@ibiz-template/mob-vue3-components 0.7.41-alpha.23 → 0.7.41-alpha.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-HQsqnjtM.js +2 -0
- package/dist/index-HQsqnjtM.js.map +1 -0
- package/dist/index.min.css +9 -9
- package/dist/index.system.min.js +1 -1
- package/dist/{quill-CeDXLpcJ.js → quill-CSDnV3Pb.js} +2 -2
- package/dist/{quill-CeDXLpcJ.js.map → quill-CSDnV3Pb.js.map} +1 -1
- package/dist/quill-editor-B7NuxNK7.js +2 -0
- package/dist/{quill-editor-C5mEMG93.js.map → quill-editor-B7NuxNK7.js.map} +1 -1
- package/dist/quill-editor-preview-CtFf0ZKt.js +2 -0
- package/dist/{quill-editor-preview-BPS9uMa7.js.map → quill-editor-preview-CtFf0ZKt.js.map} +1 -1
- package/dist/tree-on8cJom4.js +2 -0
- package/dist/{tree-SAqvldtV.js.map → tree-on8cJom4.js.map} +1 -1
- package/dist/{xlsx-util-b5CesqYd.js → xlsx-util-DRvvWEVq.js} +2 -2
- package/dist/{xlsx-util-b5CesqYd.js.map → xlsx-util-DRvvWEVq.js.map} +1 -1
- package/es/common/fullscreen-header/fullscreen-header.css +1 -1
- package/es/control/app-menu/app-menu.mjs +2 -2
- package/es/control/app-menu/custom-menu-design/custom-menu-design.css +1 -1
- package/es/control/app-menu/custom-menu-design/custom-menu-design.mjs +30 -86
- package/es/control/app-menu/custom-menu-design/menu-design-list/menu-design-list.css +1 -0
- package/es/control/app-menu/custom-menu-design/menu-design-list/menu-design-list.mjs +105 -0
- package/es/control/app-menu/custom-menu-design/menu-design-tree/menu-design-tree.css +1 -0
- package/es/control/app-menu/custom-menu-design/menu-design-tree/menu-design-tree.mjs +124 -0
- package/es/control/app-menu/menu-render-util.mjs +4 -1
- package/es/control/form/form-detail/form-button/form-button.mjs +3 -3
- package/es/control/toolbar/float-toolbar/float-toolbar.mjs +6 -1
- package/es/control/toolbar/toolbar-group-list/toolbar-group-list.css +1 -1
- package/es/control/toolbar/toolbar-group-list/toolbar-group-list.mjs +26 -12
- package/es/control/toolbar/toolbar-render-util.mjs +68 -17
- package/es/control/toolbar/toolbar.css +1 -1
- package/es/control/toolbar/toolbar.mjs +3 -0
- package/es/editor/html/quill-editor-preview/quill-editor-preview.css +1 -1
- package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.css +1 -1
- package/es/mob-app/guard/auth-guard/dyna-auth-guard.mjs +1 -1
- package/es/util/button-util/button-util.mjs +2 -2
- package/es/util/fullscreen/fullscreen-util.mjs +1 -1
- package/es/util/list-util/list-render-util.mjs +2 -2
- package/es/view/download-view/download-view.mjs +4 -1
- package/es/view/login-view/login-view.mjs +1 -0
- package/es/view-engine/index-view.engine.mjs +0 -4
- package/lib/common/fullscreen-header/fullscreen-header.css +1 -1
- package/lib/control/app-menu/app-menu.cjs +1 -1
- package/lib/control/app-menu/custom-menu-design/custom-menu-design.cjs +29 -85
- package/lib/control/app-menu/custom-menu-design/custom-menu-design.css +1 -1
- package/lib/control/app-menu/custom-menu-design/menu-design-list/menu-design-list.cjs +107 -0
- package/lib/control/app-menu/custom-menu-design/menu-design-list/menu-design-list.css +1 -0
- package/lib/control/app-menu/custom-menu-design/menu-design-tree/menu-design-tree.cjs +126 -0
- package/lib/control/app-menu/custom-menu-design/menu-design-tree/menu-design-tree.css +1 -0
- package/lib/control/app-menu/menu-render-util.cjs +4 -1
- package/lib/control/form/form-detail/form-button/form-button.cjs +3 -3
- package/lib/control/toolbar/float-toolbar/float-toolbar.cjs +6 -1
- package/lib/control/toolbar/toolbar-group-list/toolbar-group-list.cjs +25 -11
- package/lib/control/toolbar/toolbar-group-list/toolbar-group-list.css +1 -1
- package/lib/control/toolbar/toolbar-render-util.cjs +66 -15
- package/lib/control/toolbar/toolbar.cjs +3 -0
- package/lib/control/toolbar/toolbar.css +1 -1
- package/lib/editor/html/quill-editor-preview/quill-editor-preview.css +1 -1
- package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.css +1 -1
- package/lib/mob-app/guard/auth-guard/dyna-auth-guard.cjs +1 -1
- package/lib/util/button-util/button-util.cjs +2 -2
- package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
- package/lib/util/list-util/list-render-util.cjs +2 -2
- package/lib/view/download-view/download-view.cjs +3 -0
- package/lib/view/login-view/login-view.cjs +1 -0
- package/lib/view-engine/index-view.engine.cjs +0 -4
- package/package.json +5 -5
- package/dist/index-Cxv8dJIk.js +0 -2
- package/dist/index-Cxv8dJIk.js.map +0 -1
- package/dist/quill-editor-C5mEMG93.js +0 -2
- package/dist/quill-editor-preview-BPS9uMa7.js +0 -2
- package/dist/tree-SAqvldtV.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["lodash-es","./index-Cxv8dJIk.js"],function(t){"use strict";var e,n,s,i,r;return{setters:[function(t){e=t.isEqual,n=t.cloneDeep,s=t.merge},function(t){i=t.a,r=t.g}],execute:function(){function o(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var s=n.call(t,e);if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(l||{});class a{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.attrName=t,this.keyName=e;const s=l.TYPE&l.ATTRIBUTE;this.scope=null!=n.scope?n.scope&l.LEVEL|s:l.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(t){return Array.from(t.attributes).map(t=>t.name)}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1)}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}class c extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}const h=class t{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==t)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let n=null;try{n=t.parentNode}catch(t){return null}return this.find(n,e)}return null}create(e,n,s){const i=this.query(n);if(null==i)throw new c("Unable to create ".concat(n," blot"));const r=i,o=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:r.create(s),l=new r(e,o,s);return t.blots.set(l.domNode,l),l}find(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.find(e,n)}query(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.ANY;return"string"==typeof t?e=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?e=this.types.text:"number"==typeof t?t&l.LEVEL&l.BLOCK?e=this.types.block:t&l.LEVEL&l.INLINE&&(e=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(t=>(e=this.classes[t],!!e)),e=e||this.tags[t.tagName]),null==e?null:"scope"in e&&n&l.LEVEL&e.scope&&n&l.TYPE&e.scope?e:null}register(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.map(t=>{const e="blotName"in t,n="attrName"in t;if(!e&&!n)throw new c("Invalid definition");if(e&&"abstract"===t.blotName)throw new c("Cannot register abstract class");const s=e?t.blotName:n?t.attrName:void 0;return this.types[s]=t,n?"string"==typeof t.keyName&&(this.attributes[t.keyName]=t):e&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(t=>t.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(e=>{(null==this.tags[e]||null==t.className)&&(this.tags[e]=t)}))),t})}};h.blots=new WeakMap;let u=h;function d(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(t=>0===t.indexOf("".concat(e,"-")))}const f=class extends a{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add("".concat(this.keyName,"-").concat(e)),!0)}remove(t){d(t,this.keyName).forEach(e=>{t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(d(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function p(t){const e=t.split("-"),n=e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("");return e[0]+n}const g=class extends a{static keys(t){return(t.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(t,e){return!!this.canAdd(t,e)&&(t.style[p(this.keyName)]=e,!0)}remove(t){t.style[p(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[p(this.keyName)];return this.canAdd(t,e)?e:""}};const m=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=u.find(this.domNode);if(null==t)return;const e=a.keys(this.domNode),n=f.keys(this.domNode),s=g.keys(this.domNode);e.concat(n).concat(s).forEach(e=>{const n=t.scroll.query(e,l.ATTRIBUTE);n instanceof a&&(this.attributes[n.attrName]=n)})}copy(t){Object.keys(this.attributes).forEach(e=>{const n=this.attributes[e].value(this.domNode);t.format(e,n)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}},b=class{constructor(t,e){this.scroll=t,this.domNode=e,u.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new c("Blot definition missing tagName");let e,n;return Array.isArray(this.tagName)?("string"==typeof t?(n=t.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof t&&(n=t),e="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){null!=this.parent&&this.parent.removeChild(this),u.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,s){const i=this.isolate(t,e);if(null!=this.scroll.query(n,l.BLOT)&&s)i.wrap(n,s);else if(null!=this.scroll.query(n,l.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);i.wrap(t),t.format(n,s)}}insertAt(t,e,n){const s=null==n?this.scroll.create("text",e):this.scroll.create(e,n),i=this.split(t);this.parent.insertBefore(s,i||void 0)}isolate(t,e){const n=this.split(t);if(null==n)throw new Error("Attempt to isolate at end");return n.split(e),n}length(){return 1}offset(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;return null==this.parent||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new c("Cannot wrap ".concat(t));return n.appendChild(this),n}};b.blotName="abstract";let v=b;const y=class extends v{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};y.scope=l.INLINE_BLOT;const x=y;class N{constructor(){this.head=null,this.tail=null,this.length=0}append(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(t){const e=this.iterator();let n=e();for(;n&&t>0;)t-=1,n=e();return n}contains(t){const e=this.iterator();let n=e();for(;n;){if(n===t)return!0;n=e()}return!1}indexOf(t){const e=this.iterator();let n=e(),s=0;for(;n;){if(n===t)return s;s+=1,n=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,n=this.head;for(;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.head;return()=>{const e=t;return null!=t&&(t=t.next),e}}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.iterator();let s=n();for(;s;){const i=s.length();if(t<i||e&&t===i&&(null==s.next||0!==s.next.length()))return[s,t];t-=i,s=n()}return[null,0]}forEach(t){const e=this.iterator();let n=e();for(;n;)t(n),n=e()}forEachAt(t,e,n){if(e<=0)return;const[s,i]=this.find(t);let r=t-i;const o=this.iterator(s);let l=o();for(;l&&r<t+e;){const s=l.length();t>r?n(l,t-r,Math.min(e,r+s-t)):n(l,0,Math.min(s,t+e-r)),r+=s,l=o()}}map(t){return this.reduce((e,n)=>(e.push(t(n)),e),[])}reduce(t,e){const n=this.iterator();let s=n();for(;s;)e=t(e,s),s=n();return e}}function E(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch(n){const s=e.create(l.INLINE);return Array.from(t.childNodes).forEach(t=>{s.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(s.domNode,t),s.attach(),s}}const A=class t extends v{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(e){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=e,t.uiClass&&this.uiNode.classList.add(t.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new N,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=E(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof c)return;throw t}})}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,(t,e,n)=>{t.deleteAt(e,n)})}descendant(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const[s,i]=this.children.find(n);return null==e.blotName&&e(s)||null!=e.blotName&&s instanceof e?[s,i]:s instanceof t?s.descendant(e,i):[null,-1]}descendants(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_VALUE,i=[],r=s;return this.children.forEachAt(n,s,(n,s,o)=>{(null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e)&&i.push(n),n instanceof t&&(i=i.concat(n.descendants(e,s,r))),r-=o}),i}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(t=>n instanceof t)||(n.statics.scope===l.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof t?n.unwrap():n.remove())})}formatAt(t,e,n,s){this.children.forEachAt(t,e,(t,e,i)=>{t.formatAt(e,i,n,s)})}insertAt(t,e,n){const[s,i]=this.children.find(t);if(s)s.insertAt(i,e,n);else{const t=null==n?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),t.parent=this,null!=e&&(n=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(t.domNode,n),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(n=>{t.insertBefore(n,e)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const[s,i]=this.children.find(e,n),r=[[this,e]];return s instanceof t?r.concat(s.path(i,n)):(null!=s&&r.push([s,i]),r)}removeChild(t){this.children.remove(t)}replaceWith(e,n){const s="string"==typeof e?this.scroll.create(e,n):e;return s instanceof t&&this.moveChildren(s),super.replaceWith(s)}split(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e){if(0===t)return this;if(t===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(t,this.length(),(t,s,i)=>{const r=t.split(s,e);null!=r&&n.appendChild(r)}),n}splitAfter(t){const e=this.clone();for(;null!=t.next;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const n=[],s=[];t.forEach(t=>{t.target===this.domNode&&"childList"===t.type&&(n.push(...t.addedNodes),s.push(...t.removedNodes))}),s.forEach(t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null==e.domNode.parentNode||e.domNode.parentNode===this.domNode)&&e.detach()}),n.filter(t=>t.parentNode===this.domNode&&t!==this.uiNode).sort((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const n=E(t,this.scroll);(n.next!==e||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,e||void 0))}),this.enforceAllowedChildren()}};A.uiClass="";const w=A;const q=class t extends w{static create(t){return super.create(t)}static formats(e,n){const s=n.query(t.blotName);if(null==s||e.tagName!==s.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new m(this.domNode)}format(e,n){if(e!==this.statics.blotName||n){const t=this.scroll.query(e,l.INLINE);if(null==t)return;t instanceof a?this.attributes.attribute(t,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}else this.children.forEach(e=>{e instanceof t||(e=e.wrap(t.blotName,!0)),this.attributes.copy(e)}),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,s){null!=this.formats()[n]||this.scroll.query(n,l.ATTRIBUTE)?this.isolate(t,e).format(n,s):super.formatAt(t,e,n,s)}optimize(e){super.optimize(e);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const s=this.next;s instanceof t&&s.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}(n,s.formats())&&(s.moveChildren(this),s.remove())}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}wrap(e,n){const s=super.wrap(e,n);return s instanceof t&&this.attributes.move(s),s}};q.allowedChildren=[q,x],q.blotName="inline",q.scope=l.INLINE_BLOT,q.tagName="SPAN";const k=q,L=class t extends w{static create(t){return super.create(t)}static formats(e,n){const s=n.query(t.blotName);if(null==s||e.tagName!==s.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new m(this.domNode)}format(e,n){const s=this.scroll.query(e,l.BLOCK);null!=s&&(s instanceof a?this.attributes.attribute(s,n):e!==this.statics.blotName||n?n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n):this.replaceWith(t.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,s){null!=this.scroll.query(n,l.BLOCK)?this.format(n,s):super.formatAt(t,e,n,s)}insertAt(t,e,n){if(null==n||null!=this.scroll.query(e,l.INLINE))super.insertAt(t,e,n);else{const s=this.split(t);if(null==s)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,n);s.parent.insertBefore(t,s)}}}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}};L.blotName="block",L.scope=l.BLOCK_BLOT,L.tagName="P",L.allowedChildren=[k,L,x];const T=L,S=class extends w{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,n,s){super.formatAt(t,e,n,s),this.enforceAllowedChildren()}insertAt(t,e,n){super.insertAt(t,e,n),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};S.blotName="container",S.scope=l.BLOCK_BLOT;const O=S;const _=class extends x{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,s){0===t&&e===this.length()?this.format(n,s):super.formatAt(t,e,n,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}},C={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},R=class extends w{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(t=>{this.update(t)}),this.observer.observe(this.domNode,C),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.registry.find(t,e);return n?n.scroll===this?n:e?this.find(n.scroll.domNode.parentNode,!0):null:null}query(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.ANY;return this.registry.query(t,e)}register(){return this.registry.register(...arguments)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach(t=>{t.remove()}):super.deleteAt(t,e)}formatAt(t,e,n,s){this.update(),super.formatAt(t,e,n,s)}insertAt(t,e,n){this.update(),super.insertAt(t,e,n)}optimize(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super.optimize(n);const s=n.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const r=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];null==e||e===t||null!=e.domNode.parentNode&&(s.has(e.domNode)||s.set(e.domNode,[]),n&&r(e.parent))},o=t=>{s.has(t.domNode)&&(t instanceof w&&t.children.forEach(o),s.delete(t.domNode),t.optimize(n))};let l=e;for(let t=0;l.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(r(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach(t=>{const e=this.find(t,!1);r(e,!1),e instanceof w&&e.children.forEach(t=>{r(t,!1)})})):"attributes"===t.type&&r(e.prev)),r(e))}),this.children.forEach(o),l=Array.from(this.observer.takeRecords()),i=l.slice();i.length>0;)e.push(i.pop())}}update(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=t||this.observer.takeRecords();const n=new WeakMap;t.map(t=>{const e=this.find(t.target,!0);return null==e?null:n.has(e.domNode)?(n.get(e.domNode).push(t),null):(n.set(e.domNode,[t]),e)}).forEach(t=>{null!=t&&t!==this&&n.has(t.domNode)&&t.update(n.get(t.domNode)||[],e)}),e.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),e),this.optimize(t,e)}};R.blotName="scroll",R.defaultChild=T,R.allowedChildren=[T,O],R.scope=l.BLOCK_BLOT,R.tagName="DIV";const I=R,j=class t extends x{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,n){null==n?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,n)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t){return[this.domNode,t]}split(t){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])){if(0===t)return this;if(t===this.length())return this.next}const e=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(e,this.next||void 0),this.text=this.statics.value(this.domNode),e}update(t,e){t.some(t=>"characterData"===t.type&&t.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};j.blotName="text",j.scope=l.INLINE_BLOT;const M=j;var B=Object.freeze({__proto__:null,Attributor:a,AttributorStore:m,BlockBlot:T,ClassAttributor:f,ContainerBlot:O,EmbedBlot:_,InlineBlot:k,LeafBlot:x,ParentBlot:w,Registry:u,Scope:l,ScrollBlot:I,StyleAttributor:g,TextBlot:M}),D={exports:{}},U=-1;function P(t,e,n,s,i){if(t===e)return t?[[0,t]]:[];if(null!=n){var r=function(t,e,n){var s="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,r=t.length,o=e.length;if(0===s.length&&(null===i||0===i.length)){var l=s.index,a=t.slice(0,l),c=t.slice(l),h=i?i.index:null,u=l+o-r;if((null===h||h===u)&&!(u<0||u>o)){var d=e.slice(0,u);if((g=e.slice(u))===c){var f=Math.min(l,u);if((b=a.slice(0,f))===(y=d.slice(0,f)))return et(b,a.slice(f),d.slice(f),c)}}if(null===h||h===l){var p=l,g=(d=e.slice(0,p),e.slice(p));if(d===a){var m=Math.min(r-p,o-p);if((v=c.slice(c.length-m))===(x=g.slice(g.length-m)))return et(a,c.slice(0,c.length-m),g.slice(0,g.length-m),v)}}}if(s.length>0&&i&&0===i.length){var b=t.slice(0,s.index),v=t.slice(s.index+s.length);if(!(o<(f=b.length)+(m=v.length))){var y=e.slice(0,f),x=e.slice(o-m);if(b===y&&v===x)return et(b,t.slice(f,r-m),e.slice(f,o-m),v)}}return null}(t,e,n);if(r)return r}var o=z(t,e),l=t.substring(0,o);o=V(t=t.substring(o),e=e.substring(o));var a=t.substring(t.length-o),c=function(t,e){var n;if(!t)return[[1,e]];if(!e)return[[U,t]];var s=t.length>e.length?t:e,i=t.length>e.length?e:t,r=s.indexOf(i);if(-1!==r)return n=[[1,s.substring(0,r)],[0,i],[1,s.substring(r+i.length)]],t.length>e.length&&(n[0][0]=n[2][0]=U),n;if(1===i.length)return[[U,t],[1,e]];var o=function(t,e){var n=t.length>e.length?t:e,s=t.length>e.length?e:t;if(n.length<4||2*s.length<n.length)return null;function i(t,e,n){for(var s,i,r,o,l=t.substring(n,n+Math.floor(t.length/4)),a=-1,c="";-1!==(a=e.indexOf(l,a+1));){var h=z(t.substring(n),e.substring(a)),u=V(t.substring(0,n),e.substring(0,a));c.length<u+h&&(c=e.substring(a-u,a)+e.substring(a,a+h),s=t.substring(0,n-u),i=t.substring(n+h),r=e.substring(0,a-u),o=e.substring(a+h))}return 2*c.length>=t.length?[s,i,r,o,c]:null}var r,o,l,a,c,h=i(n,s,Math.ceil(n.length/4)),u=i(n,s,Math.ceil(n.length/2));if(!h&&!u)return null;r=u?h&&h[4].length>u[4].length?h:u:h;t.length>e.length?(o=r[0],l=r[1],a=r[2],c=r[3]):(a=r[0],c=r[1],o=r[2],l=r[3]);var d=r[4];return[o,l,a,c,d]}(t,e);if(o){var l=o[0],a=o[1],c=o[2],h=o[3],u=o[4],d=P(l,c),f=P(a,h);return d.concat([[0,u]],f)}return function(t,e){for(var n=t.length,s=e.length,i=Math.ceil((n+s)/2),r=i,o=2*i,l=new Array(o),a=new Array(o),c=0;c<o;c++)l[c]=-1,a[c]=-1;l[r+1]=0,a[r+1]=0;for(var h=n-s,u=h%2!=0,d=0,f=0,p=0,g=0,m=0;m<i;m++){for(var b=-m+d;b<=m-f;b+=2){for(var v=r+b,y=(w=b===-m||b!==m&&l[v-1]<l[v+1]?l[v+1]:l[v-1]+1)-b;w<n&&y<s&&t.charAt(w)===e.charAt(y);)w++,y++;if(l[v]=w,w>n)f+=2;else if(y>s)d+=2;else if(u){if((E=r+h-b)>=0&&E<o&&-1!==a[E])if(w>=(N=n-a[E]))return H(t,e,w,y)}}for(var x=-m+p;x<=m-g;x+=2){for(var N,E=r+x,A=(N=x===-m||x!==m&&a[E-1]<a[E+1]?a[E+1]:a[E-1]+1)-x;N<n&&A<s&&t.charAt(n-N-1)===e.charAt(s-A-1);)N++,A++;if(a[E]=N,N>n)g+=2;else if(A>s)p+=2;else if(!u){if((v=r+h-x)>=0&&v<o&&-1!==l[v]){var w;y=r+(w=l[v])-v;if(w>=(N=n-N))return H(t,e,w,y)}}}}return[[U,t],[1,e]]}(t,e)}(t=t.substring(0,t.length-o),e=e.substring(0,e.length-o));return l&&c.unshift([0,l]),a&&c.push([0,a]),X(c,i),s&&function(t){var e=!1,n=[],s=0,i=null,r=0,o=0,l=0,a=0,c=0;for(;r<t.length;)0==t[r][0]?(n[s++]=r,o=a,l=c,a=0,c=0,i=t[r][1]):(1==t[r][0]?a+=t[r][1].length:c+=t[r][1].length,i&&i.length<=Math.max(o,l)&&i.length<=Math.max(a,c)&&(t.splice(n[s-1],0,[U,i]),t[n[s-1]+1][0]=1,s--,r=--s>0?n[s-1]:-1,o=0,l=0,a=0,c=0,i=null,e=!0)),r++;e&&X(t);(function(t){function e(t,e){if(!t||!e)return 6;var n=t.charAt(t.length-1),s=e.charAt(0),i=n.match(K),r=s.match(K),o=i&&n.match(Z),l=r&&s.match(Z),a=o&&n.match(W),c=l&&s.match(W),h=a&&t.match(G),u=c&&e.match($);return h||u?5:a||c?4:i&&!o&&l?3:o||l?2:i||r?1:0}var n=1;for(;n<t.length-1;){if(0==t[n-1][0]&&0==t[n+1][0]){var s=t[n-1][1],i=t[n][1],r=t[n+1][1],o=V(s,i);if(o){var l=i.substring(i.length-o);s=s.substring(0,s.length-o),i=l+i.substring(0,i.length-o),r=l+r}for(var a=s,c=i,h=r,u=e(s,i)+e(i,r);i.charAt(0)===r.charAt(0);){s+=i.charAt(0),i=i.substring(1)+r.charAt(0),r=r.substring(1);var d=e(s,i)+e(i,r);d>=u&&(u=d,a=s,c=i,h=r)}t[n-1][1]!=a&&(a?t[n-1][1]=a:(t.splice(n-1,1),n--),t[n][1]=c,h?t[n+1][1]=h:(t.splice(n+1,1),n--))}n++}})(t),r=1;for(;r<t.length;){if(t[r-1][0]==U&&1==t[r][0]){var h=t[r-1][1],u=t[r][1],d=F(h,u),f=F(u,h);d>=f?(d>=h.length/2||d>=u.length/2)&&(t.splice(r,0,[0,u.substring(0,d)]),t[r-1][1]=h.substring(0,h.length-d),t[r+1][1]=u.substring(d),r++):(f>=h.length/2||f>=u.length/2)&&(t.splice(r,0,[0,h.substring(0,f)]),t[r-1][0]=1,t[r-1][1]=u.substring(0,u.length-f),t[r+1][0]=U,t[r+1][1]=h.substring(f),r++),r++}r++}}(c),c}function H(t,e,n,s){var i=t.substring(0,n),r=e.substring(0,s),o=t.substring(n),l=e.substring(s),a=P(i,r),c=P(o,l);return a.concat(c)}function z(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,s=Math.min(t.length,e.length),i=s,r=0;n<i;)t.substring(r,i)==e.substring(r,i)?r=n=i:s=i,i=Math.floor((s-n)/2+n);return Y(t.charCodeAt(i-1))&&i--,i}function F(t,e){var n=t.length,s=e.length;if(0==n||0==s)return 0;n>s?t=t.substring(n-s):n<s&&(e=e.substring(0,n));var i=Math.min(n,s);if(t==e)return i;for(var r=0,o=1;;){var l=t.substring(i-o),a=e.indexOf(l);if(-1==a)return r;o+=a,0!=a&&t.substring(i-o)!=e.substring(0,o)||(r=o,o++)}}function V(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var n=0,s=Math.min(t.length,e.length),i=s,r=0;n<i;)t.substring(t.length-i,t.length-r)==e.substring(e.length-i,e.length-r)?r=n=i:s=i,i=Math.floor((s-n)/2+n);return Q(t.charCodeAt(t.length-i))&&i--,i}var K=/[^a-zA-Z0-9]/,Z=/\s/,W=/[\r\n]/,G=/\n\r?\n$/,$=/^\r?\n\r?\n/;function X(t,e){t.push([0,""]);for(var n,s=0,i=0,r=0,o="",l="";s<t.length;)if(s<t.length-1&&!t[s][1])t.splice(s,1);else switch(t[s][0]){case 1:r++,l+=t[s][1],s++;break;case U:i++,o+=t[s][1],s++;break;case 0:var a=s-r-i-1;if(e){if(a>=0&&tt(t[a][1])){var c=t[a][1].slice(-1);if(t[a][1]=t[a][1].slice(0,-1),o=c+o,l=c+l,!t[a][1]){t.splice(a,1),s--;var h=a-1;t[h]&&1===t[h][0]&&(r++,l=t[h][1]+l,h--),t[h]&&t[h][0]===U&&(i++,o=t[h][1]+o,h--),a=h}}if(J(t[s][1])){c=t[s][1].charAt(0);t[s][1]=t[s][1].slice(1),o+=c,l+=c}}if(s<t.length-1&&!t[s][1]){t.splice(s,1);break}if(o.length>0||l.length>0){o.length>0&&l.length>0&&(0!==(n=z(l,o))&&(a>=0?t[a][1]+=l.substring(0,n):(t.splice(0,0,[0,l.substring(0,n)]),s++),l=l.substring(n),o=o.substring(n)),0!==(n=V(l,o))&&(t[s][1]=l.substring(l.length-n)+t[s][1],l=l.substring(0,l.length-n),o=o.substring(0,o.length-n)));var u=r+i;0===o.length&&0===l.length?(t.splice(s-u,u),s-=u):0===o.length?(t.splice(s-u,u,[1,l]),s=s-u+1):0===l.length?(t.splice(s-u,u,[U,o]),s=s-u+1):(t.splice(s-u,u,[U,o],[1,l]),s=s-u+2)}0!==s&&0===t[s-1][0]?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,r=0,i=0,o="",l=""}""===t[t.length-1][1]&&t.pop();var d=!1;for(s=1;s<t.length-1;)0===t[s-1][0]&&0===t[s+1][0]&&(t[s][1].substring(t[s][1].length-t[s-1][1].length)===t[s-1][1]?(t[s][1]=t[s-1][1]+t[s][1].substring(0,t[s][1].length-t[s-1][1].length),t[s+1][1]=t[s-1][1]+t[s+1][1],t.splice(s-1,1),d=!0):t[s][1].substring(0,t[s+1][1].length)==t[s+1][1]&&(t[s-1][1]+=t[s+1][1],t[s][1]=t[s][1].substring(t[s+1][1].length)+t[s+1][1],t.splice(s+1,1),d=!0)),s++;d&&X(t,e)}function Y(t){return t>=55296&&t<=56319}function Q(t){return t>=56320&&t<=57343}function J(t){return Q(t.charCodeAt(0))}function tt(t){return Y(t.charCodeAt(t.length-1))}function et(t,e,n,s){return tt(t)||J(s)?null:function(t){for(var e=[],n=0;n<t.length;n++)t[n][1].length>0&&e.push(t[n]);return e}([[0,t],[U,e],[1,n],[0,s]])}function nt(t,e,n,s){return P(t,e,n,s,!0)}nt.INSERT=1,nt.DELETE=U,nt.EQUAL=0;var st=nt,it={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Boolean]",l="[object Date]",a="[object Function]",c="[object GeneratorFunction]",h="[object Map]",u="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",g="[object Set]",m="[object String]",b="[object Symbol]",v="[object WeakMap]",y="[object ArrayBuffer]",x="[object DataView]",N="[object Float32Array]",E="[object Float64Array]",A="[object Int8Array]",w="[object Int16Array]",q="[object Int32Array]",k="[object Uint8Array]",L="[object Uint8ClampedArray]",T="[object Uint16Array]",S="[object Uint32Array]",O=/\w*$/,_=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,R={};R[r]=R["[object Array]"]=R[y]=R[x]=R[o]=R[l]=R[N]=R[E]=R[A]=R[w]=R[q]=R[h]=R[u]=R[d]=R[p]=R[g]=R[m]=R[b]=R[k]=R[L]=R[T]=R[S]=!0,R["[object Error]"]=R[a]=R[v]=!1;var I="object"==typeof i&&i&&i.Object===Object&&i,j="object"==typeof self&&self&&self.Object===Object&&self,M=I||j||Function("return this")(),B=e&&!e.nodeType&&e,D=B&&t&&!t.nodeType&&t,U=D&&D.exports===B;function P(t,e){return t.set(e[0],e[1]),t}function H(t,e){return t.add(e),t}function z(t,e,n,s){for(var i=-1,r=t?t.length:0;++i<r;)n=e(n,t[i],i,t);return n}function F(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function V(t){var e=-1,n=Array(t.size);return t.forEach(function(t,s){n[++e]=[s,t]}),n}function K(t,e){return function(n){return t(e(n))}}function Z(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}var W,G=Array.prototype,$=Function.prototype,X=Object.prototype,Y=M["__core-js_shared__"],Q=(W=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",J=$.toString,tt=X.hasOwnProperty,et=X.toString,nt=RegExp("^"+J.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=U?M.Buffer:void 0,it=M.Symbol,rt=M.Uint8Array,ot=K(Object.getPrototypeOf,Object),lt=Object.create,at=X.propertyIsEnumerable,ct=G.splice,ht=Object.getOwnPropertySymbols,ut=st?st.isBuffer:void 0,dt=K(Object.keys,Object),ft=Dt(M,"DataView"),pt=Dt(M,"Map"),gt=Dt(M,"Promise"),mt=Dt(M,"Set"),bt=Dt(M,"WeakMap"),vt=Dt(Object,"create"),yt=Ft(ft),xt=Ft(pt),Nt=Ft(gt),Et=Ft(mt),At=Ft(bt),wt=it?it.prototype:void 0,qt=wt?wt.valueOf:void 0;function kt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function Lt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function Tt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function St(t){this.__data__=new Lt(t)}function Ot(t,e){var n=Kt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Zt(t)}(t)&&tt.call(t,"callee")&&(!at.call(t,"callee")||et.call(t)==r)}(t)?function(t,e){for(var n=-1,s=Array(t);++n<t;)s[n]=e(n);return s}(t.length,String):[],s=n.length,i=!!s;for(var o in t)!tt.call(t,o)||i&&("length"==o||Ht(o,s))||n.push(o);return n}function _t(t,e,n){var s=t[e];tt.call(t,e)&&Vt(s,n)&&(void 0!==n||e in t)||(t[e]=n)}function Ct(t,e){for(var n=t.length;n--;)if(Vt(t[n][0],e))return n;return-1}function Rt(t,e,n,s,i,f,v){var _;if(s&&(_=f?s(t,i,f,v):s(t)),void 0!==_)return _;if(!$t(t))return t;var C=Kt(t);if(C){if(_=function(t){var e=t.length,n=t.constructor(e);e&&"string"==typeof t[0]&&tt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!e)return function(t,e){var n=-1,s=t.length;e||(e=Array(s));for(;++n<s;)e[n]=t[n];return e}(t,_)}else{var I=Pt(t),j=I==a||I==c;if(Wt(t))return function(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}(t,e);if(I==d||I==r||j&&!f){if(F(t))return f?t:{};if(_=function(t){return"function"!=typeof t.constructor||zt(t)?{}:(e=ot(t),$t(e)?lt(e):{});var e}(j?{}:t),!e)return function(t,e){return Mt(t,Ut(t),e)}(t,function(t,e){return t&&Mt(e,Xt(e),t)}(_,t))}else{if(!R[I])return f?t:{};_=function(t,e,n,s){var i=t.constructor;switch(e){case y:return jt(t);case o:case l:return new i(+t);case x:return function(t,e){var n=e?jt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,s);case N:case E:case A:case w:case q:case k:case L:case T:case S:return function(t,e){var n=e?jt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,s);case h:return function(t,e,n){var s=e?n(V(t),!0):V(t);return z(s,P,new t.constructor)}(t,s,n);case u:case m:return new i(t);case p:return function(t){var e=new t.constructor(t.source,O.exec(t));return e.lastIndex=t.lastIndex,e}(t);case g:return function(t,e,n){var s=e?n(Z(t),!0):Z(t);return z(s,H,new t.constructor)}(t,s,n);case b:return r=t,qt?Object(qt.call(r)):{}}var r}(t,I,Rt,e)}}v||(v=new St);var M=v.get(t);if(M)return M;if(v.set(t,_),!C)var B=n?function(t){return function(t,e,n){var s=e(t);return Kt(t)?s:function(t,e){for(var n=-1,s=e.length,i=t.length;++n<s;)t[i+n]=e[n];return t}(s,n(t))}(t,Xt,Ut)}(t):Xt(t);return function(t,e){for(var n=-1,s=t?t.length:0;++n<s&&!1!==e(t[n],n,t););}(B||t,function(i,r){B&&(i=t[r=i]),_t(_,r,Rt(i,e,n,s,r,t,v))}),_}function It(t){return!(!$t(t)||(e=t,Q&&Q in e))&&(Gt(t)||F(t)?nt:_).test(Ft(t));var e}function jt(t){var e=new t.constructor(t.byteLength);return new rt(e).set(new rt(t)),e}function Mt(t,e,n,s){n||(n={});for(var i=-1,r=e.length;++i<r;){var o=e[i];_t(n,o,t[o])}return n}function Bt(t,e){var n,s,i=t.__data__;return("string"==(s=typeof(n=e))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Dt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return It(n)?n:void 0}kt.prototype.clear=function(){this.__data__=vt?vt(null):{}},kt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},kt.prototype.get=function(t){var e=this.__data__;if(vt){var s=e[t];return s===n?void 0:s}return tt.call(e,t)?e[t]:void 0},kt.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:tt.call(e,t)},kt.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?n:e,this},Lt.prototype.clear=function(){this.__data__=[]},Lt.prototype.delete=function(t){var e=this.__data__,n=Ct(e,t);return!(n<0)&&(n==e.length-1?e.pop():ct.call(e,n,1),!0)},Lt.prototype.get=function(t){var e=this.__data__,n=Ct(e,t);return n<0?void 0:e[n][1]},Lt.prototype.has=function(t){return Ct(this.__data__,t)>-1},Lt.prototype.set=function(t,e){var n=this.__data__,s=Ct(n,t);return s<0?n.push([t,e]):n[s][1]=e,this},Tt.prototype.clear=function(){this.__data__={hash:new kt,map:new(pt||Lt),string:new kt}},Tt.prototype.delete=function(t){return Bt(this,t).delete(t)},Tt.prototype.get=function(t){return Bt(this,t).get(t)},Tt.prototype.has=function(t){return Bt(this,t).has(t)},Tt.prototype.set=function(t,e){return Bt(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new Lt},St.prototype.delete=function(t){return this.__data__.delete(t)},St.prototype.get=function(t){return this.__data__.get(t)},St.prototype.has=function(t){return this.__data__.has(t)},St.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Lt){var s=n.__data__;if(!pt||s.length<199)return s.push([t,e]),this;n=this.__data__=new Tt(s)}return n.set(t,e),this};var Ut=ht?K(ht,Object):function(){return[]},Pt=function(t){return et.call(t)};function Ht(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||C.test(t))&&t>-1&&t%1==0&&t<e}function zt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||X)}function Ft(t){if(null!=t){try{return J.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Vt(t,e){return t===e||t!=t&&e!=e}(ft&&Pt(new ft(new ArrayBuffer(1)))!=x||pt&&Pt(new pt)!=h||gt&&Pt(gt.resolve())!=f||mt&&Pt(new mt)!=g||bt&&Pt(new bt)!=v)&&(Pt=function(t){var e=et.call(t),n=e==d?t.constructor:void 0,s=n?Ft(n):void 0;if(s)switch(s){case yt:return x;case xt:return h;case Nt:return f;case Et:return g;case At:return v}return e});var Kt=Array.isArray;function Zt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}(t.length)&&!Gt(t)}var Wt=ut||function(){return!1};function Gt(t){var e=$t(t)?et.call(t):"";return e==a||e==c}function $t(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return Zt(t)?Ot(t):function(t){if(!zt(t))return dt(t);var e=[];for(var n in Object(t))tt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}t.exports=function(t){return Rt(t,!0,!0)}}(it,it.exports);var rt=it.exports,ot={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",l="[object Boolean]",a="[object Date]",c="[object Error]",h="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",p="[object Promise]",g="[object RegExp]",m="[object Set]",b="[object String]",v="[object Symbol]",y="[object WeakMap]",x="[object ArrayBuffer]",N="[object DataView]",E=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,w={};w["[object Float32Array]"]=w["[object Float64Array]"]=w["[object Int8Array]"]=w["[object Int16Array]"]=w["[object Int32Array]"]=w["[object Uint8Array]"]=w["[object Uint8ClampedArray]"]=w["[object Uint16Array]"]=w["[object Uint32Array]"]=!0,w[r]=w[o]=w[x]=w[l]=w[N]=w[a]=w[c]=w[h]=w[u]=w[d]=w[f]=w[g]=w[m]=w[b]=w[y]=!1;var q="object"==typeof i&&i&&i.Object===Object&&i,k="object"==typeof self&&self&&self.Object===Object&&self,L=q||k||Function("return this")(),T=e&&!e.nodeType&&e,S=T&&t&&!t.nodeType&&t,O=S&&S.exports===T,_=O&&q.process,C=function(){try{return _&&_.binding&&_.binding("util")}catch(t){}}(),R=C&&C.isTypedArray;function I(t,e){for(var n=-1,s=null==t?0:t.length;++n<s;)if(e(t[n],n,t))return!0;return!1}function j(t){var e=-1,n=Array(t.size);return t.forEach(function(t,s){n[++e]=[s,t]}),n}function M(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}var B,D,U,P=Array.prototype,H=Function.prototype,z=Object.prototype,F=L["__core-js_shared__"],V=H.toString,K=z.hasOwnProperty,Z=(B=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"",W=z.toString,G=RegExp("^"+V.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=O?L.Buffer:void 0,X=L.Symbol,Y=L.Uint8Array,Q=z.propertyIsEnumerable,J=P.splice,tt=X?X.toStringTag:void 0,et=Object.getOwnPropertySymbols,nt=$?$.isBuffer:void 0,st=(D=Object.keys,U=Object,function(t){return D(U(t))}),it=Ct(L,"DataView"),rt=Ct(L,"Map"),ot=Ct(L,"Promise"),lt=Ct(L,"Set"),at=Ct(L,"WeakMap"),ct=Ct(Object,"create"),ht=Mt(it),ut=Mt(rt),dt=Mt(ot),ft=Mt(lt),pt=Mt(at),gt=X?X.prototype:void 0,mt=gt?gt.valueOf:void 0;function bt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function vt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function yt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function xt(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new yt;++e<n;)this.add(t[e])}function Nt(t){var e=this.__data__=new vt(t);this.size=e.size}function Et(t,e){var n=Ut(t),s=!n&&Dt(t),i=!n&&!s&&Pt(t),r=!n&&!s&&!i&&Kt(t),o=n||s||i||r,l=o?function(t,e){for(var n=-1,s=Array(t);++n<t;)s[n]=e(n);return s}(t.length,String):[],a=l.length;for(var c in t)!K.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||jt(c,a))||l.push(c);return l}function At(t,e){for(var n=t.length;n--;)if(Bt(t[n][0],e))return n;return-1}function wt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":tt&&tt in Object(t)?function(t){var e=K.call(t,tt),n=t[tt];try{t[tt]=void 0;var s=!0}catch(t){}var i=W.call(t);s&&(e?t[tt]=n:delete t[tt]);return i}(t):function(t){return W.call(t)}(t)}function qt(t){return Vt(t)&&wt(t)==r}function kt(t,e,n,s,i){return t===e||(null==t||null==e||!Vt(t)&&!Vt(e)?t!=t&&e!=e:function(t,e,n,s,i,h){var p=Ut(t),y=Ut(e),E=p?o:It(t),A=y?o:It(e),w=(E=E==r?f:E)==f,q=(A=A==r?f:A)==f,k=E==A;if(k&&Pt(t)){if(!Pt(e))return!1;p=!0,w=!1}if(k&&!w)return h||(h=new Nt),p||Kt(t)?St(t,e,n,s,i,h):function(t,e,n,s,i,r,o){switch(n){case N:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case x:return!(t.byteLength!=e.byteLength||!r(new Y(t),new Y(e)));case l:case a:case d:return Bt(+t,+e);case c:return t.name==e.name&&t.message==e.message;case g:case b:return t==e+"";case u:var h=j;case m:var f=1&s;if(h||(h=M),t.size!=e.size&&!f)return!1;var p=o.get(t);if(p)return p==e;s|=2,o.set(t,e);var y=St(h(t),h(e),s,i,r,o);return o.delete(t),y;case v:if(mt)return mt.call(t)==mt.call(e)}return!1}(t,e,E,n,s,i,h);if(!(1&n)){var L=w&&K.call(t,"__wrapped__"),T=q&&K.call(e,"__wrapped__");if(L||T){var S=L?t.value():t,O=T?e.value():e;return h||(h=new Nt),i(S,O,n,s,h)}}if(!k)return!1;return h||(h=new Nt),function(t,e,n,s,i,r){var o=1&n,l=Ot(t),a=l.length,c=Ot(e),h=c.length;if(a!=h&&!o)return!1;var u=a;for(;u--;){var d=l[u];if(!(o?d in e:K.call(e,d)))return!1}var f=r.get(t);if(f&&r.get(e))return f==e;var p=!0;r.set(t,e),r.set(e,t);var g=o;for(;++u<a;){var m=t[d=l[u]],b=e[d];if(s)var v=o?s(b,m,d,e,t,r):s(m,b,d,t,e,r);if(!(void 0===v?m===b||i(m,b,n,s,r):v)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var y=t.constructor,x=e.constructor;y==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof x&&x instanceof x||(p=!1)}return r.delete(t),r.delete(e),p}(t,e,n,s,i,h)}(t,e,n,s,kt,i))}function Lt(t){return!(!Ft(t)||function(t){return!!Z&&Z in t}(t))&&(Ht(t)?G:E).test(Mt(t))}function Tt(t){if(n=(e=t)&&e.constructor,s="function"==typeof n&&n.prototype||z,e!==s)return st(t);var e,n,s,i=[];for(var r in Object(t))K.call(t,r)&&"constructor"!=r&&i.push(r);return i}function St(t,e,n,s,i,r){var o=1&n,l=t.length,a=e.length;if(l!=a&&!(o&&a>l))return!1;var c=r.get(t);if(c&&r.get(e))return c==e;var h=-1,u=!0,d=2&n?new xt:void 0;for(r.set(t,e),r.set(e,t);++h<l;){var f=t[h],p=e[h];if(s)var g=o?s(p,f,h,e,t,r):s(f,p,h,t,e,r);if(void 0!==g){if(g)continue;u=!1;break}if(d){if(!I(e,function(t,e){if(o=e,!d.has(o)&&(f===t||i(f,t,n,s,r)))return d.push(e);var o})){u=!1;break}}else if(f!==p&&!i(f,p,n,s,r)){u=!1;break}}return r.delete(t),r.delete(e),u}function Ot(t){return function(t,e,n){var s=e(t);return Ut(t)?s:function(t,e){for(var n=-1,s=e.length,i=t.length;++n<s;)t[i+n]=e[n];return t}(s,n(t))}(t,Zt,Rt)}function _t(t,e){var n,s,i=t.__data__;return("string"==(s=typeof(n=e))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Ct(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Lt(n)?n:void 0}bt.prototype.clear=function(){this.__data__=ct?ct(null):{},this.size=0},bt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},bt.prototype.get=function(t){var e=this.__data__;if(ct){var s=e[t];return s===n?void 0:s}return K.call(e,t)?e[t]:void 0},bt.prototype.has=function(t){var e=this.__data__;return ct?void 0!==e[t]:K.call(e,t)},bt.prototype.set=function(t,e){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=ct&&void 0===e?n:e,this},vt.prototype.clear=function(){this.__data__=[],this.size=0},vt.prototype.delete=function(t){var e=this.__data__,n=At(e,t);return!(n<0)&&(n==e.length-1?e.pop():J.call(e,n,1),--this.size,!0)},vt.prototype.get=function(t){var e=this.__data__,n=At(e,t);return n<0?void 0:e[n][1]},vt.prototype.has=function(t){return At(this.__data__,t)>-1},vt.prototype.set=function(t,e){var n=this.__data__,s=At(n,t);return s<0?(++this.size,n.push([t,e])):n[s][1]=e,this},yt.prototype.clear=function(){this.size=0,this.__data__={hash:new bt,map:new(rt||vt),string:new bt}},yt.prototype.delete=function(t){var e=_t(this,t).delete(t);return this.size-=e?1:0,e},yt.prototype.get=function(t){return _t(this,t).get(t)},yt.prototype.has=function(t){return _t(this,t).has(t)},yt.prototype.set=function(t,e){var n=_t(this,t),s=n.size;return n.set(t,e),this.size+=n.size==s?0:1,this},xt.prototype.add=xt.prototype.push=function(t){return this.__data__.set(t,n),this},xt.prototype.has=function(t){return this.__data__.has(t)},Nt.prototype.clear=function(){this.__data__=new vt,this.size=0},Nt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Nt.prototype.get=function(t){return this.__data__.get(t)},Nt.prototype.has=function(t){return this.__data__.has(t)},Nt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof vt){var s=n.__data__;if(!rt||s.length<199)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new yt(s)}return n.set(t,e),this.size=n.size,this};var Rt=et?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,s=null==t?0:t.length,i=0,r=[];++n<s;){var o=t[n];e(o,n,t)&&(r[i++]=o)}return r}(et(t),function(e){return Q.call(t,e)}))}:function(){return[]},It=wt;function jt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||A.test(t))&&t>-1&&t%1==0&&t<e}function Mt(t){if(null!=t){try{return V.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Bt(t,e){return t===e||t!=t&&e!=e}(it&&It(new it(new ArrayBuffer(1)))!=N||rt&&It(new rt)!=u||ot&&It(ot.resolve())!=p||lt&&It(new lt)!=m||at&&It(new at)!=y)&&(It=function(t){var e=wt(t),n=e==f?t.constructor:void 0,s=n?Mt(n):"";if(s)switch(s){case ht:return N;case ut:return u;case dt:return p;case ft:return m;case pt:return y}return e});var Dt=qt(function(){return arguments}())?qt:function(t){return Vt(t)&&K.call(t,"callee")&&!Q.call(t,"callee")},Ut=Array.isArray;var Pt=nt||function(){return!1};function Ht(t){if(!Ft(t))return!1;var e=wt(t);return e==h||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function Ft(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Vt(t){return null!=t&&"object"==typeof t}var Kt=R?function(t){return function(e){return t(e)}}(R):function(t){return Vt(t)&&zt(t.length)&&!!w[wt(t)]};function Zt(t){return null!=(e=t)&&zt(e.length)&&!Ht(e)?Et(t):Tt(t);var e}t.exports=function(t,e){return kt(t,e)}}(ot,ot.exports);var lt=ot.exports,at={};Object.defineProperty(at,"__esModule",{value:!0});const ct=rt,ht=lt;var ut;!function(t){t.compose=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});let s=ct(e);n||(s=Object.keys(s).reduce((t,e)=>(null!=s[e]&&(t[e]=s[e]),t),{}));for(const n in t)void 0!==t[n]&&void 0===e[n]&&(s[n]=t[n]);return Object.keys(s).length>0?s:void 0},t.diff=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});const n=Object.keys(t).concat(Object.keys(e)).reduce((n,s)=>(ht(t[s],e[s])||(n[s]=void 0===e[s]?null:e[s]),n),{});return Object.keys(n).length>0?n:void 0},t.invert=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=t||{};const n=Object.keys(e).reduce((n,s)=>(e[s]!==t[s]&&void 0!==t[s]&&(n[s]=e[s]),n),{});return Object.keys(t).reduce((n,s)=>(t[s]!==e[s]&&void 0===e[s]&&(n[s]=null),n),n)},t.transform=function(t,e){if("object"!=typeof t)return e;if("object"!=typeof e)return;if(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2]))return e;const n=Object.keys(e).reduce((n,s)=>(void 0===t[s]&&(n[s]=e[s]),n),{});return Object.keys(n).length>0?n:void 0}}(ut||(ut={})),at.default=ut;var dt,ft={};Object.defineProperty(ft,"__esModule",{value:!0}),function(t){t.length=function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"object"==typeof t.retain&&null!==t.retain?1:"string"==typeof t.insert?t.insert.length:1}}(dt||(dt={})),ft.default=dt;var pt={};Object.defineProperty(pt,"__esModule",{value:!0});const gt=ft;pt.default=class{constructor(t){this.ops=t,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(t){t||(t=1/0);const e=this.ops[this.index];if(e){const n=this.offset,s=gt.default.length(e);if(t>=s-n?(t=s-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};{const s={};return e.attributes&&(s.attributes=e.attributes),"number"==typeof e.retain?s.retain=t:"object"==typeof e.retain&&null!==e.retain?s.retain=e.retain:"string"==typeof e.insert?s.insert=e.insert.substr(n,t):s.insert=e.insert,s}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?gt.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const t=this.ops[this.index];return t?"number"==typeof t.delete?"delete":"number"==typeof t.retain||"object"==typeof t.retain&&null!==t.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const t=this.offset,e=this.index,n=this.next(),s=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(s)}}return[]}},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=st,s=rt,i=lt,r=at;e.AttributeMap=r.default;const o=ft;e.Op=o.default;const l=pt;e.OpIterator=l.default;const a=String.fromCharCode(0),c=(t,e)=>{if("object"!=typeof t||null===t)throw new Error("cannot retain a ".concat(typeof t));if("object"!=typeof e||null===e)throw new Error("cannot retain a ".concat(typeof e));const n=Object.keys(t)[0];if(!n||n!==Object.keys(e)[0])throw new Error("embed types not matched: ".concat(n," != ").concat(Object.keys(e)[0]));return[n,t[n],e[n]]};class h{constructor(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}static registerEmbed(t,e){this.handlers[t]=e}static unregisterEmbed(t){delete this.handlers[t]}static getHandler(t){const e=this.handlers[t];if(!e)throw new Error('no handlers for embed type "'.concat(t,'"'));return e}insert(t,e){const n={};return"string"==typeof t&&0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))}delete(t){return t<=0?this:this.push({delete:t})}retain(t,e){if("number"==typeof t&&t<=0)return this;const n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)}push(t){let e=this.ops.length,n=this.ops[e-1];if(t=s(t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,n=this.ops[e-1],"object"!=typeof n))return this.ops.unshift(t),this;if(i(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this}chop(){const t=this.ops[this.ops.length-1];return t&&"number"==typeof t.retain&&!t.attributes&&this.ops.pop(),this}filter(t){return this.ops.filter(t)}forEach(t){this.ops.forEach(t)}map(t){return this.ops.map(t)}partition(t){const e=[],n=[];return this.forEach(s=>{(t(s)?e:n).push(s)}),[e,n]}reduce(t,e){return this.ops.reduce(t,e)}changeLength(){return this.reduce((t,e)=>e.insert?t+o.default.length(e):e.delete?t-e.delete:t,0)}length(){return this.reduce((t,e)=>t+o.default.length(e),0)}slice(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;const n=[],s=new l.default(this.ops);let i=0;for(;i<e&&s.hasNext();){let r;i<t?r=s.next(t-i):(r=s.next(e-i),n.push(r)),i+=o.default.length(r)}return new h(n)}compose(t){const e=new l.default(this.ops),n=new l.default(t.ops),s=[],o=n.peek();if(null!=o&&"number"==typeof o.retain&&null==o.attributes){let t=o.retain;for(;"insert"===e.peekType()&&e.peekLength()<=t;)t-=e.peekLength(),s.push(e.next());o.retain-t>0&&n.next(o.retain-t)}const a=new h(s);for(;e.hasNext()||n.hasNext();)if("insert"===n.peekType())a.push(n.next());else if("delete"===e.peekType())a.push(e.next());else{const t=Math.min(e.peekLength(),n.peekLength()),s=e.next(t),o=n.next(t);if(o.retain){const l={};if("number"==typeof s.retain)l.retain="number"==typeof o.retain?t:o.retain;else if("number"==typeof o.retain)null==s.retain?l.insert=s.insert:l.retain=s.retain;else{const t=null==s.retain?"insert":"retain",[e,n,i]=c(s[t],o.retain),r=h.getHandler(e);l[t]={[e]:r.compose(n,i,"retain"===t)}}const u=r.default.compose(s.attributes,o.attributes,"number"==typeof s.retain);if(u&&(l.attributes=u),a.push(l),!n.hasNext()&&i(a.ops[a.ops.length-1],l)){const t=new h(e.rest());return a.concat(t).chop()}}else"number"==typeof o.delete&&("number"==typeof s.retain||"object"==typeof s.retain&&null!==s.retain)&&a.push(o)}return a.chop()}concat(t){const e=new h(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e}diff(t,e){if(this.ops===t.ops)return new h;const s=[this,t].map(e=>e.map(n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:a;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")}).join("")),o=new h,c=n(s[0],s[1],e,!0),u=new l.default(this.ops),d=new l.default(t.ops);return c.forEach(t=>{let e=t[1].length;for(;e>0;){let s=0;switch(t[0]){case n.INSERT:s=Math.min(d.peekLength(),e),o.push(d.next(s));break;case n.DELETE:s=Math.min(e,u.peekLength()),u.next(s),o.delete(s);break;case n.EQUAL:s=Math.min(u.peekLength(),d.peekLength(),e);const t=u.next(s),l=d.next(s);i(t.insert,l.insert)?o.retain(s,r.default.diff(t.attributes,l.attributes)):o.push(l).delete(s)}e-=s}}),o.chop()}eachLine(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"\n";const n=new l.default(this.ops);let s=new h,i=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const r=n.peek(),l=o.default.length(r)-n.peekLength(),a="string"==typeof r.insert?r.insert.indexOf(e,l)-l:-1;if(a<0)s.push(n.next());else if(a>0)s.push(n.next(a));else{if(!1===t(s,n.next(1).attributes||{},i))return;i+=1,s=new h}}s.length()>0&&t(s,{},i)}invert(t){const e=new h;return this.reduce((n,s)=>{if(s.insert)e.delete(o.default.length(s));else{if("number"==typeof s.retain&&null==s.attributes)return e.retain(s.retain),n+s.retain;if(s.delete||"number"==typeof s.retain){const i=s.delete||s.retain;return t.slice(n,n+i).forEach(t=>{s.delete?e.push(t):s.retain&&s.attributes&&e.retain(o.default.length(t),r.default.invert(s.attributes,t.attributes))}),n+i}if("object"==typeof s.retain&&null!==s.retain){const i=t.slice(n,n+1),o=new l.default(i.ops).next(),[a,u,d]=c(s.retain,o.insert),f=h.getHandler(a);return e.retain({[a]:f.invert(u,d)},r.default.invert(s.attributes,o.attributes)),n+1}}return n},0),e.chop()}transform(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);const n=t,s=new l.default(this.ops),i=new l.default(n.ops),a=new h;for(;s.hasNext()||i.hasNext();)if("insert"!==s.peekType()||!e&&"insert"===i.peekType())if("insert"===i.peekType())a.push(i.next());else{const t=Math.min(s.peekLength(),i.peekLength()),n=s.next(t),o=i.next(t);if(n.delete)continue;if(o.delete)a.push(o);else{const s=n.retain,i=o.retain;let l="object"==typeof i&&null!==i?i:t;if("object"==typeof s&&null!==s&&"object"==typeof i&&null!==i){const t=Object.keys(s)[0];if(t===Object.keys(i)[0]){const n=h.getHandler(t);n&&(l={[t]:n.transform(s[t],i[t],e)})}}a.retain(l,r.default.transform(n.attributes,o.attributes,e))}}else a.retain(o.default.length(s.next()));return a.chop()}transformPosition(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=!!e;const n=new l.default(this.ops);let s=0;for(;n.hasNext()&&s<=t;){const i=n.peekLength(),r=n.peekType();n.next(),"delete"!==r?("insert"===r&&(s<t||!e)&&(t+=i),s+=i):t-=Math.min(i,t-s)}return t}}h.Op=o.default,h.OpIterator=l.default,h.AttributeMap=r.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h}(D,D.exports);var mt=D.exports,bt=r(mt);class vt extends _{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}vt.blotName="break",vt.tagName="BR";let yt=class extends M{};const xt={"&":"&","<":"<",">":">",'"':""","'":"'"};function Nt(t){return t.replace(/[&<>"']/g,t=>xt[t])}class Et extends k{static compare(t,e){const n=Et.order.indexOf(t),s=Et.order.indexOf(e);return n>=0||s>=0?n-s:t===e?0:t<e?-1:1}formatAt(t,e,n,s){if(Et.compare(this.statics.blotName,n)<0&&this.scroll.query(n,l.BLOT)){const i=this.isolate(t,e);s&&i.wrap(n,s)}else super.formatAt(t,e,n,s)}optimize(t){if(super.optimize(t),this.parent instanceof Et&&Et.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}o(Et,"allowedChildren",[Et,vt,_,yt]),o(Et,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);class At extends T{constructor(){super(...arguments),o(this,"cache",{})}delta(){return null==this.cache.delta&&(this.cache.delta=qt(this)),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,e,n,s){e<=0||(this.scroll.query(n,l.BLOCK)?t+e===this.length()&&this.format(n,s):super.formatAt(t,Math.min(e,this.length()-t-1),n,s),this.cache={})}insertAt(t,e,n){if(null!=n)return super.insertAt(t,e,n),void(this.cache={});if(0===e.length)return;const s=e.split("\n"),i=s.shift();i.length>0&&(t<this.length()-1||null==this.children.tail?super.insertAt(Math.min(t,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let r=this;s.reduce((t,e)=>(r=r.split(t,!0),r.insertAt(0,e),e.length),t+i.length)}insertBefore(t,e){const{head:n}=this.children;super.insertBefore(t,e),n instanceof vt&&n.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),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&&void 0!==arguments[1]&&arguments[1];if(e&&(0===t||t>=this.length()-1)){const e=this.clone();return 0===t?(this.parent.insertBefore(e,this),this):(this.parent.insertBefore(e,this.next),e)}const n=super.split(t,e);return this.cache={},n}}At.blotName="block",At.tagName="P",At.defaultChild=vt,At.allowedChildren=[vt,Et,_,yt];class wt extends _{attach(){super.attach(),this.attributes=new m(this.domNode)}delta(){return(new bt).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const n=this.scroll.query(t,l.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,e)}formatAt(t,e,n,s){this.format(n,s)}insertAt(t,e,n){if(null!=n)return void super.insertAt(t,e,n);const s=e.split("\n"),i=s.pop(),r=s.map(t=>{const e=this.scroll.create(At.blotName);return e.insertAt(0,t),e}),o=this.split(t);r.forEach(t=>{this.parent.insertBefore(t,o)}),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}}function qt(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.descendants(x).reduce((t,n)=>0===n.length()?t:t.insert(n.value(),kt(n,{},e)),new bt).insert("\n",kt(t))}function kt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==t?e:("formats"in t&&"function"==typeof t.formats&&(e={...e,...t.formats()},n&&delete e["code-token"]),null==t.parent||"scroll"===t.parent.statics.blotName||t.parent.statics.scope!==t.statics.scope?e:kt(t.parent,e,n))}wt.scope=l.BLOCK_BLOT;class Lt extends _{static value(){}constructor(t,e,n){super(t,e),this.selection=n,this.textNode=document.createTextNode(Lt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(t,e){if(0!==this.savedLength)return void super.format(t,e);let n=this,s=0;for(;null!=n&&n.statics.scope!==l.BLOCK_BLOT;)s+=n.offset(n.parent),n=n.parent;null!=n&&(this.savedLength=Lt.CONTENTS.length,n.optimize(),n.formatAt(s,Lt.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||null==this.parent)return null;const t=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof yt?this.prev:null,n=e?e.length():0,s=this.next instanceof yt?this.next:null,i=s?s.text:"",{textNode:r}=this,o=r.data.split(Lt.CONTENTS).join("");let l;if(r.data=Lt.CONTENTS,e)l=e,(o||s)&&(e.insertAt(e.length(),o+i),s&&s.remove());else if(s)l=s,s.insertAt(0,o);else{const t=document.createTextNode(o);l=this.scroll.create(t),this.parent.insertBefore(l,this)}if(this.remove(),t){const i=(t,i)=>e&&t===e.domNode?i:t===r?n+i-1:s&&t===s.domNode?n+o.length+i:null,a=i(t.start.node,t.start.offset),c=i(t.end.node,t.end.offset);if(null!==a&&null!==c)return{startNode:l.domNode,startOffset:a,endNode:l.domNode,endOffset:c}}return null}update(t,e){if(t.some(t=>"characterData"===t.type&&t.target===this.textNode)){const t=this.restore();t&&(e.range=t)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if("A"===e.domNode.tagName){this.savedLength=Lt.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}}o(Lt,"blotName","cursor"),o(Lt,"className","ql-cursor"),o(Lt,"tagName","span"),o(Lt,"CONTENTS","\ufeff");var Tt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function s(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function r(t,e,s,r,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var l=new i(s,r||t,o),a=n?n+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],l]:t._events[a].push(l):(t._events[a]=l,t._eventsCount++),t}function o(t,e){0===--t._eventsCount?t._events=new s:delete t._events[e]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(n=!1)),l.prototype.eventNames=function(){var t,s,i=[];if(0===this._eventsCount)return i;for(s in t=this._events)e.call(t,s)&&i.push(n?s.slice(1):s);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=n?n+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var i=0,r=s.length,o=new Array(r);i<r;i++)o[i]=s[i].fn;return o},l.prototype.listenerCount=function(t){var e=n?n+t:t,s=this._events[e];return s?s.fn?1:s.length:0},l.prototype.emit=function(t,e,s,i,r,o){var l=n?n+t:t;if(!this._events[l])return!1;var a,c,h=this._events[l],u=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),u){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,s),!0;case 4:return h.fn.call(h.context,e,s,i),!0;case 5:return h.fn.call(h.context,e,s,i,r),!0;case 6:return h.fn.call(h.context,e,s,i,r,o),!0}for(c=1,a=new Array(u-1);c<u;c++)a[c-1]=arguments[c];h.fn.apply(h.context,a)}else{var d,f=h.length;for(c=0;c<f;c++)switch(h[c].once&&this.removeListener(t,h[c].fn,void 0,!0),u){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,e);break;case 3:h[c].fn.call(h[c].context,e,s);break;case 4:h[c].fn.call(h[c].context,e,s,i);break;default:if(!a)for(d=1,a=new Array(u-1);d<u;d++)a[d-1]=arguments[d];h[c].fn.apply(h[c].context,a)}}return!0},l.prototype.on=function(t,e,n){return r(this,t,e,n,!1)},l.prototype.once=function(t,e,n){return r(this,t,e,n,!0)},l.prototype.removeListener=function(t,e,s,i){var r=n?n+t:t;if(!this._events[r])return this;if(!e)return o(this,r),this;var l=this._events[r];if(l.fn)l.fn!==e||i&&!l.once||s&&l.context!==s||o(this,r);else{for(var a=0,c=[],h=l.length;a<h;a++)(l[a].fn!==e||i&&!l[a].once||s&&l[a].context!==s)&&c.push(l[a]);c.length?this._events[r]=1===c.length?c[0]:c:o(this,r)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,t.exports=l}(Tt);var St=r(Tt.exports),Ot=new WeakMap;const _t=["error","warn","log","info"];let Ct="warn";function Rt(t){if(Ct&&_t.indexOf(t)<=_t.indexOf(Ct)){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];console[t](...n)}}function It(t){return _t.reduce((e,n)=>(e[n]=Rt.bind(console,n,t),e),{})}It.level=t=>{Ct=t},Rt.level=It.level;const jt=It("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(t=>{document.addEventListener(t,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Array.from(document.querySelectorAll(".ql-container")).forEach(t=>{const n=Ot.get(t);n&&n.emitter&&n.emitter.handleDOM(...e)})})});class Mt extends St{constructor(){super(),this.domListeners={},this.on("error",jt.error)}emit(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return jt.log.call(jt,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];(this.domListeners[t.type]||[]).forEach(e=>{let{node:s,handler:i}=e;(t.target===s||s.contains(t.target))&&i(t,...n)})}listenDOM(t,e,n){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:n})}}o(Mt,"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"}),o(Mt,"sources",{API:"api",SILENT:"silent",USER:"user"});const Bt=It("quill:selection");class Dt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=t,this.length=e}}class Ut{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 Dt(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,Mt.sources.USER),1)}),this.emitter.on(Mt.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const t=this.getNativeRange();null!=t&&t.start.node!==this.cursor.textNode&&this.emitter.once(Mt.events.SCROLL_UPDATE,(e,n)=>{try{this.root.contains(t.start.node)&&this.root.contains(t.end.node)&&this.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset);const s=n.some(t=>"characterData"===t.type||"childList"===t.type||"attributes"===t.type&&t.target===this.root);this.update(s?Mt.sources.SILENT:e)}catch(t){}})}),this.emitter.on(Mt.events.SCROLL_OPTIMIZE,(t,e)=>{if(e.range){const{startNode:t,startOffset:n,endNode:s,endOffset:i}=e.range;this.setNativeRange(t,n,s,i),this.update(Mt.sources.SILENT)}}),this.update(Mt.sources.SILENT)}handleComposition(){this.emitter.on(Mt.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Mt.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(Mt.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!this.scroll.query(t,l.BLOCK)){if(n.start.node!==this.cursor.textNode){const t=this.scroll.find(n.start.node,!1);if(null==t)return;if(t instanceof x){const e=t.split(n.start.offset);t.parent.insertBefore(this.cursor,e)}else t.insertBefore(this.cursor,n.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&&void 0!==arguments[1]?arguments[1]:0;const n=this.scroll.length();let s;t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;let[i,r]=this.scroll.leaf(t);if(null==i)return null;if(e>0&&r===i.length()){const[e]=this.scroll.leaf(t+1);if(e){const[n]=this.scroll.line(t),[s]=this.scroll.line(t+1);n===s&&(i=e,r=0)}}[s,r]=i.position(r,!0);const o=document.createRange();if(e>0)return o.setStart(s,r),[i,r]=this.scroll.leaf(t+e),null==i?null:([s,r]=i.position(r,!0),o.setEnd(s,r),o.getBoundingClientRect());let l,a="left";if(s instanceof Text){if(!s.data.length)return null;r<s.data.length?(o.setStart(s,r),o.setEnd(s,r+1)):(o.setStart(s,r-1),o.setEnd(s,r),a="right"),l=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;l=i.domNode.getBoundingClientRect(),r>0&&(a="right")}return{bottom:l.top+l.height,height:l.height,left:l[a],right:l[a],top:l.top,width:0}}getNativeRange(){const t=document.getSelection();if(null==t||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(null==e)return null;const n=this.normalizeNative(e);return Bt.info("getNativeRange",n),n}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();if(null==e)return[null,null];return[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&Pt(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 n=e.map(t=>{const[e,n]=t,s=this.scroll.find(e,!0),i=s.offset(this.scroll);return 0===n?i:s instanceof x?i+s.index(e,n):i+s.length()}),s=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(s,...n);return new Dt(i,s-i)}normalizeNative(t){if(!Pt(this.root,t.startContainer)||!t.collapsed&&!Pt(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(t=>{let{node:e,offset:n}=t;for(;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length>0?e.childNodes.length:e.childNodes.length+1}t.node=e,t.offset=n}),e}rangeToNative(t){const e=this.scroll.length(),n=(t,n)=>{t=Math.min(e-1,t);const[s,i]=this.scroll.leaf(t);return s?s.position(i,n):[null,-1]};return[...n(t.index,!1),...n(t.index+t.length,!0)]}setNativeRange(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Bt.info("setNativeRange",t,e,n,s),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==n.parentNode))return;const r=document.getSelection();if(null!=r)if(null!=t){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(null==o||i||t!==o.startContainer||e!==o.startOffset||n!==o.endContainer||s!==o.endOffset){t instanceof Element&&"BR"===t.tagName&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),n instanceof Element&&"BR"===n.tagName&&(s=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const i=document.createRange();i.setStart(t,e),i.setEnd(n,s),r.removeAllRanges(),r.addRange(i)}}else r.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mt.sources.API;if("string"==typeof e&&(n=e,e=!1),Bt.info("setRange",t),null!=t){const n=this.rangeToNative(t);this.setNativeRange(...n,e)}else this.setNativeRange(null);this.update(n)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt.sources.USER;const s=this.lastRange,[i,r]=this.getRange();if(this.lastRange=i,this.lastNative=r,null!=this.lastRange&&(this.savedRange=this.lastRange),!e(s,this.lastRange)){if(!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const t=this.cursor.restore();t&&this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}const e=[Mt.events.SELECTION_CHANGE,n(this.lastRange),n(s),t];this.emitter.emit(Mt.events.EDITOR_CHANGE,...e),t!==Mt.sources.SILENT&&this.emitter.emit(...e)}}}function Pt(t,e){try{e.parentNode}catch(t){return!1}return t.contains(e)}const Ht=/^[ -~]*$/;class zt{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const n=Wt(t),i=new bt;return function(t){const e=[];return t.forEach(t=>{if("string"==typeof t.insert){t.insert.split("\n").forEach((n,s)=>{s&&e.push({insert:"\n",attributes:t.attributes}),n&&e.push({insert:n,attributes:t.attributes})})}else e.push(t)}),e}(n.ops.slice()).reduce((t,n)=>{const r=mt.Op.length(n);let o=n.attributes||{},a=!1,c=!1;if(null!=n.insert){if(i.retain(r),"string"==typeof n.insert){const i=n.insert;c=!i.endsWith("\n")&&(e<=t||!!this.scroll.descendant(wt,t)[0]),this.scroll.insertAt(t,i);const[r,l]=this.scroll.line(t);let a=s({},kt(r));if(r instanceof At){const[t]=r.descendant(x,l);t&&(a=s(a,kt(t)))}o=mt.AttributeMap.diff(a,o)||{}}else if("object"==typeof n.insert){const i=Object.keys(n.insert)[0];if(null==i)return t;const r=null!=this.scroll.query(i,l.INLINE);if(r)(e<=t||this.scroll.descendant(wt,t)[0])&&(c=!0);else if(t>0){const[e,n]=this.scroll.descendant(x,t-1);if(e instanceof yt){"\n"!==e.value()[n]&&(a=!0)}else e instanceof _&&e.statics.scope===l.INLINE_BLOT&&(a=!0)}if(this.scroll.insertAt(t,i,n.insert[i]),r){const[e]=this.scroll.descendant(x,t);if(e){const t=s({},kt(e));o=mt.AttributeMap.diff(t,o)||{}}}}e+=r}else if(i.push(n),null!==n.retain&&"object"==typeof n.retain){const e=Object.keys(n.retain)[0];if(null==e)return t;this.scroll.updateEmbedAt(t,e,n.retain[e])}Object.keys(o).forEach(e=>{this.scroll.formatAt(t,r,e,o[e])});const h=a?1:0,u=c?1:0;return e+=h+u,i.retain(h),i.delete(u),t+r+h+u},0),i.reduce((t,e)=>"number"==typeof e.delete?(this.scroll.deleteAt(t,e.delete),t):t+mt.Op.length(e),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update((new bt).retain(t).delete(e))}formatLine(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(s).forEach(n=>{this.scroll.lines(t,Math.max(e,1)).forEach(t=>{t.format(n,s[n])})}),this.scroll.optimize();const i=(new bt).retain(t).retain(e,n(s));return this.update(i)}formatText(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(s).forEach(n=>{this.scroll.formatAt(t,e,n,s[n])});const i=(new bt).retain(t).retain(e,n(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 bt)}getFormat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],s=[];0===e?this.scroll.path(t).forEach(t=>{const[e]=t;e instanceof At?n.push(e):e instanceof x&&s.push(e)}):(n=this.scroll.lines(t,e),s=this.scroll.descendants(x,t,e));const[i,r]=[n,s].map(t=>{const e=t.shift();if(null==e)return{};let n=kt(e);for(;Object.keys(n).length>0;){const e=t.shift();if(null==e)return n;n=Kt(kt(e),n)}return n});return{...i,...r}}getHTML(t,e){const[n,s]=this.scroll.line(t);if(n){const i=n.length();return!(n.length()>=s+e)||0===s&&e===i?Vt(this.scroll,t,e,!0):Vt(n,s,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(t=>"string"==typeof t.insert).map(t=>t.insert).join("")}insertContents(t,e){const n=Wt(e),s=(new bt).retain(t).concat(n);return this.scroll.insertContents(t,n),this.update(s)}insertEmbed(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new bt).retain(t).insert({[e]:n}))}insertText(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(s).forEach(n=>{this.scroll.formatAt(t,e.length,n,s[n])}),this.update((new bt).retain(t).insert(e,n(s)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if((null==t?void 0:t.statics.blotName)!==At.blotName)return!1;const e=t;return!(e.children.length>1)&&e.children.head instanceof vt}removeFormat(t,e){const n=this.getText(t,e),[s,i]=this.scroll.line(t+e);let r=0,o=new bt;null!=s&&(r=s.length()-i,o=s.delta().slice(i,i+r-1).insert("\n"));const l=this.getContents(t,e+r).diff((new bt).insert(n).concat(o)),a=(new bt).retain(t).concat(l);return this.applyDelta(a)}update(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=this.delta;if(1===n.length&&"characterData"===n[0].type&&n[0].target.data.match(Ht)&&this.scroll.find(n[0].target)){const e=this.scroll.find(n[0].target),r=kt(e),o=e.offset(this.scroll),l=n[0].oldValue.replace(Lt.CONTENTS,""),a=(new bt).insert(l),c=(new bt).insert(e.value()),h=s&&{oldRange:Gt(s.oldRange,-o),newRange:Gt(s.newRange,-o)};t=(new bt).retain(o).concat(a.diff(c,h)).reduce((t,e)=>e.insert?t.insert(e.insert,r):t.push(e),new bt),this.delta=i.compose(t)}else this.delta=this.getDelta(),t&&e(i.compose(t),this.delta)||(t=i.diff(this.delta,s));return t}}function Ft(t,e,n){if(0===t.length){const[t]=Zt(n.pop());return e<=0?"</li></".concat(t,">"):"</li></".concat(t,">").concat(Ft([],e-1,n))}const[{child:s,offset:i,length:r,indent:o,type:l},...a]=t,[c,h]=Zt(l);if(o>e)return n.push(l),o===e+1?"<".concat(c,"><li").concat(h,">").concat(Vt(s,i,r)).concat(Ft(a,o,n)):"<".concat(c,"><li>").concat(Ft(t,e+1,n));const u=n[n.length-1];if(o===e&&l===u)return"</li><li".concat(h,">").concat(Vt(s,i,r)).concat(Ft(a,o,n));const[d]=Zt(n.pop());return"</li></".concat(d,">").concat(Ft(t,e-1,n))}function Vt(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in t&&"function"==typeof t.html)return t.html(e,n);if(t instanceof yt){return Nt(t.value().slice(e,e+n)).replaceAll(" "," ")}if(t instanceof w){if("list-container"===t.statics.blotName){const s=[];return t.children.forEachAt(e,n,(t,e,n)=>{const i="formats"in t&&"function"==typeof t.formats?t.formats():{};s.push({child:t,offset:e,length:n,indent:i.indent||0,type:i.list})}),Ft(s,-1,[])}const i=[];if(t.children.forEachAt(e,n,(t,e,n)=>{i.push(Vt(t,e,n))}),s||"list"===t.statics.blotName)return i.join("");const{outerHTML:r,innerHTML:o}=t.domNode,[l,a]=r.split(">".concat(o,"<"));return"<table"===l?'<table style="border: 1px solid #000;">'.concat(i.join(""),"<").concat(a):"".concat(l,">").concat(i.join(""),"<").concat(a)}return t.domNode instanceof Element?t.domNode.outerHTML:""}function Kt(t,e){return Object.keys(e).reduce((n,s)=>{if(null==t[s])return n;const i=e[s];return i===t[s]?n[s]=i:Array.isArray(i)?i.indexOf(t[s])<0?n[s]=i.concat([t[s]]):n[s]=i:n[s]=[i,t[s]],n},{})}function Zt(t){const e="ordered"===t?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Wt(t){return t.reduce((t,e)=>{if("string"==typeof e.insert){const n=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(n,e.attributes)}return t.push(e)},new bt)}function Gt(t,e){let{index:n,length:s}=t;return new Dt(n+e,s)}class $t{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=t,this.options=e}}o($t,"DEFAULTS",{});const Xt="\ufeff";class Yt extends _{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(t=>{this.contentNode.appendChild(t)}),this.leftGuard=document.createTextNode(Xt),this.rightGuard=document.createTextNode(Xt),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,n=null;const s=t.data.split(Xt).join("");if(t===this.leftGuard)if(this.prev instanceof yt){const t=this.prev.length();this.prev.insertAt(t,s),n={startNode:this.prev.domNode,startOffset:t+s.length}}else e=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(e),this),n={startNode:e,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof yt?(this.next.insertAt(0,s),n={startNode:this.next.domNode,startOffset:s.length}):(e=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(e),this.next),n={startNode:e,startOffset:s.length}));return t.data=Xt,n}update(t,e){t.forEach(t=>{if("characterData"===t.type&&(t.target===this.leftGuard||t.target===this.rightGuard)){const n=this.restore(t.target);n&&(e.range=n)}})}}class Qt{constructor(t,e){o(this,"isComposing",!1),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 Yt||(this.emitter.emit(Mt.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(Mt.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(Mt.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(Mt.events.COMPOSITION_END,t),this.isComposing=!1}}var Jt;class te{constructor(t,e){o(this,"modules",{}),this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach(t=>{null==this.modules[t]&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import("modules/".concat(t));return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}Jt=te,o(te,"DEFAULTS",{modules:{}}),o(te,"themes",{default:Jt});const ee=t=>t.parentElement||t.getRootNode().host||null,ne=t=>{const e=t.getBoundingClientRect(),n="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1,s="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*n,bottom:e.top+t.clientHeight*s,left:e.left}},se=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},ie=(t,e,n,s,i,r)=>t<n&&e>s?0:t<n?-(n-t+i):e>s?e-t>s-n?t+i-n:e-s+r:0,re=["block","break","cursor","inline","scroll","text"],oe=It("quill"),le=new u;w.uiClass="ql-ui";class ae{static debug(t){!0===t&&(t="log"),It.level(t)}static find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ot.get(t)||le.find(t,e)}static import(t){return null==this.imports[t]&&oe.error("Cannot import ".concat(t,". Are you sure it was registered?")),this.imports[t]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const t=arguments.length<=0?void 0:arguments[0],e=!!(arguments.length<=1?void 0:arguments[1]),n="attrName"in t?t.attrName:t.blotName;"string"==typeof n?this.register("formats/".concat(n),t,e):Object.keys(t).forEach(n=>{this.register(n,t[n],e)})}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],n=!!(arguments.length<=2?void 0:arguments[2]);null==this.imports[t]||n||oe.warn("Overwriting ".concat(t," with"),e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&"boolean"!=typeof e&&"abstract"!==e.blotName&&le.register(e),"function"==typeof e.register&&e.register(le)}}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(t,e){const n=ce(t);if(!n)throw new Error("Invalid Quill container");const i=!e.theme||e.theme===ae.DEFAULTS.theme,r=i?te:ae.import("themes/".concat(e.theme));if(!r)throw new Error("Invalid theme ".concat(e.theme,". Did you register it?"));const{modules:o,...l}=ae.DEFAULTS,{modules:a,...c}=r.DEFAULTS;let h=he(e.modules);null!=h&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const d=s({},he(o),he(a),h),f={...l,...ue(c),...ue(e)};let p=e.registry;p?e.formats&&oe.warn('Ignoring "formats" option because "registry" is specified'):p=e.formats?((t,e,n)=>{const s=new u;return re.forEach(t=>{const n=e.query(t);n&&s.register(n)}),t.forEach(t=>{let i=e.query(t);i||n.error('Cannot register "'.concat(t,'" specified in "formats" config. Are you sure it was registered?'));let r=0;for(;i;){var o;if(s.register(i),i="blotName"in i&&null!==(o=i.requiredContainer)&&void 0!==o?o:null,r+=1,r>100){n.error('Cycle detected in registering blot requiredContainer: "'.concat(t,'"'));break}}}),s})(e.formats,f.registry,oe):f.registry;return{...f,registry:p,container:n,theme:r,modules:Object.entries(d).reduce((t,e)=>{let[n,i]=e;if(!i)return t;const r=ae.import("modules/".concat(n));return null==r?(oe.error("Cannot load ".concat(n," module. Are you sure you registered it?")),t):{...t,[n]:s({},r.DEFAULTS||{},i)}},{}),bounds:ce(f.bounds)}}(t,e),this.container=this.options.container,null==this.container)return void oe.error("Invalid Quill container",t);this.options.debug&&ae.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Ot.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Mt;const i=I.blotName,r=this.options.registry.query(i);if(!r||!("blotName"in r))throw new Error('Cannot initialize Quill without "'.concat(i,'" blot'));if(this.scroll=new r(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new zt(this.scroll),this.selection=new Ut(this.scroll,this.emitter),this.composition=new Qt(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(Mt.events.EDITOR_CHANGE,t=>{t===Mt.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Mt.events.SCROLL_UPDATE,(t,e)=>{const n=this.selection.lastRange,[s]=this.selection.getRange(),i=n&&s?{oldRange:n,newRange:s}:void 0;de.call(this,()=>this.editor.update(null,e,i),t)}),this.emitter.on(Mt.events.SCROLL_EMBED_UPDATE,(t,e)=>{const n=this.selection.lastRange,[s]=this.selection.getRange(),i=n&&s?{oldRange:n,newRange:s}:void 0;de.call(this,()=>{const n=(new bt).retain(t.offset(this)).retain({[t.statics.blotName]:e});return this.editor.update(n,[],i)},ae.sources.USER)}),n){const t=this.clipboard.convert({html:"".concat(n,"<p><br></p>"),text:"\n"});this.setContents(t)}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&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){const e=t;(t=document.createElement("div")).classList.add(e)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,n){return[t,e,,n]=fe(t,e,n),de.call(this,()=>this.editor.deleteText(t,e),n,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&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mt.sources.API;return de.call(this,()=>{const n=this.getSelection(!0);let s=new bt;if(null==n)return s;if(this.scroll.query(t,l.BLOCK))s=this.editor.formatLine(n.index,n.length,{[t]:e});else{if(0===n.length)return this.selection.format(t,e),s;s=this.editor.formatText(n.index,n.length,{[t]:e})}return this.setSelection(n,Mt.sources.SILENT),s},n)}formatLine(t,e,n,s,i){let r;return[t,e,r,i]=fe(t,e,n,s,i),de.call(this,()=>this.editor.formatLine(t,e,r),i,t,0)}formatText(t,e,n,s,i){let r;return[t,e,r,i]=fe(t,e,n,s,i),de.call(this,()=>this.editor.formatText(t,e,r),i,t,0)}getBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length),!n)return null;const s=this.container.getBoundingClientRect();return{bottom:n.bottom-s.top,height:n.height,left:n.left-s.left,right:n.right-s.left,top:n.top-s.top,width:n.width}}getContents(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;return[t,e]=fe(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?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&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return"number"==typeof t&&(e=null!=e?e:this.getLength()-t),[t,e]=fe(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return"number"==typeof t&&(e=null!=e?e:this.getLength()-t),[t,e]=fe(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ae.sources.API;return de.call(this,()=>this.editor.insertEmbed(t,e,n),s,t)}insertText(t,e,n,s,i){let r;return[t,,r,i]=fe(t,0,n,s,i),de.call(this,()=>this.editor.insertText(t,e,r),i,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,n){return[t,e,,n]=fe(t,e,n),de.call(this,()=>this.editor.removeFormat(t,e),n,t)}scrollRectIntoView(t){((t,e)=>{const n=t.ownerDocument;let s=e,i=t;for(;i;){var r,o,l,a;const t=i===n.body,e=t?{top:0,right:null!==(r=null===(o=window.visualViewport)||void 0===o?void 0:o.width)&&void 0!==r?r:n.documentElement.clientWidth,bottom:null!==(l=null===(a=window.visualViewport)||void 0===a?void 0:a.height)&&void 0!==l?l:n.documentElement.clientHeight,left:0}:ne(i),h=getComputedStyle(i),u=ie(s.left,s.right,e.left,e.right,se(h.scrollPaddingLeft),se(h.scrollPaddingRight)),d=ie(s.top,s.bottom,e.top,e.bottom,se(h.scrollPaddingTop),se(h.scrollPaddingBottom));if(u||d)if(t){var c;null===(c=n.defaultView)||void 0===c||c.scrollBy(u,d)}else{const{scrollLeft:t,scrollTop:e}=i;d&&(i.scrollTop+=d),u&&(i.scrollLeft+=u);const n=i.scrollLeft-t,r=i.scrollTop-e;s={left:s.left-n,top:s.top-r,right:s.right-n,bottom:s.bottom-r}}i=t||"fixed"===h.position?null:ee(i)}})(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&&void 0!==arguments[1]?arguments[1]:Mt.sources.API;return de.call(this,()=>{t=new bt(t);const e=this.getLength(),n=this.editor.deleteText(0,e),s=this.editor.insertContents(0,t),i=this.editor.deleteText(this.getLength()-1,1);return n.compose(s).compose(i)},e)}setSelection(t,e,n){null==t?this.selection.setRange(null,e||ae.sources.API):([t,e,,n]=fe(t,e,n),this.selection.setRange(new Dt(Math.max(0,t),e),n),n!==Mt.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mt.sources.API;const n=(new bt).insert(t);return this.setContents(n,e)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mt.sources.API;return de.call(this,()=>(t=new bt(t),this.editor.applyDelta(t)),e,!0)}}function ce(t){return"string"==typeof t?document.querySelector(t):t}function he(t){return Object.entries(null!=t?t:{}).reduce((t,e)=>{let[n,s]=e;return{...t,[n]:!0===s?{}:s}},{})}function ue(t){return Object.fromEntries(Object.entries(t).filter(t=>void 0!==t[1]))}function de(t,e,n,s){if(!this.isEnabled()&&e===Mt.sources.USER&&!this.allowReadOnlyEdits)return new bt;let i=null==n?null:this.getSelection();const r=this.editor.delta,o=t();if(null!=i&&(!0===n&&(n=i.index),null==s?i=pe(i,o,e):0!==s&&(i=pe(i,n,s,e)),this.setSelection(i,Mt.sources.SILENT)),o.length()>0){const t=[Mt.events.TEXT_CHANGE,o,r,e];this.emitter.emit(Mt.events.EDITOR_CHANGE,...t),e!==Mt.sources.SILENT&&this.emitter.emit(...t)}return o}function fe(t,e,n,s,i){let r={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(i=s,s=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(i=s,s=n,n=e,e=0),"object"==typeof n?(r=n,i=s):"string"==typeof n&&(null!=s?r[n]=s:i=n),[t,e,r,i=i||Mt.sources.API]}function pe(t,e,n,s){const i="number"==typeof n?n:0;if(null==t)return null;let r,o;return e&&"function"==typeof e.transformPosition?[r,o]=[t.index,t.index+t.length].map(t=>e.transformPosition(t,s!==Mt.sources.USER)):[r,o]=[t.index,t.index+t.length].map(t=>t<e||t===e&&s===Mt.sources.USER?t:i>=0?t+i:Math.max(e,t+i)),new Dt(r,o-r)}t("Q",ae),o(ae,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:le,theme:"default"}),o(ae,"events",Mt.events),o(ae,"sources",Mt.sources),o(ae,"version","2.0.3"),o(ae,"imports",{delta:bt,parchment:B,"core/module":$t,"core/theme":te});class ge extends O{}function me(t){return t instanceof At||t instanceof wt}function be(t){return"function"==typeof t.updateContent}class ve extends I{constructor(t,e,n){let{emitter:s}=n;super(t,e),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",t=>this.handleDragStart(t))}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(Mt.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(Mt.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(Mt.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[n,s]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),null!=i&&n!==i&&s>0){if(n instanceof wt||i instanceof wt)return void this.optimize();const t=i.children.head instanceof vt?null:i.children.head;n.moveChildren(i,t),n.remove()}this.optimize()}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,n,s){super.formatAt(t,e,n,s),this.optimize()}insertAt(t,e,n){if(t>=this.length())if(null==n||null==this.scroll.query(e,l.BLOCK)){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t),null==n&&e.endsWith("\n")?t.insertAt(0,e.slice(0,-1),n):t.insertAt(0,e,n)}else{const t=this.scroll.create(e,n);this.appendChild(t)}else super.insertAt(t,e,n);this.optimize()}insertBefore(t,e){if(t.statics.scope===l.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(t),super.insertBefore(n,e)}else super.insertBefore(t,e)}insertContents(t,e){const n=this.deltaToRenderBlocks(e.concat((new bt).insert("\n"))),s=n.pop();if(null==s)return;this.batchStart();const i=n.shift();if(i){const e="block"===i.type&&(0===i.delta.length()||!this.descendant(wt,t)[0]&&t<this.length()),n="block"===i.type?i.delta:(new bt).insert({[i.key]:i.value});ye(this,t,n);const s="block"===i.type?1:0,r=t+n.length()+s;e&&this.insertAt(r-1,"\n");const o=kt(this.line(t)[0]),l=mt.AttributeMap.diff(o,i.attributes)||{};Object.keys(l).forEach(t=>{this.formatAt(r-1,1,t,l[t])}),t=r}let[r,o]=this.children.find(t);if(n.length&&(r&&(r=r.split(o),o=0),n.forEach(t=>{if("block"===t.type){ye(this.createBlock(t.attributes,r||void 0),0,t.delta)}else{const e=this.create(t.key,t.value);this.insertBefore(e,r||void 0),Object.keys(t.attributes).forEach(n=>{e.format(n,t.attributes[n])})}})),"block"===s.type&&s.delta.length()){ye(this,r?r.offset(r.scroll)+o:this.length(),s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[n,s]=e;return n instanceof x?[n,s]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(me,t)}lines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const n=(t,e,s)=>{let i=[],r=s;return t.children.forEachAt(e,s,(t,e,s)=>{me(t)?i.push(t):t instanceof O&&(i=i.concat(n(t,e,r))),r-=s}),i};return n(this,t,e)}optimize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(Mt.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch)return void(Array.isArray(t)&&(this.batch=this.batch.concat(t)));let e=Mt.sources.USER;"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),(t=t.filter(t=>{let{target:e}=t;const n=this.find(e,!0);return n&&!be(n)})).length>0&&this.emitter.emit(Mt.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(Mt.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,n){const[s]=this.descendant(t=>t instanceof wt,t);s&&s.statics.blotName===e&&be(s)&&s.updateContent(n)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let n=new bt;return t.forEach(t=>{const s=null==t?void 0:t.insert;if(s)if("string"==typeof s){const i=s.split("\n");i.slice(0,-1).forEach(s=>{var i;n.insert(s,t.attributes),e.push({type:"block",delta:n,attributes:null!==(i=t.attributes)&&void 0!==i?i:{}}),n=new bt});const r=i[i.length-1];r&&n.insert(r,t.attributes)}else{const r=Object.keys(s)[0];if(!r)return;var i;if(this.query(r,l.INLINE))n.push(t);else n.length()&&e.push({type:"block",delta:n,attributes:{}}),n=new bt,e.push({type:"blockEmbed",key:r,value:s[r],attributes:null!==(i=t.attributes)&&void 0!==i?i:{}})}}),n.length()&&e.push({type:"block",delta:n,attributes:{}}),e}createBlock(t,e){let n;const s={};Object.entries(t).forEach(t=>{let[e,i]=t;null!=this.query(e,l.BLOCK&l.BLOT)?n=e:s[e]=i});const i=this.create(n||this.statics.defaultChild.blotName,n?t[n]:void 0);this.insertBefore(i,e||void 0);const r=i.length();return Object.entries(s).forEach(t=>{let[e,n]=t;i.formatAt(0,r,e,n)}),i}}function ye(t,e,n){n.reduce((e,n)=>{const s=mt.Op.length(n);let i=n.attributes||{};if(null!=n.insert)if("string"==typeof n.insert){const s=n.insert;t.insertAt(e,s);const[r]=t.descendant(x,e),o=kt(r);i=mt.AttributeMap.diff(o,i)||{}}else if("object"==typeof n.insert){const s=Object.keys(n.insert)[0];if(null==s)return e;t.insertAt(e,s,n.insert[s]);if(null!=t.scroll.query(s,l.INLINE)){const[n]=t.descendant(x,e),s=kt(n);i=mt.AttributeMap.diff(s,i)||{}}}return Object.keys(i).forEach(n=>{t.formatAt(e,s,n,i[n])}),e+s},e)}o(ve,"blotName","scroll"),o(ve,"className","ql-editor"),o(ve,"tagName","DIV"),o(ve,"defaultChild",At),o(ve,"allowedChildren",[At,wt,ge]);const xe={scope:l.BLOCK,whitelist:["right","center","justify"]},Ne=new a("align","align",xe),Ee=new f("align","ql-align",xe),Ae=new g("align","text-align",xe);class we extends g{value(t){let e=super.value(t);if(!e.startsWith("rgb("))return e;e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");const n=e.split(",").map(t=>"00".concat(parseInt(t,10).toString(16)).slice(-2)).join("");return"#".concat(n)}}const qe=new f("color","ql-color",{scope:l.INLINE}),ke=new we("color","color",{scope:l.INLINE}),Le=new f("background","ql-bg",{scope:l.INLINE}),Te=new we("background","background-color",{scope:l.INLINE});class Se extends ge{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(t=>t.length()<=1?"":t.domNode.innerText).join("\n").slice(t,t+e)}html(t,e){return"<pre>\n".concat(Nt(this.code(t,e)),"\n</pre>")}}class Oe extends At{static register(){ae.register(Se)}}o(Oe,"TAB"," ");class _e extends Et{}_e.blotName="code",_e.tagName="CODE",Oe.blotName="code-block",Oe.className="ql-code-block",Oe.tagName="DIV",Se.blotName="code-block-container",Se.className="ql-code-block-container",Se.tagName="DIV",Se.allowedChildren=[Oe],Oe.allowedChildren=[yt,vt,Lt],Oe.requiredContainer=Se;const Ce={scope:l.BLOCK,whitelist:["rtl"]},Re=new a("direction","dir",Ce),Ie=new f("direction","ql-direction",Ce),je=new g("direction","direction",Ce),Me={scope:l.INLINE,whitelist:["serif","monospace"]},Be=new f("font","ql-font",Me);const De=new class extends g{value(t){return super.value(t).replace(/["']/g,"")}}("font","font-family",Me),Ue=new f("size","ql-size",{scope:l.INLINE,whitelist:["small","large","huge"]}),Pe=new g("size","font-size",{scope:l.INLINE,whitelist:["10px","18px","32px"]}),He=It("quill:keyboard"),ze=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Fe extends $t{static match(t,e){return!["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!e[n]!==t[n]&&null!==e[n])&&(e.key===t.key||e.key===t.which)}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(t=>{this.options.bindings[t]&&this.addBinding(this.options.bindings[t])}),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&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(t){if("string"==typeof t||"number"==typeof t)t={key:t};else{if("object"!=typeof t)return null;t=n(t)}t.shortKey&&(t[ze]=t.shortKey,delete t.shortKey);return t}(t);if(null==i)return void He.warn("Attempted to add invalid keyboard binding",i);"function"==typeof e&&(e={handler:e}),"function"==typeof s&&(s={handler:s});(Array.isArray(i.key)?i.key:[i.key]).forEach(t=>{const n={...i,key:t,...e,...s};this.bindings[n.key]=this.bindings[n.key]||[],this.bindings[n.key].push(n)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing)return;if(229===t.keyCode&&("Enter"===t.key||"Backspace"===t.key))return;const n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(e=>Fe.match(t,e));if(0===n.length)return;const s=ae.find(t.target,!0);if(s&&s.scroll!==this.quill.scroll)return;const i=this.quill.getSelection();if(null==i||!this.quill.hasFocus())return;const[r,o]=this.quill.getLine(i.index),[l,a]=this.quill.getLeaf(i.index),[c,h]=0===i.length?[l,a]:this.quill.getLeaf(i.index+i.length),u=l instanceof M?l.value().slice(0,a):"",d=c instanceof M?c.value().slice(h):"",f={collapsed:0===i.length,empty:0===i.length&&r.length()<=1,format:this.quill.getFormat(i),line:r,offset:o,prefix:u,suffix:d,event:t};n.some(t=>{if(null!=t.collapsed&&t.collapsed!==f.collapsed)return!1;if(null!=t.empty&&t.empty!==f.empty)return!1;if(null!=t.offset&&t.offset!==f.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(t=>null==f.format[t]))return!1}else if("object"==typeof t.format&&!Object.keys(t.format).every(n=>!0===t.format[n]?null!=f.format[n]:!1===t.format[n]?null==f.format[n]:e(t.format[n],f.format[n])))return!1;return!(null!=t.prefix&&!t.prefix.test(f.prefix))&&(!(null!=t.suffix&&!t.suffix.test(f.suffix))&&!0!==t.handler.call(this,i,f,t))})&&t.preventDefault()})}handleBackspace(t,e){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(0===t.index||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(t.index);let r=(new bt).retain(t.index-n).delete(n);if(0===e.offset){const[e]=this.quill.getLine(t.index-1);if(e){if(!("block"===e.statics.blotName&&e.length()<=1)){const e=i.formats(),n=this.quill.getFormat(t.index-1,1);if(s=mt.AttributeMap.diff(e,n)||{},Object.keys(s).length>0){const e=(new bt).retain(t.index+i.length()-2).retain(1,s);r=r.compose(e)}}}}this.quill.updateContents(r,ae.sources.USER),this.quill.focus()}handleDelete(t,e){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-n)return;let s={};const[i]=this.quill.getLine(t.index);let r=(new bt).retain(t.index).delete(n);if(e.offset>=i.length()-1){const[e]=this.quill.getLine(t.index+1);if(e){const n=i.formats(),o=this.quill.getFormat(t.index,1);s=mt.AttributeMap.diff(n,o)||{},Object.keys(s).length>0&&(r=r.retain(e.length()-1).retain(1,s))}}this.quill.updateContents(r,ae.sources.USER),this.quill.focus()}handleDeleteRange(t){$e({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const n=Object.keys(e.format).reduce((t,n)=>(this.quill.scroll.query(n,l.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t),{}),s=(new bt).retain(t.index).delete(t.length).insert("\n",n);this.quill.updateContents(s,ae.sources.USER),this.quill.setSelection(t.index+1,ae.sources.SILENT),this.quill.focus()}}const Ve={bindings:{bold:We("bold"),italic:We("italic"),underline:We("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","+1",ae.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","-1",ae.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){null!=e.format.indent?this.quill.format("indent","-1",ae.sources.USER):null!=e.format.list&&this.quill.format("list",!1,ae.sources.USER)}},"indent code-block":Ke(!0),"outdent code-block":Ke(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,ae.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const n=(new bt).retain(t.index).delete(t.length).insert("\t");return this.quill.updateContents(n,ae.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,ae.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,ae.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const n={list:!1};e.format.indent&&(n.indent=!1),this.quill.formatLine(t.index,t.length,n,ae.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){const[e,n]=this.quill.getLine(t.index),s={...e.formats(),list:"checked"},i=(new bt).retain(t.index).insert("\n",s).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,ae.sources.USER),this.quill.setSelection(t.index+1,ae.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){const[n,s]=this.quill.getLine(t.index),i=(new bt).retain(t.index).insert("\n",e.format).retain(n.length()-s-1).retain(1,{header:null});this.quill.updateContents(i,ae.sources.USER),this.quill.setSelection(t.index+1,ae.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(t){const e=this.quill.getModule("table");if(e){const[n,s,i,r]=e.getTable(t),o=function(t,e,n,s){if(null==e.prev&&null==e.next)return null==n.prev&&null==n.next?0===s?-1:1:null==n.prev?-1:1;if(null==e.prev)return-1;if(null==e.next)return 1;return null}(0,s,i,r);if(null==o)return;let l=n.offset();if(o<0){const e=(new bt).retain(l).insert("\n");this.quill.updateContents(e,ae.sources.USER),this.quill.setSelection(t.index+1,t.length,ae.sources.SILENT)}else if(o>0){l+=n.length();const t=(new bt).retain(l).insert("\n");this.quill.updateContents(t,ae.sources.USER),this.quill.setSelection(l,ae.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:n,line:s}=e,i=s.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(i-1,ae.sources.USER):this.quill.setSelection(i+s.length(),ae.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(null==this.quill.scroll.query("list"))return!0;const{length:n}=e.prefix,[s,i]=this.quill.getLine(t.index);if(i>n)return!0;let r;switch(e.prefix.trim()){case"[]":case"[ ]":r="unchecked";break;case"[x]":r="checked";break;case"-":case"*":r="bullet";break;default:r="ordered"}this.quill.insertText(t.index," ",ae.sources.USER),this.quill.history.cutoff();const o=(new bt).retain(t.index-i).delete(n+1).retain(s.length()-2-i).retain(1,{list:r});return this.quill.updateContents(o,ae.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,ae.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,n]=this.quill.getLine(t.index);let s=2,i=e;for(;null!=i&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,s-=1,s<=0){const s=(new bt).retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(s,ae.sources.USER),this.quill.setSelection(t.index-1,ae.sources.SILENT),!1}return!0}},"embed left":Ze("ArrowLeft",!1),"embed left shift":Ze("ArrowLeft",!0),"embed right":Ze("ArrowRight",!1),"embed right shift":Ze("ArrowRight",!0),"table down":Ge(!1),"table up":Ge(!0)}};function Ke(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e,n){let{event:s}=n;const i=this.quill.scroll.query("code-block"),{TAB:r}=i;if(0===e.length&&!s.shiftKey)return this.quill.insertText(e.index,r,ae.sources.USER),void this.quill.setSelection(e.index+r.length,ae.sources.SILENT);const o=0===e.length?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:l,length:a}=e;o.forEach((e,n)=>{t?(e.insertAt(0,r),0===n?l+=r.length:a+=r.length):e.domNode.textContent.startsWith(r)&&(e.deleteAt(0,r.length),0===n?l-=r.length:a-=r.length)}),this.quill.update(ae.sources.USER),this.quill.setSelection(l,a,ae.sources.SILENT)}}}function Ze(t,e){const n="ArrowLeft"===t?"prefix":"suffix";return{key:t,shiftKey:e,altKey:null,[n]:/^$/,handler(n){let{index:s}=n;"ArrowRight"===t&&(s+=n.length+1);const[i]=this.quill.getLeaf(s);return!(i instanceof _)||("ArrowLeft"===t?e?this.quill.setSelection(n.index-1,n.length+1,ae.sources.USER):this.quill.setSelection(n.index-1,ae.sources.USER):e?this.quill.setSelection(n.index,n.length+1,ae.sources.USER):this.quill.setSelection(n.index+n.length+1,ae.sources.USER),!1)}}}function We(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],ae.sources.USER)}}}function Ge(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,n){const s=t?"prev":"next",i=n.line,r=i.parent[s];if(null!=r){if("table-row"===r.statics.blotName){let t=r.children.head,e=i;for(;null!=e.prev;)e=e.prev,t=t.next;const s=t.offset(this.quill.scroll)+Math.min(n.offset,t.length()-1);this.quill.setSelection(s,0,ae.sources.USER)}}else{const e=i.table()[s];null!=e&&(t?this.quill.setSelection(e.offset(this.quill.scroll)+e.length()-1,0,ae.sources.USER):this.quill.setSelection(e.offset(this.quill.scroll),0,ae.sources.USER))}return!1}}}function $e(t){let{quill:e,range:n}=t;const s=e.getLines(n);let i={};if(s.length>1){const t=s[0].formats(),e=s[s.length-1].formats();i=mt.AttributeMap.diff(e,t)||{}}e.deleteText(n,ae.sources.USER),Object.keys(i).length>0&&e.formatLine(n.index,1,i,ae.sources.USER),e.setSelection(n.index,ae.sources.SILENT)}Fe.DEFAULTS=Ve;const Xe=/font-weight:\s*normal/,Ye=["P","OL","UL"],Qe=t=>t&&Ye.includes(t.tagName);const Je=/\bmso-list:[^;]*ignore/i,tn=/\bmso-list:[^;]*\bl(\d+)/i,en=/\bmso-list:[^;]*\blevel(\d+)/i,nn=t=>{const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],s=[];e.forEach(t=>{(t.getAttribute("style")||"").match(Je)?n.push(t):s.push(t)}),n.forEach(t=>{var e;return null===(e=t.parentNode)||void 0===e?void 0:e.removeChild(t)});const i=t.documentElement.innerHTML,r=s.map(t=>((t,e)=>{const n=t.getAttribute("style"),s=null==n?void 0:n.match(tn);if(!s)return null;const i=Number(s[1]),r=null==n?void 0:n.match(en),o=r?Number(r[1]):1,l=new RegExp("@list l".concat(i,":level").concat(o,"\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)"),"i"),a=e.match(l);return{id:i,indent:o,type:a&&"bullet"===a[1]?"bullet":"ordered",element:t}})(t,i)).filter(t=>t);for(;r.length;){var o;const t=[];let e=r.shift();for(;e;){var l;t.push(e),e=r.length&&(null===(l=r[0])||void 0===l?void 0:l.element)===e.element.nextElementSibling&&r[0].id===e.id?r.shift():null}const n=document.createElement("ul");t.forEach(t=>{const e=document.createElement("li");e.setAttribute("data-list",t.type),t.indent>1&&e.setAttribute("class","ql-indent-".concat(t.indent-1)),e.innerHTML=t.element.innerHTML,n.appendChild(e)});const s=null===(o=t[0])||void 0===o?void 0:o.element,{parentNode:i}=null!=s?s:{};s&&(null==i||i.replaceChild(n,s)),t.slice(1).forEach(t=>{let{element:e}=t;null==i||i.removeChild(e)})}};const sn=[function(t){"urn:schemas-microsoft-com:office:word"===t.documentElement.getAttribute("xmlns:w")&&nn(t)},function(t){t.querySelector('[id^="docs-internal-guid-"]')&&((t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(t=>{var e;return null===(e=t.getAttribute("style"))||void 0===e?void 0:e.match(Xe)}).forEach(e=>{var n;const s=t.createDocumentFragment();s.append(...e.childNodes),null===(n=e.parentNode)||void 0===n||n.replaceChild(s,e)})})(t),(t=>{Array.from(t.querySelectorAll("br")).filter(t=>Qe(t.previousElementSibling)&&Qe(t.nextElementSibling)).forEach(t=>{var e;null===(e=t.parentNode)||void 0===e||e.removeChild(t)})})(t))}],rn=It("quill:clipboard"),on=[[Node.TEXT_NODE,function(t,e,n){var s;let i=t.data;if("O:P"===(null===(s=t.parentElement)||void 0===s?void 0:s.tagName))return e.insert(i.trim());if(!pn(t)){if(0===i.trim().length&&i.includes("\n")&&!function(t,e){return t.previousElementSibling&&t.nextElementSibling&&!dn(t.previousElementSibling,e)&&!dn(t.nextElementSibling,e)}(t,n))return e;i=i.replace(/[^\S\u00a0]/g," "),i=i.replace(/ {2,}/g," "),(null==t.previousSibling&&null!=t.parentElement&&dn(t.parentElement,n)||t.previousSibling instanceof Element&&dn(t.previousSibling,n))&&(i=i.replace(/^ /,"")),(null==t.nextSibling&&null!=t.parentElement&&dn(t.parentElement,n)||t.nextSibling instanceof Element&&dn(t.nextSibling,n))&&(i=i.replace(/ $/,"")),i=i.replaceAll(" "," ")}return e.insert(i)}],[Node.TEXT_NODE,bn],["br",function(t,e){un(e,"\n")||e.insert("\n");return e}],[Node.ELEMENT_NODE,bn],[Node.ELEMENT_NODE,function(t,e,n){const s=n.query(t);if(null==s)return e;if(s.prototype instanceof _){const e={},i=s.value(t);if(null!=i)return e[s.blotName]=i,(new bt).insert(e,s.formats(t,n))}else if(s.prototype instanceof T&&!un(e,"\n")&&e.insert("\n"),"blotName"in s&&"formats"in s&&"function"==typeof s.formats)return hn(e,s.blotName,s.formats(t,n),n);return e}],[Node.ELEMENT_NODE,function(t,e,n){const s=a.keys(t),i=f.keys(t),r=g.keys(t),o={};return s.concat(i).concat(r).forEach(e=>{let s=n.query(e,l.ATTRIBUTE);null!=s&&(o[s.attrName]=s.value(t),o[s.attrName])||(s=ln[e],null==s||s.attrName!==e&&s.keyName!==e||(o[s.attrName]=s.value(t)||void 0),s=an[e],null==s||s.attrName!==e&&s.keyName!==e||(s=an[e],o[s.attrName]=s.value(t)||void 0))}),Object.entries(o).reduce((t,e)=>{let[s,i]=e;return hn(t,s,i,n)},e)}],[Node.ELEMENT_NODE,function(t,e,n){var s;const i={},r=t.style||{};"italic"===r.fontStyle&&(i.italic=!0);"underline"===r.textDecoration&&(i.underline=!0);"line-through"===r.textDecoration&&(i.strike=!0);(null!==(s=r.fontWeight)&&void 0!==s&&s.startsWith("bold")||parseInt(r.fontWeight,10)>=700)&&(i.bold=!0);if(e=Object.entries(i).reduce((t,e)=>{let[s,i]=e;return hn(t,s,i,n)},e),parseFloat(r.textIndent||0)>0)return(new bt).insert("\t").concat(e);return e}],["li",function(t,e,n){const s=n.query(t);if(null==s||"list"!==s.blotName||!un(e,"\n"))return e;let i=-1,r=t.parentNode;for(;null!=r;)["OL","UL"].includes(r.tagName)&&(i+=1),r=r.parentNode;return i<=0?e:e.reduce((t,e)=>e.insert?e.attributes&&"number"==typeof e.attributes.indent?t.push(e):t.insert(e.insert,{indent:i,...e.attributes||{}}):t,new bt)}],["ol, ul",function(t,e,n){const s=t;let i="OL"===s.tagName?"ordered":"bullet";const r=s.getAttribute("data-checked");r&&(i="true"===r?"checked":"unchecked");return hn(e,"list",i,n)}],["pre",function(t,e,n){const s=n.query("code-block"),i=!s||!("formats"in s)||"function"!=typeof s.formats||s.formats(t,n);return hn(e,"code-block",i,n)}],["tr",function(t,e,n){var s,i;const r="TABLE"===(null===(s=t.parentElement)||void 0===s?void 0:s.tagName)?t.parentElement:null===(i=t.parentElement)||void 0===i?void 0:i.parentElement;if(null!=r){return hn(e,"table",Array.from(r.querySelectorAll("tr")).indexOf(t)+1,n)}return e}],["b",mn("bold")],["i",mn("italic")],["strike",mn("strike")],["style",function(){return new bt}]],ln=[Ne,Re].reduce((t,e)=>(t[e.keyName]=e,t),{}),an=[Ae,Te,ke,je,De,Pe].reduce((t,e)=>(t[e.keyName]=e,t),{});class cn extends $t{constructor(t,e){var n;super(t,e),this.quill.root.addEventListener("copy",t=>this.onCaptureCopy(t,!1)),this.quill.root.addEventListener("cut",t=>this.onCaptureCopy(t,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],on.concat(null!==(n=this.options.matchers)&&void 0!==n?n:[]).forEach(t=>{let[e,n]=t;this.addMatcher(e,n)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:n}=t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s[Oe.blotName])return(new bt).insert(n||"",{[Oe.blotName]:s[Oe.blotName]});if(!e)return(new bt).insert(n||"",s);const i=this.convertHTML(e);return un(i,"\n")&&(null==i.ops[i.ops.length-1].attributes||s.table)?i.compose((new bt).retain(i.length()-1).delete(1)):i}normalizeHTML(t){(t=>{t.documentElement&&sn.forEach(e=>{e(t)})})(t)}convertHTML(t){const e=(new DOMParser).parseFromString(t,"text/html");this.normalizeHTML(e);const n=e.body,s=new WeakMap,[i,r]=this.prepareMatching(n,s);return gn(this.quill.scroll,n,i,r,s)}dangerouslyPasteHTML(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ae.sources.API;if("string"==typeof t){const n=this.convert({html:t,text:""});this.quill.setContents(n,e),this.quill.setSelection(0,ae.sources.SILENT)}else{const s=this.convert({html:e,text:""});this.quill.updateContents((new bt).retain(t).concat(s),n),this.quill.setSelection(t+s.length(),ae.sources.SILENT)}}onCaptureCopy(t){var e,n;let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.defaultPrevented)return;t.preventDefault();const[i]=this.quill.selection.getRange();if(null==i)return;const{html:r,text:o}=this.onCopy(i,s);null===(e=t.clipboardData)||void 0===e||e.setData("text/plain",o),null===(n=t.clipboardData)||void 0===n||n.setData("text/html",r),s&&$e({range:i,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(t=>"#"!==t[0]).join("\n")}onCapturePaste(t){var e,n,s;if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const i=this.quill.getSelection(!0);if(null==i)return;const r=null===(e=t.clipboardData)||void 0===e?void 0:e.getData("text/html");let o=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/plain");if(!r&&!o){var l;const e=null===(l=t.clipboardData)||void 0===l?void 0:l.getData("text/uri-list");e&&(o=this.normalizeURIList(e))}const a=Array.from((null===(s=t.clipboardData)||void 0===s?void 0:s.files)||[]);if(!r&&a.length>0)this.quill.uploader.upload(i,a);else{if(r&&a.length>0){var c;const t=(new DOMParser).parseFromString(r,"text/html");if(1===t.body.childElementCount&&"IMG"===(null===(c=t.body.firstElementChild)||void 0===c?void 0:c.tagName))return void this.quill.uploader.upload(i,a)}this.onPaste(i,{html:r,text:o})}}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:n,html:s}=e;const i=this.quill.getFormat(t.index),r=this.convert({text:n,html:s},i);rn.log("onPaste",r,{text:n,html:s});const o=(new bt).retain(t.index).delete(t.length).concat(r);this.quill.updateContents(o,ae.sources.USER),this.quill.setSelection(o.length()-t.length,ae.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const n=[],s=[];return this.matchers.forEach(i=>{const[r,o]=i;switch(r){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(t.querySelectorAll(r)).forEach(t=>{if(e.has(t)){const n=e.get(t);null==n||n.push(o)}else e.set(t,[o])})}}),[n,s]}}function hn(t,e,n,s){return s.query(e)?t.reduce((t,s)=>{if(!s.insert)return t;if(s.attributes&&s.attributes[e])return t.push(s);const i=n?{[e]:n}:{};return t.insert(s.insert,{...i,...s.attributes})},new bt):t}function un(t,e){let n="";for(let s=t.ops.length-1;s>=0&&n.length<e.length;--s){const e=t.ops[s];if("string"!=typeof e.insert)break;n=e.insert+n}return n.slice(-1*e.length)===e}function dn(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return!(n&&n.prototype instanceof _)&&["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(t.tagName.toLowerCase())}o(cn,"DEFAULTS",{matchers:[]});const fn=new WeakMap;function pn(t){return null!=t&&(fn.has(t)||("PRE"===t.tagName?fn.set(t,!0):fn.set(t,pn(t.parentNode))),fn.get(t))}function gn(t,e,n,s,i){return e.nodeType===e.TEXT_NODE?s.reduce((n,s)=>s(e,n,t),new bt):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((r,o)=>{let l=gn(t,o,n,s,i);return o.nodeType===e.ELEMENT_NODE&&(l=n.reduce((e,n)=>n(o,e,t),l),l=(i.get(o)||[]).reduce((e,n)=>n(o,e,t),l)),r.concat(l)},new bt):new bt}function mn(t){return(e,n,s)=>hn(n,t,!0,s)}function bn(t,e,n){if(!un(e,"\n")){if(dn(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert("\n");if(e.length()>0&&t.nextSibling){let s=t.nextSibling;for(;null!=s;){if(dn(s,n))return e.insert("\n");const t=n.query(s);if(t&&t.prototype instanceof wt)return e.insert("\n");s=s.firstChild}}}return e}class vn extends $t{constructor(t,e){super(t,e),o(this,"lastRecorded",0),o(this,"ignoreChange",!1),o(this,"stack",{undo:[],redo:[]}),o(this,"currentRange",null),this.quill.on(ae.events.EDITOR_CHANGE,(t,e,n,s)=>{t===ae.events.SELECTION_CHANGE?e&&s!==ae.sources.SILENT&&(this.currentRange=e):t===ae.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&s!==ae.sources.USER?this.transform(e):this.record(e,n)),this.currentRange=xn(this.currentRange,e))}),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",t=>{"historyUndo"===t.inputType?(this.undo(),t.preventDefault()):"historyRedo"===t.inputType&&(this.redo(),t.preventDefault())})}change(t,e){if(0===this.stack[t].length)return;const n=this.stack[t].pop();if(!n)return;const s=this.quill.getContents(),i=n.delta.invert(s);this.stack[e].push({delta:i,range:xn(n.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,ae.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(0===t.ops.length)return;this.stack.redo=[];let n=t.invert(e),s=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const t=this.stack.undo.pop();t&&(n=n.compose(t.delta),s=t.range)}else this.lastRecorded=i;0!==n.length()&&(this.stack.undo.push({delta:n,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){yn(this.stack.undo,t),yn(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,ae.sources.USER);else{const e=function(t,e){const n=e.reduce((t,e)=>t+(e.delete||0),0);let s=e.length()-n;(function(t,e){const n=e.ops[e.ops.length-1];if(null==n)return!1;if(null!=n.insert)return"string"==typeof n.insert&&n.insert.endsWith("\n");if(null!=n.attributes)return Object.keys(n.attributes).some(e=>null!=t.query(e,l.BLOCK));return!1})(t,e)&&(s-=1);return s}(this.quill.scroll,t.delta);this.quill.setSelection(e,ae.sources.USER)}}}function yn(t,e){let n=e;for(let e=t.length-1;e>=0;e-=1){const s=t[e];t[e]={delta:n.transform(s.delta,!0),range:s.range&&xn(s.range,n)},n=s.delta.transform(n),0===t[e].delta.length()&&t.splice(e,1)}}function xn(t,e){if(!t)return t;const n=e.transformPosition(t.index);return{index:n,length:e.transformPosition(t.index+t.length)-n}}o(vn,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});class Nn extends $t{constructor(t,e){super(t,e),t.root.addEventListener("drop",e=>{e.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(e.clientX,e.clientY);else if(document.caretPositionFromPoint){const t=document.caretPositionFromPoint(e.clientX,e.clientY);n=document.createRange(),n.setStart(t.offsetNode,t.offset),n.setEnd(t.offsetNode,t.offset)}const s=n&&t.selection.normalizeNative(n);if(s){var i;const n=t.selection.normalizedToRange(s);null!==(i=e.dataTransfer)&&void 0!==i&&i.files&&this.upload(n,e.dataTransfer.files)}})}upload(t,e){const n=[];Array.from(e).forEach(t=>{var e;t&&null!==(e=this.options.mimetypes)&&void 0!==e&&e.includes(t.type)&&n.push(t)}),n.length>0&&this.options.handler.call(this,t,n)}}Nn.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image"))return;const n=e.map(t=>new Promise(e=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.readAsDataURL(t)}));Promise.all(n).then(e=>{const n=e.reduce((t,e)=>t.insert({image:e}),(new bt).retain(t.index).delete(t.length));this.quill.updateContents(n,Mt.sources.USER),this.quill.setSelection(t.index+e.length,Mt.sources.SILENT)})}};const En=["insertText","insertReplacementText"];const An=/Mac/i.test(navigator.platform);ae.register({"blots/block":At,"blots/block/embed":wt,"blots/break":vt,"blots/container":ge,"blots/cursor":Lt,"blots/embed":Yt,"blots/inline":Et,"blots/scroll":ve,"blots/text":yt,"modules/clipboard":cn,"modules/history":vn,"modules/keyboard":Fe,"modules/uploader":Nn,"modules/input":class extends $t{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",t=>{this.handleBeforeInput(t)}),/Android/i.test(navigator.userAgent)||t.on(ae.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){$e({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===t.length)return!1;if(e){const n=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents((new bt).retain(t.index).insert(e,n),ae.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,ae.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!En.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||!0===e.collapsed)return;const n=function(t){var e;if("string"==typeof t.data)return t.data;if(null!==(e=t.dataTransfer)&&void 0!==e&&e.types.includes("text/plain"))return t.dataTransfer.getData("text/plain");return null}(t);if(null==n)return;const s=this.quill.selection.normalizeNative(e),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,n)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}},"modules/uiNode":class extends $t{constructor(t,e){super(t,e),o(this,"isListening",!1),o(this,"selectionChangeDeadline",0),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,e){let{line:n,event:s}=e;if(!(n instanceof w&&n.uiNode))return!0;const i="rtl"===getComputedStyle(n.domNode).direction;return!!(i&&"ArrowRight"!==s.key||!i&&"ArrowLeft"!==s.key)||(this.quill.setSelection(t.index-1,t.length+(s.shiftKey?1:0),ae.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&(t=>"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowUp"===t.key||"ArrowDown"===t.key||"Home"===t.key||!(!An||"a"!==t.key||!0!==t.ctrlKey))(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+100,this.isListening)return;this.isListening=!0;document.addEventListener("selectionchange",()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()},{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const e=t.getRangeAt(0);if(!0!==e.collapsed||0!==e.startOffset)return;const n=this.quill.scroll.find(e.startContainer);if(!(n instanceof w&&n.uiNode))return;const s=document.createRange();s.setStartAfter(n.uiNode),s.setEndAfter(n.uiNode),t.removeAllRanges(),t.addRange(s)}}});const wn=new class extends f{add(t,e){let n=0;if("+1"===e||"-1"===e){const s=this.value(t)||0;n="+1"===e?s+1:s-1}else"number"==typeof e&&(n=e);return 0===n?(this.remove(t),!0):super.add(t,n.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}}("indent","ql-indent",{scope:l.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class qn extends At{}o(qn,"blotName","blockquote"),o(qn,"tagName","blockquote");class kn extends At{static formats(t){return this.tagName.indexOf(t.tagName)+1}}o(kn,"blotName","header"),o(kn,"tagName",["H1","H2","H3","H4","H5","H6"]);class Ln extends ge{}Ln.blotName="list-container",Ln.tagName="OL";class Tn extends At{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(){ae.register(Ln)}constructor(t,e){super(t,e);const n=e.ownerDocument.createElement("span"),s=n=>{if(!t.isEnabled())return;const s=this.statics.formats(e,t);"checked"===s?(this.format("list","unchecked"),n.preventDefault()):"unchecked"===s&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s),this.attachUI(n)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}Tn.blotName="list",Tn.tagName="LI",Ln.allowedChildren=[Tn],Tn.requiredContainer=Ln;class Sn extends Et{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)}}o(Sn,"blotName","bold"),o(Sn,"tagName",["STRONG","B"]);class On extends Sn{}o(On,"blotName","italic"),o(On,"tagName",["EM","I"]);class _n extends Et{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 Cn(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("href",this.constructor.sanitize(e)):super.format(t,e)}}function Cn(t,e){const n=document.createElement("a");n.href=t;const s=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(s)>-1}o(_n,"blotName","link"),o(_n,"tagName","A"),o(_n,"SANITIZED_URL","about:blank"),o(_n,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);class Rn extends Et{static create(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):super.create(t)}static formats(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}}o(Rn,"blotName","script"),o(Rn,"tagName",["SUB","SUP"]);class In extends Sn{}o(In,"blotName","strike"),o(In,"tagName",["S","STRIKE"]);class jn extends Et{}o(jn,"blotName","underline"),o(jn,"tagName","U");class Mn extends Yt{static create(t){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return"string"==typeof t&&(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>".concat(t,"</span>")}}o(Mn,"blotName","formula"),o(Mn,"className","ql-formula"),o(Mn,"tagName","SPAN");const Bn=["alt","height","width"];class Dn extends _{static create(t){const e=super.create(t);return"string"==typeof t&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Bn.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return Cn(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){Bn.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}o(Dn,"blotName","image"),o(Dn,"tagName","IMG");const Un=["height","width"];class Pn extends wt{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 Un.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static sanitize(t){return _n.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){Un.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="'.concat(t,'">').concat(t,"</a>")}}o(Pn,"blotName","video"),o(Pn,"className","ql-video"),o(Pn,"tagName","IFRAME");const Hn=new f("code-token","hljs",{scope:l.INLINE});class zn extends Et{static formats(t,e){for(;null!=t&&t!==e.domNode;){if(t.classList&&t.classList.contains(Oe.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,n){super(t,e,n),Hn.add(this.domNode,n)}format(t,e){t!==zn.blotName?super.format(t,e):e?Hn.add(this.domNode,e):(Hn.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Hn.value(this.domNode)||this.unwrap()}}zn.blotName="code-token",zn.className="ql-token";class Fn extends Oe{static create(t){const e=super.create(t);return"string"==typeof t&&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(),zn.blotName,!1),super.replaceWith(t,e)}}class Vn extends Se{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===Fn.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(t,e)}))}formatAt(t,e,n,s){n===Fn.blotName&&(this.forceNext=!0),super.formatAt(t,e,n,s)}highlight(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const n=Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode),s="".concat(n.map(t=>t.textContent).join("\n"),"\n"),i=Fn.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||null==this.cachedText){const e=this.children.reduce((t,e)=>t.concat(qt(e,!1)),new bt),n=t(s,i);e.diff(n).reduce((t,e)=>{let{retain:n,attributes:s}=e;return n?(s&&Object.keys(s).forEach(e=>{[Fn.blotName,zn.blotName].includes(e)&&this.formatAt(t,n,e,s[e])}),t+n):t},0)}this.cachedText=s,this.forceNext=!1}}html(t,e){const[n]=this.children.find(t),s=n?Fn.formats(n.domNode):"plain";return'<pre data-language="'.concat(s,'">\n').concat(Nt(this.code(t,e)),"\n</pre>")}optimize(t){if(super.optimize(t),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const t=Fn.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Vn.allowedChildren=[Fn],Fn.requiredContainer=Vn,Fn.allowedChildren=[zn,Lt,yt,vt];class Kn extends $t{static register(){ae.register(zn,!0),ae.register(Fn,!0),ae.register(Vn,!0)}constructor(t,e){if(super(t,e),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((t,e)=>{let{key:n}=e;return t[n]=!0,t},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(ae.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof Vn))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(t=>{let{key:n,label:s}=t;const i=e.ownerDocument.createElement("option");i.textContent=s,i.setAttribute("value",n),e.appendChild(i)}),e.addEventListener("change",()=>{t.format(Fn.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),null==t.uiNode&&(t.attachUI(e),t.children.head&&(e.value=Fn.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(ae.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(ae.sources.USER);const n=this.quill.getSelection();(null==t?this.quill.scroll.descendants(Vn):[t]).forEach(t=>{t.highlight(this.highlightBlot,e)}),this.quill.update(ae.sources.SILENT),null!=n&&this.quill.setSelection(n,ae.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(e=this.languages[e]?e:"plain","plain"===e)return Nt(t).split("\n").reduce((t,n,s)=>(0!==s&&t.insert("\n",{[Oe.blotName]:e}),t.insert(n)),new bt);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Oe.className),n.innerHTML=((t,e,n)=>{if("string"==typeof t.versionString){const s=t.versionString.split(".")[0];if(parseInt(s,10)>=11)return t.highlight(n,{language:e}).value}return t.highlight(e,n).value})(this.options.hljs,e,t),gn(this.quill.scroll,n,[(t,e)=>{const n=Hn.value(t);return n?e.compose((new bt).retain(e.length(),{[zn.blotName]:n})):e}],[(t,n)=>t.data.split("\n").reduce((t,n,s)=>(0!==s&&t.insert("\n",{[Oe.blotName]:e}),t.insert(n)),n)],new WeakMap)}}Kn.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 Zn extends At{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Xn()),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===Zn.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()}}o(Zn,"blotName","table"),o(Zn,"tagName","TD");class Wn extends ge{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const t=this.children.head.formats(),e=this.children.tail.formats(),n=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===n.table&&t.table===s.table}return!1}optimize(t){super.optimize(t),this.children.forEach(t=>{if(null==t.next)return;const e=t.formats(),n=t.next.formats();if(e.table!==n.table){const e=this.splitAfter(t);e&&e.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}o(Wn,"blotName","table-row"),o(Wn,"tagName","TR");class Gn extends ge{}o(Gn,"blotName","table-body"),o(Gn,"tagName","TBODY");class $n extends ge{balanceCells(){const t=this.descendants(Wn),e=t.reduce((t,e)=>Math.max(e.children.length,t),0);t.forEach(t=>{new Array(e-t.children.length).fill(0).forEach(()=>{let e;null!=t.children.head&&(e=Zn.formats(t.children.head.domNode));const n=this.scroll.create(Zn.blotName,e);t.appendChild(n),n.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(Gn);null!=e&&null!=e.children.head&&e.children.forEach(e=>{const n=e.children.at(t);null!=n&&n.remove()})}insertColumn(t){const[e]=this.descendant(Gn);null!=e&&null!=e.children.head&&e.children.forEach(e=>{const n=e.children.at(t),s=Zn.formats(e.children.head.domNode),i=this.scroll.create(Zn.blotName,s);e.insertBefore(i,n)})}insertRow(t){const[e]=this.descendant(Gn);if(null==e||null==e.children.head)return;const n=Xn(),s=this.scroll.create(Wn.blotName);e.children.head.children.forEach(()=>{const t=this.scroll.create(Zn.blotName,n);s.appendChild(t)});const i=e.children.at(t);e.insertBefore(s,i)}rows(){const t=this.children.head;return null==t?[]:t.children.map(t=>t)}}function Xn(){const t=Math.random().toString(36).slice(2,6);return"row-".concat(t)}o($n,"blotName","table-container"),o($n,"tagName","TABLE"),$n.allowedChildren=[Gn],Gn.requiredContainer=$n,Gn.allowedChildren=[Wn],Wn.requiredContainer=Gn,Wn.allowedChildren=[Zn],Zn.requiredContainer=Wn;const Yn=It("quill:toolbar");class Qn extends $t{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){var n;const e=document.createElement("div");e.setAttribute("role","toolbar"),function(t,e){Array.isArray(e[0])||(e=[e]);e.forEach(e=>{const n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(t=>{if("string"==typeof t)Jn(n,t);else{const e=Object.keys(t)[0],s=t[e];Array.isArray(s)?function(t,e,n){const s=document.createElement("select");s.classList.add("ql-".concat(e)),n.forEach(t=>{const e=document.createElement("option");!1!==t?e.setAttribute("value",String(t)):e.setAttribute("selected","selected"),s.appendChild(e)}),t.appendChild(s)}(n,e,s):Jn(n,e,s)}}),t.appendChild(n)})}(e,this.options.container),null===(n=t.container)||void 0===n||null===(n=n.parentNode)||void 0===n||n.insertBefore(e,t.container),this.container=e}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(t=>{var e;const n=null===(e=this.options.handlers)||void 0===e?void 0:e[t];n&&this.addHandler(t,n)}),Array.from(this.container.querySelectorAll("button, select")).forEach(t=>{this.attach(t)}),this.quill.on(ae.events.EDITOR_CHANGE,()=>{const[t]=this.quill.selection.getRange();this.update(t)})):Yn.error("Container required for toolbar",this.options)}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(t=>0===t.indexOf("ql-"));if(!e)return;if(e=e.slice(3),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null==this.handlers[e]&&null==this.quill.scroll.query(e))return void Yn.warn("ignoring attaching to nonexistent format",e,t);const n="SELECT"===t.tagName?"change":"click";t.addEventListener(n,n=>{let s;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;const e=t.options[t.selectedIndex];s=!e.hasAttribute("selected")&&(e.value||!1)}else s=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),n.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(null!=this.handlers[e])this.handlers[e].call(this,s);else if(this.quill.scroll.query(e).prototype instanceof _){if(s=prompt("Enter ".concat(e)),!s)return;this.quill.updateContents((new bt).retain(i.index).delete(i.length).insert({[e]:s}),ae.sources.USER)}else this.quill.format(e,s,ae.sources.USER);this.update(i)}),this.controls.push([e,t])}update(t){const e=null==t?{}:this.quill.getFormat(t);this.controls.forEach(n=>{const[s,i]=n;if("SELECT"===i.tagName){let n=null;if(null==t)n=null;else if(null==e[s])n=i.querySelector("option[selected]");else if(!Array.isArray(e[s])){let t=e[s];"string"==typeof t&&(t=t.replace(/"/g,'\\"')),n=i.querySelector('option[value="'.concat(t,'"]'))}null==n?(i.value="",i.selectedIndex=-1):n.selected=!0}else if(null==t)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const t=e[s],n=t===i.getAttribute("value")||null!=t&&t.toString()===i.getAttribute("value")||null==t&&!i.getAttribute("value");i.classList.toggle("ql-active",n),i.setAttribute("aria-pressed",n.toString())}else{const t=null!=e[s];i.classList.toggle("ql-active",t),i.setAttribute("aria-pressed",t.toString())}})}}function Jn(t,e,n){const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add("ql-".concat(e)),s.setAttribute("aria-pressed","false"),null!=n?(s.value=n,s.setAttribute("aria-label","".concat(e,": ").concat(n))):s.setAttribute("aria-label",e),t.appendChild(s)}Qn.DEFAULTS={},Qn.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(null!=t)if(0===t.length){const t=this.quill.getFormat();Object.keys(t).forEach(t=>{null!=this.quill.scroll.query(t,l.INLINE)&&this.quill.format(t,!1,ae.sources.USER)})}else this.quill.removeFormat(t.index,t.length,ae.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();"rtl"===t&&null==e?this.quill.format("align","right",ae.sources.USER):t||"right"!==e||this.quill.format("align",!1,ae.sources.USER),this.quill.format("direction",t,ae.sources.USER)},indent(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e),s=parseInt(n.indent||0,10);if("+1"===t||"-1"===t){let e="+1"===t?1:-1;"rtl"===n.direction&&(e*=-1),this.quill.format("indent",s+e,ae.sources.USER)}},link(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,ae.sources.USER)},list(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e);"check"===t?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,ae.sources.USER):this.quill.format("list","unchecked",ae.sources.USER):this.quill.format("list",t,ae.sources.USER)}}};const ts='<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>';var es={align:{"":'<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>',center:'<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>',right:'<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>',justify:'<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>'},background:'<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>',blockquote:'<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>',bold:'<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>',clean:'<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>',code:ts,"code-block":ts,color:'<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>',direction:{"":'<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>',rtl:'<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>'},formula:'<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>',header:{1:'<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>',2:'<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>',3:'<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>',4:'<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>',5:'<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>',6:'<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>'},italic:'<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>',image:'<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>',indent:{"+1":'<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>',"-1":'<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>'},link:'<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>',list:{bullet:'<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>',check:'<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>',ordered:'<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>'},script:{sub:'<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>',super:'<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>'},strike:'<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>',table:'<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>',underline:'<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>',video:'<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>'};let ns=0;function ss(t,e){t.setAttribute(e,"".concat(!("true"===t.getAttribute(e))))}class is{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",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),ss(this.label,"aria-expanded"),ss(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 n=t.getAttribute("value");return n&&e.setAttribute("data-value",n),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.selectItem(e,!0),t.preventDefault();break;case"Escape":this.escape(),t.preventDefault()}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML='<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>',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-".concat(ns),ns+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const n=this.buildItem(e);t.appendChild(n),!0===e.selected&&this.selectItem(n)}),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&&void 0!==arguments[1]&&arguments[1];const n=this.container.querySelector(".ql-selected");t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(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 e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);const e=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class rs extends is{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(t=>{t.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 n=this.label.querySelector(".ql-color-label"),s=t&&t.getAttribute("data-value")||"";n&&("line"===n.tagName?n.style.stroke=s:n.style.fill=s)}}class os extends is{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(t=>{t.innerHTML=e[t.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const n=t||this.defaultItem;if(null!=n){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}class ls{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(t=>{const{overflowY:e}=getComputedStyle(t,null);return"visible"!==e&&"clip"!==e})(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop="".concat(-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,n=t.bottom+this.quill.root.scrollTop;this.root.style.left="".concat(e,"px"),this.root.style.top="".concat(n,"px"),this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let r=0;if(i.right>s.right&&(r=s.right-i.right,this.root.style.left="".concat(e+r,"px")),i.left<s.left&&(r=s.left-i.left,this.root.style.left="".concat(e+r,"px")),i.bottom>s.bottom){const e=i.bottom-i.top,s=t.bottom-t.top+e;this.root.style.top="".concat(n-s,"px"),this.root.classList.add("ql-flip")}return r}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const as=[!1,"center","right","justify"],cs=["#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"],hs=[!1,"serif","monospace"],us=["1","2","3",!1],ds=["small",!1,"large","huge"];class fs extends te{constructor(t,e){super(t,e);const n=e=>{document.body.contains(t.root)?(null==this.tooltip||this.tooltip.root.contains(e.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach(t=>{t.container.contains(e.target)||t.close()})):document.body.removeEventListener("click",n)};t.emitter.listenDOM("click",document.body,n)}addModule(t){const e=super.addModule(t);return"toolbar"===t&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(t=>{(t.getAttribute("class")||"").split(/\s+/).forEach(n=>{if(n.startsWith("ql-")&&(n=n.slice(3),null!=e[n]))if("direction"===n)t.innerHTML=e[n][""]+e[n].rtl;else if("string"==typeof e[n])t.innerHTML=e[n];else{const s=t.value||"";null!=s&&e[n][s]&&(t.innerHTML=e[n][s])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(t=>{if(t.classList.contains("ql-align")&&(null==t.querySelector("option")&&gs(t,as),"object"==typeof e.align))return new os(t,e.align);if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){const n=t.classList.contains("ql-background")?"background":"color";return null==t.querySelector("option")&&gs(t,cs,"background"===n?"#ffffff":"#000000"),new rs(t,e[n])}return null==t.querySelector("option")&&(t.classList.contains("ql-font")?gs(t,hs):t.classList.contains("ql-header")?gs(t,us):t.classList.contains("ql-size")&&gs(t,ds)),new is(t)});this.quill.on(Mt.events.EDITOR_CHANGE,()=>{this.pickers.forEach(t=>{t.update()})})}}fs.DEFAULTS=s({},te.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");null==t&&(t=document.createElement("input"),t.setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class ps extends ls{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{"Enter"===t.key?(this.save(),t.preventDefault()):"Escape"===t.key&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);null!=n&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-".concat(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,Mt.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,Mt.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=function(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(e)return"".concat(e[1]||"https","://www.youtube.com/embed/").concat(e[2],"?showinfo=0");if(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return"".concat(e[1]||"https","://player.vimeo.com/video/").concat(e[2],"/");return t}(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(null!=e){const n=e.index+e.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),t,Mt.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(n+1," ",Mt.sources.USER),this.quill.setSelection(n+2,Mt.sources.USER)}break}}this.textbox.value="",this.hide()}}function gs(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(e=>{const s=document.createElement("option");e===n?s.setAttribute("selected","selected"):s.setAttribute("value",String(e)),t.appendChild(s)})}const ms=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class bs extends ps{constructor(t,e){super(t,e),this.quill.on(Mt.events.EDITOR_CHANGE,(t,e,n,s)=>{if(t===Mt.events.SELECTION_CHANGE)if(null!=e&&e.length>0&&s===Mt.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width="".concat(this.root.offsetWidth,"px");const t=this.quill.getLines(e.index,e.length);if(1===t.length){const t=this.quill.getBounds(e);null!=t&&this.position(t)}else{const n=t[t.length-1],s=this.quill.getIndex(n),i=Math.min(n.length()-1,e.index+e.length-s),r=this.quill.getBounds(new Dt(s,i));null!=r&&this.position(r)}}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(Mt.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(null!=t){const e=this.quill.getBounds(t);null!=e&&this.position(e)}},1)})}cancel(){this.show()}position(t){const e=super.position(t),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",0!==e&&(n.style.marginLeft="".concat(-1*e-n.offsetWidth/2,"px")),e}}o(bs,"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(""));class vs extends fs{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=ms),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new bs(this.quill,this.options.bounds),null!=t.container&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),es),this.buildPickers(t.container.querySelectorAll("select"),es))}}vs.DEFAULTS=s({},fs.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,ae.sources.USER)}}}}});const ys=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class xs extends ps{constructor(){super(...arguments),o(this,"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(null!=this.linkRange){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,Mt.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(Mt.events.SELECTION_CHANGE,(t,e,n)=>{if(null!=t){if(0===t.length&&n===Mt.sources.USER){const[e,n]=this.quill.scroll.descendant(_n,t.index);if(null!=e){this.linkRange=new Dt(t.index-n,e.length());const s=_n.formats(e.domNode);this.preview.textContent=s,this.preview.setAttribute("href",s),this.show();const i=this.quill.getBounds(this.linkRange);return void(null!=i&&this.position(i))}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}o(xs,"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(""));class Ns extends fs{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=ys),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){null!=t.container&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),es),this.buildPickers(t.container.querySelectorAll("select"),es),this.tooltip=new xs(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,n)=>{t.handlers.link.call(t,!n.format.link)}))}}Ns.DEFAULTS=s({},fs.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const t=this.quill.getSelection();if(null==t||0===t.length)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&0!==e.indexOf("mailto:")&&(e="mailto:".concat(e));const{tooltip:n}=this.quill.theme;n.edit("link",e)}else this.quill.format("link",!1,ae.sources.USER)}}}}}),ae.register({"attributors/attribute/direction":Re,"attributors/class/align":Ee,"attributors/class/background":Le,"attributors/class/color":qe,"attributors/class/direction":Ie,"attributors/class/font":Be,"attributors/class/size":Ue,"attributors/style/align":Ae,"attributors/style/background":Te,"attributors/style/color":ke,"attributors/style/direction":je,"attributors/style/font":De,"attributors/style/size":Pe},!0),ae.register({"formats/align":Ee,"formats/direction":Ie,"formats/indent":wn,"formats/background":Te,"formats/color":ke,"formats/font":Be,"formats/size":Ue,"formats/blockquote":qn,"formats/code-block":Oe,"formats/header":kn,"formats/list":Tn,"formats/bold":Sn,"formats/code":_e,"formats/italic":On,"formats/link":_n,"formats/script":Rn,"formats/strike":In,"formats/underline":jn,"formats/formula":Mn,"formats/image":Dn,"formats/video":Pn,"modules/syntax":Kn,"modules/table":class extends $t{static register(){ae.register(Zn),ae.register(Wn),ae.register(Gn),ae.register($n)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants($n).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();null!=e&&(t.deleteColumn(e.cellOffset()),this.quill.update(ae.sources.USER))}deleteRow(){const[,t]=this.getTable();null!=t&&(t.remove(),this.quill.update(ae.sources.USER))}deleteTable(){const[t]=this.getTable();if(null==t)return;const e=t.offset();t.remove(),this.quill.update(ae.sources.USER),this.quill.setSelection(e,ae.sources.SILENT)}getTable(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==t)return[null,null,null,-1];const[e,n]=this.quill.getLine(t.index);if(null==e||e.statics.blotName!==Zn.blotName)return[null,null,null,-1];const s=e.parent;return[s.parent.parent,s,e,n]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(null==i)return;const r=i.cellOffset();n.insertColumn(r+t),this.quill.update(ae.sources.USER);let o=s.rowOffset();0===t&&(o+=1),this.quill.setSelection(e.index+o,e.length,ae.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(null==i)return;const r=s.rowOffset();n.insertRow(r+t),this.quill.update(ae.sources.USER),t>0?this.quill.setSelection(e,ae.sources.SILENT):this.quill.setSelection(e.index+s.children.length,e.length,ae.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const n=this.quill.getSelection();if(null==n)return;const s=new Array(t).fill(0).reduce(t=>{const n=new Array(e).fill("\n").join("");return t.insert(n,{table:Xn()})},(new bt).retain(n.index));this.quill.updateContents(s,ae.sources.USER),this.quill.setSelection(n.index,ae.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(ae.events.SCROLL_OPTIMIZE,t=>{t.some(t=>!!["TD","TR","TBODY","TABLE"].includes(t.target.tagName)&&(this.quill.once(ae.events.TEXT_CHANGE,(t,e,n)=>{n===ae.sources.USER&&this.balanceTables()}),!0))})}},"modules/toolbar":Qn,"themes/bubble":vs,"themes/snow":Ns,"ui/icons":es,"ui/picker":is,"ui/icon-picker":os,"ui/color-picker":rs,"ui/tooltip":ls},!0)}}});
|
|
2
|
-
//# sourceMappingURL=quill-
|
|
1
|
+
System.register(["lodash-es","./index-HQsqnjtM.js"],function(t){"use strict";var e,n,s,i,r;return{setters:[function(t){e=t.isEqual,n=t.cloneDeep,s=t.merge},function(t){i=t.a,r=t.g}],execute:function(){function o(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var s=n.call(t,e);if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(l||{});class a{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.attrName=t,this.keyName=e;const s=l.TYPE&l.ATTRIBUTE;this.scope=null!=n.scope?n.scope&l.LEVEL|s:l.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(t){return Array.from(t.attributes).map(t=>t.name)}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1)}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}class c extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}const h=class t{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==t)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let n=null;try{n=t.parentNode}catch(t){return null}return this.find(n,e)}return null}create(e,n,s){const i=this.query(n);if(null==i)throw new c("Unable to create ".concat(n," blot"));const r=i,o=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:r.create(s),l=new r(e,o,s);return t.blots.set(l.domNode,l),l}find(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.find(e,n)}query(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.ANY;return"string"==typeof t?e=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?e=this.types.text:"number"==typeof t?t&l.LEVEL&l.BLOCK?e=this.types.block:t&l.LEVEL&l.INLINE&&(e=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some(t=>(e=this.classes[t],!!e)),e=e||this.tags[t.tagName]),null==e?null:"scope"in e&&n&l.LEVEL&e.scope&&n&l.TYPE&e.scope?e:null}register(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.map(t=>{const e="blotName"in t,n="attrName"in t;if(!e&&!n)throw new c("Invalid definition");if(e&&"abstract"===t.blotName)throw new c("Cannot register abstract class");const s=e?t.blotName:n?t.attrName:void 0;return this.types[s]=t,n?"string"==typeof t.keyName&&(this.attributes[t.keyName]=t):e&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(t=>t.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(e=>{(null==this.tags[e]||null==t.className)&&(this.tags[e]=t)}))),t})}};h.blots=new WeakMap;let u=h;function d(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(t=>0===t.indexOf("".concat(e,"-")))}const f=class extends a{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add("".concat(this.keyName,"-").concat(e)),!0)}remove(t){d(t,this.keyName).forEach(e=>{t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(d(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function p(t){const e=t.split("-"),n=e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("");return e[0]+n}const g=class extends a{static keys(t){return(t.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(t,e){return!!this.canAdd(t,e)&&(t.style[p(this.keyName)]=e,!0)}remove(t){t.style[p(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[p(this.keyName)];return this.canAdd(t,e)?e:""}};const m=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=u.find(this.domNode);if(null==t)return;const e=a.keys(this.domNode),n=f.keys(this.domNode),s=g.keys(this.domNode);e.concat(n).concat(s).forEach(e=>{const n=t.scroll.query(e,l.ATTRIBUTE);n instanceof a&&(this.attributes[n.attrName]=n)})}copy(t){Object.keys(this.attributes).forEach(e=>{const n=this.attributes[e].value(this.domNode);t.format(e,n)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}},b=class{constructor(t,e){this.scroll=t,this.domNode=e,u.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new c("Blot definition missing tagName");let e,n;return Array.isArray(this.tagName)?("string"==typeof t?(n=t.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof t&&(n=t),e="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){null!=this.parent&&this.parent.removeChild(this),u.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,s){const i=this.isolate(t,e);if(null!=this.scroll.query(n,l.BLOT)&&s)i.wrap(n,s);else if(null!=this.scroll.query(n,l.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);i.wrap(t),t.format(n,s)}}insertAt(t,e,n){const s=null==n?this.scroll.create("text",e):this.scroll.create(e,n),i=this.split(t);this.parent.insertBefore(s,i||void 0)}isolate(t,e){const n=this.split(t);if(null==n)throw new Error("Attempt to isolate at end");return n.split(e),n}length(){return 1}offset(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;return null==this.parent||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new c("Cannot wrap ".concat(t));return n.appendChild(this),n}};b.blotName="abstract";let v=b;const y=class extends v{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};y.scope=l.INLINE_BLOT;const x=y;class N{constructor(){this.head=null,this.tail=null,this.length=0}append(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(t){const e=this.iterator();let n=e();for(;n&&t>0;)t-=1,n=e();return n}contains(t){const e=this.iterator();let n=e();for(;n;){if(n===t)return!0;n=e()}return!1}indexOf(t){const e=this.iterator();let n=e(),s=0;for(;n;){if(n===t)return s;s+=1,n=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,n=this.head;for(;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.head;return()=>{const e=t;return null!=t&&(t=t.next),e}}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.iterator();let s=n();for(;s;){const i=s.length();if(t<i||e&&t===i&&(null==s.next||0!==s.next.length()))return[s,t];t-=i,s=n()}return[null,0]}forEach(t){const e=this.iterator();let n=e();for(;n;)t(n),n=e()}forEachAt(t,e,n){if(e<=0)return;const[s,i]=this.find(t);let r=t-i;const o=this.iterator(s);let l=o();for(;l&&r<t+e;){const s=l.length();t>r?n(l,t-r,Math.min(e,r+s-t)):n(l,0,Math.min(s,t+e-r)),r+=s,l=o()}}map(t){return this.reduce((e,n)=>(e.push(t(n)),e),[])}reduce(t,e){const n=this.iterator();let s=n();for(;s;)e=t(e,s),s=n();return e}}function E(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch(n){const s=e.create(l.INLINE);return Array.from(t.childNodes).forEach(t=>{s.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(s.domNode,t),s.attach(),s}}const A=class t extends v{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(e){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=e,t.uiClass&&this.uiNode.classList.add(t.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new N,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=E(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof c)return;throw t}})}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,(t,e,n)=>{t.deleteAt(e,n)})}descendant(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const[s,i]=this.children.find(n);return null==e.blotName&&e(s)||null!=e.blotName&&s instanceof e?[s,i]:s instanceof t?s.descendant(e,i):[null,-1]}descendants(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_VALUE,i=[],r=s;return this.children.forEachAt(n,s,(n,s,o)=>{(null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e)&&i.push(n),n instanceof t&&(i=i.concat(n.descendants(e,s,r))),r-=o}),i}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(t=>n instanceof t)||(n.statics.scope===l.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof t?n.unwrap():n.remove())})}formatAt(t,e,n,s){this.children.forEachAt(t,e,(t,e,i)=>{t.formatAt(e,i,n,s)})}insertAt(t,e,n){const[s,i]=this.children.find(t);if(s)s.insertAt(i,e,n);else{const t=null==n?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),t.parent=this,null!=e&&(n=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(t.domNode,n),t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(n=>{t.insertBefore(n,e)})}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const[s,i]=this.children.find(e,n),r=[[this,e]];return s instanceof t?r.concat(s.path(i,n)):(null!=s&&r.push([s,i]),r)}removeChild(t){this.children.remove(t)}replaceWith(e,n){const s="string"==typeof e?this.scroll.create(e,n):e;return s instanceof t&&this.moveChildren(s),super.replaceWith(s)}split(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e){if(0===t)return this;if(t===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(t,this.length(),(t,s,i)=>{const r=t.split(s,e);null!=r&&n.appendChild(r)}),n}splitAfter(t){const e=this.clone();for(;null!=t.next;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const n=[],s=[];t.forEach(t=>{t.target===this.domNode&&"childList"===t.type&&(n.push(...t.addedNodes),s.push(...t.removedNodes))}),s.forEach(t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null==e.domNode.parentNode||e.domNode.parentNode===this.domNode)&&e.detach()}),n.filter(t=>t.parentNode===this.domNode&&t!==this.uiNode).sort((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const n=E(t,this.scroll);(n.next!==e||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,e||void 0))}),this.enforceAllowedChildren()}};A.uiClass="";const w=A;const q=class t extends w{static create(t){return super.create(t)}static formats(e,n){const s=n.query(t.blotName);if(null==s||e.tagName!==s.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new m(this.domNode)}format(e,n){if(e!==this.statics.blotName||n){const t=this.scroll.query(e,l.INLINE);if(null==t)return;t instanceof a?this.attributes.attribute(t,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}else this.children.forEach(e=>{e instanceof t||(e=e.wrap(t.blotName,!0)),this.attributes.copy(e)}),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,s){null!=this.formats()[n]||this.scroll.query(n,l.ATTRIBUTE)?this.isolate(t,e).format(n,s):super.formatAt(t,e,n,s)}optimize(e){super.optimize(e);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const s=this.next;s instanceof t&&s.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}(n,s.formats())&&(s.moveChildren(this),s.remove())}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}wrap(e,n){const s=super.wrap(e,n);return s instanceof t&&this.attributes.move(s),s}};q.allowedChildren=[q,x],q.blotName="inline",q.scope=l.INLINE_BLOT,q.tagName="SPAN";const k=q,L=class t extends w{static create(t){return super.create(t)}static formats(e,n){const s=n.query(t.blotName);if(null==s||e.tagName!==s.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new m(this.domNode)}format(e,n){const s=this.scroll.query(e,l.BLOCK);null!=s&&(s instanceof a?this.attributes.attribute(s,n):e!==this.statics.blotName||n?n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n):this.replaceWith(t.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,s){null!=this.scroll.query(n,l.BLOCK)?this.format(n,s):super.formatAt(t,e,n,s)}insertAt(t,e,n){if(null==n||null!=this.scroll.query(e,l.INLINE))super.insertAt(t,e,n);else{const s=this.split(t);if(null==s)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,n);s.parent.insertBefore(t,s)}}}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}};L.blotName="block",L.scope=l.BLOCK_BLOT,L.tagName="P",L.allowedChildren=[k,L,x];const T=L,S=class extends w{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,n,s){super.formatAt(t,e,n,s),this.enforceAllowedChildren()}insertAt(t,e,n){super.insertAt(t,e,n),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};S.blotName="container",S.scope=l.BLOCK_BLOT;const O=S;const _=class extends x{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,s){0===t&&e===this.length()?this.format(n,s):super.formatAt(t,e,n,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}},C={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},R=class extends w{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(t=>{this.update(t)}),this.observer.observe(this.domNode,C),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.registry.find(t,e);return n?n.scroll===this?n:e?this.find(n.scroll.domNode.parentNode,!0):null:null}query(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.ANY;return this.registry.query(t,e)}register(){return this.registry.register(...arguments)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach(t=>{t.remove()}):super.deleteAt(t,e)}formatAt(t,e,n,s){this.update(),super.formatAt(t,e,n,s)}insertAt(t,e,n){this.update(),super.insertAt(t,e,n)}optimize(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super.optimize(n);const s=n.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const r=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];null==e||e===t||null!=e.domNode.parentNode&&(s.has(e.domNode)||s.set(e.domNode,[]),n&&r(e.parent))},o=t=>{s.has(t.domNode)&&(t instanceof w&&t.children.forEach(o),s.delete(t.domNode),t.optimize(n))};let l=e;for(let t=0;l.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(r(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach(t=>{const e=this.find(t,!1);r(e,!1),e instanceof w&&e.children.forEach(t=>{r(t,!1)})})):"attributes"===t.type&&r(e.prev)),r(e))}),this.children.forEach(o),l=Array.from(this.observer.takeRecords()),i=l.slice();i.length>0;)e.push(i.pop())}}update(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=t||this.observer.takeRecords();const n=new WeakMap;t.map(t=>{const e=this.find(t.target,!0);return null==e?null:n.has(e.domNode)?(n.get(e.domNode).push(t),null):(n.set(e.domNode,[t]),e)}).forEach(t=>{null!=t&&t!==this&&n.has(t.domNode)&&t.update(n.get(t.domNode)||[],e)}),e.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),e),this.optimize(t,e)}};R.blotName="scroll",R.defaultChild=T,R.allowedChildren=[T,O],R.scope=l.BLOCK_BLOT,R.tagName="DIV";const I=R,j=class t extends x{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,n){null==n?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,n)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t){return[this.domNode,t]}split(t){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])){if(0===t)return this;if(t===this.length())return this.next}const e=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(e,this.next||void 0),this.text=this.statics.value(this.domNode),e}update(t,e){t.some(t=>"characterData"===t.type&&t.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};j.blotName="text",j.scope=l.INLINE_BLOT;const M=j;var B=Object.freeze({__proto__:null,Attributor:a,AttributorStore:m,BlockBlot:T,ClassAttributor:f,ContainerBlot:O,EmbedBlot:_,InlineBlot:k,LeafBlot:x,ParentBlot:w,Registry:u,Scope:l,ScrollBlot:I,StyleAttributor:g,TextBlot:M}),D={exports:{}},U=-1;function P(t,e,n,s,i){if(t===e)return t?[[0,t]]:[];if(null!=n){var r=function(t,e,n){var s="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,r=t.length,o=e.length;if(0===s.length&&(null===i||0===i.length)){var l=s.index,a=t.slice(0,l),c=t.slice(l),h=i?i.index:null,u=l+o-r;if((null===h||h===u)&&!(u<0||u>o)){var d=e.slice(0,u);if((g=e.slice(u))===c){var f=Math.min(l,u);if((b=a.slice(0,f))===(y=d.slice(0,f)))return et(b,a.slice(f),d.slice(f),c)}}if(null===h||h===l){var p=l,g=(d=e.slice(0,p),e.slice(p));if(d===a){var m=Math.min(r-p,o-p);if((v=c.slice(c.length-m))===(x=g.slice(g.length-m)))return et(a,c.slice(0,c.length-m),g.slice(0,g.length-m),v)}}}if(s.length>0&&i&&0===i.length){var b=t.slice(0,s.index),v=t.slice(s.index+s.length);if(!(o<(f=b.length)+(m=v.length))){var y=e.slice(0,f),x=e.slice(o-m);if(b===y&&v===x)return et(b,t.slice(f,r-m),e.slice(f,o-m),v)}}return null}(t,e,n);if(r)return r}var o=z(t,e),l=t.substring(0,o);o=V(t=t.substring(o),e=e.substring(o));var a=t.substring(t.length-o),c=function(t,e){var n;if(!t)return[[1,e]];if(!e)return[[U,t]];var s=t.length>e.length?t:e,i=t.length>e.length?e:t,r=s.indexOf(i);if(-1!==r)return n=[[1,s.substring(0,r)],[0,i],[1,s.substring(r+i.length)]],t.length>e.length&&(n[0][0]=n[2][0]=U),n;if(1===i.length)return[[U,t],[1,e]];var o=function(t,e){var n=t.length>e.length?t:e,s=t.length>e.length?e:t;if(n.length<4||2*s.length<n.length)return null;function i(t,e,n){for(var s,i,r,o,l=t.substring(n,n+Math.floor(t.length/4)),a=-1,c="";-1!==(a=e.indexOf(l,a+1));){var h=z(t.substring(n),e.substring(a)),u=V(t.substring(0,n),e.substring(0,a));c.length<u+h&&(c=e.substring(a-u,a)+e.substring(a,a+h),s=t.substring(0,n-u),i=t.substring(n+h),r=e.substring(0,a-u),o=e.substring(a+h))}return 2*c.length>=t.length?[s,i,r,o,c]:null}var r,o,l,a,c,h=i(n,s,Math.ceil(n.length/4)),u=i(n,s,Math.ceil(n.length/2));if(!h&&!u)return null;r=u?h&&h[4].length>u[4].length?h:u:h;t.length>e.length?(o=r[0],l=r[1],a=r[2],c=r[3]):(a=r[0],c=r[1],o=r[2],l=r[3]);var d=r[4];return[o,l,a,c,d]}(t,e);if(o){var l=o[0],a=o[1],c=o[2],h=o[3],u=o[4],d=P(l,c),f=P(a,h);return d.concat([[0,u]],f)}return function(t,e){for(var n=t.length,s=e.length,i=Math.ceil((n+s)/2),r=i,o=2*i,l=new Array(o),a=new Array(o),c=0;c<o;c++)l[c]=-1,a[c]=-1;l[r+1]=0,a[r+1]=0;for(var h=n-s,u=h%2!=0,d=0,f=0,p=0,g=0,m=0;m<i;m++){for(var b=-m+d;b<=m-f;b+=2){for(var v=r+b,y=(w=b===-m||b!==m&&l[v-1]<l[v+1]?l[v+1]:l[v-1]+1)-b;w<n&&y<s&&t.charAt(w)===e.charAt(y);)w++,y++;if(l[v]=w,w>n)f+=2;else if(y>s)d+=2;else if(u){if((E=r+h-b)>=0&&E<o&&-1!==a[E])if(w>=(N=n-a[E]))return H(t,e,w,y)}}for(var x=-m+p;x<=m-g;x+=2){for(var N,E=r+x,A=(N=x===-m||x!==m&&a[E-1]<a[E+1]?a[E+1]:a[E-1]+1)-x;N<n&&A<s&&t.charAt(n-N-1)===e.charAt(s-A-1);)N++,A++;if(a[E]=N,N>n)g+=2;else if(A>s)p+=2;else if(!u){if((v=r+h-x)>=0&&v<o&&-1!==l[v]){var w;y=r+(w=l[v])-v;if(w>=(N=n-N))return H(t,e,w,y)}}}}return[[U,t],[1,e]]}(t,e)}(t=t.substring(0,t.length-o),e=e.substring(0,e.length-o));return l&&c.unshift([0,l]),a&&c.push([0,a]),X(c,i),s&&function(t){var e=!1,n=[],s=0,i=null,r=0,o=0,l=0,a=0,c=0;for(;r<t.length;)0==t[r][0]?(n[s++]=r,o=a,l=c,a=0,c=0,i=t[r][1]):(1==t[r][0]?a+=t[r][1].length:c+=t[r][1].length,i&&i.length<=Math.max(o,l)&&i.length<=Math.max(a,c)&&(t.splice(n[s-1],0,[U,i]),t[n[s-1]+1][0]=1,s--,r=--s>0?n[s-1]:-1,o=0,l=0,a=0,c=0,i=null,e=!0)),r++;e&&X(t);(function(t){function e(t,e){if(!t||!e)return 6;var n=t.charAt(t.length-1),s=e.charAt(0),i=n.match(K),r=s.match(K),o=i&&n.match(Z),l=r&&s.match(Z),a=o&&n.match(W),c=l&&s.match(W),h=a&&t.match(G),u=c&&e.match($);return h||u?5:a||c?4:i&&!o&&l?3:o||l?2:i||r?1:0}var n=1;for(;n<t.length-1;){if(0==t[n-1][0]&&0==t[n+1][0]){var s=t[n-1][1],i=t[n][1],r=t[n+1][1],o=V(s,i);if(o){var l=i.substring(i.length-o);s=s.substring(0,s.length-o),i=l+i.substring(0,i.length-o),r=l+r}for(var a=s,c=i,h=r,u=e(s,i)+e(i,r);i.charAt(0)===r.charAt(0);){s+=i.charAt(0),i=i.substring(1)+r.charAt(0),r=r.substring(1);var d=e(s,i)+e(i,r);d>=u&&(u=d,a=s,c=i,h=r)}t[n-1][1]!=a&&(a?t[n-1][1]=a:(t.splice(n-1,1),n--),t[n][1]=c,h?t[n+1][1]=h:(t.splice(n+1,1),n--))}n++}})(t),r=1;for(;r<t.length;){if(t[r-1][0]==U&&1==t[r][0]){var h=t[r-1][1],u=t[r][1],d=F(h,u),f=F(u,h);d>=f?(d>=h.length/2||d>=u.length/2)&&(t.splice(r,0,[0,u.substring(0,d)]),t[r-1][1]=h.substring(0,h.length-d),t[r+1][1]=u.substring(d),r++):(f>=h.length/2||f>=u.length/2)&&(t.splice(r,0,[0,h.substring(0,f)]),t[r-1][0]=1,t[r-1][1]=u.substring(0,u.length-f),t[r+1][0]=U,t[r+1][1]=h.substring(f),r++),r++}r++}}(c),c}function H(t,e,n,s){var i=t.substring(0,n),r=e.substring(0,s),o=t.substring(n),l=e.substring(s),a=P(i,r),c=P(o,l);return a.concat(c)}function z(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,s=Math.min(t.length,e.length),i=s,r=0;n<i;)t.substring(r,i)==e.substring(r,i)?r=n=i:s=i,i=Math.floor((s-n)/2+n);return Y(t.charCodeAt(i-1))&&i--,i}function F(t,e){var n=t.length,s=e.length;if(0==n||0==s)return 0;n>s?t=t.substring(n-s):n<s&&(e=e.substring(0,n));var i=Math.min(n,s);if(t==e)return i;for(var r=0,o=1;;){var l=t.substring(i-o),a=e.indexOf(l);if(-1==a)return r;o+=a,0!=a&&t.substring(i-o)!=e.substring(0,o)||(r=o,o++)}}function V(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var n=0,s=Math.min(t.length,e.length),i=s,r=0;n<i;)t.substring(t.length-i,t.length-r)==e.substring(e.length-i,e.length-r)?r=n=i:s=i,i=Math.floor((s-n)/2+n);return Q(t.charCodeAt(t.length-i))&&i--,i}var K=/[^a-zA-Z0-9]/,Z=/\s/,W=/[\r\n]/,G=/\n\r?\n$/,$=/^\r?\n\r?\n/;function X(t,e){t.push([0,""]);for(var n,s=0,i=0,r=0,o="",l="";s<t.length;)if(s<t.length-1&&!t[s][1])t.splice(s,1);else switch(t[s][0]){case 1:r++,l+=t[s][1],s++;break;case U:i++,o+=t[s][1],s++;break;case 0:var a=s-r-i-1;if(e){if(a>=0&&tt(t[a][1])){var c=t[a][1].slice(-1);if(t[a][1]=t[a][1].slice(0,-1),o=c+o,l=c+l,!t[a][1]){t.splice(a,1),s--;var h=a-1;t[h]&&1===t[h][0]&&(r++,l=t[h][1]+l,h--),t[h]&&t[h][0]===U&&(i++,o=t[h][1]+o,h--),a=h}}if(J(t[s][1])){c=t[s][1].charAt(0);t[s][1]=t[s][1].slice(1),o+=c,l+=c}}if(s<t.length-1&&!t[s][1]){t.splice(s,1);break}if(o.length>0||l.length>0){o.length>0&&l.length>0&&(0!==(n=z(l,o))&&(a>=0?t[a][1]+=l.substring(0,n):(t.splice(0,0,[0,l.substring(0,n)]),s++),l=l.substring(n),o=o.substring(n)),0!==(n=V(l,o))&&(t[s][1]=l.substring(l.length-n)+t[s][1],l=l.substring(0,l.length-n),o=o.substring(0,o.length-n)));var u=r+i;0===o.length&&0===l.length?(t.splice(s-u,u),s-=u):0===o.length?(t.splice(s-u,u,[1,l]),s=s-u+1):0===l.length?(t.splice(s-u,u,[U,o]),s=s-u+1):(t.splice(s-u,u,[U,o],[1,l]),s=s-u+2)}0!==s&&0===t[s-1][0]?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,r=0,i=0,o="",l=""}""===t[t.length-1][1]&&t.pop();var d=!1;for(s=1;s<t.length-1;)0===t[s-1][0]&&0===t[s+1][0]&&(t[s][1].substring(t[s][1].length-t[s-1][1].length)===t[s-1][1]?(t[s][1]=t[s-1][1]+t[s][1].substring(0,t[s][1].length-t[s-1][1].length),t[s+1][1]=t[s-1][1]+t[s+1][1],t.splice(s-1,1),d=!0):t[s][1].substring(0,t[s+1][1].length)==t[s+1][1]&&(t[s-1][1]+=t[s+1][1],t[s][1]=t[s][1].substring(t[s+1][1].length)+t[s+1][1],t.splice(s+1,1),d=!0)),s++;d&&X(t,e)}function Y(t){return t>=55296&&t<=56319}function Q(t){return t>=56320&&t<=57343}function J(t){return Q(t.charCodeAt(0))}function tt(t){return Y(t.charCodeAt(t.length-1))}function et(t,e,n,s){return tt(t)||J(s)?null:function(t){for(var e=[],n=0;n<t.length;n++)t[n][1].length>0&&e.push(t[n]);return e}([[0,t],[U,e],[1,n],[0,s]])}function nt(t,e,n,s){return P(t,e,n,s,!0)}nt.INSERT=1,nt.DELETE=U,nt.EQUAL=0;var st=nt,it={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Boolean]",l="[object Date]",a="[object Function]",c="[object GeneratorFunction]",h="[object Map]",u="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",g="[object Set]",m="[object String]",b="[object Symbol]",v="[object WeakMap]",y="[object ArrayBuffer]",x="[object DataView]",N="[object Float32Array]",E="[object Float64Array]",A="[object Int8Array]",w="[object Int16Array]",q="[object Int32Array]",k="[object Uint8Array]",L="[object Uint8ClampedArray]",T="[object Uint16Array]",S="[object Uint32Array]",O=/\w*$/,_=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,R={};R[r]=R["[object Array]"]=R[y]=R[x]=R[o]=R[l]=R[N]=R[E]=R[A]=R[w]=R[q]=R[h]=R[u]=R[d]=R[p]=R[g]=R[m]=R[b]=R[k]=R[L]=R[T]=R[S]=!0,R["[object Error]"]=R[a]=R[v]=!1;var I="object"==typeof i&&i&&i.Object===Object&&i,j="object"==typeof self&&self&&self.Object===Object&&self,M=I||j||Function("return this")(),B=e&&!e.nodeType&&e,D=B&&t&&!t.nodeType&&t,U=D&&D.exports===B;function P(t,e){return t.set(e[0],e[1]),t}function H(t,e){return t.add(e),t}function z(t,e,n,s){for(var i=-1,r=t?t.length:0;++i<r;)n=e(n,t[i],i,t);return n}function F(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function V(t){var e=-1,n=Array(t.size);return t.forEach(function(t,s){n[++e]=[s,t]}),n}function K(t,e){return function(n){return t(e(n))}}function Z(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}var W,G=Array.prototype,$=Function.prototype,X=Object.prototype,Y=M["__core-js_shared__"],Q=(W=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",J=$.toString,tt=X.hasOwnProperty,et=X.toString,nt=RegExp("^"+J.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=U?M.Buffer:void 0,it=M.Symbol,rt=M.Uint8Array,ot=K(Object.getPrototypeOf,Object),lt=Object.create,at=X.propertyIsEnumerable,ct=G.splice,ht=Object.getOwnPropertySymbols,ut=st?st.isBuffer:void 0,dt=K(Object.keys,Object),ft=Dt(M,"DataView"),pt=Dt(M,"Map"),gt=Dt(M,"Promise"),mt=Dt(M,"Set"),bt=Dt(M,"WeakMap"),vt=Dt(Object,"create"),yt=Ft(ft),xt=Ft(pt),Nt=Ft(gt),Et=Ft(mt),At=Ft(bt),wt=it?it.prototype:void 0,qt=wt?wt.valueOf:void 0;function kt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function Lt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function Tt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function St(t){this.__data__=new Lt(t)}function Ot(t,e){var n=Kt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Zt(t)}(t)&&tt.call(t,"callee")&&(!at.call(t,"callee")||et.call(t)==r)}(t)?function(t,e){for(var n=-1,s=Array(t);++n<t;)s[n]=e(n);return s}(t.length,String):[],s=n.length,i=!!s;for(var o in t)!tt.call(t,o)||i&&("length"==o||Ht(o,s))||n.push(o);return n}function _t(t,e,n){var s=t[e];tt.call(t,e)&&Vt(s,n)&&(void 0!==n||e in t)||(t[e]=n)}function Ct(t,e){for(var n=t.length;n--;)if(Vt(t[n][0],e))return n;return-1}function Rt(t,e,n,s,i,f,v){var _;if(s&&(_=f?s(t,i,f,v):s(t)),void 0!==_)return _;if(!$t(t))return t;var C=Kt(t);if(C){if(_=function(t){var e=t.length,n=t.constructor(e);e&&"string"==typeof t[0]&&tt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!e)return function(t,e){var n=-1,s=t.length;e||(e=Array(s));for(;++n<s;)e[n]=t[n];return e}(t,_)}else{var I=Pt(t),j=I==a||I==c;if(Wt(t))return function(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}(t,e);if(I==d||I==r||j&&!f){if(F(t))return f?t:{};if(_=function(t){return"function"!=typeof t.constructor||zt(t)?{}:(e=ot(t),$t(e)?lt(e):{});var e}(j?{}:t),!e)return function(t,e){return Mt(t,Ut(t),e)}(t,function(t,e){return t&&Mt(e,Xt(e),t)}(_,t))}else{if(!R[I])return f?t:{};_=function(t,e,n,s){var i=t.constructor;switch(e){case y:return jt(t);case o:case l:return new i(+t);case x:return function(t,e){var n=e?jt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,s);case N:case E:case A:case w:case q:case k:case L:case T:case S:return function(t,e){var n=e?jt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,s);case h:return function(t,e,n){var s=e?n(V(t),!0):V(t);return z(s,P,new t.constructor)}(t,s,n);case u:case m:return new i(t);case p:return function(t){var e=new t.constructor(t.source,O.exec(t));return e.lastIndex=t.lastIndex,e}(t);case g:return function(t,e,n){var s=e?n(Z(t),!0):Z(t);return z(s,H,new t.constructor)}(t,s,n);case b:return r=t,qt?Object(qt.call(r)):{}}var r}(t,I,Rt,e)}}v||(v=new St);var M=v.get(t);if(M)return M;if(v.set(t,_),!C)var B=n?function(t){return function(t,e,n){var s=e(t);return Kt(t)?s:function(t,e){for(var n=-1,s=e.length,i=t.length;++n<s;)t[i+n]=e[n];return t}(s,n(t))}(t,Xt,Ut)}(t):Xt(t);return function(t,e){for(var n=-1,s=t?t.length:0;++n<s&&!1!==e(t[n],n,t););}(B||t,function(i,r){B&&(i=t[r=i]),_t(_,r,Rt(i,e,n,s,r,t,v))}),_}function It(t){return!(!$t(t)||(e=t,Q&&Q in e))&&(Gt(t)||F(t)?nt:_).test(Ft(t));var e}function jt(t){var e=new t.constructor(t.byteLength);return new rt(e).set(new rt(t)),e}function Mt(t,e,n,s){n||(n={});for(var i=-1,r=e.length;++i<r;){var o=e[i];_t(n,o,t[o])}return n}function Bt(t,e){var n,s,i=t.__data__;return("string"==(s=typeof(n=e))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Dt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return It(n)?n:void 0}kt.prototype.clear=function(){this.__data__=vt?vt(null):{}},kt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},kt.prototype.get=function(t){var e=this.__data__;if(vt){var s=e[t];return s===n?void 0:s}return tt.call(e,t)?e[t]:void 0},kt.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:tt.call(e,t)},kt.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?n:e,this},Lt.prototype.clear=function(){this.__data__=[]},Lt.prototype.delete=function(t){var e=this.__data__,n=Ct(e,t);return!(n<0)&&(n==e.length-1?e.pop():ct.call(e,n,1),!0)},Lt.prototype.get=function(t){var e=this.__data__,n=Ct(e,t);return n<0?void 0:e[n][1]},Lt.prototype.has=function(t){return Ct(this.__data__,t)>-1},Lt.prototype.set=function(t,e){var n=this.__data__,s=Ct(n,t);return s<0?n.push([t,e]):n[s][1]=e,this},Tt.prototype.clear=function(){this.__data__={hash:new kt,map:new(pt||Lt),string:new kt}},Tt.prototype.delete=function(t){return Bt(this,t).delete(t)},Tt.prototype.get=function(t){return Bt(this,t).get(t)},Tt.prototype.has=function(t){return Bt(this,t).has(t)},Tt.prototype.set=function(t,e){return Bt(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new Lt},St.prototype.delete=function(t){return this.__data__.delete(t)},St.prototype.get=function(t){return this.__data__.get(t)},St.prototype.has=function(t){return this.__data__.has(t)},St.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Lt){var s=n.__data__;if(!pt||s.length<199)return s.push([t,e]),this;n=this.__data__=new Tt(s)}return n.set(t,e),this};var Ut=ht?K(ht,Object):function(){return[]},Pt=function(t){return et.call(t)};function Ht(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||C.test(t))&&t>-1&&t%1==0&&t<e}function zt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||X)}function Ft(t){if(null!=t){try{return J.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Vt(t,e){return t===e||t!=t&&e!=e}(ft&&Pt(new ft(new ArrayBuffer(1)))!=x||pt&&Pt(new pt)!=h||gt&&Pt(gt.resolve())!=f||mt&&Pt(new mt)!=g||bt&&Pt(new bt)!=v)&&(Pt=function(t){var e=et.call(t),n=e==d?t.constructor:void 0,s=n?Ft(n):void 0;if(s)switch(s){case yt:return x;case xt:return h;case Nt:return f;case Et:return g;case At:return v}return e});var Kt=Array.isArray;function Zt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}(t.length)&&!Gt(t)}var Wt=ut||function(){return!1};function Gt(t){var e=$t(t)?et.call(t):"";return e==a||e==c}function $t(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return Zt(t)?Ot(t):function(t){if(!zt(t))return dt(t);var e=[];for(var n in Object(t))tt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}t.exports=function(t){return Rt(t,!0,!0)}}(it,it.exports);var rt=it.exports,ot={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",l="[object Boolean]",a="[object Date]",c="[object Error]",h="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",p="[object Promise]",g="[object RegExp]",m="[object Set]",b="[object String]",v="[object Symbol]",y="[object WeakMap]",x="[object ArrayBuffer]",N="[object DataView]",E=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,w={};w["[object Float32Array]"]=w["[object Float64Array]"]=w["[object Int8Array]"]=w["[object Int16Array]"]=w["[object Int32Array]"]=w["[object Uint8Array]"]=w["[object Uint8ClampedArray]"]=w["[object Uint16Array]"]=w["[object Uint32Array]"]=!0,w[r]=w[o]=w[x]=w[l]=w[N]=w[a]=w[c]=w[h]=w[u]=w[d]=w[f]=w[g]=w[m]=w[b]=w[y]=!1;var q="object"==typeof i&&i&&i.Object===Object&&i,k="object"==typeof self&&self&&self.Object===Object&&self,L=q||k||Function("return this")(),T=e&&!e.nodeType&&e,S=T&&t&&!t.nodeType&&t,O=S&&S.exports===T,_=O&&q.process,C=function(){try{return _&&_.binding&&_.binding("util")}catch(t){}}(),R=C&&C.isTypedArray;function I(t,e){for(var n=-1,s=null==t?0:t.length;++n<s;)if(e(t[n],n,t))return!0;return!1}function j(t){var e=-1,n=Array(t.size);return t.forEach(function(t,s){n[++e]=[s,t]}),n}function M(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}var B,D,U,P=Array.prototype,H=Function.prototype,z=Object.prototype,F=L["__core-js_shared__"],V=H.toString,K=z.hasOwnProperty,Z=(B=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"",W=z.toString,G=RegExp("^"+V.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=O?L.Buffer:void 0,X=L.Symbol,Y=L.Uint8Array,Q=z.propertyIsEnumerable,J=P.splice,tt=X?X.toStringTag:void 0,et=Object.getOwnPropertySymbols,nt=$?$.isBuffer:void 0,st=(D=Object.keys,U=Object,function(t){return D(U(t))}),it=Ct(L,"DataView"),rt=Ct(L,"Map"),ot=Ct(L,"Promise"),lt=Ct(L,"Set"),at=Ct(L,"WeakMap"),ct=Ct(Object,"create"),ht=Mt(it),ut=Mt(rt),dt=Mt(ot),ft=Mt(lt),pt=Mt(at),gt=X?X.prototype:void 0,mt=gt?gt.valueOf:void 0;function bt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function vt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function yt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function xt(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new yt;++e<n;)this.add(t[e])}function Nt(t){var e=this.__data__=new vt(t);this.size=e.size}function Et(t,e){var n=Ut(t),s=!n&&Dt(t),i=!n&&!s&&Pt(t),r=!n&&!s&&!i&&Kt(t),o=n||s||i||r,l=o?function(t,e){for(var n=-1,s=Array(t);++n<t;)s[n]=e(n);return s}(t.length,String):[],a=l.length;for(var c in t)!K.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||jt(c,a))||l.push(c);return l}function At(t,e){for(var n=t.length;n--;)if(Bt(t[n][0],e))return n;return-1}function wt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":tt&&tt in Object(t)?function(t){var e=K.call(t,tt),n=t[tt];try{t[tt]=void 0;var s=!0}catch(t){}var i=W.call(t);s&&(e?t[tt]=n:delete t[tt]);return i}(t):function(t){return W.call(t)}(t)}function qt(t){return Vt(t)&&wt(t)==r}function kt(t,e,n,s,i){return t===e||(null==t||null==e||!Vt(t)&&!Vt(e)?t!=t&&e!=e:function(t,e,n,s,i,h){var p=Ut(t),y=Ut(e),E=p?o:It(t),A=y?o:It(e),w=(E=E==r?f:E)==f,q=(A=A==r?f:A)==f,k=E==A;if(k&&Pt(t)){if(!Pt(e))return!1;p=!0,w=!1}if(k&&!w)return h||(h=new Nt),p||Kt(t)?St(t,e,n,s,i,h):function(t,e,n,s,i,r,o){switch(n){case N:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case x:return!(t.byteLength!=e.byteLength||!r(new Y(t),new Y(e)));case l:case a:case d:return Bt(+t,+e);case c:return t.name==e.name&&t.message==e.message;case g:case b:return t==e+"";case u:var h=j;case m:var f=1&s;if(h||(h=M),t.size!=e.size&&!f)return!1;var p=o.get(t);if(p)return p==e;s|=2,o.set(t,e);var y=St(h(t),h(e),s,i,r,o);return o.delete(t),y;case v:if(mt)return mt.call(t)==mt.call(e)}return!1}(t,e,E,n,s,i,h);if(!(1&n)){var L=w&&K.call(t,"__wrapped__"),T=q&&K.call(e,"__wrapped__");if(L||T){var S=L?t.value():t,O=T?e.value():e;return h||(h=new Nt),i(S,O,n,s,h)}}if(!k)return!1;return h||(h=new Nt),function(t,e,n,s,i,r){var o=1&n,l=Ot(t),a=l.length,c=Ot(e),h=c.length;if(a!=h&&!o)return!1;var u=a;for(;u--;){var d=l[u];if(!(o?d in e:K.call(e,d)))return!1}var f=r.get(t);if(f&&r.get(e))return f==e;var p=!0;r.set(t,e),r.set(e,t);var g=o;for(;++u<a;){var m=t[d=l[u]],b=e[d];if(s)var v=o?s(b,m,d,e,t,r):s(m,b,d,t,e,r);if(!(void 0===v?m===b||i(m,b,n,s,r):v)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var y=t.constructor,x=e.constructor;y==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof x&&x instanceof x||(p=!1)}return r.delete(t),r.delete(e),p}(t,e,n,s,i,h)}(t,e,n,s,kt,i))}function Lt(t){return!(!Ft(t)||function(t){return!!Z&&Z in t}(t))&&(Ht(t)?G:E).test(Mt(t))}function Tt(t){if(n=(e=t)&&e.constructor,s="function"==typeof n&&n.prototype||z,e!==s)return st(t);var e,n,s,i=[];for(var r in Object(t))K.call(t,r)&&"constructor"!=r&&i.push(r);return i}function St(t,e,n,s,i,r){var o=1&n,l=t.length,a=e.length;if(l!=a&&!(o&&a>l))return!1;var c=r.get(t);if(c&&r.get(e))return c==e;var h=-1,u=!0,d=2&n?new xt:void 0;for(r.set(t,e),r.set(e,t);++h<l;){var f=t[h],p=e[h];if(s)var g=o?s(p,f,h,e,t,r):s(f,p,h,t,e,r);if(void 0!==g){if(g)continue;u=!1;break}if(d){if(!I(e,function(t,e){if(o=e,!d.has(o)&&(f===t||i(f,t,n,s,r)))return d.push(e);var o})){u=!1;break}}else if(f!==p&&!i(f,p,n,s,r)){u=!1;break}}return r.delete(t),r.delete(e),u}function Ot(t){return function(t,e,n){var s=e(t);return Ut(t)?s:function(t,e){for(var n=-1,s=e.length,i=t.length;++n<s;)t[i+n]=e[n];return t}(s,n(t))}(t,Zt,Rt)}function _t(t,e){var n,s,i=t.__data__;return("string"==(s=typeof(n=e))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Ct(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Lt(n)?n:void 0}bt.prototype.clear=function(){this.__data__=ct?ct(null):{},this.size=0},bt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},bt.prototype.get=function(t){var e=this.__data__;if(ct){var s=e[t];return s===n?void 0:s}return K.call(e,t)?e[t]:void 0},bt.prototype.has=function(t){var e=this.__data__;return ct?void 0!==e[t]:K.call(e,t)},bt.prototype.set=function(t,e){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=ct&&void 0===e?n:e,this},vt.prototype.clear=function(){this.__data__=[],this.size=0},vt.prototype.delete=function(t){var e=this.__data__,n=At(e,t);return!(n<0)&&(n==e.length-1?e.pop():J.call(e,n,1),--this.size,!0)},vt.prototype.get=function(t){var e=this.__data__,n=At(e,t);return n<0?void 0:e[n][1]},vt.prototype.has=function(t){return At(this.__data__,t)>-1},vt.prototype.set=function(t,e){var n=this.__data__,s=At(n,t);return s<0?(++this.size,n.push([t,e])):n[s][1]=e,this},yt.prototype.clear=function(){this.size=0,this.__data__={hash:new bt,map:new(rt||vt),string:new bt}},yt.prototype.delete=function(t){var e=_t(this,t).delete(t);return this.size-=e?1:0,e},yt.prototype.get=function(t){return _t(this,t).get(t)},yt.prototype.has=function(t){return _t(this,t).has(t)},yt.prototype.set=function(t,e){var n=_t(this,t),s=n.size;return n.set(t,e),this.size+=n.size==s?0:1,this},xt.prototype.add=xt.prototype.push=function(t){return this.__data__.set(t,n),this},xt.prototype.has=function(t){return this.__data__.has(t)},Nt.prototype.clear=function(){this.__data__=new vt,this.size=0},Nt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Nt.prototype.get=function(t){return this.__data__.get(t)},Nt.prototype.has=function(t){return this.__data__.has(t)},Nt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof vt){var s=n.__data__;if(!rt||s.length<199)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new yt(s)}return n.set(t,e),this.size=n.size,this};var Rt=et?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,s=null==t?0:t.length,i=0,r=[];++n<s;){var o=t[n];e(o,n,t)&&(r[i++]=o)}return r}(et(t),function(e){return Q.call(t,e)}))}:function(){return[]},It=wt;function jt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||A.test(t))&&t>-1&&t%1==0&&t<e}function Mt(t){if(null!=t){try{return V.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Bt(t,e){return t===e||t!=t&&e!=e}(it&&It(new it(new ArrayBuffer(1)))!=N||rt&&It(new rt)!=u||ot&&It(ot.resolve())!=p||lt&&It(new lt)!=m||at&&It(new at)!=y)&&(It=function(t){var e=wt(t),n=e==f?t.constructor:void 0,s=n?Mt(n):"";if(s)switch(s){case ht:return N;case ut:return u;case dt:return p;case ft:return m;case pt:return y}return e});var Dt=qt(function(){return arguments}())?qt:function(t){return Vt(t)&&K.call(t,"callee")&&!Q.call(t,"callee")},Ut=Array.isArray;var Pt=nt||function(){return!1};function Ht(t){if(!Ft(t))return!1;var e=wt(t);return e==h||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}function Ft(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Vt(t){return null!=t&&"object"==typeof t}var Kt=R?function(t){return function(e){return t(e)}}(R):function(t){return Vt(t)&&zt(t.length)&&!!w[wt(t)]};function Zt(t){return null!=(e=t)&&zt(e.length)&&!Ht(e)?Et(t):Tt(t);var e}t.exports=function(t,e){return kt(t,e)}}(ot,ot.exports);var lt=ot.exports,at={};Object.defineProperty(at,"__esModule",{value:!0});const ct=rt,ht=lt;var ut;!function(t){t.compose=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});let s=ct(e);n||(s=Object.keys(s).reduce((t,e)=>(null!=s[e]&&(t[e]=s[e]),t),{}));for(const n in t)void 0!==t[n]&&void 0===e[n]&&(s[n]=t[n]);return Object.keys(s).length>0?s:void 0},t.diff=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});const n=Object.keys(t).concat(Object.keys(e)).reduce((n,s)=>(ht(t[s],e[s])||(n[s]=void 0===e[s]?null:e[s]),n),{});return Object.keys(n).length>0?n:void 0},t.invert=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=t||{};const n=Object.keys(e).reduce((n,s)=>(e[s]!==t[s]&&void 0!==t[s]&&(n[s]=e[s]),n),{});return Object.keys(t).reduce((n,s)=>(t[s]!==e[s]&&void 0===e[s]&&(n[s]=null),n),n)},t.transform=function(t,e){if("object"!=typeof t)return e;if("object"!=typeof e)return;if(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2]))return e;const n=Object.keys(e).reduce((n,s)=>(void 0===t[s]&&(n[s]=e[s]),n),{});return Object.keys(n).length>0?n:void 0}}(ut||(ut={})),at.default=ut;var dt,ft={};Object.defineProperty(ft,"__esModule",{value:!0}),function(t){t.length=function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"object"==typeof t.retain&&null!==t.retain?1:"string"==typeof t.insert?t.insert.length:1}}(dt||(dt={})),ft.default=dt;var pt={};Object.defineProperty(pt,"__esModule",{value:!0});const gt=ft;pt.default=class{constructor(t){this.ops=t,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(t){t||(t=1/0);const e=this.ops[this.index];if(e){const n=this.offset,s=gt.default.length(e);if(t>=s-n?(t=s-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};{const s={};return e.attributes&&(s.attributes=e.attributes),"number"==typeof e.retain?s.retain=t:"object"==typeof e.retain&&null!==e.retain?s.retain=e.retain:"string"==typeof e.insert?s.insert=e.insert.substr(n,t):s.insert=e.insert,s}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?gt.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const t=this.ops[this.index];return t?"number"==typeof t.delete?"delete":"number"==typeof t.retain||"object"==typeof t.retain&&null!==t.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const t=this.offset,e=this.index,n=this.next(),s=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(s)}}return[]}},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=st,s=rt,i=lt,r=at;e.AttributeMap=r.default;const o=ft;e.Op=o.default;const l=pt;e.OpIterator=l.default;const a=String.fromCharCode(0),c=(t,e)=>{if("object"!=typeof t||null===t)throw new Error("cannot retain a ".concat(typeof t));if("object"!=typeof e||null===e)throw new Error("cannot retain a ".concat(typeof e));const n=Object.keys(t)[0];if(!n||n!==Object.keys(e)[0])throw new Error("embed types not matched: ".concat(n," != ").concat(Object.keys(e)[0]));return[n,t[n],e[n]]};class h{constructor(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}static registerEmbed(t,e){this.handlers[t]=e}static unregisterEmbed(t){delete this.handlers[t]}static getHandler(t){const e=this.handlers[t];if(!e)throw new Error('no handlers for embed type "'.concat(t,'"'));return e}insert(t,e){const n={};return"string"==typeof t&&0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))}delete(t){return t<=0?this:this.push({delete:t})}retain(t,e){if("number"==typeof t&&t<=0)return this;const n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)}push(t){let e=this.ops.length,n=this.ops[e-1];if(t=s(t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,n=this.ops[e-1],"object"!=typeof n))return this.ops.unshift(t),this;if(i(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this}chop(){const t=this.ops[this.ops.length-1];return t&&"number"==typeof t.retain&&!t.attributes&&this.ops.pop(),this}filter(t){return this.ops.filter(t)}forEach(t){this.ops.forEach(t)}map(t){return this.ops.map(t)}partition(t){const e=[],n=[];return this.forEach(s=>{(t(s)?e:n).push(s)}),[e,n]}reduce(t,e){return this.ops.reduce(t,e)}changeLength(){return this.reduce((t,e)=>e.insert?t+o.default.length(e):e.delete?t-e.delete:t,0)}length(){return this.reduce((t,e)=>t+o.default.length(e),0)}slice(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;const n=[],s=new l.default(this.ops);let i=0;for(;i<e&&s.hasNext();){let r;i<t?r=s.next(t-i):(r=s.next(e-i),n.push(r)),i+=o.default.length(r)}return new h(n)}compose(t){const e=new l.default(this.ops),n=new l.default(t.ops),s=[],o=n.peek();if(null!=o&&"number"==typeof o.retain&&null==o.attributes){let t=o.retain;for(;"insert"===e.peekType()&&e.peekLength()<=t;)t-=e.peekLength(),s.push(e.next());o.retain-t>0&&n.next(o.retain-t)}const a=new h(s);for(;e.hasNext()||n.hasNext();)if("insert"===n.peekType())a.push(n.next());else if("delete"===e.peekType())a.push(e.next());else{const t=Math.min(e.peekLength(),n.peekLength()),s=e.next(t),o=n.next(t);if(o.retain){const l={};if("number"==typeof s.retain)l.retain="number"==typeof o.retain?t:o.retain;else if("number"==typeof o.retain)null==s.retain?l.insert=s.insert:l.retain=s.retain;else{const t=null==s.retain?"insert":"retain",[e,n,i]=c(s[t],o.retain),r=h.getHandler(e);l[t]={[e]:r.compose(n,i,"retain"===t)}}const u=r.default.compose(s.attributes,o.attributes,"number"==typeof s.retain);if(u&&(l.attributes=u),a.push(l),!n.hasNext()&&i(a.ops[a.ops.length-1],l)){const t=new h(e.rest());return a.concat(t).chop()}}else"number"==typeof o.delete&&("number"==typeof s.retain||"object"==typeof s.retain&&null!==s.retain)&&a.push(o)}return a.chop()}concat(t){const e=new h(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e}diff(t,e){if(this.ops===t.ops)return new h;const s=[this,t].map(e=>e.map(n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:a;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")}).join("")),o=new h,c=n(s[0],s[1],e,!0),u=new l.default(this.ops),d=new l.default(t.ops);return c.forEach(t=>{let e=t[1].length;for(;e>0;){let s=0;switch(t[0]){case n.INSERT:s=Math.min(d.peekLength(),e),o.push(d.next(s));break;case n.DELETE:s=Math.min(e,u.peekLength()),u.next(s),o.delete(s);break;case n.EQUAL:s=Math.min(u.peekLength(),d.peekLength(),e);const t=u.next(s),l=d.next(s);i(t.insert,l.insert)?o.retain(s,r.default.diff(t.attributes,l.attributes)):o.push(l).delete(s)}e-=s}}),o.chop()}eachLine(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"\n";const n=new l.default(this.ops);let s=new h,i=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const r=n.peek(),l=o.default.length(r)-n.peekLength(),a="string"==typeof r.insert?r.insert.indexOf(e,l)-l:-1;if(a<0)s.push(n.next());else if(a>0)s.push(n.next(a));else{if(!1===t(s,n.next(1).attributes||{},i))return;i+=1,s=new h}}s.length()>0&&t(s,{},i)}invert(t){const e=new h;return this.reduce((n,s)=>{if(s.insert)e.delete(o.default.length(s));else{if("number"==typeof s.retain&&null==s.attributes)return e.retain(s.retain),n+s.retain;if(s.delete||"number"==typeof s.retain){const i=s.delete||s.retain;return t.slice(n,n+i).forEach(t=>{s.delete?e.push(t):s.retain&&s.attributes&&e.retain(o.default.length(t),r.default.invert(s.attributes,t.attributes))}),n+i}if("object"==typeof s.retain&&null!==s.retain){const i=t.slice(n,n+1),o=new l.default(i.ops).next(),[a,u,d]=c(s.retain,o.insert),f=h.getHandler(a);return e.retain({[a]:f.invert(u,d)},r.default.invert(s.attributes,o.attributes)),n+1}}return n},0),e.chop()}transform(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);const n=t,s=new l.default(this.ops),i=new l.default(n.ops),a=new h;for(;s.hasNext()||i.hasNext();)if("insert"!==s.peekType()||!e&&"insert"===i.peekType())if("insert"===i.peekType())a.push(i.next());else{const t=Math.min(s.peekLength(),i.peekLength()),n=s.next(t),o=i.next(t);if(n.delete)continue;if(o.delete)a.push(o);else{const s=n.retain,i=o.retain;let l="object"==typeof i&&null!==i?i:t;if("object"==typeof s&&null!==s&&"object"==typeof i&&null!==i){const t=Object.keys(s)[0];if(t===Object.keys(i)[0]){const n=h.getHandler(t);n&&(l={[t]:n.transform(s[t],i[t],e)})}}a.retain(l,r.default.transform(n.attributes,o.attributes,e))}}else a.retain(o.default.length(s.next()));return a.chop()}transformPosition(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=!!e;const n=new l.default(this.ops);let s=0;for(;n.hasNext()&&s<=t;){const i=n.peekLength(),r=n.peekType();n.next(),"delete"!==r?("insert"===r&&(s<t||!e)&&(t+=i),s+=i):t-=Math.min(i,t-s)}return t}}h.Op=o.default,h.OpIterator=l.default,h.AttributeMap=r.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h}(D,D.exports);var mt=D.exports,bt=r(mt);class vt extends _{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}vt.blotName="break",vt.tagName="BR";let yt=class extends M{};const xt={"&":"&","<":"<",">":">",'"':""","'":"'"};function Nt(t){return t.replace(/[&<>"']/g,t=>xt[t])}class Et extends k{static compare(t,e){const n=Et.order.indexOf(t),s=Et.order.indexOf(e);return n>=0||s>=0?n-s:t===e?0:t<e?-1:1}formatAt(t,e,n,s){if(Et.compare(this.statics.blotName,n)<0&&this.scroll.query(n,l.BLOT)){const i=this.isolate(t,e);s&&i.wrap(n,s)}else super.formatAt(t,e,n,s)}optimize(t){if(super.optimize(t),this.parent instanceof Et&&Et.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}o(Et,"allowedChildren",[Et,vt,_,yt]),o(Et,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);class At extends T{constructor(){super(...arguments),o(this,"cache",{})}delta(){return null==this.cache.delta&&(this.cache.delta=qt(this)),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,e,n,s){e<=0||(this.scroll.query(n,l.BLOCK)?t+e===this.length()&&this.format(n,s):super.formatAt(t,Math.min(e,this.length()-t-1),n,s),this.cache={})}insertAt(t,e,n){if(null!=n)return super.insertAt(t,e,n),void(this.cache={});if(0===e.length)return;const s=e.split("\n"),i=s.shift();i.length>0&&(t<this.length()-1||null==this.children.tail?super.insertAt(Math.min(t,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let r=this;s.reduce((t,e)=>(r=r.split(t,!0),r.insertAt(0,e),e.length),t+i.length)}insertBefore(t,e){const{head:n}=this.children;super.insertBefore(t,e),n instanceof vt&&n.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),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&&void 0!==arguments[1]&&arguments[1];if(e&&(0===t||t>=this.length()-1)){const e=this.clone();return 0===t?(this.parent.insertBefore(e,this),this):(this.parent.insertBefore(e,this.next),e)}const n=super.split(t,e);return this.cache={},n}}At.blotName="block",At.tagName="P",At.defaultChild=vt,At.allowedChildren=[vt,Et,_,yt];class wt extends _{attach(){super.attach(),this.attributes=new m(this.domNode)}delta(){return(new bt).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const n=this.scroll.query(t,l.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,e)}formatAt(t,e,n,s){this.format(n,s)}insertAt(t,e,n){if(null!=n)return void super.insertAt(t,e,n);const s=e.split("\n"),i=s.pop(),r=s.map(t=>{const e=this.scroll.create(At.blotName);return e.insertAt(0,t),e}),o=this.split(t);r.forEach(t=>{this.parent.insertBefore(t,o)}),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}}function qt(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.descendants(x).reduce((t,n)=>0===n.length()?t:t.insert(n.value(),kt(n,{},e)),new bt).insert("\n",kt(t))}function kt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==t?e:("formats"in t&&"function"==typeof t.formats&&(e={...e,...t.formats()},n&&delete e["code-token"]),null==t.parent||"scroll"===t.parent.statics.blotName||t.parent.statics.scope!==t.statics.scope?e:kt(t.parent,e,n))}wt.scope=l.BLOCK_BLOT;class Lt extends _{static value(){}constructor(t,e,n){super(t,e),this.selection=n,this.textNode=document.createTextNode(Lt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(t,e){if(0!==this.savedLength)return void super.format(t,e);let n=this,s=0;for(;null!=n&&n.statics.scope!==l.BLOCK_BLOT;)s+=n.offset(n.parent),n=n.parent;null!=n&&(this.savedLength=Lt.CONTENTS.length,n.optimize(),n.formatAt(s,Lt.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||null==this.parent)return null;const t=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof yt?this.prev:null,n=e?e.length():0,s=this.next instanceof yt?this.next:null,i=s?s.text:"",{textNode:r}=this,o=r.data.split(Lt.CONTENTS).join("");let l;if(r.data=Lt.CONTENTS,e)l=e,(o||s)&&(e.insertAt(e.length(),o+i),s&&s.remove());else if(s)l=s,s.insertAt(0,o);else{const t=document.createTextNode(o);l=this.scroll.create(t),this.parent.insertBefore(l,this)}if(this.remove(),t){const i=(t,i)=>e&&t===e.domNode?i:t===r?n+i-1:s&&t===s.domNode?n+o.length+i:null,a=i(t.start.node,t.start.offset),c=i(t.end.node,t.end.offset);if(null!==a&&null!==c)return{startNode:l.domNode,startOffset:a,endNode:l.domNode,endOffset:c}}return null}update(t,e){if(t.some(t=>"characterData"===t.type&&t.target===this.textNode)){const t=this.restore();t&&(e.range=t)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if("A"===e.domNode.tagName){this.savedLength=Lt.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}}o(Lt,"blotName","cursor"),o(Lt,"className","ql-cursor"),o(Lt,"tagName","span"),o(Lt,"CONTENTS","\ufeff");var Tt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function s(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function r(t,e,s,r,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var l=new i(s,r||t,o),a=n?n+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],l]:t._events[a].push(l):(t._events[a]=l,t._eventsCount++),t}function o(t,e){0===--t._eventsCount?t._events=new s:delete t._events[e]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(n=!1)),l.prototype.eventNames=function(){var t,s,i=[];if(0===this._eventsCount)return i;for(s in t=this._events)e.call(t,s)&&i.push(n?s.slice(1):s);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=n?n+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var i=0,r=s.length,o=new Array(r);i<r;i++)o[i]=s[i].fn;return o},l.prototype.listenerCount=function(t){var e=n?n+t:t,s=this._events[e];return s?s.fn?1:s.length:0},l.prototype.emit=function(t,e,s,i,r,o){var l=n?n+t:t;if(!this._events[l])return!1;var a,c,h=this._events[l],u=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),u){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,s),!0;case 4:return h.fn.call(h.context,e,s,i),!0;case 5:return h.fn.call(h.context,e,s,i,r),!0;case 6:return h.fn.call(h.context,e,s,i,r,o),!0}for(c=1,a=new Array(u-1);c<u;c++)a[c-1]=arguments[c];h.fn.apply(h.context,a)}else{var d,f=h.length;for(c=0;c<f;c++)switch(h[c].once&&this.removeListener(t,h[c].fn,void 0,!0),u){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,e);break;case 3:h[c].fn.call(h[c].context,e,s);break;case 4:h[c].fn.call(h[c].context,e,s,i);break;default:if(!a)for(d=1,a=new Array(u-1);d<u;d++)a[d-1]=arguments[d];h[c].fn.apply(h[c].context,a)}}return!0},l.prototype.on=function(t,e,n){return r(this,t,e,n,!1)},l.prototype.once=function(t,e,n){return r(this,t,e,n,!0)},l.prototype.removeListener=function(t,e,s,i){var r=n?n+t:t;if(!this._events[r])return this;if(!e)return o(this,r),this;var l=this._events[r];if(l.fn)l.fn!==e||i&&!l.once||s&&l.context!==s||o(this,r);else{for(var a=0,c=[],h=l.length;a<h;a++)(l[a].fn!==e||i&&!l[a].once||s&&l[a].context!==s)&&c.push(l[a]);c.length?this._events[r]=1===c.length?c[0]:c:o(this,r)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,t.exports=l}(Tt);var St=r(Tt.exports),Ot=new WeakMap;const _t=["error","warn","log","info"];let Ct="warn";function Rt(t){if(Ct&&_t.indexOf(t)<=_t.indexOf(Ct)){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];console[t](...n)}}function It(t){return _t.reduce((e,n)=>(e[n]=Rt.bind(console,n,t),e),{})}It.level=t=>{Ct=t},Rt.level=It.level;const jt=It("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(t=>{document.addEventListener(t,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Array.from(document.querySelectorAll(".ql-container")).forEach(t=>{const n=Ot.get(t);n&&n.emitter&&n.emitter.handleDOM(...e)})})});class Mt extends St{constructor(){super(),this.domListeners={},this.on("error",jt.error)}emit(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return jt.log.call(jt,...e),super.emit(...e)}handleDOM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];(this.domListeners[t.type]||[]).forEach(e=>{let{node:s,handler:i}=e;(t.target===s||s.contains(t.target))&&i(t,...n)})}listenDOM(t,e,n){this.domListeners[t]||(this.domListeners[t]=[]),this.domListeners[t].push({node:e,handler:n})}}o(Mt,"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"}),o(Mt,"sources",{API:"api",SILENT:"silent",USER:"user"});const Bt=It("quill:selection");class Dt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=t,this.length=e}}class Ut{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 Dt(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,Mt.sources.USER),1)}),this.emitter.on(Mt.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const t=this.getNativeRange();null!=t&&t.start.node!==this.cursor.textNode&&this.emitter.once(Mt.events.SCROLL_UPDATE,(e,n)=>{try{this.root.contains(t.start.node)&&this.root.contains(t.end.node)&&this.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset);const s=n.some(t=>"characterData"===t.type||"childList"===t.type||"attributes"===t.type&&t.target===this.root);this.update(s?Mt.sources.SILENT:e)}catch(t){}})}),this.emitter.on(Mt.events.SCROLL_OPTIMIZE,(t,e)=>{if(e.range){const{startNode:t,startOffset:n,endNode:s,endOffset:i}=e.range;this.setNativeRange(t,n,s,i),this.update(Mt.sources.SILENT)}}),this.update(Mt.sources.SILENT)}handleComposition(){this.emitter.on(Mt.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Mt.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(Mt.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(t,e){this.scroll.update();const n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!this.scroll.query(t,l.BLOCK)){if(n.start.node!==this.cursor.textNode){const t=this.scroll.find(n.start.node,!1);if(null==t)return;if(t instanceof x){const e=t.split(n.start.offset);t.parent.insertBefore(this.cursor,e)}else t.insertBefore(this.cursor,n.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&&void 0!==arguments[1]?arguments[1]:0;const n=this.scroll.length();let s;t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;let[i,r]=this.scroll.leaf(t);if(null==i)return null;if(e>0&&r===i.length()){const[e]=this.scroll.leaf(t+1);if(e){const[n]=this.scroll.line(t),[s]=this.scroll.line(t+1);n===s&&(i=e,r=0)}}[s,r]=i.position(r,!0);const o=document.createRange();if(e>0)return o.setStart(s,r),[i,r]=this.scroll.leaf(t+e),null==i?null:([s,r]=i.position(r,!0),o.setEnd(s,r),o.getBoundingClientRect());let l,a="left";if(s instanceof Text){if(!s.data.length)return null;r<s.data.length?(o.setStart(s,r),o.setEnd(s,r+1)):(o.setStart(s,r-1),o.setEnd(s,r),a="right"),l=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;l=i.domNode.getBoundingClientRect(),r>0&&(a="right")}return{bottom:l.top+l.height,height:l.height,left:l[a],right:l[a],top:l.top,width:0}}getNativeRange(){const t=document.getSelection();if(null==t||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(null==e)return null;const n=this.normalizeNative(e);return Bt.info("getNativeRange",n),n}getRange(){const t=this.scroll.domNode;if("isConnected"in t&&!t.isConnected)return[null,null];const e=this.getNativeRange();if(null==e)return[null,null];return[this.normalizedToRange(e),e]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&Pt(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 n=e.map(t=>{const[e,n]=t,s=this.scroll.find(e,!0),i=s.offset(this.scroll);return 0===n?i:s instanceof x?i+s.index(e,n):i+s.length()}),s=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(s,...n);return new Dt(i,s-i)}normalizeNative(t){if(!Pt(this.root,t.startContainer)||!t.collapsed&&!Pt(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(t=>{let{node:e,offset:n}=t;for(;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length>0?e.childNodes.length:e.childNodes.length+1}t.node=e,t.offset=n}),e}rangeToNative(t){const e=this.scroll.length(),n=(t,n)=>{t=Math.min(e-1,t);const[s,i]=this.scroll.leaf(t);return s?s.position(i,n):[null,-1]};return[...n(t.index,!1),...n(t.index+t.length,!0)]}setNativeRange(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Bt.info("setNativeRange",t,e,n,s),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==n.parentNode))return;const r=document.getSelection();if(null!=r)if(null!=t){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(null==o||i||t!==o.startContainer||e!==o.startOffset||n!==o.endContainer||s!==o.endOffset){t instanceof Element&&"BR"===t.tagName&&(e=Array.from(t.parentNode.childNodes).indexOf(t),t=t.parentNode),n instanceof Element&&"BR"===n.tagName&&(s=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const i=document.createRange();i.setStart(t,e),i.setEnd(n,s),r.removeAllRanges(),r.addRange(i)}}else r.removeAllRanges(),this.root.blur()}setRange(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mt.sources.API;if("string"==typeof e&&(n=e,e=!1),Bt.info("setRange",t),null!=t){const n=this.rangeToNative(t);this.setNativeRange(...n,e)}else this.setNativeRange(null);this.update(n)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt.sources.USER;const s=this.lastRange,[i,r]=this.getRange();if(this.lastRange=i,this.lastNative=r,null!=this.lastRange&&(this.savedRange=this.lastRange),!e(s,this.lastRange)){if(!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const t=this.cursor.restore();t&&this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}const e=[Mt.events.SELECTION_CHANGE,n(this.lastRange),n(s),t];this.emitter.emit(Mt.events.EDITOR_CHANGE,...e),t!==Mt.sources.SILENT&&this.emitter.emit(...e)}}}function Pt(t,e){try{e.parentNode}catch(t){return!1}return t.contains(e)}const Ht=/^[ -~]*$/;class zt{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){this.scroll.update();let e=this.scroll.length();this.scroll.batchStart();const n=Wt(t),i=new bt;return function(t){const e=[];return t.forEach(t=>{if("string"==typeof t.insert){t.insert.split("\n").forEach((n,s)=>{s&&e.push({insert:"\n",attributes:t.attributes}),n&&e.push({insert:n,attributes:t.attributes})})}else e.push(t)}),e}(n.ops.slice()).reduce((t,n)=>{const r=mt.Op.length(n);let o=n.attributes||{},a=!1,c=!1;if(null!=n.insert){if(i.retain(r),"string"==typeof n.insert){const i=n.insert;c=!i.endsWith("\n")&&(e<=t||!!this.scroll.descendant(wt,t)[0]),this.scroll.insertAt(t,i);const[r,l]=this.scroll.line(t);let a=s({},kt(r));if(r instanceof At){const[t]=r.descendant(x,l);t&&(a=s(a,kt(t)))}o=mt.AttributeMap.diff(a,o)||{}}else if("object"==typeof n.insert){const i=Object.keys(n.insert)[0];if(null==i)return t;const r=null!=this.scroll.query(i,l.INLINE);if(r)(e<=t||this.scroll.descendant(wt,t)[0])&&(c=!0);else if(t>0){const[e,n]=this.scroll.descendant(x,t-1);if(e instanceof yt){"\n"!==e.value()[n]&&(a=!0)}else e instanceof _&&e.statics.scope===l.INLINE_BLOT&&(a=!0)}if(this.scroll.insertAt(t,i,n.insert[i]),r){const[e]=this.scroll.descendant(x,t);if(e){const t=s({},kt(e));o=mt.AttributeMap.diff(t,o)||{}}}}e+=r}else if(i.push(n),null!==n.retain&&"object"==typeof n.retain){const e=Object.keys(n.retain)[0];if(null==e)return t;this.scroll.updateEmbedAt(t,e,n.retain[e])}Object.keys(o).forEach(e=>{this.scroll.formatAt(t,r,e,o[e])});const h=a?1:0,u=c?1:0;return e+=h+u,i.retain(h),i.delete(u),t+r+h+u},0),i.reduce((t,e)=>"number"==typeof e.delete?(this.scroll.deleteAt(t,e.delete),t):t+mt.Op.length(e),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update((new bt).retain(t).delete(e))}formatLine(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(s).forEach(n=>{this.scroll.lines(t,Math.max(e,1)).forEach(t=>{t.format(n,s[n])})}),this.scroll.optimize();const i=(new bt).retain(t).retain(e,n(s));return this.update(i)}formatText(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(s).forEach(n=>{this.scroll.formatAt(t,e,n,s[n])});const i=(new bt).retain(t).retain(e,n(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 bt)}getFormat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],s=[];0===e?this.scroll.path(t).forEach(t=>{const[e]=t;e instanceof At?n.push(e):e instanceof x&&s.push(e)}):(n=this.scroll.lines(t,e),s=this.scroll.descendants(x,t,e));const[i,r]=[n,s].map(t=>{const e=t.shift();if(null==e)return{};let n=kt(e);for(;Object.keys(n).length>0;){const e=t.shift();if(null==e)return n;n=Kt(kt(e),n)}return n});return{...i,...r}}getHTML(t,e){const[n,s]=this.scroll.line(t);if(n){const i=n.length();return!(n.length()>=s+e)||0===s&&e===i?Vt(this.scroll,t,e,!0):Vt(n,s,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(t=>"string"==typeof t.insert).map(t=>t.insert).join("")}insertContents(t,e){const n=Wt(e),s=(new bt).retain(t).concat(n);return this.scroll.insertContents(t,n),this.update(s)}insertEmbed(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new bt).retain(t).insert({[e]:n}))}insertText(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(s).forEach(n=>{this.scroll.formatAt(t,e.length,n,s[n])}),this.update((new bt).retain(t).insert(e,n(s)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if((null==t?void 0:t.statics.blotName)!==At.blotName)return!1;const e=t;return!(e.children.length>1)&&e.children.head instanceof vt}removeFormat(t,e){const n=this.getText(t,e),[s,i]=this.scroll.line(t+e);let r=0,o=new bt;null!=s&&(r=s.length()-i,o=s.delta().slice(i,i+r-1).insert("\n"));const l=this.getContents(t,e+r).diff((new bt).insert(n).concat(o)),a=(new bt).retain(t).concat(l);return this.applyDelta(a)}update(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=this.delta;if(1===n.length&&"characterData"===n[0].type&&n[0].target.data.match(Ht)&&this.scroll.find(n[0].target)){const e=this.scroll.find(n[0].target),r=kt(e),o=e.offset(this.scroll),l=n[0].oldValue.replace(Lt.CONTENTS,""),a=(new bt).insert(l),c=(new bt).insert(e.value()),h=s&&{oldRange:Gt(s.oldRange,-o),newRange:Gt(s.newRange,-o)};t=(new bt).retain(o).concat(a.diff(c,h)).reduce((t,e)=>e.insert?t.insert(e.insert,r):t.push(e),new bt),this.delta=i.compose(t)}else this.delta=this.getDelta(),t&&e(i.compose(t),this.delta)||(t=i.diff(this.delta,s));return t}}function Ft(t,e,n){if(0===t.length){const[t]=Zt(n.pop());return e<=0?"</li></".concat(t,">"):"</li></".concat(t,">").concat(Ft([],e-1,n))}const[{child:s,offset:i,length:r,indent:o,type:l},...a]=t,[c,h]=Zt(l);if(o>e)return n.push(l),o===e+1?"<".concat(c,"><li").concat(h,">").concat(Vt(s,i,r)).concat(Ft(a,o,n)):"<".concat(c,"><li>").concat(Ft(t,e+1,n));const u=n[n.length-1];if(o===e&&l===u)return"</li><li".concat(h,">").concat(Vt(s,i,r)).concat(Ft(a,o,n));const[d]=Zt(n.pop());return"</li></".concat(d,">").concat(Ft(t,e-1,n))}function Vt(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in t&&"function"==typeof t.html)return t.html(e,n);if(t instanceof yt){return Nt(t.value().slice(e,e+n)).replaceAll(" "," ")}if(t instanceof w){if("list-container"===t.statics.blotName){const s=[];return t.children.forEachAt(e,n,(t,e,n)=>{const i="formats"in t&&"function"==typeof t.formats?t.formats():{};s.push({child:t,offset:e,length:n,indent:i.indent||0,type:i.list})}),Ft(s,-1,[])}const i=[];if(t.children.forEachAt(e,n,(t,e,n)=>{i.push(Vt(t,e,n))}),s||"list"===t.statics.blotName)return i.join("");const{outerHTML:r,innerHTML:o}=t.domNode,[l,a]=r.split(">".concat(o,"<"));return"<table"===l?'<table style="border: 1px solid #000;">'.concat(i.join(""),"<").concat(a):"".concat(l,">").concat(i.join(""),"<").concat(a)}return t.domNode instanceof Element?t.domNode.outerHTML:""}function Kt(t,e){return Object.keys(e).reduce((n,s)=>{if(null==t[s])return n;const i=e[s];return i===t[s]?n[s]=i:Array.isArray(i)?i.indexOf(t[s])<0?n[s]=i.concat([t[s]]):n[s]=i:n[s]=[i,t[s]],n},{})}function Zt(t){const e="ordered"===t?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Wt(t){return t.reduce((t,e)=>{if("string"==typeof e.insert){const n=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(n,e.attributes)}return t.push(e)},new bt)}function Gt(t,e){let{index:n,length:s}=t;return new Dt(n+e,s)}class $t{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=t,this.options=e}}o($t,"DEFAULTS",{});const Xt="\ufeff";class Yt extends _{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(t=>{this.contentNode.appendChild(t)}),this.leftGuard=document.createTextNode(Xt),this.rightGuard=document.createTextNode(Xt),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,n=null;const s=t.data.split(Xt).join("");if(t===this.leftGuard)if(this.prev instanceof yt){const t=this.prev.length();this.prev.insertAt(t,s),n={startNode:this.prev.domNode,startOffset:t+s.length}}else e=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(e),this),n={startNode:e,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof yt?(this.next.insertAt(0,s),n={startNode:this.next.domNode,startOffset:s.length}):(e=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(e),this.next),n={startNode:e,startOffset:s.length}));return t.data=Xt,n}update(t,e){t.forEach(t=>{if("characterData"===t.type&&(t.target===this.leftGuard||t.target===this.rightGuard)){const n=this.restore(t.target);n&&(e.range=n)}})}}class Qt{constructor(t,e){o(this,"isComposing",!1),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 Yt||(this.emitter.emit(Mt.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(Mt.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(Mt.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(Mt.events.COMPOSITION_END,t),this.isComposing=!1}}var Jt;class te{constructor(t,e){o(this,"modules",{}),this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach(t=>{null==this.modules[t]&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import("modules/".concat(t));return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}Jt=te,o(te,"DEFAULTS",{modules:{}}),o(te,"themes",{default:Jt});const ee=t=>t.parentElement||t.getRootNode().host||null,ne=t=>{const e=t.getBoundingClientRect(),n="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1,s="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*n,bottom:e.top+t.clientHeight*s,left:e.left}},se=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},ie=(t,e,n,s,i,r)=>t<n&&e>s?0:t<n?-(n-t+i):e>s?e-t>s-n?t+i-n:e-s+r:0,re=["block","break","cursor","inline","scroll","text"],oe=It("quill"),le=new u;w.uiClass="ql-ui";class ae{static debug(t){!0===t&&(t="log"),It.level(t)}static find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ot.get(t)||le.find(t,e)}static import(t){return null==this.imports[t]&&oe.error("Cannot import ".concat(t,". Are you sure it was registered?")),this.imports[t]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const t=arguments.length<=0?void 0:arguments[0],e=!!(arguments.length<=1?void 0:arguments[1]),n="attrName"in t?t.attrName:t.blotName;"string"==typeof n?this.register("formats/".concat(n),t,e):Object.keys(t).forEach(n=>{this.register(n,t[n],e)})}else{const t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],n=!!(arguments.length<=2?void 0:arguments[2]);null==this.imports[t]||n||oe.warn("Overwriting ".concat(t," with"),e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&e&&"boolean"!=typeof e&&"abstract"!==e.blotName&&le.register(e),"function"==typeof e.register&&e.register(le)}}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(t,e){const n=ce(t);if(!n)throw new Error("Invalid Quill container");const i=!e.theme||e.theme===ae.DEFAULTS.theme,r=i?te:ae.import("themes/".concat(e.theme));if(!r)throw new Error("Invalid theme ".concat(e.theme,". Did you register it?"));const{modules:o,...l}=ae.DEFAULTS,{modules:a,...c}=r.DEFAULTS;let h=he(e.modules);null!=h&&h.toolbar&&h.toolbar.constructor!==Object&&(h={...h,toolbar:{container:h.toolbar}});const d=s({},he(o),he(a),h),f={...l,...ue(c),...ue(e)};let p=e.registry;p?e.formats&&oe.warn('Ignoring "formats" option because "registry" is specified'):p=e.formats?((t,e,n)=>{const s=new u;return re.forEach(t=>{const n=e.query(t);n&&s.register(n)}),t.forEach(t=>{let i=e.query(t);i||n.error('Cannot register "'.concat(t,'" specified in "formats" config. Are you sure it was registered?'));let r=0;for(;i;){var o;if(s.register(i),i="blotName"in i&&null!==(o=i.requiredContainer)&&void 0!==o?o:null,r+=1,r>100){n.error('Cycle detected in registering blot requiredContainer: "'.concat(t,'"'));break}}}),s})(e.formats,f.registry,oe):f.registry;return{...f,registry:p,container:n,theme:r,modules:Object.entries(d).reduce((t,e)=>{let[n,i]=e;if(!i)return t;const r=ae.import("modules/".concat(n));return null==r?(oe.error("Cannot load ".concat(n," module. Are you sure you registered it?")),t):{...t,[n]:s({},r.DEFAULTS||{},i)}},{}),bounds:ce(f.bounds)}}(t,e),this.container=this.options.container,null==this.container)return void oe.error("Invalid Quill container",t);this.options.debug&&ae.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Ot.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Mt;const i=I.blotName,r=this.options.registry.query(i);if(!r||!("blotName"in r))throw new Error('Cannot initialize Quill without "'.concat(i,'" blot'));if(this.scroll=new r(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new zt(this.scroll),this.selection=new Ut(this.scroll,this.emitter),this.composition=new Qt(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(Mt.events.EDITOR_CHANGE,t=>{t===Mt.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Mt.events.SCROLL_UPDATE,(t,e)=>{const n=this.selection.lastRange,[s]=this.selection.getRange(),i=n&&s?{oldRange:n,newRange:s}:void 0;de.call(this,()=>this.editor.update(null,e,i),t)}),this.emitter.on(Mt.events.SCROLL_EMBED_UPDATE,(t,e)=>{const n=this.selection.lastRange,[s]=this.selection.getRange(),i=n&&s?{oldRange:n,newRange:s}:void 0;de.call(this,()=>{const n=(new bt).retain(t.offset(this)).retain({[t.statics.blotName]:e});return this.editor.update(n,[],i)},ae.sources.USER)}),n){const t=this.clipboard.convert({html:"".concat(n,"<p><br></p>"),text:"\n"});this.setContents(t)}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&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){const e=t;(t=document.createElement("div")).classList.add(e)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,n){return[t,e,,n]=fe(t,e,n),de.call(this,()=>this.editor.deleteText(t,e),n,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&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mt.sources.API;return de.call(this,()=>{const n=this.getSelection(!0);let s=new bt;if(null==n)return s;if(this.scroll.query(t,l.BLOCK))s=this.editor.formatLine(n.index,n.length,{[t]:e});else{if(0===n.length)return this.selection.format(t,e),s;s=this.editor.formatText(n.index,n.length,{[t]:e})}return this.setSelection(n,Mt.sources.SILENT),s},n)}formatLine(t,e,n,s,i){let r;return[t,e,r,i]=fe(t,e,n,s,i),de.call(this,()=>this.editor.formatLine(t,e,r),i,t,0)}formatText(t,e,n,s,i){let r;return[t,e,r,i]=fe(t,e,n,s,i),de.call(this,()=>this.editor.formatText(t,e,r),i,t,0)}getBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length),!n)return null;const s=this.container.getBoundingClientRect();return{bottom:n.bottom-s.top,height:n.height,left:n.left-s.left,right:n.right-s.left,top:n.top-s.top,width:n.width}}getContents(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;return[t,e]=fe(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?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&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return"number"==typeof t&&(e=null!=e?e:this.getLength()-t),[t,e]=fe(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return"number"==typeof t&&(e=null!=e?e:this.getLength()-t),[t,e]=fe(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ae.sources.API;return de.call(this,()=>this.editor.insertEmbed(t,e,n),s,t)}insertText(t,e,n,s,i){let r;return[t,,r,i]=fe(t,0,n,s,i),de.call(this,()=>this.editor.insertText(t,e,r),i,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,n){return[t,e,,n]=fe(t,e,n),de.call(this,()=>this.editor.removeFormat(t,e),n,t)}scrollRectIntoView(t){((t,e)=>{const n=t.ownerDocument;let s=e,i=t;for(;i;){var r,o,l,a;const t=i===n.body,e=t?{top:0,right:null!==(r=null===(o=window.visualViewport)||void 0===o?void 0:o.width)&&void 0!==r?r:n.documentElement.clientWidth,bottom:null!==(l=null===(a=window.visualViewport)||void 0===a?void 0:a.height)&&void 0!==l?l:n.documentElement.clientHeight,left:0}:ne(i),h=getComputedStyle(i),u=ie(s.left,s.right,e.left,e.right,se(h.scrollPaddingLeft),se(h.scrollPaddingRight)),d=ie(s.top,s.bottom,e.top,e.bottom,se(h.scrollPaddingTop),se(h.scrollPaddingBottom));if(u||d)if(t){var c;null===(c=n.defaultView)||void 0===c||c.scrollBy(u,d)}else{const{scrollLeft:t,scrollTop:e}=i;d&&(i.scrollTop+=d),u&&(i.scrollLeft+=u);const n=i.scrollLeft-t,r=i.scrollTop-e;s={left:s.left-n,top:s.top-r,right:s.right-n,bottom:s.bottom-r}}i=t||"fixed"===h.position?null:ee(i)}})(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&&void 0!==arguments[1]?arguments[1]:Mt.sources.API;return de.call(this,()=>{t=new bt(t);const e=this.getLength(),n=this.editor.deleteText(0,e),s=this.editor.insertContents(0,t),i=this.editor.deleteText(this.getLength()-1,1);return n.compose(s).compose(i)},e)}setSelection(t,e,n){null==t?this.selection.setRange(null,e||ae.sources.API):([t,e,,n]=fe(t,e,n),this.selection.setRange(new Dt(Math.max(0,t),e),n),n!==Mt.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mt.sources.API;const n=(new bt).insert(t);return this.setContents(n,e)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt.sources.USER;const e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mt.sources.API;return de.call(this,()=>(t=new bt(t),this.editor.applyDelta(t)),e,!0)}}function ce(t){return"string"==typeof t?document.querySelector(t):t}function he(t){return Object.entries(null!=t?t:{}).reduce((t,e)=>{let[n,s]=e;return{...t,[n]:!0===s?{}:s}},{})}function ue(t){return Object.fromEntries(Object.entries(t).filter(t=>void 0!==t[1]))}function de(t,e,n,s){if(!this.isEnabled()&&e===Mt.sources.USER&&!this.allowReadOnlyEdits)return new bt;let i=null==n?null:this.getSelection();const r=this.editor.delta,o=t();if(null!=i&&(!0===n&&(n=i.index),null==s?i=pe(i,o,e):0!==s&&(i=pe(i,n,s,e)),this.setSelection(i,Mt.sources.SILENT)),o.length()>0){const t=[Mt.events.TEXT_CHANGE,o,r,e];this.emitter.emit(Mt.events.EDITOR_CHANGE,...t),e!==Mt.sources.SILENT&&this.emitter.emit(...t)}return o}function fe(t,e,n,s,i){let r={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(i=s,s=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(i=s,s=n,n=e,e=0),"object"==typeof n?(r=n,i=s):"string"==typeof n&&(null!=s?r[n]=s:i=n),[t,e,r,i=i||Mt.sources.API]}function pe(t,e,n,s){const i="number"==typeof n?n:0;if(null==t)return null;let r,o;return e&&"function"==typeof e.transformPosition?[r,o]=[t.index,t.index+t.length].map(t=>e.transformPosition(t,s!==Mt.sources.USER)):[r,o]=[t.index,t.index+t.length].map(t=>t<e||t===e&&s===Mt.sources.USER?t:i>=0?t+i:Math.max(e,t+i)),new Dt(r,o-r)}t("Q",ae),o(ae,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:le,theme:"default"}),o(ae,"events",Mt.events),o(ae,"sources",Mt.sources),o(ae,"version","2.0.3"),o(ae,"imports",{delta:bt,parchment:B,"core/module":$t,"core/theme":te});class ge extends O{}function me(t){return t instanceof At||t instanceof wt}function be(t){return"function"==typeof t.updateContent}class ve extends I{constructor(t,e,n){let{emitter:s}=n;super(t,e),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",t=>this.handleDragStart(t))}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(Mt.events.SCROLL_BLOT_MOUNT,t)}emitUnmount(t){this.emitter.emit(Mt.events.SCROLL_BLOT_UNMOUNT,t)}emitEmbedUpdate(t,e){this.emitter.emit(Mt.events.SCROLL_EMBED_UPDATE,t,e)}deleteAt(t,e){const[n,s]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),null!=i&&n!==i&&s>0){if(n instanceof wt||i instanceof wt)return void this.optimize();const t=i.children.head instanceof vt?null:i.children.head;n.moveChildren(i,t),n.remove()}this.optimize()}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t?"true":"false")}formatAt(t,e,n,s){super.formatAt(t,e,n,s),this.optimize()}insertAt(t,e,n){if(t>=this.length())if(null==n||null==this.scroll.query(e,l.BLOCK)){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t),null==n&&e.endsWith("\n")?t.insertAt(0,e.slice(0,-1),n):t.insertAt(0,e,n)}else{const t=this.scroll.create(e,n);this.appendChild(t)}else super.insertAt(t,e,n);this.optimize()}insertBefore(t,e){if(t.statics.scope===l.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(t),super.insertBefore(n,e)}else super.insertBefore(t,e)}insertContents(t,e){const n=this.deltaToRenderBlocks(e.concat((new bt).insert("\n"))),s=n.pop();if(null==s)return;this.batchStart();const i=n.shift();if(i){const e="block"===i.type&&(0===i.delta.length()||!this.descendant(wt,t)[0]&&t<this.length()),n="block"===i.type?i.delta:(new bt).insert({[i.key]:i.value});ye(this,t,n);const s="block"===i.type?1:0,r=t+n.length()+s;e&&this.insertAt(r-1,"\n");const o=kt(this.line(t)[0]),l=mt.AttributeMap.diff(o,i.attributes)||{};Object.keys(l).forEach(t=>{this.formatAt(r-1,1,t,l[t])}),t=r}let[r,o]=this.children.find(t);if(n.length&&(r&&(r=r.split(o),o=0),n.forEach(t=>{if("block"===t.type){ye(this.createBlock(t.attributes,r||void 0),0,t.delta)}else{const e=this.create(t.key,t.value);this.insertBefore(e,r||void 0),Object.keys(t.attributes).forEach(n=>{e.format(n,t.attributes[n])})}})),"block"===s.type&&s.delta.length()){ye(this,r?r.offset(r.scroll)+o:this.length(),s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[n,s]=e;return n instanceof x?[n,s]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(me,t)}lines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const n=(t,e,s)=>{let i=[],r=s;return t.children.forEachAt(e,s,(t,e,s)=>{me(t)?i.push(t):t instanceof O&&(i=i.concat(n(t,e,r))),r-=s}),i};return n(this,t,e)}optimize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(Mt.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch)return void(Array.isArray(t)&&(this.batch=this.batch.concat(t)));let e=Mt.sources.USER;"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),(t=t.filter(t=>{let{target:e}=t;const n=this.find(e,!0);return n&&!be(n)})).length>0&&this.emitter.emit(Mt.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(Mt.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,n){const[s]=this.descendant(t=>t instanceof wt,t);s&&s.statics.blotName===e&&be(s)&&s.updateContent(n)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let n=new bt;return t.forEach(t=>{const s=null==t?void 0:t.insert;if(s)if("string"==typeof s){const i=s.split("\n");i.slice(0,-1).forEach(s=>{var i;n.insert(s,t.attributes),e.push({type:"block",delta:n,attributes:null!==(i=t.attributes)&&void 0!==i?i:{}}),n=new bt});const r=i[i.length-1];r&&n.insert(r,t.attributes)}else{const r=Object.keys(s)[0];if(!r)return;var i;if(this.query(r,l.INLINE))n.push(t);else n.length()&&e.push({type:"block",delta:n,attributes:{}}),n=new bt,e.push({type:"blockEmbed",key:r,value:s[r],attributes:null!==(i=t.attributes)&&void 0!==i?i:{}})}}),n.length()&&e.push({type:"block",delta:n,attributes:{}}),e}createBlock(t,e){let n;const s={};Object.entries(t).forEach(t=>{let[e,i]=t;null!=this.query(e,l.BLOCK&l.BLOT)?n=e:s[e]=i});const i=this.create(n||this.statics.defaultChild.blotName,n?t[n]:void 0);this.insertBefore(i,e||void 0);const r=i.length();return Object.entries(s).forEach(t=>{let[e,n]=t;i.formatAt(0,r,e,n)}),i}}function ye(t,e,n){n.reduce((e,n)=>{const s=mt.Op.length(n);let i=n.attributes||{};if(null!=n.insert)if("string"==typeof n.insert){const s=n.insert;t.insertAt(e,s);const[r]=t.descendant(x,e),o=kt(r);i=mt.AttributeMap.diff(o,i)||{}}else if("object"==typeof n.insert){const s=Object.keys(n.insert)[0];if(null==s)return e;t.insertAt(e,s,n.insert[s]);if(null!=t.scroll.query(s,l.INLINE)){const[n]=t.descendant(x,e),s=kt(n);i=mt.AttributeMap.diff(s,i)||{}}}return Object.keys(i).forEach(n=>{t.formatAt(e,s,n,i[n])}),e+s},e)}o(ve,"blotName","scroll"),o(ve,"className","ql-editor"),o(ve,"tagName","DIV"),o(ve,"defaultChild",At),o(ve,"allowedChildren",[At,wt,ge]);const xe={scope:l.BLOCK,whitelist:["right","center","justify"]},Ne=new a("align","align",xe),Ee=new f("align","ql-align",xe),Ae=new g("align","text-align",xe);class we extends g{value(t){let e=super.value(t);if(!e.startsWith("rgb("))return e;e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"");const n=e.split(",").map(t=>"00".concat(parseInt(t,10).toString(16)).slice(-2)).join("");return"#".concat(n)}}const qe=new f("color","ql-color",{scope:l.INLINE}),ke=new we("color","color",{scope:l.INLINE}),Le=new f("background","ql-bg",{scope:l.INLINE}),Te=new we("background","background-color",{scope:l.INLINE});class Se extends ge{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(t=>t.length()<=1?"":t.domNode.innerText).join("\n").slice(t,t+e)}html(t,e){return"<pre>\n".concat(Nt(this.code(t,e)),"\n</pre>")}}class Oe extends At{static register(){ae.register(Se)}}o(Oe,"TAB"," ");class _e extends Et{}_e.blotName="code",_e.tagName="CODE",Oe.blotName="code-block",Oe.className="ql-code-block",Oe.tagName="DIV",Se.blotName="code-block-container",Se.className="ql-code-block-container",Se.tagName="DIV",Se.allowedChildren=[Oe],Oe.allowedChildren=[yt,vt,Lt],Oe.requiredContainer=Se;const Ce={scope:l.BLOCK,whitelist:["rtl"]},Re=new a("direction","dir",Ce),Ie=new f("direction","ql-direction",Ce),je=new g("direction","direction",Ce),Me={scope:l.INLINE,whitelist:["serif","monospace"]},Be=new f("font","ql-font",Me);const De=new class extends g{value(t){return super.value(t).replace(/["']/g,"")}}("font","font-family",Me),Ue=new f("size","ql-size",{scope:l.INLINE,whitelist:["small","large","huge"]}),Pe=new g("size","font-size",{scope:l.INLINE,whitelist:["10px","18px","32px"]}),He=It("quill:keyboard"),ze=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Fe extends $t{static match(t,e){return!["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!e[n]!==t[n]&&null!==e[n])&&(e.key===t.key||e.key===t.which)}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(t=>{this.options.bindings[t]&&this.addBinding(this.options.bindings[t])}),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&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(t){if("string"==typeof t||"number"==typeof t)t={key:t};else{if("object"!=typeof t)return null;t=n(t)}t.shortKey&&(t[ze]=t.shortKey,delete t.shortKey);return t}(t);if(null==i)return void He.warn("Attempted to add invalid keyboard binding",i);"function"==typeof e&&(e={handler:e}),"function"==typeof s&&(s={handler:s});(Array.isArray(i.key)?i.key:[i.key]).forEach(t=>{const n={...i,key:t,...e,...s};this.bindings[n.key]=this.bindings[n.key]||[],this.bindings[n.key].push(n)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing)return;if(229===t.keyCode&&("Enter"===t.key||"Backspace"===t.key))return;const n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(e=>Fe.match(t,e));if(0===n.length)return;const s=ae.find(t.target,!0);if(s&&s.scroll!==this.quill.scroll)return;const i=this.quill.getSelection();if(null==i||!this.quill.hasFocus())return;const[r,o]=this.quill.getLine(i.index),[l,a]=this.quill.getLeaf(i.index),[c,h]=0===i.length?[l,a]:this.quill.getLeaf(i.index+i.length),u=l instanceof M?l.value().slice(0,a):"",d=c instanceof M?c.value().slice(h):"",f={collapsed:0===i.length,empty:0===i.length&&r.length()<=1,format:this.quill.getFormat(i),line:r,offset:o,prefix:u,suffix:d,event:t};n.some(t=>{if(null!=t.collapsed&&t.collapsed!==f.collapsed)return!1;if(null!=t.empty&&t.empty!==f.empty)return!1;if(null!=t.offset&&t.offset!==f.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(t=>null==f.format[t]))return!1}else if("object"==typeof t.format&&!Object.keys(t.format).every(n=>!0===t.format[n]?null!=f.format[n]:!1===t.format[n]?null==f.format[n]:e(t.format[n],f.format[n])))return!1;return!(null!=t.prefix&&!t.prefix.test(f.prefix))&&(!(null!=t.suffix&&!t.suffix.test(f.suffix))&&!0!==t.handler.call(this,i,f,t))})&&t.preventDefault()})}handleBackspace(t,e){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(0===t.index||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(t.index);let r=(new bt).retain(t.index-n).delete(n);if(0===e.offset){const[e]=this.quill.getLine(t.index-1);if(e){if(!("block"===e.statics.blotName&&e.length()<=1)){const e=i.formats(),n=this.quill.getFormat(t.index-1,1);if(s=mt.AttributeMap.diff(e,n)||{},Object.keys(s).length>0){const e=(new bt).retain(t.index+i.length()-2).retain(1,s);r=r.compose(e)}}}}this.quill.updateContents(r,ae.sources.USER),this.quill.focus()}handleDelete(t,e){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-n)return;let s={};const[i]=this.quill.getLine(t.index);let r=(new bt).retain(t.index).delete(n);if(e.offset>=i.length()-1){const[e]=this.quill.getLine(t.index+1);if(e){const n=i.formats(),o=this.quill.getFormat(t.index,1);s=mt.AttributeMap.diff(n,o)||{},Object.keys(s).length>0&&(r=r.retain(e.length()-1).retain(1,s))}}this.quill.updateContents(r,ae.sources.USER),this.quill.focus()}handleDeleteRange(t){$e({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const n=Object.keys(e.format).reduce((t,n)=>(this.quill.scroll.query(n,l.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t),{}),s=(new bt).retain(t.index).delete(t.length).insert("\n",n);this.quill.updateContents(s,ae.sources.USER),this.quill.setSelection(t.index+1,ae.sources.SILENT),this.quill.focus()}}const Ve={bindings:{bold:We("bold"),italic:We("italic"),underline:We("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","+1",ae.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return!(!e.collapsed||0===e.offset)||(this.quill.format("indent","-1",ae.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){null!=e.format.indent?this.quill.format("indent","-1",ae.sources.USER):null!=e.format.list&&this.quill.format("list",!1,ae.sources.USER)}},"indent code-block":Ke(!0),"outdent code-block":Ke(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,ae.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const n=(new bt).retain(t.index).delete(t.length).insert("\t");return this.quill.updateContents(n,ae.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,ae.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,ae.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const n={list:!1};e.format.indent&&(n.indent=!1),this.quill.formatLine(t.index,t.length,n,ae.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){const[e,n]=this.quill.getLine(t.index),s={...e.formats(),list:"checked"},i=(new bt).retain(t.index).insert("\n",s).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,ae.sources.USER),this.quill.setSelection(t.index+1,ae.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){const[n,s]=this.quill.getLine(t.index),i=(new bt).retain(t.index).insert("\n",e.format).retain(n.length()-s-1).retain(1,{header:null});this.quill.updateContents(i,ae.sources.USER),this.quill.setSelection(t.index+1,ae.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(t){const e=this.quill.getModule("table");if(e){const[n,s,i,r]=e.getTable(t),o=function(t,e,n,s){if(null==e.prev&&null==e.next)return null==n.prev&&null==n.next?0===s?-1:1:null==n.prev?-1:1;if(null==e.prev)return-1;if(null==e.next)return 1;return null}(0,s,i,r);if(null==o)return;let l=n.offset();if(o<0){const e=(new bt).retain(l).insert("\n");this.quill.updateContents(e,ae.sources.USER),this.quill.setSelection(t.index+1,t.length,ae.sources.SILENT)}else if(o>0){l+=n.length();const t=(new bt).retain(l).insert("\n");this.quill.updateContents(t,ae.sources.USER),this.quill.setSelection(l,ae.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:n,line:s}=e,i=s.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(i-1,ae.sources.USER):this.quill.setSelection(i+s.length(),ae.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(null==this.quill.scroll.query("list"))return!0;const{length:n}=e.prefix,[s,i]=this.quill.getLine(t.index);if(i>n)return!0;let r;switch(e.prefix.trim()){case"[]":case"[ ]":r="unchecked";break;case"[x]":r="checked";break;case"-":case"*":r="bullet";break;default:r="ordered"}this.quill.insertText(t.index," ",ae.sources.USER),this.quill.history.cutoff();const o=(new bt).retain(t.index-i).delete(n+1).retain(s.length()-2-i).retain(1,{list:r});return this.quill.updateContents(o,ae.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,ae.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,n]=this.quill.getLine(t.index);let s=2,i=e;for(;null!=i&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,s-=1,s<=0){const s=(new bt).retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(s,ae.sources.USER),this.quill.setSelection(t.index-1,ae.sources.SILENT),!1}return!0}},"embed left":Ze("ArrowLeft",!1),"embed left shift":Ze("ArrowLeft",!0),"embed right":Ze("ArrowRight",!1),"embed right shift":Ze("ArrowRight",!0),"table down":Ge(!1),"table up":Ge(!0)}};function Ke(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e,n){let{event:s}=n;const i=this.quill.scroll.query("code-block"),{TAB:r}=i;if(0===e.length&&!s.shiftKey)return this.quill.insertText(e.index,r,ae.sources.USER),void this.quill.setSelection(e.index+r.length,ae.sources.SILENT);const o=0===e.length?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:l,length:a}=e;o.forEach((e,n)=>{t?(e.insertAt(0,r),0===n?l+=r.length:a+=r.length):e.domNode.textContent.startsWith(r)&&(e.deleteAt(0,r.length),0===n?l-=r.length:a-=r.length)}),this.quill.update(ae.sources.USER),this.quill.setSelection(l,a,ae.sources.SILENT)}}}function Ze(t,e){const n="ArrowLeft"===t?"prefix":"suffix";return{key:t,shiftKey:e,altKey:null,[n]:/^$/,handler(n){let{index:s}=n;"ArrowRight"===t&&(s+=n.length+1);const[i]=this.quill.getLeaf(s);return!(i instanceof _)||("ArrowLeft"===t?e?this.quill.setSelection(n.index-1,n.length+1,ae.sources.USER):this.quill.setSelection(n.index-1,ae.sources.USER):e?this.quill.setSelection(n.index,n.length+1,ae.sources.USER):this.quill.setSelection(n.index+n.length+1,ae.sources.USER),!1)}}}function We(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],ae.sources.USER)}}}function Ge(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,n){const s=t?"prev":"next",i=n.line,r=i.parent[s];if(null!=r){if("table-row"===r.statics.blotName){let t=r.children.head,e=i;for(;null!=e.prev;)e=e.prev,t=t.next;const s=t.offset(this.quill.scroll)+Math.min(n.offset,t.length()-1);this.quill.setSelection(s,0,ae.sources.USER)}}else{const e=i.table()[s];null!=e&&(t?this.quill.setSelection(e.offset(this.quill.scroll)+e.length()-1,0,ae.sources.USER):this.quill.setSelection(e.offset(this.quill.scroll),0,ae.sources.USER))}return!1}}}function $e(t){let{quill:e,range:n}=t;const s=e.getLines(n);let i={};if(s.length>1){const t=s[0].formats(),e=s[s.length-1].formats();i=mt.AttributeMap.diff(e,t)||{}}e.deleteText(n,ae.sources.USER),Object.keys(i).length>0&&e.formatLine(n.index,1,i,ae.sources.USER),e.setSelection(n.index,ae.sources.SILENT)}Fe.DEFAULTS=Ve;const Xe=/font-weight:\s*normal/,Ye=["P","OL","UL"],Qe=t=>t&&Ye.includes(t.tagName);const Je=/\bmso-list:[^;]*ignore/i,tn=/\bmso-list:[^;]*\bl(\d+)/i,en=/\bmso-list:[^;]*\blevel(\d+)/i,nn=t=>{const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],s=[];e.forEach(t=>{(t.getAttribute("style")||"").match(Je)?n.push(t):s.push(t)}),n.forEach(t=>{var e;return null===(e=t.parentNode)||void 0===e?void 0:e.removeChild(t)});const i=t.documentElement.innerHTML,r=s.map(t=>((t,e)=>{const n=t.getAttribute("style"),s=null==n?void 0:n.match(tn);if(!s)return null;const i=Number(s[1]),r=null==n?void 0:n.match(en),o=r?Number(r[1]):1,l=new RegExp("@list l".concat(i,":level").concat(o,"\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)"),"i"),a=e.match(l);return{id:i,indent:o,type:a&&"bullet"===a[1]?"bullet":"ordered",element:t}})(t,i)).filter(t=>t);for(;r.length;){var o;const t=[];let e=r.shift();for(;e;){var l;t.push(e),e=r.length&&(null===(l=r[0])||void 0===l?void 0:l.element)===e.element.nextElementSibling&&r[0].id===e.id?r.shift():null}const n=document.createElement("ul");t.forEach(t=>{const e=document.createElement("li");e.setAttribute("data-list",t.type),t.indent>1&&e.setAttribute("class","ql-indent-".concat(t.indent-1)),e.innerHTML=t.element.innerHTML,n.appendChild(e)});const s=null===(o=t[0])||void 0===o?void 0:o.element,{parentNode:i}=null!=s?s:{};s&&(null==i||i.replaceChild(n,s)),t.slice(1).forEach(t=>{let{element:e}=t;null==i||i.removeChild(e)})}};const sn=[function(t){"urn:schemas-microsoft-com:office:word"===t.documentElement.getAttribute("xmlns:w")&&nn(t)},function(t){t.querySelector('[id^="docs-internal-guid-"]')&&((t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(t=>{var e;return null===(e=t.getAttribute("style"))||void 0===e?void 0:e.match(Xe)}).forEach(e=>{var n;const s=t.createDocumentFragment();s.append(...e.childNodes),null===(n=e.parentNode)||void 0===n||n.replaceChild(s,e)})})(t),(t=>{Array.from(t.querySelectorAll("br")).filter(t=>Qe(t.previousElementSibling)&&Qe(t.nextElementSibling)).forEach(t=>{var e;null===(e=t.parentNode)||void 0===e||e.removeChild(t)})})(t))}],rn=It("quill:clipboard"),on=[[Node.TEXT_NODE,function(t,e,n){var s;let i=t.data;if("O:P"===(null===(s=t.parentElement)||void 0===s?void 0:s.tagName))return e.insert(i.trim());if(!pn(t)){if(0===i.trim().length&&i.includes("\n")&&!function(t,e){return t.previousElementSibling&&t.nextElementSibling&&!dn(t.previousElementSibling,e)&&!dn(t.nextElementSibling,e)}(t,n))return e;i=i.replace(/[^\S\u00a0]/g," "),i=i.replace(/ {2,}/g," "),(null==t.previousSibling&&null!=t.parentElement&&dn(t.parentElement,n)||t.previousSibling instanceof Element&&dn(t.previousSibling,n))&&(i=i.replace(/^ /,"")),(null==t.nextSibling&&null!=t.parentElement&&dn(t.parentElement,n)||t.nextSibling instanceof Element&&dn(t.nextSibling,n))&&(i=i.replace(/ $/,"")),i=i.replaceAll(" "," ")}return e.insert(i)}],[Node.TEXT_NODE,bn],["br",function(t,e){un(e,"\n")||e.insert("\n");return e}],[Node.ELEMENT_NODE,bn],[Node.ELEMENT_NODE,function(t,e,n){const s=n.query(t);if(null==s)return e;if(s.prototype instanceof _){const e={},i=s.value(t);if(null!=i)return e[s.blotName]=i,(new bt).insert(e,s.formats(t,n))}else if(s.prototype instanceof T&&!un(e,"\n")&&e.insert("\n"),"blotName"in s&&"formats"in s&&"function"==typeof s.formats)return hn(e,s.blotName,s.formats(t,n),n);return e}],[Node.ELEMENT_NODE,function(t,e,n){const s=a.keys(t),i=f.keys(t),r=g.keys(t),o={};return s.concat(i).concat(r).forEach(e=>{let s=n.query(e,l.ATTRIBUTE);null!=s&&(o[s.attrName]=s.value(t),o[s.attrName])||(s=ln[e],null==s||s.attrName!==e&&s.keyName!==e||(o[s.attrName]=s.value(t)||void 0),s=an[e],null==s||s.attrName!==e&&s.keyName!==e||(s=an[e],o[s.attrName]=s.value(t)||void 0))}),Object.entries(o).reduce((t,e)=>{let[s,i]=e;return hn(t,s,i,n)},e)}],[Node.ELEMENT_NODE,function(t,e,n){var s;const i={},r=t.style||{};"italic"===r.fontStyle&&(i.italic=!0);"underline"===r.textDecoration&&(i.underline=!0);"line-through"===r.textDecoration&&(i.strike=!0);(null!==(s=r.fontWeight)&&void 0!==s&&s.startsWith("bold")||parseInt(r.fontWeight,10)>=700)&&(i.bold=!0);if(e=Object.entries(i).reduce((t,e)=>{let[s,i]=e;return hn(t,s,i,n)},e),parseFloat(r.textIndent||0)>0)return(new bt).insert("\t").concat(e);return e}],["li",function(t,e,n){const s=n.query(t);if(null==s||"list"!==s.blotName||!un(e,"\n"))return e;let i=-1,r=t.parentNode;for(;null!=r;)["OL","UL"].includes(r.tagName)&&(i+=1),r=r.parentNode;return i<=0?e:e.reduce((t,e)=>e.insert?e.attributes&&"number"==typeof e.attributes.indent?t.push(e):t.insert(e.insert,{indent:i,...e.attributes||{}}):t,new bt)}],["ol, ul",function(t,e,n){const s=t;let i="OL"===s.tagName?"ordered":"bullet";const r=s.getAttribute("data-checked");r&&(i="true"===r?"checked":"unchecked");return hn(e,"list",i,n)}],["pre",function(t,e,n){const s=n.query("code-block"),i=!s||!("formats"in s)||"function"!=typeof s.formats||s.formats(t,n);return hn(e,"code-block",i,n)}],["tr",function(t,e,n){var s,i;const r="TABLE"===(null===(s=t.parentElement)||void 0===s?void 0:s.tagName)?t.parentElement:null===(i=t.parentElement)||void 0===i?void 0:i.parentElement;if(null!=r){return hn(e,"table",Array.from(r.querySelectorAll("tr")).indexOf(t)+1,n)}return e}],["b",mn("bold")],["i",mn("italic")],["strike",mn("strike")],["style",function(){return new bt}]],ln=[Ne,Re].reduce((t,e)=>(t[e.keyName]=e,t),{}),an=[Ae,Te,ke,je,De,Pe].reduce((t,e)=>(t[e.keyName]=e,t),{});class cn extends $t{constructor(t,e){var n;super(t,e),this.quill.root.addEventListener("copy",t=>this.onCaptureCopy(t,!1)),this.quill.root.addEventListener("cut",t=>this.onCaptureCopy(t,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],on.concat(null!==(n=this.options.matchers)&&void 0!==n?n:[]).forEach(t=>{let[e,n]=t;this.addMatcher(e,n)})}addMatcher(t,e){this.matchers.push([t,e])}convert(t){let{html:e,text:n}=t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s[Oe.blotName])return(new bt).insert(n||"",{[Oe.blotName]:s[Oe.blotName]});if(!e)return(new bt).insert(n||"",s);const i=this.convertHTML(e);return un(i,"\n")&&(null==i.ops[i.ops.length-1].attributes||s.table)?i.compose((new bt).retain(i.length()-1).delete(1)):i}normalizeHTML(t){(t=>{t.documentElement&&sn.forEach(e=>{e(t)})})(t)}convertHTML(t){const e=(new DOMParser).parseFromString(t,"text/html");this.normalizeHTML(e);const n=e.body,s=new WeakMap,[i,r]=this.prepareMatching(n,s);return gn(this.quill.scroll,n,i,r,s)}dangerouslyPasteHTML(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ae.sources.API;if("string"==typeof t){const n=this.convert({html:t,text:""});this.quill.setContents(n,e),this.quill.setSelection(0,ae.sources.SILENT)}else{const s=this.convert({html:e,text:""});this.quill.updateContents((new bt).retain(t).concat(s),n),this.quill.setSelection(t+s.length(),ae.sources.SILENT)}}onCaptureCopy(t){var e,n;let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.defaultPrevented)return;t.preventDefault();const[i]=this.quill.selection.getRange();if(null==i)return;const{html:r,text:o}=this.onCopy(i,s);null===(e=t.clipboardData)||void 0===e||e.setData("text/plain",o),null===(n=t.clipboardData)||void 0===n||n.setData("text/html",r),s&&$e({range:i,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(t=>"#"!==t[0]).join("\n")}onCapturePaste(t){var e,n,s;if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const i=this.quill.getSelection(!0);if(null==i)return;const r=null===(e=t.clipboardData)||void 0===e?void 0:e.getData("text/html");let o=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/plain");if(!r&&!o){var l;const e=null===(l=t.clipboardData)||void 0===l?void 0:l.getData("text/uri-list");e&&(o=this.normalizeURIList(e))}const a=Array.from((null===(s=t.clipboardData)||void 0===s?void 0:s.files)||[]);if(!r&&a.length>0)this.quill.uploader.upload(i,a);else{if(r&&a.length>0){var c;const t=(new DOMParser).parseFromString(r,"text/html");if(1===t.body.childElementCount&&"IMG"===(null===(c=t.body.firstElementChild)||void 0===c?void 0:c.tagName))return void this.quill.uploader.upload(i,a)}this.onPaste(i,{html:r,text:o})}}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:n,html:s}=e;const i=this.quill.getFormat(t.index),r=this.convert({text:n,html:s},i);rn.log("onPaste",r,{text:n,html:s});const o=(new bt).retain(t.index).delete(t.length).concat(r);this.quill.updateContents(o,ae.sources.USER),this.quill.setSelection(o.length()-t.length,ae.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const n=[],s=[];return this.matchers.forEach(i=>{const[r,o]=i;switch(r){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(t.querySelectorAll(r)).forEach(t=>{if(e.has(t)){const n=e.get(t);null==n||n.push(o)}else e.set(t,[o])})}}),[n,s]}}function hn(t,e,n,s){return s.query(e)?t.reduce((t,s)=>{if(!s.insert)return t;if(s.attributes&&s.attributes[e])return t.push(s);const i=n?{[e]:n}:{};return t.insert(s.insert,{...i,...s.attributes})},new bt):t}function un(t,e){let n="";for(let s=t.ops.length-1;s>=0&&n.length<e.length;--s){const e=t.ops[s];if("string"!=typeof e.insert)break;n=e.insert+n}return n.slice(-1*e.length)===e}function dn(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return!(n&&n.prototype instanceof _)&&["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(t.tagName.toLowerCase())}o(cn,"DEFAULTS",{matchers:[]});const fn=new WeakMap;function pn(t){return null!=t&&(fn.has(t)||("PRE"===t.tagName?fn.set(t,!0):fn.set(t,pn(t.parentNode))),fn.get(t))}function gn(t,e,n,s,i){return e.nodeType===e.TEXT_NODE?s.reduce((n,s)=>s(e,n,t),new bt):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((r,o)=>{let l=gn(t,o,n,s,i);return o.nodeType===e.ELEMENT_NODE&&(l=n.reduce((e,n)=>n(o,e,t),l),l=(i.get(o)||[]).reduce((e,n)=>n(o,e,t),l)),r.concat(l)},new bt):new bt}function mn(t){return(e,n,s)=>hn(n,t,!0,s)}function bn(t,e,n){if(!un(e,"\n")){if(dn(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert("\n");if(e.length()>0&&t.nextSibling){let s=t.nextSibling;for(;null!=s;){if(dn(s,n))return e.insert("\n");const t=n.query(s);if(t&&t.prototype instanceof wt)return e.insert("\n");s=s.firstChild}}}return e}class vn extends $t{constructor(t,e){super(t,e),o(this,"lastRecorded",0),o(this,"ignoreChange",!1),o(this,"stack",{undo:[],redo:[]}),o(this,"currentRange",null),this.quill.on(ae.events.EDITOR_CHANGE,(t,e,n,s)=>{t===ae.events.SELECTION_CHANGE?e&&s!==ae.sources.SILENT&&(this.currentRange=e):t===ae.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&s!==ae.sources.USER?this.transform(e):this.record(e,n)),this.currentRange=xn(this.currentRange,e))}),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",t=>{"historyUndo"===t.inputType?(this.undo(),t.preventDefault()):"historyRedo"===t.inputType&&(this.redo(),t.preventDefault())})}change(t,e){if(0===this.stack[t].length)return;const n=this.stack[t].pop();if(!n)return;const s=this.quill.getContents(),i=n.delta.invert(s);this.stack[e].push({delta:i,range:xn(n.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,ae.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(0===t.ops.length)return;this.stack.redo=[];let n=t.invert(e),s=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const t=this.stack.undo.pop();t&&(n=n.compose(t.delta),s=t.range)}else this.lastRecorded=i;0!==n.length()&&(this.stack.undo.push({delta:n,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(t){yn(this.stack.undo,t),yn(this.stack.redo,t)}undo(){this.change("undo","redo")}restoreSelection(t){if(t.range)this.quill.setSelection(t.range,ae.sources.USER);else{const e=function(t,e){const n=e.reduce((t,e)=>t+(e.delete||0),0);let s=e.length()-n;(function(t,e){const n=e.ops[e.ops.length-1];if(null==n)return!1;if(null!=n.insert)return"string"==typeof n.insert&&n.insert.endsWith("\n");if(null!=n.attributes)return Object.keys(n.attributes).some(e=>null!=t.query(e,l.BLOCK));return!1})(t,e)&&(s-=1);return s}(this.quill.scroll,t.delta);this.quill.setSelection(e,ae.sources.USER)}}}function yn(t,e){let n=e;for(let e=t.length-1;e>=0;e-=1){const s=t[e];t[e]={delta:n.transform(s.delta,!0),range:s.range&&xn(s.range,n)},n=s.delta.transform(n),0===t[e].delta.length()&&t.splice(e,1)}}function xn(t,e){if(!t)return t;const n=e.transformPosition(t.index);return{index:n,length:e.transformPosition(t.index+t.length)-n}}o(vn,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});class Nn extends $t{constructor(t,e){super(t,e),t.root.addEventListener("drop",e=>{e.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(e.clientX,e.clientY);else if(document.caretPositionFromPoint){const t=document.caretPositionFromPoint(e.clientX,e.clientY);n=document.createRange(),n.setStart(t.offsetNode,t.offset),n.setEnd(t.offsetNode,t.offset)}const s=n&&t.selection.normalizeNative(n);if(s){var i;const n=t.selection.normalizedToRange(s);null!==(i=e.dataTransfer)&&void 0!==i&&i.files&&this.upload(n,e.dataTransfer.files)}})}upload(t,e){const n=[];Array.from(e).forEach(t=>{var e;t&&null!==(e=this.options.mimetypes)&&void 0!==e&&e.includes(t.type)&&n.push(t)}),n.length>0&&this.options.handler.call(this,t,n)}}Nn.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image"))return;const n=e.map(t=>new Promise(e=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.readAsDataURL(t)}));Promise.all(n).then(e=>{const n=e.reduce((t,e)=>t.insert({image:e}),(new bt).retain(t.index).delete(t.length));this.quill.updateContents(n,Mt.sources.USER),this.quill.setSelection(t.index+e.length,Mt.sources.SILENT)})}};const En=["insertText","insertReplacementText"];const An=/Mac/i.test(navigator.platform);ae.register({"blots/block":At,"blots/block/embed":wt,"blots/break":vt,"blots/container":ge,"blots/cursor":Lt,"blots/embed":Yt,"blots/inline":Et,"blots/scroll":ve,"blots/text":yt,"modules/clipboard":cn,"modules/history":vn,"modules/keyboard":Fe,"modules/uploader":Nn,"modules/input":class extends $t{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",t=>{this.handleBeforeInput(t)}),/Android/i.test(navigator.userAgent)||t.on(ae.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){$e({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===t.length)return!1;if(e){const n=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents((new bt).retain(t.index).insert(e,n),ae.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,ae.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!En.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||!0===e.collapsed)return;const n=function(t){var e;if("string"==typeof t.data)return t.data;if(null!==(e=t.dataTransfer)&&void 0!==e&&e.types.includes("text/plain"))return t.dataTransfer.getData("text/plain");return null}(t);if(null==n)return;const s=this.quill.selection.normalizeNative(e),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,n)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}},"modules/uiNode":class extends $t{constructor(t,e){super(t,e),o(this,"isListening",!1),o(this,"selectionChangeDeadline",0),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(t,e){let{line:n,event:s}=e;if(!(n instanceof w&&n.uiNode))return!0;const i="rtl"===getComputedStyle(n.domNode).direction;return!!(i&&"ArrowRight"!==s.key||!i&&"ArrowLeft"!==s.key)||(this.quill.setSelection(t.index-1,t.length+(s.shiftKey?1:0),ae.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",t=>{!t.defaultPrevented&&(t=>"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowUp"===t.key||"ArrowDown"===t.key||"Home"===t.key||!(!An||"a"!==t.key||!0!==t.ctrlKey))(t)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+100,this.isListening)return;this.isListening=!0;document.addEventListener("selectionchange",()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()},{once:!0})}handleSelectionChange(){const t=document.getSelection();if(!t)return;const e=t.getRangeAt(0);if(!0!==e.collapsed||0!==e.startOffset)return;const n=this.quill.scroll.find(e.startContainer);if(!(n instanceof w&&n.uiNode))return;const s=document.createRange();s.setStartAfter(n.uiNode),s.setEndAfter(n.uiNode),t.removeAllRanges(),t.addRange(s)}}});const wn=new class extends f{add(t,e){let n=0;if("+1"===e||"-1"===e){const s=this.value(t)||0;n="+1"===e?s+1:s-1}else"number"==typeof e&&(n=e);return 0===n?(this.remove(t),!0):super.add(t,n.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}}("indent","ql-indent",{scope:l.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class qn extends At{}o(qn,"blotName","blockquote"),o(qn,"tagName","blockquote");class kn extends At{static formats(t){return this.tagName.indexOf(t.tagName)+1}}o(kn,"blotName","header"),o(kn,"tagName",["H1","H2","H3","H4","H5","H6"]);class Ln extends ge{}Ln.blotName="list-container",Ln.tagName="OL";class Tn extends At{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(){ae.register(Ln)}constructor(t,e){super(t,e);const n=e.ownerDocument.createElement("span"),s=n=>{if(!t.isEnabled())return;const s=this.statics.formats(e,t);"checked"===s?(this.format("list","unchecked"),n.preventDefault()):"unchecked"===s&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",s),n.addEventListener("touchstart",s),this.attachUI(n)}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("data-list",e):super.format(t,e)}}Tn.blotName="list",Tn.tagName="LI",Ln.allowedChildren=[Tn],Tn.requiredContainer=Ln;class Sn extends Et{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)}}o(Sn,"blotName","bold"),o(Sn,"tagName",["STRONG","B"]);class On extends Sn{}o(On,"blotName","italic"),o(On,"tagName",["EM","I"]);class _n extends Et{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 Cn(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){t===this.statics.blotName&&e?this.domNode.setAttribute("href",this.constructor.sanitize(e)):super.format(t,e)}}function Cn(t,e){const n=document.createElement("a");n.href=t;const s=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(s)>-1}o(_n,"blotName","link"),o(_n,"tagName","A"),o(_n,"SANITIZED_URL","about:blank"),o(_n,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);class Rn extends Et{static create(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):super.create(t)}static formats(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}}o(Rn,"blotName","script"),o(Rn,"tagName",["SUB","SUP"]);class In extends Sn{}o(In,"blotName","strike"),o(In,"tagName",["S","STRIKE"]);class jn extends Et{}o(jn,"blotName","underline"),o(jn,"tagName","U");class Mn extends Yt{static create(t){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const e=super.create(t);return"string"==typeof t&&(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>".concat(t,"</span>")}}o(Mn,"blotName","formula"),o(Mn,"className","ql-formula"),o(Mn,"tagName","SPAN");const Bn=["alt","height","width"];class Dn extends _{static create(t){const e=super.create(t);return"string"==typeof t&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Bn.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return Cn(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){Bn.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}o(Dn,"blotName","image"),o(Dn,"tagName","IMG");const Un=["height","width"];class Pn extends wt{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 Un.reduce((e,n)=>(t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e),{})}static sanitize(t){return _n.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){Un.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="'.concat(t,'">').concat(t,"</a>")}}o(Pn,"blotName","video"),o(Pn,"className","ql-video"),o(Pn,"tagName","IFRAME");const Hn=new f("code-token","hljs",{scope:l.INLINE});class zn extends Et{static formats(t,e){for(;null!=t&&t!==e.domNode;){if(t.classList&&t.classList.contains(Oe.className))return super.formats(t,e);t=t.parentNode}}constructor(t,e,n){super(t,e,n),Hn.add(this.domNode,n)}format(t,e){t!==zn.blotName?super.format(t,e):e?Hn.add(this.domNode,e):(Hn.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Hn.value(this.domNode)||this.unwrap()}}zn.blotName="code-token",zn.className="ql-token";class Fn extends Oe{static create(t){const e=super.create(t);return"string"==typeof t&&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(),zn.blotName,!1),super.replaceWith(t,e)}}class Vn extends Se{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(t,e){t===Fn.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(t,e)}))}formatAt(t,e,n,s){n===Fn.blotName&&(this.forceNext=!0),super.formatAt(t,e,n,s)}highlight(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const n=Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode),s="".concat(n.map(t=>t.textContent).join("\n"),"\n"),i=Fn.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||null==this.cachedText){const e=this.children.reduce((t,e)=>t.concat(qt(e,!1)),new bt),n=t(s,i);e.diff(n).reduce((t,e)=>{let{retain:n,attributes:s}=e;return n?(s&&Object.keys(s).forEach(e=>{[Fn.blotName,zn.blotName].includes(e)&&this.formatAt(t,n,e,s[e])}),t+n):t},0)}this.cachedText=s,this.forceNext=!1}}html(t,e){const[n]=this.children.find(t),s=n?Fn.formats(n.domNode):"plain";return'<pre data-language="'.concat(s,'">\n').concat(Nt(this.code(t,e)),"\n</pre>")}optimize(t){if(super.optimize(t),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const t=Fn.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Vn.allowedChildren=[Fn],Fn.requiredContainer=Vn,Fn.allowedChildren=[zn,Lt,yt,vt];class Kn extends $t{static register(){ae.register(zn,!0),ae.register(Fn,!0),ae.register(Vn,!0)}constructor(t,e){if(super(t,e),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((t,e)=>{let{key:n}=e;return t[n]=!0,t},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(ae.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof Vn))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(t=>{let{key:n,label:s}=t;const i=e.ownerDocument.createElement("option");i.textContent=s,i.setAttribute("value",n),e.appendChild(i)}),e.addEventListener("change",()=>{t.format(Fn.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),null==t.uiNode&&(t.attachUI(e),t.children.head&&(e.value=Fn.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(ae.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(ae.sources.USER);const n=this.quill.getSelection();(null==t?this.quill.scroll.descendants(Vn):[t]).forEach(t=>{t.highlight(this.highlightBlot,e)}),this.quill.update(ae.sources.SILENT),null!=n&&this.quill.setSelection(n,ae.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(e=this.languages[e]?e:"plain","plain"===e)return Nt(t).split("\n").reduce((t,n,s)=>(0!==s&&t.insert("\n",{[Oe.blotName]:e}),t.insert(n)),new bt);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(Oe.className),n.innerHTML=((t,e,n)=>{if("string"==typeof t.versionString){const s=t.versionString.split(".")[0];if(parseInt(s,10)>=11)return t.highlight(n,{language:e}).value}return t.highlight(e,n).value})(this.options.hljs,e,t),gn(this.quill.scroll,n,[(t,e)=>{const n=Hn.value(t);return n?e.compose((new bt).retain(e.length(),{[zn.blotName]:n})):e}],[(t,n)=>t.data.split("\n").reduce((t,n,s)=>(0!==s&&t.insert("\n",{[Oe.blotName]:e}),t.insert(n)),n)],new WeakMap)}}Kn.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 Zn extends At{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Xn()),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===Zn.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()}}o(Zn,"blotName","table"),o(Zn,"tagName","TD");class Wn extends ge{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const t=this.children.head.formats(),e=this.children.tail.formats(),n=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===n.table&&t.table===s.table}return!1}optimize(t){super.optimize(t),this.children.forEach(t=>{if(null==t.next)return;const e=t.formats(),n=t.next.formats();if(e.table!==n.table){const e=this.splitAfter(t);e&&e.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}o(Wn,"blotName","table-row"),o(Wn,"tagName","TR");class Gn extends ge{}o(Gn,"blotName","table-body"),o(Gn,"tagName","TBODY");class $n extends ge{balanceCells(){const t=this.descendants(Wn),e=t.reduce((t,e)=>Math.max(e.children.length,t),0);t.forEach(t=>{new Array(e-t.children.length).fill(0).forEach(()=>{let e;null!=t.children.head&&(e=Zn.formats(t.children.head.domNode));const n=this.scroll.create(Zn.blotName,e);t.appendChild(n),n.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(Gn);null!=e&&null!=e.children.head&&e.children.forEach(e=>{const n=e.children.at(t);null!=n&&n.remove()})}insertColumn(t){const[e]=this.descendant(Gn);null!=e&&null!=e.children.head&&e.children.forEach(e=>{const n=e.children.at(t),s=Zn.formats(e.children.head.domNode),i=this.scroll.create(Zn.blotName,s);e.insertBefore(i,n)})}insertRow(t){const[e]=this.descendant(Gn);if(null==e||null==e.children.head)return;const n=Xn(),s=this.scroll.create(Wn.blotName);e.children.head.children.forEach(()=>{const t=this.scroll.create(Zn.blotName,n);s.appendChild(t)});const i=e.children.at(t);e.insertBefore(s,i)}rows(){const t=this.children.head;return null==t?[]:t.children.map(t=>t)}}function Xn(){const t=Math.random().toString(36).slice(2,6);return"row-".concat(t)}o($n,"blotName","table-container"),o($n,"tagName","TABLE"),$n.allowedChildren=[Gn],Gn.requiredContainer=$n,Gn.allowedChildren=[Wn],Wn.requiredContainer=Gn,Wn.allowedChildren=[Zn],Zn.requiredContainer=Wn;const Yn=It("quill:toolbar");class Qn extends $t{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){var n;const e=document.createElement("div");e.setAttribute("role","toolbar"),function(t,e){Array.isArray(e[0])||(e=[e]);e.forEach(e=>{const n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(t=>{if("string"==typeof t)Jn(n,t);else{const e=Object.keys(t)[0],s=t[e];Array.isArray(s)?function(t,e,n){const s=document.createElement("select");s.classList.add("ql-".concat(e)),n.forEach(t=>{const e=document.createElement("option");!1!==t?e.setAttribute("value",String(t)):e.setAttribute("selected","selected"),s.appendChild(e)}),t.appendChild(s)}(n,e,s):Jn(n,e,s)}}),t.appendChild(n)})}(e,this.options.container),null===(n=t.container)||void 0===n||null===(n=n.parentNode)||void 0===n||n.insertBefore(e,t.container),this.container=e}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(t=>{var e;const n=null===(e=this.options.handlers)||void 0===e?void 0:e[t];n&&this.addHandler(t,n)}),Array.from(this.container.querySelectorAll("button, select")).forEach(t=>{this.attach(t)}),this.quill.on(ae.events.EDITOR_CHANGE,()=>{const[t]=this.quill.selection.getRange();this.update(t)})):Yn.error("Container required for toolbar",this.options)}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(t=>0===t.indexOf("ql-"));if(!e)return;if(e=e.slice(3),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null==this.handlers[e]&&null==this.quill.scroll.query(e))return void Yn.warn("ignoring attaching to nonexistent format",e,t);const n="SELECT"===t.tagName?"change":"click";t.addEventListener(n,n=>{let s;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;const e=t.options[t.selectedIndex];s=!e.hasAttribute("selected")&&(e.value||!1)}else s=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),n.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(null!=this.handlers[e])this.handlers[e].call(this,s);else if(this.quill.scroll.query(e).prototype instanceof _){if(s=prompt("Enter ".concat(e)),!s)return;this.quill.updateContents((new bt).retain(i.index).delete(i.length).insert({[e]:s}),ae.sources.USER)}else this.quill.format(e,s,ae.sources.USER);this.update(i)}),this.controls.push([e,t])}update(t){const e=null==t?{}:this.quill.getFormat(t);this.controls.forEach(n=>{const[s,i]=n;if("SELECT"===i.tagName){let n=null;if(null==t)n=null;else if(null==e[s])n=i.querySelector("option[selected]");else if(!Array.isArray(e[s])){let t=e[s];"string"==typeof t&&(t=t.replace(/"/g,'\\"')),n=i.querySelector('option[value="'.concat(t,'"]'))}null==n?(i.value="",i.selectedIndex=-1):n.selected=!0}else if(null==t)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const t=e[s],n=t===i.getAttribute("value")||null!=t&&t.toString()===i.getAttribute("value")||null==t&&!i.getAttribute("value");i.classList.toggle("ql-active",n),i.setAttribute("aria-pressed",n.toString())}else{const t=null!=e[s];i.classList.toggle("ql-active",t),i.setAttribute("aria-pressed",t.toString())}})}}function Jn(t,e,n){const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add("ql-".concat(e)),s.setAttribute("aria-pressed","false"),null!=n?(s.value=n,s.setAttribute("aria-label","".concat(e,": ").concat(n))):s.setAttribute("aria-label",e),t.appendChild(s)}Qn.DEFAULTS={},Qn.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(null!=t)if(0===t.length){const t=this.quill.getFormat();Object.keys(t).forEach(t=>{null!=this.quill.scroll.query(t,l.INLINE)&&this.quill.format(t,!1,ae.sources.USER)})}else this.quill.removeFormat(t.index,t.length,ae.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();"rtl"===t&&null==e?this.quill.format("align","right",ae.sources.USER):t||"right"!==e||this.quill.format("align",!1,ae.sources.USER),this.quill.format("direction",t,ae.sources.USER)},indent(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e),s=parseInt(n.indent||0,10);if("+1"===t||"-1"===t){let e="+1"===t?1:-1;"rtl"===n.direction&&(e*=-1),this.quill.format("indent",s+e,ae.sources.USER)}},link(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,ae.sources.USER)},list(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e);"check"===t?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,ae.sources.USER):this.quill.format("list","unchecked",ae.sources.USER):this.quill.format("list",t,ae.sources.USER)}}};const ts='<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>';var es={align:{"":'<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>',center:'<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>',right:'<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>',justify:'<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>'},background:'<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>',blockquote:'<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>',bold:'<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>',clean:'<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>',code:ts,"code-block":ts,color:'<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>',direction:{"":'<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>',rtl:'<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>'},formula:'<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>',header:{1:'<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>',2:'<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>',3:'<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>',4:'<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>',5:'<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>',6:'<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>'},italic:'<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>',image:'<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>',indent:{"+1":'<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>',"-1":'<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>'},link:'<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>',list:{bullet:'<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>',check:'<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>',ordered:'<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>'},script:{sub:'<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>',super:'<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>'},strike:'<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>',table:'<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>',underline:'<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>',video:'<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>'};let ns=0;function ss(t,e){t.setAttribute(e,"".concat(!("true"===t.getAttribute(e))))}class is{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",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),ss(this.label,"aria-expanded"),ss(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 n=t.getAttribute("value");return n&&e.setAttribute("data-value",n),t.textContent&&e.setAttribute("data-label",t.textContent),e.addEventListener("click",()=>{this.selectItem(e,!0)}),e.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.selectItem(e,!0),t.preventDefault();break;case"Escape":this.escape(),t.preventDefault()}}),e}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML='<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>',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-".concat(ns),ns+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(e=>{const n=this.buildItem(e);t.appendChild(n),!0===e.selected&&this.selectItem(n)}),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&&void 0!==arguments[1]&&arguments[1];const n=this.container.querySelector(".ql-selected");t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(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 e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);const e=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",e)}}class rs extends is{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(t=>{t.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 n=this.label.querySelector(".ql-color-label"),s=t&&t.getAttribute("data-value")||"";n&&("line"===n.tagName?n.style.stroke=s:n.style.fill=s)}}class os extends is{constructor(t,e){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(t=>{t.innerHTML=e[t.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,e){super.selectItem(t,e);const n=t||this.defaultItem;if(null!=n){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}}class ls{constructor(t,e){this.quill=t,this.boundsContainer=e||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(t=>{const{overflowY:e}=getComputedStyle(t,null);return"visible"!==e&&"clip"!==e})(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop="".concat(-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,n=t.bottom+this.quill.root.scrollTop;this.root.style.left="".concat(e,"px"),this.root.style.top="".concat(n,"px"),this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let r=0;if(i.right>s.right&&(r=s.right-i.right,this.root.style.left="".concat(e+r,"px")),i.left<s.left&&(r=s.left-i.left,this.root.style.left="".concat(e+r,"px")),i.bottom>s.bottom){const e=i.bottom-i.top,s=t.bottom-t.top+e;this.root.style.top="".concat(n-s,"px"),this.root.classList.add("ql-flip")}return r}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const as=[!1,"center","right","justify"],cs=["#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"],hs=[!1,"serif","monospace"],us=["1","2","3",!1],ds=["small",!1,"large","huge"];class fs extends te{constructor(t,e){super(t,e);const n=e=>{document.body.contains(t.root)?(null==this.tooltip||this.tooltip.root.contains(e.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach(t=>{t.container.contains(e.target)||t.close()})):document.body.removeEventListener("click",n)};t.emitter.listenDOM("click",document.body,n)}addModule(t){const e=super.addModule(t);return"toolbar"===t&&this.extendToolbar(e),e}buildButtons(t,e){Array.from(t).forEach(t=>{(t.getAttribute("class")||"").split(/\s+/).forEach(n=>{if(n.startsWith("ql-")&&(n=n.slice(3),null!=e[n]))if("direction"===n)t.innerHTML=e[n][""]+e[n].rtl;else if("string"==typeof e[n])t.innerHTML=e[n];else{const s=t.value||"";null!=s&&e[n][s]&&(t.innerHTML=e[n][s])}})})}buildPickers(t,e){this.pickers=Array.from(t).map(t=>{if(t.classList.contains("ql-align")&&(null==t.querySelector("option")&&gs(t,as),"object"==typeof e.align))return new os(t,e.align);if(t.classList.contains("ql-background")||t.classList.contains("ql-color")){const n=t.classList.contains("ql-background")?"background":"color";return null==t.querySelector("option")&&gs(t,cs,"background"===n?"#ffffff":"#000000"),new rs(t,e[n])}return null==t.querySelector("option")&&(t.classList.contains("ql-font")?gs(t,hs):t.classList.contains("ql-header")?gs(t,us):t.classList.contains("ql-size")&&gs(t,ds)),new is(t)});this.quill.on(Mt.events.EDITOR_CHANGE,()=>{this.pickers.forEach(t=>{t.update()})})}}fs.DEFAULTS=s({},te.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");null==t&&(t=document.createElement("input"),t.setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class ps extends ls{constructor(t,e){super(t,e),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{"Enter"===t.key?(this.save(),t.preventDefault()):"Escape"===t.key&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);null!=n&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-".concat(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,Mt.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,Mt.sources.USER)),this.quill.root.scrollTop=e;break}case"video":t=function(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(e)return"".concat(e[1]||"https","://www.youtube.com/embed/").concat(e[2],"?showinfo=0");if(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return"".concat(e[1]||"https","://player.vimeo.com/video/").concat(e[2],"/");return t}(t);case"formula":{if(!t)break;const e=this.quill.getSelection(!0);if(null!=e){const n=e.index+e.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),t,Mt.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(n+1," ",Mt.sources.USER),this.quill.setSelection(n+2,Mt.sources.USER)}break}}this.textbox.value="",this.hide()}}function gs(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(e=>{const s=document.createElement("option");e===n?s.setAttribute("selected","selected"):s.setAttribute("value",String(e)),t.appendChild(s)})}const ms=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class bs extends ps{constructor(t,e){super(t,e),this.quill.on(Mt.events.EDITOR_CHANGE,(t,e,n,s)=>{if(t===Mt.events.SELECTION_CHANGE)if(null!=e&&e.length>0&&s===Mt.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width="".concat(this.root.offsetWidth,"px");const t=this.quill.getLines(e.index,e.length);if(1===t.length){const t=this.quill.getBounds(e);null!=t&&this.position(t)}else{const n=t[t.length-1],s=this.quill.getIndex(n),i=Math.min(n.length()-1,e.index+e.length-s),r=this.quill.getBounds(new Dt(s,i));null!=r&&this.position(r)}}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(Mt.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(null!=t){const e=this.quill.getBounds(t);null!=e&&this.position(e)}},1)})}cancel(){this.show()}position(t){const e=super.position(t),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",0!==e&&(n.style.marginLeft="".concat(-1*e-n.offsetWidth/2,"px")),e}}o(bs,"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(""));class vs extends fs{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=ms),super(t,e),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new bs(this.quill,this.options.bounds),null!=t.container&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),es),this.buildPickers(t.container.querySelectorAll("select"),es))}}vs.DEFAULTS=s({},fs.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,ae.sources.USER)}}}}});const ys=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class xs extends ps{constructor(){super(...arguments),o(this,"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(null!=this.linkRange){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,Mt.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(Mt.events.SELECTION_CHANGE,(t,e,n)=>{if(null!=t){if(0===t.length&&n===Mt.sources.USER){const[e,n]=this.quill.scroll.descendant(_n,t.index);if(null!=e){this.linkRange=new Dt(t.index-n,e.length());const s=_n.formats(e.domNode);this.preview.textContent=s,this.preview.setAttribute("href",s),this.show();const i=this.quill.getBounds(this.linkRange);return void(null!=i&&this.position(i))}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}o(xs,"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(""));class Ns extends fs{constructor(t,e){null!=e.modules.toolbar&&null==e.modules.toolbar.container&&(e.modules.toolbar.container=ys),super(t,e),this.quill.container.classList.add("ql-snow")}extendToolbar(t){null!=t.container&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),es),this.buildPickers(t.container.querySelectorAll("select"),es),this.tooltip=new xs(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(e,n)=>{t.handlers.link.call(t,!n.format.link)}))}}Ns.DEFAULTS=s({},fs.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const t=this.quill.getSelection();if(null==t||0===t.length)return;let e=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(e)&&0!==e.indexOf("mailto:")&&(e="mailto:".concat(e));const{tooltip:n}=this.quill.theme;n.edit("link",e)}else this.quill.format("link",!1,ae.sources.USER)}}}}}),ae.register({"attributors/attribute/direction":Re,"attributors/class/align":Ee,"attributors/class/background":Le,"attributors/class/color":qe,"attributors/class/direction":Ie,"attributors/class/font":Be,"attributors/class/size":Ue,"attributors/style/align":Ae,"attributors/style/background":Te,"attributors/style/color":ke,"attributors/style/direction":je,"attributors/style/font":De,"attributors/style/size":Pe},!0),ae.register({"formats/align":Ee,"formats/direction":Ie,"formats/indent":wn,"formats/background":Te,"formats/color":ke,"formats/font":Be,"formats/size":Ue,"formats/blockquote":qn,"formats/code-block":Oe,"formats/header":kn,"formats/list":Tn,"formats/bold":Sn,"formats/code":_e,"formats/italic":On,"formats/link":_n,"formats/script":Rn,"formats/strike":In,"formats/underline":jn,"formats/formula":Mn,"formats/image":Dn,"formats/video":Pn,"modules/syntax":Kn,"modules/table":class extends $t{static register(){ae.register(Zn),ae.register(Wn),ae.register(Gn),ae.register($n)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants($n).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();null!=e&&(t.deleteColumn(e.cellOffset()),this.quill.update(ae.sources.USER))}deleteRow(){const[,t]=this.getTable();null!=t&&(t.remove(),this.quill.update(ae.sources.USER))}deleteTable(){const[t]=this.getTable();if(null==t)return;const e=t.offset();t.remove(),this.quill.update(ae.sources.USER),this.quill.setSelection(e,ae.sources.SILENT)}getTable(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==t)return[null,null,null,-1];const[e,n]=this.quill.getLine(t.index);if(null==e||e.statics.blotName!==Zn.blotName)return[null,null,null,-1];const s=e.parent;return[s.parent.parent,s,e,n]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(null==i)return;const r=i.cellOffset();n.insertColumn(r+t),this.quill.update(ae.sources.USER);let o=s.rowOffset();0===t&&(o+=1),this.quill.setSelection(e.index+o,e.length,ae.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(null==i)return;const r=s.rowOffset();n.insertRow(r+t),this.quill.update(ae.sources.USER),t>0?this.quill.setSelection(e,ae.sources.SILENT):this.quill.setSelection(e.index+s.children.length,e.length,ae.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const n=this.quill.getSelection();if(null==n)return;const s=new Array(t).fill(0).reduce(t=>{const n=new Array(e).fill("\n").join("");return t.insert(n,{table:Xn()})},(new bt).retain(n.index));this.quill.updateContents(s,ae.sources.USER),this.quill.setSelection(n.index,ae.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(ae.events.SCROLL_OPTIMIZE,t=>{t.some(t=>!!["TD","TR","TBODY","TABLE"].includes(t.target.tagName)&&(this.quill.once(ae.events.TEXT_CHANGE,(t,e,n)=>{n===ae.sources.USER&&this.balanceTables()}),!0))})}},"modules/toolbar":Qn,"themes/bubble":vs,"themes/snow":Ns,"ui/icons":es,"ui/picker":is,"ui/icon-picker":os,"ui/color-picker":rs,"ui/tooltip":ls},!0)}}});
|
|
2
|
+
//# sourceMappingURL=quill-CSDnV3Pb.js.map
|