Snapshot of main at 9f39a6e1e (2026-11-02)
This commit is contained in:
commit
6ccf1792d7
2580 files changed
+1040202
No files matched your search
@@ -0,0 +1,49 @@
|
||||
var $o=Object.defineProperty;var Uo=(r,t,e)=>t in r?$o(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var Fo=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var O=(r,t,e)=>Uo(r,typeof t!="symbol"?t+"":t,e);import{c as me,g as Il}from"./_commonjsHelpers-Cpj98o6Y.js";var Cg=Fo((Lt,St)=>{var Rl=typeof global=="object"&&global&&global.Object===Object&&global,Ho=typeof self=="object"&&self&&self.Object===Object&&self,ne=Rl||Ho||Function("return this")(),Ee=ne.Symbol,kl=Object.prototype,zo=kl.hasOwnProperty,Ko=kl.toString,_n=Ee?Ee.toStringTag:void 0;function Go(r){var t=zo.call(r,_n),e=r[_n];try{r[_n]=void 0;var n=!0}catch{}var s=Ko.call(r);return n&&(t?r[_n]=e:delete r[_n]),s}var Vo=Object.prototype,Wo=Vo.toString;function Zo(r){return Wo.call(r)}var Xo="[object Null]",Yo="[object Undefined]",qi=Ee?Ee.toStringTag:void 0;function hn(r){return r==null?r===void 0?Yo:Xo:qi&&qi in Object(r)?Go(r):Zo(r)}function ae(r){return r!=null&&typeof r=="object"}var Oe=Array.isArray;function Ae(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}function Bl(r){return r}var Qo="[object AsyncFunction]",Jo="[object Function]",ta="[object GeneratorFunction]",ea="[object Proxy]";function ci(r){if(!Ae(r))return!1;var t=hn(r);return t==Jo||t==ta||t==Qo||t==ea}var Ls=ne["__core-js_shared__"],Oi=function(){var r=/[^.]+$/.exec(Ls&&Ls.keys&&Ls.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function na(r){return!!Oi&&Oi in r}var ra=Function.prototype,sa=ra.toString;function Re(r){if(r!=null){try{return sa.call(r)}catch{}try{return r+""}catch{}}return""}var ia=/[\\^$.*+?()[\]{}|]/g,la=/^\[object .+?Constructor\]$/,oa=Function.prototype,aa=Object.prototype,ca=oa.toString,ua=aa.hasOwnProperty,ha=RegExp("^"+ca.call(ua).replace(ia,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fa(r){if(!Ae(r)||na(r))return!1;var t=ci(r)?ha:la;return t.test(Re(r))}function da(r,t){return r==null?void 0:r[t]}function ke(r,t){var e=da(r,t);return fa(e)?e:void 0}var $s=ke(ne,"WeakMap"),Ci=Object.create,ga=function(){function r(){}return function(t){if(!Ae(t))return{};if(Ci)return Ci(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}();function pa(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}function ma(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t}var ba=800,ya=16,va=Date.now;function Ea(r){var t=0,e=0;return function(){var n=va(),s=ya-(n-e);if(e=n,s>0){if(++t>=ba)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}function Aa(r){return function(){return r}}var Sr=function(){try{var r=ke(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Na=Sr?function(r,t){return Sr(r,"toString",{configurable:!0,enumerable:!1,value:Aa(t),writable:!0})}:Bl,wa=Ea(Na);function Ta(r,t){for(var e=-1,n=r==null?0:r.length;++e<n&&t(r[e],e,r)!==!1;);return r}var xa=9007199254740991,La=/^(?:0|[1-9]\d*)$/;function Ml(r,t){var e=typeof r;return t=t??xa,!!t&&(e=="number"||e!="symbol"&&La.test(r))&&r>-1&&r%1==0&&r<t}function ui(r,t,e){t=="__proto__"&&Sr?Sr(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}function zn(r,t){return r===t||r!==r&&t!==t}var Sa=Object.prototype,_a=Sa.hasOwnProperty;function Dl(r,t,e){var n=r[t];(!(_a.call(r,t)&&zn(n,e))||e===void 0&&!(t in r))&&ui(r,t,e)}function qa(r,t,e,n){var s=!e;e||(e={});for(var i=-1,o=t.length;++i<o;){var a=t[i],u=void 0;u===void 0&&(u=r[a]),s?ui(e,a,u):Dl(e,a,u)}return e}var Ii=Math.max;function Oa(r,t,e){return t=Ii(t===void 0?r.length-1:t,0),function(){for(var n=arguments,s=-1,i=Ii(n.length-t,0),o=Array(i);++s<i;)o[s]=n[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=n[s];return a[t]=e(o),pa(r,this,a)}}function Ca(r,t){return wa(Oa(r,t,Bl),r+"")}var Ia=9007199254740991;function jl(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ia}function Cr(r){return r!=null&&jl(r.length)&&!ci(r)}function Ra(r,t,e){if(!Ae(e))return!1;var n=typeof t;return(n=="number"?Cr(e)&&Ml(t,e.length):n=="string"&&t in e)?zn(e[t],r):!1}function ka(r){return Ca(function(t,e){var n=-1,s=e.length,i=s>1?e[s-1]:void 0,o=s>2?e[2]:void 0;for(i=r.length>3&&typeof i=="function"?(s--,i):void 0,o&&Ra(e[0],e[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++n<s;){var a=e[n];a&&r(t,a,n,i)}return t})}var Ba=Object.prototype;function hi(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Ba;return r===e}function Ma(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}var Da="[object Arguments]";function Ri(r){return ae(r)&&hn(r)==Da}var Pl=Object.prototype,ja=Pl.hasOwnProperty,Pa=Pl.propertyIsEnumerable,Us=Ri(function(){return arguments}())?Ri:function(r){return ae(r)&&ja.call(r,"callee")&&!Pa.call(r,"callee")};function $a(){return!1}var $l=typeof Lt=="object"&&Lt&&!Lt.nodeType&&Lt,ki=$l&&typeof St=="object"&&St&&!St.nodeType&&St,Ua=ki&&ki.exports===$l,Bi=Ua?ne.Buffer:void 0,Fa=Bi?Bi.isBuffer:void 0,Dn=Fa||$Line truncated
|
||||
`){const y=new a.default(this.ops);let A=new p,w=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const x=y.peek(),C=o.default.length(x)-y.peekLength(),M=typeof x.insert=="string"?x.insert.indexOf(m,C)-C:-1;if(M<0)A.push(y.next());else if(M>0)A.push(y.next(M));else{if(f(A,y.next(1).attributes||{},w)===!1)return;w+=1,A=new p}}A.length()>0&&f(A,{},w)}invert(f){const m=new p;return this.reduce((y,A)=>{if(A.insert)m.delete(o.default.length(A));else{if(typeof A.retain=="number"&&A.attributes==null)return m.retain(A.retain),y+A.retain;if(A.delete||typeof A.retain=="number"){const w=A.delete||A.retain;return f.slice(y,y+w).forEach(C=>{A.delete?m.push(C):A.retain&&A.attributes&&m.retain(o.default.length(C),i.default.invert(A.attributes,C.attributes))}),y+w}else if(typeof A.retain=="object"&&A.retain!==null){const w=f.slice(y,y+1),x=new a.default(w.ops).next(),[C,M,z]=h(A.retain,x.insert),U=p.getHandler(C);return m.retain({[C]:U.invert(M,z)},i.default.invert(A.attributes,x.attributes)),y+1}}return y},0),m.chop()}transform(f,m=!1){if(m=!!m,typeof f=="number")return this.transformPosition(f,m);const y=f,A=new a.default(this.ops),w=new a.default(y.ops),x=new p;for(;A.hasNext()||w.hasNext();)if(A.peekType()==="insert"&&(m||w.peekType()!=="insert"))x.retain(o.default.length(A.next()));else if(w.peekType()==="insert")x.push(w.next());else{const C=Math.min(A.peekLength(),w.peekLength()),M=A.next(C),z=w.next(C);if(M.delete)continue;if(z.delete)x.push(z);else{const U=M.retain,rt=z.retain;let at=typeof rt=="object"&&rt!==null?rt:C;if(typeof U=="object"&&U!==null&&typeof rt=="object"&&rt!==null){const ft=Object.keys(U)[0];if(ft===Object.keys(rt)[0]){const Bt=p.getHandler(ft);Bt&&(at={[ft]:Bt.transform(U[ft],rt[ft],m)})}}x.retain(at,i.default.transform(M.attributes,z.attributes,m))}}return x.chop()}transformPosition(f,m=!1){m=!!m;const y=new a.default(this.ops);let A=0;for(;y.hasNext()&&A<=f;){const w=y.peekLength(),x=y.peekType();if(y.next(),x==="delete"){f-=Math.min(w,f-A);continue}else x==="insert"&&(A<f||!m)&&(f+=w);A+=w}return f}}p.Op=o.default,p.OpIterator=a.default,p.AttributeMap=i.default,p.handlers={},t.default=p,r.exports=p,r.exports.default=p}(pr,pr.exports)),pr.exports}var kt=_f();const B=Il(kt);class Kt extends _t{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Kt.blotName="break";Kt.tagName="BR";let Ht=class extends Or{};function Mr(r){return r.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}const Yt=class Yt extends mi{static compare(t,e){const n=Yt.order.indexOf(t),s=Yt.order.indexOf(e);return n>=0||s>=0?n-s:t===e?0:t<e?-1:1}formatAt(t,e,n,s){if(Yt.compare(this.statics.blotName,n)<0&&this.scroll.query(n,D.BLOT)){const i=this.isolate(t,e);s&&i.wrap(n,s)}else super.formatAt(t,e,n,s)}optimize(t){if(super.optimize(t),this.parent instanceof Yt&&Yt.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}};O(Yt,"allowedChildren",[Yt,Kt,_t,Ht]),O(Yt,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let ee=Yt;const cl=1;class pt extends $n{constructor(){super(...arguments);O(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=fo(this)),this.cache.delta}deleteAt(e,n){super.deleteAt(e,n),this.cache={}}formatAt(e,n,s,i){n<=0||(this.scroll.query(s,D.BLOCK)?e+n===this.length()&&this.format(s,i):super.formatAt(e,Math.min(n,this.length()-e-1),s,i),this.cache={})}insertAt(e,n,s){if(s!=null){super.insertAt(e,n,s),this.cache={};return}if(n.length===0)return;const i=n.split(`
|
||||
`),o=i.shift();o.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});let a=this;i.reduce((u,h)=>(a=a.split(u,!0),a.insertAt(0,h),h.length),e+o.length)}insertBefore(e,n){const{head:s}=this.children;super.insertBefore(e,n),s instanceof Kt&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+cl),this.cache.length}moveChildren(e,n){super.moveChildren(e,n),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n&&(e===0||e>=this.length()-cl)){const i=this.clone();return e===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const s=super.split(e,n);return this.cache={},s}}pt.blotName="block";pt.tagName="P";pt.defaultChild=Kt;pt.allowedChildren=[Kt,ee,_t,Ht];class Rt extends _t{attach(){super.attach(),this.attributes=new kr(this.domNode)}delta(){return new B().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(t,e){const n=this.scroll.query(t,D.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,e)}formatAt(t,e,n,s){this.format(n,s)}insertAt(t,e,n){if(n!=null){super.insertAt(t,e,n);return}const s=e.split(`
|
||||
`),i=s.pop(),o=s.map(u=>{const h=this.scroll.create(pt.blotName);return h.insertAt(0,u),h}),a=this.split(t);o.forEach(u=>{this.parent.insertBefore(u,a)}),i&&this.parent.insertBefore(this.scroll.create("text",i),a)}}Rt.scope=D.BLOCK_BLOT;function fo(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.descendants(Et).reduce((e,n)=>n.length()===0?e:e.insert(n.value(),Ct(n,{},t)),new B).insert(`
|
||||
`,Ct(r))}function Ct(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return r==null||("formats"in r&&typeof r.formats=="function"&&(t={...t,...r.formats()},e&&delete t["code-token"]),r.parent==null||r.parent.statics.blotName==="scroll"||r.parent.statics.scope!==r.statics.scope)?t:Ct(r.parent,t,e)}const Ot=class Ot extends _t{static value(){}constructor(t,e,n){super(t,e),this.selection=n,this.textNode=document.createTextNode(Ot.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,e){if(this.savedLength!==0){super.format(t,e);return}let n=this,s=0;for(;n!=null&&n.statics.scope!==D.BLOCK_BLOT;)s+=n.offset(n.parent),n=n.parent;n!=null&&(this.savedLength=Ot.CONTENTS.length,n.optimize(),n.formatAt(s,Ot.CONTENTS.length,t,e),this.savedLength=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const e=this.prev instanceof Ht?this.prev:null,n=e?e.length():0,s=this.next instanceof Ht?this.next:null,i=s?s.text:"",{textNode:o}=this,a=o.data.split(Ot.CONTENTS).join("");o.data=Ot.CONTENTS;let u;if(e)u=e,(a||s)&&(e.insertAt(e.length(),a+i),s&&s.remove());else if(s)u=s,s.insertAt(0,a);else{const h=document.createTextNode(a);u=this.scroll.create(h),this.parent.insertBefore(u,this)}if(this.remove(),t){const h=(f,m)=>e&&f===e.domNode?m:f===o?n+m-1:s&&f===s.domNode?n+a.length+m:null,p=h(t.start.node,t.start.offset),v=h(t.end.node,t.end.offset);if(p!==null&&v!==null)return{startNode:u.domNode,startOffset:p,endNode:u.domNode,endOffset:v}}return null}update(t,e){if(t.some(n=>n.type==="characterData"&&n.target===this.textNode)){const n=this.restore();n&&(e.range=n)}}optimize(t){super.optimize(t);let{parent:e}=this;for(;e;){if(e.domNode.tagName==="A"){this.savedLength=Ot.CONTENTS.length,e.isolate(this.offset(e),this.length()).unwrap(),this.savedLength=0;break}e=e.parent}}value(){return""}};O(Ot,"blotName","cursor"),O(Ot,"className","ql-cursor"),O(Ot,"tagName","span"),O(Ot,"CONTENTS","\uFEFF");let an=Ot;var Cs={exports:{}},ul;function qf(){return ul||(ul=1,function(r){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function s(u,h,p){this.fn=u,this.context=h,this.once=p||!1}function i(u,h,p,v,f){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new s(p,v||u,f),y=e?e+h:h;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],m]:u._events[y].push(m):(u._events[y]=m,u._eventsCount++),u}function o(u,h){--u._eventsCount===0?u._events=new n:delete u._events[h]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],p,v;if(this._eventsCount===0)return h;for(v in p=this._events)t.call(p,v)&&h.push(e?v.slice(1):v);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},a.prototype.listeners=function(h){var p=e?e+h:h,v=this._events[p];if(!v)return[];if(v.fn)return[v.fn];for(var f=0,m=v.length,y=new Array(m);f<m;f++)y[f]=v[f].fn;return y},a.prototype.listenerCount=function(h){var p=e?e+h:h,v=this._events[p];return v?v.fn?1:v.length:0},a.prototype.emit=function(h,p,v,f,m,y){var A=e?e+h:h;if(!this._events[A])return!1;var w=this._events[A],x=arguments.length,C,M;if(w.fn){switch(w.once&&this.removeListener(h,w.fn,void 0,!0),x){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,p),!0;case 3:return w.fn.call(w.context,p,v),!0;case 4:return w.fn.call(w.context,p,v,f),!0;case 5:return w.fn.call(w.context,p,v,f,m),!0;case 6:return w.fn.call(w.context,p,v,f,m,y),!0}for(M=1,C=new Array(x-1);M<x;M++)C[M-1]=arguments[M];w.fn.apply(w.context,C)}else{var z=w.length,U;for(M=0;M<z;M++)switch(w[M].once&&this.removeListener(h,w[M].fn,void 0,!0),x){case 1:w[M].fn.call(w[M].context);break;case 2:w[M].fn.call(w[M].context,p);break;case 3:w[M].fn.call(w[M].context,p,v);break;case 4:w[M].fn.call(w[M].context,p,v,f);break;default:if(!C)for(U=1,C=new Array(x-1);U<x;U++)C[U-1]=arguments[U];w[M].fn.apply(w[M].context,C)}}return!0},a.prototype.on=function(h,p,v){return i(this,h,p,v,!1)},a.prototype.once=function(h,p,v){return i(this,h,p,v,!0)},a.prototype.removeListener=function(h,p,v,f){var m=e?e+h:h;if(!this._events[m])return this;if(!p)return o(this,m),this;var y=this._events[m];if(y.fn)y.fn===p&&(!f||y.once)&&(!v||y.context===v)&&o(this,m);else{for(var A=0,w=[],x=y.length;A<x;A++)(y[A].fn!==p||f&&!y[A].once||v&&y[A].context!==v)&&w.push(y[A]);w.length?this._events[m]=w.length===1?w[0]:w:o(this,m)}return this},a.
Line truncated
|
||||
`)&&(e<=o||!!this.scroll.descendant(Rt,o)[0]),this.scroll.insertAt(o,y);const[A,w]=this.scroll.line(o);let x=ve({},Ct(A));if(A instanceof pt){const[C]=A.descendant(Et,w);C&&(x=ve(x,Ct(C)))}h=kt.AttributeMap.diff(x,h)||{}}else if(typeof a.insert=="object"){const y=Object.keys(a.insert)[0];if(y==null)return o;const A=this.scroll.query(y,D.INLINE)!=null;if(A)(e<=o||this.scroll.descendant(Rt,o)[0])&&(v=!0);else if(o>0){const[w,x]=this.scroll.descendant(Et,o-1);w instanceof Ht?w.value()[x]!==`
|
||||
`&&(p=!0):w instanceof _t&&w.statics.scope===D.INLINE_BLOT&&(p=!0)}if(this.scroll.insertAt(o,y,a.insert[y]),A){const[w]=this.scroll.descendant(Et,o);if(w){const x=ve({},Ct(w));h=kt.AttributeMap.diff(x,h)||{}}}}e+=u}else if(s.push(a),a.retain!==null&&typeof a.retain=="object"){const y=Object.keys(a.retain)[0];if(y==null)return o;this.scroll.updateEmbedAt(o,y,a.retain[y])}Object.keys(h).forEach(y=>{this.scroll.formatAt(o,u,y,h[y])});const f=p?1:0,m=v?1:0;return e+=f+m,s.retain(f),s.delete(m),o+u+f+m},0),s.reduce((o,a)=>typeof a.delete=="number"?(this.scroll.deleteAt(o,a.delete),o):o+kt.Op.length(a),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update(new B().retain(t).delete(e))}formatLine(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(i=>{this.scroll.lines(t,Math.max(e,1)).forEach(o=>{o.format(i,n[i])})}),this.scroll.optimize();const s=new B().retain(t).retain(e,nn(n));return this.update(s)}formatText(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(i=>{this.scroll.formatAt(t,e,i,n[i])});const s=new B().retain(t).retain(e,nn(n));return this.update(s)}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce((t,e)=>t.concat(e.delta()),new B)}getFormat(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],s=[];e===0?this.scroll.path(t).forEach(a=>{const[u]=a;u instanceof pt?n.push(u):u instanceof Et&&s.push(u)}):(n=this.scroll.lines(t,e),s=this.scroll.descendants(Et,t,e));const[i,o]=[n,s].map(a=>{const u=a.shift();if(u==null)return{};let h=Ct(u);for(;Object.keys(h).length>0;){const p=a.shift();if(p==null)return h;h=Mf(Ct(p),h)}return h});return{...i,...o}}getHTML(t,e){const[n,s]=this.scroll.line(t);if(n){const i=n.length();return n.length()>=s+e&&!(s===0&&e===i)?Un(n,s,e,!0):Un(this.scroll,t,e,!0)}return""}getText(t,e){return this.getContents(t,e).filter(n=>typeof n.insert=="string").map(n=>n.insert).join("")}insertContents(t,e){const n=hl(e),s=new B().retain(t).concat(n);return this.scroll.insertContents(t,n),this.update(s)}insertEmbed(t,e,n){return this.scroll.insertAt(t,e,n),this.update(new B().retain(t).insert({[e]:n}))}insertText(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=e.replace(/\r\n/g,`
|
||||
`).replace(/\r/g,`
|
||||
`),this.scroll.insertAt(t,e),Object.keys(n).forEach(s=>{this.scroll.formatAt(t,e.length,s,n[s])}),this.update(new B().retain(t).insert(e,nn(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const t=this.scroll.children.head;if((t==null?void 0:t.statics.blotName)!==pt.blotName)return!1;const e=t;return e.children.length>1?!1:e.children.head instanceof Kt}removeFormat(t,e){const n=this.getText(t,e),[s,i]=this.scroll.line(t+e);let o=0,a=new B;s!=null&&(o=s.length()-i,a=s.delta().slice(i,i+o-1).insert(`
|
||||
`));const h=this.getContents(t,e+o).diff(new B().insert(n).concat(a)),p=new B().retain(t).concat(h);return this.applyDelta(p)}update(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(e.length===1&&e[0].type==="characterData"&&e[0].target.data.match(kf)&&this.scroll.find(e[0].target)){const i=this.scroll.find(e[0].target),o=Ct(i),a=i.offset(this.scroll),u=e[0].oldValue.replace(an.CONTENTS,""),h=new B().insert(u),p=new B().insert(i.value()),v=n&&{oldRange:fl(n.oldRange,-a),newRange:fl(n.newRange,-a)};t=new B().retain(a).concat(h.diff(p,v)).reduce((m,y)=>y.insert?m.insert(y.insert,o):m.push(y),new B),this.delta=s.compose(t)}else this.delta=this.getDelta(),(!t||!pi(s.compose(t),this.delta))&&(t=s.diff(this.delta,n));return t}}function tn(r,t,e){if(r.length===0){const[m]=Bs(e.pop());return t<=0?`</li></${m}>`:`</li></${m}>${tn([],t-1,e)}`}const[{child:n,offset:s,length:i,indent:o,type:a},...u]=r,[h,p]=Bs(a);if(o>t)return e.push(a),o===t+1?`<${h}><li${p}>${Un(n,s,i)}${tn(u,o,e)}`:`<${h}><li>${tn(r,t+1,e)}`;const v=e[e.length-1];if(o===t&&a===v)return`</li><li${p}>${Un(n,s,i)}${tn(u,o,e)}`;const[f]=Bs(e.pop());return`</li></${f}>${tn(r,t-1,e)}`}function Un(r,t,e){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in r&&typeof r.html=="function")return r.html(t,e);if(r instanceof Ht)return Mr(r.value().slice(t,t+e));if(r instanceof Ft){if(r.statics.blotName==="list-container"){const h=[];return r.children.forEachAt(t,e,(p,v,f)=>{const m="formats"in p&&typeof p.formats=="function"?p.formats():{};h.push({child:p,offset:v,length:f,indent:m.indent||0,type:m.list})}),tn(h,-1,[])}const s=[];if(r.children.forEachAt(t,e,(h,p,v)=>{s.push(Un(h,p,v))}),n||r.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:o}=r.domNode,[a,u]=i.split(`>${o}<`);return a==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${u}`:`${a}>${s.join("")}<${u}`}return r.domNode instanceof Element?r.domNode.outerHTML:""}function Mf(r,t){return Object.keys(t).reduce((e,n)=>{if(r[n]==null)return e;const s=t[n];return s===r[n]?e[n]=s:Array.isArray(s)?s.indexOf(r[n])<0?e[n]=s.concat([r[n]]):e[n]=s:e[n]=[s,r[n]],e},{})}function Bs(r){const t=r==="ordered"?"ol":"ul";switch(r){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function hl(r){return r.reduce((t,e)=>{if(typeof e.insert=="string"){const n=e.insert.replace(/\r\n/g,`
|
||||
`).replace(/\r/g,`
|
||||
`);return t.insert(n,e.attributes)}return t.push(e)},new B)}function fl(r,t){let{index:e,length:n}=r;return new Ie(e+t,n)}function Df(r){const t=[];return r.forEach(e=>{typeof e.insert=="string"?e.insert.split(`
|
||||
`).forEach((s,i)=>{i&&t.push({insert:`
|
||||
`,attributes:e.attributes}),s&&t.push({insert:s,attributes:e.attributes})}):t.push(e)}),t}class Gt{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=t,this.options=e}}O(Gt,"DEFAULTS",{});const vr="\uFEFF";class yi extends _t{constructor(t,e){super(t,e),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(n=>{this.contentNode.appendChild(n)}),this.leftGuard=document.createTextNode(vr),this.rightGuard=document.createTextNode(vr),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(t,e){return t===this.leftGuard?0:t===this.rightGuard?1:super.index(t,e)}restore(t){let e=null,n;const s=t.data.split(vr).join("");if(t===this.leftGuard)if(this.prev instanceof Ht){const i=this.prev.length();this.prev.insertAt(i,s),e={startNode:this.prev.domNode,startOffset:i+s.length}}else n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this),e={startNode:n,startOffset:s.length};else t===this.rightGuard&&(this.next instanceof Ht?(this.next.insertAt(0,s),e={startNode:this.next.domNode,startOffset:s.length}):(n=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(n),this.next),e={startNode:n,startOffset:s.length}));return t.data=vr,e}update(t,e){t.forEach(n=>{if(n.type==="characterData"&&(n.target===this.leftGuard||n.target===this.rightGuard)){const s=this.restore(n.target);s&&(e.range=s)}})}}class jf{constructor(t,e){O(this,"isComposing",!1);this.scroll=t,this.emitter=e,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",t=>{this.isComposing||this.handleCompositionStart(t)}),this.scroll.domNode.addEventListener("compositionend",t=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(t)})})}handleCompositionStart(t){const e=t.target instanceof Node?this.scroll.find(t.target,!0):null;e&&!(e instanceof yi)&&(this.emitter.emit(R.events.COMPOSITION_BEFORE_START,t),this.scroll.batchStart(),this.emitter.emit(R.events.COMPOSITION_START,t),this.isComposing=!0)}handleCompositionEnd(t){this.emitter.emit(R.events.COMPOSITION_BEFORE_END,t),this.scroll.batchEnd(),this.emitter.emit(R.events.COMPOSITION_END,t),this.isComposing=!1}}const Bn=class Bn{constructor(t,e){O(this,"modules",{});this.quill=t,this.options=e}init(){Object.keys(this.options.modules).forEach(t=>{this.modules[t]==null&&this.addModule(t)})}addModule(t){const e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}};O(Bn,"DEFAULTS",{modules:{}}),O(Bn,"themes",{default:Bn});let cn=Bn;const Pf=r=>r.parentElement||r.getRootNode().host||null,$f=r=>{const t=r.getBoundingClientRect(),e="offsetWidth"in r&&Math.abs(t.width)/r.offsetWidth||1,n="offsetHeight"in r&&Math.abs(t.height)/r.offsetHeight||1;return{top:t.top,right:t.left+r.clientWidth*e,bottom:t.top+r.clientHeight*n,left:t.left}},Er=r=>{const t=parseInt(r,10);return Number.isNaN(t)?0:t},dl=(r,t,e,n,s,i)=>r<e&&t>n?0:r<e?-(e-r+s):t>n?t-r>n-e?r+s-e:t-n+i:0,Uf=(r,t)=>{var i,o,a;const e=r.ownerDocument;let n=t,s=r;for(;s;){const u=s===e.body,h=u?{top:0,right:((i=window.visualViewport)==null?void 0:i.width)??e.documentElement.clientWidth,bottom:((o=window.visualViewport)==null?void 0:o.height)??e.documentElement.clientHeight,left:0}:$f(s),p=getComputedStyle(s),v=dl(n.left,n.right,h.left,h.right,Er(p.scrollPaddingLeft),Er(p.scrollPaddingRight)),f=dl(n.top,n.bottom,h.top,h.bottom,Er(p.scrollPaddingTop),Er(p.scrollPaddingBottom));if(v||f)if(u)(a=e.defaultView)==null||a.scrollBy(v,f);else{const{scrollLeft:m,scrollTop:y}=s;f&&(s.scrollTop+=f),v&&(s.scrollLeft+=v);const A=s.scrollLeft-m,w=s.scrollTop-y;n={left:n.left-A,top:n.top-w,right:n.right-A,bottom:n.bottom-w}}s=u||p.position==="fixed"?null:Pf(s)}},Ff=100,Hf=["block","break","cursor","inline","scroll","text"],zf=(r,t,e)=>{const n=new on;return Hf.forEach(s=>{const i=t.query(s);i&&n.register(i)}),r.forEach(s=>{let i=t.query(s);i||e.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;i;)if(n.register(i),i="blotName"in i?i.requiredContainer??null:null,o+=1,o>Ff){e.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),n},sn=fe("quill"),Ar=new on;Ft.uiClass="ql-ui";const Pt=class Pt{static debug(t){t===!0&&(t="log"),fe.level(t)}static find(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Qs.get(t)||Ar.find(t,e)}static import(t){return this.imports[t]==null&&sn.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const t=arguments.length<=0?void 0:arguments[0],e=!!(!(arguments.length<=1)&&arguments[1]),n="attrName"in t?t.attrName:t.blotName;typeof n=="string"?this.register(`formats/${n}`,t,e):Object.keys
Line truncated
|
||||
`});this.setContents(o)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof t=="string"){const n=t;t=document.createElement("div"),t.classList.add(n)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,n){return[t,e,,n]=oe(t,e,n),jt.call(this,()=>this.editor.deleteText(t,e),n,t,-1*e)}disable(){this.enable(!1)}editReadOnly(t){this.allowReadOnlyEdits=!0;const e=t();return this.allowReadOnlyEdits=!1,e}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),t.preventScroll||this.scrollSelectionIntoView()}format(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R.sources.API;return jt.call(this,()=>{const s=this.getSelection(!0);let i=new B;if(s==null)return i;if(this.scroll.query(t,D.BLOCK))i=this.editor.formatLine(s.index,s.length,{[t]:e});else{if(s.length===0)return this.selection.format(t,e),i;i=this.editor.formatText(s.index,s.length,{[t]:e})}return this.setSelection(s,R.sources.SILENT),i},n)}formatLine(t,e,n,s,i){let o;return[t,e,o,i]=oe(t,e,n,s,i),jt.call(this,()=>this.editor.formatLine(t,e,o),i,t,0)}formatText(t,e,n,s,i){let o;return[t,e,o,i]=oe(t,e,n,s,i),jt.call(this,()=>this.editor.formatText(t,e,o),i,t,0)}getBounds(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(typeof t=="number"?n=this.selection.getBounds(t,e):n=this.selection.getBounds(t.index,t.length),!n)return null;const s=this.container.getBoundingClientRect();return{bottom:n.bottom-s.top,height:n.height,left:n.left-s.left,right:n.right-s.left,top:n.top-s.top,width:n.width}}getContents(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-t;return[t,e]=oe(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof t=="number"?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof t!="number"?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=oe(t,e),this.editor.getHTML(t,e)}getText(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;return typeof t=="number"&&(e=e??this.getLength()-t),[t,e]=oe(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,n){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Pt.sources.API;return jt.call(this,()=>this.editor.insertEmbed(t,e,n),s,t)}insertText(t,e,n,s,i){let o;return[t,,o,i]=oe(t,0,n,s,i),jt.call(this,()=>this.editor.insertText(t,e,o),i,t,e.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(t,e,n){return[t,e,,n]=oe(t,e,n),jt.call(this,()=>this.editor.removeFormat(t,e),n,t)}scrollRectIntoView(t){Uf(this.root,t)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const t=this.selection.lastRange,e=t&&this.selection.getBounds(t.index,t.length);e&&this.scrollRectIntoView(e)}setContents(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R.sources.API;return jt.call(this,()=>{t=new B(t);const n=this.getLength(),s=this.editor.deleteText(0,n),i=this.editor.insertContents(0,t),o=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(o)},e)}setSelection(t,e,n){t==null?this.selection.setRange(null,e||Pt.sources.API):([t,e,,n]=oe(t,e,n),this.selection.setRange(new Ie(Math.max(0,t),e),n),n!==R.sources.SILENT&&this.scrollSelectionIntoView())}setText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R.sources.API;const n=new B().insert(t);return this.setContents(n,e)}update
Line truncated
|
||||
`)?s.insertAt(0,e.slice(0,-1),n):s.insertAt(0,e,n)}else{const s=this.scroll.create(e,n);this.appendChild(s)}else super.insertAt(t,e,n);this.optimize()}insertBefore(t,e){if(t.statics.scope===D.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(t),super.insertBefore(n,e)}else super.insertBefore(t,e)}insertContents(t,e){const n=this.deltaToRenderBlocks(e.concat(new B().insert(`
|
||||
`))),s=n.pop();if(s==null)return;this.batchStart();const i=n.shift();if(i){const u=i.type==="block"&&(i.delta.length()===0||!this.descendant(Rt,t)[0]&&t<this.length()),h=i.type==="block"?i.delta:new B().insert({[i.key]:i.value});Ds(this,t,h);const p=i.type==="block"?1:0,v=t+h.length()+p;u&&this.insertAt(v-1,`
|
||||
`);const f=Ct(this.line(t)[0]),m=kt.AttributeMap.diff(f,i.attributes)||{};Object.keys(m).forEach(y=>{this.formatAt(v-1,1,y,m[y])}),t=v}let[o,a]=this.children.find(t);if(n.length&&(o&&(o=o.split(a),a=0),n.forEach(u=>{if(u.type==="block"){const h=this.createBlock(u.attributes,o||void 0);Ds(h,0,u.delta)}else{const h=this.create(u.key,u.value);this.insertBefore(h,o||void 0),Object.keys(u.attributes).forEach(p=>{h.format(p,u.attributes[p])})}})),s.type==="block"&&s.delta.length()){const u=o?o.offset(o.scroll)+a:this.length();Ds(this,u,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(t){const e=this.path(t).pop();if(!e)return[null,-1];const[n,s]=e;return n instanceof Et?[n,s]:[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(bl,t)}lines(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const n=(s,i,o)=>{let a=[],u=o;return s.children.forEachAt(i,o,(h,p,v)=>{bl(h)?a.push(h):h instanceof Br&&(a=a.concat(n(h,p,u))),u-=v}),a};return n(this,t,e)}optimize(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(t,e),t.length>0&&this.emitter.emit(R.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}remove(){}update(t){if(this.batch){Array.isArray(t)&&(this.batch=this.batch.concat(t));return}let e=R.sources.USER;typeof t=="string"&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t=t.filter(n=>{let{target:s}=n;const i=this.find(s,!0);return i&&!yl(i)}),t.length>0&&this.emitter.emit(R.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(R.events.SCROLL_UPDATE,e,t)}updateEmbedAt(t,e,n){const[s]=this.descendant(i=>i instanceof Rt,t);s&&s.statics.blotName===e&&yl(s)&&s.updateContent(n)}handleDragStart(t){t.preventDefault()}deltaToRenderBlocks(t){const e=[];let n=new B;return t.forEach(s=>{const i=s==null?void 0:s.insert;if(i)if(typeof i=="string"){const o=i.split(`
|
||||
`);o.slice(0,-1).forEach(u=>{n.insert(u,s.attributes),e.push({type:"block",delta:n,attributes:s.attributes??{}}),n=new B});const a=o[o.length-1];a&&n.insert(a,s.attributes)}else{const o=Object.keys(i)[0];if(!o)return;this.query(o,D.INLINE)?n.push(s):(n.length()&&e.push({type:"block",delta:n,attributes:{}}),n=new B,e.push({type:"blockEmbed",key:o,value:i[o],attributes:s.attributes??{}}))}}),n.length()&&e.push({type:"block",delta:n,attributes:{}}),e}createBlock(t,e){let n;const s={};Object.entries(t).forEach(a=>{let[u,h]=a;this.query(u,D.BLOCK&D.BLOT)!=null?n=u:s[u]=h});const i=this.create(n||this.statics.defaultChild.blotName,n?t[n]:void 0);this.insertBefore(i,e||void 0);const o=i.length();return Object.entries(s).forEach(a=>{let[u,h]=a;i.formatAt(0,o,u,h)}),i}}O(en,"blotName","scroll"),O(en,"className","ql-editor"),O(en,"tagName","DIV"),O(en,"defaultChild",pt),O(en,"allowedChildren",[pt,Rt,Me]);function Ds(r,t,e){e.reduce((n,s)=>{const i=kt.Op.length(s);let o=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const a=s.insert;r.insertAt(n,a);const[u]=r.descendant(Et,n),h=Ct(u);o=kt.AttributeMap.diff(h,o)||{}}else if(typeof s.insert=="object"){const a=Object.keys(s.insert)[0];if(a==null)return n;if(r.insertAt(n,a,s.insert[a]),r.scroll.query(a,D.INLINE)!=null){const[h]=r.descendant(Et,n),p=Ct(h);o=kt.AttributeMap.diff(p,o)||{}}}}return Object.keys(o).forEach(a=>{r.formatAt(n,i,a,o[a])}),n+i},t)}const vi={scope:D.BLOCK,whitelist:["right","center","justify"]},Gf=new te("align","align",vi),po=new zt("align","ql-align",vi),mo=new Ne("align","text-align",vi);class bo extends Ne{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${e.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):e}}const Vf=new zt("color","ql-color",{scope:D.INLINE}),Ei=new bo("color","color",{scope:D.INLINE}),Wf=new zt("background","ql-bg",{scope:D.INLINE}),Ai=new bo("background","background-color",{scope:D.INLINE});class De extends Me{static create(t){const e=super.create(t);return e.setAttribute("spellcheck","false"),e}code(t,e){return this.children.map(n=>n.length()<=1?"":n.domNode.innerText).join(`
|
||||
`).slice(t,t+e)}html(t,e){return`<pre>
|
||||
${Mr(this.code(t,e))}
|
||||
</pre>`}}class At extends pt{static register(){N.register(De)}}O(At,"TAB"," ");class Ni extends ee{}Ni.blotName="code";Ni.tagName="CODE";At.blotName="code-block";At.className="ql-code-block";At.tagName="DIV";De.blotName="code-block-container";De.className="ql-code-block-container";De.tagName="DIV";De.allowedChildren=[At];At.allowedChildren=[Ht,Kt,an];At.requiredContainer=De;const wi={scope:D.BLOCK,whitelist:["rtl"]},yo=new te("direction","dir",wi),vo=new zt("direction","ql-direction",wi),Eo=new Ne("direction","direction",wi),Ao={scope:D.INLINE,whitelist:["serif","monospace"]},No=new zt("font","ql-font",Ao);class Zf extends Ne{value(t){return super.value(t).replace(/["']/g,"")}}const wo=new Zf("font","font-family",Ao),To=new zt("size","ql-size",{scope:D.INLINE,whitelist:["small","large","huge"]}),xo=new Ne("size","font-size",{scope:D.INLINE,whitelist:["10px","18px","32px"]}),Xf=fe("quill:keyboard"),Yf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Dr extends Gt{static match(t,e){return["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!e[n]!==t[n]&&e[n]!==null)?!1:e.key===t.key||e.key===t.which}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach(n=>{this.options.bindings[n]&&this.addBinding(this.options.bindings[n])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Jf(t);if(s==null){Xf.warn("Attempted to add invalid keyboard binding",s);return}typeof e=="function"&&(e={handler:e}),typeof n=="function"&&(n={handler:n}),(Array.isArray(s.key)?s.key:[s.key]).forEach(o=>{const a={...s,key:o,...e,...n};this.bindings[a.key]=this.bindings[a.key]||[],this.bindings[a.key].push(a)})}listen(){this.quill.root.addEventListener("keydown",t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key==="Enter"||t.key==="Backspace"))return;const s=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(x=>Dr.match(t,x));if(s.length===0)return;const i=N.find(t.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const o=this.quill.getSelection();if(o==null||!this.quill.hasFocus())return;const[a,u]=this.quill.getLine(o.index),[h,p]=this.quill.getLeaf(o.index),[v,f]=o.length===0?[h,p]:this.quill.getLeaf(o.index+o.length),m=h instanceof Or?h.value().slice(0,p):"",y=v instanceof Or?v.value().slice(f):"",A={collapsed:o.length===0,empty:o.length===0&&a.length()<=1,format:this.quill.getFormat(o),line:a,offset:u,prefix:m,suffix:y,event:t};s.some(x=>{if(x.collapsed!=null&&x.collapsed!==A.collapsed||x.empty!=null&&x.empty!==A.empty||x.offset!=null&&x.offset!==A.offset)return!1;if(Array.isArray(x.format)){if(x.format.every(C=>A.format[C]==null))return!1}else if(typeof x.format=="object"&&!Object.keys(x.format).every(C=>x.format[C]===!0?A.format[C]!=null:x.format[C]===!1?A.format[C]==null:pi(x.format[C],A.format[C])))return!1;return x.prefix!=null&&!x.prefix.test(A.prefix)||x.suffix!=null&&!x.suffix.test(A.suffix)?!1:x.handler.call(this,o,A,x)!==!0})&&t.preventDefault()})}handleBackspace(t,e){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;if(t.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(t.index);let o=new B().retain(t.index-n).delete(n);if(e.offset===0){const[a]=this.quill.getLine(t.index-1);if(a&&!(a.statics.blotName==="block"&&a.length()<=1)){const h=i.formats(),p=this.quill.getFormat(t.index-1,1);if(s=kt.AttributeMap.diff(h,p)||{},Object.keys(s).length>0){const v=new B().retain(t.index+i.length()-2).retain(1,s);o=o.compose(v)}}}this.quill.updateContents(o,N.sources.USER),this.quill.focus()}handleDelete(t,e){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-n)return;let s={};const[i]=this.quill.getLine(t.index);let o=new B().retain(t.index).delete(n);if(e.offset>=i.length()-1){const[a]=this.quill.getLine(t.index+1);if(a){const u=i.formats(),h=this.quill.getFormat(t.index,1);s=kt.AttributeMap.diff(u,h)||{},Object.keys(s).length>0&&(o=o.retain(a.length()-1).retain(1,s))}}this.quill.updateContents(o,N.sources.USER),this.quill.focus()}handleDeleteRange(t){Ti({range:t,quill:this.quill}),this.quill.focus()}handleEnter(t,e){const n=ObLine truncated
|
||||
`,n);this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(t.index+1,N.sources.SILENT),this.quill.focus()}}const Qf={bindings:{bold:js("bold"),italic:js("italic"),underline:js("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(r,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","+1",N.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(r,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format("indent","-1",N.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(r,t){t.format.indent!=null?this.quill.format("indent","-1",N.sources.USER):t.format.list!=null&&this.quill.format("list",!1,N.sources.USER)}},"indent code-block":vl(!0),"outdent code-block":vl(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(r){this.quill.deleteText(r.index-1,1,N.sources.USER)}},tab:{key:"Tab",handler(r,t){if(t.format.table)return!0;this.quill.history.cutoff();const e=new B().retain(r.index).delete(r.length).insert(" ");return this.quill.updateContents(e,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index+1,N.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,N.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(r,t){const e={list:!1};t.format.indent&&(e.indent=!1),this.quill.formatLine(r.index,r.length,e,N.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(r){const[t,e]=this.quill.getLine(r.index),n={...t.formats(),list:"checked"},s=new B().retain(r.index).insert(`
|
||||
`,n).retain(t.length()-e-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(r.index+1,N.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(r,t){const[e,n]=this.quill.getLine(r.index),s=new B().retain(r.index).insert(`
|
||||
`,t.format).retain(e.length()-n-1).retain(1,{header:null});this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(r.index+1,N.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(r){const t=this.quill.getModule("table");if(t){const[e,n,s,i]=t.getTable(r),o=td(e,n,s,i);if(o==null)return;let a=e.offset();if(o<0){const u=new B().retain(a).insert(`
|
||||
`);this.quill.updateContents(u,N.sources.USER),this.quill.setSelection(r.index+1,r.length,N.sources.SILENT)}else if(o>0){a+=e.length();const u=new B().retain(a).insert(`
|
||||
`);this.quill.updateContents(u,N.sources.USER),this.quill.setSelection(a,N.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(r,t){const{event:e,line:n}=t,s=n.offset(this.quill.scroll);e.shiftKey?this.quill.setSelection(s-1,N.sources.USER):this.quill.setSelection(s+n.length(),N.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(r,t){if(this.quill.scroll.query("list")==null)return!0;const{length:e}=t.prefix,[n,s]=this.quill.getLine(r.index);if(s>e)return!0;let i;switch(t.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(r.index," ",N.sources.USER),this.quill.history.cutoff();const o=new B().retain(r.index-s).delete(e+1).retain(n.length()-2-s).retain(1,{list:i});return this.quill.updateContents(o,N.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(r.index-e,N.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(r){const[t,e]=this.quill.getLine(r.index);let n=2,s=t;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,n-=1,n<=0){const i=new B().retain(r.index+t.length()-e-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,N.sources.USER),this.quill.setSelection(r.index-1,N.sources.SILENT),!1}return!0}},"embed left":Nr("ArrowLeft",!1),"embed left shift":Nr("ArrowLeft",!0),"embed right":Nr("ArrowRight",!1),"embed right shift":Nr("ArrowRight",!0),"table down":El(!1),"table up":El(!0)}};Dr.DEFAULTS=Qf;function vl(r){return{key:"Tab",shiftKey:!r,format:{"code-block":!0},handler(t,e){let{event:n}=e;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(t.length===0&&!n.shiftKey){this.quill.insertText(t.index,i,N.sources.USER),this.quill.setSelection(t.index+i.length,N.sources.SILENT);return}const o=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:a,length:u}=t;o.forEach((h,p)=>{r?(h.insertAt(0,i),p===0?a+=i.length:u+=i.length):h.domNode.textContent.startsWith(i)&&(h.deleteAt(0,i.length),p===0?a-=i.length:u-=i.length)}),this.quill.update(N.sources.USER),this.quill.setSelection(a,u,N.sources.SILENT)}}}function Nr(r,t){return{key:r,shiftKey:t,altKey:null,[r==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(n){let{index:s}=n;r==="ArrowRight"&&(s+=n.length+1);const[i]=this.quill.getLeaf(s);return i instanceof _t?(r==="ArrowLeft"?t?this.quill.setSelection(n.index-1,n.length+1,N.sources.USER):this.quill.setSelection(n.index-1,N.sources.USER):t?this.quill.setSelection(n.index,n.length+1,N.sources.USER):this.quill.setSelection(n.index+n.length+1,N.sources.USER),!1):!0}}}function js(r){return{key:r[0],shortKey:!0,handler(t,e){this.quill.format(r,!e.format[r],N.sources.USER)}}}function El(r){return{key:r?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,e){const n=r?"prev":"next",s=e.line,i=s.parent[n];if(i!=null){if(i.statics.blotName==="table-row"){let o=i.children.head,a=s;for(;a.prev!=null;)a=a.prev,o=o.next;const u=o.offset(this.quill.scroll)+Math.min(e.offset,o.length()-1);this.quill.setSelection(u,0,N.sources.USER)}}else{const o=s.table()[n];o!=null&&(r?this.quill.setSelection(o.offset(this.quill.scroll)+o.length()-1,0,N.sources.USER):this.quill.setSelection(o.offset(this.quill.scroll),0,N.sources.USER))}return!1}}}function Jf(r){if(typeof r=="string"||typeof r=="number")r={key:r};else if(typeof r=="object")r=nn(r);else return null;return r.shortKey&&(r[Yf]=r.shortKey,delete r.shortKey),r}function Ti(r){let{quill:t,range:e}=r;const n=t.getLines(e);let s={};if(n.length>1){const i=n[0].formats(),o=n[n.length-1].formats();s=kt.AttributeMap.diff(o,i)||{}}t.deleteText(e,N.sources.USER),Object.keys(s).length>0&&t.formatLine(e.index,1,s,N.sources.USER),t.setSelection(e.index,N.sources.SILENT)}function td(r,t,e,n){return t.prev==null&&t.next==null?e.prev==null&&e.next==null?n===0?-1:1:e.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}const ed=/font-weight:\s*normal/,nd=["P","OL","UL"],Al=r=>r&&nd.includes(r.tagName),rd=r=>{Array.from(r.querySelectorAll("br")).filter(t=>Al(t.previousElementSibling)&&Al(t.nextElementSibling)).forEach(t=>{var e;(e=t.parentNode)==null||e.removeChild(t)})},sd=r=>{Array.from(r.querySelectorAll('b[style*="font-weight"]')).filter(t=>{var e;return(e=t.getAttribute("style"))==null?void 0:e.match(ed)}).forEach(t=>{var n;const e=r.createDocumentFragment();e.append(...t.childNodes),(n=t.parentNode)==null||n.replaceChild(e,t)})};function id(r){r.querySelector('[id^="docs-internal-guid-"]')&&(sd(r),rd(r))}const ld=/\bmso-list:[^;]*ignore/i,od=/\bmso-list:[^;]*\bl(\d+)/i,ad=/\bmso-list:[^;]*\blevel(\d+)/i,cd=(r,t)=>{const e=r.getAttribute("style"),n=e==null?void 0:e.match(od);if(!n)return null;const s=Number(n[1]),i=e==null?void 0:e.match(ad),o=i?Number(i[1]):1,a=new RegExp(`@list l${s}:level${o}\\s*\\{Line truncated
|
||||
`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new B().retain(i.length()-1).delete(1)):i}normalizeHTML(t){dd(t)}convertHTML(t){const e=new DOMParser().parseFromString(t,"text/html");this.normalizeHTML(e);const n=e.body,s=new WeakMap,[i,o]=this.prepareMatching(n,s);return xi(this.quill.scroll,n,i,o,s)}dangerouslyPasteHTML(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:N.sources.API;if(typeof t=="string"){const s=this.convert({html:t,text:""});this.quill.setContents(s,e),this.quill.setSelection(0,N.sources.SILENT)}else{const s=this.convert({html:e,text:""});this.quill.updateContents(new B().retain(t).concat(s),n),this.quill.setSelection(t+s.length(),N.sources.SILENT)}}onCaptureCopy(t){var o,a;let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t.defaultPrevented)return;t.preventDefault();const[n]=this.quill.selection.getRange();if(n==null)return;const{html:s,text:i}=this.onCopy(n,e);(o=t.clipboardData)==null||o.setData("text/plain",i),(a=t.clipboardData)==null||a.setData("text/html",s),e&&Ti({range:n,quill:this.quill})}normalizeURIList(t){return t.split(/\r?\n/).filter(e=>e[0]!=="#").join(`
|
||||
`)}onCapturePaste(t){var o,a,u,h,p;if(t.defaultPrevented||!this.quill.isEnabled())return;t.preventDefault();const e=this.quill.getSelection(!0);if(e==null)return;const n=(o=t.clipboardData)==null?void 0:o.getData("text/html");let s=(a=t.clipboardData)==null?void 0:a.getData("text/plain");if(!n&&!s){const v=(u=t.clipboardData)==null?void 0:u.getData("text/uri-list");v&&(s=this.normalizeURIList(v))}const i=Array.from(((h=t.clipboardData)==null?void 0:h.files)||[]);if(!n&&i.length>0){this.quill.uploader.upload(e,i);return}if(n&&i.length>0){const v=new DOMParser().parseFromString(n,"text/html");if(v.body.childElementCount===1&&((p=v.body.firstElementChild)==null?void 0:p.tagName)==="IMG"){this.quill.uploader.upload(e,i);return}}this.onPaste(e,{html:n,text:s})}onCopy(t){const e=this.quill.getText(t);return{html:this.quill.getSemanticHTML(t),text:e}}onPaste(t,e){let{text:n,html:s}=e;const i=this.quill.getFormat(t.index),o=this.convert({text:n,html:s},i);gd.log("onPaste",o,{text:n,html:s});const a=new B().retain(t.index).delete(t.length).concat(o);this.quill.updateContents(a,N.sources.USER),this.quill.setSelection(a.length()-t.length,N.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(t,e){const n=[],s=[];return this.matchers.forEach(i=>{const[o,a]=i;switch(o){case Node.TEXT_NODE:s.push(a);break;case Node.ELEMENT_NODE:n.push(a);break;default:Array.from(t.querySelectorAll(o)).forEach(u=>{if(e.has(u)){const h=e.get(u);h==null||h.push(a)}else e.set(u,[a])});break}}),[n,s]}}O(Lo,"DEFAULTS",{matchers:[]});function je(r,t,e,n){return n.query(t)?r.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[t])return s.push(i);const o=e?{[t]:e}:{};return s.insert(i.insert,{...o,...i.attributes})},new B):r}function Kn(r,t){let e="";for(let n=r.ops.length-1;n>=0&&e.length<t.length;--n){const s=r.ops[n];if(typeof s.insert!="string")break;e=s.insert+e}return e.slice(-1*t.length)===t}function be(r,t){if(!(r instanceof Element))return!1;const e=t.query(r);return e&&e.prototype instanceof _t?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(r.tagName.toLowerCase())}function bd(r,t){return r.previousElementSibling&&r.nextElementSibling&&!be(r.previousElementSibling,t)&&!be(r.nextElementSibling,t)}const wr=new WeakMap;function So(r){return r==null?!1:(wr.has(r)||(r.tagName==="PRE"?wr.set(r,!0):wr.set(r,So(r.parentNode))),wr.get(r))}function xi(r,t,e,n,s){return t.nodeType===t.TEXT_NODE?n.reduce((i,o)=>o(t,i,r),new B):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((i,o)=>{let a=xi(r,o,e,n,s);return o.nodeType===t.ELEMENT_NODE&&(a=e.reduce((u,h)=>h(o,u,r),a),a=(s.get(o)||[]).reduce((u,h)=>h(o,u,r),a)),i.concat(a)},new B):new B}function Ps(r){return(t,e,n)=>je(e,r,!0,n)}function yd(r,t,e){const n=te.keys(r),s=zt.keys(r),i=Ne.keys(r),o={};return n.concat(s).concat(i).forEach(a=>{let u=e.query(a,D.ATTRIBUTE);u!=null&&(o[u.attrName]=u.value(r),o[u.attrName])||(u=md[a],u!=null&&(u.attrName===a||u.keyName===a)&&(o[u.attrName]=u.value(r)||void 0),u=Nl[a],u!=null&&(u.attrName===a||u.keyName===a)&&(u=Nl[a],o[u.attrName]=u.value(r)||void 0))}),Object.entries(o).reduce((a,u)=>{let[h,p]=u;return je(a,h,p,e)},t)}function vd(r,t,e){const n=e.query(r);if(n==null)return t;if(n.prototype instanceof _t){const s={},i=n.value(r);if(i!=null)return s[n.blotName]=i,new B().insert(s,n.formats(r,e))}else if(n.prototype instanceof $n&&!Kn(t,`
|
||||
`)&&t.insert(`
|
||||
`),"blotName"in n&&"formats"in n&&typeof n.formats=="function")return je(t,n.blotName,n.formats(r,e),e);return t}function Ed(r,t){return Kn(t,`
|
||||
`)||t.insert(`
|
||||
`),t}function Ad(r,t,e){const n=e.query("code-block"),s=n&&"formats"in n&&typeof n.formats=="function"?n.formats(r,e):!0;return je(t,"code-block",s,e)}function Nd(){return new B}function wd(r,t,e){const n=e.query(r);if(n==null||n.blotName!=="list"||!Kn(t,`
|
||||
`))return t;let s=-1,i=r.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?t:t.reduce((o,a)=>a.insert?a.attributes&&typeof a.attributes.indent=="number"?o.push(a):o.insert(a.insert,{indent:s,...a.attributes||{}}):o,new B)}function Td(r,t,e){const n=r;let s=n.tagName==="OL"?"ordered":"bullet";const i=n.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),je(t,"list",s,e)}function wl(r,t,e){if(!Kn(t,`
|
||||
`)){if(be(r,e)&&(r.childNodes.length>0||r instanceof HTMLParagraphElement))return t.insert(`
|
||||
`);if(t.length()>0&&r.nextSibling){let n=r.nextSibling;for(;n!=null;){if(be(n,e))return t.insert(`
|
||||
`);const s=e.query(n);if(s&&s.prototype instanceof Rt)return t.insert(`
|
||||
`);n=n.firstChild}}}return t}function xd(r,t,e){var i;const n={},s=r.style||{};return s.fontStyle==="italic"&&(n.italic=!0),s.textDecoration==="underline"&&(n.underline=!0),s.textDecoration==="line-through"&&(n.strike=!0),((i=s.fontWeight)!=null&&i.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(n.bold=!0),t=Object.entries(n).reduce((o,a)=>{let[u,h]=a;return je(o,u,h,e)},t),parseFloat(s.textIndent||0)>0?new B().insert(" ").concat(t):t}function Ld(r,t,e){var s,i;const n=((s=r.parentElement)==null?void 0:s.tagName)==="TABLE"?r.parentElement:(i=r.parentElement)==null?void 0:i.parentElement;if(n!=null){const a=Array.from(n.querySelectorAll("tr")).indexOf(r)+1;return je(t,"table",a,e)}return t}function Sd(r,t,e){var s;let n=r.data;if(((s=r.parentElement)==null?void 0:s.tagName)==="O:P")return t.insert(n.trim());if(!So(r)){if(n.trim().length===0&&n.includes(`
|
||||
`)&&!bd(r,e))return t;const i=(o,a)=>{const u=a.replace(/[^\u00a0]/g,"");return u.length<1&&o?" ":u};n=n.replace(/\r\n/g," ").replace(/\n/g," "),n=n.replace(/\s\s+/g,i.bind(i,!0)),(r.previousSibling==null&&r.parentElement!=null&&be(r.parentElement,e)||r.previousSibling instanceof Element&&be(r.previousSibling,e))&&(n=n.replace(/^\s+/,i.bind(i,!1))),(r.nextSibling==null&&r.parentElement!=null&&be(r.parentElement,e)||r.nextSibling instanceof Element&&be(r.nextSibling,e))&&(n=n.replace(/\s+$/,i.bind(i,!1)))}return t.insert(n)}class _o extends Gt{constructor(e,n){super(e,n);O(this,"lastRecorded",0);O(this,"ignoreChange",!1);O(this,"stack",{undo:[],redo:[]});O(this,"currentRange",null);this.quill.on(N.events.EDITOR_CHANGE,(s,i,o,a)=>{s===N.events.SELECTION_CHANGE?i&&a!==N.sources.SILENT&&(this.currentRange=i):s===N.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===N.sources.USER?this.record(i,o):this.transform(i)),this.currentRange=ei(this.currentRange,i))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(e,n){if(this.stack[e].length===0)return;const s=this.stack[e].pop();if(!s)return;const i=this.quill.getContents(),o=s.delta.invert(i);this.stack[n].push({delta:o,range:ei(s.range,o)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,N.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,n){if(e.ops.length===0)return;this.stack.redo=[];let s=e.invert(n),i=this.currentRange;const o=Date.now();if(this.lastRecorded+this.options.delay>o&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(s=s.compose(a.delta),i=a.range)}else this.lastRecorded=o;s.length()!==0&&(this.stack.undo.push({delta:s,range:i}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Tl(this.stack.undo,e),Tl(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,N.sources.USER);else{const n=qd(this.quill.scroll,e.delta);this.quill.setSelection(n,N.sources.USER)}}}O(_o,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function Tl(r,t){let e=t;for(let n=r.length-1;n>=0;n-=1){const s=r[n];r[n]={delta:e.transform(s.delta,!0),range:s.range&&ei(s.range,e)},e=s.delta.transform(e),r[n].delta.length()===0&&r.splice(n,1)}}function _d(r,t){const e=t.ops[t.ops.length-1];return e==null?!1:e.insert!=null?typeof e.insert=="string"&&e.insert.endsWith(`
|
||||
`):e.attributes!=null?Object.keys(e.attributes).some(n=>r.query(n,D.BLOCK)!=null):!1}function qd(r,t){const e=t.reduce((s,i)=>s+(i.delete||0),0);let n=t.length()-e;return _d(r,t)&&(n-=1),n}function ei(r,t){if(!r)return r;const e=t.transformPosition(r.index),n=t.transformPosition(r.index+r.length);return{index:e,length:n-e}}class qo extends Gt{constructor(t,e){super(t,e),t.root.addEventListener("drop",n=>{var o;n.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(n.clientX,n.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(n.clientX,n.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&t.selection.normalizeNative(s);if(i){const a=t.selection.normalizedToRange(i);(o=n.dataTransfer)!=null&&o.files&&this.upload(a,n.dataTransfer.files)}})}upload(t,e){const n=[];Array.from(e).forEach(s=>{var i;s&&((i=this.options.mimetypes)!=null&&i.includes(s.type))&&n.push(s)}),n.length>0&&this.options.handler.call(this,t,n)}}qo.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(r,t){if(!this.quill.scroll.query("image"))return;const e=t.map(n=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(n)}));Promise.all(e).then(n=>{const s=n.reduce((i,o)=>i.insert({image:o}),new B().retain(r.index).delete(r.length));this.quill.updateContents(s,R.sources.USER),this.quill.setSelection(r.index+n.length,R.sources.SILENT)})}};const Od=["insertText","insertReplacementText"];class Cd extends Gt{constructor(t,e){super(t,e),t.root.addEventListener("beforeinput",n=>{this.handleBeforeInput(n)}),/Android/i.test(navigator.userAgent)||t.on(N.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(t){Ti({range:t,quill:this.quill})}replaceText(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t.length===0)return!1;if(e){const n=this.quill.getFormat(t.index,1);this.deleteRange(t),this.quill.updateContents(new B().retain(t.index).insert(e,n),N.sources.USER)}else this.deleteRange(t);return this.quill.setSelection(t.index+e.length,0,N.sources.SILENT),!0}handleBeforeInput(t){if(this.quill.composition.isComposing||t.defaultPrevented||!Od.includes(t.inputType))return;const e=t.getTargetRanges?t.getTargetRanges()[0]:null;if(!e||e.collapsed===!0)return;const n=Id(t);if(n==null)return;const s=this.quill.selection.normalizeNative(e),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,n)&&t.preventDefault()}handleCompositionStart(){const t=this.quill.getSelection();t&&this.replaceText(t)}}function Id(r){var t;return typeof r.data=="string"?r.data:(t=r.dataTransfer)!=null&&t.types.includes("text/plain")?r.dataTransfer.getData("text/plain"):null}const Rd=/Mac/i.test(navigator.platform),kd=100,Bd=r=>!!(r.key==="ArrowLeft"||r.key==="ArrowRight"||r.key==="ArrowUp"||r.key==="ArrowDown"||r.key==="Home"||Rd&&r.key==="a"&&r.ctrlKey===!0);class Md extends Gt{constructor(e,n){super(e,n);O(this,"isListening",!1);O(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,n){let{line:s,event:i}=n;if(!(s instanceof Ft)||!s.uiNode)return!0;const o=getComputedStyle(s.domNode).direction==="rtl";return o&&i.key!=="ArrowRight"||!o&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(i.shiftKey?1:0),N.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Bd(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+kd,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const n=e.getRangeAt(0);if(n.collapsed!==!0||n.startOffset!==0)return;const s=this.quill.scroll.find(n.startContainer);if(!(s instanceof Ft)||!s.uiNode)return;const i=document.createRange();i.setStartAfter(s.uiNode),i.setEndAfter(s.uiNode),e.removeAllRanges(),e.addRange(i)}}N.register({"blots/block":pt,"blots/block/embed":Rt,"blots/break":Kt,"blots/container":Me,"blots/cursor":an,"blots/embed":yi,"blots/inline":ee,"blots/scroll":en,"blots/text":Ht,"modules/clipboard":Lo,"modules/history":_o,"modules/keyboard":Dr,"modules/uploader":qo,"modules/input":Cd,"modules/uiNode":Md});class Dd extends zt{add(t,e){let n=0;if(e==="+1"||e==="-1"){const s=this.value(t)||0;n=e==="+1"?s+1:s-1}else typeof e=="number"&&(n=e);return n===0?(this.remove(t),!0):super.add(t,n.toString())}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e,10))}value(t){return parseInt(super.value(t),10)||void 0}}const jd=new Dd("indent","ql-indent",{scope:D.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class ni exten
Line truncated
|
||||
`)}
|
||||
`,i=It.formats(this.children.head.domNode);if(e||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const o=this.children.reduce((u,h)=>u.concat(fo(h,!1)),new B),a=t(s,i);o.diff(a).reduce((u,h)=>{let{retain:p,attributes:v}=h;return p?(v&&Object.keys(v).forEach(f=>{[It.blotName,ce.blotName].includes(f)&&this.formatAt(u,p,f,v[f])}),u+p):u},0)}this.cachedText=s,this.forceNext=!1}}html(t,e){const[n]=this.children.find(t);return`<pre data-language="${n?It.formats(n.domNode):"plain"}">
|
||||
${Mr(this.code(t,e))}
|
||||
</pre>`}optimize(t){if(super.optimize(t),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const e=It.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}kn.allowedChildren=[It];It.requiredContainer=kn;It.allowedChildren=[ce,an,Ht,Kt];const Pd=(r,t,e)=>{if(typeof r.versionString=="string"){const n=r.versionString.split(".")[0];if(parseInt(n,10)>=11)return r.highlight(e,{language:t}).value}return r.highlight(t,e).value};class Co extends Gt{static register(){N.register(ce,!0),N.register(It,!0),N.register(kn,!0)}constructor(t,e){if(super(t,e),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((n,s)=>{let{key:i}=s;return n[i]=!0,n},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(N.events.SCROLL_BLOT_MOUNT,t=>{if(!(t instanceof kn))return;const e=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(n=>{let{key:s,label:i}=n;const o=e.ownerDocument.createElement("option");o.textContent=i,o.setAttribute("value",s),e.appendChild(o)}),e.addEventListener("change",()=>{t.format(It.blotName,e.value),this.quill.root.focus(),this.highlight(t,!0)}),t.uiNode==null&&(t.attachUI(e),t.children.head&&(e.value=It.formats(t.children.head.domNode)))})}initTimer(){let t=null;this.quill.on(N.events.SCROLL_OPTIMIZE,()=>{t&&clearTimeout(t),t=setTimeout(()=>{this.highlight(),t=null},this.options.interval)})}highlight(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(N.sources.USER);const n=this.quill.getSelection();(t==null?this.quill.scroll.descendants(kn):[t]).forEach(i=>{i.highlight(this.highlightBlot,e)}),this.quill.update(N.sources.SILENT),n!=null&&this.quill.setSelection(n,N.sources.SILENT)}highlightBlot(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(e=this.languages[e]?e:"plain",e==="plain")return Mr(t).split(`
|
||||
`).reduce((s,i,o)=>(o!==0&&s.insert(`
|
||||
`,{[At.blotName]:e}),s.insert(i)),new B);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(At.className),n.innerHTML=Pd(this.options.hljs,e,t),xi(this.quill.scroll,n,[(s,i)=>{const o=In.value(s);return o?i.compose(new B().retain(i.length(),{[ce.blotName]:o})):i}],[(s,i)=>s.data.split(`
|
||||
`).reduce((o,a,u)=>(u!==0&&o.insert(`
|
||||
`,{[At.blotName]:e}),o.insert(a)),i)],new WeakMap)}}Co.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const Mn=class Mn extends pt{static create(t){const e=super.create();return t?e.setAttribute("data-row",t):e.setAttribute("data-row",Li()),e}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,e){t===Mn.blotName&&e?this.domNode.setAttribute("data-row",e):super.format(t,e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};O(Mn,"blotName","table"),O(Mn,"tagName","TD");let Ut=Mn;class ue extends Me{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),e=this.children.tail.formats(),n=this.next.children.head.formats(),s=this.next.children.tail.formats();return t.table===e.table&&t.table===n.table&&t.table===s.table}return!1}optimize(t){super.optimize(t),this.children.forEach(e=>{if(e.next==null)return;const n=e.formats(),s=e.next.formats();if(n.table!==s.table){const i=this.splitAfter(e);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}O(ue,"blotName","table-row"),O(ue,"tagName","TR");class Jt extends Me{}O(Jt,"blotName","table-body"),O(Jt,"tagName","TBODY");class un extends Me{balanceCells(){const t=this.descendants(ue),e=t.reduce((n,s)=>Math.max(s.children.length,n),0);t.forEach(n=>{new Array(e-n.children.length).fill(0).forEach(()=>{let s;n.children.head!=null&&(s=Ut.formats(n.children.head.domNode));const i=this.scroll.create(Ut.blotName,s);n.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(e=>e.children.at(t))}deleteColumn(t){const[e]=this.descendant(Jt);e==null||e.children.head==null||e.children.forEach(n=>{const s=n.children.at(t);s!=null&&s.remove()})}insertColumn(t){const[e]=this.descendant(Jt);e==null||e.children.head==null||e.children.forEach(n=>{const s=n.children.at(t),i=Ut.formats(n.children.head.domNode),o=this.scroll.create(Ut.blotName,i);n.insertBefore(o,s)})}insertRow(t){const[e]=this.descendant(Jt);if(e==null||e.children.head==null)return;const n=Li(),s=this.scroll.create(ue.blotName);e.children.head.children.forEach(()=>{const o=this.scroll.create(Ut.blotName,n);s.appendChild(o)});const i=e.children.at(t);e.insertBefore(s,i)}rows(){const t=this.children.head;return t==null?[]:t.children.map(e=>e)}}O(un,"blotName","table-container"),O(un,"tagName","TABLE");un.allowedChildren=[Jt];Jt.requiredContainer=un;Jt.allowedChildren=[ue];ue.requiredContainer=Jt;ue.allowedChildren=[Ut];Ut.requiredContainer=ue;function Li(){return`row-${Math.random().toString(36).slice(2,6)}`}class $d extends Gt{static register(){N.register(Ut),N.register(ue),N.register(Jt),N.register(un)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(un).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,e]=this.getTable();e!=null&&(t.deleteColumn(e.cellOffset()),this.quill.update(N.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(N.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const e=t.offset();t.remove(),this.quill.update(N.sources.USER),this.quill.setSelection(e,N.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[e,n]=this.quill.getLine(t.index);if(e==null||e.statics.blotName!==Ut.blotName)return[null,null,null,-1];const s=e.parent;return[s.parent.parent,s,e,n]}insertColumn(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(i==null)return;const o=i.cellOffset();n.insertColumn(o+t),this.quill.update(N.sources.USER);let a=s.rowOffset();t===0&&(a+=1),this.quill.setSelection(e.index+a,e.length,N.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const e=this.quill.getSelection();if(!e)return;const[n,s,i]=this.getTable(e);if(i==null)return;const o=s.rowOffset();n.insertRow(o+t),this.quill.update(N.sources.USER),t>0?this.quill.setSelection(e,N.sources.SILENT):this.quill.setSelection(e.index+s.children.length,e.length,N.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,e){const n=this.quill.getSelection();if(n==null)return;const s=new Array(t).fill(0).reduce(i=>{const o=new Array(e).fill(`
|
||||
`).join("");return i.insert(o,{table:Li()})},new B().retain(n.index));this.quill.updateContents(s,N.sources.USER),this.quill.setSelection(n.index,N.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(N.events.SCROLL_OPTIMIZE,t=>{t.some(e=>["TD","TR","TBODY","TABLE"].includes(e.target.tagName)?(this.quill.once(N.events.TEXT_CHANGE,(n,s,i)=>{i===N.sources.USER&&this.balanceTables()}),!0):!1)})}}const Sl=fe("quill:toolbar");class Si extends Gt{constructor(t,e){var n,s;if(super(t,e),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),Ud(i,this.options.container),(s=(n=t.container)==null?void 0:n.parentNode)==null||s.insertBefore(i,t.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Sl.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(i=>{var a;const o=(a=this.options.handlers)==null?void 0:a[i];o&&this.addHandler(i,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(N.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}addHandler(t,e){this.handlers[t]=e}attach(t){let e=Array.from(t.classList).find(s=>s.indexOf("ql-")===0);if(!e)return;if(e=e.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[e]==null&&this.quill.scroll.query(e)==null){Sl.warn("ignoring attaching to nonexistent format",e,t);return}const n=t.tagName==="SELECT"?"change":"click";t.addEventListener(n,s=>{let i;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const a=t.options[t.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else t.classList.contains("ql-active")?i=!1:i=t.value||!t.hasAttribute("value"),s.preventDefault();this.quill.focus();const[o]=this.quill.selection.getRange();if(this.handlers[e]!=null)this.handlers[e].call(this,i);else if(this.quill.scroll.query(e).prototype instanceof _t){if(i=prompt(`Enter ${e}`),!i)return;this.quill.updateContents(new B().retain(o.index).delete(o.length).insert({[e]:i}),N.sources.USER)}else this.quill.format(e,i,N.sources.USER);this.update(o)}),this.controls.push([e,t])}update(t){const e=t==null?{}:this.quill.getFormat(t);this.controls.forEach(n=>{const[s,i]=n;if(i.tagName==="SELECT"){let o=null;if(t==null)o=null;else if(e[s]==null)o=i.querySelector("option[selected]");else if(!Array.isArray(e[s])){let a=e[s];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),o=i.querySelector(`option[value="${a}"]`)}o==null?(i.value="",i.selectedIndex=-1):o.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const o=e[s],a=o===i.getAttribute("value")||o!=null&&o.toString()===i.getAttribute("value")||o==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const o=e[s]!=null;i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}})}}Si.DEFAULTS={};function _l(r,t,e){const n=document.createElement("button");n.setAttribute("type","button"),n.classList.add(`ql-${t}`),n.setAttribute("aria-pressed","false"),e!=null?(n.value=e,n.setAttribute("aria-label",`${t}: ${e}`)):n.setAttribute("aria-label",t),r.appendChild(n)}function Ud(r,t){Array.isArray(t[0])||(t=[t]),t.forEach(e=>{const n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(s=>{if(typeof s=="string")_l(n,s);else{const i=Object.keys(s)[0],o=s[i];Array.isArray(o)?Fd(n,i,o):_l(n,i,o)}}),r.appendChild(n)})}function Fd(r,t,e){const n=document.createElement("select");n.classList.add(`ql-${t}`),e.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),n.appendChild(i)}),r.appendChild(n)}Si.DEFAULTS={container:null,handlers:{clean(){const r=this.quill.getSelection();if(r!=null)if(r.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(e=>{this.quill.scroll.query(e,D.INLINE)!=null&&this.quill.format(e,!1,N.sources.USER)})}else this.quill.removeFormat(r.index,r.length,N.sources.USER)},direction(r){const{align:t}=this.quill.getFormat();r==="rtl"&&t==null?this.quill.format("align","right",N.sources.USER):!r&&t==="right"&&this.quill.format("align",!1,N.sources.USER),this.quill.format("direction",r,N.sources.USER)},indent(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t),n=parseInt(e.indent||0,10);if(r==="+1"||r==="-1"){let s=r==="+1"?1:-1;e.direction==="rtl"&&(s*=-1),this.quill.format("indent",n+s,N.sources.USER)}},link(r){r===!0&&(r=prompt("Enter link URL:")),this.quill.format("link",r,N.sources.USER)},list(r){const t=this.quill.getSelection(),e=this.quill.getFormat(t);r==="check"?e.list
Line truncated
|
||||
Reference in new issue
Block a user