@limetech/lime-crm-building-blocks 1.95.0 → 1.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/{_MapCache-2e84a981.js → _MapCache-8b125fbb.js} +0 -26
  3. package/dist/cjs/{_Uint8Array-1e99726d.js → _Uint8Array-95263550.js} +1 -12
  4. package/dist/cjs/_baseIsEqual-cb7951b0.js +496 -0
  5. package/dist/cjs/_defineProperty-40a6ad5d.js +15 -0
  6. package/dist/cjs/{get-1acf79ce.js → get-932b213e.js} +5 -4
  7. package/dist/cjs/isEqual-e77cce75.js +37 -0
  8. package/dist/cjs/isSymbol-5b36aeee.js +30 -0
  9. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  10. package/dist/cjs/lime-query.types-bcb63a22.js +61 -0
  11. package/dist/cjs/limebb-component-config.cjs.entry.js +3 -2
  12. package/dist/cjs/limebb-document-item.cjs.entry.js +174 -0
  13. package/dist/cjs/limebb-document-picker.cjs.entry.js +82 -0
  14. package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
  16. package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
  17. package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
  18. package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
  19. package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
  20. package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
  21. package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
  22. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +382 -150
  23. package/dist/cjs/limebb-lime-query-filter-and_5.cjs.entry.js +278 -0
  24. package/dist/cjs/limebb-lime-query-value-input.cjs.entry.js +239 -0
  25. package/dist/cjs/limebb-limetype-field_2.cjs.entry.js +406 -0
  26. package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
  27. package/dist/cjs/limebb-locale-picker.cjs.entry.js +13 -498
  28. package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
  29. package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
  30. package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
  31. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
  32. package/dist/cjs/limebb-property-selector.cjs.entry.js +234 -0
  33. package/dist/cjs/limebb-response-format-item.cjs.entry.js +80 -0
  34. package/dist/cjs/limebb-text-editor.cjs.entry.js +22 -83
  35. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
  36. package/dist/cjs/limetype-1fe0207f.js +90 -0
  37. package/dist/cjs/loader.cjs.js +1 -1
  38. package/dist/cjs/property-resolution-fb42a46b.js +66 -0
  39. package/dist/cjs/random-string-aac0a74b.js +24 -0
  40. package/dist/collection/collection-manifest.json +12 -0
  41. package/dist/collection/components/document-picker/document-item/document-item.css +64 -0
  42. package/dist/collection/components/document-picker/document-item/document-item.js +265 -0
  43. package/dist/collection/components/document-picker/document-item/document-item.types.js +1 -0
  44. package/dist/collection/components/document-picker/document-picker.css +139 -0
  45. package/dist/collection/components/document-picker/document-picker.js +304 -0
  46. package/dist/collection/components/document-picker/document.types.js +1 -0
  47. package/dist/collection/components/feed/feed-item/feed-timeline-item.js +1 -1
  48. package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.js +1 -1
  49. package/dist/collection/components/feed/feed.js +1 -1
  50. package/dist/collection/components/icon-picker/icon-picker.js +1 -1
  51. package/dist/collection/components/info-tile/format/config/info-tile-format.js +1 -1
  52. package/dist/collection/components/info-tile/info-tile.js +1 -1
  53. package/dist/collection/components/kanban/kanban-group/kanban-group.js +1 -1
  54. package/dist/collection/components/kanban/kanban-item/kanban-item.js +1 -1
  55. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.css +121 -0
  56. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +257 -0
  57. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.css +39 -0
  58. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +246 -0
  59. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.css +104 -0
  60. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.js +220 -0
  61. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.css +107 -0
  62. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +212 -0
  63. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.css +123 -0
  64. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +237 -0
  65. package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.css +48 -0
  66. package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.js +457 -0
  67. package/dist/collection/components/lime-query-builder/filter-conversion.js +118 -21
  68. package/dist/collection/components/lime-query-builder/lime-query-builder.css +30 -17
  69. package/dist/collection/components/lime-query-builder/lime-query-builder.js +233 -28
  70. package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +435 -0
  71. package/dist/collection/components/lime-query-builder/property-selection-format.js +158 -0
  72. package/dist/collection/components/lime-query-builder/property-selector/property-selector.css +8 -0
  73. package/dist/collection/components/lime-query-builder/property-selector/property-selector.js +422 -0
  74. package/dist/collection/components/lime-query-builder/response-format-editor.css +72 -0
  75. package/dist/collection/components/lime-query-builder/response-format-editor.js +249 -0
  76. package/dist/collection/components/lime-query-builder/response-format-item.css +61 -0
  77. package/dist/collection/components/lime-query-builder/response-format-item.js +208 -0
  78. package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
  79. package/dist/collection/components/locale-picker/locale-picker.js +1 -1
  80. package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
  81. package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
  82. package/dist/collection/components/summary-popover/summary-popover.js +3 -3
  83. package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
  84. package/dist/collection/components/text-editor/text-editor.js +1 -1
  85. package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
  86. package/dist/collection/util/format-bytes.js +36 -0
  87. package/dist/components/_MapCache.js +2 -27
  88. package/dist/components/_Uint8Array.js +2 -12
  89. package/dist/components/_baseIsEqual.js +494 -0
  90. package/dist/components/_defineProperty.js +13 -0
  91. package/dist/components/document-item.js +190 -0
  92. package/dist/components/feed-item-thumbnail-file-info.js +1 -1
  93. package/dist/components/feed-timeline-item.js +1 -1
  94. package/dist/components/get.js +2 -1
  95. package/dist/components/isEqual.js +35 -0
  96. package/dist/components/isSymbol.js +28 -0
  97. package/dist/components/kanban-group.js +1 -1
  98. package/dist/components/kanban-item.js +1 -1
  99. package/dist/components/lime-query-filter-and.js +408 -0
  100. package/dist/components/lime-query-filter-comparison.js +152 -0
  101. package/dist/components/lime-query-value-input.js +266 -0
  102. package/dist/components/limebb-document-item.d.ts +11 -0
  103. package/dist/components/limebb-document-item.js +6 -0
  104. package/dist/components/limebb-document-picker.d.ts +11 -0
  105. package/dist/components/limebb-document-picker.js +111 -0
  106. package/dist/components/limebb-feed.js +1 -1
  107. package/dist/components/limebb-icon-picker.js +1 -1
  108. package/dist/components/limebb-info-tile-format.js +1 -1
  109. package/dist/components/limebb-info-tile.js +1 -1
  110. package/dist/components/limebb-lime-query-builder.js +441 -149
  111. package/dist/components/limebb-lime-query-filter-and.d.ts +11 -0
  112. package/dist/components/limebb-lime-query-filter-and.js +6 -0
  113. package/dist/components/limebb-lime-query-filter-comparison.d.ts +11 -0
  114. package/dist/components/limebb-lime-query-filter-comparison.js +6 -0
  115. package/dist/components/limebb-lime-query-filter-expression.d.ts +11 -0
  116. package/dist/components/limebb-lime-query-filter-expression.js +6 -0
  117. package/dist/components/limebb-lime-query-filter-not.d.ts +11 -0
  118. package/dist/components/limebb-lime-query-filter-not.js +6 -0
  119. package/dist/components/limebb-lime-query-filter-or.d.ts +11 -0
  120. package/dist/components/limebb-lime-query-filter-or.js +6 -0
  121. package/dist/components/limebb-lime-query-value-input.d.ts +11 -0
  122. package/dist/components/limebb-lime-query-value-input.js +6 -0
  123. package/dist/components/limebb-limetype-field.d.ts +11 -0
  124. package/dist/components/limebb-limetype-field.js +6 -0
  125. package/dist/components/limebb-locale-picker.js +8 -493
  126. package/dist/components/limebb-mention-group-counter.js +2 -2
  127. package/dist/components/limebb-percentage-visualizer.js +2 -2
  128. package/dist/components/limebb-property-selector.d.ts +11 -0
  129. package/dist/components/limebb-property-selector.js +6 -0
  130. package/dist/components/limebb-response-format-editor.d.ts +11 -0
  131. package/dist/components/limebb-response-format-editor.js +6 -0
  132. package/dist/components/limebb-response-format-item.d.ts +11 -0
  133. package/dist/components/limebb-response-format-item.js +6 -0
  134. package/dist/components/limebb-text-editor.js +8 -69
  135. package/dist/components/limebb-trend-indicator.js +1 -1
  136. package/dist/components/limetype-field.js +184 -0
  137. package/dist/components/limetype.js +85 -0
  138. package/dist/components/live-docs-info.js +2 -2
  139. package/dist/components/notification-item.js +1 -1
  140. package/dist/components/property-selector.js +317 -0
  141. package/dist/components/random-string.js +22 -0
  142. package/dist/components/response-format-editor.js +278 -0
  143. package/dist/components/response-format-item.js +104 -0
  144. package/dist/components/summary-popover.js +3 -3
  145. package/dist/esm/{_MapCache-6484495d.js → _MapCache-af496e9d.js} +2 -27
  146. package/dist/esm/{_Uint8Array-e5cac922.js → _Uint8Array-d6ebd526.js} +3 -13
  147. package/dist/esm/_baseIsEqual-28053b81.js +494 -0
  148. package/dist/esm/_defineProperty-e6a185c3.js +13 -0
  149. package/dist/esm/{get-f9e0b2e1.js → get-3e42932b.js} +2 -1
  150. package/dist/esm/isEqual-57d0c223.js +35 -0
  151. package/dist/esm/isSymbol-1c5f65cc.js +28 -0
  152. package/dist/esm/lime-crm-building-blocks.js +1 -1
  153. package/dist/esm/lime-query.types-f72355e1.js +59 -0
  154. package/dist/esm/limebb-component-config.entry.js +3 -2
  155. package/dist/esm/limebb-document-item.entry.js +170 -0
  156. package/dist/esm/limebb-document-picker.entry.js +78 -0
  157. package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
  158. package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
  159. package/dist/esm/limebb-feed.entry.js +1 -1
  160. package/dist/esm/limebb-icon-picker.entry.js +1 -1
  161. package/dist/esm/limebb-info-tile-format.entry.js +1 -1
  162. package/dist/esm/limebb-info-tile.entry.js +1 -1
  163. package/dist/esm/limebb-kanban-group.entry.js +1 -1
  164. package/dist/esm/limebb-kanban-item.entry.js +1 -1
  165. package/dist/esm/limebb-lime-query-builder.entry.js +379 -147
  166. package/dist/esm/limebb-lime-query-filter-and_5.entry.js +270 -0
  167. package/dist/esm/limebb-lime-query-value-input.entry.js +235 -0
  168. package/dist/esm/limebb-limetype-field_2.entry.js +401 -0
  169. package/dist/esm/limebb-live-docs-info.entry.js +2 -2
  170. package/dist/esm/limebb-locale-picker.entry.js +9 -494
  171. package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
  172. package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
  173. package/dist/esm/limebb-notification-item.entry.js +1 -1
  174. package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
  175. package/dist/esm/limebb-property-selector.entry.js +230 -0
  176. package/dist/esm/limebb-response-format-item.entry.js +76 -0
  177. package/dist/esm/limebb-text-editor.entry.js +8 -69
  178. package/dist/esm/limebb-trend-indicator.entry.js +1 -1
  179. package/dist/esm/limetype-6e7552a7.js +85 -0
  180. package/dist/esm/loader.js +1 -1
  181. package/dist/esm/property-resolution-fde2375e.js +63 -0
  182. package/dist/esm/random-string-f6ef6fbf.js +22 -0
  183. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  184. package/dist/lime-crm-building-blocks/{p-85e11ff7.entry.js → p-00da9b24.entry.js} +1 -1
  185. package/dist/lime-crm-building-blocks/p-02c0cc04.entry.js +1 -0
  186. package/dist/lime-crm-building-blocks/p-123190c3.js +1 -0
  187. package/dist/lime-crm-building-blocks/p-244ee55b.entry.js +1 -0
  188. package/dist/lime-crm-building-blocks/p-35897ec3.js +1 -0
  189. package/dist/lime-crm-building-blocks/{p-d6a07ea4.entry.js → p-3932077b.entry.js} +1 -1
  190. package/dist/lime-crm-building-blocks/p-3b0a15ec.js +1 -0
  191. package/dist/lime-crm-building-blocks/p-4a82410e.entry.js +1 -0
  192. package/dist/lime-crm-building-blocks/{p-a694aae5.entry.js → p-50d3d61a.entry.js} +1 -1
  193. package/dist/lime-crm-building-blocks/p-5a6d2e7f.js +1 -0
  194. package/dist/lime-crm-building-blocks/p-60971d64.js +1 -0
  195. package/dist/lime-crm-building-blocks/{p-a44f543c.entry.js → p-61282e1a.entry.js} +1 -1
  196. package/dist/lime-crm-building-blocks/p-6c1146ca.entry.js +1 -0
  197. package/dist/lime-crm-building-blocks/p-70a28b93.entry.js +1 -0
  198. package/dist/lime-crm-building-blocks/{p-16199127.entry.js → p-79d4668a.entry.js} +1 -1
  199. package/dist/lime-crm-building-blocks/p-7e6fb4af.js +1 -0
  200. package/dist/lime-crm-building-blocks/{p-88cc5b66.entry.js → p-82d33d43.entry.js} +1 -1
  201. package/dist/lime-crm-building-blocks/{p-7db8652e.entry.js → p-8c4eb49f.entry.js} +1 -1
  202. package/dist/lime-crm-building-blocks/p-96beaabc.entry.js +1 -0
  203. package/dist/lime-crm-building-blocks/p-9d25ed5a.entry.js +1 -0
  204. package/dist/lime-crm-building-blocks/{p-8dce83ad.entry.js → p-9d9f25da.entry.js} +1 -1
  205. package/dist/lime-crm-building-blocks/p-a659d55a.js +1 -0
  206. package/dist/lime-crm-building-blocks/p-b7c72179.entry.js +1 -0
  207. package/dist/lime-crm-building-blocks/p-baf4e428.entry.js +1 -0
  208. package/dist/lime-crm-building-blocks/{p-516210d4.entry.js → p-beb0d164.entry.js} +1 -1
  209. package/dist/lime-crm-building-blocks/p-d298b34e.js +1 -0
  210. package/dist/lime-crm-building-blocks/{p-047c89de.entry.js → p-d89c44ad.entry.js} +1 -1
  211. package/dist/lime-crm-building-blocks/p-e0ab1554.js +1 -0
  212. package/dist/lime-crm-building-blocks/{p-46d2f604.entry.js → p-e35299e0.entry.js} +1 -1
  213. package/dist/lime-crm-building-blocks/{p-8ef39ab8.entry.js → p-e9d23ef7.entry.js} +1 -1
  214. package/dist/lime-crm-building-blocks/p-ef8a5266.entry.js +1 -0
  215. package/dist/lime-crm-building-blocks/{p-abf1c197.entry.js → p-f52125a0.entry.js} +1 -1
  216. package/dist/lime-crm-building-blocks/p-f99c611d.entry.js +1 -0
  217. package/dist/lime-crm-building-blocks/p-fbda77a7.js +1 -0
  218. package/dist/lime-crm-building-blocks/p-fe2b91d9.js +1 -0
  219. package/dist/lime-crm-building-blocks/{p-d6af09a8.entry.js → p-ff0b244b.entry.js} +1 -1
  220. package/dist/types/components/document-picker/document-item/document-item.d.ts +46 -0
  221. package/dist/types/components/document-picker/document-item/document-item.types.d.ts +37 -0
  222. package/dist/types/components/document-picker/document-picker.d.ts +80 -0
  223. package/dist/types/components/document-picker/document.types.d.ts +2 -0
  224. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +56 -0
  225. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-comparison.d.ts +64 -0
  226. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-expression.d.ts +53 -0
  227. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-not.d.ts +54 -0
  228. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +55 -0
  229. package/dist/types/components/lime-query-builder/expressions/lime-query-value-input.d.ts +92 -0
  230. package/dist/types/components/lime-query-builder/filter-conversion.d.ts +18 -0
  231. package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +30 -8
  232. package/dist/types/components/lime-query-builder/limetype-field/limetype-field.d.ts +96 -0
  233. package/dist/types/components/lime-query-builder/property-selection-format.d.ts +23 -0
  234. package/dist/types/components/lime-query-builder/property-selector/property-selector.d.ts +71 -0
  235. package/dist/types/components/lime-query-builder/response-format-editor.d.ts +57 -0
  236. package/dist/types/components/lime-query-builder/response-format-item.d.ts +46 -0
  237. package/dist/types/components.d.ts +1795 -114
  238. package/dist/types/util/format-bytes.d.ts +20 -0
  239. package/package.json +2 -2
  240. package/dist/lime-crm-building-blocks/p-29346b1a.entry.js +0 -1
  241. package/dist/lime-crm-building-blocks/p-4ccce5cc.entry.js +0 -1
  242. package/dist/lime-crm-building-blocks/p-7ef3bace.entry.js +0 -1
  243. package/dist/lime-crm-building-blocks/p-8044ffbd.js +0 -1
  244. package/dist/lime-crm-building-blocks/p-92ec9205.entry.js +0 -1
  245. package/dist/lime-crm-building-blocks/p-bcc23575.js +0 -1
  246. package/dist/lime-crm-building-blocks/p-c40a3f4b.js +0 -1
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Format a file size in bytes into a human readable string.
3
+ *
4
+ * Uses base 1024 units (binary prefixes without the "i" designation)
5
+ * and applies adaptive precision: one decimal for values < 10 of the
6
+ * chosen unit, otherwise no decimals.
7
+ *
8
+ * Examples:
9
+ * - 0 => "0 B"
10
+ * - 512 => "512 B"
11
+ * - 1536 => "1.5 KB"
12
+ * - 1048576 => "1 MB"
13
+ * - 5347737600 => "4.98 GB" (value < 10 so one decimal)
14
+ *
15
+ * @param bytes - the size in bytes
16
+ * @param decimals - max number of decimals for small unit values (default: 1)
17
+ * @returns formatted size string
18
+ */
19
+ export declare function formatBytes(bytes: number | undefined | null, decimals?: number): string;
20
+ //# sourceMappingURL=format-bytes.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-crm-building-blocks",
3
- "version": "1.95.0",
3
+ "version": "1.97.0",
4
4
  "description": "A home for shared components meant for use with Lime CRM",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@limetech/eslint-config": "^3.0.1",
