ados-rcm 1.1.921 → 1.1.922

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/AModule/AComponents/ATheme/ATheme.d.ts +1 -1
  2. package/dist/AModule/AComponents/ATheme/DesignTokens.d.ts +8 -0
  3. package/dist/AModule/AComponents/ATheme/RefinedDesignTokens.d.ts +8 -0
  4. package/dist/{Copy-BBgr3W2s.cjs → Copy-B7lxS-NO.cjs} +1 -1
  5. package/dist/{Copy-Bfe0ncDG.js → Copy-Cy4gMug9.js} +1 -1
  6. package/dist/{Divider-CkNfZKWI.cjs → Divider-CPGbK70-.cjs} +1 -1
  7. package/dist/{Divider-C5bTbqkN.js → Divider-CcTJRBWG.js} +1 -1
  8. package/dist/{ImageResizer-DrkEK3Tu.cjs → ImageResizer-3B89PMMJ.cjs} +1 -1
  9. package/dist/{ImageResizer-OrZcS-CR.js → ImageResizer-CB5Lg77H.js} +1 -1
  10. package/dist/{TableClipboard-DITsfpQv.js → TableClipboard-CSB3HP2I.js} +3 -3
  11. package/dist/{TableClipboard-dlElXPRx.cjs → TableClipboard-CzjzxdxW.cjs} +1 -1
  12. package/dist/{TableUp-CC9dBHOA.cjs → TableUp-D_0GlUMo.cjs} +1 -1
  13. package/dist/{TableUp-BrsZtd-X.js → TableUp-WQKKfjth.js} +1 -1
  14. package/dist/{Video-VbPJGhK0.cjs → Video-BKCZ-qD8.cjs} +1 -1
  15. package/dist/{Video-B0afDsx-.js → Video-BLwGJfeQ.js} +1 -1
  16. package/dist/{index-BYCgXjDO.cjs → index-BMxbHpPm.cjs} +2 -2
  17. package/dist/{index-rdk4wV0l.js → index-CNlXRCGl.js} +14 -6
  18. package/dist/{index-Ch1ojEzX.cjs → index-Cd9cxJ80.cjs} +1 -1
  19. package/dist/{index-Cm7ZiBkR.cjs → index-Di0br3jn.cjs} +1 -1
  20. package/dist/{index-Dvi7lgdt.js → index-DjWuJZt0.js} +1 -1
  21. package/dist/{index-DUoUF-hg.js → index-Q773q-tW.js} +1 -1
  22. package/dist/index.cjs.js +1 -1
  23. package/dist/index.es.js +1 -1
  24. package/package.json +1 -1
