From d683e983df62fa504b2f7e70d24ae57183476cb6 Mon Sep 17 00:00:00 2001 From: Serhii Kulykov Date: Tue, 1 Oct 2024 16:46:45 +0300 Subject: [PATCH] fix: bump Quill to fix error thrown on deleting text (#7899) --- packages/rich-text-editor/vendor/vaadin-quill.js | 2 +- packages/rich-text-editor/vendor/vaadin-quill.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rich-text-editor/vendor/vaadin-quill.js b/packages/rich-text-editor/vendor/vaadin-quill.js index e2ad4a5888..5cf03969ba 100644 --- a/packages/rich-text-editor/vendor/vaadin-quill.js +++ b/packages/rich-text-editor/vendor/vaadin-quill.js @@ -4,5 +4,5 @@ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com */ -!function(t,e){t.Quill=e()}(window,(()=>(()=>{var t={423:()=>{let t=document.createElement("div");if(t.classList.toggle("test-class",!1),t.classList.contains("test-class")){let t=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,n){return arguments.length>1&&!this.contains(e)==!n?n:t.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,i=arguments[1],o=0;o{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),o.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},o.prototype.listeners=function(t,e){var r=n?n+t:t,i=this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var o=0,s=i.length,l=new Array(s);o{var e=-1,n=1,r=0;function i(t,u,c,h){if(t===u)return t?[[r,t]]:[];if(null!=c){var f=function(t,e,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,o=t.length,s=e.length;if(0===r.length&&(null===i||0===i.length)){var l=r.index,a=t.slice(0,l),u=t.slice(l),c=i?i.index:null,h=l+s-o;if((null===c||c===h)&&!(h<0||h>s)){var f=e.slice(0,h);if((m=e.slice(h))===u){var p=Math.min(l,h);if((v=a.slice(0,p))===(_=f.slice(0,p)))return d(v,a.slice(p),f.slice(p),u)}}if(null===c||c===l){var g=l,m=(f=e.slice(0,g),e.slice(g));if(f===a){var y=Math.min(o-g,s-g);if((b=u.slice(u.length-y))===(N=m.slice(m.length-y)))return d(a,u.slice(0,u.length-y),m.slice(0,m.length-y),b)}}}if(r.length>0&&i&&0===i.length){var v=t.slice(0,r.index),b=t.slice(r.index+r.length);if(!(s<(p=v.length)+(y=b.length))){var _=e.slice(0,p),N=e.slice(s-y);if(v===_&&b===N)return d(v,t.slice(p,o-y),e.slice(p,s-y),b)}}return null}(t,u,c);if(f)return f}var p=s(t,u),g=t.substring(0,p);p=l(t=t.substring(p),u=u.substring(p));var m=t.substring(t.length-p),y=function(t,a){var u;if(!t)return[[n,a]];if(!a)return[[e,t]];var c=t.length>a.length?t:a,h=t.length>a.length?a:t,f=c.indexOf(h);if(-1!==f)return u=[[n,c.substring(0,f)],[r,h],[n,c.substring(f+h.length)]],t.length>a.length&&(u[0][0]=u[2][0]=e),u;if(1===h.length)return[[e,t],[n,a]];var d=function(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||2*r.length=t.length?[r,i,o,a,h]:null}var o,a,u,c,h,f=i(n,r,Math.ceil(n.length/4)),d=i(n,r,Math.ceil(n.length/2));if(!f&&!d)return null;o=d?f&&f[4].length>d[4].length?f:d:f;t.length>e.length?(a=o[0],u=o[1],c=o[2],h=o[3]):(c=o[0],h=o[1],a=o[2],u=o[3]);var p=o[4];return[a,u,c,h,p]}(t,a);if(d){var p=d[0],g=d[1],m=d[2],y=d[3],v=d[4],b=i(p,m),_=i(g,y);return b.concat([[r,v]],_)}return function(t,r){for(var i=t.length,s=r.length,l=Math.ceil((i+s)/2),a=l,u=2*l,c=new Array(u),h=new Array(u),f=0;fi)m+=2;else if(E>s)g+=2;else if(p){if((O=a+d-_)>=0&&O=(x=i-h[O]))return o(t,r,T,E)}}for(var A=-b+y;A<=b-v;A+=2){for(var x,O=a+A,w=(x=A===-b||A!==b&&h[O-1]i)v+=2;else if(w>s)y+=2;else if(!p){if((N=a+d-A)>=0&&N=(x=i-x))return o(t,r,T,E)}}}}return[[e,t],[n,r]]}(t,a)}(t=t.substring(0,t.length-p),u=u.substring(0,u.length-p));return g&&y.unshift([r,g]),m&&y.push([r,m]),a(y,h),y}function o(t,e,n,r){var o=t.substring(0,n),s=e.substring(0,r),l=t.substring(n),a=e.substring(r),u=i(o,s),c=i(l,a);return u.concat(c)}function s(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,o=0;n=0&&f(t[m][1])){var y=t[m][1].slice(-1);if(t[m][1]=t[m][1].slice(0,-1),p=y+p,g=y+g,!t[m][1]){t.splice(m,1),u--;var v=m-1;t[v]&&t[v][0]===n&&(d++,g=t[v][1]+g,v--),t[v]&&t[v][0]===e&&(c++,p=t[v][1]+p,v--),m=v}}if(h(t[u][1])){y=t[u][1].charAt(0);t[u][1]=t[u][1].slice(1),p+=y,g+=y}}if(u0||g.length>0){p.length>0&&g.length>0&&(0!==(o=s(g,p))&&(m>=0?t[m][1]+=g.substring(0,o):(t.splice(0,0,[r,g.substring(0,o)]),u++),g=g.substring(o),p=p.substring(o)),0!==(o=l(g,p))&&(t[u][1]=g.substring(g.length-o)+t[u][1],g=g.substring(0,g.length-o),p=p.substring(0,p.length-o)));var b=d+c;0===p.length&&0===g.length?(t.splice(u-b,b),u-=b):0===p.length?(t.splice(u-b,b,[n,g]),u=u-b+1):0===g.length?(t.splice(u-b,b,[e,p]),u=u-b+1):(t.splice(u-b,b,[e,p],[n,g]),u=u-b+2)}0!==u&&t[u-1][0]===r?(t[u-1][1]+=t[u][1],t.splice(u,1)):u++,d=0,c=0,p="",g=""}""===t[t.length-1][1]&&t.pop();var _=!1;for(u=1;u=55296&&t<=56319}function c(t){return t>=56320&&t<=57343}function h(t){return c(t.charCodeAt(0))}function f(t){return u(t.charCodeAt(t.length-1))}function d(t,i,o,s){return f(t)||h(s)?null:function(t){for(var e=[],n=0;n0&&e.push(t[n]);return e}([[r,t],[e,i],[n,o],[r,s]])}function p(t,e,n){return i(t,e,n,!0)}p.INSERT=n,p.DELETE=e,p.EQUAL=r,t.exports=p},739:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",s="[object Boolean]",l="[object Date]",a="[object Function]",u="[object GeneratorFunction]",c="[object Map]",h="[object Number]",f="[object Object]",d="[object Promise]",p="[object RegExp]",g="[object Set]",m="[object String]",y="[object Symbol]",v="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",N="[object Float32Array]",E="[object Float64Array]",A="[object Int8Array]",x="[object Int16Array]",O="[object Int32Array]",w="[object Uint8Array]",T="[object Uint8ClampedArray]",k="[object Uint16Array]",S="[object Uint32Array]",L=/\w*$/,j=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,q={};q[o]=q["[object Array]"]=q[b]=q[_]=q[s]=q[l]=q[N]=q[E]=q[A]=q[x]=q[O]=q[c]=q[h]=q[f]=q[p]=q[g]=q[m]=q[y]=q[w]=q[T]=q[k]=q[S]=!0,q["[object Error]"]=q[a]=q[v]=!1;var R="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,I="object"==typeof self&&self&&self.Object===Object&&self,B=R||I||Function("return this")(),D=e&&!e.nodeType&&e,P=D&&t&&!t.nodeType&&t,M=P&&P.exports===D;function U(t,e){return t.set(e[0],e[1]),t}function z(t,e){return t.add(e),t}function F(t,e,n,r){var i=-1,o=t?t.length:0;for(r&&o&&(n=t[++i]);++i-1},Tt.prototype.set=function(t,e){var n=this.__data__,r=Ct(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},kt.prototype.clear=function(){this.__data__={hash:new wt,map:new(pt||Tt),string:new wt}},kt.prototype.delete=function(t){return Dt(this,t).delete(t)},kt.prototype.get=function(t){return Dt(this,t).get(t)},kt.prototype.has=function(t){return Dt(this,t).has(t)},kt.prototype.set=function(t,e){return Dt(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new Tt},St.prototype.delete=function(t){return this.__data__.delete(t)},St.prototype.get=function(t){return this.__data__.get(t)},St.prototype.has=function(t){return this.__data__.has(t)},St.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Tt){var r=n.__data__;if(!pt||r.length<199)return r.push([t,e]),this;n=this.__data__=new kt(r)}return n.set(t,e),this};var Mt=ct?W(ct,Object):function(){return[]},Ut=function(t){return et.call(t)};function zt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||C.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=i}(t.length)&&!Yt(t)}var Gt=ht||function(){return!1};function Yt(t){var e=Vt(t)?et.call(t):"";return e==a||e==u}function Vt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return Ht(t)?Lt(t):function(t){if(!Ft(t))return ft(t);var e=[];for(var n in Object(t))tt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}t.exports=function(t){return qt(t,!0,!0)}},216:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,l="[object Arguments]",a="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",h="[object Date]",f="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Null]",v="[object Object]",b="[object Promise]",_="[object Proxy]",N="[object RegExp]",E="[object Set]",A="[object String]",x="[object Symbol]",O="[object Undefined]",w="[object WeakMap]",T="[object ArrayBuffer]",k="[object DataView]",S=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,j={};j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j[l]=j[a]=j[T]=j[c]=j[k]=j[h]=j[f]=j[d]=j[g]=j[m]=j[v]=j[N]=j[E]=j[A]=j[w]=!1;var C="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,q="object"==typeof self&&self&&self.Object===Object&&self,R=C||q||Function("return this")(),I=e&&!e.nodeType&&e,B=I&&t&&!t.nodeType&&t,D=B&&B.exports===I,P=D&&C.process,M=function(){try{return P&&P.binding&&P.binding("util")}catch(t){}}(),U=M&&M.isTypedArray;function z(t,e){for(var n=-1,r=null==t?0:t.length;++nu))return!1;var h=l.get(t);if(h&&l.get(e))return h==e;var f=-1,d=!0,p=n&o?new Tt:void 0;for(l.set(t,e),l.set(e,t);++f-1},Ot.prototype.set=function(t,e){var n=this.__data__,r=Lt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},wt.prototype.clear=function(){this.size=0,this.__data__={hash:new xt,map:new(ft||Ot),string:new xt}},wt.prototype.delete=function(t){var e=Pt(this,t).delete(t);return this.size-=e?1:0,e},wt.prototype.get=function(t){return Pt(this,t).get(t)},wt.prototype.has=function(t){return Pt(this,t).has(t)},wt.prototype.set=function(t,e){var n=Pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Tt.prototype.add=Tt.prototype.push=function(t){return this.__data__.set(t,r),this},Tt.prototype.has=function(t){return this.__data__.has(t)},kt.prototype.clear=function(){this.__data__=new Ot,this.size=0},kt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},kt.prototype.get=function(t){return this.__data__.get(t)},kt.prototype.has=function(t){return this.__data__.has(t)},kt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ot){var r=n.__data__;if(!ft||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new wt(r)}return n.set(t,e),this.size=n.size,this};var Ut=at?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n-1&&t%1==0&&t-1&&t%1==0&&t<=s}function Xt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Zt(t){return null!=t&&"object"==typeof t}var Qt=U?function(t){return function(e){return t(e)}}(U):function(t){return Zt(t)&&Vt(t.length)&&!!j[jt(t)]};function Jt(t){return null!=(e=t)&&Vt(e.length)&&!Yt(e)?St(t):It(t);var e}t.exports=function(t,e){return qt(t,e)}},124:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",s="[object AsyncFunction]",l="[object Function]",a="[object GeneratorFunction]",u="[object Null]",c="[object Object]",h="[object Proxy]",f="[object Undefined]",d=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[o]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[l]=g["[object Map]"]=g["[object Number]"]=g[c]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,v=m||y||Function("return this")(),b=e&&!e.nodeType&&e,_=b&&t&&!t.nodeType&&t,N=_&&_.exports===b,E=N&&m.process,A=function(){try{var t=_&&_.require&&_.require("util").types;return t||E&&E.binding&&E.binding("util")}catch(t){}}(),x=A&&A.isTypedArray;var O,w,T,k=Array.prototype,S=Function.prototype,L=Object.prototype,j=v["__core-js_shared__"],C=S.toString,q=L.hasOwnProperty,R=(O=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",I=L.toString,B=C.call(Object),D=RegExp("^"+C.call(q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=N?v.Buffer:void 0,M=v.Symbol,U=v.Uint8Array,z=P?P.allocUnsafe:void 0,F=(w=Object.getPrototypeOf,T=Object,function(t){return w(T(t))}),K=Object.create,$=L.propertyIsEnumerable,W=k.splice,H=M?M.toStringTag:void 0,G=function(){try{var t=bt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=P?P.isBuffer:void 0,V=Math.max,X=Date.now,Z=bt(v,"Map"),Q=bt(Object,"create"),J=function(){function t(){}return function(e){if(!jt(e))return{};if(K)return K(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function tt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},et.prototype.set=function(t,e){var n=this.__data__,r=lt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},nt.prototype.clear=function(){this.size=0,this.__data__={hash:new tt,map:new(Z||et),string:new tt}},nt.prototype.delete=function(t){var e=vt(this,t).delete(t);return this.size-=e?1:0,e},nt.prototype.get=function(t){return vt(this,t).get(t)},nt.prototype.has=function(t){return vt(this,t).has(t)},nt.prototype.set=function(t,e){var n=vt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},rt.prototype.clear=function(){this.__data__=new et,this.size=0},rt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},rt.prototype.get=function(t){return this.__data__.get(t)},rt.prototype.has=function(t){return this.__data__.has(t)},rt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof et){var r=n.__data__;if(!Z||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new nt(r)}return n.set(t,e),this.size=n.size,this};var ut,ct=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var l=o[ut?s:++r];if(!1===e(i[l],l,i))break}return t};function ht(t){return null==t?void 0===t?f:u:H&&H in Object(t)?function(t){var e=q.call(t,H),n=t[H];try{t[H]=void 0;var r=!0}catch(t){}var i=I.call(t);r&&(e?t[H]=n:delete t[H]);return i}(t):function(t){return I.call(t)}(t)}function ft(t){return Ct(t)&&ht(t)==o}function dt(t){return!(!jt(t)||function(t){return!!R&&R in t}(t))&&(St(t)?D:d).test(function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function pt(t){if(!jt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Nt(t),n=[];for(var r in t)("constructor"!=r||!e&&q.call(t,r))&&n.push(r);return n}function gt(t,e,n,r,i){t!==e&&ct(e,(function(o,s){if(i||(i=new rt),jt(o))!function(t,e,n,r,i,o,s){var l=Et(t,n),a=Et(e,n),u=s.get(a);if(u)return void ot(t,n,u);var h=o?o(l,a,n+"",t,e,s):void 0,f=void 0===h;if(f){var d=wt(a),p=!d&&kt(a),g=!d&&!p&&qt(a);h=a,d||p||g?wt(l)?h=l:Ct(_=l)&&Tt(_)?h=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(yt);function xt(t,e){return t===e||t!=t&&e!=e}var Ot=ft(function(){return arguments}())?ft:function(t){return Ct(t)&&q.call(t,"callee")&&!$.call(t,"callee")},wt=Array.isArray;function Tt(t){return null!=t&&Lt(t.length)&&!St(t)}var kt=Y||function(){return!1};function St(t){if(!jt(t))return!1;var e=ht(t);return e==l||e==a||e==s||e==h}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}function jt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ct(t){return null!=t&&"object"==typeof t}var qt=x?function(t){return function(e){return t(e)}}(x):function(t){return Ct(t)&&Lt(t.length)&&!!g[ht(t)]};function Rt(t){return Tt(t)?it(t,!0):pt(t)}var It,Bt=(It=function(t,e,n){gt(t,e,n)},mt((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(t,e,n){if(!jt(n))return!1;var r=typeof e;return!!("number"==r?Tt(n)&&_t(e,n.length):"string"==r&&e in n)&&xt(n[e],t)}(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n1)return e.map((function(e){return t(e)}));var r=e[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new o("Invalid definition");if("abstract"===r.blotName)throw new o("Cannot register abstract class");return c[r.blotName||r.attrName]=r,"string"==typeof r.keyName?l[r.keyName]=r:(null!=r.className&&(a[r.className]=r),null!=r.tagName&&(Array.isArray(r.tagName)?r.tagName=r.tagName.map((function(t){return t.toUpperCase()})):r.tagName=r.tagName.toUpperCase(),(Array.isArray(r.tagName)?r.tagName:[r.tagName]).forEach((function(t){null!=u[t]&&null!=r.className||(u[t]=r)})))),r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var i=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|i:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,(function(t){return t.name}))},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){return null!=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=i},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(11),s=n(5),l=n(0),a=function(t){function e(e){var n=t.call(this,e)||this;return n.build(),n}return i(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){t.prototype.attach.call(this),this.children.forEach((function(t){t.attach()}))},e.prototype.build=function(){var t=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach((function(e){try{var n=u(e);t.insertBefore(n,t.children.head||void 0)}catch(t){if(t instanceof l.ParchmentError)return;throw t}}))},e.prototype.deleteAt=function(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,(function(t,e,n){t.deleteAt(e,n)}))},e.prototype.descendant=function(t,n){var r=this.children.find(n),i=r[0],o=r[1];return null==t.blotName&&t(i)||null!=t.blotName&&i instanceof t?[i,o]:i instanceof e?i.descendant(t,o):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var i=[],o=r;return this.children.forEachAt(n,r,(function(n,r,s){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&i.push(n),n instanceof e&&(i=i.concat(n.descendants(t,r,o))),o-=s})),i},e.prototype.detach=function(){this.children.forEach((function(t){t.detach()})),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,(function(t,e,i){t.formatAt(e,i,n,r)}))},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),i=r[0],o=r[1];if(i)i.insertAt(o,e,n);else{var s=null==n?l.create("text",e):l.create(e,n);this.appendChild(s)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some((function(e){return t instanceof e})))throw new l.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce((function(t,e){return t+e.length()}),0)},e.prototype.moveChildren=function(t,e){this.children.forEach((function(n){t.insertBefore(n,e)}))},e.prototype.optimize=function(e){if(t.prototype.optimize.call(this,e),0===this.children.length)if(null!=this.statics.defaultChild){var n=l.create(this.statics.defaultChild);this.appendChild(n),n.optimize(e)}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),i=r[0],o=r[1],s=[[this,t]];return i instanceof e?s.concat(i.path(o,n)):(null!=i&&s.push([i,o]),s)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),(function(t,r,i){t=t.split(r,e),n.appendChild(t)})),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t,e){var n=this,r=[],i=[];t.forEach((function(t){t.target===n.domNode&&"childList"===t.type&&(r.push.apply(r,t.addedNodes),i.push.apply(i,t.removedNodes))})),i.forEach((function(t){if(!(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var e=l.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==n.domNode||e.detach())}})),r.filter((function(t){return t.parentNode==n.domNode})).sort((function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1})).forEach((function(t){var e=null;null!=t.nextSibling&&(e=l.find(t.nextSibling));var r=u(t);r.next==e&&null!=r.next||(null!=r.parent&&r.parent.removeChild(n),n.insertBefore(r,e||void 0))}))},e}(s.default);function u(t){var e=l.find(t);if(null==e)try{e=l.create(t)}catch(n){e=l.create(l.Scope.INLINE),[].slice.call(t.childNodes).forEach((function(t){e.domNode.appendChild(t)})),t.parentNode&&t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}e.default=a},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),s=n(6),l=n(2),a=n(0),u=function(t){function e(e){var n=t.call(this,e)||this;return n.attributes=new s.default(n.domNode),n}return i(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.format=function(t,e){var n=a.query(t);n instanceof o.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e,n){var r=this;t.prototype.update.call(this,e,n),e.some((function(t){return t.target===r.domNode&&"attributes"===t.type}))&&this.attributes.build()},e.prototype.wrap=function(n,r){var i=t.prototype.wrap.call(this,n,r);return i instanceof e&&i.statics.scope===this.statics.scope&&this.attributes.move(i),i},e}(l.default);e.default=u},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(5),s=n(0),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return(t={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=s.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,i){var o=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&i)o.wrap(n,i);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var s=r.create(this.statics.scope);o.wrap(s),s.format(n,i)}},t.prototype.insertAt=function(t,e,n){var i=null==n?r.create("text",e):r.create(e,n),o=this.split(t);this.parent.insertBefore(i,o)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=n(7),o=n(8),s=n(0),l=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=i.default.keys(this.domNode),l=o.default.keys(this.domNode);e.concat(n).concat(l).forEach((function(e){var n=s.query(e,s.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)}))},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach((function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)}))},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach((function(t){e.attributes[t].remove(e.domNode)})),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce((function(e,n){return e[n]=t.attributes[n].value(t.domNode),e}),{})},t}();e.default=l},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function o(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((function(t){return 0===t.indexOf(e+"-")}))}Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map((function(t){return t.split("-").slice(0,-1).join("-")}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){o(t,this.keyName).forEach((function(e){t.classList.remove(e)})),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=(o(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},e}(n(1).default);e.default=s},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function o(t){var e=t.split("-"),n=e.slice(1).map((function(t){return t[0].toUpperCase()+t.slice(1)})).join("");return e[0]+n}Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map((function(t){return t.split(":")[0].trim()}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[o(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[o(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[o(this.keyName)];return this.canAdd(t,e)?e:""},e}(n(1).default);e.default=s},function(t,e,n){t.exports=n(10)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(3),o=n(4),s=n(12),l=n(13),a=n(14),u=n(15),c=n(16),h=n(1),f=n(7),d=n(8),p=n(6),g=n(0),m={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:r.default,Format:i.default,Leaf:o.default,Embed:u.default,Scroll:s.default,Block:a.default,Inline:l.default,Text:c.default,Attributor:{Attribute:h.default,Class:f.default,Style:d.default,Store:p.default}};e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var i=n.length();if(ts?n(r,t-s,Math.min(e,s+a-t)):n(r,0,Math.min(a,t+e-s)),s+=a}},t.prototype.map=function(t){return this.reduce((function(e,n){return e.push(t(n)),e}),[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),s=n(0),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},a=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver((function(t){n.update(t)})),n.observer.observe(n.domNode,l),n.attach(),n}return i(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach((function(t){t.remove()})):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,i){this.update(),t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var i=[].slice.call(this.observer.takeRecords());i.length>0;)e.push(i.pop());for(var l=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[s.DATA_KEY].mutations&&(t.domNode[s.DATA_KEY].mutations=[]),e&&l(t.parent))},a=function(t){null!=t.domNode[s.DATA_KEY]&&null!=t.domNode[s.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(a),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach((function(t){var e=s.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(l(s.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,(function(t){var e=s.find(t,!1);l(e,!1),e instanceof o.default&&e.children.forEach((function(t){l(t,!1)}))}))):"attributes"===t.type&&l(e.prev)),l(e))})),this.children.forEach(a),i=(u=[].slice.call(this.observer.takeRecords())).slice();i.length>0;)e.push(i.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),(e=e||this.observer.takeRecords()).map((function(t){var e=s.find(t.target,!0);return null==e?null:null==e.domNode[s.DATA_KEY].mutations?(e.domNode[s.DATA_KEY].mutations=[t],e):(e.domNode[s.DATA_KEY].mutations.push(t),null)})).forEach((function(t){null!=t&&t!==r&&null!=t.domNode[s.DATA_KEY]&&t.update(t.domNode[s.DATA_KEY].mutations||[],n)})),null!=this.domNode[s.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=s.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);e.default=a},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=n(0),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var i=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach((function(t){t instanceof o.default||(t=t.wrap(e.blotName,!0)),i.attributes.copy(t)})),this.unwrap())},e.prototype.formatAt=function(e,n,r,i){null!=this.formats()[r]||s.query(r,s.Scope.ATTRIBUTE)?this.isolate(e,n).format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var i=this.next;i instanceof e&&i.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}(r,i.formats())&&(i.moveChildren(this),i.remove())},e.blotName="inline",e.scope=s.Scope.INLINE_BLOT,e.tagName="SPAN",e}(o.default);e.default=l},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=n(0),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.formats=function(n){var r=s.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=s.query(n,s.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,i){null!=s.query(r,s.Scope.BLOCK)?this.format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=s.query(n,s.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var i=this.split(e),o=s.create(n,r);i.parent.insertBefore(o,i)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=s.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);e.default=l},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,i){0===e&&n===this.length()?this.format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(n(4).default);e.default=o},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),s=n(0),l=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return i(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=s.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some((function(t){return"characterData"===t.type&&t.target===n.domNode}))&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=s.Scope.INLINE_BLOT,e}(o.default);e.default=l}])},t.exports=e()},204:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i,o=r(n(739)),s=r(n(216));!function(t){t.compose=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=o.default(e);for(var i in n||(r=Object.keys(r).reduce((function(t,e){return null!=r[e]&&(t[e]=r[e]),t}),{})),t)void 0!==t[i]&&void 0===e[i]&&(r[i]=t[i]);return Object.keys(r).length>0?r:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce((function(n,r){return s.default(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n}),{});return Object.keys(n).length>0?n:void 0},t.invert=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),t=t||{};var n=Object.keys(e).reduce((function(n,r){return e[r]!==t[r]&&void 0!==t[r]&&(n[r]=e[r]),n}),{});return Object.keys(t).reduce((function(n,r){return t[r]!==e[r]&&void 0===e[r]&&(n[r]=null),n}),n)},t.transform=function(t,e,n){if(void 0===n&&(n=!1),"object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce((function(n,r){return void 0===t[r]&&(n[r]=e[r]),n}),{});return Object.keys(r).length>0?r:void 0}}}(i||(i={})),e.default=i},802:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=r(n(284)),o=r(n(739)),s=r(n(216)),l=r(n(204)),a=r(n(933)),u=String.fromCharCode(0),c=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var n={};return"string"==typeof t&&0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},t.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=o.default(t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(s.default(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],n=[];return this.forEach((function(r){(t(r)?e:n).push(r)})),[e,n]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+a.default.length(e):e.delete?t-e.delete:t}),0)},t.prototype.length=function(){return this.reduce((function(t,e){return t+a.default.length(e)}),0)},t.prototype.slice=function(e,n){void 0===e&&(e=0),void 0===n&&(n=1/0);for(var r=[],i=a.default.iterator(this.ops),o=0;o0&&r.next(o.retain-u)}for(var c=new t(i);n.hasNext()||r.hasNext();)if("insert"===r.peekType())c.push(r.next());else if("delete"===n.peekType())c.push(n.next());else{var h=Math.min(n.peekLength(),r.peekLength()),f=n.next(h),d=r.next(h);if("number"==typeof d.retain){var p={};"number"==typeof f.retain?p.retain=h:p.insert=f.insert;var g=l.default.compose(f.attributes,d.attributes,"number"==typeof f.retain);if(g&&(p.attributes=g),c.push(p),!r.hasNext()&&s.default(c.ops[c.ops.length-1],p)){var m=new t(n.rest());return c.concat(m).chop()}}else"number"==typeof d.delete&&"number"==typeof f.retain&&c.push(d)}return c.chop()},t.prototype.concat=function(e){var n=new t(this.ops.slice());return e.ops.length>0&&(n.push(e.ops[0]),n.ops=n.ops.concat(e.ops.slice(1))),n},t.prototype.diff=function(e,n){if(this.ops===e.ops)return new t;var r=[this,e].map((function(t){return t.map((function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:u;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join("")})),o=new t,c=i.default(r[0],r[1],n),h=a.default.iterator(this.ops),f=a.default.iterator(e.ops);return c.forEach((function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case i.default.INSERT:n=Math.min(f.peekLength(),e),o.push(f.next(n));break;case i.default.DELETE:n=Math.min(e,h.peekLength()),h.next(n),o.delete(n);break;case i.default.EQUAL:n=Math.min(h.peekLength(),f.peekLength(),e);var r=h.next(n),a=f.next(n);s.default(r.insert,a.insert)?o.retain(n,l.default.diff(r.attributes,a.attributes)):o.push(a).delete(n)}e-=n}})),o.chop()},t.prototype.eachLine=function(e,n){void 0===n&&(n="\n");for(var r=a.default.iterator(this.ops),i=new t,o=0;r.hasNext();){if("insert"!==r.peekType())return;var s=r.peek(),l=a.default.length(s)-r.peekLength(),u="string"==typeof s.insert?s.insert.indexOf(n,l)-l:-1;if(u<0)i.push(r.next());else if(u>0)i.push(r.next(u));else{if(!1===e(i,r.next(1).attributes||{},o))return;o+=1,i=new t}}i.length()>0&&e(i,{},o)},t.prototype.invert=function(e){var n=new t;return this.reduce((function(t,r){if(r.insert)n.delete(a.default.length(r));else{if(r.retain&&null==r.attributes)return n.retain(r.retain),t+r.retain;if(r.delete||r.retain&&r.attributes){var i=r.delete||r.retain;return e.slice(t,t+i).forEach((function(t){r.delete?n.push(t):r.retain&&r.attributes&&n.retain(a.default.length(t),l.default.invert(r.attributes,t.attributes))})),t+i}}return t}),0),n.chop()},t.prototype.transform=function(e,n){if(void 0===n&&(n=!1),n=!!n,"number"==typeof e)return this.transformPosition(e,n);for(var r=e,i=a.default.iterator(this.ops),o=a.default.iterator(r.ops),s=new t;i.hasNext()||o.hasNext();)if("insert"!==i.peekType()||!n&&"insert"===o.peekType())if("insert"===o.peekType())s.push(o.next());else{var u=Math.min(i.peekLength(),o.peekLength()),c=i.next(u),h=o.next(u);if(c.delete)continue;h.delete?s.push(h):s.retain(u,l.default.transform(c.attributes,h.attributes,n))}else s.retain(a.default.length(i.next()));return s.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var n=a.default.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var i=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(r=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?i.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(r)}return[]},t}();e.default=o},933:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i,o=r(n(908));!function(t){t.iterator=function(t){return new o.default(t)},t.length=function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}}(i||(i={})),e.default=i}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};return(()=>{"use strict";n.d(r,{default:()=>Ie});var t=n(538),e=n.n(t),i=(n(423),n(124)),o=n.n(i),s=n(802),l=n.n(s),a=n(739),u=n.n(a),c=n(216),h=n.n(c);class f extends e().Embed{static value(){}insertInto(t,e){0===t.children.length?super.insertInto(t,e):this.remove()}length(){return 0}value(){return""}}f.blotName="break",f.tagName="BR";const d=f;class p extends e().Text{}const g=p;class m extends e().Inline{static compare(t,e){let n=m.order.indexOf(t),r=m.order.indexOf(e);return n>=0||r>=0?n-r:t===e?0:t0){let t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}m.allowedChildren=[m,e().Embed,g],m.order=["cursor","inline","underline","strike","italic","bold","script","link","code"];const y=m;class v extends e().Embed{attach(){super.attach(),this.attributes=new(e().Attributor.Store)(this.domNode)}delta(){return(new(l())).insert(this.value(),o()(this.formats(),this.attributes.values()))}format(t,n){let r=e().query(t,e().Scope.BLOCK_ATTRIBUTE);null!=r&&this.attributes.attribute(r,n)}formatAt(t,e,n,r){this.format(n,r)}insertAt(t,n,r){if("string"==typeof n&&n.endsWith("\n")){let r=e().create(b.blotName);this.parent.insertBefore(r,0===t?this:this.next),r.insertAt(0,n.slice(0,-1))}else super.insertAt(t,n,r)}}v.scope=e().Scope.BLOCK_BLOT;class b extends e().Block{constructor(t){super(t),this.cache={}}delta(){return null==this.cache.delta&&(this.cache.delta=this.descendants(e().Leaf).reduce(((t,e)=>0===e.length()?t:t.insert(e.value(),_(e))),new(l())).insert("\n",_(this))),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,n,r,i){n<=0||(e().query(r,e().Scope.BLOCK)?t+n===this.length()&&this.format(r,i):super.formatAt(t,Math.min(n,this.length()-t-1),r,i),this.cache={})}insertAt(t,e,n){if(null!=n)return super.insertAt(t,e,n);if(0===e.length)return;let r=e.split("\n"),i=r.shift();i.length>0&&(t1&&void 0!==arguments[1]&&arguments[1];if(e&&(0===t||t>=this.length()-1)){let e=this.clone();return 0===t?(this.parent.insertBefore(e,this),this):(this.parent.insertBefore(e,this.next),e)}{let n=super.split(t,e);return this.cache={},n}}}function _(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=o()(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:_(t.parent,e))}b.blotName="block",b.tagName="P",b.defaultChild="break",b.allowedChildren=[y,e().Embed,g];class N extends y{}N.blotName="code",N.tagName="CODE";class E extends b{static create(t){let e=super.create(t);return e.setAttribute("spellcheck",!1),e}static formats(){return!0}delta(){let t=this.domNode.textContent;return t.endsWith("\n")&&(t=t.slice(0,-1)),t.split("\n").reduce(((t,e)=>t.insert(e).insert("\n",this.formats())),new(l()))}format(t,e){if(t===this.statics.blotName&&e)return;let[n]=this.descendant(g,this.length()-1);null!=n&&n.deleteAt(n.length()-1,1),super.format(t,e)}formatAt(t,n,r,i){if(0===n)return;if(null==e().query(r,e().Scope.BLOCK)||r===this.statics.blotName&&i===this.statics.formats(this.domNode))return;let o=this.newlineIndex(t);if(o<0||o>=t+n)return;let s=this.newlineIndex(t,!0)+1,l=o-s+1,a=this.isolate(s,l),u=a.next;a.format(r,i),u instanceof E&&u.formatAt(0,t-s+n-l,r,i)}insertAt(t,e,n){if(null!=n)return;let[r,i]=this.descendant(g,t);r.insertAt(i,e)}length(){let t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}newlineIndex(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,t).lastIndexOf("\n");{let e=this.domNode.textContent.slice(t).indexOf("\n");return e>-1?t+e:-1}}optimize(t){this.domNode.textContent.endsWith("\n")||this.appendChild(e().create("text","\n")),super.optimize(t);let n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}replace(t){super.replace(t),[].slice.call(this.domNode.querySelectorAll("*")).forEach((function(t){let n=e().find(t);null==n?t.parentNode.removeChild(t):n instanceof e().Embed?n.remove():n.unwrap()}))}}E.blotName="code-block",E.tagName="PRE",E.TAB=" ";class A extends e().Embed{static value(){}constructor(t,e){super(t),this.selection=e,this.textNode=document.createTextNode(A.CONTENTS),this.domNode.appendChild(this.textNode),this._length=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(t,n){if(0!==this._length)return super.format(t,n);let r=this,i=0;for(;null!=r&&r.statics.scope!==e().Scope.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;null!=r&&(this._length=A.CONTENTS.length,r.optimize(),r.formatAt(i,A.CONTENTS.length,t,n),this._length=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this._length}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return;let t,n,r,i=this.textNode,o=this.selection.getNativeRange();for(null!=o&&o.start.node===i&&o.end.node===i&&([t,n,r]=[i,o.start.offset,o.end.offset]);null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==A.CONTENTS){let n=this.textNode.data.split(A.CONTENTS).join("");this.next instanceof g?(t=this.next.domNode,this.next.insertAt(0,n),this.textNode.data=A.CONTENTS):(this.textNode.data=n,this.parent.insertBefore(e().create(this.textNode),this),this.textNode=document.createTextNode(A.CONTENTS),this.domNode.appendChild(this.textNode))}return this.remove(),null!=n?([n,r]=[n,r].map((function(e){return Math.max(0,Math.min(t.data.length,e-1))})),{startNode:t,startOffset:n,endNode:t,endOffset:r}):void 0}update(t,e){if(t.some((t=>"characterData"===t.type&&t.target===this.textNode))){let t=this.restore();t&&(e.range=t)}}value(){return""}}A.blotName="cursor",A.className="ql-cursor",A.tagName="span",A.CONTENTS="\ufeff";const x=A,O=/^[ -~]*$/;function w(t,e){return Object.keys(e).reduce((function(n,r){return null==t[r]||(e[r]===t[r]?n[r]=e[r]:Array.isArray(e[r])?e[r].indexOf(t[r])<0&&(n[r]=e[r].concat([t[r]])):n[r]=[e[r],t[r]]),n}),{})}const T=class{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){let n=!1;this.scroll.update();let r=this.scroll.length();return this.scroll.batchStart(),(t=function(t){return t.reduce((function(t,e){if(1===e.insert){let n=u()(e.attributes);return delete n.image,t.insert({image:e.attributes.image},n)}if(null==e.attributes||!0!==e.attributes.list&&!0!==e.attributes.bullet||((e=u()(e)).attributes.list?e.attributes.list="ordered":(e.attributes.list="bullet",delete e.attributes.bullet)),"string"==typeof e.insert){let n=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(n,e.attributes)}return t.push(e)}),new(l()))}(t)).reduce(((t,i)=>{let l=i.retain||i.delete||i.insert.length||1,a=i.attributes||{};if(null!=i.insert){if("string"==typeof i.insert){let l=i.insert;l.endsWith("\n")&&n&&(n=!1,l=l.slice(0,-1)),t>=r&&!l.endsWith("\n")&&(n=!0),this.scroll.insertAt(t,l);let[u,c]=this.scroll.line(t),h=o()({},_(u));if(u instanceof b){let[t]=u.descendant(e().Leaf,c);h=o()(h,_(t))}a=s.AttributeMap.diff(h,a)||{}}else if("object"==typeof i.insert){let e=Object.keys(i.insert)[0];if(null==e)return t;this.scroll.insertAt(t,e,i.insert[e])}r+=l}return Object.keys(a).forEach((e=>{this.scroll.formatAt(t,l,e,a[e])})),t+l}),0),t.reduce(((t,e)=>"number"==typeof e.delete?(this.scroll.deleteAt(t,e.delete),t):t+(e.retain||e.insert.length||1)),0),this.scroll.batchEnd(),this.update(t)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update((new(l())).retain(t).delete(e))}formatLine(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(n).forEach((r=>{if(null!=this.scroll.whitelist&&!this.scroll.whitelist[r])return;let i=this.scroll.lines(t,Math.max(e,1)),o=e;i.forEach((e=>{let i=e.length();if(e instanceof E){let i=t-e.offset(this.scroll),s=e.newlineIndex(i+o)-i+1;e.formatAt(i,s,r,n[r])}else e.format(r,n[r]);o-=i}))})),this.scroll.optimize(),this.update((new(l())).retain(t).retain(e,u()(n)))}formatText(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(n).forEach((r=>{this.scroll.formatAt(t,e,r,n[r])})),this.update((new(l())).retain(t).retain(e,u()(n)))}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce(((t,e)=>t.concat(e.delta())),new(l()))}getFormat(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],i=[];0===n?this.scroll.path(t).forEach((function(t){let[n]=t;n instanceof b?r.push(n):n instanceof e().Leaf&&i.push(n)})):(r=this.scroll.lines(t,n),i=this.scroll.descendants(e().Leaf,t,n));const[o,s]=[r,i].map((function(t){if(0===t.length)return{};let e=_(t.shift());for(;Object.keys(e).length>0;){let n=t.shift();if(null==n)return e;e=w(_(n),e)}return e}));return{...o,...s}}getText(t,e){return this.getContents(t,e).filter((function(t){return"string"==typeof t.insert})).map((function(t){return t.insert})).join("")}insertEmbed(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new(l())).retain(t).insert({[e]:n}))}insertText(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(n).forEach((r=>{this.scroll.formatAt(t,e.length,r,n[r])})),this.update((new(l())).retain(t).insert(e,u()(n)))}isBlank(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;let t=this.scroll.children.head;return t.statics.blotName===b.blotName&&(!(t.children.length>1)&&t.children.head instanceof d)}removeFormat(t,e){let n=this.getText(t,e),[r,i]=this.scroll.line(t+e),o=0,s=new(l());null!=r&&(o=r instanceof E?r.newlineIndex(i)-i+1:r.length()-i,s=r.delta().slice(i,i+o-1).insert("\n"));let a=this.getContents(t,e+o).diff((new(l())).insert(n).concat(s)),u=(new(l())).retain(t).concat(a);return this.applyDelta(u)}update(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=this.delta;if(1===n.length&&"characterData"===n[0].type&&n[0].target.data.match(O)&&e().find(n[0].target)){let o=e().find(n[0].target),s=_(o),a=o.offset(this.scroll),u=n[0].oldValue.replace(x.CONTENTS,""),c=(new(l())).insert(u),h=(new(l())).insert(o.value());t=(new(l())).retain(a).concat(c.diff(h,r)).reduce((function(t,e){return e.insert?t.insert(e.insert,s):t.push(e)}),new(l())),this.delta=i.compose(t)}else this.delta=this.getDelta(),t&&h()(i.compose(t),this.delta)||(t=i.diff(this.delta,r));return t}};var k=n(418),S=n.n(k);let L=["error","warn","log","info"],j="warn";function C(t){if(L.indexOf(t)<=L.indexOf(j)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r{t.handleDOM(...e)}))}))}));class P extends(S()){constructor(){super(),this.listeners={},this.on("error",I.error)}emit(){I.log.apply(I,arguments),super.emit.apply(this,arguments)}connect(){B.push(this)}disconnect(){B.splice(B.indexOf(this),1)}handleDOM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r{if(!D||e.getRootNode()===document)return t.contains(e);for(;!t.contains(e);){const t=e.getRootNode();if(!t||!t.host)return!1;e=t.host}return!0})(r,i))&&o(t,...n)}))}listenDOM(t,e,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push({node:e,handler:n})}}P.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},P.sources={API:"api",SILENT:"silent",USER:"user"};const M=P;class U{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=t,this.options=e}}U.DEFAULTS={};const z=U,F="function"==typeof window.ShadowRoot.prototype.getSelection,K=window.InputEvent&&"function"==typeof window.InputEvent.prototype.getTargetRanges,$=window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,W=!(!window.navigator.userAgent.match(/Trident/)||window.navigator.userAgent.match(/MSIE/)),H=window.navigator.userAgent.match(/Edge/);let G=!1;class Y{constructor(){this._ranges=[]}get rangeCount(){return this._ranges.length}getRangeAt(t){return this._ranges[t]}addRange(t){if(this._ranges.push(t),!G){let e=window.getSelection();e.removeAllRanges(),e.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset)}}removeAllRanges(){this._ranges=[]}}if(($||W||H)&&!F&&(window.ShadowRoot.prototype.getSelection=function(){return document.getSelection()}),!$&&!F&&K){let t=new Y;window.ShadowRoot.prototype.getSelection=function(){return t},window.addEventListener("selectionchange",(()=>{if(!G){G=!0;const e=function(){let t=document.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}();e&&"true"===e.getAttribute("contenteditable")?document.execCommand("indent"):t.removeAllRanges(),G=!1}}),!0),window.addEventListener("beforeinput",(e=>{if(G){const n=e.getTargetRanges()[0],r=new Range;r.setStart(n.startContainer,n.startOffset),r.setEnd(n.endContainer,n.endOffset),t.removeAllRanges(),t.addRange(r),e.preventDefault(),e.stopImmediatePropagation()}}),!0),window.addEventListener("selectstart",(()=>{t.removeAllRanges()}),!0)}const V=R("quill:selection");class X{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=t,this.length=e}}class Z{constructor(t,n){this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.rootDocument=this.root.getRootNode?this.root.getRootNode():document,this.cursor=e().create("cursor",this),this.lastRange=this.savedRange=new X(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,M.sources.USER),1)})),this.emitter.on(M.events.SCROLL_BEFORE_UPDATE,((t,e)=>{if(!this.hasFocus())return;const n=this.getNativeRange();if(null==n)return;const r=0===n.start.offset&&n.start.offset===n.end.offset&&this.rootDocument.getSelection()instanceof Y&&e.some((t=>"characterData"===t.type&&""===t.oldValue))?1:0;n.start.node!==this.cursor.textNode&&this.emitter.once(M.events.SCROLL_UPDATE,(()=>{try{this.root.contains(n.start.node)&&this.root.contains(n.end.node)&&this.setNativeRange(n.start.node,n.start.offset+r,n.end.node,n.end.offset+r),this.update(M.sources.SILENT)}catch(t){}}))})),this.emitter.on(M.events.SCROLL_OPTIMIZE,((t,e)=>{if(e.range){const{startNode:t,startOffset:n,endNode:r,endOffset:i}=e.range;this.setNativeRange(t,n,r,i)}})),this.update(M.sources.SILENT)}handleComposition(){this.root.addEventListener("compositionstart",(()=>{this.composing=!0})),this.root.addEventListener("compositionend",(()=>{if(this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout((()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(M.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}format(t,n){if(null!=this.scroll.whitelist&&!this.scroll.whitelist[t])return;this.scroll.update();let r=this.getNativeRange();if(null!=r&&r.native.collapsed&&!e().query(t,e().Scope.BLOCK)){if(r.start.node!==this.cursor.textNode){let t=e().find(r.start.node,!1);if(null==t)return;if(t instanceof e().Leaf){let e=t.split(r.start.offset);t.parent.insertBefore(this.cursor,e)}else t.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(t,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;let r,[i,o]=this.scroll.leaf(t);if(null==i)return null;[r,o]=i.position(o,!0);let s=document.createRange();if(e>0)return s.setStart(r,o),[i,o]=this.scroll.leaf(t+e),null==i?null:([r,o]=i.position(o,!0),s.setEnd(r,o),s.getBoundingClientRect());{let t,e="left";return r instanceof Text?(o0&&(e="right")),{bottom:t.top+t.height,height:t.height,left:t[e],right:t[e],top:t.top,width:0}}}getNativeRange(){const t=this.rootDocument.getSelection();if(null==t||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(null==e)return null;let n=this.normalizeNative(e);return V.info("getNativeRange",n),n}getRange(){let t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return this.rootDocument.activeElement===this.root}normalizedToRange(t){let n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);let r=n.map((t=>{let[n,r]=t,i=e().find(n,!0),o=i.offset(this.scroll);return 0===r?o:i instanceof e().Container?o+i.length():o+i.index(n,r)})),i=Math.min(Math.max(...r),this.scroll.length()-1),o=Math.min(i,...r);return new X(o,i-o)}normalizeNative(t){if(!Q(this.root,t.startContainer)||!t.collapsed&&!Q(this.root,t.endContainer))return null;let e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach((function(t){let e=t.node,n=t.offset;for(;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n})),e}rangeToNative(t){let e=t.collapsed?[t.index]:[t.index,t.index+t.length],n=[],r=this.scroll.length();return e.forEach(((t,e)=>{t=Math.min(r-1,t);let i,[o,s]=this.scroll.leaf(t);[i,s]=o.position(s,0!==e),n.push(i,s)})),n.length<2&&(n=n.concat(n)),n}scrollIntoView(t){let e=this.lastRange;if(null==e)return;let n=this.getBounds(e.index,e.length);if(null==n)return;let r=this.scroll.length()-1,[i]=this.scroll.line(Math.min(e.index,r)),o=i;if(e.length>0&&([o]=this.scroll.line(Math.min(e.index+e.length,r))),null==i||null==o)return;let s=t.getBoundingClientRect();n.tops.bottom&&(t.scrollTop+=n.bottom-s.bottom)}setNativeRange(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(V.info("setNativeRange",t,e,n,r),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==n.parentNode))return;const o=this.rootDocument.getSelection();if(null!=o)if(null!=t){this.hasFocus()||this.root.focus();let s=(this.getNativeRange()||{}).native;if(null==s||i||t!==s.startContainer||e!==s.startOffset||n!==s.endContainer||r!==s.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);let i=document.createRange();i.setStart(t,e),i.setEnd(n,r),o.removeAllRanges(),o.addRange(i)}}else o.removeAllRanges(),this.root.blur(),document.body.focus()}setRange(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M.sources.API;if("string"==typeof e&&(n=e,e=!1),V.info("setRange",t),null!=t){let n=this.rangeToNative(t);this.setNativeRange(...n,e)}else this.setNativeRange(null);this.update(n)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M.sources.USER,e=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,null!=this.lastRange&&(this.savedRange=this.lastRange),!h()(e,this.lastRange)){!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode&&this.cursor.restore();let n=[M.events.SELECTION_CHANGE,u()(this.lastRange),u()(e),t];this.emitter.emit(M.events.EDITOR_CHANGE,...n),t!==M.sources.SILENT&&this.emitter.emit(...n)}}}function Q(t,e){try{e.parentNode}catch(t){return!1}return e instanceof Text&&(e=e.parentNode),t.contains(e)}class J{constructor(t,e){this.quill=t,this.options=e,this.modules={}}init(){Object.keys(this.options.modules).forEach((t=>{null==this.modules[t]&&this.addModule(t)}))}addModule(t){let e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}J.DEFAULTS={modules:{}},J.themes={default:J};const tt=J;let et=R("quill");class nt{static debug(t){!0===t&&(t="log"),R.level(t)}static find(t){return t.__quill||e().find(t)}static import(t){return null==this.imports[t]&&et.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(t,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){let e=t.attrName||t.blotName;"string"==typeof e?this.register("formats/"+e,t,n):Object.keys(t).forEach((e=>{this.register(e,t[e],n)}))}else null==this.imports[t]||r||et.warn(`Overwriting ${t} with`,n),this.imports[t]=n,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==n.blotName?e().register(n):t.startsWith("modules")&&"function"==typeof n.register&&n.register()}constructor(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(t,e){if(e=o()({container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e),e.theme&&e.theme!==nt.DEFAULTS.theme){if(e.theme=nt.import(`themes/${e.theme}`),null==e.theme)throw new Error(`Invalid theme ${e.theme}. Did you register it?`)}else e.theme=tt;let n=o()({},e.theme.DEFAULTS);[n,e].forEach((function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach((function(e){!0===t.modules[e]&&(t.modules[e]={})}))}));let r=Object.keys(n.modules).concat(Object.keys(e.modules)).reduce((function(t,e){let n=nt.import(`modules/${e}`);return null==n?et.error(`Cannot load ${e} module. Are you sure you registered it?`):t[e]=n.DEFAULTS||{},t}),{});null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar});return e=o()({},nt.DEFAULTS,{modules:r},n,e),["bounds","container","scrollingContainer"].forEach((function(t){"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))})),e.modules=Object.keys(e.modules).reduce((function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t}),{}),e}(t,n),this.container=this.options.container,null==this.container)return et.error("Invalid Quill container",t);this.options.debug&&nt.debug(this.options.debug);let r=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 M,this.scroll=e().create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new T(this.scroll),this.selection=new Z(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(M.events.EDITOR_CHANGE,(t=>{t===M.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(M.events.SCROLL_UPDATE,((t,e)=>{let n=this.selection.lastRange,r=n&&0===n.length?n.index:void 0;rt.call(this,(()=>this.editor.update(null,e,r)),t)}));let i=this.clipboard.convert(`
${r}


`);this.setContents(i),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}addContainer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){let e=t;(t=document.createElement("div")).classList.add(e)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,n){return[t,e,,n]=it(t,e,n),rt.call(this,(()=>this.editor.deleteText(t,e)),n,t,-1*e)}disable(){this.enable(!1)}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}format(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M.sources.API;return rt.call(this,(()=>{let r=this.getSelection(!0),i=new(l());if(null==r)return i;if(e().query(t,e().Scope.BLOCK))i=this.editor.formatLine(r.index,r.length,{[t]:n});else{if(0===r.length)return this.selection.format(t,n),i;i=this.editor.formatText(r.index,r.length,{[t]:n})}return this.setSelection(r,M.sources.SILENT),i}),r)}formatLine(t,e,n,r,i){let o;return[t,e,o,i]=it(t,e,n,r,i),rt.call(this,(()=>this.editor.formatLine(t,e,o)),i,t,0)}formatText(t,e,n,r,i){let o;return[t,e,o,i]=it(t,e,n,r,i),rt.call(this,(()=>this.editor.formatText(t,e,o)),i,t,0)}getBounds(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e="number"==typeof t?this.selection.getBounds(t,n):this.selection.getBounds(t.index,t.length);let r=this.container.getBoundingClientRect();return{bottom:e.bottom-r.top,height:e.height,left:e.left-r.left,right:e.right-r.left,top:e.top-r.top,width:e.width}}getContents(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;return[t,e]=it(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;return[t,e]=it(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:nt.sources.API;return rt.call(this,(()=>this.editor.insertEmbed(t,e,n)),r,t)}insertText(t,e,n,r,i){let o;return[t,,o,i]=it(t,0,n,r,i),rt.call(this,(()=>this.editor.insertText(t,e,o)),i,t,e.length)}isEnabled(){return!this.container.classList.contains("ql-disabled")}off(){return this.emitter.off.apply(this.emitter,arguments)}on(){return this.emitter.on.apply(this.emitter,arguments)}once(){return this.emitter.once.apply(this.emitter,arguments)}pasteHTML(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}removeFormat(t,e,n){return[t,e,,n]=it(t,e,n),rt.call(this,(()=>this.editor.removeFormat(t,e)),n,t)}scrollIntoView(){this.selection.scrollIntoView(this.scrollingContainer)}setContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M.sources.API;return rt.call(this,(()=>{t=new(l())(t);let e=this.getLength(),n=this.editor.deleteText(0,e),r=this.editor.applyDelta(t),i=r.ops[r.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(this.editor.deleteText(this.getLength()-1,1),r.delete(1)),n.compose(r)}),e)}setSelection(t,e,n){null==t?this.selection.setRange(null,e||nt.sources.API):([t,e,,n]=it(t,e,n),this.selection.setRange(new X(t,e),n),n!==M.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer))}setText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M.sources.API,n=(new(l())).insert(t);return this.setContents(n,e)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M.sources.API;return rt.call(this,(()=>(t=new(l())(t),this.editor.applyDelta(t,e))),e,!0)}}function rt(t,e,n,r){if(this.options.strict&&!this.isEnabled()&&e===M.sources.USER)return new(l());let i=null==n?null:this.getSelection(),o=this.editor.delta,s=t();if(null!=i&&(!0===n&&(n=i.index),null==r?i=ot(i,s,e):0!==r&&(i=ot(i,n,r,e)),this.setSelection(i,M.sources.SILENT)),s.length()>0){let t=[M.events.TEXT_CHANGE,s,o,e];this.emitter.emit(M.events.EDITOR_CHANGE,...t),e!==M.sources.SILENT&&this.emitter.emit(...t)}return s}function it(t,e,n,r,i){let o={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(i=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(i=r,r=n,n=e,e=0),"object"==typeof n?(o=n,i=r):"string"==typeof n&&(null!=r?o[n]=r:i=n),[t,e,o,i=i||M.sources.API]}function ot(t,e,n,r){if(null==t)return null;let i,o;return e instanceof l()?[i,o]=[t.index,t.index+t.length].map((function(t){return e.transformPosition(t,r!==M.sources.USER)})):[i,o]=[t.index,t.index+t.length].map((function(t){return t=0?t+n:Math.max(e,t+n)})),new X(i,o-i)}nt.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},nt.events=M.events,nt.sources=M.sources,nt.version="1.3.6",nt.imports={delta:l(),parchment:e(),"core/module":z,"core/theme":tt};class st extends e().Container{}st.allowedChildren=[b,v,st];const lt=st,at="\ufeff";class ut extends e().Embed{constructor(t){super(t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable",!1),[].slice.call(this.domNode.childNodes).forEach((t=>{this.contentNode.appendChild(t)})),this.leftGuard=document.createTextNode(at),this.rightGuard=document.createTextNode(at),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 n,r,i=t.data.split(at).join("");if(t===this.leftGuard)if(this.prev instanceof g){let t=this.prev.length();this.prev.insertAt(t,i),n={startNode:this.prev.domNode,startOffset:t+i.length}}else r=document.createTextNode(i),this.parent.insertBefore(e().create(r),this),n={startNode:r,startOffset:i.length};else t===this.rightGuard&&(this.next instanceof g?(this.next.insertAt(0,i),n={startNode:this.next.domNode,startOffset:i.length}):(r=document.createTextNode(i),this.parent.insertBefore(e().create(r),this.next),n={startNode:r,startOffset:i.length}));return t.data=at,n}update(t,e){t.forEach((t=>{if("characterData"===t.type&&(t.target===this.leftGuard||t.target===this.rightGuard)){let n=this.restore(t.target);n&&(e.range=n)}}))}}const ct=ut;function ht(t){return t instanceof b||t instanceof v}class ft extends e().Scroll{constructor(t,e){super(t),this.emitter=e.emitter,Array.isArray(e.whitelist)&&(this.whitelist=e.whitelist.reduce((function(t,e){return t[e]=!0,t}),{})),this.optimize(),this.enable()}batchStart(){this.batch=!0}batchEnd(){this.batch=!1,this.optimize()}deleteAt(t,e){let[n,r]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),null!=i&&n!==i&&r>0){if(n instanceof v||i instanceof v)return void this.optimize();if(n instanceof E){let t=n.newlineIndex(n.length(),!0);if(t>-1&&(n=n.split(t+1),n===i))return void this.optimize()}else if(i instanceof E){let t=i.newlineIndex(0);t>-1&&i.split(t+1)}let t=i.children.head instanceof d?null:i.children.head;n.moveChildren(i,t),n.remove()}this.optimize()}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}formatAt(t,e,n,r){(null==this.whitelist||this.whitelist[n])&&(super.formatAt(t,e,n,r),this.optimize())}insertAt(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==e().query(n,e().Scope.BLOCK)){let t=e().create(this.statics.defaultChild);this.appendChild(t),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),t.insertAt(0,n,r)}else{let t=e().create(n,r);this.appendChild(t)}else super.insertAt(t,n,r);this.optimize()}}insertBefore(t,n){if(t.statics.scope===e().Scope.INLINE_BLOT){let n=e().create(this.statics.defaultChild);n.appendChild(t),t=n}super.insertBefore(t,n)}leaf(t){return this.path(t).pop()||[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(ht,t)}lines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,r=(t,n,i)=>{let o=[],s=i;return t.children.forEachAt(n,i,(function(t,n,i){ht(t)?o.push(t):t instanceof e().Container&&(o=o.concat(r(t,n,s))),s-=i})),o};return r(this,t,n)}optimize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(super.optimize(t,e),t.length>0&&this.emitter.emit(M.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}update(t){if(!0===this.batch)return;let e=M.sources.USER;"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(M.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(M.events.SCROLL_UPDATE,e,t)}}ft.blotName="scroll",ft.className="ql-editor",ft.tagName="DIV",ft.defaultChild="block",ft.allowedChildren=[b,v,lt];const dt=ft;let pt={scope:e().Scope.BLOCK,whitelist:["right","center","justify"]},gt=new(e().Attributor.Attribute)("align","align",pt),mt=new(e().Attributor.Class)("align","ql-align",pt),yt=new(e().Attributor.Style)("align","text-align",pt);class vt extends e().Attributor.Style{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+e.split(",").map((function(t){return("00"+parseInt(t).toString(16)).slice(-2)})).join("")):e}}let bt=new(e().Attributor.Class)("color","ql-color",{scope:e().Scope.INLINE}),_t=new vt("color","color",{scope:e().Scope.INLINE}),Nt=new(e().Attributor.Class)("background","ql-bg",{scope:e().Scope.INLINE}),Et=new vt("background","background-color",{scope:e().Scope.INLINE}),At={scope:e().Scope.BLOCK,whitelist:["rtl"]},xt=new(e().Attributor.Attribute)("direction","dir",At),Ot=new(e().Attributor.Class)("direction","ql-direction",At),wt=new(e().Attributor.Style)("direction","direction",At),Tt={scope:e().Scope.INLINE,whitelist:["serif","monospace"]},kt=new(e().Attributor.Class)("font","ql-font",Tt);class St extends e().Attributor.Style{value(t){return super.value(t).replace(/["']/g,"")}}let Lt=new St("font","font-family",Tt),jt=new(e().Attributor.Class)("size","ql-size",{scope:e().Scope.INLINE,whitelist:["small","large","huge"]}),Ct=new(e().Attributor.Style)("size","font-size",{scope:e().Scope.INLINE,whitelist:["10px","18px","32px"]}),qt=R("quill:clipboard");const Rt="__ql-matcher",It=[[Node.TEXT_NODE,function(t,e){let n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!Ut(t.parentNode).whiteSpace.startsWith("pre")){let e=function(t,e){return(e=e.replace(/[^\u00a0]/g,"")).length<1&&t?" ":e};n=n.replace(/\r\n/g," ").replace(/\n/g," "),n=n.replace(/\s\s+/g,e.bind(e,!0)),(null==t.previousSibling&&Ft(t.parentNode)||null!=t.previousSibling&&Ft(t.previousSibling))&&(n=n.replace(/^\s+/,e.bind(e,!1))),(null==t.nextSibling&&Ft(t.parentNode)||null!=t.nextSibling&&Ft(t.nextSibling))&&(n=n.replace(/\s+$/,e.bind(e,!1)))}return e.insert(n)}],[Node.TEXT_NODE,Wt],["br",function(t,e){zt(e,"\n")||e.insert("\n");return e}],[Node.ELEMENT_NODE,Wt],[Node.ELEMENT_NODE,function(t,n){let r=e().query(t);if(null==r)return n;if(r.prototype instanceof e().Embed){let e={},i=r.value(t);null!=i&&(e[r.blotName]=i,n=(new(l())).insert(e,r.formats(t)))}else"function"==typeof r.formats&&(n=Mt(n,r.blotName,r.formats(t)));return n}],[Node.ELEMENT_NODE,function(t,n){let r=e().Attributor.Attribute.keys(t),i=e().Attributor.Class.keys(t),o=e().Attributor.Style.keys(t),s={};r.concat(i).concat(o).forEach((n=>{let r=e().query(n,e().Scope.ATTRIBUTE);null!=r&&(s[r.attrName]=r.value(t),s[r.attrName])||(r=Bt[n],null==r||r.attrName!==n&&r.keyName!==n||(s[r.attrName]=r.value(t)||void 0),r=Dt[n],null==r||r.attrName!==n&&r.keyName!==n||(r=Dt[n],s[r.attrName]=r.value(t)||void 0))})),Object.keys(s).length>0&&(n=Mt(n,s));return n}],[Node.ELEMENT_NODE,function(t,e){let n={},r=t.style||{};r.fontStyle&&"italic"===Ut(t).fontStyle&&(n.italic=!0);r.fontWeight&&(Ut(t).fontWeight.startsWith("bold")||parseInt(Ut(t).fontWeight)>=700)&&(n.bold=!0);Object.keys(n).length>0&&(e=Mt(e,n));parseFloat(r.textIndent||0)>0&&(e=(new(l())).insert("\t").concat(e));return e}],["li",function(t,n){let r=e().query(t);if(null==r||"list-item"!==r.blotName||!zt(n,"\n"))return n;let i=-1,o=t.parentNode;for(;!o.classList.contains("ql-clipboard");)"list"===(e().query(o)||{}).blotName&&(i+=1),o=o.parentNode;return i<=0?n:n.compose((new(l())).retain(n.length()-1).retain(1,{indent:i}))}],["b",$t.bind($t,"bold")],["i",$t.bind($t,"italic")],["style",function(){return new(l())}]],Bt=[gt,xt].reduce((function(t,e){return t[e.keyName]=e,t}),{}),Dt=[yt,Et,_t,wt,Lt,Ct].reduce((function(t,e){return t[e.keyName]=e,t}),{});class Pt extends z{constructor(t,e){super(t,e),this.quill.root.addEventListener("paste",this.onPaste.bind(this)),this.container=this.quill.addContainer("ql-clipboard"),this.container.setAttribute("contenteditable",!0),this.container.setAttribute("tabindex",-1),this.matchers=[],It.concat(this.options.matchers).forEach((t=>{let[e,n]=t;this.addMatcher(e,n)}))}addMatcher(t,e){this.matchers.push([t,e])}convert(t){if("string"==typeof t)return this.container.innerHTML=t.replace(/\>\r?\n +\<"),this.convert();const e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[E.blotName]){const t=this.container.innerText;return this.container.innerHTML="",(new(l())).insert(t,{[E.blotName]:e[E.blotName]})}let[n,r]=this.prepareMatching(),i=Kt(this.container,n,r);return zt(i,"\n")&&null==i.ops[i.ops.length-1].attributes&&(i=i.compose((new(l())).retain(i.length()-1).delete(1))),qt.log("convert",this.container.innerHTML,i),this.container.innerHTML="",i}dangerouslyPasteHTML(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nt.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,nt.sources.SILENT);else{let r=this.convert(e);this.quill.updateContents((new(l())).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),nt.sources.SILENT)}}onPaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;let e=this.quill.getSelection(),n=(new(l())).retain(e.index),r=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(nt.sources.SILENT),setTimeout((()=>{n=n.concat(this.convert()).delete(e.length),this.quill.updateContents(n,nt.sources.USER),this.quill.setSelection(n.length()-e.length,nt.sources.SILENT),this.quill.scrollingContainer.scrollTop=r,this.quill.focus()}),1)}prepareMatching(){let t=[],e=[];return this.matchers.forEach((n=>{let[r,i]=n;switch(r){case Node.TEXT_NODE:e.push(i);break;case Node.ELEMENT_NODE:t.push(i);break;default:[].forEach.call(this.container.querySelectorAll(r),(t=>{t[Rt]=t[Rt]||[],t[Rt].push(i)}))}})),[t,e]}}function Mt(t,e,n){return"object"==typeof e?Object.keys(e).reduce((function(t,n){return Mt(t,n,e[n])}),t):t.reduce((function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,o()({},{[e]:n},r.attributes))}),new(l()))}function Ut(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};const e="__ql-computed-style";return t[e]||(t[e]=window.getComputedStyle(t))}function zt(t,e){let n="";for(let r=t.ops.length-1;r>=0&&n.length-1}function Kt(t,e,n){return t.nodeType===t.TEXT_NODE?n.reduce((function(e,n){return n(t,e)}),new(l())):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],((r,i)=>{let o=Kt(i,e,n);return i.nodeType===t.ELEMENT_NODE&&(o=e.reduce((function(t,e){return e(i,t)}),o),o=(i[Rt]||[]).reduce((function(t,e){return e(i,t)}),o)),r.concat(o)}),new(l())):new(l())}function $t(t,e,n){return Mt(n,t,!0)}function Wt(t,e){return zt(e,"\n")||(Ft(t)||e.length()>0&&t.nextSibling&&Ft(t.nextSibling))&&e.insert("\n"),e}Pt.DEFAULTS={matchers:[],matchVisual:!1};class Ht extends z{constructor(t,e){super(t,e),this.lastRecorded=0,this.ignoreChange=!1,this.clear(),this.quill.on(nt.events.EDITOR_CHANGE,((t,e,n,r)=>{t!==nt.events.TEXT_CHANGE||this.ignoreChange||(this.options.userOnly&&r!==nt.sources.USER?this.transform(e):this.record(e,n))})),this.quill.keyboard.addBinding({key:"Z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:"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))}change(t,n){if(0===this.stack[t].length)return;let r=this.stack[t].pop();this.stack[n].push(r),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r[t],nt.sources.USER),this.ignoreChange=!1;let i=function(t){let n=t.reduce((function(t,e){return t+=e.delete||0}),0),r=t.length()-n;(function(t){let n=t.ops[t.ops.length-1];if(null==n)return!1;if(null!=n.insert)return"string"==typeof n.insert&&n.insert.endsWith("\n");if(null!=n.attributes)return Object.keys(n.attributes).some((function(t){return null!=e().query(t,e().Scope.BLOCK)}));return!1})(t)&&(r-=1);return r}(r[t]);this.quill.setSelection(i)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(0===t.ops.length)return;this.stack.redo=[];let n=this.quill.getContents().diff(e),r=Date.now();if(this.lastRecorded+this.options.delay>r&&this.stack.undo.length>0){let e=this.stack.undo.pop();n=n.compose(e.undo),t=e.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}redo(){this.change("redo","undo")}transform(t){this.stack.undo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})),this.stack.redo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}))}undo(){this.change("undo","redo")}}Ht.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};let Gt=R("quill:keyboard");const Yt=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Vt extends z{static match(t,e){return e=re(e),!["altKey","ctrlKey","metaKey","shiftKey"].some((function(n){return!!e[n]!==t[n]&&null!==e[n]}))&&e.key===(t.which||t.keyCode)}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach((e=>{("list autofill"!==e||null==t.scroll.whitelist||t.scroll.whitelist.list)&&this.options.bindings[e]&&this.addBinding(this.options.bindings[e])})),this.addBinding({key:Vt.keys.ENTER,shiftKey:null},te),this.addBinding({key:Vt.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},(function(){})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:Vt.keys.BACKSPACE},{collapsed:!0},Zt),this.addBinding({key:Vt.keys.DELETE},{collapsed:!0},Qt)):(this.addBinding({key:Vt.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},Zt),this.addBinding({key:Vt.keys.DELETE},{collapsed:!0,suffix:/^.?$/},Qt)),this.addBinding({key:Vt.keys.BACKSPACE},{collapsed:!1},Jt),this.addBinding({key:Vt.keys.DELETE},{collapsed:!1},Jt),this.addBinding({key:Vt.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},Zt),this.listen()}addBinding(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=re(t);if(null==r||null==r.key)return Gt.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=o()(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}listen(){this.quill.root.addEventListener("keydown",(t=>{if(t.defaultPrevented)return;let n=t.which||t.keyCode,r=(this.bindings[n]||[]).filter((function(e){return Vt.match(t,e)}));if(0===r.length)return;let i=this.quill.getSelection();if(null==i||!this.quill.hasFocus())return;let[o,s]=this.quill.getLine(i.index),[l,a]=this.quill.getLeaf(i.index),[u,c]=0===i.length?[l,a]:this.quill.getLeaf(i.index+i.length),f=l instanceof e().Text?l.value().slice(0,a):"",d=u instanceof e().Text?u.value().slice(c):"",p={collapsed:0===i.length,empty:0===i.length&&o.length()<=1,format:this.quill.getFormat(i),offset:s,prefix:f,suffix:d};r.some((t=>{if(null!=t.collapsed&&t.collapsed!==p.collapsed)return!1;if(null!=t.empty&&t.empty!==p.empty)return!1;if(null!=t.offset&&t.offset!==p.offset)return!1;if(Array.isArray(t.format)){if(t.format.every((function(t){return null==p.format[t]})))return!1}else if("object"==typeof t.format&&!Object.keys(t.format).every((function(e){return!0===t.format[e]?null!=p.format[e]:!1===t.format[e]?null==p.format[e]:h()(t.format[e],p.format[e])})))return!1;return!(null!=t.prefix&&!t.prefix.test(p.prefix))&&(!(null!=t.suffix&&!t.suffix.test(p.suffix))&&!0!==t.handler.call(this,i,p))}))&&t.preventDefault()}))}}function Xt(t,n){const r=t===Vt.keys.LEFT?"prefix":"suffix";return{key:t,shiftKey:n,altKey:null,[r]:/^$/,handler:function(r){let i=r.index;t===Vt.keys.RIGHT&&(i+=r.length+1);const[o]=this.quill.getLeaf(i);return!(o instanceof e().Embed)||(t===Vt.keys.LEFT?n?this.quill.setSelection(r.index-1,r.length+1,nt.sources.USER):this.quill.setSelection(r.index-1,nt.sources.USER):n?this.quill.setSelection(r.index,r.length+1,nt.sources.USER):this.quill.setSelection(r.index+r.length+1,nt.sources.USER),!1)}}}function Zt(t,e){if(0===t.index||this.quill.getLength()<=1)return;let[n]=this.quill.getLine(t.index),r={};if(0===e.offset){let[e]=this.quill.getLine(t.index-1);if(null!=e&&e.length()>1){let e=n.formats(),i=this.quill.getFormat(t.index-1,1);r=s.AttributeMap.diff(e,i)||{}}}let i=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-i,i,nt.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index-i,i,r,nt.sources.USER),this.quill.focus()}function Qt(t,e){let n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-n)return;let r={},i=0,[o]=this.quill.getLine(t.index);if(e.offset>=o.length()-1){let[e]=this.quill.getLine(t.index+1);if(e){let n=o.formats(),s=this.quill.getFormat(t.index,1);r=DeltaOp.attributes.diff(n,s)||{},i=e.length()}}this.quill.deleteText(t.index,n,nt.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+i-1,n,r,nt.sources.USER)}function Jt(t){let e=this.quill.getLines(t),n={};if(e.length>1){let t=e[0].formats(),r=e[e.length-1].formats();n=DeltaOp.attributes.diff(r,t)||{}}this.quill.deleteText(t,nt.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,nt.sources.USER),this.quill.setSelection(t.index,nt.sources.SILENT),this.quill.focus()}function te(t,n){t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);let r=Object.keys(n.format).reduce((function(t,r){return e().query(r,e().Scope.BLOCK)&&!Array.isArray(n.format[r])&&(t[r]=n.format[r]),t}),{});this.quill.insertText(t.index,"\n",r,nt.sources.USER),this.quill.setSelection(t.index+1,nt.sources.SILENT),this.quill.focus(),Object.keys(n.format).forEach((t=>{null==r[t]&&(Array.isArray(n.format[t])||"link"!==t&&this.quill.format(t,n.format[t],nt.sources.USER))}))}function ee(t){return{key:Vt.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(n){let r=e().query("code-block"),i=n.index,o=n.length,[s,l]=this.quill.scroll.descendant(r,i);if(null==s)return;let a=this.quill.getIndex(s),u=s.newlineIndex(l,!0)+1,c=s.newlineIndex(a+l+o),h=s.domNode.textContent.slice(u,c).split("\n");l=0,h.forEach(((e,n)=>{t?(s.insertAt(u+l,r.TAB),l+=r.TAB.length,0===n?i+=r.TAB.length:o+=r.TAB.length):e.startsWith(r.TAB)&&(s.deleteAt(u+l,r.TAB.length),l-=r.TAB.length,0===n?i-=r.TAB.length:o-=r.TAB.length),l+=e.length+1})),this.quill.update(nt.sources.USER),this.quill.setSelection(i,o,nt.sources.SILENT)}}}function ne(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],nt.sources.USER)}}}function re(t){if("string"==typeof t||"number"==typeof t)return re({key:t});if("object"==typeof t&&(t=u()(t,!1)),"string"==typeof t.key)if(null!=Vt.keys[t.key.toUpperCase()])t.key=Vt.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[Yt]=t.shortKey,delete t.shortKey),t}Vt.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},Vt.DEFAULTS={bindings:{bold:ne("bold"),italic:ne("italic"),underline:ne("underline"),indent:{key:Vt.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",nt.sources.USER)}},outdent:{key:Vt.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",nt.sources.USER)}},"outdent backspace":{key:Vt.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",nt.sources.USER):null!=e.format.list&&this.quill.format("list",!1,nt.sources.USER)}},"indent code-block":ee(!0),"outdent code-block":ee(!1),"remove tab":{key:Vt.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,nt.sources.USER)}},tab:{key:Vt.keys.TAB,handler:function(t){this.quill.history.cutoff();let e=(new(l())).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,nt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,nt.sources.SILENT)}},"list empty enter":{key:Vt.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,nt.sources.USER),e.format.indent&&this.quill.format("indent",!1,nt.sources.USER)}},"checklist enter":{key:Vt.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){let[e,n]=this.quill.getLine(t.index),r=o()({},e.formats(),{list:"checked"}),i=(new(l())).retain(t.index).insert("\n",r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,nt.sources.USER),this.quill.setSelection(t.index+1,nt.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:Vt.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){let[n,r]=this.quill.getLine(t.index),i=(new(l())).retain(t.index).insert("\n",e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,nt.sources.USER),this.quill.setSelection(t.index+1,nt.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){let n,r=e.prefix.length,[i,o]=this.quill.getLine(t.index);if(o>r)return!0;switch(e.prefix.trim()){case"[]":case"[ ]":n="unchecked";break;case"[x]":n="checked";break;case"-":case"*":n="bullet";break;default:n="ordered"}this.quill.insertText(t.index," ",nt.sources.USER),this.quill.history.cutoff();let s=(new(l())).retain(t.index-o).delete(r+1).retain(i.length()-2-o).retain(1,{list:n});this.quill.updateContents(s,nt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-r,nt.sources.SILENT)}},"code exit":{key:Vt.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){const[e,n]=this.quill.getLine(t.index),r=(new(l())).retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(r,nt.sources.USER)}},"embed left":Xt(Vt.keys.LEFT,!1),"embed left shift":Xt(Vt.keys.LEFT,!0),"embed right":Xt(Vt.keys.RIGHT,!1),"embed right shift":Xt(Vt.keys.RIGHT,!0)}},nt.register({"blots/block":b,"blots/block/embed":v,"blots/break":d,"blots/container":lt,"blots/cursor":x,"blots/embed":ct,"blots/inline":y,"blots/scroll":dt,"blots/text":g,"modules/clipboard":Pt,"modules/history":Ht,"modules/keyboard":Vt}),e().register(b,d,x,y,dt,g);const ie=nt;class oe extends e().Attributor.Class{add(t,e){if("+1"===e||"-1"===e){let n=this.value(t)||0;e="+1"===e?n+1:n-1}return 0===e?(this.remove(t),!0):super.add(t,e)}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e))}value(t){return parseInt(super.value(t))||void 0}}let se=new oe("indent","ql-indent",{scope:e().Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class le extends b{}le.blotName="blockquote",le.tagName="blockquote";const ae=le;class ue extends b{static formats(t){return this.tagName.indexOf(t.tagName)+1}}ue.blotName="header",ue.tagName=["H1","H2","H3","H4","H5","H6"];const ce=ue;class he extends b{static formats(t){return t.tagName===this.tagName?void 0:super.formats(t)}format(t,n){t!==fe.blotName||n?super.format(t,n):this.replaceWith(e().create(this.statics.scope))}remove(){null==this.prev&&null==this.next?this.parent.remove():super.remove()}replaceWith(t,e){return this.parent.isolate(this.offset(this.parent),this.length()),t===this.parent.statics.blotName?(this.parent.replaceWith(t,e),this):(this.parent.unwrap(),super.replaceWith(t,e))}}he.blotName="list-item",he.tagName="LI";class fe extends lt{static create(t){let e="ordered"===t?"OL":"UL",n=super.create(e);return"checked"!==t&&"unchecked"!==t||n.setAttribute("data-checked","checked"===t),n}static formats(t){return"OL"===t.tagName?"ordered":"UL"===t.tagName?t.hasAttribute("data-checked")?"true"===t.getAttribute("data-checked")?"checked":"unchecked":"bullet":void 0}constructor(t){super(t);const n=n=>{if(n.target.parentNode!==t)return;let r=this.statics.formats(t),i=e().find(n.target);"checked"===r?i.format("list","unchecked"):"unchecked"===r&&i.format("list","checked")};t.addEventListener("touchstart",n),t.addEventListener("mousedown",n)}format(t,e){this.children.length>0&&this.children.tail.format(t,e)}formats(){return{[this.statics.blotName]:this.statics.formats(this.domNode)}}insertBefore(t,e){if(t instanceof he)super.insertBefore(t,e);else{let n=null==e?this.length():e.offset(this),r=this.split(n);r.parent.insertBefore(t,r)}}optimize(t){super.optimize(t);let e=this.next;null!=e&&e.prev===this&&e.statics.blotName===this.statics.blotName&&e.domNode.tagName===this.domNode.tagName&&e.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(e.moveChildren(this),e.remove())}replace(t){if(t.statics.blotName!==this.statics.blotName){let n=e().create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}super.replace(t)}}fe.blotName="list",fe.scope=e().Scope.BLOCK_BLOT,fe.tagName=["OL","UL"],fe.defaultChild="list-item",fe.allowedChildren=[he];class de extends y{static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}de.blotName="bold",de.tagName=["STRONG","B"];const pe=de;class ge extends pe{}ge.blotName="italic",ge.tagName=["EM","I"];const me=ge;class ye extends y{static create(t){let e=super.create(t);return t=this.sanitize(t),e.setAttribute("href",t),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return ve(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){if(t!==this.statics.blotName||!e)return super.format(t,e);e=this.constructor.sanitize(e),this.domNode.setAttribute("href",e)}}function ve(t,e){let n=document.createElement("a");n.href=t;let r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}ye.blotName="link",ye.tagName="A",ye.SANITIZED_URL="about:blank",ye.PROTOCOL_WHITELIST=["http","https","mailto","tel"];class be extends y{static create(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):super.create(t)}static formats(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}}be.blotName="script",be.tagName=["SUB","SUP"];const _e=be;class Ne extends y{}Ne.blotName="strike",Ne.tagName="S";const Ee=Ne;class Ae extends y{}Ae.blotName="underline",Ae.tagName="U";const xe=Ae,Oe=["alt","height","width"];class we extends e().Embed{static create(t){let e=super.create(t);return"string"==typeof t&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Oe.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return ve(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){Oe.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}we.blotName="image",we.tagName="IMG";const Te=we,ke=["height","width"];class Se extends v{static create(t){let e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen",!0),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return ke.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}static sanitize(t){return ye.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){ke.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}Se.blotName="video",Se.className="ql-video",Se.tagName="IFRAME";const Le=Se,je="getRootNode"in document;let Ce=R("quill:toolbar");class qe extends z{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){let e=document.createElement("div");!function(t,e){Array.isArray(e[0])||(e=[e]);e.forEach((function(e){let n=document.createElement("span");n.classList.add("ql-formats"),e.forEach((function(t){if("string"==typeof t)Re(n,t);else{let e=Object.keys(t)[0],r=t[e];Array.isArray(r)?function(t,e,n){let r=document.createElement("select");r.classList.add("ql-"+e),n.forEach((function(t){let e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)})),t.appendChild(r)}(n,e,r):Re(n,e,r)}})),t.appendChild(n)}))}(e,this.options.container),t.container.parentNode.insertBefore(e,t.container),this.container=e}else if("string"==typeof this.options.container){const e=je?t.container.getRootNode():document;this.container=e.querySelector(this.options.container)}else this.container=this.options.container;if(!(this.container instanceof HTMLElement))return Ce.error("Container required for toolbar",this.options);this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},Object.keys(this.options.handlers).forEach((t=>{this.addHandler(t,this.options.handlers[t])})),[].forEach.call(this.container.querySelectorAll("button, select"),(t=>{this.attach(t)})),this.quill.on(nt.events.EDITOR_CHANGE,((t,e)=>{t===nt.events.SELECTION_CHANGE&&this.update(e)})),this.quill.on(nt.events.SCROLL_OPTIMIZE,(()=>{let[t]=this.quill.selection.getRange();this.update(t)}))}addHandler(t,e){this.handlers[t]=e}attach(t){let n=[].find.call(t.classList,(t=>0===t.indexOf("ql-")));if(!n)return;if(n=n.slice(3),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null==this.handlers[n]){if(null!=this.quill.scroll.whitelist&&null==this.quill.scroll.whitelist[n])return void Ce.warn("ignoring attaching to disabled format",n,t);if(null==e().query(n))return void Ce.warn("ignoring attaching to nonexistent format",n,t)}let r="SELECT"===t.tagName?"change":"click";t.addEventListener(r,(r=>{let i;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;let e=t.options[t.selectedIndex];i=!e.hasAttribute("selected")&&(e.value||!1)}else i=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),r.preventDefault();this.quill.focus();let[o]=this.quill.selection.getRange();if(null!=this.handlers[n])this.handlers[n].call(this,i);else if(e().query(n).prototype instanceof e().Embed){if(i=prompt(`Enter ${n}`),!i)return;this.quill.updateContents((new(l())).retain(o.index).delete(o.length).insert({[n]:i}),nt.sources.USER)}else this.quill.format(n,i,nt.sources.USER);this.update(o)})),this.controls.push([n,t])}update(t){let e=null==t?{}:this.quill.getFormat(t);this.controls.forEach((function(n){let[r,i]=n;if("SELECT"===i.tagName){let n;if(null==t)n=null;else if(null==e[r])n=i.querySelector("option[selected]");else if(!Array.isArray(e[r])){let t=e[r];"string"==typeof t&&(t=t.replace(/\"/g,'\\"')),n=i.querySelector(`option[value="${t}"]`)}null==n?(i.value="",i.selectedIndex=-1):n.selected=!0}else if(null==t)i.classList.remove("ql-active");else if(i.hasAttribute("value")){let t=e[r]===i.getAttribute("value")||null!=e[r]&&e[r].toString()===i.getAttribute("value")||null==e[r]&&!i.getAttribute("value");i.classList.toggle("ql-active",t)}else i.classList.toggle("ql-active",null!=e[r])}))}}function Re(t,e,n){let r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+e),null!=n&&(r.value=n),t.appendChild(r)}qe.DEFAULTS={},qe.DEFAULTS={container:null,handlers:{clean:function(){let t=this.quill.getSelection();if(null!=t)if(0==t.length){let t=this.quill.getFormat();Object.keys(t).forEach((t=>{null!=e().query(t,e().Scope.INLINE)&&this.quill.format(t,!1)}))}else this.quill.removeFormat(t,nt.sources.USER)},direction:function(t){let e=this.quill.getFormat().align;"rtl"===t&&null==e?this.quill.format("align","right",nt.sources.USER):t||"right"!==e||this.quill.format("align",!1,nt.sources.USER),this.quill.format("direction",t,nt.sources.USER)},indent:function(t){let e=this.quill.getSelection(),n=this.quill.getFormat(e),r=parseInt(n.indent||0);if("+1"===t||"-1"===t){let e="+1"===t?1:-1;"rtl"===n.direction&&(e*=-1),this.quill.format("indent",r+e,nt.sources.USER)}},link:function(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,nt.sources.USER)},list:function(t){let e=this.quill.getSelection(),n=this.quill.getFormat(e);"check"===t?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,nt.sources.USER):this.quill.format("list","unchecked",nt.sources.USER):this.quill.format("list",t,nt.sources.USER)}}},ie.register({"attributors/attribute/direction":xt,"attributors/class/align":mt,"attributors/class/background":Nt,"attributors/class/color":bt,"attributors/class/direction":Ot,"attributors/class/font":kt,"attributors/class/size":jt,"attributors/style/align":yt,"attributors/style/background":Et,"attributors/style/color":_t,"attributors/style/direction":wt,"attributors/style/font":Lt,"attributors/style/size":Ct},!0),ie.register({"formats/align":mt,"formats/direction":Ot,"formats/indent":se,"formats/background":Et,"formats/color":_t,"formats/font":kt,"formats/size":jt,"formats/blockquote":ae,"formats/code-block":E,"formats/header":ce,"formats/list":fe,"formats/bold":pe,"formats/code":N,"formats/italic":me,"formats/link":ye,"formats/script":_e,"formats/strike":Ee,"formats/underline":xe,"formats/image":Te,"formats/video":Le,"formats/list/item":he,"modules/toolbar":qe},!0);const Ie=ie})(),r=r.default})())); +!function(t,e){t.Quill=e()}(window,(()=>(()=>{var t={423:()=>{let t=document.createElement("div");if(t.classList.toggle("test-class",!1),t.classList.contains("test-class")){let t=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,n){return arguments.length>1&&!this.contains(e)==!n?n:t.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,i=arguments[1],o=0;o{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),o.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},o.prototype.listeners=function(t,e){var r=n?n+t:t,i=this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var o=0,s=i.length,l=new Array(s);o{var e=-1,n=1,r=0;function i(t,u,c,h){if(t===u)return t?[[r,t]]:[];if(null!=c){var f=function(t,e,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,o=t.length,s=e.length;if(0===r.length&&(null===i||0===i.length)){var l=r.index,a=t.slice(0,l),u=t.slice(l),c=i?i.index:null,h=l+s-o;if((null===c||c===h)&&!(h<0||h>s)){var f=e.slice(0,h);if((m=e.slice(h))===u){var p=Math.min(l,h);if((v=a.slice(0,p))===(_=f.slice(0,p)))return d(v,a.slice(p),f.slice(p),u)}}if(null===c||c===l){var g=l,m=(f=e.slice(0,g),e.slice(g));if(f===a){var y=Math.min(o-g,s-g);if((b=u.slice(u.length-y))===(N=m.slice(m.length-y)))return d(a,u.slice(0,u.length-y),m.slice(0,m.length-y),b)}}}if(r.length>0&&i&&0===i.length){var v=t.slice(0,r.index),b=t.slice(r.index+r.length);if(!(s<(p=v.length)+(y=b.length))){var _=e.slice(0,p),N=e.slice(s-y);if(v===_&&b===N)return d(v,t.slice(p,o-y),e.slice(p,s-y),b)}}return null}(t,u,c);if(f)return f}var p=s(t,u),g=t.substring(0,p);p=l(t=t.substring(p),u=u.substring(p));var m=t.substring(t.length-p),y=function(t,a){var u;if(!t)return[[n,a]];if(!a)return[[e,t]];var c=t.length>a.length?t:a,h=t.length>a.length?a:t,f=c.indexOf(h);if(-1!==f)return u=[[n,c.substring(0,f)],[r,h],[n,c.substring(f+h.length)]],t.length>a.length&&(u[0][0]=u[2][0]=e),u;if(1===h.length)return[[e,t],[n,a]];var d=function(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||2*r.length=t.length?[r,i,o,a,h]:null}var o,a,u,c,h,f=i(n,r,Math.ceil(n.length/4)),d=i(n,r,Math.ceil(n.length/2));if(!f&&!d)return null;o=d?f&&f[4].length>d[4].length?f:d:f;t.length>e.length?(a=o[0],u=o[1],c=o[2],h=o[3]):(c=o[0],h=o[1],a=o[2],u=o[3]);var p=o[4];return[a,u,c,h,p]}(t,a);if(d){var p=d[0],g=d[1],m=d[2],y=d[3],v=d[4],b=i(p,m),_=i(g,y);return b.concat([[r,v]],_)}return function(t,r){for(var i=t.length,s=r.length,l=Math.ceil((i+s)/2),a=l,u=2*l,c=new Array(u),h=new Array(u),f=0;fi)m+=2;else if(E>s)g+=2;else if(p){if((O=a+d-_)>=0&&O=(x=i-h[O]))return o(t,r,T,E)}}for(var A=-b+y;A<=b-v;A+=2){for(var x,O=a+A,w=(x=A===-b||A!==b&&h[O-1]i)v+=2;else if(w>s)y+=2;else if(!p){if((N=a+d-A)>=0&&N=(x=i-x))return o(t,r,T,E)}}}}return[[e,t],[n,r]]}(t,a)}(t=t.substring(0,t.length-p),u=u.substring(0,u.length-p));return g&&y.unshift([r,g]),m&&y.push([r,m]),a(y,h),y}function o(t,e,n,r){var o=t.substring(0,n),s=e.substring(0,r),l=t.substring(n),a=e.substring(r),u=i(o,s),c=i(l,a);return u.concat(c)}function s(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,o=0;n=0&&f(t[m][1])){var y=t[m][1].slice(-1);if(t[m][1]=t[m][1].slice(0,-1),p=y+p,g=y+g,!t[m][1]){t.splice(m,1),u--;var v=m-1;t[v]&&t[v][0]===n&&(d++,g=t[v][1]+g,v--),t[v]&&t[v][0]===e&&(c++,p=t[v][1]+p,v--),m=v}}if(h(t[u][1])){y=t[u][1].charAt(0);t[u][1]=t[u][1].slice(1),p+=y,g+=y}}if(u0||g.length>0){p.length>0&&g.length>0&&(0!==(o=s(g,p))&&(m>=0?t[m][1]+=g.substring(0,o):(t.splice(0,0,[r,g.substring(0,o)]),u++),g=g.substring(o),p=p.substring(o)),0!==(o=l(g,p))&&(t[u][1]=g.substring(g.length-o)+t[u][1],g=g.substring(0,g.length-o),p=p.substring(0,p.length-o)));var b=d+c;0===p.length&&0===g.length?(t.splice(u-b,b),u-=b):0===p.length?(t.splice(u-b,b,[n,g]),u=u-b+1):0===g.length?(t.splice(u-b,b,[e,p]),u=u-b+1):(t.splice(u-b,b,[e,p],[n,g]),u=u-b+2)}0!==u&&t[u-1][0]===r?(t[u-1][1]+=t[u][1],t.splice(u,1)):u++,d=0,c=0,p="",g=""}""===t[t.length-1][1]&&t.pop();var _=!1;for(u=1;u=55296&&t<=56319}function c(t){return t>=56320&&t<=57343}function h(t){return c(t.charCodeAt(0))}function f(t){return u(t.charCodeAt(t.length-1))}function d(t,i,o,s){return f(t)||h(s)?null:function(t){for(var e=[],n=0;n0&&e.push(t[n]);return e}([[r,t],[e,i],[n,o],[r,s]])}function p(t,e,n){return i(t,e,n,!0)}p.INSERT=n,p.DELETE=e,p.EQUAL=r,t.exports=p},739:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",s="[object Boolean]",l="[object Date]",a="[object Function]",u="[object GeneratorFunction]",c="[object Map]",h="[object Number]",f="[object Object]",d="[object Promise]",p="[object RegExp]",g="[object Set]",m="[object String]",y="[object Symbol]",v="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",N="[object Float32Array]",E="[object Float64Array]",A="[object Int8Array]",x="[object Int16Array]",O="[object Int32Array]",w="[object Uint8Array]",T="[object Uint8ClampedArray]",k="[object Uint16Array]",S="[object Uint32Array]",L=/\w*$/,j=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,q={};q[o]=q["[object Array]"]=q[b]=q[_]=q[s]=q[l]=q[N]=q[E]=q[A]=q[x]=q[O]=q[c]=q[h]=q[f]=q[p]=q[g]=q[m]=q[y]=q[w]=q[T]=q[k]=q[S]=!0,q["[object Error]"]=q[a]=q[v]=!1;var R="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,I="object"==typeof self&&self&&self.Object===Object&&self,B=R||I||Function("return this")(),D=e&&!e.nodeType&&e,P=D&&t&&!t.nodeType&&t,M=P&&P.exports===D;function U(t,e){return t.set(e[0],e[1]),t}function z(t,e){return t.add(e),t}function F(t,e,n,r){var i=-1,o=t?t.length:0;for(r&&o&&(n=t[++i]);++i-1},Tt.prototype.set=function(t,e){var n=this.__data__,r=Ct(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},kt.prototype.clear=function(){this.__data__={hash:new wt,map:new(pt||Tt),string:new wt}},kt.prototype.delete=function(t){return Dt(this,t).delete(t)},kt.prototype.get=function(t){return Dt(this,t).get(t)},kt.prototype.has=function(t){return Dt(this,t).has(t)},kt.prototype.set=function(t,e){return Dt(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new Tt},St.prototype.delete=function(t){return this.__data__.delete(t)},St.prototype.get=function(t){return this.__data__.get(t)},St.prototype.has=function(t){return this.__data__.has(t)},St.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Tt){var r=n.__data__;if(!pt||r.length<199)return r.push([t,e]),this;n=this.__data__=new kt(r)}return n.set(t,e),this};var Mt=ct?W(ct,Object):function(){return[]},Ut=function(t){return et.call(t)};function zt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||C.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=i}(t.length)&&!Yt(t)}var Gt=ht||function(){return!1};function Yt(t){var e=Vt(t)?et.call(t):"";return e==a||e==u}function Vt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return Ht(t)?Lt(t):function(t){if(!Ft(t))return ft(t);var e=[];for(var n in Object(t))tt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}t.exports=function(t){return qt(t,!0,!0)}},216:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=1,o=2,s=9007199254740991,l="[object Arguments]",a="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",h="[object Date]",f="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Null]",v="[object Object]",b="[object Promise]",_="[object Proxy]",N="[object RegExp]",E="[object Set]",A="[object String]",x="[object Symbol]",O="[object Undefined]",w="[object WeakMap]",T="[object ArrayBuffer]",k="[object DataView]",S=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,j={};j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j[l]=j[a]=j[T]=j[c]=j[k]=j[h]=j[f]=j[d]=j[g]=j[m]=j[v]=j[N]=j[E]=j[A]=j[w]=!1;var C="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,q="object"==typeof self&&self&&self.Object===Object&&self,R=C||q||Function("return this")(),I=e&&!e.nodeType&&e,B=I&&t&&!t.nodeType&&t,D=B&&B.exports===I,P=D&&C.process,M=function(){try{return P&&P.binding&&P.binding("util")}catch(t){}}(),U=M&&M.isTypedArray;function z(t,e){for(var n=-1,r=null==t?0:t.length;++nu))return!1;var h=l.get(t);if(h&&l.get(e))return h==e;var f=-1,d=!0,p=n&o?new Tt:void 0;for(l.set(t,e),l.set(e,t);++f-1},Ot.prototype.set=function(t,e){var n=this.__data__,r=Lt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},wt.prototype.clear=function(){this.size=0,this.__data__={hash:new xt,map:new(ft||Ot),string:new xt}},wt.prototype.delete=function(t){var e=Pt(this,t).delete(t);return this.size-=e?1:0,e},wt.prototype.get=function(t){return Pt(this,t).get(t)},wt.prototype.has=function(t){return Pt(this,t).has(t)},wt.prototype.set=function(t,e){var n=Pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Tt.prototype.add=Tt.prototype.push=function(t){return this.__data__.set(t,r),this},Tt.prototype.has=function(t){return this.__data__.has(t)},kt.prototype.clear=function(){this.__data__=new Ot,this.size=0},kt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},kt.prototype.get=function(t){return this.__data__.get(t)},kt.prototype.has=function(t){return this.__data__.has(t)},kt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ot){var r=n.__data__;if(!ft||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new wt(r)}return n.set(t,e),this.size=n.size,this};var Ut=at?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n-1&&t%1==0&&t-1&&t%1==0&&t<=s}function Xt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Zt(t){return null!=t&&"object"==typeof t}var Qt=U?function(t){return function(e){return t(e)}}(U):function(t){return Zt(t)&&Vt(t.length)&&!!j[jt(t)]};function Jt(t){return null!=(e=t)&&Vt(e.length)&&!Yt(e)?St(t):It(t);var e}t.exports=function(t,e){return qt(t,e)}},124:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",s="[object AsyncFunction]",l="[object Function]",a="[object GeneratorFunction]",u="[object Null]",c="[object Object]",h="[object Proxy]",f="[object Undefined]",d=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[o]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[l]=g["[object Map]"]=g["[object Number]"]=g[c]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,v=m||y||Function("return this")(),b=e&&!e.nodeType&&e,_=b&&t&&!t.nodeType&&t,N=_&&_.exports===b,E=N&&m.process,A=function(){try{var t=_&&_.require&&_.require("util").types;return t||E&&E.binding&&E.binding("util")}catch(t){}}(),x=A&&A.isTypedArray;var O,w,T,k=Array.prototype,S=Function.prototype,L=Object.prototype,j=v["__core-js_shared__"],C=S.toString,q=L.hasOwnProperty,R=(O=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",I=L.toString,B=C.call(Object),D=RegExp("^"+C.call(q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=N?v.Buffer:void 0,M=v.Symbol,U=v.Uint8Array,z=P?P.allocUnsafe:void 0,F=(w=Object.getPrototypeOf,T=Object,function(t){return w(T(t))}),K=Object.create,$=L.propertyIsEnumerable,W=k.splice,H=M?M.toStringTag:void 0,G=function(){try{var t=bt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=P?P.isBuffer:void 0,V=Math.max,X=Date.now,Z=bt(v,"Map"),Q=bt(Object,"create"),J=function(){function t(){}return function(e){if(!jt(e))return{};if(K)return K(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function tt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},et.prototype.set=function(t,e){var n=this.__data__,r=lt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},nt.prototype.clear=function(){this.size=0,this.__data__={hash:new tt,map:new(Z||et),string:new tt}},nt.prototype.delete=function(t){var e=vt(this,t).delete(t);return this.size-=e?1:0,e},nt.prototype.get=function(t){return vt(this,t).get(t)},nt.prototype.has=function(t){return vt(this,t).has(t)},nt.prototype.set=function(t,e){var n=vt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},rt.prototype.clear=function(){this.__data__=new et,this.size=0},rt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},rt.prototype.get=function(t){return this.__data__.get(t)},rt.prototype.has=function(t){return this.__data__.has(t)},rt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof et){var r=n.__data__;if(!Z||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new nt(r)}return n.set(t,e),this.size=n.size,this};var ut,ct=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var l=o[ut?s:++r];if(!1===e(i[l],l,i))break}return t};function ht(t){return null==t?void 0===t?f:u:H&&H in Object(t)?function(t){var e=q.call(t,H),n=t[H];try{t[H]=void 0;var r=!0}catch(t){}var i=I.call(t);r&&(e?t[H]=n:delete t[H]);return i}(t):function(t){return I.call(t)}(t)}function ft(t){return Ct(t)&&ht(t)==o}function dt(t){return!(!jt(t)||function(t){return!!R&&R in t}(t))&&(St(t)?D:d).test(function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function pt(t){if(!jt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Nt(t),n=[];for(var r in t)("constructor"!=r||!e&&q.call(t,r))&&n.push(r);return n}function gt(t,e,n,r,i){t!==e&&ct(e,(function(o,s){if(i||(i=new rt),jt(o))!function(t,e,n,r,i,o,s){var l=Et(t,n),a=Et(e,n),u=s.get(a);if(u)return void ot(t,n,u);var h=o?o(l,a,n+"",t,e,s):void 0,f=void 0===h;if(f){var d=wt(a),p=!d&&kt(a),g=!d&&!p&&qt(a);h=a,d||p||g?wt(l)?h=l:Ct(_=l)&&Tt(_)?h=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(yt);function xt(t,e){return t===e||t!=t&&e!=e}var Ot=ft(function(){return arguments}())?ft:function(t){return Ct(t)&&q.call(t,"callee")&&!$.call(t,"callee")},wt=Array.isArray;function Tt(t){return null!=t&&Lt(t.length)&&!St(t)}var kt=Y||function(){return!1};function St(t){if(!jt(t))return!1;var e=ht(t);return e==l||e==a||e==s||e==h}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}function jt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ct(t){return null!=t&&"object"==typeof t}var qt=x?function(t){return function(e){return t(e)}}(x):function(t){return Ct(t)&&Lt(t.length)&&!!g[ht(t)]};function Rt(t){return Tt(t)?it(t,!0):pt(t)}var It,Bt=(It=function(t,e,n){gt(t,e,n)},mt((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(t,e,n){if(!jt(n))return!1;var r=typeof e;return!!("number"==r?Tt(n)&&_t(e,n.length):"string"==r&&e in n)&&xt(n[e],t)}(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n1)return e.map((function(e){return t(e)}));var r=e[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new o("Invalid definition");if("abstract"===r.blotName)throw new o("Cannot register abstract class");return c[r.blotName||r.attrName]=r,"string"==typeof r.keyName?l[r.keyName]=r:(null!=r.className&&(a[r.className]=r),null!=r.tagName&&(Array.isArray(r.tagName)?r.tagName=r.tagName.map((function(t){return t.toUpperCase()})):r.tagName=r.tagName.toUpperCase(),(Array.isArray(r.tagName)?r.tagName:[r.tagName]).forEach((function(t){null!=u[t]&&null!=r.className||(u[t]=r)})))),r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var i=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|i:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,(function(t){return t.name}))},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){return null!=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=i},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(11),s=n(5),l=n(0),a=function(t){function e(e){var n=t.call(this,e)||this;return n.build(),n}return i(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){t.prototype.attach.call(this),this.children.forEach((function(t){t.attach()}))},e.prototype.build=function(){var t=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach((function(e){try{var n=u(e);t.insertBefore(n,t.children.head||void 0)}catch(t){if(t instanceof l.ParchmentError)return;throw t}}))},e.prototype.deleteAt=function(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,(function(t,e,n){t.deleteAt(e,n)}))},e.prototype.descendant=function(t,n){var r=this.children.find(n),i=r[0],o=r[1];return null==t.blotName&&t(i)||null!=t.blotName&&i instanceof t?[i,o]:i instanceof e?i.descendant(t,o):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var i=[],o=r;return this.children.forEachAt(n,r,(function(n,r,s){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&i.push(n),n instanceof e&&(i=i.concat(n.descendants(t,r,o))),o-=s})),i},e.prototype.detach=function(){this.children.forEach((function(t){t.detach()})),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,(function(t,e,i){t.formatAt(e,i,n,r)}))},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),i=r[0],o=r[1];if(i)i.insertAt(o,e,n);else{var s=null==n?l.create("text",e):l.create(e,n);this.appendChild(s)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some((function(e){return t instanceof e})))throw new l.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce((function(t,e){return t+e.length()}),0)},e.prototype.moveChildren=function(t,e){this.children.forEach((function(n){t.insertBefore(n,e)}))},e.prototype.optimize=function(e){if(t.prototype.optimize.call(this,e),0===this.children.length)if(null!=this.statics.defaultChild){var n=l.create(this.statics.defaultChild);this.appendChild(n),n.optimize(e)}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),i=r[0],o=r[1],s=[[this,t]];return i instanceof e?s.concat(i.path(o,n)):(null!=i&&s.push([i,o]),s)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),(function(t,r,i){t=t.split(r,e),n.appendChild(t)})),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t,e){var n=this,r=[],i=[];t.forEach((function(t){t.target===n.domNode&&"childList"===t.type&&(r.push.apply(r,t.addedNodes),i.push.apply(i,t.removedNodes))})),i.forEach((function(t){if(!(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var e=l.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==n.domNode||e.detach())}})),r.filter((function(t){return t.parentNode==n.domNode})).sort((function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1})).forEach((function(t){var e=null;null!=t.nextSibling&&(e=l.find(t.nextSibling));var r=u(t);r.next==e&&null!=r.next||(null!=r.parent&&r.parent.removeChild(n),n.insertBefore(r,e||void 0))}))},e}(s.default);function u(t){var e=l.find(t);if(null==e)try{e=l.create(t)}catch(n){e=l.create(l.Scope.INLINE),[].slice.call(t.childNodes).forEach((function(t){e.domNode.appendChild(t)})),t.parentNode&&t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}e.default=a},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),s=n(6),l=n(2),a=n(0),u=function(t){function e(e){var n=t.call(this,e)||this;return n.attributes=new s.default(n.domNode),n}return i(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.format=function(t,e){var n=a.query(t);n instanceof o.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e,n){var r=this;t.prototype.update.call(this,e,n),e.some((function(t){return t.target===r.domNode&&"attributes"===t.type}))&&this.attributes.build()},e.prototype.wrap=function(n,r){var i=t.prototype.wrap.call(this,n,r);return i instanceof e&&i.statics.scope===this.statics.scope&&this.attributes.move(i),i},e}(l.default);e.default=u},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(5),s=n(0),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return(t={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=s.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,i){var o=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&i)o.wrap(n,i);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var s=r.create(this.statics.scope);o.wrap(s),s.format(n,i)}},t.prototype.insertAt=function(t,e,n){var i=null==n?r.create("text",e):r.create(e,n),o=this.split(t);this.parent.insertBefore(i,o)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=n(7),o=n(8),s=n(0),l=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=i.default.keys(this.domNode),l=o.default.keys(this.domNode);e.concat(n).concat(l).forEach((function(e){var n=s.query(e,s.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)}))},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach((function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)}))},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach((function(t){e.attributes[t].remove(e.domNode)})),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce((function(e,n){return e[n]=t.attributes[n].value(t.domNode),e}),{})},t}();e.default=l},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function o(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((function(t){return 0===t.indexOf(e+"-")}))}Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map((function(t){return t.split("-").slice(0,-1).join("-")}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){o(t,this.keyName).forEach((function(e){t.classList.remove(e)})),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=(o(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},e}(n(1).default);e.default=s},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function o(t){var e=t.split("-"),n=e.slice(1).map((function(t){return t[0].toUpperCase()+t.slice(1)})).join("");return e[0]+n}Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map((function(t){return t.split(":")[0].trim()}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[o(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[o(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[o(this.keyName)];return this.canAdd(t,e)?e:""},e}(n(1).default);e.default=s},function(t,e,n){t.exports=n(10)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(3),o=n(4),s=n(12),l=n(13),a=n(14),u=n(15),c=n(16),h=n(1),f=n(7),d=n(8),p=n(6),g=n(0),m={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:r.default,Format:i.default,Leaf:o.default,Embed:u.default,Scroll:s.default,Block:a.default,Inline:l.default,Text:c.default,Attributor:{Attribute:h.default,Class:f.default,Style:d.default,Store:p.default}};e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var i=n.length();if(ts?n(r,t-s,Math.min(e,s+a-t)):n(r,0,Math.min(a,t+e-s)),s+=a}},t.prototype.map=function(t){return this.reduce((function(e,n){return e.push(t(n)),e}),[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),s=n(0),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},a=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver((function(t){n.update(t)})),n.observer.observe(n.domNode,l),n.attach(),n}return i(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach((function(t){t.remove()})):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,i){this.update(),t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var i=[].slice.call(this.observer.takeRecords());i.length>0;)e.push(i.pop());for(var l=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[s.DATA_KEY].mutations&&(t.domNode[s.DATA_KEY].mutations=[]),e&&l(t.parent))},a=function(t){null!=t.domNode[s.DATA_KEY]&&null!=t.domNode[s.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(a),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach((function(t){var e=s.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(l(s.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,(function(t){var e=s.find(t,!1);l(e,!1),e instanceof o.default&&e.children.forEach((function(t){l(t,!1)}))}))):"attributes"===t.type&&l(e.prev)),l(e))})),this.children.forEach(a),i=(u=[].slice.call(this.observer.takeRecords())).slice();i.length>0;)e.push(i.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),(e=e||this.observer.takeRecords()).map((function(t){var e=s.find(t.target,!0);return null==e?null:null==e.domNode[s.DATA_KEY].mutations?(e.domNode[s.DATA_KEY].mutations=[t],e):(e.domNode[s.DATA_KEY].mutations.push(t),null)})).forEach((function(t){null!=t&&t!==r&&null!=t.domNode[s.DATA_KEY]&&t.update(t.domNode[s.DATA_KEY].mutations||[],n)})),null!=this.domNode[s.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=s.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);e.default=a},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=n(0),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var i=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach((function(t){t instanceof o.default||(t=t.wrap(e.blotName,!0)),i.attributes.copy(t)})),this.unwrap())},e.prototype.formatAt=function(e,n,r,i){null!=this.formats()[r]||s.query(r,s.Scope.ATTRIBUTE)?this.isolate(e,n).format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var i=this.next;i instanceof e&&i.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}(r,i.formats())&&(i.moveChildren(this),i.remove())},e.blotName="inline",e.scope=s.Scope.INLINE_BLOT,e.tagName="SPAN",e}(o.default);e.default=l},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=n(0),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.formats=function(n){var r=s.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=s.query(n,s.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,i){null!=s.query(r,s.Scope.BLOCK)?this.format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=s.query(n,s.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var i=this.split(e),o=s.create(n,r);i.parent.insertBefore(o,i)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=s.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);e.default=l},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,i){0===e&&n===this.length()?this.format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(n(4).default);e.default=o},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),s=n(0),l=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return i(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=s.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some((function(t){return"characterData"===t.type&&t.target===n.domNode}))&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=s.Scope.INLINE_BLOT,e}(o.default);e.default=l}])},t.exports=e()},204:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i,o=r(n(739)),s=r(n(216));!function(t){t.compose=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=o.default(e);for(var i in n||(r=Object.keys(r).reduce((function(t,e){return null!=r[e]&&(t[e]=r[e]),t}),{})),t)void 0!==t[i]&&void 0===e[i]&&(r[i]=t[i]);return Object.keys(r).length>0?r:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce((function(n,r){return s.default(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n}),{});return Object.keys(n).length>0?n:void 0},t.invert=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),t=t||{};var n=Object.keys(e).reduce((function(n,r){return e[r]!==t[r]&&void 0!==t[r]&&(n[r]=e[r]),n}),{});return Object.keys(t).reduce((function(n,r){return t[r]!==e[r]&&void 0===e[r]&&(n[r]=null),n}),n)},t.transform=function(t,e,n){if(void 0===n&&(n=!1),"object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce((function(n,r){return void 0===t[r]&&(n[r]=e[r]),n}),{});return Object.keys(r).length>0?r:void 0}}}(i||(i={})),e.default=i},802:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=r(n(284)),o=r(n(739)),s=r(n(216)),l=r(n(204)),a=r(n(933)),u=String.fromCharCode(0),c=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var n={};return"string"==typeof t&&0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},t.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=o.default(t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(s.default(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],n=[];return this.forEach((function(r){(t(r)?e:n).push(r)})),[e,n]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+a.default.length(e):e.delete?t-e.delete:t}),0)},t.prototype.length=function(){return this.reduce((function(t,e){return t+a.default.length(e)}),0)},t.prototype.slice=function(e,n){void 0===e&&(e=0),void 0===n&&(n=1/0);for(var r=[],i=a.default.iterator(this.ops),o=0;o0&&r.next(o.retain-u)}for(var c=new t(i);n.hasNext()||r.hasNext();)if("insert"===r.peekType())c.push(r.next());else if("delete"===n.peekType())c.push(n.next());else{var h=Math.min(n.peekLength(),r.peekLength()),f=n.next(h),d=r.next(h);if("number"==typeof d.retain){var p={};"number"==typeof f.retain?p.retain=h:p.insert=f.insert;var g=l.default.compose(f.attributes,d.attributes,"number"==typeof f.retain);if(g&&(p.attributes=g),c.push(p),!r.hasNext()&&s.default(c.ops[c.ops.length-1],p)){var m=new t(n.rest());return c.concat(m).chop()}}else"number"==typeof d.delete&&"number"==typeof f.retain&&c.push(d)}return c.chop()},t.prototype.concat=function(e){var n=new t(this.ops.slice());return e.ops.length>0&&(n.push(e.ops[0]),n.ops=n.ops.concat(e.ops.slice(1))),n},t.prototype.diff=function(e,n){if(this.ops===e.ops)return new t;var r=[this,e].map((function(t){return t.map((function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:u;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join("")})),o=new t,c=i.default(r[0],r[1],n),h=a.default.iterator(this.ops),f=a.default.iterator(e.ops);return c.forEach((function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case i.default.INSERT:n=Math.min(f.peekLength(),e),o.push(f.next(n));break;case i.default.DELETE:n=Math.min(e,h.peekLength()),h.next(n),o.delete(n);break;case i.default.EQUAL:n=Math.min(h.peekLength(),f.peekLength(),e);var r=h.next(n),a=f.next(n);s.default(r.insert,a.insert)?o.retain(n,l.default.diff(r.attributes,a.attributes)):o.push(a).delete(n)}e-=n}})),o.chop()},t.prototype.eachLine=function(e,n){void 0===n&&(n="\n");for(var r=a.default.iterator(this.ops),i=new t,o=0;r.hasNext();){if("insert"!==r.peekType())return;var s=r.peek(),l=a.default.length(s)-r.peekLength(),u="string"==typeof s.insert?s.insert.indexOf(n,l)-l:-1;if(u<0)i.push(r.next());else if(u>0)i.push(r.next(u));else{if(!1===e(i,r.next(1).attributes||{},o))return;o+=1,i=new t}}i.length()>0&&e(i,{},o)},t.prototype.invert=function(e){var n=new t;return this.reduce((function(t,r){if(r.insert)n.delete(a.default.length(r));else{if(r.retain&&null==r.attributes)return n.retain(r.retain),t+r.retain;if(r.delete||r.retain&&r.attributes){var i=r.delete||r.retain;return e.slice(t,t+i).forEach((function(t){r.delete?n.push(t):r.retain&&r.attributes&&n.retain(a.default.length(t),l.default.invert(r.attributes,t.attributes))})),t+i}}return t}),0),n.chop()},t.prototype.transform=function(e,n){if(void 0===n&&(n=!1),n=!!n,"number"==typeof e)return this.transformPosition(e,n);for(var r=e,i=a.default.iterator(this.ops),o=a.default.iterator(r.ops),s=new t;i.hasNext()||o.hasNext();)if("insert"!==i.peekType()||!n&&"insert"===o.peekType())if("insert"===o.peekType())s.push(o.next());else{var u=Math.min(i.peekLength(),o.peekLength()),c=i.next(u),h=o.next(u);if(c.delete)continue;h.delete?s.push(h):s.retain(u,l.default.transform(c.attributes,h.attributes,n))}else s.retain(a.default.length(i.next()));return s.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var n=a.default.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var i=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(r=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?i.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(r)}return[]},t}();e.default=o},933:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i,o=r(n(908));!function(t){t.iterator=function(t){return new o.default(t)},t.length=function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}}(i||(i={})),e.default=i}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};return(()=>{"use strict";n.d(r,{default:()=>Ie});var t=n(538),e=n.n(t),i=(n(423),n(124)),o=n.n(i),s=n(802),l=n.n(s),a=n(739),u=n.n(a),c=n(216),h=n.n(c);class f extends e().Embed{static value(){}insertInto(t,e){0===t.children.length?super.insertInto(t,e):this.remove()}length(){return 0}value(){return""}}f.blotName="break",f.tagName="BR";const d=f;class p extends e().Text{}const g=p;class m extends e().Inline{static compare(t,e){let n=m.order.indexOf(t),r=m.order.indexOf(e);return n>=0||r>=0?n-r:t===e?0:t0){let t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}m.allowedChildren=[m,e().Embed,g],m.order=["cursor","inline","underline","strike","italic","bold","script","link","code"];const y=m;class v extends e().Embed{attach(){super.attach(),this.attributes=new(e().Attributor.Store)(this.domNode)}delta(){return(new(l())).insert(this.value(),o()(this.formats(),this.attributes.values()))}format(t,n){let r=e().query(t,e().Scope.BLOCK_ATTRIBUTE);null!=r&&this.attributes.attribute(r,n)}formatAt(t,e,n,r){this.format(n,r)}insertAt(t,n,r){if("string"==typeof n&&n.endsWith("\n")){let r=e().create(b.blotName);this.parent.insertBefore(r,0===t?this:this.next),r.insertAt(0,n.slice(0,-1))}else super.insertAt(t,n,r)}}v.scope=e().Scope.BLOCK_BLOT;class b extends e().Block{constructor(t){super(t),this.cache={}}delta(){return null==this.cache.delta&&(this.cache.delta=this.descendants(e().Leaf).reduce(((t,e)=>0===e.length()?t:t.insert(e.value(),_(e))),new(l())).insert("\n",_(this))),this.cache.delta}deleteAt(t,e){super.deleteAt(t,e),this.cache={}}formatAt(t,n,r,i){n<=0||(e().query(r,e().Scope.BLOCK)?t+n===this.length()&&this.format(r,i):super.formatAt(t,Math.min(n,this.length()-t-1),r,i),this.cache={})}insertAt(t,e,n){if(null!=n)return super.insertAt(t,e,n);if(0===e.length)return;let r=e.split("\n"),i=r.shift();i.length>0&&(t1&&void 0!==arguments[1]&&arguments[1];if(e&&(0===t||t>=this.length()-1)){let e=this.clone();return 0===t?(this.parent.insertBefore(e,this),this):(this.parent.insertBefore(e,this.next),e)}{let n=super.split(t,e);return this.cache={},n}}}function _(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=o()(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:_(t.parent,e))}b.blotName="block",b.tagName="P",b.defaultChild="break",b.allowedChildren=[y,e().Embed,g];class N extends y{}N.blotName="code",N.tagName="CODE";class E extends b{static create(t){let e=super.create(t);return e.setAttribute("spellcheck",!1),e}static formats(){return!0}delta(){let t=this.domNode.textContent;return t.endsWith("\n")&&(t=t.slice(0,-1)),t.split("\n").reduce(((t,e)=>t.insert(e).insert("\n",this.formats())),new(l()))}format(t,e){if(t===this.statics.blotName&&e)return;let[n]=this.descendant(g,this.length()-1);null!=n&&n.deleteAt(n.length()-1,1),super.format(t,e)}formatAt(t,n,r,i){if(0===n)return;if(null==e().query(r,e().Scope.BLOCK)||r===this.statics.blotName&&i===this.statics.formats(this.domNode))return;let o=this.newlineIndex(t);if(o<0||o>=t+n)return;let s=this.newlineIndex(t,!0)+1,l=o-s+1,a=this.isolate(s,l),u=a.next;a.format(r,i),u instanceof E&&u.formatAt(0,t-s+n-l,r,i)}insertAt(t,e,n){if(null!=n)return;let[r,i]=this.descendant(g,t);r.insertAt(i,e)}length(){let t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}newlineIndex(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,t).lastIndexOf("\n");{let e=this.domNode.textContent.slice(t).indexOf("\n");return e>-1?t+e:-1}}optimize(t){this.domNode.textContent.endsWith("\n")||this.appendChild(e().create("text","\n")),super.optimize(t);let n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}replace(t){super.replace(t),[].slice.call(this.domNode.querySelectorAll("*")).forEach((function(t){let n=e().find(t);null==n?t.parentNode.removeChild(t):n instanceof e().Embed?n.remove():n.unwrap()}))}}E.blotName="code-block",E.tagName="PRE",E.TAB=" ";class A extends e().Embed{static value(){}constructor(t,e){super(t),this.selection=e,this.textNode=document.createTextNode(A.CONTENTS),this.domNode.appendChild(this.textNode),this._length=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(t,n){if(0!==this._length)return super.format(t,n);let r=this,i=0;for(;null!=r&&r.statics.scope!==e().Scope.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;null!=r&&(this._length=A.CONTENTS.length,r.optimize(),r.formatAt(i,A.CONTENTS.length,t,n),this._length=0)}index(t,e){return t===this.textNode?0:super.index(t,e)}length(){return this._length}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return;let t,n,r,i=this.textNode,o=this.selection.getNativeRange();for(null!=o&&o.start.node===i&&o.end.node===i&&([t,n,r]=[i,o.start.offset,o.end.offset]);null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==A.CONTENTS){let n=this.textNode.data.split(A.CONTENTS).join("");this.next instanceof g?(t=this.next.domNode,this.next.insertAt(0,n),this.textNode.data=A.CONTENTS):(this.textNode.data=n,this.parent.insertBefore(e().create(this.textNode),this),this.textNode=document.createTextNode(A.CONTENTS),this.domNode.appendChild(this.textNode))}return this.remove(),null!=n?([n,r]=[n,r].map((function(e){return Math.max(0,Math.min(t.data.length,e-1))})),{startNode:t,startOffset:n,endNode:t,endOffset:r}):void 0}update(t,e){if(t.some((t=>"characterData"===t.type&&t.target===this.textNode))){let t=this.restore();t&&(e.range=t)}}value(){return""}}A.blotName="cursor",A.className="ql-cursor",A.tagName="span",A.CONTENTS="\ufeff";const x=A,O=/^[ -~]*$/;function w(t,e){return Object.keys(e).reduce((function(n,r){return null==t[r]||(e[r]===t[r]?n[r]=e[r]:Array.isArray(e[r])?e[r].indexOf(t[r])<0&&(n[r]=e[r].concat([t[r]])):n[r]=[e[r],t[r]]),n}),{})}const T=class{constructor(t){this.scroll=t,this.delta=this.getDelta()}applyDelta(t){let n=!1;this.scroll.update();let r=this.scroll.length();return this.scroll.batchStart(),(t=function(t){return t.reduce((function(t,e){if(1===e.insert){let n=u()(e.attributes);return delete n.image,t.insert({image:e.attributes.image},n)}if(null==e.attributes||!0!==e.attributes.list&&!0!==e.attributes.bullet||((e=u()(e)).attributes.list?e.attributes.list="ordered":(e.attributes.list="bullet",delete e.attributes.bullet)),"string"==typeof e.insert){let n=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return t.insert(n,e.attributes)}return t.push(e)}),new(l()))}(t)).reduce(((t,i)=>{let l=i.retain||i.delete||i.insert.length||1,a=i.attributes||{};if(null!=i.insert){if("string"==typeof i.insert){let l=i.insert;l.endsWith("\n")&&n&&(n=!1,l=l.slice(0,-1)),t>=r&&!l.endsWith("\n")&&(n=!0),this.scroll.insertAt(t,l);let[u,c]=this.scroll.line(t),h=o()({},_(u));if(u instanceof b){let[t]=u.descendant(e().Leaf,c);h=o()(h,_(t))}a=s.AttributeMap.diff(h,a)||{}}else if("object"==typeof i.insert){let e=Object.keys(i.insert)[0];if(null==e)return t;this.scroll.insertAt(t,e,i.insert[e])}r+=l}return Object.keys(a).forEach((e=>{this.scroll.formatAt(t,l,e,a[e])})),t+l}),0),t.reduce(((t,e)=>"number"==typeof e.delete?(this.scroll.deleteAt(t,e.delete),t):t+(e.retain||e.insert.length||1)),0),this.scroll.batchEnd(),this.update(t)}deleteText(t,e){return this.scroll.deleteAt(t,e),this.update((new(l())).retain(t).delete(e))}formatLine(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(n).forEach((r=>{if(null!=this.scroll.whitelist&&!this.scroll.whitelist[r])return;let i=this.scroll.lines(t,Math.max(e,1)),o=e;i.forEach((e=>{let i=e.length();if(e instanceof E){let i=t-e.offset(this.scroll),s=e.newlineIndex(i+o)-i+1;e.formatAt(i,s,r,n[r])}else e.format(r,n[r]);o-=i}))})),this.scroll.optimize(),this.update((new(l())).retain(t).retain(e,u()(n)))}formatText(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(n).forEach((r=>{this.scroll.formatAt(t,e,r,n[r])})),this.update((new(l())).retain(t).retain(e,u()(n)))}getContents(t,e){return this.delta.slice(t,t+e)}getDelta(){return this.scroll.lines().reduce(((t,e)=>t.concat(e.delta())),new(l()))}getFormat(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],i=[];0===n?this.scroll.path(t).forEach((function(t){let[n]=t;n instanceof b?r.push(n):n instanceof e().Leaf&&i.push(n)})):(r=this.scroll.lines(t,n),i=this.scroll.descendants(e().Leaf,t,n));const[o,s]=[r,i].map((function(t){if(0===t.length)return{};let e=_(t.shift());for(;Object.keys(e).length>0;){let n=t.shift();if(null==n)return e;e=w(_(n),e)}return e}));return{...o,...s}}getText(t,e){return this.getContents(t,e).filter((function(t){return"string"==typeof t.insert})).map((function(t){return t.insert})).join("")}insertEmbed(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new(l())).retain(t).insert({[e]:n}))}insertText(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(n).forEach((r=>{this.scroll.formatAt(t,e.length,r,n[r])})),this.update((new(l())).retain(t).insert(e,u()(n)))}isBlank(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;let t=this.scroll.children.head;return t.statics.blotName===b.blotName&&(!(t.children.length>1)&&t.children.head instanceof d)}removeFormat(t,e){let n=this.getText(t,e),[r,i]=this.scroll.line(t+e),o=0,s=new(l());null!=r&&(o=r instanceof E?r.newlineIndex(i)-i+1:r.length()-i,s=r.delta().slice(i,i+o-1).insert("\n"));let a=this.getContents(t,e+o).diff((new(l())).insert(n).concat(s)),u=(new(l())).retain(t).concat(a);return this.applyDelta(u)}update(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=this.delta;if(1===n.length&&"characterData"===n[0].type&&n[0].target.data.match(O)&&e().find(n[0].target)){let o=e().find(n[0].target),s=_(o),a=o.offset(this.scroll),u=n[0].oldValue.replace(x.CONTENTS,""),c=(new(l())).insert(u),h=(new(l())).insert(o.value());t=(new(l())).retain(a).concat(c.diff(h,r)).reduce((function(t,e){return e.insert?t.insert(e.insert,s):t.push(e)}),new(l())),this.delta=i.compose(t)}else this.delta=this.getDelta(),t&&h()(i.compose(t),this.delta)||(t=i.diff(this.delta,r));return t}};var k=n(418),S=n.n(k);let L=["error","warn","log","info"],j="warn";function C(t){if(L.indexOf(t)<=L.indexOf(j)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r{t.handleDOM(...e)}))}))}));class P extends(S()){constructor(){super(),this.listeners={},this.on("error",I.error)}emit(){I.log.apply(I,arguments),super.emit.apply(this,arguments)}connect(){B.push(this)}disconnect(){B.splice(B.indexOf(this),1)}handleDOM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r{if(!D||e.getRootNode()===document)return t.contains(e);for(;!t.contains(e);){const t=e.getRootNode();if(!t||!t.host)return!1;e=t.host}return!0})(r,i))&&o(t,...n)}))}listenDOM(t,e,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push({node:e,handler:n})}}P.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},P.sources={API:"api",SILENT:"silent",USER:"user"};const M=P;class U{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=t,this.options=e}}U.DEFAULTS={};const z=U,F="function"==typeof window.ShadowRoot.prototype.getSelection,K=window.InputEvent&&"function"==typeof window.InputEvent.prototype.getTargetRanges,$=window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,W=!(!window.navigator.userAgent.match(/Trident/)||window.navigator.userAgent.match(/MSIE/)),H=window.navigator.userAgent.match(/Edge/);let G=!1;class Y{constructor(){this._ranges=[]}get rangeCount(){return this._ranges.length}getRangeAt(t){return this._ranges[t]}addRange(t){if(this._ranges.push(t),!G){let e=window.getSelection();e.removeAllRanges(),e.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset)}}removeAllRanges(){this._ranges=[]}}if(($||W||H)&&!F&&(window.ShadowRoot.prototype.getSelection=function(){return document.getSelection()}),!$&&!F&&K){let t=new Y;window.ShadowRoot.prototype.getSelection=function(){return t},window.addEventListener("selectionchange",(()=>{if(!G){G=!0;const e=function(){let t=document.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}();e&&"true"===e.getAttribute("contenteditable")?document.execCommand("indent"):t.removeAllRanges(),G=!1}}),!0),window.addEventListener("beforeinput",(e=>{if(G){const n=e.getTargetRanges()[0],r=new Range;r.setStart(n.startContainer,n.startOffset),r.setEnd(n.endContainer,n.endOffset),t.removeAllRanges(),t.addRange(r),e.preventDefault(),e.stopImmediatePropagation()}}),!0),window.addEventListener("selectstart",(()=>{t.removeAllRanges()}),!0)}const V=R("quill:selection");class X{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=t,this.length=e}}class Z{constructor(t,n){this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.rootDocument=this.root.getRootNode?this.root.getRootNode():document,this.cursor=e().create("cursor",this),this.lastRange=this.savedRange=new X(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,M.sources.USER),1)})),this.emitter.on(M.events.SCROLL_BEFORE_UPDATE,((t,e)=>{if(!this.hasFocus())return;const n=this.getNativeRange();if(null==n)return;const r=0===n.start.offset&&n.start.offset===n.end.offset&&this.rootDocument.getSelection()instanceof Y&&e.some((t=>"characterData"===t.type&&""===t.oldValue))?1:0;n.start.node!==this.cursor.textNode&&this.emitter.once(M.events.SCROLL_UPDATE,(()=>{try{this.root.contains(n.start.node)&&this.root.contains(n.end.node)&&this.setNativeRange(n.start.node,n.start.offset+r,n.end.node,n.end.offset+r),this.update(M.sources.SILENT)}catch(t){}}))})),this.emitter.on(M.events.SCROLL_OPTIMIZE,((t,e)=>{if(e.range){const{startNode:t,startOffset:n,endNode:r,endOffset:i}=e.range;this.setNativeRange(t,n,r,i)}})),this.update(M.sources.SILENT)}handleComposition(){this.root.addEventListener("compositionstart",(()=>{this.composing=!0})),this.root.addEventListener("compositionend",(()=>{if(this.composing=!1,this.cursor.parent){const t=this.cursor.restore();if(!t)return;setTimeout((()=>{this.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(M.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}format(t,n){if(null!=this.scroll.whitelist&&!this.scroll.whitelist[t])return;this.scroll.update();let r=this.getNativeRange();if(null!=r&&r.native.collapsed&&!e().query(t,e().Scope.BLOCK)){if(r.start.node!==this.cursor.textNode){let t=e().find(r.start.node,!1);if(null==t)return;if(t instanceof e().Leaf){let e=t.split(r.start.offset);t.parent.insertBefore(this.cursor,e)}else t.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(t,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;let r,[i,o]=this.scroll.leaf(t);if(null==i)return null;[r,o]=i.position(o,!0);let s=document.createRange();if(e>0)return s.setStart(r,o),[i,o]=this.scroll.leaf(t+e),null==i?null:([r,o]=i.position(o,!0),s.setEnd(r,o),s.getBoundingClientRect());{let t,e="left";return r instanceof Text?(o0&&(e="right")),{bottom:t.top+t.height,height:t.height,left:t[e],right:t[e],top:t.top,width:0}}}getNativeRange(){const t=this.rootDocument.getSelection();if(null==t||t.rangeCount<=0)return null;const e=t.getRangeAt(0);if(null==e)return null;let n=this.normalizeNative(e);return V.info("getNativeRange",n),n}getRange(){let t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return this.rootDocument.activeElement===this.root}normalizedToRange(t){let n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);let r=n.map((t=>{let[n,r]=t,i=e().find(n,!0),o=i.offset(this.scroll);return 0===r?o:i instanceof e().Container?o+i.length():o+i.index(n,r)})),i=Math.min(Math.max(...r),this.scroll.length()-1),o=Math.min(i,...r);return new X(o,i-o)}normalizeNative(t){if(!Q(this.root,t.startContainer)||!t.collapsed&&!Q(this.root,t.endContainer))return null;let e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach((function(t){let e=t.node,n=t.offset;for(;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n})),e}rangeToNative(t){let e=t.collapsed?[t.index]:[t.index,t.index+t.length],n=[],r=this.scroll.length();return e.forEach(((t,e)=>{t=Math.min(r-1,t);let i,[o,s]=this.scroll.leaf(t);[i,s]=o.position(s,0!==e),n.push(i,s)})),n.length<2&&(n=n.concat(n)),n}scrollIntoView(t){let e=this.lastRange;if(null==e)return;let n=this.getBounds(e.index,e.length);if(null==n)return;let r=this.scroll.length()-1,[i]=this.scroll.line(Math.min(e.index,r)),o=i;if(e.length>0&&([o]=this.scroll.line(Math.min(e.index+e.length,r))),null==i||null==o)return;let s=t.getBoundingClientRect();n.tops.bottom&&(t.scrollTop+=n.bottom-s.bottom)}setNativeRange(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(V.info("setNativeRange",t,e,n,r),null!=t&&(null==this.root.parentNode||null==t.parentNode||null==n.parentNode))return;const o=this.rootDocument.getSelection();if(null!=o)if(null!=t){this.hasFocus()||this.root.focus();let s=(this.getNativeRange()||{}).native;if(null==s||i||t!==s.startContainer||e!==s.startOffset||n!==s.endContainer||r!==s.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);let i=document.createRange();i.setStart(t,e),i.setEnd(n,r),o.removeAllRanges(),o.addRange(i)}}else o.removeAllRanges(),this.root.blur(),document.body.focus()}setRange(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M.sources.API;if("string"==typeof e&&(n=e,e=!1),V.info("setRange",t),null!=t){let n=this.rangeToNative(t);this.setNativeRange(...n,e)}else this.setNativeRange(null);this.update(n)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M.sources.USER,e=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,null!=this.lastRange&&(this.savedRange=this.lastRange),!h()(e,this.lastRange)){!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode&&this.cursor.restore();let n=[M.events.SELECTION_CHANGE,u()(this.lastRange),u()(e),t];this.emitter.emit(M.events.EDITOR_CHANGE,...n),t!==M.sources.SILENT&&this.emitter.emit(...n)}}}function Q(t,e){try{e.parentNode}catch(t){return!1}return e instanceof Text&&(e=e.parentNode),t.contains(e)}class J{constructor(t,e){this.quill=t,this.options=e,this.modules={}}init(){Object.keys(this.options.modules).forEach((t=>{null==this.modules[t]&&this.addModule(t)}))}addModule(t){let e=this.quill.constructor.import(`modules/${t}`);return this.modules[t]=new e(this.quill,this.options.modules[t]||{}),this.modules[t]}}J.DEFAULTS={modules:{}},J.themes={default:J};const tt=J;let et=R("quill");class nt{static debug(t){!0===t&&(t="log"),R.level(t)}static find(t){return t.__quill||e().find(t)}static import(t){return null==this.imports[t]&&et.error(`Cannot import ${t}. Are you sure it was registered?`),this.imports[t]}static register(t,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){let e=t.attrName||t.blotName;"string"==typeof e?this.register("formats/"+e,t,n):Object.keys(t).forEach((e=>{this.register(e,t[e],n)}))}else null==this.imports[t]||r||et.warn(`Overwriting ${t} with`,n),this.imports[t]=n,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==n.blotName?e().register(n):t.startsWith("modules")&&"function"==typeof n.register&&n.register()}constructor(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(t,e){if(e=o()({container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e),e.theme&&e.theme!==nt.DEFAULTS.theme){if(e.theme=nt.import(`themes/${e.theme}`),null==e.theme)throw new Error(`Invalid theme ${e.theme}. Did you register it?`)}else e.theme=tt;let n=o()({},e.theme.DEFAULTS);[n,e].forEach((function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach((function(e){!0===t.modules[e]&&(t.modules[e]={})}))}));let r=Object.keys(n.modules).concat(Object.keys(e.modules)).reduce((function(t,e){let n=nt.import(`modules/${e}`);return null==n?et.error(`Cannot load ${e} module. Are you sure you registered it?`):t[e]=n.DEFAULTS||{},t}),{});null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar});return e=o()({},nt.DEFAULTS,{modules:r},n,e),["bounds","container","scrollingContainer"].forEach((function(t){"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))})),e.modules=Object.keys(e.modules).reduce((function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t}),{}),e}(t,n),this.container=this.options.container,null==this.container)return et.error("Invalid Quill container",t);this.options.debug&&nt.debug(this.options.debug);let r=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 M,this.scroll=e().create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new T(this.scroll),this.selection=new Z(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(M.events.EDITOR_CHANGE,(t=>{t===M.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(M.events.SCROLL_UPDATE,((t,e)=>{let n=this.selection.lastRange,r=n&&0===n.length?n.index:void 0;rt.call(this,(()=>this.editor.update(null,e,r)),t)}));let i=this.clipboard.convert(`
${r}


`);this.setContents(i),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}addContainer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){let e=t;(t=document.createElement("div")).classList.add(e)}return this.container.insertBefore(t,e),t}blur(){this.selection.setRange(null)}deleteText(t,e,n){return[t,e,,n]=it(t,e,n),rt.call(this,(()=>this.editor.deleteText(t,e)),n,t,-1*e)}disable(){this.enable(!1)}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}focus(){let t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}format(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M.sources.API;return rt.call(this,(()=>{let r=this.getSelection(!0),i=new(l());if(null==r)return i;if(e().query(t,e().Scope.BLOCK))i=this.editor.formatLine(r.index,r.length,{[t]:n});else{if(0===r.length)return this.selection.format(t,n),i;i=this.editor.formatText(r.index,r.length,{[t]:n})}return this.setSelection(r,M.sources.SILENT),i}),r)}formatLine(t,e,n,r,i){let o;return[t,e,o,i]=it(t,e,n,r,i),rt.call(this,(()=>this.editor.formatLine(t,e,o)),i,t,0)}formatText(t,e,n,r,i){let o;return[t,e,o,i]=it(t,e,n,r,i),rt.call(this,(()=>this.editor.formatText(t,e,o)),i,t,0)}getBounds(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e="number"==typeof t?this.selection.getBounds(t,n):this.selection.getBounds(t.index,t.length);let r=this.container.getBoundingClientRect();return{bottom:e.bottom-r.top,height:e.height,left:e.left-r.left,right:e.right-r.left,top:e.top-r.top,width:e.width}}getContents(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;return[t,e]=it(t,e),this.editor.getContents(t,e)}getFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}getIndex(t){return t.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(t){return this.scroll.leaf(t)}getLine(t){return this.scroll.line(t)}getLines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}getModule(t){return this.theme.modules[t]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getText(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t;return[t,e]=it(t,e),this.editor.getText(t,e)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:nt.sources.API;return rt.call(this,(()=>this.editor.insertEmbed(t,e,n)),r,t)}insertText(t,e,n,r,i){let o;return[t,,o,i]=it(t,0,n,r,i),rt.call(this,(()=>this.editor.insertText(t,e,o)),i,t,e.length)}isEnabled(){return!this.container.classList.contains("ql-disabled")}off(){return this.emitter.off.apply(this.emitter,arguments)}on(){return this.emitter.on.apply(this.emitter,arguments)}once(){return this.emitter.once.apply(this.emitter,arguments)}pasteHTML(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}removeFormat(t,e,n){return[t,e,,n]=it(t,e,n),rt.call(this,(()=>this.editor.removeFormat(t,e)),n,t)}scrollIntoView(){this.selection.scrollIntoView(this.scrollingContainer)}setContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M.sources.API;return rt.call(this,(()=>{t=new(l())(t);let e=this.getLength(),n=this.editor.deleteText(0,e),r=this.editor.applyDelta(t),i=r.ops[r.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(this.editor.deleteText(this.getLength()-1,1),r.delete(1)),n.compose(r)}),e)}setSelection(t,e,n){null==t?this.selection.setRange(null,e||nt.sources.API):([t,e,,n]=it(t,e,n),this.selection.setRange(new X(t,e),n),n!==M.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer))}setText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M.sources.API,n=(new(l())).insert(t);return this.setContents(n,e)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}updateContents(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M.sources.API;return rt.call(this,(()=>(t=new(l())(t),this.editor.applyDelta(t,e))),e,!0)}}function rt(t,e,n,r){if(this.options.strict&&!this.isEnabled()&&e===M.sources.USER)return new(l());let i=null==n?null:this.getSelection(),o=this.editor.delta,s=t();if(null!=i&&(!0===n&&(n=i.index),null==r?i=ot(i,s,e):0!==r&&(i=ot(i,n,r,e)),this.setSelection(i,M.sources.SILENT)),s.length()>0){let t=[M.events.TEXT_CHANGE,s,o,e];this.emitter.emit(M.events.EDITOR_CHANGE,...t),e!==M.sources.SILENT&&this.emitter.emit(...t)}return s}function it(t,e,n,r,i){let o={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(i=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(i=r,r=n,n=e,e=0),"object"==typeof n?(o=n,i=r):"string"==typeof n&&(null!=r?o[n]=r:i=n),[t,e,o,i=i||M.sources.API]}function ot(t,e,n,r){if(null==t)return null;let i,o;return e instanceof l()?[i,o]=[t.index,t.index+t.length].map((function(t){return e.transformPosition(t,r!==M.sources.USER)})):[i,o]=[t.index,t.index+t.length].map((function(t){return t=0?t+n:Math.max(e,t+n)})),new X(i,o-i)}nt.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},nt.events=M.events,nt.sources=M.sources,nt.version="1.3.6",nt.imports={delta:l(),parchment:e(),"core/module":z,"core/theme":tt};class st extends e().Container{}st.allowedChildren=[b,v,st];const lt=st,at="\ufeff";class ut extends e().Embed{constructor(t){super(t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable",!1),[].slice.call(this.domNode.childNodes).forEach((t=>{this.contentNode.appendChild(t)})),this.leftGuard=document.createTextNode(at),this.rightGuard=document.createTextNode(at),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 n,r,i=t.data.split(at).join("");if(t===this.leftGuard)if(this.prev instanceof g){let t=this.prev.length();this.prev.insertAt(t,i),n={startNode:this.prev.domNode,startOffset:t+i.length}}else r=document.createTextNode(i),this.parent.insertBefore(e().create(r),this),n={startNode:r,startOffset:i.length};else t===this.rightGuard&&(this.next instanceof g?(this.next.insertAt(0,i),n={startNode:this.next.domNode,startOffset:i.length}):(r=document.createTextNode(i),this.parent.insertBefore(e().create(r),this.next),n={startNode:r,startOffset:i.length}));return t.data=at,n}update(t,e){t.forEach((t=>{if("characterData"===t.type&&(t.target===this.leftGuard||t.target===this.rightGuard)){let n=this.restore(t.target);n&&(e.range=n)}}))}}const ct=ut;function ht(t){return t instanceof b||t instanceof v}class ft extends e().Scroll{constructor(t,e){super(t),this.emitter=e.emitter,Array.isArray(e.whitelist)&&(this.whitelist=e.whitelist.reduce((function(t,e){return t[e]=!0,t}),{})),this.optimize(),this.enable()}batchStart(){this.batch=!0}batchEnd(){this.batch=!1,this.optimize()}deleteAt(t,e){let[n,r]=this.line(t),[i]=this.line(t+e);if(super.deleteAt(t,e),null!=i&&n!==i&&r>0){if(n instanceof v||i instanceof v)return void this.optimize();if(n instanceof E){let t=n.newlineIndex(n.length(),!0);if(t>-1&&(n=n.split(t+1),n===i))return void this.optimize()}else if(i instanceof E){let t=i.newlineIndex(0);t>-1&&i.split(t+1)}let t=i.children.head instanceof d?null:i.children.head;n.moveChildren(i,t),n.remove()}this.optimize()}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}formatAt(t,e,n,r){(null==this.whitelist||this.whitelist[n])&&(super.formatAt(t,e,n,r),this.optimize())}insertAt(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==e().query(n,e().Scope.BLOCK)){let t=e().create(this.statics.defaultChild);this.appendChild(t),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),t.insertAt(0,n,r)}else{let t=e().create(n,r);this.appendChild(t)}else super.insertAt(t,n,r);this.optimize()}}insertBefore(t,n){if(t.statics.scope===e().Scope.INLINE_BLOT){let n=e().create(this.statics.defaultChild);n.appendChild(t),t=n}super.insertBefore(t,n)}leaf(t){return this.path(t).pop()||[null,-1]}line(t){return t===this.length()?this.line(t-1):this.descendant(ht,t)}lines(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,r=(t,n,i)=>{let o=[],s=i;return t.children.forEachAt(n,i,(function(t,n,i){ht(t)?o.push(t):t instanceof e().Container&&(o=o.concat(r(t,n,s))),s-=i})),o};return r(this,t,n)}optimize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(super.optimize(t,e),t.length>0&&this.emitter.emit(M.events.SCROLL_OPTIMIZE,t,e))}path(t){return super.path(t).slice(1)}update(t){if(!0===this.batch)return;let e=M.sources.USER;"string"==typeof t&&(e=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(M.events.SCROLL_BEFORE_UPDATE,e,t),super.update(t.concat([])),t.length>0&&this.emitter.emit(M.events.SCROLL_UPDATE,e,t)}}ft.blotName="scroll",ft.className="ql-editor",ft.tagName="DIV",ft.defaultChild="block",ft.allowedChildren=[b,v,lt];const dt=ft;let pt={scope:e().Scope.BLOCK,whitelist:["right","center","justify"]},gt=new(e().Attributor.Attribute)("align","align",pt),mt=new(e().Attributor.Class)("align","ql-align",pt),yt=new(e().Attributor.Style)("align","text-align",pt);class vt extends e().Attributor.Style{value(t){let e=super.value(t);return e.startsWith("rgb(")?(e=e.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+e.split(",").map((function(t){return("00"+parseInt(t).toString(16)).slice(-2)})).join("")):e}}let bt=new(e().Attributor.Class)("color","ql-color",{scope:e().Scope.INLINE}),_t=new vt("color","color",{scope:e().Scope.INLINE}),Nt=new(e().Attributor.Class)("background","ql-bg",{scope:e().Scope.INLINE}),Et=new vt("background","background-color",{scope:e().Scope.INLINE}),At={scope:e().Scope.BLOCK,whitelist:["rtl"]},xt=new(e().Attributor.Attribute)("direction","dir",At),Ot=new(e().Attributor.Class)("direction","ql-direction",At),wt=new(e().Attributor.Style)("direction","direction",At),Tt={scope:e().Scope.INLINE,whitelist:["serif","monospace"]},kt=new(e().Attributor.Class)("font","ql-font",Tt);class St extends e().Attributor.Style{value(t){return super.value(t).replace(/["']/g,"")}}let Lt=new St("font","font-family",Tt),jt=new(e().Attributor.Class)("size","ql-size",{scope:e().Scope.INLINE,whitelist:["small","large","huge"]}),Ct=new(e().Attributor.Style)("size","font-size",{scope:e().Scope.INLINE,whitelist:["10px","18px","32px"]}),qt=R("quill:clipboard");const Rt="__ql-matcher",It=[[Node.TEXT_NODE,function(t,e){let n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!Ut(t.parentNode).whiteSpace.startsWith("pre")){let e=function(t,e){return(e=e.replace(/[^\u00a0]/g,"")).length<1&&t?" ":e};n=n.replace(/\r\n/g," ").replace(/\n/g," "),n=n.replace(/\s\s+/g,e.bind(e,!0)),(null==t.previousSibling&&Ft(t.parentNode)||null!=t.previousSibling&&Ft(t.previousSibling))&&(n=n.replace(/^\s+/,e.bind(e,!1))),(null==t.nextSibling&&Ft(t.parentNode)||null!=t.nextSibling&&Ft(t.nextSibling))&&(n=n.replace(/\s+$/,e.bind(e,!1)))}return e.insert(n)}],[Node.TEXT_NODE,Wt],["br",function(t,e){zt(e,"\n")||e.insert("\n");return e}],[Node.ELEMENT_NODE,Wt],[Node.ELEMENT_NODE,function(t,n){let r=e().query(t);if(null==r)return n;if(r.prototype instanceof e().Embed){let e={},i=r.value(t);null!=i&&(e[r.blotName]=i,n=(new(l())).insert(e,r.formats(t)))}else"function"==typeof r.formats&&(n=Mt(n,r.blotName,r.formats(t)));return n}],[Node.ELEMENT_NODE,function(t,n){let r=e().Attributor.Attribute.keys(t),i=e().Attributor.Class.keys(t),o=e().Attributor.Style.keys(t),s={};r.concat(i).concat(o).forEach((n=>{let r=e().query(n,e().Scope.ATTRIBUTE);null!=r&&(s[r.attrName]=r.value(t),s[r.attrName])||(r=Bt[n],null==r||r.attrName!==n&&r.keyName!==n||(s[r.attrName]=r.value(t)||void 0),r=Dt[n],null==r||r.attrName!==n&&r.keyName!==n||(r=Dt[n],s[r.attrName]=r.value(t)||void 0))})),Object.keys(s).length>0&&(n=Mt(n,s));return n}],[Node.ELEMENT_NODE,function(t,e){let n={},r=t.style||{};r.fontStyle&&"italic"===Ut(t).fontStyle&&(n.italic=!0);r.fontWeight&&(Ut(t).fontWeight.startsWith("bold")||parseInt(Ut(t).fontWeight)>=700)&&(n.bold=!0);Object.keys(n).length>0&&(e=Mt(e,n));parseFloat(r.textIndent||0)>0&&(e=(new(l())).insert("\t").concat(e));return e}],["li",function(t,n){let r=e().query(t);if(null==r||"list-item"!==r.blotName||!zt(n,"\n"))return n;let i=-1,o=t.parentNode;for(;!o.classList.contains("ql-clipboard");)"list"===(e().query(o)||{}).blotName&&(i+=1),o=o.parentNode;return i<=0?n:n.compose((new(l())).retain(n.length()-1).retain(1,{indent:i}))}],["b",$t.bind($t,"bold")],["i",$t.bind($t,"italic")],["style",function(){return new(l())}]],Bt=[gt,xt].reduce((function(t,e){return t[e.keyName]=e,t}),{}),Dt=[yt,Et,_t,wt,Lt,Ct].reduce((function(t,e){return t[e.keyName]=e,t}),{});class Pt extends z{constructor(t,e){super(t,e),this.quill.root.addEventListener("paste",this.onPaste.bind(this)),this.container=this.quill.addContainer("ql-clipboard"),this.container.setAttribute("contenteditable",!0),this.container.setAttribute("tabindex",-1),this.matchers=[],It.concat(this.options.matchers).forEach((t=>{let[e,n]=t;this.addMatcher(e,n)}))}addMatcher(t,e){this.matchers.push([t,e])}convert(t){if("string"==typeof t)return this.container.innerHTML=t.replace(/\>\r?\n +\<"),this.convert();const e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[E.blotName]){const t=this.container.innerText;return this.container.innerHTML="",(new(l())).insert(t,{[E.blotName]:e[E.blotName]})}let[n,r]=this.prepareMatching(),i=Kt(this.container,n,r);return zt(i,"\n")&&null==i.ops[i.ops.length-1].attributes&&(i=i.compose((new(l())).retain(i.length()-1).delete(1))),qt.log("convert",this.container.innerHTML,i),this.container.innerHTML="",i}dangerouslyPasteHTML(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:nt.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,nt.sources.SILENT);else{let r=this.convert(e);this.quill.updateContents((new(l())).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),nt.sources.SILENT)}}onPaste(t){if(t.defaultPrevented||!this.quill.isEnabled())return;let e=this.quill.getSelection(),n=(new(l())).retain(e.index),r=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(nt.sources.SILENT),setTimeout((()=>{n=n.concat(this.convert()).delete(e.length),this.quill.updateContents(n,nt.sources.USER),this.quill.setSelection(n.length()-e.length,nt.sources.SILENT),this.quill.scrollingContainer.scrollTop=r,this.quill.focus()}),1)}prepareMatching(){let t=[],e=[];return this.matchers.forEach((n=>{let[r,i]=n;switch(r){case Node.TEXT_NODE:e.push(i);break;case Node.ELEMENT_NODE:t.push(i);break;default:[].forEach.call(this.container.querySelectorAll(r),(t=>{t[Rt]=t[Rt]||[],t[Rt].push(i)}))}})),[t,e]}}function Mt(t,e,n){return"object"==typeof e?Object.keys(e).reduce((function(t,n){return Mt(t,n,e[n])}),t):t.reduce((function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,o()({},{[e]:n},r.attributes))}),new(l()))}function Ut(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};const e="__ql-computed-style";return t[e]||(t[e]=window.getComputedStyle(t))}function zt(t,e){let n="";for(let r=t.ops.length-1;r>=0&&n.length-1}function Kt(t,e,n){return t.nodeType===t.TEXT_NODE?n.reduce((function(e,n){return n(t,e)}),new(l())):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],((r,i)=>{let o=Kt(i,e,n);return i.nodeType===t.ELEMENT_NODE&&(o=e.reduce((function(t,e){return e(i,t)}),o),o=(i[Rt]||[]).reduce((function(t,e){return e(i,t)}),o)),r.concat(o)}),new(l())):new(l())}function $t(t,e,n){return Mt(n,t,!0)}function Wt(t,e){return zt(e,"\n")||(Ft(t)||e.length()>0&&t.nextSibling&&Ft(t.nextSibling))&&e.insert("\n"),e}Pt.DEFAULTS={matchers:[],matchVisual:!1};class Ht extends z{constructor(t,e){super(t,e),this.lastRecorded=0,this.ignoreChange=!1,this.clear(),this.quill.on(nt.events.EDITOR_CHANGE,((t,e,n,r)=>{t!==nt.events.TEXT_CHANGE||this.ignoreChange||(this.options.userOnly&&r!==nt.sources.USER?this.transform(e):this.record(e,n))})),this.quill.keyboard.addBinding({key:"Z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:"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))}change(t,n){if(0===this.stack[t].length)return;let r=this.stack[t].pop();this.stack[n].push(r),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r[t],nt.sources.USER),this.ignoreChange=!1;let i=function(t){let n=t.reduce((function(t,e){return t+=e.delete||0}),0),r=t.length()-n;(function(t){let n=t.ops[t.ops.length-1];if(null==n)return!1;if(null!=n.insert)return"string"==typeof n.insert&&n.insert.endsWith("\n");if(null!=n.attributes)return Object.keys(n.attributes).some((function(t){return null!=e().query(t,e().Scope.BLOCK)}));return!1})(t)&&(r-=1);return r}(r[t]);this.quill.setSelection(i)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(t,e){if(0===t.ops.length)return;this.stack.redo=[];let n=this.quill.getContents().diff(e),r=Date.now();if(this.lastRecorded+this.options.delay>r&&this.stack.undo.length>0){let e=this.stack.undo.pop();n=n.compose(e.undo),t=e.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}redo(){this.change("redo","undo")}transform(t){this.stack.undo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})),this.stack.redo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}))}undo(){this.change("undo","redo")}}Ht.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};let Gt=R("quill:keyboard");const Yt=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Vt extends z{static match(t,e){return e=re(e),!["altKey","ctrlKey","metaKey","shiftKey"].some((function(n){return!!e[n]!==t[n]&&null!==e[n]}))&&e.key===(t.which||t.keyCode)}constructor(t,e){super(t,e),this.bindings={},Object.keys(this.options.bindings).forEach((e=>{("list autofill"!==e||null==t.scroll.whitelist||t.scroll.whitelist.list)&&this.options.bindings[e]&&this.addBinding(this.options.bindings[e])})),this.addBinding({key:Vt.keys.ENTER,shiftKey:null},te),this.addBinding({key:Vt.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},(function(){})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:Vt.keys.BACKSPACE},{collapsed:!0},Zt),this.addBinding({key:Vt.keys.DELETE},{collapsed:!0},Qt)):(this.addBinding({key:Vt.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},Zt),this.addBinding({key:Vt.keys.DELETE},{collapsed:!0,suffix:/^.?$/},Qt)),this.addBinding({key:Vt.keys.BACKSPACE},{collapsed:!1},Jt),this.addBinding({key:Vt.keys.DELETE},{collapsed:!1},Jt),this.addBinding({key:Vt.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},Zt),this.listen()}addBinding(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=re(t);if(null==r||null==r.key)return Gt.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=o()(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}listen(){this.quill.root.addEventListener("keydown",(t=>{if(t.defaultPrevented)return;let n=t.which||t.keyCode,r=(this.bindings[n]||[]).filter((function(e){return Vt.match(t,e)}));if(0===r.length)return;let i=this.quill.getSelection();if(null==i||!this.quill.hasFocus())return;let[o,s]=this.quill.getLine(i.index),[l,a]=this.quill.getLeaf(i.index),[u,c]=0===i.length?[l,a]:this.quill.getLeaf(i.index+i.length),f=l instanceof e().Text?l.value().slice(0,a):"",d=u instanceof e().Text?u.value().slice(c):"",p={collapsed:0===i.length,empty:0===i.length&&o.length()<=1,format:this.quill.getFormat(i),offset:s,prefix:f,suffix:d};r.some((t=>{if(null!=t.collapsed&&t.collapsed!==p.collapsed)return!1;if(null!=t.empty&&t.empty!==p.empty)return!1;if(null!=t.offset&&t.offset!==p.offset)return!1;if(Array.isArray(t.format)){if(t.format.every((function(t){return null==p.format[t]})))return!1}else if("object"==typeof t.format&&!Object.keys(t.format).every((function(e){return!0===t.format[e]?null!=p.format[e]:!1===t.format[e]?null==p.format[e]:h()(t.format[e],p.format[e])})))return!1;return!(null!=t.prefix&&!t.prefix.test(p.prefix))&&(!(null!=t.suffix&&!t.suffix.test(p.suffix))&&!0!==t.handler.call(this,i,p))}))&&t.preventDefault()}))}}function Xt(t,n){const r=t===Vt.keys.LEFT?"prefix":"suffix";return{key:t,shiftKey:n,altKey:null,[r]:/^$/,handler:function(r){let i=r.index;t===Vt.keys.RIGHT&&(i+=r.length+1);const[o]=this.quill.getLeaf(i);return!(o instanceof e().Embed)||(t===Vt.keys.LEFT?n?this.quill.setSelection(r.index-1,r.length+1,nt.sources.USER):this.quill.setSelection(r.index-1,nt.sources.USER):n?this.quill.setSelection(r.index,r.length+1,nt.sources.USER):this.quill.setSelection(r.index+r.length+1,nt.sources.USER),!1)}}}function Zt(t,e){if(0===t.index||this.quill.getLength()<=1)return;let[n]=this.quill.getLine(t.index),r={};if(0===e.offset){let[e]=this.quill.getLine(t.index-1);if(null!=e&&e.length()>1){let e=n.formats(),i=this.quill.getFormat(t.index-1,1);r=s.AttributeMap.diff(e,i)||{}}}let i=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-i,i,nt.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index-i,i,r,nt.sources.USER),this.quill.focus()}function Qt(t,e){let n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(t.index>=this.quill.getLength()-n)return;let r={},i=0,[o]=this.quill.getLine(t.index);if(e.offset>=o.length()-1){let[e]=this.quill.getLine(t.index+1);if(e){let n=o.formats(),l=this.quill.getFormat(t.index,1);r=s.AttributeMap.diff(n,l)||{},i=e.length()}}this.quill.deleteText(t.index,n,nt.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+i-1,n,r,nt.sources.USER)}function Jt(t){let e=this.quill.getLines(t),n={};if(e.length>1){let t=e[0].formats(),r=e[e.length-1].formats();n=s.AttributeMap.diff(r,t)||{}}this.quill.deleteText(t,nt.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,nt.sources.USER),this.quill.setSelection(t.index,nt.sources.SILENT),this.quill.focus()}function te(t,n){t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);let r=Object.keys(n.format).reduce((function(t,r){return e().query(r,e().Scope.BLOCK)&&!Array.isArray(n.format[r])&&(t[r]=n.format[r]),t}),{});this.quill.insertText(t.index,"\n",r,nt.sources.USER),this.quill.setSelection(t.index+1,nt.sources.SILENT),this.quill.focus(),Object.keys(n.format).forEach((t=>{null==r[t]&&(Array.isArray(n.format[t])||"link"!==t&&this.quill.format(t,n.format[t],nt.sources.USER))}))}function ee(t){return{key:Vt.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(n){let r=e().query("code-block"),i=n.index,o=n.length,[s,l]=this.quill.scroll.descendant(r,i);if(null==s)return;let a=this.quill.getIndex(s),u=s.newlineIndex(l,!0)+1,c=s.newlineIndex(a+l+o),h=s.domNode.textContent.slice(u,c).split("\n");l=0,h.forEach(((e,n)=>{t?(s.insertAt(u+l,r.TAB),l+=r.TAB.length,0===n?i+=r.TAB.length:o+=r.TAB.length):e.startsWith(r.TAB)&&(s.deleteAt(u+l,r.TAB.length),l-=r.TAB.length,0===n?i-=r.TAB.length:o-=r.TAB.length),l+=e.length+1})),this.quill.update(nt.sources.USER),this.quill.setSelection(i,o,nt.sources.SILENT)}}}function ne(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],nt.sources.USER)}}}function re(t){if("string"==typeof t||"number"==typeof t)return re({key:t});if("object"==typeof t&&(t=u()(t,!1)),"string"==typeof t.key)if(null!=Vt.keys[t.key.toUpperCase()])t.key=Vt.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[Yt]=t.shortKey,delete t.shortKey),t}Vt.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},Vt.DEFAULTS={bindings:{bold:ne("bold"),italic:ne("italic"),underline:ne("underline"),indent:{key:Vt.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",nt.sources.USER)}},outdent:{key:Vt.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",nt.sources.USER)}},"outdent backspace":{key:Vt.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",nt.sources.USER):null!=e.format.list&&this.quill.format("list",!1,nt.sources.USER)}},"indent code-block":ee(!0),"outdent code-block":ee(!1),"remove tab":{key:Vt.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,nt.sources.USER)}},tab:{key:Vt.keys.TAB,handler:function(t){this.quill.history.cutoff();let e=(new(l())).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,nt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,nt.sources.SILENT)}},"list empty enter":{key:Vt.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,nt.sources.USER),e.format.indent&&this.quill.format("indent",!1,nt.sources.USER)}},"checklist enter":{key:Vt.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){let[e,n]=this.quill.getLine(t.index),r=o()({},e.formats(),{list:"checked"}),i=(new(l())).retain(t.index).insert("\n",r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,nt.sources.USER),this.quill.setSelection(t.index+1,nt.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:Vt.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){let[n,r]=this.quill.getLine(t.index),i=(new(l())).retain(t.index).insert("\n",e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,nt.sources.USER),this.quill.setSelection(t.index+1,nt.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){let n,r=e.prefix.length,[i,o]=this.quill.getLine(t.index);if(o>r)return!0;switch(e.prefix.trim()){case"[]":case"[ ]":n="unchecked";break;case"[x]":n="checked";break;case"-":case"*":n="bullet";break;default:n="ordered"}this.quill.insertText(t.index," ",nt.sources.USER),this.quill.history.cutoff();let s=(new(l())).retain(t.index-o).delete(r+1).retain(i.length()-2-o).retain(1,{list:n});this.quill.updateContents(s,nt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-r,nt.sources.SILENT)}},"code exit":{key:Vt.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){const[e,n]=this.quill.getLine(t.index),r=(new(l())).retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(r,nt.sources.USER)}},"embed left":Xt(Vt.keys.LEFT,!1),"embed left shift":Xt(Vt.keys.LEFT,!0),"embed right":Xt(Vt.keys.RIGHT,!1),"embed right shift":Xt(Vt.keys.RIGHT,!0)}},nt.register({"blots/block":b,"blots/block/embed":v,"blots/break":d,"blots/container":lt,"blots/cursor":x,"blots/embed":ct,"blots/inline":y,"blots/scroll":dt,"blots/text":g,"modules/clipboard":Pt,"modules/history":Ht,"modules/keyboard":Vt}),e().register(b,d,x,y,dt,g);const ie=nt;class oe extends e().Attributor.Class{add(t,e){if("+1"===e||"-1"===e){let n=this.value(t)||0;e="+1"===e?n+1:n-1}return 0===e?(this.remove(t),!0):super.add(t,e)}canAdd(t,e){return super.canAdd(t,e)||super.canAdd(t,parseInt(e))}value(t){return parseInt(super.value(t))||void 0}}let se=new oe("indent","ql-indent",{scope:e().Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class le extends b{}le.blotName="blockquote",le.tagName="blockquote";const ae=le;class ue extends b{static formats(t){return this.tagName.indexOf(t.tagName)+1}}ue.blotName="header",ue.tagName=["H1","H2","H3","H4","H5","H6"];const ce=ue;class he extends b{static formats(t){return t.tagName===this.tagName?void 0:super.formats(t)}format(t,n){t!==fe.blotName||n?super.format(t,n):this.replaceWith(e().create(this.statics.scope))}remove(){null==this.prev&&null==this.next?this.parent.remove():super.remove()}replaceWith(t,e){return this.parent.isolate(this.offset(this.parent),this.length()),t===this.parent.statics.blotName?(this.parent.replaceWith(t,e),this):(this.parent.unwrap(),super.replaceWith(t,e))}}he.blotName="list-item",he.tagName="LI";class fe extends lt{static create(t){let e="ordered"===t?"OL":"UL",n=super.create(e);return"checked"!==t&&"unchecked"!==t||n.setAttribute("data-checked","checked"===t),n}static formats(t){return"OL"===t.tagName?"ordered":"UL"===t.tagName?t.hasAttribute("data-checked")?"true"===t.getAttribute("data-checked")?"checked":"unchecked":"bullet":void 0}constructor(t){super(t);const n=n=>{if(n.target.parentNode!==t)return;let r=this.statics.formats(t),i=e().find(n.target);"checked"===r?i.format("list","unchecked"):"unchecked"===r&&i.format("list","checked")};t.addEventListener("touchstart",n),t.addEventListener("mousedown",n)}format(t,e){this.children.length>0&&this.children.tail.format(t,e)}formats(){return{[this.statics.blotName]:this.statics.formats(this.domNode)}}insertBefore(t,e){if(t instanceof he)super.insertBefore(t,e);else{let n=null==e?this.length():e.offset(this),r=this.split(n);r.parent.insertBefore(t,r)}}optimize(t){super.optimize(t);let e=this.next;null!=e&&e.prev===this&&e.statics.blotName===this.statics.blotName&&e.domNode.tagName===this.domNode.tagName&&e.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(e.moveChildren(this),e.remove())}replace(t){if(t.statics.blotName!==this.statics.blotName){let n=e().create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}super.replace(t)}}fe.blotName="list",fe.scope=e().Scope.BLOCK_BLOT,fe.tagName=["OL","UL"],fe.defaultChild="list-item",fe.allowedChildren=[he];class de extends y{static create(){return super.create()}static formats(){return!0}optimize(t){super.optimize(t),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}de.blotName="bold",de.tagName=["STRONG","B"];const pe=de;class ge extends pe{}ge.blotName="italic",ge.tagName=["EM","I"];const me=ge;class ye extends y{static create(t){let e=super.create(t);return t=this.sanitize(t),e.setAttribute("href",t),e.setAttribute("target","_blank"),e}static formats(t){return t.getAttribute("href")}static sanitize(t){return ve(t,this.PROTOCOL_WHITELIST)?t:this.SANITIZED_URL}format(t,e){if(t!==this.statics.blotName||!e)return super.format(t,e);e=this.constructor.sanitize(e),this.domNode.setAttribute("href",e)}}function ve(t,e){let n=document.createElement("a");n.href=t;let r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}ye.blotName="link",ye.tagName="A",ye.SANITIZED_URL="about:blank",ye.PROTOCOL_WHITELIST=["http","https","mailto","tel"];class be extends y{static create(t){return"super"===t?document.createElement("sup"):"sub"===t?document.createElement("sub"):super.create(t)}static formats(t){return"SUB"===t.tagName?"sub":"SUP"===t.tagName?"super":void 0}}be.blotName="script",be.tagName=["SUB","SUP"];const _e=be;class Ne extends y{}Ne.blotName="strike",Ne.tagName="S";const Ee=Ne;class Ae extends y{}Ae.blotName="underline",Ae.tagName="U";const xe=Ae,Oe=["alt","height","width"];class we extends e().Embed{static create(t){let e=super.create(t);return"string"==typeof t&&e.setAttribute("src",this.sanitize(t)),e}static formats(t){return Oe.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}static match(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}static sanitize(t){return ve(t,["http","https","data"])?t:"//:0"}static value(t){return t.getAttribute("src")}format(t,e){Oe.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}we.blotName="image",we.tagName="IMG";const Te=we,ke=["height","width"];class Se extends v{static create(t){let e=super.create(t);return e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen",!0),e.setAttribute("src",this.sanitize(t)),e}static formats(t){return ke.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}static sanitize(t){return ye.sanitize(t)}static value(t){return t.getAttribute("src")}format(t,e){ke.indexOf(t)>-1?e?this.domNode.setAttribute(t,e):this.domNode.removeAttribute(t):super.format(t,e)}}Se.blotName="video",Se.className="ql-video",Se.tagName="IFRAME";const Le=Se,je="getRootNode"in document;let Ce=R("quill:toolbar");class qe extends z{constructor(t,e){if(super(t,e),Array.isArray(this.options.container)){let e=document.createElement("div");!function(t,e){Array.isArray(e[0])||(e=[e]);e.forEach((function(e){let n=document.createElement("span");n.classList.add("ql-formats"),e.forEach((function(t){if("string"==typeof t)Re(n,t);else{let e=Object.keys(t)[0],r=t[e];Array.isArray(r)?function(t,e,n){let r=document.createElement("select");r.classList.add("ql-"+e),n.forEach((function(t){let e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)})),t.appendChild(r)}(n,e,r):Re(n,e,r)}})),t.appendChild(n)}))}(e,this.options.container),t.container.parentNode.insertBefore(e,t.container),this.container=e}else if("string"==typeof this.options.container){const e=je?t.container.getRootNode():document;this.container=e.querySelector(this.options.container)}else this.container=this.options.container;if(!(this.container instanceof HTMLElement))return Ce.error("Container required for toolbar",this.options);this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},Object.keys(this.options.handlers).forEach((t=>{this.addHandler(t,this.options.handlers[t])})),[].forEach.call(this.container.querySelectorAll("button, select"),(t=>{this.attach(t)})),this.quill.on(nt.events.EDITOR_CHANGE,((t,e)=>{t===nt.events.SELECTION_CHANGE&&this.update(e)})),this.quill.on(nt.events.SCROLL_OPTIMIZE,(()=>{let[t]=this.quill.selection.getRange();this.update(t)}))}addHandler(t,e){this.handlers[t]=e}attach(t){let n=[].find.call(t.classList,(t=>0===t.indexOf("ql-")));if(!n)return;if(n=n.slice(3),"BUTTON"===t.tagName&&t.setAttribute("type","button"),null==this.handlers[n]){if(null!=this.quill.scroll.whitelist&&null==this.quill.scroll.whitelist[n])return void Ce.warn("ignoring attaching to disabled format",n,t);if(null==e().query(n))return void Ce.warn("ignoring attaching to nonexistent format",n,t)}let r="SELECT"===t.tagName?"change":"click";t.addEventListener(r,(r=>{let i;if("SELECT"===t.tagName){if(t.selectedIndex<0)return;let e=t.options[t.selectedIndex];i=!e.hasAttribute("selected")&&(e.value||!1)}else i=!t.classList.contains("ql-active")&&(t.value||!t.hasAttribute("value")),r.preventDefault();this.quill.focus();let[o]=this.quill.selection.getRange();if(null!=this.handlers[n])this.handlers[n].call(this,i);else if(e().query(n).prototype instanceof e().Embed){if(i=prompt(`Enter ${n}`),!i)return;this.quill.updateContents((new(l())).retain(o.index).delete(o.length).insert({[n]:i}),nt.sources.USER)}else this.quill.format(n,i,nt.sources.USER);this.update(o)})),this.controls.push([n,t])}update(t){let e=null==t?{}:this.quill.getFormat(t);this.controls.forEach((function(n){let[r,i]=n;if("SELECT"===i.tagName){let n;if(null==t)n=null;else if(null==e[r])n=i.querySelector("option[selected]");else if(!Array.isArray(e[r])){let t=e[r];"string"==typeof t&&(t=t.replace(/\"/g,'\\"')),n=i.querySelector(`option[value="${t}"]`)}null==n?(i.value="",i.selectedIndex=-1):n.selected=!0}else if(null==t)i.classList.remove("ql-active");else if(i.hasAttribute("value")){let t=e[r]===i.getAttribute("value")||null!=e[r]&&e[r].toString()===i.getAttribute("value")||null==e[r]&&!i.getAttribute("value");i.classList.toggle("ql-active",t)}else i.classList.toggle("ql-active",null!=e[r])}))}}function Re(t,e,n){let r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+e),null!=n&&(r.value=n),t.appendChild(r)}qe.DEFAULTS={},qe.DEFAULTS={container:null,handlers:{clean:function(){let t=this.quill.getSelection();if(null!=t)if(0==t.length){let t=this.quill.getFormat();Object.keys(t).forEach((t=>{null!=e().query(t,e().Scope.INLINE)&&this.quill.format(t,!1)}))}else this.quill.removeFormat(t,nt.sources.USER)},direction:function(t){let e=this.quill.getFormat().align;"rtl"===t&&null==e?this.quill.format("align","right",nt.sources.USER):t||"right"!==e||this.quill.format("align",!1,nt.sources.USER),this.quill.format("direction",t,nt.sources.USER)},indent:function(t){let e=this.quill.getSelection(),n=this.quill.getFormat(e),r=parseInt(n.indent||0);if("+1"===t||"-1"===t){let e="+1"===t?1:-1;"rtl"===n.direction&&(e*=-1),this.quill.format("indent",r+e,nt.sources.USER)}},link:function(t){!0===t&&(t=prompt("Enter link URL:")),this.quill.format("link",t,nt.sources.USER)},list:function(t){let e=this.quill.getSelection(),n=this.quill.getFormat(e);"check"===t?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,nt.sources.USER):this.quill.format("list","unchecked",nt.sources.USER):this.quill.format("list",t,nt.sources.USER)}}},ie.register({"attributors/attribute/direction":xt,"attributors/class/align":mt,"attributors/class/background":Nt,"attributors/class/color":bt,"attributors/class/direction":Ot,"attributors/class/font":kt,"attributors/class/size":jt,"attributors/style/align":yt,"attributors/style/background":Et,"attributors/style/color":_t,"attributors/style/direction":wt,"attributors/style/font":Lt,"attributors/style/size":Ct},!0),ie.register({"formats/align":mt,"formats/direction":Ot,"formats/indent":se,"formats/background":Et,"formats/color":_t,"formats/font":kt,"formats/size":jt,"formats/blockquote":ae,"formats/code-block":E,"formats/header":ce,"formats/list":fe,"formats/bold":pe,"formats/code":N,"formats/italic":me,"formats/link":ye,"formats/script":_e,"formats/strike":Ee,"formats/underline":xe,"formats/image":Te,"formats/video":Le,"formats/list/item":he,"modules/toolbar":qe},!0);const Ie=ie})(),r=r.default})())); //# sourceMappingURL=vaadin-quill.js.map diff --git a/packages/rich-text-editor/vendor/vaadin-quill.js.map b/packages/rich-text-editor/vendor/vaadin-quill.js.map index d97691ad6a..e398281073 100644 --- a/packages/rich-text-editor/vendor/vaadin-quill.js.map +++ b/packages/rich-text-editor/vendor/vaadin-quill.js.map @@ -1 +1 @@ -{"version":3,"file":"vaadin-quill.min.js","mappings":";;;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,GACjB,CATD,CASGK,MAAM,IACT,M,gBCVA,IAAIC,EAAOC,SAASC,cAAc,OAElC,GADAF,EAAKG,UAAUC,OAAO,cAAc,GAChCJ,EAAKG,UAAUE,SAAS,cAAe,CACzC,IAAIC,EAAUC,aAAaC,UAAUJ,OACrCG,aAAaC,UAAUJ,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GAC1B,yBAA0BE,KACzB,GAGH1E,GAAM5c,SAAS,CACb,gBAAiBwgB,GACjB,oBAAqBQ,GACrB,iBAAkB0J,GAElB,qBAAsB5J,GACtB,gBAAiBF,GACjB,eAAgBM,GAChB,eAAgBG,GAEhB,qBAAsB2G,GACtB,qBAAsBlX,EACtB,iBAAkBmX,GAClB,eAAgBE,GAEhB,eAAgBG,GAChB,eAAgBqC,EAChB,iBAAkBpC,GAClB,eAAgBC,GAChB,iBAAkBS,GAClB,iBAAkBC,GAClB,oBAAqBC,GAErB,gBAAiBE,GACjB,gBAAiBC,GAEjB,oBAAqBpB,GAIrB,kBAAmBqB,KAUlB,GAGH,W,kB3E7FA","sources":["webpack://Quill/webpack/universalModuleDefinition","webpack://Quill/./core/polyfill.js","webpack://Quill/./node_modules/eventemitter3/index.js","webpack://Quill/./node_modules/fast-diff/diff.js","webpack://Quill/./node_modules/lodash.clonedeep/index.js","webpack://Quill/./node_modules/lodash.isequal/index.js","webpack://Quill/./node_modules/lodash.merge/index.js","webpack://Quill/../../../../webpack/universalModuleDefinition","webpack://Quill/../../../../webpack/bootstrap 3c334e19bc1efdeb80ab","webpack://Quill/../../../../src/registry.ts","webpack://Quill/../../../../src/attributor/attributor.ts","webpack://Quill/../../../../src/blot/abstract/container.ts","webpack://Quill/../../../../src/blot/abstract/format.ts","webpack://Quill/../../../../src/blot/abstract/leaf.ts","webpack://Quill/../../../../src/blot/abstract/shadow.ts","webpack://Quill/../../../../src/attributor/store.ts","webpack://Quill/../../../../src/attributor/class.ts","webpack://Quill/../../../../src/attributor/style.ts","webpack://Quill/../../../../src/parchment.ts","webpack://Quill/../../../../src/collection/linked-list.ts","webpack://Quill/../../../../src/blot/scroll.ts","webpack://Quill/../../../../src/blot/inline.ts","webpack://Quill/../../../../src/blot/block.ts","webpack://Quill/../../../../src/blot/embed.ts","webpack://Quill/../../../../src/blot/text.ts","webpack://Quill/./node_modules/quill-delta/src/AttributeMap.ts","webpack://Quill/./node_modules/quill-delta/src/Delta.ts","webpack://Quill/./node_modules/quill-delta/src/Iterator.ts","webpack://Quill/./node_modules/quill-delta/src/Op.ts","webpack://Quill/webpack/bootstrap","webpack://Quill/webpack/runtime/compat get default export","webpack://Quill/webpack/runtime/define property getters","webpack://Quill/webpack/runtime/global","webpack://Quill/webpack/runtime/hasOwnProperty shorthand","webpack://Quill/webpack/runtime/node module decorator","webpack://Quill/./blots/break.js","webpack://Quill/./blots/text.js","webpack://Quill/./blots/inline.js","webpack://Quill/./blots/block.js","webpack://Quill/./formats/code.js","webpack://Quill/./blots/cursor.js","webpack://Quill/./core/editor.js","webpack://Quill/./core/logger.js","webpack://Quill/./core/emitter.js","webpack://Quill/./core/module.js","webpack://Quill/./core/shadow-selection-polyfill.js","webpack://Quill/./core/selection.js","webpack://Quill/./core/theme.js","webpack://Quill/./core/quill.js","webpack://Quill/./blots/container.js","webpack://Quill/./blots/embed.js","webpack://Quill/./blots/scroll.js","webpack://Quill/./formats/align.js","webpack://Quill/./formats/color.js","webpack://Quill/./formats/background.js","webpack://Quill/./formats/direction.js","webpack://Quill/./formats/font.js","webpack://Quill/./formats/size.js","webpack://Quill/./modules/clipboard.js","webpack://Quill/./modules/history.js","webpack://Quill/./modules/keyboard.js","webpack://Quill/./core.js","webpack://Quill/./formats/indent.js","webpack://Quill/./formats/blockquote.js","webpack://Quill/./formats/header.js","webpack://Quill/./formats/list.js","webpack://Quill/./formats/bold.js","webpack://Quill/./formats/italic.js","webpack://Quill/./formats/link.js","webpack://Quill/./formats/script.js","webpack://Quill/./formats/strike.js","webpack://Quill/./formats/underline.js","webpack://Quill/./formats/image.js","webpack://Quill/./formats/video.js","webpack://Quill/./modules/toolbar.js","webpack://Quill/./vaadin-quill.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(self, () => {\nreturn ","let elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n let _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function(token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position){\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function(searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n // Disable resizing in Firefox\n document.execCommand(\"enableObjectResizing\", false, false);\n // Disable automatic linkifying in IE11\n document.execCommand(\"autoUrlDetect\", false, false);\n});\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 !== 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i), shorttext.substring(j));\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i), shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(\n j - suffixLength, j) + shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length - commonlength);\n text_delete = text_delete.substring(0, text_delete.length - commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n};\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xD800 && charCode <= 0xDBFF;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xDC00 && charCode <= 0xDFFF;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after]\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange = typeof cursor_pos === 'number' ?\n { index: cursor_pos, length: 0 } : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === 'number' ?\n null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeMax = Math.max,\n nativeNow = Date.now;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = merge;\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Parchment\"] = factory();\n\telse\n\t\troot[\"Parchment\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3c334e19bc1efdeb80ab","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ParchmentError = /** @class */ (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n var _this = this;\n message = '[Parchment] ' + message;\n _this = _super.call(this, message) || this;\n _this.message = message;\n _this.name = _this.constructor.name;\n return _this;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\nvar Scope;\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(Scope = exports.Scope || (exports.Scope = {}));\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = \n // @ts-ignore\n input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n // @ts-ignore\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n // @ts-ignore\n }\n else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null)\n return null;\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/registry.ts\n// module id = 0\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../registry\");\nvar Attributor = /** @class */ (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match == null)\n return false;\n if (this.whitelist == null)\n return true;\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n }\n else {\n return this.whitelist.indexOf(value) > -1;\n }\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n var value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n };\n return Attributor;\n}());\nexports.default = Attributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/attributor/attributor.ts\n// module id = 1\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar linked_list_1 = require(\"../../collection/linked-list\");\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar ContainerBlot = /** @class */ (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.build();\n return _this;\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.children.forEach(function (child) {\n child.attach();\n });\n };\n ContainerBlot.prototype.build = function () {\n var _this = this;\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice\n .call(this.domNode.childNodes)\n .reverse()\n .forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head || undefined);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [];\n var lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null &&\n !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize(context);\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations, context) {\n var _this = this;\n var addedNodes = [];\n var removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes\n .filter(function (node) {\n return node.parentNode == _this.domNode;\n })\n .sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot || undefined);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot;\n}\nexports.default = ContainerBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/abstract/container.ts\n// module id = 2\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"../../attributor/attributor\");\nvar store_1 = require(\"../../attributor/store\");\nvar container_1 = require(\"./container\");\nvar Registry = require(\"../../registry\");\nvar FormatBlot = /** @class */ (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.attributes = new store_1.default(_this.domNode);\n return _this;\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations, context) {\n var _this = this;\n _super.prototype.update.call(this, mutations, context);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nexports.default = FormatBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/abstract/format.ts\n// module id = 3\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar LeafBlot = /** @class */ (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (this.domNode === node ||\n this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return Math.min(offset, 1);\n }\n return -1;\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nexports.default = LeafBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/abstract/leaf.ts\n// module id = 4\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../../registry\");\nvar ShadowBlot = /** @class */ (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n // @ts-ignore\n this.domNode[Registry.DATA_KEY] = { blot: this };\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n if (this.parent != null) {\n this.scroll = this.parent.scroll;\n }\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode(false);\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent_1 = Registry.create(this.statics.scope);\n blot.wrap(parent_1);\n parent_1.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (refBlot === void 0) { refBlot = null; }\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n var refDomNode = null;\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (this.domNode.parentNode != parentBlot.domNode ||\n this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n this.attach();\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function (context) {\n // TODO clean up once we use WeakMap\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY] != null) {\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations, context) {\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nexports.default = ShadowBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/abstract/shadow.ts\n// module id = 5\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nvar class_1 = require(\"./class\");\nvar style_1 = require(\"./style\");\nvar Registry = require(\"../registry\");\nvar AttributorStore = /** @class */ (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nexports.default = AttributorStore;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/attributor/store.ts\n// module id = 6\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = /** @class */ (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name\n .split('-')\n .slice(0, -1)\n .join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n var value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n };\n return ClassAttributor;\n}(attributor_1.default));\nexports.default = ClassAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/attributor/class.ts\n// module id = 7\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts\n .slice(1)\n .map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n })\n .join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = /** @class */ (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n // @ts-ignore\n var value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n };\n return StyleAttributor;\n}(attributor_1.default));\nexports.default = StyleAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/attributor/style.ts\n// module id = 8\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./blot/abstract/container\");\nvar format_1 = require(\"./blot/abstract/format\");\nvar leaf_1 = require(\"./blot/abstract/leaf\");\nvar scroll_1 = require(\"./blot/scroll\");\nvar inline_1 = require(\"./blot/inline\");\nvar block_1 = require(\"./blot/block\");\nvar embed_1 = require(\"./blot/embed\");\nvar text_1 = require(\"./blot/text\");\nvar attributor_1 = require(\"./attributor/attributor\");\nvar class_1 = require(\"./attributor/class\");\nvar style_1 = require(\"./attributor/style\");\nvar store_1 = require(\"./attributor/store\");\nvar Registry = require(\"./registry\");\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default,\n },\n};\nexports.default = Parchment;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/parchment.ts\n// module id = 10\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedList = /** @class */ (function () {\n function LinkedList() {\n this.head = this.tail = null;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i] = arguments[_i];\n }\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n if (!node)\n return;\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while ((cur = next())) {\n var length_1 = cur.length();\n if (index < length_1 ||\n (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length_1;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nexports.default = LinkedList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/collection/linked-list.ts\n// module id = 11\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./abstract/container\");\nvar Registry = require(\"../registry\");\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = /** @class */ (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.scroll = _this;\n _this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n _this.observer.observe(_this.domNode, OBSERVER_CONFIG);\n _this.attach();\n return _this;\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations, context) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n if (context === void 0) { context = {}; }\n _super.prototype.optimize.call(this, context);\n // We must modify mutations directly, cannot make copy and then modify\n var records = [].slice.call(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0)\n mutations.push(records.pop());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n // Post-order traversal\n if (\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY] == null ||\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize(context);\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = [].slice.call(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0)\n mutations.push(records.pop());\n }\n };\n ScrollBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (context === void 0) { context = {}; }\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations\n .map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return null;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n })\n .forEach(function (blot) {\n if (blot == null ||\n blot === _this ||\n //@ts-ignore\n blot.domNode[Registry.DATA_KEY] == null)\n return;\n // @ts-ignore\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);\n });\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n // @ts-ignore\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);\n }\n this.optimize(mutations, context);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nexports.default = ScrollBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/scroll.ts\n// module id = 12\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n // @ts-ignore\n for (var prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = /** @class */ (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nexports.default = InlineBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/inline.ts\n// module id = 13\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\nvar BlockBlot = /** @class */ (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.prototype.update = function (mutations, context) {\n if (navigator.userAgent.match(/Trident/)) {\n this.build();\n }\n else {\n _super.prototype.update.call(this, mutations, context);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nexports.default = BlockBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/block.ts\n// module id = 14\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar EmbedBlot = /** @class */ (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nexports.default = EmbedBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/embed.ts\n// module id = 15\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar Registry = require(\"../registry\");\nvar TextBlot = /** @class */ (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.text = _this.statics.value(_this.domNode);\n return _this;\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n var text = domNode.data;\n // @ts-ignore\n if (text['normalize'])\n text = text['normalize']();\n return text;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nexports.default = TextBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/text.ts\n// module id = 16\n// module chunks = 0","import cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\n\ninterface AttributeMap {\n [key: string]: any;\n}\n\nnamespace AttributeMap {\n export function compose(\n a: AttributeMap = {},\n b: AttributeMap = {},\n keepNull: boolean,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n let attributes = cloneDeep(b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce((copy, key) => {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (const key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function diff(\n a: AttributeMap = {},\n b: AttributeMap = {},\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n const attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce((attrs, key) => {\n if (!isEqual(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function invert(\n attr: AttributeMap = {},\n base: AttributeMap = {},\n ): AttributeMap {\n attr = attr || {};\n const baseInverted = Object.keys(base).reduce((memo, key) => {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce((memo, key) => {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n\n export function transform(\n a: AttributeMap | undefined,\n b: AttributeMap | undefined,\n priority = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n const attributes = Object.keys(b).reduce((attrs, key) => {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n}\n\nexport default AttributeMap;\n","import diff from 'fast-diff';\nimport cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\nimport AttributeMap from './AttributeMap';\nimport Op from './Op';\n\nconst NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\nclass Delta {\n static Op = Op;\n static AttributeMap = AttributeMap;\n\n ops: Op[];\n constructor(ops?: Op[] | { ops: Op[] }) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n }\n\n insert(arg: string | object, attributes?: AttributeMap): this {\n const newOp: Op = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n delete(length: number): this {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n }\n\n retain(length: number, attributes?: AttributeMap): this {\n if (length <= 0) {\n return this;\n }\n const newOp: Op = { retain: length };\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n push(newOp: Op): this {\n let index = this.ops.length;\n let lastOp = this.ops[index - 1];\n newOp = cloneDeep(newOp);\n if (typeof lastOp === 'object') {\n if (\n typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number'\n ) {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (isEqual(newOp.attributes, lastOp.attributes)) {\n if (\n typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string'\n ) {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n } else if (\n typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number'\n ) {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n }\n\n chop(): this {\n const lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n }\n\n filter(predicate: (op: Op, index: number) => boolean): Op[] {\n return this.ops.filter(predicate);\n }\n\n forEach(predicate: (op: Op, index: number) => void): void {\n this.ops.forEach(predicate);\n }\n\n map(predicate: (op: Op, index: number) => T): T[] {\n return this.ops.map(predicate);\n }\n\n partition(predicate: (op: Op) => boolean): [Op[], Op[]] {\n const passed: Op[] = [];\n const failed: Op[] = [];\n this.forEach((op) => {\n const target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n }\n\n reduce(\n predicate: (accum: T, curr: Op, index: number) => T,\n initialValue: T,\n ): T {\n return this.ops.reduce(predicate, initialValue);\n }\n\n changeLength(): number {\n return this.reduce((length, elem) => {\n if (elem.insert) {\n return length + Op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n }\n\n length(): number {\n return this.reduce((length, elem) => {\n return length + Op.length(elem);\n }, 0);\n }\n\n slice(start = 0, end = Infinity): Delta {\n const ops = [];\n const iter = Op.iterator(this.ops);\n let index = 0;\n while (index < end && iter.hasNext()) {\n let nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op.length(nextOp);\n }\n return new Delta(ops);\n }\n\n compose(other: Delta): Delta {\n const thisIter = Op.iterator(this.ops);\n const otherIter = Op.iterator(other.ops);\n const ops = [];\n const firstOther = otherIter.peek();\n if (\n firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null\n ) {\n let firstLeft = firstOther.retain;\n while (\n thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft\n ) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n const delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n const newOp: Op = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n const attributes = AttributeMap.compose(\n thisOp.attributes,\n otherOp.attributes,\n typeof thisOp.retain === 'number',\n );\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n\n // Optimization if rest of other is just retain\n if (\n !otherIter.hasNext() &&\n isEqual(delta.ops[delta.ops.length - 1], newOp)\n ) {\n const rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (\n typeof otherOp.delete === 'number' &&\n typeof thisOp.retain === 'number'\n ) {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n }\n\n concat(other: Delta): Delta {\n const delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n }\n\n diff(other: Delta, cursor?: number | diff.CursorInfo): Delta {\n if (this.ops === other.ops) {\n return new Delta();\n }\n const strings = [this, other].map((delta) => {\n return delta\n .map((op) => {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n const prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n const retDelta = new Delta();\n const diffResult = diff(strings[0], strings[1], cursor);\n const thisIter = Op.iterator(this.ops);\n const otherIter = Op.iterator(other.ops);\n diffResult.forEach((component: diff.Diff) => {\n let length = component[1].length;\n while (length > 0) {\n let opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(\n thisIter.peekLength(),\n otherIter.peekLength(),\n length,\n );\n const thisOp = thisIter.next(opLength);\n const otherOp = otherIter.next(opLength);\n if (isEqual(thisOp.insert, otherOp.insert)) {\n retDelta.retain(\n opLength,\n AttributeMap.diff(thisOp.attributes, otherOp.attributes),\n );\n } else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n }\n\n eachLine(\n predicate: (\n line: Delta,\n attributes: AttributeMap,\n index: number,\n ) => boolean | void,\n newline = '\\n',\n ): void {\n const iter = Op.iterator(this.ops);\n let line = new Delta();\n let i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n const thisOp = iter.peek();\n const start = Op.length(thisOp) - iter.peekLength();\n const index =\n typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n }\n\n invert(base: Delta): Delta {\n const inverted = new Delta();\n this.reduce((baseIndex, op) => {\n if (op.insert) {\n inverted.delete(Op.length(op));\n } else if (op.retain && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n } else if (op.delete || (op.retain && op.attributes)) {\n const length = (op.delete || op.retain) as number;\n const slice = base.slice(baseIndex, baseIndex + length);\n slice.forEach((baseOp) => {\n if (op.delete) {\n inverted.push(baseOp);\n } else if (op.retain && op.attributes) {\n inverted.retain(\n Op.length(baseOp),\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n }\n });\n return baseIndex + length;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n }\n\n transform(index: number, priority?: boolean): number;\n transform(other: Delta, priority?: boolean): Delta;\n transform(arg: number | Delta, priority = false): typeof arg {\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n const other: Delta = arg;\n const thisIter = Op.iterator(this.ops);\n const otherIter = Op.iterator(other.ops);\n const delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (\n thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')\n ) {\n delta.retain(Op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp.delete) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(\n length,\n AttributeMap.transform(\n thisOp.attributes,\n otherOp.attributes,\n priority,\n ),\n );\n }\n }\n }\n return delta.chop();\n }\n\n transformPosition(index: number, priority = false): number {\n priority = !!priority;\n const thisIter = Op.iterator(this.ops);\n let offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n const length = thisIter.peekLength();\n const nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n }\n}\n\nexport = Delta;\n","import Op from './Op';\n\nexport default class Iterator {\n ops: Op[];\n index: number;\n offset: number;\n\n constructor(ops: Op[]) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n\n hasNext(): boolean {\n return this.peekLength() < Infinity;\n }\n\n next(length?: number): Op {\n if (!length) {\n length = Infinity;\n }\n const nextOp = this.ops[this.index];\n if (nextOp) {\n const offset = this.offset;\n const opLength = Op.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n } else {\n const retOp: Op = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n }\n\n peek(): Op {\n return this.ops[this.index];\n }\n\n peekLength(): number {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n }\n\n peekType(): string {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index].delete === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n }\n\n rest(): Op[] {\n if (!this.hasNext()) {\n return [];\n } else if (this.offset === 0) {\n return this.ops.slice(this.index);\n } else {\n const offset = this.offset;\n const index = this.index;\n const next = this.next();\n const rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n }\n}\n","import AttributeMap from './AttributeMap';\nimport Iterator from './Iterator';\n\ninterface Op {\n // only one property out of {insert, delete, retain} will be present\n insert?: string | object;\n delete?: number;\n retain?: number;\n\n attributes?: AttributeMap;\n}\n\nnamespace Op {\n export function iterator(ops: Op[]): Iterator {\n return new Iterator(ops);\n }\n\n export function length(op: Op): number {\n if (typeof op.delete === 'number') {\n return op.delete;\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n}\n\nexport default Op;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","import Parchment from 'parchment';\n\n\nclass Break extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n insertInto(parent, ref) {\n if (parent.children.length === 0) {\n super.insertInto(parent, ref);\n } else {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\n\nexport default Break;\n","import Parchment from 'parchment';\n\nclass TextBlot extends Parchment.Text { }\n\nexport default TextBlot;\n","import Text from './text';\nimport Parchment from 'parchment';\n\n\nclass Inline extends Parchment.Inline {\n static compare(self, other) {\n let selfIndex = Inline.order.indexOf(self);\n let otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n\n formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && Parchment.query(name, Parchment.Scope.BLOT)) {\n let blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n let parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, Parchment.Embed, Text];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = [\n 'cursor', 'inline', // Must be lower\n 'underline', 'strike', 'italic', 'bold', 'script',\n 'link', 'code' // Must be higher\n];\n\n\nexport default Inline;\n","import merge from 'lodash.merge';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Break from './break';\nimport Inline from './inline';\nimport TextBlot from './text';\n\n\nconst NEWLINE_LENGTH = 1;\n\n\nclass BlockEmbed extends Parchment.Embed {\n attach() {\n super.attach();\n this.attributes = new Parchment.Attributor.Store(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), merge(this.formats(), this.attributes.values()));\n }\n\n format(name, value) {\n let attribute = Parchment.query(name, Parchment.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n let block = Parchment.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n}\nBlockEmbed.scope = Parchment.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nclass Block extends Parchment.Block {\n constructor(domNode) {\n super(domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(Parchment.Leaf).reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new Delta()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) return super.insertAt(index, value, def);\n if (value.length === 0) return;\n let lines = value.split('\\n');\n let text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n let block = this;\n lines.reduce(function(index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n let head = this.children.head;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n let clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n let next = super.split(index, force);\n this.cache = {};\n return next;\n }\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [Inline, Parchment.Embed, TextBlot];\n\n\nfunction bubbleFormats(blot, formats = {}) {\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = merge(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\n\nexport { bubbleFormats, BlockEmbed, Block as default };\n","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Inline from '../blots/inline';\nimport TextBlot from '../blots/text';\n\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\n\nclass CodeBlock extends Block {\n static create(value) {\n let domNode = super.create(value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n\n static formats() {\n return true;\n }\n\n delta() {\n let text = this.domNode.textContent;\n if (text.endsWith('\\n')) { // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce((delta, frag) => {\n return delta.insert(frag).insert('\\n', this.formats());\n }, new Delta());\n }\n\n format(name, value) {\n if (name === this.statics.blotName && value) return;\n let [text, ] = this.descendant(TextBlot, this.length() - 1);\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n super.format(name, value);\n }\n\n formatAt(index, length, name, value) {\n if (length === 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK) == null ||\n (name === this.statics.blotName && value === this.statics.formats(this.domNode))) {\n return;\n }\n let nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n let prevNewline = this.newlineIndex(index, true) + 1;\n let isolateLength = nextNewline - prevNewline + 1;\n let blot = this.isolate(prevNewline, isolateLength);\n let next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n\n insertAt(index, value, def) {\n if (def != null) return;\n let [text, offset] = this.descendant(TextBlot, index);\n text.insertAt(offset, value);\n }\n\n length() {\n let length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n\n newlineIndex(searchIndex, reverse = false) {\n if (!reverse) {\n let offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n\n optimize(context) {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(Parchment.create('text', '\\n'));\n }\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize(context);\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n super.replace(target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function(node) {\n let blot = Parchment.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof Parchment.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n}\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\n\nexport { Code, CodeBlock as default };\n","import Parchment from 'parchment';\nimport TextBlot from './text';\n\n\nclass Cursor extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n constructor(domNode, selection) {\n super(domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this._length = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this._length !== 0) {\n return super.format(name, value);\n }\n let target = this, index = 0;\n while (target != null && target.statics.scope !== Parchment.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this._length;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing || this.parent == null) return;\n let textNode = this.textNode;\n let range = this.selection.getNativeRange();\n let restoreText, start, end;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n [restoreText, start, end] = [textNode, range.start.offset, range.end.offset];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n let text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof TextBlot) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(Parchment.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start != null) {\n [start, end] = [start, end].map(function(offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n return {\n startNode: restoreText,\n startOffset: start,\n endNode: restoreText,\n endOffset: end\n };\n }\n }\n\n update(mutations, context) {\n if (mutations.some((mutation) => {\n return mutation.type === 'characterData' && mutation.target === this.textNode;\n })) {\n let range = this.restore();\n if (range) context.range = range;\n }\n }\n\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = \"\\uFEFF\"; // Zero width no break space\n\n\nexport default Cursor;\n","import cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\nimport merge from 'lodash.merge';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport Parchment from 'parchment';\nimport CodeBlock from '../formats/code';\nimport CursorBlot from '../blots/cursor';\nimport Block, { bubbleFormats } from '../blots/block';\nimport Break from '../blots/break';\n\nconst ASCII = /^[ -~]*$/;\n\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n delta = normalizeDelta(delta);\n delta.reduce((index, op) => {\n let length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n this.scroll.insertAt(index, text);\n let [line, offset] = this.scroll.line(index);\n let formats = merge({}, bubbleFormats(line));\n if (line instanceof Block) {\n let [leaf, ] = line.descendant(Parchment.Leaf, offset);\n formats = merge(formats, bubbleFormats(leaf));\n }\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n let key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n return this.update(delta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n let lines = this.scroll.lines(index, Math.max(length, 1));\n let lengthRemaining = length;\n lines.forEach((line) => {\n let lineLength = line.length();\n if (!(line instanceof CodeBlock)) {\n line.format(format, formats[format]);\n } else {\n let codeIndex = index - line.offset(this.scroll);\n let codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new Delta().retain(index).retain(length, cloneDeep(formats)));\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).retain(length, cloneDeep(formats)));\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index, length = 0) {\n let lines = [], leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function(path) {\n let [blot, ] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof Parchment.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(Parchment.Leaf, index, length);\n }\n const [lineFormats, leafFormats] = [lines, leaves].map(function(blots) {\n if (blots.length === 0) return {};\n let formats = bubbleFormats(blots.shift());\n while (Object.keys(formats).length > 0) {\n let blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return { ...lineFormats, ...leafFormats };\n }\n\n getText(index, length) {\n return this.getContents(index, length).filter(function(op) {\n return typeof op.insert === 'string';\n }).map(function(op) {\n return op.insert;\n }).join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).insert(text, cloneDeep(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n let block = this.scroll.children.head;\n if (block.statics.blotName !== Block.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index, length) {\n let text = this.getText(index, length);\n let [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0, suffix = new Delta();\n if (line != null) {\n if (!(line instanceof CodeBlock)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n let contents = this.getContents(index, length + suffixLength);\n let diff = contents.diff(new Delta().insert(text).concat(suffix));\n let delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], cursorIndex = undefined) {\n let oldDelta = this.delta;\n if (mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n mutations[0].target.data.match(ASCII) &&\n Parchment.find(mutations[0].target)) {\n // Optimization for character changes\n let textBlot = Parchment.find(mutations[0].target);\n let formats = bubbleFormats(textBlot);\n let index = textBlot.offset(this.scroll);\n let oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n let oldText = new Delta().insert(oldValue);\n let newText = new Delta().insert(textBlot.value());\n let diffDelta = new Delta().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function(delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !isEqual(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n}\n\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function(merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function(delta, op) {\n if (op.insert === 1) {\n let attributes = cloneDeep(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = cloneDeep(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n let text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new Delta());\n}\n\n\nexport default Editor;\n","let levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\n\nfunction debug(method, ...args) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function(logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function(newLevel) {\n level = newLevel;\n};\n\n\nexport default namespace;\n","import EventEmitter from 'eventemitter3';\nimport logger from './logger';\n\nconst debug = logger('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\nconst EMITTERS = [];\nconst supportsRootNode = ('getRootNode' in document);\n\nEVENTS.forEach(function(eventName) {\n document.addEventListener(eventName, (...args) => {\n EMITTERS.forEach((em) => {\n em.handleDOM(...args);\n });\n });\n});\n\n\nclass Emitter extends EventEmitter {\n constructor() {\n super();\n this.listeners = {};\n this.on('error', debug.error);\n }\n\n emit() {\n debug.log.apply(debug, arguments);\n super.emit.apply(this, arguments);\n }\n\n connect() {\n EMITTERS.push(this);\n }\n\n disconnect() {\n EMITTERS.splice(EMITTERS.indexOf(this), 1);\n }\n\n handleDOM(event, ...args) {\n const target = (event.composedPath ? event.composedPath()[0] : event.target);\n const containsNode = (node, target) => {\n if (!supportsRootNode || target.getRootNode() === document) {\n return node.contains(target);\n }\n\n while (!node.contains(target)) {\n const root = target.getRootNode();\n if (!root || !root.host) {\n return false;\n }\n target = root.host;\n }\n\n return true;\n };\n\n (this.listeners[event.type] || []).forEach(function({ node, handler }) {\n if (target === node || containsNode(node, target)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node, handler })\n }\n}\n\nEmitter.events = {\n EDITOR_CHANGE : 'editor-change',\n SCROLL_BEFORE_UPDATE : 'scroll-before-update',\n SCROLL_OPTIMIZE : 'scroll-optimize',\n SCROLL_UPDATE : 'scroll-update',\n SELECTION_CHANGE : 'selection-change',\n TEXT_CHANGE : 'text-change'\n};\nEmitter.sources = {\n API : 'api',\n SILENT : 'silent',\n USER : 'user'\n};\n\n\nexport default Emitter;\n","class Module {\n constructor(quill, options = {}) {\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n\n\nexport default Module;\n","// see https://github.com/GoogleChromeLabs/shadow-selection-polyfill/issues/11\nconst SUPPORTS_SHADOW_SELECTION = typeof window.ShadowRoot.prototype.getSelection === 'function';\nconst SUPPORTS_BEFORE_INPUT = window.InputEvent && typeof window.InputEvent.prototype.getTargetRanges === 'function';\nconst IS_FIREFOX = window.navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\nconst IS_MSIE = !!(window.navigator.userAgent.match(/Trident/) && !window.navigator.userAgent.match(/MSIE/));\nconst IS_EDGE = window.navigator.userAgent.match(/Edge/);\n\nlet processing = false;\nexport class ShadowSelection {\n constructor() {\n this._ranges = [];\n }\n\n get rangeCount() {\n return this._ranges.length;\n }\n\n getRangeAt(index) {\n return this._ranges[index];\n }\n\n addRange(range) {\n this._ranges.push(range);\n if (!processing) {\n let windowSel = window.getSelection();\n windowSel.removeAllRanges();\n windowSel.setBaseAndExtent(range.startContainer, range.startOffset, range.endContainer, range.endOffset);\n }\n }\n\n removeAllRanges() {\n this._ranges = [];\n }\n\n // todo: implement remaining `Selection` methods and properties.\n}\n\nfunction getActiveElement() {\n let active = document.activeElement;\n\n /* eslint-disable no-constant-condition */\n while (true) {\n if (active && active.shadowRoot && active.shadowRoot.activeElement) {\n active = active.shadowRoot.activeElement;\n } else {\n break;\n }\n }\n\n return active;\n}\n\nif ((IS_FIREFOX || IS_MSIE || IS_EDGE) && !SUPPORTS_SHADOW_SELECTION) {\n window.ShadowRoot.prototype.getSelection = function() {\n return document.getSelection();\n }\n}\n\nif (!IS_FIREFOX && !SUPPORTS_SHADOW_SELECTION && SUPPORTS_BEFORE_INPUT) {\n let selection = new ShadowSelection();\n\n window.ShadowRoot.prototype.getSelection = function() {\n return selection;\n }\n\n window.addEventListener('selectionchange', () => {\n if (!processing) {\n processing = true;\n\n const active = getActiveElement();\n\n if (active && (active.getAttribute('contenteditable') === 'true')) {\n document.execCommand('indent');\n } else {\n selection.removeAllRanges();\n }\n\n processing = false;\n }\n }, true);\n\n window.addEventListener('beforeinput', (event) => {\n if (processing) {\n const ranges = event.getTargetRanges();\n const range = ranges[0];\n\n const newRange = new Range();\n\n newRange.setStart(range.startContainer, range.startOffset);\n newRange.setEnd(range.endContainer, range.endOffset);\n\n selection.removeAllRanges();\n selection.addRange(newRange);\n\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }, true);\n\n window.addEventListener('selectstart', () => {\n selection.removeAllRanges();\n }, true);\n}\n","import cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\nimport Parchment from 'parchment';\nimport Emitter from './emitter';\nimport logger from './logger';\nimport { ShadowSelection } from './shadow-selection-polyfill';\n\nconst debug = logger('quill:selection');\n\nclass Range {\n constructor(index, length = 0) {\n this.index = index;\n this.length = length;\n }\n}\n\n\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.rootDocument = (this.root.getRootNode ? this.root.getRootNode() : document);\n this.cursor = Parchment.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, (_, mutations) => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n\n if (native == null) return;\n\n // We might need to hack the offset on Safari, when we are dealing with the first character of a row.\n // This likely happens because of a race condition between quill's update method being called before the\n // selectionchange event being fired in the selection polyfill.\n const hackOffset = (native.start.offset === 0 &&\n native.start.offset === native.end.offset &&\n this.rootDocument.getSelection() instanceof ShadowSelection &&\n mutations.some((a) => a.type === 'characterData' && a.oldValue === '')) ? 1 : 0;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n this.emitter.once(Emitter.events.SCROLL_UPDATE, () => {\n try {\n if (\n this.root.contains(native.start.node) &&\n this.root.contains(native.end.node)\n ) {\n this.setNativeRange(\n native.start.node,\n native.start.offset + hackOffset,\n native.end.node,\n native.end.offset + hackOffset\n );\n }\n this.update(Emitter.sources.SILENT);\n } catch (ignored) {\n // ignore\n }\n });\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.root.addEventListener('compositionstart', () => {\n this.composing = true;\n });\n this.root.addEventListener('compositionend', () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n\n format(format, value) {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n this.scroll.update();\n let nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || Parchment.query(format, Parchment.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n let blot = Parchment.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof Parchment.Leaf) {\n let after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index, length = 0) {\n let scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node, [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n let range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n } else {\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n }\n\n getNativeRange() {\n const selection = this.rootDocument.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n let range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange() {\n let normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n let range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus() {\n return this.rootDocument.activeElement === this.root;\n }\n\n normalizedToRange(range) {\n let positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n let indexes = positions.map((position) => {\n let [node, offset] = position;\n let blot = Parchment.find(node, true);\n let index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof Parchment.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n let end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n let start = Math.min(end, ...indexes);\n return new Range(start, end-start);\n }\n\n normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))) {\n return null;\n }\n let range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function(position) {\n let node = position.node, offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range) {\n let indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n let args = [];\n let scrollLength = this.scroll.length();\n indexes.forEach((index, i) => {\n index = Math.min(scrollLength - 1, index);\n let node, [leaf, offset] = this.scroll.leaf(index);\n [node, offset] = leaf.position(offset, i !== 0);\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n return args;\n }\n\n scrollIntoView(scrollingContainer) {\n let range = this.lastRange;\n if (range == null) return;\n let bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n let limit = this.scroll.length()-1;\n let [first, ] = this.scroll.line(Math.min(range.index, limit));\n let last = first;\n if (range.length > 0) {\n [last, ] = this.scroll.line(Math.min(range.index + range.length, limit));\n }\n if (first == null || last == null) return;\n let scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= (scrollBounds.top - bounds.top);\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += (bounds.bottom - scrollBounds.bottom);\n }\n }\n\n setNativeRange(startNode, startOffset, endNode = startNode, endOffset = startOffset, force = false) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n const selection = this.rootDocument.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n let native = (this.getNativeRange() || {}).native;\n if (native == null || force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset) {\n\n if (startNode.tagName == \"BR\") {\n startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);\n startNode = startNode.parentNode;\n }\n if (endNode.tagName == \"BR\") {\n endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);\n endNode = endNode.parentNode;\n }\n let range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n\n setRange(range, force = false, source = Emitter.sources.API) {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n let args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source = Emitter.sources.USER) {\n let oldRange = this.lastRange;\n let [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!isEqual(oldRange, this.lastRange)) {\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n let args = [Emitter.events.SELECTION_CHANGE, cloneDeep(this.lastRange), cloneDeep(oldRange), source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\n\nexport { Range, Selection as default };\n","class Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name) {\n let moduleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\n\nexport default Theme;\n","import './polyfill';\nimport merge from 'lodash.merge';\nimport Delta from 'quill-delta';\nimport Editor from './editor';\nimport Emitter from './emitter';\nimport Module from './module';\nimport Parchment from 'parchment';\nimport Selection, { Range } from './selection';\nimport logger from './logger';\nimport Theme from './theme';\n\nlet debug = logger('quill');\n\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node) {\n return node.__quill || Parchment.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(path, target, overwrite = false) {\n if (typeof path !== 'string') {\n let name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach((key) => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) &&\n target.blotName !== 'abstract') {\n Parchment.register(target);\n } else if (path.startsWith('modules') && typeof target.register === 'function') {\n target.register();\n }\n }\n }\n\n constructor(container, options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n let html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.container.__quill = this;\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new Emitter();\n this.scroll = Parchment.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n let range = this.selection.lastRange;\n let index = range && range.length === 0 ? range.index : undefined;\n modify.call(this, () => {\n return this.editor.update(null, mutations, index);\n }, source);\n });\n let contents = this.clipboard.convert(`
${html}


`);\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n addContainer(container, refNode = null) {\n if (typeof container === 'string') {\n let className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1*length);\n }\n\n disable() {\n this.enable(false);\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n let scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value, source = Emitter.sources.API) {\n return modify.call(this, () => {\n let range = this.getSelection(true);\n let change = new Delta();\n if (range == null) {\n return change;\n } else if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, { [name]: value });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, { [name]: value });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index, length = 0) {\n let bounds;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n let containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index = this.getSelection(true), length = 0) {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines(index = 0, length = Number.MAX_VALUE) {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n } else {\n return this.scroll.lines(index, length);\n }\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection(focus = false) {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getText(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value, source = Quill.sources.API) {\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats;\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n\n off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n\n on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n\n once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n\n pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n\n removeFormat(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n let length = this.getLength();\n let deleted = this.editor.deleteText(0, length);\n let applied = this.editor.applyDelta(delta);\n let lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof(lastOp.insert) === 'string' && lastOp.insert[lastOp.insert.length-1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n let ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(index, length), source);\n if (source !== Emitter.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text, source = Emitter.sources.API) {\n let delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source = Emitter.sources.USER) {\n let change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n\n updateContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n scrollingContainer: null,\n strict: true,\n theme: 'default'\n};\nQuill.events = Emitter.events;\nQuill.sources = Emitter.sources;\n// eslint-disable-next-line no-undef\nQuill.version = typeof(QUILL_VERSION) === 'undefined' ? 'dev' : QUILL_VERSION;\n\nQuill.imports = {\n 'delta' : Delta,\n 'parchment' : Parchment,\n 'core/module' : Module,\n 'core/theme' : Theme\n};\n\n\nfunction expandConfig(container, userConfig) {\n userConfig = merge({\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = Theme;\n } else {\n userConfig.theme = Quill.import(`themes/${userConfig.theme}`);\n if (userConfig.theme == null) {\n throw new Error(`Invalid theme ${userConfig.theme}. Did you register it?`);\n }\n }\n let themeConfig = merge({}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function(config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function(module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n let moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n let moduleConfig = moduleNames.reduce(function(config, name) {\n let moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(`Cannot load ${name} module. Are you sure you registered it?`);\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar &&\n userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = merge({}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(function(key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === Emitter.sources.USER) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n let oldDelta = this.editor.delta;\n let change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n let args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start, end;\n if (index instanceof Delta) {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n return index.transformPosition(pos, source !== Emitter.sources.USER);\n });\n } else {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n if (pos < index || (pos === index && source === Emitter.sources.USER)) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n }\n return new Range(start, end - start);\n}\n\n\nexport { expandConfig, overload, Quill as default };\n","import Parchment from 'parchment';\nimport Block, { BlockEmbed } from './block';\n\n\nclass Container extends Parchment.Container { }\nContainer.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Container;\n","import Parchment from 'parchment';\nimport TextBlot from './text';\n\nconst GUARD_TEXT = \"\\uFEFF\";\n\n\nclass Embed extends Parchment.Embed {\n constructor(node) {\n super(node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', false);\n [].slice.call(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node) {\n let range, textNode;\n let text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n let prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n }\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations, context) {\n mutations.forEach((mutation) => {\n if (mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard || mutation.target === this.rightGuard)) {\n let range = this.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n}\n\n\nexport default Embed;\n","import Parchment from 'parchment';\nimport Emitter from '../core/emitter';\nimport Block, { BlockEmbed } from './block';\nimport Break from './break';\nimport CodeBlock from '../formats/code';\nimport Container from './container';\n\n\nfunction isLine(blot) {\n return (blot instanceof Block || blot instanceof BlockEmbed);\n}\n\n\nclass Scroll extends Parchment.Scroll {\n constructor(domNode, config) {\n super(domNode);\n this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n this.whitelist = config.whitelist.reduce(function(whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n this.optimize();\n this.enable();\n }\n\n batchStart() {\n this.batch = true;\n }\n\n batchEnd() {\n this.batch = false;\n this.optimize();\n }\n\n deleteAt(index, length) {\n let [first, offset] = this.line(index);\n let [last, ] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n if (first instanceof CodeBlock) {\n let newlineIndex = first.newlineIndex(first.length(), true);\n if (newlineIndex > -1) {\n first = first.split(newlineIndex + 1);\n if (first === last) {\n this.optimize();\n return;\n }\n }\n } else if (last instanceof CodeBlock) {\n let newlineIndex = last.newlineIndex(0);\n if (newlineIndex > -1) {\n last.split(newlineIndex + 1);\n }\n }\n let ref = last.children.head instanceof Break ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || Parchment.query(value, Parchment.Scope.BLOCK) == null) {\n let blot = Parchment.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n let embed = Parchment.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === Parchment.Scope.INLINE_BLOT) {\n let wrapper = Parchment.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n super.insertBefore(blot, ref);\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n let getLines = (blot, index, length) => {\n let lines = [], lengthLeft = length;\n blot.children.forEachAt(index, length, function(child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof Parchment.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(mutations = [], context = {}) {\n if (this.batch === true) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n update(mutations) {\n if (this.batch === true) return;\n let source = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Scroll;\n","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nlet AlignAttribute = new Parchment.Attributor.Attribute('align', 'align', config);\nlet AlignClass = new Parchment.Attributor.Class('align', 'ql-align', config);\nlet AlignStyle = new Parchment.Attributor.Style('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n","import Parchment from 'parchment';\n\nclass ColorAttributor extends Parchment.Attributor.Style {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function(component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n}\n\nlet ColorClass = new Parchment.Attributor.Class('color', 'ql-color', {\n scope: Parchment.Scope.INLINE\n});\nlet ColorStyle = new ColorAttributor('color', 'color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n","import Parchment from 'parchment';\nimport { ColorAttributor } from './color';\n\nlet BackgroundClass = new Parchment.Attributor.Class('background', 'ql-bg', {\n scope: Parchment.Scope.INLINE\n});\nlet BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { BackgroundClass, BackgroundStyle };\n","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nlet DirectionAttribute = new Parchment.Attributor.Attribute('direction', 'dir', config);\nlet DirectionClass = new Parchment.Attributor.Class('direction', 'ql-direction', config);\nlet DirectionStyle = new Parchment.Attributor.Style('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nlet FontClass = new Parchment.Attributor.Class('font', 'ql-font', config);\n\nclass FontStyleAttributor extends Parchment.Attributor.Style {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nlet FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n","import Parchment from 'parchment';\n\nlet SizeClass = new Parchment.Attributor.Class('size', 'ql-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nlet SizeStyle = new Parchment.Attributor.Style('size', 'font-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexport { SizeClass, SizeStyle };\n","import merge from 'lodash.merge';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nimport { AlignAttribute, AlignStyle } from '../formats/align';\nimport { BackgroundStyle } from '../formats/background';\nimport CodeBlock from '../formats/code';\nimport { ColorStyle } from '../formats/color';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction';\nimport { FontStyle } from '../formats/font';\nimport { SizeStyle } from '../formats/size';\n\nlet debug = logger('quill:clipboard');\n\n\nconst DOM_KEY = '__ql-matcher';\n\nconst CLIPBOARD_CONFIG = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['b', matchAlias.bind(matchAlias, 'bold')],\n ['i', matchAlias.bind(matchAlias, 'italic')],\n ['style', matchIgnore]\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [\n AlignAttribute,\n DirectionAttribute\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\n\nclass Clipboard extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('paste', this.onPaste.bind(this));\n this.container = this.quill.addContainer('ql-clipboard');\n this.container.setAttribute('contenteditable', true);\n this.container.setAttribute('tabindex', -1);\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach(([selector, matcher]) => {\n this.addMatcher(selector, matcher);\n });\n }\n\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(html) {\n if (typeof html === 'string') {\n this.container.innerHTML = html.replace(/\\>\\r?\\n +\\<'); // Remove spaces between tags\n return this.convert();\n }\n const formats = this.quill.getFormat(this.quill.selection.savedRange.index);\n if (formats[CodeBlock.blotName]) {\n const text = this.container.innerText;\n this.container.innerHTML = '';\n return new Delta().insert(text, { [CodeBlock.blotName]: formats[CodeBlock.blotName] });\n }\n let [elementMatchers, textMatchers] = this.prepareMatching();\n let delta = traverse(this.container, elementMatchers, textMatchers);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n\n dangerouslyPasteHTML(index, html, source = Quill.sources.API) {\n if (typeof index === 'string') {\n this.quill.setContents(this.convert(index), html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n let paste = this.convert(html);\n this.quill.updateContents(new Delta().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onPaste(e) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n let range = this.quill.getSelection();\n let delta = new Delta().retain(range.index);\n let scrollTop = this.quill.scrollingContainer.scrollTop;\n this.container.focus();\n this.quill.selection.update(Quill.sources.SILENT);\n setTimeout(() => {\n delta = delta.concat(this.convert()).delete(range.length);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT);\n this.quill.scrollingContainer.scrollTop = scrollTop;\n this.quill.focus();\n }, 1);\n }\n\n prepareMatching() {\n let elementMatchers = [], textMatchers = [];\n this.matchers.forEach((pair) => {\n let [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(this.container.querySelectorAll(selector), (node) => {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\nClipboard.DEFAULTS = {\n matchers: [],\n matchVisual: false\n};\n\n\nfunction applyFormat(delta, format, value) {\n if (typeof format === 'object') {\n return Object.keys(format).reduce(function(delta, key) {\n return applyFormat(delta, key, format[key]);\n }, delta);\n } else {\n return delta.reduce(function(delta, op) {\n if (op.attributes && op.attributes[format]) {\n return delta.push(op);\n } else {\n return delta.insert(op.insert, merge({}, {[format]: value}, op.attributes));\n }\n }, new Delta());\n }\n}\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n const DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n let endText = \"\";\n for (let i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n let op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1*text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n let style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction traverse(node, elementMatchers, textMatchers) { // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function(delta, matcher) {\n return matcher(node, delta);\n }, new Delta());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], (delta, childNode) => {\n let childrenDelta = traverse(childNode, elementMatchers, textMatchers);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n } else {\n return new Delta();\n }\n}\n\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta) {\n let attributes = Parchment.Attributor.Attribute.keys(node);\n let classes = Parchment.Attributor.Class.keys(node);\n let styles = Parchment.Attributor.Style.keys(node);\n let formats = {};\n attributes.concat(classes).concat(styles).forEach((name) => {\n let attr = Parchment.query(name, Parchment.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name]\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n let match = Parchment.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof Parchment.Embed) {\n let embed = {};\n let value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new Delta().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n delta = applyFormat(delta, match.blotName, match.formats(node));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node, delta) {\n let match = Parchment.query(node);\n if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n let indent = -1, parent = node.parentNode;\n while (!parent.classList.contains('ql-clipboard')) {\n if ((Parchment.query(parent) || {}).blotName === 'list') {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.compose(new Delta().retain(delta.length() - 1).retain(1, { indent: indent}));\n}\n\nfunction matchNewline(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node) || (delta.length() > 0 && node.nextSibling && isLine(node.nextSibling))) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n let formats = {};\n let style = node.style || {};\n if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') ||\n parseInt(computeStyle(node).fontWeight) >= 700)) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) { // Could be 0.5in\n delta = new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n let text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) {\n return delta;\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n let replacer = function(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if ((node.previousSibling == null && isLine(node.parentNode)) ||\n (node.previousSibling != null && isLine(node.previousSibling))) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if ((node.nextSibling == null && isLine(node.parentNode)) ||\n (node.nextSibling != null && isLine(node.nextSibling))) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\n\nexport { Clipboard as default, matchAttributor, matchBlot, matchNewline, matchText };\n","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass History extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.clear();\n this.quill.on(Quill.events.EDITOR_CHANGE, (eventName, delta, oldDelta, source) => {\n if (eventName !== Quill.events.TEXT_CHANGE || this.ignoreChange) return;\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(delta, oldDelta);\n } else {\n this.transform(delta);\n }\n });\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, this.undo.bind(this));\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, this.redo.bind(this));\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, this.redo.bind(this));\n }\n }\n\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n let delta = this.stack[source].pop();\n this.stack[dest].push(delta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], Quill.sources.USER);\n this.ignoreChange = false;\n let index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = this.quill.getContents().diff(oldDelta);\n let timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n let delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta) {\n this.stack.undo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n let lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function(attr) {\n return Parchment.query(attr, Parchment.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n let deleteLength = delta.reduce(function(length, op) {\n length += (op.delete || 0);\n return length;\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\n\nexport { History as default, getLastChangeIndex };\n","import cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\nimport merge from 'lodash.merge';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\n\nclass Keyboard extends Module {\n static match(evt, binding) {\n binding = normalize(binding);\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function(key) {\n return (!!binding[key] !== evt[key] && binding[key] !== null);\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n Object.keys(this.options.bindings).forEach((name) => {\n if (name === 'list autofill' &&\n quill.scroll.whitelist != null &&\n !quill.scroll.whitelist['list']) {\n return;\n }\n if (this.options.bindings[name]) {\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);\n } else {\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);\n }\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null },\n { collapsed: true, offset: 0 },\n handleBackspace);\n this.listen();\n }\n\n addBinding(key, context = {}, handler = {}) {\n let binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = merge(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented) return;\n let which = evt.which || evt.keyCode;\n let bindings = (this.bindings[which] || []).filter(function(binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n let range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n let [line, offset] = this.quill.getLine(range.index);\n let [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n let [leafEnd, offsetEnd] = range.length === 0 ? [leafStart, offsetStart] : this.quill.getLeaf(range.index + range.length);\n let prefixText = leafStart instanceof Parchment.Text ? leafStart.value().slice(0, offsetStart) : '';\n let suffixText = leafEnd instanceof Parchment.Text ? leafEnd.value().slice(offsetEnd) : '';\n let curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n let prevented = bindings.some((binding) => {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function(name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function(name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return isEqual(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(this, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n}\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold' : makeFormatHandler('bold'),\n 'italic' : makeFormatHandler('italic'),\n 'underline' : makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler: function(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function(range) {\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function(range, context) {\n this.quill.format('list', false, Quill.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, Quill.sources.USER);\n }\n }\n },\n 'checklist enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: { list: 'checked' },\n handler: function(range) {\n let [line, offset] = this.quill.getLine(range.index);\n let formats = merge({}, line.formats(), { list: 'checked' });\n let delta = new Delta().retain(range.index)\n .insert('\\n', formats)\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function(range, context) {\n let [line, offset] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index)\n .insert('\\n', context.format)\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler: function(range, context) {\n let length = context.prefix.length;\n let [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]': case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-': case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index - offset)\n .delete(length + 1)\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n }\n },\n 'code exit': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['code-block'],\n prefix: /\\n\\n$/,\n suffix: /^\\s+$/,\n handler: function(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n }\n },\n 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),\n 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),\n 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),\n 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)\n }\n};\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n const where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler: function(range) {\n let index = range.index;\n if (key === Keyboard.keys.RIGHT) {\n index += (range.length + 1);\n }\n const [leaf, ] = this.quill.getLeaf(index);\n if (!(leaf instanceof Parchment.Embed)) return true;\n if (key === Keyboard.keys.LEFT) {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else {\n if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, Quill.sources.USER);\n }\n }\n return false;\n }\n };\n}\n\n\nfunction handleBackspace(range, context) {\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let [line, ] = this.quill.getLine(range.index);\n let formats = {};\n if (context.offset === 0) {\n let [prev, ] = this.quill.getLine(range.index - 1);\n if (prev != null && prev.length() > 1) {\n let curFormats = line.formats();\n let prevFormats = this.quill.getFormat(range.index-1, 1);\n formats = AttributeMap.diff(curFormats, prevFormats) || {};\n }\n }\n // Check for astral symbols\n let length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n this.quill.deleteText(range.index-length, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index-length, length, formats, Quill.sources.USER);\n }\n this.quill.focus();\n}\n\nfunction handleDelete(range, context) {\n // Check for astral symbols\n let length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {}, nextLength = 0;\n let [line, ] = this.quill.getLine(range.index);\n if (context.offset >= line.length() - 1) {\n let [next, ] = this.quill.getLine(range.index + 1);\n if (next) {\n let curFormats = line.formats();\n let nextFormats = this.quill.getFormat(range.index, 1);\n formats = DeltaOp.attributes.diff(curFormats, nextFormats) || {};\n nextLength = next.length();\n }\n }\n this.quill.deleteText(range.index, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index + nextLength - 1, length, formats, Quill.sources.USER);\n }\n}\n\nfunction handleDeleteRange(range) {\n let lines = this.quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n let firstFormats = lines[0].formats();\n let lastFormats = lines[lines.length - 1].formats();\n formats = DeltaOp.attributes.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.quill.focus();\n}\n\nfunction handleEnter(range, context) {\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n let lineFormats = Object.keys(context.format).reduce(function(lineFormats, format) {\n if (Parchment.query(format, Parchment.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, Quill.sources.USER);\n // Earlier scroll.deleteAt might have messed up our selection,\n // so insertText's built in selection preservation is not reliable\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n Object.keys(context.format).forEach((name) => {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n this.quill.format(name, context.format[name], Quill.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: {'code-block': true },\n handler: function(range) {\n let CodeBlock = Parchment.query('code-block');\n let index = range.index, length = range.length;\n let [block, offset] = this.quill.scroll.descendant(CodeBlock, index);\n if (block == null) return;\n let scrollIndex = this.quill.getIndex(block);\n let start = block.newlineIndex(offset, true) + 1;\n let end = block.newlineIndex(scrollIndex + offset + length);\n let lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach((line, i) => {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if (typeof binding === 'object') {\n binding = cloneDeep(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n\nexport { Keyboard as default, SHORTKEY };\n","import Parchment from 'parchment';\nimport Quill from './core/quill';\n\nimport Block, { BlockEmbed } from './blots/block';\nimport Break from './blots/break';\nimport Container from './blots/container';\nimport Cursor from './blots/cursor';\nimport Embed from './blots/embed';\nimport Inline from './blots/inline';\nimport Scroll from './blots/scroll';\nimport TextBlot from './blots/text';\n\nimport Clipboard from './modules/clipboard';\nimport History from './modules/history';\nimport Keyboard from './modules/keyboard';\n\nQuill.register({\n 'blots/block' : Block,\n 'blots/block/embed' : BlockEmbed,\n 'blots/break' : Break,\n 'blots/container' : Container,\n 'blots/cursor' : Cursor,\n 'blots/embed' : Embed,\n 'blots/inline' : Inline,\n 'blots/scroll' : Scroll,\n 'blots/text' : TextBlot,\n\n 'modules/clipboard' : Clipboard,\n 'modules/history' : History,\n 'modules/keyboard' : Keyboard\n});\n\nParchment.register(Block, Break, Cursor, Inline, Scroll, TextBlot);\n\n\nexport default Quill;\n","import Parchment from 'parchment';\n\nclass IdentAttributor extends Parchment.Attributor.Class {\n add(node, value) {\n if (value === '+1' || value === '-1') {\n let indent = this.value(node) || 0;\n value = (value === '+1' ? (indent + 1) : (indent - 1));\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return super.add(node, value);\n }\n }\n\n canAdd(node, value) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value));\n }\n\n value(node) {\n return parseInt(super.value(node)) || undefined; // Don't return NaN\n }\n}\n\nlet IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: Parchment.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexport { IndentClass };\n","import Block from '../blots/block';\n\n\nclass Blockquote extends Block {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\n\nexport default Blockquote;\n","import Block from '../blots/block';\n\n\nclass Header extends Block {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n\nexport default Header;\n","import Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Container from '../blots/container';\n\n\nclass ListItem extends Block {\n static formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : super.formats(domNode);\n }\n\n format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(Parchment.create(this.statics.scope));\n } else {\n super.format(name, value);\n }\n }\n\n remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n super.remove();\n }\n }\n\n replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return super.replaceWith(name, value);\n }\n }\n}\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\n\nclass List extends Container {\n static create(value) {\n let tagName = value === 'ordered' ? 'OL' : 'UL';\n let node = super.create(tagName);\n if (value === 'checked' || value === 'unchecked') {\n node.setAttribute('data-checked', value === 'checked');\n }\n return node;\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') {\n if (domNode.hasAttribute('data-checked')) {\n return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';\n } else {\n return 'bullet';\n }\n }\n return undefined;\n }\n\n constructor(domNode) {\n super(domNode);\n const listEventHandler = (e) => {\n if (e.target.parentNode !== domNode) return;\n let format = this.statics.formats(domNode);\n let blot = Parchment.find(e.target);\n if (format === 'checked') {\n blot.format('list', 'unchecked');\n } else if(format === 'unchecked') {\n blot.format('list', 'checked');\n }\n }\n\n domNode.addEventListener('touchstart', listEventHandler);\n domNode.addEventListener('mousedown', listEventHandler);\n }\n\n format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n\n formats() {\n // We don't inherit from FormatBlot\n return { [this.statics.blotName]: this.statics.formats(this.domNode) };\n }\n\n insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n super.insertBefore(blot, ref);\n } else {\n let index = ref == null ? this.length() : ref.offset(this);\n let after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n next.domNode.tagName === this.domNode.tagName &&\n next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n let item = Parchment.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n super.replace(target);\n }\n}\nList.blotName = 'list';\nList.scope = Parchment.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\n\nexport { ListItem, List as default };\n","import Inline from '../blots/inline';\n\nclass Bold extends Inline {\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexport default Bold;\n","import Bold from './bold';\n\nclass Italic extends Bold { }\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexport default Italic;\n","import Inline from '../blots/inline';\n\n\nclass Link extends Inline {\n static create(value) {\n let node = super.create(value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name, value) {\n if (name !== this.statics.blotName || !value) return super.format(name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\n\nfunction sanitize(url, protocols) {\n let anchor = document.createElement('a');\n anchor.href = url;\n let protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\n\nexport { Link as default, sanitize };\n","import Inline from '../blots/inline';\n\nclass Script extends Inline {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return super.create(value);\n }\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexport default Script;\n","import Inline from '../blots/inline';\n\nclass Strike extends Inline { }\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexport default Strike;\n","import Inline from '../blots/inline';\n\nclass Underline extends Inline { }\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexport default Underline;\n","import Parchment from 'parchment';\nimport { sanitize } from '../formats/link';\n\nconst ATTRIBUTES = [\n 'alt',\n 'height',\n 'width'\n];\n\n\nclass Image extends Parchment.Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\n\nexport default Image;\n","import { BlockEmbed } from '../blots/block';\nimport Link from '../formats/link';\n\nconst ATTRIBUTES = [\n 'height',\n 'width'\n];\n\n\nclass Video extends BlockEmbed {\n static create(value) {\n let node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static sanitize(url) {\n return Link.sanitize(url);\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\n\nexport default Video;\n","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nconst supportsRootNode = ('getRootNode' in document);\nlet debug = logger('quill:toolbar');\n\nclass Toolbar extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n let container = document.createElement('div');\n addControls(container, this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n const rootDocument = (supportsRootNode ? quill.container.getRootNode() : document);\n this.container = rootDocument.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n return debug.error('Container required for toolbar', this.options);\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n Object.keys(this.options.handlers).forEach((format) => {\n this.addHandler(format, this.options.handlers[format]);\n });\n [].forEach.call(this.container.querySelectorAll('button, select'), (input) => {\n this.attach(input);\n });\n this.quill.on(Quill.events.EDITOR_CHANGE, (type, range) => {\n if (type === Quill.events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n let [range, ] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n\n attach(input) {\n let format = [].find.call(input.classList, (className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (Parchment.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n let eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n let selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n let [range, ] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (Parchment.query(format).prototype instanceof Parchment.Embed) {\n value = prompt(`Enter ${format}`);\n if (!value) return;\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ [format]: value })\n , Quill.sources.USER);\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n\n update(range) {\n let formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function(pair) {\n let [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n let isActive = formats[format] === input.getAttribute('value') ||\n (formats[format] != null && formats[format].toString() === input.getAttribute('value')) ||\n (formats[format] == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\n\nfunction addButton(container, format, value) {\n let input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function(controls) {\n let group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function(control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n let format = Object.keys(control)[0];\n let value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n let input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function() {\n let range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n let formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (Parchment.query(name, Parchment.Scope.INLINE) != null) {\n this.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction: function(value) {\n let align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n let indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n let modifier = (value === '+1') ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link: function(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n }\n }\n}\n\n\nexport { Toolbar as default, addControls };\n","import Quill from './core';\n\nimport { AlignClass, AlignStyle } from './formats/align';\nimport { DirectionAttribute, DirectionClass, DirectionStyle } from './formats/direction';\nimport { IndentClass as Indent } from './formats/indent';\n\nimport Blockquote from './formats/blockquote';\nimport Header from './formats/header';\nimport List, { ListItem } from './formats/list';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background';\nimport { ColorClass, ColorStyle } from './formats/color';\nimport { FontClass, FontStyle } from './formats/font';\nimport { SizeClass, SizeStyle } from './formats/size';\n\nimport Bold from './formats/bold';\nimport Italic from './formats/italic';\nimport Link from './formats/link';\nimport Script from './formats/script';\nimport Strike from './formats/strike';\nimport Underline from './formats/underline';\n\nimport Image from './formats/image';\nimport Video from './formats/video';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code';\n\n// import Formula from './modules/formula';\n// import Syntax from './modules/syntax';\nimport Toolbar from './modules/toolbar';\n\n// import Icons from './ui/icons';\n// import Picker from './ui/picker';\n// import ColorPicker from './ui/color-picker';\n// import IconPicker from './ui/icon-picker';\n// import Tooltip from './ui/tooltip';\n\n// import BubbleTheme from './themes/bubble';\n// import SnowTheme from './themes/snow';\n\n\nQuill.register({\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle\n}, true);\n\n\nQuill.register({\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'formats/list/item': ListItem,\n\n // 'modules/formula': Formula,\n // 'modules/syntax': Syntax,\n 'modules/toolbar': Toolbar\n\n // 'themes/bubble': BubbleTheme,\n // 'themes/snow': SnowTheme,\n\n // 'ui/icons': Icons,\n // 'ui/picker': Picker,\n // 'ui/icon-picker': IconPicker,\n // 'ui/color-picker': ColorPicker,\n // 'ui/tooltip': Tooltip\n}, true);\n\n\nexport default Quill;\n"],"names":["root","factory","exports","module","define","amd","self","elem","document","createElement","classList","toggle","contains","_toggle","DOMTokenList","prototype","token","force","arguments","length","this","call","String","startsWith","searchString","position","substr","endsWith","subjectString","toString","isFinite","Math","floor","lastIndex","indexOf","Array","find","Object","defineProperty","value","predicate","TypeError","list","thisArg","i","addEventListener","execCommand","has","hasOwnProperty","prefix","Events","EE","fn","context","once","EventEmitter","_events","_eventsCount","create","__proto__","eventNames","events","name","names","push","slice","getOwnPropertySymbols","concat","listeners","event","exists","evt","available","l","ee","emit","a1","a2","a3","a4","a5","args","len","removeListener","undefined","apply","j","on","listener","removeAllListeners","off","addListener","setMaxListeners","prefixed","DIFF_DELETE","DIFF_INSERT","DIFF_EQUAL","diff_main","text1","text2","cursor_pos","_fix_unicode","editdiff","oldText","newText","oldRange","index","newRange","oldLength","newLength","oldCursor","oldBefore","oldAfter","maybeNewCursor","newCursor","newBefore","newAfter","prefixLength","min","oldPrefix","newPrefix","make_edit_splice","cursor","suffixLength","oldSuffix","newSuffix","find_cursor_edit_diff","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","longtext","shorttext","hm","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","best_common","text1_a","text1_b","text2_a","text2_b","hm1","ceil","hm2","mid_common","diff_halfMatch_","diffs_a","diffs_b","text1_length","text2_length","max_d","v_offset","v_length","v1","v2","x","delta","front","k1start","k1end","k2start","k2end","d","k1","k1_offset","y1","x1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","diff_bisect_","diff_compute_","unshift","diff_cleanupMerge","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","is_surrogate_pair_start","charCodeAt","pointerend","is_surrogate_pair_end","fix_unicode","pointer","count_delete","count_insert","text_delete","text_insert","splice","previous_equality","ends_with_pair_start","stray","k","starts_with_pair_end","n","pop","changes","charCode","str","before","oldMiddle","newMiddle","after","tuples","ret","remove_empty_tuples","diff","INSERT","DELETE","EQUAL","HASH_UNDEFINED","MAX_SAFE_INTEGER","argsTag","boolTag","dateTag","funcTag","genTag","mapTag","numberTag","objectTag","promiseTag","regexpTag","setTag","stringTag","symbolTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reFlags","reIsHostCtor","reIsUint","cloneableTags","freeGlobal","g","freeSelf","Function","freeExports","nodeType","freeModule","moduleExports","addMapEntry","map","pair","set","addSetEntry","add","arrayReduce","array","iteratee","accumulator","initAccum","isHostObject","result","e","mapToArray","size","forEach","key","overArg","func","transform","arg","setToArray","uid","arrayProto","funcProto","objectProto","coreJsData","maskSrcKey","exec","keys","IE_PROTO","funcToString","objectToString","reIsNative","RegExp","replace","Buffer","Symbol","Uint8Array","getPrototype","getPrototypeOf","objectCreate","propertyIsEnumerable","nativeGetSymbols","nativeIsBuffer","isBuffer","nativeKeys","DataView","getNative","Map","Promise","Set","WeakMap","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","valueOf","Hash","entries","clear","entry","ListCache","MapCache","Stack","__data__","arrayLikeKeys","inherited","isArray","isObjectLike","isArrayLike","isArrayLikeObject","isArguments","baseTimes","skipIndexes","isIndex","assignValue","object","objValue","eq","assocIndexOf","baseClone","isDeep","isFull","customizer","stack","isObject","isArr","constructor","input","initCloneArray","source","copyArray","tag","getTag","isFunc","buffer","copy","cloneBuffer","isPrototype","proto","initCloneObject","copyObject","getSymbols","copySymbols","baseAssign","cloneFunc","Ctor","cloneArrayBuffer","dataView","byteOffset","byteLength","cloneDataView","typedArray","cloneTypedArray","cloneMap","regexp","cloneRegExp","cloneSet","symbol","initCloneByTag","stacked","get","props","keysFunc","symbolsFunc","values","offset","arrayPush","baseGetAllKeys","getAllKeys","arrayEach","subValue","baseIsNative","isFunction","test","arrayBuffer","newValue","getMapData","type","data","getValue","cache","pairs","LARGE_ARRAY_SIZE","other","ArrayBuffer","resolve","ctorString","isLength","baseKeys","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","arrayTag","asyncTag","errorTag","nullTag","proxyTag","undefinedTag","typedArrayTags","freeProcess","process","nodeUtil","binding","nodeIsTypedArray","isTypedArray","arraySome","nativeObjectToString","symToStringTag","toStringTag","SetCache","isArg","isBuff","isType","baseGetTag","isOwn","unmasked","getRawTag","baseIsArguments","baseIsEqual","bitmask","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","message","convert","isPartial","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","objLength","othProps","othLength","skipCtor","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","isMasked","arrLength","seen","arrValue","othIndex","resIndex","arrayFilter","baseUnary","types","require","objectCtorString","allocUnsafe","nativeMax","max","nativeNow","Date","now","baseCreate","assignMergeValue","baseAssignValue","fromRight","baseFor","iterable","baseKeysIn","nativeKeysIn","isProto","baseMerge","srcIndex","srcValue","mergeFunc","safeGet","isCommon","isTyped","isPlainObject","isNew","keysIn","toPlainObject","baseMergeDeep","baseRest","start","setToString","otherArgs","overRest","identity","baseSetToString","string","count","lastCalled","stamp","remaining","shortOut","assigner","merge","sources","guard","isIterateeCall","property","extendStatics","__extends","setPrototypeOf","b","p","__","ParchmentError","_super","_this","Error","Scope","attributes","classes","tags","query","scope","match","ANY","Text","Node","TEXT_NODE","LEVEL","BLOCK","INLINE","HTMLElement","getAttribute","split","tagName","TYPE","DATA_KEY","BlotClass","node","bubble","blot","parentNode","register","Definitions","_i","Definition","blotName","attrName","keyName","className","toUpperCase","Registry","Attributor","options","attributeBit","ATTRIBUTE","whitelist","item","canAdd","setAttribute","BLOT","remove","removeAttribute","default","linked_list_1","shadow_1","ContainerBlot","domNode","build","appendChild","insertBefore","attach","children","child","childNodes","reverse","makeBlot","head","err","deleteAt","forEachAt","descendant","criteria","_a","descendants","Number","MAX_VALUE","lengthLeft","detach","formatAt","insertAt","def","childBlot","refBlot","statics","allowedChildren","some","insertInto","reduce","memo","moveChildren","targetParent","refNode","optimize","defaultChild","path","inclusive","removeChild","target","next","clone","parent","unwrap","update","mutations","addedNodes","removedNodes","mutation","body","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","filter","sort","a","DOCUMENT_POSITION_FOLLOWING","nextSibling","replaceChild","attributor_1","store_1","container_1","FormatBlot","formats","toLowerCase","format","attribute","replaceWith","replacement","wrap","wrapper","move","LeafBlot","INLINE_BLOT","ShadowBlot","enumerable","configurable","parseInt","scroll","cloneNode","isolate","parent_1","ref","parentBlot","refDomNode","class_1","style_1","AttributorStore","styles","attr","ClassAttributor","join","camelize","parts","rest","part","StyleAttributor","trim","style","format_1","leaf_1","scroll_1","inline_1","block_1","embed_1","text_1","Parchment","Container","Format","Leaf","Embed","Scroll","Block","Inline","Attribute","Class","Style","Store","LinkedList","tail","append","nodes","cur","iterator","prev","curNode","length_1","callback","startNode","curIndex","curLength","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","ScrollBlot","observer","MutationObserver","observe","disconnect","records","takeRecords","mark","markParent","previousSibling","grandChild","BLOCK_BLOT","InlineBlot","obj1","obj2","prop","isEqual","BlockBlot","navigator","userAgent","EmbedBlot","TextBlot","text","createTextNode","splitText","AttributeMap","compose","keepNull","attrs","invert","base","baseInverted","priority","NULL_CHARACTER","fromCharCode","ops","insert","newOp","delete","retain","lastOp","chop","partition","passed","failed","op","initialValue","changeLength","end","iter","hasNext","nextOp","Delta","thisIter","otherIter","firstOther","peek","firstLeft","peekType","peekLength","thisOp","otherOp","strings","retDelta","diffResult","component","opLength","eachLine","newline","line","inverted","baseIndex","baseOp","transformPosition","nextType","Op","Infinity","retOp","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","id","loaded","__webpack_modules__","getter","__esModule","definition","o","globalThis","window","obj","nmd","paths","Break","super","compare","selfIndex","order","otherIndex","BlockEmbed","BLOCK_ATTRIBUTE","block","leaf","bubbleFormats","lines","shift","Code","CodeBlock","textContent","frag","nextNewline","newlineIndex","prevNewline","isolateLength","searchIndex","lastIndexOf","querySelectorAll","TAB","Cursor","selection","textNode","CONTENTS","_length","restore","composing","restoreText","range","getNativeRange","lastChild","startOffset","endNode","endOffset","ASCII","combineFormats","combined","merged","getDelta","applyDelta","consumeNextNewline","scrollLength","batchStart","cloneDeep","image","bullet","normalizeDelta","batchEnd","deleteText","formatLine","lengthRemaining","lineLength","codeIndex","codeLength","formatText","getContents","getFormat","leaves","lineFormats","leafFormats","blots","getText","insertEmbed","embed","insertText","isBlank","removeFormat","suffix","change","cursorIndex","oldDelta","textBlot","oldValue","CursorBlot","levels","level","debug","method","_len","_key","console","namespace","ns","logger","bind","newLevel","EMITTERS","supportsRootNode","eventName","em","handleDOM","Emitter","error","log","connect","_len2","_key2","composedPath","_ref","handler","containsNode","getRootNode","host","listenDOM","EDITOR_CHANGE","SCROLL_BEFORE_UPDATE","SCROLL_OPTIMIZE","SCROLL_UPDATE","SELECTION_CHANGE","TEXT_CHANGE","API","SILENT","USER","Module","quill","DEFAULTS","SUPPORTS_SHADOW_SELECTION","ShadowRoot","getSelection","SUPPORTS_BEFORE_INPUT","InputEvent","getTargetRanges","IS_FIREFOX","IS_MSIE","IS_EDGE","processing","ShadowSelection","_ranges","rangeCount","getRangeAt","addRange","windowSel","removeAllRanges","setBaseAndExtent","startContainer","endContainer","active","activeElement","shadowRoot","getActiveElement","Range","setStart","setEnd","preventDefault","stopImmediatePropagation","Selection","emitter","mouseDown","rootDocument","lastRange","savedRange","handleComposition","handleDragging","setTimeout","_","hasFocus","native","hackOffset","setNativeRange","ignored","focus","setRange","nativeRange","collapsed","getBounds","createRange","getBoundingClientRect","rect","side","bottom","top","height","left","right","width","normalizeNative","info","getRange","normalized","normalizedToRange","positions","indexes","rangeToNative","scrollIntoView","scrollingContainer","bounds","limit","first","last","scrollBounds","scrollTop","blur","Theme","modules","init","addModule","moduleClass","import","themes","Quill","__quill","imports","overwrite","warn","container","userConfig","clipboard","keyboard","history","theme","themeConfig","config","moduleConfig","toolbar","querySelector","expandConfig","html","innerHTML","addContainer","editor","Editor","modify","contents","setContents","placeholder","readOnly","disable","overload","enable","enabled","setSelection","containerBounds","getLength","getIndex","getLeaf","getLine","getLines","getModule","isEnabled","pasteHTML","dangerouslyPasteHTML","deleted","applied","setText","updateContents","modifier","strict","shiftRange","pos","version","GUARD_TEXT","contentNode","childNode","leftGuard","rightGuard","prevLength","isLine","batch","AlignAttribute","AlignClass","AlignStyle","ColorAttributor","ColorClass","ColorStyle","BackgroundClass","BackgroundStyle","DirectionAttribute","DirectionClass","DirectionStyle","FontClass","FontStyleAttributor","FontStyle","SizeClass","SizeStyle","DOM_KEY","CLIPBOARD_CONFIG","computeStyle","whiteSpace","replacer","collapse","matchNewline","deltaEndsWith","ELEMENT_NODE","applyFormat","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","fontStyle","italic","fontWeight","bold","parseFloat","textIndent","indent","matchAlias","Clipboard","onPaste","matchers","selector","matcher","addMatcher","innerText","elementMatchers","textMatchers","prepareMatching","traverse","paste","defaultPrevented","getComputedStyle","endText","display","childrenDelta","matchVisual","History","lastRecorded","ignoreChange","userOnly","record","addBinding","shortKey","undo","shiftKey","redo","platform","dest","deleteLength","changeIndex","endsWithNewlineChange","getLastChangeIndex","cutoff","changeDelta","undoDelta","timestamp","delay","maxStack","SHORTKEY","Keyboard","normalize","which","keyCode","bindings","ENTER","handleEnter","metaKey","ctrlKey","altKey","BACKSPACE","handleBackspace","handleDelete","handleDeleteRange","listen","leafStart","offsetStart","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","every","makeEmbedArrowHandler","where","LEFT","RIGHT","curFormats","prevFormats","nextLength","nextFormats","DeltaOp","firstFormats","lastFormats","makeCodeBlockHandler","scrollIndex","makeFormatHandler","ESCAPE","UP","DOWN","header","IdentAttributor","IndentClass","Blockquote","Header","ListItem","List","hasAttribute","listEventHandler","Bold","Italic","Link","sanitize","url","PROTOCOL_WHITELIST","SANITIZED_URL","protocols","anchor","href","protocol","Script","Strike","Underline","ATTRIBUTES","Image","Video","Toolbar","groups","controls","group","control","addButton","option","addSelect","addControls","handlers","addHandler","selectedIndex","selected","prompt","isActive","clean","direction","align","link","Indent","InlineCode"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"vaadin-quill.js","mappings":";;;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,GACjB,CATD,CASGK,MAAM,IACT,M,gBCVA,IAAIC,EAAOC,SAASC,cAAc,OAElC,GADAF,EAAKG,UAAUC,OAAO,cAAc,GAChCJ,EAAKG,UAAUE,SAAS,cAAe,CACzC,IAAIC,EAAUC,aAAaC,UAAUJ,OACrCG,aAAaC,UAAUJ,OAAS,SAASK,EAAOC,GAC9C,OAAIC,UAAUC,OAAS,IAAMC,KAAKR,SAASI,KAAYC,EAC9CA,EAEAJ,EAAQQ,KAAKD,KAAMJ,EAE9B,CACF,CAEKM,OAAOP,UAAUQ,aACpBD,OAAOP,UAAUQ,WAAa,SAASC,EAAcC,GAEnD,OADAA,EAAWA,GAAY,EAChBL,KAAKM,OAAOD,EAAUD,EAAaL,UAAYK,CACxD,GAGGF,OAAOP,UAAUY,WACpBL,OAAOP,UAAUY,SAAW,SAASH,EAAcC,GACjD,IAAIG,EAAgBR,KAAKS,YACD,iBAAbJ,IAA0BK,SAASL,IAAaM,KAAKC,MAAMP,KAAcA,GAAYA,EAAWG,EAAcT,UACvHM,EAAWG,EAAcT,QAE3BM,GAAYD,EAAaL,OACzB,IAAIc,EAAYL,EAAcM,QAAQV,EAAcC,GACpD,OAAsB,IAAfQ,GAAoBA,IAAcR,CAC3C,GAGGU,MAAMpB,UAAUqB,MACnBC,OAAOC,eAAeH,MAAMpB,UAAW,OAAQ,CAC7CwB,MAAO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,EAAQz0B,KAAK+5B,MAAMI,eACnBlS,EAAUjoB,KAAK+5B,MAAM1D,UAAU5B,GACrB,UAAVtzB,EACsB,YAApB8mB,EAAc,MAAuC,cAApBA,EAAc,KACjDjoB,KAAK+5B,MAAM5R,OAAO,QAAQ,EAAOiX,GAAMnf,QAAQ4Z,MAE/C75B,KAAK+5B,MAAM5R,OAAO,OAAQ,YAAaiX,GAAMnf,QAAQ4Z,MAGvD75B,KAAK+5B,MAAM5R,OAAO,OAAQhnB,EAAOi+B,GAAMnf,QAAQ4Z,KAEnD,ICvNJuF,GAAM5c,SAAS,CACb,kCAAmC+gB,GAEnC,0BAA2BP,GAC3B,+BAAgCK,GAChC,0BAA2BF,GAC3B,8BAA+BK,GAC/B,yBAA0BE,GAC1B,yBAA0BG,GAE1B,0BAA2BZ,GAC3B,+BAAgCK,GAChC,0BAA2BF,GAC3B,8BAA+BK,GAC/B,yBAA0BG,GAC1B,yBAA0BE,KACzB,GAGH1E,GAAM5c,SAAS,CACb,gBAAiBwgB,GACjB,oBAAqBQ,GACrB,iBAAkByJ,GAElB,qBAAsB3J,GACtB,gBAAiBF,GACjB,eAAgBM,GAChB,eAAgBG,GAEhB,qBAAsB0G,GACtB,qBAAsBjX,EACtB,iBAAkBkX,GAClB,eAAgBE,GAEhB,eAAgBG,GAChB,eAAgBqC,EAChB,iBAAkBpC,GAClB,eAAgBC,GAChB,iBAAkBS,GAClB,iBAAkBC,GAClB,oBAAqBC,GAErB,gBAAiBE,GACjB,gBAAiBC,GAEjB,oBAAqBpB,GAIrB,kBAAmBqB,KAUlB,GAGH,W,kB3E7FA","sources":["webpack://Quill/webpack/universalModuleDefinition","webpack://Quill/./core/polyfill.js","webpack://Quill/./node_modules/eventemitter3/index.js","webpack://Quill/./node_modules/fast-diff/diff.js","webpack://Quill/./node_modules/lodash.clonedeep/index.js","webpack://Quill/./node_modules/lodash.isequal/index.js","webpack://Quill/./node_modules/lodash.merge/index.js","webpack://Quill/../../../../webpack/universalModuleDefinition","webpack://Quill/../../../../webpack/bootstrap 3c334e19bc1efdeb80ab","webpack://Quill/../../../../src/registry.ts","webpack://Quill/../../../../src/attributor/attributor.ts","webpack://Quill/../../../../src/blot/abstract/container.ts","webpack://Quill/../../../../src/blot/abstract/format.ts","webpack://Quill/../../../../src/blot/abstract/leaf.ts","webpack://Quill/../../../../src/blot/abstract/shadow.ts","webpack://Quill/../../../../src/attributor/store.ts","webpack://Quill/../../../../src/attributor/class.ts","webpack://Quill/../../../../src/attributor/style.ts","webpack://Quill/../../../../src/parchment.ts","webpack://Quill/../../../../src/collection/linked-list.ts","webpack://Quill/../../../../src/blot/scroll.ts","webpack://Quill/../../../../src/blot/inline.ts","webpack://Quill/../../../../src/blot/block.ts","webpack://Quill/../../../../src/blot/embed.ts","webpack://Quill/../../../../src/blot/text.ts","webpack://Quill/./node_modules/quill-delta/src/AttributeMap.ts","webpack://Quill/./node_modules/quill-delta/src/Delta.ts","webpack://Quill/./node_modules/quill-delta/src/Iterator.ts","webpack://Quill/./node_modules/quill-delta/src/Op.ts","webpack://Quill/webpack/bootstrap","webpack://Quill/webpack/runtime/compat get default export","webpack://Quill/webpack/runtime/define property getters","webpack://Quill/webpack/runtime/global","webpack://Quill/webpack/runtime/hasOwnProperty shorthand","webpack://Quill/webpack/runtime/node module decorator","webpack://Quill/./blots/break.js","webpack://Quill/./blots/text.js","webpack://Quill/./blots/inline.js","webpack://Quill/./blots/block.js","webpack://Quill/./formats/code.js","webpack://Quill/./blots/cursor.js","webpack://Quill/./core/editor.js","webpack://Quill/./core/logger.js","webpack://Quill/./core/emitter.js","webpack://Quill/./core/module.js","webpack://Quill/./core/shadow-selection-polyfill.js","webpack://Quill/./core/selection.js","webpack://Quill/./core/theme.js","webpack://Quill/./core/quill.js","webpack://Quill/./blots/container.js","webpack://Quill/./blots/embed.js","webpack://Quill/./blots/scroll.js","webpack://Quill/./formats/align.js","webpack://Quill/./formats/color.js","webpack://Quill/./formats/background.js","webpack://Quill/./formats/direction.js","webpack://Quill/./formats/font.js","webpack://Quill/./formats/size.js","webpack://Quill/./modules/clipboard.js","webpack://Quill/./modules/history.js","webpack://Quill/./modules/keyboard.js","webpack://Quill/./core.js","webpack://Quill/./formats/indent.js","webpack://Quill/./formats/blockquote.js","webpack://Quill/./formats/header.js","webpack://Quill/./formats/list.js","webpack://Quill/./formats/bold.js","webpack://Quill/./formats/italic.js","webpack://Quill/./formats/link.js","webpack://Quill/./formats/script.js","webpack://Quill/./formats/strike.js","webpack://Quill/./formats/underline.js","webpack://Quill/./formats/image.js","webpack://Quill/./formats/video.js","webpack://Quill/./modules/toolbar.js","webpack://Quill/./vaadin-quill.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(self, () => {\nreturn ","let elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n let _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function(token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position){\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function(searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n // Disable resizing in Firefox\n document.execCommand(\"enableObjectResizing\", false, false);\n // Disable automatic linkifying in IE11\n document.execCommand(\"autoUrlDetect\", false, false);\n});\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 !== 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) === text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i), shorttext.substring(j));\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i), shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(\n j - suffixLength, j) + shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length - commonlength);\n text_delete = text_delete.substring(0, text_delete.length - commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n};\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xD800 && charCode <= 0xDBFF;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xDC00 && charCode <= 0xDFFF;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after]\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange = typeof cursor_pos === 'number' ?\n { index: cursor_pos, length: 0 } : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === 'number' ?\n null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeMax = Math.max,\n nativeNow = Date.now;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = merge;\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Parchment\"] = factory();\n\telse\n\t\troot[\"Parchment\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3c334e19bc1efdeb80ab","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ParchmentError = /** @class */ (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n var _this = this;\n message = '[Parchment] ' + message;\n _this = _super.call(this, message) || this;\n _this.message = message;\n _this.name = _this.constructor.name;\n return _this;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\nvar Scope;\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(Scope = exports.Scope || (exports.Scope = {}));\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = \n // @ts-ignore\n input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n // @ts-ignore\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n // @ts-ignore\n }\n else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null)\n return null;\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/registry.ts\n// module id = 0\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../registry\");\nvar Attributor = /** @class */ (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match == null)\n return false;\n if (this.whitelist == null)\n return true;\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n }\n else {\n return this.whitelist.indexOf(value) > -1;\n }\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n var value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n };\n return Attributor;\n}());\nexports.default = Attributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/attributor/attributor.ts\n// module id = 1\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar linked_list_1 = require(\"../../collection/linked-list\");\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar ContainerBlot = /** @class */ (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.build();\n return _this;\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.children.forEach(function (child) {\n child.attach();\n });\n };\n ContainerBlot.prototype.build = function () {\n var _this = this;\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice\n .call(this.domNode.childNodes)\n .reverse()\n .forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head || undefined);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [];\n var lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null &&\n !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize(context);\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations, context) {\n var _this = this;\n var addedNodes = [];\n var removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes\n .filter(function (node) {\n return node.parentNode == _this.domNode;\n })\n .sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot || undefined);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot;\n}\nexports.default = ContainerBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/abstract/container.ts\n// module id = 2\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"../../attributor/attributor\");\nvar store_1 = require(\"../../attributor/store\");\nvar container_1 = require(\"./container\");\nvar Registry = require(\"../../registry\");\nvar FormatBlot = /** @class */ (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.attributes = new store_1.default(_this.domNode);\n return _this;\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations, context) {\n var _this = this;\n _super.prototype.update.call(this, mutations, context);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nexports.default = FormatBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/abstract/format.ts\n// module id = 3\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar LeafBlot = /** @class */ (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (this.domNode === node ||\n this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return Math.min(offset, 1);\n }\n return -1;\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nexports.default = LeafBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/abstract/leaf.ts\n// module id = 4\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../../registry\");\nvar ShadowBlot = /** @class */ (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n // @ts-ignore\n this.domNode[Registry.DATA_KEY] = { blot: this };\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n if (this.parent != null) {\n this.scroll = this.parent.scroll;\n }\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode(false);\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent_1 = Registry.create(this.statics.scope);\n blot.wrap(parent_1);\n parent_1.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (refBlot === void 0) { refBlot = null; }\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n var refDomNode = null;\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (this.domNode.parentNode != parentBlot.domNode ||\n this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n this.attach();\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function (context) {\n // TODO clean up once we use WeakMap\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY] != null) {\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations, context) {\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nexports.default = ShadowBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/abstract/shadow.ts\n// module id = 5\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nvar class_1 = require(\"./class\");\nvar style_1 = require(\"./style\");\nvar Registry = require(\"../registry\");\nvar AttributorStore = /** @class */ (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nexports.default = AttributorStore;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/attributor/store.ts\n// module id = 6\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = /** @class */ (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name\n .split('-')\n .slice(0, -1)\n .join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n var value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n };\n return ClassAttributor;\n}(attributor_1.default));\nexports.default = ClassAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/attributor/class.ts\n// module id = 7\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts\n .slice(1)\n .map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n })\n .join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = /** @class */ (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n // @ts-ignore\n var value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n };\n return StyleAttributor;\n}(attributor_1.default));\nexports.default = StyleAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/attributor/style.ts\n// module id = 8\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./blot/abstract/container\");\nvar format_1 = require(\"./blot/abstract/format\");\nvar leaf_1 = require(\"./blot/abstract/leaf\");\nvar scroll_1 = require(\"./blot/scroll\");\nvar inline_1 = require(\"./blot/inline\");\nvar block_1 = require(\"./blot/block\");\nvar embed_1 = require(\"./blot/embed\");\nvar text_1 = require(\"./blot/text\");\nvar attributor_1 = require(\"./attributor/attributor\");\nvar class_1 = require(\"./attributor/class\");\nvar style_1 = require(\"./attributor/style\");\nvar store_1 = require(\"./attributor/store\");\nvar Registry = require(\"./registry\");\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default,\n },\n};\nexports.default = Parchment;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/parchment.ts\n// module id = 10\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedList = /** @class */ (function () {\n function LinkedList() {\n this.head = this.tail = null;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i] = arguments[_i];\n }\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n if (!node)\n return;\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while ((cur = next())) {\n var length_1 = cur.length();\n if (index < length_1 ||\n (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length_1;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nexports.default = LinkedList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/collection/linked-list.ts\n// module id = 11\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./abstract/container\");\nvar Registry = require(\"../registry\");\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = /** @class */ (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.scroll = _this;\n _this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n _this.observer.observe(_this.domNode, OBSERVER_CONFIG);\n _this.attach();\n return _this;\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations, context) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n if (context === void 0) { context = {}; }\n _super.prototype.optimize.call(this, context);\n // We must modify mutations directly, cannot make copy and then modify\n var records = [].slice.call(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0)\n mutations.push(records.pop());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n // Post-order traversal\n if (\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY] == null ||\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize(context);\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = [].slice.call(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0)\n mutations.push(records.pop());\n }\n };\n ScrollBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (context === void 0) { context = {}; }\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations\n .map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return null;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n })\n .forEach(function (blot) {\n if (blot == null ||\n blot === _this ||\n //@ts-ignore\n blot.domNode[Registry.DATA_KEY] == null)\n return;\n // @ts-ignore\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);\n });\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n // @ts-ignore\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);\n }\n this.optimize(mutations, context);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nexports.default = ScrollBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/scroll.ts\n// module id = 12\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n // @ts-ignore\n for (var prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = /** @class */ (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nexports.default = InlineBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/inline.ts\n// module id = 13\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\nvar BlockBlot = /** @class */ (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.prototype.update = function (mutations, context) {\n if (navigator.userAgent.match(/Trident/)) {\n this.build();\n }\n else {\n _super.prototype.update.call(this, mutations, context);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nexports.default = BlockBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/block.ts\n// module id = 14\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar EmbedBlot = /** @class */ (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nexports.default = EmbedBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/embed.ts\n// module id = 15\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar Registry = require(\"../registry\");\nvar TextBlot = /** @class */ (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.text = _this.statics.value(_this.domNode);\n return _this;\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n var text = domNode.data;\n // @ts-ignore\n if (text['normalize'])\n text = text['normalize']();\n return text;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nexports.default = TextBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/blot/text.ts\n// module id = 16\n// module chunks = 0","import cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\n\ninterface AttributeMap {\n [key: string]: any;\n}\n\nnamespace AttributeMap {\n export function compose(\n a: AttributeMap = {},\n b: AttributeMap = {},\n keepNull: boolean,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n let attributes = cloneDeep(b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce((copy, key) => {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (const key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function diff(\n a: AttributeMap = {},\n b: AttributeMap = {},\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n const attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce((attrs, key) => {\n if (!isEqual(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function invert(\n attr: AttributeMap = {},\n base: AttributeMap = {},\n ): AttributeMap {\n attr = attr || {};\n const baseInverted = Object.keys(base).reduce((memo, key) => {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce((memo, key) => {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n\n export function transform(\n a: AttributeMap | undefined,\n b: AttributeMap | undefined,\n priority = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n const attributes = Object.keys(b).reduce((attrs, key) => {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n}\n\nexport default AttributeMap;\n","import diff from 'fast-diff';\nimport cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\nimport AttributeMap from './AttributeMap';\nimport Op from './Op';\n\nconst NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\nclass Delta {\n static Op = Op;\n static AttributeMap = AttributeMap;\n\n ops: Op[];\n constructor(ops?: Op[] | { ops: Op[] }) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n }\n\n insert(arg: string | object, attributes?: AttributeMap): this {\n const newOp: Op = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n delete(length: number): this {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n }\n\n retain(length: number, attributes?: AttributeMap): this {\n if (length <= 0) {\n return this;\n }\n const newOp: Op = { retain: length };\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n push(newOp: Op): this {\n let index = this.ops.length;\n let lastOp = this.ops[index - 1];\n newOp = cloneDeep(newOp);\n if (typeof lastOp === 'object') {\n if (\n typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number'\n ) {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (isEqual(newOp.attributes, lastOp.attributes)) {\n if (\n typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string'\n ) {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n } else if (\n typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number'\n ) {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n }\n\n chop(): this {\n const lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n }\n\n filter(predicate: (op: Op, index: number) => boolean): Op[] {\n return this.ops.filter(predicate);\n }\n\n forEach(predicate: (op: Op, index: number) => void): void {\n this.ops.forEach(predicate);\n }\n\n map(predicate: (op: Op, index: number) => T): T[] {\n return this.ops.map(predicate);\n }\n\n partition(predicate: (op: Op) => boolean): [Op[], Op[]] {\n const passed: Op[] = [];\n const failed: Op[] = [];\n this.forEach((op) => {\n const target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n }\n\n reduce(\n predicate: (accum: T, curr: Op, index: number) => T,\n initialValue: T,\n ): T {\n return this.ops.reduce(predicate, initialValue);\n }\n\n changeLength(): number {\n return this.reduce((length, elem) => {\n if (elem.insert) {\n return length + Op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n }\n\n length(): number {\n return this.reduce((length, elem) => {\n return length + Op.length(elem);\n }, 0);\n }\n\n slice(start = 0, end = Infinity): Delta {\n const ops = [];\n const iter = Op.iterator(this.ops);\n let index = 0;\n while (index < end && iter.hasNext()) {\n let nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op.length(nextOp);\n }\n return new Delta(ops);\n }\n\n compose(other: Delta): Delta {\n const thisIter = Op.iterator(this.ops);\n const otherIter = Op.iterator(other.ops);\n const ops = [];\n const firstOther = otherIter.peek();\n if (\n firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null\n ) {\n let firstLeft = firstOther.retain;\n while (\n thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft\n ) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n const delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n const newOp: Op = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n const attributes = AttributeMap.compose(\n thisOp.attributes,\n otherOp.attributes,\n typeof thisOp.retain === 'number',\n );\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n\n // Optimization if rest of other is just retain\n if (\n !otherIter.hasNext() &&\n isEqual(delta.ops[delta.ops.length - 1], newOp)\n ) {\n const rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (\n typeof otherOp.delete === 'number' &&\n typeof thisOp.retain === 'number'\n ) {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n }\n\n concat(other: Delta): Delta {\n const delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n }\n\n diff(other: Delta, cursor?: number | diff.CursorInfo): Delta {\n if (this.ops === other.ops) {\n return new Delta();\n }\n const strings = [this, other].map((delta) => {\n return delta\n .map((op) => {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n const prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n const retDelta = new Delta();\n const diffResult = diff(strings[0], strings[1], cursor);\n const thisIter = Op.iterator(this.ops);\n const otherIter = Op.iterator(other.ops);\n diffResult.forEach((component: diff.Diff) => {\n let length = component[1].length;\n while (length > 0) {\n let opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(\n thisIter.peekLength(),\n otherIter.peekLength(),\n length,\n );\n const thisOp = thisIter.next(opLength);\n const otherOp = otherIter.next(opLength);\n if (isEqual(thisOp.insert, otherOp.insert)) {\n retDelta.retain(\n opLength,\n AttributeMap.diff(thisOp.attributes, otherOp.attributes),\n );\n } else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n }\n\n eachLine(\n predicate: (\n line: Delta,\n attributes: AttributeMap,\n index: number,\n ) => boolean | void,\n newline = '\\n',\n ): void {\n const iter = Op.iterator(this.ops);\n let line = new Delta();\n let i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n const thisOp = iter.peek();\n const start = Op.length(thisOp) - iter.peekLength();\n const index =\n typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n }\n\n invert(base: Delta): Delta {\n const inverted = new Delta();\n this.reduce((baseIndex, op) => {\n if (op.insert) {\n inverted.delete(Op.length(op));\n } else if (op.retain && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n } else if (op.delete || (op.retain && op.attributes)) {\n const length = (op.delete || op.retain) as number;\n const slice = base.slice(baseIndex, baseIndex + length);\n slice.forEach((baseOp) => {\n if (op.delete) {\n inverted.push(baseOp);\n } else if (op.retain && op.attributes) {\n inverted.retain(\n Op.length(baseOp),\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n }\n });\n return baseIndex + length;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n }\n\n transform(index: number, priority?: boolean): number;\n transform(other: Delta, priority?: boolean): Delta;\n transform(arg: number | Delta, priority = false): typeof arg {\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n const other: Delta = arg;\n const thisIter = Op.iterator(this.ops);\n const otherIter = Op.iterator(other.ops);\n const delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (\n thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')\n ) {\n delta.retain(Op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp.delete) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(\n length,\n AttributeMap.transform(\n thisOp.attributes,\n otherOp.attributes,\n priority,\n ),\n );\n }\n }\n }\n return delta.chop();\n }\n\n transformPosition(index: number, priority = false): number {\n priority = !!priority;\n const thisIter = Op.iterator(this.ops);\n let offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n const length = thisIter.peekLength();\n const nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n }\n}\n\nexport = Delta;\n","import Op from './Op';\n\nexport default class Iterator {\n ops: Op[];\n index: number;\n offset: number;\n\n constructor(ops: Op[]) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n\n hasNext(): boolean {\n return this.peekLength() < Infinity;\n }\n\n next(length?: number): Op {\n if (!length) {\n length = Infinity;\n }\n const nextOp = this.ops[this.index];\n if (nextOp) {\n const offset = this.offset;\n const opLength = Op.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n } else {\n const retOp: Op = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n }\n\n peek(): Op {\n return this.ops[this.index];\n }\n\n peekLength(): number {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n }\n\n peekType(): string {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index].delete === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n }\n\n rest(): Op[] {\n if (!this.hasNext()) {\n return [];\n } else if (this.offset === 0) {\n return this.ops.slice(this.index);\n } else {\n const offset = this.offset;\n const index = this.index;\n const next = this.next();\n const rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n }\n}\n","import AttributeMap from './AttributeMap';\nimport Iterator from './Iterator';\n\ninterface Op {\n // only one property out of {insert, delete, retain} will be present\n insert?: string | object;\n delete?: number;\n retain?: number;\n\n attributes?: AttributeMap;\n}\n\nnamespace Op {\n export function iterator(ops: Op[]): Iterator {\n return new Iterator(ops);\n }\n\n export function length(op: Op): number {\n if (typeof op.delete === 'number') {\n return op.delete;\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n}\n\nexport default Op;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","import Parchment from 'parchment';\n\n\nclass Break extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n insertInto(parent, ref) {\n if (parent.children.length === 0) {\n super.insertInto(parent, ref);\n } else {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\n\nexport default Break;\n","import Parchment from 'parchment';\n\nclass TextBlot extends Parchment.Text { }\n\nexport default TextBlot;\n","import Text from './text';\nimport Parchment from 'parchment';\n\n\nclass Inline extends Parchment.Inline {\n static compare(self, other) {\n let selfIndex = Inline.order.indexOf(self);\n let otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n\n formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && Parchment.query(name, Parchment.Scope.BLOT)) {\n let blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n let parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, Parchment.Embed, Text];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = [\n 'cursor', 'inline', // Must be lower\n 'underline', 'strike', 'italic', 'bold', 'script',\n 'link', 'code' // Must be higher\n];\n\n\nexport default Inline;\n","import merge from 'lodash.merge';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Break from './break';\nimport Inline from './inline';\nimport TextBlot from './text';\n\n\nconst NEWLINE_LENGTH = 1;\n\n\nclass BlockEmbed extends Parchment.Embed {\n attach() {\n super.attach();\n this.attributes = new Parchment.Attributor.Store(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), merge(this.formats(), this.attributes.values()));\n }\n\n format(name, value) {\n let attribute = Parchment.query(name, Parchment.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n let block = Parchment.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n}\nBlockEmbed.scope = Parchment.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nclass Block extends Parchment.Block {\n constructor(domNode) {\n super(domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(Parchment.Leaf).reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new Delta()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) return super.insertAt(index, value, def);\n if (value.length === 0) return;\n let lines = value.split('\\n');\n let text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n let block = this;\n lines.reduce(function(index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n let head = this.children.head;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n let clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n let next = super.split(index, force);\n this.cache = {};\n return next;\n }\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [Inline, Parchment.Embed, TextBlot];\n\n\nfunction bubbleFormats(blot, formats = {}) {\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = merge(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\n\nexport { bubbleFormats, BlockEmbed, Block as default };\n","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Inline from '../blots/inline';\nimport TextBlot from '../blots/text';\n\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\n\nclass CodeBlock extends Block {\n static create(value) {\n let domNode = super.create(value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n\n static formats() {\n return true;\n }\n\n delta() {\n let text = this.domNode.textContent;\n if (text.endsWith('\\n')) { // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce((delta, frag) => {\n return delta.insert(frag).insert('\\n', this.formats());\n }, new Delta());\n }\n\n format(name, value) {\n if (name === this.statics.blotName && value) return;\n let [text, ] = this.descendant(TextBlot, this.length() - 1);\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n super.format(name, value);\n }\n\n formatAt(index, length, name, value) {\n if (length === 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK) == null ||\n (name === this.statics.blotName && value === this.statics.formats(this.domNode))) {\n return;\n }\n let nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n let prevNewline = this.newlineIndex(index, true) + 1;\n let isolateLength = nextNewline - prevNewline + 1;\n let blot = this.isolate(prevNewline, isolateLength);\n let next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n\n insertAt(index, value, def) {\n if (def != null) return;\n let [text, offset] = this.descendant(TextBlot, index);\n text.insertAt(offset, value);\n }\n\n length() {\n let length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n\n newlineIndex(searchIndex, reverse = false) {\n if (!reverse) {\n let offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n\n optimize(context) {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(Parchment.create('text', '\\n'));\n }\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize(context);\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n super.replace(target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function(node) {\n let blot = Parchment.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof Parchment.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n}\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\n\nexport { Code, CodeBlock as default };\n","import Parchment from 'parchment';\nimport TextBlot from './text';\n\n\nclass Cursor extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n constructor(domNode, selection) {\n super(domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this._length = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this._length !== 0) {\n return super.format(name, value);\n }\n let target = this, index = 0;\n while (target != null && target.statics.scope !== Parchment.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this._length;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing || this.parent == null) return;\n let textNode = this.textNode;\n let range = this.selection.getNativeRange();\n let restoreText, start, end;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n [restoreText, start, end] = [textNode, range.start.offset, range.end.offset];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n let text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof TextBlot) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(Parchment.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start != null) {\n [start, end] = [start, end].map(function(offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n return {\n startNode: restoreText,\n startOffset: start,\n endNode: restoreText,\n endOffset: end\n };\n }\n }\n\n update(mutations, context) {\n if (mutations.some((mutation) => {\n return mutation.type === 'characterData' && mutation.target === this.textNode;\n })) {\n let range = this.restore();\n if (range) context.range = range;\n }\n }\n\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = \"\\uFEFF\"; // Zero width no break space\n\n\nexport default Cursor;\n","import cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\nimport merge from 'lodash.merge';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport Parchment from 'parchment';\nimport CodeBlock from '../formats/code';\nimport CursorBlot from '../blots/cursor';\nimport Block, { bubbleFormats } from '../blots/block';\nimport Break from '../blots/break';\n\nconst ASCII = /^[ -~]*$/;\n\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n delta = normalizeDelta(delta);\n delta.reduce((index, op) => {\n let length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n this.scroll.insertAt(index, text);\n let [line, offset] = this.scroll.line(index);\n let formats = merge({}, bubbleFormats(line));\n if (line instanceof Block) {\n let [leaf, ] = line.descendant(Parchment.Leaf, offset);\n formats = merge(formats, bubbleFormats(leaf));\n }\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n let key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n return this.update(delta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n let lines = this.scroll.lines(index, Math.max(length, 1));\n let lengthRemaining = length;\n lines.forEach((line) => {\n let lineLength = line.length();\n if (!(line instanceof CodeBlock)) {\n line.format(format, formats[format]);\n } else {\n let codeIndex = index - line.offset(this.scroll);\n let codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new Delta().retain(index).retain(length, cloneDeep(formats)));\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).retain(length, cloneDeep(formats)));\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index, length = 0) {\n let lines = [], leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function(path) {\n let [blot, ] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof Parchment.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(Parchment.Leaf, index, length);\n }\n const [lineFormats, leafFormats] = [lines, leaves].map(function(blots) {\n if (blots.length === 0) return {};\n let formats = bubbleFormats(blots.shift());\n while (Object.keys(formats).length > 0) {\n let blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return { ...lineFormats, ...leafFormats };\n }\n\n getText(index, length) {\n return this.getContents(index, length).filter(function(op) {\n return typeof op.insert === 'string';\n }).map(function(op) {\n return op.insert;\n }).join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).insert(text, cloneDeep(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n let block = this.scroll.children.head;\n if (block.statics.blotName !== Block.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index, length) {\n let text = this.getText(index, length);\n let [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0, suffix = new Delta();\n if (line != null) {\n if (!(line instanceof CodeBlock)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n let contents = this.getContents(index, length + suffixLength);\n let diff = contents.diff(new Delta().insert(text).concat(suffix));\n let delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], cursorIndex = undefined) {\n let oldDelta = this.delta;\n if (mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n mutations[0].target.data.match(ASCII) &&\n Parchment.find(mutations[0].target)) {\n // Optimization for character changes\n let textBlot = Parchment.find(mutations[0].target);\n let formats = bubbleFormats(textBlot);\n let index = textBlot.offset(this.scroll);\n let oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n let oldText = new Delta().insert(oldValue);\n let newText = new Delta().insert(textBlot.value());\n let diffDelta = new Delta().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function(delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !isEqual(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n}\n\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function(merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function(delta, op) {\n if (op.insert === 1) {\n let attributes = cloneDeep(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = cloneDeep(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n let text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new Delta());\n}\n\n\nexport default Editor;\n","let levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\n\nfunction debug(method, ...args) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function(logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function(newLevel) {\n level = newLevel;\n};\n\n\nexport default namespace;\n","import EventEmitter from 'eventemitter3';\nimport logger from './logger';\n\nconst debug = logger('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\nconst EMITTERS = [];\nconst supportsRootNode = ('getRootNode' in document);\n\nEVENTS.forEach(function(eventName) {\n document.addEventListener(eventName, (...args) => {\n EMITTERS.forEach((em) => {\n em.handleDOM(...args);\n });\n });\n});\n\n\nclass Emitter extends EventEmitter {\n constructor() {\n super();\n this.listeners = {};\n this.on('error', debug.error);\n }\n\n emit() {\n debug.log.apply(debug, arguments);\n super.emit.apply(this, arguments);\n }\n\n connect() {\n EMITTERS.push(this);\n }\n\n disconnect() {\n EMITTERS.splice(EMITTERS.indexOf(this), 1);\n }\n\n handleDOM(event, ...args) {\n const target = (event.composedPath ? event.composedPath()[0] : event.target);\n const containsNode = (node, target) => {\n if (!supportsRootNode || target.getRootNode() === document) {\n return node.contains(target);\n }\n\n while (!node.contains(target)) {\n const root = target.getRootNode();\n if (!root || !root.host) {\n return false;\n }\n target = root.host;\n }\n\n return true;\n };\n\n (this.listeners[event.type] || []).forEach(function({ node, handler }) {\n if (target === node || containsNode(node, target)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node, handler })\n }\n}\n\nEmitter.events = {\n EDITOR_CHANGE : 'editor-change',\n SCROLL_BEFORE_UPDATE : 'scroll-before-update',\n SCROLL_OPTIMIZE : 'scroll-optimize',\n SCROLL_UPDATE : 'scroll-update',\n SELECTION_CHANGE : 'selection-change',\n TEXT_CHANGE : 'text-change'\n};\nEmitter.sources = {\n API : 'api',\n SILENT : 'silent',\n USER : 'user'\n};\n\n\nexport default Emitter;\n","class Module {\n constructor(quill, options = {}) {\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n\n\nexport default Module;\n","// see https://github.com/GoogleChromeLabs/shadow-selection-polyfill/issues/11\nconst SUPPORTS_SHADOW_SELECTION = typeof window.ShadowRoot.prototype.getSelection === 'function';\nconst SUPPORTS_BEFORE_INPUT = window.InputEvent && typeof window.InputEvent.prototype.getTargetRanges === 'function';\nconst IS_FIREFOX = window.navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\nconst IS_MSIE = !!(window.navigator.userAgent.match(/Trident/) && !window.navigator.userAgent.match(/MSIE/));\nconst IS_EDGE = window.navigator.userAgent.match(/Edge/);\n\nlet processing = false;\nexport class ShadowSelection {\n constructor() {\n this._ranges = [];\n }\n\n get rangeCount() {\n return this._ranges.length;\n }\n\n getRangeAt(index) {\n return this._ranges[index];\n }\n\n addRange(range) {\n this._ranges.push(range);\n if (!processing) {\n let windowSel = window.getSelection();\n windowSel.removeAllRanges();\n windowSel.setBaseAndExtent(range.startContainer, range.startOffset, range.endContainer, range.endOffset);\n }\n }\n\n removeAllRanges() {\n this._ranges = [];\n }\n\n // todo: implement remaining `Selection` methods and properties.\n}\n\nfunction getActiveElement() {\n let active = document.activeElement;\n\n /* eslint-disable no-constant-condition */\n while (true) {\n if (active && active.shadowRoot && active.shadowRoot.activeElement) {\n active = active.shadowRoot.activeElement;\n } else {\n break;\n }\n }\n\n return active;\n}\n\nif ((IS_FIREFOX || IS_MSIE || IS_EDGE) && !SUPPORTS_SHADOW_SELECTION) {\n window.ShadowRoot.prototype.getSelection = function() {\n return document.getSelection();\n }\n}\n\nif (!IS_FIREFOX && !SUPPORTS_SHADOW_SELECTION && SUPPORTS_BEFORE_INPUT) {\n let selection = new ShadowSelection();\n\n window.ShadowRoot.prototype.getSelection = function() {\n return selection;\n }\n\n window.addEventListener('selectionchange', () => {\n if (!processing) {\n processing = true;\n\n const active = getActiveElement();\n\n if (active && (active.getAttribute('contenteditable') === 'true')) {\n document.execCommand('indent');\n } else {\n selection.removeAllRanges();\n }\n\n processing = false;\n }\n }, true);\n\n window.addEventListener('beforeinput', (event) => {\n if (processing) {\n const ranges = event.getTargetRanges();\n const range = ranges[0];\n\n const newRange = new Range();\n\n newRange.setStart(range.startContainer, range.startOffset);\n newRange.setEnd(range.endContainer, range.endOffset);\n\n selection.removeAllRanges();\n selection.addRange(newRange);\n\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }, true);\n\n window.addEventListener('selectstart', () => {\n selection.removeAllRanges();\n }, true);\n}\n","import cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\nimport Parchment from 'parchment';\nimport Emitter from './emitter';\nimport logger from './logger';\nimport { ShadowSelection } from './shadow-selection-polyfill';\n\nconst debug = logger('quill:selection');\n\nclass Range {\n constructor(index, length = 0) {\n this.index = index;\n this.length = length;\n }\n}\n\n\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.rootDocument = (this.root.getRootNode ? this.root.getRootNode() : document);\n this.cursor = Parchment.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, (_, mutations) => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n\n if (native == null) return;\n\n // We might need to hack the offset on Safari, when we are dealing with the first character of a row.\n // This likely happens because of a race condition between quill's update method being called before the\n // selectionchange event being fired in the selection polyfill.\n const hackOffset = (native.start.offset === 0 &&\n native.start.offset === native.end.offset &&\n this.rootDocument.getSelection() instanceof ShadowSelection &&\n mutations.some((a) => a.type === 'characterData' && a.oldValue === '')) ? 1 : 0;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n this.emitter.once(Emitter.events.SCROLL_UPDATE, () => {\n try {\n if (\n this.root.contains(native.start.node) &&\n this.root.contains(native.end.node)\n ) {\n this.setNativeRange(\n native.start.node,\n native.start.offset + hackOffset,\n native.end.node,\n native.end.offset + hackOffset\n );\n }\n this.update(Emitter.sources.SILENT);\n } catch (ignored) {\n // ignore\n }\n });\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.root.addEventListener('compositionstart', () => {\n this.composing = true;\n });\n this.root.addEventListener('compositionend', () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n\n format(format, value) {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n this.scroll.update();\n let nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || Parchment.query(format, Parchment.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n let blot = Parchment.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof Parchment.Leaf) {\n let after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index, length = 0) {\n let scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node, [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n let range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n } else {\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n }\n\n getNativeRange() {\n const selection = this.rootDocument.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n let range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange() {\n let normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n let range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus() {\n return this.rootDocument.activeElement === this.root;\n }\n\n normalizedToRange(range) {\n let positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n let indexes = positions.map((position) => {\n let [node, offset] = position;\n let blot = Parchment.find(node, true);\n let index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof Parchment.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n let end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n let start = Math.min(end, ...indexes);\n return new Range(start, end-start);\n }\n\n normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))) {\n return null;\n }\n let range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function(position) {\n let node = position.node, offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range) {\n let indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n let args = [];\n let scrollLength = this.scroll.length();\n indexes.forEach((index, i) => {\n index = Math.min(scrollLength - 1, index);\n let node, [leaf, offset] = this.scroll.leaf(index);\n [node, offset] = leaf.position(offset, i !== 0);\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n return args;\n }\n\n scrollIntoView(scrollingContainer) {\n let range = this.lastRange;\n if (range == null) return;\n let bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n let limit = this.scroll.length()-1;\n let [first, ] = this.scroll.line(Math.min(range.index, limit));\n let last = first;\n if (range.length > 0) {\n [last, ] = this.scroll.line(Math.min(range.index + range.length, limit));\n }\n if (first == null || last == null) return;\n let scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= (scrollBounds.top - bounds.top);\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += (bounds.bottom - scrollBounds.bottom);\n }\n }\n\n setNativeRange(startNode, startOffset, endNode = startNode, endOffset = startOffset, force = false) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n const selection = this.rootDocument.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n let native = (this.getNativeRange() || {}).native;\n if (native == null || force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset) {\n\n if (startNode.tagName == \"BR\") {\n startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);\n startNode = startNode.parentNode;\n }\n if (endNode.tagName == \"BR\") {\n endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);\n endNode = endNode.parentNode;\n }\n let range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n\n setRange(range, force = false, source = Emitter.sources.API) {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n let args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source = Emitter.sources.USER) {\n let oldRange = this.lastRange;\n let [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!isEqual(oldRange, this.lastRange)) {\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n let args = [Emitter.events.SELECTION_CHANGE, cloneDeep(this.lastRange), cloneDeep(oldRange), source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\n\nexport { Range, Selection as default };\n","class Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name) {\n let moduleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\n\nexport default Theme;\n","import './polyfill';\nimport merge from 'lodash.merge';\nimport Delta from 'quill-delta';\nimport Editor from './editor';\nimport Emitter from './emitter';\nimport Module from './module';\nimport Parchment from 'parchment';\nimport Selection, { Range } from './selection';\nimport logger from './logger';\nimport Theme from './theme';\n\nlet debug = logger('quill');\n\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node) {\n return node.__quill || Parchment.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(path, target, overwrite = false) {\n if (typeof path !== 'string') {\n let name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach((key) => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) &&\n target.blotName !== 'abstract') {\n Parchment.register(target);\n } else if (path.startsWith('modules') && typeof target.register === 'function') {\n target.register();\n }\n }\n }\n\n constructor(container, options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n let html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.container.__quill = this;\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new Emitter();\n this.scroll = Parchment.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n let range = this.selection.lastRange;\n let index = range && range.length === 0 ? range.index : undefined;\n modify.call(this, () => {\n return this.editor.update(null, mutations, index);\n }, source);\n });\n let contents = this.clipboard.convert(`
${html}


`);\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n addContainer(container, refNode = null) {\n if (typeof container === 'string') {\n let className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1*length);\n }\n\n disable() {\n this.enable(false);\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n let scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value, source = Emitter.sources.API) {\n return modify.call(this, () => {\n let range = this.getSelection(true);\n let change = new Delta();\n if (range == null) {\n return change;\n } else if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, { [name]: value });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, { [name]: value });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index, length = 0) {\n let bounds;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n let containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index = this.getSelection(true), length = 0) {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines(index = 0, length = Number.MAX_VALUE) {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n } else {\n return this.scroll.lines(index, length);\n }\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection(focus = false) {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getText(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value, source = Quill.sources.API) {\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats;\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n\n off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n\n on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n\n once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n\n pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n\n removeFormat(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n let length = this.getLength();\n let deleted = this.editor.deleteText(0, length);\n let applied = this.editor.applyDelta(delta);\n let lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof(lastOp.insert) === 'string' && lastOp.insert[lastOp.insert.length-1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n let ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(index, length), source);\n if (source !== Emitter.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text, source = Emitter.sources.API) {\n let delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source = Emitter.sources.USER) {\n let change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n\n updateContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n scrollingContainer: null,\n strict: true,\n theme: 'default'\n};\nQuill.events = Emitter.events;\nQuill.sources = Emitter.sources;\n// eslint-disable-next-line no-undef\nQuill.version = typeof(QUILL_VERSION) === 'undefined' ? 'dev' : QUILL_VERSION;\n\nQuill.imports = {\n 'delta' : Delta,\n 'parchment' : Parchment,\n 'core/module' : Module,\n 'core/theme' : Theme\n};\n\n\nfunction expandConfig(container, userConfig) {\n userConfig = merge({\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = Theme;\n } else {\n userConfig.theme = Quill.import(`themes/${userConfig.theme}`);\n if (userConfig.theme == null) {\n throw new Error(`Invalid theme ${userConfig.theme}. Did you register it?`);\n }\n }\n let themeConfig = merge({}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function(config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function(module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n let moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n let moduleConfig = moduleNames.reduce(function(config, name) {\n let moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(`Cannot load ${name} module. Are you sure you registered it?`);\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar &&\n userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = merge({}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(function(key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === Emitter.sources.USER) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n let oldDelta = this.editor.delta;\n let change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n let args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start, end;\n if (index instanceof Delta) {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n return index.transformPosition(pos, source !== Emitter.sources.USER);\n });\n } else {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n if (pos < index || (pos === index && source === Emitter.sources.USER)) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n }\n return new Range(start, end - start);\n}\n\n\nexport { expandConfig, overload, Quill as default };\n","import Parchment from 'parchment';\nimport Block, { BlockEmbed } from './block';\n\n\nclass Container extends Parchment.Container { }\nContainer.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Container;\n","import Parchment from 'parchment';\nimport TextBlot from './text';\n\nconst GUARD_TEXT = \"\\uFEFF\";\n\n\nclass Embed extends Parchment.Embed {\n constructor(node) {\n super(node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', false);\n [].slice.call(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node) {\n let range, textNode;\n let text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n let prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n }\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations, context) {\n mutations.forEach((mutation) => {\n if (mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard || mutation.target === this.rightGuard)) {\n let range = this.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n}\n\n\nexport default Embed;\n","import Parchment from 'parchment';\nimport Emitter from '../core/emitter';\nimport Block, { BlockEmbed } from './block';\nimport Break from './break';\nimport CodeBlock from '../formats/code';\nimport Container from './container';\n\n\nfunction isLine(blot) {\n return (blot instanceof Block || blot instanceof BlockEmbed);\n}\n\n\nclass Scroll extends Parchment.Scroll {\n constructor(domNode, config) {\n super(domNode);\n this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n this.whitelist = config.whitelist.reduce(function(whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n this.optimize();\n this.enable();\n }\n\n batchStart() {\n this.batch = true;\n }\n\n batchEnd() {\n this.batch = false;\n this.optimize();\n }\n\n deleteAt(index, length) {\n let [first, offset] = this.line(index);\n let [last, ] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n if (first instanceof CodeBlock) {\n let newlineIndex = first.newlineIndex(first.length(), true);\n if (newlineIndex > -1) {\n first = first.split(newlineIndex + 1);\n if (first === last) {\n this.optimize();\n return;\n }\n }\n } else if (last instanceof CodeBlock) {\n let newlineIndex = last.newlineIndex(0);\n if (newlineIndex > -1) {\n last.split(newlineIndex + 1);\n }\n }\n let ref = last.children.head instanceof Break ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || Parchment.query(value, Parchment.Scope.BLOCK) == null) {\n let blot = Parchment.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n let embed = Parchment.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === Parchment.Scope.INLINE_BLOT) {\n let wrapper = Parchment.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n super.insertBefore(blot, ref);\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n let getLines = (blot, index, length) => {\n let lines = [], lengthLeft = length;\n blot.children.forEachAt(index, length, function(child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof Parchment.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(mutations = [], context = {}) {\n if (this.batch === true) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n update(mutations) {\n if (this.batch === true) return;\n let source = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Scroll;\n","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nlet AlignAttribute = new Parchment.Attributor.Attribute('align', 'align', config);\nlet AlignClass = new Parchment.Attributor.Class('align', 'ql-align', config);\nlet AlignStyle = new Parchment.Attributor.Style('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n","import Parchment from 'parchment';\n\nclass ColorAttributor extends Parchment.Attributor.Style {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function(component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n}\n\nlet ColorClass = new Parchment.Attributor.Class('color', 'ql-color', {\n scope: Parchment.Scope.INLINE\n});\nlet ColorStyle = new ColorAttributor('color', 'color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n","import Parchment from 'parchment';\nimport { ColorAttributor } from './color';\n\nlet BackgroundClass = new Parchment.Attributor.Class('background', 'ql-bg', {\n scope: Parchment.Scope.INLINE\n});\nlet BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { BackgroundClass, BackgroundStyle };\n","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nlet DirectionAttribute = new Parchment.Attributor.Attribute('direction', 'dir', config);\nlet DirectionClass = new Parchment.Attributor.Class('direction', 'ql-direction', config);\nlet DirectionStyle = new Parchment.Attributor.Style('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nlet FontClass = new Parchment.Attributor.Class('font', 'ql-font', config);\n\nclass FontStyleAttributor extends Parchment.Attributor.Style {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nlet FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n","import Parchment from 'parchment';\n\nlet SizeClass = new Parchment.Attributor.Class('size', 'ql-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nlet SizeStyle = new Parchment.Attributor.Style('size', 'font-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexport { SizeClass, SizeStyle };\n","import merge from 'lodash.merge';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nimport { AlignAttribute, AlignStyle } from '../formats/align';\nimport { BackgroundStyle } from '../formats/background';\nimport CodeBlock from '../formats/code';\nimport { ColorStyle } from '../formats/color';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction';\nimport { FontStyle } from '../formats/font';\nimport { SizeStyle } from '../formats/size';\n\nlet debug = logger('quill:clipboard');\n\n\nconst DOM_KEY = '__ql-matcher';\n\nconst CLIPBOARD_CONFIG = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['b', matchAlias.bind(matchAlias, 'bold')],\n ['i', matchAlias.bind(matchAlias, 'italic')],\n ['style', matchIgnore]\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [\n AlignAttribute,\n DirectionAttribute\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\n\nclass Clipboard extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('paste', this.onPaste.bind(this));\n this.container = this.quill.addContainer('ql-clipboard');\n this.container.setAttribute('contenteditable', true);\n this.container.setAttribute('tabindex', -1);\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach(([selector, matcher]) => {\n this.addMatcher(selector, matcher);\n });\n }\n\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(html) {\n if (typeof html === 'string') {\n this.container.innerHTML = html.replace(/\\>\\r?\\n +\\<'); // Remove spaces between tags\n return this.convert();\n }\n const formats = this.quill.getFormat(this.quill.selection.savedRange.index);\n if (formats[CodeBlock.blotName]) {\n const text = this.container.innerText;\n this.container.innerHTML = '';\n return new Delta().insert(text, { [CodeBlock.blotName]: formats[CodeBlock.blotName] });\n }\n let [elementMatchers, textMatchers] = this.prepareMatching();\n let delta = traverse(this.container, elementMatchers, textMatchers);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n\n dangerouslyPasteHTML(index, html, source = Quill.sources.API) {\n if (typeof index === 'string') {\n this.quill.setContents(this.convert(index), html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n let paste = this.convert(html);\n this.quill.updateContents(new Delta().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onPaste(e) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n let range = this.quill.getSelection();\n let delta = new Delta().retain(range.index);\n let scrollTop = this.quill.scrollingContainer.scrollTop;\n this.container.focus();\n this.quill.selection.update(Quill.sources.SILENT);\n setTimeout(() => {\n delta = delta.concat(this.convert()).delete(range.length);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT);\n this.quill.scrollingContainer.scrollTop = scrollTop;\n this.quill.focus();\n }, 1);\n }\n\n prepareMatching() {\n let elementMatchers = [], textMatchers = [];\n this.matchers.forEach((pair) => {\n let [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(this.container.querySelectorAll(selector), (node) => {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\nClipboard.DEFAULTS = {\n matchers: [],\n matchVisual: false\n};\n\n\nfunction applyFormat(delta, format, value) {\n if (typeof format === 'object') {\n return Object.keys(format).reduce(function(delta, key) {\n return applyFormat(delta, key, format[key]);\n }, delta);\n } else {\n return delta.reduce(function(delta, op) {\n if (op.attributes && op.attributes[format]) {\n return delta.push(op);\n } else {\n return delta.insert(op.insert, merge({}, {[format]: value}, op.attributes));\n }\n }, new Delta());\n }\n}\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n const DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n let endText = \"\";\n for (let i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n let op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1*text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n let style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction traverse(node, elementMatchers, textMatchers) { // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function(delta, matcher) {\n return matcher(node, delta);\n }, new Delta());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], (delta, childNode) => {\n let childrenDelta = traverse(childNode, elementMatchers, textMatchers);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n } else {\n return new Delta();\n }\n}\n\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta) {\n let attributes = Parchment.Attributor.Attribute.keys(node);\n let classes = Parchment.Attributor.Class.keys(node);\n let styles = Parchment.Attributor.Style.keys(node);\n let formats = {};\n attributes.concat(classes).concat(styles).forEach((name) => {\n let attr = Parchment.query(name, Parchment.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name]\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n let match = Parchment.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof Parchment.Embed) {\n let embed = {};\n let value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new Delta().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n delta = applyFormat(delta, match.blotName, match.formats(node));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node, delta) {\n let match = Parchment.query(node);\n if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n let indent = -1, parent = node.parentNode;\n while (!parent.classList.contains('ql-clipboard')) {\n if ((Parchment.query(parent) || {}).blotName === 'list') {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.compose(new Delta().retain(delta.length() - 1).retain(1, { indent: indent}));\n}\n\nfunction matchNewline(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node) || (delta.length() > 0 && node.nextSibling && isLine(node.nextSibling))) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n let formats = {};\n let style = node.style || {};\n if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') ||\n parseInt(computeStyle(node).fontWeight) >= 700)) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) { // Could be 0.5in\n delta = new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n let text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) {\n return delta;\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n let replacer = function(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if ((node.previousSibling == null && isLine(node.parentNode)) ||\n (node.previousSibling != null && isLine(node.previousSibling))) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if ((node.nextSibling == null && isLine(node.parentNode)) ||\n (node.nextSibling != null && isLine(node.nextSibling))) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\n\nexport { Clipboard as default, matchAttributor, matchBlot, matchNewline, matchText };\n","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass History extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.clear();\n this.quill.on(Quill.events.EDITOR_CHANGE, (eventName, delta, oldDelta, source) => {\n if (eventName !== Quill.events.TEXT_CHANGE || this.ignoreChange) return;\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(delta, oldDelta);\n } else {\n this.transform(delta);\n }\n });\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, this.undo.bind(this));\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, this.redo.bind(this));\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, this.redo.bind(this));\n }\n }\n\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n let delta = this.stack[source].pop();\n this.stack[dest].push(delta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], Quill.sources.USER);\n this.ignoreChange = false;\n let index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = this.quill.getContents().diff(oldDelta);\n let timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n let delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta) {\n this.stack.undo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n let lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function(attr) {\n return Parchment.query(attr, Parchment.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n let deleteLength = delta.reduce(function(length, op) {\n length += (op.delete || 0);\n return length;\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\n\nexport { History as default, getLastChangeIndex };\n","import cloneDeep from 'lodash.clonedeep';\nimport isEqual from 'lodash.isequal';\nimport merge from 'lodash.merge';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\n\nclass Keyboard extends Module {\n static match(evt, binding) {\n binding = normalize(binding);\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function(key) {\n return (!!binding[key] !== evt[key] && binding[key] !== null);\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n Object.keys(this.options.bindings).forEach((name) => {\n if (name === 'list autofill' &&\n quill.scroll.whitelist != null &&\n !quill.scroll.whitelist['list']) {\n return;\n }\n if (this.options.bindings[name]) {\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);\n } else {\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);\n }\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null },\n { collapsed: true, offset: 0 },\n handleBackspace);\n this.listen();\n }\n\n addBinding(key, context = {}, handler = {}) {\n let binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = merge(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented) return;\n let which = evt.which || evt.keyCode;\n let bindings = (this.bindings[which] || []).filter(function(binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n let range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n let [line, offset] = this.quill.getLine(range.index);\n let [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n let [leafEnd, offsetEnd] = range.length === 0 ? [leafStart, offsetStart] : this.quill.getLeaf(range.index + range.length);\n let prefixText = leafStart instanceof Parchment.Text ? leafStart.value().slice(0, offsetStart) : '';\n let suffixText = leafEnd instanceof Parchment.Text ? leafEnd.value().slice(offsetEnd) : '';\n let curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n let prevented = bindings.some((binding) => {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function(name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function(name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return isEqual(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(this, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n}\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold' : makeFormatHandler('bold'),\n 'italic' : makeFormatHandler('italic'),\n 'underline' : makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler: function(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function(range) {\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function(range, context) {\n this.quill.format('list', false, Quill.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, Quill.sources.USER);\n }\n }\n },\n 'checklist enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: { list: 'checked' },\n handler: function(range) {\n let [line, offset] = this.quill.getLine(range.index);\n let formats = merge({}, line.formats(), { list: 'checked' });\n let delta = new Delta().retain(range.index)\n .insert('\\n', formats)\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function(range, context) {\n let [line, offset] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index)\n .insert('\\n', context.format)\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler: function(range, context) {\n let length = context.prefix.length;\n let [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]': case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-': case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index - offset)\n .delete(length + 1)\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n }\n },\n 'code exit': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['code-block'],\n prefix: /\\n\\n$/,\n suffix: /^\\s+$/,\n handler: function(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n }\n },\n 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),\n 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),\n 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),\n 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)\n }\n};\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n const where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler: function(range) {\n let index = range.index;\n if (key === Keyboard.keys.RIGHT) {\n index += (range.length + 1);\n }\n const [leaf, ] = this.quill.getLeaf(index);\n if (!(leaf instanceof Parchment.Embed)) return true;\n if (key === Keyboard.keys.LEFT) {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else {\n if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, Quill.sources.USER);\n }\n }\n return false;\n }\n };\n}\n\n\nfunction handleBackspace(range, context) {\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let [line, ] = this.quill.getLine(range.index);\n let formats = {};\n if (context.offset === 0) {\n let [prev, ] = this.quill.getLine(range.index - 1);\n if (prev != null && prev.length() > 1) {\n let curFormats = line.formats();\n let prevFormats = this.quill.getFormat(range.index-1, 1);\n formats = AttributeMap.diff(curFormats, prevFormats) || {};\n }\n }\n // Check for astral symbols\n let length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n this.quill.deleteText(range.index-length, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index-length, length, formats, Quill.sources.USER);\n }\n this.quill.focus();\n}\n\nfunction handleDelete(range, context) {\n // Check for astral symbols\n let length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {}, nextLength = 0;\n let [line, ] = this.quill.getLine(range.index);\n if (context.offset >= line.length() - 1) {\n let [next, ] = this.quill.getLine(range.index + 1);\n if (next) {\n let curFormats = line.formats();\n let nextFormats = this.quill.getFormat(range.index, 1);\n formats = AttributeMap.diff(curFormats, nextFormats) || {};\n nextLength = next.length();\n }\n }\n this.quill.deleteText(range.index, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index + nextLength - 1, length, formats, Quill.sources.USER);\n }\n}\n\nfunction handleDeleteRange(range) {\n let lines = this.quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n let firstFormats = lines[0].formats();\n let lastFormats = lines[lines.length - 1].formats();\n formats = AttributeMap.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.quill.focus();\n}\n\nfunction handleEnter(range, context) {\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n let lineFormats = Object.keys(context.format).reduce(function(lineFormats, format) {\n if (Parchment.query(format, Parchment.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, Quill.sources.USER);\n // Earlier scroll.deleteAt might have messed up our selection,\n // so insertText's built in selection preservation is not reliable\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n Object.keys(context.format).forEach((name) => {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n this.quill.format(name, context.format[name], Quill.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: {'code-block': true },\n handler: function(range) {\n let CodeBlock = Parchment.query('code-block');\n let index = range.index, length = range.length;\n let [block, offset] = this.quill.scroll.descendant(CodeBlock, index);\n if (block == null) return;\n let scrollIndex = this.quill.getIndex(block);\n let start = block.newlineIndex(offset, true) + 1;\n let end = block.newlineIndex(scrollIndex + offset + length);\n let lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach((line, i) => {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if (typeof binding === 'object') {\n binding = cloneDeep(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n\nexport { Keyboard as default, SHORTKEY };\n","import Parchment from 'parchment';\nimport Quill from './core/quill';\n\nimport Block, { BlockEmbed } from './blots/block';\nimport Break from './blots/break';\nimport Container from './blots/container';\nimport Cursor from './blots/cursor';\nimport Embed from './blots/embed';\nimport Inline from './blots/inline';\nimport Scroll from './blots/scroll';\nimport TextBlot from './blots/text';\n\nimport Clipboard from './modules/clipboard';\nimport History from './modules/history';\nimport Keyboard from './modules/keyboard';\n\nQuill.register({\n 'blots/block' : Block,\n 'blots/block/embed' : BlockEmbed,\n 'blots/break' : Break,\n 'blots/container' : Container,\n 'blots/cursor' : Cursor,\n 'blots/embed' : Embed,\n 'blots/inline' : Inline,\n 'blots/scroll' : Scroll,\n 'blots/text' : TextBlot,\n\n 'modules/clipboard' : Clipboard,\n 'modules/history' : History,\n 'modules/keyboard' : Keyboard\n});\n\nParchment.register(Block, Break, Cursor, Inline, Scroll, TextBlot);\n\n\nexport default Quill;\n","import Parchment from 'parchment';\n\nclass IdentAttributor extends Parchment.Attributor.Class {\n add(node, value) {\n if (value === '+1' || value === '-1') {\n let indent = this.value(node) || 0;\n value = (value === '+1' ? (indent + 1) : (indent - 1));\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return super.add(node, value);\n }\n }\n\n canAdd(node, value) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value));\n }\n\n value(node) {\n return parseInt(super.value(node)) || undefined; // Don't return NaN\n }\n}\n\nlet IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: Parchment.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexport { IndentClass };\n","import Block from '../blots/block';\n\n\nclass Blockquote extends Block {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\n\nexport default Blockquote;\n","import Block from '../blots/block';\n\n\nclass Header extends Block {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n\nexport default Header;\n","import Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Container from '../blots/container';\n\n\nclass ListItem extends Block {\n static formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : super.formats(domNode);\n }\n\n format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(Parchment.create(this.statics.scope));\n } else {\n super.format(name, value);\n }\n }\n\n remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n super.remove();\n }\n }\n\n replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return super.replaceWith(name, value);\n }\n }\n}\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\n\nclass List extends Container {\n static create(value) {\n let tagName = value === 'ordered' ? 'OL' : 'UL';\n let node = super.create(tagName);\n if (value === 'checked' || value === 'unchecked') {\n node.setAttribute('data-checked', value === 'checked');\n }\n return node;\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') {\n if (domNode.hasAttribute('data-checked')) {\n return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';\n } else {\n return 'bullet';\n }\n }\n return undefined;\n }\n\n constructor(domNode) {\n super(domNode);\n const listEventHandler = (e) => {\n if (e.target.parentNode !== domNode) return;\n let format = this.statics.formats(domNode);\n let blot = Parchment.find(e.target);\n if (format === 'checked') {\n blot.format('list', 'unchecked');\n } else if(format === 'unchecked') {\n blot.format('list', 'checked');\n }\n }\n\n domNode.addEventListener('touchstart', listEventHandler);\n domNode.addEventListener('mousedown', listEventHandler);\n }\n\n format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n\n formats() {\n // We don't inherit from FormatBlot\n return { [this.statics.blotName]: this.statics.formats(this.domNode) };\n }\n\n insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n super.insertBefore(blot, ref);\n } else {\n let index = ref == null ? this.length() : ref.offset(this);\n let after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n next.domNode.tagName === this.domNode.tagName &&\n next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n let item = Parchment.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n super.replace(target);\n }\n}\nList.blotName = 'list';\nList.scope = Parchment.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\n\nexport { ListItem, List as default };\n","import Inline from '../blots/inline';\n\nclass Bold extends Inline {\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexport default Bold;\n","import Bold from './bold';\n\nclass Italic extends Bold { }\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexport default Italic;\n","import Inline from '../blots/inline';\n\n\nclass Link extends Inline {\n static create(value) {\n let node = super.create(value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name, value) {\n if (name !== this.statics.blotName || !value) return super.format(name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\n\nfunction sanitize(url, protocols) {\n let anchor = document.createElement('a');\n anchor.href = url;\n let protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\n\nexport { Link as default, sanitize };\n","import Inline from '../blots/inline';\n\nclass Script extends Inline {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return super.create(value);\n }\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexport default Script;\n","import Inline from '../blots/inline';\n\nclass Strike extends Inline { }\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexport default Strike;\n","import Inline from '../blots/inline';\n\nclass Underline extends Inline { }\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexport default Underline;\n","import Parchment from 'parchment';\nimport { sanitize } from '../formats/link';\n\nconst ATTRIBUTES = [\n 'alt',\n 'height',\n 'width'\n];\n\n\nclass Image extends Parchment.Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\n\nexport default Image;\n","import { BlockEmbed } from '../blots/block';\nimport Link from '../formats/link';\n\nconst ATTRIBUTES = [\n 'height',\n 'width'\n];\n\n\nclass Video extends BlockEmbed {\n static create(value) {\n let node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static sanitize(url) {\n return Link.sanitize(url);\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\n\nexport default Video;\n","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nconst supportsRootNode = ('getRootNode' in document);\nlet debug = logger('quill:toolbar');\n\nclass Toolbar extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n let container = document.createElement('div');\n addControls(container, this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n const rootDocument = (supportsRootNode ? quill.container.getRootNode() : document);\n this.container = rootDocument.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n return debug.error('Container required for toolbar', this.options);\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n Object.keys(this.options.handlers).forEach((format) => {\n this.addHandler(format, this.options.handlers[format]);\n });\n [].forEach.call(this.container.querySelectorAll('button, select'), (input) => {\n this.attach(input);\n });\n this.quill.on(Quill.events.EDITOR_CHANGE, (type, range) => {\n if (type === Quill.events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n let [range, ] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n\n attach(input) {\n let format = [].find.call(input.classList, (className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (Parchment.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n let eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n let selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n let [range, ] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (Parchment.query(format).prototype instanceof Parchment.Embed) {\n value = prompt(`Enter ${format}`);\n if (!value) return;\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ [format]: value })\n , Quill.sources.USER);\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n\n update(range) {\n let formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function(pair) {\n let [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n let isActive = formats[format] === input.getAttribute('value') ||\n (formats[format] != null && formats[format].toString() === input.getAttribute('value')) ||\n (formats[format] == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\n\nfunction addButton(container, format, value) {\n let input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function(controls) {\n let group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function(control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n let format = Object.keys(control)[0];\n let value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n let input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function() {\n let range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n let formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (Parchment.query(name, Parchment.Scope.INLINE) != null) {\n this.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction: function(value) {\n let align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n let indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n let modifier = (value === '+1') ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link: function(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n }\n }\n}\n\n\nexport { Toolbar as default, addControls };\n","import Quill from './core';\n\nimport { AlignClass, AlignStyle } from './formats/align';\nimport { DirectionAttribute, DirectionClass, DirectionStyle } from './formats/direction';\nimport { IndentClass as Indent } from './formats/indent';\n\nimport Blockquote from './formats/blockquote';\nimport Header from './formats/header';\nimport List, { ListItem } from './formats/list';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background';\nimport { ColorClass, ColorStyle } from './formats/color';\nimport { FontClass, FontStyle } from './formats/font';\nimport { SizeClass, SizeStyle } from './formats/size';\n\nimport Bold from './formats/bold';\nimport Italic from './formats/italic';\nimport Link from './formats/link';\nimport Script from './formats/script';\nimport Strike from './formats/strike';\nimport Underline from './formats/underline';\n\nimport Image from './formats/image';\nimport Video from './formats/video';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code';\n\n// import Formula from './modules/formula';\n// import Syntax from './modules/syntax';\nimport Toolbar from './modules/toolbar';\n\n// import Icons from './ui/icons';\n// import Picker from './ui/picker';\n// import ColorPicker from './ui/color-picker';\n// import IconPicker from './ui/icon-picker';\n// import Tooltip from './ui/tooltip';\n\n// import BubbleTheme from './themes/bubble';\n// import SnowTheme from './themes/snow';\n\n\nQuill.register({\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle\n}, true);\n\n\nQuill.register({\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'formats/list/item': ListItem,\n\n // 'modules/formula': Formula,\n // 'modules/syntax': Syntax,\n 'modules/toolbar': Toolbar\n\n // 'themes/bubble': BubbleTheme,\n // 'themes/snow': SnowTheme,\n\n // 'ui/icons': Icons,\n // 'ui/picker': Picker,\n // 'ui/icon-picker': IconPicker,\n // 'ui/color-picker': ColorPicker,\n // 'ui/tooltip': Tooltip\n}, true);\n\n\nexport default Quill;\n"],"names":["root","factory","exports","module","define","amd","self","elem","document","createElement","classList","toggle","contains","_toggle","DOMTokenList","prototype","token","force","arguments","length","this","call","String","startsWith","searchString","position","substr","endsWith","subjectString","toString","isFinite","Math","floor","lastIndex","indexOf","Array","find","Object","defineProperty","value","predicate","TypeError","list","thisArg","i","addEventListener","execCommand","has","hasOwnProperty","prefix","Events","EE","fn","context","once","EventEmitter","_events","_eventsCount","create","__proto__","eventNames","events","name","names","push","slice","getOwnPropertySymbols","concat","listeners","event","exists","evt","available","l","ee","emit","a1","a2","a3","a4","a5","args","len","removeListener","undefined","apply","j","on","listener","removeAllListeners","off","addListener","setMaxListeners","prefixed","DIFF_DELETE","DIFF_INSERT","DIFF_EQUAL","diff_main","text1","text2","cursor_pos","_fix_unicode","editdiff","oldText","newText","oldRange","index","newRange","oldLength","newLength","oldCursor","oldBefore","oldAfter","maybeNewCursor","newCursor","newBefore","newAfter","prefixLength","min","oldPrefix","newPrefix","make_edit_splice","cursor","suffixLength","oldSuffix","newSuffix","find_cursor_edit_diff","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","longtext","shorttext","hm","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","best_common","text1_a","text1_b","text2_a","text2_b","hm1","ceil","hm2","mid_common","diff_halfMatch_","diffs_a","diffs_b","text1_length","text2_length","max_d","v_offset","v_length","v1","v2","x","delta","front","k1start","k1end","k2start","k2end","d","k1","k1_offset","y1","x1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","diff_bisect_","diff_compute_","unshift","diff_cleanupMerge","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","is_surrogate_pair_start","charCodeAt","pointerend","is_surrogate_pair_end","fix_unicode","pointer","count_delete","count_insert","text_delete","text_insert","splice","previous_equality","ends_with_pair_start","stray","k","starts_with_pair_end","n","pop","changes","charCode","str","before","oldMiddle","newMiddle","after","tuples","ret","remove_empty_tuples","diff","INSERT","DELETE","EQUAL","HASH_UNDEFINED","MAX_SAFE_INTEGER","argsTag","boolTag","dateTag","funcTag","genTag","mapTag","numberTag","objectTag","promiseTag","regexpTag","setTag","stringTag","symbolTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reFlags","reIsHostCtor","reIsUint","cloneableTags","freeGlobal","g","freeSelf","Function","freeExports","nodeType","freeModule","moduleExports","addMapEntry","map","pair","set","addSetEntry","add","arrayReduce","array","iteratee","accumulator","initAccum","isHostObject","result","e","mapToArray","size","forEach","key","overArg","func","transform","arg","setToArray","uid","arrayProto","funcProto","objectProto","coreJsData","maskSrcKey","exec","keys","IE_PROTO","funcToString","objectToString","reIsNative","RegExp","replace","Buffer","Symbol","Uint8Array","getPrototype","getPrototypeOf","objectCreate","propertyIsEnumerable","nativeGetSymbols","nativeIsBuffer","isBuffer","nativeKeys","DataView","getNative","Map","Promise","Set","WeakMap","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","valueOf","Hash","entries","clear","entry","ListCache","MapCache","Stack","__data__","arrayLikeKeys","inherited","isArray","isObjectLike","isArrayLike","isArrayLikeObject","isArguments","baseTimes","skipIndexes","isIndex","assignValue","object","objValue","eq","assocIndexOf","baseClone","isDeep","isFull","customizer","stack","isObject","isArr","constructor","input","initCloneArray","source","copyArray","tag","getTag","isFunc","buffer","copy","cloneBuffer","isPrototype","proto","initCloneObject","copyObject","getSymbols","copySymbols","baseAssign","cloneFunc","Ctor","cloneArrayBuffer","dataView","byteOffset","byteLength","cloneDataView","typedArray","cloneTypedArray","cloneMap","regexp","cloneRegExp","cloneSet","symbol","initCloneByTag","stacked","get","props","keysFunc","symbolsFunc","values","offset","arrayPush","baseGetAllKeys","getAllKeys","arrayEach","subValue","baseIsNative","isFunction","test","arrayBuffer","newValue","getMapData","type","data","getValue","cache","pairs","LARGE_ARRAY_SIZE","other","ArrayBuffer","resolve","ctorString","isLength","baseKeys","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","arrayTag","asyncTag","errorTag","nullTag","proxyTag","undefinedTag","typedArrayTags","freeProcess","process","nodeUtil","binding","nodeIsTypedArray","isTypedArray","arraySome","nativeObjectToString","symToStringTag","toStringTag","SetCache","isArg","isBuff","isType","baseGetTag","isOwn","unmasked","getRawTag","baseIsArguments","baseIsEqual","bitmask","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","message","convert","isPartial","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","objLength","othProps","othLength","skipCtor","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","isMasked","arrLength","seen","arrValue","othIndex","resIndex","arrayFilter","baseUnary","types","require","objectCtorString","allocUnsafe","nativeMax","max","nativeNow","Date","now","baseCreate","assignMergeValue","baseAssignValue","fromRight","baseFor","iterable","baseKeysIn","nativeKeysIn","isProto","baseMerge","srcIndex","srcValue","mergeFunc","safeGet","isCommon","isTyped","isPlainObject","isNew","keysIn","toPlainObject","baseMergeDeep","baseRest","start","setToString","otherArgs","overRest","identity","baseSetToString","string","count","lastCalled","stamp","remaining","shortOut","assigner","merge","sources","guard","isIterateeCall","property","extendStatics","__extends","setPrototypeOf","b","p","__","ParchmentError","_super","_this","Error","Scope","attributes","classes","tags","query","scope","match","ANY","Text","Node","TEXT_NODE","LEVEL","BLOCK","INLINE","HTMLElement","getAttribute","split","tagName","TYPE","DATA_KEY","BlotClass","node","bubble","blot","parentNode","register","Definitions","_i","Definition","blotName","attrName","keyName","className","toUpperCase","Registry","Attributor","options","attributeBit","ATTRIBUTE","whitelist","item","canAdd","setAttribute","BLOT","remove","removeAttribute","default","linked_list_1","shadow_1","ContainerBlot","domNode","build","appendChild","insertBefore","attach","children","child","childNodes","reverse","makeBlot","head","err","deleteAt","forEachAt","descendant","criteria","_a","descendants","Number","MAX_VALUE","lengthLeft","detach","formatAt","insertAt","def","childBlot","refBlot","statics","allowedChildren","some","insertInto","reduce","memo","moveChildren","targetParent","refNode","optimize","defaultChild","path","inclusive","removeChild","target","next","clone","parent","unwrap","update","mutations","addedNodes","removedNodes","mutation","body","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","filter","sort","a","DOCUMENT_POSITION_FOLLOWING","nextSibling","replaceChild","attributor_1","store_1","container_1","FormatBlot","formats","toLowerCase","format","attribute","replaceWith","replacement","wrap","wrapper","move","LeafBlot","INLINE_BLOT","ShadowBlot","enumerable","configurable","parseInt","scroll","cloneNode","isolate","parent_1","ref","parentBlot","refDomNode","class_1","style_1","AttributorStore","styles","attr","ClassAttributor","join","camelize","parts","rest","part","StyleAttributor","trim","style","format_1","leaf_1","scroll_1","inline_1","block_1","embed_1","text_1","Parchment","Container","Format","Leaf","Embed","Scroll","Block","Inline","Attribute","Class","Style","Store","LinkedList","tail","append","nodes","cur","iterator","prev","curNode","length_1","callback","startNode","curIndex","curLength","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","ScrollBlot","observer","MutationObserver","observe","disconnect","records","takeRecords","mark","markParent","previousSibling","grandChild","BLOCK_BLOT","InlineBlot","obj1","obj2","prop","isEqual","BlockBlot","navigator","userAgent","EmbedBlot","TextBlot","text","createTextNode","splitText","AttributeMap","compose","keepNull","attrs","invert","base","baseInverted","priority","NULL_CHARACTER","fromCharCode","ops","insert","newOp","delete","retain","lastOp","chop","partition","passed","failed","op","initialValue","changeLength","end","iter","hasNext","nextOp","Delta","thisIter","otherIter","firstOther","peek","firstLeft","peekType","peekLength","thisOp","otherOp","strings","retDelta","diffResult","component","opLength","eachLine","newline","line","inverted","baseIndex","baseOp","transformPosition","nextType","Op","Infinity","retOp","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","id","loaded","__webpack_modules__","getter","__esModule","definition","o","globalThis","window","obj","nmd","paths","Break","super","compare","selfIndex","order","otherIndex","BlockEmbed","BLOCK_ATTRIBUTE","block","leaf","bubbleFormats","lines","shift","Code","CodeBlock","textContent","frag","nextNewline","newlineIndex","prevNewline","isolateLength","searchIndex","lastIndexOf","querySelectorAll","TAB","Cursor","selection","textNode","CONTENTS","_length","restore","composing","restoreText","range","getNativeRange","lastChild","startOffset","endNode","endOffset","ASCII","combineFormats","combined","merged","getDelta","applyDelta","consumeNextNewline","scrollLength","batchStart","cloneDeep","image","bullet","normalizeDelta","batchEnd","deleteText","formatLine","lengthRemaining","lineLength","codeIndex","codeLength","formatText","getContents","getFormat","leaves","lineFormats","leafFormats","blots","getText","insertEmbed","embed","insertText","isBlank","removeFormat","suffix","change","cursorIndex","oldDelta","textBlot","oldValue","CursorBlot","levels","level","debug","method","_len","_key","console","namespace","ns","logger","bind","newLevel","EMITTERS","supportsRootNode","eventName","em","handleDOM","Emitter","error","log","connect","_len2","_key2","composedPath","_ref","handler","containsNode","getRootNode","host","listenDOM","EDITOR_CHANGE","SCROLL_BEFORE_UPDATE","SCROLL_OPTIMIZE","SCROLL_UPDATE","SELECTION_CHANGE","TEXT_CHANGE","API","SILENT","USER","Module","quill","DEFAULTS","SUPPORTS_SHADOW_SELECTION","ShadowRoot","getSelection","SUPPORTS_BEFORE_INPUT","InputEvent","getTargetRanges","IS_FIREFOX","IS_MSIE","IS_EDGE","processing","ShadowSelection","_ranges","rangeCount","getRangeAt","addRange","windowSel","removeAllRanges","setBaseAndExtent","startContainer","endContainer","active","activeElement","shadowRoot","getActiveElement","Range","setStart","setEnd","preventDefault","stopImmediatePropagation","Selection","emitter","mouseDown","rootDocument","lastRange","savedRange","handleComposition","handleDragging","setTimeout","_","hasFocus","native","hackOffset","setNativeRange","ignored","focus","setRange","nativeRange","collapsed","getBounds","createRange","getBoundingClientRect","rect","side","bottom","top","height","left","right","width","normalizeNative","info","getRange","normalized","normalizedToRange","positions","indexes","rangeToNative","scrollIntoView","scrollingContainer","bounds","limit","first","last","scrollBounds","scrollTop","blur","Theme","modules","init","addModule","moduleClass","import","themes","Quill","__quill","imports","overwrite","warn","container","userConfig","clipboard","keyboard","history","theme","themeConfig","config","moduleConfig","toolbar","querySelector","expandConfig","html","innerHTML","addContainer","editor","Editor","modify","contents","setContents","placeholder","readOnly","disable","overload","enable","enabled","setSelection","containerBounds","getLength","getIndex","getLeaf","getLine","getLines","getModule","isEnabled","pasteHTML","dangerouslyPasteHTML","deleted","applied","setText","updateContents","modifier","strict","shiftRange","pos","version","GUARD_TEXT","contentNode","childNode","leftGuard","rightGuard","prevLength","isLine","batch","AlignAttribute","AlignClass","AlignStyle","ColorAttributor","ColorClass","ColorStyle","BackgroundClass","BackgroundStyle","DirectionAttribute","DirectionClass","DirectionStyle","FontClass","FontStyleAttributor","FontStyle","SizeClass","SizeStyle","DOM_KEY","CLIPBOARD_CONFIG","computeStyle","whiteSpace","replacer","collapse","matchNewline","deltaEndsWith","ELEMENT_NODE","applyFormat","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","fontStyle","italic","fontWeight","bold","parseFloat","textIndent","indent","matchAlias","Clipboard","onPaste","matchers","selector","matcher","addMatcher","innerText","elementMatchers","textMatchers","prepareMatching","traverse","paste","defaultPrevented","getComputedStyle","endText","display","childrenDelta","matchVisual","History","lastRecorded","ignoreChange","userOnly","record","addBinding","shortKey","undo","shiftKey","redo","platform","dest","deleteLength","changeIndex","endsWithNewlineChange","getLastChangeIndex","cutoff","changeDelta","undoDelta","timestamp","delay","maxStack","SHORTKEY","Keyboard","normalize","which","keyCode","bindings","ENTER","handleEnter","metaKey","ctrlKey","altKey","BACKSPACE","handleBackspace","handleDelete","handleDeleteRange","listen","leafStart","offsetStart","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","every","makeEmbedArrowHandler","where","LEFT","RIGHT","curFormats","prevFormats","nextLength","nextFormats","firstFormats","lastFormats","makeCodeBlockHandler","scrollIndex","makeFormatHandler","ESCAPE","UP","DOWN","header","IdentAttributor","IndentClass","Blockquote","Header","ListItem","List","hasAttribute","listEventHandler","Bold","Italic","Link","sanitize","url","PROTOCOL_WHITELIST","SANITIZED_URL","protocols","anchor","href","protocol","Script","Strike","Underline","ATTRIBUTES","Image","Video","Toolbar","groups","controls","group","control","addButton","option","addSelect","addControls","handlers","addHandler","selectedIndex","selected","prompt","isActive","clean","direction","align","link","Indent","InlineCode"],"sourceRoot":""}