@retailcrm/embed-ui-v1-components 0.9.21 → 0.9.22-alpha.2

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 (96) hide show
  1. package/AGENTS.md +3 -3
  2. package/README.md +3 -4
  3. package/assets/sprites/actions/add-square-outlined.svg +8 -0
  4. package/assets/sprites/actions/drag.svg +8 -0
  5. package/bin/embed-ui-v1-components.mjs +227 -50
  6. package/bin/postinstall.mjs +2 -1
  7. package/dist/host.cjs +1204 -488
  8. package/dist/host.css +629 -0
  9. package/dist/host.d.ts +100 -20
  10. package/dist/host.js +1205 -489
  11. package/dist/remote.cjs +1210 -153
  12. package/dist/remote.d.ts +786 -36
  13. package/dist/remote.js +1212 -155
  14. package/docs/AI.md +19 -20
  15. package/docs/COMPONENTS.md +58 -59
  16. package/docs/FORMAT.md +6 -8
  17. package/docs/PROFILES.md +34 -21
  18. package/docs/README.md +3 -6
  19. package/docs/profiles/{UiAddButton.yml → components/UiAddButton.yml} +49 -2
  20. package/docs/profiles/{UiAlert.yml → components/UiAlert.yml} +32 -2
  21. package/docs/profiles/{UiAvatar.yml → components/UiAvatar.yml} +17 -3
  22. package/docs/profiles/{UiAvatarList.yml → components/UiAvatarList.yml} +0 -2
  23. package/docs/profiles/{UiButton.yml → components/UiButton.yml} +14 -1
  24. package/docs/profiles/components/UiCalendar.yml +190 -0
  25. package/docs/profiles/{UiCheckbox.yml → components/UiCheckbox.yml} +28 -2
  26. package/docs/profiles/{UiCollapse.yml → components/UiCollapse.yml} +57 -2
  27. package/docs/profiles/{UiCollapseBox.yml → components/UiCollapseBox.yml} +64 -2
  28. package/docs/profiles/{UiCollapseGroup.yml → components/UiCollapseGroup.yml} +0 -2
  29. package/docs/profiles/{UiCopyButton.yml → components/UiCopyButton.yml} +19 -2
  30. package/docs/profiles/{UiDate.yml → components/UiDate.yml} +20 -2
  31. package/docs/profiles/{UiDatePicker.yml → components/UiDatePicker.yml} +51 -2
  32. package/docs/profiles/{UiError.yml → components/UiError.yml} +48 -2
  33. package/docs/profiles/{UiField.yml → components/UiField.yml} +46 -1
  34. package/docs/profiles/{UiInfobox.yml → components/UiInfobox.yml} +54 -2
  35. package/docs/profiles/{UiLink.yml → components/UiLink.yml} +22 -2
  36. package/docs/profiles/{UiLoader.yml → components/UiLoader.yml} +0 -2
  37. package/docs/profiles/{UiMenuItem.yml → components/UiMenuItem.yml} +0 -2
  38. package/docs/profiles/{UiMenuItemGroup.yml → components/UiMenuItemGroup.yml} +0 -2
  39. package/docs/profiles/{UiModalSidebar.yml → components/UiModalSidebar.yml} +80 -2
  40. package/docs/profiles/components/UiModalWindow.yml +181 -0
  41. package/docs/profiles/{UiModalWindowSurface.yml → components/UiModalWindowSurface.yml} +0 -2
  42. package/docs/profiles/{UiNumberStepper.yml → components/UiNumberStepper.yml} +14 -2
  43. package/docs/profiles/{UiPageHeader.yml → components/UiPageHeader.yml} +39 -1
  44. package/docs/profiles/components/UiPopconfirm.yml +164 -0
  45. package/docs/profiles/{UiPopper.yml → components/UiPopper.yml} +66 -1
  46. package/docs/profiles/{UiPopperConnector.yml → components/UiPopperConnector.yml} +0 -2
  47. package/docs/profiles/{UiPopperTarget.yml → components/UiPopperTarget.yml} +0 -2
  48. package/docs/profiles/{UiRadio.yml → components/UiRadio.yml} +15 -2
  49. package/docs/profiles/{UiRadioSwitch.yml → components/UiRadioSwitch.yml} +55 -1
  50. package/docs/profiles/{UiRadioSwitchOption.yml → components/UiRadioSwitchOption.yml} +0 -2
  51. package/docs/profiles/{UiScrollBox.yml → components/UiScrollBox.yml} +45 -2
  52. package/docs/profiles/{UiSelect.yml → components/UiSelect.yml} +133 -1
  53. package/docs/profiles/{UiSelectOption.yml → components/UiSelectOption.yml} +0 -2
  54. package/docs/profiles/{UiSelectOptionGroup.yml → components/UiSelectOptionGroup.yml} +0 -2
  55. package/docs/profiles/{UiSkeleton.yml → components/UiSkeleton.yml} +11 -2
  56. package/docs/profiles/{UiSlider.yml → components/UiSlider.yml} +85 -2
  57. package/docs/profiles/{UiSwitch.yml → components/UiSwitch.yml} +50 -2
  58. package/docs/profiles/{UiTab.yml → components/UiTab.yml} +126 -2
  59. package/docs/profiles/{UiTabGroup.yml → components/UiTabGroup.yml} +0 -1
  60. package/docs/profiles/components/UiTable.yml +622 -0
  61. package/docs/profiles/{UiTableBodyCell.yml → components/UiTableBodyCell.yml} +0 -2
  62. package/docs/profiles/{UiTableColumn.yml → components/UiTableColumn.yml} +0 -2
  63. package/docs/profiles/{UiTableFooterButton.yml → components/UiTableFooterButton.yml} +0 -2
  64. package/docs/profiles/{UiTableFooterSection.yml → components/UiTableFooterSection.yml} +0 -2
  65. package/docs/profiles/{UiTableHeadCell.yml → components/UiTableHeadCell.yml} +0 -2
  66. package/docs/profiles/{UiTableSorter.yml → components/UiTableSorter.yml} +0 -2
  67. package/docs/profiles/{UiTag.yml → components/UiTag.yml} +13 -2
  68. package/docs/profiles/{UiTextbox.yml → components/UiTextbox.yml} +20 -1
  69. package/docs/profiles/{UiTimePicker.yml → components/UiTimePicker.yml} +60 -2
  70. package/docs/profiles/{UiToggleButton.yml → components/UiToggleButton.yml} +16 -1
  71. package/docs/profiles/{UiToggleGroup.yml → components/UiToggleGroup.yml} +25 -1
  72. package/docs/profiles/{UiToggleGroupOption.yml → components/UiToggleGroupOption.yml} +0 -2
  73. package/docs/profiles/{UiToolbarButton.yml → components/UiToolbarButton.yml} +15 -2
  74. package/docs/profiles/{UiToolbarLink.yml → components/UiToolbarLink.yml} +13 -2
  75. package/docs/profiles/{UiTooltip.yml → components/UiTooltip.yml} +18 -2
  76. package/docs/profiles/{UiTransition.yml → components/UiTransition.yml} +0 -2
  77. package/docs/profiles/{UiYandexMap.yml → components/UiYandexMap.yml} +24 -2
  78. package/docs/profiles/pages/CardSettingsPage.yml +58 -0
  79. package/docs/profiles/pages/CollapseBlockPage.yml +46 -0
  80. package/docs/profiles/pages/EntityListPage.yml +66 -0
  81. package/docs/profiles/pages/ModalSidebar.yml +158 -0
  82. package/docs/profiles/pages/ModalWindow.yml +55 -0
  83. package/docs/profiles/pages/MultiColumnPage.yml +27 -0
  84. package/docs/profiles/pages/PageComposition.yml +56 -0
  85. package/package.json +1 -1
  86. package/docs/AGENT-DESIGN-GUIDELINES.md +0 -463
  87. package/docs/assets/page-guidelines/card-settings-page.png +0 -0
  88. package/docs/assets/page-guidelines/collapse-block-page.png +0 -0
  89. package/docs/assets/page-guidelines/entity-list-page.png +0 -0
  90. package/docs/assets/page-guidelines/modal-sidebar.png +0 -0
  91. package/docs/assets/page-guidelines/modal-window.png +0 -0
  92. package/docs/assets/page-guidelines/multi-column-page.png +0 -0
  93. package/docs/profiles/UiCalendar.yml +0 -76
  94. package/docs/profiles/UiImage.yml +0 -67
  95. package/docs/profiles/UiModalWindow.yml +0 -86
  96. package/docs/profiles/UiTable.yml +0 -300
package/dist/remote.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineRemoteComponent, defineRemoteMethod, withKeys, withModifiers, nextTick, createRemoteRoot } from "@omnicajs/vue-remote/remote";
2
- import { openBlock, createElementBlock, createElementVNode, defineComponent, mergeProps, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, unref, withCtx, useTemplateRef, ref, computed, watch, createBlock, inject, onBeforeMount, onBeforeUnmount, Fragment, provide, renderList, createSlots, isVNode, Comment, Text, getCurrentInstance, h, reactive, onMounted } from "vue";
1
+ import { defineRemoteComponent, defineRemoteMethod, RemoteSortableContainer, RemoteSortableItem, RemoteDragHandle, withKeys, withModifiers, nextTick, createRemoteRoot } from "@omnicajs/vue-remote/remote";
2
+ import { openBlock, createElementBlock, createElementVNode, defineComponent, mergeProps, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, unref, withCtx, computed, inject, shallowRef, ref, watch, createBlock, Fragment, renderList, normalizeClass, useTemplateRef, createSlots, onBeforeMount, onBeforeUnmount, provide, isVNode, Comment, Text, getCurrentInstance, h, reactive, onMounted } from "vue";
3
3
  import isEqual from "lodash.isequal";
4
4
  import { preview } from "@retailcrm/image-preview";
5
5
  import { ru, es, enGB } from "date-fns/locale";
@@ -122,13 +122,13 @@ const UiError = defineRemoteComponent(
122
122
  UiErrorType,
123
123
  ["click", "focus", "blur"]
124
124
  );
