From 2d4165e630cd4a7796129ee4d58d62021ac3f9c9 Mon Sep 17 00:00:00 2001 From: Masahiro Iuchi Date: Tue, 3 Sep 2024 20:57:42 +0900 Subject: [PATCH 01/14] Copy yarn.lock from movabletype repo copy from mt7.0 tag (https://github.com/movabletype/movabletype/commit/8989bb7fde91003f7aa36c1467213c9f7b7cac23) --- yarn.lock | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index af3db0d..46779f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,9 +9,9 @@ JSONStream@^1.0.3: jsonparse "^1.2.0" through ">=2.2.7 <3" -a-template@0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/a-template/-/a-template-0.4.4.tgz#0b0034ed953a1bcdea63dcbc67215a7a8c54485a" +a-template@^0.5.1: + version "0.5.3" + resolved "https://registry.yarnpkg.com/a-template/-/a-template-0.5.3.tgz#3ac2b709d0537211cb6ad479be7ac4dad4ce13b4" dependencies: array.prototype.find "^2.0.4" delegate "^3.1.2" @@ -421,6 +421,10 @@ babel-messages@^6.22.0: dependencies: babel-runtime "^6.22.0" +babel-plugin-add-module-exports@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz#9ae9a1f4a8dc67f0cdec4f4aeda1e43a5ff65e25" + babel-plugin-check-es2015-constants@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" From d01b3a847aa8c3d892a7c9835a75716ba13b102c Mon Sep 17 00:00:00 2001 From: Masahiro Iuchi Date: Tue, 3 Sep 2024 21:00:44 +0900 Subject: [PATCH 02/14] yarn build:js --- build/a-table.js | 783 ++++++++++--------------------------------- build/a-table.min.js | 66 +--- 2 files changed, 190 insertions(+), 659 deletions(-) diff --git a/build/a-table.js b/build/a-table.js index cc445a1..69a1c55 100644 --- a/build/a-table.js +++ b/build/a-table.js @@ -5,57 +5,48 @@ * a-table: * license: MIT (http://opensource.org/licenses/MIT) * author: appleple - * version: 1.5.3 + * version: 1.5.4 * * a-template: * license: MIT (http://opensource.org/licenses/MIT) * author: steelydylan - * maintainers: appleple , steelydylan - * version: 0.5.1 + * version: 0.5.3 * * array.prototype.find: * license: MIT (http://opensource.org/licenses/MIT) * author: Paul Miller - * maintainers: ljharb , paulmillr * contributors: Duncan Hall - * homepage: https://github.com/paulmillr/Array.prototype.find#readme * version: 2.0.4 * * base64-js: * license: MIT (http://opensource.org/licenses/MIT) * author: T. Jameson Little - * maintainers: beatgammit , feross * homepage: https://github.com/beatgammit/base64-js - * version: 1.2.3 + * version: 1.2.0 * * buffer: * license: MIT (http://opensource.org/licenses/MIT) * author: Feross Aboukhadijeh - * maintainers: feross * contributors: Romain Beauxis , James Halliday * homepage: https://github.com/feross/buffer * version: 4.9.1 * * clone: * license: MIT (http://opensource.org/licenses/MIT) - * author: Paul Vorbach - * maintainers: pvorb - * contributors: Blake Miner , Tian You , George Stagas , Tobiasz Cudnik , Pavel Lang , Dan MacTough, w1nk, Hugh Kennedy, Dustin Diaz, Ilya Shaisultanov, Nathan MacInnes , Benjamin E. Coe , Nathan Zadoks, Róbert Oroszi , Aurélio A. Heckert, Guy Ellis, fscherwi, rictic, Martin Jurča, Misery Lee , Clemens Wolff - * homepage: https://github.com/pvorb/node-clone#readme - * version: 2.1.1 + * author: Paul Vorbach (http://paul.vorba.ch/) + * contributors: Blake Miner (http://www.blakeminer.com/), Tian You (http://blog.axqd.net/), George Stagas (http://stagas.com/), Tobiasz Cudnik (https://github.com/TobiaszCudnik), Pavel Lang (https://github.com/langpavel), Dan MacTough (http://yabfog.com/), w1nk (https://github.com/w1nk), Hugh Kennedy (http://twitter.com/hughskennedy), Dustin Diaz (http://dustindiaz.com), Ilya Shaisultanov (https://github.com/diversario), Nathan MacInnes (http://macinn.es/), Benjamin E. Coe (https://twitter.com/benjamincoe), Nathan Zadoks (https://github.com/nathan7), Róbert Oroszi (https://github.com/oroce), Aurélio A. Heckert (http://softwarelivre.org/aurium), Guy Ellis (http://www.guyellisrocks.com/), fscherwi (https://fscherwi.github.io), rictic (https://github.com/rictic), Martin Jurča (https://github.com/jurca), Misery Lee (https://github.com/miserylee) + * version: 2.1.0 * * custom-event-polyfill: * license: MIT (http://opensource.org/licenses/MIT) - * maintainers: krambuhl - * contributors: Frank Panetta, Mikhail Reenko , Joscha Feth - * homepage: https://github.com/krambuhl/custom-event-polyfill#readme + * author: NO AUTHOR! + * contributors: Frank Panetta (http://www.savvi.io), Mikhail Reenko , Joscha Feth (http://www.feth.com) * version: 0.3.0 * * deep-extend: * license: MIT (http://opensource.org/licenses/MIT) * licenses: MIT (http://opensource.org/licenses/MIT) * author: Viacheslav Lotsmanov - * maintainers: unclechu * contributors: Romain Prieto, Max Maximov, Marshall Bowers * homepage: https://github.com/unclechu/node-deep-extend * version: 0.5.0 @@ -63,110 +54,86 @@ * define-properties: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb - * homepage: https://github.com/ljharb/define-properties#readme * version: 1.1.2 * * es-abstract: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb * contributors: Jordan Harband - * homepage: https://github.com/ljharb/es-abstract#readme - * version: 1.10.0 + * version: 1.7.0 * * es-to-primitive: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb - * homepage: https://github.com/ljharb/es-to-primitive#readme * version: 1.1.1 * * foreach: * license: MIT (http://opensource.org/licenses/MIT) * author: Manuel Stofer - * maintainers: manuelstofer * contributors: Manuel Stofer, Jordan Harband - * homepage: https://github.com/manuelstofer/foreach * version: 2.0.5 * * function-bind: - * license: MIT (http://opensource.org/licenses/MIT) + * licenses: MIT (http://opensource.org/licenses/MIT) * author: Raynos - * maintainers: raynos , ljharb * contributors: Raynos, Jordan Harband * homepage: https://github.com/Raynos/function-bind - * version: 1.1.1 + * version: 1.1.0 * * has: * licenses: MIT (http://opensource.org/licenses/MIT) * author: Thiago de Arruda - * maintainers: tarruda * homepage: https://github.com/tarruda/has * version: 1.0.1 * * ieee754: * license: BSD-3-Clause (http://opensource.org/licenses/BSD-3-Clause) * author: Feross Aboukhadijeh - * maintainers: feross * contributors: Romain Beauxis - * homepage: https://github.com/feross/ieee754#readme * version: 1.1.8 * * is-callable: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb * contributors: Jordan Harband - * homepage: https://github.com/ljharb/is-callable#readme * version: 1.1.3 * * is-date-object: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb - * homepage: https://github.com/ljharb/is-date-object#readme * version: 1.0.1 * * is-regex: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb * homepage: https://github.com/ljharb/is-regex * version: 1.0.4 * * is-symbol: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb - * homepage: https://github.com/ljharb/is-symbol * version: 1.0.1 * * isarray: * license: MIT (http://opensource.org/licenses/MIT) * author: Julian Gruber - * maintainers: juliangruber * homepage: https://github.com/juliangruber/isarray * version: 1.0.0 * * morphdom: * license: MIT (http://opensource.org/licenses/MIT) * author: Patrick Steele-Idem - * maintainers: mlrawlings , pnidem - * homepage: https://github.com/patrick-steele-idem/morphdom#readme - * version: 2.3.3 + * version: 2.3.1 * * object-keys: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb * contributors: Jordan Harband , Raynos , Nathan Rajlich , Ivan Starkov , Gary Katsevman - * homepage: https://github.com/ljharb/object-keys#readme * version: 1.0.11 * * This header is generated by licensify (https://github.com/twada/licensify) */ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.aTable = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 ? len - 4 : len var L = 0 - for (i = 0; i < l; i += 4) { + for (i = 0, j = 0; i < l; i += 4, j += 3) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] arr[L++] = (tmp >> 16) & 0xFF arr[L++] = (tmp >> 8) & 0xFF @@ -952,7 +917,7 @@ function encodeChunk (uint8, start, end) { var tmp var output = [] for (var i = start; i < end; i += 3) { - tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF) + tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) output.push(tripletToBase64(tmp)) } return output.join('') @@ -2783,15 +2748,11 @@ function isnan (val) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"base64-js":7,"ieee754":29,"isarray":34}],9:[function(require,module,exports){ +},{"base64-js":7,"ieee754":28,"isarray":33}],9:[function(require,module,exports){ (function (Buffer){ var clone = (function() { 'use strict'; -function _instanceof(obj, type) { - return type != null && obj instanceof type; -} - var nativeMap; try { nativeMap = Map; @@ -2871,11 +2832,11 @@ function clone(parent, circular, depth, prototype, includeNonEnumerable) { return parent; } - if (_instanceof(parent, nativeMap)) { + if (parent instanceof nativeMap) { child = new nativeMap(); - } else if (_instanceof(parent, nativeSet)) { + } else if (parent instanceof nativeSet) { child = new nativeSet(); - } else if (_instanceof(parent, nativePromise)) { + } else if (parent instanceof nativePromise) { child = new nativePromise(function (resolve, reject) { parent.then(function(value) { resolve(_clone(value, depth - 1)); @@ -2894,7 +2855,7 @@ function clone(parent, circular, depth, prototype, includeNonEnumerable) { child = new Buffer(parent.length); parent.copy(child); return child; - } else if (_instanceof(parent, Error)) { + } else if (parent instanceof Error) { child = Object.create(parent); } else { if (typeof prototype == 'undefined') { @@ -2917,18 +2878,28 @@ function clone(parent, circular, depth, prototype, includeNonEnumerable) { allChildren.push(child); } - if (_instanceof(parent, nativeMap)) { - parent.forEach(function(value, key) { - var keyChild = _clone(key, depth - 1); - var valueChild = _clone(value, depth - 1); + if (parent instanceof nativeMap) { + var keyIterator = parent.keys(); + while(true) { + var next = keyIterator.next(); + if (next.done) { + break; + } + var keyChild = _clone(next.value, depth - 1); + var valueChild = _clone(parent.get(next.value), depth - 1); child.set(keyChild, valueChild); - }); + } } - if (_instanceof(parent, nativeSet)) { - parent.forEach(function(value) { - var entryChild = _clone(value, depth - 1); + if (parent instanceof nativeSet) { + var iterator = parent.keys(); + while(true) { + var next = iterator.next(); + if (next.done) { + break; + } + var entryChild = _clone(next.value, depth - 1); child.add(entryChild); - }); + } } for (var i in parent) { @@ -3290,14 +3261,100 @@ defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; -},{"foreach":25,"object-keys":36}],13:[function(require,module,exports){ +},{"foreach":24,"object-keys":35}],13:[function(require,module,exports){ 'use strict'; -var has = require('has'); -var toPrimitive = require('es-to-primitive/es6'); +var $isNaN = require('./helpers/isNaN'); +var $isFinite = require('./helpers/isFinite'); + +var sign = require('./helpers/sign'); +var mod = require('./helpers/mod'); + +var IsCallable = require('is-callable'); +var toPrimitive = require('es-to-primitive/es5'); + +// https://es5.github.io/#x9 +var ES5 = { + ToPrimitive: toPrimitive, + + ToBoolean: function ToBoolean(value) { + return Boolean(value); + }, + ToNumber: function ToNumber(value) { + return Number(value); + }, + ToInteger: function ToInteger(value) { + var number = this.ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return sign(number) * Math.floor(Math.abs(number)); + }, + ToInt32: function ToInt32(x) { + return this.ToNumber(x) >> 0; + }, + ToUint32: function ToUint32(x) { + return this.ToNumber(x) >>> 0; + }, + ToUint16: function ToUint16(value) { + var number = this.ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * Math.floor(Math.abs(number)); + return mod(posInt, 0x10000); + }, + ToString: function ToString(value) { + return String(value); + }, + ToObject: function ToObject(value) { + this.CheckObjectCoercible(value); + return Object(value); + }, + CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) { + /* jshint eqnull:true */ + if (value == null) { + throw new TypeError(optMessage || 'Cannot call method on ' + value); + } + return value; + }, + IsCallable: IsCallable, + SameValue: function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); + }, + + // http://www.ecma-international.org/ecma-262/5.1/#sec-8 + Type: function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } + } +}; + +module.exports = ES5; + +},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(require,module,exports){ +'use strict'; var toStr = Object.prototype.toString; var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; +var symbolToStr = hasSymbols ? Symbol.prototype.toString : toStr; var $isNaN = require('./helpers/isNaN'); var $isFinite = require('./helpers/isFinite'); @@ -3307,13 +3364,12 @@ var assign = require('./helpers/assign'); var sign = require('./helpers/sign'); var mod = require('./helpers/mod'); var isPrimitive = require('./helpers/isPrimitive'); +var toPrimitive = require('es-to-primitive/es6'); var parseInteger = parseInt; var bind = require('function-bind'); -var arraySlice = bind.call(Function.call, Array.prototype.slice); var strSlice = bind.call(Function.call, String.prototype.slice); var isBinary = bind.call(Function.call, RegExp.prototype.test, /^0b[01]+$/i); var isOctal = bind.call(Function.call, RegExp.prototype.test, /^0o[0-7]+$/i); -var regexExec = bind.call(Function.call, RegExp.prototype.exec); var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); var nonWSregex = new RegExp('[' + nonWS + ']', 'g'); var hasNonWS = bind.call(Function.call, RegExp.prototype.test, nonWSregex); @@ -3357,7 +3413,7 @@ var ES6 = assign(assign({}, ES5), { // http://www.ecma-international.org/ecma-262/6.0/#sec-tonumber ToNumber: function ToNumber(argument) { - var value = isPrimitive(argument) ? argument : toPrimitive(argument, Number); + var value = isPrimitive(argument) ? argument : toPrimitive(argument, 'number'); if (typeof value === 'symbol') { throw new TypeError('Cannot convert a Symbol value to a number'); } @@ -3439,7 +3495,7 @@ var ES6 = assign(assign({}, ES5), { // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey ToPropertyKey: function ToPropertyKey(argument) { var key = this.ToPrimitive(argument, String); - return typeof key === 'symbol' ? key : this.ToString(key); + return typeof key === 'symbol' ? symbolToStr.call(key) : this.ToString(key); }, // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength @@ -3562,7 +3618,7 @@ var ES6 = assign(assign({}, ES5), { // 7.3.9.4 if (func == null) { - return void 0; + return undefined; } // 7.3.9.5 @@ -3612,7 +3668,7 @@ var ES6 = assign(assign({}, ES5), { if (this.Type(C) !== 'Object') { throw new TypeError('O.constructor is not an Object'); } - var S = hasSymbols && Symbol.species ? C[Symbol.species] : void 0; + var S = hasSymbols && Symbol.species ? C[Symbol.species] : undefined; if (S == null) { return defaultConstructor; } @@ -3620,236 +3676,6 @@ var ES6 = assign(assign({}, ES5), { return S; } throw new TypeError('no constructor found'); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor - CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) { - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { - if (!has(Desc, '[[Value]]')) { - Desc['[[Value]]'] = void 0; - } - if (!has(Desc, '[[Writable]]')) { - Desc['[[Writable]]'] = false; - } - } else { - if (!has(Desc, '[[Get]]')) { - Desc['[[Get]]'] = void 0; - } - if (!has(Desc, '[[Set]]')) { - Desc['[[Set]]'] = void 0; - } - } - if (!has(Desc, '[[Enumerable]]')) { - Desc['[[Enumerable]]'] = false; - } - if (!has(Desc, '[[Configurable]]')) { - Desc['[[Configurable]]'] = false; - } - return Desc; - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw - Set: function Set(O, P, V, Throw) { - if (this.Type(O) !== 'Object') { - throw new TypeError('O must be an Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('P must be a Property Key'); - } - if (this.Type(Throw) !== 'Boolean') { - throw new TypeError('Throw must be a Boolean'); - } - if (Throw) { - O[P] = V; - return true; - } else { - try { - O[P] = V; - } catch (e) { - return false; - } - } - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-hasownproperty - HasOwnProperty: function HasOwnProperty(O, P) { - if (this.Type(O) !== 'Object') { - throw new TypeError('O must be an Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('P must be a Property Key'); - } - return has(O, P); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-hasproperty - HasProperty: function HasProperty(O, P) { - if (this.Type(O) !== 'Object') { - throw new TypeError('O must be an Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('P must be a Property Key'); - } - return P in O; - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable - IsConcatSpreadable: function IsConcatSpreadable(O) { - if (this.Type(O) !== 'Object') { - return false; - } - if (hasSymbols && typeof Symbol.isConcatSpreadable === 'symbol') { - var spreadable = this.Get(O, Symbol.isConcatSpreadable); - if (typeof spreadable !== 'undefined') { - return this.ToBoolean(spreadable); - } - } - return this.IsArray(O); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-invoke - Invoke: function Invoke(O, P) { - if (!this.IsPropertyKey(P)) { - throw new TypeError('P must be a Property Key'); - } - var argumentsList = arraySlice(arguments, 2); - var func = this.GetV(O, P); - return this.Call(func, O, argumentsList); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject - CreateIterResultObject: function CreateIterResultObject(value, done) { - if (this.Type(done) !== 'Boolean') { - throw new TypeError('Assertion failed: Type(done) is not Boolean'); - } - return { - value: value, - done: done - }; - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-regexpexec - RegExpExec: function RegExpExec(R, S) { - if (this.Type(R) !== 'Object') { - throw new TypeError('R must be an Object'); - } - if (this.Type(S) !== 'String') { - throw new TypeError('S must be a String'); - } - var exec = this.Get(R, 'exec'); - if (this.IsCallable(exec)) { - var result = this.Call(exec, R, [S]); - if (result === null || this.Type(result) === 'Object') { - return result; - } - throw new TypeError('"exec" method must return `null` or an Object'); - } - return regexExec(R, S); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate - ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) { - if (!this.IsInteger(length) || length < 0) { - throw new TypeError('Assertion failed: length must be an integer >= 0'); - } - var len = length === 0 ? 0 : length; - var C; - var isArray = this.IsArray(originalArray); - if (isArray) { - C = this.Get(originalArray, 'constructor'); - // TODO: figure out how to make a cross-realm normal Array, a same-realm Array - // if (this.IsConstructor(C)) { - // if C is another realm's Array, C = undefined - // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? - // } - if (this.Type(C) === 'Object' && hasSymbols && Symbol.species) { - C = this.Get(C, Symbol.species); - if (C === null) { - C = void 0; - } - } - } - if (typeof C === 'undefined') { - return Array(len); - } - if (!this.IsConstructor(C)) { - throw new TypeError('C must be a constructor'); - } - return new C(len); // this.Construct(C, len); - }, - - CreateDataProperty: function CreateDataProperty(O, P, V) { - if (this.Type(O) !== 'Object') { - throw new TypeError('Assertion failed: Type(O) is not Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('Assertion failed: IsPropertyKey(P) is not true'); - } - var oldDesc = Object.getOwnPropertyDescriptor(O, P); - var extensible = oldDesc || (typeof Object.isExtensible !== 'function' || Object.isExtensible(O)); - var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable); - if (immutable || !extensible) { - return false; - } - var newDesc = { - configurable: true, - enumerable: true, - value: V, - writable: true - }; - Object.defineProperty(O, P, newDesc); - return true; - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow - CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) { - if (this.Type(O) !== 'Object') { - throw new TypeError('Assertion failed: Type(O) is not Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('Assertion failed: IsPropertyKey(P) is not true'); - } - var success = this.CreateDataProperty(O, P, V); - if (!success) { - throw new TypeError('unable to create data property'); - } - return success; - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-advancestringindex - AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) { - if (this.Type(S) !== 'String') { - throw new TypeError('Assertion failed: Type(S) is not String'); - } - if (!this.IsInteger(index)) { - throw new TypeError('Assertion failed: length must be an integer >= 0 and <= (2**53 - 1)'); - } - if (index < 0 || index > MAX_SAFE_INTEGER) { - throw new RangeError('Assertion failed: length must be an integer >= 0 and <= (2**53 - 1)'); - } - if (this.Type(unicode) !== 'Boolean') { - throw new TypeError('Assertion failed: Type(unicode) is not Boolean'); - } - if (!unicode) { - return index + 1; - } - var length = S.length; - if ((index + 1) >= length) { - return index + 1; - } - var first = S.charCodeAt(index); - if (first < 0xD800 || first > 0xDBFF) { - return index + 1; - } - var second = S.charCodeAt(index + 1); - if (second < 0xDC00 || second > 0xDFFF) { - return index + 1; - } - return index + 2; } }); @@ -3857,255 +3683,9 @@ delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible module.exports = ES6; -},{"./es5":14,"./helpers/assign":16,"./helpers/isFinite":17,"./helpers/isNaN":18,"./helpers/isPrimitive":19,"./helpers/mod":20,"./helpers/sign":21,"es-to-primitive/es6":23,"function-bind":27,"has":28,"is-regex":32}],14:[function(require,module,exports){ -'use strict'; - -var $isNaN = require('./helpers/isNaN'); -var $isFinite = require('./helpers/isFinite'); - -var sign = require('./helpers/sign'); -var mod = require('./helpers/mod'); - -var IsCallable = require('is-callable'); -var toPrimitive = require('es-to-primitive/es5'); - -var has = require('has'); - -// https://es5.github.io/#x9 -var ES5 = { - ToPrimitive: toPrimitive, - - ToBoolean: function ToBoolean(value) { - return !!value; - }, - ToNumber: function ToNumber(value) { - return Number(value); - }, - ToInteger: function ToInteger(value) { - var number = this.ToNumber(value); - if ($isNaN(number)) { return 0; } - if (number === 0 || !$isFinite(number)) { return number; } - return sign(number) * Math.floor(Math.abs(number)); - }, - ToInt32: function ToInt32(x) { - return this.ToNumber(x) >> 0; - }, - ToUint32: function ToUint32(x) { - return this.ToNumber(x) >>> 0; - }, - ToUint16: function ToUint16(value) { - var number = this.ToNumber(value); - if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } - var posInt = sign(number) * Math.floor(Math.abs(number)); - return mod(posInt, 0x10000); - }, - ToString: function ToString(value) { - return String(value); - }, - ToObject: function ToObject(value) { - this.CheckObjectCoercible(value); - return Object(value); - }, - CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) { - /* jshint eqnull:true */ - if (value == null) { - throw new TypeError(optMessage || 'Cannot call method on ' + value); - } - return value; - }, - IsCallable: IsCallable, - SameValue: function SameValue(x, y) { - if (x === y) { // 0 === -0, but they are not identical. - if (x === 0) { return 1 / x === 1 / y; } - return true; - } - return $isNaN(x) && $isNaN(y); - }, - - // http://www.ecma-international.org/ecma-262/5.1/#sec-8 - Type: function Type(x) { - if (x === null) { - return 'Null'; - } - if (typeof x === 'undefined') { - return 'Undefined'; - } - if (typeof x === 'function' || typeof x === 'object') { - return 'Object'; - } - if (typeof x === 'number') { - return 'Number'; - } - if (typeof x === 'boolean') { - return 'Boolean'; - } - if (typeof x === 'string') { - return 'String'; - } - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type - IsPropertyDescriptor: function IsPropertyDescriptor(Desc) { - if (this.Type(Desc) !== 'Object') { - return false; - } - var allowed = { - '[[Configurable]]': true, - '[[Enumerable]]': true, - '[[Get]]': true, - '[[Set]]': true, - '[[Value]]': true, - '[[Writable]]': true - }; - // jscs:disable - for (var key in Desc) { // eslint-disable-line - if (has(Desc, key) && !allowed[key]) { - return false; - } - } - // jscs:enable - var isData = has(Desc, '[[Value]]'); - var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); - if (isData && IsAccessor) { - throw new TypeError('Property Descriptors may not be both accessor and data descriptors'); - } - return true; - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.1 - IsAccessorDescriptor: function IsAccessorDescriptor(Desc) { - if (typeof Desc === 'undefined') { - return false; - } - - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { - return false; - } - - return true; - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.2 - IsDataDescriptor: function IsDataDescriptor(Desc) { - if (typeof Desc === 'undefined') { - return false; - } - - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { - return false; - } - - return true; - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.3 - IsGenericDescriptor: function IsGenericDescriptor(Desc) { - if (typeof Desc === 'undefined') { - return false; - } - - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) { - return true; - } - - return false; - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.4 - FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { - if (typeof Desc === 'undefined') { - return Desc; - } - - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (this.IsDataDescriptor(Desc)) { - return { - value: Desc['[[Value]]'], - writable: !!Desc['[[Writable]]'], - enumerable: !!Desc['[[Enumerable]]'], - configurable: !!Desc['[[Configurable]]'] - }; - } else if (this.IsAccessorDescriptor(Desc)) { - return { - get: Desc['[[Get]]'], - set: Desc['[[Set]]'], - enumerable: !!Desc['[[Enumerable]]'], - configurable: !!Desc['[[Configurable]]'] - }; - } else { - throw new TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); - } - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.5 - ToPropertyDescriptor: function ToPropertyDescriptor(Obj) { - if (this.Type(Obj) !== 'Object') { - throw new TypeError('ToPropertyDescriptor requires an object'); - } - - var desc = {}; - if (has(Obj, 'enumerable')) { - desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable); - } - if (has(Obj, 'configurable')) { - desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable); - } - if (has(Obj, 'value')) { - desc['[[Value]]'] = Obj.value; - } - if (has(Obj, 'writable')) { - desc['[[Writable]]'] = this.ToBoolean(Obj.writable); - } - if (has(Obj, 'get')) { - var getter = Obj.get; - if (typeof getter !== 'undefined' && !this.IsCallable(getter)) { - throw new TypeError('getter must be a function'); - } - desc['[[Get]]'] = getter; - } - if (has(Obj, 'set')) { - var setter = Obj.set; - if (typeof setter !== 'undefined' && !this.IsCallable(setter)) { - throw new TypeError('setter must be a function'); - } - desc['[[Set]]'] = setter; - } - - if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { - throw new TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); - } - return desc; - } -}; - -module.exports = ES5; - -},{"./helpers/isFinite":17,"./helpers/isNaN":18,"./helpers/mod":20,"./helpers/sign":21,"es-to-primitive/es5":22,"has":28,"is-callable":30}],15:[function(require,module,exports){ -'use strict'; - -module.exports = require('./es2015'); - -},{"./es2015":13}],16:[function(require,module,exports){ +},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(require,module,exports){ var has = Object.prototype.hasOwnProperty; -module.exports = function assign(target, source) { - if (Object.assign) { - return Object.assign(target, source); - } +module.exports = Object.assign || function assign(target, source) { for (var key in source) { if (has.call(source, key)) { target[key] = source[key]; @@ -4114,33 +3694,33 @@ module.exports = function assign(target, source) { return target; }; -},{}],17:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ var $isNaN = Number.isNaN || function (a) { return a !== a; }; module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; -},{}],18:[function(require,module,exports){ +},{}],17:[function(require,module,exports){ module.exports = Number.isNaN || function isNaN(a) { return a !== a; }; -},{}],19:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ module.exports = function isPrimitive(value) { return value === null || (typeof value !== 'function' && typeof value !== 'object'); }; -},{}],20:[function(require,module,exports){ +},{}],19:[function(require,module,exports){ module.exports = function mod(number, modulo) { var remain = number % modulo; return Math.floor(remain >= 0 ? remain : remain + modulo); }; -},{}],21:[function(require,module,exports){ +},{}],20:[function(require,module,exports){ module.exports = function sign(number) { return number >= 0 ? 1 : -1; }; -},{}],22:[function(require,module,exports){ +},{}],21:[function(require,module,exports){ 'use strict'; var toStr = Object.prototype.toString; @@ -4179,7 +3759,7 @@ module.exports = function ToPrimitive(input, PreferredType) { return ES5internalSlots['[[DefaultValue]]'](input, PreferredType); }; -},{"./helpers/isPrimitive":24,"is-callable":30}],23:[function(require,module,exports){ +},{"./helpers/isPrimitive":23,"is-callable":29}],22:[function(require,module,exports){ 'use strict'; var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; @@ -4255,9 +3835,9 @@ module.exports = function ToPrimitive(input, PreferredType) { return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); }; -},{"./helpers/isPrimitive":24,"is-callable":30,"is-date-object":31,"is-symbol":33}],24:[function(require,module,exports){ -arguments[4][19][0].apply(exports,arguments) -},{"dup":19}],25:[function(require,module,exports){ +},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(require,module,exports){ +arguments[4][18][0].apply(exports,arguments) +},{"dup":18}],24:[function(require,module,exports){ var hasOwn = Object.prototype.hasOwnProperty; var toString = Object.prototype.toString; @@ -4281,11 +3861,7 @@ module.exports = function forEach (obj, fn, ctx) { }; -},{}],26:[function(require,module,exports){ -'use strict'; - -/* eslint no-invalid-this: 1 */ - +},{}],25:[function(require,module,exports){ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; var slice = Array.prototype.slice; var toStr = Object.prototype.toString; @@ -4335,19 +3911,17 @@ module.exports = function bind(that) { return bound; }; -},{}],27:[function(require,module,exports){ -'use strict'; - +},{}],26:[function(require,module,exports){ var implementation = require('./implementation'); module.exports = Function.prototype.bind || implementation; -},{"./implementation":26}],28:[function(require,module,exports){ +},{"./implementation":25}],27:[function(require,module,exports){ var bind = require('function-bind'); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); -},{"function-bind":27}],29:[function(require,module,exports){ +},{"function-bind":26}],28:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 @@ -4433,7 +4007,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],30:[function(require,module,exports){ +},{}],29:[function(require,module,exports){ 'use strict'; var fnToStr = Function.prototype.toString; @@ -4474,7 +4048,7 @@ module.exports = function isCallable(value) { return strClass === fnClass || strClass === genClass; }; -},{}],31:[function(require,module,exports){ +},{}],30:[function(require,module,exports){ 'use strict'; var getDay = Date.prototype.getDay; @@ -4496,7 +4070,7 @@ module.exports = function isDateObject(value) { return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; }; -},{}],32:[function(require,module,exports){ +},{}],31:[function(require,module,exports){ 'use strict'; var has = require('has'); @@ -4537,7 +4111,7 @@ module.exports = function isRegex(value) { return tryRegexExecCall(value); }; -},{"has":28}],33:[function(require,module,exports){ +},{"has":27}],32:[function(require,module,exports){ 'use strict'; var toStr = Object.prototype.toString; @@ -4566,14 +4140,14 @@ if (hasSymbols) { }; } -},{}],34:[function(require,module,exports){ +},{}],33:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; -},{}],35:[function(require,module,exports){ +},{}],34:[function(require,module,exports){ 'use strict'; var range; // Create a range object for efficently rendering strings to elements. @@ -4780,17 +4354,14 @@ var specialElHandlers = { fromEl.value = newValue; } - var firstChild = fromEl.firstChild; - if (firstChild) { + if (fromEl.firstChild) { // Needed for IE. Apparently IE sets the placeholder as the // node value and vise versa. This ignores an empty update. - var oldValue = firstChild.nodeValue; - - if (oldValue == newValue || (!newValue && oldValue == fromEl.placeholder)) { + if (newValue === '' && fromEl.firstChild.nodeValue === fromEl.placeholder) { return; } - firstChild.nodeValue = newValue; + fromEl.firstChild.nodeValue = newValue; } }, SELECT: function(fromEl, toEl) { @@ -5101,10 +4672,7 @@ function morphdomFactory(morphAttrs) { isCompatible = true; // Simply update nodeValue on the original node to // change the text value - if (curFromNodeChild.nodeValue !== curToNodeChild.nodeValue) { - curFromNodeChild.nodeValue = curToNodeChild.nodeValue; - } - + curFromNodeChild.nodeValue = curToNodeChild.nodeValue; } } @@ -5203,10 +4771,7 @@ function morphdomFactory(morphAttrs) { } } else if (morphedNodeType === TEXT_NODE || morphedNodeType === COMMENT_NODE) { // Text or comment node if (toNodeType === morphedNodeType) { - if (morphedNode.nodeValue !== toNode.nodeValue) { - morphedNode.nodeValue = toNode.nodeValue; - } - + morphedNode.nodeValue = toNode.nodeValue; return morphedNode; } else { // Text node to something else @@ -5257,7 +4822,7 @@ var morphdom = morphdomFactory(morphAttrs); module.exports = morphdom; -},{}],36:[function(require,module,exports){ +},{}],35:[function(require,module,exports){ 'use strict'; // modified from https://github.com/es-shims/es5-shim @@ -5399,7 +4964,7 @@ keysShim.shim = function shimObjectKeys() { module.exports = keysShim; -},{"./isArguments":37}],37:[function(require,module,exports){ +},{"./isArguments":36}],36:[function(require,module,exports){ 'use strict'; var toStr = Object.prototype.toString; @@ -5418,7 +4983,7 @@ module.exports = function isArguments(value) { return isArgs; }; -},{}],38:[function(require,module,exports){ +},{}],37:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -7039,7 +6604,7 @@ var aTable = function (_aTemplate) { exports.default = aTable; module.exports = exports['default']; -},{"./util.js":39,"a-template":1,"clone":9,"deep-extend":11}],39:[function(require,module,exports){ +},{"./util.js":38,"a-template":1,"clone":9,"deep-extend":11}],38:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -7134,5 +6699,5 @@ module.exports.removeIndentNewline = function (str) { return str.replace(/(\n|\t)/g, ''); }; -},{"custom-event-polyfill":10}]},{},[38])(38) +},{"custom-event-polyfill":10}]},{},[37])(37) }); \ No newline at end of file diff --git a/build/a-table.min.js b/build/a-table.min.js index 8b27483..d128e47 100644 --- a/build/a-table.min.js +++ b/build/a-table.min.js @@ -5,57 +5,48 @@ * a-table: * license: MIT (http://opensource.org/licenses/MIT) * author: appleple - * version: 1.5.3 + * version: 1.5.4 * * a-template: * license: MIT (http://opensource.org/licenses/MIT) * author: steelydylan - * maintainers: appleple , steelydylan - * version: 0.5.1 + * version: 0.5.3 * * array.prototype.find: * license: MIT (http://opensource.org/licenses/MIT) * author: Paul Miller - * maintainers: ljharb , paulmillr * contributors: Duncan Hall - * homepage: https://github.com/paulmillr/Array.prototype.find#readme * version: 2.0.4 * * base64-js: * license: MIT (http://opensource.org/licenses/MIT) * author: T. Jameson Little - * maintainers: beatgammit , feross * homepage: https://github.com/beatgammit/base64-js - * version: 1.2.3 + * version: 1.2.0 * * buffer: * license: MIT (http://opensource.org/licenses/MIT) * author: Feross Aboukhadijeh - * maintainers: feross * contributors: Romain Beauxis , James Halliday * homepage: https://github.com/feross/buffer * version: 4.9.1 * * clone: * license: MIT (http://opensource.org/licenses/MIT) - * author: Paul Vorbach - * maintainers: pvorb - * contributors: Blake Miner , Tian You , George Stagas , Tobiasz Cudnik , Pavel Lang , Dan MacTough, w1nk, Hugh Kennedy, Dustin Diaz, Ilya Shaisultanov, Nathan MacInnes , Benjamin E. Coe , Nathan Zadoks, Róbert Oroszi , Aurélio A. Heckert, Guy Ellis, fscherwi, rictic, Martin Jurča, Misery Lee , Clemens Wolff - * homepage: https://github.com/pvorb/node-clone#readme - * version: 2.1.1 + * author: Paul Vorbach (http://paul.vorba.ch/) + * contributors: Blake Miner (http://www.blakeminer.com/), Tian You (http://blog.axqd.net/), George Stagas (http://stagas.com/), Tobiasz Cudnik (https://github.com/TobiaszCudnik), Pavel Lang (https://github.com/langpavel), Dan MacTough (http://yabfog.com/), w1nk (https://github.com/w1nk), Hugh Kennedy (http://twitter.com/hughskennedy), Dustin Diaz (http://dustindiaz.com), Ilya Shaisultanov (https://github.com/diversario), Nathan MacInnes (http://macinn.es/), Benjamin E. Coe (https://twitter.com/benjamincoe), Nathan Zadoks (https://github.com/nathan7), Róbert Oroszi (https://github.com/oroce), Aurélio A. Heckert (http://softwarelivre.org/aurium), Guy Ellis (http://www.guyellisrocks.com/), fscherwi (https://fscherwi.github.io), rictic (https://github.com/rictic), Martin Jurča (https://github.com/jurca), Misery Lee (https://github.com/miserylee) + * version: 2.1.0 * * custom-event-polyfill: * license: MIT (http://opensource.org/licenses/MIT) - * maintainers: krambuhl - * contributors: Frank Panetta, Mikhail Reenko , Joscha Feth - * homepage: https://github.com/krambuhl/custom-event-polyfill#readme + * author: NO AUTHOR! + * contributors: Frank Panetta (http://www.savvi.io), Mikhail Reenko , Joscha Feth (http://www.feth.com) * version: 0.3.0 * * deep-extend: * license: MIT (http://opensource.org/licenses/MIT) * licenses: MIT (http://opensource.org/licenses/MIT) * author: Viacheslav Lotsmanov - * maintainers: unclechu * contributors: Romain Prieto, Max Maximov, Marshall Bowers * homepage: https://github.com/unclechu/node-deep-extend * version: 0.5.0 @@ -63,116 +54,92 @@ * define-properties: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb - * homepage: https://github.com/ljharb/define-properties#readme * version: 1.1.2 * * es-abstract: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb * contributors: Jordan Harband - * homepage: https://github.com/ljharb/es-abstract#readme - * version: 1.10.0 + * version: 1.7.0 * * es-to-primitive: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb - * homepage: https://github.com/ljharb/es-to-primitive#readme * version: 1.1.1 * * foreach: * license: MIT (http://opensource.org/licenses/MIT) * author: Manuel Stofer - * maintainers: manuelstofer * contributors: Manuel Stofer, Jordan Harband - * homepage: https://github.com/manuelstofer/foreach * version: 2.0.5 * * function-bind: - * license: MIT (http://opensource.org/licenses/MIT) + * licenses: MIT (http://opensource.org/licenses/MIT) * author: Raynos - * maintainers: raynos , ljharb * contributors: Raynos, Jordan Harband * homepage: https://github.com/Raynos/function-bind - * version: 1.1.1 + * version: 1.1.0 * * has: * licenses: MIT (http://opensource.org/licenses/MIT) * author: Thiago de Arruda - * maintainers: tarruda * homepage: https://github.com/tarruda/has * version: 1.0.1 * * ieee754: * license: BSD-3-Clause (http://opensource.org/licenses/BSD-3-Clause) * author: Feross Aboukhadijeh - * maintainers: feross * contributors: Romain Beauxis - * homepage: https://github.com/feross/ieee754#readme * version: 1.1.8 * * is-callable: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb * contributors: Jordan Harband - * homepage: https://github.com/ljharb/is-callable#readme * version: 1.1.3 * * is-date-object: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb - * homepage: https://github.com/ljharb/is-date-object#readme * version: 1.0.1 * * is-regex: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb * homepage: https://github.com/ljharb/is-regex * version: 1.0.4 * * is-symbol: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb - * homepage: https://github.com/ljharb/is-symbol * version: 1.0.1 * * isarray: * license: MIT (http://opensource.org/licenses/MIT) * author: Julian Gruber - * maintainers: juliangruber * homepage: https://github.com/juliangruber/isarray * version: 1.0.0 * * morphdom: * license: MIT (http://opensource.org/licenses/MIT) * author: Patrick Steele-Idem - * maintainers: mlrawlings , pnidem - * homepage: https://github.com/patrick-steele-idem/morphdom#readme - * version: 2.3.3 + * version: 2.3.1 * * object-keys: * license: MIT (http://opensource.org/licenses/MIT) * author: Jordan Harband - * maintainers: ljharb * contributors: Jordan Harband , Raynos , Nathan Rajlich , Ivan Starkov , Gary Katsevman - * homepage: https://github.com/ljharb/object-keys#readme * version: 1.0.11 * * This header is generated by licensify (https://github.com/twada/licensify) */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.aTable=t()}}(function(){return function(){function t(e,r,n){function o(a,l){if(!r[a]){if(!e[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[a]={exports:{}};e[a][0].call(u.exports,function(t){var r=e[a][1][t];return o(r||t)},u,u.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a1;)r=r[n.shift()];r[n.shift()]=e}},{key:"removeDataByString",value:function(t){for(var e=this.data,r=t.split(".");r.length>1;)e=e[r.shift()];var n=r.shift();n.match(/^\d+$/)?e.splice(Number(n),1):delete e[n]}},{key:"resolveBlock",value:function(t,e,r){var n=this,o=t.match(//g),i=t.match(//g),a=t.match(//g),l=t.match(//g);if(o)for(var s=0,c=o.length;s/g;return t=t.replace(e,function(t,e){return(0,a.selector)("#"+e).innerHTML})}},{key:"resolveWith",value:function(t){var e=/(([\n\r\t]|.)*?)/g;return t=t.replace(e,function(t,e){return t=t.replace(/data\-bind=['"](.*?)['"]/g,"data-bind='"+e+".$1'")})}},{key:"resolveLoop",value:function(t){var e=/(([\n\r\t]|.)*?)/g,r=this;return t=t.replace(e,function(t,e,n){var o=r.getDataByString(e),i=[];i="function"==typeof o?o.apply(r):o;var a="";if(i instanceof Array)for(var l=0,s=i.length;l(([\n\r\t]|.)*?)/g;return!!t.match(e)}},{key:"getHtml",value:function(t,e){var r=s(this.atemplate,function(e){return e.id===t}),n="";if(r&&r.html&&(n=r.html),e&&(n=t),!n)return"";var o=this.data;for(n=this.resolveInclude(n),n=this.resolveWith(n);this.hasLoop(n);)n=this.resolveLoop(n);return n=this.resolveBlock(n,o),n=n.replace(/\\([^\\])/g,"$1"),n=this.resolveAbsBlock(n),n.replace(/^([\t ])*\n/gm,"")}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"html",r=arguments[1],n=this.templates;this.beforeUpdated&&this.beforeUpdated();for(var o=0,i=n.length;o"+f+"");else(0,a.selector)(u).insertAdjacentHTML("afterend",'
'),"text"===e?(0,a.selector)("[data-id='"+c+"']").innerText=f:(0,a.selector)("[data-id='"+c+"']").innerHTML=f;var g=s(t.atemplate,function(t){return t.id===c});g.binded||(g.binded=!0,t.addDataBind((0,a.selector)("[data-id='"+c+"']")),t.addActionBind((0,a.selector)("[data-id='"+c+"']")))}(o);return this.updateBindingData(r),this.onUpdated&&this.onUpdated(r),this}},{key:"updateBindingData",value:function(t){for(var e=this,r=this.templates,n=0,o=r.length;n1?r-1:0),o=1;o1;)e=e[r.shift()];var n=r.shift();return n.match(/^\d+$/)?e.splice(Number(n),1):delete e[n],this}}]),t}();r.default=f,e.exports=r.default},{"./util":2,"array.prototype.find":4,morphdom:35}],2:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=r.matches=function(t,e){for(var r=(t.document||t.ownerDocument).querySelectorAll(e),n=r.length;--n>=0&&r.item(n)!==t;);return n>-1},o=(r.selector=function(t){return document.querySelector(t)},r.findAncestor=function(t,e){if("function"==typeof t.closest)return t.closest(e)||null;for(;t&&t!==document;){if(n(t,e))return t;t=t.parentElement}return null});r.on=function(t,e,r,n){r.split(" ").forEach(function(r){t.addEventListener(r,function(t){var r=(t.target,o(t.target,e));r&&(t.delegateTarget=r,n(t))})})}},{}],3:[function(t,e,r){"use strict";var n=t("es-abstract/es6");e.exports=function(t){var e=n.ToObject(this),r=n.ToInteger(n.ToLength(e.length));if(!n.IsCallable(t))throw new TypeError("Array#find: predicate must be a function");if(0!==r)for(var o,i=arguments[1],a=0;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function o(t){return 3*t.length/4-n(t)}function i(t){var e,r,o,i,a,l=t.length;i=n(t),a=new f(3*l/4-i),r=i>0?l-4:l;var s=0;for(e=0;e>16&255,a[s++]=o>>8&255,a[s++]=255&o;return 2===i?(o=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,a[s++]=255&o):1===i&&(o=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,a[s++]=o>>8&255,a[s++]=255&o),a}function a(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function l(t,e,r){for(var n,o=[],i=e;is?s:a+16383));return 1===n?(e=t[r-1],o+=c[e>>2],o+=c[e<<4&63],o+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],o+=c[e>>10],o+=c[e>>4&63],o+=c[e<<2&63],o+="="),i.push(o),i.join("")}r.byteLength=o,r.toByteArray=i,r.fromByteArray=s;for(var c=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,d=h.length;p1;)n=n[r.shift()];n[r.shift()]=e}},{key:"removeDataByString",value:function(t){for(var e=this.data,n=t.split(".");n.length>1;)e=e[n.shift()];var r=n.shift();r.match(/^\d+$/)?e.splice(Number(r),1):delete e[r]}},{key:"resolveBlock",value:function(t,e,n){var r=this,o=t.match(//g),i=t.match(//g),a=t.match(//g),l=t.match(//g);if(o)for(var s=0,c=o.length;s/g,function(t,e){return(0,a.selector)("#"+e).innerHTML})}},{key:"resolveWith",value:function(t){return t=t.replace(/(([\n\r\t]|.)*?)/g,function(t,e){return t=t.replace(/data\-bind=['"](.*?)['"]/g,"data-bind='"+e+".$1'")})}},{key:"resolveLoop",value:function(t){var e=this;return t=t.replace(/(([\n\r\t]|.)*?)/g,function(t,n,r){var o=e.getDataByString(n),i=[];i="function"==typeof o?o.apply(e):o;var a="";if(i instanceof Array)for(var l=0,s=i.length;l(([\n\r\t]|.)*?)/g)}},{key:"getHtml",value:function(t,e){var n=s(this.atemplate,function(e){return e.id===t}),r="";if(n&&n.html&&(r=n.html),e&&(r=t),!r)return"";var o=this.data;for(r=this.resolveInclude(r),r=this.resolveWith(r);this.hasLoop(r);)r=this.resolveLoop(r);return r=this.resolveBlock(r,o),r=r.replace(/\\([^\\])/g,"$1"),r=this.resolveAbsBlock(r),r.replace(/^([\t ])*\n/gm,"")}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"html",n=arguments[1],r=this.templates;this.beforeUpdated&&this.beforeUpdated();for(var o=0,i=r.length;o"+f+"");else(0,a.selector)(u).insertAdjacentHTML("afterend",'
'),"text"===e?(0,a.selector)("[data-id='"+c+"']").innerText=f:(0,a.selector)("[data-id='"+c+"']").innerHTML=f;var y=s(t.atemplate,function(t){return t.id===c});y.binded||(y.binded=!0,t.addDataBind((0,a.selector)("[data-id='"+c+"']")),t.addActionBind((0,a.selector)("[data-id='"+c+"']")))}(o);return this.updateBindingData(n),this.onUpdated&&this.onUpdated(n),this}},{key:"updateBindingData",value:function(t){for(var e=this,n=this.templates,r=0,o=n.length;r1?n-1:0),o=1;o1;)e=e[n.shift()];var r=n.shift();return r.match(/^\d+$/)?e.splice(Number(r),1):delete e[r],this}}]),t}();n.default=f,e.exports=n.default},{"./util":2,"array.prototype.find":4,morphdom:34}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=n.matches=function(t,e){for(var n=(t.document||t.ownerDocument).querySelectorAll(e),r=n.length;--r>=0&&n.item(r)!==t;);return r>-1},o=(n.selector=function(t){return document.querySelector(t)},n.findAncestor=function(t,e){if("function"==typeof t.closest)return t.closest(e)||null;for(;t&&t!==document;){if(r(t,e))return t;t=t.parentElement}return null});n.on=function(t,e,n,r){n.split(" ").forEach(function(n){t.addEventListener(n,function(t){var n=(t.target,o(t.target,e));n&&(t.delegateTarget=n,r(t))})})}},{}],3:[function(t,e,n){"use strict";var r=t("es-abstract/es6");e.exports=function(t){var e=r.ToObject(this),n=r.ToInteger(r.ToLength(e.length));if(!r.IsCallable(t))throw new TypeError("Array#find: predicate must be a function");if(0!==n)for(var o,i=arguments[1],a=0;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function o(t){return 3*t.length/4-r(t)}function i(t){var e,n,o,i,a,l,s=t.length;a=r(t),l=new f(3*s/4-a),o=a>0?s-4:s;var c=0;for(e=0,n=0;e>16&255,l[c++]=i>>8&255,l[c++]=255&i;return 2===a?(i=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,l[c++]=255&i):1===a&&(i=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,l[c++]=i>>8&255,l[c++]=255&i),l}function a(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function l(t,e,n){for(var r,o=[],i=e;is?s:a+16383));return 1===r?(e=t[n-1],o+=c[e>>2],o+=c[e<<4&63],o+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],o+=c[e>>10],o+=c[e>>4&63],o+=c[e<<2&63],o+="="),i.push(o),i.join("")}n.byteLength=o,n.toByteArray=i,n.fromByteArray=s;for(var c=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,d=h.length;p * @license MIT */ -"use strict";function n(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(n()=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),i.alloc(+t)}function g(t,e){if(i.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(t).length;default:if(n)return H(t).length;e=(""+e).toLowerCase(),n=!0}}function v(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e)return e&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,l=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,l/=2,s/=2,r/=2}var c;if(o){var u=-1;for(c=r;cl&&(r=l-s),c=r;c>=0;c--){for(var f=!0,h=0;ho&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a239?4:i>223?3:i>191?2:1;if(o+l<=r){var s,c,u,f;switch(l){case 1:i<128&&(a=i);break;case 2:s=t[o+1],128==(192&s)&&(f=(31&i)<<6|63&s)>127&&(a=f);break;case 3:s=t[o+1],c=t[o+2],128==(192&s)&&128==(192&c)&&(f=(15&i)<<12|(63&s)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:s=t[o+1],c=t[o+2],u=t[o+3],128==(192&s)&&128==(192&c)&&128==(192&u)&&(f=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&u)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,l=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=l}return N(n)}function N(t){var e=t.length;if(e<=Z)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,o,a){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function _(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return o||L(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function G(t,e,r,n,o){return o||L(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function Y(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function $(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(t){for(var e=[],r=0;r>8,o=r%256,i.push(o),i.push(n);return i}function K(t){return X.toByteArray(Y(t))}function z(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function W(t){return t!==t}var X=t("base64-js"),Q=t("ieee754"),J=t("isarray");r.Buffer=i,r.SlowBuffer=y,r.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=n(),i.poolSize=8192,i._augment=function(t){return t.__proto__=i.prototype,t},i.from=function(t,e,r){return a(null,t,e,r)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(t,e,r){return s(null,t,e,r)},i.allocUnsafe=function(t){return c(null,t)},i.allocUnsafeSlow=function(t){return c(null,t)},i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,a=Math.min(r,n);o0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var a=o-n,l=r-e,s=Math.min(a,l),c=this.slice(n,o),u=t.slice(e,r),f=0;fo)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return C(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(o*=256);)n+=this[t+--e]*o;return n},i.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],o=1,i=0;++i=o&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),Q.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),Q.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){j(this,t,e,r,Math.pow(2,8*r)-1,0)}var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);j(this,t,e,r,o-1,-o)}var i=0,a=1,l=0;for(this[e]=255&t;++i>0)-l&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);j(this,t,e,r,o-1,-o)}var i=r-1,a=1,l=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/a>>0)-l&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return G(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return G(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;a=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),i.alloc(+t)}function g(t,e){if(i.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return B(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,o);if("number"==typeof e)return e&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,o){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,l=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,l/=2,s/=2,n/=2}var c;if(o){var u=-1;for(c=n;cl&&(n=l-s),c=n;c>=0;c--){for(var f=!0,h=0;ho&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a239?4:i>223?3:i>191?2:1;if(o+l<=n){var s,c,u,f;switch(l){case 1:i<128&&(a=i);break;case 2:s=t[o+1],128==(192&s)&&(f=(31&i)<<6|63&s)>127&&(a=f);break;case 3:s=t[o+1],c=t[o+2],128==(192&s)&&128==(192&c)&&(f=(15&i)<<12|(63&s)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:s=t[o+1],c=t[o+2],u=t[o+3],128==(192&s)&&128==(192&c)&&128==(192&u)&&(f=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&u)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=l}return I(r)}function I(t){var e=t.length;if(e<=Z)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var o="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,r,o,a){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function _(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o>>8*(r?o:1-o)}function M(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o>>8*(r?o:3-o)&255}function L(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(t,e,n,r,o){return o||L(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(t,e,n,r,23,4),n+4}function G(t,e,n,r,o){return o||L(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(t,e,n,r,52,8),n+8}function Y(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function $(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,o=null,i=[],a=0;a55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function q(t){for(var e=[],n=0;n>8,o=n%256,i.push(o),i.push(r);return i}function z(t){return Q.toByteArray(Y(t))}function K(t,e,n,r){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function X(t){return t!==t}var Q=t("base64-js"),J=t("ieee754"),W=t("isarray");n.Buffer=i,n.SlowBuffer=y,n.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),n.kMaxLength=r(),i.poolSize=8192,i._augment=function(t){return t.__proto__=i.prototype,t},i.from=function(t,e,n){return a(null,t,e,n)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(t,e,n){return s(null,t,e,n)},i.allocUnsafe=function(t){return c(null,t)},i.allocUnsafeSlow=function(t){return c(null,t)},i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,a=Math.min(n,r);o0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,n,r,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var a=o-r,l=n-e,s=Math.min(a,l),c=this.slice(r,o),u=t.slice(e,n),f=0;fo)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return T(this,t,e,n);case"base64":return N(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;i.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],o=1,i=0;++i=o&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){j(this,t,e,n,Math.pow(2,8*n)-1,0)}var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=0,a=1,l=0;for(this[e]=255&t;++i>0)-l&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/a>>0)-l&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,n){return U(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return U(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return G(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return G(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;a * @license MIT @@ -198,6 +165,5 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"use strict";function r(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function n(e){if(e instanceof t){var r=new t(e.length);return e.copy(r),r}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(t){var e=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?e[a]=o(t):r(t)?e[a]=n(t):e[a]=i({},t):e[a]=t}),e}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var t,e,a=arguments[0],l=Array.prototype.slice.call(arguments,1);return l.forEach(function(l){"object"!=typeof l||null===l||Array.isArray(l)||Object.keys(l).forEach(function(s){return e=a[s],t=l[s],t===a?void 0:"object"!=typeof t||null===t?void(a[s]=t):Array.isArray(t)?void(a[s]=o(t)):r(t)?void(a[s]=n(t)):"object"!=typeof e||null===e||Array.isArray(e)?void(a[s]=i({},t)):void(a[s]=i(e,t))})}),a}}).call(this,t("buffer").Buffer)},{buffer:8}],12:[function(t,e,r){"use strict";var n=t("object-keys"),o=t("foreach"),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),a=Object.prototype.toString,l=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)},s=Object.defineProperty&&function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),c=function(t,e,r,n){(!(e in t)||l(n)&&n())&&(s?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},u=function(t,e){var r=arguments.length>2?arguments[2]:{},a=n(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(n){c(t,n,e[n],r[n])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:25,"object-keys":36}],13:[function(t,e,r){"use strict";var n=t("has"),o=t("es-to-primitive/es6"),i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,l=t("./helpers/isNaN"),s=t("./helpers/isFinite"),c=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,u=t("./helpers/assign"),f=t("./helpers/sign"),h=t("./helpers/mod"),p=t("./helpers/isPrimitive"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,Array.prototype.slice),v=y.call(Function.call,String.prototype.slice),b=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),w=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=y.call(Function.call,RegExp.prototype.exec),x=["…","​","￾"].join(""),E=new RegExp("["+x+"]","g"),T=y.call(Function.call,RegExp.prototype.test,E),C=/^[-+]0x[0-9a-f]+$/i,S=y.call(Function.call,RegExp.prototype.test,C),A=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),P=new RegExp("(^["+A+"]+)|(["+A+"]+$)","g"),I=y.call(Function.call,String.prototype.replace),N=function(t){return I(t,P,"")},k=t("./es5"),B=t("is-regex"),O=u(u({},k),{Call:function(t,e){var r=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,r)},ToPrimitive:o,ToNumber:function(t){var e=p(t)?t:o(t,Number);if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(b(e))return this.ToNumber(d(v(e,2),2));if(w(e))return this.ToNumber(d(v(e,2),8));if(T(e)||S(e))return NaN;var r=N(e);if(r!==e)return this.ToNumber(r)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(l(e)||0===e||!s(e))return 0;var r=f(e)*Math.floor(Math.abs(e));return h(r,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(l(e)||e<=0)return 0;if(e>=255)return 255;var r=Math.floor(t);return r+.5c?c:e},CanonicalNumericIndexString:function(t){if("[object String]"!==i.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:k.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===i.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!p(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||l(t)||!s(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(a){var e=t[Symbol.match];if(void 0!==e)return k.ToBoolean(e)}return B(t)},SameValueZero:function(t,e){return t===e||l(t)&&l(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var r=this.GetV(t,e);if(null!=r){if(!this.IsCallable(r))throw new TypeError(e+"is not a function");return r}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":k.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==this.Type(r))throw new TypeError("O.constructor is not an Object");var n=a&&Symbol.species?r[Symbol.species]:void 0;if(null==n)return e;if(this.IsConstructor(n))return n;throw new TypeError("no constructor found")},CompletePropertyDescriptor:function(t){if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return this.IsGenericDescriptor(t)||this.IsDataDescriptor(t)?(n(t,"[[Value]]")||(t["[[Value]]"]=void 0),n(t,"[[Writable]]")||(t["[[Writable]]"]=!1)):(n(t,"[[Get]]")||(t["[[Get]]"]=void 0),n(t,"[[Set]]")||(t["[[Set]]"]=void 0)),n(t,"[[Enumerable]]")||(t["[[Enumerable]]"]=!1),n(t,"[[Configurable]]")||(t["[[Configurable]]"]=!1),t},Set:function(t,e,r,n){if("Object"!==this.Type(t))throw new TypeError("O must be an Object");if(!this.IsPropertyKey(e))throw new TypeError("P must be a Property Key");if("Boolean"!==this.Type(n))throw new TypeError("Throw must be a Boolean");if(n)return t[e]=r,!0;try{t[e]=r}catch(t){return!1}},HasOwnProperty:function(t,e){if("Object"!==this.Type(t))throw new TypeError("O must be an Object");if(!this.IsPropertyKey(e))throw new TypeError("P must be a Property Key");return n(t,e)},HasProperty:function(t,e){if("Object"!==this.Type(t))throw new TypeError("O must be an Object");if(!this.IsPropertyKey(e))throw new TypeError("P must be a Property Key");return e in t},IsConcatSpreadable:function(t){if("Object"!==this.Type(t))return!1;if(a&&"symbol"==typeof Symbol.isConcatSpreadable){var e=this.Get(t,Symbol.isConcatSpreadable);if(void 0!==e)return this.ToBoolean(e)}return this.IsArray(t)},Invoke:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("P must be a Property Key");var r=g(arguments,2),n=this.GetV(t,e);return this.Call(n,t,r)},CreateIterResultObject:function(t,e){if("Boolean"!==this.Type(e))throw new TypeError("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}},RegExpExec:function(t,e){if("Object"!==this.Type(t))throw new TypeError("R must be an Object");if("String"!==this.Type(e))throw new TypeError("S must be a String");var r=this.Get(t,"exec");if(this.IsCallable(r)){var n=this.Call(r,t,[e]);if(null===n||"Object"===this.Type(n))return n;throw new TypeError('"exec" method must return `null` or an Object')}return m(t,e)},ArraySpeciesCreate:function(t,e){if(!this.IsInteger(e)||e<0)throw new TypeError("Assertion failed: length must be an integer >= 0");var r,n=0===e?0:e;if(this.IsArray(t)&&(r=this.Get(t,"constructor"),"Object"===this.Type(r)&&a&&Symbol.species&&null===(r=this.Get(r,Symbol.species))&&(r=void 0)),void 0===r)return Array(n);if(!this.IsConstructor(r))throw new TypeError("C must be a constructor");return new r(n)},CreateDataProperty:function(t,e,r){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=Object.getOwnPropertyDescriptor(t,e),o=n||"function"!=typeof Object.isExtensible||Object.isExtensible(t);if(n&&(!n.writable||!n.configurable)||!o)return!1;var i={configurable:!0,enumerable:!0,value:r,writable:!0};return Object.defineProperty(t,e,i),!0},CreateDataPropertyOrThrow:function(t,e,r){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.CreateDataProperty(t,e,r);if(!n)throw new TypeError("unable to create data property");return n},AdvanceStringIndex:function(t,e,r){if("String"!==this.Type(t))throw new TypeError("Assertion failed: Type(S) is not String");if(!this.IsInteger(e))throw new TypeError("Assertion failed: length must be an integer >= 0 and <= (2**53 - 1)");if(e<0||e>c)throw new RangeError("Assertion failed: length must be an integer >= 0 and <= (2**53 - 1)");if("Boolean"!==this.Type(r))throw new TypeError("Assertion failed: Type(unicode) is not Boolean");if(!r)return e+1;if(e+1>=t.length)return e+1;var n=t.charCodeAt(e);if(n<55296||n>56319)return e+1;var o=t.charCodeAt(e+1);return o<56320||o>57343?e+1:e+2}});delete O.CheckObjectCoercible,e.exports=O},{"./es5":14,"./helpers/assign":16,"./helpers/isFinite":17,"./helpers/isNaN":18,"./helpers/isPrimitive":19,"./helpers/mod":20,"./helpers/sign":21,"es-to-primitive/es6":23,"function-bind":27,has:28,"is-regex":32}],14:[function(t,e,r){"use strict";var n=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c=t("has"),u={ToPrimitive:s,ToBoolean:function(t){return!!t},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return n(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(n(e)||0===e||!o(e))return 0;var r=i(e)*Math.floor(Math.abs(e));return a(r,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0},IsPropertyDescriptor:function(t){if("Object"!==this.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(c(t,r)&&!e[r])return!1;var n=c(t,"[[Value]]"),o=c(t,"[[Get]]")||c(t,"[[Set]]");if(n&&o)throw new TypeError("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return!(!c(t,"[[Get]]")&&!c(t,"[[Set]]"))},IsDataDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return!(!c(t,"[[Value]]")&&!c(t,"[[Writable]]"))},IsGenericDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");return!this.IsAccessorDescriptor(t)&&!this.IsDataDescriptor(t)},FromPropertyDescriptor:function(t){if(void 0===t)return t;if(!this.IsPropertyDescriptor(t))throw new TypeError("Desc must be a Property Descriptor");if(this.IsDataDescriptor(t))return{value:t["[[Value]]"],writable:!!t["[[Writable]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};if(this.IsAccessorDescriptor(t))return{get:t["[[Get]]"],set:t["[[Set]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};throw new TypeError("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(t){if("Object"!==this.Type(t))throw new TypeError("ToPropertyDescriptor requires an object");var e={};if(c(t,"enumerable")&&(e["[[Enumerable]]"]=this.ToBoolean(t.enumerable)),c(t,"configurable")&&(e["[[Configurable]]"]=this.ToBoolean(t.configurable)),c(t,"value")&&(e["[[Value]]"]=t.value),c(t,"writable")&&(e["[[Writable]]"]=this.ToBoolean(t.writable)),c(t,"get")){var r=t.get;if(void 0!==r&&!this.IsCallable(r))throw new TypeError("getter must be a function");e["[[Get]]"]=r}if(c(t,"set")){var n=t.set;if(void 0!==n&&!this.IsCallable(n))throw new TypeError("setter must be a function");e["[[Set]]"]=n}if((c(e,"[[Get]]")||c(e,"[[Set]]"))&&(c(e,"[[Value]]")||c(e,"[[Writable]]")))throw new TypeError("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}};e.exports=u},{"./helpers/isFinite":17,"./helpers/isNaN":18,"./helpers/mod":20,"./helpers/sign":21,"es-to-primitive/es5":22,has:28,"is-callable":30}],15:[function(t,e,r){"use strict";e.exports=t("./es2015")},{"./es2015":13}],16:[function(t,e,r){var n=Object.prototype.hasOwnProperty;e.exports=function(t,e){if(Object.assign)return Object.assign(t,e);for(var r in e)n.call(e,r)&&(t[r]=e[r]);return t}},{}],17:[function(t,e,r){var n=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!n(t)&&t!==1/0&&t!==-1/0}},{}],18:[function(t,e,r){e.exports=Number.isNaN||function(t){return t!==t}},{}],19:[function(t,e,r){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],20:[function(t,e,r){e.exports=function(t,e){var r=t%e;return Math.floor(r>=0?r:r+e)}},{}],21:[function(t,e,r){e.exports=function(t){return t>=0?1:-1}},{}],22:[function(t,e,r){"use strict";var n=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var r=e||("[object Date]"===n.call(t)?String:Number);if(r===String||r===Number){var a,l,s=r===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?r="string":e===Number&&(r="number"));var i;if(n&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,r);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||l(t))&&(r="string"),s(t,"default"===r?"number":r)}},{"./helpers/isPrimitive":24,"is-callable":30,"is-date-object":31,"is-symbol":33}],24:[function(t,e,r){arguments[4][19][0].apply(r,arguments)},{dup:19}],25:[function(t,e,r){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,r){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=r?o-1:0,h=r?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)},r.write=function(t,e,r,n,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[r+p]=255&a,p+=d,a/=256,c-=8);t[r+p-d]|=128*y}},{}],30:[function(t,e,r){"use strict";var n=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=n.call(t),r=e.replace(/\/\/.*\n/g,""),i=r.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(n.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],31:[function(t,e,r){"use strict";var n=Date.prototype.getDay,o=function(t){try{return n.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],32:[function(t,e,r){"use strict";var n=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!n(e,"value"))&&a(t)}},{has:28}],33:[function(t,e,r){"use strict";var n=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],34:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],35:[function(t,e,r){"use strict";function n(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var r=t.nodeName,n=e.nodeName;return r===n||!!(e.actualize&&r.charCodeAt(0)<91&&n.charCodeAt(0)>90)&&r===n.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var r=t.firstChild;r;){var n=r.nextSibling;e.appendChild(r),r=n}return e}function l(t,e){var r,n,o,i,a,l=e.attributes;for(r=l.length-1;r>=0;--r)n=l[r],o=n.name,i=n.namespaceURI,a=n.value,i?(o=n.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,r=l.length-1;r>=0;--r)n=l[r],!1!==n.specified&&(o=n.name,i=n.namespaceURI,i?(o=n.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,r){t[r]!==e[r]&&(t[r]=e[r],t[r]?t.setAttribute(r,""):t.removeAttribute(r,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,r){return t.hasAttributeNS(e,r)}:y.hasAttribute?function(t,e,r){return t.hasAttribute(r)}:function(t,e,r){return null!=t.getAttributeNode(e,r)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var r=e.value;t.value!==r&&(t.value=r);var n=t.firstChild;if(n){var o=n.nodeValue;if(o==r||!r&&o==t.placeholder)return;n.nodeValue=r}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var r=0,n=e.firstChild;n;){var o=n.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(n,null,"selected")){r;break}r++}n=n.nextSibling}t.selectedIndex=r}}},b=1,w=3,m=8,x=function(t){return function(e,r,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var r=t.firstChild;r;){var n=void 0;e&&(n=T(r))?s(n):(N(r),r.firstChild&&f(r,e)),r=r.nextSibling}}function h(t,e,r){!1!==I(t)&&(e&&e.removeChild(t),N(t),f(t,r))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var r=T(e);r&&(O[r]=e),p(e),e=e.nextSibling}}function y(t){S(t);for(var e=t.firstChild;e;){var r=e.nextSibling,n=T(e);if(n){var i=O[n];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=r}}function g(n,i,a){var l,c=T(i);if(c&&delete O[c],!r.isSameNode||!r.isSameNode(e)){if(!a){if(!1===A(n,i))return;if(t(n,i),P(n),!1===k(n,i))return}if("TEXTAREA"!==n.nodeName){var u,f,p,x,E=i.firstChild,S=n.firstChild;t:for(;E;){for(p=E.nextSibling,u=T(E);S;){if(f=S.nextSibling,E.isSameNode&&E.isSameNode(S)){E=p,S=f;continue t}l=T(S);var I=S.nodeType,N=void 0;if(I===E.nodeType&&(I===b?(u?u!==l&&((x=O[u])?S.nextSibling===x?N=!1:(n.insertBefore(x,S),f=S.nextSibling,l?s(l):h(S,n,!0),S=x):N=!1):l&&(N=!1),(N=!1!==N&&o(S,E))&&g(S,E)):I!==w&&I!=m||(N=!0,S.nodeValue!==E.nodeValue&&(S.nodeValue=E.nodeValue))),N){E=p,S=f;continue t}l?s(l):h(S,n,!0),S=f}if(u&&(x=O[u])&&o(x,E))n.appendChild(x),g(x,E);else{var B=C(E);!1!==B&&(B&&(E=B),E.actualize&&(E=E.actualize(n.ownerDocument||d)),n.appendChild(E),y(E))}E=p,S=f}for(;S;)f=S.nextSibling,(l=T(S))?s(l):h(S,n,!0),S=f}var R=v[n.nodeName];R&&R(n,i)}}if(l||(l={}),"string"==typeof r)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=r;r=d.createElement("html"),r.innerHTML=x}else r=n(r);var E,T=l.getNodeKey||u,C=l.onBeforeNodeAdded||c,S=l.onNodeAdded||c,A=l.onBeforeElUpdated||c,P=l.onElUpdated||c,I=l.onBeforeNodeDiscarded||c,N=l.onNodeDiscarded||c,k=l.onBeforeElChildrenUpdated||c,B=!0===l.childrenOnly,O={};p(e);var R=e,D=R.nodeType,j=r.nodeType;if(!B)if(D===b)j===b?o(e,r)||(N(e),R=a(e,i(r.nodeName,r.namespaceURI))):R=r;else if(D===w||D===m){if(j===D)return R.nodeValue!==r.nodeValue&&(R.nodeValue=r.nodeValue),R;R=r}if(R===r)N(e);else if(g(R,r,B),E)for(var _=0,M=E.length;_0&&!n.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===n.call(t.callee)),r}},{}],38:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var l=function(){function t(t,e){for(var r=0;r\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',w={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},m=function(t){function e(t,r){o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.id=e.getUniqId(),n.menu_id=e.getUniqId(),n.addTemplate(n.id,g),n.addTemplate(n.menu_id,y.default.removeIndentNewline(v)),n.data=(0,p.default)({},w,r);var a=n.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=n.parse(""+l.innerHTML+"
    "),a.tableResult=n.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=n.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),n.convert={},n.convert.getStyleByAlign=n.getStyleByAlign,n.convert.setClass=n.setClass;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),n.update(),n}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],r=0;return e?(e.col.forEach(function(e){for(var n=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var r=this.data;r.point={x:e,y:t},r.row.forEach(function(r,n){if(!r||!r.col)return!1;r.col.forEach(function(r,o){n===t&&o===e||(r.selected=!1)})}),r.row[t].col[e].selected||(r.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,r=0,n=e.length;r1&&void 0!==arguments[1]?arguments[1]:"html",r=this,n=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var n={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?n.type="th":n.type="td",n.colspan=t.getAttribute("colspan")||1,n.rowspan=t.getAttribute("rowspan")||1,n.value="",o&&(n.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=r.getAlignByStyle(t);e?n.align=e:l+=" "+t})}n.cellClass=l.substr(1),i.push(n)}),n.push(o)}),n}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var r={},n=[];r.col=n,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),n.push(e)}),e.push(r)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),r="",n=e.querySelectorAll("tr");return[].forEach.call(n,function(t,e){r+="| ";var n=t.querySelectorAll("td,th");[].forEach.call(n,function(t){r+=t.innerHTML,r+=" | "}),0===e&&(r+="\n| ",[].forEach.call(n,function(t){r+="--- | "})),r+="\n"}),r}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(e)}else if(void 0!==document.body.createTextRange){var n=document.body.createTextRange();n.moveToElementText(t),n.collapse(!1),n.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),r=this.getLargePoint.apply(null,e),n=(r.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),n){o.style.width="9999px";var l=n.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,r=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=r.pop();e&&(0===r.length&&r.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var r=this.data,n=r.row;n[t]?n.splice(t,0,{col:e}):n.length===t&&n.push({col:e})}},{key:"insertCellAt",value:function(t,e,r){var n=this.data,o=n.row;o[t]&&o[t].col&&o[t].col.splice(e,0,r)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var r=this.getAllPoints(),n=this.getLargePoint.apply(null,r),o={x:parseInt(t),y:0,width:1,height:n.height},i=[],a=this;r.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),r=this.getLargePoint.apply(null,e),n={x:0,y:parseInt(t),width:r.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(n,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var r=this,n=this.getAllPoints(),o=this.getLargePoint.apply(null,n),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];n.forEach(function(t){r.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=r.getCellByPos(t.x,t.y);1===e.colspan?r.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var r=this,n=this.getAllPoints(),o=this.getLargePoint.apply(null,n);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];n.forEach(function(t){r.hitTest(i,t)&&l.push(t)}),n.forEach(function(t){if(r.hitTest(a,t)){var e=r.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var n=r.getCellByPos(e.x,e.y);1===n.rowspan?s.push(n):(n.rowspan=parseInt(n.rowspan)-1,t===e.y&&(n.x=e.x,c.push(n)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){r.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,r){var n=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(r),parseInt(t)];if(r=s[0],t=s[1],n.mode="cell",n.selectedRowNo=-1,n.selectedColNo=-1,n.showMenu=!1,"compositionstart"===i)n.beingInput=!0;else if("compositionend"===i)n.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[r].col[t].selected||this.data.beingInput||(this.select(r,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+r&&(n.history.push((0,f.default)(n.row)),n.row[r].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+r&&(n.history.push((0,f.default)(n.row)),n.row[r].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(r,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[r].col[t].selected||(this.select(r,t),this.update()));else this.e.shiftKey&&this.selectRange(r,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,r){if(!t.col)return!1;e+="",t.col.forEach(function(t,r){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),r=this.getCellIndexByPos(e.x,e.y),n=this.getCellByIndex(r.col,r.row),o=n.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var r=this;if(t.childNodes&&t.childNodes.length>0){var n=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(n)}else setTimeout(function(){r.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var r=this.getSelectedPoint(),n=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(n&&n[0]){var i=this.parse(n[0],"text");if(i&&i.length)return this.insertTable(i,{x:r.x,y:r.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var r=this,n=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-n.x,a=e.y+o.y-n.y,l=n.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var T=w.y,C=T+w.height;T1?(n.colspan=parseInt(n.colspan)+1,n.colspan+=""):r.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var r=this,n=this.getAllPoints(),o=this.getLargePoint.apply(null,n),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(n.forEach(function(t){r.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(n.colspan=parseInt(n.colspan)+1,n.colspan+=""):r.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var r=this,n=this.getAllPoints(),o=this.getLargePoint.apply(null,n);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(n.forEach(function(t){r.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(n.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(n.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var n=this.getSelectedPoint(),o={x:0,y:n.y,width:n.x,height:n.height},i=this.getAllPoints(),a=this.getCellIndexByPos(n.x,n.y),l=this.getCellByPos(n.x,n.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=n.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),r="unknown";return-1!=t.indexOf("msie")?r=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?r="ie11":-1!=t.indexOf("chrome")?r="chrome":-1!=t.indexOf("safari")?r="safari":-1!=t.indexOf("opera")?r="opera":-1!=t.indexOf("firefox")&&(r="firefox"),r}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);r.default=m,e.exports=r.default},{"./util.js":39,"a-template":1,clone:9,"deep-extend":11}],39:[function(t,e,r){"use strict";function n(t){t=t||{};for(var e=1;e2?arguments[2]:{},a=r(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(r){c(t,r,e[r],n[r])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:24,"object-keys":35}],13:[function(t,e,n){"use strict";var r=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c={ToPrimitive:s,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return a(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=c},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,a=t("./helpers/isNaN"),l=t("./helpers/isFinite"),s=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,c=t("./helpers/assign"),u=t("./helpers/sign"),f=t("./helpers/mod"),h=t("./helpers/isPrimitive"),p=t("es-to-primitive/es6"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,String.prototype.slice),v=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),b=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=["…","​","￾"].join(""),w=new RegExp("["+m+"]","g"),x=y.call(Function.call,RegExp.prototype.test,w),E=y.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),C=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),T=new RegExp("(^["+C+"]+)|(["+C+"]+$)","g"),N=y.call(Function.call,String.prototype.replace),A=function(t){return N(t,T,"")},S=t("./es5"),k=t("is-regex"),I=c(c({},S),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:p,ToNumber:function(t){var e=h(t)?t:p(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(g(e,2),2));if(b(e))return this.ToNumber(d(g(e,2),8));if(x(e)||E(e))return NaN;var n=A(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!l(e))return 0;var n=u(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(a(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5s?s:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:S.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!h(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||a(t)||!l(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if(void 0!==e)return S.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||a(t)&&a(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":S.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete I.CheckObjectCoercible,e.exports=I},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}},{}],16:[function(t,e,n){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],17:[function(t,e,n){e.exports=Number.isNaN||function(t){return t!==t}},{}],18:[function(t,e,n){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],19:[function(t,e,n){e.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},{}],20:[function(t,e,n){e.exports=function(t){return t>=0?1:-1}},{}],21:[function(t,e,n){"use strict";var r=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var a,l,s=n===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,n);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||l(t))&&(n="string"),s(t,"default"===n?"number":n)}},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],24:[function(t,e,n){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,n){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=n?o-1:0,h=n?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*y}},{}],29:[function(t,e,n){"use strict";var r=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=r.call(t),n=e.replace(/\/\/.*\n/g,""),i=n.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(r.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],30:[function(t,e,n){"use strict";var r=Date.prototype.getDay,o=function(t){try{return r.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],31:[function(t,e,n){"use strict";var r=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&a(t)}},{has:27}],32:[function(t,e,n){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],33:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],34:[function(t,e,n){"use strict";function r(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function l(t,e){var n,r,o,i,a,l=e.attributes;for(n=l.length-1;n>=0;--n)r=l[n],o=r.name,i=r.namespaceURI,a=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,n=l.length-1;n>=0;--n)r=l[n],!1!==r.specified&&(o=r.name,i=r.namespaceURI,i?(o=r.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:y.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;if(t.value!==n&&(t.value=n),t.firstChild){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},b=1,m=3,w=8,x=function(t){return function(e,n,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var n=t.firstChild;n;){var r=void 0;e&&(r=C(n))?s(r):(I(n),n.firstChild&&f(n,e)),n=n.nextSibling}}function h(t,e,n){!1!==k(t)&&(e&&e.removeChild(t),I(t),f(t,n))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var n=C(e);n&&(R[n]=e),p(e),e=e.nextSibling}}function y(t){N(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=C(e);if(r){var i=R[r];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=n}}function g(r,i,a){var l,c=C(i);if(c&&delete R[c],!n.isSameNode||!n.isSameNode(e)){if(!a){if(!1===A(r,i))return;if(t(r,i),S(r),!1===B(r,i))return}if("TEXTAREA"!==r.nodeName){var u,f,p,x,E=i.firstChild,N=r.firstChild;t:for(;E;){for(p=E.nextSibling,u=C(E);N;){if(f=N.nextSibling,E.isSameNode&&E.isSameNode(N)){E=p,N=f;continue t}l=C(N);var k=N.nodeType,I=void 0;if(k===E.nodeType&&(k===b?(u?u!==l&&((x=R[u])?N.nextSibling===x?I=!1:(r.insertBefore(x,N),f=N.nextSibling,l?s(l):h(N,r,!0),N=x):I=!1):l&&(I=!1),(I=!1!==I&&o(N,E))&&g(N,E)):k!==m&&k!=w||(I=!0,N.nodeValue=E.nodeValue)),I){E=p,N=f;continue t}l?s(l):h(N,r,!0),N=f}if(u&&(x=R[u])&&o(x,E))r.appendChild(x),g(x,E);else{var P=T(E);!1!==P&&(P&&(E=P),E.actualize&&(E=E.actualize(r.ownerDocument||d)),r.appendChild(E),y(E))}E=p,N=f}for(;N;)f=N.nextSibling,(l=C(N))?s(l):h(N,r,!0),N=f}var O=v[r.nodeName];O&&O(r,i)}}if(l||(l={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=n;n=d.createElement("html"),n.innerHTML=x}else n=r(n);var E,C=l.getNodeKey||u,T=l.onBeforeNodeAdded||c,N=l.onNodeAdded||c,A=l.onBeforeElUpdated||c,S=l.onElUpdated||c,k=l.onBeforeNodeDiscarded||c,I=l.onNodeDiscarded||c,B=l.onBeforeElChildrenUpdated||c,P=!0===l.childrenOnly,R={};p(e);var O=e,D=O.nodeType,j=n.nodeType;if(!P)if(D===b)j===b?o(e,n)||(I(e),O=a(e,i(n.nodeName,n.namespaceURI))):O=n;else if(D===m||D===w){if(j===D)return O.nodeValue=n.nodeValue,O;O=n}if(O===n)I(e);else if(g(O,n,P),E)for(var _=0,M=E.length;_0&&!r.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},{}],37:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',m={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},w=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.id=e.getUniqId(),r.menu_id=e.getUniqId(),r.addTemplate(r.id,g),r.addTemplate(r.menu_id,y.default.removeIndentNewline(v)),r.data=(0,p.default)({},m,n);var a=r.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=r.parse(""+l.innerHTML+"
    "),a.tableResult=r.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=r.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),r.convert={},r.convert.getStyleByAlign=r.getStyleByAlign,r.convert.setClass=r.setClass +;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}else if(void 0!==document.body.createTextRange){var r=document.body.createTextRange();r.moveToElementText(t),r.collapse(!1),r.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e Date: Tue, 3 Sep 2024 21:01:43 +0900 Subject: [PATCH 03/14] Implement afterAction trigger copy diff from https://github.com/movabletype/movabletype/commit/45ed1c31645ab24b21865643169cf5549240d7fb --- src/index.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9b1208e..aac28ce 100644 --- a/src/index.js +++ b/src/index.js @@ -698,6 +698,9 @@ export default class aTable extends aTemplate { }); data.history.push(clone(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } removeRow(selectedno) { @@ -1100,6 +1103,9 @@ export default class aTable extends aTemplate { }); data.history.push(clone(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } insertColLeft(selectedno) { @@ -1125,6 +1131,9 @@ export default class aTable extends aTemplate { } data.history.push(clone(data.row)); self.update(); + if (this.afterAction) { + this.afterAction(); + } return; } targetPoints.forEach((point) => { @@ -1142,6 +1151,9 @@ export default class aTable extends aTemplate { }); data.history.push(clone(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } beforeUpdated() { @@ -1274,6 +1286,9 @@ export default class aTable extends aTemplate { data.showMenu = false; data.history.push(clone(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } splitCell() { @@ -1355,6 +1370,9 @@ export default class aTable extends aTemplate { data.history.push(clone(data.row)); data.splited = true; this.update(); + if (this.afterAction) { + this.afterAction(); + } } changeCellTypeTo(type) { @@ -1369,6 +1387,9 @@ export default class aTable extends aTemplate { data.showMenu = false; data.history.push(clone(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } align(align) { @@ -1383,6 +1404,9 @@ export default class aTable extends aTemplate { data.showMenu = false; data.history.push(clone(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } getStyleByAlign(val) { @@ -1445,6 +1469,9 @@ export default class aTable extends aTemplate { }); data.history.push(clone(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } changeSelectOption() { @@ -1515,4 +1542,4 @@ export default class aTable extends aTemplate { return (Date.now().toString(36) + Math.random().toString(36).substr(2, 5)).toUpperCase(); } -} \ No newline at end of file +} From c5ffbb8ddd3cf203c1ee9a0e1ddc3d2d77a52cda Mon Sep 17 00:00:00 2001 From: Masahiro Iuchi Date: Tue, 3 Sep 2024 21:13:30 +0900 Subject: [PATCH 04/14] yarn build:js --- build/a-table.js | 27 +++++++++++++++++++++++++++ build/a-table.min.js | 8 ++++---- lib/index.js | 27 +++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/build/a-table.js b/build/a-table.js index 69a1c55..50bcb4d 100644 --- a/build/a-table.js +++ b/build/a-table.js @@ -5747,6 +5747,9 @@ var aTable = function (_aTemplate) { }); data.history.push((0, _clone2.default)(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } }, { key: 'removeRow', @@ -6166,6 +6169,9 @@ var aTable = function (_aTemplate) { }); data.history.push((0, _clone2.default)(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } }, { key: 'insertColLeft', @@ -6192,6 +6198,9 @@ var aTable = function (_aTemplate) { } data.history.push((0, _clone2.default)(data.row)); self.update(); + if (this.afterAction) { + this.afterAction(); + } return; } targetPoints.forEach(function (point) { @@ -6209,6 +6218,9 @@ var aTable = function (_aTemplate) { }); data.history.push((0, _clone2.default)(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } }, { key: 'beforeUpdated', @@ -6345,6 +6357,9 @@ var aTable = function (_aTemplate) { data.showMenu = false; data.history.push((0, _clone2.default)(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } }, { key: 'splitCell', @@ -6427,6 +6442,9 @@ var aTable = function (_aTemplate) { data.history.push((0, _clone2.default)(data.row)); data.splited = true; this.update(); + if (this.afterAction) { + this.afterAction(); + } } }, { key: 'changeCellTypeTo', @@ -6442,6 +6460,9 @@ var aTable = function (_aTemplate) { data.showMenu = false; data.history.push((0, _clone2.default)(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } }, { key: 'align', @@ -6457,6 +6478,9 @@ var aTable = function (_aTemplate) { data.showMenu = false; data.history.push((0, _clone2.default)(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } }, { key: 'getStyleByAlign', @@ -6524,6 +6548,9 @@ var aTable = function (_aTemplate) { }); data.history.push((0, _clone2.default)(data.row)); this.update(); + if (this.afterAction) { + this.afterAction(); + } } }, { key: 'changeSelectOption', diff --git a/build/a-table.min.js b/build/a-table.min.js index d128e47..daa736c 100644 --- a/build/a-table.min.js +++ b/build/a-table.min.js @@ -133,13 +133,13 @@ * * This header is generated by licensify (https://github.com/twada/licensify) */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.aTable=t()}}(function(){return function t(e,n,r){function o(a,l){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return o(n||t)},u,u.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a1;)n=n[r.shift()];n[r.shift()]=e}},{key:"removeDataByString",value:function(t){for(var e=this.data,n=t.split(".");n.length>1;)e=e[n.shift()];var r=n.shift();r.match(/^\d+$/)?e.splice(Number(r),1):delete e[r]}},{key:"resolveBlock",value:function(t,e,n){var r=this,o=t.match(//g),i=t.match(//g),a=t.match(//g),l=t.match(//g);if(o)for(var s=0,c=o.length;s/g,function(t,e){return(0,a.selector)("#"+e).innerHTML})}},{key:"resolveWith",value:function(t){return t=t.replace(/(([\n\r\t]|.)*?)/g,function(t,e){return t=t.replace(/data\-bind=['"](.*?)['"]/g,"data-bind='"+e+".$1'")})}},{key:"resolveLoop",value:function(t){var e=this;return t=t.replace(/(([\n\r\t]|.)*?)/g,function(t,n,r){var o=e.getDataByString(n),i=[];i="function"==typeof o?o.apply(e):o;var a="";if(i instanceof Array)for(var l=0,s=i.length;l(([\n\r\t]|.)*?)/g)}},{key:"getHtml",value:function(t,e){var n=s(this.atemplate,function(e){return e.id===t}),r="";if(n&&n.html&&(r=n.html),e&&(r=t),!r)return"";var o=this.data;for(r=this.resolveInclude(r),r=this.resolveWith(r);this.hasLoop(r);)r=this.resolveLoop(r);return r=this.resolveBlock(r,o),r=r.replace(/\\([^\\])/g,"$1"),r=this.resolveAbsBlock(r),r.replace(/^([\t ])*\n/gm,"")}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"html",n=arguments[1],r=this.templates;this.beforeUpdated&&this.beforeUpdated();for(var o=0,i=r.length;o"+f+"");else(0,a.selector)(u).insertAdjacentHTML("afterend",'
    '),"text"===e?(0,a.selector)("[data-id='"+c+"']").innerText=f:(0,a.selector)("[data-id='"+c+"']").innerHTML=f;var y=s(t.atemplate,function(t){return t.id===c});y.binded||(y.binded=!0,t.addDataBind((0,a.selector)("[data-id='"+c+"']")),t.addActionBind((0,a.selector)("[data-id='"+c+"']")))}(o);return this.updateBindingData(n),this.onUpdated&&this.onUpdated(n),this}},{key:"updateBindingData",value:function(t){for(var e=this,n=this.templates,r=0,o=n.length;r1?n-1:0),o=1;o1;)e=e[n.shift()];var r=n.shift();return r.match(/^\d+$/)?e.splice(Number(r),1):delete e[r],this}}]),t}();n.default=f,e.exports=n.default},{"./util":2,"array.prototype.find":4,morphdom:34}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=n.matches=function(t,e){for(var n=(t.document||t.ownerDocument).querySelectorAll(e),r=n.length;--r>=0&&n.item(r)!==t;);return r>-1},o=(n.selector=function(t){return document.querySelector(t)},n.findAncestor=function(t,e){if("function"==typeof t.closest)return t.closest(e)||null;for(;t&&t!==document;){if(r(t,e))return t;t=t.parentElement}return null});n.on=function(t,e,n,r){n.split(" ").forEach(function(n){t.addEventListener(n,function(t){var n=(t.target,o(t.target,e));n&&(t.delegateTarget=n,r(t))})})}},{}],3:[function(t,e,n){"use strict";var r=t("es-abstract/es6");e.exports=function(t){var e=r.ToObject(this),n=r.ToInteger(r.ToLength(e.length));if(!r.IsCallable(t))throw new TypeError("Array#find: predicate must be a function");if(0!==n)for(var o,i=arguments[1],a=0;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function o(t){return 3*t.length/4-r(t)}function i(t){var e,n,o,i,a,l,s=t.length;a=r(t),l=new f(3*s/4-a),o=a>0?s-4:s;var c=0;for(e=0,n=0;e>16&255,l[c++]=i>>8&255,l[c++]=255&i;return 2===a?(i=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,l[c++]=255&i):1===a&&(i=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,l[c++]=i>>8&255,l[c++]=255&i),l}function a(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function l(t,e,n){for(var r,o=[],i=e;is?s:a+16383));return 1===r?(e=t[n-1],o+=c[e>>2],o+=c[e<<4&63],o+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],o+=c[e>>10],o+=c[e>>4&63],o+=c[e<<2&63],o+="="),i.push(o),i.join("")}n.byteLength=o,n.toByteArray=i,n.fromByteArray=s;for(var c=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,d=h.length;p1;)n=n[r.shift()];n[r.shift()]=e}},{key:"removeDataByString",value:function(t){for(var e=this.data,n=t.split(".");n.length>1;)e=e[n.shift()];var r=n.shift();r.match(/^\d+$/)?e.splice(Number(r),1):delete e[r]}},{key:"resolveBlock",value:function(t,e,n){var r=this,o=t.match(//g),i=t.match(//g),a=t.match(//g),l=t.match(//g);if(o)for(var s=0,c=o.length;s/g,function(t,e){return(0,a.selector)("#"+e).innerHTML})}},{key:"resolveWith",value:function(t){return t=t.replace(/(([\n\r\t]|.)*?)/g,function(t,e){return t=t.replace(/data\-bind=['"](.*?)['"]/g,"data-bind='"+e+".$1'")})}},{key:"resolveLoop",value:function(t){var e=this;return t=t.replace(/(([\n\r\t]|.)*?)/g,function(t,n,r){var o=e.getDataByString(n),i=[];i="function"==typeof o?o.apply(e):o;var a="";if(i instanceof Array)for(var l=0,s=i.length;l(([\n\r\t]|.)*?)/g)}},{key:"getHtml",value:function(t,e){var n=s(this.atemplate,function(e){return e.id===t}),r="";if(n&&n.html&&(r=n.html),e&&(r=t),!r)return"";var o=this.data;for(r=this.resolveInclude(r),r=this.resolveWith(r);this.hasLoop(r);)r=this.resolveLoop(r);return r=this.resolveBlock(r,o),r=r.replace(/\\([^\\])/g,"$1"),r=this.resolveAbsBlock(r),r.replace(/^([\t ])*\n/gm,"")}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"html",n=arguments[1],r=this.templates;this.beforeUpdated&&this.beforeUpdated();for(var o=0,i=r.length;o"+f+"");else(0,a.selector)(u).insertAdjacentHTML("afterend",'
    '),"text"===e?(0,a.selector)("[data-id='"+c+"']").innerText=f:(0,a.selector)("[data-id='"+c+"']").innerHTML=f;var y=s(t.atemplate,function(t){return t.id===c});y.binded||(y.binded=!0,t.addDataBind((0,a.selector)("[data-id='"+c+"']")),t.addActionBind((0,a.selector)("[data-id='"+c+"']")))}(o);return this.updateBindingData(n),this.onUpdated&&this.onUpdated(n),this}},{key:"updateBindingData",value:function(t){for(var e=this,n=this.templates,r=0,o=n.length;r1?n-1:0),o=1;o1;)e=e[n.shift()];var r=n.shift();return r.match(/^\d+$/)?e.splice(Number(r),1):delete e[r],this}}]),t}();n.default=f,e.exports=n.default},{"./util":2,"array.prototype.find":4,morphdom:34}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=n.matches=function(t,e){for(var n=(t.document||t.ownerDocument).querySelectorAll(e),r=n.length;--r>=0&&n.item(r)!==t;);return r>-1},o=(n.selector=function(t){return document.querySelector(t)},n.findAncestor=function(t,e){if("function"==typeof t.closest)return t.closest(e)||null;for(;t&&t!==document;){if(r(t,e))return t;t=t.parentElement}return null});n.on=function(t,e,n,r){n.split(" ").forEach(function(n){t.addEventListener(n,function(t){var n=(t.target,o(t.target,e));n&&(t.delegateTarget=n,r(t))})})}},{}],3:[function(t,e,n){"use strict";var r=t("es-abstract/es6");e.exports=function(t){var e=r.ToObject(this),n=r.ToInteger(r.ToLength(e.length));if(!r.IsCallable(t))throw new TypeError("Array#find: predicate must be a function");if(0!==n)for(var o,i=arguments[1],a=0;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function o(t){return 3*t.length/4-r(t)}function i(t){var e,n,o,i,a,l,s=t.length;a=r(t),l=new f(3*s/4-a),o=a>0?s-4:s;var c=0;for(e=0,n=0;e>16&255,l[c++]=i>>8&255,l[c++]=255&i;return 2===a?(i=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,l[c++]=255&i):1===a&&(i=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,l[c++]=i>>8&255,l[c++]=255&i),l}function a(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function l(t,e,n){for(var r,o=[],i=e;is?s:a+16383));return 1===r?(e=t[n-1],o+=c[e>>2],o+=c[e<<4&63],o+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],o+=c[e>>10],o+=c[e>>4&63],o+=c[e<<2&63],o+="="),i.push(o),i.join("")}n.byteLength=o,n.toByteArray=i,n.fromByteArray=s;for(var c=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,d=h.length;p * @license MIT */ -"use strict";function r(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(r()=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),i.alloc(+t)}function g(t,e){if(i.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return B(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,o);if("number"==typeof e)return e&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,o){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,l=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,l/=2,s/=2,n/=2}var c;if(o){var u=-1;for(c=n;cl&&(n=l-s),c=n;c>=0;c--){for(var f=!0,h=0;ho&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a239?4:i>223?3:i>191?2:1;if(o+l<=n){var s,c,u,f;switch(l){case 1:i<128&&(a=i);break;case 2:s=t[o+1],128==(192&s)&&(f=(31&i)<<6|63&s)>127&&(a=f);break;case 3:s=t[o+1],c=t[o+2],128==(192&s)&&128==(192&c)&&(f=(15&i)<<12|(63&s)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:s=t[o+1],c=t[o+2],u=t[o+3],128==(192&s)&&128==(192&c)&&128==(192&u)&&(f=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&u)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=l}return I(r)}function I(t){var e=t.length;if(e<=Z)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var o="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,r,o,a){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function _(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o>>8*(r?o:1-o)}function M(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o>>8*(r?o:3-o)&255}function L(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(t,e,n,r,o){return o||L(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(t,e,n,r,23,4),n+4}function G(t,e,n,r,o){return o||L(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(t,e,n,r,52,8),n+8}function Y(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function $(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,o=null,i=[],a=0;a55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function q(t){for(var e=[],n=0;n>8,o=n%256,i.push(o),i.push(r);return i}function z(t){return Q.toByteArray(Y(t))}function K(t,e,n,r){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function X(t){return t!==t}var Q=t("base64-js"),J=t("ieee754"),W=t("isarray");n.Buffer=i,n.SlowBuffer=y,n.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),n.kMaxLength=r(),i.poolSize=8192,i._augment=function(t){return t.__proto__=i.prototype,t},i.from=function(t,e,n){return a(null,t,e,n)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(t,e,n){return s(null,t,e,n)},i.allocUnsafe=function(t){return c(null,t)},i.allocUnsafeSlow=function(t){return c(null,t)},i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,a=Math.min(n,r);o0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,n,r,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var a=o-r,l=n-e,s=Math.min(a,l),c=this.slice(r,o),u=t.slice(e,n),f=0;fo)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return T(this,t,e,n);case"base64":return N(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;i.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],o=1,i=0;++i=o&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){j(this,t,e,n,Math.pow(2,8*n)-1,0)}var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=0,a=1,l=0;for(this[e]=255&t;++i>0)-l&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/a>>0)-l&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,n){return U(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return U(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return G(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return G(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;a=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),i.alloc(+t)}function g(t,e){if(i.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return B(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,o);if("number"==typeof e)return e&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,o){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,l=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,l/=2,s/=2,n/=2}var c;if(o){var u=-1;for(c=n;cl&&(n=l-s),c=n;c>=0;c--){for(var f=!0,h=0;ho&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a239?4:i>223?3:i>191?2:1;if(o+l<=n){var s,c,u,f;switch(l){case 1:i<128&&(a=i);break;case 2:s=t[o+1],128==(192&s)&&(f=(31&i)<<6|63&s)>127&&(a=f);break;case 3:s=t[o+1],c=t[o+2],128==(192&s)&&128==(192&c)&&(f=(15&i)<<12|(63&s)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:s=t[o+1],c=t[o+2],u=t[o+3],128==(192&s)&&128==(192&c)&&128==(192&u)&&(f=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&u)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=l}return I(r)}function I(t){var e=t.length;if(e<=Z)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var o="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,r,o,a){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function _(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o>>8*(r?o:1-o)}function M(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o>>8*(r?o:3-o)&255}function L(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(t,e,n,r,o){return o||L(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(t,e,n,r,23,4),n+4}function G(t,e,n,r,o){return o||L(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(t,e,n,r,52,8),n+8}function Y(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function $(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,o=null,i=[],a=0;a55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function q(t){for(var e=[],n=0;n>8,o=n%256,i.push(o),i.push(r);return i}function z(t){return Q.toByteArray(Y(t))}function K(t,e,n,r){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function X(t){return t!==t}var Q=t("base64-js"),J=t("ieee754"),W=t("isarray");n.Buffer=i,n.SlowBuffer=y,n.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),n.kMaxLength=r(),i.poolSize=8192,i._augment=function(t){return t.__proto__=i.prototype,t},i.from=function(t,e,n){return a(null,t,e,n)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(t,e,n){return s(null,t,e,n)},i.allocUnsafe=function(t){return c(null,t)},i.allocUnsafeSlow=function(t){return c(null,t)},i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,a=Math.min(n,r);o0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,n,r,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var a=o-r,l=n-e,s=Math.min(a,l),c=this.slice(r,o),u=t.slice(e,n),f=0;fo)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return T(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;i.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],o=1,i=0;++i=o&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){j(this,t,e,n,Math.pow(2,8*n)-1,0)}var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=0,a=1,l=0;for(this[e]=255&t;++i>0)-l&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/a>>0)-l&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,n){return U(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return U(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return G(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return G(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;a * @license MIT @@ -165,5 +165,5 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"use strict";function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(t){var e=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?e[a]=o(t):n(t)?e[a]=r(t):e[a]=i({},t):e[a]=t}),e}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var t,e,a=arguments[0],l=Array.prototype.slice.call(arguments,1);return l.forEach(function(l){"object"!=typeof l||null===l||Array.isArray(l)||Object.keys(l).forEach(function(s){return e=a[s],t=l[s],t===a?void 0:"object"!=typeof t||null===t?void(a[s]=t):Array.isArray(t)?void(a[s]=o(t)):n(t)?void(a[s]=r(t)):"object"!=typeof e||null===e||Array.isArray(e)?void(a[s]=i({},t)):void(a[s]=i(e,t))})}),a}}).call(this,t("buffer").Buffer)},{buffer:8}],12:[function(t,e,n){"use strict";var r=t("object-keys"),o=t("foreach"),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),a=Object.prototype.toString,l=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)},s=Object.defineProperty&&function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),c=function(t,e,n,r){(!(e in t)||l(r)&&r())&&(s?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},u=function(t,e){var n=arguments.length>2?arguments[2]:{},a=r(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(r){c(t,r,e[r],n[r])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:24,"object-keys":35}],13:[function(t,e,n){"use strict";var r=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c={ToPrimitive:s,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return a(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=c},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,a=t("./helpers/isNaN"),l=t("./helpers/isFinite"),s=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,c=t("./helpers/assign"),u=t("./helpers/sign"),f=t("./helpers/mod"),h=t("./helpers/isPrimitive"),p=t("es-to-primitive/es6"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,String.prototype.slice),v=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),b=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=["…","​","￾"].join(""),w=new RegExp("["+m+"]","g"),x=y.call(Function.call,RegExp.prototype.test,w),E=y.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),C=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),T=new RegExp("(^["+C+"]+)|(["+C+"]+$)","g"),N=y.call(Function.call,String.prototype.replace),A=function(t){return N(t,T,"")},S=t("./es5"),k=t("is-regex"),I=c(c({},S),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:p,ToNumber:function(t){var e=h(t)?t:p(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(g(e,2),2));if(b(e))return this.ToNumber(d(g(e,2),8));if(x(e)||E(e))return NaN;var n=A(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!l(e))return 0;var n=u(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(a(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5s?s:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:S.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!h(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||a(t)||!l(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if(void 0!==e)return S.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||a(t)&&a(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":S.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete I.CheckObjectCoercible,e.exports=I},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}},{}],16:[function(t,e,n){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],17:[function(t,e,n){e.exports=Number.isNaN||function(t){return t!==t}},{}],18:[function(t,e,n){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],19:[function(t,e,n){e.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},{}],20:[function(t,e,n){e.exports=function(t){return t>=0?1:-1}},{}],21:[function(t,e,n){"use strict";var r=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var a,l,s=n===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,n);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||l(t))&&(n="string"),s(t,"default"===n?"number":n)}},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],24:[function(t,e,n){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,n){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=n?o-1:0,h=n?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*y}},{}],29:[function(t,e,n){"use strict";var r=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=r.call(t),n=e.replace(/\/\/.*\n/g,""),i=n.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(r.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],30:[function(t,e,n){"use strict";var r=Date.prototype.getDay,o=function(t){try{return r.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],31:[function(t,e,n){"use strict";var r=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&a(t)}},{has:27}],32:[function(t,e,n){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],33:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],34:[function(t,e,n){"use strict";function r(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function l(t,e){var n,r,o,i,a,l=e.attributes;for(n=l.length-1;n>=0;--n)r=l[n],o=r.name,i=r.namespaceURI,a=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,n=l.length-1;n>=0;--n)r=l[n],!1!==r.specified&&(o=r.name,i=r.namespaceURI,i?(o=r.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:y.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;if(t.value!==n&&(t.value=n),t.firstChild){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},b=1,m=3,w=8,x=function(t){return function(e,n,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var n=t.firstChild;n;){var r=void 0;e&&(r=C(n))?s(r):(I(n),n.firstChild&&f(n,e)),n=n.nextSibling}}function h(t,e,n){!1!==k(t)&&(e&&e.removeChild(t),I(t),f(t,n))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var n=C(e);n&&(R[n]=e),p(e),e=e.nextSibling}}function y(t){N(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=C(e);if(r){var i=R[r];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=n}}function g(r,i,a){var l,c=C(i);if(c&&delete R[c],!n.isSameNode||!n.isSameNode(e)){if(!a){if(!1===A(r,i))return;if(t(r,i),S(r),!1===B(r,i))return}if("TEXTAREA"!==r.nodeName){var u,f,p,x,E=i.firstChild,N=r.firstChild;t:for(;E;){for(p=E.nextSibling,u=C(E);N;){if(f=N.nextSibling,E.isSameNode&&E.isSameNode(N)){E=p,N=f;continue t}l=C(N);var k=N.nodeType,I=void 0;if(k===E.nodeType&&(k===b?(u?u!==l&&((x=R[u])?N.nextSibling===x?I=!1:(r.insertBefore(x,N),f=N.nextSibling,l?s(l):h(N,r,!0),N=x):I=!1):l&&(I=!1),(I=!1!==I&&o(N,E))&&g(N,E)):k!==m&&k!=w||(I=!0,N.nodeValue=E.nodeValue)),I){E=p,N=f;continue t}l?s(l):h(N,r,!0),N=f}if(u&&(x=R[u])&&o(x,E))r.appendChild(x),g(x,E);else{var P=T(E);!1!==P&&(P&&(E=P),E.actualize&&(E=E.actualize(r.ownerDocument||d)),r.appendChild(E),y(E))}E=p,N=f}for(;N;)f=N.nextSibling,(l=C(N))?s(l):h(N,r,!0),N=f}var O=v[r.nodeName];O&&O(r,i)}}if(l||(l={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=n;n=d.createElement("html"),n.innerHTML=x}else n=r(n);var E,C=l.getNodeKey||u,T=l.onBeforeNodeAdded||c,N=l.onNodeAdded||c,A=l.onBeforeElUpdated||c,S=l.onElUpdated||c,k=l.onBeforeNodeDiscarded||c,I=l.onNodeDiscarded||c,B=l.onBeforeElChildrenUpdated||c,P=!0===l.childrenOnly,R={};p(e);var O=e,D=O.nodeType,j=n.nodeType;if(!P)if(D===b)j===b?o(e,n)||(I(e),O=a(e,i(n.nodeName,n.namespaceURI))):O=n;else if(D===m||D===w){if(j===D)return O.nodeValue=n.nodeValue,O;O=n}if(O===n)I(e);else if(g(O,n,P),E)for(var _=0,M=E.length;_0&&!r.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},{}],37:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',m={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},w=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.id=e.getUniqId(),r.menu_id=e.getUniqId(),r.addTemplate(r.id,g),r.addTemplate(r.menu_id,y.default.removeIndentNewline(v)),r.data=(0,p.default)({},m,n);var a=r.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=r.parse(""+l.innerHTML+"
    "),a.tableResult=r.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=r.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),r.convert={},r.convert.getStyleByAlign=r.getStyleByAlign,r.convert.setClass=r.setClass -;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}else if(void 0!==document.body.createTextRange){var r=document.body.createTextRange();r.moveToElementText(t),r.collapse(!1),r.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e2?arguments[2]:{},a=r(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(r){c(t,r,e[r],n[r])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:24,"object-keys":35}],13:[function(t,e,n){"use strict";var r=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c={ToPrimitive:s,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return a(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=c},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,a=t("./helpers/isNaN"),l=t("./helpers/isFinite"),s=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,c=t("./helpers/assign"),u=t("./helpers/sign"),f=t("./helpers/mod"),h=t("./helpers/isPrimitive"),p=t("es-to-primitive/es6"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,String.prototype.slice),v=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),b=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=["…","​","￾"].join(""),w=new RegExp("["+m+"]","g"),x=y.call(Function.call,RegExp.prototype.test,w),E=y.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),C=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),T=new RegExp("(^["+C+"]+)|(["+C+"]+$)","g"),A=y.call(Function.call,String.prototype.replace),N=function(t){return A(t,T,"")},S=t("./es5"),k=t("is-regex"),I=c(c({},S),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:p,ToNumber:function(t){var e=h(t)?t:p(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(g(e,2),2));if(b(e))return this.ToNumber(d(g(e,2),8));if(x(e)||E(e))return NaN;var n=N(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!l(e))return 0;var n=u(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(a(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5s?s:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:S.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!h(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||a(t)||!l(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if(void 0!==e)return S.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||a(t)&&a(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":S.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete I.CheckObjectCoercible,e.exports=I},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}},{}],16:[function(t,e,n){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],17:[function(t,e,n){e.exports=Number.isNaN||function(t){return t!==t}},{}],18:[function(t,e,n){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],19:[function(t,e,n){e.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},{}],20:[function(t,e,n){e.exports=function(t){return t>=0?1:-1}},{}],21:[function(t,e,n){"use strict";var r=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var a,l,s=n===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,n);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||l(t))&&(n="string"),s(t,"default"===n?"number":n)}},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],24:[function(t,e,n){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,n){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=n?o-1:0,h=n?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*y}},{}],29:[function(t,e,n){"use strict";var r=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=r.call(t),n=e.replace(/\/\/.*\n/g,""),i=n.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(r.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],30:[function(t,e,n){"use strict";var r=Date.prototype.getDay,o=function(t){try{return r.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],31:[function(t,e,n){"use strict";var r=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&a(t)}},{has:27}],32:[function(t,e,n){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],33:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],34:[function(t,e,n){"use strict";function r(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function l(t,e){var n,r,o,i,a,l=e.attributes;for(n=l.length-1;n>=0;--n)r=l[n],o=r.name,i=r.namespaceURI,a=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,n=l.length-1;n>=0;--n)r=l[n],!1!==r.specified&&(o=r.name,i=r.namespaceURI,i?(o=r.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:y.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;if(t.value!==n&&(t.value=n),t.firstChild){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},b=1,m=3,w=8,x=function(t){return function(e,n,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var n=t.firstChild;n;){var r=void 0;e&&(r=C(n))?s(r):(I(n),n.firstChild&&f(n,e)),n=n.nextSibling}}function h(t,e,n){!1!==k(t)&&(e&&e.removeChild(t),I(t),f(t,n))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var n=C(e);n&&(R[n]=e),p(e),e=e.nextSibling}}function y(t){A(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=C(e);if(r){var i=R[r];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=n}}function g(r,i,a){var l,c=C(i);if(c&&delete R[c],!n.isSameNode||!n.isSameNode(e)){if(!a){if(!1===N(r,i))return;if(t(r,i),S(r),!1===B(r,i))return}if("TEXTAREA"!==r.nodeName){var u,f,p,x,E=i.firstChild,A=r.firstChild;t:for(;E;){for(p=E.nextSibling,u=C(E);A;){if(f=A.nextSibling,E.isSameNode&&E.isSameNode(A)){E=p,A=f;continue t}l=C(A);var k=A.nodeType,I=void 0;if(k===E.nodeType&&(k===b?(u?u!==l&&((x=R[u])?A.nextSibling===x?I=!1:(r.insertBefore(x,A),f=A.nextSibling,l?s(l):h(A,r,!0),A=x):I=!1):l&&(I=!1),(I=!1!==I&&o(A,E))&&g(A,E)):k!==m&&k!=w||(I=!0,A.nodeValue=E.nodeValue)),I){E=p,A=f;continue t}l?s(l):h(A,r,!0),A=f}if(u&&(x=R[u])&&o(x,E))r.appendChild(x),g(x,E);else{var P=T(E);!1!==P&&(P&&(E=P),E.actualize&&(E=E.actualize(r.ownerDocument||d)),r.appendChild(E),y(E))}E=p,A=f}for(;A;)f=A.nextSibling,(l=C(A))?s(l):h(A,r,!0),A=f}var O=v[r.nodeName];O&&O(r,i)}}if(l||(l={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=n;n=d.createElement("html"),n.innerHTML=x}else n=r(n);var E,C=l.getNodeKey||u,T=l.onBeforeNodeAdded||c,A=l.onNodeAdded||c,N=l.onBeforeElUpdated||c,S=l.onElUpdated||c,k=l.onBeforeNodeDiscarded||c,I=l.onNodeDiscarded||c,B=l.onBeforeElChildrenUpdated||c,P=!0===l.childrenOnly,R={};p(e);var O=e,D=O.nodeType,j=n.nodeType;if(!P)if(D===b)j===b?o(e,n)||(I(e),O=a(e,i(n.nodeName,n.namespaceURI))):O=n;else if(D===m||D===w){if(j===D)return O.nodeValue=n.nodeValue,O;O=n}if(O===n)I(e);else if(g(O,n,P),E)for(var _=0,M=E.length;_0&&!r.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},{}],37:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',m={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},w=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.id=e.getUniqId(),r.menu_id=e.getUniqId(),r.addTemplate(r.id,g),r.addTemplate(r.menu_id,y.default.removeIndentNewline(v)),r.data=(0,p.default)({},m,n);var a=r.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=r.parse(""+l.innerHTML+"
    "),a.tableResult=r.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=r.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),r.convert={},r.convert.getStyleByAlign=r.getStyleByAlign,r.convert.setClass=r.setClass +;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}else if(void 0!==document.body.createTextRange){var r=document.body.createTextRange();r.moveToElementText(t),r.collapse(!1),r.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e Date: Tue, 3 Sep 2024 21:14:03 +0900 Subject: [PATCH 05/14] Implement increaseDecreaseColumns and increaseDecreaseRows options copy diff from https://github.com/movabletype/movabletype/commit/54344d93be29d97fbbeee355f7482e55519f91b7 --- src/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index aac28ce..feb119d 100644 --- a/src/index.js +++ b/src/index.js @@ -646,7 +646,9 @@ export default class aTable extends aTemplate { data.mode = 'col'; data.selectedColNo = -1; data.selectedRowNo = i; - this.contextmenu(); + if (data.increaseDecreaseRows) { + this.contextmenu(); + } this.update(); } @@ -671,7 +673,9 @@ export default class aTable extends aTemplate { data.mode = 'row'; data.selectedRowNo = -1; data.selectedColNo = i; - this.contextmenu(); + if (data.increaseDecreaseColumns) { + this.contextmenu(); + } this.update(); } From 6e0e1ee3742fbb3d51d178ec6db8cf5e0cf21f64 Mon Sep 17 00:00:00 2001 From: Masahiro Iuchi Date: Tue, 3 Sep 2024 21:22:37 +0900 Subject: [PATCH 06/14] yarn build:js --- build/a-table.js | 8 ++++++-- build/a-table.min.js | 2 +- lib/index.js | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/build/a-table.js b/build/a-table.js index 50bcb4d..a2f901e 100644 --- a/build/a-table.js +++ b/build/a-table.js @@ -5693,7 +5693,9 @@ var aTable = function (_aTemplate) { data.mode = 'col'; data.selectedColNo = -1; data.selectedRowNo = i; - this.contextmenu(); + if (data.increaseDecreaseRows) { + this.contextmenu(); + } this.update(); } }, { @@ -5719,7 +5721,9 @@ var aTable = function (_aTemplate) { data.mode = 'row'; data.selectedRowNo = -1; data.selectedColNo = i; - this.contextmenu(); + if (data.increaseDecreaseColumns) { + this.contextmenu(); + } this.update(); } }, { diff --git a/build/a-table.min.js b/build/a-table.min.js index daa736c..d5b897b 100644 --- a/build/a-table.min.js +++ b/build/a-table.min.js @@ -166,4 +166,4 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ "use strict";function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(t){var e=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?e[a]=o(t):n(t)?e[a]=r(t):e[a]=i({},t):e[a]=t}),e}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var t,e,a=arguments[0],l=Array.prototype.slice.call(arguments,1);return l.forEach(function(l){"object"!=typeof l||null===l||Array.isArray(l)||Object.keys(l).forEach(function(s){return e=a[s],t=l[s],t===a?void 0:"object"!=typeof t||null===t?void(a[s]=t):Array.isArray(t)?void(a[s]=o(t)):n(t)?void(a[s]=r(t)):"object"!=typeof e||null===e||Array.isArray(e)?void(a[s]=i({},t)):void(a[s]=i(e,t))})}),a}}).call(this,t("buffer").Buffer)},{buffer:8}],12:[function(t,e,n){"use strict";var r=t("object-keys"),o=t("foreach"),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),a=Object.prototype.toString,l=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)},s=Object.defineProperty&&function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),c=function(t,e,n,r){(!(e in t)||l(r)&&r())&&(s?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},u=function(t,e){var n=arguments.length>2?arguments[2]:{},a=r(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(r){c(t,r,e[r],n[r])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:24,"object-keys":35}],13:[function(t,e,n){"use strict";var r=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c={ToPrimitive:s,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return a(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=c},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,a=t("./helpers/isNaN"),l=t("./helpers/isFinite"),s=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,c=t("./helpers/assign"),u=t("./helpers/sign"),f=t("./helpers/mod"),h=t("./helpers/isPrimitive"),p=t("es-to-primitive/es6"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,String.prototype.slice),v=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),b=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=["…","​","￾"].join(""),w=new RegExp("["+m+"]","g"),x=y.call(Function.call,RegExp.prototype.test,w),E=y.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),C=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),T=new RegExp("(^["+C+"]+)|(["+C+"]+$)","g"),A=y.call(Function.call,String.prototype.replace),N=function(t){return A(t,T,"")},S=t("./es5"),k=t("is-regex"),I=c(c({},S),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:p,ToNumber:function(t){var e=h(t)?t:p(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(g(e,2),2));if(b(e))return this.ToNumber(d(g(e,2),8));if(x(e)||E(e))return NaN;var n=N(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!l(e))return 0;var n=u(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(a(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5s?s:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:S.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!h(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||a(t)||!l(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if(void 0!==e)return S.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||a(t)&&a(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":S.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete I.CheckObjectCoercible,e.exports=I},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}},{}],16:[function(t,e,n){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],17:[function(t,e,n){e.exports=Number.isNaN||function(t){return t!==t}},{}],18:[function(t,e,n){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],19:[function(t,e,n){e.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},{}],20:[function(t,e,n){e.exports=function(t){return t>=0?1:-1}},{}],21:[function(t,e,n){"use strict";var r=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var a,l,s=n===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,n);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||l(t))&&(n="string"),s(t,"default"===n?"number":n)}},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],24:[function(t,e,n){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,n){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=n?o-1:0,h=n?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*y}},{}],29:[function(t,e,n){"use strict";var r=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=r.call(t),n=e.replace(/\/\/.*\n/g,""),i=n.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(r.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],30:[function(t,e,n){"use strict";var r=Date.prototype.getDay,o=function(t){try{return r.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],31:[function(t,e,n){"use strict";var r=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&a(t)}},{has:27}],32:[function(t,e,n){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],33:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],34:[function(t,e,n){"use strict";function r(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function l(t,e){var n,r,o,i,a,l=e.attributes;for(n=l.length-1;n>=0;--n)r=l[n],o=r.name,i=r.namespaceURI,a=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,n=l.length-1;n>=0;--n)r=l[n],!1!==r.specified&&(o=r.name,i=r.namespaceURI,i?(o=r.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:y.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;if(t.value!==n&&(t.value=n),t.firstChild){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},b=1,m=3,w=8,x=function(t){return function(e,n,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var n=t.firstChild;n;){var r=void 0;e&&(r=C(n))?s(r):(I(n),n.firstChild&&f(n,e)),n=n.nextSibling}}function h(t,e,n){!1!==k(t)&&(e&&e.removeChild(t),I(t),f(t,n))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var n=C(e);n&&(R[n]=e),p(e),e=e.nextSibling}}function y(t){A(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=C(e);if(r){var i=R[r];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=n}}function g(r,i,a){var l,c=C(i);if(c&&delete R[c],!n.isSameNode||!n.isSameNode(e)){if(!a){if(!1===N(r,i))return;if(t(r,i),S(r),!1===B(r,i))return}if("TEXTAREA"!==r.nodeName){var u,f,p,x,E=i.firstChild,A=r.firstChild;t:for(;E;){for(p=E.nextSibling,u=C(E);A;){if(f=A.nextSibling,E.isSameNode&&E.isSameNode(A)){E=p,A=f;continue t}l=C(A);var k=A.nodeType,I=void 0;if(k===E.nodeType&&(k===b?(u?u!==l&&((x=R[u])?A.nextSibling===x?I=!1:(r.insertBefore(x,A),f=A.nextSibling,l?s(l):h(A,r,!0),A=x):I=!1):l&&(I=!1),(I=!1!==I&&o(A,E))&&g(A,E)):k!==m&&k!=w||(I=!0,A.nodeValue=E.nodeValue)),I){E=p,A=f;continue t}l?s(l):h(A,r,!0),A=f}if(u&&(x=R[u])&&o(x,E))r.appendChild(x),g(x,E);else{var P=T(E);!1!==P&&(P&&(E=P),E.actualize&&(E=E.actualize(r.ownerDocument||d)),r.appendChild(E),y(E))}E=p,A=f}for(;A;)f=A.nextSibling,(l=C(A))?s(l):h(A,r,!0),A=f}var O=v[r.nodeName];O&&O(r,i)}}if(l||(l={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=n;n=d.createElement("html"),n.innerHTML=x}else n=r(n);var E,C=l.getNodeKey||u,T=l.onBeforeNodeAdded||c,A=l.onNodeAdded||c,N=l.onBeforeElUpdated||c,S=l.onElUpdated||c,k=l.onBeforeNodeDiscarded||c,I=l.onNodeDiscarded||c,B=l.onBeforeElChildrenUpdated||c,P=!0===l.childrenOnly,R={};p(e);var O=e,D=O.nodeType,j=n.nodeType;if(!P)if(D===b)j===b?o(e,n)||(I(e),O=a(e,i(n.nodeName,n.namespaceURI))):O=n;else if(D===m||D===w){if(j===D)return O.nodeValue=n.nodeValue,O;O=n}if(O===n)I(e);else if(g(O,n,P),E)for(var _=0,M=E.length;_0&&!r.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},{}],37:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',m={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},w=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.id=e.getUniqId(),r.menu_id=e.getUniqId(),r.addTemplate(r.id,g),r.addTemplate(r.menu_id,y.default.removeIndentNewline(v)),r.data=(0,p.default)({},m,n);var a=r.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=r.parse(""+l.innerHTML+"
    "),a.tableResult=r.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=r.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),r.convert={},r.convert.getStyleByAlign=r.getStyleByAlign,r.convert.setClass=r.setClass -;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}else if(void 0!==document.body.createTextRange){var r=document.body.createTextRange();r.moveToElementText(t),r.collapse(!1),r.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e\n
    \n
    \n
    \n
    \n
    \n ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}else if(void 0!==document.body.createTextRange){var r=document.body.createTextRange();r.moveToElementText(t),r.collapse(!1),r.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,e.increaseDecreaseRows&&this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,a.increaseDecreaseColumns&&this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e Date: Tue, 3 Sep 2024 21:23:02 +0900 Subject: [PATCH 07/14] Fix bug that extra linefeed is added in tables field on Firefox copy diff from https://github.com/movabletype/movabletype/commit/51d3545bda8444935f8d29a05c59d7540dc4c39e --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index feb119d..1fed4ff 100644 --- a/src/index.js +++ b/src/index.js @@ -536,7 +536,11 @@ export default class aTable extends aTemplate { if (typeof window.getSelection !== 'undefined' && typeof document.createRange !== 'undefined') { const range = document.createRange(); - range.selectNodeContents(elem); + if (aTable.getBrowser() === 'firefox' && elem.hasChildNodes() && elem.lastChild.tagName === 'BR') { + range.setEndBefore(elem.lastChild); + } else { + range.selectNodeContents(elem); + } range.collapse(false); const sel = window.getSelection(); sel.removeAllRanges(); From fedb93116fef44c60c83f1fc50d2790dada9895b Mon Sep 17 00:00:00 2001 From: Masahiro Iuchi Date: Tue, 3 Sep 2024 21:23:18 +0900 Subject: [PATCH 08/14] yarn build:js --- build/a-table.js | 6 +++++- build/a-table.min.js | 6 +++--- lib/index.js | 6 +++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/build/a-table.js b/build/a-table.js index a2f901e..401abe6 100644 --- a/build/a-table.js +++ b/build/a-table.js @@ -5575,7 +5575,11 @@ var aTable = function (_aTemplate) { elem.focus(); if (typeof window.getSelection !== 'undefined' && typeof document.createRange !== 'undefined') { var range = document.createRange(); - range.selectNodeContents(elem); + if (aTable.getBrowser() === 'firefox' && elem.hasChildNodes() && elem.lastChild.tagName === 'BR') { + range.setEndBefore(elem.lastChild); + } else { + range.selectNodeContents(elem); + } range.collapse(false); var sel = window.getSelection(); sel.removeAllRanges(); diff --git a/build/a-table.min.js b/build/a-table.min.js index d5b897b..6dd860c 100644 --- a/build/a-table.min.js +++ b/build/a-table.min.js @@ -139,7 +139,7 @@ * @author Feross Aboukhadijeh * @license MIT */ -"use strict";function r(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(r()=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),i.alloc(+t)}function g(t,e){if(i.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return B(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,o);if("number"==typeof e)return e&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,o){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,l=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,l/=2,s/=2,n/=2}var c;if(o){var u=-1;for(c=n;cl&&(n=l-s),c=n;c>=0;c--){for(var f=!0,h=0;ho&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a239?4:i>223?3:i>191?2:1;if(o+l<=n){var s,c,u,f;switch(l){case 1:i<128&&(a=i);break;case 2:s=t[o+1],128==(192&s)&&(f=(31&i)<<6|63&s)>127&&(a=f);break;case 3:s=t[o+1],c=t[o+2],128==(192&s)&&128==(192&c)&&(f=(15&i)<<12|(63&s)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:s=t[o+1],c=t[o+2],u=t[o+3],128==(192&s)&&128==(192&c)&&128==(192&u)&&(f=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&u)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=l}return I(r)}function I(t){var e=t.length;if(e<=Z)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var o="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,r,o,a){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function _(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o>>8*(r?o:1-o)}function M(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o>>8*(r?o:3-o)&255}function L(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(t,e,n,r,o){return o||L(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(t,e,n,r,23,4),n+4}function G(t,e,n,r,o){return o||L(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(t,e,n,r,52,8),n+8}function Y(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function $(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,o=null,i=[],a=0;a55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function q(t){for(var e=[],n=0;n>8,o=n%256,i.push(o),i.push(r);return i}function z(t){return Q.toByteArray(Y(t))}function K(t,e,n,r){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function X(t){return t!==t}var Q=t("base64-js"),J=t("ieee754"),W=t("isarray");n.Buffer=i,n.SlowBuffer=y,n.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),n.kMaxLength=r(),i.poolSize=8192,i._augment=function(t){return t.__proto__=i.prototype,t},i.from=function(t,e,n){return a(null,t,e,n)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(t,e,n){return s(null,t,e,n)},i.allocUnsafe=function(t){return c(null,t)},i.allocUnsafeSlow=function(t){return c(null,t)},i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,a=Math.min(n,r);o0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,n,r,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var a=o-r,l=n-e,s=Math.min(a,l),c=this.slice(r,o),u=t.slice(e,n),f=0;fo)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return T(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;i.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],o=1,i=0;++i=o&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){j(this,t,e,n,Math.pow(2,8*n)-1,0)}var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=0,a=1,l=0;for(this[e]=255&t;++i>0)-l&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/a>>0)-l&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,n){return U(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return U(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return G(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return G(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;a=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),i.alloc(+t)}function g(t,e){if(i.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,o);if("number"==typeof e)return e&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,o){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,l=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,l/=2,s/=2,n/=2}var c;if(o){var u=-1;for(c=n;cl&&(n=l-s),c=n;c>=0;c--){for(var f=!0,h=0;ho&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a239?4:i>223?3:i>191?2:1;if(o+l<=n){var s,c,u,f;switch(l){case 1:i<128&&(a=i);break;case 2:s=t[o+1],128==(192&s)&&(f=(31&i)<<6|63&s)>127&&(a=f);break;case 3:s=t[o+1],c=t[o+2],128==(192&s)&&128==(192&c)&&(f=(15&i)<<12|(63&s)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:s=t[o+1],c=t[o+2],u=t[o+3],128==(192&s)&&128==(192&c)&&128==(192&u)&&(f=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&u)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=l}return B(r)}function B(t){var e=t.length;if(e<=Z)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var o="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,r,o,a){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function _(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o>>8*(r?o:1-o)}function M(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o>>8*(r?o:3-o)&255}function L(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(t,e,n,r,o){return o||L(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(t,e,n,r,23,4),n+4}function G(t,e,n,r,o){return o||L(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(t,e,n,r,52,8),n+8}function Y(t){if(t=F(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function $(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,o=null,i=[],a=0;a55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function q(t){for(var e=[],n=0;n>8,o=n%256,i.push(o),i.push(r);return i}function z(t){return Q.toByteArray(Y(t))}function K(t,e,n,r){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function X(t){return t!==t}var Q=t("base64-js"),J=t("ieee754"),W=t("isarray");n.Buffer=i,n.SlowBuffer=y,n.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),n.kMaxLength=r(),i.poolSize=8192,i._augment=function(t){return t.__proto__=i.prototype,t},i.from=function(t,e,n){return a(null,t,e,n)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(t,e,n){return s(null,t,e,n)},i.allocUnsafe=function(t){return c(null,t)},i.allocUnsafeSlow=function(t){return c(null,t)},i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,a=Math.min(n,r);o0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,n,r,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var a=o-r,l=n-e,s=Math.min(a,l),c=this.slice(r,o),u=t.slice(e,n),f=0;fo)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return T(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;i.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],o=1,i=0;++i=o&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){j(this,t,e,n,Math.pow(2,8*n)-1,0)}var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=0,a=1,l=0;for(this[e]=255&t;++i>0)-l&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/a>>0)-l&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,n){return U(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return U(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return G(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return G(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var a;if("number"==typeof t)for(a=e;a * @license MIT @@ -165,5 +165,5 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"use strict";function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(t){var e=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?e[a]=o(t):n(t)?e[a]=r(t):e[a]=i({},t):e[a]=t}),e}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var t,e,a=arguments[0],l=Array.prototype.slice.call(arguments,1);return l.forEach(function(l){"object"!=typeof l||null===l||Array.isArray(l)||Object.keys(l).forEach(function(s){return e=a[s],t=l[s],t===a?void 0:"object"!=typeof t||null===t?void(a[s]=t):Array.isArray(t)?void(a[s]=o(t)):n(t)?void(a[s]=r(t)):"object"!=typeof e||null===e||Array.isArray(e)?void(a[s]=i({},t)):void(a[s]=i(e,t))})}),a}}).call(this,t("buffer").Buffer)},{buffer:8}],12:[function(t,e,n){"use strict";var r=t("object-keys"),o=t("foreach"),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),a=Object.prototype.toString,l=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)},s=Object.defineProperty&&function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),c=function(t,e,n,r){(!(e in t)||l(r)&&r())&&(s?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},u=function(t,e){var n=arguments.length>2?arguments[2]:{},a=r(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(r){c(t,r,e[r],n[r])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:24,"object-keys":35}],13:[function(t,e,n){"use strict";var r=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c={ToPrimitive:s,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return a(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=c},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,a=t("./helpers/isNaN"),l=t("./helpers/isFinite"),s=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,c=t("./helpers/assign"),u=t("./helpers/sign"),f=t("./helpers/mod"),h=t("./helpers/isPrimitive"),p=t("es-to-primitive/es6"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,String.prototype.slice),v=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),b=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=["…","​","￾"].join(""),w=new RegExp("["+m+"]","g"),x=y.call(Function.call,RegExp.prototype.test,w),E=y.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),C=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),T=new RegExp("(^["+C+"]+)|(["+C+"]+$)","g"),A=y.call(Function.call,String.prototype.replace),N=function(t){return A(t,T,"")},S=t("./es5"),k=t("is-regex"),I=c(c({},S),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:p,ToNumber:function(t){var e=h(t)?t:p(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(g(e,2),2));if(b(e))return this.ToNumber(d(g(e,2),8));if(x(e)||E(e))return NaN;var n=N(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!l(e))return 0;var n=u(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(a(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5s?s:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:S.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!h(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||a(t)||!l(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if(void 0!==e)return S.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||a(t)&&a(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":S.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete I.CheckObjectCoercible,e.exports=I},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}},{}],16:[function(t,e,n){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],17:[function(t,e,n){e.exports=Number.isNaN||function(t){return t!==t}},{}],18:[function(t,e,n){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],19:[function(t,e,n){e.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},{}],20:[function(t,e,n){e.exports=function(t){return t>=0?1:-1}},{}],21:[function(t,e,n){"use strict";var r=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var a,l,s=n===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,n);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||l(t))&&(n="string"),s(t,"default"===n?"number":n)}},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],24:[function(t,e,n){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,n){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=n?o-1:0,h=n?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*y}},{}],29:[function(t,e,n){"use strict";var r=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=r.call(t),n=e.replace(/\/\/.*\n/g,""),i=n.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(r.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],30:[function(t,e,n){"use strict";var r=Date.prototype.getDay,o=function(t){try{return r.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],31:[function(t,e,n){"use strict";var r=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&a(t)}},{has:27}],32:[function(t,e,n){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],33:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],34:[function(t,e,n){"use strict";function r(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function l(t,e){var n,r,o,i,a,l=e.attributes;for(n=l.length-1;n>=0;--n)r=l[n],o=r.name,i=r.namespaceURI,a=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,n=l.length-1;n>=0;--n)r=l[n],!1!==r.specified&&(o=r.name,i=r.namespaceURI,i?(o=r.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:y.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;if(t.value!==n&&(t.value=n),t.firstChild){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},b=1,m=3,w=8,x=function(t){return function(e,n,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var n=t.firstChild;n;){var r=void 0;e&&(r=C(n))?s(r):(I(n),n.firstChild&&f(n,e)),n=n.nextSibling}}function h(t,e,n){!1!==k(t)&&(e&&e.removeChild(t),I(t),f(t,n))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var n=C(e);n&&(R[n]=e),p(e),e=e.nextSibling}}function y(t){A(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=C(e);if(r){var i=R[r];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=n}}function g(r,i,a){var l,c=C(i);if(c&&delete R[c],!n.isSameNode||!n.isSameNode(e)){if(!a){if(!1===N(r,i))return;if(t(r,i),S(r),!1===B(r,i))return}if("TEXTAREA"!==r.nodeName){var u,f,p,x,E=i.firstChild,A=r.firstChild;t:for(;E;){for(p=E.nextSibling,u=C(E);A;){if(f=A.nextSibling,E.isSameNode&&E.isSameNode(A)){E=p,A=f;continue t}l=C(A);var k=A.nodeType,I=void 0;if(k===E.nodeType&&(k===b?(u?u!==l&&((x=R[u])?A.nextSibling===x?I=!1:(r.insertBefore(x,A),f=A.nextSibling,l?s(l):h(A,r,!0),A=x):I=!1):l&&(I=!1),(I=!1!==I&&o(A,E))&&g(A,E)):k!==m&&k!=w||(I=!0,A.nodeValue=E.nodeValue)),I){E=p,A=f;continue t}l?s(l):h(A,r,!0),A=f}if(u&&(x=R[u])&&o(x,E))r.appendChild(x),g(x,E);else{var P=T(E);!1!==P&&(P&&(E=P),E.actualize&&(E=E.actualize(r.ownerDocument||d)),r.appendChild(E),y(E))}E=p,A=f}for(;A;)f=A.nextSibling,(l=C(A))?s(l):h(A,r,!0),A=f}var O=v[r.nodeName];O&&O(r,i)}}if(l||(l={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=n;n=d.createElement("html"),n.innerHTML=x}else n=r(n);var E,C=l.getNodeKey||u,T=l.onBeforeNodeAdded||c,A=l.onNodeAdded||c,N=l.onBeforeElUpdated||c,S=l.onElUpdated||c,k=l.onBeforeNodeDiscarded||c,I=l.onNodeDiscarded||c,B=l.onBeforeElChildrenUpdated||c,P=!0===l.childrenOnly,R={};p(e);var O=e,D=O.nodeType,j=n.nodeType;if(!P)if(D===b)j===b?o(e,n)||(I(e),O=a(e,i(n.nodeName,n.namespaceURI))):O=n;else if(D===m||D===w){if(j===D)return O.nodeValue=n.nodeValue,O;O=n}if(O===n)I(e);else if(g(O,n,P),E)for(var _=0,M=E.length;_0&&!r.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},{}],37:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',m={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},w=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.id=e.getUniqId(),r.menu_id=e.getUniqId(),r.addTemplate(r.id,g),r.addTemplate(r.menu_id,y.default.removeIndentNewline(v)),r.data=(0,p.default)({},m,n);var a=r.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=r.parse(""+l.innerHTML+"
    "),a.tableResult=r.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=r.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),r.convert={},r.convert.getStyleByAlign=r.getStyleByAlign,r.convert.setClass=r.setClass -;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}else if(void 0!==document.body.createTextRange){var r=document.body.createTextRange();r.moveToElementText(t),r.collapse(!1),r.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,e.increaseDecreaseRows&&this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,a.increaseDecreaseColumns&&this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e2?arguments[2]:{},a=r(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(r){c(t,r,e[r],n[r])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:24,"object-keys":35}],13:[function(t,e,n){"use strict";var r=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c={ToPrimitive:s,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return a(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=c},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,a=t("./helpers/isNaN"),l=t("./helpers/isFinite"),s=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,c=t("./helpers/assign"),u=t("./helpers/sign"),f=t("./helpers/mod"),h=t("./helpers/isPrimitive"),p=t("es-to-primitive/es6"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,String.prototype.slice),v=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),b=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=["…","​","￾"].join(""),w=new RegExp("["+m+"]","g"),x=y.call(Function.call,RegExp.prototype.test,w),E=y.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),C=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),T=new RegExp("(^["+C+"]+)|(["+C+"]+$)","g"),A=y.call(Function.call,String.prototype.replace),N=function(t){return A(t,T,"")},S=t("./es5"),k=t("is-regex"),B=c(c({},S),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:p,ToNumber:function(t){var e=h(t)?t:p(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(g(e,2),2));if(b(e))return this.ToNumber(d(g(e,2),8));if(x(e)||E(e))return NaN;var n=N(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!l(e))return 0;var n=u(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(a(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5s?s:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:S.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!h(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||a(t)||!l(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if(void 0!==e)return S.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||a(t)&&a(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":S.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete B.CheckObjectCoercible,e.exports=B},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}},{}],16:[function(t,e,n){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],17:[function(t,e,n){e.exports=Number.isNaN||function(t){return t!==t}},{}],18:[function(t,e,n){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],19:[function(t,e,n){e.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},{}],20:[function(t,e,n){e.exports=function(t){return t>=0?1:-1}},{}],21:[function(t,e,n){"use strict";var r=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var a,l,s=n===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,n);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||l(t))&&(n="string"),s(t,"default"===n?"number":n)}},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],24:[function(t,e,n){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,n){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=n?o-1:0,h=n?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*y}},{}],29:[function(t,e,n){"use strict";var r=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=r.call(t),n=e.replace(/\/\/.*\n/g,""),i=n.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(r.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],30:[function(t,e,n){"use strict";var r=Date.prototype.getDay,o=function(t){try{return r.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],31:[function(t,e,n){"use strict";var r=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&a(t)}},{has:27}],32:[function(t,e,n){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],33:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],34:[function(t,e,n){"use strict";function r(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function l(t,e){var n,r,o,i,a,l=e.attributes;for(n=l.length-1;n>=0;--n)r=l[n],o=r.name,i=r.namespaceURI,a=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,n=l.length-1;n>=0;--n)r=l[n],!1!==r.specified&&(o=r.name,i=r.namespaceURI,i?(o=r.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:y.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;if(t.value!==n&&(t.value=n),t.firstChild){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},b=1,m=3,w=8,x=function(t){return function(e,n,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var n=t.firstChild;n;){var r=void 0;e&&(r=C(n))?s(r):(B(n),n.firstChild&&f(n,e)),n=n.nextSibling}}function h(t,e,n){!1!==k(t)&&(e&&e.removeChild(t),B(t),f(t,n))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var n=C(e);n&&(R[n]=e),p(e),e=e.nextSibling}}function y(t){A(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=C(e);if(r){var i=R[r];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=n}}function g(r,i,a){var l,c=C(i);if(c&&delete R[c],!n.isSameNode||!n.isSameNode(e)){if(!a){if(!1===N(r,i))return;if(t(r,i),S(r),!1===I(r,i))return}if("TEXTAREA"!==r.nodeName){var u,f,p,x,E=i.firstChild,A=r.firstChild;t:for(;E;){for(p=E.nextSibling,u=C(E);A;){if(f=A.nextSibling,E.isSameNode&&E.isSameNode(A)){E=p,A=f;continue t}l=C(A);var k=A.nodeType,B=void 0;if(k===E.nodeType&&(k===b?(u?u!==l&&((x=R[u])?A.nextSibling===x?B=!1:(r.insertBefore(x,A),f=A.nextSibling,l?s(l):h(A,r,!0),A=x):B=!1):l&&(B=!1),(B=!1!==B&&o(A,E))&&g(A,E)):k!==m&&k!=w||(B=!0,A.nodeValue=E.nodeValue)),B){E=p,A=f;continue t}l?s(l):h(A,r,!0),A=f}if(u&&(x=R[u])&&o(x,E))r.appendChild(x),g(x,E);else{var P=T(E);!1!==P&&(P&&(E=P),E.actualize&&(E=E.actualize(r.ownerDocument||d)),r.appendChild(E),y(E))}E=p,A=f}for(;A;)f=A.nextSibling,(l=C(A))?s(l):h(A,r,!0),A=f}var O=v[r.nodeName];O&&O(r,i)}}if(l||(l={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=n;n=d.createElement("html"),n.innerHTML=x}else n=r(n);var E,C=l.getNodeKey||u,T=l.onBeforeNodeAdded||c,A=l.onNodeAdded||c,N=l.onBeforeElUpdated||c,S=l.onElUpdated||c,k=l.onBeforeNodeDiscarded||c,B=l.onNodeDiscarded||c,I=l.onBeforeElChildrenUpdated||c,P=!0===l.childrenOnly,R={};p(e);var O=e,D=O.nodeType,j=n.nodeType;if(!P)if(D===b)j===b?o(e,n)||(B(e),O=a(e,i(n.nodeName,n.namespaceURI))):O=n;else if(D===m||D===w){if(j===D)return O.nodeValue=n.nodeValue,O;O=n}if(O===n)B(e);else if(g(O,n,P),E)for(var _=0,M=E.length;_0&&!r.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},{}],37:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',m={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},w=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.id=e.getUniqId(),r.menu_id=e.getUniqId(),r.addTemplate(r.id,g),r.addTemplate(r.menu_id,y.default.removeIndentNewline(v)),r.data=(0,p.default)({},m,n);var a=r.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=r.parse(""+l.innerHTML+"
    "),a.tableResult=r.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=r.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),r.convert={},r.convert.getStyleByAlign=r.getStyleByAlign,r.convert.setClass=r.setClass +;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var n=document.createRange();"firefox"===e.getBrowser()&&t.hasChildNodes()&&"BR"===t.lastChild.tagName?n.setEndBefore(t.lastChild):n.selectNodeContents(t),n.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(n)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(t),o.collapse(!1),o.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,e.increaseDecreaseRows&&this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,a.increaseDecreaseColumns&&this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e Date: Tue, 3 Sep 2024 21:23:59 +0900 Subject: [PATCH 09/14] Fix bug that extra linefeed is added in tables field on IE 11 copy diff from https://github.com/movabletype/movabletype/commit/00cfba7ec1b65bfbd47dff2d86bfec4fec36a1f9 --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index 1fed4ff..78aafec 100644 --- a/src/index.js +++ b/src/index.js @@ -538,6 +538,11 @@ export default class aTable extends aTemplate { const range = document.createRange(); if (aTable.getBrowser() === 'firefox' && elem.hasChildNodes() && elem.lastChild.tagName === 'BR') { range.setEndBefore(elem.lastChild); + } else if (aTable.getBrowser() === 'ie11' + && elem.hasChildNodes() && elem.lastChild.tagName === 'P' + && elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR') + { + range.setEndBefore(elem.lastChild.lastChild); } else { range.selectNodeContents(elem); } From c13fb13b3b648a85efe3677091d9f94bc5a3da03 Mon Sep 17 00:00:00 2001 From: Masahiro Iuchi Date: Tue, 3 Sep 2024 21:24:15 +0900 Subject: [PATCH 10/14] yarn build:js --- build/a-table.js | 2 ++ build/a-table.min.js | 2 +- lib/index.js | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/a-table.js b/build/a-table.js index 401abe6..a5937f8 100644 --- a/build/a-table.js +++ b/build/a-table.js @@ -5577,6 +5577,8 @@ var aTable = function (_aTemplate) { var range = document.createRange(); if (aTable.getBrowser() === 'firefox' && elem.hasChildNodes() && elem.lastChild.tagName === 'BR') { range.setEndBefore(elem.lastChild); + } else if (aTable.getBrowser() === 'ie11' && elem.hasChildNodes() && elem.lastChild.tagName === 'P' && elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR') { + range.setEndBefore(elem.lastChild.lastChild); } else { range.selectNodeContents(elem); } diff --git a/build/a-table.min.js b/build/a-table.min.js index 6dd860c..6b2da00 100644 --- a/build/a-table.min.js +++ b/build/a-table.min.js @@ -166,4 +166,4 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ "use strict";function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(t){var e=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?e[a]=o(t):n(t)?e[a]=r(t):e[a]=i({},t):e[a]=t}),e}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var t,e,a=arguments[0],l=Array.prototype.slice.call(arguments,1);return l.forEach(function(l){"object"!=typeof l||null===l||Array.isArray(l)||Object.keys(l).forEach(function(s){return e=a[s],t=l[s],t===a?void 0:"object"!=typeof t||null===t?void(a[s]=t):Array.isArray(t)?void(a[s]=o(t)):n(t)?void(a[s]=r(t)):"object"!=typeof e||null===e||Array.isArray(e)?void(a[s]=i({},t)):void(a[s]=i(e,t))})}),a}}).call(this,t("buffer").Buffer)},{buffer:8}],12:[function(t,e,n){"use strict";var r=t("object-keys"),o=t("foreach"),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),a=Object.prototype.toString,l=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)},s=Object.defineProperty&&function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),c=function(t,e,n,r){(!(e in t)||l(r)&&r())&&(s?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},u=function(t,e){var n=arguments.length>2?arguments[2]:{},a=r(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(r){c(t,r,e[r],n[r])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:24,"object-keys":35}],13:[function(t,e,n){"use strict";var r=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c={ToPrimitive:s,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return a(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=c},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,a=t("./helpers/isNaN"),l=t("./helpers/isFinite"),s=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,c=t("./helpers/assign"),u=t("./helpers/sign"),f=t("./helpers/mod"),h=t("./helpers/isPrimitive"),p=t("es-to-primitive/es6"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,String.prototype.slice),v=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),b=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=["…","​","￾"].join(""),w=new RegExp("["+m+"]","g"),x=y.call(Function.call,RegExp.prototype.test,w),E=y.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),C=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),T=new RegExp("(^["+C+"]+)|(["+C+"]+$)","g"),A=y.call(Function.call,String.prototype.replace),N=function(t){return A(t,T,"")},S=t("./es5"),k=t("is-regex"),B=c(c({},S),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:p,ToNumber:function(t){var e=h(t)?t:p(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(g(e,2),2));if(b(e))return this.ToNumber(d(g(e,2),8));if(x(e)||E(e))return NaN;var n=N(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!l(e))return 0;var n=u(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(a(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5s?s:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:S.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!h(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||a(t)||!l(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if(void 0!==e)return S.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||a(t)&&a(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":S.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete B.CheckObjectCoercible,e.exports=B},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}},{}],16:[function(t,e,n){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],17:[function(t,e,n){e.exports=Number.isNaN||function(t){return t!==t}},{}],18:[function(t,e,n){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],19:[function(t,e,n){e.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},{}],20:[function(t,e,n){e.exports=function(t){return t>=0?1:-1}},{}],21:[function(t,e,n){"use strict";var r=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var a,l,s=n===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,n);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||l(t))&&(n="string"),s(t,"default"===n?"number":n)}},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],24:[function(t,e,n){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,n){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=n?o-1:0,h=n?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*y}},{}],29:[function(t,e,n){"use strict";var r=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=r.call(t),n=e.replace(/\/\/.*\n/g,""),i=n.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(r.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],30:[function(t,e,n){"use strict";var r=Date.prototype.getDay,o=function(t){try{return r.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],31:[function(t,e,n){"use strict";var r=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&a(t)}},{has:27}],32:[function(t,e,n){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],33:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],34:[function(t,e,n){"use strict";function r(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function l(t,e){var n,r,o,i,a,l=e.attributes;for(n=l.length-1;n>=0;--n)r=l[n],o=r.name,i=r.namespaceURI,a=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,n=l.length-1;n>=0;--n)r=l[n],!1!==r.specified&&(o=r.name,i=r.namespaceURI,i?(o=r.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:y.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;if(t.value!==n&&(t.value=n),t.firstChild){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},b=1,m=3,w=8,x=function(t){return function(e,n,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var n=t.firstChild;n;){var r=void 0;e&&(r=C(n))?s(r):(B(n),n.firstChild&&f(n,e)),n=n.nextSibling}}function h(t,e,n){!1!==k(t)&&(e&&e.removeChild(t),B(t),f(t,n))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var n=C(e);n&&(R[n]=e),p(e),e=e.nextSibling}}function y(t){A(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=C(e);if(r){var i=R[r];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=n}}function g(r,i,a){var l,c=C(i);if(c&&delete R[c],!n.isSameNode||!n.isSameNode(e)){if(!a){if(!1===N(r,i))return;if(t(r,i),S(r),!1===I(r,i))return}if("TEXTAREA"!==r.nodeName){var u,f,p,x,E=i.firstChild,A=r.firstChild;t:for(;E;){for(p=E.nextSibling,u=C(E);A;){if(f=A.nextSibling,E.isSameNode&&E.isSameNode(A)){E=p,A=f;continue t}l=C(A);var k=A.nodeType,B=void 0;if(k===E.nodeType&&(k===b?(u?u!==l&&((x=R[u])?A.nextSibling===x?B=!1:(r.insertBefore(x,A),f=A.nextSibling,l?s(l):h(A,r,!0),A=x):B=!1):l&&(B=!1),(B=!1!==B&&o(A,E))&&g(A,E)):k!==m&&k!=w||(B=!0,A.nodeValue=E.nodeValue)),B){E=p,A=f;continue t}l?s(l):h(A,r,!0),A=f}if(u&&(x=R[u])&&o(x,E))r.appendChild(x),g(x,E);else{var P=T(E);!1!==P&&(P&&(E=P),E.actualize&&(E=E.actualize(r.ownerDocument||d)),r.appendChild(E),y(E))}E=p,A=f}for(;A;)f=A.nextSibling,(l=C(A))?s(l):h(A,r,!0),A=f}var O=v[r.nodeName];O&&O(r,i)}}if(l||(l={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=n;n=d.createElement("html"),n.innerHTML=x}else n=r(n);var E,C=l.getNodeKey||u,T=l.onBeforeNodeAdded||c,A=l.onNodeAdded||c,N=l.onBeforeElUpdated||c,S=l.onElUpdated||c,k=l.onBeforeNodeDiscarded||c,B=l.onNodeDiscarded||c,I=l.onBeforeElChildrenUpdated||c,P=!0===l.childrenOnly,R={};p(e);var O=e,D=O.nodeType,j=n.nodeType;if(!P)if(D===b)j===b?o(e,n)||(B(e),O=a(e,i(n.nodeName,n.namespaceURI))):O=n;else if(D===m||D===w){if(j===D)return O.nodeValue=n.nodeValue,O;O=n}if(O===n)B(e);else if(g(O,n,P),E)for(var _=0,M=E.length;_0&&!r.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},{}],37:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',m={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},w=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.id=e.getUniqId(),r.menu_id=e.getUniqId(),r.addTemplate(r.id,g),r.addTemplate(r.menu_id,y.default.removeIndentNewline(v)),r.data=(0,p.default)({},m,n);var a=r.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=r.parse(""+l.innerHTML+"
    "),a.tableResult=r.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=r.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),r.convert={},r.convert.getStyleByAlign=r.getStyleByAlign,r.convert.setClass=r.setClass -;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var n=document.createRange();"firefox"===e.getBrowser()&&t.hasChildNodes()&&"BR"===t.lastChild.tagName?n.setEndBefore(t.lastChild):n.selectNodeContents(t),n.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(n)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(t),o.collapse(!1),o.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,e.increaseDecreaseRows&&this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,a.increaseDecreaseColumns&&this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e\n
    \n
    \n
    \n
    \n
    \n ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var n=document.createRange();"firefox"===e.getBrowser()&&t.hasChildNodes()&&"BR"===t.lastChild.tagName?n.setEndBefore(t.lastChild):"ie11"===e.getBrowser()&&t.hasChildNodes()&&"P"===t.lastChild.tagName&&t.lastChild.hasChildNodes()&&"BR"===t.lastChild.lastChild.tagName?n.setEndBefore(t.lastChild.lastChild):n.selectNodeContents(t),n.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(n)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(t),o.collapse(!1),o.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,e.increaseDecreaseRows&&this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,a.increaseDecreaseColumns&&this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e Date: Tue, 3 Sep 2024 21:24:53 +0900 Subject: [PATCH 11/14] Fix bug that extra linefeed is added in tables field on Edge copy diff from https://github.com/movabletype/movabletype/commit/3861c76327fc88e5ced22576888eeda2814cce5e --- src/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.js b/src/index.js index 78aafec..abc33b0 100644 --- a/src/index.js +++ b/src/index.js @@ -543,6 +543,11 @@ export default class aTable extends aTemplate { && elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR') { range.setEndBefore(elem.lastChild.lastChild); + } else if (aTable.getBrowser() === 'edge' + && elem.hasChildNodes() && elem.lastChild.tagName === 'DIV' + && elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR') + { + range.setEndBefore(elem.lastChild.lastChild); } else { range.selectNodeContents(elem); } @@ -1539,6 +1544,8 @@ export default class aTable extends aTemplate { } } else if (ua.indexOf('trident/7') != -1) { name = 'ie11'; + } else if (ua.indexOf('edge') != -1) { + name = 'edge'; } else if (ua.indexOf('chrome') != -1) { name = 'chrome'; } else if (ua.indexOf('safari') != -1) { From 1bc4231ae32d5c07a9cfb3b736f49dc1c3f4e7ee Mon Sep 17 00:00:00 2001 From: Masahiro Iuchi Date: Tue, 3 Sep 2024 21:26:54 +0900 Subject: [PATCH 12/14] yarn build:js --- build/a-table.js | 4 ++++ build/a-table.min.js | 2 +- lib/index.js | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/build/a-table.js b/build/a-table.js index a5937f8..fc0fafa 100644 --- a/build/a-table.js +++ b/build/a-table.js @@ -5579,6 +5579,8 @@ var aTable = function (_aTemplate) { range.setEndBefore(elem.lastChild); } else if (aTable.getBrowser() === 'ie11' && elem.hasChildNodes() && elem.lastChild.tagName === 'P' && elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR') { range.setEndBefore(elem.lastChild.lastChild); + } else if (aTable.getBrowser() === 'edge' && elem.hasChildNodes() && elem.lastChild.tagName === 'DIV' && elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR') { + range.setEndBefore(elem.lastChild.lastChild); } else { range.selectNodeContents(elem); } @@ -6617,6 +6619,8 @@ var aTable = function (_aTemplate) { } } else if (ua.indexOf('trident/7') != -1) { name = 'ie11'; + } else if (ua.indexOf('edge') != -1) { + name = 'edge'; } else if (ua.indexOf('chrome') != -1) { name = 'chrome'; } else if (ua.indexOf('safari') != -1) { diff --git a/build/a-table.min.js b/build/a-table.min.js index 6b2da00..146a6b8 100644 --- a/build/a-table.min.js +++ b/build/a-table.min.js @@ -166,4 +166,4 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ "use strict";function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(t){var e=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?e[a]=o(t):n(t)?e[a]=r(t):e[a]=i({},t):e[a]=t}),e}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var t,e,a=arguments[0],l=Array.prototype.slice.call(arguments,1);return l.forEach(function(l){"object"!=typeof l||null===l||Array.isArray(l)||Object.keys(l).forEach(function(s){return e=a[s],t=l[s],t===a?void 0:"object"!=typeof t||null===t?void(a[s]=t):Array.isArray(t)?void(a[s]=o(t)):n(t)?void(a[s]=r(t)):"object"!=typeof e||null===e||Array.isArray(e)?void(a[s]=i({},t)):void(a[s]=i(e,t))})}),a}}).call(this,t("buffer").Buffer)},{buffer:8}],12:[function(t,e,n){"use strict";var r=t("object-keys"),o=t("foreach"),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),a=Object.prototype.toString,l=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)},s=Object.defineProperty&&function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),c=function(t,e,n,r){(!(e in t)||l(r)&&r())&&(s?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},u=function(t,e){var n=arguments.length>2?arguments[2]:{},a=r(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(r){c(t,r,e[r],n[r])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:24,"object-keys":35}],13:[function(t,e,n){"use strict";var r=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c={ToPrimitive:s,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return a(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=c},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,a=t("./helpers/isNaN"),l=t("./helpers/isFinite"),s=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,c=t("./helpers/assign"),u=t("./helpers/sign"),f=t("./helpers/mod"),h=t("./helpers/isPrimitive"),p=t("es-to-primitive/es6"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,String.prototype.slice),v=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),b=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=["…","​","￾"].join(""),w=new RegExp("["+m+"]","g"),x=y.call(Function.call,RegExp.prototype.test,w),E=y.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),C=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),T=new RegExp("(^["+C+"]+)|(["+C+"]+$)","g"),A=y.call(Function.call,String.prototype.replace),N=function(t){return A(t,T,"")},S=t("./es5"),k=t("is-regex"),B=c(c({},S),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:p,ToNumber:function(t){var e=h(t)?t:p(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(g(e,2),2));if(b(e))return this.ToNumber(d(g(e,2),8));if(x(e)||E(e))return NaN;var n=N(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!l(e))return 0;var n=u(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(a(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5s?s:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:S.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!h(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||a(t)||!l(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if(void 0!==e)return S.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||a(t)&&a(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":S.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete B.CheckObjectCoercible,e.exports=B},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}},{}],16:[function(t,e,n){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],17:[function(t,e,n){e.exports=Number.isNaN||function(t){return t!==t}},{}],18:[function(t,e,n){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],19:[function(t,e,n){e.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},{}],20:[function(t,e,n){e.exports=function(t){return t>=0?1:-1}},{}],21:[function(t,e,n){"use strict";var r=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var a,l,s=n===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,n);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||l(t))&&(n="string"),s(t,"default"===n?"number":n)}},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],24:[function(t,e,n){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,n){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=n?o-1:0,h=n?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*y}},{}],29:[function(t,e,n){"use strict";var r=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=r.call(t),n=e.replace(/\/\/.*\n/g,""),i=n.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(r.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],30:[function(t,e,n){"use strict";var r=Date.prototype.getDay,o=function(t){try{return r.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],31:[function(t,e,n){"use strict";var r=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&a(t)}},{has:27}],32:[function(t,e,n){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],33:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],34:[function(t,e,n){"use strict";function r(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function l(t,e){var n,r,o,i,a,l=e.attributes;for(n=l.length-1;n>=0;--n)r=l[n],o=r.name,i=r.namespaceURI,a=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,n=l.length-1;n>=0;--n)r=l[n],!1!==r.specified&&(o=r.name,i=r.namespaceURI,i?(o=r.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:y.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;if(t.value!==n&&(t.value=n),t.firstChild){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},b=1,m=3,w=8,x=function(t){return function(e,n,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var n=t.firstChild;n;){var r=void 0;e&&(r=C(n))?s(r):(B(n),n.firstChild&&f(n,e)),n=n.nextSibling}}function h(t,e,n){!1!==k(t)&&(e&&e.removeChild(t),B(t),f(t,n))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var n=C(e);n&&(R[n]=e),p(e),e=e.nextSibling}}function y(t){A(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=C(e);if(r){var i=R[r];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=n}}function g(r,i,a){var l,c=C(i);if(c&&delete R[c],!n.isSameNode||!n.isSameNode(e)){if(!a){if(!1===N(r,i))return;if(t(r,i),S(r),!1===I(r,i))return}if("TEXTAREA"!==r.nodeName){var u,f,p,x,E=i.firstChild,A=r.firstChild;t:for(;E;){for(p=E.nextSibling,u=C(E);A;){if(f=A.nextSibling,E.isSameNode&&E.isSameNode(A)){E=p,A=f;continue t}l=C(A);var k=A.nodeType,B=void 0;if(k===E.nodeType&&(k===b?(u?u!==l&&((x=R[u])?A.nextSibling===x?B=!1:(r.insertBefore(x,A),f=A.nextSibling,l?s(l):h(A,r,!0),A=x):B=!1):l&&(B=!1),(B=!1!==B&&o(A,E))&&g(A,E)):k!==m&&k!=w||(B=!0,A.nodeValue=E.nodeValue)),B){E=p,A=f;continue t}l?s(l):h(A,r,!0),A=f}if(u&&(x=R[u])&&o(x,E))r.appendChild(x),g(x,E);else{var P=T(E);!1!==P&&(P&&(E=P),E.actualize&&(E=E.actualize(r.ownerDocument||d)),r.appendChild(E),y(E))}E=p,A=f}for(;A;)f=A.nextSibling,(l=C(A))?s(l):h(A,r,!0),A=f}var O=v[r.nodeName];O&&O(r,i)}}if(l||(l={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=n;n=d.createElement("html"),n.innerHTML=x}else n=r(n);var E,C=l.getNodeKey||u,T=l.onBeforeNodeAdded||c,A=l.onNodeAdded||c,N=l.onBeforeElUpdated||c,S=l.onElUpdated||c,k=l.onBeforeNodeDiscarded||c,B=l.onNodeDiscarded||c,I=l.onBeforeElChildrenUpdated||c,P=!0===l.childrenOnly,R={};p(e);var O=e,D=O.nodeType,j=n.nodeType;if(!P)if(D===b)j===b?o(e,n)||(B(e),O=a(e,i(n.nodeName,n.namespaceURI))):O=n;else if(D===m||D===w){if(j===D)return O.nodeValue=n.nodeValue,O;O=n}if(O===n)B(e);else if(g(O,n,P),E)for(var _=0,M=E.length;_0&&!r.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},{}],37:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',m={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},w=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.id=e.getUniqId(),r.menu_id=e.getUniqId(),r.addTemplate(r.id,g),r.addTemplate(r.menu_id,y.default.removeIndentNewline(v)),r.data=(0,p.default)({},m,n);var a=r.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=r.parse(""+l.innerHTML+"
    "),a.tableResult=r.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=r.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),r.convert={},r.convert.getStyleByAlign=r.getStyleByAlign,r.convert.setClass=r.setClass -;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var n=document.createRange();"firefox"===e.getBrowser()&&t.hasChildNodes()&&"BR"===t.lastChild.tagName?n.setEndBefore(t.lastChild):"ie11"===e.getBrowser()&&t.hasChildNodes()&&"P"===t.lastChild.tagName&&t.lastChild.hasChildNodes()&&"BR"===t.lastChild.lastChild.tagName?n.setEndBefore(t.lastChild.lastChild):n.selectNodeContents(t),n.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(n)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(t),o.collapse(!1),o.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,e.increaseDecreaseRows&&this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,a.increaseDecreaseColumns&&this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e\n
    \n
    \n
    \n
    \n
    \n ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var n=document.createRange();"firefox"===e.getBrowser()&&t.hasChildNodes()&&"BR"===t.lastChild.tagName?n.setEndBefore(t.lastChild):"ie11"===e.getBrowser()&&t.hasChildNodes()&&"P"===t.lastChild.tagName&&t.lastChild.hasChildNodes()&&"BR"===t.lastChild.lastChild.tagName?n.setEndBefore(t.lastChild.lastChild):"edge"===e.getBrowser()&&t.hasChildNodes()&&"DIV"===t.lastChild.tagName&&t.lastChild.hasChildNodes()&&"BR"===t.lastChild.lastChild.tagName?n.setEndBefore(t.lastChild.lastChild):n.selectNodeContents(t),n.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(n)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(t),o.collapse(!1),o.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,e.increaseDecreaseRows&&this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,a.increaseDecreaseColumns&&this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("edge")?n="edge":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e Date: Tue, 3 Sep 2024 21:27:33 +0900 Subject: [PATCH 13/14] Fix bug that value is reverted after moving cell in tables field on Edge copy diff from https://github.com/movabletype/movabletype/commit/a906bc6e1c35d616fb52dc93422f9e7bd5820c27 --- src/index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index abc33b0..ac2f959 100644 --- a/src/index.js +++ b/src/index.js @@ -545,9 +545,13 @@ export default class aTable extends aTemplate { range.setEndBefore(elem.lastChild.lastChild); } else if (aTable.getBrowser() === 'edge' && elem.hasChildNodes() && elem.lastChild.tagName === 'DIV' - && elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR') + && elem.lastChild.hasChildNodes()) { - range.setEndBefore(elem.lastChild.lastChild); + if (elem.lastChild.lastChild.tagName === 'BR') { + range.setEndBefore(elem.lastChild.lastChild); + } else { + range.setEndAfter(elem.lastChild.lastChild); + } } else { range.selectNodeContents(elem); } @@ -843,7 +847,9 @@ export default class aTable extends aTemplate { if (this.afterEntered) { this.afterEntered(); } - } else if (type === 'keyup' && aTable.getBrowser().indexOf('ie') !== -1) { + } else if (type === 'keyup' + && (aTable.getBrowser().indexOf('ie') !== -1 || aTable.getBrowser() === 'edge')) + { if (util.hasClass(this.e.target, 'a-table-editable') && this.e.target.parentNode.getAttribute('data-cell-id') === `${b}-${a}`) { data.history.push(clone(data.row)); data.row[a].col[b].value = this.e.target.innerHTML.replace(/{(.*?)}/g, '{$1}'); From ed2cdf5153a7ffd7009a5f4981d5ee6d827579e4 Mon Sep 17 00:00:00 2001 From: Masahiro Iuchi Date: Tue, 3 Sep 2024 21:27:56 +0900 Subject: [PATCH 14/14] yarn build:js --- build/a-table.js | 10 +++++++--- build/a-table.min.js | 2 +- lib/index.js | 10 +++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/build/a-table.js b/build/a-table.js index fc0fafa..c5d6375 100644 --- a/build/a-table.js +++ b/build/a-table.js @@ -5579,8 +5579,12 @@ var aTable = function (_aTemplate) { range.setEndBefore(elem.lastChild); } else if (aTable.getBrowser() === 'ie11' && elem.hasChildNodes() && elem.lastChild.tagName === 'P' && elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR') { range.setEndBefore(elem.lastChild.lastChild); - } else if (aTable.getBrowser() === 'edge' && elem.hasChildNodes() && elem.lastChild.tagName === 'DIV' && elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR') { - range.setEndBefore(elem.lastChild.lastChild); + } else if (aTable.getBrowser() === 'edge' && elem.hasChildNodes() && elem.lastChild.tagName === 'DIV' && elem.lastChild.hasChildNodes()) { + if (elem.lastChild.lastChild.tagName === 'BR') { + range.setEndBefore(elem.lastChild.lastChild); + } else { + range.setEndAfter(elem.lastChild.lastChild); + } } else { range.selectNodeContents(elem); } @@ -5891,7 +5895,7 @@ var aTable = function (_aTemplate) { if (this.afterEntered) { this.afterEntered(); } - } else if (type === 'keyup' && aTable.getBrowser().indexOf('ie') !== -1) { + } else if (type === 'keyup' && (aTable.getBrowser().indexOf('ie') !== -1 || aTable.getBrowser() === 'edge')) { if (_util2.default.hasClass(this.e.target, 'a-table-editable') && this.e.target.parentNode.getAttribute('data-cell-id') === b + '-' + a) { data.history.push((0, _clone2.default)(data.row)); data.row[a].col[b].value = this.e.target.innerHTML.replace(/{(.*?)}/g, '{$1}'); diff --git a/build/a-table.min.js b/build/a-table.min.js index 146a6b8..7191318 100644 --- a/build/a-table.min.js +++ b/build/a-table.min.js @@ -166,4 +166,4 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ "use strict";function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(t){var e=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?e[a]=o(t):n(t)?e[a]=r(t):e[a]=i({},t):e[a]=t}),e}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var t,e,a=arguments[0],l=Array.prototype.slice.call(arguments,1);return l.forEach(function(l){"object"!=typeof l||null===l||Array.isArray(l)||Object.keys(l).forEach(function(s){return e=a[s],t=l[s],t===a?void 0:"object"!=typeof t||null===t?void(a[s]=t):Array.isArray(t)?void(a[s]=o(t)):n(t)?void(a[s]=r(t)):"object"!=typeof e||null===e||Array.isArray(e)?void(a[s]=i({},t)):void(a[s]=i(e,t))})}),a}}).call(this,t("buffer").Buffer)},{buffer:8}],12:[function(t,e,n){"use strict";var r=t("object-keys"),o=t("foreach"),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),a=Object.prototype.toString,l=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)},s=Object.defineProperty&&function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}}(),c=function(t,e,n,r){(!(e in t)||l(r)&&r())&&(s?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},u=function(t,e){var n=arguments.length>2?arguments[2]:{},a=r(e);i&&(a=a.concat(Object.getOwnPropertySymbols(e))),o(a,function(r){c(t,r,e[r],n[r])})};u.supportsDescriptors=!!s,e.exports=u},{foreach:24,"object-keys":35}],13:[function(t,e,n){"use strict";var r=t("./helpers/isNaN"),o=t("./helpers/isFinite"),i=t("./helpers/sign"),a=t("./helpers/mod"),l=t("is-callable"),s=t("es-to-primitive/es5"),c={ToPrimitive:s,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return a(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:l,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};e.exports=c},{"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,"is-callable":29}],14:[function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,a=t("./helpers/isNaN"),l=t("./helpers/isFinite"),s=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,c=t("./helpers/assign"),u=t("./helpers/sign"),f=t("./helpers/mod"),h=t("./helpers/isPrimitive"),p=t("es-to-primitive/es6"),d=parseInt,y=t("function-bind"),g=y.call(Function.call,String.prototype.slice),v=y.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),b=y.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),m=["…","​","￾"].join(""),w=new RegExp("["+m+"]","g"),x=y.call(Function.call,RegExp.prototype.test,w),E=y.call(Function.call,RegExp.prototype.test,/^[-+]0x[0-9a-f]+$/i),C=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),T=new RegExp("(^["+C+"]+)|(["+C+"]+$)","g"),A=y.call(Function.call,String.prototype.replace),N=function(t){return A(t,T,"")},S=t("./es5"),k=t("is-regex"),B=c(c({},S),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:p,ToNumber:function(t){var e=h(t)?t:p(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(g(e,2),2));if(b(e))return this.ToNumber(d(g(e,2),8));if(x(e)||E(e))return NaN;var n=N(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!l(e))return 0;var n=u(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(a(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5s?s:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:S.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!h(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||a(t)||!l(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if(void 0!==e)return S.ToBoolean(e)}return k(t)},SameValueZero:function(t,e){return t===e||a(t)&&a(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":S.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete B.CheckObjectCoercible,e.exports=B},{"./es5":13,"./helpers/assign":15,"./helpers/isFinite":16,"./helpers/isNaN":17,"./helpers/isPrimitive":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es6":22,"function-bind":26,"is-regex":31}],15:[function(t,e,n){var r=Object.prototype.hasOwnProperty;e.exports=Object.assign||function(t,e){for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}},{}],16:[function(t,e,n){var r=Number.isNaN||function(t){return t!==t};e.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},{}],17:[function(t,e,n){e.exports=Number.isNaN||function(t){return t!==t}},{}],18:[function(t,e,n){e.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},{}],19:[function(t,e,n){e.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},{}],20:[function(t,e,n){e.exports=function(t){return t>=0?1:-1}},{}],21:[function(t,e,n){"use strict";var r=Object.prototype.toString,o=t("./helpers/isPrimitive"),i=t("is-callable"),a={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var a,l,s=n===String?["toString","valueOf"]:["valueOf","toString"];for(l=0;l1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=c(t,Symbol.toPrimitive):l(t)&&(i=Symbol.prototype.valueOf)),void 0!==i){var u=i.call(t,n);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||l(t))&&(n="string"),s(t,"default"===n?"number":n)}},{"./helpers/isPrimitive":23,"is-callable":29,"is-date-object":30,"is-symbol":32}],23:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{dup:18}],24:[function(t,e,n){var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(t,e,n){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a>1,u=-7,f=n?o-1:0,h=n?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=l;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var a,l,s,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),e+=a+f>=1?h/s:h*Math.pow(2,1-f),e*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(e*s-1)*Math.pow(2,o),a+=f):(l=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&l,p+=d,l/=256,o-=8);for(a=a<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*y}},{}],29:[function(t,e,n){"use strict";var r=Function.prototype.toString,o=/^\s*class /,i=function(t){try{var e=r.call(t),n=e.replace(/\/\/.*\n/g,""),i=n.replace(/\/\*[.\s\S]*\*\//g,""),a=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(a)}catch(t){return!1}},a=function(t){try{return!i(t)&&(r.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return a(t);if(i(t))return!1;var e=l.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},{}],30:[function(t,e,n){"use strict";var r=Date.prototype.getDay,o=function(t){try{return r.call(t),!0}catch(t){return!1}},i=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){return"object"==typeof t&&null!==t&&(a?o(t):"[object Date]"===i.call(t))}},{}],31:[function(t,e,n){"use strict";var r=t("has"),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,a=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},l=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s)return"[object RegExp]"===l.call(t);var e=i(t,"lastIndex");return!(!e||!r(e,"value"))&&a(t)}},{has:27}],32:[function(t,e,n){"use strict";var r=Object.prototype.toString;if("function"==typeof Symbol&&"symbol"==typeof Symbol()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,a=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};e.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return a(t)}catch(t){return!1}}}else e.exports=function(t){return!1}},{}],33:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],34:[function(t,e,n){"use strict";function r(t){!f&&d.createRange&&(f=d.createRange(),f.selectNode(d.body));var e;return f&&f.createContextualFragment?e=f.createContextualFragment(t):(e=d.createElement("body"),e.innerHTML=t),e.childNodes[0]}function o(t,e){var n=t.nodeName,r=e.nodeName;return n===r||!!(e.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function i(t,e){return e&&e!==p?d.createElementNS(e,t):d.createElement(t)}function a(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function l(t,e){var n,r,o,i,a,l=e.attributes;for(n=l.length-1;n>=0;--n)r=l[n],o=r.name,i=r.namespaceURI,a=r.value,i?(o=r.localName||o,t.getAttributeNS(i,o)!==a&&t.setAttributeNS(i,o,a)):t.getAttribute(o)!==a&&t.setAttribute(o,a);for(l=t.attributes,n=l.length-1;n>=0;--n)r=l[n],!1!==r.specified&&(o=r.name,i=r.namespaceURI,i?(o=r.localName||o,g(e,i,o)||t.removeAttributeNS(i,o)):g(e,null,o)||t.removeAttribute(o))}function s(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n,""))}function c(){}function u(t){return t.id}var f,h,p="http://www.w3.org/1999/xhtml",d="undefined"==typeof document?void 0:document,y=d?d.body||d.createElement("div"):{};h=y.hasAttributeNS?function(t,e,n){return t.hasAttributeNS(e,n)}:y.hasAttribute?function(t,e,n){return t.hasAttribute(n)}:function(t,e,n){return null!=t.getAttributeNode(e,n)};var g=h,v={OPTION:function(t,e){s(t,e,"selected")},INPUT:function(t,e){s(t,e,"checked"),s(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),g(e,null,"value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;if(t.value!==n&&(t.value=n),t.firstChild){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}},SELECT:function(t,e){if(!g(e,null,"multiple")){for(var n=0,r=e.firstChild;r;){var o=r.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(g(r,null,"selected")){n;break}n++}r=r.nextSibling}t.selectedIndex=n}}},b=1,m=3,w=8,x=function(t){return function(e,n,l){function s(t){E?E.push(t):E=[t]}function f(t,e){if(t.nodeType===b)for(var n=t.firstChild;n;){var r=void 0;e&&(r=C(n))?s(r):(B(n),n.firstChild&&f(n,e)),n=n.nextSibling}}function h(t,e,n){!1!==k(t)&&(e&&e.removeChild(t),B(t),f(t,n))}function p(t){if(t.nodeType===b)for(var e=t.firstChild;e;){var n=C(e);n&&(R[n]=e),p(e),e=e.nextSibling}}function y(t){A(t);for(var e=t.firstChild;e;){var n=e.nextSibling,r=C(e);if(r){var i=R[r];i&&o(e,i)&&(e.parentNode.replaceChild(i,e),g(i,e))}y(e),e=n}}function g(r,i,a){var l,c=C(i);if(c&&delete R[c],!n.isSameNode||!n.isSameNode(e)){if(!a){if(!1===N(r,i))return;if(t(r,i),S(r),!1===I(r,i))return}if("TEXTAREA"!==r.nodeName){var u,f,p,x,E=i.firstChild,A=r.firstChild;t:for(;E;){for(p=E.nextSibling,u=C(E);A;){if(f=A.nextSibling,E.isSameNode&&E.isSameNode(A)){E=p,A=f;continue t}l=C(A);var k=A.nodeType,B=void 0;if(k===E.nodeType&&(k===b?(u?u!==l&&((x=R[u])?A.nextSibling===x?B=!1:(r.insertBefore(x,A),f=A.nextSibling,l?s(l):h(A,r,!0),A=x):B=!1):l&&(B=!1),(B=!1!==B&&o(A,E))&&g(A,E)):k!==m&&k!=w||(B=!0,A.nodeValue=E.nodeValue)),B){E=p,A=f;continue t}l?s(l):h(A,r,!0),A=f}if(u&&(x=R[u])&&o(x,E))r.appendChild(x),g(x,E);else{var P=T(E);!1!==P&&(P&&(E=P),E.actualize&&(E=E.actualize(r.ownerDocument||d)),r.appendChild(E),y(E))}E=p,A=f}for(;A;)f=A.nextSibling,(l=C(A))?s(l):h(A,r,!0),A=f}var O=v[r.nodeName];O&&O(r,i)}}if(l||(l={}),"string"==typeof n)if("#document"===e.nodeName||"HTML"===e.nodeName){var x=n;n=d.createElement("html"),n.innerHTML=x}else n=r(n);var E,C=l.getNodeKey||u,T=l.onBeforeNodeAdded||c,A=l.onNodeAdded||c,N=l.onBeforeElUpdated||c,S=l.onElUpdated||c,k=l.onBeforeNodeDiscarded||c,B=l.onNodeDiscarded||c,I=l.onBeforeElChildrenUpdated||c,P=!0===l.childrenOnly,R={};p(e);var O=e,D=O.nodeType,j=n.nodeType;if(!P)if(D===b)j===b?o(e,n)||(B(e),O=a(e,i(n.nodeName,n.namespaceURI))):O=n;else if(D===m||D===w){if(j===D)return O.nodeValue=n.nodeValue,O;O=n}if(O===n)B(e);else if(g(O,n,P),E)for(var _=0,M=E.length;_0&&!r.call(t,0))for(var p=0;p0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},{}],37:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n\n\t\x3c!-- BEGIN mode:touch#cell --\x3e\n\t
  • \\{message.mergeCells\\}
  • \n\t
  • \\{message.splitCell\\}
  • \n\t
  • \\{message.changeToTh\\}
  • \n\t
  • \\{message.changeToTd\\}
  • \n\t
  • \\{message.alignLeft\\}
  • \n\t
  • \\{message.alignCenter\\}
  • \n\t
  • \\{message.alignRight\\}
  • \n\t\x3c!-- END mode:touch#cell --\x3e\n\t\x3c!-- BEGIN mode:touch#col --\x3e\n\t
  • \\{message.addColumnLeft\\}
  • \n\t
  • \\{message.addColumnRight\\}
  • \n\t
  • \\{message.removeColumn\\}
  • \n\t\x3c!-- END mode:touch#col --\x3e\n\t\x3c!-- BEGIN mode:touch#row --\x3e\n\t
  • \\{message.addRowTop\\}
  • \n\t
  • \\{message.addRowBottom\\}
  • \n\t
  • \\{message.removeRow\\}
  • \n\t\x3c!-- END mode:touch#row --\x3e\n\n\x3c!-- END showMenu:exist --\x3e\n
    \n\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\n\t\t\n\t\t\t\n\t\t\t\x3c!-- BEGIN highestRow:loop --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedRowNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- END highestRow:loop --\x3e\n\t\t\n\t\t\x3c!-- BEGIN row:loop --\x3e\n\t\t\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touchnot#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touchnot#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN selectedColNo:touch#{i} --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END selectedColNo:touch#{i} --\x3e\n\t\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\t\n\t\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\t\n\t\t\x3c!-- END row:loop --\x3e\n\t
    \\{value\\}
    \n\t\x3c!-- END inputMode:touch#table --\x3e\n\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\n\t\x3c!-- END inputMode:touch#source --\x3e\n
    \n',v='\x3c!-- BEGIN showBtnList:exist --\x3e\n
    \n\t
    \n\t\t\x3c!-- BEGIN inputMode:touch#table --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#table --\x3e\n\t\t\x3c!-- BEGIN inputMode:touch#source --\x3e\n\t\t\n\t\t\x3c!-- END inputMode:touch#source --\x3e\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- BEGIN tableOption:exist --\x3e\n\t
    \n\t\t
    \n\t\t\t\n\t\t\t\n\t\t
    \n\t
    \n\t\x3c!-- END tableOption:exist --\x3e\n
    \n\x3c!-- END showBtnList:exist --\x3e\n',b='\n\t\x3c!-- BEGIN row:loop --\x3e\n\t\n\t\t\x3c!-- \\BEGIN row.{i}.col:loop --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#th --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#th --\x3e\n\t\t\x3c!-- \\BEGIN type:touch#td --\x3e\n\t\t\\{value\\}\n\t\t\x3c!-- \\END type:touch#td --\x3e\n\t\t\x3c!-- \\END row.{i}.col:loop --\x3e\n\t\n\t\x3c!-- END row:loop --\x3e\n
    \n',m={showBtnList:!0,lang:"en",mark:{align:{default:"left",left:"left",center:"center",right:"right"},btn:{group:"a-table-btn-list",item:"a-table-btn",itemActive:"a-table-btn-active"},icon:{alignLeft:"a-table-icon a-table-icon-left",alignCenter:"a-table-icon a-table-icon-center",alignRight:"a-table-icon a-table-icon-right",undo:"a-table-icon a-table-icon-undo",merge:"a-table-icon a-table-icon-merge02",split:"a-table-icon a-table-icon-split02",table:"a-table-icon a-table-icon-th02",source:"a-table-icon a-table-icon-source01",td:"a-table-icon a-table-icon-td03",th:"a-table-icon a-table-icon-th02"},label:"a-table-label",actionGroup:"a-table-action-group",selector:{self:"a-table-selector"}},message:{mergeCells:"merge cell",splitCell:"split cell",changeToTh:"change to th",changeToTd:"change to td",alignLeft:"align left",alignCenter:"align center",alignRight:"align right",addColumnLeft:"insert column on the left",addColumnRight:"insert column on the right",removeColumn:"remove column",addRowTop:"insert row above",addRowBottom:"insert row below",removeRow:"remove row",source:"Source",mergeCellError1:"All possible cells should be selected so to merge cells into one",mergeCellConfirm1:"The top left cell's value of the selected range will only be saved. Are you sure you want to continue?",pasteError1:"You can't paste here",splitError1:"Cell is not selected",splitError2:"Only one cell should be selected",splitError3:"You can't split the cell anymore"}},w=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.id=e.getUniqId(),r.menu_id=e.getUniqId(),r.addTemplate(r.id,g),r.addTemplate(r.menu_id,y.default.removeIndentNewline(v)),r.data=(0,p.default)({},m,n);var a=r.data,l="string"==typeof t?document.querySelector(t):t;a.point={x:-1,y:-1},a.selectedRowNo=-1,a.selectedColNo=-1,a.showBtnList=!0,a.row=r.parse(""+l.innerHTML+"
    "),a.tableResult=r.getTable(),a.tableClass=l.getAttribute("class")||"",a.highestRow=r.highestRow,a.history=[],a.inputMode="table",a.cellClass="",a.history.push((0,f.default)(a.row)),r.convert={},r.convert.getStyleByAlign=r.getStyleByAlign,r.convert.setClass=r.setClass -;var s="\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var n=document.createRange();"firefox"===e.getBrowser()&&t.hasChildNodes()&&"BR"===t.lastChild.tagName?n.setEndBefore(t.lastChild):"ie11"===e.getBrowser()&&t.hasChildNodes()&&"P"===t.lastChild.tagName&&t.lastChild.hasChildNodes()&&"BR"===t.lastChild.lastChild.tagName?n.setEndBefore(t.lastChild.lastChild):"edge"===e.getBrowser()&&t.hasChildNodes()&&"DIV"===t.lastChild.tagName&&t.lastChild.hasChildNodes()&&"BR"===t.lastChild.lastChild.tagName?n.setEndBefore(t.lastChild.lastChild):n.selectNodeContents(t),n.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(n)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(t),o.collapse(!1),o.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,e.increaseDecreaseRows&&this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,a.increaseDecreaseColumns&&this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"===i&&-1!==e.getBrowser().indexOf("ie")&&(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("edge")?n="edge":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e\n
    \n
    \n
    \n
    \n
    \n ";return y.default.before(l,s),y.default.removeElement(l),r.update(),r}return a(e,t),l(e,[{key:"highestRow",value:function(){var t=[],e=this.data.row[0],n=0;return e?(e.col.forEach(function(e){for(var r=parseInt(e.colspan),o=0;o1&&this.update()}}},{key:"select",value:function(t,e){var n=this.data;n.point={x:e,y:t},n.row.forEach(function(n,r){if(!n||!n.col)return!1;n.col.forEach(function(n,o){r===t&&o===e||(n.selected=!1)})}),n.row[t].col[e].selected||(n.row[t].col[e].selected=!0)}},{key:"unselectCells",value:function(){this.data.row.forEach(function(t,e){if(!t||!t.col)return!1;t.col.forEach(function(t,e){t.selected=!1})})}},{key:"removeCell",value:function(t){for(var e=this.data.row,n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:"html",n=this,r=[],o=y.default.parseHTML(t),i=o.querySelectorAll("tr");return[].forEach.call(i,function(t){var o={},i=[],a=t.querySelectorAll("th,td");o.col=i,[].forEach.call(a,function(t){var r={},o="html"===e?t.innerHTML:t.innerText;"TH"===t.tagName?r.type="th":r.type="td",r.colspan=t.getAttribute("colspan")||1,r.rowspan=t.getAttribute("rowspan")||1,r.value="",o&&(r.value=o.replace(/{(.*?)}/g,"{$1}"));var a=t.getAttribute("class"),l="";if(a){a.split(/\s+/).forEach(function(t){var e=n.getAlignByStyle(t);e?r.align=e:l+=" "+t})}r.cellClass=l.substr(1),i.push(r)}),r.push(o)}),r}},{key:"parseText",value:function(t){var e=[];return t=t.replace(/"(([\n\r\t]|.)*?)"/g,function(t,e){return e.replace(/[\n\r]/g,"
    ")}),t.split(String.fromCharCode(13)).forEach(function(t){var n={},r=[];n.col=r,t.split(String.fromCharCode(9)).forEach(function(t){var e={};e.type="td",e.colspan=1,e.rowspan=1,e.value="",t&&(e.value=t.replace(/{(.*?)}/g,"{$1}")),r.push(e)}),e.push(n)}),e}},{key:"getTableClass",value:function(t){return y.default.parseHTML(t).getAttribute("class")}},{key:"toMarkdown",value:function(t){var e=y.default.parseHTML(t),n="",r=e.querySelectorAll("tr");return[].forEach.call(r,function(t,e){n+="| ";var r=t.querySelectorAll("td,th");[].forEach.call(r,function(t){n+=t.innerHTML,n+=" | "}),0===e&&(n+="\n| ",[].forEach.call(r,function(t){n+="--- | "})),n+="\n"}),n}},{key:"getTable",value:function(){return this.getHtml(b,!0).replace(/ class=""/g,"").replace(/class="(.*)? "/g,'class="$1"')}},{key:"getMarkdown",value:function(){return this.toMarkdown(this.getHtml(b,!0))}},{key:"putCaret",value:function(t){if(t)if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var n=document.createRange();"firefox"===e.getBrowser()&&t.hasChildNodes()&&"BR"===t.lastChild.tagName?n.setEndBefore(t.lastChild):"ie11"===e.getBrowser()&&t.hasChildNodes()&&"P"===t.lastChild.tagName&&t.lastChild.hasChildNodes()&&"BR"===t.lastChild.lastChild.tagName?n.setEndBefore(t.lastChild.lastChild):"edge"===e.getBrowser()&&t.hasChildNodes()&&"DIV"===t.lastChild.tagName&&t.lastChild.hasChildNodes()?"BR"===t.lastChild.lastChild.tagName?n.setEndBefore(t.lastChild.lastChild):n.setEndAfter(t.lastChild.lastChild):n.selectNodeContents(t),n.collapse(!1);var r=window.getSelection();r.removeAllRanges(),r.addRange(n)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(t),o.collapse(!1),o.select()}}},{key:"onUpdated",value:function(){var t=this,e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r=(n.width,this._getElementByQuery("table")),o=this._getSelf().parentNode,i=this._getElementByQuery(".a-table-selected .a-table-editable"),a=this.getSelectedPoints();if(i&&!this.data.showMenu&&1===a.length&&setTimeout(function(){t.putCaret(i)},1),r){o.style.width="9999px";var l=r.offsetWidth;o.style.width=l+"px"}else o.style.width="auto";this.afterRendered&&this.afterRendered()}},{key:"undo",value:function(){var t=this.data,e=t.row,n=t.history;if(0!==t.history.length){for(;JSON.stringify(e)===JSON.stringify(t.row);)e=n.pop();e&&(0===n.length&&n.push((0,f.default)(e)),t.row=e,this.update())}}},{key:"insertRow",value:function(t,e){var n=this.data,r=n.row;r[t]?r.splice(t,0,{col:e}):r.length===t&&r.push({col:e})}},{key:"insertCellAt",value:function(t,e,n){var r=this.data,o=r.row;o[t]&&o[t].col&&o[t].col.splice(e,0,n)}},{key:"unselect",value:function(){var t=this.data;this.unselectCells(),t.selectedColNo=-1,t.selectedRowNo=-1,t.showMenu=!1,this.update()}},{key:"selectRow",value:function(t){var e=this.data;this.unselectCells(),e.showMenu=!1;var n=this.getAllPoints(),r=this.getLargePoint.apply(null,n),o={x:parseInt(t),y:0,width:1,height:r.height},i=[],a=this;n.forEach(function(t){a.hitTest(o,t)&&i.push(t)}),i.forEach(function(t){a.getCellByPos(t.x,t.y).selected=!0}),e.mode="col",e.selectedColNo=-1,e.selectedRowNo=t,e.increaseDecreaseRows&&this.contextmenu(),this.update()}},{key:"selectCol",value:function(t){var e=this.getAllPoints(),n=this.getLargePoint.apply(null,e),r={x:0,y:parseInt(t),width:n.width,height:1},o=[],i=this,a=this.data;this.unselectCells(),a.showMenu=!1,e.forEach(function(t){i.hitTest(r,t)&&o.push(t)}),o.forEach(function(t){i.getCellByPos(t.x,t.y).selected=!0}),a.mode="row",a.selectedRowNo=-1,a.selectedColNo=t,a.increaseDecreaseColumns&&this.contextmenu(),this.update()}},{key:"removeCol",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t),y:0,width:1,height:o.height},a=[];r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),a.forEach(function(t){var e=n.getCellByPos(t.x,t.y);1===e.colspan?n.removeCell(e):e.colspan=parseInt(e.colspan)-1}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"removeRow",value:function(t){var e=this.data;e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t,width:o.width,height:1},a={x:0,y:t+1,width:o.width,height:1},l=[],s=[],c=[];r.forEach(function(t){n.hitTest(i,t)&&l.push(t)}),r.forEach(function(t){if(n.hitTest(a,t)){var e=n.getCellByPos(t.x,t.y);e.x=t.x,t.y===a.y&&c.push(e)}}),l.forEach(function(e){var r=n.getCellByPos(e.x,e.y);1===r.rowspan?s.push(r):(r.rowspan=parseInt(r.rowspan)-1,t===e.y&&(r.x=e.x,c.push(r)))}),c.sort(function(t,e){return t.x>e.x?1:-1}),s.forEach(function(t){n.removeCell(t)}),e.row.splice(t,1),c.length>0&&(e.row[t]={col:c}),e.history.push((0,f.default)(e.row)),this.update()}},{key:"updateTable",value:function(t,n){var r=this.data,o=this.e,i=o.type,a=this.getSelectedPoints(),l=e.isSmartPhone();if("mouseup"!==i||!this.data.showMenu){var s=[parseInt(n),parseInt(t)];if(n=s[0],t=s[1],r.mode="cell",r.selectedRowNo=-1,r.selectedColNo=-1,r.showMenu=!1,"compositionstart"===i)r.beingInput=!0;else if("compositionend"===i)r.beingInput=!1;else if("click"!==i||l)if("keydown"===i&&67==o.keyCode&&(o.ctrlKey||o.metaKey)){var c=this._getElementByQuery(".a-table-selected .a-table-editable");y.default.triggerEvent(c,"copy")}else if("copy"===i)this.copyTable(o);else if("paste"===i)this.pasteTable(o);else if("mousedown"!==i||l)if("mousemove"!==i||l)if("mouseup"!==i||l)"contextmenu"===i?(this.mousedown=!1,this.contextmenu()):"touchstart"===i?1===a.length&&this.data.row[n].col[t].selected||this.data.beingInput||(this.select(n,t),this.update()):"input"===i?(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered()):"keyup"!==i||-1===e.getBrowser().indexOf("ie")&&"edge"!==e.getBrowser()||(y.default.hasClass(this.e.target,"a-table-editable")&&this.e.target.parentNode.getAttribute("data-cell-id")===t+"-"+n&&(r.history.push((0,f.default)(r.row)),r.row[n].col[t].value=this.e.target.innerHTML.replace(/{(.*?)}/g,"{$1}")),this.afterEntered&&this.afterEntered());else{this.mousedown=!1;var u=this._getElementByQuery(".a-table-selected .a-table-editable");a.length>1&&this.putCaret(u)}else this.mousedown&&this.selectRange(n,t);else 2===this.e.button||this.e.ctrlKey||(this.mousedown=!0,this.data.beingInput||1===a.length&&this.data.row[n].col[t].selected||(this.select(n,t),this.update()));else this.e.shiftKey&&this.selectRange(n,t)}}},{key:"copyTable",value:function(t){if(!(this.getSelectedPoints().length<=1)){t.preventDefault();var e='';this.data.row.forEach(function(t,n){if(!t.col)return!1;e+="",t.col.forEach(function(t,n){t.selected&&(e+="<"+t.type+' colspan="'+t.colspan+'" rowspan="'+t.rowspan+'">'+t.value+"")}),e+=""}),e+="
    ",e=e.replace(/(<\/tr>)*/g,"
    "),e=e.replace(/(<\/tr>)*<\/table>/g,"
    "),t.clipboardData?t.clipboardData.setData("text/html",e):window.clipboardData&&window.clipboardData.setData("Text",e)}}},{key:"pasteTable",value:function(t){this.data;t.clipboardData?this.processPaste(t.clipboardData.getData("text/html")):window.clipboardData&&this.getClipBoardData()}},{key:"getClipBoardData",value:function(){for(var t=document.createDocumentFragment(),e=this.getSelectedPoint(),n=this.getCellIndexByPos(e.x,e.y),r=this.getCellByIndex(n.col,n.row),o=r.querySelector(".a-table-editable");o.childNodes.length>0;)t.appendChild(o.childNodes[0]);return this.waitForPastedData(o,t),!0}},{key:"waitForPastedData",value:function(t,e){var n=this;if(t.childNodes&&t.childNodes.length>0){var r=t.innerHTML;t.innerHTML="",t.appendChild(e),this.processPaste(r)}else setTimeout(function(){n.waitForPastedData(t,e)},20)}},{key:"processPaste",value:function(t){var e=this.e;e.preventDefault();var n=this.getSelectedPoint(),r=t.match(/(([\n\r\t]|.)*?)<\/table>/i),o=this.data;if(r&&r[0]){var i=this.parse(r[0],"text");if(i&&i.length)return this.insertTable(i,{x:n.x,y:n.y}),void o.history.push((0,f.default)(o.row))}var a=this.parseText(t);if(a&&a[0]&&a[0].col&&a[0].col.length>1){var l=this.getSelectedPoint();this.insertTable(a,{x:l.x,y:l.y}),this.update(),o.history.push((0,f.default)(o.row))}else if(e.clipboardData){var s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}else if(window.clipboardData){var c=window.clipboardData.getData("Text");y.default.replaceSelectionWithHtml(c)}}},{key:"insertTable",value:function(t,e){for(var n=this,r=this._getTableLength(this.data.row),o=this._getTableLength(t),i=e.x+o.x-r.x,a=e.y+o.y-r.y,l=r.x,s=(this.data.row,[]),c=[],u=this.data,h=(0,f.default)(u.row);a>0;){for(var p=[],d=0;d0&&this.data.row.forEach(function(t){for(var e=0;ee.col?1:-1});for(var C=m.y,T=C+m.height;C1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"insertColLeft",value:function(t){var e=this.data;t=parseInt(t),e.selectedRowNo=t+1,e.showMenu=!1;var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r),i={x:parseInt(t)-1,y:0,width:1,height:o.height},a=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===t){for(var l=o.height,s=0;s1?(r.colspan=parseInt(r.colspan)+1,r.colspan+=""):n.insertCellAt(e.row,e.col+1,o))}),e.history.push((0,f.default)(e.row)),this.update(),this.afterAction&&this.afterAction()}},{key:"beforeUpdated",value:function(){this.changeSelectOption(),this.markup()}},{key:"insertRowBelow",value:function(t){var e=this.data;e.showMenu=!1,e.selectedColNo=parseInt(t);var n=this,r=this.getAllPoints(),o=this.getLargePoint.apply(null,r);t=parseInt(t);var i={x:0,y:t+1,width:o.width,height:1},a=[],l=[];if(r.forEach(function(t){n.hitTest(i,t)&&a.push(t)}),0===a.length){for(var s=o.width,c=0;c1&&e.y<=t)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t+1)for(var a=parseInt(o.colspan),s=0;s1)o.rowspan=parseInt(o.rowspan)+1,o.rowspan+="";else if(r.row===t-1)for(var a=parseInt(o.colspan),s=0;s1)return void alert(this.data.message.splitError2);var r=this.getSelectedPoint(),o={x:0,y:r.y,width:r.x,height:r.height},i=this.getAllPoints(),a=this.getCellIndexByPos(r.x,r.y),l=this.getCellByPos(r.x,r.y),s=parseInt(l.colspan),c=parseInt(l.rowspan),u=l.value,h=this,p=[],d=[];if(1===s&&1===c)return void alert(this.data.message.splitError3);i.forEach(function(t){if(h.hitTest(o,t)){var e=h.getCellIndexByPos(t.x,t.y);h.getCellByPos(t.x,t.y);p.push(e)}}),p.forEach(function(t){var e=t.row;t.rowe.col?1:-1});for(var v=r.y,b=v+c;v0||t.indexOf("iPad")>0||t.indexOf("ipod")>0||t.indexOf("Android")>0}},{key:"getBrowser",value:function(){var t=window.navigator.userAgent.toLowerCase(),e=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!=t.indexOf("msie")?n=-1!=e.indexOf("msie 6.")?"ie6":-1!=e.indexOf("msie 7.")?"ie7":-1!=e.indexOf("msie 8.")?"ie8":-1!=e.indexOf("msie 9.")?"ie9":-1!=e.indexOf("msie 10.")?"ie10":"ie":-1!=t.indexOf("trident/7")?n="ie11":-1!=t.indexOf("edge")?n="edge":-1!=t.indexOf("chrome")?n="chrome":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("firefox")&&(n="firefox"),n}},{key:"getUniqId",value:function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}}]),e}(c.default);n.default=w,e.exports=n.default},{"./util.js":38,"a-template":1,clone:9,"deep-extend":11}],38:[function(t,e,n){"use strict";function r(t){t=t||{};for(var e=1;e