import{B as Bn}from"./D8wkbzbL.js";import{d as Xn,J as nr,r as Gt,H as Qn,a0 as rr,af as Cn,z as Ne,G as Jn,E as Ft,B as jt,D as Ot,K as xt,F as ir,C as Mn,S as Pe,Q as Rn,u as or,o as ar,A as qn,a3 as lr,a1 as Fn,a2 as Un,T as ur,c_ as sr}from"./sHYMdOhR.js";import{_ as fr,a as cr}from"./BBWcOEEO.js";import{B as hr}from"./CEk4iKpv.js";import{_ as dr}from"./CHWTpocX.js";import{B as jn}from"./BYAjTvVj.js";import{I as vr}from"./syGHIf6Q.js";import{B as pr}from"./B1_zfk8Q.js";import{u as yr,c as gr,g as mr,d as br}from"./BfDbd4D-.js";import{c as Wt}from"./CE1G-McA.js";import{B as _r}from"./CcPysqK2.js";import{F as Or}from"./Lro_135l.js";import{_ as Er}from"./B1FXwelu.js";import{_ as Ar}from"./DlAUqK2U.js";import{F as wr}from"./BIa9oC5T.js";import"./0WLYhuc0.js";import"./s5VsWXJm.js";/* empty css */import"./CscEAC8U.js";import"./BXQsDisu.js";import"./DwS8IiHz.js";import"./1GKgVMtx.js";import"./CAog9izl.js";import"./FRupd7em.js";import"./C5o9uLp2.js";import"./T5RUGJza.js";import"./MgoZ6sgN.js";import"./BlxE6CuM.js";import"./D9spR2Y-.js";import"./DESWC84c.js";import"./0qMxIxIU.js";import"./D9W93jKc.js";import"./N3gv61e4.js";import"./CcRNtUWx.js";import"./BKeFls8M.js";import"./Cj99RmFE.js";import"./BtazoGfv.js";import"./DRJnIYfK.js";import"./BCNp_OwF.js";import"./CaX2wWhb.js";import"./c3m89UKz.js";import"./DjvBa-1E.js";import"./DHW72GED.js";var Ve={exports:{}};var Tr=Ve.exports,Hn;function kr(){return Hn||(Hn=1,(function(st,ft){(function(O,g){st.exports=g()})(typeof self<"u"?self:Tr,function(){return(function(B){var O={};function g(P){if(O[P])return O[P].exports;var S=O[P]={i:P,l:!1,exports:{}};return B[P].call(S.exports,S,S.exports,g),S.l=!0,S.exports}return g.m=B,g.c=O,g.d=function(P,S,k){g.o(P,S)||Object.defineProperty(P,S,{configurable:!1,enumerable:!0,get:k})},g.n=function(P){var S=P&&P.__esModule?function(){return P.default}:function(){return P};return g.d(S,"a",S),S},g.o=function(P,S){return Object.prototype.hasOwnProperty.call(P,S)},g.p="",g(g.s=109)})([(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=g(17),S=g(18),k=g(19),p=g(45),d=g(46),s=g(47),i=g(48),t=g(49),e=g(12),h=g(32),u=g(33),c=g(31),a=g(1),o={Scope:a.Scope,create:a.create,find:a.find,query:a.query,register:a.register,Container:P.default,Format:S.default,Leaf:k.default,Embed:i.default,Scroll:p.default,Block:s.default,Inline:d.default,Text:t.default,Attributor:{Attribute:e.default,Class:h.default,Style:u.default,Store:c.default}};O.default=o}),(function(B,O,g){var P=this&&this.__extends||(function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var r in o)o.hasOwnProperty(r)&&(a[r]=o[r])};return function(a,o){c(a,o);function r(){this.constructor=a}a.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}})();Object.defineProperty(O,"__esModule",{value:!0});var S=(function(c){P(a,c);function a(o){var r=this;return o="[Parchment] "+o,r=c.call(this,o)||this,r.message=o,r.name=r.constructor.name,r}return a})(Error);O.ParchmentError=S;var k={},p={},d={},s={};O.DATA_KEY="__blot";var i;(function(c){c[c.TYPE=3]="TYPE",c[c.LEVEL=12]="LEVEL",c[c.ATTRIBUTE=13]="ATTRIBUTE",c[c.BLOT=14]="BLOT",c[c.INLINE=7]="INLINE",c[c.BLOCK=11]="BLOCK",c[c.BLOCK_BLOT=10]="BLOCK_BLOT",c[c.INLINE_BLOT=6]="INLINE_BLOT",c[c.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",c[c.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",c[c.ANY=15]="ANY"})(i=O.Scope||(O.Scope={}));function t(c,a){var o=h(c);if(o==null)throw new S("Unable to create "+c+" blot");var r=o,n=c instanceof Node||c.nodeType===Node.TEXT_NODE?c:r.create(a);return new r(n,a)}O.create=t;function e(c,a){return a===void 0&&(a=!1),c==null?null:c[O.DATA_KEY]!=null?c[O.DATA_KEY].blot:a?e(c.parentNode,a):null}O.find=e;function h(c,a){a===void 0&&(a=i.ANY);var o;if(typeof c=="string")o=s[c]||k[c];else if(c instanceof Text||c.nodeType===Node.TEXT_NODE)o=s.text;else if(typeof c=="number")c&i.LEVEL&i.BLOCK?o=s.block:c&i.LEVEL&i.INLINE&&(o=s.inline);else if(c instanceof HTMLElement){var r=(c.getAttribute("class")||"").split(/\s+/);for(var n in r)if(o=p[r[n]],o)break;o=o||d[c.tagName]}return o==null?null:a&i.LEVEL&o.scope&&a&i.TYPE&o.scope?o:null}O.query=h;function u(){for(var c=[],a=0;a1)return c.map(function(n){return u(n)});var o=c[0];if(typeof o.blotName!="string"&&typeof o.attrName!="string")throw new S("Invalid definition");if(o.blotName==="abstract")throw new S("Cannot register abstract class");if(s[o.blotName||o.attrName]=o,typeof o.keyName=="string")k[o.keyName]=o;else if(o.className!=null&&(p[o.className]=o),o.tagName!=null){Array.isArray(o.tagName)?o.tagName=o.tagName.map(function(n){return n.toUpperCase()}):o.tagName=o.tagName.toUpperCase();var r=Array.isArray(o.tagName)?o.tagName:[o.tagName];r.forEach(function(n){(d[n]==null||o.className==null)&&(d[n]=o)})}return o}O.register=u}),(function(B,O,g){var P=g(51),S=g(11),k=g(3),p=g(20),d="\0",s=function(i){Array.isArray(i)?this.ops=i:i!=null&&Array.isArray(i.ops)?this.ops=i.ops:this.ops=[]};s.prototype.insert=function(i,t){var e={};return i.length===0?this:(e.insert=i,t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(e.attributes=t),this.push(e))},s.prototype.delete=function(i){return i<=0?this:this.push({delete:i})},s.prototype.retain=function(i,t){if(i<=0)return this;var e={retain:i};return t!=null&&typeof t=="object"&&Object.keys(t).length>0&&(e.attributes=t),this.push(e)},s.prototype.push=function(i){var t=this.ops.length,e=this.ops[t-1];if(i=k(!0,{},i),typeof e=="object"){if(typeof i.delete=="number"&&typeof e.delete=="number")return this.ops[t-1]={delete:e.delete+i.delete},this;if(typeof e.delete=="number"&&i.insert!=null&&(t-=1,e=this.ops[t-1],typeof e!="object"))return this.ops.unshift(i),this;if(S(i.attributes,e.attributes)){if(typeof i.insert=="string"&&typeof e.insert=="string")return this.ops[t-1]={insert:e.insert+i.insert},typeof i.attributes=="object"&&(this.ops[t-1].attributes=i.attributes),this;if(typeof i.retain=="number"&&typeof e.retain=="number")return this.ops[t-1]={retain:e.retain+i.retain},typeof i.attributes=="object"&&(this.ops[t-1].attributes=i.attributes),this}}return t===this.ops.length?this.ops.push(i):this.ops.splice(t,0,i),this},s.prototype.chop=function(){var i=this.ops[this.ops.length-1];return i&&i.retain&&!i.attributes&&this.ops.pop(),this},s.prototype.filter=function(i){return this.ops.filter(i)},s.prototype.forEach=function(i){this.ops.forEach(i)},s.prototype.map=function(i){return this.ops.map(i)},s.prototype.partition=function(i){var t=[],e=[];return this.forEach(function(h){var u=i(h)?t:e;u.push(h)}),[t,e]},s.prototype.reduce=function(i,t){return this.ops.reduce(i,t)},s.prototype.changeLength=function(){return this.reduce(function(i,t){return t.insert?i+p.length(t):t.delete?i-t.delete:i},0)},s.prototype.length=function(){return this.reduce(function(i,t){return i+p.length(t)},0)},s.prototype.slice=function(i,t){i=i||0,typeof t!="number"&&(t=1/0);for(var e=[],h=p.iterator(this.ops),u=0;u0&&e.next(u.retain-c)}for(var a=new s(h);t.hasNext()||e.hasNext();)if(e.peekType()==="insert")a.push(e.next());else if(t.peekType()==="delete")a.push(t.next());else{var o=Math.min(t.peekLength(),e.peekLength()),r=t.next(o),n=e.next(o);if(typeof n.retain=="number"){var l={};typeof r.retain=="number"?l.retain=o:l.insert=r.insert;var E=p.attributes.compose(r.attributes,n.attributes,typeof r.retain=="number");if(E&&(l.attributes=E),a.push(l),!e.hasNext()&&S(a.ops[a.ops.length-1],l)){var b=new s(t.rest());return a.concat(b).chop()}}else typeof n.delete=="number"&&typeof r.retain=="number"&&a.push(n)}return a.chop()},s.prototype.concat=function(i){var t=new s(this.ops.slice());return i.ops.length>0&&(t.push(i.ops[0]),t.ops=t.ops.concat(i.ops.slice(1))),t},s.prototype.diff=function(i,t){if(this.ops===i.ops)return new s;var e=[this,i].map(function(o){return o.map(function(r){if(r.insert!=null)return typeof r.insert=="string"?r.insert:d;var n=o===i?"on":"with";throw new Error("diff() called "+n+" non-document")}).join("")}),h=new s,u=P(e[0],e[1],t),c=p.iterator(this.ops),a=p.iterator(i.ops);return u.forEach(function(o){for(var r=o[1].length;r>0;){var n=0;switch(o[0]){case P.INSERT:n=Math.min(a.peekLength(),r),h.push(a.next(n));break;case P.DELETE:n=Math.min(r,c.peekLength()),c.next(n),h.delete(n);break;case P.EQUAL:n=Math.min(c.peekLength(),a.peekLength(),r);var l=c.next(n),E=a.next(n);S(l.insert,E.insert)?h.retain(n,p.attributes.diff(l.attributes,E.attributes)):h.push(E).delete(n);break}r-=n}}),h.chop()},s.prototype.eachLine=function(i,t){t=t||` `;for(var e=p.iterator(this.ops),h=new s,u=0;e.hasNext();){if(e.peekType()!=="insert")return;var c=e.peek(),a=p.length(c)-e.peekLength(),o=typeof c.insert=="string"?c.insert.indexOf(t,a)-a:-1;if(o<0)h.push(e.next());else if(o>0)h.push(e.next(o));else{if(i(h,e.next(1).attributes||{},u)===!1)return;u+=1,h=new s}}h.length()>0&&i(h,{},u)},s.prototype.transform=function(i,t){if(t=!!t,typeof i=="number")return this.transformPosition(i,t);for(var e=p.iterator(this.ops),h=p.iterator(i.ops),u=new s;e.hasNext()||h.hasNext();)if(e.peekType()==="insert"&&(t||h.peekType()!=="insert"))u.retain(p.length(e.next()));else if(h.peekType()==="insert")u.push(h.next());else{var c=Math.min(e.peekLength(),h.peekLength()),a=e.next(c),o=h.next(c);if(a.delete)continue;o.delete?u.push(o):u.retain(c,p.attributes.transform(a.attributes,o.attributes,t))}return u.chop()},s.prototype.transformPosition=function(i,t){t=!!t;for(var e=p.iterator(this.ops),h=0;e.hasNext()&&h<=i;){var u=e.peekLength(),c=e.peekType();if(e.next(),c==="delete"){i-=Math.min(u,i-h);continue}else c==="insert"&&(h"u"||g.call(e,c)},s=function(e,h){S&&h.name==="__proto__"?S(e,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):e[h.name]=h.newValue},i=function(e,h){if(h==="__proto__")if(g.call(e,h)){if(k)return k(e,h).value}else return;return e[h]};B.exports=function t(){var e,h,u,c,a,o,r=arguments[0],n=1,l=arguments.length,E=!1;for(typeof r=="boolean"&&(E=r,r=arguments[1]||{},n=2),(r==null||typeof r!="object"&&typeof r!="function")&&(r={});n0&&(x1&&arguments[1]!==void 0?arguments[1]:!1;if(I&&(x===0||x>=this.length()-b)){var U=this.clone();return x===0?(this.parent.insertBefore(U,this),this):(this.parent.insertBefore(U,this.next),U)}else{var z=S(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"split",this).call(this,x,I);return this.cache={},z}}}]),_})(t.default.Block);T.blotName="block",T.tagName="P",T.defaultChild="break",T.allowedChildren=[c.default,t.default.Embed,o.default];function y(v){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v==null||(typeof v.formats=="function"&&(_=(0,p.default)(_,v.formats())),v.parent==null||v.parent.blotName=="scroll"||v.parent.statics.scope!==v.statics.scope)?_:y(v.parent,_)}O.bubbleFormats=y,O.BlockEmbed=m,O.default=T}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0}),O.default=O.overload=O.expandConfig=void 0;var P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},S=(function(){function F(R,A){var q=[],j=!0,H=!1,M=void 0;try{for(var L=R[Symbol.iterator](),C;!(j=(C=L.next()).done)&&(q.push(C.value),!(A&&q.length===A));j=!0);}catch(K){H=!0,M=K}finally{try{!j&&L.return&&L.return()}finally{if(H)throw M}}return q}return function(R,A){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return F(R,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),k=(function(){function F(R,A){for(var q=0;q2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof A!="string"){var M=A.attrName||A.blotName;typeof M=="string"?this.register("formats/"+M,A,q):Object.keys(A).forEach(function(L){j.register(L,A[L],q)})}else this.imports[A]!=null&&!H&&w.warn("Overwriting "+A+" with",q),this.imports[A]=q,(A.startsWith("blots/")||A.startsWith("formats/"))&&q.blotName!=="abstract"?a.default.register(q):A.startsWith("modules")&&typeof q.register=="function"&&q.register()}}]);function F(R){var A=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_(this,F),this.options=I(R,q),this.container=this.options.container,this.container==null)return w.error("Invalid Quill container",R);this.options.debug&&F.debug(this.options.debug);var j=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=a.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new i.default(this.scroll),this.selection=new r.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&&A.root.classList.toggle("ql-blank",A.editor.isBlank())}),this.emitter.on(e.default.events.SCROLL_UPDATE,function(M,L){var C=A.selection.lastRange,K=C&&C.length===0?C.index:void 0;U.call(A,function(){return A.editor.update(null,L,K)},M)});var H=this.clipboard.convert(`
`+j+"


");this.setContents(H),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return k(F,[{key:"addContainer",value:function(A){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof A=="string"){var j=A;A=document.createElement("div"),A.classList.add(j)}return this.container.insertBefore(A,q),A}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(A,q,j){var H=this,M=z(A,q,j),L=S(M,4);return A=L[0],q=L[1],j=L[3],U.call(this,function(){return H.editor.deleteText(A,q)},j,A,-1*q)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(A),this.container.classList.toggle("ql-disabled",!A)}},{key:"focus",value:function(){var A=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=A,this.scrollIntoView()}},{key:"format",value:function(A,q){var j=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.default.sources.API;return U.call(this,function(){var M=j.getSelection(!0),L=new d.default;if(M==null)return L;if(a.default.query(A,a.default.Scope.BLOCK))L=j.editor.formatLine(M.index,M.length,v({},A,q));else{if(M.length===0)return j.selection.format(A,q),L;L=j.editor.formatText(M.index,M.length,v({},A,q))}return j.setSelection(M,e.default.sources.SILENT),L},H)}},{key:"formatLine",value:function(A,q,j,H,M){var L=this,C=void 0,K=z(A,q,j,H,M),G=S(K,4);return A=G[0],q=G[1],C=G[2],M=G[3],U.call(this,function(){return L.editor.formatLine(A,q,C)},M,A,0)}},{key:"formatText",value:function(A,q,j,H,M){var L=this,C=void 0,K=z(A,q,j,H,M),G=S(K,4);return A=G[0],q=G[1],C=G[2],M=G[3],U.call(this,function(){return L.editor.formatText(A,q,C)},M,A,0)}},{key:"getBounds",value:function(A){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,j=void 0;typeof A=="number"?j=this.selection.getBounds(A,q):j=this.selection.getBounds(A.index,A.length);var H=this.container.getBoundingClientRect();return{bottom:j.bottom-H.top,height:j.height,left:j.left-H.left,right:j.right-H.left,top:j.top-H.top,width:j.width}}},{key:"getContents",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-A,j=z(A,q),H=S(j,2);return A=H[0],q=H[1],this.editor.getContents(A,q)}},{key:"getFormat",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof A=="number"?this.editor.getFormat(A,q):this.editor.getFormat(A.index,A.length)}},{key:"getIndex",value:function(A){return A.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(A){return this.scroll.leaf(A)}},{key:"getLine",value:function(A){return this.scroll.line(A)}},{key:"getLines",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof A!="number"?this.scroll.lines(A.index,A.length):this.scroll.lines(A,q)}},{key:"getModule",value:function(A){return this.theme.modules[A]}},{key:"getSelection",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return A&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-A,j=z(A,q),H=S(j,2);return A=H[0],q=H[1],this.editor.getText(A,q)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(A,q,j){var H=this,M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:F.sources.API;return U.call(this,function(){return H.editor.insertEmbed(A,q,j)},M,A)}},{key:"insertText",value:function(A,q,j,H,M){var L=this,C=void 0,K=z(A,0,j,H,M),G=S(K,4);return A=G[0],C=G[2],M=G[3],U.call(this,function(){return L.editor.insertText(A,q,C)},M,A,q.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(A,q,j){this.clipboard.dangerouslyPasteHTML(A,q,j)}},{key:"removeFormat",value:function(A,q,j){var H=this,M=z(A,q,j),L=S(M,4);return A=L[0],q=L[1],j=L[3],U.call(this,function(){return H.editor.removeFormat(A,q)},j,A)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(A){var q=this,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API;return U.call(this,function(){A=new d.default(A);var H=q.getLength(),M=q.editor.deleteText(0,H),L=q.editor.applyDelta(A),C=L.ops[L.ops.length-1];C!=null&&typeof C.insert=="string"&&C.insert[C.insert.length-1]===` `&&(q.editor.deleteText(q.getLength()-1,1),L.delete(1));var K=M.compose(L);return K},j)}},{key:"setSelection",value:function(A,q,j){if(A==null)this.selection.setRange(null,q||F.sources.API);else{var H=z(A,q,j),M=S(H,4);A=M[0],q=M[1],j=M[3],this.selection.setRange(new o.Range(A,q),j),j!==e.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(A){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API,j=new d.default().insert(A);return this.setContents(j,q)}},{key:"update",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.default.sources.USER,q=this.scroll.update(A);return this.selection.update(A),q}},{key:"updateContents",value:function(A){var q=this,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.default.sources.API;return U.call(this,function(){return A=new d.default(A),q.editor.applyDelta(A,j)},j,!0)}}]),F})();x.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},x.events=e.default.events,x.sources=e.default.sources,x.version="1.3.7",x.imports={delta:d.default,parchment:a.default,"core/module":u.default,"core/theme":T.default};function I(F,R){if(R=(0,l.default)(!0,{container:F,modules:{clipboard:!0,keyboard:!0,history:!0}},R),!R.theme||R.theme===x.DEFAULTS.theme)R.theme=T.default;else if(R.theme=x.import("themes/"+R.theme),R.theme==null)throw new Error("Invalid theme "+R.theme+". Did you register it?");var A=(0,l.default)(!0,{},R.theme.DEFAULTS);[A,R].forEach(function(H){H.modules=H.modules||{},Object.keys(H.modules).forEach(function(M){H.modules[M]===!0&&(H.modules[M]={})})});var q=Object.keys(A.modules).concat(Object.keys(R.modules)),j=q.reduce(function(H,M){var L=x.import("modules/"+M);return L==null?w.error("Cannot load "+M+" module. Are you sure you registered it?"):H[M]=L.DEFAULTS||{},H},{});return R.modules!=null&&R.modules.toolbar&&R.modules.toolbar.constructor!==Object&&(R.modules.toolbar={container:R.modules.toolbar}),R=(0,l.default)(!0,{},x.DEFAULTS,{modules:j},A,R),["bounds","container","scrollingContainer"].forEach(function(H){typeof R[H]=="string"&&(R[H]=document.querySelector(R[H]))}),R.modules=Object.keys(R.modules).reduce(function(H,M){return R.modules[M]&&(H[M]=R.modules[M]),H},{}),R}function U(F,R,A,q){if(this.options.strict&&!this.isEnabled()&&R===e.default.sources.USER)return new d.default;var j=A==null?null:this.getSelection(),H=this.editor.delta,M=F();if(j!=null&&(A===!0&&(A=j.index),q==null?j=W(j,M,R):q!==0&&(j=W(j,A,q,R)),this.setSelection(j,e.default.sources.SILENT)),M.length()>0){var L,C=[e.default.events.TEXT_CHANGE,M,H,R];if((L=this.emitter).emit.apply(L,[e.default.events.EDITOR_CHANGE].concat(C)),R!==e.default.sources.SILENT){var K;(K=this.emitter).emit.apply(K,C)}}return M}function z(F,R,A,q,j){var H={};return typeof F.index=="number"&&typeof F.length=="number"?typeof R!="number"?(j=q,q=A,A=R,R=F.length,F=F.index):(R=F.length,F=F.index):typeof R!="number"&&(j=q,q=A,A=R,R=0),(typeof A>"u"?"undefined":P(A))==="object"?(H=A,j=q):typeof A=="string"&&(q!=null?H[A]=q:j=A),j=j||e.default.sources.API,[F,R,H,j]}function W(F,R,A,q){if(F==null)return null;var j=void 0,H=void 0;if(R instanceof d.default){var M=[F.index,F.index+F.length].map(function(G){return R.transformPosition(G,q!==e.default.sources.USER)}),L=S(M,2);j=L[0],H=L[1]}else{var C=[F.index,F.index+F.length].map(function(G){return G=0?G+A:Math.max(R,G+A)}),K=S(C,2);j=K[0],H=K[1]}return new o.Range(j,H-j)}O.expandConfig=I,O.overload=z,O.default=x}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function c(a,o){for(var r=0;r0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(r,n){var l=a.order.indexOf(r),E=a.order.indexOf(n);return l>=0||E>=0?l-E:r===n?0:r1?E-1:0),m=1;m1&&arguments[1]!==void 0?arguments[1]:{};P(this,k),this.quill=p,this.options=d};S.DEFAULTS={},O.default=S}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=["error","warn","log","info"],S="warn";function k(d){if(P.indexOf(d)<=P.indexOf(S)){for(var s,i=arguments.length,t=Array(i>1?i-1:0),e=1;e0&&typeof t[0]!="number")}function i(t,e,h){var u,c;if(d(t)||d(e)||t.prototype!==e.prototype)return!1;if(k(t))return k(e)?(t=P.call(t),e=P.call(e),p(t,e,h)):!1;if(s(t)){if(!s(e)||t.length!==e.length)return!1;for(u=0;u=0;u--)if(a[u]!=o[u])return!1;for(u=a.length-1;u>=0;u--)if(c=a[u],!p(t[c],e[c],h))return!1;return typeof t==typeof e}}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=g(1),S=(function(){function k(p,d,s){s===void 0&&(s={}),this.attrName=p,this.keyName=d;var i=P.Scope.TYPE&P.Scope.ATTRIBUTE;s.scope!=null?this.scope=s.scope&P.Scope.LEVEL|i:this.scope=P.Scope.ATTRIBUTE,s.whitelist!=null&&(this.whitelist=s.whitelist)}return k.keys=function(p){return[].map.call(p.attributes,function(d){return d.name})},k.prototype.add=function(p,d){return this.canAdd(p,d)?(p.setAttribute(this.keyName,d),!0):!1},k.prototype.canAdd=function(p,d){var s=P.query(p,P.Scope.BLOT&(this.scope|P.Scope.TYPE));return s==null?!1:this.whitelist==null?!0:typeof d=="string"?this.whitelist.indexOf(d.replace(/["']/g,""))>-1:this.whitelist.indexOf(d)>-1},k.prototype.remove=function(p){p.removeAttribute(this.keyName)},k.prototype.value=function(p){var d=p.getAttribute(this.keyName);return this.canAdd(p,d)&&d?d:""},k})();O.default=S}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0}),O.default=O.Code=void 0;var P=(function(){function m(T,y){var v=[],_=!0,w=!1,x=void 0;try{for(var I=T[Symbol.iterator](),U;!(_=(U=I.next()).done)&&(v.push(U.value),!(y&&v.length===y));_=!0);}catch(z){w=!0,x=z}finally{try{!_&&I.return&&I.return()}finally{if(w)throw x}}return v}return function(T,y){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return m(T,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),S=(function(){function m(T,y){for(var v=0;v=v+_)){var U=this.newlineIndex(v,!0)+1,z=I-U+1,W=this.isolate(U,z),F=W.next;W.format(w,x),F instanceof T&&F.formatAt(0,v-U+_-z,w,x)}}}},{key:"insertAt",value:function(v,_,w){if(w==null){var x=this.descendant(a.default,v),I=P(x,2),U=I[0],z=I[1];U.insertAt(z,_)}}},{key:"length",value:function(){var v=this.domNode.textContent.length;return this.domNode.textContent.endsWith(` `)?v:v+1}},{key:"newlineIndex",value:function(v){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(_)return this.domNode.textContent.slice(0,v).lastIndexOf(` `);var w=this.domNode.textContent.slice(v).indexOf(` `);return w>-1?v+w:-1}},{key:"optimize",value:function(v){this.domNode.textContent.endsWith(` `)||this.appendChild(i.default.create("text",` `)),k(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,v);var _=this.next;_!=null&&_.prev===this&&_.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===_.statics.formats(_.domNode)&&(_.optimize(v),_.moveChildren(this),_.remove())}},{key:"replace",value:function(v){k(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"replace",this).call(this,v),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(_){var w=i.default.find(_);w==null?_.parentNode.removeChild(_):w instanceof i.default.Embed?w.remove():w.unwrap()})}}],[{key:"create",value:function(v){var _=k(T.__proto__||Object.getPrototypeOf(T),"create",this).call(this,v);return _.setAttribute("spellcheck",!1),_}},{key:"formats",value:function(){return!0}}]),T})(e.default);b.blotName="code-block",b.tagName="PRE",b.TAB=" ",O.Code=E,O.default=b}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},S=(function(){function F(R,A){var q=[],j=!0,H=!1,M=void 0;try{for(var L=R[Symbol.iterator](),C;!(j=(C=L.next()).done)&&(q.push(C.value),!(A&&q.length===A));j=!0);}catch(K){H=!0,M=K}finally{try{!j&&L.return&&L.return()}finally{if(H)throw M}}return q}return function(R,A){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return F(R,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),k=(function(){function F(R,A){for(var q=0;q=H&&!G.endsWith(` `)&&(j=!0),q.scroll.insertAt(M,G);var X=q.scroll.line(M),tt=S(X,2),nt=tt[0],it=tt[1],ut=(0,v.default)({},(0,o.bubbleFormats)(nt));if(nt instanceof r.default){var ct=nt.descendant(e.default.Leaf,it),mt=S(ct,1),gt=mt[0];ut=(0,v.default)(ut,(0,o.bubbleFormats)(gt))}K=i.default.attributes.diff(ut,K)||{}}else if(P(L.insert)==="object"){var V=Object.keys(L.insert)[0];if(V==null)return M;q.scroll.insertAt(M,V,L.insert[V])}H+=C}return Object.keys(K).forEach(function(Y){q.scroll.formatAt(M,C,Y,K[Y])}),M+C},0),A.reduce(function(M,L){return typeof L.delete=="number"?(q.scroll.deleteAt(M,L.delete),M):M+(L.retain||L.insert.length||1)},0),this.scroll.batchEnd(),this.update(A)}},{key:"deleteText",value:function(A,q){return this.scroll.deleteAt(A,q),this.update(new d.default().retain(A).delete(q))}},{key:"formatLine",value:function(A,q){var j=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(H).forEach(function(M){if(!(j.scroll.whitelist!=null&&!j.scroll.whitelist[M])){var L=j.scroll.lines(A,Math.max(q,1)),C=q;L.forEach(function(K){var G=K.length();if(!(K instanceof u.default))K.format(M,H[M]);else{var X=A-K.offset(j.scroll),tt=K.newlineIndex(X+C)-X+1;K.formatAt(X,tt,M,H[M])}C-=G})}}),this.scroll.optimize(),this.update(new d.default().retain(A).retain(q,(0,b.default)(H)))}},{key:"formatText",value:function(A,q){var j=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(H).forEach(function(M){j.scroll.formatAt(A,q,M,H[M])}),this.update(new d.default().retain(A).retain(q,(0,b.default)(H)))}},{key:"getContents",value:function(A,q){return this.delta.slice(A,A+q)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(A,q){return A.concat(q.delta())},new d.default)}},{key:"getFormat",value:function(A){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,j=[],H=[];q===0?this.scroll.path(A).forEach(function(L){var C=S(L,1),K=C[0];K instanceof r.default?j.push(K):K instanceof e.default.Leaf&&H.push(K)}):(j=this.scroll.lines(A,q),H=this.scroll.descendants(e.default.Leaf,A,q));var M=[j,H].map(function(L){if(L.length===0)return{};for(var C=(0,o.bubbleFormats)(L.shift());Object.keys(C).length>0;){var K=L.shift();if(K==null)return C;C=z((0,o.bubbleFormats)(K),C)}return C});return v.default.apply(v.default,M)}},{key:"getText",value:function(A,q){return this.getContents(A,q).filter(function(j){return typeof j.insert=="string"}).map(function(j){return j.insert}).join("")}},{key:"insertEmbed",value:function(A,q,j){return this.scroll.insertAt(A,q,j),this.update(new d.default().retain(A).insert(w({},q,j)))}},{key:"insertText",value:function(A,q){var j=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return q=q.replace(/\r\n/g,` `).replace(/\r/g,` `),this.scroll.insertAt(A,q),Object.keys(H).forEach(function(M){j.scroll.formatAt(A,q.length,M,H[M])}),this.update(new d.default().retain(A).insert(q,(0,b.default)(H)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var A=this.scroll.children.head;return A.statics.blotName!==r.default.blotName||A.children.length>1?!1:A.children.head instanceof l.default}},{key:"removeFormat",value:function(A,q){var j=this.getText(A,q),H=this.scroll.line(A+q),M=S(H,2),L=M[0],C=M[1],K=0,G=new d.default;L!=null&&(L instanceof u.default?K=L.newlineIndex(C)-C+1:K=L.length()-C,G=L.delta().slice(C,C+K-1).insert(` `));var X=this.getContents(A,q+K),tt=X.diff(new d.default().insert(j).concat(G)),nt=new d.default().retain(A).concat(tt);return this.applyDelta(nt)}},{key:"update",value:function(A){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,H=this.delta;if(q.length===1&&q[0].type==="characterData"&&q[0].target.data.match(I)&&e.default.find(q[0].target)){var M=e.default.find(q[0].target),L=(0,o.bubbleFormats)(M),C=M.offset(this.scroll),K=q[0].oldValue.replace(a.default.CONTENTS,""),G=new d.default().insert(K),X=new d.default().insert(M.value()),tt=new d.default().retain(C).concat(G.diff(X,j));A=tt.reduce(function(nt,it){return it.insert?nt.insert(it.insert,L):nt.push(it)},new d.default),this.delta=H.compose(A)}else this.delta=this.getDelta(),(!A||!(0,T.default)(H.compose(A),this.delta))&&(A=H.diff(this.delta,j));return A}}]),F})();function z(F,R){return Object.keys(R).reduce(function(A,q){return F[q]==null||(R[q]===F[q]?A[q]=R[q]:Array.isArray(R[q])?R[q].indexOf(F[q])<0&&(A[q]=R[q].concat([F[q]])):A[q]=[R[q],F[q]]),A},{})}function W(F){return F.reduce(function(R,A){if(A.insert===1){var q=(0,b.default)(A.attributes);return delete q.image,R.insert({image:A.attributes.image},q)}if(A.attributes!=null&&(A.attributes.list===!0||A.attributes.bullet===!0)&&(A=(0,b.default)(A),A.attributes.list?A.attributes.list="ordered":(A.attributes.list="bullet",delete A.attributes.bullet)),typeof A.insert=="string"){var j=A.insert.replace(/\r\n/g,` `).replace(/\r/g,` `);return R.insert(j,A.attributes)}return R.push(A)},new d.default)}O.default=U}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0}),O.default=O.Range=void 0;var P=(function(){function m(T,y){var v=[],_=!0,w=!1,x=void 0;try{for(var I=T[Symbol.iterator](),U;!(_=(U=I.next()).done)&&(v.push(U.value),!(y&&v.length===y));_=!0);}catch(z){w=!0,x=z}finally{try{!_&&I.return&&I.return()}finally{if(w)throw x}}return v}return function(T,y){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return m(T,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),S=(function(){function m(T,y){for(var v=0;v1&&arguments[1]!==void 0?arguments[1]:0;r(this,m),this.index=T,this.length=y},E=(function(){function m(T,y){var v=this;r(this,m),this.emitter=y,this.scroll=T,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=p.default.create("cursor",this),this.lastRange=this.savedRange=new l(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){v.mouseDown||setTimeout(v.update.bind(v,h.default.sources.USER),1)}),this.emitter.on(h.default.events.EDITOR_CHANGE,function(_,w){_===h.default.events.TEXT_CHANGE&&w.length()>0&&v.update(h.default.sources.SILENT)}),this.emitter.on(h.default.events.SCROLL_BEFORE_UPDATE,function(){if(v.hasFocus()){var _=v.getNativeRange();_!=null&&_.start.node!==v.cursor.textNode&&v.emitter.once(h.default.events.SCROLL_UPDATE,function(){try{v.setNativeRange(_.start.node,_.start.offset,_.end.node,_.end.offset)}catch{}})}}),this.emitter.on(h.default.events.SCROLL_OPTIMIZE,function(_,w){if(w.range){var x=w.range,I=x.startNode,U=x.startOffset,z=x.endNode,W=x.endOffset;v.setNativeRange(I,U,z,W)}}),this.update(h.default.sources.SILENT)}return S(m,[{key:"handleComposition",value:function(){var y=this;this.root.addEventListener("compositionstart",function(){y.composing=!0}),this.root.addEventListener("compositionend",function(){if(y.composing=!1,y.cursor.parent){var v=y.cursor.restore();if(!v)return;setTimeout(function(){y.setNativeRange(v.startNode,v.startOffset,v.endNode,v.endOffset)},1)}})}},{key:"handleDragging",value:function(){var y=this;this.emitter.listenDOM("mousedown",document.body,function(){y.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){y.mouseDown=!1,y.update(h.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(y,v){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[y])){this.scroll.update();var _=this.getNativeRange();if(!(_==null||!_.native.collapsed||p.default.query(y,p.default.Scope.BLOCK))){if(_.start.node!==this.cursor.textNode){var w=p.default.find(_.start.node,!1);if(w==null)return;if(w instanceof p.default.Leaf){var x=w.split(_.start.offset);w.parent.insertBefore(this.cursor,x)}else w.insertBefore(this.cursor,_.start.node);this.cursor.attach()}this.cursor.format(y,v),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(y){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=this.scroll.length();y=Math.min(y,_-1),v=Math.min(y+v,_-1)-y;var w=void 0,x=this.scroll.leaf(y),I=P(x,2),U=I[0],z=I[1];if(U==null)return null;var W=U.position(z,!0),F=P(W,2);w=F[0],z=F[1];var R=document.createRange();if(v>0){R.setStart(w,z);var A=this.scroll.leaf(y+v),q=P(A,2);if(U=q[0],z=q[1],U==null)return null;var j=U.position(z,!0),H=P(j,2);return w=H[0],z=H[1],R.setEnd(w,z),R.getBoundingClientRect()}else{var M="left",L=void 0;return w instanceof Text?(z0&&(M="right")),{bottom:L.top+L.height,height:L.height,left:L[M],right:L[M],top:L.top,width:0}}}},{key:"getNativeRange",value:function(){var y=document.getSelection();if(y==null||y.rangeCount<=0)return null;var v=y.getRangeAt(0);if(v==null)return null;var _=this.normalizeNative(v);return n.info("getNativeRange",_),_}},{key:"getRange",value:function(){var y=this.getNativeRange();if(y==null)return[null,null];var v=this.normalizedToRange(y);return[v,y]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(y){var v=this,_=[[y.start.node,y.start.offset]];y.native.collapsed||_.push([y.end.node,y.end.offset]);var w=_.map(function(U){var z=P(U,2),W=z[0],F=z[1],R=p.default.find(W,!0),A=R.offset(v.scroll);return F===0?A:R instanceof p.default.Container?A+R.length():A+R.index(W,F)}),x=Math.min(Math.max.apply(Math,o(w)),this.scroll.length()-1),I=Math.min.apply(Math,[x].concat(o(w)));return new l(I,x-I)}},{key:"normalizeNative",value:function(y){if(!b(this.root,y.startContainer)||!y.collapsed&&!b(this.root,y.endContainer))return null;var v={start:{node:y.startContainer,offset:y.startOffset},end:{node:y.endContainer,offset:y.endOffset},native:y};return[v.start,v.end].forEach(function(_){for(var w=_.node,x=_.offset;!(w instanceof Text)&&w.childNodes.length>0;)if(w.childNodes.length>x)w=w.childNodes[x],x=0;else if(w.childNodes.length===x)w=w.lastChild,x=w instanceof Text?w.data.length:w.childNodes.length+1;else break;_.node=w,_.offset=x}),v}},{key:"rangeToNative",value:function(y){var v=this,_=y.collapsed?[y.index]:[y.index,y.index+y.length],w=[],x=this.scroll.length();return _.forEach(function(I,U){I=Math.min(x-1,I);var z=void 0,W=v.scroll.leaf(I),F=P(W,2),R=F[0],A=F[1],q=R.position(A,U!==0),j=P(q,2);z=j[0],A=j[1],w.push(z,A)}),w.length<2&&(w=w.concat(w)),w}},{key:"scrollIntoView",value:function(y){var v=this.lastRange;if(v!=null){var _=this.getBounds(v.index,v.length);if(_!=null){var w=this.scroll.length()-1,x=this.scroll.line(Math.min(v.index,w)),I=P(x,1),U=I[0],z=U;if(v.length>0){var W=this.scroll.line(Math.min(v.index+v.length,w)),F=P(W,1);z=F[0]}if(!(U==null||z==null)){var R=y.getBoundingClientRect();_.topR.bottom&&(y.scrollTop+=_.bottom-R.bottom)}}}}},{key:"setNativeRange",value:function(y,v){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y,w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:v,x=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(n.info("setNativeRange",y,v,_,w),!(y!=null&&(this.root.parentNode==null||y.parentNode==null||_.parentNode==null))){var I=document.getSelection();if(I!=null)if(y!=null){this.hasFocus()||this.root.focus();var U=(this.getNativeRange()||{}).native;if(U==null||x||y!==U.startContainer||v!==U.startOffset||_!==U.endContainer||w!==U.endOffset){y.tagName=="BR"&&(v=[].indexOf.call(y.parentNode.childNodes,y),y=y.parentNode),_.tagName=="BR"&&(w=[].indexOf.call(_.parentNode.childNodes,_),_=_.parentNode);var z=document.createRange();z.setStart(y,v),z.setEnd(_,w),I.removeAllRanges(),I.addRange(z)}}else I.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(y){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h.default.sources.API;if(typeof v=="string"&&(_=v,v=!1),n.info("setRange",y),y!=null){var w=this.rangeToNative(y);this.setNativeRange.apply(this,o(w).concat([v]))}else this.setNativeRange(null);this.update(_)}},{key:"update",value:function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h.default.sources.USER,v=this.lastRange,_=this.getRange(),w=P(_,2),x=w[0],I=w[1];if(this.lastRange=x,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,t.default)(v,this.lastRange)){var U;!this.composing&&I!=null&&I.native.collapsed&&I.start.node!==this.cursor.textNode&&this.cursor.restore();var z=[h.default.events.SELECTION_CHANGE,(0,s.default)(this.lastRange),(0,s.default)(v),y];if((U=this.emitter).emit.apply(U,[h.default.events.EDITOR_CHANGE].concat(z)),y!==h.default.sources.SILENT){var W;(W=this.emitter).emit.apply(W,z)}}}}]),m})();function b(m,T){try{T.parentNode}catch{return!1}return T instanceof Text&&(T=T.parentNode),m.contains(T)}O.Range=l,O.default=E}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function h(u,c){for(var a=0;a0&&(e+=1),[this.parent.domNode,e]},s.prototype.value=function(){var i;return i={},i[this.statics.blotName]=this.statics.value(this.domNode)||!0,i},s.scope=k.Scope.INLINE_BLOT,s})(S.default);O.default=p}),(function(B,O,g){var P=g(11),S=g(3),k={attributes:{compose:function(d,s,i){typeof d!="object"&&(d={}),typeof s!="object"&&(s={});var t=S(!0,{},s);i||(t=Object.keys(t).reduce(function(h,u){return t[u]!=null&&(h[u]=t[u]),h},{}));for(var e in d)d[e]!==void 0&&s[e]===void 0&&(t[e]=d[e]);return Object.keys(t).length>0?t:void 0},diff:function(d,s){typeof d!="object"&&(d={}),typeof s!="object"&&(s={});var i=Object.keys(d).concat(Object.keys(s)).reduce(function(t,e){return P(d[e],s[e])||(t[e]=s[e]===void 0?null:s[e]),t},{});return Object.keys(i).length>0?i:void 0},transform:function(d,s,i){if(typeof d!="object")return s;if(typeof s=="object"){if(!i)return s;var t=Object.keys(s).reduce(function(e,h){return d[h]===void 0&&(e[h]=s[h]),e},{});return Object.keys(t).length>0?t:void 0}}},iterator:function(d){return new p(d)},length:function(d){return typeof d.delete=="number"?d.delete:typeof d.retain=="number"?d.retain:typeof d.insert=="string"?d.insert.length:1}};function p(d){this.ops=d,this.index=0,this.offset=0}p.prototype.hasNext=function(){return this.peekLength()<1/0},p.prototype.next=function(d){d||(d=1/0);var s=this.ops[this.index];if(s){var i=this.offset,t=k.length(s);if(d>=t-i?(d=t-i,this.index+=1,this.offset=0):this.offset+=d,typeof s.delete=="number")return{delete:d};var e={};return s.attributes&&(e.attributes=s.attributes),typeof s.retain=="number"?e.retain=d:typeof s.insert=="string"?e.insert=s.insert.substr(i,d):e.insert=s.insert,e}else return{retain:1/0}},p.prototype.peek=function(){return this.ops[this.index]},p.prototype.peekLength=function(){return this.ops[this.index]?k.length(this.ops[this.index])-this.offset:1/0},p.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},p.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var d=this.offset,s=this.index,i=this.next(),t=this.ops.slice(this.index);return this.offset=d,this.index=s,[i].concat(t)}else return[]},B.exports=k}),(function(B,O){var g=(function(){function P(u,c){return c!=null&&u instanceof c}var S;try{S=Map}catch{S=function(){}}var k;try{k=Set}catch{k=function(){}}var p;try{p=Promise}catch{p=function(){}}function d(u,c,a,o,r){typeof c=="object"&&(a=c.depth,o=c.prototype,r=c.includeNonEnumerable,c=c.circular);var n=[],l=[],E=typeof Buffer<"u";typeof c>"u"&&(c=!0),typeof a>"u"&&(a=1/0);function b(m,T){if(m===null)return null;if(T===0)return m;var y,v;if(typeof m!="object")return m;if(P(m,S))y=new S;else if(P(m,k))y=new k;else if(P(m,p))y=new p(function(R,A){m.then(function(q){R(b(q,T-1))},function(q){A(b(q,T-1))})});else if(d.__isArray(m))y=[];else if(d.__isRegExp(m))y=new RegExp(m.source,h(m)),m.lastIndex&&(y.lastIndex=m.lastIndex);else if(d.__isDate(m))y=new Date(m.getTime());else{if(E&&Buffer.isBuffer(m))return Buffer.allocUnsafe?y=Buffer.allocUnsafe(m.length):y=new Buffer(m.length),m.copy(y),y;P(m,Error)?y=Object.create(m):typeof o>"u"?(v=Object.getPrototypeOf(m),y=Object.create(v)):(y=Object.create(o),v=o)}if(c){var _=n.indexOf(m);if(_!=-1)return l[_];n.push(m),l.push(y)}P(m,S)&&m.forEach(function(R,A){var q=b(A,T-1),j=b(R,T-1);y.set(q,j)}),P(m,k)&&m.forEach(function(R){var A=b(R,T-1);y.add(A)});for(var w in m){var x;v&&(x=Object.getOwnPropertyDescriptor(v,w)),!(x&&x.set==null)&&(y[w]=b(m[w],T-1))}if(Object.getOwnPropertySymbols)for(var I=Object.getOwnPropertySymbols(m),w=0;w0){if(z instanceof t.BlockEmbed||A instanceof t.BlockEmbed){this.optimize();return}if(z instanceof a.default){var q=z.newlineIndex(z.length(),!0);if(q>-1&&(z=z.split(q+1),z===A)){this.optimize();return}}else if(A instanceof a.default){var j=A.newlineIndex(0);j>-1&&A.split(j+1)}var H=A.children.head instanceof u.default?null:A.children.head;z.moveChildren(A,H),z.remove()}this.optimize()}},{key:"enable",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",w)}},{key:"formatAt",value:function(w,x,I,U){this.whitelist!=null&&!this.whitelist[I]||(k(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"formatAt",this).call(this,w,x,I,U),this.optimize())}},{key:"insertAt",value:function(w,x,I){if(!(I!=null&&this.whitelist!=null&&!this.whitelist[x])){if(w>=this.length())if(I==null||d.default.query(x,d.default.Scope.BLOCK)==null){var U=d.default.create(this.statics.defaultChild);this.appendChild(U),I==null&&x.endsWith(` `)&&(x=x.slice(0,-1)),U.insertAt(0,x,I)}else{var z=d.default.create(x,I);this.appendChild(z)}else k(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,w,x,I);this.optimize()}}},{key:"insertBefore",value:function(w,x){if(w.statics.scope===d.default.Scope.INLINE_BLOT){var I=d.default.create(this.statics.defaultChild);I.appendChild(w),w=I}k(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertBefore",this).call(this,w,x)}},{key:"leaf",value:function(w){return this.path(w).pop()||[null,-1]}},{key:"line",value:function(w){return w===this.length()?this.line(w-1):this.descendant(m,w)}},{key:"lines",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,I=function U(z,W,F){var R=[],A=F;return z.children.forEachAt(W,F,function(q,j,H){m(q)?R.push(q):q instanceof d.default.Container&&(R=R.concat(U(q,j,A))),A-=H}),R};return I(this,w,x)}},{key:"optimize",value:function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(k(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,w,x),w.length>0&&this.emitter.emit(i.default.events.SCROLL_OPTIMIZE,w,x))}},{key:"path",value:function(w){return k(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"path",this).call(this,w).slice(1)}},{key:"update",value:function(w){if(this.batch!==!0){var x=i.default.sources.USER;typeof w=="string"&&(x=w),Array.isArray(w)||(w=this.observer.takeRecords()),w.length>0&&this.emitter.emit(i.default.events.SCROLL_BEFORE_UPDATE,x,w),k(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"update",this).call(this,w.concat([])),w.length>0&&this.emitter.emit(i.default.events.SCROLL_UPDATE,x,w)}}}]),v})(d.default.Scroll);T.blotName="scroll",T.className="ql-editor",T.tagName="DIV",T.defaultChild="block",T.allowedChildren=[e.default,t.BlockEmbed,r.default],O.default=T}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0}),O.SHORTKEY=O.default=void 0;var P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},S=(function(){function L(C,K){var G=[],X=!0,tt=!1,nt=void 0;try{for(var it=C[Symbol.iterator](),ut;!(X=(ut=it.next()).done)&&(G.push(ut.value),!(K&&G.length===K));X=!0);}catch(ct){tt=!0,nt=ct}finally{try{!X&&it.return&&it.return()}finally{if(tt)throw nt}}return G}return function(C,K){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return L(C,K);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),k=(function(){function L(C,K){for(var G=0;G1&&arguments[1]!==void 0?arguments[1]:{},tt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},nt=M(G);if(nt==null||nt.key==null)return I.warn("Attempted to add invalid keyboard binding",nt);typeof X=="function"&&(X={handler:X}),typeof tt=="function"&&(tt={handler:tt}),nt=(0,e.default)(nt,X,tt),this.bindings[nt.key]=this.bindings[nt.key]||[],this.bindings[nt.key].push(nt)}},{key:"listen",value:function(){var G=this;this.quill.root.addEventListener("keydown",function(X){if(!X.defaultPrevented){var tt=X.which||X.keyCode,nt=(G.bindings[tt]||[]).filter(function(ht){return C.match(X,ht)});if(nt.length!==0){var it=G.quill.getSelection();if(!(it==null||!G.quill.hasFocus())){var ut=G.quill.getLine(it.index),ct=S(ut,2),mt=ct[0],gt=ct[1],V=G.quill.getLeaf(it.index),Y=S(V,2),J=Y[0],$=Y[1],Q=it.length===0?[J,$]:G.quill.getLeaf(it.index+it.length),at=S(Q,2),rt=at[0],ot=at[1],Tt=J instanceof r.default.Text?J.value().slice(0,$):"",Et=rt instanceof r.default.Text?rt.value().slice(ot):"",pt={collapsed:it.length===0,empty:it.length===0&&mt.length()<=1,format:G.quill.getFormat(it),offset:gt,prefix:Tt,suffix:Et},Yt=nt.some(function(ht){if(ht.collapsed!=null&&ht.collapsed!==pt.collapsed||ht.empty!=null&&ht.empty!==pt.empty||ht.offset!=null&&ht.offset!==pt.offset)return!1;if(Array.isArray(ht.format)){if(ht.format.every(function(qt){return pt.format[qt]==null}))return!1}else if(P(ht.format)==="object"&&!Object.keys(ht.format).every(function(qt){return ht.format[qt]===!0?pt.format[qt]!=null:ht.format[qt]===!1?pt.format[qt]==null:(0,i.default)(ht.format[qt],pt.format[qt])}))return!1;return ht.prefix!=null&&!ht.prefix.test(pt.prefix)||ht.suffix!=null&&!ht.suffix.test(pt.suffix)?!1:ht.handler.call(G,it,pt)!==!0});Yt&&X.preventDefault()}}}})}}]),C})(T.default);z.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},z.DEFAULTS={bindings:{bold:H("bold"),italic:H("italic"),underline:H("underline"),indent:{key:z.keys.TAB,format:["blockquote","indent","list"],handler:function(C,K){if(K.collapsed&&K.offset!==0)return!0;this.quill.format("indent","+1",l.default.sources.USER)}},outdent:{key:z.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(C,K){if(K.collapsed&&K.offset!==0)return!0;this.quill.format("indent","-1",l.default.sources.USER)}},"outdent backspace":{key:z.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(C,K){K.format.indent!=null?this.quill.format("indent","-1",l.default.sources.USER):K.format.list!=null&&this.quill.format("list",!1,l.default.sources.USER)}},"indent code-block":j(!0),"outdent code-block":j(!1),"remove tab":{key:z.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(C){this.quill.deleteText(C.index-1,1,l.default.sources.USER)}},tab:{key:z.keys.TAB,handler:function(C){this.quill.history.cutoff();var K=new u.default().retain(C.index).delete(C.length).insert(" ");this.quill.updateContents(K,l.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(C.index+1,l.default.sources.SILENT)}},"list empty enter":{key:z.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(C,K){this.quill.format("list",!1,l.default.sources.USER),K.format.indent&&this.quill.format("indent",!1,l.default.sources.USER)}},"checklist enter":{key:z.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(C){var K=this.quill.getLine(C.index),G=S(K,2),X=G[0],tt=G[1],nt=(0,e.default)({},X.formats(),{list:"checked"}),it=new u.default().retain(C.index).insert(` `,nt).retain(X.length()-tt-1).retain(1,{list:"unchecked"});this.quill.updateContents(it,l.default.sources.USER),this.quill.setSelection(C.index+1,l.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:z.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(C,K){var G=this.quill.getLine(C.index),X=S(G,2),tt=X[0],nt=X[1],it=new u.default().retain(C.index).insert(` `,K.format).retain(tt.length()-nt-1).retain(1,{header:null});this.quill.updateContents(it,l.default.sources.USER),this.quill.setSelection(C.index+1,l.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(C,K){var G=K.prefix.length,X=this.quill.getLine(C.index),tt=S(X,2),nt=tt[0],it=tt[1];if(it>G)return!0;var ut=void 0;switch(K.prefix.trim()){case"[]":case"[ ]":ut="unchecked";break;case"[x]":ut="checked";break;case"-":case"*":ut="bullet";break;default:ut="ordered"}this.quill.insertText(C.index," ",l.default.sources.USER),this.quill.history.cutoff();var ct=new u.default().retain(C.index-it).delete(G+1).retain(nt.length()-2-it).retain(1,{list:ut});this.quill.updateContents(ct,l.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(C.index-G,l.default.sources.SILENT)}},"code exit":{key:z.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(C){var K=this.quill.getLine(C.index),G=S(K,2),X=G[0],tt=G[1],nt=new u.default().retain(C.index+X.length()-tt-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(nt,l.default.sources.USER)}},"embed left":W(z.keys.LEFT,!1),"embed left shift":W(z.keys.LEFT,!0),"embed right":W(z.keys.RIGHT,!1),"embed right shift":W(z.keys.RIGHT,!0)}};function W(L,C){var K,G=L===z.keys.LEFT?"prefix":"suffix";return K={key:L,shiftKey:C,altKey:null},v(K,G,/^$/),v(K,"handler",function(tt){var nt=tt.index;L===z.keys.RIGHT&&(nt+=tt.length+1);var it=this.quill.getLeaf(nt),ut=S(it,1),ct=ut[0];return ct instanceof r.default.Embed?(L===z.keys.LEFT?C?this.quill.setSelection(tt.index-1,tt.length+1,l.default.sources.USER):this.quill.setSelection(tt.index-1,l.default.sources.USER):C?this.quill.setSelection(tt.index,tt.length+1,l.default.sources.USER):this.quill.setSelection(tt.index+tt.length+1,l.default.sources.USER),!1):!0}),K}function F(L,C){if(!(L.index===0||this.quill.getLength()<=1)){var K=this.quill.getLine(L.index),G=S(K,1),X=G[0],tt={};if(C.offset===0){var nt=this.quill.getLine(L.index-1),it=S(nt,1),ut=it[0];if(ut!=null&&ut.length()>1){var ct=X.formats(),mt=this.quill.getFormat(L.index-1,1);tt=a.default.attributes.diff(ct,mt)||{}}}var gt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(C.prefix)?2:1;this.quill.deleteText(L.index-gt,gt,l.default.sources.USER),Object.keys(tt).length>0&&this.quill.formatLine(L.index-gt,gt,tt,l.default.sources.USER),this.quill.focus()}}function R(L,C){var K=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(C.suffix)?2:1;if(!(L.index>=this.quill.getLength()-K)){var G={},X=0,tt=this.quill.getLine(L.index),nt=S(tt,1),it=nt[0];if(C.offset>=it.length()-1){var ut=this.quill.getLine(L.index+1),ct=S(ut,1),mt=ct[0];if(mt){var gt=it.formats(),V=this.quill.getFormat(L.index,1);G=a.default.attributes.diff(gt,V)||{},X=mt.length()}}this.quill.deleteText(L.index,K,l.default.sources.USER),Object.keys(G).length>0&&this.quill.formatLine(L.index+X-1,K,G,l.default.sources.USER)}}function A(L){var C=this.quill.getLines(L),K={};if(C.length>1){var G=C[0].formats(),X=C[C.length-1].formats();K=a.default.attributes.diff(X,G)||{}}this.quill.deleteText(L,l.default.sources.USER),Object.keys(K).length>0&&this.quill.formatLine(L.index,1,K,l.default.sources.USER),this.quill.setSelection(L.index,l.default.sources.SILENT),this.quill.focus()}function q(L,C){var K=this;L.length>0&&this.quill.scroll.deleteAt(L.index,L.length);var G=Object.keys(C.format).reduce(function(X,tt){return r.default.query(tt,r.default.Scope.BLOCK)&&!Array.isArray(C.format[tt])&&(X[tt]=C.format[tt]),X},{});this.quill.insertText(L.index,` `,G,l.default.sources.USER),this.quill.setSelection(L.index+1,l.default.sources.SILENT),this.quill.focus(),Object.keys(C.format).forEach(function(X){G[X]==null&&(Array.isArray(C.format[X])||X!=="link"&&K.quill.format(X,C.format[X],l.default.sources.USER))})}function j(L){return{key:z.keys.TAB,shiftKey:!L,format:{"code-block":!0},handler:function(K){var G=r.default.query("code-block"),X=K.index,tt=K.length,nt=this.quill.scroll.descendant(G,X),it=S(nt,2),ut=it[0],ct=it[1];if(ut!=null){var mt=this.quill.getIndex(ut),gt=ut.newlineIndex(ct,!0)+1,V=ut.newlineIndex(mt+ct+tt),Y=ut.domNode.textContent.slice(gt,V).split(` `);ct=0,Y.forEach(function(J,$){L?(ut.insertAt(gt+ct,G.TAB),ct+=G.TAB.length,$===0?X+=G.TAB.length:tt+=G.TAB.length):J.startsWith(G.TAB)&&(ut.deleteAt(gt+ct,G.TAB.length),ct-=G.TAB.length,$===0?X-=G.TAB.length:tt-=G.TAB.length),ct+=J.length+1}),this.quill.update(l.default.sources.USER),this.quill.setSelection(X,tt,l.default.sources.SILENT)}}}}function H(L){return{key:L[0].toUpperCase(),shortKey:!0,handler:function(K,G){this.quill.format(L,!G.format[L],l.default.sources.USER)}}}function M(L){if(typeof L=="string"||typeof L=="number")return M({key:L});if((typeof L>"u"?"undefined":P(L))==="object"&&(L=(0,d.default)(L,!1)),typeof L.key=="string")if(z.keys[L.key.toUpperCase()]!=null)L.key=z.keys[L.key.toUpperCase()];else if(L.key.length===1)L.key=L.key.toUpperCase().charCodeAt(0);else return null;return L.shortKey&&(L[U]=L.shortKey,delete L.shortKey),L}O.default=z,O.SHORTKEY=U}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function a(o,r){var n=[],l=!0,E=!1,b=void 0;try{for(var m=o[Symbol.iterator](),T;!(l=(T=m.next()).done)&&(n.push(T.value),!(r&&n.length===r));l=!0);}catch(y){E=!0,b=y}finally{try{!l&&m.return&&m.return()}finally{if(E)throw b}}return n}return function(o,r){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return a(o,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),S=function a(o,r,n){o===null&&(o=Function.prototype);var l=Object.getOwnPropertyDescriptor(o,r);if(l===void 0){var E=Object.getPrototypeOf(o);return E===null?void 0:a(E,r,n)}else{if("value"in l)return l.value;var b=l.get;return b===void 0?void 0:b.call(n)}},k=(function(){function a(o,r){for(var n=0;n-1}O.default=e,O.sanitize=h}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},S=(function(){function c(a,o){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:!1,n=this.container.querySelector(".ql-selected");if(o!==n&&(n?.classList.remove("ql-selected"),o!=null&&(o.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(o.parentNode.children,o),o.hasAttribute("data-value")?this.label.setAttribute("data-value",o.getAttribute("data-value")):this.label.removeAttribute("data-value"),o.hasAttribute("data-label")?this.label.setAttribute("data-label",o.getAttribute("data-label")):this.label.removeAttribute("data-label"),r))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":P(Event))==="object"){var l=document.createEvent("Event");l.initEvent("change",!0,!0),this.select.dispatchEvent(l)}this.close()}}},{key:"update",value:function(){var o=void 0;if(this.select.selectedIndex>-1){var r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];o=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);var n=o!=null&&o!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),c})();O.default=u}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=g(0),S=I(P),k=g(5),p=I(k),d=g(4),s=I(d),i=g(16),t=I(i),e=g(25),h=I(e),u=g(24),c=I(u),a=g(35),o=I(a),r=g(6),n=I(r),l=g(22),E=I(l),b=g(7),m=I(b),T=g(55),y=I(T),v=g(42),_=I(v),w=g(23),x=I(w);function I(U){return U&&U.__esModule?U:{default:U}}p.default.register({"blots/block":s.default,"blots/block/embed":d.BlockEmbed,"blots/break":t.default,"blots/container":h.default,"blots/cursor":c.default,"blots/embed":o.default,"blots/inline":n.default,"blots/scroll":E.default,"blots/text":m.default,"modules/clipboard":y.default,"modules/history":_.default,"modules/keyboard":x.default}),S.default.register(s.default,t.default,c.default,n.default,E.default,m.default),O.default=p.default}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=g(1),S=(function(){function k(p){this.domNode=p,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(p){if(this.tagName==null)throw new P.ParchmentError("Blot definition missing tagName");var d;return Array.isArray(this.tagName)?(typeof p=="string"&&(p=p.toUpperCase(),parseInt(p).toString()===p&&(p=parseInt(p))),typeof p=="number"?d=document.createElement(this.tagName[p-1]):this.tagName.indexOf(p)>-1?d=document.createElement(p):d=document.createElement(this.tagName[0])):d=document.createElement(this.tagName),this.className&&d.classList.add(this.className),d},k.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},k.prototype.clone=function(){var p=this.domNode.cloneNode(!1);return P.create(p)},k.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[P.DATA_KEY]},k.prototype.deleteAt=function(p,d){var s=this.isolate(p,d);s.remove()},k.prototype.formatAt=function(p,d,s,i){var t=this.isolate(p,d);if(P.query(s,P.Scope.BLOT)!=null&&i)t.wrap(s,i);else if(P.query(s,P.Scope.ATTRIBUTE)!=null){var e=P.create(this.statics.scope);t.wrap(e),e.format(s,i)}},k.prototype.insertAt=function(p,d,s){var i=s==null?P.create("text",d):P.create(d,s),t=this.split(p);this.parent.insertBefore(i,t)},k.prototype.insertInto=function(p,d){d===void 0&&(d=null),this.parent!=null&&this.parent.children.remove(this);var s=null;p.children.insertBefore(this,d),d!=null&&(s=d.domNode),(this.domNode.parentNode!=p.domNode||this.domNode.nextSibling!=s)&&p.domNode.insertBefore(this.domNode,s),this.parent=p,this.attach()},k.prototype.isolate=function(p,d){var s=this.split(p);return s.split(d),s},k.prototype.length=function(){return 1},k.prototype.offset=function(p){return p===void 0&&(p=this.parent),this.parent==null||this==p?0:this.parent.children.offset(this)+this.parent.offset(p)},k.prototype.optimize=function(p){this.domNode[P.DATA_KEY]!=null&&delete this.domNode[P.DATA_KEY].mutations},k.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},k.prototype.replace=function(p){p.parent!=null&&(p.parent.insertBefore(this,p.next),p.remove())},k.prototype.replaceWith=function(p,d){var s=typeof p=="string"?P.create(p,d):p;return s.replace(this),s},k.prototype.split=function(p,d){return p===0?this:this.next},k.prototype.update=function(p,d){},k.prototype.wrap=function(p,d){var s=typeof p=="string"?P.create(p,d):p;return this.parent!=null&&this.parent.insertBefore(s,this.next),s.appendChild(this),s},k.blotName="abstract",k})();O.default=S}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=g(12),S=g(32),k=g(33),p=g(1),d=(function(){function s(i){this.attributes={},this.domNode=i,this.build()}return s.prototype.attribute=function(i,t){t?i.add(this.domNode,t)&&(i.value(this.domNode)!=null?this.attributes[i.attrName]=i:delete this.attributes[i.attrName]):(i.remove(this.domNode),delete this.attributes[i.attrName])},s.prototype.build=function(){var i=this;this.attributes={};var t=P.default.keys(this.domNode),e=S.default.keys(this.domNode),h=k.default.keys(this.domNode);t.concat(e).concat(h).forEach(function(u){var c=p.query(u,p.Scope.ATTRIBUTE);c instanceof P.default&&(i.attributes[c.attrName]=c)})},s.prototype.copy=function(i){var t=this;Object.keys(this.attributes).forEach(function(e){var h=t.attributes[e].value(t.domNode);i.format(e,h)})},s.prototype.move=function(i){var t=this;this.copy(i),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},s.prototype.values=function(){var i=this;return Object.keys(this.attributes).reduce(function(t,e){return t[e]=i.attributes[e].value(i.domNode),t},{})},s})();O.default=d}),(function(B,O,g){var P=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var t in i)i.hasOwnProperty(t)&&(s[t]=i[t])};return function(s,i){d(s,i);function t(){this.constructor=s}s.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}})();Object.defineProperty(O,"__esModule",{value:!0});var S=g(12);function k(d,s){var i=d.getAttribute("class")||"";return i.split(/\s+/).filter(function(t){return t.indexOf(s+"-")===0})}var p=(function(d){P(s,d);function s(){return d!==null&&d.apply(this,arguments)||this}return s.keys=function(i){return(i.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},s.prototype.add=function(i,t){return this.canAdd(i,t)?(this.remove(i),i.classList.add(this.keyName+"-"+t),!0):!1},s.prototype.remove=function(i){var t=k(i,this.keyName);t.forEach(function(e){i.classList.remove(e)}),i.classList.length===0&&i.removeAttribute("class")},s.prototype.value=function(i){var t=k(i,this.keyName)[0]||"",e=t.slice(this.keyName.length+1);return this.canAdd(i,e)?e:""},s})(S.default);O.default=p}),(function(B,O,g){var P=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var t in i)i.hasOwnProperty(t)&&(s[t]=i[t])};return function(s,i){d(s,i);function t(){this.constructor=s}s.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}})();Object.defineProperty(O,"__esModule",{value:!0});var S=g(12);function k(d){var s=d.split("-"),i=s.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return s[0]+i}var p=(function(d){P(s,d);function s(){return d!==null&&d.apply(this,arguments)||this}return s.keys=function(i){return(i.getAttribute("style")||"").split(";").map(function(t){var e=t.split(":");return e[0].trim()})},s.prototype.add=function(i,t){return this.canAdd(i,t)?(i.style[k(this.keyName)]=t,!0):!1},s.prototype.remove=function(i){i.style[k(this.keyName)]="",i.getAttribute("style")||i.removeAttribute("style")},s.prototype.value=function(i){var t=i.style[k(this.keyName)];return this.canAdd(i,t)?t:""},s})(S.default);O.default=p}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function p(d,s){for(var i=0;iT&&this.stack.undo.length>0){var y=this.stack.undo.pop();m=m.compose(y.undo),E=y.redo.compose(E)}else this.lastRecorded=T;this.stack.undo.push({redo:E,undo:m}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(E){this.stack.undo.forEach(function(b){b.undo=E.transform(b.undo,!0),b.redo=E.transform(b.redo,!0)}),this.stack.redo.forEach(function(b){b.undo=E.transform(b.undo,!0),b.redo=E.transform(b.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),n})(i.default);c.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function a(r){var n=r.ops[r.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(` `):n.attributes!=null?Object.keys(n.attributes).some(function(l){return k.default.query(l,k.default.Scope.BLOCK)!=null}):!1}function o(r){var n=r.reduce(function(E,b){return E+=b.delete||0,E},0),l=r.length()-n;return a(r)&&(l-=1),l}O.default=c,O.getLastChangeIndex=o}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0}),O.default=O.BaseTooltip=void 0;var P=(function(){function q(j,H){for(var M=0;M0&&arguments[0]!==void 0?arguments[0]:"link",L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),L!=null?this.textbox.value=L: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 L=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=L;break}case"video":M=R(M);case"formula":{if(!M)break;var C=this.quill.getSelection(!0);if(C!=null){var K=C.index+C.length;this.quill.insertEmbed(K,this.root.getAttribute("data-mode"),M,t.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(K+1," ",t.default.sources.USER),this.quill.setSelection(K+2,t.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),j})(m.default);function R(q){var j=q.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||q.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return j?(j[1]||"https")+"://www.youtube.com/embed/"+j[2]+"?showinfo=0":(j=q.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(j[1]||"https")+"://player.vimeo.com/video/"+j[2]+"/":q}function A(q,j){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;j.forEach(function(M){var L=document.createElement("option");M===H?L.setAttribute("selected","selected"):L.setAttribute("value",M),q.appendChild(L)})}O.BaseTooltip=F,O.default=W}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function S(){this.head=this.tail=null,this.length=0}return S.prototype.append=function(){for(var k=[],p=0;p1&&this.append.apply(this,k.slice(1))},S.prototype.contains=function(k){for(var p,d=this.iterator();p=d();)if(p===k)return!0;return!1},S.prototype.insertBefore=function(k,p){k&&(k.next=p,p!=null?(k.prev=p.prev,p.prev!=null&&(p.prev.next=k),p.prev=k,p===this.head&&(this.head=k)):this.tail!=null?(this.tail.next=k,k.prev=this.tail,this.tail=k):(k.prev=null,this.head=this.tail=k),this.length+=1)},S.prototype.offset=function(k){for(var p=0,d=this.head;d!=null;){if(d===k)return p;p+=d.length(),d=d.next}return-1},S.prototype.remove=function(k){this.contains(k)&&(k.prev!=null&&(k.prev.next=k.next),k.next!=null&&(k.next.prev=k.prev),k===this.head&&(this.head=k.next),k===this.tail&&(this.tail=k.prev),this.length-=1)},S.prototype.iterator=function(k){return k===void 0&&(k=this.head),function(){var p=k;return k!=null&&(k=k.next),p}},S.prototype.find=function(k,p){p===void 0&&(p=!1);for(var d,s=this.iterator();d=s();){var i=d.length();if(kh?d(e,k-h,Math.min(p,h+c-k)):d(e,0,Math.min(c,k+p-h)),h+=c}},S.prototype.map=function(k){return this.reduce(function(p,d){return p.push(k(d)),p},[])},S.prototype.reduce=function(k,p){for(var d,s=this.iterator();d=s();)p=k(p,d);return p},S})();O.default=P}),(function(B,O,g){var P=this&&this.__extends||(function(){var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var h in e)e.hasOwnProperty(h)&&(t[h]=e[h])};return function(t,e){i(t,e);function h(){this.constructor=t}t.prototype=e===null?Object.create(e):(h.prototype=e.prototype,new h)}})();Object.defineProperty(O,"__esModule",{value:!0});var S=g(17),k=g(1),p={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},d=100,s=(function(i){P(t,i);function t(e){var h=i.call(this,e)||this;return h.scroll=h,h.observer=new MutationObserver(function(u){h.update(u)}),h.observer.observe(h.domNode,p),h.attach(),h}return t.prototype.detach=function(){i.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(e,h){this.update(),e===0&&h===this.length()?this.children.forEach(function(u){u.remove()}):i.prototype.deleteAt.call(this,e,h)},t.prototype.formatAt=function(e,h,u,c){this.update(),i.prototype.formatAt.call(this,e,h,u,c)},t.prototype.insertAt=function(e,h,u){this.update(),i.prototype.insertAt.call(this,e,h,u)},t.prototype.optimize=function(e,h){var u=this;e===void 0&&(e=[]),h===void 0&&(h={}),i.prototype.optimize.call(this,h);for(var c=[].slice.call(this.observer.takeRecords());c.length>0;)e.push(c.pop());for(var a=function(l,E){E===void 0&&(E=!0),!(l==null||l===u)&&l.domNode.parentNode!=null&&(l.domNode[k.DATA_KEY].mutations==null&&(l.domNode[k.DATA_KEY].mutations=[]),E&&a(l.parent))},o=function(l){l.domNode[k.DATA_KEY]==null||l.domNode[k.DATA_KEY].mutations==null||(l instanceof S.default&&l.children.forEach(o),l.optimize(h))},r=e,n=0;r.length>0;n+=1){if(n>=d)throw new Error("[Parchment] Maximum optimize iterations reached");for(r.forEach(function(l){var E=k.find(l.target,!0);E!=null&&(E.domNode===l.target&&(l.type==="childList"?(a(k.find(l.previousSibling,!1)),[].forEach.call(l.addedNodes,function(b){var m=k.find(b,!1);a(m,!1),m instanceof S.default&&m.children.forEach(function(T){a(T,!1)})})):l.type==="attributes"&&a(E.prev)),a(E))}),this.children.forEach(o),r=[].slice.call(this.observer.takeRecords()),c=r.slice();c.length>0;)e.push(c.pop())}},t.prototype.update=function(e,h){var u=this;h===void 0&&(h={}),e=e||this.observer.takeRecords(),e.map(function(c){var a=k.find(c.target,!0);return a==null?null:a.domNode[k.DATA_KEY].mutations==null?(a.domNode[k.DATA_KEY].mutations=[c],a):(a.domNode[k.DATA_KEY].mutations.push(c),null)}).forEach(function(c){c==null||c===u||c.domNode[k.DATA_KEY]==null||c.update(c.domNode[k.DATA_KEY].mutations||[],h)}),this.domNode[k.DATA_KEY].mutations!=null&&i.prototype.update.call(this,this.domNode[k.DATA_KEY].mutations,h),this.optimize(e,h)},t.blotName="scroll",t.defaultChild="block",t.scope=k.Scope.BLOCK_BLOT,t.tagName="DIV",t})(S.default);O.default=s}),(function(B,O,g){var P=this&&this.__extends||(function(){var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,t){i.__proto__=t}||function(i,t){for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e])};return function(i,t){s(i,t);function e(){this.constructor=i}i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})();Object.defineProperty(O,"__esModule",{value:!0});var S=g(18),k=g(1);function p(s,i){if(Object.keys(s).length!==Object.keys(i).length)return!1;for(var t in s)if(s[t]!==i[t])return!1;return!0}var d=(function(s){P(i,s);function i(){return s!==null&&s.apply(this,arguments)||this}return i.formats=function(t){if(t.tagName!==i.tagName)return s.formats.call(this,t)},i.prototype.format=function(t,e){var h=this;t===this.statics.blotName&&!e?(this.children.forEach(function(u){u instanceof S.default||(u=u.wrap(i.blotName,!0)),h.attributes.copy(u)}),this.unwrap()):s.prototype.format.call(this,t,e)},i.prototype.formatAt=function(t,e,h,u){if(this.formats()[h]!=null||k.query(h,k.Scope.ATTRIBUTE)){var c=this.isolate(t,e);c.format(h,u)}else s.prototype.formatAt.call(this,t,e,h,u)},i.prototype.optimize=function(t){s.prototype.optimize.call(this,t);var e=this.formats();if(Object.keys(e).length===0)return this.unwrap();var h=this.next;h instanceof i&&h.prev===this&&p(e,h.formats())&&(h.moveChildren(this),h.remove())},i.blotName="inline",i.scope=k.Scope.INLINE_BLOT,i.tagName="SPAN",i})(S.default);O.default=d}),(function(B,O,g){var P=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var t in i)i.hasOwnProperty(t)&&(s[t]=i[t])};return function(s,i){d(s,i);function t(){this.constructor=s}s.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}})();Object.defineProperty(O,"__esModule",{value:!0});var S=g(18),k=g(1),p=(function(d){P(s,d);function s(){return d!==null&&d.apply(this,arguments)||this}return s.formats=function(i){var t=k.query(s.blotName).tagName;if(i.tagName!==t)return d.formats.call(this,i)},s.prototype.format=function(i,t){k.query(i,k.Scope.BLOCK)!=null&&(i===this.statics.blotName&&!t?this.replaceWith(s.blotName):d.prototype.format.call(this,i,t))},s.prototype.formatAt=function(i,t,e,h){k.query(e,k.Scope.BLOCK)!=null?this.format(e,h):d.prototype.formatAt.call(this,i,t,e,h)},s.prototype.insertAt=function(i,t,e){if(e==null||k.query(t,k.Scope.INLINE)!=null)d.prototype.insertAt.call(this,i,t,e);else{var h=this.split(i),u=k.create(t,e);h.parent.insertBefore(u,h)}},s.prototype.update=function(i,t){navigator.userAgent.match(/Trident/)?this.build():d.prototype.update.call(this,i,t)},s.blotName="block",s.scope=k.Scope.BLOCK_BLOT,s.tagName="P",s})(S.default);O.default=p}),(function(B,O,g){var P=this&&this.__extends||(function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,s){d.__proto__=s}||function(d,s){for(var i in s)s.hasOwnProperty(i)&&(d[i]=s[i])};return function(d,s){p(d,s);function i(){this.constructor=d}d.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}})();Object.defineProperty(O,"__esModule",{value:!0});var S=g(19),k=(function(p){P(d,p);function d(){return p!==null&&p.apply(this,arguments)||this}return d.formats=function(s){},d.prototype.format=function(s,i){p.prototype.formatAt.call(this,0,this.length(),s,i)},d.prototype.formatAt=function(s,i,t,e){s===0&&i===this.length()?this.format(t,e):p.prototype.formatAt.call(this,s,i,t,e)},d.prototype.formats=function(){return this.statics.formats(this.domNode)},d})(S.default);O.default=k}),(function(B,O,g){var P=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var t in i)i.hasOwnProperty(t)&&(s[t]=i[t])};return function(s,i){d(s,i);function t(){this.constructor=s}s.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}})();Object.defineProperty(O,"__esModule",{value:!0});var S=g(19),k=g(1),p=(function(d){P(s,d);function s(i){var t=d.call(this,i)||this;return t.text=t.statics.value(t.domNode),t}return s.create=function(i){return document.createTextNode(i)},s.value=function(i){var t=i.data;return t.normalize&&(t=t.normalize()),t},s.prototype.deleteAt=function(i,t){this.domNode.data=this.text=this.text.slice(0,i)+this.text.slice(i+t)},s.prototype.index=function(i,t){return this.domNode===i?t:-1},s.prototype.insertAt=function(i,t,e){e==null?(this.text=this.text.slice(0,i)+t+this.text.slice(i),this.domNode.data=this.text):d.prototype.insertAt.call(this,i,t,e)},s.prototype.length=function(){return this.text.length},s.prototype.optimize=function(i){d.prototype.optimize.call(this,i),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof s&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},s.prototype.position=function(i,t){return[this.domNode,i]},s.prototype.split=function(i,t){if(t===void 0&&(t=!1),!t){if(i===0)return this;if(i===this.length())return this.next}var e=k.create(this.domNode.splitText(i));return this.parent.insertBefore(e,this.next),this.text=this.statics.value(this.domNode),e},s.prototype.update=function(i,t){var e=this;i.some(function(h){return h.type==="characterData"&&h.target===e.domNode})&&(this.text=this.statics.value(this.domNode))},s.prototype.value=function(){return this.text},s.blotName="text",s.scope=k.Scope.INLINE_BLOT,s})(S.default);O.default=p}),(function(B,O,g){var P=document.createElement("div");if(P.classList.toggle("test-class",!1),P.classList.contains("test-class")){var S=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(k,p){return arguments.length>1&&!this.contains(k)==!p?p:S.call(this,k)}}String.prototype.startsWith||(String.prototype.startsWith=function(k,p){return p=p||0,this.substr(p,k.length)===k}),String.prototype.endsWith||(String.prototype.endsWith=function(k,p){var d=this.toString();(typeof p!="number"||!isFinite(p)||Math.floor(p)!==p||p>d.length)&&(p=d.length),p-=k.length;var s=d.indexOf(k,p);return s!==-1&&s===p}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(p){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof p!="function")throw new TypeError("predicate must be a function");for(var d=Object(this),s=d.length>>>0,i=arguments[1],t,e=0;el.length?n:l,m=n.length>l.length?l:n,T=b.indexOf(m);if(T!=-1)return E=[[P,b.substring(0,T)],[S,m],[P,b.substring(T+m.length)]],n.length>l.length&&(E[0][0]=E[2][0]=g),E;if(m.length==1)return[[g,n],[P,l]];var y=e(n,l);if(y){var v=y[0],_=y[1],w=y[2],x=y[3],I=y[4],U=k(v,w),z=k(_,x);return U.concat([[S,I]],z)}return d(n,l)}function d(n,l){for(var E=n.length,b=l.length,m=Math.ceil((E+b)/2),T=m,y=2*m,v=new Array(y),_=new Array(y),w=0;wE)z+=2;else if(H>b)U+=2;else if(I){var M=T+x-A;if(M>=0&&M=L)return s(n,l,j,H)}}}for(var C=-R+W;C<=R-F;C+=2){var M=T+C,L;C==-R||C!=R&&_[M-1]<_[M+1]?L=_[M+1]:L=_[M-1]+1;for(var K=L-C;LE)F+=2;else if(K>b)W+=2;else if(!I){var q=T+x-C;if(q>=0&&q=L)return s(n,l,j,H)}}}}return[[g,n],[P,l]]}function s(n,l,E,b){var m=n.substring(0,E),T=l.substring(0,b),y=n.substring(E),v=l.substring(b),_=k(m,T),w=k(y,v);return _.concat(w)}function i(n,l){if(!n||!l||n.charAt(0)!=l.charAt(0))return 0;for(var E=0,b=Math.min(n.length,l.length),m=b,T=0;El.length?n:l,b=n.length>l.length?l:n;if(E.length<4||b.length*2=z.length?[j,H,M,L,q]:null}var T=m(E,b,Math.ceil(E.length/4)),y=m(E,b,Math.ceil(E.length/2)),v;if(!T&&!y)return null;y?T?v=T[4].length>y[4].length?T:y:v=y:v=T;var _,w,x,I;n.length>l.length?(_=v[0],w=v[1],x=v[2],I=v[3]):(x=v[0],I=v[1],_=v[2],w=v[3]);var U=v[4];return[_,w,x,I,U]}function h(n){n.push([S,""]);for(var l=0,E=0,b=0,m="",T="",y;l1?(E!==0&&b!==0&&(y=i(T,m),y!==0&&(l-E-b>0&&n[l-E-b-1][0]==S?n[l-E-b-1][1]+=T.substring(0,y):(n.splice(0,0,[S,T.substring(0,y)]),l++),T=T.substring(y),m=m.substring(y)),y=t(T,m),y!==0&&(n[l][1]=T.substring(T.length-y)+n[l][1],T=T.substring(0,T.length-y),m=m.substring(0,m.length-y))),E===0?n.splice(l-b,E+b,[P,T]):b===0?n.splice(l-E,E+b,[g,m]):n.splice(l-E-b,E+b,[g,m],[P,T]),l=l-E-b+(E?1:0)+(b?1:0)+1):l!==0&&n[l-1][0]==S?(n[l-1][1]+=n[l][1],n.splice(l,1)):l++,b=0,E=0,m="",T="";break}n[n.length-1][1]===""&&n.pop();var v=!1;for(l=1;l0&&b.splice(m+2,0,[y[0],v]),r(b,m,3)}else return n}function o(n){for(var l=!1,E=function(y){return y.charCodeAt(0)>=56320&&y.charCodeAt(0)<=57343},b=function(y){return y.charCodeAt(y.length-1)>=55296&&y.charCodeAt(y.length-1)<=56319},m=2;m0&&T.push(n[m]);return T}function r(n,l,E){for(var b=l+E-1;b>=0&&b>=l-1;b--)if(b+1\r?\n +\<"),this.convert();var Q=this.quill.getFormat(this.quill.selection.savedRange.index);if(Q[b.default.blotName]){var at=this.container.innerText;return this.container.innerHTML="",new i.default().insert(at,w({},b.default.blotName,Q[b.default.blotName]))}var rt=this.prepareMatching(),ot=S(rt,2),Tt=ot[0],Et=ot[1],pt=C(this.container,Tt,Et);return M(pt,` `)&&pt.ops[pt.ops.length-1].attributes==null&&(pt=pt.compose(new i.default().retain(pt.length()-1).delete(1))),z.log("convert",this.container.innerHTML,pt),this.container.innerHTML="",pt}},{key:"dangerouslyPasteHTML",value:function($,Q){var at=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u.default.sources.API;if(typeof $=="string")this.quill.setContents(this.convert($),Q),this.quill.setSelection(0,u.default.sources.SILENT);else{var rt=this.convert(Q);this.quill.updateContents(new i.default().retain($).concat(rt),at),this.quill.setSelection($+rt.length(),u.default.sources.SILENT)}}},{key:"onPaste",value:function($){var Q=this;if(!($.defaultPrevented||!this.quill.isEnabled())){var at=this.quill.getSelection(),rt=new i.default().retain(at.index),ot=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(u.default.sources.SILENT),setTimeout(function(){rt=rt.concat(Q.convert()).delete(at.length),Q.quill.updateContents(rt,u.default.sources.USER),Q.quill.setSelection(rt.length()-at.length,u.default.sources.SILENT),Q.quill.scrollingContainer.scrollTop=ot,Q.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var $=this,Q=[],at=[];return this.matchers.forEach(function(rt){var ot=S(rt,2),Tt=ot[0],Et=ot[1];switch(Tt){case Node.TEXT_NODE:at.push(Et);break;case Node.ELEMENT_NODE:Q.push(Et);break;default:[].forEach.call($.container.querySelectorAll(Tt),function(pt){pt[W]=pt[W]||[],pt[W].push(Et)});break}}),[Q,at]}}]),Y})(r.default);q.DEFAULTS={matchers:[],matchVisual:!0};function j(V,Y,J){return(typeof Y>"u"?"undefined":P(Y))==="object"?Object.keys(Y).reduce(function($,Q){return j($,Q,Y[Q])},V):V.reduce(function($,Q){return Q.attributes&&Q.attributes[Y]?$.push(Q):$.insert(Q.insert,(0,d.default)({},w({},Y,J),Q.attributes))},new i.default)}function H(V){if(V.nodeType!==Node.ELEMENT_NODE)return{};var Y="__ql-computed-style";return V[Y]||(V[Y]=window.getComputedStyle(V))}function M(V,Y){for(var J="",$=V.ops.length-1;$>=0&&J.length-1}function C(V,Y,J){return V.nodeType===V.TEXT_NODE?J.reduce(function($,Q){return Q(V,$)},new i.default):V.nodeType===V.ELEMENT_NODE?[].reduce.call(V.childNodes||[],function($,Q){var at=C(Q,Y,J);return Q.nodeType===V.ELEMENT_NODE&&(at=Y.reduce(function(rt,ot){return ot(Q,rt)},at),at=(Q[W]||[]).reduce(function(rt,ot){return ot(Q,rt)},at)),$.concat(at)},new i.default):new i.default}function K(V,Y,J){return j(J,V,!0)}function G(V,Y){var J=e.default.Attributor.Attribute.keys(V),$=e.default.Attributor.Class.keys(V),Q=e.default.Attributor.Style.keys(V),at={};return J.concat($).concat(Q).forEach(function(rt){var ot=e.default.query(rt,e.default.Scope.ATTRIBUTE);ot!=null&&(at[ot.attrName]=ot.value(V),at[ot.attrName])||(ot=R[rt],ot!=null&&(ot.attrName===rt||ot.keyName===rt)&&(at[ot.attrName]=ot.value(V)||void 0),ot=A[rt],ot!=null&&(ot.attrName===rt||ot.keyName===rt)&&(ot=A[rt],at[ot.attrName]=ot.value(V)||void 0))}),Object.keys(at).length>0&&(Y=j(Y,at)),Y}function X(V,Y){var J=e.default.query(V);if(J==null)return Y;if(J.prototype instanceof e.default.Embed){var $={},Q=J.value(V);Q!=null&&($[J.blotName]=Q,Y=new i.default().insert($,J.formats(V)))}else typeof J.formats=="function"&&(Y=j(Y,J.blotName,J.formats(V)));return Y}function tt(V,Y){return M(Y,` `)||Y.insert(` `),Y}function nt(){return new i.default}function it(V,Y){var J=e.default.query(V);if(J==null||J.blotName!=="list-item"||!M(Y,` `))return Y;for(var $=-1,Q=V.parentNode;!Q.classList.contains("ql-clipboard");)(e.default.query(Q)||{}).blotName==="list"&&($+=1),Q=Q.parentNode;return $<=0?Y:Y.compose(new i.default().retain(Y.length()-1).retain(1,{indent:$}))}function ut(V,Y){return M(Y,` `)||(L(V)||Y.length()>0&&V.nextSibling&&L(V.nextSibling))&&Y.insert(` `),Y}function ct(V,Y){if(L(V)&&V.nextElementSibling!=null&&!M(Y,` `)){var J=V.offsetHeight+parseFloat(H(V).marginTop)+parseFloat(H(V).marginBottom);V.nextElementSibling.offsetTop>V.offsetTop+J*1.5&&Y.insert(` `)}return Y}function mt(V,Y){var J={},$=V.style||{};return $.fontStyle&&H(V).fontStyle==="italic"&&(J.italic=!0),$.fontWeight&&(H(V).fontWeight.startsWith("bold")||parseInt(H(V).fontWeight)>=700)&&(J.bold=!0),Object.keys(J).length>0&&(Y=j(Y,J)),parseFloat($.textIndent||0)>0&&(Y=new i.default().insert(" ").concat(Y)),Y}function gt(V,Y){var J=V.data;if(V.parentNode.tagName==="O:P")return Y.insert(J.trim());if(J.trim().length===0&&V.parentNode.classList.contains("ql-clipboard"))return Y;if(!H(V.parentNode).whiteSpace.startsWith("pre")){var $=function(at,rt){return rt=rt.replace(/[^\u00a0]/g,""),rt.length<1&&at?" ":rt};J=J.replace(/\r\n/g," ").replace(/\n/g," "),J=J.replace(/\s\s+/g,$.bind($,!0)),(V.previousSibling==null&&L(V.parentNode)||V.previousSibling!=null&&L(V.previousSibling))&&(J=J.replace(/^\s+/,$.bind($,!1))),(V.nextSibling==null&&L(V.parentNode)||V.nextSibling!=null&&L(V.nextSibling))&&(J=J.replace(/\s+$/,$.bind($,!1)))}return Y.insert(J)}O.default=q,O.matchAttributor=G,O.matchBlot=X,O.matchNewline=ut,O.matchSpacing=ct,O.matchText=gt}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function h(u,c){for(var a=0;a '}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function h(u,c){for(var a=0;ae.right&&(u=e.right-h.right,this.root.style.left=i+u+"px"),h.lefte.bottom){var c=h.bottom-h.top,a=s.bottom-s.top+c;this.root.style.top=t-a+"px",this.root.classList.add("ql-flip")}return u}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),p})();O.default=k}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function y(v,_){var w=[],x=!0,I=!1,U=void 0;try{for(var z=v[Symbol.iterator](),W;!(x=(W=z.next()).done)&&(w.push(W.value),!(_&&w.length===_));x=!0);}catch(F){I=!0,U=F}finally{try{!x&&z.return&&z.return()}finally{if(I)throw U}}return w}return function(v,_){if(Array.isArray(v))return v;if(Symbol.iterator in Object(v))return y(v,_);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),S=function y(v,_,w){v===null&&(v=Function.prototype);var x=Object.getOwnPropertyDescriptor(v,_);if(x===void 0){var I=Object.getPrototypeOf(v);return I===null?void 0:y(I,_,w)}else{if("value"in x)return x.value;var U=x.get;return U===void 0?void 0:U.call(w)}},k=(function(){function y(v,_){for(var w=0;w<_.length;w++){var x=_[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,x.key,x)}}return function(v,_,w){return _&&y(v.prototype,_),w&&y(v,w),v}})(),p=g(3),d=r(p),s=g(8),i=r(s),t=g(43),e=r(t),h=g(27),u=r(h),c=g(15),a=g(41),o=r(a);function r(y){return y&&y.__esModule?y:{default:y}}function n(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function l(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function E(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var b=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],m=(function(y){E(v,y);function v(_,w){n(this,v),w.modules.toolbar!=null&&w.modules.toolbar.container==null&&(w.modules.toolbar.container=b);var x=l(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,_,w));return x.quill.container.classList.add("ql-snow"),x}return k(v,[{key:"extendToolbar",value:function(w){w.container.classList.add("ql-snow"),this.buildButtons([].slice.call(w.container.querySelectorAll("button")),o.default),this.buildPickers([].slice.call(w.container.querySelectorAll("select")),o.default),this.tooltip=new T(this.quill,this.options.bounds),w.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(x,I){w.handlers.link.call(w,!I.format.link)})}}]),v})(e.default);m.DEFAULTS=(0,d.default)(!0,{},e.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(v){if(v){var _=this.quill.getSelection();if(_==null||_.length==0)return;var w=this.quill.getText(_);/^\S+@\S+\.\S+$/.test(w)&&w.indexOf("mailto:")!==0&&(w="mailto:"+w);var x=this.quill.theme.tooltip;x.edit("link",w)}else this.quill.format("link",!1)}}}}});var T=(function(y){E(v,y);function v(_,w){n(this,v);var x=l(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,_,w));return x.preview=x.root.querySelector("a.ql-preview"),x}return k(v,[{key:"listen",value:function(){var w=this;S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(x){w.root.classList.contains("ql-editing")?w.save():w.edit("link",w.preview.textContent),x.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(x){if(w.linkRange!=null){var I=w.linkRange;w.restoreFocus(),w.quill.formatText(I,"link",!1,i.default.sources.USER),delete w.linkRange}x.preventDefault(),w.hide()}),this.quill.on(i.default.events.SELECTION_CHANGE,function(x,I,U){if(x!=null){if(x.length===0&&U===i.default.sources.USER){var z=w.quill.scroll.descendant(u.default,x.index),W=P(z,2),F=W[0],R=W[1];if(F!=null){w.linkRange=new c.Range(x.index-R,F.length());var A=u.default.formats(F.domNode);w.preview.textContent=A,w.preview.setAttribute("href",A),w.show(),w.position(w.quill.getBounds(w.linkRange));return}}else delete w.linkRange;w.hide()}})}},{key:"show",value:function(){S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),v})(t.BaseTooltip);T.TEMPLATE=['','','',''].join(""),O.default=m}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=g(29),S=Q(P),k=g(36),p=g(38),d=g(64),s=g(65),i=Q(s),t=g(66),e=Q(t),h=g(67),u=Q(h),c=g(37),a=g(26),o=g(39),r=g(40),n=g(56),l=Q(n),E=g(68),b=Q(E),m=g(27),T=Q(m),y=g(69),v=Q(y),_=g(70),w=Q(_),x=g(71),I=Q(x),U=g(72),z=Q(U),W=g(73),F=Q(W),R=g(13),A=Q(R),q=g(74),j=Q(q),H=g(75),M=Q(H),L=g(57),C=Q(L),K=g(41),G=Q(K),X=g(28),tt=Q(X),nt=g(59),it=Q(nt),ut=g(60),ct=Q(ut),mt=g(61),gt=Q(mt),V=g(108),Y=Q(V),J=g(62),$=Q(J);function Q(at){return at&&at.__esModule?at:{default:at}}S.default.register({"attributors/attribute/direction":p.DirectionAttribute,"attributors/class/align":k.AlignClass,"attributors/class/background":c.BackgroundClass,"attributors/class/color":a.ColorClass,"attributors/class/direction":p.DirectionClass,"attributors/class/font":o.FontClass,"attributors/class/size":r.SizeClass,"attributors/style/align":k.AlignStyle,"attributors/style/background":c.BackgroundStyle,"attributors/style/color":a.ColorStyle,"attributors/style/direction":p.DirectionStyle,"attributors/style/font":o.FontStyle,"attributors/style/size":r.SizeStyle},!0),S.default.register({"formats/align":k.AlignClass,"formats/direction":p.DirectionClass,"formats/indent":d.IndentClass,"formats/background":c.BackgroundStyle,"formats/color":a.ColorStyle,"formats/font":o.FontClass,"formats/size":r.SizeClass,"formats/blockquote":i.default,"formats/code-block":A.default,"formats/header":e.default,"formats/list":u.default,"formats/bold":l.default,"formats/code":R.Code,"formats/italic":b.default,"formats/link":T.default,"formats/script":v.default,"formats/strike":w.default,"formats/underline":I.default,"formats/image":z.default,"formats/video":F.default,"formats/list/item":h.ListItem,"modules/formula":j.default,"modules/syntax":M.default,"modules/toolbar":C.default,"themes/bubble":Y.default,"themes/snow":$.default,"ui/icons":G.default,"ui/picker":tt.default,"ui/icon-picker":ct.default,"ui/color-picker":it.default,"ui/tooltip":gt.default},!0),O.default=S.default}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0}),O.IndentClass=void 0;var P=(function(){function u(c,a){for(var o=0;o0&&this.children.tail.format(b,m)}},{key:"formats",value:function(){return h({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(b,m){if(b instanceof o)S(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"insertBefore",this).call(this,b,m);else{var T=m==null?this.length():m.offset(this),y=this.split(T);y.parent.insertBefore(b,y)}}},{key:"optimize",value:function(b){S(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"optimize",this).call(this,b);var m=this.next;m!=null&&m.prev===this&&m.statics.blotName===this.statics.blotName&&m.domNode.tagName===this.domNode.tagName&&m.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(m.moveChildren(this),m.remove())}},{key:"replace",value:function(b){if(b.statics.blotName!==this.statics.blotName){var m=p.default.create(this.statics.defaultChild);b.moveChildren(m),this.appendChild(m)}S(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"replace",this).call(this,b)}}]),l})(t.default);r.blotName="list",r.scope=p.default.Scope.BLOCK_BLOT,r.tagName=["OL","UL"],r.defaultChild="list-item",r.allowedChildren=[o],O.ListItem=o,O.default=r}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=g(56),S=k(P);function k(t){return t&&t.__esModule?t:{default:t}}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function s(t,e){if(typeof e!="function"&&e!==null)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)}var i=(function(t){s(e,t);function e(){return p(this,e),d(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return e})(S.default);i.blotName="italic",i.tagName=["EM","I"],O.default=i}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function h(u,c){for(var a=0;a-1?n?this.domNode.setAttribute(r,n):this.domNode.removeAttribute(r):S(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"format",this).call(this,r,n)}}],[{key:"create",value:function(r){var n=S(a.__proto__||Object.getPrototypeOf(a),"create",this).call(this,r);return typeof r=="string"&&n.setAttribute("src",this.sanitize(r)),n}},{key:"formats",value:function(r){return h.reduce(function(n,l){return r.hasAttribute(l)&&(n[l]=r.getAttribute(l)),n},{})}},{key:"match",value:function(r){return/\.(jpe?g|gif|png)$/.test(r)||/^data:image\/.+;base64/.test(r)}},{key:"sanitize",value:function(r){return(0,d.sanitize)(r,["http","https","data"])?r:"//:0"}},{key:"value",value:function(r){return r.getAttribute("src")}}]),a})(p.default.Embed);u.blotName="image",u.tagName="IMG",O.default=u}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0});var P=(function(){function c(a,o){for(var r=0;r-1?n?this.domNode.setAttribute(r,n):this.domNode.removeAttribute(r):S(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"format",this).call(this,r,n)}}],[{key:"create",value:function(r){var n=S(a.__proto__||Object.getPrototypeOf(a),"create",this).call(this,r);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(r)),n}},{key:"formats",value:function(r){return h.reduce(function(n,l){return r.hasAttribute(l)&&(n[l]=r.getAttribute(l)),n},{})}},{key:"sanitize",value:function(r){return d.default.sanitize(r)}},{key:"value",value:function(r){return r.getAttribute("src")}}]),a})(k.BlockEmbed);u.blotName="video",u.className="ql-video",u.tagName="IFRAME",O.default=u}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0}),O.default=O.FormulaBlot=void 0;var P=(function(){function r(n,l){for(var E=0;E0||this.cachedText==null)&&(this.domNode.innerHTML=T(y),this.domNode.normalize(),this.attach()),this.cachedText=y)}}]),b})(h.default);r.className="ql-syntax";var n=new p.default.Attributor.Class("token","hljs",{scope:p.default.Scope.INLINE}),l=(function(E){o(b,E),P(b,null,[{key:"register",value:function(){s.default.register(n,!0),s.default.register(r,!0)}}]);function b(m,T){c(this,b);var y=a(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,m,T));if(typeof y.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var v=null;return y.quill.on(s.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(v),v=setTimeout(function(){y.highlight(),v=null},y.options.interval)}),y.highlight(),y}return P(b,[{key:"highlight",value:function(){var T=this;if(!this.quill.selection.composing){this.quill.update(s.default.sources.USER);var y=this.quill.getSelection();this.quill.scroll.descendants(r).forEach(function(v){v.highlight(T.options.highlight)}),this.quill.update(s.default.sources.SILENT),y!=null&&this.quill.setSelection(y,s.default.sources.SILENT)}}}]),b})(t.default);l.DEFAULTS={highlight:(function(){return window.hljs==null?null:function(E){var b=window.hljs.highlightAuto(E);return b.value}})(),interval:1e3},O.CodeBlock=r,O.CodeToken=n,O.default=l}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O){B.exports=' '}),(function(B,O,g){Object.defineProperty(O,"__esModule",{value:!0}),O.default=O.BubbleTooltip=void 0;var P=function b(m,T,y){m===null&&(m=Function.prototype);var v=Object.getOwnPropertyDescriptor(m,T);if(v===void 0){var _=Object.getPrototypeOf(m);return _===null?void 0:b(_,T,y)}else{if("value"in v)return v.value;var w=v.get;return w===void 0?void 0:w.call(y)}},S=(function(){function b(m,T){for(var y=0;y0&&I===s.default.sources.USER){v.show(),v.root.style.left="0px",v.root.style.width="",v.root.style.width=v.root.offsetWidth+"px";var U=v.quill.getLines(w.index,w.length);if(U.length===1)v.position(v.quill.getBounds(w));else{var z=U[U.length-1],W=v.quill.getIndex(z),F=Math.min(z.length()-1,w.index+w.length-W),R=v.quill.getBounds(new e.Range(W,F));v.position(R)}}else document.activeElement!==v.textbox&&v.quill.hasFocus()&&v.hide()}),v}return S(m,[{key:"listen",value:function(){var y=this;P(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){y.root.classList.remove("ql-editing")}),this.quill.on(s.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!y.root.classList.contains("ql-hidden")){var v=y.quill.getSelection();v!=null&&y.position(y.quill.getBounds(v))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(y){var v=P(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"position",this).call(this,y),_=this.root.querySelector(".ql-tooltip-arrow");if(_.style.marginLeft="",v===0)return v;_.style.marginLeft=-1*v-_.offsetWidth/2+"px"}}]),m})(i.BaseTooltip);E.TEMPLATE=['','
','','',"
"].join(""),O.BubbleTooltip=E,O.default=l}),(function(B,O,g){B.exports=g(63)})]).default})})(Ve)),Ve.exports}kr();var In,zn;function Nr(){if(zn)return In;zn=1;var st=-1,ft=1,B=0;function O(r,n,l,E){if(r===n)return r?[[B,r]]:[];if(l!=null){var b=a(r,n,l);if(b)return b}var m=k(r,n),T=r.substring(0,m);r=r.substring(m),n=n.substring(m),m=p(r,n);var y=r.substring(r.length-m);r=r.substring(0,r.length-m),n=n.substring(0,n.length-m);var v=g(r,n);return T&&v.unshift([B,T]),y&&v.push([B,y]),s(v,E),v}function g(r,n){var l;if(!r)return[[ft,n]];if(!n)return[[st,r]];var E=r.length>n.length?r:n,b=r.length>n.length?n:r,m=E.indexOf(b);if(m!==-1)return l=[[ft,E.substring(0,m)],[B,b],[ft,E.substring(m+b.length)]],r.length>n.length&&(l[0][0]=l[2][0]=st),l;if(b.length===1)return[[st,r],[ft,n]];var T=d(r,n);if(T){var y=T[0],v=T[1],_=T[2],w=T[3],x=T[4],I=O(y,_),U=O(v,w);return I.concat([[B,x]],U)}return P(r,n)}function P(r,n){for(var l=r.length,E=n.length,b=Math.ceil((l+E)/2),m=b,T=2*b,y=new Array(T),v=new Array(T),_=0;_l)U+=2;else if(j>E)I+=2;else if(x){var H=m+w-R;if(H>=0&&H=M)return S(r,n,q,j)}}}for(var L=-F+z;L<=F-W;L+=2){var H=m+L,M;L===-F||L!==F&&v[H-1]l)W+=2;else if(C>E)z+=2;else if(!x){var A=m+w-L;if(A>=0&&A=M)return S(r,n,q,j)}}}}return[[st,r],[ft,n]]}function S(r,n,l,E){var b=r.substring(0,l),m=n.substring(0,E),T=r.substring(l),y=n.substring(E),v=O(b,m),_=O(T,y);return v.concat(_)}function k(r,n){if(!r||!n||r.charAt(0)!==n.charAt(0))return 0;for(var l=0,E=Math.min(r.length,n.length),b=E,m=0;ln.length?r:n,E=r.length>n.length?n:r;if(l.length<4||E.length*2=U.length?[q,j,H,M,A]:null}var m=b(l,E,Math.ceil(l.length/4)),T=b(l,E,Math.ceil(l.length/2)),y;if(!m&&!T)return null;T?m?y=m[4].length>T[4].length?m:T:y=T:y=m;var v,_,w,x;r.length>n.length?(v=y[0],_=y[1],w=y[2],x=y[3]):(w=y[0],x=y[1],v=y[2],_=y[3]);var I=y[4];return[v,_,w,x,I]}function s(r,n){r.push([B,""]);for(var l=0,E=0,b=0,m="",T="",y;l=0&&h(r[v][1])){var _=r[v][1].slice(-1);if(r[v][1]=r[v][1].slice(0,-1),m=_+m,T=_+T,!r[v][1]){r.splice(v,1),l--;var w=v-1;r[w]&&r[w][0]===ft&&(b++,T=r[w][1]+T,w--),r[w]&&r[w][0]===st&&(E++,m=r[w][1]+m,w--),v=w}}if(e(r[l][1])){var _=r[l][1].charAt(0);r[l][1]=r[l][1].slice(1),m+=_,T+=_}}if(l0||T.length>0){m.length>0&&T.length>0&&(y=k(T,m),y!==0&&(v>=0?r[v][1]+=T.substring(0,y):(r.splice(0,0,[B,T.substring(0,y)]),l++),T=T.substring(y),m=m.substring(y)),y=p(T,m),y!==0&&(r[l][1]=T.substring(T.length-y)+r[l][1],T=T.substring(0,T.length-y),m=m.substring(0,m.length-y)));var x=b+E;m.length===0&&T.length===0?(r.splice(l-x,x),l=l-x):m.length===0?(r.splice(l-x,x,[ft,T]),l=l-x+1):T.length===0?(r.splice(l-x,x,[st,m]),l=l-x+1):(r.splice(l-x,x,[st,m],[ft,T]),l=l-x+2)}l!==0&&r[l-1][0]===B?(r[l-1][1]+=r[l][1],r.splice(l,1)):l++,b=0,E=0,m="",T="";break}}r[r.length-1][1]===""&&r.pop();var I=!1;for(l=1;l=55296&&r<=56319}function t(r){return r>=56320&&r<=57343}function e(r){return t(r.charCodeAt(0))}function h(r){return i(r.charCodeAt(r.length-1))}function u(r){for(var n=[],l=0;l0&&n.push(r[l]);return n}function c(r,n,l,E){return h(r)||e(E)?null:u([[B,r],[st,n],[ft,l],[B,E]])}function a(r,n,l){var E=typeof l=="number"?{index:l,length:0}:l.oldRange,b=typeof l=="number"?null:l.newRange,m=r.length,T=n.length;if(E.length===0&&(b===null||b.length===0)){var y=E.index,v=r.slice(0,y),_=r.slice(y),w=b?b.index:null;t:{var x=y+T-m;if(w!==null&&w!==x||x<0||x>T)break t;var I=n.slice(0,x),U=n.slice(x);if(U!==_)break t;var z=Math.min(y,x),W=v.slice(0,z),F=I.slice(0,z);if(W!==F)break t;var R=v.slice(z),A=I.slice(z);return c(W,R,A,_)}t:{if(w!==null&&w!==y)break t;var q=y,I=n.slice(0,q),U=n.slice(q);if(I!==v)break t;var j=Math.min(m-q,T-q),H=_.slice(_.length-j),M=U.slice(U.length-j);if(H!==M)break t;var R=_.slice(0,_.length-j),A=U.slice(0,U.length-j);return c(v,R,A,H)}}if(E.length>0&&b&&b.length===0)t:{var W=r.slice(0,E.index),H=r.slice(E.index+E.length),z=W.length,j=H.length;if(T-1}function en(f,N){var D=this.__data__,Z=ae(D,f);return Z<0?D.push([f,N]):D[Z][1]=N,this}At.prototype.clear=Qe,At.prototype.delete=Je,At.prototype.get=$e,At.prototype.has=tn,At.prototype.set=en;function kt(f){var N=-1,D=f?f.length:0;for(this.clear();++N-1&&f%1==0&&f-1&&f%1==0&&f<=g}function Ct(f){var N=typeof f;return!!f&&(N=="object"||N=="function")}function ze(f){return!!f&&typeof f=="object"}function Te(f){return se(f)?oe(f):gn(f)}function Pn(){return[]}function Ln(){return!1}st.exports=Ce})(Se,Se.exports)),Se.exports}var xe={exports:{}};xe.exports;var Gn;function tr(){return Gn||(Gn=1,(function(st,ft){var B=200,O="__lodash_hash_undefined__",g=1,P=2,S=9007199254740991,k="[object Arguments]",p="[object Array]",d="[object AsyncFunction]",s="[object Boolean]",i="[object Date]",t="[object Error]",e="[object Function]",h="[object GeneratorFunction]",u="[object Map]",c="[object Number]",a="[object Null]",o="[object Object]",r="[object Promise]",n="[object Proxy]",l="[object RegExp]",E="[object Set]",b="[object String]",m="[object Symbol]",T="[object Undefined]",y="[object WeakMap]",v="[object ArrayBuffer]",_="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",I="[object Int8Array]",U="[object Int16Array]",z="[object Int32Array]",W="[object Uint8Array]",F="[object Uint8ClampedArray]",R="[object Uint16Array]",A="[object Uint32Array]",q=/[\\^$.*+?()[\]{}|]/g,j=/^\[object .+?Constructor\]$/,H=/^(?:0|[1-9]\d*)$/,M={};M[w]=M[x]=M[I]=M[U]=M[z]=M[W]=M[F]=M[R]=M[A]=!0,M[k]=M[p]=M[v]=M[s]=M[_]=M[i]=M[t]=M[e]=M[u]=M[c]=M[o]=M[l]=M[E]=M[b]=M[y]=!1;var L=typeof Wt=="object"&&Wt&&Wt.Object===Object&&Wt,C=typeof self=="object"&&self&&self.Object===Object&&self,K=L||C||Function("return this")(),G=ft&&!ft.nodeType&&ft,X=G&&!0&&st&&!st.nodeType&&st,tt=X&&X.exports===G,nt=tt&&L.process,it=(function(){try{return nt&&nt.binding&&nt.binding("util")}catch{}})(),ut=it&&it.isTypedArray;function ct(f,N){for(var D=-1,Z=f==null?0:f.length,lt=0,et=[];++D-1}function ln(f,N){var D=this.__data__,Z=le(D,f);return Z<0?(++this.size,D.push([f,N])):D[Z][1]=N,this}kt.prototype.clear=nn,kt.prototype.delete=rn,kt.prototype.get=on,kt.prototype.has=an,kt.prototype.set=ln;function Lt(f){var N=-1,D=f==null?0:f.length;for(this.clear();++Ndt))return!1;var yt=et.get(f);if(yt&&et.get(N))return yt==N;var Nt=-1,Rt=!0,_t=D&P?new oe:void 0;for(et.set(f,N),et.set(N,f);++Nt-1&&f%1==0&&f-1&&f%1==0&&f<=S}function He(f){var N=typeof f;return f!=null&&(N=="object"||N=="function")}function Ct(f){return f!=null&&typeof f=="object"}var ze=ut?Y(ut):_n;function Te(f){return Ae(f)?gn(f):On(f)}function Pn(){return[]}function Ln(){return!1}st.exports=xn})(xe,xe.exports)),xe.exports}var fe={},Vn;function Sr(){if(Vn)return fe;Vn=1;var st=fe&&fe.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(fe,"__esModule",{value:!0});var ft=st($n()),B=st(tr()),O;return(function(g){function P(d,s,i){d===void 0&&(d={}),s===void 0&&(s={}),typeof d!="object"&&(d={}),typeof s!="object"&&(s={});var t=ft.default(s);i||(t=Object.keys(t).reduce(function(h,u){return t[u]!=null&&(h[u]=t[u]),h},{}));for(var e in d)d[e]!==void 0&&s[e]===void 0&&(t[e]=d[e]);return Object.keys(t).length>0?t:void 0}g.compose=P;function S(d,s){d===void 0&&(d={}),s===void 0&&(s={}),typeof d!="object"&&(d={}),typeof s!="object"&&(s={});var i=Object.keys(d).concat(Object.keys(s)).reduce(function(t,e){return B.default(d[e],s[e])||(t[e]=s[e]===void 0?null:s[e]),t},{});return Object.keys(i).length>0?i:void 0}g.diff=S;function k(d,s){d===void 0&&(d={}),s===void 0&&(s={}),d=d||{};var i=Object.keys(s).reduce(function(t,e){return s[e]!==d[e]&&d[e]!==void 0&&(t[e]=s[e]),t},{});return Object.keys(d).reduce(function(t,e){return d[e]!==s[e]&&s[e]===void 0&&(t[e]=null),t},i)}g.invert=k;function p(d,s,i){if(i===void 0&&(i=!1),typeof d!="object")return s;if(typeof s=="object"){if(!i)return s;var t=Object.keys(s).reduce(function(e,h){return d[h]===void 0&&(e[h]=s[h]),e},{});return Object.keys(t).length>0?t:void 0}}g.transform=p})(O||(O={})),fe.default=O,fe}var ce={},he={},Zn;function xr(){if(Zn)return he;Zn=1;var st=he&&he.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(he,"__esModule",{value:!0});var ft=st(er()),B=(function(){function O(g){this.ops=g,this.index=0,this.offset=0}return O.prototype.hasNext=function(){return this.peekLength()<1/0},O.prototype.next=function(g){g||(g=1/0);var P=this.ops[this.index];if(P){var S=this.offset,k=ft.default.length(P);if(g>=k-S?(g=k-S,this.index+=1,this.offset=0):this.offset+=g,typeof P.delete=="number")return{delete:g};var p={};return P.attributes&&(p.attributes=P.attributes),typeof P.retain=="number"?p.retain=g:typeof P.insert=="string"?p.insert=P.insert.substr(S,g):p.insert=P.insert,p}else return{retain:1/0}},O.prototype.peek=function(){return this.ops[this.index]},O.prototype.peekLength=function(){return this.ops[this.index]?ft.default.length(this.ops[this.index])-this.offset:1/0},O.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},O.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var g=this.offset,P=this.index,S=this.next(),k=this.ops.slice(this.index);return this.offset=g,this.index=P,[S].concat(k)}else return[]},O})();return he.default=B,he}var Wn;function er(){if(Wn)return ce;Wn=1;var st=ce&&ce.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(ce,"__esModule",{value:!0});var ft=st(xr()),B;return(function(O){function g(S){return new ft.default(S)}O.iterator=g;function P(S){return typeof S.delete=="number"?S.delete:typeof S.retain=="number"?S.retain:typeof S.insert=="string"?S.insert.length:1}O.length=P})(B||(B={})),ce.default=B,ce}var ke,Yn;function Pr(){if(Yn)return ke;Yn=1;var st=ke&&ke.__importDefault||function(p){return p&&p.__esModule?p:{default:p}},ft=st(Nr()),B=st($n()),O=st(tr()),g=st(Sr()),P=st(er()),S="\0",k=(function(){function p(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]}return p.prototype.insert=function(d,s){var i={};return typeof d=="string"&&d.length===0?this:(i.insert=d,s!=null&&typeof s=="object"&&Object.keys(s).length>0&&(i.attributes=s),this.push(i))},p.prototype.delete=function(d){return d<=0?this:this.push({delete:d})},p.prototype.retain=function(d,s){if(d<=0)return this;var i={retain:d};return s!=null&&typeof s=="object"&&Object.keys(s).length>0&&(i.attributes=s),this.push(i)},p.prototype.push=function(d){var s=this.ops.length,i=this.ops[s-1];if(d=B.default(d),typeof i=="object"){if(typeof d.delete=="number"&&typeof i.delete=="number")return this.ops[s-1]={delete:i.delete+d.delete},this;if(typeof i.delete=="number"&&d.insert!=null&&(s-=1,i=this.ops[s-1],typeof i!="object"))return this.ops.unshift(d),this;if(O.default(d.attributes,i.attributes)){if(typeof d.insert=="string"&&typeof i.insert=="string")return this.ops[s-1]={insert:i.insert+d.insert},typeof d.attributes=="object"&&(this.ops[s-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof i.retain=="number")return this.ops[s-1]={retain:i.retain+d.retain},typeof d.attributes=="object"&&(this.ops[s-1].attributes=d.attributes),this}}return s===this.ops.length?this.ops.push(d):this.ops.splice(s,0,d),this},p.prototype.chop=function(){var d=this.ops[this.ops.length-1];return d&&d.retain&&!d.attributes&&this.ops.pop(),this},p.prototype.filter=function(d){return this.ops.filter(d)},p.prototype.forEach=function(d){this.ops.forEach(d)},p.prototype.map=function(d){return this.ops.map(d)},p.prototype.partition=function(d){var s=[],i=[];return this.forEach(function(t){var e=d(t)?s:i;e.push(t)}),[s,i]},p.prototype.reduce=function(d,s){return this.ops.reduce(d,s)},p.prototype.changeLength=function(){return this.reduce(function(d,s){return s.insert?d+P.default.length(s):s.delete?d-s.delete:d},0)},p.prototype.length=function(){return this.reduce(function(d,s){return d+P.default.length(s)},0)},p.prototype.slice=function(d,s){d===void 0&&(d=0),s===void 0&&(s=1/0);for(var i=[],t=P.default.iterator(this.ops),e=0;e0&&i.next(e.retain-h)}for(var u=new p(t);s.hasNext()||i.hasNext();)if(i.peekType()==="insert")u.push(i.next());else if(s.peekType()==="delete")u.push(s.next());else{var c=Math.min(s.peekLength(),i.peekLength()),a=s.next(c),o=i.next(c);if(typeof o.retain=="number"){var r={};typeof a.retain=="number"?r.retain=c:r.insert=a.insert;var n=g.default.compose(a.attributes,o.attributes,typeof a.retain=="number");if(n&&(r.attributes=n),u.push(r),!i.hasNext()&&O.default(u.ops[u.ops.length-1],r)){var l=new p(s.rest());return u.concat(l).chop()}}else typeof o.delete=="number"&&typeof a.retain=="number"&&u.push(o)}return u.chop()},p.prototype.concat=function(d){var s=new p(this.ops.slice());return d.ops.length>0&&(s.push(d.ops[0]),s.ops=s.ops.concat(d.ops.slice(1))),s},p.prototype.diff=function(d,s){if(this.ops===d.ops)return new p;var i=[this,d].map(function(c){return c.map(function(a){if(a.insert!=null)return typeof a.insert=="string"?a.insert:S;var o=c===d?"on":"with";throw new Error("diff() called "+o+" non-document")}).join("")}),t=new p,e=ft.default(i[0],i[1],s),h=P.default.iterator(this.ops),u=P.default.iterator(d.ops);return e.forEach(function(c){for(var a=c[1].length;a>0;){var o=0;switch(c[0]){case ft.default.INSERT:o=Math.min(u.peekLength(),a),t.push(u.next(o));break;case ft.default.DELETE:o=Math.min(a,h.peekLength()),h.next(o),t.delete(o);break;case ft.default.EQUAL:o=Math.min(h.peekLength(),u.peekLength(),a);var r=h.next(o),n=u.next(o);O.default(r.insert,n.insert)?t.retain(o,g.default.diff(r.attributes,n.attributes)):t.push(n).delete(o);break}a-=o}}),t.chop()},p.prototype.eachLine=function(d,s){s===void 0&&(s=` `);for(var i=P.default.iterator(this.ops),t=new p,e=0;i.hasNext();){if(i.peekType()!=="insert")return;var h=i.peek(),u=P.default.length(h)-i.peekLength(),c=typeof h.insert=="string"?h.insert.indexOf(s,u)-u:-1;if(c<0)t.push(i.next());else if(c>0)t.push(i.next(c));else{if(d(t,i.next(1).attributes||{},e)===!1)return;e+=1,t=new p}}t.length()>0&&d(t,{},e)},p.prototype.invert=function(d){var s=new p;return this.reduce(function(i,t){if(t.insert)s.delete(P.default.length(t));else{if(t.retain&&t.attributes==null)return s.retain(t.retain),i+t.retain;if(t.delete||t.retain&&t.attributes){var e=t.delete||t.retain,h=d.slice(i,i+e);return h.forEach(function(u){t.delete?s.push(u):t.retain&&t.attributes&&s.retain(P.default.length(u),g.default.invert(t.attributes,u.attributes))}),i+e}}return i},0),s.chop()},p.prototype.transform=function(d,s){if(s===void 0&&(s=!1),s=!!s,typeof d=="number")return this.transformPosition(d,s);for(var i=d,t=P.default.iterator(this.ops),e=P.default.iterator(i.ops),h=new p;t.hasNext()||e.hasNext();)if(t.peekType()==="insert"&&(s||e.peekType()!=="insert"))h.retain(P.default.length(t.next()));else if(e.peekType()==="insert")h.push(e.next());else{var u=Math.min(t.peekLength(),e.peekLength()),c=t.next(u),a=e.next(u);if(c.delete)continue;a.delete?h.push(a):h.retain(u,g.default.transform(c.attributes,a.attributes,s))}return h.chop()},p.prototype.transformPosition=function(d,s){s===void 0&&(s=!1),s=!!s;for(var i=P.default.iterator(this.ops),t=0;i.hasNext()&&t<=d;){var e=i.peekLength(),h=i.peekType();if(i.next(),h==="delete"){d-=Math.min(e,d-t);continue}else h==="insert"&&(t{O.value=[],Object.assign(B,{title:"",image:null,active:!0})},s=()=>{console.log(k.data),Object.assign(B,k.data),B.image?.length&&(O.value=[],O.value.push({src:P.useDataStorage(B.image),thumbUrl:P.useDataStorage(B.image)}))},i=async()=>{g.value.validateFields().then(async()=>{try{if(console.log("brandImage.value ===>",O.value),Pe.value=!0,B.image=O.value[0]?.subUrl,k.isEdit&&k.data){const h=k.data;await yr(h.id,B),p("update:isEdit",!1),Rn.success(P.useString("editedSuccessfully"))}else await gr(B),Rn.success(P.useString("addedSuccessfully"));p("update:visible",!1),p("success"),await e()}catch(h){Pe.value=!1,console.log("error",h),Rn.error(P.useString("errorInSubmittingData"))}})};rr(k,h=>{h.open?t():e(),k.isEdit?s():d()});async function t(){await Cn(),await S.value?.setOpen()}async function e(){await Cn(),await S.value?.setClose(),p("update:open",!1)}return(h,u)=>{const c=Er,a=Or;return Ne(),Jn(hr,{title:"",ref_key:"sheetRef",ref:S,headerCls:"",closeOnClickOutside:"",onOnClickOutside:u[5]||(u[5]=o=>p("update:open",!1)),onOnClose:u[6]||(u[6]=o=>p("update:open",!1))},{header:Ft(()=>[jt("div",Lr,[u[7]||(u[7]=jt("div",{"bg-gray-500":"","h-2px":"","w-2.5rem":""},null,-1)),jt("div",Rr,[jt("div",qr,Mn(h.isEdit?xt(P).useString("editBrand"):xt(P).useString("addBrand")),1),jt("div",jr,[Ot(dr,{class:"w-1rem mt-2 me-5",onClick:e})])])])]),default:Ft(()=>[jt("div",Ir,[Ot(a,{model:B,ref_key:"formRef",ref:g},{default:Ft(()=>[Ot(c,{label:xt(P).useString("image")},{default:Ft(()=>[jt("div",Mr,[Ot(vr,{"file-list":O.value,"onUpdate:fileList":u[0]||(u[0]=o=>O.value=o)},null,8,["file-list"])])]),_:1},8,["label"]),Ot(c,{label:xt(P).useString("title"),name:"title"},{default:Ft(()=>[Ot(jn,{value:B.title,"onUpdate:value":u[1]||(u[1]=o=>B.title=o),"place-holder":xt(P).useString("title")},null,8,["value","place-holder"])]),_:1},8,["label"]),Ot(c,{name:"seo_title",label:xt(P).useString("seoTitle")},{default:Ft(()=>[Ot(jn,{"place-holder":xt(P).useString("seoTitle"),value:B.seo_title,"onUpdate:value":u[2]||(u[2]=o=>B.seo_title=o)},null,8,["place-holder","value"])]),_:1},8,["label"]),Ot(c,{name:"meta",label:xt(P).useString("meta")},{default:Ft(()=>[Ot(jn,{"place-holder":xt(P).useString("meta"),value:B.meta,"onUpdate:value":u[3]||(u[3]=o=>B.meta=o)},null,8,["place-holder","value"])]),_:1},8,["label"]),Ot(c,{class:"mt-3",label:xt(P).useString("description"),key:"description"},{default:Ft(()=>[Ot(_r,{value:B.description,"onUpdate:value":u[4]||(u[4]=o=>B.description=o)},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"]),Ot(pr,{type:"primary",block:"",onClick:i},{default:Ft(()=>[ir(Mn(xt(P).useString("submit")),1)]),_:1})])]),_:1},512)}}}),Br=Object.assign(Ar(Dr,[["__scopeId","data-v-df91d0fb"]]),{__name:"BrandAddEdit"}),Cr={class:"sm:!w-50vw sm:justify-self-center"},Fr={class:"px-4 flex items-center justify-between"},Ur={class:"flex gap-4 py-3 items-center"},Hr={class:"font-semibold"},zr={class:"pt-4 px-2 pb40 sm:grid sm:grid-cols-3 sm:gap-2"},qi=Xn({__name:"index",setup(st){const ft=or(),B=Qn();Gt({y:720});const O=Gt(!1),g=Gt(!1);Gt(null);const P=Gt([]),S=Gt({});async function k(){Pe.value=!0,P.value=await mr(),Pe.value=!1}const p=s=>{S.value=s,g.value=!0,O.value=!0},d=async s=>{await sr(B.useString("areYouSureToDeleteThisBrand"),s??"",br,k)};return ar(async()=>{await k()}),(s,i)=>{const t=wr;return Ne(),qn("div",Cr,[jt("div",{class:lr(["sticky w-full top-0 z-2",xt(B).isNightStore?"bg-header-color-dark ":"bg-header-color"])},[jt("div",Fr,[jt("div",Ur,[Ot(Bn,{icon:xt(B).isRTL?"vuesax-linear:arrow-right":"vuesax-linear:arrow-left",class:"cursor-pointer",onClick:i[0]||(i[0]=e=>xt(ft).back())},null,8,["icon"]),jt("div",Hr,Mn(xt(B).useString("brands")),1)]),i[4]||(i[4]=jt("div",null,null,-1))])],2),jt("div",zr,[(Ne(!0),qn(Fn,null,Un(P.value,(e,h)=>(Ne(),Jn(fr,{key:h,item:e,onEdit:p,onDelete:d},null,8,["item"]))),128)),xt(Pe)?(Ne(),qn(Fn,{key:0},Un(10,e=>Ot(cr)),64)):ur("",!0)]),Ot(t,{shape:"circle",type:"primary",onClick:i[1]||(i[1]=e=>O.value=!0),class:"bottom-10vh w-3rem h-3rem"},{default:Ft(()=>[Ot(Bn,{icon:"vuesax-linear:add"})]),_:1}),Ot(Br,{open:O.value,"onUpdate:open":i[2]||(i[2]=e=>O.value=e),"is-edit":g.value,"onUpdate:isEdit":i[3]||(i[3]=e=>g.value=e),data:S.value,onSuccess:k},null,8,["open","is-edit","data"])])}}});export{qi as default};