@heartlandone/vega 2.73.0 → 2.74.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/{app-globals-cc162173.js → app-globals-e9f2edcf.js} +5 -5
- package/dist/cjs/{code-block-823cd481.js → code-block-c8ae7e0a.js} +1 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-e2e0c6f3.js → component-value-history-controller-slimmer.abstract-13968181.js} +2 -2
- package/dist/cjs/{design-token-11656685.js → design-token-4e23c50a.js} +1 -1
- package/dist/cjs/{dto-renderer-manager-bd2bd447.js → dto-renderer-manager-ca753971.js} +19 -3
- package/dist/cjs/{element-appender-slimmer-12f40b8b.js → element-appender-slimmer-dc769946.js} +2 -2
- package/dist/cjs/{function-extension-78ec27e0.js → function-extension-5972c73c.js} +2 -2
- package/dist/cjs/{image-annotation-action-7408a4b3.js → image-annotation-action-92df8979.js} +2 -2
- package/dist/cjs/index.cjs.js +8 -8
- package/dist/cjs/{language-extension-716015a5.js → language-extension-d78389f9.js} +2 -2
- package/dist/cjs/loader.cjs.js +6 -6
- package/dist/cjs/{public-rules-2950f1fc.js → public-rules-23a86d33.js} +3 -3
- package/dist/cjs/{range-c3c48132.js → range-80f19554.js} +1 -1
- package/dist/cjs/{responsive-format-facade-96c5f598.js → responsive-format-facade-8d195366.js} +3 -3
- package/dist/cjs/{rich-text-editor-required-rule-4aab05a3.js → rich-text-editor-required-rule-80304585.js} +1 -1
- package/dist/cjs/{style-formatter-9c42d41b.js → style-formatter-dbda894b.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +5 -5
- package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +4 -4
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +4 -4
- package/dist/cjs/vega-chip.cjs.entry.js +5 -5
- package/dist/cjs/vega-code-block.cjs.entry.js +3 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-dialog_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +18 -8
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +175 -47
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +5 -5
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- package/dist/cjs/vega-popover_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +19 -9
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +4 -4
- package/dist/cjs/vega-signature-capture.cjs.entry.js +5 -5
- package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +5 -5
- package/dist/cjs/vega.cjs.js +6 -6
- package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +6 -3
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +31 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-item-controller.js +89 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.js +4 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.js +4 -0
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +33 -13
- package/dist/collection/components/vega-input-select/vega-input-select.js +27 -7
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/plain-text-annotation.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +18 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/extension-controller.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +6 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +5 -0
- package/dist/esm/{app-globals-949d2e18.js → app-globals-9203a3e5.js} +5 -5
- package/dist/esm/{code-block-666674d7.js → code-block-4e0d321d.js} +1 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-171dda08.js → component-value-history-controller-slimmer.abstract-0ab0d9f0.js} +2 -2
- package/dist/esm/{design-token-9b510e59.js → design-token-175c4c0c.js} +1 -1
- package/dist/esm/{dto-renderer-manager-49ae5d56.js → dto-renderer-manager-402e89d0.js} +19 -3
- package/dist/esm/{element-appender-slimmer-b9890dcb.js → element-appender-slimmer-7e7aa230.js} +2 -2
- package/dist/esm/{function-extension-8b06c6f8.js → function-extension-45e413ff.js} +2 -2
- package/dist/esm/{image-annotation-action-b3eea6a2.js → image-annotation-action-2cdbbd57.js} +2 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/{language-extension-b3f836d4.js → language-extension-4bed2436.js} +2 -2
- package/dist/esm/loader.js +6 -6
- package/dist/esm/{public-rules-b164e40e.js → public-rules-05e83e40.js} +3 -3
- package/dist/esm/{range-9cc1422b.js → range-5086f250.js} +1 -1
- package/dist/esm/{responsive-format-facade-94897ae8.js → responsive-format-facade-f995d6de.js} +3 -3
- package/dist/esm/{rich-text-editor-required-rule-2131f21c.js → rich-text-editor-required-rule-0d1147a8.js} +1 -1
- package/dist/esm/{style-formatter-bb5aec96.js → style-formatter-f4067407.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +5 -5
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +4 -4
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +4 -4
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +3 -3
- package/dist/esm/vega-date-picker_2.entry.js +5 -5
- package/dist/esm/vega-dialog_2.entry.js +5 -5
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +18 -8
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +4 -4
- package/dist/esm/vega-input-phone-number.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +175 -47
- package/dist/esm/vega-left-nav_5.entry.js +5 -5
- package/dist/esm/vega-loader-wrapper_2.entry.js +4 -4
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-popover_2.entry.js +6 -6
- package/dist/esm/vega-progress-tracker_2.entry.js +4 -4
- package/dist/esm/vega-rich-text-content.entry.js +3 -3
- package/dist/esm/vega-rich-text-editor_4.entry.js +19 -9
- package/dist/esm/vega-selection-chip_2.entry.js +4 -4
- package/dist/esm/vega-sidenav_3.entry.js +4 -4
- package/dist/esm/vega-signature-capture.entry.js +5 -5
- package/dist/esm/vega-table_11.entry.js +4 -4
- package/dist/esm/vega-time-picker_2.entry.js +5 -5
- package/dist/esm/vega-tooltip_2.entry.js +5 -5
- package/dist/esm/vega.js +6 -6
- package/dist/sri/vega-sri-manifest.json +179 -179
- package/dist/types/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +7 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-item-controller.d.ts +29 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +1 -1
- package/dist/types/components/vega-input-select/types.d.ts +5 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +12 -4
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +8 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/value-controller.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/source-edit-toolbar-button-slimmer.d.ts +1 -0
- package/dist/types/components.d.ts +17 -5
- package/dist/types/types/components.type.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-38ed3d59.entry.js → p-05feab84.entry.js} +1 -1
- package/dist/vega/{p-adc615a4.entry.js → p-071f9d00.entry.js} +1 -1
- package/dist/vega/{p-f3831dc9.entry.js → p-0f601e59.entry.js} +1 -1
- package/dist/vega/{p-40561fa0.entry.js → p-1a7e97d2.entry.js} +1 -1
- package/dist/vega/{p-76e6c13a.js → p-29618be2.js} +1 -1
- package/dist/vega/{p-c0036e71.js → p-301096ee.js} +1 -1
- package/dist/vega/{p-d01fe83d.entry.js → p-310a6294.entry.js} +1 -1
- package/dist/vega/{p-8fba7f9a.js → p-3226c208.js} +1 -1
- package/dist/vega/{p-03e16a05.entry.js → p-3398f553.entry.js} +1 -1
- package/dist/vega/{p-42a283b5.entry.js → p-370ee9e3.entry.js} +1 -1
- package/dist/vega/{p-70b2906a.entry.js → p-38b8efe5.entry.js} +1 -1
- package/dist/vega/{p-2e0deef6.js → p-3a279b71.js} +1 -1
- package/dist/vega/{p-623c3911.entry.js → p-3b32e75d.entry.js} +1 -1
- package/dist/vega/{p-0ba0f83d.entry.js → p-3ebc8b5b.entry.js} +1 -1
- package/dist/vega/{p-21e7808a.entry.js → p-3f56d184.entry.js} +1 -1
- package/dist/vega/{p-1e019406.js → p-42b7b5df.js} +1 -1
- package/dist/vega/p-451ddd84.js +1 -0
- package/dist/vega/{p-c2ac6b47.entry.js → p-5a0c92db.entry.js} +1 -1
- package/dist/vega/{p-0ad59141.entry.js → p-5c492358.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-e88f2dc3.js → p-674fe99e.js} +1 -1
- package/dist/vega/{p-dd72ad9e.js → p-73383099.js} +1 -1
- package/dist/vega/{p-9dfe2bbc.js → p-748eb5a2.js} +1 -1
- package/dist/vega/p-779cd090.entry.js +1 -0
- package/dist/vega/{p-3938880f.entry.js → p-7c238c19.entry.js} +1 -1
- package/dist/vega/{p-a3c4fa30.entry.js → p-950bf9a9.entry.js} +1 -1
- package/dist/vega/{p-5f09868d.entry.js → p-95b11cdd.entry.js} +1 -1
- package/dist/vega/{p-7be3aefc.entry.js → p-99676172.entry.js} +1 -1
- package/dist/vega/{p-a125cfec.entry.js → p-9b7daab0.entry.js} +1 -1
- package/dist/vega/{p-74a77cad.js → p-9ea8eb49.js} +1 -1
- package/dist/vega/{p-2971b17a.js → p-a2d1c2f3.js} +1 -1
- package/dist/vega/p-a6dfef41.entry.js +1 -0
- package/dist/vega/{p-6e701542.entry.js → p-a7f151fe.entry.js} +1 -1
- package/dist/vega/p-b0ed81e2.js +1 -0
- package/dist/vega/{p-75d91ee9.entry.js → p-b18c12cb.entry.js} +1 -1
- package/dist/vega/{p-e39aa2ea.entry.js → p-b19d4e26.entry.js} +1 -1
- package/dist/vega/{p-524ffc12.entry.js → p-b4be03bb.entry.js} +1 -1
- package/dist/vega/{p-721b2981.entry.js → p-ba223773.entry.js} +1 -1
- package/dist/vega/{p-db62b038.entry.js → p-bb9db84a.entry.js} +1 -1
- package/dist/vega/{p-1faef917.entry.js → p-c34feecd.entry.js} +1 -1
- package/dist/vega/{p-7b337fd4.entry.js → p-c796307d.entry.js} +1 -1
- package/dist/vega/p-ca9b4af9.entry.js +1 -0
- package/dist/vega/{p-f427d88c.entry.js → p-cadd84ec.entry.js} +1 -1
- package/dist/vega/{p-bf61d136.js → p-e3fa091a.js} +1 -1
- package/dist/vega/{p-114c6df8.entry.js → p-edbecf19.entry.js} +1 -1
- package/dist/vega/{p-7f86b3c8.js → p-f0bde406.js} +1 -1
- package/dist/vega/{p-2b20a215.entry.js → p-f844f3f1.entry.js} +1 -1
- package/dist/vega/{p-2bc4f7d9.entry.js → p-f92752d2.entry.js} +1 -1
- package/dist/vega/{p-bd60c72e.entry.js → p-fbda4a20.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-21cba83b.entry.js +0 -1
- package/dist/vega/p-2f592078.entry.js +0 -1
- package/dist/vega/p-79a544d6.js +0 -1
- package/dist/vega/p-aab0deab.js +0 -1
- package/dist/vega/p-b406a846.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,H as e,F as i,r as o,c as s,g as n}from"./p-6b2342e0.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-d849e0f5.js";import{s as u}from"./p-519a7d55.js";import{c as f}from"./p-86194314.js";import{C as p}from"./p-2d0d575f.js";import{d as v,D as m,V as b,g,X as x,a as w,T as C,U as y}from"./p-8bd496b4.js";import{V as R,b as j,G as k,H as S,I as O,y as H}from"./p-5b71c85e.js";import{R as T,f as z,c as L,V as B,M as E,I,S as M,i as A,d as D}from"./p-79a544d6.js";import{i as F}from"./p-161b9c5b.js";import{a as V}from"./p-8c9ea6f4.js";import{b as P,a1 as N,y as W,a2 as U,a3 as $,e as _,T as K,a4 as q,a5 as G,u as J,a6 as Z,a7 as X,a8 as Y,_ as Q,W as tt,a9 as et,M as it,c as ot,a0 as st,A as nt,H as rt,s as ct,h as lt,Z as at,U as ht,j as dt,J as ut,r as ft,G as pt,x as vt,I as mt,V as bt}from"./p-bf61d136.js";import{V as gt,I as xt,T as wt,b as Ct,a as yt}from"./p-e88f2dc3.js";import{g as Rt}from"./p-a4670e23.js";import{a as jt}from"./p-ce2ffff7.js";import{F as kt}from"./p-30e7544c.js";import{c as St}from"./p-f2c8c363.js";import{c as Ot}from"./p-5be29f14.js";import{R as Ht,C as Tt,A as zt,a as Lt}from"./p-2e0deef6.js";import{F as Bt,D as Et}from"./p-a528714c.js";import{O as It}from"./p-331a62d5.js";import{d as Mt}from"./p-1bc5b3bc.js";import{D as At}from"./p-a5713178.js";import{R as Dt}from"./p-74a77cad.js";import{C as Ft}from"./p-184d8443.js";import{T as Vt}from"./p-75f981ce.js";import{V as Pt}from"./p-ef9cbad1.js";import{i as Nt}from"./p-d27ae9ff.js";import{c as Wt}from"./p-613ddaab.js";import{t as Ut}from"./p-aacf6920.js";import{f as $t}from"./p-d9671d27.js";import{r as _t}from"./p-77e64f26.js";import"./p-02841589.js";import"./p-bf19682d.js";import"./p-ed45b3b6.js";import"./p-40f39194.js";import"./p-d884c644.js";import"./p-f69f84a7.js";import"./p-6a334573.js";import"./p-5d676a94.js";import"./p-10ac8b57.js";import"./p-b75ee3ba.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-59fa3f68.js";import"./p-697eb0e1.js";import"./p-8fba7f9a.js";import"./p-1fb56e14.js";import"./p-a8dad05d.js";import"./p-207cfa6a.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-112455b1.js";import"./p-4866e390.js";import"./p-262ec334.js";class Kt{constructor(){this.format=(t,e={})=>{const{tabWidth:i=4,useTabs:o=!0}=e,s=(o?"\t":" ").repeat(i),n=t.split(/(<\/?[^>]+>)/g).filter((t=>t.length>0));let r=0,c="";for(let t=0;t<n.length;t++){let e=n[t];e.startsWith("</")&&(r=Math.max(0,r-1));const i=s.repeat(r);if(e.startsWith("<")){e=e.replace(/style\s*=\s*"([^"]*)"/g,((t,e)=>`style="${this.formatStyle(e)}"`));const o=Kt.getTagName(e);if(Kt.INLINE_TAGS.has(o)&&t+2<n.length&&n[t+2]===`</${o}>`){let o=`${e}${n[t+1]}${n[t+2]}`;for(t+=2;t+2<n.length&&n[t+1].startsWith("<")&&Kt.INLINE_TAGS.has(Kt.getTagName(n[t+1]))&&n[t+3]===`</${Kt.getTagName(n[t+1])}>`;)o+=`${n[t+1]}${n[t+2]}${n[t+3]}`,t+=3;c+=`${i}${o}\n`}else c+=`${i}${e}\n`,e.startsWith("</")||e.endsWith("/>")||/^<br|^<img|^<meta|^<input|^<hr/i.test(e)||r++}else{const t=e;t.length>0&&(c+=`${s.repeat(r)}${t}\n`)}}return c.trim()}}static getTagName(t){var e;const i=t.match(/^<\/?([a-z0-9]+)/i);return null!==(e=null==i?void 0:i[1].toLowerCase())&&void 0!==e?e:""}formatStyle(t){return t.split(";").map((t=>t.trim())).filter(Boolean).join("; ")}}Kt.INLINE_TAGS=new Set(["span","strong","em","a","b","i","u","small","abbr","code","b","u","s","mark","time","del","ins"]);const qt=new Kt;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 Jt 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,"vega-hidden":this.sourceView},style:{minHeight:24*this.rows+"px"},onClick:this.richTextContentFocus,role:"textbox",tabIndex:this.disabled?0:-1,onKeyDown:f(),ref:t=>this.richTextContainerRef=t},t("vega-rich-text-content",{ref:t=>this.richTextContentRef=t,content:this.value,extensions:this.extensions}),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()},this.renderSourceViewContent=()=>{if(!this.allowSourceEdit)return;const e=this.sourceView?qt.format(this.value.toHtml()):"";return t("div",{class:{"source-view-container":!0,"vega-hidden":!this.sourceView}},t("vega-code-block",{ref:t=>this.sourceCodeBlockRef=t,disabled:this.disabled,value:{language:"html",code:e}}))}}componentDidRender(){p.notify(v.getSubject(this.host,R),{})}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")}getSourceCode(){if(this.sourceCodeBlockRef)return this.sourceCodeBlockRef.value.code}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.renderContent(),this.renderErrorMessage())}renderLabel(){return this.label&&t("vega-field-label",{onClick:this.richTextContentFocus,isFieldRequired:this.required,disabled:this.disabled,label:this.label})}renderContent(){return t(i,null,this.renderTextContent(),this.renderSourceViewContent())}}Gt([r()],Jt.prototype,"host",void 0),Gt([r()],Jt.prototype,"toolbarRenderer",void 0),Gt([r()],Jt.prototype,"label",void 0),Gt([r()],Jt.prototype,"required",void 0),Gt([r()],Jt.prototype,"hint",void 0),Gt([r()],Jt.prototype,"disabled",void 0),Gt([r()],Jt.prototype,"rows",void 0),Gt([r()],Jt.prototype,"placeholder",void 0),Gt([r()],Jt.prototype,"value",void 0),Gt([r()],Jt.prototype,"sourceView",void 0),Gt([r()],Jt.prototype,"toolbarItems",void 0),Gt([r()],Jt.prototype,"sourceEditConfig",void 0),Gt([r()],Jt.prototype,"allowSourceEdit",void 0),Gt([r()],Jt.prototype,"extensions",void 0),Gt([c("componentDidRender")],Jt.prototype,"componentDidRender",null);var Zt=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 Xt 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(){const[e,o]=this.renderToolbarItems();return t("vega-flex",{gap:"size-8",alignItems:"center",flexWrap:"wrap"},this.allowSourceEdit&&t(i,null,t("div",{class:"toolbar-btn-group"},this.sourceEditToolbarButtonSlimmer.render()),this.toolbarItems.length>0&&o>0&&this.renderVegaDivider()),e)}renderVegaDivider(){return t("vega-box",{height:"size-32"},t("vega-divider",{direction:"vertical"}))}renderToolbarItems(){let e=0;return[this.toolbarItems.map((i=>{let o=0;const s=i.map((i=>{const s=this.getToolbarBtnRenderer(i),n=T.getRTEToolbarButtonRenderer(i);if(s)return s.isHidden()||(e++,o++),s.render();if(n){const i={sourceEditMode:this.sourceView,host:this.host,rteRange:this.selectionController.getCurrentRange()};return n.isHidden(i)||(e++,o++),n.render(t,i)}return null})).filter(F);return t("div",{class:{"toolbar-btn-group":!0,"vega-hidden":o<1}},s)})),e]}}Zt([r()],Xt.prototype,"toolbarItems",void 0),Zt([r()],Xt.prototype,"allowSourceEdit",void 0),Zt([r()],Xt.prototype,"host",void 0),Zt([r()],Xt.prototype,"clearStyleToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"boldToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"textStylesToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"italicToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"underlineToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"textColorToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"bulletsNumbersToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"horizontalAlignmentToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"strikethroughToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"imageToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"moreIndentToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"lessIndentToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"codeToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"linkToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"codeBlockToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"sourceEditToolbarButtonSlimmer",void 0),Zt([r()],Xt.prototype,"selectionController",void 0),Zt([r()],Xt.prototype,"sourceView",void 0);class Yt extends gt{constructor(){super({icon:"bold",tooltip:{text:"Bold"}})}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new N(!t))))}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof P));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(W.BOLD))||void 0===e?void 0:e.bold}))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return(null===(e=t.getAnnotationByType(W.CODE))||void 0===e?void 0:e.code)||this.shouldDisabledToolbar(t,N.name)}))}}V.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()],Yt.prototype,"selectionController",void 0);class Qt extends gt{constructor(){super({icon:"italic",tooltip:{text:"Italic"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof P));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(W.ITALIC))||void 0===e?void 0:e.italic}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new U(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return(null===(e=t.getAnnotationByType(W.CODE))||void 0===e?void 0:e.code)||this.shouldDisabledToolbar(t,U.name)}))}}V.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()],Qt.prototype,"selectionController",void 0);class te extends gt{constructor(){super({icon:"underline",tooltip:{text:"Underline"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof P));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(W.UNDERLINE))||void 0===e?void 0:e.underline}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new $(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return(null===(e=t.getAnnotationByType(W.CODE))||void 0===e?void 0:e.code)||this.shouldDisabledToolbar(t,$.name)}))}}V.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()],te.prototype,"selectionController",void 0);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 ie extends gt{constructor(){super({icon:"text-size",tooltip:{text:"Text Styles"}}),this.handleDropdownItemClick=t=>{const e=t.detail,i=ie.items.find((t=>t.key===e)).bold,o=this.selectionController.getSelectedBlocks().filter((t=>t instanceof _));o.length>0?o.forEach((t=>{t.apply(new K(e,i))})):this.focusController.focusOnLastTextNode({newLine:!0}).then((()=>{this.selectionController.getSelectedBlocks().filter((t=>t instanceof _)).forEach((t=>{t.apply(new K(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,ie.items.map((e=>{const i=new q(e.key),o=new G(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.renderStyle({standalone:!0})),o.renderStyle({standalone:!0}))},this.translationSlimmer.t(e.label))))})))}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedBlocks();return super.isDisabled()||t.some((t=>this.shouldDisabledToolbar(t,K.name)))}addDropdownObserver(t){m.addUniqueObserverToNode(t,b,this.handleDropdownItemClick)}getSelectedSourceKey(){var t;const e=this.selectionController.getSelectedBlocks().filter((t=>t instanceof _));if(e.length>0&&e.every((t=>t.type===e[0].type))){const i=e[0].getAnnotationByType(J.TEXT_STYLE);return null!==(t=null==i?void 0:i.textStyle)&&void 0!==t?t:""}return""}}V.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>'}}),ie.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"}],ee([r()],ie.prototype,"selectionController",void 0),ee([r()],ie.prototype,"focusController",void 0);class oe extends gt{constructor(){super({icon:"text-slash",tooltip:{text:"Clear Style"}})}isSelected(){return!1}onClick(){this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((t=>{t.apply(new Z)}))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>this.shouldDisabledToolbar(t,Z.name)))}}V.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()],oe.prototype,"selectionController",void 0);class se extends gt{constructor(){super({icon:"code-simple",tooltip:{text:"Code"}})}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new X(!t))))}isSelected(){const t=this.selectionController.getSelectedNodes();return t.length>0&&t.filter((t=>t instanceof P)).map((t=>t.getAnnotationByType(W.CODE))).every((t=>t&&t.code))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>t.getAnnotationByType(W.LINK)||this.shouldDisabledToolbar(t,X.name)))}}V.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()],se.prototype,"selectionController",void 0);class ne extends gt{constructor(){super({icon:"strikethrough",tooltip:{text:"Strikethrough"}})}isSelected(){const t=this.selectionController.getSelectedNodes().filter((t=>t instanceof P));return t.length>0&&t.every((t=>{var e;return null===(e=t.getAnnotationByType(W.STRIKETHROUGH))||void 0===e?void 0:e.strikethrough}))}onClick(){const t=this.isSelected();this.selectionController.getSelectedNodes().filter((t=>t instanceof P)).forEach((e=>e.apply(new Y(!t))))}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return(null===(e=t.getAnnotationByType(W.CODE))||void 0===e?void 0:e.code)||this.shouldDisabledToolbar(t,Y.name)}))}}V.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()],ne.prototype,"selectionController",void 0);class re extends gt{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=Rt();return void this.currentSelectedNodes.forEach((t=>{t.apply(new Q(this.currentRange)).apply(new tt({link:{href:e,groupKey:s},newText:o?i:void 0,needMergeNode:o&&this.currentSelectedNodes.length>1,type:"link"}))}))}}}}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),m.addUniqueObserverToNode(t,g,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 this.shouldDisabledToolbar(t,tt.name)||t.getAnnotationByType(W.LINK)||(null===(e=t.getAnnotationByType(W.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,jt(this.linkEditorRef).then((()=>{this.linkEditorRef.show()})))}}V.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()],re.prototype,"selectionController",void 0);class ce extends gt{constructor(){super({icon:"indent",tooltip:{text:"More Indent"}})}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedBlocks();return super.isDisabled()||t.some((t=>this.shouldDisabledToolbar(t,et.name)))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>{var e,i;const o=null!==(i=null===(e=t.getAnnotationByType(J.INDENT))||void 0===e?void 0:e.indent)&&void 0!==i?i:0;t.apply(new et(o+1))}))}}V.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 gt{constructor(){super({icon:"outdent",tooltip:{text:"Less Indent"}})}isSelected(){return!1}isDisabled(){const t=this.selectionController.getSelectedBlocks();return super.isDisabled()||t.some((t=>this.shouldDisabledToolbar(t,et.name)))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>{var e,i;const o=null!==(i=null===(e=t.getAnnotationByType(J.INDENT))||void 0===e?void 0:e.indent)&&void 0!==i?i:0;t.apply(new et(o>1?o-1:0))}))}}V.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 it{constructor(t){super(),this.type=ot.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 gt{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(),e=this.selectionController.getSelectedBlocks()[0];return super.isDisabled()||t.some((t=>t.getAnnotationByType(W.LINK)))||this.shouldDisabledToolbar(e,ot.INSERT_IMAGE_TO_BLOCK)}}V.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 it{constructor(t,e){super(),this.type=ot.TRANSFORM_LIST_BLOCK,this.isFlushable=!0,this.listType=t,this.selectedBlocks=e}}class fe extends it{constructor(t){super(),this.type=ot.TRANSFORM_PARAGRAPH_BLOCK,this.isFlushable=!0,this.selectedBlocks=t}}var pe=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 gt{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 st))}isListType(t,e="bullet-list"){return t.length>0&&t.every((t=>t instanceof L&&t.parent.type===e))}deselectBulletList(){const t=this.selectionController.getSelectedBlocks();t[0]&&t[0].parent.apply(new fe(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))}}pe([r()],ve.prototype,"selectionController",void 0),pe([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 gt{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 st))}isListType(t,e="number-list"){return t.length>0&&t.every((t=>t instanceof L&&t.parent.type===e))}deselectNumberList(){const t=this.selectionController.getSelectedBlocks();t[0]&&t[0].parent.apply(new fe(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 gt{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(){return super.isDisabled()||this.shouldDisabledListToolbar()}shouldDisabledListToolbar(){return this.selectionController.getSelectedBlocks().some((t=>t&&(this.unableToConvertListOrParagraph(t)||this.unableToInsertBlock(t.parent))))}unableToInsertBlock(t){return!(nt.canHandle(ot.INSERT_CHILDREN_AFTER,t)||nt.canHandle(ot.INSERT_CHILDREN_BEFORE,t))}unableToConvertListOrParagraph(t){return!nt.canHandle(ot.TRANSFORM_LIST_BLOCK,t)&&!nt.canHandle(ot.TRANSFORM_PARAGRAPH_BLOCK,t.parent)}}V.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);var we=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 Ce extends gt{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(J.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new rt("left")))),this.popoverRef.hide()}}V.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>'}}),we([r()],Ce.prototype,"selectionController",void 0),we([r()],Ce.prototype,"popoverRef",void 0);var ye=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 Re extends gt{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(J.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new rt("center")))),this.popoverRef.hide()}}V.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>'}}),ye([r()],Re.prototype,"selectionController",void 0),ye([r()],Re.prototype,"popoverRef",void 0);var je=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 ke extends gt{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(J.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new rt("right")))),this.popoverRef.hide()}}V.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>'}}),je([r()],ke.prototype,"selectionController",void 0),je([r()],ke.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 Oe extends gt{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(J.ALIGNMENT))||void 0===e?void 0:e.textAlign)}))}onClick(){this.selectionController.getSelectedBlocks().forEach((t=>t.apply(new rt("justify")))),this.popoverRef.hide()}}V.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()],Oe.prototype,"selectionController",void 0),Se([r()],Oe.prototype,"popoverRef",void 0);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 Te extends gt{constructor(){super({icon:"align-left",tooltip:{text:"Left Align"}}),this.leftAlignToolbarButtonSlimmer=new Ce,this.centerAlignToolbarButtonSlimmer=new Re,this.rightAlignToolbarButtonSlimmer=new ke,this.justifiedToolbarButtonSlimmer=new Oe}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=>this.shouldDisabledToolbar(t,rt.name)))}}He([r()],Te.prototype,"selectionController",void 0),He([a()],Te.prototype,"leftAlignToolbarButtonSlimmer",void 0),He([a()],Te.prototype,"centerAlignToolbarButtonSlimmer",void 0),He([a()],Te.prototype,"rightAlignToolbarButtonSlimmer",void 0),He([a()],Te.prototype,"justifiedToolbarButtonSlimmer",void 0),He([c("componentWillRender")],Te.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 Le=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=Mt((()=>{this.valueController.flushChanges(this.value)}),Be.VALUE_CHANGE_DEBOUNCE_TIME,this);this.flushChangeObserver=new It(this.isAcceptableFlushChange.bind(this),t),p.register(v.getSubject(this.host,j),this.flushChangeObserver)}disconnectedCallback(){p.unregister(v.getSubject(this.host,j),this.flushChangeObserver)}componentWillLoad(){!this.value||this.value instanceof B||(this.value=B.fromJSON(this.value)),this.registerEditorRefAndContent()}watchValueUpdate(){!this.value||this.value instanceof B?this.value&&0!==this.value.children.length?(this.changeEventEmitter.emit(this.value),p.notify(Bt,{host:this.host,detail:this.value})):this.value=B.createEmptyContent():this.value=B.fromJSON(this.value),this.registerEditorRefAndContent()}async flushChanges(t,e=!0){this.value=t.clone(),e&&this.historyController.registerHistory(new ze(this.value,new Ht(this.selectionController.getCurrentRange()))),await jt(this.host)}isAcceptableFlushChange(){return!0}registerEditorRefAndContent(){this.host&&this.host.value&&ct.register(this.host,this.host.value)}}Be.VALUE_CHANGE_DEBOUNCE_TIME=50,Le([r()],Be.prototype,"host",void 0),Le([r({writable:!0})],Be.prototype,"value",void 0),Le([r()],Be.prototype,"changeEventEmitter",void 0),Le([r()],Be.prototype,"valueController",void 0),Le([r()],Be.prototype,"historyController",void 0),Le([r()],Be.prototype,"selectionController",void 0),Le([c("connectedCallback")],Be.prototype,"connectedCallback",null),Le([c("disconnectedCallback")],Be.prototype,"disconnectedCallback",null),Le([c("componentWillLoad")],Be.prototype,"componentWillLoad",null),Le([c("watchValueUpdate")],Be.prototype,"watchValueUpdate",null);class Ee{constructor(t){this.editor=t}syncRichTextContentEditable(){this.editor.richTextContentEditable=!this.editor.disabled}}class Ie{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){p.notify(v.getSubject(this.richTextEditorRef,k),{host:this.richTextEditorRef,detail:t});const e=this.selectionController.getCurrentRange(),i=this.selectionController.getSelectedNodes();return e.startNode||i[0]}createEmptyParagraph(){const t=new _(Rt(),"paragraph"),e=new P(`${t.id}1`,"",t);return t.apply(new lt([e])),t}initCurrentStateAndSelection(t,e){this.currentState=t,this.selectionController=e}setCurrentRichTextEditor(t){this.richTextEditorRef=t}}class Me extends it{constructor(t,e){super(),this.type=ot.REPLACE_SELECTED_TEXT,this.textToBeInsert="",this.textToBeInsert=t,this.currentRange=e}}class Ae extends it{constructor(t,e,i){super(),this.type=ot.INSERT_TEXT_TO_DECORATOR_NODE,this.text="",this.offset=0,this.decoratorNode=t,this.text=e,this.offset=i}}class De extends Ie{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 P)if(n[0].isContentEditable()){let t=s+e.length,r=!1,c=n[0];"\n"===c.text?(c=this.insertTextToLineBreakNode(c,e),r=!0):(o.nodeValue===at&&s===at.length&&c.isEmpty()&&(o.nodeValue="",t-=at.length),c instanceof P&&(r=!0,c.apply(new Me(e,i)))),r&&this.selectionController.enqueueSelectionRangeFutureState(c,Math.min(t,c.text.length))}else n[0].parent.apply(new Ae(n[0],e,s))}else{const t=this.removeSelectionRange(!0);t instanceof P&&(t.apply(new Me(e,i)),this.selectionController.enqueueSelectionRangeFutureState(t,Math.min(s+e.length,t.text.length)))}}insertTextToRoot(t){if(this.currentState&&this.currentState.children[0]&&this.currentState.children[0]instanceof _){const e=this.currentState.children[0].children[0];return e.apply(new ht(t)),e}}insertTextToLineBreakNode(t,e){const{startOffset:i,endOffset:o}=this.selectionController.getCurrentRange(),s=t.parent;if(s instanceof _){const n=s.children.indexOf(t);if(0===i&&i===o&&s.children[n+1]){const i=t.cloneWithText(e);return s.apply(new dt(t,i)),i}return t.apply(new ht(e)),t}}}class Fe extends Ie{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.parent,s=t[t.length-1];if(o.type!==s.type&&e.startContainer.nodeType===e.endContainer.nodeType){o.apply(new E(s));const t=new ut(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.parent,{startOffset:i}=this.selectionController.getCurrentRange();if(e){const o=new I(t,i);e.apply(o),this.switchCaretPositionToNextElement(o.newBlock)}}switchCaretPositionToNextElement(t){t&&t.children&&this.selectionController.enqueueSelectionRangeFutureState(t.children[0],0)}}class Ve extends it{constructor(t,e){super(),this.type=ot.LINE_BREAK_SINGLE_BLOCK,this.startContainerNode=t,this.startOffset=e}}class Pe extends it{constructor(t){super(),this.type=ot.LINE_BREAK_MULTIPLE_BLOCKS,this.selectedBlocks=t}}class Ne extends Ie{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.children[0]&&this.currentState.children[0]instanceof _){const t=new Ve(this.currentState.children[0].children[0],0);this.currentState.children[0].apply(t),this.switchCaretPositionToSpecifiedNode(t.lineBreakNode)}}breakSingleBlock(){const t=this.selectionController.getCurrentRange(),e=this.removeSelectionRange(),i=e.parent;if(i){const o=new Ve(e,t.startOffset);i.apply(o),o.lineBreakNode&&this.switchCaretPositionToSpecifiedNode(o.lineBreakNode)}}breakMultipleBlocks(){const t=this.selectionController.getSelectedBlocks(),e=this.removeSelectionRange(),i=new Pe(t);e.parent.apply(i),this.switchCaretPositionToSpecifiedNode(i.lineBreakNode)}switchCaretPositionToSpecifiedNode(t){this.selectionController.enqueueSelectionRangeFutureState(this.getNextRTENode(t),0)}getNextRTENode(t){const e=t.parent.children.indexOf(t);return t.parent.children[e+1]||t}}class We extends it{constructor(t,e){super(),this.type=ot.DELETE_BLOCK_CONTENT,this.startContainerNode=t,this.startOffset=e}}class Ue extends Ie{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 We(r[0],e);if(n[0].apply(t),t.previousNode){const i=t.previousNode===r[0]?Math.max(0,e-1):t.previousNode.getRangeEndOffset();this.selectionController.enqueueSelectionRangeFutureState(t.previousNode,i)}else t.nextNode?this.selectionController.enqueueSelectionRangeFutureState(t.nextNode,0):0===this.currentState.children.length&&this.insertDefaultParagraph()}}deleteContentWithMultipleNodes(){const t=this.selectionController.getSelectedNodes(),e=this.removeSelectionRange(!0),i=t[t.length-1];t.length>1&&i instanceof P&&i.isEmpty()&&i.parent.apply(new ft(i)),this.convertFirstBlockToParagraph(e.parent)}convertFirstBlockToParagraph(t){if(this.currentState.children[0]===t&&t instanceof _&&1===t.children.length&&t.children[0].isEmpty()&&"paragraph"!==t.type){const e=this.createEmptyParagraph();e.apply(new pt(t.children)),t.parent.apply(new dt(t,e)),t.parent.apply(new ft(t))}}insertDefaultParagraph(){const t=this.createEmptyParagraph();this.currentState.apply(new lt([t])),this.selectionController.enqueueSelectionRangeFutureState(t.children[0],1)}}class $e extends it{constructor(t,e,i,o){super(),this.type=ot.PASTE_CONTENT,this.blocksToBeInserted=t,this.startNode=e,this.startOffset=i,this.rteRange=o}}class _e extends Ie{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 lt(t))}insertBlocksToContent(t){const e=this.removeSelectionRange();if(e&&e.parent){const{startOffset:i}=this.selectionController.getCurrentRange(),o=new $e(t,e,i);e.parent.apply(o),o.futureFocusBlock&&this.switchCaretPositionToNextElement(o.futureFocusBlock)}}insertBlocksBeforeEmptyBlock(t){const e=this.removeSelectionRange(),i=null==e?void 0:e.parent;if(i){const e=new $e(t,i.children[0],0,this.selectionController.getCurrentRange());i.apply(e),e.futureFocusBlock&&this.switchCaretPositionToNextElement(e.futureFocusBlock)}}parsePastedElements(t){let e=t.dataTransfer.getData("text/html");if(!e){const i=t.dataTransfer.getData("text/plain");e=this.parsePlainText(i)}const i=M.preserve(e),o=i.getProcessedHtml(),s=(new DOMParser).parseFromString(o,"text/html"),n=Array.from(s.body.childNodes);return i.restore(n),A.process(n).filter(Boolean).map((t=>t.toDto())).filter(Boolean)}switchCaretPositionToNextElement(t){t&&t.children&&this.selectionController.enqueueSelectionRangeFutureState(t.children[0],0)}parsePlainText(t){return t.split("\n").map((t=>""===t?"<p>\n</p>":`<p>${t}</p>`)).join("")}}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 qe extends l{constructor(){super(...arguments),this.insertTextHandler=new De,this.insertParagraphHandler=new Fe,this.insertLineBreakHandler=new Ne,this.deleteContentHandler=new Ue,this.insertPasteHandler=new _e,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=Rt();this.valueController.flushChanges(B.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(vt.CODE_BLOCK_PLACEHOLDER_CLASS_NAME)}return!1}}Ke([r()],qe.prototype,"host",void 0),Ke([r()],qe.prototype,"value",void 0),Ke([r()],qe.prototype,"valueController",void 0),Ke([r()],qe.prototype,"vegaRichTextEditorRenderer",void 0),Ke([r()],qe.prototype,"selectionController",void 0),Ke([r()],qe.prototype,"insertCompositionTextController",void 0),Ke([c("componentDidLoad")],qe.prototype,"addActionListener",null),Ke([c("disconnectedCallback")],qe.prototype,"removeActionListener",null);class Ge extends it{constructor(t,e,i){super(),this.isFlushable=!0,this.type=ot.INSERT_IMAGE_TO_BLOCK,this.splitPointNode=t,this.startOffsetOfNode=e,this.imageBlockToBeInserted=i}}var Je=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 Ze extends l{insertImageToCaretPosition(t){const e=this.selectionController.getSelectedBlocks(),i=new D(Rt()),o=new z(Rt(),t,i);if(o.apply(new xt("md","")),i.apply(new lt([o])),e.length<1||this.value.children.length<1)this.value.apply(new lt([i])),this.valueController.flushChanges(this.value);else{const{startOffset:t}=this.selectionController.getCurrentRange(),o=this.selectionController.getSelectedNodes();e[0].apply(new Ge(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&&(m.addUniqueObserverToNode(t,S,(t=>{const e=this.selectionController.getCurrentRange();if(!e||e.startContainer!==t.host||0!==e.startOffset){const e=ct.getEntityByDOM(t.host.querySelector("img"));this.selectionController.enqueueSelectionRangeFutureState(e,0,e,0,!0)}})),m.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&&(m.removeUniqueObserverFromNode(t,S),m.removeUniqueObserverFromNode(t,O))}}Je([r()],Ze.prototype,"selectionController",void 0),Je([r()],Ze.prototype,"value",void 0),Je([r()],Ze.prototype,"valueController",void 0),Je([r()],Ze.prototype,"vegaRichTextEditorRenderer",void 0),Je([c("componentDidLoad")],Ze.prototype,"registerObserver",null),Je([c("disconnectedCallback")],Ze.prototype,"unRegisterObserver",null);var Xe=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 l{constructor(){super(...arguments),this.doFocusOnLastTextNode=async t=>{const e=t.getLastNode(),i=ct.getDOMByEntity(e);i&&(e.isContentEditable()?this.setCaretRangeToNodeEnd(i.firstChild,i.firstChild.nodeValue.length):this.setCaretRangeToNodeEnd(i.parentElement,e.getRangeEndOffset()),await this.vegaRichTextEditorRenderer.getRichTextContentRef().vegaFocus())}}async focusOnLastTextNode(t){const e=this.value.children[this.value.children.length-1];if(e instanceof _&&!(null==t?void 0:t.newLine))await this.doFocusOnLastTextNode(e);else{const t=_.from({id:Rt(),type:"paragraph",nodes:[{id:Rt(),type:"text",text:""}]});e.parent.apply(new mt(e,t)),await this.valueController.flushChanges(this.value),await this.doFocusOnLastTextNode(t)}}setCaretRangeToNodeEnd(t,e){const i=new Range;i.setStart(t,e),this.selectionController.setSelectionRange(i)}}Xe([r()],Ye.prototype,"vegaRichTextEditorRenderer",void 0),Xe([r()],Ye.prototype,"selectionController",void 0),Xe([r()],Ye.prototype,"valueController",void 0),Xe([r()],Ye.prototype,"value",void 0);var Qe=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 ti extends l{connectedCallback(){this.observer=new It(this.isAcceptObserver.bind(this),(t=>{wt.getTextNodeElements().forEach(((e,i)=>{i.style.color=t?e.textColor.dark:e.textColor.light}))})),p.register(Et,this.observer)}disconnectResizeObserver(){p.unregister(Et,this.observer)}isAcceptObserver(){return!0}}Qe([c("connectedCallback")],ti.prototype,"connectedCallback",null),Qe([c("disconnectedCallback")],ti.prototype,"disconnectResizeObserver",null);var ei=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 ii 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=ct.getEntityByDOM(i.parentElement),s=i.textContent;t instanceof P&&t.isContentEditable()&&t.parent instanceof _?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,p.notify(v.getSubject(this.host,k),{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.parent,i=e.children.indexOf(t);if(e.children[i+1]){const o=t.cloneWithText("\n");e.apply(new dt(e.children[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 ht(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(at)?t.slice(at.length):t.endsWith(at)?t.slice(0,t.length-at.length):t}dispatchInsertTextEvent(t){const e=new CustomEvent("beforeinput");e.data=t,e.inputType="insertText",this.editableElementRef.dispatchEvent(e)}}ei([r()],ii.prototype,"selectionController",void 0),ei([r()],ii.prototype,"host",void 0),ei([r()],ii.prototype,"value",void 0),ei([r()],ii.prototype,"valueController",void 0),ei([r()],ii.prototype,"userInputController",void 0),ei([r()],ii.prototype,"vegaRichTextEditorRenderer",void 0),ei([c("componentDidLoad")],ii.prototype,"addCompositionTextEventListener",null),ei([c("disconnectedCallback")],ii.prototype,"removeCompositionTextEventListener",null),ei([c("componentDidRender")],ii.prototype,"reConnectObserver",null);var oi=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 si 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(){m.addUniqueObserverToNode(this.host,k,this.deleteActionProcess)}removeDeleteObserver(){m.removeUniqueObserverFromNode(this.host,k)}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.isContentEditable()?t!==s&&t!==n:t!==s&&(t!==n||this.isEndNodeFullyInTheRange(n,i,t)))).forEach((t=>{t.parent.apply(new ft(t))})),this.removeRangeStartAndEndSelectedText(),!s.isContentEditable()&&this.isStartNodeFullyInTheRange(s,n,o,i)){if(1===s.parent.children.length){const t=this.createEmptyParagraph();let e=s.parent;return!e.parent||e.parent instanceof B||1!==e.parent.children.length||(e=e.parent),e.parent.apply(new dt(e,t)),s.parent.apply(new ft(s)),t.children[0]}if(s===s.parent.children[0])return s.parent.apply(new ft(s)),s.parent.children[0]}return s}removeRangeStartAndEndSelectedText(){const t=this.selectionController.getSelectedNodes(),e=this.selectionController.getCurrentRange();t[0]instanceof P&&t[0].isContentEditable()&&t[0].apply(new Me("",e));const i=t[t.length-1];t.length>1&&i instanceof P&&i.isContentEditable()&&t[t.length-1].apply(new Me("",e))}createEmptyParagraph(){const t=new _(Rt(),"paragraph"),e=new P(`${t.id}1`,"",t);return t.apply(new lt([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.parent&&i&&i.parent){const t=i.parent;this.shouldMergeTextNode(e,i)&&(e.apply(new ht(e.text+i.text)),e.parent===i.parent?e.parent.apply(new ft(i)):i.parent.apply(new ft(i.parent.children[0]))),e instanceof P&&i instanceof P&&e.parent!==i.parent&&(e.parent.apply(new lt(t.children)),t.children=[]),t.children.length<1&&t.parent.apply(new ft(t))}}}shouldMergeTextNode(t,e){const{annotations:i}=t.toJSON(),{annotations:o}=e.toJSON();return t instanceof P&&e instanceof P&&JSON.stringify(i)===JSON.stringify(o)}isEndNodeFullyInTheRange(t,e,i){return i instanceof st||i===t&&0!==e}isStartNodeFullyInTheRange(t,e,i,o){return t instanceof st||0===i&&(e!==t||0!==o)}}oi([r()],si.prototype,"host",void 0),oi([r()],si.prototype,"selectionController",void 0),oi([r()],si.prototype,"value",void 0),oi([c("connectedCallback")],si.prototype,"addDeleteObserver",null),oi([c("disconnectedCallback")],si.prototype,"removeDeleteObserver",null);var ni=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 Tt{constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.vegaRichTextEditorRenderer.getRTEEditableElementRef()],this.getIneffectiveTargets=()=>{const t=this.vegaRichTextEditorRenderer.getRTEEditableElementRef();let e=[];return t&&(e=Array.from(t.querySelectorAll(".code-block-container"))),e}}registerInitState(){this.value&&this.registerHistory(new ze(this.value,new Ht(this.selectionController.getCurrentRange())),!0)}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop().clone();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){if(this.redoStack.length>0){const t=this.redoStack.pop().clone();this.undoStack.push(t),await this.restoreState(t)}}async restoreState(t){const{content:e,selection:i}=t.clone();this.selectionController.setSelectionState(i),await this.valueController.flushChanges(e,!1)}}ni([r()],ri.prototype,"host",void 0),ni([r()],ri.prototype,"vegaRichTextEditorRenderer",void 0),ni([r()],ri.prototype,"valueController",void 0),ni([r()],ri.prototype,"value",void 0),ni([r()],ri.prototype,"selectionController",void 0),ni([c("componentDidLoad")],ri.prototype,"registerInitState",null);class ci extends it{constructor(t){super(),this.type=ot.TRANSFORM_TO_CODE_BLOCK,this.selectedBlocks=t}}var li=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 gt{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.children[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=>!(t instanceof vt)&&this.shouldDisabledCodeBlockToolbar(t)))}shouldDisabledCodeBlockToolbar(t){return t&&!(t instanceof _&&nt.canHandle(ot.TRANSFORM_TO_CODE_BLOCK,t.parent))}}V.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>'}}),li([r()],ai.prototype,"selectionController",void 0),li([r()],ai.prototype,"valueController",void 0),li([r()],ai.prototype,"value",void 0);class hi extends zt{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=ct.getDOMByEntity(t.children[0]);return t.isSelected()||i&&e.intersectsNode(i.nextSibling)&&e.intersectsNode(i.previousSibling)}async focusTheCodeBlock(t){await Promise.resolve();const e=ct.getDOMByEntity(t);e&&e.doFocus()}}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 Ct{constructor(){super({icon:"display-code",tooltip:{text:"Edit Source"},autoFocusOnClick:!1})}async onClick(){const t=this.sourceView;t?await this.saveSourceCode():this.selectionController.setSelectionRange(new Range),this.sourceView=!t}isSelected(){return this.sourceView}isDisabled(){return super.isDisabled()}async saveSourceCode(){const t=this.vegaRichTextEditorRenderer.getSourceCode();"string"==typeof t&&await this.valueController.flushChanges(B.fromHtml(t,{autoMatchFormat:this.sourceEditConfig.autoMatchFormat}))}}V.register({"display-code":{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="M512 48c8.8 0 16 7.2 16 16V352c0 8.8-7.2 16-16 16H336.5c-.3 0-.6 0-.8 0H240.4c-.3 0-.6 0-.8 0H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H512zM64 416H211.7l-8 48H152c-13.3 0-24 10.7-24 24s10.7 24 24 24h72H352h72c13.3 0 24-10.7 24-24s-10.7-24-24-24H372.3l-8-48H512c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64C28.7 0 0 28.7 0 64V352c0 35.3 28.7 64 64 64zm188.3 48l8-48h55.3l8 48H252.3zM249 177c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-48 48c-9.4 9.4-9.4 24.6 0 33.9l48 48c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-31-31 31-31zM361 143c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l48-48c9.4-9.4 9.4-24.6 0-33.9l-48-48z"/></svg>'}}),di([r({writable:!0})],ui.prototype,"sourceView",void 0),di([r()],ui.prototype,"selectionController",void 0),di([r()],ui.prototype,"valueController",void 0),di([r()],ui.prototype,"vegaRichTextEditorRenderer",void 0),di([r()],ui.prototype,"sourceEditConfig",void 0);var fi=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 pi extends l{constructor(){super(...arguments),this.flushValue=(t,e=!1)=>{if(this.host&&t&&(this.valueController.flushChanges(t,!0),e)){const t=this.host.value.getLastNode();t&&this.selectionController.enqueueSelectionRangeFutureState(t,t.getRangeEndOffset())}},this.isSourceEditMode=()=>this.sourceView,this.getSelectedNodes=()=>this.selectionController.getSelectedNodes()}initialExtensionContext(){if(this.extensions&&this.host)for(const t of this.extensions)t.initialExtension({host:this.host,flushValue:this.flushValue,isSourceEditMode:this.isSourceEditMode,getSelectedNodes:this.getSelectedNodes})}handleExtensionsChange(t,e){Nt(t,e,!1,((t,e)=>t===e?0:1))||this.initialExtensionContext()}}fi([r()],pi.prototype,"extensions",void 0),fi([r()],pi.prototype,"host",void 0),fi([r()],pi.prototype,"sourceView",void 0),fi([r()],pi.prototype,"valueController",void 0),fi([r()],pi.prototype,"selectionController",void 0),fi([c("connectedCallback")],pi.prototype,"initialExtensionContext",null),fi([c("watchExtensions")],pi.prototype,"handleExtensionsChange",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};const mi=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 Vt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.formFieldController=new kt({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new Dt:null}],validationRulesName:"validationRules",defaultValue:null,attributeGetter:t=>this[t],inputContainerGetter:()=>this.vegaRichTextEditorRenderer.getRichTextContainerRef(),touchableAreaGetter:()=>[this.vegaRichTextEditorRenderer.getRichTextContentRef()]}),this.changeEventEmitter=St(mi,g),this.vegaRichTextEditorRenderer=new Jt,this.valueController=new Be,this.selectionController=new Lt,this.focusController=new Ye,this.darkModeStateControllerSlimmer=new At,this.toolbarRenderer=new Xt,this.clearStyleToolbarButtonSlimmer=new oe,this.boldToolbarButtonSlimmer=new Yt,this.italicToolbarButtonSlimmer=new Qt,this.underlineToolbarButtonSlimmer=new te,this.textColorToolbarButtonSlimmer=new yt,this.textStylesToolbarButtonSlimmer=new ie,this.codeToolbarButtonSlimmer=new se,this.strikethroughToolbarButtonSlimmer=new ne,this.imageToolbarButtonSlimmer=new de,this.linkToolbarButtonSlimmer=new re,this.moreIndentToolbarButtonSlimmer=new ce,this.lessIndentToolbarButtonSlimmer=new le,this.bulletsNumbersToolbarButtonSlimmer=new xe,this.horizontalAlignmentToolbarButtonSlimmer=new Te,this.codeBlockToolbarButtonSlimmer=new ai,this.sourceEditToolbarButtonSlimmer=new ui,this.placeholderNotifySlimmer=Ot(mi,"placeholder","watchPlaceholder"),this.disabledNotifySlimmer=Ot(mi,"richTextContentEditable","watchRichTextContentEditable"),this.richTextContentController=new Ee(this),this.userInputController=new qe,this.insertImageController=new Ze,this.insertCompositionTextController=new ii,this.imageInsertedEventEmitter=St(mi,x),this.changeEventPreventSlimmer=new Ft([g],(()=>this.vegaRichTextEditorRenderer.getRichTextWrapperRef())),this.textNodeColorController=new ti,this.deleteSelectedNodesController=new si,this.historyController=new ri,this.internalCodeBlockSelectionController=new hi,this.rteExtensionController=new pi,this.richTextContentEditable=!0,this.selectionMap=new Map,this.isInDarkMode=Pt.isDarkMode(),this.sourceView=!1,this.label="",this.required=!1,this.placeholder="",this.disabled=!1,this.hint="",this.rows=4,this.value=B.createEmptyContent(),this.toolbarItems=bt,this.allowSourceEdit=!1,this.sourceEditConfig={autoMatchFormat:!0},this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.extensions=[]}watchRichTextContentEditable(){}watchPlaceholder(){}watchDisabled(){this.richTextContentController.syncRichTextContentEditable()}watchValueUpdate(){}watchValidationRules(){}watchExtensions(){}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"],extensions:["watchExtensions"]}}};vi([d()],mi.prototype,"globalSlimmers",void 0),vi([a()],mi.prototype,"translationSlimmer",void 0),vi([a()],mi.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),vi([a()],mi.prototype,"formFieldController",void 0),vi([a()],mi.prototype,"changeEventEmitter",void 0),vi([a()],mi.prototype,"vegaRichTextEditorRenderer",void 0),vi([a()],mi.prototype,"valueController",void 0),vi([a()],mi.prototype,"selectionController",void 0),vi([a()],mi.prototype,"focusController",void 0),vi([a()],mi.prototype,"darkModeStateControllerSlimmer",void 0),vi([a()],mi.prototype,"toolbarRenderer",void 0),vi([a()],mi.prototype,"clearStyleToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"boldToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"italicToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"underlineToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"textColorToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"textStylesToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"codeToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"strikethroughToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"imageToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"linkToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"moreIndentToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"lessIndentToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"bulletsNumbersToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"horizontalAlignmentToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"codeBlockToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"sourceEditToolbarButtonSlimmer",void 0),vi([a()],mi.prototype,"placeholderNotifySlimmer",void 0),vi([a()],mi.prototype,"disabledNotifySlimmer",void 0),vi([a()],mi.prototype,"richTextContentController",void 0),vi([a()],mi.prototype,"userInputController",void 0),vi([a()],mi.prototype,"insertImageController",void 0),vi([a()],mi.prototype,"insertCompositionTextController",void 0),vi([a()],mi.prototype,"imageInsertedEventEmitter",void 0),vi([a()],mi.prototype,"changeEventPreventSlimmer",void 0),vi([a()],mi.prototype,"textNodeColorController",void 0),vi([a()],mi.prototype,"deleteSelectedNodesController",void 0),vi([a()],mi.prototype,"historyController",void 0),vi([a()],mi.prototype,"internalCodeBlockSelectionController",void 0),vi([a()],mi.prototype,"rteExtensionController",void 0),mi.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;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}: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 !important}.source-view-container{margin-top:12px}.source-view-container vega-code-block::part(editor-toolbar){display:none}';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.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-hidden":this.hidden,"rich-text-editor-toolbar-button-selected":this.selected},onClick:this.handleClick,disabled:this.disabled,hidden:this.hidden},t("vega-flex",{gap:"size-8",justifyContent:"center",alignItems:"center"},this.icon&&t("vega-icon",{size:"size-16",color:this.iconColor,icon:V.getIconKey(this.icon)}),this.showArrowIcon&&t("vega-icon",{size:"size-8",color:"text-secondary",icon:V.getIconKey("chevron-down")})),t("slot",null))}}V.register({"chevron-down":Wt}),bi([r()],gi.prototype,"disabled",void 0),bi([r()],gi.prototype,"hidden",void 0),bi([r()],gi.prototype,"selected",void 0),bi([r()],gi.prototype,"showArrowIcon",void 0),bi([r()],gi.prototype,"icon",void 0),bi([r()],gi.prototype,"iconColor",void 0),bi([r()],gi.prototype,"clickEventEmitter",void 0);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};const wi=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=St(wi,w),this.eventPrevent=new Ft([w],(()=>this.host),{useCapture:!0,customPreventHandle:t=>{this.disabled&&t.stopImmediatePropagation()}}),this.renderer=new gi,this.disabled=!1,this.hidden=!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)}};xi([d()],wi.prototype,"globalSlimmers",void 0),xi([a()],wi.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),xi([a()],wi.prototype,"clickEventEmitter",void 0),xi([a()],wi.prototype,"eventPrevent",void 0),xi([a()],wi.prototype,"renderer",void 0),wi.style=":host{display:inline-block}:host ::slotted(vega-font.v-font-field-label-sm){line-height:16px}.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))}.rich-text-editor-toolbar-btn.rich-text-editor-toolbar-button-hidden{display:none}";var Ci=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 yi 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,m.addUniqueObserverToNode(t,C,(()=>{this.selected=!0,this.notifyImageSelected(),this.formRef.setValue({alt:this.alt})})),m.addUniqueObserverToNode(t,y,(()=>{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=$t(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=>{m.addUniqueObserverToNode(t,g,(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=>{m.addUniqueObserverToNode(t,w,(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:V.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&&p.notify(v.getSubject(this.parentContainerRef,S),{host:this.host})}notifyImageDeleteButtonClicked(){this.parentContainerRef&&p.notify(v.getSubject(this.parentContainerRef,O),{host:this.host})}}V.register({"trash-can":Ut}),Ci([r({writable:!0})],yi.prototype,"currentPage",void 0),Ci([r({writable:!0})],yi.prototype,"selected",void 0),Ci([r()],yi.prototype,"host",void 0),Ci([r()],yi.prototype,"alt",void 0),Ci([r({writable:!0})],yi.prototype,"size",void 0),Ci([r()],yi.prototype,"changeEventEmitter",void 0),Ci([r()],yi.prototype,"translationSlimmer",void 0),Ci([c("componentDidLoad")],yi.prototype,"findParentContainerRef",null);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};const ji=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new Vt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.renderer=new yi,this.changeEventEmitter=St(ji,g),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)}};Ri([d()],ji.prototype,"globalSlimmers",void 0),Ri([a()],ji.prototype,"translationSlimmer",void 0),Ri([a()],ji.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Ri([a()],ji.prototype,"renderer",void 0),Ri([a()],ji.prototype,"changeEventEmitter",void 0),ji.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 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};class Si 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(){p.notify(v.getSubject(this.host,R),{})}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,m.addUniqueObserverToNode(t,C,(()=>{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})})),m.addUniqueObserverToNode(t,y,(()=>{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=>{m.addUniqueObserverToNode(t,w,(({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(){_t.call(v.getSubject(this.popoverRef,H),this.target)}}ki([r()],Si.prototype,"host",void 0),ki([r({writable:!0})],Si.prototype,"status",void 0),ki([r({writable:!0})],Si.prototype,"record",void 0),ki([r()],Si.prototype,"changeEventEmitter",void 0),ki([r()],Si.prototype,"resetStatusAfterHide",void 0),ki([r()],Si.prototype,"translationSlimmer",void 0),ki([r()],Si.prototype,"target",void 0),ki([c("componentDidLoad")],Si.prototype,"componentDidLoad",null),ki([c("componentDidRender")],Si.prototype,"componentDidRender",null),ki([c("watchStatusChange")],Si.prototype,"watchStatusChange",null),ki([c("watchTargetChange")],Si.prototype,"watchTargetChange",null);var Oi=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 Hi=class{constructor(t){o(this,t),this.vegaChange=s(this,"vegaChange",7),this.change=s(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new Vt,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.renderer=new Si,this.changeEventEmitter=St(Hi,g),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"]}}};Oi([d()],Hi.prototype,"globalSlimmers",void 0),Oi([a()],Hi.prototype,"translationSlimmer",void 0),Oi([a()],Hi.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Oi([a()],Hi.prototype,"renderer",void 0),Oi([a()],Hi.prototype,"changeEventEmitter",void 0),Hi.style=":host{display:contents}:host vega-popover{display:inline}";export{mi as vega_rich_text_editor,wi as vega_rich_text_editor_toolbar_button,ji as vega_rich_text_image_editor,Hi as vega_rich_text_link_editor}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,H as t,r as i,c as s,g as o}from"./p-6b2342e0.js";import{R as r}from"./p-280cbcdb.js";import{s as a}from"./p-519a7d55.js";import{P as n,g as l}from"./p-10ac8b57.js";import{c as p,V as d,M as h,L as c,I as v}from"./p-6e1ab235.js";import{a as f}from"./p-d9671d27.js";import{R as u}from"./p-c0036e71.js";import{D as g,w as m,s as x,t as b,V as w,u as y,v as j,c as I,d as R,g as S,o as D,K as C,L as E}from"./p-8bd496b4.js";import{V as O,I as V}from"./p-d849e0f5.js";import{j as z,k as L,l as T}from"./p-5b71c85e.js";import{i as k}from"./p-d27ae9ff.js";import{C as A}from"./p-2d0d575f.js";import{F as P}from"./p-a528714c.js";import{c as _}from"./p-86194314.js";import{c as N}from"./p-1ec763ab.js";import{c as B}from"./p-613ddaab.js";import{a as F}from"./p-8c9ea6f4.js";import{F as G}from"./p-30e7544c.js";import{c as K}from"./p-f2c8c363.js";import{C as U}from"./p-184d8443.js";import{W as M,Y as W}from"./p-161b9c5b.js";import{M as $}from"./p-78a57a17.js";import{T as q}from"./p-52b8f2d2.js";import{T as H}from"./p-75f981ce.js";import{r as J}from"./p-77e64f26.js";import{I as Y}from"./p-abd7aeaa.js";import"./p-40f39194.js";import"./p-ed45b3b6.js";import"./p-b75ee3ba.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-5f377954.js";import"./p-dd72ad9e.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-ef9cbad1.js";import"./p-331a62d5.js";import"./p-112455b1.js";import"./p-4866e390.js";import"./p-697eb0e1.js";import"./p-79a544d6.js";import"./p-bf61d136.js";import"./p-02841589.js";import"./p-bf19682d.js";import"./p-f69f84a7.js";import"./p-a7b5f497.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-5d676a94.js";import"./p-59fa3f68.js";import"./p-d884c644.js";var Q=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class X extends d{constructor(){super(...arguments),this.renderErrorMessage=()=>e("div",{class:"vega-input-select-error-message"}),this.renderHelpMessage=()=>e("div",{class:"vega-input-select-hint"},this.hint),this.handleLabelButtonClick=()=>{this.labelButtonClickEventEmitter.emit()}}render(){return e(t,{class:f([this.disabled?"vega-input-select-disabled":"",u.formatCustom(this.size)])},this.renderLabel(),this.dropdownRenderer.render(),this.renderErrorMessage(),this.hint&&this.renderHelpMessage())}renderLabel(){return this.label&&e("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,label:this.label,suffixButtonConfig:this.labelSuffixButtonConfig,ref:e=>{g.addUniqueObserverToNode(e,m,this.handleLabelButtonClick)}})}}Q([p()],X.prototype,"disabled",void 0),Q([p()],X.prototype,"size",void 0),Q([p()],X.prototype,"hint",void 0),Q([p()],X.prototype,"label",void 0),Q([p()],X.prototype,"required",void 0),Q([p()],X.prototype,"labelSuffixButtonConfig",void 0),Q([p()],X.prototype,"labelButtonClickEventEmitter",void 0),Q([p({componentFieldName:"vegaInputSelectDropdownRenderer"})],X.prototype,"dropdownRenderer",void 0);var Z=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class ee extends d{constructor(){super(...arguments),this.onDropdownShow=()=>{this.isDropdownShow=!0},this.onDropdownHide=()=>{this.isDropdownShow=!1}}addDropdownObserver(e){g.addUniqueObserverToNode(e,x,(e=>{this.onDropdownShow(),this.showEventEmitter.emit(e.detail)})),g.addUniqueObserverToNode(e,b,(e=>{this.onDropdownHide(),this.hideEventEmitter.emit(e.detail)})),g.addUniqueObserverToNode(e,w,(async e=>{this.vegaInputSelectValueController.setValue(await e.host.getSelection())})),g.addUniqueObserverToNode(e,y,(e=>{this.searchEventEmitter.emit(e.detail)})),g.addUniqueObserverToNode(e,j,(e=>{this.searchTriggerEventEmitter.emit(e.detail)})),g.addUniqueObserverToNode(e,z,(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)})),g.addUniqueObserverToNode(e,I,(async()=>{this.vegaInputSelectValueController.setValue("multiple"===this.selectType?[]:"")}))}}Z([p({writable:!0})],ee.prototype,"isDropdownShow",void 0),Z([p()],ee.prototype,"vegaSearch",void 0),Z([p()],ee.prototype,"searchEventEmitter",void 0),Z([p()],ee.prototype,"searchTriggerEventEmitter",void 0),Z([p()],ee.prototype,"vegaInputSelectValueController",void 0),Z([p()],ee.prototype,"sourceController",void 0),Z([p()],ee.prototype,"source",void 0),Z([p()],ee.prototype,"showEventEmitter",void 0),Z([p()],ee.prototype,"hideEventEmitter",void 0),Z([p()],ee.prototype,"selectType",void 0);var te=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class ie extends d{constructor(){super(...arguments),this.handleValueChange=(e,t)=>{if("multiple"===this.selectType){let i;t=t,i=(e=e)?this.vegaDropdownProps.preserveValueIfNotInSource?e:e.filter((e=>this.sourceController.getItem(e))):[],k(i,t,!0)?k(i,e,!0)||this.setValue(i):(this.setValue(i),this.changeEventEmitter.emit(i),A.notify(P,{host:this.host,detail:i}))}else if(e!==t){const t=this.sourceController.getItem(e);this.setValue(this.vegaDropdownProps.preserveValueIfNotInSource?e:t?t.id:""),this.changeEventEmitter.emit(this.value),A.notify(P,{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 c.warn(`Invalid input select value ${e} for ${this.selectType} mode`),!1}}}te([p({writable:!0})],ie.prototype,"value",void 0),te([p()],ie.prototype,"selectType",void 0),te([p()],ie.prototype,"changeEventEmitter",void 0),te([p()],ie.prototype,"host",void 0),te([p()],ie.prototype,"sourceController",void 0),te([p()],ie.prototype,"vegaDropdownProps",void 0),te([h("watchValue")],ie.prototype,"handleValueChange",void 0);var se=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class oe 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:F.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=()=>{if(this.value.length>0){const t=this.selectedLabel(this.value);return e("span",{class:"vega-input-select-selected"},e("vega-text",{overflow:"ellipsis",tooltip:{placement:"bottom"},key:t},t))}return e("div",{class:"vega-input-select-placeholder"},this.translationSlimmer.t(this.placeholder))},this.renderSingleSelected=()=>{const t=this.sourceController.getItem(this.value);return t||this.vegaDropdownProps.preserveValueIfNotInSource&&this.value?e("span",{class:"vega-input-select-selected",part:"selected-box"},e("vega-text",{overflow:"ellipsis",tooltip:{placement:"bottom"},key:this.vegaDropdownProps.preserveValueIfNotInSource?this.value:t.displayName},this.vegaDropdownProps.preserveValueIfNotInSource?this.value: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)}watchVegaDropdownProps(){this.vegaDropdownProps&&void 0!==this.vegaDropdownProps.preserveValueIfNotInSource&&(this.dropdown.preserveValueIfNotInSource=this.vegaDropdownProps.preserveValueIfNotInSource,this.dropdown.selectedSourceKey=this.value)}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})))}}F.register({"chevron-up":N,"chevron-down":B}),se([p()],oe.prototype,"value",void 0),se([p()],oe.prototype,"source",void 0),se([p()],oe.prototype,"host",void 0),se([p()],oe.prototype,"selectType",void 0),se([p()],oe.prototype,"isDropdownShow",void 0),se([p()],oe.prototype,"vegaDropdownProps",void 0),se([p()],oe.prototype,"placeholder",void 0),se([p()],oe.prototype,"selectedLabel",void 0),se([p()],oe.prototype,"isLazyLoading",void 0),se([p()],oe.prototype,"vegaInputSelectDropdownController",void 0),se([p()],oe.prototype,"vegaInputSelectPrefixIconRenderer",void 0),se([p()],oe.prototype,"sourceController",void 0),se([p()],oe.prototype,"translationSlimmer",void 0),se([p()],oe.prototype,"disabled",void 0),se([h("watchVegaDropdownProps")],oe.prototype,"watchVegaDropdownProps",null);var re=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class ae extends d{constructor(){super(...arguments),this.hasMore=!0}componentDidLoad(){const e=this.getVirtualScroll();e&&g.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}}}re([p()],ae.prototype,"sourceLazyLoadCallback",void 0),re([p({writable:!0})],ae.prototype,"isLazyLoading",void 0),re([p()],ae.prototype,"sourceController",void 0),re([p()],ae.prototype,"vegaInputSelectDropdownRenderer",void 0),re([h("componentDidLoad")],ae.prototype,"componentDidLoad",null);const ne=[{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 le=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class pe extends d{constructor(){super(...arguments),this.handleSourceChange=()=>{this.host.dataset.source=JSON.stringify(this.source),this.source=M(this.source,W)?this.source:[]}}appendSourceItems(e){this.source=[...this.source,...e]}getItem(e){return this.source.find((t=>t.id===e))}}le([p()],pe.prototype,"host",void 0),le([p({writable:!0})],pe.prototype,"source",void 0),le([h("watchSource")],pe.prototype,"handleSourceChange",void 0);var de=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class he extends d{constructor(){super(...arguments),this.mutationObserver=new $({mutationFilter:q("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))}}de([v()],he.prototype,"mutationObserver",void 0),de([p()],he.prototype,"host",void 0),de([p()],he.prototype,"vegaInputSelectDropdownRenderer",void 0),de([h("componentDidLoad")],he.prototype,"componentDidLoad",null);var ce=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class ve extends d{connectedCallback(){this.remotePhoneNumberPrefixIconRenderSubject=R.getSubjectFromParentNodeByEventId(this.host,T)}callRemotePrefixIconRender(...e){if(this.remotePhoneNumberPrefixIconRenderSubject){const t=J.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"}))}}ce([p()],ve.prototype,"host",void 0),ce([p()],ve.prototype,"prefixIcon",void 0),ce([h("connectedCallback")],ve.prototype,"connectedCallback",null);class fe extends Y{constructor(e){super(),this.inputSelectSourceGetter=e,this.invalidResult=e=>({isValid:!1,message:e}),this.validResult=()=>({isValid:!0,message:""})}canEvaluate(e,t){return t?this.isAcceptedInputType(e)&&!t.disabled&&t.visible:this.isAcceptedInputType(e)}evaluate(e){return"string"!=typeof e||this.inputSelectSourceGetter().find((t=>t.id===e))?Array.isArray(e)&&!e.every((e=>this.inputSelectSourceGetter().find((t=>t.id===e))))?this.invalidResult("There are values that do not exist in the source"):this.validResult():this.invalidResult("The value does not exist in the source")}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){return("string"==typeof e||Array.isArray(e)&&e.every((e=>"string"==typeof e)))&&e.length>0}}var ue=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};const ge=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.vegaLabelButtonClick=s(this,"vegaLabelButtonClick",7),this.labelButtonClick=s(this,"labelButtonClick",7),this.globalSlimmers={},this.translationSlimmer=new H,this.sourceController=new pe,this.vegaInputSelectRenderer=new X,this.vegaInputSelectPrefixIconRenderer=new ve,this.vegaInputSelectDropdownController=new ee,this.vegaInputSelectValueController=new ie,this.vegaInputSelectDropdownRenderer=new oe,this.vegaInputSelectItemsSlotController=new he,this.formFieldControllerSlimmer=new G({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new r:null},{propertyName:"data-source",ruleFactory:()=>new fe((()=>this.source))}],validationRulesName:"validationRules",defaultValue:e=>"multiple"===e.selectType?[]:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.vegaInputSelectDropdownRenderer.getDropdownRef(),touchableAreaGetter:()=>[this.vegaInputSelectDropdownRenderer.getInputSelectContainerRef()]}),this.pageResizeObserverSlimmer=new n,this.lazyLoadController=new ae,this.changeEventEmitter=K(ge,S),this.searchEventEmitter=K(ge,D),this.searchTriggerEventEmitter=K(ge,j),this.showEventEmitter=K(ge,C),this.hideEventEmitter=K(ge,E),this.labelButtonClickEventEmitter=K(ge,m),this.eventPrevent=new U([D,j,C,E],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new O(ne),this.isDropdownShow=!1,this.currentBreakpoint=l(),this.isLazyLoading=!1,this.label="",this.labelSuffixButtonConfig=null,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(){}watchVegaDropdownProps(){}componentWillLoad(){}async doClose(){await this.vegaInputSelectDropdownRenderer.hide()}async doOpen(){await this.vegaInputSelectDropdownRenderer.show()}async doChange(e){this.vegaInputSelectValueController.setValue(e)}render(){return a(this.vegaInputSelectRenderer.render(),this.host)}get host(){return o(this)}static get watchers(){return{source:["watchSource"],value:["watchValue"],validationRules:["watchValidationRules"],vegaDropdownProps:["watchVegaDropdownProps"]}}};ue([V()],ge.prototype,"globalSlimmers",void 0),ue([v()],ge.prototype,"translationSlimmer",void 0),ue([v()],ge.prototype,"sourceController",void 0),ue([v()],ge.prototype,"vegaInputSelectRenderer",void 0),ue([v()],ge.prototype,"vegaInputSelectPrefixIconRenderer",void 0),ue([v()],ge.prototype,"vegaInputSelectDropdownController",void 0),ue([v()],ge.prototype,"vegaInputSelectValueController",void 0),ue([v()],ge.prototype,"vegaInputSelectDropdownRenderer",void 0),ue([v()],ge.prototype,"vegaInputSelectItemsSlotController",void 0),ue([v()],ge.prototype,"formFieldControllerSlimmer",void 0),ue([v()],ge.prototype,"pageResizeObserverSlimmer",void 0),ue([v()],ge.prototype,"lazyLoadController",void 0),ue([v()],ge.prototype,"changeEventEmitter",void 0),ue([v()],ge.prototype,"searchEventEmitter",void 0),ue([v()],ge.prototype,"searchTriggerEventEmitter",void 0),ue([v()],ge.prototype,"showEventEmitter",void 0),ue([v()],ge.prototype,"hideEventEmitter",void 0),ue([v()],ge.prototype,"labelButtonClickEventEmitter",void 0),ue([v()],ge.prototype,"eventPrevent",void 0),ue([v()],ge.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ge.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}vega-field-label{margin-bottom:8px}: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-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));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{ge as vega_input_select}
|
package/dist/vega/p-79a544d6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as t,e,b as n,h as s,A as r,T as o,B as i,H as a,l,c,m as d,n as h,o as u,p as m,q as w,I as T,r as E,S as p,j as g,t as R,u as k,f,v as B,w as b,C as I,x,s as O,N as L,y as N,z as y,D as A,E as C,F as j,G as H,M as S,J as v,K as D,U as M,L as P,O as V,P as F,R as U}from"./p-bf61d136.js";import{g as z}from"./p-a4670e23.js";import{i as $}from"./p-161b9c5b.js";import{C as G}from"./p-2d0d575f.js";import{d as J}from"./p-8bd496b4.js";import{a as W,b as K}from"./p-5b71c85e.js";import{d as X}from"./p-02841589.js";import{r as Y,i as Z}from"./p-d9671d27.js";import{c as _}from"./p-bf19682d.js";import{L as Q}from"./p-6e1ab235.js";class RTEListItemBlock extends e{constructor(t,e,n){super(t,"list-item",n),this.nestList=[],this.nestList=e}static from(t,e={autoMatchFormat:!0}){const s=new RTEListItemBlock(t.id,void 0,e);s.children=t.nodes.map((t=>n.from(t,s,e))),t.children&&(s.nestList=t.children.map((t=>{const e=RTEListBlock.from(t);return e.parent=s,e})));const{annotations:r}=t;return r&&Object.entries(r).forEach((([t,e])=>{const n=this.createAnnotationEntity(t,e);$(n)&&s.annotationMap.set(...n)})),s}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.nestList)||void 0===t?void 0:t.map((t=>t.toJSON()))})}toHtml(){return[`<li${super.generateAttributeString()}>`,this.children.map((t=>t.toHtml())).join(""),"</li>"].join("")}cloneWithNodes(t){const e=new RTEListItemBlock(z());return e.children=[],e.apply(new s(t)),e}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new RTEListItemBlock(z())}clone(t){var e;const n=new RTEListItemBlock(this.id);return n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((t=>t.clone(n))),n.parent=t,n}}r.register(o.name,RTEListItemBlock.name,new i),r.register(a.name,RTEListItemBlock.name,new l),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEListItemBlock.name,new d),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEListItemBlock.name,new h),r.register(c.DELETE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.nestList&&(e.nestList=e.nestList.length>1?e.nestList.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEListItemBlock.name,new u),r.register(c.REPLACE_CHILD_NODES,RTEListItemBlock.name,new m),r.register(c.REPLACE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.nestList=t.newList}}),r.register(c.MERGE_TWO_BLOCKS_NODES,RTEListItemBlock.name,new w),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.parent.apply(t)}});class q extends R{constructor(){super(...arguments),this.type=k.LIST}renderStyle(t){return(null==t?void 0:t.standalone)?{paddingLeft:"8px",marginLeft:"16px"}:null}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--list"}clone(){return new q}toJSON(){}}class RTEListBlock extends f{constructor(t,e,n){super(t),this.type="bullet-list",this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(k.LIST,new q)}static from(t,e={autoMatchFormat:!0}){const n=new RTEListBlock(t.id,t.type,e),{annotations:s}=t;return s&&Object.entries(s).forEach((([t,e])=>{const s=this.createAnnotationEntity(t,e);$(s)&&n.annotationMap.set(...s)})),n.children=t.blocks.map((t=>{const s=RTEListItemBlock.from(t,e);return s.parent=n,s})),n}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return I.from(e);case"customClass":return b.from(e);case"customStyle":return B.from(e)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((t=>t.toJSON()))})}toHtml(){const t=this.getBlockTag();return[`<${t}${super.generateAttributeString()}>`,this.children.map((t=>t.toHtml())).join(""),`</${t}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(t){const e=new RTEListBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(c.TRANSFORM_LIST_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,r=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))r.apply(new s(e.children)),e.parent.apply(new T(e,r)),e.parent.apply(new E(e)),n.forEach((t=>t.children.map((t=>t.apply(new p)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));r.apply(new s(n)),e.parent.apply(new T(e,r)),t.selectedBlocks.forEach((t=>{t.parent.apply(new E(t))})),0===e.children.length&&e.parent.apply(new E(e))}}}),r.register(c.TRANSFORM_PARAGRAPH_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){let n=!1,r=!1;const o=t.selectedBlocks,i=o.map((t=>(t.children.map((t=>t.apply(new p))),t===e.children[0]&&(n=!0),t===e.children[e.children.length-1]&&(r=!0),this.toParagraph(t))));if(n)e.parent.apply(new g(e,...i));else if(r)e.parent.apply(new T(e,...i));else{const t=e.children.indexOf(o[0]),n=e.children.indexOf(o[o.length-1]),r=e.parent.createList(e.type);r.apply(new s(e.children.slice(0,t)));const a=e.parent.createList(e.type);a.apply(new s(e.children.slice(n+1))),e.parent.apply(new g(e,r,...i,a)),e.parent.apply(new E(e))}o.map((t=>{e.apply(new E(t))})),0===e.children.length&&e.parent.apply(new E(e))}toParagraph(t){const n=new e(z(),"paragraph");return n.apply(new s(t.children)),n.annotationMap=t.annotationMap,n}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new T(e,t.imageBlockToBeInserted):t)}});class tt{}class et{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const e=this.currentStrategy.handle(this.currentElements,t);return this.childrenOutput.length>0&&e&&this.currentStrategy.appendChildBlocks(e,this.childrenOutput.map((e=>e.toDto(t))).filter($)),e}}const nt=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(t){this.hasDuplicateStrategy(t,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(t)}registerElementToNodeStrategy(t){this.hasDuplicateStrategy(t,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(t)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(t,e){return e.includes(t)}},st=new class{process(t,e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<t.length;r++){if(this.isInvalidElement(t[r]))continue;let o=0;for(const i of n)if(o=i.canHandle(t,r,e),o>0){const n=t.slice(r,r+o),a=new et(i,n);1===o&&i.shouldProceedToElementChildren()&&a.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(a),r+=o-1;break}if(0===o&&r<t.length){const n=Array.from(t[r].childNodes),o=this.process(Array.from(n),e);o.length>0&&s.push(...o)}}return s}isInvalidElement(t){return t.nodeType===Node.COMMENT_NODE||["META","STYLE"].includes(t.nodeName)}getElementToBlockStrategies(){return nt.getElementToBlockStrategies()}};class rt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class ot extends t{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[...t.childrenToBeInserted,t.referChildren])}replaceElementWithElements(t,e,n){t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?n:t)))}}class it extends ot{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class at extends L{constructor(t,e){super(),this.type=N.IMAGE,this.size=t,this.alt=e}static from(t,e){return[N.IMAGE,new at(t,e)]}toJSON(){return $(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new at(this.size,this.alt)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e={verticalAlign:"bottom"};switch(this.size){case"sm":return Object.assign(Object.assign({},e),{width:"25%"});case"md":return Object.assign(Object.assign({},e),{width:"50%"});case"lg":return Object.assign(Object.assign({},e),{width:"100%"})}}}class RTEImageNode extends y{constructor(t,e,n,s){super(t,s),this.type=A.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new RTEImageNode(t.id,t.url,e),r=!!n.autoMatchFormat,o=Object.assign({},t.annotations),{size:i}=o,a=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(o,["size"]),l=Object.assign(Object.assign({},a),{size:null!=i?i:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?at.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter($)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof at||t instanceof C)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new RTEImageNode(this.id,this.url,t,super.cloneAnnotations())}toHtml(){const t=this.getAnnotationByType(N.IMAGE);return`<img${super.generateAttributeString(...[t&&t.alt?`alt="${t.alt}"`:null,`src="${this.url}"`,t&&t.size?`data-size="${t.size}"`:null].filter($))}>`}doAnnotationActionApply(t){const e=r.get(j.name,RTEImageNode.name);e&&e.execute(t,this)}doModifyActionApply(t){r.executeTheStrategy(t,this)}}r.register(c.UPDATE_IMAGE_NODE_URL,RTEImageNode.name,new class extends t{handleAction(t,e){e.url=t.url}}),r.register(j.name,RTEImageNode.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class lt extends S{constructor(t,e){super(),this.type=c.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class RTEImageBlock extends f{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new RTEImageBlock(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>RTEImageNode.from(t,n,e))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((t=>t.toJSON()))})}toHtml(){const t=super.generateAttributeString(),e=this.children.map((t=>t.toHtml())).join("");return super.shouldRenderAsInternalWrapper()?e:[`<div${t}>`,e,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new RTEImageBlock(z())}clone(t){const e=new RTEImageBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}r.register(c.MERGE_TWO_BLOCKS_NODES,RTEImageBlock.name,new w),r.register(c.REPLACE_CHILD_NODES,RTEImageBlock.name,new m),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEImageBlock.name,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new H(t));const o=this.cloneWithNodes(r,n);return n.parent.apply(new T(n,o)),o}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new s(t)),n}}),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=new lt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEImageBlock.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,r){const o=e.from({id:z(),type:"paragraph",nodes:[{id:z(),type:"text",text:"\n"}]});r.parent.apply(new T(r,o));const i=this.concatBlocksNodes(t.slice(1));return(0===i.length||i[0]&&""===i[0].text)&&i.push(new n(z(),"\n",o)),o.apply(new s(i)),o.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new E(t)))})),e}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=t.splitPointNode,r=t.startOffsetOfNode,o=t.imageBlockToBeInserted;e.children.length<1?e.apply(new s(o.children)):this.isCaretPositionAtBlockEnd(e,n,r)?e.parent.apply(new T(e,o)):this.isCaretPositionAtBlockStart(e,n,r)?e.parent.apply(new g(e,o)):(e.apply(new v(n,r)),e.parent.apply(new T(e,o)))}}),r.register(a.name,RTEImageBlock.name,new l);class RTEHtmlBlock extends f{constructor(t,e){super(t),this.type="html-block",this.children=[],this.htmlTag=e}static from(t,e){const n=new RTEHtmlBlock(t.id,t.htmlTag),{annotations:s}=t;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=this.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTEHtmlBlock(this.id,this.htmlTag);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(){const t=this.htmlTag;return[`<${t}${super.generateAttributeString()}>`,this.children.map((t=>t.toHtml())).join(""),`</${t}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((t=>t.toJSON()))})}}class ct extends S{constructor(t){super(),this.type=c.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class dt extends D{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const s=e.parent;s&&e.isListItemBlock()&&0===s.children.length&&s.parent.apply(new E(s))}deleteTextNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new M(r)),r)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===e&&"\n"===s.text||1===e.children.length?void(t.previousNode=n):(e.apply(new E(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const o=n.isEmpty();if(e.children.length&&s&&s.parent!==e)o&&e.apply(new E(n)),e.type===s.parent.type&&s.parent.apply(new ct(e));else if(this.isContentFirstNode(n)&&o&&(r=this.getNextNode(n)),o&&e.apply(new E(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===e)){const t=s;s=this.getPreviousNode(s),t.parent.apply(new E(t)),s||o||(r=n)}0===e.children.length&&e.parent.apply(new E(e)),s?t.previousNode=s:r&&(t.nextNode=r)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let r=this.getPreviousNode(n),o=null;if(0!==s){const t=e;this.isContentFirstNode(n)&&(o=this.getNextNode(n)),1===t.children.length?t.parent.apply(new E(t)):t.apply(new E(n))}else{const e=r;e&&!e.isContentEditable()&&(r=this.getPreviousNode(e),e.parent.apply(new E(e)),r||(t.nextNode=n))}r?t.previousNode=r:o&&(t.nextNode=o)}}class ht extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,n){const s=this.getNewParagraph(t);if(s){if(this.isCaretPositionAtBlockEnd(n,t,e))n.parent.apply(new T(n,s));else{if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new v(t,e);return n.apply(s),s.newBlock}n.parent.apply(new g(n,s))}return s}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(N.LINK),e.apply(new s([n]))),e}}}class ut extends S{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=c.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class mt extends t{handleAction(t,e){const{rteRange:n,nodeToBeInserted:s}=t,{startNode:r,startOffset:o}=n;if(r){const t=e;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==o){const e=r.text.substring(0,o),n=r.text.substring(o),i=r.cloneWithText(e),a=r.cloneWithText(n),l=[i,s];n&&l.push(a),t.apply(new g(r,...l)),t.apply(new E(r))}else t.apply(new g(r,s));else t.apply(0!==o?new T(r,s):new g(r,s));this.updateCursorPosition(s)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new ut(t))}}class wt extends t{handleAction(t,e){const{text:n,offset:s,decoratorNode:r}=t,o=this.createNewParagraph(n);if(o){const t=o.children[0];e.apply(0!==s?new T(r,t):new g(r,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new ut(t))}}class Tt extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const r=n.createNewListItem(),o=this.copyInlineStyleToNewNode(t);if(r.apply(new s([o])),this.isCaretPositionAtBlockEnd(n,t,e))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new v(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new g(n,r)),r}breakListItemAtEnd(t,n){const r=n.parent.children[n.parent.children.length-1],o=1===n.children.length&&n.children[0].isEmpty();if(n===r&&o){const r=n.parent.parent;if("list-item"!==r.type){const o=e.from({id:z(),type:"paragraph",nodes:[]});return o.apply(new s(t.children)),r.apply(new T(n.parent,o)),n.parent.apply(new E(n)),o}r.parent.apply(new T(r,t)),n.parent.apply(new E(n))}else n.parent.apply(new T(n,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(N.LINK),e}}class Et extends S{constructor(t){super(),this.type=c.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class pt extends P{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.children.length&&n&&n.apply("list-item"===n.type?new Et(e):new E(e))}}class gt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t;let o=e;if(s===e.children[0]&&0===r)e.parent.apply(new g(e,...n));else{const t=new v(s,r);e.apply(t),e.parent.apply(new T(e,...n)),o=t.newBlock}t.futureFocusBlock=o}}}const Rt=new class{registerBlockBasicStrategies(t){r.register(c.DELETE_CHILDREN,t,t===RTEListBlock.name?new pt:new P),r.register(c.APPEND_CHILDREN,t,new rt),r.register(c.INSERT_CHILDREN_BEFORE,t,new ot),r.register(c.INSERT_CHILDREN_AFTER,t,new it),r.register(c.DELETE_BLOCK_CONTENT,t,new dt),r.register(c.INSERT_NEW_PARAGRAPH,t,t===RTEListItemBlock.name?new Tt:new ht),r.register(c.INSERT_TEXT_TO_DECORATOR_NODE,t,new wt),r.register(c.INSERT_NODE_TO_NEAREST_ROOT,t,new mt),r.register(c.PASTE_CONTENT,t,new gt)}};class kt{}class ft extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||"bold"===t.style.fontWeight||"700"===t.style.fontWeight||t.classList.contains("v-rte--bold")}}class Bt extends kt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getAttributes(t);return Object.keys(e).length>0?{customAttribute:e}:{}}getAttributes(t){return t.getAttributeNames().filter((t=>"style"!==t&&"class"!==t&&this.isValidAttr(t))).reduce(((e,n)=>(e[n]=t.getAttribute(n),e)),{})}isValidAttr(t){return/^[a-zA-Z_][\w-]*$/.test(t)}}class bt extends kt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getCustomClass(t);return e.length>0?{customClass:e}:{}}getCustomClass(t){return t.classList.toString().split(" ").filter((t=>!t.includes("v-rte")&&""!==t))}}class It extends kt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.generateCustomStyleAnnotations(t);return Object.keys(e).length>0?{customStyle:e}:{}}generateCustomStyleAnnotations(t){const e=t.getAttribute("style");return e?e.split(";").filter(Boolean).filter((t=>" "!==t)).map((t=>{const e=t.replace(/(['"])(.*?)\1/g,"$2").split(":");return{[X(e[0].trim())]:e[1].trim().replace(";","")}})).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{}):{}}}class xt extends kt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Ot extends kt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}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}}}class Lt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Nt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=Y(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=V.filter((t=>t.key!==F.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of V)if(t.style.color.includes(e.key))return e.key;return null}}class yt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||"italic"===t.style.fontStyle||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class At extends kt{constructor(){super(...arguments),this.handlers=[new Bt,new bt,new It]}canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return e.link?{link:e.link}:"A"===t.tagName?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:z()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Ct extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes("line-through")||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class jt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes("underline")||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Ht extends kt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.name}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByNodeName(t);if(n)return n;const s=this.getElementTypeByFontSize(t);if(s)return s;return this.getElementTypeByClassName(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;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";default:return null}}getElementTypeByNodeName(t){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 null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte--text-style-(title|subtitle|heading-1|heading-2|heading-3|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class St extends kt{canHandle(t){return"RTEImageNode"===t.name}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class vt extends kt{canHandle(t){return"RTEImageNode"===t.name}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}class Dt extends kt{constructor(){super(...arguments),this.customAttributeHandler=new Bt,this.customStyleAnnotationHandler=new It,this.customClassAnnotationHandler=new bt}canHandle(t,e){return"RTETextNode"===t.name&&!1===e.autoMatchFormat}handle(t,e){if(Dt.canHandleTags.includes(t.nodeName)){const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));if(n)return{inlineHtml:n}}return{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:s}=e;if(!n.supportsHtmlTag(t.nodeName.toLowerCase())||1===t.childNodes.length&&t.childNodes[0].nodeType!==Node.TEXT_NODE){const e={htmlTag:t.nodeName.toLowerCase(),customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass};if(s){let n=s;for(;n.child&&t.parentNode&&n.child.htmlTag===t.parentNode.nodeName.toLowerCase();)n=n.child;n.child=e}else s=e}return s?Object.assign({},s):null}}Dt.canHandleTags=["A","ABBR","AUDIO","B","BDI","BDO","CITE","CODE","DEL","DFN","EMBED","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR","VIDEO"];const Mt=new class{constructor(){this.handlers=[new Ot,new xt,new ft,new yt,new jt,new Ct,new Nt,new At,new Lt,new St,new vt,new Bt,new bt,new It,new At,new Ht,new Dt]}generate(t,e,n={autoMatchFormat:!0}){const s="A"===e.tagName;return this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof At)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{})}};class Pt extends tt{constructor(){super(...arguments),this.annotationHandler=new Ht}generateChildNodes(t,e,s){const r=[],o=!(!s||!1!==s.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const a=nt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,s)>0));let l=null;if(a&&(l=a.handle([t],s,i)),l)r.push(l);else if(Z(t)&&t.childNodes.length>0){const a=Mt.generate(n,t,Object.assign({parentAnnotations:o?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},s));r.push(...this.generateChildNodes(Array.from(t.childNodes),a,s))}})),r}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class Vt extends Pt{canHandle(t,e,n){const s=t[e];return!n.autoMatchFormat&&("DIV"!==s.nodeName||s.childNodes.length>0&&"IMG"!==s.childNodes[0].nodeName)&&Vt.canHandleTags.includes(t[e].nodeName)?1:0}handle(t,e){return RTEHtmlBlock.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}generateHtmlBlock(t,e){return{id:z(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:Mt.generate(RTEHtmlBlock,t,e),children:[]}}}Vt.canHandleTags=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","BUTTON","CAPTION","COL","COLGROUP","DIV","DD","DETAILS","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","HEADER","HR","HX","INPUT","LEGEND","MAIN","NAV","PRE","SECTION","SUMMARY","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR"];class Ft extends Pt{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,n=e.dataset.language;return x.from({id:z(),type:"code-block",content:t,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class Ut extends Pt{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return RTEImageBlock.from({id:z(),type:"image",nodes:[{id:z(),type:"image",url:t.src,annotations:Mt.generate(RTEImageNode,t,e)}],annotations:Object.assign(Object.assign({},Mt.generate(RTEImageBlock,t.parentElement,e)),{internalWrapper:n})},e)}}class zt extends Pt{canHandle(t,e){let n=0;for(let s=e;s<t.length;s++){const e=t[s];if(e.nodeType!==Node.TEXT_NODE&&(!zt.canHandleTags.includes(e.nodeName)||""===e.textContent&&e.querySelector("IMG")))break;n++}return n}handle(t,s){const r=t[0].parentElement,o=s&&s.autoMatchFormat,i=this.generateChildNodes(t,o?Mt.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),a=o?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),l=!o&&!a;return e.from(Object.assign({id:z(),type:a||"paragraph",nodes:i},l?{annotations:{internalWrapper:l}}:{annotations:Mt.generate(e,r,s)}),s)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}}zt.canHandleTags=[...Dt.canHandleTags,"CODE","A","VEGA-RICH-TEXT-LINK-EDITOR","BR"];class $t extends tt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:z(),type:"text",text:t,annotations:e}}}U.registerRTEDTOClass("paragraph",e),U.registerRTEDTOClass("title",e),U.registerRTEDTOClass("subtitle",e),U.registerRTEDTOClass("heading-1",e),U.registerRTEDTOClass("heading-2",e),U.registerRTEDTOClass("heading-3",e),U.registerRTEDTOClass("heading-4",e),U.registerRTEDTOClass("heading-5",e),U.registerRTEDTOClass("heading-6",e),U.registerRTEDTOClass("heading-6",e),U.registerRTEDTOClass("list-item",RTEListItemBlock),U.registerRTEDTOClass("bullet-list",RTEListBlock),U.registerRTEDTOClass("number-list",RTEListBlock),U.registerRTEDTOClass("image",RTEImageBlock),U.registerRTEDTOClass("code-block",x),U.registerRTEDTOClass("html-block",RTEHtmlBlock),U.registerRTEDTOClass("text",n),U.registerRTEDTOClass("image",RTEImageNode),Rt.registerBlockBasicStrategies(e.name),Rt.registerBlockBasicStrategies(RTEListBlock.name),Rt.registerBlockBasicStrategies(RTEListItemBlock.name),Rt.registerBlockBasicStrategies(RTEImageBlock.name),Rt.registerBlockBasicStrategies(RTEHtmlBlock.name),nt.registerElementToBlockStrategy(new zt),nt.registerElementToBlockStrategy(new class extends Ut{canHandle(t,e){const n=t[e];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(t,e){const n=t[0].querySelector("img");return this.createRTEImageBlock(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Ut{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t,e){const n=t[0],s=n.querySelector("img");if($(s))return RTEImageBlock.from({id:z(),type:"image",nodes:[{id:z(),type:"image",url:s.src,annotations:Mt.generate(RTEImageNode,n,e)}],annotations:Mt.generate(RTEImageBlock,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Ut{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,n){const s=this.generateChildNodes(Array.from(t[0].childNodes),{},n);return 0===s.length?null:e.from({id:z(),type:super.matchTextBlockType(t[0]),nodes:s,annotations:Mt.generate(e,t[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new Ft),nt.registerElementToBlockStrategy(new class extends Ft{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],n=e.querySelector("code");if(n)return super.handle([n]);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}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){if(!["UL","OL"].includes(t[e].parentElement.nodeName)&&t.some((t=>"LI"===t.nodeName))){let n=0;for(let s=e;s<t.length&&"LI"===t[s].nodeName;s++)n++;return n}return"LI"===t[e].tagName?1:0}handle(t,e){const n=t[0];return["UL","OL"].includes(n.parentElement.nodeName)?RTEListItemBlock.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return RTEListBlock.from({id:z(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:z(),type:"list-item",annotations:Mt.generate(RTEListItemBlock,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),Mt.generate(n,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,o=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),i=$(s)&&["UL","OL"].includes(s.nodeName);return r&&!o&&i?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return RTEListItemBlock.from({id:z(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:z(),type:"number-list",blocks:[],annotations:Mt.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:z(),type:"bullet-list",blocks:[],annotations:Mt.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),nt.registerElementToBlockStrategy(new Vt),nt.registerElementToNodeStrategy(new class extends $t{canHandle(t,e){const n=t[e];return!Z(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,s){const r=!(!e||!1!==e.autoMatchFormat),o=Object.assign({},s),i=t[0],a=Mt.generate(n,i,Object.assign({parentAnnotations:r?{inlineHtml:o.inlineHtml,link:o.link,code:o.code}:s},e));if("BR"===i.nodeName)return this.generateTextNode("\n",a);if(0===i.childNodes.length){const t=r?_(Object.assign(Object.assign({},n.supportsHtmlTag(i.nodeName.toLowerCase())?a:{}),{inlineHtml:a.inlineHtml,plainText:$(a.inlineHtml)})):a;return Object.assign({},this.generateTextNode("",t))}}}),nt.registerElementToNodeStrategy(new class extends $t{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,s){const r=Object.assign({},s),o=!(!e||!1!==e.autoMatchFormat),i=t[0],a=i.parentNode.nodeName.toLowerCase(),l=o&&!n.supportsHtmlTag(a),c=this.generateTextNode(String(i.textContent),o?_(Object.assign(Object.assign({},"span"===a?r:{link:r.link,code:"code"===a?r.code:void 0}),{inlineHtml:r.inlineHtml,plainText:l||void 0})):r);return Object.assign({},c)}});class Gt{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new Jt(e)}}class Jt{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(Z(t)){const e=t.getAttribute("data-style");e&&(t.style.cssText=e,t.removeAttribute("data-style")),t.children.length>0&&this.walkNodes(Array.from(t.children))}}))}}class VegaRTEContent{constructor(t){t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=U.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new VegaRTEContent(n)}static createEmptyContent(){return VegaRTEContent.fromJSON([{id:z(),type:"paragraph",nodes:[{id:z(),type:"text",text:""}]}])}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=t.replace(/>\s+<\/?/g,(t=>t.endsWith("</")?t:"><")).replace(/(>)[\n\t]+(?=[a-zA-Z0-9_\W])/g,"$1").replace(/([a-zA-Z0-9_\W])[\n\t]+(?=<)/g,"$1"),s=Gt.preserve(n),r=s.getProcessedHtml(),o=(new DOMParser).parseFromString(r,"text/html").body,i=Array.from(o.childNodes);s.restore(i);const a=st.process(i,e).filter($).map((t=>t.toDto(e))).filter($);return new VegaRTEContent(a)}clone(t=!1){return new VegaRTEContent(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&Q.warn("The 'options' parameter in toHtml method is deprecated and will be removed in the future."),this.children.map((t=>t.toHtml())).join("")}apply(t){if(r.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=O.getDOMByEntity(this);t&&G.notify(J.getSubject(t,K),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(t){t.children.map((t=>t.apply(new p)));const e=new RTEListItemBlock(z());return e.apply(new s(t.children)),e.annotationMap=t.annotationMap,e}createList(t){return new RTEListBlock(z(),t)}findNodeById(t){return this.findNodeInBlocksById(t,this.children)}findNodeInBlocksById(t,e){for(const n of e){if("children"in n)for(const e of n.children)if(e.id===t)return e;if(n instanceof RTEListItemBlock&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof RTEListBlock&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}r.register(c.DELETE_CHILDREN,VegaRTEContent.name,new P),r.register(c.APPEND_CHILDREN,VegaRTEContent.name,new rt),r.register(c.INSERT_CHILDREN_BEFORE,VegaRTEContent.name,new ot),r.register(c.INSERT_CHILDREN_AFTER,VegaRTEContent.name,new it),r.register(c.TRANSFORM_TO_CODE_BLOCK,VegaRTEContent.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,s=new x(z(),this.getCodeContent(n),"plainText");e.apply(new g(n[0],s)),t.newCodeBlock=s,this.removeSelectBlocks(n,e)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new E(t[n]))}}),r.register(c.UPDATE_CURSOR_POSITION,VegaRTEContent.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:r}=t,o=O.getDOMByEntity(e);o&&G.notify(J.getSubject(o,W),{node:s,offset:n,updateDirectly:r})}});const Wt=new class{constructor(){this.RTE_DTO_RENDERER_MAP=new Map,this.RTE_TOOLBAR_BUTTON_RENDERER_MAP=new Map}registerRTEDTORenderer(t,e){const n=this.RTE_DTO_RENDERER_MAP.get(t);if(e&&n&&n.constructor.name!==e.constructor.name)throw new Error(`Renderer for type ${t} is already registered with a different class(${n.constructor.name}).`);this.RTE_DTO_RENDERER_MAP.set(t,e)}registerRTEToolbarButtonRenderer(t,e){this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.set(t,e)}getRTERenderer(t){return this.RTE_DTO_RENDERER_MAP.get(t)}getRTEToolbarButtonRenderer(t){return this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.get(t)}};export{Pt as B,nt as E,lt as I,ct as M,Wt as R,Gt as S,ut as U,VegaRTEContent as V,Rt as a,tt as b,RTEListItemBlock as c,RTEImageBlock as d,RTEListBlock as e,RTEImageNode as f,at as g,Mt as h,st as i}
|
package/dist/vega/p-aab0deab.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as o}from"./p-161b9c5b.js";import{R as i}from"./p-c0036e71.js";function r(r,f,e,s){return o(r)?{flex:`${i.formatCustom(r)}`}:{flexGrow:o(f)?`${i.formatCustom(f)}`:void 0,flexShrink:o(e)?`${i.formatCustom(e)}`:void 0,flexBasis:o(s)?`${i.formatCustom(s)}`:void 0}}export{r as f}
|