svgedit/dist/editor/xdomain-index.js

582 lines
1.9 MiB
JavaScript
Raw Normal View History

Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
var Tn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(Tn,Un,Qn){return Tn(Qn={path:Un,exports:{},require:function(Tn,Un){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==Un&&Qn.path)}},Qn.exports),Qn.exports}var check=function(Tn){return Tn&&Tn.Math==Math&&Tn},Un=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof Tn&&Tn)||function(){return this}()||Function("return this")(),fails=function(Tn){try{return!!Tn()}catch(Tn){return!0}},Qn=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Dn={}.propertyIsEnumerable,Hn=Object.getOwnPropertyDescriptor,Gn={f:Hn&&!Dn.call({1:2},1)?function propertyIsEnumerable(Tn){var Un=Hn(this,Tn);return!!Un&&Un.enumerable}:Dn},createPropertyDescriptor=function(Tn,Un){return{enumerable:!(1&Tn),configurable:!(2&Tn),writable:!(4&Tn),value:Un}},Vn={}.toString,classofRaw=function(Tn){return Vn.call(Tn).slice(8,-1)},zn="".split,Kn=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(Tn){return"String"==classofRaw(Tn)?zn.call(Tn,""):Object(Tn)}:Object,requireObjectCoercible=function(Tn){if(null==Tn)throw TypeError("Can't call method on "+Tn);return Tn},toIndexedObject=function(Tn){return Kn(requireObjectCoercible(Tn))},isObject=function(Tn){return"object"==typeof Tn?null!==Tn:"function"==typeof Tn},toPrimitive=function(Tn,Un){if(!isObject(Tn))return Tn;var Qn,Dn;if(Un&&"function"==typeof(Qn=Tn.toString)&&!isObject(Dn=Qn.call(Tn)))return Dn;if("function"==typeof(Qn=Tn.valueOf)&&!isObject(Dn=Qn.call(Tn)))return Dn;if(!Un&&"function"==typeof(Qn=Tn.toString)&&!isObject(Dn=Qn.call(Tn)))return Dn;throw TypeError("Can't convert object to primitive value")},Xn={}.hasOwnProperty,has=function(Tn,Un){return Xn.call(Tn,Un)},Wn=Un.document,Yn=isObject(Wn)&&isObject(Wn.createElement),documentCreateElement=function(Tn){return Yn?Wn.createElement(Tn):{}},Jn=!Qn&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),$n=Object.getOwnPropertyDescriptor,Zn={f:Qn?$n:function getOwnPropertyDescriptor(Tn,Un){if(Tn=toIndexedObject(Tn),Un=toPrimitive(Un,!0),Jn)try{return $n(Tn,Un)}catch(Tn){}if(has(Tn,Un))return createPropertyDescriptor(!Gn.f.call(Tn,Un),Tn[Un])}},anObject=function(Tn){if(!isObject(Tn))throw TypeError(String(Tn)+" is not an object");return Tn},er=Object.defineProperty,tr={f:Qn?er:function defineProperty(Tn,Un,Qn){if(anObject(Tn),Un=toPrimitive(Un,!0),anObject(Qn),Jn)try{return er(Tn,Un,Qn)}catch(Tn){}if("get"in Qn||"set"in Qn)throw TypeError("Accessors not supported");return"value"in Qn&&(Tn[Un]=Qn.value),Tn}},nr=Qn?function(Tn,Un,Qn){return tr.f(Tn,Un,createPropertyDescriptor(1,Qn))}:function(Tn,Un,Qn){return Tn[Un]=Qn,Tn},setGlobal=function(Tn,Qn){try{nr(Un,Tn,Qn)}catch(Dn){Un[Tn]=Qn}return Qn},rr=Un["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),ir=Function.toString;"function"!=typeof rr.inspectSource&&(rr.inspectSource=function(Tn){return ir.call(Tn)});var or,ar,sr,lr=rr.inspectSource,cr=Un.WeakMap,ur="function"==typeof cr&&/native code/.test(lr(cr)),dr=createCommonjsModule((function(Tn){(Tn.exports=function(Tn,Un){return rr[Tn]||(rr[Tn]=void 0!==Un?Un:{})})("versions",[]).push({version:"3.7.0",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),hr=0,pr=Math.random(),uid=function(Tn){return"Symbol("+String(void 0===Tn?"":Tn)+")_"+(++hr+pr).toString(36)},Ar=dr("keys"),sharedKey=function(Tn){return Ar[Tn]||(Ar[Tn]=uid(Tn))},fr={},gr=Un.WeakMap;if(ur){var mr=rr.state||(rr.state=new gr),_r=mr.get,vr=mr.has,yr=mr.set;or=function(Tn,Un){return Un.facade=Tn,yr.call(mr,Tn,Un),Un},ar=function(Tn){return _r.call(mr,Tn)||{}},sr=function(Tn){return vr.call(mr,Tn)}}else{var br=sharedKey("state");fr[br]=!0,or=function(Tn,Un){return Un.facade=Tn,nr(Tn,br,Un),Un},ar=functio
/*! jQuery v1.7.1 jquery.com | jquery.org/license */_export({target:"String",proto:!0,forced:stringHtmlForced("sub")},{sub:function sub(){return createHtml(this,"sub","","")}}),_export({target:"URL",proto:!0,enumerable:!0},{toJSON:function toJSON(){return URL.prototype.toString.call(this)}}),function(Tn,Un){function cy(Tn){return Gn.isWindow(Tn)?Tn:9===Tn.nodeType&&(Tn.defaultView||Tn.parentWindow)}function cv(Tn){if(!Bi[Tn]){var Un=Qn.body,Dn=Gn("<"+Tn+">").appendTo(Un),Hn=Dn.css("display");Dn.remove(),"none"!==Hn&&""!==Hn||(Si||((Si=Qn.createElement("iframe")).frameBorder=Si.width=Si.height=0),Un.appendChild(Si),xi&&Si.createElement||((xi=(Si.contentWindow||Si.contentDocument).document).write(("CSS1Compat"===Qn.compatMode?"<!doctype html>":"")+"<html><body>"),xi.close()),Dn=xi.createElement(Tn),xi.body.appendChild(Dn),Hn=Gn.css(Dn,"display"),Un.removeChild(Si)),Bi[Tn]=Hn}return Bi[Tn]}function cu(Tn,Un){var Qn={};return Gn.each(Li.concat.apply([],Li.slice(0,Un)),(function(){Qn[this]=Tn})),Qn}function ct(){ki=Un}function cs(){return setTimeout(ct,0),ki=Gn.now()}function ci(){try{return new Tn.XMLHttpRequest}catch(Tn){}}function ca(Tn,Un,Qn,Dn){if(Gn.isArray(Un))Gn.each(Un,(function(Un,Hn){Qn||Zr.test(Tn)?Dn(Tn,Hn):ca(Tn+"["+("object"==_typeof(Hn)||Gn.isArray(Hn)?Un:"")+"]",Hn,Qn,Dn)}));else if(Qn||null==Un||"object"!=_typeof(Un))Dn(Tn,Un);else for(var Hn in Un)ca(Tn+"["+Hn+"]",Un[Hn],Qn,Dn)}function b_(Tn,Qn){var Dn,Hn,Vn=Gn.ajaxSettings.flatOptions||{};for(Dn in Qn)Qn[Dn]!==Un&&((Vn[Dn]?Tn:Hn||(Hn={}))[Dn]=Qn[Dn]);Hn&&Gn.extend(!0,Tn,Hn)}function b$(Tn,Qn,Dn,Hn,Gn,Vn){(Vn=Vn||{})[Gn=Gn||Qn.dataTypes[0]]=!0;for(var zn,Kn=Tn[Gn],Xn=0,Wn=Kn?Kn.length:0,Yn=Tn===Ai;Xn<Wn&&(Yn||!zn);Xn++)"string"==typeof(zn=Kn[Xn](Qn,Dn,Hn))&&(!Yn||Vn[zn]?zn=Un:(Qn.dataTypes.unshift(zn),zn=b$(Tn,Qn,Dn,Hn,zn,Vn)));return(Yn||!zn)&&!Vn["*"]&&(zn=b$(Tn,Qn,Dn,Hn,"*",Vn)),zn}function bZ(Tn){return function(Un,Qn){if("string"!=typeof Un&&(Qn=Un,Un="*"),Gn.isFunction(Qn))for(var Dn,Hn,Vn=Un.toLowerCase().split(ui),zn=0,Kn=Vn.length;zn<Kn;zn++)Dn=Vn[zn],(Hn=/^\+/.test(Dn))&&(Dn=Dn.substr(1)||"*"),(Tn[Dn]=Tn[Dn]||[])[Hn?"unshift":"push"](Qn)}}function bC(Tn,Un,Qn){var Dn="width"===Un?Tn.offsetWidth:Tn.offsetHeight,Hn="width"===Un?Xr:Wr,Vn=0,zn=Hn.length;if(Dn>0){if("border"!==Qn)for(;Vn<zn;Vn++)Qn||(Dn-=parseFloat(Gn.css(Tn,"padding"+Hn[Vn]))||0),"margin"===Qn?Dn+=parseFloat(Gn.css(Tn,Qn+Hn[Vn]))||0:Dn-=parseFloat(Gn.css(Tn,"border"+Hn[Vn]+"Width"))||0;return Dn+"px"}if(((Dn=Or(Tn,Un,Un))<0||null==Dn)&&(Dn=Tn.style[Un]||0),Dn=parseFloat(Dn)||0,Qn)for(;Vn<zn;Vn++)Dn+=parseFloat(Gn.css(Tn,"padding"+Hn[Vn]))||0,"padding"!==Qn&&(Dn+=parseFloat(Gn.css(Tn,"border"+Hn[Vn]+"Width"))||0),"margin"===Qn&&(Dn+=parseFloat(Gn.css(Tn,Qn+Hn[Vn]))||0);return Dn+"px"}function bp(Tn,Un){Un.src?Gn.ajax({url:Un.src,async:!1,dataType:"script"}):Gn.globalEval((Un.text||Un.textContent||Un.innerHTML||"").replace(Ir,"/*$0*/")),Un.parentNode&&Un.parentNode.removeChild(Un)}function bo(Tn){var Un=Qn.createElement("div");return Mr.appendChild(Un),Un.innerHTML=Tn.outerHTML,Un.firstChild}function bn(Tn){var Un=(Tn.nodeName||"").toLowerCase();"input"===Un?bm(Tn):"script"!==Un&&void 0!==Tn.getElementsByTagName&&Gn.grep(Tn.getElementsByTagName("input"),bm)}function bm(Tn){"checkbox"!==Tn.type&&"radio"!==Tn.type||(Tn.defaultChecked=Tn.checked)}function bl(Tn){return void 0!==Tn.getElementsByTagName?Tn.getElementsByTagName("*"):void 0!==Tn.querySelectorAll?Tn.querySelectorAll("*"):[]}function bk(Tn,Un){var Qn;1===Un.nodeType&&(Un.clearAttributes&&Un.clearAttributes(),Un.mergeAttributes&&Un.mergeAttributes(Tn),"object"===(Qn=Un.nodeName.toLowerCase())?Un.outerHTML=Tn.outerHTML:"input"!==Qn||"checkbox"!==Tn.type&&"radio"!==Tn.type?"option"===Qn?Un.selected=Tn.defaultSelected:"input"!==Qn&&"textarea"!==Qn||(Un.defaultValue=Tn.defaultValue):(Tn.checked&&(Un.defaultChecked=Un.checked=Tn.checked),Un.value!==Tn.value&&(Un.value=Tn.value)),Un.removeAttribute(Gn.expando))}function bj(Tn,Un){if(1===Un.nodeType&&Gn.hasData(Tn)){var Qn,Dn,Hn,Vn=Gn._data(Tn),zn=Gn._data(Un,Vn),Kn=Vn.events;if(Kn)fo
2020-09-18 20:43:34 +00:00
/*!
* jQuery UI 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI
2020-09-19 14:20:30 +00:00
*/!function(Tn,Un){function d(Un){return!Tn(Un).parents().andSelf().filter((function(){return"hidden"===Tn.curCSS(this,"visibility")||Tn.expr.filters.hidden(this)})).length}function c(Un,Qn){var Dn=Un.nodeName.toLowerCase();if("area"===Dn){var Hn,Gn=Un.parentNode,Vn=Gn.name;return!(!Un.href||!Vn||"map"!==Gn.nodeName.toLowerCase())&&(!!(Hn=Tn("img[usemap=#"+Vn+"]")[0])&&d(Hn))}return(/input|select|textarea|button|object/.test(Dn)?!Un.disabled:"a"==Dn&&Un.href||Qn)&&d(Un)}Tn.ui=Tn.ui||{},Tn.ui.version||(Tn.extend(Tn.ui,{version:"1.8.17",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),Tn.fn.extend({propAttr:Tn.fn.prop||Tn.fn.attr,_focus:Tn.fn.focus,focus:function focus(Un,Qn){return"number"==typeof Un?this.each((function(){var Dn=this;setTimeout((function(){Tn(Dn).focus(),Qn&&Qn.call(Dn)}),Un)})):this._focus.apply(this,arguments)},scrollParent:function scrollParent(){var Un;return Un=Tn.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter((function(){return/(relative|absolute|fixed)/.test(Tn.curCSS(this,"position",1))&&/(auto|scroll)/.test(Tn.curCSS(this,"overflow",1)+Tn.curCSS(this,"overflow-y",1)+Tn.curCSS(this,"overflow-x",1))})).eq(0):this.parents().filter((function(){return/(auto|scroll)/.test(Tn.curCSS(this,"overflow",1)+Tn.curCSS(this,"overflow-y",1)+Tn.curCSS(this,"overflow-x",1))})).eq(0),/fixed/.test(this.css("position"))||!Un.length?Tn(document):Un},zIndex:function zIndex(Qn){if(Qn!==Un)return this.css("zIndex",Qn);if(this.length)for(var Dn,Hn,Gn=Tn(this[0]);Gn.length&&Gn[0]!==document;){if(("absolute"===(Dn=Gn.css("position"))||"relative"===Dn||"fixed"===Dn)&&(Hn=parseInt(Gn.css("zIndex"),10),!isNaN(Hn)&&0!==Hn))return Hn;Gn=Gn.parent()}return 0},disableSelection:function disableSelection(){return this.bind((Tn.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",(function(Tn){Tn.preventDefault()}))},enableSelection:function enableSelection(){return this.unbind(".ui-disableSelection")}}),Tn.each(["Width","Height"],(function(Qn,Dn){function h(Un,Qn,Dn,Gn){return Tn.each(Hn,(function(){Qn-=parseFloat(Tn.curCSS(Un,"padding"+this,!0))||0,Dn&&(Qn-=parseFloat(Tn.curCSS(Un,"border"+this+"Width",!0))||0),Gn&&(Qn-=parseFloat(Tn.curCSS(Un,"margin"+this,!0))||0)})),Qn}var Hn="Width"===Dn?["Left","Right"]:["Top","Bottom"],Gn=Dn.toLowerCase(),Vn={innerWidth:Tn.fn.innerWidth,innerHeight:Tn.fn.innerHeight,outerWidth:Tn.fn.outerWidth,outerHeight:Tn.fn.outerHeight};Tn.fn["inner"+Dn]=function(Qn){return Qn===Un?Vn["inner"+Dn].call(this):this.each((function(){Tn(this).css(Gn,h(this,Qn)+"px")}))},Tn.fn["outer"+Dn]=function(Un,Qn){return"number"!=typeof Un?Vn["outer"+Dn].call(this,Un):this.each((function(){Tn(this).css(Gn,h(this,Un,!0,Qn)+"px")}))}})),Tn.extend(Tn.expr[":"],{data:function data(Un,Qn,Dn){return!!Tn.data(Un,Dn[3])},focusable:function focusable(Un){return c(Un,!isNaN(Tn.attr(Un,"tabindex")))},tabbable:function tabbable(Un){var Qn=Tn.attr(Un,"tabindex"),Dn=isNaN(Qn);return(Dn||Qn>=0)&&c(Un,!Dn)}}),Tn((function(){var Un=document.body,Qn=Un.appendChild(Qn=document.createElement("div"));Tn.extend(Qn.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),Tn.support.minHeight=100===Qn.offsetHeight,Tn.support.selectstart="onselectstart"in Qn,Un.removeChild(Qn).style.display="none"})),Tn.extend(Tn.ui,{plugin:{add:function add(Un,Qn,Dn){var Hn=Tn.ui[Un].prototype;for(var Gn in Dn)Hn.plugins[Gn]=Hn.plugins[Gn]||[],Hn.plugins[Gn].push([Qn,Dn[Gn]])},call:function call(Tn,Un,Qn){var Dn=Tn.plugins[Un];if(Dn&&Tn.element[0].parentNode)for(var Hn=0;Hn<Dn.length;Hn++)Tn.options[Dn[Hn][0]]&&Dn[Hn][1].apply(Tn.element,Qn)}},contains:function contains(Tn,Un){return document.compareDocumentPosition?16&Tn.compareDocume
2020-09-18 20:43:34 +00:00
/*!
* jQuery UI Widget 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Widget
*/
2020-09-19 14:20:30 +00:00
function(Tn,Un){if(Tn.cleanData){var Qn=Tn.cleanData;Tn.cleanData=function(Un){for(var Dn,Hn=0;null!=(Dn=Un[Hn]);Hn++)try{Tn(Dn).triggerHandler("remove")}catch(Tn){}Qn(Un)}}else{var Dn=Tn.fn.remove;Tn.fn.remove=function(Un,Qn){return this.each((function(){return Qn||(!Un||Tn.filter(Un,[this]).length)&&Tn("*",this).add([this]).each((function(){try{Tn(this).triggerHandler("remove")}catch(Tn){}})),Dn.call(Tn(this),Un,Qn)}))}}Tn.widget=function(Un,Qn,Dn){var Hn,Gn=Un.split(".")[0];Hn=Gn+"-"+(Un=Un.split(".")[1]),Dn||(Dn=Qn,Qn=Tn.Widget),Tn.expr[":"][Hn]=function(Qn){return!!Tn.data(Qn,Un)},Tn[Gn]=Tn[Gn]||{},Tn[Gn][Un]=function(Tn,Un){arguments.length&&this._createWidget(Tn,Un)};var Vn=new Qn;Vn.options=Tn.extend(!0,{},Vn.options),Tn[Gn][Un].prototype=Tn.extend(!0,Vn,{namespace:Gn,widgetName:Un,widgetEventPrefix:Tn[Gn][Un].prototype.widgetEventPrefix||Un,widgetBaseClass:Hn},Dn),Tn.widget.bridge(Un,Tn[Gn][Un])},Tn.widget.bridge=function(Qn,Dn){Tn.fn[Qn]=function(Hn){var Gn="string"==typeof Hn,Vn=Array.prototype.slice.call(arguments,1),zn=this;return Hn=!Gn&&Vn.length?Tn.extend.apply(null,[!0,Hn].concat(Vn)):Hn,Gn&&"_"===Hn.charAt(0)||(Gn?this.each((function(){var Dn=Tn.data(this,Qn),Gn=Dn&&Tn.isFunction(Dn[Hn])?Dn[Hn].apply(Dn,Vn):Dn;if(Gn!==Dn&&Gn!==Un)return zn=Gn,!1})):this.each((function(){var Un=Tn.data(this,Qn);Un?Un.option(Hn||{})._init():Tn.data(this,Qn,new Dn(Hn,this))}))),zn}},Tn.Widget=function(Tn,Un){arguments.length&&this._createWidget(Tn,Un)},Tn.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function _createWidget(Un,Qn){Tn.data(Qn,this.widgetName,this),this.element=Tn(Qn),this.options=Tn.extend(!0,{},this.options,this._getCreateOptions(),Un);var Dn=this;this.element.bind("remove."+this.widgetName,(function(){Dn.destroy()})),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function _getCreateOptions(){return Tn.metadata&&Tn.metadata.get(this.element[0])[this.widgetName]},_create:function _create(){},_init:function _init(){},destroy:function destroy(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function widget(){return this.element},option:function option(Qn,Dn){var Hn=Qn;if(0===arguments.length)return Tn.extend({},this.options);if("string"==typeof Qn){if(Dn===Un)return this.options[Qn];(Hn={})[Qn]=Dn}return this._setOptions(Hn),this},_setOptions:function _setOptions(Un){var Qn=this;return Tn.each(Un,(function(Tn,Un){Qn._setOption(Tn,Un)})),this},_setOption:function _setOption(Tn,Un){return this.options[Tn]=Un,"disabled"===Tn&&this.widget()[Un?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",Un),this},enable:function enable(){return this._setOption("disabled",!1)},disable:function disable(){return this._setOption("disabled",!0)},_trigger:function _trigger(Un,Qn,Dn){var Hn,Gn,Vn=this.options[Un];if(Dn=Dn||{},(Qn=Tn.Event(Qn)).type=(Un===this.widgetEventPrefix?Un:this.widgetEventPrefix+Un).toLowerCase(),Qn.target=this.element[0],Gn=Qn.originalEvent)for(Hn in Gn)Hn in Qn||(Qn[Hn]=Gn[Hn]);return this.element.trigger(Qn,Dn),!(Tn.isFunction(Vn)&&!1===Vn.call(this.element[0],Qn,Dn)||Qn.isDefaultPrevented())}}}(jQuery),
2020-09-18 20:43:34 +00:00
/*!
* jQuery UI Mouse 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Mouse
*
* Depends:
* jquery.ui.widget.js
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn,Un){var Qn=!1;Tn(document).mouseup((function(Tn){Qn=!1})),Tn.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function _mouseInit(){var Un=this;this.element.bind("mousedown."+this.widgetName,(function(Tn){return Un._mouseDown(Tn)})).bind("click."+this.widgetName,(function(Qn){if(!0===Tn.data(Qn.target,Un.widgetName+".preventClickEvent"))return Tn.removeData(Qn.target,Un.widgetName+".preventClickEvent"),Qn.stopImmediatePropagation(),!1})),this.started=!1},_mouseDestroy:function _mouseDestroy(){this.element.unbind("."+this.widgetName)},_mouseDown:function _mouseDown(Un){if(!Qn){this._mouseStarted&&this._mouseUp(Un),this._mouseDownEvent=Un;var Dn=this,Hn=1==Un.which,Gn=!("string"!=typeof this.options.cancel||!Un.target.nodeName)&&Tn(Un.target).closest(this.options.cancel).length;return!(Hn&&!Gn&&this._mouseCapture(Un))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){Dn.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(Un)&&this._mouseDelayMet(Un)&&(this._mouseStarted=!1!==this._mouseStart(Un),!this._mouseStarted)?(Un.preventDefault(),!0):(!0===Tn.data(Un.target,this.widgetName+".preventClickEvent")&&Tn.removeData(Un.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(Tn){return Dn._mouseMove(Tn)},this._mouseUpDelegate=function(Tn){return Dn._mouseUp(Tn)},Tn(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),Un.preventDefault(),Qn=!0,!0))}},_mouseMove:function _mouseMove(Un){return!Tn.browser.msie||document.documentMode>=9||Un.button?this._mouseStarted?(this._mouseDrag(Un),Un.preventDefault()):(this._mouseDistanceMet(Un)&&this._mouseDelayMet(Un)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,Un),this._mouseStarted?this._mouseDrag(Un):this._mouseUp(Un)),!this._mouseStarted):this._mouseUp(Un)},_mouseUp:function _mouseUp(Un){return Tn(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,Un.target==this._mouseDownEvent.target&&Tn.data(Un.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(Un)),!1},_mouseDistanceMet:function _mouseDistanceMet(Tn){return Math.max(Math.abs(this._mouseDownEvent.pageX-Tn.pageX),Math.abs(this._mouseDownEvent.pageY-Tn.pageY))>=this.options.distance},_mouseDelayMet:function _mouseDelayMet(Tn){return this.mouseDelayMet},_mouseStart:function _mouseStart(Tn){},_mouseDrag:function _mouseDrag(Tn){},_mouseStop:function _mouseStop(Tn){},_mouseCapture:function _mouseCapture(Tn){return!0}})}(jQuery),function(Tn,Un){Tn.widget("ui.draggable",Tn.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function _create(){"original"==this.options.helper&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function destroy(){if(this.element.data("draggable"))return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function _mouseCapture(Un){var Qn=this.options;return!(this.helper||Qn.disabled||Tn(Un.target).is(".ui-resizable-handle"))&&(this.handle=this._getHandle(Un),!!this.handle&&(Qn.iframeFix&&Tn(!0===Qn.iframeFix?"iframe":Qn.iframeFix).each((function(){Tn('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"
2020-09-11 23:27:47 +00:00
/**
* Namespaces or tools therefor.
* @module namespaces
* @license MIT
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
var yd={HTML:"http://www.w3.org/1999/xhtml",MATH:"http://www.w3.org/1998/Math/MathML",SE:"http://svg-edit.googlecode.com",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"},bd=function getReverseNS(){var Tn={};return Object.entries(yd).forEach((function(Un){var Qn=_slicedToArray(Un,2),Dn=Qn[0],Hn=Qn[1];Tn[Hn]=Dn.toLowerCase()})),Tn};"SVGPathSeg"in window||(window.SVGPathSeg=function(Tn,Un,Qn){this.pathSegType=Tn,this.pathSegTypeAsLetter=Un,this._owningPathSegList=Qn},window.SVGPathSeg.prototype.classname="SVGPathSeg",window.SVGPathSeg.PATHSEG_UNKNOWN=0,window.SVGPathSeg.PATHSEG_CLOSEPATH=1,window.SVGPathSeg.PATHSEG_MOVETO_ABS=2,window.SVGPathSeg.PATHSEG_MOVETO_REL=3,window.SVGPathSeg.PATHSEG_LINETO_ABS=4,window.SVGPathSeg.PATHSEG_LINETO_REL=5,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,window.SVGPathSeg.PATHSEG_ARC_ABS=10,window.SVGPathSeg.PATHSEG_ARC_REL=11,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,window.SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},window.SVGPathSegClosePath=function(Tn){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CLOSEPATH,"z",Tn)},window.SVGPathSegClosePath.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},window.SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},window.SVGPathSegClosePath.prototype.clone=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathSegMovetoAbs=function(Tn,Un,Qn){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_ABS,"M",Tn),this._x=Un,this._y=Qn},window.SVGPathSegMovetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},window.SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoAbs.prototype.clone=function(){return new window.SVGPathSegMovetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"x",{get:function get(){return this._x},set:function set(Tn){this._x=Tn,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"y",{get:function get(){return this._y},set:function set(Tn){this._y=Tn,this._segmentChanged()},enumerable:!0}),window.SVGPathSegMovetoRel=function(Tn,Un,Qn){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_REL,"m",Tn),this._x=Un,this._y=Qn},window.SVGPathSegMovetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},window.SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoRel.prototype.clone=function(){return new window.SVGPathSegMovetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"x",{get:function get(){return this._x},set:function set(Tn){this._x=Tn,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"y",{get:function get(){return this._y},set:function set(Tn){this._y=Tn,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoAbs=function(Tn,Un,Qn){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_ABS,"L",Tn),this._x=Un,this._y=Qn},window.SV
2020-09-11 23:27:47 +00:00
/**
* A jQuery module to work with SVG attributes.
* @module jQueryAttr
* @license MIT
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function jQueryPluginSVG(Tn){var Un=Tn.fn.attr;return Tn.fn.attr=function(Tn,Qn){var Dn=this.length;if(!Dn)return Un.call(this,Tn,Qn);for(var Hn=0;Hn<Dn;++Hn){var Gn=this[Hn];if("http://www.w3.org/2000/svg"!==Gn.namespaceURI)return Un.call(this,Tn,Qn);if(void 0!==Qn)Gn.setAttribute(Tn,Qn);else if(Array.isArray(Tn)){for(var Vn={},zn=Tn.length;zn--;){var Kn=Tn[zn],Xn=Gn.getAttribute(Kn);(Xn||"0"===Xn)&&(Xn=isNaN(Xn)?Xn:Xn-0),Vn[Kn]=Xn}return Vn}if("object"!==_typeof(Tn)){var Wn=Gn.getAttribute(Tn);return(Wn||"0"===Wn)&&(Wn=isNaN(Wn)?Wn:Wn-0),Wn}for(var Yn=0,Jn=Object.entries(Tn);Yn<Jn.length;Yn++){var $n=_slicedToArray(Jn[Yn],2),Zn=$n[0],er=$n[1];Gn.setAttribute(Zn,er)}}return this},Tn}iA("toString",sA,cA);var uA=document.createElementNS(yd.SVG,"svg");function transformToString(Tn){var Un=Tn.matrix,Qn="";switch(Tn.type){case 1:Qn="matrix("+[Un.a,Un.b,Un.c,Un.d,Un.e,Un.f].join(",")+")";break;case 2:Qn="translate("+Un.e+","+Un.f+")";break;case 3:Qn=Un.a===Un.d?"scale("+Un.a+")":"scale("+Un.a+","+Un.d+")";break;case 4:var Dn=0,Hn=0;if(0!==Tn.angle){var Gn=1-Un.a;Hn=(Gn*Un.f+Un.b*Un.e)/(Gn*Gn+Un.b*Un.b),Dn=(Un.e-Un.b*Hn)/Gn}Qn="rotate("+Tn.angle+" "+Dn+","+Hn+")"}return Qn}var dA,hA={},pA=function(){function SVGTransformList(Tn){_classCallCheck(this,SVGTransformList),this._elem=Tn||null,this._xforms=[],this._update=function(){for(var Tn="",Un=0;Un<this.numberOfItems;++Un){Tn+=transformToString(this._list.getItem(Un))+" "}this._elem.setAttribute("transform",Tn)},this._list=this,this._init=function(){var Tn=this,Un=this._elem.getAttribute("transform");if(Un)for(var Qn=/\s*((scale|matrix|rotate|translate)\s*\(.*?\))\s*,?\s*/,Dn=!0;Dn;)Dn=Un.match(Qn),Un=Un.replace(Qn,""),Dn&&Dn[1]&&function(){var Un=Dn[1].split(/\s*\(/),Qn=Un[0],Hn=Un[1].match(/\s*(.*?)\s*\)/);Hn[1]=Hn[1].replace(/(\d)-/g,"$1 -");var Gn=Hn[1].split(/[, ]+/),Vn="abcdef".split(""),zn=uA.createSVGMatrix();Object.values(Gn).forEach((function(Tn,Un){Gn[Un]=Number.parseFloat(Tn),"matrix"===Qn&&(zn[Vn[Un]]=Gn[Un])}));var Kn=uA.createSVGTransform(),Xn="set"+Qn.charAt(0).toUpperCase()+Qn.slice(1),Wn="matrix"===Qn?[zn]:Gn;"scale"===Qn&&1===Wn.length?Wn.push(Wn[0]):"translate"===Qn&&1===Wn.length?Wn.push(0):"rotate"===Qn&&1===Wn.length&&Wn.push(0,0),Kn[Xn].apply(Kn,_toConsumableArray(Wn)),Tn._list.appendItem(Kn)}()},this._removeFromOtherLists=function(Tn){Tn&&Object.values(hA).some((function(Un){for(var Qn=0,Dn=Un._xforms.length;Qn<Dn;++Qn)if(Un._xforms[Qn]===Tn)return Un.removeItem(Qn),!0;return!1}))},this.numberOfItems=0}return _createClass(SVGTransformList,[{key:"clear",value:function clear(){this.numberOfItems=0,this._xforms=[]}},{key:"initialize",value:function initialize(Tn){this.numberOfItems=1,this._removeFromOtherLists(Tn),this._xforms=[Tn]}},{key:"getItem",value:function getItem(Tn){if(Tn<this.numberOfItems&&Tn>=0)return this._xforms[Tn];var Un=new Error("DOMException with code=INDEX_SIZE_ERR");throw Un.code=1,Un}},{key:"insertItemBefore",value:function insertItemBefore(Tn,Un){var Qn=null;if(Un>=0)if(Un<this.numberOfItems){this._removeFromOtherLists(Tn);var Dn,Hn=new Array(this.numberOfItems+1);for(Dn=0;Dn<Un;++Dn)Hn[Dn]=this._xforms[Dn];Hn[Dn]=Tn;for(var Gn=Dn+1;Dn<this.numberOfItems;++Gn,++Dn)Hn[Gn]=this._xforms[Dn];this.numberOfItems++,this._xforms=Hn,Qn=Tn,this._list._update()}else Qn=this._list.appendItem(Tn);return Qn}},{key:"replaceItem",value:function replaceItem(Tn,Un){var Qn=null;return Un<this.numberOfItems&&Un>=0&&(this._removeFromOtherLists(Tn),this._xforms[Un]=Tn,Qn=Tn,this._list._update()),Qn}},{key:"removeItem",value:function removeItem(Tn){if(Tn<this.numberOfItems&&Tn>=0){var Un,Qn=this._xforms[Tn],Dn=new Array(this.numberOfItems-1);for(Un=0;Un<Tn;++Un)Dn[Un]=this._xforms[Un];for(var Hn=Un;Hn<this.numberOfItems-1;++Hn,++Un)Dn[Hn]=this._xforms[Un+1];return this.numberOfItems--,this._xforms=Dn,this._list._update(),Qn}var Gn=new Error("DOMException with code=INDEX_SIZE_ERR");throw Gn.code=1,Gn}},{key:"appendItem",value:function appendItem(Tn){return this._removeFromOtherLists(Tn),this._xforms.push(Tn),this.numberOfItems++,this._list._update(),Tn}}])
2020-09-11 23:27:47 +00:00
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.1.1 Built on 2020-09-07T12:58:19.950Z
* CommitID 00000000
*
* Copyright (c) 2010-2020 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
* 2015-2020 yWorks GmbH, http://www.yworks.com
* 2015-2020 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
* 2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
* 2010 Aaron Spike, https://github.com/acspike
* 2012 Willow Systems Corporation, willow-systems.com
* 2012 Pablo Hess, https://github.com/pablohess
* 2012 Florian Jenett, https://github.com/fjenett
* 2013 Warren Weckesser, https://github.com/warrenweckesser
* 2013 Youssef Beddad, https://github.com/lifof
* 2013 Lee Driscoll, https://github.com/lsdriscoll
* 2013 Stefan Slonevskiy, https://github.com/stefslon
* 2013 Jeremy Morel, https://github.com/jmorel
* 2013 Christoph Hartmann, https://github.com/chris-rock
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
* 2014 James Makes, https://github.com/dollaruw
* 2014 Diego Casorran, https://github.com/diegocr
* 2014 Steven Spungin, https://github.com/Flamenco
* 2014 Kenneth Glassey, https://github.com/Gavvers
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Contributor(s):
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
* kim3er, mfo, alnorth, Flamenco
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
var AT=function(){return"undefined"!=typeof window?window:void 0!==Bf?Bf:"undefined"!=typeof self?self:this}();function e$1(){AT.console&&"function"==typeof AT.console.log&&AT.console.log.apply(AT.console,arguments)}var fT={log:e$1,warn:function warn(Tn){AT.console&&("function"==typeof AT.console.warn?AT.console.warn.apply(AT.console,arguments):e$1.call(null,arguments))},error:function error(Tn){AT.console&&("function"==typeof AT.console.error?AT.console.error.apply(AT.console,arguments):e$1(Tn))}};
2020-09-11 23:27:47 +00:00
/**
* @license
* FileSaver.js
* A saveAs() FileSaver implementation.
*
* By Eli Grey, http://eligrey.com
*
* License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)
* source : http://purl.eligrey.com/github/FileSaver.js
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
*/function r$1(Tn,Un,Qn){var Dn=new XMLHttpRequest;Dn.open("GET",Tn),Dn.responseType="blob",Dn.onload=function(){_T(Dn.response,Un,Qn)},Dn.onerror=function(){fT.error("could not download file")},Dn.send()}function i$2(Tn){var Un=new XMLHttpRequest;Un.open("HEAD",Tn,!1);try{Un.send()}catch(Tn){}return Un.status>=200&&Un.status<=299}function a$1(Tn){try{Tn.dispatchEvent(new MouseEvent("click"))}catch(Qn){var Un=document.createEvent("MouseEvents");Un.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),Tn.dispatchEvent(Un)}}var gT,mT,_T=AT.saveAs||("object"!=("undefined"==typeof window?"undefined":_typeof(window))||window!==AT?function(){}:"download"in HTMLAnchorElement.prototype?function(Tn,Un,Qn){var Dn=AT.URL||AT.webkitURL,Hn=document.createElement("a");Un=Un||Tn.name||"download",Hn.download=Un,Hn.rel="noopener","string"==typeof Tn?(Hn.href=Tn,Hn.origin!==location.origin?i$2(Hn.href)?r$1(Tn,Un,Qn):a$1(Hn,Hn.target="_blank"):a$1(Hn)):(Hn.href=Dn.createObjectURL(Tn),setTimeout((function(){Dn.revokeObjectURL(Hn.href)}),4e4),setTimeout((function(){a$1(Hn)}),0))}:"msSaveOrOpenBlob"in navigator?function(Tn,Un,Qn){if(Un=Un||Tn.name||"download","string"==typeof Tn)if(i$2(Tn))r$1(Tn,Un,Qn);else{var Dn=document.createElement("a");Dn.href=Tn,Dn.target="_blank",setTimeout((function(){a$1(Dn)}))}else navigator.msSaveOrOpenBlob(function(Tn,Un){return void 0===Un?Un={autoBom:!1}:"object"!=_typeof(Un)&&(fT.warn("Deprecated: Expected third argument to be a object"),Un={autoBom:!Un}),Un.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(Tn.type)?new Blob([String.fromCharCode(65279),Tn],{type:Tn.type}):Tn}(Tn,Qn),Un)}:function(Tn,Un,Qn,Dn){if((Dn=Dn||open("","_blank"))&&(Dn.document.title=Dn.document.body.innerText="downloading..."),"string"==typeof Tn)return r$1(Tn,Un,Qn);var Hn="application/octet-stream"===Tn.type,Gn=/constructor/i.test(AT.HTMLElement)||AT.safari,Vn=/CriOS\/[\d]+/.test(navigator.userAgent);if((Vn||Hn&&Gn)&&"object"==("undefined"==typeof FileReader?"undefined":_typeof(FileReader))){var zn=new FileReader;zn.onloadend=function(){var Tn=zn.result;Tn=Vn?Tn:Tn.replace(/^data:[^;]*;/,"data:attachment/file;"),Dn?Dn.location.href=Tn:location=Tn,Dn=null},zn.readAsDataURL(Tn)}else{var Kn=AT.URL||AT.webkitURL,Xn=Kn.createObjectURL(Tn);Dn?Dn.location=Xn:location.href=Xn,Dn=null,setTimeout((function(){Kn.revokeObjectURL(Xn)}),4e4)}});
2020-09-11 23:27:47 +00:00
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
* @license Use it if you like it
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
*/function c$2(Tn){var Un;Tn=Tn||"",this.ok=!1,"#"==Tn.charAt(0)&&(Tn=Tn.substr(1,6)),Tn={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",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"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",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",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:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",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",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[Tn=(Tn=Tn.replace(/ /g,"")).toLowerCase()]||Tn;for(var Qn=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function process(Tn){return[parseInt(Tn[1]),parseInt(Tn[2]),parseInt(Tn[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function process(Tn){return[parseInt(Tn[1],16),parseInt(Tn[2],16),parseInt(Tn[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function process(Tn){return[parseInt(Tn[1]+Tn[1],16),parseInt(Tn[2]+Tn[2],16),parseInt(Tn[3]+Tn[3],16)]}}],Dn=0;Dn<Qn.length;Dn++){var Hn=Qn[Dn].re,Gn=Qn[Dn].process,Vn=Hn.exec(Tn);Vn&&(Un=Gn(Vn),this.r=Un[0],this.g=Un[1],this.b=Un[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var Tn=this.r.toString(16),Un=this.g.toString(16),Qn=this.b.toString(16);return 1==Tn.length&&(Tn="0"+Tn),1==Un.length&&(Un="0"+Un),1==Qn.length&&(Qn="0"+Qn),"#"+Tn+Un+Qn}}function h$1(Tn){if("object"!=_typeof(Tn))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var Un={};this.subscribe=function(Tn,Q
2020-09-11 23:27:47 +00:00
/**
* @license
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){var Un=function e(Tn){if(void 0!==Tn&&""!=Tn)return!0};g.API.events.push(["addPage",function(Tn){this.internal.getPageInfo(Tn.pageNumber).pageContext.annotations=[]}]),Tn.events.push(["putPage",function(Tn){for(var Qn,Dn,Hn,Gn=this.internal.getCoordinateString,Vn=this.internal.getVerticalCoordinateString,zn=this.internal.getPageInfoByObjId(Tn.objId),Kn=Tn.pageContext.annotations,Xn=!1,Wn=0;Wn<Kn.length&&!Xn;Wn++)switch((Qn=Kn[Wn]).type){case"link":(Un(Qn.options.url)||Un(Qn.options.pageNumber))&&(Xn=!0);break;case"reference":case"text":case"freetext":Xn=!0}if(0!=Xn){this.internal.write("/Annots [");for(var Yn=0;Yn<Kn.length;Yn++)switch((Qn=Kn[Yn]).type){case"reference":this.internal.write(" "+Qn.object.objId+" 0 R ");break;case"text":var Jn=this.internal.newAdditionalObject(),$n=this.internal.newAdditionalObject(),Zn=Qn.title||"Note";Hn="<</Type /Annot /Subtype /Text "+(Dn="/Rect ["+Gn(Qn.bounds.x)+" "+Vn(Qn.bounds.y+Qn.bounds.h)+" "+Gn(Qn.bounds.x+Qn.bounds.w)+" "+Vn(Qn.bounds.y)+"] ")+"/Contents ("+Qn.contents+")",Hn+=" /Popup "+$n.objId+" 0 R",Hn+=" /P "+zn.objId+" 0 R",Hn+=" /T ("+Zn+") >>",Jn.content=Hn;var er=Jn.objId+" 0 R";Hn="<</Type /Annot /Subtype /Popup "+(Dn="/Rect ["+Gn(Qn.bounds.x+30)+" "+Vn(Qn.bounds.y+Qn.bounds.h)+" "+Gn(Qn.bounds.x+Qn.bounds.w+30)+" "+Vn(Qn.bounds.y)+"] ")+" /Parent "+er,Qn.open&&(Hn+=" /Open true"),Hn+=" >>",$n.content=Hn,this.internal.write(Jn.objId,"0 R",$n.objId,"0 R");break;case"freetext":Dn="/Rect ["+Gn(Qn.bounds.x)+" "+Vn(Qn.bounds.y)+" "+Gn(Qn.bounds.x+Qn.bounds.w)+" "+Vn(Qn.bounds.y+Qn.bounds.h)+"] ";var tr=Qn.color||"#000000";Hn="<</Type /Annot /Subtype /FreeText "+Dn+"/Contents ("+Qn.contents+")",Hn+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+tr+")",Hn+=" /Border [0 0 0]",Hn+=" >>",this.internal.write(Hn);break;case"link":if(Qn.options.name){var nr=this.annotations._nameMap[Qn.options.name];Qn.options.pageNumber=nr.page,Qn.options.top=nr.y}else Qn.options.top||(Qn.options.top=0);if(Dn="/Rect ["+Gn(Qn.x)+" "+Vn(Qn.y)+" "+Gn(Qn.x+Qn.w)+" "+Vn(Qn.y+Qn.h)+"] ",Hn="",Qn.options.url)Hn="<</Type /Annot /Subtype /Link "+Dn+"/Border [0 0 0] /A <</S /URI /URI ("+Qn.options.url+") >>";else if(Qn.options.pageNumber)switch(Hn="<</Type /Annot /Subtype /Link "+Dn+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(Qn.options.pageNumber).objId+" 0 R",Qn.options.magFactor=Qn.options.magFactor||"XYZ",Qn.options.magFactor){case"Fit":Hn+=" /Fit]";break;case"FitH":Hn+=" /FitH "+Qn.options.top+"]";break;case"FitV":Qn.options.left=Qn.options.left||0,Hn+=" /FitV "+Qn.options.left+"]";break;case"XYZ":default:var rr=Vn(Qn.options.top);Qn.options.left=Qn.options.left||0,void 0===Qn.options.zoom&&(Qn.options.zoom=0),Hn+=" /XYZ "+Qn.options.left+" "+rr+" "+Qn.options.zoom+"]"}""!=Hn&&(Hn+=" >>",this.internal.write(Hn))}this.internal.write("]")}}]),Tn.createAnnotation=function(Tn){var Un=this.internal.getCurrentPageInfo();switch(Tn.type){case"link":this.link(Tn.bounds.x,Tn.bounds.y,Tn.bounds.w,Tn.bounds.h,Tn);break;case"text":case"freetext":Un.pageContext.annotations.push(Tn)}},Tn.link=function(Tn,Un,Qn,Dn,Hn){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:Tn,y:Un,w:Qn,h:Dn,options:Hn,type:"link"})},Tn.textWithLink=function(Tn,Un,Qn,Dn){var Hn=this.getTextWidth(Tn),Gn=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(Tn,Un,Qn,Dn),Qn+=.2*Gn,this.link(Un,Qn-Gn,Hn,Gn,Dn),Hn},Tn.getTextWidth=function(Tn){var Un=this.internal.getFontSize();return this.getStringUnitWidth(Tn)*Un/this.internal.scaleFactor}}(g.API),
2020-09-11 23:27:47 +00:00
/**
* @license
* Copyright (c) 2017 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){var Un={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},Qn={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},Dn={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},Hn=[1570,1571,1573,1575];Tn.__arabicParser__={};var Gn=Tn.__arabicParser__.isInArabicSubstitutionA=function(Tn){return void 0!==Un[Tn.charCodeAt(0)]},Vn=Tn.__arabicParser__.isArabicLetter=function(Tn){return"string"==typeof Tn&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(Tn)},zn=Tn.__arabicParser__.isArabicEndLetter=function(Tn){return Vn(Tn)&&Gn(Tn)&&Un[Tn.charCodeAt(0)].length<=2},Kn=Tn.__arabicParser__.isArabicAlfLetter=function(Tn){return Vn(Tn)&&Hn.indexOf(Tn.charCodeAt(0))>=0};Tn.__arabicParser__.arabicLetterHasIsolatedForm=function(Tn){return Vn(Tn)&&Gn(Tn)&&Un[Tn.charCodeAt(0)].length>=1};var Xn=Tn.__arabicParser__.arabicLetterHasFinalForm=function(Tn){return Vn(Tn)&&Gn(Tn)&&Un[Tn.charCodeAt(0)].length>=2};Tn.__arabicParser__.arabicLetterHasInitialForm=function(Tn){return Vn(Tn)&&Gn(Tn)&&Un[Tn.charCodeAt(0)].length>=3};var Wn=Tn.__arabicParser__.arabicLetterHasMedialForm=function(Tn){return Vn(Tn)&&Gn(Tn)&&4==Un[Tn.charCodeAt(0)].length},Yn=Tn.__arabicParser__.resolveLigatures=function(Tn){var Un=0,Dn=Qn,Hn="",Gn=0;for(Un=0;Un<Tn.length;Un+=1)void 0!==Dn[Tn.charCodeAt(Un)]?(Gn++,"number"==typeof(Dn=Dn[Tn.charCodeAt(Un)])&&(Hn+=String.fromCharCode(Dn),Dn=Qn,Gn=0),Un===Tn.length-1&&(Dn=Qn,Hn+=Tn.charAt(Un-(Gn-1)),Un-=Gn-1,Gn=0)):(Dn=Qn,Hn+=Tn.charAt(Un-Gn),Un-=Gn,Gn=0);return Hn};Tn.__arabicParser__.isArabicDiacritic=function(Tn){return void 0!==Tn&&void 0!==Dn[Tn.charCodeAt(0)]};var Jn=Tn.__arabicParser__.getCorrectForm=function(Tn,Un,Qn){return Vn(Tn)?!1===Gn(Tn)?-1:!Xn(Tn)||!Vn(Un)&&!Vn(Qn)||!Vn(Qn)&&zn(Un)||zn(Tn)&&!Vn(Un)||zn(Tn)&&Kn(Un)||zn(Tn)&&zn(Un)?0:Wn(Tn)&&Vn(Un)&&!zn(Un)&&Vn(Qn)&&Xn(Qn)?3:zn(Tn)||!Vn(Qn)?1:2:-1},$n=function d(Tn){var Qn=0,Dn=0,Hn=0,Gn="",zn="",Kn="",Xn=(Tn=Tn||"").split("\\s+"),Wn=[];for(Qn=0;Qn<Xn.length;Qn+=1){fo
2020-09-11 23:27:47 +00:00
/**
* @license
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
2020-09-18 20:43:34 +00:00
function(Tn){var Un=function e(){var Tn=void 0;Object.defineProperty(this,"pdf",{get:function get(){return Tn},set:function set(Un){Tn=Un}});var e=150;Object.defineProperty(this,"width",{get:function get(){return e},set:function set(Tn){e=isNaN(Tn)||!1===Number.isInteger(Tn)||Tn<0?150:Tn,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=e+1)}});var Un=300;Object.defineProperty(this,"height",{get:function get(){return Un},set:function set(Tn){Un=isNaN(Tn)||!1===Number.isInteger(Tn)||Tn<0?300:Tn,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=Un+1)}});var Qn=[];Object.defineProperty(this,"childNodes",{get:function get(){return Qn},set:function set(Tn){Qn=Tn}});var Dn={};Object.defineProperty(this,"style",{get:function get(){return Dn},set:function set(Tn){Dn=Tn}}),Object.defineProperty(this,"parentNode",{})};Un.prototype.getContext=function(Tn,Un){var Qn;if("2d"!==(Tn=Tn||"2d"))return null;for(Qn in Un)this.pdf.context2d.hasOwnProperty(Qn)&&(this.pdf.context2d[Qn]=Un[Qn]);return this.pdf.context2d._canvas=this,this.pdf.context2d},Un.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},Tn.events.push(["initialized",function(){this.canvas=new Un,this.canvas.pdf=this}])}(g.API),
2020-09-11 23:27:47 +00:00
/**
* @license
* ====================================================================
* Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
* 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
* 2013 Lee Driscoll, https://github.com/lsdriscoll
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
* 2014 James Hall, james@parall.ax
* 2014 Diego Casorran, https://github.com/diegocr
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){var Un={left:0,top:0,bottom:0,right:0},Qn=!1,Dn=function r(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},Un),this.internal.__cell__.margins.width=this.getPageWidth(),Hn.call(this))},Hn=function i(){this.internal.__cell__.lastCell=new Gn,this.internal.__cell__.pages=1},Gn=function a(){var Tn=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function get(){return Tn},set:function set(Un){Tn=Un}});var Un=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function get(){return Un},set:function set(Tn){Un=Tn}});var Qn=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function get(){return Qn},set:function set(Tn){Qn=Tn}});var Dn=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function get(){return Dn},set:function set(Tn){Dn=Tn}});var Hn=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function get(){return Hn},set:function set(Tn){Hn=Tn}});var a=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function get(){return a},set:function set(Tn){a=Tn}});var Gn=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function get(){return Gn},set:function set(Tn){Gn=Tn}}),this};Gn.prototype.clone=function(){return new Gn(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},Gn.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},Tn.setHeaderFunction=function(Tn){return Dn.call(this),this.internal.__cell__.headerFunction="function"==typeof Tn?Tn:void 0,this},Tn.getTextDimensions=function(Tn,Un){Dn.call(this);var Qn=(Un=Un||{}).fontSize||this.getFontSize(),Hn=Un.font||this.getFont(),Gn=Un.scaleFactor||this.internal.scaleFactor,Vn=0,zn=0,Kn=0;if(!Array.isArray(Tn)&&"string"!=typeof Tn){if("number"!=typeof Tn)throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");Tn=String(Tn)}var Xn=Un.maxWidth;Xn>0?"string"==typeof Tn?Tn=this.splitTextToSize(Tn,Xn):"[object Array]"===Object.prototype.toString.call(Tn)&&(Tn=this.splitTextToSize(Tn.join(" "),Xn)):Tn=Array.isArray(Tn)?Tn:[Tn];for(var Wn=0;Wn<Tn.length;Wn++)Vn<(Kn=this.getStringUnitWidth(Tn[Wn],{font:Hn})*Qn)&&(Vn=Kn);return 0!==Vn&&(zn=Tn.length),{w:Vn/=Gn,h:Math.max((zn*Qn*this.getLineHeightFactor()-Qn*(this.getLineHeightFactor()-1))/Gn,0)}},Tn.cellAddPage=function(){Dn.call(this),this.addPage();var Tn=this.internal.__cell__.margins||Un;return this.internal.__cell__.lastCell=new Gn(Tn.left,Tn.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var Vn=Tn.cell=function(){var Tn;Tn=arguments[0]instanceof Gn?arguments[0]:new Gn(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),Dn.call(this);var Hn=this.internal.__cell__.lastCell,Vn=this.internal.__cell__.padding,zn=this.internal.__cell__.margins||Un,Kn=this.internal.__cell__.tableHeaderRow,Xn=this.internal.__cell__.printHeaders;return void 0!==Hn.lineNumber&&(Hn.lineNumber===Tn.lineNumber?(Tn.x=(Hn.x||0)+(Hn.width||0),Tn.y=Hn.y||0):Hn.y+Hn.height+Tn.height+zn.bottom>this.getPageHeight()?(this.cellAddPage(),Tn.y=zn.top,Xn&&Kn&&(this.printHeaderRow(Tn.lineNumber,!0),Tn.y+=Kn[0].height)):Tn.y=Hn.y+Hn.height||Tn.y),void 0!==Tn.text[0]&&(this.rect(Tn.x,Tn.y,Tn.width,Tn.height,!0===Qn?"FD":void 0),"right"===Tn.align?this.text(Tn.text,Tn.x+Tn.width-Vn,Tn.y+Vn,{align:"right",baseline:"top"}):"center"===Tn.align?this.text(Tn.text,Tn.x+Tn.width/2,Tn.y+Vn,{align:"center",baseline:"top",maxWidth:Tn.width-Vn-Vn}):this.text(Tn.text,Tn.x+Vn,Tn.y+Vn,{align:"left",baseline:"top",maxWidth:Tn.width-Vn-Vn})),this.internal.__cell__.lastCell=Tn,this};Tn.table=function(Tn,Qn,Kn,Xn,Wn){if(Dn.call(this),!Kn)throw new Error("No data for PDF table.");var Yn,Jn,$n,Zn,er=[],tr=[],nr=[],rr={},ir={},or=[],ar=[],sr=(Wn=Wn||{}).autoSize||!1,lr=!1!==Wn.printHeaders,cr=Wn.css&&void 0!==Wn.css["font-size"]?16*Wn.css["font-size"]:
2020-09-11 23:27:47 +00:00
/**
* @license
Copyright (c) 2013 Gildas Lormeau. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
var pP=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function ft(){var Tn=this;function e(Tn,Un){var Qn=0;do{Qn|=1&Tn,Tn>>>=1,Qn<<=1}while(--Un>0);return Qn>>>1}Tn.build_tree=function(Un){var Qn,Dn,Hn,Gn=Tn.dyn_tree,Vn=Tn.stat_desc.static_tree,zn=Tn.stat_desc.elems,Kn=-1;for(Un.heap_len=0,Un.heap_max=573,Qn=0;Qn<zn;Qn++)0!==Gn[2*Qn]?(Un.heap[++Un.heap_len]=Kn=Qn,Un.depth[Qn]=0):Gn[2*Qn+1]=0;for(;Un.heap_len<2;)Gn[2*(Hn=Un.heap[++Un.heap_len]=Kn<2?++Kn:0)]=1,Un.depth[Hn]=0,Un.opt_len--,Vn&&(Un.static_len-=Vn[2*Hn+1]);for(Tn.max_code=Kn,Qn=Math.floor(Un.heap_len/2);Qn>=1;Qn--)Un.pqdownheap(Gn,Qn);Hn=zn;do{Qn=Un.heap[1],Un.heap[1]=Un.heap[Un.heap_len--],Un.pqdownheap(Gn,1),Dn=Un.heap[1],Un.heap[--Un.heap_max]=Qn,Un.heap[--Un.heap_max]=Dn,Gn[2*Hn]=Gn[2*Qn]+Gn[2*Dn],Un.depth[Hn]=Math.max(Un.depth[Qn],Un.depth[Dn])+1,Gn[2*Qn+1]=Gn[2*Dn+1]=Hn,Un.heap[1]=Hn++,Un.pqdownheap(Gn,1)}while(Un.heap_len>=2);Un.heap[--Un.heap_max]=Un.heap[1],function(Un){var Qn,Dn,Hn,Gn,Vn,zn,Kn=Tn.dyn_tree,Xn=Tn.stat_desc.static_tree,Wn=Tn.stat_desc.extra_bits,Yn=Tn.stat_desc.extra_base,Jn=Tn.stat_desc.max_length,$n=0;for(Gn=0;Gn<=15;Gn++)Un.bl_count[Gn]=0;for(Kn[2*Un.heap[Un.heap_max]+1]=0,Qn=Un.heap_max+1;Qn<573;Qn++)(Gn=Kn[2*Kn[2*(Dn=Un.heap[Qn])+1]+1]+1)>Jn&&(Gn=Jn,$n++),Kn[2*Dn+1]=Gn,Dn>Tn.max_code||(Un.bl_count[Gn]++,Vn=0,Dn>=Yn&&(Vn=Wn[Dn-Yn]),zn=Kn[2*Dn],Un.opt_len+=zn*(Gn+Vn),Xn&&(Un.static_len+=zn*(Xn[2*Dn+1]+Vn)));if(0!==$n){do{for(Gn=Jn-1;0===Un.bl_count[Gn];)Gn--;Un.bl_count[Gn]--,Un.bl_count[Gn+1]+=2,Un.bl_count[Jn]--,$n-=2}while($n>0);for(Gn=Jn;0!==Gn;Gn--)for(Dn=Un.bl_count[Gn];0!==Dn;)(Hn=Un.heap[--Qn])>Tn.max_code||(Kn[2*Hn+1]!==Gn&&(Un.opt_len+=(Gn-Kn[2*Hn+1])*Kn[2*Hn],Kn[2*Hn+1]=Gn),Dn--)}}(Un),function(Tn,Un,Qn){var Dn,Hn,Gn,Vn=[],zn=0;for(Dn=1;Dn<=15;Dn++)Vn[Dn]=zn=zn+Qn[Dn-1]<<1;for(Hn=0;Hn<=Un;Hn++)0!==(Gn=Tn[2*Hn+1])&&(Tn[2*Hn]=e(Vn[Gn]++,Gn))}(Gn,Tn.max_code,Un.bl_count)}}function dt(Tn,Un,Qn,Dn,Hn){this.static_tree=Tn,this.extra_bits=Un,this.extra_base=Qn,this.elems=Dn,this.max_length=Hn}function pt(Tn,Un,Qn,Dn,Hn){this.good_length=Tn,this.max_lazy=Un,this.nice_length=Qn,this.max_chain=Dn,this.func=Hn}ft._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,
2020-09-11 23:27:47 +00:00
/**
* @license
* jsPDF filters PlugIn
* Copyright (c) 2014 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
*/Lt.prototype={deflateInit:function deflateInit(Tn,Un){return this.dstate=new Nt,Un||(Un=15),this.dstate.deflateInit(this,Tn,Un)},deflate:function deflate(Tn){return this.dstate?this.dstate.deflate(this,Tn):-2},deflateEnd:function deflateEnd(){if(!this.dstate)return-2;var Tn=this.dstate.deflateEnd();return this.dstate=null,Tn},deflateParams:function deflateParams(Tn,Un){return this.dstate?this.dstate.deflateParams(this,Tn,Un):-2},deflateSetDictionary:function deflateSetDictionary(Tn,Un){return this.dstate?this.dstate.deflateSetDictionary(this,Tn,Un):-2},read_buf:function read_buf(Tn,Un,Qn){var Dn=this.avail_in;return Dn>Qn&&(Dn=Qn),0===Dn?0:(this.avail_in-=Dn,Tn.set(this.next_in.subarray(this.next_in_index,this.next_in_index+Dn),Un),this.next_in_index+=Dn,this.total_in+=Dn,Dn)},flush_pending:function flush_pending(){var Tn=this.dstate.pending;Tn>this.avail_out&&(Tn=this.avail_out),0!==Tn&&(this.next_out.set(this.dstate.pending_buf.subarray(this.dstate.pending_out,this.dstate.pending_out+Tn),this.next_out_index),this.next_out_index+=Tn,this.dstate.pending_out+=Tn,this.total_out+=Tn,this.avail_out-=Tn,this.dstate.pending-=Tn,0===this.dstate.pending&&(this.dstate.pending_out=0))}},function(Tn){var Un=function e(Tn){var e,Un,Qn,Dn,Hn,Gn,Vn,zn,Kn,Xn;for(/[^\x00-\xFF]/.test(Tn),Un=[],Qn=0,Dn=(Tn+=e="\0\0\0\0".slice(Tn.length%4||4)).length;Dn>Qn;Qn+=4)0!==(Hn=(Tn.charCodeAt(Qn)<<24)+(Tn.charCodeAt(Qn+1)<<16)+(Tn.charCodeAt(Qn+2)<<8)+Tn.charCodeAt(Qn+3))?(Gn=(Hn=((Hn=((Hn=((Hn=(Hn-(Xn=Hn%85))/85)-(Kn=Hn%85))/85)-(zn=Hn%85))/85)-(Vn=Hn%85))/85)%85,Un.push(Gn+33,Vn+33,zn+33,Kn+33,Xn+33)):Un.push(122);return function(Tn,Un){for(var Qn=Un;Qn>0;Qn--)Tn.pop()}(Un,e.length),String.fromCharCode.apply(String,Un)+"~>"},Qn=function n(Tn){var Un,n,Qn,Dn,Hn,Gn=String,Vn="length",zn=255,Kn="charCodeAt",Xn="slice",Wn="replace";for(Tn[Xn](-2),Tn=Tn[Xn](0,-2)[Wn](/\s/g,"")[Wn]("z","!!!!!"),Qn=[],Dn=0,Hn=(Tn+=Un="uuuuu"[Xn](Tn[Vn]%5||5))[Vn];Hn>Dn;Dn+=5)n=52200625*(Tn[Kn](Dn)-33)+614125*(Tn[Kn](Dn+1)-33)+7225*(Tn[Kn](Dn+2)-33)+85*(Tn[Kn](Dn+3)-33)+(Tn[Kn](Dn+4)-33),Qn.push(zn&n>>24,zn&n>>16,zn&n>>8,zn&n);return function(Tn,Un){for(var Qn=Un;Qn>0;Qn--)Tn.pop()}(Qn,Un[Vn]),Gn.fromCharCode.apply(Gn,Qn)},Dn=function r(Tn){var Un=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(Tn=Tn.replace(/\s/g,"")).indexOf(">")&&(Tn=Tn.substr(0,Tn.indexOf(">"))),Tn.length%2&&(Tn+="0"),!1===Un.test(Tn))return"";for(var Qn="",r=0;r<Tn.length;r+=2)Qn+=String.fromCharCode("0x"+(Tn[r]+Tn[r+1]));return Qn},Hn=function i(Un){for(var Qn,Dn,i,Hn,Gn,Vn=[],zn=Un.length;zn--;)Vn[zn]=Un.charCodeAt(zn);return Qn=Tn.adler32cs.from(Un),i=Un=(Dn=new xt(6)).append(new Uint8Array(Vn)),Hn=Dn.flush(),(Gn=new Uint8Array(i.byteLength+Hn.byteLength)).set(new Uint8Array(i),0),Gn.set(new Uint8Array(Hn),i.byteLength),Un=Gn,(Vn=new Uint8Array(Un.byteLength+6)).set(new Uint8Array([120,156])),Vn.set(Un,2),Vn.set(new Uint8Array([255&Qn,Qn>>8&255,Qn>>16&255,Qn>>24&255]),Un.byteLength+2),Vn.reduce((function(Tn,Un){return Tn+String.fromCharCode(Un)}),"")};Tn.processDataByFilters=function(Tn,Gn){var Vn=0,zn=Tn||"",Kn=[];for("string"==typeof(Gn=Gn||[])&&(Gn=[Gn]),Vn=0;Vn<Gn.length;Vn+=1)switch(Gn[Vn]){case"ASCII85Decode":case"/ASCII85Decode":zn=Qn(zn),Kn.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":zn=Un(zn),Kn.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":zn=Dn(zn),Kn.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":zn=zn.split("").map((function(Tn){return("0"+Tn.charCodeAt().toString(16)).slice(-2)})).join("")+">",Kn.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":zn=Hn(zn),Kn.push("/FlateDecode");break;default:throw new Error('The filter: "'+Gn[Vn]+'" is not implemented')}return{data:zn,reverseChain:Kn.reverse().join(" ")}}}(g.API),
2020-09-11 23:27:47 +00:00
/**
* @license
* jsPDF fileloading PlugIn
* Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
2020-09-18 20:43:34 +00:00
function(Tn){Tn.loadFile=function(Tn,Un,Qn){return function(Tn,Un,Qn){Un=!1!==Un,Qn="function"==typeof Qn?Qn:function(){};var Dn=void 0;try{Dn=function(Tn,Un,Qn){var Dn=new XMLHttpRequest,Hn=0,Gn=function a(Tn){var Un=Tn.length,Qn=[],Dn=String.fromCharCode;for(Hn=0;Hn<Un;Hn+=1)Qn.push(Dn(255&Tn.charCodeAt(Hn)));return Qn.join("")};if(Dn.open("GET",Tn,!Un),Dn.overrideMimeType("text/plain; charset=x-user-defined"),!1===Un&&(Dn.onload=function(){200===Dn.status?Qn(Gn(this.responseText)):Qn(void 0)}),Dn.send(null),Un&&200===Dn.status)return Gn(Dn.responseText)}(Tn,Un,Qn)}catch(Tn){}return Dn}(Tn,Un,Qn)},Tn.loadImageFile=Tn.loadFile}(g.API),
2020-09-11 23:27:47 +00:00
/**
* @license
* Copyright (c) 2018 Erik Koopmans
* Released under the MIT License.
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){function n(){return(AT.html2canvas?Promise.resolve(AT.html2canvas):Promise.resolve().then((function(){return EI}))).catch((function(Tn){return Promise.reject(new Error("Could not load dompurify: "+Tn))})).then((function(Tn){return Tn.default?Tn.default:Tn}))}function r(){return(AT.DOMPurify?Promise.resolve(AT.DOMPurify):Promise.resolve().then((function(){return HI}))).catch((function(Tn){return Promise.reject(new Error("Could not load dompurify: "+Tn))})).then((function(Tn){return Tn.default?Tn.default:Tn}))}var Un=function i(Tn){var Un=_typeof(Tn);return"undefined"===Un?"undefined":"string"===Un||Tn instanceof String?"string":"number"===Un||Tn instanceof Number?"number":"function"===Un||Tn instanceof Function?"function":Tn&&Tn.constructor===Array?"array":Tn&&1===Tn.nodeType?"element":"object"===Un?"object":"unknown"},Qn=function a(Tn,Un){var Qn=document.createElement(Tn);for(var Dn in Un.className&&(Qn.className=Un.className),Un.innerHTML&&Un.dompurify&&(Qn.innerHTML=Un.dompurify.sanitize(Un.innerHTML)),Un.style)Qn.style[Dn]=Un.style[Dn];return Qn},Dn=function t(Tn){var Un=Object.assign(t.convert(Promise.resolve()),JSON.parse(JSON.stringify(t.template))),Qn=t.convert(Promise.resolve(),Un);return(Qn=Qn.setProgress(1,t,1,[t])).set(Tn)};(Dn.prototype=Object.create(Promise.prototype)).constructor=Dn,Dn.convert=function(Tn,Un){return Tn.__proto__=Un||Dn.prototype,Tn},Dn.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function callback(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},Dn.prototype.from=function(Tn,Dn){return this.then((function(){switch(Dn=Dn||function(Tn){switch(Un(Tn)){case"string":return"string";case"element":return"canvas"===Tn.nodeName.toLowerCase?"canvas":"element";default:return"unknown"}}(Tn)){case"string":return this.then(r).then((function(Un){return this.set({src:Qn("div",{innerHTML:Tn,dompurify:Un})})}));case"element":return this.set({src:Tn});case"canvas":return this.set({canvas:Tn});case"img":return this.set({img:Tn});default:return this.error("Unknown source type.")}}))},Dn.prototype.to=function(Tn){switch(Tn){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},Dn.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then((function(){var Tn={position:"relative",display:"inline-block",width:Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},Un=function o(Tn,Un){for(var Qn=3===Tn.nodeType?document.createTextNode(Tn.nodeValue):Tn.cloneNode(!1),Dn=Tn.firstChild;Dn;Dn=Dn.nextSibling)!0!==Un&&1===Dn.nodeType&&"SCRIPT"===Dn.nodeName||Qn.appendChild(o(Dn,Un));return 1===Tn.nodeType&&("CANVAS"===Tn.nodeName?(Qn.width=Tn.width,Qn.height=Tn.height,Qn.getContext("2d").drawImage(Tn,0,0)):"TEXTAREA"!==Tn.nodeName&&"SELECT"!==Tn.nodeName||(Qn.value=Tn.value),Qn.addEventListener("load",(function(){Qn.scrollTop=Tn.scrollTop,Qn.scrollLeft=Tn.scrollLeft}),!0)),Qn}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===Un.tagName&&(Tn.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=Qn("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=Qn("div",{className:"html2pdf__container",style:Tn}),this.prop.container.appendChild(Un),this.prop.container.firstChild.appendChild(Qn("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.sty
2020-09-11 23:27:47 +00:00
/**
* @license
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){var Un;Tn.events.push(["postPutResources",function(){var Tn=this,Qn=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var Dn=Tn.outline.render().split(/\r\n/),Hn=0;Hn<Dn.length;Hn++){var Gn=Dn[Hn],Vn=Qn.exec(Gn);if(null!=Vn){var zn=Vn[1];Tn.internal.newObjectDeferredBegin(zn,!1)}Tn.internal.write(Gn)}if(this.outline.createNamedDestinations){var Kn=this.internal.pages.length,Xn=[];for(Hn=0;Hn<Kn;Hn++){var Wn=Tn.internal.newObject();Xn.push(Wn);var Yn=Tn.internal.getPageInfo(Hn+1);Tn.internal.write("<< /D["+Yn.objId+" 0 R /XYZ null null null]>> endobj")}var Jn=Tn.internal.newObject();for(Tn.internal.write("<< /Names [ "),Hn=0;Hn<Xn.length;Hn++)Tn.internal.write("(page_"+(Hn+1)+")"+Xn[Hn]+" 0 R");Tn.internal.write(" ] >>","endobj"),Un=Tn.internal.newObject(),Tn.internal.write("<< /Dests "+Jn+" 0 R"),Tn.internal.write(">>","endobj")}}]),Tn.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+Un+" 0 R"))}]),Tn.events.push(["initialized",function(){var Tn=this;Tn.outline={createNamedDestinations:!1,root:{children:[]}},Tn.outline.add=function(Tn,Un,Qn){var Dn={title:Un,options:Qn,children:[]};return null==Tn&&(Tn=this.root),Tn.children.push(Dn),Dn},Tn.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=Tn,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},Tn.outline.genIds_r=function(Un){Un.id=Tn.internal.newObjectDeferred();for(var Qn=0;Qn<Un.children.length;Qn++)this.genIds_r(Un.children[Qn])},Tn.outline.renderRoot=function(Tn){this.objStart(Tn),this.line("/Type /Outlines"),Tn.children.length>0&&(this.line("/First "+this.makeRef(Tn.children[0])),this.line("/Last "+this.makeRef(Tn.children[Tn.children.length-1]))),this.line("/Count "+this.count_r({count:0},Tn)),this.objEnd()},Tn.outline.renderItems=function(Un){for(var Qn=this.ctx.pdf.internal.getVerticalCoordinateString,Dn=0;Dn<Un.children.length;Dn++){var Hn=Un.children[Dn];this.objStart(Hn),this.line("/Title "+this.makeString(Hn.title)),this.line("/Parent "+this.makeRef(Un)),Dn>0&&this.line("/Prev "+this.makeRef(Un.children[Dn-1])),Dn<Un.children.length-1&&this.line("/Next "+this.makeRef(Un.children[Dn+1])),Hn.children.length>0&&(this.line("/First "+this.makeRef(Hn.children[0])),this.line("/Last "+this.makeRef(Hn.children[Hn.children.length-1])));var Gn=this.count=this.count_r({count:0},Hn);if(Gn>0&&this.line("/Count "+Gn),Hn.options&&Hn.options.pageNumber){var Vn=Tn.internal.getPageInfo(Hn.options.pageNumber);this.line("/Dest ["+Vn.objId+" 0 R /XYZ 0 "+Qn(0)+" 0]")}this.objEnd()}for(var zn=0;zn<Un.children.length;zn++)this.renderItems(Un.children[zn])},Tn.outline.line=function(Tn){this.ctx.val+=Tn+"\r\n"},Tn.outline.makeRef=function(Tn){return Tn.id+" 0 R"},Tn.outline.makeString=function(Un){return"("+Tn.internal.pdfEscape(Un)+")"},Tn.outline.objStart=function(Tn){this.ctx.val+="\r\n"+Tn.id+" 0 obj\r\n<<\r\n"},Tn.outline.objEnd=function(){this.ctx.val+=">> \r\nendobj\r\n"},Tn.outline.count_r=function(Tn,Un){for(var Qn=0;Qn<Un.children.length;Qn++)Tn.count++,this.count_r(Tn,Un.children[Qn]);return Tn.count}}])}(g.API),
2020-09-11 23:27:47 +00:00
/**
* @license
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){var Un=[192,193,194,195,196,197,198,199];Tn.processJPEG=function(Tn,Qn,Dn,Hn,Gn,Vn){var zn,Kn=this.decode.DCT_DECODE,Xn=null;if("string"==typeof Tn||this.__addimage__.isArrayBuffer(Tn)||this.__addimage__.isArrayBufferView(Tn)){switch(Tn=Gn||Tn,Tn=this.__addimage__.isArrayBuffer(Tn)?new Uint8Array(Tn):Tn,(zn=function(Tn){for(var Qn,Dn=256*Tn.charCodeAt(4)+Tn.charCodeAt(5),Hn=Tn.length,Gn={width:0,height:0,numcomponents:1},Vn=4;Vn<Hn;Vn+=2){if(Vn+=Dn,-1!==Un.indexOf(Tn.charCodeAt(Vn+1))){Qn=256*Tn.charCodeAt(Vn+5)+Tn.charCodeAt(Vn+6),Gn={width:256*Tn.charCodeAt(Vn+7)+Tn.charCodeAt(Vn+8),height:Qn,numcomponents:Tn.charCodeAt(Vn+9)};break}Dn=256*Tn.charCodeAt(Vn+2)+Tn.charCodeAt(Vn+3)}return Gn}(Tn=this.__addimage__.isArrayBufferView(Tn)?this.__addimage__.arrayBufferToBinaryString(Tn):Tn)).numcomponents){case 1:Vn=this.color_spaces.DEVICE_GRAY;break;case 4:Vn=this.color_spaces.DEVICE_CMYK;break;case 3:Vn=this.color_spaces.DEVICE_RGB}Xn={data:Tn,width:zn.width,height:zn.height,colorSpace:Vn,bitsPerComponent:8,filter:Kn,index:Qn,alias:Dn}}return Xn}}(g.API);
2020-09-11 23:27:47 +00:00
/**
* @license
* Extracted from pdf.js
* https://github.com/andreasgal/pdf.js
*
* Copyright (c) 2011 Mozilla Foundation
*
* Contributors: Andreas Gal <gal@mozilla.com>
* Chris G Jones <cjones@mozilla.com>
* Shaon Barman <shaon.barman@gmail.com>
* Vivien Nicolas <21@vingtetun.org>
* Justin D'Arcangelo <justindarc@gmail.com>
* Yury Delendik
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
var vP,yP,bP,wP,SP,xP=function(){function t(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return t.prototype={ensureBuffer:function ensureBuffer(Tn){var Un=this.buffer,Qn=Un?Un.byteLength:0;if(Tn<Qn)return Un;for(var Dn=512;Dn<Tn;)Dn<<=1;for(var Hn=new Uint8Array(Dn),Gn=0;Gn<Qn;++Gn)Hn[Gn]=Un[Gn];return this.buffer=Hn},getByte:function getByte(){for(var Tn=this.pos;this.bufferLength<=Tn;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function getBytes(Tn){var Un=this.pos;if(Tn){this.ensureBuffer(Un+Tn);for(var Qn=Un+Tn;!this.eof&&this.bufferLength<Qn;)this.readBlock();var Dn=this.bufferLength;Qn>Dn&&(Qn=Dn)}else{for(;!this.eof;)this.readBlock();Qn=this.bufferLength}return this.pos=Qn,this.buffer.subarray(Un,Qn)},lookChar:function lookChar(){for(var Tn=this.pos;this.bufferLength<=Tn;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function getChar(){for(var Tn=this.pos;this.bufferLength<=Tn;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function makeSubStream(Tn,Un,Qn){for(var Dn=Tn+Un;this.bufferLength<=Dn&&!this.eof;)this.readBlock();return new Stream(this.buffer,Tn,Un,Qn)},skip:function skip(Tn){Tn||(Tn=1),this.pos+=Tn},reset:function reset(){this.pos=0}},t}(),CP=("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==Bf&&Bf||Function('return typeof this === "object" && this.content')()||Function("return this")()).FlateStream=function(){if("undefined"!=typeof Uint32Array){var Tn=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Un=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),Qn=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),Dn=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459
2020-09-11 23:27:47 +00:00
/**
* @license
* (c) Dean McNamee <dean@gmail.com>, 2013.
*
* https://github.com/deanm/omggif
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
* including animation and compression. It does not rely on any specific
* underlying system, so should run in the browser, Node, or Plask.
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
*/function jt(Tn){var Un=0;if(71!==Tn[Un++]||73!==Tn[Un++]||70!==Tn[Un++]||56!==Tn[Un++]||56!=(Tn[Un++]+1&253)||97!==Tn[Un++])throw new Error("Invalid GIF 87a/89a header.");var Qn=Tn[Un++]|Tn[Un++]<<8,Dn=Tn[Un++]|Tn[Un++]<<8,Hn=Tn[Un++],Gn=Hn>>7,Vn=1<<1+(7&Hn);Tn[Un++],Tn[Un++];var zn=null,Kn=null;Gn&&(zn=Un,Kn=Vn,Un+=3*Vn);var Xn=!0,Wn=[],Yn=0,Jn=null,$n=0,Zn=null;for(this.width=Qn,this.height=Dn;Xn&&Un<Tn.length;)switch(Tn[Un++]){case 33:switch(Tn[Un++]){case 255:if(11!==Tn[Un]||78==Tn[Un+1]&&69==Tn[Un+2]&&84==Tn[Un+3]&&83==Tn[Un+4]&&67==Tn[Un+5]&&65==Tn[Un+6]&&80==Tn[Un+7]&&69==Tn[Un+8]&&50==Tn[Un+9]&&46==Tn[Un+10]&&48==Tn[Un+11]&&3==Tn[Un+12]&&1==Tn[Un+13]&&0==Tn[Un+16])Un+=14,Zn=Tn[Un++]|Tn[Un++]<<8,Un++;else for(Un+=12;;){if(!((hr=Tn[Un++])>=0))throw Error("Invalid block size");if(0===hr)break;Un+=hr}break;case 249:if(4!==Tn[Un++]||0!==Tn[Un+4])throw new Error("Invalid graphics extension block.");var er=Tn[Un++];Yn=Tn[Un++]|Tn[Un++]<<8,Jn=Tn[Un++],0==(1&er)&&(Jn=null),$n=er>>2&7,Un++;break;case 254:for(;;){if(!((hr=Tn[Un++])>=0))throw Error("Invalid block size");if(0===hr)break;Un+=hr}break;default:throw new Error("Unknown graphic control label: 0x"+Tn[Un-1].toString(16))}break;case 44:var tr=Tn[Un++]|Tn[Un++]<<8,nr=Tn[Un++]|Tn[Un++]<<8,rr=Tn[Un++]|Tn[Un++]<<8,ir=Tn[Un++]|Tn[Un++]<<8,or=Tn[Un++],ar=or>>6&1,sr=1<<1+(7&or),lr=zn,cr=Kn,ur=!1;or>>7&&(ur=!0,lr=Un,cr=sr,Un+=3*sr);var dr=Un;for(Un++;;){var hr;if(!((hr=Tn[Un++])>=0))throw Error("Invalid block size");if(0===hr)break;Un+=hr}Wn.push({x:tr,y:nr,width:rr,height:ir,has_local_palette:ur,palette_offset:lr,palette_size:cr,data_offset:dr,data_length:Un-dr,transparent_index:Jn,interlaced:!!ar,delay:Yn,disposal:$n});break;case 59:Xn=!1;break;default:throw new Error("Unknown gif block: 0x"+Tn[Un-1].toString(16))}this.numFrames=function(){return Wn.length},this.loopCount=function(){return Zn},this.frameInfo=function(Tn){if(Tn<0||Tn>=Wn.length)throw new Error("Frame index out of range.");return Wn[Tn]},this.decodeAndBlitFrameBGRA=function(Un,Dn){var Hn=this.frameInfo(Un),Gn=Hn.width*Hn.height,Vn=new Uint8Array(Gn);Bt(Tn,Hn.data_offset,Vn,Gn);var zn=Hn.palette_offset,Kn=Hn.transparent_index;null===Kn&&(Kn=256);var Xn=Hn.width,Wn=Qn-Xn,Yn=Xn,Jn=4*(Hn.y*Qn+Hn.x),$n=4*((Hn.y+Hn.height)*Qn+Hn.x),Zn=Jn,er=4*Wn;!0===Hn.interlaced&&(er+=4*Qn*7);for(var tr=8,nr=0,rr=Vn.length;nr<rr;++nr){var ir=Vn[nr];if(0===Yn&&(Yn=Xn,(Zn+=er)>=$n&&(er=4*Wn+4*Qn*(tr-1),Zn=Jn+(Xn+Wn)*(tr<<1),tr>>=1)),ir===Kn)Zn+=4;else{var or=Tn[zn+3*ir],ar=Tn[zn+3*ir+1],sr=Tn[zn+3*ir+2];Dn[Zn++]=sr,Dn[Zn++]=ar,Dn[Zn++]=or,Dn[Zn++]=255}--Yn}},this.decodeAndBlitFrameRGBA=function(Un,Dn){var Hn=this.frameInfo(Un),Gn=Hn.width*Hn.height,Vn=new Uint8Array(Gn);Bt(Tn,Hn.data_offset,Vn,Gn);var zn=Hn.palette_offset,Kn=Hn.transparent_index;null===Kn&&(Kn=256);var Xn=Hn.width,Wn=Qn-Xn,Yn=Xn,Jn=4*(Hn.y*Qn+Hn.x),$n=4*((Hn.y+Hn.height)*Qn+Hn.x),Zn=Jn,er=4*Wn;!0===Hn.interlaced&&(er+=4*Qn*7);for(var tr=8,nr=0,rr=Vn.length;nr<rr;++nr){var ir=Vn[nr];if(0===Yn&&(Yn=Xn,(Zn+=er)>=$n&&(er=4*Wn+4*Qn*(tr-1),Zn=Jn+(Xn+Wn)*(tr<<1),tr>>=1)),ir===Kn)Zn+=4;else{var or=Tn[zn+3*ir],ar=Tn[zn+3*ir+1],sr=Tn[zn+3*ir+2];Dn[Zn++]=or,Dn[Zn++]=ar,Dn[Zn++]=sr,Dn[Zn++]=255}--Yn}}}function Bt(Tn,Un,Qn,Dn){for(var Hn=Tn[Un++],Gn=1<<Hn,Vn=Gn+1,zn=Vn+1,Kn=Hn+1,Xn=(1<<Kn)-1,Wn=0,Yn=0,Jn=0,$n=Tn[Un++],Zn=new Int32Array(4096),er=null;;){for(;Wn<16&&0!==$n;)Yn|=Tn[Un++]<<Wn,Wn+=8,1===$n?$n=Tn[Un++]:--$n;if(Wn<Kn)break;var tr=Yn&Xn;if(Yn>>=Kn,Wn-=Kn,tr!==Gn){if(tr===Vn)break;for(var nr=tr<zn?tr:er,rr=0,ir=nr;ir>Gn;)ir=Zn[ir]>>8,++rr;var or=ir;if(Jn+rr+(nr!==tr?1:0)>Dn)return void fT.log("Warning, gif stream longer than expected.");Qn[Jn++]=or;var ar=Jn+=rr;for(nr!==tr&&(Qn[Jn++]=or),ir=nr;rr--;)ir=Zn[ir],Qn[--ar]=255&ir,ir>>=8;null!==er&&zn<4096&&(Zn[zn++]=er<<8|or,zn>=Xn+1&&Kn<12&&(++Kn,Xn=Xn<<1|1)),er=tr}else zn=Vn+1,Xn=(1<<(Kn=Hn+1))-1,er=null}return Jn!==Dn&&fT.log("Warning, gif stream shorter than expected."),Qn
2020-09-11 23:27:47 +00:00
/**
* @license
Copyright (c) 2008, Adobe Systems Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Adobe Systems Incorporated nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
*/}function Ot(Tn){var Un,Qn,Dn,Hn,Gn,Vn=Math.floor,zn=new Array(64),Kn=new Array(64),Xn=new Array(64),Wn=new Array(64),Yn=new Array(65535),Jn=new Array(65535),$n=new Array(64),Zn=new Array(64),er=[],tr=0,nr=7,rr=new Array(64),ir=new Array(64),or=new Array(64),ar=new Array(256),sr=new Array(2048),lr=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],cr=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],ur=[0,1,2,3,4,5,6,7,8,9,10,11],dr=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],hr=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],pr=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],Ar=[0,1,2,3,4,5,6,7,8,9,10,11],fr=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],gr=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function j(Tn,Un){for(var Qn=0,Dn=0,Hn=new Array,Gn=1;Gn<=16;Gn++){for(var Vn=1;Vn<=Tn[Gn];Vn++)Hn[Un[Dn]]=[],Hn[Un[Dn]][0]=Qn,Hn[Un[Dn]][1]=Gn,Dn++,Qn++;Qn*=2}return Hn}function B(Tn){for(var Un=Tn[0],Qn=Tn[1]-1;Qn>=0;)Un&1<<Qn&&(tr|=1<<nr),Qn--,--nr<0&&(255==tr?(O(255),O(0)):O(tr),nr=7,tr=0)}function O(Tn){er.push(Tn)}function M(Tn){O(Tn>>8&255),O(255&Tn)}function E(Tn,Un,Qn,Dn,Hn){for(var Gn,Vn=Hn[0],zn=Hn[240],Kn=function(Tn,Un){var Qn,Dn,Hn,Gn,Vn,zn,Kn,Xn,Wn,Yn,Jn=0;for(Wn=0;Wn<8;++Wn){Qn=Tn[Jn],Dn=Tn[Jn+1],Hn=Tn[Jn+2],Gn=Tn[Jn+3],Vn=Tn[Jn+4],zn=Tn[Jn+5],Kn=Tn[Jn+6];var Zn=Qn+(Xn=Tn[Jn+7]),er=Qn-Xn,tr=Dn+Kn,nr=Dn-Kn,rr=Hn+zn,ir=Hn-zn,or=Gn+Vn,ar=Gn-Vn,sr=Zn+or,lr=Zn-or,cr=tr+rr,ur=tr-rr;Tn[Jn]=sr+cr,Tn[Jn+4]=sr-cr;var dr=.707106781*(ur+lr);Tn[Jn+2]=lr+dr,Tn[Jn+6]=lr-dr;var hr=.382683433*((sr=ar+ir)-(ur=nr+er)),pr=.5411961*sr+hr,Ar=1.306562965*ur+hr,fr=.707106781*(cr=ir+nr),gr=er+fr,mr=er-fr;Tn[Jn+5]=mr+pr,Tn[Jn+3]=mr-pr,Tn[Jn+1]=gr+Ar,Tn[Jn+7]=gr-Ar,Jn+=8}for(Jn=0,Wn=0;Wn<8;++Wn){Qn=Tn[Jn],Dn=Tn[Jn+8],Hn=Tn[Jn+16],Gn=Tn[Jn+24],Vn=Tn[Jn+32],zn=Tn[Jn+40],Kn=Tn[Jn+48];var _r=Qn+(Xn=Tn[Jn+56]),vr=Qn-Xn,yr=Dn+Kn,br=Dn-Kn,wr=Hn+zn,Sr=Hn-zn,xr=Gn+Vn,Cr=Gn-Vn,kr=_r+xr,Br=_r-xr,Er=yr+wr,Nr=yr-wr;Tn[Jn]=kr+Er,Tn[Jn+32]=kr-Er;var Lr=.707106781*(Nr+Br);Tn[Jn+16]=Br+Lr,Tn[Jn+48]=Br-Lr;var Tr=.382683433*((kr=Cr+Sr)-(Nr=br+vr)),Pr=.5411961*kr+Tr,Fr=1.306562965*Nr+Tr,Ur=.707106781*(Er=Sr+br),Ir=vr+Ur,Rr=vr-Ur;Tn[Jn+40]=Rr+Pr,Tn[Jn+24]=Rr-Pr,Tn[Jn+8]=Ir+Fr,Tn[Jn+56]=Ir-Fr,Jn++}for(Wn=0;Wn<64;++Wn)Yn=Tn[Wn]*Un[Wn],$n[Wn]=Yn>0?Yn+.5|0:Yn-.5|0;return $n}(Tn,Un),Xn=0;Xn<64;++Xn)Zn[lr[Xn]]=Kn[Xn];var Wn=Zn[0]-Qn;Qn=Zn[0],0==Wn?B(Dn[0]):(B(Dn[Jn[Gn=32767+Wn]]),B(Yn[Gn]));for(var er=63;er>0&&0==Zn[er];)er--;if(0==er)return B(Vn),Qn;for(var tr,nr=1;nr<=er;){for(var rr=nr;0==Zn[nr]&&nr<=er;)++nr;var ir=nr-rr;if(ir>=16){tr=ir>>4;for(var or=1;or<=tr;++or)B(zn);ir&=15}Gn=32767+Zn[nr],B(Hn[(ir<<4)+Jn[Gn]]),B(Yn[Gn]),nr++}return 63!=er&&B(Vn),Qn}function q(Tn){Tn=Math.min(Math.max(Tn,1),100),Gn!=Tn&&(function(Tn){for(var Un=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100
2020-09-11 23:27:47 +00:00
/**
* @license
* Copyright (c) 2017 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
*/function Mt(Tn,Un){if(this.pos=0,this.buffer=Tn,this.datav=new DataView(Tn.buffer),this.is_with_alpha=!!Un,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function Et(Tn){function e(Tn){if(!Tn)throw Error("assert :P")}function n(Tn,Un,Qn){for(var Dn=0;4>Dn;Dn++)if(Tn[Un+Dn]!=Qn.charCodeAt(Dn))return!0;return!1}function r(Tn,Un,Qn,Dn,Hn){for(var Gn=0;Gn<Hn;Gn++)Tn[Un+Gn]=Qn[Dn+Gn]}function i(Tn,Un,Qn,Dn){for(var Hn=0;Hn<Dn;Hn++)Tn[Un+Hn]=Qn}function a(Tn){return new Int32Array(Tn)}function o(Tn,Un){for(var Qn=[],Dn=0;Dn<Tn;Dn++)Qn.push(new Un);return Qn}function s(Tn,Un){var Qn=[];return function t(Tn,Qn,Dn){for(var Hn=Dn[Qn],Gn=0;Gn<Hn&&(Tn.push(Dn.length>Qn+1?[]:new Un),!(Dn.length<Qn+1));Gn++)t(Tn[Gn],Qn+1,Dn)}(Qn,0,Tn),Qn}function u(Tn,Un){for(var Qn="",Dn=0;Dn<4;Dn++)Qn+=String.fromCharCode(Tn[Un++]);return Qn}function c(Tn,Un){return(Tn[Un+0]<<0|Tn[Un+1]<<8|Tn[Un+2]<<16)>>>0}function h(Tn,Un){return(Tn[Un+0]<<0|Tn[Un+1]<<8|Tn[Un+2]<<16|Tn[Un+3]<<24)>>>0}new(Et=function Et(){var Tn=this;function u(Tn,Un){for(var Qn=1<<Un-1>>>0;Tn&Qn;)Qn>>>=1;return Qn?(Tn&Qn-1)+Qn:Tn}function c(Tn,Un,Qn,Dn,Hn){e(!(Dn%Qn));do{Tn[Un+(Dn-=Qn)]=Hn}while(0<Dn)}function h(Tn,Un,Qn,Dn,Hn){if(e(2328>=Hn),512>=Hn)var Gn=a(512);else if(null==(Gn=a(Hn)))return 0;return function(Tn,Un,Qn,Dn,Hn,Gn){var Vn,zn,Kn=Un,Xn=1<<Qn,Wn=a(16),Yn=a(16);for(e(0!=Hn),e(null!=Dn),e(null!=Tn),e(0<Qn),zn=0;zn<Hn;++zn){if(15<Dn[zn])return 0;++Wn[Dn[zn]]}if(Wn[0]==Hn)return 0;for(Yn[1]=0,Vn=1;15>Vn;++Vn){if(Wn[Vn]>1<<Vn)return 0;Yn[Vn+1]=Yn[Vn]+Wn[Vn]}for(zn=0;zn<Hn;++zn)Vn=Dn[zn],0<Dn[zn]&&(Gn[Yn[Vn]++]=zn);if(1==Yn[15])return(Dn=new l).g=0,Dn.value=Gn[0],c(Tn,Kn,1,Xn,Dn),Xn;var Jn,$n=-1,Zn=Xn-1,er=0,tr=1,nr=1,rr=1<<Qn;for(zn=0,Vn=1,Hn=2;Vn<=Qn;++Vn,Hn<<=1){if(tr+=nr<<=1,0>(nr-=Wn[Vn]))return 0;for(;0<Wn[Vn];--Wn[Vn])(Dn=new l).g=Vn,Dn.value=Gn[zn++],c(Tn,Kn+er,Hn,rr,Dn),er=u(er,Vn)}for(Vn=Qn+1,Hn=2;15>=Vn;++Vn,Hn<<=1){if(tr+=nr<<=1,0>(nr-=Wn[Vn]))return 0;for(;0<Wn[Vn];--Wn[Vn]){if(Dn=new l,(er&Zn)!=$n){for(Kn+=rr,Jn=1<<($n=Vn)-Qn;15>$n&&!(0>=(Jn-=Wn[$n]));)++$n,Jn<<=1;Xn+=rr=1<<(Jn=$n-Qn),Tn[Un+($n=er&Zn)].g=Jn+Qn,Tn[Un+$n].value=Kn-Un-$n}Dn.g=Vn-Qn,Dn.value=Gn[zn++],c(Tn,Kn+(er>>Qn),Hn,rr,Dn),er=u(er,Vn)}}return tr!=2*Yn[15]-1?0:Xn}(Tn,Un,Qn,Dn,Hn,Gn)}function l(){this.value=this.g=0}function f(){this.value=this.g=0}function d(){this.G=o(5,l),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Un,f)}function p(Tn,Un,Qn,Dn){e(null!=Tn),e(null!=Un),e(2147483648>Dn),Tn.Ca=254,Tn.I=0,Tn.b=-8,Tn.Ka=0,Tn.oa=Un,Tn.pa=Qn,Tn.Jd=Un,Tn.Yc=Qn+Dn,Tn.Zc=4<=Dn?Qn+Dn-4+1:Qn,S(Tn)}function g(Tn,Un){for(var Qn=0;0<Un--;)Qn|=k(Tn,128)<<Un;return Qn}function m(Tn,Un){var Qn=g(Tn,Un);return P(Tn)?-Qn:Qn}function v(Tn,Un,Qn,Dn){var Hn,Gn=0;for(e(null!=Tn),e(null!=Un),e(4294967288>Dn),Tn.Sb=Dn,Tn.Ra=0,Tn.u=0,Tn.h=0,4<Dn&&(Dn=4),Hn=0;Hn<Dn;++Hn)Gn+=Un[Qn+Hn]<<8*Hn;Tn.Ra=Gn,Tn.bb=Dn,Tn.oa=Un,Tn.pa=Qn}function b(Tn){for(;8<=Tn.u&&Tn.bb<Tn.Sb;)Tn.Ra>>>=8,Tn.Ra+=Tn.oa[Tn.pa+Tn.bb]<<Hn-8>>>0,++Tn.bb,Tn.u-=8;x(Tn)&&(Tn.h=1,Tn.u=0)}function y(Tn,Un){if(e(0<=Un),!Tn.h&&Un<=Dn){var Hn=L(Tn)&Qn[Un];return Tn.u+=Un,b(Tn),Hn}return Tn.h=1,Tn.u=0}function w(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function N(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function L(Tn){return Tn.Ra>>>(Tn.u&Hn-1)>>>0}function x(Tn){return e(Tn.bb<=Tn.Sb),Tn.h||Tn.bb==Tn.Sb&&Tn.u>Hn}function A(Tn,Un){Tn.u=Un,Tn.h=x(Tn)}function _(Tn){Tn.u>=Gn&&(e(Tn.u>=Gn),b(Tn))}function S(Tn){e(null!=Tn&&null!=Tn.oa),Tn.pa<Tn.Zc?(Tn.I=(Tn.oa[Tn.pa++]|Tn.I<<8)>>>0,Tn.b+=8):(e(null!=Tn&&null!=Tn.oa),Tn.pa<Tn.Yc?(Tn.b+=8,Tn.I=Tn.oa[Tn.pa++]|Tn.I<<8):Tn.Ka?Tn.b=0:(Tn.I<<=8,Tn.b+=8,Tn.Ka=1))}function P(Tn){return g(Tn,1)}function k(Tn,Un){var Qn=Tn.Ca;0>Tn.b&&S(Tn);var Dn=Tn.b,Hn=Qn*Un>>>8,Gn=(Tn.I>>>Dn>Hn)+0;for(Gn?(Qn-=Hn,Tn.I-=Hn+1<<Dn>>>0):Qn=Hn+1,Dn=Qn,Hn=0;256<=Dn;)Hn+=8,
2020-09-11 23:27:47 +00:00
/** @license
* Copyright (c) 2017 Dominik Homberger
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
https://webpjs.appspot.com
WebPRiffParser dominikhlbg@gmail.com
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn,Un,Qn,Dn){for(var Hn=0;Hn<4;Hn++)if(Tn[Un+Hn]!="RIFF".charCodeAt(Hn))return!0;return!1}(Tn,Un)){var zn,Kn;for(h(Tn,Un+=4),Un+=8;Un<Tn.length;){var Xn=u(Tn,Un),Wn=h(Tn,Un+=4);Un+=4;var Yn=Wn+(1&Wn);switch(Xn){case"VP8 ":case"VP8L":void 0===Qn.frames[Dn]&&(Qn.frames[Dn]={}),(Zn=Qn.frames[Dn]).src_off=Hn?Vn:Un-8,Zn.src_size=Gn+Wn+8,Dn++,Hn&&(Hn=!1,Gn=0,Vn=0);break;case"VP8X":(Zn=Qn.header={}).feature_flags=Tn[Un];var Jn=Un+4;Zn.canvas_width=1+c(Tn,Jn),Jn+=3,Zn.canvas_height=1+c(Tn,Jn),Jn+=3;break;case"ALPH":Hn=!0,Gn=Yn+8,Vn=Un-8;break;case"ANIM":(Zn=Qn.header).bgcolor=h(Tn,Un),Jn=Un+4,Zn.loop_count=(zn=Tn)[(Kn=Jn)+0]<<0|zn[Kn+1]<<8,Jn+=2;break;case"ANMF":var $n,Zn;(Zn=Qn.frames[Dn]={}).offset_x=2*c(Tn,Un),Un+=3,Zn.offset_y=2*c(Tn,Un),Un+=3,Zn.width=1+c(Tn,Un),Un+=3,Zn.height=1+c(Tn,Un),Un+=3,Zn.duration=c(Tn,Un),Un+=3,$n=Tn[Un++],Zn.dispose=1&$n,Zn.blend=$n>>1&1}"ANMF"!=Xn&&(Un+=Yn)}return Qn}}(Gn,0);Vn.response=Gn,Vn.rgbaoutput=!0,Vn.dataurl=!1;var zn=Vn.header?Vn.header:null,Kn=Vn.frames?Vn.frames:null;if(zn){zn.loop_counter=zn.loop_count,Un=[zn.canvas_height],Qn=[zn.canvas_width];for(var Xn=0;Xn<Kn.length&&0!=Kn[Xn].blend;Xn++);}var Wn=Kn[0],Yn=Hn.WebPDecodeRGBA(Gn,Wn.src_off,Wn.src_size,Qn,Un);Wn.rgba=Yn,Wn.imgwidth=Qn[0],Wn.imgheight=Un[0];for(var Jn=0;Jn<Qn[0]*Un[0]*4;Jn++)Dn[Jn]=Yn[Jn];return this.width=Qn,this.height=Un,this.data=Dn,this
2020-09-11 23:27:47 +00:00
/**
* @license
*
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
*/}!function(Tn){var Un=function n(Un,Hn,Xn,Wn){var Yn=5,Jn=Vn;switch(Wn){case Tn.image_compression.FAST:Yn=3,Jn=Gn;break;case Tn.image_compression.MEDIUM:Yn=6,Jn=zn;break;case Tn.image_compression.SLOW:Yn=9,Jn=Kn}Un=Dn(Un,Hn,Xn,Jn);var $n=new Uint8Array(Qn(Yn)),Zn=g.API.adler32cs.fromBuffer(Un.buffer),er=new xt(Yn),tr=er.append(Un),nr=er.flush(),rr=$n.length+tr.length+nr.length,ir=new Uint8Array(rr+4);return ir.set($n),ir.set(tr,$n.length),ir.set(nr,$n.length+tr.length),ir[rr++]=Zn>>>24&255,ir[rr++]=Zn>>>16&255,ir[rr++]=Zn>>>8&255,ir[rr++]=255&Zn,Tn.__addimage__.arrayBufferToBinaryString(ir)},Qn=function r(Tn){var Un=30720;return Un|=Math.min(3,(Tn-1&255)>>1)<<6,Un|=0,[120,255&(Un+=31-Un%31)]},Dn=function i(Tn,Un,Qn,Dn){for(var i,Hn,Gn,Vn=Tn.length/Un,zn=new Uint8Array(Tn.length+Vn),Kn=Wn(),Xn=0;Xn<Vn;Xn+=1){if(Gn=Xn*Un,i=Tn.subarray(Gn,Gn+Un),Dn)zn.set(Dn(i,Qn,Hn),Gn+Xn);else{for(var Jn,$n=Kn.length,Zn=[];Jn<$n;Jn+=1)Zn[Jn]=Kn[Jn](i,Qn,Hn);var er=Yn(Zn.concat());zn.set(Zn[er],Gn+Xn)}Hn=i}return zn},Hn=function a(Tn){var Un=Array.apply([],Tn);return Un.unshift(0),Un},Gn=function o(Tn,Un){var Qn,Dn=[],Hn=Tn.length;Dn[0]=1;for(var Gn=0;Gn<Hn;Gn+=1)Qn=Tn[Gn-Un]||0,Dn[Gn+1]=Tn[Gn]-Qn+256&255;return Dn},Vn=function s(Tn,Un,Qn){var Dn,Hn=[],Gn=Tn.length;Hn[0]=2;for(var Vn=0;Vn<Gn;Vn+=1)Dn=Qn&&Qn[Vn]||0,Hn[Vn+1]=Tn[Vn]-Dn+256&255;return Hn},zn=function u(Tn,Un,Qn){var Dn,Hn,Gn=[],Vn=Tn.length;Gn[0]=3;for(var zn=0;zn<Vn;zn+=1)Dn=Tn[zn-Un]||0,Hn=Qn&&Qn[zn]||0,Gn[zn+1]=Tn[zn]+256-(Dn+Hn>>>1)&255;return Gn},Kn=function c(Tn,Un,Qn){var Dn,Hn,Gn,Vn,zn=[],Kn=Tn.length;zn[0]=4;for(var c=0;c<Kn;c+=1)Dn=Tn[c-Un]||0,Hn=Qn&&Qn[c]||0,Gn=Qn&&Qn[c-Un]||0,Vn=Xn(Dn,Hn,Gn),zn[c+1]=Tn[c]-Vn+256&255;return zn},Xn=function h(Tn,Un,Qn){if(Tn===Un&&Un===Qn)return Tn;var Dn=Math.abs(Un-Qn),Hn=Math.abs(Tn-Qn),Gn=Math.abs(Tn+Un-Qn-Qn);return Dn<=Hn&&Dn<=Gn?Tn:Hn<=Gn?Un:Qn},Wn=function l(){return[Hn,Gn,Vn,zn,Kn]},Yn=function f(Tn){var Un=Tn.map((function(Tn){return Tn.reduce((function(Tn,Un){return Tn+Math.abs(Un)}),0)}));return Un.indexOf(Math.min.apply(null,Un))};Tn.processPNG=function(Qn,Dn,Hn,Gn){var Vn,zn,Kn,Xn,Wn,Yn,Jn,$n,Zn,er,tr,nr,rr,ir,or,ar=this.decode.FLATE_DECODE,sr="";if(this.__addimage__.isArrayBuffer(Qn)&&(Qn=new Uint8Array(Qn)),this.__addimage__.isArrayBufferView(Qn)){if(Qn=(Kn=new kP(Qn)).imgData,zn=Kn.bits,Vn=Kn.colorSpace,Wn=Kn.colors,-1!==[4,6].indexOf(Kn.colorType)){if(8===Kn.bits){Zn=($n=32==Kn.pixelBitlength?new Uint32Array(Kn.decodePixels().buffer):16==Kn.pixelBitlength?new Uint16Array(Kn.decodePixels().buffer):new Uint8Array(Kn.decodePixels().buffer)).length,tr=new Uint8Array(Zn*Kn.colors),er=new Uint8Array(Zn);var lr,cr=Kn.pixelBitlength-Kn.bits;for(ir=0,or=0;ir<Zn;ir++){for(rr=$n[ir],lr=0;lr<cr;)tr[or++]=rr>>>lr&255,lr+=Kn.bits;er[ir]=rr>>>lr&255}}if(16===Kn.bits){Zn=($n=new Uint32Array(Kn.decodePixels().buffer)).length,tr=new Uint8Array(Zn*(32/Kn.pixelBitlength)*Kn.colors),er=new Uint8Array(Zn*(32/Kn.pixelBitlength)),nr=Kn.colors>1,ir=0,or=0;for(var ur=0;ir<Zn;)rr=$n[ir++],tr[or++]=rr>>>0&255,nr&&(tr[or++]=rr>>>16&255,rr=$n[ir++],tr[or++]=rr>>>0&255),er[ur++]=rr>>>16&255;zn=8}Gn!==Tn.image_compression.NONE?(Qn=Un(tr,Kn.width*Kn.colors,Kn.colors,Gn),Jn=Un(er,Kn.width,1,Gn)):(Qn=tr,Jn=er,ar=void 0)}if(3===Kn.colorType&&(Vn=this.color_spaces.INDEXED,Yn=Kn.palette,Kn.transparency.indexed)){var dr=Kn.transparency.indexed,hr=0;for(ir=0,Zn=dr.length;ir<Zn;++ir)hr+=dr[ir];if((hr/=255)==Zn-1&&-1!==dr.indexOf(0))Xn=[dr.indexOf(0)];else if(hr!==Zn){for($n=Kn.decodePixels(),er=new Uint8Array($n.length),ir=0,Zn=$n.length;ir<Zn;ir++)er[ir]=dr[$n[ir]];Jn=Un(er,Kn.width,1)}}var pr=function(Un){var Qn;switch(Un){case Tn.image_compression.FAST:Qn=11;break;case Tn.image_compression.MEDIUM:Qn=13;break;case Tn.image_compression.SLOW:Qn=14;break;default:Qn=12}return Qn}(Gn);return ar===this.decode.FLATE_DECODE&&(sr="/Predictor "+pr+" "),sr+="/Colors "+Wn+" /BitsPerComponent "+zn+" /Columns "+Kn.width,(this.__addimage__.isArrayBuffer(Qn)||this.__addimage__.isArrayBufferView(Qn))&&(Qn=this.__addimage__.arrayBufferToBinaryString(Qn)),(Jn&&this.__a
2020-09-11 23:27:47 +00:00
/**
* @license
* Copyright (c) 2018 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){Tn.processBMP=function(Un,Qn,Dn,Hn){var Gn=new Mt(Un,!1),Vn=Gn.width,zn=Gn.height,Kn={data:Gn.getData(),width:Vn,height:zn},Xn=new Ot(100).encode(Kn,100);return Tn.processJPEG.call(this,Xn,Qn,Dn,Hn)}}(g.API),Et.prototype.getData=function(){return this.data},
2020-09-11 23:27:47 +00:00
/**
* @license
* Copyright (c) 2019 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){Tn.processWEBP=function(Un,Qn,Dn,Hn){var Gn=new Et(Un,!1),Vn=Gn.width,zn=Gn.height,Kn={data:Gn.getData(),width:Vn,height:zn},Xn=new Ot(100).encode(Kn,100);return Tn.processJPEG.call(this,Xn,Qn,Dn,Hn)}}(g.API),g.API.setLanguage=function(Tn){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),void 0!=={af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"FYRO Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian"
2020-09-11 23:27:47 +00:00
/** @license
* MIT license.
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
* 2014 Diego Casorran, https://github.com/diegocr
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
vP=g.API,yP=vP.getCharWidthsArray=function(Tn,Un){var Qn,Dn,Hn=(Un=Un||{}).font||this.internal.getFont(),Gn=Un.fontSize||this.internal.getFontSize(),Vn=Un.charSpace||this.internal.getCharSpace(),zn=Un.widths?Un.widths:Hn.metadata.Unicode.widths,Kn=zn.fof?zn.fof:1,Xn=Un.kerning?Un.kerning:Hn.metadata.Unicode.kerning,Wn=Xn.fof?Xn.fof:1,Yn=!1!==Un.doKerning,Jn=0,$n=Tn.length,Zn=0,er=zn[0]||Kn,tr=[];for(Qn=0;Qn<$n;Qn++)Dn=Tn.charCodeAt(Qn),"function"==typeof Hn.metadata.widthOfString?tr.push((Hn.metadata.widthOfGlyph(Hn.metadata.characterToGlyph(Dn))+Vn*(1e3/Gn)||0)/1e3):(Jn=Yn&&"object"==_typeof(Xn[Dn])&&!isNaN(parseInt(Xn[Dn][Zn],10))?Xn[Dn][Zn]/Wn:0,tr.push((zn[Dn]||er)/Kn+Jn)),Zn=Dn;return tr},bP=vP.getStringUnitWidth=function(Tn,Un){var Qn=(Un=Un||{}).fontSize||this.internal.getFontSize(),Dn=Un.font||this.internal.getFont(),Hn=Un.charSpace||this.internal.getCharSpace();return vP.processArabic&&(Tn=vP.processArabic(Tn)),"function"==typeof Dn.metadata.widthOfString?Dn.metadata.widthOfString(Tn,Qn,Hn)/Qn:yP.apply(this,arguments).reduce((function(Tn,Un){return Tn+Un}),0)},wP=function Pt(Tn,Un,Qn,Dn){for(var Hn=[],Gn=0,Vn=Tn.length,zn=0;Gn!==Vn&&zn+Un[Gn]<Qn;)zn+=Un[Gn],Gn++;Hn.push(Tn.slice(0,Gn));var Kn=Gn;for(zn=0;Gn!==Vn;)zn+Un[Gn]>Dn&&(Hn.push(Tn.slice(Kn,Gn)),zn=0,Kn=Gn),zn+=Un[Gn],Gn++;return Kn!==Gn&&Hn.push(Tn.slice(Kn,Gn)),Hn},SP=function kt(Tn,Un,Qn){Qn||(Qn={});var Dn,Hn,Gn,Vn,zn,Kn,Xn,Wn=[],Yn=[Wn],Jn=Qn.textIndent||0,$n=0,Zn=0,er=Tn.split(" "),tr=yP.apply(this,[" ",Qn])[0];if(Kn=-1===Qn.lineIndent?er[0].length+2:Qn.lineIndent||0){var nr=Array(Kn).join(" "),rr=[];er.map((function(Tn){(Tn=Tn.split(/\s*\n/)).length>1?rr=rr.concat(Tn.map((function(Tn,Un){return(Un&&Tn.length?"\n":"")+Tn}))):rr.push(Tn[0])})),er=rr,Kn=bP.apply(this,[nr,Qn])}for(Gn=0,Vn=er.length;Gn<Vn;Gn++){var ir=0;if(Dn=er[Gn],Kn&&"\n"==Dn[0]&&(Dn=Dn.substr(1),ir=1),Jn+$n+(Zn=(Hn=yP.apply(this,[Dn,Qn])).reduce((function(Tn,Un){return Tn+Un}),0))>Un||ir){if(Zn>Un){for(zn=wP.apply(this,[Dn,Hn,Un-(Jn+$n),Un]),Wn.push(zn.shift()),Wn=[zn.pop()];zn.length;)Yn.push([zn.shift()]);Zn=Hn.slice(Dn.length-(Wn[0]?Wn[0].length:0)).reduce((function(Tn,Un){return Tn+Un}),0)}else Wn=[Dn];Yn.push(Wn),Jn=Zn+Kn,$n=tr}else Wn.push(Dn),Jn+=$n+Zn,$n=tr}return Xn=Kn?function(Tn,Un){return(Un?nr:"")+Tn.join(" ")}:function(Tn){return Tn.join(" ")},Yn.map(Xn)},vP.splitTextToSize=function(Tn,Un,Qn){var Dn,Hn=(Qn=Qn||{}).fontSize||this.internal.getFontSize(),Gn=function(Tn){if(Tn.widths&&Tn.kerning)return{widths:Tn.widths,kerning:Tn.kerning};var Un=this.internal.getFont(Tn.fontName,Tn.fontStyle);return Un.metadata.Unicode?{widths:Un.metadata.Unicode.widths||{0:1},kerning:Un.metadata.Unicode.kerning||{}}:{font:Un.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,Qn);Dn=Array.isArray(Tn)?Tn:String(Tn).split(/\r?\n/);var Vn=1*this.internal.scaleFactor*Un/Hn;Gn.textIndent=Qn.textIndent?1*Qn.textIndent*this.internal.scaleFactor/Hn:0,Gn.lineIndent=Qn.lineIndent;var zn,Kn,Xn=[];for(zn=0,Kn=Dn.length;zn<Kn;zn++)Xn=Xn.concat(SP.apply(this,[Dn[zn],Vn,Gn]));return Xn},
2020-09-11 23:27:47 +00:00
/** @license
jsPDF standard_fonts_metrics plugin
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
* MIT license.
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){Tn.__fontmetrics__=Tn.__fontmetrics__||{};for(var Un="klmnopqrstuvwxyz",Qn={},Dn={},Hn=0;Hn<Un.length;Hn++)Qn[Un[Hn]]="0123456789abcdef"[Hn],Dn["0123456789abcdef"[Hn]]=Un[Hn];var Gn=function a(Tn){return"0x"+parseInt(Tn,10).toString(16)},Vn=Tn.__fontmetrics__.compress=function(Tn){var Un,Qn,Hn,zn,Kn=["{"];for(var Xn in Tn){if(Un=Tn[Xn],isNaN(parseInt(Xn,10))?Qn="'"+Xn+"'":(Xn=parseInt(Xn,10),Qn=(Qn=Gn(Xn).slice(2)).slice(0,-1)+Dn[Qn.slice(-1)]),"number"==typeof Un)Un<0?(Hn=Gn(Un).slice(3),zn="-"):(Hn=Gn(Un).slice(2),zn=""),Hn=zn+Hn.slice(0,-1)+Dn[Hn.slice(-1)];else{if("object"!=_typeof(Un))throw new Error("Don't know what to do with value type "+_typeof(Un)+".");Hn=Vn(Un)}Kn.push(Qn+Hn)}return Kn.push("}"),Kn.join("")},zn=Tn.__fontmetrics__.uncompress=function(Tn){if("string"!=typeof Tn)throw new Error("Invalid argument passed to uncompress.");for(var Un,Dn,Hn,Gn,Vn={},zn=1,Kn=Vn,Xn=[],Wn="",Yn="",Jn=Tn.length-1,$n=1;$n<Jn;$n+=1)"'"==(Gn=Tn[$n])?Un?(Hn=Un.join(""),Un=void 0):Un=[]:Un?Un.push(Gn):"{"==Gn?(Xn.push([Kn,Hn]),Kn={},Hn=void 0):"}"==Gn?((Dn=Xn.pop())[0][Dn[1]]=Kn,Hn=void 0,Kn=Dn[0]):"-"==Gn?zn=-1:void 0===Hn?Qn.hasOwnProperty(Gn)?(Wn+=Qn[Gn],Hn=parseInt(Wn,16)*zn,zn=1,Wn=""):Wn+=Gn:Qn.hasOwnProperty(Gn)?(Yn+=Qn[Gn],Kn[Hn]=parseInt(Yn,16)*zn,zn=1,Hn=void 0,Yn=""):Yn+=Gn;return Vn},Kn={codePages:["WinAnsiEncoding"],WinAnsiEncoding:zn("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},Xn={Unicode:{Courier:Kn,"Courier-Bold":Kn,"Courier-BoldOblique":Kn,"Courier-Oblique":Kn,Helvetica:Kn,"Helvetica-Bold":Kn,"Helvetica-BoldOblique":Kn,"Helvetica-Oblique":Kn,"Times-Roman":Kn,"Times-Bold":Kn,"Times-BoldItalic":Kn,"Times-Italic":Kn}},Wn={Unicode:{"Courier-Oblique":zn("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":zn("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":zn("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r
2020-09-11 23:27:47 +00:00
/**
* @license
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){var Un=function e(Tn){for(var e=Tn.length,Un=new Uint8Array(e),Qn=0;Qn<e;Qn++)Un[Qn]=Tn.charCodeAt(Qn);return Un};Tn.API.events.push(["addFont",function(Qn){var Dn=void 0,Hn=Qn.font,Gn=Qn.instance;if(!Hn.isStandardFont){if(void 0===Gn)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+Hn.postScriptName+"').");if("string"!=typeof(Dn=!1===Gn.existsFileInVFS(Hn.postScriptName)?Gn.loadFile(Hn.postScriptName):Gn.getFileFromVFS(Hn.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+Hn.postScriptName+"').");!function(Qn,Dn){Dn=/^\x00\x01\x00\x00/.test(Dn)?Un(Dn):Un(gT(Dn)),Qn.metadata=Tn.API.TTFFont.open(Dn),Qn.metadata.Unicode=Qn.metadata.Unicode||{encoding:{},kerning:{},widths:[]},Qn.metadata.glyIdsUsed=[0]}(Hn,Dn)}}])}(g),
2020-09-11 23:27:47 +00:00
/** @license
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){function r(){return(AT.canvg?Promise.resolve(AT.canvg):Promise.resolve().then((function(){return kB}))).catch((function(Tn){return Promise.reject(new Error("Could not load dompurify: "+Tn))})).then((function(Tn){return Tn.default?Tn.default:Tn}))}g.API.addSvgAsImage=function(Tn,Un,Qn,Dn,Hn,Gn,Vn,zn){if(isNaN(Un)||isNaN(Qn))throw fT.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(Dn)||isNaN(Hn))throw fT.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var Kn=document.createElement("canvas");Kn.width=Dn,Kn.height=Hn;var Xn=Kn.getContext("2d");Xn.fillStyle="#fff",Xn.fillRect(0,0,Kn.width,Kn.height);var Wn={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},Yn=this;return r().then((function(Un){return Un.Canvg.fromString(Xn,Tn,Wn)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(Tn){return Tn.render(Wn)})).then((function(){Yn.addImage(Kn.toDataURL("image/jpeg",1),Un,Qn,Dn,Hn,Vn,zn)}))}}(),g.API.putTotalPages=function(Tn){var Un,Qn=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(Un=new RegExp(Tn,"g"),Qn=this.internal.getNumberOfPages()):(Un=new RegExp(this.pdfEscape16(Tn,this.internal.getFont()),"g"),Qn=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var Dn=1;Dn<=this.internal.getNumberOfPages();Dn++)for(var Hn=0;Hn<this.internal.pages[Dn].length;Hn++)this.internal.pages[Dn][Hn]=this.internal.pages[Dn][Hn].replace(Un,Qn);return this},g.API.viewerPreferences=function(Tn,Un){var Qn;Tn=Tn||{},Un=Un||!1;var Dn,Hn,Gn,Vn={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},zn=Object.keys(Vn),Kn=[],Xn=0,Wn=0,Yn=0;function f(Tn,Un){var Qn,Dn=!1;for(Qn=0;Qn<Tn.length;Qn+=1)Tn[Qn]===Un&&(Dn=!0);return Dn}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(Vn)),this.int
2020-09-11 23:27:47 +00:00
/** ====================================================================
* @license
* jsPDF XMP metadata plugin
* Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){var Un=function e(){var Tn='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',e=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),Un=unescape(encodeURIComponent(Tn)),Qn=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),Dn=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),Hn=unescape(encodeURIComponent("</x:xmpmeta>")),Gn=Un.length+Qn.length+Dn.length+e.length+Hn.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+Gn+" >>"),this.internal.write("stream"),this.internal.write(e+Un+Qn+Dn+Hn),this.internal.write("endstream"),this.internal.write("endobj")},Qn=function n(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};Tn.addMetadata=function(Tn,Dn){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:Tn,namespaceuri:Dn||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",Qn),this.internal.events.subscribe("postPutResources",Un)),this}}(g.API),function(Tn){var Un=Tn.API,Qn=Un.pdfEscape16=function(Tn,Un){for(var Qn,Dn=Un.metadata.Unicode.widths,Hn=["","0","00","000","0000"],Gn=[""],Vn=0,zn=Tn.length;Vn<zn;++Vn){if(Qn=Un.metadata.characterToGlyph(Tn.charCodeAt(Vn)),Un.metadata.glyIdsUsed.push(Qn),Un.metadata.toUnicode[Qn]=Tn.charCodeAt(Vn),-1==Dn.indexOf(Qn)&&(Dn.push(Qn),Dn.push([parseInt(Un.metadata.widthOfGlyph(Qn),10)])),"0"==Qn)return Gn.join("");Qn=Qn.toString(16),Gn.push(Hn[4-Qn.length],Qn)}return Gn.join("")},Dn=function r(Tn){var Un,Qn,r,Dn,Hn,Gn,Vn;for(Hn="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],Gn=0,Vn=(Qn=Object.keys(Tn).sort((function(Tn,Un){return Tn-Un}))).length;Gn<Vn;Gn++)Un=Qn[Gn],r.length>=100&&(Hn+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),void 0!==Tn[Un]&&null!==Tn[Un]&&"function"==typeof Tn[Un].toString&&(Dn=("0000"+Tn[Un].toString(16)).slice(-4),Un=("0000"+(+Un).toString(16)).slice(-4),r.push("<"+Un+"><"+Dn+">"));return r.length&&(Hn+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),Hn+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};Un.events.push(["putFont",function(Un){!function(Un){var Qn=Un.font,Hn=Un.out,Gn=Un.newObject,Vn=Un.putStream,zn=Un.pdfEscapeWithNeededParanthesis;if(Qn.metadata instanceof Tn.API.TTFFont&&"Identity-H"===Qn.encoding){for(var Kn=Qn.metadata.Unicode.widths,Xn=Qn.metadata.subset.encode(Qn.metadata.glyIdsUsed,1),Wn="",Yn=0;Yn<Xn.length;Yn++)Wn+=String.fromCharCode(Xn[Yn]);var Jn=Gn();Vn({data:Wn,addLength1:!0}),Hn("endobj");var $n=Gn();Vn({data:Dn(Qn.metadata.toUnicode),addLength1:!0}),Hn("endobj");var Zn=Gn();Hn("<<"),Hn("/Type /FontDescriptor"),Hn("/FontName /"+zn(Qn.fontName)),Hn("/FontFile2 "+Jn+" 0 R"),Hn("/FontBBox "+Tn.API.PDFObject.convert(Qn.metadata.bbox)),Hn("/Flags "+Qn.metadata.flags),Hn("/StemV "+Qn.metadata.stemV),Hn("/ItalicAngle "+Qn.metadata.italicAngle),Hn("/Ascent "+Qn.metadata.ascender),Hn("/Descent "+Qn.metadata.decender),Hn("/CapHeight "+Qn.metadata.capHeight),Hn(">>"),Hn("endobj");var er=Gn();Hn("<<"),Hn("/Type /Font"),Hn("/BaseFont /"+zn(Qn.fontName)),Hn("/FontDescriptor "+Zn+" 0 R"),Hn("/W "+Tn.API.PDFObject.convert(Kn)),Hn("/CIDToGIDMap /Identity"),Hn("/DW 1000"),Hn("/Subtype /CIDFontType2"),Hn("/CIDSystemInfo"),Hn("<<"),Hn("/Supplement 0"),Hn("/Registry (Adobe)"),Hn("/Ordering ("+Qn.encoding+")"),Hn(">>"),Hn(">>"),Hn("endobj"),Qn.objectNumber=Gn(),Hn("<<"),Hn("/Type /Font"),Hn("/Subtype /Type0"),Hn("/ToUnicode "+$n+" 0 R"),Hn("/BaseFont /"+zn(Qn.fontName)),Hn("/Encoding /"+Qn.encoding),Hn("/DescendantFonts ["+er+" 0 R]"),Hn(">>"),Hn("endobj"),Qn.i
2020-09-11 23:27:47 +00:00
/**
* @license
* jsPDF virtual FileSystem functionality
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
2020-09-18 20:43:34 +00:00
function(Tn){var Un=function e(){return void 0===this.internal.vFS&&(this.internal.vFS={}),!0};Tn.existsFileInVFS=function(Tn){return Un.call(this),void 0!==this.internal.vFS[Tn]},Tn.addFileToVFS=function(Tn,Qn){return Un.call(this),this.internal.vFS[Tn]=Qn,this},Tn.getFileFromVFS=function(Tn){return Un.call(this),void 0!==this.internal.vFS[Tn]?this.internal.vFS[Tn]:null}}(g.API),
2020-09-11 23:27:47 +00:00
/**
* @license
* Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
* MIT License
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function(Tn){Tn.__bidiEngine__=Tn.prototype.__bidiEngine__=function(Tn){var Qn,Dn,Hn,Gn,Vn,zn,Kn,Xn=Un,Wn=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],Yn=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],Jn={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},$n={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},Zn=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","","","","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],er=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),tr=!1,nr=0;this.__bidiEngine__={};var rr=function b(Tn){var Un=Tn.charCodeAt(),Qn=Un>>8,Dn=$n[Qn];return void 0!==Dn?Xn[256*Dn+(255&Un)]:252===Qn||253===Qn?"AL":er.test(Qn)?"L":8===Qn?"R":"N"},ir=function y(Tn){for(var Un,Qn=0;Qn<Tn.length;Qn++){if("L"===(Un=rr(Tn.charAt(Qn))))return!1;if("R"===Un)return!0}return!1},or=function w(Tn,Un,Vn,zn){var Kn,Xn,Wn,Yn,Jn=Un[zn];switch(Jn){case"L":case"R":tr=!1;break;case"N":case"AN":break;case"EN":tr&&(Jn="AN");break;case"AL":tr=!0,Jn="R";break;case"WS":Jn="N";break;case"CS":zn<1||zn+1>=Un.length||"EN"!==(Kn=Vn[zn-1])&&"AN"!==Kn||"EN"!==(Xn=Un[zn+1])&&"AN"!==Xn?Jn="N":tr&&(Xn="AN"),Jn=Xn===Kn?Xn:"N";break;case"ES":Jn="EN"===(Kn=zn>0?Vn[zn-1]:"B")&&zn+1<Un.length&&"EN"===Un[zn+1]?"EN":"N";break;case"ET":if(zn>0&&"EN"===Vn[zn-1]){Jn="EN";break}if(tr){Jn="N";break}for(Wn=zn+1,Yn=Un.length;Wn<Yn&&"ET"===Un[Wn];)Wn++;Jn=Wn<Yn&&"EN"===Un[Wn]?"EN":"N";break;case"NSM":if(Hn&&!Gn){for(Yn=Un.length,Wn=zn+1;Wn<Yn&&"NSM"===Un[Wn];)Wn++;if(Wn<Yn){var $n=Tn[zn],Zn=$n>=1425&&$n<=2303||64286===$n;if(Kn=Un[Wn],Zn&&("R"===Kn||"AL"===Kn)){Jn="R";break}}}Jn=zn<1||"B"===(Kn=Un[zn-1])?"N":Vn[zn-1];break;case"B":tr=!1,Qn=!0,Jn=nr;break;case"S":Dn=!0,Jn="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":tr=!1;break;case"BN":Jn="N"}return Jn},ar=function N(Tn,Un,Qn){var Dn=Tn.split("");return Qn&&sr(Dn,Qn,{hiLevel:nr}),Dn.reverse(),Un&&Un.reverse(),Dn.join("")},sr=function L(Tn,Un,Hn){var Gn,Vn,zn,Kn,Xn,$n=-1,Zn=Tn.length,er=0,ir=[],ar=nr?Yn:Wn,L=[];for(tr=!1,Qn=!1,Dn=!1,Vn=0;Vn<Zn;Vn++)L[Vn]=rr(Tn[Vn]);for(zn=0;zn<Zn;zn++){if(Xn=er,ir[zn]=or(Tn,L,ir,zn),Gn=240&(er=ar[Xn][Jn[ir[zn]]]),er&=15,Un[zn]=Kn=ar[er][5],Gn>0)if(16===Gn){for(Vn=$n;Vn<zn;Vn++)Un[Vn]=1;$n=-1}else $n=-1;if(ar[er][6])-1===$n&&($n=zn);else if($n>-1){for(Vn=$n;Vn<zn;Vn++)Un[Vn]=Kn;$n=-1}"B"===L[zn]&&(Un[zn]=0),Hn.hiLevel|=Kn}Dn&&function(Tn,Un,Qn){for(var Dn=0;Dn<Qn;Dn++)if("S"===Tn[Dn]){Un[Dn]=nr;for(var Hn=Dn-1;Hn>=0&&"WS"===Tn[Hn];Hn--)Un[Hn]=nr}}(L,Un,Zn)},lr=function x(Tn,Un,Dn,Hn,Gn){if(!(Gn.hiLevel<Tn)){if(1===Tn&&1===nr&&!Qn)return Un.reverse(),void(Dn&&Dn.reverse());for(var Vn,zn,Kn,Xn,Wn=Un.length,Yn=0;Yn<Wn;){if(Hn[Yn]>=Tn){for(Kn=Yn+1;Kn<Wn&&Hn[Kn]>=Tn;)Kn++;for(Xn=Yn,zn=Kn-1;Xn<zn;Xn++,zn--)Vn=Un[Xn],Un[Xn]=Un[zn],Un[zn]=Vn,Dn&&(Vn=Dn[Xn],Dn[Xn]=Dn[zn],Dn[zn]=Vn);Yn=Kn}Yn++}}},cr=function A(Tn,Un,Qn){var Dn=Tn.split(""),Hn={hiLevel:nr};return Qn||(Qn=[]),sr(Dn,Qn,Hn),function(Tn,Un,Qn){if(0!==Qn.hiLevel&&Kn)for(var Dn,Hn=0;Hn<Tn.length;Hn++)1===Un[Hn]&&(Dn=Zn.indexOf(Tn[Hn]))>=0&&(Tn[Hn]=Zn[Dn+1])}(Dn,Qn,Hn),lr(2,Dn,Un,Qn,Hn),lr(1,Dn,Un,Qn,Hn),Dn.join("")};return this.__bidiEngine__.doBidiReorder=function(Tn,Un,Qn){if(function(Tn,Un){if(Un)for(var Qn=0;Qn<Tn.length;Qn++)Un[Qn]=Qn;void 0===Gn&&(Gn=ir(Tn)),void 0===zn&&(zn=ir(Tn))}(Tn,Un),Hn||!Vn||zn)if(Hn&&Vn&&Gn^zn)nr=Gn?1:0,Tn=ar(Tn,Un,Qn);else if(!Hn&&Vn&&zn)nr=Gn?1:0,Tn=cr(Tn,Un,Qn),Tn=ar(Tn,Un);else if(!Hn||Gn||Vn||zn){if(Hn&&!Vn&&Gn^zn)Tn=ar(Tn,Un),Gn?(nr=0,Tn=cr(Tn,Un,Qn)):(nr=1,Tn=cr(Tn,Un,Qn),Tn=ar(Tn,Un));else if(Hn&&Gn&&!Vn&&zn)nr=1,Tn=cr(Tn,Un,Qn),Tn=ar(Tn,Un);else if(!Hn&&!Vn&&Gn^zn){var Dn=Kn;Gn?(nr=1,Tn=cr(Tn,Un,Qn),nr=0,Kn=!1,Tn=cr(Tn,Un,Qn),Kn=Dn):(nr=0,Tn=cr(Tn,Un,Qn),Tn=ar(Tn,Un),nr=1,Kn=!1,Tn=cr(Tn,Un,Qn),Kn=Dn,Tn=ar(Tn,Un))}}else nr=0,Tn=cr(Tn,Un,Qn);else nr=Gn?1:0,Tn=cr(Tn,Un,Qn);return Tn},this.__bidiEngine__.setOptions=function(Tn){Tn&&(
2020-09-11 23:27:47 +00:00
/*! https://mths.be/cssesc v3.0.0 by @mathias */
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
var XP={}.hasOwnProperty,WP=/[ -,\.\/:-@\[-\^`\{-~]/,YP=/[ -,\.\/:-@\[\]\^`\{-~]/,JP=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,$P=function cssesc(Tn,Un){"single"!=(Un=function merge(Tn,Un){if(!Tn)return Un;var Qn={};for(var Dn in Un)Qn[Dn]=XP.call(Tn,Dn)?Tn[Dn]:Un[Dn];return Qn}(Un,cssesc.options)).quotes&&"double"!=Un.quotes&&(Un.quotes="single");for(var Qn="double"==Un.quotes?'"':"'",Dn=Un.isIdentifier,Hn=Tn.charAt(0),Gn="",Vn=0,zn=Tn.length;Vn<zn;){var Kn=Tn.charAt(Vn++),Xn=Kn.charCodeAt(),Wn=void 0;if(Xn<32||Xn>126){if(Xn>=55296&&Xn<=56319&&Vn<zn){var Yn=Tn.charCodeAt(Vn++);56320==(64512&Yn)?Xn=((1023&Xn)<<10)+(1023&Yn)+65536:Vn--}Wn="\\"+Xn.toString(16).toUpperCase()+" "}else Wn=Un.escapeEverything?WP.test(Kn)?"\\"+Kn:"\\"+Xn.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(Kn)?"\\"+Xn.toString(16).toUpperCase()+" ":"\\"==Kn||!Dn&&('"'==Kn&&Qn==Kn||"'"==Kn&&Qn==Kn)||Dn&&YP.test(Kn)?"\\"+Kn:Kn;Gn+=Wn}return Dn&&(/^-[-\d]/.test(Gn)?Gn="\\-"+Gn.slice(1):/\d/.test(Hn)&&(Gn="\\3"+Hn+" "+Gn.slice(1))),Gn=Gn.replace(JP,(function(Tn,Un,Qn){return Un&&Un.length%2?Tn:(Un||"")+Qn})),!Dn&&Un.wrap?Qn+Gn+Qn:Gn};$P.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1},$P.version="3.0.0";var ZP=$P,eF=/[a-z0-9_-]/i,tF=/[\s\t]/,nF=function parse(Tn){for(var Un,Qn,Dn=!0,Hn=0,Gn="",Vn=0,zn=[];;){if(Qn=Tn[Vn],0===Hn){if(!Qn&&Dn)break;if(!Qn&&!Dn)throw new Error("Parse error");if('"'===Qn||"'"===Qn)Un=Qn,Hn=1,Dn=!1;else if(tF.test(Qn));else{if(!eF.test(Qn))throw new Error("Parse error");Hn=3,Dn=!1,Vn--}}else if(1===Hn){if(!Qn)throw new Error("Parse Error");"\\"===Qn?Hn=2:Qn===Un?(zn.push(Gn),Gn="",Hn=4):Gn+=Qn}else if(2===Hn){if(Qn!==Un&&"\\"!==Qn)throw new Error("Parse error");Gn+=Qn,Hn=1}else if(3===Hn){if(!Qn){zn.push(Gn);break}if(eF.test(Qn))Gn+=Qn;else if(","===Qn)zn.push(Gn),Gn="",Hn=0;else{if(!tF.test(Qn))throw new Error("Parse error");Hn=5}}else if(5===Hn){if(!Qn){zn.push(Gn);break}if(eF.test(Qn))Gn+=" "+Qn,Hn=3;else if(","===Qn)zn.push(Gn),Gn="",Hn=0;else if(!tF.test(Qn))throw new Error("Parse error")}else if(4===Hn){if(!Qn)break;if(","===Qn)Hn=0;else if(!tF.test(Qn))throw new Error("Parse error")}Vn++}return zn},rF={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},iF=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function isDigit(Tn){return Tn>=48&&Tn<=57}function State(Tn){this.index=0,this.path=Tn,this.max=Tn.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function skipSpaces(Tn){for(;Tn.index<Tn.max&&(10===(Un=Tn.path.charCodeAt(Tn.index))||13===Un||8232===Un||8233===Un||32===Un||9===Un||11===Un||12===Un||160===Un||Un>=5760&&iF.indexOf(Un)>=0);)Tn.index++;var Un}function scanFlag(Tn){var Un=Tn.path.charCodeAt(Tn.index);return 48===Un?(Tn.param=0,void Tn.index++):49===Un?(Tn.param=1,void Tn.index++):void(Tn.err="SvgPath: arc flag can be 0 or 1 only (at pos "+Tn.index+")")}function scanParam(Tn){var Un,Qn=Tn.index,Dn=Qn,Hn=Tn.max,Gn=!1,Vn=!1,zn=!1,Kn=!1;if(Dn>=Hn)Tn.err="SvgPath: missed param (at pos "+Dn+")";else if(43!==(Un=Tn.path.charCodeAt(Dn))&&45!==Un||(Un=++Dn<Hn?Tn.path.charCodeAt(Dn):0),isDigit(Un)||46===Un){if(46!==Un){if(Gn=48===Un,Un=++Dn<Hn?Tn.path.charCodeAt(Dn):0,Gn&&Dn<Hn&&Un&&isDigit(Un))return void(Tn.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+Qn+")");for(;Dn<Hn&&isDigit(Tn.path.charCodeAt(Dn));)Dn++,Vn=!0;Un=Dn<Hn?Tn.path.charCodeAt(Dn):0}if(46===Un){for(Kn=!0,Dn++;isDigit(Tn.path.charCodeAt(Dn));)Dn++,zn=!0;Un=Dn<Hn?Tn.path.charCodeAt(Dn):0}if(101===Un||69===Un){if(Kn&&!Vn&&!zn)return void(Tn.err="SvgPath: invalid float exponent (at pos "+Dn+")");if(43!==(Un=++Dn<Hn?Tn.path.charCodeAt(Dn):0)&&45!==Un||Dn++,!(Dn<Hn&&isDigit(Tn.path.charCodeAt(Dn))))return void(Tn.err="SvgPath: invalid float exponent (at pos "+Dn+")");for(;Dn<Hn&&isDigit(Tn.path.charCodeAt(Dn));)Dn++}Tn.index=Dn,Tn.param=parseFloat(Tn.path.slice(Qn,Dn))+0}else Tn.err="SvgPath: param should start with 0..9 or `.` (at pos "+Dn+")"}function finalizeSegment(Tn){var Un,Qn;Qn=(Un=Tn.path[Tn.segmentStart]).toLowerCase(
2020-09-11 23:27:47 +00:00
/**
* @file jGraduate 0.4
*
* jQuery Plugin for a gradient picker
*
* @module jGraduate
* @copyright 2010 Jeff Schiller {@link http://blog.codedread.com/}, 2010 Alexis Deveria {@link http://a.deveria.com/}
*
* @license Apache-2.0
* @example
* // The Paint object is described below.
* $.jGraduate.Paint(); // constructs a 'none' color
* @example $.jGraduate.Paint({copy: o}); // creates a copy of the paint o
* @example $.jGraduate.Paint({hex: '#rrggbb'}); // creates a solid color paint with hex = "#rrggbb"
* @example $.jGraduate.Paint({linearGradient: o, a: 50}); // creates a linear gradient paint with opacity=0.5
* @example $.jGraduate.Paint({radialGradient: o, a: 7}); // creates a radial gradient paint with opacity=0.07
* @example $.jGraduate.Paint({hex: '#rrggbb', linearGradient: o}); // throws an exception?
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
var ZU="http://www.w3.org/2000/svg",eI="http://www.w3.org/1999/xlink";
2020-09-11 23:27:47 +00:00
/**
* @file jPicker (Adapted from version 1.1.6)
*
* jQuery Plugin for Photoshop style color picker
*
* @module jPicker
* @copyright (c) 2010 Christopher T. Tillman
* Digital Magic Productions, Inc. ({@link http://www.digitalmagicpro.com/})
* FREE to use, alter, copy, sell, and especially ENHANCE
* @license MIT
*
* Painstakingly ported from John Dyers' excellent work on his own color picker based on the Prototype framework.
*
* John Dyers' website: {@link http://johndyer.name}
* Color Picker page: {@link http://johndyer.name/photoshop-like-javascript-color-picker/}
*/
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
function toFixedNumeric(Tn,Un){return void 0===Un&&(Un=0),Math.round(Tn*Math.pow(10,Un))/Math.pow(10,Un)}window.console||(window.console={log:function log(Tn){},dir:function dir(Tn){}});var tI,nI=function isNullish(Tn){return null==Tn};function __variableDynamicImportRuntime0__(Tn){switch(Tn){case"./locale/lang.af.js":return Promise.resolve().then((function(){return GI}));case"./locale/lang.ar.js":return Promise.resolve().then((function(){return VI}));case"./locale/lang.az.js":return Promise.resolve().then((function(){return zI}));case"./locale/lang.be.js":return Promise.resolve().then((function(){return KI}));case"./locale/lang.bg.js":return Promise.resolve().then((function(){return qI}));case"./locale/lang.ca.js":return Promise.resolve().then((function(){return XI}));case"./locale/lang.cs.js":return Promise.resolve().then((function(){return WI}));case"./locale/lang.cy.js":return Promise.resolve().then((function(){return YI}));case"./locale/lang.da.js":return Promise.resolve().then((function(){return JI}));case"./locale/lang.de.js":return Promise.resolve().then((function(){return $I}));case"./locale/lang.el.js":return Promise.resolve().then((function(){return ZI}));case"./locale/lang.en.js":return Promise.resolve().then((function(){return eR}));case"./locale/lang.es.js":return Promise.resolve().then((function(){return tR}));case"./locale/lang.et.js":return Promise.resolve().then((function(){return nR}));case"./locale/lang.fa.js":return Promise.resolve().then((function(){return rR}));case"./locale/lang.fi.js":return Promise.resolve().then((function(){return iR}));case"./locale/lang.fr.js":return Promise.resolve().then((function(){return oR}));case"./locale/lang.fy.js":return Promise.resolve().then((function(){return aR}));case"./locale/lang.ga.js":return Promise.resolve().then((function(){return sR}));case"./locale/lang.gl.js":return Promise.resolve().then((function(){return lR}));case"./locale/lang.he.js":return Promise.resolve().then((function(){return cR}));case"./locale/lang.hi.js":return Promise.resolve().then((function(){return uR}));case"./locale/lang.hr.js":return Promise.resolve().then((function(){return dR}));case"./locale/lang.hu.js":return Promise.resolve().then((function(){return hR}));case"./locale/lang.hy.js":return Promise.resolve().then((function(){return pR}));case"./locale/lang.id.js":return Promise.resolve().then((function(){return AR}));case"./locale/lang.is.js":return Promise.resolve().then((function(){return fR}));case"./locale/lang.it.js":return Promise.resolve().then((function(){return gR}));case"./locale/lang.ja.js":return Promise.resolve().then((function(){return mR}));case"./locale/lang.ko.js":return Promise.resolve().then((function(){return _R}));case"./locale/lang.lt.js":return Promise.resolve().then((function(){return vR}));case"./locale/lang.lv.js":return Promise.resolve().then((function(){return yR}));case"./locale/lang.mk.js":return Promise.resolve().then((function(){return bR}));case"./locale/lang.ms.js":return Promise.resolve().then((function(){return wR}));case"./locale/lang.mt.js":return Promise.resolve().then((function(){return SR}));case"./locale/lang.nl.js":return Promise.resolve().then((function(){return xR}));case"./locale/lang.no.js":return Promise.resolve().then((function(){return CR}));case"./locale/lang.pl.js":return Promise.resolve().then((function(){return kR}));case"./locale/lang.pt-BR.js":return Promise.resolve().then((function(){return BR}));case"./locale/lang.pt-PT.js":return Promise.resolve().then((function(){return ER}));case"./locale/lang.ro.js":return Promise.resolve().then((function(){return NR}));case"./locale/lang.ru.js":return Promise.resolve().then((function(){return LR}));case"./locale/lang.sk.js":return Promise.resolve().then((function(){return TR}));case"./locale/lang.sl.js":return Promise.resolve().then((function(){return PR}));case"./locale/lang.sq.js":return Promise.resolve().then((function(){return FR}));case"./locale/lang.sr.js":return Promise.resolve().then((function(){return UR}));case"./locale/lang.sv.js":return Promise.resolve().then((function(){r
2020-09-11 23:27:47 +00:00
/**
* Localizing script for SVG-edit UI.
* @module locale
* @license MIT
*
* @copyright 2010 Narendra Sisodya
* @copyright 2010 Alexis Deveria
*
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
*/_export({target:"String",proto:!0,forced:stringHtmlForced("bold")},{bold:function bold(){return createHtml(this,"b","","")}});var rI=function setStrings(Tn,Un,Qn){var Dn=document.getElementById("svg_editor").parentNode;Object.entries(Un).forEach((function(Un){var Hn=_slicedToArray(Un,2),Gn=Hn[0],Vn=Hn[1];if(Vn){Qn&&(Gn="#"+Gn);var zn=Dn.querySelectorAll(Gn);if(zn.length){var Kn=zn[0];switch(Tn){case"aria-label":Kn.setAttribute("aria-label",Vn);break;case"content":_toConsumableArray(zn).some((function(Tn){return!(3!==Tn.nodeType||!Tn.textContent.trim())&&(Tn.textContent=Vn,!0)}));break;case"title":Kn.title=Vn}}else console.log("Missing element for localization: "+Gn)}else console.log(Gn)}))},iI=function readLang(Tn){var Un=Tn.tools,Qn=Tn.properties,Dn=Tn.config,Hn=Tn.layers,Gn=Tn.common,Vn=Tn.ui;rI("content",{curve_segments:Qn.curve_segments,fitToContent:Un.fitToContent,fit_to_all:Un.fit_to_all,fit_to_canvas:Un.fit_to_canvas,fit_to_layer_content:Un.fit_to_layer_content,fit_to_sel:Un.fit_to_sel,icon_large:Dn.icon_large,icon_medium:Dn.icon_medium,icon_small:Dn.icon_small,icon_xlarge:Dn.icon_xlarge,image_opt_embed:Dn.image_opt_embed,image_opt_ref:Dn.image_opt_ref,includedImages:Dn.included_images,largest_object:Un.largest_object,layersLabel:Hn.layers,page:Un.page,relativeToLabel:Un.relativeTo,selLayerLabel:Hn.move_elems_to,selectedPredefined:Dn.select_predefined,selected_objects:Un.selected_objects,smallest_object:Un.smallest_object,straight_segments:Qn.straight_segments,svginfo_bg_url:Dn.editor_img_url+":",svginfo_bg_note:Dn.editor_bg_note,svginfo_change_background:Dn.background,svginfo_dim:Dn.doc_dims,svginfo_editor_prefs:Dn.editor_prefs,svginfo_height:Gn.height,svginfo_icons:Dn.icon_size,svginfo_image_props:Dn.image_props,svginfo_lang:Dn.language,svginfo_title:Dn.doc_title,svginfo_width:Gn.width,tool_docprops_cancel:Gn.cancel,tool_docprops_save:Gn.ok,tool_source_cancel:Gn.cancel,tool_source_save:Gn.ok,tool_prefs_cancel:Gn.cancel,tool_prefs_save:Gn.ok,sidepanel_handle:Hn.layers.split("").join(" "),tool_clear:Un.new_doc,tool_docprops:Un.docprops,tool_export:Un.export_img,tool_import:Un.import_doc,tool_open:Un.open_doc,tool_save:Un.save_doc,tool_editor_prefs:Dn.editor_prefs,tool_editor_homepage:Un.editor_homepage,svginfo_units_rulers:Dn.units_and_rulers,svginfo_rulers_onoff:Dn.show_rulers,svginfo_unit:Dn.base_unit,svginfo_grid_settings:Dn.grid,svginfo_snap_onoff:Dn.snapping_onoff,svginfo_snap_step:Dn.snapping_stepsize,svginfo_grid_color:Dn.grid_color},!0);var zn={};["cut","copy","paste","paste_in_place","delete","group","ungroup","move_front","move_up","move_down","move_back"].forEach((function(Tn){zn['#cmenu_canvas a[href="#'+Tn+'"]']=Un[Tn]})),["dupe","merge_down","merge_all"].forEach((function(Tn){zn['#cmenu_layers a[href="#'+Tn+'"]']=Hn[Tn]})),zn['#cmenu_layers a[href="#delete"]']=Hn.del,rI("content",zn);var Kn={};return Object.entries({tool_blur:Qn.blur,tool_position:Un.align_to_page,tool_font_family:Qn.font_family,zoom_panel:Vn.zoom_level,stroke_linejoin:Qn.linejoin_miter,stroke_linecap:Qn.linecap_butt,tool_opacity:Qn.opacity}).forEach((function(Tn){var Un=_slicedToArray(Tn,2),Qn=Un[0],Dn=Un[1];Kn["#"+Qn+" button"]=Dn})),Object.entries({group_opacity:Qn.opacity,zoom:Vn.zoom_level}).forEach((function(Tn){var Un=_slicedToArray(Tn,2),Qn=Un[0],Dn=Un[1];Kn["#"+Qn]=Dn})),rI("aria-label",Kn),rI("title",{align_relative_to:Un.align_relative_to,circle_cx:Qn.circle_cx,circle_cy:Qn.circle_cy,circle_r:Qn.circle_r,cornerRadiusLabel:Qn.corner_radius,ellipse_cx:Qn.ellipse_cx,ellipse_cy:Qn.ellipse_cy,ellipse_rx:Qn.ellipse_rx,ellipse_ry:Qn.ellipse_ry,fill_color:Qn.fill_color,font_family:Qn.font_family,idLabel:Qn.id,image_height:Qn.image_height,image_url:Qn.image_url,image_width:Qn.image_width,layer_delete:Hn.del,layer_down:Hn.move_down,layer_new:Hn.new,layer_rename:Hn.rename,layer_moreopts:Gn.more_opts,layer_up:Hn.move_up,line_x1:Qn.line_x1,line_x2:Qn.line_x2,line_y1:Qn.line_y1,line_y2:Qn.line_y2,linecap_butt:Qn.linecap_butt,linecap_round:Qn.linecap_round,linecap_square:Qn.linecap_square,linejoin_bevel:Qn.linejoin_bevel,linejoin_mit
2020-09-11 23:27:47 +00:00
/*!
* html2canvas 1.0.0-rc.7 <https://html2canvas.hertzen.com>
* Copyright (c) 2020 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
*/
2020-09-18 20:43:34 +00:00
Tn.exports=function(){
2020-09-11 23:27:47 +00:00
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
var Tn=function extendStatics(Un,Qn){return(Tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Tn,Un){Tn.__proto__=Un}||function(Tn,Un){for(var Qn in Un)Un.hasOwnProperty(Qn)&&(Tn[Qn]=Un[Qn])})(Un,Qn)};function __extends(Un,Qn){function __(){this.constructor=Un}Tn(Un,Qn),Un.prototype=null===Qn?Object.create(Qn):(__.prototype=Qn.prototype,new __)}var Un=function __assign(){return(Un=Object.assign||function __assign(Tn){for(var Un,Qn=1,Dn=arguments.length;Qn<Dn;Qn++)for(var Hn in Un=arguments[Qn])Object.prototype.hasOwnProperty.call(Un,Hn)&&(Tn[Hn]=Un[Hn]);return Tn}).apply(this,arguments)};function __awaiter(Tn,Un,Qn,Dn){return new(Qn||(Qn=Promise))((function(Hn,Gn){function fulfilled(Tn){try{step(Dn.next(Tn))}catch(Tn){Gn(Tn)}}function rejected(Tn){try{step(Dn.throw(Tn))}catch(Tn){Gn(Tn)}}function step(Tn){Tn.done?Hn(Tn.value):new Qn((function(Un){Un(Tn.value)})).then(fulfilled,rejected)}step((Dn=Dn.apply(Tn,Un||[])).next())}))}function __generator(Tn,Un){var Qn,Dn,Hn,Gn,Vn={label:0,sent:function sent(){if(1&Hn[0])throw Hn[1];return Hn[1]},trys:[],ops:[]};return Gn={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(Gn[Symbol.iterator]=function(){return this}),Gn;function verb(Tn){return function(Un){return step([Tn,Un])}}function step(Gn){if(Qn)throw new TypeError("Generator is already executing.");for(;Vn;)try{if(Qn=1,Dn&&(Hn=2&Gn[0]?Dn.return:Gn[0]?Dn.throw||((Hn=Dn.return)&&Hn.call(Dn),0):Dn.next)&&!(Hn=Hn.call(Dn,Gn[1])).done)return Hn;switch(Dn=0,Hn&&(Gn=[2&Gn[0],Hn.value]),Gn[0]){case 0:case 1:Hn=Gn;break;case 4:return Vn.label++,{value:Gn[1],done:!1};case 5:Vn.label++,Dn=Gn[1],Gn=[0];continue;case 7:Gn=Vn.ops.pop(),Vn.trys.pop();continue;default:if(!((Hn=(Hn=Vn.trys).length>0&&Hn[Hn.length-1])||6!==Gn[0]&&2!==Gn[0])){Vn=0;continue}if(3===Gn[0]&&(!Hn||Gn[1]>Hn[0]&&Gn[1]<Hn[3])){Vn.label=Gn[1];break}if(6===Gn[0]&&Vn.label<Hn[1]){Vn.label=Hn[1],Hn=Gn;break}if(Hn&&Vn.label<Hn[2]){Vn.label=Hn[2],Vn.ops.push(Gn);break}Hn[2]&&Vn.ops.pop(),Vn.trys.pop();continue}Gn=Un.call(Tn,Vn)}catch(Tn){Gn=[6,Tn],Dn=0}finally{Qn=Hn=0}if(5&Gn[0])throw Gn[1];return{value:Gn[0]?Gn[1]:void 0,done:!0}}}for(var Qn=function(){function Bounds(Tn,Un,Qn,Dn){this.left=Tn,this.top=Un,this.width=Qn,this.height=Dn}return Bounds.prototype.add=function(Tn,Un,Qn,Dn){return new Bounds(this.left+Tn,this.top+Un,this.width+Qn,this.height+Dn)},Bounds.fromClientRect=function(Tn){return new Bounds(Tn.left,Tn.top,Tn.width,Tn.height)},Bounds}(),Dn=function parseBounds(Tn){return Qn.fromClientRect(Tn.getBoundingClientRect())},Hn=function parseDocumentSize(Tn){var Un=Tn.body,Dn=Tn.documentElement;if(!Un||!Dn)throw new Error("Unable to get document size");var Hn=Math.max(Math.max(Un.scrollWidth,Dn.scrollWidth),Math.max(Un.offsetWidth,Dn.offsetWidth),Math.max(Un.clientWidth,Dn.clientWidth)),Gn=Math.max(Math.max(Un.scrollHeight,Dn.scrollHeight),Math.max(Un.offsetHeight,Dn.offsetHeight),Math.max(Un.clientHeight,Dn.clientHeight));return new Qn(0,0,Hn,Gn)},Gn=function toCodePoints(Tn){for(var Un=[],Qn=0,Dn=Tn.length;Qn<Dn;){var Hn=Tn.charCodeAt(Qn++);if(Hn>=55296&&Hn<=56319&&Qn<Dn){var Gn=Tn.charCodeAt(Qn++);56320==(64512&Gn)?Un.push(((1023&Hn)<<10)+(1023&Gn)+65536):(Un.push(Hn),Qn--)}else Un.push(Hn)}return Un},Vn=function fromCodePoint(){for(var Tn=[],Un=0;Un<arguments.length;Un++)Tn[Un]=arguments[Un];if(String.fromCodePoint)return String.fromCodePoint.apply(String,Tn);var Qn=Tn.length;if(!Qn)return"";for(var Dn=[],Hn=-1,Gn="";++Hn<Qn;){var Vn=Tn[Hn];Vn<=65535?Dn.push(Vn):(Vn-=65536,Dn.push(55296+(Vn>>10),Vn%1024+56320)),(Hn+1===Qn||Dn.length>16384)&&(Gn+=String.fromCharCode.apply(String,Dn),Dn.length=0)}return Gn},zn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Kn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Xn=0;Xn<zn.length;Xn++)Kn[zn.charCodeAt(Xn)]=Xn;var Wn,Yn=function decode(Tn){var Un,Qn,Dn,Hn,Gn,Vn=.75*Tn.length,zn=Tn.length,Xn=0;"="===Tn[Tn.length-1]&&(Vn--,"="===Tn[Tn.length-2]&&Vn--);var Wn="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.sli
2020-09-11 23:27:47 +00:00
/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */
Refactor canvas in multiple pieces to increase maintainability (#446) * #refactor-canvas getJsonFromSvgElement and svgroot code moved to separate file * #refactor-canvas build files changes * #refactor-canvas addSVGElementsFromJson move to json file * #refactor-canvas selected element option function move separate file * #refactor-canvas moveUpDownSelected move to select-elem * ##refactor-canvas build file updated * #refactor-canvas moveSelectedElements move to selected-elem * #refactor-canvas cloneSelectedElements move to slected-elem * #refactor-canvas alignSelectedElements move to selected-elem * #refactor-canvas deleteSelectedElements move to selected-elem * #refactor-canvas copySelectedElements and groupSelectedElements move to selected-elem * #refactor-canvas pushGroupProperty, ungroupSelectedElement move to selected-elem * #refactor-canvas comment changes * #refactor-canvas UndoManager move to separate file * #refactor-canvas event file move to mouseMove, mouseUpEvent and dblClickEvent * #refactor-canvas mouseDown move to event * #refactor-canvas move to undo file * #refactor alignment changes and set function revert return * #refactor-canvas textaction move to separate file * #refactor-canvas paste-element function move to separate file * #refactor-canvas set and get method move to separate file * #refactor-canvas set and get function moved changes * #refactor clear file import and regaring function moved changes changes * #refactor-canvas svg related function move to separate file * #refactor-canvas setBackground methos move to elem-get-set file * #refactor-canvas getBsplinePoint method move to event file * #refactor-canvas export functions move to svg-exec * #refactor-canvas svg related function moved separate file * #refactor-canvas updateCanvas, cycleElement move to selected-elem file * #refactor-canvas removeUnusedDefElems move to svg-exec file * #refactor-canvas blur method move to separate file blur-event.js * #refactor-canvas selection related function move to separate file slection.js * #refactor-canvas convertGradients, mousewheelmove event bind function move to other files * #refactor-canvas extension function move to selection file * #refactor-canvas svg tag long string changes to es6 format * eslint fixes * eslint and test fixes * add netlify logo per their requirements * #refactor-canvas path file separate to path-method.js and path-actions.js * #refactor-canvas lint issue fixed * #refactor-canvas path.js file class and const move to path-method.js * #refactor-canvas eslint issue fixed. 'jsdoc/check-examples': 'off' already so removed eslint-disable jsdoc/check-examples * #refactor-canvas path class moved changes and copy-elem.js file cypress test issue fixed * #refactor-canvas UI - Clipboard paste element cypress issue fixed * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test cases issue fixed changes * #refactor-canvas cypress test case issue fixed * npm update and fix a few eslint new errors * fix snapshot and run tests * add star tool to cypress * #refactor-canvas shapelibrary, star, polygon and panning tool issue fixed * build * Update layer.js * revert proper declarations Authored-by OptimistikSAS
2020-11-11 10:38:45 +00:00
Tn.exports=function(){function _toConsumableArray(Tn){if(Array.isArray(Tn)){for(var Un=0,Qn=Array(Tn.length);Un<Tn.length;Un++)Qn[Un]=Tn[Un];return Qn}return Array.from(Tn)}var Tn=Object.hasOwnProperty,Un=Object.setPrototypeOf,Qn=Object.isFrozen,Dn=Object.keys,Hn=Object.freeze,Gn=Object.seal,Vn="undefined"!=typeof Reflect&&Reflect,zn=Vn.apply,Kn=Vn.construct;zn||(zn=function apply(Tn,Un,Qn){return Tn.apply(Un,Qn)}),Hn||(Hn=function freeze(Tn){return Tn}),Gn||(Gn=function seal(Tn){return Tn}),Kn||(Kn=function construct(Tn,Un){return new(Function.prototype.bind.apply(Tn,[null].concat(_toConsumableArray(Un))))});var Xn=unapply(Array.prototype.forEach),Wn=unapply(Array.prototype.indexOf),Yn=unapply(Array.prototype.join),Jn=unapply(Array.prototype.pop),$n=unapply(Array.prototype.push),Zn=unapply(Array.prototype.slice),er=unapply(String.prototype.toLowerCase),tr=unapply(String.prototype.match),nr=unapply(String.prototype.replace),rr=unapply(String.prototype.indexOf),ir=unapply(String.prototype.trim),or=unapply(RegExp.prototype.test),ar=unconstruct(RegExp),sr=unconstruct(TypeError);function unapply(Tn){return function(Un){for(var Qn=arguments.length,Dn=Array(Qn>1?Qn-1:0),Hn=1;Hn<Qn;Hn++)Dn[Hn-1]=arguments[Hn];return zn(Tn,Un,Dn)}}function unconstruct(Tn){return function(){for(var Un=arguments.length,Qn=Array(Un),Dn=0;Dn<Un;Dn++)Qn[Dn]=arguments[Dn];return Kn(Tn,Qn)}}function addToSet(Tn,Dn){Un&&Un(Tn,null);for(var Hn=Dn.length;Hn--;){var Gn=Dn[Hn];if("string"==typeof Gn){var Vn=er(Gn);Vn!==Gn&&(Qn(Dn)||(Dn[Hn]=Vn),Gn=Vn)}Tn[Gn]=!0}return Tn}function clone(Un){var Qn={},Dn=void 0;for(Dn in Un)zn(Tn,Un,[Dn])&&(Qn[Dn]=Un[Dn]);return Qn}var lr=Hn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),cr=Hn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),ur=Hn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),dr=Hn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),hr=Hn(["#text"]),pr=Hn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","i
2020-09-11 23:27:47 +00:00
//# sourceMappingURL=xdomain-index.js.map