gridjs-spreadsheet 23.4.2 → 23.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -1
- package/readme.md +6 -1
- package/xspreadsheet.css +4 -3
- package/xspreadsheet.js +4 -4
package/xspreadsheet.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
!function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=
|
|
1
|
+
!function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=36)}([function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(t){return e.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,i(t)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(24);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(15).default,r=i(8);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(16),r=i(21),a=i(14),o=i(18);e.exports=function(e,t){return n(e)||r(e,t)||a(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(22),r=i(19),a=i(14),o=i(23);e.exports=function(e){return n(e)||r(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(26);function r(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=r=Reflect.get,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e,t,i){var r=n(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:i):a.value}},e.exports.default=e.exports,e.exports.__esModule=!0),r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){(function(e){
|
|
2
2
|
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
|
|
3
|
-
var n,r,a,o,s,l,c,h,u,f,d,m,g,v,p,y,b,w,x,k,C,S,_=_||{version:"4.6.0"};if(t.fabric=_,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?_.document=document:_.document=document.implementation.createHTMLDocument(""),_.window=window;else{var T=new(i(32).JSDOM)(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;_.document=T.document,_.jsdomImplForWrapper=i(33).implForWrapper,_.nodeCanvas=i(34).Canvas,_.window=T,DOMParser=_.window.DOMParser}function O(e,t){var i=e.canvas,n=t.targetCanvas,r=n.getContext("2d");r.translate(0,n.height),r.scale(1,-1);var a=i.height-n.height;r.drawImage(i,0,a,n.width,n.height,0,0,n.width,n.height)}function E(e,t){var i=t.targetCanvas.getContext("2d"),n=t.destinationWidth,r=t.destinationHeight,a=n*r*4,o=new Uint8Array(this.imageBuffer,0,a),s=new Uint8ClampedArray(this.imageBuffer,0,a);e.readPixels(0,0,n,r,e.RGBA,e.UNSIGNED_BYTE,o);var l=new ImageData(s,n,r);i.putImageData(l,0,0)}_.isTouchSupported="ontouchstart"in _.window||"ontouchstart"in _.document||_.window&&_.window.navigator&&_.window.navigator.maxTouchPoints>0,_.isLikelyNode=void 0!==e&&"undefined"==typeof window,_.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],_.DPI=96,_.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",_.commaWsp="(?:\\s+,?\\s*|,\\s*)",_.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,_.reNonWord=/[ \n\.,;!\?\-]/,_.fontPaths={},_.iMatrix=[1,0,0,1,0,0],_.svgNS="http://www.w3.org/2000/svg",_.perfLimitSizeTotal=2097152,_.maxCacheSideLimit=4096,_.minCacheSideLimit=256,_.charWidthsCache={},_.textureSize=2048,_.disableStyleCopyPaste=!1,_.enableGLFiltering=!0,_.devicePixelRatio=_.window.devicePixelRatio||_.window.webkitDevicePixelRatio||_.window.mozDevicePixelRatio||1,_.browserShadowBlurConstant=1,_.arcToSegmentsCache={},_.boundsOfCurveCache={},_.cachesBoundsOfCurve=!0,_.forceGLPutImageData=!1,_.initFilterBackend=function(){return _.enableGLFiltering&&_.isWebglSupported&&_.isWebglSupported(_.textureSize)?(console.log("max texture size: "+_.maxTextureSize),new _.WebglFilterBackend({tileSize:_.textureSize})):_.Canvas2dFilterBackend?new _.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=_),function(){function e(e,t){if(this.__eventListeners[e]){var i=this.__eventListeners[e];t?i[i.indexOf(t)]=!1:_.util.array.fill(i,!1)}}function t(e,t){var i=function(){t.apply(this,arguments),this.off(e,i)}.bind(this);this.on(e,i)}_.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var i=this.__eventListeners[e];if(!i)return this;for(var n=0,r=i.length;n<r;n++)i[n]&&i[n].call(this,t||{});return this.__eventListeners[e]=i.filter((function(e){return!1!==e})),this},on:function(e,t){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in e)this.on(i,e[i]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},once:function(e,i){if(1===arguments.length)for(var n in e)t.call(this,n,e[n]);else t.call(this,e,i);return this},off:function(t,i){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)e.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var n in t)e.call(this,n,t[n]);else e.call(this,t,i);return this}}}(),_.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,i){var n=this._objects;return i?n[t]=e:n.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,i=!1,n=0,r=arguments.length;n<r;n++)-1!==(e=t.indexOf(arguments[n]))&&(i=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[n]));return this.renderOnAddRemove&&i&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var i=this.getObjects(),n=0,r=i.length;n<r;n++)e.call(t,i[n],n,i);return this},getObjects:function(e){return void 0===e?this._objects.concat():this._objects.filter((function(t){return t.type===e}))},item:function(e){return this._objects[e]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e,t){return this._objects.indexOf(e)>-1||!!t&&this._objects.some((function(t){return"function"==typeof t.contains&&t.contains(e,!0)}))},complexity:function(){return this._objects.reduce((function(e,t){return e+=t.complexity?t.complexity():0}),0)}},_.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,t){!e||!e.colorStops||e instanceof _.Gradient||this.set(t,new _.Gradient(e))},_initPattern:function(e,t,i){!e||!e.source||e instanceof _.Pattern?i&&i():this.set(t,new _.Pattern(e,i))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return"object"==typeof e?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return"boolean"==typeof t&&this.set(e,!t),this},get:function(e){return this[e]}},n=t,r=Math.sqrt,a=Math.atan2,o=Math.pow,s=Math.PI/180,l=Math.PI/2,_.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/l){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(0===e)return 0;var t=1;switch(e<0&&(t=-1),e/l){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var i=e.indexOf(t);return-1!==i&&e.splice(i,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*s},radiansToDegrees:function(e){return e/s},rotatePoint:function(e,t,i){var n=new _.Point(e.x-t.x,e.y-t.y),r=_.util.rotateVector(n,i);return new _.Point(r.x,r.y).addEquals(t)},rotateVector:function(e,t){var i=_.util.sin(t),n=_.util.cos(t);return{x:e.x*n-e.y*i,y:e.x*i+e.y*n}},transformPoint:function(e,t,i){return i?new _.Point(t[0]*e.x+t[2]*e.y,t[1]*e.x+t[3]*e.y):new _.Point(t[0]*e.x+t[2]*e.y+t[4],t[1]*e.x+t[3]*e.y+t[5])},makeBoundingBoxFromPoints:function(e,t){if(t)for(var i=0;i<e.length;i++)e[i]=_.util.transformPoint(e[i],t);var n=[e[0].x,e[1].x,e[2].x,e[3].x],r=_.util.array.min(n),a=_.util.array.max(n)-r,o=[e[0].y,e[1].y,e[2].y,e[3].y],s=_.util.array.min(o);return{left:r,top:s,width:a,height:_.util.array.max(o)-s}},invertTransform:function(e){var t=1/(e[0]*e[3]-e[1]*e[2]),i=[t*e[3],-t*e[1],-t*e[2],t*e[0]],n=_.util.transformPoint({x:e[4],y:e[5]},i,!0);return i[4]=-n.x,i[5]=-n.y,i},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,t){var i=/\D{0,2}$/.exec(e),n=parseFloat(e);switch(t||(t=_.Text.DEFAULT_SVG_FONT_SIZE),i[0]){case"mm":return n*_.DPI/25.4;case"cm":return n*_.DPI/2.54;case"in":return n*_.DPI;case"pt":return n*_.DPI/72;case"pc":return n*_.DPI/72*12;case"em":return n*t;default:return n}},falseFunction:function(){return!1},getKlass:function(e,t){return e=_.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),_.util.resolveNamespace(t)[e]},getSvgAttributes:function(e){var t=["instantiated_by_use","style","id","class"];switch(e){case"linearGradient":t=t.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":t=t.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":t=t.concat(["offset","stop-color","stop-opacity"])}return t},resolveNamespace:function(e){if(!e)return _;var t,i=e.split("."),r=i.length,a=n||_.window;for(t=0;t<r;++t)a=a[i[t]];return a},loadImage:function(e,t,i,n){if(e){var r=_.util.createImage(),a=function(){t&&t.call(i,r,!1),r=r.onload=r.onerror=null};r.onload=a,r.onerror=function(){_.log("Error loading "+r.src),t&&t.call(i,null,!0),r=r.onload=r.onerror=null},0!==e.indexOf("data")&&null!=n&&(r.crossOrigin=n),"data:image/svg"===e.substring(0,14)&&(r.onload=null,_.util.loadImageInDom(r,a)),r.src=e}else t&&t.call(i,e)},loadImageInDom:function(e,t){var i=_.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(e),_.document.querySelector("body").appendChild(i),e.onload=function(){t(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(e,t,i,n){var r=[],a=0,o=(e=e||[]).length;function s(){++a===o&&t&&t(r.filter((function(e){return e})))}o?e.forEach((function(e,t){e&&e.type?_.util.getKlass(e.type,i).fromObject(e,(function(i,a){a||(r[t]=i),n&&n(e,i,a),s()})):s()})):t&&t(r)},enlivenPatterns:function(e,t){function i(){++r===a&&t&&t(n)}var n=[],r=0,a=(e=e||[]).length;a?e.forEach((function(e,t){e&&e.source?new _.Pattern(e,(function(e){n[t]=e,i()})):(n[t]=e,i())})):t&&t(n)},groupSVGElements:function(e,t,i){var n;return e&&1===e.length?e[0]:(t&&(t.width&&t.height?t.centerPoint={x:t.width/2,y:t.height/2}:(delete t.width,delete t.height)),n=new _.Group(e,t),void 0!==i&&(n.sourcePath=i),n)},populateWithProperties:function(e,t,i){if(i&&"[object Array]"===Object.prototype.toString.call(i))for(var n=0,r=i.length;n<r;n++)i[n]in e&&(t[i[n]]=e[i[n]])},drawDashedLine:function(e,t,i,n,o,s){var l=n-t,c=o-i,h=r(l*l+c*c),u=a(c,l),f=s.length,d=0,m=!0;for(e.save(),e.translate(t,i),e.moveTo(0,0),e.rotate(u),t=0;h>t;)(t+=s[d++%f])>h&&(t=h),e[m?"lineTo":"moveTo"](t,0),m=!m;e.restore()},createCanvasElement:function(){return _.document.createElement("canvas")},copyCanvasElement:function(e){var t=_.util.createCanvasElement();return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t},toDataURL:function(e,t,i){return e.toDataURL("image/"+t,i)},createImage:function(){return _.document.createElement("img")},multiplyTransformMatrices:function(e,t,i){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],i?0:e[0]*t[4]+e[2]*t[5]+e[4],i?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=a(e[1],e[0]),i=o(e[0],2)+o(e[1],2),n=r(i),l=(e[0]*e[3]-e[2]*e[1])/n,c=a(e[0]*e[2]+e[1]*e[3],i);return{angle:t/s,scaleX:n,scaleY:l,skewX:c/s,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return _.iMatrix.concat();var t=_.util.degreesToRadians(e.angle),i=_.util.cos(t),n=_.util.sin(t);return[i,n,-n,i,0,0]},calcDimensionsMatrix:function(e){var t=void 0===e.scaleX?1:e.scaleX,i=void 0===e.scaleY?1:e.scaleY,n=[e.flipX?-t:t,0,0,e.flipY?-i:i,0,0],r=_.util.multiplyTransformMatrices,a=_.util.degreesToRadians;return e.skewX&&(n=r(n,[1,0,Math.tan(a(e.skewX)),1],!0)),e.skewY&&(n=r(n,[1,Math.tan(a(e.skewY)),0,1],!0)),n},composeMatrix:function(e){var t=[1,0,0,1,e.translateX||0,e.translateY||0],i=_.util.multiplyTransformMatrices;return e.angle&&(t=i(t,_.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(t=i(t,_.util.calcDimensionsMatrix(e))),t},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,i,n){n>0&&(t>n?t-=n:t=0,i>n?i-=n:i=0);var r,a=!0,o=e.getImageData(t,i,2*n||1,2*n||1),s=o.data.length;for(r=3;r<s&&!1!=(a=o.data[r]<=0);r+=4);return o=null,a},parsePreserveAspectRatioAttribute:function(e){var t,i="meet",n=e.split(" ");return n&&n.length&&("meet"!==(i=n.pop())&&"slice"!==i?(t=i,i="meet"):n.length&&(t=n.pop())),{meetOrSlice:i,alignX:"none"!==t?t.slice(1,4):"none",alignY:"none"!==t?t.slice(5,8):"none"}},clearFabricFontCache:function(e){(e=(e||"").toLowerCase())?_.charWidthsCache[e]&&delete _.charWidthsCache[e]:_.charWidthsCache={}},limitDimsByArea:function(e,t){var i=Math.sqrt(t*e),n=Math.floor(t/i);return{x:Math.floor(i),y:n}},capValue:function(e,t,i){return Math.max(e,Math.min(t,i))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return"matrix("+e.map((function(e){return _.util.toFixed(e,_.Object.NUM_FRACTION_DIGITS)})).join(" ")+")"},removeTransformFromObject:function(e,t){var i=_.util.invertTransform(t),n=_.util.multiplyTransformMatrices(i,e.calcOwnMatrix());_.util.applyTransformToObject(e,n)},addTransformToObject:function(e,t){_.util.applyTransformToObject(e,_.util.multiplyTransformMatrices(t,e.calcOwnMatrix()))},applyTransformToObject:function(e,t){var i=_.util.qrDecompose(t),n=new _.Point(i.translateX,i.translateY);e.flipX=!1,e.flipY=!1,e.set("scaleX",i.scaleX),e.set("scaleY",i.scaleY),e.skewX=i.skewX,e.skewY=i.skewY,e.angle=i.angle,e.setPositionByOrigin(n,"center","center")},sizeAfterTransform:function(e,t,i){var n=e/2,r=t/2,a=[{x:-n,y:-r},{x:n,y:-r},{x:-n,y:r},{x:n,y:r}],o=_.util.calcDimensionsMatrix(i),s=_.util.makeBoundingBoxFromPoints(a,o);return{x:s.width,y:s.height}}},function(){var e=Array.prototype.join,t={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},i={m:"l",M:"L"};function n(e,t,i,n,r,a,o,s,l,c,h){var u=_.util.cos(e),f=_.util.sin(e),d=_.util.cos(t),m=_.util.sin(t),g=i*r*d-n*a*m+o,v=n*r*d+i*a*m+s;return["C",c+l*(-i*r*f-n*a*u),h+l*(-n*r*f+i*a*u),g+l*(i*r*m+n*a*d),v+l*(n*r*m-i*a*d),g,v]}function r(e,t,i,r,o,s,l){var c=Math.PI,h=l*c/180,u=_.util.sin(h),f=_.util.cos(h),d=0,m=0,g=-f*e*.5-u*t*.5,v=-f*t*.5+u*e*.5,p=(i=Math.abs(i))*i,y=(r=Math.abs(r))*r,b=v*v,w=g*g,x=p*y-p*b-y*w,k=0;if(x<0){var C=Math.sqrt(1-x/(p*y));i*=C,r*=C}else k=(o===s?-1:1)*Math.sqrt(x/(p*b+y*w));var S=k*i*v/r,T=-k*r*g/i,O=f*S-u*T+.5*e,E=u*S+f*T+.5*t,R=a(1,0,(g-S)/i,(v-T)/r),I=a((g-S)/i,(v-T)/r,(-g-S)/i,(-v-T)/r);0===s&&I>0?I-=2*c:1===s&&I<0&&(I+=2*c);for(var A=Math.ceil(Math.abs(I/c*2)),D=[],P=I/A,F=8/3*Math.sin(P/4)*Math.sin(P/4)/Math.sin(P/2),M=R+P,L=0;L<A;L++)D[L]=n(R,M,f,u,i,r,O,E,F,d,m),d=D[L][5],m=D[L][6],R=M,M+=P;return D}function a(e,t,i,n){var r=Math.atan2(t,e),a=Math.atan2(n,i);return a>=r?a-r:2*Math.PI-(r-a)}function o(t,i,n,r,a,o,s,l){var c;if(_.cachesBoundsOfCurve&&(c=e.call(arguments),_.boundsOfCurveCache[c]))return _.boundsOfCurveCache[c];var h,u,f,d,m,g,v,p,y=Math.sqrt,b=Math.min,w=Math.max,x=Math.abs,k=[],C=[[],[]];u=6*t-12*n+6*a,h=-3*t+9*n-9*a+3*s,f=3*n-3*t;for(var S=0;S<2;++S)if(S>0&&(u=6*i-12*r+6*o,h=-3*i+9*r-9*o+3*l,f=3*r-3*i),x(h)<1e-12){if(x(u)<1e-12)continue;0<(d=-f/u)&&d<1&&k.push(d)}else(v=u*u-4*f*h)<0||(0<(m=(-u+(p=y(v)))/(2*h))&&m<1&&k.push(m),0<(g=(-u-p)/(2*h))&&g<1&&k.push(g));for(var T,O,E,R=k.length,I=R;R--;)T=(E=1-(d=k[R]))*E*E*t+3*E*E*d*n+3*E*d*d*a+d*d*d*s,C[0][R]=T,O=E*E*E*i+3*E*E*d*r+3*E*d*d*o+d*d*d*l,C[1][R]=O;C[0][I]=t,C[1][I]=i,C[0][I+1]=s,C[1][I+1]=l;var A=[{x:b.apply(null,C[0]),y:b.apply(null,C[1])},{x:w.apply(null,C[0]),y:w.apply(null,C[1])}];return _.cachesBoundsOfCurve&&(_.boundsOfCurveCache[c]=A),A}function s(e,t,i){for(var n=i[1],a=i[2],o=i[3],s=i[4],l=i[5],c=r(i[6]-e,i[7]-t,n,a,s,l,o),h=0,u=c.length;h<u;h++)c[h][1]+=e,c[h][2]+=t,c[h][3]+=e,c[h][4]+=t,c[h][5]+=e,c[h][6]+=t;return c}function l(e,t,i,n){return Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))}function c(e,t,i,n,r,a,o,s){return function(l){var c,h=(c=l)*c*c,u=function(e){return 3*e*e*(1-e)}(l),f=function(e){return 3*e*(1-e)*(1-e)}(l),d=function(e){return(1-e)*(1-e)*(1-e)}(l);return{x:o*h+r*u+i*f+e*d,y:s*h+a*u+n*f+t*d}}}function h(e,t,i,n,r,a,o,s){return function(l){var c=1-l,h=3*c*c*(i-e)+6*c*l*(r-i)+3*l*l*(o-r),u=3*c*c*(n-t)+6*c*l*(a-n)+3*l*l*(s-a);return Math.atan2(u,h)}}function u(e,t,i,n,r,a){return function(o){var s,l=(s=o)*s,c=function(e){return 2*e*(1-e)}(o),h=function(e){return(1-e)*(1-e)}(o);return{x:r*l+i*c+e*h,y:a*l+n*c+t*h}}}function f(e,t,i,n,r,a){return function(o){var s=1-o,l=2*s*(i-e)+2*o*(r-i),c=2*s*(n-t)+2*o*(a-n);return Math.atan2(c,l)}}function d(e,t,i){var n,r,a={x:t,y:i},o=0;for(r=1;r<=100;r+=1)n=e(r/100),o+=l(a.x,a.y,n.x,n.y),a=n;return o}function m(e,t){for(var i,n,r,a=0,o=0,s=e.iterator,c={x:e.x,y:e.y},h=.01,u=e.angleFinder;o<t&&a<=1&&h>1e-4;)i=s(a),r=a,(n=l(c.x,c.y,i.x,i.y))+o>t?a-=h/=2:(c=i,a+=h,o+=n);return i.angle=u(r),i}function g(e){for(var t,i,n,r,a=0,o=e.length,s=0,m=0,g=0,v=0,p=[],y=0;y<o;y++){switch(n={x:s,y:m,command:(t=e[y])[0]},t[0]){case"M":n.length=0,g=s=t[1],v=m=t[2];break;case"L":n.length=l(s,m,t[1],t[2]),s=t[1],m=t[2];break;case"C":i=c(s,m,t[1],t[2],t[3],t[4],t[5],t[6]),r=h(s,m,t[1],t[2],t[3],t[4],t[5],t[6]),n.iterator=i,n.angleFinder=r,n.length=d(i,s,m),s=t[5],m=t[6];break;case"Q":i=u(s,m,t[1],t[2],t[3],t[4]),r=f(s,m,t[1],t[2],t[3],t[4]),n.iterator=i,n.angleFinder=r,n.length=d(i,s,m),s=t[3],m=t[4];break;case"Z":case"z":n.destX=g,n.destY=v,n.length=l(s,m,g,v),s=g,m=v}a+=n.length,p.push(n)}return p.push({length:a,x:s,y:m}),p}_.util.joinPath=function(e){return e.map((function(e){return e.join(" ")})).join(" ")},_.util.parsePath=function(e){var n,r,a,o,s,l=[],c=[],h=_.rePathCommand,u="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+u+")"+_.commaWsp,d="([01])"+_.commaWsp+"?",m=new RegExp(f+"?"+f+"?"+f+d+d+f+"?("+u+")","g");if(!e||!e.match)return l;for(var g,v=0,p=(s=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;v<p;v++){o=(n=s[v]).slice(1).trim(),c.length=0;var y=n.charAt(0);if(g=[y],"a"===y.toLowerCase())for(var b;b=m.exec(o);)for(var w=1;w<b.length;w++)c.push(b[w]);else for(;a=h.exec(o);)c.push(a[0]);w=0;for(var x=c.length;w<x;w++)r=parseFloat(c[w]),isNaN(r)||g.push(r);var k=t[y.toLowerCase()],C=i[y]||y;if(g.length-1>k)for(var S=1,T=g.length;S<T;S+=k)l.push([y].concat(g.slice(S,S+k))),y=C;else l.push(g)}return l},_.util.makePathSimpler=function(e){var t,i,n,r,a,o,l=0,c=0,h=e.length,u=0,f=0,d=[];for(i=0;i<h;++i){switch(n=!1,(t=e[i].slice(0))[0]){case"l":t[0]="L",t[1]+=l,t[2]+=c;case"L":l=t[1],c=t[2];break;case"h":t[1]+=l;case"H":t[0]="L",t[2]=c,l=t[1];break;case"v":t[1]+=c;case"V":t[0]="L",c=t[1],t[1]=l,t[2]=c;break;case"m":t[0]="M",t[1]+=l,t[2]+=c;case"M":l=t[1],c=t[2],u=t[1],f=t[2];break;case"c":t[0]="C",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c,t[5]+=l,t[6]+=c;case"C":a=t[3],o=t[4],l=t[5],c=t[6];break;case"s":t[0]="S",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"S":"C"===r?(a=2*l-a,o=2*c-o):(a=l,o=c),l=t[3],c=t[4],t[0]="C",t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=a,t[2]=o,a=t[3],o=t[4];break;case"q":t[0]="Q",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"Q":a=t[1],o=t[2],l=t[3],c=t[4];break;case"t":t[0]="T",t[1]+=l,t[2]+=c;case"T":"Q"===r?(a=2*l-a,o=2*c-o):(a=l,o=c),t[0]="Q",l=t[1],c=t[2],t[1]=a,t[2]=o,t[3]=l,t[4]=c;break;case"a":t[0]="A",t[6]+=l,t[7]+=c;case"A":n=!0,d=d.concat(s(l,c,t)),l=t[6],c=t[7];break;case"z":case"Z":l=u,c=f}n||d.push(t),r=t[0]}return d},_.util.getSmoothPathFromPoints=function(e,t){var i,n=[],r=new _.Point(e[0].x,e[0].y),a=new _.Point(e[1].x,e[1].y),o=e.length,s=1,l=0,c=o>2;for(t=t||0,c&&(s=e[2].x<a.x?-1:e[2].x===a.x?0:1,l=e[2].y<a.y?-1:e[2].y===a.y?0:1),n.push(["M",r.x-s*t,r.y-l*t]),i=1;i<o;i++){if(!r.eq(a)){var h=r.midPointFrom(a);n.push(["Q",r.x,r.y,h.x,h.y])}r=e[i],i+1<e.length&&(a=e[i+1])}return c&&(s=r.x>e[i-2].x?1:r.x===e[i-2].x?0:-1,l=r.y>e[i-2].y?1:r.y===e[i-2].y?0:-1),n.push(["L",r.x+s*t,r.y+l*t]),n},_.util.getPathSegmentsInfo=g,_.util.getBoundsOfCurve=o,_.util.getPointOnPath=function(e,t,i){i||(i=g(e));for(var n=0;t-i[n].length>0&&n<i.length-2;)t-=i[n].length,n++;var r,a=i[n],o=t/a.length,s=a.command,l=e[n];switch(s){case"M":return{x:a.x,y:a.y,angle:0};case"Z":case"z":return(r=new _.Point(a.x,a.y).lerp(new _.Point(a.destX,a.destY),o)).angle=Math.atan2(a.destY-a.y,a.destX-a.x),r;case"L":return(r=new _.Point(a.x,a.y).lerp(new _.Point(l[1],l[2]),o)).angle=Math.atan2(l[2]-a.y,l[1]-a.x),r;case"C":case"Q":return m(a,t)}},_.util.transformPath=function(e,t,i){return i&&(t=_.util.multiplyTransformMatrices(t,[1,0,0,1,-i.x,-i.y])),e.map((function(e){for(var i=e.slice(0),n={},r=1;r<e.length-1;r+=2)n.x=e[r],n.y=e[r+1],n=_.util.transformPoint(n,t),i[r]=n.x,i[r+1]=n.y;return i}))},_.util.fromArcToBeizers=s,_.util.getBoundsOfArc=function(e,t,i,n,a,s,l,c,h){for(var u,f=0,d=0,m=[],g=r(c-e,h-t,i,n,s,l,a),v=0,p=g.length;v<p;v++)u=o(f,d,g[v][1],g[v][2],g[v][3],g[v][4],g[v][5],g[v][6]),m.push({x:u[0].x+e,y:u[0].y+t}),m.push({x:u[1].x+e,y:u[1].y+t}),f=g[v][5],d=g[v][6];return m},_.util.drawArc=function(e,t,i,n){s(t,i,n=n.slice(0).unshift("X")).forEach((function(t){e.bezierCurveTo.apply(e,t.slice(1))}))}}(),function(){var e=Array.prototype.slice;function t(e,t,i){if(e&&0!==e.length){var n=e.length-1,r=t?e[n][t]:e[n];if(t)for(;n--;)i(e[n][t],r)&&(r=e[n][t]);else for(;n--;)i(e[n],r)&&(r=e[n]);return r}}_.util.array={fill:function(e,t){for(var i=e.length;i--;)e[i]=t;return e},invoke:function(t,i){for(var n=e.call(arguments,2),r=[],a=0,o=t.length;a<o;a++)r[a]=n.length?t[a][i].apply(t[a],n):t[a][i].call(t[a]);return r},min:function(e,i){return t(e,i,(function(e,t){return e<t}))},max:function(e,i){return t(e,i,(function(e,t){return e>=t}))}}}(),function(){function e(t,i,n){if(n)if(!_.isLikelyNode&&i instanceof Element)t=i;else if(i instanceof Array){t=[];for(var r=0,a=i.length;r<a;r++)t[r]=e({},i[r],n)}else if(i&&"object"==typeof i)for(var o in i)"canvas"===o||"group"===o?t[o]=null:i.hasOwnProperty(o)&&(t[o]=e({},i[o],n));else t=i;else for(var o in i)t[o]=i[o];return t}_.util.object={extend:e,clone:function(t,i){return e({},t,i)}},_.util.object.extend(_.util,_.Observable)}(),function(){function e(e,t){var i=e.charCodeAt(t);if(isNaN(i))return"";if(i<55296||i>57343)return e.charAt(t);if(55296<=i&&i<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var n=e.charCodeAt(t+1);if(56320>n||n>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(0===t)throw"Low surrogate without preceding high surrogate";var r=e.charCodeAt(t-1);if(55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}_.util.string={camelize:function(e){return e.replace(/-+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},graphemeSplit:function(t){var i,n=0,r=[];for(n=0;n<t.length;n++)!1!==(i=e(t,n))&&r.push(i);return r}}}(),function(){var e=Array.prototype.slice,t=function(){},i=function(){for(var e in{toString:1})if("toString"===e)return!1;return!0}(),n=function(e,t,n){for(var r in t)r in e.prototype&&"function"==typeof e.prototype[r]&&(t[r]+"").indexOf("callSuper")>-1?e.prototype[r]=function(e){return function(){var i=this.constructor.superclass;this.constructor.superclass=n;var r=t[e].apply(this,arguments);if(this.constructor.superclass=i,"initialize"!==e)return r}}(r):e.prototype[r]=t[r],i&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function r(){}function a(t){for(var i=null,n=this;n.constructor.superclass;){var r=n.constructor.superclass.prototype[t];if(n[t]!==r){i=r;break}n=n.constructor.superclass.prototype}return i?arguments.length>1?i.apply(this,e.call(arguments,1)):i.call(this):console.log("tried to callSuper "+t+", method not found in prototype chain",this)}_.util.createClass=function(){var i=null,o=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof o[0]&&(i=o.shift()),s.superclass=i,s.subclasses=[],i&&(r.prototype=i.prototype,s.prototype=new r,i.subclasses.push(s));for(var l=0,c=o.length;l<c;l++)n(s,o[l],i);return s.prototype.initialize||(s.prototype.initialize=t),s.prototype.constructor=s,s.prototype.callSuper=a,s}}(),c=!!_.document.createElement("div").attachEvent,h=["touchstart","touchmove","touchend"],_.util.addListener=function(e,t,i,n){e&&e.addEventListener(t,i,!c&&n)},_.util.removeListener=function(e,t,i,n){e&&e.removeEventListener(t,i,!c&&n)},_.util.getPointer=function(e){var t=e.target,i=_.util.getScrollLeftTop(t),n=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:n.clientX+i.left,y:n.clientY+i.top}},_.util.isTouchEvent=function(e){return h.indexOf(e.type)>-1||"touch"===e.pointerType},u=_.document.createElement("div"),f="string"==typeof u.style.opacity,d="string"==typeof u.style.filter,m=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,g=function(e){return e},f?g=function(e,t){return e.style.opacity=t,e}:d&&(g=function(e,t){var i=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(i.zoom=1),m.test(i.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",i.filter=i.filter.replace(m,t)):i.filter+=" alpha(opacity="+100*t+")",e}),_.util.setStyle=function(e,t){var i=e.style;if(!i)return e;if("string"==typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?g(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var n in t)"opacity"===n?g(e,t[n]):i["float"===n||"cssFloat"===n?void 0===i.styleFloat?"cssFloat":"styleFloat":n]=t[n];return e},function(){var e=Array.prototype.slice;var t,i,n,r,a=function(t){return e.call(t,0)};try{t=a(_.document.childNodes)instanceof Array}catch(e){}function o(e,t){var i=_.document.createElement(e);for(var n in t)"class"===n?i.className=t[n]:"for"===n?i.htmlFor=t[n]:i.setAttribute(n,t[n]);return i}function s(e){for(var t=0,i=0,n=_.document.documentElement,r=_.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===_.document?(t=r.scrollLeft||n.scrollLeft||0,i=r.scrollTop||n.scrollTop||0):(t+=e.scrollLeft||0,i+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:t,top:i}}t||(a=function(e){for(var t=new Array(e.length),i=e.length;i--;)t[i]=e[i];return t}),i=_.document.defaultView&&_.document.defaultView.getComputedStyle?function(e,t){var i=_.document.defaultView.getComputedStyle(e,null);return i?i[t]:void 0}:function(e,t){var i=e.style[t];return!i&&e.currentStyle&&(i=e.currentStyle[t]),i},n=_.document.documentElement.style,r="userSelect"in n?"userSelect":"MozUserSelect"in n?"MozUserSelect":"WebkitUserSelect"in n?"WebkitUserSelect":"KhtmlUserSelect"in n?"KhtmlUserSelect":"",_.util.makeElementUnselectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=_.util.falseFunction),r?e.style[r]="none":"string"==typeof e.unselectable&&(e.unselectable="on"),e},_.util.makeElementSelectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=null),r?e.style[r]="":"string"==typeof e.unselectable&&(e.unselectable=""),e},_.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},_.util.getById=function(e){return"string"==typeof e?_.document.getElementById(e):e},_.util.toArray=a,_.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},_.util.makeElement=o,_.util.wrapElement=function(e,t,i){return"string"==typeof t&&(t=o(t,i)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},_.util.getScrollLeftTop=s,_.util.getElementOffset=function(e){var t,n,r=e&&e.ownerDocument,a={left:0,top:0},o={left:0,top:0},l={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return o;for(var c in l)o[l[c]]+=parseInt(i(e,c),10)||0;return t=r.documentElement,void 0!==e.getBoundingClientRect&&(a=e.getBoundingClientRect()),n=s(e),{left:a.left+n.left-(t.clientLeft||0)+o.left,top:a.top+n.top-(t.clientTop||0)+o.top}},_.util.getNodeCanvas=function(e){var t=_.jsdomImplForWrapper(e);return t._canvas||t._image},_.util.cleanUpJsdomNode=function(e){if(_.isLikelyNode){var t=_.jsdomImplForWrapper(e);t&&(t._image=null,t._canvas=null,t._currentSrc=null,t._attributes=null,t._classList=null)}}}(),function(){function e(){}_.util.request=function(t,i){i||(i={});var n=i.method?i.method.toUpperCase():"GET",r=i.onComplete||function(){},a=new _.window.XMLHttpRequest,o=i.body||i.parameters;return a.onreadystatechange=function(){4===a.readyState&&(r(a),a.onreadystatechange=e)},"GET"===n&&(o=null,"string"==typeof i.parameters&&(t=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(t,i.parameters))),a.open(n,t,!0),"POST"!==n&&"PUT"!==n||a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(o),a}}(),_.log=console.log,_.warn=console.warn,function(){function e(){return!1}function t(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t}var i=_.window.requestAnimationFrame||_.window.webkitRequestAnimationFrame||_.window.mozRequestAnimationFrame||_.window.oRequestAnimationFrame||_.window.msRequestAnimationFrame||function(e){return _.window.setTimeout(e,1e3/60)},n=_.window.cancelAnimationFrame||_.window.clearTimeout;function r(){return i.apply(_.window,arguments)}_.util.animate=function(i){var n=!1;return r((function(a){i||(i={});var o,s=a||+new Date,l=i.duration||500,c=s+l,h=i.onChange||e,u=i.abort||e,f=i.onComplete||e,d=i.easing||t,m="startValue"in i?i.startValue:0,g="endValue"in i?i.endValue:100,v=i.byValue||g-m;i.onStart&&i.onStart(),function e(t){var i=(o=t||+new Date)>c?l:o-s,a=i/l,p=d(i,m,v,l),y=Math.abs((p-m)/v);if(!n){if(!u(p,y,a))return o>c?(h(g,1,1),void f(g,1,1)):(h(p,y,a),void r(e));f(g,1,1)}}(s)})),function(){n=!0}},_.util.requestAnimFrame=r,_.util.cancelAnimFrame=function(){return n.apply(_.window,arguments)}}(),function(){function e(e,t,i){var n="rgba("+parseInt(e[0]+i*(t[0]-e[0]),10)+","+parseInt(e[1]+i*(t[1]-e[1]),10)+","+parseInt(e[2]+i*(t[2]-e[2]),10);return n+=","+(e&&t?parseFloat(e[3]+i*(t[3]-e[3])):1),n+=")"}_.util.animateColor=function(t,i,n,r){var a=new _.Color(t).getSource(),o=new _.Color(i).getSource(),s=r.onComplete,l=r.onChange;return r=r||{},_.util.animate(_.util.object.extend(r,{duration:n||500,startValue:a,endValue:o,byValue:o,easing:function(t,i,n,a){return e(i,n,r.colorEasing?r.colorEasing(t,a):1-Math.cos(t/a*(Math.PI/2)))},onComplete:function(t,i,n){if(s)return s(e(o,o,0),i,n)},onChange:function(t,i,n){if(l){if(Array.isArray(t))return l(e(t,t,0),i,n);l(t,i,n)}}}))}}(),function(){function e(e,t,i,n){return e<Math.abs(t)?(e=t,n=i/4):n=0===t&&0===e?i/(2*Math.PI)*Math.asin(1):i/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:i,s:n}}function t(e,t,i){return e.a*Math.pow(2,10*(t-=1))*Math.sin((t*i-e.s)*(2*Math.PI)/e.p)}function i(e,t,i,r){return i-n(r-e,0,i,r)+t}function n(e,t,i,n){return(e/=n)<1/2.75?i*(7.5625*e*e)+t:e<2/2.75?i*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?i*(7.5625*(e-=2.25/2.75)*e+.9375)+t:i*(7.5625*(e-=2.625/2.75)*e+.984375)+t}_.util.ease={easeInQuad:function(e,t,i,n){return i*(e/=n)*e+t},easeOutQuad:function(e,t,i,n){return-i*(e/=n)*(e-2)+t},easeInOutQuad:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,i,n){return i*(e/=n)*e*e+t},easeOutCubic:function(e,t,i,n){return i*((e=e/n-1)*e*e+1)+t},easeInOutCubic:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,i,n){return i*(e/=n)*e*e*e+t},easeOutQuart:function(e,t,i,n){return-i*((e=e/n-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e+t:-i/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,i,n){return i*(e/=n)*e*e*e*e+t},easeOutQuint:function(e,t,i,n){return i*((e=e/n-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t},easeOutSine:function(e,t,i,n){return i*Math.sin(e/n*(Math.PI/2))+t},easeInOutSine:function(e,t,i,n){return-i/2*(Math.cos(Math.PI*e/n)-1)+t},easeInExpo:function(e,t,i,n){return 0===e?t:i*Math.pow(2,10*(e/n-1))+t},easeOutExpo:function(e,t,i,n){return e===n?t+i:i*(1-Math.pow(2,-10*e/n))+t},easeInOutExpo:function(e,t,i,n){return 0===e?t:e===n?t+i:(e/=n/2)<1?i/2*Math.pow(2,10*(e-1))+t:i/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,i,n){return-i*(Math.sqrt(1-(e/=n)*e)-1)+t},easeOutCirc:function(e,t,i,n){return i*Math.sqrt(1-(e=e/n-1)*e)+t},easeInOutCirc:function(e,t,i,n){return(e/=n/2)<1?-i/2*(Math.sqrt(1-e*e)-1)+t:i/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(i,n,r,a){var o=0;return 0===i?n:1===(i/=a)?n+r:(o||(o=.3*a),-t(e(r,r,o,1.70158),i,a)+n)},easeOutElastic:function(t,i,n,r){var a=0;if(0===t)return i;if(1===(t/=r))return i+n;a||(a=.3*r);var o=e(n,n,a,1.70158);return o.a*Math.pow(2,-10*t)*Math.sin((t*r-o.s)*(2*Math.PI)/o.p)+o.c+i},easeInOutElastic:function(i,n,r,a){var o=0;if(0===i)return n;if(2===(i/=a/2))return n+r;o||(o=a*(.3*1.5));var s=e(r,r,o,1.70158);return i<1?-.5*t(s,i,a)+n:s.a*Math.pow(2,-10*(i-=1))*Math.sin((i*a-s.s)*(2*Math.PI)/s.p)*.5+s.c+n},easeInBack:function(e,t,i,n,r){return void 0===r&&(r=1.70158),i*(e/=n)*e*((r+1)*e-r)+t},easeOutBack:function(e,t,i,n,r){return void 0===r&&(r=1.70158),i*((e=e/n-1)*e*((r+1)*e+r)+1)+t},easeInOutBack:function(e,t,i,n,r){return void 0===r&&(r=1.70158),(e/=n/2)<1?i/2*(e*e*((1+(r*=1.525))*e-r))+t:i/2*((e-=2)*e*((1+(r*=1.525))*e+r)+2)+t},easeInBounce:i,easeOutBounce:n,easeInOutBounce:function(e,t,r,a){return e<a/2?.5*i(2*e,0,r,a)+t:.5*n(2*e-a,0,r,a)+.5*r+t}}}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.object.clone,r=t.util.toFixed,a=t.util.parseUnit,o=t.util.multiplyTransformMatrices,s={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},l={stroke:"strokeOpacity",fill:"fillOpacity"};function c(e){return e in s?s[e]:e}function h(e,i,n,r){var s,l="[object Array]"===Object.prototype.toString.call(i);if("fill"!==e&&"stroke"!==e||"none"!==i){if("strokeUniform"===e)return"non-scaling-stroke"===i;if("strokeDashArray"===e)i="none"===i?null:i.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===e)i=n&&n.transformMatrix?o(n.transformMatrix,t.parseTransformAttribute(i)):t.parseTransformAttribute(i);else if("visible"===e)i="none"!==i&&"hidden"!==i,n&&!1===n.visible&&(i=!1);else if("opacity"===e)i=parseFloat(i),n&&void 0!==n.opacity&&(i*=n.opacity);else if("textAnchor"===e)i="start"===i?"left":"end"===i?"right":"center";else if("charSpacing"===e)s=a(i,r)/r*1e3;else if("paintFirst"===e){var c=i.indexOf("fill"),h=i.indexOf("stroke");i="fill";(c>-1&&h>-1&&h<c||-1===c&&h>-1)&&(i="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return i;if("imageSmoothing"===e)return"optimizeQuality"===i;s=l?i.map(a):a(i,r)}}else i="";return!l&&isNaN(s)?i:s}function u(e){return new RegExp("^("+e.join("|")+")\\b","i")}function f(e,t){var i,n,r,a,o=[];for(r=0,a=t.length;r<a;r++)i=t[r],n=e.getElementsByTagName(i),o=o.concat(Array.prototype.slice.call(n));return o}function d(e,t){var i,n=!0;return(i=m(e,t.pop()))&&t.length&&(n=function(e,t){var i,n=!0;for(;e.parentNode&&1===e.parentNode.nodeType&&t.length;)n&&(i=t.pop()),e=e.parentNode,n=m(e,i);return 0===t.length}(e,t)),i&&n&&0===t.length}function m(e,t){var i,n,r=e.nodeName,a=e.getAttribute("class"),o=e.getAttribute("id");if(i=new RegExp("^"+r,"i"),t=t.replace(i,""),o&&t.length&&(i=new RegExp("#"+o+"(?![a-zA-Z\\-]+)","i"),t=t.replace(i,"")),a&&t.length)for(n=(a=a.split(" ")).length;n--;)i=new RegExp("\\."+a[n]+"(?![a-zA-Z\\-]+)","i"),t=t.replace(i,"");return 0===t.length}function g(e,t){var i;if(e.getElementById&&(i=e.getElementById(t)),i)return i;var n,r,a,o=e.getElementsByTagName("*");for(r=0,a=o.length;r<a;r++)if(t===(n=o[r]).getAttribute("id"))return n}t.svgValidTagNamesRegEx=u(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),t.svgViewBoxElementsRegEx=u(["symbol","image","marker","pattern","view","svg"]),t.svgInvalidAncestorsRegEx=u(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),t.svgValidParentsRegEx=u(["symbol","g","a","svg","clipPath","defs"]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,i,n){e[n]=Math.tan(t.util.degreesToRadians(i[0]))}var i=t.iMatrix,n=t.reNum,r=t.commaWsp,a="(?:"+("(?:(matrix)\\s*\\(\\s*("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")\\s*\\))")+"|"+("(?:(translate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(scale)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(rotate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+")"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(skewX)\\s*\\(\\s*("+n+")\\s*\\))")+"|"+("(?:(skewY)\\s*\\(\\s*("+n+")\\s*\\))")+")",o=new RegExp("^\\s*(?:"+("(?:"+a+"(?:"+r+"*"+a+")*)")+"?)\\s*$"),s=new RegExp(a,"g");return function(n){var r=i.concat(),l=[];if(!n||n&&!o.test(n))return r;n.replace(s,(function(n){var o=new RegExp(a).exec(n).filter((function(e){return!!e})),s=o[1],c=o.slice(2).map(parseFloat);switch(s){case"translate":!function(e,t){e[4]=t[0],2===t.length&&(e[5]=t[1])}(r,c);break;case"rotate":c[0]=t.util.degreesToRadians(c[0]),function(e,i){var n=t.util.cos(i[0]),r=t.util.sin(i[0]),a=0,o=0;3===i.length&&(a=i[1],o=i[2]),e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e[4]=a-(n*a-r*o),e[5]=o-(r*a+n*o)}(r,c);break;case"scale":!function(e,t){var i=t[0],n=2===t.length?t[1]:t[0];e[0]=i,e[3]=n}(r,c);break;case"skewX":e(r,c,2);break;case"skewY":e(r,c,1);break;case"matrix":r=c}l.push(r.concat()),r=i.concat()}));for(var c=l[0];l.length>1;)l.shift(),c=t.util.multiplyTransformMatrices(c,l[0]);return c}}();var v=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function p(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var i,n,r,o,s,l,c=e.getAttribute("viewBox"),h=1,u=1,f=e.getAttribute("width"),d=e.getAttribute("height"),m=e.getAttribute("x")||0,g=e.getAttribute("y")||0,p=e.getAttribute("preserveAspectRatio")||"",y=!c||!(c=c.match(v)),b=!f||!d||"100%"===f||"100%"===d,w=y&&b,x={},k="",C=0,S=0;if(x.width=0,x.height=0,x.toBeParsed=w,y&&(m||g)&&e.parentNode&&"#document"!==e.parentNode.nodeName&&(k=" translate("+a(m)+" "+a(g)+") ",s=(e.getAttribute("transform")||"")+k,e.setAttribute("transform",s),e.removeAttribute("x"),e.removeAttribute("y")),w)return x;if(y)return x.width=a(f),x.height=a(d),x;if(i=-parseFloat(c[1]),n=-parseFloat(c[2]),r=parseFloat(c[3]),o=parseFloat(c[4]),x.minX=i,x.minY=n,x.viewBoxWidth=r,x.viewBoxHeight=o,b?(x.width=r,x.height=o):(x.width=a(f),x.height=a(d),h=x.width/r,u=x.height/o),"none"!==(p=t.util.parsePreserveAspectRatioAttribute(p)).alignX&&("meet"===p.meetOrSlice&&(u=h=h>u?u:h),"slice"===p.meetOrSlice&&(u=h=h>u?h:u),C=x.width-r*h,S=x.height-o*h,"Mid"===p.alignX&&(C/=2),"Mid"===p.alignY&&(S/=2),"Min"===p.alignX&&(C=0),"Min"===p.alignY&&(S=0)),1===h&&1===u&&0===i&&0===n&&0===m&&0===g)return x;if((m||g)&&"#document"!==e.parentNode.nodeName&&(k=" translate("+a(m)+" "+a(g)+") "),s=k+" matrix("+h+" 0 0 "+u+" "+(i*h+C)+" "+(n*u+S)+") ","svg"===e.nodeName){for(l=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}else(l=e).removeAttribute("x"),l.removeAttribute("y"),s=l.getAttribute("transform")+s;return l.setAttribute("transform",s),x}function y(e,t){var i=g(e,t.getAttribute("xlink:href").substr(1));if(i&&i.getAttribute("xlink:href")&&y(e,i),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach((function(e){i&&!t.hasAttribute(e)&&i.hasAttribute(e)&&t.setAttribute(e,i.getAttribute(e))})),!t.children.length)for(var n=i.cloneNode(!0);n.firstChild;)t.appendChild(n.firstChild);t.removeAttribute("xlink:href")}t.parseSVGDocument=function(e,i,r,a){if(e){!function(e){for(var i=f(e,["use","svg:use"]),n=0;i.length&&n<i.length;){var r=i[n],a=r.getAttribute("xlink:href")||r.getAttribute("href");if(null===a)return;var o,s,l,c,h=a.substr(1),u=r.getAttribute("x")||0,d=r.getAttribute("y")||0,m=g(e,h).cloneNode(!0),v=(m.getAttribute("transform")||"")+" translate("+u+", "+d+")",y=i.length,b=t.svgNS;if(p(m),/^svg$/i.test(m.nodeName)){var w=m.ownerDocument.createElementNS(b,"g");for(s=0,c=(l=m.attributes).length;s<c;s++)o=l.item(s),w.setAttributeNS(b,o.nodeName,o.nodeValue);for(;m.firstChild;)w.appendChild(m.firstChild);m=w}for(s=0,c=(l=r.attributes).length;s<c;s++)"x"!==(o=l.item(s)).nodeName&&"y"!==o.nodeName&&"xlink:href"!==o.nodeName&&"href"!==o.nodeName&&("transform"===o.nodeName?v=o.nodeValue+" "+v:m.setAttribute(o.nodeName,o.nodeValue));m.setAttribute("transform",v),m.setAttribute("instantiated_by_use","1"),m.removeAttribute("id"),r.parentNode.replaceChild(m,r),i.length===y&&n++}}(e);var o,s,l=t.Object.__uid++,c=p(e),h=t.util.toArray(e.getElementsByTagName("*"));if(c.crossOrigin=a&&a.crossOrigin,c.svgUid=l,0===h.length&&t.isLikelyNode){var u=[];for(o=0,s=(h=e.selectNodes('//*[name(.)!="svg"]')).length;o<s;o++)u[o]=h[o];h=u}var d=h.filter((function(e){return p(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))&&!function(e,t){for(;e&&(e=e.parentNode);)if(e.nodeName&&t.test(e.nodeName.replace("svg:",""))&&!e.getAttribute("instantiated_by_use"))return!0;return!1}(e,t.svgInvalidAncestorsRegEx)}));if(!d||d&&!d.length)i&&i([],{});else{var m={};h.filter((function(e){return"clipPath"===e.nodeName.replace("svg:","")})).forEach((function(e){var i=e.getAttribute("id");m[i]=t.util.toArray(e.getElementsByTagName("*")).filter((function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))}))})),t.gradientDefs[l]=t.getGradientDefs(e),t.cssRules[l]=t.getCSSRules(e),t.clipPaths[l]=m,t.parseElements(d,(function(e,n){i&&(i(e,c,n,h),delete t.gradientDefs[l],delete t.cssRules[l],delete t.clipPaths[l])}),n(c),r,a)}}};var b=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+t.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+t.reNum+"))?\\s+(.*)");i(t,{parseFontDeclaration:function(e,t){var i=e.match(b);if(i){var n=i[1],r=i[3],o=i[4],s=i[5],l=i[6];n&&(t.fontStyle=n),r&&(t.fontWeight=isNaN(parseFloat(r))?r:parseFloat(r)),o&&(t.fontSize=a(o)),l&&(t.fontFamily=l),s&&(t.lineHeight="normal"===s?1:s)}},getGradientDefs:function(e){var t,i=f(e,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),n=0,r={};for(n=i.length;n--;)(t=i[n]).getAttribute("xlink:href")&&y(e,t),r[t.getAttribute("id")]=t;return r},parseAttributes:function(e,n,o){if(e){var s,u,f,m={};void 0===o&&(o=e.getAttribute("svgUid")),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(m=t.parseAttributes(e.parentNode,n,o));var g=n.reduce((function(t,i){return(s=e.getAttribute(i))&&(t[i]=s),t}),{}),v=i(function(e,i){var n={};for(var r in t.cssRules[i])if(d(e,r.split(" ")))for(var a in t.cssRules[i][r])n[a]=t.cssRules[i][r][a];return n}(e,o),t.parseStyleAttribute(e));g=i(g,v),v["clip-path"]&&e.setAttribute("clip-path",v["clip-path"]),u=f=m.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,g["font-size"]&&(g["font-size"]=u=a(g["font-size"],f));var p,y,b={};for(var w in g)y=h(p=c(w),g[w],m,u),b[p]=y;b&&b.font&&t.parseFontDeclaration(b.font,b);var x=i(m,b);return t.svgValidParentsRegEx.test(e.nodeName)?x:function(e){for(var i in l)if(void 0!==e[l[i]]&&""!==e[i]){if(void 0===e[i]){if(!t.Object.prototype[i])continue;e[i]=t.Object.prototype[i]}if(0!==e[i].indexOf("url(")){var n=new t.Color(e[i]);e[i]=n.setAlpha(r(n.getAlpha()*e[l[i]],2)).toRgba()}}return e}(x)}},parseElements:function(e,i,n,r,a){new t.ElementsParser(e,i,n,r,a).parse()},parseStyleAttribute:function(e){var t={},i=e.getAttribute("style");return i?("string"==typeof i?function(e,t){var i,n;e.replace(/;\s*$/,"").split(";").forEach((function(e){var r=e.split(":");i=r[0].trim().toLowerCase(),n=r[1].trim(),t[i]=n}))}(i,t):function(e,t){var i,n;for(var r in e)void 0!==e[r]&&(i=r.toLowerCase(),n=e[r],t[i]=n)}(i,t),t):t},parsePointsAttribute:function(e){if(!e)return null;var t,i,n=[];for(t=0,i=(e=(e=e.replace(/,/g," ").trim()).split(/\s+/)).length;t<i;t+=2)n.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return n},getCSSRules:function(e){var i,n,r=e.getElementsByTagName("style"),a={};for(i=0,n=r.length;i<n;i++){var o=r[i].textContent;""!==(o=o.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&o.match(/[^{]*\{[\s\S]*?\}/g).map((function(e){return e.trim()})).forEach((function(e){var r=e.match(/([\s\S]*?)\s*\{([^}]*)\}/),o={},s=r[2].trim().replace(/;$/,"").split(/\s*;\s*/);for(i=0,n=s.length;i<n;i++){var l=s[i].split(/\s*:\s*/),c=l[0],h=l[1];o[c]=h}(e=r[1]).split(",").forEach((function(e){""!==(e=e.replace(/^svg/i,"").trim())&&(a[e]?t.util.object.extend(a[e],o):a[e]=t.util.object.clone(o))}))}))}return a},loadSVGFromURL:function(e,i,n,r){e=e.replace(/^\n\s*/,"").trim(),new t.util.request(e,{method:"get",onComplete:function(e){var a=e.responseXML;if(!a||!a.documentElement)return i&&i(null),!1;t.parseSVGDocument(a.documentElement,(function(e,t,n,r){i&&i(e,t,n,r)}),n,r)}})},loadSVGFromString:function(e,i,n,r){var a=(new t.window.DOMParser).parseFromString(e.trim(),"text/xml");t.parseSVGDocument(a.documentElement,(function(e,t,n,r){i(e,t,n,r)}),n,r)}})}(t),_.ElementsParser=function(e,t,i,n,r,a){this.elements=e,this.callback=t,this.options=i,this.reviver=n,this.svgUid=i&&i.svgUid||0,this.parsingOptions=r,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=a},(v=_.ElementsParser.prototype).parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},v.createObjects=function(){var e=this;this.elements.forEach((function(t,i){t.setAttribute("svgUid",e.svgUid),e.createObject(t,i)}))},v.findTag=function(e){return _[_.util.string.capitalize(e.tagName.replace("svg:",""))]},v.createObject=function(e,t){var i=this.findTag(e);if(i&&i.fromElement)try{i.fromElement(e,this.createCallback(t,e),this.options)}catch(e){_.log(e)}else this.checkIfDone()},v.createCallback=function(e,t){var i=this;return function(n){var r;i.resolveGradient(n,t,"fill"),i.resolveGradient(n,t,"stroke"),n instanceof _.Image&&n._originalElement&&(r=n.parsePreserveAspectRatioAttribute(t)),n._removeTransformMatrix(r),i.resolveClipPath(n,t),i.reviver&&i.reviver(t,n),i.instances[e]=n,i.checkIfDone()}},v.extractPropertyDefinition=function(e,t,i){var n=e[t],r=this.regexUrl;if(r.test(n)){r.lastIndex=0;var a=r.exec(n)[1];return r.lastIndex=0,_[i][this.svgUid][a]}},v.resolveGradient=function(e,t,i){var n=this.extractPropertyDefinition(e,i,"gradientDefs");if(n){var r=t.getAttribute(i+"-opacity"),a=_.Gradient.fromElement(n,e,r,this.options);e.set(i,a)}},v.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},v.resolveClipPath=function(e,t){var i,n,r,a,o=this.extractPropertyDefinition(e,"clipPath","clipPaths");if(o){r=[],n=_.util.invertTransform(e.calcTransformMatrix());for(var s=o[0].parentNode,l=t;l.parentNode&&l.getAttribute("clip-path")!==e.clipPath;)l=l.parentNode;l.parentNode.appendChild(s);for(var c=0;c<o.length;c++)i=o[c],this.findTag(i).fromElement(i,this.createClipPathCallback(e,r),this.options);o=1===r.length?r[0]:new _.Group(r),a=_.util.multiplyTransformMatrices(n,o.calcTransformMatrix()),o.clipPath&&this.resolveClipPath(o,l);var h=_.util.qrDecompose(a);o.flipX=!1,o.flipY=!1,o.set("scaleX",h.scaleX),o.set("scaleY",h.scaleY),o.angle=h.angle,o.skewX=h.skewX,o.skewY=0,o.setPositionByOrigin({x:h.translateX,y:h.translateY},"center","center"),e.clipPath=o}else delete e.clipPath},v.checkIfDone=function(){0==--this.numElements&&(this.instances=this.instances.filter((function(e){return null!=e})),this.callback(this.instances,this.elements))},function(e){"use strict";var t=e.fabric||(e.fabric={});function i(e,t){this.x=e,this.y=t}t.Point?t.warn("fabric.Point is already defined"):(t.Point=i,i.prototype={type:"point",constructor:i,add:function(e){return new i(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new i(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new i(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new i(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new i(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new i(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return void 0===t&&(t=.5),t=Math.max(Math.min(1,t),0),new i(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new i(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new i(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,i=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=i},clone:function(){return new i(this.x,this.y)}})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function i(e){this.status=e,this.points=[]}t.Intersection?t.warn("fabric.Intersection is already defined"):(t.Intersection=i,t.Intersection.prototype={constructor:i,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,n,r,a){var o,s=(a.x-r.x)*(e.y-r.y)-(a.y-r.y)*(e.x-r.x),l=(n.x-e.x)*(e.y-r.y)-(n.y-e.y)*(e.x-r.x),c=(a.y-r.y)*(n.x-e.x)-(a.x-r.x)*(n.y-e.y);if(0!==c){var h=s/c,u=l/c;0<=h&&h<=1&&0<=u&&u<=1?(o=new i("Intersection")).appendPoint(new t.Point(e.x+h*(n.x-e.x),e.y+h*(n.y-e.y))):o=new i}else o=new i(0===s||0===l?"Coincident":"Parallel");return o},t.Intersection.intersectLinePolygon=function(e,t,n){var r,a,o,s,l=new i,c=n.length;for(s=0;s<c;s++)r=n[s],a=n[(s+1)%c],o=i.intersectLineLine(e,t,r,a),l.appendPoints(o.points);return l.points.length>0&&(l.status="Intersection"),l},t.Intersection.intersectPolygonPolygon=function(e,t){var n,r=new i,a=e.length;for(n=0;n<a;n++){var o=e[n],s=e[(n+1)%a],l=i.intersectLinePolygon(o,s,t);r.appendPoints(l.points)}return r.points.length>0&&(r.status="Intersection"),r},t.Intersection.intersectPolygonRectangle=function(e,n,r){var a=n.min(r),o=n.max(r),s=new t.Point(o.x,a.y),l=new t.Point(a.x,o.y),c=i.intersectLinePolygon(a,s,e),h=i.intersectLinePolygon(s,o,e),u=i.intersectLinePolygon(o,l,e),f=i.intersectLinePolygon(l,a,e),d=new i;return d.appendPoints(c.points),d.appendPoints(h.points),d.appendPoints(u.points),d.appendPoints(f.points),d.points.length>0&&(d.status="Intersection"),d})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function i(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function n(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}t.Color?t.warn("fabric.Color is already defined."):(t.Color=i,t.Color.prototype={_tryParsingColor:function(e){var t;e in i.colorNameMap&&(e=i.colorNameMap[e]),"transparent"===e&&(t=[255,255,255,0]),t||(t=i.sourceFromHex(e)),t||(t=i.sourceFromRgb(e)),t||(t=i.sourceFromHsl(e)),t||(t=[0,0,0,1]),t&&this.setSource(t)},_rgbToHsl:function(e,i,n){e/=255,i/=255,n/=255;var r,a,o,s=t.util.array.max([e,i,n]),l=t.util.array.min([e,i,n]);if(o=(s+l)/2,s===l)r=a=0;else{var c=s-l;switch(a=o>.5?c/(2-s-l):c/(s+l),s){case e:r=(i-n)/c+(i<n?6:0);break;case i:r=(n-e)/c+2;break;case n:r=(e-i)/c+4}r/=6}return[Math.round(360*r),Math.round(100*a),Math.round(100*o)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return"rgb("+e[0]+","+e[1]+","+e[2]+")"},toRgba:function(){var e=this.getSource();return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsl("+t[0]+","+t[1]+"%,"+t[2]+"%)"},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsla("+t[0]+","+t[1]+"%,"+t[2]+"%,"+e[3]+")"},toHex:function(){var e,t,i,n=this.getSource();return e=1===(e=n[0].toString(16)).length?"0"+e:e,t=1===(t=n[1].toString(16)).length?"0"+t:t,i=1===(i=n[2].toString(16)).length?"0"+i:i,e.toUpperCase()+t.toUpperCase()+i.toUpperCase()},toHexa:function(){var e,t=this.getSource();return e=1===(e=(e=Math.round(255*t[3])).toString(16)).length?"0"+e:e,this.toHex()+e.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),10),i=e[3];return this.setSource([t,t,t,i]),this},toBlackWhite:function(e){var t=this.getSource(),i=(.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),n=t[3];return e=e||127,i=Number(i)<Number(e)?0:255,this.setSource([i,i,i,n]),this},overlayWith:function(e){e instanceof i||(e=new i(e));var t,n=[],r=this.getAlpha(),a=this.getSource(),o=e.getSource();for(t=0;t<3;t++)n.push(Math.round(.5*a[t]+.5*o[t]));return n[3]=r,this.setSource(n),this}},t.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},t.Color.fromRgb=function(e){return i.fromSource(i.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(i.reRGBa);if(t){var n=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),r=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),a=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(n,10),parseInt(r,10),parseInt(a,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=i.fromRgb,t.Color.fromHsl=function(e){return i.fromSource(i.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(i.reHSLa);if(t){var r,a,o,s=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(0===l)r=a=o=c;else{var h=c<=.5?c*(l+1):c+l-c*l,u=2*c-h;r=n(u,h,s+1/3),a=n(u,h,s),o=n(u,h,s-1/3)}return[Math.round(255*r),Math.round(255*a),Math.round(255*o),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=i.fromHsl,t.Color.fromHex=function(e){return i.fromSource(i.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(i.reHex)){var t=e.slice(e.indexOf("#")+1),n=3===t.length||4===t.length,r=8===t.length||4===t.length,a=n?t.charAt(0)+t.charAt(0):t.substring(0,2),o=n?t.charAt(1)+t.charAt(1):t.substring(2,4),s=n?t.charAt(2)+t.charAt(2):t.substring(4,6),l=r?n?t.charAt(3)+t.charAt(3):t.substring(6,8):"FF";return[parseInt(a,16),parseInt(o,16),parseInt(s,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new i;return t.setSource(e),t})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=["e","se","s","sw","w","nw","n","ne","e"],n=["ns","nesw","ew","nwse"],r={},a="left",o="top",s={top:"bottom",bottom:o,left:"right",right:a,center:"center"},l=t.util.radiansToDegrees,c=Math.sign||function(e){return(e>0)-(e<0)||+e};function h(e,t){var i=e.angle+l(Math.atan2(t.y,t.x))+360;return Math.round(i%360/45)}function u(e,i){var n=i.transform.target,r=n.canvas,a=t.util.object.clone(i);a.target=n,r&&r.fire("object:"+e,a),n.fire(e,i)}function f(e,t){var i=t.canvas,n=e[i.uniScaleKey];return i.uniformScaling&&!n||!i.uniformScaling&&n}function d(e){return"center"===e.originX&&"center"===e.originY}function m(e,t,i){var n=e.lockScalingX,r=e.lockScalingY;return!(!n||!r)||(!(t||!n&&!r||!i)||(!(!n||"x"!==t)||!(!r||"y"!==t)))}function g(e,t,i,n){return{e:e,transform:t,pointer:{x:i,y:n}}}function v(e){return function(t,i,n,r){var a=i.target,o=a.getCenterPoint(),s=a.translateToOriginPoint(o,i.originX,i.originY),l=e(t,i,n,r);return a.setPositionByOrigin(s,i.originX,i.originY),l}}function p(e,t){return function(i,n,r,a){var o=t(i,n,r,a);return o&&u(e,g(i,n,r,a)),o}}function y(e,i,n,r,a){var o=e.target,s=o.controls[e.corner],l=o.canvas.getZoom(),c=o.padding/l,h=o.toLocalPoint(new t.Point(r,a),i,n);return h.x>=c&&(h.x-=c),h.x<=-c&&(h.x+=c),h.y>=c&&(h.y-=c),h.y<=c&&(h.y+=c),h.x-=s.offsetX,h.y-=s.offsetY,h}function b(e){return e.flipX!==e.flipY}function w(e,t,i,n,r){if(0!==e[t]){var a=r/e._getTransformedDimensions()[n]*e[i];e.set(i,a)}}function x(e,t,i,n){var r,s=t.target,c=s._getTransformedDimensions(0,s.skewY),h=y(t,t.originX,t.originY,i,n),u=Math.abs(2*h.x)-c.x,f=s.skewX;u<2?r=0:(r=l(Math.atan2(u/s.scaleX,c.y/s.scaleY)),t.originX===a&&"bottom"===t.originY&&(r=-r),"right"===t.originX&&t.originY===o&&(r=-r),b(s)&&(r=-r));var d=f!==r;if(d){var m=s._getTransformedDimensions().y;s.set("skewX",r),w(s,"skewY","scaleY","y",m)}return d}function k(e,t,i,n){var r,s=t.target,c=s._getTransformedDimensions(s.skewX,0),h=y(t,t.originX,t.originY,i,n),u=Math.abs(2*h.y)-c.y,f=s.skewY;u<2?r=0:(r=l(Math.atan2(u/s.scaleY,c.x/s.scaleX)),t.originX===a&&"bottom"===t.originY&&(r=-r),"right"===t.originX&&t.originY===o&&(r=-r),b(s)&&(r=-r));var d=f!==r;if(d){var m=s._getTransformedDimensions().x;s.set("skewY",r),w(s,"skewX","scaleX","x",m)}return d}function C(e,t,i,n,r){r=r||{};var a,o,l,h,u,g,v=t.target,p=v.lockScalingX,b=v.lockScalingY,w=r.by,x=f(e,v),k=m(v,w,x),C=t.gestureScale;if(k)return!1;if(C)o=t.scaleX*C,l=t.scaleY*C;else{if(a=y(t,t.originX,t.originY,i,n),u="y"!==w?c(a.x):1,g="x"!==w?c(a.y):1,t.signX||(t.signX=u),t.signY||(t.signY=g),v.lockScalingFlip&&(t.signX!==u||t.signY!==g))return!1;if(h=v._getTransformedDimensions(),x&&!w){var S=Math.abs(a.x)+Math.abs(a.y),_=t.original,T=S/(Math.abs(h.x*_.scaleX/v.scaleX)+Math.abs(h.y*_.scaleY/v.scaleY));o=_.scaleX*T,l=_.scaleY*T}else o=Math.abs(a.x*v.scaleX/h.x),l=Math.abs(a.y*v.scaleY/h.y);d(t)&&(o*=2,l*=2),t.signX!==u&&"y"!==w&&(t.originX=s[t.originX],o*=-1,t.signX=u),t.signY!==g&&"x"!==w&&(t.originY=s[t.originY],l*=-1,t.signY=g)}var O=v.scaleX,E=v.scaleY;return w?("x"===w&&v.set("scaleX",o),"y"===w&&v.set("scaleY",l)):(!p&&v.set("scaleX",o),!b&&v.set("scaleY",l)),O!==v.scaleX||E!==v.scaleY}r.scaleCursorStyleHandler=function(e,t,n){var r=f(e,n),a="";if(0!==t.x&&0===t.y?a="x":0===t.x&&0!==t.y&&(a="y"),m(n,a,r))return"not-allowed";var o=h(n,t);return i[o]+"-resize"},r.skewCursorStyleHandler=function(e,t,i){if(0!==t.x&&i.lockSkewingY)return"not-allowed";if(0!==t.y&&i.lockSkewingX)return"not-allowed";var r=h(i,t)%4;return n[r]+"-resize"},r.scaleSkewCursorStyleHandler=function(e,t,i){return e[i.canvas.altActionKey]?r.skewCursorStyleHandler(e,t,i):r.scaleCursorStyleHandler(e,t,i)},r.rotationWithSnapping=p("rotating",v((function(e,t,i,n){var r=t,a=r.target,o=a.translateToOriginPoint(a.getCenterPoint(),r.originX,r.originY);if(a.lockRotation)return!1;var s,c=Math.atan2(r.ey-o.y,r.ex-o.x),h=Math.atan2(n-o.y,i-o.x),u=l(h-c+r.theta);if(a.snapAngle>0){var f=a.snapAngle,d=a.snapThreshold||f,m=Math.ceil(u/f)*f,g=Math.floor(u/f)*f;Math.abs(u-g)<d?u=g:Math.abs(u-m)<d&&(u=m)}return u<0&&(u=360+u),u%=360,s=a.angle!==u,a.angle=u,s}))),r.scalingEqually=p("scaling",v((function(e,t,i,n){return C(e,t,i,n)}))),r.scalingX=p("scaling",v((function(e,t,i,n){return C(e,t,i,n,{by:"x"})}))),r.scalingY=p("scaling",v((function(e,t,i,n){return C(e,t,i,n,{by:"y"})}))),r.scalingYOrSkewingX=function(e,t,i,n){return e[t.target.canvas.altActionKey]?r.skewHandlerX(e,t,i,n):r.scalingY(e,t,i,n)},r.scalingXOrSkewingY=function(e,t,i,n){return e[t.target.canvas.altActionKey]?r.skewHandlerY(e,t,i,n):r.scalingX(e,t,i,n)},r.changeWidth=p("resizing",v((function(e,t,i,n){var r=t.target,a=y(t,t.originX,t.originY,i,n),o=r.strokeWidth/(r.strokeUniform?r.scaleX:1),s=d(t)?2:1,l=r.width,c=Math.abs(a.x*s/r.scaleX)-o;return r.set("width",Math.max(c,0)),l!==c}))),r.skewHandlerX=function(e,t,i,n){var r,s=t.target,l=s.skewX,c=t.originY;return!s.lockSkewingX&&(0===l?r=y(t,"center","center",i,n).x>0?a:"right":(l>0&&(r=c===o?a:"right"),l<0&&(r=c===o?"right":a),b(s)&&(r=r===a?"right":a)),t.originX=r,p("skewing",v(x))(e,t,i,n))},r.skewHandlerY=function(e,t,i,n){var r,s=t.target,l=s.skewY,c=t.originX;return!s.lockSkewingY&&(0===l?r=y(t,"center","center",i,n).y>0?o:"bottom":(l>0&&(r=c===a?o:"bottom"),l<0&&(r=c===a?"bottom":o),b(s)&&(r=r===o?"bottom":o)),t.originY=r,p("skewing",v(k))(e,t,i,n))},r.dragHandler=function(e,t,i,n){var r=t.target,a=i-t.offsetX,o=n-t.offsetY,s=!r.get("lockMovementX")&&r.left!==a,l=!r.get("lockMovementY")&&r.top!==o;return s&&r.set("left",a),l&&r.set("top",o),(s||l)&&u("moving",g(e,t,i,n)),s||l},r.scaleOrSkewActionName=function(e,t,i){var n=e[i.canvas.altActionKey];return 0===t.x?n?"skewX":"scaleY":0===t.y?n?"skewY":"scaleX":void 0},r.rotationStyleHandler=function(e,t,i){return i.lockRotation?"not-allowed":t.cursorStyle},r.fireEvent=u,r.wrapWithFixedAnchor=v,r.wrapWithFireEvent=p,r.getLocalPoint=y,t.controlsUtils=r}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.degreesToRadians,n=t.controlsUtils;n.renderCircleControl=function(e,t,i,n,r){n=n||{};var a,o=this.sizeX||n.cornerSize||r.cornerSize,s=this.sizeY||n.cornerSize||r.cornerSize,l=void 0!==n.transparentCorners?n.transparentCorners:r.transparentCorners,c=l?"stroke":"fill",h=!l&&(n.cornerStrokeColor||r.cornerStrokeColor),u=t,f=i;e.save(),e.fillStyle=n.cornerColor||r.cornerColor,e.strokeStyle=n.cornerStrokeColor||r.cornerStrokeColor,o>s?(a=o,e.scale(1,s/o),f=i*o/s):s>o?(a=s,e.scale(o/s,1),u=t*s/o):a=o,e.lineWidth=1,e.beginPath(),e.arc(u,f,a/2,0,2*Math.PI,!1),e[c](),h&&e.stroke(),e.restore()},n.renderSquareControl=function(e,t,n,r,a){r=r||{};var o=this.sizeX||r.cornerSize||a.cornerSize,s=this.sizeY||r.cornerSize||a.cornerSize,l=void 0!==r.transparentCorners?r.transparentCorners:a.transparentCorners,c=l?"stroke":"fill",h=!l&&(r.cornerStrokeColor||a.cornerStrokeColor),u=o/2,f=s/2;e.save(),e.fillStyle=r.cornerColor||a.cornerColor,e.strokeStyle=r.cornerStrokeColor||a.cornerStrokeColor,e.lineWidth=1,e.translate(t,n),e.rotate(i(a.angle)),e[c+"Rect"](-u,-f,o,s),h&&e.strokeRect(-u,-f,o,s),e.restore()}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Control=function(e){for(var t in e)this[t]=e[t]},t.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var i=e._controlsVisibility;return i&&void 0!==i[t]?i[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,i){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},i)},calcCornerCoords:function(e,i,n,r,a){var o,s,l,c,h=a?this.touchSizeX:this.sizeX,u=a?this.touchSizeY:this.sizeY;if(h&&u&&h!==u){var f=Math.atan2(u,h),d=Math.sqrt(h*h+u*u)/2,m=f-t.util.degreesToRadians(e),g=Math.PI/2-f-t.util.degreesToRadians(e);o=d*t.util.cos(m),s=d*t.util.sin(m),l=d*t.util.cos(g),c=d*t.util.sin(g)}else{d=.7071067812*(h&&u?h:i);m=t.util.degreesToRadians(45-e);o=l=d*t.util.cos(m),s=c=d*t.util.sin(m)}return{tl:{x:n-c,y:r-l},tr:{x:n+o,y:r-s},bl:{x:n-o,y:r+s},br:{x:n+c,y:r+l}}},render:function(e,i,n,r,a){switch((r=r||{}).cornerStyle||a.cornerStyle){case"circle":t.controlsUtils.renderCircleControl.call(this,e,i,n,r,a);break;default:t.controlsUtils.renderSquareControl.call(this,e,i,n,r,a)}}}}(t),function(){function e(e,t){var i,n,r,a,o=e.getAttribute("style"),s=e.getAttribute("offset")||0;if(s=(s=parseFloat(s)/(/%$/.test(s)?100:1))<0?0:s>1?1:s,o){var l=o.split(/\s*;\s*/);for(""===l[l.length-1]&&l.pop(),a=l.length;a--;){var c=l[a].split(/\s*:\s*/),h=c[0].trim(),u=c[1].trim();"stop-color"===h?i=u:"stop-opacity"===h&&(r=u)}}return i||(i=e.getAttribute("stop-color")||"rgb(0,0,0)"),r||(r=e.getAttribute("stop-opacity")),n=(i=new _.Color(i)).getAlpha(),r=isNaN(parseFloat(r))?1:parseFloat(r),r*=n*t,{offset:s,color:i.toRgb(),opacity:r}}var t=_.util.object.clone;_.Gradient=_.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var t,i=this;Object.keys(e).forEach((function(t){i[t]=e[t]})),this.id?this.id+="_"+_.Object.__uid++:this.id=_.Object.__uid++,t={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(t.r1=e.coords.r1||0,t.r2=e.coords.r2||0),this.coords=t,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var t in e){var i=new _.Color(e[t]);this.colorStops.push({offset:parseFloat(t),color:i.toRgb(),opacity:i.getAlpha()})}return this},toObject:function(e){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return _.util.populateWithProperties(this,t,e),t},toSVG:function(e,i){var n,r,a,o,s=t(this.coords,!0),l=(i=i||{},t(this.colorStops,!0)),c=s.r1>s.r2,h=this.gradientTransform?this.gradientTransform.concat():_.iMatrix.concat(),u=-this.offsetX,f=-this.offsetY,d=!!i.additionalTransform,m="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(l.sort((function(e,t){return e.offset-t.offset})),"objectBoundingBox"===m?(u/=e.width,f/=e.height):(u+=e.width/2,f+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(u-=e.pathOffset.x,f-=e.pathOffset.y),h[4]-=u,h[5]-=f,o='id="SVGID_'+this.id+'" gradientUnits="'+m+'"',o+=' gradientTransform="'+(d?i.additionalTransform+" ":"")+_.util.matrixToSVG(h)+'" ',"linear"===this.type?a=["<linearGradient ",o,' x1="',s.x1,'" y1="',s.y1,'" x2="',s.x2,'" y2="',s.y2,'">\n']:"radial"===this.type&&(a=["<radialGradient ",o,' cx="',c?s.x1:s.x2,'" cy="',c?s.y1:s.y2,'" r="',c?s.r1:s.r2,'" fx="',c?s.x2:s.x1,'" fy="',c?s.y2:s.y1,'">\n']),"radial"===this.type){if(c)for((l=l.concat()).reverse(),n=0,r=l.length;n<r;n++)l[n].offset=1-l[n].offset;var g=Math.min(s.r1,s.r2);if(g>0){var v=g/Math.max(s.r1,s.r2);for(n=0,r=l.length;n<r;n++)l[n].offset+=v*(1-l[n].offset)}}for(n=0,r=l.length;n<r;n++){var p=l[n];a.push("<stop ",'offset="',100*p.offset+"%",'" style="stop-color:',p.color,void 0!==p.opacity?";stop-opacity: "+p.opacity:";",'"/>\n')}return a.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),a.join("")},toLive:function(e){var t,i,n,r=_.util.object.clone(this.coords);if(this.type){for("linear"===this.type?t=e.createLinearGradient(r.x1,r.y1,r.x2,r.y2):"radial"===this.type&&(t=e.createRadialGradient(r.x1,r.y1,r.r1,r.x2,r.y2,r.r2)),i=0,n=this.colorStops.length;i<n;i++){var a=this.colorStops[i].color,o=this.colorStops[i].opacity,s=this.colorStops[i].offset;void 0!==o&&(a=new _.Color(a).setAlpha(o).toRgba()),t.addColorStop(s,a)}return t}}}),_.util.object.extend(_.Gradient,{fromElement:function(t,i,n,r){var a=parseFloat(n)/(/%$/.test(n)?100:1);a=a<0?0:a>1?1:a,isNaN(a)&&(a=1);var o,s,l,c,h=t.getElementsByTagName("stop"),u="userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage",f=t.getAttribute("gradientTransform")||"",d=[],m=0,g=0;for("linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?(o="linear",s=function(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}(t)):(o="radial",s=function(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}(t)),l=h.length;l--;)d.push(e(h[l],a));return c=_.parseTransformAttribute(f),function(e,t,i,n){var r,a;Object.keys(t).forEach((function(e){"Infinity"===(r=t[e])?a=1:"-Infinity"===r?a=0:(a=parseFloat(t[e],10),"string"==typeof r&&/^(\d+\.\d+)%|(\d+)%$/.test(r)&&(a*=.01,"pixels"===n&&("x1"!==e&&"x2"!==e&&"r2"!==e||(a*=i.viewBoxWidth||i.width),"y1"!==e&&"y2"!==e||(a*=i.viewBoxHeight||i.height)))),t[e]=a}))}(0,s,r,u),"pixels"===u&&(m=-i.left,g=-i.top),new _.Gradient({id:t.getAttribute("id"),type:o,coords:s,colorStops:d,gradientUnits:u,gradientTransform:c,offsetX:m,offsetY:g})}})}(),function(){"use strict";var e=_.util.toFixed;_.Pattern=_.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(e,t){if(e||(e={}),this.id=_.Object.__uid++,this.setOptions(e),!e.source||e.source&&"string"!=typeof e.source)t&&t(this);else{var i=this;this.source=_.util.createImage(),_.util.loadImage(e.source,(function(e,n){i.source=e,t&&t(i,n)}),null,this.crossOrigin)}},toObject:function(t){var i,n,r=_.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?i=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(i=this.source.toDataURL()),n={type:"pattern",source:i,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,r),offsetY:e(this.offsetY,r),patternTransform:this.patternTransform?this.patternTransform.concat():null},_.util.populateWithProperties(this,n,t),n},toSVG:function(e){var t="function"==typeof this.source?this.source():this.source,i=t.width/e.width,n=t.height/e.height,r=this.offsetX/e.width,a=this.offsetY/e.height,o="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(n=1,a&&(n+=Math.abs(a))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(i=1,r&&(i+=Math.abs(r))),t.src?o=t.src:t.toDataURL&&(o=t.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+r+'" y="'+a+'" width="'+i+'" height="'+n+'">\n<image x="0" y="0" width="'+t.width+'" height="'+t.height+'" xlink:href="'+o+'"></image>\n</pattern>\n'},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;if(!t)return"";if(void 0!==t.src){if(!t.complete)return"";if(0===t.naturalWidth||0===t.naturalHeight)return""}return e.createPattern(t,this.repeat)}})}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.toFixed;t.Shadow?t.warn("fabric.Shadow is already defined."):(t.Shadow=t.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var i in"string"==typeof e&&(e=this._parseShadow(e)),e)this[i]=e[i];this.id=t.Object.__uid++},_parseShadow:function(e){var i=e.trim(),n=t.Shadow.reOffsetsAndBlur.exec(i)||[];return{color:(i.replace(t.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(n[1],10)||0,offsetY:parseFloat(n[2],10)||0,blur:parseFloat(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(e){var n=40,r=40,a=t.Object.NUM_FRACTION_DIGITS,o=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=new t.Color(this.color);return e.width&&e.height&&(n=100*i((Math.abs(o.x)+this.blur)/e.width,a)+20,r=100*i((Math.abs(o.y)+this.blur)/e.height,a)+20),e.flipX&&(o.x*=-1),e.flipY&&(o.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+r+'%" height="'+(100+2*r)+'%" x="-'+n+'%" width="'+(100+2*n)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+i(this.blur?this.blur/2:0,a)+'"></feGaussianBlur>\n\t<feOffset dx="'+i(o.x,a)+'" dy="'+i(o.y,a)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+s.toRgb()+'" flood-opacity="'+s.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},i=t.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach((function(t){this[t]!==i[t]&&(e[t]=this[t])}),this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(t),function(){"use strict";if(_.StaticCanvas)_.warn("fabric.StaticCanvas is already defined.");else{var e=_.util.object.extend,t=_.util.getElementOffset,i=_.util.removeFromArray,n=_.util.toFixed,r=_.util.transformPoint,a=_.util.invertTransform,o=_.util.getNodeCanvas,s=_.util.createCanvasElement,l=new Error("Could not initialize `canvas` element");_.StaticCanvas=_.util.createClass(_.CommonMethods,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:_.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,i),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,i),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,i),t.overlayColor&&this.setOverlayColor(t.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return 1!==_.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?_.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=_.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,i){t.setAttribute("width",this.width*e),t.setAttribute("height",this.height*e),i.scale(e,e)},calcOffset:function(){return this._offset=t(this.lowerCanvasEl),this},setOverlayImage:function(e,t,i){return this.__setBgOverlayImage("overlayImage",e,t,i)},setBackgroundImage:function(e,t,i){return this.__setBgOverlayImage("backgroundImage",e,t,i)},setOverlayColor:function(e,t){return this.__setBgOverlayColor("overlayColor",e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor("backgroundColor",e,t)},__setBgOverlayImage:function(e,t,i,n){return"string"==typeof t?_.util.loadImage(t,(function(t,r){if(t){var a=new _.Image(t,n);this[e]=a,a.canvas=this}i&&i(t,r)}),this,n&&n.crossOrigin):(n&&t.setOptions(n),this[e]=t,t&&(t.canvas=this),i&&i(t,!1)),this},__setBgOverlayColor:function(e,t,i){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,i),this},_createCanvasElement:function(){var e=s();if(!e)throw l;if(e.style||(e.style={}),void 0===e.getContext)throw l;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+"px",t.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=_.util.getById(e)||this._createCanvasElement(),_.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var i;for(var n in t=t||{},e)i=e[n],t.cssOnly||(this._setBackstoreDimension(n,e[n]),i+="px",this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(n,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,i,n,r=this._activeObject,a=this.backgroundImage,o=this.overlayImage;for(this.viewportTransform=e,i=0,n=this._objects.length;i<n;i++)(t=this._objects[i]).group||t.setCoords(!0);return r&&r.setCoords(),a&&a.setCoords(!0),o&&o.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var i=e,n=this.viewportTransform.slice(0);e=r(e,a(this.viewportTransform)),n[0]=t,n[3]=t;var o=r(e,n);return n[4]+=i.x-o.x,n[5]+=i.y-o.y,this.setViewportTransform(n)},setZoom:function(e){return this.zoomToPoint(new _.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new _.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set("canvas",this),e.setCoords(),this.fire("object:added",{target:e}),e.fire("added")},_onObjectRemoved:function(e){this.fire("object:removed",{target:e}),e.fire("removed"),delete e.canvas},clearContext:function(e){return e.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=_.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var e={},t=this.width,i=this.height,n=a(this.viewportTransform);return e.tl=r({x:0,y:0},n),e.br=r({x:t,y:i},n),e.tr=new _.Point(e.br.x,e.tl.y),e.bl=new _.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&(_.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(e,t){var i=this.viewportTransform,n=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),_.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire("before:render",{ctx:e}),this._renderBackground(e),e.save(),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._renderObjects(e,t),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),n&&(n.canvas=this,n.shouldCache(),n._transformDone=!0,n.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire("after:render",{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,i=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation="destination-in",i.transform(e),e.scale(1/i.zoomX,1/i.zoomY),e.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var i,n;for(i=0,n=t.length;i<n;++i)t[i]&&t[i].render(e)},_renderBackgroundOrOverlay:function(e,t){var i=this[t+"Color"],n=this[t+"Image"],r=this.viewportTransform,a=this[t+"Vpt"];if(i||n){if(i){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=i.toLive?i.toLive(e,this):i,a&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),e.transform(1,0,0,1,i.offsetX||0,i.offsetY||0);var o=i.gradientTransform||i.patternTransform;o&&e.transform(o[0],o[1],o[2],o[3],o[4],o[5]),e.fill(),e.restore()}n&&(e.save(),a&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),n.render(e),e.restore())}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,"background")},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},centerObjectH:function(e){return this._centerObject(e,new _.Point(this.getCenter().left,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new _.Point(e.getCenterPoint().x,this.getCenter().top))},centerObject:function(e){var t=this.getCenter();return this._centerObject(e,new _.Point(t.left,t.top))},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var t=this.getVpCenter();return this._centerObject(e,new _.Point(t.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var t=this.getVpCenter();return this._centerObject(e,new _.Point(e.getCenterPoint().x,t.y))},getVpCenter:function(){var e=this.getCenter(),t=a(this.viewportTransform);return r({x:e.left,y:e.top},t)},_centerObject:function(e,t){return e.setPositionByOrigin(t,"center","center"),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod("toObject",e)},toDatalessObject:function(e){return this._toObjectMethod("toDatalessObject",e)},_toObjectMethod:function(t,i){var n=this.clipPath,r={version:_.version,objects:this._toObjects(t,i)};return n&&!n.excludeFromExport&&(r.clipPath=this._toObject(this.clipPath,t,i)),e(r,this.__serializeBgOverlay(t,i)),_.util.populateWithProperties(this,r,i),r},_toObjects:function(e,t){return this._objects.filter((function(e){return!e.excludeFromExport})).map((function(i){return this._toObject(i,e,t)}),this)},_toObject:function(e,t,i){var n;this.includeDefaultValues||(n=e.includeDefaultValues,e.includeDefaultValues=!1);var r=e[t](i);return this.includeDefaultValues||(e.includeDefaultValues=n),r},__serializeBgOverlay:function(e,t){var i={},n=this.backgroundImage,r=this.overlayImage,a=this.backgroundColor,o=this.overlayColor;return a&&a.toObject?a.excludeFromExport||(i.background=a.toObject(t)):a&&(i.background=a),o&&o.toObject?o.excludeFromExport||(i.overlay=o.toObject(t)):o&&(i.overlay=o),n&&!n.excludeFromExport&&(i.backgroundImage=this._toObject(n,e,t)),r&&!r.excludeFromExport&&(i.overlayImage=this._toObject(r,e,t)),i},svgViewportTransformation:!0,toSVG:function(e,t){e||(e={}),e.reviver=t;var i=[];return this._setSVGPreamble(i,e),this._setSVGHeader(i,e),this.clipPath&&i.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",t),this._setSVGObjects(i,t),this.clipPath&&i.push("</g>\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",t),i.push("</svg>"),i.join("")},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push('<?xml version="1.0" encoding="',t.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(e,t){var i,r=t.width||this.width,a=t.height||this.height,o='viewBox="0 0 '+this.width+" "+this.height+'" ',s=_.Object.NUM_FRACTION_DIGITS;t.viewBox?o='viewBox="'+t.viewBox.x+" "+t.viewBox.y+" "+t.viewBox.width+" "+t.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,o='viewBox="'+n(-i[4]/i[0],s)+" "+n(-i[5]/i[3],s)+" "+n(this.width/i[0],s)+" "+n(this.height/i[3],s)+'" '),e.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',r,'" ','height="',a,'" ',o,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",_.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(t),"</defs>\n")},createSVGClipPathMarkup:function(e){var t=this.clipPath;return t?(t.clipPathId="CLIPPATH_"+_.Object.__uid++,'<clipPath id="'+t.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(e.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var e=this;return["background","overlay"].map((function(t){var i=e[t+"Color"];if(i&&i.toLive){var n=e[t+"Vpt"],r=e.viewportTransform,a={width:e.width/(n?r[0]:1),height:e.height/(n?r[3]:1)};return i.toSVG(a,{additionalTransform:n?_.util.matrixToSVG(r):""})}})).join("")},createSVGFontFacesMarkup:function(){var e,t,i,n,r,a,o,s,l="",c={},h=_.fontPaths,u=[];for(this._objects.forEach((function e(t){u.push(t),t._objects&&t._objects.forEach(e)})),o=0,s=u.length;o<s;o++)if(t=(e=u[o]).fontFamily,-1!==e.type.indexOf("text")&&!c[t]&&h[t]&&(c[t]=!0,e.styles))for(r in i=e.styles)for(a in n=i[r])!c[t=n[a].fontFamily]&&h[t]&&(c[t]=!0);for(var f in c)l+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",h[f],"');\n","\t\t}\n"].join("");return l&&(l=['\t<style type="text/css">',"<![CDATA[\n",l,"]]>","</style>\n"].join("")),l},_setSVGObjects:function(e,t){var i,n,r,a=this._objects;for(n=0,r=a.length;n<r;n++)(i=a[n]).excludeFromExport||this._setSVGObject(e,i,t)},_setSVGObject:function(e,t,i){e.push(t.toSVG(i))},_setSVGBgOverlayImage:function(e,t,i){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(i))},_setSVGBgOverlayColor:function(e,t){var i=this[t+"Color"],n=this.viewportTransform,r=this.width,a=this.height;if(i)if(i.toLive){var o=i.repeat,s=_.util.invertTransform(n),l=this[t+"Vpt"]?_.util.matrixToSVG(s):"";e.push('<rect transform="'+l+" translate(",r/2,",",a/2,')"',' x="',i.offsetX-r/2,'" y="',i.offsetY-a/2,'" ','width="',"repeat-y"===o||"no-repeat"===o?i.source.width:r,'" height="',"repeat-x"===o||"no-repeat"===o?i.source.height:a,'" fill="url(#SVGID_'+i.id+')"',"></rect>\n")}else e.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',i,'"',"></rect>\n")},sendToBack:function(e){if(!e)return this;var t,n,r,a=this._activeObject;if(e===a&&"activeSelection"===e.type)for(t=(r=a._objects).length;t--;)n=r[t],i(this._objects,n),this._objects.unshift(n);else i(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,n,r,a=this._activeObject;if(e===a&&"activeSelection"===e.type)for(r=a._objects,t=0;t<r.length;t++)n=r[t],i(this._objects,n),this._objects.push(n);else i(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var n,r,a,o,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(s=l._objects,n=0;n<s.length;n++)r=s[n],(a=this._objects.indexOf(r))>0+c&&(o=a-1,i(this._objects,r),this._objects.splice(o,0,r)),c++;else 0!==(a=this._objects.indexOf(e))&&(o=this._findNewLowerIndex(e,a,t),i(this._objects,e),this._objects.splice(o,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,i){var n,r;if(i)for(n=t,r=t-1;r>=0;--r){if(e.intersectsWithObject(this._objects[r])||e.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(e)){n=r;break}}else n=t-1;return n},bringForward:function(e,t){if(!e)return this;var n,r,a,o,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(n=(s=l._objects).length;n--;)r=s[n],(a=this._objects.indexOf(r))<this._objects.length-1-c&&(o=a+1,i(this._objects,r),this._objects.splice(o,0,r)),c++;else(a=this._objects.indexOf(e))!==this._objects.length-1&&(o=this._findNewUpperIndex(e,a,t),i(this._objects,e),this._objects.splice(o,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,i){var n,r,a;if(i)for(n=t,r=t+1,a=this._objects.length;r<a;++r){if(e.intersectsWithObject(this._objects[r])||e.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(e)){n=r;break}}else n=t+1;return n},moveTo:function(e,t){return i(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(_.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject((function(e){e.dispose&&e.dispose()})),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),this.lowerCanvasEl.style=this._originalCanvasStyle,delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),_.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),e(_.StaticCanvas.prototype,_.Observable),e(_.StaticCanvas.prototype,_.Collection),e(_.StaticCanvas.prototype,_.DataURLExporter),e(_.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(e){var t=s();if(!t||!t.getContext)return null;var i=t.getContext("2d");if(!i)return null;switch(e){case"setLineDash":return void 0!==i.setLineDash;default:return null}}}),_.StaticCanvas.prototype.toJSON=_.StaticCanvas.prototype.toObject,_.isLikelyNode&&(_.StaticCanvas.prototype.createPNGStream=function(){var e=o(this.lowerCanvasEl);return e&&e.createPNGStream()},_.StaticCanvas.prototype.createJPEGStream=function(e){var t=o(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),_.BaseBrush=_.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var e=this.canvas.contextTop;e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,t=this.shadow,i=e.contextTop,n=e.getZoom();e&&e._isRetinaScaling()&&(n*=_.devicePixelRatio),i.shadowColor=t.color,i.shadowBlur=t.blur*n,i.shadowOffsetX=t.offsetX*n,i.shadowOffsetY=t.offsetY*n}},needsFullRender:function(){return new _.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),_.PencilBrush=_.util.createClass(_.BaseBrush,{decimate:.4,initialize:function(e){this.canvas=e,this._points=[]},_drawSegment:function(e,t,i){var n=t.midPointFrom(i);return e.quadraticCurveTo(t.x,t.y,n.x,n.y),n},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var i=this._points,n=i.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(r,i[n-2],i[n-1],!0),r.stroke(),r.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var t=new _.Point(e.x,e.y);this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1])||(this._points.push(e),0))},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(e){var t=new _.Point(e.x,e.y);return this._addPoint(t)},_render:function(){var e,t,i=this.canvas.contextTop,n=this._points[0],r=this._points[1];if(this._saveAndTransform(i),i.beginPath(),2===this._points.length&&n.x===r.x&&n.y===r.y){var a=this.width/1e3;n=new _.Point(n.x,n.y),r=new _.Point(r.x,r.y),n.x-=a,r.x+=a}for(i.moveTo(n.x,n.y),e=1,t=this._points.length;e<t;e++)this._drawSegment(i,n,r),n=this._points[e],r=this._points[e+1];i.lineTo(n.x,n.y),i.stroke(),i.restore()},convertPointsToSVGPath:function(e){var t=this.width/1e3;return _.util.getSmoothPathFromPoints(e,t)},_isEmptySVGPath:function(e){return"M 0 0 Q 0 0 0 0 L 0 0"===_.util.joinPath(e)},createPath:function(e){var t=new _.Path(e,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,t.shadow=new _.Shadow(this.shadow)),t},decimatePoints:function(e,t){if(e.length<=2)return e;var i,n=this.canvas.getZoom(),r=Math.pow(t/n,2),a=e.length-1,o=e[0],s=[o];for(i=1;i<a-1;i++)Math.pow(o.x-e[i].x,2)+Math.pow(o.y-e[i].y,2)>=r&&(o=e[i],s.push(o));return s.push(e[a]),s},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t})}}}),_.CircleBrush=_.util.createClass(_.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),i=this.canvas.contextTop;this._saveAndTransform(i),this.dot(i,t),i.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,i=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(i),e=0,t=n.length;e<t;e++)this.dot(i,n[e]);i.restore()},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e,t,i=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var n=[];for(e=0,t=this.points.length;e<t;e++){var r=this.points[e],a=new _.Circle({radius:r.radius,left:r.x,top:r.y,originX:"center",originY:"center",fill:r.fill});this.shadow&&(a.shadow=new _.Shadow(this.shadow)),n.push(a)}var o=new _.Group(n);o.canvas=this.canvas,this.canvas.fire("before:path:created",{path:o}),this.canvas.add(o),this.canvas.fire("path:created",{path:o}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=i,this.canvas.requestRenderAll()},addPoint:function(e){var t=new _.Point(e.x,e.y),i=_.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,n=new _.Color(this.color).setAlpha(_.util.getRandomInt(0,100)/100).toRgba();return t.radius=i,t.fill=n,this.points.push(t),t}}),_.SprayBrush=_.util.createClass(_.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var t=[],i=0,n=this.sprayChunks.length;i<n;i++)for(var r=this.sprayChunks[i],a=0,o=r.length;a<o;a++){var s=new _.Rect({width:r[a].width,height:r[a].width,left:r[a].x+1,top:r[a].y+1,originX:"center",originY:"center",fill:this.color});t.push(s)}this.optimizeOverlapping&&(t=this._getOptimizedRects(t));var l=new _.Group(t);this.shadow&&l.set("shadow",new _.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:l}),this.canvas.add(l),this.canvas.fire("path:created",{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t,i,n,r={};for(i=0,n=e.length;i<n;i++)r[t=e[i].left+""+e[i].top]||(r[t]=e[i]);var a=[];for(t in r)a.push(r[t]);return a},render:function(e){var t,i,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),t=0,i=e.length;t<i;t++){var r=e[t];void 0!==r.opacity&&(n.globalAlpha=r.opacity),n.fillRect(r.x,r.y,r.width,r.width)}n.restore()},_render:function(){var e,t,i=this.canvas.contextTop;for(i.fillStyle=this.color,this._saveAndTransform(i),e=0,t=this.sprayChunks.length;e<t;e++)this.render(this.sprayChunks[e]);i.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var t,i,n,r,a=this.width/2;for(r=0;r<this.density;r++){t=_.util.getRandomInt(e.x-a,e.x+a),i=_.util.getRandomInt(e.y-a,e.y+a),n=this.dotWidthVariance?_.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var o=new _.Point(t,i);o.width=n,this.randomOpacity&&(o.opacity=_.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(o)}this.sprayChunks.push(this.sprayChunkPoints)}}),_.PatternBrush=_.util.createClass(_.PencilBrush,{getPatternSrc:function(){var e=_.util.createCanvasElement(),t=e.getContext("2d");return e.width=e.height=25,t.fillStyle=this.color,t.beginPath(),t.arc(10,10,10,0,2*Math.PI,!1),t.closePath(),t.fill(),e},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(e){var t=this.callSuper("createPath",e),i=t._getLeftTopCoords().scalarAdd(t.strokeWidth/2);return t.stroke=new _.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-i.x,offsetY:-i.y}),t}}),function(){var e=_.util.getPointer,t=_.util.degreesToRadians,i=_.util.isTouchEvent;for(var n in _.Canvas=_.util.createClass(_.StaticCanvas,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",rotationCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=_.PencilBrush&&new _.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e,t,i,n=this.getActiveObjects();if(n.length>0&&!this.preserveObjectStacking){t=[],i=[];for(var r=0,a=this._objects.length;r<a;r++)e=this._objects[r],-1===n.indexOf(e)?t.push(e):i.push(e);n.length>1&&(this._activeObject._objects=i),t.push.apply(t,i)}else t=this._objects;return t},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,t){var i=e.calcTransformMatrix(),n=_.util.invertTransform(i),r=this.restorePointerVpt(t);return _.util.transformPoint(r,n)},isTargetTransparent:function(e,t,i){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var n=this._normalizePointer(e,{x:t,y:i}),r=Math.max(e.cacheTranslationX+n.x*e.zoomX,0),a=Math.max(e.cacheTranslationY+n.y*e.zoomY,0);return _.util.isTransparent(e._cacheContext,Math.round(r),Math.round(a),this.targetFindTolerance)}var o=this.contextCache,s=e.selectionBackgroundColor,l=this.viewportTransform;return e.selectionBackgroundColor="",this.clearContext(o),o.save(),o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),e.render(o),o.restore(),e.selectionBackgroundColor=s,_.util.isTransparent(o,t,i,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return"[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find((function(t){return!0===e[t]})):e[this.selectionKey]},_shouldClearSelection:function(e,t){var i=this.getActiveObjects(),n=this._activeObject;return!t||t&&n&&i.length>1&&-1===i.indexOf(t)&&n!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&n&&n!==t},_shouldCenterTransform:function(e,t,i){var n;if(e)return"scale"===t||"scaleX"===t||"scaleY"===t||"resizing"===t?n=this.centeredScaling||e.centeredScaling:"rotate"===t&&(n=this.centeredRotation||e.centeredRotation),n?!i:i},_getOriginFromCorner:function(e,t){var i={x:e.originX,y:e.originY};return"ml"===t||"tl"===t||"bl"===t?i.x="right":"mr"!==t&&"tr"!==t&&"br"!==t||(i.x="left"),"tl"===t||"mt"===t||"tr"===t?i.y="bottom":"bl"!==t&&"mb"!==t&&"br"!==t||(i.y="top"),i},_getActionFromCorner:function(e,t,i,n){if(!t||!e)return"drag";var r=n.controls[t];return r.getActionName(i,r,n)},_setupCurrentTransform:function(e,i,n){if(i){var r=this.getPointer(e),a=i.__corner,o=i.controls[a],s=n&&a?o.getActionHandler(e,i,o):_.controlsUtils.dragHandler,l=this._getActionFromCorner(n,a,e,i),c=this._getOriginFromCorner(i,a),h=e[this.centeredKey],u={target:i,action:l,actionHandler:s,corner:a,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,offsetX:r.x-i.left,offsetY:r.y-i.top,originX:c.x,originY:c.y,ex:r.x,ey:r.y,lastX:r.x,lastY:r.y,theta:t(i.angle),width:i.width*i.scaleX,shiftKey:e.shiftKey,altKey:h,original:_.util.saveObjectTransform(i)};this._shouldCenterTransform(i,l,h)&&(u.originX="center",u.originY="center"),u.original.originX=c.x,u.original.originY=c.y,this._currentTransform=u,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var t=this._groupSelector,i=new _.Point(t.ex,t.ey),n=_.util.transformPoint(i,this.viewportTransform),r=new _.Point(t.ex+t.left,t.ey+t.top),a=_.util.transformPoint(r,this.viewportTransform),o=Math.min(n.x,a.x),s=Math.min(n.y,a.y),l=Math.max(n.x,a.x),c=Math.max(n.y,a.y),h=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(o,s,l-o,c-s)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,o+=h,s+=h,l-=h,c-=h,_.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(o,s,l-o,c-s))},findTarget:function(e,t){if(!this.skipTargetFind){var n,r,a=this.getPointer(e,!0),o=this._activeObject,s=this.getActiveObjects(),l=i(e),c=s.length>1&&!t||1===s.length;if(this.targets=[],c&&o._findTargetCorner(a,l))return o;if(s.length>1&&!t&&o===this._searchPossibleTargets([o],a))return o;if(1===s.length&&o===this._searchPossibleTargets([o],a)){if(!this.preserveObjectStacking)return o;n=o,r=this.targets,this.targets=[]}var h=this._searchPossibleTargets(this._objects,a);return e[this.altSelectionKey]&&h&&n&&h!==n&&(h=n,this.targets=r),h}},_checkTarget:function(e,t,i){if(t&&t.visible&&t.evented&&t.containsPoint(e)){if(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)return!0;if(!this.isTargetTransparent(t,i.x,i.y))return!0}},_searchPossibleTargets:function(e,t){for(var i,n,r=e.length;r--;){var a=e[r],o=a.group?this._normalizePointer(a.group,t):t;if(this._checkTarget(o,a,t)){(i=e[r]).subTargetCheck&&i instanceof _.Group&&(n=this._searchPossibleTargets(i._objects,t))&&this.targets.push(n);break}}return i},restorePointerVpt:function(e){return _.util.transformPoint(e,_.util.invertTransform(this.viewportTransform))},getPointer:function(t,i){if(this._absolutePointer&&!i)return this._absolutePointer;if(this._pointer&&i)return this._pointer;var n,r=e(t),a=this.upperCanvasEl,o=a.getBoundingClientRect(),s=o.width||0,l=o.height||0;s&&l||("top"in o&&"bottom"in o&&(l=Math.abs(o.top-o.bottom)),"right"in o&&"left"in o&&(s=Math.abs(o.right-o.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,i||(r=this.restorePointerVpt(r));var c=this.getRetinaScaling();return 1!==c&&(r.x/=c,r.y/=c),n=0===s||0===l?{width:1,height:1}:{width:a.width/s,height:a.height/l},{x:r.x*n.width,y:r.y*n.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),t=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),_.util.addClass(i,"upper-canvas "+e),this.wrapperEl.appendChild(i),this._copyCanvasStyle(t,i),this._applyCanvasStyle(i),this.contextTop=i.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=_.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),_.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),_.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var t=this.width||e.width,i=this.height||e.height;_.util.setStyle(e,{position:"absolute",width:t+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=t,e.height=i,_.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?"activeSelection"===e.type&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,t){var i=!1,n=this.getActiveObjects(),r=[],a=[];e.forEach((function(e){-1===n.indexOf(e)&&(i=!0,e.fire("deselected",{e:t,target:e}),a.push(e))})),n.forEach((function(n){-1===e.indexOf(n)&&(i=!0,n.fire("selected",{e:t,target:n}),r.push(n))})),e.length>0&&n.length>0?i&&this.fire("selection:updated",{e:t,selected:r,deselected:a,updated:r[0]||a[0],target:this._activeObject}):n.length>0?this.fire("selection:created",{e:t,selected:r,target:this._activeObject}):e.length>0&&this.fire("selection:cleared",{e:t,deselected:a})},setActiveObject:function(e,t){var i=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(i,t),this},_setActiveObject:function(e,t){return this._activeObject!==e&&(!!this._discardActiveObject(t,e)&&(!e.onSelect({e:t})&&(this._activeObject=e,!0)))},_discardActiveObject:function(e,t){var i=this._activeObject;if(i){if(i.onDeselect({e:e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),i=this.getActiveObject();return t.length&&this.fire("before:selection:cleared",{target:i,e:e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){_.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,_.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,i){var n=this._realizeGroupTransformOnObject(e),r=this.callSuper("_toObject",e,t,i);return this._unwindGroupTransformOnObject(e,n),r},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var t={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach((function(i){t[i]=e[i]})),_.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,i){var n=this._realizeGroupTransformOnObject(t);this.callSuper("_setSVGObject",e,t,i),this._unwindGroupTransformOnObject(t,n)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),_.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),_.StaticCanvas)"prototype"!==n&&(_.Canvas[n]=_.StaticCanvas[n])}(),function(){var e=_.util.addListener,t=_.util.removeListener,i={passive:!1};function n(e,t){return e.button&&e.button===t-1}_.util.object.extend(_.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(e,t){var n=this.upperCanvasEl,r=this._getEventPrefix();e(_.window,"resize",this._onResize),e(n,r+"down",this._onMouseDown),e(n,r+"move",this._onMouseMove,i),e(n,r+"out",this._onMouseOut),e(n,r+"enter",this._onMouseEnter),e(n,"wheel",this._onMouseWheel),e(n,"contextmenu",this._onContextMenu),e(n,"dblclick",this._onDoubleClick),e(n,"dragover",this._onDragOver),e(n,"dragenter",this._onDragEnter),e(n,"dragleave",this._onDragLeave),e(n,"drop",this._onDrop),this.enablePointerEvents||e(n,"touchstart",this._onTouchStart,i),"undefined"!=typeof eventjs&&t in eventjs&&(eventjs[t](n,"gesture",this._onGesture),eventjs[t](n,"drag",this._onDrag),eventjs[t](n,"orientation",this._onOrientationChange),eventjs[t](n,"shake",this._onShake),eventjs[t](n,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(t,"remove");var e=this._getEventPrefix();t(_.document,e+"up",this._onMouseUp),t(_.document,"touchend",this._onTouchEnd,i),t(_.document,e+"move",this._onMouseMove,i),t(_.document,"touchmove",this._onMouseMove,i)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire("mouse:out",{target:t,e:e}),this._hoveredTarget=null,t&&t.fire("mouseout",{e:e});var i=this;this._hoveredTargets.forEach((function(n){i.fire("mouse:out",{target:t,e:e}),n&&t.fire("mouseout",{e:e})})),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach((function(e){e.isEditing&&e.hiddenTextarea.focus()}))},_onMouseEnter:function(e){this._currentTransform||this.findTarget(e)||(this.fire("mouse:over",{target:null,e:e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler("dragover",e);this._fireEnterLeaveEvents(t,e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"dblclick"),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&("touchend"===e.type&&0===e.touches.length||(!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId))},_onTouchStart:function(n){n.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,a=this._getEventPrefix();e(_.document,"touchend",this._onTouchEnd,i),e(_.document,"touchmove",this._onMouseMove,i),t(r,a+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,a=this._getEventPrefix();t(r,a+"move",this._onMouseMove,i),e(_.document,a+"up",this._onMouseUp),e(_.document,a+"move",this._onMouseMove,i)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var r=this._getEventPrefix();t(_.document,"touchend",this._onTouchEnd,i),t(_.document,"touchmove",this._onMouseMove,i);var a=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout((function(){e(a.upperCanvasEl,r+"down",a._onMouseDown),a._willAddMouseDown=0}),400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var r=this.upperCanvasEl,a=this._getEventPrefix();this._isMainEvent(n)&&(t(_.document,a+"up",this._onMouseUp),t(_.document,a+"move",this._onMouseMove,i),e(r,a+"move",this._onMouseMove,i))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!=!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var t,i=this._currentTransform,r=this._groupSelector,a=!1,o=!r||0===r.left&&0===r.top;if(this._cacheTransformEventData(e),t=this._target,this._handleEvent(e,"up:before"),n(e,3))this.fireRightClick&&this._handleEvent(e,"up",3,o);else{if(n(e,2))return this.fireMiddleClick&&this._handleEvent(e,"up",2,o),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(i&&(this._finalizeCurrentTransform(e),a=i.actionPerformed),!o){var s=t===this._activeObject;this._maybeGroupObjects(e),a||(a=this._shouldRender(t)||!s&&t===this._activeObject)}if(t){if(t.selectable&&t!==this._activeObject&&"up"===t.activeOn)this.setActiveObject(t,e),a=!0;else{var l=t._findTargetCorner(this.getPointer(e,!0),_.util.isTouchEvent(e)),c=t.controls[l],h=c&&c.getMouseUpHandler(e,t,c);if(h){var u=this.getPointer(e);h(e,i,u.x,u.y)}}t.isMoving=!1}this._setCursorFromEvent(e,t),this._handleEvent(e,"up",1,o),this._groupSelector=null,this._currentTransform=null,t&&(t.__corner=0),a?this.requestRenderAll():o||this.renderTop()}}},_simpleEventHandler:function(e,t){var i=this.findTarget(t),n=this.targets,r={e:t,target:i,subTargets:n};if(this.fire(e,r),i&&i.fire(e,r),!n)return i;for(var a=0;a<n.length;a++)n[a].fire(e,r);return i},_handleEvent:function(e,t,i,n){var r=this._target,a=this.targets||[],o={e:e,target:r,subTargets:a,button:i||1,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===t&&(o.currentTarget=this.findTarget(e),o.currentSubTargets=this.targets),this.fire("mouse:"+t,o),r&&r.fire("mouse"+t,o);for(var s=0;s<a.length;s++)a[s].fire("mouse"+t,o)},_finalizeCurrentTransform:function(e){var t,i=this._currentTransform,n=i.target,r={e:e,target:n,transform:i,action:i.action};n._scaling&&(n._scaling=!1),n.setCoords(),(i.actionPerformed||this.stateful&&n.hasStateChanged())&&(i.actionPerformed&&(t=this._addEventOptions(r,i),this._fire(t,r)),this._fire("modified",r))},_addEventOptions:function(e,t){var i,n;switch(t.action){case"scaleX":i="scaled",n="x";break;case"scaleY":i="scaled",n="y";break;case"skewX":i="skewed",n="x";break;case"skewY":i="skewed",n="y";break;case"scale":i="scaled",n="equally";break;case"rotate":i="rotated";break;case"drag":i="moved"}return e.by=n,i},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e:e,pointer:t}),this._handleEvent(e,"down")},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e:e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,"move")},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:e,pointer:t}),this._handleEvent(e,"up")},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"down:before");var t=this._target;if(n(e,3))this.fireRightClick&&this._handleEvent(e,"down",3);else if(n(e,2))this.fireMiddleClick&&this._handleEvent(e,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(e);else if(this._isMainEvent(e)&&!this._currentTransform){var i=this._pointer;this._previousPointer=i;var r=this._shouldRender(t),a=this._shouldGroup(e,t);if(this._shouldClearSelection(e,t)?this.discardActiveObject(e):a&&(this._handleGrouping(e,t),t=this._activeObject),!this.selection||t&&(t.selectable||t.isEditing||t===this._activeObject)||(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),t){var o=t===this._activeObject;t.selectable&&"down"===t.activeOn&&this.setActiveObject(t,e);var s=t._findTargetCorner(this.getPointer(e,!0),_.util.isTouchEvent(e));if(t.__corner=s,t===this._activeObject&&(s||!a)){this._setupCurrentTransform(e,t,o);var l=t.controls[s],c=(i=this.getPointer(e),l&&l.getMouseDownHandler(e,t,l));c&&c(e,this._currentTransform,i.x,i.y)}}this._handleEvent(e,"down"),(r||a)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire("before:transform",{e:e,transform:t})},__onMouseMove:function(e){var t,i;if(this._handleEvent(e,"move:before"),this._cacheTransformEventData(e),this.isDrawingMode)this._onMouseMoveInDrawingMode(e);else if(this._isMainEvent(e)){var n=this._groupSelector;n?(i=this._absolutePointer,n.left=i.x-n.ex,n.top=i.y-n.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var i=this._hoveredTarget,n=this._hoveredTargets,r=this.targets,a=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:i,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(r[o],t,{oldTarget:n[o],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var i=this._draggedoverTarget,n=this._hoveredTargets,r=this.targets,a=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:i,evtOut:"dragleave",evtIn:"dragenter"});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(r[o],t,{oldTarget:n[o],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,i){var n,r,a,o=i.oldTarget,s=o!==e,l=i.canvasEvtIn,c=i.canvasEvtOut;s&&(n={e:t,target:e,previousTarget:o},r={e:t,target:o,nextTarget:e}),a=e&&s,o&&s&&(c&&this.fire(c,r),o.fire(i.evtOut,r)),a&&(l&&this.fire(l,n),e.fire(i.evtIn,n))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"wheel"),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),i=this._currentTransform;i.reset=!1,i.shiftKey=e.shiftKey,i.altKey=e[this.centeredKey],this._performTransformAction(e,i,t),i.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,i){var n=i.x,r=i.y,a=t.action,o=!1,s=t.actionHandler;s&&(o=s(e,t,n,r)),"drag"===a&&o&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||o},_fire:_.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;var i=t.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,r=(!n||!n.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));r?this.setCursor(this.getCornerCursor(r,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map((function(e){i=e.hoverCursor||i})),this.setCursor(i))},getCornerCursor:function(e,t,i){var n=t.controls[e];return n.cursorStyleHandler(i,n,t)}})}(),p=Math.min,y=Math.max,_.util.object.extend(_.Canvas.prototype,{_shouldGroup:function(e,t){var i=this._activeObject;return i&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(i!==t||"activeSelection"===i.type)&&!t.onSelect({e:e})},_handleGrouping:function(e,t){var i=this._activeObject;i.__corner||(t!==i||(t=this.findTarget(e,!0))&&t.selectable)&&(i&&"activeSelection"===i.type?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var i=this._activeObject,n=i._objects.slice(0);i.contains(e)?(i.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),1===i.size()&&this._setActiveObject(i.item(0),t)):(i.addWithUpdate(e),this._hoveredTarget=i,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(n,t)},_createActiveSelection:function(e,t){var i=this.getActiveObjects(),n=this._createGroup(e);this._hoveredTarget=n,this._setActiveObject(n,t),this._fireSelectionEvents(i,t)},_createGroup:function(e){var t=this._objects,i=t.indexOf(this._activeObject)<t.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new _.ActiveSelection(i,{canvas:this})},_groupSelectedObjects:function(e){var t,i=this._collectObjects(e);1===i.length?this.setActiveObject(i[0],e):i.length>1&&(t=new _.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(t,e))},_collectObjects:function(e){for(var t,i=[],n=this._groupSelector.ex,r=this._groupSelector.ey,a=n+this._groupSelector.left,o=r+this._groupSelector.top,s=new _.Point(p(n,a),p(r,o)),l=new _.Point(y(n,a),y(r,o)),c=!this.selectionFullyContained,h=n===a&&r===o,u=this._objects.length;u--&&!((t=this._objects[u])&&t.selectable&&t.visible&&(c&&t.intersectsWithRect(s,l,!0)||t.isContainedWithinRect(s,l,!0)||c&&t.containsPoint(s,null,!0)||c&&t.containsPoint(l,null,!0))&&(i.push(t),h)););return i.length>1&&(i=i.filter((function(t){return!t.onSelect({e:e})}))),i},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}}),_.util.object.extend(_.StaticCanvas.prototype,{toDataURL:function(e){e||(e={});var t=e.format||"png",i=e.quality||1,n=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),r=this.toCanvasElement(n,e);return _.util.toDataURL(r,t,i)},toCanvasElement:function(e,t){e=e||1;var i=((t=t||{}).width||this.width)*e,n=(t.height||this.height)*e,r=this.getZoom(),a=this.width,o=this.height,s=r*e,l=this.viewportTransform,c=(l[4]-(t.left||0))*e,h=(l[5]-(t.top||0))*e,u=this.interactive,f=[s,0,0,s,c,h],d=this.enableRetinaScaling,m=_.util.createCanvasElement(),g=this.contextTop;return m.width=i,m.height=n,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=i,this.height=n,this.calcViewportBoundaries(),this.renderCanvas(m.getContext("2d"),this._objects),this.viewportTransform=l,this.width=a,this.height=o,this.calcViewportBoundaries(),this.interactive=u,this.enableRetinaScaling=d,this.contextTop=g,m}}),_.util.object.extend(_.StaticCanvas.prototype,{loadFromJSON:function(e,t,i){if(e){var n="string"==typeof e?JSON.parse(e):_.util.object.clone(e),r=this,a=n.clipPath,o=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete n.clipPath,this._enlivenObjects(n.objects,(function(e){r.clear(),r._setBgOverlay(n,(function(){a?r._enlivenObjects([a],(function(i){r.clipPath=i[0],r.__setupCanvas.call(r,n,e,o,t)})):r.__setupCanvas.call(r,n,e,o,t)}))}),i),this}},__setupCanvas:function(e,t,i,n){var r=this;t.forEach((function(e,t){r.insertAt(e,t)})),this.renderOnAddRemove=i,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),n&&n()},_setBgOverlay:function(e,t){var i={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var n=function(){i.backgroundImage&&i.overlayImage&&i.backgroundColor&&i.overlayColor&&t&&t()};this.__setBgOverlay("backgroundImage",e.backgroundImage,i,n),this.__setBgOverlay("overlayImage",e.overlayImage,i,n),this.__setBgOverlay("backgroundColor",e.background,i,n),this.__setBgOverlay("overlayColor",e.overlay,i,n)}else t&&t()},__setBgOverlay:function(e,t,i,n){var r=this;if(!t)return i[e]=!0,void(n&&n());"backgroundImage"===e||"overlayImage"===e?_.util.enlivenObjects([t],(function(t){r[e]=t[0],i[e]=!0,n&&n()})):this["set"+_.util.string.capitalize(e,!0)](t,(function(){i[e]=!0,n&&n()}))},_enlivenObjects:function(e,t,i){e&&0!==e.length?_.util.enlivenObjects(e,(function(e){t&&t(e)}),null,i):t&&t([])},_toDataURL:function(e,t){this.clone((function(i){t(i.toDataURL(e))}))},_toDataURLWithMultiplier:function(e,t,i){this.clone((function(n){i(n.toDataURLWithMultiplier(e,t))}))},clone:function(e,t){var i=JSON.stringify(this.toJSON(t));this.cloneWithoutData((function(t){t.loadFromJSON(i,(function(){e&&e(t)}))}))},cloneWithoutData:function(e){var t=_.util.createCanvasElement();t.width=this.width,t.height=this.height;var i=new _.Canvas(t);this.backgroundImage?(i.setBackgroundImage(this.backgroundImage.src,(function(){i.renderAll(),e&&e(i)})),i.backgroundImageOpacity=this.backgroundImageOpacity,i.backgroundImageStretch=this.backgroundImageStretch):e&&e(i)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.object.clone,r=t.util.toFixed,a=t.util.string.capitalize,o=t.util.degreesToRadians,s=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var i=t.perfLimitSizeTotal,n=e.width,r=e.height,a=t.maxCacheSideLimit,o=t.minCacheSideLimit;if(n<=a&&r<=a&&n*r<=i)return n<o&&(e.width=o),r<o&&(e.height=o),e;var s=n/r,l=t.util.limitDimsByArea(s,i),c=t.util.capValue,h=c(o,l.x,a),u=c(o,l.y,a);return n>h&&(e.zoomX/=n/h,e.width=h,e.capped=!0),r>u&&(e.zoomY/=r/u,e.height=u,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),i=t.x*e.scaleX/this.scaleX,n=t.y*e.scaleY/this.scaleY;return{width:i+2,height:n+2,zoomX:e.scaleX,zoomY:e.scaleY,x:i,y:n}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var i=e._currentTransform.target,n=e._currentTransform.action;if(this===i&&n.slice&&"scale"===n.slice(0,5))return!1}var r,a,o=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),l=t.minCacheSideLimit,c=s.width,h=s.height,u=s.zoomX,f=s.zoomY,d=c!==this.cacheWidth||h!==this.cacheHeight,m=this.zoomX!==u||this.zoomY!==f,g=d||m,v=0,p=0,y=!1;if(d){var b=this._cacheCanvas.width,w=this._cacheCanvas.height,x=c>b||h>w;y=x||(c<.9*b||h<.9*w)&&b>l&&w>l,x&&!s.capped&&(c>l||h>l)&&(v=.1*c,p=.1*h)}return this instanceof t.Text&&this.path&&(g=!0,y=!0,v+=this.getHeightOfLine(0)*this.zoomX,p+=this.getHeightOfLine(0)*this.zoomY),!!g&&(y?(o.width=Math.ceil(c+v),o.height=Math.ceil(h+p)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,o.width,o.height)),r=s.x/2,a=s.y/2,this.cacheTranslationX=Math.round(o.width/2-r)+r,this.cacheTranslationY=Math.round(o.height/2-a)+a,this.cacheWidth=c,this.cacheHeight=h,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(u,f),this.zoomX=u,this.zoomY=f,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,"fill"),this._initGradient(e.stroke,"stroke"),this._initPattern(e.fill,"fill"),this._initPattern(e.stroke,"stroke")},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,i=this.calcTransformMatrix(!t);e.transform(i[0],i[1],i[2],i[3],i[4],i[5])},toObject:function(e){var i=t.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:r(this.left,i),top:r(this.top,i),width:r(this.width,i),height:r(this.height,i),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,i),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:r(this.strokeMiterLimit,i),scaleX:r(this.scaleX,i),scaleY:r(this.scaleY,i),angle:r(this.angle,i),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,i),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:r(this.skewX,i),skewY:r(this.skewY,i)};return this.clipPath&&!this.clipPath.excludeFromExport&&(n.clipPath=this.clipPath.toObject(e),n.clipPath.inverted=this.clipPath.inverted,n.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,n,e),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var i=t.util.getKlass(e.type).prototype;return i.stateProperties.forEach((function(t){"left"!==t&&"top"!==t&&(e[t]===i[t]&&delete e[t],"[object Array]"===Object.prototype.toString.call(e[t])&&"[object Array]"===Object.prototype.toString.call(i[t])&&0===e[t].length&&0===i[t].length&&delete e[t])})),e},toString:function(){return"#<fabric."+a(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,i=e.scaleY;if(this.canvas){var n=this.canvas.getZoom(),r=this.canvas.getRetinaScaling();t*=n*r,i*=n*r}return{scaleX:t,scaleY:i}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,i){var n="scaleX"===e||"scaleY"===e,r=this[e]!==i,a=!1;return n&&(i=this._constrainScale(i)),"scaleX"===e&&i<0?(this.flipX=!this.flipX,i*=-1):"scaleY"===e&&i<0?(this.flipY=!this.flipY,i*=-1):"shadow"!==e||!i||i instanceof t.Shadow?"dirty"===e&&this.group&&this.group.set("dirty",i):i=new t.Shadow(i),this[e]=i,r&&(a=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,a&&this.group.set("dirty",!0)):a&&this.stateProperties.indexOf(e)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),e.restore())},renderCache:function(e){e=e||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!=typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(e){var i=this.clipPath;if(e.save(),i.inverted?e.globalCompositeOperation="destination-out":e.globalCompositeOperation="destination-in",i.absolutePositioned){var n=t.util.invertTransform(this.calcTransformMatrix());e.transform(n[0],n[1],n[2],n[3],n[4],n[5])}i.transform(e),e.scale(1/i.zoomX,1/i.zoomY),e.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),e.restore()},drawObject:function(e,t){var i=this.fill,n=this.stroke;t?(this.fill="black",this.stroke="",this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e),this.fill=i,this.stroke=n},_drawClipPath:function(e){var t=this.clipPath;t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!e){var t=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-i/2,t,i)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var i=t.stroke;i&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?this._applyPatternForTransformedGradient(e,i):(e.strokeStyle=i.toLive(e,this),this._applyPatternGradientTransform(e,i)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var i=t.fill;i&&(i.toLive?(e.fillStyle=i.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=i)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle="transparent",e.fillStyle="#000000"},_setLineDash:function(e,t){t&&0!==t.length&&(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,i){var n,r,a,s=this.getViewportTransform(),l=this.calcTransformMatrix();r=void 0!==(i=i||{}).hasBorders?i.hasBorders:this.hasBorders,a=void 0!==i.hasControls?i.hasControls:this.hasControls,l=t.util.multiplyTransformMatrices(s,l),n=t.util.qrDecompose(l),e.save(),e.translate(n.translateX,n.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),e.rotate(o(n.angle)),i.forActiveSelection||this.group?r&&this.drawBordersInGroup(e,n,i):r&&this.drawBorders(e,i),a&&this.drawControls(e,i),e.restore()},_setShadow:function(e){if(this.shadow){var i,n=this.shadow,r=this.canvas,a=r&&r.viewportTransform[0]||1,o=r&&r.viewportTransform[3]||1;i=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(a*=t.devicePixelRatio,o*=t.devicePixelRatio),e.shadowColor=n.color,e.shadowBlur=n.blur*t.browserShadowBlurConstant*(a+o)*(i.scaleX+i.scaleY)/4,e.shadowOffsetX=n.offsetX*a*i.scaleX,e.shadowOffsetY=n.offsetY*o*i.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var i=t.gradientTransform||t.patternTransform,n=-this.width/2+t.offsetX||0,r=-this.height/2+t.offsetY||0;return"percentage"===t.gradientUnits?e.transform(this.width,0,0,this.height,n,r):e.transform(1,0,0,1,n,r),i&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:n,offsetY:r}},_renderPaintInOrder:function(e){"stroke"===this.paintFirst?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),"evenodd"===this.fillRule?e.fill("evenodd"):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,i){var n,r=this._limitCacheSize(this._getCacheCanvasDimensions()),a=t.util.createCanvasElement(),o=this.canvas.getRetinaScaling(),s=r.x/this.scaleX/o,l=r.y/this.scaleY/o;a.width=s,a.height=l,(n=a.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(s,0),n.lineTo(s,l),n.lineTo(0,l),n.closePath(),n.translate(s/2,l/2),n.scale(r.zoomX/this.scaleX/o,r.zoomY/this.scaleY/o),this._applyPatternGradientTransform(n,i),n.fillStyle=i.toLive(e),n.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(o*this.scaleX/r.zoomX,o*this.scaleY/r.zoomY),e.strokeStyle=n.createPattern(a,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",e.scaleX),this.set("scaleY",e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var i=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),i=t.util.transformPoint(i,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,i.x+=e.offsetLeft,i.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(i,"center","center")},clone:function(e,i){var n=this.toObject(i);this.constructor.fromObject?this.constructor.fromObject(n,e):t.Object._fromObject("Object",n,e)},cloneAsImage:function(e,i){var n=this.toCanvasElement(i);return e&&e(new t.Image(n)),this},toCanvasElement:function(e){e||(e={});var i=t.util,n=i.saveObjectTransform(this),r=this.group,a=this.shadow,o=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&i.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var l,c,h,u,f=t.util.createCanvasElement(),d=this.getBoundingRect(!0,!0),m=this.shadow,g={x:0,y:0};m&&(c=m.blur,l=m.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(o(m.offsetX)+c)*o(l.scaleX),g.y=2*Math.round(o(m.offsetY)+c)*o(l.scaleY)),h=d.width+g.x,u=d.height+g.y,f.width=Math.ceil(h),f.height=Math.ceil(u);var v=new t.StaticCanvas(f,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===e.format&&(v.backgroundColor="#fff"),this.setPositionByOrigin(new t.Point(v.width/2,v.height/2),"center","center");var p=this.canvas;v.add(this);var y=v.toCanvasElement(s||1,e);return this.shadow=a,this.set("canvas",p),r&&(this.group=r),this.set(n).setCoords(),v._objects=[],v.dispose(),v=null,y},toDataURL:function(e){return e||(e={}),t.util.toDataURL(this.toCanvasElement(e),e.format||"png",e.quality||1)},isType:function(e){return this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set("angle",e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,i){i=i||this.canvas.getPointer(e);var n=new t.Point(i.x,i.y),r=this._getLeftTopCoords();return this.angle&&(n=t.util.rotatePoint(n,r,o(-this.angle))),{x:n.x-r.x,y:n.y-r.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),i(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object._fromObject=function(e,i,r,a){var o=t[e];i=n(i,!0),t.util.enlivenPatterns([i.fill,i.stroke],(function(e){void 0!==e[0]&&(i.fill=e[0]),void 0!==e[1]&&(i.stroke=e[1]),t.util.enlivenObjects([i.clipPath],(function(e){i.clipPath=e[0];var t=a?new o(i[a],i):new o(i);r&&r(t)}))}))},t.Object.__uid=0)}(t),b=_.util.degreesToRadians,w={left:-.5,center:0,right:.5},x={top:-.5,center:0,bottom:.5},_.util.object.extend(_.Object.prototype,{translateToGivenOrigin:function(e,t,i,n,r){var a,o,s,l=e.x,c=e.y;return"string"==typeof t?t=w[t]:t-=.5,"string"==typeof n?n=w[n]:n-=.5,"string"==typeof i?i=x[i]:i-=.5,"string"==typeof r?r=x[r]:r-=.5,o=r-i,((a=n-t)||o)&&(s=this._getTransformedDimensions(),l=e.x+a*s.x,c=e.y+o*s.y),new _.Point(l,c)},translateToCenterPoint:function(e,t,i){var n=this.translateToGivenOrigin(e,t,i,"center","center");return this.angle?_.util.rotatePoint(n,e,b(this.angle)):n},translateToOriginPoint:function(e,t,i){var n=this.translateToGivenOrigin(e,"center","center",t,i);return this.angle?_.util.rotatePoint(n,e,b(this.angle)):n},getCenterPoint:function(){var e=new _.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var i=this.getCenterPoint();return this.translateToOriginPoint(i,e,t)},toLocalPoint:function(e,t,i){var n,r,a=this.getCenterPoint();return n=void 0!==t&&void 0!==i?this.translateToGivenOrigin(a,"center","center",t,i):new _.Point(this.left,this.top),r=new _.Point(e.x,e.y),this.angle&&(r=_.util.rotatePoint(r,a,-b(this.angle))),r.subtractEquals(n)},setPositionByOrigin:function(e,t,i){var n=this.translateToCenterPoint(e,t,i),r=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",r.x),this.set("top",r.y)},adjustPosition:function(e){var t,i,n=b(this.angle),r=this.getScaledWidth(),a=_.util.cos(n)*r,o=_.util.sin(n)*r;t="string"==typeof this.originX?w[this.originX]:this.originX-.5,i="string"==typeof e?w[e]:e-.5,this.left+=a*(i-t),this.top+=o*(i-t),this.setCoords(),this.originX=e},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX="center",this.originY="center",this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}}),function(){var e=_.util,t=e.degreesToRadians,i=e.multiplyTransformMatrices,n=e.transformPoint;e.object.extend(_.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,t){return i=this._getCoords(e,t),[new _.Point(i.tl.x,i.tl.y),new _.Point(i.tr.x,i.tr.y),new _.Point(i.br.x,i.br.y),new _.Point(i.bl.x,i.bl.y)];var i},intersectsWithRect:function(e,t,i,n){var r=this.getCoords(i,n);return"Intersection"===_.Intersection.intersectPolygonRectangle(r,e,t).status},intersectsWithObject:function(e,t,i){return"Intersection"===_.Intersection.intersectPolygonPolygon(this.getCoords(t,i),e.getCoords(t,i)).status||e.isContainedWithinObject(this,t,i)||this.isContainedWithinObject(e,t,i)},isContainedWithinObject:function(e,t,i){for(var n=this.getCoords(t,i),r=t?e.aCoords:e.lineCoords,a=0,o=e._getImageLines(r);a<4;a++)if(!e.containsPoint(n[a],o))return!1;return!0},isContainedWithinRect:function(e,t,i,n){var r=this.getBoundingRect(i,n);return r.left>=e.x&&r.left+r.width<=t.x&&r.top>=e.y&&r.top+r.height<=t.y},containsPoint:function(e,t,i,n){var r=this._getCoords(i,n),a=(t=t||this._getImageLines(r),this._findCrossPoints(e,t));return 0!==a&&a%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.getCoords(!0,e).some((function(e){return e.x<=i.x&&e.x>=t.x&&e.y<=i.y&&e.y>=t.y}))||(!!this.intersectsWithRect(t,i,!0,e)||this._containsCenterOfCanvas(t,i,e))},_containsCenterOfCanvas:function(e,t,i){var n={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(n,null,!0,i)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,i,!0,e)||this.getCoords(!0,e).every((function(e){return(e.x>=i.x||e.x<=t.x)&&(e.y>=i.y||e.y<=t.y)}))&&this._containsCenterOfCanvas(t,i,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var i,n,r,a=0;for(var o in t)if(!((r=t[o]).o.y<e.y&&r.d.y<e.y||r.o.y>=e.y&&r.d.y>=e.y||(r.o.x===r.d.x&&r.o.x>=e.x?n=r.o.x:(0,i=(r.d.y-r.o.y)/(r.d.x-r.o.x),n=-(e.y-0*e.x-(r.o.y-i*r.o.x))/(0-i)),n>=e.x&&(a+=1),2!==a)))break;return a},getBoundingRect:function(t,i){var n=this.getCoords(t,i);return e.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:0===e?1e-4:e},scale:function(e){return this._set("scaleX",e),this._set("scaleY",e),this.setCoords()},scaleToWidth:function(e,t){var i=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/i)},scaleToHeight:function(e,t){var i=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/i)},calcCoords:function(e){return e?this.calcACoords():this.calcOCoords()},calcLineCoords:function(){var i=this.getViewportTransform(),r=this.padding,a=t(this.angle),o=e.cos(a)*r,s=e.sin(a)*r,l=o+s,c=o-s,h=this.calcACoords(),u={tl:n(h.tl,i),tr:n(h.tr,i),bl:n(h.bl,i),br:n(h.br,i)};return r&&(u.tl.x-=c,u.tl.y-=l,u.tr.x+=l,u.tr.y-=c,u.bl.x-=l,u.bl.y+=c,u.br.x+=c,u.br.y+=l),u},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),n=this.getViewportTransform(),r=i(n,t),a=i(r,e),o=(a=i(a,[1/n[0],0,0,1/n[3],0,0]),this._calculateCurrentDimensions()),s={};return this.forEachControl((function(e,t,i){s[t]=e.positionHandler(o,a,i)})),s},calcACoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),r=i(t,e),a=this._getTransformedDimensions(),o=a.x/2,s=a.y/2;return{tl:n({x:-o,y:-s},r),tr:n({x:o,y:-s},r),bl:n({x:-o,y:s},r),br:n({x:o,y:s},r)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t="";return!e&&this.group&&(t=this.group.transformMatrixKey(e)+"_"),t+this.top+"_"+this.left+"_"+this.scaleX+"_"+this.scaleY+"_"+this.skewX+"_"+this.skewY+"_"+this.angle+"_"+this.originX+"_"+this.originY+"_"+this.width+"_"+this.height+"_"+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var n=this.transformMatrixKey(e),r=this.matrixCache||(this.matrixCache={});return r.key===n?r.value:(this.group&&(t=i(this.group.calcTransformMatrix(!1),t)),r.key=n,r.value=t,t)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),i=this.ownMatrixCache||(this.ownMatrixCache={});if(i.key===t)return i.value;var n=this._calcTranslateMatrix(),r={angle:this.angle,translateX:n[4],translateY:n[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return i.key=t,i.value=e.composeMatrix(r),i.value},_calcDimensionsTransformMatrix:function(t,i,n){return e.calcDimensionsMatrix({skewX:t,skewY:i,scaleX:this.scaleX*(n&&this.flipX?-1:1),scaleY:this.scaleY*(n&&this.flipY?-1:1)})},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(t,i){void 0===t&&(t=this.skewX),void 0===i&&(i=this.skewY);var n,r,a,o=0===t&&0===i;if(this.strokeUniform?(r=this.width,a=this.height):(r=(n=this._getNonTransformedDimensions()).x,a=n.y),o)return this._finalizeDimensions(r*this.scaleX,a*this.scaleY);var s=e.sizeAfterTransform(r,a,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:i});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform(),t=this._getTransformedDimensions();return n(t,e,!0).scalarAdd(2*this.padding)}})}(),_.util.object.extend(_.Object.prototype,{sendToBack:function(){return this.group?_.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?_.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?_.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?_.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&"activeSelection"!==this.group.type?_.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),function(){function e(e,t){if(t){if(t.toLive)return e+": url(#SVGID_"+t.id+"); ";var i=new _.Color(t),n=e+": "+i.toRgb()+"; ",r=i.getAlpha();return 1!==r&&(n+=e+"-opacity: "+r.toString()+"; "),n}return e+": none; "}var t=_.util.toFixed;_.util.object.extend(_.Object.prototype,{getSvgStyles:function(t){var i=this.fillRule?this.fillRule:"nonzero",n=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",a=this.strokeDashOffset?this.strokeDashOffset:"0",o=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=void 0!==this.opacity?this.opacity:"1",h=this.visible?"":" visibility: hidden;",u=t?"":this.getSvgFilter(),f=e("fill",this.fill);return[e("stroke",this.stroke),"stroke-width: ",n,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",o,"; ","stroke-dashoffset: ",a,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",l,"; ",f,"fill-rule: ",i,"; ","opacity: ",c,";",u,h].join("")},getSvgSpanStyles:function(t,i){var n=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+"; ":"",r=t.strokeWidth?"stroke-width: "+t.strokeWidth+"; ":"",a=(n=n,t.fontSize?"font-size: "+t.fontSize+"px; ":""),o=t.fontStyle?"font-style: "+t.fontStyle+"; ":"",s=t.fontWeight?"font-weight: "+t.fontWeight+"; ":"",l=t.fill?e("fill",t.fill):"",c=t.stroke?e("stroke",t.stroke):"",h=this.getSvgTextDecoration(t);return h&&(h="text-decoration: "+h+"; "),[c,r,n,a,o,s,h,l,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",i?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter((function(t){return e[t.replace("-","")]})).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(e,t){var i=e?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+_.util.matrixToSVG(i)+(t||"")+'" '},_setSVGBg:function(e){if(this.backgroundColor){var i=_.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',t(-this.width/2,i),'" y="',t(-this.height/2,i),'" width="',t(this.width,i),'" height="',t(this.height,i),'"></rect>\n')}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var i=(t=t||{}).reviver,n=t.additionalTransform||"",r=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),a=e.indexOf("COMMON_PARTS");return e[a]=r,i?i(e.join("")):e.join("")},_createBaseSVGMarkup:function(e,t){var i,n,r=(t=t||{}).noStyle,a=t.reviver,o=r?"":'style="'+this.getSvgStyles()+'" ',s=t.withShadow?'style="'+this.getSvgFilter()+'" ':"",l=this.clipPath,c=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",h=l&&l.absolutePositioned,u=this.stroke,f=this.fill,d=this.shadow,m=[],g=e.indexOf("COMMON_PARTS"),v=t.additionalTransform;return l&&(l.clipPathId="CLIPPATH_"+_.Object.__uid++,n='<clipPath id="'+l.clipPathId+'" >\n'+l.toClipPathSVG(a)+"</clipPath>\n"),h&&m.push("<g ",s,this.getSvgCommons()," >\n"),m.push("<g ",this.getSvgTransform(!1),h?"":s+this.getSvgCommons()," >\n"),i=[o,c,r?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),e[g]=i,f&&f.toLive&&m.push(f.toSVG(this)),u&&u.toLive&&m.push(u.toSVG(this)),d&&m.push(d.toSVG(this)),l&&m.push(n),m.push(e.join("")),m.push("</g>\n"),h&&m.push("</g>\n"),a?a(m.join("")):m.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var e=_.util.object.extend;function t(t,i,n){var r={};n.forEach((function(e){r[e]=t[e]})),e(t[i],r,!0)}_.util.object.extend(_.Object.prototype,{hasStateChanged:function(e){var t="_"+(e=e||"stateProperties");return Object.keys(this[t]).length<this[e].length||!function e(t,i,n){if(t===i)return!0;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var r=0,a=t.length;r<a;r++)if(!e(t[r],i[r]))return!1;return!0}if(t&&"object"==typeof t){var o,s=Object.keys(t);if(!i||"object"!=typeof i||!n&&s.length!==Object.keys(i).length)return!1;for(r=0,a=s.length;r<a;r++)if("canvas"!==(o=s[r])&&"group"!==o&&!e(t[o],i[o]))return!1;return!0}}(this[t],this,!0)},saveState:function(e){var i=e&&e.propertySet||"stateProperties",n="_"+i;return this[n]?(t(this,n,this[i]),e&&e.stateProperties&&t(this,n,e.stateProperties),this):this.setupState(e)},setupState:function(e){var t=(e=e||{}).propertySet||"stateProperties";return e.propertySet=t,this["_"+t]={},this.saveState(e),this}})}(),function(){var e=_.util.degreesToRadians;_.util.object.extend(_.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var i,n,r,a=e.x,o=e.y,s=Object.keys(this.oCoords),l=s.length-1;for(this.__corner=0;l>=0;l--)if(r=s[l],this.isControlVisible(r)&&(n=this._getImageLines(t?this.oCoords[r].touchCorner:this.oCoords[r].corner),0!==(i=this._findCrossPoints({x:a,y:o},n))&&i%2==1))return this.__corner=r,r;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var i=this.controls[t];e[t].corner=i.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=i.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var i=this.getCenterPoint(),n=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return t.translate(i.x,i.y),t.scale(1/r[0],1/r[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-n.x/2,-n.y/2,n.x,n.y),t.restore(),this},drawBorders:function(e,t){t=t||{};var i=this._calculateCurrentDimensions(),n=this.borderScaleFactor,r=i.x+n,a=i.y+n,o=void 0!==t.hasControls?t.hasControls:this.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-r/2,-a/2,r,a),o&&(e.beginPath(),this.forEachControl((function(t,i,n){t.withConnection&&t.getVisibility(n,i)&&(s=!0,e.moveTo(t.x*r,t.y*a),e.lineTo(t.x*r+t.offsetX,t.y*a+t.offsetY))})),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,t,i){i=i||{};var n=_.util.sizeAfterTransform(this.width,this.height,t),r=this.strokeWidth,a=this.strokeUniform,o=this.borderScaleFactor,s=n.x+r*(a?this.canvas.getZoom():t.scaleX)+o,l=n.y+r*(a?this.canvas.getZoom():t.scaleY)+o;return e.save(),this._setLineDash(e,i.borderDashArray||this.borderDashArray),e.strokeStyle=i.borderColor||this.borderColor,e.strokeRect(-s/2,-l/2,s,l),e.restore(),this},drawControls:function(e,t){t=t||{},e.save();var i,n,r=this.canvas.getRetinaScaling();return e.setTransform(r,0,0,r,0,0),e.strokeStyle=e.fillStyle=t.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=t.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,t.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(i=this.group.calcTransformMatrix()),this.forEachControl((function(r,a,o){n=o.oCoords[a],r.getVisibility(o,a)&&(i&&(n=_.util.transformPoint(n,i)),r.render(e,n.x,n.y,t,o))})),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||(e={}),e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),_.util.object.extend(_.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,t){var i=function(){},n=(t=t||{}).onComplete||i,r=t.onChange||i,a=this;return _.util.animate({startValue:e.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),a.requestRenderAll(),r()},onComplete:function(){e.setCoords(),n()}}),this},fxCenterObjectV:function(e,t){var i=function(){},n=(t=t||{}).onComplete||i,r=t.onChange||i,a=this;return _.util.animate({startValue:e.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),a.requestRenderAll(),r()},onComplete:function(){e.setCoords(),n()}}),this},fxRemove:function(e,t){var i=function(){},n=(t=t||{}).onComplete||i,r=t.onChange||i,a=this;return _.util.animate({startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),a.requestRenderAll(),r()},onComplete:function(){a.remove(e),n()}}),this}}),_.util.object.extend(_.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var e,t,i=[];for(e in arguments[0])i.push(e);for(var n=0,r=i.length;n<r;n++)e=i[n],t=n!==r-1,this._animate(e,arguments[0][e],arguments[1],t)}else this._animate.apply(this,arguments);return this},_animate:function(e,t,i,n){var r,a=this;t=t.toString(),i=i?_.util.object.clone(i):{},~e.indexOf(".")&&(r=e.split("."));var o=a.colorProperties.indexOf(e)>-1||r&&a.colorProperties.indexOf(r[1])>-1,s=r?this.get(r[0])[r[1]]:this.get(e);"from"in i||(i.from=s),o||(t=~t.indexOf("=")?s+parseFloat(t.replace("=","")):parseFloat(t));var l={startValue:i.from,endValue:t,byValue:i.by,easing:i.easing,duration:i.duration,abort:i.abort&&function(e,t,n){return i.abort.call(a,e,t,n)},onChange:function(t,o,s){r?a[r[0]][r[1]]=t:a.set(e,t),n||i.onChange&&i.onChange(t,o,s)},onComplete:function(e,t,r){n||(a.setCoords(),i.onComplete&&i.onComplete(e,t,r))}};return o?_.util.animateColor(l.startValue,l.endValue,l.duration,l):_.util.animate(l)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.object.clone,r={x1:1,x2:1,y1:1,y2:1};function a(e,t){var i=e.origin,n=e.axis1,r=e.axis2,a=e.dimension,o=t.nearest,s=t.center,l=t.farthest;return function(){switch(this.get(i)){case o:return Math.min(this.get(n),this.get(r));case s:return Math.min(this.get(n),this.get(r))+.5*this.get(a);case l:return Math.max(this.get(n),this.get(r))}}}t.Line?t.warn("fabric.Line is already defined"):(t.Line=t.util.createClass(t.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(e,t){e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in e?e.left:this._getLeftToOriginX(),this.top="top"in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper("_set",e,t),void 0!==r[e]&&this._setWidthHeight(),this},_getLeftToOriginX:a({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:a({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var i=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=i},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return i(this.callSuper("toObject",e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(e.y-=this.strokeWidth),0===this.height&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,i=e*this.width*.5,n=t*this.height*.5;return{x1:i,x2:e*this.width*-.5,y1:n,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',e.x1,'" y1="',e.y1,'" x2="',e.x2,'" y2="',e.y2,'" />\n']}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),t.Line.fromElement=function(e,n,r){r=r||{};var a=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),o=[a.x1||0,a.y1||0,a.x2||0,a.y2||0];n(new t.Line(o,i(a,r)))},t.Line.fromObject=function(e,i){var r=n(e,!0);r.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject("Line",r,(function(e){delete e.points,i&&i(e)}),"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=Math.PI;t.Circle?t.warn("fabric.Circle is already defined."):(t.Circle=t.util.createClass(t.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*i,cacheProperties:t.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,t){return this.callSuper("_set",e,t),"radius"===e&&this.setRadius(t),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,n=(this.endAngle-this.startAngle)%(2*i);if(0===n)e=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var r=t.util.cos(this.startAngle)*this.radius,a=t.util.sin(this.startAngle)*this.radius,o=t.util.cos(this.endAngle)*this.radius,s=t.util.sin(this.endAngle)*this.radius,l=n>i?"1":"0";e=['<path d="M '+r+" "+a," A "+this.radius+" "+this.radius," 0 ",+l+" 1"," "+o+" "+s,'" ',"COMMON_PARTS"," />\n"]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",2*e).set("height",2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),t.Circle.fromElement=function(e,i){var n,r=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!("radius"in(n=r)&&n.radius>=0))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,i(new t.Circle(r))},t.Circle.fromObject=function(e,i){t.Object._fromObject("Circle",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Triangle?t.warn("fabric.Triangle is already defined"):(t.Triangle=t.util.createClass(t.Object,{type:"triangle",width:100,height:100,_render:function(e){var t=this.width/2,i=this.height/2;e.beginPath(),e.moveTo(-t,i),e.lineTo(0,-i),e.lineTo(t,i),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-e+" "+t,"0 "+-t,e+" "+t].join(","),'" />']}}),t.Triangle.fromObject=function(e,i){return t.Object._fromObject("Triangle",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=2*Math.PI;t.Ellipse?t.warn("fabric.Ellipse is already defined."):(t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this.set("rx",e&&e.rx||0),this.set("ry",e&&e.ry||0)},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.set("width",2*t);break;case"ry":this.ry=t,this.set("height",2*t)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,i,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),t.Ellipse.fromElement=function(e,i){var n=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,i(new t.Ellipse(n))},t.Ellipse.fromObject=function(e,i){t.Object._fromObject("Ellipse",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend;t.Rect?t.warn("fabric.Rect is already defined"):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,r=this.height,a=-this.width/2,o=-this.height/2,s=0!==t||0!==i,l=.4477152502;e.beginPath(),e.moveTo(a+t,o),e.lineTo(a+n-t,o),s&&e.bezierCurveTo(a+n-l*t,o,a+n,o+l*i,a+n,o+i),e.lineTo(a+n,o+r-i),s&&e.bezierCurveTo(a+n,o+r-l*i,a+n-l*t,o+r,a+n-t,o+r),e.lineTo(a+t,o+r),s&&e.bezierCurveTo(a+l*t,o+r,a,o+r-l*i,a,o+r-i),e.lineTo(a,o+i),s&&e.bezierCurveTo(a,o+l*i,a+l*t,o,a+t,o),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),t.Rect.fromElement=function(e,n,r){if(!e)return n(null);r=r||{};var a=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);a.left=a.left||0,a.top=a.top||0,a.height=a.height||0,a.width=a.width||0;var o=new t.Rect(i(r?t.util.object.clone(r):{},a));o.visible=o.visible&&o.width>0&&o.height>0,n(o)},t.Rect.fromObject=function(e,i){return t.Object._fromObject("Rect",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.array.min,r=t.util.array.max,a=t.util.toFixed;t.Polyline?t.warn("fabric.Polyline is already defined"):(t.Polyline=t.util.createClass(t.Object,{type:"polyline",points:null,cacheProperties:t.Object.prototype.cacheProperties.concat("points"),initialize:function(e,t){t=t||{},this.points=e||[],this.callSuper("initialize",t),this._setPositionDimensions(t)},_setPositionDimensions:function(e){var t,i=this._calcDimensions(e);this.width=i.width,this.height=i.height,e.fromSVG||(t=this.translateToGivenOrigin({x:i.left-this.strokeWidth/2,y:i.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),void 0===e.left&&(this.left=e.fromSVG?i.left:t.x),void 0===e.top&&(this.top=e.fromSVG?i.top:t.y),this.pathOffset={x:i.left+this.width/2,y:i.top+this.height/2}},_calcDimensions:function(){var e=this.points,t=n(e,"x")||0,i=n(e,"y")||0;return{left:t,top:i,width:(r(e,"x")||0)-t,height:(r(e,"y")||0)-i}},toObject:function(e){return i(this.callSuper("toObject",e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],i=this.pathOffset.x,n=this.pathOffset.y,r=t.Object.NUM_FRACTION_DIGITS,o=0,s=this.points.length;o<s;o++)e.push(a(this.points[o].x-i,r),",",a(this.points[o].y-n,r)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',e.join(""),'" />\n']},commonRender:function(e){var t,i=this.points.length,n=this.pathOffset.x,r=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-n,this.points[0].y-r);for(var a=0;a<i;a++)t=this.points[a],e.lineTo(t.x-n,t.y-r);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get("points").length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(n,r,a){if(!n)return r(null);a||(a={});var o=t.parsePointsAttribute(n.getAttribute("points")),s=t.parseAttributes(n,t[e].ATTRIBUTE_NAMES);s.fromSVG=!0,r(new t[e](o,i(s,a)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator("Polyline"),t.Polyline.fromObject=function(e,i){return t.Object._fromObject("Polyline",e,i,"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Polygon?t.warn("fabric.Polygon is already defined"):(t.Polygon=t.util.createClass(t.Polyline,{type:"polygon",_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator("Polygon"),t.Polygon.fromObject=function(e,i){t.Object._fromObject("Polygon",e,i,"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.array.min,n=t.util.array.max,r=t.util.object.extend,a=Object.prototype.toString,o=t.util.toFixed;t.Path?t.warn("fabric.Path is already defined"):(t.Path=t.util.createClass(t.Object,{type:"path",path:null,cacheProperties:t.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:t.Object.prototype.stateProperties.concat("path"),initialize:function(e,i){i=i||{},this.callSuper("initialize",i),e||(e=[]);var n="[object Array]"===a.call(e);this.path=t.util.makePathSimpler(n?e:t.util.parsePath(e)),this.path&&t.Polyline.prototype._setPositionDimensions.call(this,i)},_renderPathCommands:function(e){var t,i=0,n=0,r=0,a=0,o=0,s=0,l=-this.pathOffset.x,c=-this.pathOffset.y;e.beginPath();for(var h=0,u=this.path.length;h<u;++h)switch((t=this.path[h])[0]){case"L":r=t[1],a=t[2],e.lineTo(r+l,a+c);break;case"M":i=r=t[1],n=a=t[2],e.moveTo(r+l,a+c);break;case"C":r=t[5],a=t[6],o=t[3],s=t[4],e.bezierCurveTo(t[1]+l,t[2]+c,o+l,s+c,r+l,a+c);break;case"Q":e.quadraticCurveTo(t[1]+l,t[2]+c,t[3]+l,t[4]+c),r=t[3],a=t[4],o=t[1],s=t[2];break;case"z":case"Z":r=i,a=n,e.closePath()}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(e){return r(this.callSuper("toObject",e),{path:this.path.map((function(e){return e.slice()}))})},toDatalessObject:function(e){var t=this.toObject(["sourcePath"].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',t.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return" translate("+o(-this.pathOffset.x,e)+", "+o(-this.pathOffset.y,e)+")"},toClipPathSVG:function(e){var t=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,r,a=[],o=[],s=0,l=0,c=0,h=0,u=0,f=this.path.length;u<f;++u){switch((e=this.path[u])[0]){case"L":c=e[1],h=e[2],r=[];break;case"M":s=c=e[1],l=h=e[2],r=[];break;case"C":r=t.util.getBoundsOfCurve(c,h,e[1],e[2],e[3],e[4],e[5],e[6]),c=e[5],h=e[6];break;case"Q":r=t.util.getBoundsOfCurve(c,h,e[1],e[2],e[1],e[2],e[3],e[4]),c=e[3],h=e[4];break;case"z":case"Z":c=s,h=l}r.forEach((function(e){a.push(e.x),o.push(e.y)})),a.push(c),o.push(h)}var d=i(a)||0,m=i(o)||0;return{left:d,top:m,width:(n(a)||0)-d,height:(n(o)||0)-m}}}),t.Path.fromObject=function(e,i){if("string"==typeof e.sourcePath){var n=e.sourcePath;t.loadSVGFromURL(n,(function(t){var n=t[0];n.setOptions(e),i&&i(n)}))}else t.Object._fromObject("Path",e,i,"path")},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(["d"]),t.Path.fromElement=function(e,i,n){var a=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);a.fromSVG=!0,i(new t.Path(a.d,r(a,n)))})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.array.min,n=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,i){t=t||{},this._objects=[],i&&this.callSuper("initialize",t),this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(i)this._updateObjectsACoords();else{var r=t&&t.centerPoint;void 0!==t.originX&&(this.originX=t.originX),void 0!==t.originY&&(this.originY=t.originY),r||this._calcBounds(),this._updateObjectsCoords(r),delete t.centerPoint,this.callSuper("initialize",t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=this._objects.length;e--;)this._objects[e].setCoords(!0)},_updateObjectsCoords:function(e){e=e||this.getCenterPoint();for(var t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var i=e.left,n=e.top;e.set({left:i-t.x,top:n-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(e){var i=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(i&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,i?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,i){var n=this._objects.length;if(this.useSetOnGroup)for(;n--;)this._objects[n].setOnGroup(e,i);if("canvas"===e)for(;n--;)this._objects[n]._set(e,i);t.Object.prototype._set.call(this,e,i)},toObject:function(e){var i=this.includeDefaultValues,n=this._objects.filter((function(e){return!e.excludeFromExport})).map((function(t){var n=t.includeDefaultValues;t.includeDefaultValues=i;var r=t.toObject(e);return t.includeDefaultValues=n,r})),r=t.Object.prototype.toObject.call(this,e);return r.objects=n,r},toDatalessObject:function(e){var i,n=this.sourcePath;if(n)i=n;else{var r=this.includeDefaultValues;i=this._objects.map((function(t){var i=t.includeDefaultValues;t.includeDefaultValues=r;var n=t.toDatalessObject(e);return t.includeDefaultValues=i,n}))}var a=t.Object.prototype.toDatalessObject.call(this,e);return a.objects=i,a},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e)for(var i=0,n=this._objects.length;i<n;i++)if(this._objects[i].willDrawShadow())return this.ownCaching=!1,!1;return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,i=this._objects.length;t<i;t++)this._objects[t].render(e);this._drawClipPath(e)},isCacheDirty:function(e){if(this.callSuper("isCacheDirty",e))return!0;if(!this.statefullCache)return!1;for(var t=0,i=this._objects.length;t<i;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var n=this.cacheWidth/this.zoomX,r=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-n/2,-r/2,n,r)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach((function(i){t.util.addTransformToObject(i,e),delete i.group,i.setCoords()})),this},realizeTransform:function(e,i){return t.util.addTransformToObject(e,i),e},destroy:function(){return this._objects.forEach((function(e){e.set("dirty",!0)})),this._restoreObjectsState()},toActiveSelection:function(){if(this.canvas){var e=this._objects,i=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var r=new t.ActiveSelection([]);return r.set(n),r.type="activeSelection",i.remove(this),e.forEach((function(e){e.group=r,e.dirty=!0,i.add(e)})),r.canvas=i,r._objects=e,i._activeObject=r,r.setCoords(),r}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject((function(e){e.setCoords(!0)})),this},_calcBounds:function(e){for(var t,i,n,r,a=[],o=[],s=["tr","br","bl","tl"],l=0,c=this._objects.length,h=s.length;l<c;++l){for(n=(t=this._objects[l]).calcACoords(),r=0;r<h;r++)i=s[r],a.push(n[i].x),o.push(n[i].y);t.aCoords=n}this._getBounds(a,o,e)},_getBounds:function(e,r,a){var o=new t.Point(i(e),i(r)),s=new t.Point(n(e),n(r)),l=o.y||0,c=o.x||0,h=s.x-o.x||0,u=s.y-o.y||0;this.width=h,this.height=u,a||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(e){for(var t=["<g ","COMMON_PARTS"," >\n"],i=0,n=this._objects.length;i<n;i++)t.push("\t\t",this._objects[i].toSVG(e));return t.push("</g>\n"),t},getSvgStyles:function(){var e=void 0!==this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",t=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),t].join("")},toClipPathSVG:function(e){for(var t=[],i=0,n=this._objects.length;i<n;i++)t.push("\t",this._objects[i].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,i){var n=e.objects,r=t.util.object.clone(e,!0);delete r.objects,"string"!=typeof n?t.util.enlivenObjects(n,(function(n){t.util.enlivenObjects([e.clipPath],(function(r){var a=t.util.object.clone(e,!0);a.clipPath=r[0],delete a.objects,i&&i(new t.Group(n,a,!0))}))})):t.loadSVGFromURL(n,(function(a){var o=t.util.groupSVGElements(a,e,n);o.set(r),i&&i(o)}))})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:"activeSelection",initialize:function(e,i){i=i||{},this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;i.originX&&(this.originX=i.originX),i.originY&&(this.originY=i.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,i),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var i=t.Object.prototype.toObject.call(this),n=new t.Group([]);if(delete i.type,n.set(i),e.forEach((function(e){e.canvas.remove(e),e.group=n})),n._objects=e,!this.canvas)return n;var r=this.canvas;return r.add(n),r._activeObject=n,n.setCoords(),n},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,i){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",e,t),void 0===(i=i||{}).hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var n=0,r=this._objects.length;n<r;n++)this._objects[n]._renderControls(e,i);e.restore()}}),t.ActiveSelection.fromObject=function(e,i){t.util.enlivenObjects(e.objects,(function(n){delete e.objects,i&&i(new t.ActiveSelection(n,e,!0))}))})}(t),function(e){"use strict";var t=_.util.object.extend;e.fabric||(e.fabric={}),e.fabric.Image?_.warn("fabric.Image is already defined."):(_.Image=_.util.createClass(_.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:_.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:_.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,t){t||(t={}),this.filters=[],this.cacheKey="texture"+_.Object.__uid++,this.callSuper("initialize",t),this._initElement(e,t)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=e,this._originalElement=e,this._initConfig(t),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var t=_.filterBackend;t&&t.evictCachesForKey&&t.evictCachesForKey(e)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(e){_.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(this.stroke&&0!==this.strokeWidth){var t=this.width/2,i=this.height/2;e.beginPath(),e.moveTo(-t,-i),e.lineTo(t,-i),e.lineTo(t,i),e.lineTo(-t,i),e.lineTo(-t,-i),e.closePath()}},toObject:function(e){var i=[];this.filters.forEach((function(e){e&&i.push(e.toObject())}));var n=t(this.callSuper("toObject",["cropX","cropY"].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:i});return this.resizeFilter&&(n.resizeFilter=this.resizeFilter.toObject()),n},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e,t=[],i=[],n=this._element,r=-this.width/2,a=-this.height/2,o="",s="";if(!n)return[];if(this.hasCrop()){var l=_.Object.__uid++;t.push('<clipPath id="imageCrop_'+l+'">\n','\t<rect x="'+r+'" y="'+a+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),o=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(s='" image-rendering="optimizeSpeed'),i.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',r-this.cropX,'" y="',a-this.cropY,'" width="',n.width||n.naturalWidth,'" height="',n.height||n.height,s,'"',o,"></image>\n"),this.stroke||this.strokeDashArray){var c=this.fill;this.fill=null,e=["\t<rect ",'x="',r,'" y="',a,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=c}return t="fill"!==this.paintFirst?t.concat(e,i):t.concat(i,e)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(e,t,i){return _.util.loadImage(e,(function(e,n){this.setElement(e,i),this._setWidthHeight(),t&&t(this,n)}),this,i&&i.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var e=this.resizeFilter,t=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),n=i.scaleX,r=i.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!e||n>t&&r>t)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=n,void(this._lastScaleY=r);_.filterBackend||(_.filterBackend=_.initFilterBackend());var o=_.util.createCanvasElement(),s=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=a.width,c=a.height;o.width=l,o.height=c,this._element=o,this._lastScaleX=e.scaleX=n,this._lastScaleY=e.scaleY=r,_.filterBackend.applyFilters([e],a,l,c,this._element,s),this._filterScalingX=o.width/this._originalElement.width,this._filterScalingY=o.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter((function(e){return e&&!e.isNeutralState()})),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===e.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var t=this._originalElement,i=t.naturalWidth||t.width,n=t.naturalHeight||t.height;if(this._element===this._originalElement){var r=_.util.createCanvasElement();r.width=i,r.height=n,this._element=r,this._filteredEl=r}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,i,n),this._lastScaleX=1,this._lastScaleY=1;return _.filterBackend||(_.filterBackend=_.initFilterBackend()),_.filterBackend.applyFilters(e,this._originalElement,i,n,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){_.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){_.util.setImageSmoothing(e,this.imageSmoothing),_.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var i=this._filterScalingX,n=this._filterScalingY,r=this.width,a=this.height,o=Math.min,s=Math.max,l=s(this.cropX,0),c=s(this.cropY,0),h=t.naturalWidth||t.width,u=t.naturalHeight||t.height,f=l*i,d=c*n,m=o(r*i,h-f),g=o(a*n,u-d),v=-r/2,p=-a/2,y=o(r,h/i-l),b=o(a,u/n-c);t&&e.drawImage(t,f,d,m,g,v,p,y,b)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,t){this.setElement(_.util.getById(e),t),_.util.addClass(this.getElement(),_.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,t){e&&e.length?_.util.enlivenObjects(e,(function(e){t&&t(e)}),"fabric.Image.filters"):t&&t()},_setWidthHeight:function(e){e||(e={});var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,t=_.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,n=this._element.height,r=1,a=1,o=0,s=0,l=0,c=0,h=this.width,u=this.height,f={width:h,height:u};return!t||"none"===t.alignX&&"none"===t.alignY?(r=h/i,a=u/n):("meet"===t.meetOrSlice&&(e=(h-i*(r=a=_.util.findScaleToFit(this._element,f)))/2,"Min"===t.alignX&&(o=-e),"Max"===t.alignX&&(o=e),e=(u-n*a)/2,"Min"===t.alignY&&(s=-e),"Max"===t.alignY&&(s=e)),"slice"===t.meetOrSlice&&(e=i-h/(r=a=_.util.findScaleToCover(this._element,f)),"Mid"===t.alignX&&(l=e/2),"Max"===t.alignX&&(l=e),e=n-u/a,"Mid"===t.alignY&&(c=e/2),"Max"===t.alignY&&(c=e),i=h/r,n=u/a)),{width:i,height:n,scaleX:r,scaleY:a,offsetLeft:o,offsetTop:s,cropX:l,cropY:c}}}),_.Image.CSS_CANVAS="canvas-img",_.Image.prototype.getSvgSrc=_.Image.prototype.getSrc,_.Image.fromObject=function(e,t){var i=_.util.object.clone(e);_.util.loadImage(i.src,(function(e,n){n?t&&t(null,!0):_.Image.prototype._initFilters.call(i,i.filters,(function(n){i.filters=n||[],_.Image.prototype._initFilters.call(i,[i.resizeFilter],(function(n){i.resizeFilter=n[0],_.util.enlivenObjects([i.clipPath],(function(n){i.clipPath=n[0];var r=new _.Image(e,i);t(r,!1)}))}))}))}),null,i.crossOrigin)},_.Image.fromURL=function(e,t,i){_.util.loadImage(e,(function(e,n){t&&t(new _.Image(e,i),n)}),null,i&&i.crossOrigin)},_.Image.ATTRIBUTE_NAMES=_.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),_.Image.fromElement=function(e,i,n){var r=_.parseAttributes(e,_.Image.ATTRIBUTE_NAMES);_.Image.fromURL(r["xlink:href"],i,t(n?_.util.object.clone(n):{},r))})}(t),_.util.object.extend(_.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(e){var t=function(){},i=(e=e||{}).onComplete||t,n=e.onChange||t,r=this;return _.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){r.rotate(e),n()},onComplete:function(){r.setCoords(),i()}}),this}}),_.util.object.extend(_.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function e(e,t){var i="precision "+t+" float;\nvoid main(){}",n=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(n,i),e.compileShader(n),!!e.getShaderParameter(n,e.COMPILE_STATUS)}function t(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}_.isWebglSupported=function(t){if(_.isLikelyNode)return!1;t=t||_.WebglFilterBackend.prototype.tileSize;var i=document.createElement("canvas"),n=i.getContext("webgl")||i.getContext("experimental-webgl"),r=!1;if(n){_.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),r=_.maxTextureSize>=t;for(var a=["highp","mediump","lowp"],o=0;o<3;o++)if(e(n,a[o])){_.webGlPrecision=a[o];break}}return this.isSupported=r,r},_.WebglFilterBackend=t,t.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,t){var i,n=void 0!==window.performance;try{new ImageData(1,1),i=!0}catch(e){i=!1}var r="undefined"!=typeof ArrayBuffer,a="undefined"!=typeof Uint8ClampedArray;if(n&&i&&r&&a){var o=_.util.createCanvasElement(),s=new ArrayBuffer(e*t*4);if(_.forceGLPutImageData)return this.imageBuffer=s,void(this.copyGLTo2D=E);var l,c,h={imageBuffer:s,destinationWidth:e,destinationHeight:t,targetCanvas:o};o.width=e,o.height=t,l=window.performance.now(),O.call(h,this.gl,h),c=window.performance.now()-l,l=window.performance.now(),E.call(h,this.gl,h),c>window.performance.now()-l?(this.imageBuffer=s,this.copyGLTo2D=E):this.copyGLTo2D=O}},createWebGLCanvas:function(e,t){var i=_.util.createCanvasElement();i.width=e,i.height=t;var n={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},r=i.getContext("webgl",n);r||(r=i.getContext("experimental-webgl",n)),r&&(r.clearColor(0,0,0,0),this.canvas=i,this.gl=r)},applyFilters:function(e,t,i,n,r,a){var o,s=this.gl;a&&(o=this.getCachedTexture(a,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:i,sourceHeight:n,destinationWidth:i,destinationHeight:n,context:s,sourceTexture:this.createTexture(s,i,n,!o&&t),targetTexture:this.createTexture(s,i,n),originalTexture:o||this.createTexture(s,i,n,!o&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},c=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,c),e.forEach((function(e){e&&e.applyTo(l)})),function(e){var t=e.targetCanvas,i=t.width,n=t.height,r=e.destinationWidth,a=e.destinationHeight;i===r&&n===a||(t.width=r,t.height=a)}(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(c),r.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,i,n){var r=e.createTexture();return e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,i,0,e.RGBA,e.UNSIGNED_BYTE,null),r},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var i=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=i,i},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:O,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:"",vendor:""};if(!e)return t;var i=e.getExtension("WEBGL_debug_renderer_info");if(i){var n=e.getParameter(i.UNMASKED_RENDERER_WEBGL),r=e.getParameter(i.UNMASKED_VENDOR_WEBGL);n&&(t.renderer=n.toLowerCase()),r&&(t.vendor=r.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){"use strict";var e=function(){};function t(){}_.Canvas2dFilterBackend=t,t.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,i,n,r){var a=r.getContext("2d");a.drawImage(t,0,0,i,n);var o={sourceWidth:i,sourceHeight:n,imageData:a.getImageData(0,0,i,n),originalEl:t,originalImageData:a.getImageData(0,0,i,n),canvasEl:r,ctx:a,filterBackend:this};return e.forEach((function(e){e.applyTo(o)})),o.imageData.width===i&&o.imageData.height===n||(r.width=o.imageData.width,r.height=o.imageData.height),a.putImageData(o.imageData,0,0),o}}}(),_.Image=_.Image||{},_.Image.filters=_.Image.filters||{},_.Image.filters.BaseFilter=_.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,t,i){t=t||this.fragmentSource,i=i||this.vertexSource,"highp"!==_.webGlPrecision&&(t=t.replace(/precision highp float/g,"precision "+_.webGlPrecision+" float"));var n=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(n,i),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+e.getShaderInfoLog(n));var r=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+e.getShaderInfoLog(r));var a=e.createProgram();if(e.attachShader(a,n),e.attachShader(a,r),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(a));var o=this.getAttributeLocations(e,a),s=this.getUniformLocations(e,a)||{};return s.uStepW=e.getUniformLocation(a,"uStepW"),s.uStepH=e.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:o,uniformLocations:s}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,i){var n=t.aPosition,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,i,n=e.context;e.passes>1?(t=e.destinationWidth,i=e.destinationHeight,e.sourceWidth===t&&e.sourceHeight===i||(n.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(n,t,i)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,t=_.Image.filters[this.type].prototype;if(e){if(Array.isArray(t[e])){for(var i=t[e].length;i--;)if(this[e][i]!==t[e][i])return!1;return!0}return t[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,i=this.retrieveShader(e);0===e.pass&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(i.program),this.sendAttributeData(t,i.attributeLocations,e.aPosition),t.uniform1f(i.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(i.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,i.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,i){e.activeTexture(i),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement("canvas");t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),_.Image.filters.BaseFilter.fromObject=function(e,t){var i=new _.Image.filters[e.type](e);return t&&t(i),i},function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.ColorMatrix=n(i.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,i,n,r,a,o=e.imageData.data,s=o.length,l=this.matrix,c=this.colorsOnly;for(a=0;a<s;a+=4)t=o[a],i=o[a+1],n=o[a+2],c?(o[a]=t*l[0]+i*l[1]+n*l[2]+255*l[4],o[a+1]=t*l[5]+i*l[6]+n*l[7]+255*l[9],o[a+2]=t*l[10]+i*l[11]+n*l[12]+255*l[14]):(r=o[a+3],o[a]=t*l[0]+i*l[1]+n*l[2]+r*l[3]+255*l[4],o[a+1]=t*l[5]+i*l[6]+n*l[7]+r*l[8]+255*l[9],o[a+2]=t*l[10]+i*l[11]+n*l[12]+r*l[13]+255*l[14],o[a+3]=t*l[15]+i*l[16]+n*l[17]+r*l[18]+255*l[19])},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,"uColorMatrix"),uConstants:e.getUniformLocation(t,"uConstants")}},sendUniformData:function(e,t){var i=this.matrix,n=[i[0],i[1],i[2],i[3],i[5],i[6],i[7],i[8],i[10],i[11],i[12],i[13],i[15],i[16],i[17],i[18]],r=[i[4],i[9],i[14],i[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,n),e.uniform4fv(t.uConstants,r)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Brightness=n(i.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(e){if(0!==this.brightness){var t,i=e.imageData.data,n=i.length,r=Math.round(255*this.brightness);for(t=0;t<n;t+=4)i[t]=i[t]+r,i[t+1]=i[t+1]+r,i[t+2]=i[t+2]+r}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,"uBrightness")}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.Image.filters,r=t.util.createClass;n.Convolute=r(n.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),i=this.type+"_"+t+"_"+(this.opaque?1:0),n=this.fragmentSource[i];return e.programCache.hasOwnProperty(i)||(e.programCache[i]=this.createProgram(e.context,n)),e.programCache[i]},applyTo2d:function(e){var t,i,n,r,a,o,s,l,c,h,u,f,d,m=e.imageData,g=m.data,v=this.matrix,p=Math.round(Math.sqrt(v.length)),y=Math.floor(p/2),b=m.width,w=m.height,x=e.ctx.createImageData(b,w),k=x.data,C=this.opaque?1:0;for(u=0;u<w;u++)for(h=0;h<b;h++){for(a=4*(u*b+h),t=0,i=0,n=0,r=0,d=0;d<p;d++)for(f=0;f<p;f++)o=h+f-y,(s=u+d-y)<0||s>=w||o<0||o>=b||(l=4*(s*b+o),c=v[d*p+f],t+=g[l]*c,i+=g[l+1]*c,n+=g[l+2]*c,C||(r+=g[l+3]*c));k[a]=t,k[a+1]=i,k[a+2]=n,k[a+3]=C?g[a+3]:r}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,"uMatrix"),uOpaque:e.getUniformLocation(t,"uOpaque"),uHalfSize:e.getUniformLocation(t,"uHalfSize"),uSize:e.getUniformLocation(t,"uSize")}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return i(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Grayscale=n(i.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(e){var t,i,n=e.imageData.data,r=n.length,a=this.mode;for(t=0;t<r;t+=4)"average"===a?i=(n[t]+n[t+1]+n[t+2])/3:"lightness"===a?i=(Math.min(n[t],n[t+1],n[t+2])+Math.max(n[t],n[t+1],n[t+2]))/2:"luminosity"===a&&(i=.21*n[t]+.72*n[t+1]+.07*n[t+2]),n[t]=i,n[t+1]=i,n[t+2]=i},retrieveShader:function(e){var t=this.type+"_"+this.mode;if(!e.programCache.hasOwnProperty(t)){var i=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,i)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,"uMode")}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Invert=n(i.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(e){var t,i=e.imageData.data,n=i.length;for(t=0;t<n;t+=4)i[t]=255-i[t],i[t+1]=255-i[t+1],i[t+2]=255-i[t+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,"uInvert")}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.Image.filters,r=t.util.createClass;n.Noise=r(n.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(e){if(0!==this.noise){var t,i,n=e.imageData.data,r=n.length,a=this.noise;for(t=0,r=n.length;t<r;t+=4)i=(.5-Math.random())*a,n[t]+=i,n[t+1]+=i,n[t+2]+=i}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,"uNoise"),uSeed:e.getUniformLocation(t,"uSeed")}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return i(this.callSuper("toObject"),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Pixelate=n(i.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(e){var t,i,n,r,a,o,s,l,c,h,u,f=e.imageData,d=f.data,m=f.height,g=f.width;for(i=0;i<m;i+=this.blocksize)for(n=0;n<g;n+=this.blocksize)for(r=d[t=4*i*g+4*n],a=d[t+1],o=d[t+2],s=d[t+3],h=Math.min(i+this.blocksize,m),u=Math.min(n+this.blocksize,g),l=i;l<h;l++)for(c=n;c<u;c++)d[t=4*l*g+4*c]=r,d[t+1]=a,d[t+2]=o,d[t+3]=s},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,"uBlocksize"),uStepW:e.getUniformLocation(t,"uStepW"),uStepH:e.getUniformLocation(t,"uStepH")}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.Image.filters,r=t.util.createClass;n.RemoveColor=r(n.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(e){var i,n,r,a,o=e.imageData.data,s=255*this.distance,l=new t.Color(this.color).getSource(),c=[l[0]-s,l[1]-s,l[2]-s],h=[l[0]+s,l[1]+s,l[2]+s];for(i=0;i<o.length;i+=4)n=o[i],r=o[i+1],a=o[i+2],n>c[0]&&r>c[1]&&a>c[2]&&n<h[0]&&r<h[1]&&a<h[2]&&(o[i+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,"uLow"),uHigh:e.getUniformLocation(t,"uHigh")}},sendUniformData:function(e,i){var n=new t.Color(this.color).getSource(),r=parseFloat(this.distance),a=[0+n[0]/255-r,0+n[1]/255-r,0+n[2]/255-r,1],o=[n[0]/255+r,n[1]/255+r,n[2]/255+r,1];e.uniform4fv(i.uLow,a),e.uniform4fv(i.uHigh,o)},toObject:function(){return i(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass,r={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var a in r)i[a]=n(i.ColorMatrix,{type:a,matrix:r[a],mainParameter:!1,colorsOnly:!0}),t.Image.filters[a].fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric,i=t.Image.filters,n=t.util.createClass;i.BlendColor=n(i.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(e){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[e]+"}\n}"},retrieveShader:function(e){var t,i=this.type+"_"+this.mode;return e.programCache.hasOwnProperty(i)||(t=this.buildSource(this.mode),e.programCache[i]=this.createProgram(e.context,t)),e.programCache[i]},applyTo2d:function(e){var i,n,r,a,o,s,l,c=e.imageData.data,h=c.length,u=1-this.alpha;i=(l=new t.Color(this.color).getSource())[0]*this.alpha,n=l[1]*this.alpha,r=l[2]*this.alpha;for(var f=0;f<h;f+=4)switch(a=c[f],o=c[f+1],s=c[f+2],this.mode){case"multiply":c[f]=a*i/255,c[f+1]=o*n/255,c[f+2]=s*r/255;break;case"screen":c[f]=255-(255-a)*(255-i)/255,c[f+1]=255-(255-o)*(255-n)/255,c[f+2]=255-(255-s)*(255-r)/255;break;case"add":c[f]=a+i,c[f+1]=o+n,c[f+2]=s+r;break;case"diff":case"difference":c[f]=Math.abs(a-i),c[f+1]=Math.abs(o-n),c[f+2]=Math.abs(s-r);break;case"subtract":c[f]=a-i,c[f+1]=o-n,c[f+2]=s-r;break;case"darken":c[f]=Math.min(a,i),c[f+1]=Math.min(o,n),c[f+2]=Math.min(s,r);break;case"lighten":c[f]=Math.max(a,i),c[f+1]=Math.max(o,n),c[f+2]=Math.max(s,r);break;case"overlay":c[f]=i<128?2*a*i/255:255-2*(255-a)*(255-i)/255,c[f+1]=n<128?2*o*n/255:255-2*(255-o)*(255-n)/255,c[f+2]=r<128?2*s*r/255:255-2*(255-s)*(255-r)/255;break;case"exclusion":c[f]=i+a-2*i*a/255,c[f+1]=n+o-2*n*o/255,c[f+2]=r+s-2*r*s/255;break;case"tint":c[f]=i+a*u,c[f+1]=n+o*u,c[f+2]=r+s*u}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,"uColor")}},sendUniformData:function(e,i){var n=new t.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,e.uniform4fv(i.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric,i=t.Image.filters,n=t.util.createClass;i.BlendImage=n(i.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(e){var t=this.type+"_"+this.mode,i=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,i)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,i=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,i,t.TEXTURE1),this.callSuper("applyToWebGL",e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,i=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/i,1]},applyTo2d:function(e){var i,n,r,a,o,s,l,c,h,u,f,d=e.imageData,m=e.filterBackend.resources,g=d.data,v=g.length,p=d.width,y=d.height,b=this.image;m.blendImage||(m.blendImage=t.util.createCanvasElement()),u=(h=m.blendImage).getContext("2d"),h.width!==p||h.height!==y?(h.width=p,h.height=y):u.clearRect(0,0,p,y),u.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),u.drawImage(b._element,0,0,p,y),f=u.getImageData(0,0,p,y).data;for(var w=0;w<v;w+=4)switch(o=g[w],s=g[w+1],l=g[w+2],c=g[w+3],i=f[w],n=f[w+1],r=f[w+2],a=f[w+3],this.mode){case"multiply":g[w]=o*i/255,g[w+1]=s*n/255,g[w+2]=l*r/255,g[w+3]=c*a/255;break;case"mask":g[w+3]=a}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,"uTransformMatrix"),uImage:e.getUniformLocation(t,"uImage")}},sendUniformData:function(e,t){var i=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,i)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,i){t.Image.fromObject(e.image,(function(n){var r=t.util.object.clone(e);r.image=n,i(new t.Image.filters.BlendImage(r))}))}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=Math.pow,n=Math.floor,r=Math.sqrt,a=Math.abs,o=Math.round,s=Math.sin,l=Math.ceil,c=t.Image.filters,h=t.util.createClass;c.Resize=h(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,"uDelta"),uTaps:e.getUniformLocation(t,"uTaps")}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),i=this.type+"_"+t;if(!e.programCache.hasOwnProperty(i)){var n=this.generateShader(t);e.programCache[i]=this.createProgram(e.context,n)}return e.programCache[i]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,i=this.getFilterWindow(),n=new Array(i),r=1;r<=i;r++)n[r-1]=e(r*t);return n},generateShader:function(e){for(var t=new Array(e),i=this.fragmentSourceTOP,n=1;n<=e;n++)t[n-1]=n+".0 * uDelta";return i+="uniform float uTaps["+e+"];\n",i+="void main() {\n",i+=" vec4 color = texture2D(uTexture, vTexCoord);\n",i+=" float sum = 1.0;\n",t.forEach((function(e,t){i+=" color += texture2D(uTexture, vTexCoord + "+e+") * uTaps["+t+"];\n",i+=" color += texture2D(uTexture, vTexCoord - "+e+") * uTaps["+t+"];\n",i+=" sum += 2.0 * uTaps["+t+"];\n"})),i+=" gl_FragColor = color / sum;\n",i+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var i=(t*=Math.PI)/e;return s(t)/t*s(i)/i}},applyTo2d:function(e){var t=e.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;var r,a=t.width,s=t.height,l=o(a*i),c=o(s*n);"sliceHack"===this.resizeType?r=this.sliceByTwo(e,a,s,l,c):"hermite"===this.resizeType?r=this.hermiteFastResize(e,a,s,l,c):"bilinear"===this.resizeType?r=this.bilinearFiltering(e,a,s,l,c):"lanczos"===this.resizeType&&(r=this.lanczosResize(e,a,s,l,c)),e.imageData=r},sliceByTwo:function(e,i,r,a,o){var s,l,c=e.imageData,h=!1,u=!1,f=.5*i,d=.5*r,m=t.filterBackend.resources,g=0,v=0,p=i,y=0;for(m.sliceByTwo||(m.sliceByTwo=document.createElement("canvas")),((s=m.sliceByTwo).width<1.5*i||s.height<r)&&(s.width=1.5*i,s.height=r),(l=s.getContext("2d")).clearRect(0,0,1.5*i,r),l.putImageData(c,0,0),a=n(a),o=n(o);!h||!u;)i=f,r=d,a<n(.5*f)?f=n(.5*f):(f=a,h=!0),o<n(.5*d)?d=n(.5*d):(d=o,u=!0),l.drawImage(s,g,v,i,r,p,y,f,d),g=p,v=y,y+=d;return l.getImageData(g,v,a,o)},lanczosResize:function(e,t,o,s,c){var h=e.imageData.data,u=e.ctx.createImageData(s,c),f=u.data,d=this.lanczosCreate(this.lanczosLobes),m=this.rcpScaleX,g=this.rcpScaleY,v=2/this.rcpScaleX,p=2/this.rcpScaleY,y=l(m*this.lanczosLobes/2),b=l(g*this.lanczosLobes/2),w={},x={},k={};return function e(l){var C,S,_,T,O,E,R,I,A,D,P;for(x.x=(l+.5)*m,k.x=n(x.x),C=0;C<c;C++){for(x.y=(C+.5)*g,k.y=n(x.y),O=0,E=0,R=0,I=0,A=0,S=k.x-y;S<=k.x+y;S++)if(!(S<0||S>=t)){D=n(1e3*a(S-x.x)),w[D]||(w[D]={});for(var F=k.y-b;F<=k.y+b;F++)F<0||F>=o||(P=n(1e3*a(F-x.y)),w[D][P]||(w[D][P]=d(r(i(D*v,2)+i(P*p,2))/1e3)),(_=w[D][P])>0&&(O+=_,E+=_*h[T=4*(F*t+S)],R+=_*h[T+1],I+=_*h[T+2],A+=_*h[T+3]))}f[T=4*(C*s+l)]=E/O,f[T+1]=R/O,f[T+2]=I/O,f[T+3]=A/O}return++l<s?e(l):u}(0)},bilinearFiltering:function(e,t,i,r,a){var o,s,l,c,h,u,f,d,m,g=0,v=this.rcpScaleX,p=this.rcpScaleY,y=4*(t-1),b=e.imageData.data,w=e.ctx.createImageData(r,a),x=w.data;for(l=0;l<a;l++)for(c=0;c<r;c++)for(h=v*c-(o=n(v*c)),u=p*l-(s=n(p*l)),m=4*(s*t+o),f=0;f<4;f++)d=b[m+f]*(1-h)*(1-u)+b[m+4+f]*h*(1-u)+b[m+y+f]*u*(1-h)+b[m+y+4+f]*h*u,x[g++]=d;return w},hermiteFastResize:function(e,t,i,o,s){for(var c=this.rcpScaleX,h=this.rcpScaleY,u=l(c/2),f=l(h/2),d=e.imageData.data,m=e.ctx.createImageData(o,s),g=m.data,v=0;v<s;v++)for(var p=0;p<o;p++){for(var y=4*(p+v*o),b=0,w=0,x=0,k=0,C=0,S=0,_=0,T=(v+.5)*h,O=n(v*h);O<(v+1)*h;O++)for(var E=a(T-(O+.5))/f,R=(p+.5)*c,I=E*E,A=n(p*c);A<(p+1)*c;A++){var D=a(R-(A+.5))/u,P=r(I+D*D);P>1&&P<-1||(b=2*P*P*P-3*P*P+1)>0&&(_+=b*d[(D=4*(A+O*t))+3],x+=b,d[D+3]<255&&(b=b*d[D+3]/250),k+=b*d[D],C+=b*d[D+1],S+=b*d[D+2],w+=b)}g[y]=k/w,g[y+1]=C/w,g[y+2]=S/w,g[y+3]=_/x}return m},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Contrast=n(i.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(0!==this.contrast){var t,i=e.imageData.data,n=i.length,r=Math.floor(255*this.contrast),a=259*(r+255)/(255*(259-r));for(t=0;t<n;t+=4)i[t]=a*(i[t]-128)+128,i[t+1]=a*(i[t+1]-128)+128,i[t+2]=a*(i[t+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,"uContrast")}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Saturation=n(i.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(e){if(0!==this.saturation){var t,i,n=e.imageData.data,r=n.length,a=-this.saturation;for(t=0;t<r;t+=4)i=Math.max(n[t],n[t+1],n[t+2]),n[t]+=i!==n[t]?(i-n[t])*a:0,n[t+1]+=i!==n[t+1]?(i-n[t+1])*a:0,n[t+2]+=i!==n[t+2]?(i-n[t+2])*a:0}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,"uSaturation")}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Vibrance=n(i.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(e){if(0!==this.vibrance){var t,i,n,r,a=e.imageData.data,o=a.length,s=-this.vibrance;for(t=0;t<o;t+=4)i=Math.max(a[t],a[t+1],a[t+2]),n=(a[t]+a[t+1]+a[t+2])/3,r=2*Math.abs(i-n)/255*s,a[t]+=i!==a[t]?(i-a[t])*r:0,a[t+1]+=i!==a[t+1]?(i-a[t+1])*r:0,a[t+2]+=i!==a[t+2]?(i-a[t+2])*r:0}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,"uVibrance")}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Blur=n(i.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var i,n,r=e.filterBackend.resources,a=e.imageData.width,o=e.imageData.height;r.blurLayer1||(r.blurLayer1=t.util.createCanvasElement(),r.blurLayer2=t.util.createCanvasElement()),i=r.blurLayer1,n=r.blurLayer2,i.width===a&&i.height===o||(n.width=i.width=a,n.height=i.height=o);var s,l,c,h,u=i.getContext("2d"),f=n.getContext("2d"),d=.06*this.blur*.5;for(u.putImageData(e.imageData,0,0),f.clearRect(0,0,a,o),h=-15;h<=15;h++)c=d*(l=h/15)*a+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,c,s),u.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);for(h=-15;h<=15;h++)c=d*(l=h/15)*o+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,s,c),u.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);e.ctx.drawImage(i,0,0);var m=e.ctx.getImageData(0,0,i.width,i.height);return u.globalAlpha=1,u.clearRect(0,0,i.width,i.height),m},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,"uDelta")}},sendUniformData:function(e,t){var i=this.chooseRightDelta();e.uniform2fv(t.delta,i)},chooseRightDelta:function(){var e,t=1,i=[0,0];return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?i[0]=e:i[1]=e,i}}),i.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Gamma=n(i.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],i.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,i=e.imageData.data,n=this.gamma,r=i.length,a=1/n[0],o=1/n[1],s=1/n[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,r=256;t<r;t++)this.rVals[t]=255*Math.pow(t/255,a),this.gVals[t]=255*Math.pow(t/255,o),this.bVals[t]=255*Math.pow(t/255,s);for(t=0,r=i.length;t<r;t+=4)i[t]=this.rVals[i[t]],i[t+1]=this.gVals[i[t+1]],i[t+2]=this.bVals[i[t+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,"uGamma")}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Composed=n(i.BaseFilter,{type:"Composed",subFilters:[],initialize:function(e){this.callSuper("initialize",e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach((function(t){t.applyTo(e)}))},toObject:function(){return t.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map((function(e){return e.toObject()}))})},isNeutralState:function(){return!this.subFilters.some((function(e){return!e.isNeutralState()}))}}),t.Image.filters.Composed.fromObject=function(e,i){var n=(e.subFilters||[]).map((function(e){return new t.Image.filters[e.type](e)})),r=new t.Image.filters.Composed({subFilters:n});return i&&i(r),r}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.HueRotation=n(i.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var e=this.rotation*Math.PI,i=t.util.cos(e),n=t.util.sin(e),r=Math.sqrt(1/3)*n,a=1-i;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=i+a/3,this.matrix[1]=1/3*a-r,this.matrix[2]=1/3*a+r,this.matrix[5]=1/3*a+r,this.matrix[6]=i+1/3*a,this.matrix[7]=1/3*a-r,this.matrix[10]=1/3*a-r,this.matrix[11]=1/3*a+r,this.matrix[12]=i+1/3*a},isNeutralState:function(e){return this.calculateMatrix(),i.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),i.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.clone;if(t.Text)t.warn("fabric.Text is already defined");else{var n="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:t.Object.prototype.stateProperties.concat(n),cacheProperties:t.Object.prototype.cacheProperties.concat(n),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper("initialize",t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||(t._measuringContext=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext("2d")),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var e,t,i,n,r,a,o,s=0,l=this._textLines.length;s<l;s++)if(("justify"===this.textAlign||s!==l-1&&!this.isEndOfWrapping(s))&&(n=0,r=this._textLines[s],(t=this.getLineWidth(s))<this.width&&(o=this.textLines[s].match(this._reSpacesAndTabs)))){i=o.length,e=(this.width-t)/i;for(var c=0,h=r.length;c<=h;c++)a=this.__charBounds[s][c],this._reSpaceAndTab.test(r[c])?(a.width+=e,a.kernedWidth+=e,a.left+=n,n+=e):a.left+=n}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,i){e.textBaseline="alphabetic",e.font=this._getFontDeclaration(t,i)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,i=this._textLines.length;t<i;t++){var n=this.getLineWidth(t);n>e&&(e=n)}return e},_renderTextLine:function(e,t,i,n,r,a){this._renderChars(e,t,i,n,r,a)},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var t,i,n,r,a,o,s,l=e.fillStyle,c=this._getLeftOffset(),h=this._getTopOffset(),u=0,f=0,d=this.path,m=0,g=this._textLines.length;m<g;m++)if(t=this.getHeightOfLine(m),this.textBackgroundColor||this.styleHas("textBackgroundColor",m)){n=this._textLines[m],i=this._getLineLeftOffset(m),f=0,u=0,r=this.getValueOfPropertyAt(m,0,"textBackgroundColor");for(var v=0,p=n.length;v<p;v++)a=this.__charBounds[m][v],o=this.getValueOfPropertyAt(m,v,"textBackgroundColor"),d?(e.save(),e.translate(a.renderLeft,a.renderTop),e.rotate(a.angle),e.fillStyle=o,o&&e.fillRect(-a.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),a.width,t/this.lineHeight),e.restore()):o!==r?(s=c+i+u,"rtl"===this.direction&&(s=this.width-s-f),e.fillStyle=r,r&&e.fillRect(s,h,f,t/this.lineHeight),u=a.left,f=a.width,r=o):f+=a.kernedWidth;o&&!d&&(s=c+i+u,"rtl"===this.direction&&(s=this.width-s-f),e.fillStyle=o,e.fillRect(s,h,f,t/this.lineHeight)),h+=t}else h+=t;e.fillStyle=l,this._removeShadow(e)}},getFontCache:function(e){var i=e.fontFamily.toLowerCase();t.charWidthsCache[i]||(t.charWidthsCache[i]={});var n=t.charWidthsCache[i],r=e.fontStyle.toLowerCase()+"_"+(e.fontWeight+"").toLowerCase();return n[r]||(n[r]={}),n[r]},_measureChar:function(e,t,i,n){var r,a,o,s,l=this.getFontCache(t),c=i+e,h=this._getFontDeclaration(t)===this._getFontDeclaration(n),u=t.fontSize/this.CACHE_FONT_SIZE;if(i&&void 0!==l[i]&&(o=l[i]),void 0!==l[e]&&(s=r=l[e]),h&&void 0!==l[c]&&(s=(a=l[c])-o),void 0===r||void 0===o||void 0===a){var f=this.getMeasuringContext();this._setTextStyles(f,t,!0)}return void 0===r&&(s=r=f.measureText(e).width,l[e]=r),void 0===o&&h&&i&&(o=f.measureText(i).width,l[i]=o),h&&void 0===a&&(a=f.measureText(c).width,l[c]=a,s=a-o),{width:r*u,kernedWidth:s*u}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,"fontSize")},measureLine:function(e){var t=this._measureLine(e);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var i,n,r,a,o,s,l=0,c=this._textLines[e],h=new Array(c.length),u=0,f=this.path,d="right"===this.pathSide;for(this.__charBounds[e]=h,i=0;i<c.length;i++)n=c[i],a=this._getGraphemeBox(n,e,i,r),h[i]=a,l+=a.kernedWidth,r=n;if(h[i]={left:a?a.left+a.width:0,width:0,kernedWidth:0,height:this.fontSize},f){switch(s=f.segmentsInfo[f.segmentsInfo.length-1].length,(o=t.util.getPointOnPath(f.path,0,f.segmentsInfo)).x+=f.pathOffset.x,o.y+=f.pathOffset.y,this.textAlign){case"left":u=d?s-l:0;break;case"center":u=(s-l)/2;break;case"right":u=d?0:s-l}for(u+=this.pathStartOffset*(d?-1:1),i=d?c.length-1:0;d?i>=0:i<c.length;d?i--:i++)a=h[i],u>s?u%=s:u<0&&(u+=s),this._setGraphemeOnPath(u,a,o),u+=a.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(e,i,n){var r=e+i.kernedWidth/2,a=this.path,o=t.util.getPointOnPath(a.path,r,a.segmentsInfo);i.renderLeft=o.x-n.x,i.renderTop=o.y-n.y,i.angle=o.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(e,t,i,n,r){var a,o=this.getCompleteStyleDeclaration(t,i),s=n?this.getCompleteStyleDeclaration(t,i-1):{},l=this._measureChar(e,o,n,s),c=l.kernedWidth,h=l.width;0!==this.charSpacing&&(h+=a=this._getWidthOfCharSpacing(),c+=a);var u={width:h,left:0,height:o.fontSize,kernedWidth:c,deltaY:o.deltaY};if(i>0&&!r){var f=this.__charBounds[t][i-1];u.left=f.left+f.width+l.kernedWidth-l.width}return u},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],i=this.getHeightOfChar(e,0),n=1,r=t.length;n<r;n++)i=Math.max(this.getHeightOfChar(e,n),i);return this.__lineHeights[e]=i*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,i=0,n=this._textLines.length;i<n;i++)e=this.getHeightOfLine(i),t+=i===n-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var i=0,n=this._getLeftOffset(),r=this._getTopOffset(),a=0,o=this._textLines.length;a<o;a++){var s=this.getHeightOfLine(a),l=s/this.lineHeight,c=this._getLineLeftOffset(a);this._renderTextLine(t,e,this._textLines[a],n+c,r+i+l,a),i+=s}e.restore()},_renderTextFill:function(e){(this.fill||this.styleHas("fill"))&&this._renderTextCommon(e,"fillText")},_renderTextStroke:function(e){(this.stroke&&0!==this.strokeWidth||!this.isEmptyStyles())&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,"strokeText"),e.closePath(),e.restore())},_renderChars:function(e,t,i,n,r,a){var o,s,l,c,h,u=this.getHeightOfLine(a),f=-1!==this.textAlign.indexOf("justify"),d="",m=0,g=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(a)&&!g,p="ltr"===this.direction,y="ltr"===this.direction?1:-1;if(t.save(),r-=u*this._fontSizeFraction/this.lineHeight,v)return t.canvas.setAttribute("dir",p?"ltr":"rtl"),t.direction=p?"ltr":"rtl",t.textAlign=p?"left":"right",this._renderChar(e,t,a,0,i.join(""),n,r,u),void t.restore();for(var b=0,w=i.length-1;b<=w;b++)c=b===w||this.charSpacing||g,d+=i[b],l=this.__charBounds[a][b],0===m?(n+=y*(l.kernedWidth-l.width),m+=l.width):m+=l.kernedWidth,f&&!c&&this._reSpaceAndTab.test(i[b])&&(c=!0),c||(o=o||this.getCompleteStyleDeclaration(a,b),s=this.getCompleteStyleDeclaration(a,b+1),c=this._hasStyleChanged(o,s)),c&&(g?(t.save(),t.translate(l.renderLeft,l.renderTop),t.rotate(l.angle),this._renderChar(e,t,a,b,d,-m/2,0,u),t.restore()):(h=n,t.canvas.setAttribute("dir",p?"ltr":"rtl"),t.direction=p?"ltr":"rtl",t.textAlign=p?"left":"right",this._renderChar(e,t,a,b,d,h,r,u)),d="",o=s,n+=y*m,m=0);t.restore()},_applyPatternGradientTransformText:function(e){var i,n=t.util.createCanvasElement(),r=this.width+this.strokeWidth,a=this.height+this.strokeWidth;return n.width=r,n.height=a,(i=n.getContext("2d")).beginPath(),i.moveTo(0,0),i.lineTo(r,0),i.lineTo(r,a),i.lineTo(0,a),i.closePath(),i.translate(r/2,a/2),i.fillStyle=e.toLive(i),this._applyPatternGradientTransform(i,e),i.fill(),i.createPattern(n,"no-repeat")},handleFiller:function(e,t,i){var n,r;return i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?(n=-this.width/2,r=-this.height/2,e.translate(n,r),e[t]=this._applyPatternGradientTransformText(i),{offsetX:n,offsetY:r}):(e[t]=i.toLive(e,this),this._applyPatternGradientTransform(e,i)):(e[t]=i,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,"strokeStyle",t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,"fillStyle",t.fill)},_renderChar:function(e,t,i,n,r,a,o){var s,l,c=this._getStyleDeclaration(i,n),h=this.getCompleteStyleDeclaration(i,n),u="fillText"===e&&h.fill,f="strokeText"===e&&h.stroke&&h.strokeWidth;(f||u)&&(t.save(),u&&(s=this._setFillStyles(t,h)),f&&(l=this._setStrokeStyles(t,h)),t.font=this._getFontDeclaration(h),c&&c.textBackgroundColor&&this._removeShadow(t),c&&c.deltaY&&(o+=c.deltaY),u&&t.fillText(r,a-s.offsetX,o-s.offsetY),f&&t.strokeText(r,a-l.offsetX,o-l.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,i){var n=this.get2DCursorLocation(e,!0),r=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),a=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),o={fontSize:r*i.size,deltaY:a+r*i.baseline};return this.setSelectionStyles(o,e,t),this},_hasStyleChanged:function(e,t){return e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.deltaY!==t.deltaY},_hasStyleChangedForSvg:function(e,t){return this._hasStyleChanged(e,t)||e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),i=this.width-t,n=this.textAlign,r=this.direction,a=0,o=this.isEndOfWrapping(e);return"justify"===n||"justify-center"===n&&!o||"justify-right"===n&&!o||"justify-left"===n&&!o?0:("center"===n&&(a=i/2),"right"===n&&(a=i),"justify-center"===n&&(a=i/2),"justify-right"===n&&(a=i),"rtl"===r&&(a-=i),a)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||(e=this.hasStateChanged("_dimensionAffectingProps")),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){return this.__lineWidths[e]?this.__lineWidths[e]:(t=""===this._textLines[e]?0:this.measureLine(e).width,this.__lineWidths[e]=t,t);var t},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(e,t,i){var n=this._getStyleDeclaration(e,t);return n&&void 0!==n[i]?n[i]:this[i]},_renderTextDecoration:function(e,t){if(this[t]||this.styleHas(t)){for(var i,n,r,a,o,s,l,c,h,u,f,d,m,g,v,p,y=this._getLeftOffset(),b=this._getTopOffset(),w=this.path,x=this._getWidthOfCharSpacing(),k=this.offsets[t],C=0,S=this._textLines.length;C<S;C++)if(i=this.getHeightOfLine(C),this[t]||this.styleHas(t,C)){l=this._textLines[C],g=i/this.lineHeight,a=this._getLineLeftOffset(C),u=0,f=0,c=this.getValueOfPropertyAt(C,0,t),p=this.getValueOfPropertyAt(C,0,"fill"),h=b+g*(1-this._fontSizeFraction),n=this.getHeightOfChar(C,0),o=this.getValueOfPropertyAt(C,0,"deltaY");for(var _=0,T=l.length;_<T;_++)if(d=this.__charBounds[C][_],m=this.getValueOfPropertyAt(C,_,t),v=this.getValueOfPropertyAt(C,_,"fill"),r=this.getHeightOfChar(C,_),s=this.getValueOfPropertyAt(C,_,"deltaY"),w&&m&&v)e.save(),e.fillStyle=p,e.translate(d.renderLeft,d.renderTop),e.rotate(d.angle),e.fillRect(-d.kernedWidth/2,k*r+s,d.kernedWidth,this.fontSize/15),e.restore();else if((m!==c||v!==p||r!==n||s!==o)&&f>0){var O=y+a+u;"rtl"===this.direction&&(O=this.width-O-f),c&&p&&(e.fillStyle=p,e.fillRect(O,h+k*n+o,f,this.fontSize/15)),u=d.left,f=d.width,c=m,p=v,n=r,o=s}else f+=d.kernedWidth;O=y+a+u;"rtl"===this.direction&&(O=this.width-O-f),e.fillStyle=v,m&&v&&e.fillRect(O,h+k*n+o,f-x,this.fontSize/15),b+=i}else b+=i;this._removeShadow(e)}},_getFontDeclaration:function(e,i){var n=e||this,r=this.fontFamily,a=t.Text.genericFonts.indexOf(r.toLowerCase())>-1,o=void 0===r||r.indexOf("'")>-1||r.indexOf(",")>-1||r.indexOf('"')>-1||a?n.fontFamily:'"'+n.fontFamily+'"';return[t.isLikelyNode?n.fontWeight:n.fontStyle,t.isLikelyNode?n.fontStyle:n.fontWeight,i?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",o].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var i=e.split(this._reNewline),n=new Array(i.length),r=["\n"],a=[],o=0;o<i.length;o++)n[o]=t.util.string.graphemeSplit(i[o]),a=a.concat(n[o],r);return a.pop(),{_unwrappedLines:n,lines:i,graphemeText:a,graphemeLines:n}},toObject:function(e){var t=n.concat(e),r=this.callSuper("toObject",t);return r.styles=i(this.styles,!0),r.path&&(r.path=this.path.toObject()),r},set:function(e,t){this.callSuper("set",e,t);var i=!1,n=!1;if("object"==typeof e)for(var r in e)"path"===r&&this.setPathInfo(),i=i||-1!==this._dimensionAffectingProps.indexOf(r),n=n||"path"===r;else i=-1!==this._dimensionAffectingProps.indexOf(e),n="path"===e;return n&&this.setPathInfo(),i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,n,r){if(!e)return n(null);var a=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),o=a.textAnchor||"left";if((r=t.util.object.extend(r?i(r):{},a)).top=r.top||0,r.left=r.left||0,a.textDecoration){var s=a.textDecoration;-1!==s.indexOf("underline")&&(r.underline=!0),-1!==s.indexOf("overline")&&(r.overline=!0),-1!==s.indexOf("line-through")&&(r.linethrough=!0),delete r.textDecoration}"dx"in a&&(r.left+=a.dx),"dy"in a&&(r.top+=a.dy),"fontSize"in r||(r.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in e?l=e.textContent:"firstChild"in e&&null!==e.firstChild&&"data"in e.firstChild&&null!==e.firstChild.data&&(l=e.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=r.strokeWidth;r.strokeWidth=0;var h=new t.Text(l,r),u=h.getScaledHeight()/h.height,f=((h.height+h.strokeWidth)*h.lineHeight-h.height)*u,d=h.getScaledHeight()+f,m=0;"center"===o&&(m=h.getScaledWidth()/2),"right"===o&&(m=h.getScaledWidth()),h.set({left:h.left-m,top:h.top-(d-h.fontSize*(.07+h._fontSizeFraction))/h.lineHeight,strokeWidth:void 0!==c?c:1}),n(h)},t.Text.fromObject=function(e,n){var r=i(e),a=e.path;return delete r.path,t.Object._fromObject("Text",r,(function(e){a?t.Object._fromObject("Path",a,(function(t){e.set("path",t),n(e)}),"path"):n(e)}),"text")},t.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],t.util.createAccessors&&t.util.createAccessors(t.Text)}}(t),_.util.object.extend(_.Text.prototype,{isEmptyStyles:function(e){if(!this.styles)return!0;if(void 0!==e&&!this.styles[e])return!0;var t=void 0===e?this.styles:{line:this.styles[e]};for(var i in t)for(var n in t[i])for(var r in t[i][n])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||""===e)return!1;if(void 0!==t&&!this.styles[t])return!1;var i=void 0===t?this.styles:{0:this.styles[t]};for(var n in i)for(var r in i[n])if(void 0!==i[n][r][e])return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||""===e)return!1;var t,i,n=this.styles,r=0,a=!0,o=0;for(var s in n){for(var l in t=0,n[s]){var c;r++,(c=n[s][l]).hasOwnProperty(e)?(i?c[e]!==i&&(a=!1):i=c[e],c[e]===this[e]&&delete c[e]):a=!1,0!==Object.keys(c).length?t++:delete n[s][l]}0===t&&delete n[s]}for(var h=0;h<this._textLines.length;h++)o+=this._textLines[h].length;a&&r===o&&(this[e]=i,this.removeStyle(e))},removeStyle:function(e){if(this.styles&&e&&""!==e){var t,i,n,r=this.styles;for(i in r){for(n in t=r[i])delete t[n][e],0===Object.keys(t[n]).length&&delete t[n];0===Object.keys(t).length&&delete r[i]}}},_extendStyles:function(e,t){var i=this.get2DCursorLocation(e);this._getLineStyle(i.lineIndex)||this._setLineStyle(i.lineIndex),this._getStyleDeclaration(i.lineIndex,i.charIndex)||this._setStyleDeclaration(i.lineIndex,i.charIndex,{}),_.util.object.extend(this._getStyleDeclaration(i.lineIndex,i.charIndex),t)},get2DCursorLocation:function(e,t){void 0===e&&(e=this.selectionStart);for(var i=t?this._unwrappedTextLines:this._textLines,n=i.length,r=0;r<n;r++){if(e<=i[r].length)return{lineIndex:r,charIndex:e};e-=i[r].length+this.missingNewlineOffset(r)}return{lineIndex:r-1,charIndex:i[r-1].length<e?i[r-1].length:e}},getSelectionStyles:function(e,t,i){void 0===e&&(e=this.selectionStart||0),void 0===t&&(t=this.selectionEnd||e);for(var n=[],r=e;r<t;r++)n.push(this.getStyleAtPosition(r,i));return n},getStyleAtPosition:function(e,t){var i=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(i.lineIndex,i.charIndex):this._getStyleDeclaration(i.lineIndex,i.charIndex))||{}},setSelectionStyles:function(e,t,i){void 0===t&&(t=this.selectionStart||0),void 0===i&&(i=this.selectionEnd||t);for(var n=t;n<i;n++)this._extendStyles(n,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var i=this.styles&&this.styles[e];return i?i[t]:null},getCompleteStyleDeclaration:function(e,t){for(var i,n=this._getStyleDeclaration(e,t)||{},r={},a=0;a<this._styleProperties.length;a++)r[i=this._styleProperties[a]]=void 0===n[i]?this[i]:n[i];return r},_setStyleDeclaration:function(e,t,i){this.styles[e][t]=i},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]},_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}}),function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf("underline")>-1&&(e.underline=!0),e.textDecoration.indexOf("line-through")>-1&&(e.linethrough=!0),e.textDecoration.indexOf("overline")>-1&&(e.overline=!0),delete e.textDecoration)}_.IText=_.util.createClass(_.Text,_.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper("initialize",e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire("selectionStart",e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire("selectionEnd",e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(e){this.clearContextTop(),this.callSuper("render",e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper("_render",e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,i=this.canvas.viewportTransform;t.save(),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,i=this.height+4;e.clearRect(-t/2,-i/2,t,i)},_getCursorBoundaries:function(e){void 0===e&&(e=this.selectionStart);var t=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(e);return{left:t,top:i,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var t,i,n,r,a=0,o=0,s=this.get2DCursorLocation(e);n=s.charIndex,i=s.lineIndex;for(var l=0;l<i;l++)a+=this.getHeightOfLine(l);t=this._getLineLeftOffset(i);var c=this.__charBounds[i][n];return c&&(o=c.left),0!==this.charSpacing&&n===this._textLines[i].length&&(o-=this._getWidthOfCharSpacing()),r={top:a,left:t+(o>0?o:0)},"rtl"===this.direction&&(r.left*=-1),this.cursorOffsetCache=r,this.cursorOffsetCache},renderCursor:function(e,t){var i=this.get2DCursorLocation(),n=i.lineIndex,r=i.charIndex>0?i.charIndex-1:0,a=this.getValueOfPropertyAt(n,r,"fontSize"),o=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/o,l=e.topOffset,c=this.getValueOfPropertyAt(n,r,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-a*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,r,"fill"),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,l+e.top+c,s,a)},renderSelection:function(e,t){for(var i=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=-1!==this.textAlign.indexOf("justify"),a=this.get2DCursorLocation(i),o=this.get2DCursorLocation(n),s=a.lineIndex,l=o.lineIndex,c=a.charIndex<0?0:a.charIndex,h=o.charIndex<0?0:o.charIndex,u=s;u<=l;u++){var f,d=this._getLineLeftOffset(u)||0,m=this.getHeightOfLine(u),g=0,v=0;if(u===s&&(g=this.__charBounds[s][c].left),u>=s&&u<l)v=r&&!this.isEndOfWrapping(u)?this.width:this.getLineWidth(u)||5;else if(u===l)if(0===h)v=this.__charBounds[l][h].left;else{var p=this._getWidthOfCharSpacing();v=this.__charBounds[l][h-1].left+this.__charBounds[l][h-1].width-p}f=m,(this.lineHeight<1||u===l&&this.lineHeight>1)&&(m/=this.lineHeight);var y=e.left+d+g,b=v-g,w=m,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",w=1,x=m):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),t.fillRect(y,e.top+e.topOffset+x,b,w),e.topOffset+=f}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fontSize")},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fill")},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),_.IText.fromObject=function(t,i){if(e(t),t.styles)for(var n in t.styles)for(var r in t.styles[n])e(t.styles[n][r]);_.Object._fromObject("IText",t,i,"text")}}(),k=_.util.object.clone,_.util.object.extend(_.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",(function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))}))},initRemovedHandler:function(){var e=this;this.on("removed",(function(){var t=e.canvas;t&&(t._iTextInstances=t._iTextInstances||[],_.util.removeFromArray(t._iTextInstances,e),0===t._iTextInstances.length&&(t._hasITextHandlers=!1,e._removeCanvasHandlers(t)))}))},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach((function(e){e.__isMousedown=!1}))},e.on("mouse:up",e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off("mouse:up",e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(e,t,i,n){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate("_currentCursorOpacity",t,{duration:i,onComplete:function(){r.isAborted||e[n]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout((function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,"_tick")}),100)},initDelayedCursor:function(e){var t=this,i=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout((function(){t._tick()}),i)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(e){var t=0,i=e-1;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)t++,i--;for(;/\S/.test(this._text[i])&&i>-1;)t++,i--;return e-t},findWordBoundaryRight:function(e){var t=0,i=e;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)t++,i++;for(;/\S/.test(this._text[i])&&i<this._text.length;)t++,i++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,i=e-1;!/\n/.test(this._text[i])&&i>-1;)t++,i--;return e-t},findLineBoundaryRight:function(e){for(var t=0,i=e;!/\n/.test(this._text[i])&&i<this._text.length;)t++,i++;return e+t},searchWordBoundary:function(e,t){for(var i=this._text,n=this._reSpace.test(i[e])?e-1:e,r=i[n],a=_.reNonWord;!a.test(r)&&n>0&&n<i.length;)r=i[n+=t];return a.test(r)&&(n+=1===t?0:1),n},selectWord:function(e){e=e||this.selectionStart;var t=this.searchWordBoundary(e,-1),i=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e=e||this.selectionStart;var t=this.findLineBoundaryLeft(e),i=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(e){e._iTextInstances&&e._iTextInstances.forEach((function(e){e.selected=!1,e.isEditing&&e.exitEditing()}))},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(e){if(this.__isMousedown&&this.isEditing){var t=this.getSelectionStartFromPointer(e.e),i=this.selectionStart,n=this.selectionEnd;(t===this.__selectionStartOnMouseDown&&i!==n||i!==t&&n!==t)&&(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,t,i){var n=i.slice(0,e),r=_.util.string.graphemeSplit(n).length;if(e===t)return{selectionStart:r,selectionEnd:r};var a=i.slice(e,t);return{selectionStart:r,selectionEnd:r+_.util.string.graphemeSplit(a).length}},fromGraphemeToStringSelection:function(e,t,i){var n=i.slice(0,e).join("").length;return e===t?{selectionStart:n,selectionEnd:n}:{selectionStart:n,selectionEnd:n+i.slice(e,t).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,t=this._getCursorBoundaries(e),i=this.get2DCursorLocation(e),n=i.lineIndex,r=i.charIndex,a=this.getValueOfPropertyAt(n,r,"fontSize")*this.lineHeight,o=t.leftOffset,s=this.calcTransformMatrix(),l={x:t.left+o,y:t.top+t.topOffset+a},c=this.canvas.getRetinaScaling(),h=this.canvas.upperCanvasEl,u=h.width/c,f=h.height/c,d=u-a,m=f-a,g=h.clientWidth/u,v=h.clientHeight/f;return l=_.util.transformPoint(l,s),(l=_.util.transformPoint(l,this.canvas.viewportTransform)).x*=g,l.y*=v,l.x<0&&(l.x=0),l.x>d&&(l.x=d),l.y<0&&(l.y=0),l.y>m&&(l.y=m),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+"px",top:l.y+"px",fontSize:a+"px",charHeight:a}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),e&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),e&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var i,n,r=this.get2DCursorLocation(e,!0),a=this.get2DCursorLocation(t,!0),o=r.lineIndex,s=r.charIndex,l=a.lineIndex,c=a.charIndex;if(o!==l){if(this.styles[o])for(i=s;i<this._unwrappedTextLines[o].length;i++)delete this.styles[o][i];if(this.styles[l])for(i=c;i<this._unwrappedTextLines[l].length;i++)(n=this.styles[l][i])&&(this.styles[o]||(this.styles[o]={}),this.styles[o][s+i-c]=n);for(i=o+1;i<=l;i++)delete this.styles[i];this.shiftLineStyles(l,o-l)}else if(this.styles[o]){n=this.styles[o];var h,u,f=c-s;for(i=s;i<c;i++)delete n[i];for(u in this.styles[o])(h=parseInt(u,10))>=c&&(n[h-f]=n[u],delete n[u])}},shiftLineStyles:function(e,t){var i=k(this.styles);for(var n in this.styles){var r=parseInt(n,10);r>e&&(this.styles[r+t]=i[r],i[r-t]||delete this.styles[r])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(e,t,i,n){var r,a={},o=!1,s=this._unwrappedTextLines[e].length===t;for(var l in i||(i=1),this.shiftLineStyles(e,i),this.styles[e]&&(r=this.styles[e][0===t?t:t-1]),this.styles[e]){var c=parseInt(l,10);c>=t&&(o=!0,a[c-t]=this.styles[e][l],s&&0===t||delete this.styles[e][l])}var h=!1;for(o&&!s&&(this.styles[e+i]=a,h=!0),h&&i--;i>0;)n&&n[i-1]?this.styles[e+i]={0:k(n[i-1])}:r?this.styles[e+i]={0:k(r)}:delete this.styles[e+i],i--;this._forceClearCache=!0},insertCharStyleObject:function(e,t,i,n){this.styles||(this.styles={});var r=this.styles[e],a=r?k(r):{};for(var o in i||(i=1),a){var s=parseInt(o,10);s>=t&&(r[s+i]=a[s],a[s-i]||delete r[s])}if(this._forceClearCache=!0,n)for(;i--;)Object.keys(n[i]).length&&(this.styles[e]||(this.styles[e]={}),this.styles[e][t+i]=k(n[i]));else if(r)for(var l=r[t?t-1:1];l&&i--;)this.styles[e][t+i]=k(l)},insertNewStyleBlock:function(e,t,i){for(var n=this.get2DCursorLocation(t,!0),r=[0],a=0,o=0;o<e.length;o++)"\n"===e[o]?r[++a]=0:r[a]++;for(r[0]>0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,r[0],i),i=i&&i.slice(r[0]+1)),a&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+r[0],a),o=1;o<a;o++)r[o]>0?this.insertCharStyleObject(n.lineIndex+o,0,r[o],i):i&&(this.styles[n.lineIndex+o][0]=i[0]),i=i&&i.slice(r[o]+1);r[o]>0&&this.insertCharStyleObject(n.lineIndex+o,0,r[o],i)},setSelectionStartEndWithShift:function(e,t,i){i<=e?(t===e?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=e),this.selectionStart=i):i>e&&i<t?"right"===this._selectionDirection?this.selectionEnd=i:this.selectionStart=i:(t===e?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=t),this.selectionEnd=i)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}}),_.util.object.extend(_.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire("tripleclick",e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&1!==e.e.button)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),i=this.selectionStart,n=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(i,n,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,i=this.getLocalPointer(e),n=0,r=0,a=0,o=0,s=0,l=0,c=this._textLines.length;l<c&&a<=i.y;l++)a+=this.getHeightOfLine(l)*this.scaleY,s=l,l>0&&(o+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));r=this._getLineLeftOffset(s)*this.scaleX,t=this._textLines[s],"rtl"===this.direction&&(i.x=this.width*this.scaleX-i.x+r);for(var h=0,u=t.length;h<u&&(n=r,(r+=this.__charBounds[s][h].kernedWidth*this.scaleX)<=i.x);h++)o++;return this._getNewSelectionStartFromOffset(i,n,r,o,u)},_getNewSelectionStartFromOffset:function(e,t,i,n,r){var a=e.x-t,o=i-e.x,s=n+(o>a||o<0?0:1);return this.flipX&&(s=r-s),s>this._text.length&&(s=this._text.length),s}}),_.util.object.extend(_.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=_.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+e.top+"; left: "+e.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; paddingーtop: "+e.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):_.document.body.appendChild(this.hiddenTextarea),_.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),_.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),_.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),_.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),_.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),_.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),_.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),_.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),_.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(_.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var t=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var i,n,r,a,o,s=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,l=this._text.length,c=s.length,h=c-l,u=this.selectionStart,f=this.selectionEnd,d=u!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var m=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),g=u>m.selectionStart;d?(i=this._text.slice(u,f),h+=f-u):c<l&&(i=g?this._text.slice(f+h,f):this._text.slice(u,u-h)),n=s.slice(m.selectionEnd-h,m.selectionEnd),i&&i.length&&(n.length&&(r=this.getSelectionStyles(u,u+1,!1),r=n.map((function(){return r[0]}))),d?(a=u,o=f):g?(a=f-i.length,o=f):(a=f,o=f+i.length),this.removeStyleFromTo(a,o)),n.length&&(t&&n.join("")===_.copiedText&&!_.disableStyleCopyPaste&&(r=_.copiedTextStyle),this.insertNewStyleBlock(n,u,r)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(_.copiedText=this.getSelectedText(),_.disableStyleCopyPaste?_.copiedTextStyle=null:_.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||_.window.clipboardData},_getWidthBeforeCursor:function(e,t){var i,n=this._getLineLeftOffset(e);return t>0&&(n+=(i=this.__charBounds[e][t-1]).left+i.width),n},getDownCursorOffset:function(e,t){var i=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(i),r=n.lineIndex;if(r===this._textLines.length-1||e.metaKey||34===e.keyCode)return this._text.length-i;var a=n.charIndex,o=this._getWidthBeforeCursor(r,a),s=this._getIndexOnLine(r+1,o);return this._textLines[r].slice(a).length+s+1+this.missingNewlineOffset(r)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var i=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(i),r=n.lineIndex;if(0===r||e.metaKey||33===e.keyCode)return-i;var a=n.charIndex,o=this._getWidthBeforeCursor(r,a),s=this._getIndexOnLine(r-1,o),l=this._textLines[r].slice(0,a),c=this.missingNewlineOffset(r-1);return-this._textLines[r-1].length+s-l.length+(1-c)},_getIndexOnLine:function(e,t){for(var i,n,r=this._textLines[e],a=this._getLineLeftOffset(e),o=0,s=0,l=r.length;s<l;s++)if((a+=i=this.__charBounds[e][s].width)>t){n=!0;var c=a-i,h=a,u=Math.abs(c-t);o=Math.abs(h-t)<u?s:s-1;break}return n||(o=r.length-1),o},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",e)},moveCursorUp:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",e)},_moveCursorUpOrDown:function(e,t){var i=this["get"+e+"CursorOffset"](t,"right"===this._selectionDirection);t.shiftKey?this.moveCursorWithShift(i):this.moveCursorWithoutShift(i),0!==i&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t="left"===this._selectionDirection?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),0!==e},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),0!==e},moveCursorLeft:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",e)},_move:function(e,t,i){var n;if(e.altKey)n=this["findWordBoundary"+i](this[t]);else{if(!e.metaKey&&35!==e.keyCode&&36!==e.keyCode)return this[t]+="Left"===i?-1:1,!0;n=this["findLineBoundary"+i](this[t])}if(void 0!==typeof n&&this[t]!==n)return this[t]=n,!0},_moveLeft:function(e,t){return this._move(e,t,"Left")},_moveRight:function(e,t){return this._move(e,t,"Right")},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(t=this._moveLeft(e,"selectionStart")),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(e,"selectionStart")):void 0},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",e)},_moveCursorLeftOrRight:function(e,t){var i="moveCursor"+e+"With";this._currentCursorOpacity=1,t.shiftKey?i+="Shift":i+="outShift",this[i](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(e,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(e,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(t=this._moveRight(e,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){void 0===t&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,t,i,n){void 0===n&&(n=i),n>i&&this.removeStyleFromTo(i,n);var r=_.util.string.graphemeSplit(e);this.insertNewStyleBlock(r,i,t),this._text=[].concat(this._text.slice(0,i),r,this._text.slice(n)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),C=_.util.toFixed,S=/ +/g,_.util.object.extend(_.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",t?'text-decoration="'+t+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",e.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(e,t){var i,n=[],r=[],a=e;this._setSVGBg(r);for(var o=0,s=this._textLines.length;o<s;o++)i=this._getLineLeftOffset(o),(this.textBackgroundColor||this.styleHas("textBackgroundColor",o))&&this._setSVGTextLineBg(r,o,t+i,a),this._setSVGTextLineText(n,o,t+i,a),a+=this.getHeightOfLine(o);return{textSpans:n,textBgRects:r}},_createTextCharSpan:function(e,t,i,n){var r=e!==e.trim()||e.match(S),a=this.getSvgSpanStyles(t,r),o=a?'style="'+a+'"':"",s=t.deltaY,l="",c=_.Object.NUM_FRACTION_DIGITS;return s&&(l=' dy="'+C(s,c)+'" '),['<tspan x="',C(i,c),'" y="',C(n,c),'" ',l,o,">",_.util.string.escapeXml(e),"</tspan>"].join("")},_setSVGTextLineText:function(e,t,i,n){var r,a,o,s,l,c=this.getHeightOfLine(t),h=-1!==this.textAlign.indexOf("justify"),u="",f=0,d=this._textLines[t];n+=c*(1-this._fontSizeFraction)/this.lineHeight;for(var m=0,g=d.length-1;m<=g;m++)l=m===g||this.charSpacing,u+=d[m],o=this.__charBounds[t][m],0===f?(i+=o.kernedWidth-o.width,f+=o.width):f+=o.kernedWidth,h&&!l&&this._reSpaceAndTab.test(d[m])&&(l=!0),l||(r=r||this.getCompleteStyleDeclaration(t,m),a=this.getCompleteStyleDeclaration(t,m+1),l=this._hasStyleChangedForSvg(r,a)),l&&(s=this._getStyleDeclaration(t,m)||{},e.push(this._createTextCharSpan(u,s,i,n)),u="",r=a,i+=f,f=0)},_pushTextBgRect:function(e,t,i,n,r,a){var o=_.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(t),' x="',C(i,o),'" y="',C(n,o),'" width="',C(r,o),'" height="',C(a,o),'"></rect>\n')},_setSVGTextLineBg:function(e,t,i,n){for(var r,a,o=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,l=0,c=0,h=this.getValueOfPropertyAt(t,0,"textBackgroundColor"),u=0,f=o.length;u<f;u++)r=this.__charBounds[t][u],(a=this.getValueOfPropertyAt(t,u,"textBackgroundColor"))!==h?(h&&this._pushTextBgRect(e,h,i+c,n,l,s),c=r.left,l=r.width,h=a):l+=r.kernedWidth;a&&this._pushTextBgRect(e,a,i+c,n,l,s)},_getFillAttributes:function(e){var t=e&&"string"==typeof e?new _.Color(e):"";return t&&t.getSource()&&1!==t.getAlpha()?'opacity="'+t.getAlpha()+'" fill="'+t.setAlpha(1).toRgb()+'"':'fill="'+e+'"'},_getSVGLineTopOffset:function(e){for(var t,i=0,n=0;n<e;n++)i+=this.getHeightOfLine(n);return t=this.getHeightOfLine(n),{lineTop:i,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return _.Object.prototype.getSvgStyles.call(this,e)+" white-space: pre;"}}),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Textbox=t.util.createClass(t.IText,t.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(e){for(var t=0,i=0,n=0,r={},a=0;a<e.graphemeLines.length;a++)"\n"===e.graphemeText[n]&&a>0?(i=0,n++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[n])&&a>0&&(i++,n++),r[a]={line:t,offset:i},n+=e.graphemeLines[a].length,i+=e.graphemeLines[a].length;return r},styleHas:function(e,i){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[i];n&&(i=n.line)}return t.Text.prototype.styleHas.call(this,e,i)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,i,n=0,r=!1,a=this._styleMap[e],o=this._styleMap[e+1];for(var s in a&&(e=a.line,n=a.offset),o&&(r=o.line===e,t=o.offset),i=void 0===e?this.styles:{line:this.styles[e]})for(var l in i[s])if(l>=n&&(!r||l<t))for(var c in i[s][l])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[e];if(!i)return null;e=i.line,t=i.offset+t}return this.callSuper("_getStyleDeclaration",e,t)},_setStyleDeclaration:function(e,t,i){var n=this._styleMap[e];e=n.line,t=n.offset+t,this.styles[e][t]=i},_deleteStyleDeclaration:function(e,t){var i=this._styleMap[e];e=i.line,t=i.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var i,n=[];for(this.isWrapping=!0,i=0;i<e.length;i++)n=n.concat(this._wrapLine(e[i],i,t));return this.isWrapping=!1,n},_measureWord:function(e,t,i){var n,r=0;i=i||0;for(var a=0,o=e.length;a<o;a++){r+=this._getGraphemeBox(e[a],t,a+i,n,!0).kernedWidth,n=e[a]}return r},_wrapLine:function(e,i,n,r){var a=0,o=this.splitByGrapheme,s=[],l=[],c=o?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),h="",u=0,f=o?"":" ",d=0,m=0,g=0,v=!0,p=this._getWidthOfCharSpacing();r=r||0;0===c.length&&c.push([]),n-=r;for(var y=0;y<c.length;y++)h=o?c[y]:t.util.string.graphemeSplit(c[y]),d=this._measureWord(h,i,u),u+=h.length,(a+=m+d-p)>n&&!v?(s.push(l),l=[],a=d,v=!0):a+=p,v||o||l.push(f),l=l.concat(h),m=o?0:this._measureWord([f],i,u),u++,v=!1,d>g&&(g=d);return y&&s.push(l),g+r>this.dynamicMinWidth&&(this.dynamicMinWidth=g-p+r),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?this.isEndOfWrapping(e)?1:0:1},_splitTextIntoLines:function(e){for(var i=t.Text.prototype._splitTextIntoLines.call(this,e),n=this._wrapText(i.lines,this.width),r=new Array(n.length),a=0;a<n.length;a++)r[a]=n[a].join("");return i.lines=r,i.graphemeLines=n,i},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(e))}}),t.Textbox.fromObject=function(e,i){return t.Object._fromObject("Textbox",e,i,"text")}}(t),function(){var e=_.controlsUtils,t=e.scaleSkewCursorStyleHandler,i=e.scaleCursorStyleHandler,n=e.scalingEqually,r=e.scalingYOrSkewingX,a=e.scalingXOrSkewingY,o=e.scaleOrSkewActionName,s=_.Object.prototype.controls;if(s.ml=new _.Control({x:-.5,y:0,cursorStyleHandler:t,actionHandler:a,getActionName:o}),s.mr=new _.Control({x:.5,y:0,cursorStyleHandler:t,actionHandler:a,getActionName:o}),s.mb=new _.Control({x:0,y:.5,cursorStyleHandler:t,actionHandler:r,getActionName:o}),s.mt=new _.Control({x:0,y:-.5,cursorStyleHandler:t,actionHandler:r,getActionName:o}),s.tl=new _.Control({x:-.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),s.tr=new _.Control({x:.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),s.bl=new _.Control({x:-.5,y:.5,cursorStyleHandler:i,actionHandler:n}),s.br=new _.Control({x:.5,y:.5,cursorStyleHandler:i,actionHandler:n}),s.mtr=new _.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),_.Textbox){var l=_.Textbox.prototype.controls={};l.mtr=s.mtr,l.tr=s.tr,l.br=s.br,l.tl=s.tl,l.bl=s.bl,l.mt=s.mt,l.mb=s.mb,l.mr=new _.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"}),l.ml=new _.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"})}}()}).call(this,i(27).Buffer)},function(e,t,i){e.exports=i(25)},function(e,t){function i(e,t,i,n,r,a,o){try{var s=e[a](o),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,r)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=i=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),i(t)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(16),r=i(19),a=i(15),o=i(18);e.exports=function(e){return n(e)||r(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(17);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){e.exports=function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,a=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw r}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(17);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(t,n){return e.exports=i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,i(t,n)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=function(e){"use strict";var t=Object.prototype,i=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,i){return e[t]=i}}function l(e,t,i,n){var r=t&&t.prototype instanceof u?t:u,a=Object.create(r.prototype),o=new C(n||[]);return a._invoke=function(e,t,i){var n="suspendedStart";return function(r,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return _()}for(i.method=r,i.arg=a;;){var o=i.delegate;if(o){var s=w(o,i);if(s){if(s===h)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=c(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}(e,i,o),a}function c(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h={};function u(){}function f(){}function d(){}var m={};s(m,r,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(S([])));v&&v!==t&&i.call(v,r)&&(m=v);var p=d.prototype=u.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var n;this._invoke=function(r,a){function o(){return new t((function(n,o){!function n(r,a,o,s){var l=c(e[r],e,a);if("throw"!==l.type){var h=l.arg,u=h.value;return u&&"object"==typeof u&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(u).then((function(e){h.value=e,o(h)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}(r,a,n,o)}))}return n=n?n.then(o,o):o()}}function w(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=c(i,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var r=n.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:_}}function _(){return{value:void 0,done:!0}}return f.prototype=d,s(p,"constructor",d),s(d,"constructor",f),f.displayName=s(d,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,i,n,r,a){void 0===a&&(a=Promise);var o=new b(l(t,i,n,r),a);return e.isGeneratorFunction(i)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},y(p),s(p,o,"Generator"),s(p,r,(function(){return this})),s(p,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var n=t.pop();if(n in e)return i.value=n,i.done=!1,i}return i.done=!0,i}},e.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(i,n){return o.type="throw",o.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),k(i),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;k(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:S(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),h}},e}(e.exports);try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t,i){var n=i(1);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){"use strict";(function(e){
|
|
3
|
+
var n,r,a,o,s,l,c,h,u,f,d,m,g,v,p,y,b,w,x,k,C,_,S=S||{version:"4.6.0"};if(t.fabric=S,"undefined"!=typeof document&&"undefined"!=typeof window)document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?S.document=document:S.document=document.implementation.createHTMLDocument(""),S.window=window;else{var T=new(i(32).JSDOM)(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;S.document=T.document,S.jsdomImplForWrapper=i(33).implForWrapper,S.nodeCanvas=i(34).Canvas,S.window=T,DOMParser=S.window.DOMParser}function O(e,t){var i=e.canvas,n=t.targetCanvas,r=n.getContext("2d");r.translate(0,n.height),r.scale(1,-1);var a=i.height-n.height;r.drawImage(i,0,a,n.width,n.height,0,0,n.width,n.height)}function E(e,t){var i=t.targetCanvas.getContext("2d"),n=t.destinationWidth,r=t.destinationHeight,a=n*r*4,o=new Uint8Array(this.imageBuffer,0,a),s=new Uint8ClampedArray(this.imageBuffer,0,a);e.readPixels(0,0,n,r,e.RGBA,e.UNSIGNED_BYTE,o);var l=new ImageData(s,n,r);i.putImageData(l,0,0)}S.isTouchSupported="ontouchstart"in S.window||"ontouchstart"in S.document||S.window&&S.window.navigator&&S.window.navigator.maxTouchPoints>0,S.isLikelyNode=void 0!==e&&"undefined"==typeof window,S.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],S.DPI=96,S.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",S.commaWsp="(?:\\s+,?\\s*|,\\s*)",S.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,S.reNonWord=/[ \n\.,;!\?\-]/,S.fontPaths={},S.iMatrix=[1,0,0,1,0,0],S.svgNS="http://www.w3.org/2000/svg",S.perfLimitSizeTotal=2097152,S.maxCacheSideLimit=4096,S.minCacheSideLimit=256,S.charWidthsCache={},S.textureSize=2048,S.disableStyleCopyPaste=!1,S.enableGLFiltering=!0,S.devicePixelRatio=S.window.devicePixelRatio||S.window.webkitDevicePixelRatio||S.window.mozDevicePixelRatio||1,S.browserShadowBlurConstant=1,S.arcToSegmentsCache={},S.boundsOfCurveCache={},S.cachesBoundsOfCurve=!0,S.forceGLPutImageData=!1,S.initFilterBackend=function(){return S.enableGLFiltering&&S.isWebglSupported&&S.isWebglSupported(S.textureSize)?(console.log("max texture size: "+S.maxTextureSize),new S.WebglFilterBackend({tileSize:S.textureSize})):S.Canvas2dFilterBackend?new S.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=S),function(){function e(e,t){if(this.__eventListeners[e]){var i=this.__eventListeners[e];t?i[i.indexOf(t)]=!1:S.util.array.fill(i,!1)}}function t(e,t){var i=function(){t.apply(this,arguments),this.off(e,i)}.bind(this);this.on(e,i)}S.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var i=this.__eventListeners[e];if(!i)return this;for(var n=0,r=i.length;n<r;n++)i[n]&&i[n].call(this,t||{});return this.__eventListeners[e]=i.filter((function(e){return!1!==e})),this},on:function(e,t){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in e)this.on(i,e[i]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},once:function(e,i){if(1===arguments.length)for(var n in e)t.call(this,n,e[n]);else t.call(this,e,i);return this},off:function(t,i){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)e.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var n in t)e.call(this,n,t[n]);else e.call(this,t,i);return this}}}(),S.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,i){var n=this._objects;return i?n[t]=e:n.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,i=!1,n=0,r=arguments.length;n<r;n++)-1!==(e=t.indexOf(arguments[n]))&&(i=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[n]));return this.renderOnAddRemove&&i&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var i=this.getObjects(),n=0,r=i.length;n<r;n++)e.call(t,i[n],n,i);return this},getObjects:function(e){return void 0===e?this._objects.concat():this._objects.filter((function(t){return t.type===e}))},item:function(e){return this._objects[e]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e,t){return this._objects.indexOf(e)>-1||!!t&&this._objects.some((function(t){return"function"==typeof t.contains&&t.contains(e,!0)}))},complexity:function(){return this._objects.reduce((function(e,t){return e+=t.complexity?t.complexity():0}),0)}},S.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,t){!e||!e.colorStops||e instanceof S.Gradient||this.set(t,new S.Gradient(e))},_initPattern:function(e,t,i){!e||!e.source||e instanceof S.Pattern?i&&i():this.set(t,new S.Pattern(e,i))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return"object"==typeof e?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return"boolean"==typeof t&&this.set(e,!t),this},get:function(e){return this[e]}},n=t,r=Math.sqrt,a=Math.atan2,o=Math.pow,s=Math.PI/180,l=Math.PI/2,S.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/l){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(0===e)return 0;var t=1;switch(e<0&&(t=-1),e/l){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var i=e.indexOf(t);return-1!==i&&e.splice(i,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*s},radiansToDegrees:function(e){return e/s},rotatePoint:function(e,t,i){var n=new S.Point(e.x-t.x,e.y-t.y),r=S.util.rotateVector(n,i);return new S.Point(r.x,r.y).addEquals(t)},rotateVector:function(e,t){var i=S.util.sin(t),n=S.util.cos(t);return{x:e.x*n-e.y*i,y:e.x*i+e.y*n}},transformPoint:function(e,t,i){return i?new S.Point(t[0]*e.x+t[2]*e.y,t[1]*e.x+t[3]*e.y):new S.Point(t[0]*e.x+t[2]*e.y+t[4],t[1]*e.x+t[3]*e.y+t[5])},makeBoundingBoxFromPoints:function(e,t){if(t)for(var i=0;i<e.length;i++)e[i]=S.util.transformPoint(e[i],t);var n=[e[0].x,e[1].x,e[2].x,e[3].x],r=S.util.array.min(n),a=S.util.array.max(n)-r,o=[e[0].y,e[1].y,e[2].y,e[3].y],s=S.util.array.min(o);return{left:r,top:s,width:a,height:S.util.array.max(o)-s}},invertTransform:function(e){var t=1/(e[0]*e[3]-e[1]*e[2]),i=[t*e[3],-t*e[1],-t*e[2],t*e[0]],n=S.util.transformPoint({x:e[4],y:e[5]},i,!0);return i[4]=-n.x,i[5]=-n.y,i},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,t){var i=/\D{0,2}$/.exec(e),n=parseFloat(e);switch(t||(t=S.Text.DEFAULT_SVG_FONT_SIZE),i[0]){case"mm":return n*S.DPI/25.4;case"cm":return n*S.DPI/2.54;case"in":return n*S.DPI;case"pt":return n*S.DPI/72;case"pc":return n*S.DPI/72*12;case"em":return n*t;default:return n}},falseFunction:function(){return!1},getKlass:function(e,t){return e=S.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),S.util.resolveNamespace(t)[e]},getSvgAttributes:function(e){var t=["instantiated_by_use","style","id","class"];switch(e){case"linearGradient":t=t.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":t=t.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":t=t.concat(["offset","stop-color","stop-opacity"])}return t},resolveNamespace:function(e){if(!e)return S;var t,i=e.split("."),r=i.length,a=n||S.window;for(t=0;t<r;++t)a=a[i[t]];return a},loadImage:function(e,t,i,n){if(e){var r=S.util.createImage(),a=function(){t&&t.call(i,r,!1),r=r.onload=r.onerror=null};r.onload=a,r.onerror=function(){S.log("Error loading "+r.src),t&&t.call(i,null,!0),r=r.onload=r.onerror=null},0!==e.indexOf("data")&&null!=n&&(r.crossOrigin=n),"data:image/svg"===e.substring(0,14)&&(r.onload=null,S.util.loadImageInDom(r,a)),r.src=e}else t&&t.call(i,e)},loadImageInDom:function(e,t){var i=S.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(e),S.document.querySelector("body").appendChild(i),e.onload=function(){t(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(e,t,i,n){var r=[],a=0,o=(e=e||[]).length;function s(){++a===o&&t&&t(r.filter((function(e){return e})))}o?e.forEach((function(e,t){e&&e.type?S.util.getKlass(e.type,i).fromObject(e,(function(i,a){a||(r[t]=i),n&&n(e,i,a),s()})):s()})):t&&t(r)},enlivenPatterns:function(e,t){function i(){++r===a&&t&&t(n)}var n=[],r=0,a=(e=e||[]).length;a?e.forEach((function(e,t){e&&e.source?new S.Pattern(e,(function(e){n[t]=e,i()})):(n[t]=e,i())})):t&&t(n)},groupSVGElements:function(e,t,i){var n;return e&&1===e.length?e[0]:(t&&(t.width&&t.height?t.centerPoint={x:t.width/2,y:t.height/2}:(delete t.width,delete t.height)),n=new S.Group(e,t),void 0!==i&&(n.sourcePath=i),n)},populateWithProperties:function(e,t,i){if(i&&"[object Array]"===Object.prototype.toString.call(i))for(var n=0,r=i.length;n<r;n++)i[n]in e&&(t[i[n]]=e[i[n]])},drawDashedLine:function(e,t,i,n,o,s){var l=n-t,c=o-i,h=r(l*l+c*c),u=a(c,l),f=s.length,d=0,m=!0;for(e.save(),e.translate(t,i),e.moveTo(0,0),e.rotate(u),t=0;h>t;)(t+=s[d++%f])>h&&(t=h),e[m?"lineTo":"moveTo"](t,0),m=!m;e.restore()},createCanvasElement:function(){return S.document.createElement("canvas")},copyCanvasElement:function(e){var t=S.util.createCanvasElement();return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t},toDataURL:function(e,t,i){return e.toDataURL("image/"+t,i)},createImage:function(){return S.document.createElement("img")},multiplyTransformMatrices:function(e,t,i){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],i?0:e[0]*t[4]+e[2]*t[5]+e[4],i?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=a(e[1],e[0]),i=o(e[0],2)+o(e[1],2),n=r(i),l=(e[0]*e[3]-e[2]*e[1])/n,c=a(e[0]*e[2]+e[1]*e[3],i);return{angle:t/s,scaleX:n,scaleY:l,skewX:c/s,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return S.iMatrix.concat();var t=S.util.degreesToRadians(e.angle),i=S.util.cos(t),n=S.util.sin(t);return[i,n,-n,i,0,0]},calcDimensionsMatrix:function(e){var t=void 0===e.scaleX?1:e.scaleX,i=void 0===e.scaleY?1:e.scaleY,n=[e.flipX?-t:t,0,0,e.flipY?-i:i,0,0],r=S.util.multiplyTransformMatrices,a=S.util.degreesToRadians;return e.skewX&&(n=r(n,[1,0,Math.tan(a(e.skewX)),1],!0)),e.skewY&&(n=r(n,[1,Math.tan(a(e.skewY)),0,1],!0)),n},composeMatrix:function(e){var t=[1,0,0,1,e.translateX||0,e.translateY||0],i=S.util.multiplyTransformMatrices;return e.angle&&(t=i(t,S.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(t=i(t,S.util.calcDimensionsMatrix(e))),t},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,i,n){n>0&&(t>n?t-=n:t=0,i>n?i-=n:i=0);var r,a=!0,o=e.getImageData(t,i,2*n||1,2*n||1),s=o.data.length;for(r=3;r<s&&!1!=(a=o.data[r]<=0);r+=4);return o=null,a},parsePreserveAspectRatioAttribute:function(e){var t,i="meet",n=e.split(" ");return n&&n.length&&("meet"!==(i=n.pop())&&"slice"!==i?(t=i,i="meet"):n.length&&(t=n.pop())),{meetOrSlice:i,alignX:"none"!==t?t.slice(1,4):"none",alignY:"none"!==t?t.slice(5,8):"none"}},clearFabricFontCache:function(e){(e=(e||"").toLowerCase())?S.charWidthsCache[e]&&delete S.charWidthsCache[e]:S.charWidthsCache={}},limitDimsByArea:function(e,t){var i=Math.sqrt(t*e),n=Math.floor(t/i);return{x:Math.floor(i),y:n}},capValue:function(e,t,i){return Math.max(e,Math.min(t,i))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return"matrix("+e.map((function(e){return S.util.toFixed(e,S.Object.NUM_FRACTION_DIGITS)})).join(" ")+")"},removeTransformFromObject:function(e,t){var i=S.util.invertTransform(t),n=S.util.multiplyTransformMatrices(i,e.calcOwnMatrix());S.util.applyTransformToObject(e,n)},addTransformToObject:function(e,t){S.util.applyTransformToObject(e,S.util.multiplyTransformMatrices(t,e.calcOwnMatrix()))},applyTransformToObject:function(e,t){var i=S.util.qrDecompose(t),n=new S.Point(i.translateX,i.translateY);e.flipX=!1,e.flipY=!1,e.set("scaleX",i.scaleX),e.set("scaleY",i.scaleY),e.skewX=i.skewX,e.skewY=i.skewY,e.angle=i.angle,e.setPositionByOrigin(n,"center","center")},sizeAfterTransform:function(e,t,i){var n=e/2,r=t/2,a=[{x:-n,y:-r},{x:n,y:-r},{x:-n,y:r},{x:n,y:r}],o=S.util.calcDimensionsMatrix(i),s=S.util.makeBoundingBoxFromPoints(a,o);return{x:s.width,y:s.height}}},function(){var e=Array.prototype.join,t={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},i={m:"l",M:"L"};function n(e,t,i,n,r,a,o,s,l,c,h){var u=S.util.cos(e),f=S.util.sin(e),d=S.util.cos(t),m=S.util.sin(t),g=i*r*d-n*a*m+o,v=n*r*d+i*a*m+s;return["C",c+l*(-i*r*f-n*a*u),h+l*(-n*r*f+i*a*u),g+l*(i*r*m+n*a*d),v+l*(n*r*m-i*a*d),g,v]}function r(e,t,i,r,o,s,l){var c=Math.PI,h=l*c/180,u=S.util.sin(h),f=S.util.cos(h),d=0,m=0,g=-f*e*.5-u*t*.5,v=-f*t*.5+u*e*.5,p=(i=Math.abs(i))*i,y=(r=Math.abs(r))*r,b=v*v,w=g*g,x=p*y-p*b-y*w,k=0;if(x<0){var C=Math.sqrt(1-x/(p*y));i*=C,r*=C}else k=(o===s?-1:1)*Math.sqrt(x/(p*b+y*w));var _=k*i*v/r,T=-k*r*g/i,O=f*_-u*T+.5*e,E=u*_+f*T+.5*t,R=a(1,0,(g-_)/i,(v-T)/r),I=a((g-_)/i,(v-T)/r,(-g-_)/i,(-v-T)/r);0===s&&I>0?I-=2*c:1===s&&I<0&&(I+=2*c);for(var A=Math.ceil(Math.abs(I/c*2)),D=[],P=I/A,F=8/3*Math.sin(P/4)*Math.sin(P/4)/Math.sin(P/2),M=R+P,L=0;L<A;L++)D[L]=n(R,M,f,u,i,r,O,E,F,d,m),d=D[L][5],m=D[L][6],R=M,M+=P;return D}function a(e,t,i,n){var r=Math.atan2(t,e),a=Math.atan2(n,i);return a>=r?a-r:2*Math.PI-(r-a)}function o(t,i,n,r,a,o,s,l){var c;if(S.cachesBoundsOfCurve&&(c=e.call(arguments),S.boundsOfCurveCache[c]))return S.boundsOfCurveCache[c];var h,u,f,d,m,g,v,p,y=Math.sqrt,b=Math.min,w=Math.max,x=Math.abs,k=[],C=[[],[]];u=6*t-12*n+6*a,h=-3*t+9*n-9*a+3*s,f=3*n-3*t;for(var _=0;_<2;++_)if(_>0&&(u=6*i-12*r+6*o,h=-3*i+9*r-9*o+3*l,f=3*r-3*i),x(h)<1e-12){if(x(u)<1e-12)continue;0<(d=-f/u)&&d<1&&k.push(d)}else(v=u*u-4*f*h)<0||(0<(m=(-u+(p=y(v)))/(2*h))&&m<1&&k.push(m),0<(g=(-u-p)/(2*h))&&g<1&&k.push(g));for(var T,O,E,R=k.length,I=R;R--;)T=(E=1-(d=k[R]))*E*E*t+3*E*E*d*n+3*E*d*d*a+d*d*d*s,C[0][R]=T,O=E*E*E*i+3*E*E*d*r+3*E*d*d*o+d*d*d*l,C[1][R]=O;C[0][I]=t,C[1][I]=i,C[0][I+1]=s,C[1][I+1]=l;var A=[{x:b.apply(null,C[0]),y:b.apply(null,C[1])},{x:w.apply(null,C[0]),y:w.apply(null,C[1])}];return S.cachesBoundsOfCurve&&(S.boundsOfCurveCache[c]=A),A}function s(e,t,i){for(var n=i[1],a=i[2],o=i[3],s=i[4],l=i[5],c=r(i[6]-e,i[7]-t,n,a,s,l,o),h=0,u=c.length;h<u;h++)c[h][1]+=e,c[h][2]+=t,c[h][3]+=e,c[h][4]+=t,c[h][5]+=e,c[h][6]+=t;return c}function l(e,t,i,n){return Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))}function c(e,t,i,n,r,a,o,s){return function(l){var c,h=(c=l)*c*c,u=function(e){return 3*e*e*(1-e)}(l),f=function(e){return 3*e*(1-e)*(1-e)}(l),d=function(e){return(1-e)*(1-e)*(1-e)}(l);return{x:o*h+r*u+i*f+e*d,y:s*h+a*u+n*f+t*d}}}function h(e,t,i,n,r,a,o,s){return function(l){var c=1-l,h=3*c*c*(i-e)+6*c*l*(r-i)+3*l*l*(o-r),u=3*c*c*(n-t)+6*c*l*(a-n)+3*l*l*(s-a);return Math.atan2(u,h)}}function u(e,t,i,n,r,a){return function(o){var s,l=(s=o)*s,c=function(e){return 2*e*(1-e)}(o),h=function(e){return(1-e)*(1-e)}(o);return{x:r*l+i*c+e*h,y:a*l+n*c+t*h}}}function f(e,t,i,n,r,a){return function(o){var s=1-o,l=2*s*(i-e)+2*o*(r-i),c=2*s*(n-t)+2*o*(a-n);return Math.atan2(c,l)}}function d(e,t,i){var n,r,a={x:t,y:i},o=0;for(r=1;r<=100;r+=1)n=e(r/100),o+=l(a.x,a.y,n.x,n.y),a=n;return o}function m(e,t){for(var i,n,r,a=0,o=0,s=e.iterator,c={x:e.x,y:e.y},h=.01,u=e.angleFinder;o<t&&a<=1&&h>1e-4;)i=s(a),r=a,(n=l(c.x,c.y,i.x,i.y))+o>t?a-=h/=2:(c=i,a+=h,o+=n);return i.angle=u(r),i}function g(e){for(var t,i,n,r,a=0,o=e.length,s=0,m=0,g=0,v=0,p=[],y=0;y<o;y++){switch(n={x:s,y:m,command:(t=e[y])[0]},t[0]){case"M":n.length=0,g=s=t[1],v=m=t[2];break;case"L":n.length=l(s,m,t[1],t[2]),s=t[1],m=t[2];break;case"C":i=c(s,m,t[1],t[2],t[3],t[4],t[5],t[6]),r=h(s,m,t[1],t[2],t[3],t[4],t[5],t[6]),n.iterator=i,n.angleFinder=r,n.length=d(i,s,m),s=t[5],m=t[6];break;case"Q":i=u(s,m,t[1],t[2],t[3],t[4]),r=f(s,m,t[1],t[2],t[3],t[4]),n.iterator=i,n.angleFinder=r,n.length=d(i,s,m),s=t[3],m=t[4];break;case"Z":case"z":n.destX=g,n.destY=v,n.length=l(s,m,g,v),s=g,m=v}a+=n.length,p.push(n)}return p.push({length:a,x:s,y:m}),p}S.util.joinPath=function(e){return e.map((function(e){return e.join(" ")})).join(" ")},S.util.parsePath=function(e){var n,r,a,o,s,l=[],c=[],h=S.rePathCommand,u="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+u+")"+S.commaWsp,d="([01])"+S.commaWsp+"?",m=new RegExp(f+"?"+f+"?"+f+d+d+f+"?("+u+")","g");if(!e||!e.match)return l;for(var g,v=0,p=(s=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;v<p;v++){o=(n=s[v]).slice(1).trim(),c.length=0;var y=n.charAt(0);if(g=[y],"a"===y.toLowerCase())for(var b;b=m.exec(o);)for(var w=1;w<b.length;w++)c.push(b[w]);else for(;a=h.exec(o);)c.push(a[0]);w=0;for(var x=c.length;w<x;w++)r=parseFloat(c[w]),isNaN(r)||g.push(r);var k=t[y.toLowerCase()],C=i[y]||y;if(g.length-1>k)for(var _=1,T=g.length;_<T;_+=k)l.push([y].concat(g.slice(_,_+k))),y=C;else l.push(g)}return l},S.util.makePathSimpler=function(e){var t,i,n,r,a,o,l=0,c=0,h=e.length,u=0,f=0,d=[];for(i=0;i<h;++i){switch(n=!1,(t=e[i].slice(0))[0]){case"l":t[0]="L",t[1]+=l,t[2]+=c;case"L":l=t[1],c=t[2];break;case"h":t[1]+=l;case"H":t[0]="L",t[2]=c,l=t[1];break;case"v":t[1]+=c;case"V":t[0]="L",c=t[1],t[1]=l,t[2]=c;break;case"m":t[0]="M",t[1]+=l,t[2]+=c;case"M":l=t[1],c=t[2],u=t[1],f=t[2];break;case"c":t[0]="C",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c,t[5]+=l,t[6]+=c;case"C":a=t[3],o=t[4],l=t[5],c=t[6];break;case"s":t[0]="S",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"S":"C"===r?(a=2*l-a,o=2*c-o):(a=l,o=c),l=t[3],c=t[4],t[0]="C",t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=a,t[2]=o,a=t[3],o=t[4];break;case"q":t[0]="Q",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"Q":a=t[1],o=t[2],l=t[3],c=t[4];break;case"t":t[0]="T",t[1]+=l,t[2]+=c;case"T":"Q"===r?(a=2*l-a,o=2*c-o):(a=l,o=c),t[0]="Q",l=t[1],c=t[2],t[1]=a,t[2]=o,t[3]=l,t[4]=c;break;case"a":t[0]="A",t[6]+=l,t[7]+=c;case"A":n=!0,d=d.concat(s(l,c,t)),l=t[6],c=t[7];break;case"z":case"Z":l=u,c=f}n||d.push(t),r=t[0]}return d},S.util.getSmoothPathFromPoints=function(e,t){var i,n=[],r=new S.Point(e[0].x,e[0].y),a=new S.Point(e[1].x,e[1].y),o=e.length,s=1,l=0,c=o>2;for(t=t||0,c&&(s=e[2].x<a.x?-1:e[2].x===a.x?0:1,l=e[2].y<a.y?-1:e[2].y===a.y?0:1),n.push(["M",r.x-s*t,r.y-l*t]),i=1;i<o;i++){if(!r.eq(a)){var h=r.midPointFrom(a);n.push(["Q",r.x,r.y,h.x,h.y])}r=e[i],i+1<e.length&&(a=e[i+1])}return c&&(s=r.x>e[i-2].x?1:r.x===e[i-2].x?0:-1,l=r.y>e[i-2].y?1:r.y===e[i-2].y?0:-1),n.push(["L",r.x+s*t,r.y+l*t]),n},S.util.getPathSegmentsInfo=g,S.util.getBoundsOfCurve=o,S.util.getPointOnPath=function(e,t,i){i||(i=g(e));for(var n=0;t-i[n].length>0&&n<i.length-2;)t-=i[n].length,n++;var r,a=i[n],o=t/a.length,s=a.command,l=e[n];switch(s){case"M":return{x:a.x,y:a.y,angle:0};case"Z":case"z":return(r=new S.Point(a.x,a.y).lerp(new S.Point(a.destX,a.destY),o)).angle=Math.atan2(a.destY-a.y,a.destX-a.x),r;case"L":return(r=new S.Point(a.x,a.y).lerp(new S.Point(l[1],l[2]),o)).angle=Math.atan2(l[2]-a.y,l[1]-a.x),r;case"C":case"Q":return m(a,t)}},S.util.transformPath=function(e,t,i){return i&&(t=S.util.multiplyTransformMatrices(t,[1,0,0,1,-i.x,-i.y])),e.map((function(e){for(var i=e.slice(0),n={},r=1;r<e.length-1;r+=2)n.x=e[r],n.y=e[r+1],n=S.util.transformPoint(n,t),i[r]=n.x,i[r+1]=n.y;return i}))},S.util.fromArcToBeizers=s,S.util.getBoundsOfArc=function(e,t,i,n,a,s,l,c,h){for(var u,f=0,d=0,m=[],g=r(c-e,h-t,i,n,s,l,a),v=0,p=g.length;v<p;v++)u=o(f,d,g[v][1],g[v][2],g[v][3],g[v][4],g[v][5],g[v][6]),m.push({x:u[0].x+e,y:u[0].y+t}),m.push({x:u[1].x+e,y:u[1].y+t}),f=g[v][5],d=g[v][6];return m},S.util.drawArc=function(e,t,i,n){s(t,i,n=n.slice(0).unshift("X")).forEach((function(t){e.bezierCurveTo.apply(e,t.slice(1))}))}}(),function(){var e=Array.prototype.slice;function t(e,t,i){if(e&&0!==e.length){var n=e.length-1,r=t?e[n][t]:e[n];if(t)for(;n--;)i(e[n][t],r)&&(r=e[n][t]);else for(;n--;)i(e[n],r)&&(r=e[n]);return r}}S.util.array={fill:function(e,t){for(var i=e.length;i--;)e[i]=t;return e},invoke:function(t,i){for(var n=e.call(arguments,2),r=[],a=0,o=t.length;a<o;a++)r[a]=n.length?t[a][i].apply(t[a],n):t[a][i].call(t[a]);return r},min:function(e,i){return t(e,i,(function(e,t){return e<t}))},max:function(e,i){return t(e,i,(function(e,t){return e>=t}))}}}(),function(){function e(t,i,n){if(n)if(!S.isLikelyNode&&i instanceof Element)t=i;else if(i instanceof Array){t=[];for(var r=0,a=i.length;r<a;r++)t[r]=e({},i[r],n)}else if(i&&"object"==typeof i)for(var o in i)"canvas"===o||"group"===o?t[o]=null:i.hasOwnProperty(o)&&(t[o]=e({},i[o],n));else t=i;else for(var o in i)t[o]=i[o];return t}S.util.object={extend:e,clone:function(t,i){return e({},t,i)}},S.util.object.extend(S.util,S.Observable)}(),function(){function e(e,t){var i=e.charCodeAt(t);if(isNaN(i))return"";if(i<55296||i>57343)return e.charAt(t);if(55296<=i&&i<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var n=e.charCodeAt(t+1);if(56320>n||n>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(0===t)throw"Low surrogate without preceding high surrogate";var r=e.charCodeAt(t-1);if(55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}S.util.string={camelize:function(e){return e.replace(/-+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},graphemeSplit:function(t){var i,n=0,r=[];for(n=0;n<t.length;n++)!1!==(i=e(t,n))&&r.push(i);return r}}}(),function(){var e=Array.prototype.slice,t=function(){},i=function(){for(var e in{toString:1})if("toString"===e)return!1;return!0}(),n=function(e,t,n){for(var r in t)r in e.prototype&&"function"==typeof e.prototype[r]&&(t[r]+"").indexOf("callSuper")>-1?e.prototype[r]=function(e){return function(){var i=this.constructor.superclass;this.constructor.superclass=n;var r=t[e].apply(this,arguments);if(this.constructor.superclass=i,"initialize"!==e)return r}}(r):e.prototype[r]=t[r],i&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function r(){}function a(t){for(var i=null,n=this;n.constructor.superclass;){var r=n.constructor.superclass.prototype[t];if(n[t]!==r){i=r;break}n=n.constructor.superclass.prototype}return i?arguments.length>1?i.apply(this,e.call(arguments,1)):i.call(this):console.log("tried to callSuper "+t+", method not found in prototype chain",this)}S.util.createClass=function(){var i=null,o=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof o[0]&&(i=o.shift()),s.superclass=i,s.subclasses=[],i&&(r.prototype=i.prototype,s.prototype=new r,i.subclasses.push(s));for(var l=0,c=o.length;l<c;l++)n(s,o[l],i);return s.prototype.initialize||(s.prototype.initialize=t),s.prototype.constructor=s,s.prototype.callSuper=a,s}}(),c=!!S.document.createElement("div").attachEvent,h=["touchstart","touchmove","touchend"],S.util.addListener=function(e,t,i,n){e&&e.addEventListener(t,i,!c&&n)},S.util.removeListener=function(e,t,i,n){e&&e.removeEventListener(t,i,!c&&n)},S.util.getPointer=function(e){var t=e.target,i=S.util.getScrollLeftTop(t),n=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:n.clientX+i.left,y:n.clientY+i.top}},S.util.isTouchEvent=function(e){return h.indexOf(e.type)>-1||"touch"===e.pointerType},u=S.document.createElement("div"),f="string"==typeof u.style.opacity,d="string"==typeof u.style.filter,m=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,g=function(e){return e},f?g=function(e,t){return e.style.opacity=t,e}:d&&(g=function(e,t){var i=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(i.zoom=1),m.test(i.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",i.filter=i.filter.replace(m,t)):i.filter+=" alpha(opacity="+100*t+")",e}),S.util.setStyle=function(e,t){var i=e.style;if(!i)return e;if("string"==typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?g(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var n in t)"opacity"===n?g(e,t[n]):i["float"===n||"cssFloat"===n?void 0===i.styleFloat?"cssFloat":"styleFloat":n]=t[n];return e},function(){var e=Array.prototype.slice;var t,i,n,r,a=function(t){return e.call(t,0)};try{t=a(S.document.childNodes)instanceof Array}catch(e){}function o(e,t){var i=S.document.createElement(e);for(var n in t)"class"===n?i.className=t[n]:"for"===n?i.htmlFor=t[n]:i.setAttribute(n,t[n]);return i}function s(e){for(var t=0,i=0,n=S.document.documentElement,r=S.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===S.document?(t=r.scrollLeft||n.scrollLeft||0,i=r.scrollTop||n.scrollTop||0):(t+=e.scrollLeft||0,i+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:t,top:i}}t||(a=function(e){for(var t=new Array(e.length),i=e.length;i--;)t[i]=e[i];return t}),i=S.document.defaultView&&S.document.defaultView.getComputedStyle?function(e,t){var i=S.document.defaultView.getComputedStyle(e,null);return i?i[t]:void 0}:function(e,t){var i=e.style[t];return!i&&e.currentStyle&&(i=e.currentStyle[t]),i},n=S.document.documentElement.style,r="userSelect"in n?"userSelect":"MozUserSelect"in n?"MozUserSelect":"WebkitUserSelect"in n?"WebkitUserSelect":"KhtmlUserSelect"in n?"KhtmlUserSelect":"",S.util.makeElementUnselectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=S.util.falseFunction),r?e.style[r]="none":"string"==typeof e.unselectable&&(e.unselectable="on"),e},S.util.makeElementSelectable=function(e){return void 0!==e.onselectstart&&(e.onselectstart=null),r?e.style[r]="":"string"==typeof e.unselectable&&(e.unselectable=""),e},S.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},S.util.getById=function(e){return"string"==typeof e?S.document.getElementById(e):e},S.util.toArray=a,S.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},S.util.makeElement=o,S.util.wrapElement=function(e,t,i){return"string"==typeof t&&(t=o(t,i)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},S.util.getScrollLeftTop=s,S.util.getElementOffset=function(e){var t,n,r=e&&e.ownerDocument,a={left:0,top:0},o={left:0,top:0},l={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return o;for(var c in l)o[l[c]]+=parseInt(i(e,c),10)||0;return t=r.documentElement,void 0!==e.getBoundingClientRect&&(a=e.getBoundingClientRect()),n=s(e),{left:a.left+n.left-(t.clientLeft||0)+o.left,top:a.top+n.top-(t.clientTop||0)+o.top}},S.util.getNodeCanvas=function(e){var t=S.jsdomImplForWrapper(e);return t._canvas||t._image},S.util.cleanUpJsdomNode=function(e){if(S.isLikelyNode){var t=S.jsdomImplForWrapper(e);t&&(t._image=null,t._canvas=null,t._currentSrc=null,t._attributes=null,t._classList=null)}}}(),function(){function e(){}S.util.request=function(t,i){i||(i={});var n=i.method?i.method.toUpperCase():"GET",r=i.onComplete||function(){},a=new S.window.XMLHttpRequest,o=i.body||i.parameters;return a.onreadystatechange=function(){4===a.readyState&&(r(a),a.onreadystatechange=e)},"GET"===n&&(o=null,"string"==typeof i.parameters&&(t=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(t,i.parameters))),a.open(n,t,!0),"POST"!==n&&"PUT"!==n||a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(o),a}}(),S.log=console.log,S.warn=console.warn,function(){function e(){return!1}function t(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t}var i=S.window.requestAnimationFrame||S.window.webkitRequestAnimationFrame||S.window.mozRequestAnimationFrame||S.window.oRequestAnimationFrame||S.window.msRequestAnimationFrame||function(e){return S.window.setTimeout(e,1e3/60)},n=S.window.cancelAnimationFrame||S.window.clearTimeout;function r(){return i.apply(S.window,arguments)}S.util.animate=function(i){var n=!1;return r((function(a){i||(i={});var o,s=a||+new Date,l=i.duration||500,c=s+l,h=i.onChange||e,u=i.abort||e,f=i.onComplete||e,d=i.easing||t,m="startValue"in i?i.startValue:0,g="endValue"in i?i.endValue:100,v=i.byValue||g-m;i.onStart&&i.onStart(),function e(t){var i=(o=t||+new Date)>c?l:o-s,a=i/l,p=d(i,m,v,l),y=Math.abs((p-m)/v);if(!n){if(!u(p,y,a))return o>c?(h(g,1,1),void f(g,1,1)):(h(p,y,a),void r(e));f(g,1,1)}}(s)})),function(){n=!0}},S.util.requestAnimFrame=r,S.util.cancelAnimFrame=function(){return n.apply(S.window,arguments)}}(),function(){function e(e,t,i){var n="rgba("+parseInt(e[0]+i*(t[0]-e[0]),10)+","+parseInt(e[1]+i*(t[1]-e[1]),10)+","+parseInt(e[2]+i*(t[2]-e[2]),10);return n+=","+(e&&t?parseFloat(e[3]+i*(t[3]-e[3])):1),n+=")"}S.util.animateColor=function(t,i,n,r){var a=new S.Color(t).getSource(),o=new S.Color(i).getSource(),s=r.onComplete,l=r.onChange;return r=r||{},S.util.animate(S.util.object.extend(r,{duration:n||500,startValue:a,endValue:o,byValue:o,easing:function(t,i,n,a){return e(i,n,r.colorEasing?r.colorEasing(t,a):1-Math.cos(t/a*(Math.PI/2)))},onComplete:function(t,i,n){if(s)return s(e(o,o,0),i,n)},onChange:function(t,i,n){if(l){if(Array.isArray(t))return l(e(t,t,0),i,n);l(t,i,n)}}}))}}(),function(){function e(e,t,i,n){return e<Math.abs(t)?(e=t,n=i/4):n=0===t&&0===e?i/(2*Math.PI)*Math.asin(1):i/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:i,s:n}}function t(e,t,i){return e.a*Math.pow(2,10*(t-=1))*Math.sin((t*i-e.s)*(2*Math.PI)/e.p)}function i(e,t,i,r){return i-n(r-e,0,i,r)+t}function n(e,t,i,n){return(e/=n)<1/2.75?i*(7.5625*e*e)+t:e<2/2.75?i*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?i*(7.5625*(e-=2.25/2.75)*e+.9375)+t:i*(7.5625*(e-=2.625/2.75)*e+.984375)+t}S.util.ease={easeInQuad:function(e,t,i,n){return i*(e/=n)*e+t},easeOutQuad:function(e,t,i,n){return-i*(e/=n)*(e-2)+t},easeInOutQuad:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,i,n){return i*(e/=n)*e*e+t},easeOutCubic:function(e,t,i,n){return i*((e=e/n-1)*e*e+1)+t},easeInOutCubic:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,i,n){return i*(e/=n)*e*e*e+t},easeOutQuart:function(e,t,i,n){return-i*((e=e/n-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e+t:-i/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,i,n){return i*(e/=n)*e*e*e*e+t},easeOutQuint:function(e,t,i,n){return i*((e=e/n-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t},easeOutSine:function(e,t,i,n){return i*Math.sin(e/n*(Math.PI/2))+t},easeInOutSine:function(e,t,i,n){return-i/2*(Math.cos(Math.PI*e/n)-1)+t},easeInExpo:function(e,t,i,n){return 0===e?t:i*Math.pow(2,10*(e/n-1))+t},easeOutExpo:function(e,t,i,n){return e===n?t+i:i*(1-Math.pow(2,-10*e/n))+t},easeInOutExpo:function(e,t,i,n){return 0===e?t:e===n?t+i:(e/=n/2)<1?i/2*Math.pow(2,10*(e-1))+t:i/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,i,n){return-i*(Math.sqrt(1-(e/=n)*e)-1)+t},easeOutCirc:function(e,t,i,n){return i*Math.sqrt(1-(e=e/n-1)*e)+t},easeInOutCirc:function(e,t,i,n){return(e/=n/2)<1?-i/2*(Math.sqrt(1-e*e)-1)+t:i/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(i,n,r,a){var o=0;return 0===i?n:1===(i/=a)?n+r:(o||(o=.3*a),-t(e(r,r,o,1.70158),i,a)+n)},easeOutElastic:function(t,i,n,r){var a=0;if(0===t)return i;if(1===(t/=r))return i+n;a||(a=.3*r);var o=e(n,n,a,1.70158);return o.a*Math.pow(2,-10*t)*Math.sin((t*r-o.s)*(2*Math.PI)/o.p)+o.c+i},easeInOutElastic:function(i,n,r,a){var o=0;if(0===i)return n;if(2===(i/=a/2))return n+r;o||(o=a*(.3*1.5));var s=e(r,r,o,1.70158);return i<1?-.5*t(s,i,a)+n:s.a*Math.pow(2,-10*(i-=1))*Math.sin((i*a-s.s)*(2*Math.PI)/s.p)*.5+s.c+n},easeInBack:function(e,t,i,n,r){return void 0===r&&(r=1.70158),i*(e/=n)*e*((r+1)*e-r)+t},easeOutBack:function(e,t,i,n,r){return void 0===r&&(r=1.70158),i*((e=e/n-1)*e*((r+1)*e+r)+1)+t},easeInOutBack:function(e,t,i,n,r){return void 0===r&&(r=1.70158),(e/=n/2)<1?i/2*(e*e*((1+(r*=1.525))*e-r))+t:i/2*((e-=2)*e*((1+(r*=1.525))*e+r)+2)+t},easeInBounce:i,easeOutBounce:n,easeInOutBounce:function(e,t,r,a){return e<a/2?.5*i(2*e,0,r,a)+t:.5*n(2*e-a,0,r,a)+.5*r+t}}}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.object.clone,r=t.util.toFixed,a=t.util.parseUnit,o=t.util.multiplyTransformMatrices,s={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},l={stroke:"strokeOpacity",fill:"fillOpacity"};function c(e){return e in s?s[e]:e}function h(e,i,n,r){var s,l="[object Array]"===Object.prototype.toString.call(i);if("fill"!==e&&"stroke"!==e||"none"!==i){if("strokeUniform"===e)return"non-scaling-stroke"===i;if("strokeDashArray"===e)i="none"===i?null:i.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===e)i=n&&n.transformMatrix?o(n.transformMatrix,t.parseTransformAttribute(i)):t.parseTransformAttribute(i);else if("visible"===e)i="none"!==i&&"hidden"!==i,n&&!1===n.visible&&(i=!1);else if("opacity"===e)i=parseFloat(i),n&&void 0!==n.opacity&&(i*=n.opacity);else if("textAnchor"===e)i="start"===i?"left":"end"===i?"right":"center";else if("charSpacing"===e)s=a(i,r)/r*1e3;else if("paintFirst"===e){var c=i.indexOf("fill"),h=i.indexOf("stroke");i="fill";(c>-1&&h>-1&&h<c||-1===c&&h>-1)&&(i="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return i;if("imageSmoothing"===e)return"optimizeQuality"===i;s=l?i.map(a):a(i,r)}}else i="";return!l&&isNaN(s)?i:s}function u(e){return new RegExp("^("+e.join("|")+")\\b","i")}function f(e,t){var i,n,r,a,o=[];for(r=0,a=t.length;r<a;r++)i=t[r],n=e.getElementsByTagName(i),o=o.concat(Array.prototype.slice.call(n));return o}function d(e,t){var i,n=!0;return(i=m(e,t.pop()))&&t.length&&(n=function(e,t){var i,n=!0;for(;e.parentNode&&1===e.parentNode.nodeType&&t.length;)n&&(i=t.pop()),e=e.parentNode,n=m(e,i);return 0===t.length}(e,t)),i&&n&&0===t.length}function m(e,t){var i,n,r=e.nodeName,a=e.getAttribute("class"),o=e.getAttribute("id");if(i=new RegExp("^"+r,"i"),t=t.replace(i,""),o&&t.length&&(i=new RegExp("#"+o+"(?![a-zA-Z\\-]+)","i"),t=t.replace(i,"")),a&&t.length)for(n=(a=a.split(" ")).length;n--;)i=new RegExp("\\."+a[n]+"(?![a-zA-Z\\-]+)","i"),t=t.replace(i,"");return 0===t.length}function g(e,t){var i;if(e.getElementById&&(i=e.getElementById(t)),i)return i;var n,r,a,o=e.getElementsByTagName("*");for(r=0,a=o.length;r<a;r++)if(t===(n=o[r]).getAttribute("id"))return n}t.svgValidTagNamesRegEx=u(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),t.svgViewBoxElementsRegEx=u(["symbol","image","marker","pattern","view","svg"]),t.svgInvalidAncestorsRegEx=u(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),t.svgValidParentsRegEx=u(["symbol","g","a","svg","clipPath","defs"]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,i,n){e[n]=Math.tan(t.util.degreesToRadians(i[0]))}var i=t.iMatrix,n=t.reNum,r=t.commaWsp,a="(?:"+("(?:(matrix)\\s*\\(\\s*("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")\\s*\\))")+"|"+("(?:(translate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(scale)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(rotate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+")"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(skewX)\\s*\\(\\s*("+n+")\\s*\\))")+"|"+("(?:(skewY)\\s*\\(\\s*("+n+")\\s*\\))")+")",o=new RegExp("^\\s*(?:"+("(?:"+a+"(?:"+r+"*"+a+")*)")+"?)\\s*$"),s=new RegExp(a,"g");return function(n){var r=i.concat(),l=[];if(!n||n&&!o.test(n))return r;n.replace(s,(function(n){var o=new RegExp(a).exec(n).filter((function(e){return!!e})),s=o[1],c=o.slice(2).map(parseFloat);switch(s){case"translate":!function(e,t){e[4]=t[0],2===t.length&&(e[5]=t[1])}(r,c);break;case"rotate":c[0]=t.util.degreesToRadians(c[0]),function(e,i){var n=t.util.cos(i[0]),r=t.util.sin(i[0]),a=0,o=0;3===i.length&&(a=i[1],o=i[2]),e[0]=n,e[1]=r,e[2]=-r,e[3]=n,e[4]=a-(n*a-r*o),e[5]=o-(r*a+n*o)}(r,c);break;case"scale":!function(e,t){var i=t[0],n=2===t.length?t[1]:t[0];e[0]=i,e[3]=n}(r,c);break;case"skewX":e(r,c,2);break;case"skewY":e(r,c,1);break;case"matrix":r=c}l.push(r.concat()),r=i.concat()}));for(var c=l[0];l.length>1;)l.shift(),c=t.util.multiplyTransformMatrices(c,l[0]);return c}}();var v=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function p(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var i,n,r,o,s,l,c=e.getAttribute("viewBox"),h=1,u=1,f=e.getAttribute("width"),d=e.getAttribute("height"),m=e.getAttribute("x")||0,g=e.getAttribute("y")||0,p=e.getAttribute("preserveAspectRatio")||"",y=!c||!(c=c.match(v)),b=!f||!d||"100%"===f||"100%"===d,w=y&&b,x={},k="",C=0,_=0;if(x.width=0,x.height=0,x.toBeParsed=w,y&&(m||g)&&e.parentNode&&"#document"!==e.parentNode.nodeName&&(k=" translate("+a(m)+" "+a(g)+") ",s=(e.getAttribute("transform")||"")+k,e.setAttribute("transform",s),e.removeAttribute("x"),e.removeAttribute("y")),w)return x;if(y)return x.width=a(f),x.height=a(d),x;if(i=-parseFloat(c[1]),n=-parseFloat(c[2]),r=parseFloat(c[3]),o=parseFloat(c[4]),x.minX=i,x.minY=n,x.viewBoxWidth=r,x.viewBoxHeight=o,b?(x.width=r,x.height=o):(x.width=a(f),x.height=a(d),h=x.width/r,u=x.height/o),"none"!==(p=t.util.parsePreserveAspectRatioAttribute(p)).alignX&&("meet"===p.meetOrSlice&&(u=h=h>u?u:h),"slice"===p.meetOrSlice&&(u=h=h>u?h:u),C=x.width-r*h,_=x.height-o*h,"Mid"===p.alignX&&(C/=2),"Mid"===p.alignY&&(_/=2),"Min"===p.alignX&&(C=0),"Min"===p.alignY&&(_=0)),1===h&&1===u&&0===i&&0===n&&0===m&&0===g)return x;if((m||g)&&"#document"!==e.parentNode.nodeName&&(k=" translate("+a(m)+" "+a(g)+") "),s=k+" matrix("+h+" 0 0 "+u+" "+(i*h+C)+" "+(n*u+_)+") ","svg"===e.nodeName){for(l=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}else(l=e).removeAttribute("x"),l.removeAttribute("y"),s=l.getAttribute("transform")+s;return l.setAttribute("transform",s),x}function y(e,t){var i=g(e,t.getAttribute("xlink:href").substr(1));if(i&&i.getAttribute("xlink:href")&&y(e,i),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach((function(e){i&&!t.hasAttribute(e)&&i.hasAttribute(e)&&t.setAttribute(e,i.getAttribute(e))})),!t.children.length)for(var n=i.cloneNode(!0);n.firstChild;)t.appendChild(n.firstChild);t.removeAttribute("xlink:href")}t.parseSVGDocument=function(e,i,r,a){if(e){!function(e){for(var i=f(e,["use","svg:use"]),n=0;i.length&&n<i.length;){var r=i[n],a=r.getAttribute("xlink:href")||r.getAttribute("href");if(null===a)return;var o,s,l,c,h=a.substr(1),u=r.getAttribute("x")||0,d=r.getAttribute("y")||0,m=g(e,h).cloneNode(!0),v=(m.getAttribute("transform")||"")+" translate("+u+", "+d+")",y=i.length,b=t.svgNS;if(p(m),/^svg$/i.test(m.nodeName)){var w=m.ownerDocument.createElementNS(b,"g");for(s=0,c=(l=m.attributes).length;s<c;s++)o=l.item(s),w.setAttributeNS(b,o.nodeName,o.nodeValue);for(;m.firstChild;)w.appendChild(m.firstChild);m=w}for(s=0,c=(l=r.attributes).length;s<c;s++)"x"!==(o=l.item(s)).nodeName&&"y"!==o.nodeName&&"xlink:href"!==o.nodeName&&"href"!==o.nodeName&&("transform"===o.nodeName?v=o.nodeValue+" "+v:m.setAttribute(o.nodeName,o.nodeValue));m.setAttribute("transform",v),m.setAttribute("instantiated_by_use","1"),m.removeAttribute("id"),r.parentNode.replaceChild(m,r),i.length===y&&n++}}(e);var o,s,l=t.Object.__uid++,c=p(e),h=t.util.toArray(e.getElementsByTagName("*"));if(c.crossOrigin=a&&a.crossOrigin,c.svgUid=l,0===h.length&&t.isLikelyNode){var u=[];for(o=0,s=(h=e.selectNodes('//*[name(.)!="svg"]')).length;o<s;o++)u[o]=h[o];h=u}var d=h.filter((function(e){return p(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))&&!function(e,t){for(;e&&(e=e.parentNode);)if(e.nodeName&&t.test(e.nodeName.replace("svg:",""))&&!e.getAttribute("instantiated_by_use"))return!0;return!1}(e,t.svgInvalidAncestorsRegEx)}));if(!d||d&&!d.length)i&&i([],{});else{var m={};h.filter((function(e){return"clipPath"===e.nodeName.replace("svg:","")})).forEach((function(e){var i=e.getAttribute("id");m[i]=t.util.toArray(e.getElementsByTagName("*")).filter((function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))}))})),t.gradientDefs[l]=t.getGradientDefs(e),t.cssRules[l]=t.getCSSRules(e),t.clipPaths[l]=m,t.parseElements(d,(function(e,n){i&&(i(e,c,n,h),delete t.gradientDefs[l],delete t.cssRules[l],delete t.clipPaths[l])}),n(c),r,a)}}};var b=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+t.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+t.reNum+"))?\\s+(.*)");i(t,{parseFontDeclaration:function(e,t){var i=e.match(b);if(i){var n=i[1],r=i[3],o=i[4],s=i[5],l=i[6];n&&(t.fontStyle=n),r&&(t.fontWeight=isNaN(parseFloat(r))?r:parseFloat(r)),o&&(t.fontSize=a(o)),l&&(t.fontFamily=l),s&&(t.lineHeight="normal"===s?1:s)}},getGradientDefs:function(e){var t,i=f(e,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),n=0,r={};for(n=i.length;n--;)(t=i[n]).getAttribute("xlink:href")&&y(e,t),r[t.getAttribute("id")]=t;return r},parseAttributes:function(e,n,o){if(e){var s,u,f,m={};void 0===o&&(o=e.getAttribute("svgUid")),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(m=t.parseAttributes(e.parentNode,n,o));var g=n.reduce((function(t,i){return(s=e.getAttribute(i))&&(t[i]=s),t}),{}),v=i(function(e,i){var n={};for(var r in t.cssRules[i])if(d(e,r.split(" ")))for(var a in t.cssRules[i][r])n[a]=t.cssRules[i][r][a];return n}(e,o),t.parseStyleAttribute(e));g=i(g,v),v["clip-path"]&&e.setAttribute("clip-path",v["clip-path"]),u=f=m.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,g["font-size"]&&(g["font-size"]=u=a(g["font-size"],f));var p,y,b={};for(var w in g)y=h(p=c(w),g[w],m,u),b[p]=y;b&&b.font&&t.parseFontDeclaration(b.font,b);var x=i(m,b);return t.svgValidParentsRegEx.test(e.nodeName)?x:function(e){for(var i in l)if(void 0!==e[l[i]]&&""!==e[i]){if(void 0===e[i]){if(!t.Object.prototype[i])continue;e[i]=t.Object.prototype[i]}if(0!==e[i].indexOf("url(")){var n=new t.Color(e[i]);e[i]=n.setAlpha(r(n.getAlpha()*e[l[i]],2)).toRgba()}}return e}(x)}},parseElements:function(e,i,n,r,a){new t.ElementsParser(e,i,n,r,a).parse()},parseStyleAttribute:function(e){var t={},i=e.getAttribute("style");return i?("string"==typeof i?function(e,t){var i,n;e.replace(/;\s*$/,"").split(";").forEach((function(e){var r=e.split(":");i=r[0].trim().toLowerCase(),n=r[1].trim(),t[i]=n}))}(i,t):function(e,t){var i,n;for(var r in e)void 0!==e[r]&&(i=r.toLowerCase(),n=e[r],t[i]=n)}(i,t),t):t},parsePointsAttribute:function(e){if(!e)return null;var t,i,n=[];for(t=0,i=(e=(e=e.replace(/,/g," ").trim()).split(/\s+/)).length;t<i;t+=2)n.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return n},getCSSRules:function(e){var i,n,r=e.getElementsByTagName("style"),a={};for(i=0,n=r.length;i<n;i++){var o=r[i].textContent;""!==(o=o.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&o.match(/[^{]*\{[\s\S]*?\}/g).map((function(e){return e.trim()})).forEach((function(e){var r=e.match(/([\s\S]*?)\s*\{([^}]*)\}/),o={},s=r[2].trim().replace(/;$/,"").split(/\s*;\s*/);for(i=0,n=s.length;i<n;i++){var l=s[i].split(/\s*:\s*/),c=l[0],h=l[1];o[c]=h}(e=r[1]).split(",").forEach((function(e){""!==(e=e.replace(/^svg/i,"").trim())&&(a[e]?t.util.object.extend(a[e],o):a[e]=t.util.object.clone(o))}))}))}return a},loadSVGFromURL:function(e,i,n,r){e=e.replace(/^\n\s*/,"").trim(),new t.util.request(e,{method:"get",onComplete:function(e){var a=e.responseXML;if(!a||!a.documentElement)return i&&i(null),!1;t.parseSVGDocument(a.documentElement,(function(e,t,n,r){i&&i(e,t,n,r)}),n,r)}})},loadSVGFromString:function(e,i,n,r){var a=(new t.window.DOMParser).parseFromString(e.trim(),"text/xml");t.parseSVGDocument(a.documentElement,(function(e,t,n,r){i(e,t,n,r)}),n,r)}})}(t),S.ElementsParser=function(e,t,i,n,r,a){this.elements=e,this.callback=t,this.options=i,this.reviver=n,this.svgUid=i&&i.svgUid||0,this.parsingOptions=r,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=a},(v=S.ElementsParser.prototype).parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},v.createObjects=function(){var e=this;this.elements.forEach((function(t,i){t.setAttribute("svgUid",e.svgUid),e.createObject(t,i)}))},v.findTag=function(e){return S[S.util.string.capitalize(e.tagName.replace("svg:",""))]},v.createObject=function(e,t){var i=this.findTag(e);if(i&&i.fromElement)try{i.fromElement(e,this.createCallback(t,e),this.options)}catch(e){S.log(e)}else this.checkIfDone()},v.createCallback=function(e,t){var i=this;return function(n){var r;i.resolveGradient(n,t,"fill"),i.resolveGradient(n,t,"stroke"),n instanceof S.Image&&n._originalElement&&(r=n.parsePreserveAspectRatioAttribute(t)),n._removeTransformMatrix(r),i.resolveClipPath(n,t),i.reviver&&i.reviver(t,n),i.instances[e]=n,i.checkIfDone()}},v.extractPropertyDefinition=function(e,t,i){var n=e[t],r=this.regexUrl;if(r.test(n)){r.lastIndex=0;var a=r.exec(n)[1];return r.lastIndex=0,S[i][this.svgUid][a]}},v.resolveGradient=function(e,t,i){var n=this.extractPropertyDefinition(e,i,"gradientDefs");if(n){var r=t.getAttribute(i+"-opacity"),a=S.Gradient.fromElement(n,e,r,this.options);e.set(i,a)}},v.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},v.resolveClipPath=function(e,t){var i,n,r,a,o=this.extractPropertyDefinition(e,"clipPath","clipPaths");if(o){r=[],n=S.util.invertTransform(e.calcTransformMatrix());for(var s=o[0].parentNode,l=t;l.parentNode&&l.getAttribute("clip-path")!==e.clipPath;)l=l.parentNode;l.parentNode.appendChild(s);for(var c=0;c<o.length;c++)i=o[c],this.findTag(i).fromElement(i,this.createClipPathCallback(e,r),this.options);o=1===r.length?r[0]:new S.Group(r),a=S.util.multiplyTransformMatrices(n,o.calcTransformMatrix()),o.clipPath&&this.resolveClipPath(o,l);var h=S.util.qrDecompose(a);o.flipX=!1,o.flipY=!1,o.set("scaleX",h.scaleX),o.set("scaleY",h.scaleY),o.angle=h.angle,o.skewX=h.skewX,o.skewY=0,o.setPositionByOrigin({x:h.translateX,y:h.translateY},"center","center"),e.clipPath=o}else delete e.clipPath},v.checkIfDone=function(){0==--this.numElements&&(this.instances=this.instances.filter((function(e){return null!=e})),this.callback(this.instances,this.elements))},function(e){"use strict";var t=e.fabric||(e.fabric={});function i(e,t){this.x=e,this.y=t}t.Point?t.warn("fabric.Point is already defined"):(t.Point=i,i.prototype={type:"point",constructor:i,add:function(e){return new i(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new i(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new i(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new i(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new i(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new i(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return void 0===t&&(t=.5),t=Math.max(Math.min(1,t),0),new i(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new i(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new i(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,i=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=i},clone:function(){return new i(this.x,this.y)}})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function i(e){this.status=e,this.points=[]}t.Intersection?t.warn("fabric.Intersection is already defined"):(t.Intersection=i,t.Intersection.prototype={constructor:i,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,n,r,a){var o,s=(a.x-r.x)*(e.y-r.y)-(a.y-r.y)*(e.x-r.x),l=(n.x-e.x)*(e.y-r.y)-(n.y-e.y)*(e.x-r.x),c=(a.y-r.y)*(n.x-e.x)-(a.x-r.x)*(n.y-e.y);if(0!==c){var h=s/c,u=l/c;0<=h&&h<=1&&0<=u&&u<=1?(o=new i("Intersection")).appendPoint(new t.Point(e.x+h*(n.x-e.x),e.y+h*(n.y-e.y))):o=new i}else o=new i(0===s||0===l?"Coincident":"Parallel");return o},t.Intersection.intersectLinePolygon=function(e,t,n){var r,a,o,s,l=new i,c=n.length;for(s=0;s<c;s++)r=n[s],a=n[(s+1)%c],o=i.intersectLineLine(e,t,r,a),l.appendPoints(o.points);return l.points.length>0&&(l.status="Intersection"),l},t.Intersection.intersectPolygonPolygon=function(e,t){var n,r=new i,a=e.length;for(n=0;n<a;n++){var o=e[n],s=e[(n+1)%a],l=i.intersectLinePolygon(o,s,t);r.appendPoints(l.points)}return r.points.length>0&&(r.status="Intersection"),r},t.Intersection.intersectPolygonRectangle=function(e,n,r){var a=n.min(r),o=n.max(r),s=new t.Point(o.x,a.y),l=new t.Point(a.x,o.y),c=i.intersectLinePolygon(a,s,e),h=i.intersectLinePolygon(s,o,e),u=i.intersectLinePolygon(o,l,e),f=i.intersectLinePolygon(l,a,e),d=new i;return d.appendPoints(c.points),d.appendPoints(h.points),d.appendPoints(u.points),d.appendPoints(f.points),d.points.length>0&&(d.status="Intersection"),d})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function i(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function n(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}t.Color?t.warn("fabric.Color is already defined."):(t.Color=i,t.Color.prototype={_tryParsingColor:function(e){var t;e in i.colorNameMap&&(e=i.colorNameMap[e]),"transparent"===e&&(t=[255,255,255,0]),t||(t=i.sourceFromHex(e)),t||(t=i.sourceFromRgb(e)),t||(t=i.sourceFromHsl(e)),t||(t=[0,0,0,1]),t&&this.setSource(t)},_rgbToHsl:function(e,i,n){e/=255,i/=255,n/=255;var r,a,o,s=t.util.array.max([e,i,n]),l=t.util.array.min([e,i,n]);if(o=(s+l)/2,s===l)r=a=0;else{var c=s-l;switch(a=o>.5?c/(2-s-l):c/(s+l),s){case e:r=(i-n)/c+(i<n?6:0);break;case i:r=(n-e)/c+2;break;case n:r=(e-i)/c+4}r/=6}return[Math.round(360*r),Math.round(100*a),Math.round(100*o)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return"rgb("+e[0]+","+e[1]+","+e[2]+")"},toRgba:function(){var e=this.getSource();return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsl("+t[0]+","+t[1]+"%,"+t[2]+"%)"},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsla("+t[0]+","+t[1]+"%,"+t[2]+"%,"+e[3]+")"},toHex:function(){var e,t,i,n=this.getSource();return e=1===(e=n[0].toString(16)).length?"0"+e:e,t=1===(t=n[1].toString(16)).length?"0"+t:t,i=1===(i=n[2].toString(16)).length?"0"+i:i,e.toUpperCase()+t.toUpperCase()+i.toUpperCase()},toHexa:function(){var e,t=this.getSource();return e=1===(e=(e=Math.round(255*t[3])).toString(16)).length?"0"+e:e,this.toHex()+e.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),10),i=e[3];return this.setSource([t,t,t,i]),this},toBlackWhite:function(e){var t=this.getSource(),i=(.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),n=t[3];return e=e||127,i=Number(i)<Number(e)?0:255,this.setSource([i,i,i,n]),this},overlayWith:function(e){e instanceof i||(e=new i(e));var t,n=[],r=this.getAlpha(),a=this.getSource(),o=e.getSource();for(t=0;t<3;t++)n.push(Math.round(.5*a[t]+.5*o[t]));return n[3]=r,this.setSource(n),this}},t.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},t.Color.fromRgb=function(e){return i.fromSource(i.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(i.reRGBa);if(t){var n=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),r=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),a=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(n,10),parseInt(r,10),parseInt(a,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=i.fromRgb,t.Color.fromHsl=function(e){return i.fromSource(i.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(i.reHSLa);if(t){var r,a,o,s=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(0===l)r=a=o=c;else{var h=c<=.5?c*(l+1):c+l-c*l,u=2*c-h;r=n(u,h,s+1/3),a=n(u,h,s),o=n(u,h,s-1/3)}return[Math.round(255*r),Math.round(255*a),Math.round(255*o),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=i.fromHsl,t.Color.fromHex=function(e){return i.fromSource(i.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(i.reHex)){var t=e.slice(e.indexOf("#")+1),n=3===t.length||4===t.length,r=8===t.length||4===t.length,a=n?t.charAt(0)+t.charAt(0):t.substring(0,2),o=n?t.charAt(1)+t.charAt(1):t.substring(2,4),s=n?t.charAt(2)+t.charAt(2):t.substring(4,6),l=r?n?t.charAt(3)+t.charAt(3):t.substring(6,8):"FF";return[parseInt(a,16),parseInt(o,16),parseInt(s,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new i;return t.setSource(e),t})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=["e","se","s","sw","w","nw","n","ne","e"],n=["ns","nesw","ew","nwse"],r={},a="left",o="top",s={top:"bottom",bottom:o,left:"right",right:a,center:"center"},l=t.util.radiansToDegrees,c=Math.sign||function(e){return(e>0)-(e<0)||+e};function h(e,t){var i=e.angle+l(Math.atan2(t.y,t.x))+360;return Math.round(i%360/45)}function u(e,i){var n=i.transform.target,r=n.canvas,a=t.util.object.clone(i);a.target=n,r&&r.fire("object:"+e,a),n.fire(e,i)}function f(e,t){var i=t.canvas,n=e[i.uniScaleKey];return i.uniformScaling&&!n||!i.uniformScaling&&n}function d(e){return"center"===e.originX&&"center"===e.originY}function m(e,t,i){var n=e.lockScalingX,r=e.lockScalingY;return!(!n||!r)||(!(t||!n&&!r||!i)||(!(!n||"x"!==t)||!(!r||"y"!==t)))}function g(e,t,i,n){return{e:e,transform:t,pointer:{x:i,y:n}}}function v(e){return function(t,i,n,r){var a=i.target,o=a.getCenterPoint(),s=a.translateToOriginPoint(o,i.originX,i.originY),l=e(t,i,n,r);return a.setPositionByOrigin(s,i.originX,i.originY),l}}function p(e,t){return function(i,n,r,a){var o=t(i,n,r,a);return o&&u(e,g(i,n,r,a)),o}}function y(e,i,n,r,a){var o=e.target,s=o.controls[e.corner],l=o.canvas.getZoom(),c=o.padding/l,h=o.toLocalPoint(new t.Point(r,a),i,n);return h.x>=c&&(h.x-=c),h.x<=-c&&(h.x+=c),h.y>=c&&(h.y-=c),h.y<=c&&(h.y+=c),h.x-=s.offsetX,h.y-=s.offsetY,h}function b(e){return e.flipX!==e.flipY}function w(e,t,i,n,r){if(0!==e[t]){var a=r/e._getTransformedDimensions()[n]*e[i];e.set(i,a)}}function x(e,t,i,n){var r,s=t.target,c=s._getTransformedDimensions(0,s.skewY),h=y(t,t.originX,t.originY,i,n),u=Math.abs(2*h.x)-c.x,f=s.skewX;u<2?r=0:(r=l(Math.atan2(u/s.scaleX,c.y/s.scaleY)),t.originX===a&&"bottom"===t.originY&&(r=-r),"right"===t.originX&&t.originY===o&&(r=-r),b(s)&&(r=-r));var d=f!==r;if(d){var m=s._getTransformedDimensions().y;s.set("skewX",r),w(s,"skewY","scaleY","y",m)}return d}function k(e,t,i,n){var r,s=t.target,c=s._getTransformedDimensions(s.skewX,0),h=y(t,t.originX,t.originY,i,n),u=Math.abs(2*h.y)-c.y,f=s.skewY;u<2?r=0:(r=l(Math.atan2(u/s.scaleY,c.x/s.scaleX)),t.originX===a&&"bottom"===t.originY&&(r=-r),"right"===t.originX&&t.originY===o&&(r=-r),b(s)&&(r=-r));var d=f!==r;if(d){var m=s._getTransformedDimensions().x;s.set("skewY",r),w(s,"skewX","scaleX","x",m)}return d}function C(e,t,i,n,r){r=r||{};var a,o,l,h,u,g,v=t.target,p=v.lockScalingX,b=v.lockScalingY,w=r.by,x=f(e,v),k=m(v,w,x),C=t.gestureScale;if(k)return!1;if(C)o=t.scaleX*C,l=t.scaleY*C;else{if(a=y(t,t.originX,t.originY,i,n),u="y"!==w?c(a.x):1,g="x"!==w?c(a.y):1,t.signX||(t.signX=u),t.signY||(t.signY=g),v.lockScalingFlip&&(t.signX!==u||t.signY!==g))return!1;if(h=v._getTransformedDimensions(),x&&!w){var _=Math.abs(a.x)+Math.abs(a.y),S=t.original,T=_/(Math.abs(h.x*S.scaleX/v.scaleX)+Math.abs(h.y*S.scaleY/v.scaleY));o=S.scaleX*T,l=S.scaleY*T}else o=Math.abs(a.x*v.scaleX/h.x),l=Math.abs(a.y*v.scaleY/h.y);d(t)&&(o*=2,l*=2),t.signX!==u&&"y"!==w&&(t.originX=s[t.originX],o*=-1,t.signX=u),t.signY!==g&&"x"!==w&&(t.originY=s[t.originY],l*=-1,t.signY=g)}var O=v.scaleX,E=v.scaleY;return w?("x"===w&&v.set("scaleX",o),"y"===w&&v.set("scaleY",l)):(!p&&v.set("scaleX",o),!b&&v.set("scaleY",l)),O!==v.scaleX||E!==v.scaleY}r.scaleCursorStyleHandler=function(e,t,n){var r=f(e,n),a="";if(0!==t.x&&0===t.y?a="x":0===t.x&&0!==t.y&&(a="y"),m(n,a,r))return"not-allowed";var o=h(n,t);return i[o]+"-resize"},r.skewCursorStyleHandler=function(e,t,i){if(0!==t.x&&i.lockSkewingY)return"not-allowed";if(0!==t.y&&i.lockSkewingX)return"not-allowed";var r=h(i,t)%4;return n[r]+"-resize"},r.scaleSkewCursorStyleHandler=function(e,t,i){return e[i.canvas.altActionKey]?r.skewCursorStyleHandler(e,t,i):r.scaleCursorStyleHandler(e,t,i)},r.rotationWithSnapping=p("rotating",v((function(e,t,i,n){var r=t,a=r.target,o=a.translateToOriginPoint(a.getCenterPoint(),r.originX,r.originY);if(a.lockRotation)return!1;var s,c=Math.atan2(r.ey-o.y,r.ex-o.x),h=Math.atan2(n-o.y,i-o.x),u=l(h-c+r.theta);if(a.snapAngle>0){var f=a.snapAngle,d=a.snapThreshold||f,m=Math.ceil(u/f)*f,g=Math.floor(u/f)*f;Math.abs(u-g)<d?u=g:Math.abs(u-m)<d&&(u=m)}return u<0&&(u=360+u),u%=360,s=a.angle!==u,a.angle=u,s}))),r.scalingEqually=p("scaling",v((function(e,t,i,n){return C(e,t,i,n)}))),r.scalingX=p("scaling",v((function(e,t,i,n){return C(e,t,i,n,{by:"x"})}))),r.scalingY=p("scaling",v((function(e,t,i,n){return C(e,t,i,n,{by:"y"})}))),r.scalingYOrSkewingX=function(e,t,i,n){return e[t.target.canvas.altActionKey]?r.skewHandlerX(e,t,i,n):r.scalingY(e,t,i,n)},r.scalingXOrSkewingY=function(e,t,i,n){return e[t.target.canvas.altActionKey]?r.skewHandlerY(e,t,i,n):r.scalingX(e,t,i,n)},r.changeWidth=p("resizing",v((function(e,t,i,n){var r=t.target,a=y(t,t.originX,t.originY,i,n),o=r.strokeWidth/(r.strokeUniform?r.scaleX:1),s=d(t)?2:1,l=r.width,c=Math.abs(a.x*s/r.scaleX)-o;return r.set("width",Math.max(c,0)),l!==c}))),r.skewHandlerX=function(e,t,i,n){var r,s=t.target,l=s.skewX,c=t.originY;return!s.lockSkewingX&&(0===l?r=y(t,"center","center",i,n).x>0?a:"right":(l>0&&(r=c===o?a:"right"),l<0&&(r=c===o?"right":a),b(s)&&(r=r===a?"right":a)),t.originX=r,p("skewing",v(x))(e,t,i,n))},r.skewHandlerY=function(e,t,i,n){var r,s=t.target,l=s.skewY,c=t.originX;return!s.lockSkewingY&&(0===l?r=y(t,"center","center",i,n).y>0?o:"bottom":(l>0&&(r=c===a?o:"bottom"),l<0&&(r=c===a?"bottom":o),b(s)&&(r=r===o?"bottom":o)),t.originY=r,p("skewing",v(k))(e,t,i,n))},r.dragHandler=function(e,t,i,n){var r=t.target,a=i-t.offsetX,o=n-t.offsetY,s=!r.get("lockMovementX")&&r.left!==a,l=!r.get("lockMovementY")&&r.top!==o;return s&&r.set("left",a),l&&r.set("top",o),(s||l)&&u("moving",g(e,t,i,n)),s||l},r.scaleOrSkewActionName=function(e,t,i){var n=e[i.canvas.altActionKey];return 0===t.x?n?"skewX":"scaleY":0===t.y?n?"skewY":"scaleX":void 0},r.rotationStyleHandler=function(e,t,i){return i.lockRotation?"not-allowed":t.cursorStyle},r.fireEvent=u,r.wrapWithFixedAnchor=v,r.wrapWithFireEvent=p,r.getLocalPoint=y,t.controlsUtils=r}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.degreesToRadians,n=t.controlsUtils;n.renderCircleControl=function(e,t,i,n,r){n=n||{};var a,o=this.sizeX||n.cornerSize||r.cornerSize,s=this.sizeY||n.cornerSize||r.cornerSize,l=void 0!==n.transparentCorners?n.transparentCorners:r.transparentCorners,c=l?"stroke":"fill",h=!l&&(n.cornerStrokeColor||r.cornerStrokeColor),u=t,f=i;e.save(),e.fillStyle=n.cornerColor||r.cornerColor,e.strokeStyle=n.cornerStrokeColor||r.cornerStrokeColor,o>s?(a=o,e.scale(1,s/o),f=i*o/s):s>o?(a=s,e.scale(o/s,1),u=t*s/o):a=o,e.lineWidth=1,e.beginPath(),e.arc(u,f,a/2,0,2*Math.PI,!1),e[c](),h&&e.stroke(),e.restore()},n.renderSquareControl=function(e,t,n,r,a){r=r||{};var o=this.sizeX||r.cornerSize||a.cornerSize,s=this.sizeY||r.cornerSize||a.cornerSize,l=void 0!==r.transparentCorners?r.transparentCorners:a.transparentCorners,c=l?"stroke":"fill",h=!l&&(r.cornerStrokeColor||a.cornerStrokeColor),u=o/2,f=s/2;e.save(),e.fillStyle=r.cornerColor||a.cornerColor,e.strokeStyle=r.cornerStrokeColor||a.cornerStrokeColor,e.lineWidth=1,e.translate(t,n),e.rotate(i(a.angle)),e[c+"Rect"](-u,-f,o,s),h&&e.strokeRect(-u,-f,o,s),e.restore()}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Control=function(e){for(var t in e)this[t]=e[t]},t.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var i=e._controlsVisibility;return i&&void 0!==i[t]?i[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,i){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},i)},calcCornerCoords:function(e,i,n,r,a){var o,s,l,c,h=a?this.touchSizeX:this.sizeX,u=a?this.touchSizeY:this.sizeY;if(h&&u&&h!==u){var f=Math.atan2(u,h),d=Math.sqrt(h*h+u*u)/2,m=f-t.util.degreesToRadians(e),g=Math.PI/2-f-t.util.degreesToRadians(e);o=d*t.util.cos(m),s=d*t.util.sin(m),l=d*t.util.cos(g),c=d*t.util.sin(g)}else{d=.7071067812*(h&&u?h:i);m=t.util.degreesToRadians(45-e);o=l=d*t.util.cos(m),s=c=d*t.util.sin(m)}return{tl:{x:n-c,y:r-l},tr:{x:n+o,y:r-s},bl:{x:n-o,y:r+s},br:{x:n+c,y:r+l}}},render:function(e,i,n,r,a){switch((r=r||{}).cornerStyle||a.cornerStyle){case"circle":t.controlsUtils.renderCircleControl.call(this,e,i,n,r,a);break;default:t.controlsUtils.renderSquareControl.call(this,e,i,n,r,a)}}}}(t),function(){function e(e,t){var i,n,r,a,o=e.getAttribute("style"),s=e.getAttribute("offset")||0;if(s=(s=parseFloat(s)/(/%$/.test(s)?100:1))<0?0:s>1?1:s,o){var l=o.split(/\s*;\s*/);for(""===l[l.length-1]&&l.pop(),a=l.length;a--;){var c=l[a].split(/\s*:\s*/),h=c[0].trim(),u=c[1].trim();"stop-color"===h?i=u:"stop-opacity"===h&&(r=u)}}return i||(i=e.getAttribute("stop-color")||"rgb(0,0,0)"),r||(r=e.getAttribute("stop-opacity")),n=(i=new S.Color(i)).getAlpha(),r=isNaN(parseFloat(r))?1:parseFloat(r),r*=n*t,{offset:s,color:i.toRgb(),opacity:r}}var t=S.util.object.clone;S.Gradient=S.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var t,i=this;Object.keys(e).forEach((function(t){i[t]=e[t]})),this.id?this.id+="_"+S.Object.__uid++:this.id=S.Object.__uid++,t={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(t.r1=e.coords.r1||0,t.r2=e.coords.r2||0),this.coords=t,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var t in e){var i=new S.Color(e[t]);this.colorStops.push({offset:parseFloat(t),color:i.toRgb(),opacity:i.getAlpha()})}return this},toObject:function(e){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return S.util.populateWithProperties(this,t,e),t},toSVG:function(e,i){var n,r,a,o,s=t(this.coords,!0),l=(i=i||{},t(this.colorStops,!0)),c=s.r1>s.r2,h=this.gradientTransform?this.gradientTransform.concat():S.iMatrix.concat(),u=-this.offsetX,f=-this.offsetY,d=!!i.additionalTransform,m="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(l.sort((function(e,t){return e.offset-t.offset})),"objectBoundingBox"===m?(u/=e.width,f/=e.height):(u+=e.width/2,f+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(u-=e.pathOffset.x,f-=e.pathOffset.y),h[4]-=u,h[5]-=f,o='id="SVGID_'+this.id+'" gradientUnits="'+m+'"',o+=' gradientTransform="'+(d?i.additionalTransform+" ":"")+S.util.matrixToSVG(h)+'" ',"linear"===this.type?a=["<linearGradient ",o,' x1="',s.x1,'" y1="',s.y1,'" x2="',s.x2,'" y2="',s.y2,'">\n']:"radial"===this.type&&(a=["<radialGradient ",o,' cx="',c?s.x1:s.x2,'" cy="',c?s.y1:s.y2,'" r="',c?s.r1:s.r2,'" fx="',c?s.x2:s.x1,'" fy="',c?s.y2:s.y1,'">\n']),"radial"===this.type){if(c)for((l=l.concat()).reverse(),n=0,r=l.length;n<r;n++)l[n].offset=1-l[n].offset;var g=Math.min(s.r1,s.r2);if(g>0){var v=g/Math.max(s.r1,s.r2);for(n=0,r=l.length;n<r;n++)l[n].offset+=v*(1-l[n].offset)}}for(n=0,r=l.length;n<r;n++){var p=l[n];a.push("<stop ",'offset="',100*p.offset+"%",'" style="stop-color:',p.color,void 0!==p.opacity?";stop-opacity: "+p.opacity:";",'"/>\n')}return a.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),a.join("")},toLive:function(e){var t,i,n,r=S.util.object.clone(this.coords);if(this.type){for("linear"===this.type?t=e.createLinearGradient(r.x1,r.y1,r.x2,r.y2):"radial"===this.type&&(t=e.createRadialGradient(r.x1,r.y1,r.r1,r.x2,r.y2,r.r2)),i=0,n=this.colorStops.length;i<n;i++){var a=this.colorStops[i].color,o=this.colorStops[i].opacity,s=this.colorStops[i].offset;void 0!==o&&(a=new S.Color(a).setAlpha(o).toRgba()),t.addColorStop(s,a)}return t}}}),S.util.object.extend(S.Gradient,{fromElement:function(t,i,n,r){var a=parseFloat(n)/(/%$/.test(n)?100:1);a=a<0?0:a>1?1:a,isNaN(a)&&(a=1);var o,s,l,c,h=t.getElementsByTagName("stop"),u="userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage",f=t.getAttribute("gradientTransform")||"",d=[],m=0,g=0;for("linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?(o="linear",s=function(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}(t)):(o="radial",s=function(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}(t)),l=h.length;l--;)d.push(e(h[l],a));return c=S.parseTransformAttribute(f),function(e,t,i,n){var r,a;Object.keys(t).forEach((function(e){"Infinity"===(r=t[e])?a=1:"-Infinity"===r?a=0:(a=parseFloat(t[e],10),"string"==typeof r&&/^(\d+\.\d+)%|(\d+)%$/.test(r)&&(a*=.01,"pixels"===n&&("x1"!==e&&"x2"!==e&&"r2"!==e||(a*=i.viewBoxWidth||i.width),"y1"!==e&&"y2"!==e||(a*=i.viewBoxHeight||i.height)))),t[e]=a}))}(0,s,r,u),"pixels"===u&&(m=-i.left,g=-i.top),new S.Gradient({id:t.getAttribute("id"),type:o,coords:s,colorStops:d,gradientUnits:u,gradientTransform:c,offsetX:m,offsetY:g})}})}(),function(){"use strict";var e=S.util.toFixed;S.Pattern=S.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(e,t){if(e||(e={}),this.id=S.Object.__uid++,this.setOptions(e),!e.source||e.source&&"string"!=typeof e.source)t&&t(this);else{var i=this;this.source=S.util.createImage(),S.util.loadImage(e.source,(function(e,n){i.source=e,t&&t(i,n)}),null,this.crossOrigin)}},toObject:function(t){var i,n,r=S.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?i=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(i=this.source.toDataURL()),n={type:"pattern",source:i,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,r),offsetY:e(this.offsetY,r),patternTransform:this.patternTransform?this.patternTransform.concat():null},S.util.populateWithProperties(this,n,t),n},toSVG:function(e){var t="function"==typeof this.source?this.source():this.source,i=t.width/e.width,n=t.height/e.height,r=this.offsetX/e.width,a=this.offsetY/e.height,o="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(n=1,a&&(n+=Math.abs(a))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(i=1,r&&(i+=Math.abs(r))),t.src?o=t.src:t.toDataURL&&(o=t.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+r+'" y="'+a+'" width="'+i+'" height="'+n+'">\n<image x="0" y="0" width="'+t.width+'" height="'+t.height+'" xlink:href="'+o+'"></image>\n</pattern>\n'},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;if(!t)return"";if(void 0!==t.src){if(!t.complete)return"";if(0===t.naturalWidth||0===t.naturalHeight)return""}return e.createPattern(t,this.repeat)}})}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.toFixed;t.Shadow?t.warn("fabric.Shadow is already defined."):(t.Shadow=t.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var i in"string"==typeof e&&(e=this._parseShadow(e)),e)this[i]=e[i];this.id=t.Object.__uid++},_parseShadow:function(e){var i=e.trim(),n=t.Shadow.reOffsetsAndBlur.exec(i)||[];return{color:(i.replace(t.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(n[1],10)||0,offsetY:parseFloat(n[2],10)||0,blur:parseFloat(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(e){var n=40,r=40,a=t.Object.NUM_FRACTION_DIGITS,o=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=new t.Color(this.color);return e.width&&e.height&&(n=100*i((Math.abs(o.x)+this.blur)/e.width,a)+20,r=100*i((Math.abs(o.y)+this.blur)/e.height,a)+20),e.flipX&&(o.x*=-1),e.flipY&&(o.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+r+'%" height="'+(100+2*r)+'%" x="-'+n+'%" width="'+(100+2*n)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+i(this.blur?this.blur/2:0,a)+'"></feGaussianBlur>\n\t<feOffset dx="'+i(o.x,a)+'" dy="'+i(o.y,a)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+s.toRgb()+'" flood-opacity="'+s.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},i=t.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach((function(t){this[t]!==i[t]&&(e[t]=this[t])}),this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(t),function(){"use strict";if(S.StaticCanvas)S.warn("fabric.StaticCanvas is already defined.");else{var e=S.util.object.extend,t=S.util.getElementOffset,i=S.util.removeFromArray,n=S.util.toFixed,r=S.util.transformPoint,a=S.util.invertTransform,o=S.util.getNodeCanvas,s=S.util.createCanvasElement,l=new Error("Could not initialize `canvas` element");S.StaticCanvas=S.util.createClass(S.CommonMethods,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:S.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,i),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,i),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,i),t.overlayColor&&this.setOverlayColor(t.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return 1!==S.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?S.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=S.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,i){t.setAttribute("width",this.width*e),t.setAttribute("height",this.height*e),i.scale(e,e)},calcOffset:function(){return this._offset=t(this.lowerCanvasEl),this},setOverlayImage:function(e,t,i){return this.__setBgOverlayImage("overlayImage",e,t,i)},setBackgroundImage:function(e,t,i){return this.__setBgOverlayImage("backgroundImage",e,t,i)},setOverlayColor:function(e,t){return this.__setBgOverlayColor("overlayColor",e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor("backgroundColor",e,t)},__setBgOverlayImage:function(e,t,i,n){return"string"==typeof t?S.util.loadImage(t,(function(t,r){if(t){var a=new S.Image(t,n);this[e]=a,a.canvas=this}i&&i(t,r)}),this,n&&n.crossOrigin):(n&&t.setOptions(n),this[e]=t,t&&(t.canvas=this),i&&i(t,!1)),this},__setBgOverlayColor:function(e,t,i){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,i),this},_createCanvasElement:function(){var e=s();if(!e)throw l;if(e.style||(e.style={}),void 0===e.getContext)throw l;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+"px",t.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=S.util.getById(e)||this._createCanvasElement(),S.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var i;for(var n in t=t||{},e)i=e[n],t.cssOnly||(this._setBackstoreDimension(n,e[n]),i+="px",this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(n,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,i,n,r=this._activeObject,a=this.backgroundImage,o=this.overlayImage;for(this.viewportTransform=e,i=0,n=this._objects.length;i<n;i++)(t=this._objects[i]).group||t.setCoords(!0);return r&&r.setCoords(),a&&a.setCoords(!0),o&&o.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var i=e,n=this.viewportTransform.slice(0);e=r(e,a(this.viewportTransform)),n[0]=t,n[3]=t;var o=r(e,n);return n[4]+=i.x-o.x,n[5]+=i.y-o.y,this.setViewportTransform(n)},setZoom:function(e){return this.zoomToPoint(new S.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new S.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set("canvas",this),e.setCoords(),this.fire("object:added",{target:e}),e.fire("added")},_onObjectRemoved:function(e){this.fire("object:removed",{target:e}),e.fire("removed"),delete e.canvas},clearContext:function(e){return e.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=S.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var e={},t=this.width,i=this.height,n=a(this.viewportTransform);return e.tl=r({x:0,y:0},n),e.br=r({x:t,y:i},n),e.tr=new S.Point(e.br.x,e.tl.y),e.bl=new S.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&(S.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(e,t){var i=this.viewportTransform,n=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),S.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire("before:render",{ctx:e}),this._renderBackground(e),e.save(),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._renderObjects(e,t),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),n&&(n.canvas=this,n.shouldCache(),n._transformDone=!0,n.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire("after:render",{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,i=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation="destination-in",i.transform(e),e.scale(1/i.zoomX,1/i.zoomY),e.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var i,n;for(i=0,n=t.length;i<n;++i)t[i]&&t[i].render(e)},_renderBackgroundOrOverlay:function(e,t){var i=this[t+"Color"],n=this[t+"Image"],r=this.viewportTransform,a=this[t+"Vpt"];if(i||n){if(i){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=i.toLive?i.toLive(e,this):i,a&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),e.transform(1,0,0,1,i.offsetX||0,i.offsetY||0);var o=i.gradientTransform||i.patternTransform;o&&e.transform(o[0],o[1],o[2],o[3],o[4],o[5]),e.fill(),e.restore()}n&&(e.save(),a&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),n.render(e),e.restore())}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,"background")},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},centerObjectH:function(e){return this._centerObject(e,new S.Point(this.getCenter().left,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new S.Point(e.getCenterPoint().x,this.getCenter().top))},centerObject:function(e){var t=this.getCenter();return this._centerObject(e,new S.Point(t.left,t.top))},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var t=this.getVpCenter();return this._centerObject(e,new S.Point(t.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var t=this.getVpCenter();return this._centerObject(e,new S.Point(e.getCenterPoint().x,t.y))},getVpCenter:function(){var e=this.getCenter(),t=a(this.viewportTransform);return r({x:e.left,y:e.top},t)},_centerObject:function(e,t){return e.setPositionByOrigin(t,"center","center"),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod("toObject",e)},toDatalessObject:function(e){return this._toObjectMethod("toDatalessObject",e)},_toObjectMethod:function(t,i){var n=this.clipPath,r={version:S.version,objects:this._toObjects(t,i)};return n&&!n.excludeFromExport&&(r.clipPath=this._toObject(this.clipPath,t,i)),e(r,this.__serializeBgOverlay(t,i)),S.util.populateWithProperties(this,r,i),r},_toObjects:function(e,t){return this._objects.filter((function(e){return!e.excludeFromExport})).map((function(i){return this._toObject(i,e,t)}),this)},_toObject:function(e,t,i){var n;this.includeDefaultValues||(n=e.includeDefaultValues,e.includeDefaultValues=!1);var r=e[t](i);return this.includeDefaultValues||(e.includeDefaultValues=n),r},__serializeBgOverlay:function(e,t){var i={},n=this.backgroundImage,r=this.overlayImage,a=this.backgroundColor,o=this.overlayColor;return a&&a.toObject?a.excludeFromExport||(i.background=a.toObject(t)):a&&(i.background=a),o&&o.toObject?o.excludeFromExport||(i.overlay=o.toObject(t)):o&&(i.overlay=o),n&&!n.excludeFromExport&&(i.backgroundImage=this._toObject(n,e,t)),r&&!r.excludeFromExport&&(i.overlayImage=this._toObject(r,e,t)),i},svgViewportTransformation:!0,toSVG:function(e,t){e||(e={}),e.reviver=t;var i=[];return this._setSVGPreamble(i,e),this._setSVGHeader(i,e),this.clipPath&&i.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",t),this._setSVGObjects(i,t),this.clipPath&&i.push("</g>\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",t),i.push("</svg>"),i.join("")},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push('<?xml version="1.0" encoding="',t.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(e,t){var i,r=t.width||this.width,a=t.height||this.height,o='viewBox="0 0 '+this.width+" "+this.height+'" ',s=S.Object.NUM_FRACTION_DIGITS;t.viewBox?o='viewBox="'+t.viewBox.x+" "+t.viewBox.y+" "+t.viewBox.width+" "+t.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,o='viewBox="'+n(-i[4]/i[0],s)+" "+n(-i[5]/i[3],s)+" "+n(this.width/i[0],s)+" "+n(this.height/i[3],s)+'" '),e.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',r,'" ','height="',a,'" ',o,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",S.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(t),"</defs>\n")},createSVGClipPathMarkup:function(e){var t=this.clipPath;return t?(t.clipPathId="CLIPPATH_"+S.Object.__uid++,'<clipPath id="'+t.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(e.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var e=this;return["background","overlay"].map((function(t){var i=e[t+"Color"];if(i&&i.toLive){var n=e[t+"Vpt"],r=e.viewportTransform,a={width:e.width/(n?r[0]:1),height:e.height/(n?r[3]:1)};return i.toSVG(a,{additionalTransform:n?S.util.matrixToSVG(r):""})}})).join("")},createSVGFontFacesMarkup:function(){var e,t,i,n,r,a,o,s,l="",c={},h=S.fontPaths,u=[];for(this._objects.forEach((function e(t){u.push(t),t._objects&&t._objects.forEach(e)})),o=0,s=u.length;o<s;o++)if(t=(e=u[o]).fontFamily,-1!==e.type.indexOf("text")&&!c[t]&&h[t]&&(c[t]=!0,e.styles))for(r in i=e.styles)for(a in n=i[r])!c[t=n[a].fontFamily]&&h[t]&&(c[t]=!0);for(var f in c)l+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",h[f],"');\n","\t\t}\n"].join("");return l&&(l=['\t<style type="text/css">',"<![CDATA[\n",l,"]]>","</style>\n"].join("")),l},_setSVGObjects:function(e,t){var i,n,r,a=this._objects;for(n=0,r=a.length;n<r;n++)(i=a[n]).excludeFromExport||this._setSVGObject(e,i,t)},_setSVGObject:function(e,t,i){e.push(t.toSVG(i))},_setSVGBgOverlayImage:function(e,t,i){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(i))},_setSVGBgOverlayColor:function(e,t){var i=this[t+"Color"],n=this.viewportTransform,r=this.width,a=this.height;if(i)if(i.toLive){var o=i.repeat,s=S.util.invertTransform(n),l=this[t+"Vpt"]?S.util.matrixToSVG(s):"";e.push('<rect transform="'+l+" translate(",r/2,",",a/2,')"',' x="',i.offsetX-r/2,'" y="',i.offsetY-a/2,'" ','width="',"repeat-y"===o||"no-repeat"===o?i.source.width:r,'" height="',"repeat-x"===o||"no-repeat"===o?i.source.height:a,'" fill="url(#SVGID_'+i.id+')"',"></rect>\n")}else e.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',i,'"',"></rect>\n")},sendToBack:function(e){if(!e)return this;var t,n,r,a=this._activeObject;if(e===a&&"activeSelection"===e.type)for(t=(r=a._objects).length;t--;)n=r[t],i(this._objects,n),this._objects.unshift(n);else i(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,n,r,a=this._activeObject;if(e===a&&"activeSelection"===e.type)for(r=a._objects,t=0;t<r.length;t++)n=r[t],i(this._objects,n),this._objects.push(n);else i(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var n,r,a,o,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(s=l._objects,n=0;n<s.length;n++)r=s[n],(a=this._objects.indexOf(r))>0+c&&(o=a-1,i(this._objects,r),this._objects.splice(o,0,r)),c++;else 0!==(a=this._objects.indexOf(e))&&(o=this._findNewLowerIndex(e,a,t),i(this._objects,e),this._objects.splice(o,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,i){var n,r;if(i)for(n=t,r=t-1;r>=0;--r){if(e.intersectsWithObject(this._objects[r])||e.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(e)){n=r;break}}else n=t-1;return n},bringForward:function(e,t){if(!e)return this;var n,r,a,o,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(n=(s=l._objects).length;n--;)r=s[n],(a=this._objects.indexOf(r))<this._objects.length-1-c&&(o=a+1,i(this._objects,r),this._objects.splice(o,0,r)),c++;else(a=this._objects.indexOf(e))!==this._objects.length-1&&(o=this._findNewUpperIndex(e,a,t),i(this._objects,e),this._objects.splice(o,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,i){var n,r,a;if(i)for(n=t,r=t+1,a=this._objects.length;r<a;++r){if(e.intersectsWithObject(this._objects[r])||e.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(e)){n=r;break}}else n=t+1;return n},moveTo:function(e,t){return i(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(S.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject((function(e){e.dispose&&e.dispose()})),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),this.lowerCanvasEl.style=this._originalCanvasStyle,delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),S.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),e(S.StaticCanvas.prototype,S.Observable),e(S.StaticCanvas.prototype,S.Collection),e(S.StaticCanvas.prototype,S.DataURLExporter),e(S.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(e){var t=s();if(!t||!t.getContext)return null;var i=t.getContext("2d");if(!i)return null;switch(e){case"setLineDash":return void 0!==i.setLineDash;default:return null}}}),S.StaticCanvas.prototype.toJSON=S.StaticCanvas.prototype.toObject,S.isLikelyNode&&(S.StaticCanvas.prototype.createPNGStream=function(){var e=o(this.lowerCanvasEl);return e&&e.createPNGStream()},S.StaticCanvas.prototype.createJPEGStream=function(e){var t=o(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),S.BaseBrush=S.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var e=this.canvas.contextTop;e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,t=this.shadow,i=e.contextTop,n=e.getZoom();e&&e._isRetinaScaling()&&(n*=S.devicePixelRatio),i.shadowColor=t.color,i.shadowBlur=t.blur*n,i.shadowOffsetX=t.offsetX*n,i.shadowOffsetY=t.offsetY*n}},needsFullRender:function(){return new S.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),S.PencilBrush=S.util.createClass(S.BaseBrush,{decimate:.4,initialize:function(e){this.canvas=e,this._points=[]},_drawSegment:function(e,t,i){var n=t.midPointFrom(i);return e.quadraticCurveTo(t.x,t.y,n.x,n.y),n},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var i=this._points,n=i.length,r=this.canvas.contextTop;this._saveAndTransform(r),this.oldEnd&&(r.beginPath(),r.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(r,i[n-2],i[n-1],!0),r.stroke(),r.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var t=new S.Point(e.x,e.y);this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1])||(this._points.push(e),0))},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(e){var t=new S.Point(e.x,e.y);return this._addPoint(t)},_render:function(){var e,t,i=this.canvas.contextTop,n=this._points[0],r=this._points[1];if(this._saveAndTransform(i),i.beginPath(),2===this._points.length&&n.x===r.x&&n.y===r.y){var a=this.width/1e3;n=new S.Point(n.x,n.y),r=new S.Point(r.x,r.y),n.x-=a,r.x+=a}for(i.moveTo(n.x,n.y),e=1,t=this._points.length;e<t;e++)this._drawSegment(i,n,r),n=this._points[e],r=this._points[e+1];i.lineTo(n.x,n.y),i.stroke(),i.restore()},convertPointsToSVGPath:function(e){var t=this.width/1e3;return S.util.getSmoothPathFromPoints(e,t)},_isEmptySVGPath:function(e){return"M 0 0 Q 0 0 0 0 L 0 0"===S.util.joinPath(e)},createPath:function(e){var t=new S.Path(e,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,t.shadow=new S.Shadow(this.shadow)),t},decimatePoints:function(e,t){if(e.length<=2)return e;var i,n=this.canvas.getZoom(),r=Math.pow(t/n,2),a=e.length-1,o=e[0],s=[o];for(i=1;i<a-1;i++)Math.pow(o.x-e[i].x,2)+Math.pow(o.y-e[i].y,2)>=r&&(o=e[i],s.push(o));return s.push(e[a]),s},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t})}}}),S.CircleBrush=S.util.createClass(S.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),i=this.canvas.contextTop;this._saveAndTransform(i),this.dot(i,t),i.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,i=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(i),e=0,t=n.length;e<t;e++)this.dot(i,n[e]);i.restore()},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e,t,i=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var n=[];for(e=0,t=this.points.length;e<t;e++){var r=this.points[e],a=new S.Circle({radius:r.radius,left:r.x,top:r.y,originX:"center",originY:"center",fill:r.fill});this.shadow&&(a.shadow=new S.Shadow(this.shadow)),n.push(a)}var o=new S.Group(n);o.canvas=this.canvas,this.canvas.fire("before:path:created",{path:o}),this.canvas.add(o),this.canvas.fire("path:created",{path:o}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=i,this.canvas.requestRenderAll()},addPoint:function(e){var t=new S.Point(e.x,e.y),i=S.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,n=new S.Color(this.color).setAlpha(S.util.getRandomInt(0,100)/100).toRgba();return t.radius=i,t.fill=n,this.points.push(t),t}}),S.SprayBrush=S.util.createClass(S.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var t=[],i=0,n=this.sprayChunks.length;i<n;i++)for(var r=this.sprayChunks[i],a=0,o=r.length;a<o;a++){var s=new S.Rect({width:r[a].width,height:r[a].width,left:r[a].x+1,top:r[a].y+1,originX:"center",originY:"center",fill:this.color});t.push(s)}this.optimizeOverlapping&&(t=this._getOptimizedRects(t));var l=new S.Group(t);this.shadow&&l.set("shadow",new S.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:l}),this.canvas.add(l),this.canvas.fire("path:created",{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t,i,n,r={};for(i=0,n=e.length;i<n;i++)r[t=e[i].left+""+e[i].top]||(r[t]=e[i]);var a=[];for(t in r)a.push(r[t]);return a},render:function(e){var t,i,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),t=0,i=e.length;t<i;t++){var r=e[t];void 0!==r.opacity&&(n.globalAlpha=r.opacity),n.fillRect(r.x,r.y,r.width,r.width)}n.restore()},_render:function(){var e,t,i=this.canvas.contextTop;for(i.fillStyle=this.color,this._saveAndTransform(i),e=0,t=this.sprayChunks.length;e<t;e++)this.render(this.sprayChunks[e]);i.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var t,i,n,r,a=this.width/2;for(r=0;r<this.density;r++){t=S.util.getRandomInt(e.x-a,e.x+a),i=S.util.getRandomInt(e.y-a,e.y+a),n=this.dotWidthVariance?S.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var o=new S.Point(t,i);o.width=n,this.randomOpacity&&(o.opacity=S.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(o)}this.sprayChunks.push(this.sprayChunkPoints)}}),S.PatternBrush=S.util.createClass(S.PencilBrush,{getPatternSrc:function(){var e=S.util.createCanvasElement(),t=e.getContext("2d");return e.width=e.height=25,t.fillStyle=this.color,t.beginPath(),t.arc(10,10,10,0,2*Math.PI,!1),t.closePath(),t.fill(),e},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(e){var t=this.callSuper("createPath",e),i=t._getLeftTopCoords().scalarAdd(t.strokeWidth/2);return t.stroke=new S.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-i.x,offsetY:-i.y}),t}}),function(){var e=S.util.getPointer,t=S.util.degreesToRadians,i=S.util.isTouchEvent;for(var n in S.Canvas=S.util.createClass(S.StaticCanvas,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",rotationCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=S.PencilBrush&&new S.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e,t,i,n=this.getActiveObjects();if(n.length>0&&!this.preserveObjectStacking){t=[],i=[];for(var r=0,a=this._objects.length;r<a;r++)e=this._objects[r],-1===n.indexOf(e)?t.push(e):i.push(e);n.length>1&&(this._activeObject._objects=i),t.push.apply(t,i)}else t=this._objects;return t},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,t){var i=e.calcTransformMatrix(),n=S.util.invertTransform(i),r=this.restorePointerVpt(t);return S.util.transformPoint(r,n)},isTargetTransparent:function(e,t,i){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var n=this._normalizePointer(e,{x:t,y:i}),r=Math.max(e.cacheTranslationX+n.x*e.zoomX,0),a=Math.max(e.cacheTranslationY+n.y*e.zoomY,0);return S.util.isTransparent(e._cacheContext,Math.round(r),Math.round(a),this.targetFindTolerance)}var o=this.contextCache,s=e.selectionBackgroundColor,l=this.viewportTransform;return e.selectionBackgroundColor="",this.clearContext(o),o.save(),o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),e.render(o),o.restore(),e.selectionBackgroundColor=s,S.util.isTransparent(o,t,i,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return"[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find((function(t){return!0===e[t]})):e[this.selectionKey]},_shouldClearSelection:function(e,t){var i=this.getActiveObjects(),n=this._activeObject;return!t||t&&n&&i.length>1&&-1===i.indexOf(t)&&n!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&n&&n!==t},_shouldCenterTransform:function(e,t,i){var n;if(e)return"scale"===t||"scaleX"===t||"scaleY"===t||"resizing"===t?n=this.centeredScaling||e.centeredScaling:"rotate"===t&&(n=this.centeredRotation||e.centeredRotation),n?!i:i},_getOriginFromCorner:function(e,t){var i={x:e.originX,y:e.originY};return"ml"===t||"tl"===t||"bl"===t?i.x="right":"mr"!==t&&"tr"!==t&&"br"!==t||(i.x="left"),"tl"===t||"mt"===t||"tr"===t?i.y="bottom":"bl"!==t&&"mb"!==t&&"br"!==t||(i.y="top"),i},_getActionFromCorner:function(e,t,i,n){if(!t||!e)return"drag";var r=n.controls[t];return r.getActionName(i,r,n)},_setupCurrentTransform:function(e,i,n){if(i){var r=this.getPointer(e),a=i.__corner,o=i.controls[a],s=n&&a?o.getActionHandler(e,i,o):S.controlsUtils.dragHandler,l=this._getActionFromCorner(n,a,e,i),c=this._getOriginFromCorner(i,a),h=e[this.centeredKey],u={target:i,action:l,actionHandler:s,corner:a,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,offsetX:r.x-i.left,offsetY:r.y-i.top,originX:c.x,originY:c.y,ex:r.x,ey:r.y,lastX:r.x,lastY:r.y,theta:t(i.angle),width:i.width*i.scaleX,shiftKey:e.shiftKey,altKey:h,original:S.util.saveObjectTransform(i)};this._shouldCenterTransform(i,l,h)&&(u.originX="center",u.originY="center"),u.original.originX=c.x,u.original.originY=c.y,this._currentTransform=u,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var t=this._groupSelector,i=new S.Point(t.ex,t.ey),n=S.util.transformPoint(i,this.viewportTransform),r=new S.Point(t.ex+t.left,t.ey+t.top),a=S.util.transformPoint(r,this.viewportTransform),o=Math.min(n.x,a.x),s=Math.min(n.y,a.y),l=Math.max(n.x,a.x),c=Math.max(n.y,a.y),h=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(o,s,l-o,c-s)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,o+=h,s+=h,l-=h,c-=h,S.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(o,s,l-o,c-s))},findTarget:function(e,t){if(!this.skipTargetFind){var n,r,a=this.getPointer(e,!0),o=this._activeObject,s=this.getActiveObjects(),l=i(e),c=s.length>1&&!t||1===s.length;if(this.targets=[],c&&o._findTargetCorner(a,l))return o;if(s.length>1&&!t&&o===this._searchPossibleTargets([o],a))return o;if(1===s.length&&o===this._searchPossibleTargets([o],a)){if(!this.preserveObjectStacking)return o;n=o,r=this.targets,this.targets=[]}var h=this._searchPossibleTargets(this._objects,a);return e[this.altSelectionKey]&&h&&n&&h!==n&&(h=n,this.targets=r),h}},_checkTarget:function(e,t,i){if(t&&t.visible&&t.evented&&t.containsPoint(e)){if(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)return!0;if(!this.isTargetTransparent(t,i.x,i.y))return!0}},_searchPossibleTargets:function(e,t){for(var i,n,r=e.length;r--;){var a=e[r],o=a.group?this._normalizePointer(a.group,t):t;if(this._checkTarget(o,a,t)){(i=e[r]).subTargetCheck&&i instanceof S.Group&&(n=this._searchPossibleTargets(i._objects,t))&&this.targets.push(n);break}}return i},restorePointerVpt:function(e){return S.util.transformPoint(e,S.util.invertTransform(this.viewportTransform))},getPointer:function(t,i){if(this._absolutePointer&&!i)return this._absolutePointer;if(this._pointer&&i)return this._pointer;var n,r=e(t),a=this.upperCanvasEl,o=a.getBoundingClientRect(),s=o.width||0,l=o.height||0;s&&l||("top"in o&&"bottom"in o&&(l=Math.abs(o.top-o.bottom)),"right"in o&&"left"in o&&(s=Math.abs(o.right-o.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,i||(r=this.restorePointerVpt(r));var c=this.getRetinaScaling();return 1!==c&&(r.x/=c,r.y/=c),n=0===s||0===l?{width:1,height:1}:{width:a.width/s,height:a.height/l},{x:r.x*n.width,y:r.y*n.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),t=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),S.util.addClass(i,"upper-canvas "+e),this.wrapperEl.appendChild(i),this._copyCanvasStyle(t,i),this._applyCanvasStyle(i),this.contextTop=i.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=S.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),S.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),S.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var t=this.width||e.width,i=this.height||e.height;S.util.setStyle(e,{position:"absolute",width:t+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=t,e.height=i,S.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?"activeSelection"===e.type&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,t){var i=!1,n=this.getActiveObjects(),r=[],a=[];e.forEach((function(e){-1===n.indexOf(e)&&(i=!0,e.fire("deselected",{e:t,target:e}),a.push(e))})),n.forEach((function(n){-1===e.indexOf(n)&&(i=!0,n.fire("selected",{e:t,target:n}),r.push(n))})),e.length>0&&n.length>0?i&&this.fire("selection:updated",{e:t,selected:r,deselected:a,updated:r[0]||a[0],target:this._activeObject}):n.length>0?this.fire("selection:created",{e:t,selected:r,target:this._activeObject}):e.length>0&&this.fire("selection:cleared",{e:t,deselected:a})},setActiveObject:function(e,t){var i=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(i,t),this},_setActiveObject:function(e,t){return this._activeObject!==e&&(!!this._discardActiveObject(t,e)&&(!e.onSelect({e:t})&&(this._activeObject=e,!0)))},_discardActiveObject:function(e,t){var i=this._activeObject;if(i){if(i.onDeselect({e:e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),i=this.getActiveObject();return t.length&&this.fire("before:selection:cleared",{target:i,e:e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){S.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,S.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,i){var n=this._realizeGroupTransformOnObject(e),r=this.callSuper("_toObject",e,t,i);return this._unwindGroupTransformOnObject(e,n),r},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var t={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach((function(i){t[i]=e[i]})),S.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,i){var n=this._realizeGroupTransformOnObject(t);this.callSuper("_setSVGObject",e,t,i),this._unwindGroupTransformOnObject(t,n)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),S.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),S.StaticCanvas)"prototype"!==n&&(S.Canvas[n]=S.StaticCanvas[n])}(),function(){var e=S.util.addListener,t=S.util.removeListener,i={passive:!1};function n(e,t){return e.button&&e.button===t-1}S.util.object.extend(S.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(e,t){var n=this.upperCanvasEl,r=this._getEventPrefix();e(S.window,"resize",this._onResize),e(n,r+"down",this._onMouseDown),e(n,r+"move",this._onMouseMove,i),e(n,r+"out",this._onMouseOut),e(n,r+"enter",this._onMouseEnter),e(n,"wheel",this._onMouseWheel),e(n,"contextmenu",this._onContextMenu),e(n,"dblclick",this._onDoubleClick),e(n,"dragover",this._onDragOver),e(n,"dragenter",this._onDragEnter),e(n,"dragleave",this._onDragLeave),e(n,"drop",this._onDrop),this.enablePointerEvents||e(n,"touchstart",this._onTouchStart,i),"undefined"!=typeof eventjs&&t in eventjs&&(eventjs[t](n,"gesture",this._onGesture),eventjs[t](n,"drag",this._onDrag),eventjs[t](n,"orientation",this._onOrientationChange),eventjs[t](n,"shake",this._onShake),eventjs[t](n,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(t,"remove");var e=this._getEventPrefix();t(S.document,e+"up",this._onMouseUp),t(S.document,"touchend",this._onTouchEnd,i),t(S.document,e+"move",this._onMouseMove,i),t(S.document,"touchmove",this._onMouseMove,i)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire("mouse:out",{target:t,e:e}),this._hoveredTarget=null,t&&t.fire("mouseout",{e:e});var i=this;this._hoveredTargets.forEach((function(n){i.fire("mouse:out",{target:t,e:e}),n&&t.fire("mouseout",{e:e})})),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach((function(e){e.isEditing&&e.hiddenTextarea.focus()}))},_onMouseEnter:function(e){this._currentTransform||this.findTarget(e)||(this.fire("mouse:over",{target:null,e:e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler("dragover",e);this._fireEnterLeaveEvents(t,e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"dblclick"),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&("touchend"===e.type&&0===e.touches.length||(!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId))},_onTouchStart:function(n){n.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(n)),this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,a=this._getEventPrefix();e(S.document,"touchend",this._onTouchEnd,i),e(S.document,"touchmove",this._onMouseMove,i),t(r,a+"down",this._onMouseDown)},_onMouseDown:function(n){this.__onMouseDown(n),this._resetTransformEventData();var r=this.upperCanvasEl,a=this._getEventPrefix();t(r,a+"move",this._onMouseMove,i),e(S.document,a+"up",this._onMouseUp),e(S.document,a+"move",this._onMouseMove,i)},_onTouchEnd:function(n){if(!(n.touches.length>0)){this.__onMouseUp(n),this._resetTransformEventData(),this.mainTouchId=null;var r=this._getEventPrefix();t(S.document,"touchend",this._onTouchEnd,i),t(S.document,"touchmove",this._onMouseMove,i);var a=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout((function(){e(a.upperCanvasEl,r+"down",a._onMouseDown),a._willAddMouseDown=0}),400)}},_onMouseUp:function(n){this.__onMouseUp(n),this._resetTransformEventData();var r=this.upperCanvasEl,a=this._getEventPrefix();this._isMainEvent(n)&&(t(S.document,a+"up",this._onMouseUp),t(S.document,a+"move",this._onMouseMove,i),e(r,a+"move",this._onMouseMove,i))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!=!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var t,i=this._currentTransform,r=this._groupSelector,a=!1,o=!r||0===r.left&&0===r.top;if(this._cacheTransformEventData(e),t=this._target,this._handleEvent(e,"up:before"),n(e,3))this.fireRightClick&&this._handleEvent(e,"up",3,o);else{if(n(e,2))return this.fireMiddleClick&&this._handleEvent(e,"up",2,o),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(i&&(this._finalizeCurrentTransform(e),a=i.actionPerformed),!o){var s=t===this._activeObject;this._maybeGroupObjects(e),a||(a=this._shouldRender(t)||!s&&t===this._activeObject)}if(t){if(t.selectable&&t!==this._activeObject&&"up"===t.activeOn)this.setActiveObject(t,e),a=!0;else{var l=t._findTargetCorner(this.getPointer(e,!0),S.util.isTouchEvent(e)),c=t.controls[l],h=c&&c.getMouseUpHandler(e,t,c);if(h){var u=this.getPointer(e);h(e,i,u.x,u.y)}}t.isMoving=!1}this._setCursorFromEvent(e,t),this._handleEvent(e,"up",1,o),this._groupSelector=null,this._currentTransform=null,t&&(t.__corner=0),a?this.requestRenderAll():o||this.renderTop()}}},_simpleEventHandler:function(e,t){var i=this.findTarget(t),n=this.targets,r={e:t,target:i,subTargets:n};if(this.fire(e,r),i&&i.fire(e,r),!n)return i;for(var a=0;a<n.length;a++)n[a].fire(e,r);return i},_handleEvent:function(e,t,i,n){var r=this._target,a=this.targets||[],o={e:e,target:r,subTargets:a,button:i||1,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===t&&(o.currentTarget=this.findTarget(e),o.currentSubTargets=this.targets),this.fire("mouse:"+t,o),r&&r.fire("mouse"+t,o);for(var s=0;s<a.length;s++)a[s].fire("mouse"+t,o)},_finalizeCurrentTransform:function(e){var t,i=this._currentTransform,n=i.target,r={e:e,target:n,transform:i,action:i.action};n._scaling&&(n._scaling=!1),n.setCoords(),(i.actionPerformed||this.stateful&&n.hasStateChanged())&&(i.actionPerformed&&(t=this._addEventOptions(r,i),this._fire(t,r)),this._fire("modified",r))},_addEventOptions:function(e,t){var i,n;switch(t.action){case"scaleX":i="scaled",n="x";break;case"scaleY":i="scaled",n="y";break;case"skewX":i="skewed",n="x";break;case"skewY":i="skewed",n="y";break;case"scale":i="scaled",n="equally";break;case"rotate":i="rotated";break;case"drag":i="moved"}return e.by=n,i},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e:e,pointer:t}),this._handleEvent(e,"down")},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e:e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,"move")},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:e,pointer:t}),this._handleEvent(e,"up")},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"down:before");var t=this._target;if(n(e,3))this.fireRightClick&&this._handleEvent(e,"down",3);else if(n(e,2))this.fireMiddleClick&&this._handleEvent(e,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(e);else if(this._isMainEvent(e)&&!this._currentTransform){var i=this._pointer;this._previousPointer=i;var r=this._shouldRender(t),a=this._shouldGroup(e,t);if(this._shouldClearSelection(e,t)?this.discardActiveObject(e):a&&(this._handleGrouping(e,t),t=this._activeObject),!this.selection||t&&(t.selectable||t.isEditing||t===this._activeObject)||(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),t){var o=t===this._activeObject;t.selectable&&"down"===t.activeOn&&this.setActiveObject(t,e);var s=t._findTargetCorner(this.getPointer(e,!0),S.util.isTouchEvent(e));if(t.__corner=s,t===this._activeObject&&(s||!a)){this._setupCurrentTransform(e,t,o);var l=t.controls[s],c=(i=this.getPointer(e),l&&l.getMouseDownHandler(e,t,l));c&&c(e,this._currentTransform,i.x,i.y)}}this._handleEvent(e,"down"),(r||a)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire("before:transform",{e:e,transform:t})},__onMouseMove:function(e){var t,i;if(this._handleEvent(e,"move:before"),this._cacheTransformEventData(e),this.isDrawingMode)this._onMouseMoveInDrawingMode(e);else if(this._isMainEvent(e)){var n=this._groupSelector;n?(i=this._absolutePointer,n.left=i.x-n.ex,n.top=i.y-n.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var i=this._hoveredTarget,n=this._hoveredTargets,r=this.targets,a=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:i,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(r[o],t,{oldTarget:n[o],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var i=this._draggedoverTarget,n=this._hoveredTargets,r=this.targets,a=Math.max(n.length,r.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:i,evtOut:"dragleave",evtIn:"dragenter"});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(r[o],t,{oldTarget:n[o],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,i){var n,r,a,o=i.oldTarget,s=o!==e,l=i.canvasEvtIn,c=i.canvasEvtOut;s&&(n={e:t,target:e,previousTarget:o},r={e:t,target:o,nextTarget:e}),a=e&&s,o&&s&&(c&&this.fire(c,r),o.fire(i.evtOut,r)),a&&(l&&this.fire(l,n),e.fire(i.evtIn,n))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"wheel"),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),i=this._currentTransform;i.reset=!1,i.shiftKey=e.shiftKey,i.altKey=e[this.centeredKey],this._performTransformAction(e,i,t),i.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,i){var n=i.x,r=i.y,a=t.action,o=!1,s=t.actionHandler;s&&(o=s(e,t,n,r)),"drag"===a&&o&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||o},_fire:S.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;var i=t.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,r=(!n||!n.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));r?this.setCursor(this.getCornerCursor(r,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map((function(e){i=e.hoverCursor||i})),this.setCursor(i))},getCornerCursor:function(e,t,i){var n=t.controls[e];return n.cursorStyleHandler(i,n,t)}})}(),p=Math.min,y=Math.max,S.util.object.extend(S.Canvas.prototype,{_shouldGroup:function(e,t){var i=this._activeObject;return i&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(i!==t||"activeSelection"===i.type)&&!t.onSelect({e:e})},_handleGrouping:function(e,t){var i=this._activeObject;i.__corner||(t!==i||(t=this.findTarget(e,!0))&&t.selectable)&&(i&&"activeSelection"===i.type?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var i=this._activeObject,n=i._objects.slice(0);i.contains(e)?(i.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),1===i.size()&&this._setActiveObject(i.item(0),t)):(i.addWithUpdate(e),this._hoveredTarget=i,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(n,t)},_createActiveSelection:function(e,t){var i=this.getActiveObjects(),n=this._createGroup(e);this._hoveredTarget=n,this._setActiveObject(n,t),this._fireSelectionEvents(i,t)},_createGroup:function(e){var t=this._objects,i=t.indexOf(this._activeObject)<t.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new S.ActiveSelection(i,{canvas:this})},_groupSelectedObjects:function(e){var t,i=this._collectObjects(e);1===i.length?this.setActiveObject(i[0],e):i.length>1&&(t=new S.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(t,e))},_collectObjects:function(e){for(var t,i=[],n=this._groupSelector.ex,r=this._groupSelector.ey,a=n+this._groupSelector.left,o=r+this._groupSelector.top,s=new S.Point(p(n,a),p(r,o)),l=new S.Point(y(n,a),y(r,o)),c=!this.selectionFullyContained,h=n===a&&r===o,u=this._objects.length;u--&&!((t=this._objects[u])&&t.selectable&&t.visible&&(c&&t.intersectsWithRect(s,l,!0)||t.isContainedWithinRect(s,l,!0)||c&&t.containsPoint(s,null,!0)||c&&t.containsPoint(l,null,!0))&&(i.push(t),h)););return i.length>1&&(i=i.filter((function(t){return!t.onSelect({e:e})}))),i},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}}),S.util.object.extend(S.StaticCanvas.prototype,{toDataURL:function(e){e||(e={});var t=e.format||"png",i=e.quality||1,n=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),r=this.toCanvasElement(n,e);return S.util.toDataURL(r,t,i)},toCanvasElement:function(e,t){e=e||1;var i=((t=t||{}).width||this.width)*e,n=(t.height||this.height)*e,r=this.getZoom(),a=this.width,o=this.height,s=r*e,l=this.viewportTransform,c=(l[4]-(t.left||0))*e,h=(l[5]-(t.top||0))*e,u=this.interactive,f=[s,0,0,s,c,h],d=this.enableRetinaScaling,m=S.util.createCanvasElement(),g=this.contextTop;return m.width=i,m.height=n,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=i,this.height=n,this.calcViewportBoundaries(),this.renderCanvas(m.getContext("2d"),this._objects),this.viewportTransform=l,this.width=a,this.height=o,this.calcViewportBoundaries(),this.interactive=u,this.enableRetinaScaling=d,this.contextTop=g,m}}),S.util.object.extend(S.StaticCanvas.prototype,{loadFromJSON:function(e,t,i){if(e){var n="string"==typeof e?JSON.parse(e):S.util.object.clone(e),r=this,a=n.clipPath,o=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete n.clipPath,this._enlivenObjects(n.objects,(function(e){r.clear(),r._setBgOverlay(n,(function(){a?r._enlivenObjects([a],(function(i){r.clipPath=i[0],r.__setupCanvas.call(r,n,e,o,t)})):r.__setupCanvas.call(r,n,e,o,t)}))}),i),this}},__setupCanvas:function(e,t,i,n){var r=this;t.forEach((function(e,t){r.insertAt(e,t)})),this.renderOnAddRemove=i,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),n&&n()},_setBgOverlay:function(e,t){var i={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var n=function(){i.backgroundImage&&i.overlayImage&&i.backgroundColor&&i.overlayColor&&t&&t()};this.__setBgOverlay("backgroundImage",e.backgroundImage,i,n),this.__setBgOverlay("overlayImage",e.overlayImage,i,n),this.__setBgOverlay("backgroundColor",e.background,i,n),this.__setBgOverlay("overlayColor",e.overlay,i,n)}else t&&t()},__setBgOverlay:function(e,t,i,n){var r=this;if(!t)return i[e]=!0,void(n&&n());"backgroundImage"===e||"overlayImage"===e?S.util.enlivenObjects([t],(function(t){r[e]=t[0],i[e]=!0,n&&n()})):this["set"+S.util.string.capitalize(e,!0)](t,(function(){i[e]=!0,n&&n()}))},_enlivenObjects:function(e,t,i){e&&0!==e.length?S.util.enlivenObjects(e,(function(e){t&&t(e)}),null,i):t&&t([])},_toDataURL:function(e,t){this.clone((function(i){t(i.toDataURL(e))}))},_toDataURLWithMultiplier:function(e,t,i){this.clone((function(n){i(n.toDataURLWithMultiplier(e,t))}))},clone:function(e,t){var i=JSON.stringify(this.toJSON(t));this.cloneWithoutData((function(t){t.loadFromJSON(i,(function(){e&&e(t)}))}))},cloneWithoutData:function(e){var t=S.util.createCanvasElement();t.width=this.width,t.height=this.height;var i=new S.Canvas(t);this.backgroundImage?(i.setBackgroundImage(this.backgroundImage.src,(function(){i.renderAll(),e&&e(i)})),i.backgroundImageOpacity=this.backgroundImageOpacity,i.backgroundImageStretch=this.backgroundImageStretch):e&&e(i)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.object.clone,r=t.util.toFixed,a=t.util.string.capitalize,o=t.util.degreesToRadians,s=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var i=t.perfLimitSizeTotal,n=e.width,r=e.height,a=t.maxCacheSideLimit,o=t.minCacheSideLimit;if(n<=a&&r<=a&&n*r<=i)return n<o&&(e.width=o),r<o&&(e.height=o),e;var s=n/r,l=t.util.limitDimsByArea(s,i),c=t.util.capValue,h=c(o,l.x,a),u=c(o,l.y,a);return n>h&&(e.zoomX/=n/h,e.width=h,e.capped=!0),r>u&&(e.zoomY/=r/u,e.height=u,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),i=t.x*e.scaleX/this.scaleX,n=t.y*e.scaleY/this.scaleY;return{width:i+2,height:n+2,zoomX:e.scaleX,zoomY:e.scaleY,x:i,y:n}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var i=e._currentTransform.target,n=e._currentTransform.action;if(this===i&&n.slice&&"scale"===n.slice(0,5))return!1}var r,a,o=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),l=t.minCacheSideLimit,c=s.width,h=s.height,u=s.zoomX,f=s.zoomY,d=c!==this.cacheWidth||h!==this.cacheHeight,m=this.zoomX!==u||this.zoomY!==f,g=d||m,v=0,p=0,y=!1;if(d){var b=this._cacheCanvas.width,w=this._cacheCanvas.height,x=c>b||h>w;y=x||(c<.9*b||h<.9*w)&&b>l&&w>l,x&&!s.capped&&(c>l||h>l)&&(v=.1*c,p=.1*h)}return this instanceof t.Text&&this.path&&(g=!0,y=!0,v+=this.getHeightOfLine(0)*this.zoomX,p+=this.getHeightOfLine(0)*this.zoomY),!!g&&(y?(o.width=Math.ceil(c+v),o.height=Math.ceil(h+p)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,o.width,o.height)),r=s.x/2,a=s.y/2,this.cacheTranslationX=Math.round(o.width/2-r)+r,this.cacheTranslationY=Math.round(o.height/2-a)+a,this.cacheWidth=c,this.cacheHeight=h,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(u,f),this.zoomX=u,this.zoomY=f,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,"fill"),this._initGradient(e.stroke,"stroke"),this._initPattern(e.fill,"fill"),this._initPattern(e.stroke,"stroke")},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,i=this.calcTransformMatrix(!t);e.transform(i[0],i[1],i[2],i[3],i[4],i[5])},toObject:function(e){var i=t.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:r(this.left,i),top:r(this.top,i),width:r(this.width,i),height:r(this.height,i),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,i),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:r(this.strokeMiterLimit,i),scaleX:r(this.scaleX,i),scaleY:r(this.scaleY,i),angle:r(this.angle,i),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,i),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:r(this.skewX,i),skewY:r(this.skewY,i)};return this.clipPath&&!this.clipPath.excludeFromExport&&(n.clipPath=this.clipPath.toObject(e),n.clipPath.inverted=this.clipPath.inverted,n.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,n,e),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var i=t.util.getKlass(e.type).prototype;return i.stateProperties.forEach((function(t){"left"!==t&&"top"!==t&&(e[t]===i[t]&&delete e[t],"[object Array]"===Object.prototype.toString.call(e[t])&&"[object Array]"===Object.prototype.toString.call(i[t])&&0===e[t].length&&0===i[t].length&&delete e[t])})),e},toString:function(){return"#<fabric."+a(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,i=e.scaleY;if(this.canvas){var n=this.canvas.getZoom(),r=this.canvas.getRetinaScaling();t*=n*r,i*=n*r}return{scaleX:t,scaleY:i}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,i){var n="scaleX"===e||"scaleY"===e,r=this[e]!==i,a=!1;return n&&(i=this._constrainScale(i)),"scaleX"===e&&i<0?(this.flipX=!this.flipX,i*=-1):"scaleY"===e&&i<0?(this.flipY=!this.flipY,i*=-1):"shadow"!==e||!i||i instanceof t.Shadow?"dirty"===e&&this.group&&this.group.set("dirty",i):i=new t.Shadow(i),this[e]=i,r&&(a=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,a&&this.group.set("dirty",!0)):a&&this.stateProperties.indexOf(e)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),e.restore())},renderCache:function(e){e=e||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!=typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(e){var i=this.clipPath;if(e.save(),i.inverted?e.globalCompositeOperation="destination-out":e.globalCompositeOperation="destination-in",i.absolutePositioned){var n=t.util.invertTransform(this.calcTransformMatrix());e.transform(n[0],n[1],n[2],n[3],n[4],n[5])}i.transform(e),e.scale(1/i.zoomX,1/i.zoomY),e.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),e.restore()},drawObject:function(e,t){var i=this.fill,n=this.stroke;t?(this.fill="black",this.stroke="",this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e),this.fill=i,this.stroke=n},_drawClipPath:function(e){var t=this.clipPath;t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!e){var t=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-i/2,t,i)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var i=t.stroke;i&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?this._applyPatternForTransformedGradient(e,i):(e.strokeStyle=i.toLive(e,this),this._applyPatternGradientTransform(e,i)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var i=t.fill;i&&(i.toLive?(e.fillStyle=i.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=i)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle="transparent",e.fillStyle="#000000"},_setLineDash:function(e,t){t&&0!==t.length&&(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,i){var n,r,a,s=this.getViewportTransform(),l=this.calcTransformMatrix();r=void 0!==(i=i||{}).hasBorders?i.hasBorders:this.hasBorders,a=void 0!==i.hasControls?i.hasControls:this.hasControls,l=t.util.multiplyTransformMatrices(s,l),n=t.util.qrDecompose(l),e.save(),e.translate(n.translateX,n.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),e.rotate(o(n.angle)),i.forActiveSelection||this.group?r&&this.drawBordersInGroup(e,n,i):r&&this.drawBorders(e,i),a&&this.drawControls(e,i),e.restore()},_setShadow:function(e){if(this.shadow){var i,n=this.shadow,r=this.canvas,a=r&&r.viewportTransform[0]||1,o=r&&r.viewportTransform[3]||1;i=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),r&&r._isRetinaScaling()&&(a*=t.devicePixelRatio,o*=t.devicePixelRatio),e.shadowColor=n.color,e.shadowBlur=n.blur*t.browserShadowBlurConstant*(a+o)*(i.scaleX+i.scaleY)/4,e.shadowOffsetX=n.offsetX*a*i.scaleX,e.shadowOffsetY=n.offsetY*o*i.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var i=t.gradientTransform||t.patternTransform,n=-this.width/2+t.offsetX||0,r=-this.height/2+t.offsetY||0;return"percentage"===t.gradientUnits?e.transform(this.width,0,0,this.height,n,r):e.transform(1,0,0,1,n,r),i&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:n,offsetY:r}},_renderPaintInOrder:function(e){"stroke"===this.paintFirst?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),"evenodd"===this.fillRule?e.fill("evenodd"):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,i){var n,r=this._limitCacheSize(this._getCacheCanvasDimensions()),a=t.util.createCanvasElement(),o=this.canvas.getRetinaScaling(),s=r.x/this.scaleX/o,l=r.y/this.scaleY/o;a.width=s,a.height=l,(n=a.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(s,0),n.lineTo(s,l),n.lineTo(0,l),n.closePath(),n.translate(s/2,l/2),n.scale(r.zoomX/this.scaleX/o,r.zoomY/this.scaleY/o),this._applyPatternGradientTransform(n,i),n.fillStyle=i.toLive(e),n.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(o*this.scaleX/r.zoomX,o*this.scaleY/r.zoomY),e.strokeStyle=n.createPattern(a,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",e.scaleX),this.set("scaleY",e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var i=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),i=t.util.transformPoint(i,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,i.x+=e.offsetLeft,i.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(i,"center","center")},clone:function(e,i){var n=this.toObject(i);this.constructor.fromObject?this.constructor.fromObject(n,e):t.Object._fromObject("Object",n,e)},cloneAsImage:function(e,i){var n=this.toCanvasElement(i);return e&&e(new t.Image(n)),this},toCanvasElement:function(e){e||(e={});var i=t.util,n=i.saveObjectTransform(this),r=this.group,a=this.shadow,o=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&i.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var l,c,h,u,f=t.util.createCanvasElement(),d=this.getBoundingRect(!0,!0),m=this.shadow,g={x:0,y:0};m&&(c=m.blur,l=m.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(o(m.offsetX)+c)*o(l.scaleX),g.y=2*Math.round(o(m.offsetY)+c)*o(l.scaleY)),h=d.width+g.x,u=d.height+g.y,f.width=Math.ceil(h),f.height=Math.ceil(u);var v=new t.StaticCanvas(f,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===e.format&&(v.backgroundColor="#fff"),this.setPositionByOrigin(new t.Point(v.width/2,v.height/2),"center","center");var p=this.canvas;v.add(this);var y=v.toCanvasElement(s||1,e);return this.shadow=a,this.set("canvas",p),r&&(this.group=r),this.set(n).setCoords(),v._objects=[],v.dispose(),v=null,y},toDataURL:function(e){return e||(e={}),t.util.toDataURL(this.toCanvasElement(e),e.format||"png",e.quality||1)},isType:function(e){return this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set("angle",e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,i){i=i||this.canvas.getPointer(e);var n=new t.Point(i.x,i.y),r=this._getLeftTopCoords();return this.angle&&(n=t.util.rotatePoint(n,r,o(-this.angle))),{x:n.x-r.x,y:n.y-r.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),i(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object._fromObject=function(e,i,r,a){var o=t[e];i=n(i,!0),t.util.enlivenPatterns([i.fill,i.stroke],(function(e){void 0!==e[0]&&(i.fill=e[0]),void 0!==e[1]&&(i.stroke=e[1]),t.util.enlivenObjects([i.clipPath],(function(e){i.clipPath=e[0];var t=a?new o(i[a],i):new o(i);r&&r(t)}))}))},t.Object.__uid=0)}(t),b=S.util.degreesToRadians,w={left:-.5,center:0,right:.5},x={top:-.5,center:0,bottom:.5},S.util.object.extend(S.Object.prototype,{translateToGivenOrigin:function(e,t,i,n,r){var a,o,s,l=e.x,c=e.y;return"string"==typeof t?t=w[t]:t-=.5,"string"==typeof n?n=w[n]:n-=.5,"string"==typeof i?i=x[i]:i-=.5,"string"==typeof r?r=x[r]:r-=.5,o=r-i,((a=n-t)||o)&&(s=this._getTransformedDimensions(),l=e.x+a*s.x,c=e.y+o*s.y),new S.Point(l,c)},translateToCenterPoint:function(e,t,i){var n=this.translateToGivenOrigin(e,t,i,"center","center");return this.angle?S.util.rotatePoint(n,e,b(this.angle)):n},translateToOriginPoint:function(e,t,i){var n=this.translateToGivenOrigin(e,"center","center",t,i);return this.angle?S.util.rotatePoint(n,e,b(this.angle)):n},getCenterPoint:function(){var e=new S.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var i=this.getCenterPoint();return this.translateToOriginPoint(i,e,t)},toLocalPoint:function(e,t,i){var n,r,a=this.getCenterPoint();return n=void 0!==t&&void 0!==i?this.translateToGivenOrigin(a,"center","center",t,i):new S.Point(this.left,this.top),r=new S.Point(e.x,e.y),this.angle&&(r=S.util.rotatePoint(r,a,-b(this.angle))),r.subtractEquals(n)},setPositionByOrigin:function(e,t,i){var n=this.translateToCenterPoint(e,t,i),r=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",r.x),this.set("top",r.y)},adjustPosition:function(e){var t,i,n=b(this.angle),r=this.getScaledWidth(),a=S.util.cos(n)*r,o=S.util.sin(n)*r;t="string"==typeof this.originX?w[this.originX]:this.originX-.5,i="string"==typeof e?w[e]:e-.5,this.left+=a*(i-t),this.top+=o*(i-t),this.setCoords(),this.originX=e},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX="center",this.originY="center",this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}}),function(){var e=S.util,t=e.degreesToRadians,i=e.multiplyTransformMatrices,n=e.transformPoint;e.object.extend(S.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,t){return i=this._getCoords(e,t),[new S.Point(i.tl.x,i.tl.y),new S.Point(i.tr.x,i.tr.y),new S.Point(i.br.x,i.br.y),new S.Point(i.bl.x,i.bl.y)];var i},intersectsWithRect:function(e,t,i,n){var r=this.getCoords(i,n);return"Intersection"===S.Intersection.intersectPolygonRectangle(r,e,t).status},intersectsWithObject:function(e,t,i){return"Intersection"===S.Intersection.intersectPolygonPolygon(this.getCoords(t,i),e.getCoords(t,i)).status||e.isContainedWithinObject(this,t,i)||this.isContainedWithinObject(e,t,i)},isContainedWithinObject:function(e,t,i){for(var n=this.getCoords(t,i),r=t?e.aCoords:e.lineCoords,a=0,o=e._getImageLines(r);a<4;a++)if(!e.containsPoint(n[a],o))return!1;return!0},isContainedWithinRect:function(e,t,i,n){var r=this.getBoundingRect(i,n);return r.left>=e.x&&r.left+r.width<=t.x&&r.top>=e.y&&r.top+r.height<=t.y},containsPoint:function(e,t,i,n){var r=this._getCoords(i,n),a=(t=t||this._getImageLines(r),this._findCrossPoints(e,t));return 0!==a&&a%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.getCoords(!0,e).some((function(e){return e.x<=i.x&&e.x>=t.x&&e.y<=i.y&&e.y>=t.y}))||(!!this.intersectsWithRect(t,i,!0,e)||this._containsCenterOfCanvas(t,i,e))},_containsCenterOfCanvas:function(e,t,i){var n={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(n,null,!0,i)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,i,!0,e)||this.getCoords(!0,e).every((function(e){return(e.x>=i.x||e.x<=t.x)&&(e.y>=i.y||e.y<=t.y)}))&&this._containsCenterOfCanvas(t,i,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var i,n,r,a=0;for(var o in t)if(!((r=t[o]).o.y<e.y&&r.d.y<e.y||r.o.y>=e.y&&r.d.y>=e.y||(r.o.x===r.d.x&&r.o.x>=e.x?n=r.o.x:(0,i=(r.d.y-r.o.y)/(r.d.x-r.o.x),n=-(e.y-0*e.x-(r.o.y-i*r.o.x))/(0-i)),n>=e.x&&(a+=1),2!==a)))break;return a},getBoundingRect:function(t,i){var n=this.getCoords(t,i);return e.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:0===e?1e-4:e},scale:function(e){return this._set("scaleX",e),this._set("scaleY",e),this.setCoords()},scaleToWidth:function(e,t){var i=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/i)},scaleToHeight:function(e,t){var i=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/i)},calcCoords:function(e){return e?this.calcACoords():this.calcOCoords()},calcLineCoords:function(){var i=this.getViewportTransform(),r=this.padding,a=t(this.angle),o=e.cos(a)*r,s=e.sin(a)*r,l=o+s,c=o-s,h=this.calcACoords(),u={tl:n(h.tl,i),tr:n(h.tr,i),bl:n(h.bl,i),br:n(h.br,i)};return r&&(u.tl.x-=c,u.tl.y-=l,u.tr.x+=l,u.tr.y-=c,u.bl.x-=l,u.bl.y+=c,u.br.x+=c,u.br.y+=l),u},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),n=this.getViewportTransform(),r=i(n,t),a=i(r,e),o=(a=i(a,[1/n[0],0,0,1/n[3],0,0]),this._calculateCurrentDimensions()),s={};return this.forEachControl((function(e,t,i){s[t]=e.positionHandler(o,a,i)})),s},calcACoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),r=i(t,e),a=this._getTransformedDimensions(),o=a.x/2,s=a.y/2;return{tl:n({x:-o,y:-s},r),tr:n({x:o,y:-s},r),bl:n({x:-o,y:s},r),br:n({x:o,y:s},r)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t="";return!e&&this.group&&(t=this.group.transformMatrixKey(e)+"_"),t+this.top+"_"+this.left+"_"+this.scaleX+"_"+this.scaleY+"_"+this.skewX+"_"+this.skewY+"_"+this.angle+"_"+this.originX+"_"+this.originY+"_"+this.width+"_"+this.height+"_"+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var n=this.transformMatrixKey(e),r=this.matrixCache||(this.matrixCache={});return r.key===n?r.value:(this.group&&(t=i(this.group.calcTransformMatrix(!1),t)),r.key=n,r.value=t,t)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),i=this.ownMatrixCache||(this.ownMatrixCache={});if(i.key===t)return i.value;var n=this._calcTranslateMatrix(),r={angle:this.angle,translateX:n[4],translateY:n[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return i.key=t,i.value=e.composeMatrix(r),i.value},_calcDimensionsTransformMatrix:function(t,i,n){return e.calcDimensionsMatrix({skewX:t,skewY:i,scaleX:this.scaleX*(n&&this.flipX?-1:1),scaleY:this.scaleY*(n&&this.flipY?-1:1)})},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(t,i){void 0===t&&(t=this.skewX),void 0===i&&(i=this.skewY);var n,r,a,o=0===t&&0===i;if(this.strokeUniform?(r=this.width,a=this.height):(r=(n=this._getNonTransformedDimensions()).x,a=n.y),o)return this._finalizeDimensions(r*this.scaleX,a*this.scaleY);var s=e.sizeAfterTransform(r,a,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:i});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform(),t=this._getTransformedDimensions();return n(t,e,!0).scalarAdd(2*this.padding)}})}(),S.util.object.extend(S.Object.prototype,{sendToBack:function(){return this.group?S.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?S.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?S.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?S.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&"activeSelection"!==this.group.type?S.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),function(){function e(e,t){if(t){if(t.toLive)return e+": url(#SVGID_"+t.id+"); ";var i=new S.Color(t),n=e+": "+i.toRgb()+"; ",r=i.getAlpha();return 1!==r&&(n+=e+"-opacity: "+r.toString()+"; "),n}return e+": none; "}var t=S.util.toFixed;S.util.object.extend(S.Object.prototype,{getSvgStyles:function(t){var i=this.fillRule?this.fillRule:"nonzero",n=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",a=this.strokeDashOffset?this.strokeDashOffset:"0",o=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=void 0!==this.opacity?this.opacity:"1",h=this.visible?"":" visibility: hidden;",u=t?"":this.getSvgFilter(),f=e("fill",this.fill);return[e("stroke",this.stroke),"stroke-width: ",n,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",o,"; ","stroke-dashoffset: ",a,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",l,"; ",f,"fill-rule: ",i,"; ","opacity: ",c,";",u,h].join("")},getSvgSpanStyles:function(t,i){var n=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+"; ":"",r=t.strokeWidth?"stroke-width: "+t.strokeWidth+"; ":"",a=(n=n,t.fontSize?"font-size: "+t.fontSize+"px; ":""),o=t.fontStyle?"font-style: "+t.fontStyle+"; ":"",s=t.fontWeight?"font-weight: "+t.fontWeight+"; ":"",l=t.fill?e("fill",t.fill):"",c=t.stroke?e("stroke",t.stroke):"",h=this.getSvgTextDecoration(t);return h&&(h="text-decoration: "+h+"; "),[c,r,n,a,o,s,h,l,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",i?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter((function(t){return e[t.replace("-","")]})).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(e,t){var i=e?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+S.util.matrixToSVG(i)+(t||"")+'" '},_setSVGBg:function(e){if(this.backgroundColor){var i=S.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',t(-this.width/2,i),'" y="',t(-this.height/2,i),'" width="',t(this.width,i),'" height="',t(this.height,i),'"></rect>\n')}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var i=(t=t||{}).reviver,n=t.additionalTransform||"",r=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),a=e.indexOf("COMMON_PARTS");return e[a]=r,i?i(e.join("")):e.join("")},_createBaseSVGMarkup:function(e,t){var i,n,r=(t=t||{}).noStyle,a=t.reviver,o=r?"":'style="'+this.getSvgStyles()+'" ',s=t.withShadow?'style="'+this.getSvgFilter()+'" ':"",l=this.clipPath,c=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",h=l&&l.absolutePositioned,u=this.stroke,f=this.fill,d=this.shadow,m=[],g=e.indexOf("COMMON_PARTS"),v=t.additionalTransform;return l&&(l.clipPathId="CLIPPATH_"+S.Object.__uid++,n='<clipPath id="'+l.clipPathId+'" >\n'+l.toClipPathSVG(a)+"</clipPath>\n"),h&&m.push("<g ",s,this.getSvgCommons()," >\n"),m.push("<g ",this.getSvgTransform(!1),h?"":s+this.getSvgCommons()," >\n"),i=[o,c,r?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),e[g]=i,f&&f.toLive&&m.push(f.toSVG(this)),u&&u.toLive&&m.push(u.toSVG(this)),d&&m.push(d.toSVG(this)),l&&m.push(n),m.push(e.join("")),m.push("</g>\n"),h&&m.push("</g>\n"),a?a(m.join("")):m.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var e=S.util.object.extend;function t(t,i,n){var r={};n.forEach((function(e){r[e]=t[e]})),e(t[i],r,!0)}S.util.object.extend(S.Object.prototype,{hasStateChanged:function(e){var t="_"+(e=e||"stateProperties");return Object.keys(this[t]).length<this[e].length||!function e(t,i,n){if(t===i)return!0;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var r=0,a=t.length;r<a;r++)if(!e(t[r],i[r]))return!1;return!0}if(t&&"object"==typeof t){var o,s=Object.keys(t);if(!i||"object"!=typeof i||!n&&s.length!==Object.keys(i).length)return!1;for(r=0,a=s.length;r<a;r++)if("canvas"!==(o=s[r])&&"group"!==o&&!e(t[o],i[o]))return!1;return!0}}(this[t],this,!0)},saveState:function(e){var i=e&&e.propertySet||"stateProperties",n="_"+i;return this[n]?(t(this,n,this[i]),e&&e.stateProperties&&t(this,n,e.stateProperties),this):this.setupState(e)},setupState:function(e){var t=(e=e||{}).propertySet||"stateProperties";return e.propertySet=t,this["_"+t]={},this.saveState(e),this}})}(),function(){var e=S.util.degreesToRadians;S.util.object.extend(S.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var i,n,r,a=e.x,o=e.y,s=Object.keys(this.oCoords),l=s.length-1;for(this.__corner=0;l>=0;l--)if(r=s[l],this.isControlVisible(r)&&(n=this._getImageLines(t?this.oCoords[r].touchCorner:this.oCoords[r].corner),0!==(i=this._findCrossPoints({x:a,y:o},n))&&i%2==1))return this.__corner=r,r;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var i=this.controls[t];e[t].corner=i.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=i.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var i=this.getCenterPoint(),n=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return t.translate(i.x,i.y),t.scale(1/r[0],1/r[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-n.x/2,-n.y/2,n.x,n.y),t.restore(),this},drawBorders:function(e,t){t=t||{};var i=this._calculateCurrentDimensions(),n=this.borderScaleFactor,r=i.x+n,a=i.y+n,o=void 0!==t.hasControls?t.hasControls:this.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-r/2,-a/2,r,a),o&&(e.beginPath(),this.forEachControl((function(t,i,n){t.withConnection&&t.getVisibility(n,i)&&(s=!0,e.moveTo(t.x*r,t.y*a),e.lineTo(t.x*r+t.offsetX,t.y*a+t.offsetY))})),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,t,i){i=i||{};var n=S.util.sizeAfterTransform(this.width,this.height,t),r=this.strokeWidth,a=this.strokeUniform,o=this.borderScaleFactor,s=n.x+r*(a?this.canvas.getZoom():t.scaleX)+o,l=n.y+r*(a?this.canvas.getZoom():t.scaleY)+o;return e.save(),this._setLineDash(e,i.borderDashArray||this.borderDashArray),e.strokeStyle=i.borderColor||this.borderColor,e.strokeRect(-s/2,-l/2,s,l),e.restore(),this},drawControls:function(e,t){t=t||{},e.save();var i,n,r=this.canvas.getRetinaScaling();return e.setTransform(r,0,0,r,0,0),e.strokeStyle=e.fillStyle=t.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=t.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,t.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(i=this.group.calcTransformMatrix()),this.forEachControl((function(r,a,o){n=o.oCoords[a],r.getVisibility(o,a)&&(i&&(n=S.util.transformPoint(n,i)),r.render(e,n.x,n.y,t,o))})),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||(e={}),e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),S.util.object.extend(S.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,t){var i=function(){},n=(t=t||{}).onComplete||i,r=t.onChange||i,a=this;return S.util.animate({startValue:e.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),a.requestRenderAll(),r()},onComplete:function(){e.setCoords(),n()}}),this},fxCenterObjectV:function(e,t){var i=function(){},n=(t=t||{}).onComplete||i,r=t.onChange||i,a=this;return S.util.animate({startValue:e.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),a.requestRenderAll(),r()},onComplete:function(){e.setCoords(),n()}}),this},fxRemove:function(e,t){var i=function(){},n=(t=t||{}).onComplete||i,r=t.onChange||i,a=this;return S.util.animate({startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),a.requestRenderAll(),r()},onComplete:function(){a.remove(e),n()}}),this}}),S.util.object.extend(S.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var e,t,i=[];for(e in arguments[0])i.push(e);for(var n=0,r=i.length;n<r;n++)e=i[n],t=n!==r-1,this._animate(e,arguments[0][e],arguments[1],t)}else this._animate.apply(this,arguments);return this},_animate:function(e,t,i,n){var r,a=this;t=t.toString(),i=i?S.util.object.clone(i):{},~e.indexOf(".")&&(r=e.split("."));var o=a.colorProperties.indexOf(e)>-1||r&&a.colorProperties.indexOf(r[1])>-1,s=r?this.get(r[0])[r[1]]:this.get(e);"from"in i||(i.from=s),o||(t=~t.indexOf("=")?s+parseFloat(t.replace("=","")):parseFloat(t));var l={startValue:i.from,endValue:t,byValue:i.by,easing:i.easing,duration:i.duration,abort:i.abort&&function(e,t,n){return i.abort.call(a,e,t,n)},onChange:function(t,o,s){r?a[r[0]][r[1]]=t:a.set(e,t),n||i.onChange&&i.onChange(t,o,s)},onComplete:function(e,t,r){n||(a.setCoords(),i.onComplete&&i.onComplete(e,t,r))}};return o?S.util.animateColor(l.startValue,l.endValue,l.duration,l):S.util.animate(l)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.object.clone,r={x1:1,x2:1,y1:1,y2:1};function a(e,t){var i=e.origin,n=e.axis1,r=e.axis2,a=e.dimension,o=t.nearest,s=t.center,l=t.farthest;return function(){switch(this.get(i)){case o:return Math.min(this.get(n),this.get(r));case s:return Math.min(this.get(n),this.get(r))+.5*this.get(a);case l:return Math.max(this.get(n),this.get(r))}}}t.Line?t.warn("fabric.Line is already defined"):(t.Line=t.util.createClass(t.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(e,t){e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in e?e.left:this._getLeftToOriginX(),this.top="top"in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper("_set",e,t),void 0!==r[e]&&this._setWidthHeight(),this},_getLeftToOriginX:a({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:a({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var i=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=i},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return i(this.callSuper("toObject",e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(e.y-=this.strokeWidth),0===this.height&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,i=e*this.width*.5,n=t*this.height*.5;return{x1:i,x2:e*this.width*-.5,y1:n,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',e.x1,'" y1="',e.y1,'" x2="',e.x2,'" y2="',e.y2,'" />\n']}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),t.Line.fromElement=function(e,n,r){r=r||{};var a=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),o=[a.x1||0,a.y1||0,a.x2||0,a.y2||0];n(new t.Line(o,i(a,r)))},t.Line.fromObject=function(e,i){var r=n(e,!0);r.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject("Line",r,(function(e){delete e.points,i&&i(e)}),"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=Math.PI;t.Circle?t.warn("fabric.Circle is already defined."):(t.Circle=t.util.createClass(t.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*i,cacheProperties:t.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,t){return this.callSuper("_set",e,t),"radius"===e&&this.setRadius(t),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,n=(this.endAngle-this.startAngle)%(2*i);if(0===n)e=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var r=t.util.cos(this.startAngle)*this.radius,a=t.util.sin(this.startAngle)*this.radius,o=t.util.cos(this.endAngle)*this.radius,s=t.util.sin(this.endAngle)*this.radius,l=n>i?"1":"0";e=['<path d="M '+r+" "+a," A "+this.radius+" "+this.radius," 0 ",+l+" 1"," "+o+" "+s,'" ',"COMMON_PARTS"," />\n"]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",2*e).set("height",2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),t.Circle.fromElement=function(e,i){var n,r=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!("radius"in(n=r)&&n.radius>=0))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,i(new t.Circle(r))},t.Circle.fromObject=function(e,i){t.Object._fromObject("Circle",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Triangle?t.warn("fabric.Triangle is already defined"):(t.Triangle=t.util.createClass(t.Object,{type:"triangle",width:100,height:100,_render:function(e){var t=this.width/2,i=this.height/2;e.beginPath(),e.moveTo(-t,i),e.lineTo(0,-i),e.lineTo(t,i),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-e+" "+t,"0 "+-t,e+" "+t].join(","),'" />']}}),t.Triangle.fromObject=function(e,i){return t.Object._fromObject("Triangle",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=2*Math.PI;t.Ellipse?t.warn("fabric.Ellipse is already defined."):(t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this.set("rx",e&&e.rx||0),this.set("ry",e&&e.ry||0)},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.set("width",2*t);break;case"ry":this.ry=t,this.set("height",2*t)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,i,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),t.Ellipse.fromElement=function(e,i){var n=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,i(new t.Ellipse(n))},t.Ellipse.fromObject=function(e,i){t.Object._fromObject("Ellipse",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend;t.Rect?t.warn("fabric.Rect is already defined"):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,r=this.height,a=-this.width/2,o=-this.height/2,s=0!==t||0!==i,l=.4477152502;e.beginPath(),e.moveTo(a+t,o),e.lineTo(a+n-t,o),s&&e.bezierCurveTo(a+n-l*t,o,a+n,o+l*i,a+n,o+i),e.lineTo(a+n,o+r-i),s&&e.bezierCurveTo(a+n,o+r-l*i,a+n-l*t,o+r,a+n-t,o+r),e.lineTo(a+t,o+r),s&&e.bezierCurveTo(a+l*t,o+r,a,o+r-l*i,a,o+r-i),e.lineTo(a,o+i),s&&e.bezierCurveTo(a,o+l*i,a+l*t,o,a+t,o),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),t.Rect.fromElement=function(e,n,r){if(!e)return n(null);r=r||{};var a=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);a.left=a.left||0,a.top=a.top||0,a.height=a.height||0,a.width=a.width||0;var o=new t.Rect(i(r?t.util.object.clone(r):{},a));o.visible=o.visible&&o.width>0&&o.height>0,n(o)},t.Rect.fromObject=function(e,i){return t.Object._fromObject("Rect",e,i)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.util.array.min,r=t.util.array.max,a=t.util.toFixed;t.Polyline?t.warn("fabric.Polyline is already defined"):(t.Polyline=t.util.createClass(t.Object,{type:"polyline",points:null,cacheProperties:t.Object.prototype.cacheProperties.concat("points"),initialize:function(e,t){t=t||{},this.points=e||[],this.callSuper("initialize",t),this._setPositionDimensions(t)},_setPositionDimensions:function(e){var t,i=this._calcDimensions(e);this.width=i.width,this.height=i.height,e.fromSVG||(t=this.translateToGivenOrigin({x:i.left-this.strokeWidth/2,y:i.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),void 0===e.left&&(this.left=e.fromSVG?i.left:t.x),void 0===e.top&&(this.top=e.fromSVG?i.top:t.y),this.pathOffset={x:i.left+this.width/2,y:i.top+this.height/2}},_calcDimensions:function(){var e=this.points,t=n(e,"x")||0,i=n(e,"y")||0;return{left:t,top:i,width:(r(e,"x")||0)-t,height:(r(e,"y")||0)-i}},toObject:function(e){return i(this.callSuper("toObject",e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],i=this.pathOffset.x,n=this.pathOffset.y,r=t.Object.NUM_FRACTION_DIGITS,o=0,s=this.points.length;o<s;o++)e.push(a(this.points[o].x-i,r),",",a(this.points[o].y-n,r)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',e.join(""),'" />\n']},commonRender:function(e){var t,i=this.points.length,n=this.pathOffset.x,r=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-n,this.points[0].y-r);for(var a=0;a<i;a++)t=this.points[a],e.lineTo(t.x-n,t.y-r);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get("points").length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(n,r,a){if(!n)return r(null);a||(a={});var o=t.parsePointsAttribute(n.getAttribute("points")),s=t.parseAttributes(n,t[e].ATTRIBUTE_NAMES);s.fromSVG=!0,r(new t[e](o,i(s,a)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator("Polyline"),t.Polyline.fromObject=function(e,i){return t.Object._fromObject("Polyline",e,i,"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Polygon?t.warn("fabric.Polygon is already defined"):(t.Polygon=t.util.createClass(t.Polyline,{type:"polygon",_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator("Polygon"),t.Polygon.fromObject=function(e,i){t.Object._fromObject("Polygon",e,i,"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.array.min,n=t.util.array.max,r=t.util.object.extend,a=Object.prototype.toString,o=t.util.toFixed;t.Path?t.warn("fabric.Path is already defined"):(t.Path=t.util.createClass(t.Object,{type:"path",path:null,cacheProperties:t.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:t.Object.prototype.stateProperties.concat("path"),initialize:function(e,i){i=i||{},this.callSuper("initialize",i),e||(e=[]);var n="[object Array]"===a.call(e);this.path=t.util.makePathSimpler(n?e:t.util.parsePath(e)),this.path&&t.Polyline.prototype._setPositionDimensions.call(this,i)},_renderPathCommands:function(e){var t,i=0,n=0,r=0,a=0,o=0,s=0,l=-this.pathOffset.x,c=-this.pathOffset.y;e.beginPath();for(var h=0,u=this.path.length;h<u;++h)switch((t=this.path[h])[0]){case"L":r=t[1],a=t[2],e.lineTo(r+l,a+c);break;case"M":i=r=t[1],n=a=t[2],e.moveTo(r+l,a+c);break;case"C":r=t[5],a=t[6],o=t[3],s=t[4],e.bezierCurveTo(t[1]+l,t[2]+c,o+l,s+c,r+l,a+c);break;case"Q":e.quadraticCurveTo(t[1]+l,t[2]+c,t[3]+l,t[4]+c),r=t[3],a=t[4],o=t[1],s=t[2];break;case"z":case"Z":r=i,a=n,e.closePath()}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(e){return r(this.callSuper("toObject",e),{path:this.path.map((function(e){return e.slice()}))})},toDatalessObject:function(e){var t=this.toObject(["sourcePath"].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',t.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return" translate("+o(-this.pathOffset.x,e)+", "+o(-this.pathOffset.y,e)+")"},toClipPathSVG:function(e){var t=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,r,a=[],o=[],s=0,l=0,c=0,h=0,u=0,f=this.path.length;u<f;++u){switch((e=this.path[u])[0]){case"L":c=e[1],h=e[2],r=[];break;case"M":s=c=e[1],l=h=e[2],r=[];break;case"C":r=t.util.getBoundsOfCurve(c,h,e[1],e[2],e[3],e[4],e[5],e[6]),c=e[5],h=e[6];break;case"Q":r=t.util.getBoundsOfCurve(c,h,e[1],e[2],e[1],e[2],e[3],e[4]),c=e[3],h=e[4];break;case"z":case"Z":c=s,h=l}r.forEach((function(e){a.push(e.x),o.push(e.y)})),a.push(c),o.push(h)}var d=i(a)||0,m=i(o)||0;return{left:d,top:m,width:(n(a)||0)-d,height:(n(o)||0)-m}}}),t.Path.fromObject=function(e,i){if("string"==typeof e.sourcePath){var n=e.sourcePath;t.loadSVGFromURL(n,(function(t){var n=t[0];n.setOptions(e),i&&i(n)}))}else t.Object._fromObject("Path",e,i,"path")},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(["d"]),t.Path.fromElement=function(e,i,n){var a=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);a.fromSVG=!0,i(new t.Path(a.d,r(a,n)))})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.array.min,n=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,i){t=t||{},this._objects=[],i&&this.callSuper("initialize",t),this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(i)this._updateObjectsACoords();else{var r=t&&t.centerPoint;void 0!==t.originX&&(this.originX=t.originX),void 0!==t.originY&&(this.originY=t.originY),r||this._calcBounds(),this._updateObjectsCoords(r),delete t.centerPoint,this.callSuper("initialize",t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=this._objects.length;e--;)this._objects[e].setCoords(!0)},_updateObjectsCoords:function(e){e=e||this.getCenterPoint();for(var t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var i=e.left,n=e.top;e.set({left:i-t.x,top:n-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(e){var i=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(i&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,i?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,i){var n=this._objects.length;if(this.useSetOnGroup)for(;n--;)this._objects[n].setOnGroup(e,i);if("canvas"===e)for(;n--;)this._objects[n]._set(e,i);t.Object.prototype._set.call(this,e,i)},toObject:function(e){var i=this.includeDefaultValues,n=this._objects.filter((function(e){return!e.excludeFromExport})).map((function(t){var n=t.includeDefaultValues;t.includeDefaultValues=i;var r=t.toObject(e);return t.includeDefaultValues=n,r})),r=t.Object.prototype.toObject.call(this,e);return r.objects=n,r},toDatalessObject:function(e){var i,n=this.sourcePath;if(n)i=n;else{var r=this.includeDefaultValues;i=this._objects.map((function(t){var i=t.includeDefaultValues;t.includeDefaultValues=r;var n=t.toDatalessObject(e);return t.includeDefaultValues=i,n}))}var a=t.Object.prototype.toDatalessObject.call(this,e);return a.objects=i,a},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e)for(var i=0,n=this._objects.length;i<n;i++)if(this._objects[i].willDrawShadow())return this.ownCaching=!1,!1;return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,i=this._objects.length;t<i;t++)this._objects[t].render(e);this._drawClipPath(e)},isCacheDirty:function(e){if(this.callSuper("isCacheDirty",e))return!0;if(!this.statefullCache)return!1;for(var t=0,i=this._objects.length;t<i;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var n=this.cacheWidth/this.zoomX,r=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-n/2,-r/2,n,r)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach((function(i){t.util.addTransformToObject(i,e),delete i.group,i.setCoords()})),this},realizeTransform:function(e,i){return t.util.addTransformToObject(e,i),e},destroy:function(){return this._objects.forEach((function(e){e.set("dirty",!0)})),this._restoreObjectsState()},toActiveSelection:function(){if(this.canvas){var e=this._objects,i=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var r=new t.ActiveSelection([]);return r.set(n),r.type="activeSelection",i.remove(this),e.forEach((function(e){e.group=r,e.dirty=!0,i.add(e)})),r.canvas=i,r._objects=e,i._activeObject=r,r.setCoords(),r}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject((function(e){e.setCoords(!0)})),this},_calcBounds:function(e){for(var t,i,n,r,a=[],o=[],s=["tr","br","bl","tl"],l=0,c=this._objects.length,h=s.length;l<c;++l){for(n=(t=this._objects[l]).calcACoords(),r=0;r<h;r++)i=s[r],a.push(n[i].x),o.push(n[i].y);t.aCoords=n}this._getBounds(a,o,e)},_getBounds:function(e,r,a){var o=new t.Point(i(e),i(r)),s=new t.Point(n(e),n(r)),l=o.y||0,c=o.x||0,h=s.x-o.x||0,u=s.y-o.y||0;this.width=h,this.height=u,a||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(e){for(var t=["<g ","COMMON_PARTS"," >\n"],i=0,n=this._objects.length;i<n;i++)t.push("\t\t",this._objects[i].toSVG(e));return t.push("</g>\n"),t},getSvgStyles:function(){var e=void 0!==this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",t=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),t].join("")},toClipPathSVG:function(e){for(var t=[],i=0,n=this._objects.length;i<n;i++)t.push("\t",this._objects[i].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,i){var n=e.objects,r=t.util.object.clone(e,!0);delete r.objects,"string"!=typeof n?t.util.enlivenObjects(n,(function(n){t.util.enlivenObjects([e.clipPath],(function(r){var a=t.util.object.clone(e,!0);a.clipPath=r[0],delete a.objects,i&&i(new t.Group(n,a,!0))}))})):t.loadSVGFromURL(n,(function(a){var o=t.util.groupSVGElements(a,e,n);o.set(r),i&&i(o)}))})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:"activeSelection",initialize:function(e,i){i=i||{},this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;i.originX&&(this.originX=i.originX),i.originY&&(this.originY=i.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,i),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var i=t.Object.prototype.toObject.call(this),n=new t.Group([]);if(delete i.type,n.set(i),e.forEach((function(e){e.canvas.remove(e),e.group=n})),n._objects=e,!this.canvas)return n;var r=this.canvas;return r.add(n),r._activeObject=n,n.setCoords(),n},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,i){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",e,t),void 0===(i=i||{}).hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var n=0,r=this._objects.length;n<r;n++)this._objects[n]._renderControls(e,i);e.restore()}}),t.ActiveSelection.fromObject=function(e,i){t.util.enlivenObjects(e.objects,(function(n){delete e.objects,i&&i(new t.ActiveSelection(n,e,!0))}))})}(t),function(e){"use strict";var t=S.util.object.extend;e.fabric||(e.fabric={}),e.fabric.Image?S.warn("fabric.Image is already defined."):(S.Image=S.util.createClass(S.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:S.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:S.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,t){t||(t={}),this.filters=[],this.cacheKey="texture"+S.Object.__uid++,this.callSuper("initialize",t),this._initElement(e,t)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=e,this._originalElement=e,this._initConfig(t),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var t=S.filterBackend;t&&t.evictCachesForKey&&t.evictCachesForKey(e)},dispose:function(){this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(e){S.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(this.stroke&&0!==this.strokeWidth){var t=this.width/2,i=this.height/2;e.beginPath(),e.moveTo(-t,-i),e.lineTo(t,-i),e.lineTo(t,i),e.lineTo(-t,i),e.lineTo(-t,-i),e.closePath()}},toObject:function(e){var i=[];this.filters.forEach((function(e){e&&i.push(e.toObject())}));var n=t(this.callSuper("toObject",["cropX","cropY"].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:i});return this.resizeFilter&&(n.resizeFilter=this.resizeFilter.toObject()),n},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e,t=[],i=[],n=this._element,r=-this.width/2,a=-this.height/2,o="",s="";if(!n)return[];if(this.hasCrop()){var l=S.Object.__uid++;t.push('<clipPath id="imageCrop_'+l+'">\n','\t<rect x="'+r+'" y="'+a+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),o=' clip-path="url(#imageCrop_'+l+')" '}if(this.imageSmoothing||(s='" image-rendering="optimizeSpeed'),i.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',r-this.cropX,'" y="',a-this.cropY,'" width="',n.width||n.naturalWidth,'" height="',n.height||n.height,s,'"',o,"></image>\n"),this.stroke||this.strokeDashArray){var c=this.fill;this.fill=null,e=["\t<rect ",'x="',r,'" y="',a,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=c}return t="fill"!==this.paintFirst?t.concat(e,i):t.concat(i,e)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(e,t,i){return S.util.loadImage(e,(function(e,n){this.setElement(e,i),this._setWidthHeight(),t&&t(this,n)}),this,i&&i.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var e=this.resizeFilter,t=this.minimumScaleTrigger,i=this.getTotalObjectScaling(),n=i.scaleX,r=i.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!e||n>t&&r>t)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=n,void(this._lastScaleY=r);S.filterBackend||(S.filterBackend=S.initFilterBackend());var o=S.util.createCanvasElement(),s=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,l=a.width,c=a.height;o.width=l,o.height=c,this._element=o,this._lastScaleX=e.scaleX=n,this._lastScaleY=e.scaleY=r,S.filterBackend.applyFilters([e],a,l,c,this._element,s),this._filterScalingX=o.width/this._originalElement.width,this._filterScalingY=o.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter((function(e){return e&&!e.isNeutralState()})),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===e.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var t=this._originalElement,i=t.naturalWidth||t.width,n=t.naturalHeight||t.height;if(this._element===this._originalElement){var r=S.util.createCanvasElement();r.width=i,r.height=n,this._element=r,this._filteredEl=r}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,i,n),this._lastScaleX=1,this._lastScaleY=1;return S.filterBackend||(S.filterBackend=S.initFilterBackend()),S.filterBackend.applyFilters(e,this._originalElement,i,n,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){S.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){S.util.setImageSmoothing(e,this.imageSmoothing),S.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var i=this._filterScalingX,n=this._filterScalingY,r=this.width,a=this.height,o=Math.min,s=Math.max,l=s(this.cropX,0),c=s(this.cropY,0),h=t.naturalWidth||t.width,u=t.naturalHeight||t.height,f=l*i,d=c*n,m=o(r*i,h-f),g=o(a*n,u-d),v=-r/2,p=-a/2,y=o(r,h/i-l),b=o(a,u/n-c);t&&e.drawImage(t,f,d,m,g,v,p,y,b)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,t){this.setElement(S.util.getById(e),t),S.util.addClass(this.getElement(),S.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,t){e&&e.length?S.util.enlivenObjects(e,(function(e){t&&t(e)}),"fabric.Image.filters"):t&&t()},_setWidthHeight:function(e){e||(e={});var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,t=S.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,n=this._element.height,r=1,a=1,o=0,s=0,l=0,c=0,h=this.width,u=this.height,f={width:h,height:u};return!t||"none"===t.alignX&&"none"===t.alignY?(r=h/i,a=u/n):("meet"===t.meetOrSlice&&(e=(h-i*(r=a=S.util.findScaleToFit(this._element,f)))/2,"Min"===t.alignX&&(o=-e),"Max"===t.alignX&&(o=e),e=(u-n*a)/2,"Min"===t.alignY&&(s=-e),"Max"===t.alignY&&(s=e)),"slice"===t.meetOrSlice&&(e=i-h/(r=a=S.util.findScaleToCover(this._element,f)),"Mid"===t.alignX&&(l=e/2),"Max"===t.alignX&&(l=e),e=n-u/a,"Mid"===t.alignY&&(c=e/2),"Max"===t.alignY&&(c=e),i=h/r,n=u/a)),{width:i,height:n,scaleX:r,scaleY:a,offsetLeft:o,offsetTop:s,cropX:l,cropY:c}}}),S.Image.CSS_CANVAS="canvas-img",S.Image.prototype.getSvgSrc=S.Image.prototype.getSrc,S.Image.fromObject=function(e,t){var i=S.util.object.clone(e);S.util.loadImage(i.src,(function(e,n){n?t&&t(null,!0):S.Image.prototype._initFilters.call(i,i.filters,(function(n){i.filters=n||[],S.Image.prototype._initFilters.call(i,[i.resizeFilter],(function(n){i.resizeFilter=n[0],S.util.enlivenObjects([i.clipPath],(function(n){i.clipPath=n[0];var r=new S.Image(e,i);t(r,!1)}))}))}))}),null,i.crossOrigin)},S.Image.fromURL=function(e,t,i){S.util.loadImage(e,(function(e,n){t&&t(new S.Image(e,i),n)}),null,i&&i.crossOrigin)},S.Image.ATTRIBUTE_NAMES=S.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),S.Image.fromElement=function(e,i,n){var r=S.parseAttributes(e,S.Image.ATTRIBUTE_NAMES);S.Image.fromURL(r["xlink:href"],i,t(n?S.util.object.clone(n):{},r))})}(t),S.util.object.extend(S.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(e){var t=function(){},i=(e=e||{}).onComplete||t,n=e.onChange||t,r=this;return S.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){r.rotate(e),n()},onComplete:function(){r.setCoords(),i()}}),this}}),S.util.object.extend(S.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function e(e,t){var i="precision "+t+" float;\nvoid main(){}",n=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(n,i),e.compileShader(n),!!e.getShaderParameter(n,e.COMPILE_STATUS)}function t(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}S.isWebglSupported=function(t){if(S.isLikelyNode)return!1;t=t||S.WebglFilterBackend.prototype.tileSize;var i=document.createElement("canvas"),n=i.getContext("webgl")||i.getContext("experimental-webgl"),r=!1;if(n){S.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),r=S.maxTextureSize>=t;for(var a=["highp","mediump","lowp"],o=0;o<3;o++)if(e(n,a[o])){S.webGlPrecision=a[o];break}}return this.isSupported=r,r},S.WebglFilterBackend=t,t.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,t){var i,n=void 0!==window.performance;try{new ImageData(1,1),i=!0}catch(e){i=!1}var r="undefined"!=typeof ArrayBuffer,a="undefined"!=typeof Uint8ClampedArray;if(n&&i&&r&&a){var o=S.util.createCanvasElement(),s=new ArrayBuffer(e*t*4);if(S.forceGLPutImageData)return this.imageBuffer=s,void(this.copyGLTo2D=E);var l,c,h={imageBuffer:s,destinationWidth:e,destinationHeight:t,targetCanvas:o};o.width=e,o.height=t,l=window.performance.now(),O.call(h,this.gl,h),c=window.performance.now()-l,l=window.performance.now(),E.call(h,this.gl,h),c>window.performance.now()-l?(this.imageBuffer=s,this.copyGLTo2D=E):this.copyGLTo2D=O}},createWebGLCanvas:function(e,t){var i=S.util.createCanvasElement();i.width=e,i.height=t;var n={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},r=i.getContext("webgl",n);r||(r=i.getContext("experimental-webgl",n)),r&&(r.clearColor(0,0,0,0),this.canvas=i,this.gl=r)},applyFilters:function(e,t,i,n,r,a){var o,s=this.gl;a&&(o=this.getCachedTexture(a,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:i,sourceHeight:n,destinationWidth:i,destinationHeight:n,context:s,sourceTexture:this.createTexture(s,i,n,!o&&t),targetTexture:this.createTexture(s,i,n),originalTexture:o||this.createTexture(s,i,n,!o&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},c=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,c),e.forEach((function(e){e&&e.applyTo(l)})),function(e){var t=e.targetCanvas,i=t.width,n=t.height,r=e.destinationWidth,a=e.destinationHeight;i===r&&n===a||(t.width=r,t.height=a)}(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(c),r.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,i,n){var r=e.createTexture();return e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,i,0,e.RGBA,e.UNSIGNED_BYTE,null),r},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var i=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=i,i},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:O,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:"",vendor:""};if(!e)return t;var i=e.getExtension("WEBGL_debug_renderer_info");if(i){var n=e.getParameter(i.UNMASKED_RENDERER_WEBGL),r=e.getParameter(i.UNMASKED_VENDOR_WEBGL);n&&(t.renderer=n.toLowerCase()),r&&(t.vendor=r.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){"use strict";var e=function(){};function t(){}S.Canvas2dFilterBackend=t,t.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,i,n,r){var a=r.getContext("2d");a.drawImage(t,0,0,i,n);var o={sourceWidth:i,sourceHeight:n,imageData:a.getImageData(0,0,i,n),originalEl:t,originalImageData:a.getImageData(0,0,i,n),canvasEl:r,ctx:a,filterBackend:this};return e.forEach((function(e){e.applyTo(o)})),o.imageData.width===i&&o.imageData.height===n||(r.width=o.imageData.width,r.height=o.imageData.height),a.putImageData(o.imageData,0,0),o}}}(),S.Image=S.Image||{},S.Image.filters=S.Image.filters||{},S.Image.filters.BaseFilter=S.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,t,i){t=t||this.fragmentSource,i=i||this.vertexSource,"highp"!==S.webGlPrecision&&(t=t.replace(/precision highp float/g,"precision "+S.webGlPrecision+" float"));var n=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(n,i),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+e.getShaderInfoLog(n));var r=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+e.getShaderInfoLog(r));var a=e.createProgram();if(e.attachShader(a,n),e.attachShader(a,r),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(a));var o=this.getAttributeLocations(e,a),s=this.getUniformLocations(e,a)||{};return s.uStepW=e.getUniformLocation(a,"uStepW"),s.uStepH=e.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:o,uniformLocations:s}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,i){var n=t.aPosition,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,i,n=e.context;e.passes>1?(t=e.destinationWidth,i=e.destinationHeight,e.sourceWidth===t&&e.sourceHeight===i||(n.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(n,t,i)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,t=S.Image.filters[this.type].prototype;if(e){if(Array.isArray(t[e])){for(var i=t[e].length;i--;)if(this[e][i]!==t[e][i])return!1;return!0}return t[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,i=this.retrieveShader(e);0===e.pass&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(i.program),this.sendAttributeData(t,i.attributeLocations,e.aPosition),t.uniform1f(i.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(i.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,i.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,i){e.activeTexture(i),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement("canvas");t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),S.Image.filters.BaseFilter.fromObject=function(e,t){var i=new S.Image.filters[e.type](e);return t&&t(i),i},function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.ColorMatrix=n(i.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,i,n,r,a,o=e.imageData.data,s=o.length,l=this.matrix,c=this.colorsOnly;for(a=0;a<s;a+=4)t=o[a],i=o[a+1],n=o[a+2],c?(o[a]=t*l[0]+i*l[1]+n*l[2]+255*l[4],o[a+1]=t*l[5]+i*l[6]+n*l[7]+255*l[9],o[a+2]=t*l[10]+i*l[11]+n*l[12]+255*l[14]):(r=o[a+3],o[a]=t*l[0]+i*l[1]+n*l[2]+r*l[3]+255*l[4],o[a+1]=t*l[5]+i*l[6]+n*l[7]+r*l[8]+255*l[9],o[a+2]=t*l[10]+i*l[11]+n*l[12]+r*l[13]+255*l[14],o[a+3]=t*l[15]+i*l[16]+n*l[17]+r*l[18]+255*l[19])},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,"uColorMatrix"),uConstants:e.getUniformLocation(t,"uConstants")}},sendUniformData:function(e,t){var i=this.matrix,n=[i[0],i[1],i[2],i[3],i[5],i[6],i[7],i[8],i[10],i[11],i[12],i[13],i[15],i[16],i[17],i[18]],r=[i[4],i[9],i[14],i[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,n),e.uniform4fv(t.uConstants,r)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Brightness=n(i.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(e){if(0!==this.brightness){var t,i=e.imageData.data,n=i.length,r=Math.round(255*this.brightness);for(t=0;t<n;t+=4)i[t]=i[t]+r,i[t+1]=i[t+1]+r,i[t+2]=i[t+2]+r}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,"uBrightness")}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.Image.filters,r=t.util.createClass;n.Convolute=r(n.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),i=this.type+"_"+t+"_"+(this.opaque?1:0),n=this.fragmentSource[i];return e.programCache.hasOwnProperty(i)||(e.programCache[i]=this.createProgram(e.context,n)),e.programCache[i]},applyTo2d:function(e){var t,i,n,r,a,o,s,l,c,h,u,f,d,m=e.imageData,g=m.data,v=this.matrix,p=Math.round(Math.sqrt(v.length)),y=Math.floor(p/2),b=m.width,w=m.height,x=e.ctx.createImageData(b,w),k=x.data,C=this.opaque?1:0;for(u=0;u<w;u++)for(h=0;h<b;h++){for(a=4*(u*b+h),t=0,i=0,n=0,r=0,d=0;d<p;d++)for(f=0;f<p;f++)o=h+f-y,(s=u+d-y)<0||s>=w||o<0||o>=b||(l=4*(s*b+o),c=v[d*p+f],t+=g[l]*c,i+=g[l+1]*c,n+=g[l+2]*c,C||(r+=g[l+3]*c));k[a]=t,k[a+1]=i,k[a+2]=n,k[a+3]=C?g[a+3]:r}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,"uMatrix"),uOpaque:e.getUniformLocation(t,"uOpaque"),uHalfSize:e.getUniformLocation(t,"uHalfSize"),uSize:e.getUniformLocation(t,"uSize")}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return i(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Grayscale=n(i.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(e){var t,i,n=e.imageData.data,r=n.length,a=this.mode;for(t=0;t<r;t+=4)"average"===a?i=(n[t]+n[t+1]+n[t+2])/3:"lightness"===a?i=(Math.min(n[t],n[t+1],n[t+2])+Math.max(n[t],n[t+1],n[t+2]))/2:"luminosity"===a&&(i=.21*n[t]+.72*n[t+1]+.07*n[t+2]),n[t]=i,n[t+1]=i,n[t+2]=i},retrieveShader:function(e){var t=this.type+"_"+this.mode;if(!e.programCache.hasOwnProperty(t)){var i=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,i)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,"uMode")}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Invert=n(i.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(e){var t,i=e.imageData.data,n=i.length;for(t=0;t<n;t+=4)i[t]=255-i[t],i[t+1]=255-i[t+1],i[t+2]=255-i[t+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,"uInvert")}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.Image.filters,r=t.util.createClass;n.Noise=r(n.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(e){if(0!==this.noise){var t,i,n=e.imageData.data,r=n.length,a=this.noise;for(t=0,r=n.length;t<r;t+=4)i=(.5-Math.random())*a,n[t]+=i,n[t+1]+=i,n[t+2]+=i}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,"uNoise"),uSeed:e.getUniformLocation(t,"uSeed")}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return i(this.callSuper("toObject"),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Pixelate=n(i.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(e){var t,i,n,r,a,o,s,l,c,h,u,f=e.imageData,d=f.data,m=f.height,g=f.width;for(i=0;i<m;i+=this.blocksize)for(n=0;n<g;n+=this.blocksize)for(r=d[t=4*i*g+4*n],a=d[t+1],o=d[t+2],s=d[t+3],h=Math.min(i+this.blocksize,m),u=Math.min(n+this.blocksize,g),l=i;l<h;l++)for(c=n;c<u;c++)d[t=4*l*g+4*c]=r,d[t+1]=a,d[t+2]=o,d[t+3]=s},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,"uBlocksize"),uStepW:e.getUniformLocation(t,"uStepW"),uStepH:e.getUniformLocation(t,"uStepH")}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.extend,n=t.Image.filters,r=t.util.createClass;n.RemoveColor=r(n.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(e){var i,n,r,a,o=e.imageData.data,s=255*this.distance,l=new t.Color(this.color).getSource(),c=[l[0]-s,l[1]-s,l[2]-s],h=[l[0]+s,l[1]+s,l[2]+s];for(i=0;i<o.length;i+=4)n=o[i],r=o[i+1],a=o[i+2],n>c[0]&&r>c[1]&&a>c[2]&&n<h[0]&&r<h[1]&&a<h[2]&&(o[i+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,"uLow"),uHigh:e.getUniformLocation(t,"uHigh")}},sendUniformData:function(e,i){var n=new t.Color(this.color).getSource(),r=parseFloat(this.distance),a=[0+n[0]/255-r,0+n[1]/255-r,0+n[2]/255-r,1],o=[n[0]/255+r,n[1]/255+r,n[2]/255+r,1];e.uniform4fv(i.uLow,a),e.uniform4fv(i.uHigh,o)},toObject:function(){return i(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass,r={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var a in r)i[a]=n(i.ColorMatrix,{type:a,matrix:r[a],mainParameter:!1,colorsOnly:!0}),t.Image.filters[a].fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric,i=t.Image.filters,n=t.util.createClass;i.BlendColor=n(i.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(e){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[e]+"}\n}"},retrieveShader:function(e){var t,i=this.type+"_"+this.mode;return e.programCache.hasOwnProperty(i)||(t=this.buildSource(this.mode),e.programCache[i]=this.createProgram(e.context,t)),e.programCache[i]},applyTo2d:function(e){var i,n,r,a,o,s,l,c=e.imageData.data,h=c.length,u=1-this.alpha;i=(l=new t.Color(this.color).getSource())[0]*this.alpha,n=l[1]*this.alpha,r=l[2]*this.alpha;for(var f=0;f<h;f+=4)switch(a=c[f],o=c[f+1],s=c[f+2],this.mode){case"multiply":c[f]=a*i/255,c[f+1]=o*n/255,c[f+2]=s*r/255;break;case"screen":c[f]=255-(255-a)*(255-i)/255,c[f+1]=255-(255-o)*(255-n)/255,c[f+2]=255-(255-s)*(255-r)/255;break;case"add":c[f]=a+i,c[f+1]=o+n,c[f+2]=s+r;break;case"diff":case"difference":c[f]=Math.abs(a-i),c[f+1]=Math.abs(o-n),c[f+2]=Math.abs(s-r);break;case"subtract":c[f]=a-i,c[f+1]=o-n,c[f+2]=s-r;break;case"darken":c[f]=Math.min(a,i),c[f+1]=Math.min(o,n),c[f+2]=Math.min(s,r);break;case"lighten":c[f]=Math.max(a,i),c[f+1]=Math.max(o,n),c[f+2]=Math.max(s,r);break;case"overlay":c[f]=i<128?2*a*i/255:255-2*(255-a)*(255-i)/255,c[f+1]=n<128?2*o*n/255:255-2*(255-o)*(255-n)/255,c[f+2]=r<128?2*s*r/255:255-2*(255-s)*(255-r)/255;break;case"exclusion":c[f]=i+a-2*i*a/255,c[f+1]=n+o-2*n*o/255,c[f+2]=r+s-2*r*s/255;break;case"tint":c[f]=i+a*u,c[f+1]=n+o*u,c[f+2]=r+s*u}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,"uColor")}},sendUniformData:function(e,i){var n=new t.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,e.uniform4fv(i.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric,i=t.Image.filters,n=t.util.createClass;i.BlendImage=n(i.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(e){var t=this.type+"_"+this.mode,i=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,i)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,i=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,i,t.TEXTURE1),this.callSuper("applyToWebGL",e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,i=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/i,1]},applyTo2d:function(e){var i,n,r,a,o,s,l,c,h,u,f,d=e.imageData,m=e.filterBackend.resources,g=d.data,v=g.length,p=d.width,y=d.height,b=this.image;m.blendImage||(m.blendImage=t.util.createCanvasElement()),u=(h=m.blendImage).getContext("2d"),h.width!==p||h.height!==y?(h.width=p,h.height=y):u.clearRect(0,0,p,y),u.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),u.drawImage(b._element,0,0,p,y),f=u.getImageData(0,0,p,y).data;for(var w=0;w<v;w+=4)switch(o=g[w],s=g[w+1],l=g[w+2],c=g[w+3],i=f[w],n=f[w+1],r=f[w+2],a=f[w+3],this.mode){case"multiply":g[w]=o*i/255,g[w+1]=s*n/255,g[w+2]=l*r/255,g[w+3]=c*a/255;break;case"mask":g[w+3]=a}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,"uTransformMatrix"),uImage:e.getUniformLocation(t,"uImage")}},sendUniformData:function(e,t){var i=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,i)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,i){t.Image.fromObject(e.image,(function(n){var r=t.util.object.clone(e);r.image=n,i(new t.Image.filters.BlendImage(r))}))}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=Math.pow,n=Math.floor,r=Math.sqrt,a=Math.abs,o=Math.round,s=Math.sin,l=Math.ceil,c=t.Image.filters,h=t.util.createClass;c.Resize=h(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,"uDelta"),uTaps:e.getUniformLocation(t,"uTaps")}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),i=this.type+"_"+t;if(!e.programCache.hasOwnProperty(i)){var n=this.generateShader(t);e.programCache[i]=this.createProgram(e.context,n)}return e.programCache[i]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,i=this.getFilterWindow(),n=new Array(i),r=1;r<=i;r++)n[r-1]=e(r*t);return n},generateShader:function(e){for(var t=new Array(e),i=this.fragmentSourceTOP,n=1;n<=e;n++)t[n-1]=n+".0 * uDelta";return i+="uniform float uTaps["+e+"];\n",i+="void main() {\n",i+=" vec4 color = texture2D(uTexture, vTexCoord);\n",i+=" float sum = 1.0;\n",t.forEach((function(e,t){i+=" color += texture2D(uTexture, vTexCoord + "+e+") * uTaps["+t+"];\n",i+=" color += texture2D(uTexture, vTexCoord - "+e+") * uTaps["+t+"];\n",i+=" sum += 2.0 * uTaps["+t+"];\n"})),i+=" gl_FragColor = color / sum;\n",i+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var i=(t*=Math.PI)/e;return s(t)/t*s(i)/i}},applyTo2d:function(e){var t=e.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;var r,a=t.width,s=t.height,l=o(a*i),c=o(s*n);"sliceHack"===this.resizeType?r=this.sliceByTwo(e,a,s,l,c):"hermite"===this.resizeType?r=this.hermiteFastResize(e,a,s,l,c):"bilinear"===this.resizeType?r=this.bilinearFiltering(e,a,s,l,c):"lanczos"===this.resizeType&&(r=this.lanczosResize(e,a,s,l,c)),e.imageData=r},sliceByTwo:function(e,i,r,a,o){var s,l,c=e.imageData,h=!1,u=!1,f=.5*i,d=.5*r,m=t.filterBackend.resources,g=0,v=0,p=i,y=0;for(m.sliceByTwo||(m.sliceByTwo=document.createElement("canvas")),((s=m.sliceByTwo).width<1.5*i||s.height<r)&&(s.width=1.5*i,s.height=r),(l=s.getContext("2d")).clearRect(0,0,1.5*i,r),l.putImageData(c,0,0),a=n(a),o=n(o);!h||!u;)i=f,r=d,a<n(.5*f)?f=n(.5*f):(f=a,h=!0),o<n(.5*d)?d=n(.5*d):(d=o,u=!0),l.drawImage(s,g,v,i,r,p,y,f,d),g=p,v=y,y+=d;return l.getImageData(g,v,a,o)},lanczosResize:function(e,t,o,s,c){var h=e.imageData.data,u=e.ctx.createImageData(s,c),f=u.data,d=this.lanczosCreate(this.lanczosLobes),m=this.rcpScaleX,g=this.rcpScaleY,v=2/this.rcpScaleX,p=2/this.rcpScaleY,y=l(m*this.lanczosLobes/2),b=l(g*this.lanczosLobes/2),w={},x={},k={};return function e(l){var C,_,S,T,O,E,R,I,A,D,P;for(x.x=(l+.5)*m,k.x=n(x.x),C=0;C<c;C++){for(x.y=(C+.5)*g,k.y=n(x.y),O=0,E=0,R=0,I=0,A=0,_=k.x-y;_<=k.x+y;_++)if(!(_<0||_>=t)){D=n(1e3*a(_-x.x)),w[D]||(w[D]={});for(var F=k.y-b;F<=k.y+b;F++)F<0||F>=o||(P=n(1e3*a(F-x.y)),w[D][P]||(w[D][P]=d(r(i(D*v,2)+i(P*p,2))/1e3)),(S=w[D][P])>0&&(O+=S,E+=S*h[T=4*(F*t+_)],R+=S*h[T+1],I+=S*h[T+2],A+=S*h[T+3]))}f[T=4*(C*s+l)]=E/O,f[T+1]=R/O,f[T+2]=I/O,f[T+3]=A/O}return++l<s?e(l):u}(0)},bilinearFiltering:function(e,t,i,r,a){var o,s,l,c,h,u,f,d,m,g=0,v=this.rcpScaleX,p=this.rcpScaleY,y=4*(t-1),b=e.imageData.data,w=e.ctx.createImageData(r,a),x=w.data;for(l=0;l<a;l++)for(c=0;c<r;c++)for(h=v*c-(o=n(v*c)),u=p*l-(s=n(p*l)),m=4*(s*t+o),f=0;f<4;f++)d=b[m+f]*(1-h)*(1-u)+b[m+4+f]*h*(1-u)+b[m+y+f]*u*(1-h)+b[m+y+4+f]*h*u,x[g++]=d;return w},hermiteFastResize:function(e,t,i,o,s){for(var c=this.rcpScaleX,h=this.rcpScaleY,u=l(c/2),f=l(h/2),d=e.imageData.data,m=e.ctx.createImageData(o,s),g=m.data,v=0;v<s;v++)for(var p=0;p<o;p++){for(var y=4*(p+v*o),b=0,w=0,x=0,k=0,C=0,_=0,S=0,T=(v+.5)*h,O=n(v*h);O<(v+1)*h;O++)for(var E=a(T-(O+.5))/f,R=(p+.5)*c,I=E*E,A=n(p*c);A<(p+1)*c;A++){var D=a(R-(A+.5))/u,P=r(I+D*D);P>1&&P<-1||(b=2*P*P*P-3*P*P+1)>0&&(S+=b*d[(D=4*(A+O*t))+3],x+=b,d[D+3]<255&&(b=b*d[D+3]/250),k+=b*d[D],C+=b*d[D+1],_+=b*d[D+2],w+=b)}g[y]=k/w,g[y+1]=C/w,g[y+2]=_/w,g[y+3]=S/x}return m},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Contrast=n(i.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(0!==this.contrast){var t,i=e.imageData.data,n=i.length,r=Math.floor(255*this.contrast),a=259*(r+255)/(255*(259-r));for(t=0;t<n;t+=4)i[t]=a*(i[t]-128)+128,i[t+1]=a*(i[t+1]-128)+128,i[t+2]=a*(i[t+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,"uContrast")}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Saturation=n(i.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(e){if(0!==this.saturation){var t,i,n=e.imageData.data,r=n.length,a=-this.saturation;for(t=0;t<r;t+=4)i=Math.max(n[t],n[t+1],n[t+2]),n[t]+=i!==n[t]?(i-n[t])*a:0,n[t+1]+=i!==n[t+1]?(i-n[t+1])*a:0,n[t+2]+=i!==n[t+2]?(i-n[t+2])*a:0}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,"uSaturation")}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Vibrance=n(i.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(e){if(0!==this.vibrance){var t,i,n,r,a=e.imageData.data,o=a.length,s=-this.vibrance;for(t=0;t<o;t+=4)i=Math.max(a[t],a[t+1],a[t+2]),n=(a[t]+a[t+1]+a[t+2])/3,r=2*Math.abs(i-n)/255*s,a[t]+=i!==a[t]?(i-a[t])*r:0,a[t+1]+=i!==a[t+1]?(i-a[t+1])*r:0,a[t+2]+=i!==a[t+2]?(i-a[t+2])*r:0}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,"uVibrance")}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Blur=n(i.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var i,n,r=e.filterBackend.resources,a=e.imageData.width,o=e.imageData.height;r.blurLayer1||(r.blurLayer1=t.util.createCanvasElement(),r.blurLayer2=t.util.createCanvasElement()),i=r.blurLayer1,n=r.blurLayer2,i.width===a&&i.height===o||(n.width=i.width=a,n.height=i.height=o);var s,l,c,h,u=i.getContext("2d"),f=n.getContext("2d"),d=.06*this.blur*.5;for(u.putImageData(e.imageData,0,0),f.clearRect(0,0,a,o),h=-15;h<=15;h++)c=d*(l=h/15)*a+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,c,s),u.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);for(h=-15;h<=15;h++)c=d*(l=h/15)*o+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(l),f.drawImage(i,s,c),u.drawImage(n,0,0),f.globalAlpha=1,f.clearRect(0,0,n.width,n.height);e.ctx.drawImage(i,0,0);var m=e.ctx.getImageData(0,0,i.width,i.height);return u.globalAlpha=1,u.clearRect(0,0,i.width,i.height),m},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,"uDelta")}},sendUniformData:function(e,t){var i=this.chooseRightDelta();e.uniform2fv(t.delta,i)},chooseRightDelta:function(){var e,t=1,i=[0,0];return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?i[0]=e:i[1]=e,i}}),i.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Gamma=n(i.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],i.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,i=e.imageData.data,n=this.gamma,r=i.length,a=1/n[0],o=1/n[1],s=1/n[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,r=256;t<r;t++)this.rVals[t]=255*Math.pow(t/255,a),this.gVals[t]=255*Math.pow(t/255,o),this.bVals[t]=255*Math.pow(t/255,s);for(t=0,r=i.length;t<r;t+=4)i[t]=this.rVals[i[t]],i[t+1]=this.gVals[i[t+1]],i[t+2]=this.bVals[i[t+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,"uGamma")}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.Composed=n(i.BaseFilter,{type:"Composed",subFilters:[],initialize:function(e){this.callSuper("initialize",e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach((function(t){t.applyTo(e)}))},toObject:function(){return t.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map((function(e){return e.toObject()}))})},isNeutralState:function(){return!this.subFilters.some((function(e){return!e.isNeutralState()}))}}),t.Image.filters.Composed.fromObject=function(e,i){var n=(e.subFilters||[]).map((function(e){return new t.Image.filters[e.type](e)})),r=new t.Image.filters.Composed({subFilters:n});return i&&i(r),r}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.Image.filters,n=t.util.createClass;i.HueRotation=n(i.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var e=this.rotation*Math.PI,i=t.util.cos(e),n=t.util.sin(e),r=Math.sqrt(1/3)*n,a=1-i;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=i+a/3,this.matrix[1]=1/3*a-r,this.matrix[2]=1/3*a+r,this.matrix[5]=1/3*a+r,this.matrix[6]=i+1/3*a,this.matrix[7]=1/3*a-r,this.matrix[10]=1/3*a-r,this.matrix[11]=1/3*a+r,this.matrix[12]=i+1/3*a},isNeutralState:function(e){return this.calculateMatrix(),i.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),i.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),i=t.util.object.clone;if(t.Text)t.warn("fabric.Text is already defined");else{var n="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide".split(" ");t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:t.Object.prototype.stateProperties.concat(n),cacheProperties:t.Object.prototype.cacheProperties.concat(n),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper("initialize",t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||(t._measuringContext=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext("2d")),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var e,t,i,n,r,a,o,s=0,l=this._textLines.length;s<l;s++)if(("justify"===this.textAlign||s!==l-1&&!this.isEndOfWrapping(s))&&(n=0,r=this._textLines[s],(t=this.getLineWidth(s))<this.width&&(o=this.textLines[s].match(this._reSpacesAndTabs)))){i=o.length,e=(this.width-t)/i;for(var c=0,h=r.length;c<=h;c++)a=this.__charBounds[s][c],this._reSpaceAndTab.test(r[c])?(a.width+=e,a.kernedWidth+=e,a.left+=n,n+=e):a.left+=n}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,i){e.textBaseline="alphabetic",e.font=this._getFontDeclaration(t,i)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,i=this._textLines.length;t<i;t++){var n=this.getLineWidth(t);n>e&&(e=n)}return e},_renderTextLine:function(e,t,i,n,r,a){this._renderChars(e,t,i,n,r,a)},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var t,i,n,r,a,o,s,l=e.fillStyle,c=this._getLeftOffset(),h=this._getTopOffset(),u=0,f=0,d=this.path,m=0,g=this._textLines.length;m<g;m++)if(t=this.getHeightOfLine(m),this.textBackgroundColor||this.styleHas("textBackgroundColor",m)){n=this._textLines[m],i=this._getLineLeftOffset(m),f=0,u=0,r=this.getValueOfPropertyAt(m,0,"textBackgroundColor");for(var v=0,p=n.length;v<p;v++)a=this.__charBounds[m][v],o=this.getValueOfPropertyAt(m,v,"textBackgroundColor"),d?(e.save(),e.translate(a.renderLeft,a.renderTop),e.rotate(a.angle),e.fillStyle=o,o&&e.fillRect(-a.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),a.width,t/this.lineHeight),e.restore()):o!==r?(s=c+i+u,"rtl"===this.direction&&(s=this.width-s-f),e.fillStyle=r,r&&e.fillRect(s,h,f,t/this.lineHeight),u=a.left,f=a.width,r=o):f+=a.kernedWidth;o&&!d&&(s=c+i+u,"rtl"===this.direction&&(s=this.width-s-f),e.fillStyle=o,e.fillRect(s,h,f,t/this.lineHeight)),h+=t}else h+=t;e.fillStyle=l,this._removeShadow(e)}},getFontCache:function(e){var i=e.fontFamily.toLowerCase();t.charWidthsCache[i]||(t.charWidthsCache[i]={});var n=t.charWidthsCache[i],r=e.fontStyle.toLowerCase()+"_"+(e.fontWeight+"").toLowerCase();return n[r]||(n[r]={}),n[r]},_measureChar:function(e,t,i,n){var r,a,o,s,l=this.getFontCache(t),c=i+e,h=this._getFontDeclaration(t)===this._getFontDeclaration(n),u=t.fontSize/this.CACHE_FONT_SIZE;if(i&&void 0!==l[i]&&(o=l[i]),void 0!==l[e]&&(s=r=l[e]),h&&void 0!==l[c]&&(s=(a=l[c])-o),void 0===r||void 0===o||void 0===a){var f=this.getMeasuringContext();this._setTextStyles(f,t,!0)}return void 0===r&&(s=r=f.measureText(e).width,l[e]=r),void 0===o&&h&&i&&(o=f.measureText(i).width,l[i]=o),h&&void 0===a&&(a=f.measureText(c).width,l[c]=a,s=a-o),{width:r*u,kernedWidth:s*u}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,"fontSize")},measureLine:function(e){var t=this._measureLine(e);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var i,n,r,a,o,s,l=0,c=this._textLines[e],h=new Array(c.length),u=0,f=this.path,d="right"===this.pathSide;for(this.__charBounds[e]=h,i=0;i<c.length;i++)n=c[i],a=this._getGraphemeBox(n,e,i,r),h[i]=a,l+=a.kernedWidth,r=n;if(h[i]={left:a?a.left+a.width:0,width:0,kernedWidth:0,height:this.fontSize},f){switch(s=f.segmentsInfo[f.segmentsInfo.length-1].length,(o=t.util.getPointOnPath(f.path,0,f.segmentsInfo)).x+=f.pathOffset.x,o.y+=f.pathOffset.y,this.textAlign){case"left":u=d?s-l:0;break;case"center":u=(s-l)/2;break;case"right":u=d?0:s-l}for(u+=this.pathStartOffset*(d?-1:1),i=d?c.length-1:0;d?i>=0:i<c.length;d?i--:i++)a=h[i],u>s?u%=s:u<0&&(u+=s),this._setGraphemeOnPath(u,a,o),u+=a.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(e,i,n){var r=e+i.kernedWidth/2,a=this.path,o=t.util.getPointOnPath(a.path,r,a.segmentsInfo);i.renderLeft=o.x-n.x,i.renderTop=o.y-n.y,i.angle=o.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(e,t,i,n,r){var a,o=this.getCompleteStyleDeclaration(t,i),s=n?this.getCompleteStyleDeclaration(t,i-1):{},l=this._measureChar(e,o,n,s),c=l.kernedWidth,h=l.width;0!==this.charSpacing&&(h+=a=this._getWidthOfCharSpacing(),c+=a);var u={width:h,left:0,height:o.fontSize,kernedWidth:c,deltaY:o.deltaY};if(i>0&&!r){var f=this.__charBounds[t][i-1];u.left=f.left+f.width+l.kernedWidth-l.width}return u},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],i=this.getHeightOfChar(e,0),n=1,r=t.length;n<r;n++)i=Math.max(this.getHeightOfChar(e,n),i);return this.__lineHeights[e]=i*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,i=0,n=this._textLines.length;i<n;i++)e=this.getHeightOfLine(i),t+=i===n-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var i=0,n=this._getLeftOffset(),r=this._getTopOffset(),a=0,o=this._textLines.length;a<o;a++){var s=this.getHeightOfLine(a),l=s/this.lineHeight,c=this._getLineLeftOffset(a);this._renderTextLine(t,e,this._textLines[a],n+c,r+i+l,a),i+=s}e.restore()},_renderTextFill:function(e){(this.fill||this.styleHas("fill"))&&this._renderTextCommon(e,"fillText")},_renderTextStroke:function(e){(this.stroke&&0!==this.strokeWidth||!this.isEmptyStyles())&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,"strokeText"),e.closePath(),e.restore())},_renderChars:function(e,t,i,n,r,a){var o,s,l,c,h,u=this.getHeightOfLine(a),f=-1!==this.textAlign.indexOf("justify"),d="",m=0,g=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(a)&&!g,p="ltr"===this.direction,y="ltr"===this.direction?1:-1;if(t.save(),r-=u*this._fontSizeFraction/this.lineHeight,v)return t.canvas.setAttribute("dir",p?"ltr":"rtl"),t.direction=p?"ltr":"rtl",t.textAlign=p?"left":"right",this._renderChar(e,t,a,0,i.join(""),n,r,u),void t.restore();for(var b=0,w=i.length-1;b<=w;b++)c=b===w||this.charSpacing||g,d+=i[b],l=this.__charBounds[a][b],0===m?(n+=y*(l.kernedWidth-l.width),m+=l.width):m+=l.kernedWidth,f&&!c&&this._reSpaceAndTab.test(i[b])&&(c=!0),c||(o=o||this.getCompleteStyleDeclaration(a,b),s=this.getCompleteStyleDeclaration(a,b+1),c=this._hasStyleChanged(o,s)),c&&(g?(t.save(),t.translate(l.renderLeft,l.renderTop),t.rotate(l.angle),this._renderChar(e,t,a,b,d,-m/2,0,u),t.restore()):(h=n,t.canvas.setAttribute("dir",p?"ltr":"rtl"),t.direction=p?"ltr":"rtl",t.textAlign=p?"left":"right",this._renderChar(e,t,a,b,d,h,r,u)),d="",o=s,n+=y*m,m=0);t.restore()},_applyPatternGradientTransformText:function(e){var i,n=t.util.createCanvasElement(),r=this.width+this.strokeWidth,a=this.height+this.strokeWidth;return n.width=r,n.height=a,(i=n.getContext("2d")).beginPath(),i.moveTo(0,0),i.lineTo(r,0),i.lineTo(r,a),i.lineTo(0,a),i.closePath(),i.translate(r/2,a/2),i.fillStyle=e.toLive(i),this._applyPatternGradientTransform(i,e),i.fill(),i.createPattern(n,"no-repeat")},handleFiller:function(e,t,i){var n,r;return i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?(n=-this.width/2,r=-this.height/2,e.translate(n,r),e[t]=this._applyPatternGradientTransformText(i),{offsetX:n,offsetY:r}):(e[t]=i.toLive(e,this),this._applyPatternGradientTransform(e,i)):(e[t]=i,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,"strokeStyle",t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,"fillStyle",t.fill)},_renderChar:function(e,t,i,n,r,a,o){var s,l,c=this._getStyleDeclaration(i,n),h=this.getCompleteStyleDeclaration(i,n),u="fillText"===e&&h.fill,f="strokeText"===e&&h.stroke&&h.strokeWidth;(f||u)&&(t.save(),u&&(s=this._setFillStyles(t,h)),f&&(l=this._setStrokeStyles(t,h)),t.font=this._getFontDeclaration(h),c&&c.textBackgroundColor&&this._removeShadow(t),c&&c.deltaY&&(o+=c.deltaY),u&&t.fillText(r,a-s.offsetX,o-s.offsetY),f&&t.strokeText(r,a-l.offsetX,o-l.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,i){var n=this.get2DCursorLocation(e,!0),r=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),a=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),o={fontSize:r*i.size,deltaY:a+r*i.baseline};return this.setSelectionStyles(o,e,t),this},_hasStyleChanged:function(e,t){return e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.deltaY!==t.deltaY},_hasStyleChangedForSvg:function(e,t){return this._hasStyleChanged(e,t)||e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),i=this.width-t,n=this.textAlign,r=this.direction,a=0,o=this.isEndOfWrapping(e);return"justify"===n||"justify-center"===n&&!o||"justify-right"===n&&!o||"justify-left"===n&&!o?0:("center"===n&&(a=i/2),"right"===n&&(a=i),"justify-center"===n&&(a=i/2),"justify-right"===n&&(a=i),"rtl"===r&&(a-=i),a)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||(e=this.hasStateChanged("_dimensionAffectingProps")),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){return this.__lineWidths[e]?this.__lineWidths[e]:(t=""===this._textLines[e]?0:this.measureLine(e).width,this.__lineWidths[e]=t,t);var t},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(e,t,i){var n=this._getStyleDeclaration(e,t);return n&&void 0!==n[i]?n[i]:this[i]},_renderTextDecoration:function(e,t){if(this[t]||this.styleHas(t)){for(var i,n,r,a,o,s,l,c,h,u,f,d,m,g,v,p,y=this._getLeftOffset(),b=this._getTopOffset(),w=this.path,x=this._getWidthOfCharSpacing(),k=this.offsets[t],C=0,_=this._textLines.length;C<_;C++)if(i=this.getHeightOfLine(C),this[t]||this.styleHas(t,C)){l=this._textLines[C],g=i/this.lineHeight,a=this._getLineLeftOffset(C),u=0,f=0,c=this.getValueOfPropertyAt(C,0,t),p=this.getValueOfPropertyAt(C,0,"fill"),h=b+g*(1-this._fontSizeFraction),n=this.getHeightOfChar(C,0),o=this.getValueOfPropertyAt(C,0,"deltaY");for(var S=0,T=l.length;S<T;S++)if(d=this.__charBounds[C][S],m=this.getValueOfPropertyAt(C,S,t),v=this.getValueOfPropertyAt(C,S,"fill"),r=this.getHeightOfChar(C,S),s=this.getValueOfPropertyAt(C,S,"deltaY"),w&&m&&v)e.save(),e.fillStyle=p,e.translate(d.renderLeft,d.renderTop),e.rotate(d.angle),e.fillRect(-d.kernedWidth/2,k*r+s,d.kernedWidth,this.fontSize/15),e.restore();else if((m!==c||v!==p||r!==n||s!==o)&&f>0){var O=y+a+u;"rtl"===this.direction&&(O=this.width-O-f),c&&p&&(e.fillStyle=p,e.fillRect(O,h+k*n+o,f,this.fontSize/15)),u=d.left,f=d.width,c=m,p=v,n=r,o=s}else f+=d.kernedWidth;O=y+a+u;"rtl"===this.direction&&(O=this.width-O-f),e.fillStyle=v,m&&v&&e.fillRect(O,h+k*n+o,f-x,this.fontSize/15),b+=i}else b+=i;this._removeShadow(e)}},_getFontDeclaration:function(e,i){var n=e||this,r=this.fontFamily,a=t.Text.genericFonts.indexOf(r.toLowerCase())>-1,o=void 0===r||r.indexOf("'")>-1||r.indexOf(",")>-1||r.indexOf('"')>-1||a?n.fontFamily:'"'+n.fontFamily+'"';return[t.isLikelyNode?n.fontWeight:n.fontStyle,t.isLikelyNode?n.fontStyle:n.fontWeight,i?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",o].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var i=e.split(this._reNewline),n=new Array(i.length),r=["\n"],a=[],o=0;o<i.length;o++)n[o]=t.util.string.graphemeSplit(i[o]),a=a.concat(n[o],r);return a.pop(),{_unwrappedLines:n,lines:i,graphemeText:a,graphemeLines:n}},toObject:function(e){var t=n.concat(e),r=this.callSuper("toObject",t);return r.styles=i(this.styles,!0),r.path&&(r.path=this.path.toObject()),r},set:function(e,t){this.callSuper("set",e,t);var i=!1,n=!1;if("object"==typeof e)for(var r in e)"path"===r&&this.setPathInfo(),i=i||-1!==this._dimensionAffectingProps.indexOf(r),n=n||"path"===r;else i=-1!==this._dimensionAffectingProps.indexOf(e),n="path"===e;return n&&this.setPathInfo(),i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,n,r){if(!e)return n(null);var a=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),o=a.textAnchor||"left";if((r=t.util.object.extend(r?i(r):{},a)).top=r.top||0,r.left=r.left||0,a.textDecoration){var s=a.textDecoration;-1!==s.indexOf("underline")&&(r.underline=!0),-1!==s.indexOf("overline")&&(r.overline=!0),-1!==s.indexOf("line-through")&&(r.linethrough=!0),delete r.textDecoration}"dx"in a&&(r.left+=a.dx),"dy"in a&&(r.top+=a.dy),"fontSize"in r||(r.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in e?l=e.textContent:"firstChild"in e&&null!==e.firstChild&&"data"in e.firstChild&&null!==e.firstChild.data&&(l=e.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=r.strokeWidth;r.strokeWidth=0;var h=new t.Text(l,r),u=h.getScaledHeight()/h.height,f=((h.height+h.strokeWidth)*h.lineHeight-h.height)*u,d=h.getScaledHeight()+f,m=0;"center"===o&&(m=h.getScaledWidth()/2),"right"===o&&(m=h.getScaledWidth()),h.set({left:h.left-m,top:h.top-(d-h.fontSize*(.07+h._fontSizeFraction))/h.lineHeight,strokeWidth:void 0!==c?c:1}),n(h)},t.Text.fromObject=function(e,n){var r=i(e),a=e.path;return delete r.path,t.Object._fromObject("Text",r,(function(e){a?t.Object._fromObject("Path",a,(function(t){e.set("path",t),n(e)}),"path"):n(e)}),"text")},t.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],t.util.createAccessors&&t.util.createAccessors(t.Text)}}(t),S.util.object.extend(S.Text.prototype,{isEmptyStyles:function(e){if(!this.styles)return!0;if(void 0!==e&&!this.styles[e])return!0;var t=void 0===e?this.styles:{line:this.styles[e]};for(var i in t)for(var n in t[i])for(var r in t[i][n])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||""===e)return!1;if(void 0!==t&&!this.styles[t])return!1;var i=void 0===t?this.styles:{0:this.styles[t]};for(var n in i)for(var r in i[n])if(void 0!==i[n][r][e])return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||""===e)return!1;var t,i,n=this.styles,r=0,a=!0,o=0;for(var s in n){for(var l in t=0,n[s]){var c;r++,(c=n[s][l]).hasOwnProperty(e)?(i?c[e]!==i&&(a=!1):i=c[e],c[e]===this[e]&&delete c[e]):a=!1,0!==Object.keys(c).length?t++:delete n[s][l]}0===t&&delete n[s]}for(var h=0;h<this._textLines.length;h++)o+=this._textLines[h].length;a&&r===o&&(this[e]=i,this.removeStyle(e))},removeStyle:function(e){if(this.styles&&e&&""!==e){var t,i,n,r=this.styles;for(i in r){for(n in t=r[i])delete t[n][e],0===Object.keys(t[n]).length&&delete t[n];0===Object.keys(t).length&&delete r[i]}}},_extendStyles:function(e,t){var i=this.get2DCursorLocation(e);this._getLineStyle(i.lineIndex)||this._setLineStyle(i.lineIndex),this._getStyleDeclaration(i.lineIndex,i.charIndex)||this._setStyleDeclaration(i.lineIndex,i.charIndex,{}),S.util.object.extend(this._getStyleDeclaration(i.lineIndex,i.charIndex),t)},get2DCursorLocation:function(e,t){void 0===e&&(e=this.selectionStart);for(var i=t?this._unwrappedTextLines:this._textLines,n=i.length,r=0;r<n;r++){if(e<=i[r].length)return{lineIndex:r,charIndex:e};e-=i[r].length+this.missingNewlineOffset(r)}return{lineIndex:r-1,charIndex:i[r-1].length<e?i[r-1].length:e}},getSelectionStyles:function(e,t,i){void 0===e&&(e=this.selectionStart||0),void 0===t&&(t=this.selectionEnd||e);for(var n=[],r=e;r<t;r++)n.push(this.getStyleAtPosition(r,i));return n},getStyleAtPosition:function(e,t){var i=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(i.lineIndex,i.charIndex):this._getStyleDeclaration(i.lineIndex,i.charIndex))||{}},setSelectionStyles:function(e,t,i){void 0===t&&(t=this.selectionStart||0),void 0===i&&(i=this.selectionEnd||t);for(var n=t;n<i;n++)this._extendStyles(n,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var i=this.styles&&this.styles[e];return i?i[t]:null},getCompleteStyleDeclaration:function(e,t){for(var i,n=this._getStyleDeclaration(e,t)||{},r={},a=0;a<this._styleProperties.length;a++)r[i=this._styleProperties[a]]=void 0===n[i]?this[i]:n[i];return r},_setStyleDeclaration:function(e,t,i){this.styles[e][t]=i},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]},_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}}),function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf("underline")>-1&&(e.underline=!0),e.textDecoration.indexOf("line-through")>-1&&(e.linethrough=!0),e.textDecoration.indexOf("overline")>-1&&(e.overline=!0),delete e.textDecoration)}S.IText=S.util.createClass(S.Text,S.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper("initialize",e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire("selectionStart",e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire("selectionEnd",e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(e){this.clearContextTop(),this.callSuper("render",e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper("_render",e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,i=this.canvas.viewportTransform;t.save(),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,i=this.height+4;e.clearRect(-t/2,-i/2,t,i)},_getCursorBoundaries:function(e){void 0===e&&(e=this.selectionStart);var t=this._getLeftOffset(),i=this._getTopOffset(),n=this._getCursorBoundariesOffsets(e);return{left:t,top:i,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var t,i,n,r,a=0,o=0,s=this.get2DCursorLocation(e);n=s.charIndex,i=s.lineIndex;for(var l=0;l<i;l++)a+=this.getHeightOfLine(l);t=this._getLineLeftOffset(i);var c=this.__charBounds[i][n];return c&&(o=c.left),0!==this.charSpacing&&n===this._textLines[i].length&&(o-=this._getWidthOfCharSpacing()),r={top:a,left:t+(o>0?o:0)},"rtl"===this.direction&&(r.left*=-1),this.cursorOffsetCache=r,this.cursorOffsetCache},renderCursor:function(e,t){var i=this.get2DCursorLocation(),n=i.lineIndex,r=i.charIndex>0?i.charIndex-1:0,a=this.getValueOfPropertyAt(n,r,"fontSize"),o=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/o,l=e.topOffset,c=this.getValueOfPropertyAt(n,r,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-a*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,r,"fill"),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,l+e.top+c,s,a)},renderSelection:function(e,t){for(var i=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=-1!==this.textAlign.indexOf("justify"),a=this.get2DCursorLocation(i),o=this.get2DCursorLocation(n),s=a.lineIndex,l=o.lineIndex,c=a.charIndex<0?0:a.charIndex,h=o.charIndex<0?0:o.charIndex,u=s;u<=l;u++){var f,d=this._getLineLeftOffset(u)||0,m=this.getHeightOfLine(u),g=0,v=0;if(u===s&&(g=this.__charBounds[s][c].left),u>=s&&u<l)v=r&&!this.isEndOfWrapping(u)?this.width:this.getLineWidth(u)||5;else if(u===l)if(0===h)v=this.__charBounds[l][h].left;else{var p=this._getWidthOfCharSpacing();v=this.__charBounds[l][h-1].left+this.__charBounds[l][h-1].width-p}f=m,(this.lineHeight<1||u===l&&this.lineHeight>1)&&(m/=this.lineHeight);var y=e.left+d+g,b=v-g,w=m,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",w=1,x=m):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),t.fillRect(y,e.top+e.topOffset+x,b,w),e.topOffset+=f}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fontSize")},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fill")},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),S.IText.fromObject=function(t,i){if(e(t),t.styles)for(var n in t.styles)for(var r in t.styles[n])e(t.styles[n][r]);S.Object._fromObject("IText",t,i,"text")}}(),k=S.util.object.clone,S.util.object.extend(S.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",(function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))}))},initRemovedHandler:function(){var e=this;this.on("removed",(function(){var t=e.canvas;t&&(t._iTextInstances=t._iTextInstances||[],S.util.removeFromArray(t._iTextInstances,e),0===t._iTextInstances.length&&(t._hasITextHandlers=!1,e._removeCanvasHandlers(t)))}))},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach((function(e){e.__isMousedown=!1}))},e.on("mouse:up",e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off("mouse:up",e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(e,t,i,n){var r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate("_currentCursorOpacity",t,{duration:i,onComplete:function(){r.isAborted||e[n]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout((function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,"_tick")}),100)},initDelayedCursor:function(e){var t=this,i=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout((function(){t._tick()}),i)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(e){var t=0,i=e-1;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)t++,i--;for(;/\S/.test(this._text[i])&&i>-1;)t++,i--;return e-t},findWordBoundaryRight:function(e){var t=0,i=e;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)t++,i++;for(;/\S/.test(this._text[i])&&i<this._text.length;)t++,i++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,i=e-1;!/\n/.test(this._text[i])&&i>-1;)t++,i--;return e-t},findLineBoundaryRight:function(e){for(var t=0,i=e;!/\n/.test(this._text[i])&&i<this._text.length;)t++,i++;return e+t},searchWordBoundary:function(e,t){for(var i=this._text,n=this._reSpace.test(i[e])?e-1:e,r=i[n],a=S.reNonWord;!a.test(r)&&n>0&&n<i.length;)r=i[n+=t];return a.test(r)&&(n+=1===t?0:1),n},selectWord:function(e){e=e||this.selectionStart;var t=this.searchWordBoundary(e,-1),i=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e=e||this.selectionStart;var t=this.findLineBoundaryLeft(e),i=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(e){e._iTextInstances&&e._iTextInstances.forEach((function(e){e.selected=!1,e.isEditing&&e.exitEditing()}))},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(e){if(this.__isMousedown&&this.isEditing){var t=this.getSelectionStartFromPointer(e.e),i=this.selectionStart,n=this.selectionEnd;(t===this.__selectionStartOnMouseDown&&i!==n||i!==t&&n!==t)&&(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,t,i){var n=i.slice(0,e),r=S.util.string.graphemeSplit(n).length;if(e===t)return{selectionStart:r,selectionEnd:r};var a=i.slice(e,t);return{selectionStart:r,selectionEnd:r+S.util.string.graphemeSplit(a).length}},fromGraphemeToStringSelection:function(e,t,i){var n=i.slice(0,e).join("").length;return e===t?{selectionStart:n,selectionEnd:n}:{selectionStart:n,selectionEnd:n+i.slice(e,t).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,t=this._getCursorBoundaries(e),i=this.get2DCursorLocation(e),n=i.lineIndex,r=i.charIndex,a=this.getValueOfPropertyAt(n,r,"fontSize")*this.lineHeight,o=t.leftOffset,s=this.calcTransformMatrix(),l={x:t.left+o,y:t.top+t.topOffset+a},c=this.canvas.getRetinaScaling(),h=this.canvas.upperCanvasEl,u=h.width/c,f=h.height/c,d=u-a,m=f-a,g=h.clientWidth/u,v=h.clientHeight/f;return l=S.util.transformPoint(l,s),(l=S.util.transformPoint(l,this.canvas.viewportTransform)).x*=g,l.y*=v,l.x<0&&(l.x=0),l.x>d&&(l.x=d),l.y<0&&(l.y=0),l.y>m&&(l.y=m),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+"px",top:l.y+"px",fontSize:a+"px",charHeight:a}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),e&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),e&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var i,n,r=this.get2DCursorLocation(e,!0),a=this.get2DCursorLocation(t,!0),o=r.lineIndex,s=r.charIndex,l=a.lineIndex,c=a.charIndex;if(o!==l){if(this.styles[o])for(i=s;i<this._unwrappedTextLines[o].length;i++)delete this.styles[o][i];if(this.styles[l])for(i=c;i<this._unwrappedTextLines[l].length;i++)(n=this.styles[l][i])&&(this.styles[o]||(this.styles[o]={}),this.styles[o][s+i-c]=n);for(i=o+1;i<=l;i++)delete this.styles[i];this.shiftLineStyles(l,o-l)}else if(this.styles[o]){n=this.styles[o];var h,u,f=c-s;for(i=s;i<c;i++)delete n[i];for(u in this.styles[o])(h=parseInt(u,10))>=c&&(n[h-f]=n[u],delete n[u])}},shiftLineStyles:function(e,t){var i=k(this.styles);for(var n in this.styles){var r=parseInt(n,10);r>e&&(this.styles[r+t]=i[r],i[r-t]||delete this.styles[r])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(e,t,i,n){var r,a={},o=!1,s=this._unwrappedTextLines[e].length===t;for(var l in i||(i=1),this.shiftLineStyles(e,i),this.styles[e]&&(r=this.styles[e][0===t?t:t-1]),this.styles[e]){var c=parseInt(l,10);c>=t&&(o=!0,a[c-t]=this.styles[e][l],s&&0===t||delete this.styles[e][l])}var h=!1;for(o&&!s&&(this.styles[e+i]=a,h=!0),h&&i--;i>0;)n&&n[i-1]?this.styles[e+i]={0:k(n[i-1])}:r?this.styles[e+i]={0:k(r)}:delete this.styles[e+i],i--;this._forceClearCache=!0},insertCharStyleObject:function(e,t,i,n){this.styles||(this.styles={});var r=this.styles[e],a=r?k(r):{};for(var o in i||(i=1),a){var s=parseInt(o,10);s>=t&&(r[s+i]=a[s],a[s-i]||delete r[s])}if(this._forceClearCache=!0,n)for(;i--;)Object.keys(n[i]).length&&(this.styles[e]||(this.styles[e]={}),this.styles[e][t+i]=k(n[i]));else if(r)for(var l=r[t?t-1:1];l&&i--;)this.styles[e][t+i]=k(l)},insertNewStyleBlock:function(e,t,i){for(var n=this.get2DCursorLocation(t,!0),r=[0],a=0,o=0;o<e.length;o++)"\n"===e[o]?r[++a]=0:r[a]++;for(r[0]>0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,r[0],i),i=i&&i.slice(r[0]+1)),a&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+r[0],a),o=1;o<a;o++)r[o]>0?this.insertCharStyleObject(n.lineIndex+o,0,r[o],i):i&&(this.styles[n.lineIndex+o][0]=i[0]),i=i&&i.slice(r[o]+1);r[o]>0&&this.insertCharStyleObject(n.lineIndex+o,0,r[o],i)},setSelectionStartEndWithShift:function(e,t,i){i<=e?(t===e?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=e),this.selectionStart=i):i>e&&i<t?"right"===this._selectionDirection?this.selectionEnd=i:this.selectionStart=i:(t===e?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=t),this.selectionEnd=i)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}}),S.util.object.extend(S.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire("tripleclick",e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&1!==e.e.button)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),i=this.selectionStart,n=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(i,n,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,i=this.getLocalPointer(e),n=0,r=0,a=0,o=0,s=0,l=0,c=this._textLines.length;l<c&&a<=i.y;l++)a+=this.getHeightOfLine(l)*this.scaleY,s=l,l>0&&(o+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));r=this._getLineLeftOffset(s)*this.scaleX,t=this._textLines[s],"rtl"===this.direction&&(i.x=this.width*this.scaleX-i.x+r);for(var h=0,u=t.length;h<u&&(n=r,(r+=this.__charBounds[s][h].kernedWidth*this.scaleX)<=i.x);h++)o++;return this._getNewSelectionStartFromOffset(i,n,r,o,u)},_getNewSelectionStartFromOffset:function(e,t,i,n,r){var a=e.x-t,o=i-e.x,s=n+(o>a||o<0?0:1);return this.flipX&&(s=r-s),s>this._text.length&&(s=this._text.length),s}}),S.util.object.extend(S.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=S.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+e.top+"; left: "+e.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; paddingーtop: "+e.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):S.document.body.appendChild(this.hiddenTextarea),S.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),S.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),S.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),S.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),S.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),S.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),S.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),S.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),S.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(S.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var t=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var i,n,r,a,o,s=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,l=this._text.length,c=s.length,h=c-l,u=this.selectionStart,f=this.selectionEnd,d=u!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var m=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),g=u>m.selectionStart;d?(i=this._text.slice(u,f),h+=f-u):c<l&&(i=g?this._text.slice(f+h,f):this._text.slice(u,u-h)),n=s.slice(m.selectionEnd-h,m.selectionEnd),i&&i.length&&(n.length&&(r=this.getSelectionStyles(u,u+1,!1),r=n.map((function(){return r[0]}))),d?(a=u,o=f):g?(a=f-i.length,o=f):(a=f,o=f+i.length),this.removeStyleFromTo(a,o)),n.length&&(t&&n.join("")===S.copiedText&&!S.disableStyleCopyPaste&&(r=S.copiedTextStyle),this.insertNewStyleBlock(n,u,r)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(S.copiedText=this.getSelectedText(),S.disableStyleCopyPaste?S.copiedTextStyle=null:S.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||S.window.clipboardData},_getWidthBeforeCursor:function(e,t){var i,n=this._getLineLeftOffset(e);return t>0&&(n+=(i=this.__charBounds[e][t-1]).left+i.width),n},getDownCursorOffset:function(e,t){var i=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(i),r=n.lineIndex;if(r===this._textLines.length-1||e.metaKey||34===e.keyCode)return this._text.length-i;var a=n.charIndex,o=this._getWidthBeforeCursor(r,a),s=this._getIndexOnLine(r+1,o);return this._textLines[r].slice(a).length+s+1+this.missingNewlineOffset(r)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var i=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(i),r=n.lineIndex;if(0===r||e.metaKey||33===e.keyCode)return-i;var a=n.charIndex,o=this._getWidthBeforeCursor(r,a),s=this._getIndexOnLine(r-1,o),l=this._textLines[r].slice(0,a),c=this.missingNewlineOffset(r-1);return-this._textLines[r-1].length+s-l.length+(1-c)},_getIndexOnLine:function(e,t){for(var i,n,r=this._textLines[e],a=this._getLineLeftOffset(e),o=0,s=0,l=r.length;s<l;s++)if((a+=i=this.__charBounds[e][s].width)>t){n=!0;var c=a-i,h=a,u=Math.abs(c-t);o=Math.abs(h-t)<u?s:s-1;break}return n||(o=r.length-1),o},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",e)},moveCursorUp:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",e)},_moveCursorUpOrDown:function(e,t){var i=this["get"+e+"CursorOffset"](t,"right"===this._selectionDirection);t.shiftKey?this.moveCursorWithShift(i):this.moveCursorWithoutShift(i),0!==i&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t="left"===this._selectionDirection?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),0!==e},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),0!==e},moveCursorLeft:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",e)},_move:function(e,t,i){var n;if(e.altKey)n=this["findWordBoundary"+i](this[t]);else{if(!e.metaKey&&35!==e.keyCode&&36!==e.keyCode)return this[t]+="Left"===i?-1:1,!0;n=this["findLineBoundary"+i](this[t])}if(void 0!==typeof n&&this[t]!==n)return this[t]=n,!0},_moveLeft:function(e,t){return this._move(e,t,"Left")},_moveRight:function(e,t){return this._move(e,t,"Right")},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(t=this._moveLeft(e,"selectionStart")),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(e,"selectionStart")):void 0},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",e)},_moveCursorLeftOrRight:function(e,t){var i="moveCursor"+e+"With";this._currentCursorOpacity=1,t.shiftKey?i+="Shift":i+="outShift",this[i](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(e,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(e,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(t=this._moveRight(e,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){void 0===t&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,t,i,n){void 0===n&&(n=i),n>i&&this.removeStyleFromTo(i,n);var r=S.util.string.graphemeSplit(e);this.insertNewStyleBlock(r,i,t),this._text=[].concat(this._text.slice(0,i),r,this._text.slice(n)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),C=S.util.toFixed,_=/ +/g,S.util.object.extend(S.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",t?'text-decoration="'+t+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",e.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(e,t){var i,n=[],r=[],a=e;this._setSVGBg(r);for(var o=0,s=this._textLines.length;o<s;o++)i=this._getLineLeftOffset(o),(this.textBackgroundColor||this.styleHas("textBackgroundColor",o))&&this._setSVGTextLineBg(r,o,t+i,a),this._setSVGTextLineText(n,o,t+i,a),a+=this.getHeightOfLine(o);return{textSpans:n,textBgRects:r}},_createTextCharSpan:function(e,t,i,n){var r=e!==e.trim()||e.match(_),a=this.getSvgSpanStyles(t,r),o=a?'style="'+a+'"':"",s=t.deltaY,l="",c=S.Object.NUM_FRACTION_DIGITS;return s&&(l=' dy="'+C(s,c)+'" '),['<tspan x="',C(i,c),'" y="',C(n,c),'" ',l,o,">",S.util.string.escapeXml(e),"</tspan>"].join("")},_setSVGTextLineText:function(e,t,i,n){var r,a,o,s,l,c=this.getHeightOfLine(t),h=-1!==this.textAlign.indexOf("justify"),u="",f=0,d=this._textLines[t];n+=c*(1-this._fontSizeFraction)/this.lineHeight;for(var m=0,g=d.length-1;m<=g;m++)l=m===g||this.charSpacing,u+=d[m],o=this.__charBounds[t][m],0===f?(i+=o.kernedWidth-o.width,f+=o.width):f+=o.kernedWidth,h&&!l&&this._reSpaceAndTab.test(d[m])&&(l=!0),l||(r=r||this.getCompleteStyleDeclaration(t,m),a=this.getCompleteStyleDeclaration(t,m+1),l=this._hasStyleChangedForSvg(r,a)),l&&(s=this._getStyleDeclaration(t,m)||{},e.push(this._createTextCharSpan(u,s,i,n)),u="",r=a,i+=f,f=0)},_pushTextBgRect:function(e,t,i,n,r,a){var o=S.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(t),' x="',C(i,o),'" y="',C(n,o),'" width="',C(r,o),'" height="',C(a,o),'"></rect>\n')},_setSVGTextLineBg:function(e,t,i,n){for(var r,a,o=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,l=0,c=0,h=this.getValueOfPropertyAt(t,0,"textBackgroundColor"),u=0,f=o.length;u<f;u++)r=this.__charBounds[t][u],(a=this.getValueOfPropertyAt(t,u,"textBackgroundColor"))!==h?(h&&this._pushTextBgRect(e,h,i+c,n,l,s),c=r.left,l=r.width,h=a):l+=r.kernedWidth;a&&this._pushTextBgRect(e,a,i+c,n,l,s)},_getFillAttributes:function(e){var t=e&&"string"==typeof e?new S.Color(e):"";return t&&t.getSource()&&1!==t.getAlpha()?'opacity="'+t.getAlpha()+'" fill="'+t.setAlpha(1).toRgb()+'"':'fill="'+e+'"'},_getSVGLineTopOffset:function(e){for(var t,i=0,n=0;n<e;n++)i+=this.getHeightOfLine(n);return t=this.getHeightOfLine(n),{lineTop:i,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return S.Object.prototype.getSvgStyles.call(this,e)+" white-space: pre;"}}),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Textbox=t.util.createClass(t.IText,t.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(e){for(var t=0,i=0,n=0,r={},a=0;a<e.graphemeLines.length;a++)"\n"===e.graphemeText[n]&&a>0?(i=0,n++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[n])&&a>0&&(i++,n++),r[a]={line:t,offset:i},n+=e.graphemeLines[a].length,i+=e.graphemeLines[a].length;return r},styleHas:function(e,i){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[i];n&&(i=n.line)}return t.Text.prototype.styleHas.call(this,e,i)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,i,n=0,r=!1,a=this._styleMap[e],o=this._styleMap[e+1];for(var s in a&&(e=a.line,n=a.offset),o&&(r=o.line===e,t=o.offset),i=void 0===e?this.styles:{line:this.styles[e]})for(var l in i[s])if(l>=n&&(!r||l<t))for(var c in i[s][l])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[e];if(!i)return null;e=i.line,t=i.offset+t}return this.callSuper("_getStyleDeclaration",e,t)},_setStyleDeclaration:function(e,t,i){var n=this._styleMap[e];e=n.line,t=n.offset+t,this.styles[e][t]=i},_deleteStyleDeclaration:function(e,t){var i=this._styleMap[e];e=i.line,t=i.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var i,n=[];for(this.isWrapping=!0,i=0;i<e.length;i++)n=n.concat(this._wrapLine(e[i],i,t));return this.isWrapping=!1,n},_measureWord:function(e,t,i){var n,r=0;i=i||0;for(var a=0,o=e.length;a<o;a++){r+=this._getGraphemeBox(e[a],t,a+i,n,!0).kernedWidth,n=e[a]}return r},_wrapLine:function(e,i,n,r){var a=0,o=this.splitByGrapheme,s=[],l=[],c=o?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),h="",u=0,f=o?"":" ",d=0,m=0,g=0,v=!0,p=this._getWidthOfCharSpacing();r=r||0;0===c.length&&c.push([]),n-=r;for(var y=0;y<c.length;y++)h=o?c[y]:t.util.string.graphemeSplit(c[y]),d=this._measureWord(h,i,u),u+=h.length,(a+=m+d-p)>n&&!v?(s.push(l),l=[],a=d,v=!0):a+=p,v||o||l.push(f),l=l.concat(h),m=o?0:this._measureWord([f],i,u),u++,v=!1,d>g&&(g=d);return y&&s.push(l),g+r>this.dynamicMinWidth&&(this.dynamicMinWidth=g-p+r),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?this.isEndOfWrapping(e)?1:0:1},_splitTextIntoLines:function(e){for(var i=t.Text.prototype._splitTextIntoLines.call(this,e),n=this._wrapText(i.lines,this.width),r=new Array(n.length),a=0;a<n.length;a++)r[a]=n[a].join("");return i.lines=r,i.graphemeLines=n,i},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(e))}}),t.Textbox.fromObject=function(e,i){return t.Object._fromObject("Textbox",e,i,"text")}}(t),function(){var e=S.controlsUtils,t=e.scaleSkewCursorStyleHandler,i=e.scaleCursorStyleHandler,n=e.scalingEqually,r=e.scalingYOrSkewingX,a=e.scalingXOrSkewingY,o=e.scaleOrSkewActionName,s=S.Object.prototype.controls;if(s.ml=new S.Control({x:-.5,y:0,cursorStyleHandler:t,actionHandler:a,getActionName:o}),s.mr=new S.Control({x:.5,y:0,cursorStyleHandler:t,actionHandler:a,getActionName:o}),s.mb=new S.Control({x:0,y:.5,cursorStyleHandler:t,actionHandler:r,getActionName:o}),s.mt=new S.Control({x:0,y:-.5,cursorStyleHandler:t,actionHandler:r,getActionName:o}),s.tl=new S.Control({x:-.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),s.tr=new S.Control({x:.5,y:-.5,cursorStyleHandler:i,actionHandler:n}),s.bl=new S.Control({x:-.5,y:.5,cursorStyleHandler:i,actionHandler:n}),s.br=new S.Control({x:.5,y:.5,cursorStyleHandler:i,actionHandler:n}),s.mtr=new S.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),S.Textbox){var l=S.Textbox.prototype.controls={};l.mtr=s.mtr,l.tr=s.tr,l.br=s.br,l.tl=s.tl,l.bl=s.bl,l.mt=s.mt,l.mb=s.mb,l.mr=new S.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"}),l.ml=new S.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"})}}()}).call(this,i(27).Buffer)},function(e,t,i){e.exports=i(25)},function(e,t){function i(e,t,i,n,r,a,o){try{var s=e[a](o),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,r)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(16),r=i(19),a=i(14),o=i(18);e.exports=function(e){return n(e)||r(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(17);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=i=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),i(t)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){},function(e,t){e.exports=function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,a=[],o=!0,s=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(s)throw r}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=i(17);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function i(t,n){return e.exports=i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,i(t,n)}e.exports=i,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){var n=function(e){"use strict";var t=Object.prototype,i=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,i){return e[t]=i}}function l(e,t,i,n){var r=t&&t.prototype instanceof u?t:u,a=Object.create(r.prototype),o=new C(n||[]);return a._invoke=function(e,t,i){var n="suspendedStart";return function(r,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return S()}for(i.method=r,i.arg=a;;){var o=i.delegate;if(o){var s=w(o,i);if(s){if(s===h)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=c(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}(e,i,o),a}function c(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h={};function u(){}function f(){}function d(){}var m={};s(m,r,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(_([])));v&&v!==t&&i.call(v,r)&&(m=v);var p=d.prototype=u.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var n;this._invoke=function(r,a){function o(){return new t((function(n,o){!function n(r,a,o,s){var l=c(e[r],e,a);if("throw"!==l.type){var h=l.arg,u=h.value;return u&&"object"==typeof u&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(u).then((function(e){h.value=e,o(h)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}(r,a,n,o)}))}return n=n?n.then(o,o):o()}}function w(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=c(i,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var r=n.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function _(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=d,s(p,"constructor",d),s(d,"constructor",f),f.displayName=s(d,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,i,n,r,a){void 0===a&&(a=Promise);var o=new b(l(t,i,n,r),a);return e.isGeneratorFunction(i)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},y(p),s(p,o,"Generator"),s(p,r,(function(){return this})),s(p,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){for(;t.length;){var n=t.pop();if(n in e)return i.value=n,i.done=!1,i}return i.done=!0,i}},e.values=_,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(i,n){return o.type="throw",o.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),k(i),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;k(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:_(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),h}},e}(e.exports);try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t,i){var n=i(1);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,i){"use strict";(function(e){
|
|
4
4
|
/*!
|
|
5
5
|
* The buffer module from node.js, for the browser.
|
|
6
6
|
*
|
|
7
7
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
8
8
|
* @license MIT
|
|
9
9
|
*/
|
|
10
|
-
var n=i(29),r=i(30),a=i(31);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return c(this,e,t,i)}function c(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=f(e,t);return e}(e,t,i,n):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(t,i),r=(e=s(e,n)).write(t,i);r!==n&&(e=e.slice(0,r));return e}(e,t,i):function(e,t){if(l.isBuffer(t)){var i=0|d(t.length);return 0===(e=s(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t){if(h(t),e=s(e,t<0?0:0|d(t)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function f(e,t){var i=t.length<0?0:0|d(t.length);e=s(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return N(e).length;default:if(n)return H(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,i);case"utf8":case"utf-8":return T(this,t,i);case"ascii":return O(this,t,i);case"latin1":case"binary":return E(this,t,i);case"base64":return _(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function p(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:y(e,t,i,n,r);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):y(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function y(e,t,i,n,r){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var h=-1;for(a=i;a<s;a++)if(c(e,a)===c(t,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===l)return h*o}else-1!==h&&(a-=a-h),h=-1}else for(i+l>s&&(i=s-l),a=i;a>=0;a--){for(var u=!0,f=0;f<l;f++)if(c(e,a+f)!==c(t,f)){u=!1;break}if(u)return a}return-1}function b(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[i+o]=s}return o}function w(e,t,i,n){return U(H(t,e.length-i),e,i,n)}function x(e,t,i,n){return U(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function k(e,t,i,n){return x(e,t,i,n)}function C(e,t,i,n){return U(N(t),e,i,n)}function S(e,t,i,n){return U(function(e,t){for(var i,n,r,a=[],o=0;o<e.length&&!((t-=2)<0);++o)i=e.charCodeAt(o),n=i>>8,r=i%256,a.push(r),a.push(n);return a}(t,e.length-i),e,i,n)}function _(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function T(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var a,o,s,l,c=e[r],h=null,u=c>239?4:c>223?3:c>191?2:1;if(r+u<=i)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(a=e[r+1]))&&(l=(31&c)<<6|63&a)>127&&(h=l);break;case 3:a=e[r+1],o=e[r+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:a=e[r+1],o=e[r+2],s=e[r+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=u}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return i}(n)}t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,i){return c(null,e,t,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,i){return function(e,t,i,n){return h(t),t<=0?s(e,t):void 0!==i?"string"==typeof n?s(e,t).fill(i,n):s(e,t).fill(i):s(e,t)}(null,e,t,i)},l.allocUnsafe=function(e){return u(null,e)},l.allocUnsafeSlow=function(e){return u(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,a=Math.min(i,n);r<a;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=l.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):g.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,i,n,r){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var a=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,r),h=e.slice(t,i),u=0;u<s;++u)if(c[u]!==h[u]){a=c[u],o=h[u];break}return a<o?-1:o<a?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return p(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return p(this,e,t,i,!1)},l.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,i);case"utf8":case"utf-8":return w(this,e,t,i);case"ascii":return x(this,e,t,i);case"latin1":case"binary":return k(this,e,t,i);case"base64":return C(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}function E(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}function R(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",a=t;a<i;++a)r+=B(e[a]);return r}function I(e,t,i){for(var n=e.slice(t,i),r="",a=0;a<n.length;a+=2)r+=String.fromCharCode(n[a]+256*n[a+1]);return r}function A(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,i,n,r,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<a)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function P(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,a=Math.min(e.length-i,2);r<a;++r)e[i+r]=(t&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function F(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,a=Math.min(e.length-i,4);r<a;++r)e[i+r]=t>>>8*(n?r:3-r)&255}function M(e,t,i,n,r,a){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function L(e,t,i,n,a){return a||M(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function j(e,t,i,n,a){return a||M(e,0,i,8),r.write(e,t,i,n,52,8),i+8}l.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=l.prototype;else{var r=t-e;i=new l(r,void 0);for(var a=0;a<r;++a)i[a]=this[a+e]}return i},l.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e],r=1,a=0;++a<t&&(r*=256);)n+=this[e+a]*r;return n},l.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},l.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e],r=1,a=0;++a<t&&(r*=256);)n+=this[e+a]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=t,r=1,a=this[e+--n];n>0&&(r*=256);)a+=this[e+--n]*r;return a>=(r*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,n){(e=+e,t|=0,i|=0,n)||D(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,a=0;for(this[t]=255&e;++a<i&&(r*=256);)this[t+a]=e/r&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,n){(e=+e,t|=0,i|=0,n)||D(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,a=1;for(this[t+r]=255&e;--r>=0&&(a*=256);)this[t+r]=e/a&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);D(this,e,t,i,r-1,-r)}var a=0,o=1,s=0;for(this[t]=255&e;++a<i&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);D(this,e,t,i,r-1,-r)}var a=i-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return L(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return L(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return j(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return j(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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),e.length-t<n-i&&(n=e.length-t+i);var r,a=n-i;if(this===e&&i<t&&t<n)for(r=a-1;r>=0;--r)e[r+t]=this[r+i];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<a;++r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},l.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a<i;++a)this[a]=e;else{var o=l.isBuffer(e)?e:H(new l(e,n).toString()),s=o.length;for(a=0;a<i-t;++a)this[a+t]=o[a%s]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){var i;t=t||1/0;for(var n=e.length,r=null,a=[],o=0;o<n;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function N(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}}).call(this,i(28))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){"use strict";t.byteLength=function(e){var t=c(e),i=t[0],n=t[1];return 3*(i+n)/4-n},t.toByteArray=function(e){var t,i,n=c(e),o=n[0],s=n[1],l=new a(function(e,t,i){return 3*(t+i)/4-i}(0,o,s)),h=0,u=s>0?o-4:o;for(i=0;i<u;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;2===s&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,l[h++]=255&t);1===s&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t);return l},t.fromByteArray=function(e){for(var t,i=e.length,r=i%3,a=[],o=0,s=i-r;o<s;o+=16383)a.push(h(e,o,o+16383>s?s:o+16383));1===r?(t=e[i-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],r=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function h(e,t,i){for(var r,a,o=[],s=t;s<i;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(a=r)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(e,t){
|
|
10
|
+
var n=i(29),r=i(30),a=i(31);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return c(this,e,t,i)}function c(e,t,i,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=f(e,t);return e}(e,t,i,n):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(t,i),r=(e=s(e,n)).write(t,i);r!==n&&(e=e.slice(0,r));return e}(e,t,i):function(e,t){if(l.isBuffer(t)){var i=0|d(t.length);return 0===(e=s(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t){if(h(t),e=s(e,t<0?0:0|d(t)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function f(e,t){var i=t.length<0?0:0|d(t.length);e=s(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return N(e).length;default:if(n)return H(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,i);case"utf8":case"utf-8":return T(this,t,i);case"ascii":return O(this,t,i);case"latin1":case"binary":return E(this,t,i);case"base64":return S(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function p(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:y(e,t,i,n,r);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):y(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function y(e,t,i,n,r){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,i/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var h=-1;for(a=i;a<s;a++)if(c(e,a)===c(t,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===l)return h*o}else-1!==h&&(a-=a-h),h=-1}else for(i+l>s&&(i=s-l),a=i;a>=0;a--){for(var u=!0,f=0;f<l;f++)if(c(e,a+f)!==c(t,f)){u=!1;break}if(u)return a}return-1}function b(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[i+o]=s}return o}function w(e,t,i,n){return U(H(t,e.length-i),e,i,n)}function x(e,t,i,n){return U(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function k(e,t,i,n){return x(e,t,i,n)}function C(e,t,i,n){return U(N(t),e,i,n)}function _(e,t,i,n){return U(function(e,t){for(var i,n,r,a=[],o=0;o<e.length&&!((t-=2)<0);++o)i=e.charCodeAt(o),n=i>>8,r=i%256,a.push(r),a.push(n);return a}(t,e.length-i),e,i,n)}function S(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function T(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var a,o,s,l,c=e[r],h=null,u=c>239?4:c>223?3:c>191?2:1;if(r+u<=i)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(a=e[r+1]))&&(l=(31&c)<<6|63&a)>127&&(h=l);break;case 3:a=e[r+1],o=e[r+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:a=e[r+1],o=e[r+2],s=e[r+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=u}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return i}(n)}t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,i){return c(null,e,t,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,i){return function(e,t,i,n){return h(t),t<=0?s(e,t):void 0!==i?"string"==typeof n?s(e,t).fill(i,n):s(e,t).fill(i):s(e,t)}(null,e,t,i)},l.allocUnsafe=function(e){return u(null,e)},l.allocUnsafeSlow=function(e){return u(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,a=Math.min(i,n);r<a;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=l.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):g.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,i,n,r){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var a=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(n,r),h=e.slice(t,i),u=0;u<s;++u)if(c[u]!==h[u]){a=c[u],o=h[u];break}return a<o?-1:o<a?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return p(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return p(this,e,t,i,!1)},l.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,i);case"utf8":case"utf-8":return w(this,e,t,i);case"ascii":return x(this,e,t,i);case"latin1":case"binary":return k(this,e,t,i);case"base64":return C(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}function E(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}function R(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",a=t;a<i;++a)r+=B(e[a]);return r}function I(e,t,i){for(var n=e.slice(t,i),r="",a=0;a<n.length;a+=2)r+=String.fromCharCode(n[a]+256*n[a+1]);return r}function A(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,i,n,r,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<a)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function P(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,a=Math.min(e.length-i,2);r<a;++r)e[i+r]=(t&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function F(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,a=Math.min(e.length-i,4);r<a;++r)e[i+r]=t>>>8*(n?r:3-r)&255}function M(e,t,i,n,r,a){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function L(e,t,i,n,a){return a||M(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function j(e,t,i,n,a){return a||M(e,0,i,8),r.write(e,t,i,n,52,8),i+8}l.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=l.prototype;else{var r=t-e;i=new l(r,void 0);for(var a=0;a<r;++a)i[a]=this[a+e]}return i},l.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e],r=1,a=0;++a<t&&(r*=256);)n+=this[e+a]*r;return n},l.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},l.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=this[e],r=1,a=0;++a<t&&(r*=256);)n+=this[e+a]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||A(e,t,this.length);for(var n=t,r=1,a=this[e+--n];n>0&&(r*=256);)a+=this[e+--n]*r;return a>=(r*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,n){(e=+e,t|=0,i|=0,n)||D(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,a=0;for(this[t]=255&e;++a<i&&(r*=256);)this[t+a]=e/r&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,n){(e=+e,t|=0,i|=0,n)||D(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,a=1;for(this[t+r]=255&e;--r>=0&&(a*=256);)this[t+r]=e/a&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);D(this,e,t,i,r-1,-r)}var a=0,o=1,s=0;for(this[t]=255&e;++a<i&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);D(this,e,t,i,r-1,-r)}var a=i-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return L(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return L(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return j(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return j(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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),e.length-t<n-i&&(n=e.length-t+i);var r,a=n-i;if(this===e&&i<t&&t<n)for(r=a-1;r>=0;--r)e[r+t]=this[r+i];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<a;++r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},l.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a<i;++a)this[a]=e;else{var o=l.isBuffer(e)?e:H(new l(e,n).toString()),s=o.length;for(a=0;a<i-t;++a)this[a+t]=o[a%s]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){var i;t=t||1/0;for(var n=e.length,r=null,a=[],o=0;o<n;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function N(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}}).call(this,i(28))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){"use strict";t.byteLength=function(e){var t=c(e),i=t[0],n=t[1];return 3*(i+n)/4-n},t.toByteArray=function(e){var t,i,n=c(e),o=n[0],s=n[1],l=new a(function(e,t,i){return 3*(t+i)/4-i}(0,o,s)),h=0,u=s>0?o-4:o;for(i=0;i<u;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;2===s&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,l[h++]=255&t);1===s&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t);return l},t.fromByteArray=function(e){for(var t,i=e.length,r=i%3,a=[],o=0,s=i-r;o<s;o+=16383)a.push(h(e,o,o+16383>s?s:o+16383));1===r?(t=e[i-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],r=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s<l;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function h(e,t,i){for(var r,a,o=[],s=t;s<i;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(a=r)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(e,t){
|
|
11
11
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
12
|
-
t.read=function(e,t,i,n,r){var a,o,s=8*r-n-1,l=(1<<s)-1,c=l>>1,h=-7,u=i?r-1:0,f=i?-1:1,d=e[t+u];for(u+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+u],u+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=n;h>0;o=256*o+e[t+u],u+=f,h-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,i,n,r,a){var o,s,l,c=8*a-r-1,h=(1<<c)-1,u=h>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,m=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?f/l:f*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(s=0,o=h):o+u>=1?(s=(t*l-1)*Math.pow(2,r),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;e[i+d]=255&s,d+=m,s/=256,r-=8);for(o=o<<r|s,c+=r;c>0;e[i+d]=255&o,d+=m,o/=256,c-=8);e[i+d-m]|=128*g}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t){},function(e,t){},function(e,t){},function(e,t,i){},function(e,t,i){"use strict";(function(e){var t=i(13),n=i.n(t);!function(){function t(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function i(e,i){var n=function(e,i){var n=t(e)*t(i);if(0===n)return 0;var r=function(e,t){return e.x*t.x+e.y*t.y}(e,i)/n;return r>1&&(r=1),Math.acos(r)}(e,i);return function(e,t){return e.x*t.y-t.x*e.y}(e,i)>0&&(n*=-1),180*n/Math.PI}var r=function(e){this.handlers=[],this.el=e};function a(e,t){var i=new r(e);return i.add(t),i}r.prototype.add=function(e){this.handlers.push(e)},r.prototype.del=function(e){e||(this.handlers=[]);for(var t=this.handlers.length;t>=0;t--)this.handlers[t]===e&&this.handlers.splice(t,1)},r.prototype.dispatch=function(){for(var e=0,t=this.handlers.length;e<t;e++){var i=this.handlers[e];"function"==typeof i&&i.apply(this.el,arguments)}};var o=function(e,t){this.element="string"==typeof e?document.querySelector(e):e,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var i=function(){};this.rotate=a(this.element,t.rotate||i),this.touchStart=a(this.element,t.touchStart||i),this.multipointStart=a(this.element,t.multipointStart||i),this.multipointEnd=a(this.element,t.multipointEnd||i),this.pinch=a(this.element,t.pinch||i),this.swipe=a(this.element,t.swipe||i),this.tap=a(this.element,t.tap||i),this.doubleTap=a(this.element,t.doubleTap||i),this.longTap=a(this.element,t.longTap||i),this.singleTap=a(this.element,t.singleTap||i),this.pressMove=a(this.element,t.pressMove||i),this.twoFingerPressMove=a(this.element,t.twoFingerPressMove||i),this.touchMove=a(this.element,t.touchMove||i),this.touchEnd=a(this.element,t.touchEnd||i),this.touchCancel=a(this.element,t.touchCancel||i),this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}};o.prototype={start:function(e){if(e.touches){this.now=Date.now(),this.x1=e.touches[0].pageX,this.y1=e.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(e,this.element),null!==this.preTapPosition.x&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var i=this.preV;if(e.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var n={x:e.touches[1].pageX-this.x1,y:e.touches[1].pageY-this.y1};i.x=n.x,i.y=n.y,this.pinchStartLen=t(i),this.multipointStart.dispatch(e,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout(function(){this._inZoom||(this.longTap.dispatch(e,this.element),this._preventTap=!0)}.bind(this),750)}},move:function(e){if(e.touches){var n=this.preV,r=e.touches.length,a=e.touches[0].pageX,o=e.touches[0].pageY;if(this.isDoubleTap=!1,r>1){var s=e.touches[1].pageX,l=e.touches[1].pageY,c={x:e.touches[1].pageX-a,y:e.touches[1].pageY-o};null!==n.x&&(this.pinchStartLen>0&&(e.zoom=t(c)/this.pinchStartLen,this.pinch.dispatch(e,this.element),this._preventTap=!0,this._inZoom=!0),e.angle=i(c,n),this.rotate.dispatch(e,this.element)),n.x=c.x,n.y=c.y,null!==this.x2&&null!==this.sx2?(e.deltaX=(a-this.x2+s-this.sx2)/2,e.deltaY=(o-this.y2+l-this.sy2)/2):(e.deltaX=0,e.deltaY=0),this.twoFingerPressMove.dispatch(e,this.element),this.sx2=s,this.sy2=l}else{if(null!==this.x2){e.deltaX=a-this.x2,e.deltaY=o-this.y2;var h=Math.abs(this.x1-this.x2),u=Math.abs(this.y1-this.y2);(h>10||u>10)&&(this._preventTap=!0)}else e.deltaX=0,e.deltaY=0;this.pressMove.dispatch(e,this.element)}this.touchMove.dispatch(e,this.element),this._cancelLongTap(),this.x2=a,this.y2=o,r>1&&e.preventDefault()}},end:function(e){if(e.changedTouches){this._cancelLongTap();var t=this;e.touches.length<2&&(this.multipointEnd.dispatch(e,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(e.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){t.swipe.dispatch(e,t.element)}),0)):(this.tapTimeout=setTimeout((function(){t._preventTap||t.tap.dispatch(e,t.element),t.isDoubleTap&&(t.doubleTap.dispatch(e,t.element),t.isDoubleTap=!1)}),0),t.isDoubleTap||t._preventTap||(t.singleTapTimeout=setTimeout((function(){t.singleTap.dispatch(e,t.element)}),250))),this.touchEnd.dispatch(e,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}},cancelAll:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)},cancel:function(e){this.cancelAll(),this.touchCancel.dispatch(e,this.element)},_cancelLongTap:function(){clearTimeout(this.longTapTimeout)},_cancelSingleTap:function(){clearTimeout(this.singleTapTimeout)},_swipeDirection:function(e,t,i,n){return Math.abs(e-t)>=Math.abs(i-n)?e-t>0?"Left":"Right":i-n>0?"Up":"Down"},on:function(e,t){this[e]&&this[e].add(t)},off:function(e,t){this[e]&&this[e].del(t)},destroy:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}},"object"===("undefined"==typeof exports?"undefined":n()(exports))?e.exports=o:window.AlloyFinger=o}()}).call(this,i(37)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,i){"use strict";i.r(t),i.d(t,"spreadsheet",(function(){return cs}));var n=i(5),r=i.n(n),a=i(2),o=i.n(a),s=i(0),l=i.n(s),c=i(14),h=i.n(c),u=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l()(this,e),"string"==typeof t?(this.el=document.createElement(t),this.el.className=i):this.el=t,this.data={}}return o()(e,[{key:"data",value:function(e,t){return void 0!==t?(this.data[e]=t,this):this.data[e]}},{key:"on",value:function(e,t){var i=e.split("."),n=h()(i),r=n[0],a=n.slice(1),o=r;return"mousewheel"===o&&/Firefox/i.test(window.navigator.userAgent)&&(o="DOMMouseScroll"),this.el.addEventListener(o,(function(e){t(e);for(var i=0;i<a.length;i+=1){var n=a[i];if("left"===n&&0!==e.button)return;if("right"===n&&2!==e.button)return;"stop"===n&&e.stopPropagation()}})),this}},{key:"offset",value:function(e){var t=this;if(void 0!==e)return Object.keys(e).forEach((function(i){t.css(i,"".concat(e[i],"px"))})),this;var i=this.el;return{top:i.offsetTop,left:i.offsetLeft,height:i.offsetHeight,width:i.offsetWidth}}},{key:"scroll",value:function(e){var t=this.el;return void 0!==e&&(void 0!==e.left&&(t.scrollLeft=e.left),void 0!==e.top&&(t.scrollTop=e.top)),{left:t.scrollLeft,top:t.scrollTop}}},{key:"box",value:function(){return this.el.getBoundingClientRect()}},{key:"parent",value:function(){return new e(this.el.parentNode)}},{key:"children",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return 0===arguments.length?this.el.childNodes:(i.forEach((function(t){return e.child(t)})),this)}},{key:"removeChild",value:function(e){this.el.removeChild(e)}},{key:"empty",value:function(){this.el.innerHTML=""}},{key:"child",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;return"string"==typeof t?n=document.createTextNode(t):t instanceof e&&(n=t.el),i?this.el.prepend(n):this.el.appendChild(n),this}},{key:"contains",value:function(e){return this.el.contains(e)}},{key:"className",value:function(e){return void 0!==e?(this.el.className=e,this):this.el.className}},{key:"addClass",value:function(e){return this.el.classList.add(e),this}},{key:"hasClass",value:function(e){return this.el.classList.contains(e)}},{key:"removeClass",value:function(e){return this.el&&this.el.classList.remove(e),this}},{key:"toggle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"active";return this.toggleClass(e)}},{key:"toggleClass",value:function(e){return this.el.classList.toggle(e)}},{key:"active",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"active";return e?this.addClass(t):this.removeClass(t),this}},{key:"checked",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.active(e,"checked"),this}},{key:"disabled",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e?this.addClass("disabled"):this.removeClass("disabled"),this}},{key:"attr",value:function(e,t){var i=this;if(void 0!==t)this.el.setAttribute(e,t);else{if("string"==typeof e)return this.el.getAttribute(e);Object.keys(e).forEach((function(t){i.el.setAttribute(t,e[t])}))}return this}},{key:"removeAttr",value:function(e){return this.el.removeAttribute(e),this}},{key:"sanitizeHTML",value:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML}},{key:"html",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return void 0!==e?(this.el.innerHTML=t?i?this.sanitizeHTML(e).replace(/\n/g,"<br>"):this.sanitizeHTML(e):e,this):this.el.innerHTML}},{key:"val",value:function(e){return void 0!==e?(this.el.value=e,this):this.el.value}},{key:"focus",value:function(){this.el.focus()}},{key:"cssRemoveKeys",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){return e.el.style.removeProperty(t)})),this}},{key:"css",value:function(e,t){var i=this;return void 0===t&&"string"!=typeof e?(Object.keys(e).forEach((function(t){i.el.style[t]=e[t]})),this):void 0!==t?(this.el.style[e]=t,this):this.el.style[e]}},{key:"computedStyle",value:function(){return window.getComputedStyle(this.el,null)}},{key:"show",value:function(){return this.css("display","block"),this}},{key:"hide",value:function(){return this.css("display","none"),this}}]),e}(),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new u(e,t)},d=i(6),m=i.n(d),g=(i(20),["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]);function v(e){for(var t="",i=e;i>=g.length;)i/=g.length,i-=1,t+=g[parseInt(i,10)%g.length];return t+=g[e%g.length]}function p(e){for(var t=0,i=0;i<e.length-1;i+=1){var n=e.charCodeAt(i)-65,r=e.length-1-i;t+=Math.pow(g.length,r)+g.length*n}return t+=e.charCodeAt(e.length-1)-65}function y(e){for(var t="",i="",n=0;n<e.length;n+=1)e.charAt(n)>="0"&&e.charAt(n)<="9"?i+=e.charAt(n):t+=e.charAt(n);return[p(t),parseInt(i,10)-1]}function b(e,t){return"".concat(v(e)).concat(t+1)}function w(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(0===t&&0===i)return e;var a=y(e),o=r()(a,2),s=o[0],l=o[1];return n(s,l)?b(s+t,l+i):e}var x=function(){function e(t,i,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;l()(this,e),this.sri=t,this.sci=i,this.eri=n,this.eci=r,this.w=a,this.h=o}return o()(e,[{key:"set",value:function(e,t,i,n){this.sri=e,this.sci=t,this.eri=i,this.eci=n}},{key:"setToOther",value:function(e){this.sri=e.sri,this.sci=e.sci,this.eri=e.eri,this.eci=e.eci}},{key:"multiple",value:function(){return this.eri-this.sri>0||this.eci-this.sci>0}},{key:"includes",value:function(){for(var e=0,t=0,i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];if(1===n.length){var o=y(n[0]),s=r()(o,2);t=s[0],e=s[1]}else 2===n.length&&(e=n[0],t=n[1]);var l=this.sri,c=this.sci,h=this.eri,u=this.eci;return l<=e&&e<=h&&c<=t&&t<=u}},{key:"each",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=this.sri,n=this.sci,r=this.eri,a=this.eci,o=i;o<=r;o+=1)if(t(o))for(var s=n;s<=a;s+=1)e(o,s)}},{key:"emptyFirst",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},n=this.sri,r=this.sci,a=this.eri,o=this.eci,s=n;s<=a;s+=1)if(t(s)){for(var l=[],c=[],h=r;h<=o;h+=1)i(s,h)?l.push(h):c.push(h);for(var u=0;u<l.length;u++)e(s,l[u]);for(var f=0;f<c.length;f++)e(s,c[f])}}},{key:"contains",value:function(e){return this.sri<=e.sri&&this.sci<=e.sci&&this.eri>=e.eri&&this.eci>=e.eci}},{key:"within",value:function(e){return this.sri>=e.sri&&this.sci>=e.sci&&this.eri<=e.eri&&this.eci<=e.eci}},{key:"disjoint",value:function(e){return this.sri>e.eri||this.sci>e.eci||e.sri>this.eri||e.sci>this.eci}},{key:"intersects",value:function(e){return this.sri<=e.eri&&this.sci<=e.eci&&e.sri<=this.eri&&e.sci<=this.eci}},{key:"union",value:function(t){var i=this.sri,n=this.sci,r=this.eri,a=this.eci;return new e(t.sri<i?t.sri:i,t.sci<n?t.sci:n,t.eri>r?t.eri:r,t.eci>a?t.eci:a)}},{key:"extendRange",value:function(t){var i=this.sri,n=this.sci,r=this.eri,a=this.eci,o=t.eri-t.sri+1,s=t.eci-t.sci+1,l=r-i+1,c=a-n+1;return new e(i,n,i+(l<o?o:l-l%o)-1,n+(c<s?s:c-c%s)-1)}},{key:"difference",value:function(t){var i=[],n=function(t,n,r,a){i.push(new e(t,n,r,a))},r=this.sri,a=this.sci,o=this.eri,s=this.eci,l=t.sri-r,c=t.sci-a,h=o-t.eri,u=s-t.eci;return this.intersects(t)?l>0?(n(r,a,t.sri-1,s),h>0?(n(t.eri+1,a,o,s),c>0?(n(t.sri,a,t.eri,t.sci-1),u>0&&n(t.sri,t.eci+1,t.eri,s)):u>0&&n(t.sri,t.eci+1,t.eri,s)):c>0?(n(t.sri,a,o,t.sci-1),u>0&&n(t.sri,t.eci+1,o,s)):u>0&&n(t.sri,t.eci+1,o,s)):h>0?(n(t.eri+1,a,o,s),c>0?(n(r,a,t.eri,t.sci-1),u>0&&n(r,t.eci+1,t.eri,s)):u>0&&n(r,t.eci+1,t.eri,s)):c>0?(n(r,a,o,t.sci-1),u>0&&n(r,t.eci+1,o,s)):u>0&&n(r,t.eci+1,o,s):n(r,a,o,s),i}},{key:"size",value:function(){return[this.eri-this.sri+1,this.eci-this.sci+1]}},{key:"toString",value:function(){var e=this.sri,t=this.sci,i=this.eri,n=this.eci,r=b(t,e);return this.multiple()&&(r="".concat(r,":").concat(b(n,i))),r}},{key:"clone",value:function(){return new e(this.sri,this.sci,this.eri,this.eci,this.w,this.h)}},{key:"equals",value:function(e){return this.eri===e.eri&&this.eci===e.eci&&this.sri===e.sri&&this.sci===e.sci}}],[{key:"valueOf",value:function(t){var i=t.split(":"),n=y(i[0]),a=r()(n,2),o=a[0],s=a[1],l=s,c=o;if(i.length>1){var h=y(i[1]),u=r()(h,2);c=u[0],l=u[1]}return new e(s,o,l,c)}}]),e}(),k=x,C=function(){function e(){l()(this,e),this.range=new x(0,0,0,0),this.ri=0,this.ci=0}return o()(e,[{key:"multiple",value:function(){return this.range.multiple()}},{key:"setIndexes",value:function(e,t){this.ri=e,this.ci=t}},{key:"size",value:function(){return this.range.size()}}]),e}(),S=function e(){l()(this,e),this.x=0,this.y=0,this.ri=0,this.ci=0,this.riact=0},_=function(){function e(){l()(this,e),this.undoItems=[],this.redoItems=[]}return o()(e,[{key:"add",value:function(e){this.undoItems.push(JSON.stringify(e)),this.redoItems=[]}},{key:"canUndo",value:function(){return this.undoItems.length>0}},{key:"canRedo",value:function(){return this.redoItems.length>0}},{key:"undo",value:function(e,t){var i=this.undoItems,n=this.redoItems;if(this.canUndo()){var r=JSON.parse(i.pop());n.push(JSON.stringify(e(r))),t(r)}}},{key:"redo",value:function(e,t){var i=this.undoItems,n=this.redoItems;if(this.canRedo()){var r=JSON.parse(n.pop());i.push(JSON.stringify(e(r))),t(r)}}}]),e}(),T=function(){function e(){l()(this,e),this.range=null,this.state="clear",this.textdata=null}return o()(e,[{key:"copy",value:function(e,t){this.range=e,this.state="copy";for(var i=e.sri,n=e.sci,r=e.eri,a=e.eci,o="",s=i;s<=r;s+=1){if(t._[s])for(var l=n;l<=a;l+=1){if(t._[s].cells&&t._[s].cells[l]){var c=t._[s].cells[l].text;c&&(c.indexOf("\n")>=0&&(c='"'+c+'"'),o+=c)}o+="\t"}o+="\n"}return this.setData(o),this}},{key:"cut",value:function(e){return this.range=e,this.state="cut",this}},{key:"isCopy",value:function(){return"copy"===this.state}},{key:"isCut",value:function(){return"cut"===this.state}},{key:"isClear",value:function(){return"clear"===this.state}},{key:"clear",value:function(){this.range=null,this.state="clear"}},{key:"setData",value:function(e){this.textdata=e,this.copyTextToClipboard(e)}},{key:"fallbackCopyTextToClipboard",value:function(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){}document.body.removeChild(t)}},{key:"copyTextToClipboard",value:function(e){navigator.clipboard?navigator.clipboard.writeText(e).then((function(){}),(function(e){})):this.fallbackCopyTextToClipboard(e)}}]),e}(),O=function(){function e(t,i,n){l()(this,e),this.ci=t,this.operator=i,this.value=n}return o()(e,[{key:"set",value:function(e,t){this.operator=e,this.value=t}},{key:"includes",value:function(e){var t=this.operator,i=this.value;return"all"===t||"in"===t&&i.includes(e)}},{key:"vlength",value:function(){var e=this.operator,t=this.value;return"in"===e?t.length:0}},{key:"getData",value:function(){return{ci:this.ci,operator:this.operator,value:this.value}}}]),e}(),E=function(){function e(t,i){l()(this,e),this.ci=t,this.order=i}return o()(e,[{key:"asc",value:function(){return"asc"===this.order}},{key:"desc",value:function(){return"desc"===this.order}}]),e}(),R=function(){function e(){l()(this,e),this.ref=null,this.filters=[],this.sort=null}return o()(e,[{key:"setData",value:function(e){var t=e.ref,i=e.filters,n=e.sort;null!=t&&(this.ref=t,this.filters=i.map((function(e){return new O(e.ci,e.operator,e.value)})),n&&(this.sort=new E(n.ci,n.order)))}},{key:"getData",value:function(){if(this.active()){var e=this.ref,t=this.filters,i=this.sort;return{ref:e,filters:t.map((function(e){return e.getData()})),sort:i}}return{}}},{key:"addFilter",value:function(e,t,i){var n=this.getFilter(e);null==n?this.filters.push(new O(e,t,i)):n.set(t,i)}},{key:"setSort",value:function(e,t){this.sort=t?new E(e,t):null}},{key:"includes",value:function(e,t){return!!this.active()&&this.hrange().includes(e,t)}},{key:"getSort",value:function(e){var t=this.sort;return t&&t.ci===e?t:null}},{key:"getFilter",value:function(e){for(var t=this.filters,i=0;i<t.length;i+=1)if(t[i].ci===e)return t[i];return null}},{key:"filteredRows",value:function(e){var t=new Set,i=new Set;if(this.active())for(var n=this.range(),r=n.sri,a=n.eri,o=this.filters,s=r+1;s<=a;s+=1)for(var l=0;l<o.length;l+=1){var c=o[l],h=e(s,c.ci),u=h&&0!=h.text.trim().length?h.text:"";if(!c.includes(u)){t.add(s);break}i.add(s)}return{rset:t,fset:i}}},{key:"items",value:function(e,t){var i={};if(this.active())for(var n=this.range(),r=n.sri,a=n.eri,o=r+1;o<=a;o+=1){var s=t(o,e);if(null===s||/^\s*$/.test(s.text))i[""]=(i[""]||0)+1;else{var l=s.text,c=(i[l]||0)+1;i[l]=c}}return i}},{key:"range",value:function(){return x.valueOf(this.ref)}},{key:"hrange",value:function(){var e=this.range();return e.eri=e.sri,e}},{key:"clear",value:function(){this.ref=null,this.filters=[],this.sort=null}},{key:"active",value:function(){return null!==this.ref}}]),e}(),I=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l()(this,e),this._=t}return o()(e,[{key:"forEach",value:function(e){this._.forEach(e)}},{key:"deleteWithin",value:function(e){this._=this._.filter((function(t){return!t.within(e)}))}},{key:"getFirstIncludes",value:function(e,t){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(e,t))return n}return null}},{key:"filterIntersects",value:function(t){return new e(this._.filter((function(e){return e.intersects(t)})))}},{key:"intersects",value:function(e){for(var t=0;t<this._.length;t+=1){if(this._[t].intersects(e))return!0}return!1}},{key:"equals",value:function(e){for(var t=0;t<this._.length;t+=1){if(this._[t].equals(e))return!0}return!1}},{key:"union",value:function(e){var t=e;return this._.forEach((function(e){e.intersects(t)&&(t=e.union(t))})),t}},{key:"add",value:function(e){this.deleteWithin(e),this._.push(e)}},{key:"shift",value:function(e,t,i,n){this._.forEach((function(r){var a=r.sri,o=r.sci,s=r.eri,l=r.eci,c=r;"row"===e?a>=t?(c.sri+=i,c.eri+=i):a<t&&t<=s&&(c.eri+=i,n(a,o,i,0)):"column"===e&&(o>=t?(c.sci+=i,c.eci+=i):o<t&&t<=l&&(c.eci+=i,n(a,o,0,i)))}))}},{key:"move",value:function(e,t,i){this._.forEach((function(n){var r=n;r.within(e)&&(r.eri+=t,r.sri+=t,r.sci+=i,r.eci+=i)}))}},{key:"setData",value:function(e){return this._=e.map((function(e){return x.valueOf(e)})),this}},{key:"getData",value:function(){return this._.map((function(e){return e.toString()}))}},{key:"getDataForSave",value:function(){return this._.filter((function(e){return e.multiple()}))}}]),e}();var A=function e(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach((function(i){Object.keys(i).forEach((function(n){var r=i[n];"string"==typeof r||"number"==typeof r||"boolean"==typeof r?t[n]=r:"function"!=typeof r&&!Array.isArray(r)&&r instanceof Object?(t[n]=t[n]||{},e(t[n],r)):t[n]=r}))})),t};function D(e){for(var t="".concat(e),i=0,n=!1,r=0;r<t.length;r+=1)!0===n&&(i+=1),"."===t.charAt(r)&&(n=!0);return i}function P(e,t,i){if(Number.isNaN(t)||Number.isNaN(i))return t+e+i;var n=D(t),r=D(i),a=Number(t),o=Number(i),s=0;return"-"===e?s=a-o:"+"===e?s=a+o:"*"===e?s=a*o:"/"===e&&(s=a/o),s.toFixed(Math.max(n,r))}var F={cloneDeep:function(e){return JSON.parse(JSON.stringify(e))},merge:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return A.apply(void 0,[{}].concat(t))},equals:function e(t,i){var n=Object.keys(t);if(n.length!==Object.keys(i).length)return!1;for(var r=0;r<n.length;r+=1){var a=n[r],o=t[a],s=i[a];if(void 0===s)return!1;if("string"==typeof o||"number"==typeof o||"boolean"==typeof o){if(o!==s)return!1}else if(Array.isArray(o)){if(o.length!==s.length)return!1;for(var l=0;l<o.length;l+=1)if(!e(o[l],s[l]))return!1}else if("function"!=typeof o&&!Array.isArray(o)&&o instanceof Object&&!e(o,s))return!1}return!0},arrayEquals:function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i+=1)if(e[i]!==t[i])return!1;return!0},sum:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},i=0,n=0;return Object.keys(e).forEach((function(r){i+=t(e[r],r),n+=1})),[i,n]},rangeEach:function(e,t,i){for(var n=e;n<t;n+=1)i(n)},rangeSum:function(e,t,i){for(var n=0,r=e;r<t;r+=1)n+=i(r);return n},rangeReduceIf:function(e,t,i,n,r,a){for(var o=i,s=n,l=e;l<t&&!(o>r);l+=1)o+=s=a(l);return[l,o-s,s]},deleteProperty:function(e,t){var i=e["".concat(t)];return delete e["".concat(t)],i},numberCalc:P},M=function(){function e(t){var i=t.len,n=t.height;l()(this,e),this._={},this.len=i,this.height=n}return o()(e,[{key:"getHeight",value:function(e,t){if(this.isHide(e))return 0;if(t&&t.has(e))return 0;var i=this.get(e);return i&&i.height?i.height:this.height}},{key:"setHeight",value:function(e,t){this.getOrNew(e).height=t}},{key:"setInfo",value:function(e,t){var i=this.getOrNew(e);i.height=t.h,t.hide&&(i.hide=!0)}},{key:"unhide",value:function(e){for(var t=e;t>0&&(t-=1,this.isHide(t));)this.setHide(t,!1)}},{key:"isHide",value:function(e){var t=this.get(e);return t&&t.hide}},{key:"setHide",value:function(e,t){var i=this.getOrNew(e);!0===t?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(e,t){this.getOrNew(e).style=t}},{key:"sumHeight",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;return F.rangeSum(e,t,(function(e){return n&&n.has(e)?0:i.getHeight(e)}))}},{key:"totalHeight",value:function(){return this.sumHeight(0,this.len)}},{key:"get",value:function(e){return this._[e]}},{key:"getOrNew",value:function(e){return this._[e]=this._[e]||{cells:{}},this._[e]}},{key:"getCell",value:function(e,t){var i=this.get(e);return void 0!==i&&void 0!==i.cells&&void 0!==i.cells[t]?i.cells[t]:null}},{key:"getCellMerge",value:function(e,t){var i=this.getCell(e,t);return i&&i.merge?i.merge:[0,0]}},{key:"getCellOrNew",value:function(e,t){var i=this.getOrNew(e);return i.cells[t]=i.cells[t]||{},i.cells[t]}},{key:"setCell",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all",r=this.getOrNew(e);"all"===n?r.cells[t]=i:"text"===n?(r.cells[t]=r.cells[t]||{},r.cells[t].text=i.text):"format"===n&&(r.cells[t]=r.cells[t]||{},r.cells[t].style=i.style,i.merge&&(r.cells[t].merge=i.merge))}},{key:"setCellTextBasicAct",value:function(e,t,i,n){e.text=t,n?e.f=n:delete e.f,i?e.ufv=i:delete e.ufv,e.html&&t.startsWith("<font style=")&&t.endsWith("</font>")&&(e.html=t)}},{key:"setCellText",value:function(e,t,i,n,r){var a=this.getCellOrNew(e,t);this.setCellTextBasicAct(a,i,n,r)}},{key:"setCellTextAndGetRet",value:function(e){var t=this.getCellOrNew(e.ri,e.ci);return this.setCellTextBasicAct(t,e.text,e.ufv,e.f),t.rtxt=e.rtxt,t.html=e.html,delete t.bigfontsize,t}},{key:"updateOneCell",value:function(e){return this.setCellTextAndGetRet(e)}},{key:"copyPaste",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=e.sri,s=e.sci,l=e.eri,c=e.eci,h=new Array,u=new Array,f=t.sri>=0?t.sri:0,d=t.sci>=0?t.sci:0,m=t.eri,g=t.eci,v=e.size(),p=r()(v,2),y=p[0],b=p[1],x=t.size(),k=r()(x,2),C=k[0],S=k[1],_=!0,T=0;(m<o||g<s)&&(_=!1,T=m<o?C:S);for(var O=o;O<=l;O+=1)for(var E=s;E<=c;E+=1)for(var R=f;R<=m;R+=y)for(var I=d;I<=g;I+=b){var A=R+(O-o),D=I+(E-s);if(A!==O||D!==E){var P=this._[O]&&this._[O].cells&&this._[O].cells[E],M=P?F.cloneDeep(this._[O].cells[E]):{};if(A!==O||D!==E){n&&M&&M.text&&M.text.length>0&&function(){var e=M.text,t=I-d+(R-f)+2;if(_||(t-=T+1),"="===e[0])M.text=e.replace(/\w{1,3}\d/g,(function(e){var i=0,n=0;return o===f?i=t-1:n=t-1,/^\d+$/.test(e)?e:w(e,i,n)}));else if(y<=1&&b>1&&(f>l||m<o)||b<=1&&y>1&&(d>c||g<s)||y<=1&&b<=1){var i=/[\\.\d]+$/.exec(e);if(null!==i){var n=Number(i[0])+t-1;M.text=e.substring(0,i.index)+n}}}();var L={ri:A,ci:D,text:M.f?M.f:M.text},j={ri:A,ci:D,ncell:M};n&&(M.f||M.ufv)||h.push(L),u.push(j)}}}for(var z=0;z<u.length;z++)this.setCell(u[z].ri,u[z].ci,u[z].ncell,i),a(u[z].ri,u[z].ci,u[z].ncell);return h}},{key:"cutPaste",value:function(e,t){var i=this,n={};this.each((function(r){i.eachCells(r,(function(a){var o=parseInt(r,10),s=parseInt(a,10);e.includes(r,a)&&(o=t.sri+(o-e.sri),s=t.sci+(s-e.sci)),n[o]=n[o]||{cells:{}},n[o].cells[s]=i._[r].cells[a],n[o].height=i._[r].height}))})),this._=n}},{key:"paste",value:function(e,t){var i=this,n=new Array;if(!(e.length<=0)){var r=t.sri,a=t.sci;return e.forEach((function(e,t){var o=r+t;e.forEach((function(e,t){var r=a+t;if(r<=1e3){i.setCellText(o,r,e);var s={ri:o,ci:r,text:e};n.push(s)}}))})),n}}},{key:"insert",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n={};this.each((function(r,a){var o=parseInt(r,10);o>=e&&(o+=i,t.eachCells(r,(function(t,n){n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(t){return w(t,0,i,(function(t,i){return i>=e}))})))}))),n[o]=a})),this._=n,this.len+=i,e>=1&&this.copyrow(e-1,i)}},{key:"copyrow",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle,r=this._[e];if(void 0!==r)for(var a=function(i){var a=t.getOrNew(e+i);a.height=r.height,t.eachCells(e,(function(e,t){a.cells[e]={},n(a.cells[e],t)}))},o=1;o<=i;o++)a(o)}},{key:"copyCellStyle",value:function(e,t){e.style=t.style,t.isautoalign&&(e.isautoalign=t.isautoalign)}},{key:"delete",value:function(e,t){var i=this,n=t-e+1,r={};this.each((function(a,o){var s=parseInt(a,10);s<e?r[s]=o:a>t&&(r[s-n]=o,i.eachCells(a,(function(e,i){i.text&&"="===i.text[0]&&(i.text=i.text.replace(/\w{1,3}\d/g,(function(e){return w(e,0,-n,(function(e,i){return i>t}))})))})))})),this._=r,this.len-=n}},{key:"insertColumn",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle;this.each((function(r,a){var o={};if(t.eachCells(r,(function(t,n){var r=parseInt(t,10);r>=e&&(r+=i,n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(t){return w(t,i,0,(function(t){return t>=e}))})))),o[r]=n})),e>=1)for(var s=1;s<=i;s++)void 0!==o[e-1]&&(o[e-1+s]={},n(o[e-1+s],o[e-1]));a.cells=o}))}},{key:"deleteColumn",value:function(e,t){var i=this,n=t-e+1;this.each((function(r,a){var o={};i.eachCells(r,(function(i,r){var a=parseInt(i,10);a<e?o[a]=r:a>t&&(o[a-n]=r,r.text&&"="===r.text[0]&&(r.text=r.text.replace(/\w{1,3}\d/g,(function(e){return w(e,-n,0,(function(e){return e>t}))}))))})),a.cells=o}))}},{key:"deleteCells",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";e.each((function(e,n){t.deleteCell(e,n,i)}))}},{key:"deleteCell",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",n=this.get(e);if(null!==n){var r=this.getCell(e,t);null!==r&&("all"===i?delete n.cells[t]:"text"===i?(r.text&&delete r.text,r.value&&delete r.value):"format"===i?(void 0!==r.style&&delete r.style,r.merge&&delete r.merge):"merge"===i&&r.merge&&delete r.merge)}}},{key:"maxCell",value:function(){var e=Object.keys(this._),t=e[e.length-1],i=this._[t];if(i){var n=i.cells,r=Object.keys(n),a=r[r.length-1];return[parseInt(t,10),parseInt(a,10)]}return[0,0]}},{key:"each",value:function(e){Object.entries(this._).forEach((function(t){var i=r()(t,2),n=i[0],a=i[1];e(n,a)}))}},{key:"eachCells",value:function(e,t){this._[e]&&this._[e].cells&&Object.entries(this._[e].cells).forEach((function(e){var i=r()(e,2),n=i[0],a=i[1];t(n,a)}))}},{key:"setData",value:function(e){e.len&&(this.len=e.len,delete e.len),void 0!==e.height&&(this.height=e.height,delete e.height),this._=e}},{key:"setRangeData",value:function(e,t){for(var i=t.sri;i<=t.eri;i++)void 0!==e[i]&&(this._[i]=e[i]),null===e[i]&&delete this._[i]}},{key:"getData",value:function(){var e=this.len,t=this.height;return Object.assign({len:e,height:t},this._)}},{key:"getRangeData",value:function(e){for(var t={},i=e.sri;i<=e.eri;i++)void 0!==this._[i]?t[i]=this._[i]:t[i]=null;return t}},{key:"getDataForRowsSet",value:function(e){var t=this,i=this.len,n=this.height,r={};return r.height=n,r.len=i,e.forEach((function(e){void 0!==t._[e]&&(r[e]=t._[e])})),r}},{key:"getHeightForSave",value:function(e){var t=this,i={};return e.forEach((function(e){void 0!==t._[e]&&(i[e]=t.getHeight(e))})),i}}]),e}(),L=function(){function e(t){var i=t.len,n=t.width,r=t.indexWidth,a=t.minWidth;l()(this,e),this._={},this.len=i,this.width=n,this.indexWidth=r,this.minWidth=a}return o()(e,[{key:"setData",value:function(e){e.len&&(this.len=e.len,delete e.len),this._=e}},{key:"getData",value:function(){var e=this.len;return Object.assign({len:e},this._)}},{key:"getDataForSave",value:function(e){var t=this,i={};return e.forEach((function(e){void 0!==t._[e]&&(i[e]=t._[e])})),i}},{key:"getWidth",value:function(e){if(this.isHide(e))return 0;var t=this._[e];return t&&t.width?t.width:this.width}},{key:"getOrNew",value:function(e){return this._[e]=this._[e]||{},this._[e]}},{key:"setWidth",value:function(e,t){this.getOrNew(e).width=t}},{key:"unhide",value:function(e){for(var t=e;t>0&&(t-=1,this.isHide(t));)this.setHide(t,!1)}},{key:"isHide",value:function(e){var t=this._[e];return t&&t.hide}},{key:"setHide",value:function(e,t){var i=this.getOrNew(e);!0===t?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(e,t){this.getOrNew(e).style=t}},{key:"sumWidth",value:function(e,t){var i=this;return F.rangeSum(e,t,(function(e){return i.getWidth(e)}))}},{key:"totalWidth",value:function(){return this.sumWidth(0,this.len)}}]),e}();function j(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return z(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return z(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var B=["zh","en"],H={en:{toolbar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font",fontSize:"Font size",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Insert image"},menubar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font name:",fontSize:"Font size:",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",download_HTML:"Download As HTML",download_PDF:"Download As PDF",download_Original:"Download Original",download_XLSX:"Download As XLSX",download_GOOGLE:"Save To Google Drive",download_DROPBOX:"Save To Dropbox",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",insertSheet:"Sheet",insertRow:"Row",insertColumn:"Column",link:"Link",insertComment:"Comment",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Image",fromURL:"From URL",fromLocal:"From Local",menuInsert:"Insert",menuComment:"Review",menuText:"Format",menuFont:"Font",menuEdit:"Home",menuFile:"File"},contextmenu:{copy:"Copy",cut:"Cut",paste:"Paste",pasteValue:"Paste values only",pasteFormat:"Paste format only",hide:"Hide",insertRow:"Insert row",insertColumn:"Insert column",deleteSheet:"Delete",deleteRow:"Delete row",deleteColumn:"Delete column",deleteCell:"Delete cell",deleteCellText:"Delete cell text",validation:"Data validations",sort:"Sort",link:"Link",removeLink:"Remove Link",editLink:"Edit Link",openLink:"Open Link",download:"Download",cellprintable:"Enable export",cellnonprintable:"Disable export",celleditable:"Enable editing",cellnoneditable:"Disable editing",insertURL:"Enter the image address",deleteImage:"Delete image",copyImage:"Copy image",pasteImage:"Paste image",merge:"Merge",unmerge:"Unmerge",edit:"Edit",clear:"Clear"},link:{emailAddress:"E-mail Address",emailSubject:"Subject",sheetPage:"Document Place",sheetCell:"Cell Reference",linkTypes:{web:"Web Page",sheet:"This Document",email:"E-mail Address"},webUrl:"Address",linkType:"Link To"},download:{fileName:"File Name",saveType:"Save As",saveTypes:{Original:"Original",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Paper size",orientation:"Page orientation",orientations:["Landscape","Portrait"]},format:{normal:"Normal",text:"Plain Text",number:"Number",percent:"Percent",rmb:"RMB",usd:"USD",eur:"EUR",date:"Date",time:"Time",datetime:"Date time",duration:"Duration"},formula:{sum:"Calculate the sum of a set of values",average:"Calculate the arithmetic mean of all parameters",max:"Calculate the maximum value in a set of numbers",min:"Calculate the smallest value in a set of numbers",_if:"According to the true or false result of the logical judgment of the specified condition, the calculation result triggered by the corresponding condition is returned",and:'Only when the results of the parameters are all logical "true", it returns logical "true", otherwise it returns logical "false"',or:'Only when all parameter values are logically "false", the result is returned as logical "false", otherwise it is returned as logical "true"',concat:"Connect multiple character text or data in cells together",count:"counts the number of cells that contain numbers, and counts numbers within the list of arguments",sumif:"Adds the cells specified by a given criteria",sumifs:"Adds the cells in a range that meet multiple criteria",vlookup:"Looks in the first column of an array and moves across the row to return the value of a cell",hlookup:"Searches for a value in the top row of a table or an array of values, and then returns a value in the same column from a row you specify in the table or array.",lookup:"Looks up values in a vector or array",match:"Looks up values in a reference or array",rank:"Returns the rank of a number in a list of numbers",frequency:"Returns a frequency distribution as a vertical array",text:"Formats a number and converts it to text",left:"Returns the leftmost characters from a text value",right:"Returns the rightmost characters from a text value",round:"Rounds a number to a specified number of digits",index:"Uses an index to choose a value from a reference or array",countif:"Counts the number of cells within a range that meet the given criteria",countifs:"Counts the number of cells within a range that meet multiple criteria",mid:"Returns a specific number of characters from a text string starting at the position you specify",len:"Returns the number of characters in a text string",power:"Returns the result of a number raised to a power",ceiling:"Rounds a number to the nearest integer or to the nearest multiple of significance",floor:"Rounds a number down, toward zero",substitute:"Substitutes new text for old text in a text string",replace:"Replaces characters within text",search:"Finds one text value within another (not case-sensitive)",find:"Finds one text value within another (case-sensitive)",isnumber:"Returns TRUE if the value is a number",istext:"Returns TRUE if the value is text",isblank:"Returns TRUE if the value is blank",upper:"Converts text to uppercase",lower:"Converts text to lowercase",product:"Multiplies its arguments",sumproduct:"Returns the sum of the products of corresponding array components",subtotal:"Returns a subtotal in a list or database",counta:"Counts how many values are in the list of arguments",averageif:"Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria",averageifs:"Returns the average (arithmetic mean) of all cells that meet multiple criteria.",trim:"Removes spaces from text",sign:"Returns the sign of a number",yield:"Returns the yield on a security that pays periodic interest",abs:"Returns the absolute value of a number",sin:"Returns the sine of the given angle",cos:"Returns the cosine of a number",tan:"Returns the tangent of a number"},validation:{required:"it must be required",notMatch:"it not match its validation rule",between:"it is between {} and {}",notBetween:"it is not between {} and {}",notIn:"it is not in list",equal:"it equal to {}",notEqual:"it not equal to {}",lessThan:"it less than {}",lessThanEqual:"it less than or equal to {}",greaterThan:"it greater than {}",greaterThanEqual:"it greater than or equal to {}",downloadImageFail:"download image fail"},error:{pasteForMergedCell:"Unable to do this for merged cells"},calendar:{weeks:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},button:{add:"Add",del:"Delete",next:"Next",cancel:"Cancel",remove:"Remove",save:"Save",ok:"OK",previous:"Previous",close:"Close"},sort:{desc:"Sort Z -> A",asc:"Sort A -> Z"},filter:{empty:"empty"},dataValidation:{mode:"Mode",range:"Cell Range",criteria:"Criteria",modeType:{cell:"Cell",column:"Column",row:"Row"},type:{list:"List",number:"Number",date:"Date",phone:"Phone",email:"Email"},operator:{be:"between",nbe:"not between",lt:"less than",lte:"less than or equal to",gt:"greater than",gte:"greater than or equal to",eq:"equal to",neq:"not equal to"}},dataSort:{ci:"Range",criteria:"Order",casesense:"Case Sensitive",sortby:"Sort by",header:"My data has headers",msg:"Please select diffrent columns for sort by fields",msg2:"The select range has merge areas,we do not support sort on merge areas ",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Find what",lkinlb:"Look in",matchwhole:"Match entire contents",lookin:{values:"Values",formulas:"Formulas",comments:"Comments"}},dataComment:{label:"Comment"}},de:{toolbar:{undo:"Rückgängig machen",redo:"Wiederholen",print:"Drucken",paintformat:"Format Maler",clearformat:"übersichtliches Format",format:"Datei Format",fontName:"Schriftartenname",fontSize:"Schriftgröße",fontBold:"fette Schriftart",fontItalic:"Schriftart kursiv",underline:"unterstreichen",strike:"durchgestrichen",color:"Textfarbe",bgcolor:"Füllfarbe",border:"rahmen",merge:"Zellen verbinden",unmerge:"Zellen trennen",align:"Horizontale Ausrichtung",valign:"Vertikale Ausrichtung",textwrap:"Zeilenumbruch",freeze:"feste Ränge",autofilter:"Filter",formula:"Formel",more:"Mehr",sort:"Einstufung",download:"herunterladen",pagination:"Paging",search:"suchen",commentDefault:"Bitte Text eingeben",commentEdit:"Kommentare bearbeiten",commentRemove:"Kommentar löschen",commentPrevious:"Vorheriger Kommentar",commentNext:"nächster Kommentar",insertImage:"Bild einfügen"},menubar:{undo:"rückgängig machen",redo:"wiederholen",print:"Drucken",paintformat:"Format Maler",clearformat:"übersichtliches Format",format:"Datei Format",fontName:"Schriftartenname:",fontSize:"Schriftgröße:",fontBold:"fette Schriftart",fontItalic:"Schriftart kursiv",underline:"unterstreichen",strike:"durchgestrichen",color:"Textfarbe",bgcolor:"Füllfarbe",border:"rahmen",merge:"Zellen verbinden",unmerge:"Zellen trennen",align:"Horizontale Ausrichtung",valign:"Vertikale Ausrichtung",textwrap:"Zeilenumbruch",freeze:"feste Ränge",autofilter:"Filter",formula:"Formel",more:"Mehr",sort:"Einstufung",download:"herunterladen",download_HTML:"Als HTML herunterladen",download_PDF:"Als PDF herunterladen",download_Original:"Original herunterladen",download_XLSX:"Als XLSX herunterladen",download_GOOGLE:"Auf Google Drive speichern",download_DROPBOX:"In Dropbox speichern",pagination:"Paging",search:"suchen",commentDefault:"Bitte Text eingeben",insertSheet:"Arbeitsblatt einfügen",insertRow:"Zeile einfügen",insertColumn:"Spalte einfügen",link:"Verknüpfung",insertComment:"einen Kommentar hinzufügen",commentEdit:"Kommentare bearbeiten",commentRemove:"Kommentar löschen",commentPrevious:"Vorheriger Kommentar",commentNext:"nächster Kommentar",insertImage:"Bild einfügen",fromURL:"von URL",fromLocal:"von lokal",menuInsert:"ergänzen",menuComment:"Überprüfen",menuText:"Format",menuFont:"Schriftart",menuEdit:"Titelseite",menuFile:"dokumentieren"},contextmenu:{copy:"Kopieren",cut:"schneiden",paste:"Paste",pasteValue:"Fügen Sie nur den Wert ein",pasteFormat:"Nur Formatierung einfügen",hide:"verstecken",insertRow:"Zeile einfügen",insertColumn:"Spalte einfügen",deleteSheet:"Blatt löschen",deleteRow:"Zeile löschen",deleteColumn:"Spalte löschen",deleteCell:"Zelle löschen",deleteCellText:"Zelltext löschen",validation:"Datenüberprüfung",sort:"Einstufung",link:"Verknüpfung",removeLink:"Link löschen",editLink:"Link bearbeiten",openLink:"Verbindung öffnen",download:"herunterladen",cellprintable:"Export aktivieren",cellnonprintable:"Export deaktivieren",celleditable:"Bearbeitung aktivieren",cellnoneditable:"Bearbeitung deaktivieren",insertURL:"Bildadresse eingeben",deleteImage:"Foto löschen",copyImage:"Bild kopieren",pasteImage:"Bild einfügen",merge:"verschmelzen",unmerge:"aufheben",edit:"bearbeiten",clear:"zu löschen"},link:{emailAddress:"Email",emailSubject:"Thema",sheetPage:"Speicherort",sheetCell:"Zellbezug",linkTypes:{web:"Website",sheet:"Diese Datei",email:"Email"},webUrl:"URL",linkType:"Linktyp"},download:{fileName:"Dateinamen",saveType:"Speichern als",saveTypes:{Original:"Originalformat",XLSX:"XLSX-Format",PDF:"PDF-Format",HTML:"HTML-Format"}},print:{size:"Papier größe",orientation:"Seitenausrichtung",orientations:["Horizontal, Vertikal"]},format:{normal:"normal",text:"Klartext",number:"Nummer",percent:"Prozentsatz",rmb:"Renminbi",usd:"Dollar",eur:"EUR",date:"Datum",time:"Zeit",datetime:"Terminzeit",duration:"Zeitraum"},formula:{sum:"Berechnet die Summe einer Reihe von Werten",average:"Berechnet das arithmetische Mittel aller Parameter",max:"Berechnet den Maximalwert in einer Reihe von Ziffern",min:"Berechnet den kleinsten Wert in einer Reihe von Ziffern",_if:"Je nachdem, ob das Ergebnis der logischen Beurteilung der angegebenen Bedingung wahr oder falsch ist, geben Sie das Berechnungsergebnis zurück, das durch die entsprechende Bedingung ausgelöst wurde",and:"Es gibt nur logisch „wahr“ zurück, wenn die Ergebnisse der Parameter beide logisch „wahr“ sind, andernfalls gibt es logisch „falsch“ zurück.",or:"Das Ergebnis wird nur dann als logisch „falsch“ zurückgegeben, wenn alle Parameterwerte logisch „falsch“ sind, ansonsten wird logisch „wahr“ zurückgegeben.",concat:"Mehreren Zeichentext oder Daten in Zellen miteinander verbinden",count:"zählt die Anzahl der Zellen, die Zahlen enthalten, und zählt Zahlen in der Liste der Argumente",sumif:"Fügt die durch ein bestimmtes Kriterium spezifizierten Zellen hinzu",sumifs:"Fügt die Zellen in einem Bereich hinzu, die mehrere Kriterien erfüllen",vlookup:"Sucht in der ersten Spalte eines Arrays und bewegt sich über die Zeile, um den Wert einer Zelle zurückzugeben",hlookup:"Sucht nach einem Wert in der obersten Zeile einer Tabelle oder einem Array von Werten und gibt dann einen Wert in derselben Spalte aus einer Zeile zurück, die Sie in der Tabelle oder dem Array angeben.",lookup:"Schlägt Werte in einem Vektor oder Array nach",match:"Schlägt Werte in einer Referenz oder einem Array nach",rank:"Gibt den Rang einer Zahl in einer Liste von Zahlen zurück",frequency:"Gibt eine Häufigkeitsverteilung als vertikales Array zurück",text:"Formatiert eine Zahl und wandelt sie in Text um",left:"Gibt die Zeichen ganz links von einem Textwert zurück",right:"Gibt die Zeichen ganz rechts von einem Textwert zurück",round:"Rundet eine Zahl auf eine bestimmte Anzahl von Stellen",index:"Verwendet einen Index, um einen Wert aus einer Referenz oder einem Array auszuwählen",countif:"Zählt die Anzahl der Zellen innerhalb eines Bereichs, die die angegebenen Kriterien erfüllen",countifs:"Zählt die Anzahl der Zellen innerhalb eines Bereichs, die mehrere Kriterien erfüllen",mid:"Gibt eine bestimmte Anzahl von Zeichen aus einer Textzeichenfolge zurück, beginnend an der von Ihnen angegebenen Position",len:"Gibt die Anzahl der Zeichen in einer Textzeichenfolge zurück",power:"Gibt das Ergebnis einer potenzierten Zahl zurück",ceiling:"Rundet eine Zahl auf die nächste ganze Zahl oder auf das nächste Vielfache der Wertigkeit",floor:"Rundet eine Zahl ab, gegen Null",substitute:"Ersetzt alten Text in einer Textzeichenfolge durch neuen Text",replace:"Ersetzt Zeichen im Text",search:"Sucht einen Textwert innerhalb eines anderen (Groß- und Kleinschreibung wird nicht beachtet)",find:"Sucht einen Textwert in einem anderen (Groß-/Kleinschreibung beachten)",isnumber:"Gibt TRUE zurück, wenn der Wert eine Zahl ist",istext:"Gibt TRUE zurück, wenn der Wert Text ist",isblank:"Gibt TRUE zurück, wenn der Wert leer ist",upper:"Konvertiert Text in Großbuchstaben",lower:"Konvertiert Text in Kleinbuchstaben",product:"Multipliziert seine Argumente",sumproduct:"Gibt die Summe der Produkte der entsprechenden Array-Komponenten zurück",subtotal:"Gibt eine Zwischensumme in einer Liste oder Datenbank zurück",counta:"Zählt, wie viele Werte in der Liste der Argumente sind",averageif:"Gibt den Durchschnitt (arithmetisches Mittel) aller Zellen in einem Bereich zurück, die ein bestimmtes Kriterium erfüllen",averageifs:"Gibt den Durchschnitt (arithmetisches Mittel) aller Zellen zurück, die mehrere Kriterien erfüllen.",trim:"Entfernt Leerzeichen aus Text",sign:"Gibt das Vorzeichen einer Zahl zurück",yield:"Gibt die Rendite eines Wertpapiers zurück, das periodisch Zinsen zahlt",abs:"Gibt den Absolutwert einer Zahl zurück",sin:"Gibt den Sinus des angegebenen Winkels zurück",cos:"Gibt den Kosinus einer Zahl zurück",tan:"Gibt den Tangens einer Zahl zurück"},validation:{required:"es muss erforderlich sein",notMatch:"es entspricht nicht seinen Validierungsregeln",between:"Es liegt zwischen {} und {}",notBetween:"es liegt nicht zwischen {} und {}",notIn:"es ist nicht in der liste",equal:"es ist gleich {}",notEqual:"es ist nicht gleich {}",lessThan:"es ist kleiner als {}",lessThanEqual:"es ist kleiner oder gleich {}",greaterThan:"es ist größer als {}",greaterThanEqual:"es ist größer oder gleich {}",downloadImageFail:"Bild konnte nicht heruntergeladen werden"},error:{pasteForMergedCell:"Dieser Vorgang kann nicht für verbundene Zellen ausgeführt werden"},calendar:{weeks:["Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag"],months:["Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember"]},button:{add:"ergänzen",del:"löschen",next:"Nächste",cancel:"Stornieren",remove:"entfernen",save:"speichern",ok:"bestätigen",previous:"Vorherige",close:"Schließung"},sort:{desc:"Z->A sortieren",asc:"A->Z sortieren"},filter:{empty:"leer"},dataValidation:{mode:"Modell",range:"Zellbereich",criteria:"Standard",modeType:{cell:"Einzelzelle",column:"Spalte",row:"Linie"},type:{list:"Liste",number:"Ziffer",date:"Datum",phone:"Telefon",email:"Email"},operator:{be:"zwischen",nbe:"nicht zwischen",lt:"weniger als",lte:"Gleich oder kleiner als",gt:"mehr als die",gte:"größer als oder gleich wie",eq:"gleich",neq:"Nicht gleichzusetzen mit"}},dataSort:{ci:"Umfang",criteria:"Befehl",casesense:"Groß- und Kleinschreibung beachten",sortby:"Sortieren nach",header:"Titel",msg:"Bitte wählen Sie eine andere Spalte sortiert nach Feld",msg2:"Der Auswahlbereich hat einen zusammengeführten Bereich, wir unterstützen das Sortieren des zusammengeführten Bereichs nicht",order:{asc:"Positive Folge",desc:"umgekehrte Reihenfolge"}},dataSearch:{label:"Inhalt finden",lkinlb:"Suchbereich",matchwhole:"entspricht dem gesamten Inhalt",lookin:{values:"Text",formulas:"Formel",comments:"Anmerkung"}},dataComment:{label:"Anmerkung"}},nl:{toolbar:{undo:"herroepen",redo:"opnieuw doen",print:"Afdrukken",paintformat:"Formaat schilder",clearformat:"duidelijk formaat",format:"Data formaat",fontName:"lettertype naam",fontSize:"lettertypegrootte",fontBold:"Lettertype vetgedrukt",fontItalic:"lettertype cursief",underline:"onderstrepen",strike:"doorhalen",color:"tekst kleur",bgcolor:"opvulkleur",border:"kader",merge:"Cellen samenvoegen",unmerge:"cellen samenvoegen",align:"Horizontale uitlijning",valign:"verticale uitlijning",textwrap:"woordomslag",freeze:"vaste rangen",autofilter:"filter",formula:"formule",more:"Meer",sort:"Classificatie",download:"downloaden",pagination:"paging",search:"zoekopdracht",commentDefault:"voer a.u.b. tekst in",commentEdit:"opmerkingen bewerken",commentRemove:"opmerking verwijderen",commentPrevious:"Vorige opmerking",commentNext:"volgende opmerking",insertImage:"plaatje invoegen"},menubar:{undo:"ongedaan maken",redo:"opnieuw doen",print:"Afdrukken",paintformat:"Formaat schilder",clearformat:"duidelijk formaat",format:"Data formaat",fontName:"Lettertype naam:",fontSize:"lettertypegrootte:",fontBold:"Lettertype vetgedrukt",fontItalic:"lettertype cursief",underline:"onderstrepen",strike:"doorhalen",color:"tekst kleur",bgcolor:"opvulkleur",border:"kader",merge:"Cellen samenvoegen",unmerge:"cellen samenvoegen",align:"Horizontale uitlijning",valign:"verticale uitlijning",textwrap:"woordomslag",freeze:"vaste rangen",autofilter:"filter",formula:"formule",more:"Meer",sort:"Classificatie",download:"downloaden",download_HTML:"Downloaden als HTML",download_PDF:"Downloaden als PDF",download_Original:"origineel downloaden",download_XLSX:"Downloaden als XLSX",download_GOOGLE:"Opslaan in Google Drive",download_DROPBOX:"Sla op in Dropbox",pagination:"paging",search:"zoekopdracht",commentDefault:"voer a.u.b. tekst in",insertSheet:"werkblad invoegen",insertRow:"rij invoegen",insertColumn:"kolom invoegen",link:"koppeling",insertComment:"Voeg commentaar toe",commentEdit:"opmerkingen bewerken",commentRemove:"opmerking verwijderen",commentPrevious:"Vorige opmerking",commentNext:"volgende opmerking",insertImage:"plaatje invoegen",fromURL:"van URL",fromLocal:"van lokaal",menuInsert:"Optellen bij",menuComment:"Rekening",menuText:"Formaat",menuFont:"lettertype",menuEdit:"voorpagina",menuFile:"document"},contextmenu:{copy:"kopiëren",cut:"snijden",paste:"Plakken",pasteValue:"Plak alleen de waarde",pasteFormat:"Alleen opmaak plakken",hide:"verbergen",insertRow:"rij invoegen",insertColumn:"kolom invoegen",deleteSheet:"blad verwijderen",deleteRow:"Verwijder rij",deleteColumn:"kolom verwijderen",deleteCell:"cel verwijderen",deleteCellText:"celtekst verwijderen",validation:"gegevens verificatie",sort:"Classificatie",link:"koppeling",removeLink:"koppeling verwijderen",editLink:"koppeling bewerken",openLink:"open link",download:"downloaden",cellprintable:"export inschakelen",cellnonprintable:"export uitschakelen",celleditable:"bewerking inschakelen",cellnoneditable:"bewerking uitschakelen",insertURL:"Voer het afbeeldingsadres in",deleteImage:"foto verwijderen",copyImage:"foto kopiëren",pasteImage:"foto plakken",merge:"samenvoegen",unmerge:"ongedaan maken",edit:"bewerking",clear:"wissen"},link:{emailAddress:"E-mailen",emailSubject:"thema",sheetPage:"bestandslocatie",sheetCell:"celverwijzing",linkTypes:{web:"webpagina",sheet:"dit bestand",email:"E-mailen"},webUrl:"url",linkType:"koppelingstype"},download:{fileName:"bestandsnaam",saveType:"Opslaan als",saveTypes:{Original:"origineel formaat",XLSX:"XLSX-formaat",PDF:"PDF-formaat",HTML:"HTML-indeling"}},print:{size:"papiergrootte",orientation:"paginaoriëntatie",orientations:["horizontaal verticaal"]},format:{normal:"normaal",text:"platte tekst",number:"nummer",percent:"percentage",rmb:"RMB",usd:"Dollar",eur:"EUR",date:"datum",time:"tijd",datetime:"datum Tijd",duration:"periode"},formula:{sum:"Berekent de som van een reeks waarden",average:"Berekent het rekenkundig gemiddelde van alle parameters",max:"Berekent de maximale waarde in een reeks cijfers",min:"Berekent de kleinste waarde in een reeks cijfers",_if:"Volgens het logische oordeel is het resultaat van de opgegeven voorwaarde waar of onwaar, retourneert u het berekeningsresultaat dat wordt geactiveerd door de overeenkomstige voorwaarde",and:'Het retourneert alleen logisch "true" als de resultaten van de parameters beide logisch "true" zijn, anders retourneert het logisch "false"',or:'Het resultaat wordt alleen als logisch "false" geretourneerd als alle parameterwaarden logisch "false" zijn, anders wordt het logisch "true" geretourneerd',concat:"Forbind tekst eller data med flere tegn i celler sammen",count:"tæller antallet af celler, der indeholder tal, og tæller tal inden for listen over argumenter",sumif:"Tilføjer de celler, der er specificeret af et givet kriterium",sumifs:"Tilføjer cellerne i et område, der opfylder flere kriterier",vlookup:"Ser i den første kolonne i en matrix og bevæger sig hen over rækken for at returnere værdien af en celle",hlookup:"Søger efter en værdi i den øverste række af en tabel eller en matrix af værdier og returnerer derefter en værdi i den samme kolonne fra en række, du angiver i tabellen eller matrixen.",lookup:"Søger værdier i en vektor eller et array",match:"Søger værdier i en reference eller et array",rank:"Gengiver rangeringen af et tal i en liste over tal",frequency:"Returnerer en frekvensfordeling som en vertikal matrix",text:"Formater et tal og konverterer det til tekst",left:"Returnerer tegnene længst til venstre fra en tekstværdi",right:"Returnerer tegnene længst til højre fra en tekstværdi",round:"Runder et tal til et bestemt antal cifre",index:"Bruger et indeks til at vælge en værdi fra en reference eller et array",countif:"Tæller antallet af celler inden for et område, der opfylder de givne kriterier",countifs:"Tæller antallet af celler inden for et område, der opfylder flere kriterier",mid:"Returnerer et bestemt antal tegn fra en tekststreng, der starter på den position, du angiver",len:"Returnerer antallet af tegn i en tekststreng",power:"Returnerer resultatet af et tal hævet til en potens",ceiling:"Runder et tal til det nærmeste heltal eller til det nærmeste multiplum af betydning",floor:"Runder et tal nedad mod nul",substitute:"Erstatter ny tekst med gammel tekst i en tekststreng",replace:"Erstatter tegn i tekst",search:"Finder en tekstværdi i en anden (ikke skelner mellem store og små bogstaver)",find:"Finder en tekstværdi i en anden (forskel på store og små bogstaver)",isnumber:"Returnerer SAND, hvis værdien er et tal",istext:"Returnerer TRUE, hvis værdien er tekst",isblank:"Returnerer SAND, hvis værdien er tom",upper:"Konverterer tekst til store bogstaver",lower:"Konverterer tekst til små bogstaver",product:"Multiplicerer sine argumenter",sumproduct:"Returnerer summen af produkterne af tilsvarende array-komponenter",subtotal:"Returnerer en subtotal i en liste eller database",counta:"Tæller, hvor mange værdier der er på listen over argumenter",averageif:"Returnerer gennemsnittet (aritmetisk middelværdi) af alle celler i et område, der opfylder et givet kriterium",averageifs:"Returnerer gennemsnittet (aritmetisk middelværdi) af alle celler, der opfylder flere kriterier.",trim:"Fjerner mellemrum fra tekst",sign:"Returnerer tegnet på et tal",yield:"Gengiver afkastet på et værdipapir, der betaler periodisk rente",abs:"Returnerer den absolutte værdi af et tal",sin:"Returnerer sinus for den givne vinkel",cos:"Returnerer cosinus af et tal",tan:"Returnerer tangens af et tal"},validation:{required:"het moet verplicht zijn",notMatch:"het komt niet overeen met de validatieregels",between:"Het is tussen {} en {}",notBetween:"het is niet tussen {} en {}",notIn:"het staat niet in de lijst",equal:"het is gelijk aan {}",notEqual:"het is niet gelijk aan {}",lessThan:"het is minder dan {}",lessThanEqual:"het is kleiner dan of gelijk aan {}",greaterThan:"het is groter dan {}",greaterThanEqual:"het is groter dan of gelijk aan {}",downloadImageFail:"Kan de afbeelding niet downloaden"},error:{pasteForMergedCell:"Kan deze bewerking niet uitvoeren op samengevoegde cellen"},calendar:{weeks:["Zondag maandag dinsdag woensdag donderdag vrijdag zaterdag"],months:["Januari, februari, maart, april, mei, juni, juli, augustus, september, oktober, november, december"]},button:{add:"Optellen bij",del:"verwijderen",next:"Volgende",cancel:"Annuleren",remove:"verwijderen",save:"redden ",ok:"bevestigen",previous:"Vorig",close:"sluiting"},sort:{desc:"Sorteer Z->A",asc:"Sorteer A->Z"},filter:{empty:"leeg"},dataValidation:{mode:"model",range:"cel bereik",criteria:"standaard",modeType:{cell:"eencellig",column:"kolom",row:"lijn"},type:{list:"lijst",number:"cijfer",date:"datum",phone:"Telefoon",email:"e-mailen"},operator:{be:"tussen",nbe:"niet tussen",lt:"minder dan",lte:"minder dan of gelijk aan",gt:"meer dan de",gte:"groter dan of gelijk aan",eq:"gelijkwaardig",neq:"niet gelijk aan"}},dataSort:{ci:"domein",criteria:"volgorde",casesense:"hoofdlettergevoelig",sortby:"sorteer op",header:"titel",msg:"Kies een andere kolom gesorteerd op veld",msg2:"Het selectiegebied heeft een samengevoegd gebied, we ondersteunen het sorteren van het samengevoegde gebied niet",order:{asc:"Positieve volgorde",desc:"omgekeerde volgorde"}},dataSearch:{label:"inhoud vinden",lkinlb:"zoek bereik",matchwhole:"komt overeen met de volledige inhoud",lookin:{values:"tekst",formulas:"formule",comments:"annotatie"}},dataComment:{label:"annotatie"}},zh:{toolbar:{undo:"撤消",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体名称",fontSize:"字体大小",fontBold:"字体粗体",fontItalic:"字体斜体",underline:"下划线",strike:"删除线",color:"文字颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",unmerge:"取消合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"文字换行",freeze:"固定行列",autofilter:"过滤器",formula:"公式",more:"更多",sort:"分类",download:"下载",pagination:"分页",search:"搜索",commentDefault:"请输入文字",commentEdit:"编辑批注",commentRemove:"删除批注",commentPrevious:"上一条批注",commentNext:"下一条批注",insertImage:"插入图片"},menubar:{undo:"撤消",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体名称:",fontSize:"字体大小:",fontBold:"字体粗体",fontItalic:"字体斜体",underline:"下划线",strike:"删除线",color:"文字颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",unmerge:"取消合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"文字换行",freeze:"固定行列",autofilter:"过滤器",formula:"公式",more:"更多",sort:"分类",download:"下载",download_HTML:"下载为HTML",download_PDF:"下载为PDF",download_Original:"下载原件",download_XLSX:"下载为XLSX",download_GOOGLE:"保存至GoogleDrive",download_DROPBOX:"保存至Dropbox",pagination:"分页",search:"搜索",commentDefault:"请输入文字",insertSheet:"插入工作表",insertRow:"插入行",insertColumn:"插入列",link:"连接",insertComment:"添加批注",commentEdit:"编辑批注",commentRemove:"删除批注",commentPrevious:"上一条批注",commentNext:"下一条批注",insertImage:"插入图片",fromURL:"来自URL",fromLocal:"来自本地",menuInsert:"添加",menuComment:"查看",menuText:"格式",menuFont:"字体",menuEdit:"首页",menuFile:"文件"},contextmenu:{copy:"复制",cut:"剪切",paste:"粘贴",pasteValue:"仅粘贴值",pasteFormat:"仅粘贴格式",hide:"隐藏",insertRow:"插入行",insertColumn:"插入列",deleteSheet:"删去工作表",deleteRow:"删除行",deleteColumn:"删除列",deleteCell:"删除储存格",deleteCellText:"删除储存格文字",validation:"数据验证",sort:"分类",link:"连接",removeLink:"删除连接",editLink:"编辑连接",openLink:"打开连接",download:"下载",cellprintable:"启用导出",cellnonprintable:"禁用导出",celleditable:"启用编辑",cellnoneditable:"禁用编辑",insertURL:"输入图像地址",deleteImage:"删除图片",copyImage:"复制图片",pasteImage:"粘贴图片",merge:"合并",unmerge:"取消合并",edit:"编辑",clear:"清除"},link:{emailAddress:"电子邮箱",emailSubject:"主题",sheetPage:"档案位置",sheetCell:"储存格引用",linkTypes:{web:"网页",sheet:"本档案",email:"电子邮箱"},webUrl:"网址",linkType:"连接类型"},download:{fileName:"文档名称",saveType:"另存为",saveTypes:{Original:"原格式",XLSX:"XLSX格式",PDF:"PDF格式",HTML:"HTML格式"}},print:{size:"纸张大小",orientation:"页面方向",orientations:["横向,纵向"]},format:{normal:"普通",text:"纯文字",number:"数字",percent:"百分比",rmb:"人民币",usd:"美元",eur:"欧元",date:"日期",time:"时间",datetime:"日期时间",duration:"期间"},formula:{sum:"计算一组值的总和",average:"计算所有参数的算术平均值",max:"计算一组数位中的最大值",min:"计算一组数位中的最小值",_if:"根据指定条件的逻辑判断结果的真或假,返回相应条件触发的计算结果",and:"只有当参数的结果都是逻辑“true”时,它才会返回逻辑“true”,否则返回逻辑“false”",or:"只有当所有参数值在逻辑上都为“false”时,结果才返回为逻辑“false”,否则返回为逻辑上的“true”",concat:"将单元格中的多个字符文本或数据连接在一起",count:"计算包含数字的单元格数量,并计算参数列表中的数字",sumif:"添加给定条件指定的单元格",sumifs:"添加满足多个条件的范围内的单元格",vlookup:"查看数组的第一列并跨行移动以返回单元格的值",hlookup:"在表的第一行或值数组中搜索一个值,然后从您在表或数组中指定的行的同一列中返回一个值",lookup:"在向量或数组中查找值",match:"在引用或数组中查找值",rank:"返回一个数字在数字列表中的排名",frequency:"以垂直数组形式返回频率分布",text:"格式化数字并将其转换为文本",left:"返回文本值最左边的字符",right:"返回文本值中最右边的字符",round:"将数字四舍五入到指定位数",index:"使用索引从引用或数组中选择一个值",countif:"计算范围内满足给定条件的单元格数",countifs:"计算范围内满足多个条件的单元格数",mid:"从指定位置开始的文本字符串中返回特定数量的字符",len:"返回文本字符串中的字符数",power:"返回一个数的幂的结果",ceiling:"将数字四舍五入到最接近的整数或最接近的有效倍数",floor:"将数字向下舍入为零",substitute:"用新文本替换文本字符串中的旧文本",replace:"替换文本中的字符",search:"在另一个文本值中查找一个文本值(不区分大小写)",find:"在一个文本值中查找另一个文本值(区分大小写)",isnumber:"如果值为数字则返回 TRUE",istext:"如果值为文本则返回 TRUE",isblank:"如果值为空则返回 TRUE",upper:"将文本转换为大写",lower:"将文本转换为小写",product:"乘以它的论点",sumproduct:"返回对应数组元素的乘积之和",subtotal:"返回列表或数据库中的小计",counta:"计算参数列表中有多少个值",averageif:"返回范围内满足给定条件的所有单元格的平均值(算术平均值)",averageifs:"返回满足多个条件的所有单元格的平均值(算术平均值)。",trim:"从文本中删除空格",sign:"返回数字的符号",yield:"返回支付定期利息的证券的收益率",abs:"返回数字的绝对值",sin:"返回给定角度的正弦值",cos:"返回数字的余弦值",tan:"返回数字的正切"},validation:{required:"它必须是必需的",notMatch:"它与其验证规则不匹配",between:"它介于{}和{}之间",notBetween:"它不在{}和{}之间",notIn:"它不在清单中",equal:"它等于{}",notEqual:"它不等于{}",lessThan:"它小于{}",lessThanEqual:"它小于或等于{}",greaterThan:"它大于{}",greaterThanEqual:"它大于或等于{}",downloadImageFail:"下载图像失败"},error:{pasteForMergedCell:"无法对合并的储存格执行此操作"},calendar:{weeks:["周日、周一、周二、周三、周四、周五、周六"],months:["一月、二月、三月、四月、五月、六月、七月、八月、九月、十月、十一月、十二月"]},button:{add:"添加",del:"删除",next:"下一个",cancel:"取消",remove:"去除",save:"保存",ok:"确认",previous:"前一个",close:"关闭"},sort:{desc:"排序Z->A",asc:"排序A->Z"},filter:{empty:"空的"},dataValidation:{mode:"模式",range:"储存格范围",criteria:"标准",modeType:{cell:"单间牢房",column:"柱",row:"一行"},type:{list:"清单",number:"数位",date:"日期",phone:"电话",email:"电子邮件"},operator:{be:"之间",nbe:"不介于",lt:"少于",lte:"小于或等于",gt:"大于",gte:"大于或等于",eq:"等于",neq:"不等于"}},dataSort:{ci:"范围",criteria:"顺序",casesense:"区分大小写",sortby:"排序依据",header:"标题",msg:"请选择按字段排序的不同列",msg2:"选择区域有合并区域,我们不支持对合并区域进行排序",order:{asc:"正序",desc:"逆序"}},dataSearch:{label:"查找内容",lkinlb:"查找范围",matchwhole:"匹配整个内容",lookin:{values:"文本",formulas:"公式",comments:"批注"}},dataComment:{label:"批注"}},ru:{toolbar:{undo:"отозвать",redo:"переделывать",print:"Распечатать",paintformat:"Формат Painter",clearformat:"чистый формат",format:"Формат данных",fontName:"имя шрифта",fontSize:"размер шрифта",fontBold:"шрифт полужирный",fontItalic:"курсив",underline:"подчеркнуть",strike:"зачеркнутый",color:"цвет текста",bgcolor:"Цвет заливки",border:"рамка",merge:"Объединить ячейки",unmerge:"разъединить ячейки",align:"Горизонтальное выравнивание",valign:"вертикальное выравнивание",textwrap:"перенос слова",freeze:"фиксированные ранги",autofilter:"фильтр",formula:"формула",more:"Более",sort:"Классификация",download:"скачать",pagination:"пейджинг",search:"поиск",commentDefault:"пожалуйста, введите текст",commentEdit:"редактировать комментарии",commentRemove:"удалить комментарий",commentPrevious:"Предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"вставить картинку"},menubar:{undo:"отменить",redo:"переделывать",print:"Распечатать",paintformat:"Формат Painter",clearformat:"чистый формат",format:"Формат данных",fontName:"Название шрифта:",fontSize:"размер шрифта:",fontBold:"шрифт полужирный",fontItalic:"курсив",underline:"подчеркнуть",strike:"зачеркнутый",color:"цвет текста",bgcolor:"Цвет заливки",border:"рамка",merge:"Объединить ячейки",unmerge:"разъединить ячейки",align:"Горизонтальное выравнивание",valign:"вертикальное выравнивание",textwrap:"перенос слова",freeze:"фиксированные ранги",autofilter:"фильтр",formula:"формула",more:"Более",sort:"Классификация",download:"скачать",download_HTML:"Скачать как HTML",download_PDF:"Скачать в формате PDF",download_Original:"скачать оригинал",download_XLSX:"Скачать как XLSX",download_GOOGLE:"Сохранить на Google Диск",download_DROPBOX:"Сохранить в Dropbox",pagination:"пейджинг",search:"поиск",commentDefault:"пожалуйста, введите текст",insertSheet:"вставить рабочий лист",insertRow:"вставить строку",insertColumn:"вставить столбец",link:"связь",insertComment:"добавить комментарий",commentEdit:"редактировать комментарии",commentRemove:"удалить комментарий",commentPrevious:"Предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"вставить картинку",fromURL:"из URL",fromLocal:"от местного",menuInsert:"добавить в",menuComment:"Проверять",menuText:"Формат",menuFont:"шрифт",menuEdit:"титульная страница",menuFile:"документ"},contextmenu:{copy:"копировать",cut:"вырезать",paste:"вставить",pasteValue:"Вставьте только значение",pasteFormat:"Вставить только форматирование",hide:"скрывать",insertRow:"вставить строку",insertColumn:"вставить столбец",deleteSheet:"удалить лист",deleteRow:"удалить строку",deleteColumn:"удалить столбец",deleteCell:"удалить ячейку",deleteCellText:"удалить текст ячейки",validation:"проверка данных",sort:"Классификация",link:"связь",removeLink:"удалить ссылку",editLink:"изменить ссылку",openLink:"открыть ссылку",download:"скачать",cellprintable:"включить экспорт",cellnonprintable:"отключить экспорт",celleditable:"разрешить редактирование",cellnoneditable:"отключить редактирование",insertURL:"Введите адрес изображения",deleteImage:"удалить картинку",copyImage:"копировать картинку",pasteImage:"вставить картинку",merge:"сливаться",unmerge:"разъединять",edit:"редактировать",clear:"очистить"},link:{emailAddress:"Электронная почта",emailSubject:"тема",sheetPage:"местоположение файла",sheetCell:"ссылка на ячейку",linkTypes:{web:"веб-страница",sheet:"этот файл",email:"Электронная почта"},webUrl:"URL",linkType:"тип ссылки"},download:{fileName:"имя файла",saveType:"Сохранить как",saveTypes:{Original:"исходный формат",XLSX:"XLSX-формат",PDF:"PDF-формат",HTML:"HTML-формат"}},print:{size:"размер бумаги",orientation:"ориентация страницы",orientations:["горизонтальная вертикальная"]},format:{normal:"обычный",text:"простой текст",number:"число",percent:"процент",rmb:"юаней",usd:"доллар",eur:"евро",date:"дата",time:"время",datetime:"дата время",duration:"период"},formula:{sum:"Вычисляет сумму набора значений",average:"Вычисляет среднее арифметическое всех параметров",max:"Вычисляет максимальное значение в наборе цифр",min:"Вычисляет наименьшее значение в наборе цифр",_if:"Согласно логическому заключению, результат указанного условия является истинным или ложным, вернуть результат вычисления, вызванный соответствующим условием.",and:"Он возвращает логическое «истина» только в том случае, если результаты обоих параметров являются логическими «истинами», в противном случае он возвращает логическое «ложь».",or:"Результат возвращается как логическое «ложь», только если все значения параметров являются логически «ложными», в противном случае возвращается логическое «истина».",concat:"Conecte vários caracteres de texto ou dados em células juntos",count:"conta o número de células que contêm números e conta os números dentro da lista de argumentos",sumif:"Adiciona as células especificadas por um determinado critério",sumifs:"Adiciona as células em um intervalo que atendem a vários critérios",vlookup:"Olha na primeira coluna de uma matriz e move-se pela linha para retornar o valor de uma célula",hlookup:"Procura um valor na linha superior de uma tabela ou uma matriz de valores e, em seguida, retorna um valor na mesma coluna de uma linha especificada na tabela ou matriz.",lookup:"Procura valores em um vetor ou array",match:"Procura valores em uma referência ou array",rank:"Retorna a classificação de um número em uma lista de números",frequency:"Retorna uma distribuição de frequência como uma matriz vertical",text:"Formata um número e o converte em texto",left:"Retorna os caracteres mais à esquerda de um valor de texto",right:"Retorna os caracteres mais à direita de um valor de texto",round:"Arredonda um número para um número especificado de dígitos",index:"Usa um índice para escolher um valor de uma referência ou array",countif:"Conta o número de células dentro de um intervalo que atendem aos critérios fornecidos",countifs:"Conta o número de células dentro de um intervalo que atendem a vários critérios",mid:"Retorna um número específico de caracteres de uma string de texto começando na posição que você especificar",len:"Retorna o número de caracteres em uma string de texto",power:"Retorna o resultado de um número elevado a uma potência",ceiling:"Arredonda um número para o inteiro mais próximo ou para o múltiplo de significância mais próximo",floor:"Arredonda um número para baixo, para zero",substitute:"Substitui o novo texto pelo texto antigo em uma string de texto",replace:"Substitui caracteres no texto",search:"Encontra um valor de texto dentro de outro (sem distinção entre maiúsculas e minúsculas)",find:"Encontra um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)",isnumber:"Retorna TRUE se o valor for um número",istext:"Retorna TRUE se o valor for texto",isblank:"Retorna TRUE se o valor estiver em branco",upper:"Converte o texto em letras maiúsculas",lower:"Converte o texto em minúsculas",product:"Multiplica seus argumentos",sumproduct:"Retorna a soma dos produtos dos componentes do array correspondente",subtotal:"Retorna um subtotal em uma lista ou banco de dados",counta:"Conta quantos valores estão na lista de argumentos",averageif:"Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério",averageifs:"Retorna a média (média aritmética) de todas as células que atendem a vários critérios.",trim:"Remove espaços do texto",sign:"Retorna o sinal de um número",yield:"Retorna o rendimento de um título que paga juros periódicos",abs:"Retorna o valor absoluto de um número",sin:"Retorna o seno do ângulo dado",cos:"Retorna o cosseno de um número",tan:"Retorna a tangente de um número"},validation:{required:"это должно быть необходимо",notMatch:"это не соответствует его правилам проверки",between:"Это между {} и {}",notBetween:"это не между {} и {}",notIn:"его нет в списке",equal:"он равен {}",notEqual:"это не равно {}",lessThan:"это меньше, чем {}",lessThanEqual:"меньше или равно {}",greaterThan:"это больше, чем {}",greaterThanEqual:"это больше или равно {}",downloadImageFail:"Не удалось загрузить изображение"},error:{pasteForMergedCell:"Невозможно выполнить эту операцию с объединенными ячейками"},calendar:{weeks:["Воскресенье понедельник вторник среда четверг пятница суббота"],months:["Январь, февраль, март, апрель, май, июнь, июль, август, сентябрь, октябрь, ноябрь, декабрь"]},button:{add:"добавить в",del:"удалить",next:"Следующий",cancel:"Отмена",remove:"удалять",save:"сохранять",ok:"подтверждать",previous:"Предыдущий",close:"закрытие"},sort:{desc:"Сортировать Я->А",asc:"Сортировать А->Я"},filter:{empty:"пустой"},dataValidation:{mode:"модель",range:"диапазон ячеек",criteria:"стандартный",modeType:{cell:"одна ячейка",column:"столбец",row:"линия"},type:{list:"список",number:"цифра",date:"дата",phone:"телефон",email:"электронная почта"},operator:{be:"между",nbe:"не между",lt:"меньше, чем",lte:"меньше или равно",gt:"больше, чем",gte:"больше или равно",eq:"равный",neq:"не равно"}},dataSort:{ci:"объем",criteria:"заказ",casesense:"с учетом регистра",sortby:"Сортировать по",header:"заголовок",msg:"Пожалуйста, выберите другой столбец, отсортированный по полю",msg2:"Область выбора имеет объединенную область, мы не поддерживаем сортировку объединенной области",order:{asc:"Положительная последовательность",desc:"обратный порядок"}},dataSearch:{label:"найти контент",lkinlb:"диапазон поиска",matchwhole:"соответствует всему содержимому",lookin:{values:"текст",formulas:"формула",comments:"аннотация"}},dataComment:{label:"аннотация"}},es:{toolbar:{undo:"revocar",redo:"rehacer",print:"Imprimir",paintformat:"Copiar formato",clearformat:"formato claro",format:"Formato de datos",fontName:"nombre de la fuente",fontSize:"tamaño de fuente",fontBold:"negrita",fontItalic:"letra cursiva",underline:"subrayar",strike:"tachado",color:"color de texto",bgcolor:"color de relleno",border:"marco",merge:"Combinar células",unmerge:"separar celdas",align:"Alineación horizontal",valign:"alineamiento vertical",textwrap:"ajuste de línea",freeze:"rangos fijos",autofilter:"filtrar",formula:"fórmula",more:"Más",sort:"Clasificación",download:"descargar",pagination:"paginación",search:"buscar",commentDefault:"por favor ingrese texto",commentEdit:"editar comentarios",commentRemove:"Eliminar comentario",commentPrevious:"comentario anterior",commentNext:"siguiente comentario",insertImage:"Insertar imagen"},menubar:{undo:"deshacer",redo:"rehacer",print:"Imprimir",paintformat:"Copiar formato",clearformat:"formato claro",format:"Formato de datos",fontName:"Nombre de la fuente:",fontSize:"tamaño de fuente:",fontBold:"negrita",fontItalic:"letra cursiva",underline:"subrayar",strike:"tachado",color:"color de texto",bgcolor:"color de relleno",border:"marco",merge:"Combinar células",unmerge:"separar celdas",align:"Alineación horizontal",valign:"alineamiento vertical",textwrap:"ajuste de línea",freeze:"rangos fijos",autofilter:"filtrar",formula:"fórmula",more:"Más",sort:"Clasificación",download:"Descargar",download_HTML:"Descargar como HTML",download_PDF:"Descargar como PDF",download_Original:"Descargar originales",download_XLSX:"Descargar como XLSX",download_GOOGLE:"Guardar en Google Drive",download_DROPBOX:"Guardar en dropbox",pagination:"paginación",search:"buscar",commentDefault:"por favor ingrese texto",insertSheet:"insertar hoja de trabajo",insertRow:"insertar fila",insertColumn:"insertar columna",link:"enlace",insertComment:"agregar comentario",commentEdit:"editar comentarios",commentRemove:"Eliminar comentario",commentPrevious:"comentario anterior",commentNext:"siguiente comentario",insertImage:"Insertar imagen",fromURL:"de URL",fromLocal:"del local",menuInsert:"añadir",menuComment:"Controlar",menuText:"Formato",menuFont:"fuente",menuEdit:"página delantera",menuFile:"documento"},contextmenu:{copy:"Copiar",cut:"cortar",paste:"pegar",pasteValue:"Pegar solo el valor",pasteFormat:"Pegar solo formato",hide:"esconder",insertRow:"insertar fila",insertColumn:"insertar columna",deleteSheet:"borrar hoja",deleteRow:"borrar fila",deleteColumn:"eliminar columna",deleteCell:"borrar celda",deleteCellText:"eliminar texto de celda",validation:"verificación de datos",sort:"Clasificación",link:"enlace",removeLink:"eliminar enlace",editLink:"editar enlace",openLink:"enlace abierto",download:"descargar",cellprintable:"habilitar exportar",cellnonprintable:"deshabilitar la exportación",celleditable:"permitir la edición",cellnoneditable:"deshabilitar la edición",insertURL:"Ingrese la dirección de la imagen",deleteImage:"borrar imagen",copyImage:"copiar foto",pasteImage:"pegar foto",merge:"unir",unmerge:"desunir",edit:"editar",clear:"limpiar"},link:{emailAddress:"Correo electrónico",emailSubject:"tema",sheetPage:"ubicación del archivo",sheetCell:"referencia de celda",linkTypes:{web:"Página web",sheet:"Este archivo",email:"Correo electrónico"},webUrl:"URL",linkType:"Tipo de enlace"},download:{fileName:"Nombre del archivo",saveType:"Guardar como",saveTypes:{Original:"formato original",XLSX:"formato XLSX",PDF:"formato PDF",HTML:"formato HTML"}},print:{size:"Tamaño de papel",orientation:"orientación de la página",orientations:["horizontal Vertical"]},format:{normal:"común",text:"Texto sin formato",number:"número",percent:"porcentaje",rmb:"RMB",usd:"Dólar",eur:"EUR",date:"fecha",time:"tiempo",datetime:"fecha y hora",duration:"período"},formula:{sum:"Calcula la suma de un conjunto de valores",average:"Calcula la media aritmética de todos los parámetros",max:"Calcula el valor máximo en un conjunto de dígitos",min:"Calcula el valor más pequeño en un conjunto de dígitos",_if:"Según el resultado del juicio lógico de la condición especificada es verdadero o falso, devuelva el resultado del cálculo desencadenado por la condición correspondiente",and:'Devuelve "verdadero" lógico solo si los resultados de los parámetros son ambos "verdaderos" lógicos; de lo contrario, devuelve "falso" lógico',or:'El resultado se devuelve como lógico "falso" solo si todos los valores de los parámetros son lógicamente "falsos", de lo contrario, devuelve lógicamente "verdadero".',concat:"Conectar texto de varios caracteres o datos en celdas juntos",count:"cuenta el número de celdas que contienen números y cuenta los números dentro de la lista de argumentos",sumif:"Agrega las celdas especificadas por un criterio dado",sumifs:"Agrega las celdas en un rango que cumple con múltiples criterios",vlookup:"Busca en la primera columna de una matriz y se mueve por la fila para devolver el valor de una celda",hlookup:"Busca un valor en la fila superior de una tabla o una matriz de valores, y luego devuelve un valor en la misma columna de una fila que especifique en la tabla o matriz.",lookup:"Busca valores en un vector o matriz",match:"Busca valores en una referencia o matriz",rank:"Devuelve el rango de un número en una lista de números",frequency:"Devuelve una distribución de frecuencias como una matriz vertical",text:"Dar formato a un número y convertirlo en texto",left:"Devuelve los caracteres más a la izquierda de un valor de texto",right:"Devuelve los caracteres más a la derecha de un valor de texto",round:"Redondea un número a un número específico de dígitos",index:"Usa un índice para elegir un valor de una referencia o matriz",countif:"Cuenta el número de celdas dentro de un rango que cumple con los criterios dados",countifs:"Cuenta el número de celdas dentro de un rango que cumplen múltiples criterios",mid:"Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que especifique",len:"Devuelve el número de caracteres en una cadena de texto",power:"Devuelve el resultado de un número elevado a una potencia",ceiling:"Redondea un número al entero más cercano o al múltiplo significativo más cercano",floor:"Redondea un número hacia abajo, hacia cero",substitute:"Sustituye texto nuevo por texto antiguo en una cadena de texto",replace:"Reemplaza caracteres dentro del texto",search:"Encuentra un valor de texto dentro de otro (no distingue entre mayúsculas y minúsculas)",find:"Encuentra un valor de texto dentro de otro (distingue entre mayúsculas y minúsculas)",isnumber:"Devuelve VERDADERO si el valor es un número",istext:"Devuelve VERDADERO si el valor es texto",isblank:"Devuelve VERDADERO si el valor está en blanco",upper:"Convierte texto a mayúsculas",lower:"Convierte texto a minúsculas",product:"Multiplica sus argumentos",sumproduct:"Devuelve la suma de los productos de los componentes de matriz correspondientes",subtotal:"Devuelve un subtotal en una lista o base de datos",counta:"Cuenta cuántos valores hay en la lista de argumentos",averageif:"Devuelve el promedio (media aritmética) de todas las celdas en un rango que cumplen con un criterio dado",averageifs:"Devuelve el promedio (media aritmética) de todas las celdas que cumplen varios criterios.",trim:"Quita espacios del texto",sign:"Devuelve el signo de un número",yield:"Devuelve el rendimiento de un valor que paga intereses periódicos",abs:"Devuelve el valor absoluto de un número",sin:"Devuelve el seno del ángulo dado",cos:"Devuelve el coseno de un número",tan:"Devuelve la tangente de un número"},validation:{required:"debe ser requerido",notMatch:"no coincide con sus reglas de validación",between:"Está entre {} y {}",notBetween:"no está entre {} y {}",notIn:"no esta en la lista",equal:"es igual a {}",notEqual:"no es igual a {}",lessThan:"es menos que {}",lessThanEqual:"es menor o igual que {}",greaterThan:"es mayor que {}",greaterThanEqual:"es mayor o igual que {}",downloadImageFail:"Error al descargar la imagen"},error:{pasteForMergedCell:"No se puede realizar esta operación en celdas combinadas"},calendar:{weeks:["Domingo Lunes Martes Miércoles Jueves Viernes Sábado"],months:["Enero, febrero, marzo, abril, mayo, junio, julio, agosto, septiembre, octubre, noviembre, diciembre"]},button:{add:"añadir",del:"borrar",next:"Próximo",cancel:"Cancelar",remove:"eliminar",save:"ahorrar",ok:"confirmar",previous:"Anterior",close:"cierre"},sort:{desc:"Ordenar Z->A",asc:"Ordenar A->Z"},filter:{empty:"vacío"},dataValidation:{mode:"modelo",range:"rango de celdas",criteria:"estándar",modeType:{cell:"unicelular",column:"columna",row:"línea"},type:{list:"lista",number:"dígito",date:"fecha",phone:"Teléfono",email:"correo electrónico"},operator:{be:"entre",nbe:"no entre",lt:"menos que",lte:"Menos que o igual a",gt:"más que el",gte:"Mayor qué o igual a",eq:"igual",neq:"no igual a"}},dataSort:{ci:"alcance",criteria:"orden",casesense:"distingue mayúsculas y minúsculas",sortby:"Ordenar por",header:"título",msg:"Elija una columna diferente ordenada por campo",msg2:"El área de selección tiene un área fusionada, no admitimos ordenar el área fusionada",order:{asc:"secuencia positiva",desc:"orden inverso"}},dataSearch:{label:"encontrar contenido",lkinlb:"rango de búsqueda",matchwhole:"coincide con todo el contenido",lookin:{values:"texto",formulas:"fórmula",comments:"anotación"}},dataComment:{label:"anotación"}},pt:{toolbar:{undo:"revogar",redo:"refazer",print:"Imprimir",paintformat:"Pincel de Formatação",clearformat:"formato claro",format:"Formato de dados",fontName:"nome da fonte",fontSize:"tamanho da fonte",fontBold:"Negrito",fontItalic:"fonte em itálico",underline:"sublinhado",strike:"tachado",color:"cor do texto",bgcolor:"cor de preenchimento",border:"quadro",merge:"Mesclar Células",unmerge:"unmerge células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"quebra de linha",freeze:"fileiras fixas",autofilter:"filtro",formula:"Fórmula",more:"Mais",sort:"Classificação",download:"download",pagination:"paginação",search:"procurar",commentDefault:"por favor digite o texto",commentEdit:"editar comentários",commentRemove:"excluir comentário",commentPrevious:"comentário anterior",commentNext:"próximo comentário",insertImage:"inserir imagem"},menubar:{undo:"desfazer",redo:"refazer",print:"Imprimir",paintformat:"Pincel de Formatação",clearformat:"formato claro",format:"Formato de dados",fontName:"Nome da fonte:",fontSize:"tamanho da fonte:",fontBold:"Negrito",fontItalic:"fonte em itálico",underline:"sublinhado",strike:"tachado",color:"cor do texto",bgcolor:"cor de preenchimento",border:"quadro",merge:"Mesclar Células",unmerge:"unmerge células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"quebra de linha",freeze:"fileiras fixas",autofilter:"filtro",formula:"Fórmula",more:"Mais",sort:"Classificação",download:"download",download_HTML:"Baixar como HTML",download_PDF:"Baixar como PDF",download_Original:"baixar original",download_XLSX:"Baixar como XLSX",download_GOOGLE:"Salvar no Google Drive",download_DROPBOX:"Salvar no Dropbox",pagination:"paginação",search:"procurar",commentDefault:"por favor digite o texto",insertSheet:"inserir planilha",insertRow:"inserir linha",insertColumn:"inserir coluna",link:"link",insertComment:"adicionar comentário",commentEdit:"editar comentários",commentRemove:"excluir comentário",commentPrevious:"comentário anterior",commentNext:"próximo comentário",insertImage:"inserir imagem",fromURL:"da URL",fromLocal:"do local",menuInsert:"adicionar à",menuComment:"Verificar",menuText:"Formatar",menuFont:"Fonte",menuEdit:"primeira página",menuFile:"documento"},contextmenu:{copy:"cópia de",cut:"cortar",paste:"colar",pasteValue:"Cole apenas o valor",pasteFormat:"Colar apenas a formatação",hide:"esconder",insertRow:"inserir linha",insertColumn:"inserir coluna",deleteSheet:"excluir folha",deleteRow:"excluir linha",deleteColumn:"excluir coluna",deleteCell:"excluir célula",deleteCellText:"excluir texto da célula",validation:"verificação de dados",sort:"Classificação",link:"link",removeLink:"excluir link",editLink:"editar link",openLink:"link aberto",download:"download",cellprintable:"habilitar exportação",cellnonprintable:"desabilitar exportação",celleditable:"habilitar a edição",cellnoneditable:"desabilitar a edição",insertURL:"Insira o endereço da imagem",deleteImage:"deletar foto",copyImage:"copiar foto",pasteImage:"colar foto",merge:"fundir",unmerge:"desagregar",edit:"editar",clear:"limpar"},link:{emailAddress:"E-mail",emailSubject:"tema",sheetPage:"localização de arquivo",sheetCell:"referência de célula",linkTypes:{web:"página da Internet",sheet:"este ficheiro",email:"E-mail"},webUrl:"url",linkType:"tipo de link"},download:{fileName:"nome do arquivo",saveType:"Salvar como",saveTypes:{Original:"formato original",XLSX:"Formato XLSX",PDF:"formato PDF",HTML:"formato HTML"}},print:{size:"Tamanho do papel",orientation:"orientação da página",orientations:["horizontal vertical"]},format:{normal:"ordinário",text:"texto simples",number:"número",percent:"percentagem",rmb:"RMB",usd:"Dólar",eur:"EUR",date:"data",time:"tempo",datetime:"data hora",duration:"período"},formula:{sum:"Calcula a soma de um conjunto de valores",average:"Calcula a média aritmética de todos os parâmetros",max:"Calcula o valor máximo em um conjunto de dígitos",min:"Calcula o menor valor em um conjunto de dígitos",_if:"De acordo com o resultado do julgamento lógico da condição especificada é verdadeiro ou falso, retorne o resultado do cálculo acionado pela condição correspondente",and:'Ele retorna "verdadeiro" lógico somente se os resultados dos parâmetros forem "verdadeiros" lógicos, caso contrário, ele retorna "falso" lógico',or:'O resultado é retornado como lógico "falso" somente se todos os valores dos parâmetros forem logicamente "falsos", caso contrário, ele retorna logicamente "verdadeiro"',concat:"Conecte vários caracteres de texto ou dados em células juntos",count:"conta o número de células que contêm números e conta os números dentro da lista de argumentos",sumif:"Adiciona as células especificadas por um determinado critério",sumifs:"Adiciona as células em um intervalo que atendem a vários critérios",vlookup:"Olha na primeira coluna de uma matriz e move-se pela linha para retornar o valor de uma célula",hlookup:"Procura um valor na linha superior de uma tabela ou uma matriz de valores e, em seguida, retorna um valor na mesma coluna de uma linha especificada na tabela ou matriz.",lookup:"Procura valores em um vetor ou array",match:"Procura valores em uma referência ou array",rank:"Retorna a classificação de um número em uma lista de números",frequency:"Retorna uma distribuição de frequência como uma matriz vertical",text:"Formata um número e o converte em texto",left:"Retorna os caracteres mais à esquerda de um valor de texto",right:"Retorna os caracteres mais à direita de um valor de texto",round:"Arredonda um número para um número especificado de dígitos",index:"Usa um índice para escolher um valor de uma referência ou array",countif:"Conta o número de células dentro de um intervalo que atendem aos critérios fornecidos",countifs:"Conta o número de células dentro de um intervalo que atendem a vários critérios",mid:"Retorna um número específico de caracteres de uma string de texto começando na posição que você especificar",len:"Retorna o número de caracteres em uma string de texto",power:"Retorna o resultado de um número elevado a uma potência",ceiling:"Arredonda um número para o inteiro mais próximo ou para o múltiplo de significância mais próximo",floor:"Arredonda um número para baixo, para zero",substitute:"Substitui o novo texto pelo texto antigo em uma string de texto",replace:"Substitui caracteres no texto",search:"Encontra um valor de texto dentro de outro (sem distinção entre maiúsculas e minúsculas)",find:"Encontra um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)",isnumber:"Retorna TRUE se o valor for um número",istext:"Retorna TRUE se o valor for texto",isblank:"Retorna TRUE se o valor estiver em branco",upper:"Converte o texto em letras maiúsculas",lower:"Converte o texto em minúsculas",product:"Multiplica seus argumentos",sumproduct:"Retorna a soma dos produtos dos componentes do array correspondente",subtotal:"Retorna um subtotal em uma lista ou banco de dados",counta:"Conta quantos valores estão na lista de argumentos",averageif:"Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério",averageifs:"Retorna a média (média aritmética) de todas as células que atendem a vários critérios.",trim:"Remove espaços do texto",sign:"Retorna o sinal de um número",yield:"Retorna o rendimento de um título que paga juros periódicos",abs:"Retorna o valor absoluto de um número",sin:"Retorna o seno do ângulo dado",cos:"Retorna o cosseno de um número",tan:"Retorna a tangente de um número"},validation:{required:"deve ser exigido",notMatch:"não corresponde às suas regras de validação",between:"Está entre {} e {}",notBetween:"não está entre {} e {}",notIn:"não está na lista",equal:"é igual a {}",notEqual:"não é igual a {}",lessThan:"é menor que {}",lessThanEqual:"é menor ou igual a {}",greaterThan:"é maior que {}",greaterThanEqual:"é maior ou igual a {}",downloadImageFail:"Falha ao baixar a imagem"},error:{pasteForMergedCell:"Não é possível executar esta operação em células mescladas"},calendar:{weeks:["Domingo segunda terça quarta quinta sexta sábado"],months:["janeiro, fevereiro, março, abril, maio, junho, julho, agosto, setembro, outubro, novembro, dezembro"]},button:{add:"adicionar à",del:"excluir",next:"Próximo",cancel:"Cancelar",remove:"remover",save:"salvar",ok:"confirme",previous:"Anterior",close:"fecho"},sort:{desc:"Ordenar Z->A",asc:"Ordenar A->Z"},filter:{empty:"vazio"},dataValidation:{mode:"modelo",range:"intervalo de células",criteria:"padrão",modeType:{cell:"célula única",column:"coluna",row:"linha"},type:{list:"lista",number:"dígito",date:"data",phone:"Telefone",email:"e-mail"},operator:{be:"entre",nbe:"não entre",lt:"menor que",lte:"menos que ou igual a",gt:"mais do que o",gte:"Melhor que ou igual a",eq:"igual",neq:"não igual a"}},dataSort:{ci:"escopo",criteria:"ordem",casesense:"maiúsculas e minúsculas",sortby:"ordenar por",header:"título",msg:"Escolha uma coluna diferente classificada por campo",msg2:"A área de seleção tem uma área mesclada, não oferecemos suporte para classificação da área mesclada",order:{asc:"sequência positiva",desc:"ordem reversa"}},dataSearch:{label:"encontrar conteúdo",lkinlb:"intervalo de pesquisa",matchwhole:"corresponde a todo o conteúdo",lookin:{values:"texto",formulas:"Fórmula",comments:"anotação"}},dataComment:{label:"anotação"}},id:{toolbar:{undo:"menarik kembali",redo:"mengulangi",print:"Mencetak",paintformat:"Pelukis Format",clearformat:"format yang jelas",format:"Format data",fontName:"nama font",fontSize:"ukuran huruf",fontBold:"huruf tebal",fontItalic:"huruf miring",underline:"menggarisbawahi",strike:"dicoret",color:"warna teks",bgcolor:"mengisi warna",border:"bingkai",merge:"Menggabungkan Sel",unmerge:"memisahkan sel",align:"Penjajaran horizontal",valign:"penjajaran vertikal",textwrap:"bungkus kata",freeze:"peringkat tetap",autofilter:"Saring",formula:"rumus",more:"Lagi",sort:"Klasifikasi",download:"unduh",pagination:"paging",search:"mencari",commentDefault:"harap masukkan teks",commentEdit:"mengedit komentar",commentRemove:"hapus komentar",commentPrevious:"Komentar sebelumnya",commentNext:"komentar berikutnya",insertImage:"menyisipkan gambar"},menubar:{undo:"membuka",redo:"mengulangi",print:"Mencetak",paintformat:"Pelukis Format",clearformat:"format yang jelas",format:"Format data",fontName:"Nama font:",fontSize:"ukuran huruf:",fontBold:"huruf tebal",fontItalic:"huruf miring",underline:"menggarisbawahi",strike:"dicoret",color:"warna teks",bgcolor:"mengisi warna",border:"bingkai",merge:"Menggabungkan Sel",unmerge:"memisahkan sel",align:"Penjajaran horizontal",valign:"penjajaran vertikal",textwrap:"bungkus kata",freeze:"peringkat tetap",autofilter:"Saring",formula:"rumus",more:"Lagi",sort:"Klasifikasi",download:"unduh",download_HTML:"Unduh sebagai HTML",download_PDF:"Unduh sebagai PDF",download_Original:"unduh asli",download_XLSX:"Unduh sebagai XLSX",download_GOOGLE:"Simpan ke Google Drive",download_DROPBOX:"Simpan ke Dropbox",pagination:"paging",search:"mencari",commentDefault:"harap masukkan teks",insertSheet:"menyisipkan lembar kerja",insertRow:"sisipkan baris",insertColumn:"sisipkan kolom",link:"tautan",insertComment:"Tambahkan komentar",commentEdit:"mengedit komentar",commentRemove:"hapus komentar",commentPrevious:"Komentar sebelumnya",commentNext:"komentar berikutnya",insertImage:"menyisipkan gambar",fromURL:"dari URL",fromLocal:"dari lokal",menuInsert:"Tambahkan",menuComment:"Memeriksa",menuText:"Format",menuFont:"font",menuEdit:"halaman Depan",menuFile:"dokumen"},contextmenu:{copy:"menyalin",cut:"untuk memotong",paste:"tempel",pasteValue:"Tempelkan hanya nilainya",pasteFormat:"Hanya tempel pemformatan",hide:"bersembunyi",insertRow:"sisipkan baris",insertColumn:"sisipkan kolom",deleteSheet:"hapus lembar",deleteRow:"hapus baris",deleteColumn:"hapus kolom",deleteCell:"hapus sel",deleteCellText:"menghapus teks sel",validation:"verifikasi data",sort:"Klasifikasi",link:"tautan",removeLink:"hapus tautan",editLink:"tautan edit",openLink:"Buka tautan",download:"unduh",cellprintable:"mengaktifkan ekspor",cellnonprintable:"nonaktifkan ekspor",celleditable:"aktifkan pengeditan",cellnoneditable:"nonaktifkan pengeditan",insertURL:"Masukkan alamat gambar",deleteImage:"hapus gambar",copyImage:"menyalin gambar",pasteImage:"tempel gambar",merge:"menggabungkan",unmerge:"pisahkan",edit:"sunting",clear:"untuk membersihkan"},link:{emailAddress:"Surel",emailSubject:"tema",sheetPage:"lokasi file",sheetCell:"referensi sel",linkTypes:{web:"halaman web",sheet:"file ini",email:"Surel"},webUrl:"url",linkType:"jenis tautan"},download:{fileName:"nama file",saveType:"Simpan sebagai",saveTypes:{Original:"format asli",XLSX:"berformat XLSX",PDF:"format PDF",HTML:"format HTML"}},print:{size:"ukuran kertas",orientation:"orientasi halaman",orientations:["horisontal vertikal"]},format:{normal:"biasa",text:"teks biasa",number:"nomor",percent:"persentase",rmb:"RMB",usd:"Dolar",eur:"EUR",date:"tanggal",time:"waktu",datetime:"tanggal Waktu",duration:"periode"},formula:{sum:"Menghitung jumlah dari sekumpulan nilai",average:"Menghitung rata-rata aritmatika dari semua parameter",max:"Menghitung nilai maksimum dalam satu set digit",min:"Menghitung nilai terkecil dalam satu set digit",_if:"Menurut hasil penilaian logis dari kondisi yang ditentukan benar atau salah, kembalikan hasil perhitungan yang dipicu oleh kondisi yang sesuai",and:'Ini mengembalikan logika "benar" hanya jika hasil dari parameter keduanya logis "benar", jika tidak maka mengembalikan logika "salah"',or:'Hasilnya dikembalikan sebagai logis "salah" hanya jika semua nilai parameter secara logis "salah", jika tidak, hasilnya secara logis "benar"',concat:"Hubungkan beberapa karakter teks atau data dalam sel bersama-sama",count:"menghitung jumlah sel yang berisi angka, dan menghitung angka dalam daftar argumen",sumif:"Menambahkan sel yang ditentukan oleh kriteria tertentu",sumifs:"Menambahkan sel dalam rentang yang memenuhi beberapa kriteria",vlookup:"Tampak di kolom pertama larik dan bergerak melintasi baris untuk mengembalikan nilai sel",hlookup:"Mencari nilai di baris atas tabel atau larik nilai, lalu mengembalikan nilai di kolom yang sama dari baris yang Anda tentukan di tabel atau larik.",lookup:"Mencari nilai dalam vektor atau larik",match:"Mencari nilai dalam referensi atau larik",rank:"Mengembalikan peringkat nomor dalam daftar nomor",frequency:"Mengembalikan distribusi frekuensi sebagai larik vertikal",text:"Memformat angka dan mengubahnya menjadi teks",left:"Mengembalikan karakter paling kiri dari nilai teks",right:"Mengembalikan karakter paling kanan dari nilai teks",round:"Membulatkan angka ke jumlah digit yang ditentukan",index:"Menggunakan indeks untuk memilih nilai dari referensi atau larik",countif:"Menghitung jumlah sel dalam rentang yang memenuhi kriteria yang diberikan",countifs:"Menghitung jumlah sel dalam rentang yang memenuhi beberapa kriteria",mid:"Mengembalikan sejumlah karakter tertentu dari string teks mulai dari posisi yang Anda tentukan",len:"Mengembalikan jumlah karakter dalam string teks",power:"Mengembalikan hasil angka yang dipangkatkan",ceiling:"Membulatkan angka ke bilangan bulat terdekat atau ke kelipatan signifikansi terdekat",floor:"Membulatkan angka ke bawah, menuju nol",substitute:"Mengganti teks baru dengan teks lama dalam string teks",replace:"Mengganti karakter dalam teks",search:"Menemukan satu nilai teks di dalam yang lain (tidak peka huruf besar/kecil)",find:"Menemukan satu nilai teks di dalam yang lain (peka huruf besar kecil)",isnumber:"Mengembalikan BENAR jika nilainya berupa angka",istext:"Mengembalikan BENAR jika nilainya adalah teks",isblank:"Mengembalikan BENAR jika nilainya kosong",upper:"Mengubah teks menjadi huruf besar",lower:"Mengubah teks menjadi huruf kecil",product:"Kalikan argumennya",sumproduct:"Mengembalikan jumlah produk dari komponen array yang sesuai",subtotal:"Mengembalikan subtotal dalam daftar atau basis data",counta:"Menghitung berapa banyak nilai dalam daftar argumen",averageif:"Mengembalikan rata-rata (rata-rata aritmatika) dari semua sel dalam rentang yang memenuhi kriteria tertentu",averageifs:"Mengembalikan rata-rata (rata-rata aritmatika) dari semua sel yang memenuhi beberapa kriteria.",trim:"Menghapus spasi dari teks",sign:"Mengembalikan tanda angka",yield:"Mengembalikan hasil pada sekuritas yang membayar bunga berkala",abs:"Mengembalikan nilai absolut dari angka",sin:"Mengembalikan sinus dari sudut yang diberikan",cos:"Mengembalikan cosinus angka",tan:"Mengembalikan garis singgung sebuah angka"},validation:{required:"itu harus diperlukan",notMatch:"itu tidak cocok dengan aturan validasinya",between:"Itu antara {} dan {}",notBetween:"itu bukan antara {} dan {}",notIn:"itu tidak ada dalam daftar",equal:"itu sama dengan {}",notEqual:"tidak sama dengan {}",lessThan:"kurang dari {}",lessThanEqual:"kurang dari atau sama dengan {}",greaterThan:"ini lebih besar dari {}",greaterThanEqual:"lebih besar atau sama dengan {}",downloadImageFail:"Gagal mengunduh gambar"},error:{pasteForMergedCell:"Tidak dapat melakukan operasi ini pada sel yang digabungkan"},calendar:{weeks:["Minggu Senin Selasa Rabu Kamis Jumat Sabtu"],months:["Januari, Februari, Maret, April, Mei, Juni, Juli, Agustus, September, Oktober, November, Desember"]},button:{add:"Tambahkan",del:"menghapus",next:"Berikutnya",cancel:"Membatalkan",remove:"menghapus",save:"menyimpan",ok:"mengonfirmasi",previous:"Sebelumnya",close:"penutup"},sort:{desc:"Urutkan Z->A",asc:"Urutkan A->Z"},filter:{empty:"kosong"},dataValidation:{mode:"model",range:"jangkauan sel",criteria:"standar",modeType:{cell:"sel tunggal",column:"kolom",row:"garis"},type:{list:"daftar",number:"angka",date:"tanggal",phone:"Telepon",email:"surel"},operator:{be:"di antara",nbe:"tidak diantara",lt:"kurang dari",lte:"kurang dari atau sama dengan",gt:"lebih dari",gte:"lebih dari atau sama dengan",eq:"setara",neq:"tidak sama dengan"}},dataSort:{ci:"cakupan",criteria:"memesan",casesense:"hal - hal sensitif",sortby:"Sortir dengan",header:"judul",msg:"Harap pilih kolom lain yang diurutkan berdasarkan kolom",msg2:"Area pemilihan memiliki area gabungan, kami tidak mendukung penyortiran area gabungan",order:{asc:"Urutan positif",desc:"urutan terbalik"}},dataSearch:{label:"menemukan konten",lkinlb:"rentang pencarian",matchwhole:"cocok dengan seluruh konten",lookin:{values:"teks",formulas:"rumus",comments:"anotasi"}},dataComment:{label:"anotasi"}},fr:{toolbar:{undo:"révoquer",redo:"refaire",print:"Imprimer",paintformat:"Peintre de format",clearformat:"mise en forme claire",format:"Format de données",fontName:"nom de la police",fontSize:"taille de police",fontBold:"Caractères gras",fontItalic:"police en italique",underline:"souligner",strike:"barré",color:"couleur du texte",bgcolor:"la couleur de remplissage",border:"cadre",merge:"Fusionner des cellules",unmerge:"dissocier des cellules",align:"Alignement horizontal",valign:"alignement vertical",textwrap:"retour à la ligne",freeze:"rangs fixes",autofilter:"filtre",formula:"formule",more:"Plus",sort:"Classification",download:"télécharger",pagination:"pagination",search:"recherche",commentDefault:"veuillez entrer du texte",commentEdit:"modifier les commentaires",commentRemove:"supprimer le commentaire",commentPrevious:"Commentaire précédent",commentNext:"commentaire suivant",insertImage:"insérer une image"},menubar:{undo:"annuler",redo:"refaire",print:"Imprimer",paintformat:"Peintre de format",clearformat:"mise en forme claire",format:"Format de données",fontName:"Nom de la police :",fontSize:"taille de police:",fontBold:"Caractères gras",fontItalic:"police en italique",underline:"souligner",strike:"barré",color:"couleur du texte",bgcolor:"la couleur de remplissage",border:"cadre",merge:"Fusionner des cellules",unmerge:"dissocier des cellules",align:"Alignement horizontal",valign:"alignement vertical",textwrap:"retour à la ligne",freeze:"rangs fixes",autofilter:"filtre",formula:"formule",more:"Plus",sort:"Classification",download:"télécharger",download_HTML:"Télécharger au format HTML",download_PDF:"Télécharger au format PDF",download_Original:"télécharger l'original",download_XLSX:"Télécharger au format XLSX",download_GOOGLE:"Enregistrer sur Google Drive",download_DROPBOX:"Enregistrer dans Dropbox",pagination:"pagination",search:"recherche",commentDefault:"veuillez entrer du texte",insertSheet:"insérer une feuille de calcul",insertRow:"insérer une ligne",insertColumn:"insérer une colonne",link:"lien",insertComment:"ajouter un commentaire",commentEdit:"modifier les commentaires",commentRemove:"supprimer le commentaire",commentPrevious:"Commentaire précédent",commentNext:"commentaire suivant",insertImage:"insérer une image",fromURL:"à partir de l'URL",fromLocal:"du local",menuInsert:"Ajouter à",menuComment:"Vérifier",menuText:"Format",menuFont:"Police de caractère",menuEdit:"page de garde",menuFile:"document"},contextmenu:{copy:"copie",cut:"couper",paste:"pâte",pasteValue:"Coller uniquement la valeur",pasteFormat:"Coller la mise en forme uniquement",hide:"cacher",insertRow:"insérer une ligne",insertColumn:"insérer une colonne",deleteSheet:"supprimer une feuille",deleteRow:"Supprimer la ligne",deleteColumn:"supprimer la colonne",deleteCell:"supprimer la cellule",deleteCellText:"supprimer le texte de la cellule",validation:"verification des données",sort:"Classification",link:"lien",removeLink:"supprimer le lien",editLink:"modifier le lien",openLink:"ouvrir le lien",download:"télécharger",cellprintable:"activer l'exportation",cellnonprintable:"désactiver l'exportation",celleditable:"activer la modification",cellnoneditable:"désactiver l'édition",insertURL:"Entrez l'adresse de l'image",deleteImage:"supprimer l'image",copyImage:"copier l'image",pasteImage:"coller une image",merge:"fusionner",unmerge:"dissocier",edit:"modifier",clear:"nettoyer"},link:{emailAddress:"E-mail",emailSubject:"thème",sheetPage:"emplacement du fichier",sheetCell:"référence de cellule",linkTypes:{web:"page web",sheet:"ce fichier",email:"E-mail"},webUrl:"URL",linkType:"type de lien"},download:{fileName:"nom de fichier",saveType:"Enregistrer sous",saveTypes:{Original:"format d'origine",XLSX:"Format XLSX",PDF:"Format PDF",HTML:"Format HTML"}},print:{size:"taille de papier",orientation:"orientation des pages",orientations:["horizontal Vertical"]},format:{normal:"ordinaire",text:"texte brut",number:"nombre",percent:"pourcentage",rmb:"RMB",usd:"Dollar",eur:"EUR",date:"date",time:"temps",datetime:"date et heure",duration:"période"},formula:{sum:"Calcule la somme d'un ensemble de valeurs",average:"Calcule la moyenne arithmétique de tous les paramètres",max:"Calcule la valeur maximale dans un ensemble de chiffres",min:"Calcule la plus petite valeur dans un ensemble de chiffres",_if:"Selon le résultat du jugement logique de la condition spécifiée est vrai ou faux, renvoie le résultat du calcul déclenché par la condition correspondante",and:'Il renvoie "vrai" logique uniquement si les résultats des paramètres sont tous les deux "vrais" logiques, sinon il renvoie "faux" logique',or:'Le résultat est renvoyé comme "faux" logique uniquement si toutes les valeurs des paramètres sont logiquement "faux", sinon il renvoie logiquement "vrai"',concat:"Connecter plusieurs caractères texte ou données dans des cellules ensemble",count:"compte le nombre de cellules contenant des nombres et compte les nombres dans la liste des arguments",sumif:"Ajoute les cellules spécifiées par un critère donné",sumifs:"Ajoute les cellules d'une plage qui répondent à plusieurs critères",vlookup:"Regarde dans la première colonne d'un tableau et se déplace sur la ligne pour renvoyer la valeur d'une cellule",hlookup:"Recherche une valeur dans la ligne supérieure d'un tableau ou d'un tableau de valeurs, puis renvoie une valeur dans la même colonne à partir d'une ligne que vous spécifiez dans le tableau ou le tableau.",lookup:"Recherche des valeurs dans un vecteur ou un tableau",match:"Recherche des valeurs dans une référence ou un tableau",rank:"Renvoie le rang d'un nombre dans une liste de nombres",frequency:"Renvoie une distribution de fréquence sous la forme d'un tableau vertical",text:"Formate un nombre et le convertit en texte",left:"Renvoie les caractères les plus à gauche d'une valeur de texte",right:"Renvoie les caractères les plus à droite d'une valeur de texte",round:"Arrondit un nombre à un nombre de chiffres spécifié",index:"Utilise un index pour choisir une valeur dans une référence ou un tableau",countif:"Compte le nombre de cellules dans une plage qui répondent aux critères donnés",countifs:"Compte le nombre de cellules dans une plage qui répondent à plusieurs critères",mid:"Renvoie un nombre spécifique de caractères d'une chaîne de texte à partir de la position que vous spécifiez",len:"Renvoie le nombre de caractères d'une chaîne de texte",power:"Renvoie le résultat d'un nombre élevé à une puissance",ceiling:"Arrondit un nombre à l'entier le plus proche ou au multiple de signification le plus proche",floor:"Arrondit un nombre vers le bas, vers zéro",substitute:"Remplace le nouveau texte par l'ancien texte dans une chaîne de texte",replace:"Remplace les caractères dans le texte",search:"Trouve une valeur de texte dans une autre (non sensible à la casse)",find:"Trouve une valeur de texte dans une autre (sensible à la casse)",isnumber:"Renvoie TRUE si la valeur est un nombre",istext:"Renvoie TRUE si la valeur est du texte",isblank:"Renvoie TRUE si la valeur est vide",upper:"Convertit le texte en majuscule",lower:"Convertit le texte en minuscules",product:"Multiplie ses arguments",sumproduct:"Renvoie la somme des produits des composants du tableau correspondants",subtotal:"Renvoie un sous-total dans une liste ou une base de données",counta:"Compte le nombre de valeurs dans la liste des arguments",averageif:"Renvoie la moyenne (moyenne arithmétique) de toutes les cellules d'une plage qui répondent à un critère donné",averageifs:"Renvoie la moyenne (moyenne arithmétique) de toutes les cellules répondant à plusieurs critères.",trim:"Supprime les espaces du texte",sign:"Renvoie le signe d'un nombre",yield:"Rend le rendement d'un titre qui paie des intérêts périodiques",abs:"Renvoie la valeur absolue d'un nombre",sin:"Renvoie le sinus de l'angle donné",cos:"Renvoie le cosinus d'un nombre",tan:"Renvoie la tangente d'un nombre"},validation:{required:"ça doit être obligatoire",notMatch:"il ne correspond pas à ses règles de validation",between:"c'est entre {} et {}",notBetween:"ce n'est pas entre {} et {}",notIn:"il n'est pas dans la liste",equal:"il est égal à {}",notEqual:"il n'est pas égal à {}",lessThan:"c'est moins de {}",lessThanEqual:"il est inférieur ou égal à {}",greaterThan:"il est supérieur à {}",greaterThanEqual:"il est supérieur ou égal à {}",downloadImageFail:"Échec du téléchargement de l'image"},error:{pasteForMergedCell:"Impossible d'effectuer cette opération sur des cellules fusionnées"},calendar:{weeks:["Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi"],months:["janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre"]},button:{add:"Ajouter à",del:"supprimer",next:"Suivant",cancel:"Annuler",remove:"retirer",save:"sauvegarder",ok:"confirmer",previous:"Précédent",close:"fermeture"},sort:{desc:"Trier Z->A",asc:"Trier A->Z"},filter:{empty:"vide"},dataValidation:{mode:"modèle",range:"plage de cellules",criteria:"standard",modeType:{cell:"unicellulaire",column:"colonne",row:"doubler"},type:{list:"liste",number:"chiffre",date:"date",phone:"Téléphone",email:"e-mail"},operator:{be:"entre",nbe:"pas entre",lt:"moins que",lte:"inférieur ou égal à",gt:"plus que le",gte:"Plus grand ou égal à",eq:"égal",neq:"pas égal à"}},dataSort:{ci:"portée",criteria:"commande",casesense:"sensible aux majuscules et minuscules",sortby:"Trier par",header:"titre",msg:"Veuillez choisir une autre colonne triée par champ",msg2:"La zone de sélection a une zone fusionnée, nous ne prenons pas en charge le tri de la zone fusionnée",order:{asc:"Séquence positive",desc:"ordre inverse"}},dataSearch:{label:"trouver du contenu",lkinlb:"plage de recherche",matchwhole:"correspond à tout le contenu",lookin:{values:"texte",formulas:"formule",comments:"annotation"}},dataComment:{label:"annotation"}},vi:{toolbar:{undo:"thu hồi",redo:"làm lại",print:"In",paintformat:"Trình vẽ định dạng",clearformat:"định dạng rõ ràng",format:"Định dạng dữ liệu",fontName:"tên phông chữ",fontSize:"cỡ chữ",fontBold:"phông chữ đậm",fontItalic:"phông chữ nghiêng",underline:"gạch dưới",strike:"gạch ngang",color:"văn bản màu",bgcolor:"tô màu",border:"khung",merge:"Hợp nhất các ô",unmerge:"hủy hợp nhất các ô",align:"Căn ngang",valign:"căn lề dọc",textwrap:"gói từ",freeze:"cấp bậc cố định",autofilter:"lọc",formula:"công thức",more:"Hơn",sort:"phân loại",download:"Tải xuống",pagination:"phân trang",search:"tìm kiếm",commentDefault:"vui lòng nhập văn bản",commentEdit:"chỉnh sửa nhận xét",commentRemove:"Xóa nhận xét",commentPrevious:"Nhận xét trước",commentNext:"bình luận tiếp theo",insertImage:"chèn ảnh"},menubar:{undo:"Hoàn tác",redo:"làm lại",print:"In",paintformat:"Trình vẽ định dạng",clearformat:"định dạng rõ ràng",format:"Định dạng dữ liệu",fontName:"Tên phông chữ:",fontSize:"cỡ chữ:",fontBold:"phông chữ đậm",fontItalic:"phông chữ nghiêng",underline:"gạch dưới",strike:"gạch ngang",color:"văn bản màu",bgcolor:"tô màu",border:"khung",merge:"Hợp nhất các ô",unmerge:"hủy hợp nhất các ô",align:"Căn ngang",valign:"căn lề dọc",textwrap:"gói từ",freeze:"cấp bậc cố định",autofilter:"lọc",formula:"công thức",more:"Hơn",sort:"phân loại",download:"Tải xuống",download_HTML:"Tải xuống dưới dạng HTML",download_PDF:"Tải xuống dưới dạng PDF",download_Original:"tải xuống bản gốc",download_XLSX:"Tải xuống dưới dạng XLSX",download_GOOGLE:"Lưu vào Google Drive",download_DROPBOX:"Lưu vào hộp chứa",pagination:"phân trang",search:"tìm kiếm",commentDefault:"vui lòng nhập văn bản",insertSheet:"chèn bảng tính",insertRow:"Chèn hàng",insertColumn:"chèn cột",link:"liên kết",insertComment:"thêm bình luận",commentEdit:"chỉnh sửa bình luận",commentRemove:"Xóa nhận xét",commentPrevious:"Nhận xét trước",commentNext:"bình luận tiếp theo",insertImage:"chèn ảnh",fromURL:"từ URL",fromLocal:"từ địa phương",menuInsert:"Thêm vào",menuComment:"Kiểm tra",menuText:"Định dạng",menuFont:"nét chữ",menuEdit:"trang đầu",menuFile:"tài liệu"},contextmenu:{copy:"sao chép",cut:"cắt",paste:"dán",pasteValue:"Chỉ dán giá trị",pasteFormat:"Chỉ dán định dạng",hide:"trốn",insertRow:"Chèn hàng",insertColumn:"chèn cột",deleteSheet:"xóa tờ",deleteRow:"xóa hàng",deleteColumn:"xóa cột",deleteCell:"xóa ô",deleteCellText:"xóa văn bản ô",validation:"xác minh dữ liệu",sort:"phân loại",link:"liên kết",removeLink:"xóa liên kết",editLink:"chỉnh sửa liên kết",openLink:"mở liên kết",download:"Tải xuống",cellprintable:"bật xuất",cellnonprintable:"tắt xuất",celleditable:"cho phép chỉnh sửa",cellnoneditable:"tắt chỉnh sửa",insertURL:"Nhập địa chỉ hình ảnh",deleteImage:"xóa ảnh",copyImage:"sao chép hình ảnh",pasteImage:"dán hình",merge:"hợp nhất",unmerge:"hủy hợp nhất",edit:"biên tập",clear:"xóa"},link:{emailAddress:"E-mail",emailSubject:"chủ đề",sheetPage:"vị trí tập tin",sheetCell:"tham chiếu ô",linkTypes:{web:"trang web",sheet:"tập tin này",email:"E-mail"},webUrl:"url",linkType:"Loại liên kết"},download:{fileName:"tên tập tin",saveType:"Lưu thành",saveTypes:{Original:"định dạng ban đầu",XLSX:"định dạng XLSX",PDF:"định dạng PDF",HTML:"định dạng HTML"}},print:{size:"khổ giấy",orientation:"Định hướng trang",orientations:["ngang Dọc"]},format:{normal:"bình thường",text:"văn bản thô",number:"con số",percent:"phần trăm",rmb:"nhân dân tệ",usd:"đô la",eur:"EUR",date:"ngày",time:"thời gian",datetime:"ngày giờ",duration:"Giai đoạn"},formula:{sum:"Tính tổng của một tập hợp các giá trị",average:"Tính giá trị trung bình cộng của tất cả các tham số",max:"Tính giá trị lớn nhất trong một tập hợp các chữ số",min:"Tính giá trị nhỏ nhất trong một tập hợp các chữ số",_if:"Theo kết quả phán đoán logic của điều kiện đã chỉ định là đúng hay sai, trả về kết quả tính toán được kích hoạt bởi điều kiện tương ứng",and:'Nó chỉ trả về logic "true" nếu kết quả của các tham số đều logic "true", nếu không, nó trả về logic "false"',or:'Kết quả chỉ được trả về dưới dạng logic "false" nếu tất cả các giá trị tham số là "false" về mặt logic, nếu không, nó trả về dạng logic "true"',concat:"Kết nối nhiều ký tự văn bản hoặc dữ liệu trong các ô với nhau",count:"đếm số ô chứa số và đếm số trong danh sách đối số",sumif:"Thêm các ô được chỉ định bởi một tiêu chí nhất định",sumifs:"Thêm các ô trong một phạm vi đáp ứng nhiều tiêu chí",vlookup:"Tìm trong cột đầu tiên của một mảng và di chuyển qua hàng để trả về giá trị của một ô",hlookup:"Tìm kiếm một giá trị ở hàng trên cùng của một bảng hoặc một mảng các giá trị, sau đó trả về một giá trị trong cùng một cột từ một hàng mà bạn chỉ định trong bảng hoặc mảng.",lookup:"Tra cứu các giá trị trong một vectơ hoặc mảng",match:"Tra cứu các giá trị trong một tham chiếu hoặc mảng",rank:"Trả về thứ hạng của một số trong danh sách các số",frequency:"Trả về phân bố tần suất dưới dạng mảng dọc",text:"Định dạng một số và chuyển đổi nó thành văn bản",left:"Trả về các ký tự ngoài cùng bên trái từ một giá trị văn bản",right:"Trả về các ký tự ngoài cùng bên phải từ một giá trị văn bản",round:"Làm tròn một số thành một số chữ số đã chỉ định",index:"Sử dụng chỉ mục để chọn giá trị từ tham chiếu hoặc mảng",countif:"Đếm số lượng ô trong một phạm vi đáp ứng tiêu chí đã cho",countifs:"Đếm số lượng ô trong một phạm vi đáp ứng nhiều tiêu chí",mid:"Trả về một số ký tự cụ thể từ một chuỗi văn bản bắt đầu từ vị trí bạn chỉ định",len:"Trả về số ký tự trong chuỗi văn bản",power:"Trả về kết quả của một số được nâng lên lũy thừa",ceiling:"Làm tròn một số thành số nguyên gần nhất hoặc bội số gần nhất",floor:"Làm tròn một số xuống, về 0",substitute:"Thay thế văn bản mới cho văn bản cũ trong một chuỗi văn bản",replace:"Thay thế ký tự trong văn bản",search:"Tìm một giá trị văn bản trong một giá trị văn bản khác (không phân biệt chữ hoa chữ thường)",find:"Tìm một giá trị văn bản trong một giá trị văn bản khác (phân biệt chữ hoa chữ thường)",isnumber:"Trả về TRUE nếu giá trị là số",istext:"Trả về TRUE nếu giá trị là văn bản",isblank:"Trả về TRUE nếu giá trị trống",upper:"Chuyển văn bản thành chữ hoa",lower:"Chuyển văn bản thành chữ thường",product:"Nhân lên các đối số của nó",sumproduct:"Trả về tổng tích của các thành phần mảng tương ứng",subtotal:"Trả về tổng phụ trong danh sách hoặc cơ sở dữ liệu",counta:"Đếm xem có bao nhiêu giá trị trong danh sách đối số",averageif:"Trả về giá trị trung bình (trung bình cộng) của tất cả các ô trong một phạm vi đáp ứng một tiêu chí nhất định",averageifs:"Trả về giá trị trung bình (trung bình cộng) của tất cả các ô đáp ứng nhiều tiêu chí.",trim:"Xóa khoảng trắng khỏi văn bản",sign:"Trả về dấu của một số",yield:"Trả về lợi tức của chứng khoán trả lãi định kỳ",abs:"Trả về giá trị tuyệt đối của một số",sin:"Trả về sin của góc đã cho",cos:"Trả về cosin của một số",tan:"Trả về tang của một số"},validation:{required:"nó phải được yêu cầu",notMatch:"nó không phù hợp với quy tắc xác thực của nó",between:"Nó nằm giữa {} và {}",notBetween:"nó không nằm giữa {} và {}",notIn:"nó không có trong danh sách",equal:"nó bằng {}",notEqual:"nó không bằng {}",lessThan:"nó nhỏ hơn {}",lessThanEqual:"nó nhỏ hơn hoặc bằng {}",greaterThan:"nó lớn hơn {}",greaterThanEqual:"nó lớn hơn hoặc bằng {}",downloadImageFail:"Không thể tải xuống hình ảnh"},error:{pasteForMergedCell:"Không thể thực hiện thao tác này trên các ô đã hợp nhất"},calendar:{weeks:["Chủ nhật thứ hai thứ ba thứ tư thứ năm thứ sáu Thứ Bảy"],months:["Tháng 1, tháng 2, tháng 3, tháng 4, tháng 5, tháng 6, tháng 7, tháng 8, tháng 9, tháng 10, tháng 11, tháng 12"]},button:{add:"Thêm vào",del:"xóa bỏ",next:"Kế tiếp",cancel:"Hủy bỏ",remove:"di dời",save:"cứu",ok:"xác nhận",previous:"Trước",close:"Khép kín"},sort:{desc:"Sắp xếp Z->A",asc:"Sắp xếp A->Z"},filter:{empty:"trống"},dataValidation:{mode:"người mẫu",range:"phạm vi ô",criteria:"tiêu chuẩn",modeType:{cell:"đơn bào",column:"cột",row:"đường kẻ"},type:{list:"danh sách",number:"chữ số",date:"ngày",phone:"Điện thoại",email:"e-mail"},operator:{be:"giữa",nbe:"không phải ở giữa",lt:"ít hơn",lte:"ít hơn hoặc bằng",gt:"nhiều hơn",gte:"lớn hơn hoặc bằng",eq:"bình đẳng",neq:"không bằng"}},dataSort:{ci:"phạm vi",criteria:"đặt hàng",casesense:"trường hợp nhạy cảm",sortby:"sắp xếp theo",header:"tiêu đề",msg:"Vui lòng chọn một cột khác được sắp xếp theo trường",msg2:"Khu vực lựa chọn có khu vực đã hợp nhất, chúng tôi không hỗ trợ sắp xếp khu vực đã hợp nhất",order:{asc:"trình tự tích cực",desc:"thứ tự đảo ngược"}},dataSearch:{label:"tìm nội dung",lkinlb:"phạm vi tìm kiếm",matchwhole:"phù hợp với toàn bộ nội dung",lookin:{values:"chữ",formulas:"công thức",comments:"chú thích"}},dataComment:{label:"chú thích"}},ko:{toolbar:{undo:"취소",redo:"다시 하다",print:"인쇄",paintformat:"포맷 페인터",clearformat:"명확한 형식",format:"데이터 형식",fontName:"글꼴 이름",fontSize:"글꼴 크기",fontBold:"글꼴 굵게",fontItalic:"글꼴 이탤릭체",underline:"밑줄",strike:"취소선",color:"텍스트 색상",bgcolor:"채우기 색상",border:"액자",merge:"셀 병합",unmerge:"셀 병합 해제",align:"수평 정렬",valign:"수직 정렬",textwrap:"줄 바꿈",freeze:"고정 순위",autofilter:"필터",formula:"공식",more:"더",sort:"분류",download:"다운로드",pagination:"페이징",search:"찾다",commentDefault:"텍스트를 입력하십시오",commentEdit:"댓글 수정",commentRemove:"댓글 삭제",commentPrevious:"이전 댓글",commentNext:"다음 댓글",insertImage:"그림 삽입"},menubar:{undo:"실행 취소",redo:"다시 하다",print:"인쇄",paintformat:"포맷 페인터",clearformat:"명확한 형식",format:"데이터 형식",fontName:"글꼴 이름:",fontSize:"글꼴 크기:",fontBold:"글꼴 굵게",fontItalic:"글꼴 이탤릭체",underline:"밑줄",strike:"취소선",color:"텍스트 색상",bgcolor:"채우기 색상",border:"액자",merge:"셀 병합",unmerge:"셀 병합 해제",align:"수평 정렬",valign:"수직 정렬",textwrap:"줄 바꿈",freeze:"고정 순위",autofilter:"필터",formula:"공식",more:"더",sort:"분류",download:"다운로드",download_HTML:"HTML로 다운로드",download_PDF:"PDF로 다운로드",download_Original:"원본 다운로드",download_XLSX:"XLSX로 다운로드",download_GOOGLE:"Google 드라이브에 저장",download_DROPBOX:"드롭박스에 저장",pagination:"페이징",search:"찾다",commentDefault:"텍스트를 입력하십시오",insertSheet:"워크시트 삽입",insertRow:"행 삽입",insertColumn:"열 삽입",link:"링크",insertComment:"댓글 추가",commentEdit:"댓글 수정",commentRemove:"댓글 삭제",commentPrevious:"이전 댓글",commentNext:"다음 댓글",insertImage:"그림 삽입",fromURL:"URL에서",fromLocal:"현지에서",menuInsert:"에 추가",menuComment:"확인하다",menuText:"체재",menuFont:"폰트",menuEdit:"첫 장",menuFile:"문서"},contextmenu:{copy:"복사",cut:"자르다",paste:"반죽",pasteValue:"값만 붙여넣기",pasteFormat:"서식만 붙여넣기",hide:"숨다",insertRow:"행 삽입",insertColumn:"열 삽입",deleteSheet:"시트 삭제",deleteRow:"행 삭제",deleteColumn:"열 삭제",deleteCell:"셀 삭제",deleteCellText:"셀 텍스트 삭제",validation:"데이터 검증",sort:"분류",link:"링크",removeLink:"링크 삭제",editLink:"링크 편집",openLink:"링크 열기",download:"다운로드",cellprintable:"내보내기 활성화",cellnonprintable:"내보내기 비활성화",celleditable:"편집 가능",cellnoneditable:"편집 비활성화",insertURL:"이미지 주소 입력",deleteImage:"사진 삭제",copyImage:"사진 복사",pasteImage:"그림 붙여넣기",merge:"병합",unmerge:"병합 해제",edit:"편집하다",clear:"지우다"},link:{emailAddress:"이메일",emailSubject:"주제",sheetPage:"파일 위치",sheetCell:"셀 참조",linkTypes:{web:"웹 페이지",sheet:"이 파일",email:"이메일"},webUrl:"URL",linkType:"링크 유형"},download:{fileName:"파일 이름",saveType:"다른 이름으로 저장",saveTypes:{Original:"원래 형식",XLSX:"XLSX 형식",PDF:"PDF 형식",HTML:"HTML 형식"}},print:{size:"용지 크기",orientation:"페이지 방향",orientations:["수평 수직"]},format:{normal:"평범한",text:"일반 텍스트",number:"숫자",percent:"백분율",rmb:"인민폐",usd:"달러",eur:"유로",date:"날짜",time:"시간",datetime:"날짜 시간",duration:"기간"},formula:{sum:"값 집합의 합계를 계산합니다.",average:"모든 매개변수의 산술 평균을 계산합니다.",max:"일련의 자릿수에서 최대값을 계산합니다.",min:"숫자 집합에서 가장 작은 값을 계산합니다.",_if:"지정된 조건의 논리적 판단 결과가 참 또는 거짓에 따라 해당 조건에 의해 트리거된 계산 결과를 반환합니다.",and:'매개변수의 결과가 둘 다 논리적 "true"인 경우에만 논리적 "true"를 반환하고, 그렇지 않으면 논리적 "false"를 반환합니다.',or:'결과는 모든 매개변수 값이 논리적으로 "false"인 경우에만 논리적 "false"로 반환되고, 그렇지 않으면 논리적으로 "true"로 반환됩니다.',concat:"셀의 여러 문자 텍스트 또는 데이터 연결",count:"숫자를 포함하는 셀의 수를 계산하고 인수 목록 내의 숫자를 계산",sumif:"지정된 기준으로 지정된 셀을 추가합니다.",sumifs:"여러 기준을 충족하는 범위의 셀을 추가합니다.",vlookup:"배열의 첫 번째 열을 보고 행을 가로질러 이동하여 셀 값을 반환합니다.",hlookup:"테이블의 맨 위 행 또는 값 배열에서 값을 검색한 다음 테이블 또는 배열에서 지정한 행에서 동일한 열의 값을 반환합니다.",lookup:"벡터 또는 배열에서 값 조회",match:"참조 또는 배열에서 값 조회",rank:"숫자 목록에서 숫자의 순위를 반환합니다",frequency:"도수 분포를 수직 배열로 반환",text:"숫자를 형식화하고 텍스트로 변환",left:"텍스트 값에서 가장 왼쪽에 있는 문자를 반환합니다.",right:"텍스트 값에서 가장 오른쪽 문자를 반환",round:"숫자를 지정된 자릿수로 반올림",index:"인덱스를 사용하여 참조 또는 배열에서 값을 선택합니다.",countif:"주어진 기준을 충족하는 범위 내의 셀 수를 계산합니다.",countifs:"여러 기준을 충족하는 범위 내의 셀 수를 계산합니다.",mid:"지정한 위치에서 시작하는 텍스트 문자열에서 특정 수의 문자를 반환합니다.",len:"텍스트 문자열의 문자 수를 반환합니다.",power:"숫자의 거듭제곱 결과를 반환합니다.",ceiling:"숫자를 가장 가까운 정수 또는 가장 가까운 유효 배수로 반올림",floor:"숫자를 0에 가깝게 반올림",substitute:"텍스트 문자열의 기존 텍스트를 새 텍스트로 대체",replace:"텍스트 내 문자 교체",search:"다른 텍스트 값 내에서 하나의 텍스트 값 찾기(대소문자 구분 안 함)",find:"다른 텍스트 값 내에서 하나의 텍스트 값 찾기(대소문자 구분)",isnumber:"값이 숫자이면 TRUE를 반환",istext:"값이 텍스트이면 TRUE를 반환",isblank:"값이 비어 있으면 TRUE를 반환",upper:"텍스트를 대문자로 변환",lower:"텍스트를 소문자로 변환",product:"인수를 곱합니다",sumproduct:"해당 배열 구성요소의 곱의 합을 반환합니다.",subtotal:"목록 또는 데이터베이스에서 소계를 반환합니다.",counta:"인수 목록에 얼마나 많은 값이 있는지 계산",averageif:"지정된 기준을 충족하는 범위 내 모든 셀의 평균(산술 평균)을 반환합니다.",averageifs:"여러 기준을 충족하는 모든 셀의 평균(산술 평균)을 반환합니다.",trim:"텍스트에서 공백 제거",sign:"숫자의 부호를 반환합니다",yield:"주기적으로 이자를 지급하는 유가 증권의 수익률을 반환합니다",abs:"숫자의 절대값을 반환합니다.",sin:"주어진 각도의 사인을 반환합니다",cos:"숫자의 코사인을 반환합니다",tan:"숫자의 탄젠트를 반환합니다"},validation:{required:"반드시 필요하다",notMatch:"유효성 검사 규칙과 일치하지 않습니다.",between:"{}와 {} 사이입니다.",notBetween:"{}와 {} 사이가 아닙니다.",notIn:"목록에 없습니다",equal:"{}와 같습니다.",notEqual:"{}와 같지 않습니다.",lessThan:"{}보다 작습니다.",lessThanEqual:"{}보다 작거나 같습니다.",greaterThan:"{}보다 큽니다.",greaterThanEqual:"{}보다 크거나 같습니다.",downloadImageFail:"이미지를 다운로드하지 못했습니다."},error:{pasteForMergedCell:"병합된 셀에서 이 작업을 수행할 수 없습니다."},calendar:{weeks:["일요일 월요일 화요일 수요일 목요일 금요일 토요일"],months:["1월, 2월, 3월, 4월, 5월, 6월, 7월, 8월, 9월, 10월, 11월, 12월"]},button:{add:"에 추가",del:"삭제",next:"다음",cancel:"취소",remove:"제거하다",save:"구하다",ok:"확인하다",previous:"이전의",close:"폐쇄"},sort:{desc:"정렬 Z->A",asc:"정렬 A->Z"},filter:{empty:"비어 있는"},dataValidation:{mode:"모델",range:"셀 범위",criteria:"기준",modeType:{cell:"단세포",column:"열",row:"선"},type:{list:"목록",number:"숫자",date:"날짜",phone:"전화",email:"이메일"},operator:{be:"~ 사이",nbe:"사이가 아니다",lt:"미만",lte:"이하",gt:"보다 더",gte:"보다 크거나 같음",eq:"동일한",neq:"같지 않다"}},dataSort:{ci:"범위",criteria:"주문하다",casesense:"대소문자 구분",sortby:"정렬 기준",header:"제목",msg:"필드별로 정렬된 다른 열을 선택하세요.",msg2:"선택 영역에 병합된 영역이 있습니다. 병합된 영역 정렬을 지원하지 않습니다.",order:{asc:"양성 서열",desc:"역순으로"}},dataSearch:{label:"콘텐츠 찾기",lkinlb:"검색 범위",matchwhole:"전체 내용과 일치",lookin:{values:"텍스트",formulas:"공식",comments:"주석"}},dataComment:{label:"주석"}},it:{toolbar:{undo:"revocare",redo:"rifare",print:"Stampa",paintformat:"Formato pittore",clearformat:"formato chiaro",format:"Formato dei dati",fontName:"nome del carattere",fontSize:"dimensione del font",fontBold:"carattere grassetto",fontItalic:"carattere corsivo",underline:"sottolineare",strike:"barrato",color:"colore del testo",bgcolor:"colore di riempimento",border:"telaio",merge:"Unire le celle",unmerge:"separare le celle",align:"Allineamento orizzontale",valign:"allineamento verticale",textwrap:"a capo automatico",freeze:"ranghi fissi",autofilter:"filtro",formula:"formula",more:"Di più",sort:"Classificazione",download:"scaricamento",pagination:"paginazione",search:"ricerca",commentDefault:"si prega di inserire il testo",commentEdit:"modificare i commenti",commentRemove:"eliminare il commento",commentPrevious:"Commento precedente",commentNext:"prossimo commento",insertImage:"inserire immagine"},menubar:{undo:"disfare",redo:"rifare",print:"Stampa",paintformat:"Formato pittore",clearformat:"formato chiaro",format:"Formato dei dati",fontName:"Nome carattere:",fontSize:"dimensione del font:",fontBold:"carattere grassetto",fontItalic:"carattere corsivo",underline:"sottolineare",strike:"barrato",color:"colore del testo",bgcolor:"colore di riempimento",border:"telaio",merge:"Unire le celle",unmerge:"separare le celle",align:"Allineamento orizzontale",valign:"allineamento verticale",textwrap:"a capo automatico",freeze:"ranghi fissi",autofilter:"filtro",formula:"formula",more:"Di più",sort:"Classificazione",download:"scaricamento",download_HTML:"Scarica come HTML",download_PDF:"Scarica come PDF",download_Original:"scarica originale",download_XLSX:"Scarica come XLSX",download_GOOGLE:"Salva su Google Drive",download_DROPBOX:"Salva su Dropbox",pagination:"paginazione",search:"ricerca",commentDefault:"si prega di inserire il testo",insertSheet:"inserire foglio di lavoro",insertRow:"inserire riga",insertColumn:"inserire colonna",link:"collegamento",insertComment:"Aggiungi un commento",commentEdit:"modificare i commenti",commentRemove:"eliminare il commento",commentPrevious:"Commento precedente",commentNext:"prossimo commento",insertImage:"inserire immagine",fromURL:"dall'URL",fromLocal:"dal locale",menuInsert:"aggiungere a",menuComment:"Controllo",menuText:"Formato",menuFont:"font",menuEdit:"prima pagina",menuFile:"documento"},contextmenu:{copy:"copia",cut:"tagliare",paste:"impasto",pasteValue:"Incolla solo il valore",pasteFormat:"Incolla solo la formattazione",hide:"nascondere",insertRow:"inserire riga",insertColumn:"inserire colonna",deleteSheet:"eliminare foglio",deleteRow:"elimina riga",deleteColumn:"elimina colonna",deleteCell:"eliminare cella",deleteCellText:"eliminare il testo della cella",validation:"verifica dei dati",sort:"Classificazione",link:"collegamento",removeLink:"eliminare il collegamento",editLink:"modifica collegamento",openLink:"link aperto",download:"scaricamento",cellprintable:"abilitare l'esportazione",cellnonprintable:"disabilitare l'esportazione",celleditable:"permettere la modifica",cellnoneditable:"disabilitare la modifica",insertURL:"Inserisci l'indirizzo dell'immagine",deleteImage:"eliminare l'immagine",copyImage:"copia immagine",pasteImage:"incollare l'immagine",merge:"unire",unmerge:"separare",edit:"modificare",clear:"cancellare"},link:{emailAddress:"E-mail",emailSubject:"tema",sheetPage:"posizione del file",sheetCell:"riferimento di cella",linkTypes:{web:"pagina web",sheet:"questa vita",email:"E-mail"},webUrl:"URL",linkType:"tipo di collegamento"},download:{fileName:"nome del file",saveType:"Salva come",saveTypes:{Original:"formato originale",XLSX:"Formato XLSX",PDF:"Formato PDF",HTML:"Formato HTML"}},print:{size:"Misura del foglio",orientation:"orientamento della pagina",orientations:["orizzontale verticale"]},format:{normal:"ordinario",text:"testo semplice",number:"numero",percent:"percentuale",rmb:"RMB",usd:"Dollaro",eur:"euro",date:"data",time:"tempo",datetime:"appuntamento",duration:"periodo"},formula:{sum:"Calcola la somma di un insieme di valori",average:"Calcola la media aritmetica di tutti i parametri",max:"Calcola il valore massimo in un insieme di cifre",min:"Calcola il valore più piccolo in un set di cifre",_if:"A seconda che il risultato del giudizio logico della condizione specificata sia vero o falso, restituisce il risultato del calcolo attivato dalla condizione corrispondente",and:'Restituisce "vero" logico solo se i risultati dei parametri sono entrambi "veri" logici, altrimenti restituisce "falso" logico',or:'Il risultato viene restituito come logico "falso" solo se tutti i valori dei parametri sono logicamente "falsi", altrimenti restituisce logicamente "vero"',concat:"Collega insieme più caratteri di testo o dati nelle celle",count:"conta il numero di celle che contengono numeri e conta i numeri all'interno dell'elenco di argomenti",sumif:"Aggiunge le celle specificate da un determinato criterio",sumifs:"Aggiunge le celle in un intervallo che soddisfano più criteri",vlookup:"Cerca nella prima colonna di un array e si sposta lungo la riga per restituire il valore di una cella",hlookup:"Cerca un valore nella prima riga di una tabella o di un array di valori, quindi restituisce un valore nella stessa colonna da una riga specificata nella tabella o nell'array.",lookup:"Cerca i valori in un vettore o in un array",match:"Cerca i valori in un riferimento o in un array",rank:"Restituisce il rango di un numero in un elenco di numeri",frequency:"Restituisce una distribuzione di frequenza come matrice verticale",text:"Formatta un numero e lo converte in testo",left:"Restituisce i caratteri più a sinistra da un valore di testo",right:"Restituisce i caratteri più a destra da un valore di testo",round:"Arrotonda un numero a un numero di cifre specificato",index:"Utilizza un indice per scegliere un valore da un riferimento o un array",countif:"Conta il numero di celle all'interno di un intervallo che soddisfano i criteri specificati",countifs:"Conta il numero di celle all'interno di un intervallo che soddisfano più criteri",mid:"Restituisce un numero specifico di caratteri da una stringa di testo a partire dalla posizione specificata",len:"Restituisce il numero di caratteri in una stringa di testo",power:"Restituisce il risultato di un numero elevato a potenza",ceiling:"Arrotonda un numero all'intero più vicino o al multiplo significativo più vicino",floor:"Arrotonda un numero per difetto, verso lo zero",substitute:"Sostituisce il nuovo testo con il vecchio testo in una stringa di testo",replace:"Sostituisce i caratteri all'interno del testo",search:"Trova un valore di testo all'interno di un altro (senza distinzione tra maiuscole e minuscole)",find:"Trova un valore di testo all'interno di un altro (con distinzione tra maiuscole e minuscole)",isnumber:"Restituisce TRUE se il valore è un numero",istext:"Restituisce TRUE se il valore è testo",isblank:"Restituisce TRUE se il valore è vuoto",upper:"Converte il testo in maiuscolo",lower:"Converte il testo in minuscolo",product:"Moltiplica i suoi argomenti",sumproduct:"Restituisce la somma dei prodotti dei corrispondenti componenti dell'array",subtotal:"Restituisce un totale parziale in un elenco o database",counta:"Conta quanti valori ci sono nell'elenco degli argomenti",averageif:"Restituisce la media (media aritmetica) di tutte le celle in un intervallo che soddisfano un dato criterio",averageifs:"Restituisce la media (media aritmetica) di tutte le celle che soddisfano più criteri.",trim:"Rimuove gli spazi dal testo",sign:"Restituisce il segno di un numero",yield:"Restituisce il rendimento di un titolo che paga interessi periodici",abs:"Restituisce il valore assoluto di un numero",sin:"Restituisce il seno dell'angolo dato",cos:"Restituisce il coseno di un numero",tan:"Restituisce la tangente di un numero"},validation:{required:"deve essere richiesto",notMatch:"non corrisponde alle sue regole di convalida",between:"È compreso tra {} e {}",notBetween:"non è tra {} e {}",notIn:"non è nella lista",equal:"è uguale a {}",notEqual:"non è uguale a {}",lessThan:"è minore di {}",lessThanEqual:"è minore o uguale a {}",greaterThan:"è maggiore di {}",greaterThanEqual:"è maggiore o uguale a {}",downloadImageFail:"Impossibile scaricare l'immagine"},error:{pasteForMergedCell:"Impossibile eseguire questa operazione sulle celle unite"},calendar:{weeks:["Domenica lunedì martedì mercoledì giovedì venerdì sabato"],months:["Gennaio, Febbraio, Marzo, Aprile, Maggio, Giugno, Luglio, Agosto, Settembre, Ottobre, Novembre, Dicembre"]},button:{add:"aggiungere a",del:"eliminare",next:"Prossimo",cancel:"Annulla",remove:"rimuovere",save:"salva",ok:"Confermare",previous:"Precedente",close:"chiusura"},sort:{desc:"Ordina Z->A",asc:"Ordina A->Z"},filter:{empty:"vuoto"},dataValidation:{mode:"modello",range:"intervallo di celle",criteria:"standard",modeType:{cell:"singola cella",column:"colonna",row:"linea"},type:{list:"elenco",number:"cifra",date:"data",phone:"Telefono",email:"e-mail"},operator:{be:"fra",nbe:"non in mezzo",lt:"meno di",lte:"minore o uguale a",gt:"più del",gte:"maggiore o uguale a",eq:"pari",neq:"non uguale a"}},dataSort:{ci:"scopo",criteria:"ordine",casesense:"maiuscole e minuscole",sortby:"ordina per",header:"titolo",msg:"Scegli una colonna diversa ordinata per campo",msg2:"L'area di selezione ha un'area unita, non supportiamo l'ordinamento dell'area unita",order:{asc:"Sequenza positiva",desc:"ordine inverso"}},dataSearch:{label:"trovare contenuti",lkinlb:"intervallo di ricerca",matchwhole:"corrisponde all'intero contenuto",lookin:{values:"testo",formulas:"formula",comments:"annotazione"}},dataComment:{label:"annotazione"}},ar:{toolbar:{undo:"سحب او إبطال",redo:"إعادة",print:"مطبعة",paintformat:"شكل الرسام",clearformat:"شكل واضح",format:"تنسيق البيانات",fontName:"اسم الخط",fontSize:"حجم الخط",fontBold:"خط عريض",fontItalic:"مائل الخط",underline:"تسطير",strike:"يتوسطه خط",color:"لون الخط",bgcolor:"لون التعبئة",border:"إطار",merge:"دمج الخلايا",unmerge:"فك دمج الخلايا",align:"محاذاة أفقية",valign:"انحياز عمودي",textwrap:"التفاف النص",freeze:"رتب ثابتة",autofilter:"منقي",formula:"معادلة",more:"أكثر",sort:"تصنيف",download:"تحميل",pagination:"الترحيل",search:"يبحث",commentDefault:"الرجاء إدخال النص",commentEdit:"تحرير التعليقات",commentRemove:"حذف تعليق",commentPrevious:"التعليق السابق",commentNext:"التعليق التالي",insertImage:"إدراج الصورة"},menubar:{undo:"الغاء التحميل",redo:"إعادة",print:"مطبعة",paintformat:"شكل الرسام",clearformat:"شكل واضح",format:"تنسيق البيانات",fontName:"اسم الخط:",fontSize:"حجم الخط:",fontBold:"خط عريض",fontItalic:"مائل الخط",underline:"تسطير",strike:"يتوسطه خط",color:"لون الخط",bgcolor:"لون التعبئة",border:"إطار",merge:"دمج الخلايا",unmerge:"فك دمج الخلايا",align:"محاذاة أفقية",valign:"انحياز عمودي",textwrap:"التفاف النص",freeze:"رتب ثابتة",autofilter:"منقي",formula:"معادلة",more:"أكثر",sort:"تصنيف",download:"تحميل",download_HTML:"تنزيل بتنسيق HTML",download_PDF:"تنزيل كملف PDF",download_Original:"تحميل الاصلي",download_XLSX:"تنزيل بتنسيق XLSX",download_GOOGLE:"حفظ في Google Drive",download_DROPBOX:"حفظ إلى المنسدل",pagination:"الترحيل",search:"يبحث",commentDefault:"الرجاء إدخال النص",insertSheet:"أدخل ورقة العمل",insertRow:"الصف إدراج",insertColumn:"إدراج العمود",link:"وصلة",insertComment:"أضف تعليق",commentEdit:"تحرير التعليقات",commentRemove:"حذف تعليق",commentPrevious:"التعليق السابق",commentNext:"التعليق التالي",insertImage:"إدراج الصورة",fromURL:"من URL",fromLocal:"من المحلية",menuInsert:"اضف إليه",menuComment:"يفحص",menuText:"شكل",menuFont:"الخط",menuEdit:"الصفحة الأمامية",menuFile:"وثيقة"},contextmenu:{copy:"ينسخ",cut:"لقطع",paste:"معجون",pasteValue:"الصق القيمة فقط",pasteFormat:"لصق التنسيق فقط",hide:"يخفي",insertRow:"الصف إدراج",insertColumn:"إدراج العمود",deleteSheet:"حذف الورقة",deleteRow:"احذف صف",deleteColumn:"حذف العمود",deleteCell:"حذف الخلية",deleteCellText:"حذف نص الخلية",validation:"التحقق من البيانات",sort:"تصنيف",link:"وصلة",removeLink:"حذف الارتباط",editLink:"تعديل الارتباط",openLink:"افتح الرابط",download:"تحميل",cellprintable:"تمكين التصدير",cellnonprintable:"تعطيل التصدير",celleditable:"تفعيل التحرير",cellnoneditable:"تعطيل التحرير",insertURL:"أدخل عنوان الصورة",deleteImage:"حذف الصورة",copyImage:"نسخ الصورة",pasteImage:"لصق الصورة",merge:"دمج",unmerge:"تفكك",edit:"يحرر",clear:"لتوضيح"},link:{emailAddress:"بريد إلكتروني",emailSubject:"سمة",sheetPage:"مكان الملف",sheetCell:"مرجع الخلية",linkTypes:{web:"صفحة على الإنترنت",sheet:"هذا الملف",email:"بريد إلكتروني"},webUrl:"عنوان url",linkType:"نوع الارتباط"},download:{fileName:"اسم الملف",saveType:"حفظ باسم",saveTypes:{Original:"التنسيق الأصلي",XLSX:"تنسيق XLSX",PDF:"تنسيق PDF",HTML:"تنسيق HTML"}},print:{size:"حجم الورق",orientation:"اتجاه الصفحة",orientations:["افقي عمودي"]},format:{normal:"عادي",text:"نص عادي",number:"رقم",percent:"نسبة مئوية",rmb:"يوان",usd:"دولار",eur:"يورو",date:"تاريخ",time:"وقت",datetime:"وقت التاريخ",duration:"فترة"},formula:{sum:"تحسب مجموع مجموعة من القيم",average:"يحسب المتوسط الحسابي لجميع المعلمات",max:"تحسب القيمة القصوى في مجموعة من الأرقام",min:"تحسب أصغر قيمة في مجموعة من الأرقام",_if:"وفقًا لنتيجة الحكم المنطقي للشرط المحدد هي صواب أو خطأ ، قم بإرجاع نتيجة الحساب التي تم تشغيلها بواسطة الشرط المقابل",and:'تقوم بإرجاع "صواب" منطقيًا فقط إذا كانت نتائج المعلمات "صواب" منطقية ، وإلا فإنها ترجع "خطأ" منطقيًا',or:'يتم إرجاع النتيجة على أنها "خطأ" منطقية فقط إذا كانت جميع قيم المعلمات "خطأ" منطقيًا ، وإلا فإنها ترجع "صواب" منطقيًا',concat:"ربط نصوص أو بيانات متعددة الأحرف في الخلايا معًا",count:"تحسب عدد الخلايا التي تحتوي على أرقام ,وتحسب الأرقام في قائمة الوسائط",sumif:"إضافة الخلايا المحددة بمعايير معينة",sumifs:"إضافة الخلايا في نطاق يلبي معايير متعددة",vlookup:"البحث في العمود الأول من المصفوفة ويتحرك عبر الصف لإرجاع قيمة الخلية",hlookup:"البحث عن قيمة في الصف العلوي من جدول أو مصفوفة من القيم ,ثم إرجاع قيمة في نفس العمود من صف تحدده في الجدول أو المصفوفة.",lookup:"البحث عن القيم في متجه أو مصفوفة",match:"البحث عن القيم في مرجع أو مصفوفة",rank:"إرجاع رتبة رقم في قائمة الأرقام",frequency:"ترجع توزيع التردد كصفيف عمودي",text:"تنسيق رقم وتحويله إلى نص",left:"إرجاع الأحرف الموجودة في أقصى اليسار من قيمة نصية",right:"إرجاع الأحرف الموجودة في أقصى اليمين من قيمة نصية",round:"لتقريب رقم إلى عدد محدد من الأرقام",index:"يستخدم فهرسًا لاختيار قيمة من مرجع أو مصفوفة",countif:"تحسب عدد الخلايا داخل النطاق الذي يفي بالمعايير المحددة",countifs:"تحسب عدد الخلايا الموجودة في النطاق التي تفي بمعايير متعددة",mid:"ترجع عددًا محددًا من الأحرف من سلسلة نصية تبدأ من الموضع الذي تحدده",len:"إرجاع عدد الأحرف في سلسلة نصية",power:"إرجاع نتيجة رقم مرفوع إلى أس",ceiling:"تقريب رقم إلى أقرب عدد صحيح أو إلى أقرب مضاعف ذي أهمية",floor:"تقريب رقم لأسفل باتجاه الصفر",substitute:"استبدال نص جديد بالنص القديم في سلسلة نصية",replace:"يستبدل الأحرف داخل النص",search:"البحث عن قيمة نصية داخل قيمة أخرى (ليست حساسة لحالة الأحرف)",find:"البحث عن قيمة نصية داخل أخرى (حساسة لحالة الأحرف)",isnumber:"ترجع TRUE إذا كانت القيمة رقمًا",istext:"ترجع TRUE إذا كانت القيمة نصًا",isblank:"ترجع TRUE إذا كانت القيمة فارغة",upper:"تحويل النص إلى أحرف كبيرة",lower:"تحويل النص إلى أحرف صغيرة",product:"تضاعف حججها",sumproduct:"إرجاع مجموع حاصل ضرب مكونات المصفوفة المقابلة",subtotal:"إرجاع إجمالي فرعي في قائمة أو قاعدة بيانات",counta:"تحسب عدد القيم الموجودة في قائمة الوسائط",averageif:"إرجاع المتوسط (الوسط الحسابي) لجميع الخلايا في النطاق الذي يفي بمعايير معينة",averageifs:"إرجاع المتوسط (الوسط الحسابي) لجميع الخلايا التي تفي بمعايير متعددة.",trim:"يزيل المسافات من النص",sign:"إرجاع علامة الرقم",yield:"إرجاع العائد على ورقة مالية ذات فائدة دورية",abs:"إعادة القيمة المطلقة لرقم",sin:"إرجاع جيب الزاوية لزاوية معينة",cos:"إرجاع جيب التمام لرقم",tan:"إرجاع ظل الرقم"},validation:{required:"يجب أن يكون مطلوبًا",notMatch:"لا يتطابق مع قواعد التحقق من الصحة الخاصة به",between:"ما بين {} و {}",notBetween:"إنه ليس بين {} و {}",notIn:"ليس في القائمة",equal:"انها تساوي {}",notEqual:"لا تساوي {}",lessThan:"إنه أقل من {}",lessThanEqual:"إنه أصغر من أو يساوي {}",greaterThan:"أكبر من {}",greaterThanEqual:"أكبر من أو يساوي {}",downloadImageFail:"فشل تحميل الصورة"},error:{pasteForMergedCell:"لا يمكن إجراء هذه العملية على الخلايا المدمجة"},calendar:{weeks:["الاحد الاثنين الثلاثاء الاربعاء الخميس الجمعة السبت"],months:["يناير ، فبراير ، مارس ، أبريل ، مايو ، يونيو ، يوليو ، أغسطس ، سبتمبر ، أكتوبر ، نوفمبر ، ديسمبر"]},button:{add:"اضف إليه",del:"يمسح",next:"التالي",cancel:"يلغي",remove:"يزيل",save:"يحفظ",ok:"يتأكد",previous:"سابق",close:"إنهاء"},sort:{desc:"فرز Z-> A",asc:"فرز A-> Z"},filter:{empty:"فارغ"},dataValidation:{mode:"نموذج",range:"نطاق الخلايا",criteria:"معيار",modeType:{cell:"خلية واحدة",column:"عمود",row:"خط"},type:{list:"قائمة",number:"رقم",date:"تاريخ",phone:"هاتف",email:"بريد إلكتروني"},operator:{be:"بين",nbe:"ليس بينهما",lt:"أقل من",lte:"اقل او يساوي",gt:"أكثر من",gte:"أكبر من أو يساوي",eq:"متساوي",neq:"لا يساوي"}},dataSort:{ci:"نِطَاق",criteria:"طلب",casesense:"حساسية الموضوع",sortby:"ترتيب حسب",header:"عنوان",msg:"الرجاء اختيار عمود مختلف مرتبة حسب المجال",msg2:"منطقة التحديد بها منطقة مدمجة ، لا ندعم فرز المنطقة المدمجة",order:{asc:"تسلسل إيجابي",desc:"ترتيب عكسي"}},dataSearch:{label:"العثور على المحتوى",lkinlb:"نطاق البحث",matchwhole:"يطابق المحتوى بأكمله",lookin:{values:"نص",formulas:"معادلة",comments:"حاشية. ملاحظة"}},dataComment:{label:"حاشية. ملاحظة"}},ja:{toolbar:{undo:"取り消す",redo:"やり直す",print:"印刷する",paintformat:"フォーマットペインター",clearformat:"クリアフォーマット",format:"データ形式",fontName:"フォント名",fontSize:"フォントサイズ",fontBold:"太字",fontItalic:"フォント斜体",underline:"下線",strike:"取り消し線",color:"テキストの色",bgcolor:"塗りつぶしの色",border:"フレーム",merge:"セルを結合します",unmerge:"セルの結合を解除する",align:"水平方向の配置",valign:"垂直方向の配置",textwrap:"ワードラップ",freeze:"固定ランク",autofilter:"フィルター",formula:"方式",more:"もっと",sort:"分類",download:"ダウンロード",pagination:"ページング",search:"検索",commentDefault:"テキストを入力してください",commentEdit:"コメントを編集",commentRemove:"コメントを削除",commentPrevious:"前のコメント",commentNext:"次のコメント",insertImage:"画像を挿入"},menubar:{undo:"元に戻す",redo:"やり直す",print:"印刷する",paintformat:"フォーマットペインター",clearformat:"クリアフォーマット",format:"データ形式",fontName:"フォント名:",fontSize:"フォントサイズ:",fontBold:"太字",fontItalic:"フォント斜体",underline:"下線",strike:"取り消し線",color:"テキストの色",bgcolor:"塗りつぶしの色",border:"フレーム",merge:"セルを結合します",unmerge:"セルの結合を解除する",align:"水平方向の配置",valign:"垂直方向の配置",textwrap:"ワードラップ",freeze:"固定ランク",autofilter:"フィルター",formula:"方式",more:"もっと",sort:"分類",download:"ダウンロード",download_HTML:"HTMLとしてダウンロード",download_PDF:"PDFとしてダウンロード",download_Original:"オリジナルをダウンロード",download_XLSX:"XLSXとしてダウンロード",download_GOOGLE:"Google ドライブに保存",download_DROPBOX:"ドロップボックスに保存",pagination:"ページング",search:"検索",commentDefault:"テキストを入力してください",insertSheet:"ワークシートを挿入",insertRow:"行を挿入",insertColumn:"列を挿入",link:"リンク",insertComment:"コメントを追加",commentEdit:"コメントを編集",commentRemove:"コメントを削除",commentPrevious:"前のコメント",commentNext:"次のコメント",insertImage:"画像を挿入",fromURL:"URLから",fromLocal:"ローカルから",menuInsert:"追加",menuComment:"チェック",menuText:"フォーマット",menuFont:"フォント",menuEdit:"表紙",menuFile:"書類"},contextmenu:{copy:"コピー",cut:"切る",paste:"ペースト",pasteValue:"値のみを貼り付けます",pasteFormat:"書式のみ貼り付け",hide:"隠れる",insertRow:"行を挿入",insertColumn:"列を挿入",deleteSheet:"シートを削除",deleteRow:"行を削除",deleteColumn:"列を削除",deleteCell:"セルを削除",deleteCellText:"セルのテキストを削除",validation:"データ検証",sort:"分類",link:"リンク",removeLink:"リンクを削除",editLink:"リンクを編集",openLink:"リンクを開く",download:"ダウンロード",cellprintable:"エクスポートを有効にする",cellnonprintable:"エクスポートを無効にする",celleditable:"編集を有効に",cellnoneditable:"編集を無効にする",insertURL:"画像アドレスを入力",deleteImage:"画像を削除",copyImage:"コピー画像",pasteImage:"絵を貼り付ける",merge:"マージ",unmerge:"マージを解除する",edit:"編集",clear:"クリアする"},link:{emailAddress:"Eメール",emailSubject:"テーマ",sheetPage:"ファイルの場所",sheetCell:"セル参照",linkTypes:{web:"ウェブページ",sheet:"このファイル",email:"Eメール"},webUrl:"URL",linkType:"リンクタイプ"},download:{fileName:"ファイル名",saveType:"名前を付けて保存",saveTypes:{Original:"オリジナルフォーマット",XLSX:"XLSX形式",PDF:"PDF形式",HTML:"HTML形式"}},print:{size:"用紙サイズ",orientation:"ページの向き",orientations:["水平垂直"]},format:{normal:"普通",text:"プレーンテキスト",number:"番号",percent:"パーセンテージ",rmb:"人民元",usd:"ドル",eur:"ユーロ",date:"日にち",time:"時間",datetime:"日付時刻",duration:"期間"},formula:{sum:"一連の値の合計を計算します",average:"すべてのパラメータの算術平均を計算します",max:"一連の桁の最大値を計算します",min:"一連の数字の最小値を計算します",_if:"指定した条件の論理判定結果が真か偽かに従って、該当する条件でトリガーされた計算結果を返す",and:"パラメータの結果が両方とも論理「真」の場合にのみ論理「真」を返し、それ以外の場合は論理「偽」を返します。",or:"結果は、すべてのパラメーター値が論理的に「false」である場合にのみ論理的な「false」として返され、それ以外の場合は論理的に「true」が返されます。",concat:"セル内の複数の文字テキストまたはデータを結合する",count:"数値を含むセルの数をカウントし、引数のリスト内の数値をカウントします",sumif:"特定の条件で指定されたセルを追加します",sumifs:"複数の基準を満たす範囲内のセルを追加します",vlookup:"配列の最初の列を調べ、行全体を移動してセルの値を返します",hlookup:"テーブルまたは値の配列の一番上の行の値を検索し、テーブルまたは配列で指定した行から同じ列の値を返します。",lookup:"ベクトルまたは配列内の値を検索します",match:"参照または配列内の値を検索します",rank:"数値のリスト内の数値のランクを返します",frequency:"度数分布を垂直配列として返します",text:"数値をフォーマットしてテキストに変換",left:"テキスト値から左端の文字を返します",right:"テキスト値から右端の文字を返します",round:"数値を指定された桁数に丸める",index:"インデックスを使用して、参照または配列から値を選択します",countif:"指定された基準を満たす範囲内のセルの数をカウントします",countifs:"複数の基準を満たす範囲内のセルの数をカウントします",mid:"指定した位置から始まるテキスト文字列から特定の文字数を返します",len:"テキスト文字列の文字数を返す",power:"累乗した数値の結果を返します",ceiling:"数値を最も近い整数または最も近い有効倍数に丸めます",floor:"数値をゼロに向かって切り捨てます",substitute:"テキスト文字列内の古いテキストを新しいテキストに置き換えます",replace:"テキスト内の文字を置き換えます",search:"別のテキスト値を検索します (大文字と小文字を区別しません)",find:"別のテキスト値を検索します (大文字と小文字を区別します)",isnumber:"値が数値の場合に TRUE を返します",istext:"値がテキストの場合、TRUE を返します",isblank:"値が空白の場合は TRUE を返します",upper:"テキストを大文字に変換します",lower:"テキストを小文字に変換します",product:"その引数を乗算します",sumproduct:"対応する配列コンポーネントの積の合計を返します",subtotal:"リストまたはデータベースの小計を返します",counta:"引数のリストにある値の数を数えます",averageif:"指定された基準を満たす範囲内のすべてのセルの平均 (算術平均) を返します",averageifs:"複数の基準を満たすすべてのセルの平均 (算術平均) を返します。",trim:"テキストからスペースを削除します",sign:"数値の符号を返します",yield:"定期的に利息を支払う証券の利回りを返します",abs:"数値の絶対値を返します",sin:"指定された角度の正弦を返します",cos:"数値のコサインを返します",tan:"数値のタンジェントを返します"},validation:{required:"必須でなければなりません",notMatch:"検証ルールと一致しません",between:"{} と {} の間にあります",notBetween:"{} と {} の間にありません",notIn:"それはリストにありません",equal:"{} に等しい",notEqual:"{} と等しくありません",lessThan:"{} 未満です",lessThanEqual:"{}以下です",greaterThan:"{} より大きい",greaterThanEqual:"{}以上です",downloadImageFail:"画像のダウンロードに失敗しました"},error:{pasteForMergedCell:"結合されたセルに対してこの操作を実行できません"},calendar:{weeks:["日曜日月曜日火曜日水曜日の木曜日金曜日土曜日"],months:["1月、2月、3月、4月、5月、6月、7月、8月、9月、10月、11月、12月"]},button:{add:"追加",del:"消去",next:"次",cancel:"キャンセル",remove:"削除",save:"保存",ok:"確認",previous:"前",close:"閉鎖"},sort:{desc:"Z->A で並べ替え",asc:"A->Z で並べ替え"},filter:{empty:"空"},dataValidation:{mode:"モデル",range:"セル範囲",criteria:"標準",modeType:{cell:"単細胞",column:"桁",row:"ライン"},type:{list:"リスト",number:"桁",date:"日にち",phone:"電話",email:"Eメール"},operator:{be:"間",nbe:"間にない",lt:"未満",lte:"以下",gt:"以上",gte:"以上",eq:"同等",neq:"等しくない"}},dataSort:{ci:"範囲",criteria:"注文",casesense:"大文字と小文字を区別",sortby:"並び替え",header:"タイトル",msg:"フィールドでソートされた別の列を選択してください",msg2:"選択領域には結合領域があります。結合領域の並べ替えはサポートされていません",order:{asc:"ポジティブシーケンス",desc:"逆順"}},dataSearch:{label:"コンテンツを見つける",lkinlb:"検索範囲",matchwhole:"コンテンツ全体に一致",lookin:{values:"文章",formulas:"方式",comments:"注釈"}},dataComment:{label:"注釈"}},tr:{toolbar:{undo:"geri çekmek",redo:"yeniden yapmak",print:"Yazdır",paintformat:"Biçim boyacısı",clearformat:"formatı temizle",format:"Veri formatı",fontName:"Yazı tipi adı",fontSize:"yazı Boyutu",fontBold:"Yazı tipi kalın",fontItalic:"italik yazı tipi",underline:"altını çizmek",strike:"üstü çizili",color:"metin rengi",bgcolor:"dolgu rengi",border:"çerçeve",merge:"Hücreleri Birleştir",unmerge:"hücreleri ayır",align:"Yatay hizalama",valign:"dikey hizalama",textwrap:"kelime sarma",freeze:"sabit rütbeler",autofilter:"filtre",formula:"formül",more:"Daha",sort:"sınıflandırma",download:"indirmek",pagination:"çağrı",search:"aramak",commentDefault:"lütfen metni girin",commentEdit:"yorumları düzenle",commentRemove:"yorumu sil",commentPrevious:"Önceki yorum",commentNext:"sonraki yorum",insertImage:"resim ekle"},menubar:{undo:"geri alma",redo:"yeniden yapmak",print:"Yazdır",paintformat:"Biçim boyacısı",clearformat:"formatı temizle",format:"Veri formatı",fontName:"Yazı tipi adı:",fontSize:"yazı Boyutu:",fontBold:"Yazı tipi kalın",fontItalic:"italik yazı tipi",underline:"altını çizmek",strike:"üstü çizili",color:"metin rengi",bgcolor:"dolgu rengi",border:"çerçeve",merge:"Hücreleri Birleştir",unmerge:"hücreleri ayır",align:"Yatay hizalama",valign:"dikey hizalama",textwrap:"kelime sarma",freeze:"sabit rütbeler",autofilter:"filtre",formula:"formül",more:"Daha",sort:"sınıflandırma",download:"indirmek",download_HTML:"HTML olarak indir",download_PDF:"PDF olarak indir",download_Original:"orijinali indir",download_XLSX:"XLSX olarak indir",download_GOOGLE:"Google Drive'a kaydet",download_DROPBOX:"Dropbox'a kaydet",pagination:"çağrı",search:"aramak",commentDefault:"lütfen metni girin",insertSheet:"çalışma sayfası ekle",insertRow:"satır ekle",insertColumn:"sütun ekle",link:"bağlantı",insertComment:"yorum ekle",commentEdit:"yorumları düzenle",commentRemove:"yorumu sil",commentPrevious:"Önceki yorum",commentNext:"sonraki yorum",insertImage:"resim ekle",fromURL:"URL'den",fromLocal:"yerelden",menuInsert:"a ekle",menuComment:"Kontrol etmek",menuText:"Biçim",menuFont:"yazı tipi",menuEdit:"ön Sayfa",menuFile:"belge"},contextmenu:{copy:"kopyalamak",cut:"kesmek",paste:"yapıştırmak",pasteValue:"Yalnızca değeri yapıştırın",pasteFormat:"Yalnızca biçimlendirmeyi yapıştır",hide:"saklamak",insertRow:"satır ekle",insertColumn:"sütun ekle",deleteSheet:"sayfayı sil",deleteRow:"sırayı sil",deleteColumn:"sütunu sil",deleteCell:"hücreyi sil",deleteCellText:"hücre metnini sil",validation:"Veri doğrulama",sort:"sınıflandırma",link:"bağlantı",removeLink:"bağlantıyı sil",editLink:"bağlantıyı düzenle",openLink:"linki aç",download:"indirmek",cellprintable:"dışa aktarmayı etkinleştir",cellnonprintable:"dışa aktarmayı devre dışı bırak",celleditable:"düzenlemeyi etkinleştir",cellnoneditable:"düzenlemeyi devre dışı bırak",insertURL:"Resim adresini girin",deleteImage:"resmi sil",copyImage:"resmi kopyala",pasteImage:"resim yapıştır",merge:"birleştirmek",unmerge:"çözmek",edit:"düzenlemek",clear:"temizlemek için"},link:{emailAddress:"e-posta",emailSubject:"tema",sheetPage:"dosya konumu",sheetCell:"hücre referansı",linkTypes:{web:"web sayfası",sheet:"bu dosya",email:"e-posta"},webUrl:"url",linkType:"bağlantı türü"},download:{fileName:"dosya adı",saveType:"Farklı kaydet",saveTypes:{Original:"orijinal biçim",XLSX:"XLSX formatı",PDF:"PDF biçimi",HTML:"HTML biçimi"}},print:{size:"kağıt boyutu",orientation:"Sayfa yönlendirmesi",orientations:["yatay dikey"]},format:{normal:"sıradan",text:"düz metin",number:"sayı",percent:"yüzde",rmb:"Yuan",usd:"Dolar",eur:"EUR",date:"tarih",time:"zaman",datetime:"tarih saat",duration:"dönem"},formula:{sum:"Bir dizi değerin toplamını hesaplar",average:"Tüm parametrelerin aritmetik ortalamasını hesaplar",max:"Bir dizi basamaktaki maksimum değeri hesaplar",min:"Bir dizi basamaktaki en küçük değeri hesaplar",_if:"Belirtilen koşulun mantıksal yargı sonucuna göre doğru veya yanlış, karşılık gelen koşul tarafından tetiklenen hesaplama sonucunu döndür",and:'Yalnızca parametrelerin sonuçlarının her ikisi de mantıksal "true" ise mantıksal "true" değerini döndürür, aksi takdirde mantıksal "false" değerini döndürür.',or:'Sonuç, yalnızca tüm parametre değerleri mantıksal olarak "yanlış" ise mantıksal olarak "yanlış" olarak döndürülür, aksi takdirde mantıksal olarak "doğru" olarak döner.',concat:"Hücrelerdeki birden çok karakterli metni veya verileri birbirine bağlayın",count:"sayı içeren hücrelerin sayısını sayar ve bağımsız değişkenler listesindeki sayıları sayar",sumif:"Belirli bir kritere göre belirtilen hücreleri ekler",sumifs:"Birden çok kriteri karşılayan bir aralıktaki hücreleri ekler",vlookup:"Bir dizinin ilk sütununa bakar ve bir hücrenin değerini döndürmek için satır boyunca hareket eder",hlookup:"Bir tablonun veya bir değerler dizisinin üst satırında bir değer arar ve ardından tablo veya dizide belirttiğiniz bir satırdan aynı sütunda bir değer döndürür.",lookup:"Bir vektör veya dizideki değerleri arar",match:"Bir başvuru veya dizideki değerleri arar",rank:"Bir sayı listesindeki bir sayının sırasını döndürür",frequency:"Dikey bir dizi olarak bir frekans dağılımı döndürür",text:"Bir sayıyı biçimlendirir ve metne dönüştürür",left:"Bir metin değerinden en soldaki karakterleri döndürür",right:"Bir metin değerinden en sağdaki karakterleri döndürür",round:"Bir sayıyı belirtilen basamak sayısına yuvarlar",index:"Bir başvurudan veya diziden bir değer seçmek için bir dizin kullanır",countif:"Belirtilen ölçütleri karşılayan bir aralıktaki hücre sayısını sayar",countifs:"Bir aralıktaki birden çok kriteri karşılayan hücre sayısını sayar",mid:"Belirttiğiniz konumdan başlayarak bir metin dizisinden belirli sayıda karakter döndürür",len:"Bir metin dizisindeki karakter sayısını döndürür",power:"Bir kuvvete yükseltilmiş bir sayının sonucunu döndürür",ceiling:"Bir sayıyı en yakın tamsayıya veya en yakın anlamlılık katına yuvarlar",floor:"Bir sayıyı sıfıra doğru aşağı yuvarlar",substitute:"Bir metin dizisindeki eski metnin yerine yeni metni koyar",replace:"Metin içindeki karakterleri değiştirir",search:"Bir metin değerini diğerinin içinde bulur (büyük/küçük harfe duyarlı değildir)",find:"Bir metin değerini diğerinin içinde bulur (büyük/küçük harfe duyarlı)",isnumber:"Değer bir sayı ise DOĞRU döndürür",istext:"Değer metin ise DOĞRU döndürür",isblank:"Değer boşsa DOĞRU döndürür",upper:"Metni büyük harfe dönüştürür",lower:"Metni küçük harfe dönüştürür",product:"Argümanlarını çoğaltır",sumproduct:"Karşılık gelen dizi bileşenlerinin çarpımlarının toplamını döndürür",subtotal:"Listede veya veritabanında bir ara toplam döndürür",counta:"Argüman listesinde kaç tane değer olduğunu sayar",averageif:"Belirli bir kriteri karşılayan bir aralıktaki tüm hücrelerin ortalamasını (aritmetik ortalama) verir",averageifs:"Birden çok kriteri karşılayan tüm hücrelerin ortalamasını (aritmetik ortalama) döndürür.",trim:"Metindeki boşlukları kaldırır",sign:"Bir sayının işaretini döndürür",yield:"Periyodik faiz ödeyen bir menkul kıymetin getirisini verir",abs:"Bir sayının mutlak değerini döndürür",sin:"Verilen açının sinüsünü verir",cos:"Bir sayının kosinüsünü döndürür",tan:"Bir sayının teğetini döndürür"},validation:{required:"gerekli olmalı",notMatch:"doğrulama kurallarına uymuyor",between:"{} ile {} arasındadır",notBetween:"{} ile {} arasında değil",notIn:"listede yok",equal:"{} eşittir",notEqual:"{}'e eşit değil",lessThan:"{} değerinden küçük",lessThanEqual:"{}'den küçük veya eşittir",greaterThan:"{} değerinden büyük",greaterThanEqual:"{}'den büyük veya eşittir",downloadImageFail:"Resim indirilemedi"},error:{pasteForMergedCell:"Birleştirilmiş hücrelerde bu işlem gerçekleştirilemez"},calendar:{weeks:["Pazar Pazartesi Salı Çarşamba Perşembe Cuma Cumartesi"],months:["Ocak, Şubat, Mart, Nisan, Mayıs, Haziran, Temmuz, Ağustos, Eylül, Ekim, Kasım, Aralık"]},button:{add:"a ekle",del:"silmek",next:"Sonraki",cancel:"İptal etmek",remove:"kaldırmak",save:"kaydetmek",ok:"onaylamak",previous:"Öncesi",close:"kapanış"},sort:{desc:"Sırala Z->A",asc:"A->Z Sırala"},filter:{empty:"boş"},dataValidation:{mode:"modeli",range:"hücre aralığı",criteria:"standart",modeType:{cell:"tek hücre",column:"kolon",row:"astar"},type:{list:"liste",number:"hane",date:"tarih",phone:"Telefon",email:"e-posta"},operator:{be:"arasında",nbe:"arasında değil",lt:"daha az",lte:"küçük veya eşit",gt:"daha fazla",gte:"büyük veya eşittir",eq:"eşit",neq:"eşit değil"}},dataSort:{ci:"kapsam",criteria:"emir",casesense:"harfe duyarlı",sortby:"göre sırala",header:"başlık",msg:"Lütfen alana göre sıralanmış farklı bir sütun seçin",msg2:"Seçim alanında birleştirilmiş alan var, birleştirilmiş alanın sıralanmasını desteklemiyoruz",order:{asc:"Pozitif dizi",desc:"Ters sipariş"}},dataSearch:{label:"içerik bul",lkinlb:"arama aralığı",matchwhole:"tüm içerikle eşleşir",lookin:{values:"metin",formulas:"formül",comments:"dipnot"}},dataComment:{label:"dipnot"}},th:{toolbar:{undo:"ถอน",redo:"ทำซ้ำ",print:"พิมพ์",paintformat:"ฟอร์แมตจิตรกร",clearformat:"รูปแบบที่ชัดเจน",format:"รูปแบบข้อมูล",fontName:"ชื่อแบบอักษร",fontSize:"ขนาดตัวอักษร",fontBold:"แบบอักษรตัวหนา",fontItalic:"ตัวอักษรตัวเอียง",underline:"ขีดเส้นใต้",strike:"ขีดทับ",color:"สีข้อความ",bgcolor:"เติมสี",border:"กรอบ",merge:"ผสานเซลล์",unmerge:"ยกเลิกการผสานเซลล์",align:"การจัดตำแหน่งแนวนอน",valign:"การจัดตำแหน่งแนวตั้ง",textwrap:"ตัดคำ",freeze:"อันดับคงที่",autofilter:"กรอง",formula:"สูตร",more:"มากกว่า",sort:"การจัดหมวดหมู่",download:"ดาวน์โหลด",pagination:"เพจ",search:"ค้นหา",commentDefault:"กรุณาใส่ข้อความ",commentEdit:"แก้ไขความคิดเห็น",commentRemove:"ลบความคิดเห็น",commentPrevious:"ความคิดเห็นที่แล้ว",commentNext:"ความคิดเห็นถัดไป",insertImage:"แทรกรูปภาพ"},menubar:{undo:"เลิกทำ",redo:"ทำซ้ำ",print:"พิมพ์",paintformat:"ฟอร์แมตจิตรกร",clearformat:"รูปแบบที่ชัดเจน",format:"รูปแบบข้อมูล",fontName:"ชื่อแบบอักษร:",fontSize:"ขนาดตัวอักษร:",fontBold:"แบบอักษรตัวหนา",fontItalic:"ตัวอักษรตัวเอียง",underline:"ขีดเส้นใต้",strike:"ขีดทับ",color:"สีข้อความ",bgcolor:"เติมสี",border:"กรอบ",merge:"ผสานเซลล์",unmerge:"ยกเลิกการผสานเซลล์",align:"การจัดตำแหน่งแนวนอน",valign:"การจัดตำแหน่งแนวตั้ง",textwrap:"ตัดคำ",freeze:"อันดับคงที่",autofilter:"กรอง",formula:"สูตร",more:"มากกว่า",sort:"การจัดหมวดหมู่",download:"ดาวน์โหลด",download_HTML:"ดาวน์โหลดเป็น HTML",download_PDF:"ดาวน์โหลดเป็น PDF",download_Original:"ดาวน์โหลดต้นฉบับ",download_XLSX:"ดาวน์โหลดเป็น XLSX",download_GOOGLE:"บันทึกไปยัง Google ไดรฟ์",download_DROPBOX:"บันทึกไปยัง Dropbox",pagination:"เพจ",search:"ค้นหา",commentDefault:"กรุณาใส่ข้อความ",insertSheet:"ใส่แผ่นงาน",insertRow:"แทรกแถว",insertColumn:"แทรกคอลัมน์",link:"ลิงค์",insertComment:"เพิ่มความเห็น",commentEdit:"แก้ไขความคิดเห็น",commentRemove:"ลบความคิดเห็น",commentPrevious:"ความคิดเห็นที่แล้ว",commentNext:"ความคิดเห็นถัดไป",insertImage:"แทรกรูปภาพ",fromURL:"จาก URL",fromLocal:"จากท้องถิ่น",menuInsert:"เพิ่ม",menuComment:"ตรวจสอบ",menuText:"รูปแบบ",menuFont:"แบบอักษร",menuEdit:"หน้าแรก",menuFile:"เอกสาร"},contextmenu:{copy:"สำเนา",cut:"ที่จะตัด",paste:"แปะ",pasteValue:"วางเฉพาะค่า",pasteFormat:"วางรูปแบบเท่านั้น",hide:"ซ่อน",insertRow:"แทรกแถว",insertColumn:"แทรกคอลัมน์",deleteSheet:"ลบแผ่นงาน",deleteRow:"ลบแถว",deleteColumn:"ลบคอลัมน์",deleteCell:"ลบเซลล์",deleteCellText:"ลบข้อความในเซลล์",validation:"การตรวจสอบข้อมูล",sort:"การจัดหมวดหมู่",link:"ลิงค์",removeLink:"ลบลิงค์",editLink:"แก้ไขลิงค์",openLink:"เปิดลิ้งค์",download:"ดาวน์โหลด",cellprintable:"เปิดใช้งานการส่งออก",cellnonprintable:"ปิดใช้งานการส่งออก",celleditable:"เปิดใช้งานการแก้ไข",cellnoneditable:"ปิดใช้งานการแก้ไข",insertURL:"ป้อนที่อยู่รูปภาพ",deleteImage:"ลบรูปภาพ",copyImage:"คัดลอกรูปภาพ",pasteImage:"วางรูปภาพ",merge:"ผสาน",unmerge:"ยกเลิกการผสาน",edit:"แก้ไข",clear:"เพื่อล้าง"},link:{emailAddress:"อีเมล",emailSubject:"ธีม",sheetPage:"ตำแหน่งไฟล์",sheetCell:"การอ้างอิงเซลล์",linkTypes:{web:"หน้าเว็บ",sheet:"ไฟล์นี้",email:"อีเมล"},webUrl:"URL",linkType:"ประเภทลิงค์"},download:{fileName:"ชื่อไฟล์",saveType:"บันทึกเป็น",saveTypes:{Original:"รูปแบบเดิม",XLSX:"รูปแบบ XLSX",PDF:"รูปแบบ PDF",HTML:"รูปแบบ HTML"}},print:{size:"ขนาดกระดาษ",orientation:"การวางแนวหน้า",orientations:["แนวนอนแนวตั้ง"]},format:{normal:"สามัญ",text:"ข้อความธรรมดา",number:"ตัวเลข",percent:"เปอร์เซ็นต์",rmb:"หยวน",usd:"ดอลลาร์",eur:"ยูโร",date:"วันที่",time:"เวลา",datetime:"วันเวลา",duration:"ระยะเวลา"},formula:{sum:"คำนวณผลรวมของชุดค่าต่างๆ",average:"คำนวณค่าเฉลี่ยเลขคณิตของพารามิเตอร์ทั้งหมด",max:"คำนวณค่าสูงสุดในชุดของหลัก",min:"คำนวณค่าที่น้อยที่สุดในชุดของหลัก",_if:"ตามผลการตัดสินเชิงตรรกะของเงื่อนไขที่ระบุเป็นจริงหรือเท็จ ให้ส่งคืนผลการคำนวณที่ทริกเกอร์ตามเงื่อนไขที่สอดคล้องกัน",and:'จะส่งกลับตรรกะ "จริง" ก็ต่อเมื่อผลลัพธ์ของพารามิเตอร์มีทั้งตรรกะ "จริง" มิฉะนั้นจะส่งกลับตรรกะ "เท็จ"',or:'ผลลัพธ์จะถูกส่งกลับเป็นตรรกะ "เท็จ" เฉพาะในกรณีที่ค่าพารามิเตอร์ทั้งหมดเป็น "เท็จ" ทางตรรกะ มิฉะนั้นจะส่งกลับทางตรรกะ "จริง"',concat:"เชื่อมต่อข้อความหรือข้อมูลหลายตัวในเซลล์เข้าด้วยกัน",count:"นับจำนวนเซลล์ที่มีตัวเลข และนับจำนวนภายในรายการอาร์กิวเมนต์",sumif:"เพิ่มเซลล์ที่ระบุโดยเกณฑ์ที่กำหนด",sumifs:"เพิ่มเซลล์ในช่วงที่ตรงตามเกณฑ์หลายข้อ",vlookup:"ดูในคอลัมน์แรกของอาร์เรย์และเลื่อนข้ามแถวเพื่อส่งกลับค่าของเซลล์",hlookup:"ค้นหาค่าในแถวบนสุดของตารางหรืออาร์เรย์ของค่า แล้วส่งกลับค่าในคอลัมน์เดียวกันจากแถวที่คุณระบุในตารางหรืออาร์เรย์",lookup:"ค้นหาค่าในเวกเตอร์หรืออาร์เรย์",match:"ค้นหาค่าในการอ้างอิงหรืออาร์เรย์",rank:"ส่งกลับอันดับของตัวเลขในรายการตัวเลข",frequency:"ส่งกลับการแจกแจงความถี่เป็นอาร์เรย์แนวตั้ง",text:"จัดรูปแบบตัวเลขและแปลงเป็นข้อความ",left:"ส่งกลับอักขระซ้ายสุดจากค่าข้อความ",right:"ส่งกลับอักขระที่อยู่ขวาสุดจากค่าข้อความ",round:"ปัดเศษตัวเลขเป็นจำนวนหลักที่ระบุ",index:"ใช้ดัชนีเพื่อเลือกค่าจากการอ้างอิงหรืออาร์เรย์",countif:"นับจำนวนเซลล์ภายในช่วงที่ตรงตามเกณฑ์ที่กำหนด",countifs:"นับจำนวนเซลล์ภายในช่วงที่ตรงตามเกณฑ์หลายข้อ",mid:"ส่งคืนอักขระจำนวนหนึ่งจากสตริงข้อความที่เริ่มต้นที่ตำแหน่งที่คุณระบุ",len:"ส่งกลับจำนวนอักขระในสตริงข้อความ",power:"ส่งคืนผลลัพธ์ของตัวเลขที่ยกกำลัง",ceiling:"ปัดเศษตัวเลขให้เป็นจำนวนเต็มที่ใกล้เคียงที่สุดหรือเป็นผลคูณของนัยสำคัญที่ใกล้ที่สุด",floor:"ปัดตัวเลขลง เข้าหาศูนย์",substitute:"แทนที่ข้อความใหม่สำหรับข้อความเก่าในสตริงข้อความ",replace:"แทนที่อักขระภายในข้อความ",search:"ค้นหาค่าข้อความหนึ่งค่าภายในค่าอื่น (ไม่คำนึงถึงตัวพิมพ์เล็กและใหญ่)",find:"ค้นหาค่าข้อความหนึ่งค่าภายในค่าอื่น (คำนึงถึงตัวพิมพ์เล็กและใหญ่)",isnumber:"ส่งกลับค่า TRUE หากค่าเป็นตัวเลข",istext:"คืนค่า TRUE หากค่าเป็นข้อความ",isblank:"คืนค่า TRUE หากค่าเป็นค่าว่าง",upper:"แปลงข้อความเป็นตัวพิมพ์ใหญ่",lower:"แปลงข้อความเป็นตัวพิมพ์เล็ก",product:"ทวีคูณอาร์กิวเมนต์",sumproduct:"ส่งคืนผลรวมของผลคูณของส่วนประกอบอาร์เรย์ที่สอดคล้องกัน",subtotal:"ส่งคืนผลรวมย่อยในรายการหรือฐานข้อมูล",counta:"นับจำนวนค่าที่อยู่ในรายการอาร์กิวเมนต์",averageif:"ส่งกลับค่าเฉลี่ย (ค่าเฉลี่ยเลขคณิต) ของเซลล์ทั้งหมดในช่วงที่ตรงกับเกณฑ์ที่กำหนด",averageifs:"ส่งกลับค่าเฉลี่ย (ค่าเฉลี่ยเลขคณิต) ของเซลล์ทั้งหมดที่ตรงกับหลายเกณฑ์",trim:"ลบช่องว่างออกจากข้อความ",sign:"ส่งคืนเครื่องหมายของตัวเลข",yield:"ส่งคืนผลตอบแทนของหลักทรัพย์ที่จ่ายดอกเบี้ยเป็นงวด",abs:"คืนค่าสัมบูรณ์ของตัวเลข",sin:"คืนค่าไซน์ของมุมที่กำหนด",cos:"คืนค่าโคไซน์ของตัวเลข",tan:"ส่งคืนแทนเจนต์ของตัวเลข"},validation:{required:"จะต้องมี",notMatch:"ไม่ตรงกับกฎการตรวจสอบ",between:"อยู่ระหว่าง {} ถึง {}",notBetween:"ไม่อยู่ระหว่าง {} ถึง {}",notIn:"มันไม่ได้อยู่ในรายการ",equal:"มันเท่ากับ {}",notEqual:"มันไม่เท่ากับ {}",lessThan:"มีค่าน้อยกว่า {}",lessThanEqual:"มันน้อยกว่าหรือเท่ากับ {}",greaterThan:"มันมากกว่า {}",greaterThanEqual:"มันมากกว่าหรือเท่ากับ {}",downloadImageFail:"ดาวน์โหลดภาพไม่สำเร็จ"},error:{pasteForMergedCell:"ไม่สามารถดำเนินการนี้กับเซลล์ที่ผสาน"},calendar:{weeks:["อาทิตย์, จันทร์, อังคาร, พุธ, พฤหัสบดี, ศุกร์, เสาร์"],months:["มกราคม กุมภาพันธ์ มีนาคม เมษายน พฤษภาคม มิถุนายน กรกฎาคม สิงหาคม กันยายน ตุลาคม พฤศจิกายน ธันวาคม"]},button:{add:"เพิ่ม",del:"ลบ",next:"ต่อไป",cancel:"ยกเลิก",remove:"ลบ",save:"บันทึก",ok:"ยืนยัน",previous:"ก่อนหน้า",close:"ปิด"},sort:{desc:"เรียง Z->A",asc:"เรียง A->Z"},filter:{empty:"ว่างเปล่า"},dataValidation:{mode:"แบบอย่าง",range:"ช่วงเซลล์",criteria:"มาตรฐาน",modeType:{cell:"เซลล์เดียว",column:"คอลัมน์",row:"เส้น"},type:{list:"รายการ",number:"หลัก",date:"วันที่",phone:"โทรศัพท์",email:"อีเมล"},operator:{be:"ระหว่าง",nbe:"ไม่ใช่ระหว่าง",lt:"น้อยกว่า",lte:"น้อยกว่าหรือเท่ากับ",gt:"มากกว่า",gte:"มากกว่าหรือเท่ากับ",eq:"เท่ากัน",neq:"ไม่เท่ากับ"}},dataSort:{ci:"ขอบเขต",criteria:"คำสั่ง",casesense:"กรณีที่สำคัญ",sortby:"จัดเรียงตาม",header:"ชื่อ",msg:"โปรดเลือกคอลัมน์อื่นที่จัดเรียงตามฟิลด์",msg2:"พื้นที่การเลือกมีพื้นที่ที่ผสาน เราไม่สนับสนุนการเรียงลำดับพื้นที่ที่ผสาน",order:{asc:"ลำดับที่เป็นบวก",desc:"ลำดับย้อนกลับ"}},dataSearch:{label:"ค้นหาเนื้อหา",lkinlb:"ช่วงการค้นหา",matchwhole:"ตรงกับเนื้อหาทั้งหมด",lookin:{values:"ข้อความ",formulas:"สูตร",comments:"คำอธิบายประกอบ"}},dataComment:{label:"คำอธิบายประกอบ"}},cht:{toolbar:{undo:"撤銷",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"數據格式",fontName:"字體名稱",fontSize:"字體大小",fontBold:"字體粗體",fontItalic:"字體斜體",underline:"下劃綫",strike:"刪除綫",color:"文字顏色",bgcolor:"填充顏色",border:"邊框",merge:"合併單元格",unmerge:"取消合併單元格",align:"水平對齊",valign:"垂直對齊",textwrap:"文字換行",freeze:"固定行列",autofilter:"過濾器",formula:"公式",more:"更多",sort:"分類",download:"下載",pagination:"分頁",search:"搜索",commentDefault:"請輸入文字",commentEdit:"編輯批注",commentRemove:"删除批注",commentPrevious:"上一條批注",commentNext:"下一條批注",insertImage:"插入圖片"},menubar:{undo:"撤消",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"數據格式",fontName:"字體名稱:",fontSize:"字體大小:",fontBold:"字體粗體",fontItalic:"字體斜體",underline:"下劃綫",strike:"刪除綫",color:"文字顏色",bgcolor:"填充顏色",border:"邊框",merge:"合併單元格",unmerge:"取消合併單元格",align:"水平對齊",valign:"垂直對齊",textwrap:"文字換行",freeze:"固定行列",autofilter:"過濾器",formula:"公式",more:"更多",sort:"分類",download:"下載",download_HTML:"下載為HTML",download_PDF:"下載為PDF",download_Original:"下載原件",download_XLSX:"下載為XLSX",download_GOOGLE:"保存至GoogleDrive",download_DROPBOX:"保存至Dropbox",pagination:"分頁",search:"搜索",commentDefault:"請輸入文字",insertSheet:"插入工作表",insertRow:"插入行",insertColumn:"插入列",link:"連結",insertComment:"添加批注",commentEdit:"編輯批注",commentRemove:"删除批注",commentPrevious:"上一條批注",commentNext:"下一條批注",insertImage:"插入圖片",fromURL:"來自URL",fromLocal:"來自本地",menuInsert:"添加",menuComment:"查看",menuText:"格式",menuFont:"字體",menuEdit:"首頁",menuFile:"文件"},contextmenu:{copy:"複製",cut:"剪切",paste:"粘貼",pasteValue:"僅粘貼值",pasteFormat:"僅粘貼格式",hide:"隱藏",insertRow:"插入行",insertColumn:"插入列",deleteSheet:"删去工作表",deleteRow:"删除行",deleteColumn:"删除列",deleteCell:"删除儲存格",deleteCellText:"删除儲存格文字",validation:"數據驗證",sort:"分類",link:"連結",removeLink:"删除連結",editLink:"編輯連結",openLink:"打開連結",download:"下載",cellprintable:"啟用匯出",cellnonprintable:"禁用匯出",celleditable:"啟用編輯",cellnoneditable:"禁用編輯",insertURL:"輸入影像地址",deleteImage:"删除圖片",copyImage:"複製圖片",pasteImage:"粘貼圖片",merge:"合併",unmerge:"取消合併",edit:"編輯",clear:"清除"},link:{emailAddress:"電子郵箱",emailSubject:"主題",sheetPage:"檔案位置",sheetCell:"儲存格引用",linkTypes:{web:"網頁",sheet:"本檔案",email:"電子郵箱"},webUrl:"網址",linkType:"連結類型"},download:{fileName:"文檔名稱",saveType:"另存為",saveTypes:{Original:"原格式",XLSX:"XLSX格式",PDF:"PDF格式",HTML:"HTML格式"}},print:{size:"紙張大小",orientation:"頁面方向",orientations:["橫向,縱向"]},format:{normal:"普通",text:"純文字",number:"數字",percent:"百分比",rmb:"人民幣",usd:"美元",eur:"歐元",date:"日期",time:"時間",datetime:"日期時間",duration:"期間"},formula:{sum:"計算一組值的總和",average:"計算所有參數的算術平均值",max:"計算一組數位中的最大值",min:"計算一組數位中的最小值",_if:"根據指定條件的邏輯判斷結果的真或假,返回相應條件觸發的計算結果",and:"只有當參數的結果都是邏輯“true”時,它才會返回邏輯“true”,否則返回邏輯“false”",or:"只有當所有參數值在邏輯上都為“false”時,結果才返回為邏輯“false”,否則返回為邏輯上的“true”",concat:"將單元格中的多個字符文本或數據連接在一起",count:"計算包含數字的單元格數量,併計算參數列表中的數字",sumif:"添加給定條件指定的單元格",sumifs:"添加滿足多個條件的範圍內的單元格",vlookup:"查看數組的第一列並跨行移動以返回單元格的值",hlookup:"在表的第一行或值數組中搜索一個值,然後從您在表或數組中指定的行的同一列中返回一個值",lookup:"在向量或數組中查找值",match:"在引用或數組中查找值",rank:"返回一個數字在數字列表中的排名",frequency:"以垂直數組形式返回頻率分佈",text:"格式化數字並將其轉換為文本",left:"返回文本值最左邊的字符",right:"返回文本值中最右邊的字符",round:"將數字四捨五入到指定位數",index:"使用索引從引用或數組中選擇一個值",countif:"計算範圍內滿足給定條件的單元格數",countifs:"計算範圍內滿足多個條件的單元格數",mid:"從指定位置開始的文本字符串中返回特定數量的字符",len:"返回文本字符串中的字符數",power:"返回一個數的冪的結果",ceiling:"將數字四捨五入到最接近的整數或最接近的有效倍數",floor:"將數字向下舍入為零",substitute:"用新文本替換文本字符串中的舊文本",replace:"替換文本中的字符",search:"在另一個文本值中查找一個文本值(不區分大小寫)",find:"在一個文本值中查找另一個文本值(區分大小寫)",isnumber:"如果值為數字則返回 TRUE",istext:"如果值為文本則返回 TRUE",isblank:"如果值為空則返回 TRUE",upper:"將文本轉換為大寫",lower:"將文本轉換為小寫",product:"乘以它的論點",sumproduct:"返回對應數組元素的乘積之和",subtotal:"返回列表或數據庫中的小計",counta:"計算參數列表中有多少個值",averageif:"返回範圍內滿足給定條件的所有單元格的平均值(算術平均值)",averageifs:"返回滿足多個條件的所有單元格的平均值(算術平均值)。",trim:"從文本中刪除空格",sign:"返回數字的符號",yield:"返回支付定期利息的證券的收益率",abs:"返回數字的絕對值",sin:"返回給定角度的正弦值",cos:"返回數字的餘弦值",tan:"返回數字的正切"},validation:{required:"它必須是必需的",notMatch:"它與其驗證規則不匹配",between:"它介於{}和{}之間",notBetween:"它不在{}和{}之間",notIn:"它不在清單中",equal:"它等於{}",notEqual:"它不等於{}",lessThan:"它小於{}",lessThanEqual:"它小於或等於{}",greaterThan:"它大於{}",greaterThanEqual:"它大於或等於{}",downloadImageFail:"下載影像失敗"},error:{pasteForMergedCell:"無法對合併的儲存格執行此操作"},calendar:{weeks:["周日、週一、週二、週三、週四、週五、週六"],months:["一月、二月、三月、四月、五月、六月、七月、八月、九月、十月、十一月、十二月"]},button:{add:"添加",del:"删除",next:"下一個",cancel:"取消",remove:"去除",save:"保存",ok:"確認",previous:"前一個",close:"關閉"},sort:{desc:"排序Z->A",asc:"排序A->Z"},filter:{empty:"空的"},dataValidation:{mode:"模式",range:"儲存格範圍",criteria:"標準",modeType:{cell:"單間牢房",column:"柱",row:"一行"},type:{list:"清單",number:"數位",date:"日期",phone:"電話",email:"電子郵件"},operator:{be:"之間",nbe:"不介於",lt:"少於",lte:"小於或等於",gt:"大於",gte:"大於或等於",eq:"等於",neq:"不等於"}},dataSort:{ci:"範圍",criteria:"順序",casesense:"區分大小寫",sortby:"排序依據",header:"標題",msg:"請選擇按欄位排序的不同列",msg2:"選擇區域有合併區域,我們不支持對合併區域進行排序",order:{asc:"正序",desc:"逆序"}},dataSearch:{label:"查找內容",lkinlb:"查找範圍",matchwhole:"匹配整個內容",lookin:{values:"文本",formulas:"公式",comments:"批注"}},dataComment:{label:"批注"}}};function N(e,t){if(t){var i,n=j(B);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(!t[r])break;for(var a=t[r],o=e.match(/(?:\\.|[^.])+/g),s=0;s<o.length;s+=1){var l=a[o[s]];if(!l)break;if(s===o.length-1)return l;a=l}}}catch(e){n.e(e)}finally{n.f()}}}function U(e){var t=N(e,H);return!t&&window&&window.x_spreadsheet&&window.x_spreadsheet.$messages&&(t=N(e,window.x_spreadsheet.$messages)),t||""}function X(e){return function(){return U(e)}}function q(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i?B=[e]:B.unshift(e),t&&(H[e]=t)}function W(e){H[e]||(e="en"),B[0]=e}var Y={phone:/^[1-9]\d{10}$/,email:/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/};function V(e,t){var i="";if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];i=U.apply(void 0,["validation.".concat(t)].concat(r))}return[e,i]}var G=function(){function e(t,i,n,r){l()(this,e),this.required=i,this.value=n,this.type=t,this.operator=r,this.message=""}return o()(e,[{key:"parseValue",value:function(e){var t=this.type;return"date"===t?new Date(e):"number"===t?Number(e):e}},{key:"equals",value:function(e){var t=this.type===e.type&&this.required===e.required&&this.operator===e.operator;return t&&(t=Array.isArray(this.value)?F.arrayEquals(this.value,e.value):this.value===e.value),t}},{key:"values",value:function(){return this.value.split(",")}},{key:"validate",value:function(e){var t=this.required,i=this.operator,n=this.value,a=this.type;if(t&&/^\s*$/.test(e))return V(!1,"required");if(/^\s*$/.test(e))return[!0];if(Y[a]&&!Y[a].test(e))return V(!1,"notMatch");if("list"===a)return V(this.values().includes(e),"notIn");if(i){var o=this.parseValue(e);if("be"===i){var s=r()(n,2),l=s[0],c=s[1];return V(o>=this.parseValue(l)&&o<=this.parseValue(c),"between",l,c)}if("nbe"===i){var h=r()(n,2),u=h[0],f=h[1];return V(o<this.parseValue(u)||o>this.parseValue(f),"notBetween",u,f)}if("eq"===i)return V(o===this.parseValue(n),"equal",n);if("neq"===i)return V(o!==this.parseValue(n),"notEqual",n);if("lt"===i)return V(o<this.parseValue(n),"lessThan",n);if("lte"===i)return V(o<=this.parseValue(n),"lessThanEqual",n);if("gt"===i)return V(o>this.parseValue(n),"greaterThan",n);if("gte"===i)return V(o>=this.parseValue(n),"greaterThanEqual",n)}return[!0]}}]),e}(),Z=function(){function e(t,i,n){l()(this,e),this.refs=i,this.mode=t,this.validator=n}return o()(e,[{key:"includes",value:function(e,t){for(var i=this.refs,n=0;n<i.length;n+=1){if(x.valueOf(i[n]).includes(e,t))return!0}return!1}},{key:"addRef",value:function(e){this.remove(x.valueOf(e)),this.refs.push(e)}},{key:"remove",value:function(e){var t=[];this.refs.forEach((function(i){var n=x.valueOf(i);n.intersects(e)?n.difference(e).forEach((function(e){return t.push(e.toString())})):t.push(i)})),this.refs=t}},{key:"getData",value:function(){var e=this.refs,t=this.mode,i=this.validator;return{refs:e,mode:t,type:i.type,required:i.required,operator:i.operator,value:i.value}}}],[{key:"valueOf",value:function(t){var i=t.refs,n=t.mode,r=t.type,a=t.required,o=t.operator,s=t.value;return new e(n,i,new G(r,a,s,o))}}]),e}(),K=function(){function e(){l()(this,e),this._=[],this.errors=new Map}return o()(e,[{key:"getError",value:function(e,t){return this.errors.get("".concat(e,"_").concat(t))}},{key:"validate",value:function(e,t,i){var n=this.get(e,t),a="".concat(e,"_").concat(t),o=this.errors;if(null!==n){var s=n.validator.validate(i),l=r()(s,2),c=l[0],h=l[1];c?o.delete(a):o.set(a,h)}else o.delete(a);return!0}},{key:"add",value:function(e,t,i){var n=i.type,r=i.required,a=i.value,o=i.operator,s=new G(n,r,a,o),l=this.getByValidator(s);null!==l?l.addRef(t):this._.push(new Z(e,[t],s))}},{key:"getByValidator",value:function(e){for(var t=0;t<this._.length;t+=1){var i=this._[t];if(i.validator.equals(e))return i}return null}},{key:"get",value:function(e,t){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(e,t))return n}return null}},{key:"remove",value:function(e){var t="".concat(e.sri,"_").concat(e.sci);this.errors.has(t)&&this.errors.delete(t),this.each((function(t){t.remove(e)}))}},{key:"each",value:function(e){this._.forEach((function(t){return e(t)}))}},{key:"getData",value:function(){return this._.filter((function(e){return e.refs.length>0})).map((function(e){return e.getData()}))}},{key:"setData",value:function(e){this._=e.map((function(e){return Z.valueOf(e)}))}}]),e}(),J=function e(){l()(this,e),this.keywords="",this.current=1,this.result=[]},Q=i(3),ee=i.n(Q),te=i(4),ie=i.n(te),ne=i(1),re=i.n(ne),ae="x-spreadsheet";window.devicePixelRatio;function oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var se=function(e){ee()(i,e);var t=oe(i);function i(e){var n;return l()(this,i),(n=t.call(this,"div","".concat(ae,"-icon"))).iconNameEl=f("div","".concat(ae,"-icon-img ").concat(e)),n.child(n.iconNameEl),n}return o()(i,[{key:"setName",value:function(e){this.iconNameEl.className("".concat(ae,"-icon-img ").concat(e))}}]),i}(u);function le(e,t,i){var n=f("div","".concat(ae,"-toast")),r=f("div","".concat(ae,"-dimmer active"));n.children(f("div","".concat(ae,"-toast-header")).children(new se("close").on("click.stop",(function(){return document.body.removeChild(n.el),document.body.removeChild(r.el),void(i&&i())})),e),f("div","".concat(ae,"-toast-content")).html(t)),document.body.appendChild(n.el),document.body.appendChild(r.el);var a=n.box(),o=a.width,s=a.height,l=document.documentElement,c=l.clientHeight,h=l.clientWidth;n.offset({left:(h-o)/2,top:(c-s)/3})}var ce={mode:"edit",updateMode:"client",updateUrl:"",folderName:"",fileName:"",view:{height:function(){return document.documentElement.clientHeight},width:function(){return document.documentElement.clientWidth}},showToolbar:!0,showPartToolbar:!1,showContextmenu:!0,showFileName:!0,row:{len:100,height:25},col:{len:26,width:100,indexWidth:60,minWidth:60},style:{align:"left",valign:"middle",textwrap:!1,strike:!1,underline:!1,color:"#0a0a0a",font:{name:"Arial",size:10,bold:!1,italic:!1},format:"normal"}};function he(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=this.merges,a=t.clone(),o=e.size(),s=r()(o,2),l=s[0],c=s[1],h=t.size(),u=r()(h,2),f=u[0],d=u[1];return l>f&&(a.eri=t.sri+l-1),c>d&&(a.eci=t.sci+c-1),this.getRangeLocked(a)?(i("Protected worksheet,the target area contains locked cells"),!1):n.intersects(a)?(i(U("error.pasteForMergedCell")),!1):e.equals(a)?(i("The selection area is same "),!1):!e.intersects(a)||!(f>l&&Math.abs(t.sri-e.sri)%l!=0||d>c&&Math.abs(t.sci-e.sci)%c!=0)||(i("Invalid selection area"),!1)}function ue(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=this.rows,o=this.merges,s=this.name,l=a.copyPaste(e,t,i,n,(function(e,t,i){if(i&&i.merge){var n=r()(i.merge,2),a=n[0],s=n[1];if(a<=0&&s<=0)return;o.add(new x(e,t,e+a,t+s))}}));n?this.updateBatchCellsOpr(s,l,e,t,i):this.copyPasteRangeOpr(s,e,t,i)}function fe(e,t){var i=this.clipboard,n=this.rows,r=this.merges,a=this.name;n.cutPaste(e,t),r.move(e,t.sri-e.sri,t.sci-e.sci),i.clear(),this.cutPasteRangeOpr(a,e,t)}function de(e,t,i){var n=this.styles,r=this.rows.getCellOrNew(e,t),a={};void 0!==r.style&&(a=F.cloneDeep(n[r.style])),a=F.merge(a,{border:i}),r.style=this.addStyle(a)}function me(e){var t=this,i=e.mode,n=e.style,a=e.color,o=this.styles,s=this.selector,l=this.rows,c=s.range,h=c.sri,u=c.sci,f=c.eri,d=c.eci,m=!this.isSignleSelected();if(m||"inside"!==i&&"horizontal"!==i&&"vertical"!==i)if("outside"!==i||m){if("none"===i)s.range.each((function(e,i){var n=l.getCell(e,i);if(n&&void 0!==n.style){var r=F.cloneDeep(o[n.style]);delete r.border,n.style=t.addStyle(r)}}));else if("all"===i||"inside"===i||"outside"===i||"horizontal"===i||"vertical"===i)!function(){for(var e=[],o=h;o<=f;o+=1)for(var s=u;s<=d;s+=1){for(var c=[],g=0;g<e.length;g+=1){var v=r()(e[g],4),p=v[0],y=v[1],b=v[2],w=v[3];if(o===p+b+1&&c.push(g),p<=o&&o<=p+b&&s===y){s+=w+1;break}}if(c.forEach((function(t){return e.splice(t,1)})),s>d)break;var x=l.getCell(o,s),k=0,C=0;if(x&&x.merge){var S=r()(x.merge,2);k=S[0],C=S[1],e.push([o,s,k,C])}var _=k>0&&o+k===f,T=C>0&&s+C===d,O={};"all"===i?O={bottom:[n,a],top:[n,a],left:[n,a],right:[n,a]}:"inside"===i?(!T&&s<d&&(O.right=[n,a]),!_&&o<f&&(O.bottom=[n,a])):"horizontal"===i?!_&&o<f&&(O.bottom=[n,a]):"vertical"===i?!T&&s<d&&(O.right=[n,a]):"outside"===i&&m&&(h===o&&(O.top=[n,a]),(_||f===o)&&(O.bottom=[n,a]),u===s&&(O.left=[n,a]),(T||d===s)&&(O.right=[n,a])),Object.keys(O).length>0&&de.call(t,o,s,O),s+=C}}();else if("top"===i||"bottom"===i)for(var g=u;g<=d;g+=1)"top"===i&&(de.call(this,h,g,{top:[n,a]}),g+=l.getCellMerge(h,g)[1]),"bottom"===i&&(de.call(this,f,g,{bottom:[n,a]}),g+=l.getCellMerge(f,g)[1]);else if("left"===i||"right"===i)for(var v=h;v<=f;v+=1)"left"===i&&(de.call(this,v,u,{left:[n,a]}),v+=l.getCellMerge(v,u)[0]),"right"===i&&(de.call(this,v,d,{right:[n,a]}),v+=l.getCellMerge(v,d)[0])}else de.call(this,h,u,{top:[n,a],bottom:[n,a],left:[n,a],right:[n,a]})}function ge(e,t){var i=this.rows,n=this.scroll,r=this.freezeTotalHeight(),a=this.settings.row.height,o=this.exceptRowSet;0===n.riact&&this.freeze[0]>0&&(n.riact=this.freeze[0]);var s=a+r,l=e>s?n.riact:0;0===l&&(s=a);for(var c=0;l<i.len&&!(s>e);l+=1)o.has(l)||(s+=c=i.getHeight(l));return{ri:l-1,top:s-=c,height:c}}function ve(e,t){var i=this.cols,n=this.displayRight2Left,a=this.freezeTotalWidth(),o=i.indexWidth;if(n){var s=this.viewWidth();a+i.indexWidth<s-e&&(o-=t);var l=F.rangeReduceIf(0,i.len,o,i.indexWidth,s-e,(function(e){return i.getWidth(e)})),c=r()(l,3),h=c[0],u=c[1],f=c[2];return u<=0?{ci:-1,left:s,width:i.indexWidth}:{ci:h-1,left:s-u,width:f}}a+i.indexWidth<e&&(o-=t);var d=F.rangeReduceIf(0,i.len,o,i.indexWidth,e,(function(e){return i.getWidth(e)})),m=r()(d,3),g=m[0],v=m[1],p=m[2];return v<=0?{ci:-1,left:0,width:i.indexWidth}:{ci:g-1,left:v,width:p}}var pe=function(){function e(t,i){l()(this,e),this.settings=F.merge(ce,i||{}),this.name=t||"sheet",this.freeze=[0,0],this.styles=[],this.merges=new I,this.rows=new M(this.settings.row),this.cols=new L(this.settings.col),this.validations=new K,this.hyperlinks=[],this.comments=[],this.viewRangeCache={},this.highlighttxts=[],this.highlightrg=[],this.highlighshapes=[],this.highlighimgs=[],this.highlightIR=null,this.highlightall=!1,this.showhighlight=!1,this.highlightstyle=null,this.selector=new C,this.scroll=new S,this.history=new _,this.updateRows=new Set,this.updateCols=new Set,this.updateRowsHeight=new Set,this.clipboard=new T,this.autoFilter=new R,this.TableAutoFilters=[],this.menubarStatus=function(){},this.change=function(){},this.updateCellsData=function(){},this.updateCellServer=function(){},this.updateServerError=function(){},this.updateCellError=function(){},this.loadImages=function(){},this.loadShapes=function(){},this.fillImageSrc=function(){},this.fillImageOnebyOne=function(){},this.loadConditionImage=function(){},this.reloadImagesShapes=function(){},this.scrollImagesShapes=function(){},this.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,this.isupdating=!1,this.search=new J,this.showGrid=!0,this.zoomlevel=1,this.isImageOk=!1}return o()(e,[{key:"addValidation",value:function(e,t,i){var n=this;this.changeData((function(){n.validations.add(e,t,i)}))}},{key:"removeValidation",value:function(){var e=this,t=this.selector.range;this.changeData((function(){e.validations.remove(t)}))}},{key:"getHighlightCellTxt",value:function(e,t){var i=this;return this.showhighlight&&!this.highlightall?this.highlighttxts.reduce((function(n,r){return r.row===e&&r.col===t&&(r.color=i.highlightstyle.color,n.push(r)),n}),[]):[]}},{key:"getSelectedValidator",value:function(){var e=this.selector,t=e.ri,i=e.ci,n=this.validations.get(t,i);return n?n.validator:null}},{key:"getSelectedValidation",value:function(){var e=this.selector,t=e.ri,i=e.ci,n=e.range,r=this.validations.get(t,i),a={ref:n.toString()};return null!==r&&(a.mode=r.mode,a.validator=r.validator),a}},{key:"getSelectedSort",value:function(){var e=this.selector,t=e.ci,i=e.range,n={ref:i.toString(),ci:[0,1,2]},r=this.merges;n.sort=[];for(var a=[],o=i.sri,s=i.eri,l=i.sci,c=i.eci,h=0;h<r._.length;h+=1){var u=r._[h];if(u.sri>=o&&u.eri<=s&&u.sci>=l&&u.eci<=c)return le("error","".concat(U("dataSort.msg2"))),null}for(var f=o+1;f<=s;f+=1){var d=this.getCell(f,t);null===d||/^\s*$/.test(d.text)||a.push(d.text)}n.m=a;for(var m=new Map,g=new Map,p=0,y=l;y<=c;y++,p++){var b=this.getCell(o,y),w="";w=null===b||/^\s*$/.test(b.text)?"(Column "+v(y)+")":b.text,m.set(p,w),g.set(p,"(Column "+v(y)+")")}return n.mcols=m,n.mcolsheader=g,n}},{key:"canUndo",value:function(){return this.history.canUndo()}},{key:"canRedo",value:function(){return this.history.canRedo()}},{key:"undo",value:function(){var e=this;this.history.undo((function(t){return e.getRangeData(t.range)}),(function(t){e.setRangeData(t)}))}},{key:"redo",value:function(){var e=this;this.history.redo((function(t){return e.getRangeData(t.range)}),(function(t){e.setRangeData(t)}))}},{key:"copy",value:function(){this.clipboard.copy(this.selector.range,this.rows)}},{key:"cut",value:function(){this.clipboard.cut(this.selector.range)}},{key:"paste",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=this.clipboard,r=this.selector;return!n.isClear()&&(!!he.call(this,n.range,r.range,i)&&(this.changeData((function(){var i=r.range.extendRange(n.range);r.range.setToOther(i),n.isCopy()?ue.call(e,n.range,i,t):n.isCut()&&fe.call(e,n.range,i)})),!0))}},{key:"pasteFromText",value:function(e){var t=this,i=this.name,n=e.split("\r\n").map((function(e){return e.replace(/"/g,"").split("\t")}));if(n.length>0&&""==n[n.length-1]&&(n.length-=1),n.length>=1){var r=this.rows,a=this.selector;this.changeData((function(){var e=r.paste(n,a.range);t.updateBatchCellsOpr(i,e)}))}}},{key:"autofill",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.selector.range;return-1==r.sci&&(r.sci=0),-1==r.sri&&(r.sri=0),-1==e.sci&&(e.sci=0),-1==e.sri&&(e.sri=0),!!he.call(this,r,e,n)&&(this.changeData((function(){ue.call(i,r,e,t,!0)}),!0,e),!0)}},{key:"clearClipboard",value:function(){this.clipboard.clear()}},{key:"calSelectedRangeByEnd",value:function(e,t){var i=this.selector,n=this.rows,r=this.cols,a=this.merges,o=i.range,s=o.sri,l=o.sci,c=o.eri,h=o.eci,u=i.ri,f=i.ci,d=e,m=t;return e<0&&(d=n.len-1),t<0&&(m=r.len-1),d>u?(s=u,c=d):(s=d,c=u),m>f?(l=f,h=m):(l=m,h=f),i.range=a.union(new x(s,l,c,h)),i.range=a.union(i.range),i.range}},{key:"calSelectedRangeByStart",value:function(e,t){var i=this.selector,n=this.rows,r=this.cols,a=this.merges.getFirstIncludes(e,t);return null===a&&(a=new x(e,t,e,t),-1===e&&(a.sri=0,a.eri=n.len-1),-1===t&&(a.sci=0,a.eci=r.len-1)),i.range=a,a}},{key:"setSelectedCellAttr",value:function(e,t){var i=this;this.changeData((function(){var n=i.selector,a=i.styles,o=i.rows,s=i.name;if("merge"===e)t?i.merge():i.unmerge();else if("border"===e)me.call(i,t);else if("formula"===e){var l=n.ri,c=n.ci,h=n.range;if(n.multiple()){var u=n.size(),f=r()(u,2),d=f[0],m=f[1],g=h.sri,v=h.sci,p=h.eri,y=h.eci;if(d>1)for(var w=v;w<=y;w+=1){o.getCellOrNew(p+1,w).text="=".concat(t,"(").concat(b(w,g),":").concat(b(w,p),")")}else if(m>1){o.getCellOrNew(l,y+1).text="=".concat(t,"(").concat(b(v,l),":").concat(b(y,l),")")}}else{o.getCellOrNew(l,c).text="=".concat(t,"()")}}else n.range.each((function(n,r){var l=o.getCellOrNew(n,r),c={};if(void 0!==l.style&&(c=F.cloneDeep(a[l.style])),"format"===e)c.format=t,"normal"===t?(delete c.number,delete c.custom):"text"===t?(c.number=49,delete c.custom):"number"===t?(c.custom="#,##0.00_",delete c.number):"percent"===t?(c.number=10,delete c.custom):"rmb"===t?(c.custom="[$¥-804]#,##0.00",delete c.number):"usd"===t?(c.custom="$#,##0.00",delete c.number):"eur"===t?(c.custom="[$€-408]#,##0.00",delete c.number):"date"===t?(c.custom="mm/dd/yyyy",delete c.number):"time"===t?(c.number=21,delete c.custom):"datetime"===t?(c.custom="mm/dd/yyyy hh:mm:ss",delete c.number):"duration"===t&&(c.custom="[h]:mm:ss",delete c.number),l.style=i.addStyle(c),i.updateCellStyleOpr(s,n,r,c);else if("font-bold"===e||"font-italic"===e||"font-name"===e||"font-size"===e){var h={};h[e.split("-")[1]]=t,c.font=Object.assign(c.font||{},h),l.style=i.addStyle(c)}else"strike"===e||"textwrap"===e||"underline"===e||"align"===e||"valign"===e||"color"===e||"bgcolor"===e||"pbgcolor"===e||"pattern"===e?(c[e]=t,l.style=i.addStyle(c),"align"===e&&delete l.isautoalign):l[e]=t}))}))}},{key:"setHyperlinkStyle",value:function(e,t,i){var n=this.rows,r=this.styles,a=n.getCellOrNew(e,t),o={};void 0!==a.style&&(o=F.cloneDeep(r[a.style])),o.underline=i,o.color=i?"#0000ff":"Black",a.style=this.addStyle(o)}},{key:"setSelectedCellText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"input",i=this.autoFilter,n=this.selector,r=this.rows,a=n.ri,o=n.ci,s=a;this.unsortedRowMap.has(a)&&(s=this.unsortedRowMap.get(a));var l=r.getCell(s,o),c=l?l.text:"";if(this.setCellText(s,o,e,t),i.active()){var h=i.getFilter(o);if(h){var u=h.value.findIndex((function(e){return e===c}));u>=0&&h.value.splice(u,1,e)}}}},{key:"getSelectedCell",value:function(){var e=this.selector,t=e.ri,i=e.ci,n=t;return this.unsortedRowMap.has(t)&&(n=this.unsortedRowMap.get(t)),this.rows.getCell(n,i)}},{key:"canSelected",value:function(e,t){if(!this.sprotected)return!0;var i=e;this.unsortedRowMap.has(e)&&(i=this.unsortedRowMap.get(e));var n=this.getCellStyle(i,t);return null==n?this.canselectlocked:!(!n.unlocked||!this.canselectunlocked)||!(n.unlocked||!this.canselectlocked)}},{key:"isfirstRowCellsContainsFormula",value:function(e){for(var t=e.sci;t<=e.eci;t+=1){var i=this.getCell(e.sri,t);if(null!=i&&void 0!==i.f)return!0}return!1}},{key:"getLocked",value:function(){var e=this.selector,t=e.ri,i=e.ci;return this.getCellLocked(t,i)}},{key:"getCellLocked",value:function(e,t){if(!this.sprotected)return!1;var i=e;this.unsortedRowMap.has(e)&&(i=this.unsortedRowMap.get(e));var n=this.getCellStyle(i,t);return!(null!=n&&n.unlocked)}},{key:"getRangeLocked",value:function(e){for(var t=e.sri;t<=e.eri;t+=1)for(var i=e.sci;i<=e.eci;i+=1)if(this.getCellLocked(t,i))return!0;return!1}},{key:"xyInSelectedRect",value:function(e,t){var i=this.getSelectedRect(),n=i.left,r=i.top,a=i.width,o=i.height,s=this.settings.row.height,l=e-this.cols.indexWidth,c=t-s;return l>n&&l<n+a&&c>r&&c<r+o}},{key:"getSelectedRectBySearch",value:function(){return this.getRect(this.selector.range)}},{key:"getSelectedRect",value:function(){var e=this.selector.range.clone();if(this.freezeIsActive()){if(e.sri>=this.freeze[0]&&e.eri<this.scroll.riact)return{left:-99999,top:-99999};e.sri>=this.freeze[0]&&e.sri<this.scroll.riact&&(e.sri=this.scroll.riact)}else{if(e.eri<this.scroll.riact)return{left:-99999,top:-99999};e.sri<this.scroll.riact&&(e.sri=this.scroll.riact)}return this.getRect(e)}},{key:"getRectForTextbox",value:function(e){var t=this.scroll,i=(this.rows,this.cols),n=(this.exceptRowSet,this.displayRight2Left),a=this.freeze,o=this.zoomlevel,s=new x(e.row,e.col,e.row,e.col),l=s.sri,c=s.sci,h=(s.eri,s.eci);if(l<0&&c<0)return{left:0,l:0,top:0,t:0,scroll:t};var u=r()(a,2)[1],f=n?e.left+i.indexWidth:e.left,d=e.top,m=e.height,g=e.width,v=n?u>0&&h>=u||0===u?f-t.x:f:f-t.x,p=this.freezeTotalHeight(),y=this.freezeTotalWidth(),b=e.top-t.y;return y>0&&y>f&&!n&&(v=f),p>0&&p>d&&(b=d),{l:f*o,t:d*o,left:v*o,top:b*o,height:m*o,width:g*o,scroll:t}}},{key:"getClipboardRect",value:function(){var e=this.clipboard;return e.isClear()?{left:-100,top:-100}:this.getRect(e.range)}},{key:"getRect",value:function(e){var t=this.scroll,i=this.rows,n=this.cols,a=this.exceptRowSet,o=this.displayRight2Left,s=this.freeze,l=this.zoomlevel,c=e.sri,h=e.sci,u=e.eri,f=e.eci;if(c<0&&h<0)return{left:0,l:0,top:0,t:0,scroll:t};var d=r()(s,2)[1],m=o?this.viewWidth()-n.indexWidth-n.sumWidth(0,f+1):n.sumWidth(0,h),g=i.sumHeight(0,c,a),v=i.sumHeight(c,u+1,a)*l,p=n.sumWidth(h,f+1)*l,y=o?d>0&&f>=d||0===d?m+t.x:m:m-t.x,b=this.freezeTotalHeight(),w=this.freezeTotalWidth(),x=i.sumHeight(t.riact,c,a)+b;return w>0&&w>m&&!o&&(y=m),b>0&&b>g&&(x=g),{l:m*l,t:g*l,left:y*l,top:x*l,height:v,width:p,scroll:t}}},{key:"getCellRectByXY",value:function(e,t){var i=this.scroll,n=this.merges,r=this.rows,a=this.cols,o=this.zoomlevel,s=ge.call(this,t,i.y),l=s.ri,c=s.top,h=s.height,u=ve.call(this,e,i.x),f=u.ci,d=u.left,m=u.width;if(-1===f&&(m=a.totalWidth()),-1===l&&(h=r.totalHeight()),l>=0||f>=0){var g=n.getFirstIncludes(l,f);if(g){l=g.sri,f=g.sci;var v=this.cellRectWithOutTransfer(l,f);d=v.left,c=v.top,m=v.width,h=v.height}}return{ri:l,ci:f,left:d*o,top:c*o,width:m*o,height:h*o}}},{key:"isSignleSelected",value:function(){var e=this.selector.range,t=e.sri,i=e.sci,n=e.eri,a=e.eci,o=this.getCell(t,i);if(o&&o.merge){var s=r()(o.merge,2),l=s[0],c=s[1];if(t+l===n&&i+c===a)return!0}return!this.selector.multiple()}},{key:"canUnmerge",value:function(){var e=this.selector.range,t=e.sri,i=e.sci,n=e.eri,a=e.eci,o=this.getCell(t,i);if(o&&o.merge){var s=r()(o.merge,2),l=s[0],c=s[1];if(t+l===n&&i+c===a)return!0}return!1}},{key:"merge",value:function(){var e=this.selector,t=this.rows;if(!this.isSignleSelected()){var i=e.size(),n=r()(i,2),a=n[0],o=n[1];if(a>1||o>1){var s=e.range,l=s.sri,c=s.sci,h=t.getCellOrNew(l,c);h.merge=[a-1,o-1],this.merges.add(e.range),this.rows.deleteCells(e.range),this.rows.setCell(l,c,h)}}}},{key:"unmerge",value:function(){var e=this.selector;if(this.isSignleSelected()){var t=e.range,i=t.sri,n=t.sci;this.rows.deleteCell(i,n,"merge"),this.merges.deleteWithin(e.range)}}},{key:"canAutofilter",value:function(){return!this.autoFilter.active()}},{key:"autofilter",value:function(){var e=this,t=this.autoFilter,i=this.selector,n=this.TableAutoFilters;if(!t.active())for(var r=0,a=n.length;r<a;r++){var o=n[r],s=x.valueOf(o.ref);if(!(s.eci<i.range.sci||i.range.eci<s.sci))return void le("Warning","there is already table autofilter in the selected range")}this.changeData((function(){t.active()?(t.clear(),e.exceptRowSet=new Set,e.sortedRowMap=new Map,e.unsortedRowMap=new Map):t.ref=i.range.toString()}))}},{key:"autoSort",value:function(){var e=this.autoFilter,t=this.selector;this.changeData((function(){e.filters=[],e.ref=t.range.toString()}))}},{key:"sortByRowIdArray",value:function(e,t){for(var i=this.rows,n=e.sri,r=e.eri,a=e.sci,o=e.eci,s=[],l=0,c=t.length;l<c;l++){for(var h=i._[t[l]].cells,u=[],f=a;f<=o;f++)void 0!==h[f]&&u.push({id:f,v:F.cloneDeep(h[f])});s.push(u)}for(var d=0,m=n;m<=r;m++)if(t[d++]!==m){for(var g=i._[m].cells,v=a;v<=o;v++)delete g[v];for(var p=s[d-1],y=0,b=p.length;y<b;y++){var w=p[y];g[w.id]=w.v}}}},{key:"doSort",value:function(e,t,i){var n=this.name,r=this.selector.range,a=(r.sri,r.eri,r.sci,r.eci,{name:n,src:r,ci:e,order:t,isheader:i,op:"sort"});this.updateCellServer(a)}},{key:"setAutoFilter",value:function(e,t,i,n){var r=this.currentAutoFilter;void 0===r&&(r=this.autoFilter),r.addFilter(e,i,n),r.setSort(e,t),this.resetAutoFilter()}},{key:"resetAutoFilter",value:function(){var e=this,t=this.currentAutoFilter,i=this.rows,n=t;if(void 0===n&&(n=this.autoFilter),n.active()){var r=n.sort,a=n.filteredRows((function(e,t){return i.getCell(e,t)})),o=a.rset,s=a.fset,l=Array.from(s),c=Array.from(s);r&&l.sort((function(e,t){if("desc"===r.order){var n=e;e=t,t=n}var a=i.getCell(e,r.ci),o=i.getCell(t,r.ci);if(null!=a&&""===a.text&&(a=null),null!=o&&""===o.text&&(o=null),null==a&&null==o)return e-t;if(null==a)return"asc"===r.order?1:-1;if(null==o)return"asc"===r.order?-1:1;a=a.text,o=o.text;var s=isNaN(Number(a)),l=isNaN(Number(o));return s&&l?a.localeCompare(o):s&&!l?1:!s&&l?-1:Number(a)-Number(o)})),this.exceptRowSet=o,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,l.forEach((function(t,i){e.sortedRowMap.set(c[i],t),e.unsortedRowMap.set(t,c[i])}))}}},{key:"deleteExceptRowHideForAutoFilter",value:function(){var e=this.exceptRowSet,t=this.rows;e.forEach((function(e){t.get(e)&&(t.get(e).hide=void 0)}))}},{key:"updateMyConditionImages",value:function(e){var t=this.conditionimg,i=(this.rows,this.styles,this);e&&e.forEach((function(e){if(t){var n=t.find((function(t){return t.row===e.row&&t.col===e.col}));n?n.image.src="data:image/png;base64,"+e.data:i.insertConditionImage(e)}}))}},{key:"createConditionImage",value:function(e,t){var i=this.displayRight2Left,n=new Image;n.src="data:image/png;base64,"+e.data;var r=this.cols.sumWidth(0,e.col),a=this.rows.sumHeight(0,e.row);if(0===e.type){n.style.zIndex=t+1;var o=this.getCellStyle(e.row,e.col);null!=o&&"bottom"===o.valign&&(a+=this.rows.getHeight(e.row)-16)}else n.style.zIndex=t,n.style.opacity=.88;if((this.rows.isHide(e.row)||this.cols.isHide(e.col)||this.exceptRowSet.has(e.row))&&(n.style.display="none"),i){var s=this.viewWidth();n.style.left=s-r+"px"}else n.style.left=r+"px";if(n.style.top=a+"px",n.style.position="absolute",void 0===e.ol){var l=parseInt(n.style.left),c=parseInt(n.style.top);e.ol=l,e.ot=c}return n}},{key:"updateConditionImageVisible",value:function(){var e=this.exceptRowSet,t=this.rows,i=this.cols;this.conditionimg&&this.conditionimg.forEach((function(n){t.isHide(n.row)||i.isHide(n.col)||e.has(n.row)?n.image.style.display="none":n.image.style.display="block"}))}},{key:"updateConditionImageDirection",value:function(){var e=this.displayRight2Left,t=this.cols,i=this.zoomlevel,n=this.viewWidth()-t.indexWidth;this.conditionimg&&this.conditionimg.forEach((function(r){r.image&&(r.image.style.left=e?(n-r.ol-t.getWidth(r.col))*i+"px":r.ol*i+"px")}))}},{key:"updateConditionImageZoom",value:function(){this.exceptRowSet,this.rows,this.cols;var e=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(t){if(t.ow||(t.ow=t.image.width,t.oh=t.image.height),t.image.style.left=t.ol*e+"px",t.image.style.top=t.ot*e+"px",t.ow){t.image.height;t.image.width=t.ow*e,1===t.type&&(t.image.height=t.oh*e)}}))}},{key:"updateConditionImagePositionForCol",value:function(e,t,i){var n=this.displayRight2Left,r=this.cols,a=this.zoomlevel;if(this.conditionimg){var o=this.viewWidth()-r.indexWidth;this.conditionimg.forEach((function(s){if(s.col>e)s.ol+=t,s.image.style.left=n?(o-s.ol-r.getWidth(s.col))*a+"px":s.ol*a+"px";else if(s.col===e){if(1===s.type){var l=s.image.height;s.image.width=i*a,s.ow=i,s.image.height=l}n&&(s.image.style.left=(o-s.ol-r.getWidth(s.col))*a+"px")}}))}}},{key:"updateConditionImagePositionForRow",value:function(e,t,i){var n=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(r){if(r.row>e)r.ot+=t,r.image.style.top=r.ot*n+"px";else if(r.row===e&&1===r.type){var a=r.image.width;r.image.height=i*n,r.oh=i,r.image.width=a}}))}},{key:"updateConditionImageForColInsert",value:function(e,t){var i=this.conditionimg,n=this.cols,r=this.displayRight2Left,a=this.zoomlevel;if(i){var o=this.viewWidth()-n.indexWidth,s=n.sumWidth(e,t+1),l=t-e+1;i.forEach((function(t){t.col>=e&&(t.ol+=s,t.image.style.left=r?(o-t.ol-n.getWidth(t.col))*a+"px":t.ol*a+"px",l&&(t.col+=l))}))}}},{key:"updateConditionImageForRowInsert",value:function(e,t){var i=this.conditionimg,n=this.rows,r=this.zoomlevel;if(i){var a=n.sumHeight(e,t+1),o=t-e+1;i.forEach((function(t){t.row>=e&&(t.ot+=a,t.image.style.top=t.ot*r+"px",o&&(t.row+=o))}))}}},{key:"updateConditionImageForRowDelete",value:function(e,t,i){var n=this.conditionimg,r=(this.rows,this.zoomlevel);if(n)for(var a=t-e+1,o=n.length-1;o>=0;o--){var s=n[o];s.row>=e&&s.row<=t?(s.image.remove(),n.splice(o,1)):s.row>t&&(s.ot+=i,s.image.style.top=s.ot*r+"px",a&&(s.row-=a))}}},{key:"updateConditionImageForColDelete",value:function(e,t,i){var n=this.conditionimg,r=this.cols,a=this.displayRight2Left,o=this.zoomlevel;if(n)for(var s=this.viewWidth()-r.indexWidth,l=n.length-1;l>=0;l--){var c=n[l];if(c.col>=e&&c.col<=t)c.image.remove(),n.splice(l,1);else if(c.col>t){c.ol+=i,c.image.style.left=a?(s-c.ol-r.getWidth(c.col))*o+"px":c.ol*o+"px";var h=t-e+1;h&&(c.col-=h)}}}},{key:"deleteCell",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=this.selector,n=this.name;this.changeData((function(){e.rows.deleteCells(i.range,t),"all"!==t&&"format"!==t||e.merges.deleteWithin(i.range),e.delCellOpr(n,i.range,t)}))}},{key:"insert",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData((function(){var n=t.selector.range,r=n.sri,a=n.sci,o=t.rows,s=t.merges,l=t.cols,c=t.name,h=r;if("row"===e){o.insert(r,i),t.updateConditionImageForRowInsert(r,r+i-1);var u=o.getHeight(r-1);t.insertRowOpr(c,r,i,u)}else if("column"===e){o.insertColumn(a,i),h=a,l.len+=i;for(var f=l.getWidth(a-1),d=l.len,m=0;m<i;m++)l._[d-1-m]={};for(var g=d-1;g>=a;g--)l._[g].width=g>=i?l._[g-i].width:l.width;t.insertColumnOpr(c,a,i,f),t.updateConditionImageForColInsert(a,a+i-1)}s.shift(e,h,i,(function(e,t,i,n){var r=o.getCell(e,t);r.merge[0]+=i,r.merge[1]+=n}))}),!1)}},{key:"delete",value:function(e){var t=this,i=this.selector.range,n=i.sri,r=i.sci,a=i.eri,o=i.eci;n<0&&(n=0),a<n||(r<0&&(r=0),o<r||this.changeData((function(){var i=t.rows,n=t.merges,r=t.selector,a=t.cols,o=t.name,s=r.range,l=r.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci,d=c,m=0;if("row"===e){if(c<0&&(c=0),u<c)return;if(confirm("sure to delete rows from "+(c+1)+" to "+(u+1))){m=u-c+1;var g=-i.sumHeight(c,u+1);i.delete(c,u),t.deleteRowOpr(o,c,u),t.updateConditionImageForRowDelete(c,u,g)}}else if("column"===e){if(h<0&&(h=0),f<h)return;if(confirm("sure to delete columns from "+(h+1)+" to "+(f+1))){var v=-a.sumWidth(h,f+1);i.deleteColumn(h,f),d=s.sci,m=f-h+1,a.len-=m;for(var p=h;p<a.len-m;p++)a._[p].width=a._[p+m].width;for(var y=a.len;y<a.len+m;y++)delete a._[y];t.deleteColumnOpr(o,h,f),t.updateConditionImageForColDelete(h,f,v)}}n.shift(e,d,-m,(function(e,t,n,r){var a=i.getCell(e,t);a.merge[0]+=n,a.merge[1]+=r,0===a.merge[0]&&0===a.merge[1]&&delete a.merge}))}),!1))}},{key:"deletelocalonly",value:function(e,t,i){var n=this;this.changeData((function(){var r=n.rows,a=n.merges;n.cols;"row"===e?r.delete(t,t+i-1):"column"===e&&r.deleteColumn(t,t+i-1),a.shift(e,t,-i,(function(e,t,i,n){var a=r.getCell(e,t);a.merge[0]+=i,a.merge[1]+=n,0===a.merge[0]&&0===a.merge[1]&&delete a.merge}))}),!1)}},{key:"updateRevertOpr",value:function(e){"insertrow"===e.op?this.deletelocalonly("row",e.ri,e.n):"insertcol"===e.op&&this.deletelocalonly("column",e.ci,e.n)}},{key:"scrollx",value:function(e,t){var i=this.scroll,n=this.freeze,a=this.cols;this.displayRight2Left&&(e=-e);var o=r()(n,2)[1],s=F.rangeReduceIf(o,a.len,0,0,e,(function(e){return a.getWidth(e)})),l=r()(s,3),c=l[0],h=l[1],u=l[2],f=h;e>0&&(f+=u),i.x!==f&&(i.ci=e>0?c:0,i.x=f,t())}},{key:"scrolly",value:function(e,t){var i=this.scroll,n=this.freeze,a=this.rows,o=this.exceptRowSet,s=r()(n,1)[0],l=F.rangeReduceIf(s,a.len,0,0,e,(function(e){return a.getHeight(e,o)})),c=r()(l,3),h=c[0],u=c[1],f=c[2],d=u;if(e>0&&(d+=f),i.y!==d){for(i.ri=e>0?h:0,i.y=d,0===i.ri&&this.freeze[0]>0&&(i.ri=this.freeze[0],i.y=0),i.yact=i.y,i.riact=i.ri;this.isInvisibleRow(i.riact);)i.yact+=a.getHeight(i.riact,o),i.riact++;t()}}},{key:"isInvisibleRow",value:function(e){var t=this.exceptRowSet;return this.rows.isHide(e)||t.has(e)}},{key:"cellRect",value:function(e,t){var i=this.rows,n=this.cols,a=this.exceptRowSet,o=this.displayRight2Left,s=this.scroll,l=i.sumHeight(0,e,a),c=i.getCell(e,t),h=n.getWidth(t),u=i.getHeight(e);if(null!==c&&c.merge){var f=r()(c.merge,2),d=f[0],m=f[1];if(d>0)for(var g=1;g<=d;g+=1)u+=i.getHeight(e+g);if(m>0)for(var v=1;v<=m;v+=1)h+=n.getWidth(t+v)}var p=o?this.viewWidth()-n.sumWidth(0,t)-h+2*s.x:n.sumWidth(0,t);if(o){var y=r()(this.freeze,2),b=(y[0],y[1]);b>0&&t<b&&(p-=2*s.x)}return{left:p,top:l,width:h,height:u,cell:c}}},{key:"cellRectWithOutTransfer",value:function(e,t){var i=this.cellRect(e,t),n=this.displayRight2Left,a=this.cols,o=this.scroll,s=this.zoomlevel,l=a.indexWidth,c=this.settings.row.height;i.top+=c;var h=r()(this.freeze,2),u=(h[0],h[1]);return n?(i.left-=l,i.left+=i.width,t>u&&(i.left-=o.x)):(i.left+=l,t>u&&(i.left-=o.x)),e>u&&(i.top-=o.y),i.left*=s,i.top*=s,i.width*=s,i.height*=s,i}},{key:"getCell",value:function(e,t){return this.rows.getCell(e,t)}},{key:"getCellTextOrDefault",value:function(e,t){var i=this.getCell(e,t);return i&&i.text?i.text:""}},{key:"isEmpty",value:function(e,t){var i=this.getCell(e,t);return!i||!i.text||0===i.text.trim().length}},{key:"getCellStyle",value:function(e,t){var i=this.getCell(e,t);return i&&void 0!==i.style?this.styles[i.style]:null}},{key:"getCellStyleOrDefault",value:function(e,t){var i=this.styles,n=this.rows,r=this.displayRight2Left,a=n.getCell(e,t),o=a&&void 0!==a.style?i[a.style]:{},s=F.merge(this.defaultStyle(),o);if(void 0!==o.bgcolor&&(s.hasbgcolor=!0),a&&void 0!==a.merge){if(0!=a.merge[1]){var l=n.getCell(e,t+a.merge[1]),c=l&&void 0!==l.style?i[l.style]:{};c.border&&void 0!==c.border.right&&(void 0===o.border&&(o.border={}),o.border.right=c.border.right)}if(0!=a.merge[0]){var h=n.getCell(e+a.merge[0],t),u=h&&void 0!==h.style?i[h.style]:{};u.border&&void 0!==u.border.bottom&&(void 0===o.border&&(o.border={}),o.border.bottom=u.border.bottom)}}if(void 0!==s.border&&r){var f=s.border.right;s.border.right=s.border.left,s.border.left=f}return s}},{key:"getSelectedCellStyle",value:function(){var e=this.selector,t=e.ri,i=e.ci;return this.getCellStyleOrDefault(t,i)}},{key:"setCellText",value:function(e,t,i,n){var r=this.rows,a=this.history,o=this.validations,s=this.settings,l=this.name;"finished"===n?("server"!==s.updateMode&&(r.setCellText(e,t,""),a.add(this.getData()),r.setCellText(e,t,i)),"server"===s.updateMode&&this.updateCellTextOpr(l,e,t,i)):r.setCellText(e,t,i),o.validate(e,t,i)}},{key:"updateTextbox",value:function(e,t){this.settings;var i=this.name;e.ischange&&(e.ischange=!1,this.updateTextboxOpr(i,e,t))}},{key:"isNumber",value:function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},{key:"isDate",value:function(e){return isNaN(e)&&!isNaN(Date.parse(e))}},{key:"setLinkedShape",value:function(e,t,i){this.rows.getCellOrNew(e,t).lc=i}},{key:"setCellAutoAlignment",value:function(e,t,i){var n=this.styles,r=this.rows.getCellOrNew(e,t),a={};void 0!==r.style&&(a=F.cloneDeep(n[r.style])),(r.isautoalign||void 0===a.align)&&(a.align=i,r.style=this.addStyle(a),r.isautoalign=!0)}},{key:"cutPasteRangeOpr",value:function(e,t,i){var n={name:e,src:t,dest:i,op:"cutpaste"};this.updateCellServer(n)}},{key:"copyPasteRangeOpr",value:function(e,t,i,n){var r={name:e,src:t,dest:i,op:"copypaste",what:n};this.updateCellServer(r)}},{key:"autofillRangeOpr",value:function(e,t,i,n){var r={name:e,src:t,dest:i,op:"autofill",what:n};this.updateCellServer(r)}},{key:"updateBatchCellsOpr",value:function(e,t,i,n,r){var a={name:e,cells:t,src:i,dest:n,what:r,op:"batchupdate"};this.updateCellServer(a)}},{key:"updateCellStyleOpr",value:function(e,t,i,n){var r={name:e,ri:t,ci:i,number:n.number,custom:n.custom,op:"updatestyle"};this.updateCellServer(r)}},{key:"updateCellTextOpr",value:function(e,t,i,n){var r=n.startsWith("<font style=")||n.startsWith("<Font Style=")?"updatehtml":"update",a={name:e,ri:t,ci:i,text:n,op:r};this.updateCellServer(a)}},{key:"updateTextboxOpr",value:function(e,t,i){var n={name:e,id:t.strid,text:i,w:t.width,h:t.height,op:"updateTextBox"};this.updateCellServer(n)}},{key:"delCellOpr",value:function(e,t,i){var n={name:e,range:t,what:i,op:"delcells"};this.updateCellServer(n)}},{key:"addSheetOpr",value:function(e){var t={name:e,op:"add"};this.updateCellServer(t)}},{key:"delSheetOpr",value:function(e){var t={name:e,op:"del"};this.updateCellServer(t)}},{key:"renameSheetOpr",value:function(e,t){var i={oldname:e,name:t,op:"rename"};this.updateCellServer(i)}},{key:"insertRowOpr",value:function(e,t,i,n){var r={name:e,ri:t,n:i,h:n,op:"insertrow"};this.updateCellServer(r)}},{key:"insertColumnOpr",value:function(e,t,i,n){var r={name:e,ci:t,n:i,w:n,op:"insertcol"};this.updateCellServer(r)}},{key:"deleteRowOpr",value:function(e,t,i){var n={name:e,sri:t,eri:i,op:"delrow"};this.updateCellServer(n)}},{key:"deleteColumnOpr",value:function(e,t,i){var n={name:e,sci:t,eci:i,op:"delcol"};this.updateCellServer(n)}},{key:"setAutoAlignForCell",value:function(e){e.ufv||this.isNumber(e.text)||this.isDate(e.text)?this.setCellAutoAlignment(e.ri,e.ci,"right"):this.setCellAutoAlignment(e.ri,e.ci,"left")}},{key:"updateMyCells",value:function(e){var t=this,i=this.styles,n=this.rows,r=this.search,a=this;e.forEach((function(e,r,o){var s=n.updateOneCell(e);if(e.bgcolor){var l={};void 0!==s.style&&(l=F.cloneDeep(i[s.style])),l.bgcolor=e.bgcolor,s.style=a.addStyle(l)}t.setAutoAlignForCell(e)})),"comments"!==r.lookin&&(r.result=null)}},{key:"updateShapes",value:function(e,t){var i=this.shapes;null!=i&&null!=e&&e.forEach((function(e,n,r){for(var a=0,o=i.length;a<o;a++)if(i[a].id===e.id){var s={};s.id="s_"+e.id+"_"+i[a].tick,s.name=e.id+"."+e.tick,s.it=i[a],t.push(s),$("#"+s.id).addClass("resize-image").removeAttr("src");break}}))}},{key:"updateShapeSrcToRefresh",value:function(e,t,i,n){if(n.length>0){var r=this;$.get(t+"?uid="+e+"&id="+i,(function(e){r.fillImageOnebyOne(e,n)}))}}},{key:"validateFormula",value:function(e){for(var t=0,i=0;i<e.length;i++)"("===e[i]?t++:")"===e[i]&&t--;return 0===t}},{key:"freezeIsActive",value:function(){var e=r()(this.freeze,2),t=e[0],i=e[1];return t>0||i>0}},{key:"resetScroll",value:function(){var e=this.scroll;e.riact=0,e.ri=0,e.y=0,e.yact=0,e.x=0,e.ci=0}},{key:"setFreeze",value:function(e,t){var i=this;0===e&&this.resetScroll(),this.changeData((function(){i.freeze=[e,t]}))}},{key:"freezeTotalWidth",value:function(){return this.cols.sumWidth(0,this.freeze[1])}},{key:"freezeTotalHeight",value:function(){return this.rows.sumHeight(0,this.freeze[0],this.exceptRowSet)}},{key:"setRowHeight",value:function(e,t){var i=this;this.changeData((function(){i.rows.setHeight(e,t)}))}},{key:"setColWidth",value:function(e,t){var i=this;this.changeData((function(){i.cols.setWidth(e,t)}))}},{key:"viewHeight",value:function(){var e=this.settings,t=e.view,i=e.showToolbar,n=e.showFileName,r=t.height();return r-=26,r-=41,i&&(r-=41,this.menubarStatus()&&(r-=n?80:40)),r}},{key:"viewWidth",value:function(){return this.settings.view.width()}},{key:"freezeViewRange",value:function(){var e=r()(this.freeze,2),t=e[0],i=e[1];return new x(0,0,t-1,i-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:"contentRange",value:function(){var e=this.rows,t=this.cols,i=e.maxCell(),n=r()(i,2),a=n[0],o=n[1],s=e.sumHeight(0,a+1),l=t.sumWidth(0,o+1);return new x(0,0,a,o,l,s)}},{key:"exceptRowTotalHeight",value:function(e,t){var i=this.exceptRowSet,n=this.rows,r=Array.from(i),a=0;return r.forEach((function(i){if(i<e||i>t){var r=n.getHeight(i);a+=r}})),a}},{key:"viewRange",value:function(){var e=this.scroll,t=this.rows,i=this.cols,n=this.freeze,a=this.exceptRowSet,o=e.ri,s=e.ci;o<=0&&(o=r()(n,1)[0]);s<=0&&(s=r()(n,2)[1]);for(var l=[this.freezeTotalWidth(),0],c=l[0],h=l[1],u=[t.len,i.len],f=u[0],d=u[1],m=o;m<t.len&&(a.has(m)||(h+=t.getHeight(m),f=m),!(h>this.viewHeight()/this.zoomlevel));m+=1);for(var g=s;g<i.len&&(d=g,!((c+=i.getWidth(g))>this.viewWidth()/this.zoomlevel));g+=1);var v=new x(o,s,f,d,c,h);return this.viewRangeCache=v,v}},{key:"eachMergesInView",value:function(e,t){this.merges.filterIntersects(e).forEach((function(e){return t(e)}))}},{key:"hideRowsOrCols",value:function(){var e=this.rows,t=this.cols,i=this.selector,n=i.size(),a=r()(n,2),o=a[0],s=a[1],l=i.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci;if(o===e.len)for(var d=h;d<=f;d+=1)t.setHide(d,!0);else if(s===t.len)for(var m=c;m<=u;m+=1)e.setHide(m,!0)}},{key:"unhideRowsOrCols",value:function(e,t){this["".concat(e,"s")].unhide(t)}},{key:"rowEach",value:function(e,t,i){for(var n=0,r=this.rows,a=this.exceptRowSet,o=(m()(a),0),s=e+o;s<=t;s+=1)if(a.has(s))o+=1;else{var l=r.getHeight(s);if(l>0){if(i(s,n,l),n+=l,this.zoomlevel<1&&n>this.viewHeight()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewHeight())break}}}},{key:"colEach",value:function(e,t,i){for(var n=0,r=this.cols,a=e;a<=t;a+=1){var o=r.getWidth(a);if(o>0){if(i(a,n,o),n+=o,this.zoomlevel<1&&n>this.viewWidth()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewWidth())break}}}},{key:"generatePicItems",value:function(e,t,i){var n=new Array;null!=e&&e.forEach((function(e){if(null==e.src){var t={};t.id="p_"+e.id+"_"+e.tick,void 0===e.refid?t.name=e.id+"."+e.tick:t.name=e.refid+"."+e.tick,t.it=e,n.push(t)}})),null!=t&&t.forEach((function(e){if(null==e.src){var t={};t.id="s_"+e.id+"_"+e.tick,void 0===e.refid?t.name=e.id+"."+e.tick:t.name=e.refid+"."+e.tick,t.it=e,n.push(t)}})),this.loadCount=n.length,this.fillImageOnebyOne(i,n)}},{key:"defaultStyle",value:function(){return this.settings.style}},{key:"addStyle",value:function(e){for(var t=this.styles,i=0;i<t.length;i+=1){var n=t[i];if(F.equals(n,e))return i}return t.push(e),t.length-1}},{key:"changeData",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=void 0!==i?i:this.selector.range;if(this.history.add(this.getRangeData(n)),e(),this.change(this.getData()),t)for(var r=n.sri,a=(n.sci,n.eri),o=(n.eci,r);o<=a;o++)this.updateRows.add(o)}},{key:"setRangeData",value:function(e){this.rows.setRangeData(e.rows,e.range),this.merges.setData(e.merges)}},{key:"setData",value:function(e){var t=this;return Object.keys(e).forEach((function(i){if("merges"===i||"rows"===i||"cols"===i||"validations"===i)t[i].setData(e[i]);else if("freeze"===i){var n=y(e[i]),a=r()(n,2),o=a[0],s=a[1];t.freeze=[s,o]}else if("autofilter"===i)t.autoFilter.setData(e[i]);else if("lautofilters"===i){var l=e[i],c=t;l.forEach((function(e){var t=new R;t.setData(e),c.TableAutoFilters.push(t)}))}else void 0!==e[i]&&(t[i]=e[i])})),this}},{key:"getData",value:function(){var e=this.name,t=this.freeze,i=this.styles,n=this.merges,r=this.rows,a=this.cols,o=this.validations,s=this.autoFilter,l=this.TableAutoFilters,c={name:e,freeze:b(t[1],t[0]),styles:i,merges:n.getData(),rows:r.getData(),cols:a.getData(),validations:o.getData(),autofilter:s.getData(),TableAutoFilters:[]};return l.forEach((function(e){c.TableAutoFilters.push(e.getData())})),c}},{key:"getRangeData",value:function(e){var t=this.merges,i=this.rows;this.styles;return{rows:i.getRangeData(e),merges:t.getData(),range:e}}},{key:"getDataForSave",value:function(){var e=this.name,t=this.freeze,i=this.styles,n=this.merges,r=this.rows,a=this.cols,o=this.validations,s=this.autoFilter,l=this.settings,c=this.updateRows,h=this.updateRowsHeight,u=this.updateCols,f=this.canselectlocked,d=this.sprotected,m=this.canselectunlocked,g=this.showGrid,v=this.comments,p=this.images,y=this.shapes;return{name:e,freeze:b(t[1],t[0]),styles:i,comments:v,canselectlocked:f,sprotected:d,canselectunlocked:m,showGrid:g,merges:n.getDataForSave(),settings:l,cols:a.getDataForSave(u),rows:r.getDataForRowsSet(c),rowh:r.getHeightForSave(h),validations:o.getData(),autofilter:s.getData(),images:null!=p?p.filter((function(e){return e.changed})).map((function(e){var t={};return t.left=e.left,t.top=e.top,t.originAngle=e.originAngle,t.angle=e.angle,t.zorder=e.zorder,t.width=e.originWidth*e.scaleX,t.height=e.originHeight*e.scaleY,t.op=e.op,t.id=e.id,e.hyperlink&&(t.hyperlink=e.hyperlink),t})):[],shapes:null!=y?y.filter((function(e){return e.changed})).map((function(e){var t={};return t.left=e.left,t.top=e.top,t.originAngle=e.originAngle,t.angle=e.angle,t.zorder=e.zorder,t.width=e.originWidth*e.scaleX,t.height=e.originHeight*e.scaleY,t.op=e.op,t.id=e.id,e.hyperlink&&(t.hyperlink=e.hyperlink),t})):[]}}}]),e}(),ye=i(12),be=i.n(ye),we=i(7),xe=i.n(we),ke=i(11),Ce=i.n(ke),Se=i(13),_e=i.n(Se);function Te(e,t,i){e.addEventListener(t,i)}function Oe(e,t,i){e.removeEventListener(t,i)}function Ee(e){e.xclickoutside&&(Oe(window.document.body,"click",e.xclickoutside),delete e.xclickoutside)}function Re(e,t){e.xclickoutside=function(i){2===i.detail||e.contains(i.target)||(t?t(e):(e.hide(),Ee(e)))},Te(window.document.body,"click",e.xclickoutside)}function Ie(e,t,i){Te(e,"mousemove",t),e.xEvtUp=function(n){Oe(e,"mousemove",t),Oe(e,"mouseup",e.xEvtUp),i(n)},Te(e,"mouseup",e.xEvtUp)}var Ae=null;function De(){clearInterval(Ae),Ae=null}function Pe(e,t){(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];Ae||(Ae=setInterval((function(){e.apply(void 0,i)}),400))})((function(){e.selectMoveDown(),e.canvas.publishEvent("object:scroll",e.data)}))}function Fe(e,t){var i="object"===("undefined"==typeof window?"undefined":_e()(window))?window.navigator.userAgent:"";if(/Android/i.test(i)){var n=window.innerHeight;window.addEventListener("resize",(function(i){var r=window.innerHeight;n>r?"true"===document.activeElement.contentEditable&&t(i):e(i)}))}else/iPhone|iPod|iPad/i.test(i)&&(window.addEventListener("focusin",(function(e){t(e)})),window.addEventListener("focusout",(function(t){e(t)})))}var Me=function(){function e(){var t=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;l()(this,e),this.moving=!1,this.sheet=r,this.vertical=i,this.el=f("div","".concat(ae,"-resizer ").concat(i?"vertical":"horizontal")).children(this.unhideHoverEl=f("div","".concat(ae,"-resizer-hover")).on("dblclick.stop",(function(e){return t.mousedblclickHandler(e)})).css("position","absolute").hide(),this.hoverEl=f("div","".concat(ae,"-resizer-hover")).on("mousedown.stop",(function(e){return t.mousedownHandler(e)})),this.lineEl=f("div","".concat(ae,"-resizer-line")).hide()).hide(),this.cRect=null,this.IsRight2Left=!1,this.finishedFn=null,this.minDistance=n,this.maxRowHeight=408,this.maxColWidth=254,this.unhideFn=function(){}}return o()(e,[{key:"showUnhide",value:function(e){this.unhideIndex=e,this.unhideHoverEl.show()}},{key:"hideUnhide",value:function(){this.unhideHoverEl.hide()}},{key:"show",value:function(e,t,i){var n=this.moving,r=this.vertical,a=this.hoverEl,o=this.lineEl,s=this.el,l=this.unhideHoverEl;if(!n){this.IsRight2Left=i,this.cRect=e;var c=e.left,h=e.top,u=e.width,f=e.height,d=i?c-u:c+u-5;s.offset({left:r?d:c,top:r?h:h+f-5}).show(),a.offset({width:r?5:u,height:r?f:5}),o.offset({width:r?0:t.width,height:r?t.height:0}),l.offset({left:r?5-u:c,top:r?h:5-f,width:r?5:u,height:r?f:5})}}},{key:"hide",value:function(){this.el.offset({left:0,top:0}).hide(),this.hideUnhide()}},{key:"mousedblclickHandler",value:function(){this.unhideIndex&&this.unhideFn(this.unhideIndex)}},{key:"mousedownHandler",value:function(e){var t=this,i=e,n=this.el,r=this.lineEl,a=this.cRect,o=this.vertical,s=this.minDistance,l=this.IsRight2Left,c=this.maxRowHeight,h=this.maxColWidth,u=o?a.width:a.height;u=Math.round(u),r.show(),Ie(window,(function(e){t.moving=!0,null!==i&&1===e.buttons&&(o?(l?u-=e.movementX:u+=e.movementX,u>s&&u<h&&(l?n.css("left","".concat(a.left-u,"px")):n.css("left","".concat(a.left+u,"px")))):(u+=e.movementY)>s&&u<c&&n.css("top","".concat(a.top+u,"px")),i=e)}),(function(){i=null,r.hide(),t.moving=!1,t.hide(),t.finishedFn&&(u<s&&(u=s),o?u>h&&(u=h):u>c&&(u=c),t.finishedFn(a,u))}))}}]),e}(),Le=function(){function e(t){var i=this;l()(this,e),this.vertical=t,this.moveFn=null,this.el=f("div","".concat(ae,"-scrollbar ").concat(t?"vertical":"horizontal")).child(this.contentEl=f("div","")).on("mousemove.stop",(function(){})).on("scroll.stop",(function(e){var t=e.target,n=t.scrollTop,r=t.scrollLeft;i.moveFn&&i.moveFn(i.vertical?n:r,e)}))}return o()(e,[{key:"move",value:function(e){return this.el.scroll(e),this}},{key:"scroll",value:function(){return this.el.scroll()}},{key:"set",value:function(e,t){var i=e-1;if(t>i){var n=this.vertical?"height":"width";this.el.css(n,"".concat(i-50,"px")).show(),this.contentEl.css(this.vertical?"width":"height","1px").css(n,"".concat(t,"px"))}else this.el.hide();return this}}]),e}(),je=10,ze=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l()(this,e),this.isreadonly=t,this.useHideInput=i,this.inputChange=function(){},this.cornerEl=f("div","".concat(ae,"-selector-corner")),this.areaEl=f("div","".concat(ae,"-selector-area")).child(this.cornerEl).hide(),window.mobileAndTabletCheck()&&this.cornerEl.child(f("div","".concat(ae,"-selector-corner-shape"))),this.clipboardEl=f("div","".concat(ae,"-selector-clipboard")).hide(),this.autofillEl=f("div","".concat(ae,"-selector-autofill")).hide(),this.el=f("div","".concat(ae,"-selector")).css("z-index","".concat(je)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),this.isreadonly&&this.cornerEl.hide(),je+=1}return o()(e,[{key:"setOffset",value:function(e){return this.el.offset(e).show(),this}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"setAreaOffset",value:function(e){var t=e.left,i=e.top,n=e.width,r=e.height,a={width:this.isreadonly?n-2:n+.8,height:this.isreadonly?r-2:r+.8,left:t-.8,top:i-.8};this.areaEl.offset(a).show()}},{key:"setClipboardOffset",value:function(e){var t=e.left,i=e.top,n=e.width,r=e.height;this.clipboardEl.offset({left:t,top:i,width:n-2.4,height:r-2.4})}},{key:"showAutofill",value:function(e){var t=e.left,i=e.top,n=e.width,r=e.height;this.autofillEl.offset({width:n-3,height:r-3,left:t,top:i}).show()}},{key:"hideAutofill",value:function(){this.autofillEl.hide()}},{key:"showClipboard",value:function(){this.clipboardEl.show()}},{key:"hideClipboard",value:function(){this.clipboardEl.hide()}}]),e}();function Be(e){var t=this.data,i=e.left,n=e.top,r=e.width,a=e.height,o=e.scroll,s=e.l,l=e.t,c=t.freezeTotalWidth(),h=t.freezeTotalHeight(),u=t.displayRight2Left?0===c?i:i-(t.viewWidth()-t.cols.indexWidth-c):i-c,f=r;void 0!==o&&(t.displayRight2Left?0===c||(u+r<0?u=19999:u<0&&(f-=o.x)):c>s&&(u-=o.x));var d=n-h;return void 0!==o&&h>l&&(d-=o.y),{left:u,top:d,width:f,height:a}}function He(e){var t=this.data,i=e.left,n=e.width,r=e.height,a=e.l,o=e.t,s=e.scroll,l=t.freezeTotalWidth(),c=t.displayRight2Left?0===l?i:i-(t.viewWidth()-t.cols.indexWidth-l):i-l,h=n;return void 0!==s&&(t.displayRight2Left?0===l||(c+n<0?c=19999:c<0&&(h-=s.x)):l>a&&(c-=s.x)),{left:c,top:o,width:h,height:r}}function Ne(e){var t=this.data,i=e.top,n=e.width,r=e.height,a=e.l,o=e.t,s=e.scroll,l=e.left,c=t.freezeTotalHeight(),h=i-c;return c>o&&(h-=s.y),t.displayRight2Left?{left:l,top:h,width:n,height:r}:{left:a,top:h,width:n,height:r}}function Ue(e){this.br.setAreaOffset(Be.call(this,e))}function Xe(e){this.tl.setAreaOffset(e)}function qe(e){this.t.setAreaOffset(He.call(this,e))}function We(e){this.l.setAreaOffset(Ne.call(this,e))}function Ye(e){this.l.setClipboardOffset(Ne.call(this,e))}function Ve(e){this.br.setClipboardOffset(Be.call(this,e))}function Ge(e){this.tl.setClipboardOffset(e)}function Ze(e){this.t.setClipboardOffset(He.call(this,e))}function Ke(e){Ue.call(this,e),Xe.call(this,e),qe.call(this,e),We.call(this,e)}function Je(e){Ve.call(this,e),Ge.call(this,e),Ze.call(this,e),Ye.call(this,e)}var $e=function(){function e(t){var i=this;l()(this,e),this.inputChange=function(){},this.data=t;var n="edit"!==t.settings.mode;this.br=new ze(n,!0),this.t=new ze(n),this.l=new ze(n),this.tl=new ze(n),this.br.inputChange=function(e){i.inputChange(e)},this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=f("div","".concat(ae,"-selectors")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,je+=1,this.mobilestartOffset=null,this.mobilestartRange=null,this.objId=null}return o()(e,[{key:"getObj",value:function(){if(null===this.objId)return null;var e=this.objId.split("_");return"s"===e[0]?this.data.shapes.filter((function(t){return Number(t.id)===Number(e[1])}))[0]:this.data.images.filter((function(t){return Number(t.id)===Number(e[1])}))[0]}},{key:"setObjId",value:function(e){this.objId=e}},{key:"setMobilestartOffsetAndRange",value:function(){this.mobilestartOffset=this.data.getSelectedRect(),this.mobilestartRange=this.range}},{key:"resetData",value:function(e){this.data=e,this.range=e.selector.range,this.resetAreaOffset()}},{key:"hide",value:function(){this.el.hide()}},{key:"resetOffset",value:function(){var e=this.data,t=this.tl,i=this.t,n=this.l,r=this.br,a=e.freezeTotalHeight(),o=e.freezeTotalWidth();if(a>0||o>0)if(this.data.displayRight2Left){var s=e.viewWidth()-e.cols.indexWidth;t.setOffset({width:s-o,height:a}),i.setOffset({left:s-o,height:a}),n.setOffset({width:s-o,top:a}),r.setOffset({left:s-o,top:a})}else t.setOffset({width:o,height:a}),i.setOffset({left:o,height:a}),n.setOffset({width:o,top:a}),r.setOffset({left:o,top:a});else t.hide(),i.hide(),n.hide(),r.setOffset({left:0,top:0})}},{key:"resetAreaOffset",value:function(){var e=this.data.getSelectedRect(),t=this.data.getClipboardRect();Ke.call(this,e),Je.call(this,t),this.resetOffset()}},{key:"resetBRTAreaOffset",value:function(){var e=this.data.getSelectedRect(),t=this.data.getClipboardRect();this.data.displayRight2Left?0===this.data.freeze[1]?Ue.call(this,e):(We.call(this,e),Xe.call(this,e),Ye.call(this,t),Ge.call(this,t)):(Ue.call(this,e),qe.call(this,e),Ve.call(this,t),Ze.call(this,t)),this.resetOffset()}},{key:"resetBRLAreaOffset",value:function(){var e=this.data.getSelectedRect(),t=this.data.getClipboardRect();Ue.call(this,e),We.call(this,e),Ve.call(this,t),Ye.call(this,t),this.resetOffset()}},{key:"set",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=n.calSelectedRangeByStart(e,t),a=r.sri,o=r.sci;if(i){var s=e,l=t;e<0&&(s=0),t<0&&(l=0),n.selector.setIndexes(s,l),this.indexes=[s,l]}this.moveIndexes=[a,o],this.range=r,this.resetAreaOffset(),this.el.show()}},{key:"setEnd",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=this.lastri,a=this.lastci;if(i){if(e===r&&t===a)return;this.lastri=e,this.lastci=t}this.moveIndexes=[e,t],this.range=n.calSelectedRangeByEnd(e,t),Ke.call(this,this.data.getSelectedRect())}},{key:"setEndMobile",value:function(e,t){Ke.call(this,{width:this.mobilestartOffset.width+e,height:this.mobilestartOffset.height+t,left:this.mobilestartOffset.left,top:this.mobilestartOffset.top})}},{key:"getMobileMultipleSelect",value:function(e,t){var i=this.mobilestartRange,n=i.sri,r=i.sci,a=i.eri,o=i.eci,s=0,l=0,c=a,h=o;if(t>0){for(var u=a+1;u<=this.data.rows.len-1;u++)if((s+=this.data.rows.getHeight(u))>t){c=u-1;break}}else{t=-t;for(u=a;u>=n;u--)if((s+=this.data.rows.getHeight(u))>t){c=u-1;break}c===n-1&&(c=n)}if(e>0){for(var f=o+1;f<=this.data.cols.len-1;f++)if((l+=this.data.cols.getWidth(f))>e){h=f-1;break}}else{e=-e;for(f=o;f>=r;f--)if((l+=this.data.cols.getWidth(f))>e){h=f-1;break}h===r-1&&(h=r)}return[c,h]}},{key:"setMobileMultipleSelect",value:function(e,t){var i=this.getMobileMultipleSelect(e,t),n=r()(i,2),a=n[0],o=n[1];this.setEnd(a,o,!1)}},{key:"setMobile",value:function(e,t,i,n){var r=this.range,a=r.eri,o=r.eci;this.set(e,t),this.lastri=this.lastci=0,this.setEnd(a,o);var s=this.data.getSelectedRect();i=i>s.width+s.left?s.width+s.left:i,n=n>s.height+s.top?s.height+s.top:n,Ke.call(this,{width:s.width+(s.left-i),height:s.height+(s.top-n),left:i,top:n}),this.el.show()}},{key:"reset",value:function(){var e=this.data.selector.range,t=e.eri,i=e.eci;this.setEnd(t,i)}},{key:"showAutofill",value:function(e,t){if(-1!==e||-1!==t){var i=this.range,n=i.sri,r=i.sci,a=i.eri,o=i.eci,s=e,l=t,c=n-e,h=a-e,u=o-t;if(r-t>0)this.arange=new x(n,l,a,r-1);else if(c>0)this.arange=new x(s,r,n-1,o);else if(u<0)this.arange=new x(n,o+1,a,l);else{if(!(h<0))return void(this.arange=null);this.arange=new x(a+1,r,s,o)}if(null!==this.arange){var f=this.data.getRect(this.arange);f.width+=2,f.height+=2;var d=this.br,m=this.l,g=this.t,v=this.tl;d.showAutofill(Be.call(this,f)),m.showAutofill(Ne.call(this,f)),g.showAutofill(He.call(this,f)),v.showAutofill(f)}}}},{key:"hideAutofill",value:function(){var e=this;["br","l","t","tl"].forEach((function(t){e[t].hideAutofill()}))}},{key:"showClipboard",value:function(){var e=this,t=this.data.getClipboardRect();Je.call(this,t),["br","l","t","tl"].forEach((function(t){e[t].showClipboard()}))}},{key:"hideClipboard",value:function(){var e=this;["br","l","t","tl"].forEach((function(t){e[t].hideClipboard()}))}}]),e}();function Qe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var et=function(e){ee()(i,e);var t=Qe(i);function i(e){var n;return l()(this,i),(n=t.call(this,"dialog")).show(),n.setContent(e),n}return o()(i,[{key:"hide",value:function(){this.removeAttr("open")}},{key:"show",value:function(){this.attr("open","")}},{key:"setContent",value:function(e){var t=f("p");t.child(e),this.child(t)}}],[{key:"findDialog",value:function(e){for(var t=[],i=0;i<e.children().length;i++)"dialog"===e.children()[i].localName&&t.push(i);return t}}]),i}(u);function tt(e){e.preventDefault(),e.stopPropagation();var t=this.filterItems;t.length<=0||(this.itemIndex>=0&&(t[this.itemIndex].toggle(),t[this.itemIndex].el.hideHelp()),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=t.length-1),t[this.itemIndex].toggle(),t[this.itemIndex].el.showHelp())}function it(e){e.stopPropagation();var t=this.filterItems;t.length<=0||(this.itemIndex>=0&&(t[this.itemIndex].toggle(),t[this.itemIndex].el.hideHelp()),this.itemIndex+=1,this.itemIndex>t.length-1&&(this.itemIndex=0),t[this.itemIndex].toggle(),t[this.itemIndex].el.showHelp())}function nt(e){e.preventDefault();var t=this.filterItems;t.length<=0||(e.stopPropagation(),this.itemIndex<0&&(this.itemIndex=0),t[this.itemIndex].el.click(),this.hide())}function rt(e,t){t.focusing=!0;var i=e.keyCode;switch(e.ctrlKey&&e.stopPropagation(),i){case 37:e.stopPropagation();break;case 38:tt.call(this,e);break;case 39:e.stopPropagation();break;case 40:it.call(this,e);break;case 13:case 9:nt.call(this,e);break;default:e.stopPropagation()}}var at=function(){function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"200px";l()(this,e),this.filterItems=[],this.items=t,this.el=f("div","".concat(ae,"-suggest")).css("width",n).hide(),this.itemClick=i,this.itemIndex=-1}return o()(e,[{key:"setOffset",value:function(e){this.el.cssRemoveKeys("top","bottom").offset(e)}},{key:"hide",value:function(){var e=this.el;this.filterItems=[],this.itemIndex=-1,e.hide();for(var t=et.findDialog(e.parent()),i=0;i<t.length;i++)e.parent().removeChild(e.parent().children()[t[i]]);Ee(this.el.parent())}},{key:"setItems",value:function(e){this.items=e}},{key:"search",value:function(e){var t,i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.items;if(/^\s*$/.test(e)||(r=r.filter((function(t){return(t.key||t).startsWith(e.toUpperCase())}))),r=r.map((function(e){var t=e.title;t?"function"==typeof t&&(t=t()):t=e;var r=f("div","".concat(ae,"-item")).child("f"===n?e.key:t).on("click.stop",(function(){i.itemClick(e),i.hide()}));return e.label&&r.child(f("div","label").html(e.label)),"f"===n&&(r.el.help=new et(e.title())),r.el.showHelp=function(){var e=i.el.el.offsetTop+i.filterItems[i.itemIndex].el.offsetTop,t=i.el.el.offsetLeft+i.filterItems[i.itemIndex].el.clientWidth+20,n={top:"".concat(e,"px"),left:"".concat(t,"px"),"line-height":"16px",padding:"5px 2px"},r=i.filterItems[i.itemIndex].el.help;r.css(n),i.el.parent().child(r),Re(r,(function(e){for(var t=et.findDialog(i.el.parent()),n=0;n<t.length;n++)i.el.parent().removeChild(i.el.parent().children()[t[n]]);Ee(e)}))},r.el.hideHelp=function(){i.el.parent().contains(i.filterItems[i.itemIndex].el.help.el)&&i.el.parent().removeChild(i.filterItems[i.itemIndex].el.help.el),Ee(i.filterItems[i.itemIndex].el.help)},r})),this.filterItems=r,!(r.length<=0)){var a=this.el;if((t=a.html("")).children.apply(t,m()(r)).show(),"f"===n){for(var o=et.findDialog(a.parent()),s=0;s<o.length;s++)a.parent().removeChild(a.parent().children()[o[s]]);this.itemIndex=0,this.filterItems[this.itemIndex].el.hideHelp(),this.filterItems[this.itemIndex].toggle(),this.filterItems[this.itemIndex].el.showHelp(),Re(a.parent(),(function(){i.hide(),i.filterItems.forEach((function(e){return e.hideHelp()}))}))}}}},{key:"bindInputEvents",value:function(e,t){var i=this;e.on("keydown",(function(e){return rt.call(i,e,t)}))}}]),e}();function ot(e,t){e.setMonth(e.getMonth()+t)}function st(e,t){var i=new Date(e);return i.setDate(t-e.getDay()+1),i}var lt=function(){function e(t){var i,n=this;l()(this,e),this.value=t,this.cvalue=new Date(t),this.headerLeftEl=f("div","calendar-header-left"),this.bodyEl=f("tbody",""),this.buildAll(),this.el=f("div","x-spreadsheet-calendar").children(f("div","calendar-header").children(this.headerLeftEl,f("div","calendar-header-right").children(f("a","calendar-prev").on("click.stop",(function(){return n.prev()})).child(new se("chevron-left")),f("a","calendar-next").on("click.stop",(function(){return n.next()})).child(new se("chevron-right")))),f("table","calendar-body").children(f("thead","").child((i=f("tr","")).children.apply(i,m()(U("calendar.weeks").map((function(e){return f("th","cell").child(e)}))))),this.bodyEl)),this.selectChange=function(){}}return o()(e,[{key:"setValue",value:function(e){this.value=e,this.cvalue=new Date(e),this.buildAll()}},{key:"prev",value:function(){ot(this.value,-1),this.buildAll()}},{key:"next",value:function(){ot(this.value,1),this.buildAll()}},{key:"buildAll",value:function(){this.buildHeaderLeft(),this.buildBody()}},{key:"buildHeaderLeft",value:function(){var e=this.value;this.headerLeftEl.html("".concat(U("calendar.months")[e.getMonth()]," ").concat(e.getFullYear()))}},{key:"buildBody",value:function(){var e,t=this,i=this.value,n=this.cvalue,r=this.bodyEl,a=function(e,t,i){for(var n=new Date(e,t,1,23,59,59),r=[[],[],[],[],[],[]],a=0;a<6;a+=1)for(var o=0;o<7;o+=1){var s=st(n,7*a+o),l=s.getMonth()!==t,c=s.getMonth()===i.getMonth()&&s.getDate()===i.getDate();r[a][o]={d:s,disabled:l,active:c}}return r}(i.getFullYear(),i.getMonth(),n).map((function(e){var i,n=e.map((function(e){var i="cell";return e.disabled&&(i+=" disabled"),e.active&&(i+=" active"),f("td","").child(f("div",i).on("click.stop",(function(){t.selectChange(e.d)})).child(e.d.getDate().toString()))}));return(i=f("tr","")).children.apply(i,m()(n))}));(e=r.html("")).children.apply(e,m()(a))}}]),e}(),ct=function(){function e(){l()(this,e),this.calendar=new lt(new Date),this.el=f("div","".concat(ae,"-datepicker")).child(this.calendar.el).hide()}return o()(e,[{key:"setValue",value:function(e){var t=this.calendar;return"string"==typeof e?/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)&&t.setValue(new Date(e.replace(new RegExp("-","g"),"/"))):e instanceof Date&&t.setValue(e),this}},{key:"change",value:function(e){var t=this;this.calendar.selectChange=function(i){e(i),t.hide()}}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),e}(),ht=[{key:"SUM",title:X("formula.sum"),render:function(e){return e.reduce((function(e,t){return P("+",e,t)}),0)},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"AVERAGE",title:X("formula.average"),render:function(e){return e.reduce((function(e,t){return Number(e)+Number(t)}),0)/e.length},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MAX",title:X("formula.max"),render:function(e){return Math.max.apply(Math,m()(e.map((function(e){return Number(e)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MIN",title:X("formula.min"),render:function(e){return Math.min.apply(Math,m()(e.map((function(e){return Number(e)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"IF",title:X("formula._if"),render:function(e){var t=r()(e,3),i=t[0],n=t[1],a=t[2];return i?n:a},tipInfo:{repeat:!1,args:[{name:"logical_test",required:!0},{name:"value_if_true",required:!1},{name:"value_if_false",required:!1}]}},{key:"AND",title:X("formula.and"),render:function(e){return e.every((function(e){return e}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"OR",title:X("formula.or"),render:function(e){return e.some((function(e){return e}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"CONCAT",title:X("formula.concat"),render:function(e){return e.join("")},tipInfo:{repeat:!0,args:[{name:"text",required:!1}]}},{key:"COUNT",title:X("formula.count"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"value",required:!1}]}},{key:"SUMIF",title:X("formula.sumif"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"range",required:!0},{name:"criteria",required:!1},{name:"sum_range",required:!1}]}},{key:"SUMIFS",title:X("formula.sumifs"),render:function(e){return e},tipInfo:{repeat:!0,repeatstart:1,repeatcount:2,args:[{name:"sum_range",required:!0},{name:"criteria_range",required:!1},{name:"criteria",required:!1}]}},{key:"VLOOKUP",title:X("formula.vlookup"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"table_array",required:!0},{name:"col_index_num",required:!0},{name:"range_lookup",required:!1}]}},{key:"HLOOKUP",title:X("formula.hlookup"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"table_array",required:!0},{name:"row_index_num",required:!0},{name:"range_lookup",required:!1}]}},{key:"LOOKUP",title:X("formula.lookup"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"lookup_vector|array",required:!0},{name:"result_vector",required:!1}]}},{key:"MATCH",title:X("formula.match"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"lookup_array",required:!0},{name:"match_type",required:!1}]}},{key:"RANK",title:X("formula.frequency"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"ref",required:!0},{name:"order",required:!1}]}},{key:"FREQUENCY",title:X("formula.frequency"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"data_array",required:!0},{name:"bins_array",required:!0}]}},{key:"TEXT",title:X("formula.text"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0},{name:"format_text",required:!0}]}},{key:"LEFT",title:X("formula.left"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"num_chars",required:!0}]}},{key:"RIGHT",title:X("formula.right"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"num_chars",required:!0}]}},{key:"ROUND",title:X("formula.round"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"num_digits",required:!0}]}},{key:"INDEX",title:X("formula.index"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"array",required:!0},{name:"row_num",required:!0},{name:"col_num",required:!1}]}},{key:"COUNTIF",title:X("formula.countif"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"range",required:!0},{name:"criteria",required:!0}]}},{key:"COUNTIFS",title:X("formula.countifs"),render:function(e){return e},tipInfo:{repeat:!0,repeatstart:0,repeatcount:2,args:[{name:"criteria_range",required:!1},{name:"criteria",required:!1}]}},{key:"COUNTA",title:X("formula.counta"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"value",required:!1}]}},{key:"AVERAGEIF",title:X("formula.averageif"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"range",required:!0},{name:"criteria",required:!0},{name:"average_range",required:!1}]}},{key:"AVERAGEIFS",title:X("formula.averageifs"),render:function(e){return e},tipInfo:{repeat:!0,repeatstart:1,repeatcount:2,args:[{name:"average_range",required:!0},{name:"criteria_range",required:!1},{name:"criteria",required:!1}]}},{key:"TRIM",title:X("formula.trim"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"SIGN",title:X("formula.sign"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"ABS",title:X("formula.abs"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"TAN",title:X("formula.tan"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"SIN",title:X("formula.sin"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"COS",title:X("formula.cos"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"YIELD",title:X("formula.yield"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"settlement",required:!0},{name:"maturity",required:!0},{name:"rate",required:!0},{name:"pr",required:!0},{name:"redemption",required:!0},{name:"frequency",required:!0},{name:"basis",required:!1}]}},{key:"MID",title:X("formula.mid"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"start_num",required:!0},{name:"num_chars",required:!0}]}},{key:"LEN",title:X("formula.len"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"POWER",title:X("formula.power"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"power",required:!0}]}},{key:"CEILING",title:X("formula.ceiling"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"significance",required:!0}]}},{key:"FLOOR",title:X("formula.floor"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"significance",required:!0}]}},{key:"SUBSTITUTE",title:X("formula.substitute"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"old_text",required:!0},{name:"new_text",required:!0},{name:"instance_num",required:!1}]}},{key:"REPLACE",title:X("formula.replace"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"old_text",required:!0},{name:"start_num",required:!0},{name:"num_chars",required:!0},{name:"new_text",required:!0}]}},{key:"SEARCH",title:X("formula.search"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"find_text",required:!0},{name:"within_text",required:!0},{name:"start_num",required:!1}]}},{key:"FIND",title:X("formula.find"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"find_text",required:!0},{name:"within_text",required:!0},{name:"start_num",required:!1}]}},{key:"ISNUMBER",title:X("formula.isnumber"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0}]}},{key:"ISTEXT",title:X("formula.istext"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0}]}},{key:"ISBLANK",title:X("formula.isblank"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0}]}},{key:"UPPER",title:X("formula.upper"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"LOWER",title:X("formula.lower"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"PRODUCT",title:X("formula.product"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"SUMPRODUCT",title:X("formula.sumproduct"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"array",required:!1}]}},{key:"SUBTOTAL",title:X("formula.subtotal"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"function_num",required:!0},{name:"ref",required:!1}]}}],ut=ht,ft={};function dt(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return mt(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return mt(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}ht.forEach((function(e){ft[e.key]=e}));var gt=function(){function e(){l()(this,e),this.el=f("div").hide(),this.el.css({position:"absolute",padding:"5px",color:"#000","border-radius":"1px","font-size":"12px","z-index":"201","line-height":"10px","min-width":"20px",background:"#fff",border:"1px solid",top:"30px",left:"0px","white-space":"nowrap"})}return o()(e,[{key:"tipContent",value:function(e,t){if(void 0===e)return"";var i=e.tipInfo.args.slice(),n=e.tipInfo.repeat,r=e.tipInfo.repeatstart,a=e.tipInfo.repeatcount,o=[];if(n){void 0===r&&(r=i.length-1,a=1);for(var s=r;s<r+a;s++)o.push(i[s].name);i.splice(r,a)}var l=[];o.length>0&&function(){for(var e=1;i.length<t+2;)o.forEach((function(t){var n=t+e;i.push({name:n,required:!1})})),e++;i.push({name:"...",required:!0})}();for(var c=0;c<i.length;c++){var h=i[c].name;c>0&&!i[c].required&&c>=r+a&&((c-r)%a==0&&(h="["+h),(c-r)%a==a-1&&(h+="]")),l.push(h)}return l[t]="<strong>".concat(l[t],"</strong>"),"".concat(e.key.toUpperCase(),"(").concat(l.join(", "),")")}},{key:"hide",value:function(){this.el.hide()}},{key:"show",value:function(e){if(-1!==e.startsWith("=")){var t,i="",n=[],r=[],a=dt(e.substring(1));try{for(a.s();!(t=a.n()).done;){var o=t.value;switch(o){case"(":n.unshift(i),r.unshift(0),i="";break;case")":n.shift(),r.shift();break;case",":r[0]++,i="";break;case"=":break;default:i+=o}}}catch(e){a.e(e)}finally{a.f()}var s=ht.find((function(e){return void 0!==n[0]&&e.key===n[0].toUpperCase()})),l=this.tipContent(s,r[0]);this.el.html(l),""!==l&&this.el.show(),""===l?this.el.hide():this.el.show(),Re(this.el)}}}]),e}(),vt=[{key:"Arial",title:"Arial"},{key:"Arial Black",title:"Arial Black"},{key:"Comic Sans",title:"Comic Sans"},{key:"Comic Sans MS",title:"Comic Sans MS"},{key:"Courier New",title:"Courier New"},{key:"Georgia",title:"Georgia"},{key:"Impact",title:"Impact"},{key:"Lucida Console",title:"Lucida Console"},{key:"Lucida Sans",title:"Lucida Sans"},{key:"Palatino",title:"Palatino"},{key:"Tahoma",title:"Tahoma"},{key:"Times New Roman",title:"Times New Roman"},{key:"Trebuchet",title:"Trebuchet"},{key:"Verdana",title:"Verdana"},{key:"Lato",title:"Lato"},{key:"Helvetica",title:"Helvetica"},{key:"Source Sans Pro",title:"Source Sans Pro"}],pt=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48},{pt:42,px:56}];function yt(e){for(var t=0;t<pt.length;t+=1){var i=pt[t];if(i.pt===e)return i.px}return e}var bt=function(e){for(var t=[],i=[],n=[],a=0,o="",s=1,l="",c=0;c<e.length;c+=1){var h=e.charAt(c);if(" "!==h){if(h>="a"&&h<="z")n.push(h.toUpperCase());else if(h>="0"&&h<="9"||h>="A"&&h<="Z"||"."===h)n.push(h);else if('"'===h){for(c+=1;'"'!==e.charAt(c);)n.push(e.charAt(c)),c+=1;i.push('"'.concat(n.join(""))),n=[]}else if("-"===h&&/[+\-*/,(]/.test(l))n.push(h);else{if("("!==h&&n.length>0&&i.push(n.join("")),")"===h){var u=t.pop();if(2===a)try{for(var f=y(i.pop()),d=r()(f,2),m=d[0],g=d[1],v=y(i.pop()),p=r()(v,2),w=p[0],x=p[1],k=0,C=w;C<=m;C+=1)for(var S=x;S<=g;S+=1)i.push(b(C,S)),k+=1;i.push([u,k])}catch(e){}else if(1===a||3===a)3===a&&i.push(o),i.push([u,s]),s=1;else for(;"("!==u&&(i.push(u),!(t.length<=0));)u=t.pop();a=0}else if("="===h||">"===h||"<"===h){var _=e.charAt(c+1);o=h,"="!==_&&"-"!==_||(o+=_,c+=1),a=3}else if(":"===h)a=2;else if(","===h)3===a&&i.push(o),a=1,s+=1;else if("("===h&&n.length>0)t.push(n.join(""));else{if(t.length>0&&("+"===h||"-"===h)){var T=t[t.length-1];if("("!==T&&i.push(t.pop()),"*"===T||"/"===T)for(;t.length>0&&"("!==(T=t[t.length-1]);)i.push(t.pop())}t.push(h)}n=[]}l=h}}for(n.length>0&&i.push(n.join(""));t.length>0;)i.push(t.pop());return i},wt=function(e,t){var i=r()(e,1)[0],n=e;if('"'===i)return e.substring(1);var a=1;if("-"===i&&(n=e.substring(1),a=-1),n[0]>="0"&&n[0]<="9")return a*Number(n);var o=y(n),s=r()(o,2);return a*t(s[0],s[1])},xt=function(e,t,i,n){for(var a=[],o=0;o<e.length;o+=1){var s=e[o],l=s[0];if("+"===s){var c=a.pop();a.push(P("+",a.pop(),c))}else if("-"===s)if(1===a.length){var h=a.pop();a.push(P("*",h,-1))}else{var u=a.pop();a.push(P("-",a.pop(),u))}else if("*"===s)a.push(P("*",a.pop(),a.pop()));else if("/"===s){var f=a.pop();a.push(P("/",a.pop(),f))}else if("="===l||">"===l||"<"===l){var d=a.pop();Number.isNaN(d)||(d=Number(d));var m=a.pop();Number.isNaN(m)||(m=Number(m));var g=!1;"="===l?g=m===d:">"===s?g=m>d:">="===s?g=m>=d:"<"===s?g=m<d:"<="===s&&(g=m<=d),a.push(g)}else if(Array.isArray(s)){for(var v=r()(s,2),p=v[0],y=v[1],b=[],w=0;w<y;w+=1)b.push(a.pop());a.push(t[p].render(b.reverse()))}else{if(n.includes(s))return 0;(l>="a"&&l<="z"||l>="A"&&l<="Z")&&n.push(s),a.push(wt(s,i)),n.pop()}}return a[0]},kt=function e(t,i,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if("="===t[0]){var a=bt(t.substring(1));return a.length<=0?t:xt(a,i,(function(t,a){return e(n(t,a),i,n,r)}),r)}return t},Ct=function(e){return e},St=function(e){if(/^(-?\d*.?\d*)$/.test(e)){var t=Number(e).toFixed(2).toString().split("\\."),i=h()(t),n=i[0],r=i.slice(1);return[n.toLocaleString()].concat(m()(r))}return e},_t=[{key:"normal",title:X("format.normal"),type:"string",render:Ct},{key:"text",title:X("format.text"),type:"string",render:Ct},{key:"number",title:X("format.number"),type:"number",label:"1,000.12",render:St},{key:"percent",title:X("format.percent"),type:"number",label:"10.12%",render:function(e){return"".concat(e,"%")}},{key:"rmb",title:X("format.rmb"),type:"number",label:"¥10.00",render:function(e){return"¥".concat(St(e))}},{key:"usd",title:X("format.usd"),type:"number",label:"$10.00",render:function(e){return"$".concat(St(e))}},{key:"eur",title:X("format.eur"),type:"number",label:"€10.00",render:function(e){return"€".concat(St(e))}},{key:"date",title:X("format.date"),type:"date",label:"26/09/2008",render:Ct},{key:"time",title:X("format.time"),type:"date",label:"15:59:00",render:Ct},{key:"datetime",title:X("format.datetime"),type:"date",label:"26/09/2008 15:59:00",render:Ct},{key:"duration",title:X("format.duration"),type:"date",label:"24:01:00",render:Ct}],Tt={};function Ot(){return window.devicePixelRatio||1}function Et(){return Ot()-.5}function Rt(e){return parseInt(e*Ot(),10)}function It(e){var t=Math.ceil(e/Ot());return Rt(t)===e?t:t-1}function At(e){var t=Rt(e);return t>0?t-.5:.5}_t.forEach((function(e){Tt[e.key]=e}));var Dt=function(){function e(t,i,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;l()(this,e),this.x=t,this.y=i,this.width=n,this.height=r,this.padding=a,this.bgcolor="#ffffff",this.borderTop=null,this.borderRight=null,this.borderBottom=null,this.borderLeft=null,this.pbgcolor=null,this.pattern=null}return o()(e,[{key:"setBorders",value:function(e){var t=e.top,i=e.bottom,n=e.left,r=e.right;t&&(this.borderTop=t),r&&(this.borderRight=r),i&&(this.borderBottom=i),n&&(this.borderLeft=n)}},{key:"setPading",value:function(e,t){this.lpading=e,this.rpading=t}},{key:"setPattern",value:function(e){e&&(this.pattern=e)}},{key:"resize",value:function(e,t){this.width=e,this.height=t}},{key:"innerWidth",value:function(){return this.lpading||this.rpading?this.width-(this.lpading+this.rpading)-2:this.width-2*this.padding-2}},{key:"innerHeight",value:function(){return this.height-2*this.padding-2}},{key:"textx",value:function(e){var t=this.width,i=this.padding,n=this.lpading,r=this.rpading,a=this.x;return"left"===e?a+=n||i:"center"===e?a+=t/2:"right"===e&&(a+=t-(r||i)),a}},{key:"texty",value:function(e,t){var i=this.height,n=this.padding,r=this.y;return"top"===e?r+=n:"middle"===e?r+=i/2-t/2:"bottom"===e&&(r+=i-n-t),r}},{key:"topxys",value:function(){var e=this.x,t=this.y;return[[e,t],[e+this.width,t]]}},{key:"rightxys",value:function(){var e=this.x,t=this.y,i=this.width;return[[e+i,t],[e+i,t+this.height]]}},{key:"bottomxys",value:function(){var e=this.x,t=this.y,i=this.width,n=this.height;return[[e,t+n],[e+i,t+n]]}},{key:"leftxys",value:function(){var e=this.x,t=this.y;return[[e,t],[e,t+this.height]]}}]),e}();function Pt(e,t,i,n,r,a,o){var s={x:0,y:0};"underline"===e?s.y="bottom"===r?0:"top"===r?-(a+2):-a/2:"strike"===e&&("bottom"===r?s.y=a/2:"top"===r&&(s.y=-(a/2+2))),"center"===n?s.x=o/2:"right"===n&&(s.x=o),this.line([t-s.x,i-s.y],[t-s.x+o,i-s.y])}function Ft(e,t,i,n,r,a){for(var o=i;o<r;o+=a)e.moveTo(t,o),e.lineTo(n,o)}function Mt(e,t,i,n,r,a){for(var o=t;o<n;o+=a)e.moveTo(o,i),e.lineTo(o,r)}function Lt(e,t,i,n,r,a){for(var o=t,s=o+a;s<=n;s+=a)e.moveTo(s,r),e.lineTo(o,i),o+=a}function jt(e,t,i,n,r,a){for(var o=t,s=o+a;s<=n;s+=a)e.moveTo(o,r),e.lineTo(s,i),o+=a}function zt(e,t,i,n,r,a){for(var o=i;o<r;o+=a)e.moveTo(t,o),e.lineTo(n,o)}var Bt=function(){function e(t,i,n){l()(this,e),this.width=i,this.height=n,this.ctx=t,this.ctx.scale(Ot(),Ot())}return o()(e,[{key:"setel",value:function(e){var t=this.width,i=this.height;this.el=e,this.ctx=e.getContext("2d"),this.resize(t,i),this.ctx.scale(Ot(),Ot())}},{key:"resize",value:function(e,t){this.width=e,this.height=t,this.el.style.width="".concat(e,"px"),this.el.style.height="".concat(t,"px"),this.el.width=Rt(e),this.el.height=Rt(t)}},{key:"clear",value:function(){var e=this.width,t=this.height;return this.ctx.clearRect(0,0,Rt(e),Rt(t)),this}},{key:"attr",value:function(e){return Object.assign(this.ctx,e),this}},{key:"save",value:function(){return this.ctx.save(),this.ctx.beginPath(),this}},{key:"restore",value:function(){return this.ctx.restore(),this}},{key:"beginPath",value:function(){return this.ctx.beginPath(),this}},{key:"translate",value:function(e,t){return this.ctx.translate(Rt(e),Rt(t)),this}},{key:"scale",value:function(e,t){return this.ctx.scale(e,t),this}},{key:"scaledpr",value:function(e){this.scale(e,e)}},{key:"clearRect",value:function(e,t,i,n){return this.ctx.clearRect(e,t,i,n),this}},{key:"fillRectWithColor",value:function(e,t,i,n,r,a,o){var s,l,c=this.ctx;this.save(),void 0!==e&&(c.fillStyle=o?(s=o,l=e.slice(1),"rgba("+[parseInt("0x"+l.slice(0,2)),parseInt("0x"+l.slice(2,4)),parseInt("0x"+l.slice(4,6)),1-s].toString()+")"):e),this.fillRect(t,i,n,r),a&&(c.globalCompositeOperation="lighter",c.fillStyle="rgba(255, 255, 255, 0.8)",this.fillRect(t,i,n,r)),this.restore()}},{key:"fillRect",value:function(e,t,i,n){return this.ctx.fillRect(Rt(e)-.5,Rt(t)-.5,Rt(i),Rt(n)),this}},{key:"fillText",value:function(e,t,i){return this.ctx.fillText(e,Rt(t),Rt(i)),this}},{key:"richtext",value:function(e,t,i,n){var r=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5?arguments[5]:void 0,s=this.ctx,l=e.bigfontsize,c=e.rtxt,h=e.text,u=e.isactiveeffect,f=h.length,d=t.exttxtwidth?t.exttxtwidth+t.innerWidth():t.innerWidth();if(!(d<=0)){var m=t.textx(i);s.save(),s.beginPath();var g=this;this.attr({textAlign:"center"===i?"right":i,textBaseline:"bottom"});var v=[],p=[],y=c.length;if(a)for(var b=function(e){var t=c[e],i=[],n=0,r=0,a=0;t.forEach((function(e){g.attr({font:"".concat(e.font.italic?"italic":""," ").concat(e.font.bold?"bold":""," ").concat(Rt(e.font.size),"pt ").concat(e.font.name)});var t=s.measureText(e.txt).width;if(r=n,(n+=t)>Rt(d)){for(var o={w:r,len:0,start:0},l=0;l<e.txt.length;)if(o.w+=s.measureText(e.txt[l]).width+1,o.w>=Rt(d)){if(o.len===o.start&&0===i.length&&(o.len+=1,l++),o.len>o.start){var c={};c.font=e.font,c.txt=e.txt.substring(o.start,o.len),c.notorigindivide=!0,i.push(c),e.font.size>a&&(a=e.font.size)}v.push(i),p.push(a),o={w:0,len:l,start:l},n=0,i=[],a=0}else o.len+=1,l++;if(o.len>o.start){var h={};h.font=e.font,h.txt=e.txt.substring(o.start,o.len),i.push(h),e.font.size>a&&(a=e.font.size),n=o.w}}else i.push(e),e.font.size>a&&(a=e.font.size)})),v.push(i),p.push(a)},w=0;w<y;w++)b(w);else v=c,p=l;for(var x=p.length,k=0,C=0;C<x;C++)k+=p[C]+8;var S=[],_=[];if("center"===i||"right"===i)for(var T=0;T<x;T++){var O=v[T],E=0;O.forEach((function(e){g.attr({font:"".concat(e.font.italic?"italic":""," ").concat(e.font.bold?"bold":""," ").concat(Rt(e.font.size),"pt ").concat(e.font.name),fillStyle:e.font.color,strokeStyle:e.font.color}),E+=It(s.measureText(e.txt).width)})),_.push(E)}if(0==o.length&&o.push(null),o.forEach((function(e){for(var a=t.texty(n,k),o=0,l=!1,c=!1,d=function(t){var n=v[t],d=0,y=m,b=y,w=y,x=p[t]+8,k=_.length>0?_[t]:0;"center"===i?b=y-k/2:"right"===i&&(b=y-k);var C=b;a+=x,n.forEach((function(t){g.attr({font:"".concat(t.font.italic?"italic":""," ").concat(t.font.bold?"bold":""," ").concat(Rt(t.font.size),"pt ").concat(t.font.name),fillStyle:u?"#217346":t.font.color,strokeStyle:u?"#217346":t.font.color});var n=It(s.measureText(t.txt).width);if(w=C+n,null!==e){for(var m=e.start;"\n"===h[m++]&&m<e.end&&m<f;)e.start=m;if(o<=e.start&&e.start<o+t.txt.length){l=!0;var v=t.txt.substr(0,e.start-o),p=It(s.measureText(v).width);b=C+p}if(o<e.end&&e.end<=o+t.txt.length){var _=t.txt.substr(0,e.end-o),T=It(s.measureText(_).width);w=C+T,l=!1,S.push({x:b,y:a-x,w:w-b,h:x})}}d+=n;var O=0;"center"===i?O=k/2-d:"right"===i&&(O=k-d),c||r.fillText(t.txt,y-O,a),"center"===i&&(O+=n/2),!c&&t.font.strike&&Pt.call(r,"strike",y-O,a,i,"bottom",t.font.size,n),!c&&t.font.underline&&Pt.call(r,"underline",y-O,a,i,"bottom",t.font.size,n),"left"===i&&(y+=n),C+=n,o+=t.txt.length})),null!==e&&l&&S.push({x:b,y:a-x,w:w-b,h:x});var T=n.length;T>0&&n[T-1].notorigindivide||o++},y=0;y<x;y++)d(y);c||(c=!0)})),s.restore(),null!=o[0]){s.save(),this.attr({fillStyle:o[0].color});for(var R=0,I=S.length;R<I;R++){var A=S[R];this.fillRect(A.x,A.y,A.w,A.h)}s.restore()}return this}}},{key:"text",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4?arguments[4]:void 0,o=this.ctx,s=n.align,l=n.valign,c=n.font,h=n.color,u=n.strike,f=n.underline,d=t.textx(s);o.save(),o.beginPath(),this.attr({textAlign:s,textBaseline:l,font:"".concat(c.italic?"italic":""," ").concat(c.bold?"bold":""," ").concat(Rt(c.size),"px ").concat(c.name),fillStyle:h,strokeStyle:h});var m="".concat(e).split("\n"),g=t.exttxtwidth?t.exttxtwidth+t.innerWidth():t.innerWidth(),v=[];m.forEach((function(e){var t=o.measureText(e).width;if(r&&t>Rt(g)){for(var i={w:0,len:0,start:0},n=0;n<e.length;n+=1)i.w>=Rt(g)&&(v.push(e.substr(i.start,i.len)),i={w:0,len:0,start:n}),i.len+=1,i.w+=o.measureText(e[n]).width+1;i.len>0&&v.push(e.substr(i.start,i.len))}else v.push(e)}));var p=(v.length-1)*(c.size+2),y=!1,b=[];if(0==a.length&&a.push(null),a.forEach((function(e){var n=t.texty(l,p),r=0,a=!1;v.forEach((function(t){var h=o.measureText(t).width,m=d,g=d+It(h);if(null!==e){if(r<=e.start&&e.start<r+t.length){a=!0;var v=t.substr(0,e.start-r),p=It(o.measureText(v).width);m+=p,It(h)-p}if(r<e.end&&e.end<r+t.length){var w=t.substr(0,e.end-r),x=It(o.measureText(w).width);g=d+x}if(r>e.end&&(a=!1),a){var k={x:0,y:0};k.y="bottom"===l?c.size+2:"top"===l?2:(c.size+2)/2,"center"===s?k.x=It(h/2):"right"===s&&(k.x=It(h)),b.push({x:m-k.x,y:n-k.y,w:g-m,h:c.size+2})}}y||(i.fillText(t,d,n),u&&Pt.call(i,"strike",d,n,s,l,c.size,It(h)),f&&Pt.call(i,"underline",d,n,s,l,c.size,It(h))),n+=c.size+2,r+=t.length+1})),y||(y=!0)})),o.restore(),null!==a[0]){o.save(),this.attr({fillStyle:a[0].color});for(var w=0,x=b.length;w<x;w++){var k=b[w];this.fillRect(k.x,k.y,k.w,k.h)}o.restore()}return this}},{key:"border",value:function(e,t){var i=this.ctx;return i.lineWidth=Et,i.strokeStyle=t,"medium"===e?i.lineWidth=Rt(2)-.5:"thick"===e?i.lineWidth=Rt(3):"dashed"===e?i.setLineDash([Rt(3),Rt(2)]):"dotted"===e?i.setLineDash([Rt(1),Rt(1)]):"double"===e&&i.setLineDash([Rt(2),0]),this}},{key:"line",value:function(){var e=this.ctx;if(arguments.length>1){e.beginPath();var t=arguments.length<=0?void 0:arguments[0],i=r()(t,2),n=i[0],a=i[1];e.moveTo(At(n),At(a));for(var o=1;o<arguments.length;o+=1){var s=o<0||arguments.length<=o?void 0:arguments[o],l=r()(s,2),c=l[0],h=l[1];e.lineTo(At(c),At(h))}e.stroke()}return this}},{key:"strokeBorders",value:function(e){var t=this.ctx;t.save();var i=e.borderTop,n=e.borderRight,r=e.borderBottom,a=e.borderLeft;i&&(this.border.apply(this,m()(i)),this.line.apply(this,m()(e.topxys()))),n&&(this.border.apply(this,m()(n)),this.line.apply(this,m()(e.rightxys()))),r&&(this.border.apply(this,m()(r)),this.line.apply(this,m()(e.bottomxys()))),a&&(this.border.apply(this,m()(a)),this.line.apply(this,m()(e.leftxys()))),t.restore()}},{key:"strokePattern",value:function(e){var t=this.ctx;t.save();var i=e.x,n=e.y,r=e.width,a=e.height,o=e.pattern;if(o){t.beginPath();var s=At(i),l=s+Rt(r),c=At(n),h=c+Rt(a);switch(o){case"None":case"Solid":break;case"HorizontalStripe":t.lineWidth=2,t.setLineDash([]),Ft(t,s,c,l,h,4);break;case"ThinHorizontalStripe":t.lineWidth=1,t.setLineDash([]),Ft(t,s,c,l,h,4);break;case"Gray75":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,3);break;case"VerticalStripe":t.lineWidth=2,t.setLineDash([]),Mt(t,s,c,l,h,4);break;case"ThinVerticalStripe":t.lineWidth=1,t.setLineDash([]),Mt(t,s,c,l,h,4);break;case"Gray50":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,3.5);break;case"ReverseDiagonalStripe":t.lineWidth=2,t.setLineDash([]),Lt(t,s,c,l,h,4);break;case"ThinReverseDiagonalStripe":t.lineWidth=1,t.setLineDash([]),Lt(t,s,c,l,h,4);break;case"Gray25":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,4);break;case"DiagonalStripe":t.lineWidth=2,t.setLineDash([]),jt(t,s,c,l,h,4);break;case"ThinDiagonalStripe":t.lineWidth=1,t.setLineDash([]),jt(t,s,c,l,h,4);break;case"Gray12":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,4.5);break;case"DiagonalCrosshatch":t.lineWidth=1.5,t.setLineDash([]),Lt(t,s,c,l,h,4),jt(t,s,c,l,h,4);break;case"ThinHorizontalCrosshatch":t.lineWidth=1,t.setLineDash([]),Ft(t,s,c,l,h,4),Mt(t,s,c,l,h,4);break;case"Gray6":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,5);break;case"ThickDiagonalCrosshatch":t.lineWidth=2,t.setLineDash([]),Lt(t,s,c,l,h,4),jt(t,s,c,l,h,4);break;case"ThinDiagonalCrosshatch":t.lineWidth=1,t.setLineDash([]),Lt(t,s,c,l,h,4),jt(t,s,c,l,h,4)}t.closePath(),t.stroke()}t.restore()}},{key:"dropdown",value:function(e){var t=this.ctx,i=e.x,n=e.y,r=i+e.width-15,a=n+e.height-15;t.save(),t.beginPath(),t.moveTo(Rt(r),Rt(a)),t.lineTo(Rt(r+8),Rt(a)),t.lineTo(Rt(r+4),Rt(a+6)),t.closePath(),t.fillStyle="rgba(0, 0, 0, .45)",t.fill(),t.restore()}},{key:"error",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=n+a-1;i.save(),i.beginPath(),t?(i.moveTo(Rt(o-a+8),Rt(r-1)),i.lineTo(Rt(o-a),Rt(r-1)),i.lineTo(Rt(o-a),Rt(r+8))):(i.moveTo(Rt(o-8),Rt(r-1)),i.lineTo(Rt(o),Rt(r-1)),i.lineTo(Rt(o),Rt(r+8))),i.closePath(),i.fillStyle="rgba(255, 0, 0, .65)",i.fill(),i.restore()}},{key:"frozen",value:function(e){var t=this.ctx,i=e.x,n=e.y,r=i+e.width-1;t.save(),t.beginPath(),t.moveTo(Rt(r-8),Rt(n-1)),t.lineTo(Rt(r),Rt(n-1)),t.lineTo(Rt(r),Rt(n+8)),t.closePath(),t.fillStyle="rgba(0, 255, 0, .85)",t.fill(),t.restore()}},{key:"line2",value:function(){var e=this.ctx;if(arguments.length>1){e.beginPath();var t=arguments.length<=0?void 0:arguments[0],i=r()(t,2),n=i[0],a=i[1];e.moveTo(n,a);for(var o=1;o<arguments.length;o+=1){var s=o<0||arguments.length<=o?void 0:arguments[o],l=r()(s,2),c=l[0],h=l[1];e.lineTo(c,h)}e.stroke()}return this}},{key:"rect3",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=e.height,s=t.bgColor,l=t.isactiveeffect,c=t.tp;s&&this.fillRectWithColor(s,n,r,a,o,l,c),i.save(),i.beginPath(),i.rect(Rt(n)-.5,Rt(r)-.5,Rt(a),Rt(o)),i.closePath(),i.strokeStyle="black",i.stroke(),i.restore()}},{key:"rect2",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=e.height,s=e.bgcolor,l=e.pbgcolor,c=e.exttxtwidthR,h=e.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(n+1,r+1,a-2,o-2),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(n+1-f,r+1,a+u+f-2,o-2),i.clip(),t(),i.restore()}else t(),i.restore()}},{key:"rect",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=e.height,s=e.bgcolor,l=e.pbgcolor,c=e.exttxtwidthR,h=e.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(At(n+1),At(r+1),Rt(a-2),Rt(o-2)),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(At(n+1-f),At(r+1),Rt(a+u+f-2),Rt(o-2)),i.clip(),t(),i.restore()}else t(),i.restore()}}]),e}();function Ht(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return Nt(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Nt(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ut={fillStyle:"#f4f5f8"},Xt={fillStyle:"#fff",lineWidth:Et,strokeStyle:"#e6e6e6"};function qt(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=e.cellRect(t,i),a=r.left,o=r.top,s=r.width,l=r.height;return new Dt(a,o+n,s,l,3)}function Wt(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.cellRect(t.sri,t.sci),r=n.left,a=n.top,o=e.cols.sumWidth(t.sci,t.eci+1),s=e.rows.sumHeight(t.sri,t.eri+1);return new Dt(r,a+i,o,s,3)}function Yt(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Wt(e,t,i);return n.width+=3,n.height+=3,n}function Vt(e,t,i,n,r,a,o){var s=e.cols,l=e.viewRangeCache;if(!o.textwrap&&a.text&&a.text.length>0){var c=0,h=0;if(void 0===o.align||"center"===o.align||"left"===o.align)for(var u=r+1;u<=l.eci;u++){var f=e.getCell(i,u);if(null!==f&&void 0!==f.text&&f.text.length>0)break;c+=s.getWidth(u)}if(o.align&&("center"===o.align||"right"===o.align))for(var d=r-1;d>=l.sci;d--){var m=e.getCell(i,d);if(null!==m&&void 0!==m.text&&m.text.length>0)break;h+=s.getWidth(d)}c>0&&(t.exttxtwidthR=c),h>0&&(t.exttxtwidthL=h)}}function Gt(e){if(void 0!==e.rtxt&&void 0===e.bigfontsize){for(var t=[],i=[],n=[],r=0,a=e.rtxt.length,o=0;o<a;o++){var s=e.rtxt[o].txt.split("\n"),l=s.length,c=e.rtxt[o].font.size;if(1===l)n.push(e.rtxt[o]),c>r&&(r=c);else{if(0!==s[0].length){var h={};h.font=e.rtxt[o].font,h.txt=s[0],n.push(h),c>r&&(r=c)}i.push(r),t.push(n),n=[],r=0;for(var u=1;u<l-1;u++){var f={};f.font=e.rtxt[o].font,f.txt=s[u],n.push(f),t.push(n),i.push(c),n=[],r=0}if(0!==s[l-1].length){var d={};d.font=e.rtxt[o].font,d.txt=s[l-1],n.push(d),r=c}}}n.length>0&&(i.push(r),t.push(n)),e.rtxt=t,e.bigfontsize=i}}function Zt(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=t.sortedRowMap,s=t.rows,l=t.cols;t.viewRangeCache;if(!s.isHide(i)&&!l.isHide(n)){var c=i;o.has(i)&&(c=o.get(i));var h=t.getCell(c,n);if(null!==h&&(!h.merge||a)){Gt(h);var u=!1;"editable"in h&&!1===h.editable&&(u=!0);var f=t.getCellStyleOrDefault(c,n),d=qt(t,i,n,r);d.bgcolor=f.bgcolor,d.pbgcolor=f.pbgcolor;var m=d,g=!1,v=!1;f.hasbgcolor&&!a&&((t.bgcolor||void 0===f.border||void 0===f.border.right)&&(m.width+=3,g=!0),(t.bgcolor||void 0===f.border||void 0===f.border.bottom)&&(m.height+=3,v=!0)),Vt(t,d,c,0,n,h,f);var p=t.getHighlightCellTxt(i,n);e.rect(m,(function(){var i="";i=t.settings.evalPaused||"server"===t.settings.updateMode?h.text||"":kt(h.text||"",ft,(function(e,i){return t.getCellTextOrDefault(i,e)})),f.format&&"server"!==t.settings.updateMode&&(i=Tt[f.format].render(i));var r=Object.assign({},f.font);r.size=yt(r.size),void 0===h.rtxt?""!==i&&e.text(i,d,{align:f.align,valign:f.valign,font:r,color:f.color,strike:f.strike,underline:f.underline},f.textwrap,p):e.richtext(h,d,f.align,f.valign,f.textwrap,p),t.validations.getError(c,n)&&e.error(d),u&&e.frozen(d),void 0!==f.pattern&&(d.setPattern(f.pattern),e.strokePattern(d))})),void 0!==f.border&&(g&&(d.width-=3),v&&(d.height-=3),d.setBorders(f.border),e.strokeBorders(d))}}}function Kt(e){var t=this.data,i=this.draw;if(e){var n=t.autoFilter,r=t.TableAutoFilters;Jt(t,e,i,n),r.forEach((function(n){Jt(t,e,i,n)}))}}function Jt(e,t,i,n){if(n.active()){var r=n.hrange();t.intersects(r)&&r.each((function(t,n){var r=qt(e,t,n);i.dropdown(r)}))}}function $t(e,t,i,n,r){var a=this.draw,o=this.data;a.save(),o.displayRight2Left?a.translate(-t,i).translate(n,r):a.translate(t,i).translate(n,r),o.comments.forEach((function(t){if(e.sri<=t.row&&e.eri>=t.row&&e.sci<=t.col&&e.eci>=t.col){var i=qt(o,t.row,t.col);a.error(i,o.displayRight2Left)}})),a.restore()}function Qt(e,t,i,n,r){var a=this.draw,o=this.data;a.save(),o.displayRight2Left?a.translate(-t,i).translate(n,r):a.translate(t,i).translate(n,r);var s=o.exceptRowSet;a.save(),a.translate(0,-0),e.emptyFirst((function(e,t){Zt(a,o,e,t)}),(function(e){return function(e){return!s.has(e)}(e)}),(function(e,t){return o.isEmpty(e,t)})),a.restore();var l=new Set;a.save(),a.translate(0,-0),o.eachMergesInView(e,(function(e){var t=e.sri,i=e.sci,n=e.eri;if(s.has(t)){if(!l.has(t)){l.add(t);var r=o.rows.sumHeight(t,n+1);a.translate(0,-r)}}else Zt(a,o,t,i,0,!0)})),a.restore(),Kt.call(this,e),a.restore()}function ei(e,t,i,n){var r=this.draw;r.save(),r.attr({fillStyle:"rgba(75, 137, 255, 0.08)"}).fillRect(e,t,i,n),r.restore()}function ti(e,t,i,n,r,a){var o=this,s=this.draw,l=this.data,c=t.h,h=t.w,u=a+n,f=r+i,d=l.displayRight2Left?l.viewWidth():0,m=l.displayRight2Left?d-i:0;if(s.save(),s.attr(Ut),"all"!==e&&"left"!==e||s.fillRect(m,u,i,c),"all"===e||"top"===e)if(l.displayRight2Left){var g=t.lineStartx?t.lineStartx:0;s.fillRect(g,0,h,n)}else s.fillRect(f,0,h,n);var p=l.selector.range,y=p.sri,b=p.sci,w=p.eri,x=p.eci;if(s.attr({textAlign:"center",textBaseline:"middle",font:"500 ".concat(Rt(12),"px Source Sans Pro"),fillStyle:"#585757",lineWidth:Et(),strokeStyle:"#e6e6e6"}),"all"===e||"left"===e){var k=m;l.rowEach(t.sri,t.eri,(function(e,t,n){var r=u+t,a=e;s.line([k,r],[k+i,r]),y<=a&&a<w+1&&ei.call(o,k,r,i,n),s.fillText(a+1,k+i/2,r+n/2),e>0&&l.rows.isHide(e-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([k+5,r+5],[k+i-5,r+5]),s.restore())})),s.line([k,c+u],[k+i,c+u]),s.line([k+i,u],[k+i,c+u])}"all"!==e&&"top"!==e||(l.colEach(t.sci,t.eci,(function(e,t,i){var r=l.displayRight2Left?d-(f+t+i):f+t,a=e;s.line([r,0],[r,n]),b<=a&&a<x+1&&ei.call(o,r,0,i,n),s.fillText(v(a),r+i/2,n/2),e>0&&l.cols.isHide(e-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([r+5,5],[r+5,n-5]),s.restore())})),s.line([h+f,0],[h+f,n]),s.line([0,n],[h+f,n])),s.restore()}function ii(e,t){var i=this.draw;i.save(),i.attr({fillStyle:"#f4f5f8"}).fillRect(0,0,e,t),i.restore()}function ni(e,t,i,n,a){var o=e.sri,s=e.sci,l=e.eri,c=e.eci,h=e.w,u=e.h,f=e.clearStartx,d=void 0===f?0:f,m=e.lineStartx,g=void 0===m?0:m,v=this.draw,p=this.data,y=(p.settings,p.displayRight2Left),b=p.scroll;if(v.save(),y?v.attr(Xt).translate(-(t+n),i+a):v.attr(Xt).translate(t+n,i+a),v.clearRect(d,0,h,u),p.bgcolor&&v.fillRectWithColor(p.bgcolor,d,0,h,u),p.showGrid&&!p.bgcolor){if(y){h+=t+n;var w=r()(p.freeze,2),x=(w[0],w[1]);x>0&&s>=x&&(h+=b.x),0===x&&0==g&&(h=p.viewWidth()),p.rowEach(o,l,(function(e,t,i){e!==o&&v.line([g,t],[g+h,t]),e===l&&v.line([g,t+i],[g+h,t+i])}))}else p.rowEach(o,l,(function(e,t,i){e!==o&&v.line([0,t],[h,t]),e===l&&v.line([0,t+i],[h,t+i])}));if(y){var k=p.viewWidth();p.colEach(s,c,(function(e,t,i){v.line([k-t-i,0],[k-t-i,u]),e===s&&v.line([k-t,0],[k-t,u])}))}else p.colEach(s,c,(function(e,t,i){e!==s&&v.line([t,0],[t,u]),e===c&&v.line([t+i,0],[t+i,u])}));v.restore()}else v.restore()}function ri(e,t,i,n){var r=this.draw,a=this.data,o=a.viewWidth(),s=(o-e)/this.zoomlevel,l=(a.viewHeight()-t)/this.zoomlevel;a.displayRight2Left?r.save().translate(-e,t).attr({strokeStyle:"rgba(75, 137, 255, .6)"}):r.save().translate(e,t).attr({strokeStyle:"rgba(75, 137, 255, .6)"}),a.displayRight2Left?(r.line([0,n],[o,n]),r.line([o-i,0],[o-i,l])):(r.line([0,n],[s,n]),r.line([i,0],[i,l])),r.restore()}var ai=function(){function e(t,i){l()(this,e),this.el=t,this.draw=new Bt(t.getContext("2d"),i.viewWidth(),i.viewHeight()),this.draw.setel(t),this.data=i,this.zoomlevel=1}return o()(e,[{key:"resetData",value:function(e){this.data=e,this.render()}},{key:"clearSelectRender",value:function(){var e=this.data,t=this.draw,i=this.zoomlevel,n=e.selector,r=n.ri,a=n.ci,o=r;e.sortedRowMap.has(r)&&(o=sortedRowMap.get(r));var s=e.getCell(o,a);if(null!==s){var l=e.getCellStyleOrDefault(o,a),c=qt(e,r,a,0);Vt(e,c,o,0,a,s,l);var h=e.cols.indexWidth,u=e.settings.row.height,f=e.freezeTotalWidth(),d=e.scroll,m=d.x,g=d.y;t.save(),t.scaledpr(i),e.displayRight2Left?t.attr(Xt).translate(-(h+f),u+0):t.attr(Xt).translate(h+f,u+0);var v=void 0===c.exttxtwidthR?0:c.exttxtwidthR,p=void 0===c.exttxtwidthL?0:c.exttxtwidthL;t.fillRect(c.x+1-p-m,c.y+1-g,c.width+v+p-2,c.height-2),t.restore()}}},{key:"render",value:function(){var e=this.data,t=this.zoomlevel;if(!e.isupdating){var i=e.rows,n=e.cols;if(0!==Object.keys(i._).length){var a=n.indexWidth,o=e.settings.row.height;this.draw.resize(e.viewWidth(),e.viewHeight()),this.draw.scaledpr(t),this.clear();var s=e.viewRange(),l=e.freezeTotalWidth(),c=e.freezeTotalHeight(),h=e.scroll,u=h.x,f=h.y;ni.call(this,s,a,o,l,c),Qt.call(this,s,a,o,-u,-f),$t.call(this,s,a,o,-u,-f),ti.call(this,"all",s,a,o,l,c),ii.call(this,a,o);var d=r()(e.freeze,2),m=d[0],g=d[1];if(m>0||g>0){if(m>0){var v=s.clone();v.sri=0,v.eri=m-1,v.h=c,ni.call(this,v,a,o,l,0),Qt.call(this,v,a,o,-u,0),$t.call(this,v,a,o,-u,0),ti.call(this,"top",v,a,o,l,0),this.highlightRanges(v,a,o,u,0)}if(g>0){var p=s.clone();p.sci=0,p.eci=g-1,p.w=l,p.clearStartx=e.displayRight2Left?this.draw.ctx.canvas.width-l:0,p.lineStartx=e.displayRight2Left?e.viewWidth()-l:0,ni.call(this,p,a,o,0,c),ti.call(this,"left",p,a,o,0,c),Qt.call(this,p,a,o,0,-f),$t.call(this,p,a,o,0,-f),this.highlightRanges(p,a,o,0,f)}var y=e.freezeViewRange();y.clearStartx=e.displayRight2Left?this.draw.ctx.canvas.width-l:0,y.lineStartx=e.displayRight2Left?e.viewWidth()-l:0,ni.call(this,y,a,o,0,0),ti.call(this,"all",y,a,o,0,0),Qt.call(this,y,a,o,0,0),$t.call(this,y,a,o,0,0),ri.call(this,a,o,l,c),this.highlightRanges(y,a,o,0,0)}this.highlightRanges(s,a,o,u,f)}}}},{key:"highlightRanges",value:function(e,t,i,n,r){var a=this.draw,o=this.data;if(o.showhighlight){if(a.save(),o.displayRight2Left?a.translate(-t,i).translate(-n,-r):a.translate(t,i).translate(-n,-r),o.highlightall){var s=Yt(o,e);s.bgcolor=o.highlightstyle.color,a.rect(s,(function(){}))}else if(o.highlightIR){var l,c=Ht(e.difference(o.highlightIR));try{for(c.s();!(l=c.n()).done;){var h=Yt(o,l.value);h.bgcolor=o.highlightstyle.color,a.rect(h,(function(){}))}}catch(e){c.e(e)}finally{c.f()}}else{var u,f=Ht(o.highlightrg);try{for(f.s();!(u=f.n()).done;){var d=u.value;if(e.intersects(d)){var m=d.clone();m.sri<e.sri&&(m.sri=e.sri),m.eri>e.eri&&(m.eri=e.eri),m.sci<e.sci&&(m.sci=e.sci),m.eci>e.eci&&(m.eci=e.eci);var g=Yt(o,m);g.bgcolor=o.highlightstyle.color,a.rect(g,(function(){}))}}}catch(e){f.e(e)}finally{f.f()}}a.restore()}}},{key:"clear",value:function(){this.draw.clear()}}]),e}();function oi(){var e=this.inputText;if(!/^\s*$/.test(e)){var t=this.textlineEl,i=this.textEl,n=this.areaOffset,r=e.split("\n"),a=Math.max.apply(Math,m()(r.map((function(e){return e.length})))),o=t.offset().width/e.length,s=(a+1)*o+5,l=this.viewFn().width-n.left-o,c=r.length;if(s>n.width){var h=s;s>l&&(h=l,c+=parseInt(s/l,10),c+=s%l>0?1:0),i.css("width","".concat(h,"px"))}c*=this.rowHeight,(c-=7)>n.height&&i.css("height","".concat(c,"px"))}}function si(e){var t=e.target;if(window.getSelection){var i=window.getSelection(),n=i.getRangeAt(0),r=document.createElement("br");n.deleteContents(),n.insertNode(r),n.collapse(!1),i.removeAllRanges(),i.addRange(n),this.inputText=t.innerText,this.inputHtml=t.innerHTML,oi.call(this)}}function li(e){var t=e.keyCode,i=e.altKey;13!==t&&9!==t&&e.stopPropagation(),13===t&&i&&(si.call(this,e),e.stopPropagation()),13!==t||i||e.preventDefault()}function ci(e){var t=e.target.innerText,i=e.target.innerHTML,n=this.suggest,r=this.textlineEl,a=this.validator,o=this.cell;if(this.textbox)return this.textbox.ischange=!0,void(this.inputHtml=i);if(null!==o)if("editable"in o&&!0===o.editable||void 0===o.editable){if(this.inputText=t,this.inputHtml=i,a)"list"===a.type?n.search(t):n.hide();else{var s=t.lastIndexOf("=");-1!==s?(n.search(t.substring(s+1),"f"),"("===e.data&&n.hide(),this.formalaTip.show(t)):(n.hide(),this.formalaTip.hide())}r.html(i),oi.call(this),this.change("input",t)}else e.target.innerText="";else{if(this.inputText=t,this.inputHtml=i,a)"list"===a.type?n.search(t):n.hide();else{var l=t.lastIndexOf("=");-1!==l?(n.search(t.substring(l+1),"f"),"("===e.data&&n.hide(),this.formalaTip.show(t)):(n.hide(),this.formalaTip.hide())}r.html(t),oi.call(this),this.change("input",t)}}function hi(e,t){var i=this.textEl.el;setTimeout((function(){if(t){var e=window.getSelection(),n=document.createRange();e.removeAllRanges(),n.selectNodeContents(i),n.collapse(!1),e.addRange(n),i.focus()}}),1)}function ui(e,t,i,n){var r=this.textEl,a=this.textlineEl;mobileAndTabletCheck()||r.el.blur();var o=!1;e.length>0?(o=!0,r.html(e)):r.html(t,!0,!0),o?a.html(e):a.html(t,!0,!0),hi.call(this,i,n)}function fi(e,t){var i=this.inputText,n=this.validator,r=0;if(n&&"list"===n.type)this.inputText=e,r=this.inputText.length;else{var a=i.lastIndexOf("="),o=i.substring(0,a+1),s=i.substring(a+1);s=-1!==s.indexOf(")")?s.substring(s.indexOf(")")):"",this.inputText="".concat(o+e.key,"("),r=this.inputText.length,this.inputText+="".concat(s),this.formalaTip.show(this.inputText)}ui.call(this,"",this.inputText,r,t)}function di(){this.suggest.setItems(this.formulas)}var mi=function(){function e(t,i,n,r){var a=this;l()(this,e),this.viewFn=i,this.rowHeight=n,this.formulas=t,this.formalaTip=new gt,this.suggest=new at(t,(function(e){fi.call(a,e,!0)})),this.datepicker=new ct,this.datepicker.change((function(e){a.setText(function(e){var t=e.getMonth()+1,i=e.getDate();return t<10&&(t="0".concat(t)),i<10&&(i="0".concat(i)),"".concat(e.getFullYear(),"-").concat(t,"-").concat(i)}(e)),a.clear()})),this.areaEl=f("div","".concat(ae,"-editor-area")).children(this.textEl=f("div","htmlline").on("input",(function(e){return ci.call(a,e)})).on("paste.stop",(function(){})).on("keydown",(function(e){return li.call(a,e)})),this.textlineEl=f("div","textline"),this.suggest.el,this.datepicker.el,this.formalaTip.el).on("mousemove.stop",(function(){})).on("mousedown.stop",(function(){})),this.el=f("div","".concat(ae,"-editor")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl,r),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.textbox=null,this.change=function(){},this.textboxChange=function(){}}return o()(e,[{key:"setFreezeLengths",value:function(e,t){this.freeze.w=e,this.freeze.h=t}},{key:"insertTextNewLine",value:function(e){si.call(this,e)}},{key:"clear",value:function(){this.textbox?(""!==this.inputHtml&&this.textboxChange(this.textbox,this.inputHtml),this.textbox.setVisible(!0)):""!==this.inputText&&this.change("finished",this.ishtml?this.inputHtml:this.inputText),this.cell=null,this.textbox=null,this.areaOffset=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.el.hide(),this.textEl.html(""),this.textEl.cssRemoveKeys("width","height","padding-left","padding-right","text-align","border"),this.textlineEl.html(""),di.call(this),this.datepicker.hide()}},{key:"setOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",i=this.textEl,n=this.areaEl,r=this.suggest,a=this.freeze,o=this.el;if(e){this.areaOffset=e;var s=e.left,l=e.top,c=e.width,h=e.height,u=e.l,f=e.t,d={left:0,top:0};a.w>u&&a.h>f||(a.w<u&&a.h<f?(d.left=a.w,d.top=a.h):a.w>u?d.top=a.h:a.h>f&&(d.left=a.w)),o.offset(d),n.offset({left:s-d.left-.8,top:l-d.top-.8}),i.offset({width:c-.2,height:h-.2});var m={left:0};m[t]=h,r.setOffset(m),r.hide()}}},{key:"setForTextBox",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.el,n=this.textEl;n.attr("contenteditable","true"),i.show(),this.textbox=e,this.textbox.setVisible(!1),this.ishtml=!0,this.inputText=e.text,this.inputHtml=e.html,ui.call(this,e.html,e.text,e.text.length,t),n.css("width","".concat(e.width-9,"px")),n.css("height","".concat(e.height,"px")),n.css("padding-left","".concat(e.lp,"pt")),n.css("padding-right","".concat(e.rp,"pt")),n.css("text-align",e.align),n.css("border","black 1px solid")}},{key:"setCell",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.el,r=this.datepicker,a=this.suggest,o=this.textEl;o.attr("contenteditable","true"),n.show(),this.cell=e;var s=e&&e.text||"",l=e&&e.html||"";if(e&&(e.f?s=e.f:e.ufv&&(s=e.ufv)),this.ishtml=e&&e.html,this.setTextAndHtml(l,s,i),this.validator=t,t){var c=t.type;"date"===c&&(r.show(),/^\s*$/.test(s)||r.setValue(s)),"list"===c&&(a.setItems(t.values()),a.search(""))}}},{key:"setTextAndHtml",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.inputText=t,this.inputHtml=e,ui.call(this,e,t,t.length,i),oi.call(this)}},{key:"setText",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.inputText=e,ui.call(this,"",e,e.length,t),oi.call(this)}}]),e}();function gi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var vi=function(e){ee()(i,e);var t=gi(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return l()(this,i),(n=t.call(this,"div","".concat(ae,"-button ").concat(r))).child(U("button.".concat(e))),n}return i}(u),pi=[["A3",11.69,16.54],["A4",8.27,11.69],["A5",5.83,8.27],["B4",9.84,13.9],["B5",6.93,9.84]],yi=["landscape","portrait"];function bi(e){return parseInt(96*e,10)}function wi(e){"cancel"===e?this.el.hide():this.toPrint()}function xi(e){var t=this.paper,i=e.target.value,n=pi[i];t.w=bi(n[1]),t.h=bi(n[2]),this.preview()}function ki(e){var t=this.paper,i=e.target.value,n=yi[i];t.orientation=n,this.preview()}var Ci=function(){function e(t,i){var n,r;l()(this,e),this.paper={w:bi(pi[0][1]),h:bi(pi[0][2]),padding:50,orientation:yi[0],get width(){return"landscape"===this.orientation?this.h:this.w},get height(){return"landscape"===this.orientation?this.w:this.h}},this.data=t,this.imageCanvas=i,this.el=f("div","".concat(ae,"-print")).children(f("div","".concat(ae,"-print-bar")).children(f("div","-title").child("Print settings"),f("div","-right").children(f("div","".concat(ae,"-buttons")).children(new vi("cancel").on("click",wi.bind(this,"cancel")),new vi("next","primary").on("click",wi.bind(this,"next"))))),f("div","".concat(ae,"-print-content")).children(this.contentEl=f("div","-content"),f("div","-sider").child(f("form","").children(f("fieldset","").children(f("label","").child("".concat(U("print.size"))),(n=f("select","")).children.apply(n,m()(pi.map((function(e,t){return f("option","").attr("value",t).child("".concat(e[0]," ( ").concat(e[1],"''x").concat(e[2],"'' )"))})))).on("change",xi.bind(this))),f("fieldset","").children(f("label","").child("".concat(U("print.orientation"))),(r=f("select","")).children.apply(r,m()(yi.map((function(e,t){return f("option","").attr("value",t).child("".concat(U("print.orientations")[t]))})))).on("change",ki.bind(this))))))).hide()}return o()(e,[{key:"resetData",value:function(e){this.data=e}},{key:"preview",value:function(){var e=this,t=this.data,i=this.paper,n=i.width,r=i.height,a=i.padding,o=n-2*a,s=r-2*a,l=t.contentRange(),c=parseInt(l.h/s,10)+1,h=o/l.w,u=a,d=a;h>1&&(u+=(o-l.w)/2);var m=0,g=0;this.contentEl.html(""),this.canvases=[];for(var v={sri:0,sci:0,eri:0,eci:0},p=function(i){var a=0,o=0,c=f("div","".concat(ae,"-canvas-card")),p=f("canvas","".concat(ae,"-canvas"));e.canvases.push(p.el);var y=new Bt(p.el,n,r);for(y.save(),y.translate(u,d),h<1&&y.scale(h,h);m<=l.eri;m+=1){var b=t.rows.getHeight(m);if(!((a+=b)<s)){o=-(a-b);break}for(var w=0;w<=l.eci;w+=1)Zt(y,t,m,w,g),v.eci=w}v.eri=m,y.restore(),y.save(),y.translate(u,d),h<1&&y.scale(h,h);var x=g;t.eachMergesInView(v,(function(e){var i=e.sri,n=e.sci;Zt(y,t,i,n,x)})),y.restore(),v.sri=v.eri,v.sci=v.eci,g+=o;var k=e.imageCanvas.el.getContext("2d");k.width=n,k.height=r,k.translate(u,d),h<1&&k.scale(h,h),p.el.getContext("2d").drawImage(e.imageCanvas.el,u-e.imageCanvas.tOffset.left,e.imageCanvas.tOffset.top),e.contentEl.child(f("div","".concat(ae,"-canvas-card-wraper")).child(c.child(p)))},y=0;y<c;y+=1)p()}},{key:"toPrint",value:function(){this.el.hide();var e=this.paper,t=f("iframe","").hide().el;window.document.body.appendChild(t);var i=t.contentWindow,n=i.document,r=document.createElement("style");r.innerHTML="\n @page { size: ".concat(e.width,"px ").concat(e.height,"px; };\n canvas {\n page-break-before: auto;\n page-break-after: always;\n image-rendering: pixelated;\n };\n "),n.head.appendChild(r),this.canvases.forEach((function(e){var t=e.cloneNode(!1);t.getContext("2d").drawImage(e,0,0),n.body.appendChild(t)})),i.print()}}]),e}(),Si=[{key:"copy",title:X("contextmenu.copy"),label:"Ctrl+C"},{key:"cut",title:X("contextmenu.cut"),label:"Ctrl+X"},{key:"paste",title:X("contextmenu.paste"),label:"Ctrl+V"},{key:"paste-value",title:X("contextmenu.pasteValue"),label:"Ctrl+Shift+V"},{key:"paste-format",title:X("contextmenu.pasteFormat"),label:"Ctrl+Alt+V"},{key:"divider"},{key:"insert-row",title:X("contextmenu.insertRow")},{key:"insert-column",title:X("contextmenu.insertColumn")},{key:"divider"},{key:"delete-row",title:X("contextmenu.deleteRow")},{key:"delete-column",title:X("contextmenu.deleteColumn")},{key:"delete-cell-text",title:X("contextmenu.deleteCellText")},{key:"hide",title:X("contextmenu.hide")},{key:"divider"},{key:"link",title:X("contextmenu.link")},{key:"openLink",title:X("contextmenu.openLink")},{key:"removeLink",title:X("contextmenu.removeLink")},{key:"divider"},{key:"validation",title:X("contextmenu.validation")},{key:"cell-editable",title:X("contextmenu.celleditable")},{key:"cell-non-editable",title:X("contextmenu.cellnoneditable")}];function _i(e,t){var i=this,n=null;return(n="divider"===e.key?f("div","".concat(ae,"-item divider")):f("div","".concat(ae,"-item")).on("click",(function(){e.callback?e.callback(t,t.selector.getObj()):i.itemClick(e.key),i.hide()})).children(e.text?e.text:e.title(),f("div","label").child(e.label||"").attr("k",e.key))).key=e.key,n}function Ti(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Si,i=arguments.length>1?arguments[1]:void 0;return t.map((function(t){return _i.call(e,t,i)}))}function Oi(e,t){return e.find((function(e){return e.key===t}))}var Ei=function(){function e(t,i){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3?arguments[3]:void 0;if(l()(this,e),window.mobileAndTabletCheck()){var o={key:"merge",title:X("contextmenu.merge"),label:""},s={key:"unmerge",title:X("contextmenu.unmerge"),label:""},c={key:"edit",title:X("contextmenu.edit"),label:""};Si.forEach((function(e){e.label=void 0,"delete-cell-text"===e.key&&(e.title=X("contextmenu.clear"))})),Si.push(o),Si.push(s),Si.unshift(c)}this.customMenuItemsForImage=[{key:"delete-image",title:X("contextmenu.deleteImage"),label:"Del"}],this.customsetting=a&&!a.usedefault,this.customItems=this.customsetting?a.customItems:[],this.menuItems=this.customsetting?Ti.call(this,a.customItems,i):Ti.call(this),this.el=(n=f("div","".concat(ae,"-contextmenu"))).children.apply(n,m()(this.menuItems)).hide(),this.viewFn=t,this.itemClick=function(){},this.showMenuBefore=function(){},this.isHide=r,this.setMode("range"),this.sheet=i}return o()(e,[{key:"getImageContextMenuItems",value:function(){return this.customMenuItemsForImage}},{key:"addImageContextMenuItems",value:function(e){var t=this.customMenuItemsForImage;e.forEach((function(e){var i=t.findIndex((function(t){return t.key===e.key}));i>=0&&t.splice(i,1)})),t.push.apply(t,e)}},{key:"delImageContextMenuItems",value:function(e){var t=this.customMenuItemsForImage;e.forEach((function(e){var i=t.findIndex((function(t){return t.key===e}));i>=0&&t.splice(i,1)}))}},{key:"updateImageContextMenuItems",value:function(e){this.addImageContextMenuItems([e])}},{key:"getCutomContextMenuItems",value:function(){if(this.customsetting)return this.customItems}},{key:"addCutomContextMenuItems",value:function(e){var t=this.customItems,i=this.customsetting,n=this.sheet,r=this.menuItems;if(i){var a=Ti.call(this,e,n);e.forEach((function(e,i){"divider"!==e.key&&Oi(t,e.key)||(t.push(e),r.push(a[i]))})),this.rebuildMenuItems(r)}}},{key:"insertCutomContextMenuItem",value:function(e,t){var i=this.customItems,n=this.customsetting,r=this.sheet,a=this.menuItems;if(n&&("divider"===e.key||!Oi(i,e.key))){var o=_i.call(this,e,r);i.splice(t,0,e),a.splice(t,0,o),this.rebuildMenuItems(a)}}},{key:"updateCutomContextMenuItem",value:function(e,t){var i=this.customItems,n=this.customsetting,r=this.sheet,a=this.menuItems;if(n){var o=i.findIndex((function(t){return t.key==e}));if(-1!==o){t.text&&(i[o].text=t.text),t.callback&&(i[o].callback=t.callback);var s=_i.call(this,i[o],r);a[o]=s,this.rebuildMenuItems(a)}}}},{key:"rebuildMenuItems",value:function(e){var t,i=this.sheet;(i.el.removeChild(this.el.el),e.length>0)?this.el=(t=f("div","".concat(ae,"-contextmenu"))).children.apply(t,m()(e)).hide():this.el=f("div","".concat(ae,"-contextmenu")).hide();i.el.child(this.el)}},{key:"delCutomContextMenuItems",value:function(e){var t=this.customItems,i=this.menuItems,n=this.customsetting;this.sheet;n&&(e.forEach((function(e){var n=t.findIndex((function(t){return t.key===e}));n>=0&&(t.splice(n,1),i.splice(n,1))})),this.rebuildMenuItems(i))}},{key:"setMode",value:function(e){if(!this.customsetting){var t=this.menuItems[12];"row-col"===e?t.show():t.hide()}}},{key:"hide",value:function(){var e=this.el;e.hide(),Ee(e)}},{key:"setPosition",value:function(e,t){if(!this.isHide){var i=this.el,n=this.sheet;this.showImageDeleteItem(i,n),this.showMenuBefore(this.menuItems);var r=i.show().offset(),a=r.width,o=r.height,s=this.viewFn(),l=e;s.width-e<=a&&(l-=a),i.css("left","".concat(l,"px"));var c=t;o+t>s.height&&(c-=o+t-s.height),i.css("top","".concat(c,"px")).css("max-height","".concat(s.height,"px")).css("bottom","auto"),Re(i)}}},{key:"showImageDeleteItem",value:function(e,t){var i=this,n=this.customMenuItemsForImage;n.forEach((function(t){e.children().forEach((function(i){i.children[0]&&i.children[0].getAttribute("k")===t.key&&e.removeChild(i)}))})),this.el.children()[0].className.includes("divider")&&this.el.removeChild(this.el.children()[0]);var r=t.canvas.fabric.getActiveObject();null!=r&&("OleObject"===r.imgType?this.addImageContextMenuItems([{key:"ole",title:X("contextmenu.download"),callback:function(){t.getOle(r.strid)}}]):this.delImageContextMenuItems(["ole"]),Ti.call(this,n,t).forEach((function(e){return i.el.child(e,!0)})),t.selector.hide(),t.selector.setObjId(r.id))}}]),e}(),Ri=i(9),Ii=i.n(Ri);var Ai=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;l()(this,e),this.tip=U("toolbar.".concat(t.replace(/-[a-z]/g,(function(e){return e[1].toUpperCase()})))),this.activeTip=null===i?null:U("toolbar.".concat(i.replace(/-[a-z]/g,(function(e){return e[1].toUpperCase()})))),n&&(this.tip+=" (".concat(n,")")),this.tag=t,this.shortcut=n,this.value=r,this.el=this.element(),this.change=function(){}}return o()(e,[{key:"element",value:function(){var e=this.tip,t=this.activeTip;return f("div","".concat(ae,"-toolbar-btn")).on("mouseenter",(function(i){""!==e&&function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.classList.contains("active")||null!==i){var n=t.getBoundingClientRect(),r=n.left,a=n.top,o=n.width,s=n.height,l=t.classList.contains("active")?i:e,c=f("div","".concat(ae,"-tooltip")).html(l).show();document.body.appendChild(c.el);var h=c.box();c.css("left","".concat(r+o/2-h.width/2,"px")).css("top","".concat(a+s+2,"px")),Te(t,"mouseleave",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)})),Te(t,"click",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)}))}}(e,i.target,t)})).attr("data-tooltip",e)}},{key:"setState",value:function(){}}]),e}();function Di(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Pi=function(e){ee()(i,e);var t=Di(i);function i(){return l()(this,i),t.apply(this,arguments)}return o()(i,[{key:"dropdown",value:function(){}},{key:"getValue",value:function(e){return e}},{key:"element",value:function(){var e=this,t=this.tag;return this.dd=this.dropdown(),this.dd.change=function(i){return e.change(t,e.getValue(i))},Ii()(re()(i.prototype),"element",this).call(this).child(this.dd)}},{key:"setState",value:function(e){e&&(this.value=e,this.dd.setTitle(e))}}]),i}(Ai);function Fi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Mi=function(e){ee()(i,e);var t=Fi(i);function i(e,n,r,a){var o,s;l()(this,i),(s=t.call(this,"div","".concat(ae,"-dropdown ").concat(a))).title=e,s.change=function(){},s.headerClick=function(){},"string"==typeof e?s.title=f("div","".concat(ae,"-dropdown-title")).child(e):r&&s.title.addClass("arrow-left"),s.contentEl=f("div","".concat(ae,"-dropdown-content")).css("width",n).hide();for(var c=arguments.length,h=new Array(c>4?c-4:0),u=4;u<c;u++)h[u-4]=arguments[u];return s.contentEl.tags=h.map((function(e){return e.tag})),(o=s).setContentChildren.apply(o,h),s.headerEl=f("div","".concat(ae,"-dropdown-header")),s.headerEl.on("click",(function(){if("block"!==s.contentEl.css("display")){if(s.show(),mobileAndTabletCheck()&&window.document.body.offsetWidth!==window.document.body.scrollWidth){if(s.menuDiv){for(var e=s.menuDiv.el,t=s.menuDiv.el.offsetParent;e.offsetParent&&"BODY"!==e.offsetParent.nodeName;)e=e.offsetParent;s.contentEl.el.clientWidth-e.offsetLeft>100&&(s.el.classList.replace("bottom-left","bottom-center"),s.contentEl.el.style.top+=t.offsetTop)}s.el.classList.contains("bottom-left")&&s.el.classList.replace("bottom-left","bottom-right"),s.el.classList.contains("top-left")&&s.el.classList.replace("top-left","top-right")}}else s.hide()})).children(s.title,r?f("div","".concat(ae,"-icon arrow-right")).child(f("div","".concat(ae,"-icon-img arrow-down"))):""),s.children(s.headerEl,s.contentEl),s}return o()(i,[{key:"setContentChildren",value:function(){var e;(this.contentEl.html(""),arguments.length>0)&&(e=this.contentEl).children.apply(e,arguments)}},{key:"showExplain",value:function(e){var t=this;if(this.contentEl.children().length===e.length)for(var i=function(i){Te(t.contentEl.children()[i],"mouseover",(function(){var n=new et(e[i].title()),r=et.findDialog(t.contentEl),a={top:"".concat(t.contentEl.children()[i].offsetTop,"px")};if(0!==r.length)for(var o=0;o<r.length;o++)t.contentEl.removeChild(t.contentEl.children()[r[o]]);n.css(a),t.contentEl.child(n)})),Te(t.contentEl.children()[i],"mouseout",(function(){var e=et.findDialog(t.contentEl);if(0!==e.length)for(var i=0;i<e.length;i++)t.contentEl.removeChild(t.contentEl.children()[e[i]])}))},n=0;n<e.length;n++)i(n)}},{key:"setTitle",value:function(e){this.title.html(e),this.hide()}},{key:"show",value:function(){var e=this;this.contentEl.show(),this.parent().active(),Re(this.parent(),(function(){e.hide()}))}},{key:"hide",value:function(){this.parent().active(!1),this.contentEl.hide(),Ee(this.parent())}}]),i}(u);function Li(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ji=function(e){ee()(i,e);var t=Li(i);function i(e,n){var r;l()(this,i);var a=new se("align-".concat(n)),o=e.map((function(e){return(t="align-".concat(e),f("div","".concat(ae,"-item")).child(new se(t))).on("click",(function(){r.setTitle(e),r.change(e)}));var t}));return r=t.call.apply(t,[this,a,"auto",!0,"bottom-left"].concat(m()(o)))}return o()(i,[{key:"setTitle",value:function(e){this.title.setName("align-".concat(e)),this.hide()}}]),i}(Mi);function zi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Bi=function(e){ee()(i,e);var t=zi(i);function i(e){return l()(this,i),t.call(this,"align",null,"",e)}return o()(i,[{key:"dropdown",value:function(){var e=this.value;return new ji(["left","center","right"],e)}}]),i}(Pi);function Hi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ni=function(e){ee()(i,e);var t=Hi(i);function i(e){return l()(this,i),t.call(this,"valign",null,"",e)}return o()(i,[{key:"dropdown",value:function(){var e=this.value;return new ji(["top","middle","bottom"],e)}}]),i}(Pi);function Ui(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Xi=function(e){ee()(i,e);var t=Ui(i);function i(){return l()(this,i),t.apply(this,arguments)}return o()(i,[{key:"element",value:function(){var e=this,t=this.tag;return Ii()(re()(i.prototype),"element",this).call(this).child(new se(t)).on("click",(function(){return e.click()}))}},{key:"click",value:function(){this.change(this.tag,this.toggle())}},{key:"setState",value:function(e){this.el.active(e)}},{key:"toggle",value:function(){return this.el.toggle()}},{key:"active",value:function(){return this.el.hasClass("active")}}]),i}(Ai);function qi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Wi=function(e){ee()(i,e);var t=qi(i);function i(){return l()(this,i),t.call(this,"autofilter")}return o()(i,[{key:"setState",value:function(){}}]),i}(Xi);function Yi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Vi=function(e){ee()(i,e);var t=Yi(i);function i(){return l()(this,i),t.call(this,"font-bold",null,"Ctrl+B")}return i}(Xi);function Gi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Zi=function(e){ee()(i,e);var t=Gi(i);function i(){return l()(this,i),t.call(this,"font-italic",null,"Ctrl+I")}return i}(Xi);function Ki(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ji=function(e){ee()(i,e);var t=Ki(i);function i(){return l()(this,i),t.call(this,"strike")}return i}(Xi);function $i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Qi=function(e){ee()(i,e);var t=$i(i);function i(){return l()(this,i),t.call(this,"underline",null,"Ctrl+U")}return i}(Xi),en=["#ffffff","#000100","#e7e5e6","#445569","#5b9cd6","#ed7d31","#a5a5a5","#ffc001","#4371c6","#71ae47"],tn=[["#f2f2f2","#7f7f7f","#d0cecf","#d5dce4","#deeaf6","#fce5d5","#ededed","#fff2cd","#d9e2f3","#e3efd9"],["#d8d8d8","#595959","#afabac","#adb8ca","#bdd7ee","#f7ccac","#dbdbdb","#ffe59a","#b3c6e7","#c5e0b3"],["#bfbfbf","#3f3f3f","#756f6f","#8596b0","#9cc2e6","#f4b184","#c9c9c9","#fed964","#8eaada","#a7d08c"],["#a5a5a5","#262626","#3a3839","#333f4f","#2e75b5","#c45a10","#7b7b7b","#bf8e01","#2f5596","#538136"],["#7f7f7f","#0c0c0c","#171516","#222a35","#1f4e7a","#843c0a","#525252","#7e6000","#203864","#365624"]],nn=["#c00000","#fe0000","#fdc101","#ffff01","#93d051","#00b04e","#01b0f1","#0170c1","#012060","#7030a0"];function rn(e){var t=this;return f("td","").child(f("div","".concat(ae,"-color-palette-cell")).on("click.stop",(function(){return t.change(e)})).css("background-color",e))}var an=function e(){var t,i,n,r=this;l()(this,e),this.el=f("div","".concat(ae,"-color-palette")),this.change=function(){};var a=f("table","").children((t=f("tbody","")).children.apply(t,[(i=f("tr","".concat(ae,"-theme-color-placeholders"))).children.apply(i,m()(en.map((function(e){return rn.call(r,e)}))))].concat(m()(tn.map((function(e){var t;return(t=f("tr","".concat(ae,"-theme-colors"))).children.apply(t,m()(e.map((function(e){return rn.call(r,e)}))))}))),[(n=f("tr","".concat(ae,"-standard-colors"))).children.apply(n,m()(nn.map((function(e){return rn.call(r,e)}))))])));this.el.child(a)};function on(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var sn=function(e){ee()(i,e);var t=on(i);function i(e,n){var r;l()(this,i);var a=new se(e).css("height","16px").css("border-bottom","3px solid ".concat(n)),o=new an;return o.change=function(e){r.setTitle(e),r.change(e)},r=t.call(this,a,"max-content",!1,"bottom-left",o.el)}return o()(i,[{key:"setTitle",value:function(e){this.title.css("border-color",e),this.hide()}}]),i}(Mi);function ln(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var cn=[["thin",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" style="user-select: none;"></line></svg>'],["medium",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="2" style="user-select: none;"><line x1="0" y1="1.0" x2="50" y2="1.0" stroke-width="2" stroke="black" style="user-select: none;"></line></svg>'],["thick",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="3" style="user-select: none;"><line x1="0" y1="1.5" x2="50" y2="1.5" stroke-width="3" stroke="black" style="user-select: none;"></line></svg>'],["dashed",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="2" style="user-select: none;"></line></svg>'],["dotted",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="1" style="user-select: none;"></line></svg>']],hn=function(e){ee()(i,e);var t=ln(i);function i(e){var n;l()(this,i);var r=new se("line-type"),a=0,o=cn.map((function(t,i){return f("div","".concat(ae,"-item state ").concat(e===t[0]?"checked":"")).on("click",(function(){o[a].toggle("checked"),o[i].toggle("checked"),a=i,n.hide(),n.change(t)})).child(f("div","".concat(ae,"-line-type")).html(t[1]))}));return n=t.call.apply(t,[this,r,"max-content",!1,"bottom-left"].concat(m()(o)))}return i}(Mi);function un(){var e;return f("table","").child((e=f("tbody","")).children.apply(e,arguments))}function fn(e){var t=this;return f("td","").child(f("div","".concat(ae,"-border-palette-cell")).child(new se("border-".concat(e))).on("click",(function(){t.mode=e;var i=t.mode,n=t.style,r=t.color;t.change({mode:i,style:n,color:r})})))}var dn=function e(){var t,i,n=this;l()(this,e),this.color="#000",this.style="thin",this.mode="all",this.change=function(){},this.ddColor=new sn("line-color",this.color),this.ddColor.change=function(e){n.color=e},this.ddType=new hn(this.style),this.ddType.change=function(e){var t=r()(e,1)[0];n.style=t},this.el=f("div","".concat(ae,"-border-palette"));var a=un(f("tr","").children(f("td","".concat(ae,"-border-palette-left")).child(un((t=f("tr","")).children.apply(t,m()(["all","inside","horizontal","vertical","outside"].map((function(e){return fn.call(n,e)})))),(i=f("tr","")).children.apply(i,m()(["left","top","right","bottom","none"].map((function(e){return fn.call(n,e)})))))),f("td","".concat(ae,"-border-palette-right")).children(f("div","".concat(ae,"-toolbar-btn")).child(this.ddColor.el),f("div","".concat(ae,"-toolbar-btn")).child(this.ddType.el))));this.el.child(a)};function mn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var gn=function(e){ee()(i,e);var t=mn(i);function i(){var e;l()(this,i);var n=new se("border-all"),r=new dn;return r.change=function(t){e.change(t),e.hide()},e=t.call(this,n,"max-content",!1,"bottom-left",r.el)}return i}(Mi);function vn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var pn=function(e){ee()(i,e);var t=vn(i);function i(){return l()(this,i),t.call(this,"border")}return o()(i,[{key:"dropdown",value:function(){return new gn}}]),i}(Pi);function yn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var bn=function(e){ee()(i,e);var t=yn(i);function i(){return l()(this,i),t.apply(this,arguments)}return o()(i,[{key:"element",value:function(){var e=this;return this.icon=new se(this.tag),Ii()(re()(i.prototype),"element",this).call(this).child(this.icon).on("click",(function(){return e.change(e.tag)}))}},{key:"setState",value:function(e){this.el.disabled(e)}},{key:"setIcon",value:function(e){this.icon.setName(e)}}]),i}(Ai);function wn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var xn=function(e){ee()(i,e);var t=wn(i);function i(){return l()(this,i),t.call(this,"clearformat")}return i}(bn);function kn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Cn=function(e){ee()(i,e);var t=kn(i);function i(){return l()(this,i),t.call(this,"paintformat")}return o()(i,[{key:"setState",value:function(){}}]),i}(Xi);function Sn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var _n=function(e){ee()(i,e);var t=Sn(i);function i(e){return l()(this,i),t.call(this,"color",null,void 0,e)}return o()(i,[{key:"dropdown",value:function(){var e=this.tag,t=this.value;return new sn(e,t)}}]),i}(Pi);function Tn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var On=function(e){ee()(i,e);var t=Tn(i);function i(e){return l()(this,i),t.call(this,"bgcolor",null,void 0,e)}return o()(i,[{key:"dropdown",value:function(){var e=this.tag,t=this.value;return new sn(e,t)}}]),i}(Pi);function En(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Rn=function(e){ee()(i,e);var t=En(i);function i(){var e;l()(this,i);var n=pt.map((function(t){return f("div","".concat(ae,"-item")).on("click",(function(){e.setTitle("".concat(t.pt)),e.change(t)})).child("".concat(t.pt))}));return e=t.call.apply(t,[this,"10","60px",!0,"bottom-left"].concat(m()(n)))}return i}(Mi);function In(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var An=function(e){ee()(i,e);var t=In(i);function i(){return l()(this,i),t.call(this,"font-size")}return o()(i,[{key:"getValue",value:function(e){return e.pt}},{key:"dropdown",value:function(){return new Rn}}]),i}(Pi);function Dn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Pn=function(e){ee()(i,e);var t=Dn(i);function i(){var e;l()(this,i);var n=[{text:"50%",number:.5},{text:"75%",number:.75},{text:"100%",number:1},{text:"125%",number:1.25},{text:"150%",number:1.5},{text:"175%",number:1.75},{text:"200%",number:2}].map((function(t){return f("div","".concat(ae,"-item")).on("click",(function(){e.setTitle("".concat(t.text)),e.change(t)})).child("".concat(t.text))}));return e=t.call.apply(t,[this,"10","60px",!0,"bottom-left"].concat(m()(n)))}return i}(Mi);function Fn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Mn=function(e){ee()(i,e);var t=Fn(i);function i(){return l()(this,i),t.call(this,"zoom-size")}return o()(i,[{key:"getValue",value:function(e){return e}},{key:"setState",value:function(e){"string"!=typeof e&&(e=100*e+"%"),Ii()(re()(i.prototype),"setState",this).call(this,e)}},{key:"dropdown",value:function(){return new Pn}}]),i}(Pi);function Ln(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var jn=function(e){ee()(i,e);var t=Ln(i);function i(){var e;l()(this,i);var n=vt.map((function(t){return f("div","".concat(ae,"-item")).on("click",(function(){e.setTitle(t.title),e.change(t)})).child(t.title)}));return e=t.call.apply(t,[this,vt[0].title,"max-content",!0,"bottom-left"].concat(m()(n)))}return i}(Mi);function zn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Bn=function(e){ee()(i,e);var t=zn(i);function i(){return l()(this,i),t.call(this,"font-name")}return o()(i,[{key:"getValue",value:function(e){return e.key}},{key:"dropdown",value:function(){return new jn}}]),i}(Pi);function Hn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Nn=function(e){ee()(i,e);var t=Hn(i);function i(){var e;l()(this,i);var n=_t.slice(0);return n.splice(2,0,{key:"divider"}),n.splice(8,0,{key:"divider"}),n=n.map((function(t){var i=f("div","".concat(ae,"-item"));return"divider"===t.key?i.addClass("divider"):(i.child(t.title()).on("click",(function(){e.setTitle(t.title()),e.change(t)})),t.label&&i.child(f("div","label").html(t.label))),i})),e=t.call.apply(t,[this,"Normal","220px",!0,"bottom-left"].concat(m()(n)))}return o()(i,[{key:"setTitle",value:function(e){for(var t=0;t<_t.length;t+=1)_t[t].key===e&&this.title.html(_t[t].title());this.hide()}}]),i}(Mi);function Un(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Xn=function(e){ee()(i,e);var t=Un(i);function i(){return l()(this,i),t.call(this,"format")}return o()(i,[{key:"getValue",value:function(e){return e.key}},{key:"dropdown",value:function(){return new Nn}}]),i}(Pi),qn=i(8),Wn=i.n(qn);function Yn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Vn=function(e){ee()(i,e);var t=Yn(i);function i(){var e,n;l()(this,i);var r=ht.map((function(e){return f("div","".concat(ae,"-item")).on("click",(function(){n.hide(),n.change(e)})).child(e.key)}));return n=t.call.apply(t,[this,new se("formula"),"max-content",!0,"bottom-left"].concat(m()(r))),Ii()((e=Wn()(n),re()(i.prototype)),"showExplain",e).call(e,ht),n}return i}(Mi);function Gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Zn=function(e){ee()(i,e);var t=Gn(i);function i(){return l()(this,i),t.call(this,"formula")}return o()(i,[{key:"getValue",value:function(e){return e.key}},{key:"dropdown",value:function(){return new Vn}}]),i}(Pi);function Kn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Jn=function(e){ee()(i,e);var t=Kn(i);function i(){return l()(this,i),t.call(this,"freeze")}return i}(Xi);function $n(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Qn=function(e){ee()(i,e);var t=$n(i);function i(){return l()(this,i),t.call(this,"merge","unmerge")}return o()(i,[{key:"setState",value:function(e,t){this.el.active(e).disabled(t)}}]),i}(Xi);function er(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var tr=function(e){ee()(i,e);var t=er(i);function i(){return l()(this,i),t.call(this,"print","Ctrl+P")}return i}(bn);function ir(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var nr=function(e){ee()(i,e);var t=ir(i);function i(){return l()(this,i),t.call(this,"textwrap")}return i}(Xi);function rr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ar=function(e){ee()(i,e);var t=rr(i);function i(){var e;l()(this,i);var n=new se("ellipsis"),r=f("div","".concat(ae,"-toolbar-more"));return(e=t.call(this,n,"max-content",!1,"bottom-right",r)).moreBtns=r,screen.width<500?e.contentEl.css("max-width","200px"):e.contentEl.css("max-width","420px"),e}return i}(Mi),or=function(e){ee()(i,e);var t=rr(i);function i(){var e;return l()(this,i),(e=t.call(this,"more")).el.hide(),e}return o()(i,[{key:"dropdown",value:function(){return new ar}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),i}(Pi);function sr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var lr=function(e){ee()(i,e);var t=sr(i);function i(){return l()(this,i),t.call(this,"sort")}return i}(bn);function cr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var hr=function(e){ee()(i,e);var t=cr(i);function i(){return l()(this,i),t.call(this,"search")}return i}(bn);function ur(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var fr=function(e){ee()(i,e);var t=ur(i);function i(){return l()(this,i),t.call(this,"commentEdit")}return i}(bn);function dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var mr=function(e){ee()(i,e);var t=dr(i);function i(){return l()(this,i),t.call(this,"commentRemove")}return i}(bn);function gr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var vr=function(e){ee()(i,e);var t=gr(i);function i(){return l()(this,i),t.call(this,"commentPrevious")}return i}(bn);function pr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var yr=function(e){ee()(i,e);var t=pr(i);function i(){return l()(this,i),t.call(this,"commentNext")}return i}(bn);function br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var wr=function(e){ee()(i,e);var t=br(i);function i(){var e;l()(this,i);var n=new se("".concat(ae,"-icon-img insert-image")),r=f("div","".concat(ae,"-item")),a=f("input");a.attr({type:"file",name:"photo",id:"upload-image",style:"display:none;",accept:"image/*"}),r.tag="fromLocal";var o=f("label");o.attr("for","upload-image"),o.child(new se("".concat(ae,"-icon-img insert-image-local"))),o.child(" "+U("menubar.".concat(r.tag))),r.child(a),r.child(o),r.on("click",(function(){e.change("local")}));var s,c=(s="".concat(ae,"-icon-img insert-image-url"),f("div","".concat(ae,"-item")).child(new se(s)));return c.tag="fromURL",c.child(" "+U("menubar.".concat(c.tag))),c.on("click",(function(){e.change("url")})),e=t.call.apply(t,[this,n,"auto",!0,"bottom-left"].concat([r,c]))}return i}(Mi);function xr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var kr=function(e){ee()(i,e);var t=xr(i);function i(e){return l()(this,i),t.call(this,"insert-image",null,"",e)}return o()(i,[{key:"dropdown",value:function(){return new wr}}]),i}(Pi);function Cr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Sr=function(e){ee()(i,e);var t=Cr(i);function i(){var e;return l()(this,i),(e=t.call(this,"menu-display-hide","")).state="up",e}return o()(i,[{key:"setUp",value:function(){this.setIcon("menu-display-hide"),this.state="up"}},{key:"setDown",value:function(){this.setIcon("menu-display-show"),this.state="down"}}]),i}(bn);function _r(){return f("div","".concat(ae,"-toolbar-divider"))}function Tr(){var e=this;this.btns2=[],this.items.forEach((function(t){if(Array.isArray(t))t.forEach((function(t){var i=t.el,n=i.box(),r=i.computedStyle(),a=r.marginLeft,o=r.marginRight;e.btns2.push([i,n.width+parseInt(a,10)+parseInt(o,10)])}));else{var i=t.box(),n=t.computedStyle(),r=n.marginLeft,a=n.marginRight;e.btns2.push([t,i.width+parseInt(r,10)+parseInt(a,10)])}}))}function Or(){var e,t,i=this.el,n=this.btns,a=this.moreEl,o=this.btns2,s=a.dd,l=s.moreBtns,c=s.contentEl,h=i.box(),u=100,f=12,d=[],m=[];o.forEach((function(e,t){var i=r()(e,2),n=i[0],a=i[1];u+=a,t===o.length-1||u<h.width?d.push(n):(f+=a,m.push(n))})),(e=n.html("")).children.apply(e,d),(t=l.html("")).children.apply(t,m),c.css("width","".concat(f,"px")),m.length>0?a.show():a.hide()}var Er=function(){function e(t,i,n,r){var a=this;l()(this,e),this.data=t,this.change=function(){},this.widthFn=i,this.isHide=n;var o=t.defaultStyle();this.items=[[new tr,this.paintformatEl=new Cn,this.clearformatEl=new xn],_r(),[this.formatEl=new Xn],_r(),[this.fontEl=new Bn,this.fontSizeEl=new An],_r(),[this.zoomSizeEl=new Mn,this.boldEl=new Vi,this.italicEl=new Zi,this.underlineEl=new Qi,this.strikeEl=new Ji,this.textColorEl=new _n(o.color)],_r(),[this.fillColorEl=new On(o.bgcolor),this.borderEl=new pn,this.mergeEl=new Qn],_r(),[this.alignEl=new Bi(o.align),this.valignEl=new Ni(o.valign),this.textwrapEl=new nr],_r(),[this.freezeEl=new Jn,this.autofilterEl=new Wi,this.formulaEl=new Zn,this.sortEl=new lr,this.insertImageEL=new kr,this.searchEl=new hr],_r(),[this.commentEditEl=new fr,this.commentRemoveEl=new mr,this.commentPreviousEl=new vr,this.commentNextEl=new yr],_r(),[this.moreEl=new or]],screen.width<500&&this.items[0].splice(0,1),n&&r&&(this.items=[[new tr,this.moreEl=new or,this.sortEl=new lr,this.searchEl=new hr]]),this.el=f("div","".concat(ae,"-toolbar")),this.btns=f("div","".concat(ae,"-toolbar-btns")),this.items.forEach((function(e){Array.isArray(e)?e.forEach((function(e){a.btns.child(e.el),e.change=function(){a.change.apply(a,arguments)}})):a.btns.child(e.el)}));var s=this.menuDisplay=new Sr;s.change=function(){a.change.apply(a,arguments)},this.el.children(this.btns.el,s.el),n&&!r?this.el.hide():(this.reset(),setTimeout((function(){Tr.call(a),Or.call(a)}),0),Te(window,"resize",(function(){Or.call(a)})))}return o()(e,[{key:"paintformatActive",value:function(){return this.paintformatEl.active()}},{key:"paintformatToggle",value:function(){this.paintformatEl.toggle()}},{key:"trigger",value:function(e){this["".concat(e,"El")].click()}},{key:"resetData",value:function(e){this.data=e,this.reset()}},{key:"reset",value:function(){if(!this.isHide){var e=this.data,t=e.getSelectedCellStyle();this.mergeEl.setState(e.canUnmerge(),!1),this.autofilterEl.setState(!e.canAutofilter());var i=t.font,n=t.format;this.formatEl.setState(n),this.fontEl.setState(i.name),this.fontSizeEl.setState(i.size),this.zoomSizeEl.setState(e.zoomlevel),this.boldEl.setState(i.bold),this.italicEl.setState(i.italic),this.underlineEl.setState(t.underline),this.strikeEl.setState(t.strike),this.textColorEl.setState(t.color),this.fillColorEl.setState(t.bgcolor),this.alignEl.setState(t.align),this.valignEl.setState(t.valign),this.textwrapEl.setState(t.textwrap),this.freezeEl.setState(e.freezeIsActive())}}}]),e}(),Rr=function(){function e(t,i){var n,r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"600px",o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];l()(this,e),this.moving=!1,this.drag=s,this.title=t;var c=parseInt(a);screen.width<500&&c>300&&(a="300px"),this.el=f("div","".concat(ae,"-modal")).css("width",a).css("position","absolute").children(f("div","".concat(ae,"-modal-header")).children(new se("close").on("click.stop",(function(){return r.hide()})),this.title),(n=f("div","".concat(ae,"-modal-content"))).children.apply(n,m()(i))).hide(),this.showDimmer=o,this.drag&&this.el.on("mousedown.stop",(function(e){return r.mousedownHandler(e)}))}return o()(e,[{key:"show",value:function(){var e=this;if(!this.moving){this.showDimmer&&(this.dimmer=f("div","".concat(ae,"-dimmer active")),document.body.appendChild(this.dimmer.el));var t=this.el.show().box(),i=t.width,n=t.height,r=document.documentElement,a=r.clientHeight,o=r.clientWidth;this.el.offset({left:(o-i)/2,top:(a-n)/3}),window.xkeydownEsc=function(t){27===t.keyCode&&e.hide()},Te(window,"keydown",window.xkeydownEsc)}}},{key:"hide",value:function(){this.el.hide(),this.showDimmer&&document.body.removeChild(this.dimmer.el),Oe(window,"keydown",window.xkeydownEsc),delete window.xkeydownEsc}},{key:"mousedownHandler",value:function(e){var t=this,i=e;Ie(window,(function(e){if(t.moving=!0,null!==i){var n=t.el.offset(void 0);t.el.offset({left:n.left+e.movementX,top:n.top+e.movementY}),i=e}}),(function(){i=null,t.moving=!1}))}}]),e}(),Ir=function(){function e(t,i){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;l()(this,e),this.vchange=function(){},this.el=f("div","".concat(ae,"-form-input")),this.input=f("input","").css("width",t).on("input",(function(e){return n.vchange(e)})).attr("placeholder",i).attr("maxlength",r),this.el.child(this.input)}return o()(e,[{key:"focus",value:function(){var e=this;setTimeout((function(){e.input.el.focus()}),10)}},{key:"hint",value:function(e){this.input.attr("placeholder",e)}},{key:"setReadonly",value:function(e){e?this.input.attr("readonly",""):this.input.removeAttr("readonly")}},{key:"val",value:function(e){return this.input.val(e)}}]),e}();function Ar(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return Dr(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Dr(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Dr(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Pr=function(){function e(t,i,n){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(e){return e},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};l()(this,e),this.key=t,this.getTitle=a,this.change=o,this.width=n,this.vchange=function(){},this.items=[],this.itemsmap=new Map,this.el=f("div","".concat(ae,"-form-select")),this.suggest=new at(i.map((function(e){return{key:e,title:r.getTitle(e)}})),(function(e){r.itemClick(e.key),o(e.key),r.vchange(e.key)}),n,this.el),this.el.children(this.itemEl=f("div","input-text").html(this.getTitle(t)),this.suggest.el).on("click",(function(){return r.show()}))}return o()(e,[{key:"show",value:function(){this.suggest.search("")}},{key:"itemClick",value:function(e){this.key=e,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(e)):this.itemEl.html(this.getTitle(e))}},{key:"setItemsMap",value:function(e){var t=this;this.itemsmap=e;var i,n=[],a=Ar(e);try{for(a.s();!(i=a.n()).done;){var o=r()(i.value,2),s=o[0],l=o[1];n.push({key:s,title:l})}}catch(e){a.e(e)}finally{a.f()}this.suggest=new at(n,(function(e){t.itemClick(e.key),t.change(e.key),t.vchange(e.key)}),this.width,this.el),e.size>6&&this.suggest.el.css("height","200px"),this.el.empty(),this.el.children(this.itemEl=f("div","input-text").html(n[0].title),this.suggest.el)}},{key:"val",value:function(e){return void 0!==e?(this.key=e,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(e)):this.itemEl.html(this.getTitle(e)),this):this.key}}]),e}(),Fr={number:/(^\d+$)|(^\d+(\.\d{0,4})?$)/,date:/^\d{4}-\d{1,2}-\d{1,2}$/},Mr=function(){function e(t,i,n,r){var a=this;l()(this,e),this.label="",this.rule=i,n&&(this.label=f("label","label").css("width","".concat(r,"px")).html(n)),this.tip=f("div","tip").child("tip").hide(),this.input=t,this.input.vchange=function(){return a.validate()},this.el=f("div","".concat(ae,"-form-field")).children(this.label,t.el,this.tip)}return o()(e,[{key:"isShow",value:function(){return"none"!==this.el.css("display")}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"val",value:function(e){return this.input.val(e)}},{key:"hint",value:function(e){this.input.hint(e)}},{key:"validate",value:function(){var e=this.input,t=this.rule,i=this.tip,n=this.el,r=e.val();if(t.required&&/^\s*$/.test(r))return i.html(U("validation.required")),n.addClass("error"),!1;if((t.type||t.pattern)&&!(t.pattern||Fr[t.type]).test(r))return i.html(U("validation.notMatch")),n.addClass("error"),!1;return n.removeClass("error"),!0}},{key:"validateFail",value:function(e){var t=this.el,i=this.tip;t.addClass("error"),i.html(e),i.show()}},{key:"validateClear",value:function(){var e=this.el,t=this.tip;e.removeClass("error"),t.html(""),t.hide()}}]),e}();function Lr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var jr=function(e){ee()(i,e);var t=Lr(i);function i(){var e;l()(this,i);var n=new Mr(new Pr("cell",["cell"],"100%",(function(e){return U("dataValidation.modeType.".concat(e))})),{required:!0},"".concat(U("dataValidation.range"),":"),100),r=new Mr(new Ir("120px","E3 or E3:F12"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/}),a=new Mr(new Pr("list",["list","number","date","phone","email"],"100%",(function(e){return U("dataValidation.type.".concat(e))}),(function(t){return e.criteriaSelected(t)})),{required:!0},"".concat(U("dataValidation.criteria"),":"),100),o=new Mr(new Pr("be",["be","nbe","eq","neq","lt","lte","gt","gte"],"160px",(function(e){return U("dataValidation.operator.".concat(e))}),(function(t){return e.criteriaOperatorSelected(t)})),{required:!0}).hide(),s=new Mr(new Ir("70px","10"),{required:!0}).hide(),c=new Mr(new Ir("70px","100"),{required:!0,type:"number"}).hide(),h=new Mr(new Ir("120px","a,b,c"),{required:!0}),u=new Mr(new Ir("70px","10"),{required:!0,type:"number"}).hide();return(e=t.call(this,U("contextmenu.validation"),[f("div","".concat(ae,"-form-fields")).children(n.el,r.el),f("div","".concat(ae,"-form-fields")).children(a.el,o.el,s.el,c.el,u.el,h.el),f("div","".concat(ae,"-buttons")).children(new vi("cancel").on("click",(function(){return e.btnClick("cancel")})),new vi("remove").on("click",(function(){return e.btnClick("remove")})),new vi("save","primary").on("click",(function(){return e.btnClick("save")})))])).mf=n,e.rf=r,e.cf=a,e.of=o,e.minvf=s,e.maxvf=c,e.vf=u,e.svf=h,e.change=function(){},e}return o()(i,[{key:"showVf",value:function(e){var t="date"===e?"2018-11-12":"10",i=this.vf;i.input.hint(t),i.show()}},{key:"criteriaSelected",value:function(e){var t=this.of,i=this.minvf,n=this.maxvf,r=this.vf,a=this.svf;"date"===e||"number"===e?(t.show(),i.rule.type=e,n.rule.type=e,"date"===e?(i.hint("2018-11-12"),n.hint("2019-11-12")):(i.hint("10"),n.hint("100")),i.show(),n.show(),r.hide(),a.hide()):("list"===e?a.show():a.hide(),r.hide(),t.hide(),i.hide(),n.hide())}},{key:"criteriaOperatorSelected",value:function(e){if(e){var t=this.minvf,i=this.maxvf,n=this.vf;if("be"===e||"nbe"===e)t.show(),i.show(),n.hide();else{var r=this.cf.val();n.rule.type=r,"date"===r?n.hint("2018-11-12"):n.hint("10"),n.show(),t.hide(),i.hide()}}}},{key:"btnClick",value:function(e){if("cancel"===e)this.hide();else if("remove"===e)this.change("remove"),this.hide();else if("save"===e){for(var t=["mf","rf","cf","of","svf","vf","minvf","maxvf"],i=0;i<t.length;i+=1){var n=this[t[i]];if(n.isShow()&&!n.validate())return}var r=this.mf.val(),a=this.rf.val(),o=this.cf.val(),s="phone"===o||"email"===o?"":this.of.val(),l=this.svf.val();"number"!==o&&"date"!==o||(l="be"===s||"nbe"===s?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change("save",r,a,{type:o,operator:s,required:!1,value:l}),this.hide()}}},{key:"setValue",value:function(e){if(e){var t=this.mf,i=this.rf,n=this.cf,r=this.of,a=this.svf,o=this.vf,s=this.minvf,l=this.maxvf,c=e.mode,h=e.ref,u=e.validator||{type:"list"},f=u.type,d=u.operator,m=u.value;t.val(c||"cell"),i.val(h),n.val(f),r.val(d),Array.isArray(m)?(s.val(m[0]),l.val(m[1])):(a.val(m||""),o.val(m||"")),this.criteriaSelected(f),this.criteriaOperatorSelected(d)}this.show()}}]),i}(Rr),zr=function(){function e(t,i){l()(this,e),this.el=f("input","".concat(ae,"-form-checkbox")).css("width",t).attr("type","Checkbox")}return o()(e,[{key:"hint",value:function(e){this.el.attr("placeholder",e)}},{key:"val",value:function(e){if(void 0===e)return this.el.el.checked;this.el.el.checked=e}}]),e}();function Br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Hr=function(e){ee()(i,e);var t=Br(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("60px",""),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/},"".concat(U("dataSort.ci"),":"),60),r=new Mr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(U("dataSort.sortby"),":"),60),a=new Mr(new Pr("desc",["asc","desc"],"100%",(function(e){return U("dataSort.order.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSort.criteria"),":"),60),o=new Mr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(U("dataSort.sortby"),":"),60),s=new Mr(new Pr("desc",["asc","desc"],"100%",(function(e){return U("dataSort.order.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSort.criteria"),":"),60),c=new Mr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(U("dataSort.sortby"),":"),60),h=new Mr(new Pr("desc",["asc","desc"],"100%",(function(e){return U("dataSort.order.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSort.criteria"),":"),60);n.input.setReadonly(!0);var u=new zr("60px","");u.el.on("click",(function(){return e.myHeaderClick()})),u.val(!0);var d=new vi("del","formbt").on("click",(function(){return e.btnClick("del",1)})),m=f("div","".concat(ae,"-form-fields")).children(o.el,s.el,f("div","".concat(ae,"-buttons")).children(new vi("add","formbt").on("click",(function(){return e.btnClick("add",2)})),d)),g=f("div","".concat(ae,"-form-fields")).children(c.el,h.el,new vi("del","formbt").on("click",(function(){return e.btnClick("del",2)})));return(e=t.call(this,U("contextmenu.sort"),[f("div","".concat(ae,"-form-fields")).children(n.el,new Mr(u,{required:!1},"".concat(U("dataSort.header"),":"),120).el),f("div","".concat(ae,"-form-fields")).children(r.el,a.el,new vi("add","formbt").on("click",(function(){return e.btnClick("add",1)}))),m,g,f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})),new vi("cancel").on("click",(function(){return e.btnClick("cancel")})))])).cf=n,e.of1=a,e.sortby1=r,e.of2=s,e.sortby2=o,e.of3=h,e.sortby3=c,e.ci1=null,e.ci2=null,e.ci3=null,e.values=[],e.mcols=null,e.mcolsheader=null,e.cicount=1,e.div2=m,e.div3=g,e.but2=d,e.sc=1,e.myheader=u,m.hide(),g.hide(),e.change=function(){},e}return o()(i,[{key:"btnClick",value:function(e,t){if("ok"===e){if(!this.cf.validate())return;var i=[],n=[];if(i.push(this.of1.val()),n.push(this.sortby1.val()),this.sc>=2&&(i.push(this.of2.val()),n.push(this.sortby2.val())),this.sc>=3&&(i.push(this.of3.val()),n.push(this.sortby3.val())),new Set(n).size<n.length)return void le("error","".concat(U("dataSort.msg")));this.change("ok",n,i,this.myheader.val()),this.hide()}else"add"===e?1===t?(this.div2.css("display",""),this.sc=2):2===t&&(this.div3.css("display",""),this.but2.hide(),this.sc=3):"del"===e?1===t?(this.div2.hide(),this.sc=1):2===t&&(this.div3.hide(),this.but2.css("display",""),this.sc=2):"cancel"===e&&this.hide()}},{key:"myHeaderClick",value:function(){var e=this.mcols,t=this.mcolsheader,i=this.myheader,n=this.sortby1,r=this.sortby2,a=this.sortby3,o=i.val()?e:t;n.input.setItemsMap(o),n.val(0),r.input.setItemsMap(o),r.val(1),a.input.setItemsMap(o),a.val(2)}},{key:"setValue",value:function(e){if(null!=e){if(e){var t=this.cf,i=this.of1,n=this.sortby1,r=this.of2,a=this.sortby2,o=this.of3,s=this.sortby3,l=e.ref,c=e.sort,h=e.ci,u=e.m,f=e.mcols,d=e.mcolsheader,m=(c[0]||{order:"asc"}).order1,g=(c[1]||{order:"asc"}).order2,v=(c[2]||{order:"asc"}).order3;t.val(l),i.val(m),r.val(g),o.val(v),this.mcols=f,this.mcolsheader=d,this.myheader.val(1);for(var p=[],y=0;y<f.length;y++)p.push(y);n.input.setItemsMap(f),n.val(0),a.input.setItemsMap(f),a.val(1),s.input.setItemsMap(f),s.val(2),this.ci=h,this.values=u}this.show()}}}]),i}(Rr);function Nr(e){return f("div","".concat(ae,"-item ").concat(e))}function Ur(e){var t=this;return Nr("state").child(U("sort.".concat(e))).on("click.stop",(function(){return t.itemClick(e)}))}function Xr(e){var t=this,i=this.filterbEl,n=this.filterValues;i.html(""),Object.keys(e).forEach((function(r,a){var o=e[r],s=n.includes(r)?"checked":"";i.child(f("div","".concat(ae,"-item state ").concat(s)).on("click.stop",(function(){return t.filterClick(a,r)})).children(""===r?U("filter.empty"):r,f("div","label").html("(".concat(o,")"))))}))}function qr(){var e=this.filterhEl,t=this.filterValues,i=this.values;e.html("".concat(t.length," / ").concat(i.length)),e.checked(t.length===i.length)}var Wr=function(){function e(){var t=this;l()(this,e),this.filterbEl=f("div","".concat(ae,"-body")),this.filterhEl=f("div","".concat(ae,"-header state")).on("click.stop",(function(){return t.filterClick(0,"all")})),this.el=f("div","".concat(ae,"-sort-filter")).children(this.sortAscEl=Ur.call(this,"asc"),this.sortDescEl=Ur.call(this,"desc"),Nr("divider"),f("div","".concat(ae,"-filter")).children(this.filterhEl,this.filterbEl),f("div","".concat(ae,"-buttons")).children(new vi("cancel").on("click",(function(){return t.btnClick("cancel")})),new vi("ok","primary").on("click",(function(){return t.btnClick("ok")})))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}return o()(e,[{key:"btnClick",value:function(e){if("ok"===e){var t=this.ci,i=this.sort,n=this.filterValues;this.ok&&this.ok(t,i,"in",n)}this.hide()}},{key:"itemClick",value:function(e){this.sort=e;var t=this.sortAscEl,i=this.sortDescEl;t.checked("asc"===e),i.checked("desc"===e)}},{key:"filterClick",value:function(e,t){var i=this.filterbEl,n=this.filterValues,r=this.values,a=i.children();"all"===t?a.length===n.length?(this.filterValues=[],a.forEach((function(e){return f(e).checked(!1)}))):(this.filterValues=Array.from(r),a.forEach((function(e){return f(e).checked(!0)}))):f(a[e]).toggle("checked")?n.push(t):n.splice(n.findIndex((function(e){return e===t})),1);qr.call(this)}},{key:"set",value:function(e,t,i,n){this.ci=e;var r=this.sortAscEl,a=this.sortDescEl;null!==n?(this.sort=n.order,r.checked(n.asc()),a.checked(n.desc())):(this.sortDesc=null,r.checked(!1),a.checked(!1)),this.values=Object.keys(t),this.filterValues=i?Array.from(i.value):Object.keys(t),Xr.call(this,t,i),qr.call(this)}},{key:"setOffset",value:function(e){var t=this;this.el.offset(e).show();var i=1;Re(this.el,(function(){i<=0&&(t.hide(),i=5),i-=1}))}},{key:"setOffsetAdjustView",value:function(e,t,i){var n=this;this.el.show();var r=this.el.offset(),a=r.width,o=r.height;e.top+o>i&&(e.top=i-o),e.left+a>t&&(e.left=t-a),this.el.offset(e);var s=1;Re(this.el,(function(){s<=0&&(n.hide(),s=5),s-=1}))}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide(),Ee(this.el)}}]),e}(),Yr=function(){function e(){l()(this,e),xe()(this,"onEdit",!1),this.el=f("div","".concat(ae,"-comment-tip")).hide()}return o()(e,[{key:"hide",value:function(){this.el.hide()}},{key:"setPosition",value:function(e,t,i){if(!0!==this.onEdit){var n=this.el,r=i?t.left-t.width-1:t.left+t.width,a=t.top-10;n.css("left","".concat(r,"px")),n.css("top","".concat(a,"px")),n.html(e).show(),i&&n.css("left","".concat(r-n.el.offsetWidth,"px"))}}}]),e}();function Vr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Gr=function(e){ee()(i,e);var t=Vr(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("80px",""),{required:!0},"".concat(U("dataSearch.label"),":"),100),r=new Mr(new zr("80px",""),{required:!1},"".concat(U("dataSort.casesense"),":"),100),a=new Mr(new zr("30px",""),{required:!1},"".concat(U("dataSearch.matchwhole"),":"),150),o=new Mr(new Pr("values",["values","formulas","comments"],"120px",(function(e){return U("dataSearch.lookin.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSearch.lkinlb"),":"),100);return(e=t.call(this,U("toolbar.search"),[f("div","".concat(ae,"-form-fields")).children(r.el,a.el),f("div","".concat(ae,"-form-fields")).child(n.el),f("div","".concat(ae,"-form-fields")).child(o.el),f("div","".concat(ae,"-buttons")).children(new vi("previous").on("click",(function(){return e.btnClick("previous")})),new vi("next").on("click",(function(){return e.btnClick("next")})),new vi("close","primary").on("click",(function(){return e.btnClick("close")})))],"500px",!1,!0)).formField=n,e.casesense=r,e.lookin=o,e.matchwhole=a,e.change=function(){},e}return o()(i,[{key:"btnClick",value:function(e){if("close"!==e){if(!this.formField.validate())return;var t=this.casesense.val(),i=this.lookin.val(),n=this.matchwhole.val(),r=this.formField.val().trim();switch(e){case"previous":this.change("previous",r,t,i,n);break;case"next":this.change("next",r,t,i,n)}}else this.hide()}},{key:"show",value:function(){Ii()(re()(i.prototype),"show",this).call(this),this.formField.input.focus()}}]),i}(Rr),Zr=function(){function e(t,i){var n=this;l()(this,e),this.data=t,this.mode=i,this.ishtml=!1,this.inputChange=function(){},this.enter=function(){},this.tab=function(){},this.focuson=function(){},this.el=f("div","".concat(ae,"-formula-bar")),this.barLabel=f("div","".concat(ae,"-bar-label")),this.formulaInput=f("div","".concat(ae,"-formula-input")).on("input",(function(e){n.inputChange(n.ishtml?e.target.innerHTML:e.target.innerText)})).on("focus",(function(e){n.focuson()})).on("keydown",(function(e){var t=e.keyCode||e.which;13===t?(e.altKey||n.formulaInput.el.blur(),n.enter(e,n.ishtml)):9===t&&(n.formulaInput.el.blur(),n.tab(e))})),"read"===this.mode?this.formulaInput.attr("disabled","disabled"):this.formulaInput.attr("contenteditable","true"),this.el.children(this.barLabel,this.formulaInput),this.reset()}return o()(e,[{key:"resetData",value:function(e){this.data=e,this.reset()}},{key:"reset",value:function(){var e=this.data,t=e.selector,i=v(t.ci)+""+(t.ri+1),n=e.getSelectedCell(),r="",a=!1;n&&(n.html?(r=n.html,this.ishtml=!0):(this.ishtml=!1,n.f?r=n.f:n.ufv?r=n.ufv:n.text&&(r=n.text,a=!0))),this.barLabel.html(i),this.formulaInput.html(r,!this.ishtml,a)}}]),e}();function Kr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Jr=function(e){ee()(i,e);var t=Kr(i);function i(){var e;return l()(this,i),e=t.call(this),xe()(Wn()(e),"col",void 0),xe()(Wn()(e),"row",void 0),e.el.attr("contentEditable","true"),e.el.attr("placeholder","".concat(U("toolbar.commentDefault"))),e.el.attr("id","commentEdit"),e}return o()(i,[{key:"saveAndHide",value:function(e){var t=this;if(void 0!==this.col&&void 0!==this.row){if(""!==this.el.html()){for(var i=-1,n=0;n<e.data.comments.length;n++)if(e.data.comments[n].col===this.col&&e.data.comments[n].row===this.row){i=n;break}-1===i?e.data.comments.push({col:this.col,row:this.row,author:"Aspose",note:this.el.html()}):e.data.comments[i].note=this.el.html()}e.data.comments=e.data.comments.filter((function(e){return!t.checkEmptyContent(e.note)})),this.hide(),e.commentTip.onEdit=!1,this.col=void 0,this.row=void 0}}},{key:"checkEmptyContent",value:function(e){var t=document.createElement("div");return t.innerHTML=e,""===t.innerText}},{key:"setPosition",value:function(e,t,n){Ii()(re()(i.prototype),"setPosition",this).call(this,e,t,n),this.el.focus()}}]),i}(Yr),$r=i(10),Qr=function(){function e(){l()(this,e),xe()(this,"name",void 0)}return o()(e,[{key:"execute",value:function(e){}}]),e}();function ea(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}function ta(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ia(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ta(Object(i),!0).forEach((function(t){xe()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ta(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function na(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}function ra(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function aa(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(i),!0).forEach((function(t){xe()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ra(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function oa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var sa=[function(e){ee()(i,e);var t=ea(i);function i(){var e;l()(this,i);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),xe()(Wn()(e),"name","delete"),e}return o()(i,[{key:"execute",value:function(e){var t=e.canvas,i=e.data,n=t.fabric,r=n.getActiveObject(),a=t.findObjByData(r.id,i);if(a)if(a.op="del",i.canvasFreeze){var o=i.canvasFreeze;[o.br,o.bl,o.tr,o.tl].forEach((function(e){e.remove(t.findObjInCanvas(e,r.id)),t.saveCanvasData(i,e),e.renderAll()}))}else n.remove(r),n.renderAll(),t.saveCanvasData(i,n)}}]),i}(Qr),function(e){ee()(r,e);var t,i,n=na(r);function r(){var e;l()(this,r);for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return e=n.call.apply(n,[this].concat(i)),xe()(Wn()(e),"name","paste"),xe()(Wn()(e),"canvas",void 0),xe()(Wn()(e),"sheet",void 0),xe()(Wn()(e),"inFreeze",void 0),e}return o()(r,[{key:"execute",value:(i=be()(Ce.a.mark((function e(t){var i,n,r,a,o;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.canvas.clipboard,this.canvas=null!==(i=this.canvas)&&void 0!==i?i:t.canvas.fabric,this.sheet=null!==(n=this.sheet)&&void 0!==n?n:t,this.inFreeze=null!==(r=this.inFreeze)&&void 0!==r?r:t.canvas.inFreeze,o=this,a){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,a.clonedObj.clone(function(){var e=be()(Ce.a.mark((function e(i){var n;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=fabric.util.object.clone(i),o.setImagePosition(n),t.canvas.setLoading(t,{left:n.left,top:n.top}),e.next=6,o.addImageToData(n);case 6:o.setImageEventAndLayout(n),o.addImageToCanvas(n)?o.reactiveObj(n):o.rollback(o.sheet,n),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0),le(e.t0);case 14:return e.prev=14,t.canvas.removeLoading(t),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[0,10,14,17]])})));return function(t){return e.apply(this,arguments)}}(),["id","tick","imgType","zorder","strid"]);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"rollback",value:function(e,t){var i=e.data,n=e.canvas;n.fabric.remove(n.fabric.getObjects()[n.fabric.getObjects().findIndex((function(e){return e.id===t.id}))]),n.saveCanvasData(e.data,n.fabric),n.inFreeze&&(n.inFreeze.removeImage(t.id),n.removeImageInData(i,t.id))}},{key:"uploadImg",value:function(e,t){var i=e.canvas,n=new FormData;n.append("uid",e.uniqueid);var r={ri:e.data.selector.ri,ci:e.data.selector.ci,name:e.data.name};n.append("p",JSON.stringify(r)),n.append("image",t);var a=e.data.getSelectedRect();i.setLoading(e,{top:a.top,left:a.left}),$.ajax({url:e.imageUploadByLocalUrl,type:"post",processData:!1,contentType:!1,data:n,success:function(t,n,r){(t=JSON.parse(t)).Error?le("error",t.Error):i.doInsertImage(t,e)}})}},{key:"setImagePosition",value:function(e){var t=this.sheet.data,i=this.sheet.getTableOffset(),n=0,r=0;if(!e)throw"no cloneObj";if(!this.canvas)throw"no canvas";if(!this.sheet)throw"no sheet data";if(this.canvas.getActiveObject()){var a=this.canvas.getActiveObject();n=a.left+20,r=a.top+20}else{var o=t.getSelectedRect();if(!o)throw"get selected rect value is null";n=o.left+i.left,r=o.top+i.top}e.set({left:n,top:r,evented:!0}),this.sheet.canvas.edgeCollision(e)}},{key:"addImageToCanvas",value:function(e){var t=this,i=this.canvas,n=this.sheet.data;if(n.name!==this.sheet.canvas.clipboard.sheetName)return!1;if(n.canvasFreeze){var r=n.canvasFreeze;[r.br,r.bl,r.tr,r.tl].forEach((function(i){var n=fabric.util.object.clone(e),r=t.inFreeze.getOffsetWhenIndividualCanvasMovement(i.canvasName);n.set({top:n.top+r.y,left:n.left+r.x}),i.add(n),n.setCoords()}))}else e.setCoords(),i.add(e);return!0}},{key:"addImageToData",value:(t=be()(Ce.a.mark((function e(t){var i,n,r,a,o,s,l,c,h,u;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.sheet,n=this.sheet.canvas.data,r=i.canvas.clipboard.newData,a=ia({},r),o=this.sheet.getTableOffset(),s="Picture"!==a.type,l={ri:n.selector.ri,ci:n.selector.ci,name:n.name,srcid:a.id,srcname:i.canvas.clipboard.sheetName,isshape:s},(c=new FormData).set("p",JSON.stringify(l)),c.set("uid",i.uniqueid),e.next=12,fetch(i.imageCopyUrl,{method:"POST",body:c});case 12:if((h=e.sent).ok){e.next=15;break}throw"upload copy image fail";case 15:return e.next=17,h.json();case 17:if(u=e.sent,u=JSON.parse(u)){e.next=21;break}throw"upload copy image return null ";case 21:if(!u.Error){e.next=23;break}throw u.Error;case 23:delete u.width,delete u.height,n.images||(n.images=[]),Object.assign(a,u),a.left=t-o.left,a.top=t-o.top,s?n.shapes.push(a):n.images.push(a),delete u.type,Object.assign(t,u),t.imgType=a.type,t.id=a.getIdtick(u.id,u.tick),t.strid=u.strid,t.zorder=i.data.topOrder++,ya(t,a),t.changed=!0;case 38:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setImageEventAndLayout",value:function(e){"Chart"===e.imgType&&e.setControlsVisibility({mtr:!1}),this.sheet.canvas.setSelectionLayout(e),this.sheet.canvas.eventsOn(e,this.sheet.canvas.imgEvents)}},{key:"reactiveObj",value:function(e){var t=this.canvas,i=this.sheet,n=i.data;if(n.canvasFreeze){var r=n.canvasFreeze,a=r.br,o=r.bl,s=r.tr,l=r.tl;[a,o,s,l].forEach((function(t){t.discardActiveObject(),t.setActiveObject(t.getObjects().find((function(t){return t.id===e.id}))),t.requestRenderAll(),i.canvas.saveCanvasData(n,t),i.canvas.saveOriginalAngleInfoOfImage(l)}))}else t.discardActiveObject(),t.setActiveObject(e),t.requestRenderAll(),i.canvas.saveCanvasData(n,t),i.canvas.saveOriginalAngleInfoOfImage(t)}}]),r}(Qr),function(e){ee()(i,e);var t=oa(i);function i(){var e;l()(this,i);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),xe()(Wn()(e),"name","copy"),e}return o()(i,[{key:"execute",value:function(e){var t=e.canvas.fabric;if(t.getActiveObject()){var i=t;e.data.canvasFreeze&&(i=e.data.canvasFreeze.tl),i.getActiveObject().clone((function(t){e.canvas.clipboard={clonedObj:t,newData:aa({},e.canvas.findObjByData(t.id,e.data)),sheetName:e.data.name}}),["id","tick","imgType","zorder","strid"])}}}]),i}(Qr)],la=function(){function e(t){var i=this;l()(this,e),xe()(this,"freezeXY",void 0),xe()(this,"imageCanvas",void 0),xe()(this,"freezeEvents",{"object:rotating":function(e){return function(t){i.imageCanvas.pubSub.publish("object:rotating",t,e)}},"object:moving":function(e){return function(t){i.imageCanvas.pubSub.publish("object:moving",t,e)}},"object:scaling":function(e){return function(t){i.imageCanvas.pubSub.publish("object:scaling",t,e)}},"selection:created":function(e){return function(t){i.imageCanvas.pubSub.publish("selection:created",t,e)}},"selection:cleared":function(e){return function(t){i.imageCanvas.pubSub.publish("selection:cleared",t,e)}},"selection:updated":function(e){return function(t){i.imageCanvas.pubSub.publish("selection:updated",t,e)}}}),this.imageCanvas=t;var n=t.sheet.getTableOffset(),r=t.sheet.data,a=t.sheet;if(!r.displayRight2Left){var o=r.freezeTotalWidth()+n.left/a.table.zoomlevel,s=r.freezeTotalHeight()+n.top/a.table.zoomlevel;if(this.freezeXY={},this.freezeXY.x=o,this.freezeXY.y=s,JSON.stringify(r.freeze)!==JSON.stringify([0,0])&&!r.canvasFreeze){t.pubSub=t.initPubSub();var c=t.fabric;c.off("object:moving",t.canvasEvents["object:moving"]),c.set("canvasName","br");var h=this.createCanvas(a.overlayerEl,"bl",o,c.height,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),u=this.createCanvas(a.overlayerEl,"tr",c.width,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),f=this.createCanvas(a.overlayerEl,"tl",o,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"])));this.setEventAndClipPath(c,u,h,f);for(var d=0;d<document.getElementsByClassName("canvas-container").length;d++)document.getElementsByClassName("canvas-container")[d].setAttribute("style","position:absolute");r.originFreezeSize={tl:{width:f.width,height:f.height},bl:{width:h.width,height:h.height},tr:{width:u.width,height:u.height},br:{width:c.width,height:c.height}},r.canvasFreeze={tl:f,bl:h,tr:u,br:c},this.setZoom(this.imageCanvas.sheet.table.zoomlevel)}}}return o()(e,[{key:"getFreezeCanvasClipPath",value:function(e,t,i){var n=this.freezeXY,r=this.imageCanvas.sheet,a=this.imageCanvas.tOffset;a.left/=r.data.zoomlevel,a.top/=r.data.zoomlevel;var o=new $r.fabric.Rect({width:n.x,height:t.height-n.y,top:n.y,left:a.left}),s=new $r.fabric.Rect({width:n.x,height:n.y,left:a.left,top:a.top}),l=new $r.fabric.Rect({width:e.width-n.x,height:n.y,left:n.x,top:a.top}),c=new $r.fabric.Rect({width:i.width-n.x,height:i.height-n.y,left:n.x,top:n.y});return function(e){var t;switch(e){case"tr":t=l;break;case"bl":t=o;break;case"tl":t=s;break;default:t=c}return t}}},{key:"getOffsetsBetweenCanvases",value:function(e,t){var i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,a=-n.y,o={offsetX:0,offsetY:0};switch(e+t){case"tlbl":case"trbr":o={offsetX:0,offsetY:-a};break;case"bltl":case"brtr":o={offsetX:0,offsetY:a};break;case"tltr":case"blbr":o={offsetX:-r,offsetY:0};break;case"brbl":case"trtl":o={offsetX:r,offsetY:0};break;case"trbl":o={offsetX:r,offsetY:-a};break;case"tlbr":o={offsetX:-r,offsetY:-a};break;case"bltr":o={offsetX:-r,offsetY:a};break;case"brtl":o={offsetX:r,offsetY:a}}return o}},{key:"setIndividualCanvasesToMoveInSync",value:function(e,t,i,n){var r=this.imageCanvas.findObjInCanvas(e,t.target.id);if(r){var a=this.getOffsetsBetweenCanvases(n,e.canvasName);r.set({left:t.target.left-a.offsetX,top:t.target.top-a.offsetY}),r.set(i),this.imageCanvas.edgeCollision(r,e.canvasName),r.dirty=!0,e.renderAll()}}},{key:"setEventAndClipPath",value:function(e,t,i,n){var r=this;[e,t,i,n].forEach((function(e){var t=Object.keys(r.freezeEvents).map((function(t){return[t,r.freezeEvents[t](e.canvasName)]}));t=Object.fromEntries(t),r.imageCanvas.eventsOn(e,t)}));var a=this.getFreezeCanvasClipPath(t,i,e);this.freezeClipPath=a,[e,t,i,n].forEach((function(e){e.clipPath=a(e.canvasName),r.subscribeObjectEvent(e),r.subscribeSelectionEvent(e),r.subscribeCustomEvent(e,a)}))}},{key:"updateCanvasAllObjectAndRenderAll",value:function(e,t){e.getObjects().forEach(t),e.renderAll()}},{key:"subscribeObjectEvent",value:function(e){var t=this;this.imageCanvas.pubSub.subscribe("object:rotating",(function(i,n){var r={angle:i.target.angle};t.setIndividualCanvasesToMoveInSync(e,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:moving",(function(i,n){var r=n===e.canvasName?{left:i.target.left,top:i.target.top}:{};t.setIndividualCanvasesToMoveInSync(e,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:scaling",(function(i,n){var r={scaleX:i.target.scaleX,scaleY:i.target.scaleY};t.setIndividualCanvasesToMoveInSync(e,i,r,n)}))}},{key:"getOffsetWhenIndividualCanvasMovement",value:function(e){var t,i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,a=-n.y;switch(e){case"tr":t={x:r,y:0};break;case"bl":t={x:0,y:a};break;case"br":t={x:r,y:a};break;default:t={x:0,y:0}}return t}},{key:"subscribeCustomEvent",value:function(e,t){var i=this;this.imageCanvas.pubSub.subscribe("reset",(function(){var t=i.getOffsetWhenIndividualCanvasMovement(e.canvasName);i.updateCanvasAllObjectAndRenderAll(e,(function(e){e.set({left:e.left-t.x,top:e.top-t.y}),e.setCoords(),e.dirty=!0}))})),this.imageCanvas.pubSub.subscribe("object:scroll",(function(t){var n=i.imageCanvas.data.canvasData,r=i.getOffsetWhenIndividualCanvasMovement(e.canvasName);if(n){var a=JSON.parse(n);e.getObjects().forEach((function(e){var t=a.objects.find((function(t){return t.id===e.id}));e.set({left:t.left+r.x,top:t.top+r.y}),e.setCoords()})),e.renderAll()}}))}},{key:"clearFreeze",value:function(e){if(e.canvasFreeze){this.imageCanvas.eventsOff(this.imageCanvas.fabric,this.freezeEvents);var t=e.canvasFreeze.tr,i=e.canvasFreeze.tl,n=e.canvasFreeze.bl;t.dispose(),i.dispose(),n.dispose(),document.getElementById("tr").remove(),document.getElementById("tl").remove(),document.getElementById("bl").remove();var r={width:this.imageCanvas.fabric.width,height:this.imageCanvas.fabric.height,top:this.imageCanvas.tOffset.top/this.imageCanvas.sheet.table.zoomlevel,left:this.imageCanvas.tOffset.left/this.imageCanvas.sheet.table.zoomlevel};this.imageCanvas.fabric.clipPath=new $r.fabric.Rect(r),this.imageCanvas.eventsOn(this.imageCanvas.fabric,this.imageCanvas.canvasEvents),this.imageCanvas.pubSub=this.imageCanvas.initPubSub(),this.imageCanvas.pubSub.subscribe("object:scroll",this.imageCanvas.customEvents["object:scroll"]),this.imageCanvas.fabric.renderAll(),e.canvasFreeze=void 0}}},{key:"setZoom",value:function(e){var t=this.imageCanvas,i=t.data,n=(t.fabric,t.tOffset,i.originFreezeSize);this.foreachFreezeCanvas((function(t){t.setZoom(e),t.renderAll()})),this.foreachFreezeCanvas((function(t){t.setWidth(n[t.canvasName].width*e),t.setHeight(n[t.canvasName].height*e)}),"br")}},{key:"resize",value:function(){var e=this.imageCanvas,t=e.data,i=(e.fabric,t.canvasFreeze),n=(i.tl,i.bl),r=i.tr,a=i.br,o=this.getFreezeCanvasClipPath(r,n,a);this.foreachFreezeCanvas((function(e){e.clipPath=o(e.canvasName),e.renderAll()}))}},{key:"subscribeSelectionEvent",value:function(e){var t=this;this.imageCanvas.pubSub.subscribe("selection:created",(function(i,n){if(n!==e.canvasName){t.imageCanvas.checkHyperlink(t.imageCanvas.data.canvasFreeze.br)&&!i.e.ctrlKey&&t.imageCanvas.openLink(t.imageCanvas.data);var r=t.imageCanvas.findObjInCanvas(e,i.target.id);e._setActiveObject(r),e.renderAll()}})),this.imageCanvas.pubSub.subscribe("selection:cleared",(function(t,i){i!==e.canvasName&&(e._discardActiveObject(),e.renderAll())})),this.imageCanvas.pubSub.subscribe("selection:updated",(function(i,n){var r;if(n!==e.canvasName){var a=t.imageCanvas.findObjInCanvas(e,i.target.id);(null===(r=e.getActiveObject())||void 0===r?void 0:r.id)!==a.id&&(e._setActiveObject(a),e.renderAll())}}))}},{key:"setObjectOrderAndChangedInAllCanvas",value:function(e,t){var i=this;++e.topOrder,Object.keys(e.canvasFreeze).forEach((function(n){var r=i.imageCanvas.findObjInCanvas(e.canvasFreeze[n],t.id);r&&(r.changed=!0,i.imageCanvas.sendImageToFont(e.canvasFreeze[n],r),t.zorder=r.zorder=e.topOrder,"TextBox"===t.imgType&&n!==t.canvas.canvasName&&(r.width=t.width,r.height=t.height,r.scaleX=1,r.scaleY=1),e.canvasFreeze[n].renderAll())}))}},{key:"setOrderAndSaveData",value:function(e){var t=this.imageCanvas.data;this.setObjectOrderAndChangedInAllCanvas(t,e),this.imageCanvas.saveOriginalAngleInfoOfImage(t.canvasFreeze.br),this.imageCanvas.saveCanvasData(t,t.canvasFreeze.br)}},{key:"loadFreezeImage",value:function(){var e=this.imageCanvas.data;if(e.canvasFreeze){var t=e.canvasFreeze,i=t.tl,n=t.bl,r=t.tr;this.imageCanvas.rerenderCanvasBySavedJson(n,{x:0,y:0},n.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(r,{x:0,y:0},r.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(i,{x:0,y:0},i.clipPath)}}},{key:"createCanvas",value:function(e,t,i,n,r){var a=document.createElement("canvas");a.width=i,a.height=n,a.setAttribute("id",t),e.children(a),window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1);var o=new $r.fabric.Canvas(t);return o.selection=!1,o.set("canvasName",t),this.imageCanvas.eventsOn(o,this.imageCanvas.canvasEvents),o}},{key:"removeImage",value:function(e){this.foreachFreezeCanvas((function(t){t.remove(t.getObjects()[t.getObjects().findIndex((function(t){return t.id===e}))])}),"br")}},{key:"setDirty",value:function(e){this.foreachFreezeCanvas((function(t){t.getObjects().find((function(t){return t.id===e})).dirty=!0,t.requestRenderAll()}))}},{key:"setVisible",value:function(e,t){this.foreachFreezeCanvas((function(i){i.getObjects().find((function(t){return t.id===e})).visible=t}))}},{key:"setFilter",value:function(e,t){this.foreachFreezeCanvas((function(i){var n=i.getObjects().find((function(t){return t.id===e}));n.filters[0]=t,n.applyFilters()}))}},{key:"setCustomHighlight",value:function(e,t,i){this.foreachFreezeCanvas((function(n){var r=n.getObjects().find((function(t){return t.id===e}));i(t,r)}))}},{key:"setOrder",value:function(){this.foreachFreezeCanvas((function(e){null!=e&&e.getObjects().find((function(e){return!e.zorder}))||e.getObjects().sort((function(e,t){return e.zorder<t.zorder?-1:1})).forEach((function(t){e.bringToFront(t)}))}))}},{key:"saveCanvasData",value:function(){var e=this,t=this.imageCanvas.data;this.foreachFreezeCanvas((function(i){e.imageCanvas.saveCanvasData(t,i)}))}},{key:"setCursor",value:function(e){this.foreachFreezeCanvas((function(t){t.defaultCursor=e}))}},{key:"renderAll",value:function(){this.foreachFreezeCanvas((function(e){e.renderAll()}))}},{key:"foreachFreezeCanvas",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var r=this.imageCanvas.data;if(r.canvasFreeze){var a=r.canvasFreeze,o=a.tl,s=a.bl,l=a.tr,c=a.br;[o,s,l,c].forEach((function(t){i.includes(t.canvasName)||e(t)}))}}}]),e}();function ca(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ha=function(){function e(){l()(this,e),this.subscribers=[]}return o()(e,[{key:"subscribe",value:function(e,t){var i=this.subscribers[e];i?i.push(t):this.subscribers[e]=[t]}},{key:"publish",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var r=this.subscribers[e]||[];r.forEach((function(e){return e.apply(void 0,i)}))}}]),e}(),ua=function(e,t){return"p_".concat(e,"_").concat(t)},fa=function(e,t){return"s_".concat(e,"_").concat(t)},da=function(e){var t;this.visible=e,this.fabobj.visible=e;var i=this.getIdtick();null===(t=this.inFreeze)||void 0===t||t.setVisible(i,e),this.setDirty()},ma=function(){var e;this.fabobj.set("dirty",!0),this.fabobj.canvas.requestRenderAll();var t=this.getIdtick();null===(e=this.inFreeze)||void 0===e||e.setDirty(t)},ga=function(e){var t;this.fabobj.filters[0]=e,this.fabobj.applyFilters();var i=this.getIdtick();null===(t=this.inFreeze)||void 0===t||t.setFilter(i,e)},va=function(e,t){var i;t(e,this.fabobj);var n=this.getIdtick();null===(i=this.inFreeze)||void 0===i||i.setCustomHighlight(n,e,t)},pa=function(){return"Picture"===this.type?ua(this.id,this.tick):fa(this.id,this.tick)},ya=function(e,t){"TextBox"===e.imgType&&(e.shape=t,e.drawObject=ba,e.on("modified",wa))},ba=function(e,t){var i=this.width,n=this.height,r=this.shape;e.save(),e.translate(-i/2,-n/2);var a=new Dt(0,0,i,n,10);a.setPading(r.lp,r.rp);var o=new Bt(e,i,n),s=1/Ot();o.scale(s,s),o.scale(s,s),o.rect3(a,r),r.ishideText||o.richtext(r,a,r.align,r.valign,r.wrap,r.getHighlight()),e.restore()},wa=function(e){var t=this.getScaledWidth(),i=this.getScaledHeight();this.scaleX=1,this.scaleY=1,this.width=t,this.height=i,this.shape.originWidth=t,this.shape.originHeight=i,this.shape.setDirty()},xa=function(e){ee()(i,e);var t=ca(i);function i(){var e;return l()(this,i),e=t.call(this,"canvas"),xe()(Wn()(e),"imgEvents",{mouseup:function(t){var i=Wn()(e).sheet,n=i.data,r=t.target;if(!window.mobileAndTabletCheck()){var a=r.canvas;a||(a=e.fabric),n.canvasFreeze?e.inFreeze.setOrderAndSaveData(r):(r.changed=!0,e.sendImageToFont(a,r),r.zorder=++n.topOrder,e.findObjInCanvas(a,r.id).zorder=r.zorder,e.saveOriginalAngleInfoOfImage(a),e.saveCanvasData(n,a)),i.selector.setObjId(r.id)}},mousedown:function(t){window.mobileAndTabletCheck()||(e.sheet.selector.hide(),e.sheet.editor.clear(),null==t||t.e.stopPropagation())},mousedblclick:function(t){if(!window.mobileAndTabletCheck()){var i=t.target,n=Wn()(e).sheet;if("OleObject"===i.imgType)n.getOle(i.strid);else if("TextBox"===i.imgType){var r=e.findShape(i.id,n.data);n.setEditForTextBox(r),e.fabric.discardActiveObject().requestRenderAll()}}},mousemove:function(t){e.findObjByData(t.target.id,e.sheet.data).hyperlink?e.fabric.hoverCursor="pointer":e.fabric.hoverCursor="move"}}),xe()(Wn()(e),"pausePanning",!1),xe()(Wn()(e),"canvasEvents",{"mouse:move:before":function(){e.sheet.data.canvasFreeze&&e.sheet.data.canvasFreeze.tl.getObjects().length!==e.sheet.data.canvasFreeze.br.getObjects().length&&e.inFreeze.loadFreezeImage()},"object:moving":function(t){e.edgeCollision(t.target,"canvas")},"selection:created":function(t){e.checkHyperlink(e.fabric)&&!t.e.ctrlKey&&e.openLink(e.data)}}),xe()(Wn()(e),"customEvents",{"object:scroll":function(){var t=e.data,i=t.scroll,n=t.displayRight2Left,r=t.canvasData,a=n?i.x:-i.x,o=-i.y;if(r){var s=JSON.parse(r);e.fabric.getObjects().forEach((function(e){var t=s.objects.find((function(t){return t.id===e.id}));e.set({left:t.left+a,top:t.top+o}),e.setCoords()})),e.fabric.renderAll()}}}),xe()(Wn()(e),"tOffset",void 0),xe()(Wn()(e),"data",void 0),xe()(Wn()(e),"fabric",void 0),xe()(Wn()(e),"freeze",void 0),xe()(Wn()(e),"freezeXY",{x:0,y:0}),xe()(Wn()(e),"pubSub",void 0),xe()(Wn()(e),"sheet",void 0),xe()(Wn()(e),"basicZorder",void 0),xe()(Wn()(e),"canvasId","canvas_".concat((new Date).getTime())),xe()(Wn()(e),"imageOperationList",{}),e.attr("id",e.canvasId),e.pubSub=e.initPubSub(),sa.forEach((function(t){var i=new t;e.imageOperationList[i.name]=i})),Te(window,"resize",(function(t){window.mobileAndTabletCheck()||e.resize(t)})),e}return o()(i,[{key:"publishEvent",value:function(e,t){this.pubSub.publish(e,t)}},{key:"initPubSub",value:function(){return new ha}},{key:"setCursor",value:function(e){this.sheet.data.canvasFreeze?this.inFreeze.setCursor(e):this.fabric.defaultCursor=e}},{key:"doNewSheetPage",value:function(e){this.fabric.clear(),this.inFreeze&&this.inFreeze.clearFreeze(e)}},{key:"doSwitchSheetPage",value:function(e){var t=this;this.sheet.selector.el.show();setTimeout((function e(){var i,n,r,a;t.sheet.canvas.fabric.getObjects().length===(null!==(i=null===(n=t.sheet.data.images)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+(null!==(r=null===(a=t.sheet.data.shapes)||void 0===a?void 0:a.length)&&void 0!==r?r:0)?t.doEndSwitchSheetPage():setTimeout(e,200)}),200);this.inFreeze&&this.inFreeze.clearFreeze(e)}},{key:"doEndSwitchSheetPage",value:function(){var e;this.setOrder(this.fabric),null===(e=this.sheet.canvas.inFreeze)||void 0===e||e.setOrder()}},{key:"initFreeze",value:function(){this.inFreeze=new la(this)}},{key:"rerenderCanvasBySavedJson",value:function(e,t,i){var n=this;if(this.data.canvasData&&this.fabric){this.initFreeze();var r=JSON.parse(this.data.canvasData);delete r.clipPath,this.loadFromCanvasData(JSON.stringify(r),(function(r,a){a.set({left:r.left+t.x,top:r.top+t.y}),"Chart"===a.imgType&&a.setControlsVisibility({mtr:!1}),n.setSelectionLayout(a),n.eventsOn(a,n.imgEvents);var o=n.findObjByData(r.id,n.data);o&&(ya(a,o),e.clipPath=i)}),e)}}},{key:"findObjInCanvas",value:function(e,t){return e.getObjects().find((function(e){return e.id===t}))}},{key:"recordCanvasData",value:function(e,t){var i,n,r=e.aCoords,a=this.tOffset,o=this.findObjByData(e.id,t);if(o){var s=r.tl.x+(r.tr.x-r.tl.x)/2-a.left,l=r.tl.y+(r.bl.y-r.tl.y)/2-a.top;o.centerX||(o.centerX=s),o.centerY||(o.centerY=l),o.currentCenterX=s,o.currentCenterY=l;var c=t.getCellRectByXY(r.tl.x,r.tl.y);o.width=o.originWidth*e.scaleX,o.height=o.originHeight*e.scaleY,o.scaleX=e.scaleX,o.scaleY=e.scaleY,o.top=e.top-a.top/t.zoomlevel+t.scroll.y,o.left=e.left-a.left/t.zoomlevel+t.scroll.x,o.row=null==c?void 0:c.ri,o.col=null==c?void 0:c.ci,o.changed=null!==(i=e.changed)&&void 0!==i&&i,o.zorder=null!==(n=e.zorder)&&void 0!==n?n:t.topOrder}}},{key:"edgeCollision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"canvas",i=this.data,n=this.tOffset,r=n.top/i.zoomlevel,a=n.left/i.zoomlevel;0!==i.scroll.y&&["br","bl"].includes(t)&&(r-=i.scroll.y),0!==i.scroll.x&&["br","tr"].includes(t)&&(a-=i.scroll.x),e.setCoords();var o=e.getBoundingRect().top/i.zoomlevel,s=e.getBoundingRect().left/i.zoomlevel;(o<r||s<a)&&(e.top=Math.max(e.top,e.top-o+r),e.left=Math.max(e.left,e.left-s+a))}},{key:"init",value:function(e){var t=this;this.tOffset=e.getTableOffset();var i=this.tOffset;this.attr("width",i.width+i.left),this.attr("height",i.height+i.top),this.sheet=e,window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1),this.fabric=new $r.fabric.Canvas(this.canvasId),this.clipPath({width:this.fabric.width,height:this.fabric.height,top:this.tOffset.top/e.data.zoomlevel,left:this.tOffset.left/e.data.zoomlevel});var n=0,r=setInterval((function(){(e.data.isImageOk||50===n)&&(t.onSheetImageLoaded(),clearInterval(r)),n++}),200);this.eventsOn(this.fabric,this.canvasEvents),this.fabric.selection=!1,window.mobileAndTabletCheck()&&this.fabric.removeListeners(),this.pubSub.subscribe("object:scroll",this.customEvents["object:scroll"])}},{key:"onSheetImageLoaded",value:function(){var e;this.setOrder(this.sheet.canvas.fabric),null===(e=this.sheet.canvas.inFreeze)||void 0===e||e.setOrder()}},{key:"resetFreeze",value:function(e){var t=r()(e.freeze,2),i=t[0],n=t[1];0===i&&0===n?this.inFreeze&&this.inFreeze.clearFreeze(e):this.initFreeze()}},{key:"reset",value:function(e){this.data=e,this.fabric.clear(),this.initFreeze(),this.freezeXY=this.inFreeze.freezeXY,this.inFreeze.loadFreezeImage(),this.fabric.renderAll()}},{key:"doResetPosition",value:function(e){0===e&&this.pubSub.publish("reset")}},{key:"saveOriginalAngleInfoOfImage",value:function(e){var t=this,i={};e.getObjects().forEach((function(e){i[e.id]=e.angle,t.rotateObject(e,0)})),e.renderAll(),e.getObjects().forEach((function(e){t.recordCanvasData(e,t.sheet.data),t.setDataAngle(e,i[e.id],t.sheet.data),t.rotateObject(e,i[e.id])})),e.renderAll()}},{key:"setDataAngle",value:function(e,t,i){var n=this.findObjByData(e.id,i);n&&(n.angle=t)}},{key:"clipPath",value:function(e){this.fabric.clipPath=new $r.fabric.Rect(e)}},{key:"eventsOn",value:function(e,t){for(var i in t)e.on(i,t[i])}},{key:"eventsOff",value:function(e,t){for(var i in t)e.off(i,t[i])}},{key:"saveCanvasData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.fabric,i=this.sheet;if(t){var n=t.toDatalessJSON(["id","tick","imgType","zorder","strid"]);n.objects.forEach((function(e){e.left+=i.data.scroll.x,e.top+=i.data.scroll.y})),e.canvasData=JSON.stringify(n)}}},{key:"loadFromCanvasData",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.fabric;e?n.loadFromJSON(e,(function(){i.setOrder(n),n.renderAll()}),t):n.clear()}},{key:"findObjByData",value:function(e,t){var i=this.findImage(e,t);return null!=i?i:this.findShape(e,t)}},{key:"setZoom",value:function(e){var t=this.sheet.data;this.tOffset=this.sheet.getTableOffset(),this.sheet.verticalScrollbar.move({top:0}),this.sheet.horizontalScrollbar.move({left:0}),t.canvasFreeze?this.inFreeze.setZoom(e):(this.fabric.clipPath=new $r.fabric.Rect({width:this.fabric.width/t.zoomlevel,height:this.fabric.height/t.zoomlevel,left:this.tOffset.left/t.zoomlevel,top:this.tOffset.top/t.zoomlevel}),this.fabric.setZoom(e),this.fabric.renderAll())}},{key:"findImage",value:function(e,t){var i;return null===(i=t.images)||void 0===i?void 0:i.find((function(t){return e===ua(t.id,t.tick)}))}},{key:"findShape",value:function(e,t){var i;return null===(i=t.shapes)||void 0===i?void 0:i.find((function(t){return e===fa(t.id,t.tick)}))}},{key:"resize",value:function(e){var t=this.sheet,i=this.fabric,n=this.tOffset;i&&(i.setWidth(e.target.outerWidth+n.left),i.setHeight(e.target.outerHeight+n.top),i.clipPath=new $r.fabric.Rect({width:i.getWidth(),height:i.getHeight(),top:this.tOffset.top/t.data.zoomlevel,left:this.tOffset.left/t.data.zoomlevel}),i.renderAll(),t.data.canvasFreeze&&this.inFreeze.resize())}},{key:"setSelectionLayout",value:function(e){e.set({borderColor:"gray",cornerColor:"gray",cornerSize:12,transparentCorners:!0})}},{key:"setTextBox",value:function(e,t,i){var n,r=e.canvas,a=new $r.fabric.Rect;i.width?i.fromOutside&&(delete i.width,delete i.height):(a.width=i.width,a.height=i.height),r.setSelectionLayout(a),r.eventsOn(a,r.imgEvents),r.eventsOn(r,this.canvasEvents),r.fabric.add(a),r.rotateObject(a,i.rotate),t.fabobj=a,a.shape=t,t.inFreeze=this.inFreeze,t.setVisible=da,t.setDirty=ma,t.setFilter=ga,t.setCustomHighlight=va,t.getIdtick=pa,i.id||(i.id=t.getIdtick()),a.set(i),e.visibleFilter&&t.setVisible(e.visibleFilter(e,t)),Gt(t),a.drawObject=ba,a.on("modified",wa),t.updateTextBox=function(e,t){this.html=e,this.rtxt=t,delete this.bigfontsize,Gt(this),this.setDirty()},t.getHighlight=function(){return this.showhighlight?m()(this.highlighttxts):[]},t.addHighlight=function(e,t){var i={start:e,end:t};this.highlighttxts.find((function(i){if(i.start===e&&i.end===t)return i}))||(i.color=this.hstyle.color,this.highlighttxts.push(i),this.setDirty())},t.removeHighlight=function(e,t){if(this.highlighttxts){var i=this.highlighttxts.findIndex((function(i){return i.start===e&&i.end===t}));-1!==i&&(this.highlighttxts.splice(i,1),this.setDirty())}},t.setHighlight=function(e,t){this.showhighlight=e,this.highlighttxts||(this.highlighttxts=[]),t&&(this.hstyle=t),this.setDirty()},t.setBackgroundColor=function(e){this.bgColor=e,this.setDirty()},t.setActiveEffect=function(e){this.isactiveeffect=e,this.setDirty()},t.hideText=function(e){this.ishideText=e,this.setDirty()},r.fabric.renderAll(),r.saveCanvasData(e.data),null===(n=this.inFreeze)||void 0===n||n.loadFreezeImage()}},{key:"setImage",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"content/img/updating.gif",r=e.canvas,a=this;$r.fabric.Image.fromURL(n,(function(n){var o;if(t&&(t.fabobj=n,t.inFreeze=a.inFreeze,t.setVisible=da,t.setDirty=ma,t.setFilter=ga,t.setCustomHighlight=va,t.getIdtick=pa),i.id||(i.id=t.getIdtick()),i.id.includes("loading"))return n.set(i),r.fabric.add(n),t&&e.visibleFilter&&t.setVisible(e.visibleFilter(e,t)),r.fabric.requestRenderAll(),void(null===(o=a.inFreeze)||void 0===o||o.loadFreezeImage());try{var s,l=r.findObjByData(i.id,e.data);if(!l)return;var c=r.findObjInCanvas(r.fabric,i.id);c&&r.fabric.remove(c),i.width?(i.fromOutside&&(delete i.width,delete i.height),n.set(i)):(n.scaleToWidth(i.scaleToWidth),n.scaleToHeight(i.scaleToHeight),n.set(i),l.fromOutside=!0,l.scaleX=n.scaleX,l.scaleY=n.scaleY),"Chart"===i.imgType&&n.setControlsVisibility({mtr:!1}),r.setSelectionLayout(n),r.eventsOn(n,r.imgEvents),r.eventsOn(r,a.canvasEvents),r.fabric.add(n),t&&e.visibleFilter&&t.setVisible(e.visibleFilter(e,t)),r.rotateObject(n,i.rotate),r.fabric.renderAll(),r.saveCanvasData(e.data),null===(s=a.inFreeze)||void 0===s||s.loadFreezeImage()}catch(e){console.error(e),le(e)}finally{r.removeLoading(e)}}))}},{key:"setLoading",value:function(e,t){var i=this.tOffset,n=e.data,r=n.displayRight2Left,a=n.cols,o=r?e.data.viewWidth()-a.indexWidth:0,s=r?o-t.left:t.left;t.top+=i.top,t.left=s+i.left,t.id="loading"+(new Date).getTime(),t.selectable=!1,this.setImage(e,null,t),this.loadingStack||(this.loadingStack=[]),this.loadingStack.push(t.id)}},{key:"removeLoading",value:function(e){var t=e.canvas;if(this.loadingStack){var i=this.loadingStack.shift();t.fabric.remove(t.fabric.getObjects()[t.fabric.getObjects().findIndex((function(e){return e.id===i}))]),t.saveCanvasData(e.data,t.fabric),t.inFreeze&&(t.inFreeze.removeImage(i),t.inFreeze.saveCanvasData(),t.inFreeze.renderAll(),t.fabric.renderAll())}}},{key:"rotateObject",value:function(e,t){e&&(e._setOriginToCenter(),e.set("angle",t).setCoords(),e._resetOrigin())}},{key:"doInsertURLImage",value:function(e,t){this.doInsertImage(e,t,!0)}},{key:"doInsertImage",value:function(e,t){var i,n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=t.data.getSelectedRect(),o=this.tOffset,s=t.data,l=s.displayRight2Left,c=s.cols,h=l?t.data.viewWidth()-c.indexWidth:0,u=l?h-a.left/t.table.zoomlevel-e.width:a.left/t.table.zoomlevel,f=e.url,d={angle:0,col:this.data.selector.ci,height:e.height,id:e.id,left:a.left/t.table.zoomlevel,originAngle:0,originHeight:e.height,originLeft:a.left,originTop:a.top,originWidth:e.width,row:this.data.selector.ri,scaleX:1,scaleY:1,src:f,strid:e.strid,tick:e.tick,top:a.top/t.table.zoomlevel,type:e.type,width:e.width,zorder:null!==(i=t.data.topOrder)&&void 0!==i?i:0};this.findObjByData(d.id,t.data)||(t.data.images||(t.data.images=[]),t.data.images.push(d)),r?this.setImage(t,d,{id:ua(d.id,d.tick),tick:d.tick,scaleToWidth:e.width,scaleToHeight:e.height,top:d.top+o.top/t.table.zoomlevel,left:u+o.left/t.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src):this.setImage(t,d,{id:ua(d.id,d.tick),tick:d.tick,scaleToWidth:d.width,scaleToHeight:d.height,top:d.top+o.top/t.table.zoomlevel,left:u+o.left/t.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:d.type,strid:d.strid,"z-index":this.basicZorder+d.zorder,zorder:d.zorder},d.src),this.fabric.renderAll(),this.saveCanvasData(t.data),null===(n=this.inFreeze)||void 0===n||n.loadFreezeImage()}},{key:"isImageOnSelected",value:function(){return!!this.fabric.getActiveObject()}},{key:"setHyperlink",value:function(e){var t=this.getActiveObjInData(this.data);t&&(t.hyperlink=e)}},{key:"getActiveObjInData",value:function(e){var t=this.fabric.getActiveObject();if(t)return this.findObjByData(t.id,e)}},{key:"link",value:function(e){var t,i=this.getActiveObjInData(e);i&&this.sheet.modalLink.setValue(xs.datas.map((function(e){return e.name})),null!==(t=i.hyperlink)&&void 0!==t?t:{})}},{key:"removeLink",value:function(e){var t=this.getActiveObjInData(e);t&&(t.hyperlink=null)}},{key:"openLink",value:function(e){var t=this.getActiveObjInData(e);t&&(this.fabric._discardActiveObject(),this.fabric.renderAll(),this.sheet.hyperlink.access(t.hyperlink))}},{key:"sendImageToFont",value:function(e,t){e&&t&&e.bringToFront(t)}},{key:"doOperation",value:function(e){Object.keys(this.imageOperationList).includes(e)&&!window.mobileAndTabletCheck()&&this.imageOperationList[e].execute(this.sheet)}},{key:"removeImageInData",value:function(e,t){if(!t.includes("_")&&t.split("_").length-1!=2)throw new Error("not correct id");var i=t.split("_"),n=r()(i,3),a=n[0],o=n[1],s=n[2],l="s"===a?e.shapes:e.images;null==l||l.splice(l.findIndex((function(e){return e.id===o&&e.tick===s})),1)}},{key:"checkHyperlink",value:function(e){var t=e.getActiveObject();if(t)return!!this.findObjByData(t.id,this.data).hyperlink}},{key:"validType",value:function(e,t,i){var n=e.getActiveObject();if(n)return this.findObjByData(n.id,this.data)[t]===i}},{key:"setOrder",value:function(e){null==e||e.getObjects().sort((function(e,t){return e.zorder<t.zorder?-1:1})).forEach((function(t){e.bringToFront(t)}))}}]),i}(u);function ka(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ca=function(e){ee()(i,e);var t=ka(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("100%",U("contextmenu.insertURL")),{required:!0},"",100);return(e=t.call(this,">",[f("div","".concat(ae,"-form-fields")).children(n.el),f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})))])).url=n,e.values=[],e.change=function(){},e}return o()(i,[{key:"btnClick",value:function(e){"ok"===e?this.url.validate()&&this.checkIsImage(this.url.val(),this.validateImage,5e3):this.hide()}},{key:"validateImage",value:function(e,t){"success"===t?(this.change("ok",e),this.hide()):this.url.validateFail(U("validation.downloadImageFail"))}},{key:"show",value:function(){Ii()(re()(i.prototype),"show",this).call(this),this.url.input.focus()}},{key:"hide",value:function(){this.url.val(""),this.url.validateClear(),Ii()(re()(i.prototype),"hide",this).call(this)}},{key:"checkIsImage",value:function(e,t,i){var n,r=!1,a=this,o=new Image;o.onerror=o.onabort=function(){r||(clearTimeout(n),t.call(a,e,"error"))},o.onload=function(){r||(clearTimeout(n),t.call(a,e,"success"))},o.src=e,n=setTimeout((function(){r=!0,o.src="//!!!!/test.jpg",t.call(a,e,"timeout")}),i)}}]),i}(Rr);function Sa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}function _a(e){e.dd&&(e.dd.title.removeClass("arrow-left"),2===e.dd.headerEl.children().length&&e.dd.headerEl.removeChild(e.dd.headerEl.children()[1]))}function Ta(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=" "+U("menubar.".concat(e.tag.replace(/-[a-z]/g,(function(e){return e[1].toUpperCase()}))));e.dd?e.dd.headerEl.child(i,t):e.el.child(i)}function Oa(e){var t=f("div","".concat(ae,"-item")).child(e.el);return e.dd&&(e.dd.contentEl.addClass("".concat(ae,"-menubar-dropdown-content")),t=f("div","".concat(ae,"-menubar-btn")).child(e.dd.el)),t}function Ea(e,t){e.el.addEventListener("click",(function(i){t.dd?t.dd.menuDiv=e:(t.click?t.click():t.change(t.tag),i.stopPropagation())}),!0),e.el.addEventListener("mouseenter",(function(e){e.stopPropagation()}),!0)}var Ra=function(e){ee()(i,e);var t=Sa(i);function i(e,n){var r;l()(this,i);for(var a,o=[],s=["format","font-name","font-size"],c=0;c<n.length;c++){(a=n[c]).tip="",a.el.attr("style","margin:0"),a.el.attr("class",""),_a(n[c]);var h=s.includes(n[c].tag);Ta(n[c],h);var u=Oa(n[c]);Ea(u,n[c]),o.push(u)}return(r=t.call.apply(t,[this,e,"max-content",!1,"bottom-left"].concat(o))).headerEl.on("mouseenter",(function(e){if(!window.mobileAndTabletCheck()){var t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e.target.dispatchEvent(t)}})),r}return i}(Mi);function Ia(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Aa=function(e){ee()(i,e);var t=Ia(i);function i(e,n){return l()(this,i),t.call(this,e,null,"",n)}return o()(i,[{key:"dropdown",value:function(){return new Ra(this.tag,this.value)}}]),i}(Pi);function Da(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Pa=function(e){ee()(i,e);var t=Da(i);function i(e){var n;l()(this,i);var r="download";return null!=e&&e&&(r+="_".concat(e)),n=t.call(this,r),"GOOGLE"===e||"DROPBOX"===e?n.setIcon("savetocloud"):n.setIcon("download"),n}return i}(bn);function Fa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ma=function(e){ee()(i,e);var t=Fa(i);function i(){return l()(this,i),t.call(this,"link")}return i}(bn);function La(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ja=function(e){ee()(i,e);var t=La(i);function i(){return l()(this,i),t.call(this,"insertColumn")}return i}(bn);function za(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ba=function(e){ee()(i,e);var t=za(i);function i(){return l()(this,i),t.call(this,"insertRow")}return i}(bn);function Ha(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Na=function(e){ee()(i,e);var t=Ha(i);function i(){return l()(this,i),t.call(this,"insertSheet")}return i}(bn);var Ua=function(){function e(t,i,n,r,a){var o=this;l()(this,e),this.data=t;var s=t.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.dropdowns=[];var c=U("menubar.menuEdit"),h=U("menubar.menuComment"),u=U("menubar.menuInsert"),d=U("menubar.menuText"),m=U("menubar.menuFile");this.items={},this.items[m]=[new tr,new Pa("Original"),new Pa("XLSX"),new Pa("PDF"),new Pa("HTML")],"ru"!==a&&"zh"!==a&&(this.items[m].push(new Pa("GOOGLE")),this.items[m].push(new Pa("DROPBOX"))),this.items[c]=[this.borderEl=new pn,this.mergeEl=new Qn,this.freezeEl=new Jn,this.autofilterEl=new Wi,this.sortEl=new lr,this.searchEl=new hr,this.paintformatEl=new Cn,this.clearformatEl=new xn,this.fillColorEl=new On(s.bgcolor)],this.items[u]=[this.insertColumn=new ja,this.insertRow=new Ba,this.insertSheet=new Na,this.insertImageEL=new kr,this.formulaEl=new Zn,this.insertLink=new Ma,this.insetCommentEl=new fr],this.insetCommentEl.tag="insertComment",this.items[d]=[this.fontEl=new Bn,this.fontSizeEl=new An,this.boldEl=new Vi,this.italicEl=new Zi,this.underlineEl=new Qi,this.strikeEl=new Ji,this.alignEl=new Bi(s.align),this.valignEl=new Ni(s.valign),this.textwrapEl=new nr,this.textColorEl=new _n(s.color)],this.items[h]=[this.commentEditEl=new fr,this.commentRemoveEl=new mr,this.commentPreviousEl=new vr,this.commentNextEl=new yr];for(var g=0;g<this.insertImageEL.dd.contentEl.children().length;g++)this.insertImageEL.dd.contentEl.children()[g].style="width:max-content";this.el=f("div","".concat(ae,"-toolbar ").concat(ae,"-menubar")),n?this.el.hide():(this.el.css("text-transform","capitalize"),Object.keys(this.items).forEach((function(e){var t=new Aa(e,o.items[e]);o.dropdowns.push(t),o.el.child(t.el),o.items[e].map((function(e){e.change=function(){o.change.apply(o,arguments)}}))})))}return o()(e,[{key:"hideDropdown",value:function(){this.dropdowns.forEach((function(e){return e.dd.hide()}))}}]),e}(),Xa=function(){function e(){l()(this,e),xe()(this,"setActiveSheetBySheetName",(function(){})),xe()(this,"setActiveCell",(function(){})),xe()(this,"linkPositions",[])}return o()(e,[{key:"checkAndAccess",value:function(e,t,i){var n=this.find(e,t,i);return n?this.access(n):null}},{key:"loadLinkPosition",value:function(e){var t=this,i=e.data;this.linkPositions=[];e.getTableOffset();i.hyperlinks.forEach((function(e){var n={},r=k.valueOf(e.area),a=i.scroll.ci,o=i.scroll.ri;a=a>0&&r.sci<a?0:a,o=o>0&&r.sri<o?0:o,n.x=[i.cols.sumWidth(a,r.sci+1)-i.cols.getWidth(r.sci),i.cols.sumWidth(a,r.eci+1)],n.y=[i.rows.sumHeight(o,r.sri+1)-i.rows.getHeight(r.eri),i.rows.sumHeight(o,r.eri+1)],i.canvasFreeze&&(i.scroll.ri>0||i.scroll.ci>0)||t.linkPositions.push(n)}))}},{key:"find",value:function(e,t,i){var n=e.hyperlinks;if(0!==n.length)return n.find((function(e){return e.area?k.valueOf(e.area).includes(t,i):null}))}},{key:"findByArea",value:function(e,t){var i=e.hyperlinks;if(0!==i.length)return i.find((function(e){return e.area?k.valueOf(e.area).contains(k.valueOf(t)):null}))}},{key:"check",value:function(e,t,i){return!!this.find(e,t,i)}},{key:"remove",value:function(e,t){var i=t.hyperlinks.findIndex((function(t){return t.area===e.area}));t.hyperlinks.splice(i,1)}},{key:"removeByRange",value:function(e,t){var i=this.findByRange(e,t.data);this.remove(i,t.data),this.setHyperlinkStyleByArea(i.area,t,!1)}},{key:"findByRange",value:function(e,t){var i=this.getSelectArea(e);return this.findByArea(t,i)}},{key:"getSelectArea",value:function(e){var t=b(e.sci,e.sri),i=b(e.eci,e.eri);return"".concat(t,":").concat(i)}},{key:"setHyperlinkStyleByArea",value:function(e,t,i){for(var n=k.valueOf(e),r=n.sri;r<=n.eri;r++)for(var a=n.sci;a<=n.eci;a++)t.data.setHyperlinkStyle(r,a,i);t.table.render()}},{key:"accessByRange",value:function(e,t){var i=this.getSelectArea(e),n=this.findByArea(t,i);this.access(n)}},{key:"access",value:function(e){if("number"==typeof e.type&&e.address){switch(e.type){case 0:case 2:window.open(e.address,"_blank");break;case 1:break;case 3:if(!e.address.includes("!"))break;var t=e.address.split("!"),i=r()(t,2),n=i[0],a=i[1];n.startsWith("'")&&n.endsWith("'")&&(n=n.substr(1,n.length-2)),this.setActiveSheetBySheetName(n);var o=y(a),s=r()(o,2),l=s[0],c=s[1],h=this;setTimeout((function(){h.setActiveCell(c,l)}),1e3)}return null}}}]),e}();function qa(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return Wa(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Wa(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Wa(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ya=function(){function e(t){l()(this,e),this.sheet=t}return o()(e,[{key:"setCustomHighlightImgFunc",value:function(e){this.highlightImgFunc=e}},{key:"showHighlights",value:function(e){var t=this.sheet.data;t.showhighlight=!0,t.highlightstyle=e,this.AutoShowOrHide()}},{key:"AutoShowOrHide",value:function(){var e=this.sheet,t=e.data,i=e.canvas;if(t.highlightall){var n=i.fabric;this.highlightAllImg(t.showhighlight,n)}else this.showHighlightImageShapesAuto(t.showhighlight)}},{key:"hideHighlights",value:function(){var e=this.sheet,t=e.data,i=e.table;t.showhighlight=!1,this.AutoShowOrHide(),i.render()}},{key:"getHighlightTexts",value:function(){return this.sheet.data.highlighttxts}},{key:"addHighlightText",value:function(e,t,i,n){var r=this.sheet.data,a={row:e,col:t,start:i,end:n};r.highlighttxts.find((function(r){if(r.row===e&&r.col===t&&r.start===i&&r.end===n)return r}))||r.highlighttxts.push(a)}},{key:"removeHighlightText",value:function(e,t,i,n){for(var r=this.sheet.data,a=0;a<r.highlighttxts.length;a++){var o=Number.isInteger(i)?i:r.highlighttxts[a].start,s=Number.isInteger(n)?n:r.highlighttxts[a].end;r.highlighttxts[a].row===e&&r.highlighttxts[a].col===t&&r.highlighttxts[a].start===o&&r.highlighttxts[a].end===s&&r.highlighttxts.splice(a,1)}}},{key:"getHighlightRanges",value:function(){return this.sheet.data.highlightrg}},{key:"addHighlightRange",value:function(e,t,i,n){for(var r=this.sheet.data,a=new k(e,t,i,n),o=0;o<r.highlightrg.length;o++)if(r.highlightrg[o].contains(a))return;r.highlightrg.push(a)}},{key:"removeHighlightRange",value:function(e,t,i,n){for(var r=this.sheet.data,a=new k(e,t,i,n),o=0;o<r.highlightrg.length;o++)r.highlightrg[o].equals(a)&&r.highlightrg.splice(o,1)}},{key:"setHighlightInverseRange",value:function(e,t,i,n){this.sheet.data.highlightIR=new k(e,t,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.sheet.data.highlightIR}},{key:"removeHighlightInverseRange",value:function(){delete this.sheet.data.highlightIR}},{key:"getCanvasImgByid",value:function(e,t){return e.getObjects().find((function(e){return e.id===t}))}},{key:"highlightAllImg",value:function(e,t){var i=this.sheet,n=i.data,r=(i.canvas,n.shapes),a=n.images;if(r){var o,s=qa(r);try{for(s.s();!(o=s.n()).done;){var l=o.value;this.highlightImg(e,l,n.highlightstyle)}}catch(e){s.e(e)}finally{s.f()}}if(a){var c,h=qa(a);try{for(h.s();!(c=h.n()).done;){var u=c.value;this.highlightImg(e,u,n.highlightstyle)}}catch(e){h.e(e)}finally{h.f()}}t.requestRenderAll()}},{key:"showHighlightImageShapesAuto",value:function(e){var t,i=this,n=this.sheet,r=n.data,a=n.canvas.fabric,o=qa(r.highlighshapes);try{var s=function(){var n=t.value,a=r.shapes.find((function(e){return e.id===n}));a&&i.highlightImg(e,a,r.highlightstyle)};for(o.s();!(t=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}var l,c=qa(r.highlighimgs);try{var h=function(){var t=l.value,n=r.images.find((function(e){return e.id===t}));n&&i.highlightImg(e,n,r.highlightstyle)};for(c.s();!(l=c.n()).done;)h()}catch(e){c.e(e)}finally{c.f()}a.requestRenderAll()}},{key:"highlightImg",value:function(e,t,i){var n=this.sheet;n.data,n.canvas;if(t)if("TextBox"!==t.type)if(this.highlightImgFunc)t.setCustomHighlight(e,this.highlightImgFunc);else{var r=!!e&&new fabric.Image.filters.Invert;t.setFilter(r)}else t.setHighlight(e,i)}},{key:"getHighlightShaps",value:function(){return this.sheet.data.highlighshapes}},{key:"addHighlightShape",value:function(e){var t=this.sheet,i=t.data,n=t.canvas;if(-1===i.highlighshapes.indexOf(e)){var r=i.shapes.find((function(t){return t.id===e}));if(r){var a=n.fabric;i.highlighshapes.push(e),this.highlightImg(i.showhighlight,r,i.highlightstyle),i.showhighlight&&a.requestRenderAll()}}}},{key:"removeHighlightShape",value:function(e){var t=this.sheet,i=t.data,n=t.canvas.fabric,r=i.highlighshapes.indexOf(e);if(r>-1){i.highlighshapes.splice(r,1);var a=i.shapes.find((function(t){return t.id===e}));a&&(this.highlightImg(!1,a),n.requestRenderAll())}}},{key:"getHighlightImages",value:function(){return this.sheet.data.highlighimgs}},{key:"addHighlightImage",value:function(e){var t=this.sheet,i=t.data,n=t.canvas;if(-1===i.highlighimgs.indexOf(e)){var r=i.images.find((function(t){return t.id===e}));if(r){var a=n.fabric;i.highlighimgs.push(e),i.showhighlight&&(this.highlightImg(!0,r),a.requestRenderAll())}}}},{key:"removeHighlightImage",value:function(e){var t=this.sheet,i=t.data,n=t.canvas.fabric,r=i.highlighimgs.indexOf(e);if(r>-1){i.highlighimgs.splice(r,1);var a=i.images.find((function(t){return t.id===e}));a&&(this.highlightImg(!1,a),n.requestRenderAll())}}},{key:"setHighlightAll",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.sheet,n=i.data,r=i.canvas,a=i.table;if(n.showhighlight){var o=r.fabric;n.highlightall=e,this.highlightAllImg(e,o),e||this.showHighlightImageShapesAuto(!0)}t&&a.render()}}]),e}();function Va(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ga=function(e){ee()(i,e);var t=Va(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("400px",""),{required:!0},"".concat(U("download.fileName"),":"),100),r=new Mr(new Pr("Original",["Original","XLSX","PDF","HTML"],"100%",(function(e){return U("download.saveTypes.".concat(e))}),(function(t){var i=e.fileNameField.val();e.fileNameField.val(e.setSuffix(i,t)),e.fileNameField.validate()})),{required:!0},"".concat(U("download.saveType"),":"),100);return e=t.call(this,U("contextmenu.download"),[f("div","".concat(ae,"-form-fields")).children(n.el),f("div","".concat(ae,"-form-fields")).children(r.el),f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})),new vi("cancel").on("click",(function(){return e.btnClick("cancel")})))]),xe()(Wn()(e),"defaultSuffix","xlsx"),e.fileNameField=n,e.saveTypeField=r,e.ci=null,e.values=[],e.change=function(){},e}return o()(i,[{key:"setSuffix",value:function(e,t){var i;return"Original"===t&&(t=this.originalType),e=(e=""===(null!==(i=e)&&void 0!==i?i:"")?this.originalFileName:e).includes(".")?e:e+"."+this.defaultSuffix,"".concat(e.substr(0,e.lastIndexOf(".")),".").concat(t.toLowerCase())}},{key:"btnClick",value:function(e){if("ok"===e){if(!this.fileNameField.validate())return;var t=this.saveTypeField.val(),i=this.fileNameField.val();i=this.setSuffix(i,t),this.change("ok",i,t)}this.hide()}},{key:"setValue",value:function(e){this.originalFileName=""===(null!=e?e:"")?"worksheet.xlsx":e,this.originalType=e.split(".").length>=2?e.substr(e.lastIndexOf(".")+1):this.defaultSuffix,this.fileNameField.val(this.originalFileName),this.show()}}]),i}(Rr);function Za(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ka=function(e){ee()(i,e);var t=Za(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.emailAddress"),":"),100),r=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.emailSubject"),":"),100),a=f("div","".concat(ae,"-form-fields")).children(f("div","".concat(ae,"-form-fields")).children(n.el),f("div","".concat(ae,"-form-fields")).children(r.el));a.hide();var o=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.sheetCell"),":"),100),s=new Mr(new Pr("",[""],"max-content",(function(e){return e}),(function(e){})),{required:!0},"".concat(U("link.sheetPage"),":"),100);s.input.el.css("width","max-content");var c=f("div","".concat(ae,"-form-fields")).children(f("div","".concat(ae,"-form-fields")).children(o.el),f("div","".concat(ae,"-form-fields")).children(s.el));c.hide();var h=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.webUrl"),":"),100),u=f("div","".concat(ae,"-form-fields")).children(h.el);u.hide();var d=new Mr(new Pr("web",["web","sheet","email"],"max-content",(function(e){return U("link.linkTypes.".concat(e))}),(function(t){switch(u.hide(),c.hide(),a.hide(),t){case"web":u.show(),e.active="web";break;case"sheet":c.show(),e.active="sheet";break;case"email":a.show(),e.active="email"}})),{required:!0},"".concat(U("link.linkType"),":"),100);return e=t.call(this,U("contextmenu.link"),[f("div","".concat(ae,"-form-fields")).children(d.el),f("div","".concat(ae,"-form-fields")).children(a.el,u.el,c.el),f("br"),f("br"),f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})),new vi("cancel").on("click",(function(){return e.btnClick("cancel")})))]),xe()(Wn()(e),"active",void 0),e.ci=null,e.values=[],e.sheetPageField=s,e.sheetField=c,e.webField=u,e.emailField=a,e.sheetCellField=o,e.webUrlField=h,e.emailAddressField=n,e.emailSubjectField=r,e.linkTypeField=d,e.change=function(){},e.el.on("click",(function(e){e.preventDefault()})),e}return o()(i,[{key:"btnClick",value:function(e){var t=this.link,i=this.type;if("ok"===e){switch(this.active){case"web":if(!this.webUrlField.validate())return;if(!this.isValidHttpUrl(this.webUrlField.val()))return void this.webUrlField.validateFail("Missing address network protocols such as http:// or https://");t.type=0,t.address=this.webUrlField.val();break;case"sheet":if(!this.sheetCellField.validate())return;t.type=3,t.address="".concat(this.sheetPageField.val(),"!").concat(this.sheetCellField.val());break;case"email":t.type=2,t.address="mailto:".concat(this.emailAddressField.val(),"?subject=").concat(this.emailSubjectField.val())}this.change("ok",t,i)}this.hide()}},{key:"clear",value:function(){this.sheetField.hide(),this.sheetPageField.val(this.sheets[0]),this.sheetCellField.val("A1"),this.webField.hide(),this.webUrlField.val(""),this.webUrlField.validateClear(),this.emailField.hide(),this.emailSubjectField.val(""),this.emailAddressField.val("")}},{key:"isValidHttpUrl",value:function(e){var t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}},{key:"setValue",value:function(e,t,i){var n;if(this.type=i,this.sheets=e,this.link=t,this.clear(),this.sheetPageField.input.suggest.setItems(e.map((function(e){return{key:e,title:e}}))),""!==(null!==(n=null==t?void 0:t.type)&&void 0!==n?n:""))switch(t.type){case 1:case 0:this.webUrlField.input.val(t.address),this.linkTypeField.val("web"),this.webField.show(),this.active="web";break;case 2:var r=/mailto:([^\?]*)\?subject\=(.*)/.exec(t.address);this.emailSubjectField.val(r[2]),this.emailAddressField.val(r[1]),this.linkTypeField.val("email"),this.emailField.show(),this.active="email";break;case 3:var a=t.address.split("!");if(2!==a.length)break;this.sheetPageField.val(a[0]),this.sheetCellField.val(a[1]),this.linkTypeField.val("sheet"),this.sheetField.show(),this.active="sheet"}else this.linkTypeField.val("web"),this.webField.show(),this.active="web";this.show()}}]),i}(Rr),Ja=function(){function e(t){l()(this,e),this.el=f("div","".concat(ae,t?"-banner-icon-s":"-banner-icon"))}return o()(e,[{key:"setHomeIcon",value:function(e,t){this.el.css({"background-image":"url(".concat(e,")"),"background-size":"contain","background-position":"center"});var i=f("a");i.attr("href",t),i.css({display:"block",height:"100%",width:"100%","text-decoration":"none"}),this.el.child(i)}}]),e}(),$a=function(){function e(t){var i=this;l()(this,e),this.el=f("div","".concat(ae,"-banner-filename")),this.filename=f("div","".concat(ae,"-banner-filename-name")),this.filename.on("blur",(function(e){e.target.innerHTML=e.target.innerHTML.replace(/<[^>]+>/gi,"");var n=e.target.innerText;n=n.replace(/\r?\n|\r/g,""),t.filename=n+i.suffixStr,setTimeout((function(){t.selector.el.show()}),100)})),this.filename.on("focus",(function(e){window.mobileEditOnCell=!1,t.editor.el.hide()})),this.filename.on("keyup",(function(e){13===e.keyCode&&i.filename.el.blur()})),this.filename.attr("contenteditable",!0),this.filename.attr("spellcheck",!1),this.suffix=f("div"),this.el.children(this.filename,this.suffix)}return o()(e,[{key:"setValue",value:function(e){if(e.includes(".")){var t=e.substring(0,e.lastIndexOf(".")),i=this.suffixStr=e.substring(e.lastIndexOf("."));this.filename.html(t),this.suffix.html(i)}}}]),e}(),Qa=function(){function e(t,i,n,r,a,o,s){var c=this;l()(this,e),this.data=t;t.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.icon=new Ja(!a),this.filenamebar=new $a(o),this.menubar=new Ua(t,i,n,r,s),this.el=f("div");var h=f("div","".concat(ae,"-banner"));n&&!r?(this.el.hide(),this.notShow=!0):(h.children(this.icon.el,f("div","".concat(ae,a?"-banner-info":"-banner-info-s")).children(this.filenamebar.el,this.menubar.el)),this.el.child(h)),a||this.filenamebar.el.hide(),this.menubar.change=function(){c.change.apply(c,arguments)}}return o()(e,[{key:"show",value:function(){this.notShow||this.el.show()}},{key:"hide",value:function(){this.el.hide()}},{key:"hideDropdown",value:function(){this.menubar.hideDropdown()}},{key:"setFileName",value:function(e){this.filenamebar.setValue(e)}}]),e}();function eo(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function to(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(i),!0).forEach((function(t){xe()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):eo(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function io(e,t){var i,n=this;return function(){for(var r=n,a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var l=o;i||(i=setTimeout((function(){i=null,e.apply(r,l)}),t))}}function no(){var e=this.data,t=this.verticalScrollbar,i=this.horizontalScrollbar,n=e.getSelectedRect(),r=n.l,a=n.t,o=n.left,s=n.top,l=n.width,c=n.height,h=this.getTableOffset();if(Math.abs(o)+l>h.width)i.move({left:r+l-h.width});else{var u=e.freezeTotalWidth();o<u&&i.move({left:r-1-u})}if(Math.abs(s)+c>h.height)t.move({top:a+c-h.height-1});else{var f=e.freezeTotalHeight();s<f&&t.move({top:a-1-f})}}function ro(){var e=this.data,t=this.verticalScrollbar,i=this.horizontalScrollbar,n=e.getSelectedRectBySearch(),r=n.l,a=n.t;i.move({left:r-1}),t.move({top:a-1})}function ao(e,t,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==t||-1!==i){var a=this.table,o=this.selector,s=this.toolbar,l=this.formulaBar,c=this.data,h=this.contextMenu;if(h.setMode(-1===t||-1===i?"row-col":"range"),c.canSelected(t,i)){var u=c.getCell(t,i);e?(o.setEnd(t,i,r),this.trigger("cells-selected",u,o.range)):(o.set(t,i,n),this.trigger("cell-selected",u,t,i)),this.focusing=!0,o.setObjId(null),s.reset(),l.reset(),a.render()}}}function oo(e,t){var i=this.selector,n=this.data,a=n.rows,o=n.cols,s=r()(i.indexes,2),l=s[0],c=s[1],h=i.range,u=h.eri,f=h.eci;if(e){var d=r()(i.moveIndexes,2);l=d[0],c=d[1]}"left"===t?c>0&&(c-=1):"right"===t?(f!==c&&(c=f),c<o.len-1&&(c+=1)):"up"===t?l>0&&(l-=1):"down"===t?(u!==l&&(l=u),l<a.len-1&&(l+=1)):"row-first"===t?c=0:"row-last"===t?c=o.len-1:"col-first"===t?l=0:"col-last"===t&&(l=a.len-1),e&&(i.moveIndexes=[l,c]),ao.call(this,e,l,c),no.call(this)}function so(e){if(0===e.buttons&&e.target.className!=="".concat(ae,"-resizer-hover")){var t=e.offsetX,i=e.offsetY,n=this.rowResizer,r=this.colResizer,a=this.tableEl,o=this.data,s=o.rows,l=o.cols,c=o.displayRight2Left,h=o.settings.row.height;if(t>l.indexWidth&&i>h)return n.hide(),void r.hide();var u=a.box(),f=o.getCellRectByXY(e.offsetX/o.zoomlevel,e.offsetY/o.zoomlevel);f.ri>=0&&-1===f.ci?(f.width=l.indexWidth*o.zoomlevel,n.show(f,{width:u.width}),s.isHide(f.ri-1)?n.showUnhide(f.ri):n.hideUnhide()):n.hide(),-1===f.ri&&f.ci>=0?(f.height=h*o.zoomlevel,f.top=0,r.show(f,{height:u.height},c),l.isHide(f.ci-1)?r.showUnhide(f.ci):r.hideUnhide()):r.hide()}}function lo(e){var t=this.verticalScrollbar,i=this.horizontalScrollbar,n=this.data,r=t.scroll().top,a=i.scroll().left,o=n.rows,s=n.cols,l=e.deltaY,c=e.deltaX,h=function(e,t){var i=e,n=0;do{n=t(i),i+=1}while(n<=0);return n},u=function(e){if(e>0){var i=n.scroll.ri+1;if(i<o.len){var a=h(i,(function(e){return o.getHeight(e)}));t.move({top:r+a-1})}}else{var s=n.scroll.ri-1;if(s>=0){var l=h(s,(function(e){return o.getHeight(e)}));t.move({top:0===s?0:r-l})}}},f=Math.abs(l),d=Math.abs(c),m=Math.max(f,d);/Firefox/i.test(window.navigator.userAgent)&&io(u(e.detail),50),m===d&&io(function(e){if(e>0){var t=n.scroll.ci+1;if(t<s.len){var r=h(t,(function(e){return s.getWidth(e)}));i.move({left:a+r-1})}}else{var o=n.scroll.ci-1;if(o>=0){var l=h(o,(function(e){return s.getWidth(e)}));i.move({left:0===o?0:a-l})}}}(c),50),m===f&&io(u(l),50)}function co(){var e=this.data,t=this.verticalScrollbar,i=(1!==e.zoomlevel?this.originTableOffset:this.getTableOffset()).height,n=e.exceptRowTotalHeight(0,-1);t.set(i,(e.rows.totalHeight()-n)*e.zoomlevel)}function ho(){var e=this.data,t=this.horizontalScrollbar,i=(1!==e.zoomlevel?this.originTableOffset:this.getTableOffset()).width;e&&t.set(i,e.cols.totalWidth()*e.zoomlevel),e.displayRight2Left?t.el.attr("dir","rtl"):t.el.removeAttr("dir")}function uo(){var e=this.selector,t=this.data,i=this.editor,n=this.canvas,a=r()(t.freeze,2),o=a[0],s=a[1];if(o>0||s>0){var l=t.freezeTotalWidth(),c=t.freezeTotalHeight();i.setFreezeLengths(l,c)}else i.setFreezeLengths(0,0);n.resetFreeze(t),e.resetAreaOffset()}function fo(){var e=this.tableEl,t=this.overlayerEl,i=this.overlayerCEl,n=this.table,r=this.toolbar,a=this.formulaBar,o=this.selector,s=this.hyperlink,l=this.el;this.originTableOffset||(this.originTableOffset=this.getTableOffset()),1!==this.data.zoomlevel&&(o.br.useHideInput=!1);var c=this.getTableOffset(),h=this.getRect();e.attr(h),t.offset(h);var u=this.data.zoomlevel;i.offset(to(to({},c),{},{width:c.width/u,height:c.height/u})),l.css("width","".concat(h.width,"px")),co.call(this),ho.call(this),uo.call(this),n.render(),r.reset(),a.reset(),o.reset(),s.loadLinkPosition(this),1!==this.data.zoomlevel&&(o.br.useHideInput=!0)}function mo(){var e=this.data,t=this.selector;e.clearClipboard(),t.hideClipboard()}function go(){var e=this.data,t=this.selector,i=this.canvas;e.copy(),t.showClipboard(),i.clipboard=null}function vo(){var e=this.data,t=this.selector;e.cut(),t.showClipboard()}function po(){return(po=be()(Ce.a.mark((function e(){var t,i;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.permissions.query({name:"clipboard-read"});case 3:return t=e.sent,i=t.state,e.abrupt("return","granted"===i);case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}function yo(e,t){var i=this.data,n=this;if("read"!==i.settings.mode&&!i.getLocked())if(i.paste(e,(function(e){return le("Tip",e)})))fo.call(this);else if(t){if(null==i.clipboard.range){var r=t.clipboardData.getData("text/plain");r.length>0&&(this.data.pasteFromText(r),fo.call(this))}}else(function(){return po.apply(this,arguments)})()&&navigator.permissions.query({name:"clipboard-read"}).then((function(e){!document.hasFocus()||"granted"!==e.state&&"prompt"!==e.state||navigator.clipboard.read().then((function(e){var t=e[0];t.types.includes("image/png")&&t.getType("image/png").then((function(e){var t=new File([e],Math.random(),{type:e.type});n.canvas.imageOperationList.paste.uploadImg(n,t)}))}))}))}function bo(){this.data.hideRowsOrCols(),fo.call(this)}function wo(e,t){this.data.unhideRowsOrCols(e,t),fo.call(this)}function xo(){this.data.autofilter(),fo.call(this)}function ko(){var e=document.createElement("div");e.id="aspose_mask_bg",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="#777",e.style.opacity=.6,e.style.zIndex=10001,document.body.appendChild(e);var t=document.createElement("div");t.style.position="absolute",t.style.top="33%",t.style.left="40%",t.style.backgroundColor="white",t.style.border="#336699 1px solid",t.style.textAlign="center",t.style.fontSize="medium",t.style.padding="1.5em 4em 1.5em 4em",t.innerText="updating , please wait...",e.appendChild(t)}function Co(){var e=document.getElementById("aspose_mask_bg");null!=e&&e.parentNode.removeChild(e)}function So(e,t){return _o.apply(this,arguments)}function _o(){return(_o=be()(Ce.a.mark((function e(t,i){var n,r,a,o,s,l;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.data,r={sheetname:n.name,actrow:n.selector.ri,actcol:n.selector.ci,datas:xs.getUpdateDatas()},a={p:JSON.stringify(r),uid:this.uniqueid,file:t,outputType:i},o=this.fileDownloadUrl,s=new FormData,Object.keys(a).forEach((function(e){return s.set(e,a[e])})),ko(),e.next=9,fetch(o,{method:"POST",body:s});case 9:if((l=e.sent).ok){e.next=15;break}Co(),alert("Download failed, please try again"),e.next=22;break;case 15:return e.t0=qo,e.next=18,l.json();case 18:e.t1=e.sent,e.t2=t,(0,e.t0)(e.t1,e.t2),Co();case 22:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function To(){var e=this.toolbar;e.paintformatActive()&&(yo.call(this,"format"),mo.call(this),e.paintformatToggle())}function Oo(){var e=this.editor,t=this.contextMenu,i=this.commentTip,n=this.commentEditable;e.clear(),t.hide(),i.hide(),n.saveAndHide(this)}function Eo(e){var t=this,i=this.selector,n=this.data,a=this.table,o=this.sortFilter,s=this.hyperlink,l=e.offsetX,c=e.offsetY,h=e.target.className==="".concat(ae,"-selector-corner"),u=a.zoomlevel,f=n.getCellRectByXY(l/u,c/u),d=f.left,m=f.top,g=f.width,v=f.height,p=n.viewHeight(),y=n.viewWidth(),b=f.ri,w=f.ci;if(!(b<-1||w<-1)){var x=n.autoFilter,k=n.TableAutoFilters;if(x.includes(b,w)&&d+g-20*u<l&&m+v-20*u<c){var C=x.items(w,(function(e,t){return n.rows.getCell(e,t)}));return o.set(w,C,x.getFilter(w),x.getSort(w)),o.setOffsetAdjustView({left:d,top:m+v+2},y,p),void(n.currentAutoFilter=x)}for(var S=0,_=k.length;S<_;S++){var T=k[S];if(T.includes(b,w)&&d+g-20*u<l&&m+v-20*u<c){var O=T.items(w,(function(e,t){return n.rows.getCell(e,t)}));return o.set(w,O,T.getFilter(w),T.getSort(w)),o.setOffsetAdjustView({left:d,top:m+v+2},y,p),void(n.currentAutoFilter=T)}}if(!e.shiftKey){if(h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else if(ao.call(this,!1,b,w),!e.ctrlKey&&2!==e.button){var E,R=null!==(E=s.checkAndAccess(n,b,w))&&void 0!==E?E:[w,b],I=r()(R,2);w=I[0],b=I[1]}window.mobileAndTabletCheck()||Ie(window,(function(e){var r=n.getCellRectByXY(e.offsetX/u,e.offsetY/u);if(b=r.ri,w=r.ci,h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else 1!==e.buttons||e.shiftKey||ao.call(t,!0,b,w,!0,!0)}),(function(){n.getLocked()||(h&&i.arange&&"read"!==n.settings.mode&&n.autofill(i.arange,"all",(function(e){return le("Tip",e)}))&&a.render(),i.hideAutofill(),To.call(t))}))}h||1!==e.buttons||e.shiftKey&&ao.call(this,!0,b,w)}}function Ro(){var e=this.data.getSelectedRect();Io.call(this,e)}function Io(e){var t=this.editor,i=this.getTableOffset(),n="top";e.top>i.height/2&&(n="bottom"),t.setOffset(e,n)}function Ao(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.table,i=this.editor,n=this.data;"read"!==n.settings.mode&&(n.getLocked()||(Ro.call(this),t.clearSelectRender(),i.setCell(n.getSelectedCell(),n.getSelectedValidator(),e),mo.call(this)))}function Do(e){this.table;var t=this.editor,i=this.data;if("read"!==i.settings.mode&&!i.getLocked()){var n=i.getRectForTextbox(e);Io.call(this,n),t.setForTextBox(e),mo.call(this)}}function Po(){var e=this.formulaBar,t=this.data;e.resetData(t)}function Fo(e){var t=this,i=this.data,n=this.table,r=this.selector,a=this.hyperlink;i.scrolly(e,(function(){1!==t.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRLAreaOffset(),Ro.call(t),n.render(),a.loadLinkPosition(t),i.scrollImagesShapes(),1!==t.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Mo(e){var t=this,i=this.data,n=this.table,r=this.selector,a=this.hyperlink;i.scrollx(e,(function(){1!==t.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRTAreaOffset(),Ro.call(t),n.render(),a.loadLinkPosition(t),i.scrollImagesShapes(),1!==t.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Lo(e,t){var i=e.ri,n=this.table,r=this.selector,a=this.data,o=this.hyperlink,s=a.rows.getHeight(i);a.rows.setHeight(i,t),a.updateRowsHeight.add(i),a.updateConditionImagePositionForRow(i,t-s,t),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),o.loadLinkPosition(this),co.call(this),Ro.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function jo(e,t){var i=e.ci,n=this.table,r=this.selector,a=this.data,o=this.hyperlink,s=a.cols.getWidth(i);a.cols.setWidth(i,t),a.updateCols.add(i),a.updateConditionImagePositionForCol(i,t-s,t),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),o.loadLinkPosition(this),ho.call(this),Ro.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function zo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"finished",i=this.data,n=this.table;if("read"!==i.settings.mode&&!i.getLocked()){i.setSelectedCellText(e,t);var r=i.selector,a=r.ri,o=r.ci;if("finished"===t){if("server"===i.settings.updateMode){var s=i.getCell(a,o);return void(s.lc&&(s.lc.text=s.text,s.lc.rtxt[0][0].txt=s.text,s.lc.setDirty()))}n.render()}else this.trigger("cell-edited",e,a,o)}}function Bo(e){var t=this.data;"insert-row"===e?t.insert("row"):"delete-row"===e?t.delete("row"):"insert-column"===e?t.insert("column"):"delete-column"===e?t.delete("column"):"delete-cell"===e?t.deleteCell():"delete-cell-format"===e?t.deleteCell("format"):"delete-cell-text"===e?t.deleteCell("text"):"cell-printable"===e?t.setSelectedCellAttr("printable",!0):"cell-non-printable"===e?t.setSelectedCellAttr("printable",!1):"cell-editable"===e?t.setSelectedCellAttr("editable",!0):"cell-non-editable"===e&&t.setSelectedCellAttr("editable",!1),mo.call(this),fo.call(this)}function Ho(e){for(var t=e,i=0,n=0;null!==t;)i+=t.offsetTop,n+=t.offsetLeft,t=t.offsetParent;return{top:i,left:n}}function No(e,t,i){var n=this.data,r=this.modalSort,a=this.modalDownload,o=this.modalLink,s=this.modalSearch,l=this.commentEditable,c=this.modalInsertURLImage,h=(this.overlayerCEl,this.canvas,this.filename),u=this.toolbar;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Device",i=this.filename;"Original"!==e&&(i="".concat(i.substr(0,i.lastIndexOf(".")),".").concat(e.toLowerCase())),"function"!=typeof this.fileDownloadCallFunc?So.call(this,i,e):this.fileDownloadCallFunc(i,e,t)}if(window.mobileAndTabletCheck()&&u.moreEl.el.hasClass("active")&&u.moreEl.dd.hide(),"undo"===e)this.undo();else if("redo"===e)this.redo();else if("print"===e)this.print.preview(),this.print.toPrint();else if("paintformat"===e)!0===t?go.call(this):mo.call(this);else if("clearformat"===e)Bo.call(this,"delete-cell-format");else if("chart"===e);else if("autofilter"===e)xo.call(this);else if("freeze"===e)if(t){var d=n.selector,m=d.ri,g=d.ci;this.freeze(m,g)}else this.freeze(0,0);else if("sort"===e)r.setValue(n.getSelectedSort());else if("download"===e)a.setValue(h);else if("download_HTML"===e)f.call(this,"HTML");else if("download_Original"===e)f.call(this,"Original");else if("download_XLSX"===e)f.call(this,"XLSX");else if("download_PDF"===e)f.call(this,"PDF");else if("download_GOOGLE"===e)f.call(this,"Original","GoogleDrive");else if("download_DROPBOX"===e)f.call(this,"Original","Dropbox");else if("search"===e)s.show();else if("menu-display-hide"===e)"up"===this.toolbar.menuDisplay.state?(this.toolbar.menuDisplay.setDown(),this.menubar.hide(),this.table.render()):(this.toolbar.menuDisplay.setUp(),this.menubar.show(),this.table.render());else if("insertComment"===e&&"commentEdit"===t||"insertComment"===e||"commentEdit"===e){var v=n.selector,p=v.ri,y=v.ci,b="";if(void 0!==n.comments)for(var w=0;w<n.comments.length;w++){var x=n.comments[w];x.row===p&&x.col===y&&(b=x.note)}var k=n.cellRectWithOutTransfer(p,y);l.col=y,l.row=p,l.setPosition(b,k,n.displayRight2Left),this.commentTip.onEdit=!0,"comments"===n.search.lookin&&(n.search.result=null)}else if("insertComment"===e&&"commentRemove"===t||"commentRemove"===e){var C=n.selector,S=C.ri,_=C.ci;if(void 0!==n.comments)for(var T=0;T<n.comments.length;T++)n.comments[T].col===_&&n.comments[T].row===S&&n.comments.splice(T,1);"comments"===n.search.lookin&&(n.search.result=null),this.table.render()}else if("insertComment"===e&&"commentPrevious"===t||"commentPrevious"===e)Uo(this,n,"previous");else if("insertComment"===e&&"commentNext"===t||"commentNext"===e)Uo(this,n,"next");else if("insert-image"===e)"url"===t&&c.show();else if("zoom-size"===e)this.setzoom(t.number);else if("insertSheet"===e)this.addSheet();else if("insertRow"===e)Bo.call(this,"insert-row");else if("insertColumn"===e)Bo.call(this,"insert-column");else if("link"===e){if(this.canvas.isImageOnSelected())return void this.canvas.link(this.data);var O=this.selector.range,E=this.hyperlink.getSelectArea(O),R=this.hyperlink.findByArea(this.data,E),I="edit";if(!R){(R={}).area=E;var A=this.data.getCell(O.sri,O.sci);R.text=A?A.text:"",I="add"}o.setValue(xs.datas.map((function(e){return e.name})),R,I)}else n.setSelectedCellAttr(e,t),"formula"!==e||n.selector.multiple()||Ao.call(this),fo.call(this);i&&i()}function Uo(e,t,i){var n=e.selector,r=e.commentEditable,a=t.selector,o=a.ri,s=a.ci,l=o,c=s,h="";if(void 0!==t.comments){t.comments.sort((function(e,t){return e.row>t.row||e.row===t.row&&e.col>t.col?1:-1}));for(var u=0;u<t.comments.length;u++){var f=t.comments[u];if("previous"===i)(f.row<o||f.row===o&&f.col<s)&&(l=f.row,c=f.col,h=f.note);else if("next"===i&&(f.row>o||f.row===o&&f.col>s)){l=f.row,c=f.col,h=f.note;break}}}if(n.set(l,c),""!==h){var d=t.cellRectWithOutTransfer(l,c);r.col=c,r.row=l,r.onEdit=!1,r.setPosition(h,d)}}function Xo(e,t,i,n){this.data.setAutoFilter(e,t,i,n),fo.call(this),this.data.updateConditionImageVisible()}function qo(e,t){var i=new XMLHttpRequest;i.open("get",e,!0),i.responseType="blob",i.onload=function(){if(200===this.status){var e=this.response;Wo.call(this,e,t)}else alert("Download failed, please try again")},i.send()}function Wo(e,t){var i=document.createElement("a"),n=e;"string"==typeof e?i.target="_blank":n=window.URL.createObjectURL(e),i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),"string"!=typeof e&&window.URL.revokeObjectURL(n)}function Yo(e){var t=Ho(e.target);return[e.changedTouches[0].pageX-t.left,e.changedTouches[0].pageY-t.top]}function Vo(){var e=this,t=this.selector,i=this.overlayerEl,n=this.rowResizer,a=this.colResizer,o=this.verticalScrollbar,s=this.horizontalScrollbar,l=this.editor,c=this.contextMenu,h=this.commentTip,u=this.commentEditable,d=this.toolbar,m=this.menubar,g=this.formulaBar,v=this.modalValidation,p=this.modalSort,y=this.modalDownload,b=this.modalLink,w=(this.hyperlink,this.modalInsertURLImage),x=this.modalSearch,C=this.sortFilter,S=this.canvas,_=this.el;function T(e,t){Oo.call(e),Eo.call(e,t)}if(window.mobileAndTabletCheck()||i.on("mousemove",(function(t){so.call(e,t)})).on("mousedown",(function(t){Oo.call(e),2===t.buttons?(e.data.xyInSelectedRect(t.offsetX,t.offsetY)||Eo.call(e,t),c.setPosition(t.offsetX,t.offsetY),t.stopPropagation()):2===t.detail?Ao.call(e):Eo.call(e,t)})).on("mousewheel.stop",(function(t){lo.call(e,t)})).on("mouseout",(function(e){var t=e.offsetX;e.offsetY<=0&&a.hide(),t<=0&&n.hide()})),u.el.on("input",(function(t){if(1===e.commentEditable.el.el.childNodes.length&&"#text"===e.commentEditable.el.el.childNodes[0].nodeName){var i=f("font");i.attr("style","FONT-FAMILY: 宋体;FONT-SIZE: 9pt;COLOR: #000000;TEXT-ALIGN: left;"),i.child(document.createTextNode(e.commentEditable.el.el.textContent)),e.commentEditable.el.el.replaceChild(i.el,e.commentEditable.el.el.firstChild),t.target.focus();var n=window.getSelection();n.selectAllChildren(t.target),n.collapseToEnd()}})),t.inputChange=function(t){zo.call(e,t,"input"),Ao.call(e),Po.call(e)},g.inputChange=function(t){zo.call(e,t,"input"),Ao.call(e,!1)},g.enter=function(t,i){if(t.altKey){l.insertTextNewLine(t);var n=i?t.target.innerHTML:t.target.innerText;zo.call(e,n,"input"),Ao.call(e,!1)}else l.clear(),oo.call(e,!1,t.shiftKey?"up":"down"),e.focusing=!0;t.preventDefault()},g.tab=function(t){l.clear(),oo.call(e,!1,t.shiftKey?"left":"right"),e.focusing=!0,t.preventDefault()},g.focuson=function(){e.focusing=!1},Te(_.el,"mousemove",(function(t){h.hide();var i=t.offsetX,n=t.offsetY,r=e.data,a=e.table,o=e.hyperlink,s=e.canvas,l=r.comments,c=a.zoomlevel,u=r.getCellRectByXY(i/c,n/c);if(0!==r.hyperlinks.length){var f=o.getSelectArea({sci:u.ci,eci:u.ci,sri:u.ri,eri:u.ri});o.findByArea(r,f)?s.setCursor("pointer"):s.setCursor("")}u.ri>=0&&u.ci>=0&&l.forEach((function(e){u.ri===e.row&&u.ci===e.col&&h.setPosition(e.note,u,r.displayRight2Left)}))})),window.mobileAndTabletCheck()){var O,E=this,R=!1,I=!1,A=function(){return R&&I},D=this.getTableOffset(),P="",F=[0,0],M=[0,0],L=[0,0],j=[0,0],z=!1;E.table.zoomlevel;new AlloyFinger(this.el.el,{tap:function(e){},touchStart:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){!function(e,t){e.target.className.includes("item")||t.contextMenu.hide()}(e,E);var t=function(e,t){var i,n=e.target.className.includes("".concat(ae,"-selector-corner")),r=e.target.className.includes("tl")?"tl":"br",a=[],o=[],s=!1;return n&&(i=Ho(e.target.offsetParent.offsetParent),a[0]=e.changedTouches[0].pageX,a[1]=e.changedTouches[0].pageY,o[0]=t.data.scroll.x,o[1]=t.data.scroll.y,s=!0),[r,i,a,o,s]}(e,E),i=r()(t,5);P=i[0],O=i[1],F=i[2],L=i[3],(R=i[4])&&(z=!1,console.info("#####touchStart ..that.data.scroll.y...... "+E.data.scroll.y+",startscroll[0]:"+L[0]),L[0]=E.data.scroll.x,L[1]=E.data.scroll.y,E.selector.setMobilestartOffsetAndRange())}},touchEnd:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)&&A()){var i=M[0]-F[0]+E.data.scroll.x-L[0],n=M[1]-F[1]+E.data.scroll.y-L[1];t.setMobileMultipleSelect(i,n),function(e,t,i,n){if(t&&i){var r=e.br.areaEl.el.getBoundingClientRect(),a=r.right>window.screen.width?window.screen.width:r.right,o=r.top-i.top+n.top;o=o>window.screen.height?window.screen.height:o,c.setPosition(a,o)}}(t,!0,O,D);var a=(De(),[!1,!1,!1]),o=r()(a,3);R=o[0],I=o[1],z=o[2],E.table.render()}},doubleTap:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)&&"CANVAS"===e.target.nodeName){var t=Yo(e),i=r()(t,2);e.offsetX=i[0],e.offsetY=i[1],window.mobileEditOnCell=!0,T(E,e),Ao.call(E)}},longTap:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){var t=Yo(e),i=r()(t,2),n=i[0],a=i[1];c.setPosition(n,a)}},singleTap:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable||"CANVAS"!==e.target.nodeName||function(e){return e.target.className.includes("item")}(e))){var i=Yo(e),n=r()(i,2);e.offsetX=n[0],e.offsetY=n[1],window.mobileEditOnCell=!0,T(E,e),t.br.useHideInput=!1,window.keyboardShow?(t.br.useHideInput=!0,Ao.call(E)):function(e,t){var i=Yo(e),n=r()(i,2),a=n[0],o=n[1];if(e.target.className.includes("".concat(ae,"-selector-corner"))){var s=Ho(e.target);a=s.left,o=s.top}var l=a<=t.left&&o>=t.top,h=a>=t.left&&o<=t.top;if(l||h){var u=l?t.left:a,f=h?t.top:o;c.setPosition(u,f)}}(e,D)}},rotate:function(e){},pinch:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){E.editor.el.hide();var t=e.zoom;t>2&&(t=2),t<.5&&(t=.5),E.setzoom(t)}},pressMove:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){var t=E.selector;E.data;if(I=!0,A()){switch(function(e,t,i,n,r){e[0]=n.changedTouches[0].pageX,e[1]=n.changedTouches[0].pageY,t[0]=i.data.scroll.x,t[1]=i.data.scroll.y}(M,j,E,e),P){case"tl":break;case"br":var i=M[0]-F[0],n=M[1]-F[1];t.setEndMobile(i,n);var a=t.getMobileMultipleSelect(i,n),o=r()(a,2),s=o[0],l=o[1];s>=E.data.viewRange().eri-4&&!z&&(z=!0,t.setEnd(s,l),function(e,t){""!==e?Pe(t):De()}("down",E))}}else Math.abs(e.deltaX)>Math.abs(e.deltaY)?Math.abs(e.deltaX)>18&&(E.scrollH(e.deltaX),E.table.render()):Math.abs(e.deltaY)>18&&(E.scrollV(e.deltaY),E.table.render())}},swipe:function(e){}})}d.change=function(t,i){return No.call(e,t,i)},m.change=function(t,i){return No.call(e,t,i,(function(){return m.hideDropdown()}))},C.ok=function(t,i,n,r){return Xo.call(e,t,i,n,r)},n.finishedFn=function(t,i){Lo.call(e,t,i)},a.finishedFn=function(t,i){jo.call(e,t,i)},n.unhideFn=function(t){wo.call(e,"row",t)},a.unhideFn=function(t){wo.call(e,"col",t)},o.moveFn=function(t,i){Fo.call(e,t,i)},s.moveFn=function(t,i){Mo.call(e,t,i)},l.change=function(t,i){zo.call(e,i,t),Po.call(e)},l.textboxChange=function(t,i){var n=e.data;e.table;n.updateTextbox(t,i)},v.change=function(t){if("save"===t){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];(i=e.data).addValidation.apply(i,r)}else e.data.removeValidation()},p.change=function(t,i,n,r){"ok"===t&&e.data.doSort(i,n,r)},y.change=function(t,i,n){"ok"===t&&So.call(e,i,n)},b.change=function(t,i,n){"ok"===t&&(e.canvas.isImageOnSelected()?e.canvas.setHyperlink(i):"add"===n&&(e.data.hyperlinks=e.data.hyperlinks.filter((function(e){return!k.valueOf(i.area).contains(k.valueOf(e.area))})),e.data.hyperlinks.push(i),e.hyperlink.setHyperlinkStyleByArea(i.area,e,!0),e.hyperlink.loadLinkPosition(e)))},w.change=function(t,i){var n=e.canvas,r=e;if("ok"===t){var a=r.data.getSelectedRect();n.setLoading(r,{top:a.top,left:a.left});var o={ri:e.data.selector.ri,ci:e.data.selector.ci,name:e.data.name},s={p:JSON.stringify(o),uid:r.uniqueid,imageurl:i};$.ajax({url:r.imageUploadByUrlUrl,type:"post",data:s,success:function(e,t,i){(e=JSON.parse(e)).Error?le("error",e.Error):n.doInsertURLImage(e,r)}})}},$("#upload-image").on("change",(function(t){var i=t.target.files[0];e.canvas.imageOperationList.paste.uploadImg(e,i),t.target.value=null})),x.change=function(i,n,r,a,o){if("close"!==i){r||(n=n.toUpperCase());var s=e.data,l=s.search,c=s.rows,h=s.comments,f=l.keywords,d=[];if(null!=l.result&&f===n&&l.iscasesense===r&&l.lookin===a&&l.matchwhole===o)d=l.result;else{var m=c.len>0?c._:{},g=null;if("comments"===a){for(var v=document.createElement("c"),p=0,y=h.length;p<y;p++)if(v.innerHTML=h[p].note,g=r?v.innerText:v.innerText.toUpperCase(),!o&&-1!==g.indexOf(n)||o&&g===n){var b={ri:h[p].row,ci:h[p].col};b.cmt=h[p],d.push(b)}}else for(var w in m){var x=m[w].cells;for(var k in x)if("values"===a?g=r?x[k].text:x[k].text.toUpperCase():"formulas"===a&&(g=void 0!==x[k].f?r?x[k].f:x[k].f.toUpperCase():null),null!=g&&(o&&g===n||!o&&-1!==g.indexOf(n))){var C={ri:w,ci:k};d.push(C)}}l.keywords=n,l.lookin=a,l.matchwhole=o,l.iscasesense=r,l.result=d}if(0===d.length)return void alert("We couldn't find what you were looking for.");var S=-1,_=Number(t.indexes[0]),T=Number(t.indexes[1]),O=d.length-1;if(1===d.length)S=0;else if("next"===i){for(var E=0,R=d.length;E<R;E++){if(Number(d[E].ri)===_&&Number(d[E].ci)>T){S=E;break}if(Number(d[E].ri)>_){S=E;break}}-1===S&&(S=0)}else{for(var I=O;I>=0;I--){if(Number(d[I].ri)===_&&Number(d[I].ci)<T){S=I;break}if(Number(d[I].ri)<_){S=I;break}}-1===S&&(S=O)}l.current=S;var A=d[S];if(t.set(A.ri,A.ci),d[S].cmt){var D=A.cmt.note;if(""!==D){var P=s.cellRectWithOutTransfer(A.ri,A.ci);u.col=A.ci,u.row=A.ri,u.onEdit=!1,u.setPosition(D,P)}}ro.call(e)}},c.showMenuBefore=function(t){var i=r()(e.selector.indexes,2),n=i[0],a=i[1],o=!1;if(t.forEach((function(e){return e.show()})),e.canvas.isImageOnSelected()){if(t.forEach((function(e){-1===["copy","cut","paste","link"].indexOf(e.key)&&e.hide()})),e.canvas.checkHyperlink(e.canvas.fabric))return;e.canvas.validType(e.canvas.fabric,"type","Chart")&&(o=!0)}if(!e.hyperlink.check(e.data,n,a)){var s=null;if(t.forEach((function(e){o&&"link"===e.key&&(s.hide(),e.hide()),"openLink"===e.key&&e.hide(),"removeLink"===e.key&&e.hide(),s=e})),window.mobileAndTabletCheck()){var l=["edit","cut","copy","paste","merge","unmerge","clear"].map((function(e){return U("contextmenu.".concat(e))}));t.forEach((function(t){l.includes(t.el.innerText)||t.hide(),t.el.className.includes("divider")&&t.hide(),e.data.merges.equals(e.selector.range)&&t.el.innerText===U("contextmenu.merge")&&t.hide(),e.data.merges.equals(e.selector.range)||t.el.innerText!==U("contextmenu.unmerge")||t.hide()}))}}},c.itemClick=function(t){if("validation"===t)v.setValue(e.data.getSelectedValidation());else if("sort"===t)p.setValue(e.data.getSelectedSort());else if("download"===t)y.setValue(e.filename);else if("link"===t){if(e.canvas.isImageOnSelected())return void e.canvas.link(e.data);var i=e.selector.range,n=e.hyperlink.getSelectArea(i),r=e.hyperlink.findByArea(e.data,n),a="edit";if(!r){(r={}).area=n;var o=e.data.getCell(i.sri,i.sci);r.text=o?o.text:"",a="add"}b.setValue(xs.datas.map((function(e){return e.name})),r,a)}else"removeLink"===t?e.canvas.isImageOnSelected()?e.canvas.removeLink(e.data):e.hyperlink.removeByRange(e.selector.range,e):"openLink"===t?e.canvas.isImageOnSelected()?e.canvas.openLink(e.data):e.hyperlink.accessByRange(e.selector.range,e.data):"copy"===t?(go.call(e),e.canvas.doOperation("copy")):"cut"===t?(vo.call(e),e.canvas.doOperation("copy"),e.canvas.doOperation("delete")):"paste"===t?S.clipboard?e.canvas.doOperation("paste"):yo.call(e,"all"):"paste-value"===t?yo.call(e,"text"):"paste-format"===t?yo.call(e,"format"):"hide"===t?bo.call(e):"delete-image"===t?e.canvas.doOperation("delete"):"merge"===t?(e.data.setSelectedCellAttr(t,!0),e.table.render()):"unmerge"===t?(e.data.setSelectedCellAttr("merge",!1),e.table.render()):"edit"===t?Ao.call(e):Bo.call(e,t)},Te(window,"resize",(function(){window.mobileAndTabletCheck()||e.reload()})),Te(window,"click",(function(e){})),Te(window,"paste",(function(t){e.focusing&&"commentEdit"!==t.target.parentElement.id&&(t.target.parentElement.parentElement&&"commentEdit"===t.target.parentElement.parentElement.id||(yo.call(e,"all",t),t.preventDefault()))})),Te(window,"keydown",(function(t){if(e.focusing&&"commentEdit"!==t.target.id){var i=t.keyCode||t.which,n=t.key,r=t.ctrlKey,a=t.shiftKey,o=t.metaKey;if(r||o)switch(i){case 90:e.undo(),t.preventDefault();break;case 89:e.redo(),t.preventDefault();break;case 67:go.call(e),S.doOperation("copy"),t.preventDefault();break;case 88:vo.call(e),t.preventDefault();break;case 85:d.trigger("underline"),t.preventDefault();break;case 86:S.clipboard?S.doOperation("paste"):yo.call(e,"all"),t.preventDefault();break;case 37:oo.call(e,a,"row-first"),t.preventDefault();break;case 38:oo.call(e,a,"col-first"),t.preventDefault();break;case 39:oo.call(e,a,"row-last"),t.preventDefault();break;case 40:oo.call(e,a,"col-last"),t.preventDefault();break;case 32:ao.call(e,!1,-1,e.data.selector.ci,!1),t.preventDefault();break;case 66:d.trigger("bold");break;case 73:d.trigger("italic")}else{switch(i){case 32:a&&ao.call(e,!1,e.data.selector.ri,-1,!1);break;case 27:c.hide(),h.hide(),mo.call(e);break;case 37:oo.call(e,a,"left"),t.preventDefault();break;case 38:oo.call(e,a,"up"),t.preventDefault();break;case 39:oo.call(e,a,"right"),t.preventDefault();break;case 40:oo.call(e,a,"down"),t.preventDefault();break;case 9:l.clear(),oo.call(e,!1,a?"left":"right"),t.preventDefault();break;case 13:l.clear(),oo.call(e,!1,a?"up":"down"),t.preventDefault();break;case 8:Bo.call(e,"delete-cell-text"),t.preventDefault()}"Delete"===n?(Bo.call(e,"delete-cell-text"),S.doOperation("delete"),t.preventDefault()):i>=65&&i<=90||i>=48&&i<=57||i>=96&&i<=105||"="===t.key?(zo.call(e,t.key,"input"),Ao.call(e),Po.call(e)):113===i&&Ao.call(e)}}}))}var Go=function(){function e(t,i){var n=this;l()(this,e),this.eventMap=new Map;var r=i.settings,a=r.view,o=r.showToolbar,s=r.showFileName,c=r.showContextmenu,h=r.mode,u=r.showPartToolbar,d=r.contextMenuItems,m=r.local;this.el=f("div","".concat(ae,"-sheet")),this.menubar=new Qa(i,a.width,!o,u,s,this,m),this.toolbar=new Er(i,a.width,!o,u),this.formulaBar=new Zr(i,h),this.canvas=new xa,this.print=new Ci(i,this.canvas),this.hyperlink=new Xa,t.children(this.menubar.el,this.toolbar.el,this.formulaBar.el,this.el,this.print.el),this.data=i,this.tableEl=f("canvas","".concat(ae,"-table"));var g=i.settings.row.height;this.rowResizer=new Me(!1,g,this),this.colResizer=new Me(!0,i.cols.minWidth,this),this.verticalScrollbar=new Le(!0),this.horizontalScrollbar=new Le(!1),this.editor=new mi(ut,(function(){return n.getTableOffset()}),g,this),this.modalValidation=new jr,this.modalSort=new Hr,this.modalDownload=new Ga,this.modalLink=new Ka,this.modalSearch=new Gr,this.modalInsertURLImage=new Ca,this.contextMenu=new Ei((function(){return n.getRect()}),this,!c,d),this.commentTip=new Yr,this.commentEditable=new Jr,this.selector=new $e(i),this.highlight=new Ya(this),this.overlayerCEl=f("div","".concat(ae,"-overlayer-content")).children(this.editor.el,this.selector.el),this.overlayerEl=f("div","".concat(ae,"-overlayer")).children(this.overlayerCEl,this.canvas),this.sortFilter=new Wr,this.el.children(this.tableEl,this.overlayerEl.el,this.rowResizer.el,this.colResizer.el,this.verticalScrollbar.el,this.horizontalScrollbar.el,this.contextMenu.el,this.commentTip.el,this.commentEditable.el,this.modalValidation.el,this.modalSort.el,this.modalDownload.el,this.modalLink.el,this.modalSearch.el,this.modalInsertURLImage.el,this.sortFilter.el),this.table=new ai(this.tableEl.el,i),Vo.call(this),fo.call(this),ao.call(this,!1,0,0),this.canvas.init(this),this.imageUploadByLocalUrl=null,this.imageUploadByUrlUrl=null,this.reloadUrl=null,this.fileDownloadUrl=null,this.oleDownloadUrl=null,this.uniqueid="",this.filename=""}var t;return o()(e,[{key:"setReloadUrl",value:function(e){this.reloadUrl=e}},{key:"getReloadUrl",value:function(){return this.reloadUrl+"?filename="+this.filename+"&uid="+this.uniqueid}},{key:"on",value:function(e,t){return this.eventMap.set(e,t),this}},{key:"preMousedown",value:function(){Oo.call(this)}},{key:"trigger",value:function(e){var t=this.eventMap;if(t.has(e)){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];(i=t.get(e)).call.apply(i,[this].concat(r))}}},{key:"resetData",value:function(e){this.editor.clear(),this.data=e,co.call(this),ho.call(this);var t=this.getTableOffset();this.overlayerCEl.offset(t),e.displayRight2Left?this.overlayerCEl.el.setAttribute("dir","rtl"):this.overlayerCEl.el.removeAttribute("dir"),this.data.topOrder=0,this.toolbar.resetData(e),this.formulaBar.resetData(e),this.print.resetData(e),this.selector.resetData(e),this.table.resetData(e),this.canvas.reset(e),this.data.updateConditionImageDirection(),this.data.reloadImagesShapes(),this.hyperlink.loadLinkPosition(this);var i=this.highlight;setTimeout((function(){i.AutoShowOrHide()}),2e3)}},{key:"loadData",value:function(e){return this.data.setData(e),fo.call(this),this}},{key:"scrollV",value:function(e){var t=this.verticalScrollbar.scroll().top;this.verticalScrollbar.move({top:t-e})}},{key:"scrollToRow",value:function(e){var t=this.verticalScrollbar.scroll().top,i=this.data.viewRange().sri,n=e>i?-this.data.rows.sumHeight(i,e):this.data.rows.sumHeight(e,i);this.verticalScrollbar.move({top:t-n})}},{key:"scrollH",value:function(e){var t=this.horizontalScrollbar.scroll().left;this.horizontalScrollbar.move({left:t-e})}},{key:"selectMoveDown",value:function(){oo.call(this,!0,"down")}},{key:"freeze",value:function(e,t){var i=this.data;return this.canvas.doResetPosition(e,t),i.setFreeze(e,t),fo.call(this),this}},{key:"setActiveCell",value:function(e,t){return ao.call(this,!1,e,t),this.focusing=!0,this}},{key:"setEditForTextBox",value:function(e){return Do.call(this,e),this}},{key:"undo",value:function(){this.data.undo(),fo.call(this)}},{key:"redo",value:function(){this.data.redo(),fo.call(this)}},{key:"reload",value:function(){return fo.call(this),this}},{key:"setzoom",value:function(e){var t=this.data,i=this.table,n=this.canvas,r=this.selector;i.zoomlevel=e,t.zoomlevel=e;this.getTableOffset();1!==this.data.zoomlevel&&(r.br.useHideInput=!1),this.data.zoomlevel<1&&!window.mobileAndTabletCheck()&&(this.overlayerCEl.el.style.width="".concat(this.overlayerCEl.el.clientWidth/e,"px"),this.overlayerCEl.el.style.height="".concat(this.overlayerCEl.el.clientHeight/e,"px")),n.setZoom(e),fo.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0),t.updateConditionImageZoom()}},{key:"showHighlights",value:function(e){this.highlight.showHighlights(e)}},{key:"hideHighlights",value:function(){this.highlight.hideHighlights()}},{key:"getHighlightTexts",value:function(){return this.highlight.getHighlightTexts()}},{key:"addHighlightText",value:function(e,t,i,n){this.highlight.addHighlightText(e,t,i,n)}},{key:"removeHighlightText",value:function(e,t,i,n){this.highlight.removeHighlightText(e,t,i,n)}},{key:"getHighlightRanges",value:function(){return this.highlight.getHighlightRanges()}},{key:"addHighlightRange",value:function(e,t,i,n){this.highlight.addHighlightRange(e,t,i,n)}},{key:"removeHighlightRange",value:function(e,t,i,n){this.highlight.removeHighlightRange(e,t,i,n)}},{key:"setHighlightInverseRange",value:function(e,t,i,n){this.highlight.setHighlightInverseRange(e,t,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.highlight.getHighlightInverseRange()}},{key:"removeHighlightInverseRange",value:function(){this.highlight.removeHighlightInverseRange()}},{key:"getHighlightShaps",value:function(){return this.highlight.getHighlightShaps()}},{key:"addHighlightShape",value:function(e){this.highlight.addHighlightShape(e)}},{key:"removeHighlightShape",value:function(e){this.highlight.removeHighlightShape(e)}},{key:"addHighlightTextBox",value:function(e,t,i){var n=this.data,r=(this.table,this.highlight,n.shapes.find((function(t){return t.id===e})));r?"TextBox"===r.type?(this.addHighlightShape(e),r.addHighlight(t,i)):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"removeHighlightTextBox",value:function(e,t,i){var n=this.data,r=(this.table,n.shapes.find((function(t){return t.id===e})));r?"TextBox"===r.type?-1!==n.highlighshapes.indexOf(e)&&r.removeHighlight(t,i):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"getHighlightImages",value:function(){return this.highlight.getHighlightImages()}},{key:"addHighlightImage",value:function(e){this.highlight.addHighlightImage(e)}},{key:"removeHighlightImage",value:function(e){this.highlight.removeHighlightImage(e)}},{key:"setHighlightAll",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.highlight;i.setHighlightAll(e,t)}},{key:"setCustomHighlightImgFunc",value:function(e){this.highlight.setCustomHighlightImgFunc(e)}},{key:"getImageContextMenuItems",value:function(){return this.contextMenu.getImageContextMenuItems()}},{key:"addImageContextMenuItems",value:function(e){this.contextMenu.addImageContextMenuItems(e)}},{key:"delImageContextMenuItems",value:function(e){this.contextMenu.delImageContextMenuItems(e)}},{key:"getCustomContextMenuItems",value:function(){return this.contextMenu.getCutomContextMenuItems()}},{key:"addCustomContextMenuItems",value:function(e){this.contextMenu.addCutomContextMenuItems(e)}},{key:"insertCustomContextMenuItem",value:function(e,t){this.contextMenu.insertCutomContextMenuItem(e,t)}},{key:"updateCustomContextMenuItem",value:function(e,t){this.contextMenu.updateCutomContextMenuItem(e,t)}},{key:"delCustomContextMenuItems",value:function(e){this.contextMenu.delCutomContextMenuItems(e)}},{key:"getOle",value:(t=be()(Ce.a.mark((function e(t){var i;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this.oleDownloadUrl+"?id="+t+"&uid="+this.uniqueid+"&sheet="+this.data.name,Wo.call(this,i);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getRect",value:function(){var e=this.data;return{width:e.viewWidth(),height:e.viewHeight()}}},{key:"getTableOffset",value:function(){var e=this.data,t=e.rows,i=e.cols,n=e.displayRight2Left,r=this.table.zoomlevel,a=this.data.settings.row.height,o=this.getRect(),s=o.width,l=o.height;return{width:(s-i.indexWidth)*r,height:(l-t.height)*r,left:n?0:i.indexWidth*r,top:a*r}}}]),e}();function Zo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ko=function(e){ee()(i,e);var t=Zo(i);function i(e){var n;l()(this,i);var r=new se("ellipsis");return(n=t.call(this,r,"auto",!1,"top-left")).contentClick=e,n}return o()(i,[{key:"reset",value:function(e){var t=this,i=e.map((function(e,i){return f("div","".concat(ae,"-item")).css("width","150px").css("font-weight","normal").on("click",(function(){t.contentClick(i),t.hide()})).child(e)}));this.setContentChildren.apply(this,m()(i))}},{key:"setTitle",value:function(){}}]),i}(Mi),Jo=function(e){ee()(i,e);var t=Zo(i);function i(e){var n;l()(this,i);var r=new se("pagination");return(n=t.call(this,r,"100px",!1,"top-left")).contentEl.css("max-height","298px"),n.contentEl.css("overflow-y","auto"),n.contentClick=e,n}return o()(i,[{key:"reset",value:function(e){var t=this,i=e.map((function(e,i){return f("div","".concat(ae,"-item")).css("width","auto").css("font-weight","normal").on("click",(function(){t.contentClick(i),t.hide()})).child(e)}));this.setContentChildren.apply(this,m()(i))}}]),i}(Mi),$o=[{key:"delete",title:X("contextmenu.deleteSheet")}];function Qo(e){var t=this;return f("div","".concat(ae,"-item")).child(e.title()).on("click",(function(){t.itemClick(e.key),t.hide()}))}function es(){var e=this;return $o.map((function(t){return Qo.call(e,t)}))}var ts=function(){function e(){var t;l()(this,e),this.el=(t=f("div","".concat(ae,"-contextmenu")).css("width","160px")).children.apply(t,m()(es.call(this))).hide(),this.itemClick=function(){}}return o()(e,[{key:"hide",value:function(){var e=this.el;e.hide(),Ee(e)}},{key:"setOffset",value:function(e){var t=this.el;t.offset(e),t.show(),Re(t)}}]),e}(),is=function(){function e(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},s=arguments.length>5?arguments[5]:void 0;l()(this,e),this.settings=s,this.addFunc=i,this.swapFunc=n,this.updateFunc=a,this.scrollFunc=o,this.dataNames=[],this.activeEl=null,this.deleteEl=null,this.items=[],this.moreEl=new Ko((function(e){t.clickSwap2(t.items[e])})),this.paginationEl=new Jo((function(e){t.scrollFunc(e)})),this.contextMenu=new ts,this.contextMenu.itemClick=r,this.el=f("div","".concat(ae,"-bottombar")).children(this.contextMenu.el,this.menuEl=this.setMenuEl())}return o()(e,[{key:"setMenuEl",value:function(){var e=this;return"edit"===this.settings.mode?f("ul","".concat(ae,"-menu")).child(f("li","").children(new se("add").on("click",(function(){e.dataNames.length<10?e.addFunc():le("Warning","It is less than or equal to 10")})),f("span","").child(this.moreEl))):f("ul","".concat(ae,"-menu")).child(f("li","").children(f("span","").child(this.moreEl)))}},{key:"addItem",value:function(e,t,i,n){this.dataNames.push(e);var r=f("li",t?"active":"").child(e);void 0!==i&&(r.el.style.color=n,r.el.style.backgroundColor=i),this.setItemEvent(r),t&&this.clickSwap(r),this.items.push(r),this.menuEl.child(r),this.moreEl.reset(this.dataNames)}},{key:"addPagination",value:function(e){for(var t=[],i=1;i<=e;i++){var n=i+"";t.push(n)}this.paginationEl.reset(t)}},{key:"setItemEvent",value:function(e){var t=this;"edit"===this.settings.mode?e.on("click",(function(){t.clickSwap2(e)})).on("contextmenu",(function(i){var n=i.target,r=n.offsetLeft,a=n.offsetHeight;t.contextMenu.setOffset({left:r,bottom:a+1}),t.deleteEl=e})).on("dblclick",(function(){if(!(e.el.children.length>0)){var i=e.html(),n=new Ir("auto","",31);n.val(i),n.input.on("blur",(function(e){var r=e.target.value,a=t.dataNames.findIndex((function(e){return e===i}));t.renameItem(a,r,n)})),e.html("").child(n.el),n.focus()}})):e.on("click",(function(){t.clickSwap2(e)}))}},{key:"renameItem",value:function(e,t,i){if(this.dataNames[e]!==t&&0!==t.length)if(t.length>31)le("Error","The max length of the sheet name is 31",(function(){i.focus()}));else if(this.dataNames.indexOf(t)>=0)le("Error","Same worksheet name already exist",(function(){i.focus()}));else{for(var n=0;n<t.length;n++)switch(t[n]){case":":case"\\":case"/":case"?":case"*":case"[":case"]":return void le("Error","Worksheet name could not contain any following characters : : \\ / ? * [ or ]",(function(){i.focus()}))}this.dataNames.splice(e,1,t),this.moreEl.reset(this.dataNames),this.items[e].html("").child(t),this.updateFunc(e,t)}else this.items[e].html("").child(t)}},{key:"clear",value:function(){var e=this;this.items.forEach((function(t){e.menuEl.removeChild(t.el)})),this.items=[],this.dataNames=[],this.moreEl.reset(this.dataNames)}},{key:"hide",value:function(){var e=this.el;e.hide(),Ee(e)}},{key:"deleteItem",value:function(){var e=this.activeEl,t=this.deleteEl;if(this.items.length>1){var i=this.items.findIndex((function(e){return e===t}));if(this.items.splice(i,1),this.dataNames.splice(i,1),this.menuEl.removeChild(t.el),this.moreEl.reset(this.dataNames),e===t){var n=r()(this.items,1)[0];return this.activeEl=n,this.activeEl.toggle(),[i,0]}return[i,-1]}return[-1]}},{key:"clickSwap2",value:function(e){var t=this.items.findIndex((function(t){return t===e}));this.clickSwap(e),this.activeEl.toggle(),this.swapFunc(t)}},{key:"clickSwap",value:function(e){if(null!==this.activeEl){this.activeEl.toggle();var t=this.activeEl.el.style.backgroundColor;t&&(this.activeEl.el.style.backgroundColor=(i=t.match(/[\d.]+/g)).length>=3?"rgb("+i[0]+","+i[1]+","+i[2]+")":"")}var i;this.activeEl=e;var n=e.el.style.backgroundColor;n&&(this.activeEl.el.style.backgroundColor=function(e,t){var i=e.match(/[\d.]+/g);if(i.length>=3)return"rgba("+i[0]+","+i[1]+","+i[2]+","+t+")"}(n,.1))}},{key:"setDirection",value:function(e){e?this.el.attr("dir","rtl"):this.el.removeAttr("dir")}}]),e}();i(35),i(36);function ns(e){var t=[],i=0;this.run=function(e){var n=this;this.startHandler(e,(function(){i--,e.timestm,e.isfinish,t.length>0&&n.run(t.shift())}))},this.startHandler=function(n,r){var a=this;n.isfinish?t.length>0&&this.run(t.shift()):0!==i?setTimeout((function(){return a.startHandler(n,r)}),300):(i++,n.timestm,n.isfinish,e(n,r))},this.append=function(e){t.push(e),t.length,e.timestm,1===t.length&&this.run(e)},this.isFinish=function(){return 0===t.length&&0===i}}var rs=function e(t,i,n,r){l()(this,e),this.item=t,this.url=i,this.callback=n,this.callbackerror=r,this.isfinish=!1,this.timestm="["+(new Date).getTime()+"] "};function as(e,t){var i=$.ajax({url:e.url,type:"post",dataType:"json",data:e.item});e.timestm,e.isfinish,i.done((function(i){e.timestm,e.callback&&(e.callback(i),e.isfinish=!0),t()})),i.fail((function(i,n,r){e.timestm,e.callbackerror&&(e.callbackerror(i,n,r),e.isfinish=!0),t()}))}function os(e){e.scaleX=1,e.scaleY=1,e.originAngle=e.angle;var t=e.originAngle;t<0&&(t+=360),t>90&&t<180?t=180-t:t>=180&&t<270?t-=180:t>=270&&(t=360-t),t>=45&&(t=90-t);Math.sin(.017453293*t),Math.cos(.017453293*t);e.originWidth=e.width,e.originHeight=e.height,e.originLeft=e.left,e.originTop=e.top}function ss(e,t,i,n,r){var a,o,s;return{tick:e.tick,width:e.width,height:e.height,top:e.top+n.top/r,left:i+n.left/r,"z-index":t+e.zorder,originAngle:e.originAngle,rotate:e.angle,imgType:e.type,strid:e.strid,text:e.text,html:e.html,hyperlink:e.hyperlink,zorder:e.zorder,fromOutside:null!==(a=e.fromOutside)&&void 0!==a&&a,scaleX:null!==(o=e.scaleX)&&void 0!==o?o:1,scaleY:null!==(s=e.scaleY)&&void 0!==s?s:1}}var ls=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,e);var r=t;this.options=n,n.local&&W(n.local),this.sheetIndex=0,this.datas=[],this.uniqueid="",this.filename="",this.imageDiv=null,this.imageUrl=null,this.basicZorder=0,this.istestforimage=!1,this.buffer=new ns(as),"string"==typeof t&&(r=document.querySelector(t)),window.mobileAndTabletCheck=function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t},window.mobileEditOnCell=!1,Fe((function(e){var t=i.sheet;t.data,t.selector,t.canvas,t.editor,t.verticalScrollbar;window.keyboardShow=!1,i.sheet.preMousedown(),i.reRender(),window.mobileEditOnCell=!1}),(function(e){window.keyboardShow=!0;var t=i.sheet,n=t.data;t.selector,t.editor,t.verticalScrollbar;window.mobileEditOnCell&&i.sheet.scrollToRow(n.selector.ri)})),this.bottombar=new is((function(){if(i.uniqueid.endsWith(".csv"))le("Warning","CSV file does not support more than one worksheet");else if(i.uniqueid.endsWith(".tsv"))le("Warning","TSV file does not support more than one worksheet");else{i.sheet.canvas.doNewSheetPage(i.sheet.data);var e=i.addSheet();e.showGrid=!0,i.sheet.resetData(e)}}),(function(e){var t=i.datas[e];t.scroll={ci:0,ri:0,riact:0,x:0,y:0,yact:0},i.sheet.canvas.doSwitchSheetPage(i.sheet.data),i.sheet.resetData(t),i.bottombar.setDirection(t.displayRight2Left),i.resetPagination(t),i.sheet.verticalScrollbar.move({top:0}),i.setZoomLevel(t.zoomlevel)}),(function(){i.deleteSheet()}),(function(e,t){i.renameSheet(e,t)}),(function(e){var t=e*i.data.settings.row.len,n=i.data.rows.sumHeight(0,t);i.sheet.verticalScrollbar.move({top:n-1})}),this.options),this.isloading=!0,this.data=this.addSheet(),this.isloading=!1,this.resetPagination(this.data);var a=f("div","".concat(ae)).on("contextmenu",(function(e){return e.preventDefault()}));r.appendChild(a.el),this.sheet=new Go(a,this.data),this.sheet.hyperlink.setActiveSheetBySheetName=function(e){i.setActiveSheetByName(e)},this.sheet.hyperlink.setActiveCell=function(e,t){i.setActiveCell(e,t)},this.sheet.addSheet=this.bottombar.addFunc,a.child(this.bottombar.el)}return o()(e,[{key:"setUniqueId",value:function(e){this.uniqueid=e,this.sheet.uniqueid=e}},{key:"setFileDownloadInfo",value:function(e){this.sheet.fileDownloadUrl=e}},{key:"setOleDownloadInfo",value:function(e){this.sheet.oleDownloadUrl=e}},{key:"setFileName",value:function(e){this.filename=e,this.sheet.filename=e,this.sheet.menubar.setFileName(e)}},{key:"setZoomLevel",value:function(e){this.sheet.setzoom(e)}},{key:"setReloadUrl",value:function(e){this.sheet.setReloadUrl(e)}},{key:"setVisibleFilter",value:function(e){this.sheet.visibleFilter=e}},{key:"setFileDownloadCallFunction",value:function(e){this.sheet.fileDownloadCallFunc=e}},{key:"setImageInfo",value:function(e,t,i,n,r,a,o){return this.imageDiv=e,this.imageUrl=t,this.sheet.imageUploadByLocalUrl=i,this.sheet.imageUploadByUrlUrl=n,this.sheet.imageCopyUrl=r,this.basicZorder=a,this.updating=o,this}},{key:"setImageForTest",value:function(e,t,i){return this.imageDiv=e,this.imageUrl=t,this.basicZorder=i,this.istestforimage=!0,this}},{key:"setDisplayRight2Left",value:function(e){var t=this.sheet,i=this.bottombar,n=t.data;if(n.displayRight2Left!==e){n.displayRight2Left=e;var r=t.getTableOffset();t.overlayerCEl.offset(r),t.resetData(n),i.setDirection(e)}}},{key:"getUpdateDatas",value:function(){for(var e=[],t=0,i=this.datas.length;t<i;t++){var n=this.datas[t].getDataForSave();null!=n&&e.push(n)}return e}},{key:"addSheet",value:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=e||"sheet".concat(this.sheetIndex),s=new pe(o,this.options);return s.rows.setCellText(0,0,""),s.change=function(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(e=t.sheet).trigger.apply(e,["change"].concat(n))},s.updateCellsData=function(e){var i=t.sheet.data,n=i.updateCellError,r=i.updateMyCells,a=t.uniqueid,o=t.imageUrl;if(e.Error)e.cell&&(r.call(t.sheet.data,[e.cell]),t.reRender()),e.cells&&(r.call(t.sheet.data,e.cells),t.reRender()),e.p&&(t.sheet.data.updateRevertOpr(e.p),t.reRender()),n(e.Error);else if("update"===e.op)e.data.forEach((function(e,i,n){for(var r=0,s=new Array;r<t.datas.length;r++)if(t.datas[r].name===e.name){t.datas[r].updateMyCells(e.cells),t.datas[r].updateShapes(e.shapes,s),t.datas[r].updateMyConditionImages(e.conditionimg);break}t.sheet.data.updateShapeSrcToRefresh(a,o,e.pickey,s)})),t.reRender();else if("sort"===e.op)e.rowids&&e.rowids.length>0&&(t.sheet.data.sortByRowIdArray(e.r,e.rowids),t.reRender());else if("updateTextBox"===e.op){for(var s=0;s<t.sheet.data.shapes.length;s++)if(t.sheet.data.shapes[s].strid===e.id){t.sheet.data.shapes[s].updateTextBox(e.html,e.rtxt);break}t.reRender()}},s.updateServerError=function(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(e=t.sheet).trigger.apply(e,["updateServerError"].concat(n))},s.updateCellError=function(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(e=t.sheet).trigger.apply(e,["updateCellError"].concat(n))},s.updateCellServer=function(e){var i=t.sheet.data,n=i.settings,r=i.updateServerError,a=i.updateCellsData,o=t.uniqueid,s=t.buffer;if("server"===n.updateMode){var l={p:JSON.stringify(e),uid:o,folderName:n.folderName,fileName:n.fileName};s.append(new rs(l,n.updateUrl,(function(e){a(e)}),(function(e,t,i){r(e,t,i)})))}},s.menubarStatus=function(){return!t.sheet||"up"===t.sheet.toolbar.menuDisplay.state},s.loadImages=function(){var e=t.sheet.data,i=e.images,n=e.displayRight2Left,r=e.cols,a=n?t.sheet.data.viewWidth()-r.indexWidth:0,o=(t.uniqueid,t.imageDiv,t.imageUrl,t.basicZorder),s=t.sheet,l=t.updating;s.canvas.basicZorder=null!=o?o:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(e){if("del"!==e.op){var t=n?a-e.left-e.width:e.left;s.data.topOrder=s.data.topOrder<e.zorder?e.zorder:s.data.topOrder;var i=ss(e,o,t,c,s.table.zoomlevel);e.src?s.canvas.setImage(s,e,i,e.src):s.canvas.setImage(s,e,i,l)}}))},s.loadShapes=function(){var e=t.sheet.data,i=e.shapes,n=e.displayRight2Left,a=e.cols,o=n?t.sheet.data.viewWidth()-a.indexWidth:0,s=(t.uniqueid,t.imageDiv,t.imageUrl,t.basicZorder),l=t.sheet,c=t.updating;l.canvas.basicZorder=null!=s?s:l.canvas.basicZorder;var h=l.getTableOffset();null!=i&&i.forEach((function(e){if("del"!==e.op){var t=n?o-e.left-e.width:e.left;l.data.topOrder=l.data.topOrder<e.zorder?e.zorder:l.data.topOrder;var i=ss(e,s,t,h,l.table.zoomlevel);if(e.lc&&!Array.isArray(e.lc)){var a=e.lc,u=a.indexOf(":");u>0&&(a=a.substr(0,u));var f=y(a=a.replaceAll("$","")),d=r()(f,2),m=d[0],g=d[1];l.data.setLinkedShape(g,m,e),e.lc=[g,m]}"TextBox"===e.type?l.canvas.setTextBox(l,e,i):e.src?l.canvas.setImage(l,e,i,e.src):l.canvas.setImage(l,e,i,c)}}))},s.fillImageSrc=function(){var e=t.sheet.data,i=e.images,n=e.shapes,r=e.sheetid,a=e.isImageOk,o=t.uniqueid,s=(t.imageDiv,t.imageUrl);t.basicZorder;if(!a&&void 0!==r&&(null!=n&&n.length>0||null!=i&&i.length>0)){var l=t,c=t.istestforimage?s+"/"+o+"."+r+"_batch.zip":s+"?uid="+o+"&id="+r+"_batch.zip";t.istestforimage?l.sheet.data.generatePicItems(i,n,c):$.get(c,(function(e){l.sheet.data.generatePicItems(i,n,e)}))}},s.fillImageOnebyOne=function(e,i){var n=new XMLHttpRequest,r=t.sheet,a=setInterval((function(){r.data.loadCount<=0&&(r.data.isImageOk=!0,clearInterval(a))}),200);n.onreadystatechange=function(){if(4==n.readyState){var e=n.response,t=new Uint8Array(e);JSZip.loadAsync(t).then((function(e){i.forEach((function(t,i,n){e.file(t.name).async("blob").then((function(e){var i=URL.createObjectURL(e),n=r.canvas.fabric.getObjects().find((function(e){return e.id===t.id}));n&&"TextBox"!==n.imgType&&(n.setSrc(i,(function(e){var t;r.canvas.fabric.requestRenderAll(),r.canvas.saveCanvasData(r.data),null===(t=r.canvas.inFreeze)||void 0===t||t.loadFreezeImage()})),t.it.src=i),r.data.loadCount--}))}))}))}},n.open("GET",e,!0),n.responseType="arraybuffer",n.send()},s.loadConditionImage=function(){var e=t.sheet.data.conditionimg,i=t.imageDiv,n=t.basicZorder;e&&e.forEach((function(e){if(e.data){var t=s.createConditionImage(e,n);e.data=void 0,e.image=t,i.append(t)}else i.append(e.image)}))},s.insertConditionImage=function(e){var i=t.sheet.data.conditionimg,n=t.imageDiv,r=t.basicZorder;if(i)if(e.data){var a=s.createConditionImage(e,r);e.data=void 0,e.image=a,n.append(a),i.push(e)}else n.append(e.image)},s.reloadImagesShapes=function(){var e=t.imageDiv;null!=e&&(e.empty(),e.css("left",0),e.css("top",0),s.loadImages(),s.loadShapes(),s.loadConditionImage(),s.fillImageSrc())},s.scrollImagesShapes=function(){var e=t.imageDiv,i=t.sheet.canvas,n=t.sheet.data,r=n.scroll,a=n.displayRight2Left,o=n.zoomlevel;i.publishEvent("object:scroll",t.sheet.data),i.initFreeze(),null!=e&&(e.css("left",a?r.x*o:-r.x*o),e.css("top",-r.y*o))},this.datas.push(s),this.bottombar.addItem(o,i,n,a),this.sheetIndex+=1,this.isloading||this.sheet.data.addSheetOpr(o),s}},{key:"resetPagination",value:function(e){var t=e.rows.len,i=e.settings.row.len,n=t%i==0?t/i:Math.ceil(t/i);this.bottombar.addPagination(n)}},{key:"deleteSheet",value:function(){var e=this.bottombar.deleteItem(),t=r()(e,2),i=t[0],n=t[1];if(i>=0){var a=this.datas[i].name;this.sheet.data.delSheetOpr(a),this.datas.splice(i,1),n>=0&&this.sheet.resetData(this.datas[n])}}},{key:"renameSheet",value:function(e,t){var i=this.datas[e].name;this.datas[e].name=t,this.sheet.data.renameSheetOpr(i,t)}},{key:"loadData",value:function(e){this.isloading=!0;var t=Array.isArray(e)?e:[e];if(this.bottombar.clear(),this.datas=[],t.length>0)for(var i=0;i<t.length;i+=1){var n,a,o=t[i],s=this.addSheet(o.name,0===i,o.tabcolor,o.fontcolor);if(void 0!==o.merges)for(var l=0,c=o.merges.length;l<c;l++){var h=o.merges[l].split(":"),u=y(h[0]),f=r()(u,2),d=f[0],m=f[1],g=y(h[1]),v=r()(g,2),p=v[0],b=v[1];o.rows[m]&&o.rows[m].cells[d]&&(o.rows[m].cells[d].merge=[b-m,p-d])}for(var w in null===(n=o.images)||void 0===n||n.forEach((function(e){os(e)})),null===(a=o.shapes)||void 0===a||a.forEach((function(e){os(e)})),s.setData(o),o.rowinfo)s.rows.setInfo(w,o.rowinfo[w]);delete o.rowinfo}return this.isloading=!1,this}},{key:"getData",value:function(){return this.datas.map((function(e){return e.getData()}))}},{key:"cellText",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.datas[n].setCellText(e,t,i,"finished"),this}},{key:"setActiveCell",value:function(e,t){return this.sheet.setActiveCell(e,t),this}},{key:"setActiveSheet",value:function(e){return this.bottombar.clickSwap2(this.bottombar.items[e]),this}},{key:"getActiveSheet",value:function(){return this.bottombar.dataNames.indexOf(this.sheet.data.name)}},{key:"getActiveSheetName",value:function(){return this.sheet.data.name}},{key:"setActiveSheetByName",value:function(e){for(var t=0;t<this.bottombar.dataNames.length;t++)if(this.bottombar.dataNames[t]===e){this.bottombar.clickSwap2(this.bottombar.items[t]);break}return this}},{key:"cell",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCell(e,t)}},{key:"cellStyle",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCellStyle(e,t)}},{key:"reRender",value:function(){return this.sheet.table.render(),this.sheet.canvas.fabric.requestRenderAll(),this}},{key:"showHighlights",value:function(e){this.sheet.showHighlights(e)}},{key:"hideHighlights",value:function(){this.sheet.hideHighlights()}},{key:"on",value:function(e,t){return this.sheet.on(e,t),this}},{key:"validate",value:function(){return this.data.validations.errors.size<=0}},{key:"change",value:function(e){return this.sheet.on("change",e),this}},{key:"updateServerError",value:function(e){return this.sheet.on("updateServerError",e),this}},{key:"updateCellError",value:function(e){return this.sheet.on("updateCellError",e),this}}],[{key:"locale",value:function(e,t){q(e,t)}}]),e}(),cs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new ls(e,t)};window&&(window.x_spreadsheet=cs,window.x_spreadsheet.locale=function(e,t){return q(e,t)});t.default=ls}]);
|
|
12
|
+
t.read=function(e,t,i,n,r){var a,o,s=8*r-n-1,l=(1<<s)-1,c=l>>1,h=-7,u=i?r-1:0,f=i?-1:1,d=e[t+u];for(u+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=256*a+e[t+u],u+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=n;h>0;o=256*o+e[t+u],u+=f,h-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,i,n,r,a){var o,s,l,c=8*a-r-1,h=(1<<c)-1,u=h>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,m=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+u>=1?f/l:f*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(s=0,o=h):o+u>=1?(s=(t*l-1)*Math.pow(2,r),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;e[i+d]=255&s,d+=m,s/=256,r-=8);for(o=o<<r|s,c+=r;c>0;e[i+d]=255&o,d+=m,o/=256,c-=8);e[i+d-m]|=128*g}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t){},function(e,t){},function(e,t){},function(e,t,i){},function(e,t,i){"use strict";i.r(t),i.d(t,"spreadsheet",(function(){return bs}));var n=i(2),r=i.n(n),a=i(5),o=i.n(a),s=i(0),l=i.n(s),c=i(13),h=i.n(c),u=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l()(this,e),"string"==typeof t?(this.el=document.createElement(t),this.el.className=i):this.el=t,this.data={}}return r()(e,[{key:"data",value:function(e,t){return void 0!==t?(this.data[e]=t,this):this.data[e]}},{key:"on",value:function(e,t){var i=e.split("."),n=h()(i),r=n[0],a=n.slice(1),o=r;return"mousewheel"===o&&/Firefox/i.test(window.navigator.userAgent)&&(o="DOMMouseScroll"),this.el.addEventListener(o,(function(e){t(e);for(var i=0;i<a.length;i+=1){var n=a[i];if("left"===n&&0!==e.button)return;if("right"===n&&2!==e.button)return;"stop"===n&&e.stopPropagation()}})),this}},{key:"offset",value:function(e){var t=this;if(void 0!==e)return Object.keys(e).forEach((function(i){t.css(i,"".concat(e[i],"px"))})),this;var i=this.el;return{top:i.offsetTop,left:i.offsetLeft,height:i.offsetHeight,width:i.offsetWidth}}},{key:"scroll",value:function(e){var t=this.el;return void 0!==e&&(void 0!==e.left&&(t.scrollLeft=e.left),void 0!==e.top&&(t.scrollTop=e.top)),{left:t.scrollLeft,top:t.scrollTop}}},{key:"box",value:function(){return this.el.getBoundingClientRect()}},{key:"parent",value:function(){return new e(this.el.parentNode)}},{key:"children",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return 0===arguments.length?this.el.childNodes:(i.forEach((function(t){return e.child(t)})),this)}},{key:"removeChild",value:function(e){this.el.removeChild(e)}},{key:"empty",value:function(){this.el.innerHTML=""}},{key:"child",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;return"string"==typeof t?n=document.createTextNode(t):t instanceof e&&(n=t.el),i?this.el.prepend(n):this.el.appendChild(n),this}},{key:"contains",value:function(e){return this.el.contains(e)}},{key:"className",value:function(e){return void 0!==e?(this.el.className=e,this):this.el.className}},{key:"addClass",value:function(e){return this.el.classList.add(e),this}},{key:"hasClass",value:function(e){return this.el.classList.contains(e)}},{key:"removeClass",value:function(e){return this.el&&this.el.classList.remove(e),this}},{key:"toggle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"active";return this.toggleClass(e)}},{key:"toggleClass",value:function(e){return this.el.classList.toggle(e)}},{key:"active",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"active";return e?this.addClass(t):this.removeClass(t),this}},{key:"checked",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.active(e,"checked"),this}},{key:"disabled",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return e?this.addClass("disabled"):this.removeClass("disabled"),this}},{key:"attr",value:function(e,t){var i=this;if(void 0!==t)this.el.setAttribute(e,t);else{if("string"==typeof e)return this.el.getAttribute(e);Object.keys(e).forEach((function(t){i.el.setAttribute(t,e[t])}))}return this}},{key:"removeAttr",value:function(e){return this.el.removeAttribute(e),this}},{key:"sanitizeHTML",value:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML}},{key:"html",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return void 0!==e?(this.el.innerHTML=t?i?this.sanitizeHTML(e).replace(/\n/g,"<br>"):this.sanitizeHTML(e):e,this):this.el.innerHTML}},{key:"val",value:function(e){return void 0!==e?(this.el.value=e,this):this.el.value}},{key:"focus",value:function(){this.el.focus()}},{key:"cssRemoveKeys",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){return e.el.style.removeProperty(t)})),this}},{key:"css",value:function(e,t){var i=this;return void 0===t&&"string"!=typeof e?(Object.keys(e).forEach((function(t){i.el.style[t]=e[t]})),this):void 0!==t?(this.el.style[e]=t,this):this.el.style[e]}},{key:"computedStyle",value:function(){return window.getComputedStyle(this.el,null)}},{key:"show",value:function(){return this.css("display","block"),this}},{key:"hide",value:function(){return this.css("display","none"),this}}]),e}(),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new u(e,t)},d=i(6),m=i.n(d),g=(i(20),["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]);function v(e){for(var t="",i=e;i>=g.length;)i/=g.length,i-=1,t+=g[parseInt(i,10)%g.length];return t+=g[e%g.length]}function p(e){for(var t=0,i=0;i<e.length-1;i+=1){var n=e.charCodeAt(i)-65,r=e.length-1-i;t+=Math.pow(g.length,r)+g.length*n}return t+=e.charCodeAt(e.length-1)-65}function y(e){for(var t="",i="",n=0;n<e.length;n+=1)e.charAt(n)>="0"&&e.charAt(n)<="9"?i+=e.charAt(n):t+=e.charAt(n);return[p(t),parseInt(i,10)-1]}function b(e,t){return"".concat(v(e)).concat(t+1)}function w(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};if(0===t&&0===i)return e;var r=y(e),a=o()(r,2),s=a[0],l=a[1];return n(s,l)?b(s+t,l+i):e}var x=function(){function e(t,i,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;l()(this,e),this.sri=t,this.sci=i,this.eri=n,this.eci=r,this.w=a,this.h=o}return r()(e,[{key:"set",value:function(e,t,i,n){this.sri=e,this.sci=t,this.eri=i,this.eci=n}},{key:"setToOther",value:function(e){this.sri=e.sri,this.sci=e.sci,this.eri=e.eri,this.eci=e.eci}},{key:"multiple",value:function(){return this.eri-this.sri>0||this.eci-this.sci>0}},{key:"includes",value:function(){for(var e=0,t=0,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];if(1===n.length){var a=y(n[0]),s=o()(a,2);t=s[0],e=s[1]}else 2===n.length&&(e=n[0],t=n[1]);var l=this.sri,c=this.sci,h=this.eri,u=this.eci;return l<=e&&e<=h&&c<=t&&t<=u}},{key:"each",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=this.sri,n=this.sci,r=this.eri,a=this.eci,o=i;o<=r;o+=1)if(t(o))for(var s=n;s<=a;s+=1)e(o,s)}},{key:"emptyFirst",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},n=this.sri,r=this.sci,a=this.eri,o=this.eci,s=n;s<=a;s+=1)if(t(s)){for(var l=[],c=[],h=r;h<=o;h+=1)i(s,h)?l.push(h):c.push(h);for(var u=0;u<l.length;u++)e(s,l[u]);for(var f=0;f<c.length;f++)e(s,c[f])}}},{key:"contains",value:function(e){return this.sri<=e.sri&&this.sci<=e.sci&&this.eri>=e.eri&&this.eci>=e.eci}},{key:"within",value:function(e){return this.sri>=e.sri&&this.sci>=e.sci&&this.eri<=e.eri&&this.eci<=e.eci}},{key:"disjoint",value:function(e){return this.sri>e.eri||this.sci>e.eci||e.sri>this.eri||e.sci>this.eci}},{key:"intersects",value:function(e){return this.sri<=e.eri&&this.sci<=e.eci&&e.sri<=this.eri&&e.sci<=this.eci}},{key:"union",value:function(t){var i=this.sri,n=this.sci,r=this.eri,a=this.eci;return new e(t.sri<i?t.sri:i,t.sci<n?t.sci:n,t.eri>r?t.eri:r,t.eci>a?t.eci:a)}},{key:"extendRange",value:function(t){var i=this.sri,n=this.sci,r=this.eri,a=this.eci,o=t.eri-t.sri+1,s=t.eci-t.sci+1,l=r-i+1,c=a-n+1;return new e(i,n,i+(l<o?o:l-l%o)-1,n+(c<s?s:c-c%s)-1)}},{key:"difference",value:function(t){var i=[],n=function(t,n,r,a){i.push(new e(t,n,r,a))},r=this.sri,a=this.sci,o=this.eri,s=this.eci,l=t.sri-r,c=t.sci-a,h=o-t.eri,u=s-t.eci;return this.intersects(t)?l>0?(n(r,a,t.sri-1,s),h>0?(n(t.eri+1,a,o,s),c>0?(n(t.sri,a,t.eri,t.sci-1),u>0&&n(t.sri,t.eci+1,t.eri,s)):u>0&&n(t.sri,t.eci+1,t.eri,s)):c>0?(n(t.sri,a,o,t.sci-1),u>0&&n(t.sri,t.eci+1,o,s)):u>0&&n(t.sri,t.eci+1,o,s)):h>0?(n(t.eri+1,a,o,s),c>0?(n(r,a,t.eri,t.sci-1),u>0&&n(r,t.eci+1,t.eri,s)):u>0&&n(r,t.eci+1,t.eri,s)):c>0?(n(r,a,o,t.sci-1),u>0&&n(r,t.eci+1,o,s)):u>0&&n(r,t.eci+1,o,s):n(r,a,o,s),i}},{key:"size",value:function(){return[this.eri-this.sri+1,this.eci-this.sci+1]}},{key:"toString",value:function(){var e=this.sri,t=this.sci,i=this.eri,n=this.eci,r=b(t,e);return this.multiple()&&(r="".concat(r,":").concat(b(n,i))),r}},{key:"clone",value:function(){return new e(this.sri,this.sci,this.eri,this.eci,this.w,this.h)}},{key:"equals",value:function(e){return this.eri===e.eri&&this.eci===e.eci&&this.sri===e.sri&&this.sci===e.sci}}],[{key:"valueOf",value:function(t){var i=t.split(":"),n=y(i[0]),r=o()(n,2),a=r[0],s=r[1],l=s,c=a;if(i.length>1){var h=y(i[1]),u=o()(h,2);c=u[0],l=u[1]}return new e(s,a,l,c)}}]),e}(),k=x,C=function(){function e(){l()(this,e),this.range=new x(0,0,0,0),this.ri=0,this.ci=0}return r()(e,[{key:"multiple",value:function(){return this.range.multiple()}},{key:"setIndexes",value:function(e,t){this.ri=e,this.ci=t}},{key:"size",value:function(){return this.range.size()}}]),e}(),_=function e(){l()(this,e),this.x=0,this.y=0,this.ri=0,this.ci=0,this.riact=0},S=function(){function e(){l()(this,e),this.undoItems=[],this.redoItems=[]}return r()(e,[{key:"add",value:function(e){this.undoItems.push(JSON.stringify(e)),this.redoItems=[]}},{key:"canUndo",value:function(){return this.undoItems.length>0}},{key:"canRedo",value:function(){return this.redoItems.length>0}},{key:"undo",value:function(e,t){var i=this.undoItems,n=this.redoItems;if(this.canUndo()){var r=JSON.parse(i.pop());n.push(JSON.stringify(e(r))),t(r)}}},{key:"redo",value:function(e,t){var i=this.undoItems,n=this.redoItems;if(this.canRedo()){var r=JSON.parse(n.pop());i.push(JSON.stringify(e(r))),t(r)}}}]),e}(),T=function(){function e(){l()(this,e),this.range=null,this.state="clear",this.textdata=null}return r()(e,[{key:"copy",value:function(e,t){this.range=e,this.state="copy";for(var i=e.sri,n=e.sci,r=e.eri,a=e.eci,o="",s=i;s<=r;s+=1){if(t._[s])for(var l=n;l<=a;l+=1){if(t._[s].cells&&t._[s].cells[l]){var c=t._[s].cells[l].text;c&&(c.indexOf("\n")>=0&&(c='"'+c+'"'),o+=c)}o+="\t"}o+="\n"}return this.setData(o),this}},{key:"cut",value:function(e){return this.range=e,this.state="cut",this}},{key:"isCopy",value:function(){return"copy"===this.state}},{key:"isCut",value:function(){return"cut"===this.state}},{key:"isClear",value:function(){return"clear"===this.state}},{key:"clear",value:function(){this.range=null,this.state="clear"}},{key:"setData",value:function(e){this.textdata=e,this.copyTextToClipboard(e)}},{key:"fallbackCopyTextToClipboard",value:function(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){}document.body.removeChild(t)}},{key:"copyTextToClipboard",value:function(e){navigator.clipboard?navigator.clipboard.writeText(e).then((function(){}),(function(e){})):this.fallbackCopyTextToClipboard(e)}}]),e}(),O=function(){function e(t,i,n){l()(this,e),this.ci=t,this.operator=i,this.value=n}return r()(e,[{key:"set",value:function(e,t){this.operator=e,this.value=t}},{key:"includes",value:function(e){var t=this.operator,i=this.value;return"all"===t||"in"===t&&i.includes(e)}},{key:"vlength",value:function(){var e=this.operator,t=this.value;return"in"===e?t.length:0}},{key:"getData",value:function(){return{ci:this.ci,operator:this.operator,value:this.value}}}]),e}(),E=function(){function e(t,i){l()(this,e),this.ci=t,this.order=i}return r()(e,[{key:"asc",value:function(){return"asc"===this.order}},{key:"desc",value:function(){return"desc"===this.order}}]),e}(),R=function(){function e(){l()(this,e),this.ref=null,this.filters=[],this.sort=null}return r()(e,[{key:"setData",value:function(e){var t=e.ref,i=e.filters,n=e.sort;null!=t&&(this.ref=t,this.filters=i.map((function(e){return new O(e.ci,e.operator,e.value)})),n&&(this.sort=new E(n.ci,n.order)))}},{key:"getData",value:function(){if(this.active()){var e=this.ref,t=this.filters,i=this.sort;return{ref:e,filters:t.map((function(e){return e.getData()})),sort:i}}return{}}},{key:"addFilter",value:function(e,t,i){var n=this.getFilter(e);null==n?this.filters.push(new O(e,t,i)):n.set(t,i)}},{key:"setSort",value:function(e,t){this.sort=t?new E(e,t):null}},{key:"includes",value:function(e,t){return!!this.active()&&this.hrange().includes(e,t)}},{key:"getSort",value:function(e){var t=this.sort;return t&&t.ci===e?t:null}},{key:"getFilter",value:function(e){for(var t=this.filters,i=0;i<t.length;i+=1)if(t[i].ci===e)return t[i];return null}},{key:"filteredRows",value:function(e){var t=new Set,i=new Set;if(this.active())for(var n=this.range(),r=n.sri,a=n.eri,o=this.filters,s=r+1;s<=a;s+=1)for(var l=0;l<o.length;l+=1){var c=o[l],h=e(s,c.ci),u=h&&0!=h.text.trim().length?h.text:"";if(!c.includes(u)){t.add(s);break}i.add(s)}return{rset:t,fset:i}}},{key:"items",value:function(e,t){var i={};if(this.active())for(var n=this.range(),r=n.sri,a=n.eri,o=r+1;o<=a;o+=1){var s=t(o,e);if(null===s||/^\s*$/.test(s.text))i[""]=(i[""]||0)+1;else{var l=s.text,c=(i[l]||0)+1;i[l]=c}}return i}},{key:"range",value:function(){return x.valueOf(this.ref)}},{key:"hrange",value:function(){var e=this.range();return e.eri=e.sri,e}},{key:"clear",value:function(){this.ref=null,this.filters=[],this.sort=null}},{key:"active",value:function(){return null!==this.ref}}]),e}(),I=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l()(this,e),this._=t}return r()(e,[{key:"forEach",value:function(e){this._.forEach(e)}},{key:"deleteWithin",value:function(e){this._=this._.filter((function(t){return!t.within(e)}))}},{key:"getFirstIncludes",value:function(e,t){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(e,t))return n}return null}},{key:"filterIntersects",value:function(t){return new e(this._.filter((function(e){return e.intersects(t)})))}},{key:"intersects",value:function(e){for(var t=0;t<this._.length;t+=1){if(this._[t].intersects(e))return!0}return!1}},{key:"equals",value:function(e){for(var t=0;t<this._.length;t+=1){if(this._[t].equals(e))return!0}return!1}},{key:"union",value:function(e){var t=e;return this._.forEach((function(e){e.intersects(t)&&(t=e.union(t))})),t}},{key:"add",value:function(e){this.deleteWithin(e),this._.push(e)}},{key:"shift",value:function(e,t,i,n){this._.forEach((function(r){var a=r.sri,o=r.sci,s=r.eri,l=r.eci,c=r;"row"===e?a>=t?(c.sri+=i,c.eri+=i):a<t&&t<=s&&(c.eri+=i,n(a,o,i,0)):"column"===e&&(o>=t?(c.sci+=i,c.eci+=i):o<t&&t<=l&&(c.eci+=i,n(a,o,0,i)))}))}},{key:"move",value:function(e,t,i){this._.forEach((function(n){var r=n;r.within(e)&&(r.eri+=t,r.sri+=t,r.sci+=i,r.eci+=i)}))}},{key:"setData",value:function(e){return this._=e.map((function(e){return x.valueOf(e)})),this}},{key:"getData",value:function(){return this._.map((function(e){return e.toString()}))}},{key:"getDataForSave",value:function(){return this._.filter((function(e){return e.multiple()}))}}]),e}();var A=function e(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach((function(i){Object.keys(i).forEach((function(n){var r=i[n];"string"==typeof r||"number"==typeof r||"boolean"==typeof r?t[n]=r:"function"!=typeof r&&!Array.isArray(r)&&r instanceof Object?(t[n]=t[n]||{},e(t[n],r)):t[n]=r}))})),t};function D(e){for(var t="".concat(e),i=0,n=!1,r=0;r<t.length;r+=1)!0===n&&(i+=1),"."===t.charAt(r)&&(n=!0);return i}function P(e,t,i){if(Number.isNaN(t)||Number.isNaN(i))return t+e+i;var n=D(t),r=D(i),a=Number(t),o=Number(i),s=0;return"-"===e?s=a-o:"+"===e?s=a+o:"*"===e?s=a*o:"/"===e&&(s=a/o),s.toFixed(Math.max(n,r))}var F={cloneDeep:function(e){return JSON.parse(JSON.stringify(e))},merge:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return A.apply(void 0,[{}].concat(t))},equals:function e(t,i){var n=Object.keys(t);if(n.length!==Object.keys(i).length)return!1;for(var r=0;r<n.length;r+=1){var a=n[r],o=t[a],s=i[a];if(void 0===s)return!1;if("string"==typeof o||"number"==typeof o||"boolean"==typeof o){if(o!==s)return!1}else if(Array.isArray(o)){if(o.length!==s.length)return!1;for(var l=0;l<o.length;l+=1)if(!e(o[l],s[l]))return!1}else if("function"!=typeof o&&!Array.isArray(o)&&o instanceof Object&&!e(o,s))return!1}return!0},arrayEquals:function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i+=1)if(e[i]!==t[i])return!1;return!0},sum:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},i=0,n=0;return Object.keys(e).forEach((function(r){i+=t(e[r],r),n+=1})),[i,n]},rangeEach:function(e,t,i){for(var n=e;n<t;n+=1)i(n)},rangeSum:function(e,t,i){for(var n=0,r=e;r<t;r+=1)n+=i(r);return n},rangeReduceIf:function(e,t,i,n,r,a){for(var o=i,s=n,l=e;l<t&&!(o>r);l+=1)o+=s=a(l);return[l,o-s,s]},deleteProperty:function(e,t){var i=e["".concat(t)];return delete e["".concat(t)],i},numberCalc:P},M=function(){function e(t){var i=t.len,n=t.height;l()(this,e),this._={},this.len=i,this.height=n}return r()(e,[{key:"getHeight",value:function(e,t){if(this.isHide(e))return 0;if(t&&t.has(e))return 0;var i=this.get(e);return i&&i.height?i.height:this.height}},{key:"setHeight",value:function(e,t){this.getOrNew(e).height=t}},{key:"setInfo",value:function(e,t){var i=this.getOrNew(e);i.height=t.h,t.hide&&(i.hide=!0)}},{key:"unhide",value:function(e){for(var t=e;t>0&&(t-=1,this.isHide(t));)this.setHide(t,!1)}},{key:"isHide",value:function(e){var t=this.get(e);return t&&t.hide}},{key:"setHide",value:function(e,t){var i=this.getOrNew(e);!0===t?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(e,t){this.getOrNew(e).style=t}},{key:"sumHeight",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;return F.rangeSum(e,t,(function(e){return n&&n.has(e)?0:i.getHeight(e)}))}},{key:"totalHeight",value:function(){return this.sumHeight(0,this.len)}},{key:"get",value:function(e){return this._[e]}},{key:"getOrNew",value:function(e){return this._[e]=this._[e]||{cells:{}},this._[e]}},{key:"getCell",value:function(e,t){var i=this.get(e);return void 0!==i&&void 0!==i.cells&&void 0!==i.cells[t]?i.cells[t]:null}},{key:"getCellMerge",value:function(e,t){var i=this.getCell(e,t);return i&&i.merge?i.merge:[0,0]}},{key:"getCellOrNew",value:function(e,t){var i=this.getOrNew(e);return i.cells[t]=i.cells[t]||{},i.cells[t]}},{key:"setCell",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"all",r=this.getOrNew(e);"all"===n?r.cells[t]=i:"text"===n?(r.cells[t]=r.cells[t]||{},r.cells[t].text=i.text):"format"===n&&(r.cells[t]=r.cells[t]||{},r.cells[t].style=i.style,i.merge&&(r.cells[t].merge=i.merge))}},{key:"setCellTextBasicAct",value:function(e,t,i,n){e.text=t,n?e.f=n:delete e.f,i?e.ufv=i:delete e.ufv,e.html&&t.startsWith("<font style=")&&t.endsWith("</font>")&&(e.html=t)}},{key:"setCellText",value:function(e,t,i,n,r){var a=this.getCellOrNew(e,t);this.setCellTextBasicAct(a,i,n,r)}},{key:"setCellTextAndGetRet",value:function(e){var t=this.getCellOrNew(e.ri,e.ci);return this.setCellTextBasicAct(t,e.text,e.ufv,e.f),t.rtxt=e.rtxt,t.html=e.html,delete t.bigfontsize,t}},{key:"updateOneCell",value:function(e){return this.setCellTextAndGetRet(e)}},{key:"copyPaste",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},a=e.sri,s=e.sci,l=e.eri,c=e.eci,h=new Array,u=new Array,f=t.sri>=0?t.sri:0,d=t.sci>=0?t.sci:0,m=t.eri,g=t.eci,v=e.size(),p=o()(v,2),y=p[0],b=p[1],x=t.size(),k=o()(x,2),C=k[0],_=k[1],S=!0,T=0;(m<a||g<s)&&(S=!1,T=m<a?C:_);for(var O=a;O<=l;O+=1)for(var E=s;E<=c;E+=1)for(var R=f;R<=m;R+=y)for(var I=d;I<=g;I+=b){var A=R+(O-a),D=I+(E-s);if(A!==O||D!==E){var P=this._[O]&&this._[O].cells&&this._[O].cells[E],M=P?F.cloneDeep(this._[O].cells[E]):{};if(A!==O||D!==E){n&&M&&M.text&&M.text.length>0&&function(){var e=M.text,t=I-d+(R-f)+2;if(S||(t-=T+1),"="===e[0])M.text=e.replace(/\w{1,3}\d/g,(function(e){var i=0,n=0;return a===f?i=t-1:n=t-1,/^\d+$/.test(e)?e:w(e,i,n)}));else if(y<=1&&b>1&&(f>l||m<a)||b<=1&&y>1&&(d>c||g<s)||y<=1&&b<=1){var i=/[\\.\d]+$/.exec(e);if(null!==i){var n=Number(i[0])+t-1;M.text=e.substring(0,i.index)+n}}}();var L={ri:A,ci:D,text:M.f?M.f:M.text},j={ri:A,ci:D,ncell:M};n&&(M.f||M.ufv)||h.push(L),u.push(j)}}}for(var z=0;z<u.length;z++)this.setCell(u[z].ri,u[z].ci,u[z].ncell,i),r(u[z].ri,u[z].ci,u[z].ncell);return h}},{key:"cutPaste",value:function(e,t){var i=this,n={};this.each((function(r){i.eachCells(r,(function(a){var o=parseInt(r,10),s=parseInt(a,10);e.includes(r,a)&&(o=t.sri+(o-e.sri),s=t.sci+(s-e.sci)),n[o]=n[o]||{cells:{}},n[o].cells[s]=i._[r].cells[a],n[o].height=i._[r].height}))})),this._=n}},{key:"paste",value:function(e,t){var i=this,n=new Array;if(!(e.length<=0)){var r=t.sri,a=t.sci;return e.forEach((function(e,t){var o=r+t;e.forEach((function(e,t){var r=a+t;if(r<=1e3){i.setCellText(o,r,e);var s={ri:o,ci:r,text:e};n.push(s)}}))})),n}}},{key:"insert",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n={};this.each((function(r,a){var o=parseInt(r,10);o>=e&&(o+=i,t.eachCells(r,(function(t,n){n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(t){return w(t,0,i,(function(t,i){return i>=e}))})))}))),n[o]=a})),this._=n,this.len+=i,e>=1&&this.copyrow(e-1,i)}},{key:"copyrow",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle,r=this._[e];if(void 0!==r)for(var a=function(i){var a=t.getOrNew(e+i);a.height=r.height,t.eachCells(e,(function(e,t){a.cells[e]={},n(a.cells[e],t)}))},o=1;o<=i;o++)a(o)}},{key:"copyCellStyle",value:function(e,t){e.style=t.style,t.isautoalign&&(e.isautoalign=t.isautoalign)}},{key:"delete",value:function(e,t){var i=this,n=t-e+1,r={};this.each((function(a,o){var s=parseInt(a,10);s<e?r[s]=o:a>t&&(r[s-n]=o,i.eachCells(a,(function(e,i){i.text&&"="===i.text[0]&&(i.text=i.text.replace(/\w{1,3}\d/g,(function(e){return w(e,0,-n,(function(e,i){return i>t}))})))})))})),this._=r,this.len-=n}},{key:"insertColumn",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.copyCellStyle;this.each((function(r,a){var o={};if(t.eachCells(r,(function(t,n){var r=parseInt(t,10);r>=e&&(r+=i,n.text&&"="===n.text[0]&&(n.text=n.text.replace(/\w{1,3}\d/g,(function(t){return w(t,i,0,(function(t){return t>=e}))})))),o[r]=n})),e>=1)for(var s=1;s<=i;s++)void 0!==o[e-1]&&(o[e-1+s]={},n(o[e-1+s],o[e-1]));a.cells=o}))}},{key:"deleteColumn",value:function(e,t){var i=this,n=t-e+1;this.each((function(r,a){var o={};i.eachCells(r,(function(i,r){var a=parseInt(i,10);a<e?o[a]=r:a>t&&(o[a-n]=r,r.text&&"="===r.text[0]&&(r.text=r.text.replace(/\w{1,3}\d/g,(function(e){return w(e,-n,0,(function(e){return e>t}))}))))})),a.cells=o}))}},{key:"deleteCells",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";e.each((function(e,n){t.deleteCell(e,n,i)}))}},{key:"deleteCell",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",n=this.get(e);if(null!==n){var r=this.getCell(e,t);null!==r&&("all"===i?delete n.cells[t]:"text"===i?(r.text&&delete r.text,r.value&&delete r.value):"format"===i?(void 0!==r.style&&delete r.style,r.merge&&delete r.merge):"merge"===i&&r.merge&&delete r.merge)}}},{key:"maxCell",value:function(){var e=Object.keys(this._),t=e[e.length-1],i=this._[t];if(i){var n=i.cells,r=Object.keys(n),a=r[r.length-1];return[parseInt(t,10),parseInt(a,10)]}return[0,0]}},{key:"each",value:function(e){Object.entries(this._).forEach((function(t){var i=o()(t,2),n=i[0],r=i[1];e(n,r)}))}},{key:"eachCells",value:function(e,t){this._[e]&&this._[e].cells&&Object.entries(this._[e].cells).forEach((function(e){var i=o()(e,2),n=i[0],r=i[1];t(n,r)}))}},{key:"setData",value:function(e){e.len&&(this.len=e.len,delete e.len),void 0!==e.height&&(this.height=e.height,delete e.height),this._=e}},{key:"setRangeData",value:function(e,t){for(var i=t.sri;i<=t.eri;i++)void 0!==e[i]&&(this._[i]=e[i]),null===e[i]&&delete this._[i]}},{key:"getData",value:function(){var e=this.len,t=this.height;return Object.assign({len:e,height:t},this._)}},{key:"getRangeData",value:function(e){for(var t={},i=e.sri;i<=e.eri;i++)void 0!==this._[i]?t[i]=this._[i]:t[i]=null;return t}},{key:"getDataForRowsSet",value:function(e){var t=this,i=this.len,n=this.height,r={};return r.height=n,r.len=i,e.forEach((function(e){void 0!==t._[e]&&(r[e]=t._[e])})),r}},{key:"getHeightForSave",value:function(e){var t=this,i={};return e.forEach((function(e){void 0!==t._[e]&&(i[e]=t.getHeight(e))})),i}}]),e}(),L=function(){function e(t){var i=t.len,n=t.width,r=t.indexWidth,a=t.minWidth;l()(this,e),this._={},this.len=i,this.width=n,this.indexWidth=r,this.minWidth=a}return r()(e,[{key:"setData",value:function(e){e.len&&(this.len=e.len,delete e.len),this._=e}},{key:"getData",value:function(){var e=this.len;return Object.assign({len:e},this._)}},{key:"getDataForSave",value:function(e){var t=this,i={};return e.forEach((function(e){void 0!==t._[e]&&(i[e]=t._[e])})),i}},{key:"getWidth",value:function(e){if(this.isHide(e))return 0;var t=this._[e];return t&&t.width?t.width:this.width}},{key:"getOrNew",value:function(e){return this._[e]=this._[e]||{},this._[e]}},{key:"setWidth",value:function(e,t){this.getOrNew(e).width=t}},{key:"unhide",value:function(e){for(var t=e;t>0&&(t-=1,this.isHide(t));)this.setHide(t,!1)}},{key:"isHide",value:function(e){var t=this._[e];return t&&t.hide}},{key:"setHide",value:function(e,t){var i=this.getOrNew(e);!0===t?i.hide=!0:delete i.hide}},{key:"setStyle",value:function(e,t){this.getOrNew(e).style=t}},{key:"sumWidth",value:function(e,t){var i=this;return F.rangeSum(e,t,(function(e){return i.getWidth(e)}))}},{key:"totalWidth",value:function(){return this.sumWidth(0,this.len)}}]),e}();function j(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return z(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return z(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var B=["zh","en"],H={en:{toolbar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font",fontSize:"Font size",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Insert image"},menubar:{undo:"Undo",redo:"Redo",print:"Print",paintformat:"Paint format",clearformat:"Clear format",format:"Format",fontName:"Font name:",fontSize:"Font size:",fontBold:"Font bold",fontItalic:"Font italic",underline:"Underline",strike:"Strike",color:"Text color",bgcolor:"Fill color",border:"Borders",merge:"Merge cells",unmerge:"Unmerge cells",align:"Horizontal align",valign:"Vertical align",textwrap:"Text wrapping",freeze:"Freeze cell",autofilter:"Filter",formula:"Functions",more:"More",sort:"Sort",download:"Download",download_HTML:"Download As HTML",download_PDF:"Download As PDF",download_Original:"Download Original",download_XLSX:"Download As XLSX",download_GOOGLE:"Save To Google Drive",download_DROPBOX:"Save To Dropbox",pagination:"Pagination",search:"Search",commentDefault:"Please enter text",insertSheet:"Sheet",insertRow:"Row",insertColumn:"Column",link:"Link",insertComment:"Comment",commentEdit:"Edit comment",commentRemove:"Remove comment",commentPrevious:"Previous comment",commentNext:"Next comment",insertImage:"Image",fromURL:"From URL",fromLocal:"From Local",menuInsert:"Insert",menuComment:"Review",menuText:"Format",menuFont:"Font",menuEdit:"Home",menuFile:"File"},contextmenu:{copy:"Copy",cut:"Cut",paste:"Paste",pasteValue:"Paste values only",pasteFormat:"Paste format only",hide:"Hide",insertRow:"Insert row",insertColumn:"Insert column",deleteSheet:"Delete",deleteRow:"Delete row",deleteColumn:"Delete column",deleteCell:"Delete cell",deleteCellText:"Delete cell text",validation:"Data validations",sort:"Sort",link:"Link",removeLink:"Remove Link",editLink:"Edit Link",openLink:"Open Link",download:"Download",cellprintable:"Enable export",cellnonprintable:"Disable export",celleditable:"Enable editing",cellnoneditable:"Disable editing",insertURL:"Enter the image address",deleteImage:"Delete image",copyImage:"Copy image",pasteImage:"Paste image",merge:"Merge",unmerge:"Unmerge",edit:"Edit",clear:"Clear"},link:{emailAddress:"E-mail Address",emailSubject:"Subject",sheetPage:"Document Place",sheetCell:"Cell Reference",linkTypes:{web:"Web Page",sheet:"This Document",email:"E-mail Address"},webUrl:"Address",linkType:"Link To"},download:{fileName:"File Name",saveType:"Save As",saveTypes:{Original:"Original",XLSX:"XLSX",PDF:"PDF",HTML:"HTML"}},print:{size:"Paper size",orientation:"Page orientation",orientations:["Landscape","Portrait"]},format:{normal:"Normal",text:"Plain Text",number:"Number",percent:"Percent",rmb:"RMB",usd:"USD",eur:"EUR",date:"Date",time:"Time",datetime:"Date time",duration:"Duration"},formula:{sum:"Calculate the sum of a set of values",average:"Calculate the arithmetic mean of all parameters",max:"Calculate the maximum value in a set of numbers",min:"Calculate the smallest value in a set of numbers",_if:"According to the true or false result of the logical judgment of the specified condition, the calculation result triggered by the corresponding condition is returned",and:'Only when the results of the parameters are all logical "true", it returns logical "true", otherwise it returns logical "false"',or:'Only when all parameter values are logically "false", the result is returned as logical "false", otherwise it is returned as logical "true"',concat:"Connect multiple character text or data in cells together",count:"counts the number of cells that contain numbers, and counts numbers within the list of arguments",sumif:"Adds the cells specified by a given criteria",sumifs:"Adds the cells in a range that meet multiple criteria",vlookup:"Looks in the first column of an array and moves across the row to return the value of a cell",hlookup:"Searches for a value in the top row of a table or an array of values, and then returns a value in the same column from a row you specify in the table or array.",lookup:"Looks up values in a vector or array",match:"Looks up values in a reference or array",rank:"Returns the rank of a number in a list of numbers",frequency:"Returns a frequency distribution as a vertical array",text:"Formats a number and converts it to text",left:"Returns the leftmost characters from a text value",right:"Returns the rightmost characters from a text value",round:"Rounds a number to a specified number of digits",index:"Uses an index to choose a value from a reference or array",countif:"Counts the number of cells within a range that meet the given criteria",countifs:"Counts the number of cells within a range that meet multiple criteria",mid:"Returns a specific number of characters from a text string starting at the position you specify",len:"Returns the number of characters in a text string",power:"Returns the result of a number raised to a power",ceiling:"Rounds a number to the nearest integer or to the nearest multiple of significance",floor:"Rounds a number down, toward zero",substitute:"Substitutes new text for old text in a text string",replace:"Replaces characters within text",search:"Finds one text value within another (not case-sensitive)",find:"Finds one text value within another (case-sensitive)",isnumber:"Returns TRUE if the value is a number",istext:"Returns TRUE if the value is text",isblank:"Returns TRUE if the value is blank",upper:"Converts text to uppercase",lower:"Converts text to lowercase",product:"Multiplies its arguments",sumproduct:"Returns the sum of the products of corresponding array components",subtotal:"Returns a subtotal in a list or database",counta:"Counts how many values are in the list of arguments",averageif:"Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria",averageifs:"Returns the average (arithmetic mean) of all cells that meet multiple criteria.",trim:"Removes spaces from text",sign:"Returns the sign of a number",yield:"Returns the yield on a security that pays periodic interest",abs:"Returns the absolute value of a number",sin:"Returns the sine of the given angle",cos:"Returns the cosine of a number",tan:"Returns the tangent of a number"},validation:{required:"it must be required",notMatch:"it not match its validation rule",between:"it is between {} and {}",notBetween:"it is not between {} and {}",notIn:"it is not in list",equal:"it equal to {}",notEqual:"it not equal to {}",lessThan:"it less than {}",lessThanEqual:"it less than or equal to {}",greaterThan:"it greater than {}",greaterThanEqual:"it greater than or equal to {}",downloadImageFail:"download image fail"},error:{pasteForMergedCell:"Unable to do this for merged cells"},calendar:{weeks:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},button:{add:"Add",del:"Delete",next:"Next",cancel:"Cancel",remove:"Remove",save:"Save",ok:"OK",previous:"Previous",close:"Close"},sort:{desc:"Sort Z -> A",asc:"Sort A -> Z"},filter:{empty:"empty"},dataValidation:{mode:"Mode",range:"Cell Range",criteria:"Criteria",modeType:{cell:"Cell",column:"Column",row:"Row"},type:{list:"List",number:"Number",date:"Date",phone:"Phone",email:"Email"},operator:{be:"between",nbe:"not between",lt:"less than",lte:"less than or equal to",gt:"greater than",gte:"greater than or equal to",eq:"equal to",neq:"not equal to"}},dataSort:{ci:"Range",criteria:"Order",casesense:"Case Sensitive",sortby:"Sort by",header:"My data has headers",msg:"Please select diffrent columns for sort by fields",msg2:"The select range has merge areas,we do not support sort on merge areas ",order:{asc:"ASC",desc:"DESC"}},dataSearch:{label:"Find what",lkinlb:"Look in",matchwhole:"Match entire contents",lookin:{values:"Values",formulas:"Formulas",comments:"Comments"}},dataComment:{label:"Comment"}},de:{toolbar:{undo:"Rückgängig machen",redo:"Wiederholen",print:"Drucken",paintformat:"Format Maler",clearformat:"übersichtliches Format",format:"Datei Format",fontName:"Schriftartenname",fontSize:"Schriftgröße",fontBold:"fette Schriftart",fontItalic:"Schriftart kursiv",underline:"unterstreichen",strike:"durchgestrichen",color:"Textfarbe",bgcolor:"Füllfarbe",border:"rahmen",merge:"Zellen verbinden",unmerge:"Zellen trennen",align:"Horizontale Ausrichtung",valign:"Vertikale Ausrichtung",textwrap:"Zeilenumbruch",freeze:"feste Ränge",autofilter:"Filter",formula:"Formel",more:"Mehr",sort:"Einstufung",download:"herunterladen",pagination:"Paging",search:"suchen",commentDefault:"Bitte Text eingeben",commentEdit:"Kommentare bearbeiten",commentRemove:"Kommentar löschen",commentPrevious:"Vorheriger Kommentar",commentNext:"nächster Kommentar",insertImage:"Bild einfügen"},menubar:{undo:"rückgängig machen",redo:"wiederholen",print:"Drucken",paintformat:"Format Maler",clearformat:"übersichtliches Format",format:"Datei Format",fontName:"Schriftartenname:",fontSize:"Schriftgröße:",fontBold:"fette Schriftart",fontItalic:"Schriftart kursiv",underline:"unterstreichen",strike:"durchgestrichen",color:"Textfarbe",bgcolor:"Füllfarbe",border:"rahmen",merge:"Zellen verbinden",unmerge:"Zellen trennen",align:"Horizontale Ausrichtung",valign:"Vertikale Ausrichtung",textwrap:"Zeilenumbruch",freeze:"feste Ränge",autofilter:"Filter",formula:"Formel",more:"Mehr",sort:"Einstufung",download:"herunterladen",download_HTML:"Als HTML herunterladen",download_PDF:"Als PDF herunterladen",download_Original:"Original herunterladen",download_XLSX:"Als XLSX herunterladen",download_GOOGLE:"Auf Google Drive speichern",download_DROPBOX:"In Dropbox speichern",pagination:"Paging",search:"suchen",commentDefault:"Bitte Text eingeben",insertSheet:"Arbeitsblatt einfügen",insertRow:"Zeile einfügen",insertColumn:"Spalte einfügen",link:"Verknüpfung",insertComment:"einen Kommentar hinzufügen",commentEdit:"Kommentare bearbeiten",commentRemove:"Kommentar löschen",commentPrevious:"Vorheriger Kommentar",commentNext:"nächster Kommentar",insertImage:"Bild einfügen",fromURL:"von URL",fromLocal:"von lokal",menuInsert:"ergänzen",menuComment:"Überprüfen",menuText:"Format",menuFont:"Schriftart",menuEdit:"Titelseite",menuFile:"dokumentieren"},contextmenu:{copy:"Kopieren",cut:"schneiden",paste:"Paste",pasteValue:"Fügen Sie nur den Wert ein",pasteFormat:"Nur Formatierung einfügen",hide:"verstecken",insertRow:"Zeile einfügen",insertColumn:"Spalte einfügen",deleteSheet:"Blatt löschen",deleteRow:"Zeile löschen",deleteColumn:"Spalte löschen",deleteCell:"Zelle löschen",deleteCellText:"Zelltext löschen",validation:"Datenüberprüfung",sort:"Einstufung",link:"Verknüpfung",removeLink:"Link löschen",editLink:"Link bearbeiten",openLink:"Verbindung öffnen",download:"herunterladen",cellprintable:"Export aktivieren",cellnonprintable:"Export deaktivieren",celleditable:"Bearbeitung aktivieren",cellnoneditable:"Bearbeitung deaktivieren",insertURL:"Bildadresse eingeben",deleteImage:"Foto löschen",copyImage:"Bild kopieren",pasteImage:"Bild einfügen",merge:"verschmelzen",unmerge:"aufheben",edit:"bearbeiten",clear:"zu löschen"},link:{emailAddress:"Email",emailSubject:"Thema",sheetPage:"Speicherort",sheetCell:"Zellbezug",linkTypes:{web:"Website",sheet:"Diese Datei",email:"Email"},webUrl:"URL",linkType:"Linktyp"},download:{fileName:"Dateinamen",saveType:"Speichern als",saveTypes:{Original:"Originalformat",XLSX:"XLSX-Format",PDF:"PDF-Format",HTML:"HTML-Format"}},print:{size:"Papier größe",orientation:"Seitenausrichtung",orientations:["Horizontal, Vertikal"]},format:{normal:"normal",text:"Klartext",number:"Nummer",percent:"Prozentsatz",rmb:"Renminbi",usd:"Dollar",eur:"EUR",date:"Datum",time:"Zeit",datetime:"Terminzeit",duration:"Zeitraum"},formula:{sum:"Berechnet die Summe einer Reihe von Werten",average:"Berechnet das arithmetische Mittel aller Parameter",max:"Berechnet den Maximalwert in einer Reihe von Ziffern",min:"Berechnet den kleinsten Wert in einer Reihe von Ziffern",_if:"Je nachdem, ob das Ergebnis der logischen Beurteilung der angegebenen Bedingung wahr oder falsch ist, geben Sie das Berechnungsergebnis zurück, das durch die entsprechende Bedingung ausgelöst wurde",and:"Es gibt nur logisch „wahr“ zurück, wenn die Ergebnisse der Parameter beide logisch „wahr“ sind, andernfalls gibt es logisch „falsch“ zurück.",or:"Das Ergebnis wird nur dann als logisch „falsch“ zurückgegeben, wenn alle Parameterwerte logisch „falsch“ sind, ansonsten wird logisch „wahr“ zurückgegeben.",concat:"Mehreren Zeichentext oder Daten in Zellen miteinander verbinden",count:"zählt die Anzahl der Zellen, die Zahlen enthalten, und zählt Zahlen in der Liste der Argumente",sumif:"Fügt die durch ein bestimmtes Kriterium spezifizierten Zellen hinzu",sumifs:"Fügt die Zellen in einem Bereich hinzu, die mehrere Kriterien erfüllen",vlookup:"Sucht in der ersten Spalte eines Arrays und bewegt sich über die Zeile, um den Wert einer Zelle zurückzugeben",hlookup:"Sucht nach einem Wert in der obersten Zeile einer Tabelle oder einem Array von Werten und gibt dann einen Wert in derselben Spalte aus einer Zeile zurück, die Sie in der Tabelle oder dem Array angeben.",lookup:"Schlägt Werte in einem Vektor oder Array nach",match:"Schlägt Werte in einer Referenz oder einem Array nach",rank:"Gibt den Rang einer Zahl in einer Liste von Zahlen zurück",frequency:"Gibt eine Häufigkeitsverteilung als vertikales Array zurück",text:"Formatiert eine Zahl und wandelt sie in Text um",left:"Gibt die Zeichen ganz links von einem Textwert zurück",right:"Gibt die Zeichen ganz rechts von einem Textwert zurück",round:"Rundet eine Zahl auf eine bestimmte Anzahl von Stellen",index:"Verwendet einen Index, um einen Wert aus einer Referenz oder einem Array auszuwählen",countif:"Zählt die Anzahl der Zellen innerhalb eines Bereichs, die die angegebenen Kriterien erfüllen",countifs:"Zählt die Anzahl der Zellen innerhalb eines Bereichs, die mehrere Kriterien erfüllen",mid:"Gibt eine bestimmte Anzahl von Zeichen aus einer Textzeichenfolge zurück, beginnend an der von Ihnen angegebenen Position",len:"Gibt die Anzahl der Zeichen in einer Textzeichenfolge zurück",power:"Gibt das Ergebnis einer potenzierten Zahl zurück",ceiling:"Rundet eine Zahl auf die nächste ganze Zahl oder auf das nächste Vielfache der Wertigkeit",floor:"Rundet eine Zahl ab, gegen Null",substitute:"Ersetzt alten Text in einer Textzeichenfolge durch neuen Text",replace:"Ersetzt Zeichen im Text",search:"Sucht einen Textwert innerhalb eines anderen (Groß- und Kleinschreibung wird nicht beachtet)",find:"Sucht einen Textwert in einem anderen (Groß-/Kleinschreibung beachten)",isnumber:"Gibt TRUE zurück, wenn der Wert eine Zahl ist",istext:"Gibt TRUE zurück, wenn der Wert Text ist",isblank:"Gibt TRUE zurück, wenn der Wert leer ist",upper:"Konvertiert Text in Großbuchstaben",lower:"Konvertiert Text in Kleinbuchstaben",product:"Multipliziert seine Argumente",sumproduct:"Gibt die Summe der Produkte der entsprechenden Array-Komponenten zurück",subtotal:"Gibt eine Zwischensumme in einer Liste oder Datenbank zurück",counta:"Zählt, wie viele Werte in der Liste der Argumente sind",averageif:"Gibt den Durchschnitt (arithmetisches Mittel) aller Zellen in einem Bereich zurück, die ein bestimmtes Kriterium erfüllen",averageifs:"Gibt den Durchschnitt (arithmetisches Mittel) aller Zellen zurück, die mehrere Kriterien erfüllen.",trim:"Entfernt Leerzeichen aus Text",sign:"Gibt das Vorzeichen einer Zahl zurück",yield:"Gibt die Rendite eines Wertpapiers zurück, das periodisch Zinsen zahlt",abs:"Gibt den Absolutwert einer Zahl zurück",sin:"Gibt den Sinus des angegebenen Winkels zurück",cos:"Gibt den Kosinus einer Zahl zurück",tan:"Gibt den Tangens einer Zahl zurück"},validation:{required:"es muss erforderlich sein",notMatch:"es entspricht nicht seinen Validierungsregeln",between:"Es liegt zwischen {} und {}",notBetween:"es liegt nicht zwischen {} und {}",notIn:"es ist nicht in der liste",equal:"es ist gleich {}",notEqual:"es ist nicht gleich {}",lessThan:"es ist kleiner als {}",lessThanEqual:"es ist kleiner oder gleich {}",greaterThan:"es ist größer als {}",greaterThanEqual:"es ist größer oder gleich {}",downloadImageFail:"Bild konnte nicht heruntergeladen werden"},error:{pasteForMergedCell:"Dieser Vorgang kann nicht für verbundene Zellen ausgeführt werden"},calendar:{weeks:["Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag"],months:["Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember"]},button:{add:"ergänzen",del:"löschen",next:"Nächste",cancel:"Stornieren",remove:"entfernen",save:"speichern",ok:"bestätigen",previous:"Vorherige",close:"Schließung"},sort:{desc:"Z->A sortieren",asc:"A->Z sortieren"},filter:{empty:"leer"},dataValidation:{mode:"Modell",range:"Zellbereich",criteria:"Standard",modeType:{cell:"Einzelzelle",column:"Spalte",row:"Linie"},type:{list:"Liste",number:"Ziffer",date:"Datum",phone:"Telefon",email:"Email"},operator:{be:"zwischen",nbe:"nicht zwischen",lt:"weniger als",lte:"Gleich oder kleiner als",gt:"mehr als die",gte:"größer als oder gleich wie",eq:"gleich",neq:"Nicht gleichzusetzen mit"}},dataSort:{ci:"Umfang",criteria:"Befehl",casesense:"Groß- und Kleinschreibung beachten",sortby:"Sortieren nach",header:"Titel",msg:"Bitte wählen Sie eine andere Spalte sortiert nach Feld",msg2:"Der Auswahlbereich hat einen zusammengeführten Bereich, wir unterstützen das Sortieren des zusammengeführten Bereichs nicht",order:{asc:"Positive Folge",desc:"umgekehrte Reihenfolge"}},dataSearch:{label:"Inhalt finden",lkinlb:"Suchbereich",matchwhole:"entspricht dem gesamten Inhalt",lookin:{values:"Text",formulas:"Formel",comments:"Anmerkung"}},dataComment:{label:"Anmerkung"}},nl:{toolbar:{undo:"herroepen",redo:"opnieuw doen",print:"Afdrukken",paintformat:"Formaat schilder",clearformat:"duidelijk formaat",format:"Data formaat",fontName:"lettertype naam",fontSize:"lettertypegrootte",fontBold:"Lettertype vetgedrukt",fontItalic:"lettertype cursief",underline:"onderstrepen",strike:"doorhalen",color:"tekst kleur",bgcolor:"opvulkleur",border:"kader",merge:"Cellen samenvoegen",unmerge:"cellen samenvoegen",align:"Horizontale uitlijning",valign:"verticale uitlijning",textwrap:"woordomslag",freeze:"vaste rangen",autofilter:"filter",formula:"formule",more:"Meer",sort:"Classificatie",download:"downloaden",pagination:"paging",search:"zoekopdracht",commentDefault:"voer a.u.b. tekst in",commentEdit:"opmerkingen bewerken",commentRemove:"opmerking verwijderen",commentPrevious:"Vorige opmerking",commentNext:"volgende opmerking",insertImage:"plaatje invoegen"},menubar:{undo:"ongedaan maken",redo:"opnieuw doen",print:"Afdrukken",paintformat:"Formaat schilder",clearformat:"duidelijk formaat",format:"Data formaat",fontName:"Lettertype naam:",fontSize:"lettertypegrootte:",fontBold:"Lettertype vetgedrukt",fontItalic:"lettertype cursief",underline:"onderstrepen",strike:"doorhalen",color:"tekst kleur",bgcolor:"opvulkleur",border:"kader",merge:"Cellen samenvoegen",unmerge:"cellen samenvoegen",align:"Horizontale uitlijning",valign:"verticale uitlijning",textwrap:"woordomslag",freeze:"vaste rangen",autofilter:"filter",formula:"formule",more:"Meer",sort:"Classificatie",download:"downloaden",download_HTML:"Downloaden als HTML",download_PDF:"Downloaden als PDF",download_Original:"origineel downloaden",download_XLSX:"Downloaden als XLSX",download_GOOGLE:"Opslaan in Google Drive",download_DROPBOX:"Sla op in Dropbox",pagination:"paging",search:"zoekopdracht",commentDefault:"voer a.u.b. tekst in",insertSheet:"werkblad invoegen",insertRow:"rij invoegen",insertColumn:"kolom invoegen",link:"koppeling",insertComment:"Voeg commentaar toe",commentEdit:"opmerkingen bewerken",commentRemove:"opmerking verwijderen",commentPrevious:"Vorige opmerking",commentNext:"volgende opmerking",insertImage:"plaatje invoegen",fromURL:"van URL",fromLocal:"van lokaal",menuInsert:"Optellen bij",menuComment:"Rekening",menuText:"Formaat",menuFont:"lettertype",menuEdit:"voorpagina",menuFile:"document"},contextmenu:{copy:"kopiëren",cut:"snijden",paste:"Plakken",pasteValue:"Plak alleen de waarde",pasteFormat:"Alleen opmaak plakken",hide:"verbergen",insertRow:"rij invoegen",insertColumn:"kolom invoegen",deleteSheet:"blad verwijderen",deleteRow:"Verwijder rij",deleteColumn:"kolom verwijderen",deleteCell:"cel verwijderen",deleteCellText:"celtekst verwijderen",validation:"gegevens verificatie",sort:"Classificatie",link:"koppeling",removeLink:"koppeling verwijderen",editLink:"koppeling bewerken",openLink:"open link",download:"downloaden",cellprintable:"export inschakelen",cellnonprintable:"export uitschakelen",celleditable:"bewerking inschakelen",cellnoneditable:"bewerking uitschakelen",insertURL:"Voer het afbeeldingsadres in",deleteImage:"foto verwijderen",copyImage:"foto kopiëren",pasteImage:"foto plakken",merge:"samenvoegen",unmerge:"ongedaan maken",edit:"bewerking",clear:"wissen"},link:{emailAddress:"E-mailen",emailSubject:"thema",sheetPage:"bestandslocatie",sheetCell:"celverwijzing",linkTypes:{web:"webpagina",sheet:"dit bestand",email:"E-mailen"},webUrl:"url",linkType:"koppelingstype"},download:{fileName:"bestandsnaam",saveType:"Opslaan als",saveTypes:{Original:"origineel formaat",XLSX:"XLSX-formaat",PDF:"PDF-formaat",HTML:"HTML-indeling"}},print:{size:"papiergrootte",orientation:"paginaoriëntatie",orientations:["horizontaal verticaal"]},format:{normal:"normaal",text:"platte tekst",number:"nummer",percent:"percentage",rmb:"RMB",usd:"Dollar",eur:"EUR",date:"datum",time:"tijd",datetime:"datum Tijd",duration:"periode"},formula:{sum:"Berekent de som van een reeks waarden",average:"Berekent het rekenkundig gemiddelde van alle parameters",max:"Berekent de maximale waarde in een reeks cijfers",min:"Berekent de kleinste waarde in een reeks cijfers",_if:"Volgens het logische oordeel is het resultaat van de opgegeven voorwaarde waar of onwaar, retourneert u het berekeningsresultaat dat wordt geactiveerd door de overeenkomstige voorwaarde",and:'Het retourneert alleen logisch "true" als de resultaten van de parameters beide logisch "true" zijn, anders retourneert het logisch "false"',or:'Het resultaat wordt alleen als logisch "false" geretourneerd als alle parameterwaarden logisch "false" zijn, anders wordt het logisch "true" geretourneerd',concat:"Forbind tekst eller data med flere tegn i celler sammen",count:"tæller antallet af celler, der indeholder tal, og tæller tal inden for listen over argumenter",sumif:"Tilføjer de celler, der er specificeret af et givet kriterium",sumifs:"Tilføjer cellerne i et område, der opfylder flere kriterier",vlookup:"Ser i den første kolonne i en matrix og bevæger sig hen over rækken for at returnere værdien af en celle",hlookup:"Søger efter en værdi i den øverste række af en tabel eller en matrix af værdier og returnerer derefter en værdi i den samme kolonne fra en række, du angiver i tabellen eller matrixen.",lookup:"Søger værdier i en vektor eller et array",match:"Søger værdier i en reference eller et array",rank:"Gengiver rangeringen af et tal i en liste over tal",frequency:"Returnerer en frekvensfordeling som en vertikal matrix",text:"Formater et tal og konverterer det til tekst",left:"Returnerer tegnene længst til venstre fra en tekstværdi",right:"Returnerer tegnene længst til højre fra en tekstværdi",round:"Runder et tal til et bestemt antal cifre",index:"Bruger et indeks til at vælge en værdi fra en reference eller et array",countif:"Tæller antallet af celler inden for et område, der opfylder de givne kriterier",countifs:"Tæller antallet af celler inden for et område, der opfylder flere kriterier",mid:"Returnerer et bestemt antal tegn fra en tekststreng, der starter på den position, du angiver",len:"Returnerer antallet af tegn i en tekststreng",power:"Returnerer resultatet af et tal hævet til en potens",ceiling:"Runder et tal til det nærmeste heltal eller til det nærmeste multiplum af betydning",floor:"Runder et tal nedad mod nul",substitute:"Erstatter ny tekst med gammel tekst i en tekststreng",replace:"Erstatter tegn i tekst",search:"Finder en tekstværdi i en anden (ikke skelner mellem store og små bogstaver)",find:"Finder en tekstværdi i en anden (forskel på store og små bogstaver)",isnumber:"Returnerer SAND, hvis værdien er et tal",istext:"Returnerer TRUE, hvis værdien er tekst",isblank:"Returnerer SAND, hvis værdien er tom",upper:"Konverterer tekst til store bogstaver",lower:"Konverterer tekst til små bogstaver",product:"Multiplicerer sine argumenter",sumproduct:"Returnerer summen af produkterne af tilsvarende array-komponenter",subtotal:"Returnerer en subtotal i en liste eller database",counta:"Tæller, hvor mange værdier der er på listen over argumenter",averageif:"Returnerer gennemsnittet (aritmetisk middelværdi) af alle celler i et område, der opfylder et givet kriterium",averageifs:"Returnerer gennemsnittet (aritmetisk middelværdi) af alle celler, der opfylder flere kriterier.",trim:"Fjerner mellemrum fra tekst",sign:"Returnerer tegnet på et tal",yield:"Gengiver afkastet på et værdipapir, der betaler periodisk rente",abs:"Returnerer den absolutte værdi af et tal",sin:"Returnerer sinus for den givne vinkel",cos:"Returnerer cosinus af et tal",tan:"Returnerer tangens af et tal"},validation:{required:"het moet verplicht zijn",notMatch:"het komt niet overeen met de validatieregels",between:"Het is tussen {} en {}",notBetween:"het is niet tussen {} en {}",notIn:"het staat niet in de lijst",equal:"het is gelijk aan {}",notEqual:"het is niet gelijk aan {}",lessThan:"het is minder dan {}",lessThanEqual:"het is kleiner dan of gelijk aan {}",greaterThan:"het is groter dan {}",greaterThanEqual:"het is groter dan of gelijk aan {}",downloadImageFail:"Kan de afbeelding niet downloaden"},error:{pasteForMergedCell:"Kan deze bewerking niet uitvoeren op samengevoegde cellen"},calendar:{weeks:["Zondag maandag dinsdag woensdag donderdag vrijdag zaterdag"],months:["Januari, februari, maart, april, mei, juni, juli, augustus, september, oktober, november, december"]},button:{add:"Optellen bij",del:"verwijderen",next:"Volgende",cancel:"Annuleren",remove:"verwijderen",save:"redden ",ok:"bevestigen",previous:"Vorig",close:"sluiting"},sort:{desc:"Sorteer Z->A",asc:"Sorteer A->Z"},filter:{empty:"leeg"},dataValidation:{mode:"model",range:"cel bereik",criteria:"standaard",modeType:{cell:"eencellig",column:"kolom",row:"lijn"},type:{list:"lijst",number:"cijfer",date:"datum",phone:"Telefoon",email:"e-mailen"},operator:{be:"tussen",nbe:"niet tussen",lt:"minder dan",lte:"minder dan of gelijk aan",gt:"meer dan de",gte:"groter dan of gelijk aan",eq:"gelijkwaardig",neq:"niet gelijk aan"}},dataSort:{ci:"domein",criteria:"volgorde",casesense:"hoofdlettergevoelig",sortby:"sorteer op",header:"titel",msg:"Kies een andere kolom gesorteerd op veld",msg2:"Het selectiegebied heeft een samengevoegd gebied, we ondersteunen het sorteren van het samengevoegde gebied niet",order:{asc:"Positieve volgorde",desc:"omgekeerde volgorde"}},dataSearch:{label:"inhoud vinden",lkinlb:"zoek bereik",matchwhole:"komt overeen met de volledige inhoud",lookin:{values:"tekst",formulas:"formule",comments:"annotatie"}},dataComment:{label:"annotatie"}},zh:{toolbar:{undo:"撤消",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体名称",fontSize:"字体大小",fontBold:"字体粗体",fontItalic:"字体斜体",underline:"下划线",strike:"删除线",color:"文字颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",unmerge:"取消合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"文字换行",freeze:"固定行列",autofilter:"过滤器",formula:"公式",more:"更多",sort:"分类",download:"下载",pagination:"分页",search:"搜索",commentDefault:"请输入文字",commentEdit:"编辑批注",commentRemove:"删除批注",commentPrevious:"上一条批注",commentNext:"下一条批注",insertImage:"插入图片"},menubar:{undo:"撤消",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"数据格式",fontName:"字体名称:",fontSize:"字体大小:",fontBold:"字体粗体",fontItalic:"字体斜体",underline:"下划线",strike:"删除线",color:"文字颜色",bgcolor:"填充颜色",border:"边框",merge:"合并单元格",unmerge:"取消合并单元格",align:"水平对齐",valign:"垂直对齐",textwrap:"文字换行",freeze:"固定行列",autofilter:"过滤器",formula:"公式",more:"更多",sort:"分类",download:"下载",download_HTML:"下载为HTML",download_PDF:"下载为PDF",download_Original:"下载原件",download_XLSX:"下载为XLSX",download_GOOGLE:"保存至GoogleDrive",download_DROPBOX:"保存至Dropbox",pagination:"分页",search:"搜索",commentDefault:"请输入文字",insertSheet:"插入工作表",insertRow:"插入行",insertColumn:"插入列",link:"连接",insertComment:"添加批注",commentEdit:"编辑批注",commentRemove:"删除批注",commentPrevious:"上一条批注",commentNext:"下一条批注",insertImage:"插入图片",fromURL:"来自URL",fromLocal:"来自本地",menuInsert:"添加",menuComment:"查看",menuText:"格式",menuFont:"字体",menuEdit:"首页",menuFile:"文件"},contextmenu:{copy:"复制",cut:"剪切",paste:"粘贴",pasteValue:"仅粘贴值",pasteFormat:"仅粘贴格式",hide:"隐藏",insertRow:"插入行",insertColumn:"插入列",deleteSheet:"删去工作表",deleteRow:"删除行",deleteColumn:"删除列",deleteCell:"删除储存格",deleteCellText:"删除储存格文字",validation:"数据验证",sort:"分类",link:"连接",removeLink:"删除连接",editLink:"编辑连接",openLink:"打开连接",download:"下载",cellprintable:"启用导出",cellnonprintable:"禁用导出",celleditable:"启用编辑",cellnoneditable:"禁用编辑",insertURL:"输入图像地址",deleteImage:"删除图片",copyImage:"复制图片",pasteImage:"粘贴图片",merge:"合并",unmerge:"取消合并",edit:"编辑",clear:"清除"},link:{emailAddress:"电子邮箱",emailSubject:"主题",sheetPage:"档案位置",sheetCell:"储存格引用",linkTypes:{web:"网页",sheet:"本档案",email:"电子邮箱"},webUrl:"网址",linkType:"连接类型"},download:{fileName:"文档名称",saveType:"另存为",saveTypes:{Original:"原格式",XLSX:"XLSX格式",PDF:"PDF格式",HTML:"HTML格式"}},print:{size:"纸张大小",orientation:"页面方向",orientations:["横向,纵向"]},format:{normal:"普通",text:"纯文字",number:"数字",percent:"百分比",rmb:"人民币",usd:"美元",eur:"欧元",date:"日期",time:"时间",datetime:"日期时间",duration:"期间"},formula:{sum:"计算一组值的总和",average:"计算所有参数的算术平均值",max:"计算一组数位中的最大值",min:"计算一组数位中的最小值",_if:"根据指定条件的逻辑判断结果的真或假,返回相应条件触发的计算结果",and:"只有当参数的结果都是逻辑“true”时,它才会返回逻辑“true”,否则返回逻辑“false”",or:"只有当所有参数值在逻辑上都为“false”时,结果才返回为逻辑“false”,否则返回为逻辑上的“true”",concat:"将单元格中的多个字符文本或数据连接在一起",count:"计算包含数字的单元格数量,并计算参数列表中的数字",sumif:"添加给定条件指定的单元格",sumifs:"添加满足多个条件的范围内的单元格",vlookup:"查看数组的第一列并跨行移动以返回单元格的值",hlookup:"在表的第一行或值数组中搜索一个值,然后从您在表或数组中指定的行的同一列中返回一个值",lookup:"在向量或数组中查找值",match:"在引用或数组中查找值",rank:"返回一个数字在数字列表中的排名",frequency:"以垂直数组形式返回频率分布",text:"格式化数字并将其转换为文本",left:"返回文本值最左边的字符",right:"返回文本值中最右边的字符",round:"将数字四舍五入到指定位数",index:"使用索引从引用或数组中选择一个值",countif:"计算范围内满足给定条件的单元格数",countifs:"计算范围内满足多个条件的单元格数",mid:"从指定位置开始的文本字符串中返回特定数量的字符",len:"返回文本字符串中的字符数",power:"返回一个数的幂的结果",ceiling:"将数字四舍五入到最接近的整数或最接近的有效倍数",floor:"将数字向下舍入为零",substitute:"用新文本替换文本字符串中的旧文本",replace:"替换文本中的字符",search:"在另一个文本值中查找一个文本值(不区分大小写)",find:"在一个文本值中查找另一个文本值(区分大小写)",isnumber:"如果值为数字则返回 TRUE",istext:"如果值为文本则返回 TRUE",isblank:"如果值为空则返回 TRUE",upper:"将文本转换为大写",lower:"将文本转换为小写",product:"乘以它的论点",sumproduct:"返回对应数组元素的乘积之和",subtotal:"返回列表或数据库中的小计",counta:"计算参数列表中有多少个值",averageif:"返回范围内满足给定条件的所有单元格的平均值(算术平均值)",averageifs:"返回满足多个条件的所有单元格的平均值(算术平均值)。",trim:"从文本中删除空格",sign:"返回数字的符号",yield:"返回支付定期利息的证券的收益率",abs:"返回数字的绝对值",sin:"返回给定角度的正弦值",cos:"返回数字的余弦值",tan:"返回数字的正切"},validation:{required:"它必须是必需的",notMatch:"它与其验证规则不匹配",between:"它介于{}和{}之间",notBetween:"它不在{}和{}之间",notIn:"它不在清单中",equal:"它等于{}",notEqual:"它不等于{}",lessThan:"它小于{}",lessThanEqual:"它小于或等于{}",greaterThan:"它大于{}",greaterThanEqual:"它大于或等于{}",downloadImageFail:"下载图像失败"},error:{pasteForMergedCell:"无法对合并的储存格执行此操作"},calendar:{weeks:["周日、周一、周二、周三、周四、周五、周六"],months:["一月、二月、三月、四月、五月、六月、七月、八月、九月、十月、十一月、十二月"]},button:{add:"添加",del:"删除",next:"下一个",cancel:"取消",remove:"去除",save:"保存",ok:"确认",previous:"前一个",close:"关闭"},sort:{desc:"排序Z->A",asc:"排序A->Z"},filter:{empty:"空的"},dataValidation:{mode:"模式",range:"储存格范围",criteria:"标准",modeType:{cell:"单间牢房",column:"柱",row:"一行"},type:{list:"清单",number:"数位",date:"日期",phone:"电话",email:"电子邮件"},operator:{be:"之间",nbe:"不介于",lt:"少于",lte:"小于或等于",gt:"大于",gte:"大于或等于",eq:"等于",neq:"不等于"}},dataSort:{ci:"范围",criteria:"顺序",casesense:"区分大小写",sortby:"排序依据",header:"标题",msg:"请选择按字段排序的不同列",msg2:"选择区域有合并区域,我们不支持对合并区域进行排序",order:{asc:"正序",desc:"逆序"}},dataSearch:{label:"查找内容",lkinlb:"查找范围",matchwhole:"匹配整个内容",lookin:{values:"文本",formulas:"公式",comments:"批注"}},dataComment:{label:"批注"}},ru:{toolbar:{undo:"отозвать",redo:"переделывать",print:"Распечатать",paintformat:"Формат Painter",clearformat:"чистый формат",format:"Формат данных",fontName:"имя шрифта",fontSize:"размер шрифта",fontBold:"шрифт полужирный",fontItalic:"курсив",underline:"подчеркнуть",strike:"зачеркнутый",color:"цвет текста",bgcolor:"Цвет заливки",border:"рамка",merge:"Объединить ячейки",unmerge:"разъединить ячейки",align:"Горизонтальное выравнивание",valign:"вертикальное выравнивание",textwrap:"перенос слова",freeze:"фиксированные ранги",autofilter:"фильтр",formula:"формула",more:"Более",sort:"Классификация",download:"скачать",pagination:"пейджинг",search:"поиск",commentDefault:"пожалуйста, введите текст",commentEdit:"редактировать комментарии",commentRemove:"удалить комментарий",commentPrevious:"Предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"вставить картинку"},menubar:{undo:"отменить",redo:"переделывать",print:"Распечатать",paintformat:"Формат Painter",clearformat:"чистый формат",format:"Формат данных",fontName:"Название шрифта:",fontSize:"размер шрифта:",fontBold:"шрифт полужирный",fontItalic:"курсив",underline:"подчеркнуть",strike:"зачеркнутый",color:"цвет текста",bgcolor:"Цвет заливки",border:"рамка",merge:"Объединить ячейки",unmerge:"разъединить ячейки",align:"Горизонтальное выравнивание",valign:"вертикальное выравнивание",textwrap:"перенос слова",freeze:"фиксированные ранги",autofilter:"фильтр",formula:"формула",more:"Более",sort:"Классификация",download:"скачать",download_HTML:"Скачать как HTML",download_PDF:"Скачать в формате PDF",download_Original:"скачать оригинал",download_XLSX:"Скачать как XLSX",download_GOOGLE:"Сохранить на Google Диск",download_DROPBOX:"Сохранить в Dropbox",pagination:"пейджинг",search:"поиск",commentDefault:"пожалуйста, введите текст",insertSheet:"вставить рабочий лист",insertRow:"вставить строку",insertColumn:"вставить столбец",link:"связь",insertComment:"добавить комментарий",commentEdit:"редактировать комментарии",commentRemove:"удалить комментарий",commentPrevious:"Предыдущий комментарий",commentNext:"следующий комментарий",insertImage:"вставить картинку",fromURL:"из URL",fromLocal:"от местного",menuInsert:"добавить в",menuComment:"Проверять",menuText:"Формат",menuFont:"шрифт",menuEdit:"титульная страница",menuFile:"документ"},contextmenu:{copy:"копировать",cut:"вырезать",paste:"вставить",pasteValue:"Вставьте только значение",pasteFormat:"Вставить только форматирование",hide:"скрывать",insertRow:"вставить строку",insertColumn:"вставить столбец",deleteSheet:"удалить лист",deleteRow:"удалить строку",deleteColumn:"удалить столбец",deleteCell:"удалить ячейку",deleteCellText:"удалить текст ячейки",validation:"проверка данных",sort:"Классификация",link:"связь",removeLink:"удалить ссылку",editLink:"изменить ссылку",openLink:"открыть ссылку",download:"скачать",cellprintable:"включить экспорт",cellnonprintable:"отключить экспорт",celleditable:"разрешить редактирование",cellnoneditable:"отключить редактирование",insertURL:"Введите адрес изображения",deleteImage:"удалить картинку",copyImage:"копировать картинку",pasteImage:"вставить картинку",merge:"сливаться",unmerge:"разъединять",edit:"редактировать",clear:"очистить"},link:{emailAddress:"Электронная почта",emailSubject:"тема",sheetPage:"местоположение файла",sheetCell:"ссылка на ячейку",linkTypes:{web:"веб-страница",sheet:"этот файл",email:"Электронная почта"},webUrl:"URL",linkType:"тип ссылки"},download:{fileName:"имя файла",saveType:"Сохранить как",saveTypes:{Original:"исходный формат",XLSX:"XLSX-формат",PDF:"PDF-формат",HTML:"HTML-формат"}},print:{size:"размер бумаги",orientation:"ориентация страницы",orientations:["горизонтальная вертикальная"]},format:{normal:"обычный",text:"простой текст",number:"число",percent:"процент",rmb:"юаней",usd:"доллар",eur:"евро",date:"дата",time:"время",datetime:"дата время",duration:"период"},formula:{sum:"Вычисляет сумму набора значений",average:"Вычисляет среднее арифметическое всех параметров",max:"Вычисляет максимальное значение в наборе цифр",min:"Вычисляет наименьшее значение в наборе цифр",_if:"Согласно логическому заключению, результат указанного условия является истинным или ложным, вернуть результат вычисления, вызванный соответствующим условием.",and:"Он возвращает логическое «истина» только в том случае, если результаты обоих параметров являются логическими «истинами», в противном случае он возвращает логическое «ложь».",or:"Результат возвращается как логическое «ложь», только если все значения параметров являются логически «ложными», в противном случае возвращается логическое «истина».",concat:"Conecte vários caracteres de texto ou dados em células juntos",count:"conta o número de células que contêm números e conta os números dentro da lista de argumentos",sumif:"Adiciona as células especificadas por um determinado critério",sumifs:"Adiciona as células em um intervalo que atendem a vários critérios",vlookup:"Olha na primeira coluna de uma matriz e move-se pela linha para retornar o valor de uma célula",hlookup:"Procura um valor na linha superior de uma tabela ou uma matriz de valores e, em seguida, retorna um valor na mesma coluna de uma linha especificada na tabela ou matriz.",lookup:"Procura valores em um vetor ou array",match:"Procura valores em uma referência ou array",rank:"Retorna a classificação de um número em uma lista de números",frequency:"Retorna uma distribuição de frequência como uma matriz vertical",text:"Formata um número e o converte em texto",left:"Retorna os caracteres mais à esquerda de um valor de texto",right:"Retorna os caracteres mais à direita de um valor de texto",round:"Arredonda um número para um número especificado de dígitos",index:"Usa um índice para escolher um valor de uma referência ou array",countif:"Conta o número de células dentro de um intervalo que atendem aos critérios fornecidos",countifs:"Conta o número de células dentro de um intervalo que atendem a vários critérios",mid:"Retorna um número específico de caracteres de uma string de texto começando na posição que você especificar",len:"Retorna o número de caracteres em uma string de texto",power:"Retorna o resultado de um número elevado a uma potência",ceiling:"Arredonda um número para o inteiro mais próximo ou para o múltiplo de significância mais próximo",floor:"Arredonda um número para baixo, para zero",substitute:"Substitui o novo texto pelo texto antigo em uma string de texto",replace:"Substitui caracteres no texto",search:"Encontra um valor de texto dentro de outro (sem distinção entre maiúsculas e minúsculas)",find:"Encontra um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)",isnumber:"Retorna TRUE se o valor for um número",istext:"Retorna TRUE se o valor for texto",isblank:"Retorna TRUE se o valor estiver em branco",upper:"Converte o texto em letras maiúsculas",lower:"Converte o texto em minúsculas",product:"Multiplica seus argumentos",sumproduct:"Retorna a soma dos produtos dos componentes do array correspondente",subtotal:"Retorna um subtotal em uma lista ou banco de dados",counta:"Conta quantos valores estão na lista de argumentos",averageif:"Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério",averageifs:"Retorna a média (média aritmética) de todas as células que atendem a vários critérios.",trim:"Remove espaços do texto",sign:"Retorna o sinal de um número",yield:"Retorna o rendimento de um título que paga juros periódicos",abs:"Retorna o valor absoluto de um número",sin:"Retorna o seno do ângulo dado",cos:"Retorna o cosseno de um número",tan:"Retorna a tangente de um número"},validation:{required:"это должно быть необходимо",notMatch:"это не соответствует его правилам проверки",between:"Это между {} и {}",notBetween:"это не между {} и {}",notIn:"его нет в списке",equal:"он равен {}",notEqual:"это не равно {}",lessThan:"это меньше, чем {}",lessThanEqual:"меньше или равно {}",greaterThan:"это больше, чем {}",greaterThanEqual:"это больше или равно {}",downloadImageFail:"Не удалось загрузить изображение"},error:{pasteForMergedCell:"Невозможно выполнить эту операцию с объединенными ячейками"},calendar:{weeks:["Воскресенье понедельник вторник среда четверг пятница суббота"],months:["Январь, февраль, март, апрель, май, июнь, июль, август, сентябрь, октябрь, ноябрь, декабрь"]},button:{add:"добавить в",del:"удалить",next:"Следующий",cancel:"Отмена",remove:"удалять",save:"сохранять",ok:"подтверждать",previous:"Предыдущий",close:"закрытие"},sort:{desc:"Сортировать Я->А",asc:"Сортировать А->Я"},filter:{empty:"пустой"},dataValidation:{mode:"модель",range:"диапазон ячеек",criteria:"стандартный",modeType:{cell:"одна ячейка",column:"столбец",row:"линия"},type:{list:"список",number:"цифра",date:"дата",phone:"телефон",email:"электронная почта"},operator:{be:"между",nbe:"не между",lt:"меньше, чем",lte:"меньше или равно",gt:"больше, чем",gte:"больше или равно",eq:"равный",neq:"не равно"}},dataSort:{ci:"объем",criteria:"заказ",casesense:"с учетом регистра",sortby:"Сортировать по",header:"заголовок",msg:"Пожалуйста, выберите другой столбец, отсортированный по полю",msg2:"Область выбора имеет объединенную область, мы не поддерживаем сортировку объединенной области",order:{asc:"Положительная последовательность",desc:"обратный порядок"}},dataSearch:{label:"найти контент",lkinlb:"диапазон поиска",matchwhole:"соответствует всему содержимому",lookin:{values:"текст",formulas:"формула",comments:"аннотация"}},dataComment:{label:"аннотация"}},es:{toolbar:{undo:"revocar",redo:"rehacer",print:"Imprimir",paintformat:"Copiar formato",clearformat:"formato claro",format:"Formato de datos",fontName:"nombre de la fuente",fontSize:"tamaño de fuente",fontBold:"negrita",fontItalic:"letra cursiva",underline:"subrayar",strike:"tachado",color:"color de texto",bgcolor:"color de relleno",border:"marco",merge:"Combinar células",unmerge:"separar celdas",align:"Alineación horizontal",valign:"alineamiento vertical",textwrap:"ajuste de línea",freeze:"rangos fijos",autofilter:"filtrar",formula:"fórmula",more:"Más",sort:"Clasificación",download:"descargar",pagination:"paginación",search:"buscar",commentDefault:"por favor ingrese texto",commentEdit:"editar comentarios",commentRemove:"Eliminar comentario",commentPrevious:"comentario anterior",commentNext:"siguiente comentario",insertImage:"Insertar imagen"},menubar:{undo:"deshacer",redo:"rehacer",print:"Imprimir",paintformat:"Copiar formato",clearformat:"formato claro",format:"Formato de datos",fontName:"Nombre de la fuente:",fontSize:"tamaño de fuente:",fontBold:"negrita",fontItalic:"letra cursiva",underline:"subrayar",strike:"tachado",color:"color de texto",bgcolor:"color de relleno",border:"marco",merge:"Combinar células",unmerge:"separar celdas",align:"Alineación horizontal",valign:"alineamiento vertical",textwrap:"ajuste de línea",freeze:"rangos fijos",autofilter:"filtrar",formula:"fórmula",more:"Más",sort:"Clasificación",download:"Descargar",download_HTML:"Descargar como HTML",download_PDF:"Descargar como PDF",download_Original:"Descargar originales",download_XLSX:"Descargar como XLSX",download_GOOGLE:"Guardar en Google Drive",download_DROPBOX:"Guardar en dropbox",pagination:"paginación",search:"buscar",commentDefault:"por favor ingrese texto",insertSheet:"insertar hoja de trabajo",insertRow:"insertar fila",insertColumn:"insertar columna",link:"enlace",insertComment:"agregar comentario",commentEdit:"editar comentarios",commentRemove:"Eliminar comentario",commentPrevious:"comentario anterior",commentNext:"siguiente comentario",insertImage:"Insertar imagen",fromURL:"de URL",fromLocal:"del local",menuInsert:"añadir",menuComment:"Controlar",menuText:"Formato",menuFont:"fuente",menuEdit:"página delantera",menuFile:"documento"},contextmenu:{copy:"Copiar",cut:"cortar",paste:"pegar",pasteValue:"Pegar solo el valor",pasteFormat:"Pegar solo formato",hide:"esconder",insertRow:"insertar fila",insertColumn:"insertar columna",deleteSheet:"borrar hoja",deleteRow:"borrar fila",deleteColumn:"eliminar columna",deleteCell:"borrar celda",deleteCellText:"eliminar texto de celda",validation:"verificación de datos",sort:"Clasificación",link:"enlace",removeLink:"eliminar enlace",editLink:"editar enlace",openLink:"enlace abierto",download:"descargar",cellprintable:"habilitar exportar",cellnonprintable:"deshabilitar la exportación",celleditable:"permitir la edición",cellnoneditable:"deshabilitar la edición",insertURL:"Ingrese la dirección de la imagen",deleteImage:"borrar imagen",copyImage:"copiar foto",pasteImage:"pegar foto",merge:"unir",unmerge:"desunir",edit:"editar",clear:"limpiar"},link:{emailAddress:"Correo electrónico",emailSubject:"tema",sheetPage:"ubicación del archivo",sheetCell:"referencia de celda",linkTypes:{web:"Página web",sheet:"Este archivo",email:"Correo electrónico"},webUrl:"URL",linkType:"Tipo de enlace"},download:{fileName:"Nombre del archivo",saveType:"Guardar como",saveTypes:{Original:"formato original",XLSX:"formato XLSX",PDF:"formato PDF",HTML:"formato HTML"}},print:{size:"Tamaño de papel",orientation:"orientación de la página",orientations:["horizontal Vertical"]},format:{normal:"común",text:"Texto sin formato",number:"número",percent:"porcentaje",rmb:"RMB",usd:"Dólar",eur:"EUR",date:"fecha",time:"tiempo",datetime:"fecha y hora",duration:"período"},formula:{sum:"Calcula la suma de un conjunto de valores",average:"Calcula la media aritmética de todos los parámetros",max:"Calcula el valor máximo en un conjunto de dígitos",min:"Calcula el valor más pequeño en un conjunto de dígitos",_if:"Según el resultado del juicio lógico de la condición especificada es verdadero o falso, devuelva el resultado del cálculo desencadenado por la condición correspondiente",and:'Devuelve "verdadero" lógico solo si los resultados de los parámetros son ambos "verdaderos" lógicos; de lo contrario, devuelve "falso" lógico',or:'El resultado se devuelve como lógico "falso" solo si todos los valores de los parámetros son lógicamente "falsos", de lo contrario, devuelve lógicamente "verdadero".',concat:"Conectar texto de varios caracteres o datos en celdas juntos",count:"cuenta el número de celdas que contienen números y cuenta los números dentro de la lista de argumentos",sumif:"Agrega las celdas especificadas por un criterio dado",sumifs:"Agrega las celdas en un rango que cumple con múltiples criterios",vlookup:"Busca en la primera columna de una matriz y se mueve por la fila para devolver el valor de una celda",hlookup:"Busca un valor en la fila superior de una tabla o una matriz de valores, y luego devuelve un valor en la misma columna de una fila que especifique en la tabla o matriz.",lookup:"Busca valores en un vector o matriz",match:"Busca valores en una referencia o matriz",rank:"Devuelve el rango de un número en una lista de números",frequency:"Devuelve una distribución de frecuencias como una matriz vertical",text:"Dar formato a un número y convertirlo en texto",left:"Devuelve los caracteres más a la izquierda de un valor de texto",right:"Devuelve los caracteres más a la derecha de un valor de texto",round:"Redondea un número a un número específico de dígitos",index:"Usa un índice para elegir un valor de una referencia o matriz",countif:"Cuenta el número de celdas dentro de un rango que cumple con los criterios dados",countifs:"Cuenta el número de celdas dentro de un rango que cumplen múltiples criterios",mid:"Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que especifique",len:"Devuelve el número de caracteres en una cadena de texto",power:"Devuelve el resultado de un número elevado a una potencia",ceiling:"Redondea un número al entero más cercano o al múltiplo significativo más cercano",floor:"Redondea un número hacia abajo, hacia cero",substitute:"Sustituye texto nuevo por texto antiguo en una cadena de texto",replace:"Reemplaza caracteres dentro del texto",search:"Encuentra un valor de texto dentro de otro (no distingue entre mayúsculas y minúsculas)",find:"Encuentra un valor de texto dentro de otro (distingue entre mayúsculas y minúsculas)",isnumber:"Devuelve VERDADERO si el valor es un número",istext:"Devuelve VERDADERO si el valor es texto",isblank:"Devuelve VERDADERO si el valor está en blanco",upper:"Convierte texto a mayúsculas",lower:"Convierte texto a minúsculas",product:"Multiplica sus argumentos",sumproduct:"Devuelve la suma de los productos de los componentes de matriz correspondientes",subtotal:"Devuelve un subtotal en una lista o base de datos",counta:"Cuenta cuántos valores hay en la lista de argumentos",averageif:"Devuelve el promedio (media aritmética) de todas las celdas en un rango que cumplen con un criterio dado",averageifs:"Devuelve el promedio (media aritmética) de todas las celdas que cumplen varios criterios.",trim:"Quita espacios del texto",sign:"Devuelve el signo de un número",yield:"Devuelve el rendimiento de un valor que paga intereses periódicos",abs:"Devuelve el valor absoluto de un número",sin:"Devuelve el seno del ángulo dado",cos:"Devuelve el coseno de un número",tan:"Devuelve la tangente de un número"},validation:{required:"debe ser requerido",notMatch:"no coincide con sus reglas de validación",between:"Está entre {} y {}",notBetween:"no está entre {} y {}",notIn:"no esta en la lista",equal:"es igual a {}",notEqual:"no es igual a {}",lessThan:"es menos que {}",lessThanEqual:"es menor o igual que {}",greaterThan:"es mayor que {}",greaterThanEqual:"es mayor o igual que {}",downloadImageFail:"Error al descargar la imagen"},error:{pasteForMergedCell:"No se puede realizar esta operación en celdas combinadas"},calendar:{weeks:["Domingo Lunes Martes Miércoles Jueves Viernes Sábado"],months:["Enero, febrero, marzo, abril, mayo, junio, julio, agosto, septiembre, octubre, noviembre, diciembre"]},button:{add:"añadir",del:"borrar",next:"Próximo",cancel:"Cancelar",remove:"eliminar",save:"ahorrar",ok:"confirmar",previous:"Anterior",close:"cierre"},sort:{desc:"Ordenar Z->A",asc:"Ordenar A->Z"},filter:{empty:"vacío"},dataValidation:{mode:"modelo",range:"rango de celdas",criteria:"estándar",modeType:{cell:"unicelular",column:"columna",row:"línea"},type:{list:"lista",number:"dígito",date:"fecha",phone:"Teléfono",email:"correo electrónico"},operator:{be:"entre",nbe:"no entre",lt:"menos que",lte:"Menos que o igual a",gt:"más que el",gte:"Mayor qué o igual a",eq:"igual",neq:"no igual a"}},dataSort:{ci:"alcance",criteria:"orden",casesense:"distingue mayúsculas y minúsculas",sortby:"Ordenar por",header:"título",msg:"Elija una columna diferente ordenada por campo",msg2:"El área de selección tiene un área fusionada, no admitimos ordenar el área fusionada",order:{asc:"secuencia positiva",desc:"orden inverso"}},dataSearch:{label:"encontrar contenido",lkinlb:"rango de búsqueda",matchwhole:"coincide con todo el contenido",lookin:{values:"texto",formulas:"fórmula",comments:"anotación"}},dataComment:{label:"anotación"}},pt:{toolbar:{undo:"revogar",redo:"refazer",print:"Imprimir",paintformat:"Pincel de Formatação",clearformat:"formato claro",format:"Formato de dados",fontName:"nome da fonte",fontSize:"tamanho da fonte",fontBold:"Negrito",fontItalic:"fonte em itálico",underline:"sublinhado",strike:"tachado",color:"cor do texto",bgcolor:"cor de preenchimento",border:"quadro",merge:"Mesclar Células",unmerge:"unmerge células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"quebra de linha",freeze:"fileiras fixas",autofilter:"filtro",formula:"Fórmula",more:"Mais",sort:"Classificação",download:"download",pagination:"paginação",search:"procurar",commentDefault:"por favor digite o texto",commentEdit:"editar comentários",commentRemove:"excluir comentário",commentPrevious:"comentário anterior",commentNext:"próximo comentário",insertImage:"inserir imagem"},menubar:{undo:"desfazer",redo:"refazer",print:"Imprimir",paintformat:"Pincel de Formatação",clearformat:"formato claro",format:"Formato de dados",fontName:"Nome da fonte:",fontSize:"tamanho da fonte:",fontBold:"Negrito",fontItalic:"fonte em itálico",underline:"sublinhado",strike:"tachado",color:"cor do texto",bgcolor:"cor de preenchimento",border:"quadro",merge:"Mesclar Células",unmerge:"unmerge células",align:"Alinhamento horizontal",valign:"Alinhamento vertical",textwrap:"quebra de linha",freeze:"fileiras fixas",autofilter:"filtro",formula:"Fórmula",more:"Mais",sort:"Classificação",download:"download",download_HTML:"Baixar como HTML",download_PDF:"Baixar como PDF",download_Original:"baixar original",download_XLSX:"Baixar como XLSX",download_GOOGLE:"Salvar no Google Drive",download_DROPBOX:"Salvar no Dropbox",pagination:"paginação",search:"procurar",commentDefault:"por favor digite o texto",insertSheet:"inserir planilha",insertRow:"inserir linha",insertColumn:"inserir coluna",link:"link",insertComment:"adicionar comentário",commentEdit:"editar comentários",commentRemove:"excluir comentário",commentPrevious:"comentário anterior",commentNext:"próximo comentário",insertImage:"inserir imagem",fromURL:"da URL",fromLocal:"do local",menuInsert:"adicionar à",menuComment:"Verificar",menuText:"Formatar",menuFont:"Fonte",menuEdit:"primeira página",menuFile:"documento"},contextmenu:{copy:"cópia de",cut:"cortar",paste:"colar",pasteValue:"Cole apenas o valor",pasteFormat:"Colar apenas a formatação",hide:"esconder",insertRow:"inserir linha",insertColumn:"inserir coluna",deleteSheet:"excluir folha",deleteRow:"excluir linha",deleteColumn:"excluir coluna",deleteCell:"excluir célula",deleteCellText:"excluir texto da célula",validation:"verificação de dados",sort:"Classificação",link:"link",removeLink:"excluir link",editLink:"editar link",openLink:"link aberto",download:"download",cellprintable:"habilitar exportação",cellnonprintable:"desabilitar exportação",celleditable:"habilitar a edição",cellnoneditable:"desabilitar a edição",insertURL:"Insira o endereço da imagem",deleteImage:"deletar foto",copyImage:"copiar foto",pasteImage:"colar foto",merge:"fundir",unmerge:"desagregar",edit:"editar",clear:"limpar"},link:{emailAddress:"E-mail",emailSubject:"tema",sheetPage:"localização de arquivo",sheetCell:"referência de célula",linkTypes:{web:"página da Internet",sheet:"este ficheiro",email:"E-mail"},webUrl:"url",linkType:"tipo de link"},download:{fileName:"nome do arquivo",saveType:"Salvar como",saveTypes:{Original:"formato original",XLSX:"Formato XLSX",PDF:"formato PDF",HTML:"formato HTML"}},print:{size:"Tamanho do papel",orientation:"orientação da página",orientations:["horizontal vertical"]},format:{normal:"ordinário",text:"texto simples",number:"número",percent:"percentagem",rmb:"RMB",usd:"Dólar",eur:"EUR",date:"data",time:"tempo",datetime:"data hora",duration:"período"},formula:{sum:"Calcula a soma de um conjunto de valores",average:"Calcula a média aritmética de todos os parâmetros",max:"Calcula o valor máximo em um conjunto de dígitos",min:"Calcula o menor valor em um conjunto de dígitos",_if:"De acordo com o resultado do julgamento lógico da condição especificada é verdadeiro ou falso, retorne o resultado do cálculo acionado pela condição correspondente",and:'Ele retorna "verdadeiro" lógico somente se os resultados dos parâmetros forem "verdadeiros" lógicos, caso contrário, ele retorna "falso" lógico',or:'O resultado é retornado como lógico "falso" somente se todos os valores dos parâmetros forem logicamente "falsos", caso contrário, ele retorna logicamente "verdadeiro"',concat:"Conecte vários caracteres de texto ou dados em células juntos",count:"conta o número de células que contêm números e conta os números dentro da lista de argumentos",sumif:"Adiciona as células especificadas por um determinado critério",sumifs:"Adiciona as células em um intervalo que atendem a vários critérios",vlookup:"Olha na primeira coluna de uma matriz e move-se pela linha para retornar o valor de uma célula",hlookup:"Procura um valor na linha superior de uma tabela ou uma matriz de valores e, em seguida, retorna um valor na mesma coluna de uma linha especificada na tabela ou matriz.",lookup:"Procura valores em um vetor ou array",match:"Procura valores em uma referência ou array",rank:"Retorna a classificação de um número em uma lista de números",frequency:"Retorna uma distribuição de frequência como uma matriz vertical",text:"Formata um número e o converte em texto",left:"Retorna os caracteres mais à esquerda de um valor de texto",right:"Retorna os caracteres mais à direita de um valor de texto",round:"Arredonda um número para um número especificado de dígitos",index:"Usa um índice para escolher um valor de uma referência ou array",countif:"Conta o número de células dentro de um intervalo que atendem aos critérios fornecidos",countifs:"Conta o número de células dentro de um intervalo que atendem a vários critérios",mid:"Retorna um número específico de caracteres de uma string de texto começando na posição que você especificar",len:"Retorna o número de caracteres em uma string de texto",power:"Retorna o resultado de um número elevado a uma potência",ceiling:"Arredonda um número para o inteiro mais próximo ou para o múltiplo de significância mais próximo",floor:"Arredonda um número para baixo, para zero",substitute:"Substitui o novo texto pelo texto antigo em uma string de texto",replace:"Substitui caracteres no texto",search:"Encontra um valor de texto dentro de outro (sem distinção entre maiúsculas e minúsculas)",find:"Encontra um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)",isnumber:"Retorna TRUE se o valor for um número",istext:"Retorna TRUE se o valor for texto",isblank:"Retorna TRUE se o valor estiver em branco",upper:"Converte o texto em letras maiúsculas",lower:"Converte o texto em minúsculas",product:"Multiplica seus argumentos",sumproduct:"Retorna a soma dos produtos dos componentes do array correspondente",subtotal:"Retorna um subtotal em uma lista ou banco de dados",counta:"Conta quantos valores estão na lista de argumentos",averageif:"Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério",averageifs:"Retorna a média (média aritmética) de todas as células que atendem a vários critérios.",trim:"Remove espaços do texto",sign:"Retorna o sinal de um número",yield:"Retorna o rendimento de um título que paga juros periódicos",abs:"Retorna o valor absoluto de um número",sin:"Retorna o seno do ângulo dado",cos:"Retorna o cosseno de um número",tan:"Retorna a tangente de um número"},validation:{required:"deve ser exigido",notMatch:"não corresponde às suas regras de validação",between:"Está entre {} e {}",notBetween:"não está entre {} e {}",notIn:"não está na lista",equal:"é igual a {}",notEqual:"não é igual a {}",lessThan:"é menor que {}",lessThanEqual:"é menor ou igual a {}",greaterThan:"é maior que {}",greaterThanEqual:"é maior ou igual a {}",downloadImageFail:"Falha ao baixar a imagem"},error:{pasteForMergedCell:"Não é possível executar esta operação em células mescladas"},calendar:{weeks:["Domingo segunda terça quarta quinta sexta sábado"],months:["janeiro, fevereiro, março, abril, maio, junho, julho, agosto, setembro, outubro, novembro, dezembro"]},button:{add:"adicionar à",del:"excluir",next:"Próximo",cancel:"Cancelar",remove:"remover",save:"salvar",ok:"confirme",previous:"Anterior",close:"fecho"},sort:{desc:"Ordenar Z->A",asc:"Ordenar A->Z"},filter:{empty:"vazio"},dataValidation:{mode:"modelo",range:"intervalo de células",criteria:"padrão",modeType:{cell:"célula única",column:"coluna",row:"linha"},type:{list:"lista",number:"dígito",date:"data",phone:"Telefone",email:"e-mail"},operator:{be:"entre",nbe:"não entre",lt:"menor que",lte:"menos que ou igual a",gt:"mais do que o",gte:"Melhor que ou igual a",eq:"igual",neq:"não igual a"}},dataSort:{ci:"escopo",criteria:"ordem",casesense:"maiúsculas e minúsculas",sortby:"ordenar por",header:"título",msg:"Escolha uma coluna diferente classificada por campo",msg2:"A área de seleção tem uma área mesclada, não oferecemos suporte para classificação da área mesclada",order:{asc:"sequência positiva",desc:"ordem reversa"}},dataSearch:{label:"encontrar conteúdo",lkinlb:"intervalo de pesquisa",matchwhole:"corresponde a todo o conteúdo",lookin:{values:"texto",formulas:"Fórmula",comments:"anotação"}},dataComment:{label:"anotação"}},id:{toolbar:{undo:"menarik kembali",redo:"mengulangi",print:"Mencetak",paintformat:"Pelukis Format",clearformat:"format yang jelas",format:"Format data",fontName:"nama font",fontSize:"ukuran huruf",fontBold:"huruf tebal",fontItalic:"huruf miring",underline:"menggarisbawahi",strike:"dicoret",color:"warna teks",bgcolor:"mengisi warna",border:"bingkai",merge:"Menggabungkan Sel",unmerge:"memisahkan sel",align:"Penjajaran horizontal",valign:"penjajaran vertikal",textwrap:"bungkus kata",freeze:"peringkat tetap",autofilter:"Saring",formula:"rumus",more:"Lagi",sort:"Klasifikasi",download:"unduh",pagination:"paging",search:"mencari",commentDefault:"harap masukkan teks",commentEdit:"mengedit komentar",commentRemove:"hapus komentar",commentPrevious:"Komentar sebelumnya",commentNext:"komentar berikutnya",insertImage:"menyisipkan gambar"},menubar:{undo:"membuka",redo:"mengulangi",print:"Mencetak",paintformat:"Pelukis Format",clearformat:"format yang jelas",format:"Format data",fontName:"Nama font:",fontSize:"ukuran huruf:",fontBold:"huruf tebal",fontItalic:"huruf miring",underline:"menggarisbawahi",strike:"dicoret",color:"warna teks",bgcolor:"mengisi warna",border:"bingkai",merge:"Menggabungkan Sel",unmerge:"memisahkan sel",align:"Penjajaran horizontal",valign:"penjajaran vertikal",textwrap:"bungkus kata",freeze:"peringkat tetap",autofilter:"Saring",formula:"rumus",more:"Lagi",sort:"Klasifikasi",download:"unduh",download_HTML:"Unduh sebagai HTML",download_PDF:"Unduh sebagai PDF",download_Original:"unduh asli",download_XLSX:"Unduh sebagai XLSX",download_GOOGLE:"Simpan ke Google Drive",download_DROPBOX:"Simpan ke Dropbox",pagination:"paging",search:"mencari",commentDefault:"harap masukkan teks",insertSheet:"menyisipkan lembar kerja",insertRow:"sisipkan baris",insertColumn:"sisipkan kolom",link:"tautan",insertComment:"Tambahkan komentar",commentEdit:"mengedit komentar",commentRemove:"hapus komentar",commentPrevious:"Komentar sebelumnya",commentNext:"komentar berikutnya",insertImage:"menyisipkan gambar",fromURL:"dari URL",fromLocal:"dari lokal",menuInsert:"Tambahkan",menuComment:"Memeriksa",menuText:"Format",menuFont:"font",menuEdit:"halaman Depan",menuFile:"dokumen"},contextmenu:{copy:"menyalin",cut:"untuk memotong",paste:"tempel",pasteValue:"Tempelkan hanya nilainya",pasteFormat:"Hanya tempel pemformatan",hide:"bersembunyi",insertRow:"sisipkan baris",insertColumn:"sisipkan kolom",deleteSheet:"hapus lembar",deleteRow:"hapus baris",deleteColumn:"hapus kolom",deleteCell:"hapus sel",deleteCellText:"menghapus teks sel",validation:"verifikasi data",sort:"Klasifikasi",link:"tautan",removeLink:"hapus tautan",editLink:"tautan edit",openLink:"Buka tautan",download:"unduh",cellprintable:"mengaktifkan ekspor",cellnonprintable:"nonaktifkan ekspor",celleditable:"aktifkan pengeditan",cellnoneditable:"nonaktifkan pengeditan",insertURL:"Masukkan alamat gambar",deleteImage:"hapus gambar",copyImage:"menyalin gambar",pasteImage:"tempel gambar",merge:"menggabungkan",unmerge:"pisahkan",edit:"sunting",clear:"untuk membersihkan"},link:{emailAddress:"Surel",emailSubject:"tema",sheetPage:"lokasi file",sheetCell:"referensi sel",linkTypes:{web:"halaman web",sheet:"file ini",email:"Surel"},webUrl:"url",linkType:"jenis tautan"},download:{fileName:"nama file",saveType:"Simpan sebagai",saveTypes:{Original:"format asli",XLSX:"berformat XLSX",PDF:"format PDF",HTML:"format HTML"}},print:{size:"ukuran kertas",orientation:"orientasi halaman",orientations:["horisontal vertikal"]},format:{normal:"biasa",text:"teks biasa",number:"nomor",percent:"persentase",rmb:"RMB",usd:"Dolar",eur:"EUR",date:"tanggal",time:"waktu",datetime:"tanggal Waktu",duration:"periode"},formula:{sum:"Menghitung jumlah dari sekumpulan nilai",average:"Menghitung rata-rata aritmatika dari semua parameter",max:"Menghitung nilai maksimum dalam satu set digit",min:"Menghitung nilai terkecil dalam satu set digit",_if:"Menurut hasil penilaian logis dari kondisi yang ditentukan benar atau salah, kembalikan hasil perhitungan yang dipicu oleh kondisi yang sesuai",and:'Ini mengembalikan logika "benar" hanya jika hasil dari parameter keduanya logis "benar", jika tidak maka mengembalikan logika "salah"',or:'Hasilnya dikembalikan sebagai logis "salah" hanya jika semua nilai parameter secara logis "salah", jika tidak, hasilnya secara logis "benar"',concat:"Hubungkan beberapa karakter teks atau data dalam sel bersama-sama",count:"menghitung jumlah sel yang berisi angka, dan menghitung angka dalam daftar argumen",sumif:"Menambahkan sel yang ditentukan oleh kriteria tertentu",sumifs:"Menambahkan sel dalam rentang yang memenuhi beberapa kriteria",vlookup:"Tampak di kolom pertama larik dan bergerak melintasi baris untuk mengembalikan nilai sel",hlookup:"Mencari nilai di baris atas tabel atau larik nilai, lalu mengembalikan nilai di kolom yang sama dari baris yang Anda tentukan di tabel atau larik.",lookup:"Mencari nilai dalam vektor atau larik",match:"Mencari nilai dalam referensi atau larik",rank:"Mengembalikan peringkat nomor dalam daftar nomor",frequency:"Mengembalikan distribusi frekuensi sebagai larik vertikal",text:"Memformat angka dan mengubahnya menjadi teks",left:"Mengembalikan karakter paling kiri dari nilai teks",right:"Mengembalikan karakter paling kanan dari nilai teks",round:"Membulatkan angka ke jumlah digit yang ditentukan",index:"Menggunakan indeks untuk memilih nilai dari referensi atau larik",countif:"Menghitung jumlah sel dalam rentang yang memenuhi kriteria yang diberikan",countifs:"Menghitung jumlah sel dalam rentang yang memenuhi beberapa kriteria",mid:"Mengembalikan sejumlah karakter tertentu dari string teks mulai dari posisi yang Anda tentukan",len:"Mengembalikan jumlah karakter dalam string teks",power:"Mengembalikan hasil angka yang dipangkatkan",ceiling:"Membulatkan angka ke bilangan bulat terdekat atau ke kelipatan signifikansi terdekat",floor:"Membulatkan angka ke bawah, menuju nol",substitute:"Mengganti teks baru dengan teks lama dalam string teks",replace:"Mengganti karakter dalam teks",search:"Menemukan satu nilai teks di dalam yang lain (tidak peka huruf besar/kecil)",find:"Menemukan satu nilai teks di dalam yang lain (peka huruf besar kecil)",isnumber:"Mengembalikan BENAR jika nilainya berupa angka",istext:"Mengembalikan BENAR jika nilainya adalah teks",isblank:"Mengembalikan BENAR jika nilainya kosong",upper:"Mengubah teks menjadi huruf besar",lower:"Mengubah teks menjadi huruf kecil",product:"Kalikan argumennya",sumproduct:"Mengembalikan jumlah produk dari komponen array yang sesuai",subtotal:"Mengembalikan subtotal dalam daftar atau basis data",counta:"Menghitung berapa banyak nilai dalam daftar argumen",averageif:"Mengembalikan rata-rata (rata-rata aritmatika) dari semua sel dalam rentang yang memenuhi kriteria tertentu",averageifs:"Mengembalikan rata-rata (rata-rata aritmatika) dari semua sel yang memenuhi beberapa kriteria.",trim:"Menghapus spasi dari teks",sign:"Mengembalikan tanda angka",yield:"Mengembalikan hasil pada sekuritas yang membayar bunga berkala",abs:"Mengembalikan nilai absolut dari angka",sin:"Mengembalikan sinus dari sudut yang diberikan",cos:"Mengembalikan cosinus angka",tan:"Mengembalikan garis singgung sebuah angka"},validation:{required:"itu harus diperlukan",notMatch:"itu tidak cocok dengan aturan validasinya",between:"Itu antara {} dan {}",notBetween:"itu bukan antara {} dan {}",notIn:"itu tidak ada dalam daftar",equal:"itu sama dengan {}",notEqual:"tidak sama dengan {}",lessThan:"kurang dari {}",lessThanEqual:"kurang dari atau sama dengan {}",greaterThan:"ini lebih besar dari {}",greaterThanEqual:"lebih besar atau sama dengan {}",downloadImageFail:"Gagal mengunduh gambar"},error:{pasteForMergedCell:"Tidak dapat melakukan operasi ini pada sel yang digabungkan"},calendar:{weeks:["Minggu Senin Selasa Rabu Kamis Jumat Sabtu"],months:["Januari, Februari, Maret, April, Mei, Juni, Juli, Agustus, September, Oktober, November, Desember"]},button:{add:"Tambahkan",del:"menghapus",next:"Berikutnya",cancel:"Membatalkan",remove:"menghapus",save:"menyimpan",ok:"mengonfirmasi",previous:"Sebelumnya",close:"penutup"},sort:{desc:"Urutkan Z->A",asc:"Urutkan A->Z"},filter:{empty:"kosong"},dataValidation:{mode:"model",range:"jangkauan sel",criteria:"standar",modeType:{cell:"sel tunggal",column:"kolom",row:"garis"},type:{list:"daftar",number:"angka",date:"tanggal",phone:"Telepon",email:"surel"},operator:{be:"di antara",nbe:"tidak diantara",lt:"kurang dari",lte:"kurang dari atau sama dengan",gt:"lebih dari",gte:"lebih dari atau sama dengan",eq:"setara",neq:"tidak sama dengan"}},dataSort:{ci:"cakupan",criteria:"memesan",casesense:"hal - hal sensitif",sortby:"Sortir dengan",header:"judul",msg:"Harap pilih kolom lain yang diurutkan berdasarkan kolom",msg2:"Area pemilihan memiliki area gabungan, kami tidak mendukung penyortiran area gabungan",order:{asc:"Urutan positif",desc:"urutan terbalik"}},dataSearch:{label:"menemukan konten",lkinlb:"rentang pencarian",matchwhole:"cocok dengan seluruh konten",lookin:{values:"teks",formulas:"rumus",comments:"anotasi"}},dataComment:{label:"anotasi"}},fr:{toolbar:{undo:"révoquer",redo:"refaire",print:"Imprimer",paintformat:"Peintre de format",clearformat:"mise en forme claire",format:"Format de données",fontName:"nom de la police",fontSize:"taille de police",fontBold:"Caractères gras",fontItalic:"police en italique",underline:"souligner",strike:"barré",color:"couleur du texte",bgcolor:"la couleur de remplissage",border:"cadre",merge:"Fusionner des cellules",unmerge:"dissocier des cellules",align:"Alignement horizontal",valign:"alignement vertical",textwrap:"retour à la ligne",freeze:"rangs fixes",autofilter:"filtre",formula:"formule",more:"Plus",sort:"Classification",download:"télécharger",pagination:"pagination",search:"recherche",commentDefault:"veuillez entrer du texte",commentEdit:"modifier les commentaires",commentRemove:"supprimer le commentaire",commentPrevious:"Commentaire précédent",commentNext:"commentaire suivant",insertImage:"insérer une image"},menubar:{undo:"annuler",redo:"refaire",print:"Imprimer",paintformat:"Peintre de format",clearformat:"mise en forme claire",format:"Format de données",fontName:"Nom de la police :",fontSize:"taille de police:",fontBold:"Caractères gras",fontItalic:"police en italique",underline:"souligner",strike:"barré",color:"couleur du texte",bgcolor:"la couleur de remplissage",border:"cadre",merge:"Fusionner des cellules",unmerge:"dissocier des cellules",align:"Alignement horizontal",valign:"alignement vertical",textwrap:"retour à la ligne",freeze:"rangs fixes",autofilter:"filtre",formula:"formule",more:"Plus",sort:"Classification",download:"télécharger",download_HTML:"Télécharger au format HTML",download_PDF:"Télécharger au format PDF",download_Original:"télécharger l'original",download_XLSX:"Télécharger au format XLSX",download_GOOGLE:"Enregistrer sur Google Drive",download_DROPBOX:"Enregistrer dans Dropbox",pagination:"pagination",search:"recherche",commentDefault:"veuillez entrer du texte",insertSheet:"insérer une feuille de calcul",insertRow:"insérer une ligne",insertColumn:"insérer une colonne",link:"lien",insertComment:"ajouter un commentaire",commentEdit:"modifier les commentaires",commentRemove:"supprimer le commentaire",commentPrevious:"Commentaire précédent",commentNext:"commentaire suivant",insertImage:"insérer une image",fromURL:"à partir de l'URL",fromLocal:"du local",menuInsert:"Ajouter à",menuComment:"Vérifier",menuText:"Format",menuFont:"Police de caractère",menuEdit:"page de garde",menuFile:"document"},contextmenu:{copy:"copie",cut:"couper",paste:"pâte",pasteValue:"Coller uniquement la valeur",pasteFormat:"Coller la mise en forme uniquement",hide:"cacher",insertRow:"insérer une ligne",insertColumn:"insérer une colonne",deleteSheet:"supprimer une feuille",deleteRow:"Supprimer la ligne",deleteColumn:"supprimer la colonne",deleteCell:"supprimer la cellule",deleteCellText:"supprimer le texte de la cellule",validation:"verification des données",sort:"Classification",link:"lien",removeLink:"supprimer le lien",editLink:"modifier le lien",openLink:"ouvrir le lien",download:"télécharger",cellprintable:"activer l'exportation",cellnonprintable:"désactiver l'exportation",celleditable:"activer la modification",cellnoneditable:"désactiver l'édition",insertURL:"Entrez l'adresse de l'image",deleteImage:"supprimer l'image",copyImage:"copier l'image",pasteImage:"coller une image",merge:"fusionner",unmerge:"dissocier",edit:"modifier",clear:"nettoyer"},link:{emailAddress:"E-mail",emailSubject:"thème",sheetPage:"emplacement du fichier",sheetCell:"référence de cellule",linkTypes:{web:"page web",sheet:"ce fichier",email:"E-mail"},webUrl:"URL",linkType:"type de lien"},download:{fileName:"nom de fichier",saveType:"Enregistrer sous",saveTypes:{Original:"format d'origine",XLSX:"Format XLSX",PDF:"Format PDF",HTML:"Format HTML"}},print:{size:"taille de papier",orientation:"orientation des pages",orientations:["horizontal Vertical"]},format:{normal:"ordinaire",text:"texte brut",number:"nombre",percent:"pourcentage",rmb:"RMB",usd:"Dollar",eur:"EUR",date:"date",time:"temps",datetime:"date et heure",duration:"période"},formula:{sum:"Calcule la somme d'un ensemble de valeurs",average:"Calcule la moyenne arithmétique de tous les paramètres",max:"Calcule la valeur maximale dans un ensemble de chiffres",min:"Calcule la plus petite valeur dans un ensemble de chiffres",_if:"Selon le résultat du jugement logique de la condition spécifiée est vrai ou faux, renvoie le résultat du calcul déclenché par la condition correspondante",and:'Il renvoie "vrai" logique uniquement si les résultats des paramètres sont tous les deux "vrais" logiques, sinon il renvoie "faux" logique',or:'Le résultat est renvoyé comme "faux" logique uniquement si toutes les valeurs des paramètres sont logiquement "faux", sinon il renvoie logiquement "vrai"',concat:"Connecter plusieurs caractères texte ou données dans des cellules ensemble",count:"compte le nombre de cellules contenant des nombres et compte les nombres dans la liste des arguments",sumif:"Ajoute les cellules spécifiées par un critère donné",sumifs:"Ajoute les cellules d'une plage qui répondent à plusieurs critères",vlookup:"Regarde dans la première colonne d'un tableau et se déplace sur la ligne pour renvoyer la valeur d'une cellule",hlookup:"Recherche une valeur dans la ligne supérieure d'un tableau ou d'un tableau de valeurs, puis renvoie une valeur dans la même colonne à partir d'une ligne que vous spécifiez dans le tableau ou le tableau.",lookup:"Recherche des valeurs dans un vecteur ou un tableau",match:"Recherche des valeurs dans une référence ou un tableau",rank:"Renvoie le rang d'un nombre dans une liste de nombres",frequency:"Renvoie une distribution de fréquence sous la forme d'un tableau vertical",text:"Formate un nombre et le convertit en texte",left:"Renvoie les caractères les plus à gauche d'une valeur de texte",right:"Renvoie les caractères les plus à droite d'une valeur de texte",round:"Arrondit un nombre à un nombre de chiffres spécifié",index:"Utilise un index pour choisir une valeur dans une référence ou un tableau",countif:"Compte le nombre de cellules dans une plage qui répondent aux critères donnés",countifs:"Compte le nombre de cellules dans une plage qui répondent à plusieurs critères",mid:"Renvoie un nombre spécifique de caractères d'une chaîne de texte à partir de la position que vous spécifiez",len:"Renvoie le nombre de caractères d'une chaîne de texte",power:"Renvoie le résultat d'un nombre élevé à une puissance",ceiling:"Arrondit un nombre à l'entier le plus proche ou au multiple de signification le plus proche",floor:"Arrondit un nombre vers le bas, vers zéro",substitute:"Remplace le nouveau texte par l'ancien texte dans une chaîne de texte",replace:"Remplace les caractères dans le texte",search:"Trouve une valeur de texte dans une autre (non sensible à la casse)",find:"Trouve une valeur de texte dans une autre (sensible à la casse)",isnumber:"Renvoie TRUE si la valeur est un nombre",istext:"Renvoie TRUE si la valeur est du texte",isblank:"Renvoie TRUE si la valeur est vide",upper:"Convertit le texte en majuscule",lower:"Convertit le texte en minuscules",product:"Multiplie ses arguments",sumproduct:"Renvoie la somme des produits des composants du tableau correspondants",subtotal:"Renvoie un sous-total dans une liste ou une base de données",counta:"Compte le nombre de valeurs dans la liste des arguments",averageif:"Renvoie la moyenne (moyenne arithmétique) de toutes les cellules d'une plage qui répondent à un critère donné",averageifs:"Renvoie la moyenne (moyenne arithmétique) de toutes les cellules répondant à plusieurs critères.",trim:"Supprime les espaces du texte",sign:"Renvoie le signe d'un nombre",yield:"Rend le rendement d'un titre qui paie des intérêts périodiques",abs:"Renvoie la valeur absolue d'un nombre",sin:"Renvoie le sinus de l'angle donné",cos:"Renvoie le cosinus d'un nombre",tan:"Renvoie la tangente d'un nombre"},validation:{required:"ça doit être obligatoire",notMatch:"il ne correspond pas à ses règles de validation",between:"c'est entre {} et {}",notBetween:"ce n'est pas entre {} et {}",notIn:"il n'est pas dans la liste",equal:"il est égal à {}",notEqual:"il n'est pas égal à {}",lessThan:"c'est moins de {}",lessThanEqual:"il est inférieur ou égal à {}",greaterThan:"il est supérieur à {}",greaterThanEqual:"il est supérieur ou égal à {}",downloadImageFail:"Échec du téléchargement de l'image"},error:{pasteForMergedCell:"Impossible d'effectuer cette opération sur des cellules fusionnées"},calendar:{weeks:["Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi"],months:["janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre"]},button:{add:"Ajouter à",del:"supprimer",next:"Suivant",cancel:"Annuler",remove:"retirer",save:"sauvegarder",ok:"confirmer",previous:"Précédent",close:"fermeture"},sort:{desc:"Trier Z->A",asc:"Trier A->Z"},filter:{empty:"vide"},dataValidation:{mode:"modèle",range:"plage de cellules",criteria:"standard",modeType:{cell:"unicellulaire",column:"colonne",row:"doubler"},type:{list:"liste",number:"chiffre",date:"date",phone:"Téléphone",email:"e-mail"},operator:{be:"entre",nbe:"pas entre",lt:"moins que",lte:"inférieur ou égal à",gt:"plus que le",gte:"Plus grand ou égal à",eq:"égal",neq:"pas égal à"}},dataSort:{ci:"portée",criteria:"commande",casesense:"sensible aux majuscules et minuscules",sortby:"Trier par",header:"titre",msg:"Veuillez choisir une autre colonne triée par champ",msg2:"La zone de sélection a une zone fusionnée, nous ne prenons pas en charge le tri de la zone fusionnée",order:{asc:"Séquence positive",desc:"ordre inverse"}},dataSearch:{label:"trouver du contenu",lkinlb:"plage de recherche",matchwhole:"correspond à tout le contenu",lookin:{values:"texte",formulas:"formule",comments:"annotation"}},dataComment:{label:"annotation"}},vi:{toolbar:{undo:"thu hồi",redo:"làm lại",print:"In",paintformat:"Trình vẽ định dạng",clearformat:"định dạng rõ ràng",format:"Định dạng dữ liệu",fontName:"tên phông chữ",fontSize:"cỡ chữ",fontBold:"phông chữ đậm",fontItalic:"phông chữ nghiêng",underline:"gạch dưới",strike:"gạch ngang",color:"văn bản màu",bgcolor:"tô màu",border:"khung",merge:"Hợp nhất các ô",unmerge:"hủy hợp nhất các ô",align:"Căn ngang",valign:"căn lề dọc",textwrap:"gói từ",freeze:"cấp bậc cố định",autofilter:"lọc",formula:"công thức",more:"Hơn",sort:"phân loại",download:"Tải xuống",pagination:"phân trang",search:"tìm kiếm",commentDefault:"vui lòng nhập văn bản",commentEdit:"chỉnh sửa nhận xét",commentRemove:"Xóa nhận xét",commentPrevious:"Nhận xét trước",commentNext:"bình luận tiếp theo",insertImage:"chèn ảnh"},menubar:{undo:"Hoàn tác",redo:"làm lại",print:"In",paintformat:"Trình vẽ định dạng",clearformat:"định dạng rõ ràng",format:"Định dạng dữ liệu",fontName:"Tên phông chữ:",fontSize:"cỡ chữ:",fontBold:"phông chữ đậm",fontItalic:"phông chữ nghiêng",underline:"gạch dưới",strike:"gạch ngang",color:"văn bản màu",bgcolor:"tô màu",border:"khung",merge:"Hợp nhất các ô",unmerge:"hủy hợp nhất các ô",align:"Căn ngang",valign:"căn lề dọc",textwrap:"gói từ",freeze:"cấp bậc cố định",autofilter:"lọc",formula:"công thức",more:"Hơn",sort:"phân loại",download:"Tải xuống",download_HTML:"Tải xuống dưới dạng HTML",download_PDF:"Tải xuống dưới dạng PDF",download_Original:"tải xuống bản gốc",download_XLSX:"Tải xuống dưới dạng XLSX",download_GOOGLE:"Lưu vào Google Drive",download_DROPBOX:"Lưu vào hộp chứa",pagination:"phân trang",search:"tìm kiếm",commentDefault:"vui lòng nhập văn bản",insertSheet:"chèn bảng tính",insertRow:"Chèn hàng",insertColumn:"chèn cột",link:"liên kết",insertComment:"thêm bình luận",commentEdit:"chỉnh sửa bình luận",commentRemove:"Xóa nhận xét",commentPrevious:"Nhận xét trước",commentNext:"bình luận tiếp theo",insertImage:"chèn ảnh",fromURL:"từ URL",fromLocal:"từ địa phương",menuInsert:"Thêm vào",menuComment:"Kiểm tra",menuText:"Định dạng",menuFont:"nét chữ",menuEdit:"trang đầu",menuFile:"tài liệu"},contextmenu:{copy:"sao chép",cut:"cắt",paste:"dán",pasteValue:"Chỉ dán giá trị",pasteFormat:"Chỉ dán định dạng",hide:"trốn",insertRow:"Chèn hàng",insertColumn:"chèn cột",deleteSheet:"xóa tờ",deleteRow:"xóa hàng",deleteColumn:"xóa cột",deleteCell:"xóa ô",deleteCellText:"xóa văn bản ô",validation:"xác minh dữ liệu",sort:"phân loại",link:"liên kết",removeLink:"xóa liên kết",editLink:"chỉnh sửa liên kết",openLink:"mở liên kết",download:"Tải xuống",cellprintable:"bật xuất",cellnonprintable:"tắt xuất",celleditable:"cho phép chỉnh sửa",cellnoneditable:"tắt chỉnh sửa",insertURL:"Nhập địa chỉ hình ảnh",deleteImage:"xóa ảnh",copyImage:"sao chép hình ảnh",pasteImage:"dán hình",merge:"hợp nhất",unmerge:"hủy hợp nhất",edit:"biên tập",clear:"xóa"},link:{emailAddress:"E-mail",emailSubject:"chủ đề",sheetPage:"vị trí tập tin",sheetCell:"tham chiếu ô",linkTypes:{web:"trang web",sheet:"tập tin này",email:"E-mail"},webUrl:"url",linkType:"Loại liên kết"},download:{fileName:"tên tập tin",saveType:"Lưu thành",saveTypes:{Original:"định dạng ban đầu",XLSX:"định dạng XLSX",PDF:"định dạng PDF",HTML:"định dạng HTML"}},print:{size:"khổ giấy",orientation:"Định hướng trang",orientations:["ngang Dọc"]},format:{normal:"bình thường",text:"văn bản thô",number:"con số",percent:"phần trăm",rmb:"nhân dân tệ",usd:"đô la",eur:"EUR",date:"ngày",time:"thời gian",datetime:"ngày giờ",duration:"Giai đoạn"},formula:{sum:"Tính tổng của một tập hợp các giá trị",average:"Tính giá trị trung bình cộng của tất cả các tham số",max:"Tính giá trị lớn nhất trong một tập hợp các chữ số",min:"Tính giá trị nhỏ nhất trong một tập hợp các chữ số",_if:"Theo kết quả phán đoán logic của điều kiện đã chỉ định là đúng hay sai, trả về kết quả tính toán được kích hoạt bởi điều kiện tương ứng",and:'Nó chỉ trả về logic "true" nếu kết quả của các tham số đều logic "true", nếu không, nó trả về logic "false"',or:'Kết quả chỉ được trả về dưới dạng logic "false" nếu tất cả các giá trị tham số là "false" về mặt logic, nếu không, nó trả về dạng logic "true"',concat:"Kết nối nhiều ký tự văn bản hoặc dữ liệu trong các ô với nhau",count:"đếm số ô chứa số và đếm số trong danh sách đối số",sumif:"Thêm các ô được chỉ định bởi một tiêu chí nhất định",sumifs:"Thêm các ô trong một phạm vi đáp ứng nhiều tiêu chí",vlookup:"Tìm trong cột đầu tiên của một mảng và di chuyển qua hàng để trả về giá trị của một ô",hlookup:"Tìm kiếm một giá trị ở hàng trên cùng của một bảng hoặc một mảng các giá trị, sau đó trả về một giá trị trong cùng một cột từ một hàng mà bạn chỉ định trong bảng hoặc mảng.",lookup:"Tra cứu các giá trị trong một vectơ hoặc mảng",match:"Tra cứu các giá trị trong một tham chiếu hoặc mảng",rank:"Trả về thứ hạng của một số trong danh sách các số",frequency:"Trả về phân bố tần suất dưới dạng mảng dọc",text:"Định dạng một số và chuyển đổi nó thành văn bản",left:"Trả về các ký tự ngoài cùng bên trái từ một giá trị văn bản",right:"Trả về các ký tự ngoài cùng bên phải từ một giá trị văn bản",round:"Làm tròn một số thành một số chữ số đã chỉ định",index:"Sử dụng chỉ mục để chọn giá trị từ tham chiếu hoặc mảng",countif:"Đếm số lượng ô trong một phạm vi đáp ứng tiêu chí đã cho",countifs:"Đếm số lượng ô trong một phạm vi đáp ứng nhiều tiêu chí",mid:"Trả về một số ký tự cụ thể từ một chuỗi văn bản bắt đầu từ vị trí bạn chỉ định",len:"Trả về số ký tự trong chuỗi văn bản",power:"Trả về kết quả của một số được nâng lên lũy thừa",ceiling:"Làm tròn một số thành số nguyên gần nhất hoặc bội số gần nhất",floor:"Làm tròn một số xuống, về 0",substitute:"Thay thế văn bản mới cho văn bản cũ trong một chuỗi văn bản",replace:"Thay thế ký tự trong văn bản",search:"Tìm một giá trị văn bản trong một giá trị văn bản khác (không phân biệt chữ hoa chữ thường)",find:"Tìm một giá trị văn bản trong một giá trị văn bản khác (phân biệt chữ hoa chữ thường)",isnumber:"Trả về TRUE nếu giá trị là số",istext:"Trả về TRUE nếu giá trị là văn bản",isblank:"Trả về TRUE nếu giá trị trống",upper:"Chuyển văn bản thành chữ hoa",lower:"Chuyển văn bản thành chữ thường",product:"Nhân lên các đối số của nó",sumproduct:"Trả về tổng tích của các thành phần mảng tương ứng",subtotal:"Trả về tổng phụ trong danh sách hoặc cơ sở dữ liệu",counta:"Đếm xem có bao nhiêu giá trị trong danh sách đối số",averageif:"Trả về giá trị trung bình (trung bình cộng) của tất cả các ô trong một phạm vi đáp ứng một tiêu chí nhất định",averageifs:"Trả về giá trị trung bình (trung bình cộng) của tất cả các ô đáp ứng nhiều tiêu chí.",trim:"Xóa khoảng trắng khỏi văn bản",sign:"Trả về dấu của một số",yield:"Trả về lợi tức của chứng khoán trả lãi định kỳ",abs:"Trả về giá trị tuyệt đối của một số",sin:"Trả về sin của góc đã cho",cos:"Trả về cosin của một số",tan:"Trả về tang của một số"},validation:{required:"nó phải được yêu cầu",notMatch:"nó không phù hợp với quy tắc xác thực của nó",between:"Nó nằm giữa {} và {}",notBetween:"nó không nằm giữa {} và {}",notIn:"nó không có trong danh sách",equal:"nó bằng {}",notEqual:"nó không bằng {}",lessThan:"nó nhỏ hơn {}",lessThanEqual:"nó nhỏ hơn hoặc bằng {}",greaterThan:"nó lớn hơn {}",greaterThanEqual:"nó lớn hơn hoặc bằng {}",downloadImageFail:"Không thể tải xuống hình ảnh"},error:{pasteForMergedCell:"Không thể thực hiện thao tác này trên các ô đã hợp nhất"},calendar:{weeks:["Chủ nhật thứ hai thứ ba thứ tư thứ năm thứ sáu Thứ Bảy"],months:["Tháng 1, tháng 2, tháng 3, tháng 4, tháng 5, tháng 6, tháng 7, tháng 8, tháng 9, tháng 10, tháng 11, tháng 12"]},button:{add:"Thêm vào",del:"xóa bỏ",next:"Kế tiếp",cancel:"Hủy bỏ",remove:"di dời",save:"cứu",ok:"xác nhận",previous:"Trước",close:"Khép kín"},sort:{desc:"Sắp xếp Z->A",asc:"Sắp xếp A->Z"},filter:{empty:"trống"},dataValidation:{mode:"người mẫu",range:"phạm vi ô",criteria:"tiêu chuẩn",modeType:{cell:"đơn bào",column:"cột",row:"đường kẻ"},type:{list:"danh sách",number:"chữ số",date:"ngày",phone:"Điện thoại",email:"e-mail"},operator:{be:"giữa",nbe:"không phải ở giữa",lt:"ít hơn",lte:"ít hơn hoặc bằng",gt:"nhiều hơn",gte:"lớn hơn hoặc bằng",eq:"bình đẳng",neq:"không bằng"}},dataSort:{ci:"phạm vi",criteria:"đặt hàng",casesense:"trường hợp nhạy cảm",sortby:"sắp xếp theo",header:"tiêu đề",msg:"Vui lòng chọn một cột khác được sắp xếp theo trường",msg2:"Khu vực lựa chọn có khu vực đã hợp nhất, chúng tôi không hỗ trợ sắp xếp khu vực đã hợp nhất",order:{asc:"trình tự tích cực",desc:"thứ tự đảo ngược"}},dataSearch:{label:"tìm nội dung",lkinlb:"phạm vi tìm kiếm",matchwhole:"phù hợp với toàn bộ nội dung",lookin:{values:"chữ",formulas:"công thức",comments:"chú thích"}},dataComment:{label:"chú thích"}},ko:{toolbar:{undo:"취소",redo:"다시 하다",print:"인쇄",paintformat:"포맷 페인터",clearformat:"명확한 형식",format:"데이터 형식",fontName:"글꼴 이름",fontSize:"글꼴 크기",fontBold:"글꼴 굵게",fontItalic:"글꼴 이탤릭체",underline:"밑줄",strike:"취소선",color:"텍스트 색상",bgcolor:"채우기 색상",border:"액자",merge:"셀 병합",unmerge:"셀 병합 해제",align:"수평 정렬",valign:"수직 정렬",textwrap:"줄 바꿈",freeze:"고정 순위",autofilter:"필터",formula:"공식",more:"더",sort:"분류",download:"다운로드",pagination:"페이징",search:"찾다",commentDefault:"텍스트를 입력하십시오",commentEdit:"댓글 수정",commentRemove:"댓글 삭제",commentPrevious:"이전 댓글",commentNext:"다음 댓글",insertImage:"그림 삽입"},menubar:{undo:"실행 취소",redo:"다시 하다",print:"인쇄",paintformat:"포맷 페인터",clearformat:"명확한 형식",format:"데이터 형식",fontName:"글꼴 이름:",fontSize:"글꼴 크기:",fontBold:"글꼴 굵게",fontItalic:"글꼴 이탤릭체",underline:"밑줄",strike:"취소선",color:"텍스트 색상",bgcolor:"채우기 색상",border:"액자",merge:"셀 병합",unmerge:"셀 병합 해제",align:"수평 정렬",valign:"수직 정렬",textwrap:"줄 바꿈",freeze:"고정 순위",autofilter:"필터",formula:"공식",more:"더",sort:"분류",download:"다운로드",download_HTML:"HTML로 다운로드",download_PDF:"PDF로 다운로드",download_Original:"원본 다운로드",download_XLSX:"XLSX로 다운로드",download_GOOGLE:"Google 드라이브에 저장",download_DROPBOX:"드롭박스에 저장",pagination:"페이징",search:"찾다",commentDefault:"텍스트를 입력하십시오",insertSheet:"워크시트 삽입",insertRow:"행 삽입",insertColumn:"열 삽입",link:"링크",insertComment:"댓글 추가",commentEdit:"댓글 수정",commentRemove:"댓글 삭제",commentPrevious:"이전 댓글",commentNext:"다음 댓글",insertImage:"그림 삽입",fromURL:"URL에서",fromLocal:"현지에서",menuInsert:"에 추가",menuComment:"확인하다",menuText:"체재",menuFont:"폰트",menuEdit:"첫 장",menuFile:"문서"},contextmenu:{copy:"복사",cut:"자르다",paste:"반죽",pasteValue:"값만 붙여넣기",pasteFormat:"서식만 붙여넣기",hide:"숨다",insertRow:"행 삽입",insertColumn:"열 삽입",deleteSheet:"시트 삭제",deleteRow:"행 삭제",deleteColumn:"열 삭제",deleteCell:"셀 삭제",deleteCellText:"셀 텍스트 삭제",validation:"데이터 검증",sort:"분류",link:"링크",removeLink:"링크 삭제",editLink:"링크 편집",openLink:"링크 열기",download:"다운로드",cellprintable:"내보내기 활성화",cellnonprintable:"내보내기 비활성화",celleditable:"편집 가능",cellnoneditable:"편집 비활성화",insertURL:"이미지 주소 입력",deleteImage:"사진 삭제",copyImage:"사진 복사",pasteImage:"그림 붙여넣기",merge:"병합",unmerge:"병합 해제",edit:"편집하다",clear:"지우다"},link:{emailAddress:"이메일",emailSubject:"주제",sheetPage:"파일 위치",sheetCell:"셀 참조",linkTypes:{web:"웹 페이지",sheet:"이 파일",email:"이메일"},webUrl:"URL",linkType:"링크 유형"},download:{fileName:"파일 이름",saveType:"다른 이름으로 저장",saveTypes:{Original:"원래 형식",XLSX:"XLSX 형식",PDF:"PDF 형식",HTML:"HTML 형식"}},print:{size:"용지 크기",orientation:"페이지 방향",orientations:["수평 수직"]},format:{normal:"평범한",text:"일반 텍스트",number:"숫자",percent:"백분율",rmb:"인민폐",usd:"달러",eur:"유로",date:"날짜",time:"시간",datetime:"날짜 시간",duration:"기간"},formula:{sum:"값 집합의 합계를 계산합니다.",average:"모든 매개변수의 산술 평균을 계산합니다.",max:"일련의 자릿수에서 최대값을 계산합니다.",min:"숫자 집합에서 가장 작은 값을 계산합니다.",_if:"지정된 조건의 논리적 판단 결과가 참 또는 거짓에 따라 해당 조건에 의해 트리거된 계산 결과를 반환합니다.",and:'매개변수의 결과가 둘 다 논리적 "true"인 경우에만 논리적 "true"를 반환하고, 그렇지 않으면 논리적 "false"를 반환합니다.',or:'결과는 모든 매개변수 값이 논리적으로 "false"인 경우에만 논리적 "false"로 반환되고, 그렇지 않으면 논리적으로 "true"로 반환됩니다.',concat:"셀의 여러 문자 텍스트 또는 데이터 연결",count:"숫자를 포함하는 셀의 수를 계산하고 인수 목록 내의 숫자를 계산",sumif:"지정된 기준으로 지정된 셀을 추가합니다.",sumifs:"여러 기준을 충족하는 범위의 셀을 추가합니다.",vlookup:"배열의 첫 번째 열을 보고 행을 가로질러 이동하여 셀 값을 반환합니다.",hlookup:"테이블의 맨 위 행 또는 값 배열에서 값을 검색한 다음 테이블 또는 배열에서 지정한 행에서 동일한 열의 값을 반환합니다.",lookup:"벡터 또는 배열에서 값 조회",match:"참조 또는 배열에서 값 조회",rank:"숫자 목록에서 숫자의 순위를 반환합니다",frequency:"도수 분포를 수직 배열로 반환",text:"숫자를 형식화하고 텍스트로 변환",left:"텍스트 값에서 가장 왼쪽에 있는 문자를 반환합니다.",right:"텍스트 값에서 가장 오른쪽 문자를 반환",round:"숫자를 지정된 자릿수로 반올림",index:"인덱스를 사용하여 참조 또는 배열에서 값을 선택합니다.",countif:"주어진 기준을 충족하는 범위 내의 셀 수를 계산합니다.",countifs:"여러 기준을 충족하는 범위 내의 셀 수를 계산합니다.",mid:"지정한 위치에서 시작하는 텍스트 문자열에서 특정 수의 문자를 반환합니다.",len:"텍스트 문자열의 문자 수를 반환합니다.",power:"숫자의 거듭제곱 결과를 반환합니다.",ceiling:"숫자를 가장 가까운 정수 또는 가장 가까운 유효 배수로 반올림",floor:"숫자를 0에 가깝게 반올림",substitute:"텍스트 문자열의 기존 텍스트를 새 텍스트로 대체",replace:"텍스트 내 문자 교체",search:"다른 텍스트 값 내에서 하나의 텍스트 값 찾기(대소문자 구분 안 함)",find:"다른 텍스트 값 내에서 하나의 텍스트 값 찾기(대소문자 구분)",isnumber:"값이 숫자이면 TRUE를 반환",istext:"값이 텍스트이면 TRUE를 반환",isblank:"값이 비어 있으면 TRUE를 반환",upper:"텍스트를 대문자로 변환",lower:"텍스트를 소문자로 변환",product:"인수를 곱합니다",sumproduct:"해당 배열 구성요소의 곱의 합을 반환합니다.",subtotal:"목록 또는 데이터베이스에서 소계를 반환합니다.",counta:"인수 목록에 얼마나 많은 값이 있는지 계산",averageif:"지정된 기준을 충족하는 범위 내 모든 셀의 평균(산술 평균)을 반환합니다.",averageifs:"여러 기준을 충족하는 모든 셀의 평균(산술 평균)을 반환합니다.",trim:"텍스트에서 공백 제거",sign:"숫자의 부호를 반환합니다",yield:"주기적으로 이자를 지급하는 유가 증권의 수익률을 반환합니다",abs:"숫자의 절대값을 반환합니다.",sin:"주어진 각도의 사인을 반환합니다",cos:"숫자의 코사인을 반환합니다",tan:"숫자의 탄젠트를 반환합니다"},validation:{required:"반드시 필요하다",notMatch:"유효성 검사 규칙과 일치하지 않습니다.",between:"{}와 {} 사이입니다.",notBetween:"{}와 {} 사이가 아닙니다.",notIn:"목록에 없습니다",equal:"{}와 같습니다.",notEqual:"{}와 같지 않습니다.",lessThan:"{}보다 작습니다.",lessThanEqual:"{}보다 작거나 같습니다.",greaterThan:"{}보다 큽니다.",greaterThanEqual:"{}보다 크거나 같습니다.",downloadImageFail:"이미지를 다운로드하지 못했습니다."},error:{pasteForMergedCell:"병합된 셀에서 이 작업을 수행할 수 없습니다."},calendar:{weeks:["일요일 월요일 화요일 수요일 목요일 금요일 토요일"],months:["1월, 2월, 3월, 4월, 5월, 6월, 7월, 8월, 9월, 10월, 11월, 12월"]},button:{add:"에 추가",del:"삭제",next:"다음",cancel:"취소",remove:"제거하다",save:"구하다",ok:"확인하다",previous:"이전의",close:"폐쇄"},sort:{desc:"정렬 Z->A",asc:"정렬 A->Z"},filter:{empty:"비어 있는"},dataValidation:{mode:"모델",range:"셀 범위",criteria:"기준",modeType:{cell:"단세포",column:"열",row:"선"},type:{list:"목록",number:"숫자",date:"날짜",phone:"전화",email:"이메일"},operator:{be:"~ 사이",nbe:"사이가 아니다",lt:"미만",lte:"이하",gt:"보다 더",gte:"보다 크거나 같음",eq:"동일한",neq:"같지 않다"}},dataSort:{ci:"범위",criteria:"주문하다",casesense:"대소문자 구분",sortby:"정렬 기준",header:"제목",msg:"필드별로 정렬된 다른 열을 선택하세요.",msg2:"선택 영역에 병합된 영역이 있습니다. 병합된 영역 정렬을 지원하지 않습니다.",order:{asc:"양성 서열",desc:"역순으로"}},dataSearch:{label:"콘텐츠 찾기",lkinlb:"검색 범위",matchwhole:"전체 내용과 일치",lookin:{values:"텍스트",formulas:"공식",comments:"주석"}},dataComment:{label:"주석"}},it:{toolbar:{undo:"revocare",redo:"rifare",print:"Stampa",paintformat:"Formato pittore",clearformat:"formato chiaro",format:"Formato dei dati",fontName:"nome del carattere",fontSize:"dimensione del font",fontBold:"carattere grassetto",fontItalic:"carattere corsivo",underline:"sottolineare",strike:"barrato",color:"colore del testo",bgcolor:"colore di riempimento",border:"telaio",merge:"Unire le celle",unmerge:"separare le celle",align:"Allineamento orizzontale",valign:"allineamento verticale",textwrap:"a capo automatico",freeze:"ranghi fissi",autofilter:"filtro",formula:"formula",more:"Di più",sort:"Classificazione",download:"scaricamento",pagination:"paginazione",search:"ricerca",commentDefault:"si prega di inserire il testo",commentEdit:"modificare i commenti",commentRemove:"eliminare il commento",commentPrevious:"Commento precedente",commentNext:"prossimo commento",insertImage:"inserire immagine"},menubar:{undo:"disfare",redo:"rifare",print:"Stampa",paintformat:"Formato pittore",clearformat:"formato chiaro",format:"Formato dei dati",fontName:"Nome carattere:",fontSize:"dimensione del font:",fontBold:"carattere grassetto",fontItalic:"carattere corsivo",underline:"sottolineare",strike:"barrato",color:"colore del testo",bgcolor:"colore di riempimento",border:"telaio",merge:"Unire le celle",unmerge:"separare le celle",align:"Allineamento orizzontale",valign:"allineamento verticale",textwrap:"a capo automatico",freeze:"ranghi fissi",autofilter:"filtro",formula:"formula",more:"Di più",sort:"Classificazione",download:"scaricamento",download_HTML:"Scarica come HTML",download_PDF:"Scarica come PDF",download_Original:"scarica originale",download_XLSX:"Scarica come XLSX",download_GOOGLE:"Salva su Google Drive",download_DROPBOX:"Salva su Dropbox",pagination:"paginazione",search:"ricerca",commentDefault:"si prega di inserire il testo",insertSheet:"inserire foglio di lavoro",insertRow:"inserire riga",insertColumn:"inserire colonna",link:"collegamento",insertComment:"Aggiungi un commento",commentEdit:"modificare i commenti",commentRemove:"eliminare il commento",commentPrevious:"Commento precedente",commentNext:"prossimo commento",insertImage:"inserire immagine",fromURL:"dall'URL",fromLocal:"dal locale",menuInsert:"aggiungere a",menuComment:"Controllo",menuText:"Formato",menuFont:"font",menuEdit:"prima pagina",menuFile:"documento"},contextmenu:{copy:"copia",cut:"tagliare",paste:"impasto",pasteValue:"Incolla solo il valore",pasteFormat:"Incolla solo la formattazione",hide:"nascondere",insertRow:"inserire riga",insertColumn:"inserire colonna",deleteSheet:"eliminare foglio",deleteRow:"elimina riga",deleteColumn:"elimina colonna",deleteCell:"eliminare cella",deleteCellText:"eliminare il testo della cella",validation:"verifica dei dati",sort:"Classificazione",link:"collegamento",removeLink:"eliminare il collegamento",editLink:"modifica collegamento",openLink:"link aperto",download:"scaricamento",cellprintable:"abilitare l'esportazione",cellnonprintable:"disabilitare l'esportazione",celleditable:"permettere la modifica",cellnoneditable:"disabilitare la modifica",insertURL:"Inserisci l'indirizzo dell'immagine",deleteImage:"eliminare l'immagine",copyImage:"copia immagine",pasteImage:"incollare l'immagine",merge:"unire",unmerge:"separare",edit:"modificare",clear:"cancellare"},link:{emailAddress:"E-mail",emailSubject:"tema",sheetPage:"posizione del file",sheetCell:"riferimento di cella",linkTypes:{web:"pagina web",sheet:"questa vita",email:"E-mail"},webUrl:"URL",linkType:"tipo di collegamento"},download:{fileName:"nome del file",saveType:"Salva come",saveTypes:{Original:"formato originale",XLSX:"Formato XLSX",PDF:"Formato PDF",HTML:"Formato HTML"}},print:{size:"Misura del foglio",orientation:"orientamento della pagina",orientations:["orizzontale verticale"]},format:{normal:"ordinario",text:"testo semplice",number:"numero",percent:"percentuale",rmb:"RMB",usd:"Dollaro",eur:"euro",date:"data",time:"tempo",datetime:"appuntamento",duration:"periodo"},formula:{sum:"Calcola la somma di un insieme di valori",average:"Calcola la media aritmetica di tutti i parametri",max:"Calcola il valore massimo in un insieme di cifre",min:"Calcola il valore più piccolo in un set di cifre",_if:"A seconda che il risultato del giudizio logico della condizione specificata sia vero o falso, restituisce il risultato del calcolo attivato dalla condizione corrispondente",and:'Restituisce "vero" logico solo se i risultati dei parametri sono entrambi "veri" logici, altrimenti restituisce "falso" logico',or:'Il risultato viene restituito come logico "falso" solo se tutti i valori dei parametri sono logicamente "falsi", altrimenti restituisce logicamente "vero"',concat:"Collega insieme più caratteri di testo o dati nelle celle",count:"conta il numero di celle che contengono numeri e conta i numeri all'interno dell'elenco di argomenti",sumif:"Aggiunge le celle specificate da un determinato criterio",sumifs:"Aggiunge le celle in un intervallo che soddisfano più criteri",vlookup:"Cerca nella prima colonna di un array e si sposta lungo la riga per restituire il valore di una cella",hlookup:"Cerca un valore nella prima riga di una tabella o di un array di valori, quindi restituisce un valore nella stessa colonna da una riga specificata nella tabella o nell'array.",lookup:"Cerca i valori in un vettore o in un array",match:"Cerca i valori in un riferimento o in un array",rank:"Restituisce il rango di un numero in un elenco di numeri",frequency:"Restituisce una distribuzione di frequenza come matrice verticale",text:"Formatta un numero e lo converte in testo",left:"Restituisce i caratteri più a sinistra da un valore di testo",right:"Restituisce i caratteri più a destra da un valore di testo",round:"Arrotonda un numero a un numero di cifre specificato",index:"Utilizza un indice per scegliere un valore da un riferimento o un array",countif:"Conta il numero di celle all'interno di un intervallo che soddisfano i criteri specificati",countifs:"Conta il numero di celle all'interno di un intervallo che soddisfano più criteri",mid:"Restituisce un numero specifico di caratteri da una stringa di testo a partire dalla posizione specificata",len:"Restituisce il numero di caratteri in una stringa di testo",power:"Restituisce il risultato di un numero elevato a potenza",ceiling:"Arrotonda un numero all'intero più vicino o al multiplo significativo più vicino",floor:"Arrotonda un numero per difetto, verso lo zero",substitute:"Sostituisce il nuovo testo con il vecchio testo in una stringa di testo",replace:"Sostituisce i caratteri all'interno del testo",search:"Trova un valore di testo all'interno di un altro (senza distinzione tra maiuscole e minuscole)",find:"Trova un valore di testo all'interno di un altro (con distinzione tra maiuscole e minuscole)",isnumber:"Restituisce TRUE se il valore è un numero",istext:"Restituisce TRUE se il valore è testo",isblank:"Restituisce TRUE se il valore è vuoto",upper:"Converte il testo in maiuscolo",lower:"Converte il testo in minuscolo",product:"Moltiplica i suoi argomenti",sumproduct:"Restituisce la somma dei prodotti dei corrispondenti componenti dell'array",subtotal:"Restituisce un totale parziale in un elenco o database",counta:"Conta quanti valori ci sono nell'elenco degli argomenti",averageif:"Restituisce la media (media aritmetica) di tutte le celle in un intervallo che soddisfano un dato criterio",averageifs:"Restituisce la media (media aritmetica) di tutte le celle che soddisfano più criteri.",trim:"Rimuove gli spazi dal testo",sign:"Restituisce il segno di un numero",yield:"Restituisce il rendimento di un titolo che paga interessi periodici",abs:"Restituisce il valore assoluto di un numero",sin:"Restituisce il seno dell'angolo dato",cos:"Restituisce il coseno di un numero",tan:"Restituisce la tangente di un numero"},validation:{required:"deve essere richiesto",notMatch:"non corrisponde alle sue regole di convalida",between:"È compreso tra {} e {}",notBetween:"non è tra {} e {}",notIn:"non è nella lista",equal:"è uguale a {}",notEqual:"non è uguale a {}",lessThan:"è minore di {}",lessThanEqual:"è minore o uguale a {}",greaterThan:"è maggiore di {}",greaterThanEqual:"è maggiore o uguale a {}",downloadImageFail:"Impossibile scaricare l'immagine"},error:{pasteForMergedCell:"Impossibile eseguire questa operazione sulle celle unite"},calendar:{weeks:["Domenica lunedì martedì mercoledì giovedì venerdì sabato"],months:["Gennaio, Febbraio, Marzo, Aprile, Maggio, Giugno, Luglio, Agosto, Settembre, Ottobre, Novembre, Dicembre"]},button:{add:"aggiungere a",del:"eliminare",next:"Prossimo",cancel:"Annulla",remove:"rimuovere",save:"salva",ok:"Confermare",previous:"Precedente",close:"chiusura"},sort:{desc:"Ordina Z->A",asc:"Ordina A->Z"},filter:{empty:"vuoto"},dataValidation:{mode:"modello",range:"intervallo di celle",criteria:"standard",modeType:{cell:"singola cella",column:"colonna",row:"linea"},type:{list:"elenco",number:"cifra",date:"data",phone:"Telefono",email:"e-mail"},operator:{be:"fra",nbe:"non in mezzo",lt:"meno di",lte:"minore o uguale a",gt:"più del",gte:"maggiore o uguale a",eq:"pari",neq:"non uguale a"}},dataSort:{ci:"scopo",criteria:"ordine",casesense:"maiuscole e minuscole",sortby:"ordina per",header:"titolo",msg:"Scegli una colonna diversa ordinata per campo",msg2:"L'area di selezione ha un'area unita, non supportiamo l'ordinamento dell'area unita",order:{asc:"Sequenza positiva",desc:"ordine inverso"}},dataSearch:{label:"trovare contenuti",lkinlb:"intervallo di ricerca",matchwhole:"corrisponde all'intero contenuto",lookin:{values:"testo",formulas:"formula",comments:"annotazione"}},dataComment:{label:"annotazione"}},ar:{toolbar:{undo:"سحب او إبطال",redo:"إعادة",print:"مطبعة",paintformat:"شكل الرسام",clearformat:"شكل واضح",format:"تنسيق البيانات",fontName:"اسم الخط",fontSize:"حجم الخط",fontBold:"خط عريض",fontItalic:"مائل الخط",underline:"تسطير",strike:"يتوسطه خط",color:"لون الخط",bgcolor:"لون التعبئة",border:"إطار",merge:"دمج الخلايا",unmerge:"فك دمج الخلايا",align:"محاذاة أفقية",valign:"انحياز عمودي",textwrap:"التفاف النص",freeze:"رتب ثابتة",autofilter:"منقي",formula:"معادلة",more:"أكثر",sort:"تصنيف",download:"تحميل",pagination:"الترحيل",search:"يبحث",commentDefault:"الرجاء إدخال النص",commentEdit:"تحرير التعليقات",commentRemove:"حذف تعليق",commentPrevious:"التعليق السابق",commentNext:"التعليق التالي",insertImage:"إدراج الصورة"},menubar:{undo:"الغاء التحميل",redo:"إعادة",print:"مطبعة",paintformat:"شكل الرسام",clearformat:"شكل واضح",format:"تنسيق البيانات",fontName:"اسم الخط:",fontSize:"حجم الخط:",fontBold:"خط عريض",fontItalic:"مائل الخط",underline:"تسطير",strike:"يتوسطه خط",color:"لون الخط",bgcolor:"لون التعبئة",border:"إطار",merge:"دمج الخلايا",unmerge:"فك دمج الخلايا",align:"محاذاة أفقية",valign:"انحياز عمودي",textwrap:"التفاف النص",freeze:"رتب ثابتة",autofilter:"منقي",formula:"معادلة",more:"أكثر",sort:"تصنيف",download:"تحميل",download_HTML:"تنزيل بتنسيق HTML",download_PDF:"تنزيل كملف PDF",download_Original:"تحميل الاصلي",download_XLSX:"تنزيل بتنسيق XLSX",download_GOOGLE:"حفظ في Google Drive",download_DROPBOX:"حفظ إلى المنسدل",pagination:"الترحيل",search:"يبحث",commentDefault:"الرجاء إدخال النص",insertSheet:"أدخل ورقة العمل",insertRow:"الصف إدراج",insertColumn:"إدراج العمود",link:"وصلة",insertComment:"أضف تعليق",commentEdit:"تحرير التعليقات",commentRemove:"حذف تعليق",commentPrevious:"التعليق السابق",commentNext:"التعليق التالي",insertImage:"إدراج الصورة",fromURL:"من URL",fromLocal:"من المحلية",menuInsert:"اضف إليه",menuComment:"يفحص",menuText:"شكل",menuFont:"الخط",menuEdit:"الصفحة الأمامية",menuFile:"وثيقة"},contextmenu:{copy:"ينسخ",cut:"لقطع",paste:"معجون",pasteValue:"الصق القيمة فقط",pasteFormat:"لصق التنسيق فقط",hide:"يخفي",insertRow:"الصف إدراج",insertColumn:"إدراج العمود",deleteSheet:"حذف الورقة",deleteRow:"احذف صف",deleteColumn:"حذف العمود",deleteCell:"حذف الخلية",deleteCellText:"حذف نص الخلية",validation:"التحقق من البيانات",sort:"تصنيف",link:"وصلة",removeLink:"حذف الارتباط",editLink:"تعديل الارتباط",openLink:"افتح الرابط",download:"تحميل",cellprintable:"تمكين التصدير",cellnonprintable:"تعطيل التصدير",celleditable:"تفعيل التحرير",cellnoneditable:"تعطيل التحرير",insertURL:"أدخل عنوان الصورة",deleteImage:"حذف الصورة",copyImage:"نسخ الصورة",pasteImage:"لصق الصورة",merge:"دمج",unmerge:"تفكك",edit:"يحرر",clear:"لتوضيح"},link:{emailAddress:"بريد إلكتروني",emailSubject:"سمة",sheetPage:"مكان الملف",sheetCell:"مرجع الخلية",linkTypes:{web:"صفحة على الإنترنت",sheet:"هذا الملف",email:"بريد إلكتروني"},webUrl:"عنوان url",linkType:"نوع الارتباط"},download:{fileName:"اسم الملف",saveType:"حفظ باسم",saveTypes:{Original:"التنسيق الأصلي",XLSX:"تنسيق XLSX",PDF:"تنسيق PDF",HTML:"تنسيق HTML"}},print:{size:"حجم الورق",orientation:"اتجاه الصفحة",orientations:["افقي عمودي"]},format:{normal:"عادي",text:"نص عادي",number:"رقم",percent:"نسبة مئوية",rmb:"يوان",usd:"دولار",eur:"يورو",date:"تاريخ",time:"وقت",datetime:"وقت التاريخ",duration:"فترة"},formula:{sum:"تحسب مجموع مجموعة من القيم",average:"يحسب المتوسط الحسابي لجميع المعلمات",max:"تحسب القيمة القصوى في مجموعة من الأرقام",min:"تحسب أصغر قيمة في مجموعة من الأرقام",_if:"وفقًا لنتيجة الحكم المنطقي للشرط المحدد هي صواب أو خطأ ، قم بإرجاع نتيجة الحساب التي تم تشغيلها بواسطة الشرط المقابل",and:'تقوم بإرجاع "صواب" منطقيًا فقط إذا كانت نتائج المعلمات "صواب" منطقية ، وإلا فإنها ترجع "خطأ" منطقيًا',or:'يتم إرجاع النتيجة على أنها "خطأ" منطقية فقط إذا كانت جميع قيم المعلمات "خطأ" منطقيًا ، وإلا فإنها ترجع "صواب" منطقيًا',concat:"ربط نصوص أو بيانات متعددة الأحرف في الخلايا معًا",count:"تحسب عدد الخلايا التي تحتوي على أرقام ,وتحسب الأرقام في قائمة الوسائط",sumif:"إضافة الخلايا المحددة بمعايير معينة",sumifs:"إضافة الخلايا في نطاق يلبي معايير متعددة",vlookup:"البحث في العمود الأول من المصفوفة ويتحرك عبر الصف لإرجاع قيمة الخلية",hlookup:"البحث عن قيمة في الصف العلوي من جدول أو مصفوفة من القيم ,ثم إرجاع قيمة في نفس العمود من صف تحدده في الجدول أو المصفوفة.",lookup:"البحث عن القيم في متجه أو مصفوفة",match:"البحث عن القيم في مرجع أو مصفوفة",rank:"إرجاع رتبة رقم في قائمة الأرقام",frequency:"ترجع توزيع التردد كصفيف عمودي",text:"تنسيق رقم وتحويله إلى نص",left:"إرجاع الأحرف الموجودة في أقصى اليسار من قيمة نصية",right:"إرجاع الأحرف الموجودة في أقصى اليمين من قيمة نصية",round:"لتقريب رقم إلى عدد محدد من الأرقام",index:"يستخدم فهرسًا لاختيار قيمة من مرجع أو مصفوفة",countif:"تحسب عدد الخلايا داخل النطاق الذي يفي بالمعايير المحددة",countifs:"تحسب عدد الخلايا الموجودة في النطاق التي تفي بمعايير متعددة",mid:"ترجع عددًا محددًا من الأحرف من سلسلة نصية تبدأ من الموضع الذي تحدده",len:"إرجاع عدد الأحرف في سلسلة نصية",power:"إرجاع نتيجة رقم مرفوع إلى أس",ceiling:"تقريب رقم إلى أقرب عدد صحيح أو إلى أقرب مضاعف ذي أهمية",floor:"تقريب رقم لأسفل باتجاه الصفر",substitute:"استبدال نص جديد بالنص القديم في سلسلة نصية",replace:"يستبدل الأحرف داخل النص",search:"البحث عن قيمة نصية داخل قيمة أخرى (ليست حساسة لحالة الأحرف)",find:"البحث عن قيمة نصية داخل أخرى (حساسة لحالة الأحرف)",isnumber:"ترجع TRUE إذا كانت القيمة رقمًا",istext:"ترجع TRUE إذا كانت القيمة نصًا",isblank:"ترجع TRUE إذا كانت القيمة فارغة",upper:"تحويل النص إلى أحرف كبيرة",lower:"تحويل النص إلى أحرف صغيرة",product:"تضاعف حججها",sumproduct:"إرجاع مجموع حاصل ضرب مكونات المصفوفة المقابلة",subtotal:"إرجاع إجمالي فرعي في قائمة أو قاعدة بيانات",counta:"تحسب عدد القيم الموجودة في قائمة الوسائط",averageif:"إرجاع المتوسط (الوسط الحسابي) لجميع الخلايا في النطاق الذي يفي بمعايير معينة",averageifs:"إرجاع المتوسط (الوسط الحسابي) لجميع الخلايا التي تفي بمعايير متعددة.",trim:"يزيل المسافات من النص",sign:"إرجاع علامة الرقم",yield:"إرجاع العائد على ورقة مالية ذات فائدة دورية",abs:"إعادة القيمة المطلقة لرقم",sin:"إرجاع جيب الزاوية لزاوية معينة",cos:"إرجاع جيب التمام لرقم",tan:"إرجاع ظل الرقم"},validation:{required:"يجب أن يكون مطلوبًا",notMatch:"لا يتطابق مع قواعد التحقق من الصحة الخاصة به",between:"ما بين {} و {}",notBetween:"إنه ليس بين {} و {}",notIn:"ليس في القائمة",equal:"انها تساوي {}",notEqual:"لا تساوي {}",lessThan:"إنه أقل من {}",lessThanEqual:"إنه أصغر من أو يساوي {}",greaterThan:"أكبر من {}",greaterThanEqual:"أكبر من أو يساوي {}",downloadImageFail:"فشل تحميل الصورة"},error:{pasteForMergedCell:"لا يمكن إجراء هذه العملية على الخلايا المدمجة"},calendar:{weeks:["الاحد الاثنين الثلاثاء الاربعاء الخميس الجمعة السبت"],months:["يناير ، فبراير ، مارس ، أبريل ، مايو ، يونيو ، يوليو ، أغسطس ، سبتمبر ، أكتوبر ، نوفمبر ، ديسمبر"]},button:{add:"اضف إليه",del:"يمسح",next:"التالي",cancel:"يلغي",remove:"يزيل",save:"يحفظ",ok:"يتأكد",previous:"سابق",close:"إنهاء"},sort:{desc:"فرز Z-> A",asc:"فرز A-> Z"},filter:{empty:"فارغ"},dataValidation:{mode:"نموذج",range:"نطاق الخلايا",criteria:"معيار",modeType:{cell:"خلية واحدة",column:"عمود",row:"خط"},type:{list:"قائمة",number:"رقم",date:"تاريخ",phone:"هاتف",email:"بريد إلكتروني"},operator:{be:"بين",nbe:"ليس بينهما",lt:"أقل من",lte:"اقل او يساوي",gt:"أكثر من",gte:"أكبر من أو يساوي",eq:"متساوي",neq:"لا يساوي"}},dataSort:{ci:"نِطَاق",criteria:"طلب",casesense:"حساسية الموضوع",sortby:"ترتيب حسب",header:"عنوان",msg:"الرجاء اختيار عمود مختلف مرتبة حسب المجال",msg2:"منطقة التحديد بها منطقة مدمجة ، لا ندعم فرز المنطقة المدمجة",order:{asc:"تسلسل إيجابي",desc:"ترتيب عكسي"}},dataSearch:{label:"العثور على المحتوى",lkinlb:"نطاق البحث",matchwhole:"يطابق المحتوى بأكمله",lookin:{values:"نص",formulas:"معادلة",comments:"حاشية. ملاحظة"}},dataComment:{label:"حاشية. ملاحظة"}},ja:{toolbar:{undo:"取り消す",redo:"やり直す",print:"印刷する",paintformat:"フォーマットペインター",clearformat:"クリアフォーマット",format:"データ形式",fontName:"フォント名",fontSize:"フォントサイズ",fontBold:"太字",fontItalic:"フォント斜体",underline:"下線",strike:"取り消し線",color:"テキストの色",bgcolor:"塗りつぶしの色",border:"フレーム",merge:"セルを結合します",unmerge:"セルの結合を解除する",align:"水平方向の配置",valign:"垂直方向の配置",textwrap:"ワードラップ",freeze:"固定ランク",autofilter:"フィルター",formula:"方式",more:"もっと",sort:"分類",download:"ダウンロード",pagination:"ページング",search:"検索",commentDefault:"テキストを入力してください",commentEdit:"コメントを編集",commentRemove:"コメントを削除",commentPrevious:"前のコメント",commentNext:"次のコメント",insertImage:"画像を挿入"},menubar:{undo:"元に戻す",redo:"やり直す",print:"印刷する",paintformat:"フォーマットペインター",clearformat:"クリアフォーマット",format:"データ形式",fontName:"フォント名:",fontSize:"フォントサイズ:",fontBold:"太字",fontItalic:"フォント斜体",underline:"下線",strike:"取り消し線",color:"テキストの色",bgcolor:"塗りつぶしの色",border:"フレーム",merge:"セルを結合します",unmerge:"セルの結合を解除する",align:"水平方向の配置",valign:"垂直方向の配置",textwrap:"ワードラップ",freeze:"固定ランク",autofilter:"フィルター",formula:"方式",more:"もっと",sort:"分類",download:"ダウンロード",download_HTML:"HTMLとしてダウンロード",download_PDF:"PDFとしてダウンロード",download_Original:"オリジナルをダウンロード",download_XLSX:"XLSXとしてダウンロード",download_GOOGLE:"Google ドライブに保存",download_DROPBOX:"ドロップボックスに保存",pagination:"ページング",search:"検索",commentDefault:"テキストを入力してください",insertSheet:"ワークシートを挿入",insertRow:"行を挿入",insertColumn:"列を挿入",link:"リンク",insertComment:"コメントを追加",commentEdit:"コメントを編集",commentRemove:"コメントを削除",commentPrevious:"前のコメント",commentNext:"次のコメント",insertImage:"画像を挿入",fromURL:"URLから",fromLocal:"ローカルから",menuInsert:"追加",menuComment:"チェック",menuText:"フォーマット",menuFont:"フォント",menuEdit:"表紙",menuFile:"書類"},contextmenu:{copy:"コピー",cut:"切る",paste:"ペースト",pasteValue:"値のみを貼り付けます",pasteFormat:"書式のみ貼り付け",hide:"隠れる",insertRow:"行を挿入",insertColumn:"列を挿入",deleteSheet:"シートを削除",deleteRow:"行を削除",deleteColumn:"列を削除",deleteCell:"セルを削除",deleteCellText:"セルのテキストを削除",validation:"データ検証",sort:"分類",link:"リンク",removeLink:"リンクを削除",editLink:"リンクを編集",openLink:"リンクを開く",download:"ダウンロード",cellprintable:"エクスポートを有効にする",cellnonprintable:"エクスポートを無効にする",celleditable:"編集を有効に",cellnoneditable:"編集を無効にする",insertURL:"画像アドレスを入力",deleteImage:"画像を削除",copyImage:"コピー画像",pasteImage:"絵を貼り付ける",merge:"マージ",unmerge:"マージを解除する",edit:"編集",clear:"クリアする"},link:{emailAddress:"Eメール",emailSubject:"テーマ",sheetPage:"ファイルの場所",sheetCell:"セル参照",linkTypes:{web:"ウェブページ",sheet:"このファイル",email:"Eメール"},webUrl:"URL",linkType:"リンクタイプ"},download:{fileName:"ファイル名",saveType:"名前を付けて保存",saveTypes:{Original:"オリジナルフォーマット",XLSX:"XLSX形式",PDF:"PDF形式",HTML:"HTML形式"}},print:{size:"用紙サイズ",orientation:"ページの向き",orientations:["水平垂直"]},format:{normal:"普通",text:"プレーンテキスト",number:"番号",percent:"パーセンテージ",rmb:"人民元",usd:"ドル",eur:"ユーロ",date:"日にち",time:"時間",datetime:"日付時刻",duration:"期間"},formula:{sum:"一連の値の合計を計算します",average:"すべてのパラメータの算術平均を計算します",max:"一連の桁の最大値を計算します",min:"一連の数字の最小値を計算します",_if:"指定した条件の論理判定結果が真か偽かに従って、該当する条件でトリガーされた計算結果を返す",and:"パラメータの結果が両方とも論理「真」の場合にのみ論理「真」を返し、それ以外の場合は論理「偽」を返します。",or:"結果は、すべてのパラメーター値が論理的に「false」である場合にのみ論理的な「false」として返され、それ以外の場合は論理的に「true」が返されます。",concat:"セル内の複数の文字テキストまたはデータを結合する",count:"数値を含むセルの数をカウントし、引数のリスト内の数値をカウントします",sumif:"特定の条件で指定されたセルを追加します",sumifs:"複数の基準を満たす範囲内のセルを追加します",vlookup:"配列の最初の列を調べ、行全体を移動してセルの値を返します",hlookup:"テーブルまたは値の配列の一番上の行の値を検索し、テーブルまたは配列で指定した行から同じ列の値を返します。",lookup:"ベクトルまたは配列内の値を検索します",match:"参照または配列内の値を検索します",rank:"数値のリスト内の数値のランクを返します",frequency:"度数分布を垂直配列として返します",text:"数値をフォーマットしてテキストに変換",left:"テキスト値から左端の文字を返します",right:"テキスト値から右端の文字を返します",round:"数値を指定された桁数に丸める",index:"インデックスを使用して、参照または配列から値を選択します",countif:"指定された基準を満たす範囲内のセルの数をカウントします",countifs:"複数の基準を満たす範囲内のセルの数をカウントします",mid:"指定した位置から始まるテキスト文字列から特定の文字数を返します",len:"テキスト文字列の文字数を返す",power:"累乗した数値の結果を返します",ceiling:"数値を最も近い整数または最も近い有効倍数に丸めます",floor:"数値をゼロに向かって切り捨てます",substitute:"テキスト文字列内の古いテキストを新しいテキストに置き換えます",replace:"テキスト内の文字を置き換えます",search:"別のテキスト値を検索します (大文字と小文字を区別しません)",find:"別のテキスト値を検索します (大文字と小文字を区別します)",isnumber:"値が数値の場合に TRUE を返します",istext:"値がテキストの場合、TRUE を返します",isblank:"値が空白の場合は TRUE を返します",upper:"テキストを大文字に変換します",lower:"テキストを小文字に変換します",product:"その引数を乗算します",sumproduct:"対応する配列コンポーネントの積の合計を返します",subtotal:"リストまたはデータベースの小計を返します",counta:"引数のリストにある値の数を数えます",averageif:"指定された基準を満たす範囲内のすべてのセルの平均 (算術平均) を返します",averageifs:"複数の基準を満たすすべてのセルの平均 (算術平均) を返します。",trim:"テキストからスペースを削除します",sign:"数値の符号を返します",yield:"定期的に利息を支払う証券の利回りを返します",abs:"数値の絶対値を返します",sin:"指定された角度の正弦を返します",cos:"数値のコサインを返します",tan:"数値のタンジェントを返します"},validation:{required:"必須でなければなりません",notMatch:"検証ルールと一致しません",between:"{} と {} の間にあります",notBetween:"{} と {} の間にありません",notIn:"それはリストにありません",equal:"{} に等しい",notEqual:"{} と等しくありません",lessThan:"{} 未満です",lessThanEqual:"{}以下です",greaterThan:"{} より大きい",greaterThanEqual:"{}以上です",downloadImageFail:"画像のダウンロードに失敗しました"},error:{pasteForMergedCell:"結合されたセルに対してこの操作を実行できません"},calendar:{weeks:["日曜日月曜日火曜日水曜日の木曜日金曜日土曜日"],months:["1月、2月、3月、4月、5月、6月、7月、8月、9月、10月、11月、12月"]},button:{add:"追加",del:"消去",next:"次",cancel:"キャンセル",remove:"削除",save:"保存",ok:"確認",previous:"前",close:"閉鎖"},sort:{desc:"Z->A で並べ替え",asc:"A->Z で並べ替え"},filter:{empty:"空"},dataValidation:{mode:"モデル",range:"セル範囲",criteria:"標準",modeType:{cell:"単細胞",column:"桁",row:"ライン"},type:{list:"リスト",number:"桁",date:"日にち",phone:"電話",email:"Eメール"},operator:{be:"間",nbe:"間にない",lt:"未満",lte:"以下",gt:"以上",gte:"以上",eq:"同等",neq:"等しくない"}},dataSort:{ci:"範囲",criteria:"注文",casesense:"大文字と小文字を区別",sortby:"並び替え",header:"タイトル",msg:"フィールドでソートされた別の列を選択してください",msg2:"選択領域には結合領域があります。結合領域の並べ替えはサポートされていません",order:{asc:"ポジティブシーケンス",desc:"逆順"}},dataSearch:{label:"コンテンツを見つける",lkinlb:"検索範囲",matchwhole:"コンテンツ全体に一致",lookin:{values:"文章",formulas:"方式",comments:"注釈"}},dataComment:{label:"注釈"}},tr:{toolbar:{undo:"geri çekmek",redo:"yeniden yapmak",print:"Yazdır",paintformat:"Biçim boyacısı",clearformat:"formatı temizle",format:"Veri formatı",fontName:"Yazı tipi adı",fontSize:"yazı Boyutu",fontBold:"Yazı tipi kalın",fontItalic:"italik yazı tipi",underline:"altını çizmek",strike:"üstü çizili",color:"metin rengi",bgcolor:"dolgu rengi",border:"çerçeve",merge:"Hücreleri Birleştir",unmerge:"hücreleri ayır",align:"Yatay hizalama",valign:"dikey hizalama",textwrap:"kelime sarma",freeze:"sabit rütbeler",autofilter:"filtre",formula:"formül",more:"Daha",sort:"sınıflandırma",download:"indirmek",pagination:"çağrı",search:"aramak",commentDefault:"lütfen metni girin",commentEdit:"yorumları düzenle",commentRemove:"yorumu sil",commentPrevious:"Önceki yorum",commentNext:"sonraki yorum",insertImage:"resim ekle"},menubar:{undo:"geri alma",redo:"yeniden yapmak",print:"Yazdır",paintformat:"Biçim boyacısı",clearformat:"formatı temizle",format:"Veri formatı",fontName:"Yazı tipi adı:",fontSize:"yazı Boyutu:",fontBold:"Yazı tipi kalın",fontItalic:"italik yazı tipi",underline:"altını çizmek",strike:"üstü çizili",color:"metin rengi",bgcolor:"dolgu rengi",border:"çerçeve",merge:"Hücreleri Birleştir",unmerge:"hücreleri ayır",align:"Yatay hizalama",valign:"dikey hizalama",textwrap:"kelime sarma",freeze:"sabit rütbeler",autofilter:"filtre",formula:"formül",more:"Daha",sort:"sınıflandırma",download:"indirmek",download_HTML:"HTML olarak indir",download_PDF:"PDF olarak indir",download_Original:"orijinali indir",download_XLSX:"XLSX olarak indir",download_GOOGLE:"Google Drive'a kaydet",download_DROPBOX:"Dropbox'a kaydet",pagination:"çağrı",search:"aramak",commentDefault:"lütfen metni girin",insertSheet:"çalışma sayfası ekle",insertRow:"satır ekle",insertColumn:"sütun ekle",link:"bağlantı",insertComment:"yorum ekle",commentEdit:"yorumları düzenle",commentRemove:"yorumu sil",commentPrevious:"Önceki yorum",commentNext:"sonraki yorum",insertImage:"resim ekle",fromURL:"URL'den",fromLocal:"yerelden",menuInsert:"a ekle",menuComment:"Kontrol etmek",menuText:"Biçim",menuFont:"yazı tipi",menuEdit:"ön Sayfa",menuFile:"belge"},contextmenu:{copy:"kopyalamak",cut:"kesmek",paste:"yapıştırmak",pasteValue:"Yalnızca değeri yapıştırın",pasteFormat:"Yalnızca biçimlendirmeyi yapıştır",hide:"saklamak",insertRow:"satır ekle",insertColumn:"sütun ekle",deleteSheet:"sayfayı sil",deleteRow:"sırayı sil",deleteColumn:"sütunu sil",deleteCell:"hücreyi sil",deleteCellText:"hücre metnini sil",validation:"Veri doğrulama",sort:"sınıflandırma",link:"bağlantı",removeLink:"bağlantıyı sil",editLink:"bağlantıyı düzenle",openLink:"linki aç",download:"indirmek",cellprintable:"dışa aktarmayı etkinleştir",cellnonprintable:"dışa aktarmayı devre dışı bırak",celleditable:"düzenlemeyi etkinleştir",cellnoneditable:"düzenlemeyi devre dışı bırak",insertURL:"Resim adresini girin",deleteImage:"resmi sil",copyImage:"resmi kopyala",pasteImage:"resim yapıştır",merge:"birleştirmek",unmerge:"çözmek",edit:"düzenlemek",clear:"temizlemek için"},link:{emailAddress:"e-posta",emailSubject:"tema",sheetPage:"dosya konumu",sheetCell:"hücre referansı",linkTypes:{web:"web sayfası",sheet:"bu dosya",email:"e-posta"},webUrl:"url",linkType:"bağlantı türü"},download:{fileName:"dosya adı",saveType:"Farklı kaydet",saveTypes:{Original:"orijinal biçim",XLSX:"XLSX formatı",PDF:"PDF biçimi",HTML:"HTML biçimi"}},print:{size:"kağıt boyutu",orientation:"Sayfa yönlendirmesi",orientations:["yatay dikey"]},format:{normal:"sıradan",text:"düz metin",number:"sayı",percent:"yüzde",rmb:"Yuan",usd:"Dolar",eur:"EUR",date:"tarih",time:"zaman",datetime:"tarih saat",duration:"dönem"},formula:{sum:"Bir dizi değerin toplamını hesaplar",average:"Tüm parametrelerin aritmetik ortalamasını hesaplar",max:"Bir dizi basamaktaki maksimum değeri hesaplar",min:"Bir dizi basamaktaki en küçük değeri hesaplar",_if:"Belirtilen koşulun mantıksal yargı sonucuna göre doğru veya yanlış, karşılık gelen koşul tarafından tetiklenen hesaplama sonucunu döndür",and:'Yalnızca parametrelerin sonuçlarının her ikisi de mantıksal "true" ise mantıksal "true" değerini döndürür, aksi takdirde mantıksal "false" değerini döndürür.',or:'Sonuç, yalnızca tüm parametre değerleri mantıksal olarak "yanlış" ise mantıksal olarak "yanlış" olarak döndürülür, aksi takdirde mantıksal olarak "doğru" olarak döner.',concat:"Hücrelerdeki birden çok karakterli metni veya verileri birbirine bağlayın",count:"sayı içeren hücrelerin sayısını sayar ve bağımsız değişkenler listesindeki sayıları sayar",sumif:"Belirli bir kritere göre belirtilen hücreleri ekler",sumifs:"Birden çok kriteri karşılayan bir aralıktaki hücreleri ekler",vlookup:"Bir dizinin ilk sütununa bakar ve bir hücrenin değerini döndürmek için satır boyunca hareket eder",hlookup:"Bir tablonun veya bir değerler dizisinin üst satırında bir değer arar ve ardından tablo veya dizide belirttiğiniz bir satırdan aynı sütunda bir değer döndürür.",lookup:"Bir vektör veya dizideki değerleri arar",match:"Bir başvuru veya dizideki değerleri arar",rank:"Bir sayı listesindeki bir sayının sırasını döndürür",frequency:"Dikey bir dizi olarak bir frekans dağılımı döndürür",text:"Bir sayıyı biçimlendirir ve metne dönüştürür",left:"Bir metin değerinden en soldaki karakterleri döndürür",right:"Bir metin değerinden en sağdaki karakterleri döndürür",round:"Bir sayıyı belirtilen basamak sayısına yuvarlar",index:"Bir başvurudan veya diziden bir değer seçmek için bir dizin kullanır",countif:"Belirtilen ölçütleri karşılayan bir aralıktaki hücre sayısını sayar",countifs:"Bir aralıktaki birden çok kriteri karşılayan hücre sayısını sayar",mid:"Belirttiğiniz konumdan başlayarak bir metin dizisinden belirli sayıda karakter döndürür",len:"Bir metin dizisindeki karakter sayısını döndürür",power:"Bir kuvvete yükseltilmiş bir sayının sonucunu döndürür",ceiling:"Bir sayıyı en yakın tamsayıya veya en yakın anlamlılık katına yuvarlar",floor:"Bir sayıyı sıfıra doğru aşağı yuvarlar",substitute:"Bir metin dizisindeki eski metnin yerine yeni metni koyar",replace:"Metin içindeki karakterleri değiştirir",search:"Bir metin değerini diğerinin içinde bulur (büyük/küçük harfe duyarlı değildir)",find:"Bir metin değerini diğerinin içinde bulur (büyük/küçük harfe duyarlı)",isnumber:"Değer bir sayı ise DOĞRU döndürür",istext:"Değer metin ise DOĞRU döndürür",isblank:"Değer boşsa DOĞRU döndürür",upper:"Metni büyük harfe dönüştürür",lower:"Metni küçük harfe dönüştürür",product:"Argümanlarını çoğaltır",sumproduct:"Karşılık gelen dizi bileşenlerinin çarpımlarının toplamını döndürür",subtotal:"Listede veya veritabanında bir ara toplam döndürür",counta:"Argüman listesinde kaç tane değer olduğunu sayar",averageif:"Belirli bir kriteri karşılayan bir aralıktaki tüm hücrelerin ortalamasını (aritmetik ortalama) verir",averageifs:"Birden çok kriteri karşılayan tüm hücrelerin ortalamasını (aritmetik ortalama) döndürür.",trim:"Metindeki boşlukları kaldırır",sign:"Bir sayının işaretini döndürür",yield:"Periyodik faiz ödeyen bir menkul kıymetin getirisini verir",abs:"Bir sayının mutlak değerini döndürür",sin:"Verilen açının sinüsünü verir",cos:"Bir sayının kosinüsünü döndürür",tan:"Bir sayının teğetini döndürür"},validation:{required:"gerekli olmalı",notMatch:"doğrulama kurallarına uymuyor",between:"{} ile {} arasındadır",notBetween:"{} ile {} arasında değil",notIn:"listede yok",equal:"{} eşittir",notEqual:"{}'e eşit değil",lessThan:"{} değerinden küçük",lessThanEqual:"{}'den küçük veya eşittir",greaterThan:"{} değerinden büyük",greaterThanEqual:"{}'den büyük veya eşittir",downloadImageFail:"Resim indirilemedi"},error:{pasteForMergedCell:"Birleştirilmiş hücrelerde bu işlem gerçekleştirilemez"},calendar:{weeks:["Pazar Pazartesi Salı Çarşamba Perşembe Cuma Cumartesi"],months:["Ocak, Şubat, Mart, Nisan, Mayıs, Haziran, Temmuz, Ağustos, Eylül, Ekim, Kasım, Aralık"]},button:{add:"a ekle",del:"silmek",next:"Sonraki",cancel:"İptal etmek",remove:"kaldırmak",save:"kaydetmek",ok:"onaylamak",previous:"Öncesi",close:"kapanış"},sort:{desc:"Sırala Z->A",asc:"A->Z Sırala"},filter:{empty:"boş"},dataValidation:{mode:"modeli",range:"hücre aralığı",criteria:"standart",modeType:{cell:"tek hücre",column:"kolon",row:"astar"},type:{list:"liste",number:"hane",date:"tarih",phone:"Telefon",email:"e-posta"},operator:{be:"arasında",nbe:"arasında değil",lt:"daha az",lte:"küçük veya eşit",gt:"daha fazla",gte:"büyük veya eşittir",eq:"eşit",neq:"eşit değil"}},dataSort:{ci:"kapsam",criteria:"emir",casesense:"harfe duyarlı",sortby:"göre sırala",header:"başlık",msg:"Lütfen alana göre sıralanmış farklı bir sütun seçin",msg2:"Seçim alanında birleştirilmiş alan var, birleştirilmiş alanın sıralanmasını desteklemiyoruz",order:{asc:"Pozitif dizi",desc:"Ters sipariş"}},dataSearch:{label:"içerik bul",lkinlb:"arama aralığı",matchwhole:"tüm içerikle eşleşir",lookin:{values:"metin",formulas:"formül",comments:"dipnot"}},dataComment:{label:"dipnot"}},th:{toolbar:{undo:"ถอน",redo:"ทำซ้ำ",print:"พิมพ์",paintformat:"ฟอร์แมตจิตรกร",clearformat:"รูปแบบที่ชัดเจน",format:"รูปแบบข้อมูล",fontName:"ชื่อแบบอักษร",fontSize:"ขนาดตัวอักษร",fontBold:"แบบอักษรตัวหนา",fontItalic:"ตัวอักษรตัวเอียง",underline:"ขีดเส้นใต้",strike:"ขีดทับ",color:"สีข้อความ",bgcolor:"เติมสี",border:"กรอบ",merge:"ผสานเซลล์",unmerge:"ยกเลิกการผสานเซลล์",align:"การจัดตำแหน่งแนวนอน",valign:"การจัดตำแหน่งแนวตั้ง",textwrap:"ตัดคำ",freeze:"อันดับคงที่",autofilter:"กรอง",formula:"สูตร",more:"มากกว่า",sort:"การจัดหมวดหมู่",download:"ดาวน์โหลด",pagination:"เพจ",search:"ค้นหา",commentDefault:"กรุณาใส่ข้อความ",commentEdit:"แก้ไขความคิดเห็น",commentRemove:"ลบความคิดเห็น",commentPrevious:"ความคิดเห็นที่แล้ว",commentNext:"ความคิดเห็นถัดไป",insertImage:"แทรกรูปภาพ"},menubar:{undo:"เลิกทำ",redo:"ทำซ้ำ",print:"พิมพ์",paintformat:"ฟอร์แมตจิตรกร",clearformat:"รูปแบบที่ชัดเจน",format:"รูปแบบข้อมูล",fontName:"ชื่อแบบอักษร:",fontSize:"ขนาดตัวอักษร:",fontBold:"แบบอักษรตัวหนา",fontItalic:"ตัวอักษรตัวเอียง",underline:"ขีดเส้นใต้",strike:"ขีดทับ",color:"สีข้อความ",bgcolor:"เติมสี",border:"กรอบ",merge:"ผสานเซลล์",unmerge:"ยกเลิกการผสานเซลล์",align:"การจัดตำแหน่งแนวนอน",valign:"การจัดตำแหน่งแนวตั้ง",textwrap:"ตัดคำ",freeze:"อันดับคงที่",autofilter:"กรอง",formula:"สูตร",more:"มากกว่า",sort:"การจัดหมวดหมู่",download:"ดาวน์โหลด",download_HTML:"ดาวน์โหลดเป็น HTML",download_PDF:"ดาวน์โหลดเป็น PDF",download_Original:"ดาวน์โหลดต้นฉบับ",download_XLSX:"ดาวน์โหลดเป็น XLSX",download_GOOGLE:"บันทึกไปยัง Google ไดรฟ์",download_DROPBOX:"บันทึกไปยัง Dropbox",pagination:"เพจ",search:"ค้นหา",commentDefault:"กรุณาใส่ข้อความ",insertSheet:"ใส่แผ่นงาน",insertRow:"แทรกแถว",insertColumn:"แทรกคอลัมน์",link:"ลิงค์",insertComment:"เพิ่มความเห็น",commentEdit:"แก้ไขความคิดเห็น",commentRemove:"ลบความคิดเห็น",commentPrevious:"ความคิดเห็นที่แล้ว",commentNext:"ความคิดเห็นถัดไป",insertImage:"แทรกรูปภาพ",fromURL:"จาก URL",fromLocal:"จากท้องถิ่น",menuInsert:"เพิ่ม",menuComment:"ตรวจสอบ",menuText:"รูปแบบ",menuFont:"แบบอักษร",menuEdit:"หน้าแรก",menuFile:"เอกสาร"},contextmenu:{copy:"สำเนา",cut:"ที่จะตัด",paste:"แปะ",pasteValue:"วางเฉพาะค่า",pasteFormat:"วางรูปแบบเท่านั้น",hide:"ซ่อน",insertRow:"แทรกแถว",insertColumn:"แทรกคอลัมน์",deleteSheet:"ลบแผ่นงาน",deleteRow:"ลบแถว",deleteColumn:"ลบคอลัมน์",deleteCell:"ลบเซลล์",deleteCellText:"ลบข้อความในเซลล์",validation:"การตรวจสอบข้อมูล",sort:"การจัดหมวดหมู่",link:"ลิงค์",removeLink:"ลบลิงค์",editLink:"แก้ไขลิงค์",openLink:"เปิดลิ้งค์",download:"ดาวน์โหลด",cellprintable:"เปิดใช้งานการส่งออก",cellnonprintable:"ปิดใช้งานการส่งออก",celleditable:"เปิดใช้งานการแก้ไข",cellnoneditable:"ปิดใช้งานการแก้ไข",insertURL:"ป้อนที่อยู่รูปภาพ",deleteImage:"ลบรูปภาพ",copyImage:"คัดลอกรูปภาพ",pasteImage:"วางรูปภาพ",merge:"ผสาน",unmerge:"ยกเลิกการผสาน",edit:"แก้ไข",clear:"เพื่อล้าง"},link:{emailAddress:"อีเมล",emailSubject:"ธีม",sheetPage:"ตำแหน่งไฟล์",sheetCell:"การอ้างอิงเซลล์",linkTypes:{web:"หน้าเว็บ",sheet:"ไฟล์นี้",email:"อีเมล"},webUrl:"URL",linkType:"ประเภทลิงค์"},download:{fileName:"ชื่อไฟล์",saveType:"บันทึกเป็น",saveTypes:{Original:"รูปแบบเดิม",XLSX:"รูปแบบ XLSX",PDF:"รูปแบบ PDF",HTML:"รูปแบบ HTML"}},print:{size:"ขนาดกระดาษ",orientation:"การวางแนวหน้า",orientations:["แนวนอนแนวตั้ง"]},format:{normal:"สามัญ",text:"ข้อความธรรมดา",number:"ตัวเลข",percent:"เปอร์เซ็นต์",rmb:"หยวน",usd:"ดอลลาร์",eur:"ยูโร",date:"วันที่",time:"เวลา",datetime:"วันเวลา",duration:"ระยะเวลา"},formula:{sum:"คำนวณผลรวมของชุดค่าต่างๆ",average:"คำนวณค่าเฉลี่ยเลขคณิตของพารามิเตอร์ทั้งหมด",max:"คำนวณค่าสูงสุดในชุดของหลัก",min:"คำนวณค่าที่น้อยที่สุดในชุดของหลัก",_if:"ตามผลการตัดสินเชิงตรรกะของเงื่อนไขที่ระบุเป็นจริงหรือเท็จ ให้ส่งคืนผลการคำนวณที่ทริกเกอร์ตามเงื่อนไขที่สอดคล้องกัน",and:'จะส่งกลับตรรกะ "จริง" ก็ต่อเมื่อผลลัพธ์ของพารามิเตอร์มีทั้งตรรกะ "จริง" มิฉะนั้นจะส่งกลับตรรกะ "เท็จ"',or:'ผลลัพธ์จะถูกส่งกลับเป็นตรรกะ "เท็จ" เฉพาะในกรณีที่ค่าพารามิเตอร์ทั้งหมดเป็น "เท็จ" ทางตรรกะ มิฉะนั้นจะส่งกลับทางตรรกะ "จริง"',concat:"เชื่อมต่อข้อความหรือข้อมูลหลายตัวในเซลล์เข้าด้วยกัน",count:"นับจำนวนเซลล์ที่มีตัวเลข และนับจำนวนภายในรายการอาร์กิวเมนต์",sumif:"เพิ่มเซลล์ที่ระบุโดยเกณฑ์ที่กำหนด",sumifs:"เพิ่มเซลล์ในช่วงที่ตรงตามเกณฑ์หลายข้อ",vlookup:"ดูในคอลัมน์แรกของอาร์เรย์และเลื่อนข้ามแถวเพื่อส่งกลับค่าของเซลล์",hlookup:"ค้นหาค่าในแถวบนสุดของตารางหรืออาร์เรย์ของค่า แล้วส่งกลับค่าในคอลัมน์เดียวกันจากแถวที่คุณระบุในตารางหรืออาร์เรย์",lookup:"ค้นหาค่าในเวกเตอร์หรืออาร์เรย์",match:"ค้นหาค่าในการอ้างอิงหรืออาร์เรย์",rank:"ส่งกลับอันดับของตัวเลขในรายการตัวเลข",frequency:"ส่งกลับการแจกแจงความถี่เป็นอาร์เรย์แนวตั้ง",text:"จัดรูปแบบตัวเลขและแปลงเป็นข้อความ",left:"ส่งกลับอักขระซ้ายสุดจากค่าข้อความ",right:"ส่งกลับอักขระที่อยู่ขวาสุดจากค่าข้อความ",round:"ปัดเศษตัวเลขเป็นจำนวนหลักที่ระบุ",index:"ใช้ดัชนีเพื่อเลือกค่าจากการอ้างอิงหรืออาร์เรย์",countif:"นับจำนวนเซลล์ภายในช่วงที่ตรงตามเกณฑ์ที่กำหนด",countifs:"นับจำนวนเซลล์ภายในช่วงที่ตรงตามเกณฑ์หลายข้อ",mid:"ส่งคืนอักขระจำนวนหนึ่งจากสตริงข้อความที่เริ่มต้นที่ตำแหน่งที่คุณระบุ",len:"ส่งกลับจำนวนอักขระในสตริงข้อความ",power:"ส่งคืนผลลัพธ์ของตัวเลขที่ยกกำลัง",ceiling:"ปัดเศษตัวเลขให้เป็นจำนวนเต็มที่ใกล้เคียงที่สุดหรือเป็นผลคูณของนัยสำคัญที่ใกล้ที่สุด",floor:"ปัดตัวเลขลง เข้าหาศูนย์",substitute:"แทนที่ข้อความใหม่สำหรับข้อความเก่าในสตริงข้อความ",replace:"แทนที่อักขระภายในข้อความ",search:"ค้นหาค่าข้อความหนึ่งค่าภายในค่าอื่น (ไม่คำนึงถึงตัวพิมพ์เล็กและใหญ่)",find:"ค้นหาค่าข้อความหนึ่งค่าภายในค่าอื่น (คำนึงถึงตัวพิมพ์เล็กและใหญ่)",isnumber:"ส่งกลับค่า TRUE หากค่าเป็นตัวเลข",istext:"คืนค่า TRUE หากค่าเป็นข้อความ",isblank:"คืนค่า TRUE หากค่าเป็นค่าว่าง",upper:"แปลงข้อความเป็นตัวพิมพ์ใหญ่",lower:"แปลงข้อความเป็นตัวพิมพ์เล็ก",product:"ทวีคูณอาร์กิวเมนต์",sumproduct:"ส่งคืนผลรวมของผลคูณของส่วนประกอบอาร์เรย์ที่สอดคล้องกัน",subtotal:"ส่งคืนผลรวมย่อยในรายการหรือฐานข้อมูล",counta:"นับจำนวนค่าที่อยู่ในรายการอาร์กิวเมนต์",averageif:"ส่งกลับค่าเฉลี่ย (ค่าเฉลี่ยเลขคณิต) ของเซลล์ทั้งหมดในช่วงที่ตรงกับเกณฑ์ที่กำหนด",averageifs:"ส่งกลับค่าเฉลี่ย (ค่าเฉลี่ยเลขคณิต) ของเซลล์ทั้งหมดที่ตรงกับหลายเกณฑ์",trim:"ลบช่องว่างออกจากข้อความ",sign:"ส่งคืนเครื่องหมายของตัวเลข",yield:"ส่งคืนผลตอบแทนของหลักทรัพย์ที่จ่ายดอกเบี้ยเป็นงวด",abs:"คืนค่าสัมบูรณ์ของตัวเลข",sin:"คืนค่าไซน์ของมุมที่กำหนด",cos:"คืนค่าโคไซน์ของตัวเลข",tan:"ส่งคืนแทนเจนต์ของตัวเลข"},validation:{required:"จะต้องมี",notMatch:"ไม่ตรงกับกฎการตรวจสอบ",between:"อยู่ระหว่าง {} ถึง {}",notBetween:"ไม่อยู่ระหว่าง {} ถึง {}",notIn:"มันไม่ได้อยู่ในรายการ",equal:"มันเท่ากับ {}",notEqual:"มันไม่เท่ากับ {}",lessThan:"มีค่าน้อยกว่า {}",lessThanEqual:"มันน้อยกว่าหรือเท่ากับ {}",greaterThan:"มันมากกว่า {}",greaterThanEqual:"มันมากกว่าหรือเท่ากับ {}",downloadImageFail:"ดาวน์โหลดภาพไม่สำเร็จ"},error:{pasteForMergedCell:"ไม่สามารถดำเนินการนี้กับเซลล์ที่ผสาน"},calendar:{weeks:["อาทิตย์, จันทร์, อังคาร, พุธ, พฤหัสบดี, ศุกร์, เสาร์"],months:["มกราคม กุมภาพันธ์ มีนาคม เมษายน พฤษภาคม มิถุนายน กรกฎาคม สิงหาคม กันยายน ตุลาคม พฤศจิกายน ธันวาคม"]},button:{add:"เพิ่ม",del:"ลบ",next:"ต่อไป",cancel:"ยกเลิก",remove:"ลบ",save:"บันทึก",ok:"ยืนยัน",previous:"ก่อนหน้า",close:"ปิด"},sort:{desc:"เรียง Z->A",asc:"เรียง A->Z"},filter:{empty:"ว่างเปล่า"},dataValidation:{mode:"แบบอย่าง",range:"ช่วงเซลล์",criteria:"มาตรฐาน",modeType:{cell:"เซลล์เดียว",column:"คอลัมน์",row:"เส้น"},type:{list:"รายการ",number:"หลัก",date:"วันที่",phone:"โทรศัพท์",email:"อีเมล"},operator:{be:"ระหว่าง",nbe:"ไม่ใช่ระหว่าง",lt:"น้อยกว่า",lte:"น้อยกว่าหรือเท่ากับ",gt:"มากกว่า",gte:"มากกว่าหรือเท่ากับ",eq:"เท่ากัน",neq:"ไม่เท่ากับ"}},dataSort:{ci:"ขอบเขต",criteria:"คำสั่ง",casesense:"กรณีที่สำคัญ",sortby:"จัดเรียงตาม",header:"ชื่อ",msg:"โปรดเลือกคอลัมน์อื่นที่จัดเรียงตามฟิลด์",msg2:"พื้นที่การเลือกมีพื้นที่ที่ผสาน เราไม่สนับสนุนการเรียงลำดับพื้นที่ที่ผสาน",order:{asc:"ลำดับที่เป็นบวก",desc:"ลำดับย้อนกลับ"}},dataSearch:{label:"ค้นหาเนื้อหา",lkinlb:"ช่วงการค้นหา",matchwhole:"ตรงกับเนื้อหาทั้งหมด",lookin:{values:"ข้อความ",formulas:"สูตร",comments:"คำอธิบายประกอบ"}},dataComment:{label:"คำอธิบายประกอบ"}},cht:{toolbar:{undo:"撤銷",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"數據格式",fontName:"字體名稱",fontSize:"字體大小",fontBold:"字體粗體",fontItalic:"字體斜體",underline:"下劃綫",strike:"刪除綫",color:"文字顏色",bgcolor:"填充顏色",border:"邊框",merge:"合併單元格",unmerge:"取消合併單元格",align:"水平對齊",valign:"垂直對齊",textwrap:"文字換行",freeze:"固定行列",autofilter:"過濾器",formula:"公式",more:"更多",sort:"分類",download:"下載",pagination:"分頁",search:"搜索",commentDefault:"請輸入文字",commentEdit:"編輯批注",commentRemove:"删除批注",commentPrevious:"上一條批注",commentNext:"下一條批注",insertImage:"插入圖片"},menubar:{undo:"撤消",redo:"重做",print:"打印",paintformat:"格式刷",clearformat:"清除格式",format:"數據格式",fontName:"字體名稱:",fontSize:"字體大小:",fontBold:"字體粗體",fontItalic:"字體斜體",underline:"下劃綫",strike:"刪除綫",color:"文字顏色",bgcolor:"填充顏色",border:"邊框",merge:"合併單元格",unmerge:"取消合併單元格",align:"水平對齊",valign:"垂直對齊",textwrap:"文字換行",freeze:"固定行列",autofilter:"過濾器",formula:"公式",more:"更多",sort:"分類",download:"下載",download_HTML:"下載為HTML",download_PDF:"下載為PDF",download_Original:"下載原件",download_XLSX:"下載為XLSX",download_GOOGLE:"保存至GoogleDrive",download_DROPBOX:"保存至Dropbox",pagination:"分頁",search:"搜索",commentDefault:"請輸入文字",insertSheet:"插入工作表",insertRow:"插入行",insertColumn:"插入列",link:"連結",insertComment:"添加批注",commentEdit:"編輯批注",commentRemove:"删除批注",commentPrevious:"上一條批注",commentNext:"下一條批注",insertImage:"插入圖片",fromURL:"來自URL",fromLocal:"來自本地",menuInsert:"添加",menuComment:"查看",menuText:"格式",menuFont:"字體",menuEdit:"首頁",menuFile:"文件"},contextmenu:{copy:"複製",cut:"剪切",paste:"粘貼",pasteValue:"僅粘貼值",pasteFormat:"僅粘貼格式",hide:"隱藏",insertRow:"插入行",insertColumn:"插入列",deleteSheet:"删去工作表",deleteRow:"删除行",deleteColumn:"删除列",deleteCell:"删除儲存格",deleteCellText:"删除儲存格文字",validation:"數據驗證",sort:"分類",link:"連結",removeLink:"删除連結",editLink:"編輯連結",openLink:"打開連結",download:"下載",cellprintable:"啟用匯出",cellnonprintable:"禁用匯出",celleditable:"啟用編輯",cellnoneditable:"禁用編輯",insertURL:"輸入影像地址",deleteImage:"删除圖片",copyImage:"複製圖片",pasteImage:"粘貼圖片",merge:"合併",unmerge:"取消合併",edit:"編輯",clear:"清除"},link:{emailAddress:"電子郵箱",emailSubject:"主題",sheetPage:"檔案位置",sheetCell:"儲存格引用",linkTypes:{web:"網頁",sheet:"本檔案",email:"電子郵箱"},webUrl:"網址",linkType:"連結類型"},download:{fileName:"文檔名稱",saveType:"另存為",saveTypes:{Original:"原格式",XLSX:"XLSX格式",PDF:"PDF格式",HTML:"HTML格式"}},print:{size:"紙張大小",orientation:"頁面方向",orientations:["橫向,縱向"]},format:{normal:"普通",text:"純文字",number:"數字",percent:"百分比",rmb:"人民幣",usd:"美元",eur:"歐元",date:"日期",time:"時間",datetime:"日期時間",duration:"期間"},formula:{sum:"計算一組值的總和",average:"計算所有參數的算術平均值",max:"計算一組數位中的最大值",min:"計算一組數位中的最小值",_if:"根據指定條件的邏輯判斷結果的真或假,返回相應條件觸發的計算結果",and:"只有當參數的結果都是邏輯“true”時,它才會返回邏輯“true”,否則返回邏輯“false”",or:"只有當所有參數值在邏輯上都為“false”時,結果才返回為邏輯“false”,否則返回為邏輯上的“true”",concat:"將單元格中的多個字符文本或數據連接在一起",count:"計算包含數字的單元格數量,併計算參數列表中的數字",sumif:"添加給定條件指定的單元格",sumifs:"添加滿足多個條件的範圍內的單元格",vlookup:"查看數組的第一列並跨行移動以返回單元格的值",hlookup:"在表的第一行或值數組中搜索一個值,然後從您在表或數組中指定的行的同一列中返回一個值",lookup:"在向量或數組中查找值",match:"在引用或數組中查找值",rank:"返回一個數字在數字列表中的排名",frequency:"以垂直數組形式返回頻率分佈",text:"格式化數字並將其轉換為文本",left:"返回文本值最左邊的字符",right:"返回文本值中最右邊的字符",round:"將數字四捨五入到指定位數",index:"使用索引從引用或數組中選擇一個值",countif:"計算範圍內滿足給定條件的單元格數",countifs:"計算範圍內滿足多個條件的單元格數",mid:"從指定位置開始的文本字符串中返回特定數量的字符",len:"返回文本字符串中的字符數",power:"返回一個數的冪的結果",ceiling:"將數字四捨五入到最接近的整數或最接近的有效倍數",floor:"將數字向下舍入為零",substitute:"用新文本替換文本字符串中的舊文本",replace:"替換文本中的字符",search:"在另一個文本值中查找一個文本值(不區分大小寫)",find:"在一個文本值中查找另一個文本值(區分大小寫)",isnumber:"如果值為數字則返回 TRUE",istext:"如果值為文本則返回 TRUE",isblank:"如果值為空則返回 TRUE",upper:"將文本轉換為大寫",lower:"將文本轉換為小寫",product:"乘以它的論點",sumproduct:"返回對應數組元素的乘積之和",subtotal:"返回列表或數據庫中的小計",counta:"計算參數列表中有多少個值",averageif:"返回範圍內滿足給定條件的所有單元格的平均值(算術平均值)",averageifs:"返回滿足多個條件的所有單元格的平均值(算術平均值)。",trim:"從文本中刪除空格",sign:"返回數字的符號",yield:"返回支付定期利息的證券的收益率",abs:"返回數字的絕對值",sin:"返回給定角度的正弦值",cos:"返回數字的餘弦值",tan:"返回數字的正切"},validation:{required:"它必須是必需的",notMatch:"它與其驗證規則不匹配",between:"它介於{}和{}之間",notBetween:"它不在{}和{}之間",notIn:"它不在清單中",equal:"它等於{}",notEqual:"它不等於{}",lessThan:"它小於{}",lessThanEqual:"它小於或等於{}",greaterThan:"它大於{}",greaterThanEqual:"它大於或等於{}",downloadImageFail:"下載影像失敗"},error:{pasteForMergedCell:"無法對合併的儲存格執行此操作"},calendar:{weeks:["周日、週一、週二、週三、週四、週五、週六"],months:["一月、二月、三月、四月、五月、六月、七月、八月、九月、十月、十一月、十二月"]},button:{add:"添加",del:"删除",next:"下一個",cancel:"取消",remove:"去除",save:"保存",ok:"確認",previous:"前一個",close:"關閉"},sort:{desc:"排序Z->A",asc:"排序A->Z"},filter:{empty:"空的"},dataValidation:{mode:"模式",range:"儲存格範圍",criteria:"標準",modeType:{cell:"單間牢房",column:"柱",row:"一行"},type:{list:"清單",number:"數位",date:"日期",phone:"電話",email:"電子郵件"},operator:{be:"之間",nbe:"不介於",lt:"少於",lte:"小於或等於",gt:"大於",gte:"大於或等於",eq:"等於",neq:"不等於"}},dataSort:{ci:"範圍",criteria:"順序",casesense:"區分大小寫",sortby:"排序依據",header:"標題",msg:"請選擇按欄位排序的不同列",msg2:"選擇區域有合併區域,我們不支持對合併區域進行排序",order:{asc:"正序",desc:"逆序"}},dataSearch:{label:"查找內容",lkinlb:"查找範圍",matchwhole:"匹配整個內容",lookin:{values:"文本",formulas:"公式",comments:"批注"}},dataComment:{label:"批注"}}};function N(e,t){if(t){var i,n=j(B);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(!t[r])break;for(var a=t[r],o=e.match(/(?:\\.|[^.])+/g),s=0;s<o.length;s+=1){var l=a[o[s]];if(!l)break;if(s===o.length-1)return l;a=l}}}catch(e){n.e(e)}finally{n.f()}}}function U(e){var t=N(e,H);return!t&&window&&window.x_spreadsheet&&window.x_spreadsheet.$messages&&(t=N(e,window.x_spreadsheet.$messages)),t||""}function X(e){return function(){return U(e)}}function W(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i?B=[e]:B.unshift(e),t&&(H[e]=t)}function q(e){H[e]||(e="en"),B[0]=e}var Y={phone:/^[1-9]\d{10}$/,email:/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/};function V(e,t){var i="";if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];i=U.apply(void 0,["validation.".concat(t)].concat(r))}return[e,i]}var G=function(){function e(t,i,n,r){l()(this,e),this.required=i,this.value=n,this.type=t,this.operator=r,this.message=""}return r()(e,[{key:"parseValue",value:function(e){var t=this.type;return"date"===t?new Date(e):"number"===t?Number(e):e}},{key:"equals",value:function(e){var t=this.type===e.type&&this.required===e.required&&this.operator===e.operator;return t&&(t=Array.isArray(this.value)?F.arrayEquals(this.value,e.value):this.value===e.value),t}},{key:"values",value:function(){return this.value.split(",")}},{key:"validate",value:function(e){var t=this.required,i=this.operator,n=this.value,r=this.type;if(t&&/^\s*$/.test(e))return V(!1,"required");if(/^\s*$/.test(e))return[!0];if(Y[r]&&!Y[r].test(e))return V(!1,"notMatch");if("list"===r)return V(this.values().includes(e),"notIn");if(i){var a=this.parseValue(e);if("be"===i){var s=o()(n,2),l=s[0],c=s[1];return V(a>=this.parseValue(l)&&a<=this.parseValue(c),"between",l,c)}if("nbe"===i){var h=o()(n,2),u=h[0],f=h[1];return V(a<this.parseValue(u)||a>this.parseValue(f),"notBetween",u,f)}if("eq"===i)return V(a===this.parseValue(n),"equal",n);if("neq"===i)return V(a!==this.parseValue(n),"notEqual",n);if("lt"===i)return V(a<this.parseValue(n),"lessThan",n);if("lte"===i)return V(a<=this.parseValue(n),"lessThanEqual",n);if("gt"===i)return V(a>this.parseValue(n),"greaterThan",n);if("gte"===i)return V(a>=this.parseValue(n),"greaterThanEqual",n)}return[!0]}}]),e}(),Z=function(){function e(t,i,n){l()(this,e),this.refs=i,this.mode=t,this.validator=n}return r()(e,[{key:"includes",value:function(e,t){for(var i=this.refs,n=0;n<i.length;n+=1){if(x.valueOf(i[n]).includes(e,t))return!0}return!1}},{key:"addRef",value:function(e){this.remove(x.valueOf(e)),this.refs.push(e)}},{key:"remove",value:function(e){var t=[];this.refs.forEach((function(i){var n=x.valueOf(i);n.intersects(e)?n.difference(e).forEach((function(e){return t.push(e.toString())})):t.push(i)})),this.refs=t}},{key:"getData",value:function(){var e=this.refs,t=this.mode,i=this.validator;return{refs:e,mode:t,type:i.type,required:i.required,operator:i.operator,value:i.value}}}],[{key:"valueOf",value:function(t){var i=t.refs,n=t.mode,r=t.type,a=t.required,o=t.operator,s=t.value;return new e(n,i,new G(r,a,s,o))}}]),e}(),K=function(){function e(){l()(this,e),this._=[],this.errors=new Map}return r()(e,[{key:"getError",value:function(e,t){return this.errors.get("".concat(e,"_").concat(t))}},{key:"validate",value:function(e,t,i){var n=this.get(e,t),r="".concat(e,"_").concat(t),a=this.errors;if(null!==n){var s=n.validator.validate(i),l=o()(s,2),c=l[0],h=l[1];c?a.delete(r):a.set(r,h)}else a.delete(r);return!0}},{key:"add",value:function(e,t,i){var n=i.type,r=i.required,a=i.value,o=i.operator,s=new G(n,r,a,o),l=this.getByValidator(s);null!==l?l.addRef(t):this._.push(new Z(e,[t],s))}},{key:"getByValidator",value:function(e){for(var t=0;t<this._.length;t+=1){var i=this._[t];if(i.validator.equals(e))return i}return null}},{key:"get",value:function(e,t){for(var i=0;i<this._.length;i+=1){var n=this._[i];if(n.includes(e,t))return n}return null}},{key:"remove",value:function(e){var t="".concat(e.sri,"_").concat(e.sci);this.errors.has(t)&&this.errors.delete(t),this.each((function(t){t.remove(e)}))}},{key:"each",value:function(e){this._.forEach((function(t){return e(t)}))}},{key:"getData",value:function(){return this._.filter((function(e){return e.refs.length>0})).map((function(e){return e.getData()}))}},{key:"setData",value:function(e){this._=e.map((function(e){return Z.valueOf(e)}))}}]),e}(),J=function e(){l()(this,e),this.keywords="",this.current=1,this.result=[]},Q=i(3),ee=i.n(Q),te=i(4),ie=i.n(te),ne=i(1),re=i.n(ne),ae="x-spreadsheet";window.devicePixelRatio;function oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var se=function(e){ee()(i,e);var t=oe(i);function i(e){var n;return l()(this,i),(n=t.call(this,"div","".concat(ae,"-icon"))).iconNameEl=f("div","".concat(ae,"-icon-img ").concat(e)),n.child(n.iconNameEl),n}return r()(i,[{key:"setName",value:function(e){this.iconNameEl.className("".concat(ae,"-icon-img ").concat(e))}}]),i}(u);function le(e,t,i){var n=f("div","".concat(ae,"-toast")),r=f("div","".concat(ae,"-dimmer active"));n.children(f("div","".concat(ae,"-toast-header")).children(new se("close").on("click.stop",(function(){return document.body.removeChild(n.el),document.body.removeChild(r.el),void(i&&i())})),e),f("div","".concat(ae,"-toast-content")).html(t)),document.body.appendChild(n.el),document.body.appendChild(r.el);var a=n.box(),o=a.width,s=a.height,l=document.documentElement,c=l.clientHeight,h=l.clientWidth;n.offset({left:(h-o)/2,top:(c-s)/3})}var ce={mode:"edit",updateMode:"client",updateUrl:"",folderName:"",fileName:"",view:{height:function(){return document.documentElement.clientHeight},width:function(){return document.documentElement.clientWidth}},showToolbar:!0,showPartToolbar:!1,showContextmenu:!0,showFileName:!0,row:{len:100,height:25},col:{len:26,width:100,indexWidth:60,minWidth:60},style:{align:"left",valign:"middle",textwrap:!1,strike:!1,underline:!1,color:"#0a0a0a",font:{name:"Arial",size:10,bold:!1,italic:!1},format:"normal"}};function he(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=this.merges,r=t.clone(),a=e.size(),s=o()(a,2),l=s[0],c=s[1],h=t.size(),u=o()(h,2),f=u[0],d=u[1];return l>f&&(r.eri=t.sri+l-1),c>d&&(r.eci=t.sci+c-1),this.getRangeLocked(r)?(i("Protected worksheet,the target area contains locked cells"),!1):n.intersects(r)?(i(U("error.pasteForMergedCell")),!1):e.equals(r)?(i("The selection area is same "),!1):!e.intersects(r)||!(f>l&&Math.abs(t.sri-e.sri)%l!=0||d>c&&Math.abs(t.sci-e.sci)%c!=0)||(i("Invalid selection area"),!1)}function ue(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.rows,a=this.merges,s=this.name,l=r.copyPaste(e,t,i,n,(function(e,t,i){if(i&&i.merge){var n=o()(i.merge,2),r=n[0],s=n[1];if(r<=0&&s<=0)return;a.add(new x(e,t,e+r,t+s))}}));n?this.updateBatchCellsOpr(s,l,e,t,i):this.copyPasteRangeOpr(s,e,t,i)}function fe(e,t){var i=this.clipboard,n=this.rows,r=this.merges,a=this.name;n.cutPaste(e,t),r.move(e,t.sri-e.sri,t.sci-e.sci),i.clear(),this.cutPasteRangeOpr(a,e,t)}function de(e,t,i){var n=this.styles,r=this.rows.getCellOrNew(e,t),a={};void 0!==r.style&&(a=F.cloneDeep(n[r.style])),a=F.merge(a,{border:i}),r.style=this.addStyle(a)}function me(e){var t=this,i=e.mode,n=e.style,r=e.color,a=this.styles,s=this.selector,l=this.rows,c=s.range,h=c.sri,u=c.sci,f=c.eri,d=c.eci,m=!this.isSignleSelected();if(m||"inside"!==i&&"horizontal"!==i&&"vertical"!==i)if("outside"!==i||m){if("none"===i)s.range.each((function(e,i){var n=l.getCell(e,i);if(n&&void 0!==n.style){var r=F.cloneDeep(a[n.style]);delete r.border,n.style=t.addStyle(r)}}));else if("all"===i||"inside"===i||"outside"===i||"horizontal"===i||"vertical"===i)!function(){for(var e=[],a=h;a<=f;a+=1)for(var s=u;s<=d;s+=1){for(var c=[],g=0;g<e.length;g+=1){var v=o()(e[g],4),p=v[0],y=v[1],b=v[2],w=v[3];if(a===p+b+1&&c.push(g),p<=a&&a<=p+b&&s===y){s+=w+1;break}}if(c.forEach((function(t){return e.splice(t,1)})),s>d)break;var x=l.getCell(a,s),k=0,C=0;if(x&&x.merge){var _=o()(x.merge,2);k=_[0],C=_[1],e.push([a,s,k,C])}var S=k>0&&a+k===f,T=C>0&&s+C===d,O={};"all"===i?O={bottom:[n,r],top:[n,r],left:[n,r],right:[n,r]}:"inside"===i?(!T&&s<d&&(O.right=[n,r]),!S&&a<f&&(O.bottom=[n,r])):"horizontal"===i?!S&&a<f&&(O.bottom=[n,r]):"vertical"===i?!T&&s<d&&(O.right=[n,r]):"outside"===i&&m&&(h===a&&(O.top=[n,r]),(S||f===a)&&(O.bottom=[n,r]),u===s&&(O.left=[n,r]),(T||d===s)&&(O.right=[n,r])),Object.keys(O).length>0&&de.call(t,a,s,O),s+=C}}();else if("top"===i||"bottom"===i)for(var g=u;g<=d;g+=1)"top"===i&&(de.call(this,h,g,{top:[n,r]}),g+=l.getCellMerge(h,g)[1]),"bottom"===i&&(de.call(this,f,g,{bottom:[n,r]}),g+=l.getCellMerge(f,g)[1]);else if("left"===i||"right"===i)for(var v=h;v<=f;v+=1)"left"===i&&(de.call(this,v,u,{left:[n,r]}),v+=l.getCellMerge(v,u)[0]),"right"===i&&(de.call(this,v,d,{right:[n,r]}),v+=l.getCellMerge(v,d)[0])}else de.call(this,h,u,{top:[n,r],bottom:[n,r],left:[n,r],right:[n,r]})}function ge(e,t){var i=this.rows,n=this.scroll,r=this.freezeTotalHeight(),a=this.settings.row.height,o=this.exceptRowSet;0===n.riact&&this.freeze[0]>0&&(n.riact=this.freeze[0]);var s=a+r,l=e>s?n.riact:0;0===l&&(s=a);for(var c=0;l<i.len&&!(s>e);l+=1)o.has(l)||(s+=c=i.getHeight(l));return{ri:l-1,top:s-=c,height:c}}function ve(e,t){var i=this.cols,n=this.displayRight2Left,r=this.freezeTotalWidth(),a=i.indexWidth;if(n){var s=this.viewWidth();r+i.indexWidth<s-e&&(a-=t);var l=F.rangeReduceIf(0,i.len,a,i.indexWidth,s-e,(function(e){return i.getWidth(e)})),c=o()(l,3),h=c[0],u=c[1],f=c[2];return u<=0?{ci:-1,left:s,width:i.indexWidth}:{ci:h-1,left:s-u,width:f}}r+i.indexWidth<e&&(a-=t);var d=F.rangeReduceIf(0,i.len,a,i.indexWidth,e,(function(e){return i.getWidth(e)})),m=o()(d,3),g=m[0],v=m[1],p=m[2];return v<=0?{ci:-1,left:0,width:i.indexWidth}:{ci:g-1,left:v,width:p}}var pe=function(){function e(t,i){l()(this,e),this.settings=F.merge(ce,i||{}),this.name=t||"sheet",this.freeze=[0,0],this.styles=[],this.merges=new I,this.rows=new M(this.settings.row),this.cols=new L(this.settings.col),this.validations=new K,this.hyperlinks=[],this.comments=[],this.viewRangeCache={},this.highlighttxts=[],this.highlightrg=[],this.highlighshapes=[],this.highlighimgs=[],this.highlightIR=null,this.highlightall=!1,this.showhighlight=!1,this.highlightstyle=null,this.selector=new C,this.scroll=new _,this.history=new S,this.updateRows=new Set,this.updateCols=new Set,this.updateRowsHeight=new Set,this.clipboard=new T,this.autoFilter=new R,this.TableAutoFilters=[],this.menubarStatus=function(){},this.change=function(){},this.updateCellsData=function(){},this.updateCellServer=function(){},this.updateServerError=function(){},this.updateCellError=function(){},this.loadImages=function(){},this.loadShapes=function(){},this.fillImageSrc=function(){},this.fillImageOnebyOne=function(){},this.loadConditionImage=function(){},this.reloadImagesShapes=function(){},this.scrollImagesShapes=function(){},this.exceptRowSet=new Set,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,this.isupdating=!1,this.search=new J,this.showGrid=!0,this.zoomlevel=1,this.isImageOk=!1}return r()(e,[{key:"addValidation",value:function(e,t,i){var n=this;this.changeData((function(){n.validations.add(e,t,i)}))}},{key:"removeValidation",value:function(){var e=this,t=this.selector.range;this.changeData((function(){e.validations.remove(t)}))}},{key:"getHighlightCellTxt",value:function(e,t){var i=this;return this.showhighlight&&!this.highlightall?this.highlighttxts.reduce((function(n,r){return r.row===e&&r.col===t&&(r.color=i.highlightstyle.color,n.push(r)),n}),[]):[]}},{key:"getSelectedValidator",value:function(){var e=this.selector,t=e.ri,i=e.ci,n=this.validations.get(t,i);return n?n.validator:null}},{key:"getSelectedValidation",value:function(){var e=this.selector,t=e.ri,i=e.ci,n=e.range,r=this.validations.get(t,i),a={ref:n.toString()};return null!==r&&(a.mode=r.mode,a.validator=r.validator),a}},{key:"getSelectedSort",value:function(){var e=this.selector,t=e.ci,i=e.range,n={ref:i.toString(),ci:[0,1,2]},r=this.merges;n.sort=[];for(var a=[],o=i.sri,s=i.eri,l=i.sci,c=i.eci,h=0;h<r._.length;h+=1){var u=r._[h];if(u.sri>=o&&u.eri<=s&&u.sci>=l&&u.eci<=c)return le("error","".concat(U("dataSort.msg2"))),null}for(var f=o+1;f<=s;f+=1){var d=this.getCell(f,t);null===d||/^\s*$/.test(d.text)||a.push(d.text)}n.m=a;for(var m=new Map,g=new Map,p=0,y=l;y<=c;y++,p++){var b=this.getCell(o,y),w="";w=null===b||/^\s*$/.test(b.text)?"(Column "+v(y)+")":b.text,m.set(p,w),g.set(p,"(Column "+v(y)+")")}return n.mcols=m,n.mcolsheader=g,n}},{key:"canUndo",value:function(){return this.history.canUndo()}},{key:"canRedo",value:function(){return this.history.canRedo()}},{key:"undo",value:function(){var e=this;this.history.undo((function(t){return e.getRangeData(t.range)}),(function(t){e.setRangeData(t)}))}},{key:"redo",value:function(){var e=this;this.history.redo((function(t){return e.getRangeData(t.range)}),(function(t){e.setRangeData(t)}))}},{key:"copy",value:function(){this.clipboard.copy(this.selector.range,this.rows)}},{key:"cut",value:function(){this.clipboard.cut(this.selector.range)}},{key:"paste",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=this.clipboard,r=this.selector;return!n.isClear()&&(!!he.call(this,n.range,r.range,i)&&(this.changeData((function(){var i=r.range.extendRange(n.range);r.range.setToOther(i),n.isCopy()?ue.call(e,n.range,i,t):n.isCut()&&fe.call(e,n.range,i)})),!0))}},{key:"pasteFromText",value:function(e){var t=this,i=this.name,n=e.split("\r\n").map((function(e){return e.replace(/"/g,"").split("\t")}));if(n.length>0&&""==n[n.length-1]&&(n.length-=1),n.length>=1){var r=this.rows,a=this.selector;this.changeData((function(){var e=r.paste(n,a.range);t.updateBatchCellsOpr(i,e)}))}}},{key:"autofill",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.selector.range;return-1==r.sci&&(r.sci=0),-1==r.sri&&(r.sri=0),-1==e.sci&&(e.sci=0),-1==e.sri&&(e.sri=0),!!he.call(this,r,e,n)&&(this.changeData((function(){ue.call(i,r,e,t,!0)}),!0,e),!0)}},{key:"clearClipboard",value:function(){this.clipboard.clear()}},{key:"calSelectedRangeByEnd",value:function(e,t){var i=this.selector,n=this.rows,r=this.cols,a=this.merges,o=i.range,s=o.sri,l=o.sci,c=o.eri,h=o.eci,u=i.ri,f=i.ci,d=e,m=t;return e<0&&(d=n.len-1),t<0&&(m=r.len-1),d>u?(s=u,c=d):(s=d,c=u),m>f?(l=f,h=m):(l=m,h=f),i.range=a.union(new x(s,l,c,h)),i.range=a.union(i.range),i.range}},{key:"calSelectedRangeByStart",value:function(e,t){var i=this.selector,n=this.rows,r=this.cols,a=this.merges.getFirstIncludes(e,t);return null===a&&(a=new x(e,t,e,t),-1===e&&(a.sri=0,a.eri=n.len-1),-1===t&&(a.sci=0,a.eci=r.len-1)),i.range=a,a}},{key:"setSelectedCellAttr",value:function(e,t){var i=this;this.changeData((function(){var n=i.selector,r=i.styles,a=i.rows,s=i.name;if("merge"===e)t?i.merge():i.unmerge();else if("border"===e)me.call(i,t);else if("formula"===e){var l=n.ri,c=n.ci,h=n.range;if(n.multiple()){var u=n.size(),f=o()(u,2),d=f[0],m=f[1],g=h.sri,v=h.sci,p=h.eri,y=h.eci;if(d>1)for(var w=v;w<=y;w+=1){a.getCellOrNew(p+1,w).text="=".concat(t,"(").concat(b(w,g),":").concat(b(w,p),")")}else if(m>1){a.getCellOrNew(l,y+1).text="=".concat(t,"(").concat(b(v,l),":").concat(b(y,l),")")}}else{a.getCellOrNew(l,c).text="=".concat(t,"()")}}else n.range.each((function(n,o){var l=a.getCellOrNew(n,o),c={};if(void 0!==l.style&&(c=F.cloneDeep(r[l.style])),"format"===e)c.format=t,"normal"===t?(delete c.number,delete c.custom):"text"===t?(c.number=49,delete c.custom):"number"===t?(c.custom="#,##0.00_",delete c.number):"percent"===t?(c.number=10,delete c.custom):"rmb"===t?(c.custom="[$¥-804]#,##0.00",delete c.number):"usd"===t?(c.custom="$#,##0.00",delete c.number):"eur"===t?(c.custom="[$€-408]#,##0.00",delete c.number):"date"===t?(c.custom="mm/dd/yyyy",delete c.number):"time"===t?(c.number=21,delete c.custom):"datetime"===t?(c.custom="mm/dd/yyyy hh:mm:ss",delete c.number):"duration"===t&&(c.custom="[h]:mm:ss",delete c.number),l.style=i.addStyle(c),i.updateCellStyleOpr(s,n,o,c);else if("font-bold"===e||"font-italic"===e||"font-name"===e||"font-size"===e){var h={};h[e.split("-")[1]]=t,c.font=Object.assign(c.font||{},h),l.style=i.addStyle(c)}else"strike"===e||"textwrap"===e||"underline"===e||"align"===e||"valign"===e||"color"===e||"bgcolor"===e||"pbgcolor"===e||"pattern"===e?(c[e]=t,l.style=i.addStyle(c),"align"===e&&delete l.isautoalign):l[e]=t}))}))}},{key:"setHyperlinkStyle",value:function(e,t,i){var n=this.rows,r=this.styles,a=n.getCellOrNew(e,t),o={};void 0!==a.style&&(o=F.cloneDeep(r[a.style])),o.underline=i,o.color=i?"#0000ff":"Black",a.style=this.addStyle(o)}},{key:"setSelectedCellText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"input",i=this.autoFilter,n=this.selector,r=this.rows,a=n.ri,o=n.ci,s=a;this.unsortedRowMap.has(a)&&(s=this.unsortedRowMap.get(a));var l=r.getCell(s,o),c=l?l.text:"";if(this.setCellText(s,o,e,t),i.active()){var h=i.getFilter(o);if(h){var u=h.value.findIndex((function(e){return e===c}));u>=0&&h.value.splice(u,1,e)}}}},{key:"getSelectedCell",value:function(){var e=this.selector,t=e.ri,i=e.ci,n=t;return this.unsortedRowMap.has(t)&&(n=this.unsortedRowMap.get(t)),this.rows.getCell(n,i)}},{key:"canSelected",value:function(e,t){if(!this.sprotected)return!0;var i=e;this.unsortedRowMap.has(e)&&(i=this.unsortedRowMap.get(e));var n=this.getCellStyle(i,t);return null==n?this.canselectlocked:!(!n.unlocked||!this.canselectunlocked)||!(n.unlocked||!this.canselectlocked)}},{key:"isfirstRowCellsContainsFormula",value:function(e){for(var t=e.sci;t<=e.eci;t+=1){var i=this.getCell(e.sri,t);if(null!=i&&void 0!==i.f)return!0}return!1}},{key:"getLocked",value:function(){var e=this.selector,t=e.ri,i=e.ci;return this.getCellLocked(t,i)}},{key:"getCellLocked",value:function(e,t){if(!this.sprotected)return!1;var i=e;this.unsortedRowMap.has(e)&&(i=this.unsortedRowMap.get(e));var n=this.getCellStyle(i,t);return!(null!=n&&n.unlocked)}},{key:"getRangeLocked",value:function(e){for(var t=e.sri;t<=e.eri;t+=1)for(var i=e.sci;i<=e.eci;i+=1)if(this.getCellLocked(t,i))return!0;return!1}},{key:"xyInSelectedRect",value:function(e,t){var i=this.getSelectedRect(),n=i.left,r=i.top,a=i.width,o=i.height,s=this.settings.row.height,l=e-this.cols.indexWidth,c=t-s;return l>n&&l<n+a&&c>r&&c<r+o}},{key:"getSelectedRectBySearch",value:function(){return this.getRect(this.selector.range)}},{key:"getSelectedRect",value:function(){var e=this.selector.range.clone();if(this.freezeIsActive()){if(e.sri>=this.freeze[0]&&e.eri<this.scroll.riact)return{left:-99999,top:-99999};e.sri>=this.freeze[0]&&e.sri<this.scroll.riact&&(e.sri=this.scroll.riact)}else{if(e.eri<this.scroll.riact)return{left:-99999,top:-99999};e.sri<this.scroll.riact&&(e.sri=this.scroll.riact)}return this.getRect(e)}},{key:"getRectForTextbox",value:function(e){var t=this.scroll,i=(this.rows,this.cols),n=(this.exceptRowSet,this.displayRight2Left),r=this.freeze,a=this.zoomlevel,s=new x(e.row,e.col,e.row,e.col),l=s.sri,c=s.sci,h=(s.eri,s.eci);if(l<0&&c<0)return{left:0,l:0,top:0,t:0,scroll:t};var u=o()(r,2)[1],f=n?e.left+i.indexWidth:e.left,d=e.top,m=e.height,g=e.width,v=n?u>0&&h>=u||0===u?f-t.x:f:f-t.x,p=this.freezeTotalHeight(),y=this.freezeTotalWidth(),b=e.top-t.y;return y>0&&y>f&&!n&&(v=f),p>0&&p>d&&(b=d),{l:f*a,t:d*a,left:v*a,top:b*a,height:m*a,width:g*a,scroll:t}}},{key:"getClipboardRect",value:function(){var e=this.clipboard;return e.isClear()?{left:-100,top:-100}:this.getRect(e.range)}},{key:"getRect",value:function(e){var t=this.scroll,i=this.rows,n=this.cols,r=this.exceptRowSet,a=this.displayRight2Left,s=this.freeze,l=this.zoomlevel,c=e.sri,h=e.sci,u=e.eri,f=e.eci;if(c<0&&h<0)return{left:0,l:0,top:0,t:0,scroll:t};var d=o()(s,2)[1],m=a?this.viewWidth()-n.indexWidth-n.sumWidth(0,f+1):n.sumWidth(0,h),g=i.sumHeight(0,c,r),v=i.sumHeight(c,u+1,r)*l,p=n.sumWidth(h,f+1)*l,y=a?d>0&&f>=d||0===d?m+t.x:m:m-t.x,b=this.freezeTotalHeight(),w=this.freezeTotalWidth(),x=i.sumHeight(t.riact,c,r)+b;return w>0&&w>m&&!a&&(y=m),b>0&&b>g&&(x=g),{l:m*l,t:g*l,left:y*l,top:x*l,height:v,width:p,scroll:t}}},{key:"getCellRectByXY",value:function(e,t){var i=this.scroll,n=this.merges,r=this.rows,a=this.cols,o=this.zoomlevel,s=ge.call(this,t,i.y),l=s.ri,c=s.top,h=s.height,u=ve.call(this,e,i.x),f=u.ci,d=u.left,m=u.width;if(-1===f&&(m=a.totalWidth()),-1===l&&(h=r.totalHeight()),l>=0||f>=0){var g=n.getFirstIncludes(l,f);if(g){l=g.sri,f=g.sci;var v=this.cellRectWithOutTransfer(l,f);d=v.left,c=v.top,m=v.width,h=v.height}}return{ri:l,ci:f,left:d*o,top:c*o,width:m*o,height:h*o}}},{key:"isSignleSelected",value:function(){var e=this.selector.range,t=e.sri,i=e.sci,n=e.eri,r=e.eci,a=this.getCell(t,i);if(a&&a.merge){var s=o()(a.merge,2),l=s[0],c=s[1];if(t+l===n&&i+c===r)return!0}return!this.selector.multiple()}},{key:"canUnmerge",value:function(){var e=this.selector.range,t=e.sri,i=e.sci,n=e.eri,r=e.eci,a=this.getCell(t,i);if(a&&a.merge){var s=o()(a.merge,2),l=s[0],c=s[1];if(t+l===n&&i+c===r)return!0}return!1}},{key:"merge",value:function(){var e=this.selector,t=this.rows;if(!this.isSignleSelected()){var i=e.size(),n=o()(i,2),r=n[0],a=n[1];if(r>1||a>1){var s=e.range,l=s.sri,c=s.sci,h=t.getCellOrNew(l,c);h.merge=[r-1,a-1],this.merges.add(e.range),this.rows.deleteCells(e.range),this.rows.setCell(l,c,h)}}}},{key:"unmerge",value:function(){var e=this.selector;if(this.isSignleSelected()){var t=e.range,i=t.sri,n=t.sci;this.rows.deleteCell(i,n,"merge"),this.merges.deleteWithin(e.range)}}},{key:"canAutofilter",value:function(){return!this.autoFilter.active()}},{key:"autofilter",value:function(){var e=this,t=this.autoFilter,i=this.selector,n=this.TableAutoFilters;if(!t.active())for(var r=0,a=n.length;r<a;r++){var o=n[r],s=x.valueOf(o.ref);if(!(s.eci<i.range.sci||i.range.eci<s.sci))return void le("Warning","there is already table autofilter in the selected range")}this.changeData((function(){t.active()?(t.clear(),e.exceptRowSet=new Set,e.sortedRowMap=new Map,e.unsortedRowMap=new Map):t.ref=i.range.toString()}))}},{key:"autoSort",value:function(){var e=this.autoFilter,t=this.selector;this.changeData((function(){e.filters=[],e.ref=t.range.toString()}))}},{key:"sortByRowIdArray",value:function(e,t){for(var i=this.rows,n=e.sri,r=e.eri,a=e.sci,o=e.eci,s=[],l=0,c=t.length;l<c;l++){for(var h=i._[t[l]].cells,u=[],f=a;f<=o;f++)void 0!==h[f]&&u.push({id:f,v:F.cloneDeep(h[f])});s.push(u)}for(var d=0,m=n;m<=r;m++)if(t[d++]!==m){for(var g=i._[m].cells,v=a;v<=o;v++)delete g[v];for(var p=s[d-1],y=0,b=p.length;y<b;y++){var w=p[y];g[w.id]=w.v}}}},{key:"doSort",value:function(e,t,i){var n=this.name,r=this.selector.range,a=(r.sri,r.eri,r.sci,r.eci,{name:n,src:r,ci:e,order:t,isheader:i,op:"sort"});this.updateCellServer(a)}},{key:"setAutoFilter",value:function(e,t,i,n){var r=this.currentAutoFilter;void 0===r&&(r=this.autoFilter),r.addFilter(e,i,n),r.setSort(e,t),this.resetAutoFilter()}},{key:"resetAutoFilter",value:function(){var e=this,t=this.currentAutoFilter,i=this.rows,n=t;if(void 0===n&&(n=this.autoFilter),n.active()){var r=n.sort,a=n.filteredRows((function(e,t){return i.getCell(e,t)})),o=a.rset,s=a.fset,l=Array.from(s),c=Array.from(s);r&&l.sort((function(e,t){if("desc"===r.order){var n=e;e=t,t=n}var a=i.getCell(e,r.ci),o=i.getCell(t,r.ci);if(null!=a&&""===a.text&&(a=null),null!=o&&""===o.text&&(o=null),null==a&&null==o)return e-t;if(null==a)return"asc"===r.order?1:-1;if(null==o)return"asc"===r.order?-1:1;a=a.text,o=o.text;var s=isNaN(Number(a)),l=isNaN(Number(o));return s&&l?a.localeCompare(o):s&&!l?1:!s&&l?-1:Number(a)-Number(o)})),this.exceptRowSet=o,this.sortedRowMap=new Map,this.unsortedRowMap=new Map,l.forEach((function(t,i){e.sortedRowMap.set(c[i],t),e.unsortedRowMap.set(t,c[i])}))}}},{key:"deleteExceptRowHideForAutoFilter",value:function(){var e=this.exceptRowSet,t=this.rows;e.forEach((function(e){t.get(e)&&(t.get(e).hide=void 0)}))}},{key:"updateMyConditionImages",value:function(e){var t=this.conditionimg,i=(this.rows,this.styles,this);e&&e.forEach((function(e){if(t){var n=t.find((function(t){return t.row===e.row&&t.col===e.col}));n?n.image.src="data:image/png;base64,"+e.data:i.insertConditionImage(e)}}))}},{key:"createConditionImage",value:function(e,t){var i=this.displayRight2Left,n=new Image;n.src="data:image/png;base64,"+e.data;var r=this.cols.sumWidth(0,e.col),a=this.rows.sumHeight(0,e.row);if(0===e.type){n.style.zIndex=t+1;var o=this.getCellStyle(e.row,e.col);null!=o&&"bottom"===o.valign&&(a+=this.rows.getHeight(e.row)-16)}else n.style.zIndex=t,n.style.opacity=.88;if((this.rows.isHide(e.row)||this.cols.isHide(e.col)||this.exceptRowSet.has(e.row))&&(n.style.display="none"),i){var s=this.viewWidth();n.style.left=s-r+"px"}else n.style.left=r+"px";if(n.style.top=a+"px",n.style.position="absolute",void 0===e.ol){var l=parseInt(n.style.left),c=parseInt(n.style.top);e.ol=l,e.ot=c}return n}},{key:"updateConditionImageVisible",value:function(){var e=this.exceptRowSet,t=this.rows,i=this.cols;this.conditionimg&&this.conditionimg.forEach((function(n){t.isHide(n.row)||i.isHide(n.col)||e.has(n.row)?n.image.style.display="none":n.image.style.display="block"}))}},{key:"updateConditionImageDirection",value:function(){var e=this.displayRight2Left,t=this.cols,i=this.zoomlevel,n=this.viewWidth()-t.indexWidth;this.conditionimg&&this.conditionimg.forEach((function(r){r.image&&(r.image.style.left=e?(n-r.ol-t.getWidth(r.col))*i+"px":r.ol*i+"px")}))}},{key:"updateConditionImageZoom",value:function(){this.exceptRowSet,this.rows,this.cols;var e=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(t){if(t.ow||(t.ow=t.image.width,t.oh=t.image.height),t.image.style.left=t.ol*e+"px",t.image.style.top=t.ot*e+"px",t.ow){t.image.height;t.image.width=t.ow*e,1===t.type&&(t.image.height=t.oh*e)}}))}},{key:"updateConditionImagePositionForCol",value:function(e,t,i){var n=this.displayRight2Left,r=this.cols,a=this.zoomlevel;if(this.conditionimg){var o=this.viewWidth()-r.indexWidth;this.conditionimg.forEach((function(s){if(s.col>e)s.ol+=t,s.image.style.left=n?(o-s.ol-r.getWidth(s.col))*a+"px":s.ol*a+"px";else if(s.col===e){if(1===s.type){var l=s.image.height;s.image.width=i*a,s.ow=i,s.image.height=l}n&&(s.image.style.left=(o-s.ol-r.getWidth(s.col))*a+"px")}}))}}},{key:"updateConditionImagePositionForRow",value:function(e,t,i){var n=this.zoomlevel;this.conditionimg&&this.conditionimg.forEach((function(r){if(r.row>e)r.ot+=t,r.image.style.top=r.ot*n+"px";else if(r.row===e&&1===r.type){var a=r.image.width;r.image.height=i*n,r.oh=i,r.image.width=a}}))}},{key:"updateConditionImageForColInsert",value:function(e,t){var i=this.conditionimg,n=this.cols,r=this.displayRight2Left,a=this.zoomlevel;if(i){var o=this.viewWidth()-n.indexWidth,s=n.sumWidth(e,t+1),l=t-e+1;i.forEach((function(t){t.col>=e&&(t.ol+=s,t.image.style.left=r?(o-t.ol-n.getWidth(t.col))*a+"px":t.ol*a+"px",l&&(t.col+=l))}))}}},{key:"updateConditionImageForRowInsert",value:function(e,t){var i=this.conditionimg,n=this.rows,r=this.zoomlevel;if(i){var a=n.sumHeight(e,t+1),o=t-e+1;i.forEach((function(t){t.row>=e&&(t.ot+=a,t.image.style.top=t.ot*r+"px",o&&(t.row+=o))}))}}},{key:"updateConditionImageForRowDelete",value:function(e,t,i){var n=this.conditionimg,r=(this.rows,this.zoomlevel);if(n)for(var a=t-e+1,o=n.length-1;o>=0;o--){var s=n[o];s.row>=e&&s.row<=t?(s.image.remove(),n.splice(o,1)):s.row>t&&(s.ot+=i,s.image.style.top=s.ot*r+"px",a&&(s.row-=a))}}},{key:"updateConditionImageForColDelete",value:function(e,t,i){var n=this.conditionimg,r=this.cols,a=this.displayRight2Left,o=this.zoomlevel;if(n)for(var s=this.viewWidth()-r.indexWidth,l=n.length-1;l>=0;l--){var c=n[l];if(c.col>=e&&c.col<=t)c.image.remove(),n.splice(l,1);else if(c.col>t){c.ol+=i,c.image.style.left=a?(s-c.ol-r.getWidth(c.col))*o+"px":c.ol*o+"px";var h=t-e+1;h&&(c.col-=h)}}}},{key:"deleteCell",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",i=this.selector,n=this.name;this.changeData((function(){e.rows.deleteCells(i.range,t),"all"!==t&&"format"!==t||e.merges.deleteWithin(i.range),e.delCellOpr(n,i.range,t)}))}},{key:"insert",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.changeData((function(){var n=t.selector.range,r=n.sri,a=n.sci,o=t.rows,s=t.merges,l=t.cols,c=t.name,h=r;if("row"===e){o.insert(r,i),t.updateConditionImageForRowInsert(r,r+i-1);var u=o.getHeight(r-1);t.insertRowOpr(c,r,i,u)}else if("column"===e){o.insertColumn(a,i),h=a,l.len+=i;for(var f=l.getWidth(a-1),d=l.len,m=0;m<i;m++)l._[d-1-m]={};for(var g=d-1;g>=a;g--)l._[g].width=g>=i?l._[g-i].width:l.width;t.insertColumnOpr(c,a,i,f),t.updateConditionImageForColInsert(a,a+i-1)}s.shift(e,h,i,(function(e,t,i,n){var r=o.getCell(e,t);r.merge[0]+=i,r.merge[1]+=n}))}),!1)}},{key:"delete",value:function(e){var t=this,i=this.selector.range,n=i.sri,r=i.sci,a=i.eri,o=i.eci;n<0&&(n=0),a<n||(r<0&&(r=0),o<r||this.changeData((function(){var i=t.rows,n=t.merges,r=t.selector,a=t.cols,o=t.name,s=r.range,l=r.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci,d=c,m=0;if("row"===e){if(c<0&&(c=0),u<c)return;if(confirm("sure to delete rows from "+(c+1)+" to "+(u+1))){m=u-c+1;var g=-i.sumHeight(c,u+1);i.delete(c,u),t.deleteRowOpr(o,c,u),t.updateConditionImageForRowDelete(c,u,g)}}else if("column"===e){if(h<0&&(h=0),f<h)return;if(confirm("sure to delete columns from "+(h+1)+" to "+(f+1))){var v=-a.sumWidth(h,f+1);i.deleteColumn(h,f),d=s.sci,m=f-h+1,a.len-=m;for(var p=h;p<a.len-m;p++)a._[p].width=a._[p+m].width;for(var y=a.len;y<a.len+m;y++)delete a._[y];t.deleteColumnOpr(o,h,f),t.updateConditionImageForColDelete(h,f,v)}}n.shift(e,d,-m,(function(e,t,n,r){var a=i.getCell(e,t);a.merge[0]+=n,a.merge[1]+=r,0===a.merge[0]&&0===a.merge[1]&&delete a.merge}))}),!1))}},{key:"deletelocalonly",value:function(e,t,i){var n=this;this.changeData((function(){var r=n.rows,a=n.merges;n.cols;"row"===e?r.delete(t,t+i-1):"column"===e&&r.deleteColumn(t,t+i-1),a.shift(e,t,-i,(function(e,t,i,n){var a=r.getCell(e,t);a.merge[0]+=i,a.merge[1]+=n,0===a.merge[0]&&0===a.merge[1]&&delete a.merge}))}),!1)}},{key:"updateRevertOpr",value:function(e){"insertrow"===e.op?this.deletelocalonly("row",e.ri,e.n):"insertcol"===e.op&&this.deletelocalonly("column",e.ci,e.n)}},{key:"scrollx",value:function(e,t){var i=this.scroll,n=this.freeze,r=this.cols;this.displayRight2Left&&(e=-e);var a=o()(n,2)[1],s=F.rangeReduceIf(a,r.len,0,0,e,(function(e){return r.getWidth(e)})),l=o()(s,3),c=l[0],h=l[1],u=l[2],f=h;e>0&&(f+=u),i.x!==f&&(i.ci=e>0?c:0,i.x=f,t())}},{key:"scrolly",value:function(e,t){var i=this.scroll,n=this.freeze,r=this.rows,a=this.exceptRowSet,s=o()(n,1)[0],l=F.rangeReduceIf(s,r.len,0,0,e,(function(e){return r.getHeight(e,a)})),c=o()(l,3),h=c[0],u=c[1],f=c[2],d=u;if(e>0&&(d+=f),i.y!==d){for(i.ri=e>0?h:0,i.y=d,0===i.ri&&this.freeze[0]>0&&(i.ri=this.freeze[0],i.y=0),i.yact=i.y,i.riact=i.ri;this.isInvisibleRow(i.riact);)i.yact+=r.getHeight(i.riact,a),i.riact++;t()}}},{key:"isInvisibleRow",value:function(e){var t=this.exceptRowSet;return this.rows.isHide(e)||t.has(e)}},{key:"cellRect",value:function(e,t){var i=this.rows,n=this.cols,r=this.exceptRowSet,a=this.displayRight2Left,s=this.scroll,l=i.sumHeight(0,e,r),c=i.getCell(e,t),h=n.getWidth(t),u=i.getHeight(e);if(null!==c&&c.merge){var f=o()(c.merge,2),d=f[0],m=f[1];if(d>0)for(var g=1;g<=d;g+=1)u+=i.getHeight(e+g);if(m>0)for(var v=1;v<=m;v+=1)h+=n.getWidth(t+v)}var p=a?this.viewWidth()-n.sumWidth(0,t)-h+2*s.x:n.sumWidth(0,t);if(a){var y=o()(this.freeze,2),b=(y[0],y[1]);b>0&&t<b&&(p-=2*s.x)}return{left:p,top:l,width:h,height:u,cell:c}}},{key:"cellRectWithOutTransfer",value:function(e,t){var i=this.cellRect(e,t),n=this.displayRight2Left,r=this.cols,a=this.scroll,s=this.zoomlevel,l=r.indexWidth,c=this.settings.row.height;i.top+=c;var h=o()(this.freeze,2),u=(h[0],h[1]);return n?(i.left-=l,i.left+=i.width,t>u&&(i.left-=a.x)):(i.left+=l,t>u&&(i.left-=a.x)),e>u&&(i.top-=a.y),i.left*=s,i.top*=s,i.width*=s,i.height*=s,i}},{key:"getCell",value:function(e,t){return this.rows.getCell(e,t)}},{key:"getCellTextOrDefault",value:function(e,t){var i=this.getCell(e,t);return i&&i.text?i.text:""}},{key:"isEmpty",value:function(e,t){var i=this.getCell(e,t);return!i||!i.text||0===i.text.trim().length}},{key:"getCellStyle",value:function(e,t){var i=this.getCell(e,t);return i&&void 0!==i.style?this.styles[i.style]:null}},{key:"getCellStyleOrDefault",value:function(e,t){var i=this.styles,n=this.rows,r=this.displayRight2Left,a=n.getCell(e,t),o=a&&void 0!==a.style?i[a.style]:{},s=F.merge(this.defaultStyle(),o);if(void 0!==o.bgcolor&&(s.hasbgcolor=!0),a&&void 0!==a.merge){if(0!=a.merge[1]){var l=n.getCell(e,t+a.merge[1]),c=l&&void 0!==l.style?i[l.style]:{};c.border&&void 0!==c.border.right&&(void 0===o.border&&(o.border={}),o.border.right=c.border.right)}if(0!=a.merge[0]){var h=n.getCell(e+a.merge[0],t),u=h&&void 0!==h.style?i[h.style]:{};u.border&&void 0!==u.border.bottom&&(void 0===o.border&&(o.border={}),o.border.bottom=u.border.bottom)}}if(void 0!==s.border&&r){var f=s.border.right;s.border.right=s.border.left,s.border.left=f}return s}},{key:"getSelectedCellStyle",value:function(){var e=this.selector,t=e.ri,i=e.ci;return this.getCellStyleOrDefault(t,i)}},{key:"setCellText",value:function(e,t,i,n){var r=this.rows,a=this.history,o=this.validations,s=this.settings,l=this.name;"finished"===n?("server"!==s.updateMode&&(r.setCellText(e,t,""),a.add(this.getData()),r.setCellText(e,t,i)),"server"===s.updateMode&&this.updateCellTextOpr(l,e,t,i)):r.setCellText(e,t,i),o.validate(e,t,i)}},{key:"updateTextbox",value:function(e,t){this.settings;var i=this.name;e.ischange&&(e.ischange=!1,this.updateTextboxOpr(i,e,t))}},{key:"isNumber",value:function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},{key:"isDate",value:function(e){return isNaN(e)&&!isNaN(Date.parse(e))}},{key:"setLinkedShape",value:function(e,t,i){this.rows.getCellOrNew(e,t).lc=i}},{key:"setCellAutoAlignment",value:function(e,t,i){var n=this.styles,r=this.rows.getCellOrNew(e,t),a={};void 0!==r.style&&(a=F.cloneDeep(n[r.style])),(r.isautoalign||void 0===a.align)&&(a.align=i,r.style=this.addStyle(a),r.isautoalign=!0)}},{key:"cutPasteRangeOpr",value:function(e,t,i){var n={name:e,src:t,dest:i,op:"cutpaste"};this.updateCellServer(n)}},{key:"copyPasteRangeOpr",value:function(e,t,i,n){var r={name:e,src:t,dest:i,op:"copypaste",what:n};this.updateCellServer(r)}},{key:"autofillRangeOpr",value:function(e,t,i,n){var r={name:e,src:t,dest:i,op:"autofill",what:n};this.updateCellServer(r)}},{key:"updateBatchCellsOpr",value:function(e,t,i,n,r){var a={name:e,cells:t,src:i,dest:n,what:r,op:"batchupdate"};this.updateCellServer(a)}},{key:"updateCellStyleOpr",value:function(e,t,i,n){var r={name:e,ri:t,ci:i,number:n.number,custom:n.custom,op:"updatestyle"};this.updateCellServer(r)}},{key:"updateCellTextOpr",value:function(e,t,i,n){var r=n.startsWith("<font style=")||n.startsWith("<Font Style=")?"updatehtml":"update",a={name:e,ri:t,ci:i,text:n,op:r};this.updateCellServer(a)}},{key:"updateTextboxOpr",value:function(e,t,i){var n={name:e,id:t.strid,text:i,w:t.width,h:t.height,op:"updateTextBox"};this.updateCellServer(n)}},{key:"delCellOpr",value:function(e,t,i){var n={name:e,range:t,what:i,op:"delcells"};this.updateCellServer(n)}},{key:"addSheetOpr",value:function(e){var t={name:e,op:"add"};this.updateCellServer(t)}},{key:"delSheetOpr",value:function(e){var t={name:e,op:"del"};this.updateCellServer(t)}},{key:"renameSheetOpr",value:function(e,t){var i={oldname:e,name:t,op:"rename"};this.updateCellServer(i)}},{key:"insertRowOpr",value:function(e,t,i,n){var r={name:e,ri:t,n:i,h:n,op:"insertrow"};this.updateCellServer(r)}},{key:"insertColumnOpr",value:function(e,t,i,n){var r={name:e,ci:t,n:i,w:n,op:"insertcol"};this.updateCellServer(r)}},{key:"deleteRowOpr",value:function(e,t,i){var n={name:e,sri:t,eri:i,op:"delrow"};this.updateCellServer(n)}},{key:"deleteColumnOpr",value:function(e,t,i){var n={name:e,sci:t,eci:i,op:"delcol"};this.updateCellServer(n)}},{key:"setAutoAlignForCell",value:function(e){e.ufv||this.isNumber(e.text)||this.isDate(e.text)?this.setCellAutoAlignment(e.ri,e.ci,"right"):this.setCellAutoAlignment(e.ri,e.ci,"left")}},{key:"updateMyCells",value:function(e){var t=this,i=this.styles,n=this.rows,r=this.search,a=this;e.forEach((function(e,r,o){var s=n.updateOneCell(e);if(e.bgcolor){var l={};void 0!==s.style&&(l=F.cloneDeep(i[s.style])),l.bgcolor=e.bgcolor,s.style=a.addStyle(l)}t.setAutoAlignForCell(e)})),"comments"!==r.lookin&&(r.result=null)}},{key:"updateShapes",value:function(e,t){var i=this.shapes;null!=i&&null!=e&&e.forEach((function(e,n,r){for(var a=0,o=i.length;a<o;a++)if(i[a].id===e.id){var s={};s.id="s_"+e.id+"_"+i[a].tick,s.name=e.id+"."+e.tick,s.it=i[a],t.push(s),$("#"+s.id).addClass("resize-image").removeAttr("src");break}}))}},{key:"updateShapeSrcToRefresh",value:function(e,t,i,n){if(n.length>0){var r=this;$.get(t+"?uid="+e+"&id="+i,(function(e){r.fillImageOnebyOne(e,n)}))}}},{key:"validateFormula",value:function(e){for(var t=0,i=0;i<e.length;i++)"("===e[i]?t++:")"===e[i]&&t--;return 0===t}},{key:"freezeIsActive",value:function(){var e=o()(this.freeze,2),t=e[0],i=e[1];return t>0||i>0}},{key:"resetScroll",value:function(){var e=this.scroll;e.riact=0,e.ri=0,e.y=0,e.yact=0,e.x=0,e.ci=0}},{key:"setFreeze",value:function(e,t){var i=this;0===e&&this.resetScroll(),this.changeData((function(){i.freeze=[e,t]}))}},{key:"freezeTotalWidth",value:function(){return this.cols.sumWidth(0,this.freeze[1])}},{key:"freezeTotalHeight",value:function(){return this.rows.sumHeight(0,this.freeze[0],this.exceptRowSet)}},{key:"setRowHeight",value:function(e,t){var i=this;this.changeData((function(){i.rows.setHeight(e,t)}))}},{key:"setColWidth",value:function(e,t){var i=this;this.changeData((function(){i.cols.setWidth(e,t)}))}},{key:"viewHeight",value:function(){var e=this.settings,t=e.view,i=e.showToolbar,n=e.showFileName,r=t.height();return r-=26,r-=41,i&&(r-=41,this.menubarStatus()&&(r-=n?80:40)),r}},{key:"viewWidth",value:function(){return this.settings.view.width()}},{key:"freezeViewRange",value:function(){var e=o()(this.freeze,2),t=e[0],i=e[1];return new x(0,0,t-1,i-1,this.freezeTotalWidth(),this.freezeTotalHeight())}},{key:"contentRange",value:function(){var e=this.rows,t=this.cols,i=e.maxCell(),n=o()(i,2),r=n[0],a=n[1],s=e.sumHeight(0,r+1),l=t.sumWidth(0,a+1);return new x(0,0,r,a,l,s)}},{key:"exceptRowTotalHeight",value:function(e,t){var i=this.exceptRowSet,n=this.rows,r=Array.from(i),a=0;return r.forEach((function(i){if(i<e||i>t){var r=n.getHeight(i);a+=r}})),a}},{key:"viewRange",value:function(){var e=this.scroll,t=this.rows,i=this.cols,n=this.freeze,r=this.exceptRowSet,a=e.ri,s=e.ci;a<=0&&(a=o()(n,1)[0]);s<=0&&(s=o()(n,2)[1]);for(var l=[this.freezeTotalWidth(),0],c=l[0],h=l[1],u=[t.len,i.len],f=u[0],d=u[1],m=a;m<t.len&&(r.has(m)||(h+=t.getHeight(m),f=m),!(h>this.viewHeight()/this.zoomlevel));m+=1);for(var g=s;g<i.len&&(d=g,!((c+=i.getWidth(g))>this.viewWidth()/this.zoomlevel));g+=1);var v=new x(a,s,f,d,c,h);return this.viewRangeCache=v,v}},{key:"eachMergesInView",value:function(e,t){this.merges.filterIntersects(e).forEach((function(e){return t(e)}))}},{key:"hideRowsOrCols",value:function(){var e=this.rows,t=this.cols,i=this.selector,n=i.size(),r=o()(n,2),a=r[0],s=r[1],l=i.range,c=l.sri,h=l.sci,u=l.eri,f=l.eci;if(a===e.len)for(var d=h;d<=f;d+=1)t.setHide(d,!0);else if(s===t.len)for(var m=c;m<=u;m+=1)e.setHide(m,!0)}},{key:"unhideRowsOrCols",value:function(e,t){this["".concat(e,"s")].unhide(t)}},{key:"rowEach",value:function(e,t,i){for(var n=0,r=this.rows,a=this.exceptRowSet,o=(m()(a),0),s=e+o;s<=t;s+=1)if(a.has(s))o+=1;else{var l=r.getHeight(s);if(l>0){if(i(s,n,l),n+=l,this.zoomlevel<1&&n>this.viewHeight()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewHeight())break}}}},{key:"colEach",value:function(e,t,i){for(var n=0,r=this.cols,a=e;a<=t;a+=1){var o=r.getWidth(a);if(o>0){if(i(a,n,o),n+=o,this.zoomlevel<1&&n>this.viewWidth()/this.zoomlevel)break;if(this.zoomlevel>=1&&n>this.viewWidth())break}}}},{key:"generatePicItems",value:function(e,t,i){var n=new Array;null!=e&&e.forEach((function(e){if(null==e.src){var t={};t.id="p_"+e.id+"_"+e.tick,void 0===e.refid?t.name=e.id+"."+e.tick:t.name=e.refid+"."+e.tick,t.it=e,n.push(t)}})),null!=t&&t.forEach((function(e){if(null==e.src){var t={};t.id="s_"+e.id+"_"+e.tick,void 0===e.refid?t.name=e.id+"."+e.tick:t.name=e.refid+"."+e.tick,t.it=e,n.push(t)}})),this.loadCount=n.length,this.fillImageOnebyOne(i,n)}},{key:"defaultStyle",value:function(){return this.settings.style}},{key:"addStyle",value:function(e){for(var t=this.styles,i=0;i<t.length;i+=1){var n=t[i];if(F.equals(n,e))return i}return t.push(e),t.length-1}},{key:"changeData",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=void 0!==i?i:this.selector.range;if(this.history.add(this.getRangeData(n)),e(),this.change(this.getData()),t)for(var r=n.sri,a=(n.sci,n.eri),o=(n.eci,r);o<=a;o++)this.updateRows.add(o)}},{key:"setRangeData",value:function(e){this.rows.setRangeData(e.rows,e.range),this.merges.setData(e.merges)}},{key:"setData",value:function(e){var t=this;return Object.keys(e).forEach((function(i){if("merges"===i||"rows"===i||"cols"===i||"validations"===i)t[i].setData(e[i]);else if("freeze"===i){var n=y(e[i]),r=o()(n,2),a=r[0],s=r[1];t.freeze=[s,a]}else if("autofilter"===i)t.autoFilter.setData(e[i]);else if("lautofilters"===i){var l=e[i],c=t;l.forEach((function(e){var t=new R;t.setData(e),c.TableAutoFilters.push(t)}))}else void 0!==e[i]&&(t[i]=e[i])})),this}},{key:"getData",value:function(){var e=this.name,t=this.freeze,i=this.styles,n=this.merges,r=this.rows,a=this.cols,o=this.validations,s=this.autoFilter,l=this.TableAutoFilters,c={name:e,freeze:b(t[1],t[0]),styles:i,merges:n.getData(),rows:r.getData(),cols:a.getData(),validations:o.getData(),autofilter:s.getData(),TableAutoFilters:[]};return l.forEach((function(e){c.TableAutoFilters.push(e.getData())})),c}},{key:"getRangeData",value:function(e){var t=this.merges,i=this.rows;this.styles;return{rows:i.getRangeData(e),merges:t.getData(),range:e}}},{key:"getDataForSave",value:function(){var e=this.name,t=this.freeze,i=this.styles,n=this.merges,r=this.rows,a=this.cols,o=this.validations,s=this.autoFilter,l=this.settings,c=this.updateRows,h=this.updateRowsHeight,u=this.updateCols,f=this.canselectlocked,d=this.sprotected,m=this.canselectunlocked,g=this.showGrid,v=this.comments,p=this.images,y=this.shapes;return{name:e,freeze:b(t[1],t[0]),styles:i,comments:v,canselectlocked:f,sprotected:d,canselectunlocked:m,showGrid:g,merges:n.getDataForSave(),settings:l,cols:a.getDataForSave(u),rows:r.getDataForRowsSet(c),rowh:r.getHeightForSave(h),validations:o.getData(),autofilter:s.getData(),images:null!=p?p.filter((function(e){return e.changed})).map((function(e){var t={};return t.left=e.left,t.top=e.top,t.originAngle=e.originAngle,t.angle=e.angle,t.zorder=e.zorder,t.width=e.originWidth*e.scaleX,t.height=e.originHeight*e.scaleY,t.op=e.op,t.id=e.id,e.hyperlink&&(t.hyperlink=e.hyperlink),t})):[],shapes:null!=y?y.filter((function(e){return e.changed})).map((function(e){var t={};return t.left=e.left,t.top=e.top,t.originAngle=e.originAngle,t.angle=e.angle,t.zorder=e.zorder,t.width=e.originWidth*e.scaleX,t.height=e.originHeight*e.scaleY,t.op=e.op,t.id=e.id,e.hyperlink&&(t.hyperlink=e.hyperlink),t})):[]}}}]),e}(),ye=i(12),be=i.n(ye),we=i(7),xe=i.n(we),ke=i(11),Ce=i.n(ke),_e=i(15),Se=i.n(_e);function Te(e,t,i){e.addEventListener(t,i)}function Oe(e,t,i){e.removeEventListener(t,i)}function Ee(e){e.xclickoutside&&(Oe(window.document.body,"click",e.xclickoutside),delete e.xclickoutside)}function Re(e,t){e.xclickoutside=function(i){2===i.detail||e.contains(i.target)||(t?t(e):(e.hide(),Ee(e)))},Te(window.document.body,"click",e.xclickoutside)}function Ie(e,t,i){Te(e,"mousemove",t),e.xEvtUp=function(n){Oe(e,"mousemove",t),Oe(e,"mouseup",e.xEvtUp),i(n)},Te(e,"mouseup",e.xEvtUp)}var Ae=null;function De(){clearInterval(Ae),Ae=null}function Pe(e,t){(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];Ae||(Ae=setInterval((function(){e.apply(void 0,i)}),400))})((function(){e.selectMoveDown(),e.canvas.publishEvent("object:scroll",e.data)}))}function Fe(e,t){var i="object"===("undefined"==typeof window?"undefined":Se()(window))?window.navigator.userAgent:"";if(/Android/i.test(i)){var n=window.innerHeight;window.addEventListener("resize",(function(i){var r=window.innerHeight;n>r?"true"===document.activeElement.contentEditable&&t(i):e(i)}))}else/iPhone|iPod|iPad/i.test(i)&&(window.addEventListener("focusin",(function(e){t(e)})),window.addEventListener("focusout",(function(t){e(t)})))}var Me=function(){function e(){var t=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;l()(this,e),this.moving=!1,this.sheet=r,this.vertical=i,this.el=f("div","".concat(ae,"-resizer ").concat(i?"vertical":"horizontal")).children(this.unhideHoverEl=f("div","".concat(ae,"-resizer-hover")).on("dblclick.stop",(function(e){return t.mousedblclickHandler(e)})).css("position","absolute").hide(),this.hoverEl=f("div","".concat(ae,"-resizer-hover")).on("mousedown.stop",(function(e){return t.mousedownHandler(e)})),this.lineEl=f("div","".concat(ae,"-resizer-line")).hide()).hide(),this.cRect=null,this.IsRight2Left=!1,this.finishedFn=null,this.minDistance=n,this.maxRowHeight=408,this.maxColWidth=254,this.unhideFn=function(){}}return r()(e,[{key:"showUnhide",value:function(e){this.unhideIndex=e,this.unhideHoverEl.show()}},{key:"hideUnhide",value:function(){this.unhideHoverEl.hide()}},{key:"show",value:function(e,t,i){var n=this.moving,r=this.vertical,a=this.hoverEl,o=this.lineEl,s=this.el,l=this.unhideHoverEl;if(!n){this.IsRight2Left=i,this.cRect=e;var c=e.left,h=e.top,u=e.width,f=e.height,d=i?c-u:c+u-5;s.offset({left:r?d:c,top:r?h:h+f-5}).show(),a.offset({width:r?5:u,height:r?f:5}),o.offset({width:r?0:t.width,height:r?t.height:0}),l.offset({left:r?5-u:c,top:r?h:5-f,width:r?5:u,height:r?f:5})}}},{key:"hide",value:function(){this.el.offset({left:0,top:0}).hide(),this.hideUnhide()}},{key:"mousedblclickHandler",value:function(){this.unhideIndex&&this.unhideFn(this.unhideIndex)}},{key:"mousedownHandler",value:function(e){var t=this,i=e,n=this.el,r=this.lineEl,a=this.cRect,o=this.vertical,s=this.minDistance,l=this.IsRight2Left,c=this.maxRowHeight,h=this.maxColWidth,u=o?a.width:a.height;u=Math.round(u),r.show(),Ie(window,(function(e){t.moving=!0,null!==i&&1===e.buttons&&(o?(l?u-=e.movementX:u+=e.movementX,u>s&&u<h&&(l?n.css("left","".concat(a.left-u,"px")):n.css("left","".concat(a.left+u,"px")))):(u+=e.movementY)>s&&u<c&&n.css("top","".concat(a.top+u,"px")),i=e)}),(function(){i=null,r.hide(),t.moving=!1,t.hide(),t.finishedFn&&(u<s&&(u=s),o?u>h&&(u=h):u>c&&(u=c),t.finishedFn(a,u))}))}}]),e}(),Le=function(){function e(t){var i=this;l()(this,e),this.vertical=t,this.moveFn=null,this.el=f("div","".concat(ae,"-scrollbar ").concat(t?"vertical":"horizontal")).child(this.contentEl=f("div","")).on("mousemove.stop",(function(){})).on("scroll.stop",(function(e){var t=e.target,n=t.scrollTop,r=t.scrollLeft;i.moveFn&&i.moveFn(i.vertical?n:r,e)}))}return r()(e,[{key:"move",value:function(e){return this.el.scroll(e),this}},{key:"scroll",value:function(){return this.el.scroll()}},{key:"set",value:function(e,t){var i=e-1;if(t>i){var n=this.vertical?"height":"width";this.el.css(n,"".concat(i-50,"px")).show(),this.contentEl.css(this.vertical?"width":"height","1px").css(n,"".concat(t,"px"))}else this.el.hide();return this}}]),e}(),je=10,ze=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];l()(this,e),this.isreadonly=t,this.useHideInput=i,this.inputChange=function(){},this.cornerEl=f("div","".concat(ae,"-selector-corner")),this.areaEl=f("div","".concat(ae,"-selector-area")).child(this.cornerEl).hide(),window.mobileAndTabletCheck()&&this.cornerEl.child(f("div","".concat(ae,"-selector-corner-shape"))),this.clipboardEl=f("div","".concat(ae,"-selector-clipboard")).hide(),this.autofillEl=f("div","".concat(ae,"-selector-autofill")).hide(),this.el=f("div","".concat(ae,"-selector")).css("z-index","".concat(je)).children(this.areaEl,this.clipboardEl,this.autofillEl).hide(),this.isreadonly&&this.cornerEl.hide(),je+=1}return r()(e,[{key:"setOffset",value:function(e){return this.el.offset(e).show(),this}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"setAreaOffset",value:function(e){var t=e.left,i=e.top,n=e.width,r=e.height,a={width:this.isreadonly?n-2:n+.8,height:this.isreadonly?r-2:r+.8,left:t-.8,top:i-.8};this.areaEl.offset(a).show()}},{key:"setClipboardOffset",value:function(e){var t=e.left,i=e.top,n=e.width,r=e.height;this.clipboardEl.offset({left:t,top:i,width:n-2.4,height:r-2.4})}},{key:"showAutofill",value:function(e){var t=e.left,i=e.top,n=e.width,r=e.height;this.autofillEl.offset({width:n-3,height:r-3,left:t,top:i}).show()}},{key:"hideAutofill",value:function(){this.autofillEl.hide()}},{key:"showClipboard",value:function(){this.clipboardEl.show()}},{key:"hideClipboard",value:function(){this.clipboardEl.hide()}}]),e}();function Be(e){var t=this.data,i=e.left,n=e.top,r=e.width,a=e.height,o=e.scroll,s=e.l,l=e.t,c=t.freezeTotalWidth(),h=t.freezeTotalHeight(),u=t.displayRight2Left?0===c?i:i-(t.viewWidth()-t.cols.indexWidth-c):i-c,f=r;void 0!==o&&(t.displayRight2Left?0===c||(u+r<0?u=19999:u<0&&(f-=o.x)):c>s&&(u-=o.x));var d=n-h;return void 0!==o&&h>l&&(d-=o.y),{left:u,top:d,width:f,height:a}}function He(e){var t=this.data,i=e.left,n=e.width,r=e.height,a=e.l,o=e.t,s=e.scroll,l=t.freezeTotalWidth(),c=t.displayRight2Left?0===l?i:i-(t.viewWidth()-t.cols.indexWidth-l):i-l,h=n;return void 0!==s&&(t.displayRight2Left?0===l||(c+n<0?c=19999:c<0&&(h-=s.x)):l>a&&(c-=s.x)),{left:c,top:o,width:h,height:r}}function Ne(e){var t=this.data,i=e.top,n=e.width,r=e.height,a=e.l,o=e.t,s=e.scroll,l=e.left,c=t.freezeTotalHeight(),h=i-c;return c>o&&(h-=s.y),t.displayRight2Left?{left:l,top:h,width:n,height:r}:{left:a,top:h,width:n,height:r}}function Ue(e){this.br.setAreaOffset(Be.call(this,e))}function Xe(e){this.tl.setAreaOffset(e)}function We(e){this.t.setAreaOffset(He.call(this,e))}function qe(e){this.l.setAreaOffset(Ne.call(this,e))}function Ye(e){this.l.setClipboardOffset(Ne.call(this,e))}function Ve(e){this.br.setClipboardOffset(Be.call(this,e))}function Ge(e){this.tl.setClipboardOffset(e)}function Ze(e){this.t.setClipboardOffset(He.call(this,e))}function Ke(e){Ue.call(this,e),Xe.call(this,e),We.call(this,e),qe.call(this,e)}function Je(e){Ve.call(this,e),Ge.call(this,e),Ze.call(this,e),Ye.call(this,e)}var $e=function(){function e(t){var i=this;l()(this,e),this.inputChange=function(){},this.data=t;var n="edit"!==t.settings.mode;this.br=new ze(n,!0),this.t=new ze(n),this.l=new ze(n),this.tl=new ze(n),this.br.inputChange=function(e){i.inputChange(e)},this.br.el.show(),this.offset=null,this.areaOffset=null,this.indexes=null,this.range=null,this.arange=null,this.el=f("div","".concat(ae,"-selectors")).children(this.tl.el,this.t.el,this.l.el,this.br.el).hide(),this.lastri=-1,this.lastci=-1,je+=1,this.mobilestartOffset=null,this.mobilestartRange=null,this.objId=null}return r()(e,[{key:"getObj",value:function(){if(null===this.objId)return null;var e=this.objId.split("_");return"s"===e[0]?this.data.shapes.filter((function(t){return Number(t.id)===Number(e[1])}))[0]:this.data.images.filter((function(t){return Number(t.id)===Number(e[1])}))[0]}},{key:"setObjId",value:function(e){this.objId=e}},{key:"setMobilestartOffsetAndRange",value:function(){this.mobilestartOffset=this.data.getSelectedRect(),this.mobilestartRange=this.range}},{key:"resetData",value:function(e){this.data=e,this.range=e.selector.range,this.resetAreaOffset()}},{key:"hide",value:function(){this.el.hide()}},{key:"resetOffset",value:function(){var e=this.data,t=this.tl,i=this.t,n=this.l,r=this.br,a=e.freezeTotalHeight(),o=e.freezeTotalWidth();if(a>0||o>0)if(this.data.displayRight2Left){var s=e.viewWidth()-e.cols.indexWidth;t.setOffset({width:s-o,height:a}),i.setOffset({left:s-o,height:a}),n.setOffset({width:s-o,top:a}),r.setOffset({left:s-o,top:a})}else t.setOffset({width:o,height:a}),i.setOffset({left:o,height:a}),n.setOffset({width:o,top:a}),r.setOffset({left:o,top:a});else t.hide(),i.hide(),n.hide(),r.setOffset({left:0,top:0})}},{key:"resetAreaOffset",value:function(){var e=this.data.getSelectedRect(),t=this.data.getClipboardRect();Ke.call(this,e),Je.call(this,t),this.resetOffset()}},{key:"resetBRTAreaOffset",value:function(){var e=this.data.getSelectedRect(),t=this.data.getClipboardRect();this.data.displayRight2Left?0===this.data.freeze[1]?Ue.call(this,e):(qe.call(this,e),Xe.call(this,e),Ye.call(this,t),Ge.call(this,t)):(Ue.call(this,e),We.call(this,e),Ve.call(this,t),Ze.call(this,t)),this.resetOffset()}},{key:"resetBRLAreaOffset",value:function(){var e=this.data.getSelectedRect(),t=this.data.getClipboardRect();Ue.call(this,e),qe.call(this,e),Ve.call(this,t),Ye.call(this,t),this.resetOffset()}},{key:"set",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=n.calSelectedRangeByStart(e,t),a=r.sri,o=r.sci;if(i){var s=e,l=t;e<0&&(s=0),t<0&&(l=0),n.selector.setIndexes(s,l),this.indexes=[s,l]}this.moveIndexes=[a,o],this.range=r,this.resetAreaOffset(),this.el.show()}},{key:"setEnd",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.data,r=this.lastri,a=this.lastci;if(i){if(e===r&&t===a)return;this.lastri=e,this.lastci=t}this.moveIndexes=[e,t],this.range=n.calSelectedRangeByEnd(e,t),Ke.call(this,this.data.getSelectedRect())}},{key:"setEndMobile",value:function(e,t){Ke.call(this,{width:this.mobilestartOffset.width+e,height:this.mobilestartOffset.height+t,left:this.mobilestartOffset.left,top:this.mobilestartOffset.top})}},{key:"getMobileMultipleSelect",value:function(e,t){var i=this.mobilestartRange,n=i.sri,r=i.sci,a=i.eri,o=i.eci,s=0,l=0,c=a,h=o;if(t>0){for(var u=a+1;u<=this.data.rows.len-1;u++)if((s+=this.data.rows.getHeight(u))>t){c=u-1;break}}else{t=-t;for(u=a;u>=n;u--)if((s+=this.data.rows.getHeight(u))>t){c=u-1;break}c===n-1&&(c=n)}if(e>0){for(var f=o+1;f<=this.data.cols.len-1;f++)if((l+=this.data.cols.getWidth(f))>e){h=f-1;break}}else{e=-e;for(f=o;f>=r;f--)if((l+=this.data.cols.getWidth(f))>e){h=f-1;break}h===r-1&&(h=r)}return[c,h]}},{key:"setMobileMultipleSelect",value:function(e,t){var i=this.getMobileMultipleSelect(e,t),n=o()(i,2),r=n[0],a=n[1];this.setEnd(r,a,!1)}},{key:"setMobile",value:function(e,t,i,n){var r=this.range,a=r.eri,o=r.eci;this.set(e,t),this.lastri=this.lastci=0,this.setEnd(a,o);var s=this.data.getSelectedRect();i=i>s.width+s.left?s.width+s.left:i,n=n>s.height+s.top?s.height+s.top:n,Ke.call(this,{width:s.width+(s.left-i),height:s.height+(s.top-n),left:i,top:n}),this.el.show()}},{key:"reset",value:function(){var e=this.data.selector.range,t=e.eri,i=e.eci;this.setEnd(t,i)}},{key:"showAutofill",value:function(e,t){if(-1!==e||-1!==t){var i=this.range,n=i.sri,r=i.sci,a=i.eri,o=i.eci,s=e,l=t,c=n-e,h=a-e,u=o-t;if(r-t>0)this.arange=new x(n,l,a,r-1);else if(c>0)this.arange=new x(s,r,n-1,o);else if(u<0)this.arange=new x(n,o+1,a,l);else{if(!(h<0))return void(this.arange=null);this.arange=new x(a+1,r,s,o)}if(null!==this.arange){var f=this.data.getRect(this.arange);f.width+=2,f.height+=2;var d=this.br,m=this.l,g=this.t,v=this.tl;d.showAutofill(Be.call(this,f)),m.showAutofill(Ne.call(this,f)),g.showAutofill(He.call(this,f)),v.showAutofill(f)}}}},{key:"hideAutofill",value:function(){var e=this;["br","l","t","tl"].forEach((function(t){e[t].hideAutofill()}))}},{key:"showClipboard",value:function(){var e=this,t=this.data.getClipboardRect();Je.call(this,t),["br","l","t","tl"].forEach((function(t){e[t].showClipboard()}))}},{key:"hideClipboard",value:function(){var e=this;["br","l","t","tl"].forEach((function(t){e[t].hideClipboard()}))}}]),e}();function Qe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var et=function(e){ee()(i,e);var t=Qe(i);function i(e){var n;return l()(this,i),(n=t.call(this,"dialog")).show(),n.setContent(e),n}return r()(i,[{key:"hide",value:function(){this.removeAttr("open")}},{key:"show",value:function(){this.attr("open","")}},{key:"setContent",value:function(e){var t=f("p");t.child(e),this.child(t)}}],[{key:"findDialog",value:function(e){for(var t=[],i=0;i<e.children().length;i++)"dialog"===e.children()[i].localName&&t.push(i);return t}}]),i}(u);function tt(e){e.preventDefault(),e.stopPropagation();var t=this.filterItems;t.length<=0||(this.itemIndex>=0&&(t[this.itemIndex].toggle(),t[this.itemIndex].el.hideHelp()),this.itemIndex-=1,this.itemIndex<0&&(this.itemIndex=t.length-1),t[this.itemIndex].toggle(),t[this.itemIndex].el.showHelp())}function it(e){e.stopPropagation();var t=this.filterItems;t.length<=0||(this.itemIndex>=0&&(t[this.itemIndex].toggle(),t[this.itemIndex].el.hideHelp()),this.itemIndex+=1,this.itemIndex>t.length-1&&(this.itemIndex=0),t[this.itemIndex].toggle(),t[this.itemIndex].el.showHelp())}function nt(e){e.preventDefault();var t=this.filterItems;t.length<=0||(e.stopPropagation(),this.itemIndex<0&&(this.itemIndex=0),t[this.itemIndex].el.click(),this.hide())}function rt(e,t){t.focusing=!0;var i=e.keyCode;switch(e.ctrlKey&&e.stopPropagation(),i){case 37:e.stopPropagation();break;case 38:tt.call(this,e);break;case 39:e.stopPropagation();break;case 40:it.call(this,e);break;case 13:case 9:nt.call(this,e);break;default:e.stopPropagation()}}var at=function(){function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"200px";l()(this,e),this.filterItems=[],this.items=t,this.el=f("div","".concat(ae,"-suggest")).css("width",n).hide(),this.itemClick=i,this.itemIndex=-1}return r()(e,[{key:"setOffset",value:function(e){this.el.cssRemoveKeys("top","bottom").offset(e)}},{key:"hide",value:function(){var e=this.el;this.filterItems=[],this.itemIndex=-1,e.hide();for(var t=et.findDialog(e.parent()),i=0;i<t.length;i++)e.parent().removeChild(e.parent().children()[t[i]]);Ee(this.el.parent())}},{key:"setItems",value:function(e){this.items=e}},{key:"search",value:function(e){var t,i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.items;if(/^\s*$/.test(e)||(r=r.filter((function(t){return(t.key||t).startsWith(e.toUpperCase())}))),r=r.map((function(e){var t=e.title;t?"function"==typeof t&&(t=t()):t=e;var r=f("div","".concat(ae,"-item")).child("f"===n?e.key:t).on("click.stop",(function(){i.itemClick(e),i.hide()}));return e.label&&r.child(f("div","label").html(e.label)),"f"===n&&(r.el.help=new et(e.title())),r.el.showHelp=function(){var e=i.el.el.offsetTop+i.filterItems[i.itemIndex].el.offsetTop,t=i.el.el.offsetLeft+i.filterItems[i.itemIndex].el.clientWidth+20,n={top:"".concat(e,"px"),left:"".concat(t,"px"),"line-height":"16px",padding:"5px 2px"},r=i.filterItems[i.itemIndex].el.help;r.css(n),i.el.parent().child(r),Re(r,(function(e){for(var t=et.findDialog(i.el.parent()),n=0;n<t.length;n++)i.el.parent().removeChild(i.el.parent().children()[t[n]]);Ee(e)}))},r.el.hideHelp=function(){i.el.parent().contains(i.filterItems[i.itemIndex].el.help.el)&&i.el.parent().removeChild(i.filterItems[i.itemIndex].el.help.el),Ee(i.filterItems[i.itemIndex].el.help)},r})),this.filterItems=r,!(r.length<=0)){var a=this.el;if((t=a.html("")).children.apply(t,m()(r)).show(),"f"===n){for(var o=et.findDialog(a.parent()),s=0;s<o.length;s++)a.parent().removeChild(a.parent().children()[o[s]]);this.itemIndex=0,this.filterItems[this.itemIndex].el.hideHelp(),this.filterItems[this.itemIndex].toggle(),this.filterItems[this.itemIndex].el.showHelp(),Re(a.parent(),(function(){i.hide(),i.filterItems.forEach((function(e){return e.hideHelp()}))}))}}}},{key:"bindInputEvents",value:function(e,t){var i=this;e.on("keydown",(function(e){return rt.call(i,e,t)}))}}]),e}();function ot(e,t){e.setMonth(e.getMonth()+t)}function st(e,t){var i=new Date(e);return i.setDate(t-e.getDay()+1),i}var lt=function(){function e(t){var i,n=this;l()(this,e),this.value=t,this.cvalue=new Date(t),this.headerLeftEl=f("div","calendar-header-left"),this.bodyEl=f("tbody",""),this.buildAll(),this.el=f("div","x-spreadsheet-calendar").children(f("div","calendar-header").children(this.headerLeftEl,f("div","calendar-header-right").children(f("a","calendar-prev").on("click.stop",(function(){return n.prev()})).child(new se("chevron-left")),f("a","calendar-next").on("click.stop",(function(){return n.next()})).child(new se("chevron-right")))),f("table","calendar-body").children(f("thead","").child((i=f("tr","")).children.apply(i,m()(U("calendar.weeks").map((function(e){return f("th","cell").child(e)}))))),this.bodyEl)),this.selectChange=function(){}}return r()(e,[{key:"setValue",value:function(e){this.value=e,this.cvalue=new Date(e),this.buildAll()}},{key:"prev",value:function(){ot(this.value,-1),this.buildAll()}},{key:"next",value:function(){ot(this.value,1),this.buildAll()}},{key:"buildAll",value:function(){this.buildHeaderLeft(),this.buildBody()}},{key:"buildHeaderLeft",value:function(){var e=this.value;this.headerLeftEl.html("".concat(U("calendar.months")[e.getMonth()]," ").concat(e.getFullYear()))}},{key:"buildBody",value:function(){var e,t=this,i=this.value,n=this.cvalue,r=this.bodyEl,a=function(e,t,i){for(var n=new Date(e,t,1,23,59,59),r=[[],[],[],[],[],[]],a=0;a<6;a+=1)for(var o=0;o<7;o+=1){var s=st(n,7*a+o),l=s.getMonth()!==t,c=s.getMonth()===i.getMonth()&&s.getDate()===i.getDate();r[a][o]={d:s,disabled:l,active:c}}return r}(i.getFullYear(),i.getMonth(),n).map((function(e){var i,n=e.map((function(e){var i="cell";return e.disabled&&(i+=" disabled"),e.active&&(i+=" active"),f("td","").child(f("div",i).on("click.stop",(function(){t.selectChange(e.d)})).child(e.d.getDate().toString()))}));return(i=f("tr","")).children.apply(i,m()(n))}));(e=r.html("")).children.apply(e,m()(a))}}]),e}(),ct=function(){function e(){l()(this,e),this.calendar=new lt(new Date),this.el=f("div","".concat(ae,"-datepicker")).child(this.calendar.el).hide()}return r()(e,[{key:"setValue",value:function(e){var t=this.calendar;return"string"==typeof e?/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)&&t.setValue(new Date(e.replace(new RegExp("-","g"),"/"))):e instanceof Date&&t.setValue(e),this}},{key:"change",value:function(e){var t=this;this.calendar.selectChange=function(i){e(i),t.hide()}}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),e}(),ht=[{key:"SUM",title:X("formula.sum"),render:function(e){return e.reduce((function(e,t){return P("+",e,t)}),0)},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"AVERAGE",title:X("formula.average"),render:function(e){return e.reduce((function(e,t){return Number(e)+Number(t)}),0)/e.length},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MAX",title:X("formula.max"),render:function(e){return Math.max.apply(Math,m()(e.map((function(e){return Number(e)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"MIN",title:X("formula.min"),render:function(e){return Math.min.apply(Math,m()(e.map((function(e){return Number(e)}))))},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"IF",title:X("formula._if"),render:function(e){var t=o()(e,3),i=t[0],n=t[1],r=t[2];return i?n:r},tipInfo:{repeat:!1,args:[{name:"logical_test",required:!0},{name:"value_if_true",required:!1},{name:"value_if_false",required:!1}]}},{key:"AND",title:X("formula.and"),render:function(e){return e.every((function(e){return e}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"OR",title:X("formula.or"),render:function(e){return e.some((function(e){return e}))},tipInfo:{repeat:!0,args:[{name:"logical",required:!1}]}},{key:"CONCAT",title:X("formula.concat"),render:function(e){return e.join("")},tipInfo:{repeat:!0,args:[{name:"text",required:!1}]}},{key:"COUNT",title:X("formula.count"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"value",required:!1}]}},{key:"SUMIF",title:X("formula.sumif"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"range",required:!0},{name:"criteria",required:!1},{name:"sum_range",required:!1}]}},{key:"SUMIFS",title:X("formula.sumifs"),render:function(e){return e},tipInfo:{repeat:!0,repeatstart:1,repeatcount:2,args:[{name:"sum_range",required:!0},{name:"criteria_range",required:!1},{name:"criteria",required:!1}]}},{key:"VLOOKUP",title:X("formula.vlookup"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"table_array",required:!0},{name:"col_index_num",required:!0},{name:"range_lookup",required:!1}]}},{key:"HLOOKUP",title:X("formula.hlookup"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"table_array",required:!0},{name:"row_index_num",required:!0},{name:"range_lookup",required:!1}]}},{key:"LOOKUP",title:X("formula.lookup"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"lookup_vector|array",required:!0},{name:"result_vector",required:!1}]}},{key:"MATCH",title:X("formula.match"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"lookup_value",required:!0},{name:"lookup_array",required:!0},{name:"match_type",required:!1}]}},{key:"RANK",title:X("formula.frequency"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"ref",required:!0},{name:"order",required:!1}]}},{key:"FREQUENCY",title:X("formula.frequency"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"data_array",required:!0},{name:"bins_array",required:!0}]}},{key:"TEXT",title:X("formula.text"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0},{name:"format_text",required:!0}]}},{key:"LEFT",title:X("formula.left"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"num_chars",required:!0}]}},{key:"RIGHT",title:X("formula.right"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"num_chars",required:!0}]}},{key:"ROUND",title:X("formula.round"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"num_digits",required:!0}]}},{key:"INDEX",title:X("formula.index"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"array",required:!0},{name:"row_num",required:!0},{name:"col_num",required:!1}]}},{key:"COUNTIF",title:X("formula.countif"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"range",required:!0},{name:"criteria",required:!0}]}},{key:"COUNTIFS",title:X("formula.countifs"),render:function(e){return e},tipInfo:{repeat:!0,repeatstart:0,repeatcount:2,args:[{name:"criteria_range",required:!1},{name:"criteria",required:!1}]}},{key:"COUNTA",title:X("formula.counta"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"value",required:!1}]}},{key:"AVERAGEIF",title:X("formula.averageif"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"range",required:!0},{name:"criteria",required:!0},{name:"average_range",required:!1}]}},{key:"AVERAGEIFS",title:X("formula.averageifs"),render:function(e){return e},tipInfo:{repeat:!0,repeatstart:1,repeatcount:2,args:[{name:"average_range",required:!0},{name:"criteria_range",required:!1},{name:"criteria",required:!1}]}},{key:"TRIM",title:X("formula.trim"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"SIGN",title:X("formula.sign"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"ABS",title:X("formula.abs"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"TAN",title:X("formula.tan"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"SIN",title:X("formula.sin"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"COS",title:X("formula.cos"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0}]}},{key:"YIELD",title:X("formula.yield"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"settlement",required:!0},{name:"maturity",required:!0},{name:"rate",required:!0},{name:"pr",required:!0},{name:"redemption",required:!0},{name:"frequency",required:!0},{name:"basis",required:!1}]}},{key:"MID",title:X("formula.mid"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"start_num",required:!0},{name:"num_chars",required:!0}]}},{key:"LEN",title:X("formula.len"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"POWER",title:X("formula.power"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"power",required:!0}]}},{key:"CEILING",title:X("formula.ceiling"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"significance",required:!0}]}},{key:"FLOOR",title:X("formula.floor"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"number",required:!0},{name:"significance",required:!0}]}},{key:"SUBSTITUTE",title:X("formula.substitute"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0},{name:"old_text",required:!0},{name:"new_text",required:!0},{name:"instance_num",required:!1}]}},{key:"REPLACE",title:X("formula.replace"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"old_text",required:!0},{name:"start_num",required:!0},{name:"num_chars",required:!0},{name:"new_text",required:!0}]}},{key:"SEARCH",title:X("formula.search"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"find_text",required:!0},{name:"within_text",required:!0},{name:"start_num",required:!1}]}},{key:"FIND",title:X("formula.find"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"find_text",required:!0},{name:"within_text",required:!0},{name:"start_num",required:!1}]}},{key:"ISNUMBER",title:X("formula.isnumber"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0}]}},{key:"ISTEXT",title:X("formula.istext"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0}]}},{key:"ISBLANK",title:X("formula.isblank"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"value",required:!0}]}},{key:"UPPER",title:X("formula.upper"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"LOWER",title:X("formula.lower"),render:function(e){return e},tipInfo:{repeat:!1,args:[{name:"text",required:!0}]}},{key:"PRODUCT",title:X("formula.product"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"number",required:!1}]}},{key:"SUMPRODUCT",title:X("formula.sumproduct"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"array",required:!1}]}},{key:"SUBTOTAL",title:X("formula.subtotal"),render:function(e){return e},tipInfo:{repeat:!0,args:[{name:"function_num",required:!0},{name:"ref",required:!1}]}}],ut=ht,ft={};function dt(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return mt(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return mt(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}ht.forEach((function(e){ft[e.key]=e}));var gt=function(){function e(){l()(this,e),this.el=f("div").hide(),this.el.css({position:"absolute",padding:"5px",color:"#000","border-radius":"1px","font-size":"12px","z-index":"201","line-height":"10px","min-width":"20px",background:"#fff",border:"1px solid",top:"30px",left:"0px","white-space":"nowrap"})}return r()(e,[{key:"tipContent",value:function(e,t){if(void 0===e)return"";var i=e.tipInfo.args.slice(),n=e.tipInfo.repeat,r=e.tipInfo.repeatstart,a=e.tipInfo.repeatcount,o=[];if(n){void 0===r&&(r=i.length-1,a=1);for(var s=r;s<r+a;s++)o.push(i[s].name);i.splice(r,a)}var l=[];o.length>0&&function(){for(var e=1;i.length<t+2;)o.forEach((function(t){var n=t+e;i.push({name:n,required:!1})})),e++;i.push({name:"...",required:!0})}();for(var c=0;c<i.length;c++){var h=i[c].name;c>0&&!i[c].required&&c>=r+a&&((c-r)%a==0&&(h="["+h),(c-r)%a==a-1&&(h+="]")),l.push(h)}return l[t]="<strong>".concat(l[t],"</strong>"),"".concat(e.key.toUpperCase(),"(").concat(l.join(", "),")")}},{key:"hide",value:function(){this.el.hide()}},{key:"show",value:function(e){if(-1!==e.startsWith("=")){var t,i="",n=[],r=[],a=dt(e.substring(1));try{for(a.s();!(t=a.n()).done;){var o=t.value;switch(o){case"(":n.unshift(i),r.unshift(0),i="";break;case")":n.shift(),r.shift();break;case",":r[0]++,i="";break;case"=":break;default:i+=o}}}catch(e){a.e(e)}finally{a.f()}var s=ht.find((function(e){return void 0!==n[0]&&e.key===n[0].toUpperCase()})),l=this.tipContent(s,r[0]);this.el.html(l),""!==l&&this.el.show(),""===l?this.el.hide():this.el.show(),Re(this.el)}}}]),e}(),vt=[{key:"Arial",title:"Arial"},{key:"Arial Black",title:"Arial Black"},{key:"Comic Sans",title:"Comic Sans"},{key:"Comic Sans MS",title:"Comic Sans MS"},{key:"Courier New",title:"Courier New"},{key:"Georgia",title:"Georgia"},{key:"Impact",title:"Impact"},{key:"Lucida Console",title:"Lucida Console"},{key:"Lucida Sans",title:"Lucida Sans"},{key:"Palatino",title:"Palatino"},{key:"Tahoma",title:"Tahoma"},{key:"Times New Roman",title:"Times New Roman"},{key:"Trebuchet",title:"Trebuchet"},{key:"Verdana",title:"Verdana"},{key:"Lato",title:"Lato"},{key:"Helvetica",title:"Helvetica"},{key:"Source Sans Pro",title:"Source Sans Pro"}],pt=[{pt:7.5,px:10},{pt:8,px:11},{pt:9,px:12},{pt:10,px:13},{pt:10.5,px:14},{pt:11,px:15},{pt:12,px:16},{pt:14,px:18.7},{pt:15,px:20},{pt:16,px:21.3},{pt:18,px:24},{pt:22,px:29.3},{pt:24,px:32},{pt:26,px:34.7},{pt:36,px:48},{pt:42,px:56}];function yt(e){for(var t=0;t<pt.length;t+=1){var i=pt[t];if(i.pt===e)return i.px}return e}var bt=function(e){for(var t=[],i=[],n=[],r=0,a="",s=1,l="",c=0;c<e.length;c+=1){var h=e.charAt(c);if(" "!==h){if(h>="a"&&h<="z")n.push(h.toUpperCase());else if(h>="0"&&h<="9"||h>="A"&&h<="Z"||"."===h)n.push(h);else if('"'===h){for(c+=1;'"'!==e.charAt(c);)n.push(e.charAt(c)),c+=1;i.push('"'.concat(n.join(""))),n=[]}else if("-"===h&&/[+\-*/,(]/.test(l))n.push(h);else{if("("!==h&&n.length>0&&i.push(n.join("")),")"===h){var u=t.pop();if(2===r)try{for(var f=y(i.pop()),d=o()(f,2),m=d[0],g=d[1],v=y(i.pop()),p=o()(v,2),w=p[0],x=p[1],k=0,C=w;C<=m;C+=1)for(var _=x;_<=g;_+=1)i.push(b(C,_)),k+=1;i.push([u,k])}catch(e){}else if(1===r||3===r)3===r&&i.push(a),i.push([u,s]),s=1;else for(;"("!==u&&(i.push(u),!(t.length<=0));)u=t.pop();r=0}else if("="===h||">"===h||"<"===h){var S=e.charAt(c+1);a=h,"="!==S&&"-"!==S||(a+=S,c+=1),r=3}else if(":"===h)r=2;else if(","===h)3===r&&i.push(a),r=1,s+=1;else if("("===h&&n.length>0)t.push(n.join(""));else{if(t.length>0&&("+"===h||"-"===h)){var T=t[t.length-1];if("("!==T&&i.push(t.pop()),"*"===T||"/"===T)for(;t.length>0&&"("!==(T=t[t.length-1]);)i.push(t.pop())}t.push(h)}n=[]}l=h}}for(n.length>0&&i.push(n.join(""));t.length>0;)i.push(t.pop());return i},wt=function(e,t){var i=o()(e,1)[0],n=e;if('"'===i)return e.substring(1);var r=1;if("-"===i&&(n=e.substring(1),r=-1),n[0]>="0"&&n[0]<="9")return r*Number(n);var a=y(n),s=o()(a,2);return r*t(s[0],s[1])},xt=function(e,t,i,n){for(var r=[],a=0;a<e.length;a+=1){var s=e[a],l=s[0];if("+"===s){var c=r.pop();r.push(P("+",r.pop(),c))}else if("-"===s)if(1===r.length){var h=r.pop();r.push(P("*",h,-1))}else{var u=r.pop();r.push(P("-",r.pop(),u))}else if("*"===s)r.push(P("*",r.pop(),r.pop()));else if("/"===s){var f=r.pop();r.push(P("/",r.pop(),f))}else if("="===l||">"===l||"<"===l){var d=r.pop();Number.isNaN(d)||(d=Number(d));var m=r.pop();Number.isNaN(m)||(m=Number(m));var g=!1;"="===l?g=m===d:">"===s?g=m>d:">="===s?g=m>=d:"<"===s?g=m<d:"<="===s&&(g=m<=d),r.push(g)}else if(Array.isArray(s)){for(var v=o()(s,2),p=v[0],y=v[1],b=[],w=0;w<y;w+=1)b.push(r.pop());r.push(t[p].render(b.reverse()))}else{if(n.includes(s))return 0;(l>="a"&&l<="z"||l>="A"&&l<="Z")&&n.push(s),r.push(wt(s,i)),n.pop()}}return r[0]},kt=function e(t,i,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if("="===t[0]){var a=bt(t.substring(1));return a.length<=0?t:xt(a,i,(function(t,a){return e(n(t,a),i,n,r)}),r)}return t},Ct=function(e){return e},_t=function(e){if(/^(-?\d*.?\d*)$/.test(e)){var t=Number(e).toFixed(2).toString().split("\\."),i=h()(t),n=i[0],r=i.slice(1);return[n.toLocaleString()].concat(m()(r))}return e},St=[{key:"normal",title:X("format.normal"),type:"string",render:Ct},{key:"text",title:X("format.text"),type:"string",render:Ct},{key:"number",title:X("format.number"),type:"number",label:"1,000.12",render:_t},{key:"percent",title:X("format.percent"),type:"number",label:"10.12%",render:function(e){return"".concat(e,"%")}},{key:"rmb",title:X("format.rmb"),type:"number",label:"¥10.00",render:function(e){return"¥".concat(_t(e))}},{key:"usd",title:X("format.usd"),type:"number",label:"$10.00",render:function(e){return"$".concat(_t(e))}},{key:"eur",title:X("format.eur"),type:"number",label:"€10.00",render:function(e){return"€".concat(_t(e))}},{key:"date",title:X("format.date"),type:"date",label:"26/09/2008",render:Ct},{key:"time",title:X("format.time"),type:"date",label:"15:59:00",render:Ct},{key:"datetime",title:X("format.datetime"),type:"date",label:"26/09/2008 15:59:00",render:Ct},{key:"duration",title:X("format.duration"),type:"date",label:"24:01:00",render:Ct}],Tt={};function Ot(){return window.devicePixelRatio||1}function Et(){return Ot()-.5}function Rt(e){return parseInt(e*Ot(),10)}function It(e){var t=Math.ceil(e/Ot());return Rt(t)===e?t:t-1}function At(e){var t=Rt(e);return t>0?t-.5:.5}St.forEach((function(e){Tt[e.key]=e}));var Dt=function(){function e(t,i,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;l()(this,e),this.x=t,this.y=i,this.width=n,this.height=r,this.padding=a,this.bgcolor="#ffffff",this.borderTop=null,this.borderRight=null,this.borderBottom=null,this.borderLeft=null,this.pbgcolor=null,this.pattern=null}return r()(e,[{key:"setBorders",value:function(e){var t=e.top,i=e.bottom,n=e.left,r=e.right;t&&(this.borderTop=t),r&&(this.borderRight=r),i&&(this.borderBottom=i),n&&(this.borderLeft=n)}},{key:"setPading",value:function(e,t){this.lpading=e,this.rpading=t}},{key:"setPattern",value:function(e){e&&(this.pattern=e)}},{key:"resize",value:function(e,t){this.width=e,this.height=t}},{key:"innerWidth",value:function(){return this.lpading||this.rpading?this.width-(this.lpading+this.rpading)-2:this.width-2*this.padding-2}},{key:"innerHeight",value:function(){return this.height-2*this.padding-2}},{key:"textx",value:function(e){var t=this.width,i=this.padding,n=this.lpading,r=this.rpading,a=this.x;return"left"===e?a+=n||i:"center"===e?a+=t/2:"right"===e&&(a+=t-(r||i)),a}},{key:"texty",value:function(e,t){var i=this.height,n=this.padding,r=this.y;return"top"===e?r+=n:"middle"===e?r+=i/2-t/2:"bottom"===e&&(r+=i-n-t),r}},{key:"topxys",value:function(){var e=this.x,t=this.y;return[[e,t],[e+this.width,t]]}},{key:"rightxys",value:function(){var e=this.x,t=this.y,i=this.width;return[[e+i,t],[e+i,t+this.height]]}},{key:"bottomxys",value:function(){var e=this.x,t=this.y,i=this.width,n=this.height;return[[e,t+n],[e+i,t+n]]}},{key:"leftxys",value:function(){var e=this.x,t=this.y;return[[e,t],[e,t+this.height]]}}]),e}();function Pt(e,t,i,n,r,a,o){var s={x:0,y:0};"underline"===e?s.y="bottom"===r?0:"top"===r?-(a+2):-a/2:"strike"===e&&("bottom"===r?s.y=a/2:"top"===r&&(s.y=-(a/2+2))),"center"===n?s.x=o/2:"right"===n&&(s.x=o),this.line([t-s.x,i-s.y],[t-s.x+o,i-s.y])}function Ft(e,t,i,n,r,a){for(var o=i;o<r;o+=a)e.moveTo(t,o),e.lineTo(n,o)}function Mt(e,t,i,n,r,a){for(var o=t;o<n;o+=a)e.moveTo(o,i),e.lineTo(o,r)}function Lt(e,t,i,n,r,a){for(var o=t,s=o+a;s<=n;s+=a)e.moveTo(s,r),e.lineTo(o,i),o+=a}function jt(e,t,i,n,r,a){for(var o=t,s=o+a;s<=n;s+=a)e.moveTo(o,r),e.lineTo(s,i),o+=a}function zt(e,t,i,n,r,a){for(var o=i;o<r;o+=a)e.moveTo(t,o),e.lineTo(n,o)}var Bt=function(){function e(t,i,n){l()(this,e),this.width=i,this.height=n,this.ctx=t,this.ctx.scale(Ot(),Ot())}return r()(e,[{key:"setel",value:function(e){var t=this.width,i=this.height;this.el=e,this.ctx=e.getContext("2d"),this.resize(t,i),this.ctx.scale(Ot(),Ot())}},{key:"resize",value:function(e,t){this.width=e,this.height=t,this.el.style.width="".concat(e,"px"),this.el.style.height="".concat(t,"px"),this.el.width=Rt(e),this.el.height=Rt(t)}},{key:"clear",value:function(){var e=this.width,t=this.height;return this.ctx.clearRect(0,0,Rt(e),Rt(t)),this}},{key:"attr",value:function(e){return Object.assign(this.ctx,e),this}},{key:"save",value:function(){return this.ctx.save(),this.ctx.beginPath(),this}},{key:"restore",value:function(){return this.ctx.restore(),this}},{key:"beginPath",value:function(){return this.ctx.beginPath(),this}},{key:"translate",value:function(e,t){return this.ctx.translate(Rt(e),Rt(t)),this}},{key:"scale",value:function(e,t){return this.ctx.scale(e,t),this}},{key:"scaledpr",value:function(e){this.scale(e,e)}},{key:"clearRect",value:function(e,t,i,n){return this.ctx.clearRect(e,t,i,n),this}},{key:"fillRectWithColor",value:function(e,t,i,n,r,a,o){var s,l,c=this.ctx;this.save(),void 0!==e&&(c.fillStyle=o?(s=o,l=e.slice(1),"rgba("+[parseInt("0x"+l.slice(0,2)),parseInt("0x"+l.slice(2,4)),parseInt("0x"+l.slice(4,6)),1-s].toString()+")"):e),this.fillRect(t,i,n,r),a&&(c.globalCompositeOperation="lighter",c.fillStyle="rgba(255, 255, 255, 0.8)",this.fillRect(t,i,n,r)),this.restore()}},{key:"fillRect",value:function(e,t,i,n){return this.ctx.fillRect(Rt(e)-.5,Rt(t)-.5,Rt(i),Rt(n)),this}},{key:"fillText",value:function(e,t,i){return this.ctx.fillText(e,Rt(t),Rt(i)),this}},{key:"richtext",value:function(e,t,i,n){var r=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5?arguments[5]:void 0,s=this.ctx,l=e.bigfontsize,c=e.rtxt,h=e.text,u=e.isactiveeffect,f=h.length,d=t.exttxtwidth?t.exttxtwidth+t.innerWidth():t.innerWidth();if(!(d<=0)){var m=t.textx(i);s.save(),s.beginPath();var g=this;this.attr({textAlign:"center"===i?"right":i,textBaseline:"bottom"});var v=[],p=[],y=c.length;if(a)for(var b=function(e){var t=c[e],i=[],n=0,r=0,a=0;t.forEach((function(e){g.attr({font:"".concat(e.font.italic?"italic":""," ").concat(e.font.bold?"bold":""," ").concat(Rt(e.font.size),"pt ").concat(e.font.name)});var t=s.measureText(e.txt).width;if(r=n,(n+=t)>Rt(d)){for(var o={w:r,len:0,start:0},l=0;l<e.txt.length;)if(o.w+=s.measureText(e.txt[l]).width+1,o.w>=Rt(d)){if(o.len===o.start&&0===i.length&&(o.len+=1,l++),o.len>o.start){var c={};c.font=e.font,c.txt=e.txt.substring(o.start,o.len),c.notorigindivide=!0,i.push(c),e.font.size>a&&(a=e.font.size)}v.push(i),p.push(a),o={w:0,len:l,start:l},n=0,i=[],a=0}else o.len+=1,l++;if(o.len>o.start){var h={};h.font=e.font,h.txt=e.txt.substring(o.start,o.len),i.push(h),e.font.size>a&&(a=e.font.size),n=o.w}}else i.push(e),e.font.size>a&&(a=e.font.size)})),v.push(i),p.push(a)},w=0;w<y;w++)b(w);else v=c,p=l;for(var x=p.length,k=0,C=0;C<x;C++)k+=p[C]+8;var _=[],S=[];if("center"===i||"right"===i)for(var T=0;T<x;T++){var O=v[T],E=0;O.forEach((function(e){g.attr({font:"".concat(e.font.italic?"italic":""," ").concat(e.font.bold?"bold":""," ").concat(Rt(e.font.size),"pt ").concat(e.font.name),fillStyle:e.font.color,strokeStyle:e.font.color}),E+=It(s.measureText(e.txt).width)})),S.push(E)}if(0==o.length&&o.push(null),o.forEach((function(e){for(var a=t.texty(n,k),o=0,l=!1,c=!1,d=function(t){var n=v[t],d=0,y=m,b=y,w=y,x=p[t]+8,k=S.length>0?S[t]:0;"center"===i?b=y-k/2:"right"===i&&(b=y-k);var C=b;a+=x,n.forEach((function(t){g.attr({font:"".concat(t.font.italic?"italic":""," ").concat(t.font.bold?"bold":""," ").concat(Rt(t.font.size),"pt ").concat(t.font.name),fillStyle:u?"#217346":t.font.color,strokeStyle:u?"#217346":t.font.color});var n=It(s.measureText(t.txt).width);if(w=C+n,null!==e){for(var m=e.start;"\n"===h[m++]&&m<e.end&&m<f;)e.start=m;if(o<=e.start&&e.start<o+t.txt.length){l=!0;var v=t.txt.substr(0,e.start-o),p=It(s.measureText(v).width);b=C+p}if(o<e.end&&e.end<=o+t.txt.length){var S=t.txt.substr(0,e.end-o),T=It(s.measureText(S).width);w=C+T,l=!1,_.push({x:b,y:a-x,w:w-b,h:x})}}d+=n;var O=0;"center"===i?O=k/2-d:"right"===i&&(O=k-d),c||r.fillText(t.txt,y-O,a),"center"===i&&(O+=n/2),!c&&t.font.strike&&Pt.call(r,"strike",y-O,a,i,"bottom",t.font.size,n),!c&&t.font.underline&&Pt.call(r,"underline",y-O,a,i,"bottom",t.font.size,n),"left"===i&&(y+=n),C+=n,o+=t.txt.length})),null!==e&&l&&_.push({x:b,y:a-x,w:w-b,h:x});var T=n.length;T>0&&n[T-1].notorigindivide||o++},y=0;y<x;y++)d(y);c||(c=!0)})),s.restore(),null!=o[0]){s.save(),this.attr({fillStyle:o[0].color});for(var R=0,I=_.length;R<I;R++){var A=_[R];this.fillRect(A.x,A.y,A.w,A.h)}s.restore()}return this}}},{key:"text",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4?arguments[4]:void 0,o=this.ctx,s=n.align,l=n.valign,c=n.font,h=n.color,u=n.strike,f=n.underline,d=t.textx(s);o.save(),o.beginPath(),this.attr({textAlign:s,textBaseline:l,font:"".concat(c.italic?"italic":""," ").concat(c.bold?"bold":""," ").concat(Rt(c.size),"px ").concat(c.name),fillStyle:h,strokeStyle:h});var m="".concat(e).split("\n"),g=t.exttxtwidth?t.exttxtwidth+t.innerWidth():t.innerWidth(),v=[];m.forEach((function(e){var t=o.measureText(e).width;if(r&&t>Rt(g)){for(var i={w:0,len:0,start:0},n=0;n<e.length;n+=1)i.w>=Rt(g)&&(v.push(e.substr(i.start,i.len)),i={w:0,len:0,start:n}),i.len+=1,i.w+=o.measureText(e[n]).width+1;i.len>0&&v.push(e.substr(i.start,i.len))}else v.push(e)}));var p=(v.length-1)*(c.size+2),y=!1,b=[];if(0==a.length&&a.push(null),a.forEach((function(e){var n=t.texty(l,p),r=0,a=!1;v.forEach((function(t){var h=o.measureText(t).width,m=d,g=d+It(h);if(null!==e){if(r<=e.start&&e.start<r+t.length){a=!0;var v=t.substr(0,e.start-r),p=It(o.measureText(v).width);m+=p,It(h)-p}if(r<e.end&&e.end<r+t.length){var w=t.substr(0,e.end-r),x=It(o.measureText(w).width);g=d+x}if(r>e.end&&(a=!1),a){var k={x:0,y:0};k.y="bottom"===l?c.size+2:"top"===l?2:(c.size+2)/2,"center"===s?k.x=It(h/2):"right"===s&&(k.x=It(h)),b.push({x:m-k.x,y:n-k.y,w:g-m,h:c.size+2})}}y||(i.fillText(t,d,n),u&&Pt.call(i,"strike",d,n,s,l,c.size,It(h)),f&&Pt.call(i,"underline",d,n,s,l,c.size,It(h))),n+=c.size+2,r+=t.length+1})),y||(y=!0)})),o.restore(),null!==a[0]){o.save(),this.attr({fillStyle:a[0].color});for(var w=0,x=b.length;w<x;w++){var k=b[w];this.fillRect(k.x,k.y,k.w,k.h)}o.restore()}return this}},{key:"border",value:function(e,t){var i=this.ctx;return i.lineWidth=Et,i.strokeStyle=t,"medium"===e?i.lineWidth=Rt(2)-.5:"thick"===e?i.lineWidth=Rt(3):"dashed"===e?i.setLineDash([Rt(3),Rt(2)]):"dotted"===e?i.setLineDash([Rt(1),Rt(1)]):"double"===e&&i.setLineDash([Rt(2),0]),this}},{key:"line",value:function(){var e=this.ctx;if(arguments.length>1){e.beginPath();var t=arguments.length<=0?void 0:arguments[0],i=o()(t,2),n=i[0],r=i[1];e.moveTo(At(n),At(r));for(var a=1;a<arguments.length;a+=1){var s=a<0||arguments.length<=a?void 0:arguments[a],l=o()(s,2),c=l[0],h=l[1];e.lineTo(At(c),At(h))}e.stroke()}return this}},{key:"strokeBorders",value:function(e){var t=this.ctx;t.save();var i=e.borderTop,n=e.borderRight,r=e.borderBottom,a=e.borderLeft;i&&(this.border.apply(this,m()(i)),this.line.apply(this,m()(e.topxys()))),n&&(this.border.apply(this,m()(n)),this.line.apply(this,m()(e.rightxys()))),r&&(this.border.apply(this,m()(r)),this.line.apply(this,m()(e.bottomxys()))),a&&(this.border.apply(this,m()(a)),this.line.apply(this,m()(e.leftxys()))),t.restore()}},{key:"strokePattern",value:function(e){var t=this.ctx;t.save();var i=e.x,n=e.y,r=e.width,a=e.height,o=e.pattern;if(o){t.beginPath();var s=At(i),l=s+Rt(r),c=At(n),h=c+Rt(a);switch(o){case"None":case"Solid":break;case"HorizontalStripe":t.lineWidth=2,t.setLineDash([]),Ft(t,s,c,l,h,4);break;case"ThinHorizontalStripe":t.lineWidth=1,t.setLineDash([]),Ft(t,s,c,l,h,4);break;case"Gray75":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,3);break;case"VerticalStripe":t.lineWidth=2,t.setLineDash([]),Mt(t,s,c,l,h,4);break;case"ThinVerticalStripe":t.lineWidth=1,t.setLineDash([]),Mt(t,s,c,l,h,4);break;case"Gray50":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,3.5);break;case"ReverseDiagonalStripe":t.lineWidth=2,t.setLineDash([]),Lt(t,s,c,l,h,4);break;case"ThinReverseDiagonalStripe":t.lineWidth=1,t.setLineDash([]),Lt(t,s,c,l,h,4);break;case"Gray25":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,4);break;case"DiagonalStripe":t.lineWidth=2,t.setLineDash([]),jt(t,s,c,l,h,4);break;case"ThinDiagonalStripe":t.lineWidth=1,t.setLineDash([]),jt(t,s,c,l,h,4);break;case"Gray12":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,4.5);break;case"DiagonalCrosshatch":t.lineWidth=1.5,t.setLineDash([]),Lt(t,s,c,l,h,4),jt(t,s,c,l,h,4);break;case"ThinHorizontalCrosshatch":t.lineWidth=1,t.setLineDash([]),Ft(t,s,c,l,h,4),Mt(t,s,c,l,h,4);break;case"Gray6":t.lineWidth=2,t.setLineDash([2]),zt(t,s,c,l,h,5);break;case"ThickDiagonalCrosshatch":t.lineWidth=2,t.setLineDash([]),Lt(t,s,c,l,h,4),jt(t,s,c,l,h,4);break;case"ThinDiagonalCrosshatch":t.lineWidth=1,t.setLineDash([]),Lt(t,s,c,l,h,4),jt(t,s,c,l,h,4)}t.closePath(),t.stroke()}t.restore()}},{key:"dropdown",value:function(e){var t=this.ctx,i=e.x,n=e.y,r=i+e.width-15,a=n+e.height-15;t.save(),t.beginPath(),t.moveTo(Rt(r),Rt(a)),t.lineTo(Rt(r+8),Rt(a)),t.lineTo(Rt(r+4),Rt(a+6)),t.closePath(),t.fillStyle="rgba(0, 0, 0, .45)",t.fill(),t.restore()}},{key:"error",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=n+a-1;i.save(),i.beginPath(),t?(i.moveTo(Rt(o-a+8),Rt(r-1)),i.lineTo(Rt(o-a),Rt(r-1)),i.lineTo(Rt(o-a),Rt(r+8))):(i.moveTo(Rt(o-8),Rt(r-1)),i.lineTo(Rt(o),Rt(r-1)),i.lineTo(Rt(o),Rt(r+8))),i.closePath(),i.fillStyle="rgba(255, 0, 0, .65)",i.fill(),i.restore()}},{key:"frozen",value:function(e){var t=this.ctx,i=e.x,n=e.y,r=i+e.width-1;t.save(),t.beginPath(),t.moveTo(Rt(r-8),Rt(n-1)),t.lineTo(Rt(r),Rt(n-1)),t.lineTo(Rt(r),Rt(n+8)),t.closePath(),t.fillStyle="rgba(0, 255, 0, .85)",t.fill(),t.restore()}},{key:"line2",value:function(){var e=this.ctx;if(arguments.length>1){e.beginPath();var t=arguments.length<=0?void 0:arguments[0],i=o()(t,2),n=i[0],r=i[1];e.moveTo(n,r);for(var a=1;a<arguments.length;a+=1){var s=a<0||arguments.length<=a?void 0:arguments[a],l=o()(s,2),c=l[0],h=l[1];e.lineTo(c,h)}e.stroke()}return this}},{key:"rect3",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=e.height,s=t.bgColor,l=t.isactiveeffect,c=t.tp,h=t.borderColor;s&&this.fillRectWithColor(s,n,r,a,o,l,c),i.save(),i.beginPath(),i.rect(Rt(n)-.5,Rt(r)-.5,Rt(a),Rt(o)),i.closePath(),i.strokeStyle=h||"black",i.stroke(),i.restore()}},{key:"rect2",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=e.height,s=e.bgcolor,l=e.pbgcolor,c=e.exttxtwidthR,h=e.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(n+1,r+1,a-2,o-2),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(n+1-f,r+1,a+u+f-2,o-2),i.clip(),t(),i.restore()}else t(),i.restore()}},{key:"rect",value:function(e,t){var i=this.ctx,n=e.x,r=e.y,a=e.width,o=e.height,s=e.bgcolor,l=e.pbgcolor,c=e.exttxtwidthR,h=e.exttxtwidthL;if(i.save(),i.beginPath(),i.fillStyle=void 0!==s?s:void 0!==l?l:"#ffffff",i.rect(At(n+1),At(r+1),Rt(a-2),Rt(o-2)),i.clip(),i.fill(),void 0!==c||void 0!==h){var u=void 0===c?0:c,f=void 0===h?0:h;i.restore(),i.save(),i.rect(At(n+1-f),At(r+1),Rt(a+u+f-2),Rt(o-2)),i.clip(),t(),i.restore()}else t(),i.restore()}}]),e}();function Ht(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return Nt(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Nt(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ut={fillStyle:"#f4f5f8"},Xt={fillStyle:"#fff",lineWidth:Et,strokeStyle:"#e6e6e6"};function Wt(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=e.cellRect(t,i),a=r.left,o=r.top,s=r.width,l=r.height;return new Dt(a,o+n,s,l,3)}function qt(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.cellRect(t.sri,t.sci),r=n.left,a=n.top,o=e.cols.sumWidth(t.sci,t.eci+1),s=e.rows.sumHeight(t.sri,t.eri+1);return new Dt(r,a+i,o,s,3)}function Yt(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=qt(e,t,i);return n.width+=3,n.height+=3,n}function Vt(e,t,i,n,r,a,o){var s=e.cols,l=e.viewRangeCache;if(!o.textwrap&&a.text&&a.text.length>0){var c=0,h=0;if(void 0===o.align||"center"===o.align||"left"===o.align)for(var u=r+1;u<=l.eci;u++){var f=e.getCell(i,u);if(null!==f&&void 0!==f.text&&f.text.length>0)break;c+=s.getWidth(u)}if(o.align&&("center"===o.align||"right"===o.align))for(var d=r-1;d>=l.sci;d--){var m=e.getCell(i,d);if(null!==m&&void 0!==m.text&&m.text.length>0)break;h+=s.getWidth(d)}c>0&&(t.exttxtwidthR=c),h>0&&(t.exttxtwidthL=h)}}function Gt(e){if(void 0!==e.rtxt&&void 0===e.bigfontsize){for(var t=[],i=[],n=[],r=0,a=e.rtxt.length,o=0;o<a;o++){var s=e.rtxt[o].txt.split("\n"),l=s.length,c=e.rtxt[o].font.size;if(1===l)n.push(e.rtxt[o]),c>r&&(r=c);else{if(0!==s[0].length){var h={};h.font=e.rtxt[o].font,h.txt=s[0],n.push(h),c>r&&(r=c)}i.push(r),t.push(n),n=[],r=0;for(var u=1;u<l-1;u++){var f={};f.font=e.rtxt[o].font,f.txt=s[u],n.push(f),t.push(n),i.push(c),n=[],r=0}if(0!==s[l-1].length){var d={};d.font=e.rtxt[o].font,d.txt=s[l-1],n.push(d),r=c}}}n.length>0&&(i.push(r),t.push(n)),e.rtxt=t,e.bigfontsize=i}}function Zt(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=t.sortedRowMap,s=t.rows,l=t.cols;t.viewRangeCache;if(!s.isHide(i)&&!l.isHide(n)){var c=i;o.has(i)&&(c=o.get(i));var h=t.getCell(c,n);if(null!==h&&(!h.merge||a)){Gt(h);var u=!1;"editable"in h&&!1===h.editable&&(u=!0);var f=t.getCellStyleOrDefault(c,n),d=Wt(t,i,n,r);d.bgcolor=f.bgcolor,d.pbgcolor=f.pbgcolor;var m=d,g=!1,v=!1;f.hasbgcolor&&!a&&((t.bgcolor||void 0===f.border||void 0===f.border.right)&&(m.width+=3,g=!0),(t.bgcolor||void 0===f.border||void 0===f.border.bottom)&&(m.height+=3,v=!0)),Vt(t,d,c,0,n,h,f);var p=t.getHighlightCellTxt(i,n);e.rect(m,(function(){var i="";i=t.settings.evalPaused||"server"===t.settings.updateMode?h.text||"":kt(h.text||"",ft,(function(e,i){return t.getCellTextOrDefault(i,e)})),f.format&&"server"!==t.settings.updateMode&&(i=Tt[f.format].render(i));var r=Object.assign({},f.font);r.size=yt(r.size),void 0===h.rtxt?""!==i&&e.text(i,d,{align:f.align,valign:f.valign,font:r,color:f.color,strike:f.strike,underline:f.underline},f.textwrap,p):e.richtext(h,d,f.align,f.valign,f.textwrap,p),t.validations.getError(c,n)&&e.error(d),u&&e.frozen(d),void 0!==f.pattern&&(d.setPattern(f.pattern),e.strokePattern(d))})),void 0!==f.border&&(g&&(d.width-=3),v&&(d.height-=3),d.setBorders(f.border),e.strokeBorders(d))}}}function Kt(e){var t=this.data,i=this.draw;if(e){var n=t.autoFilter,r=t.TableAutoFilters;Jt(t,e,i,n),r.forEach((function(n){Jt(t,e,i,n)}))}}function Jt(e,t,i,n){if(n.active()){var r=n.hrange();t.intersects(r)&&r.each((function(t,n){var r=Wt(e,t,n);i.dropdown(r)}))}}function $t(e,t,i,n,r){var a=this.draw,o=this.data;a.save(),o.displayRight2Left?a.translate(-t,i).translate(n,r):a.translate(t,i).translate(n,r),o.comments.forEach((function(t){if(e.sri<=t.row&&e.eri>=t.row&&e.sci<=t.col&&e.eci>=t.col){var i=Wt(o,t.row,t.col);a.error(i,o.displayRight2Left)}})),a.restore()}function Qt(e,t,i,n,r){var a=this.draw,o=this.data;a.save(),o.displayRight2Left?a.translate(-t,i).translate(n,r):a.translate(t,i).translate(n,r);var s=o.exceptRowSet;a.save(),a.translate(0,-0),e.emptyFirst((function(e,t){Zt(a,o,e,t)}),(function(e){return function(e){return!s.has(e)}(e)}),(function(e,t){return o.isEmpty(e,t)})),a.restore();var l=new Set;a.save(),a.translate(0,-0),o.eachMergesInView(e,(function(e){var t=e.sri,i=e.sci,n=e.eri;if(s.has(t)){if(!l.has(t)){l.add(t);var r=o.rows.sumHeight(t,n+1);a.translate(0,-r)}}else Zt(a,o,t,i,0,!0)})),a.restore(),Kt.call(this,e),a.restore()}function ei(e,t,i,n){var r=this.draw;r.save(),r.attr({fillStyle:"rgba(75, 137, 255, 0.08)"}).fillRect(e,t,i,n),r.restore()}function ti(e,t,i,n,r,a){var o=this,s=this.draw,l=this.data,c=t.h,h=t.w,u=a+n,f=r+i,d=l.displayRight2Left?l.viewWidth():0,m=l.displayRight2Left?d-i:0;if(s.save(),s.attr(Ut),"all"!==e&&"left"!==e||s.fillRect(m,u,i,c),"all"===e||"top"===e)if(l.displayRight2Left){var g=t.lineStartx?t.lineStartx:0;s.fillRect(g,0,h,n)}else s.fillRect(f,0,h,n);var p=l.selector.range,y=p.sri,b=p.sci,w=p.eri,x=p.eci;if(s.attr({textAlign:"center",textBaseline:"middle",font:"500 ".concat(Rt(12),"px Source Sans Pro"),fillStyle:"#585757",lineWidth:Et(),strokeStyle:"#e6e6e6"}),"all"===e||"left"===e){var k=m;l.rowEach(t.sri,t.eri,(function(e,t,n){var r=u+t,a=e;s.line([k,r],[k+i,r]),y<=a&&a<w+1&&ei.call(o,k,r,i,n),s.fillText(a+1,k+i/2,r+n/2),e>0&&l.rows.isHide(e-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([k+5,r+5],[k+i-5,r+5]),s.restore())})),s.line([k,c+u],[k+i,c+u]),s.line([k+i,u],[k+i,c+u])}"all"!==e&&"top"!==e||(l.colEach(t.sci,t.eci,(function(e,t,i){var r=l.displayRight2Left?d-(f+t+i):f+t,a=e;s.line([r,0],[r,n]),b<=a&&a<x+1&&ei.call(o,r,0,i,n),s.fillText(v(a),r+i/2,n/2),e>0&&l.cols.isHide(e-1)&&(s.save(),s.attr({strokeStyle:"#c6c6c6"}),s.line([r+5,5],[r+5,n-5]),s.restore())})),s.line([h+f,0],[h+f,n]),s.line([0,n],[h+f,n])),s.restore()}function ii(e,t){var i=this.draw;i.save(),i.attr({fillStyle:"#f4f5f8"}).fillRect(0,0,e,t),i.restore()}function ni(e,t,i,n,r){var a=e.sri,s=e.sci,l=e.eri,c=e.eci,h=e.w,u=e.h,f=e.clearStartx,d=void 0===f?0:f,m=e.lineStartx,g=void 0===m?0:m,v=this.draw,p=this.data,y=(p.settings,p.displayRight2Left),b=p.scroll;if(v.save(),y?v.attr(Xt).translate(-(t+n),i+r):v.attr(Xt).translate(t+n,i+r),v.clearRect(d,0,h,u),p.bgcolor&&v.fillRectWithColor(p.bgcolor,d,0,h,u),p.showGrid&&!p.bgcolor){if(y){h+=t+n;var w=o()(p.freeze,2),x=(w[0],w[1]);x>0&&s>=x&&(h+=b.x),0===x&&0==g&&(h=p.viewWidth()),p.rowEach(a,l,(function(e,t,i){e!==a&&v.line([g,t],[g+h,t]),e===l&&v.line([g,t+i],[g+h,t+i])}))}else p.rowEach(a,l,(function(e,t,i){e!==a&&v.line([0,t],[h,t]),e===l&&v.line([0,t+i],[h,t+i])}));if(y){var k=p.viewWidth();p.colEach(s,c,(function(e,t,i){v.line([k-t-i,0],[k-t-i,u]),e===s&&v.line([k-t,0],[k-t,u])}))}else p.colEach(s,c,(function(e,t,i){e!==s&&v.line([t,0],[t,u]),e===c&&v.line([t+i,0],[t+i,u])}));v.restore()}else v.restore()}function ri(e,t,i,n){var r=this.draw,a=this.data,o=a.viewWidth(),s=(o-e)/this.zoomlevel,l=(a.viewHeight()-t)/this.zoomlevel;a.displayRight2Left?r.save().translate(-e,t).attr({strokeStyle:"rgba(75, 137, 255, .6)"}):r.save().translate(e,t).attr({strokeStyle:"rgba(75, 137, 255, .6)"}),a.displayRight2Left?(r.line([0,n],[o,n]),r.line([o-i,0],[o-i,l])):(r.line([0,n],[s,n]),r.line([i,0],[i,l])),r.restore()}var ai=function(){function e(t,i){l()(this,e),this.el=t,this.draw=new Bt(t.getContext("2d"),i.viewWidth(),i.viewHeight()),this.draw.setel(t),this.data=i,this.zoomlevel=1}return r()(e,[{key:"resetData",value:function(e){this.data=e,this.render()}},{key:"clearSelectRender",value:function(){var e=this.data,t=this.draw,i=this.zoomlevel,n=e.selector,r=n.ri,a=n.ci,o=r;e.sortedRowMap.has(r)&&(o=sortedRowMap.get(r));var s=e.getCell(o,a);if(null!==s){var l=e.getCellStyleOrDefault(o,a),c=Wt(e,r,a,0);Vt(e,c,o,0,a,s,l);var h=e.cols.indexWidth,u=e.settings.row.height,f=e.freezeTotalWidth(),d=e.scroll,m=d.x,g=d.y;t.save(),t.scaledpr(i),e.displayRight2Left?t.attr(Xt).translate(-(h+f),u+0):t.attr(Xt).translate(h+f,u+0);var v=void 0===c.exttxtwidthR?0:c.exttxtwidthR,p=void 0===c.exttxtwidthL?0:c.exttxtwidthL;t.fillRect(c.x+1-p-m,c.y+1-g,c.width+v+p-2,c.height-2),t.restore()}}},{key:"render",value:function(){var e=this.data,t=this.zoomlevel;if(!e.isupdating){var i=e.rows,n=e.cols;if(0!==Object.keys(i._).length){var r=n.indexWidth,a=e.settings.row.height;this.draw.resize(e.viewWidth(),e.viewHeight()),this.draw.scaledpr(t),this.clear();var s=e.viewRange(),l=e.freezeTotalWidth(),c=e.freezeTotalHeight(),h=e.scroll,u=h.x,f=h.y;ni.call(this,s,r,a,l,c),Qt.call(this,s,r,a,-u,-f),$t.call(this,s,r,a,-u,-f),ti.call(this,"all",s,r,a,l,c),ii.call(this,r,a);var d=o()(e.freeze,2),m=d[0],g=d[1];if(m>0||g>0){if(m>0){var v=s.clone();v.sri=0,v.eri=m-1,v.h=c,ni.call(this,v,r,a,l,0),Qt.call(this,v,r,a,-u,0),$t.call(this,v,r,a,-u,0),ti.call(this,"top",v,r,a,l,0),this.highlightRanges(v,r,a,u,0)}if(g>0){var p=s.clone();p.sci=0,p.eci=g-1,p.w=l,p.clearStartx=e.displayRight2Left?this.draw.ctx.canvas.width-l:0,p.lineStartx=e.displayRight2Left?e.viewWidth()-l:0,ni.call(this,p,r,a,0,c),ti.call(this,"left",p,r,a,0,c),Qt.call(this,p,r,a,0,-f),$t.call(this,p,r,a,0,-f),this.highlightRanges(p,r,a,0,f)}var y=e.freezeViewRange();y.clearStartx=e.displayRight2Left?this.draw.ctx.canvas.width-l:0,y.lineStartx=e.displayRight2Left?e.viewWidth()-l:0,ni.call(this,y,r,a,0,0),ti.call(this,"all",y,r,a,0,0),Qt.call(this,y,r,a,0,0),$t.call(this,y,r,a,0,0),ri.call(this,r,a,l,c),this.highlightRanges(y,r,a,0,0)}this.highlightRanges(s,r,a,u,f)}}}},{key:"highlightRanges",value:function(e,t,i,n,r){var a=this.draw,o=this.data;if(o.showhighlight){if(a.save(),o.displayRight2Left?a.translate(-t,i).translate(-n,-r):a.translate(t,i).translate(-n,-r),o.highlightall){var s=Yt(o,e);s.bgcolor=o.highlightstyle.color,a.rect(s,(function(){}))}else if(o.highlightIR){var l,c=Ht(e.difference(o.highlightIR));try{for(c.s();!(l=c.n()).done;){var h=Yt(o,l.value);h.bgcolor=o.highlightstyle.color,a.rect(h,(function(){}))}}catch(e){c.e(e)}finally{c.f()}}else{var u,f=Ht(o.highlightrg);try{for(f.s();!(u=f.n()).done;){var d=u.value;if(e.intersects(d)){var m=d.clone();m.sri<e.sri&&(m.sri=e.sri),m.eri>e.eri&&(m.eri=e.eri),m.sci<e.sci&&(m.sci=e.sci),m.eci>e.eci&&(m.eci=e.eci);var g=Yt(o,m);g.bgcolor=o.highlightstyle.color,a.rect(g,(function(){}))}}}catch(e){f.e(e)}finally{f.f()}}a.restore()}}},{key:"clear",value:function(){this.draw.clear()}}]),e}();function oi(){var e=this.inputText;if(!/^\s*$/.test(e)){var t=this.textlineEl,i=this.textEl,n=this.areaOffset,r=e.split("\n"),a=Math.max.apply(Math,m()(r.map((function(e){return e.length})))),o=t.offset().width/e.length,s=(a+1)*o+5,l=this.viewFn().width-n.left-o,c=r.length;if(s>n.width){var h=s;s>l&&(h=l,c+=parseInt(s/l,10),c+=s%l>0?1:0),i.css("width","".concat(h,"px"))}c*=this.rowHeight,(c-=7)>n.height&&i.css("height","".concat(c,"px"))}}function si(e){var t=e.target;if(window.getSelection){var i=window.getSelection(),n=i.getRangeAt(0),r=document.createElement("br");n.deleteContents(),n.insertNode(r),n.collapse(!1),i.removeAllRanges(),i.addRange(n),this.inputText=t.innerText,this.inputHtml=t.innerHTML,oi.call(this)}}function li(e){var t=e.keyCode,i=e.altKey;13!==t&&9!==t&&e.stopPropagation(),13===t&&i&&(si.call(this,e),e.stopPropagation()),13!==t||i||e.preventDefault()}function ci(e){var t=e.target.innerText,i=e.target.innerHTML,n=this.suggest,r=this.textlineEl,a=this.validator,o=this.cell;if(this.textbox)return this.textbox.ischange=!0,void(this.inputHtml=i);if(null!==o)if("editable"in o&&!0===o.editable||void 0===o.editable){if(this.inputText=t,this.inputHtml=i,a)"list"===a.type?n.search(t):n.hide();else{var s=t.lastIndexOf("=");-1!==s?(n.search(t.substring(s+1),"f"),"("===e.data&&n.hide(),this.formalaTip.show(t)):(n.hide(),this.formalaTip.hide())}r.html(i),oi.call(this),this.change("input",t)}else e.target.innerText="";else{if(this.inputText=t,this.inputHtml=i,a)"list"===a.type?n.search(t):n.hide();else{var l=t.lastIndexOf("=");-1!==l?(n.search(t.substring(l+1),"f"),"("===e.data&&n.hide(),this.formalaTip.show(t)):(n.hide(),this.formalaTip.hide())}r.html(t),oi.call(this),this.change("input",t)}}function hi(e,t){var i=this.textEl.el;setTimeout((function(){if(t){var e=window.getSelection(),n=document.createRange();e.removeAllRanges(),n.selectNodeContents(i),n.collapse(!1),e.addRange(n),i.focus()}}),1)}function ui(e,t,i,n){var r=this.textEl,a=this.textlineEl;mobileAndTabletCheck()||r.el.blur();var o=!1;e.length>0?(o=!0,r.html(e)):r.html(t,!0,!0),o?a.html(e):a.html(t,!0,!0),hi.call(this,i,n)}function fi(e,t){var i=this.inputText,n=this.validator,r=0;if(n&&"list"===n.type)this.inputText=e,r=this.inputText.length;else{var a=i.lastIndexOf("="),o=i.substring(0,a+1),s=i.substring(a+1);s=-1!==s.indexOf(")")?s.substring(s.indexOf(")")):"",this.inputText="".concat(o+e.key,"("),r=this.inputText.length,this.inputText+="".concat(s),this.formalaTip.show(this.inputText)}ui.call(this,"",this.inputText,r,t)}function di(){this.suggest.setItems(this.formulas)}var mi=function(){function e(t,i,n,r){var a=this;l()(this,e),this.viewFn=i,this.rowHeight=n,this.formulas=t,this.formalaTip=new gt,this.suggest=new at(t,(function(e){fi.call(a,e,!0)})),this.datepicker=new ct,this.datepicker.change((function(e){a.setText(function(e){var t=e.getMonth()+1,i=e.getDate();return t<10&&(t="0".concat(t)),i<10&&(i="0".concat(i)),"".concat(e.getFullYear(),"-").concat(t,"-").concat(i)}(e)),a.clear()})),this.areaEl=f("div","".concat(ae,"-editor-area")).children(this.textEl=f("div","htmlline").on("input",(function(e){return ci.call(a,e)})).on("paste.stop",(function(){})).on("keydown",(function(e){return li.call(a,e)})),this.textlineEl=f("div","textline"),this.suggest.el,this.datepicker.el,this.formalaTip.el).on("mousemove.stop",(function(){})).on("mousedown.stop",(function(){})),this.el=f("div","".concat(ae,"-editor")).child(this.areaEl).hide(),this.suggest.bindInputEvents(this.textEl,r),this.areaOffset=null,this.freeze={w:0,h:0},this.cell=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.textbox=null,this.change=function(){},this.textboxChange=function(){}}return r()(e,[{key:"setFreezeLengths",value:function(e,t){this.freeze.w=e,this.freeze.h=t}},{key:"insertTextNewLine",value:function(e){si.call(this,e)}},{key:"clear",value:function(){this.textbox?(""!==this.inputHtml&&this.textboxChange(this.textbox,this.inputHtml),this.textbox.setVisible(!0)):""!==this.inputText&&this.change("finished",this.ishtml?this.inputHtml:this.inputText),this.cell=null,this.textbox=null,this.areaOffset=null,this.inputText="",this.inputHtml="",this.ishtml=!1,this.el.hide(),this.textEl.html(""),this.textEl.cssRemoveKeys("width","height","padding-left","padding-right","text-align","border"),this.textlineEl.html(""),di.call(this),this.datepicker.hide()}},{key:"setOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",i=this.textEl,n=this.areaEl,r=this.suggest,a=this.freeze,o=this.el;if(e){this.areaOffset=e;var s=e.left,l=e.top,c=e.width,h=e.height,u=e.l,f=e.t,d={left:0,top:0};a.w>u&&a.h>f||(a.w<u&&a.h<f?(d.left=a.w,d.top=a.h):a.w>u?d.top=a.h:a.h>f&&(d.left=a.w)),o.offset(d),n.offset({left:s-d.left-.8,top:l-d.top-.8}),i.offset({width:c-.2,height:h-.2});var m={left:0};m[t]=h,r.setOffset(m),r.hide()}}},{key:"setForTextBox",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.el,n=this.textEl;n.attr("contenteditable","true"),i.show(),this.textbox=e,this.textbox.setVisible(!1),this.ishtml=!0,this.inputText=e.text,this.inputHtml=e.html,ui.call(this,e.html,e.text,e.text.length,t),n.css("width","".concat(e.width-9,"px")),n.css("height","".concat(e.height,"px")),n.css("padding-left","".concat(e.lp,"pt")),n.css("padding-right","".concat(e.rp,"pt")),n.css("text-align",e.align),n.css("border","black 1px solid")}},{key:"setCell",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.el,r=this.datepicker,a=this.suggest,o=this.textEl;o.attr("contenteditable","true"),n.show(),this.cell=e;var s=e&&e.text||"",l=e&&e.html||"";if(e&&(e.f?s=e.f:e.ufv&&(s=e.ufv)),this.ishtml=e&&e.html,this.setTextAndHtml(l,s,i),this.validator=t,t){var c=t.type;"date"===c&&(r.show(),/^\s*$/.test(s)||r.setValue(s)),"list"===c&&(a.setItems(t.values()),a.search(""))}}},{key:"setTextAndHtml",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.inputText=t,this.inputHtml=e,ui.call(this,e,t,t.length,i),oi.call(this)}},{key:"setText",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.inputText=e,ui.call(this,"",e,e.length,t),oi.call(this)}}]),e}();function gi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var vi=function(e){ee()(i,e);var t=gi(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return l()(this,i),(n=t.call(this,"div","".concat(ae,"-button ").concat(r))).child(U("button.".concat(e))),n}return i}(u),pi=[["A3",11.69,16.54],["A4",8.27,11.69],["A5",5.83,8.27],["B4",9.84,13.9],["B5",6.93,9.84]],yi=["landscape","portrait"];function bi(e){return parseInt(96*e,10)}function wi(e){"cancel"===e?this.el.hide():this.toPrint()}function xi(e){var t=this.paper,i=e.target.value,n=pi[i];t.w=bi(n[1]),t.h=bi(n[2]),this.preview()}function ki(e){var t=this.paper,i=e.target.value,n=yi[i];t.orientation=n,this.preview()}var Ci=function(){function e(t,i){var n,r;l()(this,e),this.paper={w:bi(pi[0][1]),h:bi(pi[0][2]),padding:50,orientation:yi[0],get width(){return"landscape"===this.orientation?this.h:this.w},get height(){return"landscape"===this.orientation?this.w:this.h}},this.data=t,this.imageCanvas=i,this.el=f("div","".concat(ae,"-print")).children(f("div","".concat(ae,"-print-bar")).children(f("div","-title").child("Print settings"),f("div","-right").children(f("div","".concat(ae,"-buttons")).children(new vi("cancel").on("click",wi.bind(this,"cancel")),new vi("next","primary").on("click",wi.bind(this,"next"))))),f("div","".concat(ae,"-print-content")).children(this.contentEl=f("div","-content"),f("div","-sider").child(f("form","").children(f("fieldset","").children(f("label","").child("".concat(U("print.size"))),(n=f("select","")).children.apply(n,m()(pi.map((function(e,t){return f("option","").attr("value",t).child("".concat(e[0]," ( ").concat(e[1],"''x").concat(e[2],"'' )"))})))).on("change",xi.bind(this))),f("fieldset","").children(f("label","").child("".concat(U("print.orientation"))),(r=f("select","")).children.apply(r,m()(yi.map((function(e,t){return f("option","").attr("value",t).child("".concat(U("print.orientations")[t]))})))).on("change",ki.bind(this))))))).hide()}return r()(e,[{key:"resetData",value:function(e){this.data=e}},{key:"preview",value:function(){var e=this,t=this.data,i=this.paper,n=i.width,r=i.height,a=i.padding,o=n-2*a,s=r-2*a,l=t.contentRange(),c=parseInt(l.h/s,10)+1,h=o/l.w,u=a,d=a;h>1&&(u+=(o-l.w)/2);var m=0,g=0;this.contentEl.html(""),this.canvases=[];for(var v={sri:0,sci:0,eri:0,eci:0},p=function(i){var a=0,o=0,c=f("div","".concat(ae,"-canvas-card")),p=f("canvas","".concat(ae,"-canvas"));e.canvases.push(p.el);var y=new Bt(p.el,n,r);for(y.save(),y.translate(u,d),h<1&&y.scale(h,h);m<=l.eri;m+=1){var b=t.rows.getHeight(m);if(!((a+=b)<s)){o=-(a-b);break}for(var w=0;w<=l.eci;w+=1)Zt(y,t,m,w,g),v.eci=w}v.eri=m,y.restore(),y.save(),y.translate(u,d),h<1&&y.scale(h,h);var x=g;t.eachMergesInView(v,(function(e){var i=e.sri,n=e.sci;Zt(y,t,i,n,x)})),y.restore(),v.sri=v.eri,v.sci=v.eci,g+=o;var k=e.imageCanvas.el.getContext("2d");k.width=n,k.height=r,k.translate(u,d),h<1&&k.scale(h,h),p.el.getContext("2d").drawImage(e.imageCanvas.el,u-e.imageCanvas.tOffset.left,e.imageCanvas.tOffset.top),e.contentEl.child(f("div","".concat(ae,"-canvas-card-wraper")).child(c.child(p)))},y=0;y<c;y+=1)p()}},{key:"toPrint",value:function(){this.el.hide();var e=this.paper,t=f("iframe","").hide().el;window.document.body.appendChild(t);var i=t.contentWindow,n=i.document,r=document.createElement("style");r.innerHTML="\n @page { size: ".concat(e.width,"px ").concat(e.height,"px; };\n canvas {\n page-break-before: auto;\n page-break-after: always;\n image-rendering: pixelated;\n };\n "),n.head.appendChild(r),this.canvases.forEach((function(e){var t=e.cloneNode(!1);t.getContext("2d").drawImage(e,0,0),n.body.appendChild(t)})),i.print()}}]),e}(),_i=[{key:"copy",title:X("contextmenu.copy"),label:"Ctrl+C"},{key:"cut",title:X("contextmenu.cut"),label:"Ctrl+X"},{key:"paste",title:X("contextmenu.paste"),label:"Ctrl+V"},{key:"paste-value",title:X("contextmenu.pasteValue"),label:"Ctrl+Shift+V"},{key:"paste-format",title:X("contextmenu.pasteFormat"),label:"Ctrl+Alt+V"},{key:"divider"},{key:"insert-row",title:X("contextmenu.insertRow")},{key:"insert-column",title:X("contextmenu.insertColumn")},{key:"divider"},{key:"delete-row",title:X("contextmenu.deleteRow")},{key:"delete-column",title:X("contextmenu.deleteColumn")},{key:"delete-cell-text",title:X("contextmenu.deleteCellText")},{key:"hide",title:X("contextmenu.hide")},{key:"divider"},{key:"link",title:X("contextmenu.link")},{key:"openLink",title:X("contextmenu.openLink")},{key:"removeLink",title:X("contextmenu.removeLink")},{key:"divider"},{key:"validation",title:X("contextmenu.validation")},{key:"cell-editable",title:X("contextmenu.celleditable")},{key:"cell-non-editable",title:X("contextmenu.cellnoneditable")}];function Si(e,t){var i=this,n=null;return(n="divider"===e.key?f("div","".concat(ae,"-item divider")):f("div","".concat(ae,"-item")).on("click",(function(){e.callback?e.callback(t,t.selector.getObj()):i.itemClick(e.key),i.hide()})).children(e.text?e.text:e.title(),f("div","label").child(e.label||"").attr("k",e.key))).key=e.key,n}function Ti(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_i,i=arguments.length>1?arguments[1]:void 0;return t.map((function(t){return Si.call(e,t,i)}))}function Oi(e,t){return e.find((function(e){return e.key===t}))}var Ei=function(){function e(t,i){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3?arguments[3]:void 0;if(l()(this,e),window.mobileAndTabletCheck()){var o={key:"merge",title:X("contextmenu.merge"),label:""},s={key:"unmerge",title:X("contextmenu.unmerge"),label:""},c={key:"edit",title:X("contextmenu.edit"),label:""};_i.forEach((function(e){e.label=void 0,"delete-cell-text"===e.key&&(e.title=X("contextmenu.clear"))})),_i.push(o),_i.push(s),_i.unshift(c)}this.customMenuItemsForImage=[{key:"delete-image",title:X("contextmenu.deleteImage"),label:"Del"}],this.customsetting=a&&!a.usedefault,this.customItems=this.customsetting?a.customItems:[],this.menuItems=this.customsetting?Ti.call(this,a.customItems,i):Ti.call(this),this.el=(n=f("div","".concat(ae,"-contextmenu"))).children.apply(n,m()(this.menuItems)).hide(),this.viewFn=t,this.itemClick=function(){},this.showMenuBefore=function(){},this.isHide=r,this.setMode("range"),this.sheet=i}return r()(e,[{key:"getImageContextMenuItems",value:function(){return this.customMenuItemsForImage}},{key:"addImageContextMenuItems",value:function(e){var t=this.customMenuItemsForImage;e.forEach((function(e){var i=t.findIndex((function(t){return t.key===e.key}));i>=0&&t.splice(i,1)})),t.push.apply(t,e)}},{key:"delImageContextMenuItems",value:function(e){var t=this.customMenuItemsForImage;e.forEach((function(e){var i=t.findIndex((function(t){return t.key===e}));i>=0&&t.splice(i,1)}))}},{key:"updateImageContextMenuItems",value:function(e){this.addImageContextMenuItems([e])}},{key:"getCutomContextMenuItems",value:function(){if(this.customsetting)return this.customItems}},{key:"addCutomContextMenuItems",value:function(e){var t=this.customItems,i=this.customsetting,n=this.sheet,r=this.menuItems;if(i){var a=Ti.call(this,e,n);e.forEach((function(e,i){"divider"!==e.key&&Oi(t,e.key)||(t.push(e),r.push(a[i]))})),this.rebuildMenuItems(r)}}},{key:"insertCutomContextMenuItem",value:function(e,t){var i=this.customItems,n=this.customsetting,r=this.sheet,a=this.menuItems;if(n&&("divider"===e.key||!Oi(i,e.key))){var o=Si.call(this,e,r);i.splice(t,0,e),a.splice(t,0,o),this.rebuildMenuItems(a)}}},{key:"updateCutomContextMenuItem",value:function(e,t){var i=this.customItems,n=this.customsetting,r=this.sheet,a=this.menuItems;if(n){var o=i.findIndex((function(t){return t.key==e}));if(-1!==o){t.text&&(i[o].text=t.text),t.callback&&(i[o].callback=t.callback);var s=Si.call(this,i[o],r);a[o]=s,this.rebuildMenuItems(a)}}}},{key:"rebuildMenuItems",value:function(e){var t,i=this.sheet;(i.el.removeChild(this.el.el),e.length>0)?this.el=(t=f("div","".concat(ae,"-contextmenu"))).children.apply(t,m()(e)).hide():this.el=f("div","".concat(ae,"-contextmenu")).hide();i.el.child(this.el)}},{key:"delCutomContextMenuItems",value:function(e){var t=this.customItems,i=this.menuItems,n=this.customsetting;this.sheet;n&&(e.forEach((function(e){var n=t.findIndex((function(t){return t.key===e}));n>=0&&(t.splice(n,1),i.splice(n,1))})),this.rebuildMenuItems(i))}},{key:"setMode",value:function(e){if(!this.customsetting){var t=this.menuItems[12];"row-col"===e?t.show():t.hide()}}},{key:"hide",value:function(){var e=this.el;e.hide(),Ee(e)}},{key:"setPosition",value:function(e,t){if(!this.isHide){var i=this.el,n=this.sheet;this.showImageDeleteItem(i,n),this.showMenuBefore(this.menuItems);var r=i.show().offset(),a=r.width,o=r.height,s=this.viewFn(),l=e;s.width-e<=a&&(l-=a),i.css("left","".concat(l,"px"));var c=t;o+t>s.height&&(c-=o+t-s.height),i.css("top","".concat(c,"px")).css("max-height","".concat(s.height,"px")).css("bottom","auto"),Re(i)}}},{key:"showImageDeleteItem",value:function(e,t){var i=this,n=this.customMenuItemsForImage;n.forEach((function(t){e.children().forEach((function(i){i.children[0]&&i.children[0].getAttribute("k")===t.key&&e.removeChild(i)}))})),this.el.children()[0].className.includes("divider")&&this.el.removeChild(this.el.children()[0]);var r=t.canvas.fabric.getActiveObject();null!=r&&("OleObject"===r.imgType?this.addImageContextMenuItems([{key:"ole",title:X("contextmenu.download"),callback:function(){t.getOle(r.strid)}}]):this.delImageContextMenuItems(["ole"]),Ti.call(this,n,t).forEach((function(e){return i.el.child(e,!0)})),t.selector.hide(),t.selector.setObjId(r.id))}}]),e}(),Ri=i(9),Ii=i.n(Ri);var Ai=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;l()(this,e),this.tip=U("toolbar.".concat(t.replace(/-[a-z]/g,(function(e){return e[1].toUpperCase()})))),this.activeTip=null===i?null:U("toolbar.".concat(i.replace(/-[a-z]/g,(function(e){return e[1].toUpperCase()})))),n&&(this.tip+=" (".concat(n,")")),this.tag=t,this.shortcut=n,this.value=r,this.el=this.element(),this.change=function(){}}return r()(e,[{key:"element",value:function(){var e=this.tip,t=this.activeTip;return f("div","".concat(ae,"-toolbar-btn")).on("mouseenter",(function(i){""!==e&&function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.classList.contains("active")||null!==i){var n=t.getBoundingClientRect(),r=n.left,a=n.top,o=n.width,s=n.height,l=t.classList.contains("active")?i:e,c=f("div","".concat(ae,"-tooltip")).html(l).show();document.body.appendChild(c.el);var h=c.box();c.css("left","".concat(r+o/2-h.width/2,"px")).css("top","".concat(a+s+2,"px")),Te(t,"mouseleave",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)})),Te(t,"click",(function(){document.body.contains(c.el)&&document.body.removeChild(c.el)}))}}(e,i.target,t)})).attr("data-tooltip",e)}},{key:"setState",value:function(){}}]),e}();function Di(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Pi=function(e){ee()(i,e);var t=Di(i);function i(){return l()(this,i),t.apply(this,arguments)}return r()(i,[{key:"dropdown",value:function(){}},{key:"getValue",value:function(e){return e}},{key:"element",value:function(){var e=this,t=this.tag;return this.dd=this.dropdown(),this.dd.change=function(i){return e.change(t,e.getValue(i))},Ii()(re()(i.prototype),"element",this).call(this).child(this.dd)}},{key:"setState",value:function(e){e&&(this.value=e,this.dd.setTitle(e))}}]),i}(Ai);function Fi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Mi=function(e){ee()(i,e);var t=Fi(i);function i(e,n,r,a){var o,s;l()(this,i),(s=t.call(this,"div","".concat(ae,"-dropdown ").concat(a))).title=e,s.change=function(){},s.headerClick=function(){},"string"==typeof e?s.title=f("div","".concat(ae,"-dropdown-title")).child(e):r&&s.title.addClass("arrow-left"),s.contentEl=f("div","".concat(ae,"-dropdown-content")).css("width",n).hide();for(var c=arguments.length,h=new Array(c>4?c-4:0),u=4;u<c;u++)h[u-4]=arguments[u];return s.contentEl.tags=h.map((function(e){return e.tag})),(o=s).setContentChildren.apply(o,h),s.headerEl=f("div","".concat(ae,"-dropdown-header")),s.headerEl.on("click",(function(){if("block"!==s.contentEl.css("display")){if(s.show(),mobileAndTabletCheck()&&window.document.body.offsetWidth!==window.document.body.scrollWidth){if(s.menuDiv){for(var e=s.menuDiv.el,t=s.menuDiv.el.offsetParent;e.offsetParent&&"BODY"!==e.offsetParent.nodeName;)e=e.offsetParent;s.contentEl.el.clientWidth-e.offsetLeft>100&&(s.el.classList.replace("bottom-left","bottom-center"),s.contentEl.el.style.top+=t.offsetTop)}s.el.classList.contains("bottom-left")&&s.el.classList.replace("bottom-left","bottom-right"),s.el.classList.contains("top-left")&&s.el.classList.replace("top-left","top-right")}}else s.hide()})).children(s.title,r?f("div","".concat(ae,"-icon arrow-right")).child(f("div","".concat(ae,"-icon-img arrow-down"))):""),s.children(s.headerEl,s.contentEl),s}return r()(i,[{key:"setContentChildren",value:function(){var e;(this.contentEl.html(""),arguments.length>0)&&(e=this.contentEl).children.apply(e,arguments)}},{key:"showExplain",value:function(e){var t=this;if(this.contentEl.children().length===e.length)for(var i=function(i){Te(t.contentEl.children()[i],"mouseover",(function(){var n=new et(e[i].title()),r=et.findDialog(t.contentEl),a={top:"".concat(t.contentEl.children()[i].offsetTop,"px")};if(0!==r.length)for(var o=0;o<r.length;o++)t.contentEl.removeChild(t.contentEl.children()[r[o]]);n.css(a),t.contentEl.child(n)})),Te(t.contentEl.children()[i],"mouseout",(function(){var e=et.findDialog(t.contentEl);if(0!==e.length)for(var i=0;i<e.length;i++)t.contentEl.removeChild(t.contentEl.children()[e[i]])}))},n=0;n<e.length;n++)i(n)}},{key:"setTitle",value:function(e){this.title.html(e),this.hide()}},{key:"show",value:function(){var e=this;this.contentEl.show(),this.parent().active(),Re(this.parent(),(function(){e.hide()}))}},{key:"hide",value:function(){this.parent().active(!1),this.contentEl.hide(),Ee(this.parent())}}]),i}(u);function Li(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ji=function(e){ee()(i,e);var t=Li(i);function i(e,n){var r;l()(this,i);var a=new se("align-".concat(n)),o=e.map((function(e){return(t="align-".concat(e),f("div","".concat(ae,"-item")).child(new se(t))).on("click",(function(){r.setTitle(e),r.change(e)}));var t}));return r=t.call.apply(t,[this,a,"auto",!0,"bottom-left"].concat(m()(o)))}return r()(i,[{key:"setTitle",value:function(e){this.title.setName("align-".concat(e)),this.hide()}}]),i}(Mi);function zi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Bi=function(e){ee()(i,e);var t=zi(i);function i(e){return l()(this,i),t.call(this,"align",null,"",e)}return r()(i,[{key:"dropdown",value:function(){var e=this.value;return new ji(["left","center","right"],e)}}]),i}(Pi);function Hi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ni=function(e){ee()(i,e);var t=Hi(i);function i(e){return l()(this,i),t.call(this,"valign",null,"",e)}return r()(i,[{key:"dropdown",value:function(){var e=this.value;return new ji(["top","middle","bottom"],e)}}]),i}(Pi);function Ui(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Xi=function(e){ee()(i,e);var t=Ui(i);function i(){return l()(this,i),t.apply(this,arguments)}return r()(i,[{key:"element",value:function(){var e=this,t=this.tag;return Ii()(re()(i.prototype),"element",this).call(this).child(new se(t)).on("click",(function(){return e.click()}))}},{key:"click",value:function(){this.change(this.tag,this.toggle())}},{key:"setState",value:function(e){this.el.active(e)}},{key:"toggle",value:function(){return this.el.toggle()}},{key:"active",value:function(){return this.el.hasClass("active")}}]),i}(Ai);function Wi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var qi=function(e){ee()(i,e);var t=Wi(i);function i(){return l()(this,i),t.call(this,"autofilter")}return r()(i,[{key:"setState",value:function(){}}]),i}(Xi);function Yi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Vi=function(e){ee()(i,e);var t=Yi(i);function i(){return l()(this,i),t.call(this,"font-bold",null,"Ctrl+B")}return i}(Xi);function Gi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Zi=function(e){ee()(i,e);var t=Gi(i);function i(){return l()(this,i),t.call(this,"font-italic",null,"Ctrl+I")}return i}(Xi);function Ki(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ji=function(e){ee()(i,e);var t=Ki(i);function i(){return l()(this,i),t.call(this,"strike")}return i}(Xi);function $i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Qi=function(e){ee()(i,e);var t=$i(i);function i(){return l()(this,i),t.call(this,"underline",null,"Ctrl+U")}return i}(Xi),en=["#ffffff","#000100","#e7e5e6","#445569","#5b9cd6","#ed7d31","#a5a5a5","#ffc001","#4371c6","#71ae47"],tn=[["#f2f2f2","#7f7f7f","#d0cecf","#d5dce4","#deeaf6","#fce5d5","#ededed","#fff2cd","#d9e2f3","#e3efd9"],["#d8d8d8","#595959","#afabac","#adb8ca","#bdd7ee","#f7ccac","#dbdbdb","#ffe59a","#b3c6e7","#c5e0b3"],["#bfbfbf","#3f3f3f","#756f6f","#8596b0","#9cc2e6","#f4b184","#c9c9c9","#fed964","#8eaada","#a7d08c"],["#a5a5a5","#262626","#3a3839","#333f4f","#2e75b5","#c45a10","#7b7b7b","#bf8e01","#2f5596","#538136"],["#7f7f7f","#0c0c0c","#171516","#222a35","#1f4e7a","#843c0a","#525252","#7e6000","#203864","#365624"]],nn=["#c00000","#fe0000","#fdc101","#ffff01","#93d051","#00b04e","#01b0f1","#0170c1","#012060","#7030a0"];function rn(e){var t=this;return f("td","").child(f("div","".concat(ae,"-color-palette-cell")).on("click.stop",(function(){return t.change(e)})).css("background-color",e))}var an=function e(){var t,i,n,r=this;l()(this,e),this.el=f("div","".concat(ae,"-color-palette")),this.change=function(){};var a=f("table","").children((t=f("tbody","")).children.apply(t,[(i=f("tr","".concat(ae,"-theme-color-placeholders"))).children.apply(i,m()(en.map((function(e){return rn.call(r,e)}))))].concat(m()(tn.map((function(e){var t;return(t=f("tr","".concat(ae,"-theme-colors"))).children.apply(t,m()(e.map((function(e){return rn.call(r,e)}))))}))),[(n=f("tr","".concat(ae,"-standard-colors"))).children.apply(n,m()(nn.map((function(e){return rn.call(r,e)}))))])));this.el.child(a)};function on(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var sn=function(e){ee()(i,e);var t=on(i);function i(e,n){var r;l()(this,i);var a=new se(e).css("height","16px").css("border-bottom","3px solid ".concat(n)),o=new an;return o.change=function(e){r.setTitle(e),r.change(e)},r=t.call(this,a,"max-content",!1,"bottom-left",o.el)}return r()(i,[{key:"setTitle",value:function(e){this.title.css("border-color",e),this.hide()}}]),i}(Mi);function ln(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var cn=[["thin",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" style="user-select: none;"></line></svg>'],["medium",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="2" style="user-select: none;"><line x1="0" y1="1.0" x2="50" y2="1.0" stroke-width="2" stroke="black" style="user-select: none;"></line></svg>'],["thick",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="3" style="user-select: none;"><line x1="0" y1="1.5" x2="50" y2="1.5" stroke-width="3" stroke="black" style="user-select: none;"></line></svg>'],["dashed",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="2" style="user-select: none;"></line></svg>'],["dotted",'<svg xmlns="http://www.w3.org/2000/svg" width="50" height="1" style="user-select: none;"><line x1="0" y1="0.5" x2="50" y2="0.5" stroke-width="1" stroke="black" stroke-dasharray="1" style="user-select: none;"></line></svg>']],hn=function(e){ee()(i,e);var t=ln(i);function i(e){var n;l()(this,i);var r=new se("line-type"),a=0,o=cn.map((function(t,i){return f("div","".concat(ae,"-item state ").concat(e===t[0]?"checked":"")).on("click",(function(){o[a].toggle("checked"),o[i].toggle("checked"),a=i,n.hide(),n.change(t)})).child(f("div","".concat(ae,"-line-type")).html(t[1]))}));return n=t.call.apply(t,[this,r,"max-content",!1,"bottom-left"].concat(m()(o)))}return i}(Mi);function un(){var e;return f("table","").child((e=f("tbody","")).children.apply(e,arguments))}function fn(e){var t=this;return f("td","").child(f("div","".concat(ae,"-border-palette-cell")).child(new se("border-".concat(e))).on("click",(function(){t.mode=e;var i=t.mode,n=t.style,r=t.color;t.change({mode:i,style:n,color:r})})))}var dn=function e(){var t,i,n=this;l()(this,e),this.color="#000",this.style="thin",this.mode="all",this.change=function(){},this.ddColor=new sn("line-color",this.color),this.ddColor.change=function(e){n.color=e},this.ddType=new hn(this.style),this.ddType.change=function(e){var t=o()(e,1)[0];n.style=t},this.el=f("div","".concat(ae,"-border-palette"));var r=un(f("tr","").children(f("td","".concat(ae,"-border-palette-left")).child(un((t=f("tr","")).children.apply(t,m()(["all","inside","horizontal","vertical","outside"].map((function(e){return fn.call(n,e)})))),(i=f("tr","")).children.apply(i,m()(["left","top","right","bottom","none"].map((function(e){return fn.call(n,e)})))))),f("td","".concat(ae,"-border-palette-right")).children(f("div","".concat(ae,"-toolbar-btn")).child(this.ddColor.el),f("div","".concat(ae,"-toolbar-btn")).child(this.ddType.el))));this.el.child(r)};function mn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var gn=function(e){ee()(i,e);var t=mn(i);function i(){var e;l()(this,i);var n=new se("border-all"),r=new dn;return r.change=function(t){e.change(t),e.hide()},e=t.call(this,n,"max-content",!1,"bottom-left",r.el)}return i}(Mi);function vn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var pn=function(e){ee()(i,e);var t=vn(i);function i(){return l()(this,i),t.call(this,"border")}return r()(i,[{key:"dropdown",value:function(){return new gn}}]),i}(Pi);function yn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var bn=function(e){ee()(i,e);var t=yn(i);function i(){return l()(this,i),t.apply(this,arguments)}return r()(i,[{key:"element",value:function(){var e=this;return this.icon=new se(this.tag),Ii()(re()(i.prototype),"element",this).call(this).child(this.icon).on("click",(function(){return e.change(e.tag)}))}},{key:"setState",value:function(e){this.el.disabled(e)}},{key:"setIcon",value:function(e){this.icon.setName(e)}}]),i}(Ai);function wn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var xn=function(e){ee()(i,e);var t=wn(i);function i(){return l()(this,i),t.call(this,"clearformat")}return i}(bn);function kn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Cn=function(e){ee()(i,e);var t=kn(i);function i(){return l()(this,i),t.call(this,"paintformat")}return r()(i,[{key:"setState",value:function(){}}]),i}(Xi);function _n(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Sn=function(e){ee()(i,e);var t=_n(i);function i(e){return l()(this,i),t.call(this,"color",null,void 0,e)}return r()(i,[{key:"dropdown",value:function(){var e=this.tag,t=this.value;return new sn(e,t)}}]),i}(Pi);function Tn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var On=function(e){ee()(i,e);var t=Tn(i);function i(e){return l()(this,i),t.call(this,"bgcolor",null,void 0,e)}return r()(i,[{key:"dropdown",value:function(){var e=this.tag,t=this.value;return new sn(e,t)}}]),i}(Pi);function En(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Rn=function(e){ee()(i,e);var t=En(i);function i(){var e;l()(this,i);var n=pt.map((function(t){return f("div","".concat(ae,"-item")).on("click",(function(){e.setTitle("".concat(t.pt)),e.change(t)})).child("".concat(t.pt))}));return e=t.call.apply(t,[this,"10","60px",!0,"bottom-left"].concat(m()(n)))}return i}(Mi);function In(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var An=function(e){ee()(i,e);var t=In(i);function i(){return l()(this,i),t.call(this,"font-size")}return r()(i,[{key:"getValue",value:function(e){return e.pt}},{key:"dropdown",value:function(){return new Rn}}]),i}(Pi);function Dn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Pn=function(e){ee()(i,e);var t=Dn(i);function i(){var e;l()(this,i);var n=[{text:"50%",number:.5},{text:"75%",number:.75},{text:"100%",number:1},{text:"125%",number:1.25},{text:"150%",number:1.5},{text:"175%",number:1.75},{text:"200%",number:2}].map((function(t){return f("div","".concat(ae,"-item")).on("click",(function(){e.setTitle("".concat(t.text)),e.change(t)})).child("".concat(t.text))}));return e=t.call.apply(t,[this,"10","60px",!0,"bottom-left"].concat(m()(n)))}return i}(Mi);function Fn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Mn=function(e){ee()(i,e);var t=Fn(i);function i(){return l()(this,i),t.call(this,"zoom-size")}return r()(i,[{key:"getValue",value:function(e){return e}},{key:"setState",value:function(e){"string"!=typeof e&&(e=100*e+"%"),Ii()(re()(i.prototype),"setState",this).call(this,e)}},{key:"dropdown",value:function(){return new Pn}}]),i}(Pi);function Ln(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var jn=function(e){ee()(i,e);var t=Ln(i);function i(){var e;l()(this,i);var n=vt.map((function(t){return f("div","".concat(ae,"-item")).on("click",(function(){e.setTitle(t.title),e.change(t)})).child(t.title)}));return e=t.call.apply(t,[this,vt[0].title,"max-content",!0,"bottom-left"].concat(m()(n)))}return i}(Mi);function zn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Bn=function(e){ee()(i,e);var t=zn(i);function i(){return l()(this,i),t.call(this,"font-name")}return r()(i,[{key:"getValue",value:function(e){return e.key}},{key:"dropdown",value:function(){return new jn}}]),i}(Pi);function Hn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Nn=function(e){ee()(i,e);var t=Hn(i);function i(){var e;l()(this,i);var n=St.slice(0);return n.splice(2,0,{key:"divider"}),n.splice(8,0,{key:"divider"}),n=n.map((function(t){var i=f("div","".concat(ae,"-item"));return"divider"===t.key?i.addClass("divider"):(i.child(t.title()).on("click",(function(){e.setTitle(t.title()),e.change(t)})),t.label&&i.child(f("div","label").html(t.label))),i})),e=t.call.apply(t,[this,"Normal","220px",!0,"bottom-left"].concat(m()(n)))}return r()(i,[{key:"setTitle",value:function(e){for(var t=0;t<St.length;t+=1)St[t].key===e&&this.title.html(St[t].title());this.hide()}}]),i}(Mi);function Un(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Xn=function(e){ee()(i,e);var t=Un(i);function i(){return l()(this,i),t.call(this,"format")}return r()(i,[{key:"getValue",value:function(e){return e.key}},{key:"dropdown",value:function(){return new Nn}}]),i}(Pi),Wn=i(8),qn=i.n(Wn);function Yn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Vn=function(e){ee()(i,e);var t=Yn(i);function i(){var e,n;l()(this,i);var r=ht.map((function(e){return f("div","".concat(ae,"-item")).on("click",(function(){n.hide(),n.change(e)})).child(e.key)}));return n=t.call.apply(t,[this,new se("formula"),"max-content",!0,"bottom-left"].concat(m()(r))),Ii()((e=qn()(n),re()(i.prototype)),"showExplain",e).call(e,ht),n}return i}(Mi);function Gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Zn=function(e){ee()(i,e);var t=Gn(i);function i(){return l()(this,i),t.call(this,"formula")}return r()(i,[{key:"getValue",value:function(e){return e.key}},{key:"dropdown",value:function(){return new Vn}}]),i}(Pi);function Kn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Jn=function(e){ee()(i,e);var t=Kn(i);function i(){return l()(this,i),t.call(this,"freeze")}return i}(Xi);function $n(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Qn=function(e){ee()(i,e);var t=$n(i);function i(){return l()(this,i),t.call(this,"merge","unmerge")}return r()(i,[{key:"setState",value:function(e,t){this.el.active(e).disabled(t)}}]),i}(Xi);function er(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var tr=function(e){ee()(i,e);var t=er(i);function i(){return l()(this,i),t.call(this,"print","Ctrl+P")}return i}(bn);function ir(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var nr=function(e){ee()(i,e);var t=ir(i);function i(){return l()(this,i),t.call(this,"textwrap")}return i}(Xi);function rr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ar=function(e){ee()(i,e);var t=rr(i);function i(){var e;l()(this,i);var n=new se("ellipsis"),r=f("div","".concat(ae,"-toolbar-more"));return(e=t.call(this,n,"max-content",!1,"bottom-right",r)).moreBtns=r,screen.width<500?e.contentEl.css("max-width","200px"):e.contentEl.css("max-width","420px"),e}return i}(Mi),or=function(e){ee()(i,e);var t=rr(i);function i(){var e;return l()(this,i),(e=t.call(this,"more")).el.hide(),e}return r()(i,[{key:"dropdown",value:function(){return new ar}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide()}}]),i}(Pi);function sr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var lr=function(e){ee()(i,e);var t=sr(i);function i(){return l()(this,i),t.call(this,"sort")}return i}(bn);function cr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var hr=function(e){ee()(i,e);var t=cr(i);function i(){return l()(this,i),t.call(this,"search")}return i}(bn);function ur(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var fr=function(e){ee()(i,e);var t=ur(i);function i(){return l()(this,i),t.call(this,"commentEdit")}return i}(bn);function dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var mr=function(e){ee()(i,e);var t=dr(i);function i(){return l()(this,i),t.call(this,"commentRemove")}return i}(bn);function gr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var vr=function(e){ee()(i,e);var t=gr(i);function i(){return l()(this,i),t.call(this,"commentPrevious")}return i}(bn);function pr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var yr=function(e){ee()(i,e);var t=pr(i);function i(){return l()(this,i),t.call(this,"commentNext")}return i}(bn);function br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var wr=function(e){ee()(i,e);var t=br(i);function i(){var e;l()(this,i);var n=new se("".concat(ae,"-icon-img insert-image")),r=f("div","".concat(ae,"-item")),a=f("input");a.attr({type:"file",name:"photo",id:"upload-image",style:"display:none;",accept:"image/*"}),r.tag="fromLocal";var o=f("label");o.attr("for","upload-image"),o.child(new se("".concat(ae,"-icon-img insert-image-local"))),o.child(" "+U("menubar.".concat(r.tag))),r.child(a),r.child(o),r.on("click",(function(){e.change("local")}));var s,c=(s="".concat(ae,"-icon-img insert-image-url"),f("div","".concat(ae,"-item")).child(new se(s)));return c.tag="fromURL",c.child(" "+U("menubar.".concat(c.tag))),c.on("click",(function(){e.change("url")})),e=t.call.apply(t,[this,n,"auto",!0,"bottom-left"].concat([r,c]))}return i}(Mi);function xr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var kr=function(e){ee()(i,e);var t=xr(i);function i(e){return l()(this,i),t.call(this,"insert-image",null,"",e)}return r()(i,[{key:"dropdown",value:function(){return new wr}}]),i}(Pi);function Cr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var _r=function(e){ee()(i,e);var t=Cr(i);function i(){var e;return l()(this,i),(e=t.call(this,"menu-display-hide","")).state="up",e}return r()(i,[{key:"setUp",value:function(){this.setIcon("menu-display-hide"),this.state="up"}},{key:"setDown",value:function(){this.setIcon("menu-display-show"),this.state="down"}}]),i}(bn);function Sr(){return f("div","".concat(ae,"-toolbar-divider"))}function Tr(){var e=this;this.btns2=[],this.items.forEach((function(t){if(Array.isArray(t))t.forEach((function(t){var i=t.el,n=i.box(),r=i.computedStyle(),a=r.marginLeft,o=r.marginRight;e.btns2.push([i,n.width+parseInt(a,10)+parseInt(o,10)])}));else{var i=t.box(),n=t.computedStyle(),r=n.marginLeft,a=n.marginRight;e.btns2.push([t,i.width+parseInt(r,10)+parseInt(a,10)])}}))}function Or(){var e,t,i=this.el,n=this.btns,r=this.moreEl,a=this.btns2,s=r.dd,l=s.moreBtns,c=s.contentEl,h=i.box(),u=100,f=12,d=[],m=[];a.forEach((function(e,t){var i=o()(e,2),n=i[0],r=i[1];u+=r,t===a.length-1||u<h.width?d.push(n):(f+=r,m.push(n))})),(e=n.html("")).children.apply(e,d),(t=l.html("")).children.apply(t,m),c.css("width","".concat(f,"px")),m.length>0?r.show():r.hide()}var Er=function(){function e(t,i,n,r){var a=this;l()(this,e),this.data=t,this.change=function(){},this.widthFn=i,this.isHide=n;var o=t.defaultStyle();this.items=[[new tr,this.paintformatEl=new Cn,this.clearformatEl=new xn],Sr(),[this.formatEl=new Xn],Sr(),[this.fontEl=new Bn,this.fontSizeEl=new An],Sr(),[this.zoomSizeEl=new Mn,this.boldEl=new Vi,this.italicEl=new Zi,this.underlineEl=new Qi,this.strikeEl=new Ji,this.textColorEl=new Sn(o.color)],Sr(),[this.fillColorEl=new On(o.bgcolor),this.borderEl=new pn,this.mergeEl=new Qn],Sr(),[this.alignEl=new Bi(o.align),this.valignEl=new Ni(o.valign),this.textwrapEl=new nr],Sr(),[this.freezeEl=new Jn,this.autofilterEl=new qi,this.formulaEl=new Zn,this.sortEl=new lr,this.insertImageEL=new kr,this.searchEl=new hr],Sr(),[this.commentEditEl=new fr,this.commentRemoveEl=new mr,this.commentPreviousEl=new vr,this.commentNextEl=new yr],Sr(),[this.moreEl=new or]],screen.width<500&&this.items[0].splice(0,1),n&&r&&(this.items=[[new tr,this.moreEl=new or,this.sortEl=new lr,this.searchEl=new hr]]),this.el=f("div","".concat(ae,"-toolbar")),this.btns=f("div","".concat(ae,"-toolbar-btns")),this.items.forEach((function(e){Array.isArray(e)?e.forEach((function(e){a.btns.child(e.el),e.change=function(){a.change.apply(a,arguments)}})):a.btns.child(e.el)}));var s=this.menuDisplay=new _r;s.change=function(){a.change.apply(a,arguments)},this.el.children(this.btns.el,s.el),n&&!r?this.el.hide():(this.reset(),setTimeout((function(){Tr.call(a),Or.call(a)}),0),Te(window,"resize",(function(){Or.call(a)})))}return r()(e,[{key:"paintformatActive",value:function(){return this.paintformatEl.active()}},{key:"paintformatToggle",value:function(){this.paintformatEl.toggle()}},{key:"trigger",value:function(e){this["".concat(e,"El")].click()}},{key:"resetData",value:function(e){this.data=e,this.reset()}},{key:"reset",value:function(){if(!this.isHide){var e=this.data,t=e.getSelectedCellStyle();this.mergeEl.setState(e.canUnmerge(),!1),this.autofilterEl.setState(!e.canAutofilter());var i=t.font,n=t.format;this.formatEl.setState(n),this.fontEl.setState(i.name),this.fontSizeEl.setState(i.size),this.zoomSizeEl.setState(e.zoomlevel),this.boldEl.setState(i.bold),this.italicEl.setState(i.italic),this.underlineEl.setState(t.underline),this.strikeEl.setState(t.strike),this.textColorEl.setState(t.color),this.fillColorEl.setState(t.bgcolor),this.alignEl.setState(t.align),this.valignEl.setState(t.valign),this.textwrapEl.setState(t.textwrap),this.freezeEl.setState(e.freezeIsActive())}}}]),e}(),Rr=function(){function e(t,i){var n,r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"600px",o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];l()(this,e),this.moving=!1,this.drag=s,this.title=t;var c=parseInt(a);screen.width<500&&c>300&&(a="300px"),this.el=f("div","".concat(ae,"-modal")).css("width",a).css("position","absolute").children(f("div","".concat(ae,"-modal-header")).children(new se("close").on("click.stop",(function(){return r.hide()})),this.title),(n=f("div","".concat(ae,"-modal-content"))).children.apply(n,m()(i))).hide(),this.showDimmer=o,this.drag&&this.el.on("mousedown.stop",(function(e){return r.mousedownHandler(e)}))}return r()(e,[{key:"show",value:function(){var e=this;if(!this.moving){this.showDimmer&&(this.dimmer=f("div","".concat(ae,"-dimmer active")),document.body.appendChild(this.dimmer.el));var t=this.el.show().box(),i=t.width,n=t.height,r=document.documentElement,a=r.clientHeight,o=r.clientWidth;this.el.offset({left:(o-i)/2,top:(a-n)/3}),window.xkeydownEsc=function(t){27===t.keyCode&&e.hide()},Te(window,"keydown",window.xkeydownEsc)}}},{key:"hide",value:function(){this.el.hide(),this.showDimmer&&document.body.removeChild(this.dimmer.el),Oe(window,"keydown",window.xkeydownEsc),delete window.xkeydownEsc}},{key:"mousedownHandler",value:function(e){var t=this,i=e;Ie(window,(function(e){if(t.moving=!0,null!==i){var n=t.el.offset(void 0);t.el.offset({left:n.left+e.movementX,top:n.top+e.movementY}),i=e}}),(function(){i=null,t.moving=!1}))}}]),e}(),Ir=function(){function e(t,i){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;l()(this,e),this.vchange=function(){},this.el=f("div","".concat(ae,"-form-input")),this.input=f("input","").css("width",t).on("input",(function(e){return n.vchange(e)})).attr("placeholder",i).attr("maxlength",r),this.el.child(this.input)}return r()(e,[{key:"focus",value:function(){var e=this;setTimeout((function(){e.input.el.focus()}),10)}},{key:"hint",value:function(e){this.input.attr("placeholder",e)}},{key:"setReadonly",value:function(e){e?this.input.attr("readonly",""):this.input.removeAttr("readonly")}},{key:"val",value:function(e){return this.input.val(e)}}]),e}();function Ar(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return Dr(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Dr(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Dr(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Pr=function(){function e(t,i,n){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(e){return e},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};l()(this,e),this.key=t,this.getTitle=a,this.change=o,this.width=n,this.vchange=function(){},this.items=[],this.itemsmap=new Map,this.el=f("div","".concat(ae,"-form-select")),this.suggest=new at(i.map((function(e){return{key:e,title:r.getTitle(e)}})),(function(e){r.itemClick(e.key),o(e.key),r.vchange(e.key)}),n,this.el),this.el.children(this.itemEl=f("div","input-text").html(this.getTitle(t)),this.suggest.el).on("click",(function(){return r.show()}))}return r()(e,[{key:"show",value:function(){this.suggest.search("")}},{key:"itemClick",value:function(e){this.key=e,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(e)):this.itemEl.html(this.getTitle(e))}},{key:"setItemsMap",value:function(e){var t=this;this.itemsmap=e;var i,n=[],r=Ar(e);try{for(r.s();!(i=r.n()).done;){var a=o()(i.value,2),s=a[0],l=a[1];n.push({key:s,title:l})}}catch(e){r.e(e)}finally{r.f()}this.suggest=new at(n,(function(e){t.itemClick(e.key),t.change(e.key),t.vchange(e.key)}),this.width,this.el),e.size>6&&this.suggest.el.css("height","200px"),this.el.empty(),this.el.children(this.itemEl=f("div","input-text").html(n[0].title),this.suggest.el)}},{key:"val",value:function(e){return void 0!==e?(this.key=e,this.itemsmap.size>0?this.itemEl.html(this.itemsmap.get(e)):this.itemEl.html(this.getTitle(e)),this):this.key}}]),e}(),Fr={number:/(^\d+$)|(^\d+(\.\d{0,4})?$)/,date:/^\d{4}-\d{1,2}-\d{1,2}$/},Mr=function(){function e(t,i,n,r){var a=this;l()(this,e),this.label="",this.rule=i,n&&(this.label=f("label","label").css("width","".concat(r,"px")).html(n)),this.tip=f("div","tip").child("tip").hide(),this.input=t,this.input.vchange=function(){return a.validate()},this.el=f("div","".concat(ae,"-form-field")).children(this.label,t.el,this.tip)}return r()(e,[{key:"isShow",value:function(){return"none"!==this.el.css("display")}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){return this.el.hide(),this}},{key:"val",value:function(e){return this.input.val(e)}},{key:"hint",value:function(e){this.input.hint(e)}},{key:"validate",value:function(){var e=this.input,t=this.rule,i=this.tip,n=this.el,r=e.val();if(t.required&&/^\s*$/.test(r))return i.html(U("validation.required")),n.addClass("error"),!1;if((t.type||t.pattern)&&!(t.pattern||Fr[t.type]).test(r))return i.html(U("validation.notMatch")),n.addClass("error"),!1;return n.removeClass("error"),!0}},{key:"validateFail",value:function(e){var t=this.el,i=this.tip;t.addClass("error"),i.html(e),i.show()}},{key:"validateClear",value:function(){var e=this.el,t=this.tip;e.removeClass("error"),t.html(""),t.hide()}}]),e}();function Lr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var jr=function(e){ee()(i,e);var t=Lr(i);function i(){var e;l()(this,i);var n=new Mr(new Pr("cell",["cell"],"100%",(function(e){return U("dataValidation.modeType.".concat(e))})),{required:!0},"".concat(U("dataValidation.range"),":"),100),r=new Mr(new Ir("120px","E3 or E3:F12"),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/}),a=new Mr(new Pr("list",["list","number","date","phone","email"],"100%",(function(e){return U("dataValidation.type.".concat(e))}),(function(t){return e.criteriaSelected(t)})),{required:!0},"".concat(U("dataValidation.criteria"),":"),100),o=new Mr(new Pr("be",["be","nbe","eq","neq","lt","lte","gt","gte"],"160px",(function(e){return U("dataValidation.operator.".concat(e))}),(function(t){return e.criteriaOperatorSelected(t)})),{required:!0}).hide(),s=new Mr(new Ir("70px","10"),{required:!0}).hide(),c=new Mr(new Ir("70px","100"),{required:!0,type:"number"}).hide(),h=new Mr(new Ir("120px","a,b,c"),{required:!0}),u=new Mr(new Ir("70px","10"),{required:!0,type:"number"}).hide();return(e=t.call(this,U("contextmenu.validation"),[f("div","".concat(ae,"-form-fields")).children(n.el,r.el),f("div","".concat(ae,"-form-fields")).children(a.el,o.el,s.el,c.el,u.el,h.el),f("div","".concat(ae,"-buttons")).children(new vi("cancel").on("click",(function(){return e.btnClick("cancel")})),new vi("remove").on("click",(function(){return e.btnClick("remove")})),new vi("save","primary").on("click",(function(){return e.btnClick("save")})))])).mf=n,e.rf=r,e.cf=a,e.of=o,e.minvf=s,e.maxvf=c,e.vf=u,e.svf=h,e.change=function(){},e}return r()(i,[{key:"showVf",value:function(e){var t="date"===e?"2018-11-12":"10",i=this.vf;i.input.hint(t),i.show()}},{key:"criteriaSelected",value:function(e){var t=this.of,i=this.minvf,n=this.maxvf,r=this.vf,a=this.svf;"date"===e||"number"===e?(t.show(),i.rule.type=e,n.rule.type=e,"date"===e?(i.hint("2018-11-12"),n.hint("2019-11-12")):(i.hint("10"),n.hint("100")),i.show(),n.show(),r.hide(),a.hide()):("list"===e?a.show():a.hide(),r.hide(),t.hide(),i.hide(),n.hide())}},{key:"criteriaOperatorSelected",value:function(e){if(e){var t=this.minvf,i=this.maxvf,n=this.vf;if("be"===e||"nbe"===e)t.show(),i.show(),n.hide();else{var r=this.cf.val();n.rule.type=r,"date"===r?n.hint("2018-11-12"):n.hint("10"),n.show(),t.hide(),i.hide()}}}},{key:"btnClick",value:function(e){if("cancel"===e)this.hide();else if("remove"===e)this.change("remove"),this.hide();else if("save"===e){for(var t=["mf","rf","cf","of","svf","vf","minvf","maxvf"],i=0;i<t.length;i+=1){var n=this[t[i]];if(n.isShow()&&!n.validate())return}var r=this.mf.val(),a=this.rf.val(),o=this.cf.val(),s="phone"===o||"email"===o?"":this.of.val(),l=this.svf.val();"number"!==o&&"date"!==o||(l="be"===s||"nbe"===s?[this.minvf.val(),this.maxvf.val()]:this.vf.val()),this.change("save",r,a,{type:o,operator:s,required:!1,value:l}),this.hide()}}},{key:"setValue",value:function(e){if(e){var t=this.mf,i=this.rf,n=this.cf,r=this.of,a=this.svf,o=this.vf,s=this.minvf,l=this.maxvf,c=e.mode,h=e.ref,u=e.validator||{type:"list"},f=u.type,d=u.operator,m=u.value;t.val(c||"cell"),i.val(h),n.val(f),r.val(d),Array.isArray(m)?(s.val(m[0]),l.val(m[1])):(a.val(m||""),o.val(m||"")),this.criteriaSelected(f),this.criteriaOperatorSelected(d)}this.show()}}]),i}(Rr),zr=function(){function e(t,i){l()(this,e),this.el=f("input","".concat(ae,"-form-checkbox")).css("width",t).attr("type","Checkbox")}return r()(e,[{key:"hint",value:function(e){this.el.attr("placeholder",e)}},{key:"val",value:function(e){if(void 0===e)return this.el.el.checked;this.el.el.checked=e}}]),e}();function Br(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Hr=function(e){ee()(i,e);var t=Br(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("60px",""),{required:!0,pattern:/^([A-Z]{1,2}[1-9]\d*)(:[A-Z]{1,2}[1-9]\d*)?$/},"".concat(U("dataSort.ci"),":"),60),r=new Mr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(U("dataSort.sortby"),":"),60),a=new Mr(new Pr("desc",["asc","desc"],"100%",(function(e){return U("dataSort.order.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSort.criteria"),":"),60),o=new Mr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(U("dataSort.sortby"),":"),60),s=new Mr(new Pr("desc",["asc","desc"],"100%",(function(e){return U("dataSort.order.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSort.criteria"),":"),60),c=new Mr(new Pr(0,[],"180px",(function(){}),(function(){})),{required:!0},"".concat(U("dataSort.sortby"),":"),60),h=new Mr(new Pr("desc",["asc","desc"],"100%",(function(e){return U("dataSort.order.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSort.criteria"),":"),60);n.input.setReadonly(!0);var u=new zr("60px","");u.el.on("click",(function(){return e.myHeaderClick()})),u.val(!0);var d=new vi("del","formbt").on("click",(function(){return e.btnClick("del",1)})),m=f("div","".concat(ae,"-form-fields")).children(o.el,s.el,f("div","".concat(ae,"-buttons")).children(new vi("add","formbt").on("click",(function(){return e.btnClick("add",2)})),d)),g=f("div","".concat(ae,"-form-fields")).children(c.el,h.el,new vi("del","formbt").on("click",(function(){return e.btnClick("del",2)})));return(e=t.call(this,U("contextmenu.sort"),[f("div","".concat(ae,"-form-fields")).children(n.el,new Mr(u,{required:!1},"".concat(U("dataSort.header"),":"),120).el),f("div","".concat(ae,"-form-fields")).children(r.el,a.el,new vi("add","formbt").on("click",(function(){return e.btnClick("add",1)}))),m,g,f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})),new vi("cancel").on("click",(function(){return e.btnClick("cancel")})))])).cf=n,e.of1=a,e.sortby1=r,e.of2=s,e.sortby2=o,e.of3=h,e.sortby3=c,e.ci1=null,e.ci2=null,e.ci3=null,e.values=[],e.mcols=null,e.mcolsheader=null,e.cicount=1,e.div2=m,e.div3=g,e.but2=d,e.sc=1,e.myheader=u,m.hide(),g.hide(),e.change=function(){},e}return r()(i,[{key:"btnClick",value:function(e,t){if("ok"===e){if(!this.cf.validate())return;var i=[],n=[];if(i.push(this.of1.val()),n.push(this.sortby1.val()),this.sc>=2&&(i.push(this.of2.val()),n.push(this.sortby2.val())),this.sc>=3&&(i.push(this.of3.val()),n.push(this.sortby3.val())),new Set(n).size<n.length)return void le("error","".concat(U("dataSort.msg")));this.change("ok",n,i,this.myheader.val()),this.hide()}else"add"===e?1===t?(this.div2.css("display",""),this.sc=2):2===t&&(this.div3.css("display",""),this.but2.hide(),this.sc=3):"del"===e?1===t?(this.div2.hide(),this.sc=1):2===t&&(this.div3.hide(),this.but2.css("display",""),this.sc=2):"cancel"===e&&this.hide()}},{key:"myHeaderClick",value:function(){var e=this.mcols,t=this.mcolsheader,i=this.myheader,n=this.sortby1,r=this.sortby2,a=this.sortby3,o=i.val()?e:t;n.input.setItemsMap(o),n.val(0),r.input.setItemsMap(o),r.val(1),a.input.setItemsMap(o),a.val(2)}},{key:"setValue",value:function(e){if(null!=e){if(e){var t=this.cf,i=this.of1,n=this.sortby1,r=this.of2,a=this.sortby2,o=this.of3,s=this.sortby3,l=e.ref,c=e.sort,h=e.ci,u=e.m,f=e.mcols,d=e.mcolsheader,m=(c[0]||{order:"asc"}).order1,g=(c[1]||{order:"asc"}).order2,v=(c[2]||{order:"asc"}).order3;t.val(l),i.val(m),r.val(g),o.val(v),this.mcols=f,this.mcolsheader=d,this.myheader.val(1);for(var p=[],y=0;y<f.length;y++)p.push(y);n.input.setItemsMap(f),n.val(0),a.input.setItemsMap(f),a.val(1),s.input.setItemsMap(f),s.val(2),this.ci=h,this.values=u}this.show()}}}]),i}(Rr);function Nr(e){return f("div","".concat(ae,"-item ").concat(e))}function Ur(e){var t=this;return Nr("state").child(U("sort.".concat(e))).on("click.stop",(function(){return t.itemClick(e)}))}function Xr(e){var t=this,i=this.filterbEl,n=this.filterValues;i.html(""),Object.keys(e).forEach((function(r,a){var o=e[r],s=n.includes(r)?"checked":"";i.child(f("div","".concat(ae,"-item state ").concat(s)).on("click.stop",(function(){return t.filterClick(a,r)})).children(""===r?U("filter.empty"):r,f("div","label").html("(".concat(o,")"))))}))}function Wr(){var e=this.filterhEl,t=this.filterValues,i=this.values;e.html("".concat(t.length," / ").concat(i.length)),e.checked(t.length===i.length)}var qr=function(){function e(){var t=this;l()(this,e),this.filterbEl=f("div","".concat(ae,"-body")),this.filterhEl=f("div","".concat(ae,"-header state")).on("click.stop",(function(){return t.filterClick(0,"all")})),this.el=f("div","".concat(ae,"-sort-filter")).children(this.sortAscEl=Ur.call(this,"asc"),this.sortDescEl=Ur.call(this,"desc"),Nr("divider"),f("div","".concat(ae,"-filter")).children(this.filterhEl,this.filterbEl),f("div","".concat(ae,"-buttons")).children(new vi("cancel").on("click",(function(){return t.btnClick("cancel")})),new vi("ok","primary").on("click",(function(){return t.btnClick("ok")})))).hide(),this.ci=null,this.sortDesc=null,this.values=null,this.filterValues=[]}return r()(e,[{key:"btnClick",value:function(e){if("ok"===e){var t=this.ci,i=this.sort,n=this.filterValues;this.ok&&this.ok(t,i,"in",n)}this.hide()}},{key:"itemClick",value:function(e){this.sort=e;var t=this.sortAscEl,i=this.sortDescEl;t.checked("asc"===e),i.checked("desc"===e)}},{key:"filterClick",value:function(e,t){var i=this.filterbEl,n=this.filterValues,r=this.values,a=i.children();"all"===t?a.length===n.length?(this.filterValues=[],a.forEach((function(e){return f(e).checked(!1)}))):(this.filterValues=Array.from(r),a.forEach((function(e){return f(e).checked(!0)}))):f(a[e]).toggle("checked")?n.push(t):n.splice(n.findIndex((function(e){return e===t})),1);Wr.call(this)}},{key:"set",value:function(e,t,i,n){this.ci=e;var r=this.sortAscEl,a=this.sortDescEl;null!==n?(this.sort=n.order,r.checked(n.asc()),a.checked(n.desc())):(this.sortDesc=null,r.checked(!1),a.checked(!1)),this.values=Object.keys(t),this.filterValues=i?Array.from(i.value):Object.keys(t),Xr.call(this,t,i),Wr.call(this)}},{key:"setOffset",value:function(e){var t=this;this.el.offset(e).show();var i=1;Re(this.el,(function(){i<=0&&(t.hide(),i=5),i-=1}))}},{key:"setOffsetAdjustView",value:function(e,t,i){var n=this;this.el.show();var r=this.el.offset(),a=r.width,o=r.height;e.top+o>i&&(e.top=i-o),e.left+a>t&&(e.left=t-a),this.el.offset(e);var s=1;Re(this.el,(function(){s<=0&&(n.hide(),s=5),s-=1}))}},{key:"show",value:function(){this.el.show()}},{key:"hide",value:function(){this.el.hide(),Ee(this.el)}}]),e}(),Yr=function(){function e(){l()(this,e),xe()(this,"onEdit",!1),this.el=f("div","".concat(ae,"-comment-tip")).hide()}return r()(e,[{key:"hide",value:function(){this.el.hide()}},{key:"setPosition",value:function(e,t,i){if(!0!==this.onEdit){var n=this.el,r=i?t.left-t.width-1:t.left+t.width,a=t.top-10;n.css("left","".concat(r,"px")),n.css("top","".concat(a,"px")),n.html(e).show(),i&&n.css("left","".concat(r-n.el.offsetWidth,"px"))}}}]),e}();function Vr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Gr=function(e){ee()(i,e);var t=Vr(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("80px",""),{required:!0},"".concat(U("dataSearch.label"),":"),100),r=new Mr(new zr("80px",""),{required:!1},"".concat(U("dataSort.casesense"),":"),100),a=new Mr(new zr("30px",""),{required:!1},"".concat(U("dataSearch.matchwhole"),":"),150),o=new Mr(new Pr("values",["values","formulas","comments"],"120px",(function(e){return U("dataSearch.lookin.".concat(e))}),(function(){})),{required:!0},"".concat(U("dataSearch.lkinlb"),":"),100);return(e=t.call(this,U("toolbar.search"),[f("div","".concat(ae,"-form-fields")).children(r.el,a.el),f("div","".concat(ae,"-form-fields")).child(n.el),f("div","".concat(ae,"-form-fields")).child(o.el),f("div","".concat(ae,"-buttons")).children(new vi("previous").on("click",(function(){return e.btnClick("previous")})),new vi("next").on("click",(function(){return e.btnClick("next")})),new vi("close","primary").on("click",(function(){return e.btnClick("close")})))],"500px",!1,!0)).formField=n,e.casesense=r,e.lookin=o,e.matchwhole=a,e.change=function(){},e}return r()(i,[{key:"btnClick",value:function(e){if("close"!==e){if(!this.formField.validate())return;var t=this.casesense.val(),i=this.lookin.val(),n=this.matchwhole.val(),r=this.formField.val().trim();switch(e){case"previous":this.change("previous",r,t,i,n);break;case"next":this.change("next",r,t,i,n)}}else this.hide()}},{key:"show",value:function(){Ii()(re()(i.prototype),"show",this).call(this),this.formField.input.focus()}}]),i}(Rr),Zr=function(){function e(t,i){var n=this;l()(this,e),this.data=t,this.mode=i,this.ishtml=!1,this.inputChange=function(){},this.enter=function(){},this.tab=function(){},this.focuson=function(){},this.el=f("div","".concat(ae,"-formula-bar")),this.barLabel=f("div","".concat(ae,"-bar-label")),this.formulaInput=f("div","".concat(ae,"-formula-input")).on("input",(function(e){n.inputChange(n.ishtml?e.target.innerHTML:e.target.innerText)})).on("focus",(function(e){n.focuson()})).on("keydown",(function(e){var t=e.keyCode||e.which;13===t?(e.altKey||n.formulaInput.el.blur(),n.enter(e,n.ishtml)):9===t&&(n.formulaInput.el.blur(),n.tab(e))})),"read"===this.mode?this.formulaInput.attr("disabled","disabled"):this.formulaInput.attr("contenteditable","true"),this.el.children(this.barLabel,this.formulaInput),this.reset()}return r()(e,[{key:"resetData",value:function(e){this.data=e,this.reset()}},{key:"reset",value:function(){var e=this.data,t=e.selector,i=v(t.ci)+""+(t.ri+1),n=e.getSelectedCell(),r="",a=!1;n&&(n.html?(r=n.html,this.ishtml=!0):(this.ishtml=!1,n.f?r=n.f:n.ufv?r=n.ufv:n.text&&(r=n.text,a=!0))),this.barLabel.html(i),this.formulaInput.html(r,!this.ishtml,a)}}]),e}();function Kr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Jr=function(e){ee()(i,e);var t=Kr(i);function i(){var e;return l()(this,i),e=t.call(this),xe()(qn()(e),"col",void 0),xe()(qn()(e),"row",void 0),e.el.attr("contentEditable","true"),e.el.attr("placeholder","".concat(U("toolbar.commentDefault"))),e.el.attr("id","commentEdit"),e}return r()(i,[{key:"saveAndHide",value:function(e){var t=this;if(void 0!==this.col&&void 0!==this.row){if(""!==this.el.html()){for(var i=-1,n=0;n<e.data.comments.length;n++)if(e.data.comments[n].col===this.col&&e.data.comments[n].row===this.row){i=n;break}-1===i?e.data.comments.push({col:this.col,row:this.row,author:"Aspose",note:this.el.html()}):e.data.comments[i].note=this.el.html()}e.data.comments=e.data.comments.filter((function(e){return!t.checkEmptyContent(e.note)})),this.hide(),e.commentTip.onEdit=!1,this.col=void 0,this.row=void 0}}},{key:"checkEmptyContent",value:function(e){var t=document.createElement("div");return t.innerHTML=e,""===t.innerText}},{key:"setPosition",value:function(e,t,n){Ii()(re()(i.prototype),"setPosition",this).call(this,e,t,n),this.el.focus()}}]),i}(Yr),$r=i(10),Qr=function(){function e(){l()(this,e),xe()(this,"name",void 0)}return r()(e,[{key:"execute",value:function(e){}}]),e}();function ea(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}function ta(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ia(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ta(Object(i),!0).forEach((function(t){xe()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ta(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function na(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}function ra(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function aa(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(i),!0).forEach((function(t){xe()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ra(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function oa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var sa=[function(e){ee()(i,e);var t=ea(i);function i(){var e;l()(this,i);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),xe()(qn()(e),"name","delete"),e}return r()(i,[{key:"execute",value:function(e){var t=e.canvas,i=e.data,n=t.fabric,r=n.getActiveObject(),a=t.findObjByData(r.id,i);if(a)if(a.op="del",i.canvasFreeze){var o=i.canvasFreeze;[o.br,o.bl,o.tr,o.tl].forEach((function(e){e.remove(t.findObjInCanvas(e,r.id)),t.saveCanvasData(i,e),e.renderAll()}))}else n.remove(r),n.renderAll(),t.saveCanvasData(i,n)}}]),i}(Qr),function(e){ee()(a,e);var t,i,n=na(a);function a(){var e;l()(this,a);for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return e=n.call.apply(n,[this].concat(i)),xe()(qn()(e),"name","paste"),xe()(qn()(e),"canvas",void 0),xe()(qn()(e),"sheet",void 0),xe()(qn()(e),"inFreeze",void 0),e}return r()(a,[{key:"execute",value:(i=be()(Ce.a.mark((function e(t){var i,n,r,a,o;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.canvas.clipboard,this.canvas=null!==(i=this.canvas)&&void 0!==i?i:t.canvas.fabric,this.sheet=null!==(n=this.sheet)&&void 0!==n?n:t,this.inFreeze=null!==(r=this.inFreeze)&&void 0!==r?r:t.canvas.inFreeze,o=this,a){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,a.clonedObj.clone(function(){var e=be()(Ce.a.mark((function e(i){var n;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=fabric.util.object.clone(i),o.setImagePosition(n),t.canvas.setLoading(t,{left:n.left,top:n.top}),e.next=6,o.addImageToData(n);case 6:o.setImageEventAndLayout(n),o.addImageToCanvas(n)?o.reactiveObj(n):o.rollback(o.sheet,n),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0),le(e.t0);case 14:return e.prev=14,t.canvas.removeLoading(t),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[0,10,14,17]])})));return function(t){return e.apply(this,arguments)}}(),["id","tick","imgType","zorder","strid"]);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"rollback",value:function(e,t){var i=e.data,n=e.canvas;n.fabric.remove(n.fabric.getObjects()[n.fabric.getObjects().findIndex((function(e){return e.id===t.id}))]),n.saveCanvasData(e.data,n.fabric),n.inFreeze&&(n.inFreeze.removeImage(t.id),n.removeImageInData(i,t.id))}},{key:"uploadImg",value:function(e,t){var i=e.canvas,n=new FormData;n.append("uid",e.uniqueid);var r={ri:e.data.selector.ri,ci:e.data.selector.ci,name:e.data.name};n.append("p",JSON.stringify(r)),n.append("image",t);var a=e.data.getSelectedRect();i.setLoading(e,{top:a.top,left:a.left}),$.ajax({url:e.imageUploadByLocalUrl,type:"post",processData:!1,contentType:!1,data:n,success:function(t,n,r){(t=JSON.parse(t)).Error?le("error",t.Error):i.doInsertImage(t,e)}})}},{key:"setImagePosition",value:function(e){var t=this.sheet.data,i=this.sheet.getTableOffset(),n=0,r=0;if(!e)throw"no cloneObj";if(!this.canvas)throw"no canvas";if(!this.sheet)throw"no sheet data";if(this.canvas.getActiveObject()){var a=this.canvas.getActiveObject();n=a.left+20,r=a.top+20}else{var o=t.getSelectedRect();if(!o)throw"get selected rect value is null";n=o.left+i.left,r=o.top+i.top}e.set({left:n,top:r,evented:!0}),this.sheet.canvas.edgeCollision(e)}},{key:"addImageToCanvas",value:function(e){var t=this,i=this.canvas,n=this.sheet.data;if(n.name!==this.sheet.canvas.clipboard.sheetName)return!1;if(n.canvasFreeze){var r=n.canvasFreeze;[r.br,r.bl,r.tr,r.tl].forEach((function(i){var n=fabric.util.object.clone(e),r=t.inFreeze.getOffsetWhenIndividualCanvasMovement(i.canvasName);n.set({top:n.top+r.y,left:n.left+r.x}),i.add(n),n.setCoords()}))}else e.setCoords(),i.add(e);return!0}},{key:"addImageToData",value:(t=be()(Ce.a.mark((function e(t){var i,n,r,a,o,s,l,c,h,u;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.sheet,n=this.sheet.canvas.data,r=i.canvas.clipboard.newData,a=ia({},r),o=this.sheet.getTableOffset(),s="Picture"!==a.type,l={ri:n.selector.ri,ci:n.selector.ci,name:n.name,srcid:a.id,srcname:i.canvas.clipboard.sheetName,isshape:s},(c=new FormData).set("p",JSON.stringify(l)),c.set("uid",i.uniqueid),e.next=12,fetch(i.imageCopyUrl,{method:"POST",body:c});case 12:if((h=e.sent).ok){e.next=15;break}throw"upload copy image fail";case 15:return e.next=17,h.json();case 17:if(u=e.sent,u=JSON.parse(u)){e.next=21;break}throw"upload copy image return null ";case 21:if(!u.Error){e.next=23;break}throw u.Error;case 23:delete u.width,delete u.height,n.images||(n.images=[]),Object.assign(a,u),a.left=t-o.left,a.top=t-o.top,s?n.shapes.push(a):n.images.push(a),delete u.type,Object.assign(t,u),a.fabobj=t,t.imgType=a.type,t.id=a.getIdtick(u.id,u.tick),t.strid=u.strid,t.zorder=i.data.topOrder++,ba(t,a),t.changed=!0;case 39:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setImageEventAndLayout",value:function(e){"Chart"===e.imgType&&e.setControlsVisibility({mtr:!1}),this.sheet.canvas.setSelectionLayout(e),this.sheet.canvas.eventsOn(e,this.sheet.canvas.imgEvents)}},{key:"reactiveObj",value:function(e){var t=this.canvas,i=this.sheet,n=i.data;if(n.canvasFreeze){var r=n.canvasFreeze,a=r.br,o=r.bl,s=r.tr,l=r.tl;[a,o,s,l].forEach((function(t){t.discardActiveObject(),t.setActiveObject(t.getObjects().find((function(t){return t.id===e.id}))),t.requestRenderAll(),i.canvas.saveCanvasData(n,t),i.canvas.saveOriginalAngleInfoOfImage(l)}))}else t.discardActiveObject(),t.setActiveObject(e),t.requestRenderAll(),i.canvas.saveCanvasData(n,t),i.canvas.saveOriginalAngleInfoOfImage(t)}}]),a}(Qr),function(e){ee()(i,e);var t=oa(i);function i(){var e;l()(this,i);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e=t.call.apply(t,[this].concat(r)),xe()(qn()(e),"name","copy"),e}return r()(i,[{key:"execute",value:function(e){var t=e.canvas.fabric;if(t.getActiveObject()){var i=t;e.data.canvasFreeze&&(i=e.data.canvasFreeze.tl),i.getActiveObject().clone((function(t){e.canvas.clipboard={clonedObj:t,newData:aa({},e.canvas.findObjByData(t.id,e.data)),sheetName:e.data.name}}),["id","tick","imgType","zorder","strid"])}}}]),i}(Qr)],la=function(){function e(t){var i=this;l()(this,e),xe()(this,"freezeXY",void 0),xe()(this,"imageCanvas",void 0),xe()(this,"freezeEvents",{"object:rotating":function(e){return function(t){i.imageCanvas.pubSub.publish("object:rotating",t,e)}},"object:moving":function(e){return function(t){i.imageCanvas.pubSub.publish("object:moving",t,e)}},"object:scaling":function(e){return function(t){i.imageCanvas.pubSub.publish("object:scaling",t,e)}},"selection:created":function(e){return function(t){i.imageCanvas.pubSub.publish("selection:created",t,e)}},"selection:cleared":function(e){return function(t){i.imageCanvas.pubSub.publish("selection:cleared",t,e)}},"selection:updated":function(e){return function(t){i.imageCanvas.pubSub.publish("selection:updated",t,e)}}}),this.imageCanvas=t;var n=t.sheet.getTableOffset(),r=t.sheet.data,a=t.sheet;if(!r.displayRight2Left){var o=r.freezeTotalWidth()+n.left/a.table.zoomlevel,s=r.freezeTotalHeight()+n.top/a.table.zoomlevel;if(this.freezeXY={},this.freezeXY.x=o,this.freezeXY.y=s,JSON.stringify(r.freeze)!==JSON.stringify([0,0])&&!r.canvasFreeze){t.pubSub=t.initPubSub();var c=t.fabric;c.off("object:moving",t.canvasEvents["object:moving"]),c.set("canvasName","br");var h=this.createCanvas(a.overlayerEl,"bl",o,c.height,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),u=this.createCanvas(a.overlayerEl,"tr",c.width,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"]))),f=this.createCanvas(a.overlayerEl,"tl",o,s,JSON.stringify(c.toDatalessJSON(["id","tick","imgType","zorder","strid"])));this.setEventAndClipPath(c,u,h,f);for(var d=0;d<document.getElementsByClassName("canvas-container").length;d++)document.getElementsByClassName("canvas-container")[d].setAttribute("style","position:absolute");r.originFreezeSize={tl:{width:f.width,height:f.height},bl:{width:h.width,height:h.height},tr:{width:u.width,height:u.height},br:{width:c.width,height:c.height}},r.canvasFreeze={tl:f,bl:h,tr:u,br:c},this.setZoom(this.imageCanvas.sheet.table.zoomlevel)}}}return r()(e,[{key:"getFreezeCanvasClipPath",value:function(e,t,i){var n=this.freezeXY,r=this.imageCanvas.sheet,a=this.imageCanvas.tOffset;a.left/=r.data.zoomlevel,a.top/=r.data.zoomlevel;var o=new $r.fabric.Rect({width:n.x,height:t.height-n.y,top:n.y,left:a.left}),s=new $r.fabric.Rect({width:n.x,height:n.y,left:a.left,top:a.top}),l=new $r.fabric.Rect({width:e.width-n.x,height:n.y,left:n.x,top:a.top}),c=new $r.fabric.Rect({width:i.width-n.x,height:i.height-n.y,left:n.x,top:n.y});return function(e){var t;switch(e){case"tr":t=l;break;case"bl":t=o;break;case"tl":t=s;break;default:t=c}return t}}},{key:"getOffsetsBetweenCanvases",value:function(e,t){var i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,a=-n.y,o={offsetX:0,offsetY:0};switch(e+t){case"tlbl":case"trbr":o={offsetX:0,offsetY:-a};break;case"bltl":case"brtr":o={offsetX:0,offsetY:a};break;case"tltr":case"blbr":o={offsetX:-r,offsetY:0};break;case"brbl":case"trtl":o={offsetX:r,offsetY:0};break;case"trbl":o={offsetX:r,offsetY:-a};break;case"tlbr":o={offsetX:-r,offsetY:-a};break;case"bltr":o={offsetX:-r,offsetY:a};break;case"brtl":o={offsetX:r,offsetY:a}}return o}},{key:"setIndividualCanvasesToMoveInSync",value:function(e,t,i,n){var r=this.imageCanvas.findObjInCanvas(e,t.target.id);if(r){var a=this.getOffsetsBetweenCanvases(n,e.canvasName);r.set({left:t.target.left-a.offsetX,top:t.target.top-a.offsetY}),r.set(i),this.imageCanvas.edgeCollision(r,e.canvasName),r.dirty=!0,e.renderAll()}}},{key:"setEventAndClipPath",value:function(e,t,i,n){var r=this;[e,t,i,n].forEach((function(e){var t=Object.keys(r.freezeEvents).map((function(t){return[t,r.freezeEvents[t](e.canvasName)]}));t=Object.fromEntries(t),r.imageCanvas.eventsOn(e,t)}));var a=this.getFreezeCanvasClipPath(t,i,e);this.freezeClipPath=a,[e,t,i,n].forEach((function(e){e.clipPath=a(e.canvasName),r.subscribeObjectEvent(e),r.subscribeSelectionEvent(e),r.subscribeCustomEvent(e,a)}))}},{key:"updateCanvasAllObjectAndRenderAll",value:function(e,t){e.getObjects().forEach(t),e.renderAll()}},{key:"subscribeObjectEvent",value:function(e){var t=this;this.imageCanvas.pubSub.subscribe("object:rotating",(function(i,n){var r={angle:i.target.angle};t.setIndividualCanvasesToMoveInSync(e,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:moving",(function(i,n){var r=n===e.canvasName?{left:i.target.left,top:i.target.top}:{};t.setIndividualCanvasesToMoveInSync(e,i,r,n)})),this.imageCanvas.pubSub.subscribe("object:scaling",(function(i,n){var r={scaleX:i.target.scaleX,scaleY:i.target.scaleY};t.setIndividualCanvasesToMoveInSync(e,i,r,n)}))}},{key:"getOffsetWhenIndividualCanvasMovement",value:function(e){var t,i=this.imageCanvas.data,n=i.scroll,r=i.displayRight2Left?n.x:-n.x,a=-n.y;switch(e){case"tr":t={x:r,y:0};break;case"bl":t={x:0,y:a};break;case"br":t={x:r,y:a};break;default:t={x:0,y:0}}return t}},{key:"subscribeCustomEvent",value:function(e,t){var i=this;this.imageCanvas.pubSub.subscribe("reset",(function(){var t=i.getOffsetWhenIndividualCanvasMovement(e.canvasName);i.updateCanvasAllObjectAndRenderAll(e,(function(e){e.set({left:e.left-t.x,top:e.top-t.y}),e.setCoords(),e.dirty=!0}))})),this.imageCanvas.pubSub.subscribe("object:scroll",(function(t){var n=i.imageCanvas.data.canvasData,r=i.getOffsetWhenIndividualCanvasMovement(e.canvasName);if(n){var a=JSON.parse(n);e.getObjects().forEach((function(e){var t=a.objects.find((function(t){return t.id===e.id}));e.set({left:t.left+r.x,top:t.top+r.y}),e.setCoords()})),e.renderAll()}}))}},{key:"clearFreeze",value:function(e){if(e.canvasFreeze){this.imageCanvas.eventsOff(this.imageCanvas.fabric,this.freezeEvents);var t=e.canvasFreeze.tr,i=e.canvasFreeze.tl,n=e.canvasFreeze.bl;t.dispose(),i.dispose(),n.dispose(),document.getElementById("tr").remove(),document.getElementById("tl").remove(),document.getElementById("bl").remove();var r={width:this.imageCanvas.fabric.width,height:this.imageCanvas.fabric.height,top:this.imageCanvas.tOffset.top/this.imageCanvas.sheet.table.zoomlevel,left:this.imageCanvas.tOffset.left/this.imageCanvas.sheet.table.zoomlevel};this.imageCanvas.fabric.clipPath=new $r.fabric.Rect(r),this.imageCanvas.eventsOn(this.imageCanvas.fabric,this.imageCanvas.canvasEvents),this.imageCanvas.pubSub=this.imageCanvas.initPubSub(),this.imageCanvas.pubSub.subscribe("object:scroll",this.imageCanvas.customEvents["object:scroll"]),this.imageCanvas.fabric.renderAll(),e.canvasFreeze=void 0}}},{key:"setZoom",value:function(e){var t=this.imageCanvas,i=t.data,n=(t.fabric,t.tOffset,i.originFreezeSize);this.foreachFreezeCanvas((function(t){t.setZoom(e),t.renderAll()})),this.foreachFreezeCanvas((function(t){t.setWidth(n[t.canvasName].width*e),t.setHeight(n[t.canvasName].height*e)}),"br")}},{key:"resize",value:function(){var e=this.imageCanvas,t=e.data,i=(e.fabric,t.canvasFreeze),n=(i.tl,i.bl),r=i.tr,a=i.br,o=this.getFreezeCanvasClipPath(r,n,a);this.foreachFreezeCanvas((function(e){e.clipPath=o(e.canvasName),e.renderAll()}))}},{key:"subscribeSelectionEvent",value:function(e){var t=this;this.imageCanvas.pubSub.subscribe("selection:created",(function(i,n){if(n!==e.canvasName){t.imageCanvas.checkHyperlink(t.imageCanvas.data.canvasFreeze.br)&&!i.e.ctrlKey&&t.imageCanvas.openLink(t.imageCanvas.data);var r=t.imageCanvas.findObjInCanvas(e,i.target.id);e._setActiveObject(r),e.renderAll()}})),this.imageCanvas.pubSub.subscribe("selection:cleared",(function(t,i){i!==e.canvasName&&(e._discardActiveObject(),e.renderAll())})),this.imageCanvas.pubSub.subscribe("selection:updated",(function(i,n){var r;if(n!==e.canvasName){var a=t.imageCanvas.findObjInCanvas(e,i.target.id);(null===(r=e.getActiveObject())||void 0===r?void 0:r.id)!==a.id&&(e._setActiveObject(a),e.renderAll())}}))}},{key:"setObjectOrderAndChangedInAllCanvas",value:function(e,t){var i=this;++e.topOrder,Object.keys(e.canvasFreeze).forEach((function(n){var r=i.imageCanvas.findObjInCanvas(e.canvasFreeze[n],t.id);r&&(r.changed=!0,i.imageCanvas.sendImageToFont(e.canvasFreeze[n],r),t.zorder=r.zorder=e.topOrder,"TextBox"===t.imgType&&n!==t.canvas.canvasName&&(r.width=t.width,r.height=t.height,r.scaleX=1,r.scaleY=1),e.canvasFreeze[n].renderAll())}))}},{key:"setOrderAndSaveData",value:function(e){var t=this.imageCanvas.data;this.setObjectOrderAndChangedInAllCanvas(t,e),this.imageCanvas.saveOriginalAngleInfoOfImage(t.canvasFreeze.br),this.imageCanvas.saveCanvasData(t,t.canvasFreeze.br)}},{key:"loadFreezeImage",value:function(){var e=this.imageCanvas.data;if(e.canvasFreeze){var t=e.canvasFreeze,i=t.tl,n=t.bl,r=t.tr;this.imageCanvas.rerenderCanvasBySavedJson(n,{x:0,y:0},n.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(r,{x:0,y:0},r.clipPath),this.imageCanvas.rerenderCanvasBySavedJson(i,{x:0,y:0},i.clipPath)}}},{key:"createCanvas",value:function(e,t,i,n,r){var a=document.createElement("canvas");a.width=i,a.height=n,a.setAttribute("id",t),e.children(a),window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1);var o=new $r.fabric.Canvas(t);return o.selection=!1,o.set("canvasName",t),this.imageCanvas.eventsOn(o,this.imageCanvas.canvasEvents),o}},{key:"removeImage",value:function(e){this.foreachFreezeCanvas((function(t){t.remove(t.getObjects()[t.getObjects().findIndex((function(t){return t.id===e}))])}),"br")}},{key:"setDirty",value:function(e){this.foreachFreezeCanvas((function(t){t.getObjects().find((function(t){return t.id===e})).dirty=!0,t.requestRenderAll()}))}},{key:"setVisible",value:function(e,t){this.foreachFreezeCanvas((function(i){var n=i.getObjects().find((function(t){return t.id===e}));n&&(n.visible=t)}))}},{key:"setControlable",value:function(e,t){this.foreachFreezeCanvas((function(i){var n=i.getObjects().find((function(t){return t.id===e}));n&&(n.selectable=t,n.hoverCursor=t?"move":"pointer",t&&i.setActiveObject(n))}))}},{key:"setFilter",value:function(e,t){this.foreachFreezeCanvas((function(i){var n=i.getObjects().find((function(t){return t.id===e}));n.filters[0]=t,n.applyFilters()}))}},{key:"setCustomHighlight",value:function(e,t,i){this.foreachFreezeCanvas((function(n){var r=n.getObjects().find((function(t){return t.id===e}));i(t,r)}))}},{key:"setOrder",value:function(){this.foreachFreezeCanvas((function(e){null!=e&&e.getObjects().find((function(e){return!e.zorder}))||e.getObjects().sort((function(e,t){return e.zorder<t.zorder?-1:1})).forEach((function(t){e.bringToFront(t)}))}))}},{key:"saveCanvasData",value:function(){var e=this,t=this.imageCanvas.data;this.foreachFreezeCanvas((function(i){e.imageCanvas.saveCanvasData(t,i)}))}},{key:"setCursor",value:function(e){this.foreachFreezeCanvas((function(t){t.defaultCursor=e}))}},{key:"renderAll",value:function(){this.foreachFreezeCanvas((function(e){e.renderAll()}))}},{key:"foreachFreezeCanvas",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var r=this.imageCanvas.data;if(r.canvasFreeze){var a=r.canvasFreeze,o=a.tl,s=a.bl,l=a.tr,c=a.br;[o,s,l,c].forEach((function(t){i.includes(t.canvasName)||e(t)}))}}}]),e}();function ca(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ha=function(){function e(){l()(this,e),this.subscribers=[]}return r()(e,[{key:"subscribe",value:function(e,t){var i=this.subscribers[e];i?i.push(t):this.subscribers[e]=[t]}},{key:"publish",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var r=this.subscribers[e]||[];r.forEach((function(e){return e.apply(void 0,i)}))}}]),e}(),ua=function(e,t){return"p_".concat(e,"_").concat(t)},fa=function(e,t){return"s_".concat(e,"_").concat(t)},da=function(e){var t;this.visible=e,this.fabobj.visible=e;var i=this.getIdtick();null===(t=this.inFreeze)||void 0===t||t.setVisible(i,e),this.setDirty()},ma=function(){var e;this.fabobj.set("dirty",!0),this.fabobj.canvas.requestRenderAll();var t=this.getIdtick();null===(e=this.inFreeze)||void 0===e||e.setDirty(t)},ga=function(e){var t;this.fabobj.selectable=e,this.fabobj.hoverCursor=e?"move":"pointer",this.fabobj.canvas.requestRenderAll(),e&&this.fabobj.canvas.setActiveObject(this.fabobj);var i=this.getIdtick();null===(t=this.inFreeze)||void 0===t||t.setControlable(i,e)},va=function(e){var t;this.fabobj.filters[0]=e,this.fabobj.applyFilters();var i=this.getIdtick();null===(t=this.inFreeze)||void 0===t||t.setFilter(i,e)},pa=function(e,t){var i;t(e,this.fabobj);var n=this.getIdtick();null===(i=this.inFreeze)||void 0===i||i.setCustomHighlight(n,e,t)},ya=function(){return"Picture"===this.type?ua(this.id,this.tick):fa(this.id,this.tick)},ba=function(e,t){"TextBox"===e.imgType&&(e.shape=t,e.drawObject=xa,e.on("modified",ka))},wa=function(e,t){var i=this.width,n=this.height,r=this.shape;e.save(),e.translate(-i/2,-n/2);var a=new Dt(0,0,i,n,10);a.setPading(r.lp,r.rp);var o=new Bt(e,i,n),s=1/Ot();o.scale(s,s),o.scale(s,s),o.rect3(a,r),e.restore()},xa=function(e,t){var i=this.width,n=this.height,r=this.shape;e.save(),e.translate(-i/2,-n/2);var a=new Dt(0,0,i,n,10);a.setPading(r.lp,r.rp);var o=new Bt(e,i,n),s=1/Ot();o.scale(s,s),o.scale(s,s),o.rect3(a,r),r.ishideText||o.richtext(r,a,r.align,r.valign,r.wrap,r.getHighlight()),e.restore()},ka=function(e){var t=this.getScaledWidth(),i=this.getScaledHeight();this.scaleX=1,this.scaleY=1,this.width=t,this.height=i,this.shape.originWidth=t,this.shape.originHeight=i,this.shape.setDirty()};function Ca(e,t,i){e.canvas;i.style.left=t.left-i.offsetWidth/2+"px",i.style.top=t.top-i.offsetHeight/2+"px"}function _a(e,t,i,n){var r=e.canvas,a=new $r.fabric.Rect;return i.width?i.fromOutside&&(delete i.width,delete i.height):(a.width=i.width,a.height=i.height),r.setSelectionLayout(a),r.eventsOn(a,r.imgEvents),r.eventsOn(r,n.canvasEvents),r.fabric.add(a),r.rotateObject(a,i.rotate),t.fabobj=a,a.shape=t,t.inFreeze=n.inFreeze,t.setVisible=da,t.setDirty=ma,t.setFilter=va,t.setControlable=ga,t.getIdtick=ya,i.id||(i.id=t.getIdtick()),a.set(i),a.selectable=!1,a.hoverCursor="pointer",a}var Sa=function(e){ee()(i,e);var t=ca(i);function i(){var e;return l()(this,i),e=t.call(this,"canvas"),xe()(qn()(e),"imgEvents",{mouseup:function(t){var i=qn()(e).sheet,n=i.data,r=t.target;if(!window.mobileAndTabletCheck()){var a=r.canvas;a||(a=e.fabric),n.canvasFreeze?e.inFreeze.setOrderAndSaveData(r):(r.changed=!0,e.sendImageToFont(a,r),r.zorder=++n.topOrder,e.findObjInCanvas(a,r.id).zorder=r.zorder,e.saveOriginalAngleInfoOfImage(a),e.saveCanvasData(n,a)),i.selector.setObjId(r.id);var o=i.selector.getObj();o&&(i.trigger("object-selected",o),2===t.e.button&&"edit"===i.data.settings.mode&&(o.setControlable(!0),i.contextMenu.setPosition(t.e.offsetX,t.e.offsetY)))}},mousedown:function(t){window.mobileAndTabletCheck()||(e.sheet.selector.hide(),e.sheet.editor.clear(),e.sheet.focusing=!1,null==t||t.e.stopPropagation())},mousedblclick:function(t){if(!window.mobileAndTabletCheck()){var i=t.target,n=qn()(e).sheet;if("OleObject"===i.imgType)n.getOle(i.strid);else if("TextBox"===i.imgType){var r=e.findShape(i.id,n.data);n.setEditForTextBox(r),e.fabric.discardActiveObject().requestRenderAll()}}},mousemove:function(t){e.findObjByData(t.target.id,e.sheet.data).hyperlink?e.fabric.hoverCursor="pointer":e.fabric.hoverCursor="move"}}),xe()(qn()(e),"pausePanning",!1),xe()(qn()(e),"canvasEvents",{"mouse:move:before":function(){e.sheet.data.canvasFreeze&&e.sheet.data.canvasFreeze.tl.getObjects().length!==e.sheet.data.canvasFreeze.br.getObjects().length&&e.inFreeze.loadFreezeImage()},"object:moving":function(t){e.edgeCollision(t.target,"canvas")},"selection:created":function(t){e.checkHyperlink(e.fabric)&&!t.e.ctrlKey&&e.openLink(e.data)}}),xe()(qn()(e),"customEvents",{"object:scroll":function(){var t=e.data,i=t.scroll,n=t.displayRight2Left,r=t.canvasData,a=n?i.x:-i.x,o=-i.y;if(r){var s=JSON.parse(r);e.fabric.getObjects().forEach((function(e){var t=s.objects.find((function(t){return t.id===e.id}));e.set({left:t.left+a,top:t.top+o}),e.setCoords()})),e.fabric.renderAll()}}}),xe()(qn()(e),"tOffset",void 0),xe()(qn()(e),"data",void 0),xe()(qn()(e),"fabric",void 0),xe()(qn()(e),"freeze",void 0),xe()(qn()(e),"freezeXY",{x:0,y:0}),xe()(qn()(e),"pubSub",void 0),xe()(qn()(e),"sheet",void 0),xe()(qn()(e),"basicZorder",void 0),xe()(qn()(e),"canvasId","canvas_".concat((new Date).getTime())),xe()(qn()(e),"imageOperationList",{}),e.attr("id",e.canvasId),e.pubSub=e.initPubSub(),sa.forEach((function(t){var i=new t;e.imageOperationList[i.name]=i})),Te(window,"resize",(function(t){window.mobileAndTabletCheck()||e.resize(t)})),e}return r()(i,[{key:"publishEvent",value:function(e,t){this.pubSub.publish(e,t)}},{key:"initPubSub",value:function(){return new ha}},{key:"setCursor",value:function(e){this.sheet.data.canvasFreeze?this.inFreeze.setCursor(e):this.fabric.defaultCursor=e}},{key:"doNewSheetPage",value:function(e){this.fabric.clear(),this.inFreeze&&this.inFreeze.clearFreeze(e)}},{key:"doSwitchSheetPage",value:function(e){var t=this;this.sheet.selector.el.show();setTimeout((function e(){var i,n,r,a;t.sheet.canvas.fabric.getObjects().length===(null!==(i=null===(n=t.sheet.data.images)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+(null!==(r=null===(a=t.sheet.data.shapes)||void 0===a?void 0:a.length)&&void 0!==r?r:0)?t.doEndSwitchSheetPage():setTimeout(e,200)}),200);this.inFreeze&&this.inFreeze.clearFreeze(e)}},{key:"doEndSwitchSheetPage",value:function(){var e;this.setOrder(this.fabric),null===(e=this.sheet.canvas.inFreeze)||void 0===e||e.setOrder()}},{key:"initFreeze",value:function(){this.inFreeze=new la(this)}},{key:"rerenderCanvasBySavedJson",value:function(e,t,i){var n=this;if(this.data.canvasData&&this.fabric){this.initFreeze();var r=JSON.parse(this.data.canvasData);delete r.clipPath,this.loadFromCanvasData(JSON.stringify(r),(function(r,a){a.set({left:r.left+t.x,top:r.top+t.y}),"Chart"===a.imgType&&a.setControlsVisibility({mtr:!1}),n.setSelectionLayout(a),n.eventsOn(a,n.imgEvents);var o=n.findObjByData(r.id,n.data);o&&(ba(a,o),e.clipPath=i)}),e)}}},{key:"findObjInCanvas",value:function(e,t){return e.getObjects().find((function(e){return e.id===t}))}},{key:"recordCanvasData",value:function(e,t){var i,n,r=e.aCoords,a=this.tOffset,o=this.findObjByData(e.id,t);if(o){var s=r.tl.x+(r.tr.x-r.tl.x)/2-a.left,l=r.tl.y+(r.bl.y-r.tl.y)/2-a.top;o.centerX||(o.centerX=s),o.centerY||(o.centerY=l),o.currentCenterX=s,o.currentCenterY=l;var c=t.getCellRectByXY(r.tl.x,r.tl.y);o.width=o.originWidth*e.scaleX,o.height=o.originHeight*e.scaleY,o.scaleX=e.scaleX,o.scaleY=e.scaleY,o.top=e.top-a.top/t.zoomlevel+t.scroll.y,o.left=e.left-a.left/t.zoomlevel+t.scroll.x,o.row=null==c?void 0:c.ri,o.col=null==c?void 0:c.ci,o.changed=null!==(i=e.changed)&&void 0!==i&&i,o.zorder=null!==(n=e.zorder)&&void 0!==n?n:t.topOrder}}},{key:"edgeCollision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"canvas",i=this.data,n=this.tOffset,r=n.top/i.zoomlevel,a=n.left/i.zoomlevel;0!==i.scroll.y&&["br","bl"].includes(t)&&(r-=i.scroll.y),0!==i.scroll.x&&["br","tr"].includes(t)&&(a-=i.scroll.x),e.setCoords();var o=e.getBoundingRect().top/i.zoomlevel,s=e.getBoundingRect().left/i.zoomlevel;(o<r||s<a)&&(e.top=Math.max(e.top,e.top-o+r),e.left=Math.max(e.left,e.left-s+a))}},{key:"init",value:function(e){var t=this;this.tOffset=e.getTableOffset();var i=this.tOffset;this.attr("width",i.width+i.left),this.attr("height",i.height+i.top),this.sheet=e,window.mobileAndTabletCheck()&&($r.fabric.Object.prototype.selectable=!1),this.fabric=new $r.fabric.Canvas(this.canvasId),this.fabric.fireRightClick=!0,this.clipPath({width:this.fabric.width,height:this.fabric.height,top:this.tOffset.top/e.data.zoomlevel,left:this.tOffset.left/e.data.zoomlevel});var n=0,r=setInterval((function(){(e.data.isImageOk||50===n)&&(t.onSheetImageLoaded(),clearInterval(r)),n++}),200);this.eventsOn(this.fabric,this.canvasEvents),this.fabric.selection=!1,window.mobileAndTabletCheck()&&this.fabric.removeListeners(),this.pubSub.subscribe("object:scroll",this.customEvents["object:scroll"])}},{key:"onSheetImageLoaded",value:function(){var e;this.setOrder(this.sheet.canvas.fabric),null===(e=this.sheet.canvas.inFreeze)||void 0===e||e.setOrder()}},{key:"resetFreeze",value:function(e){var t=o()(e.freeze,2),i=t[0],n=t[1];0===i&&0===n?this.inFreeze&&this.inFreeze.clearFreeze(e):this.initFreeze()}},{key:"reset",value:function(e){this.data=e,this.fabric.clear(),this.initFreeze(),this.freezeXY=this.inFreeze.freezeXY,this.inFreeze.loadFreezeImage(),this.fabric.renderAll()}},{key:"doResetPosition",value:function(e){0===e&&this.pubSub.publish("reset")}},{key:"saveOriginalAngleInfoOfImage",value:function(e){var t=this,i={};e.getObjects().forEach((function(e){i[e.id]=e.angle,t.rotateObject(e,0)})),e.renderAll(),e.getObjects().forEach((function(e){t.recordCanvasData(e,t.sheet.data),t.setDataAngle(e,i[e.id],t.sheet.data),t.rotateObject(e,i[e.id])})),e.renderAll()}},{key:"setDataAngle",value:function(e,t,i){var n=this.findObjByData(e.id,i);n&&(n.angle=t)}},{key:"clipPath",value:function(e){this.fabric.clipPath=new $r.fabric.Rect(e)}},{key:"eventsOn",value:function(e,t){for(var i in t)e.on(i,t[i])}},{key:"eventsOff",value:function(e,t){for(var i in t)e.off(i,t[i])}},{key:"saveCanvasData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.fabric,i=this.sheet;if(t){var n=t.toDatalessJSON(["id","tick","imgType","zorder","strid","selectable","hoverCursor"]);n.objects.forEach((function(e){e.left+=i.data.scroll.x,e.top+=i.data.scroll.y})),e.canvasData=JSON.stringify(n)}}},{key:"loadFromCanvasData",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.fabric;e?n.loadFromJSON(e,(function(){i.setOrder(n),n.renderAll()}),t):n.clear()}},{key:"findObjByData",value:function(e,t){var i=this.findImage(e,t);return null!=i?i:this.findShape(e,t)}},{key:"setZoom",value:function(e){var t=this.sheet.data;this.tOffset=this.sheet.getTableOffset(),this.sheet.verticalScrollbar.move({top:0}),this.sheet.horizontalScrollbar.move({left:0}),t.canvasFreeze?this.inFreeze.setZoom(e):(this.fabric.clipPath=new $r.fabric.Rect({width:this.fabric.width/t.zoomlevel,height:this.fabric.height/t.zoomlevel,left:this.tOffset.left/t.zoomlevel,top:this.tOffset.top/t.zoomlevel}),this.fabric.setZoom(e),this.fabric.renderAll())}},{key:"findImage",value:function(e,t){var i;return null===(i=t.images)||void 0===i?void 0:i.find((function(t){return e===ua(t.id,t.tick)}))}},{key:"findShape",value:function(e,t){var i;return null===(i=t.shapes)||void 0===i?void 0:i.find((function(t){return e===fa(t.id,t.tick)}))}},{key:"resize",value:function(e){var t=this.sheet,i=this.fabric,n=this.tOffset;i&&(i.setWidth(e.target.outerWidth+n.left),i.setHeight(e.target.outerHeight+n.top),i.clipPath=new $r.fabric.Rect({width:i.getWidth(),height:i.getHeight(),top:this.tOffset.top/t.data.zoomlevel,left:this.tOffset.left/t.data.zoomlevel}),i.renderAll(),t.data.canvasFreeze&&this.inFreeze.resize())}},{key:"setSelectionLayout",value:function(e){e.set({borderColor:"gray",cornerColor:"gray",cornerSize:12,transparentCorners:!0})}},{key:"setCheckBox",value:function(e,t,i){e.canvas;var n=_a(e,t,i,this);t.borderColor="#ffffff",n.drawObject=wa,n.on("moving",(function(){Ca(e,n,t.control)})),n.on("scaling",(function(){Ca(e,n,t.control)})),n.set("opacity",.2),Ca(e,n,t.control)}},{key:"setTextBox",value:function(e,t,i){e.canvas;var n=_a(e,t,i,this);Gt(t),n.drawObject=xa,n.on("modified",ka),t.setCustomHighlight=pa,t.updateTextBox=function(e,t){this.html=e,this.rtxt=t,delete this.bigfontsize,Gt(this),this.setDirty()},t.getHighlight=function(){return this.showhighlight?m()(this.highlighttxts):[]},t.addHighlight=function(e,t){var i={start:e,end:t};this.highlighttxts.find((function(i){if(i.start===e&&i.end===t)return i}))||(i.color=this.hstyle.color,this.highlighttxts.push(i),this.setDirty())},t.removeHighlight=function(e,t){if(this.highlighttxts){var i=this.highlighttxts.findIndex((function(i){return i.start===e&&i.end===t}));-1!==i&&(this.highlighttxts.splice(i,1),this.setDirty())}},t.setHighlight=function(e,t){this.showhighlight=e,this.highlighttxts||(this.highlighttxts=[]),t&&(this.hstyle=t),this.setDirty()},t.setBackgroundColor=function(e){this.bgColor=e,this.setDirty()},t.setActiveEffect=function(e){this.isactiveeffect=e,this.setDirty()},t.hideText=function(e){this.ishideText=e,this.setDirty()}}},{key:"setImage",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"content/img/updating.gif",r=e.canvas,a=this;$r.fabric.Image.fromURL(n,(function(n){if(t&&(t.fabobj=n,t.inFreeze=a.inFreeze,t.setVisible=da,t.setDirty=ma,t.setControlable=ga,t.setFilter=va,t.setCustomHighlight=pa,t.getIdtick=ya),i.id||(i.id=t.getIdtick()),i.id.includes("loading"))return n.set(i),void r.fabric.add(n);try{var o=r.findObjByData(i.id,e.data);if(!o)return;var s=r.findObjInCanvas(r.fabric,i.id);s&&r.fabric.remove(s),i.width?(i.fromOutside&&(delete i.width,delete i.height),n.set(i)):(n.scaleToWidth(i.scaleToWidth),n.scaleToHeight(i.scaleToHeight),n.set(i),o.fromOutside=!0,o.scaleX=n.scaleX,o.scaleY=n.scaleY),"Chart"===i.imgType&&n.setControlsVisibility({mtr:!1}),r.setSelectionLayout(n),r.eventsOn(n,r.imgEvents),r.eventsOn(r,a.canvasEvents),"edit"!==e.data.settings.mode&&(n.selectable=!1,n.hoverCursor="pointer"),r.fabric.add(n),r.rotateObject(n,i.rotate),r.fabric.renderAll()}catch(e){console.error(e),le(e)}finally{r.removeLoading(e)}}))}},{key:"setLoading",value:function(e,t){var i=this.tOffset,n=e.data,r=n.displayRight2Left,a=n.cols,o=r?e.data.viewWidth()-a.indexWidth:0,s=r?o-t.left:t.left;t.top+=i.top,t.left=s+i.left,t.id="loading"+(new Date).getTime(),t.selectable=!1,this.setImage(e,null,t),this.loadingStack||(this.loadingStack=[]),this.loadingStack.push(t.id)}},{key:"removeLoading",value:function(e){var t=e.canvas;if(this.loadingStack){var i=this.loadingStack.shift();t.fabric.remove(t.fabric.getObjects()[t.fabric.getObjects().findIndex((function(e){return e.id===i}))]),t.saveCanvasData(e.data,t.fabric),t.inFreeze&&(t.inFreeze.removeImage(i),t.inFreeze.saveCanvasData(),t.inFreeze.renderAll(),t.fabric.renderAll())}}},{key:"rotateObject",value:function(e,t){e&&(e._setOriginToCenter(),e.set("angle",t).setCoords(),e._resetOrigin())}},{key:"doInsertURLImage",value:function(e,t){this.doInsertImage(e,t,!0)}},{key:"doInsertImage",value:function(e,t){var i,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.data.getSelectedRect(),a=this.tOffset,o=t.data,s=o.displayRight2Left,l=o.cols,c=s?t.data.viewWidth()-l.indexWidth:0,h=s?c-r.left/t.table.zoomlevel-e.width:r.left/t.table.zoomlevel,u=e.url,f={angle:0,col:this.data.selector.ci,height:e.height,id:e.id,left:r.left/t.table.zoomlevel,originAngle:0,originHeight:e.height,originLeft:r.left,originTop:r.top,originWidth:e.width,row:this.data.selector.ri,scaleX:1,scaleY:1,src:u,strid:e.strid,tick:e.tick,top:r.top/t.table.zoomlevel,type:e.type,width:e.width,zorder:null!==(i=t.data.topOrder)&&void 0!==i?i:0};this.findObjByData(f.id,t.data)||(t.data.images||(t.data.images=[]),t.data.images.push(f)),n?this.setImage(t,f,{id:ua(f.id,f.tick),tick:f.tick,scaleToWidth:e.width,scaleToHeight:e.height,top:f.top+a.top/t.table.zoomlevel,left:h+a.left/t.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:f.type,strid:f.strid,"z-index":this.basicZorder+f.zorder,zorder:f.zorder},f.src):this.setImage(t,f,{id:ua(f.id,f.tick),tick:f.tick,scaleToWidth:f.width,scaleToHeight:f.height,top:f.top+a.top/t.table.zoomlevel,left:h+a.left/t.table.zoomlevel,originAngle:0,rotate:0,fromOutside:!0,imgType:f.type,strid:f.strid,"z-index":this.basicZorder+f.zorder,zorder:f.zorder},f.src),this.fabric.requestRenderAll(),this.inFreeze&&(this.saveCanvasData(t.data),this.inFreeze.loadFreezeImage())}},{key:"isImageOnSelected",value:function(){return!!this.fabric.getActiveObject()}},{key:"setHyperlink",value:function(e){var t=this.getActiveObjInData(this.data);t&&(t.hyperlink=e)}},{key:"getActiveObjInData",value:function(e){var t=this.fabric.getActiveObject();if(t)return this.findObjByData(t.id,e)}},{key:"link",value:function(e){var t,i=this.getActiveObjInData(e);i&&this.sheet.modalLink.setValue(xs.datas.map((function(e){return e.name})),null!==(t=i.hyperlink)&&void 0!==t?t:{})}},{key:"removeLink",value:function(e){var t=this.getActiveObjInData(e);t&&(t.hyperlink=null)}},{key:"openLink",value:function(e){var t=this.getActiveObjInData(e);t&&(this.fabric._discardActiveObject(),this.fabric.renderAll(),this.sheet.hyperlink.access(t.hyperlink))}},{key:"sendImageToFont",value:function(e,t){e&&t&&e.bringToFront(t)}},{key:"doOperation",value:function(e){Object.keys(this.imageOperationList).includes(e)&&!window.mobileAndTabletCheck()&&this.imageOperationList[e].execute(this.sheet)}},{key:"removeImageInData",value:function(e,t){if(!t.includes("_")&&t.split("_").length-1!=2)throw new Error("not correct id");var i=t.split("_"),n=o()(i,3),r=n[0],a=n[1],s=n[2],l="s"===r?e.shapes:e.images;null==l||l.splice(l.findIndex((function(e){return e.id===a&&e.tick===s})),1)}},{key:"checkHyperlink",value:function(e){var t=e.getActiveObject();if(t)return!!this.findObjByData(t.id,this.data).hyperlink}},{key:"validType",value:function(e,t,i){var n=e.getActiveObject();if(n)return this.findObjByData(n.id,this.data)[t]===i}},{key:"setOrder",value:function(e){null==e||e.getObjects().sort((function(e,t){return e.zorder<t.zorder?-1:1})).forEach((function(t){e.bringToFront(t)}))}}]),i}(u);function Ta(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Oa=function(e){ee()(i,e);var t=Ta(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("100%",U("contextmenu.insertURL")),{required:!0},"",100);return(e=t.call(this,">",[f("div","".concat(ae,"-form-fields")).children(n.el),f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})))])).url=n,e.values=[],e.change=function(){},e}return r()(i,[{key:"btnClick",value:function(e){"ok"===e?this.url.validate()&&this.checkIsImage(this.url.val(),this.validateImage,5e3):this.hide()}},{key:"validateImage",value:function(e,t){"success"===t?(this.change("ok",e),this.hide()):this.url.validateFail(U("validation.downloadImageFail"))}},{key:"show",value:function(){Ii()(re()(i.prototype),"show",this).call(this),this.url.input.focus()}},{key:"hide",value:function(){this.url.val(""),this.url.validateClear(),Ii()(re()(i.prototype),"hide",this).call(this)}},{key:"checkIsImage",value:function(e,t,i){var n,r=!1,a=this,o=new Image;o.onerror=o.onabort=function(){r||(clearTimeout(n),t.call(a,e,"error"))},o.onload=function(){r||(clearTimeout(n),t.call(a,e,"success"))},o.src=e,n=setTimeout((function(){r=!0,o.src="//!!!!/test.jpg",t.call(a,e,"timeout")}),i)}}]),i}(Rr);function Ea(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}function Ra(e){e.dd&&(e.dd.title.removeClass("arrow-left"),2===e.dd.headerEl.children().length&&e.dd.headerEl.removeChild(e.dd.headerEl.children()[1]))}function Ia(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=" "+U("menubar.".concat(e.tag.replace(/-[a-z]/g,(function(e){return e[1].toUpperCase()}))));e.dd?e.dd.headerEl.child(i,t):e.el.child(i)}function Aa(e){var t=f("div","".concat(ae,"-item")).child(e.el);return e.dd&&(e.dd.contentEl.addClass("".concat(ae,"-menubar-dropdown-content")),t=f("div","".concat(ae,"-menubar-btn")).child(e.dd.el)),t}function Da(e,t){e.el.addEventListener("click",(function(i){t.dd?t.dd.menuDiv=e:(t.click?t.click():t.change(t.tag),i.stopPropagation())}),!0),e.el.addEventListener("mouseenter",(function(e){e.stopPropagation()}),!0)}var Pa=function(e){ee()(i,e);var t=Ea(i);function i(e,n){var r;l()(this,i);for(var a,o=[],s=["format","font-name","font-size"],c=0;c<n.length;c++){(a=n[c]).tip="",a.el.attr("style","margin:0"),a.el.attr("class",""),Ra(n[c]);var h=s.includes(n[c].tag);Ia(n[c],h);var u=Aa(n[c]);Da(u,n[c]),o.push(u)}return(r=t.call.apply(t,[this,e,"max-content",!1,"bottom-left"].concat(o))).headerEl.on("mouseenter",(function(e){if(!window.mobileAndTabletCheck()){var t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e.target.dispatchEvent(t)}})),r}return i}(Mi);function Fa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ma=function(e){ee()(i,e);var t=Fa(i);function i(e,n){return l()(this,i),t.call(this,e,null,"",n)}return r()(i,[{key:"dropdown",value:function(){return new Pa(this.tag,this.value)}}]),i}(Pi);function La(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var ja=function(e){ee()(i,e);var t=La(i);function i(e){var n;l()(this,i);var r="download";return null!=e&&e&&(r+="_".concat(e)),n=t.call(this,r),"GOOGLE"===e||"DROPBOX"===e?n.setIcon("savetocloud"):n.setIcon("download"),n}return i}(bn);function za(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Ba=function(e){ee()(i,e);var t=za(i);function i(){return l()(this,i),t.call(this,"link")}return i}(bn);function Ha(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Na=function(e){ee()(i,e);var t=Ha(i);function i(){return l()(this,i),t.call(this,"insertColumn")}return i}(bn);function Ua(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var Xa=function(e){ee()(i,e);var t=Ua(i);function i(){return l()(this,i),t.call(this,"insertRow")}return i}(bn);function Wa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var qa=function(e){ee()(i,e);var t=Wa(i);function i(){return l()(this,i),t.call(this,"insertSheet")}return i}(bn);var Ya=function(){function e(t,i,n,r,a){var o=this;l()(this,e),this.data=t;var s=t.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.dropdowns=[];var c=U("menubar.menuEdit"),h=U("menubar.menuComment"),u=U("menubar.menuInsert"),d=U("menubar.menuText"),m=U("menubar.menuFile");this.items={},this.items[m]=[new tr,new ja("Original"),new ja("XLSX"),new ja("PDF"),new ja("HTML")],"ru"!==a&&"zh"!==a&&(this.items[m].push(new ja("GOOGLE")),this.items[m].push(new ja("DROPBOX"))),this.items[c]=[this.borderEl=new pn,this.mergeEl=new Qn,this.freezeEl=new Jn,this.autofilterEl=new qi,this.sortEl=new lr,this.searchEl=new hr,this.paintformatEl=new Cn,this.clearformatEl=new xn,this.fillColorEl=new On(s.bgcolor)],this.items[u]=[this.insertColumn=new Na,this.insertRow=new Xa,this.insertSheet=new qa,this.insertImageEL=new kr,this.formulaEl=new Zn,this.insertLink=new Ba,this.insetCommentEl=new fr],this.insetCommentEl.tag="insertComment",this.items[d]=[this.fontEl=new Bn,this.fontSizeEl=new An,this.boldEl=new Vi,this.italicEl=new Zi,this.underlineEl=new Qi,this.strikeEl=new Ji,this.alignEl=new Bi(s.align),this.valignEl=new Ni(s.valign),this.textwrapEl=new nr,this.textColorEl=new Sn(s.color)],this.items[h]=[this.commentEditEl=new fr,this.commentRemoveEl=new mr,this.commentPreviousEl=new vr,this.commentNextEl=new yr];for(var g=0;g<this.insertImageEL.dd.contentEl.children().length;g++)this.insertImageEL.dd.contentEl.children()[g].style="width:max-content";this.el=f("div","".concat(ae,"-toolbar ").concat(ae,"-menubar")),n?this.el.hide():(this.el.css("text-transform","capitalize"),Object.keys(this.items).forEach((function(e){var t=new Ma(e,o.items[e]);o.dropdowns.push(t),o.el.child(t.el),o.items[e].map((function(e){e.change=function(){o.change.apply(o,arguments)}}))})))}return r()(e,[{key:"hideDropdown",value:function(){this.dropdowns.forEach((function(e){return e.dd.hide()}))}}]),e}(),Va=function(){function e(){l()(this,e),xe()(this,"setActiveSheetBySheetName",(function(){})),xe()(this,"setActiveCell",(function(){})),xe()(this,"linkPositions",[])}return r()(e,[{key:"checkAndAccess",value:function(e,t,i){var n=this.find(e,t,i);return n?this.access(n):null}},{key:"loadLinkPosition",value:function(e){var t=this,i=e.data;this.linkPositions=[];e.getTableOffset();i.hyperlinks.forEach((function(e){var n={},r=k.valueOf(e.area),a=i.scroll.ci,o=i.scroll.ri;a=a>0&&r.sci<a?0:a,o=o>0&&r.sri<o?0:o,n.x=[i.cols.sumWidth(a,r.sci+1)-i.cols.getWidth(r.sci),i.cols.sumWidth(a,r.eci+1)],n.y=[i.rows.sumHeight(o,r.sri+1)-i.rows.getHeight(r.eri),i.rows.sumHeight(o,r.eri+1)],i.canvasFreeze&&(i.scroll.ri>0||i.scroll.ci>0)||t.linkPositions.push(n)}))}},{key:"find",value:function(e,t,i){var n=e.hyperlinks;if(0!==n.length)return n.find((function(e){return e.area?k.valueOf(e.area).includes(t,i):null}))}},{key:"findByArea",value:function(e,t){var i=e.hyperlinks;if(0!==i.length)return i.find((function(e){return e.area?k.valueOf(e.area).contains(k.valueOf(t)):null}))}},{key:"check",value:function(e,t,i){return!!this.find(e,t,i)}},{key:"remove",value:function(e,t){var i=t.hyperlinks.findIndex((function(t){return t.area===e.area}));t.hyperlinks.splice(i,1)}},{key:"removeByRange",value:function(e,t){var i=this.findByRange(e,t.data);this.remove(i,t.data),this.setHyperlinkStyleByArea(i.area,t,!1)}},{key:"findByRange",value:function(e,t){var i=this.getSelectArea(e);return this.findByArea(t,i)}},{key:"getSelectArea",value:function(e){var t=b(e.sci,e.sri),i=b(e.eci,e.eri);return"".concat(t,":").concat(i)}},{key:"setHyperlinkStyleByArea",value:function(e,t,i){for(var n=k.valueOf(e),r=n.sri;r<=n.eri;r++)for(var a=n.sci;a<=n.eci;a++)t.data.setHyperlinkStyle(r,a,i);t.table.render()}},{key:"accessByRange",value:function(e,t){var i=this.getSelectArea(e),n=this.findByArea(t,i);this.access(n)}},{key:"access",value:function(e){if("number"==typeof e.type&&e.address){switch(e.type){case 0:case 2:window.open(e.address,"_blank");break;case 1:break;case 3:if(!e.address.includes("!"))break;var t=e.address.split("!"),i=o()(t,2),n=i[0],r=i[1];n.startsWith("'")&&n.endsWith("'")&&(n=n.substr(1,n.length-2)),this.setActiveSheetBySheetName(n);var a=y(r),s=o()(a,2),l=s[0],c=s[1],h=this;setTimeout((function(){h.setActiveCell(c,l)}),1e3)}return null}}}]),e}();function Ga(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return Za(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Za(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Za(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Ka=function(){function e(t){l()(this,e),this.sheet=t}return r()(e,[{key:"setCustomHighlightImgFunc",value:function(e){this.highlightImgFunc=e}},{key:"showHighlights",value:function(e){var t=this.sheet.data;t.showhighlight=!0,t.highlightstyle=e,this.AutoShowOrHide()}},{key:"AutoShowOrHide",value:function(){var e=this.sheet,t=e.data,i=e.canvas;if(t.highlightall){var n=i.fabric;this.highlightAllImg(t.showhighlight,n)}else this.showHighlightImageShapesAuto(t.showhighlight)}},{key:"hideHighlights",value:function(){var e=this.sheet,t=e.data,i=e.table;t.showhighlight=!1,this.AutoShowOrHide(),i.render()}},{key:"getHighlightTexts",value:function(){return this.sheet.data.highlighttxts}},{key:"addHighlightText",value:function(e,t,i,n){var r=this.sheet.data,a={row:e,col:t,start:i,end:n};r.highlighttxts.find((function(r){if(r.row===e&&r.col===t&&r.start===i&&r.end===n)return r}))||r.highlighttxts.push(a)}},{key:"removeHighlightText",value:function(e,t,i,n){for(var r=this.sheet.data,a=0;a<r.highlighttxts.length;a++){var o=Number.isInteger(i)?i:r.highlighttxts[a].start,s=Number.isInteger(n)?n:r.highlighttxts[a].end;r.highlighttxts[a].row===e&&r.highlighttxts[a].col===t&&r.highlighttxts[a].start===o&&r.highlighttxts[a].end===s&&r.highlighttxts.splice(a,1)}}},{key:"getHighlightRanges",value:function(){return this.sheet.data.highlightrg}},{key:"addHighlightRange",value:function(e,t,i,n){for(var r=this.sheet.data,a=new k(e,t,i,n),o=0;o<r.highlightrg.length;o++)if(r.highlightrg[o].contains(a))return;r.highlightrg.push(a)}},{key:"removeHighlightRange",value:function(e,t,i,n){for(var r=this.sheet.data,a=new k(e,t,i,n),o=0;o<r.highlightrg.length;o++)r.highlightrg[o].equals(a)&&r.highlightrg.splice(o,1)}},{key:"setHighlightInverseRange",value:function(e,t,i,n){this.sheet.data.highlightIR=new k(e,t,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.sheet.data.highlightIR}},{key:"removeHighlightInverseRange",value:function(){delete this.sheet.data.highlightIR}},{key:"getCanvasImgByid",value:function(e,t){return e.getObjects().find((function(e){return e.id===t}))}},{key:"highlightAllImg",value:function(e,t){var i=this.sheet,n=i.data,r=(i.canvas,n.shapes),a=n.images;if(r){var o,s=Ga(r);try{for(s.s();!(o=s.n()).done;){var l=o.value;this.highlightImg(e,l,n.highlightstyle)}}catch(e){s.e(e)}finally{s.f()}}if(a){var c,h=Ga(a);try{for(h.s();!(c=h.n()).done;){var u=c.value;this.highlightImg(e,u,n.highlightstyle)}}catch(e){h.e(e)}finally{h.f()}}t.requestRenderAll()}},{key:"showHighlightImageShapesAuto",value:function(e){var t,i=this,n=this.sheet,r=n.data,a=n.canvas.fabric,o=Ga(r.highlighshapes);try{var s=function(){var n=t.value,a=r.shapes.find((function(e){return e.id===n}));a&&i.highlightImg(e,a,r.highlightstyle)};for(o.s();!(t=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}var l,c=Ga(r.highlighimgs);try{var h=function(){var t=l.value,n=r.images.find((function(e){return e.id===t}));n&&i.highlightImg(e,n,r.highlightstyle)};for(c.s();!(l=c.n()).done;)h()}catch(e){c.e(e)}finally{c.f()}a.requestRenderAll()}},{key:"highlightImg",value:function(e,t,i){var n=this.sheet;n.data,n.canvas;if(t)if("TextBox"!==t.type)if(this.highlightImgFunc)t.setCustomHighlight(e,this.highlightImgFunc);else{var r=!!e&&new fabric.Image.filters.Invert;t.setFilter(r)}else t.setHighlight(e,i)}},{key:"getHighlightShaps",value:function(){return this.sheet.data.highlighshapes}},{key:"addHighlightShape",value:function(e){var t=this.sheet,i=t.data,n=t.canvas;if(-1===i.highlighshapes.indexOf(e)){var r=i.shapes.find((function(t){return t.id===e}));if(r){var a=n.fabric;i.highlighshapes.push(e),this.highlightImg(i.showhighlight,r,i.highlightstyle),i.showhighlight&&a.requestRenderAll()}}}},{key:"removeHighlightShape",value:function(e){var t=this.sheet,i=t.data,n=t.canvas.fabric,r=i.highlighshapes.indexOf(e);if(r>-1){i.highlighshapes.splice(r,1);var a=i.shapes.find((function(t){return t.id===e}));a&&(this.highlightImg(!1,a),n.requestRenderAll())}}},{key:"getHighlightImages",value:function(){return this.sheet.data.highlighimgs}},{key:"addHighlightImage",value:function(e){var t=this.sheet,i=t.data,n=t.canvas;if(-1===i.highlighimgs.indexOf(e)){var r=i.images.find((function(t){return t.id===e}));if(r){var a=n.fabric;i.highlighimgs.push(e),i.showhighlight&&(this.highlightImg(!0,r),a.requestRenderAll())}}}},{key:"removeHighlightImage",value:function(e){var t=this.sheet,i=t.data,n=t.canvas.fabric,r=i.highlighimgs.indexOf(e);if(r>-1){i.highlighimgs.splice(r,1);var a=i.images.find((function(t){return t.id===e}));a&&(this.highlightImg(!1,a),n.requestRenderAll())}}},{key:"setHighlightAll",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.sheet,n=i.data,r=i.canvas,a=i.table;if(n.showhighlight){var o=r.fabric;n.highlightall=e,this.highlightAllImg(e,o),e||this.showHighlightImageShapesAuto(!0)}t&&a.render()}}]),e}();function Ja(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var $a=function(e){ee()(i,e);var t=Ja(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("400px",""),{required:!0},"".concat(U("download.fileName"),":"),100),r=new Mr(new Pr("Original",["Original","XLSX","PDF","HTML"],"100%",(function(e){return U("download.saveTypes.".concat(e))}),(function(t){var i=e.fileNameField.val();e.fileNameField.val(e.setSuffix(i,t)),e.fileNameField.validate()})),{required:!0},"".concat(U("download.saveType"),":"),100);return e=t.call(this,U("contextmenu.download"),[f("div","".concat(ae,"-form-fields")).children(n.el),f("div","".concat(ae,"-form-fields")).children(r.el),f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})),new vi("cancel").on("click",(function(){return e.btnClick("cancel")})))]),xe()(qn()(e),"defaultSuffix","xlsx"),e.fileNameField=n,e.saveTypeField=r,e.ci=null,e.values=[],e.change=function(){},e}return r()(i,[{key:"setSuffix",value:function(e,t){var i;return"Original"===t&&(t=this.originalType),e=(e=""===(null!==(i=e)&&void 0!==i?i:"")?this.originalFileName:e).includes(".")?e:e+"."+this.defaultSuffix,"".concat(e.substr(0,e.lastIndexOf(".")),".").concat(t.toLowerCase())}},{key:"btnClick",value:function(e){if("ok"===e){if(!this.fileNameField.validate())return;var t=this.saveTypeField.val(),i=this.fileNameField.val();i=this.setSuffix(i,t),this.change("ok",i,t)}this.hide()}},{key:"setValue",value:function(e){this.originalFileName=""===(null!=e?e:"")?"worksheet.xlsx":e,this.originalType=e.split(".").length>=2?e.substr(e.lastIndexOf(".")+1):this.defaultSuffix,this.fileNameField.val(this.originalFileName),this.show()}}]),i}(Rr);function Qa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var eo=function(e){ee()(i,e);var t=Qa(i);function i(){var e;l()(this,i);var n=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.emailAddress"),":"),100),r=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.emailSubject"),":"),100),a=f("div","".concat(ae,"-form-fields")).children(f("div","".concat(ae,"-form-fields")).children(n.el),f("div","".concat(ae,"-form-fields")).children(r.el));a.hide();var o=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.sheetCell"),":"),100),s=new Mr(new Pr("",[""],"max-content",(function(e){return e}),(function(e){})),{required:!0},"".concat(U("link.sheetPage"),":"),100);s.input.el.css("width","max-content");var c=f("div","".concat(ae,"-form-fields")).children(f("div","".concat(ae,"-form-fields")).children(o.el),f("div","".concat(ae,"-form-fields")).children(s.el));c.hide();var h=new Mr(new Ir("100%",""),{required:!0},"".concat(U("link.webUrl"),":"),100),u=f("div","".concat(ae,"-form-fields")).children(h.el);u.hide();var d=new Mr(new Pr("web",["web","sheet","email"],"max-content",(function(e){return U("link.linkTypes.".concat(e))}),(function(t){switch(u.hide(),c.hide(),a.hide(),t){case"web":u.show(),e.active="web";break;case"sheet":c.show(),e.active="sheet";break;case"email":a.show(),e.active="email"}})),{required:!0},"".concat(U("link.linkType"),":"),100);return e=t.call(this,U("contextmenu.link"),[f("div","".concat(ae,"-form-fields")).children(d.el),f("div","".concat(ae,"-form-fields")).children(a.el,u.el,c.el),f("br"),f("br"),f("div","".concat(ae,"-buttons")).children(new vi("ok","primary").on("click",(function(){return e.btnClick("ok")})),new vi("cancel").on("click",(function(){return e.btnClick("cancel")})))]),xe()(qn()(e),"active",void 0),e.ci=null,e.values=[],e.sheetPageField=s,e.sheetField=c,e.webField=u,e.emailField=a,e.sheetCellField=o,e.webUrlField=h,e.emailAddressField=n,e.emailSubjectField=r,e.linkTypeField=d,e.change=function(){},e.el.on("click",(function(e){e.preventDefault()})),e}return r()(i,[{key:"btnClick",value:function(e){var t=this.link,i=this.type;if("ok"===e){switch(this.active){case"web":if(!this.webUrlField.validate())return;if(!this.isValidHttpUrl(this.webUrlField.val()))return void this.webUrlField.validateFail("Missing address network protocols such as http:// or https://");t.type=0,t.address=this.webUrlField.val();break;case"sheet":if(!this.sheetCellField.validate())return;t.type=3,t.address="".concat(this.sheetPageField.val(),"!").concat(this.sheetCellField.val());break;case"email":t.type=2,t.address="mailto:".concat(this.emailAddressField.val(),"?subject=").concat(this.emailSubjectField.val())}this.change("ok",t,i)}this.hide()}},{key:"clear",value:function(){this.sheetField.hide(),this.sheetPageField.val(this.sheets[0]),this.sheetCellField.val("A1"),this.webField.hide(),this.webUrlField.val(""),this.webUrlField.validateClear(),this.emailField.hide(),this.emailSubjectField.val(""),this.emailAddressField.val("")}},{key:"isValidHttpUrl",value:function(e){var t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}},{key:"setValue",value:function(e,t,i){var n;if(this.type=i,this.sheets=e,this.link=t,this.clear(),this.sheetPageField.input.suggest.setItems(e.map((function(e){return{key:e,title:e}}))),""!==(null!==(n=null==t?void 0:t.type)&&void 0!==n?n:""))switch(t.type){case 1:case 0:this.webUrlField.input.val(t.address),this.linkTypeField.val("web"),this.webField.show(),this.active="web";break;case 2:var r=/mailto:([^\?]*)\?subject\=(.*)/.exec(t.address);this.emailSubjectField.val(r[2]),this.emailAddressField.val(r[1]),this.linkTypeField.val("email"),this.emailField.show(),this.active="email";break;case 3:var a=t.address.split("!");if(2!==a.length)break;this.sheetPageField.val(a[0]),this.sheetCellField.val(a[1]),this.linkTypeField.val("sheet"),this.sheetField.show(),this.active="sheet"}else this.linkTypeField.val("web"),this.webField.show(),this.active="web";this.show()}}]),i}(Rr),to=function(){function e(t){l()(this,e),this.el=f("div","".concat(ae,t?"-banner-icon-s":"-banner-icon"))}return r()(e,[{key:"setHomeIcon",value:function(e,t){this.el.css({"background-image":"url(".concat(e,")"),"background-size":"contain","background-position":"center"});var i=f("a");i.attr("href",t),i.css({display:"block",height:"100%",width:"100%","text-decoration":"none"}),this.el.child(i)}}]),e}(),io=function(){function e(t){var i=this;l()(this,e),this.el=f("div","".concat(ae,"-banner-filename")),this.filename=f("div","".concat(ae,"-banner-filename-name")),this.filename.on("blur",(function(e){e.target.innerHTML=e.target.innerHTML.replace(/<[^>]+>/gi,"");var n=e.target.innerText;n=n.replace(/\r?\n|\r/g,""),t.filename=n+i.suffixStr,setTimeout((function(){t.selector.el.show()}),100)})),this.filename.on("focus",(function(e){window.mobileEditOnCell=!1,t.editor.el.hide()})),this.filename.on("keyup",(function(e){13===e.keyCode&&i.filename.el.blur()})),this.filename.attr("contenteditable",!0),this.filename.attr("spellcheck",!1),this.suffix=f("div"),this.el.children(this.filename,this.suffix)}return r()(e,[{key:"setValue",value:function(e){if(e.includes(".")){var t=e.substring(0,e.lastIndexOf(".")),i=this.suffixStr=e.substring(e.lastIndexOf("."));this.filename.html(t),this.suffix.html(i)}}}]),e}(),no=function(){function e(t,i,n,r,a,o,s){var c=this;l()(this,e),this.data=t;t.defaultStyle();this.change=function(){},this.widthFn=i,this.isHide=n,this.icon=new to(!a),this.filenamebar=new io(o),this.menubar=new Ya(t,i,n,r,s),this.el=f("div");var h=f("div","".concat(ae,"-banner"));n&&!r?(this.el.hide(),this.notShow=!0):(h.children(this.icon.el,f("div","".concat(ae,a?"-banner-info":"-banner-info-s")).children(this.filenamebar.el,this.menubar.el)),this.el.child(h)),a||this.filenamebar.el.hide(),this.menubar.change=function(){c.change.apply(c,arguments)}}return r()(e,[{key:"show",value:function(){this.notShow||this.el.show()}},{key:"hide",value:function(){this.el.hide()}},{key:"hideDropdown",value:function(){this.menubar.hideDropdown()}},{key:"setFileName",value:function(e){this.filenamebar.setValue(e)}}]),e}();function ro(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function ao(e,t){var i=function(e,t){var i=ro(e)*ro(t);if(0===i)return 0;var n=function(e,t){return e.x*t.x+e.y*t.y}(e,t)/i;return n>1&&(n=1),Math.acos(n)}(e,t);return function(e,t){return e.x*t.y-t.x*e.y}(e,t)>0&&(i*=-1),180*i/Math.PI}var oo=function(e){this.handlers=[],this.el=e};function so(e,t){var i=new oo(e);return i.add(t),i}function lo(e,t){this.element="string"==typeof e?document.querySelector(e):e,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this),this.element.addEventListener("touchstart",this.start,!1),this.element.addEventListener("touchmove",this.move,!1),this.element.addEventListener("touchend",this.end,!1),this.element.addEventListener("touchcancel",this.cancel,!1),this.preV={x:null,y:null},this.pinchStartLen=null,this.zoom=1,this.isDoubleTap=!1;var i=function(){};this.rotate=so(this.element,t.rotate||i),this.touchStart=so(this.element,t.touchStart||i),this.multipointStart=so(this.element,t.multipointStart||i),this.multipointEnd=so(this.element,t.multipointEnd||i),this.pinch=so(this.element,t.pinch||i),this.swipe=so(this.element,t.swipe||i),this.tap=so(this.element,t.tap||i),this.doubleTap=so(this.element,t.doubleTap||i),this.longTap=so(this.element,t.longTap||i),this.singleTap=so(this.element,t.singleTap||i),this.pressMove=so(this.element,t.pressMove||i),this.twoFingerPressMove=so(this.element,t.twoFingerPressMove||i),this.touchMove=so(this.element,t.touchMove||i),this.touchEnd=so(this.element,t.touchEnd||i),this.touchCancel=so(this.element,t.touchCancel||i),this._cancelAllHandler=this.cancelAll.bind(this),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.tapTimeout=null,this.singleTapTimeout=null,this.longTapTimeout=null,this.swipeTimeout=null,this.x1=this.x2=this.y1=this.y2=null,this.preTapPosition={x:null,y:null}}function co(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ho(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?co(Object(i),!0).forEach((function(t){xe()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):co(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function uo(e,t){var i,n=this;return function(){for(var r=n,a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var l=o;i||(i=setTimeout((function(){i=null,e.apply(r,l)}),t))}}function fo(){var e=this.data,t=this.verticalScrollbar,i=this.horizontalScrollbar,n=e.getSelectedRect(),r=n.l,a=n.t,o=n.left,s=n.top,l=n.width,c=n.height,h=this.getTableOffset();if(Math.abs(o)+l>h.width)i.move({left:r+l-h.width});else{var u=e.freezeTotalWidth();o<u&&i.move({left:r-1-u})}if(Math.abs(s)+c>h.height)t.move({top:a+c-h.height-1});else{var f=e.freezeTotalHeight();s<f&&t.move({top:a-1-f})}}function mo(){var e=this.data,t=this.verticalScrollbar,i=this.horizontalScrollbar,n=e.getSelectedRectBySearch(),r=n.l,a=n.t;i.move({left:r-1}),t.move({top:a-1})}function go(e,t,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(-1!==t||-1!==i){var a=this.table,o=this.selector,s=this.toolbar,l=this.formulaBar,c=this.data,h=this.contextMenu;if(h.setMode(-1===t||-1===i?"row-col":"range"),c.canSelected(t,i)){var u=c.getCell(t,i);e?(o.setEnd(t,i,r),this.trigger("cells-selected",u,o.range)):(o.set(t,i,n),this.trigger("cell-selected",u,t,i)),this.focusing=!0,o.setObjId(null),s.reset(),l.reset(),a.render()}}}function vo(e,t){var i=this.selector,n=this.data,r=n.rows,a=n.cols,s=o()(i.indexes,2),l=s[0],c=s[1],h=i.range,u=h.eri,f=h.eci;if(e){var d=o()(i.moveIndexes,2);l=d[0],c=d[1]}"left"===t?c>0&&(c-=1):"right"===t?(f!==c&&(c=f),c<a.len-1&&(c+=1)):"up"===t?l>0&&(l-=1):"down"===t?(u!==l&&(l=u),l<r.len-1&&(l+=1)):"row-first"===t?c=0:"row-last"===t?c=a.len-1:"col-first"===t?l=0:"col-last"===t&&(l=r.len-1),e&&(i.moveIndexes=[l,c]),go.call(this,e,l,c),fo.call(this)}function po(e){if(0===e.buttons&&e.target.className!=="".concat(ae,"-resizer-hover")){var t=e.offsetX,i=e.offsetY,n=this.rowResizer,r=this.colResizer,a=this.tableEl,o=this.data,s=o.rows,l=o.cols,c=o.displayRight2Left,h=o.settings.row.height;if(t>l.indexWidth&&i>h)return n.hide(),void r.hide();var u=a.box(),f=o.getCellRectByXY(e.offsetX/o.zoomlevel,e.offsetY/o.zoomlevel);f.ri>=0&&-1===f.ci?(f.width=l.indexWidth*o.zoomlevel,n.show(f,{width:u.width}),s.isHide(f.ri-1)?n.showUnhide(f.ri):n.hideUnhide()):n.hide(),-1===f.ri&&f.ci>=0?(f.height=h*o.zoomlevel,f.top=0,r.show(f,{height:u.height},c),l.isHide(f.ci-1)?r.showUnhide(f.ci):r.hideUnhide()):r.hide()}}function yo(e){var t=this.verticalScrollbar,i=this.horizontalScrollbar,n=this.data,r=t.scroll().top,a=i.scroll().left,o=n.rows,s=n.cols,l=e.deltaY,c=e.deltaX,h=function(e,t){var i=e,n=0;do{n=t(i),i+=1}while(n<=0);return n},u=function(e){if(e>0){var i=n.scroll.ri+1;if(i<o.len){var a=h(i,(function(e){return o.getHeight(e)}));t.move({top:r+a-1})}}else{var s=n.scroll.ri-1;if(s>=0){var l=h(s,(function(e){return o.getHeight(e)}));t.move({top:0===s?0:r-l})}}},f=Math.abs(l),d=Math.abs(c),m=Math.max(f,d);/Firefox/i.test(window.navigator.userAgent)&&uo(u(e.detail),50),m===d&&uo(function(e){if(e>0){var t=n.scroll.ci+1;if(t<s.len){var r=h(t,(function(e){return s.getWidth(e)}));i.move({left:a+r-1})}}else{var o=n.scroll.ci-1;if(o>=0){var l=h(o,(function(e){return s.getWidth(e)}));i.move({left:0===o?0:a-l})}}}(c),50),m===f&&uo(u(l),50)}function bo(){var e=this.data,t=this.verticalScrollbar,i=(1!==e.zoomlevel?this.originTableOffset:this.getTableOffset()).height,n=e.exceptRowTotalHeight(0,-1);t.set(i,(e.rows.totalHeight()-n)*e.zoomlevel)}function wo(){var e=this.data,t=this.horizontalScrollbar,i=(1!==e.zoomlevel?this.originTableOffset:this.getTableOffset()).width;e&&t.set(i,e.cols.totalWidth()*e.zoomlevel),e.displayRight2Left?t.el.attr("dir","rtl"):t.el.removeAttr("dir")}function xo(){var e=this.selector,t=this.data,i=this.editor,n=this.canvas,r=o()(t.freeze,2),a=r[0],s=r[1];if(a>0||s>0){var l=t.freezeTotalWidth(),c=t.freezeTotalHeight();i.setFreezeLengths(l,c)}else i.setFreezeLengths(0,0);n.resetFreeze(t),e.resetAreaOffset()}function ko(){var e=this.tableEl,t=this.overlayerEl,i=this.overlayerCEl,n=this.table,r=this.toolbar,a=this.formulaBar,o=this.selector,s=this.hyperlink,l=this.el;this.originTableOffset||(this.originTableOffset=this.getTableOffset()),1!==this.data.zoomlevel&&(o.br.useHideInput=!1);var c=this.getTableOffset(),h=this.getRect();e.attr(h),t.offset(h);var u=this.data.zoomlevel;i.offset(ho(ho({},c),{},{width:c.width/u,height:c.height/u})),l.css("width","".concat(h.width,"px")),bo.call(this),wo.call(this),xo.call(this),n.render(),r.reset(),a.reset(),o.reset(),s.loadLinkPosition(this),1!==this.data.zoomlevel&&(o.br.useHideInput=!0)}function Co(){var e=this.data,t=this.selector;e.clearClipboard(),t.hideClipboard()}function _o(){var e=this.data,t=this.selector,i=this.canvas;e.copy(),t.showClipboard(),i.clipboard=null}function So(){var e=this.data,t=this.selector;e.cut(),t.showClipboard()}function To(){return(To=be()(Ce.a.mark((function e(){var t,i;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.permissions.query({name:"clipboard-read"});case 3:return t=e.sent,i=t.state,e.abrupt("return","granted"===i);case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}function Oo(e,t){var i=this.data,n=this;if("read"!==i.settings.mode&&!i.getLocked())if(i.paste(e,(function(e){return le("Tip",e)})))ko.call(this);else if(t){if(null==i.clipboard.range){var r=t.clipboardData.getData("text/plain");r.length>0&&(this.data.pasteFromText(r),ko.call(this))}}else(function(){return To.apply(this,arguments)})()&&navigator.permissions.query({name:"clipboard-read"}).then((function(e){!document.hasFocus()||"granted"!==e.state&&"prompt"!==e.state||navigator.clipboard.read().then((function(e){var t=e[0];t.types.includes("image/png")&&t.getType("image/png").then((function(e){var t=new File([e],Math.random(),{type:e.type});n.canvas.imageOperationList.paste.uploadImg(n,t)}))}))}))}function Eo(){this.data.hideRowsOrCols(),ko.call(this)}function Ro(e,t){this.data.unhideRowsOrCols(e,t),ko.call(this)}function Io(){this.data.autofilter(),ko.call(this)}function Ao(){var e=document.createElement("div");e.id="aspose_mask_bg",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="#777",e.style.opacity=.6,e.style.zIndex=10001,document.body.appendChild(e);var t=document.createElement("div");t.style.position="absolute",t.style.top="33%",t.style.left="40%",t.style.backgroundColor="white",t.style.border="#336699 1px solid",t.style.textAlign="center",t.style.fontSize="medium",t.style.padding="1.5em 4em 1.5em 4em",t.innerText="updating , please wait...",e.appendChild(t)}function Do(){var e=document.getElementById("aspose_mask_bg");null!=e&&e.parentNode.removeChild(e)}function Po(e,t){return Fo.apply(this,arguments)}function Fo(){return(Fo=be()(Ce.a.mark((function e(t,i){var n,r,a,o,s,l;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.data,r={sheetname:n.name,actrow:n.selector.ri,actcol:n.selector.ci,datas:xs.getUpdateDatas()},a={p:JSON.stringify(r),uid:this.uniqueid,file:t,outputType:i},o=this.fileDownloadUrl,s=new FormData,Object.keys(a).forEach((function(e){return s.set(e,a[e])})),Ao(),e.next=9,fetch(o,{method:"POST",body:s});case 9:if((l=e.sent).ok){e.next=15;break}Do(),alert("Download failed, please try again"),e.next=22;break;case 15:return e.t0=Qo,e.next=18,l.json();case 18:e.t1=e.sent,e.t2=t,(0,e.t0)(e.t1,e.t2),Do();case 22:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function Mo(){var e=this.toolbar;e.paintformatActive()&&(Oo.call(this,"format"),Co.call(this),e.paintformatToggle())}function Lo(){var e=this.editor,t=this.contextMenu,i=this.commentTip,n=this.commentEditable;e.clear(),t.hide(),i.hide(),n.saveAndHide(this)}function jo(e){var t=this,i=this.selector,n=this.data,r=this.table,a=this.sortFilter,s=this.hyperlink,l=e.offsetX,c=e.offsetY,h=e.target.className==="".concat(ae,"-selector-corner"),u=r.zoomlevel,f=n.getCellRectByXY(l/u,c/u),d=f.left,m=f.top,g=f.width,v=f.height,p=n.viewHeight(),y=n.viewWidth(),b=f.ri,w=f.ci;if(!(b<-1||w<-1)){var x=n.autoFilter,k=n.TableAutoFilters;if(x.includes(b,w)&&d+g-20*u<l&&m+v-20*u<c){var C=x.items(w,(function(e,t){return n.rows.getCell(e,t)}));return a.set(w,C,x.getFilter(w),x.getSort(w)),a.setOffsetAdjustView({left:d,top:m+v+2},y,p),void(n.currentAutoFilter=x)}for(var _=0,S=k.length;_<S;_++){var T=k[_];if(T.includes(b,w)&&d+g-20*u<l&&m+v-20*u<c){var O=T.items(w,(function(e,t){return n.rows.getCell(e,t)}));return a.set(w,O,T.getFilter(w),T.getSort(w)),a.setOffsetAdjustView({left:d,top:m+v+2},y,p),void(n.currentAutoFilter=T)}}if(!e.shiftKey){if(h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else if(go.call(this,!1,b,w),!e.ctrlKey&&2!==e.button){var E,R=null!==(E=s.checkAndAccess(n,b,w))&&void 0!==E?E:[w,b],I=o()(R,2);w=I[0],b=I[1]}window.mobileAndTabletCheck()||Ie(window,(function(e){var r=n.getCellRectByXY(e.offsetX/u,e.offsetY/u);if(b=r.ri,w=r.ci,h){if(window.mobileAndTabletCheck())return;i.showAutofill(b,w)}else 1!==e.buttons||e.shiftKey||go.call(t,!0,b,w,!0,!0)}),(function(){n.getLocked()||(h&&i.arange&&"read"!==n.settings.mode&&n.autofill(i.arange,"all",(function(e){return le("Tip",e)}))&&r.render(),i.hideAutofill(),Mo.call(t))}))}h||1!==e.buttons||e.shiftKey&&go.call(this,!0,b,w)}}function zo(){var e=this.data.getSelectedRect();Bo.call(this,e)}function Bo(e){var t=this.editor,i=this.getTableOffset(),n="top";e.top>i.height/2&&(n="bottom"),t.setOffset(e,n)}function Ho(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.table,i=this.editor,n=this.data;"read"!==n.settings.mode&&(n.getLocked()||(zo.call(this),t.clearSelectRender(),i.setCell(n.getSelectedCell(),n.getSelectedValidator(),e),Co.call(this)))}function No(e){this.table;var t=this.editor,i=this.data;if("read"!==i.settings.mode&&!i.getLocked()){var n=i.getRectForTextbox(e);Bo.call(this,n),t.setForTextBox(e),Co.call(this)}}function Uo(){var e=this.formulaBar,t=this.data;e.resetData(t)}function Xo(e){var t=this,i=this.data,n=this.table,r=this.selector,a=this.hyperlink;i.scrolly(e,(function(){1!==t.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRLAreaOffset(),zo.call(t),n.render(),a.loadLinkPosition(t),i.scrollImagesShapes(),1!==t.data.zoomlevel&&(r.br.useHideInput=!0)}))}function Wo(e){var t=this,i=this.data,n=this.table,r=this.selector,a=this.hyperlink;i.scrollx(e,(function(){1!==t.data.zoomlevel&&(r.br.useHideInput=!1),r.resetBRTAreaOffset(),zo.call(t),n.render(),a.loadLinkPosition(t),i.scrollImagesShapes(),1!==t.data.zoomlevel&&(r.br.useHideInput=!0)}))}function qo(e,t){var i=e.ri,n=this.table,r=this.selector,a=this.data,o=this.hyperlink,s=a.rows.getHeight(i);a.rows.setHeight(i,t),a.updateRowsHeight.add(i),a.updateConditionImagePositionForRow(i,t-s,t),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),o.loadLinkPosition(this),bo.call(this),zo.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function Yo(e,t){var i=e.ci,n=this.table,r=this.selector,a=this.data,o=this.hyperlink,s=a.cols.getWidth(i);a.cols.setWidth(i,t),a.updateCols.add(i),a.updateConditionImagePositionForCol(i,t-s,t),n.render(),1!==this.data.zoomlevel&&(r.br.useHideInput=!1),r.resetAreaOffset(),o.loadLinkPosition(this),wo.call(this),zo.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0)}function Vo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"finished",i=this.data,n=this.table;if("read"!==i.settings.mode&&!i.getLocked()){i.setSelectedCellText(e,t);var r=i.selector,a=r.ri,o=r.ci;if("finished"===t){if("server"===i.settings.updateMode){var s=i.getCell(a,o);return void(s.lc&&(s.lc.text=s.text,s.lc.rtxt[0][0].txt=s.text,s.lc.setDirty()))}n.render()}else this.trigger("cell-edited",e,a,o)}}function Go(e){var t=this.data;"insert-row"===e?t.insert("row"):"delete-row"===e?t.delete("row"):"insert-column"===e?t.insert("column"):"delete-column"===e?t.delete("column"):"delete-cell"===e?t.deleteCell():"delete-cell-format"===e?t.deleteCell("format"):"delete-cell-text"===e?t.deleteCell("text"):"cell-printable"===e?t.setSelectedCellAttr("printable",!0):"cell-non-printable"===e?t.setSelectedCellAttr("printable",!1):"cell-editable"===e?t.setSelectedCellAttr("editable",!0):"cell-non-editable"===e&&t.setSelectedCellAttr("editable",!1),Co.call(this),ko.call(this)}function Zo(e){for(var t=e,i=0,n=0;null!==t;)i+=t.offsetTop,n+=t.offsetLeft,t=t.offsetParent;return{top:i,left:n}}function Ko(e,t,i){var n=this.data,r=this.modalSort,a=this.modalDownload,o=this.modalLink,s=this.modalSearch,l=this.commentEditable,c=this.modalInsertURLImage,h=(this.overlayerCEl,this.canvas,this.filename),u=this.toolbar;function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Device",i=this.filename;"Original"!==e&&(i="".concat(i.substr(0,i.lastIndexOf(".")),".").concat(e.toLowerCase())),"function"!=typeof this.fileDownloadCallFunc?Po.call(this,i,e):this.fileDownloadCallFunc(i,e,t)}if(window.mobileAndTabletCheck()&&u.moreEl.el.hasClass("active")&&u.moreEl.dd.hide(),"undo"===e)this.undo();else if("redo"===e)this.redo();else if("print"===e)this.print.preview(),this.print.toPrint();else if("paintformat"===e)!0===t?_o.call(this):Co.call(this);else if("clearformat"===e)Go.call(this,"delete-cell-format");else if("chart"===e);else if("autofilter"===e)Io.call(this);else if("freeze"===e)if(t){var d=n.selector,m=d.ri,g=d.ci;this.freeze(m,g)}else this.freeze(0,0);else if("sort"===e)r.setValue(n.getSelectedSort());else if("download"===e)a.setValue(h);else if("download_HTML"===e)f.call(this,"HTML");else if("download_Original"===e)f.call(this,"Original");else if("download_XLSX"===e)f.call(this,"XLSX");else if("download_PDF"===e)f.call(this,"PDF");else if("download_GOOGLE"===e)f.call(this,"Original","GoogleDrive");else if("download_DROPBOX"===e)f.call(this,"Original","Dropbox");else if("search"===e)s.show();else if("menu-display-hide"===e)"up"===this.toolbar.menuDisplay.state?(this.toolbar.menuDisplay.setDown(),this.menubar.hide(),this.table.render()):(this.toolbar.menuDisplay.setUp(),this.menubar.show(),this.table.render());else if("insertComment"===e&&"commentEdit"===t||"insertComment"===e||"commentEdit"===e){var v=n.selector,p=v.ri,y=v.ci,b="";if(void 0!==n.comments)for(var w=0;w<n.comments.length;w++){var x=n.comments[w];x.row===p&&x.col===y&&(b=x.note)}var k=n.cellRectWithOutTransfer(p,y);l.col=y,l.row=p,l.setPosition(b,k,n.displayRight2Left),this.commentTip.onEdit=!0,"comments"===n.search.lookin&&(n.search.result=null)}else if("insertComment"===e&&"commentRemove"===t||"commentRemove"===e){var C=n.selector,_=C.ri,S=C.ci;if(void 0!==n.comments)for(var T=0;T<n.comments.length;T++)n.comments[T].col===S&&n.comments[T].row===_&&n.comments.splice(T,1);"comments"===n.search.lookin&&(n.search.result=null),this.table.render()}else if("insertComment"===e&&"commentPrevious"===t||"commentPrevious"===e)Jo(this,n,"previous");else if("insertComment"===e&&"commentNext"===t||"commentNext"===e)Jo(this,n,"next");else if("insert-image"===e)"url"===t&&c.show();else if("zoom-size"===e)this.setzoom(t.number);else if("insertSheet"===e)this.addSheet();else if("insertRow"===e)Go.call(this,"insert-row");else if("insertColumn"===e)Go.call(this,"insert-column");else if("link"===e){if(this.canvas.isImageOnSelected())return void this.canvas.link(this.data);var O=this.selector.range,E=this.hyperlink.getSelectArea(O),R=this.hyperlink.findByArea(this.data,E),I="edit";if(!R){(R={}).area=E;var A=this.data.getCell(O.sri,O.sci);R.text=A?A.text:"",I="add"}o.setValue(xs.datas.map((function(e){return e.name})),R,I)}else n.setSelectedCellAttr(e,t),"formula"!==e||n.selector.multiple()||Ho.call(this),ko.call(this);i&&i()}function Jo(e,t,i){var n=e.selector,r=e.commentEditable,a=t.selector,o=a.ri,s=a.ci,l=o,c=s,h="";if(void 0!==t.comments){t.comments.sort((function(e,t){return e.row>t.row||e.row===t.row&&e.col>t.col?1:-1}));for(var u=0;u<t.comments.length;u++){var f=t.comments[u];if("previous"===i)(f.row<o||f.row===o&&f.col<s)&&(l=f.row,c=f.col,h=f.note);else if("next"===i&&(f.row>o||f.row===o&&f.col>s)){l=f.row,c=f.col,h=f.note;break}}}if(n.set(l,c),""!==h){var d=t.cellRectWithOutTransfer(l,c);r.col=c,r.row=l,r.onEdit=!1,r.setPosition(h,d)}}function $o(e,t,i,n){this.data.setAutoFilter(e,t,i,n),ko.call(this),this.data.updateConditionImageVisible()}function Qo(e,t){var i=new XMLHttpRequest;i.open("get",e,!0),i.responseType="blob",i.onload=function(){if(200===this.status){var e=this.response;es.call(this,e,t)}else alert("Download failed, please try again")},i.send()}function es(e,t){var i=document.createElement("a"),n=e;"string"==typeof e?i.target="_blank":n=window.URL.createObjectURL(e),i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),"string"!=typeof e&&window.URL.revokeObjectURL(n)}function ts(e){var t=Zo(e.target);return[e.changedTouches[0].pageX-t.left,e.changedTouches[0].pageY-t.top]}function is(){var e=this,t=this.selector,i=this.overlayerEl,n=this.rowResizer,r=this.colResizer,a=this.verticalScrollbar,s=this.horizontalScrollbar,l=this.editor,c=this.contextMenu,h=this.commentTip,u=this.commentEditable,d=this.toolbar,m=this.menubar,g=this.formulaBar,v=this.modalValidation,p=this.modalSort,y=this.modalDownload,b=this.modalLink,w=(this.hyperlink,this.modalInsertURLImage),x=this.modalSearch,C=this.sortFilter,_=this.canvas,S=this.el;function T(e,t){Lo.call(e),jo.call(e,t)}if(window.mobileAndTabletCheck()||i.on("mousemove",(function(t){po.call(e,t)})).on("mousedown",(function(t){Lo.call(e),2===t.buttons?(e.data.xyInSelectedRect(t.offsetX,t.offsetY)||jo.call(e,t),c.setPosition(t.offsetX,t.offsetY),t.stopPropagation()):2===t.detail?Ho.call(e):jo.call(e,t)})).on("mousewheel.stop",(function(t){yo.call(e,t)})).on("mouseout",(function(e){var t=e.offsetX;e.offsetY<=0&&r.hide(),t<=0&&n.hide()})),u.el.on("input",(function(t){if(1===e.commentEditable.el.el.childNodes.length&&"#text"===e.commentEditable.el.el.childNodes[0].nodeName){var i=f("font");i.attr("style","FONT-FAMILY: 宋体;FONT-SIZE: 9pt;COLOR: #000000;TEXT-ALIGN: left;"),i.child(document.createTextNode(e.commentEditable.el.el.textContent)),e.commentEditable.el.el.replaceChild(i.el,e.commentEditable.el.el.firstChild),t.target.focus();var n=window.getSelection();n.selectAllChildren(t.target),n.collapseToEnd()}})),t.inputChange=function(t){Vo.call(e,t,"input"),Ho.call(e),Uo.call(e)},g.inputChange=function(t){Vo.call(e,t,"input"),Ho.call(e,!1)},g.enter=function(t,i){if(t.altKey){l.insertTextNewLine(t);var n=i?t.target.innerHTML:t.target.innerText;Vo.call(e,n,"input"),Ho.call(e,!1)}else l.clear(),vo.call(e,!1,t.shiftKey?"up":"down"),e.focusing=!0;t.preventDefault()},g.tab=function(t){l.clear(),vo.call(e,!1,t.shiftKey?"left":"right"),e.focusing=!0,t.preventDefault()},g.focuson=function(){e.focusing=!1},Te(S.el,"mousemove",(function(t){h.hide();var i=t.offsetX,n=t.offsetY,r=e.data,a=e.table,o=e.hyperlink,s=e.canvas,l=r.comments,c=a.zoomlevel,u=r.getCellRectByXY(i/c,n/c);if(0!==r.hyperlinks.length){var f=o.getSelectArea({sci:u.ci,eci:u.ci,sri:u.ri,eri:u.ri});o.findByArea(r,f)?s.setCursor("pointer"):s.setCursor("")}u.ri>=0&&u.ci>=0&&l.forEach((function(e){u.ri===e.row&&u.ci===e.col&&h.setPosition(e.note,u,r.displayRight2Left)}))})),window.mobileAndTabletCheck()){var O,E=this,R=!1,I=!1,A=function(){return R&&I},D=this.getTableOffset(),P="",F=[0,0],M=[0,0],L=[0,0],j=[0,0],z=!1,B=(E.table.zoomlevel,{});B.__proto__=lo.prototype,lo.call(B,this.el.el,{tap:function(e){},touchStart:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){!function(e,t){e.target.className.includes("item")||t.contextMenu.hide()}(e,E);var t=function(e,t){var i,n=e.target.className.includes("".concat(ae,"-selector-corner")),r=e.target.className.includes("tl")?"tl":"br",a=[],o=[],s=!1;return n&&(i=Zo(e.target.offsetParent.offsetParent),a[0]=e.changedTouches[0].pageX,a[1]=e.changedTouches[0].pageY,o[0]=t.data.scroll.x,o[1]=t.data.scroll.y,s=!0),[r,i,a,o,s]}(e,E),i=o()(t,5);P=i[0],O=i[1],F=i[2],L=i[3],(R=i[4])&&(z=!1,console.info("#####touchStart ..that.data.scroll.y...... "+E.data.scroll.y+",startscroll[0]:"+L[0]),L[0]=E.data.scroll.x,L[1]=E.data.scroll.y,E.selector.setMobilestartOffsetAndRange())}},touchEnd:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)&&A()){var i=M[0]-F[0]+E.data.scroll.x-L[0],n=M[1]-F[1]+E.data.scroll.y-L[1];t.setMobileMultipleSelect(i,n),function(e,t,i,n){if(t&&i){var r=e.br.areaEl.el.getBoundingClientRect(),a=r.right>window.screen.width?window.screen.width:r.right,o=r.top-i.top+n.top;o=o>window.screen.height?window.screen.height:o,c.setPosition(a,o)}}(t,!0,O,D);var r=(De(),[!1,!1,!1]),a=o()(r,3);R=a[0],I=a[1],z=a[2],E.table.render()}},doubleTap:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)&&"CANVAS"===e.target.nodeName){var t=ts(e),i=o()(t,2);e.offsetX=i[0],e.offsetY=i[1],window.mobileEditOnCell=!0,T(E,e),Ho.call(E)}},longTap:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){var t=ts(e),i=o()(t,2),n=i[0],r=i[1];c.setPosition(n,r)}},singleTap:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable||"CANVAS"!==e.target.nodeName||function(e){return e.target.className.includes("item")}(e))){var i=ts(e),n=o()(i,2);e.offsetX=n[0],e.offsetY=n[1],window.mobileEditOnCell=!0,T(E,e),t.br.useHideInput=!1,window.keyboardShow?(t.br.useHideInput=!0,Ho.call(E)):function(e,t){var i=ts(e),n=o()(i,2),r=n[0],a=n[1];if(e.target.className.includes("".concat(ae,"-selector-corner"))){var s=Zo(e.target);r=s.left,a=s.top}var l=r<=t.left&&a>=t.top,h=r>=t.left&&a<=t.top;if(l||h){var u=l?t.left:r,f=h?t.top:a;c.setPosition(u,f)}}(e,D)}},rotate:function(e){},pinch:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){E.editor.el.hide();var t=e.zoom;t>2&&(t=2),t<.5&&(t=.5),E.setzoom(t)}},pressMove:function(e){if(!(e.target.parentElement&&"true"===e.target.parentElement.contentEditable||"true"===e.target.contentEditable)){var t=E.selector;E.data;if(I=!0,A()){switch(function(e,t,i,n,r){e[0]=n.changedTouches[0].pageX,e[1]=n.changedTouches[0].pageY,t[0]=i.data.scroll.x,t[1]=i.data.scroll.y}(M,j,E,e),P){case"tl":break;case"br":var i=M[0]-F[0],n=M[1]-F[1];t.setEndMobile(i,n);var r=t.getMobileMultipleSelect(i,n),a=o()(r,2),s=a[0],l=a[1];s>=E.data.viewRange().eri-4&&!z&&(z=!0,t.setEnd(s,l),function(e,t){""!==e?Pe(t):De()}("down",E))}}else Math.abs(e.deltaX)>Math.abs(e.deltaY)?Math.abs(e.deltaX)>18&&(E.scrollH(e.deltaX),E.table.render()):Math.abs(e.deltaY)>18&&(E.scrollV(e.deltaY),E.table.render())}},swipe:function(e){}})}d.change=function(t,i){return Ko.call(e,t,i)},m.change=function(t,i){return Ko.call(e,t,i,(function(){return m.hideDropdown()}))},C.ok=function(t,i,n,r){return $o.call(e,t,i,n,r)},n.finishedFn=function(t,i){qo.call(e,t,i)},r.finishedFn=function(t,i){Yo.call(e,t,i)},n.unhideFn=function(t){Ro.call(e,"row",t)},r.unhideFn=function(t){Ro.call(e,"col",t)},a.moveFn=function(t,i){Xo.call(e,t,i)},s.moveFn=function(t,i){Wo.call(e,t,i)},l.change=function(t,i){Vo.call(e,i,t),Uo.call(e)},l.textboxChange=function(t,i){var n=e.data;e.table;n.updateTextbox(t,i)},v.change=function(t){if("save"===t){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];(i=e.data).addValidation.apply(i,r)}else e.data.removeValidation()},p.change=function(t,i,n,r){"ok"===t&&e.data.doSort(i,n,r)},y.change=function(t,i,n){"ok"===t&&Po.call(e,i,n)},b.change=function(t,i,n){"ok"===t&&(e.canvas.isImageOnSelected()?e.canvas.setHyperlink(i):"add"===n&&(e.data.hyperlinks=e.data.hyperlinks.filter((function(e){return!k.valueOf(i.area).contains(k.valueOf(e.area))})),e.data.hyperlinks.push(i),e.hyperlink.setHyperlinkStyleByArea(i.area,e,!0),e.hyperlink.loadLinkPosition(e)))},w.change=function(t,i){var n=e.canvas,r=e;if("ok"===t){var a=r.data.getSelectedRect();n.setLoading(r,{top:a.top,left:a.left});var o={ri:e.data.selector.ri,ci:e.data.selector.ci,name:e.data.name},s={p:JSON.stringify(o),uid:r.uniqueid,imageurl:i};$.ajax({url:r.imageUploadByUrlUrl,type:"post",data:s,success:function(e,t,i){(e=JSON.parse(e)).Error?le("error",e.Error):n.doInsertURLImage(e,r)}})}},$("#upload-image").on("change",(function(t){var i=t.target.files[0];e.canvas.imageOperationList.paste.uploadImg(e,i),t.target.value=null})),x.change=function(i,n,r,a,o){if("close"!==i){r||(n=n.toUpperCase());var s=e.data,l=s.search,c=s.rows,h=s.comments,f=l.keywords,d=[];if(null!=l.result&&f===n&&l.iscasesense===r&&l.lookin===a&&l.matchwhole===o)d=l.result;else{var m=c.len>0?c._:{},g=null;if("comments"===a){for(var v=document.createElement("c"),p=0,y=h.length;p<y;p++)if(v.innerHTML=h[p].note,g=r?v.innerText:v.innerText.toUpperCase(),!o&&-1!==g.indexOf(n)||o&&g===n){var b={ri:h[p].row,ci:h[p].col};b.cmt=h[p],d.push(b)}}else for(var w in m){var x=m[w].cells;for(var k in x)if("values"===a?g=r?x[k].text:x[k].text.toUpperCase():"formulas"===a&&(g=void 0!==x[k].f?r?x[k].f:x[k].f.toUpperCase():null),null!=g&&(o&&g===n||!o&&-1!==g.indexOf(n))){var C={ri:w,ci:k};d.push(C)}}l.keywords=n,l.lookin=a,l.matchwhole=o,l.iscasesense=r,l.result=d}if(0===d.length)return void alert("We couldn't find what you were looking for.");var _=-1,S=Number(t.indexes[0]),T=Number(t.indexes[1]),O=d.length-1;if(1===d.length)_=0;else if("next"===i){for(var E=0,R=d.length;E<R;E++){if(Number(d[E].ri)===S&&Number(d[E].ci)>T){_=E;break}if(Number(d[E].ri)>S){_=E;break}}-1===_&&(_=0)}else{for(var I=O;I>=0;I--){if(Number(d[I].ri)===S&&Number(d[I].ci)<T){_=I;break}if(Number(d[I].ri)<S){_=I;break}}-1===_&&(_=O)}l.current=_;var A=d[_];if(t.set(A.ri,A.ci),d[_].cmt){var D=A.cmt.note;if(""!==D){var P=s.cellRectWithOutTransfer(A.ri,A.ci);u.col=A.ci,u.row=A.ri,u.onEdit=!1,u.setPosition(D,P)}}mo.call(e)}},c.showMenuBefore=function(t){var i=o()(e.selector.indexes,2),n=i[0],r=i[1],a=!1;if(t.forEach((function(e){return e.show()})),e.canvas.isImageOnSelected()){if(t.forEach((function(e){-1===["copy","cut","paste","link"].indexOf(e.key)&&e.hide()})),e.canvas.checkHyperlink(e.canvas.fabric))return;e.canvas.validType(e.canvas.fabric,"type","Chart")&&(a=!0)}if(!e.hyperlink.check(e.data,n,r)){var s=null;if(t.forEach((function(e){a&&"link"===e.key&&(s.hide(),e.hide()),"openLink"===e.key&&e.hide(),"removeLink"===e.key&&e.hide(),s=e})),window.mobileAndTabletCheck()){var l=["edit","cut","copy","paste","merge","unmerge","clear"].map((function(e){return U("contextmenu.".concat(e))}));t.forEach((function(t){l.includes(t.el.innerText)||t.hide(),t.el.className.includes("divider")&&t.hide(),e.data.merges.equals(e.selector.range)&&t.el.innerText===U("contextmenu.merge")&&t.hide(),e.data.merges.equals(e.selector.range)||t.el.innerText!==U("contextmenu.unmerge")||t.hide()}))}}},c.itemClick=function(t){if("validation"===t)v.setValue(e.data.getSelectedValidation());else if("sort"===t)p.setValue(e.data.getSelectedSort());else if("download"===t)y.setValue(e.filename);else if("link"===t){if(e.canvas.isImageOnSelected())return void e.canvas.link(e.data);var i=e.selector.range,n=e.hyperlink.getSelectArea(i),r=e.hyperlink.findByArea(e.data,n),a="edit";if(!r){(r={}).area=n;var o=e.data.getCell(i.sri,i.sci);r.text=o?o.text:"",a="add"}b.setValue(xs.datas.map((function(e){return e.name})),r,a)}else"removeLink"===t?e.canvas.isImageOnSelected()?e.canvas.removeLink(e.data):e.hyperlink.removeByRange(e.selector.range,e):"openLink"===t?e.canvas.isImageOnSelected()?e.canvas.openLink(e.data):e.hyperlink.accessByRange(e.selector.range,e.data):"copy"===t?(_o.call(e),e.canvas.doOperation("copy")):"cut"===t?(So.call(e),e.canvas.doOperation("copy"),e.canvas.doOperation("delete")):"paste"===t?_.clipboard?e.canvas.doOperation("paste"):Oo.call(e,"all"):"paste-value"===t?Oo.call(e,"text"):"paste-format"===t?Oo.call(e,"format"):"hide"===t?Eo.call(e):"delete-image"===t?e.canvas.doOperation("delete"):"merge"===t?(e.data.setSelectedCellAttr(t,!0),e.table.render()):"unmerge"===t?(e.data.setSelectedCellAttr("merge",!1),e.table.render()):"edit"===t?Ho.call(e):Go.call(e,t)},Te(window,"resize",(function(){window.mobileAndTabletCheck()||e.reload()})),Te(window,"click",(function(e){})),Te(window,"paste",(function(t){e.focusing&&"commentEdit"!==t.target.parentElement.id&&(t.target.parentElement.parentElement&&"commentEdit"===t.target.parentElement.parentElement.id||"x-spreadsheet-form-input"!==t.target.parentElement.className&&(Oo.call(e,"all",t),t.preventDefault()))})),Te(window,"keydown",(function(t){if(e.focusing&&"commentEdit"!==t.target.id&&"x-spreadsheet-form-input"!==t.target.parentElement.className){var i=t.keyCode||t.which,n=t.key,r=t.ctrlKey,a=t.shiftKey,o=t.metaKey;if(r||o)switch(i){case 90:e.undo(),t.preventDefault();break;case 89:e.redo(),t.preventDefault();break;case 67:_o.call(e),_.doOperation("copy"),t.preventDefault();break;case 88:So.call(e),t.preventDefault();break;case 85:d.trigger("underline"),t.preventDefault();break;case 86:_.clipboard?_.doOperation("paste"):Oo.call(e,"all"),t.preventDefault();break;case 37:vo.call(e,a,"row-first"),t.preventDefault();break;case 38:vo.call(e,a,"col-first"),t.preventDefault();break;case 39:vo.call(e,a,"row-last"),t.preventDefault();break;case 40:vo.call(e,a,"col-last"),t.preventDefault();break;case 32:go.call(e,!1,-1,e.data.selector.ci,!1),t.preventDefault();break;case 66:d.trigger("bold");break;case 73:d.trigger("italic")}else{switch(i){case 32:a&&go.call(e,!1,e.data.selector.ri,-1,!1);break;case 27:c.hide(),h.hide(),Co.call(e);break;case 37:vo.call(e,a,"left"),t.preventDefault();break;case 38:vo.call(e,a,"up"),t.preventDefault();break;case 39:vo.call(e,a,"right"),t.preventDefault();break;case 40:vo.call(e,a,"down"),t.preventDefault();break;case 9:l.clear(),vo.call(e,!1,a?"left":"right"),t.preventDefault();break;case 13:l.clear(),vo.call(e,!1,a?"up":"down"),t.preventDefault();break;case 8:Go.call(e,"delete-cell-text"),t.preventDefault()}"Delete"===n?(Go.call(e,"delete-cell-text"),_.doOperation("delete"),t.preventDefault()):i>=65&&i<=90||i>=48&&i<=57||i>=96&&i<=105||"="===t.key?(Vo.call(e,t.key,"input"),Ho.call(e),Uo.call(e)):113===i&&Ho.call(e)}}}))}oo.prototype.add=function(e){this.handlers.push(e)},oo.prototype.del=function(e){e||(this.handlers=[]);for(var t=this.handlers.length;t>=0;t--)this.handlers[t]===e&&this.handlers.splice(t,1)},oo.prototype.dispatch=function(){for(var e=0,t=this.handlers.length;e<t;e++){var i=this.handlers[e];"function"==typeof i&&i.apply(this.el,arguments)}},lo.prototype={start:function(e){if(e.touches){this.now=Date.now(),this.x1=e.touches[0].pageX,this.y1=e.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(e,this.element),null!==this.preTapPosition.x&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var t=this.preV;if(e.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var i={x:e.touches[1].pageX-this.x1,y:e.touches[1].pageY-this.y1};t.x=i.x,t.y=i.y,this.pinchStartLen=ro(t),this.multipointStart.dispatch(e,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout(function(){this._inZoom||(this.longTap.dispatch(e,this.element),this._preventTap=!0)}.bind(this),750)}},move:function(e){if(e.touches){var t=this.preV,i=e.touches.length,n=e.touches[0].pageX,r=e.touches[0].pageY;if(this.isDoubleTap=!1,i>1){var a=e.touches[1].pageX,o=e.touches[1].pageY,s={x:e.touches[1].pageX-n,y:e.touches[1].pageY-r};null!==t.x&&(this.pinchStartLen>0&&(e.zoom=ro(s)/this.pinchStartLen,this.pinch.dispatch(e,this.element),this._preventTap=!0,this._inZoom=!0),e.angle=ao(s,t),this.rotate.dispatch(e,this.element)),t.x=s.x,t.y=s.y,null!==this.x2&&null!==this.sx2?(e.deltaX=(n-this.x2+a-this.sx2)/2,e.deltaY=(r-this.y2+o-this.sy2)/2):(e.deltaX=0,e.deltaY=0),this.twoFingerPressMove.dispatch(e,this.element),this.sx2=a,this.sy2=o}else{if(null!==this.x2){e.deltaX=n-this.x2,e.deltaY=r-this.y2;var l=Math.abs(this.x1-this.x2),c=Math.abs(this.y1-this.y2);(l>10||c>10)&&(this._preventTap=!0)}else e.deltaX=0,e.deltaY=0;this.pressMove.dispatch(e,this.element)}this.touchMove.dispatch(e,this.element),this._cancelLongTap(),this.x2=n,this.y2=r,i>1&&e.preventDefault()}},end:function(e){if(e.changedTouches){this._cancelLongTap();var t=this;e.touches.length<2&&(this.multipointEnd.dispatch(e,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(e.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){t.swipe.dispatch(e,t.element)}),0)):(this.tapTimeout=setTimeout((function(){t._preventTap||t.tap.dispatch(e,t.element),t.isDoubleTap&&(t.doubleTap.dispatch(e,t.element),t.isDoubleTap=!1)}),0),t.isDoubleTap||t._preventTap||(t.singleTapTimeout=setTimeout((function(){t.singleTap.dispatch(e,t.element)}),250))),this.touchEnd.dispatch(e,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}},cancelAll:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)},cancel:function(e){this.cancelAll(),this.touchCancel.dispatch(e,this.element)},_cancelLongTap:function(){clearTimeout(this.longTapTimeout)},_cancelSingleTap:function(){clearTimeout(this.singleTapTimeout)},_swipeDirection:function(e,t,i,n){return Math.abs(e-t)>=Math.abs(i-n)?e-t>0?"Left":"Right":i-n>0?"Up":"Down"},on:function(e,t){this[e]&&this[e].add(t)},off:function(e,t){this[e]&&this[e].del(t)},destroy:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}};var ns=function(){function e(t,i){var n=this;l()(this,e),this.eventMap=new Map;var r=i.settings,a=r.view,o=r.showToolbar,s=r.showFileName,c=r.showContextmenu,h=r.mode,u=r.showPartToolbar,d=r.contextMenuItems,m=r.local;this.el=f("div","".concat(ae,"-sheet")),this.menubar=new no(i,a.width,!o,u,s,this,m),this.toolbar=new Er(i,a.width,!o,u),this.formulaBar=new Zr(i,h),this.canvas=new Sa,this.print=new Ci(i,this.canvas),this.hyperlink=new Va,t.children(this.menubar.el,this.toolbar.el,this.formulaBar.el,this.el,this.print.el),this.data=i,this.tableEl=f("canvas","".concat(ae,"-table"));var g=i.settings.row.height;this.rowResizer=new Me(!1,g,this),this.colResizer=new Me(!0,i.cols.minWidth,this),this.verticalScrollbar=new Le(!0),this.horizontalScrollbar=new Le(!1),this.editor=new mi(ut,(function(){return n.getTableOffset()}),g,this),this.modalValidation=new jr,this.modalSort=new Hr,this.modalDownload=new $a,this.modalLink=new eo,this.modalSearch=new Gr,this.modalInsertURLImage=new Oa,this.contextMenu=new Ei((function(){return n.getRect()}),this,!c,d),this.commentTip=new Yr,this.commentEditable=new Jr,this.selector=new $e(i),this.highlight=new Ka(this),this.overlayerCEl=f("div","".concat(ae,"-overlayer-content")).children(this.editor.el,this.selector.el),this.overlayerEl=f("div","".concat(ae,"-overlayer")).children(this.overlayerCEl,this.canvas),this.sortFilter=new qr,this.el.children(this.tableEl,this.overlayerEl.el,this.rowResizer.el,this.colResizer.el,this.verticalScrollbar.el,this.horizontalScrollbar.el,this.contextMenu.el,this.commentTip.el,this.commentEditable.el,this.modalValidation.el,this.modalSort.el,this.modalDownload.el,this.modalLink.el,this.modalSearch.el,this.modalInsertURLImage.el,this.sortFilter.el),this.table=new ai(this.tableEl.el,i),is.call(this),ko.call(this),go.call(this,!1,0,0),this.canvas.init(this),this.imageUploadByLocalUrl=null,this.imageUploadByUrlUrl=null,this.reloadUrl=null,this.fileDownloadUrl=null,this.oleDownloadUrl=null,this.uniqueid="",this.filename=""}var t;return r()(e,[{key:"setReloadUrl",value:function(e){this.reloadUrl=e}},{key:"getReloadUrl",value:function(){return this.reloadUrl+"?filename="+this.filename+"&uid="+this.uniqueid}},{key:"on",value:function(e,t){return this.eventMap.set(e,t),this}},{key:"preMousedown",value:function(){Lo.call(this)}},{key:"trigger",value:function(e){var t=this.eventMap;if(t.has(e)){for(var i,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];(i=t.get(e)).call.apply(i,[this].concat(r))}}},{key:"resetData",value:function(e){this.editor.clear(),this.data=e,bo.call(this),wo.call(this);var t=this.getTableOffset();this.overlayerCEl.offset(t),e.displayRight2Left?this.overlayerCEl.el.setAttribute("dir","rtl"):this.overlayerCEl.el.removeAttribute("dir"),this.data.topOrder=0,this.toolbar.resetData(e),this.formulaBar.resetData(e),this.print.resetData(e),this.selector.resetData(e),this.table.resetData(e),this.canvas.reset(e),this.data.updateConditionImageDirection(),this.data.reloadImagesShapes(),this.hyperlink.loadLinkPosition(this);var i=this.highlight;setTimeout((function(){i.AutoShowOrHide()}),2e3)}},{key:"loadData",value:function(e){return this.data.setData(e),ko.call(this),this}},{key:"scrollV",value:function(e){var t=this.verticalScrollbar.scroll().top;this.verticalScrollbar.move({top:t-e})}},{key:"scrollToRow",value:function(e){var t=this.verticalScrollbar.scroll().top,i=this.data.viewRange().sri,n=e>i?-this.data.rows.sumHeight(i,e):this.data.rows.sumHeight(e,i);this.verticalScrollbar.move({top:t-n})}},{key:"scrollH",value:function(e){var t=this.horizontalScrollbar.scroll().left;this.horizontalScrollbar.move({left:t-e})}},{key:"selectMoveDown",value:function(){vo.call(this,!0,"down")}},{key:"freeze",value:function(e,t){var i=this.data;return this.canvas.doResetPosition(e,t),i.setFreeze(e,t),ko.call(this),this}},{key:"setActiveCell",value:function(e,t){return go.call(this,!1,e,t),this.focusing=!0,this}},{key:"setEditForTextBox",value:function(e){return No.call(this,e),this}},{key:"undo",value:function(){this.data.undo(),ko.call(this)}},{key:"redo",value:function(){this.data.redo(),ko.call(this)}},{key:"reload",value:function(){return ko.call(this),this}},{key:"setzoom",value:function(e){var t=this.data,i=this.table,n=this.canvas,r=this.selector;i.zoomlevel=e,t.zoomlevel=e;this.getTableOffset();1!==this.data.zoomlevel&&(r.br.useHideInput=!1),this.data.zoomlevel<1&&!window.mobileAndTabletCheck()&&(this.overlayerCEl.el.style.width="".concat(this.overlayerCEl.el.clientWidth/e,"px"),this.overlayerCEl.el.style.height="".concat(this.overlayerCEl.el.clientHeight/e,"px")),n.setZoom(e),ko.call(this),1!==this.data.zoomlevel&&(r.br.useHideInput=!0),t.updateConditionImageZoom()}},{key:"showHighlights",value:function(e){this.highlight.showHighlights(e)}},{key:"hideHighlights",value:function(){this.highlight.hideHighlights()}},{key:"getHighlightTexts",value:function(){return this.highlight.getHighlightTexts()}},{key:"addHighlightText",value:function(e,t,i,n){this.highlight.addHighlightText(e,t,i,n)}},{key:"removeHighlightText",value:function(e,t,i,n){this.highlight.removeHighlightText(e,t,i,n)}},{key:"getHighlightRanges",value:function(){return this.highlight.getHighlightRanges()}},{key:"addHighlightRange",value:function(e,t,i,n){this.highlight.addHighlightRange(e,t,i,n)}},{key:"removeHighlightRange",value:function(e,t,i,n){this.highlight.removeHighlightRange(e,t,i,n)}},{key:"setHighlightInverseRange",value:function(e,t,i,n){this.highlight.setHighlightInverseRange(e,t,i,n)}},{key:"getHighlightInverseRange",value:function(){return this.highlight.getHighlightInverseRange()}},{key:"removeHighlightInverseRange",value:function(){this.highlight.removeHighlightInverseRange()}},{key:"getHighlightShaps",value:function(){return this.highlight.getHighlightShaps()}},{key:"addHighlightShape",value:function(e){this.highlight.addHighlightShape(e)}},{key:"removeHighlightShape",value:function(e){this.highlight.removeHighlightShape(e)}},{key:"addHighlightTextBox",value:function(e,t,i){var n=this.data,r=(this.table,this.highlight,n.shapes.find((function(t){return t.id===e})));r?"TextBox"===r.type?(this.addHighlightShape(e),r.addHighlight(t,i)):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"removeHighlightTextBox",value:function(e,t,i){var n=this.data,r=(this.table,n.shapes.find((function(t){return t.id===e})));r?"TextBox"===r.type?-1!==n.highlighshapes.indexOf(e)&&r.removeHighlight(t,i):console.error("shape is not textbox"):console.error("shape does not exist")}},{key:"getHighlightImages",value:function(){return this.highlight.getHighlightImages()}},{key:"addHighlightImage",value:function(e){this.highlight.addHighlightImage(e)}},{key:"removeHighlightImage",value:function(e){this.highlight.removeHighlightImage(e)}},{key:"setHighlightAll",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.highlight;i.setHighlightAll(e,t)}},{key:"setCustomHighlightImgFunc",value:function(e){this.highlight.setCustomHighlightImgFunc(e)}},{key:"getImageContextMenuItems",value:function(){return this.contextMenu.getImageContextMenuItems()}},{key:"addImageContextMenuItems",value:function(e){this.contextMenu.addImageContextMenuItems(e)}},{key:"delImageContextMenuItems",value:function(e){this.contextMenu.delImageContextMenuItems(e)}},{key:"getCustomContextMenuItems",value:function(){return this.contextMenu.getCutomContextMenuItems()}},{key:"addCustomContextMenuItems",value:function(e){this.contextMenu.addCutomContextMenuItems(e)}},{key:"insertCustomContextMenuItem",value:function(e,t){this.contextMenu.insertCutomContextMenuItem(e,t)}},{key:"updateCustomContextMenuItem",value:function(e,t){this.contextMenu.updateCutomContextMenuItem(e,t)}},{key:"delCustomContextMenuItems",value:function(e){this.contextMenu.delCutomContextMenuItems(e)}},{key:"getOle",value:(t=be()(Ce.a.mark((function e(t){var i;return Ce.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this.oleDownloadUrl+"?id="+t+"&uid="+this.uniqueid+"&sheet="+this.data.name,es.call(this,i);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getRect",value:function(){var e=this.data;return{width:e.viewWidth(),height:e.viewHeight()}}},{key:"getTableOffset",value:function(){var e=this.data,t=e.rows,i=e.cols,n=e.displayRight2Left,r=this.table.zoomlevel,a=this.data.settings.row.height,o=this.getRect(),s=o.width,l=o.height;return{width:(s-i.indexWidth)*r,height:(l-t.height)*r,left:n?0:i.indexWidth*r,top:a*r}}}]),e}();function rs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=re()(e);if(t){var r=re()(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ie()(this,i)}}var as=function(e){ee()(i,e);var t=rs(i);function i(e){var n;l()(this,i);var r=new se("ellipsis");return(n=t.call(this,r,"auto",!1,"top-left")).contentClick=e,n}return r()(i,[{key:"reset",value:function(e){var t=this,i=e.map((function(e,i){return f("div","".concat(ae,"-item")).css("width","150px").css("font-weight","normal").on("click",(function(){t.contentClick(i),t.hide()})).child(e)}));this.setContentChildren.apply(this,m()(i))}},{key:"setTitle",value:function(){}}]),i}(Mi),os=function(e){ee()(i,e);var t=rs(i);function i(e){var n;l()(this,i);var r=new se("pagination");return(n=t.call(this,r,"100px",!1,"top-left")).contentEl.css("max-height","298px"),n.contentEl.css("overflow-y","auto"),n.contentClick=e,n}return r()(i,[{key:"reset",value:function(e){var t=this,i=e.map((function(e,i){return f("div","".concat(ae,"-item")).css("width","auto").css("font-weight","normal").on("click",(function(){t.contentClick(i),t.hide()})).child(e)}));this.setContentChildren.apply(this,m()(i))}}]),i}(Mi),ss=[{key:"delete",title:X("contextmenu.deleteSheet")}];function ls(e){var t=this;return f("div","".concat(ae,"-item")).child(e.title()).on("click",(function(){t.itemClick(e.key),t.hide()}))}function cs(){var e=this;return ss.map((function(t){return ls.call(e,t)}))}var hs=function(){function e(){var t;l()(this,e),this.el=(t=f("div","".concat(ae,"-contextmenu")).css("width","160px")).children.apply(t,m()(cs.call(this))).hide(),this.itemClick=function(){}}return r()(e,[{key:"hide",value:function(){var e=this.el;e.hide(),Ee(e)}},{key:"setOffset",value:function(e){var t=this.el;t.offset(e),t.show(),Re(t)}}]),e}(),us=function(){function e(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},s=arguments.length>5?arguments[5]:void 0;l()(this,e),this.settings=s,this.addFunc=i,this.swapFunc=n,this.updateFunc=a,this.scrollFunc=o,this.dataNames=[],this.activeEl=null,this.deleteEl=null,this.items=[],this.moreEl=new as((function(e){t.clickSwap2(t.items[e])})),this.paginationEl=new os((function(e){t.scrollFunc(e)})),this.contextMenu=new hs,this.contextMenu.itemClick=r,this.el=f("div","".concat(ae,"-bottombar")).children(this.contextMenu.el,this.menuEl=this.setMenuEl())}return r()(e,[{key:"setMenuEl",value:function(){var e=this;return"edit"===this.settings.mode?f("ul","".concat(ae,"-menu")).child(f("li","").children(new se("add").on("click",(function(){e.dataNames.length<10?e.addFunc():le("Warning","It is less than or equal to 10")})),f("span","").child(this.moreEl))):f("ul","".concat(ae,"-menu")).child(f("li","").children(f("span","").child(this.moreEl)))}},{key:"addItem",value:function(e,t,i,n){this.dataNames.push(e);var r=f("li",t?"active":"").child(e);void 0!==i&&(r.el.style.color=n,r.el.style.backgroundColor=i),this.setItemEvent(r),t&&this.clickSwap(r),this.items.push(r),this.menuEl.child(r),this.moreEl.reset(this.dataNames)}},{key:"addPagination",value:function(e){for(var t=[],i=1;i<=e;i++){var n=i+"";t.push(n)}this.paginationEl.reset(t)}},{key:"setItemEvent",value:function(e){var t=this;"edit"===this.settings.mode?e.on("click",(function(){t.clickSwap2(e)})).on("contextmenu",(function(i){var n=i.target,r=n.offsetLeft,a=n.offsetHeight;t.contextMenu.setOffset({left:r,bottom:a+1}),t.deleteEl=e})).on("dblclick",(function(){if(!(e.el.children.length>0)){var i=e.html(),n=new Ir("auto","",31);n.val(i),n.input.on("blur",(function(e){var r=e.target.value,a=t.dataNames.findIndex((function(e){return e===i}));t.renameItem(a,r,n)})),e.html("").child(n.el),n.focus()}})):e.on("click",(function(){t.clickSwap2(e)}))}},{key:"renameItem",value:function(e,t,i){if(this.dataNames[e]!==t&&0!==t.length)if(t.length>31)le("Error","The max length of the sheet name is 31",(function(){i.focus()}));else if(this.dataNames.indexOf(t)>=0)le("Error","Same worksheet name already exist",(function(){i.focus()}));else{for(var n=0;n<t.length;n++)switch(t[n]){case":":case"\\":case"/":case"?":case"*":case"[":case"]":return void le("Error","Worksheet name could not contain any following characters : : \\ / ? * [ or ]",(function(){i.focus()}))}this.dataNames.splice(e,1,t),this.moreEl.reset(this.dataNames),this.items[e].html("").child(t),this.updateFunc(e,t)}else this.items[e].html("").child(t)}},{key:"clear",value:function(){var e=this;this.items.forEach((function(t){e.menuEl.removeChild(t.el)})),this.items=[],this.dataNames=[],this.moreEl.reset(this.dataNames)}},{key:"hide",value:function(){var e=this.el;e.hide(),Ee(e)}},{key:"deleteItem",value:function(){var e=this.activeEl,t=this.deleteEl;if(this.items.length>1){var i=this.items.findIndex((function(e){return e===t}));if(this.items.splice(i,1),this.dataNames.splice(i,1),this.menuEl.removeChild(t.el),this.moreEl.reset(this.dataNames),e===t){var n=o()(this.items,1)[0];return this.activeEl=n,this.activeEl.toggle(),[i,0]}return[i,-1]}return[-1]}},{key:"clickSwap2",value:function(e){var t=this.items.findIndex((function(t){return t===e}));this.clickSwap(e),this.activeEl.toggle(),this.swapFunc(t)}},{key:"clickSwap",value:function(e){if(null!==this.activeEl){this.activeEl.toggle();var t=this.activeEl.el.style.backgroundColor;t&&(this.activeEl.el.style.backgroundColor=(i=t.match(/[\d.]+/g)).length>=3?"rgb("+i[0]+","+i[1]+","+i[2]+")":"")}var i;this.activeEl=e;var n=e.el.style.backgroundColor;n&&(this.activeEl.el.style.backgroundColor=function(e,t){var i=e.match(/[\d.]+/g);if(i.length>=3)return"rgba("+i[0]+","+i[1]+","+i[2]+","+t+")"}(n,.1))}},{key:"setDirection",value:function(e){e?this.el.attr("dir","rtl"):this.el.removeAttr("dir")}}]),e}();i(35);function fs(e){var t=[],i=0;this.run=function(e){var n=this;this.startHandler(e,(function(){i--,e.timestm,e.isfinish,t.length>0&&n.run(t.shift())}))},this.startHandler=function(n,r){var a=this;n.isfinish?t.length>0&&this.run(t.shift()):0!==i?setTimeout((function(){return a.startHandler(n,r)}),300):(i++,n.timestm,n.isfinish,e(n,r))},this.append=function(e){t.push(e),t.length,e.timestm,1===t.length&&this.run(e)},this.isFinish=function(){return 0===t.length&&0===i}}var ds=function e(t,i,n,r){l()(this,e),this.item=t,this.url=i,this.callback=n,this.callbackerror=r,this.isfinish=!1,this.timestm="["+(new Date).getTime()+"] "};function ms(e,t){var i=$.ajax({url:e.url,type:"post",dataType:"json",data:e.item});e.timestm,e.isfinish,i.done((function(i){e.timestm,e.callback&&(e.callback(i),e.isfinish=!0),t()})),i.fail((function(i,n,r){e.timestm,e.callbackerror&&(e.callbackerror(i,n,r),e.isfinish=!0),t()}))}function gs(e){e.scaleX=1,e.scaleY=1,e.originAngle=e.angle;var t=e.originAngle;t<0&&(t+=360),t>90&&t<180?t=180-t:t>=180&&t<270?t-=180:t>=270&&(t=360-t),t>=45&&(t=90-t);Math.sin(.017453293*t),Math.cos(.017453293*t);e.originWidth=e.width,e.originHeight=e.height,e.originLeft=e.left,e.originTop=e.top}function vs(e,t){if(e.lc&&!Array.isArray(e.lc)){var i=e.lc,n=i.indexOf(":");n>0&&(i=i.substr(0,n));var r=y(i=i.replaceAll("$","")),a=o()(r,2),s=a[0],l=a[1];t.data.setLinkedShape(l,s,e),e.lc=[l,s]}}function ps(e,t,i,n,r){var a,o,s;return{tick:e.tick,width:e.width,height:e.height,top:e.top+n.top/r,left:i+n.left/r,"z-index":t+e.zorder,originAngle:e.originAngle,rotate:e.angle,imgType:e.type,strid:e.strid,text:e.text,html:e.html,hyperlink:e.hyperlink,zorder:e.zorder,fromOutside:null!==(a=e.fromOutside)&&void 0!==a&&a,scaleX:null!==(o=e.scaleX)&&void 0!==o?o:1,scaleY:null!==(s=e.scaleY)&&void 0!==s?s:1}}var ys=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,e);var r=t;this.options=n,n.local&&q(n.local),this.sheetIndex=0,this.datas=[],this.uniqueid="",this.filename="",this.imageDiv=null,this.imageUrl=null,this.basicZorder=0,this.istestforimage=!1,this.buffer=new fs(ms),"string"==typeof t&&(r=document.querySelector(t)),window.mobileAndTabletCheck=function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t},window.mobileEditOnCell=!1,Fe((function(e){var t=i.sheet;t.data,t.selector,t.canvas,t.editor,t.verticalScrollbar;window.keyboardShow=!1,i.sheet.preMousedown(),i.reRender(),window.mobileEditOnCell=!1}),(function(e){window.keyboardShow=!0;var t=i.sheet,n=t.data;t.selector,t.editor,t.verticalScrollbar;window.mobileEditOnCell&&i.sheet.scrollToRow(n.selector.ri)})),this.bottombar=new us((function(){if(i.uniqueid.endsWith(".csv"))le("Warning","CSV file does not support more than one worksheet");else if(i.uniqueid.endsWith(".tsv"))le("Warning","TSV file does not support more than one worksheet");else{i.sheet.canvas.doNewSheetPage(i.sheet.data);var e=i.addSheet();e.showGrid=!0,i.sheet.resetData(e)}}),(function(e){var t=i.datas[e];t.scroll={ci:0,ri:0,riact:0,x:0,y:0,yact:0},i.sheet.canvas.doSwitchSheetPage(i.sheet.data),i.sheet.resetData(t),i.bottombar.setDirection(t.displayRight2Left),i.resetPagination(t),i.sheet.verticalScrollbar.move({top:0}),i.setZoomLevel(t.zoomlevel)}),(function(){i.deleteSheet()}),(function(e,t){i.renameSheet(e,t)}),(function(e){var t=e*i.data.settings.row.len,n=i.data.rows.sumHeight(0,t);i.sheet.verticalScrollbar.move({top:n-1})}),this.options),this.isloading=!0,this.data=this.addSheet(),this.isloading=!1,this.resetPagination(this.data);var a=f("div","".concat(ae)).on("contextmenu",(function(e){return e.preventDefault()}));r.appendChild(a.el),this.sheet=new ns(a,this.data),this.sheet.hyperlink.setActiveSheetBySheetName=function(e){i.setActiveSheetByName(e)},this.sheet.hyperlink.setActiveCell=function(e,t){i.setActiveCell(e,t)},this.sheet.addSheet=this.bottombar.addFunc,a.child(this.bottombar.el)}return r()(e,[{key:"setUniqueId",value:function(e){this.uniqueid=e,this.sheet.uniqueid=e}},{key:"setFileDownloadInfo",value:function(e){this.sheet.fileDownloadUrl=e}},{key:"setOleDownloadInfo",value:function(e){this.sheet.oleDownloadUrl=e}},{key:"setFileName",value:function(e){this.filename=e,this.sheet.filename=e,this.sheet.menubar.setFileName(e)}},{key:"setZoomLevel",value:function(e){this.sheet.setzoom(e)}},{key:"setReloadUrl",value:function(e){this.sheet.setReloadUrl(e)}},{key:"setVisibleFilter",value:function(e){this.sheet.visibleFilter=e}},{key:"setFileDownloadCallFunction",value:function(e){this.sheet.fileDownloadCallFunc=e}},{key:"setImageInfo",value:function(e,t,i,n,r,a,o){return this.imageDiv=e,this.imageUrl=t,this.sheet.imageUploadByLocalUrl=i,this.sheet.imageUploadByUrlUrl=n,this.sheet.imageCopyUrl=r,this.basicZorder=a,this.updating=o,this}},{key:"setImageForTest",value:function(e,t,i){return this.imageDiv=e,this.imageUrl=t,this.basicZorder=i,this.istestforimage=!0,this}},{key:"setDisplayRight2Left",value:function(e){var t=this.sheet,i=this.bottombar,n=t.data;if(n.displayRight2Left!==e){n.displayRight2Left=e;var r=t.getTableOffset();t.overlayerCEl.offset(r),t.resetData(n),i.setDirection(e)}}},{key:"getUpdateDatas",value:function(){for(var e=[],t=0,i=this.datas.length;t<i;t++){var n=this.datas[t].getDataForSave();null!=n&&e.push(n)}return e}},{key:"addSheet",value:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=e||"sheet".concat(this.sheetIndex),o=new pe(a,this.options);return o.rows.setCellText(0,0,""),o.change=function(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(e=t.sheet).trigger.apply(e,["change"].concat(n))},o.updateCellsData=function(e){var i=t.sheet.data,n=i.updateCellError,r=i.updateMyCells,a=t.uniqueid,o=t.imageUrl;if(e.Error)e.cell&&(r.call(t.sheet.data,[e.cell]),t.reRender()),e.cells&&(r.call(t.sheet.data,e.cells),t.reRender()),e.p&&(t.sheet.data.updateRevertOpr(e.p),t.reRender()),n(e.Error);else if("update"===e.op)e.data.forEach((function(e,i,n){for(var r=0,s=new Array;r<t.datas.length;r++)if(t.datas[r].name===e.name){t.datas[r].updateMyCells(e.cells),t.datas[r].updateShapes(e.shapes,s),t.datas[r].updateMyConditionImages(e.conditionimg);break}t.sheet.data.updateShapeSrcToRefresh(a,o,e.pickey,s)})),t.reRender();else if("sort"===e.op)e.rowids&&e.rowids.length>0&&(t.sheet.data.sortByRowIdArray(e.r,e.rowids),t.reRender());else if("updateTextBox"===e.op){for(var s=0;s<t.sheet.data.shapes.length;s++)if(t.sheet.data.shapes[s].strid===e.id){t.sheet.data.shapes[s].updateTextBox(e.html,e.rtxt);break}t.reRender()}},o.updateServerError=function(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(e=t.sheet).trigger.apply(e,["updateServerError"].concat(n))},o.updateCellError=function(){for(var e,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];(e=t.sheet).trigger.apply(e,["updateCellError"].concat(n))},o.updateCellServer=function(e){var i=t.sheet.data,n=i.settings,r=i.updateServerError,a=i.updateCellsData,o=t.uniqueid,s=t.buffer;if("server"===n.updateMode){var l={p:JSON.stringify(e),uid:o,folderName:n.folderName,fileName:n.fileName};s.append(new ds(l,n.updateUrl,(function(e){a(e)}),(function(e,t,i){r(e,t,i)})))}},o.menubarStatus=function(){return!t.sheet||"up"===t.sheet.toolbar.menuDisplay.state},o.loadImages=function(){var e=t.sheet.data,i=e.images,n=e.displayRight2Left,r=e.cols,a=n?t.sheet.data.viewWidth()-r.indexWidth:0,o=(t.uniqueid,t.imageDiv,t.imageUrl,t.basicZorder),s=t.sheet,l=t.updating;s.canvas.basicZorder=null!=o?o:s.canvas.basicZorder;var c=s.getTableOffset();null!=i&&i.forEach((function(e){if("del"!==e.op&&(!s.visibleFilter||s.visibleFilter(s,e))){var t=n?a-e.left-e.width:e.left;s.data.topOrder=s.data.topOrder<e.zorder?e.zorder:s.data.topOrder;var i=ps(e,o,t,c,s.table.zoomlevel);e.src?s.canvas.setImage(s,e,i,e.src):s.canvas.setImage(s,e,i,l)}}))},o.loadShapes=function(){var e=t.sheet.data,i=e.shapes,n=e.displayRight2Left,r=e.cols,a=n?t.sheet.data.viewWidth()-r.indexWidth:0,o=(t.uniqueid,t.imageDiv),s=(t.imageUrl,t.basicZorder),l=t.sheet,c=t.updating;l.canvas.basicZorder=null!=s?s:l.canvas.basicZorder;var h=l.getTableOffset();null!=i&&(i.forEach((function(e){if("del"!==e.op&&(!l.visibleFilter||l.visibleFilter(l,e))){var t=n?a-e.left-e.width:e.left;l.data.topOrder=l.data.topOrder<e.zorder?e.zorder:l.data.topOrder;var i=ps(e,s,t,h,l.table.zoomlevel);if(vs(e,l),"TextBox"===e.type)l.canvas.setTextBox(l,e,i);else if("CheckBox"===e.type){var r=document.createElement("div");r.style.position="absolute";var u=document.createElement("input");u.type="checkbox",u.id=e.strid;var f=document.createElement("label");f.appendChild(document.createTextNode(e.label)),r.appendChild(u),r.appendChild(f),o.append(r),e.control=r,l.canvas.setCheckBox(l,e,i)}else e.src?l.canvas.setImage(l,e,i,e.src):l.canvas.setImage(l,e,i,c)}})),l.canvas.inFreeze&&(l.canvas.saveCanvasData(l.data),l.canvas.inFreeze.loadFreezeImage()))},o.fillImageSrc=function(){var e=t.sheet.data,i=e.images,n=e.shapes,r=e.sheetid,a=e.isImageOk,o=t.uniqueid,s=(t.imageDiv,t.imageUrl);t.basicZorder;if(!a&&void 0!==r&&(null!=n&&n.length>0||null!=i&&i.length>0)){var l=t,c=t.istestforimage?s+"/"+o+"."+r+"_batch.zip":s+"?uid="+o+"&id="+r+"_batch.zip";t.istestforimage?l.sheet.data.generatePicItems(i,n,c):$.get(c,(function(e){l.sheet.data.generatePicItems(i,n,e)}))}},o.fillImageOnebyOne=function(e,i){var n=new XMLHttpRequest,r=t.sheet,a=setInterval((function(){r.data.loadCount<=0&&(r.data.isImageOk=!0,clearInterval(a))}),200);n.onreadystatechange=function(){if(4==n.readyState){var e=n.response,t=new Uint8Array(e);JSZip.loadAsync(t).then((function(e){i.forEach((function(t,i,n){e.file(t.name).async("blob").then((function(e){var i=URL.createObjectURL(e),n=r.canvas.fabric.getObjects().find((function(e){return e.id===t.id}));n&&"TextBox"!==n.imgType&&"CheckBox"!==n.imgType&&(n.setSrc(i,(function(e){0===r.data.loadCount&&r.canvas.inFreeze&&(r.canvas.saveCanvasData(r.data),r.canvas.inFreeze.loadFreezeImage())})),t.it.src=i),r.data.loadCount--}))}))}))}},n.open("GET",e,!0),n.responseType="arraybuffer",n.send()},o.loadConditionImage=function(){var e=t.sheet.data.conditionimg,i=t.imageDiv,n=t.basicZorder;e&&e.forEach((function(e){if(e.data){var t=o.createConditionImage(e,n);e.data=void 0,e.image=t,i.append(t)}else i.append(e.image)}))},o.insertConditionImage=function(e){var i=t.sheet.data.conditionimg,n=t.imageDiv,r=t.basicZorder;if(i)if(e.data){var a=o.createConditionImage(e,r);e.data=void 0,e.image=a,n.append(a),i.push(e)}else n.append(e.image)},o.reloadImagesShapes=function(){var e=t.imageDiv;null!=e&&(e.empty(),e.css("left",0),e.css("top",0),o.loadImages(),o.loadShapes(),o.loadConditionImage(),o.fillImageSrc())},o.scrollImagesShapes=function(){var e=t.imageDiv,i=t.sheet.canvas,n=t.sheet.data,r=n.scroll,a=n.displayRight2Left,o=n.zoomlevel;i.publishEvent("object:scroll",t.sheet.data),i.initFreeze(),null!=e&&(e.css("left",a?r.x*o:-r.x*o),e.css("top",-r.y*o))},this.datas.push(o),this.bottombar.addItem(a,i,n,r),this.sheetIndex+=1,this.isloading||this.sheet.data.addSheetOpr(a),o}},{key:"resetPagination",value:function(e){var t=e.rows.len,i=e.settings.row.len,n=t%i==0?t/i:Math.ceil(t/i);this.bottombar.addPagination(n)}},{key:"deleteSheet",value:function(){var e=this.bottombar.deleteItem(),t=o()(e,2),i=t[0],n=t[1];if(i>=0){var r=this.datas[i].name;this.sheet.data.delSheetOpr(r),this.datas.splice(i,1),n>=0&&this.sheet.resetData(this.datas[n])}}},{key:"renameSheet",value:function(e,t){var i=this.datas[e].name;this.datas[e].name=t,this.sheet.data.renameSheetOpr(i,t)}},{key:"loadData",value:function(e){this.isloading=!0;var t=Array.isArray(e)?e:[e];if(this.bottombar.clear(),this.datas=[],t.length>0)for(var i=0;i<t.length;i+=1){var n,r,a=t[i],s=this.addSheet(a.name,0===i,a.tabcolor,a.fontcolor);if(void 0!==a.merges)for(var l=0,c=a.merges.length;l<c;l++){var h=a.merges[l].split(":"),u=y(h[0]),f=o()(u,2),d=f[0],m=f[1],g=y(h[1]),v=o()(g,2),p=v[0],b=v[1];a.rows[m]&&a.rows[m].cells[d]&&(a.rows[m].cells[d].merge=[b-m,p-d])}for(var w in null===(n=a.images)||void 0===n||n.forEach((function(e){gs(e)})),null===(r=a.shapes)||void 0===r||r.forEach((function(e){gs(e)})),s.setData(a),a.rowinfo)s.rows.setInfo(w,a.rowinfo[w]);delete a.rowinfo}return this.isloading=!1,this}},{key:"getData",value:function(){return this.datas.map((function(e){return e.getData()}))}},{key:"cellText",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.datas[n].setCellText(e,t,i,"finished"),this}},{key:"setActiveCell",value:function(e,t){return this.sheet.setActiveCell(e,t),this}},{key:"setActiveSheet",value:function(e){return this.bottombar.clickSwap2(this.bottombar.items[e]),this}},{key:"getActiveSheet",value:function(){return this.bottombar.dataNames.indexOf(this.sheet.data.name)}},{key:"getActiveSheetName",value:function(){return this.sheet.data.name}},{key:"setActiveSheetByName",value:function(e){for(var t=0;t<this.bottombar.dataNames.length;t++)if(this.bottombar.dataNames[t]===e){this.bottombar.clickSwap2(this.bottombar.items[t]);break}return this}},{key:"cell",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCell(e,t)}},{key:"cellStyle",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.datas[i].getCellStyle(e,t)}},{key:"reRender",value:function(){return this.sheet.table.render(),this.sheet.canvas.fabric.requestRenderAll(),this}},{key:"showHighlights",value:function(e){this.sheet.showHighlights(e)}},{key:"hideHighlights",value:function(){this.sheet.hideHighlights()}},{key:"on",value:function(e,t){return this.sheet.on(e,t),this}},{key:"validate",value:function(){return this.data.validations.errors.size<=0}},{key:"change",value:function(e){return this.sheet.on("change",e),this}},{key:"updateServerError",value:function(e){return this.sheet.on("updateServerError",e),this}},{key:"updateCellError",value:function(e){return this.sheet.on("updateCellError",e),this}}],[{key:"locale",value:function(e,t){W(e,t)}}]),e}(),bs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new ys(e,t)};window&&(window.x_spreadsheet=bs,window.x_spreadsheet.locale=function(e,t){return W(e,t)});t.default=ys}]);
|