@oneclick.dev/cms-core-modules 0.0.123 → 0.0.125

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 (223) hide show
  1. package/dist/AppointmentListTable-CWzbwqR-.js +1 -0
  2. package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
  3. package/dist/ContentEditor-BlNbqkAz.js +324 -0
  4. package/dist/{ContentEditor-MDGolnIP.mjs → ContentEditor-D754iLJS.mjs} +7985 -26820
  5. package/dist/{Detail-Dk8E6_uF.mjs → Detail-BOxWQ1QQ.mjs} +15 -14
  6. package/dist/{Detail-Cn9Bk0u0.mjs → Detail-BfKW0uZE.mjs} +26 -25
  7. package/dist/Detail-DFVu2F38.mjs +11 -0
  8. package/dist/Detail-DJea_fCd.js +1 -0
  9. package/dist/Detail-DPJacXfm.js +1 -0
  10. package/dist/Detail-DSLZ7_bM.js +1 -0
  11. package/dist/Detail-DUGThL9Y.js +1 -0
  12. package/dist/{Detail-B_scnidb.mjs → Detail-D_LlEeHu.mjs} +35 -34
  13. package/dist/Editor-D4evcdhv.mjs +768 -0
  14. package/dist/Editor-gLLtuJbY.js +1 -0
  15. package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-BjKpsqT9.js +1 -0
  16. package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs +76 -0
  17. package/dist/Knowledge-B66vxz--.js +1 -0
  18. package/dist/Knowledge-BnMTTuJ7.mjs +742 -0
  19. package/dist/Overview-0hFXiuYo.js +1 -0
  20. package/dist/Overview-BE4uYPx0.mjs +745 -0
  21. package/dist/Overview-BTx5LF4J.js +1 -0
  22. package/dist/Overview-CCu2PHai.mjs +289 -0
  23. package/dist/Overview-CQRpFhbJ.mjs +286 -0
  24. package/dist/Overview-CTs7sX4d.js +1 -0
  25. package/dist/Overview-Cj89XXKN.js +1 -0
  26. package/dist/Overview-D2u-leeO.js +1 -0
  27. package/dist/Overview-D_2wozCG.mjs +1733 -0
  28. package/dist/Overview-D_c18mbR.mjs +248 -0
  29. package/dist/Overview-Dffo-zH4.mjs +11 -0
  30. package/dist/Overview-g4Rcj245.js +1 -0
  31. package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
  32. package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
  33. package/dist/TableDataWidget-BwqWFH4A.js +1 -0
  34. package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
  35. package/dist/TableOverviewCard-BPWCqo56.js +1 -0
  36. package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
  37. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
  38. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
  39. package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
  40. package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
  41. package/dist/TableView-CwhZ9YN2.js +4 -0
  42. package/dist/TableView-DX9PKS8N.mjs +9673 -0
  43. package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
  44. package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
  45. package/dist/Test-CzmOmi53.mjs +447 -0
  46. package/dist/Test-USDtNFY1.js +1 -0
  47. package/dist/UserDetail-DpUL3mhk.mjs +1483 -0
  48. package/dist/UserDetail-KRIfxaYd.js +1 -0
  49. package/dist/cms-core-modules.css +1 -1
  50. package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
  51. package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
  52. package/dist/index-6hZ6MYY6.js +1 -0
  53. package/dist/index-BVmmicu3.mjs +14 -0
  54. package/dist/index-CQuN5rKx.js +1 -0
  55. package/dist/index-ChHD_1Cf.js +144 -0
  56. package/dist/index-CnDGeInm.js +1 -0
  57. package/dist/index-CqDTc5Ig.mjs +20 -0
  58. package/dist/index-CvV4nVWI.js +1 -0
  59. package/dist/index-CyvvAdt4.js +1 -0
  60. package/dist/index-DH2z0W_w.mjs +19012 -0
  61. package/dist/index-DIRD7t5_.mjs +20 -0
  62. package/dist/index-DZKzj48V.mjs +17 -0
  63. package/dist/index-OJuBYR60.mjs +57 -0
  64. package/dist/index.cjs.js +1 -1
  65. package/dist/index.mjs +480 -103
  66. package/dist/orders-C_sz8J9b.js +1 -0
  67. package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
  68. package/dist/server-handlers.cjs.js +1 -1
  69. package/dist/server-handlers.mjs +2696 -605
  70. package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
  71. package/dist/src/appointments/index.d.ts +93 -3
  72. package/dist/src/appointments/reservation-summary.d.ts +48 -0
  73. package/dist/src/appointments/server.d.ts +1 -0
  74. package/dist/src/appointments/tools.d.ts +93 -3
  75. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.d.ts +1 -1
  76. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.d.ts +7 -0
  77. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.d.ts +7 -0
  78. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/resizeHistory.d.ts +9 -0
  79. package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +3 -1
  80. package/dist/src/filezone/config.d.ts +31 -0
  81. package/dist/src/filezone/index.d.ts +43 -0
  82. package/dist/src/filezone/index.vue.d.ts +2 -0
  83. package/dist/src/filezone/metadata.d.ts +2 -0
  84. package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
  85. package/dist/src/filezone/permissions.d.ts +5 -0
  86. package/dist/src/filezone/routes.d.ts +5 -0
  87. package/dist/src/filezone/server.d.ts +36 -0
  88. package/dist/src/firebaseAuthManager/components/DeleteUserDialog.vue.d.ts +25 -0
  89. package/dist/src/firebaseAuthManager/components/ReasonActionDialog.vue.d.ts +23 -0
  90. package/dist/src/firebaseAuthManager/components/UserStatusBadge.vue.d.ts +5 -0
  91. package/dist/src/firebaseAuthManager/config.d.ts +151 -0
  92. package/dist/src/firebaseAuthManager/index.d.ts +163 -0
  93. package/dist/src/firebaseAuthManager/index.vue.d.ts +14 -0
  94. package/dist/src/firebaseAuthManager/metadata.d.ts +2 -0
  95. package/dist/src/firebaseAuthManager/pages/Overview.vue.d.ts +2 -0
  96. package/dist/src/firebaseAuthManager/pages/UserDetail.vue.d.ts +2 -0
  97. package/dist/src/firebaseAuthManager/permissions.d.ts +5 -0
  98. package/dist/src/firebaseAuthManager/routes.d.ts +5 -0
  99. package/dist/src/firebaseAuthManager/server.d.ts +162 -0
  100. package/dist/src/firebaseAuthManager/types.d.ts +84 -0
  101. package/dist/src/formBuilder/components/FormPreviewDialog.vue.d.ts +12 -0
  102. package/dist/src/formBuilder/components/FormStatusBadge.vue.d.ts +9 -0
  103. package/dist/src/formBuilder/config.d.ts +31 -0
  104. package/dist/src/formBuilder/index.d.ts +44 -0
  105. package/dist/src/formBuilder/index.vue.d.ts +14 -0
  106. package/dist/src/formBuilder/lib/forms.d.ts +11 -0
  107. package/dist/src/formBuilder/metadata.d.ts +2 -0
  108. package/dist/src/formBuilder/pages/Editor.vue.d.ts +2 -0
  109. package/dist/src/formBuilder/pages/Overview.vue.d.ts +2 -0
  110. package/dist/src/formBuilder/permissions.d.ts +5 -0
  111. package/dist/src/formBuilder/routes.d.ts +5 -0
  112. package/dist/src/formBuilder/server.d.ts +87 -0
  113. package/dist/src/formBuilder/tools.d.ts +1 -0
  114. package/dist/src/formBuilder/types.d.ts +46 -0
  115. package/dist/src/helpbot/composables/useHelpbotApi.d.ts +18 -0
  116. package/dist/src/helpbot/config.d.ts +17 -0
  117. package/dist/src/helpbot/index.d.ts +29 -0
  118. package/dist/src/helpbot/index.vue.d.ts +2 -0
  119. package/dist/src/helpbot/metadata.d.ts +2 -0
  120. package/dist/src/helpbot/pages/Knowledge.vue.d.ts +4 -0
  121. package/dist/src/helpbot/pages/Overview.vue.d.ts +2 -0
  122. package/dist/src/helpbot/pages/Test.vue.d.ts +4 -0
  123. package/dist/src/helpbot/permissions.d.ts +5 -0
  124. package/dist/src/helpbot/routes.d.ts +5 -0
  125. package/dist/src/helpbot/types.d.ts +42 -0
  126. package/dist/src/index.d.ts +5 -0
  127. package/dist/src/mailTemplates/builder-types.d.ts +40 -0
  128. package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
  129. package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
  130. package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
  131. package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
  132. package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
  133. package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
  134. package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
  135. package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
  136. package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
  137. package/dist/src/mailTemplates/config.d.ts +10 -4
  138. package/dist/src/mailTemplates/defaults.d.ts +10 -0
  139. package/dist/src/mailTemplates/editor-state.d.ts +21 -0
  140. package/dist/src/mailTemplates/index.d.ts +11 -5
  141. package/dist/src/mailTemplates/index.vue.d.ts +2 -4
  142. package/dist/src/mailTemplates/metadata.d.ts +1 -1
  143. package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
  144. package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
  145. package/dist/src/mailTemplates/server.d.ts +23 -0
  146. package/dist/src/server-handlers.d.ts +6 -0
  147. package/dist/src/table/badge-filter-utils.d.ts +8 -0
  148. package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
  149. package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
  150. package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
  151. package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
  152. package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
  153. package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
  154. package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
  155. package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
  156. package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
  157. package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
  158. package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
  159. package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
  160. package/dist/src/table/composables/useTableClock.d.ts +4 -0
  161. package/dist/src/table/display-utils.d.ts +35 -0
  162. package/dist/src/table/row-value.d.ts +1 -0
  163. package/dist/src/table/stat-utils.d.ts +9 -0
  164. package/dist/src/table/tool-utils.d.ts +1 -1
  165. package/dist/src/table/types.d.ts +54 -1
  166. package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
  167. package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
  168. package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
  169. package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
  170. package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
  171. package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
  172. package/dist/src/whatsappBusiness/config.d.ts +51 -0
  173. package/dist/src/whatsappBusiness/connection.d.ts +77 -0
  174. package/dist/src/whatsappBusiness/index.d.ts +63 -0
  175. package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
  176. package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
  177. package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
  178. package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
  179. package/dist/src/whatsappBusiness/provider.d.ts +21 -0
  180. package/dist/src/whatsappBusiness/routes.d.ts +5 -0
  181. package/dist/src/whatsappBusiness/server.d.ts +14 -0
  182. package/dist/src/whatsappBusiness/templates.d.ts +94 -0
  183. package/dist/src/whatsappBusiness/types.d.ts +162 -0
  184. package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
  185. package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
  186. package/dist/types-9N-DKxNj.mjs +250 -0
  187. package/dist/types-B5MifmeF.mjs +2696 -0
  188. package/dist/types-Cem0vPo_.js +1 -0
  189. package/dist/types-D5dgTskW.js +1 -0
  190. package/dist/useHelpbotApi-BIIungOh.js +1 -0
  191. package/dist/useHelpbotApi-HC9JSiSn.mjs +229 -0
  192. package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
  193. package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
  194. package/dist/vee-validate-zod-CWZwNTWE.js +1 -0
  195. package/dist/vee-validate-zod-D0WaDgDZ.mjs +1780 -0
  196. package/package.json +2 -2
  197. package/src/appointments/tools.ts +52 -2
  198. package/src/formBuilder/tools.ts +1 -0
  199. package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
  200. package/dist/AppointmentListTable-Dieu9US_.js +0 -1
  201. package/dist/ContentEditor-C-Wm48ai.js +0 -467
  202. package/dist/Detail-BCUUNWvp.js +0 -1
  203. package/dist/Detail-Byk781b4.mjs +0 -26
  204. package/dist/Detail-DGg_xXZc.js +0 -1
  205. package/dist/Detail-Sc2qZdxj.js +0 -1
  206. package/dist/Detail-mvSGbnFU.js +0 -1
  207. package/dist/Overview-BDlBCUI_.js +0 -1
  208. package/dist/Overview-Su8ZUbMs.mjs +0 -26
  209. package/dist/TableDataWidget-7qvC3Egd.js +0 -1
  210. package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
  211. package/dist/TableOverviewCard-AFq-puJs.js +0 -1
  212. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
  213. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
  214. package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
  215. package/dist/TableView-BkwoKREo.js +0 -4
  216. package/dist/TableView-C4Zyp8d7.mjs +0 -8228
  217. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
  218. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
  219. package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
  220. package/dist/dateRangePresets-CPWqst_x.js +0 -1
  221. package/dist/orders-DUa2PVoa.js +0 -1
  222. package/dist/vee-validate-zod-SjDT8X35.mjs +0 -4404
  223. package/dist/vee-validate-zod-VCmLnrtQ.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ae=require("nuxt/app"),d=require("lucide-vue-next"),le=require("./dateRangePresets-CPWqst_x.js"),N=require("./TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js"),ie={class:"w-full min-w-0"},ce={key:0,class:"flex items-center gap-2 py-3"},de={class:"text-xs text-muted-foreground"},ue={key:1,class:"rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"},me={key:2,class:"overflow-hidden rounded-xl border bg-background"},pe={class:"flex items-start gap-3 border-b bg-muted/30 p-3"},fe={class:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10"},ge={class:"min-w-0 flex-1"},ye={class:"truncate text-sm font-semibold"},be={class:"mt-0.5 text-[11px] text-muted-foreground"},xe={key:0,class:"mt-2 flex flex-wrap gap-1"},he={class:"grid gap-3 border-b p-3 sm:grid-cols-2"},_e={class:"rounded-lg border bg-muted/15 p-2.5"},ke={class:"flex items-center gap-1.5 text-[11px] font-medium"},ve={class:"rounded-lg border bg-muted/15 p-2.5"},we={class:"flex items-center gap-1.5 text-[11px] font-medium"},Ne={key:0,class:"mt-1.5 flex flex-wrap gap-1"},Ae={key:1,class:"mt-1 text-xs text-muted-foreground"},Ee={class:"border-b p-3"},Be={class:"mb-2 flex items-center justify-between gap-2"},Se={class:"flex items-center gap-1.5 text-[11px] font-medium"},Ve={class:"text-[10px] text-muted-foreground"},Ce={key:0,class:"flex flex-wrap gap-1.5"},De={class:"font-medium"},$e={class:"text-muted-foreground"},Re={key:0,class:"text-muted-foreground/70"},je={key:1,class:"text-xs text-muted-foreground"},ze={class:"p-3"},Fe={key:0,class:"mt-2 text-[11px] text-amber-600 dark:text-amber-400"},Le={key:0,class:"border-t bg-muted/20 px-3 py-2 text-[10px] text-muted-foreground"},Te=e.defineComponent({__name:"TableOverviewCard",props:{projectSlug:{},toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(f,{emit:z}){const i=f,F=z,{$useProjectService:L,$useModuleStorage:T,$useFlowBuilder:O,$useRoute:A}=ae.useNuxtApp(),p=e.ref(!0),u=e.ref(null),a=e.ref(null),g=e.ref(null),E=e.ref(!1),B=e.computed(()=>{const t=Number(i.resolvedArgs?.sampleLimit);return Number.isFinite(t)?Math.min(Math.max(Math.floor(t),1),10):3}),I=e.computed(()=>a.value?.columns.filter(t=>t.visible!==!1)||[]),S=e.computed(()=>{if(!a.value)return[];const t={fetchConfigured:"Data source connected",viewable:"Row details",editable:"Editable",deletable:"Deletable",addable:"Addable",searchable:"Searchable",downloadable:"Downloadable",allowBulkActions:"Bulk actions"};return Object.entries(a.value.capabilities).filter(([,r])=>r).map(([r])=>t[r]||r)});function M(){if(i.status!=="completed")return!1;const t=i.resolvedArgs?._cachedData;return!t||typeof t!="object"||Array.isArray(t)?!1:typeof t.error=="string"?(u.value=t.error,p.value=!1,!0):!t.module||!Array.isArray(t.columns)||!Array.isArray(t.sampleRows)?!1:(a.value=t,g.value=i.resolvedArgs?._fetchedAt||null,p.value=!1,!0)}async function P(){p.value=!0,u.value=null;try{const t=L(),r=T({projectId:i.projectSlug,moduleId:i.instanceId}),[o,n]=await Promise.all([t.getModule(i.projectSlug,i.instanceId),r.getAllModuleData()]),s=q(n),l=U(s.columns),b=Y(s.itemActions),h=H(s.filters),_=Q(s.stats),k=W(s.dateRangeFilter);let m=[],v;if(o?.config?.getItems)try{const{runFlow:c}=O(),ne=typeof A=="function"?A():null,se=await c(o.config.getItems,Z(k.defaultPreset,ne?.query||{}));m=G(se)}catch(c){v=D(c,"The table data sample could not be loaded.")}const w=l.length>0?l:X(m),$=w.filter(c=>c.visible!==!1).slice(0,40),R=$.length>0?m.slice(0,B.value).map(c=>J(c,$)).map(te):[],j=N.serializeBounded({module:{id:i.instanceId,name:o?.name||i.instanceName,type:o?.type||i.moduleType},capabilities:{fetchConfigured:!!o?.config?.getItems,viewable:o?.config?.viewable===!0,editable:o?.config?.editable===!0,deletable:o?.config?.deletable===!0,addable:o?.config?.addable===!0,searchable:o?.config?.searchable===!0,downloadable:o?.config?.downloadable===!0,allowBulkActions:o?.config?.allowBulkActions===!0},columnCount:w.length,columns:w.slice(0,40),dateRangeFilter:k,actionCount:b.length,actions:b.slice(0,20),filters:h.slice(0,20),stats:_.slice(0,20),totalRows:m.length,sampleCount:R.length,sampleRows:R,...v?{sampleError:v}:{}},512*1024);a.value=j,g.value=new Date().toISOString(),V(j)}catch(t){u.value=D(t,"Failed to inspect this table."),V({error:u.value})}finally{p.value=!1}}function V(t){i.status==="completed"||E.value||(E.value=!0,F("submit",t))}function q(t){return Array.isArray(t)?Object.fromEntries(t.filter(r=>r&&typeof r.key=="string").map(r=>[r.key,r.value])):t&&typeof t=="object"?t:{}}function U(t){return Array.isArray(t)?t.filter(r=>r&&typeof r.property=="string"&&r.property.trim()).map((r,o)=>({id:typeof r.id=="string"?r.id:`column-${o}`,property:r.property,label:typeof r.label=="string"&&r.label.trim()?r.label:y(r.property),type:typeof r.type=="string"&&r.type?r.type:"text",visible:r.visible!==!1})):[]}function Y(t){return Array.isArray(t)?t.filter(r=>r&&r.flow&&(typeof r.id=="string"||typeof r.label=="string")).map((r,o)=>({id:typeof r.id=="string"?r.id:`action-${o}`,label:typeof r.label=="string"&&r.label.trim()?r.label:`Action ${o+1}`})):[]}function H(t){return Array.isArray(t)?t.filter(r=>r&&typeof r.property=="string").map((r,o)=>({id:typeof r.id=="string"?r.id:`filter-${o}`,label:typeof r.label=="string"&&r.label.trim()?r.label:y(r.property),property:r.property})):[]}function Q(t){return Array.isArray(t)?t.filter(r=>r&&typeof r.method=="string").map((r,o)=>({id:typeof r.id=="string"?r.id:`stat-${o}`,label:typeof r.label=="string"&&r.label.trim()?r.label:`Statistic ${o+1}`,method:r.method,...typeof r.field=="string"&&r.field?{field:r.field}:{}})):[]}function W(t){const r=t&&typeof t.defaultDate=="string"&&t.defaultDate?t.defaultDate:null;return{enabled:!!r,defaultPreset:r,label:r?re(r):"Not configured"}}function Z(t,r){const o=Object.entries(r).map(([h,_])=>({name:h.replace(/-([a-z])/g,(k,m)=>m.toUpperCase()),type:"routeQueryParam",value:_??null}));if(!t)return o;const s=le.getDateRangePresets()[t];if(!Array.isArray(s)||!s[0])return o;const l=C(s[0],!1),b=C(s[1]||s[0],!0);return[...o,{name:"dateRangeFilter",type:"dateRangeFilter",value:{from:l,to:b}}]}function C(t,r){const[o,n,s]=t.split("-").map(Number),l=new Date(o,n-1,s);return r&&l.setHours(23,59,59,999),l}function G(t){return(Array.isArray(t)?t:Array.isArray(t?.data)?t.data:Array.isArray(t?.items)?t.items:Array.isArray(t?.rows)?t.rows:[]).map(o=>o&&typeof o=="object"&&!Array.isArray(o)?o:{value:o})}function J(t,r){return Object.fromEntries(r.map(o=>[o.property,K(t,o.property)]))}function K(t,r){const o=r.split(".");if(!o.some(n=>["__proto__","constructor","prototype"].includes(n)))return Object.prototype.hasOwnProperty.call(t,r)?t[r]:o.reduce((n,s)=>n?.[s],t)}function X(t){const r=[],o=new Set;for(const n of t.slice(0,10))for(const s of Object.keys(n))o.has(s)||(o.add(s),r.push(s));return r.slice(0,40).map((n,s)=>({id:`inferred-${s}`,property:n,label:y(n),type:ee(n,t.map(l=>l[n])),visible:!0}))}function ee(t,r){const n=t.toLowerCase().replace(/[_.-]/g,"");if(/email$/.test(n))return"email";if(/(phone|mobile|telephone|tel)$/.test(n))return"phone";if(/(image|photo|avatar|thumbnail|logo|picture)$/.test(n))return"image";if(/(url|link|website|href)$/.test(n))return"URL";if(/(price|amount|cost|total|revenue|salary|fee)$/.test(n))return"currency";if(/(date|createdat|updatedat|timestamp)$/.test(n))return"datetime";const s=r.filter(l=>l!=null&&l!=="");return s.length===0?"text":s.every(l=>typeof l=="boolean")?"boolean":s.every(l=>Array.isArray(l))?"array":s.every(l=>typeof l=="number")?"number":"text"}function te(t){const r=x(t,0,new WeakSet);try{return N.serializeBounded(r,32*1024)}catch{return{_sampleOmitted:"This sample row was too large to include in chat."}}}function x(t,r,o){if(t==null||typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return t.length>500?`${t.slice(0,499)}…`:t;if(typeof t=="bigint")return String(t);if(t instanceof Date)return t.toISOString();if(typeof t!="object")return String(t);if(r>=3)return Array.isArray(t)?`[Array(${t.length})]`:"[Object]";if(o.has(t))return"[Circular]";if(o.add(t),Array.isArray(t)){const s=t.slice(0,10).map(l=>x(l,r+1,o));return t.length>10&&s.push(`[${t.length-10} more items]`),s}const n={};for(const[s,l]of Object.entries(t).slice(0,20))s==="__proto__"||s==="constructor"||s==="prototype"||(n[s]=x(l,r+1,o));return n}function y(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_.-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}function re(t){return{today:"Today",yesterday:"Yesterday",last7days:"Last 7 days",lastMonth:"Last 30 days",last6months:"Last 6 months",lastYear:"Last 12 months",tomorrow:"Tomorrow",next7days:"Next 7 days",nextMonth:"Next 30 days",next6months:"Next 6 months",nextYear:"Next 12 months"}[t]||y(t)}function D(t,r){const o=t?.data?.statusMessage||t?.statusMessage||t?.message;return typeof o=="string"&&o.trim()?o.slice(0,500):r}function oe(t){if(!t)return"";const r=new Date(t);return Number.isNaN(r.getTime())?"":r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}return e.onMounted(()=>{i.status==="completed"&&M()||P()}),(t,r)=>{const o=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",ie,[p.value?(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(e.unref(d.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),e.createElementVNode("span",de,"Inspecting "+e.toDisplayString(f.instanceName)+"…",1)])):u.value?(e.openBlock(),e.createElementBlock("div",ue,e.toDisplayString(u.value),1)):a.value?(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",pe,[e.createElementVNode("div",fe,[e.createVNode(e.unref(d.Table2),{class:"size-4 text-primary"})]),e.createElementVNode("div",ge,[e.createElementVNode("p",ye,e.toDisplayString(a.value.module.name),1),e.createElementVNode("p",be,e.toDisplayString(a.value.totalRows)+" "+e.toDisplayString(a.value.totalRows===1?"row":"rows")+" · "+e.toDisplayString(a.value.columnCount)+" "+e.toDisplayString(a.value.columnCount===1?"column":"columns"),1),S.value.length?(e.openBlock(),e.createElementBlock("div",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,n=>(e.openBlock(),e.createElementBlock("span",{key:n,class:"inline-flex items-center gap-1 rounded-full border bg-background px-1.5 py-0.5 text-[10px] text-muted-foreground"},[e.createVNode(e.unref(d.Check),{class:"size-2.5 text-emerald-500"}),e.createTextVNode(" "+e.toDisplayString(n),1)]))),128))])):e.createCommentVNode("",!0)]),e.createVNode(o,{to:`/projects/${f.projectSlug}/modules/${f.instanceId}`,class:"inline-flex shrink-0 items-center gap-1 text-[11px] text-primary hover:underline"},{default:e.withCtx(()=>[r[0]||(r[0]=e.createTextVNode(" Open ",-1)),e.createVNode(e.unref(d.ExternalLink),{class:"size-3"})]),_:1},8,["to"])]),e.createElementVNode("div",he,[e.createElementVNode("div",_e,[e.createElementVNode("div",ke,[e.createVNode(e.unref(d.CalendarRange),{class:"size-3.5 text-primary"}),r[1]||(r[1]=e.createTextVNode(" Date range filter ",-1))]),e.createElementVNode("p",{class:e.normalizeClass(["mt-1 text-xs",a.value.dateRangeFilter.enabled?"text-foreground":"text-muted-foreground"])},e.toDisplayString(a.value.dateRangeFilter.label),3)]),e.createElementVNode("div",ve,[e.createElementVNode("div",we,[e.createVNode(e.unref(d.MousePointerClick),{class:"size-3.5 text-primary"}),r[2]||(r[2]=e.createTextVNode(" Row actions ",-1))]),a.value.actions.length?(e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.actions,n=>(e.openBlock(),e.createElementBlock("span",{key:n.id,class:"rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary"},e.toDisplayString(n.label),1))),128))])):(e.openBlock(),e.createElementBlock("p",Ae,"No row actions configured"))])]),e.createElementVNode("div",Ee,[e.createElementVNode("div",Be,[e.createElementVNode("div",Se,[e.createVNode(e.unref(d.Columns3),{class:"size-3.5 text-primary"}),r[3]||(r[3]=e.createTextVNode(" Columns ",-1))]),e.createElementVNode("span",Ve,e.toDisplayString(I.value.length)+" visible ",1)]),a.value.columns.length?(e.openBlock(),e.createElementBlock("div",Ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value.columns,n=>(e.openBlock(),e.createElementBlock("span",{key:n.id||n.property,class:e.normalizeClass(["inline-flex items-center gap-1 rounded-md border px-2 py-1 text-[10px]",n.visible?"bg-background":"bg-muted/40 text-muted-foreground"])},[e.createElementVNode("span",De,e.toDisplayString(n.label),1),e.createElementVNode("span",$e,e.toDisplayString(n.type),1),n.visible?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Re,"hidden"))],2))),128))])):(e.openBlock(),e.createElementBlock("p",je,"No columns could be inferred."))]),e.createElementVNode("div",ze,[e.createVNode(N._sfc_main,{rows:a.value.sampleRows,columns:a.value.columns,title:"Sample data",description:a.value.sampleCount?`First ${a.value.sampleCount} ${a.value.sampleCount===1?"row":"rows"} from the current data set`:"","total-count":a.value.sampleCount,"max-rows":B.value,"max-columns":6,"empty-text":"No sample rows were returned."},null,8,["rows","columns","description","total-count","max-rows"]),a.value.sampleError?(e.openBlock(),e.createElementBlock("p",Fe,e.toDisplayString(a.value.sampleError),1)):e.createCommentVNode("",!0)]),g.value?(e.openBlock(),e.createElementBlock("div",Le," Snapshot from "+e.toDisplayString(oe(g.value)),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])}}});exports.default=Te;
@@ -1,534 +0,0 @@
1
- import { defineComponent as ie, computed as _, openBlock as u, createElementBlock as f, createElementVNode as L, createVNode as A, unref as w, toDisplayString as b, createCommentVNode as N, Fragment as j, renderList as O, createTextVNode as I, normalizeClass as P, createBlock as F, renderSlot as oe } from "vue";
2
- import { Table2 as q, Columns3 as se, Image as Y, ExternalLink as Z, Check as X, X as G } from "lucide-vue-next";
3
- const V = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
4
- function $(t, e) {
5
- if (!t || !e) return;
6
- const i = e.split(".");
7
- if (!i.some((s) => V.has(s)))
8
- return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : i.reduce((s, l) => s?.[l], t);
9
- }
10
- function Q(t) {
11
- return t.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_.-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase());
12
- }
13
- function ae(t, e) {
14
- const i = t.toLowerCase().replace(/[_.-]/g, "");
15
- if (/email$/.test(i)) return "email";
16
- if (/(phone|mobile|telephone|tel)$/.test(i)) return "phone";
17
- if (/(image|photo|avatar|thumbnail|logo|picture)$/.test(i)) return "image";
18
- if (/(url|link|website|href)$/.test(i)) return "URL";
19
- if (/(price|amount|cost|total|revenue|salary|fee)$/.test(i)) return "currency";
20
- if (/(createdat|updatedat|timestamp)$/.test(i)) return "datetime";
21
- if (/date$/.test(i)) return "date";
22
- const s = e.filter((l) => l != null && l !== "");
23
- return s.length ? s.every((l) => typeof l == "boolean") ? "boolean" : s.every((l) => typeof l == "number") ? "number" : s.every((l) => Array.isArray(l)) ? "array" : s.every((l) => typeof l == "string" && /^\d{4}-\d{2}-\d{2}(?:T|$)/.test(l)) ? s.some((l) => String(l).includes("T")) ? "datetime" : "date" : "text" : "text";
24
- }
25
- function Ke(t) {
26
- if (t == null) return [];
27
- const e = Array.isArray(t) ? t : Array.isArray(t?.data) ? t.data : Array.isArray(t?.items) ? t.items : Array.isArray(t?.rows) ? t.rows : null;
28
- if (!e)
29
- throw new Error("The Fetch items flow must return an array of rows.");
30
- return e.map((i) => i && typeof i == "object" && !Array.isArray(i) ? i : { value: i });
31
- }
32
- function Pe(t) {
33
- return Array.isArray(t) ? t.filter((e) => e && typeof e.property == "string" && e.property.trim()).map((e, i) => ({
34
- ...e,
35
- id: typeof e.id == "string" ? e.id : `column-${i}`,
36
- property: e.property.trim(),
37
- label: typeof e.label == "string" && e.label.trim() ? e.label.trim() : Q(e.property),
38
- type: typeof e.type == "string" && e.type ? e.type : "text",
39
- visible: e.visible !== !1
40
- })) : [];
41
- }
42
- function ee(t, e, i, s) {
43
- if (!(!t || typeof t != "object" || Array.isArray(t) || s >= 2))
44
- for (const [l, p] of Object.entries(t)) {
45
- if (V.has(l)) continue;
46
- const c = e ? `${e}.${l}` : l;
47
- p && typeof p == "object" && !Array.isArray(p) && !(p instanceof Date) ? ee(p, c, i, s + 1) : i.add(c);
48
- }
49
- }
50
- function le(t) {
51
- const e = /* @__PURE__ */ new Set();
52
- for (const i of t.slice(0, 10)) ee(i, "", e, 0);
53
- return Array.from(e).slice(0, 40).map((i, s) => ({
54
- id: `inferred-${s}`,
55
- property: i,
56
- label: Q(i),
57
- type: ae(i, t.map((l) => $(l, i))),
58
- visible: !0
59
- }));
60
- }
61
- function W(t, e) {
62
- const i = String(t || "").trim().toLocaleLowerCase();
63
- return i && (e.find((s) => s.property.toLocaleLowerCase() === i) || e.find((s) => String(s.label || "").trim().toLocaleLowerCase() === i) || e.find((s) => String(s.id || "").trim().toLocaleLowerCase() === i)) || null;
64
- }
65
- function S(t) {
66
- return t == null || t === "" || Array.isArray(t) && t.length === 0;
67
- }
68
- function pe(t) {
69
- return typeof t == "boolean" ? t : typeof t != "string" ? null : t.toLowerCase() === "true" ? !0 : t.toLowerCase() === "false" ? !1 : null;
70
- }
71
- function ue(t, e) {
72
- if (typeof e == "number") {
73
- const i = Number(t);
74
- return Number.isFinite(i) ? i : t;
75
- }
76
- return typeof e == "boolean" ? pe(t) ?? t : t;
77
- }
78
- function E(t, e) {
79
- const i = ue(e, t);
80
- if (typeof t == "string" && typeof i == "string")
81
- return t.toLocaleLowerCase() === i.toLocaleLowerCase();
82
- if (t instanceof Date) {
83
- const s = new Date(i);
84
- return !Number.isNaN(s.getTime()) && t.getTime() === s.getTime();
85
- }
86
- return Object.is(t, i);
87
- }
88
- function C(t) {
89
- if (t instanceof Date) return t.getTime();
90
- if (typeof t == "number") return t;
91
- if (typeof t == "boolean") return t ? 1 : 0;
92
- if (typeof t == "string") {
93
- const e = t.trim(), i = Number(e);
94
- if (e && Number.isFinite(i)) return i;
95
- if (/^\d{4}-\d{2}-\d{2}(?:T|$)/.test(e)) {
96
- const s = new Date(e).getTime();
97
- if (!Number.isNaN(s)) return s;
98
- }
99
- return e.toLocaleLowerCase();
100
- }
101
- return String(t ?? "").toLocaleLowerCase();
102
- }
103
- function ce(t, e, i) {
104
- const l = W(e.property, i)?.property || e.property, p = $(t, l), c = e.operator || "==", a = Array.isArray(e.values) ? e.values : (c === "in" || c === "notIn") && typeof e.value == "string" ? e.value.split(",").map((m) => m.trim()) : [];
105
- if ([">", ">=", "<", "<="].includes(c) && (S(p) || S(e.value)))
106
- return !1;
107
- switch (c) {
108
- case "==":
109
- case "equals":
110
- return E(p, e.value);
111
- case "!=":
112
- case "not_equals":
113
- return !E(p, e.value);
114
- case ">":
115
- return C(p) > C(e.value);
116
- case ">=":
117
- return C(p) >= C(e.value);
118
- case "<":
119
- return C(p) < C(e.value);
120
- case "<=":
121
- return C(p) <= C(e.value);
122
- case "contains":
123
- return Array.isArray(p) ? p.some((m) => E(m, e.value)) : String(p ?? "").toLocaleLowerCase().includes(String(e.value ?? "").toLocaleLowerCase());
124
- case "startsWith":
125
- return String(p ?? "").toLocaleLowerCase().startsWith(String(e.value ?? "").toLocaleLowerCase());
126
- case "endsWith":
127
- return String(p ?? "").toLocaleLowerCase().endsWith(String(e.value ?? "").toLocaleLowerCase());
128
- case "in":
129
- return a.some((m) => E(p, m));
130
- case "notIn":
131
- return !a.some((m) => E(p, m));
132
- case "isEmpty":
133
- return S(p);
134
- case "isNotEmpty":
135
- return !S(p);
136
- default:
137
- throw new Error(`Unsupported table filter operator "${c}".`);
138
- }
139
- }
140
- function qe(t, e, i = []) {
141
- if (!Array.isArray(e) || !e.length) return [...t];
142
- for (const s of e) {
143
- if (!s || typeof s.property != "string" || !s.property.trim())
144
- throw new Error("Every table filter needs a property.");
145
- if (i.length && !W(s.property, i))
146
- throw new Error(`Unknown table filter property "${s.property}". Use a property or label reported by inspectTable.`);
147
- }
148
- return t.filter((s) => e.every((l) => ce(s, l, i)));
149
- }
150
- function Ye(t, e, i = "asc", s = []) {
151
- if (!e) return [...t];
152
- const l = W(e, s);
153
- if (s.length && !l)
154
- throw new Error(`Unknown table sort property "${e}". Use a property or label reported by inspectTable.`);
155
- const p = l?.property || e, c = i === "desc" ? -1 : 1;
156
- return t.map((a, m) => ({ row: a, index: m })).sort((a, m) => {
157
- const x = $(a.row, p), k = $(m.row, p);
158
- if (S(x) && S(k)) return a.index - m.index;
159
- if (S(x)) return 1;
160
- if (S(k)) return -1;
161
- const T = C(x), R = C(k);
162
- return T < R ? -1 * c : T > R ? 1 * c : a.index - m.index;
163
- }).map((a) => a.row);
164
- }
165
- function Ze(t, e, i, s) {
166
- return t.filter((l) => {
167
- const p = $(l, e);
168
- if (p == null || p === "") return !1;
169
- const a = (p instanceof Date ? p : typeof p == "string" && /^\d{4}-\d{2}-\d{2}$/.test(p) ? /* @__PURE__ */ new Date(`${p}T00:00:00.000`) : new Date(p)).getTime();
170
- return !Number.isNaN(a) && a >= i.getTime() && a <= s.getTime();
171
- });
172
- }
173
- function de(t) {
174
- return t === null || ["string", "number", "boolean"].includes(typeof t);
175
- }
176
- function Xe(t, e, i = []) {
177
- const s = ["id", "_id", "uuid", "key", "email", "slug"], l = i.length ? i : le(e), p = Array.from(/* @__PURE__ */ new Set([
178
- ...s,
179
- ...l.map((m) => m.property),
180
- ...Object.keys(t || {})
181
- ])).filter((m) => !V.has(m)), c = [];
182
- let a = [...e];
183
- for (const m of p) {
184
- const x = $(t, m);
185
- if (!de(x) || x === "") continue;
186
- const k = a.filter((T) => E($(T, m), x));
187
- if (k.length) {
188
- if (a.length === 1) return [{ property: m, value: x }];
189
- if (k.length !== a.length) {
190
- if (c.push({ property: m, value: x }), a = k, a.length === 1) return c;
191
- if (c.length >= 3) break;
192
- }
193
- }
194
- }
195
- return a.length === 1 && c.length ? c : null;
196
- }
197
- function Ge(t, e = 512 * 1024) {
198
- const i = /* @__PURE__ */ new WeakSet(), s = JSON.stringify(t, (p, c) => {
199
- if (!V.has(p)) {
200
- if (typeof c == "bigint") return String(c);
201
- if (c instanceof Date) return c.toISOString();
202
- if (c && typeof c == "object") {
203
- if (i.has(c)) return "[Circular]";
204
- i.add(c);
205
- }
206
- return c;
207
- }
208
- });
209
- if (s === void 0) throw new Error("The table result is not JSON serializable.");
210
- const l = new TextEncoder().encode(s).byteLength;
211
- if (l > e)
212
- throw new Error(`The table result is too large to store (${Math.ceil(l / 1024)} KB). Narrow the query or lower the row limit.`);
213
- return JSON.parse(s);
214
- }
215
- const fe = { class: "w-full min-w-0 overflow-hidden rounded-xl border bg-background" }, ye = {
216
- key: 0,
217
- class: "flex items-start gap-2.5 border-b bg-muted/30 px-3 py-2.5"
218
- }, me = { class: "mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/10" }, ge = { class: "min-w-0 flex-1" }, be = {
219
- key: 0,
220
- class: "truncate text-xs font-semibold"
221
- }, he = {
222
- key: 1,
223
- class: "mt-0.5 text-[11px] leading-relaxed text-muted-foreground"
224
- }, xe = {
225
- key: 0,
226
- class: "shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10px] tabular-nums text-muted-foreground"
227
- }, we = {
228
- key: 1,
229
- class: "flex flex-col items-center px-4 py-8 text-center"
230
- }, ke = { class: "text-xs text-muted-foreground" }, ve = {
231
- key: 2,
232
- class: "flex flex-col items-center px-4 py-8 text-center"
233
- }, _e = {
234
- key: 3,
235
- class: "grid gap-x-5 gap-y-3 p-3 sm:grid-cols-2"
236
- }, Le = { class: "mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground" }, Ce = ["src", "alt"], Se = {
237
- key: 1,
238
- class: "flex size-16 items-center justify-center rounded-lg border bg-muted/30"
239
- }, Ae = ["href"], Ne = ["href"], $e = ["href"], Te = ["title"], ze = {
240
- key: 4,
241
- class: "overflow-x-auto"
242
- }, Ee = { class: "w-full min-w-max text-left text-xs" }, Re = { class: "border-b bg-muted/30" }, De = ["src", "alt"], Ue = {
243
- key: 1,
244
- class: "flex size-8 items-center justify-center rounded-md border bg-muted/30"
245
- }, je = ["href"], Oe = { class: "truncate" }, Fe = ["href"], Ve = ["href"], Me = ["title"], Be = {
246
- key: 5,
247
- class: "flex flex-wrap items-center gap-x-3 gap-y-1 border-t bg-muted/20 px-3 py-2 text-[10px] text-muted-foreground"
248
- }, Ie = { key: 0 }, We = { key: 1 }, Qe = /* @__PURE__ */ ie({
249
- __name: "TableResultView",
250
- props: {
251
- rows: { default: () => [] },
252
- columns: { default: () => [] },
253
- title: { default: "" },
254
- description: { default: "" },
255
- totalCount: { default: void 0 },
256
- emptyText: { default: "No matching rows found." },
257
- maxRows: { default: 20 },
258
- maxColumns: { default: 12 },
259
- currency: { default: "EUR" },
260
- view: { default: "auto" }
261
- },
262
- setup(t) {
263
- const e = t, i = _(() => R(e.maxRows, 1, 100, 20)), s = _(() => R(e.maxColumns, 1, 20, 12)), l = _(
264
- () => (Array.isArray(e.rows) ? e.rows : []).filter((r) => r != null).map((r) => typeof r == "object" && !Array.isArray(r) ? r : { value: r })
265
- ), p = _(() => {
266
- const r = Array.isArray(e.columns) ? e.columns : [], y = r.filter((o) => o && o.visible !== !1 && (o.property || o.key)).map((o, g) => {
267
- const D = String(o.property || o.key);
268
- return {
269
- id: String(o.id || D || g),
270
- property: D,
271
- label: o.label || J(D),
272
- type: o.type || H(D, l.value.map((ne) => d(ne, D)))
273
- };
274
- });
275
- if (r.length > 0) return te(y);
276
- const n = [], h = /* @__PURE__ */ new Set();
277
- for (const o of l.value.slice(0, 10))
278
- for (const g of Object.keys(o))
279
- h.has(g) || (h.add(g), n.push(g));
280
- return n.map((o) => ({
281
- id: o,
282
- property: o,
283
- label: J(o),
284
- type: H(o, l.value.map((g) => d(g, o)))
285
- }));
286
- }), c = _(() => p.value.slice(0, s.value)), a = _(() => l.value.slice(0, i.value)), m = _(() => Math.max(p.value.length - c.value.length, 0)), x = _(() => {
287
- const r = Number(e.totalCount);
288
- return Number.isFinite(r) && r >= l.value.length ? r : l.value.length;
289
- }), k = _(() => Math.max(x.value - a.value.length, 0)), T = _(() => a.value.length === 1 && (e.view === "card" || e.view === "metric" || e.view === "auto" && x.value === 1));
290
- function R(r, y, n, h) {
291
- const o = Number(r);
292
- return Number.isFinite(o) ? Math.min(Math.max(Math.floor(o), y), n) : h;
293
- }
294
- function te(r) {
295
- const y = /* @__PURE__ */ new Set();
296
- return r.filter((n) => y.has(n.property) ? !1 : (y.add(n.property), !0));
297
- }
298
- function d(r, y) {
299
- const n = y.split(".");
300
- if (!n.some((h) => ["__proto__", "constructor", "prototype"].includes(h)))
301
- return Object.prototype.hasOwnProperty.call(r, y) ? r[y] : n.reduce((h, o) => h?.[o], r);
302
- }
303
- function J(r) {
304
- return r.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_.-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (y) => y.toUpperCase());
305
- }
306
- function H(r, y) {
307
- const h = r.toLowerCase().replace(/[_.-]/g, "");
308
- if (/(image|photo|avatar|thumbnail|logo|picture)$/.test(h)) return "image";
309
- if (/(email)$/.test(h)) return "email";
310
- if (/(phone|mobile|telephone|tel)$/.test(h)) return "phone";
311
- if (/(url|link|website|href)$/.test(h)) return "URL";
312
- if (/(price|amount|cost|total|revenue|salary|fee)$/.test(h)) return "currency";
313
- if (/(date|createdat|updatedat|timestamp)$/.test(h)) return "datetime";
314
- const o = y.filter((g) => g != null && g !== "");
315
- return o.length === 0 ? "text" : o.every((g) => typeof g == "boolean") ? "boolean" : o.every((g) => Array.isArray(g)) ? "array" : o.every((g) => typeof g == "number") ? "number" : o.every((g) => typeof g == "string" && /^https?:\/\//i.test(g)) ? "URL" : o.every((g) => typeof g == "string" && /^\d{4}-\d{2}-\d{2}(?:T|$)/.test(g)) ? o.some((g) => String(g).includes("T")) ? "datetime" : "date" : "text";
316
- }
317
- function z(r) {
318
- return r == null || r === "";
319
- }
320
- function M(r) {
321
- if (typeof r != "string") return !1;
322
- try {
323
- const y = new URL(r, typeof window > "u" ? "https://localhost" : window.location.origin);
324
- return y.protocol === "http:" || y.protocol === "https:";
325
- } catch {
326
- return !1;
327
- }
328
- }
329
- function K(r) {
330
- return M(r) || typeof r == "string" && /^data:image\/(?:png|jpe?g|gif|webp|avif);base64,/i.test(r);
331
- }
332
- function v(r, y) {
333
- if (z(r)) return "—";
334
- switch (y.type) {
335
- case "boolean":
336
- return r ? "Yes" : "No";
337
- case "number": {
338
- const n = Number(r);
339
- return Number.isFinite(n) ? n.toLocaleString(void 0, { maximumFractionDigits: 2 }) : String(r);
340
- }
341
- case "currency": {
342
- const n = typeof r == "number" ? r : Number(String(r).replace(",", "."));
343
- if (!Number.isFinite(n)) return String(r);
344
- try {
345
- return new Intl.NumberFormat(void 0, { style: "currency", currency: e.currency }).format(n);
346
- } catch {
347
- return `${n.toLocaleString(void 0, { maximumFractionDigits: 2 })} ${e.currency}`;
348
- }
349
- }
350
- case "date":
351
- case "datetime": {
352
- const n = new Date(r);
353
- return Number.isNaN(n.getTime()) ? String(r) : y.type === "date" ? n.toLocaleDateString() : n.toLocaleString();
354
- }
355
- case "array-counter":
356
- return Array.isArray(r) ? String(r.length) : "0";
357
- case "array":
358
- return Array.isArray(r) ? B(r.map(U).join(", "), 160) : String(r);
359
- case "html":
360
- return B(re(String(r)), 160);
361
- default:
362
- return B(U(r), 180);
363
- }
364
- }
365
- function U(r) {
366
- if (z(r)) return "—";
367
- if (r instanceof Date) return r.toLocaleString();
368
- if (typeof r == "string") return r;
369
- if (typeof r == "number" || typeof r == "boolean" || typeof r == "bigint") return String(r);
370
- try {
371
- return JSON.stringify(r);
372
- } catch {
373
- return String(r);
374
- }
375
- }
376
- function re(r) {
377
- if (typeof document > "u") return r.replace(/<[^>]*>/g, " ");
378
- const y = document.createElement("div");
379
- return y.innerHTML = r, y.textContent || "";
380
- }
381
- function B(r, y) {
382
- return r.length > y ? `${r.slice(0, y - 1)}…` : r;
383
- }
384
- return (r, y) => (u(), f("div", fe, [
385
- t.title || t.description ? (u(), f("div", ye, [
386
- L("div", me, [
387
- A(w(q), { class: "size-3.5 text-primary" })
388
- ]),
389
- L("div", ge, [
390
- t.title ? (u(), f("p", be, b(t.title), 1)) : N("", !0),
391
- t.description ? (u(), f("p", he, b(t.description), 1)) : N("", !0)
392
- ]),
393
- x.value > 0 ? (u(), f("span", xe, b(x.value) + " " + b(x.value === 1 ? "row" : "rows"), 1)) : N("", !0)
394
- ])) : N("", !0),
395
- a.value.length === 0 ? (u(), f("div", we, [
396
- A(w(q), { class: "mb-2 size-7 text-muted-foreground/50" }),
397
- L("p", ke, b(t.emptyText), 1)
398
- ])) : c.value.length === 0 ? (u(), f("div", ve, [
399
- A(w(se), { class: "mb-2 size-7 text-muted-foreground/50" }),
400
- y[0] || (y[0] = L("p", { class: "text-xs text-muted-foreground" }, "No visible columns are configured.", -1))
401
- ])) : T.value ? (u(), f("div", _e, [
402
- (u(!0), f(j, null, O(c.value, (n) => (u(), f("div", {
403
- key: n.id,
404
- class: "min-w-0"
405
- }, [
406
- L("p", Le, b(n.label), 1),
407
- n.type === "image" && K(d(a.value[0], n.property)) ? (u(), f("img", {
408
- key: 0,
409
- src: d(a.value[0], n.property),
410
- alt: n.label,
411
- class: "size-16 rounded-lg border object-cover"
412
- }, null, 8, Ce)) : n.type === "image" ? (u(), f("div", Se, [
413
- A(w(Y), { class: "size-5 text-muted-foreground/50" })
414
- ])) : n.type === "URL" && M(d(a.value[0], n.property)) ? (u(), f("a", {
415
- key: 2,
416
- href: d(a.value[0], n.property),
417
- target: "_blank",
418
- rel: "noopener noreferrer",
419
- class: "inline-flex max-w-full items-center gap-1 break-all text-xs text-primary hover:underline"
420
- }, [
421
- I(b(v(d(a.value[0], n.property), n)) + " ", 1),
422
- A(w(Z), { class: "size-3 shrink-0" })
423
- ], 8, Ae)) : n.type === "email" && !z(d(a.value[0], n.property)) ? (u(), f("a", {
424
- key: 3,
425
- href: `mailto:${d(a.value[0], n.property)}`,
426
- class: "break-all text-xs text-primary hover:underline"
427
- }, b(v(d(a.value[0], n.property), n)), 9, Ne)) : n.type === "phone" && !z(d(a.value[0], n.property)) ? (u(), f("a", {
428
- key: 4,
429
- href: `tel:${d(a.value[0], n.property)}`,
430
- class: "text-xs text-primary hover:underline"
431
- }, b(v(d(a.value[0], n.property), n)), 9, $e)) : n.type === "boolean" ? (u(), f("span", {
432
- key: 5,
433
- class: P(["inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium", d(a.value[0], n.property) ? "bg-emerald-500/10 text-emerald-700 dark:text-emerald-300" : "bg-muted text-muted-foreground"])
434
- }, [
435
- d(a.value[0], n.property) ? (u(), F(w(X), {
436
- key: 0,
437
- class: "size-3"
438
- })) : (u(), F(w(G), {
439
- key: 1,
440
- class: "size-3"
441
- })),
442
- I(" " + b(v(d(a.value[0], n.property), n)), 1)
443
- ], 2)) : (u(), f("p", {
444
- key: 6,
445
- class: "break-words text-xs font-medium",
446
- title: U(d(a.value[0], n.property))
447
- }, b(v(d(a.value[0], n.property), n)), 9, Te))
448
- ]))), 128))
449
- ])) : (u(), f("div", ze, [
450
- L("table", Ee, [
451
- L("thead", null, [
452
- L("tr", Re, [
453
- (u(!0), f(j, null, O(c.value, (n) => (u(), f("th", {
454
- key: n.id,
455
- class: "whitespace-nowrap px-3 py-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground"
456
- }, b(n.label), 1))), 128))
457
- ])
458
- ]),
459
- L("tbody", null, [
460
- (u(!0), f(j, null, O(a.value, (n, h) => (u(), f("tr", {
461
- key: h,
462
- class: "border-b last:border-b-0 hover:bg-muted/20"
463
- }, [
464
- (u(!0), f(j, null, O(c.value, (o) => (u(), f("td", {
465
- key: o.id,
466
- class: "max-w-56 px-3 py-2 align-middle"
467
- }, [
468
- o.type === "image" && K(d(n, o.property)) ? (u(), f("img", {
469
- key: 0,
470
- src: d(n, o.property),
471
- alt: o.label,
472
- class: "size-8 rounded-md border object-cover"
473
- }, null, 8, De)) : o.type === "image" ? (u(), f("div", Ue, [
474
- A(w(Y), { class: "size-3.5 text-muted-foreground/50" })
475
- ])) : o.type === "URL" && M(d(n, o.property)) ? (u(), f("a", {
476
- key: 2,
477
- href: d(n, o.property),
478
- target: "_blank",
479
- rel: "noopener noreferrer",
480
- class: "inline-flex max-w-48 items-center gap-1 truncate text-primary hover:underline"
481
- }, [
482
- L("span", Oe, b(v(d(n, o.property), o)), 1),
483
- A(w(Z), { class: "size-3 shrink-0" })
484
- ], 8, je)) : o.type === "email" && !z(d(n, o.property)) ? (u(), f("a", {
485
- key: 3,
486
- href: `mailto:${d(n, o.property)}`,
487
- class: "block max-w-48 truncate text-primary hover:underline"
488
- }, b(v(d(n, o.property), o)), 9, Fe)) : o.type === "phone" && !z(d(n, o.property)) ? (u(), f("a", {
489
- key: 4,
490
- href: `tel:${d(n, o.property)}`,
491
- class: "whitespace-nowrap text-primary hover:underline"
492
- }, b(v(d(n, o.property), o)), 9, Ve)) : o.type === "boolean" ? (u(), f("span", {
493
- key: 5,
494
- class: P(["inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium", d(n, o.property) ? "bg-emerald-500/10 text-emerald-700 dark:text-emerald-300" : "bg-muted text-muted-foreground"])
495
- }, [
496
- d(n, o.property) ? (u(), F(w(X), {
497
- key: 0,
498
- class: "size-2.5"
499
- })) : (u(), F(w(G), {
500
- key: 1,
501
- class: "size-2.5"
502
- })),
503
- I(" " + b(v(d(n, o.property), o)), 1)
504
- ], 2)) : (u(), f("span", {
505
- key: 6,
506
- class: "block max-w-56 truncate",
507
- title: U(d(n, o.property))
508
- }, b(v(d(n, o.property), o)), 9, Me))
509
- ]))), 128))
510
- ]))), 128))
511
- ])
512
- ])
513
- ])),
514
- a.value.length > 0 && (r.$slots.footer || k.value > 0 || m.value > 0) ? (u(), f("div", Be, [
515
- oe(r.$slots, "footer"),
516
- !r.$slots.footer && k.value > 0 ? (u(), f("span", Ie, "Showing " + b(a.value.length) + " of " + b(x.value) + " rows", 1)) : N("", !0),
517
- m.value > 0 ? (u(), f("span", We, b(m.value) + " more " + b(m.value === 1 ? "column" : "columns") + " hidden", 1)) : N("", !0)
518
- ])) : N("", !0)
519
- ]));
520
- }
521
- });
522
- export {
523
- Qe as _,
524
- $ as a,
525
- Xe as b,
526
- Ze as c,
527
- qe as d,
528
- Ye as e,
529
- Pe as f,
530
- le as i,
531
- Ke as n,
532
- W as r,
533
- Ge as s
534
- };
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),h=require("lucide-vue-next"),T=new Set(["__proto__","constructor","prototype"]);function v(r,t){if(!r||!t)return;const a=t.split(".");if(!a.some(s=>T.has(s)))return Object.prototype.hasOwnProperty.call(r,t)?r[t]:a.reduce((s,c)=>s?.[c],r)}function F(r){return r.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_.-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function W(r,t){const a=r.toLowerCase().replace(/[_.-]/g,"");if(/email$/.test(a))return"email";if(/(phone|mobile|telephone|tel)$/.test(a))return"phone";if(/(image|photo|avatar|thumbnail|logo|picture)$/.test(a))return"image";if(/(url|link|website|href)$/.test(a))return"URL";if(/(price|amount|cost|total|revenue|salary|fee)$/.test(a))return"currency";if(/(createdat|updatedat|timestamp)$/.test(a))return"datetime";if(/date$/.test(a))return"date";const s=t.filter(c=>c!=null&&c!=="");return s.length?s.every(c=>typeof c=="boolean")?"boolean":s.every(c=>typeof c=="number")?"number":s.every(c=>Array.isArray(c))?"array":s.every(c=>typeof c=="string"&&/^\d{4}-\d{2}-\d{2}(?:T|$)/.test(c))?s.some(c=>String(c).includes("T"))?"datetime":"date":"text":"text"}function q(r){if(r==null)return[];const t=Array.isArray(r)?r:Array.isArray(r?.data)?r.data:Array.isArray(r?.items)?r.items:Array.isArray(r?.rows)?r.rows:null;if(!t)throw new Error("The Fetch items flow must return an array of rows.");return t.map(a=>a&&typeof a=="object"&&!Array.isArray(a)?a:{value:a})}function J(r){return Array.isArray(r)?r.filter(t=>t&&typeof t.property=="string"&&t.property.trim()).map((t,a)=>({...t,id:typeof t.id=="string"?t.id:`column-${a}`,property:t.property.trim(),label:typeof t.label=="string"&&t.label.trim()?t.label.trim():F(t.property),type:typeof t.type=="string"&&t.type?t.type:"text",visible:t.visible!==!1})):[]}function U(r,t,a,s){if(!(!r||typeof r!="object"||Array.isArray(r)||s>=2))for(const[c,p]of Object.entries(r)){if(T.has(c))continue;const u=t?`${t}.${c}`:c;p&&typeof p=="object"&&!Array.isArray(p)&&!(p instanceof Date)?U(p,u,a,s+1):a.add(u)}}function j(r){const t=new Set;for(const a of r.slice(0,10))U(a,"",t,0);return Array.from(t).slice(0,40).map((a,s)=>({id:`inferred-${s}`,property:a,label:F(a),type:W(a,r.map(c=>v(c,a))),visible:!0}))}function A(r,t){const a=String(r||"").trim().toLocaleLowerCase();return a&&(t.find(s=>s.property.toLocaleLowerCase()===a)||t.find(s=>String(s.label||"").trim().toLocaleLowerCase()===a)||t.find(s=>String(s.id||"").trim().toLocaleLowerCase()===a))||null}function B(r){return r==null||r===""||Array.isArray(r)&&r.length===0}function P(r){return typeof r=="boolean"?r:typeof r!="string"?null:r.toLowerCase()==="true"?!0:r.toLowerCase()==="false"?!1:null}function H(r,t){if(typeof t=="number"){const a=Number(r);return Number.isFinite(a)?a:r}return typeof t=="boolean"?P(r)??r:r}function E(r,t){const a=H(t,r);if(typeof r=="string"&&typeof a=="string")return r.toLocaleLowerCase()===a.toLocaleLowerCase();if(r instanceof Date){const s=new Date(a);return!Number.isNaN(s.getTime())&&r.getTime()===s.getTime()}return Object.is(r,a)}function w(r){if(r instanceof Date)return r.getTime();if(typeof r=="number")return r;if(typeof r=="boolean")return r?1:0;if(typeof r=="string"){const t=r.trim(),a=Number(t);if(t&&Number.isFinite(a))return a;if(/^\d{4}-\d{2}-\d{2}(?:T|$)/.test(t)){const s=new Date(t).getTime();if(!Number.isNaN(s))return s}return t.toLocaleLowerCase()}return String(r??"").toLocaleLowerCase()}function K(r,t,a){const c=A(t.property,a)?.property||t.property,p=v(r,c),u=t.operator||"==",l=Array.isArray(t.values)?t.values:(u==="in"||u==="notIn")&&typeof t.value=="string"?t.value.split(",").map(y=>y.trim()):[];if([">",">=","<","<="].includes(u)&&(B(p)||B(t.value)))return!1;switch(u){case"==":case"equals":return E(p,t.value);case"!=":case"not_equals":return!E(p,t.value);case">":return w(p)>w(t.value);case">=":return w(p)>=w(t.value);case"<":return w(p)<w(t.value);case"<=":return w(p)<=w(t.value);case"contains":return Array.isArray(p)?p.some(y=>E(y,t.value)):String(p??"").toLocaleLowerCase().includes(String(t.value??"").toLocaleLowerCase());case"startsWith":return String(p??"").toLocaleLowerCase().startsWith(String(t.value??"").toLocaleLowerCase());case"endsWith":return String(p??"").toLocaleLowerCase().endsWith(String(t.value??"").toLocaleLowerCase());case"in":return l.some(y=>E(p,y));case"notIn":return!l.some(y=>E(p,y));case"isEmpty":return B(p);case"isNotEmpty":return!B(p);default:throw new Error(`Unsupported table filter operator "${u}".`)}}function X(r,t,a=[]){if(!Array.isArray(t)||!t.length)return[...r];for(const s of t){if(!s||typeof s.property!="string"||!s.property.trim())throw new Error("Every table filter needs a property.");if(a.length&&!A(s.property,a))throw new Error(`Unknown table filter property "${s.property}". Use a property or label reported by inspectTable.`)}return r.filter(s=>t.every(c=>K(s,c,a)))}function Y(r,t,a="asc",s=[]){if(!t)return[...r];const c=A(t,s);if(s.length&&!c)throw new Error(`Unknown table sort property "${t}". Use a property or label reported by inspectTable.`);const p=c?.property||t,u=a==="desc"?-1:1;return r.map((l,y)=>({row:l,index:y})).sort((l,y)=>{const b=v(l.row,p),k=v(y.row,p);if(B(b)&&B(k))return l.index-y.index;if(B(b))return 1;if(B(k))return-1;const S=w(b),N=w(k);return S<N?-1*u:S>N?1*u:l.index-y.index}).map(l=>l.row)}function Z(r,t,a,s){return r.filter(c=>{const p=v(c,t);if(p==null||p==="")return!1;const l=(p instanceof Date?p:typeof p=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(p)?new Date(`${p}T00:00:00.000`):new Date(p)).getTime();return!Number.isNaN(l)&&l>=a.getTime()&&l<=s.getTime()})}function G(r){return r===null||["string","number","boolean"].includes(typeof r)}function Q(r,t,a=[]){const s=["id","_id","uuid","key","email","slug"],c=a.length?a:j(t),p=Array.from(new Set([...s,...c.map(y=>y.property),...Object.keys(r||{})])).filter(y=>!T.has(y)),u=[];let l=[...t];for(const y of p){const b=v(r,y);if(!G(b)||b==="")continue;const k=l.filter(S=>E(v(S,y),b));if(k.length){if(l.length===1)return[{property:y,value:b}];if(k.length!==l.length){if(u.push({property:y,value:b}),l=k,l.length===1)return u;if(u.length>=3)break}}}return l.length===1&&u.length?u:null}function ee(r,t=512*1024){const a=new WeakSet,s=JSON.stringify(r,(p,u)=>{if(!T.has(p)){if(typeof u=="bigint")return String(u);if(u instanceof Date)return u.toISOString();if(u&&typeof u=="object"){if(a.has(u))return"[Circular]";a.add(u)}return u}});if(s===void 0)throw new Error("The table result is not JSON serializable.");const c=new TextEncoder().encode(s).byteLength;if(c>t)throw new Error(`The table result is too large to store (${Math.ceil(c/1024)} KB). Narrow the query or lower the row limit.`);return JSON.parse(s)}const te={class:"w-full min-w-0 overflow-hidden rounded-xl border bg-background"},re={key:0,class:"flex items-start gap-2.5 border-b bg-muted/30 px-3 py-2.5"},ne={class:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary/10"},oe={class:"min-w-0 flex-1"},ae={key:0,class:"truncate text-xs font-semibold"},ie={key:1,class:"mt-0.5 text-[11px] leading-relaxed text-muted-foreground"},se={key:0,class:"shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10px] tabular-nums text-muted-foreground"},le={key:1,class:"flex flex-col items-center px-4 py-8 text-center"},ce={class:"text-xs text-muted-foreground"},pe={key:2,class:"flex flex-col items-center px-4 py-8 text-center"},ue={key:3,class:"grid gap-x-5 gap-y-3 p-3 sm:grid-cols-2"},de={class:"mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground"},fe=["src","alt"],ye={key:1,class:"flex size-16 items-center justify-center rounded-lg border bg-muted/30"},me=["href"],ge=["href"],be=["href"],he=["title"],ke={key:4,class:"overflow-x-auto"},xe={class:"w-full min-w-max text-left text-xs"},we={class:"border-b bg-muted/30"},Be=["src","alt"],ve={key:1,class:"flex size-8 items-center justify-center rounded-md border bg-muted/30"},Se=["href"],_e={class:"truncate"},Ee=["href"],Ne=["href"],Ce=["title"],Le={key:5,class:"flex flex-wrap items-center gap-x-3 gap-y-1 border-t bg-muted/20 px-3 py-2 text-[10px] text-muted-foreground"},Te={key:0},Ae={key:1},$e=e.defineComponent({__name:"TableResultView",props:{rows:{default:()=>[]},columns:{default:()=>[]},title:{default:""},description:{default:""},totalCount:{default:void 0},emptyText:{default:"No matching rows found."},maxRows:{default:20},maxColumns:{default:12},currency:{default:"EUR"},view:{default:"auto"}},setup(r){const t=r,a=e.computed(()=>N(t.maxRows,1,100,20)),s=e.computed(()=>N(t.maxColumns,1,20,12)),c=e.computed(()=>(Array.isArray(t.rows)?t.rows:[]).filter(n=>n!=null).map(n=>typeof n=="object"&&!Array.isArray(n)?n:{value:n})),p=e.computed(()=>{const n=Array.isArray(t.columns)?t.columns:[],f=n.filter(i=>i&&i.visible!==!1&&(i.property||i.key)).map((i,m)=>{const C=String(i.property||i.key);return{id:String(i.id||C||m),property:C,label:i.label||V(C),type:i.type||z(C,c.value.map(I=>d(I,C)))}});if(n.length>0)return O(f);const o=[],g=new Set;for(const i of c.value.slice(0,10))for(const m of Object.keys(i))g.has(m)||(g.add(m),o.push(m));return o.map(i=>({id:i,property:i,label:V(i),type:z(i,c.value.map(m=>d(m,i)))}))}),u=e.computed(()=>p.value.slice(0,s.value)),l=e.computed(()=>c.value.slice(0,a.value)),y=e.computed(()=>Math.max(p.value.length-u.value.length,0)),b=e.computed(()=>{const n=Number(t.totalCount);return Number.isFinite(n)&&n>=c.value.length?n:c.value.length}),k=e.computed(()=>Math.max(b.value-l.value.length,0)),S=e.computed(()=>l.value.length===1&&(t.view==="card"||t.view==="metric"||t.view==="auto"&&b.value===1));function N(n,f,o,g){const i=Number(n);return Number.isFinite(i)?Math.min(Math.max(Math.floor(i),f),o):g}function O(n){const f=new Set;return n.filter(o=>f.has(o.property)?!1:(f.add(o.property),!0))}function d(n,f){const o=f.split(".");if(!o.some(g=>["__proto__","constructor","prototype"].includes(g)))return Object.prototype.hasOwnProperty.call(n,f)?n[f]:o.reduce((g,i)=>g?.[i],n)}function V(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_.-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,f=>f.toUpperCase())}function z(n,f){const g=n.toLowerCase().replace(/[_.-]/g,"");if(/(image|photo|avatar|thumbnail|logo|picture)$/.test(g))return"image";if(/(email)$/.test(g))return"email";if(/(phone|mobile|telephone|tel)$/.test(g))return"phone";if(/(url|link|website|href)$/.test(g))return"URL";if(/(price|amount|cost|total|revenue|salary|fee)$/.test(g))return"currency";if(/(date|createdat|updatedat|timestamp)$/.test(g))return"datetime";const i=f.filter(m=>m!=null&&m!=="");return i.length===0?"text":i.every(m=>typeof m=="boolean")?"boolean":i.every(m=>Array.isArray(m))?"array":i.every(m=>typeof m=="number")?"number":i.every(m=>typeof m=="string"&&/^https?:\/\//i.test(m))?"URL":i.every(m=>typeof m=="string"&&/^\d{4}-\d{2}-\d{2}(?:T|$)/.test(m))?i.some(m=>String(m).includes("T"))?"datetime":"date":"text"}function _(n){return n==null||n===""}function $(n){if(typeof n!="string")return!1;try{const f=new URL(n,typeof window>"u"?"https://localhost":window.location.origin);return f.protocol==="http:"||f.protocol==="https:"}catch{return!1}}function R(n){return $(n)||typeof n=="string"&&/^data:image\/(?:png|jpe?g|gif|webp|avif);base64,/i.test(n)}function x(n,f){if(_(n))return"—";switch(f.type){case"boolean":return n?"Yes":"No";case"number":{const o=Number(n);return Number.isFinite(o)?o.toLocaleString(void 0,{maximumFractionDigits:2}):String(n)}case"currency":{const o=typeof n=="number"?n:Number(String(n).replace(",","."));if(!Number.isFinite(o))return String(n);try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t.currency}).format(o)}catch{return`${o.toLocaleString(void 0,{maximumFractionDigits:2})} ${t.currency}`}}case"date":case"datetime":{const o=new Date(n);return Number.isNaN(o.getTime())?String(n):f.type==="date"?o.toLocaleDateString():o.toLocaleString()}case"array-counter":return Array.isArray(n)?String(n.length):"0";case"array":return Array.isArray(n)?D(n.map(L).join(", "),160):String(n);case"html":return D(M(String(n)),160);default:return D(L(n),180)}}function L(n){if(_(n))return"—";if(n instanceof Date)return n.toLocaleString();if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean"||typeof n=="bigint")return String(n);try{return JSON.stringify(n)}catch{return String(n)}}function M(n){if(typeof document>"u")return n.replace(/<[^>]*>/g," ");const f=document.createElement("div");return f.innerHTML=n,f.textContent||""}function D(n,f){return n.length>f?`${n.slice(0,f-1)}…`:n}return(n,f)=>(e.openBlock(),e.createElementBlock("div",te,[r.title||r.description?(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",ne,[e.createVNode(e.unref(h.Table2),{class:"size-3.5 text-primary"})]),e.createElementVNode("div",oe,[r.title?(e.openBlock(),e.createElementBlock("p",ae,e.toDisplayString(r.title),1)):e.createCommentVNode("",!0),r.description?(e.openBlock(),e.createElementBlock("p",ie,e.toDisplayString(r.description),1)):e.createCommentVNode("",!0)]),b.value>0?(e.openBlock(),e.createElementBlock("span",se,e.toDisplayString(b.value)+" "+e.toDisplayString(b.value===1?"row":"rows"),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),l.value.length===0?(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(e.unref(h.Table2),{class:"mb-2 size-7 text-muted-foreground/50"}),e.createElementVNode("p",ce,e.toDisplayString(r.emptyText),1)])):u.value.length===0?(e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(e.unref(h.Columns3),{class:"mb-2 size-7 text-muted-foreground/50"}),f[0]||(f[0]=e.createElementVNode("p",{class:"text-xs text-muted-foreground"},"No visible columns are configured.",-1))])):S.value?(e.openBlock(),e.createElementBlock("div",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,class:"min-w-0"},[e.createElementVNode("p",de,e.toDisplayString(o.label),1),o.type==="image"&&R(d(l.value[0],o.property))?(e.openBlock(),e.createElementBlock("img",{key:0,src:d(l.value[0],o.property),alt:o.label,class:"size-16 rounded-lg border object-cover"},null,8,fe)):o.type==="image"?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(e.unref(h.Image),{class:"size-5 text-muted-foreground/50"})])):o.type==="URL"&&$(d(l.value[0],o.property))?(e.openBlock(),e.createElementBlock("a",{key:2,href:d(l.value[0],o.property),target:"_blank",rel:"noopener noreferrer",class:"inline-flex max-w-full items-center gap-1 break-all text-xs text-primary hover:underline"},[e.createTextVNode(e.toDisplayString(x(d(l.value[0],o.property),o))+" ",1),e.createVNode(e.unref(h.ExternalLink),{class:"size-3 shrink-0"})],8,me)):o.type==="email"&&!_(d(l.value[0],o.property))?(e.openBlock(),e.createElementBlock("a",{key:3,href:`mailto:${d(l.value[0],o.property)}`,class:"break-all text-xs text-primary hover:underline"},e.toDisplayString(x(d(l.value[0],o.property),o)),9,ge)):o.type==="phone"&&!_(d(l.value[0],o.property))?(e.openBlock(),e.createElementBlock("a",{key:4,href:`tel:${d(l.value[0],o.property)}`,class:"text-xs text-primary hover:underline"},e.toDisplayString(x(d(l.value[0],o.property),o)),9,be)):o.type==="boolean"?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium",d(l.value[0],o.property)?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"bg-muted text-muted-foreground"])},[d(l.value[0],o.property)?(e.openBlock(),e.createBlock(e.unref(h.Check),{key:0,class:"size-3"})):(e.openBlock(),e.createBlock(e.unref(h.X),{key:1,class:"size-3"})),e.createTextVNode(" "+e.toDisplayString(x(d(l.value[0],o.property),o)),1)],2)):(e.openBlock(),e.createElementBlock("p",{key:6,class:"break-words text-xs font-medium",title:L(d(l.value[0],o.property))},e.toDisplayString(x(d(l.value[0],o.property),o)),9,he))]))),128))])):(e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("table",xe,[e.createElementVNode("thead",null,[e.createElementVNode("tr",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,o=>(e.openBlock(),e.createElementBlock("th",{key:o.id,class:"whitespace-nowrap px-3 py-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground"},e.toDisplayString(o.label),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(o,g)=>(e.openBlock(),e.createElementBlock("tr",{key:g,class:"border-b last:border-b-0 hover:bg-muted/20"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,i=>(e.openBlock(),e.createElementBlock("td",{key:i.id,class:"max-w-56 px-3 py-2 align-middle"},[i.type==="image"&&R(d(o,i.property))?(e.openBlock(),e.createElementBlock("img",{key:0,src:d(o,i.property),alt:i.label,class:"size-8 rounded-md border object-cover"},null,8,Be)):i.type==="image"?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(e.unref(h.Image),{class:"size-3.5 text-muted-foreground/50"})])):i.type==="URL"&&$(d(o,i.property))?(e.openBlock(),e.createElementBlock("a",{key:2,href:d(o,i.property),target:"_blank",rel:"noopener noreferrer",class:"inline-flex max-w-48 items-center gap-1 truncate text-primary hover:underline"},[e.createElementVNode("span",_e,e.toDisplayString(x(d(o,i.property),i)),1),e.createVNode(e.unref(h.ExternalLink),{class:"size-3 shrink-0"})],8,Se)):i.type==="email"&&!_(d(o,i.property))?(e.openBlock(),e.createElementBlock("a",{key:3,href:`mailto:${d(o,i.property)}`,class:"block max-w-48 truncate text-primary hover:underline"},e.toDisplayString(x(d(o,i.property),i)),9,Ee)):i.type==="phone"&&!_(d(o,i.property))?(e.openBlock(),e.createElementBlock("a",{key:4,href:`tel:${d(o,i.property)}`,class:"whitespace-nowrap text-primary hover:underline"},e.toDisplayString(x(d(o,i.property),i)),9,Ne)):i.type==="boolean"?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium",d(o,i.property)?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"bg-muted text-muted-foreground"])},[d(o,i.property)?(e.openBlock(),e.createBlock(e.unref(h.Check),{key:0,class:"size-2.5"})):(e.openBlock(),e.createBlock(e.unref(h.X),{key:1,class:"size-2.5"})),e.createTextVNode(" "+e.toDisplayString(x(d(o,i.property),i)),1)],2)):(e.openBlock(),e.createElementBlock("span",{key:6,class:"block max-w-56 truncate",title:L(d(o,i.property))},e.toDisplayString(x(d(o,i.property),i)),9,Ce))]))),128))]))),128))])])])),l.value.length>0&&(n.$slots.footer||k.value>0||y.value>0)?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(n.$slots,"footer"),!n.$slots.footer&&k.value>0?(e.openBlock(),e.createElementBlock("span",Te,"Showing "+e.toDisplayString(l.value.length)+" of "+e.toDisplayString(b.value)+" rows",1)):e.createCommentVNode("",!0),y.value>0?(e.openBlock(),e.createElementBlock("span",Ae,e.toDisplayString(y.value)+" more "+e.toDisplayString(y.value===1?"column":"columns")+" hidden",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))}});exports._sfc_main=$e;exports.applyLocalDateRange=Z;exports.applyTableFilters=X;exports.applyTableSort=Y;exports.buildRowReference=Q;exports.inferTableColumns=j;exports.normalizeTableColumns=J;exports.normalizeTableRows=q;exports.resolveColumn=A;exports.resolveProperty=v;exports.serializeBounded=ee;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("lucide-vue-next"),P=require("./useTableAgentTools-D5mzGf3A.js"),u=require("./TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js"),M=require("./tool-sandbox-DoF1PsyS.js"),Z={class:"w-full"},F={key:0,class:"flex items-center gap-2 py-3 text-xs text-muted-foreground"},U={key:1,class:"rounded-xl border bg-background p-4"},X={class:"flex items-center gap-2 text-sm font-semibold text-emerald-600 dark:text-emerald-400"},G={key:2,class:"rounded-xl border bg-background p-4"},H={class:"flex items-center gap-2 text-sm font-semibold text-muted-foreground"},J={key:3,class:"flex items-start gap-2 rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"},K={key:4,class:"overflow-hidden rounded-xl border bg-background"},Q={class:"border-b bg-amber-50/70 p-4 dark:bg-amber-950/20"},W={class:"flex items-start gap-3"},Y={class:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-amber-500/15"},ee={class:"min-w-0"},te={class:"text-sm font-semibold"},re={key:0,class:"mt-1 text-[11px] text-muted-foreground"},le={class:"p-3"},oe={key:0,class:"mt-3 text-xs text-destructive"},ae={class:"mt-3 flex items-center gap-2"},ne=["disabled"],se=["disabled"],ce=e.defineComponent({__name:"TableRowActionCard",props:{projectSlug:{},toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(R,{emit:B}){const o=R,T=B,w=e.ref(!0),f=e.ref(!1),i=e.ref(null),d=e.ref("confirm"),a=e.ref(null),A=e.ref(-1),n=e.ref(null),g=e.ref([]),v=e.ref(null),_=e.ref(null),{loadRows:C,runStoredRowAction:S}=P.useTableAgentTools(o);function D(t,r){const s=t.filter(m=>m.id===r);if(s.length===1)return s[0];const c=r.trim().toLocaleLowerCase(),l=t.filter(m=>String(m.label).trim().toLocaleLowerCase()===c);if(l.length===1)return l[0];throw l.length>1?new Error(`More than one row action is named "${r}". Use its action ID.`):new Error(`No configured row action matches "${r}".`)}async function z(t,r){if(t.visible===void 0||t.visible===null||t.visible===""||t.visible===!0||t.visible==="true")return!0;if(t.visible===!1||t.visible==="false")return!1;const c=String(t.visible).trim().match(/^\{\{([\s\S]*)\}\}$/);if(!c)return!1;const l={item:{data:r}};for(const[p,h]of Object.entries(r||{}))/^[$A-Z_][0-9A-Z_$]*$/i.test(p)&&!["constructor","prototype","__proto__"].includes(p)&&(l[p]=h);return await M.runSandboxedTableCode(`const value = (${c[1]}); return value === true || value === 'true';`,l,{timeoutMs:750,maxInputBytes:1024*1024,maxOutputBytes:1024})===!0}function $(){if(o.status!=="completed")return!1;const t=o.resolvedArgs?._cachedData;return!t||typeof t!="object"||Array.isArray(t)?!1:t.executed!==!0&&t.cancelled!==!0&&typeof t.error!="string"?(i.value="The saved row-action result is unavailable.",d.value="error",w.value=!1,!0):(_.value=t,a.value=t.row||null,g.value=t.columns||u.inferTableColumns(a.value?[a.value]:[]).slice(0,8),i.value=t.error||null,d.value=t.cancelled?"cancelled":t.executed?"success":"error",w.value=!1,!0)}function y(t){let r;try{r=u.serializeBounded(t,256*1024)}catch{r={executed:t?.executed===!0,cancelled:t?.cancelled===!0,action:t?.action||null,rowReference:t?.rowReference||null,resultOmitted:"The detailed result was too large to store in chat."}}_.value=r,o.status!=="completed"&&T("submit",r)}function E(t){return Object.fromEntries(g.value.map(r=>[r.property,u.resolveProperty(t,r.property)]))}function I(){const t=String(o.resolvedArgs?.action||"").trim(),r=Array.isArray(o.resolvedArgs?.match)?o.resolvedArgs.match:[];if(!t)throw new Error("A configured row action ID or label is required.");if(!r.length)throw new Error("At least one exact row match is required before an action can run.");return{requestedAction:t,match:r}}async function N(t=!1){const{requestedAction:r,match:s}=I(),c=await C({startDate:o.resolvedArgs?.startDate,endDate:o.resolvedArgs?.endDate,dateProperty:o.resolvedArgs?.dateProperty,useDefaultDateRange:o.resolvedArgs?.useDefaultDateRange},{freshMetadata:t}),l=D(c.actions,r),m=c.rows.filter(k=>s.every(x=>{if(!x||typeof x.property!="string")return!1;const O=u.resolveColumn(x.property,c.columns)?.property||x.property;return Object.is(u.resolveProperty(k,O),x.value)}));if(m.length!==1){const k=m.length===0?"No rows match":`${m.length} rows match`;throw new Error(`${k} the supplied identity. Refine the match until it identifies exactly one row.`)}const p=m[0],h=c.sourceRows.indexOf(p);if(h<0)throw new Error("The selected row could not be mapped back to the table data.");if(!await z(l,p))throw new Error(`The "${l.label}" action is not available for this row.`);return{result:c,action:l,row:p,rowIndex:h}}function V(t){v.value=t.result,n.value=t.action,a.value=t.row,A.value=t.rowIndex;const r=t.result.columns.length?t.result.columns:u.inferTableColumns([t.row]);g.value=r.filter(s=>s.visible!==!1&&!s._remove).slice(0,8)}async function j(){if(!$()){w.value=!0,i.value=null;try{V(await N())}catch(t){i.value=t?.message||"Could not prepare the row action.",d.value="error",y({executed:!1,error:i.value,action:o.resolvedArgs?.action||null,availableActions:v.value?.actions?.map(r=>({id:r.id,label:r.label}))||[]})}finally{w.value=!1}}}async function q(){if(!(f.value||!n.value||!a.value||!v.value)){f.value=!0,i.value=null;try{V(await N(!0));const t=await S(n.value,a.value,A.value,v.value.sourceRows),r=u.buildRowReference(a.value,v.value.rows,v.value.columns);let s=null;try{s=u.serializeBounded(t.flowResult??null,64*1024)}catch{s={omitted:"The flow result was too large to store in chat."}}const c={executed:!0,cancelled:!1,action:{id:n.value.id,label:n.value.label},row:E(a.value),rowReference:r,columns:g.value.map(l=>({property:l.property,label:l.label||l.property,type:l.type||"text"})),flowResult:s,tableEffects:t.effects.map(l=>({type:l.type,index:l.index,merge:l.merge}))};d.value="success",y(c)}catch(t){i.value=t?.message||"The row action failed.",d.value="error",y({executed:!1,cancelled:!1,error:i.value,action:n.value?{id:n.value.id,label:n.value.label}:o.resolvedArgs?.action,rowReference:a.value&&v.value?u.buildRowReference(a.value,v.value.rows,v.value.columns):null})}finally{f.value=!1}}}function L(){f.value||(d.value="cancelled",y({executed:!1,cancelled:!0,action:n.value?{id:n.value.id,label:n.value.label}:o.resolvedArgs?.action,row:a.value?E(a.value):null,columns:g.value}))}return e.onMounted(j),(t,r)=>(e.openBlock(),e.createElementBlock("div",Z,[w.value?(e.openBlock(),e.createElementBlock("div",F,[e.createVNode(e.unref(b.Loader2),{class:"size-4 animate-spin"}),r[0]||(r[0]=e.createElementVNode("span",null,"Finding the row and action…",-1))])):d.value==="success"?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",X,[e.createVNode(e.unref(b.CheckCircle2),{class:"size-5"}),e.createElementVNode("span",null,e.toDisplayString(_.value?.action?.label||"Row action")+" completed",1)]),r[1]||(r[1]=e.createElementVNode("p",{class:"mt-1 text-xs text-muted-foreground"},"The table’s configured action flow finished successfully.",-1))])):d.value==="cancelled"?(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",H,[e.createVNode(e.unref(b.XCircle),{class:"size-5"}),r[2]||(r[2]=e.createElementVNode("span",null,"Action cancelled",-1))]),r[3]||(r[3]=e.createElementVNode("p",{class:"mt-1 text-xs text-muted-foreground"},"No row action was run.",-1))])):d.value==="error"?(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(e.unref(b.AlertTriangle),{class:"mt-0.5 size-4 shrink-0"}),e.createElementVNode("span",null,e.toDisplayString(i.value),1)])):(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.createElementVNode("div",W,[e.createElementVNode("div",Y,[e.createVNode(e.unref(b.AlertTriangle),{class:"size-4 text-amber-600 dark:text-amber-400"})]),e.createElementVNode("div",ee,[e.createElementVNode("p",te,"Confirm “"+e.toDisplayString(n.value?.label)+"”",1),r[4]||(r[4]=e.createElementVNode("p",{class:"mt-1 text-xs text-muted-foreground"}," This runs the action flow configured on this table and may change external data. ",-1)),o.resolvedArgs?.confirmationMessage?(e.openBlock(),e.createElementBlock("p",re," Agent note: "+e.toDisplayString(o.resolvedArgs.confirmationMessage),1)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",le,[e.createVNode(u._sfc_main,{title:"Selected row",rows:a.value?[a.value]:[],columns:g.value,view:"card","max-rows":1},null,8,["rows","columns"]),i.value?(e.openBlock(),e.createElementBlock("p",oe,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[e.createElementVNode("button",{type:"button",class:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",disabled:f.value,onClick:q},[f.value?(e.openBlock(),e.createBlock(e.unref(b.Loader2),{key:0,class:"size-3 animate-spin"})):(e.openBlock(),e.createBlock(e.unref(b.Play),{key:1,class:"size-3"})),e.createTextVNode(" "+e.toDisplayString(f.value?"Running…":`Run ${n.value?.label}`),1)],8,ne),e.createElementVNode("button",{type:"button",class:"rounded-lg border px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted disabled:opacity-50",disabled:f.value,onClick:L}," Cancel ",8,se)])])]))]))}});exports.default=ce;