Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quill-better-table

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quill-better-table - npm Package Compare versions

Comparing version 1.1.15 to 1.2.0

4

demo/js/demo1.js

@@ -20,2 +20,6 @@ import QuillBetterTable from 'src/quill-better-table.js'

}
},
color: {
colors: ['red', 'green', 'yellow', 'white', 'red', 'green', 'yellow', 'white']
}

@@ -22,0 +26,0 @@ }

2

dist/quill-better-table.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("quill")):"function"==typeof define&&define.amd?define(["quill"],t):"object"==typeof exports?exports.quillBetterTable=t(require("quill")):e.quillBetterTable=t(e.Quill)}(window,function(e){return function(e){var t=window.webpackHotUpdatequillBetterTable;window.webpackHotUpdatequillBetterTable=function(e,n){!function(e,t){if(!x[e]||!y[e])return;for(var n in y[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(m[n]=t[n]);0==--g&&0===w&&A()}(e,n),t&&t(e,n)};var n,o=!0,r="1e06f23ef2f9d8bcafa8",i=1e4,l={},s=[],a=[];function c(e){var t=S[e];if(!t)return T;var o=function(o){return t.hot.active?(S[o]?-1===S[o].parents.indexOf(e)&&S[o].parents.push(e):(s=[e],n=o),-1===t.children.indexOf(o)&&t.children.push(o)):(console.warn("[HMR] unexpected require("+o+") from disposed module "+e),s=[]),T(o)},r=function(e){return{configurable:!0,enumerable:!0,get:function(){return T[e]},set:function(t){T[e]=t}}};for(var i in T)Object.prototype.hasOwnProperty.call(T,i)&&"e"!==i&&"t"!==i&&Object.defineProperty(o,i,r(i));return o.e=function(e){return"ready"===u&&p("prepare"),w++,T.e(e).then(t,function(e){throw t(),e});function t(){w--,"prepare"===u&&(v[e]||q(e),0===w&&0===g&&A())}},o.t=function(e,t){return 1&t&&(e=o(e)),T.t(e,-2&t)},o}function d(e){var t={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:n!==e,active:!0,accept:function(e,n){if(void 0===e)t._selfAccepted=!0;else if("function"==typeof e)t._selfAccepted=e;else if("object"==typeof e)for(var o=0;o<e.length;o++)t._acceptedDependencies[e[o]]=n||function(){};else t._acceptedDependencies[e]=n||function(){}},decline:function(e){if(void 0===e)t._selfDeclined=!0;else if("object"==typeof e)for(var n=0;n<e.length;n++)t._declinedDependencies[e[n]]=!0;else t._declinedDependencies[e]=!0},dispose:function(e){t._disposeHandlers.push(e)},addDisposeHandler:function(e){t._disposeHandlers.push(e)},removeDisposeHandler:function(e){var n=t._disposeHandlers.indexOf(e);n>=0&&t._disposeHandlers.splice(n,1)},check:C,apply:E,status:function(e){if(!e)return u;h.push(e)},addStatusHandler:function(e){h.push(e)},removeStatusHandler:function(e){var t=h.indexOf(e);t>=0&&h.splice(t,1)},data:l[e]};return n=void 0,t}var h=[],u="idle";function p(e){u=e;for(var t=0;t<h.length;t++)h[t].call(null,e)}var f,m,b,g=0,w=0,v={},y={},x={};function N(e){return+e+""===e?+e:e}function C(e){if("idle"!==u)throw new Error("check() is only allowed in idle status");return o=e,p("check"),(t=i,t=t||1e4,new Promise(function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var o=new XMLHttpRequest,i=T.p+""+r+".hot-update.json";o.open("GET",i,!0),o.timeout=t,o.send(null)}catch(e){return n(e)}o.onreadystatechange=function(){if(4===o.readyState)if(0===o.status)n(new Error("Manifest request to "+i+" timed out."));else if(404===o.status)e();else if(200!==o.status&&304!==o.status)n(new Error("Manifest request to "+i+" failed."));else{try{var t=JSON.parse(o.responseText)}catch(e){return void n(e)}e(t)}}})).then(function(e){if(!e)return p("idle"),null;y={},v={},x=e.c,b=e.h,p("prepare");var t=new Promise(function(e,t){f={resolve:e,reject:t}});m={};return q(0),"prepare"===u&&0===w&&0===g&&A(),t});var t}function q(e){x[e]?(y[e]=!0,g++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=T.p+""+e+"."+r+".hot-update.js",document.head.appendChild(t)}(e)):v[e]=!0}function A(){p("ready");var e=f;if(f=null,e)if(o)Promise.resolve().then(function(){return E(o)}).then(function(t){e.resolve(t)},function(t){e.reject(t)});else{var t=[];for(var n in m)Object.prototype.hasOwnProperty.call(m,n)&&t.push(N(n));e.resolve(t)}}function E(t){if("ready"!==u)throw new Error("apply() is only allowed in ready status");var n,o,i,a,c;function d(e){for(var t=[e],n={},o=t.map(function(e){return{chain:[e],id:e}});o.length>0;){var r=o.pop(),i=r.id,l=r.chain;if((a=S[i])&&!a.hot._selfAccepted){if(a.hot._selfDeclined)return{type:"self-declined",chain:l,moduleId:i};if(a.hot._main)return{type:"unaccepted",chain:l,moduleId:i};for(var s=0;s<a.parents.length;s++){var c=a.parents[s],d=S[c];if(d){if(d.hot._declinedDependencies[i])return{type:"declined",chain:l.concat([c]),moduleId:i,parentId:c};-1===t.indexOf(c)&&(d.hot._acceptedDependencies[i]?(n[c]||(n[c]=[]),h(n[c],[i])):(delete n[c],t.push(c),o.push({chain:l.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function h(e,t){for(var n=0;n<t.length;n++){var o=t[n];-1===e.indexOf(o)&&e.push(o)}}t=t||{};var f={},g=[],w={},v=function(){console.warn("[HMR] unexpected require("+C.moduleId+") to disposed module")};for(var y in m)if(Object.prototype.hasOwnProperty.call(m,y)){var C;c=N(y);var q=!1,A=!1,E=!1,H="";switch((C=m[y]?d(c):{type:"disposed",moduleId:y}).chain&&(H="\nUpdate propagation: "+C.chain.join(" -> ")),C.type){case"self-declined":t.onDeclined&&t.onDeclined(C),t.ignoreDeclined||(q=new Error("Aborted because of self decline: "+C.moduleId+H));break;case"declined":t.onDeclined&&t.onDeclined(C),t.ignoreDeclined||(q=new Error("Aborted because of declined dependency: "+C.moduleId+" in "+C.parentId+H));break;case"unaccepted":t.onUnaccepted&&t.onUnaccepted(C),t.ignoreUnaccepted||(q=new Error("Aborted because "+c+" is not accepted"+H));break;case"accepted":t.onAccepted&&t.onAccepted(C),A=!0;break;case"disposed":t.onDisposed&&t.onDisposed(C),E=!0;break;default:throw new Error("Unexception type "+C.type)}if(q)return p("abort"),Promise.reject(q);if(A)for(c in w[c]=m[c],h(g,C.outdatedModules),C.outdatedDependencies)Object.prototype.hasOwnProperty.call(C.outdatedDependencies,c)&&(f[c]||(f[c]=[]),h(f[c],C.outdatedDependencies[c]));E&&(h(g,[C.moduleId]),w[c]=v)}var M,B=[];for(o=0;o<g.length;o++)c=g[o],S[c]&&S[c].hot._selfAccepted&&w[c]!==v&&B.push({module:c,errorHandler:S[c].hot._selfAccepted});p("dispose"),Object.keys(x).forEach(function(e){!1===x[e]&&function(e){delete installedChunks[e]}(e)});for(var O,L,R=g.slice();R.length>0;)if(c=R.pop(),a=S[c]){var z={},I=a.hot._disposeHandlers;for(i=0;i<I.length;i++)(n=I[i])(z);for(l[c]=z,a.hot.active=!1,delete S[c],delete f[c],i=0;i<a.children.length;i++){var k=S[a.children[i]];k&&((M=k.parents.indexOf(c))>=0&&k.parents.splice(M,1))}}for(c in f)if(Object.prototype.hasOwnProperty.call(f,c)&&(a=S[c]))for(L=f[c],i=0;i<L.length;i++)O=L[i],(M=a.children.indexOf(O))>=0&&a.children.splice(M,1);for(c in p("apply"),r=b,w)Object.prototype.hasOwnProperty.call(w,c)&&(e[c]=w[c]);var D=null;for(c in f)if(Object.prototype.hasOwnProperty.call(f,c)&&(a=S[c])){L=f[c];var j=[];for(o=0;o<L.length;o++)if(O=L[o],n=a.hot._acceptedDependencies[O]){if(-1!==j.indexOf(n))continue;j.push(n)}for(o=0;o<j.length;o++){n=j[o];try{n(L)}catch(e){t.onErrored&&t.onErrored({type:"accept-errored",moduleId:c,dependencyId:L[o],error:e}),t.ignoreErrored||D||(D=e)}}}for(o=0;o<B.length;o++){var V=B[o];c=V.module,s=[c];try{T(c)}catch(e){if("function"==typeof V.errorHandler)try{V.errorHandler(e)}catch(n){t.onErrored&&t.onErrored({type:"self-accept-error-handler-errored",moduleId:c,error:n,originalError:e}),t.ignoreErrored||D||(D=n),D||(D=e)}else t.onErrored&&t.onErrored({type:"self-accept-errored",moduleId:c,error:e}),t.ignoreErrored||D||(D=e)}}return D?(p("fail"),Promise.reject(D)):(p("idle"),new Promise(function(e){e(g)}))}var S={};function T(t){if(S[t])return S[t].exports;var n=S[t]={i:t,l:!1,exports:{},hot:d(t),parents:(a=s,s=[],a),children:[]};return e[t].call(n.exports,n,n.exports,c(t)),n.l=!0,n.exports}return T.m=e,T.c=S,T.d=function(e,t,n){T.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},T.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},T.t=function(e,t){if(1&t&&(e=T(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(T.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)T.d(n,o,function(t){return e[t]}.bind(null,o));return n},T.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return T.d(t,"a",t),t},T.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},T.p="",T.h=function(){return r},c(10)(T.s=10)}([function(t,n){t.exports=e},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M73.142857 336.64h526.628572v43.885714H73.142857zM73.142857 643.657143h526.628572v43.885714H73.142857zM336.457143 117.028571h43.885714v789.942858h-43.885714zM204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.771429 87.771429 0 0 0 87.771429 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM819.2 73.142857h-219.428571v877.714286h219.428571a131.657143 131.657143 0 0 0 131.657143-131.657143V204.8A131.84 131.84 0 0 0 819.2 73.142857z m44.068571 460.982857h-65.828571v65.828572H753.371429v-65.828572h-65.828572V490.057143h65.828572v-65.828572h44.068571v65.828572h65.828571z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M380.342857 336.457143h526.811429v43.885714H380.342857z m0 307.2h526.811429v43.885714H380.342857zM643.657143 117.028571h43.885714v789.942858h-43.885714zM204.8 73.142857h614.582857A131.474286 131.474286 0 0 1 950.857143 204.8v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.657143 131.657143 0 0 1 204.8 73.142857z m0 43.885714a87.588571 87.588571 0 0 0-87.588571 87.771429v614.4a87.588571 87.588571 0 0 0 87.588571 87.771429h614.582857a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM204.8 73.142857A131.657143 131.657143 0 0 0 73.142857 204.8v614.4a131.657143 131.657143 0 0 0 131.657143 131.657143h219.428571V73.142857z m131.84 460.8h-65.828571v65.828572h-43.885715v-65.828572h-65.828571v-43.885714h65.828571v-65.828572h43.885715v65.828572h65.828571z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M73.142857 599.771429h877.714286v43.885714H73.142857zM336.457143 380.342857h43.885714v526.628572h-43.885714z m307.2 0h43.885714v526.628572h-43.885714zM204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.657143 131.657143 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.588571 87.588571 0 0 0 87.771429 87.771429h614.4a87.588571 87.588571 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM819.2 73.142857H204.8A131.657143 131.657143 0 0 0 73.142857 204.8v219.428571h877.714286v-219.428571A131.657143 131.657143 0 0 0 819.2 73.142857z m-219.428571 197.485714h-65.828572v65.828572h-43.885714v-65.828572h-65.828572v-43.885714h65.828572V160.914286h43.885714v65.828571h65.828572z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.771429 87.771429 0 0 0 87.771429 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM73.142857 336.457143h877.714286v44.068571H73.142857zM336.64 117.028571h43.885714v526.628572h-43.885714z m307.017143 0h44.068571v526.628572H643.657143zM73.142857 599.771429v219.428571a131.657143 131.657143 0 0 0 131.657143 131.657143h614.4a131.657143 131.657143 0 0 0 131.657143-131.657143v-219.428571z m526.628572 197.485714h-65.645715v65.828571H490.057143v-65.828571h-65.828572v-43.885714h65.828572v-65.828572h44.068571v65.828572h65.645715z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M925.99596 99.038384c-25.470707-25.6-60.121212-39.822222-96.323233-39.822222H194.19798c-36.072727 0-70.723232 14.351515-96.323233 39.822222-25.6 25.6-39.822222 60.121212-39.822222 96.323232v635.474748c0 36.072727 14.351515 70.723232 39.822222 96.323232C123.474747 952.759596 158.125253 967.111111 194.19798 967.111111h635.474747c36.072727 0 70.723232-14.351515 96.323233-39.951515 25.6-25.6 39.951515-60.121212 39.951515-96.323232V195.361616c0-36.072727-14.351515-70.723232-39.951515-96.323232z m-277.850505 5.559596v226.909091H375.725253V104.59798h272.420202zM103.434343 195.361616c0-24.048485 9.567677-47.191919 26.634344-64.129293 17.066667-17.066667 40.080808-26.634343 64.129293-26.634343h136.145454v226.909091H103.434343V195.361616z m90.763637 726.367677c-24.048485 0-47.191919-9.567677-64.129293-26.634344-17.066667-17.066667-26.634343-40.080808-26.634344-64.129292V649.309091h226.909091v272.420202H194.19798z m181.527273 0V649.309091h272.290909v272.420202H375.725253z m544.711111-90.892929c0 24.048485-9.567677 47.191919-26.634344 64.129293-17.066667 17.066667-40.080808 26.634343-64.129293 26.634343H693.527273V649.309091h226.909091v181.527273zM693.527273 331.507071V104.59798h136.145454c24.048485 0 47.191919 9.567677 64.129293 26.634343 17.066667 17.066667 26.634343 40.080808 26.634344 64.129293v136.145455H693.527273z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M336.457143 73.142857h43.885714v877.714286h-43.885714z m307.382857 0h43.702857v877.714286h-43.702857z m-438.857143 0h614.4A131.657143 131.657143 0 0 1 950.857143 204.8v614.4a131.474286 131.474286 0 0 1-131.474286 131.657143h-614.4A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.982857 73.142857z m0 43.885714a87.588571 87.588571 0 0 0-87.771428 87.771429v614.4a87.588571 87.588571 0 0 0 87.771428 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM73.142857 336.457143h877.714286v307.2H73.142857z m292.571429 43.885714v219.428572h292.571428v-219.428572z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M925.996 99.038c-25.47-25.6-60.121-39.822-96.323-39.822H194.198c-75.12 0.13-136.016 61.026-136.145 136.146v635.345c0 36.073 14.351 70.723 39.822 96.323 25.6 25.73 60.25 40.081 96.323 40.081h635.475c36.072 0 70.723-14.351 96.323-39.951 25.6-25.6 39.951-60.122 39.951-96.324V195.362c0-36.073-14.351-70.724-39.951-96.324z m-365.77 494.287L512 545.228l-48.226 48.097-32.194-31.935 48.355-48.226-48.226-48.097 32.194-32.194L512 480.97l48.097-48.097 32.194 32.194-48.097 48.097 48.226 48.226-32.194 31.935zM103.434 195.362c0-24.049 9.568-47.192 26.635-64.13 17.066-17.066 40.08-26.634 64.129-26.634h136.145v226.91H103.434V195.361z m0 181.656h226.91V649.31h-226.91V377.02z m90.764 544.84c-24.049 0-47.192-9.567-64.13-26.634-17.066-17.066-26.634-40.08-26.634-64.258V694.69h226.91v227.168H194.197z m726.238-90.763c0 24.048-9.438 47.192-26.505 64.259-17.066 17.066-40.21 26.634-64.258 26.505H693.527V694.69h226.91v136.404z m0-181.786H693.527V377.02h226.91v272.29zM693.527 331.507V104.598h136.146c24.048 0 47.192 9.438 64.258 26.505 17.067 17.067 26.635 40.21 26.505 64.259v136.145H693.527z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M925.99596 99.038384c-25.470707-25.6-60.121212-39.822222-96.323233-39.822222H194.19798c-36.072727 0-70.723232 14.351515-96.323233 39.822222-25.6 25.6-39.822222 60.121212-39.822222 96.323232v635.474748c0 36.072727 14.351515 70.723232 39.822222 96.323232C123.474747 952.759596 158.125253 967.111111 194.19798 967.111111h635.474747c36.072727 0 70.723232-14.351515 96.323233-39.951515 25.6-25.6 39.951515-60.121212 39.951515-96.323232V195.361616c0-36.072727-14.351515-70.723232-39.951515-96.323232z m-550.270707 5.559596h272.290909v227.167677H375.725253V104.59798z m56.242424 360.468687l31.935353-32.19394 48.09697 48.226263 48.09697-48.226263 32.193939 32.19394-48.09697 48.096969 48.226263 48.226263-32.193939 31.935354-48.226263-48.09697-48.226263 48.09697-31.935353-31.935354 48.226262-48.226263-48.096969-48.096969zM103.434343 195.361616c0-24.048485 9.567677-47.191919 26.634344-64.129293 17.066667-17.066667 40.080808-26.634343 64.129293-26.634343h136.145454v227.167677H103.434343V195.361616z m817.002021 635.733333c0 24.048485-9.567677 47.191919-26.634344 64.258586-17.066667 17.066667-40.080808 26.634343-64.129293 26.634344H194.19798c-24.048485 0-47.191919-9.567677-64.258586-26.634344C112.872727 878.157576 103.434343 855.014141 103.434343 830.836364V694.690909h226.909091v226.909091h45.381819V694.690909h272.290909v226.909091h45.381818V694.690909h226.909091v136.40404z m0-499.329292H693.527273V104.59798h136.145454c24.048485 0 47.191919 9.567677 64.129293 26.634343 17.066667 17.066667 26.634343 40.080808 26.634344 64.129293v136.404041z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M764.42168889 830.5152c0 30.23530667-24.61013333 54.84430222-54.84316444 54.84430222H314.42147555c-30.23416889 0-54.84316445-24.61013333-54.84316444-54.84430222V248.32796445h504.84337778v582.18723555zM369.26577778 149.89084445c0-6.32832 4.92202667-11.25034667 11.25034667-11.25034667H644.18702222c6.32832 0 11.25034667 4.92202667 11.25034667 11.25034667v33.04675555H369.26577778V149.89084445z m559.68768 33.04675555H720.82773333V149.89084445c0-42.1888-34.45191111-76.64071111-76.64071111-76.64071112H380.51612445c-42.1888 0-76.64071111 34.45191111-76.64071112 76.64071112v33.04675555h-208.82773333c-18.28181333 0-33.04789333 14.76608-33.04789333 33.04675555s14.76608 33.04675555 33.04675555 33.04675556h98.43825778v581.48408889c0 66.79779555 54.14001778 120.93781333 120.93667555 120.93781333h395.1570489c66.79665778 0 120.93667555-54.14001778 120.93667555-120.93781333V248.32796445h98.43825778c18.28067555 0 33.04675555-14.76494222 33.04675555-33.04675556s-14.76608-32.34360889-33.04675555-32.34360889zM512 786.21923555c18.28181333 0 33.04675555-14.76608 33.04675555-33.04789333v-351.56195555c0-18.28181333-14.76494222-33.04675555-33.04675555-33.04675556s-33.04675555 14.76494222-33.04675555 33.04675556v351.56195555c0 18.28181333 14.76494222 33.04789333 33.04675555 33.04789333m-153.98456889 0c18.28181333 0 33.04675555-14.76608 33.04675556-33.04789333v-351.56195555c0-18.28181333-14.76494222-33.04675555-33.04675556-33.04675556s-33.04675555 14.76494222-33.04675556 33.04675556v351.56195555c0.70314667 18.28181333 15.46922667 33.04789333 33.04675556 33.04789333m307.96913778 0c18.28067555 0 33.04675555-14.76608 33.04675556-33.04789333v-351.56195555c0-18.28181333-14.76608-33.04675555-33.04675556-33.04675556s-33.04675555 14.76494222-33.04675556 33.04675556v351.56195555c0 18.28181333 14.76494222 33.04789333 33.04675556 33.04789333"/></svg>'},function(e,t,n){e.exports=n(11)},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n.n(o);function i(e,t){if("object"==typeof t)for(let n in t)e.style[n]=t[n]}function l(e,t){let n=t.getBoundingClientRect();return{x:e.x-n.x-t.scrollLeft,y:e.y-n.y-t.scrollTop,x1:e.x-n.x-t.scrollLeft+e.width,y1:e.y-n.y-t.scrollTop+e.height,width:e.width,height:e.height}}function s(e,t){return e&&Object.keys(e).reduce((n,o)=>t.includes(o)?n:Object.assign({},n,{[o]:e[o]}),{})}function a(e){let t;if(null==(t=e.path||e.composedPath&&e.composedPath())&&e.target){t=[];let n=e.target;for(t.push(n);n&&n.parentNode;)n=n.parentNode,t.push(n)}return t}const c=12,d=12,h=50,u="#35A7ED";class p{constructor(e,t,n){if(!e)return null;this.table=e,this.quill=t,this.options=n,this.domNode=null,this.initColTool()}initColTool(){const e=this.quill.root.parentNode,t=(this.table.getBoundingClientRect(),e.getBoundingClientRect()),n=this.table.parentNode.getBoundingClientRect();this.domNode=document.createElement("div"),this.domNode.classList.add("qlbt-col-tool"),this.updateToolCells(),e.appendChild(this.domNode),i(this.domNode,{width:"".concat(n.width,"px"),height:"".concat(c,"px"),left:"".concat(n.left-t.left+e.scrollLeft,"px"),top:"".concat(n.top-t.top+e.scrollTop-c-5,"px")})}createToolCell(){const e=document.createElement("div");e.classList.add("qlbt-col-tool-cell");const t=document.createElement("div");return t.classList.add("qlbt-col-tool-cell-holder"),i(e,{height:"".concat(d,"px")}),e.appendChild(t),e}updateToolCells(){const e=r.a.find(this.table),t=e.children.tail.children.head.children,n=e.colGroup().children,o=function(e){return e.reduce((e,t)=>{const n=t.formats().colspan;return e+=parseInt(n,10)},0)}(t);let l=Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell"));for(let e=0;e<Math.max(o,l.length);e++){let t=n.at(e),r=t&&parseInt(t.formats()[t.statics.blotName].width,10),s=null;l[e]?l[e]&&e>=o?l[e].remove():i(s=l[e],{"min-width":"".concat(r,"px")}):(s=this.createToolCell(),this.domNode.appendChild(s),this.addColCellHolderHandler(s),i(s,{"min-width":"".concat(r,"px")}))}}destroy(){return this.domNode.remove(),null}addColCellHolderHandler(e){const t=r.a.find(this.table),n=e.querySelector(".qlbt-col-tool-cell-holder");let o=!1,l=0,s=0,a=0,d=0,p={},f={},m=null;const b=e=>{e.preventDefault(),o&&(s=e.clientX,a=d+s-l>=h?s-l:h-d,i(m,{left:"".concat(f.left+f.width-1+a,"px")}))},g=r=>{r.preventDefault();const c=Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell")).indexOf(e),h=t.colGroup().children.at(c);o&&(h.format("width",d+a),i(e,{"min-width":"".concat(d+a,"px")}),l=0,s=0,a=0,d=0,o=!1,n.classList.remove("dragging")),document.removeEventListener("mousemove",b,!1),document.removeEventListener("mouseup",g,!1),p={},f={},m.remove(),m=null,t.updateTableWidth();const u=this.quill.getModule("better-table").tableSelection;u&&u.clearSelection()};n.addEventListener("mousedown",t=>{document.addEventListener("mousemove",b,!1),document.addEventListener("mouseup",g,!1),p=this.table.getBoundingClientRect(),f=e.getBoundingClientRect(),i(m=document.createElement("div"),{position:"fixed",top:"".concat(f.top,"px"),left:"".concat(f.left+f.width-1,"px"),zIndex:"100",height:"".concat(p.height+c+4,"px"),width:"1px",backgroundColor:u}),document.body.appendChild(m),o=!0,l=t.clientX,d=f.width,n.classList.add("dragging")},!1)}colToolCells(){return Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell"))}}const f=r.a.import("blots/block");class m extends f{static create(e){"string"==typeof e&&(e={value:e});const t=super.create(e.value);return N.forEach(n=>{e[n]&&t.setAttribute("data-".concat(n),e[n])}),C.forEach(n=>{e[n]&&t.setAttribute("data-".concat(n),e[n])}),t}static formats(e){const t={};return t.value=this.tagName.indexOf(e.tagName)+1,C.concat(N).reduce((t,n)=>(e.hasAttribute("data-".concat(n))&&(t[n]=e.getAttribute("data-".concat(n))||void 0),t),t)}format(e,t){const{row:n,cell:o,rowspan:r,colspan:i}=m.formats(this.domNode);e===m.blotName?t?super.format(e,{value:t,row:n,cell:o,rowspan:r,colspan:i}):n?this.replaceWith(E.blotName,{row:n,cell:o,rowspan:r,colspan:i}):super.format(e,t):super.format(e,t)}optimize(e){const{row:t,rowspan:n,colspan:o}=m.formats(this.domNode);if(!t||this.parent instanceof S||this.wrap(S.blotName,{row:t,colspan:o,rowspan:n}),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove();this.cache={}}}m.blotName="header",m.tagName=["H1","H2","H3","H4","H5","H6"];var b=m;const g=r.a.import("blots/break"),w=r.a.import("blots/block"),v=r.a.import("blots/container"),y=["width"],x={width:100},N=["row","cell"],C=["rowspan","colspan"],q={rowspan:1,colspan:1},A=5;class E extends w{static create(e){const t=super.create(e);return N.forEach(n=>{let o="row"===n?R:z;t.setAttribute("data-".concat(n),e[n]||o())}),C.forEach(n=>{t.setAttribute("data-".concat(n),e[n]||q[n])}),t}static formats(e){return C.concat(N).reduce((t,n)=>(e.hasAttribute("data-".concat(n))&&(t[n]=e.getAttribute("data-".concat(n))||void 0),t),{})}format(e,t){if(C.concat(N).indexOf(e)>-1)t?this.domNode.setAttribute("data-".concat(e),t):this.domNode.removeAttribute("data-".concat(e));else if("header"===e){if(!t)return;const{row:n,cell:o,rowspan:r,colspan:i}=E.formats(this.domNode);super.format(e,{value:t,row:n,cell:o,rowspan:r,colspan:i})}else super.format(e,t)}optimize(e){const t=this.domNode.getAttribute("data-row"),n=this.domNode.getAttribute("data-rowspan"),o=this.domNode.getAttribute("data-colspan");!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName,{row:t,colspan:o,rowspan:n}),super.optimize(e)}tableCell(){return this.parent}}E.blotName="table-cell-line",E.ClassName="qlbt-cell-line",E.tagName="DIV";class S extends v{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats()[this.children.head.statics.blotName],t=this.children.tail.formats()[this.children.tail.statics.blotName],n=this.next.children.head.formats()[this.next.children.head.statics.blotName],o=this.next.children.tail.formats()[this.next.children.tail.statics.blotName];return e.cell===t.cell&&e.cell===n.cell&&e.cell===o.cell}return!1}static create(e){const t=super.create(e);return t.setAttribute("data-row",e.row),C.forEach(n=>{e[n]&&t.setAttribute(n,e[n])}),t}static formats(e){const t={};return e.hasAttribute("data-row")&&(t.row=e.getAttribute("data-row")),C.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),t)}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}formats(){const e={};return this.domNode.hasAttribute("data-row")&&(e.row=this.domNode.getAttribute("data-row")),C.reduce((e,t)=>(this.domNode.hasAttribute(t)&&(e[t]=this.domNode.getAttribute(t)),e),e)}toggleAttribute(e,t){t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e)}formatChildren(e,t){this.children.forEach(n=>{n.format(e,t)})}format(e,t){C.indexOf(e)>-1?(this.toggleAttribute(e,t),this.formatChildren(e,t)):["row"].indexOf(e)>-1?(this.toggleAttribute("data-".concat(e),t),this.formatChildren(e,t)):super.format(e,t)}optimize(e){const t=this.domNode.getAttribute("data-row");!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName,{row:t}),super.optimize(e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}S.blotName="table",S.tagName="TD";class T extends v{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),o=this.next.children.tail.formats();return e.row===t.row&&e.row===n.row&&e.row===o.row}return!1}static create(e){const t=super.create(e);return t.setAttribute("data-row",e.row),t}formats(){return["row"].reduce((e,t)=>(this.domNode.hasAttribute("data-".concat(t))&&(e[t]=this.domNode.getAttribute("data-".concat(t))),e),{})}optimize(e){!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}T.blotName="table-row",T.tagName="TR";class H extends v{}H.blotName="table-body",H.tagName="TBODY";class M extends w{static create(e){let t=super.create(e);return y.forEach(n=>{t.setAttribute("".concat(n),e[n]||x[n])}),t}static formats(e){return y.reduce((t,n)=>(e.hasAttribute("".concat(n))&&(t[n]=e.getAttribute("".concat(n))||void 0),t),{})}format(e,t){y.indexOf(e)>-1?this.domNode.setAttribute("".concat(e),t||x[e]):super.format(e,t)}html(){return this.domNode.outerHTML}}M.blotName="table-col",M.tagName="col";class B extends v{}B.blotName="table-col-group",B.tagName="colgroup";class O extends v{static create(){return super.create()}constructor(e,t){super(e,t),this.updateTableWidth()}updateTableWidth(){setTimeout(()=>{const e=this.colGroup();if(!e)return;const t=e.children.reduce((e,t)=>e+=parseInt(t.formats()[M.blotName].width,10),0);this.domNode.style.width="".concat(t,"px")},0)}cells(e){return this.rows().map(t=>t.children.at(e))}colGroup(){return this.children.head}deleteColumns(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const[o]=this.descendants(H);if(null==o||null==o.children.head)return;const r=this.descendants(S),i=[],s=[];if(r.forEach(t=>{const o=l(t.domNode.getBoundingClientRect(),n);o.x+A>e.x&&o.x1-A<e.x1?i.push(t):o.x<e.x+A&&o.x1>e.x1-A&&s.push(t)}),i.length===r.length)return this.tableDestroy(),!0;t.forEach(e=>{this.colGroup().children.at(t[0]).remove()}),i.forEach(e=>{e.remove()}),s.forEach(e=>{const n=parseInt(e.formats().colspan,10);parseInt(e.formats().width,10);e.format("colspan",n-t.length)}),this.updateTableWidth()}deleteRow(e,t){const[n]=this.descendants(H);if(null==n||null==n.children.head)return;const o=this.descendants(S),r=[],i=[],s=[];if(o.forEach(n=>{const o=l(n.domNode.getBoundingClientRect(),t);o.y>e.y-A&&o.y1<e.y1+A?r.push(n):o.y<e.y+A&&o.y1>e.y1-A&&(i.push(n),Math.abs(o.y-e.y)<A&&s.push(n))}),r.length===o.length)return void this.tableDestroy();const a=this.rows().reduce((n,o)=>{let r=l(o.domNode.getBoundingClientRect(),t);return r.y>e.y-A&&r.y1<e.y1+A&&(n+=1),n},0);s.forEach(e=>{const n=l(e.domNode.getBoundingClientRect(),t),o=e.parent.next,r=o.children.reduce((e,o)=>{const r=l(o.domNode.getBoundingClientRect(),t);return Math.abs(n.x1-r.x)<A&&(e=o),e},null);o.insertBefore(e,r),e.format("row",o.formats().row)}),r.forEach(e=>{e.remove()}),i.forEach(e=>{const t=parseInt(e.formats().rowspan,10);e.format("rowspan",t-a)})}tableDestroy(){const e=r.a.find(this.scroll.domNode.parentNode),t=e.getModule("better-table");this.remove(),t.hideTableTools(),e.update(r.a.sources.USER)}insertCell(e,t){const n=z(),o=e.formats().row,r=this.scroll.create(S.blotName,Object.assign({},q,{row:o})),i=this.scroll.create(E.blotName,{row:o,cell:n});r.appendChild(i),t?e.insertBefore(r,t):e.appendChild(r)}insertColumn(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0;const[r]=this.descendants(H),[i]=this.descendants(B),s=this.descendants(M);let a=[],c=[],d=[];if(null==r||null==r.children.head)return;this.descendants(S).forEach(t=>{const r=l(t.domNode.getBoundingClientRect(),o);n?Math.abs(r.x1-e.x1)<A?a.push(t):e.x1-r.x>A&&e.x1-r.x1<-A&&c.push(t):Math.abs(r.x-e.x)<A?a.push(t):e.x-r.x>A&&e.x-r.x1<-A&&c.push(t)}),a.forEach(e=>{const t=n?e.next:e,o=z(),r=e.parent,i=r.formats().row,l=e.formats(),s=this.scroll.create(S.blotName,Object.assign({},q,{row:i,rowspan:l.rowspan})),a=this.scroll.create(E.blotName,{row:i,cell:o,rowspan:l.rowspan});s.appendChild(a),t?r.insertBefore(s,t):r.appendChild(s),d.push(s)});const h=this.scroll.create(M.blotName,!0);let u=n?s[t].next:s[t];return u?i.insertBefore(h,u):i.appendChild(h),c.forEach(e=>{const t=e.formats().colspan;e.format("colspan",parseInt(t,10)+1),d.push(e)}),d.sort((e,t)=>{return e.domNode.getBoundingClientRect().y-t.domNode.getBoundingClientRect().y}),this.updateTableWidth(),d}insertRow(e,t,n){const[o]=this.descendants(H);if(null==o||null==o.children.head)return;const r=this.descendants(S),i=R(),s=this.scroll.create(T.blotName,{row:i});let a=[],c=[],d=[];r.forEach(o=>{const r=l(o.domNode.getBoundingClientRect(),n);t?Math.abs(r.y1-e.y1)<A?a.push(o):e.y1-r.y>A&&e.y1-r.y1<-A&&c.push(o):Math.abs(r.y-e.y)<A?a.push(o):e.y-r.y>A&&e.y-r.y1<-A&&c.push(o)});const h=(e,t)=>{return e.domNode.getBoundingClientRect().x-t.domNode.getBoundingClientRect().x};a.sort(h),a.forEach(e=>{const t=z(),n=e.formats(),o=this.scroll.create(S.blotName,Object.assign({},q,{row:i,colspan:n.colspan})),r=this.scroll.create(E.blotName,{row:i,cell:t,colspan:n.colspan}),l=this.scroll.create(g.blotName);r.appendChild(l),o.appendChild(r),s.appendChild(o),d.push(o)}),c.forEach(e=>{const t=parseInt(e.formats().rowspan,10);e.format("rowspan",t+1),d.push(e)});const u=this.rows().find(o=>{let r=l(o.domNode.getBoundingClientRect(),n);return t?Math.abs(r.y-e.y-e.height)<A:Math.abs(r.y-e.y)<A});return o.insertBefore(s,u),d.sort(h),d}mergeCells(e,t,n,o,r){const i=t.reduce((e,t,r)=>(0!==r?(e&&t.moveChildren(e),t.remove()):(t.format("colspan",o),t.format("rowspan",n),e=t),e),null);let l=i.domNode.getAttribute("data-row"),s=i.children.head.domNode.getAttribute("data-cell");return i.children.forEach(e=>{e.format("cell",s),e.format("row",l),e.format("colspan",o),e.format("rowspan",n)}),i}unmergeCells(e,t){let n={},o=1,r=1;e.forEach(e=>{if(n=e.formats(),o=n.rowspan,(r=n.colspan)>1){let t=e.next,n=e.row();e.format("colspan",1);for(let e=r;e>1;e--)this.insertCell(n,t)}if(o>1){let n=o,i=e.row().next;for(;n>1;){let o=i.children.reduce((n,o)=>{let r=l(e.domNode.getBoundingClientRect(),t),i=l(o.domNode.getBoundingClientRect(),t);return Math.abs(r.x1-i.x)<A&&(n=o),n},null);for(let e=r;e>0;e--)this.insertCell(i,o);n-=1,i=i.next}e.format("rowspan",1)}})}rows(){const e=this.children.tail;return null==e?[]:e.children.map(e=>e)}}O.blotName="table-container",O.className="quill-better-table",O.tagName="TABLE";class L extends v{constructor(e,t){super(e,t);const n=r.a.find(e.domNode.parentNode);t.addEventListener("scroll",e=>{const t=n.getModule("better-table");t.columnTool&&(t.columnTool.domNode.scrollLeft=e.target.scrollLeft),t.tableSelection&&t.tableSelection.selectedTds.length>0&&t.tableSelection.repositionHelpLines()},!1)}}function R(){const e=Math.random().toString(36).slice(2,6);return"row-".concat(e)}function z(){const e=Math.random().toString(36).slice(2,6);return"cell-".concat(e)}L.blotName="table-view",L.className="quill-better-table-wrapper",L.tagName="DIV",L.allowedChildren=[O],O.requiredContainer=L,O.allowedChildren=[H,B],H.requiredContainer=O,H.allowedChildren=[T],T.requiredContainer=H,T.allowedChildren=[S],S.requiredContainer=T,S.allowedChildren=[E,b],E.requiredContainer=S,B.allowedChildren=[M],B.requiredContainer=O,M.requiredContainer=B;const I="#0589f3",k=["left","right","top","bottom"],D=2;class j{constructor(e,t,n){if(!e)return null;this.table=e,this.quill=t,this.options=n,this.boundary={},this.selectedTds=[],this.dragging=!1,this.selectingHandler=this.mouseDownHandler.bind(this),this.clearSelectionHanler=this.clearSelection.bind(this),this.helpLinesInitial(),this.quill.root.addEventListener("mousedown",this.selectingHandler,!1),this.quill.on("text-change",this.clearSelectionHanler)}helpLinesInitial(){let e=this.quill.root.parentNode;k.forEach(t=>{this[t]=document.createElement("div"),this[t].classList.add("qlbt-selection-line"),this[t].classList.add("qlbt-selection-line-"+t),i(this[t],{position:"absolute",display:"none","background-color":I}),e.appendChild(this[t])})}mouseDownHandler(e){if(0!==e.button||!e.target.closest(".quill-better-table"))return;this.quill.root.addEventListener("mousemove",r,!1),this.quill.root.addEventListener("mouseup",function e(n){t.quill.root.removeEventListener("mousemove",r,!1);t.quill.root.removeEventListener("mouseup",e,!1);t.dragging=!1},!1);const t=this,n=e.target.closest("td[data-row]"),o=l(n.getBoundingClientRect(),this.quill.root.parentNode);function r(e){if(0!==e.button||!e.target.closest(".quill-better-table"))return;const r=e.target.closest("td[data-row]"),i=l(r.getBoundingClientRect(),t.quill.root.parentNode);t.boundary=V(o,i),t.correctBoundary(),t.selectedTds=t.computeSelectedTds(),t.repositionHelpLines(),n!==r&&t.quill.blur()}this.dragging=!0,this.boundary=V(o,o),this.correctBoundary(),this.selectedTds=this.computeSelectedTds(),this.repositionHelpLines()}correctBoundary(){r.a.find(this.table).descendants(S).forEach(e=>{let{x:t,y:n,width:o,height:r}=l(e.domNode.getBoundingClientRect(),this.quill.root.parentNode);(t+D>=this.boundary.x&&t+D<=this.boundary.x1||t-D+o>=this.boundary.x&&t-D+o<=this.boundary.x1)&&(n+D>=this.boundary.y&&n+D<=this.boundary.y1||n-D+r>=this.boundary.y&&n-D+r<=this.boundary.y1)&&(this.boundary=V(this.boundary,{x:t,y:n,width:o,height:r}))})}computeSelectedTds(){return r.a.find(this.table).descendants(S).reduce((e,t)=>{let{x:n,y:o,width:r,height:i}=l(t.domNode.getBoundingClientRect(),this.quill.root.parentNode);return n+D>=this.boundary.x&&n-D+r<=this.boundary.x1&&o+D>=this.boundary.y&&o-D+i<=this.boundary.y1&&e.push(t),e},[])}repositionHelpLines(){const e=this.table.parentNode.scrollLeft;i(this.left,{display:"block",left:"".concat(this.boundary.x-e-1,"px"),top:"".concat(this.boundary.y,"px"),height:"".concat(this.boundary.height+1,"px"),width:"1px"}),i(this.right,{display:"block",left:"".concat(this.boundary.x1-e,"px"),top:"".concat(this.boundary.y,"px"),height:"".concat(this.boundary.height+1,"px"),width:"1px"}),i(this.top,{display:"block",left:"".concat(this.boundary.x-1-e,"px"),top:"".concat(this.boundary.y,"px"),width:"".concat(this.boundary.width+1,"px"),height:"1px"}),i(this.bottom,{display:"block",left:"".concat(this.boundary.x-1-e,"px"),top:"".concat(this.boundary.y1+1,"px"),width:"".concat(this.boundary.width+1,"px"),height:"1px"})}refreshHelpLinesPosition(){const e=l(this.selectedTds[0].domNode.getBoundingClientRect(),this.quill.root.parentNode),t=l(this.selectedTds[this.selectedTds.length-1].domNode.getBoundingClientRect(),this.quill.root.parentNode);this.boundary=V(e,t),this.repositionHelpLines()}destroy(){return k.forEach(e=>{this[e].remove(),this[e]=null}),this.quill.root.removeEventListener("mousedown",this.selectingHandler,!1),this.quill.off("text-change",this.clearSelectionHanler),null}setSelection(e,t){this.boundary=V(l(e,this.quill.root.parentNode),l(t,this.quill.root.parentNode)),this.correctBoundary(),this.selectedTds=this.computeSelectedTds(),this.repositionHelpLines()}clearSelection(){this.boundary={},this.selectedTds=[],k.forEach(e=>{this[e]&&i(this[e],{display:"none"})})}}function V(e,t){let n=Math.min(e.x,t.x,e.x+e.width-1,t.x+t.width-1),o=Math.max(e.x,t.x,e.x+e.width-1,t.x+t.width-1),r=Math.min(e.y,t.y,e.y+e.height-1,t.y+t.height-1),i=Math.max(e.y,t.y,e.y+e.height-1,t.y+t.height-1);return{x:n,x1:o,y:r,y1:i,width:o-n,height:i-r}}var _=n(1),U=n.n(_),P=n(2),W=n.n(P),G=n(3),X=n.n(G),K=n(4),Y=n.n(K),J=n(5),Q=n.n(J),$=n(6),F=n.n($),Z=n(7),ee=n.n(Z),te=n(8),ne=n.n(te),oe=n(9),re=n.n(oe);const ie=150,le=200,se={insertColumnRight:{text:"Insert column right",iconSrc:U.a,handler(){const e=r.a.find(this.table);let t=ce(this.columnToolCells,this.boundary,(e,t)=>Math.abs(e.x+e.width-t.x1)<=5,this.quill.root.parentNode);const n=e.insertColumn(this.boundary,t,!0,this.quill.root.parentNode);this.tableColumnTool.updateToolCells(),this.quill.update(r.a.sources.USER),this.quill.setSelection(this.quill.getIndex(n[0]),0,r.a.sources.SILENT),this.tableSelection.setSelection(n[0].domNode.getBoundingClientRect(),n[0].domNode.getBoundingClientRect())}},insertColumnLeft:{text:"Insert column left",iconSrc:W.a,handler(){const e=r.a.find(this.table);let t=ce(this.columnToolCells,this.boundary,(e,t)=>Math.abs(e.x-t.x)<=5,this.quill.root.parentNode);const n=e.insertColumn(this.boundary,t,!1,this.quill.root.parentNode);this.tableColumnTool.updateToolCells(),this.quill.update(r.a.sources.USER),this.quill.setSelection(this.quill.getIndex(n[0]),0,r.a.sources.SILENT),this.tableSelection.setSelection(n[0].domNode.getBoundingClientRect(),n[0].domNode.getBoundingClientRect())}},insertRowUp:{text:"Insert row up",iconSrc:X.a,handler(){const e=r.a.find(this.table).insertRow(this.boundary,!1,this.quill.root.parentNode);this.quill.update(r.a.sources.USER),this.quill.setSelection(this.quill.getIndex(e[0]),0,r.a.sources.SILENT),this.tableSelection.setSelection(e[0].domNode.getBoundingClientRect(),e[0].domNode.getBoundingClientRect())}},insertRowDown:{text:"Insert row down",iconSrc:Y.a,handler(){const e=r.a.find(this.table).insertRow(this.boundary,!0,this.quill.root.parentNode);this.quill.update(r.a.sources.USER),this.quill.setSelection(this.quill.getIndex(e[0]),0,r.a.sources.SILENT),this.tableSelection.setSelection(e[0].domNode.getBoundingClientRect(),e[0].domNode.getBoundingClientRect())}},mergeCells:{text:"Merge selected cells",iconSrc:Q.a,handler(){const e=r.a.find(this.table),t=e.rows().reduce((e,t)=>{let n=l(t.domNode.getBoundingClientRect(),this.quill.root.parentNode);return n.y>this.boundary.y-5&&n.y+n.height<this.boundary.y+this.boundary.height+5&&(e+=1),e},0),n=this.columnToolCells.reduce((e,t)=>{let n=l(t.getBoundingClientRect(),this.quill.root.parentNode);return n.x>this.boundary.x-5&&n.x+n.width<this.boundary.x+this.boundary.width+5&&(e+=1),e},0),o=e.mergeCells(this.boundary,this.selectedTds,t,n,this.quill.root.parentNode);this.quill.update(r.a.sources.USER),this.tableSelection.setSelection(o.domNode.getBoundingClientRect(),o.domNode.getBoundingClientRect())}},unmergeCells:{text:"Unmerge cells",iconSrc:F.a,handler(){r.a.find(this.table).unmergeCells(this.selectedTds,this.quill.root.parentNode),this.quill.update(r.a.sources.USER),this.tableSelection.clearSelection()}},deleteColumn:{text:"Delete selected columns",iconSrc:ee.a,handler(){const e=r.a.find(this.table);let t=function(e,t,n,o){return e.reduce((r,i)=>{let s=l(i.getBoundingClientRect(),o);return n(s,t)&&r.push(e.indexOf(i)),r},[])}(this.columnToolCells,this.boundary,(e,t)=>e.x+5>t.x&&e.x+e.width-5<t.x1,this.quill.root.parentNode);e.deleteColumns(this.boundary,t,this.quill.root.parentNode)||(this.tableColumnTool.updateToolCells(),this.quill.update(r.a.sources.USER),this.tableSelection.clearSelection())}},deleteRow:{text:"Delete selected rows",iconSrc:ne.a,handler(){r.a.find(this.table).deleteRow(this.boundary,this.quill.root.parentNode),this.quill.update(r.a.sources.USER),this.tableSelection.clearSelection()}},deleteTable:{text:"Delete table",iconSrc:re.a,handler(){const e=this.quill.getModule("better-table"),t=r.a.find(this.table);e.hideTableTools(),t.remove(),this.quill.update(r.a.sources.USER)}}};class ae{constructor(e,t,n){const o=t.getModule("better-table");this.tableSelection=o.tableSelection,this.table=e.table,this.quill=t,this.options=n,this.menuItems=Object.assign({},se,n.items),this.tableColumnTool=o.columnTool,this.boundary=this.tableSelection.boundary,this.selectedTds=this.tableSelection.selectedTds,this.destroyHanlder=this.destroy.bind(this),this.columnToolCells=this.tableColumnTool.colToolCells(),this.menuInitial(e),this.mount(),document.addEventListener("click",this.destroyHanlder,!1)}mount(){document.body.appendChild(this.domNode)}destroy(){return this.domNode.remove(),document.removeEventListener("click",this.destroyHanlder,!1),null}menuInitial(e){let{table:t,left:n,top:o}=e;this.domNode=document.createElement("div"),this.domNode.classList.add("qlbt-operation-menu"),i(this.domNode,{position:"absolute",left:"".concat(n,"px"),top:"".concat(o,"px"),"min-height":"".concat(ie,"px"),width:"".concat(le,"px")});for(let e in this.menuItems)if(this.menuItems[e]&&(this.domNode.appendChild(this.menuItemCreator(Object.assign({},se[e],this.menuItems[e]))),["insertRowDown","unmergeCells"].indexOf(e)>-1)){const e=document.createElement("div");e.classList.add("qlbt-operation-menu-dividing"),this.domNode.appendChild(e)}}menuItemCreator(e){let{text:t,iconSrc:n,handler:o}=e;const r=document.createElement("div");r.classList.add("qlbt-operation-menu-item");const i=document.createElement("span");i.classList.add("qlbt-operation-menu-icon"),i.innerHTML=n;const l=document.createElement("span");return l.classList.add("qlbt-operation-menu-text"),l.innerText=t,r.appendChild(i),r.appendChild(l),r.addEventListener("click",o.bind(this),!1),r}}function ce(e,t,n,o){return e.reduce((r,i)=>{let s=l(i.getBoundingClientRect(),o);return n(s,t)&&(r=e.indexOf(i)),r},!1)}const de=r.a.import("delta");function he(e,t,n){const o=e.parentNode,r="TABLE"===o.parentNode.tagName?o.parentNode:o.parentNode.parentNode,i=Array.from(r.querySelectorAll("tr")),l=Array.from(o.querySelectorAll("td")),a=i.indexOf(o)+1,c=l.indexOf(e)+1,d=e.getAttribute("colspan")||!1,h=e.getAttribute("rowspan")||!1;return 0===t.length()?t=(new de).insert("\n",{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}}):(t=t.reduce((e,t)=>{if(t.insert&&"string"==typeof t.insert){const n=[];let o=t.insert,r=0;for(let e=0;e<t.insert.length;e++)"\n"===o.charAt(e)&&(0===e?n.push("\n"):(n.push(o.substring(r,e)),n.push("\n")),r=e+1);const i=o.substring(r);i&&n.push(i),n.forEach(n=>{"\n"===n?e.insert("\n",t.attributes):e.insert(n,s(t.attributes,["table","table-cell-line"]))})}else e.insert(t.insert,t.attributes);return e},new de)).reduce((e,t)=>(t.insert&&"string"==typeof t.insert&&t.insert.startsWith("\n")?e.insert(t.insert,Object.assign({},Object.assign({},{row:a},t.attributes.table),{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}},s(t.attributes,["table"]))):e.insert(t.insert,Object.assign({},s(t.attributes,["table","table-cell-line"]))),e),new de)}function ue(e,t,n){const o=e.parentNode,r="TABLE"===o.parentNode.tagName?o.parentNode:o.parentNode.parentNode,i=Array.from(r.querySelectorAll("tr")),l=Array.from(o.querySelectorAll("th")),a=i.indexOf(o)+1,c=l.indexOf(e)+1,d=e.getAttribute("colspan")||!1,h=e.getAttribute("rowspan")||!1;return 0===t.length()?t=(new de).insert("\n",{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}}):(t=t.reduce((e,t)=>{if(t.insert&&"string"==typeof t.insert){const n=[];let o=t.insert,r=0;for(let e=0;e<t.insert.length;e++)"\n"===o.charAt(e)&&(0===e?n.push("\n"):(n.push(o.substring(r,e)),n.push("\n")),r=e+1);const i=o.substring(r);i&&n.push(i),n.indexOf("\n")<0&&n.push("\n"),n.forEach(n=>{"\n"===n?e.insert("\n",{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}}):e.insert(n,t.attributes)})}else e.insert(t.insert,t.attributes);return e},new de)).reduce((e,t)=>(t.insert&&"string"==typeof t.insert&&t.insert.startsWith("\n")?e.insert(t.insert,Object.assign({},{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}})):e.insert(t.insert,Object.assign({},s(t.attributes,["table","table-cell-line"]))),e),new de)}function pe(e,t,n){let o=new de;const r=e.querySelector("tr");if(null===r)return o;const i=Array.from(r.querySelectorAll("td")).concat(Array.from(r.querySelectorAll("th"))).reduce((e,t)=>{const n=t.getAttribute("colspan")||1;return e+=parseInt(n,10)},0),l=e.querySelectorAll("col").length;if(l===i)return t;{for(let e=0;e<i-l;e++)o.insert("\n",{"table-col":!0});if(0===l)return o.concat(t);let e=0;return t.reduce((t,n)=>(t.insert(n.insert,n.attributes),n.attributes&&n.attributes["table-col"]&&(e+=n.insert.length)===l&&(t=t.concat(o)),t),new de)}}const fe=r.a.import("core/module"),me=r.a.import("delta");class be extends fe{static register(){r.a.register(M,!0),r.a.register(B,!0),r.a.register(E,!0),r.a.register(S,!0),r.a.register(T,!0),r.a.register(H,!0),r.a.register(O,!0),r.a.register(L,!0),r.a.register(L,!0)}constructor(e,t){super(e,t),this.quill.root.addEventListener("click",n=>{const o=a(n);if(!o||o.length<=0)return;const r=o.filter(e=>e.tagName&&"TABLE"===e.tagName.toUpperCase()&&e.classList.contains("quill-better-table"))[0];if(r){if(this.table===r)return;this.table&&this.hideTableTools(),this.showTableTools(r,e,t)}else this.table&&this.hideTableTools()},!1),this.quill.root.addEventListener("contextmenu",n=>{if(!this.table)return!0;n.preventDefault();const o=a(n);if(!o||o.length<=0)return;const r=o.filter(e=>e.tagName&&"TABLE"===e.tagName.toUpperCase()&&e.classList.contains("quill-better-table"))[0],i=o.filter(e=>e.tagName&&"TR"===e.tagName.toUpperCase()&&e.getAttribute("data-row"))[0],l=o.filter(e=>e.tagName&&"TD"===e.tagName.toUpperCase()&&e.getAttribute("data-row"))[0];let s=this.tableSelection.selectedTds.map(e=>e.domNode).includes(l);(this.tableSelection.selectedTds.length<=0||!s)&&this.tableSelection.setSelection(l.getBoundingClientRect(),l.getBoundingClientRect()),this.tableOperationMenu&&(this.tableOperationMenu=this.tableOperationMenu.destroy()),r&&(this.tableOperationMenu=new ae({table:r,row:i,cell:l,left:n.pageX,top:n.pageY},e,t.operationMenu))},!1);e.getModule("keyboard");e.keyboard.addBinding({key:"Backspace"},{},function(e,t){if(0===e.index||this.quill.getLength()<=1)return!0;const[n]=this.quill.getLine(e.index);if(0===t.offset){const[t]=this.quill.getLine(e.index-1);if(null!=t&&"table-cell-line"===t.statics.blotName&&"table-cell-line"!==n.statics.blotName)return!1}return!0});let n=e.keyboard.bindings.Backspace.pop();e.keyboard.bindings.Backspace.splice(0,1,n),e.clipboard.addMatcher("td",he),e.clipboard.addMatcher("th",ue),e.clipboard.addMatcher("table",pe),e.clipboard.matchers=e.clipboard.matchers.filter(e=>"tr"!==e[0])}getTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==e)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==E.blotName)return[null,null,null,-1];const o=t.tableCell(),r=o.row();return[r.table(),r,o,n]}insertTable(e,t){const n=this.quill.getSelection(!0);if(null==n)return;this.quill.getLeaf(n.index)[0],this.quill.getLeaf(n.index+1)[0];let o=(new me).retain(n.index);o.insert("\n"),o=new Array(t).fill("\n").reduce((e,t)=>(e.insert(t,{"table-col":!0}),e),o),o=new Array(e).fill(0).reduce(e=>{let n=R();return new Array(t).fill("\n").reduce((e,t)=>(e.insert(t,{"table-cell-line":{row:n,cell:z()}}),e),e)},o),this.quill.updateContents(o,r.a.sources.USER),this.quill.setSelection(n.index+t+1,r.a.sources.API)}showTableTools(e,t,n){this.table=e,this.columnTool=new p(e,t,n),this.tableSelection=new j(e,t,n)}hideTableTools(){this.columnTool&&this.columnTool.destroy(),this.tableSelection&&this.tableSelection.destroy(),this.tableOperationMenu&&this.tableOperationMenu.destroy(),this.columnTool=null,this.tableSelection=null,this.tableOperationMenu=null,this.table=null}}be.keyboardBindings={"table-cell-line backspace":{key:"Backspace",format:["table-cell-line"],collapsed:!0,offset:0,handler(e,t){const[n,o]=this.quill.getLine(e.index);return!(!n.prev||"table-cell-line"!==n.prev.statics.blotName)}},"table-cell-line delete":{key:"Delete",format:["table-cell-line"],collapsed:!0,suffix:/^$/,handler(){}},"table-cell-line enter":{key:"Enter",shiftKey:null,format:["table-cell-line"],handler(e,t){if(this.quill.selection&&this.quill.selection.composing)return;const n=r.a.imports.parchment.Scope;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);const o=Object.keys(t.format).reduce((e,o)=>(this.quill.scroll.query(o,n.BLOCK)&&!Array.isArray(t.format[o])&&(e[o]=t.format[o]),e),{});this.quill.insertText(e.index,"\n",o["table-cell-line"],r.a.sources.USER),this.quill.setSelection(e.index+1,r.a.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach(e=>{null==o[e]&&(Array.isArray(t.format[e])||"link"!==e&&this.quill.format(e,t.format[e],r.a.sources.USER))})}}};t.default=be}]).default});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("quill")):"function"==typeof define&&define.amd?define(["quill"],t):"object"==typeof exports?exports.quillBetterTable=t(require("quill")):e.quillBetterTable=t(e.Quill)}(window,function(e){return function(e){var t=window.webpackHotUpdatequillBetterTable;window.webpackHotUpdatequillBetterTable=function(e,o){!function(e,t){if(!x[e]||!y[e])return;for(var o in y[e]=!1,t)Object.prototype.hasOwnProperty.call(t,o)&&(f[o]=t[o]);0==--g&&0===w&&A()}(e,o),t&&t(e,o)};var o,n=!0,r="6ee4fda4fcab029b933f",i=1e4,l={},s=[],a=[];function c(e){var t=S[e];if(!t)return T;var n=function(n){return t.hot.active?(S[n]?-1===S[n].parents.indexOf(e)&&S[n].parents.push(e):(s=[e],o=n),-1===t.children.indexOf(n)&&t.children.push(n)):(console.warn("[HMR] unexpected require("+n+") from disposed module "+e),s=[]),T(n)},r=function(e){return{configurable:!0,enumerable:!0,get:function(){return T[e]},set:function(t){T[e]=t}}};for(var i in T)Object.prototype.hasOwnProperty.call(T,i)&&"e"!==i&&"t"!==i&&Object.defineProperty(n,i,r(i));return n.e=function(e){return"ready"===u&&p("prepare"),w++,T.e(e).then(t,function(e){throw t(),e});function t(){w--,"prepare"===u&&(v[e]||q(e),0===w&&0===g&&A())}},n.t=function(e,t){return 1&t&&(e=n(e)),T.t(e,-2&t)},n}function d(e){var t={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_disposeHandlers:[],_main:o!==e,active:!0,accept:function(e,o){if(void 0===e)t._selfAccepted=!0;else if("function"==typeof e)t._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)t._acceptedDependencies[e[n]]=o||function(){};else t._acceptedDependencies[e]=o||function(){}},decline:function(e){if(void 0===e)t._selfDeclined=!0;else if("object"==typeof e)for(var o=0;o<e.length;o++)t._declinedDependencies[e[o]]=!0;else t._declinedDependencies[e]=!0},dispose:function(e){t._disposeHandlers.push(e)},addDisposeHandler:function(e){t._disposeHandlers.push(e)},removeDisposeHandler:function(e){var o=t._disposeHandlers.indexOf(e);o>=0&&t._disposeHandlers.splice(o,1)},check:C,apply:E,status:function(e){if(!e)return u;h.push(e)},addStatusHandler:function(e){h.push(e)},removeStatusHandler:function(e){var t=h.indexOf(e);t>=0&&h.splice(t,1)},data:l[e]};return o=void 0,t}var h=[],u="idle";function p(e){u=e;for(var t=0;t<h.length;t++)h[t].call(null,e)}var m,f,b,g=0,w=0,v={},y={},x={};function N(e){return+e+""===e?+e:e}function C(e){if("idle"!==u)throw new Error("check() is only allowed in idle status");return n=e,p("check"),(t=i,t=t||1e4,new Promise(function(e,o){if("undefined"==typeof XMLHttpRequest)return o(new Error("No browser support"));try{var n=new XMLHttpRequest,i=T.p+""+r+".hot-update.json";n.open("GET",i,!0),n.timeout=t,n.send(null)}catch(e){return o(e)}n.onreadystatechange=function(){if(4===n.readyState)if(0===n.status)o(new Error("Manifest request to "+i+" timed out."));else if(404===n.status)e();else if(200!==n.status&&304!==n.status)o(new Error("Manifest request to "+i+" failed."));else{try{var t=JSON.parse(n.responseText)}catch(e){return void o(e)}e(t)}}})).then(function(e){if(!e)return p("idle"),null;y={},v={},x=e.c,b=e.h,p("prepare");var t=new Promise(function(e,t){m={resolve:e,reject:t}});f={};return q(0),"prepare"===u&&0===w&&0===g&&A(),t});var t}function q(e){x[e]?(y[e]=!0,g++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=T.p+""+e+"."+r+".hot-update.js",document.head.appendChild(t)}(e)):v[e]=!0}function A(){p("ready");var e=m;if(m=null,e)if(n)Promise.resolve().then(function(){return E(n)}).then(function(t){e.resolve(t)},function(t){e.reject(t)});else{var t=[];for(var o in f)Object.prototype.hasOwnProperty.call(f,o)&&t.push(N(o));e.resolve(t)}}function E(t){if("ready"!==u)throw new Error("apply() is only allowed in ready status");var o,n,i,a,c;function d(e){for(var t=[e],o={},n=t.map(function(e){return{chain:[e],id:e}});n.length>0;){var r=n.pop(),i=r.id,l=r.chain;if((a=S[i])&&!a.hot._selfAccepted){if(a.hot._selfDeclined)return{type:"self-declined",chain:l,moduleId:i};if(a.hot._main)return{type:"unaccepted",chain:l,moduleId:i};for(var s=0;s<a.parents.length;s++){var c=a.parents[s],d=S[c];if(d){if(d.hot._declinedDependencies[i])return{type:"declined",chain:l.concat([c]),moduleId:i,parentId:c};-1===t.indexOf(c)&&(d.hot._acceptedDependencies[i]?(o[c]||(o[c]=[]),h(o[c],[i])):(delete o[c],t.push(c),n.push({chain:l.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:o}}function h(e,t){for(var o=0;o<t.length;o++){var n=t[o];-1===e.indexOf(n)&&e.push(n)}}t=t||{};var m={},g=[],w={},v=function(){console.warn("[HMR] unexpected require("+C.moduleId+") to disposed module")};for(var y in f)if(Object.prototype.hasOwnProperty.call(f,y)){var C;c=N(y);var q=!1,A=!1,E=!1,H="";switch((C=f[y]?d(c):{type:"disposed",moduleId:y}).chain&&(H="\nUpdate propagation: "+C.chain.join(" -> ")),C.type){case"self-declined":t.onDeclined&&t.onDeclined(C),t.ignoreDeclined||(q=new Error("Aborted because of self decline: "+C.moduleId+H));break;case"declined":t.onDeclined&&t.onDeclined(C),t.ignoreDeclined||(q=new Error("Aborted because of declined dependency: "+C.moduleId+" in "+C.parentId+H));break;case"unaccepted":t.onUnaccepted&&t.onUnaccepted(C),t.ignoreUnaccepted||(q=new Error("Aborted because "+c+" is not accepted"+H));break;case"accepted":t.onAccepted&&t.onAccepted(C),A=!0;break;case"disposed":t.onDisposed&&t.onDisposed(C),E=!0;break;default:throw new Error("Unexception type "+C.type)}if(q)return p("abort"),Promise.reject(q);if(A)for(c in w[c]=f[c],h(g,C.outdatedModules),C.outdatedDependencies)Object.prototype.hasOwnProperty.call(C.outdatedDependencies,c)&&(m[c]||(m[c]=[]),h(m[c],C.outdatedDependencies[c]));E&&(h(g,[C.moduleId]),w[c]=v)}var M,B=[];for(n=0;n<g.length;n++)c=g[n],S[c]&&S[c].hot._selfAccepted&&w[c]!==v&&B.push({module:c,errorHandler:S[c].hot._selfAccepted});p("dispose"),Object.keys(x).forEach(function(e){!1===x[e]&&function(e){delete installedChunks[e]}(e)});for(var O,L,R=g.slice();R.length>0;)if(c=R.pop(),a=S[c]){var z={},k=a.hot._disposeHandlers;for(i=0;i<k.length;i++)(o=k[i])(z);for(l[c]=z,a.hot.active=!1,delete S[c],delete m[c],i=0;i<a.children.length;i++){var I=S[a.children[i]];I&&((M=I.parents.indexOf(c))>=0&&I.parents.splice(M,1))}}for(c in m)if(Object.prototype.hasOwnProperty.call(m,c)&&(a=S[c]))for(L=m[c],i=0;i<L.length;i++)O=L[i],(M=a.children.indexOf(O))>=0&&a.children.splice(M,1);for(c in p("apply"),r=b,w)Object.prototype.hasOwnProperty.call(w,c)&&(e[c]=w[c]);var D=null;for(c in m)if(Object.prototype.hasOwnProperty.call(m,c)&&(a=S[c])){L=m[c];var j=[];for(n=0;n<L.length;n++)if(O=L[n],o=a.hot._acceptedDependencies[O]){if(-1!==j.indexOf(o))continue;j.push(o)}for(n=0;n<j.length;n++){o=j[n];try{o(L)}catch(e){t.onErrored&&t.onErrored({type:"accept-errored",moduleId:c,dependencyId:L[n],error:e}),t.ignoreErrored||D||(D=e)}}}for(n=0;n<B.length;n++){var V=B[n];c=V.module,s=[c];try{T(c)}catch(e){if("function"==typeof V.errorHandler)try{V.errorHandler(e)}catch(o){t.onErrored&&t.onErrored({type:"self-accept-error-handler-errored",moduleId:c,error:o,originalError:e}),t.ignoreErrored||D||(D=o),D||(D=e)}else t.onErrored&&t.onErrored({type:"self-accept-errored",moduleId:c,error:e}),t.ignoreErrored||D||(D=e)}}return D?(p("fail"),Promise.reject(D)):(p("idle"),new Promise(function(e){e(g)}))}var S={};function T(t){if(S[t])return S[t].exports;var o=S[t]={i:t,l:!1,exports:{},hot:d(t),parents:(a=s,s=[],a),children:[]};return e[t].call(o.exports,o,o.exports,c(t)),o.l=!0,o.exports}return T.m=e,T.c=S,T.d=function(e,t,o){T.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},T.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},T.t=function(e,t){if(1&t&&(e=T(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(T.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)T.d(o,n,function(t){return e[t]}.bind(null,n));return o},T.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return T.d(t,"a",t),t},T.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},T.p="",T.h=function(){return r},c(10)(T.s=10)}([function(t,o){t.exports=e},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M73.142857 336.64h526.628572v43.885714H73.142857zM73.142857 643.657143h526.628572v43.885714H73.142857zM336.457143 117.028571h43.885714v789.942858h-43.885714zM204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.771429 87.771429 0 0 0 87.771429 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM819.2 73.142857h-219.428571v877.714286h219.428571a131.657143 131.657143 0 0 0 131.657143-131.657143V204.8A131.84 131.84 0 0 0 819.2 73.142857z m44.068571 460.982857h-65.828571v65.828572H753.371429v-65.828572h-65.828572V490.057143h65.828572v-65.828572h44.068571v65.828572h65.828571z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M380.342857 336.457143h526.811429v43.885714H380.342857z m0 307.2h526.811429v43.885714H380.342857zM643.657143 117.028571h43.885714v789.942858h-43.885714zM204.8 73.142857h614.582857A131.474286 131.474286 0 0 1 950.857143 204.8v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.657143 131.657143 0 0 1 204.8 73.142857z m0 43.885714a87.588571 87.588571 0 0 0-87.588571 87.771429v614.4a87.588571 87.588571 0 0 0 87.588571 87.771429h614.582857a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM204.8 73.142857A131.657143 131.657143 0 0 0 73.142857 204.8v614.4a131.657143 131.657143 0 0 0 131.657143 131.657143h219.428571V73.142857z m131.84 460.8h-65.828571v65.828572h-43.885715v-65.828572h-65.828571v-43.885714h65.828571v-65.828572h43.885715v65.828572h65.828571z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M73.142857 599.771429h877.714286v43.885714H73.142857zM336.457143 380.342857h43.885714v526.628572h-43.885714z m307.2 0h43.885714v526.628572h-43.885714zM204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.657143 131.657143 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.588571 87.588571 0 0 0 87.771429 87.771429h614.4a87.588571 87.588571 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM819.2 73.142857H204.8A131.657143 131.657143 0 0 0 73.142857 204.8v219.428571h877.714286v-219.428571A131.657143 131.657143 0 0 0 819.2 73.142857z m-219.428571 197.485714h-65.828572v65.828572h-43.885714v-65.828572h-65.828572v-43.885714h65.828572V160.914286h43.885714v65.828571h65.828572z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M204.8 73.142857h614.4a131.657143 131.657143 0 0 1 131.657143 131.657143v614.4a131.657143 131.657143 0 0 1-131.657143 131.657143H204.8A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.8 73.142857z m0 43.885714a87.771429 87.771429 0 0 0-87.771429 87.771429v614.4a87.771429 87.771429 0 0 0 87.771429 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM73.142857 336.457143h877.714286v44.068571H73.142857zM336.64 117.028571h43.885714v526.628572h-43.885714z m307.017143 0h44.068571v526.628572H643.657143zM73.142857 599.771429v219.428571a131.657143 131.657143 0 0 0 131.657143 131.657143h614.4a131.657143 131.657143 0 0 0 131.657143-131.657143v-219.428571z m526.628572 197.485714h-65.645715v65.828571H490.057143v-65.828571h-65.828572v-43.885714h65.828572v-65.828572h44.068571v65.828572h65.645715z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M925.99596 99.038384c-25.470707-25.6-60.121212-39.822222-96.323233-39.822222H194.19798c-36.072727 0-70.723232 14.351515-96.323233 39.822222-25.6 25.6-39.822222 60.121212-39.822222 96.323232v635.474748c0 36.072727 14.351515 70.723232 39.822222 96.323232C123.474747 952.759596 158.125253 967.111111 194.19798 967.111111h635.474747c36.072727 0 70.723232-14.351515 96.323233-39.951515 25.6-25.6 39.951515-60.121212 39.951515-96.323232V195.361616c0-36.072727-14.351515-70.723232-39.951515-96.323232z m-277.850505 5.559596v226.909091H375.725253V104.59798h272.420202zM103.434343 195.361616c0-24.048485 9.567677-47.191919 26.634344-64.129293 17.066667-17.066667 40.080808-26.634343 64.129293-26.634343h136.145454v226.909091H103.434343V195.361616z m90.763637 726.367677c-24.048485 0-47.191919-9.567677-64.129293-26.634344-17.066667-17.066667-26.634343-40.080808-26.634344-64.129292V649.309091h226.909091v272.420202H194.19798z m181.527273 0V649.309091h272.290909v272.420202H375.725253z m544.711111-90.892929c0 24.048485-9.567677 47.191919-26.634344 64.129293-17.066667 17.066667-40.080808 26.634343-64.129293 26.634343H693.527273V649.309091h226.909091v181.527273zM693.527273 331.507071V104.59798h136.145454c24.048485 0 47.191919 9.567677 64.129293 26.634343 17.066667 17.066667 26.634343 40.080808 26.634344 64.129293v136.145455H693.527273z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M336.457143 73.142857h43.885714v877.714286h-43.885714z m307.382857 0h43.702857v877.714286h-43.702857z m-438.857143 0h614.4A131.657143 131.657143 0 0 1 950.857143 204.8v614.4a131.474286 131.474286 0 0 1-131.474286 131.657143h-614.4A131.657143 131.657143 0 0 1 73.142857 819.2V204.8A131.84 131.84 0 0 1 204.982857 73.142857z m0 43.885714a87.588571 87.588571 0 0 0-87.771428 87.771429v614.4a87.588571 87.588571 0 0 0 87.771428 87.771429h614.4a87.771429 87.771429 0 0 0 87.771429-87.771429V204.8a87.771429 87.771429 0 0 0-87.771429-87.771429zM73.142857 336.457143h877.714286v307.2H73.142857z m292.571429 43.885714v219.428572h292.571428v-219.428572z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M925.996 99.038c-25.47-25.6-60.121-39.822-96.323-39.822H194.198c-75.12 0.13-136.016 61.026-136.145 136.146v635.345c0 36.073 14.351 70.723 39.822 96.323 25.6 25.73 60.25 40.081 96.323 40.081h635.475c36.072 0 70.723-14.351 96.323-39.951 25.6-25.6 39.951-60.122 39.951-96.324V195.362c0-36.073-14.351-70.724-39.951-96.324z m-365.77 494.287L512 545.228l-48.226 48.097-32.194-31.935 48.355-48.226-48.226-48.097 32.194-32.194L512 480.97l48.097-48.097 32.194 32.194-48.097 48.097 48.226 48.226-32.194 31.935zM103.434 195.362c0-24.049 9.568-47.192 26.635-64.13 17.066-17.066 40.08-26.634 64.129-26.634h136.145v226.91H103.434V195.361z m0 181.656h226.91V649.31h-226.91V377.02z m90.764 544.84c-24.049 0-47.192-9.567-64.13-26.634-17.066-17.066-26.634-40.08-26.634-64.258V694.69h226.91v227.168H194.197z m726.238-90.763c0 24.048-9.438 47.192-26.505 64.259-17.066 17.066-40.21 26.634-64.258 26.505H693.527V694.69h226.91v136.404z m0-181.786H693.527V377.02h226.91v272.29zM693.527 331.507V104.598h136.146c24.048 0 47.192 9.438 64.258 26.505 17.067 17.067 26.635 40.21 26.505 64.259v136.145H693.527z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M925.99596 99.038384c-25.470707-25.6-60.121212-39.822222-96.323233-39.822222H194.19798c-36.072727 0-70.723232 14.351515-96.323233 39.822222-25.6 25.6-39.822222 60.121212-39.822222 96.323232v635.474748c0 36.072727 14.351515 70.723232 39.822222 96.323232C123.474747 952.759596 158.125253 967.111111 194.19798 967.111111h635.474747c36.072727 0 70.723232-14.351515 96.323233-39.951515 25.6-25.6 39.951515-60.121212 39.951515-96.323232V195.361616c0-36.072727-14.351515-70.723232-39.951515-96.323232z m-550.270707 5.559596h272.290909v227.167677H375.725253V104.59798z m56.242424 360.468687l31.935353-32.19394 48.09697 48.226263 48.09697-48.226263 32.193939 32.19394-48.09697 48.096969 48.226263 48.226263-32.193939 31.935354-48.226263-48.09697-48.226263 48.09697-31.935353-31.935354 48.226262-48.226263-48.096969-48.096969zM103.434343 195.361616c0-24.048485 9.567677-47.191919 26.634344-64.129293 17.066667-17.066667 40.080808-26.634343 64.129293-26.634343h136.145454v227.167677H103.434343V195.361616z m817.002021 635.733333c0 24.048485-9.567677 47.191919-26.634344 64.258586-17.066667 17.066667-40.080808 26.634343-64.129293 26.634344H194.19798c-24.048485 0-47.191919-9.567677-64.258586-26.634344C112.872727 878.157576 103.434343 855.014141 103.434343 830.836364V694.690909h226.909091v226.909091h45.381819V694.690909h272.290909v226.909091h45.381818V694.690909h226.909091v136.40404z m0-499.329292H693.527273V104.59798h136.145454c24.048485 0 47.191919 9.567677 64.129293 26.634343 17.066667 17.066667 26.634343 40.080808 26.634344 64.129293v136.404041z"/></svg>'},function(e,t){e.exports='<?xml version="1.0" standalone="no"?><!doctype html><svg class=icon width=20px height=20.00px viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg><path fill=#595959 d="M764.42168889 830.5152c0 30.23530667-24.61013333 54.84430222-54.84316444 54.84430222H314.42147555c-30.23416889 0-54.84316445-24.61013333-54.84316444-54.84430222V248.32796445h504.84337778v582.18723555zM369.26577778 149.89084445c0-6.32832 4.92202667-11.25034667 11.25034667-11.25034667H644.18702222c6.32832 0 11.25034667 4.92202667 11.25034667 11.25034667v33.04675555H369.26577778V149.89084445z m559.68768 33.04675555H720.82773333V149.89084445c0-42.1888-34.45191111-76.64071111-76.64071111-76.64071112H380.51612445c-42.1888 0-76.64071111 34.45191111-76.64071112 76.64071112v33.04675555h-208.82773333c-18.28181333 0-33.04789333 14.76608-33.04789333 33.04675555s14.76608 33.04675555 33.04675555 33.04675556h98.43825778v581.48408889c0 66.79779555 54.14001778 120.93781333 120.93667555 120.93781333h395.1570489c66.79665778 0 120.93667555-54.14001778 120.93667555-120.93781333V248.32796445h98.43825778c18.28067555 0 33.04675555-14.76494222 33.04675555-33.04675556s-14.76608-32.34360889-33.04675555-32.34360889zM512 786.21923555c18.28181333 0 33.04675555-14.76608 33.04675555-33.04789333v-351.56195555c0-18.28181333-14.76494222-33.04675555-33.04675555-33.04675556s-33.04675555 14.76494222-33.04675555 33.04675556v351.56195555c0 18.28181333 14.76494222 33.04789333 33.04675555 33.04789333m-153.98456889 0c18.28181333 0 33.04675555-14.76608 33.04675556-33.04789333v-351.56195555c0-18.28181333-14.76494222-33.04675555-33.04675556-33.04675556s-33.04675555 14.76494222-33.04675556 33.04675556v351.56195555c0.70314667 18.28181333 15.46922667 33.04789333 33.04675556 33.04789333m307.96913778 0c18.28067555 0 33.04675555-14.76608 33.04675556-33.04789333v-351.56195555c0-18.28181333-14.76608-33.04675555-33.04675556-33.04675556s-33.04675555 14.76494222-33.04675556 33.04675556v351.56195555c0 18.28181333 14.76494222 33.04789333 33.04675556 33.04789333"/></svg>'},function(e,t,o){e.exports=o(11)},function(e,t,o){"use strict";o.r(t);var n=o(0),r=o.n(n);function i(e,t){if("object"==typeof t)for(let o in t)e.style[o]=t[o]}function l(e,t){let o=t.getBoundingClientRect();return{x:e.x-o.x-t.scrollLeft,y:e.y-o.y-t.scrollTop,x1:e.x-o.x-t.scrollLeft+e.width,y1:e.y-o.y-t.scrollTop+e.height,width:e.width,height:e.height}}function s(e,t){return e&&Object.keys(e).reduce((o,n)=>t.includes(n)?o:Object.assign({},o,{[n]:e[n]}),{})}function a(e){let t;if(null==(t=e.path||e.composedPath&&e.composedPath())&&e.target){t=[];let o=e.target;for(t.push(o);o&&o.parentNode;)o=o.parentNode,t.push(o)}return t}const c=12,d=12,h=50,u="#35A7ED";class p{constructor(e,t,o){if(!e)return null;this.table=e,this.quill=t,this.options=o,this.domNode=null,this.initColTool()}initColTool(){const e=this.quill.root.parentNode,t=(this.table.getBoundingClientRect(),e.getBoundingClientRect()),o=this.table.parentNode.getBoundingClientRect();this.domNode=document.createElement("div"),this.domNode.classList.add("qlbt-col-tool"),this.updateToolCells(),e.appendChild(this.domNode),i(this.domNode,{width:"".concat(o.width,"px"),height:"".concat(c,"px"),left:"".concat(o.left-t.left+e.scrollLeft,"px"),top:"".concat(o.top-t.top+e.scrollTop-c-5,"px")})}createToolCell(){const e=document.createElement("div");e.classList.add("qlbt-col-tool-cell");const t=document.createElement("div");return t.classList.add("qlbt-col-tool-cell-holder"),i(e,{height:"".concat(d,"px")}),e.appendChild(t),e}updateToolCells(){const e=r.a.find(this.table),t=e.children.tail.children.head.children,o=e.colGroup().children,n=function(e){return e.reduce((e,t)=>{const o=t.formats().colspan;return e+=parseInt(o,10)},0)}(t);let l=Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell"));for(let e=0;e<Math.max(n,l.length);e++){let t=o.at(e),r=t&&parseInt(t.formats()[t.statics.blotName].width,10),s=null;l[e]?l[e]&&e>=n?l[e].remove():i(s=l[e],{"min-width":"".concat(r,"px")}):(s=this.createToolCell(),this.domNode.appendChild(s),this.addColCellHolderHandler(s),i(s,{"min-width":"".concat(r,"px")}))}}destroy(){return this.domNode.remove(),null}addColCellHolderHandler(e){const t=r.a.find(this.table),o=e.querySelector(".qlbt-col-tool-cell-holder");let n=!1,l=0,s=0,a=0,d=0,p={},m={},f=null;const b=e=>{e.preventDefault(),n&&(s=e.clientX,a=d+s-l>=h?s-l:h-d,i(f,{left:"".concat(m.left+m.width-1+a,"px")}))},g=r=>{r.preventDefault();const c=Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell")).indexOf(e),h=t.colGroup().children.at(c);n&&(h.format("width",d+a),i(e,{"min-width":"".concat(d+a,"px")}),l=0,s=0,a=0,d=0,n=!1,o.classList.remove("dragging")),document.removeEventListener("mousemove",b,!1),document.removeEventListener("mouseup",g,!1),p={},m={},f.remove(),f=null,t.updateTableWidth();const u=this.quill.getModule("better-table").tableSelection;u&&u.clearSelection()};o.addEventListener("mousedown",t=>{document.addEventListener("mousemove",b,!1),document.addEventListener("mouseup",g,!1),p=this.table.getBoundingClientRect(),m=e.getBoundingClientRect(),i(f=document.createElement("div"),{position:"fixed",top:"".concat(m.top,"px"),left:"".concat(m.left+m.width-1,"px"),zIndex:"100",height:"".concat(p.height+c+4,"px"),width:"1px",backgroundColor:u}),document.body.appendChild(f),n=!0,l=t.clientX,d=m.width,o.classList.add("dragging")},!1)}colToolCells(){return Array.from(this.domNode.querySelectorAll(".qlbt-col-tool-cell"))}}const m=r.a.import("blots/block");class f extends m{static create(e){"string"==typeof e&&(e={value:e});const t=super.create(e.value);return N.forEach(o=>{e[o]&&t.setAttribute("data-".concat(o),e[o])}),C.forEach(o=>{e[o]&&t.setAttribute("data-".concat(o),e[o])}),t}static formats(e){const t={};return t.value=this.tagName.indexOf(e.tagName)+1,C.concat(N).reduce((t,o)=>(e.hasAttribute("data-".concat(o))&&(t[o]=e.getAttribute("data-".concat(o))||void 0),t),t)}format(e,t){const{row:o,cell:n,rowspan:r,colspan:i}=f.formats(this.domNode);e===f.blotName?t?super.format(e,{value:t,row:o,cell:n,rowspan:r,colspan:i}):o?this.replaceWith(E.blotName,{row:o,cell:n,rowspan:r,colspan:i}):super.format(e,t):super.format(e,t)}optimize(e){const{row:t,rowspan:o,colspan:n}=f.formats(this.domNode);if(!t||this.parent instanceof S||this.wrap(S.blotName,{row:t,colspan:n,rowspan:o}),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove();this.cache={}}}f.blotName="header",f.tagName=["H1","H2","H3","H4","H5","H6"];var b=f;const g=r.a.import("blots/break"),w=r.a.import("blots/block"),v=r.a.import("blots/container"),y=["width"],x={width:100},N=["row","cell"],C=["rowspan","colspan"],q={rowspan:1,colspan:1},A=5;class E extends w{static create(e){const t=super.create(e);return N.forEach(o=>{let n="row"===o?R:z;t.setAttribute("data-".concat(o),e[o]||n())}),C.forEach(o=>{t.setAttribute("data-".concat(o),e[o]||q[o])}),e["cell-bg"]&&t.setAttribute("data-cell-bg",e["cell-bg"]),t}static formats(e){return C.concat(N).concat(["cell-bg"]).reduce((t,o)=>(e.hasAttribute("data-".concat(o))&&(t[o]=e.getAttribute("data-".concat(o))||void 0),t),{})}format(e,t){if(C.concat(N).indexOf(e)>-1)t?this.domNode.setAttribute("data-".concat(e),t):this.domNode.removeAttribute("data-".concat(e));else if("cell-bg"===e)t?this.domNode.setAttribute("data-cell-bg",t):this.domNode.removeAttribute("data-cell-bg");else if("header"===e){if(!t)return;const{row:o,cell:n,rowspan:r,colspan:i}=E.formats(this.domNode);super.format(e,{value:t,row:o,cell:n,rowspan:r,colspan:i})}else super.format(e,t)}optimize(e){const t=this.domNode.getAttribute("data-row"),o=this.domNode.getAttribute("data-rowspan"),n=this.domNode.getAttribute("data-colspan"),r=this.domNode.getAttribute("data-cell-bg");!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName,{row:t,colspan:n,rowspan:o,"cell-bg":r}),super.optimize(e)}tableCell(){return this.parent}}E.blotName="table-cell-line",E.ClassName="qlbt-cell-line",E.tagName="DIV";class S extends v{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats()[this.children.head.statics.blotName],t=this.children.tail.formats()[this.children.tail.statics.blotName],o=this.next.children.head.formats()[this.next.children.head.statics.blotName],n=this.next.children.tail.formats()[this.next.children.tail.statics.blotName];return e.cell===t.cell&&e.cell===o.cell&&e.cell===n.cell}return!1}static create(e){const t=super.create(e);return t.setAttribute("data-row",e.row),C.forEach(o=>{e[o]&&t.setAttribute(o,e[o])}),e["cell-bg"]&&(t.setAttribute("data-cell-bg",e["cell-bg"]),t.style.backgroundColor=e["cell-bg"]),t}static formats(e){const t={};return e.hasAttribute("data-row")&&(t.row=e.getAttribute("data-row")),e.hasAttribute("data-cell-bg")&&(t["cell-bg"]=e.getAttribute("data-cell-bg")),C.reduce((t,o)=>(e.hasAttribute(o)&&(t[o]=e.getAttribute(o)),t),t)}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}formats(){const e={};return this.domNode.hasAttribute("data-row")&&(e.row=this.domNode.getAttribute("data-row")),this.domNode.hasAttribute("data-cell-bg")&&(e["cell-bg"]=this.domNode.getAttribute("data-cell-bg")),C.reduce((e,t)=>(this.domNode.hasAttribute(t)&&(e[t]=this.domNode.getAttribute(t)),e),e)}toggleAttribute(e,t){t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e)}formatChildren(e,t){this.children.forEach(o=>{o.format(e,t)})}format(e,t){C.indexOf(e)>-1?(this.toggleAttribute(e,t),this.formatChildren(e,t)):["row"].indexOf(e)>-1?(this.toggleAttribute("data-".concat(e),t),this.formatChildren(e,t)):"cell-bg"===e?(this.toggleAttribute("data-cell-bg",t),this.formatChildren(e,t),this.domNode.style.backgroundColor=t||"initial"):super.format(e,t)}optimize(e){const t=this.domNode.getAttribute("data-row");!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName,{row:t}),super.optimize(e)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}S.blotName="table",S.tagName="TD";class T extends v{checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),o=this.next.children.head.formats(),n=this.next.children.tail.formats();return e.row===t.row&&e.row===o.row&&e.row===n.row}return!1}static create(e){const t=super.create(e);return t.setAttribute("data-row",e.row),t}formats(){return["row"].reduce((e,t)=>(this.domNode.hasAttribute("data-".concat(t))&&(e[t]=this.domNode.getAttribute("data-".concat(t))),e),{})}optimize(e){!this.statics.requiredContainer||this.parent instanceof this.statics.requiredContainer||this.wrap(this.statics.requiredContainer.blotName),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}T.blotName="table-row",T.tagName="TR";class H extends v{}H.blotName="table-body",H.tagName="TBODY";class M extends w{static create(e){let t=super.create(e);return y.forEach(o=>{t.setAttribute("".concat(o),e[o]||x[o])}),t}static formats(e){return y.reduce((t,o)=>(e.hasAttribute("".concat(o))&&(t[o]=e.getAttribute("".concat(o))||void 0),t),{})}format(e,t){y.indexOf(e)>-1?this.domNode.setAttribute("".concat(e),t||x[e]):super.format(e,t)}html(){return this.domNode.outerHTML}}M.blotName="table-col",M.tagName="col";class B extends v{}B.blotName="table-col-group",B.tagName="colgroup";class O extends v{static create(){return super.create()}constructor(e,t){super(e,t),this.updateTableWidth()}updateTableWidth(){setTimeout(()=>{const e=this.colGroup();if(!e)return;const t=e.children.reduce((e,t)=>e+=parseInt(t.formats()[M.blotName].width,10),0);this.domNode.style.width="".concat(t,"px")},0)}cells(e){return this.rows().map(t=>t.children.at(e))}colGroup(){return this.children.head}deleteColumns(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;const[n]=this.descendants(H);if(null==n||null==n.children.head)return;const r=this.descendants(S),i=[],s=[];if(r.forEach(t=>{const n=l(t.domNode.getBoundingClientRect(),o);n.x+A>e.x&&n.x1-A<e.x1?i.push(t):n.x<e.x+A&&n.x1>e.x1-A&&s.push(t)}),i.length===r.length)return this.tableDestroy(),!0;t.forEach(e=>{this.colGroup().children.at(t[0]).remove()}),i.forEach(e=>{e.remove()}),s.forEach(e=>{const o=parseInt(e.formats().colspan,10);parseInt(e.formats().width,10);e.format("colspan",o-t.length)}),this.updateTableWidth()}deleteRow(e,t){const[o]=this.descendants(H);if(null==o||null==o.children.head)return;const n=this.descendants(S),r=[],i=[],s=[];if(n.forEach(o=>{const n=l(o.domNode.getBoundingClientRect(),t);n.y>e.y-A&&n.y1<e.y1+A?r.push(o):n.y<e.y+A&&n.y1>e.y1-A&&(i.push(o),Math.abs(n.y-e.y)<A&&s.push(o))}),r.length===n.length)return void this.tableDestroy();const a=this.rows().reduce((o,n)=>{let r=l(n.domNode.getBoundingClientRect(),t);return r.y>e.y-A&&r.y1<e.y1+A&&(o+=1),o},0);s.forEach(e=>{const o=l(e.domNode.getBoundingClientRect(),t),n=e.parent.next,r=n.children.reduce((e,n)=>{const r=l(n.domNode.getBoundingClientRect(),t);return Math.abs(o.x1-r.x)<A&&(e=n),e},null);n.insertBefore(e,r),e.format("row",n.formats().row)}),r.forEach(e=>{e.remove()}),i.forEach(e=>{const t=parseInt(e.formats().rowspan,10);e.format("rowspan",t-a)})}tableDestroy(){const e=r.a.find(this.scroll.domNode.parentNode),t=e.getModule("better-table");this.remove(),t.hideTableTools(),e.update(r.a.sources.USER)}insertCell(e,t){const o=z(),n=e.formats().row,r=this.scroll.create(S.blotName,Object.assign({},q,{row:n})),i=this.scroll.create(E.blotName,{row:n,cell:o});r.appendChild(i),t?e.insertBefore(r,t):e.appendChild(r)}insertColumn(e,t){let o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0;const[r]=this.descendants(H),[i]=this.descendants(B),s=this.descendants(M);let a=[],c=[],d=[];if(null==r||null==r.children.head)return;this.descendants(S).forEach(t=>{const r=l(t.domNode.getBoundingClientRect(),n);o?Math.abs(r.x1-e.x1)<A?a.push(t):e.x1-r.x>A&&e.x1-r.x1<-A&&c.push(t):Math.abs(r.x-e.x)<A?a.push(t):e.x-r.x>A&&e.x-r.x1<-A&&c.push(t)}),a.forEach(e=>{const t=o?e.next:e,n=z(),r=e.parent,i=r.formats().row,l=e.formats(),s=this.scroll.create(S.blotName,Object.assign({},q,{row:i,rowspan:l.rowspan})),a=this.scroll.create(E.blotName,{row:i,cell:n,rowspan:l.rowspan});s.appendChild(a),t?r.insertBefore(s,t):r.appendChild(s),d.push(s)});const h=this.scroll.create(M.blotName,!0);let u=o?s[t].next:s[t];return u?i.insertBefore(h,u):i.appendChild(h),c.forEach(e=>{const t=e.formats().colspan;e.format("colspan",parseInt(t,10)+1),d.push(e)}),d.sort((e,t)=>{return e.domNode.getBoundingClientRect().y-t.domNode.getBoundingClientRect().y}),this.updateTableWidth(),d}insertRow(e,t,o){const[n]=this.descendants(H);if(null==n||null==n.children.head)return;const r=this.descendants(S),i=R(),s=this.scroll.create(T.blotName,{row:i});let a=[],c=[],d=[];r.forEach(n=>{const r=l(n.domNode.getBoundingClientRect(),o);t?Math.abs(r.y1-e.y1)<A?a.push(n):e.y1-r.y>A&&e.y1-r.y1<-A&&c.push(n):Math.abs(r.y-e.y)<A?a.push(n):e.y-r.y>A&&e.y-r.y1<-A&&c.push(n)});const h=(e,t)=>{return e.domNode.getBoundingClientRect().x-t.domNode.getBoundingClientRect().x};a.sort(h),a.forEach(e=>{const t=z(),o=e.formats(),n=this.scroll.create(S.blotName,Object.assign({},q,{row:i,colspan:o.colspan})),r=this.scroll.create(E.blotName,{row:i,cell:t,colspan:o.colspan}),l=this.scroll.create(g.blotName);r.appendChild(l),n.appendChild(r),s.appendChild(n),d.push(n)}),c.forEach(e=>{const t=parseInt(e.formats().rowspan,10);e.format("rowspan",t+1),d.push(e)});const u=this.rows().find(n=>{let r=l(n.domNode.getBoundingClientRect(),o);return t?Math.abs(r.y-e.y-e.height)<A:Math.abs(r.y-e.y)<A});return n.insertBefore(s,u),d.sort(h),d}mergeCells(e,t,o,n,r){const i=t.reduce((e,t,r)=>(0!==r?(e&&t.moveChildren(e),t.remove()):(t.format("colspan",n),t.format("rowspan",o),e=t),e),null);let l=i.domNode.getAttribute("data-row"),s=i.children.head.domNode.getAttribute("data-cell");return i.children.forEach(e=>{e.format("cell",s),e.format("row",l),e.format("colspan",n),e.format("rowspan",o)}),i}unmergeCells(e,t){let o={},n=1,r=1;e.forEach(e=>{if(o=e.formats(),n=o.rowspan,(r=o.colspan)>1){let t=e.next,o=e.row();e.format("colspan",1);for(let e=r;e>1;e--)this.insertCell(o,t)}if(n>1){let o=n,i=e.row().next;for(;o>1;){let n=i.children.reduce((o,n)=>{let r=l(e.domNode.getBoundingClientRect(),t),i=l(n.domNode.getBoundingClientRect(),t);return Math.abs(r.x1-i.x)<A&&(o=n),o},null);for(let e=r;e>0;e--)this.insertCell(i,n);o-=1,i=i.next}e.format("rowspan",1)}})}rows(){const e=this.children.tail;return null==e?[]:e.children.map(e=>e)}}O.blotName="table-container",O.className="quill-better-table",O.tagName="TABLE";class L extends v{constructor(e,t){super(e,t);const o=r.a.find(e.domNode.parentNode);t.addEventListener("scroll",e=>{const t=o.getModule("better-table");t.columnTool&&(t.columnTool.domNode.scrollLeft=e.target.scrollLeft),t.tableSelection&&t.tableSelection.selectedTds.length>0&&t.tableSelection.repositionHelpLines()},!1)}}function R(){const e=Math.random().toString(36).slice(2,6);return"row-".concat(e)}function z(){const e=Math.random().toString(36).slice(2,6);return"cell-".concat(e)}L.blotName="table-view",L.className="quill-better-table-wrapper",L.tagName="DIV",L.allowedChildren=[O],O.requiredContainer=L,O.allowedChildren=[H,B],H.requiredContainer=O,H.allowedChildren=[T],T.requiredContainer=H,T.allowedChildren=[S],S.requiredContainer=T,S.allowedChildren=[E,b],E.requiredContainer=S,B.allowedChildren=[M],B.requiredContainer=O,M.requiredContainer=B;const k="#0589f3",I=["left","right","top","bottom"],D=2;class j{constructor(e,t,o){if(!e)return null;this.table=e,this.quill=t,this.options=o,this.boundary={},this.selectedTds=[],this.dragging=!1,this.selectingHandler=this.mouseDownHandler.bind(this),this.clearSelectionHanler=this.clearSelection.bind(this),this.helpLinesInitial(),this.quill.root.addEventListener("mousedown",this.selectingHandler,!1),this.quill.on("text-change",this.clearSelectionHanler)}helpLinesInitial(){let e=this.quill.root.parentNode;I.forEach(t=>{this[t]=document.createElement("div"),this[t].classList.add("qlbt-selection-line"),this[t].classList.add("qlbt-selection-line-"+t),i(this[t],{position:"absolute",display:"none","background-color":k}),e.appendChild(this[t])})}mouseDownHandler(e){if(0!==e.button||!e.target.closest(".quill-better-table"))return;this.quill.root.addEventListener("mousemove",r,!1),this.quill.root.addEventListener("mouseup",function e(o){t.quill.root.removeEventListener("mousemove",r,!1);t.quill.root.removeEventListener("mouseup",e,!1);t.dragging=!1},!1);const t=this,o=e.target.closest("td[data-row]"),n=l(o.getBoundingClientRect(),this.quill.root.parentNode);function r(e){if(0!==e.button||!e.target.closest(".quill-better-table"))return;const r=e.target.closest("td[data-row]"),i=l(r.getBoundingClientRect(),t.quill.root.parentNode);t.boundary=V(n,i),t.correctBoundary(),t.selectedTds=t.computeSelectedTds(),t.repositionHelpLines(),o!==r&&t.quill.blur()}this.dragging=!0,this.boundary=V(n,n),this.correctBoundary(),this.selectedTds=this.computeSelectedTds(),this.repositionHelpLines()}correctBoundary(){r.a.find(this.table).descendants(S).forEach(e=>{let{x:t,y:o,width:n,height:r}=l(e.domNode.getBoundingClientRect(),this.quill.root.parentNode);(t+D>=this.boundary.x&&t+D<=this.boundary.x1||t-D+n>=this.boundary.x&&t-D+n<=this.boundary.x1)&&(o+D>=this.boundary.y&&o+D<=this.boundary.y1||o-D+r>=this.boundary.y&&o-D+r<=this.boundary.y1)&&(this.boundary=V(this.boundary,{x:t,y:o,width:n,height:r}))})}computeSelectedTds(){return r.a.find(this.table).descendants(S).reduce((e,t)=>{let{x:o,y:n,width:r,height:i}=l(t.domNode.getBoundingClientRect(),this.quill.root.parentNode);return o+D>=this.boundary.x&&o-D+r<=this.boundary.x1&&n+D>=this.boundary.y&&n-D+i<=this.boundary.y1&&e.push(t),e},[])}repositionHelpLines(){const e=this.table.parentNode.scrollLeft;i(this.left,{display:"block",left:"".concat(this.boundary.x-e-1,"px"),top:"".concat(this.boundary.y,"px"),height:"".concat(this.boundary.height+1,"px"),width:"1px"}),i(this.right,{display:"block",left:"".concat(this.boundary.x1-e,"px"),top:"".concat(this.boundary.y,"px"),height:"".concat(this.boundary.height+1,"px"),width:"1px"}),i(this.top,{display:"block",left:"".concat(this.boundary.x-1-e,"px"),top:"".concat(this.boundary.y,"px"),width:"".concat(this.boundary.width+1,"px"),height:"1px"}),i(this.bottom,{display:"block",left:"".concat(this.boundary.x-1-e,"px"),top:"".concat(this.boundary.y1+1,"px"),width:"".concat(this.boundary.width+1,"px"),height:"1px"})}refreshHelpLinesPosition(){const e=l(this.selectedTds[0].domNode.getBoundingClientRect(),this.quill.root.parentNode),t=l(this.selectedTds[this.selectedTds.length-1].domNode.getBoundingClientRect(),this.quill.root.parentNode);this.boundary=V(e,t),this.repositionHelpLines()}destroy(){return I.forEach(e=>{this[e].remove(),this[e]=null}),this.quill.root.removeEventListener("mousedown",this.selectingHandler,!1),this.quill.off("text-change",this.clearSelectionHanler),null}setSelection(e,t){this.boundary=V(l(e,this.quill.root.parentNode),l(t,this.quill.root.parentNode)),this.correctBoundary(),this.selectedTds=this.computeSelectedTds(),this.repositionHelpLines()}clearSelection(){this.boundary={},this.selectedTds=[],I.forEach(e=>{this[e]&&i(this[e],{display:"none"})})}}function V(e,t){let o=Math.min(e.x,t.x,e.x+e.width-1,t.x+t.width-1),n=Math.max(e.x,t.x,e.x+e.width-1,t.x+t.width-1),r=Math.min(e.y,t.y,e.y+e.height-1,t.y+t.height-1),i=Math.max(e.y,t.y,e.y+e.height-1,t.y+t.height-1);return{x:o,x1:n,y:r,y1:i,width:n-o,height:i-r}}var _=o(1),U=o.n(_),P=o(2),W=o.n(P),G=o(3),X=o.n(G),K=o(4),Y=o.n(K),J=o(5),Q=o.n(J),$=o(6),F=o.n($),Z=o(7),ee=o.n(Z),te=o(8),oe=o.n(te),ne=o(9),re=o.n(ne);const ie=150,le=200,se=["white","red","yellow","blue"],ae="Background Colors",ce={insertColumnRight:{text:"Insert column right",iconSrc:U.a,handler(){const e=r.a.find(this.table);let t=he(this.columnToolCells,this.boundary,(e,t)=>Math.abs(e.x+e.width-t.x1)<=5,this.quill.root.parentNode);const o=e.insertColumn(this.boundary,t,!0,this.quill.root.parentNode);this.tableColumnTool.updateToolCells(),this.quill.update(r.a.sources.USER),this.quill.setSelection(this.quill.getIndex(o[0]),0,r.a.sources.SILENT),this.tableSelection.setSelection(o[0].domNode.getBoundingClientRect(),o[0].domNode.getBoundingClientRect())}},insertColumnLeft:{text:"Insert column left",iconSrc:W.a,handler(){const e=r.a.find(this.table);let t=he(this.columnToolCells,this.boundary,(e,t)=>Math.abs(e.x-t.x)<=5,this.quill.root.parentNode);const o=e.insertColumn(this.boundary,t,!1,this.quill.root.parentNode);this.tableColumnTool.updateToolCells(),this.quill.update(r.a.sources.USER),this.quill.setSelection(this.quill.getIndex(o[0]),0,r.a.sources.SILENT),this.tableSelection.setSelection(o[0].domNode.getBoundingClientRect(),o[0].domNode.getBoundingClientRect())}},insertRowUp:{text:"Insert row up",iconSrc:X.a,handler(){const e=r.a.find(this.table).insertRow(this.boundary,!1,this.quill.root.parentNode);this.quill.update(r.a.sources.USER),this.quill.setSelection(this.quill.getIndex(e[0]),0,r.a.sources.SILENT),this.tableSelection.setSelection(e[0].domNode.getBoundingClientRect(),e[0].domNode.getBoundingClientRect())}},insertRowDown:{text:"Insert row down",iconSrc:Y.a,handler(){const e=r.a.find(this.table).insertRow(this.boundary,!0,this.quill.root.parentNode);this.quill.update(r.a.sources.USER),this.quill.setSelection(this.quill.getIndex(e[0]),0,r.a.sources.SILENT),this.tableSelection.setSelection(e[0].domNode.getBoundingClientRect(),e[0].domNode.getBoundingClientRect())}},mergeCells:{text:"Merge selected cells",iconSrc:Q.a,handler(){const e=r.a.find(this.table),t=e.rows().reduce((e,t)=>{let o=l(t.domNode.getBoundingClientRect(),this.quill.root.parentNode);return o.y>this.boundary.y-5&&o.y+o.height<this.boundary.y+this.boundary.height+5&&(e+=1),e},0),o=this.columnToolCells.reduce((e,t)=>{let o=l(t.getBoundingClientRect(),this.quill.root.parentNode);return o.x>this.boundary.x-5&&o.x+o.width<this.boundary.x+this.boundary.width+5&&(e+=1),e},0),n=e.mergeCells(this.boundary,this.selectedTds,t,o,this.quill.root.parentNode);this.quill.update(r.a.sources.USER),this.tableSelection.setSelection(n.domNode.getBoundingClientRect(),n.domNode.getBoundingClientRect())}},unmergeCells:{text:"Unmerge cells",iconSrc:F.a,handler(){r.a.find(this.table).unmergeCells(this.selectedTds,this.quill.root.parentNode),this.quill.update(r.a.sources.USER),this.tableSelection.clearSelection()}},deleteColumn:{text:"Delete selected columns",iconSrc:ee.a,handler(){const e=r.a.find(this.table);let t=function(e,t,o,n){return e.reduce((r,i)=>{let s=l(i.getBoundingClientRect(),n);return o(s,t)&&r.push(e.indexOf(i)),r},[])}(this.columnToolCells,this.boundary,(e,t)=>e.x+5>t.x&&e.x+e.width-5<t.x1,this.quill.root.parentNode);e.deleteColumns(this.boundary,t,this.quill.root.parentNode)||(this.tableColumnTool.updateToolCells(),this.quill.update(r.a.sources.USER),this.tableSelection.clearSelection())}},deleteRow:{text:"Delete selected rows",iconSrc:oe.a,handler(){r.a.find(this.table).deleteRow(this.boundary,this.quill.root.parentNode),this.quill.update(r.a.sources.USER),this.tableSelection.clearSelection()}},deleteTable:{text:"Delete table",iconSrc:re.a,handler(){const e=this.quill.getModule("better-table"),t=r.a.find(this.table);e.hideTableTools(),t.remove(),this.quill.update(r.a.sources.USER)}}};class de{constructor(e,t,o){const n=t.getModule("better-table");this.tableSelection=n.tableSelection,this.table=e.table,this.quill=t,this.options=o,this.menuItems=Object.assign({},ce,o.items),this.tableColumnTool=n.columnTool,this.boundary=this.tableSelection.boundary,this.selectedTds=this.tableSelection.selectedTds,this.destroyHanlder=this.destroy.bind(this),this.columnToolCells=this.tableColumnTool.colToolCells(),this.colorSubTitle=o.color&&o.color.text?o.color.text:ae,this.cellColors=o.color&&o.color.colors?o.color.colors:se,this.menuInitial(e),this.mount(),document.addEventListener("click",this.destroyHanlder,!1)}mount(){document.body.appendChild(this.domNode)}destroy(){return this.domNode.remove(),document.removeEventListener("click",this.destroyHanlder,!1),null}menuInitial(e){let{table:t,left:o,top:n}=e;this.domNode=document.createElement("div"),this.domNode.classList.add("qlbt-operation-menu"),i(this.domNode,{position:"absolute",left:"".concat(o,"px"),top:"".concat(n,"px"),"min-height":"".concat(ie,"px"),width:"".concat(le,"px")});for(let e in this.menuItems)this.menuItems[e]&&(this.domNode.appendChild(this.menuItemCreator(Object.assign({},ce[e],this.menuItems[e]))),["insertRowDown","unmergeCells"].indexOf(e)>-1&&this.domNode.appendChild(r()));function r(){const e=document.createElement("div");return e.classList.add("qlbt-operation-menu-dividing"),e}this.options.color&&!1!==this.options.color&&(this.domNode.appendChild(r()),this.domNode.appendChild(function(e){const t=document.createElement("div");return t.classList.add("qlbt-operation-menu-subtitle"),t.innerText=e,t}(this.colorSubTitle)),this.domNode.appendChild(this.colorsItemCreator(this.cellColors)))}colorsItemCreator(e){const t=this,o=document.createElement("div");return o.classList.add("qlbt-operation-color-picker"),e.forEach(e=>{let n=function(e){const o=document.createElement("div");return o.classList.add("qlbt-operation-color-picker-item"),o.setAttribute("data-color",e),o.style.backgroundColor=e,o.addEventListener("click",function(){const o=t.tableSelection.selectedTds;o&&o.length>0&&o.forEach(t=>{t.format("cell-bg",e)})},!1),o}(e);o.appendChild(n)}),o}menuItemCreator(e){let{text:t,iconSrc:o,handler:n}=e;const r=document.createElement("div");r.classList.add("qlbt-operation-menu-item");const i=document.createElement("span");i.classList.add("qlbt-operation-menu-icon"),i.innerHTML=o;const l=document.createElement("span");return l.classList.add("qlbt-operation-menu-text"),l.innerText=t,r.appendChild(i),r.appendChild(l),r.addEventListener("click",n.bind(this),!1),r}}function he(e,t,o,n){return e.reduce((r,i)=>{let s=l(i.getBoundingClientRect(),n);return o(s,t)&&(r=e.indexOf(i)),r},!1)}const ue=r.a.import("delta");function pe(e,t,o){const n=e.parentNode,r="TABLE"===n.parentNode.tagName?n.parentNode:n.parentNode.parentNode,i=Array.from(r.querySelectorAll("tr")),l=Array.from(n.querySelectorAll("td")),a=i.indexOf(n)+1,c=l.indexOf(e)+1,d=e.getAttribute("colspan")||!1,h=e.getAttribute("rowspan")||!1,u=e.getAttribute("data-cell-bg");return 0===t.length()?t=(new ue).insert("\n",{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}}):(t=(t=t.reduce((e,t)=>(t.attributes.background===u?e.insert(t.insert,s(t.attributes,["background"])):e.insert(t.insert,t.attributes),e),new ue)).reduce((e,t)=>{if(t.insert&&"string"==typeof t.insert){const o=[];let n=t.insert,r=0;for(let e=0;e<t.insert.length;e++)"\n"===n.charAt(e)&&(0===e?o.push("\n"):(o.push(n.substring(r,e)),o.push("\n")),r=e+1);const i=n.substring(r);i&&o.push(i),o.forEach(o=>{"\n"===o?e.insert("\n",t.attributes):e.insert(o,s(t.attributes,["table","table-cell-line"]))})}else e.insert(t.insert,t.attributes);return e},new ue)).reduce((e,t)=>(t.insert&&"string"==typeof t.insert&&t.insert.startsWith("\n")?e.insert(t.insert,Object.assign({},Object.assign({},{row:a},t.attributes.table),{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}},s(t.attributes,["table"]))):e.insert(t.insert,Object.assign({},s(t.attributes,["table","table-cell-line"]))),e),new ue)}function me(e,t,o){const n=e.parentNode,r="TABLE"===n.parentNode.tagName?n.parentNode:n.parentNode.parentNode,i=Array.from(r.querySelectorAll("tr")),l=Array.from(n.querySelectorAll("th")),a=i.indexOf(n)+1,c=l.indexOf(e)+1,d=e.getAttribute("colspan")||!1,h=e.getAttribute("rowspan")||!1;return 0===t.length()?t=(new ue).insert("\n",{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}}):(t=t.reduce((e,t)=>{if(t.insert&&"string"==typeof t.insert){const o=[];let n=t.insert,r=0;for(let e=0;e<t.insert.length;e++)"\n"===n.charAt(e)&&(0===e?o.push("\n"):(o.push(n.substring(r,e)),o.push("\n")),r=e+1);const i=n.substring(r);i&&o.push(i),o.indexOf("\n")<0&&o.push("\n"),o.forEach(o=>{"\n"===o?e.insert("\n",{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}}):e.insert(o,t.attributes)})}else e.insert(t.insert,t.attributes);return e},new ue)).reduce((e,t)=>(t.insert&&"string"==typeof t.insert&&t.insert.startsWith("\n")?e.insert(t.insert,Object.assign({},{"table-cell-line":{row:a,cell:c,rowspan:h,colspan:d}})):e.insert(t.insert,Object.assign({},s(t.attributes,["table","table-cell-line"]))),e),new ue)}function fe(e,t,o){let n=new ue;const r=e.querySelector("tr");if(null===r)return n;const i=Array.from(r.querySelectorAll("td")).concat(Array.from(r.querySelectorAll("th"))).reduce((e,t)=>{const o=t.getAttribute("colspan")||1;return e+=parseInt(o,10)},0),l=e.querySelectorAll("col").length;if(l===i)return t;{for(let e=0;e<i-l;e++)n.insert("\n",{"table-col":!0});if(0===l)return n.concat(t);let e=0;return t.reduce((t,o)=>(t.insert(o.insert,o.attributes),o.attributes&&o.attributes["table-col"]&&(e+=o.insert.length)===l&&(t=t.concat(n)),t),new ue)}}const be=r.a.import("core/module"),ge=r.a.import("delta");class we extends be{static register(){r.a.register(M,!0),r.a.register(B,!0),r.a.register(E,!0),r.a.register(S,!0),r.a.register(T,!0),r.a.register(H,!0),r.a.register(O,!0),r.a.register(L,!0),r.a.register(L,!0)}constructor(e,t){super(e,t),this.quill.root.addEventListener("click",o=>{const n=a(o);if(!n||n.length<=0)return;const r=n.filter(e=>e.tagName&&"TABLE"===e.tagName.toUpperCase()&&e.classList.contains("quill-better-table"))[0];if(r){if(this.table===r)return;this.table&&this.hideTableTools(),this.showTableTools(r,e,t)}else this.table&&this.hideTableTools()},!1),this.quill.root.addEventListener("contextmenu",o=>{if(!this.table)return!0;o.preventDefault();const n=a(o);if(!n||n.length<=0)return;const r=n.filter(e=>e.tagName&&"TABLE"===e.tagName.toUpperCase()&&e.classList.contains("quill-better-table"))[0],i=n.filter(e=>e.tagName&&"TR"===e.tagName.toUpperCase()&&e.getAttribute("data-row"))[0],l=n.filter(e=>e.tagName&&"TD"===e.tagName.toUpperCase()&&e.getAttribute("data-row"))[0];let s=this.tableSelection.selectedTds.map(e=>e.domNode).includes(l);(this.tableSelection.selectedTds.length<=0||!s)&&this.tableSelection.setSelection(l.getBoundingClientRect(),l.getBoundingClientRect()),this.tableOperationMenu&&(this.tableOperationMenu=this.tableOperationMenu.destroy()),r&&(this.tableOperationMenu=new de({table:r,row:i,cell:l,left:o.pageX,top:o.pageY},e,t.operationMenu))},!1);e.getModule("keyboard");e.keyboard.addBinding({key:"Backspace"},{},function(e,t){if(0===e.index||this.quill.getLength()<=1)return!0;const[o]=this.quill.getLine(e.index);if(0===t.offset){const[t]=this.quill.getLine(e.index-1);if(null!=t&&"table-cell-line"===t.statics.blotName&&"table-cell-line"!==o.statics.blotName)return!1}return!0});let o=e.keyboard.bindings.Backspace.pop();e.keyboard.bindings.Backspace.splice(0,1,o),e.clipboard.addMatcher("td",pe),e.clipboard.addMatcher("th",me),e.clipboard.addMatcher("table",fe),e.clipboard.matchers=e.clipboard.matchers.filter(e=>"tr"!==e[0])}getTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==e)return[null,null,null,-1];const[t,o]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==E.blotName)return[null,null,null,-1];const n=t.tableCell(),r=n.row();return[r.table(),r,n,o]}insertTable(e,t){const o=this.quill.getSelection(!0);if(null==o)return;this.quill.getLeaf(o.index)[0],this.quill.getLeaf(o.index+1)[0];let n=(new ge).retain(o.index);n.insert("\n"),n=new Array(t).fill("\n").reduce((e,t)=>(e.insert(t,{"table-col":!0}),e),n),n=new Array(e).fill(0).reduce(e=>{let o=R();return new Array(t).fill("\n").reduce((e,t)=>(e.insert(t,{"table-cell-line":{row:o,cell:z()}}),e),e)},n),this.quill.updateContents(n,r.a.sources.USER),this.quill.setSelection(o.index+t+1,r.a.sources.API)}showTableTools(e,t,o){this.table=e,this.columnTool=new p(e,t,o),this.tableSelection=new j(e,t,o)}hideTableTools(){this.columnTool&&this.columnTool.destroy(),this.tableSelection&&this.tableSelection.destroy(),this.tableOperationMenu&&this.tableOperationMenu.destroy(),this.columnTool=null,this.tableSelection=null,this.tableOperationMenu=null,this.table=null}}we.keyboardBindings={"table-cell-line backspace":{key:"Backspace",format:["table-cell-line"],collapsed:!0,offset:0,handler(e,t){const[o,n]=this.quill.getLine(e.index);return!(!o.prev||"table-cell-line"!==o.prev.statics.blotName)}},"table-cell-line delete":{key:"Delete",format:["table-cell-line"],collapsed:!0,suffix:/^$/,handler(){}},"table-cell-line enter":{key:"Enter",shiftKey:null,format:["table-cell-line"],handler(e,t){if(this.quill.selection&&this.quill.selection.composing)return;const o=r.a.imports.parchment.Scope;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);const n=Object.keys(t.format).reduce((e,n)=>(this.quill.scroll.query(n,o.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e),{});this.quill.insertText(e.index,"\n",n["table-cell-line"],r.a.sources.USER),this.quill.setSelection(e.index+1,r.a.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach(e=>{null==n[e]&&(Array.isArray(t.format[e])||"link"!==e&&this.quill.format(e,t.format[e],r.a.sources.USER))})}}};t.default=we}]).default});
{
"name": "quill-better-table",
"version": "1.1.15",
"version": "1.2.0",
"description": "Module for better table in Quill, more useful features are supported.",

@@ -5,0 +5,0 @@ "main": "dist/quill-better-table.js",

@@ -7,16 +7,12 @@ # quill-better-table

# Planning to
# Updated
<ul>
<li>
<p>Supporting headers in table cell.(cancelled)</p>
<p>(Already done in v1.1.9, but overwrited quill built-in header blot, maybe this is a bad idea, so I cancel this feature in v1.1.13. This feature may be an optional feature in another module.)</p>
<p>Add operation menus icons.</p>
</li>
<li>
<p>Supporting un/ordered list in table cell.(cancelled)</p>
<p>To implement this, it will do harm to quill built-in blot. This feature may be an optional feature in another module.</p>
<p>Add 2 dots to make selected areas easier to recognize.</p>
</li>
<li>
<p>UI optimization(icons, selected areas...).</p>
<p>1. Add operation menus icons.</p>
<p>2. Add 2 dots to make selected areas easier to recognize.</p>
<p>Add support for background color in table cells and relatived configures.(Mentioned in [issue 8](https://github.com/soccerloway/quill-better-table/issues/8))</p>
</li>

@@ -155,3 +151,7 @@ </ul>

}
}
},
color: {
colors: ['#fff', 'red', 'rgb(0, 0, 0)'], // colors in operationMenu
text: 'Background Colors' // subtitle
}
}

@@ -194,2 +194,11 @@ },

## operationMenu.color
Background colors is optional, the default is hidden. If you need this feature, use this configure.
```
{
colors: ['#fff', 'red', 'rgb(0, 0, 0)'], // colors you need in operationMenu, ['white', 'red', 'yellow', 'blue'] as default
text: 'Background Colors' // subtitle, 'Background Colors' as default
}
```
# Community

@@ -196,0 +205,0 @@ Send me an email(<a href="mailto: lw54760187@hotmail.com">lw54760187@hotmail.com</a>) or Contribute on [Issues](https://github.com/soccerloway/quill-better-table/issues), I glad to hear your suggestion.

@@ -35,2 +35,6 @@ import Quill from "quill"

if (value['cell-bg']) {
node.setAttribute('data-cell-bg', value['cell-bg'])
}
return node

@@ -42,3 +46,3 @@ }

return CELL_ATTRIBUTES.concat(CELL_IDENTITY_KEYS).reduce((formats, attribute) => {
return CELL_ATTRIBUTES.concat(CELL_IDENTITY_KEYS).concat(['cell-bg']).reduce((formats, attribute) => {
if (domNode.hasAttribute(`data-${attribute}`)) {

@@ -58,2 +62,8 @@ formats[attribute] = domNode.getAttribute(`data-${attribute}`) || undefined

}
} else if (name === 'cell-bg') {
if (value) {
this.domNode.setAttribute('data-cell-bg', value)
} else {
this.domNode.removeAttribute('data-cell-bg')
}
} else if (name === 'header') {

@@ -80,2 +90,3 @@ if (!value) return;

const colspan = this.domNode.getAttribute('data-colspan')
const cellBg = this.domNode.getAttribute('data-cell-bg')
if (this.statics.requiredContainer &&

@@ -86,3 +97,4 @@ !(this.parent instanceof this.statics.requiredContainer)) {

colspan,
rowspan
rowspan,
'cell-bg': cellBg
})

@@ -127,2 +139,7 @@ }

if (value['cell-bg']) {
node.setAttribute('data-cell-bg', value['cell-bg'])
node.style.backgroundColor = value['cell-bg']
}
return node

@@ -138,2 +155,6 @@ }

if (domNode.hasAttribute("data-cell-bg")) {
formats["cell-bg"] = domNode.getAttribute("data-cell-bg")
}
return CELL_ATTRIBUTES.reduce((formats, attribute) => {

@@ -162,2 +183,6 @@ if (domNode.hasAttribute(attribute)) {

if (this.domNode.hasAttribute("data-cell-bg")) {
formats["cell-bg"] = this.domNode.getAttribute("data-cell-bg")
}
return CELL_ATTRIBUTES.reduce((formats, attribute) => {

@@ -193,2 +218,11 @@ if (this.domNode.hasAttribute(attribute)) {

this.formatChildren(name, value)
} else if (name === 'cell-bg') {
this.toggleAttribute('data-cell-bg', value)
this.formatChildren(name, value)
if (value) {
this.domNode.style.backgroundColor = value
} else {
this.domNode.style.backgroundColor = 'initial'
}
} else {

@@ -195,0 +229,0 @@ super.format(name, value)

@@ -18,2 +18,4 @@ import Quill from 'quill'

const ERROR_LIMIT = 5
const DEFAULT_CELL_COLORS = ['white', 'red', 'yellow', 'blue']
const DEFAULT_COLOR_SUBTITLE = 'Background Colors'

@@ -267,2 +269,4 @@ const MENU_ITEMS_DEFAULT = {

this.columnToolCells = this.tableColumnTool.colToolCells()
this.colorSubTitle = options.color && options.color.text ? options.color.text : DEFAULT_COLOR_SUBTITLE
this.cellColors = options.color && options.color.colors ? options.color.colors : DEFAULT_CELL_COLORS

@@ -304,7 +308,4 @@ this.menuInitial(params)

if (['insertRowDown', 'unmergeCells'].indexOf(name) > -1) {
const dividing = document.createElement('div')
dividing.classList.add('qlbt-operation-menu-dividing')
this.domNode.appendChild(
dividing
dividingCreator()
)

@@ -314,4 +315,61 @@ }

}
// if colors option is false, disabled bg color
if (this.options.color && this.options.color !== false) {
this.domNode.appendChild(
dividingCreator()
)
this.domNode.appendChild(
subTitleCreator(this.colorSubTitle)
)
this.domNode.appendChild(this.colorsItemCreator(this.cellColors))
}
// create dividing line
function dividingCreator () {
const dividing = document.createElement('div')
dividing.classList.add('qlbt-operation-menu-dividing')
return dividing
}
// create subtitle for menu
function subTitleCreator (title) {
const subTitle = document.createElement('div')
subTitle.classList.add('qlbt-operation-menu-subtitle')
subTitle.innerText = title
return subTitle
}
}
colorsItemCreator (colors) {
const self = this
const node = document.createElement('div')
node.classList.add('qlbt-operation-color-picker')
colors.forEach(color => {
let colorBox = colorBoxCreator(color)
node.appendChild(colorBox)
})
function colorBoxCreator (color) {
const box = document.createElement('div')
box.classList.add('qlbt-operation-color-picker-item')
box.setAttribute('data-color', color)
box.style.backgroundColor = color
box.addEventListener('click', function () {
const selectedTds = self.tableSelection.selectedTds
if (selectedTds && selectedTds.length > 0) {
selectedTds.forEach(tableCell => {
tableCell.format('cell-bg', color)
})
}
}, false)
return box
}
return node
}
menuItemCreator ({ text, iconSrc, handler }) {

@@ -318,0 +376,0 @@ const node = document.createElement('div')

@@ -10,4 +10,3 @@ import Quill from 'quill'

matchTableHeader,
matchTable,
matchHeader
matchTable
} from './utils/node-matchers'

@@ -33,4 +32,2 @@

import Header from './formats/header'
class BetterTable extends Module {

@@ -37,0 +34,0 @@ static register() {

@@ -18,2 +18,3 @@ import Quill from 'quill'

const rowspan = node.getAttribute('rowspan') || false
const cellBg = node.getAttribute('data-cell-bg')

@@ -28,3 +29,15 @@ // bugfix: empty table cells copied from other place will be removed unexpectedly

// bugfix: remove background attr from the delta of table cell
// to prevent unexcepted background attr append.
delta = delta.reduce((newDelta, op) => {
if (op.attributes.background === cellBg) {
newDelta.insert(op.insert, _omit(op.attributes, ['background']))
} else {
newDelta.insert(op.insert, op.attributes)
}
return newDelta
}, new Delta())
delta = delta.reduce((newDelta, op) => {
if (op.insert && typeof op.insert === 'string') {

@@ -60,3 +73,3 @@ const lines = []

}, new Delta())
return delta.reduce((newDelta, op) => {

@@ -63,0 +76,0 @@ if (op.insert && typeof op.insert === 'string' &&

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc