@runeya/runeya 2.0.157 → 2.0.159

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 (156) hide show
  1. package/agent/index.js +318 -231
  2. package/agent/index.js.map +1 -1
  3. package/agent-manager-NR24TCUQ.js +13 -0
  4. package/chat-MRS24DL3.js +28 -0
  5. package/{chunk-SVKR7CYU.js → chunk-C3KBWZ24.js} +4 -4
  6. package/{chunk-TMX3NXMQ.js → chunk-GJ5KN2LL.js} +6 -6
  7. package/{chunk-IYL545N3.js → chunk-GPSTFDKW.js} +18 -18
  8. package/{chunk-L3BEQ75K.js → chunk-JJTSWJXV.js} +5 -5
  9. package/{chunk-N4ZP7T6L.js → chunk-KNWWJND3.js} +4 -4
  10. package/{chunk-NV7MBTNW.js → chunk-KWKSPNGO.js} +5 -5
  11. package/{chunk-EZ35ISYR.js → chunk-LY4HARY5.js} +172 -67
  12. package/chunk-LY4HARY5.js.map +1 -0
  13. package/{chunk-ETPXJSVC.js → chunk-UYOJZ34Z.js} +2 -2
  14. package/{chunk-I4FSX522.js → chunk-V7BOVXZI.js} +11 -11
  15. package/{chunk-N5LP5TPS.js → chunk-YEFYRGSP.js} +2 -2
  16. package/{chunk-JAMAGUGN.js → chunk-YEZOV6GP.js} +2 -2
  17. package/{chunk-V7WTXGEJ.js → chunk-ZW4GRZRF.js} +6 -6
  18. package/{chunk-6L273MQO.js → chunk-ZZZQMQWF.js} +3 -3
  19. package/chunk-ZZZQMQWF.js.map +1 -0
  20. package/{companion-V6ITOFSU.js → companion-CGBD5O6Y.js} +9 -9
  21. package/{desktop-installer-page-DCS2FLA5.js → desktop-installer-page-54PKY3L3.js} +3 -3
  22. package/{desktop-launcher-ER3J7KAW.js → desktop-launcher-2DWKSS6V.js} +3 -3
  23. package/{environment-resolver-HT6GTSLA.js → environment-resolver-E7JDNTRO.js} +6 -6
  24. package/{external-WZQUS7LY.js → external-5I5BUT44.js} +3 -3
  25. package/index.js +12 -12
  26. package/{install-gate-3ZDX3AUO.js → install-gate-W5D4ZOZK.js} +2 -2
  27. package/mcp-server/external.js +146 -61
  28. package/mcp-server/external.js.map +1 -1
  29. package/mcp-server/index.js +146 -61
  30. package/mcp-server/index.js.map +1 -1
  31. package/package.json +1 -1
  32. package/{project-store-6TFAYAWK.js → project-store-67M34SNQ.js} +7 -7
  33. package/settings-manager-M5RS5WRM.js +10 -0
  34. package/{src-DBSSIQC7.js → src-FTYC7P2P.js} +36 -2
  35. package/{src-YR5RF76Z.js → src-UZX6XOIK.js} +1095 -897
  36. package/src-UZX6XOIK.js.map +1 -0
  37. package/{vault-resolver-G3G5YPNG.js → vault-resolver-5Q25S6NI.js} +3 -3
  38. package/web/assets/{AgentScalarChatInterface.vue-CtkvKRSd.js → AgentScalarChatInterface.vue-DLtiWyFa.js} +1 -1
  39. package/web/assets/{AgentTerminalPage-Dt9S2kZX.js → AgentTerminalPage-Ds4QAs67.js} +1 -1
  40. package/web/assets/{AiChatModals-BEpSEXmp.js → AiChatModals-Ccx5-MPb.js} +1 -1
  41. package/web/assets/AppLayout--wQ4AU4i.js +1 -0
  42. package/web/assets/AppLayout-Pi8OZrHN.css +1 -0
  43. package/web/assets/{AuditPage-BEt0m-rM.js → AuditPage-TlsfnK1U.js} +1 -1
  44. package/web/assets/{CloudAccountPage-BGijgepw.js → CloudAccountPage-BuFn-iaB.js} +1 -1
  45. package/web/assets/{CloudMessagingPage-C9uWAT8S.js → CloudMessagingPage-BcOTKWP1.js} +1 -1
  46. package/web/assets/{DashboardPage-DFiL6A-k.js → DashboardPage-BLw_tc_p.js} +1 -1
  47. package/web/assets/{DirectoryPickerDialog-C8dwWIUa.js → DirectoryPickerDialog-X6P-Gl27.js} +1 -1
  48. package/web/assets/{EditorIcon-Cx11i-sC.js → EditorIcon-DYGui0zm.js} +1 -1
  49. package/web/assets/{EnvironmentForm-DZgZitCy.js → EnvironmentForm-CNxgYejU.js} +1 -1
  50. package/web/assets/{EnvironmentFormPage-ubP8cX3l.js → EnvironmentFormPage-Cu9tmfeS.js} +1 -1
  51. package/web/assets/{EnvironmentListPage-CPs1uuvs.js → EnvironmentListPage-RJc8Noj0.js} +1 -1
  52. package/web/assets/{FlagChip-UumVjPY9.js → FlagChip-DBj0fpJC.js} +1 -1
  53. package/web/assets/{KanbanBoardPage-C9NqOqdD.js → KanbanBoardPage-CfeFN-sn.js} +3 -3
  54. package/web/assets/{KanbanListPage-D_ZpIbT2.js → KanbanListPage-Bvf_6sKr.js} +1 -1
  55. package/web/assets/{KnowledgeListPage-BoaV9hBg.js → KnowledgeListPage-8asAbOWR.js} +1 -1
  56. package/web/assets/{KnowledgePagePage-UGJGJY4d.js → KnowledgePagePage-CH8ErT7E.js} +1 -1
  57. package/web/assets/{LaunchProjectPage-B0Lg5Kr5.js → LaunchProjectPage-Cj4zIh-L.js} +1 -1
  58. package/web/assets/{LaunchServicesPage-D_pqkdXt.js → LaunchServicesPage-C5yBRgjj.js} +1 -1
  59. package/web/assets/{LaunchShell-CJtXkSUp.js → LaunchShell-BHRT0Iyo.js} +1 -1
  60. package/web/assets/{LogViewer-DLxO4-gP.js → LogViewer-B-iEIEx5.js} +1 -1
  61. package/web/assets/{OrgKeyPrompt-Cbx4cLL0.js → OrgKeyPrompt-U4dh8VYn.js} +1 -1
  62. package/web/assets/{ProcessControls-Cx-QzqxQ.js → ProcessControls-DR2mGg4A.js} +1 -1
  63. package/web/assets/{ProcessDetailPage-Bxwv0984.js → ProcessDetailPage-UdlOtobk.js} +1 -1
  64. package/web/assets/{ProcessMetrics-DisQYLu6.js → ProcessMetrics-CAiB2nbb.js} +1 -1
  65. package/web/assets/{ProjectCreateDialog-HcYVX36i.js → ProjectCreateDialog-JJ_UgVSV.js} +1 -1
  66. package/web/assets/{ProjectLocationGate-PR92Tdos.js → ProjectLocationGate-RpWuVQOx.js} +1 -1
  67. package/web/assets/{ProjectPublishDialog-YvOeVDCP.js → ProjectPublishDialog-DXBAZVgF.js} +1 -1
  68. package/web/assets/{RandomJobTestPage-Bp9qone4.js → RandomJobTestPage-BTyZOdQT.js} +1 -1
  69. package/web/assets/{ScenarioEditorPage-Cjkkz3JB.js → ScenarioEditorPage-DO5s-Rb3.js} +1 -1
  70. package/web/assets/{SendToChatDialog-CQbi2P_L.js → SendToChatDialog-jghvXDZk.js} +1 -1
  71. package/web/assets/{ServiceControlsBar-9jsN3h0c.js → ServiceControlsBar-Bjv9tyyt.js} +1 -1
  72. package/web/assets/{ServiceDetailPage-COHMUw51.js → ServiceDetailPage-DHYpDCfp.js} +1 -1
  73. package/web/assets/{ServiceFormPage-B4n8scwP.js → ServiceFormPage-CCXaIoow.js} +1 -1
  74. package/web/assets/{SettingsPage-C3PnwdxZ.js → SettingsPage-s-668z6W.js} +38 -38
  75. package/web/assets/{SettingsPage-Dsuzjo8r.css → SettingsPage-x-Rev6ea.css} +1 -1
  76. package/web/assets/{UnlockPage-BIB0NtWF.js → UnlockPage-BNdzhO5C.js} +1 -1
  77. package/web/assets/{VaultMigrationPage-D27SeEVr.js → VaultMigrationPage-RWmGEMLC.js} +1 -1
  78. package/web/assets/{VersionBadge-FeuuTMz7.js → VersionBadge-Crpf2R7o.js} +1 -1
  79. package/web/assets/{WikiPage-A8C0dEDX.js → WikiPage-BlemtaAo.js} +1 -1
  80. package/web/assets/{WikiView-D3c0r5q8.js → WikiView-Du6Adpd-.js} +1 -1
  81. package/web/assets/{add-scalar-classes-Ohd6-7G3.js → add-scalar-classes-B5tjvEi-.js} +2 -2
  82. package/web/assets/{agent.store-BwUoohNu.js → agent.store-5ggNQfb3.js} +1 -1
  83. package/web/assets/auth-ArDkSMsT.js +2 -0
  84. package/web/assets/{cloud-chat.store-za5cBdZx.js → cloud-chat.store-XJxdooyL.js} +1 -1
  85. package/web/assets/cloud-client-CMfTrHgZ.js +2 -0
  86. package/web/assets/cloud-session-CHtF1SMt.js +2 -0
  87. package/web/assets/dist-CjS_rxe9.js +1 -0
  88. package/web/assets/{i18n-B8hHo8g2.js → i18n-f_6x1GJ8.js} +2 -2
  89. package/web/assets/{index-DozDRY7J.css → index-DiXnhxxp.css} +1 -1
  90. package/web/assets/{index-CYcPxjSC.js → index-Z4n9BqGD.js} +75 -75
  91. package/web/assets/knowledge-host-D3fiBt2z.css +1 -0
  92. package/web/assets/knowledge-host-DeJwAH8b.js +7 -0
  93. package/web/assets/{modal-B9eahS9q.js → modal-Bomcd8xq.js} +1 -1
  94. package/web/assets/{notification.store-CWs6iQmx.js → notification.store-C8qNYGB5.js} +1 -1
  95. package/web/assets/open-project-org-BNDadG2_.js +1 -0
  96. package/web/assets/{project-launch.store-DkD7Q9jW.js → project-launch.store-DBuxvZJr.js} +1 -1
  97. package/web/assets/{project.store-CnflI3la.js → project.store-CXP-Oq1W.js} +1 -1
  98. package/web/assets/{scenario.store-DGt8nNt5.js → scenario.store-B6TiJlpU.js} +1 -1
  99. package/web/assets/{service.store-yECOKc1C.js → service.store-oNOqRX_s.js} +1 -1
  100. package/web/assets/{settings-scope-Ca1LjLG1.js → settings-scope-EYddCMQs.js} +1 -1
  101. package/web/assets/{settings.store-Cyop63CA.js → settings.store-Dbe4N-TD.js} +1 -1
  102. package/web/assets/{src-CcVk2-Gw.js → src-B1nAsOcw.js} +1 -1
  103. package/web/assets/{src-8YjxNhhv.js → src-BMnPg9V0.js} +1 -1
  104. package/web/assets/src-BR35jQnn.css +1 -0
  105. package/web/assets/src-BY3QUJ9Z.css +1 -0
  106. package/web/assets/src-Cpewe6v-.js +1 -0
  107. package/web/assets/{trpc-DlM4IpMe.js → trpc-CFd5DIpB.js} +3 -3
  108. package/web/assets/{useCloudOrg-Ck6Ef1iD.js → useCloudOrg-_oj_ijeT.js} +1 -1
  109. package/web/assets/{useEnvVarAutocomplete-B0fhZK-_.js → useEnvVarAutocomplete-IIpGvDLc.js} +1 -1
  110. package/web/assets/{useProjectCatalog-D1RgJoOm.js → useProjectCatalog-DT8MiHr7.js} +1 -1
  111. package/web/assets/useProjectCloudOrg-BgBNXoL1.js +1 -0
  112. package/web/assets/{useServiceUrlHost-Xzj6EOft.js → useServiceUrlHost-CzDrWXfO.js} +1 -1
  113. package/web/assets/uuid-D2uso58z.js +1 -0
  114. package/web/index.html +20 -19
  115. package/agent-manager-KDL4JWZN.js +0 -13
  116. package/chat-X6GWKPKG.js +0 -28
  117. package/chunk-6L273MQO.js.map +0 -1
  118. package/chunk-EZ35ISYR.js.map +0 -1
  119. package/settings-manager-OTVXDUJS.js +0 -10
  120. package/src-YR5RF76Z.js.map +0 -1
  121. package/web/assets/AppLayout-B1-D2-jx.css +0 -1
  122. package/web/assets/AppLayout-DIAQvecQ.js +0 -1
  123. package/web/assets/auth-DdEdmJV5.js +0 -2
  124. package/web/assets/cloud-client-zXY8HZtj.js +0 -2
  125. package/web/assets/cloud-session-DqfQKW5D.js +0 -2
  126. package/web/assets/dist-Cx_klvkk.js +0 -1
  127. package/web/assets/knowledge-host-ButMqDET.js +0 -6
  128. package/web/assets/knowledge-host-CfNnk0oz.css +0 -1
  129. package/web/assets/src-16-vEwhK.css +0 -1
  130. package/web/assets/src-BD3q9_go.js +0 -1
  131. package/web/assets/src-DOziuDw8.css +0 -1
  132. package/web/assets/useProjectCloudOrg-tnlpo5R1.js +0 -1
  133. package/web/assets/uuid-DfCowYZy.js +0 -1
  134. /package/{agent-manager-KDL4JWZN.js.map → agent-manager-NR24TCUQ.js.map} +0 -0
  135. /package/{chat-X6GWKPKG.js.map → chat-MRS24DL3.js.map} +0 -0
  136. /package/{chunk-SVKR7CYU.js.map → chunk-C3KBWZ24.js.map} +0 -0
  137. /package/{chunk-TMX3NXMQ.js.map → chunk-GJ5KN2LL.js.map} +0 -0
  138. /package/{chunk-IYL545N3.js.map → chunk-GPSTFDKW.js.map} +0 -0
  139. /package/{chunk-L3BEQ75K.js.map → chunk-JJTSWJXV.js.map} +0 -0
  140. /package/{chunk-N4ZP7T6L.js.map → chunk-KNWWJND3.js.map} +0 -0
  141. /package/{chunk-NV7MBTNW.js.map → chunk-KWKSPNGO.js.map} +0 -0
  142. /package/{chunk-ETPXJSVC.js.map → chunk-UYOJZ34Z.js.map} +0 -0
  143. /package/{chunk-I4FSX522.js.map → chunk-V7BOVXZI.js.map} +0 -0
  144. /package/{chunk-N5LP5TPS.js.map → chunk-YEFYRGSP.js.map} +0 -0
  145. /package/{chunk-JAMAGUGN.js.map → chunk-YEZOV6GP.js.map} +0 -0
  146. /package/{chunk-V7WTXGEJ.js.map → chunk-ZW4GRZRF.js.map} +0 -0
  147. /package/{companion-V6ITOFSU.js.map → companion-CGBD5O6Y.js.map} +0 -0
  148. /package/{desktop-installer-page-DCS2FLA5.js.map → desktop-installer-page-54PKY3L3.js.map} +0 -0
  149. /package/{desktop-launcher-ER3J7KAW.js.map → desktop-launcher-2DWKSS6V.js.map} +0 -0
  150. /package/{environment-resolver-HT6GTSLA.js.map → environment-resolver-E7JDNTRO.js.map} +0 -0
  151. /package/{external-WZQUS7LY.js.map → external-5I5BUT44.js.map} +0 -0
  152. /package/{install-gate-3ZDX3AUO.js.map → install-gate-W5D4ZOZK.js.map} +0 -0
  153. /package/{project-store-6TFAYAWK.js.map → project-store-67M34SNQ.js.map} +0 -0
  154. /package/{settings-manager-OTVXDUJS.js.map → settings-manager-M5RS5WRM.js.map} +0 -0
  155. /package/{src-DBSSIQC7.js.map → src-FTYC7P2P.js.map} +0 -0
  156. /package/{vault-resolver-G3G5YPNG.js.map → vault-resolver-5Q25S6NI.js.map} +0 -0