@@ -42,7 +42,7 @@ declare function editPalette(palette: Partial<TPalette>, mode?: TPaletteModes |
42
42
  export type TSemantic = typeof refinedDesignTokens.semantic.light;
43
43
  export declare const semanticModes: ("dark" | "light")[];
44
44
  export type TSemanticModes = (typeof semanticModes)[number];
45
- export declare const semanticKeys: ("static-white" | "static-black" | "acent-brand" | "acent-brand-fill" | "label-normal" | "label-strong" | "label-neutral" | "line-normal" | "line-strong" | "line-neutral" | "background-normal" | "elevation-0" | "elevation-10" | "elevation-20" | "alert-warning" | "alert-success" | "alert-danger" | "inverse-label-normal" | "inverse-label-strong" | "inverse-label-neutral" | "inverse-line-normal" | "inverse-line-strong" | "inverse-line-neutral" | "inverse-elevation-0" | "inverse-elevation-10" | "inverse-elevation-20")[];
45
+ export declare const semanticKeys: ("static-white" | "static-black" | "acent-brand" | "acent-brand-fill" | "label-normal" | "label-strong" | "label-neutral" | "line-normal" | "line-strong" | "line-neutral" | "background-normal" | "elevation-0" | "elevation-10" | "elevation-20" | "alert-warning" | "alert-success" | "alert-danger" | "inverse-label-normal" | "inverse-label-strong" | "inverse-label-neutral" | "inverse-line-normal" | "inverse-line-strong" | "inverse-line-neutral" | "inverse-elevation-0" | "inverse-elevation-10" | "inverse-elevation-20" | "icon-on" | "icon-off" | "badge-default" | "badge-default-text")[];
46
46
  export type TSemanticKeys = (typeof semanticKeys)[number];
47
47
  /**
48
48
  * getCurrentSemanticMode : () => TSemanticModes
@@ -157,6 +157,10 @@ export declare const designTokens: {
157
157
  'inverse-elevation-0': string;
158
158
  'inverse-elevation-10': string;
159
159
  'inverse-elevation-20': string;
160
+ 'icon-on': string;
161
+ 'icon-off': string;
162
+ 'badge-default': string;
163
+ 'badge-default-text': string;
160
164
  };
161
165
  dark: {
162
166
  'static-white': string;
@@ -185,6 +189,10 @@ export declare const designTokens: {
185
189
  'inverse-elevation-0': string;
186
190
  'inverse-elevation-10': string;
187
191
  'inverse-elevation-20': string;
192
+ 'icon-on': string;
193
+ 'icon-off': string;
194
+ 'badge-default': string;
195
+ 'badge-default-text': string;
188
196
  };
189
197
  };
190
198
  };
@@ -157,6 +157,10 @@ declare const refinedDesignTokens: {
157
157
  'inverse-elevation-0': string;
158
158
  'inverse-elevation-10': string;
159
159
  'inverse-elevation-20': string;
160
+ 'icon-on': string;
161
+ 'icon-off': string;
162
+ 'badge-default': string;
163
+ 'badge-default-text': string;
160
164
  };
161
165
  dark: {
162
166
  'static-white': string;
@@ -185,6 +189,10 @@ declare const refinedDesignTokens: {
185
189
  'inverse-elevation-0': string;
186
190
  'inverse-elevation-10': string;
187
191
  'inverse-elevation-20': string;
192
+ 'icon-on': string;
193
+ 'icon-off': string;
194
+ 'badge-default': string;
195
+ 'badge-default-text': string;
188
196
  };
189
197
  };
190
198
  };
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var x=(i,t,r)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r;var d=(i,t,r)=>x(i,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-BYCgXjDO.cjs"),u={capture:!0},p=new Set(["P","DIV","LI","BLOCKQUOTE","PRE","TR","TD","TH","SECTION","ARTICLE","H1","H2","H3","H4","H5","H6"]),m=/<(?:br|p|div|li|blockquote|pre|tr|td|th|section|article|h[1-6])\b|[\r\n\t]/i,T=/[\r\n\t]+/g,h=/\s{2,}/g;function E(i){return typeof i.insert=="string"?i.insert.length:1}class b{constructor(t,r={}){d(this,"clipboard");d(this,"quill");d(this,"cleanupFunctions",[]);this.clipboard=t.getModule("clipboard"),this.quill=t,r.isTitleMode&&this.setupTitleModePaste()}setupTitleModePaste(){const t=this.quill.root,r=e=>{if(e.preventDefault(),!e.clipboardData)return;const l=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain"),a=this.quill.getSelection(!0);if(!a)return;if(l){const f=this.normalizeTitlePasteHtml(l),o=this.clipboard.convert({html:f});this.applyPasteDelta(a.index,a.length,o),this.scheduleSelection(a.index+this.getDeltaLength(o));return}const c=this.normalizeTitlePasteText(n);this.applyPasteText(a.index,a.length,c),this.scheduleSelection(a.index+c.length)};t.addEventListener("paste",r,u),this.cleanupFunctions.push(()=>{t.removeEventListener("paste",r,u)})}normalizeTitlePasteText(t){return t.replaceAll(T," ").replaceAll(h," ").trim()}normalizeTitlePasteHtml(t){var a,c;if(!m.test(t))return t;const r=document.createElement("div");r.innerHTML=t,this.flattenTitlePasteNode(r);const e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);let l=e.nextNode();for(;l;)l.textContent=((a=l.textContent)==null?void 0:a.replaceAll(h," "))??"",l=e.nextNode();const n=this.findLastTextNode(r);return n&&(n.textContent=((c=n.textContent)==null?void 0:c.replaceAll(/\s+$/g,""))??""),r.innerHTML}flattenTitlePasteNode(t){var e;const r=Array.from(t.childNodes);for(const l of r){if(l.nodeType===Node.TEXT_NODE){l.textContent=((e=l.textContent)==null?void 0:e.replaceAll(T," "))??"";continue}if(l instanceof HTMLElement){if(l.tagName==="BR"){l.replaceWith(document.createTextNode(" "));continue}this.flattenTitlePasteNode(l),p.has(l.tagName)&&l.nextSibling&&!this.endsWithWhitespace(l)&&l.appendChild(document.createTextNode(" "))}}}endsWithWhitespace(t){var r;return/\s$/.test(((r=this.findLastTextNode(t))==null?void 0:r.textContent)??"")}findLastTextNode(t){const r=Array.from(t.childNodes).reverse();for(const e of r){if(e.nodeType===Node.TEXT_NODE)return e;const l=this.findLastTextNode(e);if(l)return l}return null}getDeltaLength(t){var r;return((r=t.ops)==null?void 0:r.reduce((e,l)=>e+E(l),0))??0}applyPasteDelta(t,r,e){const l=new s.Delta().retain(t).delete(r).concat(e);this.quill.updateContents(l,s.Quill.sources.USER)}applyPasteText(t,r,e){const l=new s.Delta().retain(t).delete(r);e&&l.insert(e),this.quill.updateContents(l,s.Quill.sources.USER)}scheduleSelection(t){const r=()=>this.quill.setSelection(t,0,s.Quill.sources.SILENT);if(typeof queueMicrotask=="function"){queueMicrotask(r);return}setTimeout(r,0)}destroy(){this.cleanupFunctions.forEach(t=>t()),this.cleanupFunctions=[]}async copyContent(t){var r;try{const e=this.quill.getText(),l=this.quill.root.innerHTML;return this.copyToClipboard(e,l,t)}catch(e){return console.error("Error in copyContent:",e),(r=t==null?void 0:t.onError)==null||r.call(t),!1}}async copyToClipboard(t,r,e){var l,n;try{return await this.tryModernClipboardWithHtml(t,r,e)||await this.tryModernClipboardText(t,e)||r&&this.tryLegacyClipboardWithHtml(r,e)||this.tryLegacyClipboardText(t,e)?!0:((l=e==null?void 0:e.onError)==null||l.call(e),!1)}catch(a){return console.error("복사 중 오류 발생:",a),(n=e==null?void 0:e.onError)==null||n.call(e),!1}}async tryModernClipboardWithHtml(t,r,e){var l;if(!navigator.clipboard||!r||!globalThis.ClipboardItem||!globalThis.isSecureContext)return!1;try{return await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([r],{type:"text/html"}),"text/plain":new Blob([t],{type:"text/plain"})})]),(l=e==null?void 0:e.onSuccess)==null||l.call(e),!0}catch{return!1}}async tryModernClipboardText(t,r){var e;if(!navigator.clipboard||!globalThis.isSecureContext)return!1;try{return await navigator.clipboard.writeText(t),(e=r==null?void 0:r.onSuccess)==null||e.call(r),!0}catch{return!1}}tryLegacyClipboardWithHtml(t,r){const e=document.createElement("div");e.innerHTML=t,e.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(e);try{const l=document.createRange();l.selectNodeContents(e);const n=globalThis.getSelection();return n?(n.removeAllRanges(),n.addRange(l),this.tryClipboardEventCopy({html:t,text:e.textContent??""},r)):!1}finally{e.remove()}}tryLegacyClipboardText(t,r){const e=document.createElement("textarea");e.value=t,e.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(e);try{return e.focus(),e.select(),this.tryClipboardEventCopy({text:t},r)}finally{e.remove()}}tryClipboardEventCopy(t,r){var n;let e=!1;const l=a=>{a.preventDefault(),a.clipboardData&&(a.clipboardData.setData("text/plain",t.text),t.html&&a.clipboardData.setData("text/html",t.html),e=!0)};document.addEventListener("copy",l);try{const a=new ClipboardEvent("copy",{clipboardData:new DataTransfer});if(document.dispatchEvent(a),e)return(n=r==null?void 0:r.onSuccess)==null||n.call(r),!0}catch{return!1}finally{document.removeEventListener("copy",l)}return!1}}exports.default=b;
1
+ "use strict";var y=Object.defineProperty;var x=(i,t,r)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r;var d=(i,t,r)=>x(i,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-BMxbHpPm.cjs"),u={capture:!0},p=new Set(["P","DIV","LI","BLOCKQUOTE","PRE","TR","TD","TH","SECTION","ARTICLE","H1","H2","H3","H4","H5","H6"]),m=/<(?:br|p|div|li|blockquote|pre|tr|td|th|section|article|h[1-6])\b|[\r\n\t]/i,T=/[\r\n\t]+/g,h=/\s{2,}/g;function E(i){return typeof i.insert=="string"?i.insert.length:1}class b{constructor(t,r={}){d(this,"clipboard");d(this,"quill");d(this,"cleanupFunctions",[]);this.clipboard=t.getModule("clipboard"),this.quill=t,r.isTitleMode&&this.setupTitleModePaste()}setupTitleModePaste(){const t=this.quill.root,r=e=>{if(e.preventDefault(),!e.clipboardData)return;const l=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain"),a=this.quill.getSelection(!0);if(!a)return;if(l){const f=this.normalizeTitlePasteHtml(l),o=this.clipboard.convert({html:f});this.applyPasteDelta(a.index,a.length,o),this.scheduleSelection(a.index+this.getDeltaLength(o));return}const c=this.normalizeTitlePasteText(n);this.applyPasteText(a.index,a.length,c),this.scheduleSelection(a.index+c.length)};t.addEventListener("paste",r,u),this.cleanupFunctions.push(()=>{t.removeEventListener("paste",r,u)})}normalizeTitlePasteText(t){return t.replaceAll(T," ").replaceAll(h," ").trim()}normalizeTitlePasteHtml(t){var a,c;if(!m.test(t))return t;const r=document.createElement("div");r.innerHTML=t,this.flattenTitlePasteNode(r);const e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);let l=e.nextNode();for(;l;)l.textContent=((a=l.textContent)==null?void 0:a.replaceAll(h," "))??"",l=e.nextNode();const n=this.findLastTextNode(r);return n&&(n.textContent=((c=n.textContent)==null?void 0:c.replaceAll(/\s+$/g,""))??""),r.innerHTML}flattenTitlePasteNode(t){var e;const r=Array.from(t.childNodes);for(const l of r){if(l.nodeType===Node.TEXT_NODE){l.textContent=((e=l.textContent)==null?void 0:e.replaceAll(T," "))??"";continue}if(l instanceof HTMLElement){if(l.tagName==="BR"){l.replaceWith(document.createTextNode(" "));continue}this.flattenTitlePasteNode(l),p.has(l.tagName)&&l.nextSibling&&!this.endsWithWhitespace(l)&&l.appendChild(document.createTextNode(" "))}}}endsWithWhitespace(t){var r;return/\s$/.test(((r=this.findLastTextNode(t))==null?void 0:r.textContent)??"")}findLastTextNode(t){const r=Array.from(t.childNodes).reverse();for(const e of r){if(e.nodeType===Node.TEXT_NODE)return e;const l=this.findLastTextNode(e);if(l)return l}return null}getDeltaLength(t){var r;return((r=t.ops)==null?void 0:r.reduce((e,l)=>e+E(l),0))??0}applyPasteDelta(t,r,e){const l=new s.Delta().retain(t).delete(r).concat(e);this.quill.updateContents(l,s.Quill.sources.USER)}applyPasteText(t,r,e){const l=new s.Delta().retain(t).delete(r);e&&l.insert(e),this.quill.updateContents(l,s.Quill.sources.USER)}scheduleSelection(t){const r=()=>this.quill.setSelection(t,0,s.Quill.sources.SILENT);if(typeof queueMicrotask=="function"){queueMicrotask(r);return}setTimeout(r,0)}destroy(){this.cleanupFunctions.forEach(t=>t()),this.cleanupFunctions=[]}async copyContent(t){var r;try{const e=this.quill.getText(),l=this.quill.root.innerHTML;return this.copyToClipboard(e,l,t)}catch(e){return console.error("Error in copyContent:",e),(r=t==null?void 0:t.onError)==null||r.call(t),!1}}async copyToClipboard(t,r,e){var l,n;try{return await this.tryModernClipboardWithHtml(t,r,e)||await this.tryModernClipboardText(t,e)||r&&this.tryLegacyClipboardWithHtml(r,e)||this.tryLegacyClipboardText(t,e)?!0:((l=e==null?void 0:e.onError)==null||l.call(e),!1)}catch(a){return console.error("복사 중 오류 발생:",a),(n=e==null?void 0:e.onError)==null||n.call(e),!1}}async tryModernClipboardWithHtml(t,r,e){var l;if(!navigator.clipboard||!r||!globalThis.ClipboardItem||!globalThis.isSecureContext)return!1;try{return await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([r],{type:"text/html"}),"text/plain":new Blob([t],{type:"text/plain"})})]),(l=e==null?void 0:e.onSuccess)==null||l.call(e),!0}catch{return!1}}async tryModernClipboardText(t,r){var e;if(!navigator.clipboard||!globalThis.isSecureContext)return!1;try{return await navigator.clipboard.writeText(t),(e=r==null?void 0:r.onSuccess)==null||e.call(r),!0}catch{return!1}}tryLegacyClipboardWithHtml(t,r){const e=document.createElement("div");e.innerHTML=t,e.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(e);try{const l=document.createRange();l.selectNodeContents(e);const n=globalThis.getSelection();return n?(n.removeAllRanges(),n.addRange(l),this.tryClipboardEventCopy({html:t,text:e.textContent??""},r)):!1}finally{e.remove()}}tryLegacyClipboardText(t,r){const e=document.createElement("textarea");e.value=t,e.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(e);try{return e.focus(),e.select(),this.tryClipboardEventCopy({text:t},r)}finally{e.remove()}}tryClipboardEventCopy(t,r){var n;let e=!1;const l=a=>{a.preventDefault(),a.clipboardData&&(a.clipboardData.setData("text/plain",t.text),t.html&&a.clipboardData.setData("text/html",t.html),e=!0)};document.addEventListener("copy",l);try{const a=new ClipboardEvent("copy",{clipboardData:new DataTransfer});if(document.dispatchEvent(a),e)return(n=r==null?void 0:r.onSuccess)==null||n.call(r),!0}catch{return!1}finally{document.removeEventListener("copy",l)}return!1}}exports.default=b;
@@ -1,7 +1,7 @@
1
1
  var x = Object.defineProperty;
2
2
  var p = (i, t, r) => t in i ? x(i, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[t] = r;
3
3
  var s = (i, t, r) => p(i, typeof t != "symbol" ? t + "" : t, r);
4
- import { D as u, Q as o } from "./index-rdk4wV0l.js";
4
+ import { D as u, Q as o } from "./index-CNlXRCGl.js";
5
5
  const T = {
6
6
  capture: !0
7
7
  }, m = /* @__PURE__ */ new Set(["P", "DIV", "LI", "BLOCKQUOTE", "PRE", "TR", "TD", "TH", "SECTION", "ARTICLE", "H1", "H2", "H3", "H4", "H5", "H6"]), E = /<(?:br|p|div|li|blockquote|pre|tr|td|th|section|article|h[1-6])\b|[\r\n\t]/i, h = /[\r\n\t]+/g, f = /\s{2,}/g;
@@ -1 +1 @@
1
- "use strict";var n=Object.defineProperty;var c=(e,t,o)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var i=(e,t,o)=>c(e,typeof t!="symbol"?t+"":t,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-BYCgXjDO.cjs"),d=r.Quill.import("blots/block/embed"),a=r.Quill.import("ui/icons"),l="border: var(--AEditor_Addon_Primary_border); border-bottom: none; transition: border var(--Transition);";a.divider=r.ReactDOMServer.renderToString(r.jsxRuntimeExports.jsx(r.AIcon,{icon:"Minus",strokeWidth:2.5,width:"100%"}));class s extends d{static create(){const t=super.create(!0);return t.style.cssText=l,t}}i(s,"blotName","divider"),i(s,"tagName","hr");exports.default=s;
1
+ "use strict";var n=Object.defineProperty;var c=(e,t,o)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var i=(e,t,o)=>c(e,typeof t!="symbol"?t+"":t,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-BMxbHpPm.cjs"),d=r.Quill.import("blots/block/embed"),a=r.Quill.import("ui/icons"),l="border: var(--AEditor_Addon_Primary_border); border-bottom: none; transition: border var(--Transition);";a.divider=r.ReactDOMServer.renderToString(r.jsxRuntimeExports.jsx(r.AIcon,{icon:"Minus",strokeWidth:2.5,width:"100%"}));class s extends d{static create(){const t=super.create(!0);return t.style.cssText=l,t}}i(s,"blotName","divider"),i(s,"tagName","hr");exports.default=s;
@@ -1,7 +1,7 @@
1
1
  var n = Object.defineProperty;
2
2
  var a = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
3
  var o = (r, t, e) => a(r, typeof t != "symbol" ? t + "" : t, e);
4
- import { Q as i, R as c, j as d, A as m } from "./index-rdk4wV0l.js";
4
+ import { Q as i, R as c, j as d, A as m } from "./index-CNlXRCGl.js";
5
5
  const b = i.import("blots/block/embed"), l = i.import("ui/icons"), u = "border: var(--AEditor_Addon_Primary_border); border-bottom: none; transition: border var(--Transition);";
6
6
  l.divider = c.renderToString(/* @__PURE__ */ d.jsx(m, { icon: "Minus", strokeWidth: 2.5, width: "100%" }));
7
7
  class s extends b {
@@ -1 +1 @@
1
- "use strict";var D=Object.defineProperty;var w=(a,i,t)=>i in a?D(a,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[i]=t;var l=(a,i,t)=>w(a,typeof i!="symbol"?i+"":i,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-BYCgXjDO.cjs"),g={OVERLAY:"ql-image-resizer-overlay",HANDLE:"ql-image-resizer-handle",DISPLAY:"ql-image-resizer-display",TOOLBAR:"ql-image-resizer-toolbar",TOOLBAR_BUTTON:"ql-image-resizer-toolbar-button"},d={BACKSPACE:8,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40};function q(a){switch(a.key){case"Backspace":return d.BACKSPACE;case"Delete":return d.DELETE;case"ArrowLeft":return d.LEFT;case"ArrowUp":return d.UP;case"ArrowRight":return d.RIGHT;case"ArrowDown":return d.DOWN;default:return 0}}const M=["tl","tr","br","bl"],F=8,v=(a,i)=>{const t=a?"top":"bottom",e=i?"left":"right",s=a===i?"nwse-resize":"nesw-resize";return{[t]:"-5px",[e]:"-5px",cursor:s}},N={tl:v(!0,!0),tr:v(!0,!1),bl:v(!1,!0),br:v(!1,!1)},L=new Map,C=globalThis;function B(a){const i=L.get(a);if(i)return i;const t=u.ReactDOMServer.renderToString(u.jsxRuntimeExports.jsx(u.AIcon,{icon:a,size:"xs"}));return L.set(a,t),t}const R={modules:["DisplaySize","Toolbar","Resize","Keyboard"],embedTags:["VIDEO","IFRAME"],tools:["left","center","right","justify"],contentOptions:[{attribute:["width"],limit:{minWidth:100},blotName:"image"},{attribute:["width","height"],limit:{minWidth:200,ratio:.5625},blotName:"video"}]},k=u.Quill.import("formats/image");class E extends k{static get ATTRIBUTES(){return["alt","height","width","class","style","data-align"]}static formats(i){return this.ATTRIBUTES.reduce((t,e)=>(i.hasAttribute(e)&&(t[e]=i.getAttribute(e)??""),t),{})}format(i,t){this.constructor.ATTRIBUTES.includes(i)?t?this.domNode.setAttribute(i,t):this.domNode.removeAttribute(i):super.format(i,t)}}l(E,"blotName","image"),l(E,"tagName","img"),l(E,"scope",u.Scope.INLINE);function z(){C.__AEDITOR_IMAGE_BLOT_REGISTERED__||(u.Quill.register("formats/image",E,!0),C.__AEDITOR_IMAGE_BLOT_REGISTERED__=!0)}class y{constructor(i){l(this,"resizer");l(this,"quill");l(this,"overlay");l(this,"activeEle");l(this,"blot");l(this,"options");l(this,"requestUpdate");this.resizer=i,this.quill=i.quill,this.overlay=i.overlay,this.activeEle=i.activeEle,this.blot=i.blot,this.options=i.options,this.requestUpdate=()=>i.scheduleUpdate(!0)}onCreate(){}onDestroy(){}onUpdate(){}}class I extends y{constructor(){super(...arguments);l(this,"display")}onCreate(){var t;this.display=document.createElement("div"),this.display.className=u.S[g.DISPLAY],(t=this.overlay)==null||t.appendChild(this.display)}onUpdate(){if(!this.display||!this.activeEle)return;const[t,e]=[this.activeEle.offsetWidth,this.activeEle.offsetHeight];this.display.textContent=`${t} × ${e}`,this.positionDisplay(t,e)}positionDisplay(t,e){var p;if(!this.display)return;const s=this.display.getBoundingClientRect(),o=t>120&&e>30,n=((p=this.activeEle)==null?void 0:p.style.float)==="right";let r,h,c;o?(r="4px",h="4px",c="auto"):(h=`-${s.height+4}px`,n?(r="auto",c=`-${s.width+4}px`):(r=`-${s.width+4}px`,c="auto")),Object.assign(this.display.style,{right:r,bottom:h,left:c})}}class U extends y{constructor(){super(...arguments);l(this,"boxes",[]);l(this,"dragBox",null);l(this,"dragStartX",0);l(this,"dragStartY",0);l(this,"contentOption");l(this,"preDragSize",{width:0,height:0});l(this,"naturalSize",[0,0]);l(this,"handleDragProxy",null);l(this,"handleMouseupProxy",null);l(this,"dragAnimationFrame",null);l(this,"pendingDragEvent",null);l(this,"handleMousedown",t=>{t.button!==0||!this.blot||!this.activeEle||(t.preventDefault(),t.stopPropagation(),this.cancelDragFrame(),this.removeEventListeners(),this.dragBox=t.target,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.preDragSize={width:this.activeEle.offsetWidth,height:this.activeEle.offsetHeight},this.naturalSize=this.getNaturalSize(),this.setCursor(globalThis.getComputedStyle(this.dragBox).cursor),this.handleDragProxy=this.handleDrag,this.handleMouseupProxy=this.handleMouseup,document.addEventListener("mousemove",this.handleDragProxy,!0),document.addEventListener("mouseup",this.handleMouseupProxy,!0))});l(this,"handleMouseup",t=>{if(!this.activeEle||!this.blot||!this.contentOption)return;this.cancelDragFrame();const e=this.calcSize(t,this.contentOption.limit);Object.assign(this.activeEle,e),Object.assign(this.activeEle.style,{width:null,height:null}),this.setCursor(""),this.removeEventListeners()});l(this,"handleDrag",t=>{!this.activeEle||!this.blot||!this.contentOption||(t.preventDefault(),this.pendingDragEvent=t,this.dragAnimationFrame===null&&(this.dragAnimationFrame=requestAnimationFrame(()=>{this.dragAnimationFrame=null;const e=this.pendingDragEvent;this.pendingDragEvent=null,!(!e||!this.activeEle||!this.contentOption)&&(Object.assign(this.activeEle.style,this.calcSize(e,{...this.contentOption.limit,unit:!0})),this.requestUpdate())})))});l(this,"handleDoubleClick",t=>{if(!this.blot||!this.activeEle||!this.contentOption)return;t.stopPropagation();const[e,s]=this.naturalSize,o={};this.contentOption.attribute.includes("width")&&(o.width=e),this.contentOption.attribute.includes("height")&&(o.height=s);const n=this.applyConstraints(o,this.contentOption.limit);Object.assign(this.activeEle,n),this.requestUpdate()})}onCreate(){!this.blot||!this.options.contentOptions||(this.contentOption=this.options.contentOptions.find(t=>t.blotName===this.blot.statics.blotName),this.boxes=[],M.forEach(t=>this.addBox(t)))}onDestroy(){this.setCursor(""),this.cancelDragFrame(),this.removeEventListeners(),this.boxes.forEach(t=>{t.removeEventListener("mousedown",this.handleMousedown,!1),t.removeEventListener("dblclick",this.handleDoubleClick,!1)}),this.boxes=[]}addBox(t){var s;const e=document.createElement("div");e.className=`${u.S[g.HANDLE]} ${t}`,e.addEventListener("mousedown",this.handleMousedown,!1),e.addEventListener("dblclick",this.handleDoubleClick,!1),Object.assign(e.style,N[t]),(s=this.overlay)==null||s.appendChild(e),this.boxes.push(e)}removeEventListeners(){this.handleDragProxy&&(document.removeEventListener("mousemove",this.handleDragProxy,!0),this.handleDragProxy=null),this.handleMouseupProxy&&(document.removeEventListener("mouseup",this.handleMouseupProxy,!0),this.handleMouseupProxy=null)}calcSize(t,e={}){var h;if(!this.dragBox||!this.activeEle)return{};const s=t.clientX-this.dragStartX,o=t.clientY-this.dragStartY,n=this.dragBox===this.boxes[0]||this.dragBox===this.boxes[3]?-1:1,r={};return(h=this.contentOption)!=null&&h.attribute?this.contentOption.attribute.forEach(c=>r[c]=this.preDragSize[c]):r.width=this.preDragSize.width,r.width&&(r.width=Math.round(this.preDragSize.width+s*n)),r.height&&(r.height=Math.round(this.preDragSize.height+o*n)),this.applyConstraints(r,e)}constrainDimensionsWithRatio(t,e){const s=e.ratio;let o=this.applyLimit(t,e.minWidth,e.maxWidth),n=o*s;const r=this.applyLimit(n,e.minHeight,e.maxHeight);return r!==n&&(n=r,o=n/s),{rw:o,rh:n}}applyConstraints(t,e={}){const s=typeof t.width=="string"?Number.parseInt(t.width,10):t.width||0,o=typeof t.height=="string"?Number.parseInt(t.height,10):t.height||0;let n=s,r=o;e.ratio?{rw:n,rh:r}=this.constrainDimensionsWithRatio(n,e):(s&&(n=this.applyLimit(n,e.minWidth,e.maxWidth)),o&&(r=this.applyLimit(r,e.minHeight,e.maxHeight)));const h={};return t.width!==void 0&&(h.width=e.unit?`${n}px`:n),t.height!==void 0&&(h.height=e.unit?`${r}px`:r),h}applyLimit(t,e,s){let o=t;return e!==void 0&&(o=Math.max(e,o)),s!==void 0&&(o=Math.min(s,o)),o}getNaturalSize(){if(!this.activeEle)return[0,0];const t=this.activeEle.dataset.size;if(!t){const e=this.activeEle,s=[e.offsetWidth,e.offsetHeight];return e.dataset.size=s.join(","),s}return t.split(",").map(Number)}setCursor(t){[document.body,this.activeEle].forEach(e=>e&&(e.style.cursor=t))}cancelDragFrame(){this.dragAnimationFrame!==null&&(cancelAnimationFrame(this.dragAnimationFrame),this.dragAnimationFrame=null),this.pendingDragEvent=null}}const m=class m extends y{constructor(){super(...arguments);l(this,"keyboardProxy",t=>this.keyboardHandle(t))}static injectInit(t){var s;if(m.injectedQuills.has(t))return;const e=(s=t.keyboard)==null?void 0:s.bindings;e&&([m.keys.LEFT,m.keys.RIGHT].forEach(o=>(e[o]||[]).unshift(m.makeArrowHandler(o))),m.injectedQuills.add(t))}static makeArrowHandler(t){const e=t===m.keys.LEFT;return{key:t,shiftKey:!1,altKey:null,[e?"prefix":"suffix"]:/^$/,handler(s){const o=this.quill;if(!o.resizer)return!0;let n=s.index;const r=t===m.keys.RIGHT,[h]=o.getLine(n+(e?-1:0));if(!h)return!0;if(o.resizer.judgeShow(h))return!1;const c=o.getIndex(h);if(r&&c+h.length()-1===n)return!0;r&&(n+=s.length+1);const[p]=o.getLeaf(n);if(!p)return!0;const x=p.offset(p.parent),P=p.constructor&&"scope"in p.constructor&&p.constructor.scope===u.Scope.BLOCK_BLOT;if(e&&(P&&n===x||n===0||n===c))return!0;let S=p;if(e&&x===0){const[O]=o.getLeaf(n-1);O&&(S=O)}return!S||!o.resizer.judgeShow(S)}}}onCreate(){document.addEventListener("keydown",this.keyboardProxy,!0)}onDestroy(){document.removeEventListener("keydown",this.keyboardProxy,!0)}keyboardHandle(t){if(t.defaultPrevented||t.shiftKey||t.ctrlKey||t.altKey||!this.activeEle||!this.blot)return;const e=q(t);let s=this.blot.offset(this.quill.scroll),o=null,n=!1;e===d.BACKSPACE||e===d.DELETE?(this.handleDelete(),n=!0):e>=d.LEFT&&e<=d.DOWN&&([s,o]=this.handleArrowKeys(e,s),n=!0),n&&(t.stopPropagation(),t.preventDefault()),!(o&&this.resizer.judgeShow(o,o.domNode))&&(this.quill.setSelection(s),this.resizer.hide())}handleDelete(){if(!this.blot)return;const t=this.blot.length();this.blot.deleteAt(0,t),this.blot=void 0,this.activeEle=void 0,this.resizer.hide()}handleArrowKeys(t,e){let s=null;return t===d.RIGHT?e+=this.blot.length()||1:t===d.UP?(e=this.getOtherLineIndex(-1),s=this.quill.getLeaf(e)[0]):t===d.DOWN&&(e=this.getOtherLineIndex(1),s=this.quill.getLeaf(e)[0]),[e,s]}getOtherLineIndex(t){if(!this.blot)return 0;const e=this.blot.offset(this.quill.scroll),[s]=this.quill.getLine(e);if(!s)return e;const o=this.blot.offset(s)+1,n=t>0?s.next:s.prev;if(!n)return e;let r=n.length();return n.statics.blotName==="block"&&r--,n.offset(this.quill.scroll)+Math.min(r,o)}};l(m,"keys",d),l(m,"injectedQuills",new WeakSet);let b=m;const f=class f extends y{constructor(t){super(t);l(this,"toolbar");l(this,"blot");l(this,"tools",{});l(this,"toolbarClickProxy",t=>this.handleToolbarClick(t));this.blot=t.blot}createStyleTool(t,e){const s={left:{float:"left"},right:{float:"right"},center:{display:"block",margin:"0 auto",float:"none"},justify:{display:"block",float:"none",margin:"0",width:"100%"}};return{icon:t,apply:o=>{this.clearAlignmentStyles(o);const n=s[e];Object.assign(o.style,n),o.dataset.align=e},isApplied:o=>{const n=o.style;switch(e){case"center":return n.float==="none";case"justify":return n.display==="block"&&n.width==="100%";case"left":case"right":return n.float===e;default:return!1}}}}clearAlignmentStyles(t){const e=t.dataset.align;t.style.removeProperty("display"),t.style.removeProperty("float"),t.style.removeProperty("margin"),e==="justify"&&t.style.removeProperty("width"),delete t.dataset.align}onCreate(){var t;this.toolbar=document.createElement("div"),this.toolbar.className=u.S[g.TOOLBAR],this.toolbar.addEventListener("click",this.toolbarClickProxy),(t=this.overlay)==null||t.appendChild(this.toolbar),this.initializeTools(),this._addToolbarButtons()}onDestroy(){var t;(t=this.toolbar)==null||t.removeEventListener("click",this.toolbarClickProxy),this.toolbar=void 0}initializeTools(){Object.keys(f.Tools).forEach(t=>{const e=t;this.tools[e]=this.createStyleTool(f.Tools[e].icon,e)})}_addToolbarButtons(){!this.toolbar||!this.activeEle||this.options.tools.forEach(t=>{const e=this.tools[t];if(!e)return;const s=document.createElement("button");s.type="button",s.className=u.S[g.TOOLBAR_BUTTON],s.innerHTML=B(e.icon),s.dataset.tool=t,e.isApplied&&this.activeEle&&e.isApplied.call(this,this.activeEle)&&(s.style.backgroundColor="var(--AEditor_Addon_Secondary_color)"),this.toolbar.appendChild(s)})}handleToolbarClick(t){var r,h;if(!this.activeEle||!this.blot||!this.toolbar)return;const e=(r=t.target)==null?void 0:r.closest("button[data-tool]");if(!e||!this.toolbar.contains(e))return;const s=e.dataset.tool;if(!s)return;const o=this.tools[s];if(!o||(t.stopPropagation(),o.handler&&o.handler.call(this,t,e,this.activeEle)!==!0))return;const n=o.isApplied?o.isApplied.call(this,this.activeEle):!1;Array.from(this.toolbar.querySelectorAll("button")).forEach(c=>c.style.backgroundColor=""),n?this.clearAlignmentStyles(this.activeEle):(e.style.backgroundColor="var(--AEditor_Addon_Secondary_color)",(h=o.apply)==null||h.call(o,this.activeEle)),this.requestUpdate()}};l(f,"Tools",{left:{icon:"AlignLeft"},center:{icon:"AlignCenter"},right:{icon:"AlignRight"},justify:{icon:"AlignJustify"}});let A=f;class T{constructor(i,t={}){l(this,"quill");l(this,"options");l(this,"moduleClasses");l(this,"modules",[]);l(this,"blot");l(this,"selectedBlots",[]);l(this,"embedClassName","");l(this,"activeEle");l(this,"overlay");l(this,"updateFromModule",!1);l(this,"hideProxy",null);l(this,"updateOverlayPositionProxy",null);l(this,"embedStyleElement",null);l(this,"updateAnimationFrame",null);l(this,"overlayScrollAnimationFrame",null);l(this,"pendingOverlayMarginTop",null);l(this,"scheduledFromModule",!1);l(this,"previousBodyUserSelect",null);l(this,"previousRootUserSelect",null);l(this,"handleClickProxy",i=>this.handleClick(i));l(this,"handleChangeProxy",(i,t,e)=>this.handleChange(i,t,e));l(this,"handleSelectionChangeProxy",i=>this.addBlotsSelectedClass(i));var s;z(),i.resizer=this,this.quill=i;const e=t.modules?[...t.modules]:null;this.options={...R,...t},e&&(this.options.modules=e),this.moduleClasses=this.options.modules,this.quill.root.addEventListener("mousedown",this.handleClickProxy,!1),this.quill.on("text-change",this.handleChangeProxy),this.quill.container.style.position=this.quill.container.style.position||"relative",this.quill.on("selection-change",this.handleSelectionChangeProxy),b.injectInit(this.quill),(s=this.options.embedTags)!=null&&s.length&&this.initializeEmbed()}destroy(){var i;this.updateAnimationFrame!==null&&(cancelAnimationFrame(this.updateAnimationFrame),this.updateAnimationFrame=null),this.overlayScrollAnimationFrame!==null&&(cancelAnimationFrame(this.overlayScrollAnimationFrame),this.overlayScrollAnimationFrame=null),this.pendingOverlayMarginTop=null,this.hide(),this.quill.root.removeEventListener("mousedown",this.handleClickProxy,!1),this.quill.off("text-change",this.handleChangeProxy),this.quill.off("selection-change",this.handleSelectionChangeProxy),(i=this.embedStyleElement)==null||i.remove(),this.embedStyleElement=null,this.embedClassName&&this.quill.root.classList.remove(this.embedClassName)}initializeModules(){this.modules.forEach(i=>i.onDestroy()),this.modules=[],this.modules=this.moduleClasses.map(i=>new(this.constructor.Modules[i]||i)(this)),this.modules.forEach(i=>i.onCreate()),this.repositionElements(),this.modules.forEach(i=>i.onUpdate())}initializeEmbed(){if(!this.options.embedTags.length)return;this.embedClassName=`ql-${Array.from({length:F},()=>Math.floor(Math.random()*62)).join("")}`;const i=[""].concat(this.options.embedTags).join(`, .${this.embedClassName} `).slice(2)+"{pointer-events: none;}",t=document.createElement("style");t.textContent=i,this.embedStyleElement=t,this.quill.container.appendChild(t),this.quill.root.classList.add(this.embedClassName)}scheduleUpdate(i){this.scheduledFromModule=this.scheduledFromModule||!!i,this.updateAnimationFrame===null&&(this.updateAnimationFrame=requestAnimationFrame(()=>{this.updateAnimationFrame=null;const t=this.scheduledFromModule;this.scheduledFromModule=!1,this.onUpdate(t)}))}onUpdate(i){this.updateFromModule=!!i,this.repositionElements(),this.modules.forEach(t=>t.onUpdate())}handleClick(i){if(this.overlay&&(i.target===this.overlay||this.overlay.contains(i.target)))return;let t=i.target;if(t=this.getEventTarget(i,t),t!=null&&t.tagName){const e=this.quill.scroll.find(t);if(e&&this.judgeShow(e,t)){i.preventDefault();return}}this.activeEle&&this.hide()}getEventTarget(i,t){var o;const e=(o=this.options.embedTags)==null?void 0:o.join();if(!e)return t;const s=this.quill.root;return(t===s||t.querySelectorAll(e).length)&&(s.classList.remove(this.embedClassName),t=document.elementFromPoint(i.clientX,i.clientY),s.classList.add(this.embedClassName)),t}judgeShow(i,t){if(!i||!this.options.contentOptions)return!1;!t&&i.domNode&&(t=i.domNode);const e=this.options.contentOptions.find(o=>o.blotName===i.statics.blotName);if(!e)return!1;if(this.activeEle===t)return!0;const s=e.limit||{};return!s.minWidth||s.minWidth&&t.offsetWidth>=s.minWidth?(this.activeEle&&this.hide(),this.activeEle=t,this.blot=i,this.showOverlay(),this.initializeModules(),!0):!1}handleChange(i,t,e){if(this.updateFromModule){this.updateFromModule=!1;return}e!=="user"||!this.overlay||!this.activeEle||this.onUpdate()}showOverlay(){this.overlay&&this.hideOverlay(),this.quill.setSelection(null),this.previousBodyUserSelect=document.body.style.userSelect,this.previousRootUserSelect=this.quill.root.style.userSelect,document.body.style.userSelect="none",this.quill.root.style.userSelect="none",this.overlay=document.createElement("div"),this.overlay.className=`${u.S[g.OVERLAY]}`,this.quill.container.appendChild(this.overlay),this.hideProxy=()=>this.activeEle&&this.hide(),this.updateOverlayPositionProxy=()=>this.scheduleOverlayMarginSync(),this.quill.root.addEventListener("input",this.hideProxy,!0),this.quill.root.addEventListener("scroll",this.updateOverlayPositionProxy,{passive:!0}),this.repositionElements()}hideOverlay(){this.overlay&&(this.overlayScrollAnimationFrame!==null&&(cancelAnimationFrame(this.overlayScrollAnimationFrame),this.overlayScrollAnimationFrame=null),this.pendingOverlayMarginTop=null,this.overlay.remove(),this.overlay=void 0,this.hideProxy&&this.quill.root.removeEventListener("input",this.hideProxy,!0),this.updateOverlayPositionProxy&&this.quill.root.removeEventListener("scroll",this.updateOverlayPositionProxy),this.hideProxy=null,this.updateOverlayPositionProxy=null,this.previousBodyUserSelect!==null&&(document.body.style.userSelect=this.previousBodyUserSelect,this.previousBodyUserSelect=null),this.previousRootUserSelect!==null&&(this.quill.root.style.userSelect=this.previousRootUserSelect,this.previousRootUserSelect=null))}repositionElements(){if(!this.overlay||!this.activeEle)return;const i=this.quill.container,t=this.activeEle.getBoundingClientRect(),e=i.getBoundingClientRect();Object.assign(this.overlay.style,{left:`${t.left-e.left-1+i.scrollLeft}px`,top:`${t.top-e.top+this.quill.root.scrollTop}px`,width:`${t.width}px`,height:`${t.height}px`,marginTop:-1*this.quill.root.scrollTop+"px"})}addBlotsSelectedClass(i){if(!i){this.selectedBlots=[];return}try{const t=s=>{var o;return["image","iframe","video"].includes((o=s.statics)==null?void 0:o.blotName)},e=this.quill.scroll.descendants(t,i.index,i.length);this.selectedBlots=e.filter(s=>!s.statics||!this.options.contentOptions?!1:this.options.contentOptions.some(o=>o.blotName===s.statics.blotName))}catch(t){console.warn("Error during blot selection:",t)}}hide(){this.hideOverlay(),this.modules.forEach(i=>i.onDestroy()),this.modules=[],this.activeEle=void 0,this.blot=void 0}scheduleOverlayMarginSync(){this.overlay&&(this.pendingOverlayMarginTop=-1*this.quill.root.scrollTop,this.overlayScrollAnimationFrame===null&&(this.overlayScrollAnimationFrame=requestAnimationFrame(()=>{this.overlayScrollAnimationFrame=null,!(!this.overlay||this.pendingOverlayMarginTop===null)&&(this.overlay.style.marginTop=`${this.pendingOverlayMarginTop}px`,this.pendingOverlayMarginTop=null)})))}}l(T,"Modules",{Base:y,DisplaySize:I,Toolbar:A,Resize:U,Keyboard:b});exports.default=T;
1
+ "use strict";var D=Object.defineProperty;var w=(a,i,t)=>i in a?D(a,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[i]=t;var l=(a,i,t)=>w(a,typeof i!="symbol"?i+"":i,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-BMxbHpPm.cjs"),g={OVERLAY:"ql-image-resizer-overlay",HANDLE:"ql-image-resizer-handle",DISPLAY:"ql-image-resizer-display",TOOLBAR:"ql-image-resizer-toolbar",TOOLBAR_BUTTON:"ql-image-resizer-toolbar-button"},d={BACKSPACE:8,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40};function q(a){switch(a.key){case"Backspace":return d.BACKSPACE;case"Delete":return d.DELETE;case"ArrowLeft":return d.LEFT;case"ArrowUp":return d.UP;case"ArrowRight":return d.RIGHT;case"ArrowDown":return d.DOWN;default:return 0}}const M=["tl","tr","br","bl"],F=8,v=(a,i)=>{const t=a?"top":"bottom",e=i?"left":"right",s=a===i?"nwse-resize":"nesw-resize";return{[t]:"-5px",[e]:"-5px",cursor:s}},N={tl:v(!0,!0),tr:v(!0,!1),bl:v(!1,!0),br:v(!1,!1)},L=new Map,C=globalThis;function B(a){const i=L.get(a);if(i)return i;const t=u.ReactDOMServer.renderToString(u.jsxRuntimeExports.jsx(u.AIcon,{icon:a,size:"xs"}));return L.set(a,t),t}const R={modules:["DisplaySize","Toolbar","Resize","Keyboard"],embedTags:["VIDEO","IFRAME"],tools:["left","center","right","justify"],contentOptions:[{attribute:["width"],limit:{minWidth:100},blotName:"image"},{attribute:["width","height"],limit:{minWidth:200,ratio:.5625},blotName:"video"}]},k=u.Quill.import("formats/image");class E extends k{static get ATTRIBUTES(){return["alt","height","width","class","style","data-align"]}static formats(i){return this.ATTRIBUTES.reduce((t,e)=>(i.hasAttribute(e)&&(t[e]=i.getAttribute(e)??""),t),{})}format(i,t){this.constructor.ATTRIBUTES.includes(i)?t?this.domNode.setAttribute(i,t):this.domNode.removeAttribute(i):super.format(i,t)}}l(E,"blotName","image"),l(E,"tagName","img"),l(E,"scope",u.Scope.INLINE);function z(){C.__AEDITOR_IMAGE_BLOT_REGISTERED__||(u.Quill.register("formats/image",E,!0),C.__AEDITOR_IMAGE_BLOT_REGISTERED__=!0)}class y{constructor(i){l(this,"resizer");l(this,"quill");l(this,"overlay");l(this,"activeEle");l(this,"blot");l(this,"options");l(this,"requestUpdate");this.resizer=i,this.quill=i.quill,this.overlay=i.overlay,this.activeEle=i.activeEle,this.blot=i.blot,this.options=i.options,this.requestUpdate=()=>i.scheduleUpdate(!0)}onCreate(){}onDestroy(){}onUpdate(){}}class I extends y{constructor(){super(...arguments);l(this,"display")}onCreate(){var t;this.display=document.createElement("div"),this.display.className=u.S[g.DISPLAY],(t=this.overlay)==null||t.appendChild(this.display)}onUpdate(){if(!this.display||!this.activeEle)return;const[t,e]=[this.activeEle.offsetWidth,this.activeEle.offsetHeight];this.display.textContent=`${t} × ${e}`,this.positionDisplay(t,e)}positionDisplay(t,e){var p;if(!this.display)return;const s=this.display.getBoundingClientRect(),o=t>120&&e>30,n=((p=this.activeEle)==null?void 0:p.style.float)==="right";let r,h,c;o?(r="4px",h="4px",c="auto"):(h=`-${s.height+4}px`,n?(r="auto",c=`-${s.width+4}px`):(r=`-${s.width+4}px`,c="auto")),Object.assign(this.display.style,{right:r,bottom:h,left:c})}}class U extends y{constructor(){super(...arguments);l(this,"boxes",[]);l(this,"dragBox",null);l(this,"dragStartX",0);l(this,"dragStartY",0);l(this,"contentOption");l(this,"preDragSize",{width:0,height:0});l(this,"naturalSize",[0,0]);l(this,"handleDragProxy",null);l(this,"handleMouseupProxy",null);l(this,"dragAnimationFrame",null);l(this,"pendingDragEvent",null);l(this,"handleMousedown",t=>{t.button!==0||!this.blot||!this.activeEle||(t.preventDefault(),t.stopPropagation(),this.cancelDragFrame(),this.removeEventListeners(),this.dragBox=t.target,this.dragStartX=t.clientX,this.dragStartY=t.clientY,this.preDragSize={width:this.activeEle.offsetWidth,height:this.activeEle.offsetHeight},this.naturalSize=this.getNaturalSize(),this.setCursor(globalThis.getComputedStyle(this.dragBox).cursor),this.handleDragProxy=this.handleDrag,this.handleMouseupProxy=this.handleMouseup,document.addEventListener("mousemove",this.handleDragProxy,!0),document.addEventListener("mouseup",this.handleMouseupProxy,!0))});l(this,"handleMouseup",t=>{if(!this.activeEle||!this.blot||!this.contentOption)return;this.cancelDragFrame();const e=this.calcSize(t,this.contentOption.limit);Object.assign(this.activeEle,e),Object.assign(this.activeEle.style,{width:null,height:null}),this.setCursor(""),this.removeEventListeners()});l(this,"handleDrag",t=>{!this.activeEle||!this.blot||!this.contentOption||(t.preventDefault(),this.pendingDragEvent=t,this.dragAnimationFrame===null&&(this.dragAnimationFrame=requestAnimationFrame(()=>{this.dragAnimationFrame=null;const e=this.pendingDragEvent;this.pendingDragEvent=null,!(!e||!this.activeEle||!this.contentOption)&&(Object.assign(this.activeEle.style,this.calcSize(e,{...this.contentOption.limit,unit:!0})),this.requestUpdate())})))});l(this,"handleDoubleClick",t=>{if(!this.blot||!this.activeEle||!this.contentOption)return;t.stopPropagation();const[e,s]=this.naturalSize,o={};this.contentOption.attribute.includes("width")&&(o.width=e),this.contentOption.attribute.includes("height")&&(o.height=s);const n=this.applyConstraints(o,this.contentOption.limit);Object.assign(this.activeEle,n),this.requestUpdate()})}onCreate(){!this.blot||!this.options.contentOptions||(this.contentOption=this.options.contentOptions.find(t=>t.blotName===this.blot.statics.blotName),this.boxes=[],M.forEach(t=>this.addBox(t)))}onDestroy(){this.setCursor(""),this.cancelDragFrame(),this.removeEventListeners(),this.boxes.forEach(t=>{t.removeEventListener("mousedown",this.handleMousedown,!1),t.removeEventListener("dblclick",this.handleDoubleClick,!1)}),this.boxes=[]}addBox(t){var s;const e=document.createElement("div");e.className=`${u.S[g.HANDLE]} ${t}`,e.addEventListener("mousedown",this.handleMousedown,!1),e.addEventListener("dblclick",this.handleDoubleClick,!1),Object.assign(e.style,N[t]),(s=this.overlay)==null||s.appendChild(e),this.boxes.push(e)}removeEventListeners(){this.handleDragProxy&&(document.removeEventListener("mousemove",this.handleDragProxy,!0),this.handleDragProxy=null),this.handleMouseupProxy&&(document.removeEventListener("mouseup",this.handleMouseupProxy,!0),this.handleMouseupProxy=null)}calcSize(t,e={}){var h;if(!this.dragBox||!this.activeEle)return{};const s=t.clientX-this.dragStartX,o=t.clientY-this.dragStartY,n=this.dragBox===this.boxes[0]||this.dragBox===this.boxes[3]?-1:1,r={};return(h=this.contentOption)!=null&&h.attribute?this.contentOption.attribute.forEach(c=>r[c]=this.preDragSize[c]):r.width=this.preDragSize.width,r.width&&(r.width=Math.round(this.preDragSize.width+s*n)),r.height&&(r.height=Math.round(this.preDragSize.height+o*n)),this.applyConstraints(r,e)}constrainDimensionsWithRatio(t,e){const s=e.ratio;let o=this.applyLimit(t,e.minWidth,e.maxWidth),n=o*s;const r=this.applyLimit(n,e.minHeight,e.maxHeight);return r!==n&&(n=r,o=n/s),{rw:o,rh:n}}applyConstraints(t,e={}){const s=typeof t.width=="string"?Number.parseInt(t.width,10):t.width||0,o=typeof t.height=="string"?Number.parseInt(t.height,10):t.height||0;let n=s,r=o;e.ratio?{rw:n,rh:r}=this.constrainDimensionsWithRatio(n,e):(s&&(n=this.applyLimit(n,e.minWidth,e.maxWidth)),o&&(r=this.applyLimit(r,e.minHeight,e.maxHeight)));const h={};return t.width!==void 0&&(h.width=e.unit?`${n}px`:n),t.height!==void 0&&(h.height=e.unit?`${r}px`:r),h}applyLimit(t,e,s){let o=t;return e!==void 0&&(o=Math.max(e,o)),s!==void 0&&(o=Math.min(s,o)),o}getNaturalSize(){if(!this.activeEle)return[0,0];const t=this.activeEle.dataset.size;if(!t){const e=this.activeEle,s=[e.offsetWidth,e.offsetHeight];return e.dataset.size=s.join(","),s}return t.split(",").map(Number)}setCursor(t){[document.body,this.activeEle].forEach(e=>e&&(e.style.cursor=t))}cancelDragFrame(){this.dragAnimationFrame!==null&&(cancelAnimationFrame(this.dragAnimationFrame),this.dragAnimationFrame=null),this.pendingDragEvent=null}}const m=class m extends y{constructor(){super(...arguments);l(this,"keyboardProxy",t=>this.keyboardHandle(t))}static injectInit(t){var s;if(m.injectedQuills.has(t))return;const e=(s=t.keyboard)==null?void 0:s.bindings;e&&([m.keys.LEFT,m.keys.RIGHT].forEach(o=>(e[o]||[]).unshift(m.makeArrowHandler(o))),m.injectedQuills.add(t))}static makeArrowHandler(t){const e=t===m.keys.LEFT;return{key:t,shiftKey:!1,altKey:null,[e?"prefix":"suffix"]:/^$/,handler(s){const o=this.quill;if(!o.resizer)return!0;let n=s.index;const r=t===m.keys.RIGHT,[h]=o.getLine(n+(e?-1:0));if(!h)return!0;if(o.resizer.judgeShow(h))return!1;const c=o.getIndex(h);if(r&&c+h.length()-1===n)return!0;r&&(n+=s.length+1);const[p]=o.getLeaf(n);if(!p)return!0;const x=p.offset(p.parent),P=p.constructor&&"scope"in p.constructor&&p.constructor.scope===u.Scope.BLOCK_BLOT;if(e&&(P&&n===x||n===0||n===c))return!0;let S=p;if(e&&x===0){const[O]=o.getLeaf(n-1);O&&(S=O)}return!S||!o.resizer.judgeShow(S)}}}onCreate(){document.addEventListener("keydown",this.keyboardProxy,!0)}onDestroy(){document.removeEventListener("keydown",this.keyboardProxy,!0)}keyboardHandle(t){if(t.defaultPrevented||t.shiftKey||t.ctrlKey||t.altKey||!this.activeEle||!this.blot)return;const e=q(t);let s=this.blot.offset(this.quill.scroll),o=null,n=!1;e===d.BACKSPACE||e===d.DELETE?(this.handleDelete(),n=!0):e>=d.LEFT&&e<=d.DOWN&&([s,o]=this.handleArrowKeys(e,s),n=!0),n&&(t.stopPropagation(),t.preventDefault()),!(o&&this.resizer.judgeShow(o,o.domNode))&&(this.quill.setSelection(s),this.resizer.hide())}handleDelete(){if(!this.blot)return;const t=this.blot.length();this.blot.deleteAt(0,t),this.blot=void 0,this.activeEle=void 0,this.resizer.hide()}handleArrowKeys(t,e){let s=null;return t===d.RIGHT?e+=this.blot.length()||1:t===d.UP?(e=this.getOtherLineIndex(-1),s=this.quill.getLeaf(e)[0]):t===d.DOWN&&(e=this.getOtherLineIndex(1),s=this.quill.getLeaf(e)[0]),[e,s]}getOtherLineIndex(t){if(!this.blot)return 0;const e=this.blot.offset(this.quill.scroll),[s]=this.quill.getLine(e);if(!s)return e;const o=this.blot.offset(s)+1,n=t>0?s.next:s.prev;if(!n)return e;let r=n.length();return n.statics.blotName==="block"&&r--,n.offset(this.quill.scroll)+Math.min(r,o)}};l(m,"keys",d),l(m,"injectedQuills",new WeakSet);let b=m;const f=class f extends y{constructor(t){super(t);l(this,"toolbar");l(this,"blot");l(this,"tools",{});l(this,"toolbarClickProxy",t=>this.handleToolbarClick(t));this.blot=t.blot}createStyleTool(t,e){const s={left:{float:"left"},right:{float:"right"},center:{display:"block",margin:"0 auto",float:"none"},justify:{display:"block",float:"none",margin:"0",width:"100%"}};return{icon:t,apply:o=>{this.clearAlignmentStyles(o);const n=s[e];Object.assign(o.style,n),o.dataset.align=e},isApplied:o=>{const n=o.style;switch(e){case"center":return n.float==="none";case"justify":return n.display==="block"&&n.width==="100%";case"left":case"right":return n.float===e;default:return!1}}}}clearAlignmentStyles(t){const e=t.dataset.align;t.style.removeProperty("display"),t.style.removeProperty("float"),t.style.removeProperty("margin"),e==="justify"&&t.style.removeProperty("width"),delete t.dataset.align}onCreate(){var t;this.toolbar=document.createElement("div"),this.toolbar.className=u.S[g.TOOLBAR],this.toolbar.addEventListener("click",this.toolbarClickProxy),(t=this.overlay)==null||t.appendChild(this.toolbar),this.initializeTools(),this._addToolbarButtons()}onDestroy(){var t;(t=this.toolbar)==null||t.removeEventListener("click",this.toolbarClickProxy),this.toolbar=void 0}initializeTools(){Object.keys(f.Tools).forEach(t=>{const e=t;this.tools[e]=this.createStyleTool(f.Tools[e].icon,e)})}_addToolbarButtons(){!this.toolbar||!this.activeEle||this.options.tools.forEach(t=>{const e=this.tools[t];if(!e)return;const s=document.createElement("button");s.type="button",s.className=u.S[g.TOOLBAR_BUTTON],s.innerHTML=B(e.icon),s.dataset.tool=t,e.isApplied&&this.activeEle&&e.isApplied.call(this,this.activeEle)&&(s.style.backgroundColor="var(--AEditor_Addon_Secondary_color)"),this.toolbar.appendChild(s)})}handleToolbarClick(t){var r,h;if(!this.activeEle||!this.blot||!this.toolbar)return;const e=(r=t.target)==null?void 0:r.closest("button[data-tool]");if(!e||!this.toolbar.contains(e))return;const s=e.dataset.tool;if(!s)return;const o=this.tools[s];if(!o||(t.stopPropagation(),o.handler&&o.handler.call(this,t,e,this.activeEle)!==!0))return;const n=o.isApplied?o.isApplied.call(this,this.activeEle):!1;Array.from(this.toolbar.querySelectorAll("button")).forEach(c=>c.style.backgroundColor=""),n?this.clearAlignmentStyles(this.activeEle):(e.style.backgroundColor="var(--AEditor_Addon_Secondary_color)",(h=o.apply)==null||h.call(o,this.activeEle)),this.requestUpdate()}};l(f,"Tools",{left:{icon:"AlignLeft"},center:{icon:"AlignCenter"},right:{icon:"AlignRight"},justify:{icon:"AlignJustify"}});let A=f;class T{constructor(i,t={}){l(this,"quill");l(this,"options");l(this,"moduleClasses");l(this,"modules",[]);l(this,"blot");l(this,"selectedBlots",[]);l(this,"embedClassName","");l(this,"activeEle");l(this,"overlay");l(this,"updateFromModule",!1);l(this,"hideProxy",null);l(this,"updateOverlayPositionProxy",null);l(this,"embedStyleElement",null);l(this,"updateAnimationFrame",null);l(this,"overlayScrollAnimationFrame",null);l(this,"pendingOverlayMarginTop",null);l(this,"scheduledFromModule",!1);l(this,"previousBodyUserSelect",null);l(this,"previousRootUserSelect",null);l(this,"handleClickProxy",i=>this.handleClick(i));l(this,"handleChangeProxy",(i,t,e)=>this.handleChange(i,t,e));l(this,"handleSelectionChangeProxy",i=>this.addBlotsSelectedClass(i));var s;z(),i.resizer=this,this.quill=i;const e=t.modules?[...t.modules]:null;this.options={...R,...t},e&&(this.options.modules=e),this.moduleClasses=this.options.modules,this.quill.root.addEventListener("mousedown",this.handleClickProxy,!1),this.quill.on("text-change",this.handleChangeProxy),this.quill.container.style.position=this.quill.container.style.position||"relative",this.quill.on("selection-change",this.handleSelectionChangeProxy),b.injectInit(this.quill),(s=this.options.embedTags)!=null&&s.length&&this.initializeEmbed()}destroy(){var i;this.updateAnimationFrame!==null&&(cancelAnimationFrame(this.updateAnimationFrame),this.updateAnimationFrame=null),this.overlayScrollAnimationFrame!==null&&(cancelAnimationFrame(this.overlayScrollAnimationFrame),this.overlayScrollAnimationFrame=null),this.pendingOverlayMarginTop=null,this.hide(),this.quill.root.removeEventListener("mousedown",this.handleClickProxy,!1),this.quill.off("text-change",this.handleChangeProxy),this.quill.off("selection-change",this.handleSelectionChangeProxy),(i=this.embedStyleElement)==null||i.remove(),this.embedStyleElement=null,this.embedClassName&&this.quill.root.classList.remove(this.embedClassName)}initializeModules(){this.modules.forEach(i=>i.onDestroy()),this.modules=[],this.modules=this.moduleClasses.map(i=>new(this.constructor.Modules[i]||i)(this)),this.modules.forEach(i=>i.onCreate()),this.repositionElements(),this.modules.forEach(i=>i.onUpdate())}initializeEmbed(){if(!this.options.embedTags.length)return;this.embedClassName=`ql-${Array.from({length:F},()=>Math.floor(Math.random()*62)).join("")}`;const i=[""].concat(this.options.embedTags).join(`, .${this.embedClassName} `).slice(2)+"{pointer-events: none;}",t=document.createElement("style");t.textContent=i,this.embedStyleElement=t,this.quill.container.appendChild(t),this.quill.root.classList.add(this.embedClassName)}scheduleUpdate(i){this.scheduledFromModule=this.scheduledFromModule||!!i,this.updateAnimationFrame===null&&(this.updateAnimationFrame=requestAnimationFrame(()=>{this.updateAnimationFrame=null;const t=this.scheduledFromModule;this.scheduledFromModule=!1,this.onUpdate(t)}))}onUpdate(i){this.updateFromModule=!!i,this.repositionElements(),this.modules.forEach(t=>t.onUpdate())}handleClick(i){if(this.overlay&&(i.target===this.overlay||this.overlay.contains(i.target)))return;let t=i.target;if(t=this.getEventTarget(i,t),t!=null&&t.tagName){const e=this.quill.scroll.find(t);if(e&&this.judgeShow(e,t)){i.preventDefault();return}}this.activeEle&&this.hide()}getEventTarget(i,t){var o;const e=(o=this.options.embedTags)==null?void 0:o.join();if(!e)return t;const s=this.quill.root;return(t===s||t.querySelectorAll(e).length)&&(s.classList.remove(this.embedClassName),t=document.elementFromPoint(i.clientX,i.clientY),s.classList.add(this.embedClassName)),t}judgeShow(i,t){if(!i||!this.options.contentOptions)return!1;!t&&i.domNode&&(t=i.domNode);const e=this.options.contentOptions.find(o=>o.blotName===i.statics.blotName);if(!e)return!1;if(this.activeEle===t)return!0;const s=e.limit||{};return!s.minWidth||s.minWidth&&t.offsetWidth>=s.minWidth?(this.activeEle&&this.hide(),this.activeEle=t,this.blot=i,this.showOverlay(),this.initializeModules(),!0):!1}handleChange(i,t,e){if(this.updateFromModule){this.updateFromModule=!1;return}e!=="user"||!this.overlay||!this.activeEle||this.onUpdate()}showOverlay(){this.overlay&&this.hideOverlay(),this.quill.setSelection(null),this.previousBodyUserSelect=document.body.style.userSelect,this.previousRootUserSelect=this.quill.root.style.userSelect,document.body.style.userSelect="none",this.quill.root.style.userSelect="none",this.overlay=document.createElement("div"),this.overlay.className=`${u.S[g.OVERLAY]}`,this.quill.container.appendChild(this.overlay),this.hideProxy=()=>this.activeEle&&this.hide(),this.updateOverlayPositionProxy=()=>this.scheduleOverlayMarginSync(),this.quill.root.addEventListener("input",this.hideProxy,!0),this.quill.root.addEventListener("scroll",this.updateOverlayPositionProxy,{passive:!0}),this.repositionElements()}hideOverlay(){this.overlay&&(this.overlayScrollAnimationFrame!==null&&(cancelAnimationFrame(this.overlayScrollAnimationFrame),this.overlayScrollAnimationFrame=null),this.pendingOverlayMarginTop=null,this.overlay.remove(),this.overlay=void 0,this.hideProxy&&this.quill.root.removeEventListener("input",this.hideProxy,!0),this.updateOverlayPositionProxy&&this.quill.root.removeEventListener("scroll",this.updateOverlayPositionProxy),this.hideProxy=null,this.updateOverlayPositionProxy=null,this.previousBodyUserSelect!==null&&(document.body.style.userSelect=this.previousBodyUserSelect,this.previousBodyUserSelect=null),this.previousRootUserSelect!==null&&(this.quill.root.style.userSelect=this.previousRootUserSelect,this.previousRootUserSelect=null))}repositionElements(){if(!this.overlay||!this.activeEle)return;const i=this.quill.container,t=this.activeEle.getBoundingClientRect(),e=i.getBoundingClientRect();Object.assign(this.overlay.style,{left:`${t.left-e.left-1+i.scrollLeft}px`,top:`${t.top-e.top+this.quill.root.scrollTop}px`,width:`${t.width}px`,height:`${t.height}px`,marginTop:-1*this.quill.root.scrollTop+"px"})}addBlotsSelectedClass(i){if(!i){this.selectedBlots=[];return}try{const t=s=>{var o;return["image","iframe","video"].includes((o=s.statics)==null?void 0:o.blotName)},e=this.quill.scroll.descendants(t,i.index,i.length);this.selectedBlots=e.filter(s=>!s.statics||!this.options.contentOptions?!1:this.options.contentOptions.some(o=>o.blotName===s.statics.blotName))}catch(t){console.warn("Error during blot selection:",t)}}hide(){this.hideOverlay(),this.modules.forEach(i=>i.onDestroy()),this.modules=[],this.activeEle=void 0,this.blot=void 0}scheduleOverlayMarginSync(){this.overlay&&(this.pendingOverlayMarginTop=-1*this.quill.root.scrollTop,this.overlayScrollAnimationFrame===null&&(this.overlayScrollAnimationFrame=requestAnimationFrame(()=>{this.overlayScrollAnimationFrame=null,!(!this.overlay||this.pendingOverlayMarginTop===null)&&(this.overlay.style.marginTop=`${this.pendingOverlayMarginTop}px`,this.pendingOverlayMarginTop=null)})))}}l(T,"Modules",{Base:y,DisplaySize:I,Toolbar:A,Resize:U,Keyboard:b});exports.default=T;
@@ -1,7 +1,7 @@
1
1
  var w = Object.defineProperty;
2
2
  var q = (a, i, t) => i in a ? w(a, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[i] = t;
3
3
  var l = (a, i, t) => q(a, typeof i != "symbol" ? i + "" : i, t);
4
- import { S as f, a as T, Q as D, R as M, j as F, A as N } from "./index-rdk4wV0l.js";
4
+ import { S as f, a as T, Q as D, R as M, j as F, A as N } from "./index-CNlXRCGl.js";
5
5
  const g = {
6
6
  OVERLAY: "ql-image-resizer-overlay",
7
7
  HANDLE: "ql-image-resizer-handle",
@@ -1,9 +1,9 @@
1
1
  var R = Object.defineProperty;
2
2
  var T = (d, h, t) => h in d ? R(d, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[h] = t;
3
3
  var u = (d, h, t) => T(d, typeof h != "symbol" ? h + "" : h, t);
4
- import { l as y, Q as A } from "./index-rdk4wV0l.js";
5
- import { randomId as g, blotName as p, TableColFormat as H, TableCellFormat as E, tableUpSize as M } from "./index-Dvi7lgdt.js";
6
- import { normalizeVideoUrl as w } from "./Video-B0afDsx-.js";
4
+ import { l as y, Q as A } from "./index-CNlXRCGl.js";
5
+ import { randomId as g, blotName as p, TableColFormat as H, TableCellFormat as E, tableUpSize as M } from "./index-DjWuJZt0.js";
6
+ import { normalizeVideoUrl as w } from "./Video-BLwGJfeQ.js";
7
7
  const C = A.import("delta"), F = A.import("modules/clipboard"), W = /<table[\s>]/i, S = /(?:youtube\.com\/watch.*v=|youtu\.be\/)([a-zA-Z0-9_-]+)/, I = /vimeo\.com\/(\d+)/;
8
8
  function _(d) {
9
9
  let h = Number.parseFloat(d.getAttribute("width") || String(M.colDefaultWidth));
@@ -1,4 +1,4 @@
1
- "use strict";var I=Object.defineProperty;var A=(p,u,t)=>u in p?I(p,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[u]=t;var d=(p,u,t)=>A(p,typeof u!="symbol"?u+"":u,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index-BYCgXjDO.cjs"),i=require("./index-Cm7ZiBkR.cjs"),y=require("./Video-VbPJGhK0.cjs"),g=C.Quill.import("delta"),M=C.Quill.import("modules/clipboard"),T=/<table[\s>]/i,w=/(?:youtube\.com\/watch.*v=|youtu\.be\/)([a-zA-Z0-9_-]+)/,S=/vimeo\.com\/(\d+)/;function R(p){let u=Number.parseFloat(p.getAttribute("width")||String(i.tableUpSize.colDefaultWidth));if(Number.isNaN(u)){const t=p.style.width;u=t?Number.parseFloat(t):p.offsetWidth}return u}function E(p,u){const t=new Array(u).fill(i.tableUpSize.colDefaultWidth),e=Array.from(p.querySelectorAll("tr"));for(const o of e){const s=Array.from(o.querySelectorAll("td"));for(const[r,n]of s.entries()){if(r>=u)break;const l=R(n);t[r]=l||t[r]}}return t}class N extends M{constructor(t,e){super(t,e);d(this,"matchYouTubeLinkHandler",(t,e)=>this.matchYouTubeLink(t,e));d(this,"matchTableHandler",(t,e)=>this.matchTable(t,e));d(this,"matchColgroupHandler",(t,e)=>this.matchColgroup(t,e));d(this,"matchColHandler",t=>this.matchCol(t));d(this,"matchTrHandler",(t,e)=>this.matchTr(t,e));d(this,"matchTdHandler",(t,e)=>this.matchTd(t,e));d(this,"matchCaptionHandler",(t,e)=>this.matchCaption(t,e));d(this,"STYLE_PROPERTY_PREFIXES",["color","background","background-color","mso-pattern","border","border-color","border-top","border-right","border-bottom","border-left"]);d(this,"tableId",i.randomId());d(this,"rowId",i.randomId());d(this,"colIds",[]);d(this,"rowspanCount",[]);d(this,"cellCount",0);d(this,"colCount",0);this.quill=t,this.addMatcher("a",this.matchYouTubeLinkHandler),this.addMatcher("table",this.matchTableHandler),this.addMatcher("colgroup",this.matchColgroupHandler),this.addMatcher("col",this.matchColHandler),this.addMatcher("tr",this.matchTrHandler),this.addMatcher("td",this.matchTdHandler),this.addMatcher("th",this.matchTdHandler),this.addMatcher("caption",this.matchCaptionHandler)}matchYouTubeLink(t,e){const s=t.getAttribute("href")||"";if(w.test(s)||S.test(s)){const r=y.normalizeVideoUrl(s);return new g().insert({video:r}).insert(`
1
+ "use strict";var I=Object.defineProperty;var A=(p,u,t)=>u in p?I(p,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[u]=t;var d=(p,u,t)=>A(p,typeof u!="symbol"?u+"":u,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index-BMxbHpPm.cjs"),i=require("./index-Di0br3jn.cjs"),y=require("./Video-BKCZ-qD8.cjs"),g=C.Quill.import("delta"),M=C.Quill.import("modules/clipboard"),T=/<table[\s>]/i,w=/(?:youtube\.com\/watch.*v=|youtu\.be\/)([a-zA-Z0-9_-]+)/,S=/vimeo\.com\/(\d+)/;function R(p){let u=Number.parseFloat(p.getAttribute("width")||String(i.tableUpSize.colDefaultWidth));if(Number.isNaN(u)){const t=p.style.width;u=t?Number.parseFloat(t):p.offsetWidth}return u}function E(p,u){const t=new Array(u).fill(i.tableUpSize.colDefaultWidth),e=Array.from(p.querySelectorAll("tr"));for(const o of e){const s=Array.from(o.querySelectorAll("td"));for(const[r,n]of s.entries()){if(r>=u)break;const l=R(n);t[r]=l||t[r]}}return t}class N extends M{constructor(t,e){super(t,e);d(this,"matchYouTubeLinkHandler",(t,e)=>this.matchYouTubeLink(t,e));d(this,"matchTableHandler",(t,e)=>this.matchTable(t,e));d(this,"matchColgroupHandler",(t,e)=>this.matchColgroup(t,e));d(this,"matchColHandler",t=>this.matchCol(t));d(this,"matchTrHandler",(t,e)=>this.matchTr(t,e));d(this,"matchTdHandler",(t,e)=>this.matchTd(t,e));d(this,"matchCaptionHandler",(t,e)=>this.matchCaption(t,e));d(this,"STYLE_PROPERTY_PREFIXES",["color","background","background-color","mso-pattern","border","border-color","border-top","border-right","border-bottom","border-left"]);d(this,"tableId",i.randomId());d(this,"rowId",i.randomId());d(this,"colIds",[]);d(this,"rowspanCount",[]);d(this,"cellCount",0);d(this,"colCount",0);this.quill=t,this.addMatcher("a",this.matchYouTubeLinkHandler),this.addMatcher("table",this.matchTableHandler),this.addMatcher("colgroup",this.matchColgroupHandler),this.addMatcher("col",this.matchColHandler),this.addMatcher("tr",this.matchTrHandler),this.addMatcher("td",this.matchTdHandler),this.addMatcher("th",this.matchTdHandler),this.addMatcher("caption",this.matchCaptionHandler)}matchYouTubeLink(t,e){const s=t.getAttribute("href")||"";if(w.test(s)||S.test(s)){const r=y.normalizeVideoUrl(s);return new g().insert({video:r}).insert(`
2
2
  `)}return e}matchTable(t,e){if(e.ops.length===0)return e;const o=[],s=[];let r=-1;for(const[a,{attributes:c,insert:h}]of e.ops.entries()){const b={...c||{}};delete b.table,delete b[i.blotName.tableCell];const f=C.lodashExports.isObject(h)&&h[i.blotName.tableCol];f?s.push({insert:h}):o.push({attributes:b,insert:h}),!(b!=null&&b[i.blotName.tableCellInner])&&!f&&(r=a)}const l=E(t,this.colIds.length).reduce((a,c,h)=>s[h]?(a.push(s[h]),a):(a.push({insert:{[i.blotName.tableCol]:{tableId:this.tableId,colId:this.colIds[h],width:c,full:!0}}}),a),[]);return o.splice(r+1,0,...l),this.tableId=i.randomId(),this.colIds=[],this.rowspanCount=[],this.cellCount=0,this.colCount=0,new g(o)}matchColgroup(t,e){const o=[];for(const s of e.ops)s&&C.lodashExports.isObject(s.insert)&&s.insert[i.blotName.tableCol]&&o.push(s);return new g(o)}matchCol(t){this.colIds[this.colCount]=i.randomId();const e=new g().insert({[i.blotName.tableCol]:Object.assign(i.TableColFormat.value(t),{tableId:this.tableId,colId:this.colIds[this.colCount]})});return this.colCount+=1,e}matchTr(t,e){this.rowId=i.randomId(),this.cellCount=0;for(const[o,s]of this.rowspanCount.entries())s.rowspan>0&&(s.rowspan-=1),s.rowspan<=0&&(this.rowspanCount[o]={rowspan:0,colspan:0});return e}matchTd(t,e){const o=t,s=i.TableCellFormat.formats(o);if(!this.colIds[this.cellCount]||!this.rowspanCount[this.cellCount])for(let h=this.cellCount;h>=0;h--)this.colIds[h]||(this.colIds[h]=i.randomId()),this.rowspanCount[h]||(this.rowspanCount[h]={rowspan:0,colspan:0});const{colspan:r}=this.rowspanCount[this.cellCount];this.cellCount+=r,s.rowspan>0&&(this.rowspanCount[this.cellCount]={rowspan:s.rowspan,colspan:s.colspan});const n=this.colIds[this.cellCount];this.cellCount+=s.colspan;const l=Object.assign(s,{tableId:this.tableId,rowId:this.rowId,colId:n});this.handleBorderNoneStyles(o,l);const a=[];for(const h of e.ops){const{attributes:b={},...f}=h,m={...b};delete m[i.blotName.tableCell],a.push({...f,attributes:{...m,[i.blotName.tableCellInner]:l}})}const c=a.at(-1);return(a.length<=0||!C.lodashExports.isString(c==null?void 0:c.insert)||!c.insert.endsWith(`
3
3
  `))&&a.push({insert:`
4
4
  `,attributes:{[i.blotName.tableCellInner]:l}}),new g(a)}handleBorderNoneStyles(t,e){if(!(e!=null&&e.style))return;["border",...["top","right","bottom","left"].flatMap(r=>[`border-${r}`,`border-${r}-style`])].filter(r=>t.style.getPropertyValue(r)==="none").forEach(r=>{var n;e.style=(n=e.style)==null?void 0:n.replaceAll(new RegExp(`${r}:none;?`,"g"),"")})}convert({html:t,text:e},o){const s=(e==null?void 0:e.trim())??"";if(!t&&s&&(w.test(s)||S.test(s))){const l=y.normalizeVideoUrl(s);return new g().insert({video:l}).insert(`
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var f=(u,a,e)=>a in u?d(u,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[a]=e;var p=(u,a,e)=>f(u,typeof a!="symbol"?a+"":a,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-Cm7ZiBkR.cjs");class h extends g.default{constructor(){super(...arguments);p(this,"table");p(this,"tableSelection")}fixUnusuaDeletelTable(){}resolveCellsToMerge(e){const t=this.tableSelection.selectedTds||[],n=t.length>1?t:e;return!(n!=null&&n.length)||n.length<=1?null:n}tryGetMergeCellPosition(e,t,n){var c;if(!e||t.has(e))return null;t.add(e);const s=(c=e.parent)==null?void 0:c.domNode;if(!(s instanceof HTMLElement))return null;const r=n.get(e.rowId);if(r===void 0)return null;const l=e.getColumnIndex();if(l===-1)return null;const o=s.getBoundingClientRect();return o.width===0||o.height===0?null:{colIndex:l,colspan:e.colspan,rowIndex:r,rowspan:e.rowspan,td:e,visualLeft:o.left,visualTop:o.top}}pickEarlierVisualCell(e,t){return!e||t.visualTop<e.visualTop||t.visualTop===e.visualTop&&t.visualLeft<e.visualLeft?t:e}aggregateMergeCellPositions(e,t){const n=new Set,s=[];let r=null;for(const l of e){const o=this.tryGetMergeCellPosition(l,n,t);o&&(s.push(o),r=this.pickEarlierVisualCell(r,o))}return!r||s.length<=1?null:{basePosition:r,cellPositions:s}}applyMergedSpans(e,t,n){const s=Math.max(...n.map(i=>i.rowIndex+i.rowspan-1)),r=Math.max(...n.map(i=>i.colIndex+i.colspan-1)),l=t.td,o=s-t.rowIndex+1,c=r-t.colIndex+1;for(const i of n)i.td!==l&&(i.td.moveChildren(l),i.td.parent.remove());l.rowspan=o,l.colspan=c,this.fixTableByRemove(e)}mergeCells(e){if(!this.table||!this.tableSelection)return;const t=this.resolveCellsToMerge(e);if(!t)return;const n=g.findParentBlot(t[0],g.blotName.tableMain);if(!n)return;const s=n.getRows(),r=new Map(s.map((o,c)=>[o.rowId,c])),l=this.aggregateMergeCellPositions(t,r);l&&this.applyMergedSpans(n,l.basePosition,l.cellPositions)}}exports.default=h;
1
+ "use strict";var d=Object.defineProperty;var f=(u,a,e)=>a in u?d(u,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[a]=e;var p=(u,a,e)=>f(u,typeof a!="symbol"?a+"":a,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-Di0br3jn.cjs");class h extends g.default{constructor(){super(...arguments);p(this,"table");p(this,"tableSelection")}fixUnusuaDeletelTable(){}resolveCellsToMerge(e){const t=this.tableSelection.selectedTds||[],n=t.length>1?t:e;return!(n!=null&&n.length)||n.length<=1?null:n}tryGetMergeCellPosition(e,t,n){var c;if(!e||t.has(e))return null;t.add(e);const s=(c=e.parent)==null?void 0:c.domNode;if(!(s instanceof HTMLElement))return null;const r=n.get(e.rowId);if(r===void 0)return null;const l=e.getColumnIndex();if(l===-1)return null;const o=s.getBoundingClientRect();return o.width===0||o.height===0?null:{colIndex:l,colspan:e.colspan,rowIndex:r,rowspan:e.rowspan,td:e,visualLeft:o.left,visualTop:o.top}}pickEarlierVisualCell(e,t){return!e||t.visualTop<e.visualTop||t.visualTop===e.visualTop&&t.visualLeft<e.visualLeft?t:e}aggregateMergeCellPositions(e,t){const n=new Set,s=[];let r=null;for(const l of e){const o=this.tryGetMergeCellPosition(l,n,t);o&&(s.push(o),r=this.pickEarlierVisualCell(r,o))}return!r||s.length<=1?null:{basePosition:r,cellPositions:s}}applyMergedSpans(e,t,n){const s=Math.max(...n.map(i=>i.rowIndex+i.rowspan-1)),r=Math.max(...n.map(i=>i.colIndex+i.colspan-1)),l=t.td,o=s-t.rowIndex+1,c=r-t.colIndex+1;for(const i of n)i.td!==l&&(i.td.moveChildren(l),i.td.parent.remove());l.rowspan=o,l.colspan=c,this.fixTableByRemove(e)}mergeCells(e){if(!this.table||!this.tableSelection)return;const t=this.resolveCellsToMerge(e);if(!t)return;const n=g.findParentBlot(t[0],g.blotName.tableMain);if(!n)return;const s=n.getRows(),r=new Map(s.map((o,c)=>[o.rowId,c])),l=this.aggregateMergeCellPositions(t,r);l&&this.applyMergedSpans(n,l.basePosition,l.cellPositions)}}exports.default=h;
@@ -1,7 +1,7 @@
1
1
  var f = Object.defineProperty;
2
2
  var g = (u, a, e) => a in u ? f(u, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[a] = e;
3
3
  var p = (u, a, e) => g(u, typeof a != "symbol" ? a + "" : a, e);
4
- import d, { findParentBlot as h, blotName as m } from "./index-Dvi7lgdt.js";
4
+ import d, { findParentBlot as h, blotName as m } from "./index-DjWuJZt0.js";
5
5
  class C extends d {
6
6
  constructor() {
7
7
  super(...arguments);
@@ -1 +1 @@
1
- "use strict";var A=Object.defineProperty;var g=(s,t,e)=>t in s?A(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var c=(s,t,e)=>g(s,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-BYCgXjDO.cjs"),U=b.Quill.import("blots/block/embed"),w=b.Quill.import("formats/link"),h=["height","width"],T=new Set(h),l=new Map,u=new Map,y=[/(?:youtube\.com\/watch\?(?:.*&)?v=|youtu\.be\/)([a-z0-9_-]+)/i,/youtube\.com\/embed\/([a-z0-9_-]+)/i,/youtube\.com\/shorts\/([a-z0-9_-]+)/i],E=/vimeo\.com\/(?:video\/)?(\d+)/i;function m(s){if(u.has(s))return u.get(s)??null;const t=w.sanitize(s),e=!t||t==="about:blank"?null:t;return u.set(s,e),e}const f=s=>{const t=s.trim(),e=l.get(t);if(e)return e;for(const r of y){const i=r.exec(t);if(i!=null&&i[1]){const a=`https://www.youtube.com/embed/${i[1]}`;return l.set(t,a),a}}const o=E.exec(t);if(o!=null&&o[1]){const r=`https://player.vimeo.com/video/${o[1]}`;return l.set(t,r),r}return l.set(t,t),t},n=class n extends U{static create(t){const e=f(t),o=m(e)??m(t)??"about:blank",r=super.create(o);return r.setAttribute("frameborder","0"),r.setAttribute("allowfullscreen","true"),r.setAttribute("loading","lazy"),r.setAttribute("src",o),r}static formats(t){return h.reduce((e,o)=>(t.hasAttribute(o)&&(e[o]=t.getAttribute(o)),e),{})}static value(t){return t.getAttribute("src")??""}format(t,e){if(T.has(t)){e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t);return}super.format(t,e)}html(){const t=n.value(this.domNode),e=this.domNode.getAttribute("width"),o=this.domNode.getAttribute("height"),r=this.domNode.getAttribute("style"),i=this.domNode.getAttribute("loading");return`<iframe ${['class="ql-video"','frameborder="0"','allowfullscreen="true"',`src="${t}"`,e?`width="${e}"`:"",o?`height="${o}"`:"",r?`style="${r}"`:"",i?`loading="${i}"`:""].filter(Boolean).join(" ")}></iframe>`}};c(n,"blotName","video"),c(n,"className","ql-video"),c(n,"tagName","IFRAME");let d=n;exports.default=d;exports.normalizeVideoUrl=f;
1
+ "use strict";var A=Object.defineProperty;var g=(s,t,e)=>t in s?A(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var c=(s,t,e)=>g(s,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-BMxbHpPm.cjs"),U=b.Quill.import("blots/block/embed"),w=b.Quill.import("formats/link"),h=["height","width"],T=new Set(h),l=new Map,u=new Map,y=[/(?:youtube\.com\/watch\?(?:.*&)?v=|youtu\.be\/)([a-z0-9_-]+)/i,/youtube\.com\/embed\/([a-z0-9_-]+)/i,/youtube\.com\/shorts\/([a-z0-9_-]+)/i],E=/vimeo\.com\/(?:video\/)?(\d+)/i;function m(s){if(u.has(s))return u.get(s)??null;const t=w.sanitize(s),e=!t||t==="about:blank"?null:t;return u.set(s,e),e}const f=s=>{const t=s.trim(),e=l.get(t);if(e)return e;for(const r of y){const i=r.exec(t);if(i!=null&&i[1]){const a=`https://www.youtube.com/embed/${i[1]}`;return l.set(t,a),a}}const o=E.exec(t);if(o!=null&&o[1]){const r=`https://player.vimeo.com/video/${o[1]}`;return l.set(t,r),r}return l.set(t,t),t},n=class n extends U{static create(t){const e=f(t),o=m(e)??m(t)??"about:blank",r=super.create(o);return r.setAttribute("frameborder","0"),r.setAttribute("allowfullscreen","true"),r.setAttribute("loading","lazy"),r.setAttribute("src",o),r}static formats(t){return h.reduce((e,o)=>(t.hasAttribute(o)&&(e[o]=t.getAttribute(o)),e),{})}static value(t){return t.getAttribute("src")??""}format(t,e){if(T.has(t)){e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t);return}super.format(t,e)}html(){const t=n.value(this.domNode),e=this.domNode.getAttribute("width"),o=this.domNode.getAttribute("height"),r=this.domNode.getAttribute("style"),i=this.domNode.getAttribute("loading");return`<iframe ${['class="ql-video"','frameborder="0"','allowfullscreen="true"',`src="${t}"`,e?`width="${e}"`:"",o?`height="${o}"`:"",r?`style="${r}"`:"",i?`loading="${i}"`:""].filter(Boolean).join(" ")}></iframe>`}};c(n,"blotName","video"),c(n,"className","ql-video"),c(n,"tagName","IFRAME");let d=n;exports.default=d;exports.normalizeVideoUrl=f;
@@ -1,7 +1,7 @@
1
1
  var f = Object.defineProperty;
2
2
  var A = (s, t, e) => t in s ? f(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
3
  var c = (s, t, e) => A(s, typeof t != "symbol" ? t + "" : t, e);
4
- import { Q as b } from "./index-rdk4wV0l.js";
4
+ import { Q as b } from "./index-CNlXRCGl.js";
5
5
  const g = b.import("blots/block/embed"), U = b.import("formats/link"), h = ["height", "width"], w = new Set(h), a = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), p = [/(?:youtube\.com\/watch\?(?:.*&)?v=|youtu\.be\/)([a-z0-9_-]+)/i, /youtube\.com\/embed\/([a-z0-9_-]+)/i, /youtube\.com\/shorts\/([a-z0-9_-]+)/i], E = /vimeo\.com\/(?:video\/)?(\d+)/i;
6
6
  function d(s) {
7
7
  if (u.has(s)) return u.get(s) ?? null;