125
- const _hoisted_1$7 = {
125
+ const _hoisted_1$9 = {
126
126
  xmlns: "http://www.w3.org/2000/svg",
127
127
  fill: "currentColor",
128
128
  viewBox: "0 0 24 24"
129
129
  };
130
- function render$2(_ctx, _cache) {
131
- return openBlock(), createElementBlock("svg", _hoisted_1$7, [..._cache[0] || (_cache[0] = [
130
+ function render$3(_ctx, _cache) {
131
+ return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._cache[0] || (_cache[0] = [
132
132
  createElementVNode("path", {
133
133
  "fill-rule": "evenodd",
134
134
  d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10A10 10 0 0 0 12 2m1 15.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5zm.88-5.21a2.89 2.89 0 0 0 2-2.73V9A2.88 2.88 0 0 0 13 6.12h-2A2.88 2.88 0 0 0 8.12 9v.5a.5.5 0 0 0 .5.5h.76a.5.5 0 0 0 .5-.5V9c0-.619.501-1.12 1.12-1.12h2A1.12 1.12 0 0 1 14.16 9v.56a1.13 1.13 0 0 1-.76 1.07l-.95.31a1.88 1.88 0 0 0-1.29 1.78v.78a.5.5 0 0 0 .5.5h.76a.5.5 0 0 0 .5-.5v-.78c0-.053.032-.1.08-.12z",
@@ -136,18 +136,28 @@ function render$2(_ctx, _cache) {
136
136
  }, null, -1)
137
137
  ])]);
138
138
  }
139
- const IconHelp = { render: render$2 };
139
+ const IconHelp = { render: render$3 };
140
140
  const UiPopperType = "UiPopper";
141
- const UiPopper = defineRemoteComponent(UiPopperType);
141
+ const UiPopper = defineRemoteComponent(UiPopperType, {
142
+ emits: [
143
+ "attached",
144
+ "dispose",
145
+ "hide",
146
+ "hidden",
147
+ "show",
148
+ "shown",
149
+ "update:visible"
150
+ ]
151
+ });
142
152
  const UiPopperConnectorType = "UiPopperConnector";
143
153
  const UiPopperConnector = defineRemoteComponent(UiPopperConnectorType);
144
154
  const UiPopperTargetType = "UiPopperTarget";
145
155
  const UiPopperTarget = defineRemoteComponent(UiPopperTargetType);
146
156
  const UiTooltipType = "UiTooltip";
147
157
  const UiTooltip = defineRemoteComponent(UiTooltipType);
148
- const _hoisted_1$6 = { class: "ui-v1-field__headline" };
149
- const _hoisted_2$3 = ["id", "for"];
150
- const _hoisted_3$3 = {
158
+ const _hoisted_1$8 = { class: "ui-v1-field__headline" };
159
+ const _hoisted_2$4 = ["id", "for"];
160
+ const _hoisted_3$4 = {
151
161
  key: 0,
152
162
  class: "ui-v1-field__required-mark",
153
163
  "aria-hidden": "true"
@@ -161,7 +171,7 @@ const _hoisted_5$1 = {
161
171
  class: "ui-v1-field__addon"
162
172
  };
163
173
  const _hoisted_6 = { class: "ui-v1-field__control" };
164
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
174
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
165
175
  ...{
166
176
  inheritAttrs: false
167
177
  },
@@ -219,7 +229,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
219
229
  "ui-v1-field_readonly": __props.readonly
220
230
  }
221
231
  }, _ctx.$attrs), [
222
- createElementVNode("div", _hoisted_1$6, [
232
+ createElementVNode("div", _hoisted_1$8, [
223
233
  __props.label || _ctx.$slots.label ? (openBlock(), createElementBlock("label", {
224
234
  key: 0,
225
235
  id: `${__props.id}-label`,
@@ -229,8 +239,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
229
239
  renderSlot(_ctx.$slots, "label", {}, () => [
230
240
  createTextVNode(toDisplayString(__props.label), 1)
231
241
  ]),
232
- __props.required ? (openBlock(), createElementBlock("span", _hoisted_3$3, " * ")) : createCommentVNode("", true)
233
- ], 8, _hoisted_2$3)) : createCommentVNode("", true),
242
+ __props.required ? (openBlock(), createElementBlock("span", _hoisted_3$4, " * ")) : createCommentVNode("", true)
243
+ ], 8, _hoisted_2$4)) : createCommentVNode("", true),
234
244
  __props.hint || _ctx.$slots.hint ? (openBlock(), createElementBlock("span", _hoisted_4$2, [
235
245
  createVNode(unref(UiPopperConnector), null, {
236
246
  default: withCtx(() => [
@@ -315,6 +325,954 @@ const UiLoader = defineRemoteComponent(
315
325
  UiLoaderType,
316
326
  ["click", "focus", "blur"]
317
327
  );
328
+ var LogicTreeNodeKind = /* @__PURE__ */ ((LogicTreeNodeKind2) => {
329
+ LogicTreeNodeKind2["BRANCH"] = "branch";
330
+ LogicTreeNodeKind2["CONDITION"] = "condition";
331
+ LogicTreeNodeKind2["GROUP"] = "group";
332
+ return LogicTreeNodeKind2;
333
+ })(LogicTreeNodeKind || {});
334
+ var LogicTreeChildrenView = /* @__PURE__ */ ((LogicTreeChildrenView2) => {
335
+ LogicTreeChildrenView2["GROUPED"] = "grouped";
336
+ LogicTreeChildrenView2["PLAIN"] = "plain";
337
+ return LogicTreeChildrenView2;
338
+ })(LogicTreeChildrenView || {});
339
+ var LogicTreeConjunction = /* @__PURE__ */ ((LogicTreeConjunction2) => {
340
+ LogicTreeConjunction2["AND"] = "and";
341
+ LogicTreeConjunction2["OR"] = "or";
342
+ return LogicTreeConjunction2;
343
+ })(LogicTreeConjunction || {});
344
+ var LogicTreeNodeView = /* @__PURE__ */ ((LogicTreeNodeView2) => {
345
+ LogicTreeNodeView2["ACTIONS"] = "actions";
346
+ LogicTreeNodeView2["SUMMARY"] = "summary";
347
+ return LogicTreeNodeView2;
348
+ })(LogicTreeNodeView || {});
349
+ var LogicTreeTone = /* @__PURE__ */ ((LogicTreeTone2) => {
350
+ LogicTreeTone2["BLUE"] = "blue";
351
+ LogicTreeTone2["GREEN"] = "green";
352
+ LogicTreeTone2["GREY"] = "grey";
353
+ LogicTreeTone2["RED"] = "red";
354
+ LogicTreeTone2["YELLOW"] = "yellow";
355
+ return LogicTreeTone2;
356
+ })(LogicTreeTone || {});
357
+ const pluralization_en_GB = (choice) => choice === 1 ? 0 : 1;
358
+ const pluralization_es_ES = (choice) => choice === 1 ? 0 : 1;
359
+ const pluralization_ru_RU = (choice, choicesLength) => {
360
+ if (choicesLength === 2) {
361
+ return choice === 1 ? 0 : 1;
362
+ }
363
+ const mod100 = choice % 100;
364
+ return mod100 % 10 === 1 && mod100 !== 11 ? 0 : mod100 % 10 >= 2 && mod100 % 10 <= 4 && !(mod100 >= 10 && mod100 < 15) ? 1 : 2;
365
+ };
366
+ const get = (messages, path) => {
367
+ let i = 0;
368
+ let slice = messages[path[0]];
369
+ while (i < path.length) {
370
+ if (typeof slice === "string" && i + 1 === path.length) {
371
+ return slice;
372
+ }
373
+ if (typeof slice !== "object") {
374
+ return void 0;
375
+ }
376
+ slice = slice[path[++i]];
377
+ }
378
+ return slice;
379
+ };
380
+ const replace = (message, values) => {
381
+ return Object.keys(values).reduce((message2, key) => {
382
+ const pattern = new RegExp(`\\{${key}\\}`, "g");
383
+ const replacement = String(values[key]);
384
+ return message2.replace(pattern, replacement);
385
+ }, message);
386
+ };
387
+ const compile = (messages, path, values = void 0) => {
388
+ const message = get(messages, path);
389
+ if (typeof message === "string" && values) {
390
+ return replace(message, values);
391
+ }
392
+ return message;
393
+ };
394
+ const fail = (message) => {
395
+ throw new Error(message);
396
+ };
397
+ const t = (locale, messages, path, values = void 0) => {
398
+ const keys = path.split(".");
399
+ if (locale) {
400
+ const message = compile(messages[locale] ?? {}, keys, values);
401
+ return typeof message !== "object" ? message : fail(`Translation for "${locale}:${path}" is not translatable`);
402
+ }
403
+ return void 0;
404
+ };
405
+ const plural = (template, choice, rule) => {
406
+ const forms = template.split("|");
407
+ return forms[rule(choice, forms.length)];
408
+ };
409
+ class I18n {
410
+ parent;
411
+ messages;
412
+ computed;
413
+ pluralization;
414
+ fallback;
415
+ constructor(options = void 0, parent = void 0) {
416
+ this.parent = parent;
417
+ this.messages = options?.messages ?? {};
418
+ this.computed = options?.computed ?? {};
419
+ this.pluralization = {
420
+ "en-GB": pluralization_en_GB,
421
+ "es-ES": pluralization_es_ES,
422
+ "ru-RU": pluralization_ru_RU,
423
+ ...options?.pluralization ?? {}
424
+ };
425
+ this.fallback = options?.fallback;
426
+ }
427
+ t(locale, path, values = void 0) {
428
+ try {
429
+ const _t = (locale2) => t(locale2, this.messages, path, values);
430
+ return _t(locale) ?? _t(this.fallback) ?? fail(`Translation for "${path}" does not exists`);
431
+ } catch (e) {
432
+ if (this.parent) {
433
+ return this.parent.t(locale, path, values);
434
+ }
435
+ throw e;
436
+ }
437
+ }
438
+ tc(locale, path, choice, values = void 0) {
439
+ return plural(
440
+ this.t(
441
+ locale,
442
+ path,
443
+ values
444
+ ),
445
+ choice,
446
+ this.pluralization[locale]
447
+ );
448
+ }
449
+ compute(locale, key, values) {
450
+ const computed2 = this.computed[key];
451
+ if (computed2) {
452
+ return computed2(localize(this, locale), values);
453
+ }
454
+ if (this.parent) {
455
+ return this.parent.compute(locale, key, values);
456
+ }
457
+ return fail("Key " + key + " is not registered");
458
+ }
459
+ extend(options) {
460
+ return new I18n({
461
+ pluralization: this.pluralization,
462
+ fallback: this.fallback,
463
+ ...options
464
+ }, this);
465
+ }
466
+ }
467
+ const localize = (i18n, locale) => ({
468
+ t(path, values = void 0) {
469
+ return i18n.t(locale, path, values);
470
+ },
471
+ tc(path, choice, values = void 0) {
472
+ return i18n.tc(locale, path, choice, values);
473
+ },
474
+ compute(key, values) {
475
+ return i18n.compute(locale, key, values);
476
+ }
477
+ });
478
+ const fallback = "en-GB";
479
+ const define = (options = void 0, parent = void 0) => {
480
+ const i18n = new I18n({
481
+ ...options,
482
+ fallback
483
+ }, parent);
484
+ const extend = (i18n2, options2 = void 0) => options2 ? i18n2.extend(options2) : i18n2;
485
+ return {
486
+ i18n,
487
+ init: (locale, options2 = void 0) => localize(
488
+ extend(i18n, options2),
489
+ locale
490
+ ),
491
+ fallback
492
+ };
493
+ };
494
+ const relationAnd$2 = "AND";
495
+ const relationOr$2 = "OR";
496
+ const messages_en_GB$1 = {
497
+ "delete": "Delete",
498
+ relationAnd: relationAnd$2,
499
+ relationOr: relationOr$2
500
+ };
501
+ const relationAnd$1 = "Y";
502
+ const relationOr$1 = "O";
503
+ const messages_es_ES$1 = {
504
+ "delete": "Eliminar",
505
+ relationAnd: relationAnd$1,
506
+ relationOr: relationOr$1
507
+ };
508
+ const relationAnd = "И";
509
+ const relationOr = "ИЛИ";
510
+ const messages_ru_RU$1 = {
511
+ "delete": "Удалить",
512
+ relationAnd,
513
+ relationOr
514
+ };
515
+ const _i18n = define({
516
+ messages: {
517
+ "en-GB": messages_en_GB$1,
518
+ "es-ES": messages_es_ES$1,
519
+ "ru-RU": messages_ru_RU$1
520
+ }
521
+ });
522
+ const I18nInjectKey = /* @__PURE__ */ Symbol("$embedI18n");
523
+ const UiLogicTreeRootType = "UiLogicTreeRoot";
524
+ const UiLogicTreeRoot = defineRemoteComponent(UiLogicTreeRootType, {
525
+ emits: [
526
+ "outsideClick"
527
+ ],
528
+ slots: ["default"]
529
+ });
530
+ const UiLogicTreeNodeType = "UiLogicTreeNode";
531
+ const UiLogicTreeNode = defineRemoteComponent(UiLogicTreeNodeType, {
532
+ emits: [
533
+ "nodeClick",
534
+ "nodeEdit"
535
+ ],
536
+ slots: ["conjunction-poppers", "prefix", "content", "trailing"]
537
+ });
538
+ const UiLogicTreeCaretType = "UiLogicTreeCaret";
539
+ const UiLogicTreeCaret = defineRemoteComponent(UiLogicTreeCaretType);
540
+ const UiLogicTreeNodeItemType = "UiLogicTreeNodeItem";
541
+ const UiLogicTreeNodeItem = defineRemoteComponent(UiLogicTreeNodeItemType, {
542
+ slots: ["default", "headline", "title", "trailing"]
543
+ });
544
+ const UiLogicTreeNodeIconType = "UiLogicTreeNodeIcon";
545
+ const UiLogicTreeNodeIcon = defineRemoteComponent(UiLogicTreeNodeIconType, {
546
+ slots: ["default"]
547
+ });
548
+ const _hoisted_1$7 = { class: "ui-v1-logic-tree__slot-content" };
549
+ const _hoisted_2$3 = { class: "ui-v1-logic-tree__slot-content" };
550
+ const _hoisted_3$3 = { class: "ui-v1-logic-tree__slot-content" };
551
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
552
+ __name: "UiLogicTree",
553
+ props: {
554
+ items: { default: () => [] }
555
+ },
556
+ emits: ["action", "control-action", "control:update", "drop", "remove", "node:add", "node:edit", "node:remove", "toggle", "update:items"],
557
+ setup(__props, { emit: __emit }) {
558
+ const props = __props;
559
+ const emit = __emit;
560
+ const i18n = computed(() => _i18n.init(inject(I18nInjectKey, null)?.locale ?? _i18n.fallback));
561
+ const resolveConjunctionLabel = (conjunction) => {
562
+ if (conjunction === LogicTreeConjunction.AND) {
563
+ return i18n.value.t("relationAnd");
564
+ }
565
+ if (conjunction === LogicTreeConjunction.OR) {
566
+ return i18n.value.t("relationOr");
567
+ }
568
+ return String(conjunction ?? "");
569
+ };
570
+ const itemsState = shallowRef([]);
571
+ const activePathKey = ref("");
572
+ const fallbackTone = (node) => node.tone ?? (node.kind === LogicTreeNodeKind.GROUP ? LogicTreeTone.GREEN : LogicTreeTone.BLUE);
573
+ const resolveConjunctionTone = (conjunction, fallback2) => {
574
+ if (conjunction === LogicTreeConjunction.OR) {
575
+ return LogicTreeTone.YELLOW;
576
+ }
577
+ if (conjunction === LogicTreeConjunction.AND) {
578
+ return LogicTreeTone.BLUE;
579
+ }
580
+ return fallback2;
581
+ };
582
+ const resolveNodeConjunction = (node, index, isGroupedSectionNode, parentNode) => {
583
+ if (isGroupedSectionNode || !isConjunctionContentNode(node)) {
584
+ return "";
585
+ }
586
+ if (index === 0) {
587
+ return parentNode && isConjunctionContentNode(parentNode) && countConjunctionContentChildren(parentNode) >= 2 ? node.conjunction ?? "" : "";
588
+ }
589
+ return node.conjunction ?? "";
590
+ };
591
+ const resolveConjunctionOffset = (conjunction) => {
592
+ if (!conjunction) {
593
+ return void 0;
594
+ }
595
+ return -8;
596
+ };
597
+ const resolveSubtreeEndPathKey = (source, nodeIndex) => {
598
+ const nodeEntry = source[nodeIndex];
599
+ const nodePathKey = pathToKey(nodeEntry.path);
600
+ const subtreePrefix = `${nodePathKey}.`;
601
+ let endIndex = nodeIndex;
602
+ for (let index = nodeIndex + 1; index < source.length; index += 1) {
603
+ const candidatePathKey = pathToKey(source[index].path);
604
+ if (candidatePathKey.startsWith(subtreePrefix)) {
605
+ endIndex = index;
606
+ continue;
607
+ }
608
+ break;
609
+ }
610
+ return pathToKey(source[endIndex].path);
611
+ };
612
+ const resolveConjunctionRangeEndPathKey = (source, nodeIndex) => {
613
+ const nodeEntry = source[nodeIndex];
614
+ const siblingIndex = nodeEntry.path.at(-1);
615
+ if (siblingIndex === void 0) {
616
+ return void 0;
617
+ }
618
+ let lastSiblingNodeIndex = nodeIndex;
619
+ source.forEach((candidate, candidateIndex) => {
620
+ const candidateSiblingIndex = candidate.path.at(-1);
621
+ if (candidate.path.length === nodeEntry.path.length && candidateSiblingIndex !== void 0 && candidateSiblingIndex >= siblingIndex && candidate.parentPath.length === nodeEntry.parentPath.length && candidate.parentPath.every((segment, index) => segment === nodeEntry.parentPath[index])) {
622
+ lastSiblingNodeIndex = candidateIndex;
623
+ }
624
+ });
625
+ return resolveSubtreeEndPathKey(source, lastSiblingNodeIndex);
626
+ };
627
+ const applyConjunctionToneToConnectors = (connectors, conjunction, conjunctionTone) => {
628
+ if (!conjunction || connectors.length === 0) {
629
+ return connectors;
630
+ }
631
+ return connectors.map((connector, connectorIndex, source) => connectorIndex === source.length - 1 ? {
632
+ ...connector,
633
+ tone: conjunctionTone
634
+ } : connector);
635
+ };
636
+ const setConnectorToneAtIndex = (nodeEntry, connectorIndex, tone) => {
637
+ if (!nodeEntry.connectors[connectorIndex]) {
638
+ return nodeEntry;
639
+ }
640
+ return {
641
+ ...nodeEntry,
642
+ connectors: nodeEntry.connectors.map((connector, index) => index === connectorIndex ? {
643
+ ...connector,
644
+ tone
645
+ } : connector)
646
+ };
647
+ };
648
+ const applyConjunctionBranchTones = (source) => {
649
+ const nodes = source.map((nodeEntry) => ({
650
+ ...nodeEntry,
651
+ connectors: nodeEntry.connectors.map((connector) => ({ ...connector }))
652
+ }));
653
+ const startsWithPath = (path, prefix) => prefix.length <= path.length && prefix.every((segment, index) => path[index] === segment);
654
+ const recolorBranchLevel = (parentPath, connectorIndex, tone) => {
655
+ nodes.forEach((candidate, index) => {
656
+ if (!startsWithPath(candidate.path, parentPath)) {
657
+ return;
658
+ }
659
+ if (!candidate.connectors[connectorIndex]) {
660
+ return;
661
+ }
662
+ nodes[index] = setConnectorToneAtIndex(candidate, connectorIndex, tone);
663
+ });
664
+ };
665
+ nodes.forEach((nodeEntry) => {
666
+ if (!nodeEntry.conjunction) {
667
+ return;
668
+ }
669
+ const connectorIndex = Math.max(0, nodeEntry.connectors.length - 1);
670
+ recolorBranchLevel(nodeEntry.parentPath, connectorIndex, nodeEntry.conjunctionTone);
671
+ });
672
+ return nodes;
673
+ };
674
+ const applyConjunctionRanges = (source) => source.map((nodeEntry, nodeIndex) => {
675
+ if (!nodeEntry.conjunction) {
676
+ return nodeEntry;
677
+ }
678
+ const siblingIndex = nodeEntry.path.at(-1);
679
+ const parentPathKey = nodeEntry.parentPath.length > 0 ? pathToKey(nodeEntry.parentPath) : void 0;
680
+ const parentEntry = parentPathKey ? source.find((candidate) => pathToKey(candidate.path) === parentPathKey) : void 0;
681
+ if (siblingIndex === void 0) {
682
+ return nodeEntry;
683
+ }
684
+ if (siblingIndex === 0) {
685
+ return {
686
+ ...nodeEntry,
687
+ conjunctionEndPathKey: resolveConjunctionRangeEndPathKey(source, nodeIndex),
688
+ conjunctionStartPathKey: parentEntry ? pathToKey(parentEntry.path) : void 0
689
+ };
690
+ }
691
+ return {
692
+ ...nodeEntry,
693
+ conjunctionEndPathKey: resolveConjunctionRangeEndPathKey(source, nodeIndex),
694
+ conjunctionStartPathKey: pathToKey([...nodeEntry.parentPath, siblingIndex - 1])
695
+ };
696
+ });
697
+ const pathToKey = (path) => path.join(".");
698
+ const cloneNodes = (nodes) => nodes.map((node) => ({
699
+ ...node,
700
+ children: node.children ? cloneNodes(node.children) : void 0,
701
+ data: { ...node.data }
702
+ }));
703
+ const resolveConfiguredNodeView = (node) => node.data.view;
704
+ const isConjunctionContentNode = (node) => resolveConfiguredNodeView(node) !== LogicTreeNodeView.ACTIONS && node.kind !== LogicTreeNodeKind.BRANCH;
705
+ const countConjunctionContentChildren = (node) => node?.children?.filter((child) => isConjunctionContentNode(child)).length ?? 0;
706
+ const resolveNodeView = (nodeEntry) => {
707
+ const configuredNodeView = resolveConfiguredNodeView(nodeEntry.node);
708
+ if (configuredNodeView === LogicTreeNodeView.ACTIONS) {
709
+ return configuredNodeView;
710
+ }
711
+ return configuredNodeView;
712
+ };
713
+ const canToggleNode = (nodeEntry) => Boolean(nodeEntry.node.collapsible) && nodeEntry.hasChildren;
714
+ const canSetNodeEditable = (nodeEntry) => resolveConfiguredNodeView(nodeEntry.node) !== LogicTreeNodeView.ACTIONS && !canToggleNode(nodeEntry);
715
+ const isNodeEditing = (nodeEntry) => canSetNodeEditable(nodeEntry) && Boolean(nodeEntry.node.data.editable);
716
+ const setNodeEditable = (nodeEntry, value) => {
717
+ if (!canSetNodeEditable(nodeEntry)) {
718
+ return;
719
+ }
720
+ withItemsMutation((nextItems) => {
721
+ setEditableState(nextItems, value ? nodeEntry.path : null);
722
+ });
723
+ };
724
+ watch(() => props.items, (items) => {
725
+ itemsState.value = cloneNodes(items ?? []);
726
+ }, { deep: true, immediate: true });
727
+ const withItemsMutation = (mutator) => {
728
+ const nextItems = cloneNodes(itemsState.value);
729
+ mutator(nextItems);
730
+ itemsState.value = nextItems;
731
+ emit("update:items", cloneNodes(itemsState.value));
732
+ };
733
+ const getBranchAtPath = (nodes, parentPath, create = false) => {
734
+ let branch = nodes;
735
+ for (const index of parentPath) {
736
+ const node = branch[index];
737
+ if (!node) {
738
+ return null;
739
+ }
740
+ if (!node.children) {
741
+ if (!create) {
742
+ return null;
743
+ }
744
+ node.children = [];
745
+ }
746
+ branch = node.children;
747
+ }
748
+ return branch;
749
+ };
750
+ const getNodeAtPath = (nodes, path) => {
751
+ const branch = getBranchAtPath(nodes, path.slice(0, -1));
752
+ const index = path.at(-1);
753
+ if (index === void 0) {
754
+ return null;
755
+ }
756
+ return branch?.[index] ?? null;
757
+ };
758
+ const setEditableState = (nodes, editablePath = null) => {
759
+ const editablePathKey = editablePath ? pathToKey(editablePath) : "";
760
+ const walk = (branch, parentPath = []) => {
761
+ branch.forEach((node, index) => {
762
+ const path = [...parentPath, index];
763
+ node.data.editable = editablePathKey !== "" && pathToKey(path) === editablePathKey;
764
+ if (node.children?.length) {
765
+ walk(node.children, path);
766
+ }
767
+ });
768
+ };
769
+ walk(nodes);
770
+ };
771
+ const resolveParentMeta = (nodes, path) => {
772
+ const parentPath = path.slice(0, -1);
773
+ const parentNode = parentPath.length > 0 ? getNodeAtPath(nodes, parentPath) : null;
774
+ return {
775
+ parentNode,
776
+ parentPath,
777
+ parentPathKey: parentPath.length > 0 ? pathToKey(parentPath) : null
778
+ };
779
+ };
780
+ const flatten = (nodes, ancestors = [], parentPath = [], parentTone = null, currentSectionKey = "", parentNode = null) => nodes.flatMap((node, index, siblings) => {
781
+ const isLast = index === siblings.length - 1;
782
+ const path = [...parentPath, index];
783
+ const expanded = node.expanded !== false;
784
+ const hasChildren = Boolean(node.children?.length);
785
+ const shouldPreserveChildLevel = node.kind === LogicTreeNodeKind.BRANCH && ancestors.length === 0;
786
+ const descendsIntoChildren = hasChildren && expanded;
787
+ const isGroupedSectionNode = Boolean(currentSectionKey);
788
+ const conjunction = resolveNodeConjunction(node, index, isGroupedSectionNode, parentNode);
789
+ const connectorTone = parentTone ?? fallbackTone(node);
790
+ const conjunctionTone = resolveConjunctionTone(conjunction, connectorTone);
791
+ const connectorContinues = !isLast || descendsIntoChildren;
792
+ const connectors = applyConjunctionToneToConnectors([
793
+ ...ancestors,
794
+ ...parentTone ? [{
795
+ continues: connectorContinues,
796
+ tone: connectorTone,
797
+ visible: true
798
+ }] : []
799
+ ].map((connector, connectorIndex, source) => ({
800
+ ...connector,
801
+ placeholder: isGroupedSectionNode && connectorIndex === source.length - 1
802
+ })), conjunction, conjunctionTone);
803
+ const conjunctionOffset = resolveConjunctionOffset(conjunction);
804
+ const flattenedNodes2 = [{
805
+ conjunction,
806
+ conjunctionEndPathKey: void 0,
807
+ conjunctionOffset,
808
+ conjunctionStartPathKey: void 0,
809
+ connectors,
810
+ expanded,
811
+ groupedPosition: "",
812
+ hasChildren,
813
+ node,
814
+ parentPath,
815
+ path,
816
+ conjunctionTone,
817
+ sectionKey: currentSectionKey
818
+ }];
819
+ if (hasChildren && expanded) {
820
+ const childAncestors = shouldPreserveChildLevel ? ancestors : [
821
+ ...ancestors,
822
+ ...parentTone ? [{
823
+ continues: connectorContinues,
824
+ tone: connectorTone,
825
+ visible: true
826
+ }] : []
827
+ ];
828
+ const childParentTone = shouldPreserveChildLevel ? parentTone ?? fallbackTone(node) : fallbackTone(node);
829
+ const nextSectionKey = node.childrenView === LogicTreeChildrenView.GROUPED ? pathToKey(path) : "";
830
+ flattenedNodes2.push(...flatten(
831
+ node.children ?? [],
832
+ childAncestors,
833
+ path,
834
+ childParentTone,
835
+ nextSectionKey,
836
+ node
837
+ ));
838
+ }
839
+ return flattenedNodes2;
840
+ });
841
+ const flattenedNodes = computed(() => applyConjunctionRanges(applyConjunctionBranchTones(flatten(itemsState.value))));
842
+ const nodesWithGrouping = computed(() => flattenedNodes.value.map((nodeEntry, index, source) => {
843
+ if (!nodeEntry.sectionKey) {
844
+ return nodeEntry;
845
+ }
846
+ const prev = source[index - 1];
847
+ const next = source[index + 1];
848
+ const hasPrev = prev?.sectionKey === nodeEntry.sectionKey;
849
+ const hasNext = next?.sectionKey === nodeEntry.sectionKey;
850
+ const parentNode = nodeEntry.parentPath.length > 0 ? getNodeAtPath(itemsState.value, nodeEntry.parentPath) : null;
851
+ const hasGroupedHeader = parentNode?.childrenView === LogicTreeChildrenView.GROUPED;
852
+ let groupedPosition = "single";
853
+ if (!hasPrev && hasNext) {
854
+ groupedPosition = "start";
855
+ } else if (hasPrev && hasNext) {
856
+ groupedPosition = "middle";
857
+ } else if (hasPrev && !hasNext) {
858
+ groupedPosition = "end";
859
+ } else if (!hasPrev && !hasNext && hasGroupedHeader) {
860
+ groupedPosition = "end";
861
+ }
862
+ return {
863
+ ...nodeEntry,
864
+ groupedPosition
865
+ };
866
+ }));
867
+ const renderEntries = computed(() => {
868
+ const nextEntries = [];
869
+ for (let index = 0; index < nodesWithGrouping.value.length; index += 1) {
870
+ const nodeEntry = nodesWithGrouping.value[index];
871
+ if (!nodeEntry.sectionKey) {
872
+ nextEntries.push({
873
+ id: `node:${pathToKey(nodeEntry.path)}`,
874
+ kind: "node",
875
+ item: nodeEntry
876
+ });
877
+ continue;
878
+ }
879
+ const sectionNodes = [nodeEntry];
880
+ let cursor = index + 1;
881
+ while (nodesWithGrouping.value[cursor]?.sectionKey === nodeEntry.sectionKey) {
882
+ sectionNodes.push(nodesWithGrouping.value[cursor]);
883
+ cursor += 1;
884
+ }
885
+ nextEntries.push({
886
+ containerId: nodeEntry.sectionKey,
887
+ footerNodes: sectionNodes.filter((sectionNode) => resolveConfiguredNodeView(sectionNode.node) === LogicTreeNodeView.ACTIONS),
888
+ id: `group:${nodeEntry.sectionKey}`,
889
+ itemNodes: sectionNodes.filter((sectionNode) => resolveConfiguredNodeView(sectionNode.node) !== LogicTreeNodeView.ACTIONS),
890
+ kind: "grouped"
891
+ });
892
+ index = cursor - 1;
893
+ }
894
+ return nextEntries;
895
+ });
896
+ const isNodeDraggable = (node) => Boolean(node.data.draggable) && !node.data.disabled && resolveConfiguredNodeView(node) !== LogicTreeNodeView.ACTIONS;
897
+ const isGroupedDraggableNode = (nodeEntry) => Boolean(nodeEntry.sectionKey) && isNodeDraggable(nodeEntry.node);
898
+ const isNodeSelected = (nodeEntry) => Boolean(nodeEntry.node.data.selected) || activePathKey.value === pathToKey(nodeEntry.path) || isNodeEditing(nodeEntry);
899
+ const resolveNodeSlotProps = (nodeEntry) => ({
900
+ editing: isNodeEditing(nodeEntry),
901
+ expanded: nodeEntry.expanded,
902
+ grouped: Boolean(nodeEntry.sectionKey),
903
+ groupedHeader: nodeEntry.node.childrenView === LogicTreeChildrenView.GROUPED,
904
+ groupedPosition: nodeEntry.groupedPosition || void 0,
905
+ hasChildren: nodeEntry.hasChildren,
906
+ highlighted: Boolean(nodeEntry.node.data.highlighted),
907
+ disabled: Boolean(nodeEntry.node.data.disabled),
908
+ node: nodeEntry.node,
909
+ onAction: (actionId, kind) => {
910
+ onAction(nodeEntry, actionId, kind);
911
+ },
912
+ onControlAction: (controlId) => {
913
+ emit("control-action", {
914
+ controlId,
915
+ nodeId: nodeEntry.node.id
916
+ });
917
+ },
918
+ onControlUpdate: (controlId, value) => {
919
+ onControlUpdate(nodeEntry.path, controlId, value);
920
+ },
921
+ onRemove: () => {
922
+ onRemove(nodeEntry.path, nodeEntry.node.id);
923
+ },
924
+ onToggle: () => {
925
+ onToggle(nodeEntry);
926
+ },
927
+ path: [...nodeEntry.path],
928
+ pathKey: pathToKey(nodeEntry.path),
929
+ nodeView: resolveNodeView(nodeEntry),
930
+ selected: isNodeSelected(nodeEntry)
931
+ });
932
+ const onControlUpdate = (path, controlId, value) => {
933
+ const currentNode = getNodeAtPath(itemsState.value, path);
934
+ if (currentNode) {
935
+ emit("node:edit", {
936
+ controlId,
937
+ nodeId: currentNode.id,
938
+ pathKey: pathToKey(path),
939
+ value
940
+ });
941
+ }
942
+ emit("control:update", {
943
+ controlId,
944
+ nodeId: currentNode?.id ?? "",
945
+ value
946
+ });
947
+ };
948
+ const onToggle = (nodeEntry) => {
949
+ const nextExpanded = !nodeEntry.expanded;
950
+ withItemsMutation((nextItems) => {
951
+ const nextNode = getNodeAtPath(nextItems, nodeEntry.path);
952
+ if (nextNode) {
953
+ nextNode.expanded = nextExpanded;
954
+ }
955
+ });
956
+ emit("toggle", {
957
+ expanded: nextExpanded,
958
+ nodeId: nodeEntry.node.id
959
+ });
960
+ };
961
+ const onRemove = (path, nodeId) => {
962
+ const pathKey = pathToKey(path);
963
+ const index = path.at(-1);
964
+ const { parentNode, parentPathKey } = resolveParentMeta(itemsState.value, path);
965
+ if (activePathKey.value === pathKey) {
966
+ activePathKey.value = "";
967
+ }
968
+ if (index !== void 0) {
969
+ emit("node:remove", {
970
+ index,
971
+ nodeId,
972
+ parentNodeId: parentNode?.id ?? null,
973
+ parentPathKey,
974
+ pathKey
975
+ });
976
+ }
977
+ emit("remove", nodeId);
978
+ };
979
+ const onAction = (nodeEntry, actionId, kind) => {
980
+ if (resolveNodeView(nodeEntry) !== LogicTreeNodeView.ACTIONS) {
981
+ return;
982
+ }
983
+ const { parentNode, parentPathKey } = resolveParentMeta(itemsState.value, nodeEntry.path);
984
+ emit("node:add", {
985
+ actionId,
986
+ kind,
987
+ parentNodeId: parentNode?.id ?? null,
988
+ parentPathKey,
989
+ triggerNodeId: nodeEntry.node.id
990
+ });
991
+ emit("action", {
992
+ actionId,
993
+ nodeId: nodeEntry.node.id
994
+ });
995
+ };
996
+ const onNodeClick = (nodeEntry) => {
997
+ if (resolveNodeView(nodeEntry) === LogicTreeNodeView.ACTIONS) {
998
+ return;
999
+ }
1000
+ if (canToggleNode(nodeEntry)) {
1001
+ onToggle(nodeEntry);
1002
+ activePathKey.value = pathToKey(nodeEntry.path);
1003
+ return;
1004
+ }
1005
+ if (!canSetNodeEditable(nodeEntry)) {
1006
+ withItemsMutation((nextItems) => {
1007
+ setEditableState(nextItems, null);
1008
+ });
1009
+ }
1010
+ activePathKey.value = pathToKey(nodeEntry.path);
1011
+ };
1012
+ const onOutsideClick = () => {
1013
+ activePathKey.value = "";
1014
+ withItemsMutation((nextItems) => {
1015
+ setEditableState(nextItems, null);
1016
+ });
1017
+ };
1018
+ const resolveGroupedDropPayload = (event) => {
1019
+ if (!event.accepted || !event.targetContainerId || event.sourceContainerId !== event.targetContainerId || event.placement !== "before" && event.placement !== "after") {
1020
+ return null;
1021
+ }
1022
+ return {
1023
+ itemId: event.itemId,
1024
+ payload: event.payload,
1025
+ placement: event.placement,
1026
+ sourceContainerId: event.sourceContainerId,
1027
+ targetContainerId: event.targetContainerId,
1028
+ targetIndex: event.targetIndex,
1029
+ targetItemId: event.targetItemId
1030
+ };
1031
+ };
1032
+ const onGroupedDrop = (event) => {
1033
+ const payload = resolveGroupedDropPayload(event);
1034
+ if (!payload) {
1035
+ return;
1036
+ }
1037
+ const parentPath = payload.sourceContainerId.split(".").filter(Boolean).map((segment) => Number(segment));
1038
+ withItemsMutation((nextItems) => {
1039
+ const branchNode = getNodeAtPath(nextItems, parentPath);
1040
+ const children = branchNode?.children;
1041
+ if (!children?.length) {
1042
+ return;
1043
+ }
1044
+ const sortableChildren = children.filter((child) => resolveConfiguredNodeView(child) !== LogicTreeNodeView.ACTIONS);
1045
+ const footerChildren = children.filter((child) => resolveConfiguredNodeView(child) === LogicTreeNodeView.ACTIONS);
1046
+ const movedNodeIndex = sortableChildren.findIndex((child) => child.id === payload.itemId);
1047
+ if (movedNodeIndex === -1) {
1048
+ return;
1049
+ }
1050
+ const [movedNode] = sortableChildren.splice(movedNodeIndex, 1);
1051
+ if (!movedNode) {
1052
+ return;
1053
+ }
1054
+ const targetIndex = Math.min(
1055
+ Math.max(payload.targetIndex ?? sortableChildren.length, 0),
1056
+ sortableChildren.length
1057
+ );
1058
+ sortableChildren.splice(targetIndex, 0, movedNode);
1059
+ branchNode.children = [...sortableChildren, ...footerChildren];
1060
+ });
1061
+ emit("drop", payload);
1062
+ };
1063
+ return (_ctx, _cache) => {
1064
+ return openBlock(), createBlock(unref(UiLogicTreeRoot), { onOutsideClick }, {
1065
+ default: withCtx(() => [
1066
+ (openBlock(true), createElementBlock(Fragment, null, renderList(renderEntries.value, (entry) => {
1067
+ return openBlock(), createElementBlock(Fragment, {
1068
+ key: entry.id
1069
+ }, [
1070
+ entry.kind === "grouped" ? (openBlock(), createBlock(unref(RemoteSortableContainer), {
1071
+ key: 0,
1072
+ as: "div",
1073
+ class: "ui-v1-logic-tree__grouped-sortable",
1074
+ "container-id": entry.containerId,
1075
+ accepts: [entry.containerId],
1076
+ "on-drop": onGroupedDrop
1077
+ }, {
1078
+ default: withCtx(() => [
1079
+ (openBlock(true), createElementBlock(Fragment, null, renderList(entry.itemNodes, (nodeEntry, index) => {
1080
+ return openBlock(), createBlock(unref(RemoteSortableItem), {
1081
+ key: nodeEntry.node.id,
1082
+ as: "div",
1083
+ class: "ui-v1-logic-tree__grouped-sortable-item",
1084
+ "item-id": nodeEntry.node.id,
1085
+ "container-id": entry.containerId,
1086
+ type: entry.containerId,
1087
+ index,
1088
+ payload: { nodeId: nodeEntry.node.id, pathKey: pathToKey(nodeEntry.path) },
1089
+ disabled: !isGroupedDraggableNode(nodeEntry)
1090
+ }, {
1091
+ default: withCtx(() => [
1092
+ createVNode(unref(UiLogicTreeNode), {
1093
+ "path-key": pathToKey(nodeEntry.path),
1094
+ "node-view": resolveNodeView(nodeEntry),
1095
+ connectors: nodeEntry.connectors,
1096
+ conjunction: nodeEntry.conjunction,
1097
+ "conjunction-end-path-key": nodeEntry.conjunctionEndPathKey,
1098
+ "conjunction-label": resolveConjunctionLabel(nodeEntry.conjunction),
1099
+ "conjunction-offset": nodeEntry.conjunctionOffset,
1100
+ "conjunction-start-path-key": nodeEntry.conjunctionStartPathKey,
1101
+ "conjunction-tone": nodeEntry.conjunctionTone,
1102
+ grouped: Boolean(nodeEntry.sectionKey),
1103
+ "grouped-header": nodeEntry.node.childrenView === unref(LogicTreeChildrenView).GROUPED,
1104
+ "grouped-position": nodeEntry.groupedPosition || void 0,
1105
+ editable: nodeEntry.node.data.editable,
1106
+ selected: isNodeSelected(nodeEntry),
1107
+ highlighted: Boolean(nodeEntry.node.data.highlighted),
1108
+ disabled: Boolean(nodeEntry.node.data.disabled),
1109
+ onNodeClick: ($event) => onNodeClick(nodeEntry),
1110
+ onNodeEdit: ($event) => setNodeEditable(nodeEntry, $event)
1111
+ }, {
1112
+ "conjunction-poppers": withCtx(() => [
1113
+ renderSlot(_ctx.$slots, "conjunction-poppers", mergeProps({ ref_for: true }, resolveNodeSlotProps(nodeEntry)))
1114
+ ]),
1115
+ prefix: withCtx(() => [
1116
+ renderSlot(_ctx.$slots, "node-prefix", mergeProps({ ref_for: true }, resolveNodeSlotProps(nodeEntry)))
1117
+ ]),
1118
+ content: withCtx(() => [
1119
+ createElementVNode("div", _hoisted_1$7, [
1120
+ renderSlot(_ctx.$slots, "node", mergeProps({ ref_for: true }, resolveNodeSlotProps(nodeEntry)), () => [
1121
+ _cache[0] || (_cache[0] = createElementVNode("div", {
1122
+ class: "ui-v1-logic-tree__slot-placeholder",
1123
+ "data-ui-logic-tree-slot": "node"
1124
+ }, null, -1))
1125
+ ])
1126
+ ])
1127
+ ]),
1128
+ trailing: withCtx(() => [
1129
+ renderSlot(_ctx.$slots, "node-trailing", mergeProps({ ref_for: true }, resolveNodeSlotProps(nodeEntry)))
1130
+ ]),
1131
+ _: 2
1132
+ }, 1032, ["path-key", "node-view", "connectors", "conjunction", "conjunction-end-path-key", "conjunction-label", "conjunction-offset", "conjunction-start-path-key", "conjunction-tone", "grouped", "grouped-header", "grouped-position", "editable", "selected", "highlighted", "disabled", "onNodeClick", "onNodeEdit"])
1133
+ ]),
1134
+ _: 2
1135
+ }, 1032, ["item-id", "container-id", "type", "index", "payload", "disabled"]);
1136
+ }), 128)),
1137
+ (openBlock(true), createElementBlock(Fragment, null, renderList(entry.footerNodes, (nodeEntry) => {
1138
+ return openBlock(), createBlock(unref(UiLogicTreeNode), {
1139
+ key: nodeEntry.node.id,
1140
+ "path-key": pathToKey(nodeEntry.path),
1141
+ "node-view": resolveNodeView(nodeEntry),
1142
+ connectors: nodeEntry.connectors,
1143
+ conjunction: nodeEntry.conjunction,
1144
+ "conjunction-end-path-key": nodeEntry.conjunctionEndPathKey,
1145
+ "conjunction-label": resolveConjunctionLabel(nodeEntry.conjunction),
1146
+ "conjunction-offset": nodeEntry.conjunctionOffset,
1147
+ "conjunction-start-path-key": nodeEntry.conjunctionStartPathKey,
1148
+ "conjunction-tone": nodeEntry.conjunctionTone,
1149
+ grouped: Boolean(nodeEntry.sectionKey),
1150
+ "grouped-header": nodeEntry.node.childrenView === unref(LogicTreeChildrenView).GROUPED,
1151
+ "grouped-position": nodeEntry.groupedPosition || void 0,
1152
+ editable: nodeEntry.node.data.editable,
1153
+ selected: isNodeSelected(nodeEntry),
1154
+ highlighted: Boolean(nodeEntry.node.data.highlighted),
1155
+ disabled: Boolean(nodeEntry.node.data.disabled),
1156
+ onNodeClick: ($event) => onNodeClick(nodeEntry),
1157
+ onNodeEdit: ($event) => setNodeEditable(nodeEntry, $event)
1158
+ }, {
1159
+ "conjunction-poppers": withCtx(() => [
1160
+ renderSlot(_ctx.$slots, "conjunction-poppers", mergeProps({ ref_for: true }, resolveNodeSlotProps(nodeEntry)))
1161
+ ]),
1162
+ prefix: withCtx(() => [
1163
+ renderSlot(_ctx.$slots, "node-prefix", mergeProps({ ref_for: true }, resolveNodeSlotProps(nodeEntry)))
1164
+ ]),
1165
+ content: withCtx(() => [
1166
+ createElementVNode("div", _hoisted_2$3, [
1167
+ renderSlot(_ctx.$slots, "node", mergeProps({ ref_for: true }, resolveNodeSlotProps(nodeEntry)), () => [
1168
+ _cache[1] || (_cache[1] = createElementVNode("div", {
1169
+ class: "ui-v1-logic-tree__slot-placeholder",
1170
+ "data-ui-logic-tree-slot": "node"
1171
+ }, null, -1))
1172
+ ])
1173
+ ])
1174
+ ]),
1175
+ trailing: withCtx(() => [
1176
+ renderSlot(_ctx.$slots, "node-trailing", mergeProps({ ref_for: true }, resolveNodeSlotProps(nodeEntry)))
1177
+ ]),
1178
+ _: 2
1179
+ }, 1032, ["path-key", "node-view", "connectors", "conjunction", "conjunction-end-path-key", "conjunction-label", "conjunction-offset", "conjunction-start-path-key", "conjunction-tone", "grouped", "grouped-header", "grouped-position", "editable", "selected", "highlighted", "disabled", "onNodeClick", "onNodeEdit"]);
1180
+ }), 128))
1181
+ ]),
1182
+ _: 2
1183
+ }, 1032, ["container-id", "accepts"])) : (openBlock(), createBlock(unref(UiLogicTreeNode), {
1184
+ key: 1,
1185
+ "path-key": pathToKey(entry.item.path),
1186
+ "node-view": resolveNodeView(entry.item),
1187
+ connectors: entry.item.connectors,
1188
+ conjunction: entry.item.conjunction,
1189
+ "conjunction-end-path-key": entry.item.conjunctionEndPathKey,
1190
+ "conjunction-label": resolveConjunctionLabel(entry.item.conjunction),
1191
+ "conjunction-offset": entry.item.conjunctionOffset,
1192
+ "conjunction-start-path-key": entry.item.conjunctionStartPathKey,
1193
+ "conjunction-tone": entry.item.conjunctionTone,
1194
+ grouped: Boolean(entry.item.sectionKey),
1195
+ "grouped-header": entry.item.node.childrenView === unref(LogicTreeChildrenView).GROUPED,
1196
+ "grouped-position": entry.item.groupedPosition || void 0,
1197
+ editable: entry.item.node.data.editable,
1198
+ selected: isNodeSelected(entry.item),
1199
+ highlighted: Boolean(entry.item.node.data.highlighted),
1200
+ disabled: Boolean(entry.item.node.data.disabled),
1201
+ onNodeClick: ($event) => onNodeClick(entry.item),
1202
+ onNodeEdit: ($event) => setNodeEditable(entry.item, $event)
1203
+ }, {
1204
+ "conjunction-poppers": withCtx(() => [
1205
+ renderSlot(_ctx.$slots, "conjunction-poppers", mergeProps({ ref_for: true }, resolveNodeSlotProps(entry.item)))
1206
+ ]),
1207
+ prefix: withCtx(() => [
1208
+ renderSlot(_ctx.$slots, "node-prefix", mergeProps({ ref_for: true }, resolveNodeSlotProps(entry.item)))
1209
+ ]),
1210
+ content: withCtx(() => [
1211
+ createElementVNode("div", _hoisted_3$3, [
1212
+ renderSlot(_ctx.$slots, "node", mergeProps({ ref_for: true }, resolveNodeSlotProps(entry.item)), () => [
1213
+ _cache[2] || (_cache[2] = createElementVNode("div", {
1214
+ class: "ui-v1-logic-tree__slot-placeholder",
1215
+ "data-ui-logic-tree-slot": "node"
1216
+ }, null, -1))
1217
+ ])
1218
+ ])
1219
+ ]),
1220
+ trailing: withCtx(() => [
1221
+ renderSlot(_ctx.$slots, "node-trailing", mergeProps({ ref_for: true }, resolveNodeSlotProps(entry.item)))
1222
+ ]),
1223
+ _: 2
1224
+ }, 1032, ["path-key", "node-view", "connectors", "conjunction", "conjunction-end-path-key", "conjunction-label", "conjunction-offset", "conjunction-start-path-key", "conjunction-tone", "grouped", "grouped-header", "grouped-position", "editable", "selected", "highlighted", "disabled", "onNodeClick", "onNodeEdit"]))
1225
+ ], 64);
1226
+ }), 128))
1227
+ ]),
1228
+ _: 3
1229
+ });
1230
+ };
1231
+ }
1232
+ });
1233
+ const _hoisted_1$6 = {
1234
+ xmlns: "http://www.w3.org/2000/svg",
1235
+ viewBox: "0 0 20 20"
1236
+ };
1237
+ function render$2(_ctx, _cache) {
1238
+ return openBlock(), createElementBlock("svg", _hoisted_1$6, [..._cache[0] || (_cache[0] = [
1239
+ createElementVNode("path", {
1240
+ fill: "currentColor",
1241
+ "fill-rule": "evenodd",
1242
+ d: "M7.499 6.667a1.667 1.667 0 1 0 0-3.333 1.667 1.667 0 0 0 0 3.333M5.832 10a1.667 1.667 0 1 1 3.333 0 1.667 1.667 0 0 1-3.333 0m1.667 3.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.334M14.165 5a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0M12.5 8.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333M10.832 15a1.667 1.667 0 1 1 3.333 0 1.667 1.667 0 0 1-3.333 0",
1243
+ "clip-rule": "evenodd"
1244
+ }, null, -1)
1245
+ ])]);
1246
+ }
1247
+ const IconDrag = { render: render$2 };
1248
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1249
+ __name: "UiLogicTreeDragHandle",
1250
+ props: {
1251
+ disabled: { type: Boolean, default: false },
1252
+ for: { default: void 0 }
1253
+ },
1254
+ setup(__props) {
1255
+ const props = __props;
1256
+ return (_ctx, _cache) => {
1257
+ return openBlock(), createBlock(unref(RemoteDragHandle), {
1258
+ for: props.for,
1259
+ disabled: props.disabled,
1260
+ class: normalizeClass([{
1261
+ "ui-v1-logic-tree-drag-handle_disabled": props.disabled
1262
+ }, "ui-v1-logic-tree-drag-handle"]),
1263
+ as: "span",
1264
+ "data-skip-node-click": "true"
1265
+ }, {
1266
+ default: withCtx(() => [
1267
+ renderSlot(_ctx.$slots, "default", {}, () => [
1268
+ createVNode(unref(IconDrag), { "aria-hidden": "true" })
1269
+ ])
1270
+ ]),
1271
+ _: 3
1272
+ }, 8, ["for", "disabled", "class"]);
1273
+ };
1274
+ }
1275
+ });
318
1276
  const UiModalSidebarType = "UiModalSidebar";
319
1277
  const UiModalSidebar = defineRemoteComponent(
320
1278
  UiModalSidebarType,
@@ -412,7 +1370,7 @@ const _hoisted_4$1 = {
412
1370
  key: 0,
413
1371
  class: "ui-v1-page-header__addon"
414
1372
  };
415
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
1373
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
416
1374
  ...{
417
1375
  inheritAttrs: false
418
1376
  },
@@ -556,6 +1514,225 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
556
1514
  };
557
1515
  }
558
1516
  });
1517
+ var APPEARANCE$3 = /* @__PURE__ */ ((APPEARANCE2) => {
1518
+ APPEARANCE2["OUTLINED"] = "outlined";
1519
+ APPEARANCE2["PRIMARY"] = "primary";
1520
+ APPEARANCE2["SECONDARY"] = "secondary";
1521
+ APPEARANCE2["TERTIARY"] = "tertiary";
1522
+ return APPEARANCE2;
1523
+ })(APPEARANCE$3 || {});
1524
+ var SIZE$5 = /* @__PURE__ */ ((SIZE2) => {
1525
+ SIZE2["LG"] = "lg";
1526
+ SIZE2["MD"] = "md";
1527
+ SIZE2["SM"] = "sm";
1528
+ SIZE2["XS"] = "xs";
1529
+ return SIZE2;
1530
+ })(SIZE$5 || {});
1531
+ var VARIANT = /* @__PURE__ */ ((VARIANT2) => {
1532
+ VARIANT2["DEFAULT"] = "default";
1533
+ VARIANT2["SUCCESS"] = "success";
1534
+ VARIANT2["DANGER"] = "danger";
1535
+ return VARIANT2;
1536
+ })(VARIANT || {});
1537
+ const UiPopconfirmTriggerType = "UiPopconfirmTrigger";
1538
+ const UiPopconfirmTrigger = defineRemoteComponent(UiPopconfirmTriggerType, {
1539
+ emits: [
1540
+ "click"
1541
+ ]
1542
+ });
1543
+ const UiPopconfirmPopperType = "UiPopconfirmPopper";
1544
+ const UiPopconfirmPopper = defineRemoteComponent(UiPopconfirmPopperType, {
1545
+ emits: [
1546
+ "update:visible",
1547
+ "toggle",
1548
+ "cancel",
1549
+ "ok"
1550
+ ],
1551
+ methods: {
1552
+ adjust: defineRemoteMethod(),
1553
+ close: defineRemoteMethod(),
1554
+ dispose: defineRemoteMethod(),
1555
+ open: defineRemoteMethod()
1556
+ },
1557
+ slots: [
1558
+ "title",
1559
+ "cancel-text",
1560
+ "ok-text"
1561
+ ]
1562
+ });
1563
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1564
+ __name: "UiPopconfirm",
1565
+ props: {
1566
+ id: {
1567
+ type: String,
1568
+ default: void 0
1569
+ },
1570
+ visible: {
1571
+ type: Boolean,
1572
+ default: false
1573
+ },
1574
+ title: {
1575
+ type: String,
1576
+ default: ""
1577
+ },
1578
+ okVariant: {
1579
+ type: String,
1580
+ default: VARIANT.DEFAULT
1581
+ },
1582
+ okTitle: {
1583
+ type: null,
1584
+ default: null
1585
+ },
1586
+ cancelTitle: {
1587
+ type: null,
1588
+ default: null
1589
+ },
1590
+ cancelAppearance: {
1591
+ type: String,
1592
+ default: APPEARANCE$3.SECONDARY
1593
+ },
1594
+ cancelVariant: {
1595
+ type: String,
1596
+ default: VARIANT.DEFAULT
1597
+ },
1598
+ buttonSize: {
1599
+ type: String,
1600
+ default: SIZE$5.XS
1601
+ },
1602
+ placement: {
1603
+ type: [String, Object],
1604
+ default: "bottom-start"
1605
+ },
1606
+ popperClass: {
1607
+ type: null,
1608
+ default: null
1609
+ },
1610
+ popperOptions: {
1611
+ type: Object,
1612
+ default: () => ({})
1613
+ },
1614
+ locale: {
1615
+ type: String,
1616
+ default: void 0
1617
+ }
1618
+ },
1619
+ emits: ["update:visible", "toggle", "cancel", "ok"],
1620
+ setup(__props, { expose: __expose, emit: __emit }) {
1621
+ const props = __props;
1622
+ const emit = __emit;
1623
+ const popper = useTemplateRef("popper");
1624
+ const visibleState = ref(props.visible);
1625
+ const setVisible = (visible) => {
1626
+ if (visibleState.value === visible) {
1627
+ return;
1628
+ }
1629
+ visibleState.value = visible;
1630
+ emit("update:visible", visible);
1631
+ emit("toggle", visible);
1632
+ };
1633
+ const open = async () => {
1634
+ setVisible(true);
1635
+ };
1636
+ const close = async () => {
1637
+ setVisible(false);
1638
+ };
1639
+ const toggle = async () => {
1640
+ if (visibleState.value) {
1641
+ await close();
1642
+ } else {
1643
+ await open();
1644
+ }
1645
+ };
1646
+ const onUpdateVisible = (visible) => {
1647
+ setVisible(visible);
1648
+ };
1649
+ const onCancel = () => {
1650
+ emit("cancel");
1651
+ void close();
1652
+ };
1653
+ const onOk = () => {
1654
+ emit("ok");
1655
+ void close();
1656
+ };
1657
+ watch(() => props.visible, (visible) => {
1658
+ setVisible(visible);
1659
+ });
1660
+ __expose({
1661
+ adjust: async () => {
1662
+ await popper.value?.adjust();
1663
+ },
1664
+ close,
1665
+ dispose: async () => {
1666
+ await popper.value?.dispose();
1667
+ },
1668
+ open,
1669
+ toggle
1670
+ });
1671
+ return (_ctx, _cache) => {
1672
+ return openBlock(), createBlock(unref(UiPopperConnector), null, {
1673
+ default: withCtx(() => [
1674
+ createVNode(unref(UiPopconfirmTrigger), {
1675
+ visible: visibleState.value,
1676
+ onClick: toggle
1677
+ }, {
1678
+ default: withCtx(() => [
1679
+ renderSlot(_ctx.$slots, "trigger", { open: visibleState.value }),
1680
+ createVNode(unref(UiPopconfirmPopper), {
1681
+ id: __props.id,
1682
+ ref_key: "popper",
1683
+ ref: popper,
1684
+ visible: visibleState.value,
1685
+ title: __props.title,
1686
+ "ok-variant": __props.okVariant,
1687
+ "ok-title": __props.okTitle,
1688
+ "cancel-title": __props.cancelTitle,
1689
+ "cancel-appearance": __props.cancelAppearance,
1690
+ "cancel-variant": __props.cancelVariant,
1691
+ "button-size": __props.buttonSize,
1692
+ placement: __props.placement,
1693
+ "popper-class": __props.popperClass,
1694
+ "popper-options": __props.popperOptions,
1695
+ locale: __props.locale,
1696
+ onCancel,
1697
+ onOk,
1698
+ "onUpdate:visible": onUpdateVisible
1699
+ }, createSlots({
1700
+ default: withCtx(() => [
1701
+ renderSlot(_ctx.$slots, "default")
1702
+ ]),
1703
+ _: 2
1704
+ }, [
1705
+ _ctx.$slots["title"] ? {
1706
+ name: "title",
1707
+ fn: withCtx(() => [
1708
+ renderSlot(_ctx.$slots, "title")
1709
+ ]),
1710
+ key: "0"
1711
+ } : void 0,
1712
+ _ctx.$slots["cancel-text"] ? {
1713
+ name: "cancel-text",
1714
+ fn: withCtx(() => [
1715
+ renderSlot(_ctx.$slots, "cancel-text")
1716
+ ]),
1717
+ key: "1"
1718
+ } : void 0,
1719
+ _ctx.$slots["ok-text"] ? {
1720
+ name: "ok-text",
1721
+ fn: withCtx(() => [
1722
+ renderSlot(_ctx.$slots, "ok-text")
1723
+ ]),
1724
+ key: "2"
1725
+ } : void 0
1726
+ ]), 1032, ["id", "visible", "title", "ok-variant", "ok-title", "cancel-title", "cancel-appearance", "cancel-variant", "button-size", "placement", "popper-class", "popper-options", "locale"])
1727
+ ]),
1728
+ _: 3
1729
+ }, 8, ["visible"])
1730
+ ]),
1731
+ _: 3
1732
+ });
1733
+ };
1734
+ }
1735
+ });
559
1736
  const UiRadioType = "UiRadio";
560
1737
  const UiRadio = defineRemoteComponent(
561
1738
  UiRadioType,
@@ -2046,143 +3223,6 @@ const UiMenuItemGroup = defineRemoteComponent(
2046
3223
  "quantity"
2047
3224
  ]
2048
3225
  );
2049
- const pluralization_en_GB = (choice) => choice === 1 ? 0 : 1;
2050
- const pluralization_es_ES = (choice) => choice === 1 ? 0 : 1;
2051
- const pluralization_ru_RU = (choice, choicesLength) => {
2052
- if (choicesLength === 2) {
2053
- return choice === 1 ? 0 : 1;
2054
- }
2055
- const mod100 = choice % 100;
2056
- return mod100 % 10 === 1 && mod100 !== 11 ? 0 : mod100 % 10 >= 2 && mod100 % 10 <= 4 && !(mod100 >= 10 && mod100 < 15) ? 1 : 2;
2057
- };
2058
- const get = (messages, path) => {
2059
- let i = 0;
2060
- let slice = messages[path[0]];
2061
- while (i < path.length) {
2062
- if (typeof slice === "string" && i + 1 === path.length) {
2063
- return slice;
2064
- }
2065
- if (typeof slice !== "object") {
2066
- return void 0;
2067
- }
2068
- slice = slice[path[++i]];
2069
- }
2070
- return slice;
2071
- };
2072
- const replace = (message, values) => {
2073
- return Object.keys(values).reduce((message2, key) => {
2074
- const pattern = new RegExp(`\\{${key}\\}`, "g");
2075
- const replacement = String(values[key]);
2076
- return message2.replace(pattern, replacement);
2077
- }, message);
2078
- };
2079
- const compile = (messages, path, values = void 0) => {
2080
- const message = get(messages, path);
2081
- if (typeof message === "string" && values) {
2082
- return replace(message, values);
2083
- }
2084
- return message;
2085
- };
2086
- const fail = (message) => {
2087
- throw new Error(message);
2088
- };
2089
- const t = (locale, messages, path, values = void 0) => {
2090
- const keys = path.split(".");
2091
- if (locale) {
2092
- const message = compile(messages[locale] ?? {}, keys, values);
2093
- return typeof message !== "object" ? message : fail(`Translation for "${locale}:${path}" is not translatable`);
2094
- }
2095
- return void 0;
2096
- };
2097
- const plural = (template, choice, rule) => {
2098
- const forms = template.split("|");
2099
- return forms[rule(choice, forms.length)];
2100
- };
2101
- class I18n {
2102
- parent;
2103
- messages;
2104
- computed;
2105
- pluralization;
2106
- fallback;
2107
- constructor(options = void 0, parent = void 0) {
2108
- this.parent = parent;
2109
- this.messages = options?.messages ?? {};
2110
- this.computed = options?.computed ?? {};
2111
- this.pluralization = {
2112
- "en-GB": pluralization_en_GB,
2113
- "es-ES": pluralization_es_ES,
2114
- "ru-RU": pluralization_ru_RU,
2115
- ...options?.pluralization ?? {}
2116
- };
2117
- this.fallback = options?.fallback;
2118
- }
2119
- t(locale, path, values = void 0) {
2120
- try {
2121
- const _t = (locale2) => t(locale2, this.messages, path, values);
2122
- return _t(locale) ?? _t(this.fallback) ?? fail(`Translation for "${path}" does not exists`);
2123
- } catch (e) {
2124
- if (this.parent) {
2125
- return this.parent.t(locale, path, values);
2126
- }
2127
- throw e;
2128
- }
2129
- }
2130
- tc(locale, path, choice, values = void 0) {
2131
- return plural(
2132
- this.t(
2133
- locale,
2134
- path,
2135
- values
2136
- ),
2137
- choice,
2138
- this.pluralization[locale]
2139
- );
2140
- }
2141
- compute(locale, key, values) {
2142
- const computed2 = this.computed[key];
2143
- if (computed2) {
2144
- return computed2(localize(this, locale), values);
2145
- }
2146
- if (this.parent) {
2147
- return this.parent.compute(locale, key, values);
2148
- }
2149
- return fail("Key " + key + " is not registered");
2150
- }
2151
- extend(options) {
2152
- return new I18n({
2153
- pluralization: this.pluralization,
2154
- fallback: this.fallback,
2155
- ...options
2156
- }, this);
2157
- }
2158
- }
2159
- const localize = (i18n, locale) => ({
2160
- t(path, values = void 0) {
2161
- return i18n.t(locale, path, values);
2162
- },
2163
- tc(path, choice, values = void 0) {
2164
- return i18n.tc(locale, path, choice, values);
2165
- },
2166
- compute(key, values) {
2167
- return i18n.compute(locale, key, values);
2168
- }
2169
- });
2170
- const fallback = "en-GB";
2171
- const define = (options = void 0, parent = void 0) => {
2172
- const i18n = new I18n({
2173
- ...options,
2174
- fallback
2175
- }, parent);
2176
- const extend = (i18n2, options2 = void 0) => options2 ? i18n2.extend(options2) : i18n2;
2177
- return {
2178
- i18n,
2179
- init: (locale, options2 = void 0) => localize(
2180
- extend(i18n, options2),
2181
- locale
2182
- ),
2183
- fallback
2184
- };
2185
- };
2186
3226
  const selected$2 = "Selected";
2187
3227
  const search$2 = { "placeholder": "", "noResult": "Nothing found" };
2188
3228
  const messages_en_GB = {
@@ -2246,7 +3286,6 @@ const RegisterGroupKey = /* @__PURE__ */ Symbol("UiSelectOptionGroupRegister");
2246
3286
  const UnregisterGroupKey = /* @__PURE__ */ Symbol("UiSelectOptionGroupUnregister");
2247
3287
  const RegisterHeaderOptionKey = /* @__PURE__ */ Symbol("UiSelectOptionGroupRegisterHeaderOption");
2248
3288
  const UnregisterHeaderOptionKey = /* @__PURE__ */ Symbol("UiSelectOptionGroupUnregisterHeaderOption");
2249
- const I18nInjectKey = /* @__PURE__ */ Symbol("$embedI18n");
2250
3289
  const UiSelectTriggerType = "UiSelectTrigger";
2251
3290
  const UiSelectTrigger = defineRemoteComponent(UiSelectTriggerType, {
2252
3291
  emits: [
@@ -3059,6 +4098,11 @@ const createEndpointRoot = async (channel) => {
3059
4098
  "UiInfobox",
3060
4099
  "UiLink",
3061
4100
  "UiLoader",
4101
+ "UiLogicTreeCaret",
4102
+ "UiLogicTreeNode",
4103
+ "UiLogicTreeNodeIcon",
4104
+ "UiLogicTreeNodeItem",
4105
+ "UiLogicTreeRoot",
3062
4106
  "UiMenuItem",
3063
4107
  "UiMenuItemGroup",
3064
4108
  "UiModalSidebar",
@@ -3068,6 +4112,8 @@ const createEndpointRoot = async (channel) => {
3068
4112
  "UiPageHeader",
3069
4113
  "UiPageHeaderLayout",
3070
4114
  "UiPageHeaderTitle",
4115
+ "UiPopconfirmPopper",
4116
+ "UiPopconfirmTrigger",
3071
4117
  "UiPopper",
3072
4118
  "UiPopperConnector",
3073
4119
  "UiPopperTarget",
@@ -3191,6 +4237,11 @@ export {
3191
4237
  ALIGN,
3192
4238
  DIRECTION,
3193
4239
  ImageWorkersKey,
4240
+ LogicTreeChildrenView,
4241
+ LogicTreeConjunction,
4242
+ LogicTreeNodeKind,
4243
+ LogicTreeNodeView,
4244
+ LogicTreeTone,
3194
4245
  APPEARANCE$2 as RADIO_SWITCH_APPEARANCE,
3195
4246
  SIZE$4 as RADIO_SWITCH_SIZE,
3196
4247
  ANIMATION as SKELETON_ANIMATION,
@@ -3226,13 +4277,18 @@ export {
3226
4277
  UiDateType,
3227
4278
  UiError,
3228
4279
  UiErrorType,
3229
- _sfc_main$b as UiField,
4280
+ _sfc_main$e as UiField,
3230
4281
  UiInfobox,
3231
4282
  UiInfoboxType,
3232
4283
  UiLink,
3233
4284
  UiLinkType,
3234
4285
  UiLoader,
3235
4286
  UiLoaderType,
4287
+ _sfc_main$d as UiLogicTree,
4288
+ UiLogicTreeCaret,
4289
+ _sfc_main$c as UiLogicTreeDragHandle,
4290
+ UiLogicTreeNodeIcon,
4291
+ UiLogicTreeNodeItem,
3236
4292
  UiMenuItem,
3237
4293
  UiMenuItemGroup,
3238
4294
  UiMenuItemGroupType,
@@ -3245,7 +4301,8 @@ export {
3245
4301
  UiModalWindowType,
3246
4302
  UiNumberStepper,
3247
4303
  UiNumberStepperType,
3248
- _sfc_main$a as UiPageHeader,
4304
+ _sfc_main$b as UiPageHeader,
4305
+ _sfc_main$a as UiPopconfirm,
3249
4306
  UiPopper,
3250
4307
  UiPopperConnector,
3251
4308
  UiPopperConnectorType,