Sid Gifari File Manager
🏠 Root
/
home
/
ailwtbdh
/
superstepsgroup.com
/
wp-content
/
plugins
/
all-in-one-seo-pack
/
dist
/
Lite
/
assets
/
js
/
Editing: vendor-quill.e1eec88c.js
import{l as as,k as cs,E as M,T as jt,I as us,S as N,A as hs,B as Ce,L as H,m as ds,P as At,R as Re,n as fs,o as Oe,C as Ie,q as zt,v as z,w as rt}from"./vendor-other.7b559694.js";import{r as Be,a as Me,b as Kt,c as it,e as W}from"./vendor-lodash.d3ad8b99.js";var bt={exports:{}},yt={},ne;function gs(){if(ne)return yt;ne=1,Object.defineProperty(yt,"__esModule",{value:!0});const n=Be(),t=Me();var e;return(function(s){function i(a={},u={},f=!1){typeof a!="object"&&(a={}),typeof u!="object"&&(u={});let m=n(u);f||(m=Object.keys(m).reduce((c,h)=>(m[h]!=null&&(c[h]=m[h]),c),{}));for(const c in a)a[c]!==void 0&&u[c]===void 0&&(m[c]=a[c]);return Object.keys(m).length>0?m:void 0}s.compose=i;function r(a={},u={}){typeof a!="object"&&(a={}),typeof u!="object"&&(u={});const f=Object.keys(a).concat(Object.keys(u)).reduce((m,c)=>(t(a[c],u[c])||(m[c]=u[c]===void 0?null:u[c]),m),{});return Object.keys(f).length>0?f:void 0}s.diff=r;function l(a={},u={}){a=a||{};const f=Object.keys(u).reduce((m,c)=>(u[c]!==a[c]&&a[c]!==void 0&&(m[c]=u[c]),m),{});return Object.keys(a).reduce((m,c)=>(a[c]!==u[c]&&u[c]===void 0&&(m[c]=null),m),f)}s.invert=l;function o(a,u,f=!1){if(typeof a!="object")return u;if(typeof u!="object")return;if(!f)return u;const m=Object.keys(u).reduce((c,h)=>(a[h]===void 0&&(c[h]=u[h]),c),{});return Object.keys(m).length>0?m:void 0}s.transform=o})(e||(e={})),yt.default=e,yt}var Et={},re;function De(){if(re)return Et;re=1,Object.defineProperty(Et,"__esModule",{value:!0});var n;return(function(t){function e(s){return typeof s.delete=="number"?s.delete:typeof s.retain=="number"?s.retain:typeof s.retain=="object"&&s.retain!==null?1:typeof s.insert=="string"?s.insert.length:1}t.length=e})(n||(n={})),Et.default=n,Et}var xt={},le;function ms(){if(le)return xt;le=1,Object.defineProperty(xt,"__esModule",{value:!0});const n=De();class t{constructor(s){this.ops=s,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(s){s||(s=1/0);const i=this.ops[this.index];if(i){const r=this.offset,l=n.default.length(i);if(s>=l-r?(s=l-r,this.index+=1,this.offset=0):this.offset+=s,typeof i.delete=="number")return{delete:s};{const o={};return i.attributes&&(o.attributes=i.attributes),typeof i.retain=="number"?o.retain=s:typeof i.retain=="object"&&i.retain!==null?o.retain=i.retain:typeof i.insert=="string"?o.insert=i.insert.substr(r,s):o.insert=i.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const s=this.ops[this.index];return s?typeof s.delete=="number"?"delete":typeof s.retain=="number"||typeof s.retain=="object"&&s.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const s=this.offset,i=this.index,r=this.next(),l=this.ops.slice(this.index);return this.offset=s,this.index=i,[r].concat(l)}}else return[]}}return xt.default=t,xt}var oe;function ps(){return oe||(oe=1,(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const e=as(),s=Be(),i=Me(),r=gs();t.AttributeMap=r.default;const l=De();t.Op=l.default;const o=ms();t.OpIterator=o.default;const a="\0",u=(m,c)=>{if(typeof m!="object"||m===null)throw new Error(`cannot retain a ${typeof m}`);if(typeof c!="object"||c===null)throw new Error(`cannot retain a ${typeof c}`);const h=Object.keys(m)[0];if(!h||h!==Object.keys(c)[0])throw new Error(`embed types not matched: ${h} != ${Object.keys(c)[0]}`);return[h,m[h],c[h]]};class f{constructor(c){Array.isArray(c)?this.ops=c:c!=null&&Array.isArray(c.ops)?this.ops=c.ops:this.ops=[]}static registerEmbed(c,h){this.handlers[c]=h}static unregisterEmbed(c){delete this.handlers[c]}static getHandler(c){const h=this.handlers[c];if(!h)throw new Error(`no handlers for embed type "${c}"`);return h}insert(c,h){const g={};return typeof c=="string"&&c.length===0?this:(g.insert=c,h!=null&&typeof h=="object"&&Object.keys(h).length>0&&(g.attributes=h),this.push(g))}delete(c){return c<=0?this:this.push({delete:c})}retain(c,h){if(typeof c=="number"&&c<=0)return this;const g={retain:c};return h!=null&&typeof h=="object"&&Object.keys(h).length>0&&(g.attributes=h),this.push(g)}push(c){let h=this.ops.length,g=this.ops[h-1];if(c=s(c),typeof g=="object"){if(typeof c.delete=="number"&&typeof g.delete=="number")return this.ops[h-1]={delete:g.delete+c.delete},this;if(typeof g.delete=="number"&&c.insert!=null&&(h-=1,g=this.ops[h-1],typeof g!="object"))return this.ops.unshift(c),this;if(i(c.attributes,g.attributes)){if(typeof c.insert=="string"&&typeof g.insert=="string")return this.ops[h-1]={insert:g.insert+c.insert},typeof c.attributes=="object"&&(this.ops[h-1].attributes=c.attributes),this;if(typeof c.retain=="number"&&typeof g.retain=="number")return this.ops[h-1]={retain:g.retain+c.retain},typeof c.attributes=="object"&&(this.ops[h-1].attributes=c.attributes),this}}return h===this.ops.length?this.ops.push(c):this.ops.splice(h,0,c),this}chop(){const c=this.ops[this.ops.length-1];return c&&typeof c.retain=="number"&&!c.attributes&&this.ops.pop(),this}filter(c){return this.ops.filter(c)}forEach(c){this.ops.forEach(c)}map(c){return this.ops.map(c)}partition(c){const h=[],g=[];return this.forEach(p=>{(c(p)?h:g).push(p)}),[h,g]}reduce(c,h){return this.ops.reduce(c,h)}changeLength(){return this.reduce((c,h)=>h.insert?c+l.default.length(h):h.delete?c-h.delete:c,0)}length(){return this.reduce((c,h)=>c+l.default.length(h),0)}slice(c=0,h=1/0){const g=[],p=new o.default(this.ops);let x=0;for(;x<h&&p.hasNext();){let b;x<c?b=p.next(c-x):(b=p.next(h-x),g.push(b)),x+=l.default.length(b)}return new f(g)}compose(c){const h=new o.default(this.ops),g=new o.default(c.ops),p=[],x=g.peek();if(x!=null&&typeof x.retain=="number"&&x.attributes==null){let q=x.retain;for(;h.peekType()==="insert"&&h.peekLength()<=q;)q-=h.peekLength(),p.push(h.next());x.retain-q>0&&g.next(x.retain-q)}const b=new f(p);for(;h.hasNext()||g.hasNext();)if(g.peekType()==="insert")b.push(g.next());else if(h.peekType()==="delete")b.push(h.next());else{const q=Math.min(h.peekLength(),g.peekLength()),w=h.next(q),v=g.next(q);if(v.retain){const k={};if(typeof w.retain=="number")k.retain=typeof v.retain=="number"?q:v.retain;else if(typeof v.retain=="number")w.retain==null?k.insert=w.insert:k.retain=w.retain;else{const C=w.retain==null?"insert":"retain",[Z,pt,ls]=u(w[C],v.retain),os=f.getHandler(Z);k[C]={[Z]:os.compose(pt,ls,C==="retain")}}const S=r.default.compose(w.attributes,v.attributes,typeof w.retain=="number");if(S&&(k.attributes=S),b.push(k),!g.hasNext()&&i(b.ops[b.ops.length-1],k)){const C=new f(h.rest());return b.concat(C).chop()}}else typeof v.delete=="number"&&(typeof w.retain=="number"||typeof w.retain=="object"&&w.retain!==null)&&b.push(v)}return b.chop()}concat(c){const h=new f(this.ops.slice());return c.ops.length>0&&(h.push(c.ops[0]),h.ops=h.ops.concat(c.ops.slice(1))),h}diff(c,h){if(this.ops===c.ops)return new f;const g=[this,c].map(w=>w.map(v=>{if(v.insert!=null)return typeof v.insert=="string"?v.insert:a;const k=w===c?"on":"with";throw new Error("diff() called "+k+" non-document")}).join("")),p=new f,x=e(g[0],g[1],h,!0),b=new o.default(this.ops),q=new o.default(c.ops);return x.forEach(w=>{let v=w[1].length;for(;v>0;){let k=0;switch(w[0]){case e.INSERT:k=Math.min(q.peekLength(),v),p.push(q.next(k));break;case e.DELETE:k=Math.min(v,b.peekLength()),b.next(k),p.delete(k);break;case e.EQUAL:k=Math.min(b.peekLength(),q.peekLength(),v);const S=b.next(k),C=q.next(k);i(S.insert,C.insert)?p.retain(k,r.default.diff(S.attributes,C.attributes)):p.push(C).delete(k);break}v-=k}}),p.chop()}eachLine(c,h=` `){const g=new o.default(this.ops);let p=new f,x=0;for(;g.hasNext();){if(g.peekType()!=="insert")return;const b=g.peek(),q=l.default.length(b)-g.peekLength(),w=typeof b.insert=="string"?b.insert.indexOf(h,q)-q:-1;if(w<0)p.push(g.next());else if(w>0)p.push(g.next(w));else{if(c(p,g.next(1).attributes||{},x)===!1)return;x+=1,p=new f}}p.length()>0&&c(p,{},x)}invert(c){const h=new f;return this.reduce((g,p)=>{if(p.insert)h.delete(l.default.length(p));else{if(typeof p.retain=="number"&&p.attributes==null)return h.retain(p.retain),g+p.retain;if(p.delete||typeof p.retain=="number"){const x=p.delete||p.retain;return c.slice(g,g+x).forEach(q=>{p.delete?h.push(q):p.retain&&p.attributes&&h.retain(l.default.length(q),r.default.invert(p.attributes,q.attributes))}),g+x}else if(typeof p.retain=="object"&&p.retain!==null){const x=c.slice(g,g+1),b=new o.default(x.ops).next(),[q,w,v]=u(p.retain,b.insert),k=f.getHandler(q);return h.retain({[q]:k.invert(w,v)},r.default.invert(p.attributes,b.attributes)),g+1}}return g},0),h.chop()}transform(c,h=!1){if(h=!!h,typeof c=="number")return this.transformPosition(c,h);const g=c,p=new o.default(this.ops),x=new o.default(g.ops),b=new f;for(;p.hasNext()||x.hasNext();)if(p.peekType()==="insert"&&(h||x.peekType()!=="insert"))b.retain(l.default.length(p.next()));else if(x.peekType()==="insert")b.push(x.next());else{const q=Math.min(p.peekLength(),x.peekLength()),w=p.next(q),v=x.next(q);if(w.delete)continue;if(v.delete)b.push(v);else{const k=w.retain,S=v.retain;let C=typeof S=="object"&&S!==null?S:q;if(typeof k=="object"&&k!==null&&typeof S=="object"&&S!==null){const Z=Object.keys(k)[0];if(Z===Object.keys(S)[0]){const pt=f.getHandler(Z);pt&&(C={[Z]:pt.transform(k[Z],S[Z],h)})}}b.retain(C,r.default.transform(w.attributes,v.attributes,h))}}return b.chop()}transformPosition(c,h=!1){h=!!h;const g=new o.default(this.ops);let p=0;for(;g.hasNext()&&p<=c;){const x=g.peekLength(),b=g.peekType();if(g.next(),b==="delete"){c-=Math.min(x,c-p);continue}else b==="insert"&&(p<c||!h)&&(c+=x);p+=x}return c}}f.Op=l.default,f.OpIterator=o.default,f.AttributeMap=r.default,f.handlers={},t.default=f,n.exports=f,n.exports.default=f})(bt,bt.exports)),bt.exports}var B=ps();const E=cs(B);class P extends M{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}P.blotName="break";P.tagName="BR";let j=class extends jt{};const bs={"&":"&","<":"<",">":">",'"':""","'":"'"};function St(n){return n.replace(/[&<>"']/g,t=>bs[t])}class L extends us{static allowedChildren=[L,P,M,j];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(t,e){const s=L.order.indexOf(t),i=L.order.indexOf(e);return s>=0||i>=0?s-i:t===e?0:t<e?-1:1}formatAt(t,e,s,i){if(L.compare(this.statics.blotName,s)<0&&this.scroll.query(s,N.BLOT)){const r=this.isolate(t,e);i&&r.wrap(s,i)}else super.formatAt(t,e,s,i)}optimize(t){if(super.optimize(t),this.parent instanceof L&&L.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}}const ae=1;class A extends Ce{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Ue(this)),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,e,s,i){e<=0||(this.scroll.query(s,N.BLOCK)?t+e===this.length()&&this.format(s,i):super.formatAt(t,Math.min(e,this.length()-t-1),s,i),this.cache={})}insertAt(t,e,s){if(s!=null){super.insertAt(t,e,s),this.cache={};return}if(e.length===0)return;const i=e.split(` `),r=i.shift();r.length>0&&(t<this.length()-1||this.children.tail==null?super.insertAt(Math.min(t,this.length()-1),r):this.children.tail.insertAt(this.children.tail.length(),r),this.cache={});let l=this;i.reduce((o,a)=>(l=l.split(o,!0),l.insertAt(0,a),a.length),t+r.length)}insertBefore(t,e){const{head:s}=this.children;super.insertBefore(t,e),s instanceof P&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+ae),this.cache.length}moveChildren(t,e){super.moveChildren(t,e),this.cache={}}optimize(t){super.optimize(t),this.cache={}}path(t){return super.path(t,!0)}removeChild(t){super.removeChild(t),this.cache={}}split(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e&&(t===0||t>=this.length()-ae)){const i=this.clone();return t===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const s=super.split(t,e);return this.cache={},s}}A.blotName="block";A.tagName="P";A.defaultChild=P;A.allowedChildren=[P,L,M,j];class I extends M{attach(){super.attach(),this.attributes=new hs(this.domNode)}delta(){return new E().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const s=this.scroll.query(t,N.BLOCK_ATTRIBUTE);s!=null&&this.attributes.attribute(s,e)}formatAt(t,e,s,i){this.format(s,i)}insertAt(t,e,s){if(s!=null){super.insertAt(t,e,s);return}const i=e.split(` `),r=i.pop(),l=i.map(a=>{const u=this.scroll.create(A.blotName);return u.insertAt(0,a),u}),o=this.split(t);l.forEach(a=>{this.parent.insertBefore(a,o)}),r&&this.parent.insertBefore(this.scroll.create("text",r),o)}}I.scope=N.BLOCK_BLOT;function Ue(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(H).reduce((e,s)=>s.length()===0?e:e.insert(s.value(),R(s,{},t)),new E).insert(` `,R(n))}function R(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(t={...t,...n.formats()},e&&delete t["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?t:R(n.parent,t,e)}class U extends M{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\uFEFF";static value(){}constructor(t,e,s){super(t,e),this.selection=s,this.textNode=document.createTextNode(U.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,e){if(this.savedLength!==0){super.format(t,e);return}let s=this,i=0;for(;s!=null&&s.statics.scope!==N.BLOCK_BLOT;)i+=s.offset(s.parent),s=s.parent;s!=null&&(this.savedLength=U.CONTENTS.length,s.optimize(),s.formatAt(i,U.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof j?this.prev:null,s=e?e.length():0,i=this.next instanceof j?this.next:null,r=i?i.text:"",{textNode:l}=this,o=l.data.split(U.CONTENTS).join("");l.data=U.CONTENTS;let a;if(e)a=e,(o||i)&&(e.insertAt(e.length(),o+r),i&&i.remove());else if(i)a=i,i.insertAt(0,o);else{const u=document.createTextNode(o);a=this.scroll.create(u),this.parent.insertBefore(a,this)}if(this.remove(),t){const u=(c,h)=>e&&c===e.domNode?h:c===l?s+h-1:i&&c===i.domNode?s+o.length+h:null,f=u(t.start.node,t.start.offset),m=u(t.end.node,t.end.offset);if(f!==null&&m!==null)return{startNode:a.domNode,startOffset:f,endNode:a.domNode,endOffset:m}}return null}update(t,e){if(t.some(s=>s.type==="characterData"&&s.target===this.textNode)){const s=this.restore();s&&(e.range=s)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if(e.domNode.tagName==="A"){this.savedLength=U.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}}const Pt=new WeakMap,$t=["error","warn","log","info"];let _t="warn";function He(n){if(_t&&$t.indexOf(n)<=$t.indexOf(_t)){for(var t=arguments.length,e=new Array(t>1?t-1:0),s=1;s<t;s++)e[s-1]=arguments[s];console[n](...e)}}function K(n){return $t.reduce((t,e)=>(t[e]=He.bind(console,e,n),t),{})}K.level=n=>{_t=n};He.level=K.level;const Ot=K("quill:events"),ys=["selectionchange","mousedown","mouseup","click"];ys.forEach(n=>{document.addEventListener(n,function(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];Array.from(document.querySelectorAll(".ql-container")).forEach(i=>{const r=Pt.get(i);r&&r.emitter&&r.emitter.handleDOM(...e)})})});class y extends ds{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",Ot.error)}emit(){for(var t=arguments.length,e=new Array(t),s=0;s<t;s++)e[s]=arguments[s];return Ot.log.call(Ot,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),i=1;i<e;i++)s[i-1]=arguments[i];(this.domListeners[t.type]||[]).forEach(r=>{let{node:l,handler:o}=r;(t.target===l||l.contains(t.target))&&o(t,...s)})}listenDOM(t,e,s){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:s})}}const It=K("quill:selection");class Y{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=t,this.length=e}}class Es{constructor(t,e){this.emitter=e,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Y(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,y.sources.USER),1)}),this.emitter.on(y.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const s=this.getNativeRange();s!=null&&s.start.node!==this.cursor.textNode&&this.emitter.once(y.events.SCROLL_UPDATE,(i,r)=>{try{this.root.contains(s.start.node)&&this.root.contains(s.end.node)&&this.setNativeRange(s.start.node,s.start.offset,s.end.node,s.end.offset);const l=r.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(l?y.sources.SILENT:i)}catch{}})}),this.emitter.on(y.events.SCROLL_OPTIMIZE,(s,i)=>{if(i.range){const{startNode:r,startOffset:l,endNode:o,endOffset:a}=i.range;this.setNativeRange(r,l,o,a),this.update(y.sources.SILENT)}}),this.update(y.sources.SILENT)}handleComposition(){this.emitter.on(y.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(y.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout(()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(y.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const s=this.getNativeRange();if(!(s==null||!s.native.collapsed||this.scroll.query(t,N.BLOCK))){if(s.start.node!==this.cursor.textNode){const i=this.scroll.find(s.start.node,!1);if(i==null)return;if(i instanceof H){const r=i.split(s.start.offset);i.parent.insertBefore(this.cursor,r)}else i.insertBefore(this.cursor,s.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const s=this.scroll.length();t=Math.min(t,s-1),e=Math.min(t+e,s-1)-t;let i,[r,l]=this.scroll.leaf(t);if(r==null)return null;if(e>0&&l===r.length()){const[f]=this.scroll.leaf(t+1);if(f){const[m]=this.scroll.line(t),[c]=this.scroll.line(t+1);m===c&&(r=f,l=0)}}[i,l]=r.position(l,!0);const o=document.createRange();if(e>0)return o.setStart(i,l),[r,l]=this.scroll.leaf(t+e),r==null?null:([i,l]=r.position(l,!0),o.setEnd(i,l),o.getBoundingClientRect());let a="left",u;if(i instanceof Text){if(!i.data.length)return null;l<i.data.length?(o.setStart(i,l),o.setEnd(i,l+1)):(o.setStart(i,l-1),o.setEnd(i,l),a="right"),u=o.getBoundingClientRect()}else{if(!(r.domNode instanceof Element))return null;u=r.domNode.getBoundingClientRect(),l>0&&(a="right")}return{bottom:u.top+u.height,height:u.height,left:u[a],right:u[a],top:u.top,width:0}}getNativeRange(){const t=document.getSelection();if(t==null||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(e==null)return null;const s=this.normalizeNative(e);return It.info("getNativeRange",s),s}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();return e==null?[null,null]:[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Bt(this.root,document.activeElement)}normalizedToRange(t){const e=[[t.start.node,t.start.offset]];t.native.collapsed||e.push([t.end.node,t.end.offset]);const s=e.map(l=>{const[o,a]=l,u=this.scroll.find(o,!0),f=u.offset(this.scroll);return a===0?f:u instanceof H?f+u.index(o,a):f+u.length()}),i=Math.min(Math.max(...s),this.scroll.length()-1),r=Math.min(i,...s);return new Y(r,i-r)}normalizeNative(t){if(!Bt(this.root,t.startContainer)||!t.collapsed&&!Bt(this.root,t.endContainer))return null;const e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(s=>{let{node:i,offset:r}=s;for(;!(i instanceof Text)&&i.childNodes.length>0;)if(i.childNodes.length>r)i=i.childNodes[r],r=0;else if(i.childNodes.length===r)i=i.lastChild,i instanceof Text?r=i.data.length:i.childNodes.length>0?r=i.childNodes.length:r=i.childNodes.length+1;else break;s.node=i,s.offset=r}),e}rangeToNative(t){const e=this.scroll.length(),s=(i,r)=>{i=Math.min(e-1,i);const[l,o]=this.scroll.leaf(i);return l?l.position(o,r):[null,-1]};return[...s(t.index,!1),...s(t.index+t.length,!0)]}setNativeRange(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(It.info("setNativeRange",t,e,s,i),t!=null&&(this.root.parentNode==null||t.parentNode==null||s.parentNode==null))return;const l=document.getSelection();if(l!=null)if(t!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||r||t!==o.startContainer||e!==o.startOffset||s!==o.endContainer||i!==o.endOffset){t instanceof Element&&t.tagName==="BR"&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),s instanceof Element&&s.tagName==="BR"&&(i=Array.from(s.parentNode.childNodes).indexOf(s),s=s.parentNode);const a=document.createRange();a.setStart(t,e),a.setEnd(s,i),l.removeAllRanges(),l.addRange(a)}}else l.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.sources.API;if(typeof e=="string"&&(s=e,e=!1),It.info("setRange",t),t!=null){const i=this.rangeToNative(t);this.setNativeRange(...i,e)}else this.setNativeRange(null);this.update(s)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.sources.USER;const e=this.lastRange,[s,i]=this.getRange();if(this.lastRange=s,this.lastNative=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!Kt(e,this.lastRange)){if(!this.composing&&i!=null&&i.native.collapsed&&i.start.node!==this.cursor.textNode){const l=this.cursor.restore();l&&this.setNativeRange(l.startNode,l.startOffset,l.endNode,l.endOffset)}const r=[y.events.SELECTION_CHANGE,it(this.lastRange),it(e),t];this.emitter.emit(y.events.EDITOR_CHANGE,...r),t!==y.sources.SILENT&&this.emitter.emit(...r)}}}function Bt(n,t){try{t.parentNode}catch{return!1}return n.contains(t)}const xs=/^[ -~]*$/;class qs{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const s=ce(t),i=new E;return ks(s.ops.slice()).reduce((l,o)=>{const a=B.Op.length(o);let u=o.attributes||{},f=!1,m=!1;if(o.insert!=null){if(i.retain(a),typeof o.insert=="string"){const g=o.insert;m=!g.endsWith(` `)&&(e<=l||!!this.scroll.descendant(I,l)[0]),this.scroll.insertAt(l,g);const[p,x]=this.scroll.line(l);let b=W({},R(p));if(p instanceof A){const[q]=p.descendant(H,x);q&&(b=W(b,R(q)))}u=B.AttributeMap.diff(b,u)||{}}else if(typeof o.insert=="object"){const g=Object.keys(o.insert)[0];if(g==null)return l;const p=this.scroll.query(g,N.INLINE)!=null;if(p)(e<=l||this.scroll.descendant(I,l)[0])&&(m=!0);else if(l>0){const[x,b]=this.scroll.descendant(H,l-1);x instanceof j?x.value()[b]!==` `&&(f=!0):x instanceof M&&x.statics.scope===N.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(l,g,o.insert[g]),p){const[x]=this.scroll.descendant(H,l);if(x){const b=W({},R(x));u=B.AttributeMap.diff(b,u)||{}}}}e+=a}else if(i.push(o),o.retain!==null&&typeof o.retain=="object"){const g=Object.keys(o.retain)[0];if(g==null)return l;this.scroll.updateEmbedAt(l,g,o.retain[g])}Object.keys(u).forEach(g=>{this.scroll.formatAt(l,a,g,u[g])});const c=f?1:0,h=m?1:0;return e+=c+h,i.retain(c),i.delete(h),l+a+c+h},0),i.reduce((l,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(l,o.delete),l):l+B.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(s)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update(new E().retain(t).delete(e))}formatLine(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(s).forEach(r=>{this.scroll.lines(t,Math.max(e,1)).forEach(l=>{l.format(r,s[r])})}),this.scroll.optimize();const i=new E().retain(t).retain(e,it(s));return this.update(i)}formatText(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(s).forEach(r=>{this.scroll.formatAt(t,e,r,s[r])});const i=new E().retain(t).retain(e,it(s));return this.update(i)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new E)}getFormat(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=[],i=[];e===0?this.scroll.path(t).forEach(o=>{const[a]=o;a instanceof A?s.push(a):a instanceof H&&i.push(a)}):(s=this.scroll.lines(t,e),i=this.scroll.descendants(H,t,e));const[r,l]=[s,i].map(o=>{const a=o.shift();if(a==null)return{};let u=R(a);for(;Object.keys(u).length>0;){const f=o.shift();if(f==null)return u;u=Ns(R(f),u)}return u});return{...r,...l}}getHTML(t,e){const[s,i]=this.scroll.line(t);if(s){const r=s.length();return s.length()>=i+e&&!(i===0&&e===r)?ut(s,i,e,!0):ut(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(s=>typeof s.insert=="string").map(s=>s.insert).join("")}insertContents(t,e){const s=ce(e),i=new E().retain(t).concat(s);return this.scroll.insertContents(t,s),this.update(i)}insertEmbed(t,e,s){return this.scroll.insertAt(t,e,s),this.update(new E().retain(t).insert({[e]:s}))}insertText(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=e.replace(/\r\n/g,` `).replace(/\r/g,` `),this.scroll.insertAt(t,e),Object.keys(s).forEach(i=>{this.scroll.formatAt(t,e.length,i,s[i])}),this.update(new E().retain(t).insert(e,it(s)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if(t?.statics.blotName!==A.blotName)return!1;const e=t;return e.children.length>1?!1:e.children.head instanceof P}removeFormat(t,e){const s=this.getText(t,e),[i,r]=this.scroll.line(t+e);let l=0,o=new E;i!=null&&(l=i.length()-r,o=i.delta().slice(r,r+l-1).insert(` `));const u=this.getContents(t,e+l).diff(new E().insert(s).concat(o)),f=new E().retain(t).concat(u);return this.applyDelta(f)}update(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const i=this.delta;if(e.length===1&&e[0].type==="characterData"&&e[0].target.data.match(xs)&&this.scroll.find(e[0].target)){const r=this.scroll.find(e[0].target),l=R(r),o=r.offset(this.scroll),a=e[0].oldValue.replace(U.CONTENTS,""),u=new E().insert(a),f=new E().insert(r.value()),m=s&&{oldRange:ue(s.oldRange,-o),newRange:ue(s.newRange,-o)};t=new E().retain(o).concat(u.diff(f,m)).reduce((h,g)=>g.insert?h.insert(g.insert,l):h.push(g),new E),this.delta=i.compose(t)}else this.delta=this.getDelta(),(!t||!Kt(i.compose(t),this.delta))&&(t=i.diff(this.delta,s));return t}}function st(n,t,e){if(n.length===0){const[h]=Mt(e.pop());return t<=0?`</li></${h}>`:`</li></${h}>${st([],t-1,e)}`}const[{child:s,offset:i,length:r,indent:l,type:o},...a]=n,[u,f]=Mt(o);if(l>t)return e.push(o),l===t+1?`<${u}><li${f}>${ut(s,i,r)}${st(a,l,e)}`:`<${u}><li>${st(n,t+1,e)}`;const m=e[e.length-1];if(l===t&&o===m)return`</li><li${f}>${ut(s,i,r)}${st(a,l,e)}`;const[c]=Mt(e.pop());return`</li></${c}>${st(n,t-1,e)}`}function ut(n,t,e){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(t,e);if(n instanceof j)return St(n.value().slice(t,t+e)).replaceAll(" "," ");if(n instanceof At){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(t,e,(f,m,c)=>{const h="formats"in f&&typeof f.formats=="function"?f.formats():{};u.push({child:f,offset:m,length:c,indent:h.indent||0,type:h.list})}),st(u,-1,[])}const i=[];if(n.children.forEachAt(t,e,(u,f,m)=>{i.push(ut(u,f,m))}),s||n.statics.blotName==="list")return i.join("");const{outerHTML:r,innerHTML:l}=n.domNode,[o,a]=r.split(`>${l}<`);return o==="<table"?`<table style="border: 1px solid #000;">${i.join("")}<${a}`:`${o}>${i.join("")}<${a}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function Ns(n,t){return Object.keys(t).reduce((e,s)=>{if(n[s]==null)return e;const i=t[s];return i===n[s]?e[s]=i:Array.isArray(i)?i.indexOf(n[s])<0?e[s]=i.concat([n[s]]):e[s]=i:e[s]=[i,n[s]],e},{})}function Mt(n){const t=n==="ordered"?"ol":"ul";switch(n){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function ce(n){return n.reduce((t,e)=>{if(typeof e.insert=="string"){const s=e.insert.replace(/\r\n/g,` `).replace(/\r/g,` `);return t.insert(s,e.attributes)}return t.push(e)},new E)}function ue(n,t){let{index:e,length:s}=n;return new Y(e+t,s)}function ks(n){const t=[];return n.forEach(e=>{typeof e.insert=="string"?e.insert.split(` `).forEach((i,r)=>{r&&t.push({insert:` `,attributes:e.attributes}),i&&t.push({insert:i,attributes:e.attributes})}):t.push(e)}),t}class ${static DEFAULTS={};constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}const qt="\uFEFF";class Zt extends M{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(s=>{this.contentNode.appendChild(s)}),this.leftGuard=document.createTextNode(qt),this.rightGuard=document.createTextNode(qt),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e=null,s;const i=t.data.split(qt).join("");if(t===this.leftGuard)if(this.prev instanceof j){const r=this.prev.length();this.prev.insertAt(r,i),e={startNode:this.prev.domNode,startOffset:r+i.length}}else s=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(s),this),e={startNode:s,startOffset:i.length};else t===this.rightGuard&&(this.next instanceof j?(this.next.insertAt(0,i),e={startNode:this.next.domNode,startOffset:i.length}):(s=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(s),this.next),e={startNode:s,startOffset:i.length}));return t.data=qt,e}update(t,e){t.forEach(s=>{if(s.type==="characterData"&&(s.target===this.leftGuard||s.target===this.rightGuard)){const i=this.restore(s.target);i&&(e.range=i)}})}}class ws{isComposing=!1;constructor(t,e){this.scroll=t,this.emitter=e,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",t=>{this.isComposing||this.handleCompositionStart(t)}),this.scroll.domNode.addEventListener("compositionend",t=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(t)})})}handleCompositionStart(t){const e=t.target instanceof Node?this.scroll.find(t.target,!0):null;e&&!(e instanceof Zt)&&(this.emitter.emit(y.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(y.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(y.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(y.events.COMPOSITION_END,t),this.isComposing=!1}}class lt{static DEFAULTS={modules:{}};static themes={default:lt};modules={};constructor(t,e){this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach(t=>{this.modules[t]==null&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}const vs=n=>n.parentElement||n.getRootNode().host||null,As=n=>{const t=n.getBoundingClientRect(),e="offsetWidth"in n&&Math.abs(t.width)/n.offsetWidth||1,s="offsetHeight"in n&&Math.abs(t.height)/n.offsetHeight||1;return{top:t.top,right:t.left+n.clientWidth*e,bottom:t.top+n.clientHeight*s,left:t.left}},Nt=n=>{const t=parseInt(n,10);return Number.isNaN(t)?0:t},he=(n,t,e,s,i,r)=>n<e&&t>s?0:n<e?-(e-n+i):t>s?t-n>s-e?n+i-e:t-s+r:0,Ls=(n,t)=>{const e=n.ownerDocument;let s=t,i=n;for(;i;){const r=i===e.body,l=r?{top:0,right:window.visualViewport?.width??e.documentElement.clientWidth,bottom:window.visualViewport?.height??e.documentElement.clientHeight,left:0}:As(i),o=getComputedStyle(i),a=he(s.left,s.right,l.left,l.right,Nt(o.scrollPaddingLeft),Nt(o.scrollPaddingRight)),u=he(s.top,s.bottom,l.top,l.bottom,Nt(o.scrollPaddingTop),Nt(o.scrollPaddingBottom));if(a||u)if(r)e.defaultView?.scrollBy(a,u);else{const{scrollLeft:f,scrollTop:m}=i;u&&(i.scrollTop+=u),a&&(i.scrollLeft+=a);const c=i.scrollLeft-f,h=i.scrollTop-m;s={left:s.left-c,top:s.top-h,right:s.right-c,bottom:s.bottom-h}}i=r||o.position==="fixed"?null:vs(i)}},Ts=100,Ss=["block","break","cursor","inline","scroll","text"],Cs=(n,t,e)=>{const s=new Re;return Ss.forEach(i=>{const r=t.query(i);r&&s.register(r)}),n.forEach(i=>{let r=t.query(i);r||e.error(`Cannot register "${i}" specified in "formats" config. Are you sure it was registered?`);let l=0;for(;r;)if(s.register(r),r="blotName"in r?r.requiredContainer??null:null,l+=1,l>Ts){e.error(`Cycle detected in registering blot requiredContainer: "${i}"`);break}}),s},nt=K("quill"),kt=new Re;At.uiClass="ql-ui";class d{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:kt,theme:"default"};static events=y.events;static sources=y.sources;static version="2.0.3";static imports={delta:E,parchment:fs,"core/module":$,"core/theme":lt};static debug(t){t===!0&&(t="log"),K.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Pt.get(t)||kt.find(t,e)}static import(t){return this.imports[t]==null&&nt.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const t=arguments.length<=0?void 0:arguments[0],e=!!(!(arguments.length<=1)&&arguments[1]),s="attrName"in t?t.attrName:t.blotName;typeof s=="string"?this.register(`formats/${s}`,t,e):Object.keys(t).forEach(i=>{this.register(i,t[i],e)})}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],s=!!(!(arguments.length<=2)&&arguments[2]);this.imports[t]!=null&&!s&&nt.warn(`Overwriting ${t} with`,e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&typeof e!="boolean"&&e.blotName!=="abstract"&&kt.register(e),typeof e.register=="function"&&e.register(kt)}}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Rs(t,e),this.container=this.options.container,this.container==null){nt.error("Invalid Quill container",t);return}this.options.debug&&d.debug(this.options.debug);const s=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Pt.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new y;const i=Oe.blotName,r=this.options.registry.query(i);if(!r||!("blotName"in r))throw new Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new r(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new qs(this.scroll),this.selection=new Es(this.scroll,this.emitter),this.composition=new ws(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(y.events.EDITOR_CHANGE,l=>{l===y.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(y.events.SCROLL_UPDATE,(l,o)=>{const a=this.selection.lastRange,[u]=this.selection.getRange(),f=a&&u?{oldRange:a,newRange:u}:void 0;D.call(this,()=>this.editor.update(null,o,f),l)}),this.emitter.on(y.events.SCROLL_EMBED_UPDATE,(l,o)=>{const a=this.selection.lastRange,[u]=this.selection.getRange(),f=a&&u?{oldRange:a,newRange:u}:void 0;D.call(this,()=>{const m=new E().retain(l.offset(this)).retain({[l.statics.blotName]:o});return this.editor.update(m,[],f)},d.sources.USER)}),s){const l=this.clipboard.convert({html:`${s}<p><br></p>`,text:` `});this.setContents(l)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof t=="string"){const s=t;t=document.createElement("div"),t.classList.add(s)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,s){return[t,e,,s]=_(t,e,s),D.call(this,()=>this.editor.deleteText(t,e),s,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.sources.API;return D.call(this,()=>{const i=this.getSelection(!0);let r=new E;if(i==null)return r;if(this.scroll.query(t,N.BLOCK))r=this.editor.formatLine(i.index,i.length,{[t]:e});else{if(i.length===0)return this.selection.format(t,e),r;r=this.editor.formatText(i.index,i.length,{[t]:e})}return this.setSelection(i,y.sources.SILENT),r},s)}formatLine(t,e,s,i,r){let l;return[t,e,l,r]=_(t,e,s,i,r),D.call(this,()=>this.editor.formatLine(t,e,l),r,t,0)}formatText(t,e,s,i,r){let l;return[t,e,l,r]=_(t,e,s,i,r),D.call(this,()=>this.editor.formatText(t,e,l),r,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=null;if(typeof t=="number"?s=this.selection.getBounds(t,e):s=this.selection.getBounds(t.index,t.length),!s)return null;const i=this.container.getBoundingClientRect();return{bottom:s.bottom-i.top,height:s.height,left:s.left-i.left,right:s.right-i.left,top:s.top-i.top,width:s.width}}getContents(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-t;return[t,e]=_(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof t=="number"?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof t!="number"?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=_(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=_(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:d.sources.API;return D.call(this,()=>this.editor.insertEmbed(t,e,s),i,t)}insertText(t,e,s,i,r){let l;return[t,,l,r]=_(t,0,s,i,r),D.call(this,()=>this.editor.insertText(t,e,l),r,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,e,s){return[t,e,,s]=_(t,e,s),D.call(this,()=>this.editor.removeFormat(t,e),s,t)}scrollRectIntoView(t){Ls(this.root,t)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const t=this.selection.lastRange,e=t&&this.selection.getBounds(t.index,t.length);e&&this.scrollRectIntoView(e)}setContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:y.sources.API;return D.call(this,()=>{t=new E(t);const s=this.getLength(),i=this.editor.deleteText(0,s),r=this.editor.insertContents(0,t),l=this.editor.deleteText(this.getLength()-1,1);return i.compose(r).compose(l)},e)}setSelection(t,e,s){t==null?this.selection.setRange(null,e||d.sources.API):([t,e,,s]=_(t,e,s),this.selection.setRange(new Y(Math.max(0,t),e),s),s!==y.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:y.sources.API;const s=new E().insert(t);return this.setContents(s,e)}update(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:y.sources.API;return D.call(this,()=>(t=new E(t),this.editor.applyDelta(t)),e,!0)}}function de(n){return typeof n=="string"?document.querySelector(n):n}function Dt(n){return Object.entries(n??{}).reduce((t,e)=>{let[s,i]=e;return{...t,[s]:i===!0?{}:i}},{})}function fe(n){return Object.fromEntries(Object.entries(n).filter(t=>t[1]!==void 0))}function Rs(n,t){const e=de(n);if(!e)throw new Error("Invalid Quill container");const i=!t.theme||t.theme===d.DEFAULTS.theme?lt:d.import(`themes/${t.theme}`);if(!i)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:r,...l}=d.DEFAULTS,{modules:o,...a}=i.DEFAULTS;let u=Dt(t.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=W({},Dt(r),Dt(o),u),m={...l,...fe(a),...fe(t)};let c=t.registry;return c?t.formats&&nt.warn('Ignoring "formats" option because "registry" is specified'):c=t.formats?Cs(t.formats,m.registry,nt):m.registry,{...m,registry:c,container:e,theme:i,modules:Object.entries(f).reduce((h,g)=>{let[p,x]=g;if(!x)return h;const b=d.import(`modules/${p}`);return b==null?(nt.error(`Cannot load ${p} module. Are you sure you registered it?`),h):{...h,[p]:W({},b.DEFAULTS||{},x)}},{}),bounds:de(m.bounds)}}function D(n,t,e,s){if(!this.isEnabled()&&t===y.sources.USER&&!this.allowReadOnlyEdits)return new E;let i=e==null?null:this.getSelection();const r=this.editor.delta,l=n();if(i!=null&&(e===!0&&(e=i.index),s==null?i=ge(i,l,t):s!==0&&(i=ge(i,e,s,t)),this.setSelection(i,y.sources.SILENT)),l.length()>0){const o=[y.events.TEXT_CHANGE,l,r,t];this.emitter.emit(y.events.EDITOR_CHANGE,...o),t!==y.sources.SILENT&&this.emitter.emit(...o)}return l}function _(n,t,e,s,i){let r={};return typeof n.index=="number"&&typeof n.length=="number"?typeof t!="number"?(i=s,s=e,e=t,t=n.length,n=n.index):(t=n.length,n=n.index):typeof t!="number"&&(i=s,s=e,e=t,t=0),typeof e=="object"?(r=e,i=s):typeof e=="string"&&(s!=null?r[e]=s:i=e),i=i||y.sources.API,[n,t,r,i]}function ge(n,t,e,s){const i=typeof e=="number"?e:0;if(n==null)return null;let r,l;return t&&typeof t.transformPosition=="function"?[r,l]=[n.index,n.index+n.length].map(o=>t.transformPosition(o,s!==y.sources.USER)):[r,l]=[n.index,n.index+n.length].map(o=>o<t||o===t&&s===y.sources.USER?o:i>=0?o+i:Math.max(t,o+i)),new Y(r,l-r)}class J extends Ie{}function me(n){return n instanceof A||n instanceof I}function pe(n){return typeof n.updateContent=="function"}class Os extends Oe{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=A;static allowedChildren=[A,I,J];constructor(t,e,s){let{emitter:i}=s;super(t,e),this.emitter=i,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",r=>this.handleDragStart(r))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const t=this.batch;this.batch=!1,this.update(t)}emitMount(t){this.emitter.emit(y.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(y.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(y.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[s,i]=this.line(t),[r]=this.line(t+e);if(super.deleteAt(t,e),r!=null&&s!==r&&i>0){if(s instanceof I||r instanceof I){this.optimize();return}const l=r.children.head instanceof P?null:r.children.head;s.moveChildren(r,l),s.remove()}this.optimize()}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,s,i){super.formatAt(t,e,s,i),this.optimize()}insertAt(t,e,s){if(t>=this.length())if(s==null||this.scroll.query(e,N.BLOCK)==null){const i=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(i),s==null&&e.endsWith(` `)?i.insertAt(0,e.slice(0,-1),s):i.insertAt(0,e,s)}else{const i=this.scroll.create(e,s);this.appendChild(i)}else super.insertAt(t,e,s);this.optimize()}insertBefore(t,e){if(t.statics.scope===N.INLINE_BLOT){const s=this.scroll.create(this.statics.defaultChild.blotName);s.appendChild(t),super.insertBefore(s,e)}else super.insertBefore(t,e)}insertContents(t,e){const s=this.deltaToRenderBlocks(e.concat(new E().insert(` `))),i=s.pop();if(i==null)return;this.batchStart();const r=s.shift();if(r){const a=r.type==="block"&&(r.delta.length()===0||!this.descendant(I,t)[0]&&t<this.length()),u=r.type==="block"?r.delta:new E().insert({[r.key]:r.value});Ut(this,t,u);const f=r.type==="block"?1:0,m=t+u.length()+f;a&&this.insertAt(m-1,` `);const c=R(this.line(t)[0]),h=B.AttributeMap.diff(c,r.attributes)||{};Object.keys(h).forEach(g=>{this.formatAt(m-1,1,g,h[g])}),t=m}let[l,o]=this.children.find(t);if(s.length&&(l&&(l=l.split(o),o=0),s.forEach(a=>{if(a.type==="block"){const u=this.createBlock(a.attributes,l||void 0);Ut(u,0,a.delta)}else{const u=this.create(a.key,a.value);this.insertBefore(u,l||void 0),Object.keys(a.attributes).forEach(f=>{u.format(f,a.attributes[f])})}})),i.type==="block"&&i.delta.length()){const a=l?l.offset(l.scroll)+o:this.length();Ut(this,a,i.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[s,i]=e;return s instanceof H?[s,i]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(me,t)}lines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const s=(i,r,l)=>{let o=[],a=l;return i.children.forEachAt(r,l,(u,f,m)=>{me(u)?o.push(u):u instanceof Ie&&(o=o.concat(s(u,f,a))),a-=m}),o};return s(this,t,e)}optimize(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(y.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){Array.isArray(t)&&(this.batch=this.batch.concat(t));return}let e=y.sources.USER;typeof t=="string"&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(s=>{let{target:i}=s;const r=this.find(i,!0);return r&&!pe(r)}),t.length>0&&this.emitter.emit(y.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(y.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,s){const[i]=this.descendant(r=>r instanceof I,t);i&&i.statics.blotName===e&&pe(i)&&i.updateContent(s)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let s=new E;return t.forEach(i=>{const r=i?.insert;if(r)if(typeof r=="string"){const l=r.split(` `);l.slice(0,-1).forEach(a=>{s.insert(a,i.attributes),e.push({type:"block",delta:s,attributes:i.attributes??{}}),s=new E});const o=l[l.length-1];o&&s.insert(o,i.attributes)}else{const l=Object.keys(r)[0];if(!l)return;this.query(l,N.INLINE)?s.push(i):(s.length()&&e.push({type:"block",delta:s,attributes:{}}),s=new E,e.push({type:"blockEmbed",key:l,value:r[l],attributes:i.attributes??{}}))}}),s.length()&&e.push({type:"block",delta:s,attributes:{}}),e}createBlock(t,e){let s;const i={};Object.entries(t).forEach(o=>{let[a,u]=o;this.query(a,N.BLOCK&N.BLOT)!=null?s=a:i[a]=u});const r=this.create(s||this.statics.defaultChild.blotName,s?t[s]:void 0);this.insertBefore(r,e||void 0);const l=r.length();return Object.entries(i).forEach(o=>{let[a,u]=o;r.formatAt(0,l,a,u)}),r}}function Ut(n,t,e){e.reduce((s,i)=>{const r=B.Op.length(i);let l=i.attributes||{};if(i.insert!=null){if(typeof i.insert=="string"){const o=i.insert;n.insertAt(s,o);const[a]=n.descendant(H,s),u=R(a);l=B.AttributeMap.diff(u,l)||{}}else if(typeof i.insert=="object"){const o=Object.keys(i.insert)[0];if(o==null)return s;if(n.insertAt(s,o,i.insert[o]),n.scroll.query(o,N.INLINE)!=null){const[u]=n.descendant(H,s),f=R(u);l=B.AttributeMap.diff(f,l)||{}}}}return Object.keys(l).forEach(o=>{n.formatAt(s,r,o,l[o])}),s+r},t)}const Gt={scope:N.BLOCK,whitelist:["right","center","justify"]},Is=new zt("align","align",Gt),Fe=new z("align","ql-align",Gt),je=new rt("align","text-align",Gt);class Pe extends rt{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${e.split(",").map(i=>`00${parseInt(i,10).toString(16)}`.slice(-2)).join("")}`):e}}const Bs=new z("color","ql-color",{scope:N.INLINE}),Wt=new Pe("color","color",{scope:N.INLINE}),Ms=new z("background","ql-bg",{scope:N.INLINE}),Xt=new Pe("background","background-color",{scope:N.INLINE});class tt extends J{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(s=>s.length()<=1?"":s.domNode.innerText).join(` `).slice(t,t+e)}html(t,e){return`<pre> ${St(this.code(t,e))} </pre>`}}class T extends A{static TAB=" ";static register(){d.register(tt)}}class Yt extends L{}Yt.blotName="code";Yt.tagName="CODE";T.blotName="code-block";T.className="ql-code-block";T.tagName="DIV";tt.blotName="code-block-container";tt.className="ql-code-block-container";tt.tagName="DIV";tt.allowedChildren=[T];T.allowedChildren=[j,P,U];T.requiredContainer=tt;const Qt={scope:N.BLOCK,whitelist:["rtl"]},$e=new zt("direction","dir",Qt),_e=new z("direction","ql-direction",Qt),Ve=new rt("direction","direction",Qt),ze={scope:N.INLINE,whitelist:["serif","monospace"]},Ke=new z("font","ql-font",ze);class Ds extends rt{value(t){return super.value(t).replace(/["']/g,"")}}const Ze=new Ds("font","font-family",ze),Ge=new z("size","ql-size",{scope:N.INLINE,whitelist:["small","large","huge"]}),We=new rt("size","font-size",{scope:N.INLINE,whitelist:["10px","18px","32px"]}),Us=K("quill:keyboard"),Hs=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Ct extends ${static match(t,e){return["altKey","ctrlKey","metaKey","shiftKey"].some(s=>!!e[s]!==t[s]&&e[s]!==null)?!1:e.key===t.key||e.key===t.which}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(s=>{this.options.bindings[s]&&this.addBinding(this.options.bindings[s])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=js(t);if(i==null){Us.warn("Attempted to add invalid keyboard binding",i);return}typeof e=="function"&&(e={handler:e}),typeof s=="function"&&(s={handler:s}),(Array.isArray(i.key)?i.key:[i.key]).forEach(l=>{const o={...i,key:l,...e,...s};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;const i=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(b=>Ct.match(t,b));if(i.length===0)return;const r=d.find(t.target,!0);if(r&&r.scroll!==this.quill.scroll)return;const l=this.quill.getSelection();if(l==null||!this.quill.hasFocus())return;const[o,a]=this.quill.getLine(l.index),[u,f]=this.quill.getLeaf(l.index),[m,c]=l.length===0?[u,f]:this.quill.getLeaf(l.index+l.length),h=u instanceof jt?u.value().slice(0,f):"",g=m instanceof jt?m.value().slice(c):"",p={collapsed:l.length===0,empty:l.length===0&&o.length()<=1,format:this.quill.getFormat(l),line:o,offset:a,prefix:h,suffix:g,event:t};i.some(b=>{if(b.collapsed!=null&&b.collapsed!==p.collapsed||b.empty!=null&&b.empty!==p.empty||b.offset!=null&&b.offset!==p.offset)return!1;if(Array.isArray(b.format)){if(b.format.every(q=>p.format[q]==null))return!1}else if(typeof b.format=="object"&&!Object.keys(b.format).every(q=>b.format[q]===!0?p.format[q]!=null:b.format[q]===!1?p.format[q]==null:Kt(b.format[q],p.format[q])))return!1;return b.prefix!=null&&!b.prefix.test(p.prefix)||b.suffix!=null&&!b.suffix.test(p.suffix)?!1:b.handler.call(this,l,p,b)!==!0})&&t.preventDefault()})}handleBackspace(t,e){const s=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let i={};const[r]=this.quill.getLine(t.index);let l=new E().retain(t.index-s).delete(s);if(e.offset===0){const[o]=this.quill.getLine(t.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const u=r.formats(),f=this.quill.getFormat(t.index-1,1);if(i=B.AttributeMap.diff(u,f)||{},Object.keys(i).length>0){const m=new E().retain(t.index+r.length()-2).retain(1,i);l=l.compose(m)}}}this.quill.updateContents(l,d.sources.USER),this.quill.focus()}handleDelete(t,e){const s=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-s)return;let i={};const[r]=this.quill.getLine(t.index);let l=new E().retain(t.index).delete(s);if(e.offset>=r.length()-1){const[o]=this.quill.getLine(t.index+1);if(o){const a=r.formats(),u=this.quill.getFormat(t.index,1);i=B.AttributeMap.diff(a,u)||{},Object.keys(i).length>0&&(l=l.retain(o.length()-1).retain(1,i))}}this.quill.updateContents(l,d.sources.USER),this.quill.focus()}handleDeleteRange(t){Jt({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const s=Object.keys(e.format).reduce((r,l)=>(this.quill.scroll.query(l,N.BLOCK)&&!Array.isArray(e.format[l])&&(r[l]=e.format[l]),r),{}),i=new E().retain(t.index).delete(t.length).insert(` `,s);this.quill.updateContents(i,d.sources.USER),this.quill.setSelection(t.index+1,d.sources.SILENT),this.quill.focus()}}const Fs={bindings:{bold:Ht("bold"),italic:Ht("italic"),underline:Ht("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",d.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",d.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,t){t.format.indent!=null?this.quill.format("indent","-1",d.sources.USER):t.format.list!=null&&this.quill.format("list",!1,d.sources.USER)}},"indent code-block":be(!0),"outdent code-block":be(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,d.sources.USER)}},tab:{key:"Tab",handler(n,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new E().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(e,d.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,d.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,d.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,t){const e={list:!1};t.format.indent&&(e.indent=!1),this.quill.formatLine(n.index,n.length,e,d.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[t,e]=this.quill.getLine(n.index),s={...t.formats(),list:"checked"},i=new E().retain(n.index).insert(` `,s).retain(t.length()-e-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,d.sources.USER),this.quill.setSelection(n.index+1,d.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,t){const[e,s]=this.quill.getLine(n.index),i=new E().retain(n.index).insert(` `,t.format).retain(e.length()-s-1).retain(1,{header:null});this.quill.updateContents(i,d.sources.USER),this.quill.setSelection(n.index+1,d.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const t=this.quill.getModule("table");if(t){const[e,s,i,r]=t.getTable(n),l=Ps(e,s,i,r);if(l==null)return;let o=e.offset();if(l<0){const a=new E().retain(o).insert(` `);this.quill.updateContents(a,d.sources.USER),this.quill.setSelection(n.index+1,n.length,d.sources.SILENT)}else if(l>0){o+=e.length();const a=new E().retain(o).insert(` `);this.quill.updateContents(a,d.sources.USER),this.quill.setSelection(o,d.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,t){const{event:e,line:s}=t,i=s.offset(this.quill.scroll);e.shiftKey?this.quill.setSelection(i-1,d.sources.USER):this.quill.setSelection(i+s.length(),d.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,t){if(this.quill.scroll.query("list")==null)return!0;const{length:e}=t.prefix,[s,i]=this.quill.getLine(n.index);if(i>e)return!0;let r;switch(t.prefix.trim()){case"[]":case"[ ]":r="unchecked";break;case"[x]":r="checked";break;case"-":case"*":r="bullet";break;default:r="ordered"}this.quill.insertText(n.index," ",d.sources.USER),this.quill.history.cutoff();const l=new E().retain(n.index-i).delete(e+1).retain(s.length()-2-i).retain(1,{list:r});return this.quill.updateContents(l,d.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-e,d.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[t,e]=this.quill.getLine(n.index);let s=2,i=t;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,s-=1,s<=0){const r=new E().retain(n.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,d.sources.USER),this.quill.setSelection(n.index-1,d.sources.SILENT),!1}return!0}},"embed left":wt("ArrowLeft",!1),"embed left shift":wt("ArrowLeft",!0),"embed right":wt("ArrowRight",!1),"embed right shift":wt("ArrowRight",!0),"table down":ye(!1),"table up":ye(!0)}};Ct.DEFAULTS=Fs;function be(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(t,e){let{event:s}=e;const i=this.quill.scroll.query("code-block"),{TAB:r}=i;if(t.length===0&&!s.shiftKey){this.quill.insertText(t.index,r,d.sources.USER),this.quill.setSelection(t.index+r.length,d.sources.SILENT);return}const l=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:o,length:a}=t;l.forEach((u,f)=>{n?(u.insertAt(0,r),f===0?o+=r.length:a+=r.length):u.domNode.textContent.startsWith(r)&&(u.deleteAt(0,r.length),f===0?o-=r.length:a-=r.length)}),this.quill.update(d.sources.USER),this.quill.setSelection(o,a,d.sources.SILENT)}}}function wt(n,t){return{key:n,shiftKey:t,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(s){let{index:i}=s;n==="ArrowRight"&&(i+=s.length+1);const[r]=this.quill.getLeaf(i);return r instanceof M?(n==="ArrowLeft"?t?this.quill.setSelection(s.index-1,s.length+1,d.sources.USER):this.quill.setSelection(s.index-1,d.sources.USER):t?this.quill.setSelection(s.index,s.length+1,d.sources.USER):this.quill.setSelection(s.index+s.length+1,d.sources.USER),!1):!0}}}function Ht(n){return{key:n[0],shortKey:!0,handler(t,e){this.quill.format(n,!e.format[n],d.sources.USER)}}}function ye(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,e){const s=n?"prev":"next",i=e.line,r=i.parent[s];if(r!=null){if(r.statics.blotName==="table-row"){let l=r.children.head,o=i;for(;o.prev!=null;)o=o.prev,l=l.next;const a=l.offset(this.quill.scroll)+Math.min(e.offset,l.length()-1);this.quill.setSelection(a,0,d.sources.USER)}}else{const l=i.table()[s];l!=null&&(n?this.quill.setSelection(l.offset(this.quill.scroll)+l.length()-1,0,d.sources.USER):this.quill.setSelection(l.offset(this.quill.scroll),0,d.sources.USER))}return!1}}}function js(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=it(n);else return null;return n.shortKey&&(n[Hs]=n.shortKey,delete n.shortKey),n}function Jt(n){let{quill:t,range:e}=n;const s=t.getLines(e);let i={};if(s.length>1){const r=s[0].formats(),l=s[s.length-1].formats();i=B.AttributeMap.diff(l,r)||{}}t.deleteText(e,d.sources.USER),Object.keys(i).length>0&&t.formatLine(e.index,1,i,d.sources.USER),t.setSelection(e.index,d.sources.SILENT)}function Ps(n,t,e,s){return t.prev==null&&t.next==null?e.prev==null&&e.next==null?s===0?-1:1:e.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const $s=/font-weight:\s*normal/,_s=["P","OL","UL"],Ee=n=>n&&_s.includes(n.tagName),Vs=n=>{Array.from(n.querySelectorAll("br")).filter(t=>Ee(t.previousElementSibling)&&Ee(t.nextElementSibling)).forEach(t=>{t.parentNode?.removeChild(t)})},zs=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(t=>t.getAttribute("style")?.match($s)).forEach(t=>{const e=n.createDocumentFragment();e.append(...t.childNodes),t.parentNode?.replaceChild(e,t)})};function Ks(n){n.querySelector('[id^="docs-internal-guid-"]')&&(zs(n),Vs(n))}const Zs=/\bmso-list:[^;]*ignore/i,Gs=/\bmso-list:[^;]*\bl(\d+)/i,Ws=/\bmso-list:[^;]*\blevel(\d+)/i,Xs=(n,t)=>{const e=n.getAttribute("style"),s=e?.match(Gs);if(!s)return null;const i=Number(s[1]),r=e?.match(Ws),l=r?Number(r[1]):1,o=new RegExp(`@list l${i}:level${l}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),a=t.match(o),u=a&&a[1]==="bullet"?"bullet":"ordered";return{id:i,indent:l,type:u,element:n}},Ys=n=>{const t=Array.from(n.querySelectorAll("[style*=mso-list]")),e=[],s=[];t.forEach(l=>{(l.getAttribute("style")||"").match(Zs)?e.push(l):s.push(l)}),e.forEach(l=>l.parentNode?.removeChild(l));const i=n.documentElement.innerHTML,r=s.map(l=>Xs(l,i)).filter(l=>l);for(;r.length;){const l=[];let o=r.shift();for(;o;)l.push(o),o=r.length&&r[0]?.element===o.element.nextElementSibling&&r[0].id===o.id?r.shift():null;const a=document.createElement("ul");l.forEach(m=>{const c=document.createElement("li");c.setAttribute("data-list",m.type),m.indent>1&&c.setAttribute("class",`ql-indent-${m.indent-1}`),c.innerHTML=m.element.innerHTML,a.appendChild(c)});const u=l[0]?.element,{parentNode:f}=u??{};u&&f?.replaceChild(a,u),l.slice(1).forEach(m=>{let{element:c}=m;f?.removeChild(c)})}};function Qs(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Ys(n)}const Js=[Qs,Ks],ti=n=>{n.documentElement&&Js.forEach(t=>{t(n)})},ei=K("quill:clipboard"),si=[[Node.TEXT_NODE,mi],[Node.TEXT_NODE,qe],["br",ai],[Node.ELEMENT_NODE,qe],[Node.ELEMENT_NODE,oi],[Node.ELEMENT_NODE,li],[Node.ELEMENT_NODE,fi],["li",hi],["ol, ul",di],["pre",ci],["tr",gi],["b",Ft("bold")],["i",Ft("italic")],["strike",Ft("strike")],["style",ui]],ii=[Is,$e].reduce((n,t)=>(n[t.keyName]=t,n),{}),xe=[je,Xt,Wt,Ve,Ze,We].reduce((n,t)=>(n[t.keyName]=t,n),{});class ni extends ${static DEFAULTS={matchers:[]};constructor(t,e){super(t,e),this.quill.root.addEventListener("copy",s=>this.onCaptureCopy(s,!1)),this.quill.root.addEventListener("cut",s=>this.onCaptureCopy(s,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],si.concat(this.options.matchers??[]).forEach(s=>{let[i,r]=s;this.addMatcher(i,r)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:s}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i[T.blotName])return new E().insert(s||"",{[T.blotName]:i[T.blotName]});if(!e)return new E().insert(s||"",i);const r=this.convertHTML(e);return dt(r,` `)&&(r.ops[r.ops.length-1].attributes==null||i.table)?r.compose(new E().retain(r.length()-1).delete(1)):r}normalizeHTML(t){ti(t)}convertHTML(t){const e=new DOMParser().parseFromString(t,"text/html");this.normalizeHTML(e);const s=e.body,i=new WeakMap,[r,l]=this.prepareMatching(s,i);return te(this.quill.scroll,s,r,l,i)}dangerouslyPasteHTML(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.sources.API;if(typeof t=="string"){const i=this.convert({html:t,text:""});this.quill.setContents(i,e),this.quill.setSelection(0,d.sources.SILENT)}else{const i=this.convert({html:e,text:""});this.quill.updateContents(new E().retain(t).concat(i),s),this.quill.setSelection(t+i.length(),d.sources.SILENT)}}onCaptureCopy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.defaultPrevented)return;t.preventDefault();const[s]=this.quill.selection.getRange();if(s==null)return;const{html:i,text:r}=this.onCopy(s,e);t.clipboardData?.setData("text/plain",r),t.clipboardData?.setData("text/html",i),e&&Jt({range:s,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(e=>e[0]!=="#").join(` `)}onCapturePaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(e==null)return;const s=t.clipboardData?.getData("text/html");let i=t.clipboardData?.getData("text/plain");if(!s&&!i){const l=t.clipboardData?.getData("text/uri-list");l&&(i=this.normalizeURIList(l))}const r=Array.from(t.clipboardData?.files||[]);if(!s&&r.length>0){this.quill.uploader.upload(e,r);return}if(s&&r.length>0){const l=new DOMParser().parseFromString(s,"text/html");if(l.body.childElementCount===1&&l.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(e,r);return}}this.onPaste(e,{html:s,text:i})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:s,html:i}=e;const r=this.quill.getFormat(t.index),l=this.convert({text:s,html:i},r);ei.log("onPaste",l,{text:s,html:i});const o=new E().retain(t.index).delete(t.length).concat(l);this.quill.updateContents(o,d.sources.USER),this.quill.setSelection(o.length()-t.length,d.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const s=[],i=[];return this.matchers.forEach(r=>{const[l,o]=r;switch(l){case Node.TEXT_NODE:i.push(o);break;case Node.ELEMENT_NODE:s.push(o);break;default:Array.from(t.querySelectorAll(l)).forEach(a=>{e.has(a)?e.get(a)?.push(o):e.set(a,[o])});break}}),[s,i]}}function et(n,t,e,s){return s.query(t)?n.reduce((i,r)=>{if(!r.insert)return i;if(r.attributes&&r.attributes[t])return i.push(r);const l=e?{[t]:e}:{};return i.insert(r.insert,{...l,...r.attributes})},new E):n}function dt(n,t){let e="";for(let s=n.ops.length-1;s>=0&&e.length<t.length;--s){const i=n.ops[s];if(typeof i.insert!="string")break;e=i.insert+e}return e.slice(-1*t.length)===t}function G(n,t){if(!(n instanceof Element))return!1;const e=t.query(n);return e&&e.prototype instanceof M?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function ri(n,t){return n.previousElementSibling&&n.nextElementSibling&&!G(n.previousElementSibling,t)&&!G(n.nextElementSibling,t)}const vt=new WeakMap;function Xe(n){return n==null?!1:(vt.has(n)||(n.tagName==="PRE"?vt.set(n,!0):vt.set(n,Xe(n.parentNode))),vt.get(n))}function te(n,t,e,s,i){return t.nodeType===t.TEXT_NODE?s.reduce((r,l)=>l(t,r,n),new E):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((r,l)=>{let o=te(n,l,e,s,i);return l.nodeType===t.ELEMENT_NODE&&(o=e.reduce((a,u)=>u(l,a,n),o),o=(i.get(l)||[]).reduce((a,u)=>u(l,a,n),o)),r.concat(o)},new E):new E}function Ft(n){return(t,e,s)=>et(e,n,!0,s)}function li(n,t,e){const s=zt.keys(n),i=z.keys(n),r=rt.keys(n),l={};return s.concat(i).concat(r).forEach(o=>{let a=e.query(o,N.ATTRIBUTE);a!=null&&(l[a.attrName]=a.value(n),l[a.attrName])||(a=ii[o],a!=null&&(a.attrName===o||a.keyName===o)&&(l[a.attrName]=a.value(n)||void 0),a=xe[o],a!=null&&(a.attrName===o||a.keyName===o)&&(a=xe[o],l[a.attrName]=a.value(n)||void 0))}),Object.entries(l).reduce((o,a)=>{let[u,f]=a;return et(o,u,f,e)},t)}function oi(n,t,e){const s=e.query(n);if(s==null)return t;if(s.prototype instanceof M){const i={},r=s.value(n);if(r!=null)return i[s.blotName]=r,new E().insert(i,s.formats(n,e))}else if(s.prototype instanceof Ce&&!dt(t,` `)&&t.insert(` `),"blotName"in s&&"formats"in s&&typeof s.formats=="function")return et(t,s.blotName,s.formats(n,e),e);return t}function ai(n,t){return dt(t,` `)||t.insert(` `),t}function ci(n,t,e){const s=e.query("code-block"),i=s&&"formats"in s&&typeof s.formats=="function"?s.formats(n,e):!0;return et(t,"code-block",i,e)}function ui(){return new E}function hi(n,t,e){const s=e.query(n);if(s==null||s.blotName!=="list"||!dt(t,` `))return t;let i=-1,r=n.parentNode;for(;r!=null;)["OL","UL"].includes(r.tagName)&&(i+=1),r=r.parentNode;return i<=0?t:t.reduce((l,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?l.push(o):l.insert(o.insert,{indent:i,...o.attributes||{}}):l,new E)}function di(n,t,e){const s=n;let i=s.tagName==="OL"?"ordered":"bullet";const r=s.getAttribute("data-checked");return r&&(i=r==="true"?"checked":"unchecked"),et(t,"list",i,e)}function qe(n,t,e){if(!dt(t,` `)){if(G(n,e)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return t.insert(` `);if(t.length()>0&&n.nextSibling){let s=n.nextSibling;for(;s!=null;){if(G(s,e))return t.insert(` `);const i=e.query(s);if(i&&i.prototype instanceof I)return t.insert(` `);s=s.firstChild}}}return t}function fi(n,t,e){const s={},i=n.style||{};return i.fontStyle==="italic"&&(s.italic=!0),i.textDecoration==="underline"&&(s.underline=!0),i.textDecoration==="line-through"&&(s.strike=!0),(i.fontWeight?.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(s.bold=!0),t=Object.entries(s).reduce((r,l)=>{let[o,a]=l;return et(r,o,a,e)},t),parseFloat(i.textIndent||0)>0?new E().insert(" ").concat(t):t}function gi(n,t,e){const s=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(s!=null){const r=Array.from(s.querySelectorAll("tr")).indexOf(n)+1;return et(t,"table",r,e)}return t}function mi(n,t,e){let s=n.data;if(n.parentElement?.tagName==="O:P")return t.insert(s.trim());if(!Xe(n)){if(s.trim().length===0&&s.includes(` `)&&!ri(n,e))return t;s=s.replace(/[^\S\u00a0]/g," "),s=s.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&G(n.parentElement,e)||n.previousSibling instanceof Element&&G(n.previousSibling,e))&&(s=s.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&G(n.parentElement,e)||n.nextSibling instanceof Element&&G(n.nextSibling,e))&&(s=s.replace(/ $/,"")),s=s.replaceAll(" "," ")}return t.insert(s)}class pi extends ${static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(t,e){super(t,e),this.quill.on(d.events.EDITOR_CHANGE,(s,i,r,l)=>{s===d.events.SELECTION_CHANGE?i&&l!==d.sources.SILENT&&(this.currentRange=i):s===d.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||l===d.sources.USER?this.record(i,r):this.transform(i)),this.currentRange=Vt(this.currentRange,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(t,e){if(this.stack[t].length===0)return;const s=this.stack[t].pop();if(!s)return;const i=this.quill.getContents(),r=s.delta.invert(i);this.stack[e].push({delta:r,range:Vt(s.range,r)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,d.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(t.ops.length===0)return;this.stack.redo=[];let s=t.invert(e),i=this.currentRange;const r=Date.now();if(this.lastRecorded+this.options.delay>r&&this.stack.undo.length>0){const l=this.stack.undo.pop();l&&(s=s.compose(l.delta),i=l.range)}else this.lastRecorded=r;s.length()!==0&&(this.stack.undo.push({delta:s,range:i}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){Ne(this.stack.undo,t),Ne(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,d.sources.USER);else{const e=yi(this.quill.scroll,t.delta);this.quill.setSelection(e,d.sources.USER)}}}function Ne(n,t){let e=t;for(let s=n.length-1;s>=0;s-=1){const i=n[s];n[s]={delta:e.transform(i.delta,!0),range:i.range&&Vt(i.range,e)},e=i.delta.transform(e),n[s].delta.length()===0&&n.splice(s,1)}}function bi(n,t){const e=t.ops[t.ops.length-1];return e==null?!1:e.insert!=null?typeof e.insert=="string"&&e.insert.endsWith(` `):e.attributes!=null?Object.keys(e.attributes).some(s=>n.query(s,N.BLOCK)!=null):!1}function yi(n,t){const e=t.reduce((i,r)=>i+(r.delete||0),0);let s=t.length()-e;return bi(n,t)&&(s-=1),s}function Vt(n,t){if(!n)return n;const e=t.transformPosition(n.index),s=t.transformPosition(n.index+n.length);return{index:e,length:s-e}}class Ye extends ${constructor(t,e){super(t,e),t.root.addEventListener("drop",s=>{s.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(s.clientX,s.clientY);else if(document.caretPositionFromPoint){const l=document.caretPositionFromPoint(s.clientX,s.clientY);i=document.createRange(),i.setStart(l.offsetNode,l.offset),i.setEnd(l.offsetNode,l.offset)}const r=i&&t.selection.normalizeNative(i);if(r){const l=t.selection.normalizedToRange(r);s.dataTransfer?.files&&this.upload(l,s.dataTransfer.files)}})}upload(t,e){const s=[];Array.from(e).forEach(i=>{i&&this.options.mimetypes?.includes(i.type)&&s.push(i)}),s.length>0&&this.options.handler.call(this,t,s)}}Ye.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,t){if(!this.quill.scroll.query("image"))return;const e=t.map(s=>new Promise(i=>{const r=new FileReader;r.onload=()=>{i(r.result)},r.readAsDataURL(s)}));Promise.all(e).then(s=>{const i=s.reduce((r,l)=>r.insert({image:l}),new E().retain(n.index).delete(n.length));this.quill.updateContents(i,y.sources.USER),this.quill.setSelection(n.index+s.length,y.sources.SILENT)})}};const Ei=["insertText","insertReplacementText"];class xi extends ${constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",s=>{this.handleBeforeInput(s)}),/Android/i.test(navigator.userAgent)||t.on(d.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){Jt({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t.length===0)return!1;if(e){const s=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new E().retain(t.index).insert(e,s),d.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,d.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!Ei.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const s=qi(t);if(s==null)return;const i=this.quill.selection.normalizeNative(e),r=i?this.quill.selection.normalizedToRange(i):null;r&&this.replaceText(r,s)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function qi(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const Ni=/Mac/i.test(navigator.platform),ki=100,wi=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||Ni&&n.key==="a"&&n.ctrlKey===!0);class vi extends ${isListening=!1;selectionChangeDeadline=0;constructor(t,e){super(t,e),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,e){let{line:s,event:i}=e;if(!(s instanceof At)||!s.uiNode)return!0;const r=getComputedStyle(s.domNode).direction==="rtl";return r&&i.key!=="ArrowRight"||!r&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(t.index-1,t.length+(i.shiftKey?1:0),d.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&wi(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+ki,this.isListening)return;this.isListening=!0;const t=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",t,{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const e=t.getRangeAt(0);if(e.collapsed!==!0||e.startOffset!==0)return;const s=this.quill.scroll.find(e.startContainer);if(!(s instanceof At)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),t.removeAllRanges(),t.addRange(i)}}d.register({"blots/block":A,"blots/block/embed":I,"blots/break":P,"blots/container":J,"blots/cursor":U,"blots/embed":Zt,"blots/inline":L,"blots/scroll":Os,"blots/text":j,"modules/clipboard":ni,"modules/history":pi,"modules/keyboard":Ct,"modules/uploader":Ye,"modules/input":xi,"modules/uiNode":vi});class Ai extends z{add(t,e){let s=0;if(e==="+1"||e==="-1"){const i=this.value(t)||0;s=e==="+1"?i+1:i-1}else typeof e=="number"&&(s=e);return s===0?(this.remove(t),!0):super.add(t,s.toString())}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}const Li=new Ai("indent","ql-indent",{scope:N.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Ti extends A{static blotName="blockquote";static tagName="blockquote"}class Si extends A{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(t){return this.tagName.indexOf(t.tagName)+1}}class ft extends J{}ft.blotName="list-container";ft.tagName="OL";class gt extends A{static create(t){const e=super.create();return e.setAttribute("data-list",t),e}static formats(t){return t.getAttribute("data-list")||void 0}static register(){d.register(ft)}constructor(t,e){super(t,e);const s=e.ownerDocument.createElement("span"),i=r=>{if(!t.isEnabled())return;const l=this.statics.formats(e,t);l==="checked"?(this.format("list","unchecked"),r.preventDefault()):l==="unchecked"&&(this.format("list","checked"),r.preventDefault())};s.addEventListener("mousedown",i),s.addEventListener("touchstart",i),this.attachUI(s)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}gt.blotName="list";gt.tagName="LI";ft.allowedChildren=[gt];gt.requiredContainer=ft;class ee extends L{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}class Ci extends ee{static blotName="italic";static tagName=["EM","I"]}class Lt extends L{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(t){const e=super.create(t);return e.setAttribute("href",this.sanitize(t)),e.setAttribute("rel","noopener noreferrer"),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return Qe(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t!==this.statics.blotName||!e?super.format(t,e):this.domNode.setAttribute("href",this.constructor.sanitize(e))}}function Qe(n,t){const e=document.createElement("a");e.href=n;const s=e.href.slice(0,e.href.indexOf(":"));return t.indexOf(s)>-1}class Ri extends L{static blotName="script";static tagName=["SUB","SUP"];static create(t){return t==="super"?document.createElement("sup"):t==="sub"?document.createElement("sub"):super.create(t)}static formats(t){if(t.tagName==="SUB")return"sub";if(t.tagName==="SUP")return"super"}}class Oi extends ee{static blotName="strike";static tagName=["S","STRIKE"]}class Ii extends L{static blotName="underline";static tagName="U"}class Bi extends Zt{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(t){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return typeof t=="string"&&(window.katex.render(t,e,{throwOnError:!1,errorColor:"#f00"}),e.setAttribute("data-value",t)),e}static value(t){return t.getAttribute("data-value")}html(){const{formula:t}=this.value();return`<span>${t}</span>`}}const ke=["alt","height","width"];class Mi extends M{static blotName="image";static tagName="IMG";static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return ke.reduce((e,s)=>(t.hasAttribute(s)&&(e[s]=t.getAttribute(s)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return Qe(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){ke.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}const we=["height","width"];class Di extends I{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(t){const e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","true"),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return we.reduce((e,s)=>(t.hasAttribute(s)&&(e[s]=t.getAttribute(s)),e),{})}static sanitize(t){return Lt.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){we.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}html(){const{video:t}=this.value();return`<a href="${t}">${t}</a>`}}const at=new z("code-token","hljs",{scope:N.INLINE});class V extends L{static formats(t,e){for(;t!=null&&t!==e.domNode;){if(t.classList&&t.classList.contains(T.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,s){super(t,e,s),at.add(this.domNode,s)}format(t,e){t!==V.blotName?super.format(t,e):e?at.add(this.domNode,e):(at.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),at.value(this.domNode)||this.unwrap()}}V.blotName="code-token";V.className="ql-token";class O extends T{static create(t){const e=super.create(t);return typeof t=="string"&&e.setAttribute("data-language",t),e}static formats(t){return t.getAttribute("data-language")||"plain"}static register(){}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-language",e):super.format(t,e)}replaceWith(t,e){return this.formatAt(0,this.length(),V.blotName,!1),super.replaceWith(t,e)}}class ct extends tt{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===O.blotName&&(this.forceNext=!0,this.children.forEach(s=>{s.format(t,e)}))}formatAt(t,e,s,i){s===O.blotName&&(this.forceNext=!0),super.formatAt(t,e,s,i)}highlight(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const i=`${Array.from(this.domNode.childNodes).filter(l=>l!==this.uiNode).map(l=>l.textContent).join(` `)} `,r=O.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==i){if(i.trim().length>0||this.cachedText==null){const l=this.children.reduce((a,u)=>a.concat(Ue(u,!1)),new E),o=t(i,r);l.diff(o).reduce((a,u)=>{let{retain:f,attributes:m}=u;return f?(m&&Object.keys(m).forEach(c=>{[O.blotName,V.blotName].includes(c)&&this.formatAt(a,f,c,m[c])}),a+f):a},0)}this.cachedText=i,this.forceNext=!1}}html(t,e){const[s]=this.children.find(t);return`<pre data-language="${s?O.formats(s.domNode):"plain"}"> ${St(this.code(t,e))} </pre>`}optimize(t){if(super.optimize(t),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const e=O.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}ct.allowedChildren=[O];O.requiredContainer=ct;O.allowedChildren=[V,U,j,P];const Ui=(n,t,e)=>{if(typeof n.versionString=="string"){const s=n.versionString.split(".")[0];if(parseInt(s,10)>=11)return n.highlight(e,{language:t}).value}return n.highlight(t,e).value};class Je extends ${static register(){d.register(V,!0),d.register(O,!0),d.register(ct,!0)}constructor(t,e){if(super(t,e),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((s,i)=>{let{key:r}=i;return s[r]=!0,s},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(d.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof ct))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(s=>{let{key:i,label:r}=s;const l=e.ownerDocument.createElement("option");l.textContent=r,l.setAttribute("value",i),e.appendChild(l)}),e.addEventListener("change",()=>{t.format(O.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),t.uiNode==null&&(t.attachUI(e),t.children.head&&(e.value=O.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(d.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(d.sources.USER);const s=this.quill.getSelection();(t==null?this.quill.scroll.descendants(ct):[t]).forEach(r=>{r.highlight(this.highlightBlot,e)}),this.quill.update(d.sources.SILENT),s!=null&&this.quill.setSelection(s,d.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(e=this.languages[e]?e:"plain",e==="plain")return St(t).split(` `).reduce((i,r,l)=>(l!==0&&i.insert(` `,{[T.blotName]:e}),i.insert(r)),new E);const s=this.quill.root.ownerDocument.createElement("div");return s.classList.add(T.className),s.innerHTML=Ui(this.options.hljs,e,t),te(this.quill.scroll,s,[(i,r)=>{const l=at.value(i);return l?r.compose(new E().retain(r.length(),{[V.blotName]:l})):r}],[(i,r)=>i.data.split(` `).reduce((l,o,a)=>(a!==0&&l.insert(` `,{[T.blotName]:e}),l.insert(o)),r)],new WeakMap)}}Je.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class F extends A{static blotName="table";static tagName="TD";static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",se()),e}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,e){t===F.blotName&&e?this.domNode.setAttribute("data-row",e):super.format(t,e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Q extends J{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),e=this.children.tail.formats(),s=this.next.children.head.formats(),i=this.next.children.tail.formats();return t.table===e.table&&t.table===s.table&&t.table===i.table}return!1}optimize(t){super.optimize(t),this.children.forEach(e=>{if(e.next==null)return;const s=e.formats(),i=e.next.formats();if(s.table!==i.table){const r=this.splitAfter(e);r&&r.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class X extends J{static blotName="table-body";static tagName="TBODY"}class Tt extends J{static blotName="table-container";static tagName="TABLE";balanceCells(){const t=this.descendants(Q),e=t.reduce((s,i)=>Math.max(i.children.length,s),0);t.forEach(s=>{new Array(e-s.children.length).fill(0).forEach(()=>{let i;s.children.head!=null&&(i=F.formats(s.children.head.domNode));const r=this.scroll.create(F.blotName,i);s.appendChild(r),r.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(X);e==null||e.children.head==null||e.children.forEach(s=>{const i=s.children.at(t);i?.remove()})}insertColumn(t){const[e]=this.descendant(X);e==null||e.children.head==null||e.children.forEach(s=>{const i=s.children.at(t),r=F.formats(s.children.head.domNode),l=this.scroll.create(F.blotName,r);s.insertBefore(l,i)})}insertRow(t){const[e]=this.descendant(X);if(e==null||e.children.head==null)return;const s=se(),i=this.scroll.create(Q.blotName);e.children.head.children.forEach(()=>{const l=this.scroll.create(F.blotName,s);i.appendChild(l)});const r=e.children.at(t);e.insertBefore(i,r)}rows(){const t=this.children.head;return t==null?[]:t.children.map(e=>e)}}Tt.allowedChildren=[X];X.requiredContainer=Tt;X.allowedChildren=[Q];Q.requiredContainer=X;Q.allowedChildren=[F];F.requiredContainer=Q;function se(){return`row-${Math.random().toString(36).slice(2,6)}`}class Hi extends ${static register(){d.register(F),d.register(Q),d.register(X),d.register(Tt)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Tt).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();e!=null&&(t.deleteColumn(e.cellOffset()),this.quill.update(d.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(d.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove(),this.quill.update(d.sources.USER),this.quill.setSelection(e,d.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[e,s]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==F.blotName)return[null,null,null,-1];const i=e.parent;return[i.parent.parent,i,e,s]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[s,i,r]=this.getTable(e);if(r==null)return;const l=r.cellOffset();s.insertColumn(l+t),this.quill.update(d.sources.USER);let o=i.rowOffset();t===0&&(o+=1),this.quill.setSelection(e.index+o,e.length,d.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[s,i,r]=this.getTable(e);if(r==null)return;const l=i.rowOffset();s.insertRow(l+t),this.quill.update(d.sources.USER),t>0?this.quill.setSelection(e,d.sources.SILENT):this.quill.setSelection(e.index+i.children.length,e.length,d.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const s=this.quill.getSelection();if(s==null)return;const i=new Array(t).fill(0).reduce(r=>{const l=new Array(e).fill(` `).join("");return r.insert(l,{table:se()})},new E().retain(s.index));this.quill.updateContents(i,d.sources.USER),this.quill.setSelection(s.index,d.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(d.events.SCROLL_OPTIMIZE,t=>{t.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(d.events.TEXT_CHANGE,(s,i,r)=>{r===d.sources.USER&&this.balanceTables()}),!0):!1)})}}const ve=K("quill:toolbar");class ie extends ${constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){const s=document.createElement("div");s.setAttribute("role","toolbar"),Fi(s,this.options.container),t.container?.parentNode?.insertBefore(s,t.container),this.container=s}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){ve.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(s=>{const i=this.options.handlers?.[s];i&&this.addHandler(s,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(s=>{this.attach(s)}),this.quill.on(d.events.EDITOR_CHANGE,()=>{const[s]=this.quill.selection.getRange();this.update(s)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(i=>i.indexOf("ql-")===0);if(!e)return;if(e=e.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[e]==null&&this.quill.scroll.query(e)==null){ve.warn("ignoring attaching to nonexistent format",e,t);return}const s=t.tagName==="SELECT"?"change":"click";t.addEventListener(s,i=>{let r;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const o=t.options[t.selectedIndex];o.hasAttribute("selected")?r=!1:r=o.value||!1}else t.classList.contains("ql-active")?r=!1:r=t.value||!t.hasAttribute("value"),i.preventDefault();this.quill.focus();const[l]=this.quill.selection.getRange();if(this.handlers[e]!=null)this.handlers[e].call(this,r);else if(this.quill.scroll.query(e).prototype instanceof M){if(r=prompt(`Enter ${e}`),!r)return;this.quill.updateContents(new E().retain(l.index).delete(l.length).insert({[e]:r}),d.sources.USER)}else this.quill.format(e,r,d.sources.USER);this.update(l)}),this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach(s=>{const[i,r]=s;if(r.tagName==="SELECT"){let l=null;if(t==null)l=null;else if(e[i]==null)l=r.querySelector("option[selected]");else if(!Array.isArray(e[i])){let o=e[i];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),l=r.querySelector(`option[value="${o}"]`)}l==null?(r.value="",r.selectedIndex=-1):l.selected=!0}else if(t==null)r.classList.remove("ql-active"),r.setAttribute("aria-pressed","false");else if(r.hasAttribute("value")){const l=e[i],o=l===r.getAttribute("value")||l!=null&&l.toString()===r.getAttribute("value")||l==null&&!r.getAttribute("value");r.classList.toggle("ql-active",o),r.setAttribute("aria-pressed",o.toString())}else{const l=e[i]!=null;r.classList.toggle("ql-active",l),r.setAttribute("aria-pressed",l.toString())}})}}ie.DEFAULTS={};function Ae(n,t,e){const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add(`ql-${t}`),s.setAttribute("aria-pressed","false"),e!=null?(s.value=e,s.setAttribute("aria-label",`${t}: ${e}`)):s.setAttribute("aria-label",t),n.appendChild(s)}function Fi(n,t){Array.isArray(t[0])||(t=[t]),t.forEach(e=>{const s=document.createElement("span");s.classList.add("ql-formats"),e.forEach(i=>{if(typeof i=="string")Ae(s,i);else{const r=Object.keys(i)[0],l=i[r];Array.isArray(l)?ji(s,r,l):Ae(s,r,l)}}),n.appendChild(s)})}function ji(n,t,e){const s=document.createElement("select");s.classList.add(`ql-${t}`),e.forEach(i=>{const r=document.createElement("option");i!==!1?r.setAttribute("value",String(i)):r.setAttribute("selected","selected"),s.appendChild(r)}),n.appendChild(s)}ie.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(e=>{this.quill.scroll.query(e,N.INLINE)!=null&&this.quill.format(e,!1,d.sources.USER)})}else this.quill.removeFormat(n.index,n.length,d.sources.USER)},direction(n){const{align:t}=this.quill.getFormat();n==="rtl"&&t==null?this.quill.format("align","right",d.sources.USER):!n&&t==="right"&&this.quill.format("align",!1,d.sources.USER),this.quill.format("direction",n,d.sources.USER)},indent(n){const t=this.quill.getSelection(),e=this.quill.getFormat(t),s=parseInt(e.indent||0,10);if(n==="+1"||n==="-1"){let i=n==="+1"?1:-1;e.direction==="rtl"&&(i*=-1),this.quill.format("indent",s+i,d.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,d.sources.USER)},list(n){const t=this.quill.getSelection(),e=this.quill.getFormat(t);n==="check"?e.list==="checked"||e.list==="unchecked"?this.quill.format("list",!1,d.sources.USER):this.quill.format("list","unchecked",d.sources.USER):this.quill.format("list",n,d.sources.USER)}}};const Pi='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',$i='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',_i='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Vi='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',zi='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',Ki='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Zi='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Gi='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',Le='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Wi='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',Xi='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',Yi='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',Qi='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',Ji='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',tn='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',en='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',sn='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',nn='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',rn='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',ln='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',on='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',an='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',cn='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',un='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" 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 ql-stroke" 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>',hn='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',dn='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',fn='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',gn='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',mn='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',pn='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',bn='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',yn='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',En='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',ht={align:{"":Pi,center:$i,right:_i,justify:Vi},background:zi,blockquote:Ki,bold:Zi,clean:Gi,code:Le,"code-block":Le,color:Wi,direction:{"":Xi,rtl:Yi},formula:Qi,header:{1:Ji,2:tn,3:en,4:sn,5:nn,6:rn},italic:ln,image:on,indent:{"+1":an,"-1":cn},link:un,list:{bullet:hn,check:dn,ordered:fn},script:{sub:gn,super:mn},strike:pn,table:bn,underline:yn,video:En},xn='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let Te=0;function Se(n,t){n.setAttribute(t,`${n.getAttribute(t)!=="true"}`)}class Rt{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Se(this.label,"aria-expanded"),Se(this.options,"aria-hidden")}buildItem(t){const e=document.createElement("span");e.tabIndex="0",e.setAttribute("role","button"),e.classList.add("ql-picker-item");const s=t.getAttribute("value");return s&&e.setAttribute("data-value",s),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",i=>{switch(i.key){case"Enter":this.selectItem(e,!0),i.preventDefault();break;case"Escape":this.escape(),i.preventDefault();break}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=xn,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id=`ql-picker-options-${Te}`,Te+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const s=this.buildItem(e);t.appendChild(s),e.selected===!0&&this.selectItem(s)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const s=this.container.querySelector(".ql-selected");t!==s&&(s?.classList.remove("ql-selected"),t!=null&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const s=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(s)}else this.selectItem(null);const e=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class ts extends Rt{constructor(t,e){super(t),this.label.innerHTML=e,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(s=>{s.classList.add("ql-primary")})}buildItem(t){const e=super.buildItem(t);return e.style.backgroundColor=t.getAttribute("value")||"",e}selectItem(t,e){super.selectItem(t,e);const s=this.label.querySelector(".ql-color-label"),i=t&&t.getAttribute("data-value")||"";s&&(s.tagName==="line"?s.style.stroke=i:s.style.fill=i)}}class es extends Rt{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(s=>{s.innerHTML=e[s.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const s=t||this.defaultItem;if(s!=null){if(this.label.innerHTML===s.innerHTML)return;this.label.innerHTML=s.innerHTML}}}const qn=n=>{const{overflowY:t}=getComputedStyle(n,null);return t!=="visible"&&t!=="clip"};class ss{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,qn(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const e=t.left+t.width/2-this.root.offsetWidth/2,s=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${e}px`,this.root.style.top=`${s}px`,this.root.classList.remove("ql-flip");const i=this.boundsContainer.getBoundingClientRect(),r=this.root.getBoundingClientRect();let l=0;if(r.right>i.right&&(l=i.right-r.right,this.root.style.left=`${e+l}px`),r.left<i.left&&(l=i.left-r.left,this.root.style.left=`${e+l}px`),r.bottom>i.bottom){const o=r.bottom-r.top,a=t.bottom-t.top+o;this.root.style.top=`${s-a}px`,this.root.classList.add("ql-flip")}return l}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Nn=[!1,"center","right","justify"],kn=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],wn=[!1,"serif","monospace"],vn=["1","2","3",!1],An=["small",!1,"large","huge"];class mt extends lt{constructor(t,e){super(t,e);const s=i=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",s);return}this.tooltip!=null&&!this.tooltip.root.contains(i.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(r=>{r.container.contains(i.target)||r.close()})};t.emitter.listenDOM("click",document.body,s)}addModule(t){const e=super.addModule(t);return t==="toolbar"&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(s=>{(s.getAttribute("class")||"").split(/\s+/).forEach(r=>{if(r.startsWith("ql-")&&(r=r.slice(3),e[r]!=null))if(r==="direction")s.innerHTML=e[r][""]+e[r].rtl;else if(typeof e[r]=="string")s.innerHTML=e[r];else{const l=s.value||"";l!=null&&e[r][l]&&(s.innerHTML=e[r][l])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(i=>{if(i.classList.contains("ql-align")&&(i.querySelector("option")==null&&ot(i,Nn),typeof e.align=="object"))return new es(i,e.align);if(i.classList.contains("ql-background")||i.classList.contains("ql-color")){const r=i.classList.contains("ql-background")?"background":"color";return i.querySelector("option")==null&&ot(i,kn,r==="background"?"#ffffff":"#000000"),new ts(i,e[r])}return i.querySelector("option")==null&&(i.classList.contains("ql-font")?ot(i,wn):i.classList.contains("ql-header")?ot(i,vn):i.classList.contains("ql-size")&&ot(i,An)),new Rt(i)});const s=()=>{this.pickers.forEach(i=>{i.update()})};this.quill.on(y.events.EDITOR_CHANGE,s)}}mt.DEFAULTS=W({},lt.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class is extends ss{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{t.key==="Enter"?(this.save(),t.preventDefault()):t.key==="Escape"&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;e!=null?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const s=this.quill.getBounds(this.quill.selection.savedRange);s!=null&&this.position(s),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:e}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,y.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,y.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=Ln(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(e!=null){const s=e.index+e.length;this.quill.insertEmbed(s,this.root.getAttribute("data-mode"),t,y.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(s+1," ",y.sources.USER),this.quill.setSelection(s+2,y.sources.USER)}break}}this.textbox.value="",this.hide()}}function Ln(n){let t=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:n}function ot(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(s=>{const i=document.createElement("option");s===e?i.setAttribute("selected","selected"):i.setAttribute("value",String(s)),n.appendChild(i)})}const Tn=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Sn extends is{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(t,e){super(t,e),this.quill.on(y.events.EDITOR_CHANGE,(s,i,r,l)=>{if(s===y.events.SELECTION_CHANGE)if(i!=null&&i.length>0&&l===y.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(i.index,i.length);if(o.length===1){const a=this.quill.getBounds(i);a!=null&&this.position(a)}else{const a=o[o.length-1],u=this.quill.getIndex(a),f=Math.min(a.length()-1,i.index+i.length-u),m=this.quill.getBounds(new Y(u,f));m!=null&&this.position(m)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(y.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const e=this.quill.getBounds(t);e!=null&&this.position(e)}},1)})}cancel(){this.show()}position(t){const e=super.position(t),s=this.root.querySelector(".ql-tooltip-arrow");return s.style.marginLeft="",e!==0&&(s.style.marginLeft=`${-1*e-s.offsetWidth/2}px`),e}}class ns extends mt{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=Tn),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new Sn(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),ht),this.buildPickers(t.container.querySelectorAll("select"),ht))}}ns.DEFAULTS=W({},mt.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,d.sources.USER)}}}}});const Cn=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Rn extends is{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,y.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(y.events.SELECTION_CHANGE,(t,e,s)=>{if(t!=null){if(t.length===0&&s===y.sources.USER){const[i,r]=this.quill.scroll.descendant(Lt,t.index);if(i!=null){this.linkRange=new Y(t.index-r,i.length());const l=Lt.formats(i.domNode);this.preview.textContent=l,this.preview.setAttribute("href",l),this.show();const o=this.quill.getBounds(this.linkRange);o!=null&&this.position(o);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class rs extends mt{constructor(t,e){e.modules.toolbar!=null&&e.modules.toolbar.container==null&&(e.modules.toolbar.container=Cn),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container!=null&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),ht),this.buildPickers(t.container.querySelectorAll("select"),ht),this.tooltip=new Rn(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,s)=>{t.handlers.link.call(t,!s.format.link)}))}}rs.DEFAULTS=W({},mt.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const t=this.quill.getSelection();if(t==null||t.length===0)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&e.indexOf("mailto:")!==0&&(e=`mailto:${e}`);const{tooltip:s}=this.quill.theme;s.edit("link",e)}else this.quill.format("link",!1,d.sources.USER)}}}}});d.register({"attributors/attribute/direction":$e,"attributors/class/align":Fe,"attributors/class/background":Ms,"attributors/class/color":Bs,"attributors/class/direction":_e,"attributors/class/font":Ke,"attributors/class/size":Ge,"attributors/style/align":je,"attributors/style/background":Xt,"attributors/style/color":Wt,"attributors/style/direction":Ve,"attributors/style/font":Ze,"attributors/style/size":We},!0);d.register({"formats/align":Fe,"formats/direction":_e,"formats/indent":Li,"formats/background":Xt,"formats/color":Wt,"formats/font":Ke,"formats/size":Ge,"formats/blockquote":Ti,"formats/code-block":T,"formats/header":Si,"formats/list":gt,"formats/bold":ee,"formats/code":Yt,"formats/italic":Ci,"formats/link":Lt,"formats/script":Ri,"formats/strike":Oi,"formats/underline":Ii,"formats/formula":Bi,"formats/image":Mi,"formats/video":Di,"modules/syntax":Je,"modules/table":Hi,"modules/toolbar":ie,"themes/bubble":ns,"themes/snow":rs,"ui/icons":ht,"ui/picker":Rt,"ui/icon-picker":es,"ui/color-picker":ts,"ui/tooltip":ss},!0);export{d as Q};
Save
Cancel