@globalpayments/vega 2.51.0 → 2.52.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.
- package/dist/cjs/{element-appender-slimmer-5b1d8ffb.js → element-appender-slimmer-1946ff07.js} +2 -2
- package/dist/cjs/{event-emit-slimmer-36036ef7.js → event-emit-slimmer-6154c759.js} +2 -11
- package/dist/cjs/{form-field-controller-slimmer-01c01946.js → form-field-controller-slimmer-e721359b.js} +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{mutation-observer-slimmer-895b3d3e.js → mutation-observer-slimmer-749d5020.js} +5 -2
- package/dist/cjs/try-get-document-c0ebd39a.js +13 -0
- package/dist/cjs/vega-accordion.cjs.entry.js +2 -1
- package/dist/cjs/vega-app-header-button.cjs.entry.js +2 -1
- package/dist/cjs/vega-banner.cjs.entry.js +2 -1
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +2 -1
- package/dist/cjs/vega-button-circle.cjs.entry.js +2 -1
- package/dist/cjs/vega-button-group_2.cjs.entry.js +2 -1
- package/dist/cjs/vega-button-link.cjs.entry.js +2 -1
- package/dist/cjs/vega-button.cjs.entry.js +2 -1
- package/dist/cjs/vega-calendar_3.cjs.entry.js +2 -1
- package/dist/cjs/vega-carousel.cjs.entry.js +2 -1
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +4 -3
- package/dist/cjs/vega-chip.cjs.entry.js +2 -1
- package/dist/cjs/vega-code-block.cjs.entry.js +2 -1
- package/dist/cjs/vega-color-picker.cjs.entry.js +4 -3
- package/dist/cjs/vega-combo-box.cjs.entry.js +4 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +5 -4
- package/dist/cjs/vega-dialog_2.cjs.entry.js +3 -2
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +4 -3
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +2 -1
- package/dist/cjs/vega-file-uploader.cjs.entry.js +4 -3
- package/dist/cjs/vega-form.cjs.entry.js +4 -3
- package/dist/cjs/vega-icon.cjs.entry.js +22 -22
- package/dist/cjs/vega-image-uploader.cjs.entry.js +4 -3
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +4 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +14 -4
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4 -3
- package/dist/cjs/vega-input-range.cjs.entry.js +4 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +4 -3
- package/dist/cjs/vega-input.cjs.entry.js +4 -3
- package/dist/cjs/vega-item-toggle.cjs.entry.js +2 -1
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +14 -3
- package/dist/cjs/vega-pagination.cjs.entry.js +2 -1
- package/dist/cjs/vega-popover_2.cjs.entry.js +3 -2
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +2 -1
- package/dist/cjs/vega-radio_2.cjs.entry.js +4 -3
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +4 -3
- package/dist/cjs/vega-segment-control.cjs.entry.js +2 -1
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -3
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +4 -3
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +2 -1
- package/dist/cjs/vega-signature-capture.cjs.entry.js +4 -3
- package/dist/cjs/vega-stepper.cjs.entry.js +4 -3
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +2 -1
- package/dist/cjs/vega-table_8.cjs.entry.js +3 -2
- package/dist/cjs/vega-textarea.cjs.entry.js +4 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +6 -5
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +4 -3
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +1 -1
- package/dist/cjs/vega.cjs.js +1 -1
- package/dist/collection/components/vega-dialog/vega-dialog.css +1 -0
- package/dist/collection/components/vega-icon/vega-icon.js +22 -22
- package/dist/collection/components/vega-input-numeric/slimmers/renderers/vega-input-numeric-renderer.js +4 -1
- package/dist/collection/components/vega-input-numeric/vega-input-numeric.js +27 -0
- package/dist/collection/components/vega-nav/slimmers/renderers/vega-nav-list-renderer.js +1 -1
- package/dist/collection/components/vega-nav/vega-left-nav-link/slimmers/renderers/vega-left-nav-link-renderer.js +4 -1
- package/dist/collection/components/vega-nav/vega-left-nav-link/vega-left-nav-link.js +28 -0
- package/dist/collection/components/vega-time-picker/vega-time-picker-dropdown/vega-time-picker-dropdown.css +4 -0
- package/dist/collection/helpers/event-manager/slimmers/event-emit-slimmer.js +2 -2
- package/dist/collection/helpers/event-manager/test/event-emit-slimmer.test.js +2 -2
- package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +2 -2
- package/dist/collection/helpers/slimmers/mutation-observer/mutation-observer-slimmer.js +5 -2
- package/dist/collection/helpers/slimmers/mutation-observer/test/mutation-observer-slimmer.test.js +14 -0
- package/dist/collection/helpers/validator/form-field-controller.js +2 -2
- package/dist/collection/helpers/validator/test/validator/form-field-controller.test.js +12 -0
- package/dist/collection/utils/test/safe-document.test.js +4 -4
- package/dist/collection/utils/{safe-document.js → try-get-document.js} +1 -1
- package/dist/esm/{element-appender-slimmer-64a77b7f.js → element-appender-slimmer-dbdad1df.js} +2 -2
- package/dist/esm/{event-emit-slimmer-7428cc01.js → event-emit-slimmer-b5cb9b81.js} +2 -11
- package/dist/esm/{form-field-controller-slimmer-87d80e46.js → form-field-controller-slimmer-846cda92.js} +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mutation-observer-slimmer-6cef9549.js → mutation-observer-slimmer-58ebc13c.js} +5 -2
- package/dist/esm/try-get-document-bef0f526.js +11 -0
- package/dist/esm/vega-accordion.entry.js +2 -1
- package/dist/esm/vega-app-header-button.entry.js +2 -1
- package/dist/esm/vega-banner.entry.js +2 -1
- package/dist/esm/vega-breadcrumb.entry.js +2 -1
- package/dist/esm/vega-button-circle.entry.js +2 -1
- package/dist/esm/vega-button-group_2.entry.js +2 -1
- package/dist/esm/vega-button-link.entry.js +2 -1
- package/dist/esm/vega-button.entry.js +2 -1
- package/dist/esm/vega-calendar_3.entry.js +2 -1
- package/dist/esm/vega-carousel.entry.js +2 -1
- package/dist/esm/vega-checkbox_2.entry.js +4 -3
- package/dist/esm/vega-chip.entry.js +2 -1
- package/dist/esm/vega-code-block.entry.js +2 -1
- package/dist/esm/vega-color-picker.entry.js +4 -3
- package/dist/esm/vega-combo-box.entry.js +4 -3
- package/dist/esm/vega-date-picker_2.entry.js +5 -4
- package/dist/esm/vega-dialog_2.entry.js +3 -2
- package/dist/esm/vega-dropdown_5.entry.js +4 -3
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +2 -1
- package/dist/esm/vega-file-uploader.entry.js +4 -3
- package/dist/esm/vega-form.entry.js +4 -3
- package/dist/esm/vega-icon.entry.js +22 -22
- package/dist/esm/vega-image-uploader.entry.js +4 -3
- package/dist/esm/vega-input-credit-card.entry.js +4 -3
- package/dist/esm/vega-input-numeric.entry.js +14 -4
- package/dist/esm/vega-input-phone-number.entry.js +4 -3
- package/dist/esm/vega-input-range.entry.js +4 -3
- package/dist/esm/vega-input-select.entry.js +4 -3
- package/dist/esm/vega-input.entry.js +4 -3
- package/dist/esm/vega-item-toggle.entry.js +2 -1
- package/dist/esm/vega-left-nav_5.entry.js +14 -3
- package/dist/esm/vega-pagination.entry.js +2 -1
- package/dist/esm/vega-popover_2.entry.js +3 -2
- package/dist/esm/vega-progress-tracker.entry.js +2 -1
- package/dist/esm/vega-radio_2.entry.js +4 -3
- package/dist/esm/vega-rich-text-editor_4.entry.js +4 -3
- package/dist/esm/vega-segment-control.entry.js +2 -1
- package/dist/esm/vega-selection-chip_2.entry.js +4 -3
- package/dist/esm/vega-selection-tile_2.entry.js +4 -3
- package/dist/esm/vega-sidenav_3.entry.js +2 -1
- package/dist/esm/vega-signature-capture.entry.js +4 -3
- package/dist/esm/vega-stepper.entry.js +4 -3
- package/dist/esm/vega-tab-group_2.entry.js +2 -1
- package/dist/esm/vega-table_8.entry.js +3 -2
- package/dist/esm/vega-textarea.entry.js +4 -3
- package/dist/esm/vega-time-picker_2.entry.js +6 -5
- package/dist/esm/vega-toggle-switch.entry.js +4 -3
- package/dist/esm/vega-tooltip_2.entry.js +1 -1
- package/dist/esm/vega.js +1 -1
- package/dist/types/components/vega-input-numeric/slimmers/renderers/vega-input-numeric-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-numeric/vega-input-numeric.d.ts +6 -0
- package/dist/types/components/vega-nav/interface.d.ts +1 -0
- package/dist/types/components/vega-nav/vega-left-nav-link/slimmers/renderers/vega-left-nav-link-renderer.d.ts +1 -0
- package/dist/types/components/vega-nav/vega-left-nav-link/vega-left-nav-link.d.ts +7 -0
- package/dist/types/components.d.ts +20 -0
- package/dist/types/helpers/slimmers/form-field-controller-slimmer.d.ts +1 -1
- package/dist/types/helpers/validator/form-field-controller.d.ts +1 -1
- package/dist/types/utils/{safe-document.d.ts → try-get-document.d.ts} +1 -1
- package/dist/vega/p-012cbd8f.js +1 -0
- package/dist/vega/p-029300db.entry.js +1 -0
- package/dist/vega/p-05383290.entry.js +1 -0
- package/dist/vega/p-05588c85.entry.js +1 -0
- package/dist/vega/p-06db5a2e.entry.js +1 -0
- package/dist/vega/p-092c87b5.entry.js +1 -0
- package/dist/vega/p-0f034db5.entry.js +1 -0
- package/dist/vega/{p-30c363d8.entry.js → p-0fb26be0.entry.js} +1 -1
- package/dist/vega/p-10edaab7.entry.js +1 -0
- package/dist/vega/p-2490a391.entry.js +1 -0
- package/dist/vega/p-2a4c313e.entry.js +1 -0
- package/dist/vega/p-310f0791.entry.js +1 -0
- package/dist/vega/p-35c9cd1d.entry.js +1 -0
- package/dist/vega/p-3a6b4208.entry.js +1 -0
- package/dist/vega/p-3e8a8aa5.entry.js +1 -0
- package/dist/vega/{p-8bdc9e75.js → p-40577e8e.js} +1 -1
- package/dist/vega/p-44dee180.entry.js +1 -0
- package/dist/vega/p-517615af.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-5f594deb.entry.js +1 -0
- package/dist/vega/p-62734ef7.entry.js +1 -0
- package/dist/vega/p-6419abd9.entry.js +1 -0
- package/dist/vega/p-685939dc.entry.js +1 -0
- package/dist/vega/p-6ec0e3ce.entry.js +1 -0
- package/dist/vega/p-72e64237.js +1 -0
- package/dist/vega/p-72eb8998.entry.js +1 -0
- package/dist/vega/p-75855aaf.entry.js +1 -0
- package/dist/vega/p-78a57a17.js +1 -0
- package/dist/vega/p-7a8b6f2f.entry.js +1 -0
- package/dist/vega/p-7f0def5a.entry.js +1 -0
- package/dist/vega/p-7f2c98df.entry.js +1 -0
- package/dist/vega/p-812b9d6d.entry.js +1 -0
- package/dist/vega/p-888e3f52.entry.js +1 -0
- package/dist/vega/p-8d3764d3.entry.js +1 -0
- package/dist/vega/p-9a9766cc.entry.js +1 -0
- package/dist/vega/p-a2d47741.entry.js +1 -0
- package/dist/vega/p-ab2a6d14.entry.js +1 -0
- package/dist/vega/p-abac6b00.entry.js +1 -0
- package/dist/vega/p-ac3a2d9c.entry.js +1 -0
- package/dist/vega/p-adadb1a1.entry.js +1 -0
- package/dist/vega/p-afc49b98.entry.js +1 -0
- package/dist/vega/p-b13fff4d.entry.js +1 -0
- package/dist/vega/p-b4a1a8e1.entry.js +1 -0
- package/dist/vega/p-b75ee3ba.js +1 -0
- package/dist/vega/p-bba5b112.entry.js +1 -0
- package/dist/vega/p-c22c628b.entry.js +1 -0
- package/dist/vega/p-ca0294c9.entry.js +1 -0
- package/dist/vega/{p-b264d92e.entry.js → p-cb643d8d.entry.js} +1 -1
- package/dist/vega/p-d8eec0bb.entry.js +1 -0
- package/dist/vega/p-e00da6d4.entry.js +1 -0
- package/dist/vega/p-e1ba6325.entry.js +1 -0
- package/dist/vega/p-eeab4167.entry.js +1 -0
- package/dist/vega/{p-29fe94b6.entry.js → p-efb06a25.entry.js} +1 -1
- package/dist/vega/p-f3ec4ae6.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-07cdaf74.entry.js +0 -1
- package/dist/vega/p-07e40eea.entry.js +0 -1
- package/dist/vega/p-1071f790.entry.js +0 -1
- package/dist/vega/p-12929d20.entry.js +0 -1
- package/dist/vega/p-1b81fc7a.entry.js +0 -1
- package/dist/vega/p-21d4f12e.entry.js +0 -1
- package/dist/vega/p-21d5656d.entry.js +0 -1
- package/dist/vega/p-21e180f2.js +0 -1
- package/dist/vega/p-2329cb73.entry.js +0 -1
- package/dist/vega/p-388abe56.entry.js +0 -1
- package/dist/vega/p-447a2b18.entry.js +0 -1
- package/dist/vega/p-4bca12ee.entry.js +0 -1
- package/dist/vega/p-52bdeea0.entry.js +0 -1
- package/dist/vega/p-53803447.entry.js +0 -1
- package/dist/vega/p-53815555.entry.js +0 -1
- package/dist/vega/p-597732e9.entry.js +0 -1
- package/dist/vega/p-60164904.entry.js +0 -1
- package/dist/vega/p-61b72038.entry.js +0 -1
- package/dist/vega/p-647734d1.entry.js +0 -1
- package/dist/vega/p-66145767.entry.js +0 -1
- package/dist/vega/p-6ceb2d26.entry.js +0 -1
- package/dist/vega/p-6f3dd430.entry.js +0 -1
- package/dist/vega/p-71d897e5.entry.js +0 -1
- package/dist/vega/p-7add21f8.entry.js +0 -1
- package/dist/vega/p-7df1ad72.entry.js +0 -1
- package/dist/vega/p-86713a15.entry.js +0 -1
- package/dist/vega/p-901b20d6.entry.js +0 -1
- package/dist/vega/p-987fbbd0.js +0 -1
- package/dist/vega/p-9d3292b7.entry.js +0 -1
- package/dist/vega/p-9eab97ee.entry.js +0 -1
- package/dist/vega/p-a0bd5bd7.entry.js +0 -1
- package/dist/vega/p-a1fbf49b.entry.js +0 -1
- package/dist/vega/p-b51fa6ac.entry.js +0 -1
- package/dist/vega/p-c192c2d2.entry.js +0 -1
- package/dist/vega/p-c4447540.entry.js +0 -1
- package/dist/vega/p-c8023434.entry.js +0 -1
- package/dist/vega/p-cada532e.entry.js +0 -1
- package/dist/vega/p-d0f0a908.entry.js +0 -1
- package/dist/vega/p-d53b262c.entry.js +0 -1
- package/dist/vega/p-d9cb6ec4.entry.js +0 -1
- package/dist/vega/p-e37ac14f.entry.js +0 -1
- package/dist/vega/p-e81b672b.entry.js +0 -1
- package/dist/vega/p-ea723616.entry.js +0 -1
- package/dist/vega/p-ec7d98f0.entry.js +0 -1
- package/dist/vega/p-eea36d3c.js +0 -1
- package/dist/vega/p-f0f787a2.entry.js +0 -1
- package/dist/vega/p-f9a9fca6.entry.js +0 -1
- package/dist/vega/p-fd0b2509.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,H as e,F as i,r as o,c as s,g as n}from"./p-21d26bb4.js";import{c as r,M as c,V as l,I as a}from"./p-6e1ab235.js";import{V as h,I as d}from"./p-4387d550.js";import{s as u}from"./p-519a7d55.js";import{c as p}from"./p-86194314.js";import{C as f}from"./p-2d0d575f.js";import{d as v,b as m,f as b,P as g,a as x,M as w,N as C}from"./p-6e01f0a2.js";import{V as y,a as R,v as j,w as k,x as O,r as S}from"./p-425ba7d6.js";import{b as H,I as T,T as L,a as z}from"./p-6681efd5.js";import{V as E}from"./p-c9b9322b.js";import{g as B,J as I,N as M,G as A,T as D,K as N,O as P,d as F,P as V,Q as U,V as K,W,X as _,Y as G,_ as q,D as $,L as J,H as X,$ as Y,a as Z,M as Q,f as tt,a0 as et,c as it,Z as ot,a1 as st,a2 as nt,S as rt,R as ct,b as lt,e as at,F as ht,u as dt,I as ut,w as pt}from"./p-3eb2d433.js";import{D as ft}from"./p-e7b00bf0.js";import{g as vt}from"./p-37b05e0b.js";import{a as mt}from"./p-f4a13f3f.js";import{F as bt}from"./p-72e64237.js";import{c as gt}from"./p-012cbd8f.js";import{c as xt}from"./p-8e31e7ea.js";import{a as wt,V as Ct,B as yt,b as Rt,R as jt}from"./p-fecb4044.js";import{R as kt,A as Ot,a as St}from"./p-3b34389d.js";import{b as Ht,D as Tt}from"./p-5773a9a3.js";import{O as Lt}from"./p-331a62d5.js";import{d as zt}from"./p-1bc5b3bc.js";import{D as Et}from"./p-6be16084.js";import{i as Bt}from"./p-b1f65b13.js";import{r as It,f as Mt}from"./p-d5776087.js";import{R as At}from"./p-3fa7d356.js";import{C as Dt}from"./p-6b7dca3e.js";import{T as Nt}from"./p-d64b20c2.js";import{V as Pt}from"./p-0c8bd757.js";import{K as Ft}from"./p-55563f5f.js";import{c as Vt}from"./p-613ddaab.js";import{t as Ut}from"./p-aacf6920.js";import{r as Kt}from"./p-77e64f26.js";import"./p-cc63e827.js";import"./p-6a334573.js";import"./p-fa5eb496.js";import"./p-0bb29d98.js";import"./p-4ab3df00.js";import"./p-834434d5.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-138fcf6e.js";import"./p-613ee009.js";import"./p-b75ee3ba.js";import"./p-1fb56e14.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-1df029c2.js";var Wt=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class _t extends l{constructor(){super(...arguments),this.renderHintMessage=()=>t("vega-text",null,this.hint),this.renderTextContent=()=>t("div",{class:{"rich-text-editor-container":!0,disabled:this.disabled},style:{minHeight:24*this.rows+"px"},onClick:this.richTextContentFocus,role:"textbox",tabIndex:this.disabled?0:-1,onKeyDown:p(),ref:t=>this.richTextContainerRef=t},t("vega-rich-text-content",{ref:t=>this.richTextContentRef=t,content:this.value}),this.renderCharacterCounter()),this.renderCharacterCounter=()=>t("div",{class:{"text-editor-counter":!0,"counter-exceed-max-length":!1},style:{display:"none"}},t("span",null,"0"),t("span",null,"/100")),this.renderErrorMessage=()=>t("div",{class:"vega-error vega-hidden"}),this.richTextContentFocus=()=>{this.richTextContentRef.vegaFocus()}}componentDidRender(){f.notify(v.getSubject(this.host,y),{})}getRichTextContainerRef(){return this.richTextContainerRef}getRichTextContentRef(){return this.richTextContentRef}getRichTextWrapperRef(){return this.richTextWrapperRef}getRTEEditableElementRef(){if(this.richTextContentRef&&this.richTextContentRef.shadowRoot)return this.richTextContentRef.shadowRoot.querySelector(".rich-text-content")}render(){return t(e,null,this.renderRichTextEditor())}renderRichTextEditor(){return t("vega-flex",{direction:"col",gap:"0",ref:t=>this.richTextWrapperRef=t},this.renderLabel(),this.hint&&this.renderHintMessage(),this.toolbarRenderer.render(),this.renderTextContent(),this.renderErrorMessage())}renderLabel(){return this.label&&t("vega-field-label",{onClick:this.richTextContentFocus,isFieldRequired:this.required,disabled:this.disabled,label:this.label})}}Wt([r()],_t.prototype,"host",void 0),Wt([r()],_t.prototype,"toolbarRenderer",void 0),Wt([r()],_t.prototype,"label",void 0),Wt([r()],_t.prototype,"required",void 0),Wt([r()],_t.prototype,"hint",void 0),Wt([r()],_t.prototype,"disabled",void 0),Wt([r()],_t.prototype,"rows",void 0),Wt([r()],_t.prototype,"placeholder",void 0),Wt([r()],_t.prototype,"value",void 0),Wt([c("componentDidRender")],_t.prototype,"componentDidRender",null);var Gt=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class qt extends l{constructor(){super(...arguments),this.getToolbarBtnRenderer=t=>{switch(t){case"clearStyle":return this.clearStyleToolbarButtonSlimmer;case"bold":return this.boldToolbarButtonSlimmer;case"textStyles":return this.textStylesToolbarButtonSlimmer;case"italic":return this.italicToolbarButtonSlimmer;case"underline":return this.underlineToolbarButtonSlimmer;case"textColor":return this.textColorToolbarButtonSlimmer;case"moreIndent":return this.moreIndentToolbarButtonSlimmer;case"lessIndent":return this.lessIndentToolbarButtonSlimmer;case"code":return this.codeToolbarButtonSlimmer;case"strikethrough":return this.strikethroughToolbarButtonSlimmer;case"link":return this.linkToolbarButtonSlimmer;case"image":return this.imageToolbarButtonSlimmer;case"bulletsNumbers":return this.bulletsNumbersToolbarButtonSlimmer;case"horizontalAlignment":return this.horizontalAlignmentToolbarButtonSlimmer;case"codeBlock":return this.codeBlockToolbarButtonSlimmer}}}render(){return t("vega-flex",{gap:"size-8",alignItems:"center",flexWrap:"wrap"},this.toolbarItems.map((e=>t("div",{class:"toolbar-btn-group"},e.map((t=>this.getToolbarBtnRenderer(t).render()))))))}}Gt([r()],qt.prototype,"toolbarItems",void 0),Gt([r()],qt.prototype,"clearStyleToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"boldToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"textStylesToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"italicToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"underlineToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"textColorToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"bulletsNumbersToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"horizontalAlignmentToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"strikethroughToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"imageToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"moreIndentToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"lessIndentToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"codeToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"linkToolbarButtonSlimmer",void 0),Gt([r()],qt.prototype,"codeBlockToolbarButtonSlimmer",void 0);class $t extends H{constructor(){super({icon:"bold",tooltip:{text:"Bold"}})}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new I(!t))))}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof B));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(M.BOLD))||void 0===e?void 0:e.bold}))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof A||(null===(e=t.getAnnotationByType(M.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(M.IMAGE)}))}}E.register({bold:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 64C0 46.3 14.3 32 32 32H80 96 224c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128H96 80 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48V256 96H32C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64H112V224H224zM112 288V416H256c35.3 0 64-28.7 64-64s-28.7-64-64-64H224 112z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],$t.prototype,"selectionController",void 0);class Jt extends D{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new N(this.italic)}}class Xt extends H{constructor(){super({icon:"italic",tooltip:{text:"Italic"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof B));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(M.ITALIC))||void 0===e?void 0:e.italic}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new Jt(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof A||(null===(e=t.getAnnotationByType(M.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(M.IMAGE)}))}}E.register({italic:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M128 64c0-17.7 14.3-32 32-32H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H293.3L160 416h64c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H90.7L224 96H160c-17.7 0-32-14.3-32-32z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],Xt.prototype,"selectionController",void 0);class Yt extends D{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new P(this.underline)}}class Zt extends H{constructor(){super({icon:"underline",tooltip:{text:"Underline"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof B));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(M.UNDERLINE))||void 0===e?void 0:e.underline}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new Yt(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof A||(null===(e=t.getAnnotationByType(M.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(M.IMAGE)}))}}E.register({underline:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M16 64c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H128V224c0 53 43 96 96 96s96-43 96-96V96H304c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H384V224c0 88.4-71.6 160-160 160s-160-71.6-160-160V96H48C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],Zt.prototype,"selectionController",void 0);var Qt=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class te extends H{constructor(){super({icon:"text-size",tooltip:{text:"Text Styles"}}),this.handleDropdownItemClick=t=>{const e=t.detail,i=te.items.find((t=>t.key===e)).bold,o=this.selectionController.getSelectedBlocks().filter((t=>t instanceof F));o.length>0?o.forEach((t=>{t.apply(new V(e,i))})):this.focusController.focusOnLastTextNode({newLine:!0}).then((()=>{this.selectionController.getSelectedBlocks().filter((t=>t instanceof F)).forEach((t=>{t.apply(new V(e,i))}))}))}}renderBtnWrapper(e){return t("vega-dropdown",{selectType:"single",trigger:"click",alignment:"center",selectedSourceKey:this.getSelectedSourceKey(),ref:t=>{this.addDropdownObserver(t)}},e({showArrowIcon:!0}),t("div",Object.assign({slot:"items"},super.preventLostFocus()),this.renderDropdownContent()))}renderDropdownContent(){return t(i,null,te.items.map((e=>{const i=new U(e.key),o=new K(e.bold);return t("vega-dropdown-item",{key:e.key,itemKey:e.key},t("vega-box",{padding:{right:"size-20"}},t("div",{style:Object.assign(Object.assign({},i.render()),o.render())},this.translationSlimmer.t(e.label))))})))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof A||t.getAnnotationByType(M.IMAGE)))}addDropdownObserver(t){ft.addUniqueObserverToNode(t,m,this.handleDropdownItemClick)}getSelectedSourceKey(){const t=this.selectionController.getSelectedBlocks().filter((t=>t instanceof F));return t.length>0&&t.every((e=>e.type===t[0].type))?t[0].getAnnotationByType(W.TEXT_STYLE).textStyle:""}}E.register({"text-size":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M64 128V96h96l0 320H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H256c17.7 0 32-14.3 32-32s-14.3-32-32-32H224l0-320h96v32c0 17.7 14.3 32 32 32s32-14.3 32-32V80c0-26.5-21.5-48-48-48H192 48C21.5 32 0 53.5 0 80v48c0 17.7 14.3 32 32 32s32-14.3 32-32zM384 304V288h64l0 128H432c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H512l0-128h64v16c0 17.7 14.3 32 32 32s32-14.3 32-32V272c0-26.5-21.5-48-48-48H368c-26.5 0-48 21.5-48 48v32c0 17.7 14.3 32 32 32s32-14.3 32-32z"/></svg>'}}),te.items=[{key:"title",label:"Title",bold:!0},{key:"subtitle",label:"Subtitle"},{key:"heading-1",label:"Heading 1",bold:!0},{key:"heading-2",label:"Heading 2",bold:!0},{key:"heading-3",label:"Heading 3",bold:!0},{key:"paragraph",label:"Paragraph"}],Qt([r()],te.prototype,"selectionController",void 0),Qt([r()],te.prototype,"focusController",void 0);class ee extends H{constructor(){super({icon:"text-slash",tooltip:{text:"Clear Style"}})}isSelected(){return!1}onClick(){this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((t=>{t.apply(new _)}))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof A||t.getAnnotationByType(M.IMAGE)))}}E.register({"text-slash":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L355.7 253.5 400.2 96H503L497 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C577.6 61.3 554.7 32 523.5 32H376.1h-.3H204.5c-22 0-41.2 15-46.6 36.4l-6.3 25.2L38.8 5.1zm168 131.7c.1-.3 .2-.7 .3-1L217 96H333.7L301.3 210.8l-94.5-74.1zM243.3 416H192c-17.7 0-32 14.3-32 32s14.3 32 32 32H352c17.7 0 32-14.3 32-32s-14.3-32-32-32H309.8l17.6-62.1L272.9 311 243.3 416z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ee.prototype,"selectionController",void 0);class ie extends H{constructor(){super({icon:"code-simple",tooltip:{text:"Code"}})}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new G(!t))))}isSelected(){const t=this.selectionController.getSelectedNodes();return t.length>0&&t.filter((t=>t instanceof B)).map((t=>t.getAnnotationByType(M.CODE))).every((t=>t&&t.code))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof A||t.getAnnotationByType(M.LINK)||t.getAnnotationByType(M.IMAGE)))}}E.register({"code-simple":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 214.6 118.6zm146.7 0L498.7 256 361.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ie.prototype,"selectionController",void 0);class oe extends D{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new q(this.strikethrough)}}class se extends H{constructor(){super({icon:"strikethrough",tooltip:{text:"Strikethrough"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof B));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(M.STRIKETHROUGH))||void 0===e?void 0:e.strikethrough}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof B)).forEach((e=>e.apply(new oe(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return t instanceof A||(null===(e=t.getAnnotationByType(M.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(M.IMAGE)}))}}E.register({strikethrough:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --\x3e<path fill="currentColor" d="M332.2 319.9c17.22 12.17 22.33 26.51 18.61 48.21c-3.031 17.59-10.88 29.34-24.72 36.99c-35.44 19.75-108.5 11.96-186-19.68c-16.34-6.686-35.03 1.156-41.72 17.53s1.188 35.05 17.53 41.71c31.75 12.93 95.69 35.37 157.6 35.37c29.62 0 58.81-5.156 83.72-18.96c30.81-17.09 50.44-45.46 56.72-82.11c3.998-23.27 2.168-42.58-3.488-59.05H332.2zM488 239.9l-176.5-.0309c-15.85-5.613-31.83-10.34-46.7-14.62c-85.47-24.62-110.9-39.05-103.7-81.33c2.5-14.53 10.16-25.96 22.72-34.03c20.47-13.15 64.06-23.84 155.4 .3438c17.09 4.531 34.59-5.654 39.13-22.74c4.531-17.09-5.656-34.59-22.75-39.12c-91.31-24.18-160.7-21.62-206.3 7.654C121.8 73.72 103.6 101.1 98.09 133.1C89.26 184.5 107.9 217.3 137.2 239.9L24 239.9c-13.25 0-24 10.75-24 23.1c0 13.25 10.75 23.1 24 23.1h464c13.25 0 24-10.75 24-23.1C512 250.7 501.3 239.9 488 239.9z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],se.prototype,"selectionController",void 0);class ne extends H{constructor(){super({icon:"link",tooltip:{text:"Link"}}),this.handleLinkEditorChange=({detail:t})=>{switch(t.action){case"link":{const{url:e,text:i}=t.payload,o=i!==this.currentSelectedText,s=vt();return void this.currentSelectedNodes.forEach((t=>{t.apply(new $(this.currentRange)).apply(new J({link:{href:e,groupKey:s},newText:o?i:void 0,needMergeNode:o&&this.currentSelectedNodes.length>1}))}))}}}}renderBtnWrapper(e){return t("div",{class:"toolbar-btn-link-wrapper",ref:t=>this.linkBtnWrapperRef=t},e(),t("vega-rich-text-link-editor",{resetStatusAfterHide:!1,status:"linkEdit",ref:t=>{t&&(this.linkEditorRef=t),ft.addUniqueObserverToNode(t,b,this.handleLinkEditorChange)}}))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes(),e=this.selectionController.getSelectedBlocks();return super.isDisabled()||e.length>1||t.some((t=>{var e;return!(t instanceof B)||t.getAnnotationByType(M.LINK)||(null===(e=t.getAnnotationByType(M.CODE))||void 0===e?void 0:e.code)}))}onClick(){this.currentRange=this.selectionController.getCurrentRange().toNativeRange(),this.currentSelectedNodes=this.selectionController.getSelectedNodes(),this.currentRange&&(this.currentSelectedText=this.currentRange.toString(),this.currentSelectedNodes.length>0&&(this.linkEditorRef.record={text:this.currentSelectedText,url:""})),this.linkEditorRef.target||(this.linkEditorRef.target=this.linkBtnWrapperRef,mt(this.linkEditorRef).then((()=>{this.linkEditorRef.show()})))}}E.register({link:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M562.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L405.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C189.5 251.2 196 330 246 380c56.5 56.5 148 56.5 204.5 0L562.8 267.7zM43.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C57 372 57 321 88.5 289.5L200.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C416.5 260.8 410 182 360 132c-56.5-56.5-148-56.5-204.5 0L43.2 244.3z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ne.prototype,"selectionController",void 0);class re extends X{constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new Y(this.indent)}}class ce extends H{constructor(){super({icon:"indent",tooltip:{text:"More Indent"}})}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedBlocks(),e=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>"list-item"===t.type||"code-block"===t.type))||e.some((t=>t instanceof Z))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>{var e,i;const o=null!==(i=null===(e=t.getAnnotationByType(W.INDENT))||void 0===e?void 0:e.indent)&&void 0!==i?i:0;t.apply(new re(o+1))}))}}E.register({indent:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 64C0 46.3 14.3 32 32 32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32zm32 96H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3V176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],ce.prototype,"selectionController",void 0);class le extends H{constructor(){super({icon:"outdent",tooltip:{text:"Less Indent"}})}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedBlocks(),e=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>"list-item"===t.type||"code-block"===t.type))||e.some((t=>t instanceof Z))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>{var e,i;const o=null!==(i=null===(e=t.getAnnotationByType(W.INDENT))||void 0===e?void 0:e.indent)&&void 0!==i?i:0;t.apply(new re(o>1?o-1:0))}))}}E.register({outdent:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M6 64C6 46.3 20.3 32 38 32H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H38C20.3 96 6 81.7 6 64zM198 192c0-17.7 14.3-32 32-32H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H230c-17.7 0-32-14.3-32-32zm32 96H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H230c-17.7 0-32-14.3-32-32s14.3-32 32-32zM6 448c0-17.7 14.3-32 32-32H422c17.7 0 32 14.3 32 32s-14.3 32-32 32H38c-17.7 0-32-14.3-32-32zm.2-179.4c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6V335.3c0 13.3-15.3 20.8-25.8 12.6L6.2 268.6z"/></svg>'}}),function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([r()],le.prototype,"selectionController",void 0);class ae extends Q{constructor(t){super(),this.type=tt.UPDATE_IMAGE_NODE_URL,this.url=t}}var he=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class de extends H{constructor(){super({icon:"image",tooltip:{text:"Image"}}),this.onClick=()=>{this.inputElementRef.click()},this.fileInputChange=t=>{t.stopPropagation();const e=t.target;if(!e.files.length)return;const i=this.insertImageController.insertImageToCaretPosition(URL.createObjectURL(e.files[0]));this.updateNodeURLMap||(this.updateNodeURLMap=new Map),this.updateNodeURLMap.set(i,(t=>{i.apply(new ae(t))}));const o={file:e.files[0],sendBackUploadedURLCallback:this.updateNodeURLMap.get(i)};this.imageInsertedEventEmitter.emit(o),e.value=""}}renderBtnWrapper(e){return t("vega-box",null,e({showArrowIcon:!1}),t("input",{type:"file",style:{display:"none"},ref:t=>this.inputElementRef=t,accept:"image/*",onChange:this.fileInputChange}))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t.getAnnotationByType(M.LINK)))}}E.register({image:{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6h96 32H424c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>'}}),he([r()],de.prototype,"insertImageController",void 0),he([r()],de.prototype,"imageInsertedEventEmitter",void 0),he([r()],de.prototype,"selectionController",void 0);class ue extends Q{constructor(t,e){super(),this.type=tt.TRANSFORM_LIST_BLOCK,this.isFlushable=!0,this.listType=t,this.selectedBlocks=e}}class pe extends Q{constructor(t){super(),this.type=tt.TRANSFORM_PARAGRAPH_BLOCK,this.isFlushable=!0,this.selectedBlocks=t}}var fe=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ve extends H{constructor(){super({icon:"list-ul",tooltip:{text:"Bullets"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return this.isListType(t)}onClick(){this.isSelected()?this.deselectBulletList():this.selectBulletList(),this.popoverRef.hide()}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof Z||t instanceof A))}isListType(t,e="bullet-list"){return t.length>0&&t.every((t=>t instanceof wt&&t.parent.type===e))}deselectBulletList(){const t=this.selectionController.getSelectedBlocks();t[0]&&t[0].parent.apply(new pe(t))}selectBulletList(){const t=this.selectionController.getSelectedBlocks();t[0]&&("list-item"===t[0].type?t[0].parent:t[0]).apply(new ue("bullet-list",t))}}fe([r()],ve.prototype,"selectionController",void 0),fe([r()],ve.prototype,"popoverRef",void 0);var me=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class be extends H{constructor(){super({icon:"list-ol",tooltip:{text:"Numbers"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return this.isListType(t)}onClick(){this.isSelected()?this.deselectNumberList():this.selectNumberList(),this.popoverRef.hide()}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof Z||t instanceof A))}isListType(t,e="number-list"){return t.length>0&&t.every((t=>t instanceof wt&&t.parent.type===e))}deselectNumberList(){const t=this.selectionController.getSelectedBlocks();t[0]&&t[0].parent.apply(new pe(t))}selectNumberList(){const t=this.selectionController.getSelectedBlocks();t[0]&&("list-item"===t[0].type?t[0].parent:t[0]).apply(new ue("number-list",t))}}me([r()],be.prototype,"selectionController",void 0),me([r()],be.prototype,"popoverRef",void 0);var ge=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class xe extends H{constructor(){super({icon:"list-ul",tooltip:{text:"Bullets"}}),this.bulletsToolbarButtonSlimmer=new ve,this.numbersToolbarButtonSlimmer=new be}componentWillRender(){this.numbersToolbarButtonSlimmer.isSelected()?super.setIcon("list-ol"):super.setIcon("list-ul")}renderBtnWrapper(e){return t("vega-popover",{showArrow:!1,trigger:"click",placement:"bottom",alignment:"center",ref:t=>this.popoverRef=t},t("div",{slot:"popover-content"},e({showArrowIcon:!0})),t("div",{slot:"popover"},this.renderContent()))}renderContent(){return t("vega-flex",{gap:"size-8","justify-content":"center"},t("div",null,this.bulletsToolbarButtonSlimmer.render()),t("div",null,this.numbersToolbarButtonSlimmer.render()))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t instanceof Z||t instanceof A))}}E.register({"list-ul":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M64 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM64 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm48-208a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"/></svg>'},"list-ol":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M24 56c0-13.3 10.7-24 24-24H80c13.3 0 24 10.7 24 24V176h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H40c-13.3 0-24-10.7-24-24s10.7-24 24-24H56V80H48C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432H120c13.3 0 24 10.7 24 24s-10.7 24-24 24H32c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"/></svg>'}}),ge([r()],xe.prototype,"selectionController",void 0),ge([a()],xe.prototype,"bulletsToolbarButtonSlimmer",void 0),ge([a()],xe.prototype,"numbersToolbarButtonSlimmer",void 0),ge([c("componentWillRender")],xe.prototype,"componentWillRender",null);class we extends X{constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new et(this.textAlign)}}var Ce=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ye extends H{constructor(){super({icon:"align-left",tooltip:{text:"Left Align"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"left"===(null===(e=t.getAnnotationByType(W.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new we("left")))),this.popoverRef.hide()}}E.register({"align-left":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M288 64c0 17.7-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32H256c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H256c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>'}}),Ce([r()],ye.prototype,"selectionController",void 0),Ce([r()],ye.prototype,"popoverRef",void 0);var Re=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class je extends H{constructor(){super({icon:"align-center",tooltip:{text:"Center Align"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"center"===(null===(e=t.getAnnotationByType(W.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new we("center")))),this.popoverRef.hide()}}E.register({"align-center":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M352 64c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32z"/></svg>'}}),Re([r()],je.prototype,"selectionController",void 0),Re([r()],je.prototype,"popoverRef",void 0);var ke=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Oe extends H{constructor(){super({icon:"align-right",tooltip:{text:"Right Align"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"right"===(null===(e=t.getAnnotationByType(W.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new we("right")))),this.popoverRef.hide()}}E.register({"align-right":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M448 64c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>'}}),ke([r()],Oe.prototype,"selectionController",void 0),ke([r()],Oe.prototype,"popoverRef",void 0);var Se=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class He extends H{constructor(){super({icon:"align-justify",tooltip:{text:"Justified"}})}isSelected(){const t=this.selectionController.getSelectedBlocks();return t.length>0&&t.every((t=>{var e;return"justify"===(null===(e=t.getAnnotationByType(W.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new we("justify")))),this.popoverRef.hide()}}E.register({"align-justify":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M448 64c0-17.7-14.3-32-32-32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32z"/></svg>'}}),Se([r()],He.prototype,"selectionController",void 0),Se([r()],He.prototype,"popoverRef",void 0);var Te=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Le extends H{constructor(){super({icon:"align-left",tooltip:{text:"Left Align"}}),this.leftAlignToolbarButtonSlimmer=new ye,this.centerAlignToolbarButtonSlimmer=new je,this.rightAlignToolbarButtonSlimmer=new Oe,this.justifiedToolbarButtonSlimmer=new He}componentWillRender(){this.leftAlignToolbarButtonSlimmer.isSelected()?super.setIcon("align-left"):this.centerAlignToolbarButtonSlimmer.isSelected()?super.setIcon("align-center"):this.rightAlignToolbarButtonSlimmer.isSelected()?super.setIcon("align-right"):this.justifiedToolbarButtonSlimmer.isSelected()?super.setIcon("align-justify"):super.setIcon("align-left")}renderBtnWrapper(e){return t("vega-popover",{trigger:"click",showArrow:!1,alignment:"center",placement:"bottom",ref:t=>this.popoverRef=t},t("div",{slot:"popover-content"},e({showArrowIcon:!0})),t("div",{slot:"popover"},this.renderContent()))}renderContent(){return t("vega-flex",{gap:"size-8","justify-content":"center"},t("div",null,this.leftAlignToolbarButtonSlimmer.render()),t("div",null,this.centerAlignToolbarButtonSlimmer.render()),t("div",null,this.rightAlignToolbarButtonSlimmer.render()),t("div",null,this.justifiedToolbarButtonSlimmer.render()))}isSelected(){return!1}isDisabled(){return super.isDisabled()||this.selectionController.getSelectedBlocks().some((t=>"code-block"===t.type))}}Te([r()],Le.prototype,"selectionController",void 0),Te([a()],Le.prototype,"leftAlignToolbarButtonSlimmer",void 0),Te([a()],Le.prototype,"centerAlignToolbarButtonSlimmer",void 0),Te([a()],Le.prototype,"rightAlignToolbarButtonSlimmer",void 0),Te([a()],Le.prototype,"justifiedToolbarButtonSlimmer",void 0),Te([c("componentWillRender")],Le.prototype,"componentWillRender",null);class ze{constructor(t,e){this.content=t.clone(!0),this.selection=e.clone(),this.refreshSelectionNodes()}clone(){return new ze(this.content,this.selection)}refreshSelectionNodes(){const{startNode:t,endNode:e,startOffset:i,endOffset:o}=this.selection.range;if(t&&e){const s=this.content.findNodeById(t.id),n=this.content.findNodeById(e.id);s&&n&&this.selection.range.updateRTERange({startNode:s,endNode:n,startOffset:i,endOffset:o})}}}var Ee=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Be extends l{connectedCallback(){const t=zt((()=>{this.valueController.flushChanges(this.value)}),Be.VALUE_CHANGE_DEBOUNCE_TIME,this);this.flushChangeObserver=new Lt(this.isAcceptableFlushChange.bind(this),t),f.register(v.getSubject(this.host,R),this.flushChangeObserver)}disconnectedCallback(){f.unregister(v.getSubject(this.host,R),this.flushChangeObserver)}componentWillLoad(){!this.value||this.value instanceof Ct||(this.value=Ct.fromJSON(this.value))}watchValueUpdate(){!this.value||this.value instanceof Ct?this.value&&0!==this.value.blocks.length?(this.changeEventEmitter.emit(this.value),f.notify(Ht,{host:this.host,detail:this.value})):this.value=Ct.createEmptyContent():this.value=Ct.fromJSON(this.value)}async flushChanges(t,e=!0){e&&this.historyController.registerHistory(new ze(t,new kt(this.selectionController.getCurrentRange()))),this.value=t.clone(),await mt(this.host)}isAcceptableFlushChange(){return!0}}Be.VALUE_CHANGE_DEBOUNCE_TIME=50,Ee([r()],Be.prototype,"host",void 0),Ee([r({writable:!0})],Be.prototype,"value",void 0),Ee([r()],Be.prototype,"changeEventEmitter",void 0),Ee([r()],Be.prototype,"valueController",void 0),Ee([r()],Be.prototype,"historyController",void 0),Ee([r()],Be.prototype,"selectionController",void 0),Ee([c("connectedCallback")],Be.prototype,"connectedCallback",null),Ee([c("disconnectedCallback")],Be.prototype,"disconnectedCallback",null),Ee([c("componentWillLoad")],Be.prototype,"componentWillLoad",null),Ee([c("watchValueUpdate")],Be.prototype,"watchValueUpdate",null);class Ie{constructor(t){this.editor=t}syncRichTextContentEditable(){this.editor.richTextContentEditable=!this.editor.disabled}}class Me{execute(t,e,i,o){this.initCurrentStateAndSelection(t,e),this.setCurrentRichTextEditor(i),this.handleEvent(o)}isRootContainer(t){return t&&t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("rich-text-content")}isEmptyParagraph(t){return t&&t.childNodes&&0===t.childNodes.length}removeSelectionRange(t=!1){f.notify(v.getSubject(this.richTextEditorRef,j),{host:this.richTextEditorRef,detail:t});const e=this.selectionController.getCurrentRange(),i=this.selectionController.getSelectedNodes();return e.startNode||i[0]}createEmptyParagraph(){const t=new F(vt(),"paragraph"),e=new B(`${t.id}1`,"",t);return t.apply(new it([e])),t}initCurrentStateAndSelection(t,e){this.currentState=t,this.selectionController=e}setCurrentRichTextEditor(t){this.richTextEditorRef=t}}class Ae extends Q{constructor(t,...e){super(),this.type=tt.INSERT_NODES_BEFORE,this.referNode=t,this.nodesToBeInserted=e}}class De extends Q{constructor(t,e){super(),this.type=tt.REPLACE_SELECTED_TEXT,this.textToBeInsert="",this.textToBeInsert=t,this.currentRange=e}}class Ne extends Me{handleEvent(t){const e=t.data,i=this.selectionController.getCurrentRange(),{startContainer:o,startOffset:s}=i,n=this.selectionController.getSelectedNodes();if(n.length<2){if(!n.length&&this.isRootContainer(o)){const t=this.insertTextToRoot(e);this.selectionController.enqueueSelectionRangeFutureState(t,e.length)}else if(n[0]instanceof B){let t=s+e.length,r=!1,c=n[0];"\n"===c.text?(c=this.insertTextToLineBreakNode(c,e),r=!0):(o.nodeValue===ot&&s===ot.length&&c.isEmpty()&&(o.nodeValue="",t-=ot.length),c instanceof B&&(r=!0,c.apply(new De(e,i)))),r&&this.selectionController.enqueueSelectionRangeFutureState(c,Math.min(t,c.text.length))}}else{const t=this.removeSelectionRange(!0);t instanceof B&&(t.apply(new De(e,i)),this.selectionController.enqueueSelectionRangeFutureState(t,Math.min(s+e.length,t.text.length)))}}insertTextToRoot(t){if(this.currentState&&this.currentState.blocks[0]&&this.currentState.blocks[0]instanceof F){const e=this.currentState.blocks[0].nodes[0];return e.apply(new st(t)),e}}insertTextToLineBreakNode(t,e){const{startOffset:i,endOffset:o}=this.selectionController.getCurrentRange(),s=t.parentBlock,n=s.nodes.indexOf(t);if(0===i&&i===o&&s.nodes[n+1]){const i=t.cloneWithText(e);return s.apply(new Ae(t,i)),i}return t.apply(new st(e)),t}}class Pe extends Me{handleEvent(){const t=this.selectionController.getSelectedBlocks();t.length&&(t.length<2?this.breakSingleBlock():this.breakMultipleBlocks())}breakMultipleBlocks(){const t=this.selectionController.getSelectedBlocks(),e=this.selectionController.getCurrentRange(),i=this.removeSelectionRange();if(t.length&&"list-item"===t[0].type||"list-item"===t[t.length-1].type){const o=i.parentBlock,s=t[t.length-1];if(o.type!==s.type&&e.startContainer.nodeType===e.endContainer.nodeType){o.apply(new nt(s));const t=new rt(i,i.text.length);return o.apply(t),void this.switchCaretPositionToNextElement(t.newBlock)}}this.selectionController.enqueueSelectionRangeFutureState(i,e.startOffset)}breakSingleBlock(){const t=this.removeSelectionRange(),e=t.parentBlock,{startOffset:i}=this.selectionController.getCurrentRange();if(e){const o=new yt(t,i);e.apply(o),this.switchCaretPositionToNextElement(o.newBlock)}}switchCaretPositionToNextElement(t){t&&t.nodes&&this.selectionController.enqueueSelectionRangeFutureState(t.nodes[0],0)}}class Fe extends Q{constructor(t,e){super(),this.type=tt.LINE_BREAK_SINGLE_BLOCK,this.startContainerNode=t,this.startOffset=e}}class Ve extends Q{constructor(t){super(),this.type=tt.LINE_BREAK_MULTIPLE_BLOCKS,this.selectedBlocks=t}}class Ue extends Me{handleEvent(){const t=this.selectionController.getCurrentRange(),e=this.selectionController.getSelectedBlocks();this.isRootContainer(t.startContainer)&&this.breakNewBlock(),e.length&&(e.length<2?this.breakSingleBlock():this.breakMultipleBlocks())}breakNewBlock(){if(this.currentState&&this.currentState.blocks[0]&&this.currentState.blocks[0]instanceof F){const t=new Fe(this.currentState.blocks[0].nodes[0],0);this.currentState.blocks[0].apply(t),this.switchCaretPositionToSpecifiedNode(t.lineBreakNode)}}breakSingleBlock(){const t=this.selectionController.getCurrentRange(),e=this.removeSelectionRange(),i=e.parentBlock;if(i){const o=new Fe(e,t.startOffset);i.apply(o),this.switchCaretPositionToSpecifiedNode(o.lineBreakNode)}}breakMultipleBlocks(){const t=this.selectionController.getSelectedBlocks(),e=this.removeSelectionRange(),i=new Ve(t);e.parentBlock.apply(i),this.switchCaretPositionToSpecifiedNode(i.lineBreakNode)}switchCaretPositionToSpecifiedNode(t){this.selectionController.enqueueSelectionRangeFutureState(this.getNextRTENode(t),0)}getNextRTENode(t){const e=t.parentBlock.nodes.indexOf(t);return t.parentBlock.nodes[e+1]||t}}class Ke extends Q{constructor(t,e){super(),this.type=tt.DELETE_BLOCK_CONTENT,this.startContainerNode=t,this.startOffset=e}}class We extends Me{handleEvent(){this.selectionController.getSelectedBlocks().length<2?this.deleteContentWithSingleBlock():this.deleteContentWithMultipleNodes()}deleteContentWithSingleBlock(){const t=this.selectionController.getCurrentRange(),{startOffset:e,endOffset:i,startContainer:o,endContainer:s}=t,n=this.selectionController.getSelectedBlocks(),r=this.selectionController.getSelectedNodes();if(e!==i||o!==s)this.deleteContentWithMultipleNodes();else if(n[0]){const t=new Ke(r[0],e);if(n[0].apply(t),t.previousNode){const i=t.previousNode===r[0]?Math.max(0,e-1):this.getNodeEndOffset(t.previousNode);this.selectionController.enqueueSelectionRangeFutureState(t.previousNode,i)}else t.nextNode?this.selectionController.enqueueSelectionRangeFutureState(t.nextNode,0):0===this.currentState.blocks.length&&this.insertDefaultParagraph()}}deleteContentWithMultipleNodes(){const t=this.selectionController.getSelectedNodes(),e=this.removeSelectionRange(!0),i=t[t.length-1];t.length>1&&i instanceof B&&i.isEmpty()&&i.parentBlock.apply(new ct(i)),this.convertFirstBlockToParagraph(e.parentBlock)}convertFirstBlockToParagraph(t){if(this.currentState.blocks[0]===t&&t instanceof F&&1===t.nodes.length&&t.nodes[0].isEmpty()&&"paragraph"!==t.type){const e=this.createEmptyParagraph();e.apply(new lt(t.nodes)),t.parent.apply(new at(t,e)),t.parent.apply(new ct(t))}}insertDefaultParagraph(){const t=this.createEmptyParagraph();this.currentState.apply(new it([t])),this.selectionController.enqueueSelectionRangeFutureState(t.nodes[0],1)}getNodeEndOffset(t){return"IMAGE"===t.type?1:"TEXT"===t.type?"\n"===t.text?0:t.text.length:void 0}}class _e{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(){const t=this.currentStrategy.handle(this.currentElements);return this.childrenOutput.length>0&&t&&this.currentStrategy.appendChildBlocks(t,this.childrenOutput.map((t=>t.toDto())).filter(Bt)),t}}class Ge extends class{}{generateChildNodes(t,e={}){const i=[];return t.forEach((t=>{if(t.nodeType===Node.TEXT_NODE){if(this.isInvalidTextNode(t))return;i.push({id:vt(),type:"text",text:String(t.textContent),annotations:e})}else i.push(...this.generateChildNodes(Array.from(t.childNodes),Object.assign({},e,this.generateTextNodeAnnotations(t,e))))})),i}generateBlockAnnotations(t){const e={},i=this.getTextAlign(t),o=this.getIndent(t);return i&&(e.textAlign=i),o&&(e.indent=o),e}generateTextNodeAnnotations(t,e={}){if(this.isCode(t))return{code:!0};const i={bold:this.isBold(t),italic:this.isItalic(t),underline:this.isUnderline(t),strikethrough:this.isStrikethrough(t)};e.bold&&(i.bold=!0),e.underline&&(i.underline=!0),e.italic&&(i.italic=!0),e.strikethrough&&(i.strikethrough=!0);const o=this.getColor(t),s=this.getLink(t);return o&&(i.textColor=o),s&&(i.link=s),i}isInvalidTextNode(t){return!(!t.nodeValue||!t.nodeValue.includes("\t")||0!==t.nodeValue.replace(/\n|\t/gm,"").length)}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"monospace"===t.style.fontFamily}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||"bold"===t.style.fontWeight||"700"===t.style.fontWeight}isItalic(t){return"I"===t.nodeName||"italic"===t.style.fontStyle||"EM"===t.nodeName}isUnderline(t){return t.style.textDecoration.includes("underline")||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}isStrikethrough(t){return t.style.textDecoration.includes("line-through")||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}getColor(t){var e;const i=null===(e=It(t.style.color))||void 0===e?void 0:e.toUpperCase();if(i){const t=ht.find((t=>t.light===i||t.dark===i));return t?t.key:null}for(const e of ht)if(t.style.color.includes(e.key))return e.key;return null}getLink(t){return"A"===t.nodeName?{href:t.href,groupKey:vt()}:null}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}getIndent(t){const e=t.style;let i;if(e.marginLeft)i=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:i=t[3];break;case 2:case 3:i=t[1];break;default:i=t[0]}}}const o=Number(i.replace("px",""));return o&&o>=0?Math.floor(o/16):null}}class qe extends Ge{canHandle(t,e){let i=0;for(let o=e;o<t.length;o++){const e=t[o];if(e.nodeType!==Node.TEXT_NODE&&(!qe.canHandleTags.includes(e.nodeName)||""===e.textContent&&e.querySelector("IMG")))break;i++}return i}handle(t){const e=t[0].parentElement,i=this.generateChildNodes(t,this.generateTextNodeAnnotations(e));return 0===i.length?null:F.from({id:vt(),type:"paragraph",nodes:i,annotations:this.generateBlockAnnotations(e)})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}qe.canHandleTags=["SPAN","STRONG","CODE","I","EM","S","U","A","VEGA-RICH-TEXT-LINK-EDITOR","B","INS","DEL"];class $e extends Ge{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t){return 0===t[0].childNodes.length?null:Rt.from({id:vt(),type:"bullet-list",blocks:[],annotations:this.generateBlockAnnotations(t[0])})}appendChildBlocks(t,e){t.blocks=e,e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}class Je extends Ge{canHandle(t,e){return"LI"===t[e].tagName?1:0}handle(t){return 0===t[0].childNodes.length?null:wt.from({id:vt(),type:"list-item",nodes:this.generateChildNodes(Array.from(t[0].childNodes).filter((t=>!["UL","OL"].includes(t.nodeName))),this.generateTextNodeAnnotations(t[0])),annotations:this.generateBlockAnnotations(t[0])})}appendChildBlocks(t,e){t.children=e.filter((t=>["bullet-list","number-list"].includes(t.type)))}shouldProceedToElementChildren(){return!0}}class Xe extends Ge{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(this.getElementType(t[e]))?1:0}handle(t){const e=this.generateChildNodes(t);return 0===e.length?null:F.from({id:vt(),type:this.getElementType(t[0]),nodes:e,annotations:Object.assign(Object.assign({},this.generateBlockAnnotations(t[0])),{textStyle:this.getElementType(t[0])})})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}getElementType(t){var e;if(t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type"))return t.getAttribute("data-type");switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3"}switch(t.nodeName){case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return""}}}class Ye extends Ge{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t){const e=t[0];return jt.from({id:vt(),type:"image",nodes:[{id:vt(),type:"image",url:e.src,annotations:{size:"md",alt:e.alt}}],annotations:this.generateBlockAnnotations(e)})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class Ze extends Ge{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t){const e=t[0],i=e.querySelector("img");if(Bt(i))return jt.from({id:vt(),type:"image",nodes:[{id:vt(),type:"image",url:i.src,annotations:{size:e.size||"md",alt:e.alt}}],annotations:this.generateBlockAnnotations(e)})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class Qe extends Ge{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t){return 0===t[0].childNodes.length?null:Rt.from({id:vt(),type:"number-list",blocks:[],annotations:this.generateBlockAnnotations(t[0])})}appendChildBlocks(t,e){t.blocks=e,e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}class ti extends Ge{canHandle(t,e){const i=t[e];return i.nodeType===Node.ELEMENT_NODE&&""===i.textContent&&i.querySelector("img")?1:0}handle(t){const e=t[0].querySelector("img");return jt.from({id:vt(),type:"image",nodes:[{id:vt(),type:"image",url:e.src,annotations:{size:"md",alt:e.alt}}],annotations:this.generateBlockAnnotations(e)})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ei extends Ge{canHandle(t,e){const i=t[e],o=i.parentElement;return"LI"!==i.nodeName&&o&&["UL","OL"].includes(o.nodeName)?1:0}handle(t){const e=this.generateChildNodes(t);return 0===e.length?null:wt.from({id:vt(),type:"list-item",nodes:e,annotations:{}})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ii extends Ge{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,i=e.dataset.language;return dt.from({id:vt(),type:"code-block",content:t,language:i})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class oi extends ii{canHandle(t,e){return"VEGA-CODE-BLOCK"===t[e].tagName&&0==!!t[e].querySelector("vega-code-block")||this.isCodeBlockContainer(t[e])?1:0}handle(t){const e=this.isCodeBlockContainer(t[0])?t[0].querySelector("vega-code-block"):t[0],i=e.querySelector("code");if(i)return super.handle([i]);if(e.hasAttribute("data-content")){const t=document.createElement("code");return t.textContent=e.dataset.content,t.dataset.language=e.dataset.language,super.handle([t])}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isCodeBlockContainer(t){return"PRE"===t.tagName&&t.classList.contains("code-block-container")&&1===t.querySelectorAll("vega-code-block").length}}class si{constructor(){this.elementStrategies=[new $e,new Qe,new ei,new Je,new oi,new ii,new Xe,new Ye,new Ze,new ti,new qe]}process(t){const e=[];for(let i=0;i<t.length;i++){if(this.isInvalidElement(t[i]))continue;let o=0;for(const s of this.elementStrategies)if(o=s.canHandle(t,i),o>0){const n=t.slice(i,i+o),r=new _e(s,n);1===o&&s.shouldProceedToElementChildren()&&r.setChildrenOutput(this.process(Array.from(n[0].childNodes))),e.push(r),i+=o-1;break}if(0===o&&i<t.length){const o=Array.from(t[i].childNodes),s=this.process(Array.from(o));s.length>0&&e.push(...s)}}return e}isInvalidElement(t){return t.nodeType===Node.COMMENT_NODE||["META","BUTTON","STYLE"].includes(t.nodeName)}}class ni extends Me{constructor(){super(...arguments),this.elementToDTOProcessor=new si}handleEvent(t){const e=this.parsePastedElements(t),{startContainer:i}=this.selectionController.getCurrentRange();this.isRootContainer(i)?this.insertBlocksToRoot(e):this.isEmptyParagraph(i)?this.insertBlocksBeforeEmptyBlock(e):this.insertBlocksToContent(e)}insertBlocksToRoot(t){this.currentState.apply(new it(t))}insertBlocksToContent(t){const e=this.removeSelectionRange();if(e&&e.parentBlock){const i=e.parentBlock,{startOffset:o}=this.selectionController.getCurrentRange(),s=new rt(e,o);i.apply(s),i.parent.apply(new ut(i,...t)),this.switchCaretPositionToNextElement(s.newBlock)}}insertBlocksBeforeEmptyBlock(t){const e=this.removeSelectionRange(),i=null==e?void 0:e.parentBlock;i&&(i.parent.apply(new at(i,...t)),this.switchCaretPositionToNextElement(i))}parsePastedElements(t){let e=t.dataTransfer.getData("text/html");if(!e){const i=t.dataTransfer.getData("text/plain");e=this.parsePlainText(i)}const i=document.createElement("div");return i.innerHTML=e,this.elementToDTOProcessor.process(Array.from(i.childNodes)).filter(Boolean).map((t=>t.toDto())).filter(Boolean)}switchCaretPositionToNextElement(t){t&&t.nodes&&this.selectionController.enqueueSelectionRangeFutureState(t.nodes[0],0)}parsePlainText(t){return t.split("\n").map((t=>`<span>${t}</span>`)).join("<span>\n</span>")}}var ri=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ci extends l{constructor(){super(...arguments),this.insertTextHandler=new Ne,this.insertParagraphHandler=new Pe,this.insertLineBreakHandler=new Ue,this.deleteContentHandler=new We,this.insertPasteHandler=new ni,this.handleUserInputAction=t=>{const e=t.inputType;if(t.preventDefault(),this.initValueIfEmpty(),"insertCompositionText"===e||this.isFocusNodeNonEditable())return;this.insertCompositionTextController.removeObserver();let i=!1;switch(e){case"insertParagraph":i=!0,this.insertParagraphHandler.execute(this.value,this.selectionController,this.host,t);break;case"insertText":i=!0,this.insertTextHandler.execute(this.value,this.selectionController,this.host,t);break;case"insertLineBreak":i=!0,this.insertLineBreakHandler.execute(this.value,this.selectionController,this.host,t);break;case"deleteContentBackward":i=!0,this.deleteContentHandler.execute(this.value,this.selectionController,this.host,t);break;case"insertFromPaste":i=!0,this.insertPasteHandler.execute(this.value,this.selectionController,this.host,t)}i&&this.valueController.flushChanges(this.value)}}addActionListener(){const t=this.getEditableElementRef();t&&(t.addEventListener("beforeinput",this.handleUserInputAction),t.addEventListener("drop",this.preventDropEvent))}removeActionListener(){const t=this.getEditableElementRef();t&&(t.removeEventListener("beforeinput",this.handleUserInputAction),t.removeEventListener("drop",this.preventDropEvent))}getEditableElementRef(){return this.editableElementRef||(this.editableElementRef=this.vegaRichTextEditorRenderer.getRTEEditableElementRef()),this.editableElementRef}preventDropEvent(t){t.preventDefault()}initValueIfEmpty(){if(!this.value){const t=vt();this.valueController.flushChanges(Ct.fromJSON([{id:t,type:"paragraph",nodes:[{id:`${t}1`,type:"text",text:""}]}]))}}isFocusNodeNonEditable(){const{startContainer:t,endContainer:e}=this.selectionController.getCurrentRange(),i=this.selectionController.getSelectedNodes();if(t&&t===e&&0===i.length){const e=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;return e&&e.classList.contains(dt.CODE_BLOCK_PLACEHOLDER_CLASS_NAME)}return!1}}ri([r()],ci.prototype,"host",void 0),ri([r()],ci.prototype,"value",void 0),ri([r()],ci.prototype,"valueController",void 0),ri([r()],ci.prototype,"vegaRichTextEditorRenderer",void 0),ri([r()],ci.prototype,"selectionController",void 0),ri([r()],ci.prototype,"insertCompositionTextController",void 0),ri([c("componentDidLoad")],ci.prototype,"addActionListener",null),ri([c("disconnectedCallback")],ci.prototype,"removeActionListener",null);class li extends Q{constructor(t,e,i){super(),this.isFlushable=!0,this.type=tt.INSERT_IMAGE_TO_BLOCK,this.splitPointNode=t,this.startOffsetOfNode=e,this.imageBlockToBeInserted=i}}var ai=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class hi extends l{insertImageToCaretPosition(t){const e=this.selectionController.getSelectedBlocks(),i=new jt(vt()),o=new Z(vt(),t,i);if(o.apply(new T("md","")),i.apply(new it([o])),e.length<1||this.value.blocks.length<1)this.value.apply(new it([i])),this.valueController.flushChanges(this.value);else{const{startOffset:t}=this.selectionController.getCurrentRange(),o=this.selectionController.getSelectedNodes();e[0].apply(new li(o[0],t,i))}return this.updateCaretPosition(o),o}registerObserver(){this.registerImageSelectedObserver()}unRegisterObserver(){this.removeImageSelectedObserver()}updateCaretPosition(t){this.selectionController.enqueueSelectionRangeFutureState(t,1)}registerImageSelectedObserver(){const t=this.vegaRichTextEditorRenderer.getRichTextContentRef();t&&(ft.addUniqueObserverToNode(t,k,(t=>{const e=this.selectionController.getCurrentRange();if(!e||e.startContainer!==t.host||0!==e.startOffset){const e=pt.getEntityByDOM(t.host.querySelector("img"));this.selectionController.enqueueSelectionRangeFutureState(e,0,e,0,!0)}})),ft.addUniqueObserverToNode(t,O,(t=>{const e=this.selectionController.getCurrentRange();e&&e.startContainer===t.host&&1===e.startOffset||this.selectionController.enqueueSelectionRangeFutureState(t.host,1,t.host,1,!0)})))}removeImageSelectedObserver(){const t=this.vegaRichTextEditorRenderer.getRichTextContentRef();t&&(ft.removeUniqueObserverFromNode(t,k),ft.removeUniqueObserverFromNode(t,O))}}ai([r()],hi.prototype,"selectionController",void 0),ai([r()],hi.prototype,"value",void 0),ai([r()],hi.prototype,"valueController",void 0),ai([r()],hi.prototype,"vegaRichTextEditorRenderer",void 0),ai([c("componentDidLoad")],hi.prototype,"registerObserver",null),ai([c("disconnectedCallback")],hi.prototype,"unRegisterObserver",null);var di=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ui extends l{constructor(){super(...arguments),this.doFocusOnLastTextNode=async t=>{this.setCaretRangeToNodeEnd(pt.getDOMByEntity(t.getLastNode()).firstChild),await this.vegaRichTextEditorRenderer.getRichTextContentRef().vegaFocus()}}async focusOnLastTextNode(t){const e=this.value.blocks[this.value.blocks.length-1];if(e instanceof F&&!(null==t?void 0:t.newLine))await this.doFocusOnLastTextNode(e);else{const t=F.from({id:vt(),type:"paragraph",nodes:[{id:vt(),type:"text",text:""}]});e.parent.apply(new ut(e,t)),await this.valueController.flushChanges(this.value),await this.doFocusOnLastTextNode(t)}}setCaretRangeToNodeEnd(t){const e=new Range;e.setStart(t,t.nodeValue.length),this.selectionController.setSelectionRange(e)}}di([r()],ui.prototype,"vegaRichTextEditorRenderer",void 0),di([r()],ui.prototype,"selectionController",void 0),di([r()],ui.prototype,"valueController",void 0),di([r()],ui.prototype,"value",void 0);var pi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class fi extends l{connectedCallback(){this.observer=new Lt(this.isAcceptObserver.bind(this),(t=>{L.getTextNodeElements().forEach(((e,i)=>{i.style.color=t?e.textColor.dark:e.textColor.light}))})),f.register(Tt,this.observer)}disconnectResizeObserver(){f.unregister(Tt,this.observer)}isAcceptObserver(){return!0}}pi([c("connectedCallback")],fi.prototype,"connectedCallback",null),pi([c("disconnectedCallback")],fi.prototype,"disconnectResizeObserver",null);var vi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class mi extends l{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.observerOptions={characterData:!0,characterDataOldValue:!0,subtree:!0,childList:!0},this.updateTextFromDom=t=>{let e=!1;!1!==this.insertCompositionTextEndFlag&&t.forEach((t=>{const{target:i,oldValue:o}=t;if(i.nodeType===Node.TEXT_NODE&&i.parentElement){const t=pt.getEntityByDOM(i.parentElement),s=i.textContent;t instanceof B?e=this.updateCurrentNodeText(t,s,o):s&&(i.parentElement.removeChild(i),e=!0)}})),e&&this.valueController.flushChanges(this.value)},this.handleObserver=t=>{t.every((t=>"characterData"===t.type))&&this.updateTextFromDom(t)},this.handleCompositionStart=()=>{this.insertCompositionTextEndFlag=!1,f.notify(v.getSubject(this.host,j),{host:this.host,detail:!0})},this.handleCompositionEnd=t=>{this.insertCompositionTextEndFlag=!0;const e=t.data;e&&this.dispatchInsertTextEvent(e)}}initMutationObserver(){if(this.mutationObserver){const t=this.getEditableElementRef();t&&(this.mutationObserver.disconnect(),this.mutationObserver.observe(t,this.observerOptions))}}removeObserver(){this.mutationObserver&&this.mutationObserver.disconnect()}isComposing(){return!this.insertCompositionTextEndFlag}addCompositionTextEventListener(){const t=this.getEditableElementRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd)),this.mutationObserver=new MutationObserver(this.handleObserver),this.initMutationObserver()}removeCompositionTextEventListener(){const t=this.getEditableElementRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd)),this.removeObserver()}reConnectObserver(){this.initMutationObserver()}appendLineBreakNode(t){const e=t.parentBlock,i=e.nodes.indexOf(t);if(e.nodes[i+1]){const o=t.cloneWithText("\n");e.apply(new Ae(e.nodes[i+1],o))}}updateCurrentNodeText(t,e,i){const o=this.removeZeroWidthSpace(e.replace(/(\n)$/,""));if(t.text!==o){const{startOffset:s}=this.selectionController.getCurrentRange(),n="\n"===t.text;t.apply(new st(o)),n&&this.appendLineBreakNode(t);const r=Math.min(o.length,s-(i?i.length-e.length:0));return this.selectionController.enqueueSelectionRangeFutureState(t,Math.max(0,r)),!0}}getEditableElementRef(){return this.editableElementRef||(this.editableElementRef=this.vegaRichTextEditorRenderer.getRTEEditableElementRef()),this.editableElementRef}removeZeroWidthSpace(t){return t.startsWith(ot)?t.slice(ot.length):t.endsWith(ot)?t.slice(0,t.length-ot.length):t}dispatchInsertTextEvent(t){const e=new CustomEvent("beforeinput");e.data=t,e.inputType="insertText",this.editableElementRef.dispatchEvent(e)}}vi([r()],mi.prototype,"selectionController",void 0),vi([r()],mi.prototype,"host",void 0),vi([r()],mi.prototype,"value",void 0),vi([r()],mi.prototype,"valueController",void 0),vi([r()],mi.prototype,"userInputController",void 0),vi([r()],mi.prototype,"vegaRichTextEditorRenderer",void 0),vi([c("componentDidLoad")],mi.prototype,"addCompositionTextEventListener",null),vi([c("disconnectedCallback")],mi.prototype,"removeCompositionTextEventListener",null),vi([c("componentDidRender")],mi.prototype,"reConnectObserver",null);var bi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class gi extends l{constructor(){super(...arguments),this.deleteActionProcess=t=>{const e=this.selectionController.getCurrentRange(),{startContainer:i,endContainer:o,startOffset:s,endOffset:n}=e;if(i!==o||s!==n){const s=this.removeSelectionRange();!(!t||!t.detail)&&t.detail&&this.mergeRangeStartAndEnd(i,o),this.selectionController.enqueueSelectionRangeFutureState(s,e.startOffset)}}}addDeleteObserver(){ft.addUniqueObserverToNode(this.host,j,this.deleteActionProcess)}removeDeleteObserver(){ft.removeUniqueObserverFromNode(this.host,j)}removeSelectionRange(){const t=this.selectionController.getCurrentRange(),e=this.selectionController.getSelectedNodes(),{endOffset:i,startOffset:o}=t,s=e[0],n=e[e.length-1];if(e.length>1&&e.filter((t=>t instanceof A?t!==s:"IMAGE"!==t.type?t!==s&&t!==n:t!==s&&(t!==n||t===n&&0!==i))).forEach((t=>{t.parentBlock.apply(new ct(t))})),this.removeRangeStartAndEndSelectedText(),s instanceof Z&&1!==o&&(n!==s||0!==i)){if(1===s.parentBlock.nodes.length){const t=this.createEmptyParagraph();return s.parentBlock.parent.apply(new at(s.parentBlock,t)),s.parentBlock.apply(new ct(s)),t.nodes[0]}if(s===s.parentBlock.nodes[0])return s.parentBlock.apply(new ct(s)),s.parentBlock.nodes[0]}else if(s instanceof A){const t=this.createEmptyParagraph();return s.parentBlock.parent.apply(new at(s.parentBlock,t)),s.parentBlock.apply(new ct(s)),t.nodes[0]}return s}removeRangeStartAndEndSelectedText(){const t=this.selectionController.getSelectedNodes(),e=this.selectionController.getCurrentRange();t[0]instanceof B&&t[0].apply(new De("",e)),t.length>1&&t[t.length-1]instanceof B&&t[t.length-1].apply(new De("",e))}createEmptyParagraph(){const t=new F(vt(),"paragraph"),e=new B(`${t.id}1`,"",t);return t.apply(new it([e])),t}mergeRangeStartAndEnd(t,e){if(t!==e&&t.nodeType===Node.TEXT_NODE&&e.nodeType===Node.TEXT_NODE){const t=this.selectionController.getSelectedNodes(),e=t[0],i=t[t.length-1];if(e&&e.parentBlock&&i&&i.parentBlock){const t=i.parentBlock;this.shouldMergeTextNode(e,i)&&(e.apply(new st(e.text+i.text)),e.parentBlock===i.parentBlock?e.parentBlock.apply(new ct(i)):i.parentBlock.apply(new ct(i.parentBlock.nodes[0]))),e instanceof B&&i instanceof B&&e.parentBlock!==i.parentBlock&&(e.parentBlock.apply(new it(t.nodes)),t.nodes=[]),t.nodes.length<1&&t.parent.apply(new ct(t))}}}shouldMergeTextNode(t,e){const{annotations:i}=t.toJSON(),{annotations:o}=e.toJSON();return t instanceof B&&e instanceof B&&JSON.stringify(i)===JSON.stringify(o)}}bi([r()],gi.prototype,"host",void 0),bi([r()],gi.prototype,"selectionController",void 0),bi([r()],gi.prototype,"value",void 0),bi([c("connectedCallback")],gi.prototype,"addDeleteObserver",null),bi([c("disconnectedCallback")],gi.prototype,"removeDeleteObserver",null);var xi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class wi extends Ft{constructor(){super((()=>this.getKeyboardShortcutOptions.call(this))),this.redoStack=[],this.undoStack=[],this.registerHistoryDelay=300,this.registerHistoryDebounced=zt((()=>{this.internalRegisterHistory(new ze(this.value,new kt(this.selectionController.getCurrentRange())))}),this.registerHistoryDelay,this)}registerInitState(){this.value&&this.internalRegisterHistory(new ze(this.value,new kt(this.selectionController.getCurrentRange())))}async undo(){if(this.undoStack.length>0){const t=this.undoStack.pop().clone();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e.clone())}}async redo(){if(this.redoStack.length>0){const t=this.redoStack.pop().clone();this.undoStack.push(t),await this.restoreState(t)}}registerHistory(t){this.registerHistoryDebounced(t)}internalRegisterHistory(t){this.redoStack=[],this.undoStack.push(t)}async restoreState(t){const{content:e,selection:i}=t;this.selectionController.setSelectionState(i),await this.valueController.flushChanges(e,!1)}getKeyboardShortcutOptions(){const t={keyCode:"KeyZ",activeElementInScope:[this.vegaRichTextEditorRenderer.getRTEEditableElementRef()],eventName:"keydown",modifierPressed:!0};return[Object.assign(Object.assign({},t),{shiftKey:!1,callback:t=>{t.preventDefault(),this.undo()}}),Object.assign(Object.assign({},t),{shiftKey:!0,callback:t=>{t.preventDefault(),this.redo()}})]}}xi([r()],wi.prototype,"host",void 0),xi([r()],wi.prototype,"vegaRichTextEditorRenderer",void 0),xi([r()],wi.prototype,"valueController",void 0),xi([r()],wi.prototype,"value",void 0),xi([r()],wi.prototype,"selectionController",void 0),xi([c("componentDidLoad")],wi.prototype,"registerInitState",null);class Ci extends Q{constructor(t){super(),this.type=tt.TRANSFORM_TO_CODE_BLOCK,this.selectedBlocks=t}}var yi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ri extends H{constructor(){super({icon:"rectangle-code",tooltip:{text:"Code Block"}})}onClick(){if(!this.isSelected()){const t=this.selectionController.getSelectedBlocks(),e=t[0].parent,i=new Ci(t);e.apply(i),this.valueController.flushChanges(this.value),this.selectionController.enqueueSelectionRangeFutureState(i.newCodeBlock.nodes[0],0)}}isSelected(){const t=this.selectionController.getSelectedBlocks();return!(!t.length||!t.every((t=>"code-block"===t.type)))}isDisabled(){const t=this.selectionController.getSelectedBlocks();return super.isDisabled()||t.some((t=>"image"===t.type||"list-item"===t.type))}}E.register({"rectangle-code":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill=\'currentColor\' d="M320.1 175L384.1 239C394.3 248.4 394.3 263.6 384.1 272.1L320.1 336.1C311.6 346.3 296.4 346.3 287 336.1C277.7 327.6 277.7 312.4 287 303L334.1 256L287 208.1C277.7 199.6 277.7 184.4 287 175C296.4 165.7 311.6 165.7 320.1 175V175zM177.9 256L224.1 303C234.3 312.4 234.3 327.6 224.1 336.1C215.6 346.3 200.4 346.3 191 336.1L127 272.1C117.7 263.6 117.7 248.4 127 239L191 175C200.4 165.7 215.6 165.7 224.1 175C234.3 184.4 234.3 199.6 224.1 208.1L177.9 256zM448 32C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96C0 60.65 28.65 32 64 32H448zM448 80H64C55.16 80 48 87.16 48 96V416C48 424.8 55.16 432 64 432H448C456.8 432 464 424.8 464 416V96C464 87.16 456.8 80 448 80z"/></svg>'}}),yi([r()],Ri.prototype,"selectionController",void 0),yi([r()],Ri.prototype,"valueController",void 0),yi([r()],Ri.prototype,"value",void 0);class ji extends Ot{constructor(){super(1),this.focusNodeOffset=0,this.doTask=async()=>{await this.focusTheCodeBlock(this.shouldFocusNode)}}enqueueSelectionRangeFutureState(t,e,i){this.shouldFocusNode=t,this.focusNodeOffset=e,super.enqueueTheTaskIntoQueue(i)}isCodeBlockSelected(t,e){const i=pt.getDOMByEntity(t.nodes[0]);return t.isSelected()||i&&e.intersectsNode(i.nextSibling)&&e.intersectsNode(i.previousSibling)}async focusTheCodeBlock(t){await Promise.resolve();const e=pt.getDOMByEntity(t);e&&e.doFocus()}}var ki=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Oi=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.vegaImageInserted=s(this,"vegaImageInserted",7),this.imageInserted=s(this,"imageInserted",7),this.globalSlimmers={},this.translationSlimmer=new Nt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.formFieldController=new bt({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new At:null}],validationRulesName:"validationRules",defaultValue:null,attributeGetter:t=>this[t],inputContainerGetter:()=>this.vegaRichTextEditorRenderer.getRichTextContainerRef(),touchableAreaGetter:()=>[this.vegaRichTextEditorRenderer.getRichTextContentRef()]}),this.changeEventEmitter=gt(Oi,b),this.vegaRichTextEditorRenderer=new _t,this.valueController=new Be,this.selectionController=new St,this.focusController=new ui,this.darkModeStateControllerSlimmer=new Et,this.toolbarRenderer=new qt,this.clearStyleToolbarButtonSlimmer=new ee,this.boldToolbarButtonSlimmer=new $t,this.italicToolbarButtonSlimmer=new Xt,this.underlineToolbarButtonSlimmer=new Zt,this.textColorToolbarButtonSlimmer=new z,this.textStylesToolbarButtonSlimmer=new te,this.codeToolbarButtonSlimmer=new ie,this.strikethroughToolbarButtonSlimmer=new se,this.imageToolbarButtonSlimmer=new de,this.linkToolbarButtonSlimmer=new ne,this.moreIndentToolbarButtonSlimmer=new ce,this.lessIndentToolbarButtonSlimmer=new le,this.bulletsNumbersToolbarButtonSlimmer=new xe,this.horizontalAlignmentToolbarButtonSlimmer=new Le,this.codeBlockToolbarButtonSlimmer=new Ri,this.placeholderNotifySlimmer=xt(Oi,"placeholder","watchPlaceholder"),this.disabledNotifySlimmer=xt(Oi,"richTextContentEditable","watchRichTextContentEditable"),this.richTextContentController=new Ie(this),this.userInputController=new ci,this.insertImageController=new hi,this.insertCompositionTextController=new mi,this.imageInsertedEventEmitter=gt(Oi,g),this.changeEventPreventSlimmer=new Dt([b],(()=>this.vegaRichTextEditorRenderer.getRichTextWrapperRef())),this.textNodeColorController=new fi,this.deleteSelectedNodesController=new gi,this.historyController=new wi,this.internalCodeBlockSelectionController=new ji,this.richTextContentEditable=!0,this.selectionMap=new Map,this.isInDarkMode=Pt.isDarkMode(),this.label="",this.required=!1,this.placeholder="",this.disabled=!1,this.hint="",this.rows=4,this.value=Ct.createEmptyContent(),this.toolbarItems=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]],this.isValid=null,this.autoValidation=!0,this.validationRules=[]}watchRichTextContentEditable(){}watchPlaceholder(){}watchDisabled(){this.richTextContentController.syncRichTextContentEditable()}watchValueUpdate(){}watchValidationRules(){}componentWillLoad(){this.richTextContentController.syncRichTextContentEditable()}render(){return u(this.vegaRichTextEditorRenderer.render(),this.host)}get host(){return n(this)}static get watchers(){return{richTextContentEditable:["watchRichTextContentEditable"],placeholder:["watchPlaceholder"],disabled:["watchDisabled"],value:["watchValueUpdate"],validationRules:["watchValidationRules"]}}};ki([d()],Oi.prototype,"globalSlimmers",void 0),ki([a()],Oi.prototype,"translationSlimmer",void 0),ki([a()],Oi.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ki([a()],Oi.prototype,"formFieldController",void 0),ki([a()],Oi.prototype,"changeEventEmitter",void 0),ki([a()],Oi.prototype,"vegaRichTextEditorRenderer",void 0),ki([a()],Oi.prototype,"valueController",void 0),ki([a()],Oi.prototype,"selectionController",void 0),ki([a()],Oi.prototype,"focusController",void 0),ki([a()],Oi.prototype,"darkModeStateControllerSlimmer",void 0),ki([a()],Oi.prototype,"toolbarRenderer",void 0),ki([a()],Oi.prototype,"clearStyleToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"boldToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"italicToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"underlineToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"textColorToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"textStylesToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"codeToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"strikethroughToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"imageToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"linkToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"moreIndentToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"lessIndentToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"bulletsNumbersToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"horizontalAlignmentToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"codeBlockToolbarButtonSlimmer",void 0),ki([a()],Oi.prototype,"placeholderNotifySlimmer",void 0),ki([a()],Oi.prototype,"disabledNotifySlimmer",void 0),ki([a()],Oi.prototype,"richTextContentController",void 0),ki([a()],Oi.prototype,"userInputController",void 0),ki([a()],Oi.prototype,"insertImageController",void 0),ki([a()],Oi.prototype,"insertCompositionTextController",void 0),ki([a()],Oi.prototype,"imageInsertedEventEmitter",void 0),ki([a()],Oi.prototype,"changeEventPreventSlimmer",void 0),ki([a()],Oi.prototype,"textNodeColorController",void 0),ki([a()],Oi.prototype,"deleteSelectedNodesController",void 0),ki([a()],Oi.prototype,"historyController",void 0),ki([a()],Oi.prototype,"internalCodeBlockSelectionController",void 0),Oi.style=':host{display:block}:host vega-field-label{margin-bottom:8px}:host vega-text{margin-bottom:16px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .rich-text-editor-container{display:flex;box-sizing:content-box;position:relative;box-sizing:content-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));margin-top:12px;overflow:auto;resize:vertical;padding-top:12px;padding-right:16px;padding-bottom:32px;padding-left:16px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .rich-text-editor-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .rich-text-editor-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .rich-text-editor-container{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .rich-text-editor-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .rich-text-editor-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}:host .rich-text-editor-container.disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));cursor:not-allowed}:host .rich-text-editor-container.disabled:hover,:host .rich-text-editor-container.disabled:focus-within{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host .rich-text-editor-container.disabled:focus-within{outline:none}:host .rich-text-editor-container.disabled vega-rich-text-content{pointer-events:none;opacity:0.35}:host .rich-text-editor-container.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .rich-text-editor-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .rich-text-editor-container.error:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}:host .rich-text-editor-container .text-editor-counter{position:absolute;bottom:8px;right:8px;display:flex;padding-left:4px;padding-right:4px;padding-top:2px;padding-bottom:2px;border-radius:4px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));background-color:rgba(var(--v-bg-textarea-count, 4, 4, 28, 0.6))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .rich-text-editor-container .text-editor-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .rich-text-editor-container .text-editor-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .rich-text-editor-container .text-editor-counter{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .rich-text-editor-container .text-editor-counter.counter-exceed-max-length{background-color:rgba(var(--v-bg-textarea-counter-exceed-max-length, 214, 46, 81))}.toolbar-btn-group{display:flex;justify-content:center;align-items:center}.toolbar-btn-group>*:not(:first-child):not(:last-child) ::part(rich-text-editor-toolbar-button){border-radius:0px}.toolbar-btn-group>*:first-child:not(:last-child) ::part(rich-text-editor-toolbar-button){border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0px;border-bottom-right-radius:0px}.toolbar-btn-group>*:last-child:not(:first-child) ::part(rich-text-editor-toolbar-button){border-top-left-radius:0px;border-bottom-left-radius:0px;border-top-right-radius:4px;border-bottom-right-radius:4px}.toolbar-btn-group>*:not(:first-child) ::part(rich-text-editor-toolbar-button){margin-left:-1px}.toolbar-btn-group .toolbar-btn-color-preview-box{display:flex;border:1px solid rgba(var(--v-border-chip, 205, 209, 211, 1));box-sizing:border-box;border-radius:4px;width:16px;height:16px;justify-content:center;align-items:center;margin-left:6px}.toolbar-btn-group .toolbar-btn-color-preview-box.disabled{opacity:0.35}.toolbar-btn-group .toolbar-btn-link-wrapper{position:relative}.toolbar-btn-group .toolbar-btn-link-wrapper vega-rich-text-link-editor{position:absolute;bottom:0;left:0;right:0}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;margin-top:12px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';var Si=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Hi extends l{constructor(){super(...arguments),this.handleClick=t=>{this.disabled?t.preventDefault():this.clickEventEmitter.emit(void 0,t)}}render(){return t("button",{part:"rich-text-editor-toolbar-button",class:{"rich-text-editor-toolbar-btn":!0,"rich-text-editor-toolbar-button-disabled":this.disabled,"rich-text-editor-toolbar-button-selected":this.selected},onClick:this.handleClick,disabled:this.disabled},t("vega-flex",{gap:"size-8",justifyContent:"center",alignItems:"center"},t("vega-icon",{size:"size-16",color:this.iconColor,icon:E.getIconKey(this.icon)}),this.showArrowIcon&&t("vega-icon",{size:"size-8",color:"text-secondary",icon:E.getIconKey("chevron-down")})),t("slot",null))}}E.register({"chevron-down":Vt}),Si([r()],Hi.prototype,"disabled",void 0),Si([r()],Hi.prototype,"selected",void 0),Si([r()],Hi.prototype,"showArrowIcon",void 0),Si([r()],Hi.prototype,"icon",void 0),Si([r()],Hi.prototype,"iconColor",void 0),Si([r()],Hi.prototype,"clickEventEmitter",void 0);var Ti=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Li=class{constructor(t){o(this,t),this.vegaClick=s(this,"vegaClick",7),this.click=s(this,"click",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.clickEventEmitter=gt(Li,x),this.eventPrevent=new Dt([x],(()=>this.host),{useCapture:!0,customPreventHandle:t=>{this.disabled&&t.stopImmediatePropagation()}}),this.renderer=new Hi,this.disabled=!1,this.selected=!1,this.showArrowIcon=!1,this.icon="",this.iconColor="text-primary"}render(){return u(t(e,null,this.renderer.render()),this.host)}get host(){return n(this)}};Ti([d()],Li.prototype,"globalSlimmers",void 0),Ti([a()],Li.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Ti([a()],Li.prototype,"clickEventEmitter",void 0),Ti([a()],Li.prototype,"eventPrevent",void 0),Ti([a()],Li.prototype,"renderer",void 0),Li.style=":host{display:inline-block}.rich-text-editor-toolbar-btn{display:flex;justify-content:center;align-items:center;border-radius:4px;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));padding-top:8px;padding-bottom:8px;padding-left:12px;padding-right:12px;cursor:pointer;position:relative;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1))}.rich-text-editor-toolbar-btn:hover{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));z-index:1}.rich-text-editor-toolbar-btn:active{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));z-index:1}.rich-text-editor-toolbar-btn:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:-1px;z-index:2}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-selected{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1));z-index:1}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));cursor:not-allowed}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-disabled vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}";var zi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ei extends l{constructor(){super(...arguments),this.handleKeyDown=t=>{"Enter"===t.key&&(this.formRef.getValue().then((({alt:t})=>{this.changeEventEmitter.emit({action:"edit",payload:{size:this.size,alt:t}})})),this.popoverRef.hide())}}render(){return t("vega-popover",{style:{width:"100%"},trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,ref:t=>{this.popoverRef=t,ft.addUniqueObserverToNode(t,w,(()=>{this.selected=!0,this.notifyImageSelected(),this.formRef.setValue({alt:this.alt})})),ft.addUniqueObserverToNode(t,C,(()=>{this.currentPage=1,this.selected=!1,this.formRef.reset()}))}},t("div",{slot:"popover-content"},t("slot",null)),t("div",{slot:"popover"},this.renderImageEditor(),this.renderAltTextEditor()))}findParentContainerRef(){this.parentContainerRef=Mt(this.host,"vega-rich-text-content")}renderImageEditor(){return t("vega-box",{display:1===this.currentPage?"block":"none"},t("vega-flex",{gap:"size-12",alignItems:"center"},t("vega-font",{variant:"font-field-label-sm",color:"text-primary"},this.translationSlimmer.t("Size"),":"),t("vega-segment-control",{size:"small",segments:[{key:"sm",text:this.translationSlimmer.t("Sm")},{key:"md",text:this.translationSlimmer.t("Md")},{key:"lg",text:this.translationSlimmer.t("Lg")}],selected:this.size,ref:t=>{ft.addUniqueObserverToNode(t,b,(t=>{if(!this.selected)return;const e=t.detail;this.size=e,this.changeEventEmitter.emit({action:"edit",payload:{size:e,alt:this.alt}})}))}}),t("vega-button-group",{variant:"tertiary",size:"small",ref:t=>{ft.addUniqueObserverToNode(t,x,(t=>{"Alt Text"===t.detail?this.currentPage=2:(this.notifyImageDeleteButtonClicked(),this.changeEventEmitter.emit({action:"delete"}),this.popoverRef.hide())}))}},t("vega-button-group-item",{label:this.translationSlimmer.t("Alt Text"),itemKey:"Alt Text"}),t("vega-button-group-item",{label:this.translationSlimmer.t("Delete Image"),icon:E.getIconKey("trash-can"),iconOnly:!0,itemKey:"trash-can"}))))}renderAltTextEditor(){return t("vega-box",{display:2===this.currentPage?"block":"none"},t("vega-form",{ref:t=>this.formRef=t},t("vega-input",{"data-vega-form":"alt",style:{width:"315px"},label:this.translationSlimmer.t("Alt Text"),ref:t=>{t.doFocus()},onKeyDown:this.handleKeyDown})))}notifyImageSelected(){this.parentContainerRef&&f.notify(v.getSubject(this.parentContainerRef,k),{host:this.host})}notifyImageDeleteButtonClicked(){this.parentContainerRef&&f.notify(v.getSubject(this.parentContainerRef,O),{host:this.host})}}E.register({"trash-can":Ut}),zi([r({writable:!0})],Ei.prototype,"currentPage",void 0),zi([r({writable:!0})],Ei.prototype,"selected",void 0),zi([r()],Ei.prototype,"host",void 0),zi([r()],Ei.prototype,"alt",void 0),zi([r({writable:!0})],Ei.prototype,"size",void 0),zi([r()],Ei.prototype,"changeEventEmitter",void 0),zi([r()],Ei.prototype,"translationSlimmer",void 0),zi([c("componentDidLoad")],Ei.prototype,"findParentContainerRef",null);var Bi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ii=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new Nt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.renderer=new Ei,this.changeEventEmitter=gt(Ii,b),this.currentPage=1,this.selected=!1,this.alt="",this.size="md"}render(){return u(t(e,{class:{"rte-image-selected":this.selected}},this.renderer.render()),this.host)}get host(){return n(this)}};Bi([d()],Ii.prototype,"globalSlimmers",void 0),Bi([a()],Ii.prototype,"translationSlimmer",void 0),Bi([a()],Ii.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Bi([a()],Ii.prototype,"renderer",void 0),Bi([a()],Ii.prototype,"changeEventEmitter",void 0),Ii.style=":host{display:inline-block}:host(.rte-image-selected){outline:2px solid rgba(var(--v-border-color-tile-selected, 19, 98, 226, 1));outline-offset:-2px}";var Mi=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ai extends l{constructor(){super(...arguments),this.handleKeyDown=t=>{"Enter"===t.key&&this.formRef.getValue().then((({text:t,url:e})=>{e.length>0&&(this.changeEventEmitter.emit({action:"link",payload:{text:t||e,url:e}}),this.popoverRef.hide())}))}}componentDidLoad(){this.updatePopoverTarget()}componentDidRender(){f.notify(v.getSubject(this.host,y),{})}watchStatusChange(){"linkEdit"===this.status&&setTimeout((()=>{this.urlInputRef.doFocus()}))}watchTargetChange(){this.updatePopoverTarget()}getPopoverRef(){return this.popoverRef}render(){return t("vega-popover",{trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,ref:t=>{this.popoverRef=t,ft.addUniqueObserverToNode(t,w,(()=>{var t,e;"linkEdit"===this.status&&this.urlInputRef.doFocus(),this.formRef.setValue({text:null===(t=this.record)||void 0===t?void 0:t.text,url:null===(e=this.record)||void 0===e?void 0:e.url})})),ft.addUniqueObserverToNode(t,C,(()=>{this.formRef.reset(),this.resetStatusAfterHide&&(this.status="editOrUnlinkSelection")}))}},t("span",{slot:"popover-content"},t("slot",null)),t("div",{slot:"popover"},this.renderLinkUnlinkContent(),this.renderLinkEditContent()))}renderLinkUnlinkContent(){return t("vega-box",{display:"editOrUnlinkSelection"===this.status?"block":"none"},t("vega-button-group",{size:"small",variant:"tertiary",ref:t=>{ft.addUniqueObserverToNode(t,x,(({detail:t})=>{switch(t){case"edit":return void(this.status="linkEdit");case"unlink":this.changeEventEmitter.emit({action:"unlink"}),this.popoverRef.hide()}}))}},t("vega-button-group-item",{label:this.translationSlimmer.t("Edit"),itemKey:"edit"}),t("vega-button-group-item",{label:this.translationSlimmer.t("Unlink"),itemKey:"unlink"})))}renderLinkEditContent(){return t("vega-box",{display:"linkEdit"===this.status?"block":"none"},t("vega-form",{ref:t=>this.formRef=t},t("vega-flex",{style:{width:"419px"},direction:"col",gap:"size-16"},t("vega-input",{"data-vega-form":"url",ref:t=>{this.urlInputRef=t},size:"small",label:this.translationSlimmer.t("URL"),onKeyDown:this.handleKeyDown}),t("vega-input",{size:"small",label:this.translationSlimmer.t("Text"),"data-vega-form":"text",onKeyDown:this.handleKeyDown}))))}updatePopoverTarget(){Kt.call(v.getSubject(this.popoverRef,S),this.target)}}Mi([r()],Ai.prototype,"host",void 0),Mi([r({writable:!0})],Ai.prototype,"status",void 0),Mi([r({writable:!0})],Ai.prototype,"record",void 0),Mi([r()],Ai.prototype,"changeEventEmitter",void 0),Mi([r()],Ai.prototype,"resetStatusAfterHide",void 0),Mi([r()],Ai.prototype,"translationSlimmer",void 0),Mi([r()],Ai.prototype,"target",void 0),Mi([c("componentDidLoad")],Ai.prototype,"componentDidLoad",null),Mi([c("componentDidRender")],Ai.prototype,"componentDidRender",null),Mi([c("watchStatusChange")],Ai.prototype,"watchStatusChange",null),Mi([c("watchTargetChange")],Ai.prototype,"watchTargetChange",null);var Di=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ni=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new Nt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.renderer=new Ai,this.changeEventEmitter=gt(Ni,b),this.status="editOrUnlinkSelection",this.resetStatusAfterHide=!0}watchStatusChange(){}watchTargetChange(){}async show(){await this.renderer.getPopoverRef().show()}render(){return u(t(e,null,this.renderer.render()),this.host)}get host(){return n(this)}static get watchers(){return{status:["watchStatusChange"],target:["watchTargetChange"]}}};Di([d()],Ni.prototype,"globalSlimmers",void 0),Di([a()],Ni.prototype,"translationSlimmer",void 0),Di([a()],Ni.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Di([a()],Ni.prototype,"renderer",void 0),Di([a()],Ni.prototype,"changeEventEmitter",void 0),Ni.style=":host{display:contents}:host vega-popover{display:inline}";export{Oi as vega_rich_text_editor,Li as vega_rich_text_editor_toolbar_button,Ii as vega_rich_text_image_editor,Ni as vega_rich_text_link_editor}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,H as e,g as a}from"./p-21d26bb4.js";import{F as r}from"./p-72e64237.js";import{C as o}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{g as h,b as l,d,c as m,e as c,F as p,a as f}from"./p-5773a9a3.js";import{d as u}from"./p-d27ae9ff.js";import{s as b}from"./p-519a7d55.js";import{f as v,c as j,i as w}from"./p-d5776087.js";import{I as g}from"./p-b28d4f7d.js";import{c as V,I as F}from"./p-6e1ab235.js";import{V as y,I as E}from"./p-4387d550.js";import{c as R}from"./p-012cbd8f.js";import{C as S}from"./p-6b7dca3e.js";import{w as C,x as O,y as I,d as P}from"./p-6e01f0a2.js";import{C as B}from"./p-864de9a1.js";import{d as M}from"./p-425ba7d6.js";import{c as A}from"./p-8e31e7ea.js";import{S as D}from"./p-138fcf6e.js";import"./p-0bb29d98.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-4ab3df00.js";import"./p-834434d5.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-e7b00bf0.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-262ec334.js";import"./p-613ee009.js";import"./p-b75ee3ba.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-112455b1.js";var N=function(t,i,s,e){var a,r=arguments.length,o=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,i,s,e);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(o=(r<3?a(o):r>3?a(i,s,o):a(i,s))||o);return r>3&&o&&Object.defineProperty(i,s,o),o};class x extends D{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation"}]})}}N([V()],x.prototype,"host",void 0),N([V({writable:!0})],x.prototype,"disableBlurValidation",void 0);var H=function(t,i,s,e){var a,r=arguments.length,o=r<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,i,s,e);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(o=(r<3?a(o):r>3?a(i,s,o):a(i,s))||o);return r>3&&o&&Object.defineProperty(i,s,o),o};const k=class{constructor(s){t(this,s),this.vegaValidate=i(this,"vegaValidate",7),this.validate=i(this,"validate",7),this.vegaFormSubmit=i(this,"vegaFormSubmit",7),this.formSubmit=i(this,"formSubmit",7),this.vegaFormReset=i(this,"vegaFormReset",7),this.formReset=i(this,"formReset",7),this.globalSlimmers={},this.submitEventEmitter=R(k,C),this.resetEventEmitter=R(k,O),this.validateEventEmitter=R(k,I),this.disableBlurValidationNotifySlimmer=A(k,"disableBlurValidation","watchDisableBlurValidation"),this.stateController=new x,this.childEventPrevent=new S([C,O],(()=>this.host.querySelector("vega-form")),{customPreventHandle:t=>{t.stopPropagation()}}),this.childFormValidateEventPrevent=new S([I],(()=>this.host),{customPreventHandle:t=>{t.stopPropagation()}}),this.childNotifyObserver=new B(h,(t=>this.updateInternalValidStatus(t))),this.childNodeValueChangeObserver=new B(l,(()=>this.updateInternalTouchedStatus())),this.vegaComponentUsageRuntimeMetricsSlimmer=new y,this.invalidFieldPathMap=new g(new Map,(t=>{this.invalidFieldPathMap=t,this.updateIsValidFlag()})),this.pendingValidFieldPathMap=new g(new Map,(t=>{this.pendingValidFieldPathMap=t,this.updateIsValidFlag()})),this.controlledFieldPathSet=new Set,this.isValid=null,this.isTouched=!1,this.disableBlurValidation=!1,this.updateInternalValidStatus=t=>{if(t.host!==this.host){const i=t.host,s=t.detail;r.isValidFormField(i)&&this.shouldVisitElement(i,!1,!1)&&(s?this.invalidFieldPathMap.delete(i):this.invalidFieldPathMap.set(i,i.dataset.vegaForm))}}}watchIsValid(){this.validateEventEmitter.emit(this.isValid),o.notify(h,{host:this.host,detail:this.isValid})}watchDisableBlurValidation(){}async disconnectedCallback(){o.notify(d,{host:this.host}),o.unregister(d,this.formFieldDisconnectedObserver),o.unregister(m,this.formFieldPendingValidObserver)}async componentDidLoad(){await this.navigateVegaFormChildren((async(t,i)=>{i||this.controlledFieldPathSet.add(this.getFormFieldName(t,!0))})),this.initFormFieldDisconnectedObserver(),this.registerFormSubmitChangeManager(),this.registerFormResetChangeManager(),this.registerFormFieldPendingValidChangeManager()}async valid(t=!0){const i={isValid:!0,invalidFields:[]};return await this.navigateVegaFormChildren((async(s,e)=>{if("function"==typeof s.valid&&e){const e=await s.valid(t);e.isValid||(i.isValid=!1,i.invalidFields.push(...e.invalidFields),i.invalidFieldsErrorMessages=Object.assign(Object.assign({},i.invalidFieldsErrorMessages),e.invalidFieldsErrorMessages))}else{const{isValid:e,message:a}=await this.handleChildFormFieldElementValid(s,t);e||(i.isValid=!1,i.invalidFields.push(this.getFormFieldName(s)),i.invalidFieldsErrorMessages||(i.invalidFieldsErrorMessages={}),i.invalidFieldsErrorMessages[this.getFormFieldName(s)]=a)}})),i}async getValue(t){const i={};return await this.navigateVegaFormChildren((async(s,e)=>{const a=this.getFormFieldName(s);i[a]=e?await s.getValue(t):k.getFormFieldValue(s)}),t),u(i)?Object.values(i):i}async setValue(t,i){t&&(await this.navigateVegaFormChildren((async(s,e)=>{const a=this.getFormFieldName(s);e?await s.setValue(t[a],i):(await s.componentOnReady(),void 0!==t[a]&&("function"==typeof s.setValue?await s.setValue(t[a]):s.value=t[a]))}),i),this.isTouched=!1)}async reset(t={},i){await this.navigateVegaFormChildren((async(s,e)=>{const a=this.getFormFieldName(s);e&&await s.reset(t[a]||{},i)}),i),o.notify(c,{host:this.host,defaultValueMap:t,option:i}),this.isTouched=!1}static getFormFieldValue(t){return void 0===t.value?t.getAttribute("value"):t.value}render(){return b(s(e,null,s("slot",null)),this.host)}updateInternalTouchedStatus(){this.isTouched=!0}async navigateVegaFormChildren(t,i,s=this.host){const e=[];Array.from(s.children).forEach((s=>{r.isValidFormField(s)?this.shouldVisitElement(s,null==i?void 0:i.skipDisabled,null==i?void 0:i.skipInvisible)&&e.push(t(s,"VEGA-FORM"===s.tagName)):e.push(this.navigateVegaFormChildren(t,i,s))})),await Promise.all(e)}updateIsValidFlag(){this.isValid=this.pendingValidFieldPathMap.size>0?null:0===this.invalidFieldPathMap.size}getFormFieldName(t,i){let s=t.dataset.vegaForm;if(i){let i=v(t,"vega-form");for(;i&&i!==this.host;)s=i.dataset.vegaForm+" -> "+s,i=v(i,"vega-form")}return s}shouldVisitElement(t,i,s){return this.getFormFieldName(t)&&(!i||!t.disabled)&&(!s||j(t))}initFormFieldDisconnectedObserver(){this.formFieldDisconnectedObserver=new n(this.canAcceptFormFieldDisconnectedOperation.bind(this),this.updateInvalidFieldPath.bind(this)),o.register(d,this.formFieldDisconnectedObserver)}canAcceptFormFieldDisconnectedOperation(t){return this.invalidFieldPathMap.has(t.host)}async updateInvalidFieldPath(t){this.invalidFieldPathMap.delete(t.host),this.pendingValidFieldPathMap.delete(t.host)}registerFormSubmitChangeManager(){this.formEventsObserver=new n(this.canAcceptFormSubmitEvent.bind(this),this.handleSubmitEvents.bind(this)),o.register(p,this.formEventsObserver)}canAcceptFormSubmitEvent(t){return this.isElementInCurrentForm(t.host)}async handleSubmitEvents(){if((await this.valid()).isValid){const t=await this.getValue();this.submitEventEmitter.emit(t)}}registerFormResetChangeManager(){this.formEventsObserver=new n(this.canAcceptFormResetEvent.bind(this),this.handleResetEvents.bind(this)),o.register(f,this.formEventsObserver)}canAcceptFormResetEvent(t){return this.isElementInCurrentForm(t.host)}async handleResetEvents(){await this.reset(),this.resetEventEmitter.emit()}registerFormFieldPendingValidChangeManager(){this.formFieldPendingValidObserver=new n(this.canAcceptFormFieldPendingValid.bind(this),this.handleFieldPendingValid.bind(this)),o.register(m,this.formFieldPendingValidObserver)}canAcceptFormFieldPendingValid(t){return this.isElementInCurrentForm(t.host)}handleFieldPendingValid(t){"boolean"==typeof t.detail?this.pendingValidFieldPathMap.delete(t.host):this.pendingValidFieldPathMap.set(t.host,t.host.dataset.vegaForm)}isElementInCurrentForm(t){return this.invalidFieldPathMap.has(t)||w(t,this.host)}async handleChildFormFieldElementValid(t,i){const s=P.getSubject(t,M),{isValid:e,message:a}=await new Promise((e=>{const a=setTimeout((()=>{e({isValid:!0,message:""})}),2e3);o.notify(s,{host:t,message:i,promiseResolve:e,timerId:a})}));return{isValid:e,message:a}}get host(){return a(this)}static get watchers(){return{isValid:["watchIsValid"],disableBlurValidation:["watchDisableBlurValidation"]}}};H([E()],k.prototype,"globalSlimmers",void 0),H([F()],k.prototype,"submitEventEmitter",void 0),H([F()],k.prototype,"resetEventEmitter",void 0),H([F()],k.prototype,"validateEventEmitter",void 0),H([F()],k.prototype,"disableBlurValidationNotifySlimmer",void 0),H([F()],k.prototype,"stateController",void 0),H([F()],k.prototype,"childEventPrevent",void 0),H([F()],k.prototype,"childFormValidateEventPrevent",void 0),H([F()],k.prototype,"childNotifyObserver",void 0),H([F()],k.prototype,"childNodeValueChangeObserver",void 0),H([F()],k.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),k.style=":host{display:block}";export{k as vega_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,I as e,V as i,L as s,M as o}from"./p-6e1ab235.js";import{f as n,c as h,i as r}from"./p-d5776087.js";import{I as c}from"./p-eb832119.js";import{c as l}from"./p-6a334573.js";import{P as a}from"./p-834434d5.js";import{P as d,A as u}from"./p-74168615.js";import{A as f}from"./p-b1f65b13.js";import{R as p}from"./p-06fb002a.js";import{C as v}from"./p-2d0d575f.js";import{S as m}from"./p-5773a9a3.js";import{O as g}from"./p-331a62d5.js";import{d as b}from"./p-6e01f0a2.js";import{q as w}from"./p-425ba7d6.js";import{D as j}from"./p-e7b00bf0.js";class R{canRetrieve(){return!0}retrieve(){const t=document.body;return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],R.prototype,"showConfig",void 0);class y{canRetrieve(){return!this.showConfig.isScreenPosition}}class C extends y{canRetrieve(){return super.canRetrieve()&&!!this.showConfig.positionRelativeTo&&!!document.querySelector(this.showConfig.positionRelativeTo)}retrieve(){const t=document.querySelector(this.showConfig.positionRelativeTo);return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],C.prototype,"showConfig",void 0);class x extends y{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,"vega-modal")}retrieve(){return this.getVegaModalShowConfigContainer()}setElementSlot(t,e){var i;const s=null===(i=Array.from(t.children).find((t=>{const e=t.getAttribute("slot");return e&&["content","modal-content"].includes(e)})))||void 0===i?void 0:i.getAttribute("slot");s&&e.setAttribute("slot",s)}getVegaModalShowConfigContainer(){const t=n(this.showConfig.target,"vega-modal"),e=t.shadowRoot.querySelector(".vega-modal-content-with-scroll"),i=t.shadowRoot.querySelector(".modal-dialog");return this.setElementSlot(t,this.showConfig.appendableElement),t.append(this.showConfig.appendableElement),e||i}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t({writable:!0})],x.prototype,"showConfig",void 0);class O extends y{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,".vega-popover")}retrieve(){const t=n(this.showConfig.target,".vega-popover");return t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],O.prototype,"showConfig",void 0);var S=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class E extends i{constructor(){super(...arguments),this.positionRelativeToWrapper=new C,this.vegaPopoverWrapper=new O,this.vegaModalWrapper=new x,this.defaultWrapper=new R}setContainer(){this.setContainerRetrievers();for(const t of this.containerRetrievers)if(t.canRetrieve())return void(this.container=t.retrieve())}setContainerRetrievers(){this.containerRetrievers=[this.positionRelativeToWrapper,this.vegaPopoverWrapper,this.vegaModalWrapper,this.defaultWrapper]}}S([t({writable:!0})],E.prototype,"container",void 0),S([t({writable:!0})],E.prototype,"showConfig",void 0),S([e()],E.prototype,"positionRelativeToWrapper",void 0),S([e()],E.prototype,"vegaPopoverWrapper",void 0),S([e()],E.prototype,"vegaModalWrapper",void 0),S([e()],E.prototype,"defaultWrapper",void 0);class A extends i{getPositionBox(t,e){const i=t||this.getPlacements(),s=e||this.getAlignments(),o=this.getTargetBoundBox(),n=this.getElementBoundBox(),h=this.getElementScrollDimension(),r=this.getSuitablePlacement(h,n,o,i),c=this.getSuitableAlignment(h,n,o,r,s),l=this.calculatePosition(n,o,r,c),a=this.getTranslocationBox(r);return l.placement=r,l.alignment=c,l.left+=a.X,l.top+=a.Y,l}getElementBoundBox(){const t=this.showConfig.appendableElement,e=t.classList.contains("vega-force-hidden");e&&t.classList.remove("vega-force-hidden");const i=t.getBoundingClientRect();return e&&t.classList.add("vega-force-hidden"),{width:i.width,height:i.height,left:i.left,top:i.top}}getPlacements(){const t=this.showConfig.placement;if("string"==typeof t){const e=d.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...d]}getAlignments(){const t=this.showConfig.alignment;if("string"==typeof t){const e=u.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...u]}calculatePosition(t,e,i,s){return{top:this.calculateTop(t,e,i,s),left:this.calculateLeft(t,e,i,s)}}getTranslocationBox(t){const e=Array.isArray(this.showConfig.placement)?this.showConfig.placement[0]:this.showConfig.placement,i=this.getTranslocation(),s={X:0,Y:0};if(f(i)){let o=i.X,n=i.Y;(e&&["left","right"].includes(e)&&["top","bottom"].includes(t)||e&&["top","bottom"].includes(e)&&["left","right"].includes(t))&&(o=i.Y,n=i.X),["bottom","top"].includes(t)&&(s.Y="top"===t?-n:n,s.X=o),["left","right"].includes(t)&&(s.X="left"===t?-o:o,s.Y=n)}return s}calculateLeft(t,e,i,s){switch(i){case"top":case"bottom":return"end"===s?e.left+e.width-t.width:"center"===s?e.left-(t.width-e.width)/2:e.left;case"left":return e.left-t.width;case"right":return e.left+e.width;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}calculateTop(t,e,i,s){switch(i){case"left":case"right":return"end"===s?e.top+e.height-t.height:"center"===s?e.top-(t.height-e.height)/2:e.top;case"top":return e.top-t.height;case"bottom":return e.top+e.height;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}getSuitablePlacement(t,e,i,o){const n=o[0];return o.find((s=>this.hasEnoughSpace(t,s,i,e)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined placement:\n ${n}\n `),n)}getSuitableAlignment(t,e,i,o,n){const h=n[0];return n.find((s=>this.hasEnoughAlignmentSpace(t,i,e,o,s)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined alignment:\n ${h}\n `),h)}hasEnoughAlignmentSpace(t,e,i,s,o){if(["top","bottom"].includes(s))switch(o){case"start":return e.left+i.width<=t.width;case"center":return e.left>=(i.width-e.width)/2&&e.left+e.width/2+i.width/2<=t.width;case"end":return e.left+e.width>=i.width}if(["right","left"].includes(s))switch(o){case"start":return e.top+i.height<=t.height;case"center":return e.top>=(i.height-e.height)/2&&e.top+e.height/2+i.height/2<=t.height;case"end":return e.top+e.height>=i.height}return!1}hasEnoughSpace(t,e,i,s){switch(e){case"top":return i.top>=s.height;case"bottom":return t.height-i.top-i.height>=s.height;case"left":return i.left>=s.width;case"right":return t.width-i.left-i.width>=s.width;default:return!1}}getTranslocation(){const t=this.showConfig.translocation;return t&&p.format(t,"translocation")}}var P=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class k extends A{getPosition(){return"relative"!==window.getComputedStyle(this.container).position&&s.warn("Calculate position should make container as 'position: relative', otherwise the result might not be accurate."),this.getPositionBox()}getTargetBoundBox(){const t=this.container.getBoundingClientRect(),e=this.showConfig.target.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top-t.top+this.container.scrollTop,left:e.left-t.left+this.container.scrollLeft}}getElementScrollDimension(){return{width:this.container.scrollWidth,height:this.container.scrollHeight}}}P([t()],k.prototype,"container",void 0),P([t()],k.prototype,"showConfig",void 0);class T extends A{getPosition(t){const e=t?this.getPositionBox([this.previousPositionBox.placement],[this.previousPositionBox.alignment]):this.getPositionBox();return this.previousPositionBox=e,e}getTargetBoundBox(){const t=this.showConfig.target.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,left:t.left}}getElementScrollDimension(){return{width:window.innerWidth,height:window.innerHeight}}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],T.prototype,"showConfig",void 0);var $=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class D extends i{constructor(){super(...arguments),this.bodyPositionStrategy=new k,this.screenPositionStrategy=new T}setCalculationStrategy(){this.positionStrategy=this.showConfig.isScreenPosition?this.screenPositionStrategy:this.bodyPositionStrategy}adjustPosition(t){this.adjustWidth(),this.adjustHeight(),this.applyPosition(this.positionStrategy.getPosition(t))}applyPosition(t){const e=this.showConfig.appendableElement;this.showConfig.isScreenPosition&&(e.style.position="fixed"),e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.classList.remove("vega-placement-left","vega-placement-right","vega-placement-top","vega-placement-bottom"),e.classList.remove("vega-alignment-start","vega-alignment-center","vega-alignment-end"),e.classList.add(`vega-placement-${t.placement}`),e.classList.add(`vega-alignment-${t.alignment}`)}adjustWidth(){if(this.showConfig.matchTargetWidth){const{width:t}=this.showConfig.target.getBoundingClientRect();this.setRelatedWidth("width",t)}else this.setRelatedWidth("width",this.showConfig.size),this.setRelatedWidth("minWidth",this.showConfig.minWidth),this.setRelatedWidth("maxWidth",this.showConfig.maxWidth)}setRelatedWidth(t,e){if(!e)return;const i=p.format(e,"size");i&&(this.showConfig.appendableElement.style[t]="number"==typeof i?`${i}px`:i)}adjustHeight(){if(this.showConfig.matchContainerHeight&&!this.showConfig.isScreenPosition){const{height:t}=this.showConfig.target.getBoundingClientRect();let e=this.container.scrollHeight-this.showConfig.target.offsetTop-t;this.showConfig.maxHeight&&(e=Math.min(e,this.showConfig.maxHeight)),this.showConfig.appendableElement.style.maxHeight=`${e}px`}else this.showConfig.maxHeight&&(this.showConfig.appendableElement.style.maxHeight=`${this.showConfig.maxHeight}px`)}}$([t()],D.prototype,"container",void 0),$([t()],D.prototype,"showConfig",void 0),$([e()],D.prototype,"bodyPositionStrategy",void 0),$([e()],D.prototype,"screenPositionStrategy",void 0);var B=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class L{constructor(t,e){var i,s;this.resizeObserverSlimmer=l(L,a,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"},{mapFrom:"disconnectResizeObserver",mapTo:"disconnectResizeObserver"}],[{callback:()=>{h(this.showConfig.target)&&h(this.showConfig.appendableElement)&&this.adjustPosition()},target:()=>[document.body,this.showConfig.appendableElement,this.showConfig.target]}]),this.elementAppenderContainerController=new E,this.positionCalculationController=new D,this.showConfigCallback=t,this.showConfigCallbackTarget=e;const o=this.getShowConfig();null===(i=o.appendableElement)||void 0===i||i.classList.add("vega-force-hidden"),null===(s=o.appendableElement)||void 0===s||s.classList.add("vega-element-appender-appendable")}show(){this.setShowConfig(),this.showConfig.target?this.showConfig.appendableElement?(this.prepareShow(),this.adjustPosition(),this.setZIndex(),this.toggleShow(!0),this.connectResizeObserver()):s.error("No appendable element found, please add it at new elementAppender."):s.error("No target element found, please add it at new elementAppender.")}hide(){this.showConfig&&(this.toggleShow(!1),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"))}onScroll(){var t;const e=this.showConfig.target.getBoundingClientRect();!this.showConfig.isScreenPosition||e.left===(null===(t=this.previousTargetRect)||void 0===t?void 0:t.left)&&e.top===this.previousTargetRect.top||this.adjustPosition(!0)}destroy(){this.showConfig&&(this.removeVisibleAppendElement(this.showConfig.appendableElement),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"),this.showConfig.appendableElement.remove(),this.disconnectResizeObserver())}connectResizeObserver(){}disconnectResizeObserver(){}toggleShow(t){t?(this.showConfig.appendableElement.classList.remove("vega-force-hidden"),this.saveVisibleAppendElement(this.showConfig.appendableElement)):(this.showConfig.appendableElement.classList.add("vega-force-hidden"),this.removeVisibleAppendElement(this.showConfig.appendableElement))}saveVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.add(t)}removeVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.delete(t)}resetContainerPosition(){const t=L.containerMap.get(this.container);if(t){const{visibleAppendElements:e,originPosition:i="static"}=t;0===e.size&&(this.container.style.position=i,L.containerMap.delete(this.container))}}setShowConfig(){this.showConfig=this.getShowConfig(),this.showConfig=Object.assign({matchTargetWidth:!1,matchContainerHeight:!1},this.showConfig),this.showConfig.target&&this.showConfig.appendableElement&&this.elementAppenderContainerController.setContainer()}prepareShow(){this.showConfig.isScreenPosition||this.initVisibleAppendElement(),this.showConfig.appendableElement.style.boxSizing="border-box",this.positionCalculationController.setCalculationStrategy()}initVisibleAppendElement(){const t=window.getComputedStyle(this.container).position;L.containerMap.has(this.container)||L.containerMap.set(this.container,{visibleAppendElements:new Set,originPosition:t}),"static"===t&&(this.container.style.position="relative")}adjustPosition(t){this.positionCalculationController.adjustPosition(t)}setZIndex(){c.setZIndex(this.showConfig.appendableElement,"base")}getShowConfig(){return this.showConfigCallback instanceof Function?this.showConfigCallback(this.showConfigCallbackTarget):this.showConfigCallback}}L.containerMap=new Map,B([e()],L.prototype,"resizeObserverSlimmer",void 0),B([e()],L.prototype,"elementAppenderContainerController",void 0),B([e()],L.prototype,"positionCalculationController",void 0);var W,z=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};!function(t){t.SHOW="show",t.HIDE="hide"}(W||(W={}));class M extends i{constructor(t){super(),this.childrenEA=[],this.currentEA=t}componentDidLoad(){this.register()}onShow(){this.notify(W.SHOW)}onHide(){this.notify(W.HIDE)}getParent(){return this.parentEA}getChildren(){return this.childrenEA}notify(t){const e=n(this.showConfig.target,".vega-element-appender-appendable");e&&v.notify(b.getSubject(e,w),{type:t,child:this.currentEA,callback:t=>{this.parentEA=t}})}register(){this.showConfig&&j.addUniqueObserverToNode(this.showConfig.appendableElement,w,(t=>{t.type===W.SHOW?this.childrenEA.push(t.child):t.type===W.HIDE&&(this.childrenEA=this.childrenEA.filter((e=>e!==t.child))),t.callback(this.currentEA)}))}}z([t()],M.prototype,"showConfig",void 0),z([o("componentDidLoad")],M.prototype,"componentDidLoad",null),z([o("show")],M.prototype,"onShow",null),z([o("hide")],M.prototype,"onHide",null);var V=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class F extends i{constructor(t,e,i="isDropdownShow",s=(()=>!1)){super(),this.hierarchyTreeManager=new M(this),this.registerElementAppenderListener=()=>{var t,e,i,s,o,n;this.unRegisterElementAppenderListener(),this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.addEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.addEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.addEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.addEventListener("focusout",this.targetFocusoutHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.addEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.addEventListener("mouseleave",this.elementMouseLeaveHandler)),window.addEventListener("mousedown",this.globalMouseDownHandler),document.addEventListener("scroll",this.globalScrollHandler,{capture:!0}),this.listenShadowRootElementScrolling()},this.targetClickHandler=()=>{this.shouldListenerWork("click")&&(this.isShowing()?this.hide():this.show())},this.targetMouseEnterHandler=()=>{this.shouldListenerWork("hover")&&(!1===this.isShowing()&&this.show(),this.clearDelayHideTimer())},this.targetMouseLeaveHandler=()=>{this.shouldListenerWork("hover")&&this.createDelayHideTimer()},this.targetFocusoutHandler=t=>{var e;t.relatedTarget!==(null===(e=this.showConfig)||void 0===e?void 0:e.appendableElement)&&this.targetMouseLeaveHandler()},this.elementMouseEnterHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseEnterHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.clearDelayHideTimer()},this.elementMouseLeaveHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseLeaveHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.createDelayHideTimer()},this.globalMouseDownHandler=t=>{const e=t.composedPath()[0];!this.hierarchyTreeManager.getChildren().some((t=>t.isShowing()))&&this.shouldListenerWork("custom")&&this.isShowing()&&this.showConfig&&!r(e,this.showConfig.appendableElement)&&!r(e,this.showConfig.target)&&n(e,"vega-modal")===n(this.showConfig.target,"vega-modal")&&this.hide()},this.globalScrollHandler=()=>{var t;this.showConfig&&this.showConfig.isScreenPosition&&this.isShowing()&&(null===(t=this.elementAppender)||void 0===t||t.onScroll())},this.createDelayHideTimer=()=>{this.delayHideTimer=setTimeout((()=>{this.hide(),clearTimeout(this.delayHideTimer)}),F.DELAY_HIDE_TIME)},this.clearDelayHideTimer=()=>{this.delayHideTimer&&clearTimeout(this.delayHideTimer)},this.shouldListenerWork=t=>{const e=this.getTrigger();switch(t){case"custom":return"none"!==e;case"click":return"click"===e;case"hover":return"hover"===e}throw new Error(`Unexpected trigger: ${t}. Expected values are custom, click, or hover.`)},this.showConfigFactory=t,this.getTrigger=e,this.isDropdownShowName=i,this.disableInteractiveGetter=s}connectedCallback(){null===this.elementAppender&&(this.setElementAppender(),this.registerElementAppenderListener())}disconnectedCallback(){this.unRegisterElementAppenderListener(),this.destroyElementAppender()}componentDidLoad(){this.initElementAppender()}getElementAppender(){return this.elementAppender}show(){this.elementAppender&&this.elementAppender.show(),this[this.isDropdownShowName]=!0}hide(){this.elementAppender&&this.elementAppender.hide(),this[this.isDropdownShowName]=!1,this.hierarchyTreeManager.getChildren().map((t=>{t.hide()}))}destroy(){this.destroyElementAppender(),this[this.isDropdownShowName]=!1}updateShowConfigFactory(t){this.showConfigFactory=t,this.initElementAppender()}destroyElementAppender(){this.elementAppender&&(this.elementAppender.destroy(),this.elementAppender=null)}initElementAppender(){this.setShowConfig(),this.setElementAppender(),this.registerElementAppenderListener()}setElementAppender(){this.elementAppender=new L(this.showConfigFactory,this)}isShowing(){return this[this.isDropdownShowName]}setShowConfig(){this.showConfig=this.showConfigFactory()}unRegisterElementAppenderListener(){var t,e,i,s,o,n;this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.removeEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.removeEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.removeEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.removeEventListener("focusout",this.targetMouseLeaveHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.removeEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.removeEventListener("mouseleave",this.elementMouseLeaveHandler)),window.removeEventListener("mousedown",this.globalMouseDownHandler),document.removeEventListener("scroll",this.globalScrollHandler),this.removeShadowRootElementScrolling()}listenShadowRootElementScrolling(){this.shadowRootElementScrollingObserver=new g(this.canAcceptShadowRootScrollEvent.bind(this),this.globalScrollHandler.bind(this)),v.register(m,this.shadowRootElementScrollingObserver)}canAcceptShadowRootScrollEvent(t){return Boolean(this.showConfig&&r(this.showConfig.target,t.host))}removeShadowRootElementScrolling(){v.unregister(m,this.shadowRootElementScrollingObserver)}}F.DELAY_HIDE_TIME=100,V([e()],F.prototype,"hierarchyTreeManager",void 0),V([o("connectedCallback")],F.prototype,"connectedCallback",null),V([o("disconnectedCallback")],F.prototype,"disconnectedCallback",null),V([o("componentDidLoad")],F.prototype,"componentDidLoad",null);export{F as E}
|
|
1
|
+
import{c as t,I as e,V as i,L as s,M as o}from"./p-6e1ab235.js";import{f as n,c as h,i as r}from"./p-d5776087.js";import{I as c}from"./p-eb832119.js";import{c as l}from"./p-6a334573.js";import{P as a}from"./p-834434d5.js";import{P as d,A as u}from"./p-74168615.js";import{A as f}from"./p-b1f65b13.js";import{R as p}from"./p-06fb002a.js";import{C as v}from"./p-2d0d575f.js";import{S as m}from"./p-5773a9a3.js";import{O as g}from"./p-331a62d5.js";import{d as b}from"./p-6e01f0a2.js";import{q as w}from"./p-425ba7d6.js";import{D as j}from"./p-e7b00bf0.js";class R{canRetrieve(){return!0}retrieve(){const t=document.body;return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],R.prototype,"showConfig",void 0);class y{canRetrieve(){return!this.showConfig.isScreenPosition}}class C extends y{canRetrieve(){return super.canRetrieve()&&!!this.showConfig.positionRelativeTo&&!!document.querySelector(this.showConfig.positionRelativeTo)}retrieve(){const t=document.querySelector(this.showConfig.positionRelativeTo);return this.showConfig.appendableElement.parentElement!==t&&t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],C.prototype,"showConfig",void 0);class x extends y{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,"vega-modal")}retrieve(){return this.getVegaModalShowConfigContainer()}setElementSlot(t,e){var i;const s=null===(i=Array.from(t.children).find((t=>{const e=t.getAttribute("slot");return e&&["content","modal-content"].includes(e)})))||void 0===i?void 0:i.getAttribute("slot");s&&e.setAttribute("slot",s)}getVegaModalShowConfigContainer(){const t=n(this.showConfig.target,"vega-modal"),e=t.shadowRoot.querySelector(".vega-modal-content-with-scroll"),i=t.shadowRoot.querySelector(".modal-dialog");return this.setElementSlot(t,this.showConfig.appendableElement),t.append(this.showConfig.appendableElement),e||i}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t({writable:!0})],x.prototype,"showConfig",void 0);class O extends y{canRetrieve(){return super.canRetrieve()&&!!n(this.showConfig.target,".vega-popover")}retrieve(){const t=n(this.showConfig.target,".vega-popover");return t.append(this.showConfig.appendableElement),t}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],O.prototype,"showConfig",void 0);var S=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class E extends i{constructor(){super(...arguments),this.positionRelativeToWrapper=new C,this.vegaPopoverWrapper=new O,this.vegaModalWrapper=new x,this.defaultWrapper=new R}setContainer(){this.setContainerRetrievers();for(const t of this.containerRetrievers)if(t.canRetrieve())return void(this.container=t.retrieve())}setContainerRetrievers(){this.containerRetrievers=[this.positionRelativeToWrapper,this.vegaPopoverWrapper,this.vegaModalWrapper,this.defaultWrapper]}}S([t({writable:!0})],E.prototype,"container",void 0),S([t({writable:!0})],E.prototype,"showConfig",void 0),S([e()],E.prototype,"positionRelativeToWrapper",void 0),S([e()],E.prototype,"vegaPopoverWrapper",void 0),S([e()],E.prototype,"vegaModalWrapper",void 0),S([e()],E.prototype,"defaultWrapper",void 0);class A extends i{getPositionBox(t,e){const i=t||this.getPlacements(),s=e||this.getAlignments(),o=this.getTargetBoundBox(),n=this.getElementBoundBox(),h=this.getElementScrollDimension(),r=this.getSuitablePlacement(h,n,o,i),c=this.getSuitableAlignment(h,n,o,r,s),l=this.calculatePosition(n,o,r,c),a=this.getTranslocationBox(r);return l.placement=r,l.alignment=c,l.left+=a.X,l.top+=a.Y,l}getElementBoundBox(){const t=this.showConfig.appendableElement,e=t.classList.contains("vega-force-hidden");e&&t.classList.remove("vega-force-hidden");const i=t.getBoundingClientRect();return e&&t.classList.add("vega-force-hidden"),{width:i.width,height:i.height,left:i.left,top:i.top}}getPlacements(){const t=this.showConfig.placement;if("string"==typeof t){const e=d.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...d]}getAlignments(){const t=this.showConfig.alignment;if("string"==typeof t){const e=u.filter((e=>e!==t));return[t,...e]}return Array.isArray(t)?t:[...u]}calculatePosition(t,e,i,s){return{top:this.calculateTop(t,e,i,s),left:this.calculateLeft(t,e,i,s)}}getTranslocationBox(t){const e=Array.isArray(this.showConfig.placement)?this.showConfig.placement[0]:this.showConfig.placement,i=this.getTranslocation(),s={X:0,Y:0};if(f(i)){let o=i.X,n=i.Y;(e&&["left","right"].includes(e)&&["top","bottom"].includes(t)||e&&["top","bottom"].includes(e)&&["left","right"].includes(t))&&(o=i.Y,n=i.X),["bottom","top"].includes(t)&&(s.Y="top"===t?-n:n,s.X=o),["left","right"].includes(t)&&(s.X="left"===t?-o:o,s.Y=n)}return s}calculateLeft(t,e,i,s){switch(i){case"top":case"bottom":return"end"===s?e.left+e.width-t.width:"center"===s?e.left-(t.width-e.width)/2:e.left;case"left":return e.left-t.width;case"right":return e.left+e.width;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}calculateTop(t,e,i,s){switch(i){case"left":case"right":return"end"===s?e.top+e.height-t.height:"center"===s?e.top-(t.height-e.height)/2:e.top;case"top":return e.top-t.height;case"bottom":return e.top+e.height;default:throw new Error(`Unexpected placement: ${i}. Expected values are top, bottom, left, or right.`)}}getSuitablePlacement(t,e,i,o){const n=o[0];return o.find((s=>this.hasEnoughSpace(t,s,i,e)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined placement:\n ${n}\n `),n)}getSuitableAlignment(t,e,i,o,n){const h=n[0];return n.find((s=>this.hasEnoughAlignmentSpace(t,i,e,o,s)))||(s.warn(`\n No enough space found for placing element and we will keep using the defined alignment:\n ${h}\n `),h)}hasEnoughAlignmentSpace(t,e,i,s,o){if(["top","bottom"].includes(s))switch(o){case"start":return e.left+i.width<=t.width;case"center":return e.left>=(i.width-e.width)/2&&e.left+e.width/2+i.width/2<=t.width;case"end":return e.left+e.width>=i.width}if(["right","left"].includes(s))switch(o){case"start":return e.top+i.height<=t.height;case"center":return e.top>=(i.height-e.height)/2&&e.top+e.height/2+i.height/2<=t.height;case"end":return e.top+e.height>=i.height}return!1}hasEnoughSpace(t,e,i,s){switch(e){case"top":return i.top>=s.height;case"bottom":return t.height-i.top-i.height>=s.height;case"left":return i.left>=s.width;case"right":return t.width-i.left-i.width>=s.width;default:return!1}}getTranslocation(){const t=this.showConfig.translocation;return t&&p.format(t,"translocation")}}var P=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class k extends A{getPosition(){return"relative"!==window.getComputedStyle(this.container).position&&s.warn("Calculate position should make container as 'position: relative', otherwise the result might not be accurate."),this.getPositionBox()}getTargetBoundBox(){const t=this.container.getBoundingClientRect(),e=this.showConfig.target.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top-t.top+this.container.scrollTop,left:e.left-t.left+this.container.scrollLeft}}getElementScrollDimension(){return{width:this.container.scrollWidth,height:this.container.scrollHeight}}}P([t()],k.prototype,"container",void 0),P([t()],k.prototype,"showConfig",void 0);class T extends A{getPosition(t){const e=t?this.getPositionBox([this.previousPositionBox.placement],[this.previousPositionBox.alignment]):this.getPositionBox();return this.previousPositionBox=e,e}getTargetBoundBox(){const t=this.showConfig.target.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,left:t.left}}getElementScrollDimension(){return{width:window.innerWidth,height:window.innerHeight}}}!function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);n>3&&h&&Object.defineProperty(e,i,h)}([t()],T.prototype,"showConfig",void 0);var $=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class D extends i{constructor(){super(...arguments),this.bodyPositionStrategy=new k,this.screenPositionStrategy=new T}setCalculationStrategy(){this.positionStrategy=this.showConfig.isScreenPosition?this.screenPositionStrategy:this.bodyPositionStrategy}adjustPosition(t){this.adjustWidth(),this.adjustHeight(),this.applyPosition(this.positionStrategy.getPosition(t))}applyPosition(t){const e=this.showConfig.appendableElement;this.showConfig.isScreenPosition&&(e.style.position="fixed"),e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.classList.remove("vega-placement-left","vega-placement-right","vega-placement-top","vega-placement-bottom"),e.classList.remove("vega-alignment-start","vega-alignment-center","vega-alignment-end"),e.classList.add(`vega-placement-${t.placement}`),e.classList.add(`vega-alignment-${t.alignment}`)}adjustWidth(){if(this.showConfig.matchTargetWidth){const{width:t}=this.showConfig.target.getBoundingClientRect();this.setRelatedWidth("width",t)}else this.setRelatedWidth("width",this.showConfig.size),this.setRelatedWidth("minWidth",this.showConfig.minWidth),this.setRelatedWidth("maxWidth",this.showConfig.maxWidth)}setRelatedWidth(t,e){if(!e)return;const i=p.format(e,"size");i&&(this.showConfig.appendableElement.style[t]="number"==typeof i?`${i}px`:i)}adjustHeight(){if(this.showConfig.matchContainerHeight&&!this.showConfig.isScreenPosition){const{height:t}=this.showConfig.target.getBoundingClientRect();let e=this.container.scrollHeight-this.showConfig.target.offsetTop-t;this.showConfig.maxHeight&&(e=Math.min(e,this.showConfig.maxHeight)),this.showConfig.appendableElement.style.maxHeight=`${e}px`}else this.showConfig.maxHeight&&(this.showConfig.appendableElement.style.maxHeight=`${this.showConfig.maxHeight}px`)}}$([t()],D.prototype,"container",void 0),$([t()],D.prototype,"showConfig",void 0),$([e()],D.prototype,"bodyPositionStrategy",void 0),$([e()],D.prototype,"screenPositionStrategy",void 0);var B=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class L{constructor(t,e){var i,s;this.resizeObserverSlimmer=l(L,a,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"},{mapFrom:"disconnectResizeObserver",mapTo:"disconnectResizeObserver"}],[{callback:()=>{h(this.showConfig.target)&&h(this.showConfig.appendableElement)&&this.adjustPosition()},target:()=>[document.body,this.showConfig.appendableElement,this.showConfig.target]}]),this.elementAppenderContainerController=new E,this.positionCalculationController=new D,this.showConfigCallback=t,this.showConfigCallbackTarget=e;const o=this.getShowConfig();null===(i=o.appendableElement)||void 0===i||i.classList.add("vega-force-hidden"),null===(s=o.appendableElement)||void 0===s||s.classList.add("vega-element-appender-appendable")}show(){this.setShowConfig(),this.showConfig.target?this.showConfig.appendableElement?(this.prepareShow(),this.adjustPosition(),this.setZIndex(),this.toggleShow(!0),this.connectResizeObserver()):s.error("No appendable element found, please add it at new elementAppender."):s.error("No target element found, please add it at new elementAppender.")}hide(){this.showConfig&&(this.toggleShow(!1),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"))}onScroll(){var t;const e=this.showConfig.target.getBoundingClientRect();!this.showConfig.isScreenPosition||e.left===(null===(t=this.previousTargetRect)||void 0===t?void 0:t.left)&&e.top===this.previousTargetRect.top||this.adjustPosition(!0)}destroy(){this.showConfig&&(this.removeVisibleAppendElement(this.showConfig.appendableElement),this.resetContainerPosition(),c.removeZIndex(this.showConfig.appendableElement,"base"),this.showConfig.appendableElement.remove(),this.disconnectResizeObserver())}connectResizeObserver(){}disconnectResizeObserver(){}toggleShow(t){t?(this.showConfig.appendableElement.classList.remove("vega-force-hidden"),this.saveVisibleAppendElement(this.showConfig.appendableElement)):(this.showConfig.appendableElement.classList.add("vega-force-hidden"),this.removeVisibleAppendElement(this.showConfig.appendableElement))}saveVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.add(t)}removeVisibleAppendElement(t){const e=L.containerMap.get(this.container);e&&e.visibleAppendElements.delete(t)}resetContainerPosition(){const t=L.containerMap.get(this.container);if(t){const{visibleAppendElements:e,originPosition:i="static"}=t;0===e.size&&(this.container.style.position=i,L.containerMap.delete(this.container))}}setShowConfig(){this.showConfig=this.getShowConfig(),this.showConfig=Object.assign({matchTargetWidth:!1,matchContainerHeight:!1},this.showConfig),this.showConfig.target&&this.showConfig.appendableElement&&this.elementAppenderContainerController.setContainer()}prepareShow(){this.showConfig.isScreenPosition||this.initVisibleAppendElement(),this.showConfig.appendableElement.style.boxSizing="border-box",this.positionCalculationController.setCalculationStrategy()}initVisibleAppendElement(){const t=window.getComputedStyle(this.container).position;L.containerMap.has(this.container)||L.containerMap.set(this.container,{visibleAppendElements:new Set,originPosition:t}),"static"===t&&(this.container.style.position="relative")}adjustPosition(t){this.positionCalculationController.adjustPosition(t)}setZIndex(){c.setZIndex(this.showConfig.appendableElement,"base")}getShowConfig(){return this.showConfigCallback instanceof Function?this.showConfigCallback(this.showConfigCallbackTarget):this.showConfigCallback}}L.containerMap=new Map,B([e()],L.prototype,"resizeObserverSlimmer",void 0),B([e()],L.prototype,"elementAppenderContainerController",void 0),B([e()],L.prototype,"positionCalculationController",void 0);var W,z=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};!function(t){t.SHOW="show",t.HIDE="hide"}(W||(W={}));class M extends i{constructor(t){super(),this.childrenEA=[],this.currentEA=t}componentDidLoad(){this.register()}onShow(){this.notify(W.SHOW)}onHide(){this.notify(W.HIDE)}getParent(){return this.parentEA}getChildren(){return this.childrenEA}notify(t){const e=n(this.showConfig.target,".vega-element-appender-appendable");e&&v.notify(b.getSubject(e,w),{type:t,child:this.currentEA,callback:t=>{this.parentEA=t}})}register(){this.showConfig&&j.addUniqueObserverToNode(this.showConfig.appendableElement,w,(t=>{t.type===W.SHOW?this.childrenEA.push(t.child):t.type===W.HIDE&&(this.childrenEA=this.childrenEA.filter((e=>e!==t.child))),t.callback(this.currentEA)}))}}z([t()],M.prototype,"showConfig",void 0),z([o("componentDidLoad")],M.prototype,"componentDidLoad",null),z([o("show")],M.prototype,"onShow",null),z([o("hide")],M.prototype,"onHide",null);var V=function(t,e,i,s){var o,n=arguments.length,h=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(h=(n<3?o(h):n>3?o(e,i,h):o(e,i))||h);return n>3&&h&&Object.defineProperty(e,i,h),h};class F extends i{constructor(t,e,i="isDropdownShow",s=(()=>!1)){super(),this.hierarchyTreeManager=new M(this),this.registerElementAppenderListener=()=>{var t,e,i,s,o,n;this.unRegisterElementAppenderListener(),this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.addEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.addEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.addEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.addEventListener("focusout",this.targetFocusoutHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.addEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.addEventListener("mouseleave",this.elementMouseLeaveHandler)),window.addEventListener("mousedown",this.globalMouseDownHandler),document.addEventListener("scroll",this.globalScrollHandler,{capture:!0}),this.listenShadowRootElementScrolling()},this.targetClickHandler=()=>{this.shouldListenerWork("click")&&(this.isShowing()?this.hide():this.show())},this.targetMouseEnterHandler=()=>{this.shouldListenerWork("hover")&&(!1===this.isShowing()&&this.show(),this.clearDelayHideTimer())},this.targetMouseLeaveHandler=()=>{this.shouldListenerWork("hover")&&this.createDelayHideTimer()},this.targetFocusoutHandler=t=>{var e;r(t.relatedTarget,null===(e=this.showConfig)||void 0===e?void 0:e.appendableElement)||this.targetMouseLeaveHandler()},this.elementMouseEnterHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseEnterHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.clearDelayHideTimer()},this.elementMouseLeaveHandler=()=>{var t;null===(t=this.hierarchyTreeManager.getParent())||void 0===t||t.elementMouseLeaveHandler(),this.shouldListenerWork("hover")&&!this.disableInteractiveGetter()&&this.createDelayHideTimer()},this.globalMouseDownHandler=t=>{const e=t.composedPath()[0];!this.hierarchyTreeManager.getChildren().some((t=>t.isShowing()))&&this.shouldListenerWork("custom")&&this.isShowing()&&this.showConfig&&!r(e,this.showConfig.appendableElement)&&!r(e,this.showConfig.target)&&n(e,"vega-modal")===n(this.showConfig.target,"vega-modal")&&this.hide()},this.globalScrollHandler=()=>{var t;this.showConfig&&this.showConfig.isScreenPosition&&this.isShowing()&&(null===(t=this.elementAppender)||void 0===t||t.onScroll())},this.createDelayHideTimer=()=>{this.delayHideTimer=setTimeout((()=>{this.hide(),clearTimeout(this.delayHideTimer)}),F.DELAY_HIDE_TIME)},this.clearDelayHideTimer=()=>{this.delayHideTimer&&clearTimeout(this.delayHideTimer)},this.shouldListenerWork=t=>{const e=this.getTrigger();switch(t){case"custom":return"none"!==e;case"click":return"click"===e;case"hover":return"hover"===e}throw new Error(`Unexpected trigger: ${t}. Expected values are custom, click, or hover.`)},this.showConfigFactory=t,this.getTrigger=e,this.isDropdownShowName=i,this.disableInteractiveGetter=s}connectedCallback(){null===this.elementAppender&&(this.setElementAppender(),this.registerElementAppenderListener())}disconnectedCallback(){this.unRegisterElementAppenderListener(),this.destroyElementAppender()}componentDidLoad(){this.initElementAppender()}getElementAppender(){return this.elementAppender}show(){this.elementAppender&&this.elementAppender.show(),this[this.isDropdownShowName]=!0}hide(){this.elementAppender&&this.elementAppender.hide(),this[this.isDropdownShowName]=!1,this.hierarchyTreeManager.getChildren().map((t=>{t.hide()}))}destroy(){this.destroyElementAppender(),this[this.isDropdownShowName]=!1}updateShowConfigFactory(t){this.showConfigFactory=t,this.initElementAppender()}destroyElementAppender(){this.elementAppender&&(this.elementAppender.destroy(),this.elementAppender=null)}initElementAppender(){this.setShowConfig(),this.setElementAppender(),this.registerElementAppenderListener()}setElementAppender(){this.elementAppender=new L(this.showConfigFactory,this)}isShowing(){return this[this.isDropdownShowName]}setShowConfig(){this.showConfig=this.showConfigFactory()}unRegisterElementAppenderListener(){var t,e,i,s,o,n;this.showConfig&&(null===(t=this.showConfig.target)||void 0===t||t.removeEventListener("click",this.targetClickHandler),null===(e=this.showConfig.target)||void 0===e||e.removeEventListener("mouseenter",this.targetMouseEnterHandler),null===(i=this.showConfig.target)||void 0===i||i.removeEventListener("mouseleave",this.targetMouseLeaveHandler),null===(s=this.showConfig.target)||void 0===s||s.removeEventListener("focusout",this.targetMouseLeaveHandler),null===(o=this.showConfig.appendableElement)||void 0===o||o.removeEventListener("mouseenter",this.elementMouseEnterHandler),null===(n=this.showConfig.appendableElement)||void 0===n||n.removeEventListener("mouseleave",this.elementMouseLeaveHandler)),window.removeEventListener("mousedown",this.globalMouseDownHandler),document.removeEventListener("scroll",this.globalScrollHandler),this.removeShadowRootElementScrolling()}listenShadowRootElementScrolling(){this.shadowRootElementScrollingObserver=new g(this.canAcceptShadowRootScrollEvent.bind(this),this.globalScrollHandler.bind(this)),v.register(m,this.shadowRootElementScrollingObserver)}canAcceptShadowRootScrollEvent(t){return Boolean(this.showConfig&&r(this.showConfig.target,t.host))}removeShadowRootElementScrolling(){v.unregister(m,this.shadowRootElementScrollingObserver)}}F.DELAY_HIDE_TIME=100,V([e()],F.prototype,"hierarchyTreeManager",void 0),V([o("connectedCallback")],F.prototype,"connectedCallback",null),V([o("disconnectedCallback")],F.prototype,"disconnectedCallback",null),V([o("componentDidLoad")],F.prototype,"componentDidLoad",null);export{F as E}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,H as t,r as i,c as s,g as o}from"./p-21d26bb4.js";import{R as r}from"./p-280cbcdb.js";import{s as n}from"./p-519a7d55.js";import{P as a,g as l}from"./p-834434d5.js";import{c as p,V as d,M as c,L as h,I as v}from"./p-6e1ab235.js";import{a as f}from"./p-d5776087.js";import{R as g}from"./p-06fb002a.js";import{V as u,I as m}from"./p-4387d550.js";import{D as x}from"./p-e7b00bf0.js";import{n as b,o as w,b as y,q as j,r as I,p as R,d as S,f as D,m as O,D as z,E as C}from"./p-6e01f0a2.js";import{g as E,i as L,j as T}from"./p-425ba7d6.js";import{i as V}from"./p-d27ae9ff.js";import{C as k}from"./p-2d0d575f.js";import{b as A}from"./p-5773a9a3.js";import{c as _}from"./p-86194314.js";import{c as N}from"./p-1ec763ab.js";import{c as P}from"./p-613ddaab.js";import{V as G}from"./p-c9b9322b.js";import{F as U}from"./p-72e64237.js";import{c as F}from"./p-012cbd8f.js";import{C as K}from"./p-6b7dca3e.js";import{N as q,P as M}from"./p-b1f65b13.js";import{M as $}from"./p-78a57a17.js";import{T as B}from"./p-52b8f2d2.js";import{T as H}from"./p-d64b20c2.js";import{r as W}from"./p-77e64f26.js";import"./p-abd7aeaa.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-5f377954.js";import"./p-eb832119.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-0c8bd757.js";import"./p-331a62d5.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-cc63e827.js";import"./p-fa5eb496.js";import"./p-4ab3df00.js";import"./p-fecb4044.js";import"./p-3eb2d433.js";import"./p-0bb29d98.js";import"./p-138fcf6e.js";import"./p-b75ee3ba.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";var J=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Q extends d{constructor(){super(...arguments),this.renderLabel=()=>this.label&&e("div",{class:"vega-input-select-label"},e("span",null,this.label),this.required&&e("span",{class:"vega-input-select-required"},"*")),this.renderErrorMessage=()=>e("div",{class:"vega-input-select-error-message"}),this.renderHelpMessage=()=>e("div",{class:"vega-input-select-hint"},this.hint)}render(){return e(t,{class:f([this.disabled?"vega-input-select-disabled":"",g.formatCustom(this.size)])},this.renderLabel(),this.dropdownRenderer.render(),this.renderErrorMessage(),this.hint&&this.renderHelpMessage())}}J([p()],Q.prototype,"disabled",void 0),J([p()],Q.prototype,"size",void 0),J([p()],Q.prototype,"hint",void 0),J([p()],Q.prototype,"label",void 0),J([p()],Q.prototype,"required",void 0),J([p({componentFieldName:"vegaInputSelectDropdownRenderer"})],Q.prototype,"dropdownRenderer",void 0);var X=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Y extends d{constructor(){super(...arguments),this.onDropdownShow=()=>{this.isDropdownShow=!0},this.onDropdownHide=()=>{this.isDropdownShow=!1}}addDropdownObserver(e){x.addUniqueObserverToNode(e,b,(e=>{this.onDropdownShow(),this.showEventEmitter.emit(e.detail)})),x.addUniqueObserverToNode(e,w,(e=>{this.onDropdownHide(),this.hideEventEmitter.emit(e.detail)})),x.addUniqueObserverToNode(e,y,(async e=>{this.vegaInputSelectValueController.setValue(await e.host.getSelection())})),x.addUniqueObserverToNode(e,j,(e=>{this.searchEventEmitter.emit(e.detail)})),x.addUniqueObserverToNode(e,I,(e=>{this.searchTriggerEventEmitter.emit(e.detail)})),x.addUniqueObserverToNode(e,E,(e=>{const t=Array.from(e).filter((e=>!this.source.find((t=>t.id===e.itemKey)))).map((e=>({id:e.itemKey,displayName:e.label})));this.sourceController.appendSourceItems(t)})),x.addUniqueObserverToNode(e,R,(async()=>{this.vegaInputSelectValueController.setValue("multiple"===this.selectType?[]:"")}))}}X([p({writable:!0})],Y.prototype,"isDropdownShow",void 0),X([p()],Y.prototype,"vegaSearch",void 0),X([p()],Y.prototype,"searchEventEmitter",void 0),X([p()],Y.prototype,"searchTriggerEventEmitter",void 0),X([p()],Y.prototype,"vegaInputSelectValueController",void 0),X([p()],Y.prototype,"sourceController",void 0),X([p()],Y.prototype,"source",void 0),X([p()],Y.prototype,"showEventEmitter",void 0),X([p()],Y.prototype,"hideEventEmitter",void 0),X([p()],Y.prototype,"selectType",void 0);var Z=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ee extends d{constructor(){super(...arguments),this.handleValueChange=(e,t)=>{if("multiple"===this.selectType){t=t;const i=(e=e)?e.filter((e=>this.sourceController.getItem(e))):[];V(i,t,!0)?V(i,e,!0)||this.setValue(i):(this.setValue(i),this.changeEventEmitter.emit(i),k.notify(A,{host:this.host,detail:i}))}else if(e!==t){const t=this.sourceController.getItem(e);this.setValue(t?t.id:""),this.changeEventEmitter.emit(this.value),k.notify(A,{host:this.host,detail:this.value})}}}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){switch(this.selectType){case"single":return null===e||"string"==typeof e;case"multiple":return Array.isArray(e)&&e.every((e=>"string"==typeof e));default:return h.warn(`Invalid input select value ${e} for ${this.selectType} mode`),!1}}}Z([p({writable:!0})],ee.prototype,"value",void 0),Z([p()],ee.prototype,"selectType",void 0),Z([p()],ee.prototype,"changeEventEmitter",void 0),Z([p()],ee.prototype,"host",void 0),Z([p()],ee.prototype,"sourceController",void 0),Z([c("watchValue")],ee.prototype,"handleValueChange",void 0);var te=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ie extends d{constructor(){super(...arguments),this.renderContainer=()=>e("div",{role:"button",class:"vega-input-select-container",ref:e=>this.inputSelectContainer=e,tabIndex:0,"aria-disabled":`${this.disabled}`,onKeyDown:_(),onBlur:this.preventBlur,part:"select-container"},this.renderPrefixIcon(),this.renderSelectContainer(),this.renderToggleIcon()),this.renderPrefixIcon=()=>this.vegaInputSelectPrefixIconRenderer.render(),this.renderToggleIcon=()=>e("div",{class:"vega-input-select-toggle-icon",part:"toggle-icon-container"},e("vega-icon",{part:"toggle-icon",icon:G.getIconKey(this.isDropdownShow?"chevron-up":"chevron-down")})),this.renderSelectContainer=()=>e("div",{class:"vega-input-select-select-container"},e("div",{class:"vega-input-select-selected-box"},"multiple"===this.selectType?this.renderMultipleSelected():this.renderSingleSelected())),this.renderMultipleSelected=()=>this.value.length>0?e("span",{class:"vega-input-select-selected"},this.selectedLabel(this.value)):e("div",{class:"vega-input-select-placeholder"},this.translationSlimmer.t(this.placeholder)),this.renderSingleSelected=()=>{const t=this.sourceController.getItem(this.value);return t?e("span",{class:"vega-input-select-selected",part:"selected-box"},t.displayName):e("div",{class:"vega-input-select-placeholder",part:"placeholder"},this.translationSlimmer.t(this.placeholder))},this.getVegaDropdownProperties=()=>Object.assign({searchable:!0,caseSensitive:!1},this.vegaDropdownProps)}show(){return this.dropdown.show()}hide(){return this.dropdown.hide()}getDropdownRef(){return this.dropdown}getInputSelectContainerRef(){return this.inputSelectContainer}getItemsSlotRef(){return this.itemsSlotRef}render(){return e("vega-dropdown",Object.assign({trigger:"click",source:this.getDropdownSource(),selectType:this.selectType,selectedSourceKey:this.value,matchTargetWidth:!0},this.getVegaDropdownProperties(),{ref:e=>{this.dropdown=e,this.vegaInputSelectDropdownController.addDropdownObserver(e)},isLazyLoading:this.isLazyLoading}),this.renderContainer(),this.renderItemsSlot())}renderItemsSlot(){return this.host.querySelector("[slot=items]")&&e("div",{slot:"items",ref:e=>{this.itemsSlotRef=e}})}preventBlur(e){e.stopImmediatePropagation()}getDropdownSource(){return this.source.map((e=>({key:e.id,label:e.displayName})))}}G.register({"chevron-up":N,"chevron-down":P}),te([p()],ie.prototype,"value",void 0),te([p()],ie.prototype,"source",void 0),te([p()],ie.prototype,"host",void 0),te([p()],ie.prototype,"selectType",void 0),te([p()],ie.prototype,"isDropdownShow",void 0),te([p()],ie.prototype,"vegaDropdownProps",void 0),te([p()],ie.prototype,"placeholder",void 0),te([p()],ie.prototype,"selectedLabel",void 0),te([p()],ie.prototype,"isLazyLoading",void 0),te([p()],ie.prototype,"vegaInputSelectDropdownController",void 0),te([p()],ie.prototype,"vegaInputSelectPrefixIconRenderer",void 0),te([p()],ie.prototype,"sourceController",void 0),te([p()],ie.prototype,"translationSlimmer",void 0),te([p()],ie.prototype,"disabled",void 0);var se=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class oe extends d{constructor(){super(...arguments),this.hasMore=!0}componentDidLoad(){const e=this.getVirtualScroll();e&&x.addUniqueObserverToNode(e,L,this.onScrollToBottom.bind(this))}getVirtualScroll(){var e,t,i;return null===(i=null===(t=null===(e=this.vegaInputSelectDropdownRenderer.getDropdownRef().shadowRoot)||void 0===e?void 0:e.querySelector("vega-dropdown-content-box"))||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector("vega-virtual-scroll")}async onScrollToBottom(e){if(this.sourceLazyLoadCallback&&this.hasMore){this.isLazyLoading=!0;const t=await this.sourceLazyLoadCallback(e.endIndex);this.hasMore=t.hasMore,t.items.length>0&&this.sourceController.appendSourceItems(t.items),this.isLazyLoading=!1}}}se([p()],oe.prototype,"sourceLazyLoadCallback",void 0),se([p({writable:!0})],oe.prototype,"isLazyLoading",void 0),se([p()],oe.prototype,"sourceController",void 0),se([p()],oe.prototype,"vegaInputSelectDropdownRenderer",void 0),se([c("componentDidLoad")],oe.prototype,"componentDidLoad",null);const re=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Specifies whether the system should automatically carry out validation checks on the user's selection in real-time, ensuring that the input adheres to predefined criteria before submission or proceeding further",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Specifies whether the system should automatically carry out validation checks on the user's selection in real-time, ensuring that the input adheres to predefined criteria before submission or proceeding further",payloadValue:e=>!1===e.autoValidation},{payloadKey:"IS_USING_TEMPLATE",payloadDescription:"Contains the data records to be rendered and displayed within the input select",payloadValue:e=>0===e.source.length},{payloadKey:"IS_USING_DATA_SOURCE",payloadDescription:"Contains the data records to be rendered and displayed within the input select",payloadValue:e=>e.source.length>0}];var ne=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ae extends d{constructor(){super(...arguments),this.handleSourceChange=()=>{this.source=q(this.source,M)?this.source:[]}}appendSourceItems(e){this.source=[...this.source,...e]}getItem(e){return this.source.find((t=>t.id===e))}}ne([p({writable:!0})],ae.prototype,"source",void 0),ne([c("watchSource")],ae.prototype,"handleSourceChange",void 0);var le=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class pe extends d{constructor(){super(...arguments),this.mutationObserver=new $({mutationFilter:B("VEGA-DROPDOWN-ITEM"),options:{childList:!0,subtree:!0},callback:()=>this.appendHostItemsToDropdown()})}componentDidLoad(){this.appendHostItemsToDropdown()}appendHostItemsToDropdown(){const e=this.host.querySelector("[slot=items]"),t=this.vegaInputSelectDropdownRenderer.getItemsSlotRef();e&&t&&(t.remove(),this.vegaInputSelectDropdownRenderer.getDropdownRef().append(e))}}le([v()],pe.prototype,"mutationObserver",void 0),le([p()],pe.prototype,"host",void 0),le([p()],pe.prototype,"vegaInputSelectDropdownRenderer",void 0),le([c("componentDidLoad")],pe.prototype,"componentDidLoad",null);var de=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ce extends d{connectedCallback(){this.remotePhoneNumberPrefixIconRenderSubject=S.getSubjectFromParentNodeByEventId(this.host,T)}callRemotePrefixIconRender(...e){if(this.remotePhoneNumberPrefixIconRenderSubject){const t=W.call(this.remotePhoneNumberPrefixIconRenderSubject,...e);if(t)return t}return null}render(){const t=this.callRemotePrefixIconRender(this.prefixIcon);return this.prefixIcon&&e("div",{class:"vega-input-select-prefix-icon"},t||e("vega-icon",{icon:this.prefixIcon,size:"size-16"}))}}de([p()],ce.prototype,"host",void 0),de([p()],ce.prototype,"prefixIcon",void 0),de([c("connectedCallback")],ce.prototype,"connectedCallback",null);var he=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const ve=class{constructor(e){i(this,e),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.vegaSearch=s(this,"vegaSearch",7),this.search=s(this,"search",7),this.vegaSearchTrigger=s(this,"vegaSearchTrigger",7),this.searchTrigger=s(this,"searchTrigger",7),this.vegaShow=s(this,"vegaShow",7),this.vegaHide=s(this,"vegaHide",7),this.globalSlimmers={},this.translationSlimmer=new H,this.sourceController=new ae,this.vegaInputSelectRenderer=new Q,this.vegaInputSelectPrefixIconRenderer=new ce,this.vegaInputSelectDropdownController=new Y,this.vegaInputSelectValueController=new ee,this.vegaInputSelectDropdownRenderer=new ie,this.vegaInputSelectItemsSlotController=new pe,this.formFieldControllerSlimmer=new U({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new r:null}],validationRulesName:"validationRules",defaultValue:e=>"multiple"===e.selectType?[]:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaInputSelectDropdownRenderer.getDropdownRef(),touchableAreaGetter:()=>[this.vegaInputSelectDropdownRenderer.getInputSelectContainerRef()]}),this.pageResizeObserverSlimmer=new a,this.lazyLoadController=new oe,this.changeEventEmitter=F(ve,D),this.searchEventEmitter=F(ve,O),this.searchTriggerEventEmitter=F(ve,I),this.showEventEmitter=F(ve,z),this.hideEventEmitter=F(ve,C),this.eventPrevent=new K([O,I,z,C],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new u(re),this.isDropdownShow=!1,this.currentBreakpoint=l(),this.isLazyLoading=!1,this.label="",this.required=!1,this.selectedLabel=e=>`${e.length} Selected`,this.selectType="single",this.source=[],this.value="multiple"===this.selectType?[]:"",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.disabled=!1,this.placeholder="Please select",this.vegaDropdownProps={},this.size="default"}watchSource(){}watchValue(e,t){}watchValidationRules(){}componentWillLoad(){}async doClose(){await this.vegaInputSelectDropdownRenderer.hide()}async doOpen(){await this.vegaInputSelectDropdownRenderer.show()}async doChange(e){this.vegaInputSelectValueController.setValue(e)}render(){return n(this.vegaInputSelectRenderer.render(),this.host)}get host(){return o(this)}static get watchers(){return{source:["watchSource"],value:["watchValue"],validationRules:["watchValidationRules"]}}};he([m()],ve.prototype,"globalSlimmers",void 0),he([v()],ve.prototype,"translationSlimmer",void 0),he([v()],ve.prototype,"sourceController",void 0),he([v()],ve.prototype,"vegaInputSelectRenderer",void 0),he([v()],ve.prototype,"vegaInputSelectPrefixIconRenderer",void 0),he([v()],ve.prototype,"vegaInputSelectDropdownController",void 0),he([v()],ve.prototype,"vegaInputSelectValueController",void 0),he([v()],ve.prototype,"vegaInputSelectDropdownRenderer",void 0),he([v()],ve.prototype,"vegaInputSelectItemsSlotController",void 0),he([v()],ve.prototype,"formFieldControllerSlimmer",void 0),he([v()],ve.prototype,"pageResizeObserverSlimmer",void 0),he([v()],ve.prototype,"lazyLoadController",void 0),he([v()],ve.prototype,"changeEventEmitter",void 0),he([v()],ve.prototype,"searchEventEmitter",void 0),he([v()],ve.prototype,"searchTriggerEventEmitter",void 0),he([v()],ve.prototype,"showEventEmitter",void 0),he([v()],ve.prototype,"hideEventEmitter",void 0),he([v()],ve.prototype,"eventPrevent",void 0),he([v()],ve.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ve.style=':host{display:inline-block;width:100%;min-width:0px;text-align:left;line-height:normal}:host(.default) .vega-input-select-container{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px}:host(.small) .vega-input-select-container{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px}:host .vega-input-select-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));padding-bottom:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-input-select-label .vega-input-select-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}:host .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:8px;gap:8px;display:block;display:flex;align-items:center;cursor:pointer}:host .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host .vega-input-select-container:focus{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1))}:host .error .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .error .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .error .vega-input-select-container:focus{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}:host(.vega-input-select-disabled) .vega-input-select-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}:host(.vega-input-select-disabled) vega-dropdown{pointer-events:none}:host(.vega-input-select-disabled) .vega-input-select-container{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));--tw-shadow:0 0 #0000;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px}:host(.vega-input-select-disabled) .vega-input-select-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.vega-input-select-disabled) vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host .vega-input-select-select-container{flex-grow:1;min-width:0px}:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-selected{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host(.vega-input-select-disabled) .vega-input-select-selected{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:24px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-placeholder{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .vega-input-select-prefix-icon{text-align:center;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-size:0px}:host .vega-input-select-toggle-icon{width:16px;height:16px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}:host .vega-input-select-hint{padding-left:8px;padding-right:8px;padding-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-input-select-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host vega-dropdown{display:block}';export{ve as vega_input_select}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as t,c as i,H as a,g as n}from"./p-21d26bb4.js";import{s as o}from"./p-519a7d55.js";import{n as s,c as r}from"./p-262ec334.js";import{D as p}from"./p-e7b00bf0.js";import{w as g,B as l,f as h,a as c,L as m}from"./p-6e01f0a2.js";import{a as f}from"./p-d5776087.js";import{C as u}from"./p-6b7dca3e.js";import{c as v}from"./p-012cbd8f.js";import{c as d,M as b,V as x,I as w}from"./p-6e1ab235.js";import{V as S,I as j}from"./p-4387d550.js";import{T as y}from"./p-d64b20c2.js";import{R as C}from"./p-06fb002a.js";import{P as z,g as P}from"./p-834434d5.js";import{k as O,l as k}from"./p-425ba7d6.js";import"./p-5f377954.js";import"./p-eb832119.js";import{F as I}from"./p-4d793cb0.js";import"./p-cc63e827.js";import"./p-fa5eb496.js";import"./p-4ab3df00.js";import"./p-fecb4044.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-613ee009.js";import"./p-6a334573.js";import"./p-b75ee3ba.js";import"./p-b1f65b13.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-37b05e0b.js";import"./p-0c8bd757.js";import"./p-5773a9a3.js";import"./p-112455b1.js";import"./p-7a40e033.js";import"./p-3eb2d433.js";const L=({pageSize:t,current:i,total:a,translationSlimmer:n})=>{const o=a>0?t*(i-1)+1:0,s=Math.min(i*t,a);return e("vega-field-label",{label:n.t("Viewing {0}-{1} of {2}",o,s,a)})},M=({onChange:t,pageCount:i,translationSlimmer:a})=>{let n;const o=()=>{if(n.value){const e=s(r(n.value,1),1,i);t(e),n.value=""}},h=e=>{e.stopPropagation()};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:a.t("Go To")}),e("vega-form",{ref:e=>{p.addUniqueObserverToNode(e,g,o)}},e("vega-input",{"data-vega-form":"paginationGoTo",type:"number",size:"small",showClearIcon:!1,style:{width:"60px"},maskConfig:{type:"number",options:{allowNegative:!1,precision:0}},onVegaChange:h,onChange:h,ref:e=>{n=e,p.addUniqueObserverToNode(e,l,o)}})))},E=({pageSize:t,pageSizeSelectorOptions:i,dropdownProps:a,onChange:n,translationSlimmer:o})=>{const s=i.sort(((e,t)=>e-t)),r=e=>{const t=Number(e.detail);n(t)};return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-8"},e("vega-field-label",{label:o.t("Show")}),e("div",null,e("vega-input-select",{size:"small",source:s.map((e=>({id:e.toString(),displayName:e.toString()}))),value:t.toString(),placeholder:"Page Size",vegaDropdownProps:Object.assign({matchTargetWidth:!1,searchable:!1},a),ref:e=>{p.addUniqueObserverToNode(e,h,r)}})))},R=({total:t,current:i,onChange:a,pageCount:n})=>{const o=t=>{const n=i!==t;return e("li",{key:t,class:f(["vega-pagination-item",i===t?"active":""])},e("button",{onClick:()=>n&&a(t)},t))},s=(t,i,a)=>e("li",{class:f(["vega-pagination-button",i&&"disabled"])},e("vega-button-circle",{variant:"icon-only",icon:t,iconColor:"text-link",size:"small",disabled:i,ref:e=>{p.addUniqueObserverToNode(e,c,a)}}));return e("ul",{class:"vega-pagination"},s("chevron-left",0===t||1===i,(()=>{a(i-1)})),0===t?[o(1)]:((e,t,i=7)=>{if(i<7)throw new Error("Must allow at least 7 pager items");if(i%2==0)throw new Error("Must allow odd number of pager items");if(t<i)return Array(t).fill(0).map(((e,t)=>t+1));const a=Math.max(1,Math.min(t-i+1,e-Math.floor(i/2))),n=new Array(i);for(let e=0;e<i;e+=1)n[e]=e+a;return Number(n[0])>1&&(n[0]=1,n[1]="..."),Number(n[n.length-1])<=t-1&&(n[n.length-1]=t,n[n.length-2]="..."),n})(i,n).map((t=>"string"==typeof t?e("li",{class:"vega-pagination-item pager-ellipsis"},"..."):o(t))),s("chevron-right",0===t||i===n,(()=>{a(i+1)})))};var T=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class N extends x{registerPaginationPageSizeChangeObserver(){p.addUniqueObserverToNode(this.host,O,(e=>{this.pageSize=Number(e.detail)}))}unregisterPaginationPageSizeChangeObserver(){p.removeUniqueObserverFromNode(this.host,O)}}T([d()],N.prototype,"host",void 0),T([d({writable:!0})],N.prototype,"pageSize",void 0),T([b("connectedCallback")],N.prototype,"registerPaginationPageSizeChangeObserver",null),T([b("disconnectedCallback")],N.prototype,"unregisterPaginationPageSizeChangeObserver",null);var _=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class A extends x{registerPaginationCurrentChangeObserver(){p.addUniqueObserverToNode(this.host,k,(e=>{this.current=Number(e.detail)}))}unregisterPaginationCurrentChangeObserver(){p.removeUniqueObserverFromNode(this.host,k)}}_([d()],A.prototype,"host",void 0),_([d({writable:!0})],A.prototype,"current",void 0),_([b("connectedCallback")],A.prototype,"registerPaginationCurrentChangeObserver",null),_([b("disconnectedCallback")],A.prototype,"unregisterPaginationCurrentChangeObserver",null);var V=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class B extends z{constructor(){super({callback:()=>{this.calculatePaginationLayout()}}),this.calculatePaginationLayout=()=>{if("vertical"===this.currentLayout)this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal");else{this.host.classList.remove("vega-pagination-vertical"),this.host.classList.add("vega-pagination-horizontal");const e=this.host.offsetHeight;Array.from(this.host.shadowRoot.children).filter((e=>"VEGA-FLEX"===e.tagName)).every((t=>e>t.offsetHeight))&&(this.host.classList.add("vega-pagination-vertical"),this.host.classList.remove("vega-pagination-horizontal"))}}}componentWillLoad(){this.setCurrentLayout()}watchCurrentBreakpoint(){this.setCurrentLayout()}watchLayout(){this.setCurrentLayout(),this.calculatePaginationLayout()}setCurrentLayout(){this.currentLayout=C.formatCustom(this.layout)}}V([d()],B.prototype,"host",void 0),V([d()],B.prototype,"layout",void 0),V([b("componentWillLoad")],B.prototype,"componentWillLoad",null),V([b("watchCurrentBreakpoint")],B.prototype,"watchCurrentBreakpoint",null),V([b("watchLayout")],B.prototype,"watchLayout",null);var W=function(e,t,i,a){var n,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const G=class{constructor(a){t(this,a),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaPageSizeChange=i(this,"vegaPageSizeChange",7),this.pageSizeChange=i(this,"pageSizeChange",7),this.globalSlimmers={},this.translationSlimmer=new y,this.childEventPrevent=new u([g],(()=>this.host)),this.childValueChangePrevent=new u([h],(()=>this.host),!0),this.vegaChangeEventEmitter=v(G,h),this.vegaPageSizeChangeEventEmitter=v(G,m),this.vegaComponentUsageRuntimeMetricsSlimmer=new S,this.vegaPaginationPageSizeObserverController=new N,this.vegaPaginationCurrentPageObserverController=new A,this.breakpointPageResizeObserverSlimmer=new z,this.vegaPaginationLayoutController=new B,this.vegaPaginationItemTypes=["currentPageLabel","pageSizeSelector","pageSelector","goTo","pageSelectorMobile","pageSizeSelectorMobile","pageSelectorMobile_goTo","pageSizeSelectorMobile_currentPageLabel"],this.currentBreakpoint=P(),this.pageCount=0,this.current=1,this.total=0,this.pageSize=10,this.extensions=I.isEnabled("VEGA_PAGINATION.ENABLE_EXTENSIONS_RESPONSIVE_DEFAULT_VALUE")?{default:[["pageSizeSelectorMobile_currentPageLabel"],["pageSelectorMobile_goTo"]],M:[["pageSelector"]]}:[["pageSelector"]],this.layout="horizontal",this.pageSizeSelectorOptions=[10,20,50,100],this.renderPaginationItemsWrapper=t=>e("vega-flex",{gap:{default:"size-4",M:"size-24"},flexWrap:"wrap",alignItems:"center",justifyContent:"center",key:this.generateWrapperKey(t)},t.map((t=>e("div",{key:t},this.renderPaginationItem(t))))),this.renderPaginationItem=t=>{switch(t){case"currentPageLabel":return e(L,{total:this.total,current:this.current,pageSize:this.pageSize,translationSlimmer:this.translationSlimmer});case"pageSizeSelector":{const t=this.pageSizeSelectorOptions.includes(this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize];return e(E,{pageSize:this.pageSize,pageSizeSelectorOptions:t,dropdownProps:this.dropdownProps,onChange:this.onPageSizeSelectorChange,translationSlimmer:this.translationSlimmer})}case"pageSelector":return e(R,{current:this.current,total:this.total,onChange:this.onPageSelectorChange,pageCount:this.pageCount});case"goTo":return e(M,{onChange:this.handlePaginationGoToChange,pageCount:this.pageCount,translationSlimmer:this.translationSlimmer});case"pageSelectorMobile":case"pageSelectorMobile_goTo":return e("vega-pagination-page-selector-mobile",{type:t,pageCount:this.pageCount,current:this.current,total:this.total});case"pageSizeSelectorMobile":case"pageSizeSelectorMobile_currentPageLabel":return e("vega-pagination-page-size-selector-mobile",{type:t,pageSize:this.pageSize,current:this.current,total:this.total,pageSizeSelectorOptions:this.pageSizeSelectorOptions,dropdownProps:this.dropdownProps})}},this.handlePaginationGoToChange=e=>{this.current=e},this.onPageSizeSelectorChange=e=>{this.pageSize=e},this.calculatePages=()=>this.total?Math.floor((this.total-1)/this.pageSize)+1:0,this.onPageSelectorChange=e=>{this.current=e},this.removeDuplicateItems=e=>{const t=[...this.vegaPaginationItemTypes];return[...e].map((e=>e.filter(((i,a)=>{const n=t.indexOf(i);return n>=0?(t.splice(n,1),!0):(e.splice(a,1),!1)})))).filter((e=>e.length>0))},this.generateWrapperKey=e=>e.map(String).reduce(((e,t)=>`${e}-${t}`)),this.currentValueGuard=()=>{0===this.pageCount?this.current=1:this.current>this.pageCount&&(this.current=this.pageCount)}}watchCurrentBreakpoint(){}watchPageCount(){this.currentValueGuard()}watchCurrent(){this.currentValueGuard(),this.vegaChangeEventEmitter.emit(this.current)}watchTotal(){this.pageCount=this.calculatePages()}watchPageSize(){this.vegaPageSizeChangeEventEmitter.emit(this.pageSize),this.pageCount=this.calculatePages()}watchLayout(){}componentWillLoad(){this.pageCount=this.calculatePages(),this.currentValueGuard(),this.pageSizeSelectorOptions.includes(this.pageSize)||(this.pageSizeSelectorOptions=[...this.pageSizeSelectorOptions,this.pageSize])}render(){const t=C.formatCustom(this.extensions);return o(e(a,null,this.removeDuplicateItems(t).map(this.renderPaginationItemsWrapper)),this.host)}get host(){return n(this)}static get watchers(){return{currentBreakpoint:["watchCurrentBreakpoint"],pageCount:["watchPageCount"],current:["watchCurrent"],total:["watchTotal"],pageSize:["watchPageSize"],layout:["watchLayout"]}}};W([j()],G.prototype,"globalSlimmers",void 0),W([w()],G.prototype,"translationSlimmer",void 0),W([w()],G.prototype,"childEventPrevent",void 0),W([w()],G.prototype,"childValueChangePrevent",void 0),W([w()],G.prototype,"vegaChangeEventEmitter",void 0),W([w()],G.prototype,"vegaPageSizeChangeEventEmitter",void 0),W([w()],G.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),W([w()],G.prototype,"vegaPaginationPageSizeObserverController",void 0),W([w()],G.prototype,"vegaPaginationCurrentPageObserverController",void 0),W([w()],G.prototype,"breakpointPageResizeObserverSlimmer",void 0),W([w()],G.prototype,"vegaPaginationLayoutController",void 0),G.style=':host{display:flex;align-items:center;line-height:normal;flex-wrap:wrap}:host(.vega-pagination-horizontal){flex-direction:row;justify-content:space-between}:host(.vega-pagination-vertical){flex-direction:column;gap:16px;justify-content:center}@media (min-width: 320px){:host(.vega-pagination-horizontal){gap:4px}}@media (min-width: 768px){:host(.vega-pagination-horizontal){gap:24px}}.vega-pagination{display:flex;padding:0px;margin:0px}.vega-pagination .vega-pagination-item{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1));cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item button{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:0px;outline:2px solid transparent;outline-offset:2px;width:100%;height:100%;cursor:pointer;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-pagination .vega-pagination-item.pager-ellipsis{cursor:default}.vega-pagination .vega-pagination-item:not(.pager-ellipsis):not(:active):hover{text-decoration:underline;text-underline-offset:2px}.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-pagination .vega-pagination-item button:active,.vega-pagination .vega-pagination-item.active button{font-family:"Inter", sans-serif;font-size:14px;font-weight:700;line-height:18px}}.vega-pagination .vega-pagination-item button:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border-radius:9999px}.vega-pagination .vega-pagination-button{list-style-type:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}';export{G as vega_pagination}
|
package/dist/vega/p-5f377954.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.
|
|
1
|
+
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.52.0",this.framework=t.VanillaJs}getVegaEnv(){return{version:this.vegaVersion,framework:this.framework}}setVegaFramework(t){this.framework=t}};export{t as F,s as v}
|