!function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[a]={exports:{}};e[a][0].call(u.exports,function(t){var r=e[a][1][t];return i(r?r:t)},u,u.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a=0;t--)this.unbindQuill(this.instances[t].editor);l(Object.getPrototypeOf(r.prototype),"_destroy",this).call(this)}},{key:"toString",value:function(){return this._content.map(function(t){return"string"==typeof t.val?t.val:void 0}).join("")}},{key:"toOTOps",value:function(){function t(){var t={};for(var e in r.attributes)t[e]=r.attributes[e];r={insert:[],attributes:t}}for(var e=[],r={insert:[],attributes:{}},n=0;n0&&(r.insert=r.insert.join(""),e.push(r),t()),null===i[1]?delete r.attributes[i[0]]:r.attributes[i[0]]=i[1]):r.insert.push(i)}return r.insert.length>0&&(r.insert=r.insert.join(""),e.push(r)),e}},{key:"insert",value:function(t,e){for(var n=0,i={},o=0;o=e)){var a,s,c,u;for(a=0;t>n&&an&&s=a;u--)c=this._content[u].val,l(Object.getPrototypeOf(r.prototype),"delete",this).call(this,u,1);else{"string"==typeof c&&s--;var f={};for(u=s;u>=a;u--)c=this._content[u].val,c.constructor===Array?void 0===f[c[0]]?(c[1]===i[c[0]]&&l(Object.getPrototypeOf(r.prototype),"delete",this).call(this,u,1),f[c[0]]=c[1]):l(Object.getPrototypeOf(r.prototype),"delete",this).call(this,u,1):"string"==typeof c&&l(Object.getPrototypeOf(r.prototype),"delete",this).call(this,u,1)}}}},{key:"select",value:function(t,e,n,i){if(null==t||null==e||null==n||void 0===i)throw new Error("You must define four parameters");for(var o,a,s=[n,null],c=0,u=0;u=0;v--){var y=h[v];l(Object.getPrototypeOf(r.prototype),"delete",this).call(this,y,1),u>y&&u--,o>y&&o--}if(s[1]!==i&&u=0&&(g=this._content[v].val,g.constructor===Array);v--)g[0]===n&&l(Object.getPrototypeOf(r.prototype),"delete",this).call(this,v,1)}},{key:"bind",value:function(){this.bindQuill.apply(this,arguments)}},{key:"unbindQuill",value:function(t){var e=this.instances.findIndex(function(e){return e.editor===t});if(e>=0){var r=this.instances[e];this.unobserve(r.yCallback),r.editor.off("text-change",r.quillCallback),this.instances.splice(e,1)}}},{key:"bindQuill",value:function(t){function e(t){if(o){o=!1;try{t()}catch(e){throw o=!0,new Error(e)}o=!0}}function r(r){e(function(){for(var e,n=0,o=0;oi.length){var c=t.getText(i.length);t.insertText(i.length,c);for(e in a.attributes)t.formatText(i.length+c.length,i.length+2*c.length,e,null);i.insert(i.length,c)}for(e in a.attributes)i.select(n,n+a.retain,e,a.attributes[e]),t.formatText(n,n+a.retain,e,a.attributes[e]);n=l}}})}function n(r){e(function(){for(var e,n,o=0;o=0;c--)e=i._content[c].val,"string"==typeof e?s++:e.constructor===Array&&"undefined"==typeof l[e[0]]&&(l[e[0]]=e[1]);t.insertText(s,a.value,l)}else if(a.value.constructor===Array){n=null;for(var u=a.value,f=0,h=a.index-1;h>=0;h--)if(e=i._content[h].val,e.constructor===Array){if(u[0]===e[0]){n=e[1];break}}else"string"==typeof e&&f++;for(;h>=0;h--)e=i._content[h].val,"string"==typeof e&&f++;if(u[1]===n)return;for(var p=f,v=a.index+1;v=0;b--)if(e=i._content[b].val,e.constructor===Array){if(e[0]===a.value[0]){n=e[1];break}}else"string"==typeof e&&O++;for(;b>=0;b--)e=i._content[b].val,"string"==typeof e&&O++;var _=O;for(b=a.index;b