@heartlandone/vega 2.85.0 → 2.86.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-54327b0a.js → app-globals-3080f55a.js} +5 -5
- package/dist/cjs/{code-block-6da521e6.js → code-block-c6c70464.js} +6 -0
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-f3f35f94.js → component-value-history-controller-slimmer.abstract-a523b747.js} +2 -2
- package/dist/cjs/{content-state-89fafb3b.js → content-state-efd3b1a7.js} +1 -1
- package/dist/cjs/{image-annotation-action-025389a7.js → image-annotation-action-93bace08.js} +2 -2
- package/dist/cjs/index.cjs.js +6 -6
- package/dist/cjs/loader.cjs.js +6 -6
- package/dist/cjs/{public-rules-fc52d624.js → public-rules-3cd0f182.js} +3 -3
- package/dist/cjs/{range-93cc8ab1.js → range-c9bde0b4.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-fd3711fb.js → rich-text-editor-required-rule-d1f0509c.js} +1 -1
- package/dist/cjs/{split-cell-operation-532fb9f0.js → split-cell-operation-6a59c9b0.js} +2 -2
- package/dist/cjs/{token-extension-4f6ed976.js → token-extension-d7d2ead6.js} +19 -6
- package/dist/cjs/vega-calendar_4.cjs.entry.js +4 -3
- package/dist/cjs/vega-code-block.cjs.entry.js +3 -3
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +13 -1
- package/dist/cjs/vega-dialog_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +11 -1
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +12 -10
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +3 -3
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +157 -24
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +5 -11
- package/dist/cjs/vega.cjs.js +6 -6
- package/dist/collection/components/vega-calendar/slimmers/day-view/renderers/vega-calendar-view-with-time-renderer.js +2 -2
- package/dist/collection/components/vega-calendar/slimmers/month-view/renderers/vega-calendar-month-view-renderer.js +2 -1
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +3 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +17 -1
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +31 -1
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +10 -0
- package/dist/collection/components/vega-modal/slimmers/renderers/vega-modal-renderer.js +1 -1
- package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-controller.js +10 -8
- package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-zindex-controller.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +6 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-toolbar-button-renderer.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +5 -1
- package/dist/collection/components/vega-selection-tile/slimmers/renderers/vega-selection-tile-renderer.js +71 -10
- package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/slimmers/renderers/vega-selection-tile-group-renderer.js +39 -11
- package/dist/collection/components/vega-selection-tile/vega-selection-tile-group/vega-selection-tile-group.css +1 -3
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.css +23 -18
- package/dist/collection/components/vega-selection-tile/vega-selection-tile.js +45 -1
- package/dist/collection/components/vega-time-picker/vega-time-picker.js +6 -12
- package/dist/esm/{app-globals-b1999c09.js → app-globals-37536ac9.js} +5 -5
- package/dist/esm/{code-block-e43c8120.js → code-block-10be3916.js} +6 -0
- package/dist/esm/{component-value-history-controller-slimmer.abstract-60c1910e.js → component-value-history-controller-slimmer.abstract-82d51b7a.js} +2 -2
- package/dist/esm/{content-state-d363f2ca.js → content-state-afeb700d.js} +1 -1
- package/dist/esm/{image-annotation-action-008ca25b.js → image-annotation-action-bad7c565.js} +2 -2
- package/dist/esm/index.js +6 -6
- package/dist/esm/loader.js +6 -6
- package/dist/esm/{public-rules-1561e357.js → public-rules-f54e6f39.js} +3 -3
- package/dist/esm/{range-784d5ec8.js → range-f32f9185.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-8768bc8d.js → rich-text-editor-required-rule-627fd7e4.js} +1 -1
- package/dist/esm/{split-cell-operation-35ce149b.js → split-cell-operation-90c30861.js} +2 -2
- package/dist/esm/{token-extension-23b5ab65.js → token-extension-728c0678.js} +19 -6
- package/dist/esm/vega-calendar_4.entry.js +4 -3
- package/dist/esm/vega-code-block.entry.js +3 -3
- package/dist/esm/vega-date-picker_2.entry.js +13 -1
- package/dist/esm/vega-dialog_2.entry.js +1 -1
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-input-phone-number.entry.js +11 -1
- package/dist/esm/vega-left-nav_5.entry.js +12 -10
- package/dist/esm/vega-rich-text-content.entry.js +3 -3
- package/dist/esm/vega-rich-text-editor_4.entry.js +6 -6
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +3 -3
- package/dist/esm/vega-selection-tile_2.entry.js +157 -24
- package/dist/esm/vega-time-picker_2.entry.js +5 -11
- package/dist/esm/vega.js +6 -6
- package/dist/sri/vega-sri-manifest.json +78 -78
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +1 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +8 -0
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +2 -0
- package/dist/types/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-controller.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +5 -0
- package/dist/types/components/vega-selection-tile/slimmers/renderers/vega-selection-tile-renderer.d.ts +12 -0
- package/dist/types/components/vega-selection-tile/vega-selection-tile-group/slimmers/renderers/vega-selection-tile-group-renderer.d.ts +0 -1
- package/dist/types/components/vega-selection-tile/vega-selection-tile.d.ts +2 -0
- package/dist/types/components/vega-time-picker/vega-time-picker.d.ts +5 -11
- package/dist/types/components.d.ts +14 -4
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-2ae5acfc.entry.js → p-268e84e0.entry.js} +1 -1
- package/dist/vega/p-2edc066c.entry.js +1 -0
- package/dist/vega/{p-386895e9.js → p-33234385.js} +1 -1
- package/dist/vega/{p-487ecdb0.entry.js → p-3d0ba2c6.entry.js} +1 -1
- package/dist/vega/{p-c15a58b5.entry.js → p-4c90d013.entry.js} +1 -1
- package/dist/vega/p-5087fa1e.entry.js +1 -0
- package/dist/vega/{p-1d30cab2.js → p-51b2b3de.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-a07c5dae.js → p-6817b9bd.js} +1 -1
- package/dist/vega/{p-fcb0d4d8.js → p-7730bace.js} +1 -1
- package/dist/vega/p-818da356.js +1 -0
- package/dist/vega/{p-fb05335d.js → p-84eb3b9c.js} +1 -1
- package/dist/vega/{p-77300901.js → p-93afdfc3.js} +1 -1
- package/dist/vega/p-a9f34735.entry.js +1 -0
- package/dist/vega/{p-c2e1f33d.entry.js → p-aaf44879.entry.js} +1 -1
- package/dist/vega/p-af00e6e2.entry.js +1 -0
- package/dist/vega/p-ce61d23f.entry.js +1 -0
- package/dist/vega/p-d4e519a0.js +1 -0
- package/dist/vega/{p-fcce494e.js → p-e1709e59.js} +1 -1
- package/dist/vega/{p-77754d62.entry.js → p-e95cb28f.entry.js} +1 -1
- package/dist/vega/{p-5904616e.js → p-f5f5a0d9.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-56c1a8ac.entry.js +0 -1
- package/dist/vega/p-64b566be.entry.js +0 -1
- package/dist/vega/p-887b3e2d.entry.js +0 -1
- package/dist/vega/p-9763fbbe.entry.js +0 -1
- package/dist/vega/p-bceee942.entry.js +0 -1
- package/dist/vega/p-c74060a7.js +0 -1
- package/dist/vega/p-f54fb4e5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,H as e,r as n,g as r}from"./p-6b2342e0.js";import{c as i,M as o,V as s,I as a}from"./p-6e1ab235.js";import{V as c,I as l}from"./p-4415ad28.js";import{s as h}from"./p-519a7d55.js";import{a as d,V as p}from"./p-8aee6b74.js";import{I as f,T as u}from"./p-a07c5dae.js";import{g as x,V as m}from"./p-5904616e.js";import{s as g,F as v,ac as b,M as w,l as y,ad as j,k,C as O,N as C,G as R,ae as z,af as T,E as I}from"./p-fb05335d.js";import{V as E}from"./p-a7b5f497.js";import{c as S}from"./p-6ac8e655.js";import{D as M}from"./p-f28a6074.js";import{i as N,o as V}from"./p-9af0e2e7.js";import{i as B}from"./p-e4c4ea35.js";import{R as A}from"./p-b6c3ce6d.js";import{x as L}from"./p-6c43d54a.js";import{t as P}from"./p-b75ee3ba.js";import{v as K}from"./p-4866e390.js";import{S as W}from"./p-af5cb9bc.js";import{f as D}from"./p-6e70d3cc.js";import{w as F}from"./p-5e50dbb9.js";import{i as U}from"./p-d27ae9ff.js";import{D as $}from"./p-a5713178.js";import"./p-a528714c.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-fb5ea4b2.js";import"./p-f0e828d8.js";import"./p-e1fbfd20.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-a841cf13.js";import"./p-02841589.js";import"./p-d884c644.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-3b791b5d.js";import"./p-262ec334.js";class G extends E{registerRef(t,e){t&&g.register(t,e)}getCustomAttrs(t){var e;return(null===(e=t.getCustomAttributesAnnotation())||void 0===e?void 0:e.render())||{}}}class _ extends E{registerRef(t,e){t&&g.register(t,e)}}const H=new class extends _{renderFromAnnotation(t,e){const n=this.renderText(t);return e?this.renderWithWrapper(n,e):n}render(t){return this.renderFromAnnotation(t,t.getAnnotationByType(v.INLINE_HTML))}renderWithWrapper(e,n){const{htmlTag:r,customStyle:i,customAttribute:o,customClass:s}=n,a=Object.assign(Object.assign({},null==o?void 0:o.render()),{style:null==i?void 0:i.renderStyle(),class:null==s?void 0:s.renderClass().join(" ")});return t(r,Object.assign({},a),n.child?this.renderWithWrapper(e,n.child):e)}renderText(e){var n,r;const i=(null===(n=e.getAnnotationByType(v.CODE))||void 0===n?void 0:n.code)?"code":"span",o=Object.assign(Object.assign({},null===(r=e.getCustomAttributesAnnotation())||void 0===r?void 0:r.render()),{key:e.id,style:e.getStyles(),class:e.getClasses(),ref:t=>this.registerRef(t,e)});return t(i,Object.assign({},o),e.text||b)}};class X extends w{constructor(t){super(),this.type=y.UNLINK_LINK_GROUP,this.groupKey=t}}const q=new class{constructor(){this.handleChange=({detail:t},e,n)=>{switch(t.action){case"link":{const{url:r,text:i}=t.payload,o=i!==e;return void n.forEach((t=>{const e=t.getAnnotationByType(v.LINK).link.groupKey,s=new j({link:{href:r,groupKey:e},newText:o?i:void 0,needMergeNode:o&&n.length>1,doSplit:!1,type:"update_link"});t.apply(s)}))}case"unlink":return void n.forEach((t=>{t.parent.apply(new X(t.annotationMap.get(v.LINK).link.groupKey)),t.deleteAnnotationByType(v.LINK)}))}}}render(e,n,{editable:r}){return this.groupNodesByLink(e).flatMap((e=>{if(this.isLinkGroup(e)){let t;return e.find((e=>{const n=e.getAnnotationByType(v.LINK);if(n)return t=n,!0})),r?this.renderLinkEditorWrapper(e,t,n):this.renderLink(e,t,n)}const i=A.getRTERenderer(e.type);if(i)return i.render(e,{editable:r},t)})).filter(B)}groupNodesByLink(t){return t.reduce(((t,e)=>{const n=e.getAnnotationByType(v.LINK),r=t[t.length-1];return B(n)?r&&this.isLinkGroup(r)&&r[0].getAnnotationByType(v.LINK).toEqual(n)?r.push(e):t.push([e]):t.push(e),t}),[])}isLinkGroup(t){return Array.isArray(t)}renderLinkEditorWrapper(e,n,r){const{href:i}=n.link,o=e.map((t=>t.text)).join("");let s;return t("span",{class:"link-editor-wrapper",role:"link",tabIndex:0,onKeyDown:S(),ref:t=>{t&&(s=t,g.removeDirtyDomRef(t))}},this.renderLink(e,n,r),t("vega-rich-text-link-editor",{record:{text:o,url:i},ref:t=>{t&&(t.target=s,M.addUniqueObserverToNode(t,N,(t=>{this.handleChange(t,o,e)})))}}))}renderLink(e,n,r){return t("a",Object.assign({},r.toJsx(n)),e.map((t=>H.render(t))))}};class J extends G{renderNodes(t,e){const n=t.getAnnotationByType(k.LINK_GROUP);return n?q.render(t.children,n,e):this.renderGroupedNodesAtDepth(t.children,0,e)}renderGroupedNodesAtDepth(e,n,r){var i;const o=[];let s=0;for(;s<e.length;){const a=e[s].getInlineHtmlTagAtDepth(n);if(!(null==a?void 0:a.groupId)){o.push(this.renderNodeFromDepth(e[s],n,r)),s++;continue}let c=s+1;for(;c<e.length&&(null===(i=e[c].getInlineHtmlTagAtDepth(n))||void 0===i?void 0:i.groupId)===a.groupId;)c++;if(c===s+1)o.push(this.renderNodeFromDepth(e[s],n,r));else{const i=a.annotation.renderProps(),l=this.renderGroupedNodesAtDepth(e.slice(s,c),n+1,r);o.push(t(a.htmlTag,i,l))}s=c}return o}renderNodeFromDepth(e,n,r){return 0===n?A.getRTERenderer(e.type).render(e,r,t):H.renderFromAnnotation(e,e.getInlineHtmlAnnotationAtDepth(n))}}const Q=new class extends J{render(e,n){if(e.shouldRenderAsInternalWrapper()){const r=this.getOuterInlineTag(e.children);if(r)return t(r.htmlTag,Object.assign({},r.annotation.renderProps(),{key:e.id,ref:t=>super.registerRef(t,e)}),super.renderGroupedNodesAtDepth(e.children,1,n))}const r=e.getBlockTag();return t(r,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),super.renderNodes(e,n))}getOuterInlineTag(t){return 1!==t.length?null:t[0].getInlineHtmlTagAtDepth(0)}},Y=new class extends _{constructor(){super(...arguments),this.handleChange=({detail:t},e)=>{switch(t.action){case"edit":e.apply(new f(t.payload.size,t.payload.alt));break;case"delete":{const t=new InputEvent("beforeinput",{inputType:"deleteContentBackward",bubbles:!0});setTimeout((()=>{g.getDOMByEntity(e).dispatchEvent(t)}),50);break}}}}render(e,n){const r=e.getAnnotationByType(v.IMAGE)||new x("md","");return n.editable?t("vega-rich-text-image-editor",{key:e.id,class:this.getClassesForImageEditor(e),size:r.size,alt:r.alt,ref:t=>{M.addUniqueObserverToNode(t,N,(t=>this.handleChange(t,e)))}},this.renderImage(r,e,n)):this.renderImage(r,e,n)}renderImage(e,n,r){var i;return t("img",Object.assign({},null===(i=n.getCustomAttributesAnnotation())||void 0===i?void 0:i.render({filterAttributes:["width","height"]}),{class:this.getClassesForImageNode(n,r.editable),style:Object.assign(Object.assign({},n.getStyles()),r.editable?{width:"100%"}:e.renderStyle({standalone:!0})),alt:e.alt,"data-size":e.size,src:n.url,ref:t=>super.registerRef(t,n),onError:t=>{const e=t.target;e.style.width="16px",e.style.height="16px"}}))}getCommonClasses(t){const e=t.getAnnotationByType(O.CUSTOM_CLASS);return e?e.customClass.filter(B).reduce(((t,e)=>[t,e].join(" ").trim()),""):null}getClasses(t,e={standalone:!1}){return Array.from(t.annotationMap.values()).filter((t=>t instanceof C)).map((t=>t.renderClass(e))).filter(B).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getClassesForImageNode(t,e){var n;return e?`${R.DECORATOR_NODE_CLASS} ${null!==(n=this.getCommonClasses(t))&&void 0!==n?n:""}`:t.getClasses()}getClassesForImageEditor(t){return`${R.DECORATOR_CONTAINER_CLASS} ${this.getClasses(t)}`}},Z=new class extends G{render(e,n){return t("div",Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((t=>Y.render(t,n))))}},tt=new class extends J{render(e,n){return t("li",Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),super.renderNodes(e,n),this.renderChildren(e.nestList,n))}renderChildren(t,e){return null==t?void 0:t.map((t=>et.render(t,e)))}},et=new class extends G{render(e,n){const r=e.getBlockTag();return t(r,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((t=>tt.render(t,n))))}};class nt extends w{constructor(t,e){super(),this.isFlushable=!0,this.type=y.SWITCH_OUT_FROM_CODE_BLOCK,this.content=t,this.language=e}}class rt extends w{constructor(){super(...arguments),this.isFlushable=!0,this.type=y.DELETE_CODE_BLOCK}}const it=new class extends _{render(e,n){const{text:r,language:i}=e;return t("vega-code-block",{key:e.id,value:{code:r,language:i},readOnly:!n.editable,"data-content":r,"data-language":i,ref:t=>{this.registerRef(t,e),M.addUniqueObserverToNode(t,N,(t=>this.handleCodeContentChange(t.detail,e))),M.addUniqueObserverToNode(t,V,(t=>this.handleCodeBlockRemove(t,e))),M.addUniqueObserverToNode(t,L,(t=>this.handleSelectionChange(t.detail,e)))}})}handleCodeContentChange(t,e){const{code:n,language:r}=t;if(this.shouldSwitchOutOfCodeBlock(e.text,n)){const t=new nt(n,r);e.parent.apply(t)}else e.apply(new z(n,r))}handleCodeBlockRemove(t,e){t.preventDefault(),e.parent.apply(new rt)}shouldSwitchOutOfCodeBlock(t,e){const n=e.split("\n");return e.length>t.length&&n.length>4&&""===n.slice(n.length-4).join("")}handleSelectionChange(t,e){t?e.apply(new T(null)):e.annotationMap.delete(k.SELECTION_RANGE)}},ot=new class extends G{constructor(){super(...arguments),this.preventParentDoFocus=t=>{t.stopPropagation(),"keydown"===t.type&&this.dispatchMockKeydownEvent(t)}}render(e,n){const{id:r,children:i}=e;return t("pre",{key:r,class:"code-block-container",ref:t=>this.registerRef(t,e),onKeyDown:this.preventParentDoFocus,onClick:this.preventParentDoFocus,"data-language":i[0].language},this.renderPlaceholderElement("TOP"),it.render(i[0],n),this.renderPlaceholderElement("BOTTOM"))}renderPlaceholderElement(e){return t("span",{class:I.CODE_BLOCK_PLACEHOLDER_CLASS_NAME,style:{display:"block",height:"1px",overflow:"hidden",zIndex:"1",marginTop:"BOTTOM"===e?"-1px":"0px",marginBottom:"BOTTOM"===e?"0px":"-1px"}},b)}dispatchMockKeydownEvent(t){const e=P();if(e){const{type:n,code:r,metaKey:i,ctrlKey:o,shiftKey:s}=t,a=new Event(n,{bubbles:!1,cancelable:!0});a.code=r,a.metaKey=i,a.ctrlKey=o,a.shiftKey=s,e.dispatchEvent(a)}}},st=new class extends G{render(e,n){return t(e.htmlTag,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((e=>A.getRTERenderer(e.type).render(e,n,t))))}},at=new class{constructor(){A.registerRTEDTORenderer("title",Q),A.registerRTEDTORenderer("subtitle",Q),A.registerRTEDTORenderer("paragraph",Q),A.registerRTEDTORenderer("heading-1",Q),A.registerRTEDTORenderer("heading-2",Q),A.registerRTEDTORenderer("heading-3",Q),A.registerRTEDTORenderer("heading-4",Q),A.registerRTEDTORenderer("heading-5",Q),A.registerRTEDTORenderer("heading-6",Q),A.registerRTEDTORenderer("bullet-list",et),A.registerRTEDTORenderer("number-list",et),A.registerRTEDTORenderer("list-item",tt),A.registerRTEDTORenderer("image",Z),A.registerRTEDTORenderer("code-block",ot),A.registerRTEDTORenderer("html-block",st),A.registerRTEDTORenderer("TEXT",H),A.registerRTEDTORenderer("IMAGE",Y)}getBlockRenderer(t){return A.getRTERenderer(t)}};var ct=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class lt extends s{constructor(){super(),d.registerCustomDarkModeColor(u.formatDarkModeColor())}componentWillLoad(){this.setRTEContent()}watchValueUpdate(){this.setRTEContent()}getRichTextContentRef(){return this.richTextContentRef}render(){return t(e,null,this.extensionStyles?t("style",{nonce:K.nonce,class:"rte-extension-styles"},this.extensionStyles):null,this.renderRichTextContent())}setRTEContent(){!this.content||this.content instanceof m||(this.content=m.fromJSON(this.content))}renderRichTextContent(){const e=this.shouldShowPlaceholder();return t("div",{ref:t=>this.richTextContentRef=t,class:{showPlaceholder:e,"rich-text-content":!0},"data-placeholder":this.placeholder,contenteditable:this.contentEditable},this.renderContent())}renderContent(){var e;const n={editable:this.contentEditable};return this.injectRTERefIntoContext(n),null===(e=this.content)||void 0===e?void 0:e.children.map((e=>{const r=at.getBlockRenderer(e.type);if(r)return r.render(e,n,t)}))}shouldShowPlaceholder(){var t;const e=null===(t=this.content)||void 0===t?void 0:t.children;if(e){if(e.length>1)return!1;for(const t of e)if(t.isNotEmpty())return!1}return!0}injectRTERefIntoContext(t){const e=this.content;if(e){const n=g.getDOMByEntity(e);n&&(t.host=n)}}}ct([i()],lt.prototype,"placeholder",void 0),ct([i()],lt.prototype,"contentEditable",void 0),ct([i({writable:!0})],lt.prototype,"content",void 0),ct([i()],lt.prototype,"extensionStyles",void 0),ct([o("componentWillLoad")],lt.prototype,"componentWillLoad",null),ct([o("watchValueUpdate")],lt.prototype,"watchValueUpdate",null);var ht=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class dt extends W{constructor(){super({parent:"vega-rich-text-editor",subStates:[{subStateName:"placeholder",parentStateName:"placeholder"},{subStateName:"contentEditable",parentStateName:"richTextContentEditable"}]})}}ht([i()],dt.prototype,"host",void 0),ht([i({writable:!0})],dt.prototype,"placeholder",void 0),ht([i({writable:!0})],dt.prototype,"contentEditable",void 0);var pt=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class ft extends s{attachExtensionStyles(){this.attachStylesToHost()}handleExtensionsChange(t,e){U(t,e,!1,((t,e)=>t===e?0:1))||this.attachStylesToHost()}attachStylesToHost(){if(this.extensions){let t="";for(const e of this.extensions){const n=e.collectExtensionRendererStyles();n&&(t+=`${n}\n`)}this.extensionStyles=t}}}pt([i()],ft.prototype,"extensions",void 0),pt([i()],ft.prototype,"host",void 0),pt([i({writable:!0})],ft.prototype,"extensionStyles",void 0),pt([o("componentWillLoad")],ft.prototype,"attachExtensionStyles",null),pt([o("watchExtensions")],ft.prototype,"handleExtensionsChange",null);var ut=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};const xt=class{constructor(t){n(this,t),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new c,this.vegaRichTextContentRenderer=new lt,this.vegaRichTextContentStateController=new dt,this.vegaRichTextContentExtensionsStylesController=new ft,this.darkModeStateControllerSlimmer=new $,this.contentEditable=!1,this.extensionStyles="",this.isInDarkMode=p.isDarkMode(),this.extensions=[]}watchValueUpdate(){}watchExtensions(t,e){}async vegaFocus(){this.vegaRichTextContentRenderer.getRichTextContentRef().focus();const t=D(this.host,"vega-rich-text-editor");t&&await F(t)}render(){return h(this.vegaRichTextContentRenderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{content:["watchValueUpdate"],extensions:["watchExtensions"]}}};ut([l()],xt.prototype,"globalSlimmers",void 0),ut([a()],xt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ut([a()],xt.prototype,"vegaRichTextContentRenderer",void 0),ut([a()],xt.prototype,"vegaRichTextContentStateController",void 0),ut([a()],xt.prototype,"vegaRichTextContentExtensionsStylesController",void 0),ut([a()],xt.prototype,"darkModeStateControllerSlimmer",void 0),xt.style=':host{display:flex;flex-direction:column;width:100%}:host .rich-text-content{position:relative;height:100%;outline:2px solid transparent;outline-offset:2px;font-weight:500;color:var(--v-rich-text-editor-black, #111128);overflow-wrap:break-word;white-space:pre-wrap}:host .rich-text-content.showPlaceholder::before{position:absolute;content:attr(data-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))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .rich-text-content.showPlaceholder::before{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .rich-text-content.showPlaceholder::before{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .rich-text-content.showPlaceholder::before{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .rich-text-content a.v-rte--link{color:rgba(var(--v-text-link, 19, 98, 226, 1));outline:none}:host .rich-text-content a.v-rte--link:visited{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}:host .rich-text-content a.v-rte--link:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .rich-text-content a.v-rte--link:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .rich-text-content a.v-rte--link:focus-visible{color:rgba(var(--v-text-link-focus, 4, 112, 236, 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));border-radius:8px}:host .rich-text-content .v-rte--underline{text-decoration:underline}:host .rich-text-content .v-rte--strikethrough{text-decoration:line-through}:host .rich-text-content .v-rte--underline.v-rte--strikethrough{text-decoration:underline line-through}:host .rich-text-content .v-rte--horizontal-alignment-right{text-align:right}:host .rich-text-content .v-rte--horizontal-alignment-left{text-align:left}:host .rich-text-content .v-rte--horizontal-alignment-center{text-align:center}:host .rich-text-content .v-rte--horizontal-alignment-justify{text-align:justify}:host .rich-text-content .v-rte--code{font-family:"Roboto Mono";white-space:pre-wrap}:host .rich-text-content img{cursor:pointer}:host .rich-text-content ul.v-rte--list,:host .rich-text-content ol.v-rte--list{padding-left:8px;margin-left:16px}:host .rich-text-content .link-editor-wrapper{position:relative;outline:2px solid transparent;outline-offset:2px}:host .rich-text-content .link-editor-wrapper vega-rich-text-link-editor{position:absolute;bottom:0;left:0;right:0}:host .rich-text-content .code-block-container{margin-top:22px;margin-bottom:22px}:host .rich-text-content vega-code-block.focus{outline:none}:host .rich-text-content .v-rte--bold{font-weight:700}:host .rich-text-content .v-rte--italic{font-style:italic}:host .rich-text-content .v-rte--image-base img,:host .rich-text-content .v-rte--image-size-lg img,:host .rich-text-content .v-rte--image-size-md img,:host .rich-text-content .v-rte--image-size-sm img{vertical-align:bottom}:host .rich-text-content .v-rte--image-size-sm{width:25%}:host .rich-text-content .v-rte--image-size-md{width:50%}:host .rich-text-content .v-rte--image-size-lg{width:100%}:host .rich-text-content .v-rte--text-style-paragraph{font-family:"Inter";font-size:16px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-title{font-family:"Inter";font-size:36px;line-height:40px;font-weight:500}:host .rich-text-content .v-rte--text-style-subtitle{font-family:"Inter";font-size:28px;line-height:32px;font-weight:500}:host .rich-text-content .v-rte--text-style-heading-1{font-family:"Inter";font-size:22px;line-height:24px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-2{font-family:"Inter";font-size:20px;line-height:24px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-3{font-family:"Inter";font-size:18px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-4{font-family:"Inter";font-size:16px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-5{font-family:"Inter";font-size:14px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-6{font-family:"Inter";font-size:12px;line-height:22px;font-weight:500;margin:0}';export{xt as vega_rich_text_content}
|
|
1
|
+
import{h as t,H as e,r as n,g as r}from"./p-6b2342e0.js";import{c as i,M as o,V as s,I as a}from"./p-6e1ab235.js";import{V as c,I as l}from"./p-4415ad28.js";import{s as h}from"./p-519a7d55.js";import{a as d,V as p}from"./p-8aee6b74.js";import{I as f,T as u}from"./p-6817b9bd.js";import{g as x,V as m}from"./p-f5f5a0d9.js";import{s as g,F as v,ac as b,M as w,l as y,ad as j,k,C as O,N as C,G as R,ae as z,af as T,E as I}from"./p-84eb3b9c.js";import{V as E}from"./p-a7b5f497.js";import{c as S}from"./p-6ac8e655.js";import{D as M}from"./p-f28a6074.js";import{i as N,o as V}from"./p-9af0e2e7.js";import{i as B}from"./p-e4c4ea35.js";import{R as A}from"./p-b6c3ce6d.js";import{x as L}from"./p-6c43d54a.js";import{t as P}from"./p-b75ee3ba.js";import{v as K}from"./p-4866e390.js";import{S as W}from"./p-af5cb9bc.js";import{f as D}from"./p-6e70d3cc.js";import{w as F}from"./p-5e50dbb9.js";import{i as U}from"./p-d27ae9ff.js";import{D as $}from"./p-a5713178.js";import"./p-a528714c.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-fb5ea4b2.js";import"./p-f0e828d8.js";import"./p-e1fbfd20.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-a841cf13.js";import"./p-02841589.js";import"./p-d884c644.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-3b791b5d.js";import"./p-262ec334.js";class G extends E{registerRef(t,e){t&&g.register(t,e)}getCustomAttrs(t){var e;return(null===(e=t.getCustomAttributesAnnotation())||void 0===e?void 0:e.render())||{}}}class _ extends E{registerRef(t,e){t&&g.register(t,e)}}const H=new class extends _{renderFromAnnotation(t,e){const n=this.renderText(t);return e?this.renderWithWrapper(n,e):n}render(t){return this.renderFromAnnotation(t,t.getAnnotationByType(v.INLINE_HTML))}renderWithWrapper(e,n){const{htmlTag:r,customStyle:i,customAttribute:o,customClass:s}=n,a=Object.assign(Object.assign({},null==o?void 0:o.render()),{style:null==i?void 0:i.renderStyle(),class:null==s?void 0:s.renderClass().join(" ")});return t(r,Object.assign({},a),n.child?this.renderWithWrapper(e,n.child):e)}renderText(e){var n,r;const i=(null===(n=e.getAnnotationByType(v.CODE))||void 0===n?void 0:n.code)?"code":"span",o=Object.assign(Object.assign({},null===(r=e.getCustomAttributesAnnotation())||void 0===r?void 0:r.render()),{key:e.id,style:e.getStyles(),class:e.getClasses(),ref:t=>this.registerRef(t,e)});return t(i,Object.assign({},o),e.text||b)}};class X extends w{constructor(t){super(),this.type=y.UNLINK_LINK_GROUP,this.groupKey=t}}const q=new class{constructor(){this.handleChange=({detail:t},e,n)=>{switch(t.action){case"link":{const{url:r,text:i}=t.payload,o=i!==e;return void n.forEach((t=>{const e=t.getAnnotationByType(v.LINK).link.groupKey,s=new j({link:{href:r,groupKey:e},newText:o?i:void 0,needMergeNode:o&&n.length>1,doSplit:!1,type:"update_link"});t.apply(s)}))}case"unlink":return void n.forEach((t=>{t.parent.apply(new X(t.annotationMap.get(v.LINK).link.groupKey)),t.deleteAnnotationByType(v.LINK)}))}}}render(e,n,{editable:r}){return this.groupNodesByLink(e).flatMap((e=>{if(this.isLinkGroup(e)){let t;return e.find((e=>{const n=e.getAnnotationByType(v.LINK);if(n)return t=n,!0})),r?this.renderLinkEditorWrapper(e,t,n):this.renderLink(e,t,n)}const i=A.getRTERenderer(e.type);if(i)return i.render(e,{editable:r},t)})).filter(B)}groupNodesByLink(t){return t.reduce(((t,e)=>{const n=e.getAnnotationByType(v.LINK),r=t[t.length-1];return B(n)?r&&this.isLinkGroup(r)&&r[0].getAnnotationByType(v.LINK).toEqual(n)?r.push(e):t.push([e]):t.push(e),t}),[])}isLinkGroup(t){return Array.isArray(t)}renderLinkEditorWrapper(e,n,r){const{href:i}=n.link,o=e.map((t=>t.text)).join("");let s;return t("span",{class:"link-editor-wrapper",role:"link",tabIndex:0,onKeyDown:S(),ref:t=>{t&&(s=t,g.removeDirtyDomRef(t))}},this.renderLink(e,n,r),t("vega-rich-text-link-editor",{record:{text:o,url:i},ref:t=>{t&&(t.target=s,M.addUniqueObserverToNode(t,N,(t=>{this.handleChange(t,o,e)})))}}))}renderLink(e,n,r){return t("a",Object.assign({},r.toJsx(n)),e.map((t=>H.render(t))))}};class J extends G{renderNodes(t,e){const n=t.getAnnotationByType(k.LINK_GROUP);return n?q.render(t.children,n,e):this.renderGroupedNodesAtDepth(t.children,0,e)}renderGroupedNodesAtDepth(e,n,r){var i;const o=[];let s=0;for(;s<e.length;){const a=e[s].getInlineHtmlTagAtDepth(n);if(!(null==a?void 0:a.groupId)){o.push(this.renderNodeFromDepth(e[s],n,r)),s++;continue}let c=s+1;for(;c<e.length&&(null===(i=e[c].getInlineHtmlTagAtDepth(n))||void 0===i?void 0:i.groupId)===a.groupId;)c++;if(c===s+1)o.push(this.renderNodeFromDepth(e[s],n,r));else{const i=a.annotation.renderProps(),l=this.renderGroupedNodesAtDepth(e.slice(s,c),n+1,r);o.push(t(a.htmlTag,i,l))}s=c}return o}renderNodeFromDepth(e,n,r){return 0===n?A.getRTERenderer(e.type).render(e,r,t):H.renderFromAnnotation(e,e.getInlineHtmlAnnotationAtDepth(n))}}const Q=new class extends J{render(e,n){if(e.shouldRenderAsInternalWrapper()){const r=this.getOuterInlineTag(e.children);if(r)return t(r.htmlTag,Object.assign({},r.annotation.renderProps(),{key:e.id,ref:t=>super.registerRef(t,e)}),super.renderGroupedNodesAtDepth(e.children,1,n))}const r=e.getBlockTag();return t(r,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),super.renderNodes(e,n))}getOuterInlineTag(t){return 1!==t.length?null:t[0].getInlineHtmlTagAtDepth(0)}},Y=new class extends _{constructor(){super(...arguments),this.handleChange=({detail:t},e)=>{switch(t.action){case"edit":e.apply(new f(t.payload.size,t.payload.alt));break;case"delete":{const t=new InputEvent("beforeinput",{inputType:"deleteContentBackward",bubbles:!0});setTimeout((()=>{g.getDOMByEntity(e).dispatchEvent(t)}),50);break}}}}render(e,n){const r=e.getAnnotationByType(v.IMAGE)||new x("md","");return n.editable?t("vega-rich-text-image-editor",{key:e.id,class:this.getClassesForImageEditor(e),size:r.size,alt:r.alt,ref:t=>{M.addUniqueObserverToNode(t,N,(t=>this.handleChange(t,e)))}},this.renderImage(r,e,n)):this.renderImage(r,e,n)}renderImage(e,n,r){var i;return t("img",Object.assign({},null===(i=n.getCustomAttributesAnnotation())||void 0===i?void 0:i.render({filterAttributes:["width","height"]}),{class:this.getClassesForImageNode(n,r.editable),style:Object.assign(Object.assign({},n.getStyles()),r.editable?{width:"100%"}:e.renderStyle({standalone:!0})),alt:e.alt,"data-size":e.size,src:n.url,ref:t=>super.registerRef(t,n),onError:t=>{const e=t.target;e.style.width="16px",e.style.height="16px"}}))}getCommonClasses(t){const e=t.getAnnotationByType(O.CUSTOM_CLASS);return e?e.customClass.filter(B).reduce(((t,e)=>[t,e].join(" ").trim()),""):null}getClasses(t,e={standalone:!1}){return Array.from(t.annotationMap.values()).filter((t=>t instanceof C)).map((t=>t.renderClass(e))).filter(B).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getClassesForImageNode(t,e){var n;return e?`${R.DECORATOR_NODE_CLASS} ${null!==(n=this.getCommonClasses(t))&&void 0!==n?n:""}`:t.getClasses()}getClassesForImageEditor(t){return`${R.DECORATOR_CONTAINER_CLASS} ${this.getClasses(t)}`}},Z=new class extends G{render(e,n){return t("div",Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((t=>Y.render(t,n))))}},tt=new class extends J{render(e,n){return t("li",Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),super.renderNodes(e,n),this.renderChildren(e.nestList,n))}renderChildren(t,e){return null==t?void 0:t.map((t=>et.render(t,e)))}},et=new class extends G{render(e,n){const r=e.getBlockTag();return t(r,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((t=>tt.render(t,n))))}};class nt extends w{constructor(t,e){super(),this.isFlushable=!0,this.type=y.SWITCH_OUT_FROM_CODE_BLOCK,this.content=t,this.language=e}}class rt extends w{constructor(){super(...arguments),this.isFlushable=!0,this.type=y.DELETE_CODE_BLOCK}}const it=new class extends _{render(e,n){const{text:r,language:i}=e;return t("vega-code-block",{key:e.id,value:{code:r,language:i},readOnly:!n.editable,"data-content":r,"data-language":i,ref:t=>{this.registerRef(t,e),M.addUniqueObserverToNode(t,N,(t=>this.handleCodeContentChange(t.detail,e))),M.addUniqueObserverToNode(t,V,(t=>this.handleCodeBlockRemove(t,e))),M.addUniqueObserverToNode(t,L,(t=>this.handleSelectionChange(t.detail,e)))}})}handleCodeContentChange(t,e){const{code:n,language:r}=t;if(this.shouldSwitchOutOfCodeBlock(e.text,n)){const t=new nt(n,r);e.parent.apply(t)}else e.apply(new z(n,r))}handleCodeBlockRemove(t,e){t.preventDefault(),e.parent.apply(new rt)}shouldSwitchOutOfCodeBlock(t,e){const n=e.split("\n");return e.length>t.length&&n.length>4&&""===n.slice(n.length-4).join("")}handleSelectionChange(t,e){t?e.apply(new T(null)):e.annotationMap.delete(k.SELECTION_RANGE)}},ot=new class extends G{constructor(){super(...arguments),this.preventParentDoFocus=t=>{t.stopPropagation(),"keydown"===t.type&&this.dispatchMockKeydownEvent(t)}}render(e,n){const{id:r,children:i}=e;return t("pre",{key:r,class:"code-block-container",ref:t=>this.registerRef(t,e),onKeyDown:this.preventParentDoFocus,onClick:this.preventParentDoFocus,"data-language":i[0].language},this.renderPlaceholderElement("TOP"),it.render(i[0],n),this.renderPlaceholderElement("BOTTOM"))}renderPlaceholderElement(e){return t("span",{class:I.CODE_BLOCK_PLACEHOLDER_CLASS_NAME,style:{display:"block",height:"1px",overflow:"hidden",zIndex:"1",marginTop:"BOTTOM"===e?"-1px":"0px",marginBottom:"BOTTOM"===e?"0px":"-1px"}},b)}dispatchMockKeydownEvent(t){const e=P();if(e){const{type:n,code:r,metaKey:i,ctrlKey:o,shiftKey:s}=t,a=new Event(n,{bubbles:!1,cancelable:!0});a.code=r,a.metaKey=i,a.ctrlKey=o,a.shiftKey=s,e.dispatchEvent(a)}}},st=new class extends G{render(e,n){return t(e.htmlTag,Object.assign({},this.getCustomAttrs(e),{key:e.id,ref:t=>super.registerRef(t,e),style:e.getStyles(),class:e.getClasses()}),e.children.map((e=>A.getRTERenderer(e.type).render(e,n,t))))}},at=new class{constructor(){A.registerRTEDTORenderer("title",Q),A.registerRTEDTORenderer("subtitle",Q),A.registerRTEDTORenderer("paragraph",Q),A.registerRTEDTORenderer("heading-1",Q),A.registerRTEDTORenderer("heading-2",Q),A.registerRTEDTORenderer("heading-3",Q),A.registerRTEDTORenderer("heading-4",Q),A.registerRTEDTORenderer("heading-5",Q),A.registerRTEDTORenderer("heading-6",Q),A.registerRTEDTORenderer("bullet-list",et),A.registerRTEDTORenderer("number-list",et),A.registerRTEDTORenderer("list-item",tt),A.registerRTEDTORenderer("image",Z),A.registerRTEDTORenderer("code-block",ot),A.registerRTEDTORenderer("html-block",st),A.registerRTEDTORenderer("TEXT",H),A.registerRTEDTORenderer("IMAGE",Y)}getBlockRenderer(t){return A.getRTERenderer(t)}};var ct=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class lt extends s{constructor(){super(),d.registerCustomDarkModeColor(u.formatDarkModeColor())}componentWillLoad(){this.setRTEContent()}watchValueUpdate(){this.setRTEContent()}getRichTextContentRef(){return this.richTextContentRef}render(){return t(e,null,this.extensionStyles?t("style",{nonce:K.nonce,class:"rte-extension-styles"},this.extensionStyles):null,this.renderRichTextContent())}setRTEContent(){!this.content||this.content instanceof m||(this.content=m.fromJSON(this.content))}renderRichTextContent(){const e=this.shouldShowPlaceholder();return t("div",{ref:t=>this.richTextContentRef=t,class:{showPlaceholder:e,"rich-text-content":!0},"data-placeholder":this.placeholder,contenteditable:this.contentEditable},this.renderContent())}renderContent(){var e;const n={editable:this.contentEditable};return this.injectRTERefIntoContext(n),null===(e=this.content)||void 0===e?void 0:e.children.map((e=>{const r=at.getBlockRenderer(e.type);if(r)return r.render(e,n,t)}))}shouldShowPlaceholder(){var t;const e=null===(t=this.content)||void 0===t?void 0:t.children;if(e){if(e.length>1)return!1;for(const t of e)if(t.isNotEmpty())return!1}return!0}injectRTERefIntoContext(t){const e=this.content;if(e){const n=g.getDOMByEntity(e);n&&(t.host=n)}}}ct([i()],lt.prototype,"placeholder",void 0),ct([i()],lt.prototype,"contentEditable",void 0),ct([i({writable:!0})],lt.prototype,"content",void 0),ct([i()],lt.prototype,"extensionStyles",void 0),ct([o("componentWillLoad")],lt.prototype,"componentWillLoad",null),ct([o("watchValueUpdate")],lt.prototype,"watchValueUpdate",null);var ht=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class dt extends W{constructor(){super({parent:"vega-rich-text-editor",subStates:[{subStateName:"placeholder",parentStateName:"placeholder"},{subStateName:"contentEditable",parentStateName:"richTextContentEditable"}]})}}ht([i()],dt.prototype,"host",void 0),ht([i({writable:!0})],dt.prototype,"placeholder",void 0),ht([i({writable:!0})],dt.prototype,"contentEditable",void 0);var pt=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};class ft extends s{attachExtensionStyles(){this.attachStylesToHost()}handleExtensionsChange(t,e){U(t,e,!1,((t,e)=>t===e?0:1))||this.attachStylesToHost()}attachStylesToHost(){if(this.extensions){let t="";for(const e of this.extensions){const n=e.collectExtensionRendererStyles();n&&(t+=`${n}\n`)}this.extensionStyles=t}}}pt([i()],ft.prototype,"extensions",void 0),pt([i()],ft.prototype,"host",void 0),pt([i({writable:!0})],ft.prototype,"extensionStyles",void 0),pt([o("componentWillLoad")],ft.prototype,"attachExtensionStyles",null),pt([o("watchExtensions")],ft.prototype,"handleExtensionsChange",null);var ut=function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};const xt=class{constructor(t){n(this,t),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new c,this.vegaRichTextContentRenderer=new lt,this.vegaRichTextContentStateController=new dt,this.vegaRichTextContentExtensionsStylesController=new ft,this.darkModeStateControllerSlimmer=new $,this.contentEditable=!1,this.extensionStyles="",this.isInDarkMode=p.isDarkMode(),this.extensions=[]}watchValueUpdate(){}watchExtensions(t,e){}async vegaFocus(){this.vegaRichTextContentRenderer.getRichTextContentRef().focus();const t=D(this.host,"vega-rich-text-editor");t&&await F(t)}render(){return h(this.vegaRichTextContentRenderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{content:["watchValueUpdate"],extensions:["watchExtensions"]}}};ut([l()],xt.prototype,"globalSlimmers",void 0),ut([a()],xt.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ut([a()],xt.prototype,"vegaRichTextContentRenderer",void 0),ut([a()],xt.prototype,"vegaRichTextContentStateController",void 0),ut([a()],xt.prototype,"vegaRichTextContentExtensionsStylesController",void 0),ut([a()],xt.prototype,"darkModeStateControllerSlimmer",void 0),xt.style=':host{display:flex;flex-direction:column;width:100%}:host .rich-text-content{position:relative;height:100%;outline:2px solid transparent;outline-offset:2px;font-weight:500;color:var(--v-rich-text-editor-black, #111128);overflow-wrap:break-word;white-space:pre-wrap}:host .rich-text-content.showPlaceholder::before{position:absolute;content:attr(data-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))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .rich-text-content.showPlaceholder::before{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .rich-text-content.showPlaceholder::before{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .rich-text-content.showPlaceholder::before{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .rich-text-content a.v-rte--link{color:rgba(var(--v-text-link, 19, 98, 226, 1));outline:none}:host .rich-text-content a.v-rte--link:visited{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}:host .rich-text-content a.v-rte--link:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host .rich-text-content a.v-rte--link:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host .rich-text-content a.v-rte--link:focus-visible{color:rgba(var(--v-text-link-focus, 4, 112, 236, 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));border-radius:8px}:host .rich-text-content .v-rte--underline{text-decoration:underline}:host .rich-text-content .v-rte--strikethrough{text-decoration:line-through}:host .rich-text-content .v-rte--underline.v-rte--strikethrough{text-decoration:underline line-through}:host .rich-text-content .v-rte--horizontal-alignment-right{text-align:right}:host .rich-text-content .v-rte--horizontal-alignment-left{text-align:left}:host .rich-text-content .v-rte--horizontal-alignment-center{text-align:center}:host .rich-text-content .v-rte--horizontal-alignment-justify{text-align:justify}:host .rich-text-content .v-rte--code{font-family:"Roboto Mono";white-space:pre-wrap}:host .rich-text-content img{cursor:pointer}:host .rich-text-content ul.v-rte--list,:host .rich-text-content ol.v-rte--list{padding-left:8px;margin-left:16px}:host .rich-text-content .link-editor-wrapper{position:relative;outline:2px solid transparent;outline-offset:2px}:host .rich-text-content .link-editor-wrapper vega-rich-text-link-editor{position:absolute;bottom:0;left:0;right:0}:host .rich-text-content .code-block-container{margin-top:22px;margin-bottom:22px}:host .rich-text-content vega-code-block.focus{outline:none}:host .rich-text-content .v-rte--bold{font-weight:700}:host .rich-text-content .v-rte--italic{font-style:italic}:host .rich-text-content .v-rte--image-base img,:host .rich-text-content .v-rte--image-size-lg img,:host .rich-text-content .v-rte--image-size-md img,:host .rich-text-content .v-rte--image-size-sm img{vertical-align:bottom}:host .rich-text-content .v-rte--image-size-sm{width:25%}:host .rich-text-content .v-rte--image-size-md{width:50%}:host .rich-text-content .v-rte--image-size-lg{width:100%}:host .rich-text-content .v-rte--text-style-paragraph{font-family:"Inter";font-size:16px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-title{font-family:"Inter";font-size:36px;line-height:40px;font-weight:500}:host .rich-text-content .v-rte--text-style-subtitle{font-family:"Inter";font-size:28px;line-height:32px;font-weight:500}:host .rich-text-content .v-rte--text-style-heading-1{font-family:"Inter";font-size:22px;line-height:24px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-2{font-family:"Inter";font-size:20px;line-height:24px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-3{font-family:"Inter";font-size:18px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-4{font-family:"Inter";font-size:16px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-5{font-family:"Inter";font-size:14px;line-height:22px;font-weight:500;margin:0}:host .rich-text-content .v-rte--text-style-heading-6{font-family:"Inter";font-size:12px;line-height:22px;font-weight:500;margin:0}';export{xt as vega_rich_text_content}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,F as t,r as i,c as o,H as n,g as a}from"./p-6b2342e0.js";import{s}from"./p-519a7d55.js";import{c as r,M as l,V as c,I as d}from"./p-6e1ab235.js";import{s as p}from"./p-6bd5c49b.js";import{V as h,I as f}from"./p-4415ad28.js";import{P as v}from"./p-81dd00d0.js";import{e as u}from"./p-272440e8.js";import{F as g}from"./p-18e8d9b7.js";import{l as m,m as x,f as b}from"./p-6e70d3cc.js";import{V as C}from"./p-e1fbfd20.js";import{I as w}from"./p-781fd6e0.js";import{g as y}from"./p-49a2e141.js";import{I as j}from"./p-5657f768.js";import{c as k}from"./p-6b5cb920.js";import{Q as O,R,S,a as L,T as H}from"./p-9af0e2e7.js";import{C as I}from"./p-2bb5a232.js";import{D as A,d as z}from"./p-f28a6074.js";import{N as V,O as M,P as N,Q as E,R as _}from"./p-6c43d54a.js";import{c as G}from"./p-c31a32f4.js";import{B as D}from"./p-7cd2b93b.js";import{V as W}from"./p-8aee6b74.js";import{c as B}from"./p-1ec763ab.js";import{c as U}from"./p-613ddaab.js";import{C as T}from"./p-2d0d575f.js";import{O as Z}from"./p-331a62d5.js";import{S as F}from"./p-af5cb9bc.js";import{c as K}from"./p-2a9960c9.js";import{f as P}from"./p-c85e743d.js";import"./p-b75ee3ba.js";import"./p-5a25014f.js";import"./p-e6adf829.js";import"./p-593e0f80.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-262ec334.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-4cefd7fe.js";import"./p-e4c4ea35.js";import"./p-d884c644.js";import"./p-3b791b5d.js";import"./p-a528714c.js";import"./p-f1c672e4.js";import"./p-4866e390.js";import"./p-f0e828d8.js";import"./p-fb5ea4b2.js";import"./p-a841cf13.js";import"./p-031c0cf7.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-1a869f0e.js";var X=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class $ extends v{constructor(){super({callback:()=>{this.updateMainContentUI(this.openState)}}),this.isVoiceOverClick=!1,this.triggerElement=null,this.handleClickEvent=e=>{this.isVoiceOverClick=m(e)}}componentDidLoad(){!0===this.open?(this.openState="open",g.isEnabled("VEGA_LEFT_NAV.DISABLE_ANIMATION_ON_LOAD")&&this.host.classList.add("disableAnimation")):this.openState="close",window.addEventListener("click",this.handleClickEvent,{capture:!0})}componentDidRender(){}async toggle(){"close"===this.openState?(this.triggerElement=document.activeElement,this.openState="open"):this.openState="close"}watchOpen(e){this.openState=e?"open":"close"}watchOpenState(e){this.updateMainContentUI(e),"open"===e?this.open=!0:(this.open=!1,g.isEnabled("VEGA_LEFT_NAV.DISABLE_ANIMATION_ON_LOAD")&&this.host.classList.contains("disableAnimation")&&this.host.classList.remove("disableAnimation")),this.stateUpdateEventEmitter.emit(this.openState),"open"===e?this.focusFirstFocusableInDialog():this.focusFirstFocusableOutsideDialog()}watchShowAsOverlay(){this.updateMainContentUI(this.openState)}setOpenState(e){this.openState=e}focusFirstFocusableInDialog(){if(!this.isVoiceOverClick)return;const e=this.host,t=x(e);t&&u((()=>t.focus()),e,300)}focusFirstFocusableOutsideDialog(){var e;const t=this.triggerElement;this.triggerElement=null;const i=this.host;if(t&&t.isConnected)return void(null!==(e=x(t))&&void 0!==e?e:t).focus();const o=this.findFirstFocusableOutside(i);o&&o.focus()}findFirstFocusableOutside(e){const t=i=>{const o=Array.from(i.children);for(const i of o){if(i===e||e.contains(i))continue;if(i.contains(e)){const e=t(i);if(e)return e;continue}const o=x(i);if(o)return o}return null};return t(document.body)}updateMainContentUI(e){const t=document.querySelector("body"),i=document.querySelector("vega-left-nav + .vega-left-nav-content");"open"===e?(this.host.style.display="flex",setTimeout((()=>{this.host.classList.add("open"),i&&!this.backdropController.shouldShowBackdrop()?(null==t||t.classList.remove("vega-overflow-hidden"),i.classList.add("open")):(null==t||t.classList.add("vega-overflow-hidden"),i&&i.classList.remove("open"))}))):(this.host.classList.remove("open"),null==t||t.classList.remove("vega-overflow-hidden"),i&&i.classList.remove("open"),u((()=>{this.open||(this.host.style.display="none")}),this.host))}}X([r()],$.prototype,"host",void 0),X([r({writable:!0})],$.prototype,"open",void 0),X([r({writable:!0})],$.prototype,"openState",void 0),X([r()],$.prototype,"stateUpdateEventEmitter",void 0),X([r()],$.prototype,"backdropController",void 0),X([l("componentDidLoad")],$.prototype,"componentDidLoad",null),X([l("componentDidRender")],$.prototype,"componentDidRender",null),X([l("toggle")],$.prototype,"toggle",null),X([l("watchOpen")],$.prototype,"watchOpen",null),X([l("watchOpenState")],$.prototype,"watchOpenState",null),X([l("watchShowAsOverlay")],$.prototype,"watchShowAsOverlay",null);const Q=()=>e("div",{class:"header-footer-separator-container"},e("div",{class:"header-footer-separator"}));var q=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class J extends c{componentWillLoad(){this.hasHeaderSlot=!!this.host.querySelector('[slot="header-slot"]')}render(){return this.renderHeader()}renderHeader(){const{title:i,subtitle:o}=this.headerConfig;return e(t,null,e("div",{class:"header-container"},this.hasHeaderSlot?e("slot",{name:"header-slot"}):i?e("div",{class:"header-title"},i):this.renderHeaderLogo(),o&&e("div",{class:"header-subtitle"},o)),e(Q,null))}renderHeaderLogo(){return"gp"===this.currentBranding?e("vega-brand-logo",{name:"global-payments",size:"small"}):"genius"===this.currentBranding?e("vega-brand-logo",{name:"genius",size:"small"}):e("vega-icon",{icon:C.getIconKey("heartland-logo")})}}C.register({"heartland-logo":{icon:'<svg width="142" height="26" viewBox="0 0 142 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 0H5.38012V9.88886H14.7732V0H20.2857V24.7222H14.9056V13.9144H5.42422V24.7659H0V0ZM81.3186 0H86.4784V24.7222H81.3186V0ZM141.868 0.0435179H136.708C136.708 3.19395 136.708 6.38814 136.664 9.58233C135.959 8.53217 134.856 7.78833 133.666 7.48204C131.461 6.86946 129.079 7.35077 127.227 8.70716C125.727 9.97612 124.669 11.7264 124.317 13.6516C123.92 15.4894 123.92 17.4147 124.317 19.2962C124.669 21.1339 125.684 22.7966 127.182 23.8906C128.77 24.8969 130.667 25.2907 132.519 25.0282C134.283 24.8531 135.826 23.8468 136.664 22.2716C136.664 22.824 136.703 23.3764 136.742 23.9288C136.762 24.2077 136.782 24.4867 136.796 24.7656H142C141.912 23.5843 141.868 22.3591 141.868 21.1777V0.0435179ZM129.784 13.039C130.137 11.9889 130.976 10.9388 132.166 10.6762C133.357 10.3262 134.636 10.6762 135.518 11.5514C136.444 12.4702 136.753 13.8267 136.841 15.0956C136.885 16.7583 136.753 18.4648 135.959 19.9525C135.076 21.4839 132.916 22.2716 131.284 21.3964C130.094 20.7401 129.609 19.3399 129.388 18.071C129.124 16.3645 129.256 14.6581 129.784 13.039ZM70.3382 4.15601L75.4537 2.31827V7.52523H79.5991V10.9382H75.4537V17.1515C75.4096 18.1142 75.4537 19.0768 75.5859 20.0394C75.6742 20.5645 76.1152 21.0021 76.6443 21.1334C77.6146 21.3084 78.5847 21.3084 79.5549 21.1771V24.5026C77.7469 25.0276 75.8506 25.1589 73.9984 24.9401C72.94 24.8088 71.9258 24.3276 71.2202 23.5399C70.6028 22.7085 70.3382 21.7021 70.3823 20.6958C70.3382 15.1826 70.3382 9.66925 70.3382 4.15601ZM35.5 8.2703C33.6037 7.04514 31.3106 6.56382 29.1056 7.00138C26.9889 7.35143 25.1367 8.48907 23.946 10.2831C22.4907 12.3396 22.1379 14.9212 22.2261 17.3716C22.3584 19.4718 22.9758 21.7909 24.4752 23.3224C25.9746 24.8538 28.1795 25.3789 30.2522 25.4664C32.0603 25.5539 33.9124 25.1601 35.5441 24.3725C37.264 23.4099 38.3665 21.6158 38.4546 19.6469H33.7361C33.6037 20.2595 33.2509 20.8283 32.81 21.3095C32.2808 21.7471 31.6193 22.0097 30.9577 22.0097C29.8553 22.1409 28.7969 21.7471 28.0473 20.9158C27.2534 19.9094 27.077 18.5967 27.1211 17.4153H38.8515C38.9838 15.7963 38.8075 14.1774 38.4106 12.6021C37.9696 10.8519 36.9553 9.32044 35.5 8.2703ZM27.2975 14.1774C27.2975 13.1272 27.6503 12.1208 28.3118 11.2895C29.5025 9.93302 32.0603 10.0205 32.9864 11.5958C33.4274 12.3833 33.6037 13.3022 33.6037 14.1774H27.2975ZM42.5126 8.75203C44.056 7.39558 46.2169 7.00178 48.2014 6.95802C50.1859 6.91427 52.3908 7.30807 54.0225 8.62074C55.2131 9.5834 55.6983 11.1586 55.7865 12.6463C55.8368 13.696 55.8297 14.7314 55.8225 15.7689V15.769C55.8171 16.5478 55.8117 17.3278 55.8306 18.1158C55.8389 18.5271 55.8425 18.9415 55.8461 19.3576V19.3576C55.8618 21.1545 55.8777 22.982 56.2715 24.723H51.553C51.4206 23.9791 51.3766 23.1915 51.3766 22.4039C50.4504 23.8478 48.9069 24.8105 47.1871 25.0293C45.776 25.2043 44.3207 25.0293 42.9536 24.5042C41.7629 23.9353 40.8368 22.8852 40.484 21.5725C39.9548 19.8661 40.2635 18.0283 41.2778 16.5844C42.2921 15.3154 43.6592 14.4403 45.2468 14.0465C46.9417 13.606 48.6735 13.5686 50.3747 13.5319C50.5325 13.5285 50.6901 13.5251 50.8474 13.5214C50.8474 13.4493 50.8477 13.377 50.848 13.3045V13.3038V13.3032V13.3026C50.8514 12.4946 50.8548 11.662 50.4504 10.9399C49.6567 9.80219 48.1132 9.53961 46.9666 10.3273C46.8343 10.4148 46.7461 10.5023 46.6579 10.5898C46.2169 11.0711 45.9964 11.7274 46.0847 12.3838H41.0132C40.9691 11.0711 41.4983 9.71469 42.5126 8.75203ZM47.0989 17.0657C46.4374 17.2844 45.8641 17.7657 45.5113 18.3783C45.0263 19.4285 45.3349 20.6536 46.261 21.3537C47.5399 22.1851 49.2598 21.8351 50.0977 20.5661C50.8914 19.3847 50.8914 17.9408 50.8914 16.5844C49.6126 16.4531 48.2896 16.5844 47.0989 17.0657ZM96.1373 6.95649C94.1088 6.95649 91.9474 7.35029 90.4039 8.70676C89.3901 9.66934 88.8168 11.0258 88.8605 12.426H93.9322C93.844 11.7259 94.1525 10.982 94.6821 10.5007C95.7405 9.66934 97.2394 9.80063 98.1658 10.7633C98.7448 11.5023 98.742 12.5111 98.7395 13.428C98.7393 13.4882 98.7392 13.5481 98.7392 13.6074C96.7543 13.6074 94.7704 13.6511 92.8738 14.1762C91.3741 14.5701 90.0071 15.4451 89.0816 16.7141C87.9786 18.3331 87.8021 20.3458 88.5519 22.1398C89.037 23.3212 89.9634 24.2401 91.1538 24.6777C92.477 25.0714 93.844 25.2027 95.2109 25.0277C96.8863 24.8527 98.3424 23.7151 99.2679 22.4023C99.2679 23.19 99.3125 23.9338 99.4445 24.7214H104.119C103.671 22.7031 103.674 20.573 103.678 18.5029V18.5028V18.5016V18.5003C103.678 18.3274 103.678 18.1549 103.678 17.983C103.678 16.189 103.678 14.3513 103.634 12.5135C103.502 11.1133 103.061 9.58184 101.914 8.66297C100.326 7.35029 98.1658 6.95649 96.1373 6.95649ZM93.5354 18.1143C93.9322 17.5455 94.5493 17.1516 95.2554 16.9329C96.4013 16.5828 97.5925 16.4953 98.7392 16.5828L98.7394 16.7751C98.7413 18.0786 98.7434 19.4825 97.9447 20.6084C97.1074 21.8335 95.4311 22.1835 94.1525 21.396C93.0941 20.6521 92.8293 19.2081 93.5354 18.1143ZM112.982 7.74535C114.526 6.95774 116.334 6.73897 118.01 7.13276C119.641 7.43906 121.009 8.53297 121.671 10.0644C122.123 11.1017 122.163 12.221 122.204 13.3359L122.204 13.3364C122.214 13.6322 122.225 13.9276 122.243 14.2212V24.7226H116.952V13.2148C116.952 12.2522 116.379 11.3771 115.496 10.8958C113.953 10.1957 112.145 10.8083 111.351 12.2959C110.93 13.169 110.941 14.1409 110.951 15.0687V15.0698C110.952 15.2111 110.954 15.3514 110.954 15.4901V24.6789H105.75V13.4336C105.75 13.0309 105.752 12.6264 105.754 12.2206C105.761 10.5979 105.768 8.95287 105.662 7.30779H110.602L110.63 7.84104C110.664 8.49637 110.699 9.15749 110.734 9.84562C111.263 9.01425 112.057 8.27042 112.982 7.74535ZM68.8393 7.35106C67.5163 7.21979 66.1933 7.48232 65.0026 8.09491C64.0325 8.7075 63.3268 9.58258 62.8859 10.7202C62.8859 9.6286 62.8419 8.53696 62.798 7.44526L62.7977 7.43857H57.9467C58.1672 9.58258 58.2554 11.7704 58.2114 13.9144C58.2114 15.125 58.2065 16.3356 58.2016 17.5462C58.1918 19.9674 58.1819 22.3886 58.2114 24.8097H63.3268V15.8398C63.3268 14.7021 63.5915 13.3894 64.5617 12.6893C65.7965 11.8142 67.384 11.8142 68.8393 11.9454V7.35106Z" fill="#596063" /></svg>',autoSize:!0}}),q([r()],J.prototype,"host",void 0),q([r()],J.prototype,"headerConfig",void 0),q([r()],J.prototype,"currentBranding",void 0),q([l("componentWillLoad")],J.prototype,"componentWillLoad",null);var Y=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class ee extends c{componentWillLoad(){this.hasFooterSlot=!!this.host.querySelector('[slot="footer-slot"]')}render(){return this.renderFooter()}renderFooter(){return(this.footnote||this.hasFooterSlot)&&e(t,null,e(Q,null),e("div",{class:"footer-container"},this.hasFooterSlot?e("slot",{name:"footer-slot"}):e("div",{class:"footer-footnote"},this.footnote)))}}Y([r()],ee.prototype,"host",void 0),Y([r()],ee.prototype,"footnote",void 0),Y([l("componentWillLoad")],ee.prototype,"componentWillLoad",null);var te=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class ie extends c{watchOpenState(){this.updateZIndex()}updateZIndex(){const e=this.backdropController.getBackdrop();"open"==this.openState?(e&&w.setZIndex(e,"base"),w.setZIndex(this.host,"base")):u((()=>{e&&w.removeZIndex(e,"base"),w.removeZIndex(this.host,"base")}),this.host,300)}}te([r()],ie.prototype,"host",void 0),te([r()],ie.prototype,"openState",void 0),te([r()],ie.prototype,"backdropController",void 0),te([l("watchOpenState")],ie.prototype,"watchOpenState",null);var oe=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class ne extends v{constructor(){super({callback:()=>{this.updateBackdropUI(this.openState)}}),this.backdrop=null}connectedCallback(){this.backdrop&&this.backdrop.isConnected||(this.backdrop=this.createBackdrop())}disconnectedCallback(){this.backdrop&&this.backdrop.remove(),this.backdrop=null}watchOpenState(e){this.updateBackdropUI(e)}watchShowAsOverlay(){this.updateBackdropUI(this.openState)}getBackdrop(){return this.backdrop}shouldShowBackdrop(){return!(this.isLargeScreen()&&!this.showAsOverlay)}createBackdrop(){const e=document.createElement("vega-backdrop");return e.visible=!1,e.duration=150,e.addEventListener("vegaClick",(()=>{this.openStateController.setOpenState("close")})),document.body.append(e),e}updateBackdropUI(e){const t=document.querySelector("vega-left-nav + .vega-left-nav-content"),i=this.backdrop;i&&(i.visible="open"===e&&(!t||this.shouldShowBackdrop()))}isLargeScreen(){const e=y();return"L"==e||"XL"==e}}oe([r()],ne.prototype,"openState",void 0),oe([r()],ne.prototype,"showAsOverlay",void 0),oe([r()],ne.prototype,"openStateController",void 0),oe([l("connectedCallback")],ne.prototype,"connectedCallback",null),oe([l("disconnectedCallback")],ne.prototype,"disconnectedCallback",null),oe([l("watchOpenState")],ne.prototype,"watchOpenState",null),oe([l("watchShowAsOverlay")],ne.prototype,"watchShowAsOverlay",null);class ae extends c{render(){var t;return e("div",{class:"vega-nav-list-container"},(null===(t=this.source)||void 0===t?void 0:t.length)?this.renderListBySource():e("slot",null))}renderListBySource(){return e(t,null,this.source.map((i=>e(t,null,this.renderLeftNavSourceItem(i)))))}renderLeftNavSourceItem(e){return"section"==e.type?this.renderSection(e):"group"==e.type?this.renderGroup(e):this.renderLink(e)}renderSection(t){var i;return e("vega-left-nav-section",{itemKey:t.key,sectionHeader:t.sectionHeader},null===(i=t.children)||void 0===i?void 0:i.map((e=>"group"==e.type?this.renderGroup(e):this.renderLink(e))))}renderGroup(t){var i;return e("vega-left-nav-group",{itemKey:t.key,key:t.key||t.name,icon:t.icon,label:t.name,"open-by-default":t.openByDefault},null===(i=t.children)||void 0===i?void 0:i.map((e=>"group"==e.type?this.renderGroup(e):this.renderLink(e))))}renderLink(t){return e("vega-left-nav-link",{itemKey:t.key,key:t.key||t.name,icon:t.icon,url:t.url,target:t.target,selected:t.selected,counterBadge:t.counterBadge},t.name)}}!function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);a>3&&s&&Object.defineProperty(t,i,s)}([r()],ae.prototype,"source",void 0);var se=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class re extends c{registerMenuClickObserver(){A.addUniqueObserverToNode(this.host,V,(()=>{this.shouldAutoCollapse()&&this.openStateController.setOpenState("close")}))}unregisterMenuClickObserver(){A.removeUniqueObserverFromNode(this.host,V)}shouldAutoCollapse(){return this.autoCollapseOnOverlay&&this.backdropController.shouldShowBackdrop()&&"open"===this.openState}}se([r()],re.prototype,"host",void 0),se([r()],re.prototype,"openState",void 0),se([r()],re.prototype,"autoCollapseOnOverlay",void 0),se([r()],re.prototype,"showAsOverlay",void 0),se([r()],re.prototype,"backdropController",void 0),se([r()],re.prototype,"openStateController",void 0),se([l("connectedCallback")],re.prototype,"registerMenuClickObserver",null),se([l("disconnectedCallback")],re.prototype,"unregisterMenuClickObserver",null);const le=[{payloadKey:"IS_USING_TEMPLATE",payloadDescription:"Contains the data records to be rendered and displayed within the left nav",payloadValue:e=>!e.source||0===e.source.length},{payloadKey:"IS_USING_DATA_SOURCE",payloadDescription:"Contains the data records to be rendered and displayed within the left nav",payloadValue:e=>!!e.source&&e.source.length>0}];var ce=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};const de=class{constructor(e){i(this,e),this.vegaStateUpdate=o(this,"vegaStateUpdate",7),this.stateUpdate=o(this,"stateUpdate",7),this.globalSlimmers={},this.headerRenderer=new J,this.footerRenderer=new ee,this.openStateController=new $,this.backdropController=new ne,this.zIndexController=new ie,this.listRenderer=new ae,this.vegaLeftNavAutoCollapseController=new re,this.stateUpdateEventEmitter=k(de,O),this.componentGlobalStyleSlimmer=new I(".vega-left-nav-content{transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-duration:200ms;transition-property:margin}vega-left-nav.disableAnimation+.vega-left-nav-content.open{transition-duration:0s}.vega-left-nav-content.open{margin-left:300px}"),this.vegaComponentUsageRuntimeMetricsSlimmer=new h(le),this.autoCollapseGroupsNotifySlimmer=G(de,"autoCollapseGroups","watchAutoCollapseGroups"),this.brandSwitchControllerSlimmer=new D,this.currentBranding=W.getBranding(),this.openState="close",this.open=!1,this.headerConfig={},this.footnote="",this.showAsOverlay=!0,this.autoCollapseOnOverlay=!1,this.autoCollapseGroups=!1}watchOpenState(){}watchOpen(){}watchShowAsOverlay(){}watchAutoCollapseGroups(){}componentWillLoad(){"string"==typeof this.autoCollapseGroups&&(this.autoCollapseGroups.includes("true")?this.autoCollapseGroups=!0:this.autoCollapseGroups.includes("false")&&(this.autoCollapseGroups=!1))}async toggle(){}render(){return p(e("slot",null)),s(e(n,null,this.headerRenderer.render(),this.listRenderer.render(),this.footerRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{openState:["watchOpenState"],open:["watchOpen"],showAsOverlay:["watchShowAsOverlay"],autoCollapseGroups:["watchAutoCollapseGroups"]}}};ce([f()],de.prototype,"globalSlimmers",void 0),ce([d()],de.prototype,"headerRenderer",void 0),ce([d()],de.prototype,"footerRenderer",void 0),ce([d()],de.prototype,"openStateController",void 0),ce([d()],de.prototype,"backdropController",void 0),ce([d()],de.prototype,"zIndexController",void 0),ce([d()],de.prototype,"listRenderer",void 0),ce([d()],de.prototype,"vegaLeftNavAutoCollapseController",void 0),ce([d()],de.prototype,"stateUpdateEventEmitter",void 0),ce([d()],de.prototype,"componentGlobalStyleSlimmer",void 0),ce([d()],de.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ce([d()],de.prototype,"autoCollapseGroupsNotifySlimmer",void 0),ce([d()],de.prototype,"brandSwitchControllerSlimmer",void 0),ce([j((e=>[{keyCode:"Escape",activeElementInScope:()=>{const t=e.backdropController.getBackdrop();return t&&t.visible?[document.body]:[e.host]},callback:()=>{const t=e.backdropController.getBackdrop();t&&t.visible&&e.openStateController.setOpenState("close")}}]))],de.prototype,"host",void 0),de.style=':host{display:none;flex-direction:column;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));position:fixed;top:0px;right:0px;bottom:0px;left:0px;text-align:left;transition-timing-function:cubic-bezier(0, 0, 0.2, 1);width:300px;transition-duration:200ms;transition-property:transform;transform:translateX(-320px)}:host(.open.disableAnimation){transition-duration:0s}:host(.open){transform:translateX(0px)}.header-container{padding-left:24px;padding-right:24px;padding-top:24px;padding-bottom:16px}.header-container .header-title{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:24px;font-weight:700;line-height:32px;letter-spacing:0px;overflow-wrap:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){.header-container .header-title{font-family:"Inter", sans-serif;font-size:24px;font-weight:700;line-height:32px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.header-container .header-title{font-family:"Inter", sans-serif;font-size:24px;font-weight:700;line-height:32px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.header-container .header-title{font-family:"Inter", sans-serif;font-size:28px;font-weight:700;line-height:36px;letter-spacing:0px}}.header-container .header-subtitle{color:rgba(var(--v-text-secondary, 107, 116, 125, 1));font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px;margin-top:2px;overflow-wrap:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){.header-container .header-subtitle{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.header-container .header-subtitle{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.header-container .header-subtitle{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}.header-footer-separator-container{padding-left:12px;padding-right:12px}.header-footer-separator{width:100%;height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1))}.vega-nav-list-container{flex-grow:1;padding-left:12px;padding-right:12px;padding-top:12px;overflow-y:auto;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-nav-list-container .vega-links-icon .prefix-icon{display:flex;justify-content:center;align-items:center;flex-shrink:0;width:20px;height:20px}a .vega-links-name{flex:1 1 0%;overflow:hidden;overflow-wrap:break-word}.footer-container{padding-top:16px;padding-bottom:16px;padding-left:24px;padding-right:24px}.footer-container .footer-footnote{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));overflow-wrap:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){.footer-container .footer-footnote{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.footer-container .footer-footnote{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.footer-container .footer-footnote{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}body.vega-overflow-hidden{overflow:hidden}.header-container vega-icon[icon="v-internal-icon heartland-logo"]+.header-subtitle{margin-top:8px}';var pe=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class he extends c{constructor(){super(...arguments),this.handleClick=e=>{const t=e.currentTarget;if(t&&"$1"===t.dataset.root){e.preventDefault(),this.vegaLeftNavGroupOpenStateController.toggle();const t=this.vegaLeftNavGroupOpenStateController.isOpen();this.groupClickEventEmitter.emit(t?"EXPAND":"COLLAPSE"),this.notifyOtherGroup()}}}getGroupContainer(){return this.groupContainer}render(){return e("div",{class:"vega-li-main "+(this.openByDefault?"open":""),ref:e=>this.groupContainer=e},e("a",{href:`#${this.label}`,role:"button",tabIndex:0,"data-root":"$1",onClick:this.handleClick,"aria-label":this.label||"No label defined"},this.icon&&e("div",{class:"vega-links-icon"},e("div",{class:"prefix-icon"},e("vega-icon",{icon:this.icon,size:"size-16"}))),e("span",{class:"vega-links-name"},this.label),e("div",{class:"suffix-icons"},e("vega-icon",{icon:C.getIconKey("chevron-down"),size:"size-12"}),e("vega-icon",{icon:C.getIconKey("chevron-up"),size:"size-12"}))),e("div",{class:"vega-nav-list-sub"},e("slot",null)))}notifyOtherGroup(){const e=this.vegaLeftNavHierarchyController.getTopParent();e&&T.notify(z.getSubject(e,M),{host:this.host})}}C.register({"chevron-up":B,"chevron-down":U}),pe([r()],he.prototype,"host",void 0),pe([r()],he.prototype,"autoCollapseGroups",void 0),pe([r()],he.prototype,"icon",void 0),pe([r()],he.prototype,"label",void 0),pe([r()],he.prototype,"groupClickEventEmitter",void 0),pe([r()],he.prototype,"vegaLeftNavHierarchyController",void 0),pe([r()],he.prototype,"openByDefault",void 0),pe([r()],he.prototype,"itemKey",void 0),pe([r()],he.prototype,"vegaLeftNavGroupOpenStateController",void 0);var fe=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class ve extends c{disconnectedCallback(){const e=this.vegaLeftNavHierarchyController.getTopParent();e&&T.unregister(z.getSubject(e,N),this.observer)}componentWillLoad(){const e=this.vegaLeftNavHierarchyController.getTopParent();e&&(this.observer=new Z(this.isAcceptableObserver.bind(this),this.observerListener.bind(this)),T.register(z.getSubject(e,N),this.observer))}isAcceptableObserver(e){return!this.host.contains(e.host)}shouldCollapse(){return"on-link-click"===this.autoCollapseGroups||!0===this.autoCollapseGroups||!1===this.autoCollapseGroups||"always"===this.autoCollapseGroups}observerListener(){this.shouldCollapse()&&this.vegaLeftNavGroupOpenStateController.close()}}fe([r()],ve.prototype,"host",void 0),fe([r()],ve.prototype,"autoCollapseGroups",void 0),fe([r()],ve.prototype,"vegaLeftNavGroupOpenStateController",void 0),fe([r()],ve.prototype,"vegaLeftNavHierarchyController",void 0),fe([r()],ve.prototype,"openByDefault",void 0),fe([l("disconnectedCallback")],ve.prototype,"disconnectedCallback",null),fe([l("componentWillLoad")],ve.prototype,"componentWillLoad",null);var ue=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class ge extends c{disconnectedCallback(){const e=this.vegaLeftNavHierarchyController.getTopParent();e&&T.unregister(z.getSubject(e,M),this.observer)}componentWillLoad(){const e=this.vegaLeftNavHierarchyController.getTopParent();e&&(this.observer=new Z(this.isAcceptableObserver.bind(this),this.observerListener.bind(this)),T.register(z.getSubject(e,M),this.observer))}isAcceptableObserver(e){return e.host!==this.host&&!this.host.contains(e.host)}shouldCollapse(){return 1==this.autoCollapseGroups||"on-group-click"===this.autoCollapseGroups||"always"===this.autoCollapseGroups}observerListener(){this.shouldCollapse()&&this.vegaLeftNavGroupOpenStateController.close()}}ue([r()],ge.prototype,"host",void 0),ue([r()],ge.prototype,"autoCollapseGroups",void 0),ue([r()],ge.prototype,"vegaLeftNavGroupOpenStateController",void 0),ue([r()],ge.prototype,"vegaLeftNavHierarchyController",void 0),ue([l("disconnectedCallback")],ge.prototype,"disconnectedCallback",null),ue([l("componentWillLoad")],ge.prototype,"componentWillLoad",null);var me=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class xe extends F{constructor(){super({parent:"vega-left-nav",subStates:[{subStateName:"autoCollapseGroups",parentStateName:"autoCollapseGroups"}]})}}me([r()],xe.prototype,"host",void 0),me([r({writable:!0})],xe.prototype,"autoCollapseGroups",void 0);class be extends c{isOpen(){return this.renderer.getGroupContainer().classList.contains("open")}open(){this.renderer.getGroupContainer().classList.add("open")}close(){this.renderer.getGroupContainer().classList.remove("open")}toggle(){this.isOpen()?this.close():this.open()}}!function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);a>3&&s&&Object.defineProperty(t,i,s)}([r()],be.prototype,"renderer",void 0);var Ce=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class we extends c{componentWillLoad(){const e=b(this.host,"vega-left-nav"),t=b(this.host,"vega-nav-card");(e||t)&&(this.parent=e||t)}getTopParent(){return this.parent}}Ce([r()],we.prototype,"host",void 0),Ce([l("componentWillLoad")],we.prototype,"componentWillLoad",null);var ye=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class je extends c{disconnectedCallback(){const e=this.vegaLeftNavHierarchyController.getTopParent();e&&T.unregister(z.getSubject(e,E),this.observer)}componentWillLoad(){const e=this.vegaLeftNavHierarchyController.getTopParent();e&&!this.openByDefault&&(this.observer=new Z(this.isAcceptableObserver.bind(this),this.observerListener.bind(this)),T.register(z.getSubject(e,E),this.observer))}isAcceptableObserver(e){return this.host.contains(e.host)}observerListener(){this.vegaLeftNavGroupOpenStateController.open()}}ye([r()],je.prototype,"host",void 0),ye([r()],je.prototype,"vegaLeftNavGroupOpenStateController",void 0),ye([r()],je.prototype,"vegaLeftNavHierarchyController",void 0),ye([r()],je.prototype,"openByDefault",void 0),ye([l("disconnectedCallback")],je.prototype,"disconnectedCallback",null),ye([l("componentWillLoad")],je.prototype,"componentWillLoad",null);var ke=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};const Oe=class{constructor(e){i(this,e),this.vegaGroupClick=o(this,"vegaGroupClick",7),this.groupClick=o(this,"groupClick",7),this.globalSlimmers={},this.renderer=new he,this.vegaLeftNavHierarchyController=new we,this.linkClickObserverController=new ve,this.otherGroupsClickObserverController=new ge,this.groupClickEventEmitter=k(Oe,R),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.vegaLeftNavGroupStateController=new xe,this.vegaLeftNavGroupOpenStateController=new be,this.vegaLeftNavGroupForInitializeSelectedController=new je,this.autoCollapseGroups=!1,this.label="",this.openByDefault=!1}render(){return p(e("slot",null)),e(n,{"data-key":this.itemKey},s(this.renderer.render(),this.host))}get host(){return a(this)}};ke([f()],Oe.prototype,"globalSlimmers",void 0),ke([d()],Oe.prototype,"renderer",void 0),ke([d()],Oe.prototype,"vegaLeftNavHierarchyController",void 0),ke([d()],Oe.prototype,"linkClickObserverController",void 0),ke([d()],Oe.prototype,"otherGroupsClickObserverController",void 0),ke([d()],Oe.prototype,"groupClickEventEmitter",void 0),ke([d()],Oe.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ke([d()],Oe.prototype,"vegaLeftNavGroupStateController",void 0),ke([d()],Oe.prototype,"vegaLeftNavGroupOpenStateController",void 0),ke([d()],Oe.prototype,"vegaLeftNavGroupForInitializeSelectedController",void 0),Oe.style=':host{display:block}.suffix-icons{padding-left:8px}.suffix-icons vega-icon,.vega-li-main.open>a>.suffix-icons vega-icon:first-of-type{display:none}.suffix-icons vega-icon:first-of-type,.vega-li-main.open>a>.suffix-icons vega-icon:last-of-type{display:inline-flex}.vega-nav-list-sub{display:none}.vega-li-main.open>.vega-nav-list-sub{display:block}.vega-li-main>a{display:flex;align-items:center;overflow:hidden;padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;border-radius:8px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:24px;letter-spacing:0px;cursor:pointer;text-decoration:none}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-li-main>a{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-li-main>a{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-li-main>a{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:24px;letter-spacing:0px}}.vega-li-main>a:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px}.vega-li-main>a:hover{background-color:rgba(var(--v-bg-tertiary, 240, 243, 247, 1))}.vega-li-main>a .vega-links-name{flex:1 1 0%;overflow:hidden;overflow-wrap:break-word}.vega-links-icon{color:rgba(var(--v-text-secondary, 107, 116, 125, 1));padding-right:12px;box-sizing:border-box}.vega-links-icon .prefix-icon{display:flex;justify-content:center;align-items:center;flex-shrink:0;width:20px;height:20px}::slotted(vega-left-nav-group){padding-left:32px}::slotted(vega-left-nav-link){padding-left:32px}';var Re=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class Se extends c{constructor(){super(...arguments),this.handleClick=()=>{this.selected||this.customSelectionEnabled||this.controller.setSelected(!0),this.menuClickEventEmitter.emit(),this.notifyVegaLeftNav(),this.notifyVegaLeftGroup()}}render(){return e(n,{class:!0===this.selected?"selected":"","data-key":this.itemKey},e("a",{href:this.url||"javascript:void(0);",target:this.target,onClick:this.handleClick},this.icon&&e("div",{class:"vega-links-icon"},e("div",{class:"prefix-icon"},e("vega-icon",{icon:this.icon,size:"size-16"}))),e("span",{class:"vega-links-name"},e("slot",null)),!!this.deprecatedPropertySlimmer.getValue()&&e("div",{class:"vega-counter-badge"},e("vega-counter-badge",{count:this.deprecatedPropertySlimmer.getValue(),color:this.counterBadge.color}))))}notifyVegaLeftNav(){const e=b(this.host,"vega-left-nav");e&&T.notify(z.getSubject(e,V),{host:this.host})}notifyVegaLeftGroup(){const e=this.vegaLeftNavHierarchyController.getTopParent();e&&T.notify(z.getSubject(e,N),{host:this.host})}}Re([r()],Se.prototype,"host",void 0),Re([r()],Se.prototype,"selected",void 0),Re([r()],Se.prototype,"url",void 0),Re([r()],Se.prototype,"counterBadge",void 0),Re([r()],Se.prototype,"icon",void 0),Re([r()],Se.prototype,"menuClickEventEmitter",void 0),Re([r()],Se.prototype,"controller",void 0),Re([r()],Se.prototype,"deprecatedPropertySlimmer",void 0),Re([r()],Se.prototype,"customSelectionEnabled",void 0),Re([r()],Se.prototype,"itemKey",void 0),Re([r()],Se.prototype,"target",void 0),Re([r()],Se.prototype,"vegaLeftNavHierarchyController",void 0);var Le=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class He extends c{disconnectedCallback(){const e=this.getObserverSubject();e&&T.unregister(e,this.observer)}componentWillLoad(){this.observer=new Z(this.isAcceptableNavListObserver.bind(this),this.observerListener.bind(this));const e=this.getObserverSubject();e&&T.register(e,this.observer)}isAcceptableNavListObserver(e){return e instanceof HTMLElement&&b(this.host,".vega-nav-list-container")===b(e,".vega-nav-list-container")}}Le([l("disconnectedCallback")],He.prototype,"disconnectedCallback",null),Le([l("componentWillLoad")],He.prototype,"componentWillLoad",null);var Ie=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class Ae extends He{componentWillRender(){if(this.selected){const e=this.vegaLeftNavHierarchyController.getTopParent();e&&T.notify(z.getSubject(e,E),{host:this.host})}}componentDidRender(){if(this.selected){const e=this.getObserverSubject();e&&T.notify(e,this.host)}}setSelected(e){this.customSelectionEnabled||(this.selected=e)}observerListener(e){e!==this.host&&this.setSelected(!1)}getObserverSubject(){const e=this.vegaLeftNavHierarchyController.getTopParent();return e?z.getSubject(e,_):null}}Ie([r()],Ae.prototype,"host",void 0),Ie([r({writable:!0})],Ae.prototype,"selected",void 0),Ie([r()],Ae.prototype,"customSelectionEnabled",void 0),Ie([r()],Ae.prototype,"vegaLeftNavHierarchyController",void 0),Ie([l("componentWillRender")],Ae.prototype,"componentWillRender",null),Ie([l("componentDidRender")],Ae.prototype,"componentDidRender",null);var ze=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};const Ve=class{constructor(e){i(this,e),this.vegaMenuClick=o(this,"vegaMenuClick",7),this.menuClick=o(this,"menuClick",7),this.globalSlimmers={},this.renderer=new Se,this.vegaLeftNavHierarchyController=new we,this.controller=new Ae,this.menuClickEventEmitter=k(Ve,S),this.deprecatedPropertySlimmer=K(Ve,"counterBadge.count","counterBadge.counter",void 0),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.selected=!1,this.customSelectionEnabled=!1,this.target="_self"}render(){return p(e("slot",null)),s(this.renderer.render(),this.host)}get host(){return a(this)}};ze([f()],Ve.prototype,"globalSlimmers",void 0),ze([d()],Ve.prototype,"renderer",void 0),ze([d()],Ve.prototype,"vegaLeftNavHierarchyController",void 0),ze([d()],Ve.prototype,"controller",void 0),ze([d()],Ve.prototype,"menuClickEventEmitter",void 0),ze([d()],Ve.prototype,"deprecatedPropertySlimmer",void 0),ze([d()],Ve.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Ve.style=':host{display:block}:host(.selected) .vega-links-icon{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}:host(.selected) a{background-color:rgba(var(--v-bg-selected, 0, 151, 255, 0.3))}:host .vega-counter-badge{position:relative;width:32px;height:20px}:host vega-counter-badge{position:absolute;top:10px;left:18px}:host a{display:flex;align-items:center;overflow:hidden;padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;border-radius:8px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:24px;letter-spacing:0px;cursor:pointer;text-decoration:none}@media screen and (min-width: 768px) and (max-width: 1023px){:host a{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host a{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host a{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:24px;letter-spacing:0px}}:host a .vega-links-name{flex:1 1 0%;overflow:hidden;overflow-wrap:break-word}:host .vega-links-icon{color:rgba(var(--v-text-secondary, 107, 116, 125, 1));padding-right:12px;box-sizing:border-box}:host .vega-links-icon .prefix-icon{display:flex;justify-content:center;align-items:center;flex-shrink:0;width:20px;height:20px}:host(:not(.selected)) a:hover{background-color:rgba(var(--v-bg-tertiary, 240, 243, 247, 1))}:host>a:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px}';var Me=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class Ne extends c{render(){return e(n,{"data-key":this.itemKey},this.renderSectionHeader(),e("slot",null),this.renderListSeparator())}renderListSeparator(){return e("div",{class:"list-separator-container"},e("div",{class:"list-separator"}))}renderSectionHeader(){var t;return(null===(t=this.sectionHeader)||void 0===t?void 0:t.title)&&e("div",{class:"section-header"},e("div",{class:"section-header-title"},this.sectionHeader.title),this.sectionHeader.actionTitle&&e("vega-button-link",{label:this.sectionHeader.actionTitle,size:"small",link:this.sectionHeader.actionLink,eventful:this.sectionHeader.actionEventful,ref:e=>{A.addUniqueObserverToNode(e,L,(()=>{this.actionClickEventEmitter.emit()}))}}))}}Me([r()],Ne.prototype,"sectionHeader",void 0),Me([r()],Ne.prototype,"actionClickEventEmitter",void 0),Me([r()],Ne.prototype,"itemKey",void 0);var Ee=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};const _e=class{constructor(e){i(this,e),this.vegaActionClick=o(this,"vegaActionClick",7),this.actionClick=o(this,"actionClick",7),this.globalSlimmers={},this.renderer=new Ne,this.actionClickEventEmitter=k(_e,H),this.vegaComponentUsageRuntimeMetricsSlimmer=new h}render(){return p(e("slot",null)),s(this.renderer.render(),this.host)}get host(){return a(this)}};Ee([f()],_e.prototype,"globalSlimmers",void 0),Ee([d()],_e.prototype,"renderer",void 0),Ee([d()],_e.prototype,"actionClickEventEmitter",void 0),Ee([d()],_e.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),_e.style=':host{display:block}:host(:last-child) .list-separator-container{display:none}.list-separator-container{padding-left:12px;padding-right:12px;padding-top:20px;padding-bottom:20px}.list-separator{width:100%;height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1))}.section-header{display:flex;align-items:center;gap:12px;padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;border-radius:4px}.section-header>.section-header-title{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;flex:1 1 0%;overflow:hidden;text-transform:uppercase}@media screen and (min-width: 768px) and (max-width: 1023px){.section-header>.section-header-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.section-header>.section-header-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.section-header>.section-header-title{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px}}.section-header>vega-button-link{flex-basis:0}';var Ge=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class De extends v{constructor(){super({callback:()=>{this.updateMaxHeight()}})}watchMaxHeight(){this.updateMaxHeight()}updateMaxHeight(){const e=P(this.maxHeight,"widthAndHeight");this.currentMaxHeight=e}}Ge([r()],De.prototype,"maxHeight",void 0),Ge([r({writable:!0})],De.prototype,"currentMaxHeight",void 0),Ge([l("watchMaxHeight")],De.prototype,"watchMaxHeight",null);const We=[{payloadKey:"IS_USING_TEMPLATE",payloadDescription:"Contains the data records to be rendered and displayed within the nav card",payloadValue:e=>!e.source||0===e.source.length},{payloadKey:"IS_USING_DATA_SOURCE",payloadDescription:"Contains the data records to be rendered and displayed within the nav card",payloadValue:e=>!!e.source&&e.source.length>0}];var Be=function(e,t,i,o){var n,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(s=(a<3?n(s):a>3?n(t,i,s):n(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};const Ue=class{constructor(e){i(this,e),this.globalSlimmers={},this.listRenderer=new ae,this.maxHeightController=new De,this.vegaComponentUsageRuntimeMetricsSlimmer=new h(We)}watchMaxHeight(){}render(){return p(e("slot",null)),s(e(n,{style:{maxHeight:this.currentMaxHeight}},this.listRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{maxHeight:["watchMaxHeight"]}}};Be([f()],Ue.prototype,"globalSlimmers",void 0),Be([d()],Ue.prototype,"listRenderer",void 0),Be([d()],Ue.prototype,"maxHeightController",void 0),Be([d()],Ue.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Ue.style=":host{display:block;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:12px;box-shadow:var(--v-shadow-form-field, 0px 1px 2px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.1));text-align:left;overflow-y:auto;width:300px}.vega-nav-list-container{padding:12px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-nav-list-container .vega-links-icon .prefix-icon{display:flex;justify-content:center;align-items:center;flex-shrink:0;width:20px;height:20px}a .vega-links-name{flex:1 1 0%;overflow:hidden;overflow-wrap:break-word}";export{de as vega_left_nav,Oe as vega_left_nav_group,Ve as vega_left_nav_link,_e as vega_left_nav_section,Ue as vega_nav_card}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as t,d as e,M as s,C as n,o as r,i as o,g as i}from"./p-fb05335d.js";import{c as a}from"./p-a841cf13.js";import{V as l}from"./p-8aee6b74.js";import"./p-6e1ab235.js";import{I as c,c as h}from"./p-593e0f80.js";import{r as u}from"./p-6e70d3cc.js";import{i as d}from"./p-e4c4ea35.js";import{g as E}from"./p-8b5d3a52.js";import{U as T,V as p}from"./p-5904616e.js";const b=[{payloadKey:"IS_OVERRIDECOLORS_METHOD_CALLED",payloadDescription:"Indicate if the method overrideColors of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"overrideColors"===e,payloadValue:()=>!0},{payloadKey:"IS_RESET_METHOD_CALLED",payloadDescription:"Indicate if the method reset of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"reset"===e,payloadValue:()=>!0},{payloadKey:"IS_TOGGLEDARKMODE_METHOD_CALLED",payloadDescription:"Indicate if the method toggleDarkMode of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"toggleDarkMode"===e,payloadValue:()=>!0},{payloadKey:"IS_ISDARKMODE_METHOD_CALLED",payloadDescription:"Indicate if the method isDarkMode of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"isDarkMode"===e,payloadValue:()=>!0},{payloadKey:"IS_APPLY_BRANDING_METHOD_CALLED",payloadDescription:"Indicate if the method applyBranding of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"applyBranding"===e,payloadValue:()=>!0}];class f{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=h(f,["overrideColors","reset","toggleDarkMode","isDarkMode","applyBranding"],b)}async overrideColors(t){l.overrideColors(t)}async reset(){l.reset()}toggleDarkMode(t){l.toggleDarkMode(t)}isDarkMode(){return l.isDarkMode()}applyBranding(t){l.applyBranding(t)}}!function(t,e,s,n){var r,o=arguments.length,i=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,s,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(i=(o<3?r(i):o>3?r(e,s,i):r(e,s))||i);o>3&&i&&Object.defineProperty(e,s,i)}([c()],f.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const C=new f,L=["none","solid","dashed","dotted","double","groove","ridge","inset","outset"],g=[{key:"white",dark:"#04041C",light:"#FCFCFC"},{key:"red",dark:"#AA091C",light:"#FF4C61"},{key:"orange",dark:"#974502",light:"#FDAB68"},{key:"yellow",dark:"#735C00",light:"#FFDC4C"},{key:"green",dark:"#2E6D18",light:"#7BDA58"},{key:"teal",dark:"#287171",light:"#7BD1D1"},{key:"gray",dark:"#595959",light:"#999999"},{key:"black",dark:"#FCFCFC",light:"#04041C"}],R={key:"default-head-bg",dark:"#181830",light:"#F0F3F7"};class _{static getTableColors(){return _.TABLE_COLORS}static setTableColors(t){_.TABLE_COLORS=t}static getColorKey(t,e=!1){var s;let n=null;const r=_.TABLE_COLORS,o=e?[...r,R]:r;if(o){const e=null===(s=u(t))||void 0===s?void 0:s.toUpperCase();if(e)n=o.find((t=>C.isDarkMode()?t.dark===e:t.light===e));else for(const e of o)if(e.key===t){n=e;break}}return n?n.key:""}}_.TABLE_COLORS=g;class O extends t{constructor(t){super(),this.type=m.COLOR,this.colorKey=t,t&&(this.color=this.formatColor(t))}renderStyle(){return{color:this.color?l.isDarkMode()?this.color.dark:this.color.light:this.colorKey||""}}renderClass(){return null}toJSON(){var t;return{color:(null===(t=this.color)||void 0===t?void 0:t.key)||this.colorKey||""}}clone(){return new O(this.colorKey)}formatColor(t){return _.getTableColors().find((e=>e.key===t))}}var m,k;!function(t){t.TABLE="EXTENSION_TABLE",t.CELL="EXTENSION_TABLE_CELL",t.CAPTION="EXTENSION_TABLE_CAPTION",t.COLOR="EXTENSION_TABLE_COLOR"}(m||(m={}));class A extends t{constructor({backgroundColor:t,border:e,width:s,height:n,alignment:r,borderCollapse:o}={},i=!0){super(),this.type=m.TABLE,this.useInternalStyle=i,this.backgroundColor=t,this.border=e,this.width=s,this.height=n,this.alignment=i&&void 0===r?A.DEFAULT_ALIGNMENT:r,this.backgroundColorAnnotation=new O(t),this.borderColorAnnotation=new O(null==e?void 0:e.color),this.borderCollapse=i&&void 0===o?A.DEFAULT_BORDER_COLLAPSE:o}static from(t,e=!0){return[m.TABLE,new A(t,e)]}static getDefaultStyles(){return{borderCollapse:A.DEFAULT_BORDER_COLLAPSE,margin:A.DEFAULT_ALIGNMENT_STYLE_VALUE}}get borderStr(){return this.border?`${this.border.style} ${this.border.width} ${this.borderColorAnnotation.renderStyle().color}`.trim():null}clone(){return new A({backgroundColor:this.backgroundColor,border:this.border,width:this.width,height:this.height,alignment:this.alignment,borderCollapse:this.borderCollapse},this.useInternalStyle)}toJSON(){return{table:a({backgroundColor:this.backgroundColor,border:this.border,width:this.width,height:this.height,alignment:this.alignment,borderCollapse:this.borderCollapse})}}renderStyle(){const t=this.backgroundColorAnnotation.renderStyle().color,e=Object.assign({border:this.borderStr,width:this.width,height:this.height,borderCollapse:this.borderCollapse},this.renderAlignmentStyle());return t&&(e.backgroundColor=t),a(e)}renderClass(){return"v-rte--extension-table"}renderAlignmentStyle(){return this.alignment?{margin:"center"===this.alignment?A.DEFAULT_ALIGNMENT_STYLE_VALUE:"left"===this.alignment?"0":"0 0 0 auto"}:{}}}A.DEFAULT_BORDER_COLLAPSE="collapse",A.DEFAULT_ALIGNMENT="center",A.DEFAULT_ALIGNMENT_STYLE_VALUE="0 auto";class RTETableBlock extends e{constructor(t,e){super(t),this.type="table-block",this.children=[];const{autoMatchFormat:s}=e||{autoMatchFormat:!0};s&&this.annotationMap.set(m.TABLE,new A)}static from(t,e){var s;const n=new RTETableBlock(t.id,e);return super.convertAnnotationsToMap(n.annotationMap,Object.assign({},t.annotations)),n.children=super.generateBlockChildren(t.children,e,n),(null===(s=t.annotations)||void 0===s?void 0:s.table)&&n.annotationMap.set(...A.from(t.annotations.table,null==e?void 0:e.autoMatchFormat)),n}clone(t){const e=new RTETableBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}getFirstNode(){return this.hasCaption()?this.children[0].children[0].getLastNode():this.children[0].children[0].children[0].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<table${super.generateAttributeString(t)}>${e}</table>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}getCaption(){const t=this.children.find((t=>"table-caption"===t.type));return null!=t?t:null}setCaption(t){const e=this.children.findIndex((t=>"table-caption"===t.type));t?(t.parent=this,e>=0?this.children[e]=t:this.children.unshift(t)):e>=0&&this.children.splice(e,1)}hasCaption(){return d(this.getCaption())}}!function(t){t.ROW="ROW",t.CAPTION="CAPTION",t.COLUMN="COLUMN",t.MERGE_CELLS="MERGE_CELLS",t.TABLE="TABLE",t.CELL="CELL",t.SPLIT_CELL="SPLIT_CELL"}(k||(k={}));class B{syncCursorPosition(t,e){const s=this.findRootContent(t);if(e&&s){const t=e.getRangeEndOffset();s.apply(new T(e,t))}}findRootContent(t){let e=t.parent;for(;e;){if(e instanceof p)return e;e=e.parent}}}const w="DELETE_TABLE_ROW";class S extends s{constructor(t){super(),this.isFlushable=!0,this.type="DELETE_TABLE_ROW",this.rowsToBeRemoved=t}}const y="INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION";class N extends s{constructor(t,e=[]){super(),this.isFlushable=!0,this.type="INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION",this.selectedRows=[],this.insertDirection=t,this.selectedRows=e}}const M="INSERT_TABLE_ROW_INTO_SAME_SECTION";var D;!function(t){t.ABOVE="ABOVE",t.BELOW="BELOW"}(D||(D={}));class v extends s{constructor(t,e=[]){super(),this.isFlushable=!0,this.type="INSERT_TABLE_ROW_INTO_SAME_SECTION",this.selectedRows=[],this.insertDirection=t,this.selectedRows=e}}const I="TOGGLE_HEADER_ROW";class x extends s{constructor(t){super(),this.isFlushable=!0,this.type="TOGGLE_HEADER_ROW",this.selectedRows=t}}class RTETableBodyBlock extends e{constructor(t){super(t),this.type="table-body",this.children=[]}static from(t,e){const s=new RTETableBodyBlock(t.id);return super.convertAnnotationsToMap(s.annotationMap,Object.assign({},t.annotations)),s.children=super.generateBlockChildren(t.children,e,s),s}clone(t){const e=new RTETableBodyBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<tbody${super.generateAttributeString(t)}>${e}</tbody>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}class RTETableHeadBlock extends e{constructor(t){super(t),this.type="table-head",this.children=[]}static from(t,e){const s=new RTETableHeadBlock(t.id);return super.convertAnnotationsToMap(s.annotationMap,Object.assign({},t.annotations)),s.children=super.generateBlockChildren(t.children,e,s),s}clone(t){const e=new RTETableHeadBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<thead${super.generateAttributeString(t)}>${e}</thead>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}class RTETableRowBlock extends e{constructor(t){super(t),this.type="table-row",this.children=[]}static from(t,e){const s=new RTETableRowBlock(t.id);return super.convertAnnotationsToMap(s.annotationMap,Object.assign({},t.annotations)),s.children=super.generateBlockChildren(t.children,e,s),s}clone(t){const e=new RTETableRowBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<tr${super.generateAttributeString(t)}>${e}</tr>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}class H extends t{constructor({backgroundColor:t,padding:e,border:s,width:n,height:r,textAlign:o,verticalAlign:i,minWidth:a,boxSizing:l}={},c=!0){super(),this.type=m.CELL,this.useInternalStyle=c,this.backgroundColor=t,this.width=n,this.height=r,this.border=c&&void 0===s?H.DEFAULT_BORDER:s,this.padding=c&&void 0===e?H.DEFAULT_PADDING:e,this.textAlign=c&&void 0===o?H.DEFAULT_HORIZONTAL_TEXT_ALIGN:o,this.verticalAlign=c&&void 0===i?H.DEFAULT_VERTICAL_TEXT_ALIGN:i,this.minWidth=c&&void 0===a?H.DEFAULT_CELL_MIN_WIDTH:a,this.boxSizing=c&&void 0===l?H.DEFAULT_BOX_SIZING:l}static from(t,e){return[m.CELL,new H(t,e)]}static getDefaultStyles(t=!0){return{padding:H.DEFAULT_PADDING,textAlign:H.DEFAULT_HORIZONTAL_TEXT_ALIGN,verticalAlign:H.DEFAULT_VERTICAL_TEXT_ALIGN,minWidth:H.DEFAULT_CELL_MIN_WIDTH,boxSizing:H.DEFAULT_BOX_SIZING,border:`${H.DEFAULT_BORDER.style} ${H.DEFAULT_BORDER.width} ${t?H.DEFAULT_BORDER.color:H.DEFAULT_BORDER_RGB_COLOR}`}}get borderStr(){return this.border?`${this.border.style||""} ${this.border.width||""} ${this.borderColorAnnotation.renderStyle().color}`.trim():null}set backgroundColor(t){this._backgroundColor=t,this.backgroundColorAnnotation=new O(t)}get backgroundColor(){return this._backgroundColor}set border(t){this._border=t,this.borderColorAnnotation=new O(null==t?void 0:t.color)}get border(){return this._border}clone(){return new H({backgroundColor:this.backgroundColor,padding:this.padding,border:this.border,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing},this.useInternalStyle)}toJSON(){return{tableCell:a({backgroundColor:this.backgroundColor,padding:this.padding,border:this.border,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing})}}renderStyle(t){const e=this.backgroundColorAnnotation.renderStyle().color,s={padding:this.padding,border:this.borderStr,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing};return e&&(s.backgroundColor=e),a((null==t?void 0:t.standalone)?s:this.removeDefaultValues(s),{cleanEmptyString:!0})}renderClass(){return null}removeDefaultValues(t){const e=Object.assign({},t);return e.padding===H.DEFAULT_PADDING&&delete e.padding,e.border===`${H.DEFAULT_BORDER.style} ${H.DEFAULT_BORDER.width} ${H.DEFAULT_BORDER.color}`&&delete e.border,e.textAlign===H.DEFAULT_HORIZONTAL_TEXT_ALIGN&&delete e.textAlign,e.verticalAlign===H.DEFAULT_VERTICAL_TEXT_ALIGN&&delete e.verticalAlign,e.minWidth===H.DEFAULT_CELL_MIN_WIDTH&&delete e.minWidth,e.boxSizing===H.DEFAULT_BOX_SIZING&&delete e.boxSizing,e}}H.DEFAULT_PADDING="12px",H.DEFAULT_BORDER={style:"solid",width:"1px",color:"#ddd"},H.DEFAULT_BORDER_RGB_COLOR="rgb(221, 221, 221)",H.DEFAULT_HORIZONTAL_TEXT_ALIGN="left",H.DEFAULT_VERTICAL_TEXT_ALIGN="middle",H.DEFAULT_CELL_MIN_WIDTH="55px",H.DEFAULT_BOX_SIZING="border-box";class RTETableCellBlock extends e{constructor(t,e){super(t),this.type="table-cell",this.children=[];const{autoMatchFormat:s}=e||{autoMatchFormat:!0};s&&this.annotationMap.set(m.CELL,new H)}static from(t,e){var s;const n=new RTETableCellBlock(t.id,e);return super.convertAnnotationsToMap(n.annotationMap,Object.assign({},t.annotations)),(null===(s=t.annotations)||void 0===s?void 0:s.tableCell)&&n.annotationMap.set(...H.from(t.annotations.tableCell,null==e?void 0:e.autoMatchFormat)),n.children=super.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTETableCellBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}get rowSpan(){const t=this.getCustomAttributeByName("rowspan");return isNaN(Number(t))?1:Math.max(Number(t),1)}get colSpan(){const t=this.getCustomAttributeByName("colspan");return isNaN(Number(t))?1:Math.max(Number(t),1)}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<td${super.generateAttributeString(t)}>${e}</td>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}getCustomAttributeByName(t){const e=this.getCustomAttributesAnnotation();if(e)return(e.toJSON().customAttribute||{})[t]}}class j extends H{constructor(t={},e=!0){super(t,e)}static from(t,e){return[m.CELL,new j(t,e)]}static getDefaultBackgroundColor(){return l.isDarkMode()?R.dark:R.light}clone(){return new j({backgroundColor:this.backgroundColor,padding:this.padding,border:this.border,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing},this.useInternalStyle)}renderStyle(t){var e;const s=super.renderStyle(t);return a(Object.assign(Object.assign({},s),{backgroundColor:null!==(e=s.backgroundColor)&&void 0!==e?e:j.getDefaultBackgroundColor()}))}}class RTETableHeadCellBlock extends RTETableCellBlock{constructor(t,e){super(t,e),this.type="table-head-cell";const{autoMatchFormat:s}=e||{autoMatchFormat:!0};s&&this.annotationMap.set(m.CELL,new j)}static from(t,e){var s;const n=new RTETableHeadCellBlock(t.id,e);return super.convertAnnotationsToMap(n.annotationMap,Object.assign({},t.annotations)),(null===(s=t.annotations)||void 0===s?void 0:s.tableCell)&&n.annotationMap.set(...j.from(t.annotations.tableCell,null==e?void 0:e.autoMatchFormat)),n.children=super.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTETableHeadCellBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<th${super.generateAttributeString(t)}>${e}</th>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}const F="MERGE_CELLS";class $ extends s{constructor(t,e,s,n,r){super(),this.type="MERGE_CELLS",this.isFlushable=!0,this.targetCell=t,this.mergeCells=e,this.colSpan=s,this.rowSpan=n,this.direction=r}}var P,W;!function(t){t.MERGE_CELLS="MERGE_CELLS",t.MERGE_CELL_UP="MERGE_CELL_UP",t.MERGE_CELL_RIGHT="MERGE_CELL_RIGHT",t.MERGE_CELL_DOWN="MERGE_CELL_DOWN",t.MERGE_CELL_LEFT="MERGE_CELL_LEFT"}(P||(P={}));class G extends B{canHandle(t){return t[0]===k.MERGE_CELLS}execute(t,e){const s=e.tableSelection.getSelectedCells(),n=t[1];switch(n){case P.MERGE_CELL_UP:case P.MERGE_CELL_RIGHT:case P.MERGE_CELL_DOWN:case P.MERGE_CELL_LEFT:{const t=this.getDirectionMergeCells(n,s[0]);this.handleMergeCells(t,n)}break;default:s.length>1&&this.handleMergeCells(s,P.MERGE_CELLS)}}getDirectionMergeCells(t,e){const s=Q(e,t);if(!s)return[e];switch(t){case P.MERGE_CELL_UP:return[s,e];case P.MERGE_CELL_DOWN:return[e,s];case P.MERGE_CELL_LEFT:return[s,e];default:return[e,s]}}handleMergeCells(t,e){if(t.length<2)return;const s=tt(t),{minRow:n,maxRow:r,minCol:o,maxCol:i,targetCell:a}=s,l=new $(a,t,i-o+1,r-n+1,e);this.applyActionOnTable(l,a)}applyActionOnTable(t,e){const s=U(e,RTETableBlock);s&&s.apply(t)}}function U(t,e){return t?t instanceof e?t:U(t.parent,e):null}function V(t,e){return{id:E(),type:"table-body",children:Array.from({length:t},(()=>function(t){return{id:E(),type:"table-row",children:Array.from({length:t},(()=>Y("table-cell")))}}(e)))}}function J(t){return t.children.filter((t=>t instanceof RTETableBodyBlock||t instanceof RTETableHeadBlock)).flatMap((t=>t.children))}function K(t){if(!t||!t.children||!t.children[0])return null;const e=t.children[0];return e instanceof o?e:K(e)}function z(t,e){for(const s of t){const t=s.children.find((t=>t.id===e));if(t)return t}return null}function Y(t){const e=E();return{id:e,type:t,children:[{id:`${e}-p`,type:"paragraph",nodes:[{id:`${e}-p-t`,type:"text",text:""}]}]}}function X(t){return{colSpan:t.colSpan,rowSpan:t.rowSpan}}function Z(t,e,s){const n=null!=s?s:q(e);for(let e=0;e<n.length;e++){const s=n[e];for(let e=0;e<s.length;e++)if(s[e]===t.id)return e}return-1}function q(t){const e=[];return t.forEach(((t,s)=>{e[s]||(e[s]=[]);let n=0;t.children.forEach((t=>{const{colSpan:r,rowSpan:o}=X(t);for(;void 0!==e[s][n];)n++;for(let i=0;i<o;i++)for(let o=0;o<r;o++)e[s+i]||(e[s+i]=[]),e[s+i][n+o]=t.id;n+=r}))})),e}function Q(t,e){if(!t)return null;const s=t.parent,n=s.parent.children,r=n.indexOf(s),{colSpan:o,rowSpan:i}=X(t),a=Z(t,n);let l=r,c=a;switch(e){case P.MERGE_CELL_LEFT:c=a-1;break;case P.MERGE_CELL_RIGHT:c=a+o;break;case P.MERGE_CELL_UP:l=r-1;break;default:l=r+i}return function(t,e,s){const n=q(t);for(let r=0;r<t.length;r++){const o=t[r];for(const i of o.children){const{colSpan:o,rowSpan:a}=X(i),l=Z(i,t,n),c=r+a-1,h=l+o-1,u=s>=l&&s<=h;if(e>=r&&e<=c&&u)return i}}return null}(n,l,c)}function tt(t){const e=t[0].parent.parent.children,s=q(e);let n=Number.POSITIVE_INFINITY,r=-1,o=Number.POSITIVE_INFINITY,i=-1;const a=new Set;return t.forEach((t=>{const l=e.indexOf(t.parent),c=Z(t,e,s),{colSpan:h,rowSpan:u}=X(t),d=l,E=l+u-1,T=c,p=c+h-1;for(let t=d;t<=E;t++)for(let e=T;e<=p;e++)a.add(`${t},${e}`);n=Math.min(n,d),r=Math.max(r,E),o=Math.min(o,T),i=Math.max(i,p)})),{minRow:n,maxRow:r,minCol:o,maxCol:i,targetCell:t[0],coveredPositions:a}}function et(t){let e=0;const s=J(t)[0];for(const t of s.children){const{colSpan:s}=X(t);e+=s}return e}function st(t){if(1===t.length)return!0;const e=tt(t),{minRow:s,maxRow:n,minCol:r,maxCol:o,coveredPositions:i}=e;return i.size===(n-s+1)*(o-r+1)}function nt(t,e,s,o,i){const a=t.annotationMap.get(n.CUSTOM_ATTRIBUTE),l=a?Object.assign({},a.customAttribute):{};delete l.colspan,delete l.rowspan,e>1&&(l.colspan=String(e));const c=et(o)+(i?1:0);if(s>1&&e!==c&&(l.rowspan=String(s)),Object.keys(l).length>0){const e=new r(l);t.annotationMap.set(n.CUSTOM_ATTRIBUTE,e)}else t.annotationMap.delete(n.CUSTOM_ATTRIBUTE)}function rt(t){const e=Y(t);return"table-head-cell"===t?RTETableHeadCellBlock.from(e):RTETableCellBlock.from(e)}function ot(t,e,s){for(let n=0;n<s;n++){const s=t[n],r=e.children.find((t=>t.id===s));if(r&&!(r instanceof RTETableHeadCellBlock))return n}return-1}function it(t){const e=new Map;return t.forEach((t=>{for(let s=0;s<t.length;s++){const n=t[s];n&&!e.has(n)&&e.set(n,s)}})),e}function at(t,e,s,n){if(0===t.length)return[0,-1];const r=s||J(e),o=null!=n?n:q(r);let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return t.forEach((t=>{const e=Z(t,r,o);i=Math.min(i,e),a=Math.max(a,e)})),[i,a]}!function(t){t.HEADER_ROW="HEADER_ROW",t.ADD_ROW_ABOVE="ADD_ROW_ABOVE",t.ADD_ROW_BELOW="ADD_ROW_BELOW",t.DELETE_ROW="DELETE_ROW",t.SELECT_ROW="SELECT_ROW"}(W||(W={}));class lt extends B{canHandle(t){return t[0]===k.ROW}execute(t,e){const s=t[1];switch(s){case W.ADD_ROW_ABOVE:case W.ADD_ROW_BELOW:this.handleInsertRow(s,e);break;case W.DELETE_ROW:this.handleDeleteRow(e);break;case W.HEADER_ROW:this.handleToggleHeader(e);break;case W.SELECT_ROW:this.handleSelectRow(e)}}handleInsertRow(t,e){const s=this.getAllSelectedRows(e);if(s.length>0){const e=t===W.ADD_ROW_ABOVE?D.ABOVE:D.BELOW,n=e===D.ABOVE?s[0]:s[s.length-1],r=n.parent instanceof RTETableBodyBlock,o=this.shouldInsertHeaderRow(n,e)||r?new v(e,s):new N(e,s);this.applyActionToTable(s[0],o)}}shouldInsertHeaderRow(t,e){if(e===D.ABOVE)return t.parent instanceof RTETableHeadBlock;{const e=t.parent;return e instanceof RTETableHeadBlock&&e.children[e.children.length-1]!==t}}handleDeleteRow(t){const e=this.getAllSelectedRows(t);if(e.length){const t=new S(e);this.applyActionToTable(e[0],t)}}handleToggleHeader(t){const e=this.getAllSelectedRows(t);if(e.length>0){const t=new x(e);this.applyActionToTable(e[0],t)}}handleSelectRow(t){const e=this.getAllSelectedRows(t);if(e.length>0&&t&&t.tableSelection){const s=e.flatMap((t=>t.children));t.tableSelection.setSelectedCells(s)}}getAllSelectedRows(t){const e=new Set;if(t&&t.tableSelection){const{tableSelection:s}=t;s.getSelectedCells().forEach((t=>{const s=U(t,RTETableRowBlock);s&&e.add(s)}))}return Array.from(e)}applyActionToTable(t,e){const s=U(t,RTETableBlock);s&&s.apply(e)}}const ct="REPLACE_TABLE_CELL";class ht extends s{constructor(t){super(),this.isFlushable=!0,this.type="REPLACE_TABLE_CELL",this.payload=t}}const ut="SPLIT_TABLE_CELL";class dt extends s{constructor(t){super(),this.isFlushable=!0,this.type="SPLIT_TABLE_CELL",this.payload=t}}class Et extends i{getBoundaryCellColumnRange(t,e,s){let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.forEach((t=>{const o=Z(t,e,s);n=Math.min(n,o),r=Math.max(r,o)})),[n,r]}}class Tt extends Et{static isFullHeaderSelection(t){if(0===t.length)return!1;const e=U(t[0],RTETableBlock);if(e){const s=J(e),n=q(s),r=new Map;s.forEach((t=>{t.children.forEach((t=>r.set(t.id,t)))}));const[o,i]=at(t,e,s,n);for(const t of n)for(let e=o;e<=i;e++){const s=r.get(t[e]);if(s&&!(s instanceof RTETableHeadCellBlock))return!1}return!0}return!1}handleAction(t,e){const s=t.headerOn,n=J(e),r=q(n),[o,i]=this.getBoundaryCellColumnRange(t.tableCellHeaderRange,n,r);(s||!s&&o>0)&&this.toggleHeadRows(e,n,r,s,i,o),this.toggleBodyRows(e,n,r,s,o,i);const a=this.getRootContent(e);if(a&&t.tableCellHeaderRange[0].parent){const e=t.tableCellHeaderRange[0].parent.getFirstNode();e&&a.apply(new T(e,0))}}toggleHeadRows(t,e,s,n,r,o){var i;const a=((null===(i=t.children.find((t=>t instanceof RTETableHeadBlock)))||void 0===i?void 0:i.children)||[]).length;for(let i=0;i<a;i++)this.toggleCellType(t,e[i],s[i],0,n?r:o-1,(()=>!0),(t=>RTETableHeadCellBlock.from(t.toJSON())))}toggleBodyRows(t,e,s,n,r,o){var i;const a=s[0].length,l=(null===(i=t.children.find((t=>t instanceof RTETableBodyBlock)))||void 0===i?void 0:i.children)||[],c=e.length-l.length;for(let i=0;i<l.length;i++){const l=i+c,h=e[l],u=s[l],d=ot(u,h,a);n?d>-1&&this.toggleCellType(t,h,u,d,o,(t=>!(t instanceof RTETableHeadCellBlock)),(t=>RTETableHeadCellBlock.from(t.toJSON()))):this.toggleCellType(t,h,u,r,-1===d?a-1:d-1,(t=>t instanceof RTETableHeadCellBlock),(t=>RTETableCellBlock.from(t.toJSON())))}}toggleCellType(t,e,s,n,r,o,i){for(let a=n;a<=r;a++){const n=s[a],l=e.children.find((t=>t.id===n));if(l&&o(l)){const o=s.indexOf(n),c={table:t,cell:l,col:a,cellStartCol:o,endCol:r,targetCellType:i(l).type},h=o+l.colSpan-1;if(h>r||o<a){if(e.apply(new dt(c)),h>r)return;a=h;continue}e.apply(new ht(c))}l&&(a+=l.colSpan-1)}}}const pt="DELETE_TABLE_COLUMN";class bt extends s{constructor(t){super(),this.isFlushable=!0,this.type="DELETE_TABLE_COLUMN",this.tableCellDeleteRange=t}}const ft="INSERT_TABLE_COLUMN";var Ct;!function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(Ct||(Ct={}));class Lt extends s{constructor(t,e){super(),this.isFlushable=!0,this.type="INSERT_TABLE_COLUMN",this.tableCellInsertRange=e,this.insertDirection=t}}const gt="SELECT_TABLE_COLUMN";class Rt extends s{constructor(t,e){super(),this.type="SELECT_TABLE_COLUMN",this.tableCellSelectRange=t,this.selectCellCallback=e}}const _t="TOGGLE_HEADER_TABLE_COLUMN";class Ot extends s{constructor(t,e){super(),this.isFlushable=!0,this.type="TOGGLE_HEADER_TABLE_COLUMN",this.headerOn=!1,this.tableCellHeaderRange=t,this.headerOn=e}}var mt;!function(t){t.HEADER_COLUMN="HEADER_COLUMN",t.ADD_COLUMN_LEFT="ADD_COLUMN_LEFT",t.ADD_COLUMN_RIGHT="ADD_COLUMN_RIGHT",t.DELETE_COLUMN="DELETE_COLUMN",t.SELECT_COLUMN="SELECT_COLUMN"}(mt||(mt={}));class kt extends B{canHandle(t){return t[0]===k.COLUMN}execute(t,e){const s=e.tableSelection.getSelectedCells();if(!s||0===s.length)return;const n=t[1];switch(n){case mt.ADD_COLUMN_LEFT:case mt.ADD_COLUMN_RIGHT:this.handleInsertColumn(n,s);break;case mt.DELETE_COLUMN:this.handleDeleteColumn(s);break;case mt.SELECT_COLUMN:this.handleSelectColumn(s,e);break;case mt.HEADER_COLUMN:this.handleToggleHeaderColumn(s)}}handleInsertColumn(t,e){const s=new Lt(t===mt.ADD_COLUMN_LEFT?Ct.LEFT:Ct.RIGHT,e);this.applyActionOnTable(s,e[0])}handleDeleteColumn(t){const e=new bt(t);this.applyActionOnTable(e,t[0])}handleSelectColumn(t,e){const s=new Rt(t,(t=>{e.tableSelection.setSelectedCells(t)}));this.applyActionOnTable(s,t[0])}handleToggleHeaderColumn(t){const e=!Tt.isFullHeaderSelection(t),s=new Ot(t,e);this.applyActionOnTable(s,t[0])}applyActionOnTable(t,e){const s=U(e,RTETableBlock);s&&s.apply(t)}}const At="SPLIT_CELL_HORIZONTALLY";class Bt extends s{constructor(){super(),this.isFlushable=!0,this.type="SPLIT_CELL_HORIZONTALLY"}}const wt="SPLIT_CELL_VERTICALLY";class St extends s{constructor(){super(),this.isFlushable=!0,this.type="SPLIT_CELL_VERTICALLY"}}var yt;!function(t){t.SPLIT_CELL_HORIZONTALLY="SPLIT_CELL_HORIZONTALLY",t.SPLIT_CELL_VERTICALLY="SPLIT_CELL_VERTICALLY"}(yt||(yt={}));class Nt extends B{canHandle(t){return t[0]===k.SPLIT_CELL}execute(t,e){const s=e.tableSelection.getSelectedCells();if(s&&1===s.length){const e=s[0];switch(t[1]){case yt.SPLIT_CELL_HORIZONTALLY:this.handleSplitCellHorizontally(e);break;case yt.SPLIT_CELL_VERTICALLY:this.handleSplitCellVertically(e)}}}handleSplitCellHorizontally(t){const e=new Bt;t.apply(e)}handleSplitCellVertically(t){const e=new St;t.apply(e)}}export{at as $,RTETableRowBlock as A,Z as B,kt as C,D,g as E,y as F,M as G,w as H,Ct as I,I as J,ft as K,pt as L,G as M,_t as N,Tt as O,ut as P,ct as Q,m as R,B as S,k as T,At as U,C as V,wt as W,gt as X,F as Y,L as Z,mt as _,R as a,W as a0,yt as a1,st as a2,Q as a3,A as b,H as c,RTETableHeadCellBlock as d,lt as e,Nt as f,_ as g,RTETableBlock as h,V as i,RTETableCellBlock as j,RTETableHeadBlock as k,RTETableBodyBlock as l,U as m,j as n,Et as o,J as p,q,z as r,nt as s,Y as t,it as u,et as v,K as w,X as x,rt as y,P as z}
|
|
1
|
+
import{B as t,d as e,M as s,C as n,o as r,i as o,g as i}from"./p-84eb3b9c.js";import{c as a}from"./p-a841cf13.js";import{V as l}from"./p-8aee6b74.js";import"./p-6e1ab235.js";import{I as c,c as h}from"./p-593e0f80.js";import{r as u}from"./p-6e70d3cc.js";import{i as d}from"./p-e4c4ea35.js";import{g as E}from"./p-8b5d3a52.js";import{U as T,V as p}from"./p-f5f5a0d9.js";const b=[{payloadKey:"IS_OVERRIDECOLORS_METHOD_CALLED",payloadDescription:"Indicate if the method overrideColors of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"overrideColors"===e,payloadValue:()=>!0},{payloadKey:"IS_RESET_METHOD_CALLED",payloadDescription:"Indicate if the method reset of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"reset"===e,payloadValue:()=>!0},{payloadKey:"IS_TOGGLEDARKMODE_METHOD_CALLED",payloadDescription:"Indicate if the method toggleDarkMode of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"toggleDarkMode"===e,payloadValue:()=>!0},{payloadKey:"IS_ISDARKMODE_METHOD_CALLED",payloadDescription:"Indicate if the method isDarkMode of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"isDarkMode"===e,payloadValue:()=>!0},{payloadKey:"IS_APPLY_BRANDING_METHOD_CALLED",payloadDescription:"Indicate if the method applyBranding of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"applyBranding"===e,payloadValue:()=>!0}];class f{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=h(f,["overrideColors","reset","toggleDarkMode","isDarkMode","applyBranding"],b)}async overrideColors(t){l.overrideColors(t)}async reset(){l.reset()}toggleDarkMode(t){l.toggleDarkMode(t)}isDarkMode(){return l.isDarkMode()}applyBranding(t){l.applyBranding(t)}}!function(t,e,s,n){var r,o=arguments.length,i=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,s,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(i=(o<3?r(i):o>3?r(e,s,i):r(e,s))||i);o>3&&i&&Object.defineProperty(e,s,i)}([c()],f.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const C=new f,L=["none","solid","dashed","dotted","double","groove","ridge","inset","outset"],g=[{key:"white",dark:"#04041C",light:"#FCFCFC"},{key:"red",dark:"#AA091C",light:"#FF4C61"},{key:"orange",dark:"#974502",light:"#FDAB68"},{key:"yellow",dark:"#735C00",light:"#FFDC4C"},{key:"green",dark:"#2E6D18",light:"#7BDA58"},{key:"teal",dark:"#287171",light:"#7BD1D1"},{key:"gray",dark:"#595959",light:"#999999"},{key:"black",dark:"#FCFCFC",light:"#04041C"}],R={key:"default-head-bg",dark:"#181830",light:"#F0F3F7"};class _{static getTableColors(){return _.TABLE_COLORS}static setTableColors(t){_.TABLE_COLORS=t}static getColorKey(t,e=!1){var s;let n=null;const r=_.TABLE_COLORS,o=e?[...r,R]:r;if(o){const e=null===(s=u(t))||void 0===s?void 0:s.toUpperCase();if(e)n=o.find((t=>C.isDarkMode()?t.dark===e:t.light===e));else for(const e of o)if(e.key===t){n=e;break}}return n?n.key:""}}_.TABLE_COLORS=g;class O extends t{constructor(t){super(),this.type=m.COLOR,this.colorKey=t,t&&(this.color=this.formatColor(t))}renderStyle(){return{color:this.color?l.isDarkMode()?this.color.dark:this.color.light:this.colorKey||""}}renderClass(){return null}toJSON(){var t;return{color:(null===(t=this.color)||void 0===t?void 0:t.key)||this.colorKey||""}}clone(){return new O(this.colorKey)}formatColor(t){return _.getTableColors().find((e=>e.key===t))}}var m,k;!function(t){t.TABLE="EXTENSION_TABLE",t.CELL="EXTENSION_TABLE_CELL",t.CAPTION="EXTENSION_TABLE_CAPTION",t.COLOR="EXTENSION_TABLE_COLOR"}(m||(m={}));class A extends t{constructor({backgroundColor:t,border:e,width:s,height:n,alignment:r,borderCollapse:o}={},i=!0){super(),this.type=m.TABLE,this.useInternalStyle=i,this.backgroundColor=t,this.border=e,this.width=s,this.height=n,this.alignment=i&&void 0===r?A.DEFAULT_ALIGNMENT:r,this.backgroundColorAnnotation=new O(t),this.borderColorAnnotation=new O(null==e?void 0:e.color),this.borderCollapse=i&&void 0===o?A.DEFAULT_BORDER_COLLAPSE:o}static from(t,e=!0){return[m.TABLE,new A(t,e)]}static getDefaultStyles(){return{borderCollapse:A.DEFAULT_BORDER_COLLAPSE,margin:A.DEFAULT_ALIGNMENT_STYLE_VALUE}}get borderStr(){return this.border?`${this.border.style} ${this.border.width} ${this.borderColorAnnotation.renderStyle().color}`.trim():null}clone(){return new A({backgroundColor:this.backgroundColor,border:this.border,width:this.width,height:this.height,alignment:this.alignment,borderCollapse:this.borderCollapse},this.useInternalStyle)}toJSON(){return{table:a({backgroundColor:this.backgroundColor,border:this.border,width:this.width,height:this.height,alignment:this.alignment,borderCollapse:this.borderCollapse})}}renderStyle(){const t=this.backgroundColorAnnotation.renderStyle().color,e=Object.assign({border:this.borderStr,width:this.width,height:this.height,borderCollapse:this.borderCollapse},this.renderAlignmentStyle());return t&&(e.backgroundColor=t),a(e)}renderClass(){return"v-rte--extension-table"}renderAlignmentStyle(){return this.alignment?{margin:"center"===this.alignment?A.DEFAULT_ALIGNMENT_STYLE_VALUE:"left"===this.alignment?"0":"0 0 0 auto"}:{}}}A.DEFAULT_BORDER_COLLAPSE="collapse",A.DEFAULT_ALIGNMENT="center",A.DEFAULT_ALIGNMENT_STYLE_VALUE="0 auto";class RTETableBlock extends e{constructor(t,e){super(t),this.type="table-block",this.children=[];const{autoMatchFormat:s}=e||{autoMatchFormat:!0};s&&this.annotationMap.set(m.TABLE,new A)}static from(t,e){var s;const n=new RTETableBlock(t.id,e);return super.convertAnnotationsToMap(n.annotationMap,Object.assign({},t.annotations)),n.children=super.generateBlockChildren(t.children,e,n),(null===(s=t.annotations)||void 0===s?void 0:s.table)&&n.annotationMap.set(...A.from(t.annotations.table,null==e?void 0:e.autoMatchFormat)),n}clone(t){const e=new RTETableBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}getFirstNode(){return this.hasCaption()?this.children[0].children[0].getLastNode():this.children[0].children[0].children[0].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<table${super.generateAttributeString(t)}>${e}</table>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}getCaption(){const t=this.children.find((t=>"table-caption"===t.type));return null!=t?t:null}setCaption(t){const e=this.children.findIndex((t=>"table-caption"===t.type));t?(t.parent=this,e>=0?this.children[e]=t:this.children.unshift(t)):e>=0&&this.children.splice(e,1)}hasCaption(){return d(this.getCaption())}}!function(t){t.ROW="ROW",t.CAPTION="CAPTION",t.COLUMN="COLUMN",t.MERGE_CELLS="MERGE_CELLS",t.TABLE="TABLE",t.CELL="CELL",t.SPLIT_CELL="SPLIT_CELL"}(k||(k={}));class B{syncCursorPosition(t,e){const s=this.findRootContent(t);if(e&&s){const t=e.getRangeEndOffset();s.apply(new T(e,t))}}findRootContent(t){let e=t.parent;for(;e;){if(e instanceof p)return e;e=e.parent}}}const w="DELETE_TABLE_ROW";class S extends s{constructor(t){super(),this.isFlushable=!0,this.type="DELETE_TABLE_ROW",this.rowsToBeRemoved=t}}const y="INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION";class N extends s{constructor(t,e=[]){super(),this.isFlushable=!0,this.type="INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION",this.selectedRows=[],this.insertDirection=t,this.selectedRows=e}}const M="INSERT_TABLE_ROW_INTO_SAME_SECTION";var D;!function(t){t.ABOVE="ABOVE",t.BELOW="BELOW"}(D||(D={}));class v extends s{constructor(t,e=[]){super(),this.isFlushable=!0,this.type="INSERT_TABLE_ROW_INTO_SAME_SECTION",this.selectedRows=[],this.insertDirection=t,this.selectedRows=e}}const I="TOGGLE_HEADER_ROW";class x extends s{constructor(t){super(),this.isFlushable=!0,this.type="TOGGLE_HEADER_ROW",this.selectedRows=t}}class RTETableBodyBlock extends e{constructor(t){super(t),this.type="table-body",this.children=[]}static from(t,e){const s=new RTETableBodyBlock(t.id);return super.convertAnnotationsToMap(s.annotationMap,Object.assign({},t.annotations)),s.children=super.generateBlockChildren(t.children,e,s),s}clone(t){const e=new RTETableBodyBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<tbody${super.generateAttributeString(t)}>${e}</tbody>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}class RTETableHeadBlock extends e{constructor(t){super(t),this.type="table-head",this.children=[]}static from(t,e){const s=new RTETableHeadBlock(t.id);return super.convertAnnotationsToMap(s.annotationMap,Object.assign({},t.annotations)),s.children=super.generateBlockChildren(t.children,e,s),s}clone(t){const e=new RTETableHeadBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<thead${super.generateAttributeString(t)}>${e}</thead>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}class RTETableRowBlock extends e{constructor(t){super(t),this.type="table-row",this.children=[]}static from(t,e){const s=new RTETableRowBlock(t.id);return super.convertAnnotationsToMap(s.annotationMap,Object.assign({},t.annotations)),s.children=super.generateBlockChildren(t.children,e,s),s}clone(t){const e=new RTETableRowBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<tr${super.generateAttributeString(t)}>${e}</tr>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}class H extends t{constructor({backgroundColor:t,padding:e,border:s,width:n,height:r,textAlign:o,verticalAlign:i,minWidth:a,boxSizing:l}={},c=!0){super(),this.type=m.CELL,this.useInternalStyle=c,this.backgroundColor=t,this.width=n,this.height=r,this.border=c&&void 0===s?H.DEFAULT_BORDER:s,this.padding=c&&void 0===e?H.DEFAULT_PADDING:e,this.textAlign=c&&void 0===o?H.DEFAULT_HORIZONTAL_TEXT_ALIGN:o,this.verticalAlign=c&&void 0===i?H.DEFAULT_VERTICAL_TEXT_ALIGN:i,this.minWidth=c&&void 0===a?H.DEFAULT_CELL_MIN_WIDTH:a,this.boxSizing=c&&void 0===l?H.DEFAULT_BOX_SIZING:l}static from(t,e){return[m.CELL,new H(t,e)]}static getDefaultStyles(t=!0){return{padding:H.DEFAULT_PADDING,textAlign:H.DEFAULT_HORIZONTAL_TEXT_ALIGN,verticalAlign:H.DEFAULT_VERTICAL_TEXT_ALIGN,minWidth:H.DEFAULT_CELL_MIN_WIDTH,boxSizing:H.DEFAULT_BOX_SIZING,border:`${H.DEFAULT_BORDER.style} ${H.DEFAULT_BORDER.width} ${t?H.DEFAULT_BORDER.color:H.DEFAULT_BORDER_RGB_COLOR}`}}get borderStr(){return this.border?`${this.border.style||""} ${this.border.width||""} ${this.borderColorAnnotation.renderStyle().color}`.trim():null}set backgroundColor(t){this._backgroundColor=t,this.backgroundColorAnnotation=new O(t)}get backgroundColor(){return this._backgroundColor}set border(t){this._border=t,this.borderColorAnnotation=new O(null==t?void 0:t.color)}get border(){return this._border}clone(){return new H({backgroundColor:this.backgroundColor,padding:this.padding,border:this.border,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing},this.useInternalStyle)}toJSON(){return{tableCell:a({backgroundColor:this.backgroundColor,padding:this.padding,border:this.border,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing})}}renderStyle(t){const e=this.backgroundColorAnnotation.renderStyle().color,s={padding:this.padding,border:this.borderStr,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing};return e&&(s.backgroundColor=e),a((null==t?void 0:t.standalone)?s:this.removeDefaultValues(s),{cleanEmptyString:!0})}renderClass(){return null}removeDefaultValues(t){const e=Object.assign({},t);return e.padding===H.DEFAULT_PADDING&&delete e.padding,e.border===`${H.DEFAULT_BORDER.style} ${H.DEFAULT_BORDER.width} ${H.DEFAULT_BORDER.color}`&&delete e.border,e.textAlign===H.DEFAULT_HORIZONTAL_TEXT_ALIGN&&delete e.textAlign,e.verticalAlign===H.DEFAULT_VERTICAL_TEXT_ALIGN&&delete e.verticalAlign,e.minWidth===H.DEFAULT_CELL_MIN_WIDTH&&delete e.minWidth,e.boxSizing===H.DEFAULT_BOX_SIZING&&delete e.boxSizing,e}}H.DEFAULT_PADDING="12px",H.DEFAULT_BORDER={style:"solid",width:"1px",color:"#ddd"},H.DEFAULT_BORDER_RGB_COLOR="rgb(221, 221, 221)",H.DEFAULT_HORIZONTAL_TEXT_ALIGN="left",H.DEFAULT_VERTICAL_TEXT_ALIGN="middle",H.DEFAULT_CELL_MIN_WIDTH="55px",H.DEFAULT_BOX_SIZING="border-box";class RTETableCellBlock extends e{constructor(t,e){super(t),this.type="table-cell",this.children=[];const{autoMatchFormat:s}=e||{autoMatchFormat:!0};s&&this.annotationMap.set(m.CELL,new H)}static from(t,e){var s;const n=new RTETableCellBlock(t.id,e);return super.convertAnnotationsToMap(n.annotationMap,Object.assign({},t.annotations)),(null===(s=t.annotations)||void 0===s?void 0:s.tableCell)&&n.annotationMap.set(...H.from(t.annotations.tableCell,null==e?void 0:e.autoMatchFormat)),n.children=super.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTETableCellBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}get rowSpan(){const t=this.getCustomAttributeByName("rowspan");return isNaN(Number(t))?1:Math.max(Number(t),1)}get colSpan(){const t=this.getCustomAttributeByName("colspan");return isNaN(Number(t))?1:Math.max(Number(t),1)}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<td${super.generateAttributeString(t)}>${e}</td>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}getCustomAttributeByName(t){const e=this.getCustomAttributesAnnotation();if(e)return(e.toJSON().customAttribute||{})[t]}}class j extends H{constructor(t={},e=!0){super(t,e)}static from(t,e){return[m.CELL,new j(t,e)]}static getDefaultBackgroundColor(){return l.isDarkMode()?R.dark:R.light}clone(){return new j({backgroundColor:this.backgroundColor,padding:this.padding,border:this.border,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing},this.useInternalStyle)}renderStyle(t){var e;const s=super.renderStyle(t);return a(Object.assign(Object.assign({},s),{backgroundColor:null!==(e=s.backgroundColor)&&void 0!==e?e:j.getDefaultBackgroundColor()}))}}class RTETableHeadCellBlock extends RTETableCellBlock{constructor(t,e){super(t,e),this.type="table-head-cell";const{autoMatchFormat:s}=e||{autoMatchFormat:!0};s&&this.annotationMap.set(m.CELL,new j)}static from(t,e){var s;const n=new RTETableHeadCellBlock(t.id,e);return super.convertAnnotationsToMap(n.annotationMap,Object.assign({},t.annotations)),(null===(s=t.annotations)||void 0===s?void 0:s.tableCell)&&n.annotationMap.set(...j.from(t.annotations.tableCell,null==e?void 0:e.autoMatchFormat)),n.children=super.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTETableHeadCellBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<th${super.generateAttributeString(t)}>${e}</th>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}const F="MERGE_CELLS";class $ extends s{constructor(t,e,s,n,r){super(),this.type="MERGE_CELLS",this.isFlushable=!0,this.targetCell=t,this.mergeCells=e,this.colSpan=s,this.rowSpan=n,this.direction=r}}var P,W;!function(t){t.MERGE_CELLS="MERGE_CELLS",t.MERGE_CELL_UP="MERGE_CELL_UP",t.MERGE_CELL_RIGHT="MERGE_CELL_RIGHT",t.MERGE_CELL_DOWN="MERGE_CELL_DOWN",t.MERGE_CELL_LEFT="MERGE_CELL_LEFT"}(P||(P={}));class G extends B{canHandle(t){return t[0]===k.MERGE_CELLS}execute(t,e){const s=e.tableSelection.getSelectedCells(),n=t[1];switch(n){case P.MERGE_CELL_UP:case P.MERGE_CELL_RIGHT:case P.MERGE_CELL_DOWN:case P.MERGE_CELL_LEFT:{const t=this.getDirectionMergeCells(n,s[0]);this.handleMergeCells(t,n)}break;default:s.length>1&&this.handleMergeCells(s,P.MERGE_CELLS)}}getDirectionMergeCells(t,e){const s=Q(e,t);if(!s)return[e];switch(t){case P.MERGE_CELL_UP:return[s,e];case P.MERGE_CELL_DOWN:return[e,s];case P.MERGE_CELL_LEFT:return[s,e];default:return[e,s]}}handleMergeCells(t,e){if(t.length<2)return;const s=tt(t),{minRow:n,maxRow:r,minCol:o,maxCol:i,targetCell:a}=s,l=new $(a,t,i-o+1,r-n+1,e);this.applyActionOnTable(l,a)}applyActionOnTable(t,e){const s=U(e,RTETableBlock);s&&s.apply(t)}}function U(t,e){return t?t instanceof e?t:U(t.parent,e):null}function V(t,e){return{id:E(),type:"table-body",children:Array.from({length:t},(()=>function(t){return{id:E(),type:"table-row",children:Array.from({length:t},(()=>Y("table-cell")))}}(e)))}}function J(t){return t.children.filter((t=>t instanceof RTETableBodyBlock||t instanceof RTETableHeadBlock)).flatMap((t=>t.children))}function K(t){if(!t||!t.children||!t.children[0])return null;const e=t.children[0];return e instanceof o?e:K(e)}function z(t,e){for(const s of t){const t=s.children.find((t=>t.id===e));if(t)return t}return null}function Y(t){const e=E();return{id:e,type:t,children:[{id:`${e}-p`,type:"paragraph",nodes:[{id:`${e}-p-t`,type:"text",text:""}]}]}}function X(t){return{colSpan:t.colSpan,rowSpan:t.rowSpan}}function Z(t,e,s){const n=null!=s?s:q(e);for(let e=0;e<n.length;e++){const s=n[e];for(let e=0;e<s.length;e++)if(s[e]===t.id)return e}return-1}function q(t){const e=[];return t.forEach(((t,s)=>{e[s]||(e[s]=[]);let n=0;t.children.forEach((t=>{const{colSpan:r,rowSpan:o}=X(t);for(;void 0!==e[s][n];)n++;for(let i=0;i<o;i++)for(let o=0;o<r;o++)e[s+i]||(e[s+i]=[]),e[s+i][n+o]=t.id;n+=r}))})),e}function Q(t,e){if(!t)return null;const s=t.parent,n=s.parent.children,r=n.indexOf(s),{colSpan:o,rowSpan:i}=X(t),a=Z(t,n);let l=r,c=a;switch(e){case P.MERGE_CELL_LEFT:c=a-1;break;case P.MERGE_CELL_RIGHT:c=a+o;break;case P.MERGE_CELL_UP:l=r-1;break;default:l=r+i}return function(t,e,s){const n=q(t);for(let r=0;r<t.length;r++){const o=t[r];for(const i of o.children){const{colSpan:o,rowSpan:a}=X(i),l=Z(i,t,n),c=r+a-1,h=l+o-1,u=s>=l&&s<=h;if(e>=r&&e<=c&&u)return i}}return null}(n,l,c)}function tt(t){const e=t[0].parent.parent.children,s=q(e);let n=Number.POSITIVE_INFINITY,r=-1,o=Number.POSITIVE_INFINITY,i=-1;const a=new Set;return t.forEach((t=>{const l=e.indexOf(t.parent),c=Z(t,e,s),{colSpan:h,rowSpan:u}=X(t),d=l,E=l+u-1,T=c,p=c+h-1;for(let t=d;t<=E;t++)for(let e=T;e<=p;e++)a.add(`${t},${e}`);n=Math.min(n,d),r=Math.max(r,E),o=Math.min(o,T),i=Math.max(i,p)})),{minRow:n,maxRow:r,minCol:o,maxCol:i,targetCell:t[0],coveredPositions:a}}function et(t){let e=0;const s=J(t)[0];for(const t of s.children){const{colSpan:s}=X(t);e+=s}return e}function st(t){if(1===t.length)return!0;const e=tt(t),{minRow:s,maxRow:n,minCol:r,maxCol:o,coveredPositions:i}=e;return i.size===(n-s+1)*(o-r+1)}function nt(t,e,s,o,i){const a=t.annotationMap.get(n.CUSTOM_ATTRIBUTE),l=a?Object.assign({},a.customAttribute):{};delete l.colspan,delete l.rowspan,e>1&&(l.colspan=String(e));const c=et(o)+(i?1:0);if(s>1&&e!==c&&(l.rowspan=String(s)),Object.keys(l).length>0){const e=new r(l);t.annotationMap.set(n.CUSTOM_ATTRIBUTE,e)}else t.annotationMap.delete(n.CUSTOM_ATTRIBUTE)}function rt(t){const e=Y(t);return"table-head-cell"===t?RTETableHeadCellBlock.from(e):RTETableCellBlock.from(e)}function ot(t,e,s){for(let n=0;n<s;n++){const s=t[n],r=e.children.find((t=>t.id===s));if(r&&!(r instanceof RTETableHeadCellBlock))return n}return-1}function it(t){const e=new Map;return t.forEach((t=>{for(let s=0;s<t.length;s++){const n=t[s];n&&!e.has(n)&&e.set(n,s)}})),e}function at(t,e,s,n){if(0===t.length)return[0,-1];const r=s||J(e),o=null!=n?n:q(r);let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return t.forEach((t=>{const e=Z(t,r,o);i=Math.min(i,e),a=Math.max(a,e)})),[i,a]}!function(t){t.HEADER_ROW="HEADER_ROW",t.ADD_ROW_ABOVE="ADD_ROW_ABOVE",t.ADD_ROW_BELOW="ADD_ROW_BELOW",t.DELETE_ROW="DELETE_ROW",t.SELECT_ROW="SELECT_ROW"}(W||(W={}));class lt extends B{canHandle(t){return t[0]===k.ROW}execute(t,e){const s=t[1];switch(s){case W.ADD_ROW_ABOVE:case W.ADD_ROW_BELOW:this.handleInsertRow(s,e);break;case W.DELETE_ROW:this.handleDeleteRow(e);break;case W.HEADER_ROW:this.handleToggleHeader(e);break;case W.SELECT_ROW:this.handleSelectRow(e)}}handleInsertRow(t,e){const s=this.getAllSelectedRows(e);if(s.length>0){const e=t===W.ADD_ROW_ABOVE?D.ABOVE:D.BELOW,n=e===D.ABOVE?s[0]:s[s.length-1],r=n.parent instanceof RTETableBodyBlock,o=this.shouldInsertHeaderRow(n,e)||r?new v(e,s):new N(e,s);this.applyActionToTable(s[0],o)}}shouldInsertHeaderRow(t,e){if(e===D.ABOVE)return t.parent instanceof RTETableHeadBlock;{const e=t.parent;return e instanceof RTETableHeadBlock&&e.children[e.children.length-1]!==t}}handleDeleteRow(t){const e=this.getAllSelectedRows(t);if(e.length){const t=new S(e);this.applyActionToTable(e[0],t)}}handleToggleHeader(t){const e=this.getAllSelectedRows(t);if(e.length>0){const t=new x(e);this.applyActionToTable(e[0],t)}}handleSelectRow(t){const e=this.getAllSelectedRows(t);if(e.length>0&&t&&t.tableSelection){const s=e.flatMap((t=>t.children));t.tableSelection.setSelectedCells(s)}}getAllSelectedRows(t){const e=new Set;if(t&&t.tableSelection){const{tableSelection:s}=t;s.getSelectedCells().forEach((t=>{const s=U(t,RTETableRowBlock);s&&e.add(s)}))}return Array.from(e)}applyActionToTable(t,e){const s=U(t,RTETableBlock);s&&s.apply(e)}}const ct="REPLACE_TABLE_CELL";class ht extends s{constructor(t){super(),this.isFlushable=!0,this.type="REPLACE_TABLE_CELL",this.payload=t}}const ut="SPLIT_TABLE_CELL";class dt extends s{constructor(t){super(),this.isFlushable=!0,this.type="SPLIT_TABLE_CELL",this.payload=t}}class Et extends i{getBoundaryCellColumnRange(t,e,s){let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.forEach((t=>{const o=Z(t,e,s);n=Math.min(n,o),r=Math.max(r,o)})),[n,r]}}class Tt extends Et{static isFullHeaderSelection(t){if(0===t.length)return!1;const e=U(t[0],RTETableBlock);if(e){const s=J(e),n=q(s),r=new Map;s.forEach((t=>{t.children.forEach((t=>r.set(t.id,t)))}));const[o,i]=at(t,e,s,n);for(const t of n)for(let e=o;e<=i;e++){const s=r.get(t[e]);if(s&&!(s instanceof RTETableHeadCellBlock))return!1}return!0}return!1}handleAction(t,e){const s=t.headerOn,n=J(e),r=q(n),[o,i]=this.getBoundaryCellColumnRange(t.tableCellHeaderRange,n,r);(s||!s&&o>0)&&this.toggleHeadRows(e,n,r,s,i,o),this.toggleBodyRows(e,n,r,s,o,i);const a=this.getRootContent(e);if(a&&t.tableCellHeaderRange[0].parent){const e=t.tableCellHeaderRange[0].parent.getFirstNode();e&&a.apply(new T(e,0))}}toggleHeadRows(t,e,s,n,r,o){var i;const a=((null===(i=t.children.find((t=>t instanceof RTETableHeadBlock)))||void 0===i?void 0:i.children)||[]).length;for(let i=0;i<a;i++)this.toggleCellType(t,e[i],s[i],0,n?r:o-1,(()=>!0),(t=>RTETableHeadCellBlock.from(t.toJSON())))}toggleBodyRows(t,e,s,n,r,o){var i;const a=s[0].length,l=(null===(i=t.children.find((t=>t instanceof RTETableBodyBlock)))||void 0===i?void 0:i.children)||[],c=e.length-l.length;for(let i=0;i<l.length;i++){const l=i+c,h=e[l],u=s[l],d=ot(u,h,a);n?d>-1&&this.toggleCellType(t,h,u,d,o,(t=>!(t instanceof RTETableHeadCellBlock)),(t=>RTETableHeadCellBlock.from(t.toJSON()))):this.toggleCellType(t,h,u,r,-1===d?a-1:d-1,(t=>t instanceof RTETableHeadCellBlock),(t=>RTETableCellBlock.from(t.toJSON())))}}toggleCellType(t,e,s,n,r,o,i){for(let a=n;a<=r;a++){const n=s[a],l=e.children.find((t=>t.id===n));if(l&&o(l)){const o=s.indexOf(n),c={table:t,cell:l,col:a,cellStartCol:o,endCol:r,targetCellType:i(l).type},h=o+l.colSpan-1;if(h>r||o<a){if(e.apply(new dt(c)),h>r)return;a=h;continue}e.apply(new ht(c))}l&&(a+=l.colSpan-1)}}}const pt="DELETE_TABLE_COLUMN";class bt extends s{constructor(t){super(),this.isFlushable=!0,this.type="DELETE_TABLE_COLUMN",this.tableCellDeleteRange=t}}const ft="INSERT_TABLE_COLUMN";var Ct;!function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(Ct||(Ct={}));class Lt extends s{constructor(t,e){super(),this.isFlushable=!0,this.type="INSERT_TABLE_COLUMN",this.tableCellInsertRange=e,this.insertDirection=t}}const gt="SELECT_TABLE_COLUMN";class Rt extends s{constructor(t,e){super(),this.type="SELECT_TABLE_COLUMN",this.tableCellSelectRange=t,this.selectCellCallback=e}}const _t="TOGGLE_HEADER_TABLE_COLUMN";class Ot extends s{constructor(t,e){super(),this.isFlushable=!0,this.type="TOGGLE_HEADER_TABLE_COLUMN",this.headerOn=!1,this.tableCellHeaderRange=t,this.headerOn=e}}var mt;!function(t){t.HEADER_COLUMN="HEADER_COLUMN",t.ADD_COLUMN_LEFT="ADD_COLUMN_LEFT",t.ADD_COLUMN_RIGHT="ADD_COLUMN_RIGHT",t.DELETE_COLUMN="DELETE_COLUMN",t.SELECT_COLUMN="SELECT_COLUMN"}(mt||(mt={}));class kt extends B{canHandle(t){return t[0]===k.COLUMN}execute(t,e){const s=e.tableSelection.getSelectedCells();if(!s||0===s.length)return;const n=t[1];switch(n){case mt.ADD_COLUMN_LEFT:case mt.ADD_COLUMN_RIGHT:this.handleInsertColumn(n,s);break;case mt.DELETE_COLUMN:this.handleDeleteColumn(s);break;case mt.SELECT_COLUMN:this.handleSelectColumn(s,e);break;case mt.HEADER_COLUMN:this.handleToggleHeaderColumn(s)}}handleInsertColumn(t,e){const s=new Lt(t===mt.ADD_COLUMN_LEFT?Ct.LEFT:Ct.RIGHT,e);this.applyActionOnTable(s,e[0])}handleDeleteColumn(t){const e=new bt(t);this.applyActionOnTable(e,t[0])}handleSelectColumn(t,e){const s=new Rt(t,(t=>{e.tableSelection.setSelectedCells(t)}));this.applyActionOnTable(s,t[0])}handleToggleHeaderColumn(t){const e=!Tt.isFullHeaderSelection(t),s=new Ot(t,e);this.applyActionOnTable(s,t[0])}applyActionOnTable(t,e){const s=U(e,RTETableBlock);s&&s.apply(t)}}const At="SPLIT_CELL_HORIZONTALLY";class Bt extends s{constructor(){super(),this.isFlushable=!0,this.type="SPLIT_CELL_HORIZONTALLY"}}const wt="SPLIT_CELL_VERTICALLY";class St extends s{constructor(){super(),this.isFlushable=!0,this.type="SPLIT_CELL_VERTICALLY"}}var yt;!function(t){t.SPLIT_CELL_HORIZONTALLY="SPLIT_CELL_HORIZONTALLY",t.SPLIT_CELL_VERTICALLY="SPLIT_CELL_VERTICALLY"}(yt||(yt={}));class Nt extends B{canHandle(t){return t[0]===k.SPLIT_CELL}execute(t,e){const s=e.tableSelection.getSelectedCells();if(s&&1===s.length){const e=s[0];switch(t[1]){case yt.SPLIT_CELL_HORIZONTALLY:this.handleSplitCellHorizontally(e);break;case yt.SPLIT_CELL_VERTICALLY:this.handleSplitCellVertically(e)}}}handleSplitCellHorizontally(t){const e=new Bt;t.apply(e)}handleSplitCellVertically(t){const e=new St;t.apply(e)}}export{at as $,RTETableRowBlock as A,Z as B,kt as C,D,g as E,y as F,M as G,w as H,Ct as I,I as J,ft as K,pt as L,G as M,_t as N,Tt as O,ut as P,ct as Q,m as R,B as S,k as T,At as U,C as V,wt as W,gt as X,F as Y,L as Z,mt as _,R as a,W as a0,yt as a1,st as a2,Q as a3,A as b,H as c,RTETableHeadCellBlock as d,lt as e,Nt as f,_ as g,RTETableBlock as h,V as i,RTETableCellBlock as j,RTETableHeadBlock as k,RTETableBodyBlock as l,U as m,j as n,Et as o,J as p,q,z as r,nt as s,Y as t,it as u,et as v,K as w,X as x,rt as y,P as z}
|
package/dist/vega/p-5f377954.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.
|
|
1
|
+
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.86.0",this.framework=t.VanillaJs}getVegaEnv(){return{version:this.vegaVersion,framework:this.framework}}setVegaFramework(t){this.framework=t}};export{t as F,s as v}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t}from"./p-6b2342e0.js";import{V as e}from"./p-e1fbfd20.js";import{c as o,V as s}from"./p-6e1ab235.js";import{A as r,_ as i,c as n,ag as c,F as l,m as a}from"./p-
|
|
1
|
+
import{h as t}from"./p-6b2342e0.js";import{V as e}from"./p-e1fbfd20.js";import{c as o,V as s}from"./p-6e1ab235.js";import{A as r,_ as i,c as n,ag as c,F as l,m as a}from"./p-84eb3b9c.js";import{D as h}from"./p-f28a6074.js";import{a as u,c as d,b as p,i as f}from"./p-9af0e2e7.js";import{a as v}from"./p-8aee6b74.js";import{g as m}from"./p-f5f5a0d9.js";var b=function(t,e,o,s){var r,i=arguments.length,n=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,s);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n};class C extends s{constructor({icon:e,tooltip:o,autoFocusOnClick:s=!0}){super(),this.renderBtn=({showArrowIcon:e,iconColor:o}={})=>{var s;return t("vega-tooltip",{text:this.translationSlimmer.t(this.tooltip.text),placement:["bottom","top"]},t("vega-rich-text-editor-toolbar-button",Object.assign({showArrowIcon:e,icon:this.icon,iconColor:o,ref:t=>{h.addUniqueObserverToNode(t,u,(()=>{this.handleClick()}))},selected:this.isSelected(),disabled:this.isDisabled(),hidden:this.isHidden()},this.preventLostFocus()),null===(s=this.renderSlotContent)||void 0===s?void 0:s.call(this)))},this.handleClick=()=>{"function"==typeof this.onClick&&(!this.selectionController.getSelectedNodes().length&&this.autoFocusOnClick?this.focusController.focusOnLastTextNode().then((()=>{this.onClick()})):this.onClick())},this.icon=e,this.tooltip=o,this.autoFocusOnClick=s}setIcon(t){this.icon=t}isHidden(){return!1}render(){return"function"==typeof this.renderBtnWrapper?this.renderBtnWrapper(this.renderBtn):this.renderBtn()}isDisabled(){return this.disabled}preventLostFocus(){return{onMouseDown:t=>t.preventDefault()}}}b([o()],C.prototype,"translationSlimmer",void 0),b([o()],C.prototype,"selectionController",void 0),b([o()],C.prototype,"focusController",void 0),b([o()],C.prototype,"disabled",void 0);class w extends C{constructor(t){super(t)}isHidden(){return this.sourceView}isDisabled(){return super.isDisabled()&&!this.sourceView}shouldDisabledToolbar(t,e){return t&&!r.canHandle(e,t)}}!function(t,e,o,s){var r,i=arguments.length,n=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,s);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);i>3&&n&&Object.defineProperty(e,o,n)}([o()],w.prototype,"sourceView",void 0);var j=function(t,e,o,s){var r,i=arguments.length,n=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,s);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(n=(i<3?r(n):i>3?r(e,o,n):r(e,o))||n);return i>3&&n&&Object.defineProperty(e,o,n),n};class g extends w{constructor(){super({icon:"text",tooltip:{text:"Text Color"}}),this.popoverShow=!1,v.registerCustomDarkModeColor(g.formatDarkModeColor())}static formatDarkModeColor(){return i.reduce(((t,e)=>(e.dark&&(t[`rich-text-editor-${e.key}`]=e.dark),t)),{})}renderSlotContent(){return t("div",{class:{"toolbar-btn-color-preview-box":!0,disabled:this.isDisabled()},style:{backgroundColor:this.getCurrentColor()}})}handlePopoverShowChange(){this.popoverShow=!0}handlePopoverHideChange(){this.popoverShow=!1}renderBtnWrapper(e){return t("vega-popover",{placement:"bottom",alignment:"center",ref:t=>{this.popoverRef=t,h.addUniqueObserverToNode(t,d,this.handlePopoverShowChange.bind(this)),h.addUniqueObserverToNode(t,p,this.handlePopoverHideChange.bind(this))}},t("div",{slot:"popover-content"},e({showArrowIcon:!1})),t("div",Object.assign({slot:"popover",style:{userSelect:"none"}},super.preventLostFocus()),this.renderPopoverContent()))}renderPopoverContent(){return t("vega-color-picker",{isInline:!0,colors:i.map((t=>t[this.isInDarkMode?"dark":"light"])),ref:t=>{h.addUniqueObserverToNode(t,f,this.handleChange.bind(this))},value:this.getCurrentColor()})}async handleChange(t){this.popoverShow&&(this.selectionController.getSelectedNodes().length||await this.focusController.focusOnLastTextNode(),this.selectionController.getSelectedNodes().filter((t=>t instanceof n)).forEach((e=>e.apply(new c(this.matchColor(t.detail).key))))),this.popoverRef.hide()}matchColor(t){return i.find((e=>e[this.isInDarkMode?"dark":"light"]===t))}getCurrentColor(){let t=i[0];const e=this.selectionController.getSelectedNodes();return e.length>1&&(t=this.isSelectedSameColor(e)?this.getTextColor(e[0]):null),1===e.length&&(t=this.getTextColor(e[0])),t?t[this.isInDarkMode?"dark":"light"]:null}isSelected(){return!1}isSelectedSameColor(t){return t.every((e=>this.getTextColor(e).key===this.getTextColor(t[0]).key))}getTextColor(t){var e;return(null===(e=t.getAnnotationByType("TEXT_COLOR"))||void 0===e?void 0:e.textColor)||i[0]}isDisabled(){const t=this.selectionController.getSelectedNodes();return super.isDisabled()||t.some((t=>{var e;return(null===(e=t.getAnnotationByType(l.CODE))||void 0===e?void 0:e.code)||t.getAnnotationByType(l.LINK)||this.shouldDisabledToolbar(t,c.name)}))}}e.register({text:{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="M64 96v32c0 17.7-14.3 32-32 32s-32-14.3-32-32V80C0 53.5 21.5 32 48 32H224 400c26.5 0 48 21.5 48 48v48c0 17.7-14.3 32-32 32s-32-14.3-32-32V96H256l0 320h48c17.7 0 32 14.3 32 32s-14.3 32-32 32H144c-17.7 0-32-14.3-32-32s14.3-32 32-32h48l0-320H64z"/></svg>'}}),j([o()],g.prototype,"host",void 0),j([o()],g.prototype,"isInDarkMode",void 0),j([o()],g.prototype,"selectionController",void 0),j([o()],g.prototype,"focusController",void 0);class x extends a{constructor(t,e){super(),this.isFlushable=!0,this.size=t,this.alt=e}toAnnotation(){return new m(this.size,this.alt)}}export{x as I,g as T,w as V,C as a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{C as CheckBoxRequiredRule}from"./p-590fd123.js";export{D as DateRequiredRule}from"./p-c95dbf11.js";export{I as InputPhoneNumberRequiredRule}from"./p-07c2725a.js";export{I as InputRangeRequiredRule}from"./p-f396c69a.js";export{R as RequiredFieldRule}from"./p-280cbcdb.js";export{R as RichTextEditorRequiredRule}from"./p-
|
|
1
|
+
export{C as CheckBoxRequiredRule}from"./p-590fd123.js";export{D as DateRequiredRule}from"./p-c95dbf11.js";export{I as InputPhoneNumberRequiredRule}from"./p-07c2725a.js";export{I as InputRangeRequiredRule}from"./p-f396c69a.js";export{R as RequiredFieldRule}from"./p-280cbcdb.js";export{R as RichTextEditorRequiredRule}from"./p-93afdfc3.js";export{T as TimeRangeRequiredRule,a as TimeRequiredRule}from"./p-e1d2c60d.js";export{T as ToggleSwitchRequiredRule}from"./p-7c0b4c36.js";export{F as FileUploaderRequiredRule}from"./p-0bb860cc.js";import"./p-abd7aeaa.js";import"./p-e4c4ea35.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-3b791b5d.js";import"./p-6e1ab235.js";import"./p-2d0d575f.js";import"./p-a528714c.js";import"./p-f5f5a0d9.js";import"./p-84eb3b9c.js";import"./p-f28a6074.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-6c43d54a.js";import"./p-02841589.js";import"./p-8b5d3a52.js";import"./p-8aee6b74.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";import"./p-a841cf13.js";
|