38
- "@limetech/lime-elements": "^38.28.2",
38
+ "@limetech/lime-elements": "^38.29.0",
39
39
  "@limetech/lime-web-components": "^6.4.1",
40
40
  "@limetech/lime-web-components-testing": "^1.0.0",
41
41
  "@lundalogik/lime-icons8": "^2.36.1",
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as e,g as r}from"./p-1556b545.js";import{D as s,M as n,c as o,W as a,H as h,T as c}from"./p-1fba0ade.js";import{A as u,a as f,b as l,E as d,T as v}from"./p-463d3174.js";import{d as b,b as p,k as m,c as g,s as y,a as j,e as w,U as O,S,g as k}from"./p-bcc23575.js";import{i as M,e as x}from"./p-c40a3f4b.js";import{d as I,r as T,S as A,a as C,i as E}from"./p-b31772c8.js";import{d as F,i as P,o as $,g as _,h as D,n as N,a as L}from"./p-5322fd19.js";import{i as R}from"./p-1484e300.js";var U=/\s/,z=/^\s+/;var G=NaN,W=/^[-+]0x[0-9a-f]+$/i,H=/^0b[01]+$/i,Q=/^0o[0-7]+$/i,q=parseInt;function B(t){if("number"==typeof t)return t;if(M(t))return G;if(I(t)){var i="function"==typeof t.valueOf?t.valueOf():t;t=I(i)?i+"":i}if("string"!=typeof t)return 0===t?t:+t;var e;t=(e=t)?e.slice(0,function(t){for(var i=t.length;i--&&U.test(t.charAt(i)););return i}(e)+1).replace(z,""):e;var r=H.test(t);return r||Q.test(t)?q(t.slice(2),r?2:8):W.test(t)?G:+t}var K=Object.create;const V=function(){function t(){}return function(i){if(!I(i))return{};if(K)return K(i);t.prototype=i;var e=new t;return t.prototype=void 0,e}}();function J(t,i,e){"__proto__"==i&&b?b(t,i,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[i]=e}var X=Object.prototype.hasOwnProperty;function Y(t,i,e){var r=t[i];X.call(t,i)&&x(r,e)&&(void 0!==e||i in t)||J(t,i,e)}function Z(t,i,e,r){var s=!e;e||(e={});for(var n=-1,o=i.length;++n<o;){var a=i[n],h=r?r(e[a],t[a],a,e,t):void 0;void 0===h&&(h=t[a]),s?J(e,a,h):Y(e,a,h)}return e}var tt=Object.prototype.hasOwnProperty;function it(t){return P(t)?p(t,!0):function(t){if(!I(t))return function(t){var i=[];if(null!=t)for(var e in Object(t))i.push(e);return i}(t);var i=F(t),e=[];for(var r in t)("constructor"!=r||!i&&tt.call(t,r))&&e.push(r);return e}(t)}const et=$(Object.getPrototypeOf,Object);var rt="object"==typeof exports&&exports&&!exports.nodeType&&exports,st=rt&&"object"==typeof module&&module&&!module.nodeType&&module,nt=st&&st.exports===rt?T.Buffer:void 0,ot=nt?nt.allocUnsafe:void 0;const at=Object.getOwnPropertySymbols?function(t){for(var i=[];t;)j(i,g(t)),t=et(t);return i}:y;function ht(t){return w(t,it,at)}var ct=Object.prototype.hasOwnProperty;function ut(t){var i=new t.constructor(t.byteLength);return new O(i).set(new O(t)),i}var ft=/\w*$/,lt=A?A.prototype:void 0,dt=lt?lt.valueOf:void 0,vt="[object Boolean]",bt="[object Date]",pt="[object Map]",mt="[object Number]",gt="[object RegExp]",yt="[object Set]",jt="[object String]",wt="[object Symbol]",Ot="[object ArrayBuffer]",St="[object DataView]",kt="[object Float32Array]",Mt="[object Float64Array]",xt="[object Int8Array]",It="[object Int16Array]",Tt="[object Int32Array]",At="[object Uint8Array]",Ct="[object Uint8ClampedArray]",Et="[object Uint16Array]",Ft="[object Uint32Array]";var Pt=N&&N.isMap;const $t=Pt?D(Pt):function(t){return C(t)&&"[object Map]"==_(t)};var _t=N&&N.isSet;const Dt=_t?D(_t):function(t){return C(t)&&"[object Set]"==_(t)};var Nt=1,Lt=2,Rt=4,Ut="[object Arguments]",zt="[object Function]",Gt="[object GeneratorFunction]",Wt="[object Object]",Ht={};function Qt(t,i,e,r,s,n){var o,a=i&Nt,h=i&Lt,c=i&Rt;if(e&&(o=s?e(t,r,s,n):e(t)),void 0!==o)return o;if(!I(t))return t;var u=E(t);if(u){if(o=function(t){var i=t.length,e=new t.constructor(i);return i&&"string"==typeof t[0]&&ct.call(t,"index")&&(e.index=t.index,e.input=t.input),e}(t),!a)return function(t,i){var e=-1,r=t.length;for(i||(i=Array(r));++e<r;)i[e]=t[e];return i}(t,o)}else{var f=_(t),l=f==zt||f==Gt;if(L(t))return function(t,i){if(i)return t.slice();var e=t.length,r=ot?ot(e):new t.constructor(e);return t.copy(r),r}(t,a);if(f==Wt||f==Ut||l&&!s){if(o=h||l?{}:function(t){return"function"!=typeof t.constructor||F(t)?{}:V(et(t))}(t),!a)return h?function(t,i){return Z(t,at(t),i)}(t,function(t,i){return t&&Z(i,it(i),t)}(o,t)):function(t,i){return Z(t,g(t),i)}(t,function(t,i){return t&&Z(i,m(i),t)}(o,t))}else{if(!Ht[f])return s?t:{};o=function(t,i,e){var r,s,n=t.constructor;switch(i){case Ot:return ut(t);case vt:case bt:return new n(+t);case St:return function(t,i){var e=i?ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,e);case kt:case Mt:case xt:case It:case Tt:case At:case Ct:case Et:case Ft:return function(t,i){var e=i?ut(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}(t,e);case pt:return new n;case mt:case jt:return new n(t);case gt:return(s=new(r=t).constructor(r.source,ft.exec(r))).lastIndex=r.lastIndex,s;case yt:return new n;case wt:return dt?Object(dt.call(t)):{}}}(t,f,a)}}n||(n=new S);var d=n.get(t);if(d)return d;n.set(t,o),Dt(t)?t.forEach((function(r){o.add(Qt(r,i,e,r,t,n))})):$t(t)&&t.forEach((function(r,s){o.set(s,Qt(r,i,e,s,t,n))}));var v=u?void 0:(c?h?ht:k:h?it:m)(t);return function(t,i){for(var e=-1,r=null==t?0:t.length;++e<r&&!1!==i(t[e],e););}(v||t,(function(r,s){v&&(r=t[s=r]),Y(o,s,Qt(r,i,e,s,t,n))})),o}Ht[Ut]=Ht["[object Array]"]=Ht["[object ArrayBuffer]"]=Ht["[object DataView]"]=Ht["[object Boolean]"]=Ht["[object Date]"]=Ht["[object Float32Array]"]=Ht["[object Float64Array]"]=Ht["[object Int8Array]"]=Ht["[object Int16Array]"]=Ht["[object Int32Array]"]=Ht["[object Map]"]=Ht["[object Number]"]=Ht[Wt]=Ht["[object RegExp]"]=Ht["[object Set]"]=Ht["[object String]"]=Ht["[object Symbol]"]=Ht["[object Uint8Array]"]=Ht["[object Uint8ClampedArray]"]=Ht["[object Uint16Array]"]=Ht["[object Uint32Array]"]=!0,Ht["[object Error]"]=Ht[zt]=Ht["[object WeakMap]"]=!1;const qt=function(){return T.Date.now()};var Bt=Math.max,Kt=Math.min;function Vt(t,i){return t.label===i}function Jt(t,i){return Object.values(t.properties).find((t=>t&&t.relation&&Vt(t.relation.getLimetype(),i)))}function Xt(t,i){const e=Jt(t,i);return!!e&&function(t){return s(t)&&!n(t)}(e)}class Yt{get limeObjectService(){return this.platform.get(o.LimeObjectRepository)}get queryService(){return this.platform.get(o.Query)}get viewFactoryRegistry(){return this.platform.get(o.ViewFactoryRegistry)}get translator(){var t;return null===(t=this.platform)||void 0===t?void 0:t.get(o.Translate)}get triggerCharacter(){return this._triggerCharacter}get triggerHandler(){return this._triggerHandler}constructor(t,i,e){this.platform=t,this.context=i,this.searchableLimetypes=e,this.groupCounts={},this._triggerCharacter="@",this._triggerHandler={searcher:t=>this.searcher(t),inserter:(t,i)=>this.inserter(t,i),emptySearchMessage:"Start typing a name...",noItemsFoundMessage:"No results for your search...",nodeDefinition:{customElement:{tagName:"limebb-mention",attributes:["limetype","objectid","href"]},mapAttributes:t=>({limetype:t.value.getLimetype().name,objectid:t.value.id,href:`object/${this.context.limetype}/${this.context.id}`})}},this.searcher=async t=>{if(!t)return[];const{objects:i}=await this.limeObjectService.search(t,this.searchableLimetypes,10);return this.createSearchListItems(i)},this.inserter=async(t,i)=>{var e;const r=this.triggerHandler.nodeDefinition;r&&t.insert({node:{tagName:r.customElement.tagName,attributes:r.mapAttributes(i)},children:[null===(e=i.value)||void 0===e?void 0:e.descriptive]})}}async initialize(){await this.loadGroupCounts()}async loadGroupCounts(){const t=this.searchableLimetypes.filter((t=>!Vt(t,"user")&&Xt(t,"user"))).map((t=>this.getGroupCounts(t)));for(const i of await Promise.all(t))Object.assign(this.groupCounts,i)}async getGroupCounts(t){var i;const e=Jt(t,"user"),r=t.name;try{const t=await this.queryService.execute({limetype:r,responseFormat:{object:{_id:null,[e.name]:{count:{aggregate:{op:a.Count}}}}}});if(!(null===(i=t.objects)||void 0===i?void 0:i.length))return{[r]:{}};const s=this.createGroupCount(t.objects,e.name);return{[r]:s}}catch(i){return console.error(`Error fetching group count for limetype: ${t.name}`,i),{[r]:{}}}}createGroupCount(t,i){const e={};for(const r of t){const{_id:t,[i]:s}=r;e[t]=s.count}return e}createSearchListItems(t=[]){return t.map((t=>this.createSearchListItem(t))).filter(R)}createSearchListItem(t){const i=this.viewFactoryRegistry.getFactory("search"),e=this.limeObjectService.getObject(t._limetype,t._id);if(!e)return null;const r=i(e,this.context),s=this.getGroupCountComponent(e);return Object.assign(Object.assign({},r),s?{primaryComponent:s}:{})}getGroupCountComponent(t){var i;const e=t.getLimetype(),r=null===(i=this.groupCounts[e.name])||void 0===i?void 0:i[t.id],s=Jt(e,"user");if(void 0!==r&&s)return{name:"limebb-mention-group-counter",props:{count:r,limetype:s.relation.getLimetype(),helperLabel:this.translator.get("webclient.notification-center.members-will-be-notified")}}}}class Zt{constructor(t,i){this.file=t,this.http=i,this.uploadCancelled=!1,this.getUrl=t=>`api/v1/file/${null!=t?t:""}`}async initialize(){this.uploadService=await this.http.createFileUpload(h.Post,this.getUrl(),this.file),this.progressCallback&&(this.uploadService.onProgress=this.progressCallback)}async upload(){return this.uploadService.upload()}getFileName(){return this.file.name}cancel(){this.uploadService.cancel(),this.uploadCancelled=!0}set onProgress(t){this.progressCallback=t,this.uploadService&&(this.uploadService.onProgress=t)}}class ti{constructor(t){this.platform=t}async handleImagePasted(t){const i=null==t?void 0:t.fileInfo;if(!i)return;if(!this.validateImageSize(i))return;t.insertThumbnail();const e=await this.createFileUpload(i),r=null==e?void 0:e.href;return r&&void 0!==(null==e?void 0:e.fileId)?t.insertImage(r):t.insertFailedThumbnail(),e}parseFileIdFromSrc(t){if(t){const i=/\/(\d+)\/contents\/?$/.exec(t);if(i&&i[1])return Number(i[1])}}validateImageSize(t){return!!t.fileContent&&t.fileContent.size<=52428800}async createFileUpload(t){var i;if(!t.fileContent)return;const e=new Zt(t.fileContent,this.http);await e.initialize();const r=Object.assign(Object.assign({},t),{progress:0,file:e,state:"added",fileId:void 0,href:void 0,id:t.id});e.onProgress=t=>{0===r.progress&&(r.state="uploading"),r.progress=t,100===t&&(r.state="finalizing")};const s=await e.upload();return r.fileId=s.id,r.filename=s.filename,r.extension=s.extension,r.contentType=s.contentType,r.size=s.size,r.state="done",r.href=null===(i=s._links)||void 0===i?void 0:i.contents.href,r}get http(){return this.platform.get(o.Http)}}const ii=class{watchOpen(){this.setupHandlers(),this.setPickerMessage()}watchQuery(){this.setPickerMessage()}constructor(e){var r;t(this,e),this.change=i(this,"change",7),this.metadataChange=i(this,"metadataChange",7),this.allowMentioning=!1,this.contentType="markdown",this.language="en",this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.ui="standard",this.allowResize=!0,this.value="",this.triggerMap={},this.customElements=[],this.allowInlineImages=!1,this.items=[],this.highlightedItemIndex=0,this.isPickerOpen=!1,this.isSearching=!1,this.registeredTriggers=[],this.registeredTriggerMap=this.triggerMap,this.registeredCustomElements=this.customElements,this.activeTrigger=void 0,this.handleMouseClick=t=>{this.textEditorPickerElement&&(t.target===this.textEditorPickerElement||this.resetTriggerAndPicker())},this.handleKeyPress=t=>{if(!this.isPickerOpen||!this.activeTrigger)return;if(![f,l,u,d,v].includes(t.key))return;if(t.stopPropagation(),t.preventDefault(),"keyup"===t.type)return;const i={[f]:this.handleEscapeKey,[d]:this.handleEnterOrTabKey,[v]:this.handleEnterOrTabKey,[u]:this.handleArrowKeyPress,[l]:this.handleArrowKeyPress}[t.key];i&&i(t)},this.handleArrowKeyPress=t=>{this.highlightedItemIndex=this.findNonSeparatorIndex(t.key,this.highlightedItemIndex)},this.findNonSeparatorIndex=(t,i,e=0)=>{if(0===this.items.length||e>this.items.length)return i;const r=((t,i,e)=>(i+(t===u?1:-1)+e)%e)(t,i,this.items.length);return this.isListSeparator(this.items[r])?this.findNonSeparatorIndex(t,r,e+1):r},this.handleEscapeKey=()=>{var t;null===(t=this.triggerFunction)||void 0===t||t.stopTrigger(),this.resetTriggerAndPicker()},this.handleEnterOrTabKey=t=>{this.handleItemSelection(t)},this.handleMetadataChange=t=>{t.stopPropagation();const i=t.detail,e=this.getEnhancedImages(i.images||[]),r=Object.assign(Object.assign({},i),{images:e});this.metadataChange.emit(r)},this.handleImagePasted=t=>{t.stopPropagation(),this.allowInlineImages&&this.uploadHandler.handleImagePasted(t.detail)},this.handleTriggerStart=t=>{t.stopPropagation(),this.activeTrigger=t.detail.trigger,this.triggerFunction=t.detail.textEditor,this.isPickerOpen=!0},this.handleTriggerStop=t=>{t.stopPropagation(),this.resetTriggerAndPicker()},this.handleTriggerChange=t=>{var i;t.stopImmediatePropagation(),this.editorPickerQuery=t.detail.value;const e=null===(i=this.registeredTriggerMap[t.detail.trigger])||void 0===i?void 0:i.searcher;e&&(this.isSearching=!0,this.debouncedSearchFn(e,this.editorPickerQuery))},this.resetTriggerAndPicker=()=>{this.isPickerOpen=!1,this.activeTrigger=void 0,this.triggerFunction=void 0,this.isSearching=!1,this.highlightedItemIndex=0,this.items=[]},this.handleItemSelection=t=>{var i;let e;if(t instanceof CustomEvent)e=t.detail;else{if(!(t instanceof KeyboardEvent))return;{const t=this.items[this.highlightedItemIndex];if(this.isListSeparator(t))return;e=t}}if(!this.activeTrigger)return;const r=this.registeredTriggerMap[this.activeTrigger];try{r.inserter(this.triggerFunction,e)}catch(t){console.error("Error inserting",t)}this.resetTriggerAndPicker(),null===(i=this.textEditor)||void 0===i||i.focus()},this.handleVisibilityChange=()=>{"hidden"===document.visibilityState&&this.saveDraft()},this.handleBeforeUnload=()=>{this.saveDraft()},this.portalId="crypto"in window&&"function"==typeof(null===(r=window.crypto)||void 0===r?void 0:r.randomUUID)?"a_"+crypto.randomUUID():String.fromCodePoint(97+Math.floor(26*Math.random()))+Math.random().toString(36).slice(Math.max(0,2))+Math.random().toString(36).slice(Math.max(0,2)),this.debouncedSearchFn=function(t,i,e){var r,s,n,o,a,h,c=0,u=!1,f=!1,l=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(i){var e=r,n=s;return r=s=void 0,c=i,o=t.apply(n,e)}function v(t){var e=t-h;return void 0===h||e>=i||e<0||f&&t-c>=n}function b(){var t=qt();if(v(t))return p(t);a=setTimeout(b,function(t){var e=i-(t-h);return f?Kt(e,n-(t-c)):e}(t))}function p(t){return a=void 0,l&&r?d(t):(r=s=void 0,o)}function m(){var t=qt(),e=v(t);if(r=arguments,s=this,h=t,e){if(void 0===a)return function(t){return c=t,a=setTimeout(b,i),u?d(t):o}(h);if(f)return clearTimeout(a),a=setTimeout(b,i),d(h)}return void 0===a&&(a=setTimeout(b,i)),o}return i=B(i)||0,I(e)&&(u=!!e.leading,n=(f="maxWait"in e)?Bt(B(e.maxWait)||0,i):n,l="trailing"in e?!!e.trailing:l),m.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=h=s=a=void 0},m.flush=function(){return void 0===a?o:p(qt())},m}((async(t,i)=>{try{const e=await t(i);if(i!==this.editorPickerQuery||!this.activeTrigger)return;this.items=e}catch(t){console.error("Error searching",t)}finally{this.isSearching=!1}}),300)}connectedCallback(){var t,i,e,r;if(this.draftIdentifier){const s=null!==(i=null===(t=this.context)||void 0===t?void 0:t.id)&&void 0!==i?i:"no-limeobject",n=null!==(r=null===(e=this.context)||void 0===e?void 0:e.limetype)&&void 0!==r?r:"no-limetype";this.textEditorInnerId=["text-editor-draft",n,s,this.draftIdentifier].join("-")}this.textEditorInnerId&&(document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("beforeunload",this.handleBeforeUnload)),this.uploadHandler=new ti(this.platform)}componentWillLoad(){this.allowMentioning&&this.registerMentions(),this.registerTriggers(),this.loadDraft()}disconnectedCallback(){document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.handleBeforeUnload),document.removeEventListener("mousedown",this.handleMouseClick),this.saveDraft(),this.host&&(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0})),this.debouncedSearchFn&&this.debouncedSearchFn.cancel&&this.debouncedSearchFn.cancel()}registerMentions(){const t=new Yt(this.platform,this.context,this.searchableLimetypes),i=t.triggerHandler.nodeDefinition;i&&(this.registeredCustomElements.push(i.customElement),this.registeredTriggerMap[t.triggerCharacter]=t.triggerHandler,t.initialize())}registerTriggers(){this.registeredTriggers=Object.keys(this.registeredTriggerMap)}setPickerMessage(){var t;if(!this.activeTrigger)return;const i=this.registeredTriggerMap[this.activeTrigger];this.pickerMessage=(null===(t=this.editorPickerQuery)||void 0===t?void 0:t.length)>0?i.noItemsFoundMessage:i.emptySearchMessage}setupHandlers(){this.isPickerOpen?(this.host.addEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.addEventListener("keydown",this.handleKeyPress,{capture:!0}),document.addEventListener("mousedown",this.handleMouseClick)):(this.host.removeEventListener("keyup",this.handleKeyPress,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyPress,{capture:!0}),document.removeEventListener("mousedown",this.handleMouseClick))}isListSeparator(t){return"separator"in t&&!0===t.separator}render(){return[e("limel-text-editor",{key:"f2f48910b31ecf37bc6e41245f3e6e6a70b87695",ref:t=>this.textEditor=t,tabindex:this.disabled?-1:0,value:this.value,contentType:this.contentType,customElements:this.registeredCustomElements,"aria-disabled":this.disabled,language:this.language,triggers:this.registeredTriggers,onTriggerStart:this.handleTriggerStart,onTriggerStop:this.handleTriggerStop,onTriggerChange:this.handleTriggerChange,onImagePasted:this.handleImagePasted,onMetadataChange:this.handleMetadataChange,ui:this.ui,allowResize:this.allowResize,required:this.required,disabled:this.disabled,readonly:this.readonly,helperText:this.helperText,placeholder:this.placeholder,label:this.label,invalid:this.invalid}),this.renderPicker()]}renderPicker(){if(this.isPickerOpen)return e("limel-portal",{containerId:this.portalId,visible:this.isPickerOpen,openDirection:"top",inheritParentWidth:!0,anchor:this.textEditor},e("limebb-text-editor-picker",{ref:t=>this.textEditorPickerElement=t,items:(t=this.items,i=this.highlightedItemIndex,t.map(((t,e)=>{const r=Qt(t,5);return Object.assign(Object.assign({},r),{selected:e===i})}))),onItemSelected:this.handleItemSelection,emptyMessage:this.pickerMessage,isSearching:this.isSearching}));var t,i}getEnhancedImages(t){return t.map((t=>{let i;return"success"===t.state&&(i=this.uploadHandler.parseFileIdFromSrc(t.src)),i?Object.assign(Object.assign({},t),{fileId:i}):t}))}loadDraft(){if(!this.userDataService||!this.textEditorInnerId)return;if(this.value)return;const t=this.userDataService.get(this.textEditorInnerId);t&&this.change.emit(t)}saveDraft(){var t,i,e,r;if(!this.textEditorInnerId)return;const s=null===(t=this.value)||void 0===t?void 0:t.trim(),n=null===(i=this.userDataService)||void 0===i?void 0:i.get(this.textEditorInnerId);s&&s!==n?null===(e=this.userDataService)||void 0===e||e.set(this.textEditorInnerId,s):!s&&n&&(null===(r=this.userDataService)||void 0===r||r.set(this.textEditorInnerId,void 0))}get userDataService(){return this.platform.get(o.UserDataRepository)}get host(){return r(this)}static get watchers(){return{isPickerOpen:["watchOpen"],editorPickerQuery:["watchQuery"]}}};!function(t,i,e,r){var s,n=arguments.length,o=n<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,i,e,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(i,e,o):s(i,e))||o);n>3&&o&&Object.defineProperty(i,e,o)}([c({map:[function(t){return Object.values(t).filter((t=>Vt(t,"user")||Xt(t,"user")))}]})],ii.prototype,"searchableLimetypes",void 0);export{ii as limebb_text_editor}
@@ -1 +0,0 @@
1
- import{r as e,c as r,h as t}from"./p-1556b545.js";import{T as i}from"./p-1fba0ade.js";function o(e){if(!(null==e?void 0:e.properties))return{};const r=Object.assign({},e.properties),t={id:"_id",timestamp:"_timestamp",descriptive:"_descriptive",createduser:"_createduser",createdtime:"_createdtime",updateduser:"_updateduser"};for(const[e,i]of Object.entries(t)){const t=r[e];t&&(r[i]=t,delete r[e])}return r}const n=[{value:"=",label:"Equals",icon:"equals"},{value:"!=",label:"Not Equals",icon:"not-equal"},{value:">",label:"Greater Than",icon:"greater-than",applicableTypes:["integer","decimal","date","time"]},{value:">=",label:"Greater or Equal",icon:"greater-or-equal",applicableTypes:["integer","decimal","date","time"]},{value:"<",label:"Less Than",icon:"less-than",applicableTypes:["integer","decimal","date","time"]},{value:"<=",label:"Less or Equal",icon:"less-or-equal",applicableTypes:["integer","decimal","date","time"]},{value:"IN",label:"In List",icon:"list"},{value:"?",label:"Contains",icon:"-lime-filter-contain",applicableTypes:["string","text"]},{value:"=?",label:"Begins With",icon:"-lime-filter-begin",applicableTypes:["string","text"]},{value:"=$",label:"Ends With",icon:"-lime-filter-end",applicableTypes:["string","text"]}];function l(e){return e?"key"in e?function(e){if(!("op"in e)||!("exp"in e))throw new Error("Invalid filter: comparison must have key, op, and exp properties");if(!n.map((e=>e.value)).includes(e.op))throw new Error(`Unsupported filter operator: ${e.op}`);const r=new Set(["key","op","exp","type"]),t=Object.keys(e).filter((e=>!r.has(e)));if(t.length>0)throw new Error(`Unexpected properties in filter comparison: ${t.join(", ")}`);return{filter_type:"comparison",property:e.key,operator:e.op,value:e.exp}}(e):function(e){if(!("op"in e))throw new Error("Invalid filter: filter group must have op property");if(!("exp"in e))throw new Error("Invalid filter: filter group must have exp property");const r=new Set(["op","exp"]),t=Object.keys(e).filter((e=>!r.has(e)));if(t.length>0)throw new Error(`Unexpected properties in filter group: ${t.join(", ")}`);if("!"===e.op){if(Array.isArray(e.exp))throw new TypeError("Invalid NOT filter: exp should be a single expression, not an array");return{filter_type:"NOT",expression:l(e.exp)}}if("AND"===e.op){if(!Array.isArray(e.exp))throw new TypeError("Invalid AND filter: exp must be an array");return{filter_type:"AND",expressions:e.exp.map(l)}}if("OR"===e.op){if(!Array.isArray(e.exp))throw new TypeError("Invalid OR filter: exp must be an array");return{filter_type:"OR",expressions:e.exp.map(l)}}throw new Error(`Unsupported filter operator: ${e.op}`)}(e):{filter_type:"AND",expressions:[]}}const a=new Set(["$yesterday","$now","$today","$tomorrow","$this_week","$this_month","$this_quarter","$this_year"]),s=/^\$(previous|next)_(day|week|month|quarter|year)\(\d+\)$/,d=/^\$me(\.\w+)*$/;function c(e,r,t=!0){const i=Object.keys(e),o=[];if(t){const e=i.filter((e=>e.startsWith("#")&&"#description"!==e));e.length>0&&o.push(`Property '${r}' contains # properties not supported in GUI: ${e.join(", ")}`)}return{keys:i.filter((e=>"_alias"!==e&&!e.startsWith("#"))),guiLimitations:o}}function u(e,r,t,i,o,n=!0){if(""===e){if(n&&null!==r)throw new Error("Empty property name must have null value");return[]}const l=t[e];if(!l)throw new Error(`Property '${e}' does not exist on limetype '${o}'`);return l.relation?function(e,r,t,i,o=!0){if(null===r)return[];if("object"!=typeof r)throw new TypeError(`Relation property '${e}' must be null or an object`);const n=r,{keys:l,guiLimitations:a}=c(n,e,o);if(0===l.length)return a;const s=i.relation.getLimetype();if(!s)throw new Error(`Could not determine related limetype for property '${e}'`);const d={};for(const e of l)d[e]=n[e];const u=p(d,t,s.name,o);return[...a,...u]}(e,r,i,l,n):function(e,r,t=!0){if(null===r)return[];if("object"==typeof r){const{keys:i,guiLimitations:o}=c(r,e,t);if(0===i.length)return o;throw new Error(`Non-relation property '${e}' cannot have nested properties other than _alias or # properties (got: ${i.join(", ")})`)}throw new Error(`Non-relation property '${e}' must be null or an object (got ${typeof r})`)}(e,r,n)}function p(e,r,t,i=!0){const n=r[t];if(!n)throw new Error(`Unknown limetype: ${t}`);const l=o(n),a=[];for(const[o,n]of Object.entries(e)){if(o.startsWith("#"))continue;const e=u(o,n,l,r,t,i);a.push(...e)}return a}function f(e,r,t,i=!0){if(e)if("key"in e){const i=function(e,r,t){if(function(e){return"string"==typeof e&&(a.has(e)||s.test(e)||d.test(e))}(e))return{valid:!0};if("string"!=typeof e||!e.startsWith("%activeObject%"))return{valid:!0};if(!r)return{valid:!0};const i=e.replace(/^%activeObject%\.?/,"");if(!i)return{valid:!0};try{const e=function(e,r,t){if(!t||!r||!e)return;const i=t.split(".");let n,l=e[r];for(const e of i){if(!l)return;if(n=o(l)[e],!n)return;n.relation&&(l=n.relation.getLimetype())}return n}(t,r,i);return e?{valid:!0}:{valid:!1,error:`Property path '${i}' does not exist on limetype '${r}'`}}catch(e){return{valid:!1,error:`Invalid placeholder path: ${e.message}`}}}(e.exp,r,t);if(!i.valid)throw new Error(`Invalid placeholder in filter '${e.key}': ${i.error}`)}else if("exp"in e)if("!"===e.op)f(e.exp,r,t,i);else if("AND"===e.op||"OR"===e.op){const o=e.exp;for(const e of o)f(e,r,t,i)}}const m=class{constructor(t){e(this,t),this.change=r(this,"change",7),this.mode="gui",this.codeValue="",this.switchToGui=()=>{this.mode="gui"},this.switchToCode=()=>{this.mode="code"},this.handleCodeChange=e=>{e.stopPropagation(),this.codeValue=e.detail;try{const e=JSON.parse(this.codeValue);this.change.emit(e)}catch(e){}}}get guiModeEnabled(){var e,r,t;return null!==(t=null===(r=null===(e=this.platform)||void 0===e?void 0:e.isFeatureEnabled)||void 0===r?void 0:r.call(e,"useLimeQueryBuilderGuiMode"))&&void 0!==t&&t}componentWillLoad(){this.codeValue=JSON.stringify(this.value||{},null,2),this.guiModeEnabled||(this.mode="code")}render(){const e=this.checkGuiSupport();return t("div",{key:"48ec80b81ffb7765b9965219bfd343be84fb1dd1",class:"lime-query-builder"},this.label&&t("h3",{key:"91034a7b8354b5e40858ededbbf9bcac76682a40",class:"lime-query-builder-label"},this.label),this.guiModeEnabled&&t("div",{key:"167fd8fb8673ba540e9bb1eec3518f0742cf7325",class:"mode-controls"},this.renderModeSwitch(e)),this.guiModeEnabled&&"code"!==this.mode?t("div",{class:"gui-mode"},t("div",{class:"placeholder-message"},t("h4",null,"GUI Mode Not Yet Supported"),t("p",null,"The visual query builder interface is not yet available. Please use Code mode to write queries in JSON format."))):t("div",{class:"code-mode"},this.renderCodeEditor(e)))}checkGuiSupport(){if(!this.limetypes||!this.codeValue)return{valid:!0,guiSupported:!1,validationErrors:[],guiLimitations:[]};let e;try{e=JSON.parse(this.codeValue)}catch(e){return{valid:!1,guiSupported:!1,validationErrors:["Invalid JSON"],guiLimitations:[]}}return function(e,r,t,i=!0){if(!e)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};const o=[],n=[];if(e.limetype&&!r[e.limetype]&&o.push(`Unknown limetype: ${e.limetype}`),void 0===e.offset||e.orderBy||o.push("offset requires orderBy to be specified"),i&&(e.orderBy&&n.push("orderBy is not yet supported in GUI mode"),void 0!==e.offset&&n.push("offset is not yet supported in GUI mode")),e.filter){const n=function(e,r,t,i){const o=[];try{l(e),f(e,r,t,i)}catch(e){o.push(`Invalid filter: ${e.message}`)}return o}(e.filter,t,r,i);o.push(...n)}if(e.responseFormat){const{errors:t,limitations:l}=function(e,r,t,i){const o=[],n=[];try{const o=function(e,r,t,i=!0){const o=[];if(i&&e.aggregates&&o.push("responseFormat.aggregates is not yet supported in GUI mode"),e.object){const n=p(e.object,r,t,i);o.push(...n)}return o}(e,r,t,i);n.push(...o)}catch(e){o.push(`Invalid responseFormat: ${e.message}`)}return{errors:o,limitations:n}}(e.responseFormat,r,e.limetype,i);o.push(...t),n.push(...l)}return{valid:0===o.length,guiSupported:0===n.length,validationErrors:o,guiLimitations:n}}(e,this.limetypes,void 0,this.guiModeEnabled)}renderModeSwitch(e){return t("div",{class:"mode-switch"},t("limel-button",{label:"GUI",primary:"gui"===this.mode,disabled:!e.guiSupported,onClick:this.switchToGui}),t("limel-button",{label:"Code",primary:"code"===this.mode,onClick:this.switchToCode}))}renderCodeEditor(e){return t("div",{class:"code-editor-container"},t("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!e.valid&&e.validationErrors.length>0&&t("div",{class:"validation-errors"},t("strong",null,"Invalid Lime Query:"),t("ul",null,e.validationErrors.map((e=>t("li",null,e))))),this.guiModeEnabled&&e.valid&&!e.guiSupported&&e.guiLimitations.length>0&&t("div",{class:"gui-limitations"},t("strong",null,"Cannot switch to GUI mode:"),t("ul",null,e.guiLimitations.map((e=>t("li",null,e))))))}};(function(e,r,t,i){var o,n=arguments.length,l=n<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,r,t,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(n<3?o(l):n>3?o(r,t,l):o(r,t))||l);n>3&&l&&Object.defineProperty(r,t,l)})([i()],m.prototype,"limetypes",void 0),m.style=":host(limebb-lime-query-builder){display:block;width:100%}.lime-query-builder{display:flex;flex-direction:column;gap:2rem}.mode-controls{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;background-color:rgb(var(--contrast-100));border-radius:var(--border-radius)}.mode-switch{display:flex;align-items:center;gap:0.5rem}.mode-switch limel-button{min-width:5rem}.mode-switch limel-helper-text{margin-left:1rem;color:rgb(var(--color-red-default))}.gui-mode,.code-mode{display:block}.code-editor-container{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-editor-container .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .validation-errors ul{margin:0;padding-left:1.5rem}.code-editor-container .validation-errors li{margin:0.25rem 0}.code-editor-container .gui-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .gui-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .gui-limitations ul{margin:0;padding-left:1.5rem}.code-editor-container .gui-limitations li{margin:0.25rem 0}.lime-query-builder-label{margin:0;font-size:1.5rem;font-weight:600;color:rgb(var(--contrast-1100))}.placeholder-message{padding:2rem;text-align:center;background-color:rgb(var(--contrast-100));border-radius:var(--border-radius);border:1px solid rgb(var(--contrast-300))}.placeholder-message h4{margin:0 0 1rem 0;font-size:1.125rem;font-weight:600;color:rgb(var(--contrast-1100))}.placeholder-message p{margin:0;color:rgb(var(--contrast-900));line-height:1.5}";export{m as limebb_lime_query_builder}
@@ -1 +0,0 @@
1
- import{r,c as n,h as t}from"./p-1556b545.js";import{c as e}from"./p-1fba0ade.js";import{t as u,c as i,a as f,i as a,g as o,b as c,d as s}from"./p-8044ffbd.js";import{d as v,i as l,a as d,U as b,g as h,S as p,k as j}from"./p-bcc23575.js";import{d as m,i as y,S as g,a as _}from"./p-b31772c8.js";import{i as w,c as A,g as k,a as O,b as x,f as S,h as E}from"./p-5322fd19.js";import{e as D,M,i as R}from"./p-c40a3f4b.js";function U(r){return r}var B,q,C,I=Date.now,L=v?function(r,n){return v(r,"toString",{configurable:!0,enumerable:!1,value:(t=n,function(){return t}),writable:!0});var t}:U;const N=(B=L,q=0,C=0,function(){var r=I(),n=16-(r-C);if(C=r,n>0){if(++q>=800)return arguments[0]}else q=0;return B.apply(void 0,arguments)});var T=Math.max;function V(r,n,t){if(!m(t))return!1;var e=typeof n;return!!("number"==e?w(t)&&l(n,t.length):"string"==e&&n in t)&&D(t[n],r)}var W=g?g.isConcatSpreadable:void 0;function z(r){return y(r)||A(r)||!!(W&&r&&r[W])}function F(r,n,t,e,u){var i=-1,f=r.length;for(t||(t=z),u||(u=[]);++i<f;){var a=r[i];n>0&&t(a)?n>1?F(a,n-1,t,e,u):d(u,a):e||(u[u.length]=a)}return u}var G=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function H(r){return G.test(r)}var J="\\ud800-\\udfff",K="["+J+"]",P="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Q="\\ud83c[\\udffb-\\udfff]",X="[^"+J+"]",Y="(?:\\ud83c[\\udde6-\\uddff]){2}",Z="[\\ud800-\\udbff][\\udc00-\\udfff]",$="(?:"+P+"|"+Q+")?",rr="[\\ufe0e\\ufe0f]?",nr=rr+$+"(?:\\u200d(?:"+[X,Y,Z].join("|")+")"+rr+$+")*",tr="(?:"+[X+P+"?",P,Y,Z,K].join("|")+")",er=RegExp(Q+"(?="+Q+")|"+tr+nr,"g");const ur=function(r){var n,t,e,i,f=H(r=u(r))?function(r){return H(r)?function(r){return r.match(er)||[]}(r):function(r){return r.split("")}(r)}(r):void 0,a=f?f[0]:r.charAt(0),o=f?(n=f,t=1,i=n.length,e=void 0===e?i:e,!t&&e>=i?n:function(r,n,t){var e=-1,u=r.length;n<0&&(n=-n>u?0:u+n),(t=t>u?u:t)<0&&(t+=u),u=n>t?0:t-n>>>0,n>>>=0;for(var i=Array(u);++e<u;)i[e]=r[e+n];return i}(n,t,e)).join(""):r.slice(1);return a.toUpperCase()+o};function ir(r){var n=-1,t=null==r?0:r.length;for(this.__data__=new M;++n<t;)this.add(r[n])}function fr(r,n){for(var t=-1,e=null==r?0:r.length;++t<e;)if(n(r[t],t,r))return!0;return!1}ir.prototype.add=ir.prototype.push=function(r){return this.__data__.set(r,"__lodash_hash_undefined__"),this},ir.prototype.has=function(r){return this.__data__.has(r)};var ar=1,or=2;function cr(r,n,t,e,u,i){var f=t&ar,a=r.length,o=n.length;if(a!=o&&!(f&&o>a))return!1;var c=i.get(r),s=i.get(n);if(c&&s)return c==n&&s==r;var v=-1,l=!0,d=t&or?new ir:void 0;for(i.set(r,n),i.set(n,r);++v<a;){var b=r[v],h=n[v];if(e)var p=f?e(h,b,v,n,r,i):e(b,h,v,r,n,i);if(void 0!==p){if(p)continue;l=!1;break}if(d){if(!fr(n,(function(r,n){if(!d.has(n)&&(b===r||u(b,r,t,e,i)))return d.push(n)}))){l=!1;break}}else if(b!==h&&!u(b,h,t,e,i)){l=!1;break}}return i.delete(r),i.delete(n),l}function sr(r){var n=-1,t=Array(r.size);return r.forEach((function(r,e){t[++n]=[e,r]})),t}function vr(r){var n=-1,t=Array(r.size);return r.forEach((function(r){t[++n]=r})),t}var lr=1,dr=2,br="[object Boolean]",hr="[object Date]",pr="[object Error]",jr="[object Map]",mr="[object Number]",yr="[object RegExp]",gr="[object Set]",_r="[object String]",wr="[object Symbol]",Ar="[object ArrayBuffer]",kr="[object DataView]",Or=g?g.prototype:void 0,xr=Or?Or.valueOf:void 0,Sr=1,Er=Object.prototype.hasOwnProperty,Dr=1,Mr="[object Arguments]",Rr="[object Array]",Ur="[object Object]",Br=Object.prototype.hasOwnProperty;function qr(r,n,t,e,u){return r===n||(null==r||null==n||!_(r)&&!_(n)?r!=r&&n!=n:function(r,n,t,e,u,i){var f=y(r),a=y(n),o=f?Rr:k(r),c=a?Rr:k(n),s=(o=o==Mr?Ur:o)==Ur,v=(c=c==Mr?Ur:c)==Ur,l=o==c;if(l&&O(r)){if(!O(n))return!1;f=!0,s=!1}if(l&&!s)return i||(i=new p),f||x(r)?cr(r,n,t,e,u,i):function(r,n,t,e,u,i,f){switch(t){case kr:if(r.byteLength!=n.byteLength||r.byteOffset!=n.byteOffset)return!1;r=r.buffer,n=n.buffer;case Ar:return!(r.byteLength!=n.byteLength||!i(new b(r),new b(n)));case br:case hr:case mr:return D(+r,+n);case pr:return r.name==n.name&&r.message==n.message;case yr:case _r:return r==n+"";case jr:var a=sr;case gr:if(a||(a=vr),r.size!=n.size&&!(e&lr))return!1;var o=f.get(r);if(o)return o==n;e|=dr,f.set(r,n);var c=cr(a(r),a(n),e,u,i,f);return f.delete(r),c;case wr:if(xr)return xr.call(r)==xr.call(n)}return!1}(r,n,o,t,e,u,i);if(!(t&Dr)){var d=s&&Br.call(r,"__wrapped__"),j=v&&Br.call(n,"__wrapped__");if(d||j){var m=d?r.value():r,g=j?n.value():n;return i||(i=new p),u(m,g,t,e,i)}}return!!l&&(i||(i=new p),function(r,n,t,e,u,i){var f=t&Sr,a=h(r),o=a.length;if(o!=h(n).length&&!f)return!1;for(var c=o;c--;){var s=a[c];if(!(f?s in n:Er.call(n,s)))return!1}var v=i.get(r),l=i.get(n);if(v&&l)return v==n&&l==r;var d=!0;i.set(r,n),i.set(n,r);for(var b=f;++c<o;){var p=r[s=a[c]],j=n[s];if(e)var m=f?e(j,p,s,n,r,i):e(p,j,s,r,n,i);if(!(void 0===m?p===j||u(p,j,t,e,i):m)){d=!1;break}b||(b="constructor"==s)}if(d&&!b){var y=r.constructor,g=n.constructor;y==g||!("constructor"in r)||!("constructor"in n)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(d=!1)}return i.delete(r),i.delete(n),d}(r,n,t,e,u,i))}(r,n,t,e,qr,u))}var Cr=1,Ir=2;function Lr(r){return r==r&&!m(r)}function Nr(r,n){return function(t){return null!=t&&t[r]===n&&(void 0!==n||r in Object(t))}}function Tr(r,n){return null!=r&&n in Object(r)}var Vr=1,Wr=2;function zr(r){return"function"==typeof r?r:null==r?U:"object"==typeof r?y(r)?(u=r[1],a(e=r[0])&&Lr(u)?Nr(f(e),u):function(r){var n=o(r,e);return void 0===n&&n===u?function(r,n){return null!=r&&function(r,n,t){for(var e=-1,u=(n=i(n,r)).length,a=!1;++e<u;){var o=f(n[e]);if(!(a=null!=r&&t(r,o)))break;r=r[o]}return a||++e!=u?a:!!(u=null==r?0:r.length)&&S(u)&&l(o,u)&&(y(r)||A(r))}(r,n,Tr)}(r,e):qr(u,n,Vr|Wr)}):(t=function(r){for(var n=j(r),t=n.length;t--;){var e=n[t],u=r[e];n[t]=[e,u,Lr(u)]}return n}(n=r),1==t.length&&t[0][2]?Nr(t[0][0],t[0][1]):function(r){return r===n||function(r,n,t,e){var u=t.length,i=u;if(null==r)return!i;for(r=Object(r);u--;){var f=t[u];if(f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++u<i;){var a=(f=t[u])[0],o=r[a],c=f[1];if(f[2]){if(void 0===o&&!(a in r))return!1}else{var s,v=new p;if(!(void 0===s?qr(c,o,Cr|Ir,e,v):s))return!1}}return!0}(r,0,t)}):function(r){return a(r)?(n=f(r),function(r){return null==r?void 0:r[n]}):function(r){return function(n){return c(n,r)}}(r);var n}(r);var n,t,e,u}const Fr=function(r,n,t){for(var e=-1,u=Object(r),i=t(r),f=i.length;f--;){var a=i[++e];if(!1===n(u[a],a,u))break}return r};const Gr=function(r,n){if(null==r)return r;if(!w(r))return function(r,n){return r&&Fr(r,n,j)}(r,n);for(var t=r.length,e=-1,u=Object(r);++e<t&&!1!==n(u[e],e,u););return r};function Hr(r,n){if(r!==n){var t=void 0!==r,e=null===r,u=r==r,i=R(r),f=void 0!==n,a=null===n,o=n==n,c=R(n);if(!a&&!c&&!i&&r>n||i&&f&&o&&!a&&!c||e&&f&&o||!t&&o||!u)return 1;if(!e&&!i&&!c&&r<n||c&&t&&u&&!e&&!i||a&&t&&u||!f&&u||!o)return-1}return 0}function Jr(r,n,t){n=n.length?s(n,(function(r){return y(r)?function(n){return c(n,1===r.length?r[0]:r)}:r})):[U];var e=-1;n=s(n,E(zr));var u=function(r,n){var t=-1,e=w(r)?Array(r.length):[];return Gr(r,(function(r){e[++t]=n(r)})),e}(r,(function(r){return{criteria:s(n,(function(n){return n(r)})),index:++e,value:r}}));return function(r){var n=r.length;for(r.sort((function(r,n){return function(r,n,t){for(var e=-1,u=r.criteria,i=n.criteria,f=u.length,a=t.length;++e<f;){var o=Hr(u[e],i[e]);if(o)return e>=a?o:o*("desc"==t[e]?-1:1)}return r.index-n.index}(r,n,t)}));n--;)r[n]=r[n].value;return r}(u)}var Kr=function(r){return N(function(r,n,t){return n=T(void 0===n?r.length-1:n,0),function(){for(var e=arguments,u=-1,i=T(e.length-n,0),f=Array(i);++u<i;)f[u]=e[n+u];u=-1;for(var a=Array(n+1);++u<n;)a[u]=e[u];return a[n]=t(f),function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}(r,this,a)}}(r,void 0,U),r+"")}((function(r,n){if(null==r)return[];var t=n.length;return t>1&&V(r,n[0],n[1])?n=[]:t>2&&V(n[0],n[1],n[2])&&(n=[n[0]]),Jr(r,F(n,1),[])}));const Pr=Kr;function Qr(r,n){if(0===r.length||0===n.length)return"";r="en_us"===r?"en-US":r,n="en_us"===n?"en-US":n;const t=(new Intl.DisplayNames(n,{type:"language"}).of(r)||"").split(" ");return t[0]=ur(u(t[0]).toLowerCase()),t.join(" ")}const Xr=class{constructor(t){r(this,t),this.change=n(this,"change",7),this.context={limetype:null,id:null},this.handleChange=r=>{r.stopPropagation(),this.change.emit(this.multipleChoice?r.detail.map((r=>r.value)):r.detail.value)}}async componentWillLoad(){try{this.http=this.platform.get(e.Http),this.allLanguages=await async function(r){const n=await r.get("api/v1/admin/settings/languages"),t=[];return(null==n?void 0:n.active)&&t.push(...n.active),(null==n?void 0:n.inactive)&&t.push(...n.inactive),t}(this.http)}catch(r){console.error(r)}}getOptions(){return this.allLanguages.map((r=>({value:r,text:Qr(r,r)})))}render(){const r=this.getOptions();let n;if(Array.isArray(this.value)){const t=this.value;n=r.filter((r=>t.includes(r.value)))}else{const t=this.value;n=r.find((r=>r.value===t))}return t("limel-select",{key:"54389312bd8cae7d92626c67a45bd2455f2a956f",value:n,options:Pr(r,"text"),helperText:this.helperText,label:this.label,required:this.required,disabled:this.disabled,readonly:this.readonly,onChange:this.handleChange,multiple:this.multipleChoice})}};export{Xr as limebb_locale_picker}
@@ -1 +0,0 @@
1
- import{i as r,S as n}from"./p-b31772c8.js";import{i as t,M as u}from"./p-c40a3f4b.js";function o(r,n){for(var t=-1,u=null==r?0:r.length,o=Array(u);++t<u;)o[t]=n(r[t],t,r);return o}var i=1/0,f=n?n.prototype:void 0,e=f?f.toString:void 0;function a(n){if("string"==typeof n)return n;if(r(n))return o(n,a)+"";if(t(n))return e?e.call(n):"";var u=n+"";return"0"==u&&1/n==-i?"-0":u}var c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function v(n,u){if(r(n))return!1;var o=typeof n;return!("number"!=o&&"symbol"!=o&&"boolean"!=o&&null!=n&&!t(n))||s.test(n)||!c.test(n)||null!=u&&n in Object(u)}function l(r,n){if("function"!=typeof r||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");var t=function(){var u=arguments,o=n?n.apply(this,u):u[0],i=t.cache;if(i.has(o))return i.get(o);var f=r.apply(this,u);return t.cache=i.set(o,f)||i,f};return t.cache=new(l.Cache||u),t}l.Cache=u;var p,d,y,b=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,m=/\\(\\)?/g,g=(p=function(r){var n=[];return 46===r.charCodeAt(0)&&n.push(""),r.replace(b,(function(r,t,u,o){n.push(u?o.replace(m,"$1"):t||r)})),n},d=l(p,(function(r){return 500===y.size&&y.clear(),r})),y=d.cache,d);const w=g;function h(r){return null==r?"":a(r)}function j(n,t){return r(n)?n:v(n,t)?[n]:w(h(n))}var $=1/0;function x(r){if("string"==typeof r||t(r))return r;var n=r+"";return"0"==n&&1/r==-$?"-0":n}function E(r,n){for(var t=0,u=(n=j(n,r)).length;null!=r&&t<u;)r=r[x(n[t++])];return t&&t==u?r:void 0}function A(r,n,t){var u=null==r?void 0:E(r,n);return void 0===u?t:u}export{x as a,E as b,j as c,o as d,A as g,v as i,h as t}
@@ -1 +0,0 @@
1
- import{h as t,r as o,c as e}from"./p-1556b545.js";import{c as i}from"./p-1fba0ade.js";import{g as n}from"./p-8044ffbd.js";import"./p-b31772c8.js";import"./p-c40a3f4b.js";const r=(o,e)=>t(o.name,Object.assign({class:o.class},function(t){let o={};return t.props&&(o=Object.assign({},t.props)),Object.assign({context:t.context,platform:t.platform},o)}(o),{key:o.key}),e),s=class{constructor(t){o(this,t),this.change=e(this,"change",7),this.value={},this.type="component",this.configViewType="code",this.findConfigComponent=t=>{var o,e;return"component"===this.type?null===(o=this.registry.getAll().find((o=>o.name===t)))||void 0===o?void 0:o.configComponent:"command"===this.type?null===(e=this.commandbus.getAll().find((o=>o.id===t)))||void 0===e?void 0:e.configComponent:void 0},this.handleChangeMode=t=>{t.stopPropagation(),this.configViewType=t.detail.id},this.handleCodeEditorChange=t=>{t.stopPropagation();try{const o=JSON.parse(t.detail);this.change.emit(o)}catch(t){}}}componentWillLoad(){this.configComponent=this.getComponentName()}componentShouldUpdate(t,o,e){return"formInfo"!==e}watchFormInfo(){this.configComponent=this.getComponentName()}watchconfigComponent(t,o){t&&!o&&(this.configViewType="config"),t||(this.configViewType="code")}getComponentName(){var t,o,e;const i=[...null!==(o=null===(t=this.formInfo)||void 0===t?void 0:t.schemaPath.slice(0,-1))&&void 0!==o?o:[],this.getNameField()],r=n(null===(e=this.formInfo)||void 0===e?void 0:e.rootValue,i),s=this.findConfigComponent(r);if(s&&customElements.get(s.name))return s}render(){return[this.renderHeader(),this.renderContent()]}renderHeader(){let o=[];return this.configComponent&&(o=[{id:"config",title:"Config",selected:"config"===this.configViewType},{id:"code",title:"Code",selected:"code"===this.configViewType}]),t("limel-header",{icon:"edit_property",heading:this.label,subheading:this.helperText},t("limel-button-group",{slot:"actions",value:o,onChange:this.handleChangeMode}))}renderContent(){return"config"===this.configViewType?this.renderConfigComponent():this.renderCodeEditor()}renderCodeEditor(){return t("limel-code-editor",{value:JSON.stringify(this.value,null,"\t"),language:"json",readonly:this.readonly,lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeEditorChange})}renderConfigComponent(){var o,e;return t(r,{class:"config-component",platform:this.platform,context:this.context,name:null===(o=this.configComponent)||void 0===o?void 0:o.name,props:Object.assign(Object.assign({},null===(e=this.configComponent)||void 0===e?void 0:e.props),{value:this.value,required:this.required,readonly:this.readonly,disabled:this.disabled,label:this.label,helperText:this.helperText,formInfo:this.formInfo})})}getNameField(){return this.nameField?this.nameField:{component:"name",command:"id"}[this.type]}get registry(){return this.platform.get(i.WebComponentRegistry)}get commandbus(){return this.platform.get(i.CommandBus)}static get watchers(){return{formInfo:["watchFormInfo"],configComponent:["watchconfigComponent"]}}};s.style=":host(*){--header-background-color:rgb(var(--contrast-600));display:flex;flex-direction:column;border:1px dashed rgb(var(--contrast-700));overflow:clip;border-radius:0.75rem;background-color:rgb(var(--contrast-500))}*{box-sizing:border-box}.label{margin-top:1rem;margin-bottom:1rem}.config-component{display:grid;column-gap:1rem;row-gap:1rem;margin:1rem;grid-template-columns:repeat(3, minmax(0, 1fr))}";export{s as limebb_component_config}
@@ -1 +0,0 @@
1
- import{g as t,i as r,M as n,r as s}from"./p-b31772c8.js";import{L as a,M as i}from"./p-c40a3f4b.js";import{c as e,a as u,b as f,i as o,e as c}from"./p-5322fd19.js";const h=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch(t){}}();var v=9007199254740991,b=/^(?:0|[1-9]\d*)$/;function p(t,r){var n=typeof t;return!!(r=null==r?v:r)&&("number"==n||"symbol"!=n&&b.test(t))&&t>-1&&t%1==0&&t<r}var j=Object.prototype.hasOwnProperty;function l(t,n){var s=r(t),a=!s&&e(t),i=!s&&!a&&u(t),o=!s&&!a&&!i&&f(t),c=s||a||i||o,h=c?function(t,r){for(var n=-1,s=Array(t);++n<t;)s[n]=r(n);return s}(t.length,String):[],v=h.length;for(var b in t)!n&&!j.call(t,b)||c&&("length"==b||i&&("offset"==b||"parent"==b)||o&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||p(b,v))||h.push(b);return h}function m(t){return o(t)?l(t):c(t)}function y(t,r){for(var n=-1,s=r.length,a=t.length;++n<s;)t[a+n]=r[n];return t}function O(t){var r=this.__data__=new a(t);this.size=r.size}function g(){return[]}O.prototype.clear=function(){this.__data__=new a,this.size=0},O.prototype.delete=function(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n},O.prototype.get=function(t){return this.__data__.get(t)},O.prototype.has=function(t){return this.__data__.has(t)},O.prototype.set=function(t,r){var s=this.__data__;if(s instanceof a){var e=s.__data__;if(!n||e.length<199)return e.push([t,r]),this.size=++s.size,this;s=this.__data__=new i(e)}return s.set(t,r),this.size=s.size,this};var d=Object.prototype.propertyIsEnumerable,w=Object.getOwnPropertySymbols;const L=w?function(t){return null==t?[]:(t=Object(t),function(r){for(var n=-1,s=null==r?0:r.length,a=0,i=[];++n<s;){var e=r[n];d.call(t,e)&&(i[a++]=e)}return i}(w(t)))}:g;function M(t,n,s){var a=n(t);return r(t)?a:y(a,s(t))}function S(t){return M(t,m,L)}const k=s.Uint8Array;export{O as S,k as U,y as a,l as b,L as c,h as d,M as e,S as g,p as i,m as k,g as s}
@@ -1 +0,0 @@
1
- import{a as t,b as n,g as i,M as r}from"./p-b31772c8.js";function s(i){return"symbol"==typeof i||t(i)&&"[object Symbol]"==n(i)}function o(t,n){return t===n||t!=t&&n!=n}const u=i(Object,"create");var h=Object.prototype.hasOwnProperty,e=Object.prototype.hasOwnProperty;function a(t){var n=-1,i=null==t?0:t.length;for(this.clear();++n<i;){var r=t[n];this.set(r[0],r[1])}}function f(t,n){for(var i=t.length;i--;)if(o(t[i][0],n))return i;return-1}a.prototype.clear=function(){this.__data__=u?u(null):{},this.size=0},a.prototype.delete=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},a.prototype.get=function(t){var n=this.__data__;if(u){var i=n[t];return"__lodash_hash_undefined__"===i?void 0:i}return h.call(n,t)?n[t]:void 0},a.prototype.has=function(t){var n=this.__data__;return u?void 0!==n[t]:e.call(n,t)},a.prototype.set=function(t,n){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=u&&void 0===n?"__lodash_hash_undefined__":n,this};var c=Array.prototype.splice;function v(t){var n=-1,i=null==t?0:t.length;for(this.clear();++n<i;){var r=t[n];this.set(r[0],r[1])}}function l(t,n){var i,r,s=t.__data__;return("string"==(r=typeof(i=n))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==i:null===i)?s["string"==typeof n?"string":"hash"]:s.map}function _(t){var n=-1,i=null==t?0:t.length;for(this.clear();++n<i;){var r=t[n];this.set(r[0],r[1])}}v.prototype.clear=function(){this.__data__=[],this.size=0},v.prototype.delete=function(t){var n=this.__data__,i=f(n,t);return!(i<0||(i==n.length-1?n.pop():c.call(n,i,1),--this.size,0))},v.prototype.get=function(t){var n=this.__data__,i=f(n,t);return i<0?void 0:n[i][1]},v.prototype.has=function(t){return f(this.__data__,t)>-1},v.prototype.set=function(t,n){var i=this.__data__,r=f(i,t);return r<0?(++this.size,i.push([t,n])):i[r][1]=n,this},_.prototype.clear=function(){this.size=0,this.__data__={hash:new a,map:new(r||v),string:new a}},_.prototype.delete=function(t){var n=l(this,t).delete(t);return this.size-=n?1:0,n},_.prototype.get=function(t){return l(this,t).get(t)},_.prototype.has=function(t){return l(this,t).has(t)},_.prototype.set=function(t,n){var i=l(this,t),r=i.size;return i.set(t,n),this.size+=i.size==r?0:1,this};export{v as L,_ as M,o as e,s as i}