!function(_,v){"object"==typeof exports&&"object"==typeof module?module.exports=v():"function"==typeof define&&define.amd?define([],v):"object"==typeof exports?exports.Quill=v():_.Quill=v()}(typeof self<"u"?self:this,function(){return function(B){var _={};function v(P){if(_[P])return _[P].exports;var N=_[P]={i:P,l:!1,exports:{}};return B[P].call(N.exports,N,N.exports,v),N.l=!0,N.exports}return v.m=B,v.c=_,v.d=function(P,N,k){v.o(P,N)||Object.defineProperty(P,N,{configurable:!1,enumerable:!0,get:k})},v.n=function(P){var N=P&&P.__esModule?function(){return P.default}:function(){return P};return v.d(N,"a",N),N},v.o=function(P,N){return Object.prototype.hasOwnProperty.call(P,N)},v.p="",v(v.s=109)}([function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=v(17),N=v(18),k=v(19),m=v(45),y=v(46),c=v(47),o=v(48),t=v(49),e=v(12),u=v(32),l=v(33),a=v(31),r=v(1);_.default={Scope:r.Scope,create:r.create,find:r.find,query:r.query,register:r.register,Container:P.default,Format:N.default,Leaf:k.default,Embed:o.default,Scroll:m.default,Block:c.default,Inline:y.default,Text:t.default,Attributor:{Attribute:e.default,Class:u.default,Style:l.default,Store:a.default}}},function(B,_,v){"use strict";var a,P=this&&this.__extends||(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var f in i)i.hasOwnProperty(f)&&(r[f]=i[f])},function(r,i){function f(){this.constructor=r}a(r,i),r.prototype=null===i?Object.create(i):(f.prototype=i.prototype,new f)});Object.defineProperty(_,"__esModule",{value:!0});var N=function(a){function r(i){var f=this;return(f=a.call(this,i="[Parchment] "+i)||this).message=i,f.name=f.constructor.name,f}return P(r,a),r}(Error);_.ParchmentError=N;var o,k={},m={},y={},c={};function u(a,r){var i;if(void 0===r&&(r=o.ANY),"string"==typeof a)i=c[a]||k[a];else if(a instanceof Text||a.nodeType===Node.TEXT_NODE)i=c.text;else if("number"==typeof a)a&o.LEVEL&o.BLOCK?i=c.block:a&o.LEVEL&o.INLINE&&(i=c.inline);else if(a instanceof HTMLElement){var f=(a.getAttribute("class")||"").split(/\s+/);for(var n in f)if(i=m[f[n]])break;i=i||y[a.tagName]}return null==i?null:r&o.LEVEL&i.scope&&r&o.TYPE&i.scope?i:null}_.DATA_KEY="__blot",function(a){a[a.TYPE=3]="TYPE",a[a.LEVEL=12]="LEVEL",a[a.ATTRIBUTE=13]="ATTRIBUTE",a[a.BLOT=14]="BLOT",a[a.INLINE=7]="INLINE",a[a.BLOCK=11]="BLOCK",a[a.BLOCK_BLOT=10]="BLOCK_BLOT",a[a.INLINE_BLOT=6]="INLINE_BLOT",a[a.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",a[a.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",a[a.ANY=15]="ANY"}(o=_.Scope||(_.Scope={})),_.create=function t(a,r){var i=u(a);if(null==i)throw new N("Unable to create "+a+" blot");var f=i,n=a instanceof Node||a.nodeType===Node.TEXT_NODE?a:f.create(r);return new f(n,r)},_.find=function e(a,r){return void 0===r&&(r=!1),null==a?null:null!=a[_.DATA_KEY]?a[_.DATA_KEY].blot:r?e(a.parentNode,r):null},_.query=u,_.register=function l(){for(var a=[],r=0;r1)return a.map(function(n){return l(n)});var i=a[0];if("string"!=typeof i.blotName&&"string"!=typeof i.attrName)throw new N("Invalid definition");if("abstract"===i.blotName)throw new N("Cannot register abstract class");if(c[i.blotName||i.attrName]=i,"string"==typeof i.keyName)k[i.keyName]=i;else if(null!=i.className&&(m[i.className]=i),null!=i.tagName){i.tagName=Array.isArray(i.tagName)?i.tagName.map(function(n){return n.toUpperCase()}):i.tagName.toUpperCase();var f=Array.isArray(i.tagName)?i.tagName:[i.tagName];f.forEach(function(n){(null==y[n]||null==i.className)&&(y[n]=i)})}return i}},function(B,_,v){var P=v(51),N=v(11),k=v(3),m=v(20),y=String.fromCharCode(0),c=function(o){this.ops=Array.isArray(o)?o:null!=o&&Array.isArray(o.ops)?o.ops:[]};c.prototype.insert=function(o,t){var e={};return 0===o.length?this:(e.insert=o,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(e.attributes=t),this.push(e))},c.prototype.delete=function(o){return o<=0?this:this.push({delete:o})},c.prototype.retain=function(o,t){if(o<=0)return this;var e={retain:o};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(e.attributes=t),this.push(e)},c.prototype.push=function(o){var t=this.ops.length,e=this.ops[t-1];if(o=k(!0,{},o),"object"==typeof e){if("number"==typeof o.delete&&"number"==typeof e.delete)return this.ops[t-1]={delete:e.delete+o.delete},this;if("number"==typeof e.delete&&null!=o.insert&&"object"!=typeof(e=this.ops[(t-=1)-1]))return this.ops.unshift(o),this;if(N(o.attributes,e.attributes)){if("string"==typeof o.insert&&"string"==typeof e.insert)return this.ops[t-1]={insert:e.insert+o.insert},"object"==typeof o.attributes&&(this.ops[t-1].attributes=o.attributes),this;if("number"==typeof o.retain&&"number"==typeof e.retain)return this.ops[t-1]={retain:e.retain+o.retain},"object"==typeof o.attributes&&(this.ops[t-1].attributes=o.attributes),this}}return t===this.ops.length?this.ops.push(o):this.ops.splice(t,0,o),this},c.prototype.chop=function(){var o=this.ops[this.ops.length-1];return o&&o.retain&&!o.attributes&&this.ops.pop(),this},c.prototype.filter=function(o){return this.ops.filter(o)},c.prototype.forEach=function(o){this.ops.forEach(o)},c.prototype.map=function(o){return this.ops.map(o)},c.prototype.partition=function(o){var t=[],e=[];return this.forEach(function(u){(o(u)?t:e).push(u)}),[t,e]},c.prototype.reduce=function(o,t){return this.ops.reduce(o,t)},c.prototype.changeLength=function(){return this.reduce(function(o,t){return t.insert?o+m.length(t):t.delete?o-t.delete:o},0)},c.prototype.length=function(){return this.reduce(function(o,t){return o+m.length(t)},0)},c.prototype.slice=function(o,t){o=o||0,"number"!=typeof t&&(t=1/0);for(var e=[],u=m.iterator(this.ops),l=0;l0&&e.next(l.retain-a)}for(var r=new c(u);t.hasNext()||e.hasNext();)if("insert"===e.peekType())r.push(e.next());else if("delete"===t.peekType())r.push(t.next());else{var i=Math.min(t.peekLength(),e.peekLength()),f=t.next(i),n=e.next(i);if("number"==typeof n.retain){var s={};"number"==typeof f.retain?s.retain=i:s.insert=f.insert;var A=m.attributes.compose(f.attributes,n.attributes,"number"==typeof f.retain);if(A&&(s.attributes=A),r.push(s),!e.hasNext()&&N(r.ops[r.ops.length-1],s)){var g=new c(t.rest());return r.concat(g).chop()}}else"number"==typeof n.delete&&"number"==typeof f.retain&&r.push(n)}return r.chop()},c.prototype.concat=function(o){var t=new c(this.ops.slice());return o.ops.length>0&&(t.push(o.ops[0]),t.ops=t.ops.concat(o.ops.slice(1))),t},c.prototype.diff=function(o,t){if(this.ops===o.ops)return new c;var e=[this,o].map(function(i){return i.map(function(f){if(null!=f.insert)return"string"==typeof f.insert?f.insert:y;throw new Error("diff() called "+(i===o?"on":"with")+" non-document")}).join("")}),u=new c,l=P(e[0],e[1],t),a=m.iterator(this.ops),r=m.iterator(o.ops);return l.forEach(function(i){for(var f=i[1].length;f>0;){var n=0;switch(i[0]){case P.INSERT:n=Math.min(r.peekLength(),f),u.push(r.next(n));break;case P.DELETE:n=Math.min(f,a.peekLength()),a.next(n),u.delete(n);break;case P.EQUAL:n=Math.min(a.peekLength(),r.peekLength(),f);var s=a.next(n),A=r.next(n);N(s.insert,A.insert)?u.retain(n,m.attributes.diff(s.attributes,A.attributes)):u.push(A).delete(n)}f-=n}}),u.chop()},c.prototype.eachLine=function(o,t){t=t||"\n";for(var e=m.iterator(this.ops),u=new c,l=0;e.hasNext();){if("insert"!==e.peekType())return;var a=e.peek(),r=m.length(a)-e.peekLength(),i="string"==typeof a.insert?a.insert.indexOf(t,r)-r:-1;if(i<0)u.push(e.next());else if(i>0)u.push(e.next(i));else{if(!1===o(u,e.next(1).attributes||{},l))return;l+=1,u=new c}}u.length()>0&&o(u,{},l)},c.prototype.transform=function(o,t){if(t=!!t,"number"==typeof o)return this.transformPosition(o,t);for(var e=m.iterator(this.ops),u=m.iterator(o.ops),l=new c;e.hasNext()||u.hasNext();)if("insert"!==e.peekType()||!t&&"insert"===u.peekType())if("insert"===u.peekType())l.push(u.next());else{var a=Math.min(e.peekLength(),u.peekLength()),r=e.next(a),i=u.next(a);if(r.delete)continue;i.delete?l.push(i):l.retain(a,m.attributes.transform(r.attributes,i.attributes,t))}else l.retain(m.length(e.next()));return l.chop()},c.prototype.transformPosition=function(o,t){t=!!t;for(var e=m.iterator(this.ops),u=0;e.hasNext()&&u<=o;){var l=e.peekLength(),a=e.peekType();e.next(),"delete"!==a?("insert"===a&&(u"u"||v.call(e,a)},c=function(e,u){N&&"__proto__"===u.name?N(e,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):e[u.name]=u.newValue},o=function(e,u){if("__proto__"===u){if(!v.call(e,u))return;if(k)return k(e,u).value}return e[u]};B.exports=function t(){var e,u,l,a,r,i,f=arguments[0],n=1,s=arguments.length,A=!1;for("boolean"==typeof f&&(A=f,f=arguments[1]||{},n=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});n0&&(T1&&void 0!==arguments[1]&&arguments[1];if(q&&(0===T||T>=this.length()-1)){var D=this.clone();return 0===T?(this.parent.insertBefore(D,this),this):(this.parent.insertBefore(D,this.next),D)}var C=N(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"split",this).call(this,T,q);return this.cache={},C}}]),d}(t.default.Block);function p(h){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==h||("function"==typeof h.formats&&(d=(0,m.default)(d,h.formats())),null==h.parent||"scroll"==h.parent.blotName||h.parent.statics.scope!==h.statics.scope)?d:p(h.parent,d)}w.blotName="block",w.tagName="P",w.defaultChild="break",w.allowedChildren=[a.default,t.default.Embed,i.default],_.bubbleFormats=p,_.BlockEmbed=b,_.default=w},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.default=_.overload=_.expandConfig=void 0;var P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(I){return typeof I}:function(I){return I&&"function"==typeof Symbol&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},N=function(R,O){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return function I(R,O){var S=[],L=!0,F=!1,M=void 0;try{for(var j,x=R[Symbol.iterator]();!(L=(j=x.next()).done)&&(S.push(j.value),!O||S.length!==O);L=!0);}catch(U){F=!0,M=U}finally{try{!L&&x.return&&x.return()}finally{if(F)throw M}}return S}(R,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")},k=function(){function I(R,O){for(var S=0;S1&&void 0!==arguments[1]?arguments[1]:{};if(d(this,I),this.options=q(R,S),this.container=this.options.container,null==this.container)return E.error("Invalid Quill container",R);this.options.debug&&I.debug(this.options.debug);var L=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new e.default,this.scroll=r.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new o.default(this.scroll),this.selection=new f.default(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.theme.init(),this.emitter.on(e.default.events.EDITOR_CHANGE,function(M){M===e.default.events.TEXT_CHANGE&&O.root.classList.toggle("ql-blank",O.editor.isBlank())}),this.emitter.on(e.default.events.SCROLL_UPDATE,function(M,x){var j=O.selection.lastRange,U=j&&0===j.length?j.index:void 0;D.call(O,function(){return O.editor.update(null,x,U)},M)});var F=this.clipboard.convert("
"+L+"


");this.setContents(F),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return k(I,null,[{key:"debug",value:function(O){!0===O&&(O="log"),g.default.level(O)}},{key:"find",value:function(O){return O.__quill||r.default.find(O)}},{key:"import",value:function(O){return null==this.imports[O]&&E.error("Cannot import "+O+". Are you sure it was registered?"),this.imports[O]}},{key:"register",value:function(O,S){var L=this,F=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof O){var M=O.attrName||O.blotName;"string"==typeof M?this.register("formats/"+M,O,S):Object.keys(O).forEach(function(x){L.register(x,O[x],S)})}else null!=this.imports[O]&&!F&&E.warn("Overwriting "+O+" with",S),this.imports[O]=S,(O.startsWith("blots/")||O.startsWith("formats/"))&&"abstract"!==S.blotName?r.default.register(S):O.startsWith("modules")&&"function"==typeof S.register&&S.register()}}]),k(I,[{key:"addContainer",value:function(O){var S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof O){var L=O;(O=document.createElement("div")).classList.add(L)}return this.container.insertBefore(O,S),O}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(O,S,L){var F=this,M=C(O,S,L),x=N(M,4);return D.call(this,function(){return F.editor.deleteText(O,S)},L=x[3],O=x[0],-1*(S=x[1]))}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var O=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(O),this.container.classList.toggle("ql-disabled",!O)}},{key:"focus",value:function(){var O=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=O,this.scrollIntoView()}},{key:"format",value:function(O,S){var L=this,F=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default.sources.API;return D.call(this,function(){var M=L.getSelection(!0),x=new y.default;if(null==M)return x;if(r.default.query(O,r.default.Scope.BLOCK))x=L.editor.formatLine(M.index,M.length,h({},O,S));else{if(0===M.length)return L.selection.format(O,S),x;x=L.editor.formatText(M.index,M.length,h({},O,S))}return L.setSelection(M,e.default.sources.SILENT),x},F)}},{key:"formatLine",value:function(O,S,L,F,M){var j,x=this,U=C(O,S,L,F,M),H=N(U,4);return S=H[1],j=H[2],D.call(this,function(){return x.editor.formatLine(O,S,j)},M=H[3],O=H[0],0)}},{key:"formatText",value:function(O,S,L,F,M){var j,x=this,U=C(O,S,L,F,M),H=N(U,4);return S=H[1],j=H[2],D.call(this,function(){return x.editor.formatText(O,S,j)},M=H[3],O=H[0],0)}},{key:"getBounds",value:function(O){var S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,L=void 0;L="number"==typeof O?this.selection.getBounds(O,S):this.selection.getBounds(O.index,O.length);var F=this.container.getBoundingClientRect();return{bottom:L.bottom-F.top,height:L.height,left:L.left-F.left,right:L.right-F.left,top:L.top-F.top,width:L.width}}},{key:"getContents",value:function(){var O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-O,L=C(O,S),F=N(L,2);return this.editor.getContents(O=F[0],S=F[1])}},{key:"getFormat",value:function(){var O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof O?this.editor.getFormat(O,S):this.editor.getFormat(O.index,O.length)}},{key:"getIndex",value:function(O){return O.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(O){return this.scroll.leaf(O)}},{key:"getLine",value:function(O){return this.scroll.line(O)}},{key:"getLines",value:function(){var O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof O?this.scroll.lines(O.index,O.length):this.scroll.lines(O,S)}},{key:"getModule",value:function(O){return this.theme.modules[O]}},{key:"getSelection",value:function(){var O=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return O&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-O,L=C(O,S),F=N(L,2);return this.editor.getText(O=F[0],S=F[1])}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(O,S,L){var F=this,M=arguments.length>3&&void 0!==arguments[3]?arguments[3]:I.sources.API;return D.call(this,function(){return F.editor.insertEmbed(O,S,L)},M,O)}},{key:"insertText",value:function(O,S,L,F,M){var j,x=this,U=C(O,0,L,F,M),H=N(U,4);return j=H[2],D.call(this,function(){return x.editor.insertText(O,S,j)},M=H[3],O=H[0],S.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(O,S,L){this.clipboard.dangerouslyPasteHTML(O,S,L)}},{key:"removeFormat",value:function(O,S,L){var F=this,M=C(O,S,L),x=N(M,4);return S=x[1],D.call(this,function(){return F.editor.removeFormat(O,S)},L=x[3],O=x[0])}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(O){var S=this,L=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.default.sources.API;return D.call(this,function(){O=new y.default(O);var F=S.getLength(),M=S.editor.deleteText(0,F),x=S.editor.applyDelta(O),j=x.ops[x.ops.length-1];return null!=j&&"string"==typeof j.insert&&"\n"===j.insert[j.insert.length-1]&&(S.editor.deleteText(S.getLength()-1,1),x.delete(1)),M.compose(x)},L)}},{key:"setSelection",value:function(O,S,L){if(null==O)this.selection.setRange(null,S||I.sources.API);else{var F=C(O,S,L),M=N(F,4);L=M[3],this.selection.setRange(new i.Range(O=M[0],S=M[1]),L),L!==e.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(O){var S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.default.sources.API,L=(new y.default).insert(O);return this.setContents(L,S)}},{key:"update",value:function(){var O=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.default.sources.USER,S=this.scroll.update(O);return this.selection.update(O),S}},{key:"updateContents",value:function(O){var S=this,L=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.default.sources.API;return D.call(this,function(){return O=new y.default(O),S.editor.applyDelta(O,L)},L,!0)}}]),I}();function q(I,R){if((R=(0,s.default)(!0,{container:I,modules:{clipboard:!0,keyboard:!0,history:!0}},R)).theme&&R.theme!==T.DEFAULTS.theme){if(R.theme=T.import("themes/"+R.theme),null==R.theme)throw new Error("Invalid theme "+R.theme+". Did you register it?")}else R.theme=w.default;var O=(0,s.default)(!0,{},R.theme.DEFAULTS);[O,R].forEach(function(F){F.modules=F.modules||{},Object.keys(F.modules).forEach(function(M){!0===F.modules[M]&&(F.modules[M]={})})});var L=Object.keys(O.modules).concat(Object.keys(R.modules)).reduce(function(F,M){var x=T.import("modules/"+M);return null==x?E.error("Cannot load "+M+" module. Are you sure you registered it?"):F[M]=x.DEFAULTS||{},F},{});return null!=R.modules&&R.modules.toolbar&&R.modules.toolbar.constructor!==Object&&(R.modules.toolbar={container:R.modules.toolbar}),R=(0,s.default)(!0,{},T.DEFAULTS,{modules:L},O,R),["bounds","container","scrollingContainer"].forEach(function(F){"string"==typeof R[F]&&(R[F]=document.querySelector(R[F]))}),R.modules=Object.keys(R.modules).reduce(function(F,M){return R.modules[M]&&(F[M]=R.modules[M]),F},{}),R}function D(I,R,O,S){if(this.options.strict&&!this.isEnabled()&&R===e.default.sources.USER)return new y.default;var L=null==O?null:this.getSelection(),F=this.editor.delta,M=I();if(null!=L&&(!0===O&&(O=L.index),null==S?L=Z(L,M,R):0!==S&&(L=Z(L,O,S,R)),this.setSelection(L,e.default.sources.SILENT)),M.length()>0){var x,U,j=[e.default.events.TEXT_CHANGE,M,F,R];(x=this.emitter).emit.apply(x,[e.default.events.EDITOR_CHANGE].concat(j)),R!==e.default.sources.SILENT&&(U=this.emitter).emit.apply(U,j)}return M}function C(I,R,O,S,L){var F={};return"number"==typeof I.index&&"number"==typeof I.length?"number"!=typeof R?(L=S,S=O,O=R,R=I.length,I=I.index):(R=I.length,I=I.index):"number"!=typeof R&&(L=S,S=O,O=R,R=0),"object"===(typeof O>"u"?"undefined":P(O))?(F=O,L=S):"string"==typeof O&&(null!=S?F[O]=S:L=O),[I,R,F,L=L||e.default.sources.API]}function Z(I,R,O,S){if(null==I)return null;var L=void 0,F=void 0;if(R instanceof y.default){var M=[I.index,I.index+I.length].map(function(H){return R.transformPosition(H,S!==e.default.sources.USER)}),x=N(M,2);L=x[0],F=x[1]}else{var j=[I.index,I.index+I.length].map(function(H){return H=0?H+O:Math.max(R,H+O)}),U=N(j,2);L=U[0],F=U[1]}return new i.Range(L,F-L)}T.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},T.events=e.default.events,T.sources=e.default.sources,T.version="1.3.7",T.imports={delta:y.default,parchment:r.default,"core/module":l.default,"core/theme":w.default},_.expandConfig=q,_.overload=C,_.default=T},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=function(){function a(r,i){for(var f=0;f0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(f,n){var s=r.order.indexOf(f),A=r.order.indexOf(n);return s>=0||A>=0?s-A:f===n?0:f1?A-1:0),b=1;b1&&void 0!==arguments[1]?arguments[1]:{};P(this,k),this.quill=m,this.options=y};N.DEFAULTS={},_.default=N},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=["error","warn","log","info"],N="warn";function k(y){if(P.indexOf(y)<=P.indexOf(N)){for(var c,o=arguments.length,t=Array(o>1?o-1:0),e=1;e=0;l--)if(r[l]!=i[l])return!1;for(l=r.length-1;l>=0;l--)if(!m(t[a=r[l]],e[a],u))return!1;return typeof t==typeof e}(t,e,u))};function y(t){return null==t}function c(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=v(1),N=function(){function k(m,y,c){void 0===c&&(c={}),this.attrName=m,this.keyName=y,this.scope=null!=c.scope?c.scope&P.Scope.LEVEL|P.Scope.TYPE&P.Scope.ATTRIBUTE:P.Scope.ATTRIBUTE,null!=c.whitelist&&(this.whitelist=c.whitelist)}return k.keys=function(m){return[].map.call(m.attributes,function(y){return y.name})},k.prototype.add=function(m,y){return!!this.canAdd(m,y)&&(m.setAttribute(this.keyName,y),!0)},k.prototype.canAdd=function(m,y){return null!=P.query(m,P.Scope.BLOT&(this.scope|P.Scope.TYPE))&&(null==this.whitelist||("string"==typeof y?this.whitelist.indexOf(y.replace(/["']/g,""))>-1:this.whitelist.indexOf(y)>-1))},k.prototype.remove=function(m){m.removeAttribute(this.keyName)},k.prototype.value=function(m){var y=m.getAttribute(this.keyName);return this.canAdd(m,y)&&y?y:""},k}();_.default=N},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.default=_.Code=void 0;var P=function(w,p){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return function b(w,p){var h=[],d=!0,E=!1,T=void 0;try{for(var D,q=w[Symbol.iterator]();!(d=(D=q.next()).done)&&(h.push(D.value),!p||h.length!==p);d=!0);}catch(C){E=!0,T=C}finally{try{!d&&q.return&&q.return()}finally{if(E)throw T}}return h}(w,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")},N=function(){function b(w,p){for(var h=0;h=h+d)){var D=this.newlineIndex(h,!0)+1,C=q-D+1,Z=this.isolate(D,C),I=Z.next;Z.format(E,T),I instanceof w&&I.formatAt(0,h-D+d-C,E,T)}}}},{key:"insertAt",value:function(h,d,E){if(null==E){var T=this.descendant(r.default,h),q=P(T,2);q[0].insertAt(q[1],d)}}},{key:"length",value:function(){var h=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?h:h+1}},{key:"newlineIndex",value:function(h){var d=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(d)return this.domNode.textContent.slice(0,h).lastIndexOf("\n");var E=this.domNode.textContent.slice(h).indexOf("\n");return E>-1?h+E:-1}},{key:"optimize",value:function(h){this.domNode.textContent.endsWith("\n")||this.appendChild(o.default.create("text","\n")),k(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"optimize",this).call(this,h);var d=this.next;null!=d&&d.prev===this&&d.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===d.statics.formats(d.domNode)&&(d.optimize(h),d.moveChildren(this),d.remove())}},{key:"replace",value:function(h){k(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"replace",this).call(this,h),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(d){var E=o.default.find(d);null==E?d.parentNode.removeChild(d):E instanceof o.default.Embed?E.remove():E.unwrap()})}}],[{key:"create",value:function(h){var d=k(w.__proto__||Object.getPrototypeOf(w),"create",this).call(this,h);return d.setAttribute("spellcheck",!1),d}},{key:"formats",value:function(){return!0}}]),w}(e.default);g.blotName="code-block",g.tagName="PRE",g.TAB=" ",_.Code=A,_.default=g},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(I){return typeof I}:function(I){return I&&"function"==typeof Symbol&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},N=function(R,O){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return function I(R,O){var S=[],L=!0,F=!1,M=void 0;try{for(var j,x=R[Symbol.iterator]();!(L=(j=x.next()).done)&&(S.push(j.value),!O||S.length!==O);L=!0);}catch(U){F=!0,M=U}finally{try{!L&&x.return&&x.return()}finally{if(F)throw M}}return S}(R,O);throw new TypeError("Invalid attempt to destructure non-iterable instance")},k=function(){function I(R,O){for(var S=0;S=F&&!H.endsWith("\n")&&(L=!0),S.scroll.insertAt(M,H);var V=S.scroll.line(M),Y=N(V,2),X=Y[0],Q=Y[1],nt=(0,h.default)({},(0,i.bubbleFormats)(X));if(X instanceof f.default){var rt=X.descendant(e.default.Leaf,Q),at=N(rt,1);nt=(0,h.default)(nt,(0,i.bubbleFormats)(at[0]))}U=o.default.attributes.diff(nt,U)||{}}else if("object"===P(x.insert)){var z=Object.keys(x.insert)[0];if(null==z)return M;S.scroll.insertAt(M,z,x.insert[z])}F+=j}return Object.keys(U).forEach(function(K){S.scroll.formatAt(M,j,K,U[K])}),M+j},0),O.reduce(function(M,x){return"number"==typeof x.delete?(S.scroll.deleteAt(M,x.delete),M):M+(x.retain||x.insert.length||1)},0),this.scroll.batchEnd(),this.update(O)}},{key:"deleteText",value:function(O,S){return this.scroll.deleteAt(O,S),this.update((new y.default).retain(O).delete(S))}},{key:"formatLine",value:function(O,S){var L=this,F=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(F).forEach(function(M){if(null==L.scroll.whitelist||L.scroll.whitelist[M]){var x=L.scroll.lines(O,Math.max(S,1)),j=S;x.forEach(function(U){var H=U.length();if(U instanceof l.default){var V=O-U.offset(L.scroll),Y=U.newlineIndex(V+j)-V+1;U.formatAt(V,Y,M,F[M])}else U.format(M,F[M]);j-=H})}}),this.scroll.optimize(),this.update((new y.default).retain(O).retain(S,(0,g.default)(F)))}},{key:"formatText",value:function(O,S){var L=this,F=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(F).forEach(function(M){L.scroll.formatAt(O,S,M,F[M])}),this.update((new y.default).retain(O).retain(S,(0,g.default)(F)))}},{key:"getContents",value:function(O,S){return this.delta.slice(O,O+S)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(O,S){return O.concat(S.delta())},new y.default)}},{key:"getFormat",value:function(O){var S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,L=[],F=[];0===S?this.scroll.path(O).forEach(function(x){var U=N(x,1)[0];U instanceof f.default?L.push(U):U instanceof e.default.Leaf&&F.push(U)}):(L=this.scroll.lines(O,S),F=this.scroll.descendants(e.default.Leaf,O,S));var M=[L,F].map(function(x){if(0===x.length)return{};for(var j=(0,i.bubbleFormats)(x.shift());Object.keys(j).length>0;){var U=x.shift();if(null==U)return j;j=C((0,i.bubbleFormats)(U),j)}return j});return h.default.apply(h.default,M)}},{key:"getText",value:function(O,S){return this.getContents(O,S).filter(function(L){return"string"==typeof L.insert}).map(function(L){return L.insert}).join("")}},{key:"insertEmbed",value:function(O,S,L){return this.scroll.insertAt(O,S,L),this.update((new y.default).retain(O).insert(function E(I,R,O){return R in I?Object.defineProperty(I,R,{value:O,enumerable:!0,configurable:!0,writable:!0}):I[R]=O,I}({},S,L)))}},{key:"insertText",value:function(O,S){var L=this,F=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return S=S.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(O,S),Object.keys(F).forEach(function(M){L.scroll.formatAt(O,S.length,M,F[M])}),this.update((new y.default).retain(O).insert(S,(0,g.default)(F)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var O=this.scroll.children.head;return!(O.statics.blotName!==f.default.blotName||O.children.length>1)&&O.children.head instanceof s.default}},{key:"removeFormat",value:function(O,S){var L=this.getText(O,S),F=this.scroll.line(O+S),M=N(F,2),x=M[0],j=M[1],U=0,H=new y.default;null!=x&&(U=x instanceof l.default?x.newlineIndex(j)-j+1:x.length()-j,H=x.delta().slice(j,j+U-1).insert("\n"));var Y=this.getContents(O,S+U).diff((new y.default).insert(L).concat(H)),X=(new y.default).retain(O).concat(Y);return this.applyDelta(X)}},{key:"update",value:function(O){var S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],L=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,F=this.delta;if(1===S.length&&"characterData"===S[0].type&&S[0].target.data.match(q)&&e.default.find(S[0].target)){var M=e.default.find(S[0].target),x=(0,i.bubbleFormats)(M),j=M.offset(this.scroll),U=S[0].oldValue.replace(r.default.CONTENTS,""),H=(new y.default).insert(U),V=(new y.default).insert(M.value()),Y=(new y.default).retain(j).concat(H.diff(V,L));O=Y.reduce(function(X,Q){return Q.insert?X.insert(Q.insert,x):X.push(Q)},new y.default),this.delta=F.compose(O)}else this.delta=this.getDelta(),(!O||!(0,w.default)(F.compose(O),this.delta))&&(O=F.diff(this.delta,L));return O}}]),I}();function C(I,R){return Object.keys(R).reduce(function(O,S){return null==I[S]||(R[S]===I[S]?O[S]=R[S]:Array.isArray(R[S])?R[S].indexOf(I[S])<0&&(O[S]=R[S].concat([I[S]])):O[S]=[R[S],I[S]]),O},{})}_.default=D},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.default=_.Range=void 0;var P=function(w,p){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return function b(w,p){var h=[],d=!0,E=!1,T=void 0;try{for(var D,q=w[Symbol.iterator]();!(d=(D=q.next()).done)&&(h.push(D.value),!p||h.length!==p);d=!0);}catch(C){E=!0,T=C}finally{try{!d&&q.return&&q.return()}finally{if(E)throw T}}return h}(w,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")},N=function(){function b(w,p){for(var h=0;h1&&void 0!==arguments[1]?arguments[1]:0;f(this,b),this.index=w,this.length=p},A=function(){function b(w,p){var h=this;f(this,b),this.emitter=p,this.scroll=w,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=m.default.create("cursor",this),this.lastRange=this.savedRange=new s(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){h.mouseDown||setTimeout(h.update.bind(h,u.default.sources.USER),1)}),this.emitter.on(u.default.events.EDITOR_CHANGE,function(d,E){d===u.default.events.TEXT_CHANGE&&E.length()>0&&h.update(u.default.sources.SILENT)}),this.emitter.on(u.default.events.SCROLL_BEFORE_UPDATE,function(){if(h.hasFocus()){var d=h.getNativeRange();null!=d&&d.start.node!==h.cursor.textNode&&h.emitter.once(u.default.events.SCROLL_UPDATE,function(){try{h.setNativeRange(d.start.node,d.start.offset,d.end.node,d.end.offset)}catch{}})}}),this.emitter.on(u.default.events.SCROLL_OPTIMIZE,function(d,E){if(E.range){var T=E.range;h.setNativeRange(T.startNode,T.startOffset,T.endNode,T.endOffset)}}),this.update(u.default.sources.SILENT)}return N(b,[{key:"handleComposition",value:function(){var p=this;this.root.addEventListener("compositionstart",function(){p.composing=!0}),this.root.addEventListener("compositionend",function(){if(p.composing=!1,p.cursor.parent){var h=p.cursor.restore();if(!h)return;setTimeout(function(){p.setNativeRange(h.startNode,h.startOffset,h.endNode,h.endOffset)},1)}})}},{key:"handleDragging",value:function(){var p=this;this.emitter.listenDOM("mousedown",document.body,function(){p.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){p.mouseDown=!1,p.update(u.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(p,h){if(null==this.scroll.whitelist||this.scroll.whitelist[p]){this.scroll.update();var d=this.getNativeRange();if(null!=d&&d.native.collapsed&&!m.default.query(p,m.default.Scope.BLOCK)){if(d.start.node!==this.cursor.textNode){var E=m.default.find(d.start.node,!1);if(null==E)return;if(E instanceof m.default.Leaf){var T=E.split(d.start.offset);E.parent.insertBefore(this.cursor,T)}else E.insertBefore(this.cursor,d.start.node);this.cursor.attach()}this.cursor.format(p,h),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(p){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,d=this.scroll.length();p=Math.min(p,d-1),h=Math.min(p+h,d-1)-p;var E=void 0,T=this.scroll.leaf(p),q=P(T,2),D=q[0],C=q[1];if(null==D)return null;var Z=D.position(C,!0),I=P(Z,2);E=I[0],C=I[1];var R=document.createRange();if(h>0){R.setStart(E,C);var O=this.scroll.leaf(p+h),S=P(O,2);if(null==(D=S[0]))return null;var L=D.position(C=S[1],!0),F=P(L,2);return R.setEnd(E=F[0],C=F[1]),R.getBoundingClientRect()}var M="left",x=void 0;return E instanceof Text?(C0&&(M="right")),{bottom:x.top+x.height,height:x.height,left:x[M],right:x[M],top:x.top,width:0}}},{key:"getNativeRange",value:function(){var p=document.getSelection();if(null==p||p.rangeCount<=0)return null;var h=p.getRangeAt(0);if(null==h)return null;var d=this.normalizeNative(h);return n.info("getNativeRange",d),d}},{key:"getRange",value:function(){var p=this.getNativeRange();return null==p?[null,null]:[this.normalizedToRange(p),p]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(p){var h=this,d=[[p.start.node,p.start.offset]];p.native.collapsed||d.push([p.end.node,p.end.offset]);var E=d.map(function(D){var C=P(D,2),Z=C[0],I=C[1],R=m.default.find(Z,!0),O=R.offset(h.scroll);return 0===I?O:R instanceof m.default.Container?O+R.length():O+R.index(Z,I)}),T=Math.min(Math.max.apply(Math,i(E)),this.scroll.length()-1),q=Math.min.apply(Math,[T].concat(i(E)));return new s(q,T-q)}},{key:"normalizeNative",value:function(p){if(!g(this.root,p.startContainer)||!p.collapsed&&!g(this.root,p.endContainer))return null;var h={start:{node:p.startContainer,offset:p.startOffset},end:{node:p.endContainer,offset:p.endOffset},native:p};return[h.start,h.end].forEach(function(d){for(var E=d.node,T=d.offset;!(E instanceof Text)&&E.childNodes.length>0;)if(E.childNodes.length>T)E=E.childNodes[T],T=0;else{if(E.childNodes.length!==T)break;T=(E=E.lastChild)instanceof Text?E.data.length:E.childNodes.length+1}d.node=E,d.offset=T}),h}},{key:"rangeToNative",value:function(p){var h=this,d=p.collapsed?[p.index]:[p.index,p.index+p.length],E=[],T=this.scroll.length();return d.forEach(function(q,D){q=Math.min(T-1,q);var Z=h.scroll.leaf(q),I=P(Z,2),O=I[1],S=I[0].position(O,0!==D),L=P(S,2);E.push(L[0],O=L[1])}),E.length<2&&(E=E.concat(E)),E}},{key:"scrollIntoView",value:function(p){var h=this.lastRange;if(null!=h){var d=this.getBounds(h.index,h.length);if(null!=d){var E=this.scroll.length()-1,T=this.scroll.line(Math.min(h.index,E)),D=P(T,1)[0],C=D;if(h.length>0){var Z=this.scroll.line(Math.min(h.index+h.length,E));C=P(Z,1)[0]}if(null!=D&&null!=C){var R=p.getBoundingClientRect();d.topR.bottom&&(p.scrollTop+=d.bottom-R.bottom)}}}}},{key:"setNativeRange",value:function(p,h){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p,E=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h,T=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(n.info("setNativeRange",p,h,d,E),null==p||null!=this.root.parentNode&&null!=p.parentNode&&null!=d.parentNode){var q=document.getSelection();if(null!=q)if(null!=p){this.hasFocus()||this.root.focus();var D=(this.getNativeRange()||{}).native;if(null==D||T||p!==D.startContainer||h!==D.startOffset||d!==D.endContainer||E!==D.endOffset){"BR"==p.tagName&&(h=[].indexOf.call(p.parentNode.childNodes,p),p=p.parentNode),"BR"==d.tagName&&(E=[].indexOf.call(d.parentNode.childNodes,d),d=d.parentNode);var C=document.createRange();C.setStart(p,h),C.setEnd(d,E),q.removeAllRanges(),q.addRange(C)}}else q.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(p){var h=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default.sources.API;if("string"==typeof h&&(d=h,h=!1),n.info("setRange",p),null!=p){var E=this.rangeToNative(p);this.setNativeRange.apply(this,i(E).concat([h]))}else this.setNativeRange(null);this.update(d)}},{key:"update",value:function(){var p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.default.sources.USER,h=this.lastRange,d=this.getRange(),E=P(d,2),T=E[0],q=E[1];if(this.lastRange=T,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,t.default)(h,this.lastRange)){var D;!this.composing&&null!=q&&q.native.collapsed&&q.start.node!==this.cursor.textNode&&this.cursor.restore();var Z,C=[u.default.events.SELECTION_CHANGE,(0,c.default)(this.lastRange),(0,c.default)(h),p];(D=this.emitter).emit.apply(D,[u.default.events.EDITOR_CHANGE].concat(C)),p!==u.default.sources.SILENT&&(Z=this.emitter).emit.apply(Z,C)}}}]),b}();function g(b,w){return w instanceof Text&&(w=w.parentNode),b.contains(w)}_.Range=s,_.default=A},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=function(){function u(l,a){for(var r=0;r0&&(e+=1),[this.parent.domNode,e]},c.prototype.value=function(){var o;return(o={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,o},c.scope=k.Scope.INLINE_BLOT,c}(N.default);_.default=m},function(B,_,v){var P=v(11),N=v(3),k={attributes:{compose:function(y,c,o){"object"!=typeof y&&(y={}),"object"!=typeof c&&(c={});var t=N(!0,{},c);for(var e in o||(t=Object.keys(t).reduce(function(u,l){return null!=t[l]&&(u[l]=t[l]),u},{})),y)void 0!==y[e]&&void 0===c[e]&&(t[e]=y[e]);return Object.keys(t).length>0?t:void 0},diff:function(y,c){"object"!=typeof y&&(y={}),"object"!=typeof c&&(c={});var o=Object.keys(y).concat(Object.keys(c)).reduce(function(t,e){return P(y[e],c[e])||(t[e]=void 0===c[e]?null:c[e]),t},{});return Object.keys(o).length>0?o:void 0},transform:function(y,c,o){if("object"!=typeof y)return c;if("object"==typeof c){if(!o)return c;var t=Object.keys(c).reduce(function(e,u){return void 0===y[u]&&(e[u]=c[u]),e},{});return Object.keys(t).length>0?t:void 0}}},iterator:function(y){return new m(y)},length:function(y){return"number"==typeof y.delete?y.delete:"number"==typeof y.retain?y.retain:"string"==typeof y.insert?y.insert.length:1}};function m(y){this.ops=y,this.index=0,this.offset=0}m.prototype.hasNext=function(){return this.peekLength()<1/0},m.prototype.next=function(y){y||(y=1/0);var c=this.ops[this.index];if(c){var o=this.offset,t=k.length(c);if(y>=t-o?(y=t-o,this.index+=1,this.offset=0):this.offset+=y,"number"==typeof c.delete)return{delete:y};var e={};return c.attributes&&(e.attributes=c.attributes),"number"==typeof c.retain?e.retain=y:e.insert="string"==typeof c.insert?c.insert.substr(o,y):c.insert,e}return{retain:1/0}},m.prototype.peek=function(){return this.ops[this.index]},m.prototype.peekLength=function(){return this.ops[this.index]?k.length(this.ops[this.index])-this.offset:1/0},m.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},m.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var y=this.offset,c=this.index,o=this.next(),t=this.ops.slice(this.index);return this.offset=y,this.index=c,[o].concat(t)}return[]},B.exports=k},function(B,_){var v=function(){"use strict";function P(l,a){return null!=a&&l instanceof a}var N,k,m;try{N=Map}catch{N=function(){}}try{k=Set}catch{k=function(){}}try{m=Promise}catch{m=function(){}}function y(l,a,r,i,f){"object"==typeof a&&(r=a.depth,i=a.prototype,f=a.includeNonEnumerable,a=a.circular);var n=[],s=[],A=typeof Buffer<"u";return typeof a>"u"&&(a=!0),typeof r>"u"&&(r=1/0),function g(b,w){if(null===b)return null;if(0===w)return b;var p,h;if("object"!=typeof b)return b;if(P(b,N))p=new N;else if(P(b,k))p=new k;else if(P(b,m))p=new m(function(R,O){b.then(function(S){R(g(S,w-1))},function(S){O(g(S,w-1))})});else if(y.__isArray(b))p=[];else if(y.__isRegExp(b))p=new RegExp(b.source,u(b)),b.lastIndex&&(p.lastIndex=b.lastIndex);else if(y.__isDate(b))p=new Date(b.getTime());else{if(A&&Buffer.isBuffer(b))return p=Buffer.allocUnsafe?Buffer.allocUnsafe(b.length):new Buffer(b.length),b.copy(p),p;P(b,Error)?p=Object.create(b):typeof i>"u"?(h=Object.getPrototypeOf(b),p=Object.create(h)):(p=Object.create(i),h=i)}if(a){var d=n.indexOf(b);if(-1!=d)return s[d];n.push(b),s.push(p)}for(var E in P(b,N)&&b.forEach(function(R,O){var S=g(O,w-1),L=g(R,w-1);p.set(S,L)}),P(b,k)&&b.forEach(function(R){var O=g(R,w-1);p.add(O)}),b){var T;h&&(T=Object.getOwnPropertyDescriptor(h,E)),(!T||null!=T.set)&&(p[E]=g(b[E],w-1))}if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(b);for(E=0;E0){if(C instanceof t.BlockEmbed||O instanceof t.BlockEmbed)return void this.optimize();if(C instanceof r.default){var S=C.newlineIndex(C.length(),!0);if(S>-1&&(C=C.split(S+1))===O)return void this.optimize()}else if(O instanceof r.default){var L=O.newlineIndex(0);L>-1&&O.split(L+1)}C.moveChildren(O,O.children.head instanceof l.default?null:O.children.head),C.remove()}this.optimize()}},{key:"enable",value:function(){var E=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",E)}},{key:"formatAt",value:function(E,T,q,D){null!=this.whitelist&&!this.whitelist[q]||(k(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"formatAt",this).call(this,E,T,q,D),this.optimize())}},{key:"insertAt",value:function(E,T,q){if(null==q||null==this.whitelist||this.whitelist[T]){if(E>=this.length())if(null==q||null==y.default.query(T,y.default.Scope.BLOCK)){var D=y.default.create(this.statics.defaultChild);this.appendChild(D),null==q&&T.endsWith("\n")&&(T=T.slice(0,-1)),D.insertAt(0,T,q)}else{var C=y.default.create(T,q);this.appendChild(C)}else k(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"insertAt",this).call(this,E,T,q);this.optimize()}}},{key:"insertBefore",value:function(E,T){if(E.statics.scope===y.default.Scope.INLINE_BLOT){var q=y.default.create(this.statics.defaultChild);q.appendChild(E),E=q}k(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"insertBefore",this).call(this,E,T)}},{key:"leaf",value:function(E){return this.path(E).pop()||[null,-1]}},{key:"line",value:function(E){return E===this.length()?this.line(E-1):this.descendant(b,E)}},{key:"lines",value:function(){var E=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,T=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,q=function D(C,Z,I){var R=[],O=I;return C.children.forEachAt(Z,I,function(S,L,F){b(S)?R.push(S):S instanceof y.default.Container&&(R=R.concat(D(S,L,O))),O-=F}),R};return q(this,E,T)}},{key:"optimize",value:function(){var E=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],T=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(k(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"optimize",this).call(this,E,T),E.length>0&&this.emitter.emit(o.default.events.SCROLL_OPTIMIZE,E,T))}},{key:"path",value:function(E){return k(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"path",this).call(this,E).slice(1)}},{key:"update",value:function(E){if(!0!==this.batch){var T=o.default.sources.USER;"string"==typeof E&&(T=E),Array.isArray(E)||(E=this.observer.takeRecords()),E.length>0&&this.emitter.emit(o.default.events.SCROLL_BEFORE_UPDATE,T,E),k(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"update",this).call(this,E.concat([])),E.length>0&&this.emitter.emit(o.default.events.SCROLL_UPDATE,T,E)}}}]),h}(y.default.Scroll);w.blotName="scroll",w.className="ql-editor",w.tagName="DIV",w.defaultChild="block",w.allowedChildren=[e.default,t.BlockEmbed,f.default],_.default=w},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.SHORTKEY=_.default=void 0;var P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(x){return typeof x}:function(x){return x&&"function"==typeof Symbol&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},N=function(j,U){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return function x(j,U){var H=[],V=!0,Y=!1,X=void 0;try{for(var nt,Q=j[Symbol.iterator]();!(V=(nt=Q.next()).done)&&(H.push(nt.value),!U||H.length!==U);V=!0);}catch(rt){Y=!0,X=rt}finally{try{!V&&Q.return&&Q.return()}finally{if(Y)throw X}}return H}(j,U);throw new TypeError("Invalid attempt to destructure non-iterable instance")},k=function(){function x(j,U){for(var H=0;H1&&void 0!==arguments[1]?arguments[1]:{},Y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},X=M(H);if(null==X||null==X.key)return q.warn("Attempted to add invalid keyboard binding",X);"function"==typeof V&&(V={handler:V}),"function"==typeof Y&&(Y={handler:Y}),X=(0,e.default)(X,V,Y),this.bindings[X.key]=this.bindings[X.key]||[],this.bindings[X.key].push(X)}},{key:"listen",value:function(){var H=this;this.quill.root.addEventListener("keydown",function(V){if(!V.defaultPrevented){var X=(H.bindings[V.which||V.keyCode]||[]).filter(function(ot){return j.match(V,ot)});if(0!==X.length){var Q=H.quill.getSelection();if(null!=Q&&H.quill.hasFocus()){var nt=H.quill.getLine(Q.index),rt=N(nt,2),at=rt[0],lt=rt[1],z=H.quill.getLeaf(Q.index),K=N(z,2),$=K[0],G=K[1],W=0===Q.length?[$,G]:H.quill.getLeaf(Q.index+Q.length),J=N(W,2),tt=J[0],et=J[1],ut=$ instanceof f.default.Text?$.value().slice(0,G):"",ft=tt instanceof f.default.Text?tt.value().slice(et):"",it={collapsed:0===Q.length,empty:0===Q.length&&at.length()<=1,format:H.quill.getFormat(Q),offset:lt,prefix:ut,suffix:ft};X.some(function(ot){if(null!=ot.collapsed&&ot.collapsed!==it.collapsed||null!=ot.empty&&ot.empty!==it.empty||null!=ot.offset&&ot.offset!==it.offset)return!1;if(Array.isArray(ot.format)){if(ot.format.every(function(st){return null==it.format[st]}))return!1}else if("object"===P(ot.format)&&!Object.keys(ot.format).every(function(st){return!0===ot.format[st]?null!=it.format[st]:!1===ot.format[st]?null==it.format[st]:(0,o.default)(ot.format[st],it.format[st])}))return!1;return!(null!=ot.prefix&&!ot.prefix.test(it.prefix)||null!=ot.suffix&&!ot.suffix.test(it.suffix))&&!0!==ot.handler.call(H,Q,it)})&&V.preventDefault()}}}})}}]),j}(w.default);function Z(x,j){var U;return h(U={key:x,shiftKey:j,altKey:null},x===C.keys.LEFT?"prefix":"suffix",/^$/),h(U,"handler",function(Y){var X=Y.index;x===C.keys.RIGHT&&(X+=Y.length+1);var Q=this.quill.getLeaf(X);return!(N(Q,1)[0]instanceof f.default.Embed&&(x===C.keys.LEFT?j?this.quill.setSelection(Y.index-1,Y.length+1,s.default.sources.USER):this.quill.setSelection(Y.index-1,s.default.sources.USER):j?this.quill.setSelection(Y.index,Y.length+1,s.default.sources.USER):this.quill.setSelection(Y.index+Y.length+1,s.default.sources.USER),1))}),U}function I(x,j){if(!(0===x.index||this.quill.getLength()<=1)){var U=this.quill.getLine(x.index),V=N(U,1)[0],Y={};if(0===j.offset){var X=this.quill.getLine(x.index-1),nt=N(X,1)[0];if(null!=nt&&nt.length()>1){var rt=V.formats(),at=this.quill.getFormat(x.index-1,1);Y=r.default.attributes.diff(rt,at)||{}}}var lt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(j.prefix)?2:1;this.quill.deleteText(x.index-lt,lt,s.default.sources.USER),Object.keys(Y).length>0&&this.quill.formatLine(x.index-lt,lt,Y,s.default.sources.USER),this.quill.focus()}}function R(x,j){var U=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(j.suffix)?2:1;if(!(x.index>=this.quill.getLength()-U)){var H={},V=0,Y=this.quill.getLine(x.index),Q=N(Y,1)[0];if(j.offset>=Q.length()-1){var nt=this.quill.getLine(x.index+1),at=N(nt,1)[0];if(at){var lt=Q.formats(),z=this.quill.getFormat(x.index,1);H=r.default.attributes.diff(lt,z)||{},V=at.length()}}this.quill.deleteText(x.index,U,s.default.sources.USER),Object.keys(H).length>0&&this.quill.formatLine(x.index+V-1,U,H,s.default.sources.USER)}}function O(x){var j=this.quill.getLines(x),U={};if(j.length>1){var H=j[0].formats(),V=j[j.length-1].formats();U=r.default.attributes.diff(V,H)||{}}this.quill.deleteText(x,s.default.sources.USER),Object.keys(U).length>0&&this.quill.formatLine(x.index,1,U,s.default.sources.USER),this.quill.setSelection(x.index,s.default.sources.SILENT),this.quill.focus()}function S(x,j){var U=this;x.length>0&&this.quill.scroll.deleteAt(x.index,x.length);var H=Object.keys(j.format).reduce(function(V,Y){return f.default.query(Y,f.default.Scope.BLOCK)&&!Array.isArray(j.format[Y])&&(V[Y]=j.format[Y]),V},{});this.quill.insertText(x.index,"\n",H,s.default.sources.USER),this.quill.setSelection(x.index+1,s.default.sources.SILENT),this.quill.focus(),Object.keys(j.format).forEach(function(V){null==H[V]&&(Array.isArray(j.format[V])||"link"!==V&&U.quill.format(V,j.format[V],s.default.sources.USER))})}function L(x){return{key:C.keys.TAB,shiftKey:!x,format:{"code-block":!0},handler:function(U){var H=f.default.query("code-block"),V=U.index,Y=U.length,X=this.quill.scroll.descendant(H,V),Q=N(X,2),nt=Q[0],rt=Q[1];if(null!=nt){var at=this.quill.getIndex(nt),lt=nt.newlineIndex(rt,!0)+1,z=nt.newlineIndex(at+rt+Y),K=nt.domNode.textContent.slice(lt,z).split("\n");rt=0,K.forEach(function($,G){x?(nt.insertAt(lt+rt,H.TAB),rt+=H.TAB.length,0===G?V+=H.TAB.length:Y+=H.TAB.length):$.startsWith(H.TAB)&&(nt.deleteAt(lt+rt,H.TAB.length),rt-=H.TAB.length,0===G?V-=H.TAB.length:Y-=H.TAB.length),rt+=$.length+1}),this.quill.update(s.default.sources.USER),this.quill.setSelection(V,Y,s.default.sources.SILENT)}}}}function F(x){return{key:x[0].toUpperCase(),shortKey:!0,handler:function(U,H){this.quill.format(x,!H.format[x],s.default.sources.USER)}}}function M(x){if("string"==typeof x||"number"==typeof x)return M({key:x});if("object"===(typeof x>"u"?"undefined":P(x))&&(x=(0,y.default)(x,!1)),"string"==typeof x.key)if(null!=C.keys[x.key.toUpperCase()])x.key=C.keys[x.key.toUpperCase()];else{if(1!==x.key.length)return null;x.key=x.key.toUpperCase().charCodeAt(0)}return x.shortKey&&(x[D]=x.shortKey,delete x.shortKey),x}C.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},C.DEFAULTS={bindings:{bold:F("bold"),italic:F("italic"),underline:F("underline"),indent:{key:C.keys.TAB,format:["blockquote","indent","list"],handler:function(j,U){if(U.collapsed&&0!==U.offset)return!0;this.quill.format("indent","+1",s.default.sources.USER)}},outdent:{key:C.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(j,U){if(U.collapsed&&0!==U.offset)return!0;this.quill.format("indent","-1",s.default.sources.USER)}},"outdent backspace":{key:C.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(j,U){null!=U.format.indent?this.quill.format("indent","-1",s.default.sources.USER):null!=U.format.list&&this.quill.format("list",!1,s.default.sources.USER)}},"indent code-block":L(!0),"outdent code-block":L(!1),"remove tab":{key:C.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(j){this.quill.deleteText(j.index-1,1,s.default.sources.USER)}},tab:{key:C.keys.TAB,handler:function(j){this.quill.history.cutoff();var U=(new l.default).retain(j.index).delete(j.length).insert("\t");this.quill.updateContents(U,s.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(j.index+1,s.default.sources.SILENT)}},"list empty enter":{key:C.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(j,U){this.quill.format("list",!1,s.default.sources.USER),U.format.indent&&this.quill.format("indent",!1,s.default.sources.USER)}},"checklist enter":{key:C.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(j){var U=this.quill.getLine(j.index),H=N(U,2),V=H[0],Y=H[1],X=(0,e.default)({},V.formats(),{list:"checked"}),Q=(new l.default).retain(j.index).insert("\n",X).retain(V.length()-Y-1).retain(1,{list:"unchecked"});this.quill.updateContents(Q,s.default.sources.USER),this.quill.setSelection(j.index+1,s.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:C.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(j,U){var H=this.quill.getLine(j.index),V=N(H,2),Y=V[0],X=V[1],Q=(new l.default).retain(j.index).insert("\n",U.format).retain(Y.length()-X-1).retain(1,{header:null});this.quill.updateContents(Q,s.default.sources.USER),this.quill.setSelection(j.index+1,s.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(j,U){var H=U.prefix.length,V=this.quill.getLine(j.index),Y=N(V,2),X=Y[0],Q=Y[1];if(Q>H)return!0;var nt=void 0;switch(U.prefix.trim()){case"[]":case"[ ]":nt="unchecked";break;case"[x]":nt="checked";break;case"-":case"*":nt="bullet";break;default:nt="ordered"}this.quill.insertText(j.index," ",s.default.sources.USER),this.quill.history.cutoff();var rt=(new l.default).retain(j.index-Q).delete(H+1).retain(X.length()-2-Q).retain(1,{list:nt});this.quill.updateContents(rt,s.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(j.index-H,s.default.sources.SILENT)}},"code exit":{key:C.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(j){var U=this.quill.getLine(j.index),H=N(U,2),V=H[0],Y=H[1],X=(new l.default).retain(j.index+V.length()-Y-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(X,s.default.sources.USER)}},"embed left":Z(C.keys.LEFT,!1),"embed left shift":Z(C.keys.LEFT,!0),"embed right":Z(C.keys.RIGHT,!1),"embed right shift":Z(C.keys.RIGHT,!0)}},_.default=C,_.SHORTKEY=D},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var N=function r(i,f,n){null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,f);if(void 0===s){var A=Object.getPrototypeOf(i);return null===A?void 0:r(A,f,n)}if("value"in s)return s.value;var g=s.get;return void 0===g?void 0:g.call(n)},k=function(){function r(i,f){for(var n=0;n-1}e.blotName="link",e.tagName="A",e.SANITIZED_URL="about:blank",e.PROTOCOL_WHITELIST=["http","https","mailto","tel"],_.default=e,_.sanitize=u},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},N=function(){function a(r,i){for(var f=0;f1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(i!==n&&(n?.classList.remove("ql-selected"),null!=i&&(i.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(i.parentNode.children,i),i.hasAttribute("data-value")?this.label.setAttribute("data-value",i.getAttribute("data-value")):this.label.removeAttribute("data-value"),i.hasAttribute("data-label")?this.label.setAttribute("data-label",i.getAttribute("data-label")):this.label.removeAttribute("data-label"),f))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===(typeof Event>"u"?"undefined":P(Event))){var s=document.createEvent("Event");s.initEvent("change",!0,!0),this.select.dispatchEvent(s)}this.close()}}},{key:"update",value:function(){var i=void 0;if(this.select.selectedIndex>-1){var f=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];i=this.select.options[this.select.selectedIndex],this.selectItem(f)}else this.selectItem(null);var n=null!=i&&i!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),a}();_.default=l},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var N=q(v(0)),m=q(v(5)),y=v(4),c=q(y),t=q(v(16)),u=q(v(25)),a=q(v(24)),i=q(v(35)),n=q(v(6)),A=q(v(22)),b=q(v(7)),p=q(v(55)),d=q(v(42)),T=q(v(23));function q(D){return D&&D.__esModule?D:{default:D}}m.default.register({"blots/block":c.default,"blots/block/embed":y.BlockEmbed,"blots/break":t.default,"blots/container":u.default,"blots/cursor":a.default,"blots/embed":i.default,"blots/inline":n.default,"blots/scroll":A.default,"blots/text":b.default,"modules/clipboard":p.default,"modules/history":d.default,"modules/keyboard":T.default}),N.default.register(c.default,t.default,a.default,n.default,A.default,b.default),_.default=m.default},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=v(1),N=function(){function k(m){this.domNode=m,this.domNode[P.DATA_KEY]={blot:this}}return Object.defineProperty(k.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),k.create=function(m){if(null==this.tagName)throw new P.ParchmentError("Blot definition missing tagName");var y;return Array.isArray(this.tagName)?("string"==typeof m&&(m=m.toUpperCase(),parseInt(m).toString()===m&&(m=parseInt(m))),y="number"==typeof m?document.createElement(this.tagName[m-1]):this.tagName.indexOf(m)>-1?document.createElement(m):document.createElement(this.tagName[0])):y=document.createElement(this.tagName),this.className&&y.classList.add(this.className),y},k.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},k.prototype.clone=function(){var m=this.domNode.cloneNode(!1);return P.create(m)},k.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[P.DATA_KEY]},k.prototype.deleteAt=function(m,y){this.isolate(m,y).remove()},k.prototype.formatAt=function(m,y,c,o){var t=this.isolate(m,y);if(null!=P.query(c,P.Scope.BLOT)&&o)t.wrap(c,o);else if(null!=P.query(c,P.Scope.ATTRIBUTE)){var e=P.create(this.statics.scope);t.wrap(e),e.format(c,o)}},k.prototype.insertAt=function(m,y,c){var o=null==c?P.create("text",y):P.create(y,c),t=this.split(m);this.parent.insertBefore(o,t)},k.prototype.insertInto=function(m,y){void 0===y&&(y=null),null!=this.parent&&this.parent.children.remove(this);var c=null;m.children.insertBefore(this,y),null!=y&&(c=y.domNode),(this.domNode.parentNode!=m.domNode||this.domNode.nextSibling!=c)&&m.domNode.insertBefore(this.domNode,c),this.parent=m,this.attach()},k.prototype.isolate=function(m,y){var c=this.split(m);return c.split(y),c},k.prototype.length=function(){return 1},k.prototype.offset=function(m){return void 0===m&&(m=this.parent),null==this.parent||this==m?0:this.parent.children.offset(this)+this.parent.offset(m)},k.prototype.optimize=function(m){null!=this.domNode[P.DATA_KEY]&&delete this.domNode[P.DATA_KEY].mutations},k.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},k.prototype.replace=function(m){null!=m.parent&&(m.parent.insertBefore(this,m.next),m.remove())},k.prototype.replaceWith=function(m,y){var c="string"==typeof m?P.create(m,y):m;return c.replace(this),c},k.prototype.split=function(m,y){return 0===m?this:this.next},k.prototype.update=function(m,y){},k.prototype.wrap=function(m,y){var c="string"==typeof m?P.create(m,y):m;return null!=this.parent&&this.parent.insertBefore(c,this.next),c.appendChild(this),c},k.blotName="abstract",k}();_.default=N},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=v(12),N=v(32),k=v(33),m=v(1),y=function(){function c(o){this.attributes={},this.domNode=o,this.build()}return c.prototype.attribute=function(o,t){t?o.add(this.domNode,t)&&(null!=o.value(this.domNode)?this.attributes[o.attrName]=o:delete this.attributes[o.attrName]):(o.remove(this.domNode),delete this.attributes[o.attrName])},c.prototype.build=function(){var o=this;this.attributes={};var t=P.default.keys(this.domNode),e=N.default.keys(this.domNode),u=k.default.keys(this.domNode);t.concat(e).concat(u).forEach(function(l){var a=m.query(l,m.Scope.ATTRIBUTE);a instanceof P.default&&(o.attributes[a.attrName]=a)})},c.prototype.copy=function(o){var t=this;Object.keys(this.attributes).forEach(function(e){var u=t.attributes[e].value(t.domNode);o.format(e,u)})},c.prototype.move=function(o){var t=this;this.copy(o),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},c.prototype.values=function(){var o=this;return Object.keys(this.attributes).reduce(function(t,e){return t[e]=o.attributes[e].value(o.domNode),t},{})},c}();_.default=y},function(B,_,v){"use strict";var y,P=this&&this.__extends||(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var t in o)o.hasOwnProperty(t)&&(c[t]=o[t])},function(c,o){function t(){this.constructor=c}y(c,o),c.prototype=null===o?Object.create(o):(t.prototype=o.prototype,new t)});function k(y,c){return(y.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(c+"-")})}Object.defineProperty(_,"__esModule",{value:!0});var m=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return P(c,y),c.keys=function(o){return(o.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},c.prototype.add=function(o,t){return!!this.canAdd(o,t)&&(this.remove(o),o.classList.add(this.keyName+"-"+t),!0)},c.prototype.remove=function(o){k(o,this.keyName).forEach(function(e){o.classList.remove(e)}),0===o.classList.length&&o.removeAttribute("class")},c.prototype.value=function(o){var e=(k(o,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(o,e)?e:""},c}(v(12).default);_.default=m},function(B,_,v){"use strict";var y,P=this&&this.__extends||(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var t in o)o.hasOwnProperty(t)&&(c[t]=o[t])},function(c,o){function t(){this.constructor=c}y(c,o),c.prototype=null===o?Object.create(o):(t.prototype=o.prototype,new t)});function k(y){var c=y.split("-"),o=c.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return c[0]+o}Object.defineProperty(_,"__esModule",{value:!0});var m=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return P(c,y),c.keys=function(o){return(o.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},c.prototype.add=function(o,t){return!!this.canAdd(o,t)&&(o.style[k(this.keyName)]=t,!0)},c.prototype.remove=function(o){o.style[k(this.keyName)]="",o.getAttribute("style")||o.removeAttribute("style")},c.prototype.value=function(o){var t=o.style[k(this.keyName)];return this.canAdd(o,t)?t:""},c}(v(12).default);_.default=m},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=function(){function m(y,c){for(var o=0;ow&&this.stack.undo.length>0){var p=this.stack.undo.pop();b=b.compose(p.undo),A=p.redo.compose(A)}else this.lastRecorded=w;this.stack.undo.push({redo:A,undo:b}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(A){this.stack.undo.forEach(function(g){g.undo=A.transform(g.undo,!0),g.redo=A.transform(g.redo,!0)}),this.stack.redo.forEach(function(g){g.undo=A.transform(g.undo,!0),g.redo=A.transform(g.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),n}(t(v(9)).default);function i(f){var n=f.reduce(function(A,g){return A+(g.delete||0)},0),s=f.length()-n;return function r(f){var n=f.ops[f.ops.length-1];return null!=n&&(null!=n.insert?"string"==typeof n.insert&&n.insert.endsWith("\n"):null!=n.attributes&&Object.keys(n.attributes).some(function(s){return null!=k.default.query(s,k.default.Scope.BLOCK)}))}(f)&&(s-=1),s}a.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},_.default=a,_.getLastChangeIndex=i},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.default=_.BaseTooltip=void 0;var P=function(){function S(L,F){for(var M=0;M0&&void 0!==arguments[0]?arguments[0]:"link",x=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=x?this.textbox.value=x:M!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+M)||""),this.root.setAttribute("data-mode",M)}},{key:"restoreFocus",value:function(){var M=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=M}},{key:"save",value:function(){var M=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var x=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",M,t.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",M,t.default.sources.USER)),this.quill.root.scrollTop=x;break;case"video":M=function R(S){var L=S.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||S.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return L?(L[1]||"https")+"://www.youtube.com/embed/"+L[2]+"?showinfo=0":(L=S.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(L[1]||"https")+"://player.vimeo.com/video/"+L[2]+"/":S}(M);case"formula":if(!M)break;var j=this.quill.getSelection(!0);if(null!=j){var U=j.index+j.length;this.quill.insertEmbed(U,this.root.getAttribute("data-mode"),M,t.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(U+1," ",t.default.sources.USER),this.quill.setSelection(U+2,t.default.sources.USER)}}this.textbox.value="",this.hide()}}]),L}(b.default);function O(S,L){var F=arguments.length>2&&void 0!==arguments[2]&&arguments[2];L.forEach(function(M){var x=document.createElement("option");M===F?x.setAttribute("selected","selected"):x.setAttribute("value",M),S.appendChild(x)})}_.BaseTooltip=I,_.default=Z},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=function(){function N(){this.head=this.tail=null,this.length=0}return N.prototype.append=function(){for(var k=[],m=0;m1&&this.append.apply(this,k.slice(1))},N.prototype.contains=function(k){for(var m,y=this.iterator();m=y();)if(m===k)return!0;return!1},N.prototype.insertBefore=function(k,m){!k||(k.next=m,null!=m?(k.prev=m.prev,null!=m.prev&&(m.prev.next=k),m.prev=k,m===this.head&&(this.head=k)):null!=this.tail?(this.tail.next=k,k.prev=this.tail,this.tail=k):(k.prev=null,this.head=this.tail=k),this.length+=1)},N.prototype.offset=function(k){for(var m=0,y=this.head;null!=y;){if(y===k)return m;m+=y.length(),y=y.next}return-1},N.prototype.remove=function(k){!this.contains(k)||(null!=k.prev&&(k.prev.next=k.next),null!=k.next&&(k.next.prev=k.prev),k===this.head&&(this.head=k.next),k===this.tail&&(this.tail=k.prev),this.length-=1)},N.prototype.iterator=function(k){return void 0===k&&(k=this.head),function(){var m=k;return null!=k&&(k=k.next),m}},N.prototype.find=function(k,m){void 0===m&&(m=!1);for(var y,c=this.iterator();y=c();){var o=y.length();if(ku?y(e,k-u,Math.min(m,u+a-k)):y(e,0,Math.min(a,k+m-u)),u+=a}},N.prototype.map=function(k){return this.reduce(function(m,y){return m.push(k(y)),m},[])},N.prototype.reduce=function(k,m){for(var y,c=this.iterator();y=c();)m=k(m,y);return m},N}();_.default=P},function(B,_,v){"use strict";var o,P=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var u in e)e.hasOwnProperty(u)&&(t[u]=e[u])},function(t,e){function u(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(u.prototype=e.prototype,new u)});Object.defineProperty(_,"__esModule",{value:!0});var N=v(17),k=v(1),m={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},c=function(o){function t(e){var u=o.call(this,e)||this;return u.scroll=u,u.observer=new MutationObserver(function(l){u.update(l)}),u.observer.observe(u.domNode,m),u.attach(),u}return P(t,o),t.prototype.detach=function(){o.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(e,u){this.update(),0===e&&u===this.length()?this.children.forEach(function(l){l.remove()}):o.prototype.deleteAt.call(this,e,u)},t.prototype.formatAt=function(e,u,l,a){this.update(),o.prototype.formatAt.call(this,e,u,l,a)},t.prototype.insertAt=function(e,u,l){this.update(),o.prototype.insertAt.call(this,e,u,l)},t.prototype.optimize=function(e,u){var l=this;void 0===e&&(e=[]),void 0===u&&(u={}),o.prototype.optimize.call(this,u);for(var a=[].slice.call(this.observer.takeRecords());a.length>0;)e.push(a.pop());for(var r=function(s,A){void 0===A&&(A=!0),null!=s&&s!==l&&null!=s.domNode.parentNode&&(null==s.domNode[k.DATA_KEY].mutations&&(s.domNode[k.DATA_KEY].mutations=[]),A&&r(s.parent))},i=function(s){null==s.domNode[k.DATA_KEY]||null==s.domNode[k.DATA_KEY].mutations||(s instanceof N.default&&s.children.forEach(i),s.optimize(u))},f=e,n=0;f.length>0;n+=1){if(n>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(f.forEach(function(s){var A=k.find(s.target,!0);null!=A&&(A.domNode===s.target&&("childList"===s.type?(r(k.find(s.previousSibling,!1)),[].forEach.call(s.addedNodes,function(g){var b=k.find(g,!1);r(b,!1),b instanceof N.default&&b.children.forEach(function(w){r(w,!1)})})):"attributes"===s.type&&r(A.prev)),r(A))}),this.children.forEach(i),a=(f=[].slice.call(this.observer.takeRecords())).slice();a.length>0;)e.push(a.pop())}},t.prototype.update=function(e,u){var l=this;void 0===u&&(u={}),(e=e||this.observer.takeRecords()).map(function(a){var r=k.find(a.target,!0);return null==r?null:null==r.domNode[k.DATA_KEY].mutations?(r.domNode[k.DATA_KEY].mutations=[a],r):(r.domNode[k.DATA_KEY].mutations.push(a),null)}).forEach(function(a){null==a||a===l||null==a.domNode[k.DATA_KEY]||a.update(a.domNode[k.DATA_KEY].mutations||[],u)}),null!=this.domNode[k.DATA_KEY].mutations&&o.prototype.update.call(this,this.domNode[k.DATA_KEY].mutations,u),this.optimize(e,u)},t.blotName="scroll",t.defaultChild="block",t.scope=k.Scope.BLOCK_BLOT,t.tagName="DIV",t}(N.default);_.default=c},function(B,_,v){"use strict";var c,P=this&&this.__extends||(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])},function(o,t){function e(){this.constructor=o}c(o,t),o.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)});Object.defineProperty(_,"__esModule",{value:!0});var N=v(18),k=v(1),y=function(c){function o(){return null!==c&&c.apply(this,arguments)||this}return P(o,c),o.formats=function(t){if(t.tagName!==o.tagName)return c.formats.call(this,t)},o.prototype.format=function(t,e){var u=this;t!==this.statics.blotName||e?c.prototype.format.call(this,t,e):(this.children.forEach(function(l){l instanceof N.default||(l=l.wrap(o.blotName,!0)),u.attributes.copy(l)}),this.unwrap())},o.prototype.formatAt=function(t,e,u,l){null!=this.formats()[u]||k.query(u,k.Scope.ATTRIBUTE)?this.isolate(t,e).format(u,l):c.prototype.formatAt.call(this,t,e,u,l)},o.prototype.optimize=function(t){c.prototype.optimize.call(this,t);var e=this.formats();if(0===Object.keys(e).length)return this.unwrap();var u=this.next;u instanceof o&&u.prev===this&&function m(c,o){if(Object.keys(c).length!==Object.keys(o).length)return!1;for(var t in c)if(c[t]!==o[t])return!1;return!0}(e,u.formats())&&(u.moveChildren(this),u.remove())},o.blotName="inline",o.scope=k.Scope.INLINE_BLOT,o.tagName="SPAN",o}(N.default);_.default=y},function(B,_,v){"use strict";var y,P=this&&this.__extends||(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var t in o)o.hasOwnProperty(t)&&(c[t]=o[t])},function(c,o){function t(){this.constructor=c}y(c,o),c.prototype=null===o?Object.create(o):(t.prototype=o.prototype,new t)});Object.defineProperty(_,"__esModule",{value:!0});var N=v(18),k=v(1),m=function(y){function c(){return null!==y&&y.apply(this,arguments)||this}return P(c,y),c.formats=function(o){var t=k.query(c.blotName).tagName;if(o.tagName!==t)return y.formats.call(this,o)},c.prototype.format=function(o,t){null!=k.query(o,k.Scope.BLOCK)&&(o!==this.statics.blotName||t?y.prototype.format.call(this,o,t):this.replaceWith(c.blotName))},c.prototype.formatAt=function(o,t,e,u){null!=k.query(e,k.Scope.BLOCK)?this.format(e,u):y.prototype.formatAt.call(this,o,t,e,u)},c.prototype.insertAt=function(o,t,e){if(null==e||null!=k.query(t,k.Scope.INLINE))y.prototype.insertAt.call(this,o,t,e);else{var u=this.split(o),l=k.create(t,e);u.parent.insertBefore(l,u)}},c.prototype.update=function(o,t){navigator.userAgent.match(/Trident/)?this.build():y.prototype.update.call(this,o,t)},c.blotName="block",c.scope=k.Scope.BLOCK_BLOT,c.tagName="P",c}(N.default);_.default=m},function(B,_,v){"use strict";var m,P=this&&this.__extends||(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,c){y.__proto__=c}||function(y,c){for(var o in c)c.hasOwnProperty(o)&&(y[o]=c[o])},function(y,c){function o(){this.constructor=y}m(y,c),y.prototype=null===c?Object.create(c):(o.prototype=c.prototype,new o)});Object.defineProperty(_,"__esModule",{value:!0});var k=function(m){function y(){return null!==m&&m.apply(this,arguments)||this}return P(y,m),y.formats=function(c){},y.prototype.format=function(c,o){m.prototype.formatAt.call(this,0,this.length(),c,o)},y.prototype.formatAt=function(c,o,t,e){0===c&&o===this.length()?this.format(t,e):m.prototype.formatAt.call(this,c,o,t,e)},y.prototype.formats=function(){return this.statics.formats(this.domNode)},y}(v(19).default);_.default=k},function(B,_,v){"use strict";var y,P=this&&this.__extends||(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var t in o)o.hasOwnProperty(t)&&(c[t]=o[t])},function(c,o){function t(){this.constructor=c}y(c,o),c.prototype=null===o?Object.create(o):(t.prototype=o.prototype,new t)});Object.defineProperty(_,"__esModule",{value:!0});var N=v(19),k=v(1),m=function(y){function c(o){var t=y.call(this,o)||this;return t.text=t.statics.value(t.domNode),t}return P(c,y),c.create=function(o){return document.createTextNode(o)},c.value=function(o){var t=o.data;return t.normalize&&(t=t.normalize()),t},c.prototype.deleteAt=function(o,t){this.domNode.data=this.text=this.text.slice(0,o)+this.text.slice(o+t)},c.prototype.index=function(o,t){return this.domNode===o?t:-1},c.prototype.insertAt=function(o,t,e){null==e?(this.text=this.text.slice(0,o)+t+this.text.slice(o),this.domNode.data=this.text):y.prototype.insertAt.call(this,o,t,e)},c.prototype.length=function(){return this.text.length},c.prototype.optimize=function(o){y.prototype.optimize.call(this,o),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof c&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},c.prototype.position=function(o,t){return void 0===t&&(t=!1),[this.domNode,o]},c.prototype.split=function(o,t){if(void 0===t&&(t=!1),!t){if(0===o)return this;if(o===this.length())return this.next}var e=k.create(this.domNode.splitText(o));return this.parent.insertBefore(e,this.next),this.text=this.statics.value(this.domNode),e},c.prototype.update=function(o,t){var e=this;o.some(function(u){return"characterData"===u.type&&u.target===e.domNode})&&(this.text=this.statics.value(this.domNode))},c.prototype.value=function(){return this.text},c.blotName="text",c.scope=k.Scope.INLINE_BLOT,c}(N.default);_.default=m},function(B,_,v){"use strict";var P=document.createElement("div");if(P.classList.toggle("test-class",!1),P.classList.contains("test-class")){var N=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(k,m){return arguments.length>1&&!this.contains(k)==!m?m:N.call(this,k)}}String.prototype.startsWith||(String.prototype.startsWith=function(k,m){return this.substr(m=m||0,k.length)===k}),String.prototype.endsWith||(String.prototype.endsWith=function(k,m){var y=this.toString();("number"!=typeof m||!isFinite(m)||Math.floor(m)!==m||m>y.length)&&(m=y.length);var c=y.indexOf(k,m-=k.length);return-1!==c&&c===m}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(m){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof m)throw new TypeError("predicate must be a function");for(var t,y=Object(this),c=y.length>>>0,o=arguments[1],e=0;es.length?n:s,b=n.length>s.length?s:n,w=g.indexOf(b);if(-1!=w)return A=[[1,g.substring(0,w)],[0,b],[1,g.substring(w+b.length)]],n.length>s.length&&(A[0][0]=A[2][0]=v),A;if(1==b.length)return[[v,n],[1,s]];var p=function e(n,s){var A=n.length>s.length?n:s,g=n.length>s.length?s:n;if(A.length<4||2*g.length=C.length?[L,F,M,x,S]:null}var h,d,E,T,q,w=b(A,g,Math.ceil(A.length/4)),p=b(A,g,Math.ceil(A.length/2));return w||p?(h=p?w&&w[4].length>p[4].length?w:p:w,n.length>s.length?(d=h[0],E=h[1],T=h[2],q=h[3]):(T=h[0],q=h[1],d=h[2],E=h[3]),[d,E,T,q,h[4]]):null}(n,s);if(p){var d=p[1],T=p[3],q=p[4],D=k(p[0],p[2]),C=k(d,T);return D.concat([[0,q]],C)}return function y(n,s){for(var A=n.length,g=s.length,b=Math.ceil((A+g)/2),w=b,p=2*b,h=new Array(p),d=new Array(p),E=0;EA)C+=2;else if(F>g)D+=2;else if(q&&(M=w+T-O)>=0&&M=(x=A-d[M]))return c(n,s,L,F)}for(var j=-R+Z;j<=R-I;j+=2){for(var x,M=w+j,U=(x=j==-R||j!=R&&d[M-1]A)I+=2;else if(U>g)Z+=2;else if(!q){var L;if((S=w+T-j)>=0&&S=(x=A-x))return c(n,s,L,F)}}}return[[v,n],[1,s]]}(n,s)}(n=n.substring(0,n.length-g),s=s.substring(0,s.length-g));return b&&p.unshift([0,b]),w&&p.push([0,w]),u(p),null!=A&&(p=function r(n,s){var A=function a(n,s){if(0===s)return[0,n];for(var A=0,g=0;g0&&g.splice(b+2,0,[p[0],h]),f(g,b,3)}return n}(p,A)),p=function i(n){for(var s=!1,A=function(p){return p.charCodeAt(0)>=56320&&p.charCodeAt(0)<=57343},g=function(p){return p.charCodeAt(p.length-1)>=55296&&p.charCodeAt(p.length-1)<=56319},b=2;b0&&w.push(n[b]);return w}(p),p}function c(n,s,A,g){var b=n.substring(0,A),w=s.substring(0,g),p=n.substring(A),h=s.substring(g),d=k(b,w),E=k(p,h);return d.concat(E)}function o(n,s){if(!n||!s||n.charAt(0)!=s.charAt(0))return 0;for(var A=0,g=Math.min(n.length,s.length),b=g,w=0;A1?(0!==A&&0!==g&&(0!==(p=o(w,b))&&(s-A-g>0&&0==n[s-A-g-1][0]?n[s-A-g-1][1]+=w.substring(0,p):(n.splice(0,0,[0,w.substring(0,p)]),s++),w=w.substring(p),b=b.substring(p)),0!==(p=t(w,b))&&(n[s][1]=w.substring(w.length-p)+n[s][1],w=w.substring(0,w.length-p),b=b.substring(0,b.length-p))),0===A?n.splice(s-g,A+g,[1,w]):0===g?n.splice(s-A,A+g,[v,b]):n.splice(s-A-g,A+g,[v,b],[1,w]),s=s-A-g+(A?1:0)+(g?1:0)+1):0!==s&&0==n[s-1][0]?(n[s-1][1]+=n[s][1],n.splice(s,1)):s++,g=0,A=0,b="",w=""}""===n[n.length-1][1]&&n.pop();var h=!1;for(s=1;s=0&&g>=s-1;g--)if(g+1=700)&&($.bold=!0),Object.keys($).length>0&&(K=L(K,$)),parseFloat(G.textIndent||0)>0&&(K=(new o.default).insert("\t").concat(K)),K}],["li",function Q(z,K){var $=e.default.query(z);if(null==$||"list-item"!==$.blotName||!M(K,"\n"))return K;for(var G=-1,W=z.parentNode;!W.classList.contains("ql-clipboard");)"list"===(e.default.query(W)||{}).blotName&&(G+=1),W=W.parentNode;return G<=0?K:K.compose((new o.default).retain(K.length()-1).retain(1,{indent:G}))}],["b",U.bind(U,"bold")],["i",U.bind(U,"italic")],["style",function X(){return new o.default}]],R=[n.AlignAttribute,w.DirectionAttribute].reduce(function(z,K){return z[K.keyName]=K,z},{}),O=[n.AlignStyle,s.BackgroundStyle,b.ColorStyle,w.DirectionStyle,p.FontStyle,h.SizeStyle].reduce(function(z,K){return z[K.keyName]=K,z},{}),S=function(z){function K($,G){!function T(z,K){if(!(z instanceof K))throw new TypeError("Cannot call a class as a function")}(this,K);var W=function q(z,K){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!K||"object"!=typeof K&&"function"!=typeof K?z:K}(this,(K.__proto__||Object.getPrototypeOf(K)).call(this,$,G));return W.quill.root.addEventListener("paste",W.onPaste.bind(W)),W.container=W.quill.addContainer("ql-clipboard"),W.container.setAttribute("contenteditable",!0),W.container.setAttribute("tabindex",-1),W.matchers=[],I.concat(W.options.matchers).forEach(function(J){var tt=N(J,2),ut=tt[1];!G.matchVisual&&ut===rt||W.addMatcher(tt[0],ut)}),W}return function D(z,K){if("function"!=typeof K&&null!==K)throw new TypeError("Super expression must either be null or a function, not "+typeof K);z.prototype=Object.create(K&&K.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),K&&(Object.setPrototypeOf?Object.setPrototypeOf(z,K):z.__proto__=K)}(K,z),k(K,[{key:"addMatcher",value:function(G,W){this.matchers.push([G,W])}},{key:"convert",value:function(G){if("string"==typeof G)return this.container.innerHTML=G.replace(/\>\r?\n +\<"),this.convert();var W=this.quill.getFormat(this.quill.selection.savedRange.index);if(W[g.default.blotName]){var J=this.container.innerText;return this.container.innerHTML="",(new o.default).insert(J,E({},g.default.blotName,W[g.default.blotName]))}var tt=this.prepareMatching(),et=N(tt,2),it=j(this.container,et[0],et[1]);return M(it,"\n")&&null==it.ops[it.ops.length-1].attributes&&(it=it.compose((new o.default).retain(it.length()-1).delete(1))),C.log("convert",this.container.innerHTML,it),this.container.innerHTML="",it}},{key:"dangerouslyPasteHTML",value:function(G,W){var J=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;if("string"==typeof G)this.quill.setContents(this.convert(G),W),this.quill.setSelection(0,l.default.sources.SILENT);else{var tt=this.convert(W);this.quill.updateContents((new o.default).retain(G).concat(tt),J),this.quill.setSelection(G+tt.length(),l.default.sources.SILENT)}}},{key:"onPaste",value:function(G){var W=this;if(!G.defaultPrevented&&this.quill.isEnabled()){var J=this.quill.getSelection(),tt=(new o.default).retain(J.index),et=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(l.default.sources.SILENT),setTimeout(function(){tt=tt.concat(W.convert()).delete(J.length),W.quill.updateContents(tt,l.default.sources.USER),W.quill.setSelection(tt.length()-J.length,l.default.sources.SILENT),W.quill.scrollingContainer.scrollTop=et,W.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var G=this,W=[],J=[];return this.matchers.forEach(function(tt){var et=N(tt,2),ut=et[0],ft=et[1];switch(ut){case Node.TEXT_NODE:J.push(ft);break;case Node.ELEMENT_NODE:W.push(ft);break;default:[].forEach.call(G.container.querySelectorAll(ut),function(it){it[Z]=it[Z]||[],it[Z].push(ft)})}}),[W,J]}}]),K}(f.default);function L(z,K,$){return"object"===(typeof K>"u"?"undefined":P(K))?Object.keys(K).reduce(function(G,W){return L(G,W,K[W])},z):z.reduce(function(G,W){return W.attributes&&W.attributes[K]?G.push(W):G.insert(W.insert,(0,y.default)({},E({},K,$),W.attributes))},new o.default)}function F(z){if(z.nodeType!==Node.ELEMENT_NODE)return{};var K="__ql-computed-style";return z[K]||(z[K]=window.getComputedStyle(z))}function M(z,K){for(var $="",G=z.ops.length-1;G>=0&&$.length-1}function j(z,K,$){return z.nodeType===z.TEXT_NODE?$.reduce(function(G,W){return W(z,G)},new o.default):z.nodeType===z.ELEMENT_NODE?[].reduce.call(z.childNodes||[],function(G,W){var J=j(W,K,$);return W.nodeType===z.ELEMENT_NODE&&(J=K.reduce(function(tt,et){return et(W,tt)},J),J=(W[Z]||[]).reduce(function(tt,et){return et(W,tt)},J)),G.concat(J)},new o.default):new o.default}function U(z,K,$){return L($,z,!0)}function H(z,K){var $=e.default.Attributor.Attribute.keys(z),G=e.default.Attributor.Class.keys(z),W=e.default.Attributor.Style.keys(z),J={};return $.concat(G).concat(W).forEach(function(tt){var et=e.default.query(tt,e.default.Scope.ATTRIBUTE);null!=et&&(J[et.attrName]=et.value(z),J[et.attrName])||(null!=(et=R[tt])&&(et.attrName===tt||et.keyName===tt)&&(J[et.attrName]=et.value(z)||void 0),null!=(et=O[tt])&&(et.attrName===tt||et.keyName===tt)&&(J[(et=O[tt]).attrName]=et.value(z)||void 0))}),Object.keys(J).length>0&&(K=L(K,J)),K}function V(z,K){var $=e.default.query(z);if(null==$)return K;if($.prototype instanceof e.default.Embed){var G={},W=$.value(z);null!=W&&(G[$.blotName]=W,K=(new o.default).insert(G,$.formats(z)))}else"function"==typeof $.formats&&(K=L(K,$.blotName,$.formats(z)));return K}function nt(z,K){return M(K,"\n")||(x(z)||K.length()>0&&z.nextSibling&&x(z.nextSibling))&&K.insert("\n"),K}function rt(z,K){if(x(z)&&null!=z.nextElementSibling&&!M(K,"\n\n")){var $=z.offsetHeight+parseFloat(F(z).marginTop)+parseFloat(F(z).marginBottom);z.nextElementSibling.offsetTop>z.offsetTop+1.5*$&&K.insert("\n")}return K}function lt(z,K){var $=z.data;if("O:P"===z.parentNode.tagName)return K.insert($.trim());if(0===$.trim().length&&z.parentNode.classList.contains("ql-clipboard"))return K;if(!F(z.parentNode).whiteSpace.startsWith("pre")){var G=function(J,tt){return(tt=tt.replace(/[^\u00a0]/g,"")).length<1&&J?" ":tt};$=($=$.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,G.bind(G,!0)),(null==z.previousSibling&&x(z.parentNode)||null!=z.previousSibling&&x(z.previousSibling))&&($=$.replace(/^\s+/,G.bind(G,!1))),(null==z.nextSibling&&x(z.parentNode)||null!=z.nextSibling&&x(z.nextSibling))&&($=$.replace(/\s+$/,G.bind(G,!1)))}return K.insert($)}S.DEFAULTS={matchers:[],matchVisual:!0},_.default=S,_.matchAttributor=H,_.matchBlot=V,_.matchNewline=nt,_.matchSpacing=rt,_.matchText=lt},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=function(){function u(l,a){for(var r=0;r '},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=function(){function u(l,a){for(var r=0;re.right&&(this.root.style.left=o+(l=e.right-u.right)+"px"),u.lefte.bottom&&(this.root.style.top=t-(c.bottom-c.top+(u.bottom-u.top))+"px",this.root.classList.add("ql-flip")),l}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),m}();_.default=k},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var N=function p(h,d,E){null===h&&(h=Function.prototype);var T=Object.getOwnPropertyDescriptor(h,d);if(void 0===T){var q=Object.getPrototypeOf(h);return null===q?void 0:p(q,d,E)}if("value"in T)return T.value;var D=T.get;return void 0===D?void 0:D.call(E)},k=function(){function p(h,d){for(var E=0;E','','',''].join(""),_.default=b},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var N=W(v(29)),k=v(36),m=v(38),y=v(64),o=W(v(65)),e=W(v(66)),u=v(67),l=W(u),a=v(37),r=v(26),i=v(39),f=v(40),s=W(v(56)),g=W(v(68)),w=W(v(27)),h=W(v(69)),E=W(v(70)),q=W(v(71)),C=W(v(72)),I=W(v(73)),R=v(13),O=W(R),L=W(v(74)),M=W(v(75)),j=W(v(57)),H=W(v(41)),Y=W(v(28)),Q=W(v(59)),rt=W(v(60)),lt=W(v(61)),K=W(v(108)),G=W(v(62));function W(J){return J&&J.__esModule?J:{default:J}}N.default.register({"attributors/attribute/direction":m.DirectionAttribute,"attributors/class/align":k.AlignClass,"attributors/class/background":a.BackgroundClass,"attributors/class/color":r.ColorClass,"attributors/class/direction":m.DirectionClass,"attributors/class/font":i.FontClass,"attributors/class/size":f.SizeClass,"attributors/style/align":k.AlignStyle,"attributors/style/background":a.BackgroundStyle,"attributors/style/color":r.ColorStyle,"attributors/style/direction":m.DirectionStyle,"attributors/style/font":i.FontStyle,"attributors/style/size":f.SizeStyle},!0),N.default.register({"formats/align":k.AlignClass,"formats/direction":m.DirectionClass,"formats/indent":y.IndentClass,"formats/background":a.BackgroundStyle,"formats/color":r.ColorStyle,"formats/font":i.FontClass,"formats/size":f.SizeClass,"formats/blockquote":o.default,"formats/code-block":O.default,"formats/header":e.default,"formats/list":l.default,"formats/bold":s.default,"formats/code":R.Code,"formats/italic":g.default,"formats/link":w.default,"formats/script":h.default,"formats/strike":E.default,"formats/underline":q.default,"formats/image":C.default,"formats/video":I.default,"formats/list/item":u.ListItem,"modules/formula":L.default,"modules/syntax":M.default,"modules/toolbar":j.default,"themes/bubble":K.default,"themes/snow":G.default,"ui/icons":H.default,"ui/picker":Y.default,"ui/icon-picker":rt.default,"ui/color-picker":Q.default,"ui/tooltip":lt.default},!0),_.default=N.default},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.IndentClass=void 0;var P=function(){function l(a,r){for(var i=0;i0&&this.children.tail.format(g,b)}},{key:"formats",value:function(){return function u(n,s,A){return s in n?Object.defineProperty(n,s,{value:A,enumerable:!0,configurable:!0,writable:!0}):n[s]=A,n}({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(g,b){if(g instanceof i)N(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"insertBefore",this).call(this,g,b);else{var w=null==b?this.length():b.offset(this),p=this.split(w);p.parent.insertBefore(g,p)}}},{key:"optimize",value:function(g){N(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"optimize",this).call(this,g);var b=this.next;null!=b&&b.prev===this&&b.statics.blotName===this.statics.blotName&&b.domNode.tagName===this.domNode.tagName&&b.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(b.moveChildren(this),b.remove())}},{key:"replace",value:function(g){if(g.statics.blotName!==this.statics.blotName){var b=m.default.create(this.statics.defaultChild);g.moveChildren(b),this.appendChild(b)}N(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"replace",this).call(this,g)}}]),s}(t.default);f.blotName="list",f.scope=m.default.Scope.BLOCK_BLOT,f.tagName=["OL","UL"],f.defaultChild="list-item",f.allowedChildren=[i],_.ListItem=i,_.default=f},function(B,_,v){"use strict";function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}Object.defineProperty(_,"__esModule",{value:!0});var o=function(t){function e(){return m(this,e),y(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(function k(t){return t&&t.__esModule?t:{default:t}}(v(56)).default);o.blotName="italic",o.tagName=["EM","I"],_.default=o},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=function(){function u(l,a){for(var r=0;r-1?n?this.domNode.setAttribute(f,n):this.domNode.removeAttribute(f):N(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"format",this).call(this,f,n)}}],[{key:"create",value:function(f){var n=N(r.__proto__||Object.getPrototypeOf(r),"create",this).call(this,f);return"string"==typeof f&&n.setAttribute("src",this.sanitize(f)),n}},{key:"formats",value:function(f){return u.reduce(function(n,s){return f.hasAttribute(s)&&(n[s]=f.getAttribute(s)),n},{})}},{key:"match",value:function(f){return/\.(jpe?g|gif|png)$/.test(f)||/^data:image\/.+;base64/.test(f)}},{key:"sanitize",value:function(f){return(0,y.sanitize)(f,["http","https","data"])?f:"//:0"}},{key:"value",value:function(f){return f.getAttribute("src")}}]),r}(m.default.Embed);l.blotName="image",l.tagName="IMG",_.default=l},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0});var P=function(){function a(r,i){for(var f=0;f-1?n?this.domNode.setAttribute(f,n):this.domNode.removeAttribute(f):N(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"format",this).call(this,f,n)}}],[{key:"create",value:function(f){var n=N(r.__proto__||Object.getPrototypeOf(r),"create",this).call(this,f);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(f)),n}},{key:"formats",value:function(f){return u.reduce(function(n,s){return f.hasAttribute(s)&&(n[s]=f.getAttribute(s)),n},{})}},{key:"sanitize",value:function(f){return y.default.sanitize(f)}},{key:"value",value:function(f){return f.getAttribute("src")}}]),r}(k.BlockEmbed);l.blotName="video",l.className="ql-video",l.tagName="IFRAME",_.default=l},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.default=_.FormulaBlot=void 0;var P=function(){function f(n,s){for(var A=0;A0||null==this.cachedText)&&(this.domNode.innerHTML=w(p),this.domNode.normalize(),this.attach()),this.cachedText=p)}}]),g}(l(v(13)).default);f.className="ql-syntax";var n=new m.default.Attributor.Class("token","hljs",{scope:m.default.Scope.INLINE}),s=function(A){function g(b,w){a(this,g);var p=r(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,b,w));if("function"!=typeof p.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var h=null;return p.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(h),h=setTimeout(function(){p.highlight(),h=null},p.options.interval)}),p.highlight(),p}return i(g,A),P(g,null,[{key:"register",value:function(){c.default.register(n,!0),c.default.register(f,!0)}}]),P(g,[{key:"highlight",value:function(){var w=this;if(!this.quill.selection.composing){this.quill.update(c.default.sources.USER);var p=this.quill.getSelection();this.quill.scroll.descendants(f).forEach(function(h){h.highlight(w.options.highlight)}),this.quill.update(c.default.sources.SILENT),null!=p&&this.quill.setSelection(p,c.default.sources.SILENT)}}}]),g}(t.default);s.DEFAULTS={highlight:null==window.hljs?null:function(A){return window.hljs.highlightAuto(A).value},interval:1e3},_.CodeBlock=f,_.CodeToken=n,_.default=s},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_){B.exports=' '},function(B,_,v){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.default=_.BubbleTooltip=void 0;var P=function g(b,w,p){null===b&&(b=Function.prototype);var h=Object.getOwnPropertyDescriptor(b,w);if(void 0===h){var d=Object.getPrototypeOf(b);return null===d?void 0:g(d,w,p)}if("value"in h)return h.value;var E=h.get;return void 0===E?void 0:E.call(p)},N=function(){function g(b,w){for(var p=0;p0&&q===c.default.sources.USER){h.show(),h.root.style.left="0px",h.root.style.width="",h.root.style.width=h.root.offsetWidth+"px";var D=h.quill.getLines(E.index,E.length);if(1===D.length)h.position(h.quill.getBounds(E));else{var C=D[D.length-1],Z=h.quill.getIndex(C),I=Math.min(C.length()-1,E.index+E.length-Z),R=h.quill.getBounds(new e.Range(Z,I));h.position(R)}}else document.activeElement!==h.textbox&&h.quill.hasFocus()&&h.hide()}),h}return f(b,g),N(b,[{key:"listen",value:function(){var p=this;P(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){p.root.classList.remove("ql-editing")}),this.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!p.root.classList.contains("ql-hidden")){var h=p.quill.getSelection();null!=h&&p.position(p.quill.getBounds(h))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(p){var h=P(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"position",this).call(this,p),d=this.root.querySelector(".ql-tooltip-arrow");if(d.style.marginLeft="",0===h)return h;d.style.marginLeft=-1*h-d.offsetWidth/2+"px"}}]),b}(o.BaseTooltip);A.TEMPLATE=['','
','','',"
"].join(""),_.BubbleTooltip=A,_.default=s},function(B,_,v){B.exports=v(63)}]).default});