1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e038ece8-ea63-5b19-8d16-5d0903664144")}catch(e){}}(); 3(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8193],{58919(Q,H,y){"use strict";y.d(H,{P:()=>k});var R=y(79748),T=y(18891),I=y(76925),l=y(28624),E=y(34456),M=y(8137),L=y(44436);let k=(()=>{class x{static \u0275fac=function(b){return new(b||x)};static \u0275mod=L.$C({type:x});static \u0275inj=M.G2t({imports:[R.MD,T.bv,E.YN,E.X1,I.E,l.Qs.forRoot()]})}return x})()},25128(Q,H,y){"use strict";y.d(H,{x:()=>Et});var R=y(58839),T=y(51550),I=y(95386);class l{formatter;toolbarButtons=[];debug;constructor(o){this.formatter=o,this.debug=this.formatter.options.debug||!1,this.debug&&console.debug("Action created:",this.constructor.name)}onCreate=()=>{};onDestroy=()=>{};onUpdate=()=>{}}let E=(()=>{class g extends l{static sendCaretBack=(t=1,e=!1)=>{const i=window.getSelection();if(i&&i.rangeCount>0){const n=i.getRangeAt(0),a=n.startContainer,u=n.startOffset;if(u>0)n.setStart(a,u-t);else if(a.previousSibling){const w=a.previousSibling;w.nodeType===Node.TEXT_NODE&&n.setStart(w,w.textContent?.length||0)}n.collapse(!0),i.removeAllRanges(),i.addRange(n),e&&console.debug("Caret moved back by",t,"characters")}};static placeCaretBeforeBlot=(t,e,i=!1)=>{const n=t.getIndex(e);t.setSelection(n,0,"user"),i&&console.debug("Caret placed before blot at index:",n,e)};static placeCaretAfterBlot=(t,e,i=!1)=>{t.setSelection(null),t.root.focus();const n=t.getIndex(e),a=t.getLength();n+1>=a-1?(t.setSelection(a-1,0,"user"),i&&console.debug("Caret placed at the end of the document after blot:",e)):(i&&console.debug("Caret placed after character following blot at index:",n,e),t.setSelection(n+2,0,"user"),this.sendCaretBack(1,i))};onCreate=()=>{document.addEventListener("keyup",this.onKeyUp),this.formatter.quill.root.addEventListener("input",this.onKeyUp)};onDestroy=()=>{document.removeEventListener("keyup",this.onKeyUp),this.formatter.quill.root.removeEventListener("input",this.onKeyUp)};onKeyUp=t=>{const e=!!document.querySelector("[data-blot-formatter-modal]");if(!this.formatter.currentSpec||e)return;const i=this.formatter.currentSpec.getTargetBlot();i&&("ArrowLeft"===t.code?(g.placeCaretBeforeBlot(this.formatter.quill,i,this.debug),this.formatter.hide()):"ArrowRight"===t.code&&(g.placeCaretAfterBlot(this.formatter.quill,i,this.debug),this.formatter.hide()))}}return g})();function M(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var L,k;const c=M(function x(){if(k)return L;k=1;var g=function(C){return function o(C){return!!C&&"object"==typeof C}(C)&&!function t(C){var B=Object.prototype.toString.call(C);return"[object RegExp]"===B||"[object Date]"===B||function n(C){return C.$$typeof===i}(C)}(C)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function u(C,B){return!1!==B.clone&&B.isMergeableObject(C)?G(function a(C){return Array.isArray(C)?[]:{}}(C),C,B):C}function w(C,B,N){return C.concat(B).map(function(V){return u(V,N)})}function P(C){return Object.keys(C).concat(function q(C){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(C).filter(function(B){return Object.propertyIsEnumerable.call(C,B)}):[]}(C))}function $(C,B){try{return B in C}catch{return!1}}function G(C,B,N){(N=N||{}).arrayMerge=N.arrayMerge||w,N.isMergeableObject=N.isMergeableObject||g,N.cloneUnlessOtherwiseSpecified=u;var V=Array.isArray(B);return V===Array.isArray(C)?V?N.arrayMerge(C,B,N):function U(C,B,N){var V={};return N.isMergeableObject(C)&&P(C).forEach(function(W){V[W]=u(C[W],N)}),P(B).forEach(function(W){(function j(C,B){return $(C,B)&&!(Object.hasOwnProperty.call(C,B)&&Object.propertyIsEnumerable.call(C,B))})(C,W)||(V[W]=$(C,W)&&N.isMergeableObject(B[W])?function O(C,B){if(!B.customMerge)return G;var N=B.customMerge(C);return"function"==typeof N?N:G}(W,N)(C[W],B[W],N):u(B[W],N))}),V}(C,B,N):u(B,N)}return G.all=function(C,B){if(!Array.isArray(C))throw new Error("first argument should be an array");return C.reduce(function(N,V){return G(N,V,B)},{})},L=G}());class b{formatter;element;buttons={};constructor(o){this.formatter=o,this.element=document.createElement("div"),this.element.classList.add(this.formatter.options.toolbar.mainClassName),this.element.addEventListener("mousedown",t=>{t.stopPropagation()}),this.formatter.options.toolbar.mainStyle&&Object.assign(this.element.style,this.formatter.options.toolbar.mainStyle)}create=()=>{const o=[];this.formatter.actions.forEach(t=>
3{t.toolbarButtons.forEach(e=>{this.buttons[e.action]=e,o.push(e.create())})}),this.element.append(...o),this.formatter.overlay.append(this.element),this.formatter.options.debug&&console.debug("Toolbar created with buttons:",Object.keys(this.buttons),o)};destroy=()=>{this.element&&this.formatter.overlay.removeChild(this.element);for(const o of Object.values(this.buttons))o.destroy();this.buttons={},this.element.innerHTML="",this.formatter.options.debug&&console.debug("Toolbar destroyed")}}let m=(()=>{class g{constructor(t,e=!1){this.quill=t,this.debug=e;const i=t.container.querySelector(".ql-tooltip");console.debug("tooltip:",i),i?(g.watchTooltip(t,e),e&&console.debug("Tooltip watcher initialized for:",i)):console.warn("No tooltip found to watch for adjustments.")}quill;debug;static _repositionTooltip=(t,e,i=!1)=>{const n=t.getBoundingClientRect(),a=e.getBoundingClientRect();let u=n.left-a.left,w=n.top-a.top;const O=n.width,q=n.height,P=e.clientWidth,$=e.clientHeight;let j=!1;const U={};w<0&&(U.top=`${n.height}px`,j=!0),w+q>$&&(U.top=$-q+"px",j=!0),u<0&&(U.left="0px",j=!0),u+O>P&&(U.left=P-O+"px",j=!0),j?(i&&console.debug("Repositioning tooltip",U),void 0!==U.top&&(t.style.top=U.top),void 0!==U.left&&(t.style.left=U.left),t.classList.contains("ql-flip")&&t.classList.remove("ql-flip")):i&&console.debug("Tooltip position is fine, no changes needed")};static observers=new WeakMap;static watchTooltip(t,e=!1){const i=t.container.querySelector(".ql-tooltip"),n=t.container;if(!i)return void console.warn("No tooltip found to watch for adjustments.");this.removeTooltipWatcher(i,e);let a=!1;const u=new MutationObserver(w=>{if(!a){if(e)for(const O of w)console.debug("Tooltip mutation:",O.attributeName,i.getAttribute(O.attributeName));a=!0,this._repositionTooltip(i,n,e),setTimeout(()=>{a=!1},0)}});u.observe(i,{attributes:!0,attributeFilter:["style","class"]}),this.observers.set(i,u)}static removeTooltipWatcher(t,e=!1){let i=null;i=t instanceof HTMLDivElement?t:t.container.querySelector(".ql-tooltip"),i&&this.observers.has(i)&&(this.observers.get(i)?.disconnect(),this.observers.delete(i),e&&console.debug("Tooltip watcher removed for:",i))}destroy=()=>{this.quill.container.querySelector(".ql-tooltip")&&(g.removeTooltipWatcher(this.quill,this.debug),this.debug&&console.debug("Tooltip watcher removed on destroy"))}}return g})();const h=g=>{const o=g.import("formats/image"),t=["alt","height","width","title"];return class extends o{static blotName="image";static formats(e){return t.reduce((i,n)=>(e.hasAttribute(n)&&(i[n]=e.getAttribute(n)),i),{})}format(e,i){t.indexOf(e)>-1?i||"alt"===e?this.domNode.setAttribute(e,i):this.domNode.removeAttribute(e):super.format(e,i)}}},d=g=>{const o=g.import("parchment"),{ClassAttributor:t,Scope:e}=o;return class extends t{constructor(i=!1){super("iframeAlign","ql-iframe-align",{scope:e.BLOCK,whitelist:["left","center","right"]}),this.debug=i}debug;static attrName="iframeAlign";add(i,n){if(this.debug&&console.debug("IframeAlignAttributor.add",i,n),i instanceof HTMLElement){"object"==typeof n?(super.add(i,n.align),i.dataset.blotAlign=n.align):(super.add(i,n),i.dataset.blotAlign=n);let a=i.getAttribute("width");return a?(isNaN(Number(a.trim().slice(-1)))||(a=`${a}px`),i.style.setProperty("--resize-width",a),i.dataset.relativeSize=`${a.endsWith("%")}`):(i.style.removeProperty("--resize-width"),i.dataset.relativeSize="false"),this.debug&&console.debug("IframeAlignAttributor.add - node:",i,"aligned with:",n),!0}return this.debug&&console.debug("IframeAlignAttributor.add - node is not an HTMLElement, skipping alignment"),!1}remove(i){this.debug&&console.debug("IframeAlignAttributor.remove",i),i instanceof HTMLElement&&(super.remove(i),delete i.dataset.blotAlign)}value(i){const n=super.value(i),a=i instanceof HTMLElement&&(i.style.getPropertyValue("--resize-width")||i.getAttribute("width"))||"",u={align:n,width:a,relativeSize:`${a.endsWith("%")}`};return this.debug&&console.debug("IframeAlignAttributor.value",i,u),u}}},s=g=>{const o=g.import("parchment"),{ClassAttributor:t,Scope:e}=o;return class extends t{constructor(i=!1){super("imageAlign","ql-image-align",{scope:e.INLINE,whitelist:["left","center","right"]}),this.debug=i}debug;static tagName="SPAN";static attrName="imageAlign";add(i,n){if(this.debug&&console.debug("ImageAlignAttributor.add",i,n),i instanceof HTMLSpanElement&&n){let a=i.querySelector("img");if("object"==typeof n&&n.align)super.add(i,n.align),i.setAttribute("contenteditable","false"),n.title?i.setAttribute("data-title",n.title):i.removeAttribute("data-title"),n.align&&(a.dataset.blotAlign=n.align),this.debug&&console.debug("ImageAlignAttributor.add - imageElement:",a,"aligned with:",n.align);else{if("string"!=typeof n)return this.debug&&console.debug("ImageAlignAttributor.add - no value provided, skipping alignment"),!1;super.add(i,n),a.dataset.blotAlign=n,this.debug&&console.debug("ImageAlignAttributor.add - imageElement:",a,"aligned with:",n)}let u=this.getImageWidth(a);return i.setAttribute("data-relative-size",`${u?.endsWith("%")}`),!0}{const a=i instanceof HTMLImageElement?i:i.querySelector("img");if(this.debug&&console.debug(`ImageAlignAttributor.add - ${i.tagName}
3 is not a span, checking for image:`,a),a instanceof HTMLImageElement){const u=g.find(a);return this.debug&&console.debug("ImageAlignAttributor.add - found image blot:",u),u&&(i.firstChild instanceof HTMLSpanElement||!a.parentElement?.matches('span[class^="ql-image-align-"]'))&&(u.format("imageAlign",n),this.debug&&console.debug("ImageAlignAttributor.add - reapplying imageAlign format to image blot:",n,u)),!0}return!1}}remove(i){this.debug&&console.debug("ImageAlignAttributor.remove",i),i instanceof HTMLElement&&(super.remove(i),i.firstChild&&i.firstChild instanceof HTMLElement&&delete i.firstChild.dataset.blotAlign)}value(i){const n=i.querySelector("img");if(!n)return null;const u=super.value(n.parentElement),w=n.getAttribute("title")||"";let O=n.getAttribute("width")||"";parseFloat(O)||(n.complete?O=this.getImageWidth(n):n.onload=P=>{O=this.getImageWidth(P.target)});const q={align:u,title:w,width:O,contenteditable:"false",relativeSize:`${O.endsWith("%")}`};return this.debug&&console.debug("ImageAlignAttributor.value",i,q),q}getImageWidth(i){let n=i.getAttribute("width");return n?isNaN(Number(n.trim().slice(-1)))||(n=`${n}px`,i.setAttribute("width",n)):(n=`${i.naturalWidth}px`,i.setAttribute("width",n)),i.parentElement.style.setProperty("--resize-width",n),n}}},p=g=>{const o=g.import("formats/video");return class extends o{static blotName="video";static aspectRatio="16 / 9 auto";static create(t){const e=super.create(t);return e.setAttribute("width","100%"),e.style.aspectRatio=this.aspectRatio,e}html(){return this.domNode.outerHTML}}};class v{alignments={};options;formatter;debug;Scope;constructor(o){this.formatter=o,this.debug=o.options.debug??!1;const t=o.Quill.import("parchment");this.Scope=t.Scope,this.options=o.options,this.options.align.alignments.forEach(e=>{this.alignments[e]={name:e,apply:i=>{this.setAlignment(i,e)}}}),this.debug&&console.debug("DefaultAligner created with alignments:",this.alignments)}getAlignments=()=>Object.keys(this.alignments).map(o=>this.alignments[o]);clear=o=>{null!=o&&("IMG"===o.domNode.tagName?null!==o.parent&&"SPAN"===o.parent.domNode.tagName&&(o.parent.format(this.formatter.ImageAlign.attrName,!1),this.debug&&console.debug("Cleared image alignment from parent span:",o.parent)):"IFRAME"===o.domNode.tagName&&(o.format(this.formatter.IframeAlign.attrName,!1),this.debug&&console.debug("Cleared iframe alignment:",o)))};isInlineBlot=o=>(o.statics?.scope&this.Scope.INLINE)===this.Scope.INLINE_BLOT;isBlockBlot=o=>(o.statics?.scope&this.Scope.BLOCK)===this.Scope.BLOCK_BLOT;hasInlineScope=o=>(o.statics.scope&this.Scope.INLINE)===this.Scope.INLINE;hasBlockScope=o=>(o.statics.scope&this.Scope.BLOCK)===this.Scope.BLOCK;isAligned=(o,t)=>{const e=this.getAlignment(o);return t?e===t.name:!!e};getAlignment=o=>o.domNode.dataset.blotAlign;setAlignment=(o,t)=>{if(null===o)return void(this.debug&&console.debug("DefaultAligner.setAlignment called with null blot, no action taken"));const e=this.isAligned(o,this.alignments[t]);if(this.debug&&console.debug("hasAlignment",e),this.clear(o),!e)if(this.isInlineBlot(o)||this.hasInlineScope(o)){if(this.debug&&console.debug("setting alignment",this.isInlineBlot(o)||this.hasInlineScope(o)),!o.domNode.getAttribute("width")&&this.options.resize.useRelativeSize&&!this.options.resize.allowResizeModeChange)try{const i=getComputedStyle(this.formatter.quill.root),n=this.formatter.quill.root.clientWidth-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight);o.domNode.setAttribute("width",`${Math.min(Math.round(100*o.domNode.naturalWidth/n),100)}%`)}catch{this.debug&&console.debug("DefaultAligner.setAlignment Error setting image width:",o)}this.debug&&console.debug("DefaultAligner.setAlignment formatting image with",this.formatter.ImageAlign.attrName,{align:this.alignments[t].name,title:o.domNode.getAttribute("title")||""}),o.format(this.formatter.ImageAlign.attrName,{align:this.alignments[t].name,title:o.domNode.getAttribute("title")||""});try{const i=this.formatter.quill.getContents().ops;2===i.length&&"\n"===i[1].insert&&this.formatter.quill.insertText(this.formatter.quill.getLength(),"\n","user")}catch{}}else(this.isBlockBlot(o)||this.hasBlockScope(o))&&(this.debug&&console.debug("DefaultAligner.setAlignment formatting iframe with",this.formatter.IframeAlign.attrName,{align:this.alignments[t].name}),o.format(this.formatter.IframeAlign.attrName,this.alignments[t].name))}}class A{action;icon;onClick;options;element=null;initialVisibility=!0;constructor(o,t,e){this.action=o,this.icon=e.icons[o],this.onClick=t,this.options=e}create=()=>(this.element=document.createElement("span"),this.element.innerHTML=this.icon,this.element.className=this.options.buttonClassName,this.element.dataset.action=this.action,this.element.onclick=this.onClick,this.options.tooltips&&this.options.tooltips[this.action]&&(this.element.title=this.options.tooltips[this.action]),this.selected=this.preselect(),this.visible=this.initialVisibility,this._styleButton(),this.element);destroy=()=>{this.element&&(this.element.onclick=null,this.element.remove(),this.element=null)};preselect=()=>!1;get selected(){return"true"===this.element?.dataset.selected}set selected(o){this.element&&(this.element.dataset.selected=o.toString(),o?(this.element.classList.add(this.options.buttonSelectedClassName),this.options.buttonSelectedStyle&&Object.assign(this.element.style,this.options.buttonSelectedStyle)):(this.element.classList.remove(this.options.buttonSelectedClassName),this.options.buttonSelectedStyle&&(this.element.removeAttribute("style"),this.options.buttonStyle&&Object.assign(this.element.style,this.options.buttonStyle))))}get visible(){return"none"!==this.element?.style.display}set visible(o){this.element&&("boolean"==typeof o&&(o=o?"inline-block":"none"),this.element.style.display=o)}_styleButton=()=>
vendor: 1,480 bytes, line 3
3{if(this.element&&(this.options.buttonStyle&&Object.assign(this.element.style,this.options.buttonStyle),this.options.svgStyle)){const o=this.element.children[0];o&&Object.assign(o.style,this.options.svgStyle)}}}class f extends l{aligner;alignButtons={};constructor(o){super(o),this.aligner=new v(o),o.options.debug&&console.debug("AlignAction Aligner created:",this.aligner)}_createAlignmentButtons=()=>{for(const t of Object.values(this.aligner.alignments))this.alignButtons[t.name]=new A(t.name,this.onClickHandler,this.formatter.options.toolbar);const o=this.formatter.currentSpec?.getTargetBlot();if(o){const t=this.aligner.getAlignment(o);t&&this.alignButtons[t]&&(this.alignButtons[t].preselect=()=>!0),this.debug&&(console.debug("AlignAction alignment buttons created:",this.alignButtons),console.debug("Blot alignment on load:",t))}};_clearButtons=()=>{for(const o of Object.values(this.alignButtons))o.selected=!1;this.debug&&console.debug("AlignAction alignment buttons cleared")};onClickHandler=o=>{const t=o.target.closest(`span.${this.formatter.options.toolbar.buttonClassName}`);if(t){const e=t.dataset.action||"",i=this.formatter.currentSpec?.getTargetBlot();if(e&&i){const n=this.aligner.alignments[e];this._clearButtons(),this.aligner.isAligned(i,n)?(this.aligner.clear(i),this.debug&&console.debug("AlignAction clear alignment:",e,i)):(this.aligner.setAlignment(i,e),this.alignButtons[e].selected=!0,this.debug&&console.debug("AlignAction set alignment:",e,i))}}
3this.formatter.update()};onCreate=()=>{this._createAlignmentButtons(),this.toolbarButtons=Object.values(this.alignButtons),this.formatter.options.debug&&console.debug("AlignAction alignment buttons created:",this.toolbarButtons)};onDestroy=()=>{this.alignButtons={},this.toolbarButtons=[],this.formatter.options.debug&&console.debug("AlignAction alignment buttons destroyed")}}class D extends l{onCreate=()=>{document.addEventListener("keyup",this._onKeyUp),this.formatter.quill.root.addEventListener("input",this._onKeyUp)};onDestroy=()=>{document.removeEventListener("keyup",this._onKeyUp),this.formatter.quill.root.removeEventListener("input",this._onKeyUp)};_onKeyUp=o=>{const t=!!document.querySelector("[data-blot-formatter-modal]");if(this.formatter.currentSpec&&!t&&("Delete"===o.code||"Backspace"===o.code)){this.debug&&console.debug("DeleteAction keyup detected:",o.code);const e=this.formatter.currentSpec.getTargetElement();if(e){const i=this.formatter.Quill.find(e);if(i){const n=this.formatter.quill.getIndex(i);this.formatter.quill.deleteText(n,1,"user")}}this.formatter.hide()}}}class z extends l{_topLeftHandle;_topRightHandle;_bottomRightHandle;_bottomLeftHandle;_dragHandle=null;_dragStartX=0;_dragCursorStyle;_preDragWidth=0;_pinchStartDistance=0;_calculatedAspectRatio=0;_computedAspectRatio=void 0;_target;_editorStyle;_editorWidth=0;_useRelativeSize;_resizeModeButton=null;_isUnclickable=!1;_hasResized=!1;_formattedWidth="";_sizeInfoTimerId=null;_isImage=!1;_isSVG=!1;_naturalWidth=void 0;constructor(o){super(o),this._topLeftHandle=this._createHandle("top-left","nwse-resize"),this._topRightHandle=this._createHandle("top-right","nesw-resize"),this._bottomRightHandle=this._createHandle("bottom-right","nwse-resize"),this._bottomLeftHandle=this._createHandle("bottom-left","nesw-resize"),this._dragCursorStyle=document.createElement("style"),this._useRelativeSize=this.formatter.options.resize.useRelativeSize,o.options.resize.allowResizeModeChange&&(this._resizeModeButton=this._createResizeModeButton(),this.toolbarButtons=[this._resizeModeButton])}onCreate=()=>{this._target=this.formatter.currentSpec?.getTargetElement(),this._isUnclickable=this.formatter.currentSpec?.isUnclickable||!1,this._isImage=this._target instanceof HTMLImageElement,this._isImage&&(this._isSVG=this._isSvgImage()),this.formatter.overlay.append(this._topLeftHandle,this._topRightHandle,this._bottomRightHandle,this._bottomLeftHandle),this.formatter.overlay.addEventListener("mousedown",this._onOverlayMouseDown),this.formatter.overlay.addEventListener("mouseup",this._onOverlayMouseUp);const o={passive:!1};this.formatter.overlay.addEventListener("touchstart",this._onOverlayTouchStart,o),this.formatter.overlay.addEventListener("touchmove",this._onOverlayTouchMove,o),this.formatter.overlay.addEventListener("touchend",this._onOverlayTouchEnd,o),this._repositionHandles(this.formatter.options.resize.handleStyle||{}),this.debug&&console.debug("ResizeAction created with target:",this._target,"isUnclickable:",this._isUnclickable)};onDestroy=()=>{this._target=null,this._isUnclickable=!1,this._isImage=!1,this._naturalWidth=void 0,this._isSVG=!1,this._setCursor(""),[this._topLeftHandle,this._topRightHandle,this._bottomRightHandle,this._bottomLeftHandle].forEach(t=>{t.remove()}),this.formatter.overlay.removeEventListener("mousedown",this._onOverlayMouseDown),this.formatter.overlay.removeEventListener("mouseup",this._onOverlayMouseUp);const o={passive:!1};this.formatter.overlay.removeEventListener("touchstart",this._onOverlayTouchStart,o),this.formatter.overlay.removeEventListener("touchmove",this._onOverlayTouchMove,o),this.formatter.overlay.removeEventListener("touchend",this._onOverlayTouchEnd,o),this.formatter.update(
3)};_createHandle=(o,t)=>{const e=document.createElement("div");return e.classList.add(this.formatter.options.resize.handleClassName),e.setAttribute("data-position",o),e.style.cursor=t,this.formatter.options.resize.handleStyle&&Object.assign(e.style,this.formatter.options.resize.handleStyle),e.addEventListener("pointerdown",this._onHandlePointerDown),e};_repositionHandles=o=>{const t=o?.width?-parseFloat(o.width)/2+"px":"0px",e=o?.height?-parseFloat(o.height)/2+"px":"0px",{style:i}=this._topLeftHandle;i.left=t,i.top=e;const{style:n}=this._topRightHandle;n.right=t,n.top=e;const{style:a}=this._bottomRightHandle;a.right=t,a.bottom=e;const{style:u}=this._bottomLeftHandle;u.left=t,u.bottom=e};_setCursor=o=>{if(document.body)try{o?(this._dragCursorStyle.innerHTML=`body, body * { cursor: ${o} !important; }`,document.head.contains(this._dragCursorStyle)||document.head.appendChild(this._dragCursorStyle)):document.head.contains(this._dragCursorStyle)&&document.head.removeChild(this._dragCursorStyle)}catch(t){console.error("ResizeAction: Error setting cursor style:",t)}else console.warn("ResizeAction: Cannot set cursor - document.body is null")};_resizeMode=o=>{if(o){if(this._hasResized=!1,this._formattedWidth="",this._target){this._useRelativeSize=this.formatter._useRelative(this._target),this._editorStyle=getComputedStyle(this.formatter.quill.root),this._editorWidth=this.formatter.quill.root.clientWidth-parseFloat(this._editorStyle.paddingLeft)-parseFloat(this._editorStyle.paddingRight);const t=this._target.getBoundingClientRect();if((void 0===t.height||0===t.height)&&(t.height=this._target.clientHeight+1),this._preDragWidth=t.width,this._computedAspectRatio=getComputedStyle(this._target).aspectRatio||"auto",this._calculatedAspectRatio=t.width/t.height,this._useRelativeSize)this._isUnclickable&&"auto"===this._computedAspectRatio&&(this._target.style.aspectRatio=this.formatter.options.video.defaultAspectRatio,console.warn(`No iframe aspect-ratio set. Set an aspect ratio either via custom blot or css.\nUsing temporary aspect ratio "${this.formatter.options.video.defaultAspectRatio}"`));else if(this._isUnclickable&&"auto"!==this._computedAspectRatio){const e=this._computedAspectRatio.match(/(\d+)\s*\/\s*(\d+)/);if(e)try{this._calculatedAspectRatio=parseFloat(e[1])/parseFloat(e[2])}catch{}}this._isImage&&!this._useRelativeSize&&!this._isSVG&&this.formatter.options.resize.imageOversizeProtection&&(this._naturalWidth=this._target.naturalWidth),this._showSizeInfo(!0,t.width,t.height),this.debug&&console.debug("ResizeAction resize mode activated:",{target:this._target,useRelativeSize:this._useRelativeSize,editorWidth:this._editorWidth,preDragWidth:this._preDragWidth,aspectRatio:this._calculatedAspectRatio,computedAspectRatio:this._computedAspectRatio})}}else{if(this._target&&this._hasResized){let t=this._roundDimension(this._formattedWidth);this._target.setAttribute("width",t),this.formatter.toolbar.buttons.resizeMode&&(this.formatter.toolbar.buttons.resizeMode.selected=this.isRelative),this._isUnclickable?(this._target.style.setProperty("--resize-width",`${t}`),this._target.dataset.relativeSize=`${this.isRelative}`):this.isAligned&&this._target.parentElement&&(this._target.parentElement.style.setProperty("--resize-width",`${t}`),this._target.parentElement.dataset.relativeSize=`${this.isRelative}`),this.debug&&console.debug("ResizeAction resize mode deactivated:",{target:this._target,width:t,isRelative:this.isRelative,isAligned:this.isAligned})}
3this._naturalWidth=void 0,this.formatter.update(),this._showSizeInfo(!1)}};_onHandlePointerDown=o=>{this._resizeMode(!0),o.target instanceof HTMLElement&&this._target&&(this._dragHandle=o.target,this._setCursor(this._dragHandle.style.cursor),this._dragStartX=o.clientX,document.addEventListener("pointermove",this._onHandleDrag),document.addEventListener("pointerup",this._onHandlePointerUp))};_onHandleDrag=o=>{if(!this._target||!this._dragHandle)return;this._hasResized=!0;const t=o.clientX-this._dragStartX,i=Math.round(this._dragHandle===this._topLeftHandle||this._dragHandle===this._bottomLeftHandle?this._preDragWidth-t:this._preDragWidth+t),n=Math.max(Math.min(i,this._editorWidth),this.formatter.options.resize.minimumWidthPx);this._resizeTarget(n)};_onHandlePointerUp=()=>{this._setCursor(""),this._resizeMode(!1),document.removeEventListener("pointermove",this._onHandleDrag),document.removeEventListener("pointerup",this._onHandlePointerUp)};_onOverlayTouchStart=o=>{o.target===this.formatter.overlay&&(this._resizeMode(!0),this._target&&2===o.touches.length&&(o.preventDefault(),this._pinchStartDistance=this._calculateDistance(o.touches[0],o.touches[1]),this._preDragWidth=this._target.clientWidth))};_onOverlayTouchMove=o=>{if(o.target===this.formatter.overlay&&this._target&&2===o.touches.length&&null!==this._pinchStartDistance&&null!==this._preDragWidth&&(o.preventDefault(),this._target)){this._hasResized=!0;const t=this._calculateDistance(o.touches[0],o.touches[1])/this._pinchStartDistance;let e=Math.round(this._preDragWidth*t);e=Math.max(Math.min(e,this._editorWidth),10),this._resizeTarget(e)}};_onOverlayTouchEnd=o=>{o.target===this.formatter.overlay&&this._resizeMode(!1)};_onOverlayMouseDown=o=>{o.target===this.formatter.overlay&&this._resizeMode(!0)};_onOverlayMouseUp=o=>{o.target===this.formatter.overlay&&this._resizeMode(!1)};_resizeTarget=o=>{if(this._target)try{const t=(o=Math.min(this._naturalWidth??1/0,o))/this._calculatedAspectRatio;this._updateSizeInfo(o,t),this._formattedWidth=this.formatter._useRelative(this._target)?100*o/this._editorWidth+"%":`${o}px`,this._target.setAttribute("width",this._formattedWidth),this._target.setAttribute("height","auto"),this._isUnclickable?(!this._useRelativeSize&&"auto"===this._computedAspectRatio&&this._target.setAttribute("height",(0|t)+"px"),this._target.style.setProperty("--resize-width",this._formattedWidth)):(this.isAligned&&this._target.parentElement&&this._target.parentElement.style.setProperty("--resize-width",this._formattedWidth),!this._useRelativeSize&&!this.formatter.options.image.autoHeight&&this._target.setAttribute("height",(0|t)+"px")),this.formatter.update(
3)}catch(t){console.error("ResizeAction: Error resizing target element:",t)}else console.warn("ResizeAction: Cannot resize - target element is null")};_showSizeInfo=(o,t=null,e=null)=>{o?(this._cancelSizeInfoTimer(),null!==t&&null!==e&&this._updateSizeInfo(t,e),this.formatter.sizeInfo.style.transition="",this.formatter.sizeInfo.style.opacity="1"):this._closeSizeInfo()};_updateSizeInfo=(o,t)=>{let n=`${Math.round(o)} x ${Math.round(t)}px`;if(this.isRelative)n=`${Math.round(100*o/this._editorWidth)}% (${n})`;else if(!this._hasResized&&this._target){const a=this._target.getAttribute("width");if(a){const u=parseFloat(a);u!==o&&(n=`${a} x ${Math.round(u/(o/t))}px (${n})`)}else if(this._target instanceof HTMLImageElement){const{naturalWidth:u,naturalHeight:w}=this._target;u!==o&&(n=`${u} x ${w}px (${n})`)}}this.formatter.sizeInfo.innerText=n};get isRelative(){return this._target?.getAttribute("width")?.endsWith("%")||!1}get isAligned(){return!!this._target&&this._target.hasAttribute("data-blot-align")}_createResizeModeButton=()=>{const o=new A("resizeMode",this._onResizeModeClickHandler,this.formatter.options.toolbar);return o.preselect=()=>this.isRelative,o};_onResizeModeClickHandler=o=>{o.stopImmediatePropagation(),this._swapResizeMode(!0)};_swapResizeMode=(o=!1)=>{if(this._target){const t=this._target.getBoundingClientRect();let e,i;this._editorStyle=getComputedStyle(this.formatter.quill.root),this._editorWidth=this.formatter.quill.root.clientWidth-parseFloat(this._editorStyle.paddingLeft)-parseFloat(this._editorStyle.paddingRight),this.isRelative?(e=`${Math.round(t.width)}px`,i=this.formatter.options.image.autoHeight?"auto":`${Math.round(t.height)}px`):(e=`${Math.round(100*t.width/this._editorWidth)}%`,i="auto"),this._target.setAttribute("width",`${e}`),this._target.setAttribute("height",`${i}`),this.formatter.currentSpec?.isUnclickable?(this._target.style.setProperty("--resize-width",`${e}`),this._target.dataset.relativeSize=`${this.isRelative}`):this.isAligned&&this._target.parentElement&&(this._target.parentElement.style.setProperty("--resize-width",`${e}`),this._target.parentElement.dataset.relativeSize=`${this.isRelative}`),this.formatter.toolbar.buttons.resizeMode.selected=this.isRelative,this.formatter.update(
vendor: 8,105 bytes, line 3
3),o&&(this._showSizeInfo(!0,t.width,t.height),this._showSizeInfo(!1)),this.debug&&console.debug("ResizeAction resize mode swapped:",{target:this._target,newWidth:e,isRelative:this.isRelative,isAligned:this.isAligned})}};_closeSizeInfo=()=>{this._sizeInfoTimerId=setTimeout(()=>{this.formatter.sizeInfo.style.transition="opacity 1s",this.formatter.sizeInfo.style.opacity="0"},1e3)};_cancelSizeInfoTimer=()=>{null!==this._sizeInfoTimerId&&(clearTimeout(this._sizeInfoTimerId),this._sizeInfoTimerId=null)};_calculateDistance=(o,t)=>{const e=t.clientX-o.clientX,i=t.clientY-o.clientY;return Math.sqrt(e*e+i*i)};_roundDimension=o=>o.replace(/([^0-9.-]*)(-?[\d.]+)(.*)/,(t,e,i,n)=>`${e}${Math.round(Number(i))}${n}`);_isSvgImage=()=>this._target instanceof HTMLImageElement&&(this._target.src.startsWith("data:image/")?this._target.src.includes("image/svg+xml"):this._target.src.endsWith(".svg"))}class _{formatter;isUnclickable=!1;constructor(o){this.formatter=o}init=()=>{};getActions(){const o=[];return this.formatter.options.align.allowAligning&&o.push(new f(this.formatter)),this.formatter.options.resize.allowResizing&&o.push(new z(this.formatter)),this.formatter.options.delete.allowKeyboardDelete&&o.push(new D(this.formatter)),o.push(new E(this.formatter)),o}getTargetElement=()=>null;getTargetBlot=()=>{const o=this.getTargetElement();return o?this.formatter.Quill.find(o):null};getOverlayElement=()=>this.getTargetElement();setSelection=()=>{this.formatter.quill.setSelection(null)};onHide=()=>{}}class Y extends _{selector;unclickable;proxyContainer;unclickableProxies;isUnclickable=!0;constructor(o){super(o),this.selector=o.options.video.selector,this.unclickable=null,this.proxyContainer=this._createProxyContainer(),this.unclickableProxies={}}init=()=>{this.formatter.quill.on("text-change",this._onTextChange),this.formatter.quill.root.addEventListener("scroll",()=>{this._repositionProxyImages()}),this._observeEditorResize()};_observeEditorResize=()=>{let o=null;new ResizeObserver(t=>{for(const e of t)o&&clearTimeout(o),o=window.setTimeout(()=>{this._repositionProxyImages()},200)}).observe(this.formatter.quill.root)};getTargetElement=()=>this.unclickable;getOverlayElement=()=>this.unclickable;_onTextChange=()=>{Object.entries(this.unclickableProxies).forEach(([o,{unclickable:t,proxyImage:e}])=>{try{this.formatter.quill.root.contains(t)||(e.remove(),delete this.unclickableProxies[o])}catch{}}),this.formatter.quill.root.querySelectorAll(`${this.selector}:not([data-blot-formatter-id])`).forEach(o=>{this._createUnclickableProxyImage(o)}),this._repositionProxyImages()};_createUnclickableProxyImage=o=>{const t=Array.from(crypto.getRandomValues(new Uint8Array(5)),u=>String.fromCharCode(97+u%26)).join("");o.dataset.blotFormatterId=t;const e=document.createElement("canvas"),i=e.getContext("2d");i&&(i.globalAlpha=0,i.fillRect(0,0,1,1));const n=document.createElement("img");n.src=e.toDataURL("image/png"),n.classList.add("blot-formatter__proxy-image"),n.dataset.blotFormatterId=t;const a={...this.formatter.options.video.proxyStyle,position:"absolute",margin:"0",userSelect:"none"};Object.assign(n.style,a),n.style.setProperty("-webkit-user-select","none"),n.style.setProperty("-moz-user-select","none"),n.style.setProperty("-ms-user-select","none"),this.formatter.options.debug&&n.style.setProperty("border","3px solid red"),this.proxyContainer.appendChild(n),n.addEventListener("click",this._onProxyImageClick),n.addEventListener("contextmenu",u=>{u.stopPropagation(),u.preventDefault()}),n.addEventListener("wheel",this.formatter._passWheelEventThrough),n.addEventListener("touchstart",this.formatter._onTouchScrollStart,{passive:!1}),n.addEventListener("touchmove",this.formatter._onTouchScrollMove,{passive:!1}),this.unclickableProxies[t]={unclickable:o,proxyImage:n},this.formatter.options.debug&&console.debug("UnclickableBlotSpec created proxy for unclickable:",o,"with ID:",t,"and proxy image:",n)};_repositionProxyImages=()=>{if(Object.keys(this.unclickableProxies).length>0){const o=this.formatter.quill.container.getBoundingClientRect(),t=this.formatter.quill.container.scrollLeft,e=this.formatter.quill.container.scrollTop;Object.entries(this.unclickableProxies).forEach(([i,{unclickable:n,proxyImage:a}])=>{try{const u=n.getBoundingClientRect();Object.assign(a.style,{left:`${u.left-o.left-1+t}px`,top:`${u.top-o.top+e}px`,width:`${u.width}px`,height:`${u.height}px`})}catch(u){console.error(`Error positioning proxy image with id ${i}: `,`${u instanceof Error?u.message:u}`)}})}};_onProxyImageClick=o=>{this.unclickable=this.unclickableProxies[`${o.target.dataset.blotFormatterId}`].unclickable,this.formatter.show(this)};_createProxyContainer=()=>{const o=document.createElement("div");return o.classList.add("proxy-container"),this.formatter.quill.container.appendChild(o),o}}class Z extends l{modal;targetElement=null;currentBlot=null;constructor(o){super(o),this.toolbarButtons=[new A("attribute",this._onClickHandler,this.formatter.options.toolbar)],this.modal=this._createModal()}onCreate=()=>{this.targetElement=this.formatter.currentSpec?.getTargetElement(),this.currentBlot=this.formatter.currentSpec?.getTargetBlot()};onDestroy=()=>{this.targetElement=null,this.modal.form.removeEventListener("submit",this._onSubmitHandler),this.modal.form.removeEventListener("cancel",this._hideAltTitleModal),this.modal.element.removeEventListener("pointerdown",this._onPointerDownHandler),this.modal.cancelButton.removeEventListener("click",this._hideAltTitleModal),this.modal.element.remove()};_onClickHandler=()=>{this._showAltTitleModal()};_showAltTitleModal=()=>{this.targetElement&&(this.modal.altInput.value=this.targetElement.getAttribute("alt")||"",this.modal.titleInput.value=this.targetElement.getAttribute("title")||"",document.body.append(this.modal.element),this.formatter.options.debug&&console.debug("Showing Alt Title modal for:",this.targetElement))};_hideAltTitleModal=()=>{this.modal.element.remove()};_setAltTitle=()=>{if(this.targetElement){const o="string"==typeof this.modal.altInput.value?this.modal.altInput.value:"",t=this.modal.titleInput.value;this.targetElement.setAttribute("alt",o),t?this.targetElement.setAttribute("title",t):this.targetElement.removeAttribute("title"),this.formatter.options.debug&&console.debug("Setting alt:",o,"title:",t,"on target element:",this.targetElement);const e=this.currentBlot?.parent?.formats()[this.formatter.ImageAlign.attrName]?.align;this.currentBlot&&e&&(this.formatter.options.debug&&console.debug("Updating title of image with alignment:",e),this.currentBlot.parent?.format(this.formatter.ImageAlign.attrName,!1),this.currentBlot.format(this.formatter.ImageAlign.attrName,{align:e,title:t}))}};_createModal=()=>{const o=Array.from(crypto.getRandomValues(new Uint8Array(5)),$=>String.fromCharCode(97+$%26)).join(""),t=document.createElement("div");t.id=`${o}-modal`,t.setAttribute("data-blot-formatter-modal","");const e=document.createElement("div"),i=document.createElement("form");i.id=`${o}-form`;const n=document.createElement("label");n.setAttribute("for","alt"),n.textContent=this.formatter.options.overlay.labels?.alt||this.formatter.options.image.altTitleModalOptions.labels.alt;const a=document.createElement("textarea");a.name="alt",a.rows=3;const u=document.createElement("label");u.setAttribute("for","title"),u.textContent=this.formatter.options.overlay.labels?.title||this.formatter.options.image.altTitleModalOptions.labels.title;const w=document.createElement("textarea");w.name="title",w.rows=3;const O=document.createElement("div"),q=document.createElement("button");q.type="submit",q.innerHTML=this.formatter.options.image.altTitleModalOptions.icons.submitButton,O.appendChild(q),i.appendChild(n),i.appendChild(a),i.appendChild(u),i.appendChild(w),i.appendChild(O);const P=document.createElement("button");return P.id=`${o}-cancel`,P.type="button",P.innerHTML=this.formatter.options.image.altTitleModalOptions.icons.cancelButton,this.formatter.options.image.altTitleModalOptions.styles&&(Object.assign(t.style,this.formatter.options.image.altTitleModalOptions.styles.modalBackgroun
3d),Object.assign(e.style,this.formatter.options.image.altTitleModalOptions.styles.modalContainer),Object.assign(n.style,this.formatter.options.image.altTitleModalOptions.styles.label),Object.assign(a.style,this.formatter.options.image.altTitleModalOptions.styles.textarea),Object.assign(u.style,this.formatter.options.image.altTitleModalOptions.styles.label),Object.assign(w.style,this.formatter.options.image.altTitleModalOptions.styles.textarea),Object.assign(q.style,this.formatter.options.image.altTitleModalOptions.styles.submitButton),Object.assign(P.style,this.formatter.options.image.altTitleModalOptions.styles.cancelButton)),e.appendChild(i),e.appendChild(P),t.appendChild(e),i.addEventListener("submit",this._onSubmitHandler),i.addEventListener("cancel",this._hideAltTitleModal),t.addEventListener("pointerdown",this._onPointerDownHandler),P.addEventListener("click",this._hideAltTitleModal),{element:t,form:i,altInput:a,titleInput:w,cancelButton:P}};_onSubmitHandler=o=>{o.preventDefault(),this._setAltTitle(),this._hideAltTitleModal()};_onPointerDownHandler=o=>{o.target===this.modal.element&&this._hideAltTitleModal()}}let X=(()=>{class g extends l{options;modal;targetElement=null;imageDetails=null;static isEligibleForCompression=(t,e=!1)=>{let i=!1;if(t instanceof HTMLImageElement&&t.src.startsWith("data:image/")){const n=t.src.substring(5,t.src.indexOf(";"));i="svg+xml"!==n&&"gif"!==n}return e&&console.debug("Image eligibility check:",{element:t,isEligible:i}),i};constructor(t){super(t),this.options=this.formatter.options.image.compressorOptions,this.toolbarButtons=[new A("compress",this._onClickHandler,this.formatter.options.toolbar)],this.modal=this._createModal()}onCreate=()=>{this.targetElement=this.formatter.currentSpec?.getTargetElement();const t=g.isEligibleForCompression(this.targetElement,this.debug);this.toolbarButtons[0].initialVisibility=t,this.debug&&console.debug("CompressAction initialized with target element:",this.targetElement,"is eligible:",t)};onDestroy=()=>{this.targetElement=null,this._hideModal(),this.modal.continueButton.removeEventListener("click",this._onContinueClick),this.modal.moreInfoButton.removeEventListener("click",this._onMoreInfoClick),this.modal.cancelButton.removeEventListener("click",this._hideModal),this.modal.element.removeEventListener("pointerdown",this._onBackgroundClick)};_onClickHandler=()=>{this._showModal()};_showModal=()=>{this.targetElement instanceof HTMLImageElement&&(this.imageDetails=this._getImageDetails(this.targetElement),this.imageDetails.canCompress?(this.modal.moreInfoButton.style.visibility="visible",this.modal.moreInfoText.style.display="none",document.body.append(this.modal.element)):this._displayFeedback(this.options.text.nothingToDo))};_hideModal=()=>{this.modal.element.remove()};_parseDimensions=t=>{let e=t.getAttribute("width"),i=t.getAttribute("height"),n=null,a=null;if(e)if(e.toLowerCase().endsWith("px"))n=parseFloat(e);else if(e.endsWith("%"))n=this.options.maxWidth??null;else if(e.toLowerCase().endsWith("em")||e.toLowerCase().endsWith("rem"))n=16*parseFloat(e);else{if(isNaN(parseFloat(e)))return[null,null];n=parseFloat(e)}if(i)if(isNaN(parseFloat(i)))if(i.toLowerCase().endsWith("px"))a=parseFloat(i);else if(i.toLowerCase().endsWith("em")||i.toLowerCase().endsWith("rem"))a=16*parseFloat(i);else{if(!(n&&t.naturalWidth>0&&t.naturalHeight>0))return[null,null];a=n/(t.naturalWidth/t.naturalHeight)}else a=parseFloat(i);return[n,a]};_getImageSize=t=>{const e=t.getAttribute("src");if(!e||!e.startsWith("data:image/"))return null;const i=e.split(",")[1];return i?Math.ceil(3*i.length/4):null};_displayFeedback=t=>{this.formatter.sizeInfo.innerHTML=t,this.formatter.sizeInfo.style.transition="",this.formatter.sizeInfo.style.opacity="1",setTimeout(()=>{this.formatter.sizeInfo.style.transition="opacity 1s",this.formatter.sizeInfo.style.opacity="0"},2500)};_getImageDetails=t=>{let[e,i]=this._parseDimensions(t);!e&&(this.options.maxWidth??1/0)<t.naturalWidth&&(e=this.options.maxWidth,i=e/(t.naturalWidth/t.naturalHeight));const n={naturalWidth:t.naturalWidth,naturalHeight:t.naturalHeight,targetWidth:e,targetHeight:i,size:this._getImageSize(t),canCompress:!!(e&&i&&e<t.naturalWi
vendor: 8,560 bytes, line 3
3dth&&g.isEligibleForCompression(t,this.debug))};return this.debug&&console.debug("Image details:",{element:t,...n}),n};_compressImage=t=>{if(this.imageDetails?.canCompress){const e=new Image;e.src=t.src,e.onload=()=>{this.debug&&console.debug("Compressing Image Copy loaded:",e);const i=document.createElement("canvas");i.width=this.imageDetails.targetWidth,i.height=this.imageDetails.targetHeight,i.getContext("2d").drawImage(e,0,0,i.width,i.height);const n=i.toDataURL("image/jpeg",this.options.jpegQuality),a=(new TextEncoder).encode(t.src).length,u=(new TextEncoder).encode(n).length;u<a&&(t.src=n);const w=`${Math.ceil((this.imageDetails.size-this._getImageSize(t))/1024)}kB`,O=`${this.options.text.reducedLabel}: ${w}<br>\n ${this.imageDetails.naturalWidth} x ${this.imageDetails.naturalHeight}px \u2192 ${i.width} x ${Math.round(i.height)}px\n `;return this.debug&&console.debug("Image compressed:",{"original size":a,"resized size":u,"size diff":w,"new dimensions":{width:i.width,height:Math.round(i.height)}}),this._displayFeedback(O),!0},e.onerror=i=>(console.error("Image loading failed:",i),this._displayFeedback(`Image loading failed: ${i}`),!1)}else this._displayFeedback(this.options.text.nothingToDo);return!0};_createModal=()=>{const t=document.createElement("div");t.setAttribute("data-blot-formatter-compress-modal","");const e=document.createElement("div"),i=document.createElement("div"),n=document.createElement("div"),a=document.createElement("div"),u=document.createElement("button"),w=document.createElement("button"),O=document.createElement("button");return n.style.display="none",a.append(u,w,O),e.append(i,n,a),t.appendChild(e),i.innerHTML=this.options.text.prompt,n.innerHTML=this.options.text.moreInfo||"",this.options.styles&&(Object.assign(t.style,this.options.styles.modalBackground),Object.assign(e.style,this.options.styles.modalContainer),Object.assign(a.style,this.options.styles.buttonContainer),Object.assign(u.style,{...this.options.styles.buttons,...this.options.buttons.cancel.style}),this.options.text.moreInfo?Object.assign(w.style,{...this.options.styles.buttons,...this.options.buttons.moreInfo.style}):w.style.visibility="hidden",Object.assign(O.style,{...this.options.styles.buttons,...this.options.buttons.continue.style})),u.innerHTML=this.options.icons.cancel,w.innerHTML=this.options.icons.moreInfo,O.innerHTML=this.options.icons.continue,O.addEventListener("click",this._onContinueClick),w.addEventListener("click",this._onMoreInfoClick),u.addEventListener("click",this._hideModal),t.addEventListener("pointerdown",this._onBackgroundClick),{element:t,moreInfoButton:w,cancelButton:u,continueButton:O,moreInfoText:n}};_onContinueClick=()=>{this.targetElement instanceof HTMLImageElement&&this._compressImage(this.targetElement),this._hideModal()};_onMoreInfoClick=()=>{this.modal.moreInfoText.innerHTML=this.options.text.moreInfo||"",this.modal.moreInfoText.style.display="block",this.modal.moreInfoButton.style.visibility="hidden"};_onBackgroundClick=t=>{t.stopImmediatePropagation(),t.target===this.modal.element&&(this.debug&&console.debug("Modal background clicked, hiding modal"),this._hideModal())}}return g})();class J extends l{targetElement=null;currentBlot=null;toolbarButton;linkOptions;modal;constructor(o){super(o),this.linkOptions=this.formatter.options.image.linkOptions,this.toolbarButton=new A("link",this._onClickHandler,this.formatter.options.toolbar),this.toolbarButton.preselect=()=>!!this.getLink(),this.toolbarButtons=[this.toolbarButton],window.LinkAction=this}onCreate=()=>{this.targetElement=this.formatter.currentSpec?.getTargetElement(),this.currentBlot=this.formatter.currentSpec?.getTargetBlot()};onDestroy=()=>{this.targetElement=null,this._removeEventListeners(),this.hideLinkModal()};_addEventListeners=()=>{this.modal&&(this.modal.form.addEventListener("submit",this._formSubmitHandler),this.modal.cancelButton.addEventListener("click",this.hideLinkModal),this.modal.removeButton.addEventListener("click",this.removeLink),this.modal.background.addEventListener("click",this._onBackgroundClick),this.modal.input.addEventListener("contextmenu",this._trapContextEvent))};_removeEventListeners=()=>{this.modal&&(this.modal.form.removeEventListener("submit",this._formSubmitHandler),this.modal.cancelButton.removeEventListener("click",this.hideLinkModal),this.modal.removeButton.removeEventListener("click",this.removeLink),this.modal.background.removeEventListener("click",this._onBackgroundClick),this.modal.input.removeEventListener("contextmenu",this._trapContextEvent))};_trapContextEvent=o=>{o.stopImmediatePropagation()};_onClickHandler=()=>{this.showLinkModal()};_onBackgroundClick=o=>{o.target===this.modal?.background&&(o.stopImmediatePropagation(),o.preventDefault(),this.hideLinkModal(),this.debug&&console.debug("LinkAction modal background clicked, hiding modal"))};showLinkModal=()=>{if(this.targetElement){if(this.modal=this._buildModal(),!this.modal)return;this.formatter.overlay.append(this.modal.dialog,this.modal.background),this._addEventListeners(),this.modal.dialog.style.visibility="hidden",this.modal.dialog.show(),this._positionModal(this.modal.dialog),this.modal.dialog.style.visibility="visible",this.modal.input.focus(),this.modal.input.select()}};_buildModal=()=>{const o=document.createElement("dialog");o.className=this.linkOptions.modal.dialog.className,o.dataset.blotFormatterModal="",Object.assign(o.style,this.linkOptions.modal.dialog.style);const t=document.createElement("form");t.method="dialog",t.className=this.linkOptions.modal.form.className,Object.assign(t.style,this.linkOptions.modal.form.style);const e=document.createElement("label");e.htmlFor="link-url",e.textContent=this.linkOptions.modal.label.text,e.className=this.linkOptions.modal.label.className,Object.assign(e.style,this.linkOptions.modal.label.style);const i=document.createElement("input");i.type="url",i.id="link-url",i.name="url",i.value=this.getLink()||"",i.select(),i.autofocus=!0,i.className=this.linkOptions.modal.input.className,Object.assign(i.style,this.linkOptions.modal.input.style),i.placeholder=this.linkOptions.modal.input.placeholder||"";const n=document.createElement("button");n.type="submit",n.innerHTML=this.linkOptions.modal.buttons.submit.icon,n.className=this.linkOptions.modal.buttons.submit.className,Object.assign(n.style,this.linkOptions.modal.buttons.submit.style);const a=document.createElement("button");a.type="button",a.innerHTML=this.linkOptions.modal.buttons.cancel.icon,a.className=this.linkOptions.modal.buttons.cancel.className,Object.assign(a.style,this.linkOptions.modal.buttons.cancel.style);const u=document.createElement("button");u.type="button",u.innerHTML=this.linkOptions.modal.buttons.remove.icon,u.className=this.linkOptions.modal.buttons.remove.className,Object.assign(u.style,this.linkOptions.modal.buttons.remove.style),t.appendChild(e),t.appendChild(i),t.appendChild(n),t.appendChild(u),t.appendChild(a),o.appendChild(t);const w=document.createElement("div");return w.className=this.linkOptions.modal.background.className||"",Object.assign(w.style,this.linkOptions.modal.background.style),{dialog:o,background:w,form:t,label:e,input:i,okButton:n,cancelButton:a,removeButton:u}};_positionModal=o=>{const t=this.formatter.overlay.getBoundingClientRect(),e=this.formatter.quill.root.getBoundingClientRect(),i=o.offsetParent?.getBoundingClientRect()??{top:0,left:0},n=o.offsetWidth,a=o.offsetHeight;let u=t.left+t.width/2-n/2-i.left,w=t.top+t.height/2-a/2-i.top;const q=e.right-n-i.left;u=Math.min(Math.max(u,e.left-i.left),q);const $=e.bottom-a-i.top;w=Math.min(Math.max(w,e.top-i.top),$),o.style.position="absolute",o.style.left=`${u}px`,o.style.top=`${w}px`};hideLinkModal=()=>{this.modal?.dialog?.open&&this.modal.dialog.close(),this.modal?.dialog?.remove(),this.modal?.background&&this.modal.background.remove(),this._removeEventListeners(),this.modal=void 0};_formSubmitHandler=o=>{o.preventDefault();const e=new FormData(o.target).get("url").trim();this.debug&&console.debug("LinkAction form submitted with URL:",e),this.currentBlot&&(e?this.applyLink(e):this.removeLink())};getLink=()=>{const o=this.currentBlot;if(!o||!o.domNode)return null;const t=this.formatter.quill.getIndex(o),e=this.formatter.quill.getFormat(t,1,this.formatter.Quill.sources.SILENT);return this.debug&&console.debug("LinkAction getLink called, formats:",e),e.link||null};removeLink=()=>{const o=this.currentBlot;if(!o||!o.domNode)return;let t=o.parent;for(;t&&"function"==typeof t.formats;
3){if(t.formats().link){t.format("link",null);break}t=t.parent}this.debug&&console.debug("LinkAction removeLink called, removed link from blot:",t),this.hideLinkModal(),this.toolbarButton.selected=!1};applyLink=o=>{o!==this.getLink()&&(this.removeLink(),this.currentBlot?.format("link",o),this.toolbarButton.selected=!!o),this.hideLinkModal()}}const et='<svg viewBox="0 0 16 16" fill="currentColor" style="height:100%;width:auto"><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm3.354 4.646L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 1 1 .708-.708"/></svg>',ot='<svg viewBox="0 0 24 24" fill="currentcolor" style="height:100%;width:auto"><path fill-rule="evenodd" clip-rule="evenodd" d="M 12,24 C 6.34314,24 3.514716,24 1.757364,22.2426 0,20.48532 0,17.6568 0,12 0,6.34314 0,3.514716 1.757364,1.757364 3.514716,0 6.34314,0 12,0 17.6568,0 20.48532,0 22.2426,1.757364 24,3.514716 24,6.34314 24,12 24,17.6568 24,20.48532 22.2426,22.2426 20.48532,24 17.6568,24 12,24 Z M 16.83636,8.363604 c 0.35148,0.351468 0.35148,0.921324 0,1.272756 l -6,6 c -0.35148,0.35148 -0.92124,0.35148 -1.272756,0 l -2.4,-2.4 c -0.351468,-0.35148 -0.351468,-0.92124 0,-1.27272 0.351468,-0.35148 0.921324,-0.35148 1.272792,0 L 10.2,13.72716 15.56364,8.363604 c 0.35148,-0.351468 0.92124,-0.351468 1.27272,0 z" style="stroke-width:1.2" /></svg>',lt={specs:[class rt extends _{img;constructor(o){super(o),this.img=null}init=()=>{this.formatter.quill.root.addEventListener("click",this.onClick)};getActions=()=>{const o=super.getActions();return this.formatter.options.image.linkOptions.allowLinkEdit&&o.push(new J(this.formatter)),this.formatter.options.image.allowAltTitleEdit&&o.push(new Z(this.formatter)),this.formatter.options.image.allowCompressor&&X.isEligibleForCompression(this.img)&&o.push(new X(this.formatter)),o};getTargetElement=()=>this.img;onHide=()=>{this.img=null};onClick=o=>{const t=o.target;this.formatter.enabled&&t instanceof HTMLImageElement&&(o.stopImmediatePropagation(),o.preventDefault(),this.img=t,this.formatter.show(this))}},class K extends Y{constructor(o){super(o)}}],overlay:{className:"blot-formatter__overlay",style:{position:"absolute",boxSizing:"border-box",border:"1px dashed #444",backgroundColor:"rgba(255, 255, 255, 0.35)",maxWidth:"100%",zIndex:9999},sizeInfoStyle:{position:"absolute",color:"rgba(255, 255, 255, 0.7)",backgroundColor:"rgba(0, 0, 0, 0.7)",top:"50%",left:"50%",transform:"translate(-50%, -50%)",padding:"1em",textWrap:"nowrap",fontSize:"1rem",opacity:0,lineHeight:1.2}},align:{allowAligning:!0,alignments:["left","center","right"]},resize:{allowResizing:!0,allowResizeModeChange:!1,imageOversizeProtection:!1,handleClassName:"blot-formatter__resize-handle",handleStyle:{position:"absolute",height:"12px",width:"12px",backgroundColor:"white",border:"1px solid #777",boxSizing:"border-box",opacity:"0.80",zIndex:999},useRelativeSize:!1,minimumWidthPx:25},delete:{allowKeyboardDelete:!0},toolbar:{icons:{left:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"></line><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"></line><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"></line></svg>',center:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"></line><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"></line><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"></line></svg>',right:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"></line><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"></line><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"></line></svg>',attribute:'<svg viewBox="0 0 24 24" fill="none" class="ql-stroke"><path d="M10 19H12M12 19H14M12 19V5M12 5H6V6M12 5H18V6" stroke-linecap="round" stroke-linejoin="round"/></svg>',resizeMode:'<svg viewBox="0 0 24 24" class="ql-stroke"><path d="m 7.7056591,11.853515 q -1.515179,0 -2.4160962,-0.993056 -0.9009172,-1.0032944 -0.9009172,-2.6720388 0,-1.8223098 0.9521057,-2.8665548 0.9521057,-1.0544826 2.5696616,-1.0544826 1.5663674,0 2.426334,0.9725811 0.870204,0.972581 0.870204,2.7334647 0,1.7608836 -0.972581,2.8256044 -0.9623435,1.054482 -2.5287109,1.054482 z M 7.8489868,5.3935293 q -0.9725811,0 -1.5356544,0.7268764 -0.5630732,0.7166387 -0.5630732,1.9758752 0,1.2387612 0.5528356,1.9349241 0.5528355,0.685926 1.5049412,0.685926 0.9623434,0 1.5049413,-0.716639 0.5425978,-0.7166384 0.5425978,-1.9861126 0,-1.2387612 -0.5425978,-1.9246868 Q 8.7806171,5.3935293 7.8489868,5.3935293 Z M 17.533847,4.4926121 8.1151669,19.275845 H 6.6511764 L 16.059619,4.4926121 Z M 16.448651,19.398697 q -1.515179,0 -2.416096,-1.003294 -0.900917,-1.003294 -0.900917,-2.661801 0,-1.82231 0.962343,-2.876793 0.962344,-1.06472 2.559424,-1.06472 1.55613,0 2.426334,0.982819 0.870204,0.982819 0.870204,2.75394 0,1.750646 -0.972581,2.815366 -0.962343,1.054483 -2.528711,1.054483 z m 0.143328,-6.449748 q -0.982819,0 -1.545892,0.716638 -0.552836,0.716639 -0.552836,1.986113 0,1.218286 0.552836,1.914449 0.552835,0.685926 1.504941,0.685926 0.962343,0 1.504941,-0.716639 0.542598,-0.726876 0.542598,-1.986113 0,-1.248998 -0.542598,-1.924686 -0.53236,-0.675688 -1.46399,-0.675688 z" style="fill:currentColor;stroke:currentColor;stroke-width:0.3"/></svg>',compress:'<svg viewBox="0 0 28 28"><path d="m 19.250001,9.3125004 c 0.240623,0 0.437498,0.1968749 0.437498,0.4374991 V 18.49453 l -0.136717,-0.177734 -3.718751,-4.812498 c -0.123046,-0.161329 -0.317188,-0.254297 -0.51953,-0.254297 -0.202345,0 -0.39375,0.09297 -0.519532,0.254297 l -2.269532,2.936715
3-0.833984,-1.167577 c -0.123047,-0.172265 -0.319922,-0.273437 -0.533204,-0.273437 -0.213281,0 -0.410156,0.101172 -0.533202,0.276172 l -2.1875003,3.0625 -0.1230462,0.169532 v -0.0082 -8.7500002 c 0,-0.2406242 0.1968749,-0.4374991 0.4374991,-0.4374991 z M 8.7499996,8 C 7.7847663,8 7,8.7847662 7,9.7499995 V 18.5 c 0,0.965233 0.7847663,1.75 1.7499996,1.75 H 19.250001 C 20.215235,20.25 21,19.465233 21,18.5 V 9.7499995 C 21,8.7847662 20.215235,8 19.250001,8 Z M 10.9375,13.250001 a 1.3125025,1.312501 0 1 0 0,-2.625002 1.3125025,1.312501 0 1 0 0,2.625002 z" /><path d="m 25.298508,20 h -3.58209 C 21.286567,20 21,20.286571 21,20.716427 v 3.582131 c 0,0.429856 0.286567,0.716426 0.716418,0.716426 v 0 c 0.429851,0 0.716418,-0.28657 0.716418,-0.716426 v -2.865705 h 2.865672 c 0.429851,0 0.716418,-0.28657 0.716418,-0.716426 C 26.014926,20.286571 25.728359,20 25.298508,20 Z" /><path d="M 6.298508,20 H 2.716418 C 2.2865673,20 2,20.286571 2,20.716427 c 0,0.429856 0.2865673,0.716426 0.716418,0.716426 H 5.58209 v 2.865705 c 0,0.429856 0.286567,0.716426 0.716418,0.716426 v 0 c 0.429851,0 0.716418,-0.28657 0.716418,-0.716426 V 20.716427 C 7.014926,20.286571 6.728359,20 6.298508,20 Z" /><path d="M 6.298507,3 C 5.868656,3 5.582089,3.28657 5.582089,3.716426 V 6.582131 H 2.716417 C 2.286567,6.582131 2,6.868702 2,7.298557 2,7.728413 2.286567,8.014984 2.716417,8.014984 h 3.58209 c 0.429845,0 0.716412,-0.286571 0.716412,-0.716427 V 3.716426 C 7.014919,3.28657 6.728352,3 6.298507,3 Z" /><path d="m 21.716418,8.014984 h 3.582089 c 0.429851,0 0.716418,-0.286571 0.716418,-0.716427 0,-0.429855 -0.286567,-0.716426 -0.716418,-0.716426 H 22.432836 V 3.716426 C 22.432836,3.28657 22.146269,3 21.716418,3 21.286567,3 21,3.28657 21,3.716426 v 3.582131 c 0,0.429856 0.286567,0.716427 0.716418,0.716427 z" /></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" style="fill: none;stroke: #444;stroke-linecap: round;stroke-linejoin: round;stroke-width: 1.5;"><line x1="7" x2="11" y1="7" y2="11"/><path class="ql-even" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>'},tooltips:{left:"Align Left",center:"Align Center",right:"Align Right",attribute:"Set Alt/Title",resizeMode:"Use Relative (%)/Absolute (px) Sizing",compress:"Compress Image",link:"Add/Edit Link"},mainClassName:"blot-formatter__toolbar",mainStyle:{position:"absolute",display:"flex",top:"0",right:"0",left:"0",transform:"translateY(-50%)",justifyContent:"center",flexWrap:"wrap",color:"#333",zIndex:"1"},buttonClassName:"blot-formatter__toolbar-button",buttonStyle:{display:"inline-block",width:"27px",height:"26px",background:"white",border:"1px solid #999",cursor:"pointer",margin:"0 -1px 0 0"},buttonSelectedClassName:"blot-formatter__toolbar-button--selected",buttonSelectedStyle:{filter:"invert(20%)"},svgStyle:{display:"inline-block",width:"100%",height:"100%",background:"white",verticalAlign:"top"}},image:{allowAltTitleEdit:!0,registerImageTitleBlot:!1,registerArrowRightFix:!0,altTitleModalOptions:{styles:{modalBackground:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},modalContainer:{backgroundColor:"#f2f2f2",padding:"5px 10px 10px 10px",borderRadius:"5px",position:"relative",width:"90%",maxWidth:"500px",boxShadow:"6px 6px 5px #00000075"},label:{display:"block",color:"black",margin:"7px 0 5px 0",fontSize:"14px"},textarea:{backgroundColor:"white",fontSize:"13px",display:"block",resize:"none",width:"100%",padding:"5px",border:"1px solid lightgray",borderRadius:"4px",boxSizing:"border-box"},submitButton:{display:"block",marginLeft:"auto",marginTop:"5px",cursor:"pointer",border:0,padding:0,width:"2rem",height:"2rem",color:"#198754"},cancelButton:{display:"flex",width:"1.5rem",height:"1.5rem",position:"absolute",padding:0,top:"-0.7rem",right:"-0.7rem",background:"white",border:"none",borderRadius:"5px",cursor:"pointer",alignItems:"center",color:"rgb(197, 74, 71)"}},icons:{submitButton:ot,cancelButton:et},labels:{alt:"Alt Text",title:"Image Title"}}
vendor: 4,107 bytes, line 3
3,allowCompressor:!1,compressorOptions:{jpegQuality:.8,styles:{modalBackground:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},modalContainer:{backgroundColor:"rgb(253, 253, 253)",border:"1px solid #ccc",boxShadow:"6px 6px 5px #00000075",padding:"15px",borderRadius:"8px",position:"relative",maxWidth:"min(90%, 400px)",textAlign:"justify",userSelect:"none"},buttonContainer:{gridTemplateColumns:"auto 1fr auto",display:"grid",gap:"1em",justifyItems:"center",borderTop:"1px solid lightgray",paddingTop:"12px"},buttons:{width:"1.5rem",height:"1.5rem",padding:0,backgroundColor:"transparent",border:0,cursor:"pointer"}},buttons:{continue:{className:"blot-formatter__compress-continue",style:{color:"#198754"}},cancel:{className:"blot-formatter__compress-cancel",style:{color:"rgb(197, 74, 71)"}},moreInfo:{className:"blot-formatter__compress-more-info",style:{color:"royalblue"}}},text:{prompt:'<p style="font-style: large;margin: 0 0 0.5em;">Compress image to its resized width?</p>',moreInfo:'<p style="font-size: smaller; line-height: 1.2;">You can reduce the file size and save disk space by compressing pictures. The compression reduces both the file size and picture dimensions based on the width setting.</p><p style="font-size: smaller;"><strong>NOTE:</strong> This process cannot be undone.</p>',reducedLabel:"Reduced",nothingToDo:"Image already optimised."},icons:{cancel:`<span style="color: rgb(197, 74, 71);">${et}</span>`,moreInfo:'<svg viewBox="0 0 512 512" fill="currentcolor" style="height:100%;width:auto"><path d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm169.8-90.7c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z" /></svg>',continue:ot}},linkOptions:{allowLinkEdit:!0,modal:{dialog:{className:"blot-formatter__link-modal",style:{margin:0,backgroundColor:"#fdfdfd",border:"1px solid #ccc",boxShadow:"6px 6px 5px #00000075",color:"#444",padding:"6px 13px 6px 10px",whiteSpace:"nowrap",borderRadius:"5px",minWidth:"300px",maxWidth:"90%",overflow:"visible",zIndex:101}},background:{className:"blot-formatter__link-modal-background",style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.5)",zIndex:100}},form:{className:"blot-formatter__link-form",style:{display:"flex",flexWrap:"nowrap",columnGap:"5px",alignItems:"center",margin:0}},label:{className:"blot-formatter__link-label",style:{paddingRight:"5px",fontSize:"13px"},text:"URL:"},input:{className:"blot-formatter__link-input",style:{border:"1px solid #ccc",borderRadius:"4px",boxSizing:"border-box",fontSize:"13px",height:"26px",margin:"0 0.2rem 0 0",padding:"3px 5px",width:"100%",outline:"1px auto #df9001c2"},placeholder:"https://example.com"},buttons:{submit:{className:"blot-formatter__link-submit",style:{border:"none",borderRadius:"3px",padding:"0",cursor:"pointer",background:"transparent",width:"26px",height:"26px",color:"#198754",display:"flex",alignContent:"center",justifyContent:"center"},icon:'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 16 16" style="height:100%;width:auto"><path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/><path d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/></svg>',tooltip:"Create Link"},cancel:{className:"blot-formatter__link-cancel",style:{display:"flex",width:"18px",height:"18px",position:"absolute",top:"-8px",right:"-10px",padding:"0",background:"white",border:"1px solid rgb(157, 58, 56)",borderRadius:"5px",cursor:"pointer",alignItems:"center",color:"rgb(197, 74, 71)"}
vendor: 4,272 bytes, line 3
3,icon:et,tooltip:"Cancel"},remove:{className:"blot-formatter__link-remove",style:{border:"none",padding:"0",cursor:"pointer",background:"transparent",width:"26px",height:"26px",fill:"#c54a47",display:"flex",placeContent:"center",justifyContent:"center"},icon:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 16 16" style="height:100%;width:auto"><path d="M 6.265625,3.3457031 6.125,3.625 H 4.25 c -0.3457031,0 -0.625,0.2792969 -0.625,0.625 0,0.3457031 0.2792969,0.625 0.625,0.625 h 7.5 c 0.345703,0 0.625,-0.2792969 0.625,-0.625 0,-0.3457031 -0.279297,-0.625 -0.625,-0.625 H 9.875 L 9.734375,3.3457031 C 9.6289062,3.1328125 9.4121094,3 9.1757812,3 H 6.8242188 C 6.5878906,3 6.3710938,3.1328125 6.265625,3.3457031 Z M 11.75,5.5 h -7.5 l 0.4140625,6.621094 C 4.6953125,12.615234 5.1054688,13 5.5996094,13 h 4.8007816 c 0.49414,0 0.904297,-0.384766 0.935547,-0.878906 z" style="display:inline;stroke-width:0.0195312"/><path d="m 14,1 a 1,1 0 0 1 1,1 v 12 a 1,1 0 0 1 -1,1 H 2 A 1,1 0 0 1 1,14 V 2 A 1,1 0 0 1 2,1 Z M 2,0 A 2,2 0 0 0 0,2 v 12 a 2,2 0 0 0 2,2 h 12 a 2,2 0 0 0 2,-2 V 2 A 2,2 0 0 0 14,0 Z" style="display:inline"/></svg>',tooltip:"Remove Link"}}}},autoHeight:!0},video:{selector:"iframe.ql-video",registerCustomVideoBlot:!1,registerBackspaceFix:!0,defaultAspectRatio:"16/9 auto",proxyStyle:{}}},ct=(g,o)=>o;let dt=(()=>{class g{Quill;quill;options;currentSpec;specs;overlay;toolbar;sizeInfo;actions;_enabled=!0;_startX=0;_startY=0;_abortController;_resizeObserver;_tooltipContainPosition;ImageAlign;IframeAlign;static cache={ImageAlign:null,IframeAlign:null};static registerFormats(t,e=!1){g.registerImageAlign(t,e),g.registerIframeAlign(t,e)}static registerImageAlign(t,e=!1){if(t.imports?.["formats/imageAlign"])e&&console.debug("Image align format already registered with Quill, skipping registration");else{const n=new(s(t))(e);g.cache.ImageAlign=n,e&&console.debug("Registering imageAlign format with Quill",n),t.register({"formats/imageAlign":n,"attributors/class/imageAlign":n})}}static registerIframeAlign(t,e=!1){if(t.imports?.["formats/iframeAlign"])e&&console.debug("Iframe align format already registered with Quill, skipping registration");else{const n=new(d(t))(e);g.cache.IframeAlign=n,e&&console.debug("Registering iframeAlign format with Quill",n),t.register({"formats/iframeAlign":n,"attributors/class/iframeAlign":n})}}constructor(t,e={}){this.Quill=t.constructor,this.quill=t,this.currentSpec=null,this.actions=[],e.debug&&(window.blotFormatter=this),g.registerFormats(this.Quill,e.debug),this.ImageAlign=g.cache.ImageAlign,this.IframeAlign=g.cache.IframeAlign,this.options=c(lt,e,{arrayMerge:ct}),e.debug&&console.debug("BlotFormatter options",this.options),this._enabled=!(this.quill.options.readOnly||this.quill.container.classList.contains("ql-disabled"));const i=document.createElement("style");i.innerHTML=".ql-disabled .blot-formatter__proxy-image {display: none;}",document.head.appendChild(i),[this.overlay,this.sizeInfo]=this._createOverlay(),this._addEventListeners(),this.toolbar=new b(this),e.debug&&console.debug("BlotFormatter toolbar",this.toolbar),this.specs=this.options.specs.map(n=>new n(this)),this.specs.forEach(n=>n.init()),e.debug&&console.debug("BlotFormatter specs",this.specs),this.quill.container.style.position=this.quill.container.style.position||"relative",this._registerCustomBlots(),this._keyboardBindings(),this.options.debug&&console.debug("tooltip option",this.options.tooltip?.containTooltipPosition),this.options.tooltip?.containTooltipPosition&&(this._tooltipContainPosition=new m(this.quill,this.options.debug))}destroy=()=>{try{this.hide(),this._removeEventListeners(),this._destroyActions(),this.toolbar?.destroy(),this.overlay?.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.currentSpec=null,this.specs=[],this.actions=[],this.options.tooltip?.containTooltipPosition&&this._tooltipContainPosition&&this._tooltipContainPosition?.destroy(),window.bf===this&&delete window.bf,this.quill=null,this.options.debug&&console.debug("BlotFormatter destroyed")}catch(t){console.error("BlotFormatter.destroy error:",t)}};get enabled(){return this._enabled}set enabled(t){t||this.hide(),this._enabled=t}_qlDisabledObserver=new MutationObserver(t=>
3{t.forEach(e=>{"attributes"===e.type&&"class"===e.attributeName&&(this.enabled=!this.quill.container.classList.contains("ql-disabled"))})});show=t=>{try{if(!this.enabled)return;this.quill.container.querySelectorAll(".ql-tooltip:not(.ql-hidden)").forEach(e=>{e.classList.add("ql-hidden")}),this.options.debug&&(window.blotFormatter=this),this.hide(),this.currentSpec=t,this.currentSpec.setSelection(),this._setUserSelect("none"),this.quill.container.appendChild(this.overlay),this._repositionOverlay(),this._createActions(t),this.toolbar.create(),this._scrollToolbarIntoView(this.toolbar.element),document.addEventListener("pointerdown",this._onDocumentPointerDown),this.options.debug&&console.debug("BlotFormatter show",t)}catch(e){throw console.error("Error showing BlotFormatter:",e),this.hide(),e}};hide=(t=null)=>{if(this.currentSpec){if(t){const e=this.currentSpec.getTargetBlot();if(e){const i=this._getClickPosition(t);"left"===i?(this.options.debug&&console.debug("Click position: LEFT"),E.placeCaretBeforeBlot(this.quill,e)):"right"===i&&(this.options.debug&&console.debug("Click position: RIGHT"),E.placeCaretAfterBlot(this.quill,e))}}this.currentSpec.onHide(),this.currentSpec=null,this.quill.container.removeChild(this.overlay),document.removeEventListener("pointerdown",this._onDocumentPointerDown),this.overlay.style.setProperty("display","none"),this._setUserSelect(""),this._destroyActions(),this.toolbar.destroy(),this.quill.emitter.emit(this.quill.constructor.events.TEXT_CHANGE,0,this.quill.getLength(),"api")}this.options.debug&&console.debug("BlotFormatter hide")};update=()=>{this._repositionOverlay(),this.actions.forEach(t=>t.onUpdate()),this.options.debug&&console.debug("BlotFormatter update")};_createActions=t=>{this.actions=t.getActions().map(e=>(e.onCreate(),this.options.debug&&console.debug("BlotFormatter action created",e),e))};_destroyActions=()=>{this.actions.forEach(t=>t.onDestroy()),this.actions=[],this.options.debug&&console.debug("BlotFormatter actions destroyed")};_createOverlay=()=>{const t=document.createElement("div");t.classList.add(this.options.overlay.className),this.options.overlay.style&&Object.assign(t.style,this.options.overlay.style),t.style.userSelect="none",t.style.setProperty("-webkit-user-select","none"),t.style.setProperty("-moz-user-select","none"),t.style.setProperty("-ms-user-select","none");const e=document.createElement("div");return this.options.overlay.sizeInfoStyle&&Object.assign(e.style,this.options.overlay.sizeInfoStyle),t.appendChild(e),this.options.debug&&console.debug("BlotFormatter overlay created",t,e),[t,e]};_scrollToolbarIntoView=(()=>{var e,t=this;return e=I(function*(i){let n=i.getBoundingClientRect();const a=t.quill.container.getBoundingClientRect(),u=t.currentSpec?.getTargetElement();n.top-a.top<0&&u&&(yield t._scrollIntoViewWithOffset(u,n.height),n=i.getBoundingClientRect()),n.top<0&&(t.options.debug&&console.debug(`Scrolling window ${n.top-n.height}px to bring toolbar into view`),window.scrollBy({top:n.top-n.height,behavior:"smooth"}))}),function(i){return e.apply(this,arguments)}})();_scrollIntoViewWithOffset=(t,e=10)=>new Promise(i=>{let n=null;for(let a=t.parentElement;a;a=a.parentElement){const{overflowY:u}=getComputedStyle(a);if(!["auto","scroll"].includes(u)||a.scrollHeight<=a.clientHeight)continue;const w=a.getBoundingClientRect(),O=t.getBoundingClientRect();if(O.top<w.top+e){n=a,a.scrollTo({top:a.scrollTop+O.top-w.top-e}),this.options.debug&&console.debug(`Scrolling ancestor ${a.tagName} to bring element into view with offset ${e}px`);break}}n?setTimeout(()=>{let a=n.scrollTop;const u=setInterval(()=>{n.scrollTop===a?(clearInterval(u),i()):a=n.scrollTop},50)},100):i()});_addEventListeners=()=>{this._abortController=new AbortController;const{signal:t}=this._abortController;this.overlay.addEventListener("wheel",this._passWheelEventThrough,{passive:!1,signal:t}),this.overlay.addEventListener("touchstart",this._onTouchScrollStart,{passive:!1,signal:t}),this.overlay.addEventListener("touchmove",this._onTouchScrollMove,{passive:!1,signal:t}),this.overlay.addEventListener("contextmenu",this._preventContextMenu,{signal:t}),this.quill.root.addEventListener("click",this._onClick,{signal:t}),this.quill.root.addEventListener("scroll",this._repositionOverlay,{signal:t}),this._resizeObserver=new ResizeObserver(this._repositionOverlay),this._resizeObserver.observe(this.quill.root),this._qlDisabledObserver.observe(this.quill.container,{attributes:!0,attributeFilter:["class"]})};_removeEventListeners=()=>{this._abortController?.abort(),this._resizeObserver?.disconnect(),this._qlDisabledObserver.disconnect()};_preventContextMenu=t=>{t.stopPropagation(),t.preventDefault()};_repositionOverlay=()=>
vendor: 2,902 bytes, line 3
3{if(this.currentSpec){const t=this.currentSpec.getOverlayElement();if(t){const e=this.quill.container.getBoundingClientRect(),i=t.getBoundingClientRect(),n={left:`${i.left-e.left-1+this.quill.container.scrollLeft}px`,top:`${i.top-e.top+this.quill.container.scrollTop}px`,width:`${i.width}px`,height:`${i.height}px`};Object.assign(this.overlay.style,{display:"block",...n}),this.options.debug&&console.debug("Blotformatter _repositionOverlay","specRect:",i,"overlayRect:",n)}}};_setUserSelect=t=>{["userSelect","mozUserSelect","webkitUserSelect","msUserSelect"].forEach(e=>{this.quill.root.style.setProperty(e,t),document.documentElement&&document.documentElement.style.setProperty(e,t)}),this.options.debug&&console.debug("BlotFormatter _setUserSelect",t)};_onDocumentPointerDown=t=>{const e=t.target;this.quill.root.parentNode.contains(e)||e.closest("[data-blot-formatter-modal]")||e.classList.contains("blot-formatter__proxy-image")||this.hide(t)};_onClick=t=>{this.options.debug&&console.debug("BlotFormatter _onClick",t),this.enabled&&this.hide(t)};_passWheelEventThrough=t=>{this.quill.root.scrollLeft+=t.deltaX,this.quill.root.scrollTop+=t.deltaY,this.options.debug&&console.debug(`BlotFormatter scrolling Quill root x: ${t.deltaX}, y: ${t.deltaY}`)};_onTouchScrollStart=t=>{if(1===t.touches.length){const e=t.touches[0];this._startX=e.clientX,this._startY=e.clientY,this.options.debug&&console.debug("BlotFormatter _onTouchScrollStart",`X: ${this._startX}, Y: ${this._startY}`)}};_onTouchScrollMove=t=>{if(1===t.touches.length){const e=t.touches[0],i=this._startX-e.clientX,n=this._startY-e.clientY;if(Math.abs(i)<2&&Math.abs(n)<2)return;const a=this.quill.root,u=0===a.scrollTop,w=a.scrollTop+a.clientHeight===a.scrollHeight,O=0===a.scrollLeft,q=a.scrollLeft+a.clientWidth===a.scrollWidth,P=Math.abs(n)>Math.abs(i),$=Math.abs(i)>Math.abs(n);let j=!1;P&&!(u&&n<0)&&!(w&&n>0)&&(j=!0,a.scrollTop+=n),$&&!(O&&i<0)&&!(q&&i>0)&&(j=!0,a.scrollLeft+=i),j&&t.preventDefault(),this._startX=e.clientX,this._startY=e.clientY,this.options.debug&&console.debug("BlotFormatter touch scroll end",`X: ${this._startX}, Y: ${this._startY}`)}};_registerCustomBlots=()=>{if(this.options.image.registerImageTitleBlot){const t=h(this.Quill);this.options.debug&&console.debug("Registering custom Image blot",t),this.Quill.register({"formats/image":t},!0),this.options.debug&&console.debug("formats/image after register:",this.Quill.import("formats/image"))}if(this.options.video.registerCustomVideoBlot){const t=p(this.Quill);this.options.debug&&(console.debug("Registering custom Video blot",t),console.debug("Setting default aspect ratio for Video blot",this.options.video.defaultAspectRatio)),t.aspectRatio=this.options.video.defaultAspectRatio,this.Quill.register({"formats/video":t},!0),this.options.debug&&console.debug("formats/video after register:",this.Quill.import("formats/video"))}};_keyboardBindings=()=>
3{if(this.options.video.registerBackspaceFix){this.quill.keyboard.bindings.Backspace||(this.quill.keyboard.bindings.Backspace=[]);const t={key:"Backspace",empty:!0,line:{domNode:{tagName:"IFRAME"}},handler:e=>{const[i]=this.quill.getLeaf(e.index-1);if("IFRAME"!==i?.domNode?.tagName)return!0;this.quill.deleteText(e.index-1,1,"user"),this.options.debug&&console.debug("BlotFormatter Backspace binding triggered, deleting iframe at index",e.index-1)}};this.quill.keyboard.bindings.Backspace.unshift(t),this.options.debug&&console.debug("BlotFormatter added Backspace keyboard binding",t)}if(this.options.image.registerArrowRightFix){this.quill.keyboard.bindings.ArrowRight||(this.quill.keyboard.bindings.ArrowRight=[]);const t={key:"ArrowRight",collapsed:!0,empty:!1,suffix:/^$/,handler:e=>{const i=e.index+e.length,[n]=this.quill.getLeaf(i+1);if(!n?.domNode)return!0;const a=n.domNode;if("IMG"!==a?.tagName||!a.parentElement?.matches('span[contenteditable="false"]'))return!0;const u=this.quill.getLength();i+1>=u-1?this.quill.setSelection(u-1,0,"user"):(this.quill.setSelection(i+2,0,"user"),E.sendCaretBack(1)),this.options.debug&&console.debug("BlotFormatter ArrowRight binding triggered, moving cursor past image at index",i)}};this.quill.keyboard.bindings.ArrowRight.unshift(t),this.options.debug&&console.debug("BlotFormatter added ArrowRightFix keyboard binding",t)}};_useRelative=t=>{let e=this.options.resize.useRelativeSize;if(this.options.resize.allowResizeModeChange){const i=t.getAttribute("width");e=i?i.endsWith("%"):this.options.resize.useRelativeSize}return this.options.debug&&console.debug("BlotFormatter _useRelative",e,"for element",t),e};_getClickPosition=t=>{const e=this.overlay.getBoundingClientRect();let i;return i=t.clientY<e.top?"above":t.clientY>
3e.bottom?"below":t.clientX<e.left?"left":t.clientX>e.right?"right":"inside",this.options.debug&&console.debug("BlotFormatter _getClickPosition",i,"for event",t),i}}return g})();var ht=y(68419),ut=y.n(ht),it=y(34456),nt=y(70645),S=y(44436),tt=y(8137),st=y(79748),gt=y(28624),mt=y(48503);const pt=()=>["10px","12px","14px","16px","18px","20px","22px","24px","26px"],ft=g=>({import:"attributors/style/size",whitelist:g}),bt=g=>[g];function yt(g,o){if(1&g){const t=S.RV6();S.j41(0,"div",4),S.bIt("click",function(){const i=tt.eBV(t).$implicit,n=S.XpG();return tt.Njj(n.insertVariable(i))}),S.EFF(1),S.k0s()}if(2&g){const t=o.$implicit;S.R7$(),S.JRh(t.translation)}}function vt(g,o){1&g&&(S.j41(0,"div",8),S.EFF(1),S.nI1(2,"translate"),S.k0s()),2&g&&(S.R7$(),S.SpI("0/160 ",S.bMT(2,1,"CHARACTERS")))}function _t(g,o){if(1&g){const t=S.RV6();S.j41(0,"div",5)(1,"quill-editor",6),S.bIt("onEditorCreated",function(i){tt.eBV(t);const n=S.XpG();return tt.Njj(n.onEditorCreated(i))}),S.k0s(),S.qAN(),S.DNE(2,vt,3,3,"div",7),S.k0s()}if(2&g){const t=S.XpG();S.R7$(),S.Y8G("formControl",t.form)("format","html")("formats",t.editorFormats)("sanitize",!1)("customOptions",S.eq3(10,bt,S.eq3(8,ft,S.lJ4(7,pt))))("modules",t.editorModules),S.QXe(),S.R7$(),S.Y8G("ngIf","sms"===t.type)}}T.Ay.register("modules/blotFormatter2",dt),T.Ay.register("modules/imageCompress",ut());const xt=T.Ay.import("delta");let Et=(()=>{class g{template;variables;type;templateVariables;editorFormats;editorModules={};form;editor;constructor(){}ngOnInit(){this.templateVariables=this.convertVariables(this.variables),this.editorFormats=this.buildEditorFormats(),this.form=new it.MJ(this.formatVariablesToHtml(this.template)),this.initializeQuillEditorModules(),this.initializeQuillWrapperElement()}onEditorCreated(t){this.editor=t}buildEditorFormats(){const t=["background","bold","color","font","italic","size","strike","script","underline","blockquote","header","indent","list","align","direction","variable"];return"text"===this.type&&t.push("link"),this.type!==nt.oq.Sms&&t.push("image"),t}getFormattedHtml(){const t=this.editor.root.cloneNode(!0);return this.formatHtmlToVariables(t)}insertVariable(t){const e=this.editor.getSelection(!0);this.editor.insertEmbed(e.index,"variable",t),setTimeout(()=>this.editor.setSelection(e.index+1,0)),this.form.patchValue(this.editor.root.innerHTML)}formatVariablesToHtml(t){return(t??"").replace(/>{{(.*?)}}</g,(e,i)=>`>${this.templateVariables.find(n=>n.variable===`{{${i}}}`)?.translation??`{{${i}}}`}<`)}formatHtmlToVariables(t){const e=t.getElementsByTagName("variable");for(const i of Array.from(e)){const n=i.getAttribute("variable");i.children.item(0).textContent=n}return t.innerHTML}convertVariables(t=[]){return t.map(e=>({variable:e,translation:(0,R.Tl)(`TEMPLATE_VARIABLES.${e.replace(/[{}]/g,"")}`)}))}initializeQuillWrapperElement(){const t=T.Ay.import("blots/block");t.tagName=this.type===nt.oq.Sms?"SPAN":"P",T.Ay.register(t,!0)}initializeQuillEditorModules(){this.editorModules={blotFormatter2:{resize:{showSize:!0}},counter:{container:"#counter",max:160},imageCompress:{quality:.4,maxWidth:1e3,maxHeight:1e3,imageType:"image/jpeg"},..."sms"===this.type?{keyboard:{bindings:{enter:{key:13,shiftKey:null,handler:()=>{}},tab:{key:9,shiftKey:null,handler:()=>{}}}}}:{},clipboard:{matchVisual:"sms"!==this.type,matchers:"sms"===this.type?[["BR",()=>(new xt).insert(" ")]]:[]},toolbar:"sms"!==this.type?[["bold","italic","underline","strike"],["blockquote"],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{size:["10px","12px","14px","16px","18px","20px","22px","24px","26px"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{align:[]}],["image"],"text"===this.type?["link"]:[]]:[]}}static \u0275fac=function(e){return new(e||g)};static \u0275cmp=S.VBU({type:g,selectors:[["editor-component"]],inputs:{template:"template",variables:"variables",type:"type"},standalone:!1,decls:4,vars:2,consts:[[1,"_editor-component"],[1,"_variables-container"],["class","_variable",3,"click",4,"ngFor","ngForOf"],["class","_editor-container",4,"ngIf"],[1,"_variable",3,"click"],[1,"_editor-container"],[3,"onEditorCreated","formControl","format","formats","sanitize","customOptions","modules"],["id","counter",4,"ngIf"],["id","counter"]],template:function(e,i){1&e&&(S.j41(0,"div",0)(1,"div",1),S.DNE(2,yt,2,1,"div",2),S.k0s(),S.DNE(3,_t,3,12,"div",3),S.k0s()),2&e&&(S.R7$(2),S.Y8G("ngForOf",i.templateVariables),S.R7$(),S.Y8G("ngIf",i.form))},dependencies:[st.Sq,st.bT,it.BC,it.l_,gt.i9,mt.D9],styles:['@charset "UTF-8";[_ngcontent-%COMP%]:root{--%NS%spacing-xs: 5px;--%NS%spacing-sm: 10px;--%NS%spacing-md: 15px;--%NS%spacing-lg: 20px;--%NS%spacing-xl: 30px}[_ngcontent-%COMP%]:root{--%NS%ion-color-primary: #78BC61;--%NS%ion-color-primary-rgb: 120, 188, 97;--%NS%ion-color-primary-contrast: #4B4237;--%NS%ion-color-primary-contrast-rgb: 75, 66, 55;--%NS%ion-color-primary-shade: #6AA555;--%NS%ion-color-primary-tint: #86C371;--%NS%ion-color-secondary: #3dc2ff;--%NS%ion-color-secondary-rgb: 61, 194, 255;--%NS%ion-color-secondary-contrast: #ffffff;--%NS%ion-color-secondary-contrast-rgb: 255, 255, 255;--%NS%ion-color-secondary-shade: #36abe0;--%NS%ion-color-secondary-tint: #50c8ff;--%NS%ion-color-tertiary: #bacfd0;--%NS%ion-color-tertiary-rgb: 186, 207, 208;--%NS%ion-color-tertiary-contrast: #4B4237;--%NS%ion-color-tertiary-contrast-rgb: 75, 66, 55;--%NS%ion-color-tertiary-shade: #A4B6B7;--%NS%ion-color-tertiary-tint: #C1D4D5;--%NS%ion-color-success: #78BC61;--%NS%ion-color-success-rgb: 120, 188, 97;--%NS%ion-color-success-contrast: #4B4237;--%NS%ion-color-success-contrast-rgb: 75, 66, 55;--%NS%ion-color-success-shade: #6AA555;--%NS%ion-color-success-tint: #86C371;--%NS%ion-color-warning: #edb142;--%NS%ion-color-warning-rgb: 237, 177, 66;--%NS%ion-color-warning-contrast: #4B4237;--%NS%ion-color-warning-contrast-rgb: 75, 66, 55;--%NS%ion-color-warning-shade: #D19C3A;--%NS%ion-color-warning-tint: #EFB955;--%NS%ion-color-danger: #EB4B24;--%NS%ion-color-danger-rgb: 235, 75, 36;--%NS%ion-color-danger-contrast: #ffffff;--%NS%ion-color-danger-contrast-rgb: 255, 255, 255;
3--%NS%ion-color-danger-shade: #CF4220;--%NS%ion-color-danger-tint: #ED5D3A;--%NS%ion-color-dark: #222428;--%NS%ion-color-dark-rgb: 34, 36, 40;--%NS%ion-color-dark-contrast: #ffffff;--%NS%ion-color-dark-contrast-rgb: 255, 255, 255;--%NS%ion-color-dark-shade: #1e2023;--%NS%ion-color-dark-tint: #383a3e;--%NS%ion-color-medium: #92949c;--%NS%ion-color-medium-rgb: 146, 148, 156;--%NS%ion-color-medium-contrast: #ffffff;--%NS%ion-color-medium-contrast-rgb: 255, 255, 255;--%NS%ion-color-medium-shade: #808289;--%NS%ion-color-medium-tint: #9d9fa6;--%NS%ion-color-light: #f4f5f8;--%NS%ion-color-light-rgb: 244, 245, 248;--%NS%ion-color-light-contrast: #000000;--%NS%ion-color-light-contrast-rgb: 0, 0, 0;--%NS%ion-color-light-shade: #d7d8da;--%NS%ion-color-light-tint: #f5f6f9}._editor-component[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column}._editor-component[_ngcontent-%COMP%] ._variables-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;margin-bottom:20px}._editor-component[_ngcontent-%COMP%] ._variables-container[_ngcontent-%COMP%] ._variable[_ngcontent-%COMP%]{padding:5px 10px;background-color:#f1f1f1;border-radius:15px;margin-right:10px;margin-bottom:5px}._editor-component[_ngcontent-%COMP%] ._variables-container[_ngcontent-%COMP%] ._variable[_ngcontent-%COMP%]:hover{cursor:pointer}._editor-component[_ngcontent-%COMP%] ._editor-container[_ngcontent-%COMP%]{flex-grow:10;position:relative}._editor-component[_ngcontent-%COMP%] ._editor-container[_ngcontent-%COMP%] #counter[_ngcontent-%COMP%]{position:absolute;top:10px;left:10px}._editor-component[_ngcontent-%COMP%] ._editor-container[_ngcontent-%COMP%] quill-editor[_ngcontent-%COMP%]{display:block;height:calc(100% - 42px)}'],changeDetection:1})}return g})();const wt=T.Ay.import("blots/embed");T.Ay.register((()=>class g extends wt{static blotName="variable";static tagName="variable";static create(t){const e=super.create();return e.setAttribute("class","_variable"),e.innerHTML=t?.translation??"",e.setAttribute("contenteditable","false"),e.setAttribute("variable",t.variable),e}static value(t){return{variable:t.getAttribute("variable"),translation:t.innerText}}})()),T.Ay.register("modules/counter",class At{quill;options;constructor(o,t){this.quill=o,this.options=t;const e=document.querySelector(this.options.container);e&&this.quill.on("editor-change",()=>{const i=this.quill.getText().trim();let n="inherit";this.options.max&&(n=i.length>=this.options.max/100*90&&i.length<this.options.max?"#edb142":i.length>=this.options.max?"#EB4B24":"inherit"),e.innerHTML=`<span style="color:${n};">${i.length}${this.options.max?`/${this.options.max}`:""} ${(0,R.Tl)("CHARACTERS")}</span>`})}})},98978(Q,H,y){"use strict";y.d(H,{C:()=>E});var R=y(76925),T=y(79748),I=y(8137),l=y(44436);let E=(()=>{class M{static \u0275fac=function(x){return new(x||M)};static \u0275mod=l.$C({type:M});static \u0275inj=I.G2t({imports:[R.E,T.MD]})}return M})()},9794(Q,H,y){"use strict";y.d(H,{K:()=>I});var R=y(44436),T=y(48503);let I=(()=>{class l{constructor(){}static \u0275fac=function(L){return new(L||l)};static \u0275cmp=R.VBU({type:l,selectors:[["mobile-blocker-component"]],standalone:!1,decls:4,vars:3,consts:[[1,"_mobile-blocker-component"]],template:function(L,k){1&L&&(R.j41(0,"div",0)(1,"span"),R.EFF(2),R.nI1(3,"translate"),R.k0s()()),2&L&&(R.R7$(2),R.SpI(" ",R.bMT(3,1,"MOBILE_VIEW.BLOCKER")," "))},dependencies:[T.D9],styles:["._mobile-blocker-component[_ngcontent-%COMP%]{position:absolute;inset:0;background:gray;display:flex;justify-content:center;align-items:center;padding:20px}._mobile-blocker-component[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#fff;text-align:center}"],changeDetection:1})}return l})()},70645(Q,H,y){"use strict";y.d(H,{M8:()=>R,cW:()=>I,oq:()=>T});var R=function(l){return l.ConfirmReservation="confirm-reservation",l.ConfirmLessonReservation="confirm-lesson-reservation",l.ConfirmBeegoAppointment="confirm-beego-appointment",l.CancelReservation="cancel-reservation",l.CancelLessonReservation="cancel-lesson-reservation",l.CancelBeegoAppointment="cancel-beego-appointment",l.ChangeReservation="change-reservation",l.ChangeLessonReservation="change-lesson-reservation",l.RemindReservation="remind-reservation",l.RemindLessonReservation="remind-lesson-reservation",l.RemindReturnLoan="remind-return-loan",l.InviteRatingReservation="invite-rating-reservation",l.CustomReservation="custom-reservation",l.CustomLessonReservation="custom-lesson-reservation",l.CustomBeegoAppointment="custom-beego-appointment",l.CustomLoan="custom-loan",l}(R||{}),T=function(l){return l.Email="email",l.Sms="sms",l}(T||{}),I=function(l){return l.User="user",l.Client="client",l.Employee="employee",l}(I||{})},72792(Q,H,y){"use strict";y.d(H,{g:()=>L});var R=y(95386),T=y.n(R),I=y(18322),l=y(71472),E=y(90252),M=y(8137);let L=(()=>{class k extends l.K{api;loadingService;url="/communication-templates";constructor(r,c){super(c),this.api=r,this.loadingService=c}getAll(){var r=this;return T()(function*(){return r.process(r.api.get(`${r.url}`))})()}getAllForCustomMessageType(r){var c=this;return T()(function*(){return c.process(c.api.get(`${c.url}/message-type?messageType=${r}`))})()}getOne(r){var c=this;return T()(function*(){return c.process(c.api.get(`${c.url}/${r}`))})()}getVariables(r){return this.process(this.api.get(`${this.url}/variables?messageType=${r}`))}getHtmlExample(r,c){return this.process(this.api.put(`${this.url}/example`,{html:r,messageType:c}))}updateStandard(r,c){return this.process(this.api.put(`${this.url}/${r}`,c))}updateIsEnabled(r,c){return this.process(this.api.put(`${this.url}/${r}/is-enabled`,{isEnabled:c}))}updateCustom(r,c){return this.process(this.api.put(`${this.url}/${r}/custom`,c))}createCustom(r){return this.process(this.api.post(`${this.url}/custom`,r))}deleteCustom(r){return this.process(this.api.delete(`${this.url}/${r}/custom`))}static \u0275fac=function(c){return new(c||k)(M.KVO(I.j),M.KVO(E.U))};static \u0275prov=M.jDH({token:k,factory:k.\u0275fac,providedIn:"root"})}return k})()},55963(Q,H,y){"use strict";y.d(H,{B:()=>L});var R=y(79748),T=y(34456),I=y(18891),l=y(76925),E=y(8137),M=y(44436);let L=(()=>{class k{static \u0275fac=function(c){return new(c||k)};static \u0275mod=M.$C({type:k});static \u0275inj=E.G2t({imports:[R.MD,T.YN,T.X1,I.bv,l.E]})}return k})()},68419(Q){self,Q.exports=(()=>{"use strict";var H={321:(T,I)=>{Object.defineProperty(I,"__esModule",{value:!0}),I.ConsoleLogger=void 0;var l=function(){function E(M,L){this.debug=M,this.suppressErrorLogging=L}return E.prototype.prefixString=function(){return"</> quill-image-compress: "},Object.defineProperty(E.prototype,"log",{get:function(){return this.debug?console.log.bind(console,this.prefixString()):function(){}}
3,enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"error",{get:function(){return this.suppressErrorLogging?function(){}:console.error.bind(console,this.prefixString())},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"warn",{get:function(){return this.suppressErrorLogging?function(){}:console.warn.bind(console,this.prefixString())},enumerable:!1,configurable:!0}),E}();I.ConsoleLogger=l},337:function(T,I){var l=this&&this.__awaiter||function(M,L,k,x){return new(k||(k=Promise))(function(r,c){function b(d){try{h(x.next(d))}catch(s){c(s)}}function m(d){try{h(x.throw(d))}catch(s){c(s)}}function h(d){var s;d.done?r(d.value):(s=d.value,s instanceof k?s:new k(function(p){p(s)})).then(b,m)}h((x=x.apply(M,L||[])).next())})},E=this&&this.__generator||function(M,L){var k,x,r,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},b=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return b.next=m(0),b.throw=m(1),b.return=m(2),"function"==typeof Symbol&&(b[Symbol.iterator]=function(){return this}),b;function m(h){return function(d){return function(s){if(k)throw new TypeError("Generator is already executing.");for(;b&&(b=0,s[0]&&(c=0)),c;)try{if(k=1,x&&(r=2&s[0]?x.return:s[0]?x.throw||((r=x.return)&&r.call(x),0):x.next)&&!(r=r.call(x,s[1])).done)return r;switch(x=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return c.label++,{value:s[1],done:!1};case 5:c.label++,x=s[1],s=[0];continue;case 7:s=c.ops.pop(),c.trys.pop();continue;default:if(!((r=(r=c.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){c=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){c.label=s[1];break}if(6===s[0]&&c.label<r[1]){c.label=r[1],r=s;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(s);break}r[2]&&c.ops.pop(),c.trys.pop();continue}s=L.call(M,c)}catch(p){s=[6,p],x=0}finally{k=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([h,d])}}};Object.defineProperty(I,"__esModule",{value:!0}),I.downscaleImage=function(M,L,k,x,r,c,b,m){return l(this,void 0,void 0,function(){var h,d,s,p,v,A,f,D;return E(this,function(z){switch(z.label){case 0:return h=L.split(";")[0].split(":")[1],r=r||"image/jpeg",m=m||.7,(d=new Image).src=L,[4,new Promise(function(_){d.onload=function(){_()}})];case 1:return z.sent(),s=function(_,F,Y,K){if(Y&&K&&_<=Y&&F<=K)return[_,F];if(Y&&_>Y){var Z=Y,X=Math.floor(F/_*Z);if(K&&X>K){var J=K;return[Math.floor(_/F*J),J]}return[Z,X]}return K&&F>K?(X=K,[Z=Math.floor(_/F*X),X]):[F,_]}(d.width,d.height,k,x),p=s[0],v=s[1],(A=document.createElement("canvas")).width=p,A.height=v,f=A.getContext("2d"),"image/jpeg"===r&&(f.fillStyle="#FFFFFF",f.fillRect(0,0,d.width,d.height)),b?.includes(h)?[2,L]:(c?.includes(h)&&(r=h),f.drawImage(d,0,0,p,v),D=A.toDataURL(r,m),M.log("downscaling image...",{args:{dataUrl:L,maxWidth:k,maxHeight:x,imageType:r,ignoreImageTypes:b,keepImageTypes:c,imageQuality:m},newHeight:v,newWidth:p}),[2,D])}})})}},922:function(T,I){var l=this&&this.__awaiter||function(M,L,k,x){return new(k||(k=Promise))(function(r,c){function b(d){try{h(x.next(d))}catch(s){c(s)}}function m(d){try{h(x.throw(d))}catch(s){c(s)}}function h(d){var s;d.done?r(d.value):(s=d.value,s instanceof k?s:new k(function(p){p(s)})).then(b,m)}h((x=x.apply(M,L||[])).next())})},E=this&&this.__generator||function(M,L){var k,x,r,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},b=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return b.next=m(0),b.throw=m(1),b.return=m(2),"function"==typeof Symbol&&(b[Symbol.iterator]=function(){return this}),b;function m(h){return function(d){return function(s){if(k)throw new TypeError("Generator is already executing.");for(;b&&(b=0,s[0]&&(c=0)),c;)try{if(k=1,x&&(r=2&s[0]?x.return:s[0]?x.throw||((r=x.return)&&r.call(x),0):x.next)&&!(r=r.call(x,s[1])).done)return r;switch(x=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return c.label++,{value:s[1],done:!1};case 5:c.label++,x=s[1],s=[0];continue;case 7:s=c.ops.pop(),c.trys.pop();continue;default:if(!((r=(r=c.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){c=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){c.label=s[1];break}if(6===s[0]&&c.label<r[1]){c.label=r[1],r=s;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(s);break}r[2]&&c.ops.pop(),c.trys.pop();continue}s=L.call(M,c)}
3catch(p){s=[6,p],x=0}finally{k=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([h,d])}}};Object.defineProperty(I,"__esModule",{value:!0}),I.file2b64=function(M){return l(this,void 0,void 0,function(){var L,k;return E(this,function(x){return L=new FileReader,k=new Promise(function(r,c){L.addEventListener("load",function(){var b,m=null===(b=L.result)||void 0===b?void 0:b.toString();m?r(m):c("could not convert file to base64")},!1)}),L.readAsDataURL(M),[2,k]})})}},457:(T,I)=>{Object.defineProperty(I,"__esModule",{value:!0}),I.warnAboutOptions=function(l,E){l.maxWidth=l.maxWidth||1e3,l.maxHeight=l.maxHeight||1e3,l.maxWidth&&"number"!=typeof l.maxWidth&&(E.warn("[config error] 'maxWidth' is required to be a \"number\" (in pixels), \nreceived: ".concat(l.maxWidth,"\n-> using default 1000")),l.maxWidth=1e3),l.maxHeight&&"number"!=typeof l.maxHeight&&(E.warn("[config error] 'maxHeight' is required to be a \"number\" (in pixels), \nreceived: ".concat(l.maxHeight,"\n-> using default 1000")),l.maxHeight=1e3),l.quality&&"number"!=typeof l.quality&&(E.warn("quill.imageCompressor: [config error] 'quality' is required to be a \"number\", \nreceived: ".concat(l.quality,"\n-> using default 0.7")),l.quality=.7),!l.imageType||"string"==typeof l.imageType&&l.imageType.startsWith("image/")||(E.warn('quill.imageCompressor: [config error] \'imageType\' is required be in the form of "image/png" or "image/jpeg" etc ..., \nreceived: '.concat(l.imageType,"\n-> using default image/jpeg")),l.imageType="image/jpeg"),l.keepImageTypes||(l.keepImageTypes=[]),l.keepImageTypes&&!Array.isArray(l.keepImageTypes)&&(E.warn("quill.imageCompressor: [config error] 'keepImageTypes' is required to be a \"array\", received: ".concat(l.keepImageTypes," -> using default []")),l.keepImageTypes=[]),l.ignoreImageTypes||(l.ignoreImageTypes=[]),l.ignoreImageTypes&&!Array.isArray(l.ignoreImageTypes)&&(E.warn("quill.imageCompressor: [config error] 'ignoreImageTypes' is required to be a \"array\", received: ".concat(l.ignoreImageTypes," -> using default []")),l.ignoreImageTypes=[]),l.handleOnPaste&&"boolean"!=typeof l.handleOnPaste&&(E.warn("quill.imageCompressor: [config error] 'handlePaste' is required to be a \"boolean\", received: ".concat(l.ignoreImageTypes," -> using default true")),l.handleOnPaste=!0),l.insertIntoEditor&&"function"!=typeof l.insertIntoEditor&&(E.warn("quill.imageCompressor: [config error] 'insertIntoEditor' is required to be a \"function\", received: ".concat(l.insertIntoEditor," -> using default undefined")),l.insertIntoEditor=void 0)}},423:function(T,I,l){var E=this&&this.__awaiter||function(m,h,d,s){return new(d||(d=Promise))(function(p,v){function A(z){try{D(s.next(z))}catch(_){v(_)}}function f(z){try{D(s.throw(z))}catch(_){v(_)}}function D(z){var _;
3z.done?p(z.value):(_=z.value,_ instanceof d?_:new d(function(F){F(_)})).then(A,f)}D((s=s.apply(m,h||[])).next())})},M=this&&this.__generator||function(m,h){var d,s,p,v={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]},A=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return A.next=f(0),A.throw=f(1),A.return=f(2),"function"==typeof Symbol&&(A[Symbol.iterator]=function(){return this}),A;function f(D){return function(z){return function(_){if(d)throw new TypeError("Generator is already executing.");for(;A&&(A=0,_[0]&&(v=0)),v;)try{if(d=1,s&&(p=2&_[0]?s.return:_[0]?s.throw||((p=s.return)&&p.call(s),0):s.next)&&!(p=p.call(s,_[1])).done)return p;switch(s=0,p&&(_=[2&_[0],p.value]),_[0]){case 0:case 1:p=_;break;case 4:return v.label++,{value:_[1],done:!1};case 5:v.label++,s=_[1],_=[0];continue;case 7:_=v.ops.pop(),v.trys.pop();continue;default:if(!((p=(p=v.trys).length>0&&p[p.length-1])||6!==_[0]&&2!==_[0])){v=0;continue}if(3===_[0]&&(!p||_[1]>p[0]&&_[1]<p[3])){v.label=_[1];break}if(6===_[0]&&v.label<p[1]){v.label=p[1],p=_;break}if(p&&v.label<p[2]){v.label=p[2],v.ops.push(_);break}p[2]&&v.ops.pop(),v.trys.pop();continue}_=h.call(m,v)}catch(F){_=[6,F],s=0}finally{d=p=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([D,z])}}};Object.defineProperty(I,"__esModule",{value:!0}),I.imageCompressor=void 0;var L=l(379),k=l(457),x=l(922),r=l(337),c=l(321),b=function(){function m(h,d){var s=this;this.quill=h,this.options=d||{};var p=!!d.debug;this.Logger=new c.ConsoleLogger(p,!!d.suppressErrorLogging),(0,k.warnAboutOptions)(d,this.Logger),this.imageDrop=new L.ImageDrop(h,function(f){return E(s,void 0,void 0,function(){var D;return M(this,function(z){switch(z.label){case 0:return this.Logger.log("onImageDrop",{dataUrl:f}),[4,this.downscaleImageFromUrl(f)];case 1:return D=z.sent(),this.insertToEditor(D,m.b64toBlob(D)),[2]}})})},this.Logger,!1!==this.options.handleOnPaste),this.Logger.log("fileChanged",{options:d,quill:h,debug:p});var A=this.quill.getModule("toolbar");A?A.addHandler("image",function(){return s.selectLocalImage()}):this.Logger.error("Quill toolbar module not found! need { toolbar: // options } in Quill.modules for image icon to sit in")}return m.b64toBlob=function(h){for(var d=atob(h.split(",")[1]),s=h.slice(5).split(";")[0],p=new ArrayBuffer(d.length),v=new Uint8Array(p),A=0;A<d.length;A++)v[A]=d.charCodeAt(A);return new Blob([p],{type:s})},m.prototype.selectLocalImage=function(h){var d=this;this.range=this.quill.getSelection(),this.fileHolder=document.createElement("input"),this.fileHolder.setAttribute("type","file"),this.fileHolder.setAttribute("accept","image/*"),this.fileHolder.setAttribute("style","visibility:hidden"),this.fileHolder.onchange=function(){return d.fileChanged().then(function(){return h&&h()})},document.body.appendChild(this.fileHolder),this.fileHolder.click(),window.requestAnimationFrame(function(){d.fileHolder&&document.body.removeChild(d.fileHolder)})},m.prototype.fileChanged=function(h){return E(this,void 0,void 0,function(){var d,s,p,v,A;return M(this,function(f){switch(f.label){case 0:return(d=h||(null===(A=this.fileHolder)||void 0===A?void 0:A.files))&&d.length?(this.Logger.log("fileChanged",{file:s=d[0]}),s?[4,(0,x.file2b64)(s)]:[2]):[2];case 1:return p=f.sent(),[4,this.downscaleImageFromUrl(p)];case 2:return v=f.sent(),this.insertToEditor(v,m.b64toBlob(v)),[2]}})})},m.prototype.downscaleImageFromUrl=function(h){return E(this,void 0,void 0,function(){var d;return M(this,function(s){switch(s.label){case 0:return[4,(0,r.downscaleImage)(this.Logger,h,this.options.maxWidth,this.options.maxHeight,this.options.imageType,this.options.keepImageTypes,this.options.ignoreImageTypes,this.options.quality)];case 1:return d=s.sent(),this.Logger.log("downscaleImageFromUrl",{dataUrl:h,dataUrlCompressed:d}),[2,d]}})})},m.prototype.insertToEditor=function(h,d){if(this.options.insertIntoEditor)this.options.insertIntoEditor(h,d,this.quill);else{this.Logger.log("insertToEditor",{url:h}),this.range=this.quill.getSelection();var s=this.range;if(!s)return;this.logFileSize(h),this.quill.insertEmbed(s.index,"image","".concat(h),"user"),s.index++,this.quill.setSelection(s,"api")}},m.prototype.logFileSize=function(h){var d=(Math.round(3*(h.length-22)/4)/1024).toFixed(0);this.Logger.log("estimated img size: "+d+" kb")},m}();I.imageCompressor=b,window.imageCompressor=b,I.default=b},379:function(T,I,l){var E=this&&this.__awaiter||function(r,c,b,m){return new(b||(b=Promise))(function(h,d){function s(A){try{v(m.next(A))}catch(f){d(f)}}function p(A){try{v(m.throw(A))}catch(f){d(f)}}function v(A){var f;A.done?h(A.value):(f=A.value,f instanceof b?f:new b(function(D){D(f)})).then(s,p)}v((m=m.apply(r,c||[])).next())})},M=this&&this.__generator||function(r,c){var b,m,h,d={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=p(0),s.throw=p(1),s.return=p(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function p(v){return function(A){return function(f){if(b)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(d=0)),d;)try{if(b=1,m&&(h=2&f[0]?m.return:f[0]?m.throw||((h=m.return)&&h.call(m),0):m.next)&&!(
3h=h.call(m,f[1])).done)return h;switch(m=0,h&&(f=[2&f[0],h.value]),f[0]){case 0:case 1:h=f;break;case 4:return d.label++,{value:f[1],done:!1};case 5:d.label++,m=f[1],f=[0];continue;case 7:f=d.ops.pop(),d.trys.pop();continue;default:if(!((h=(h=d.trys).length>0&&h[h.length-1])||6!==f[0]&&2!==f[0])){d=0;continue}if(3===f[0]&&(!h||f[1]>h[0]&&f[1]<h[3])){d.label=f[1];break}if(6===f[0]&&d.label<h[1]){d.label=h[1],h=f;break}if(h&&d.label<h[2]){d.label=h[2],d.ops.push(f);break}h[2]&&d.ops.pop(),d.trys.pop();continue}f=c.call(r,d)}catch(D){f=[6,D],m=0}finally{b=h=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([v,A])}}};Object.defineProperty(I,"__esModule",{value:!0}),I.ImageDrop=void 0;var L=l(922),k=function(){function r(c,b,m,h){var d=this;this.quill=c,this.onNewDataUrl=b,this.logger=m,this.handleOnPaste=h,this.localDrag=!1,this.quill.root.addEventListener("dragstart",function(s){return d.handleDragStart(s)},!1),this.quill.root.addEventListener("dragend",function(s){return d.handleDragEnd(s)},!1),this.quill.root.addEventListener("drop",function(s){return d.handleDrop(s)},!0),this.handleOnPaste&&this.quill.root.addEventListener("paste",function(s){return d.handlePaste(s)},!0)}return r.prototype.handleDragStart=function(c){this.localDrag=!0},r.prototype.handleDragEnd=function(c){this.localDrag=!1},r.prototype.handleDrop=function(c){return E(this,void 0,void 0,function(){var b,m,h,d,s,p,v,A,f,D;return M(this,function(z){switch(z.label){case 0:return this.localDrag?[2]:(c.preventDefault(),document.caretRangeFromPoint&&(b=document.getSelection(),m=document.caretRangeFromPoint(c.clientX,c.clientY),b&&m&&b.setBaseAndExtent(m.startContainer,m.startOffset,m.startContainer,m.startOffset)),this.logger.log("handleDrop",{evt:c}),h=null===(v=c.dataTransfer)||void 0===v?void 0:v.files,(d=Array.from(h||[]).filter(function(_){return x(_.type)})).length>0?(c.stopPropagation(),this.logger.log("handleDrop","found files",{evt:c,files:h,imageFiles:d}),[4,this.pasteFilesIntoQuill(d)]):[3,2]);case 1:return z.sent(),[2];case 2:return null!==(A=c.dataTransfer)&&void 0!==A&&A.items?(c.stopPropagation(),this.logger.log("handleDrop","found items",{evt:c,files:h,imageFiles:d}),[4,this.handleDataTransferList(null===(f=c.dataTransfer)||void 0===f?void 0:f.items,c)]):[3,4];case 3:return z.sent(),[2];case 4:return s=null===(D=c.dataTransfer)||void 0===D?void 0:D.getData("URL"),this.logger.log("handleDrop","trying getData('URL')",{draggedUrl:s}),s?[4,fetch(s)]:[3,8];case 5:return[4,z.sent().blob()];case 6:return p=z.sent(),this.logger.log("handleDrop","blob from drag event",{evt:c,files:h,imageFiles:d}),[4,this.pasteFilesIntoQuill([p])];case 7:z.sent(),z.label=8;case 8:return[2]}})})},r.prototype.handlePaste=function(c){return E(this,void 0,void 0,function(){var b;return M(this,function(m){switch(m.label){case 0:return[4,this.handleDataTransferList(null===(b=c.clipboardData)||void 0===b?void 0:b.items,c)];case 1:return m.sent(),[2]}})})},r.prototype.handleDataTransferList=function(c,b){return E(this,void 0,void 0,function(){var m,h,d,s;return M(this,function(p){switch(p.label){case 0:return m=Array.from(c||[]),h=m.filter(function(v){return"file"===v.kind&&x(v.type)}),d=m.map(function(v){return{type:v.type,kind:v.kind}}),this.logger.log("handleDataTransferList",{fileTypes:d,imageCount:h.length}),h.length?(b.preventDefault(),b.stopPropagation(),s=h.map(function(v){return v.getAsFile()}),[4,this.pasteFilesIntoQuill(s)]):[2];case 1:return p.sent(),[2]}})})},r.prototype.pasteFilesIntoQuill=function(c){return E(this,void 0,void 0,function(){var b=this;return M(this,function(m){switch(m.label){case 0:return this.logger.log(" pasteFilesIntoQuill","pasting ".concat(c.length," images...")),[4,Promise.all(c.map(function(h,d){return E(b,void 0,void 0,function(){var s;return M(this,function(p){switch(p.label){case 0:return h?[4,(0,L.file2b64)(h)]:[2];case 1:return s=p.sent(),this.logger.log(" pasteFilesIntoQuill","pasting image (".concat(d,")")),this.onNewDataUrl(s),[2]}})})}))];case 1:return m.sent(),this.logger.log(" pasteFilesIntoQuill","done"),[2]}})})},r}();function x(r){return!!r.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)}I.ImageDrop=k}},y={};return function T(I){var l=y[I];if(void 0!==l)return l.exports;var E=y[I]={exports:{}};return H[I].call(E.exports,E,E.exports,T),E.exports}(423)})()}}]); 4//# debugId=e038ece8-ea63-5b19-8d16-5d0903664144
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.