@@ -1 +1 @@
1
- import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{Ct as n,D as r,E as i,Ht as a,Rt as o,Yt as s,_ as c,b as l,bt as u,ct as ee,en as d,g as f,it as p,k as te,mt as m,nn as h,o as g,qt as _,rn as v,tt as ne,v as y,y as b}from"./runtime-core.esm-bundler-DujKY9QV.js";import{C as x,w as re}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as ie}from"./vue-i18n-o7yraQpR.js";import{n as S}from"./project-launch.store-DkD7Q9jW.js";import{C,J as w,P as ae,U as T,W as oe,Y as E,a as se,dt as ce,ft as D,i as O,k as le,n as ue,r as k,t as A}from"./src-CcVk2-Gw.js";import{t as de}from"./uuid-B2pLMyOM.js";import{n as j,r as fe}from"./project.store-CnflI3la.js";import{h as pe,l as M,t as me,u as N}from"./dist-Cx_klvkk.js";import{t as P}from"./service.store-yECOKc1C.js";import{t as F}from"./agent.store-BwUoohNu.js";import{H as he,U as ge}from"./index-CYcPxjSC.js";import{t as I}from"./useServiceUrlHost-Xzj6EOft.js";import"./uuid-DfCowYZy.js";import{t as _e}from"./FlagChip-UumVjPY9.js";var L={key:0,class:`env-badge`},R={class:`env-badge__name`},ve=D(te({__name:`EnvironmentBadge`,props:{environmentId:{}},setup(e){let t=e,n=fe(),r=f(()=>n.getById(t.environmentId));function i(e){if(e)return e.startsWith(`#`)?e:`#${e}`}return(e,t)=>r.value?(m(),l(`span`,L,[c(`span`,{class:`env-badge__swatch`,style:h({backgroundColor:i(r.value.bgColor)||i(r.value.color)||`var(--r-primary)`})},null,4),c(`span`,R,v(r.value.name),1)])):b(``,!0)}}),[[`__scopeId`,`data-v-968d7caa`]]),z=150,ye=te({__name:`TagsInput`,props:{modelValue:{},options:{default:()=>[]},placeholder:{default:void 0},inputId:{default:void 0},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`change`],setup(n,{emit:r}){let i=n,a=r,o=t([]);function s(e){let t=e.query.trim().toLowerCase(),n=new Set(i.modelValue);o.value=i.options.filter(e=>!n.has(e)&&(!t||e.toLowerCase().includes(t)))}function c(e){a(`update:modelValue`,e),a(`change`,e)}function l(e){c(Array.isArray(e)?e.map(String):[])}function u(e){let t=e.trim();t&&!i.modelValue.includes(t)&&c([...i.modelValue,t])}function ee(e){let t=e.target;u(t.value),t.value=``,o.value=[]}function d(e){let t=e.target;t&&typeof t.value==`string`&&t.value.trim()&&setTimeout(()=>{u(t.value),t.value=``},z)}return(t,r)=>(m(),y(e(O),{"model-value":n.modelValue,multiple:``,suggestions:o.value,"complete-on-focus":!0,placeholder:n.placeholder,"input-id":n.inputId,disabled:n.disabled,"onUpdate:modelValue":l,onComplete:s,onKeydown:x(ee,[`enter`]),onBlur:d},null,8,[`model-value`,`suggestions`,`placeholder`,`input-id`,`disabled`]))}}),be=/^\{\{([^{}]+)\}\}$/,B=/\{\{([^}]+)\}\}/g,V=`environment.`;function xe(e,t){return e.startsWith(V)?t.resolvedEnv[e.slice(12)]||null:t.serviceBuiltins[e]||null}function Se(e,t){let n=e.match(be);return n?xe(n[1],t):null}function Ce(e,t){return e.replace(B,(e,n)=>xe(n,t)??e)}var H={class:`ref-group`},we={class:`ref-option`},U={key:0,class:`ti ti-lock ref-option-secret`},Te={key:1,class:`ref-option-preview`},Ee=40,W=D(te({__name:`VariableRefInput`,props:{modelValue:{},inputId:{},placeholder:{default:``},disabled:{type:Boolean,default:!1},envKeys:{default:()=>[]},meta:{default:()=>({})},resolvedEnv:{default:()=>({})},serviceBuiltins:{default:()=>({})}},emits:[`update:modelValue`,`search`,`focus`,`blur`,`picked`],setup(n,{emit:i}){let o=/\{\{([^}]*)$/,s=n,u=i,{t:ee}=ie(),d=t(``),f=t(``),p=t([]);function te(){let e=d.value.toLowerCase(),t=Object.keys(s.serviceBuiltins).filter(t=>t.toLowerCase().includes(e)).map(e=>`{{${e}}}`),n=s.envKeys.map(e=>`{{environment.${e}}}`);return[...t.length?[{label:ee(`variableRefInput.groupBuiltins`),items:t}]:[],...n.length?[{label:ee(`variableRefInput.groupEnvironment`),items:n}]:[]]}function h(){p.value=te()}a(()=>[s.envKeys,s.serviceBuiltins],h,{deep:!0});function g(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}function ne(e){let t=e.match(be);return!t||!t[1].startsWith(`environment.`)?!1:s.meta[t[1].slice(12)]?.isSecret??!1}function x(e){let t=e.match(be);if(!t)return null;let n=t[1];if(n.startsWith(`environment.`)){let e=s.meta[n.slice(12)];if(!e||e.isSecret)return null}let r=xe(n,{resolvedEnv:s.resolvedEnv,serviceBuiltins:s.serviceBuiltins});return r?re(r):null}function re(e){return e.length>Ee?`${e.slice(0,Ee)}…`:e}function S(e){if(f.value=e.query,C)C=!1,d.value=``;else{let t=e.query.match(o),n=t?t[1]:e.query;d.value=n.replace(/^(environment|service)\./,``).trim()}u(`search`,d.value),h()}let C=!1;function w(){C=!0,u(`focus`)}function ae(e){let t=f.value,n=t.lastIndexOf(`{{`);u(`update:modelValue`,n===-1?e:t.slice(0,n)+e),u(`picked`)}return(t,i)=>(m(),y(e(O),{"input-id":n.inputId,"model-value":n.modelValue,suggestions:p.value,"option-group-label":`label`,"option-group-children":`items`,placeholder:n.placeholder,class:`w-full`,"complete-on-focus":``,disabled:n.disabled,"onUpdate:modelValue":i[0]||=e=>u(`update:modelValue`,e),onComplete:S,onItemSelect:i[1]||=e=>ae(e.value),onFocus:w,onBlur:i[2]||=e=>u(`blur`)},{optiongroup:_(({option:e})=>[c(`span`,H,v(e.label),1)]),option:_(({option:t})=>[c(`span`,we,[r(e(T),{severity:`secondary`,value:g(t)},null,8,[`value`]),ne(t)?(m(),l(`i`,U)):x(t)?(m(),l(`span`,Te,v(x(t)),1)):b(``,!0)])]),_:1},8,[`input-id`,`model-value`,`suggestions`,`placeholder`,`disabled`]))}}),[[`__scopeId`,`data-v-2247bb09`]]);function G(e){let t=!1,n=!1;return async function r(){if(t){n=!0;return}t=!0;try{await e()}finally{t=!1,n&&(n=!1,await r())}}}var K={class:`key-row`},De={class:`expansion-field expansion-field--key`},Oe=[`for`],ke={key:2,class:`value-display`},Ae={key:0,class:`key-row-delete`},je={key:0,class:`flags-row`},Me={key:1,class:`expansion-field expansion-field--tags`},Ne={class:`expansion-label`,for:`varrow-tags-input`},Pe={key:1,class:`tags-display`},Fe={key:2,class:`not-secret-warning`},Ie={key:4,class:`expansion-field expansion-field--description`},Le={class:`expansion-label`},Re={key:5,class:`not-secret-warning`},ze={key:7,class:`expansion-section`},Be={class:`section-header`},Ve={class:`section-title`},He={class:`section-fields`},Ue={class:`expansion-field expansion-field--prepost`},We={class:`expansion-label`,for:`varrow-prefix`},Ge={key:2,class:`value-display`},Ke={class:`expansion-field expansion-field--value`},qe=[`for`],Je=[`aria-label`],Ye={class:`value-help`},Xe={class:`value-help__title`},Ze={class:`value-help__line`},Qe={class:`value-help__line value-help__line--muted`},$e={class:`value-help__subtitle`},et={class:`value-help__builtins`},tt={class:`value-help__line value-help__line--muted`},nt={key:0,class:`secret-input-wrap`},rt=[`disabled`],it=[`title`],at={key:1,class:`value-display value-display--with-actions`},ot={key:0,class:`value-actions`},st={key:0},ct={key:1},lt={class:`expansion-field expansion-field--prepost`},ut={class:`expansion-label`,for:`varrow-suffix`},dt={key:2,class:`value-display`},ft={key:0,class:`preview-value`},pt={key:0,class:`prepost-part prepost-part--pre`},mt={key:1,class:`prepost-part prepost-part--interpolation`},ht={class:`prepost-part--value prepost-resolved-inline`},gt=[`title`],_t={key:2,class:`prepost-part prepost-part--value`},vt={key:3,class:`prepost-part prepost-part--post`},yt={key:9,class:`expansion-section expansion-section--override`},bt={class:`section-header`},xt={class:`section-title`},St={class:`ti ti-info-circle section-title__info`},Ct={class:`section-fields`},wt={class:`expansion-field expansion-field--prepost`},Tt={class:`expansion-label`,for:`varrow-override-prefix`},Et={class:`expansion-field expansion-field--value`},Dt=[`for`],Ot={key:0,class:`secret-input-wrap`},kt=[`disabled`],At=[`title`],jt={class:`expansion-field expansion-field--prepost`},Mt={class:`expansion-label`,for:`varrow-override-suffix`},Nt={key:1,class:`override-view`},Pt={key:0,class:`value-display--with-actions`},Ft={class:`value-actions`},It={key:0,class:`override-value-masked`},Lt={key:1,class:`override-value`},Rt={key:1,class:`override-value`},zt={key:1,class:`override-empty`},Bt={key:0,class:`preview-value preview-value--override`},Vt={key:0,class:`prepost-part prepost-part--pre`},Ht={key:1,class:`prepost-part prepost-part--interpolation`},Ut={key:0,class:`prepost-part--value prepost-resolved-inline`},Wt={key:2,class:`prepost-part prepost-part--value`},Gt={key:3,class:`prepost-part prepost-part--post`},Kt=`{{environment.KEY}}`,qt=D(te({__name:`VariableRowEditor`,props:{environmentId:{},variableId:{},overrides:{},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},canEditSource:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showOverrideBadge:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},resolvedEnv:{default:()=>({})},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{default:()=>({})},isPending:{type:Boolean,default:!1},knownTags:{default:()=>[]}},emits:[`deleted`,`saved`,`autocomplete-search`,`override-changed`,`edit-source`],setup(p,{emit:te}){let h=p,x=te,S=fe(),oe=ae(),{t:E}=ie(),se=t(!1),D=t(!1),le=t(!1),ue=t(!1),k=t(!1),A=t(!1),de=t(null);function j(e,t){navigator.clipboard.writeText(t),de.value=e,setTimeout(()=>{de.value===e&&(de.value=null)},1500)}let pe=f(()=>S.getById(h.environmentId)?.variables?.[h.variableId]),M=t(``),N=t(``),P=t(``),F=t(``),I=t(!1),L=t(!1),R=t(!1),ve=t(!1),z=t(!1),B=t(``),V=t([]),xe=t(!1),H=t(!1),we=t(!1),U=f(()=>xe.value||!!B.value),Te=o(`descriptionEditor`);async function Ee(){xe.value=!0,await ne(),Te.value?.focus?.()}let qt=f(()=>rn(N.value)),q=f(()=>I.value&&!qt.value),Jt=f({get:()=>L.value||R.value,set:e=>{L.value=e}}),Yt=f(()=>R.value?E(`variableRowEditor.shareWithAiHintInjected`):q.value?E(`variableRowEditor.shareWithAiHint`):E(`variableRowEditor.shareWithAiHintPublic`)),Xt=f(()=>h.disabled||z.value);function Zt(){let e=pe.value;M.value=e?.key??``,N.value=e?.value?.value??``,P.value=e?.value?.pre??``,F.value=e?.value?.post??``,I.value=e?.value?.isSecret??!1,L.value=e?.value?.shareWithAi??!1,R.value=e?.value?.injectIntoAi??!1,ve.value=e?.value?.required??!1,z.value=e?.value?.overrideOnly??!1,xe.value=!1,H.value=!1,we.value=!1,B.value=e?.value?.description??``,V.value=[...e?.tags??[]]}function Qt(){z.value&&(N.value=``),Q()}ee(Zt),a(pe,(e,t)=>{!t&&e&&Zt()});let J=f(()=>h.overrides[h.variableId]??null),$t=f(()=>!J.value||H.value),en=f(()=>!h.editable||!!J.value||z.value||we.value);async function tn(){we.value=!0,await ne(),document.querySelector(`#varrow-override-value-secret, #varrow-override-value-plain`)?.focus()}let Y=t(``),X=t(``),Z=t(``);function nn(){let e=J.value;Y.value=e?.pre??``,X.value=e?.value??``,Z.value=e?.post??``}ee(nn),a(J,nn);function rn(e){return be.test(e)}function an(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}let on=f(()=>({resolvedEnv:h.resolvedEnv,serviceBuiltins:h.serviceBuiltins}));function sn(e){return Ce(e,on.value)}function cn(e){return Se(e,on.value)}function ln(e){let t=e.value;M.value=t,N.value=`{{environment.${t}}}`,I.value=!1;let n=h.autocompleteMeta?.[t];n&&(P.value=n.pre,F.value=n.post),Q()}let un=t(null),dn=f(()=>me.map(e=>({ref:`{{${e.name}}}`,desc:E(`builtins.${e.descriptionKey}`)}))),Q=G(async()=>{if(D.value)return;let e=M.value.trim();if(e){se.value=!0;try{await S.upsertVariable(h.environmentId,h.variableId,{key:e,...V.value.length?{tags:V.value}:{},value:{value:N.value,pre:P.value,post:F.value,isSecret:q.value,shareWithAi:L.value,injectIntoAi:R.value,required:ve.value,overrideOnly:z.value,description:B.value}}),h.isPending&&x(`saved`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.saveError`),life:4e3})}finally{se.value=!1}}});async function fn(){if(D.value=!0,h.isPending){x(`deleted`);return}se.value=!0;try{J.value&&await S.removeOverride(h.variableId),await S.removeVariable(h.environmentId,h.variableId),x(`deleted`)}catch(e){D.value=!1,oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.deleteError`),life:4e3})}finally{se.value=!1}}async function $(){let e=Y.value||X.value||Z.value;try{if(!e){J.value&&(await S.removeOverride(h.variableId),x(`override-changed`));return}await S.setOverride(h.variableId,{value:{value:X.value,pre:Y.value,post:Z.value}}),x(`override-changed`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.overrideError`),life:4e3})}}async function pn(){try{await S.removeOverride(h.variableId),x(`override-changed`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.clearOverrideError`),life:4e3})}}function mn(e){let t=e.relatedTarget;(!t||!e.currentTarget.contains(t))&&Q()}return(t,a)=>{let o=n(`tooltip`);return m(),l(`div`,{class:`expansion-form`,onFocusout:mn},[c(`div`,K,[c(`div`,De,[c(`label`,{class:`expansion-label`,for:p.editable&&p.autocompleteEnabled?`varrow-key-ac`:`varrow-key-input`},v(e(E)(`common.key`)),9,Oe),p.editable&&p.autocompleteEnabled?(m(),y(e(O),{key:0,"input-id":`varrow-key-ac`,modelValue:M.value,"onUpdate:modelValue":a[0]||=e=>M.value=e,suggestions:p.autocompleteSuggestions,placeholder:e(E)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onComplete:a[1]||=e=>x(`autocomplete-search`,e.query),onItemSelect:ln,onBlur:e(Q)},null,8,[`modelValue`,`suggestions`,`placeholder`,`disabled`,`onBlur`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-key-input`,modelValue:M.value,"onUpdate:modelValue":a[2]||=e=>M.value=e,placeholder:e(E)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,ke,v(M.value),1))]),p.showDelete&&p.editable?(m(),l(`div`,Ae,[r(e(ce),{icon:`ti ti-trash`,severity:`danger`,variant:`text`,rounded:``,size:`small`,disabled:p.disabled||se.value,onClick:fn},null,8,[`disabled`])])):b(``,!0)]),p.editable?(m(),l(`div`,je,[qt.value?b(``,!0):(m(),y(_e,{key:0,modelValue:I.value,"onUpdate:modelValue":[a[3]||=e=>I.value=e,e(Q)],label:e(E)(`variableRowEditor.secret`),icon:`ti ti-lock`,hint:e(E)(`variableRowEditor.secretHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`])),r(_e,{modelValue:Jt.value,"onUpdate:modelValue":[a[4]||=e=>Jt.value=e,e(Q)],label:e(E)(`variableRowEditor.shareWithAi`),icon:`ti ti-eye`,hint:Yt.value,locked:R.value,disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`locked`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:R.value,"onUpdate:modelValue":[a[5]||=e=>R.value=e,e(Q)],label:e(E)(`variableRowEditor.injectIntoAi`),icon:`ti ti-login`,hint:e(E)(`variableRowEditor.injectIntoAiHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:ve.value,"onUpdate:modelValue":[a[6]||=e=>ve.value=e,e(Q)],label:e(E)(`variableRowEditor.required`),icon:`ti ti-asterisk`,hint:e(E)(`variableRowEditor.requiredHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:z.value,"onUpdate:modelValue":[a[7]||=e=>z.value=e,Qt],label:e(E)(`variableRowEditor.overrideOnly`),icon:`ti ti-device-desktop`,hint:e(E)(`variableRowEditor.overrideOnlyHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`])])):b(``,!0),p.editable||V.value.length?(m(),l(`div`,Me,[c(`label`,Ne,v(e(E)(`variableRowEditor.tags`)),1),p.editable?(m(),y(ye,{key:0,modelValue:V.value,"onUpdate:modelValue":a[8]||=e=>V.value=e,"input-id":`varrow-tags-input`,options:p.knownTags,placeholder:e(E)(`variableRowEditor.tagsPlaceholder`),disabled:p.disabled,onChange:e(Q)},null,8,[`modelValue`,`options`,`placeholder`,`disabled`,`onChange`])):(m(),l(`div`,Pe,[(m(!0),l(g,null,u(V.value,t=>(m(),y(e(T),{key:t,severity:`secondary`,value:t},null,8,[`value`]))),128))]))])):b(``,!0),p.editable&&!I.value&&!rn(N.value)?(m(),l(`div`,Fe,[a[60]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.notSecretWarning`)),1)])):b(``,!0),p.editable&&!U.value?(m(),l(`button`,{key:3,type:`button`,class:`add-section-btn`,onClick:Ee},[a[61]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.addDescription`)),1)])):b(``,!0),U.value?(m(),l(`div`,Ie,[c(`label`,Le,v(e(E)(`variableRowEditor.description`)),1),r(e(ge),{ref_key:`descriptionEditor`,ref:Te,modelValue:B.value,"onUpdate:modelValue":a[9]||=e=>B.value=e,markdown:``,"min-height":`4rem`,"max-height":`14rem`,editable:p.editable&&!p.disabled,placeholder:e(E)(`variableRowEditor.descriptionPlaceholder`),onLinkClick:e(he)},null,8,[`modelValue`,`editable`,`placeholder`,`onLinkClick`])])):b(``,!0),p.editable&&z.value?(m(),l(`div`,Re,[a[62]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.overrideOnlyNotice`)),1)])):b(``,!0),$t.value?b(``,!0):(m(),l(`button`,{key:6,type:`button`,class:`add-section-btn`,onClick:a[10]||=e=>H.value=!0},[a[63]||=c(`i`,{class:`ti ti-chevron-right`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.showSharedValue`)),1)])),$t.value?(m(),l(`div`,ze,[c(`div`,Be,[c(`div`,Ve,v(e(E)(`variableRowEditor.value`)),1),J.value?(m(),l(`button`,{key:0,type:`button`,class:`add-section-btn`,onClick:a[11]||=e=>H.value=!1},[a[64]||=c(`i`,{class:`ti ti-chevron-up`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.hideSharedValue`)),1)])):b(``,!0)]),c(`div`,He,[c(`div`,Ue,[c(`label`,We,v(e(E)(`variableRowEditor.prefix`)),1),p.editable&&p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-prefix`,modelValue:P.value,"onUpdate:modelValue":a[12]||=e=>P.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[13]||=e=>x(`autocomplete-search`,e),onBlur:a[14]||=t=>e(Q)(),onPicked:a[15]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-prefix`,modelValue:P.value,"onUpdate:modelValue":a[16]||=e=>P.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,Ge,v(P.value||`—`),1))]),c(`div`,Ke,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-value-secret`:`varrow-value-plain`},[i(v(e(E)(`variableRowEditor.value`))+` `,1),p.editable?(m(),l(`button`,{key:0,type:`button`,class:`value-help-btn`,"aria-label":e(E)(`variableRowEditor.helpTitle`),onClick:a[17]||=re(e=>un.value?.toggle(e),[`prevent`,`stop`])},[...a[65]||=[c(`i`,{class:`ti ti-info-circle`},null,-1)]],8,Je)):b(``,!0)],8,qe),r(e(C),{ref_key:`valueHelp`,ref:un},{default:_(()=>[c(`div`,Ye,[c(`div`,Xe,v(e(E)(`variableRowEditor.helpTitle`)),1),c(`p`,Ze,[i(v(e(E)(`variableRowEditor.helpReference`))+` `,1),c(`code`,null,v(Kt))]),c(`p`,Qe,v(e(E)(`variableRowEditor.helpAutocomplete`)),1),c(`div`,$e,v(e(E)(`variableRowEditor.helpBuiltinsTitle`)),1),c(`ul`,et,[(m(!0),l(g,null,u(dn.value,e=>(m(),l(`li`,{key:e.ref},[c(`code`,null,v(e.ref),1),c(`span`,null,v(e.desc),1)]))),128))]),c(`p`,tt,v(e(E)(`variableRowEditor.helpPrePost`)),1)])]),_:1},512),p.editable?(m(),l(g,{key:0},[q.value?(m(),l(`div`,nt,[r(e(w),{id:`varrow-value-secret`,modelValue:N.value,"onUpdate:modelValue":a[18]||=e=>N.value=e,type:k.value?`text`:`password`,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onBlur:e(Q)},null,8,[`modelValue`,`type`,`placeholder`,`disabled`,`onBlur`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[19]||=e=>k.value=!k.value,tabindex:`-1`},[c(`i`,{class:d(k.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,rt)])):rn(N.value)&&!le.value?(m(),l(`span`,{key:1,class:`interpolation-badge`,title:N.value,onClick:a[20]||=e=>le.value=!0},[r(e(T),{severity:`secondary`,value:an(N.value)},null,8,[`value`]),a[66]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,it)):p.autocompleteEnabled?(m(),y(W,{key:2,"input-id":`varrow-value-plain`,modelValue:N.value,"onUpdate:modelValue":a[21]||=e=>N.value=e,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:Xt.value,onSearch:a[22]||=e=>x(`autocomplete-search`,e),onFocus:a[23]||=e=>le.value=!0,onBlur:a[24]||=t=>{le.value=!1,e(Q)()},onPicked:a[25]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:3,id:`varrow-value-plain`,modelValue:N.value,"onUpdate:modelValue":a[26]||=e=>N.value=e,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onFocus:a[27]||=e=>le.value=!0,onBlur:a[28]||=t=>{le.value=!1,e(Q)()}},null,8,[`modelValue`,`placeholder`,`disabled`]))],64)):(m(),l(`span`,at,[N.value?(m(),l(`span`,ot,[q.value?(m(),l(`i`,{key:0,class:d([k.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[29]||=e=>k.value=!k.value},null,2)):b(``,!0),c(`i`,{class:d([de.value===`val`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[30]||=e=>j(`val`,P.value+N.value+F.value)},null,2)])):b(``,!0),rn(N.value)?(m(),y(e(T),{key:1,severity:`secondary`,value:an(N.value)},null,8,[`value`])):q.value?(m(),l(g,{key:2},[k.value?(m(),l(`span`,ct,v(N.value),1)):(m(),l(`span`,st,`***`))],64)):(m(),l(g,{key:3},[i(v(N.value),1)],64))]))]),c(`div`,lt,[c(`label`,ut,v(e(E)(`variableRowEditor.suffix`)),1),p.editable&&p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-suffix`,modelValue:F.value,"onUpdate:modelValue":a[31]||=e=>F.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[32]||=e=>x(`autocomplete-search`,e),onBlur:a[33]||=t=>e(Q)(),onPicked:a[34]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-suffix`,modelValue:F.value,"onUpdate:modelValue":a[35]||=e=>F.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,dt,v(F.value||`—`),1))])]),q.value?b(``,!0):(m(),l(`code`,ft,[P.value?(m(),l(`span`,pt,v(sn(P.value)),1)):b(``,!0),rn(N.value)?(m(),l(`span`,mt,[cn(N.value)==null?(m(),l(g,{key:1},[r(e(T),{severity:`secondary`,value:an(N.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[67]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(m(),l(g,{key:0},[c(`span`,ht,v(cn(N.value)),1),p.canEditSource?(m(),l(`i`,{key:0,class:`ti ti-pencil edit-source-icon`,title:e(E)(`variablesTable.editParentTitle`),onClick:a[36]||=re(e=>x(`edit-source`),[`stop`])},null,8,gt)):b(``,!0)],64))])):(m(),l(`span`,_t,v(sn(N.value)||`…`),1)),F.value?(m(),l(`span`,vt,v(sn(F.value)),1)):b(``,!0)]))])):b(``,!0),p.showOverrides&&M.value?.trim()&&p.editable&&!en.value?(m(),l(`button`,{key:8,type:`button`,class:`add-section-btn`,onClick:tn},[a[68]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.addOverride`)),1)])):b(``,!0),p.showOverrides&&M.value?.trim()&&en.value?(m(),l(`div`,yt,[c(`div`,bt,[c(`div`,xt,[i(v(e(E)(`variableRowEditor.localOverride`))+` `,1),s(c(`i`,St,null,512),[[o,{value:e(E)(`variableRowEditor.localOverrideHint`),showDelay:0,hideDelay:0},void 0,{top:!0}]])]),p.editable&&J.value?(m(),y(e(ce),{key:0,icon:`ti ti-x`,variant:`text`,rounded:``,size:`small`,severity:`danger`,title:e(E)(`variableRowEditor.clearOverride`),disabled:p.disabled,onClick:pn},null,8,[`title`,`disabled`])):b(``,!0)]),c(`div`,Ct,[p.editable?(m(),l(g,{key:0},[c(`div`,wt,[c(`label`,Tt,v(e(E)(`variableRowEditor.prefix`)),1),p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[37]||=e=>Y.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[38]||=e=>x(`autocomplete-search`,e),onBlur:a[39]||=e=>$(),onPicked:a[40]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:1,id:`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[41]||=e=>Y.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,Et,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-override-value-secret`:`varrow-override-value-plain`},v(e(E)(`variableRowEditor.value`)),9,Dt),q.value?(m(),l(`div`,Ot,[r(e(w),{id:`varrow-override-value-secret`,modelValue:X.value,"onUpdate:modelValue":a[42]||=e=>X.value=e,type:A.value?`text`:`password`,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`type`,`placeholder`,`disabled`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[43]||=e=>A.value=!A.value,tabindex:`-1`},[c(`i`,{class:d(A.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,kt)])):rn(X.value)&&!ue.value?(m(),l(`span`,{key:1,class:`interpolation-badge`,title:X.value,onClick:a[44]||=e=>ue.value=!0},[r(e(T),{severity:`secondary`,value:an(X.value)},null,8,[`value`]),a[69]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,At)):p.autocompleteEnabled?(m(),y(W,{key:2,"input-id":`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[45]||=e=>X.value=e,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[46]||=e=>x(`autocomplete-search`,e),onFocus:a[47]||=e=>ue.value=!0,onBlur:a[48]||=e=>{ue.value=!1,$()},onPicked:a[49]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:3,id:`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[50]||=e=>X.value=e,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onFocus:a[51]||=e=>ue.value=!0,onBlur:a[52]||=e=>{ue.value=!1,$()}},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,jt,[c(`label`,Mt,v(e(E)(`variableRowEditor.suffix`)),1),p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[53]||=e=>Z.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[54]||=e=>x(`autocomplete-search`,e),onBlur:a[55]||=e=>$(),onPicked:a[56]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:1,id:`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[57]||=e=>Z.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))])],64)):(m(),l(`div`,Nt,[J.value?(m(),l(`span`,Pt,[c(`span`,Ft,[q.value||J.value.isSecret?(m(),l(`i`,{key:0,class:d([A.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[58]||=e=>A.value=!A.value},null,2)):b(``,!0),c(`i`,{class:d([de.value===`ovr`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[59]||=e=>j(`ovr`,J.value.pre+J.value.value+J.value.post)},null,2)]),q.value||J.value.isSecret?(m(),l(g,{key:0},[A.value?(m(),l(`code`,Lt,v(J.value.pre)+v(J.value.value)+v(J.value.post),1)):(m(),l(`span`,It,`***`))],64)):(m(),l(`code`,Rt,v(J.value.pre)+v(J.value.value)+v(J.value.post),1))])):(m(),l(`span`,zt,`—`))]))]),p.editable&&!q.value&&(Y.value||X.value||Z.value)?(m(),l(`code`,Bt,[Y.value?(m(),l(`span`,Vt,v(sn(Y.value)),1)):b(``,!0),rn(X.value)?(m(),l(`span`,Ht,[cn(X.value)==null?(m(),l(g,{key:1},[r(e(T),{severity:`secondary`,value:an(X.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[70]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(m(),l(`span`,Ut,v(cn(X.value)),1))])):(m(),l(`span`,Wt,v(sn(X.value)||`…`),1)),Z.value?(m(),l(`span`,Gt,v(sn(Z.value)),1)):b(``,!0)])):b(``,!0)])):b(``,!0)],32)}}}),[[`__scopeId`,`data-v-88b44eb7`]]);function q(e){return e.tags?.length?[...e.tags].sort((e,t)=>e.localeCompare(t))[0]:null}function Jt(e,t){if(!e.key||!t.key)return Number(!e.key)-Number(!t.key);let n=q(e),r=q(t);return n===r?e.key.localeCompare(t.key):n===null?1:r===null?-1:n.localeCompare(r)}function Yt(e,t){return!t.length||!!e?.some(e=>t.includes(e))}var Xt=/\{\{environment\.([^}]+)\}\}/g;function Zt(e){let t=new Set;for(let n of e)for(let e of n.matchAll(Xt))t.add(e[1]);return[...t]}function Qt(e,t,n=[]){let r=new Set;for(let i of Zt(e))for(let e of t[i]??[])n.includes(e)||r.add(e);return[...r].sort((e,t)=>e.localeCompare(t))}function J(e,t){let n=e.filter(e=>t.includes(e));return n.length===e.length?e:n}var $t={class:`table-toolbar`},en={key:1,class:`overrides-filter`},tn={for:`overrides-filter`},Y={class:`text-center py-4 text-gray-500`},X={class:`row-key-cell`},Z={class:`row-key-line`},nn={class:`row-key`},rn=[`title`],an=[`title`],on={key:0,class:`row-tags`},sn={key:2,class:`resolved-from-line`},cn={class:`row-value`},ln=[`title`,`onClick`],un=[`title`,`onClick`],dn={key:1,class:`value-levels`},Q={class:`resolved-level`},fn={key:0,class:`secret-mask`},$=[`title`],pn={key:0,class:`secret-mask`},mn=[`title`],hn=[`title`],gn={key:6,class:`empty-value`},_n={key:0,class:`override-indicator`},vn=[`title`,`onClick`],yn=[`title`,`onClick`],bn={key:0,class:`override-value-masked`},xn=[`title`],Sn=[`title`],Cn={key:0,class:`parent-edit`},wn={class:`parent-edit__field`},Tn={class:`parent-edit__label`,for:`parent-edit-value`},En={class:`parent-edit__usages`},Dn={class:`parent-edit__usages-title`},On={key:0,class:`parent-edit__usages-loading`},kn={key:0,class:`parent-edit__usage-list`},An={class:`parent-edit__usage-env`},jn={key:0,class:`parent-edit__usage-svc`},Mn={key:1,class:`parent-edit__usages-empty`},Nn=40,Pn=200,Fn=24,In=D(te({__name:`VariablesTable`,props:{environmentId:{},resolvedEnv:{default:()=>({})},sources:{default:()=>({})},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},showOverrideBadge:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{},scrollHeight:{default:`auto`},resolvedVariables:{default:()=>({})}},emits:[`autocomplete-search`,`variables-changed`],setup(n,{emit:te}){let h=be,x=/^\{\{environment\.([^{}]+)\}\}$/,S=Object.fromEntries(me.map(e=>[e.name,``])),C=n,D=te,{t:O}=ie(),j=fe(),pe=f(()=>Object.keys(C.sources).length>0),M=f(()=>Object.keys(C.resolvedEnv).length>0),N=o(`rootRef`),P=t(null),F=f(()=>C.scrollHeight===`auto`?P.value??`460px`:C.scrollHeight);function he(){if(C.scrollHeight!==`auto`)return;let e=N.value;if(!e)return;let t=(e.querySelector(`.r-datatable__container`)??e).getBoundingClientRect().top,n=window.innerHeight-t-Fn;P.value=`${Math.max(Pn,Math.round(n))}px`}let ge=null;ee(()=>{ne(he),window.addEventListener(`resize`,he),typeof ResizeObserver<`u`&&N.value&&(ge=new ResizeObserver(()=>he()),ge.observe(document.body))}),p(()=>{window.removeEventListener(`resize`,he),ge?.disconnect(),ge=null});let I=t(``),_e=t(!1),L=t([]),R=t({});async function z(){if(C.showOverrides)try{let e=await j.getOverrides(),t={};for(let[n,r]of Object.entries(e)){let e=r;t[n]={value:e.value.value,pre:e.value.pre,post:e.value.post,isSecret:e.value.isSecret}}R.value=t}catch{}}ee(z);let ye=f(()=>j.getById(C.environmentId));function B(e){return ye.value?.variables?.[e]}let V=f(()=>{let e=new Set;for(let t of j.environments)for(let n of Object.values(t.variables??{}))for(let t of n.tags??[])e.add(t);return[...e].sort((e,t)=>e.localeCompare(t))}),xe=f(()=>{let e={...Se.value};for(let t of Object.values(ye.value?.variables??{}))e[t.key]=t.tags??[];return e}),Se=f(()=>{let e=ye.value?.variables??{},t={};for(let[n,r]of Object.entries(C.resolvedVariables))n in e||(t[r.key]=r.tags??[]);return t});function Ce(e){let t=B(e);if(!t)return[];let n=R.value[e],r=[t.value?.value??``,t.value?.pre??``,t.value?.post??``];return n&&r.push(n.value,n.pre,n.post),Qt(r,{...xe.value,[t.key]:Se.value[t.key]??[]},t.tags??[])}function H(e){return[...B(e)?.tags??[],...Ce(e)]}let we=f(()=>{let e=new Set;for(let t of Object.keys(ye.value?.variables??{}))for(let n of H(t))e.add(n);return[...e].sort((e,t)=>e.localeCompare(t))});a(we,e=>{L.value=J(L.value,e)});let U=t([]),Te=f(()=>{let e=Object.keys(ye.value?.variables??{}).map(e=>({variableId:e})),t=new Set(e.map(e=>e.variableId)),n=U.value.filter(e=>!t.has(e)).map(e=>({variableId:e}));return[...e,...n]}),Ee=o(`tableRef`),W=t({}),G=t([]),K=t(new Set);function De(e){let t=new Set(K.value);t.has(e)?t.delete(e):t.add(e),K.value=t}let Oe=t(null);function ke(e,t){navigator.clipboard.writeText(t),Oe.value=e,setTimeout(()=>{Oe.value===e&&(Oe.value=null)},1500)}function Ae(e){let t=B(e);if(!t)return``;let n=t.value?.value??``;return Je(n)?Xe(n)??n:(t.value?.pre??``)+n+(t.value?.post??``)}let je=ae(),Me=t(null),Ne=t(!1),Pe=t(!1),Fe=t(!1),Ie=0,Le=t([]);async function Re(e){let t=C.sources[e]?.resolvedFrom,n=B(e)?.value?.value??``;if(!t||!n)return;let r=Ye(n),i=j.getById(t.environmentId),a=Object.entries(i?.variables??{}).find(([,e])=>e.key===r);if(!a){je.add({severity:`warn`,summary:O(`variablesTable.editParentNotFound`),life:4e3});return}let[o,s]=a;Me.value={key:r,environmentId:t.environmentId,environmentName:t.environmentName,variableId:o,value:s.value?.value??``,pre:s.value?.pre??``,post:s.value?.post??``,isSecret:s.value?.isSecret??!1,shareWithAi:s.value?.shareWithAi??!1,injectIntoAi:s.value?.injectIntoAi??!1,...s.tags?.length?{tags:s.tags}:{}},Le.value=[],Ne.value=!0,ze(r,t.environmentId)}async function ze(e,t){let n=++Ie;Fe.value=!0;try{let r=j.currentProjectId;if(!r)return;let i=await j.keyUsages(r,e,t);if(n!==Ie)return;Le.value=[...i.inheritedBy.map(e=>({kind:`inherits`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.definedIn.map(e=>({kind:`defines`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.referencedBy.map(e=>({kind:`references`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{},viaKey:e.key}))]}catch{n===Ie&&(Le.value=[])}finally{n===Ie&&(Fe.value=!1)}}async function Be(){let e=Me.value;if(e){Pe.value=!0;try{await j.upsertVariable(e.environmentId,e.variableId,{key:e.key,...e.tags?{tags:e.tags}:{},value:{value:e.value,pre:e.pre,post:e.post,isSecret:e.isSecret,shareWithAi:e.shareWithAi,injectIntoAi:e.injectIntoAi}}),Ne.value=!1,D(`variables-changed`)}catch(e){je.add({severity:`error`,summary:O(`common.error`),detail:e.message,life:4e3})}finally{Pe.value=!1}}}function Ve(e){let t=R.value[e];return t?t.pre+t.value+t.post:``}let He=f(()=>{let e=[...Te.value];if(_e.value&&(e=e.filter(e=>!!R.value[e.variableId])),L.value.length&&(e=e.filter(e=>U.value.includes(e.variableId)||Yt(H(e.variableId),L.value))),I.value.trim()){let t=I.value.toLowerCase();e=e.filter(e=>{let n=B(e.variableId);if(!n)return!1;if(n.key.toLowerCase().includes(t)||H(e.variableId).some(e=>e.toLowerCase().includes(t))||(n.value?.value??``).toLowerCase().includes(t))return!0;let r=R.value[e.variableId];return!!(r&&r.value.toLowerCase().includes(t))})}if(G.value.length>0)e.sort((e,t)=>{let n=G.value.indexOf(e.variableId),r=G.value.indexOf(t.variableId);return n===-1?1:r===-1?-1:n-r});else{let t=e=>({key:B(e)?.key??``,tags:H(e)});e.sort((e,n)=>Jt(t(e.variableId),t(n.variableId)))}return e});function Ue(e){let t=e.data.variableId;W.value[t]?(W.value={},G.value=[],We(t)):(G.value=He.value.map(e=>e.variableId),W.value={[t]:!0})}function We(e){ne(()=>{let t=Ee.value?.$el;if(!t)return;let n=He.value.findIndex(t=>t.variableId===e);n<0||t.querySelectorAll(`tbody tr[data-index]`)[n]?.scrollIntoView({block:`nearest`,behavior:`smooth`})})}function Ge(e){U.value=U.value.filter(t=>t!==e),W.value[e]&&(W.value={},G.value=[])}function Ke(e){U.value=U.value.filter(t=>t!==e)}function qe(){let e=de();U.value=[...U.value,e],G.value=[...Te.value.map(e=>e.variableId),e],ne(()=>{W.value={[e]:!0},ne(()=>{let e=document.querySelector(`.variables-expand-table .r-datatable__row-expansion:last-of-type`);e&&e.scrollIntoView({block:`nearest`,behavior:`smooth`})})})}function Je(e){return h.test(e)}function Ye(e){let t=e.match(h);return t?t[1].replace(/^(?:environment|service)\./,``):e}function Xe(e){let t=e.match(x);if(t)return C.resolvedEnv[t[1]]??null;let n=e.match(h);if(n){let e={...S,...C.serviceBuiltins};if(e[n[1]])return e[n[1]]}return null}function Ze(e){return e.length<=Nn?e:e.substring(0,Nn)+`…`}return(t,a)=>(m(),l(g,null,[c(`div`,{ref_key:`rootRef`,ref:N,class:`variables-table`},[c(`div`,$t,[r(e(w),{modelValue:I.value,"onUpdate:modelValue":a[0]||=e=>I.value=e,placeholder:`Search variables...`,class:`search-input`,size:`small`},null,8,[`modelValue`]),we.value.length?(m(),y(e(se),{key:0,modelValue:L.value,"onUpdate:modelValue":a[1]||=e=>L.value=e,options:we.value,placeholder:e(O)(`variablesTable.filterByTag`),display:`chip`,"max-selected-labels":2,"show-clear":``,size:`small`,class:`tag-filter`},null,8,[`modelValue`,`options`,`placeholder`])):b(``,!0),n.showOverrides?(m(),l(`div`,en,[r(e(le),{modelValue:_e.value,"onUpdate:modelValue":a[2]||=e=>_e.value=e,"input-id":`overrides-filter`},null,8,[`modelValue`]),c(`label`,tn,v(e(O)(`variablesTable.overriddenOnly`)),1)])):b(``,!0)]),r(e(ue),{ref_key:`tableRef`,ref:Ee,"expanded-rows":W.value,"onUpdate:expandedRows":a[6]||=e=>W.value=e,value:He.value,"data-key":`variableId`,size:`small`,class:`variables-expand-table`,scrollable:``,"scroll-height":F.value,onRowClick:Ue},{empty:_(()=>[c(`div`,Y,v(n.showAddButton?e(O)(`variablesTable.empty`):e(O)(`variablesTable.emptyReadonly`)),1)]),expansion:_(({data:t})=>[r(qt,{"environment-id":n.environmentId,"variable-id":t.variableId,overrides:R.value,editable:n.editable,"show-overrides":n.showOverrides,"show-delete":n.showDelete,"show-override-badge":n.showOverrideBadge,disabled:n.disabled,"resolved-env":n.resolvedEnv,"autocomplete-enabled":n.autocompleteEnabled,"autocomplete-suggestions":n.autocompleteSuggestions,"autocomplete-meta":n.autocompleteMeta,"service-builtins":{...e(S),...n.serviceBuiltins},"is-pending":U.value.includes(t.variableId),"known-tags":V.value,onDeleted:e=>Ge(t.variableId),onSaved:e=>Ke(t.variableId),onAutocompleteSearch:a[5]||=e=>D(`autocomplete-search`,e),onOverrideChanged:z,"can-edit-source":!!n.sources[t.variableId]?.resolvedFrom,onEditSource:e=>Re(t.variableId)},null,8,[`environment-id`,`variable-id`,`overrides`,`editable`,`show-overrides`,`show-delete`,`show-override-badge`,`disabled`,`resolved-env`,`autocomplete-enabled`,`autocomplete-suggestions`,`autocomplete-meta`,`service-builtins`,`is-pending`,`known-tags`,`onDeleted`,`onSaved`,`can-edit-source`,`onEditSource`])]),default:_(()=>[r(e(k),{expander:``,style:{width:`2.5rem`}}),r(e(k),{field:`variableId`,header:e(O)(`common.key`)},{body:_(({data:t})=>[c(`div`,X,[c(`span`,Z,[c(`code`,nn,v(B(t.variableId)?.key||`(new variable)`),1),n.sources[t.variableId]?.overriddenBy?(m(),l(`span`,{key:0,class:`overridden-badge overridden-badge--local`,title:e(O)(`variablesTable.localOverrideTooltip`,{env:n.sources[t.variableId].overriddenBy.environmentName})},[a[10]||=c(`i`,{class:`ti ti-device-desktop`},null,-1),i(` `+v(e(O)(`variablesTable.localOverride`)),1)],8,rn)):n.showOverrideBadge&&n.sources[t.variableId]?.overridden&&!Je(B(t.variableId)?.value?.value??``)?(m(),l(`span`,{key:1,class:`overridden-badge`,title:e(O)(`variablesTable.overrideTooltip`)},[a[11]||=c(`i`,{class:`ti ti-alert-triangle`},null,-1),i(` `+v(e(O)(`variablesTable.override`)),1)],8,an)):b(``,!0)]),H(t.variableId).length?(m(),l(`span`,on,[(m(!0),l(g,null,u(B(t.variableId)?.tags??[],t=>(m(),y(e(T),{key:t,severity:`secondary`,value:t,class:`row-tag`},null,8,[`value`]))),128)),(m(!0),l(g,null,u(Ce(t.variableId),t=>s((m(),y(e(T),{key:`inherited:`+t,severity:`secondary`,value:t,class:`row-tag row-tag--inherited`},null,8,[`value`])),[[e(A),e(O)(`variablesTable.inheritedTag`),void 0,{top:!0}]])),128))])):b(``,!0),pe.value&&n.sources[t.variableId]?(m(),y(ve,{key:1,"environment-id":n.sources[t.variableId].environmentId,class:`source-badge`},null,8,[`environment-id`])):b(``,!0),pe.value&&n.sources[t.variableId]?.resolvedFrom?(m(),l(`span`,sn,[a[12]||=c(`i`,{class:`ti ti-arrow-right resolved-from-arrow`},null,-1),r(ve,{"environment-id":n.sources[t.variableId].resolvedFrom.environmentId,class:`source-badge`},null,8,[`environment-id`])])):b(``,!0)])]),_:1},8,[`header`]),r(e(k),{header:e(O)(`common.value`)},{body:_(({data:t})=>[c(`span`,cn,[Ae(t.variableId)?(m(),l(`span`,{key:0,class:`value-actions`,onClick:a[3]||=re(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret?(m(),l(`i`,{key:0,class:d([K.value.has(t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(O)(`variablesTable.reveal`),onClick:e=>De(t.variableId)},null,10,ln)):b(``,!0),c(`i`,{class:d([Oe.value===t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(O)(`actions.copy`),onClick:e=>ke(t.variableId,Ae(t.variableId))},null,10,un)])):b(``,!0),Je(B(t.variableId)?.value?.value??``)&&Xe(B(t.variableId)?.value?.value??``)!=null?(m(),l(`span`,dn,[r(e(T),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``),class:`interpolation-hint-tag`},null,8,[`value`]),c(`span`,Q,[B(t.variableId)?.value?.isSecret&&!K.value.has(t.variableId)?(m(),l(`span`,fn,`***`)):(m(),l(`code`,{key:1,class:`resolved-final`,title:Xe(B(t.variableId)?.value?.value??``)},v(Ze(Xe(B(t.variableId)?.value?.value??``))),9,$))])])):Je(B(t.variableId)?.value?.value??``)&&M.value&&Xe(B(t.variableId)?.value?.value??``)==null?(m(),l(g,{key:2},[a[13]||=c(`i`,{class:`ti ti-alert-triangle unresolved-icon`},null,-1),r(e(T),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`]),a[14]||=c(`span`,{class:`unresolved-msg`},`Variable not found in this environment`,-1)],64)):Je(B(t.variableId)?.value?.value??``)?(m(),y(e(T),{key:3,severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`])):B(t.variableId)?.value?.isSecret?(m(),l(g,{key:4},[K.value.has(t.variableId)?(m(),l(`code`,{key:1,title:Ae(t.variableId)},v(Ze(Ae(t.variableId))),9,mn)):(m(),l(`span`,pn,`***`))],64)):B(t.variableId)?.value?.value||B(t.variableId)?.value?.pre||B(t.variableId)?.value?.post?(m(),l(`code`,{key:5,title:Ae(t.variableId)},v(Ze(Ae(t.variableId))),9,hn)):(m(),l(`span`,gn,`(empty)`))]),n.showOverrides&&!Je(B(t.variableId)?.value?.value??``)&&R.value[t.variableId]?(m(),l(`span`,_n,[a[15]||=c(`i`,{class:`ti ti-arrow-right`,style:{"font-size":`0.7rem`}},null,-1),c(`span`,{class:`value-actions`,onClick:a[4]||=re(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(m(),l(`i`,{key:0,class:d([K.value.has(`ovr:`+t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(O)(`variablesTable.reveal`),onClick:e=>De(`ovr:`+t.variableId)},null,10,vn)):b(``,!0),c(`i`,{class:d([Oe.value===`ovr:`+t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(O)(`actions.copy`),onClick:e=>ke(`ovr:`+t.variableId,Ve(t.variableId))},null,10,yn)]),B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(m(),l(g,{key:0},[K.value.has(`ovr:`+t.variableId)?(m(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},v(Ze(Ve(t.variableId))),9,xn)):(m(),l(`span`,bn,`***`))],64)):(m(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},v(Ze(Ve(t.variableId))),9,Sn))])):b(``,!0)]),_:1},8,[`header`])]),_:1},8,[`expanded-rows`,`value`,`scroll-height`]),n.showAddButton?(m(),y(e(ce),{key:0,type:`button`,label:e(O)(`variablesTable.addVariable`),icon:`ti ti-plus`,variant:`text`,disabled:n.disabled,class:`mt-3`,onClick:qe},null,8,[`label`,`disabled`])):b(``,!0)],512),r(e(E),{visible:Ne.value,"onUpdate:visible":a[9]||=e=>Ne.value=e,modal:``,header:e(O)(`variablesTable.editParentHeader`),style:{width:`38rem`,maxWidth:`95vw`}},{footer:_(()=>[r(e(ce),{label:e(O)(`actions.cancel`),variant:`text`,disabled:Pe.value,onClick:a[8]||=e=>Ne.value=!1},null,8,[`label`,`disabled`]),r(e(ce),{label:e(O)(`variablesTable.editParentConfirm`),severity:`warn`,loading:Pe.value,onClick:Be},null,8,[`label`,`loading`])]),default:_(()=>[Me.value?(m(),l(`div`,Cn,[r(e(oe),{severity:`warn`,class:`parent-edit__warning`},{default:_(()=>[i(v(e(O)(`variablesTable.editParentWarning`,{key:Me.value.key,env:Me.value.environmentName})),1)]),_:1}),c(`div`,wn,[c(`label`,Tn,v(e(O)(`common.value`)),1),r(e(w),{id:`parent-edit-value`,modelValue:Me.value.value,"onUpdate:modelValue":a[7]||=e=>Me.value.value=e,class:`w-full`,disabled:Pe.value},null,8,[`modelValue`,`disabled`])]),c(`div`,En,[c(`div`,Dn,[a[16]||=c(`i`,{class:`ti ti-sitemap`},null,-1),i(` `+v(e(O)(`variablesTable.editParentImpact`)),1)]),Fe.value?(m(),l(`div`,On,[a[17]||=c(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),c(`span`,null,v(e(O)(`variablesTable.editParentLoading`)),1)])):(m(),l(g,{key:1},[Le.value.length?(m(),l(`ul`,kn,[(m(!0),l(g,null,u(Le.value,(t,n)=>(m(),l(`li`,{key:n},[r(e(T),{severity:t.kind===`references`?`info`:`secondary`,value:t.kind===`references`?t.viaKey:t.kind===`inherits`?e(O)(`variablesTable.editParentInherits`):e(O)(`variablesTable.editParentDefines`)},null,8,[`severity`,`value`]),c(`span`,An,v(t.environmentName),1),t.serviceName?(m(),l(`span`,jn,v(t.serviceName),1)):b(``,!0)]))),128))])):(m(),l(`div`,Mn,v(e(O)(`variablesTable.editParentNoUsage`)),1))],64))])])):b(``,!0)]),_:1},8,[`visible`,`header`])],64))}}),[[`__scopeId`,`data-v-1d1460fd`]]);function Ln(e,t){let n=j(),r=S(),i=P(),a=f(()=>{let t=n.getByRef({id:e(),orgId:r.activeOrgId});return t?t.serviceIds.map(e=>i.getById(e)).filter(e=>!!e):[]});return f(()=>{let e=M(a.value.map(e=>e.name)),n={};for(let r of a.value){let i=pe(r.name);i&&!e.has(i)&&Object.assign(n,N({name:r.name,id:r.id,ports:r.ports,localUrls:r.localUrls,url:r.url},t()))}return n})}function Rn(e){let t=F(),n=fe(),r=j(),i=S(),a=f(()=>{let r=e.environmentId()?n.getById(e.environmentId())?.agentId:void 0,i=e.agentId?.()??r;return i?t.getById(i):t.agents.find(e=>e.isLocal)??null}),{urlHost:o,serverHost:s}=I(()=>a.value?.config.id),c=Ln(e.projectId,()=>o.value);return{values:f(()=>{let t={};for(let e of me)t[e.name]=``;t[`runeya.HOST`]=s.value;let o=a.value?.status;o?.lanIp&&(t[`agent.HOST_LAN`]=o.lanIp),o?.os&&(t[`agent.OS`]=o.os),o?.home&&(t[`agent.HOME`]=o.home),a.value&&(t[`agent.NAME`]=a.value.config.name);let l=r.getByRef({id:e.projectId(),orgId:i.activeOrgId});l&&(t[`project.NAME`]=l.name);let u=e.environmentId()?n.getById(e.environmentId()):null;return u&&(t[`runeya.ENV_NAME`]=u.name),Object.assign(t,c.value),t}),agentEntry:a,urlHost:o}}function zn(e){let n=t([]),r=t({});function i(t){let i=e();if(!i)return;let a=t.toLowerCase(),o=Object.keys(i.env).filter(e=>e.toLowerCase().includes(a));n.value=o;let s=i.variables,c={};if(s)for(let e of o){let t=Object.values(s).find(t=>t.key===e);t&&(c[e]={key:e,isSecret:t.value?.isSecret??!1,pre:t.value?.pre??``,post:t.value?.post??``})}r.value=c}return{suggestions:n,meta:r,search:i}}export{ve as a,ye as i,Rn as n,In as r,zn as t};
1
+ import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{Ct as n,D as r,E as i,Ht as a,Rt as o,Yt as s,_ as c,b as l,bt as u,ct as ee,en as d,g as f,it as p,k as te,mt as m,nn as h,o as g,qt as _,rn as v,tt as ne,v as y,y as b}from"./runtime-core.esm-bundler-DujKY9QV.js";import{C as x,w as re}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as ie}from"./vue-i18n-o7yraQpR.js";import{n as S}from"./project-launch.store-DBuxvZJr.js";import{C,J as w,P as ae,U as T,W as oe,Y as E,a as se,dt as ce,ft as D,i as O,k as le,n as ue,r as k,t as A}from"./src-B1nAsOcw.js";import{t as de}from"./uuid-B2pLMyOM.js";import{n as j,r as fe}from"./project.store-CXP-Oq1W.js";import{h as pe,l as M,t as me,u as N}from"./dist-CjS_rxe9.js";import{t as P}from"./service.store-oNOqRX_s.js";import{t as F}from"./agent.store-5ggNQfb3.js";import{H as he,U as ge}from"./index-Z4n9BqGD.js";import{t as I}from"./useServiceUrlHost-CzDrWXfO.js";import"./uuid-D2uso58z.js";import{t as _e}from"./FlagChip-DBj0fpJC.js";var L={key:0,class:`env-badge`},R={class:`env-badge__name`},ve=D(te({__name:`EnvironmentBadge`,props:{environmentId:{}},setup(e){let t=e,n=fe(),r=f(()=>n.getById(t.environmentId));function i(e){if(e)return e.startsWith(`#`)?e:`#${e}`}return(e,t)=>r.value?(m(),l(`span`,L,[c(`span`,{class:`env-badge__swatch`,style:h({backgroundColor:i(r.value.bgColor)||i(r.value.color)||`var(--r-primary)`})},null,4),c(`span`,R,v(r.value.name),1)])):b(``,!0)}}),[[`__scopeId`,`data-v-968d7caa`]]),z=150,ye=te({__name:`TagsInput`,props:{modelValue:{},options:{default:()=>[]},placeholder:{default:void 0},inputId:{default:void 0},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`change`],setup(n,{emit:r}){let i=n,a=r,o=t([]);function s(e){let t=e.query.trim().toLowerCase(),n=new Set(i.modelValue);o.value=i.options.filter(e=>!n.has(e)&&(!t||e.toLowerCase().includes(t)))}function c(e){a(`update:modelValue`,e),a(`change`,e)}function l(e){c(Array.isArray(e)?e.map(String):[])}function u(e){let t=e.trim();t&&!i.modelValue.includes(t)&&c([...i.modelValue,t])}function ee(e){let t=e.target;u(t.value),t.value=``,o.value=[]}function d(e){let t=e.target;t&&typeof t.value==`string`&&t.value.trim()&&setTimeout(()=>{u(t.value),t.value=``},z)}return(t,r)=>(m(),y(e(O),{"model-value":n.modelValue,multiple:``,suggestions:o.value,"complete-on-focus":!0,placeholder:n.placeholder,"input-id":n.inputId,disabled:n.disabled,"onUpdate:modelValue":l,onComplete:s,onKeydown:x(ee,[`enter`]),onBlur:d},null,8,[`model-value`,`suggestions`,`placeholder`,`input-id`,`disabled`]))}}),be=/^\{\{([^{}]+)\}\}$/,B=/\{\{([^}]+)\}\}/g,V=`environment.`;function xe(e,t){return e.startsWith(V)?t.resolvedEnv[e.slice(12)]||null:t.serviceBuiltins[e]||null}function Se(e,t){let n=e.match(be);return n?xe(n[1],t):null}function Ce(e,t){return e.replace(B,(e,n)=>xe(n,t)??e)}var H={class:`ref-group`},we={class:`ref-option`},U={key:0,class:`ti ti-lock ref-option-secret`},Te={key:1,class:`ref-option-preview`},Ee=40,W=D(te({__name:`VariableRefInput`,props:{modelValue:{},inputId:{},placeholder:{default:``},disabled:{type:Boolean,default:!1},envKeys:{default:()=>[]},meta:{default:()=>({})},resolvedEnv:{default:()=>({})},serviceBuiltins:{default:()=>({})}},emits:[`update:modelValue`,`search`,`focus`,`blur`,`picked`],setup(n,{emit:i}){let o=/\{\{([^}]*)$/,s=n,u=i,{t:ee}=ie(),d=t(``),f=t(``),p=t([]);function te(){let e=d.value.toLowerCase(),t=Object.keys(s.serviceBuiltins).filter(t=>t.toLowerCase().includes(e)).map(e=>`{{${e}}}`),n=s.envKeys.map(e=>`{{environment.${e}}}`);return[...t.length?[{label:ee(`variableRefInput.groupBuiltins`),items:t}]:[],...n.length?[{label:ee(`variableRefInput.groupEnvironment`),items:n}]:[]]}function h(){p.value=te()}a(()=>[s.envKeys,s.serviceBuiltins],h,{deep:!0});function g(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}function ne(e){let t=e.match(be);return!t||!t[1].startsWith(`environment.`)?!1:s.meta[t[1].slice(12)]?.isSecret??!1}function x(e){let t=e.match(be);if(!t)return null;let n=t[1];if(n.startsWith(`environment.`)){let e=s.meta[n.slice(12)];if(!e||e.isSecret)return null}let r=xe(n,{resolvedEnv:s.resolvedEnv,serviceBuiltins:s.serviceBuiltins});return r?re(r):null}function re(e){return e.length>Ee?`${e.slice(0,Ee)}…`:e}function S(e){if(f.value=e.query,C)C=!1,d.value=``;else{let t=e.query.match(o),n=t?t[1]:e.query;d.value=n.replace(/^(environment|service)\./,``).trim()}u(`search`,d.value),h()}let C=!1;function w(){C=!0,u(`focus`)}function ae(e){let t=f.value,n=t.lastIndexOf(`{{`);u(`update:modelValue`,n===-1?e:t.slice(0,n)+e),u(`picked`)}return(t,i)=>(m(),y(e(O),{"input-id":n.inputId,"model-value":n.modelValue,suggestions:p.value,"option-group-label":`label`,"option-group-children":`items`,placeholder:n.placeholder,class:`w-full`,"complete-on-focus":``,disabled:n.disabled,"onUpdate:modelValue":i[0]||=e=>u(`update:modelValue`,e),onComplete:S,onItemSelect:i[1]||=e=>ae(e.value),onFocus:w,onBlur:i[2]||=e=>u(`blur`)},{optiongroup:_(({option:e})=>[c(`span`,H,v(e.label),1)]),option:_(({option:t})=>[c(`span`,we,[r(e(T),{severity:`secondary`,value:g(t)},null,8,[`value`]),ne(t)?(m(),l(`i`,U)):x(t)?(m(),l(`span`,Te,v(x(t)),1)):b(``,!0)])]),_:1},8,[`input-id`,`model-value`,`suggestions`,`placeholder`,`disabled`]))}}),[[`__scopeId`,`data-v-2247bb09`]]);function G(e){let t=!1,n=!1;return async function r(){if(t){n=!0;return}t=!0;try{await e()}finally{t=!1,n&&(n=!1,await r())}}}var K={class:`key-row`},De={class:`expansion-field expansion-field--key`},Oe=[`for`],ke={key:2,class:`value-display`},Ae={key:0,class:`key-row-delete`},je={key:0,class:`flags-row`},Me={key:1,class:`expansion-field expansion-field--tags`},Ne={class:`expansion-label`,for:`varrow-tags-input`},Pe={key:1,class:`tags-display`},Fe={key:2,class:`not-secret-warning`},Ie={key:4,class:`expansion-field expansion-field--description`},Le={class:`expansion-label`},Re={key:5,class:`not-secret-warning`},ze={key:7,class:`expansion-section`},Be={class:`section-header`},Ve={class:`section-title`},He={class:`section-fields`},Ue={class:`expansion-field expansion-field--prepost`},We={class:`expansion-label`,for:`varrow-prefix`},Ge={key:2,class:`value-display`},Ke={class:`expansion-field expansion-field--value`},qe=[`for`],Je=[`aria-label`],Ye={class:`value-help`},Xe={class:`value-help__title`},Ze={class:`value-help__line`},Qe={class:`value-help__line value-help__line--muted`},$e={class:`value-help__subtitle`},et={class:`value-help__builtins`},tt={class:`value-help__line value-help__line--muted`},nt={key:0,class:`secret-input-wrap`},rt=[`disabled`],it=[`title`],at={key:1,class:`value-display value-display--with-actions`},ot={key:0,class:`value-actions`},st={key:0},ct={key:1},lt={class:`expansion-field expansion-field--prepost`},ut={class:`expansion-label`,for:`varrow-suffix`},dt={key:2,class:`value-display`},ft={key:0,class:`preview-value`},pt={key:0,class:`prepost-part prepost-part--pre`},mt={key:1,class:`prepost-part prepost-part--interpolation`},ht={class:`prepost-part--value prepost-resolved-inline`},gt=[`title`],_t={key:2,class:`prepost-part prepost-part--value`},vt={key:3,class:`prepost-part prepost-part--post`},yt={key:9,class:`expansion-section expansion-section--override`},bt={class:`section-header`},xt={class:`section-title`},St={class:`ti ti-info-circle section-title__info`},Ct={class:`section-fields`},wt={class:`expansion-field expansion-field--prepost`},Tt={class:`expansion-label`,for:`varrow-override-prefix`},Et={class:`expansion-field expansion-field--value`},Dt=[`for`],Ot={key:0,class:`secret-input-wrap`},kt=[`disabled`],At=[`title`],jt={class:`expansion-field expansion-field--prepost`},Mt={class:`expansion-label`,for:`varrow-override-suffix`},Nt={key:1,class:`override-view`},Pt={key:0,class:`value-display--with-actions`},Ft={class:`value-actions`},It={key:0,class:`override-value-masked`},Lt={key:1,class:`override-value`},Rt={key:1,class:`override-value`},zt={key:1,class:`override-empty`},Bt={key:0,class:`preview-value preview-value--override`},Vt={key:0,class:`prepost-part prepost-part--pre`},Ht={key:1,class:`prepost-part prepost-part--interpolation`},Ut={key:0,class:`prepost-part--value prepost-resolved-inline`},Wt={key:2,class:`prepost-part prepost-part--value`},Gt={key:3,class:`prepost-part prepost-part--post`},Kt=`{{environment.KEY}}`,qt=D(te({__name:`VariableRowEditor`,props:{environmentId:{},variableId:{},overrides:{},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},canEditSource:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showOverrideBadge:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},resolvedEnv:{default:()=>({})},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{default:()=>({})},isPending:{type:Boolean,default:!1},knownTags:{default:()=>[]}},emits:[`deleted`,`saved`,`autocomplete-search`,`override-changed`,`edit-source`],setup(p,{emit:te}){let h=p,x=te,S=fe(),oe=ae(),{t:E}=ie(),se=t(!1),D=t(!1),le=t(!1),ue=t(!1),k=t(!1),A=t(!1),de=t(null);function j(e,t){navigator.clipboard.writeText(t),de.value=e,setTimeout(()=>{de.value===e&&(de.value=null)},1500)}let pe=f(()=>S.getById(h.environmentId)?.variables?.[h.variableId]),M=t(``),N=t(``),P=t(``),F=t(``),I=t(!1),L=t(!1),R=t(!1),ve=t(!1),z=t(!1),B=t(``),V=t([]),xe=t(!1),H=t(!1),we=t(!1),U=f(()=>xe.value||!!B.value),Te=o(`descriptionEditor`);async function Ee(){xe.value=!0,await ne(),Te.value?.focus?.()}let qt=f(()=>rn(N.value)),q=f(()=>I.value&&!qt.value),Jt=f({get:()=>L.value||R.value,set:e=>{L.value=e}}),Yt=f(()=>R.value?E(`variableRowEditor.shareWithAiHintInjected`):q.value?E(`variableRowEditor.shareWithAiHint`):E(`variableRowEditor.shareWithAiHintPublic`)),Xt=f(()=>h.disabled||z.value);function Zt(){let e=pe.value;M.value=e?.key??``,N.value=e?.value?.value??``,P.value=e?.value?.pre??``,F.value=e?.value?.post??``,I.value=e?.value?.isSecret??!1,L.value=e?.value?.shareWithAi??!1,R.value=e?.value?.injectIntoAi??!1,ve.value=e?.value?.required??!1,z.value=e?.value?.overrideOnly??!1,xe.value=!1,H.value=!1,we.value=!1,B.value=e?.value?.description??``,V.value=[...e?.tags??[]]}function Qt(){z.value&&(N.value=``),Q()}ee(Zt),a(pe,(e,t)=>{!t&&e&&Zt()});let J=f(()=>h.overrides[h.variableId]??null),$t=f(()=>!J.value||H.value),en=f(()=>!h.editable||!!J.value||z.value||we.value);async function tn(){we.value=!0,await ne(),document.querySelector(`#varrow-override-value-secret, #varrow-override-value-plain`)?.focus()}let Y=t(``),X=t(``),Z=t(``);function nn(){let e=J.value;Y.value=e?.pre??``,X.value=e?.value??``,Z.value=e?.post??``}ee(nn),a(J,nn);function rn(e){return be.test(e)}function an(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}let on=f(()=>({resolvedEnv:h.resolvedEnv,serviceBuiltins:h.serviceBuiltins}));function sn(e){return Ce(e,on.value)}function cn(e){return Se(e,on.value)}function ln(e){let t=e.value;M.value=t,N.value=`{{environment.${t}}}`,I.value=!1;let n=h.autocompleteMeta?.[t];n&&(P.value=n.pre,F.value=n.post),Q()}let un=t(null),dn=f(()=>me.map(e=>({ref:`{{${e.name}}}`,desc:E(`builtins.${e.descriptionKey}`)}))),Q=G(async()=>{if(D.value)return;let e=M.value.trim();if(e){se.value=!0;try{await S.upsertVariable(h.environmentId,h.variableId,{key:e,...V.value.length?{tags:V.value}:{},value:{value:N.value,pre:P.value,post:F.value,isSecret:q.value,shareWithAi:L.value,injectIntoAi:R.value,required:ve.value,overrideOnly:z.value,description:B.value}}),h.isPending&&x(`saved`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.saveError`),life:4e3})}finally{se.value=!1}}});async function fn(){if(D.value=!0,h.isPending){x(`deleted`);return}se.value=!0;try{J.value&&await S.removeOverride(h.variableId),await S.removeVariable(h.environmentId,h.variableId),x(`deleted`)}catch(e){D.value=!1,oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.deleteError`),life:4e3})}finally{se.value=!1}}async function $(){let e=Y.value||X.value||Z.value;try{if(!e){J.value&&(await S.removeOverride(h.variableId),x(`override-changed`));return}await S.setOverride(h.variableId,{value:{value:X.value,pre:Y.value,post:Z.value}}),x(`override-changed`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.overrideError`),life:4e3})}}async function pn(){try{await S.removeOverride(h.variableId),x(`override-changed`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.clearOverrideError`),life:4e3})}}function mn(e){let t=e.relatedTarget;(!t||!e.currentTarget.contains(t))&&Q()}return(t,a)=>{let o=n(`tooltip`);return m(),l(`div`,{class:`expansion-form`,onFocusout:mn},[c(`div`,K,[c(`div`,De,[c(`label`,{class:`expansion-label`,for:p.editable&&p.autocompleteEnabled?`varrow-key-ac`:`varrow-key-input`},v(e(E)(`common.key`)),9,Oe),p.editable&&p.autocompleteEnabled?(m(),y(e(O),{key:0,"input-id":`varrow-key-ac`,modelValue:M.value,"onUpdate:modelValue":a[0]||=e=>M.value=e,suggestions:p.autocompleteSuggestions,placeholder:e(E)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onComplete:a[1]||=e=>x(`autocomplete-search`,e.query),onItemSelect:ln,onBlur:e(Q)},null,8,[`modelValue`,`suggestions`,`placeholder`,`disabled`,`onBlur`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-key-input`,modelValue:M.value,"onUpdate:modelValue":a[2]||=e=>M.value=e,placeholder:e(E)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,ke,v(M.value),1))]),p.showDelete&&p.editable?(m(),l(`div`,Ae,[r(e(ce),{icon:`ti ti-trash`,severity:`danger`,variant:`text`,rounded:``,size:`small`,disabled:p.disabled||se.value,onClick:fn},null,8,[`disabled`])])):b(``,!0)]),p.editable?(m(),l(`div`,je,[qt.value?b(``,!0):(m(),y(_e,{key:0,modelValue:I.value,"onUpdate:modelValue":[a[3]||=e=>I.value=e,e(Q)],label:e(E)(`variableRowEditor.secret`),icon:`ti ti-lock`,hint:e(E)(`variableRowEditor.secretHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`])),r(_e,{modelValue:Jt.value,"onUpdate:modelValue":[a[4]||=e=>Jt.value=e,e(Q)],label:e(E)(`variableRowEditor.shareWithAi`),icon:`ti ti-eye`,hint:Yt.value,locked:R.value,disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`locked`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:R.value,"onUpdate:modelValue":[a[5]||=e=>R.value=e,e(Q)],label:e(E)(`variableRowEditor.injectIntoAi`),icon:`ti ti-login`,hint:e(E)(`variableRowEditor.injectIntoAiHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:ve.value,"onUpdate:modelValue":[a[6]||=e=>ve.value=e,e(Q)],label:e(E)(`variableRowEditor.required`),icon:`ti ti-asterisk`,hint:e(E)(`variableRowEditor.requiredHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:z.value,"onUpdate:modelValue":[a[7]||=e=>z.value=e,Qt],label:e(E)(`variableRowEditor.overrideOnly`),icon:`ti ti-device-desktop`,hint:e(E)(`variableRowEditor.overrideOnlyHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`])])):b(``,!0),p.editable||V.value.length?(m(),l(`div`,Me,[c(`label`,Ne,v(e(E)(`variableRowEditor.tags`)),1),p.editable?(m(),y(ye,{key:0,modelValue:V.value,"onUpdate:modelValue":a[8]||=e=>V.value=e,"input-id":`varrow-tags-input`,options:p.knownTags,placeholder:e(E)(`variableRowEditor.tagsPlaceholder`),disabled:p.disabled,onChange:e(Q)},null,8,[`modelValue`,`options`,`placeholder`,`disabled`,`onChange`])):(m(),l(`div`,Pe,[(m(!0),l(g,null,u(V.value,t=>(m(),y(e(T),{key:t,severity:`secondary`,value:t},null,8,[`value`]))),128))]))])):b(``,!0),p.editable&&!I.value&&!rn(N.value)?(m(),l(`div`,Fe,[a[60]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.notSecretWarning`)),1)])):b(``,!0),p.editable&&!U.value?(m(),l(`button`,{key:3,type:`button`,class:`add-section-btn`,onClick:Ee},[a[61]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.addDescription`)),1)])):b(``,!0),U.value?(m(),l(`div`,Ie,[c(`label`,Le,v(e(E)(`variableRowEditor.description`)),1),r(e(ge),{ref_key:`descriptionEditor`,ref:Te,modelValue:B.value,"onUpdate:modelValue":a[9]||=e=>B.value=e,markdown:``,"min-height":`4rem`,"max-height":`14rem`,editable:p.editable&&!p.disabled,placeholder:e(E)(`variableRowEditor.descriptionPlaceholder`),onLinkClick:e(he)},null,8,[`modelValue`,`editable`,`placeholder`,`onLinkClick`])])):b(``,!0),p.editable&&z.value?(m(),l(`div`,Re,[a[62]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.overrideOnlyNotice`)),1)])):b(``,!0),$t.value?b(``,!0):(m(),l(`button`,{key:6,type:`button`,class:`add-section-btn`,onClick:a[10]||=e=>H.value=!0},[a[63]||=c(`i`,{class:`ti ti-chevron-right`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.showSharedValue`)),1)])),$t.value?(m(),l(`div`,ze,[c(`div`,Be,[c(`div`,Ve,v(e(E)(`variableRowEditor.value`)),1),J.value?(m(),l(`button`,{key:0,type:`button`,class:`add-section-btn`,onClick:a[11]||=e=>H.value=!1},[a[64]||=c(`i`,{class:`ti ti-chevron-up`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.hideSharedValue`)),1)])):b(``,!0)]),c(`div`,He,[c(`div`,Ue,[c(`label`,We,v(e(E)(`variableRowEditor.prefix`)),1),p.editable&&p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-prefix`,modelValue:P.value,"onUpdate:modelValue":a[12]||=e=>P.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[13]||=e=>x(`autocomplete-search`,e),onBlur:a[14]||=t=>e(Q)(),onPicked:a[15]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-prefix`,modelValue:P.value,"onUpdate:modelValue":a[16]||=e=>P.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,Ge,v(P.value||`—`),1))]),c(`div`,Ke,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-value-secret`:`varrow-value-plain`},[i(v(e(E)(`variableRowEditor.value`))+` `,1),p.editable?(m(),l(`button`,{key:0,type:`button`,class:`value-help-btn`,"aria-label":e(E)(`variableRowEditor.helpTitle`),onClick:a[17]||=re(e=>un.value?.toggle(e),[`prevent`,`stop`])},[...a[65]||=[c(`i`,{class:`ti ti-info-circle`},null,-1)]],8,Je)):b(``,!0)],8,qe),r(e(C),{ref_key:`valueHelp`,ref:un},{default:_(()=>[c(`div`,Ye,[c(`div`,Xe,v(e(E)(`variableRowEditor.helpTitle`)),1),c(`p`,Ze,[i(v(e(E)(`variableRowEditor.helpReference`))+` `,1),c(`code`,null,v(Kt))]),c(`p`,Qe,v(e(E)(`variableRowEditor.helpAutocomplete`)),1),c(`div`,$e,v(e(E)(`variableRowEditor.helpBuiltinsTitle`)),1),c(`ul`,et,[(m(!0),l(g,null,u(dn.value,e=>(m(),l(`li`,{key:e.ref},[c(`code`,null,v(e.ref),1),c(`span`,null,v(e.desc),1)]))),128))]),c(`p`,tt,v(e(E)(`variableRowEditor.helpPrePost`)),1)])]),_:1},512),p.editable?(m(),l(g,{key:0},[q.value?(m(),l(`div`,nt,[r(e(w),{id:`varrow-value-secret`,modelValue:N.value,"onUpdate:modelValue":a[18]||=e=>N.value=e,type:k.value?`text`:`password`,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onBlur:e(Q)},null,8,[`modelValue`,`type`,`placeholder`,`disabled`,`onBlur`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[19]||=e=>k.value=!k.value,tabindex:`-1`},[c(`i`,{class:d(k.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,rt)])):rn(N.value)&&!le.value?(m(),l(`span`,{key:1,class:`interpolation-badge`,title:N.value,onClick:a[20]||=e=>le.value=!0},[r(e(T),{severity:`secondary`,value:an(N.value)},null,8,[`value`]),a[66]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,it)):p.autocompleteEnabled?(m(),y(W,{key:2,"input-id":`varrow-value-plain`,modelValue:N.value,"onUpdate:modelValue":a[21]||=e=>N.value=e,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:Xt.value,onSearch:a[22]||=e=>x(`autocomplete-search`,e),onFocus:a[23]||=e=>le.value=!0,onBlur:a[24]||=t=>{le.value=!1,e(Q)()},onPicked:a[25]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:3,id:`varrow-value-plain`,modelValue:N.value,"onUpdate:modelValue":a[26]||=e=>N.value=e,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onFocus:a[27]||=e=>le.value=!0,onBlur:a[28]||=t=>{le.value=!1,e(Q)()}},null,8,[`modelValue`,`placeholder`,`disabled`]))],64)):(m(),l(`span`,at,[N.value?(m(),l(`span`,ot,[q.value?(m(),l(`i`,{key:0,class:d([k.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[29]||=e=>k.value=!k.value},null,2)):b(``,!0),c(`i`,{class:d([de.value===`val`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[30]||=e=>j(`val`,P.value+N.value+F.value)},null,2)])):b(``,!0),rn(N.value)?(m(),y(e(T),{key:1,severity:`secondary`,value:an(N.value)},null,8,[`value`])):q.value?(m(),l(g,{key:2},[k.value?(m(),l(`span`,ct,v(N.value),1)):(m(),l(`span`,st,`***`))],64)):(m(),l(g,{key:3},[i(v(N.value),1)],64))]))]),c(`div`,lt,[c(`label`,ut,v(e(E)(`variableRowEditor.suffix`)),1),p.editable&&p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-suffix`,modelValue:F.value,"onUpdate:modelValue":a[31]||=e=>F.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[32]||=e=>x(`autocomplete-search`,e),onBlur:a[33]||=t=>e(Q)(),onPicked:a[34]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-suffix`,modelValue:F.value,"onUpdate:modelValue":a[35]||=e=>F.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,dt,v(F.value||`—`),1))])]),q.value?b(``,!0):(m(),l(`code`,ft,[P.value?(m(),l(`span`,pt,v(sn(P.value)),1)):b(``,!0),rn(N.value)?(m(),l(`span`,mt,[cn(N.value)==null?(m(),l(g,{key:1},[r(e(T),{severity:`secondary`,value:an(N.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[67]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(m(),l(g,{key:0},[c(`span`,ht,v(cn(N.value)),1),p.canEditSource?(m(),l(`i`,{key:0,class:`ti ti-pencil edit-source-icon`,title:e(E)(`variablesTable.editParentTitle`),onClick:a[36]||=re(e=>x(`edit-source`),[`stop`])},null,8,gt)):b(``,!0)],64))])):(m(),l(`span`,_t,v(sn(N.value)||`…`),1)),F.value?(m(),l(`span`,vt,v(sn(F.value)),1)):b(``,!0)]))])):b(``,!0),p.showOverrides&&M.value?.trim()&&p.editable&&!en.value?(m(),l(`button`,{key:8,type:`button`,class:`add-section-btn`,onClick:tn},[a[68]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.addOverride`)),1)])):b(``,!0),p.showOverrides&&M.value?.trim()&&en.value?(m(),l(`div`,yt,[c(`div`,bt,[c(`div`,xt,[i(v(e(E)(`variableRowEditor.localOverride`))+` `,1),s(c(`i`,St,null,512),[[o,{value:e(E)(`variableRowEditor.localOverrideHint`),showDelay:0,hideDelay:0},void 0,{top:!0}]])]),p.editable&&J.value?(m(),y(e(ce),{key:0,icon:`ti ti-x`,variant:`text`,rounded:``,size:`small`,severity:`danger`,title:e(E)(`variableRowEditor.clearOverride`),disabled:p.disabled,onClick:pn},null,8,[`title`,`disabled`])):b(``,!0)]),c(`div`,Ct,[p.editable?(m(),l(g,{key:0},[c(`div`,wt,[c(`label`,Tt,v(e(E)(`variableRowEditor.prefix`)),1),p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[37]||=e=>Y.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[38]||=e=>x(`autocomplete-search`,e),onBlur:a[39]||=e=>$(),onPicked:a[40]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:1,id:`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[41]||=e=>Y.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,Et,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-override-value-secret`:`varrow-override-value-plain`},v(e(E)(`variableRowEditor.value`)),9,Dt),q.value?(m(),l(`div`,Ot,[r(e(w),{id:`varrow-override-value-secret`,modelValue:X.value,"onUpdate:modelValue":a[42]||=e=>X.value=e,type:A.value?`text`:`password`,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`type`,`placeholder`,`disabled`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[43]||=e=>A.value=!A.value,tabindex:`-1`},[c(`i`,{class:d(A.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,kt)])):rn(X.value)&&!ue.value?(m(),l(`span`,{key:1,class:`interpolation-badge`,title:X.value,onClick:a[44]||=e=>ue.value=!0},[r(e(T),{severity:`secondary`,value:an(X.value)},null,8,[`value`]),a[69]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,At)):p.autocompleteEnabled?(m(),y(W,{key:2,"input-id":`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[45]||=e=>X.value=e,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[46]||=e=>x(`autocomplete-search`,e),onFocus:a[47]||=e=>ue.value=!0,onBlur:a[48]||=e=>{ue.value=!1,$()},onPicked:a[49]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:3,id:`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[50]||=e=>X.value=e,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onFocus:a[51]||=e=>ue.value=!0,onBlur:a[52]||=e=>{ue.value=!1,$()}},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,jt,[c(`label`,Mt,v(e(E)(`variableRowEditor.suffix`)),1),p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[53]||=e=>Z.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[54]||=e=>x(`autocomplete-search`,e),onBlur:a[55]||=e=>$(),onPicked:a[56]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:1,id:`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[57]||=e=>Z.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))])],64)):(m(),l(`div`,Nt,[J.value?(m(),l(`span`,Pt,[c(`span`,Ft,[q.value||J.value.isSecret?(m(),l(`i`,{key:0,class:d([A.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[58]||=e=>A.value=!A.value},null,2)):b(``,!0),c(`i`,{class:d([de.value===`ovr`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[59]||=e=>j(`ovr`,J.value.pre+J.value.value+J.value.post)},null,2)]),q.value||J.value.isSecret?(m(),l(g,{key:0},[A.value?(m(),l(`code`,Lt,v(J.value.pre)+v(J.value.value)+v(J.value.post),1)):(m(),l(`span`,It,`***`))],64)):(m(),l(`code`,Rt,v(J.value.pre)+v(J.value.value)+v(J.value.post),1))])):(m(),l(`span`,zt,`—`))]))]),p.editable&&!q.value&&(Y.value||X.value||Z.value)?(m(),l(`code`,Bt,[Y.value?(m(),l(`span`,Vt,v(sn(Y.value)),1)):b(``,!0),rn(X.value)?(m(),l(`span`,Ht,[cn(X.value)==null?(m(),l(g,{key:1},[r(e(T),{severity:`secondary`,value:an(X.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[70]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(m(),l(`span`,Ut,v(cn(X.value)),1))])):(m(),l(`span`,Wt,v(sn(X.value)||`…`),1)),Z.value?(m(),l(`span`,Gt,v(sn(Z.value)),1)):b(``,!0)])):b(``,!0)])):b(``,!0)],32)}}}),[[`__scopeId`,`data-v-88b44eb7`]]);function q(e){return e.tags?.length?[...e.tags].sort((e,t)=>e.localeCompare(t))[0]:null}function Jt(e,t){if(!e.key||!t.key)return Number(!e.key)-Number(!t.key);let n=q(e),r=q(t);return n===r?e.key.localeCompare(t.key):n===null?1:r===null?-1:n.localeCompare(r)}function Yt(e,t){return!t.length||!!e?.some(e=>t.includes(e))}var Xt=/\{\{environment\.([^}]+)\}\}/g;function Zt(e){let t=new Set;for(let n of e)for(let e of n.matchAll(Xt))t.add(e[1]);return[...t]}function Qt(e,t,n=[]){let r=new Set;for(let i of Zt(e))for(let e of t[i]??[])n.includes(e)||r.add(e);return[...r].sort((e,t)=>e.localeCompare(t))}function J(e,t){let n=e.filter(e=>t.includes(e));return n.length===e.length?e:n}var $t={class:`table-toolbar`},en={key:1,class:`overrides-filter`},tn={for:`overrides-filter`},Y={class:`text-center py-4 text-gray-500`},X={class:`row-key-cell`},Z={class:`row-key-line`},nn={class:`row-key`},rn=[`title`],an=[`title`],on={key:0,class:`row-tags`},sn={key:2,class:`resolved-from-line`},cn={class:`row-value`},ln=[`title`,`onClick`],un=[`title`,`onClick`],dn={key:1,class:`value-levels`},Q={class:`resolved-level`},fn={key:0,class:`secret-mask`},$=[`title`],pn={key:0,class:`secret-mask`},mn=[`title`],hn=[`title`],gn={key:6,class:`empty-value`},_n={key:0,class:`override-indicator`},vn=[`title`,`onClick`],yn=[`title`,`onClick`],bn={key:0,class:`override-value-masked`},xn=[`title`],Sn=[`title`],Cn={key:0,class:`parent-edit`},wn={class:`parent-edit__field`},Tn={class:`parent-edit__label`,for:`parent-edit-value`},En={class:`parent-edit__usages`},Dn={class:`parent-edit__usages-title`},On={key:0,class:`parent-edit__usages-loading`},kn={key:0,class:`parent-edit__usage-list`},An={class:`parent-edit__usage-env`},jn={key:0,class:`parent-edit__usage-svc`},Mn={key:1,class:`parent-edit__usages-empty`},Nn=40,Pn=200,Fn=24,In=D(te({__name:`VariablesTable`,props:{environmentId:{},resolvedEnv:{default:()=>({})},sources:{default:()=>({})},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},showOverrideBadge:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{},scrollHeight:{default:`auto`},resolvedVariables:{default:()=>({})}},emits:[`autocomplete-search`,`variables-changed`],setup(n,{emit:te}){let h=be,x=/^\{\{environment\.([^{}]+)\}\}$/,S=Object.fromEntries(me.map(e=>[e.name,``])),C=n,D=te,{t:O}=ie(),j=fe(),pe=f(()=>Object.keys(C.sources).length>0),M=f(()=>Object.keys(C.resolvedEnv).length>0),N=o(`rootRef`),P=t(null),F=f(()=>C.scrollHeight===`auto`?P.value??`460px`:C.scrollHeight);function he(){if(C.scrollHeight!==`auto`)return;let e=N.value;if(!e)return;let t=(e.querySelector(`.r-datatable__container`)??e).getBoundingClientRect().top,n=window.innerHeight-t-Fn;P.value=`${Math.max(Pn,Math.round(n))}px`}let ge=null;ee(()=>{ne(he),window.addEventListener(`resize`,he),typeof ResizeObserver<`u`&&N.value&&(ge=new ResizeObserver(()=>he()),ge.observe(document.body))}),p(()=>{window.removeEventListener(`resize`,he),ge?.disconnect(),ge=null});let I=t(``),_e=t(!1),L=t([]),R=t({});async function z(){if(C.showOverrides)try{let e=await j.getOverrides(),t={};for(let[n,r]of Object.entries(e)){let e=r;t[n]={value:e.value.value,pre:e.value.pre,post:e.value.post,isSecret:e.value.isSecret}}R.value=t}catch{}}ee(z);let ye=f(()=>j.getById(C.environmentId));function B(e){return ye.value?.variables?.[e]}let V=f(()=>{let e=new Set;for(let t of j.environments)for(let n of Object.values(t.variables??{}))for(let t of n.tags??[])e.add(t);return[...e].sort((e,t)=>e.localeCompare(t))}),xe=f(()=>{let e={...Se.value};for(let t of Object.values(ye.value?.variables??{}))e[t.key]=t.tags??[];return e}),Se=f(()=>{let e=ye.value?.variables??{},t={};for(let[n,r]of Object.entries(C.resolvedVariables))n in e||(t[r.key]=r.tags??[]);return t});function Ce(e){let t=B(e);if(!t)return[];let n=R.value[e],r=[t.value?.value??``,t.value?.pre??``,t.value?.post??``];return n&&r.push(n.value,n.pre,n.post),Qt(r,{...xe.value,[t.key]:Se.value[t.key]??[]},t.tags??[])}function H(e){return[...B(e)?.tags??[],...Ce(e)]}let we=f(()=>{let e=new Set;for(let t of Object.keys(ye.value?.variables??{}))for(let n of H(t))e.add(n);return[...e].sort((e,t)=>e.localeCompare(t))});a(we,e=>{L.value=J(L.value,e)});let U=t([]),Te=f(()=>{let e=Object.keys(ye.value?.variables??{}).map(e=>({variableId:e})),t=new Set(e.map(e=>e.variableId)),n=U.value.filter(e=>!t.has(e)).map(e=>({variableId:e}));return[...e,...n]}),Ee=o(`tableRef`),W=t({}),G=t([]),K=t(new Set);function De(e){let t=new Set(K.value);t.has(e)?t.delete(e):t.add(e),K.value=t}let Oe=t(null);function ke(e,t){navigator.clipboard.writeText(t),Oe.value=e,setTimeout(()=>{Oe.value===e&&(Oe.value=null)},1500)}function Ae(e){let t=B(e);if(!t)return``;let n=t.value?.value??``;return Je(n)?Xe(n)??n:(t.value?.pre??``)+n+(t.value?.post??``)}let je=ae(),Me=t(null),Ne=t(!1),Pe=t(!1),Fe=t(!1),Ie=0,Le=t([]);async function Re(e){let t=C.sources[e]?.resolvedFrom,n=B(e)?.value?.value??``;if(!t||!n)return;let r=Ye(n),i=j.getById(t.environmentId),a=Object.entries(i?.variables??{}).find(([,e])=>e.key===r);if(!a){je.add({severity:`warn`,summary:O(`variablesTable.editParentNotFound`),life:4e3});return}let[o,s]=a;Me.value={key:r,environmentId:t.environmentId,environmentName:t.environmentName,variableId:o,value:s.value?.value??``,pre:s.value?.pre??``,post:s.value?.post??``,isSecret:s.value?.isSecret??!1,shareWithAi:s.value?.shareWithAi??!1,injectIntoAi:s.value?.injectIntoAi??!1,...s.tags?.length?{tags:s.tags}:{}},Le.value=[],Ne.value=!0,ze(r,t.environmentId)}async function ze(e,t){let n=++Ie;Fe.value=!0;try{let r=j.currentProjectId;if(!r)return;let i=await j.keyUsages(r,e,t);if(n!==Ie)return;Le.value=[...i.inheritedBy.map(e=>({kind:`inherits`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.definedIn.map(e=>({kind:`defines`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.referencedBy.map(e=>({kind:`references`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{},viaKey:e.key}))]}catch{n===Ie&&(Le.value=[])}finally{n===Ie&&(Fe.value=!1)}}async function Be(){let e=Me.value;if(e){Pe.value=!0;try{await j.upsertVariable(e.environmentId,e.variableId,{key:e.key,...e.tags?{tags:e.tags}:{},value:{value:e.value,pre:e.pre,post:e.post,isSecret:e.isSecret,shareWithAi:e.shareWithAi,injectIntoAi:e.injectIntoAi}}),Ne.value=!1,D(`variables-changed`)}catch(e){je.add({severity:`error`,summary:O(`common.error`),detail:e.message,life:4e3})}finally{Pe.value=!1}}}function Ve(e){let t=R.value[e];return t?t.pre+t.value+t.post:``}let He=f(()=>{let e=[...Te.value];if(_e.value&&(e=e.filter(e=>!!R.value[e.variableId])),L.value.length&&(e=e.filter(e=>U.value.includes(e.variableId)||Yt(H(e.variableId),L.value))),I.value.trim()){let t=I.value.toLowerCase();e=e.filter(e=>{let n=B(e.variableId);if(!n)return!1;if(n.key.toLowerCase().includes(t)||H(e.variableId).some(e=>e.toLowerCase().includes(t))||(n.value?.value??``).toLowerCase().includes(t))return!0;let r=R.value[e.variableId];return!!(r&&r.value.toLowerCase().includes(t))})}if(G.value.length>0)e.sort((e,t)=>{let n=G.value.indexOf(e.variableId),r=G.value.indexOf(t.variableId);return n===-1?1:r===-1?-1:n-r});else{let t=e=>({key:B(e)?.key??``,tags:H(e)});e.sort((e,n)=>Jt(t(e.variableId),t(n.variableId)))}return e});function Ue(e){let t=e.data.variableId;W.value[t]?(W.value={},G.value=[],We(t)):(G.value=He.value.map(e=>e.variableId),W.value={[t]:!0})}function We(e){ne(()=>{let t=Ee.value?.$el;if(!t)return;let n=He.value.findIndex(t=>t.variableId===e);n<0||t.querySelectorAll(`tbody tr[data-index]`)[n]?.scrollIntoView({block:`nearest`,behavior:`smooth`})})}function Ge(e){U.value=U.value.filter(t=>t!==e),W.value[e]&&(W.value={},G.value=[])}function Ke(e){U.value=U.value.filter(t=>t!==e)}function qe(){let e=de();U.value=[...U.value,e],G.value=[...Te.value.map(e=>e.variableId),e],ne(()=>{W.value={[e]:!0},ne(()=>{let e=document.querySelector(`.variables-expand-table .r-datatable__row-expansion:last-of-type`);e&&e.scrollIntoView({block:`nearest`,behavior:`smooth`})})})}function Je(e){return h.test(e)}function Ye(e){let t=e.match(h);return t?t[1].replace(/^(?:environment|service)\./,``):e}function Xe(e){let t=e.match(x);if(t)return C.resolvedEnv[t[1]]??null;let n=e.match(h);if(n){let e={...S,...C.serviceBuiltins};if(e[n[1]])return e[n[1]]}return null}function Ze(e){return e.length<=Nn?e:e.substring(0,Nn)+`…`}return(t,a)=>(m(),l(g,null,[c(`div`,{ref_key:`rootRef`,ref:N,class:`variables-table`},[c(`div`,$t,[r(e(w),{modelValue:I.value,"onUpdate:modelValue":a[0]||=e=>I.value=e,placeholder:`Search variables...`,class:`search-input`,size:`small`},null,8,[`modelValue`]),we.value.length?(m(),y(e(se),{key:0,modelValue:L.value,"onUpdate:modelValue":a[1]||=e=>L.value=e,options:we.value,placeholder:e(O)(`variablesTable.filterByTag`),display:`chip`,"max-selected-labels":2,"show-clear":``,size:`small`,class:`tag-filter`},null,8,[`modelValue`,`options`,`placeholder`])):b(``,!0),n.showOverrides?(m(),l(`div`,en,[r(e(le),{modelValue:_e.value,"onUpdate:modelValue":a[2]||=e=>_e.value=e,"input-id":`overrides-filter`},null,8,[`modelValue`]),c(`label`,tn,v(e(O)(`variablesTable.overriddenOnly`)),1)])):b(``,!0)]),r(e(ue),{ref_key:`tableRef`,ref:Ee,"expanded-rows":W.value,"onUpdate:expandedRows":a[6]||=e=>W.value=e,value:He.value,"data-key":`variableId`,size:`small`,class:`variables-expand-table`,scrollable:``,"scroll-height":F.value,onRowClick:Ue},{empty:_(()=>[c(`div`,Y,v(n.showAddButton?e(O)(`variablesTable.empty`):e(O)(`variablesTable.emptyReadonly`)),1)]),expansion:_(({data:t})=>[r(qt,{"environment-id":n.environmentId,"variable-id":t.variableId,overrides:R.value,editable:n.editable,"show-overrides":n.showOverrides,"show-delete":n.showDelete,"show-override-badge":n.showOverrideBadge,disabled:n.disabled,"resolved-env":n.resolvedEnv,"autocomplete-enabled":n.autocompleteEnabled,"autocomplete-suggestions":n.autocompleteSuggestions,"autocomplete-meta":n.autocompleteMeta,"service-builtins":{...e(S),...n.serviceBuiltins},"is-pending":U.value.includes(t.variableId),"known-tags":V.value,onDeleted:e=>Ge(t.variableId),onSaved:e=>Ke(t.variableId),onAutocompleteSearch:a[5]||=e=>D(`autocomplete-search`,e),onOverrideChanged:z,"can-edit-source":!!n.sources[t.variableId]?.resolvedFrom,onEditSource:e=>Re(t.variableId)},null,8,[`environment-id`,`variable-id`,`overrides`,`editable`,`show-overrides`,`show-delete`,`show-override-badge`,`disabled`,`resolved-env`,`autocomplete-enabled`,`autocomplete-suggestions`,`autocomplete-meta`,`service-builtins`,`is-pending`,`known-tags`,`onDeleted`,`onSaved`,`can-edit-source`,`onEditSource`])]),default:_(()=>[r(e(k),{expander:``,style:{width:`2.5rem`}}),r(e(k),{field:`variableId`,header:e(O)(`common.key`)},{body:_(({data:t})=>[c(`div`,X,[c(`span`,Z,[c(`code`,nn,v(B(t.variableId)?.key||`(new variable)`),1),n.sources[t.variableId]?.overriddenBy?(m(),l(`span`,{key:0,class:`overridden-badge overridden-badge--local`,title:e(O)(`variablesTable.localOverrideTooltip`,{env:n.sources[t.variableId].overriddenBy.environmentName})},[a[10]||=c(`i`,{class:`ti ti-device-desktop`},null,-1),i(` `+v(e(O)(`variablesTable.localOverride`)),1)],8,rn)):n.showOverrideBadge&&n.sources[t.variableId]?.overridden&&!Je(B(t.variableId)?.value?.value??``)?(m(),l(`span`,{key:1,class:`overridden-badge`,title:e(O)(`variablesTable.overrideTooltip`)},[a[11]||=c(`i`,{class:`ti ti-alert-triangle`},null,-1),i(` `+v(e(O)(`variablesTable.override`)),1)],8,an)):b(``,!0)]),H(t.variableId).length?(m(),l(`span`,on,[(m(!0),l(g,null,u(B(t.variableId)?.tags??[],t=>(m(),y(e(T),{key:t,severity:`secondary`,value:t,class:`row-tag`},null,8,[`value`]))),128)),(m(!0),l(g,null,u(Ce(t.variableId),t=>s((m(),y(e(T),{key:`inherited:`+t,severity:`secondary`,value:t,class:`row-tag row-tag--inherited`},null,8,[`value`])),[[e(A),e(O)(`variablesTable.inheritedTag`),void 0,{top:!0}]])),128))])):b(``,!0),pe.value&&n.sources[t.variableId]?(m(),y(ve,{key:1,"environment-id":n.sources[t.variableId].environmentId,class:`source-badge`},null,8,[`environment-id`])):b(``,!0),pe.value&&n.sources[t.variableId]?.resolvedFrom?(m(),l(`span`,sn,[a[12]||=c(`i`,{class:`ti ti-arrow-right resolved-from-arrow`},null,-1),r(ve,{"environment-id":n.sources[t.variableId].resolvedFrom.environmentId,class:`source-badge`},null,8,[`environment-id`])])):b(``,!0)])]),_:1},8,[`header`]),r(e(k),{header:e(O)(`common.value`)},{body:_(({data:t})=>[c(`span`,cn,[Ae(t.variableId)?(m(),l(`span`,{key:0,class:`value-actions`,onClick:a[3]||=re(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret?(m(),l(`i`,{key:0,class:d([K.value.has(t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(O)(`variablesTable.reveal`),onClick:e=>De(t.variableId)},null,10,ln)):b(``,!0),c(`i`,{class:d([Oe.value===t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(O)(`actions.copy`),onClick:e=>ke(t.variableId,Ae(t.variableId))},null,10,un)])):b(``,!0),Je(B(t.variableId)?.value?.value??``)&&Xe(B(t.variableId)?.value?.value??``)!=null?(m(),l(`span`,dn,[r(e(T),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``),class:`interpolation-hint-tag`},null,8,[`value`]),c(`span`,Q,[B(t.variableId)?.value?.isSecret&&!K.value.has(t.variableId)?(m(),l(`span`,fn,`***`)):(m(),l(`code`,{key:1,class:`resolved-final`,title:Xe(B(t.variableId)?.value?.value??``)},v(Ze(Xe(B(t.variableId)?.value?.value??``))),9,$))])])):Je(B(t.variableId)?.value?.value??``)&&M.value&&Xe(B(t.variableId)?.value?.value??``)==null?(m(),l(g,{key:2},[a[13]||=c(`i`,{class:`ti ti-alert-triangle unresolved-icon`},null,-1),r(e(T),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`]),a[14]||=c(`span`,{class:`unresolved-msg`},`Variable not found in this environment`,-1)],64)):Je(B(t.variableId)?.value?.value??``)?(m(),y(e(T),{key:3,severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`])):B(t.variableId)?.value?.isSecret?(m(),l(g,{key:4},[K.value.has(t.variableId)?(m(),l(`code`,{key:1,title:Ae(t.variableId)},v(Ze(Ae(t.variableId))),9,mn)):(m(),l(`span`,pn,`***`))],64)):B(t.variableId)?.value?.value||B(t.variableId)?.value?.pre||B(t.variableId)?.value?.post?(m(),l(`code`,{key:5,title:Ae(t.variableId)},v(Ze(Ae(t.variableId))),9,hn)):(m(),l(`span`,gn,`(empty)`))]),n.showOverrides&&!Je(B(t.variableId)?.value?.value??``)&&R.value[t.variableId]?(m(),l(`span`,_n,[a[15]||=c(`i`,{class:`ti ti-arrow-right`,style:{"font-size":`0.7rem`}},null,-1),c(`span`,{class:`value-actions`,onClick:a[4]||=re(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(m(),l(`i`,{key:0,class:d([K.value.has(`ovr:`+t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(O)(`variablesTable.reveal`),onClick:e=>De(`ovr:`+t.variableId)},null,10,vn)):b(``,!0),c(`i`,{class:d([Oe.value===`ovr:`+t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(O)(`actions.copy`),onClick:e=>ke(`ovr:`+t.variableId,Ve(t.variableId))},null,10,yn)]),B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(m(),l(g,{key:0},[K.value.has(`ovr:`+t.variableId)?(m(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},v(Ze(Ve(t.variableId))),9,xn)):(m(),l(`span`,bn,`***`))],64)):(m(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},v(Ze(Ve(t.variableId))),9,Sn))])):b(``,!0)]),_:1},8,[`header`])]),_:1},8,[`expanded-rows`,`value`,`scroll-height`]),n.showAddButton?(m(),y(e(ce),{key:0,type:`button`,label:e(O)(`variablesTable.addVariable`),icon:`ti ti-plus`,variant:`text`,disabled:n.disabled,class:`mt-3`,onClick:qe},null,8,[`label`,`disabled`])):b(``,!0)],512),r(e(E),{visible:Ne.value,"onUpdate:visible":a[9]||=e=>Ne.value=e,modal:``,header:e(O)(`variablesTable.editParentHeader`),style:{width:`38rem`,maxWidth:`95vw`}},{footer:_(()=>[r(e(ce),{label:e(O)(`actions.cancel`),variant:`text`,disabled:Pe.value,onClick:a[8]||=e=>Ne.value=!1},null,8,[`label`,`disabled`]),r(e(ce),{label:e(O)(`variablesTable.editParentConfirm`),severity:`warn`,loading:Pe.value,onClick:Be},null,8,[`label`,`loading`])]),default:_(()=>[Me.value?(m(),l(`div`,Cn,[r(e(oe),{severity:`warn`,class:`parent-edit__warning`},{default:_(()=>[i(v(e(O)(`variablesTable.editParentWarning`,{key:Me.value.key,env:Me.value.environmentName})),1)]),_:1}),c(`div`,wn,[c(`label`,Tn,v(e(O)(`common.value`)),1),r(e(w),{id:`parent-edit-value`,modelValue:Me.value.value,"onUpdate:modelValue":a[7]||=e=>Me.value.value=e,class:`w-full`,disabled:Pe.value},null,8,[`modelValue`,`disabled`])]),c(`div`,En,[c(`div`,Dn,[a[16]||=c(`i`,{class:`ti ti-sitemap`},null,-1),i(` `+v(e(O)(`variablesTable.editParentImpact`)),1)]),Fe.value?(m(),l(`div`,On,[a[17]||=c(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),c(`span`,null,v(e(O)(`variablesTable.editParentLoading`)),1)])):(m(),l(g,{key:1},[Le.value.length?(m(),l(`ul`,kn,[(m(!0),l(g,null,u(Le.value,(t,n)=>(m(),l(`li`,{key:n},[r(e(T),{severity:t.kind===`references`?`info`:`secondary`,value:t.kind===`references`?t.viaKey:t.kind===`inherits`?e(O)(`variablesTable.editParentInherits`):e(O)(`variablesTable.editParentDefines`)},null,8,[`severity`,`value`]),c(`span`,An,v(t.environmentName),1),t.serviceName?(m(),l(`span`,jn,v(t.serviceName),1)):b(``,!0)]))),128))])):(m(),l(`div`,Mn,v(e(O)(`variablesTable.editParentNoUsage`)),1))],64))])])):b(``,!0)]),_:1},8,[`visible`,`header`])],64))}}),[[`__scopeId`,`data-v-1d1460fd`]]);function Ln(e,t){let n=j(),r=S(),i=P(),a=f(()=>{let t=n.getByRef({id:e(),orgId:r.activeOrgId});return t?t.serviceIds.map(e=>i.getById(e)).filter(e=>!!e):[]});return f(()=>{let e=M(a.value.map(e=>e.name)),n={};for(let r of a.value){let i=pe(r.name);i&&!e.has(i)&&Object.assign(n,N({name:r.name,id:r.id,ports:r.ports,localUrls:r.localUrls,url:r.url},t()))}return n})}function Rn(e){let t=F(),n=fe(),r=j(),i=S(),a=f(()=>{let r=e.environmentId()?n.getById(e.environmentId())?.agentId:void 0,i=e.agentId?.()??r;return i?t.getById(i):t.agents.find(e=>e.isLocal)??null}),{urlHost:o,serverHost:s}=I(()=>a.value?.config.id),c=Ln(e.projectId,()=>o.value);return{values:f(()=>{let t={};for(let e of me)t[e.name]=``;t[`runeya.HOST`]=s.value;let o=a.value?.status;o?.lanIp&&(t[`agent.HOST_LAN`]=o.lanIp),o?.os&&(t[`agent.OS`]=o.os),o?.home&&(t[`agent.HOME`]=o.home),a.value&&(t[`agent.NAME`]=a.value.config.name);let l=r.getByRef({id:e.projectId(),orgId:i.activeOrgId});l&&(t[`project.NAME`]=l.name);let u=e.environmentId()?n.getById(e.environmentId()):null;return u&&(t[`runeya.ENV_NAME`]=u.name),Object.assign(t,c.value),t}),agentEntry:a,urlHost:o}}function zn(e){let n=t([]),r=t({});function i(t){let i=e();if(!i)return;let a=t.toLowerCase(),o=Object.keys(i.env).filter(e=>e.toLowerCase().includes(a));n.value=o;let s=i.variables,c={};if(s)for(let e of o){let t=Object.values(s).find(t=>t.key===e);t&&(c[e]={key:e,isSecret:t.value?.isSecret??!1,pre:t.value?.pre??``,post:t.value?.post??``})}r.value=c}return{suggestions:n,meta:r,search:i}}export{ve as a,ye as i,Rn as n,In as r,zn as t};
@@ -1 +1 @@
1
- import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{g as t}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n}from"./vue-i18n-o7yraQpR.js";import{r}from"./trpc-DlM4IpMe.js";import{n as i}from"./project.store-CnflI3la.js";import{n as a}from"./cloud-auth-D_am4FlK.js";import{n as o,r as s}from"./cloud-session-DqfQKW5D.js";import{n as c}from"./cloud-client-zXY8HZtj.js";var l=e({}),u=null;function d(){return u??=r.cloudSync.orgClouds.query().then(e=>{l.value=e}).catch(()=>{}),l}var f=e({}),p=null;function m(){return p??=r.cloudSync.orgLogos.query().then(e=>{f.value=e}).catch(()=>{}),f}async function h(e){if(e.length)try{await r.cloudSync.cacheOrgLogos.mutate({orgIds:e}),f.value=await r.cloudSync.orgLogos.query()}catch{}}function g(e,t){return`${(t??a()).replace(/\/+$/,``)}/api/org-logo/${encodeURIComponent(e)}`}function _(){let{t:l}=n(),u=i(),{accounts:d,orgAccounts:f,isLinked:p,refresh:m}=s(),g=e([]),_=e(!1),v=e(``),y=e({});async function b(){try{y.value=await r.cloudSync.orgNames.query()}catch{}}b();let x=t(()=>{let e=new Map;for(let t of u.projects){if(!t.orgId)continue;let n=f.value[t.orgId],r=e.get(t.orgId)??{orgId:t.orgId,name:``,projects:[],...n?{accountId:n}:{}};r.projects.push({projectId:t.id,name:t.name,local:!0}),e.set(t.orgId,r)}for(let t of g.value){let n=e.get(t.orgId)??{orgId:t.orgId,name:t.name,projects:[]};n.name=t.name,t.accountId&&(n.accountId=t.accountId),n.canDelete=t.canDelete;for(let e of t.projects)n.projects.some(t=>t.projectId===e.projectId)||n.projects.push(e);e.set(t.orgId,n)}for(let t of e.values())t.name||=y.value[t.orgId]??``,t.name||=l(`projectSwitcher.unknownOrg`,{id:t.orgId.slice(0,8)}),t.projects.sort((e,t)=>e.name.localeCompare(t.name));return[...e.values()]});async function S(){if(v.value=``,!p.value){g.value=[];return}_.value=!0;try{let e=new Set(u.projects.map(e=>e.id)),t;try{t=await o()}catch{throw Error(l(`projectSwitcher.orgsFailed`))}h(t.map(e=>e.id)),g.value=await Promise.all(t.map(async t=>{let n=await c.$fetch(`/project/list`,{method:`GET`,query:{organizationId:t.id},accountId:t.accountId});return{orgId:t.id,name:t.name,accountId:t.accountId,canDelete:n.data?.canDelete??!0,projects:(n.data?.projects??[]).map(t=>({projectId:t.projectId,name:t.name,local:e.has(t.projectId)}))}}))}catch(e){v.value=e instanceof Error?e.message:String(e)}finally{_.value=!1}}async function C(e,t,n){if(u.getByRef({id:t,orgId:e}))return;let i=d.value.find(e=>e.id===n),o=await r.cloudSync.trackProject.mutate({orgId:e,cloudUrl:i?.cloudUrl??a(),projectId:t,...n?{accountId:n}:{}});await w(e,t,o.state,o.pulled),await m()}async function w(e,t,n,r){if(!r&&n!==`live`)throw Object.assign(Error(T(n)),{syncState:n});for(let n=0;n<20;n++){if(await u.fetchAll(),u.getByRef({id:t,orgId:e}))return;await new Promise(e=>setTimeout(e,250))}throw Object.assign(Error(T(n)),{syncState:n})}function T(e){return l(e===`unauthenticated`?`projectSwitcher.syncPaused`:e===`outdated`?`projectSwitcher.syncOutdated`:e===`key-mismatch`?`projectSwitcher.syncKeyMismatch`:`projectSwitcher.pullTimeout`)}function E(e,t){let n=g.value.find(t=>t.orgId===e)?.projects.find(e=>e.projectId===t);n&&(n.local=!1)}return{orgGroups:x,loading:_,error:v,refreshCloud:S,pullProject:C,markUntracked:E}}export{m as i,g as n,d as r,_ as t};
1
+ import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{g as t}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n}from"./vue-i18n-o7yraQpR.js";import{r}from"./trpc-CFd5DIpB.js";import{n as i}from"./project.store-CXP-Oq1W.js";import{n as a}from"./cloud-auth-D_am4FlK.js";import{n as o,r as s}from"./cloud-session-CHtF1SMt.js";import{n as c}from"./cloud-client-CMfTrHgZ.js";var l=e({}),u=null;function d(){return u??=r.cloudSync.orgClouds.query().then(e=>{l.value=e}).catch(()=>{}),l}var f=e({}),p=null;function m(){return p??=r.cloudSync.orgLogos.query().then(e=>{f.value=e}).catch(()=>{}),f}async function h(e){if(e.length)try{await r.cloudSync.cacheOrgLogos.mutate({orgIds:e}),f.value=await r.cloudSync.orgLogos.query()}catch{}}function g(e,t){return`${(t??a()).replace(/\/+$/,``)}/api/org-logo/${encodeURIComponent(e)}`}function _(){let{t:l}=n(),u=i(),{accounts:d,orgAccounts:f,isLinked:p,refresh:m}=s(),g=e([]),_=e(!1),v=e(``),y=e({});async function b(){try{y.value=await r.cloudSync.orgNames.query()}catch{}}b();let x=t(()=>{let e=new Map;for(let t of u.projects){if(!t.orgId)continue;let n=f.value[t.orgId],r=e.get(t.orgId)??{orgId:t.orgId,name:``,projects:[],...n?{accountId:n}:{}};r.projects.push({projectId:t.id,name:t.name,local:!0}),e.set(t.orgId,r)}for(let t of g.value){let n=e.get(t.orgId)??{orgId:t.orgId,name:t.name,projects:[]};n.name=t.name,t.accountId&&(n.accountId=t.accountId),n.canDelete=t.canDelete;for(let e of t.projects)n.projects.some(t=>t.projectId===e.projectId)||n.projects.push(e);e.set(t.orgId,n)}for(let t of e.values())t.name||=y.value[t.orgId]??``,t.name||=l(`projectSwitcher.unknownOrg`,{id:t.orgId.slice(0,8)}),t.projects.sort((e,t)=>e.name.localeCompare(t.name));return[...e.values()]});async function S(){if(v.value=``,!p.value){g.value=[];return}_.value=!0;try{let e=new Set(u.projects.map(e=>e.id)),t;try{t=await o()}catch{throw Error(l(`projectSwitcher.orgsFailed`))}h(t.map(e=>e.id)),g.value=await Promise.all(t.map(async t=>{let n=await c.$fetch(`/project/list`,{method:`GET`,query:{organizationId:t.id},accountId:t.accountId});return{orgId:t.id,name:t.name,accountId:t.accountId,canDelete:n.data?.canDelete??!0,projects:(n.data?.projects??[]).map(t=>({projectId:t.projectId,name:t.name,local:e.has(t.projectId)}))}}))}catch(e){v.value=e instanceof Error?e.message:String(e)}finally{_.value=!1}}async function C(e,t,n){if(u.getByRef({id:t,orgId:e}))return;let i=d.value.find(e=>e.id===n),o=await r.cloudSync.trackProject.mutate({orgId:e,cloudUrl:i?.cloudUrl??a(),projectId:t,...n?{accountId:n}:{}});await w(e,t,o.state,o.pulled),await m()}async function w(e,t,n,r){if(!r&&n!==`live`)throw Object.assign(Error(T(n)),{syncState:n});for(let n=0;n<20;n++){if(await u.fetchAll(),u.getByRef({id:t,orgId:e}))return;await new Promise(e=>setTimeout(e,250))}throw Object.assign(Error(T(n)),{syncState:n})}function T(e){return l(e===`unauthenticated`?`projectSwitcher.syncPaused`:e===`outdated`?`projectSwitcher.syncOutdated`:e===`key-mismatch`?`projectSwitcher.syncKeyMismatch`:`projectSwitcher.pullTimeout`)}function E(e,t){let n=g.value.find(t=>t.orgId===e)?.projects.find(e=>e.projectId===t);n&&(n.local=!1)}return{orgGroups:x,loading:_,error:v,refreshCloud:S,pullProject:C,markUntracked:E}}export{m as i,g as n,d as r,_ as t};
@@ -0,0 +1 @@
1
+ import{g as e}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as t}from"./project-launch.store-DBuxvZJr.js";import{n}from"./project.store-CXP-Oq1W.js";import{t as r}from"./open-project-org-BNDadG2_.js";import{r as i}from"./cloud-session-CHtF1SMt.js";function a(){let{user:a,currentAccount:o,loading:s,accountPending:c}=i(),l=n(),u=t(),d=e(()=>r(u,l)),f=e(()=>!!d.value&&o.value!==null),p=e(()=>f.value?d.value:``),m=e(()=>!!d.value&&!f.value&&(s.value||c.value)),h=e(()=>!!p.value||m.value);return{orgId:p,available:h,unavailability:e(()=>h.value?null:d.value?`not-member`:`local-project`),cloudUser:a}}export{a as t};
@@ -1 +1 @@
1
- import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{ct as t,g as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{r}from"./trpc-DlM4IpMe.js";import{_ as i}from"./dist-Cx_klvkk.js";import{t as a}from"./agent.store-BwUoohNu.js";function o(o){let s=a(),c=n(()=>{let e=o?.();return e?s.getById(e):s.agents.find(e=>e.isLocal)??null}),l=e(`localhost`);return t(async()=>{try{l.value=(await r.settings.getNetwork.query()).host}catch{}}),{serverHost:l,urlHost:n(()=>i(l.value)||(c.value?.status.lanIp??`localhost`)),agent:c}}export{o as t};
1
+ import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{ct as t,g as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{r}from"./trpc-CFd5DIpB.js";import{_ as i}from"./dist-CjS_rxe9.js";import{t as a}from"./agent.store-5ggNQfb3.js";function o(o){let s=a(),c=n(()=>{let e=o?.();return e?s.getById(e):s.agents.find(e=>e.isLocal)??null}),l=e(`localhost`);return t(async()=>{try{l.value=(await r.settings.getNetwork.query()).host}catch{}}),{serverHost:l,urlHost:n(()=>i(l.value)||(c.value?.status.lanIp??`localhost`)),agent:c}}export{o as t};
@@ -0,0 +1 @@
1
+ import"./src-B1nAsOcw.js";
package/web/index.html CHANGED
@@ -15,50 +15,51 @@
15
15
  content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content"
16
16
  />
17
17
  <title>Runeya</title>
18
- <script type="module" crossorigin src="/assets/index-CYcPxjSC.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-Z4n9BqGD.js"></script>
19
19
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/reactivity.esm-bundler-BQ9SB2vv.js">
21
21
  <link rel="modulepreload" crossorigin href="/assets/runtime-core.esm-bundler-DujKY9QV.js">
22
22
  <link rel="modulepreload" crossorigin href="/assets/runtime-dom.esm-bundler-CyEVRK6B.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/vue-i18n-o7yraQpR.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-BZ1Pz5am.js">
25
- <link rel="modulepreload" crossorigin href="/assets/auth-DdEdmJV5.js">
26
- <link rel="modulepreload" crossorigin href="/assets/trpc-DlM4IpMe.js">
27
- <link rel="modulepreload" crossorigin href="/assets/project-launch.store-DkD7Q9jW.js">
28
- <link rel="modulepreload" crossorigin href="/assets/i18n-B8hHo8g2.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/auth-ArDkSMsT.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/trpc-CFd5DIpB.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/project-launch.store-DBuxvZJr.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/i18n-f_6x1GJ8.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/useApi-s_02lHjl-DZYO2tHU.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/devtools-DCoWQoU_-D2vs4YXr.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/vue-router--yRg_Dd_.js">
32
32
  <link rel="modulepreload" crossorigin href="/assets/floating-ui.dom-DF3oyfHd.js">
33
- <link rel="modulepreload" crossorigin href="/assets/src-CcVk2-Gw.js">
33
+ <link rel="modulepreload" crossorigin href="/assets/src-B1nAsOcw.js">
34
34
  <link rel="modulepreload" crossorigin href="/assets/error-DpF7X5iu.js">
35
- <link rel="modulepreload" crossorigin href="/assets/project.store-CnflI3la.js">
35
+ <link rel="modulepreload" crossorigin href="/assets/project.store-CXP-Oq1W.js">
36
36
  <link rel="modulepreload" crossorigin href="/assets/use-polling-CEkhIY_9.js">
37
37
  <link rel="modulepreload" crossorigin href="/assets/useAiChatDrawer-D_ofn8Eo.js">
38
- <link rel="modulepreload" crossorigin href="/assets/settings-scope-Ca1LjLG1.js">
38
+ <link rel="modulepreload" crossorigin href="/assets/settings-scope-EYddCMQs.js">
39
39
  <link rel="modulepreload" crossorigin href="/assets/schemas-68I2iCLF.js">
40
- <link rel="modulepreload" crossorigin href="/assets/dist-Cx_klvkk.js">
41
- <link rel="modulepreload" crossorigin href="/assets/service.store-yECOKc1C.js">
42
- <link rel="modulepreload" crossorigin href="/assets/notification.store-CWs6iQmx.js">
43
- <link rel="modulepreload" crossorigin href="/assets/scenario.store-DGt8nNt5.js">
40
+ <link rel="modulepreload" crossorigin href="/assets/dist-CjS_rxe9.js">
41
+ <link rel="modulepreload" crossorigin href="/assets/service.store-oNOqRX_s.js">
42
+ <link rel="modulepreload" crossorigin href="/assets/notification.store-C8qNYGB5.js">
43
+ <link rel="modulepreload" crossorigin href="/assets/scenario.store-B6TiJlpU.js">
44
44
  <link rel="modulepreload" crossorigin href="/assets/app-mode-BVpTuh0i.js">
45
45
  <link rel="modulepreload" crossorigin href="/assets/cloud-auth-D_am4FlK.js">
46
- <link rel="modulepreload" crossorigin href="/assets/cloud-session-DqfQKW5D.js">
47
- <link rel="modulepreload" crossorigin href="/assets/cloud-client-zXY8HZtj.js">
48
- <link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-D1RgJoOm.js">
46
+ <link rel="modulepreload" crossorigin href="/assets/open-project-org-BNDadG2_.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/cloud-session-CHtF1SMt.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/cloud-client-CMfTrHgZ.js">
49
+ <link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-DT8MiHr7.js">
49
50
  <link rel="modulepreload" crossorigin href="/assets/editor.api-Bef3xeth.js">
50
51
  <link rel="modulepreload" crossorigin href="/assets/toggleHighContrast-Dqz1Qao1.js">
51
52
  <link rel="modulepreload" crossorigin href="/assets/register-BLGIM2pN.js">
52
- <link rel="modulepreload" crossorigin href="/assets/agent.store-BwUoohNu.js">
53
- <link rel="modulepreload" crossorigin href="/assets/AiChatModals-BEpSEXmp.js">
53
+ <link rel="modulepreload" crossorigin href="/assets/agent.store-5ggNQfb3.js">
54
+ <link rel="modulepreload" crossorigin href="/assets/AiChatModals-Ccx5-MPb.js">
54
55
  <link rel="modulepreload" crossorigin href="/assets/process-BWkHpZOM.js">
55
56
  <link rel="modulepreload" crossorigin href="/assets/theme-BZCAxfJD.js">
56
- <link rel="stylesheet" crossorigin href="/assets/src-DOziuDw8.css">
57
+ <link rel="stylesheet" crossorigin href="/assets/src-BR35jQnn.css">
57
58
  <link rel="stylesheet" crossorigin href="/assets/scenario-DOeZsRCE.css">
58
59
  <link rel="stylesheet" crossorigin href="/assets/editor-8AbsNvUX.css">
59
60
  <link rel="stylesheet" crossorigin href="/assets/toggleHighContrast--ixms01u.css">
60
61
  <link rel="stylesheet" crossorigin href="/assets/AiChatModals-DS5R3Oz1.css">
61
- <link rel="stylesheet" crossorigin href="/assets/index-DozDRY7J.css">
62
+ <link rel="stylesheet" crossorigin href="/assets/index-DiXnhxxp.css">
62
63
  </head>
63
64
  <body>
64
65
  <div id="app"></div>
@@ -1,13 +0,0 @@
1
- import {
2
- agentManager
3
- } from "./chunk-TMX3NXMQ.js";
4
- import "./chunk-NV7MBTNW.js";
5
- import "./chunk-N4ZP7T6L.js";
6
- import "./chunk-OZBSOSAS.js";
7
- import "./chunk-JAMAGUGN.js";
8
- import "./chunk-ETPXJSVC.js";
9
- import "./chunk-EZ35ISYR.js";
10
- export {
11
- agentManager
12
- };
13
- //# sourceMappingURL=agent-manager-KDL4JWZN.js.map
package/chat-X6GWKPKG.js DELETED
@@ -1,28 +0,0 @@
1
- import {
2
- chatRouter,
3
- cliToken,
4
- startClaudeCodeSession,
5
- startCliSession,
6
- startCodexSession
7
- } from "./chunk-IYL545N3.js";
8
- import "./chunk-6L273MQO.js";
9
- import "./chunk-L3BEQ75K.js";
10
- import "./chunk-SVKR7CYU.js";
11
- import "./chunk-I4FSX522.js";
12
- import "./chunk-V7WTXGEJ.js";
13
- import "./chunk-TMX3NXMQ.js";
14
- import "./chunk-NV7MBTNW.js";
15
- import "./chunk-N4ZP7T6L.js";
16
- import "./chunk-OZBSOSAS.js";
17
- import "./chunk-JAMAGUGN.js";
18
- import "./chunk-MD3VW4HQ.js";
19
- import "./chunk-ETPXJSVC.js";
20
- import "./chunk-EZ35ISYR.js";
21
- export {
22
- chatRouter,
23
- cliToken,
24
- startClaudeCodeSession,
25
- startCliSession,
26
- startCodexSession
27
- };
28
- //# sourceMappingURL=chat-X6GWKPKG.js.map