From 93a657fda517dea1493f53b302f1577534d74526 Mon Sep 17 00:00:00 2001 From: kangax Date: Thu, 13 Dec 2012 15:45:40 +0100 Subject: [PATCH] Build distribution. --- dist/all.js | 137 +++++++++++++++++++++++++++------------------ dist/all.min.js | 2 +- dist/all.min.js.gz | Bin 41191 -> 41193 bytes 3 files changed, 84 insertions(+), 55 deletions(-) diff --git a/dist/all.js b/dist/all.js index 8f0b955d..532bb59e 100644 --- a/dist/all.js +++ b/dist/all.js @@ -2071,8 +2071,8 @@ fabric.Observable.off = fabric.Observable.stopObserving; * @memberOf fabric.util * @method groupSVGElements * @param {Array} elements - * @param {Object} options optional - * @return {String} path optional + * @param {Object} [options] Options object + * @return {fabric.Object|fabric.PathGroup} */ function groupSVGElements(elements, options, path) { var object = elements.length > 1 @@ -3799,7 +3799,7 @@ fabric.util.string = { * @method parseElements * @param {Array} elements Array of elements to parse * @param {Function} callback Being passed an array of fabric instances (transformed from SVG elements) - * @param {Object} options Options object + * @param {Object} [options] Options object * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ function parseElements(elements, callback, options, reviver) { @@ -4218,6 +4218,7 @@ fabric.util.string = { fabric.Gradient = fabric.util.createClass(/** @scope fabric.Gradient.prototype */ { /** + * Constructor * @method initialize * @param options optional Options with x1, y1, x2, y2 and colorStops */ @@ -4268,6 +4269,7 @@ fabric.util.string = { fabric.util.object.extend(fabric.Gradient, { /** + * Returns {@link fabric.Gradient} instance from an SVG element * @method fromElement * @static * @memberof fabric.Gradient @@ -4323,8 +4325,11 @@ fabric.util.string = { }, /** + * Returns {@link fabric.Gradient} instance from its object representation * @method forObject * @static + * @param obj + * @param [options] * @memberof fabric.Gradient */ forObject: function(obj, options) { @@ -5269,7 +5274,7 @@ fabric.util.string = { /** * @method _initOptions - * @param {Object} options + * @param {Object} [options] */ _initOptions: function (options) { for (var prop in options) { @@ -6269,9 +6274,9 @@ fabric.util.string = { * It converts the hand writting to a SVG Path and adds this * path to the canvas. * - * @metod init - * @param fabricCanvas {FabricCanvas} - * + * @metod initialize + * @param fabricCanvas {fabric.Canvas} + * @return {fabric.FreeDrawing} */ initialize: function(fabricCanvas) { this.canvas = fabricCanvas; @@ -6377,9 +6382,11 @@ fabric.util.string = { }, /** - * @method getPathBoundingBox - * @param points {Array of points} - */ + * Retursn bounding box of a path based on given points + * @method getPathBoundingBox + * @param points {Array} + * @return {Object} + */ getPathBoundingBox: function(points) { var xBounds = [], yBounds = [], @@ -9867,12 +9874,14 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { } /** + * Line class * @class Line * @extends fabric.Object */ fabric.Line = fabric.util.createClass(fabric.Object, /** @scope fabric.Line.prototype */ { /** + * Type of an object * @property * @type String */ @@ -9905,7 +9914,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { /** * @private * @method _setWidthHeight - * @param {Object} options + * @param {Object} [options] Options */ _setWidthHeight: function(options) { options || (options = { }); @@ -9983,9 +9992,9 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { }, /** - * Returns svg representation of an instance + * Returns SVG representation of an instance * @method toSVG - * @return {string} svg representation of an instance + * @return {String} svg representation of an instance */ toSVG: function() { return [ @@ -10053,12 +10062,14 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { } /** + * Circle class * @class Circle * @extends fabric.Object */ fabric.Circle = fabric.util.createClass(fabric.Object, /** @scope fabric.Circle.prototype */ { /** + * Type of an object * @property * @type String */ @@ -10174,10 +10185,10 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { * Returns {@link fabric.Circle} instance from an SVG element * @static * @method fabric.Circle.fromElement - * @param element {SVGElement} element to parse - * @param options {Object} options object + * @param {SVGElement} element Element to parse + * @param {Object} [options] Options object * @throws {Error} If value of `r` attribute is missing or invalid - * @return {Object} instance of fabric.Circle + * @return {Object} Instance of fabric.Circle */ fabric.Circle.fromElement = function(element, options) { options || (options = { }); @@ -10225,12 +10236,14 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { } /** + * Triangle class * @class Triangle * @extends fabric.Object */ fabric.Triangle = fabric.util.createClass(fabric.Object, /** @scope fabric.Triangle.prototype */ { /** + * Type of an object * @property * @type String */ @@ -10239,7 +10252,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { /** * Constructor * @method initialize - * @param options {Object} options object + * @param {Object} [options] Options object * @return {Object} thisArg */ initialize: function(options) { @@ -10284,9 +10297,9 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { }, /** - * Returns svg representation of an instance + * Returns SVG representation of an instance * @method toSVG - * @return {string} svg representation of an instance + * @return {String} svg representation of an instance */ toSVG: function() { @@ -10333,12 +10346,14 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { } /** + * Ellipse class * @class Ellipse * @extends fabric.Object */ fabric.Ellipse = fabric.util.createClass(fabric.Object, /** @scope fabric.Ellipse.prototype */ { /** + * Type of an object * @property * @type String */ @@ -10348,7 +10363,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { * Constructor * @method initialize * @param {Object} [options] Options object - * @return {Object} thisArg + * @return {fabric.Ellipse} thisArg */ initialize: function(options) { options = options || { }; @@ -10498,6 +10513,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { } /** + * Rectangle class * @class Rect * @extends fabric.Object */ @@ -10527,7 +10543,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { /** * Constructor * @method initialize - * @param options {Object} options object + * @param {Object} [options] Options object * @return {Object} thisArg */ initialize: function(options) { @@ -10536,6 +10552,9 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { this._initStateProperties(); this.callSuper('initialize', options); this._initRxRy(); + + this.x = 0; + this.y = 0; }, /** @@ -10549,6 +10568,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { }, /** + * Initializes rx/ry attributes * @private * @method _initRxRy */ @@ -10653,7 +10673,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { /** * Returns svg representation of an instance * @method toSVG - * @return {string} svg representation of an instance + * @return {String} svg representation of an instance */ toSVG: function() { return ''+ @@ -12768,7 +12787,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { /** * Returns a clone of an instance - * @mthod clone + * @method clone * @param {Array} propertiesToInclude * @param {Function} callback Callback is invoked with a clone as a first argument */ @@ -12872,7 +12891,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { /** * @private * @method _initConfig - * @param {Object} options Options object + * @param {Object} [options] Options object */ _initConfig: function(options) { options || (options = { }); @@ -12896,7 +12915,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { /** * @private * @method _setWidthHeight - * @param {Object} options Object with width/height properties + * @param {Object} [options] Object with width/height properties */ _setWidthHeight: function(options) { this.width = 'width' in options @@ -12925,14 +12944,19 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { */ fabric.Image.CSS_CANVAS = "canvas-img"; + /** + * Alias for getSrc + * @static + * @method getSvgSrc + */ fabric.Image.prototype.getSvgSrc = fabric.Image.prototype.getSrc; /** * Creates an instance of fabric.Image from its object representation * @static * @method fromObject - * @param object {Object} - * @param callback {Function} optional + * @param {Object} object + * @param {Function} [callback] Callback to invoke when an image instance is created */ fabric.Image.fromObject = function(object, callback) { var img = fabric.document.createElement('img'), @@ -13001,6 +13025,11 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, { fabric.Image.fromURL(parsedAttributes['xlink:href'], callback, extend(parsedAttributes, options)); }; + /** + * Indicates that instances of this type are async + * @static + * @type Boolean + */ fabric.Image.async = true; })(typeof exports !== 'undefined' ? exports : this); @@ -14398,7 +14427,7 @@ fabric.Image.filters.Pixelate.fromObject = function(object) { }, /** - * Returns svg representation of an instance + * Returns SVG representation of an instance * @method toSVG * @return {string} svg representation of an instance */ diff --git a/dist/all.min.js b/dist/all.min.js index 47c56b1d..c6f4b20a 100644 --- a/dist/all.min.js +++ b/dist/all.min.js @@ -1,5 +1,5 @@ /* build: `node build.js modules=ALL` *//*! Fabric.js Copyright 2008-2012, Printio (Juriy Zaytsev, Maxim Chernyak) */var fabric=fabric||{version:"0.9.30"};typeof exports!="undefined"&&(exports.fabric=fabric),typeof document!="undefined"&&typeof window!="undefined"?(fabric.document=document,fabric.window=window):(fabric.document=require("jsdom").jsdom(""),fabric.window=fabric.document.createWindow()),fabric.isTouchSupported="ontouchstart"in fabric.document.documentElement,fabric.isLikelyNode=typeof Buffer!="undefined"&&typeof window=="undefined";var Cufon=function(){function r(e){var t=this.face=e.face;this.glyphs=e.glyphs,this.w=e.w,this.baseSize=parseInt(t["units-per-em"],10),this.family=t["font-family"].toLowerCase(),this.weight=t["font-weight"],this.style=t["font-style"]||"normal",this.viewBox=function(){var e=t.bbox.split(/\s+/),n={minX:parseInt(e[0],10),minY:parseInt(e[1],10),maxX:parseInt(e[2],10),maxY:parseInt(e[3],10)};return n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.toString=function(){return[this.minX,this.minY,this.width,this.height].join(" ")},n}(),this.ascent=-parseInt(t.ascent,10),this.descent=-parseInt(t.descent,10),this.height=-this.ascent+this.descent}function i(){var e={},t={oblique:"italic",italic:"oblique"};this.add=function(t){(e[t.style]||(e[t.style]={}))[t.weight]=t},this.get=function(n,r){var i=e[n]||e[t[n]]||e.normal||e.italic||e.oblique;if(!i)return null;r={normal:400,bold:700}[r]||parseInt(r,10);if(i[r])return i[r];var s={1:1,99:0}[r%100],o=[],u,a;s===undefined&&(s=r>400),r==500&&(r=400);for(var f in i){f=parseInt(f,10);if(!u||fa)a=f;o.push(f)}return ra&&(r=a),o.sort(function(e,t){return(s?e>r&&t>r?et:et:e=i.length+e?r():setTimeout(arguments.callee,10)}),function(t){e?t():n.push(t)}}(),supports:function(e,t){var n=fabric.document.createElement("span").style;return n[e]===undefined?!1:(n[e]=t,n[e]===t)},textAlign:function(e,t,n,r){return t.get("textAlign")=="right"?n>0&&(e=" "+e):nk&&(k=N),A.push(N),N=0;continue}var O=t.glyphs[T[b]]||t.missingGlyph;if(!O)continue;N+=C=Number(O.w||t.w)+h}A.push(N),N=Math.max(k,N);var M=[];for(var b=A.length;b--;)M[b]=N-A[b];if(C===null)return null;d+=l.width-C,m+=l.minX;var _,D;if(f)_=u,D=u.firstChild;else{_=fabric.document.createElement("span"),_.className="cufon cufon-canvas",_.alt=n,D=fabric.document.createElement("canvas"),_.appendChild(D);if(i.printable){var P=fabric.document.createElement("span");P.className="cufon-alt",P.appendChild(fabric.document.createTextNode(n)),_.appendChild(P)}}var H=_.style,B=D.style||{},j=c.convert(l.height-p+v),F=Math.ceil(j),I=F/j;D.width=Math.ceil(c.convert(N+d-m)*I),D.height=F,p+=l.minY,B.top=Math.round(c.convert(p-t.ascent))+"px",B.left=Math.round(c.convert(m))+"px";var q=Math.ceil(c.convert(N*I)),R=q+"px",U=c.convert(t.height),z=(i.lineHeight-1)*c.convert(-t.ascent/5)*(L-1);Cufon.textOptions.width=q,Cufon.textOptions.height=U*L+z,Cufon.textOptions.lines=L,Cufon.textOptions.totalLineHeight=z,e?(H.width=R,H.height=U+"px"):(H.paddingLeft=R,H.paddingBottom=U-1+"px");var W=Cufon.textOptions.context||D.getContext("2d"),X=F/l.height;Cufon.textOptions.fontAscent=t.ascent*X,Cufon.textOptions.boundaries=null;for(var V=Cufon.textOptions.shadowOffsets,b=y.length;b--;)V[b]=[y[b][0]*X,y[b][1]*X];W.save(),W.scale(X,X),W.translate(-m-1/X*D.width/2+(Cufon.fonts[t.family].offsetLeft||0),-p-Cufon.textOptions.height/X/2+(Cufon.fonts[t.family].offsetTop||0)),W.lineWidth=t.face["underline-thickness"],W.save();var J=Cufon.getTextDecoration(i),K=i.fontStyle==="italic";W.save(),Q();if(g)for(var b=0,w=g.length;b.cufon-vml-canvas{text-indent:0}@media screen{cvml\\:shape,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute}.cufon-vml-canvas{position:absolute;text-align:left}.cufon-vml{display:inline-block;position:relative;vertical-align:middle}.cufon-vml .cufon-alt{position:absolute;left:-10000in;font-size:1px}a .cufon-vml{cursor:pointer}}@media print{.cufon-vml *{display:none}.cufon-vml .cufon-alt{display:inline}}'),function(e,t,i,s,o,u,a){var f=t===null;f&&(t=o.alt);var l=e.viewBox,c=i.computedFontSize||(i.computedFontSize=new Cufon.CSS.Size(n(u,i.get("fontSize"))+"px",e.baseSize)),h=i.computedLSpacing;h==undefined&&(h=i.get("letterSpacing"),i.computedLSpacing=h=h=="normal"?0:~~c.convertFrom(r(u,h)));var p,d;if(f)p=o,d=o.firstChild;else{p=fabric.document.createElement("span"),p.className="cufon cufon-vml",p.alt=t,d=fabric.document.createElement("span"),d.className="cufon-vml-canvas",p.appendChild(d);if(s.printable){var v=fabric.document.createElement("span");v.className="cufon-alt",v.appendChild(fabric.document.createTextNode(t)),p.appendChild(v)}a||p.appendChild(fabric.document.createElement("cvml:shape"))}var m=p.style,g=d.style,y=c.convert(l.height),b=Math.ceil(y),w=b/y,E=l.minX,S=l.minY;g.height=b,g.top=Math.round(c.convert(S-e.ascent)),g.left=Math.round(c.convert(E)),m.height=c.convert(e.height)+"px";var x=Cufon.getTextDecoration(s),T=i.get("color"),N=Cufon.CSS.textTransform(t,i).split(""),C=0,k=0,L=null,A,O,M=s.textShadow;for(var _=0,D=0,P=N.length;_r?n:i-t;s(u(l,a,c,n));if(i>r||o()){e.onComplete&&e.onComplete();return}f(h)}()}function l(e,t,n){if(e){var r=new Image;r.onload=function(){t&&t.call(n,r),r=r.onload=null},r.src=e}else t&&t.call(n,e)}function c(e,t){function n(e){return fabric[fabric.util.string.camelize(fabric.util.string.capitalize(e))]}function r(){++s===o&&t&&t(i)}var i=[],s=0,o=e.length;e.forEach(function(e,t){if(!e.type)return;var s=n(e.type);s.async?s.fromObject(e,function(e){i[t]=e,r()}):(i[t]=s.fromObject(e),r())})}function h(e,t,n){var r=e.length>1?new fabric.PathGroup(e,t):e[0];return typeof n!="undefined"&&r.setSourcePath(n),r}function p(e,t,n){if(n&&Object.prototype.toString.call(n)==="[object Array]")for(var r=0,i=n.length;r=r&&(r=e[n][t]);else while(n--)e[n]>=r&&(r=e[n]);return r}function r(e,t){if(!e||e.length===0)return undefined;var n=e.length-1,r=t?e[n][t]:e[n];if(t)while(n--)e[n][t]>>0;if(n===0)return-1;var r=0;arguments.length>0&&(r=Number(arguments[1]),r!==r?r=0:r!==0&&r!==1/0&&r!==-1/0&&(r=(r>0||-1)*Math.floor(Math.abs(r))));if(r>=n)return-1;var i=r>=0?r:Math.max(n-Math.abs(r),0);for(;i>>0;n>>0;r>>0;n>>0;n>>0;i>>0,n=0,r;if(arguments.length>1)r=arguments[1];else do{if(n in this){r=this[n++];break}if(++n>=t)throw new TypeError}while(!0);for(;n/g,">")}String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,"")}),fabric.util.string={camelize:e,capitalize:t,escapeXml:n}}(),function(){var e=Array.prototype.slice,t=Function.prototype.apply,n=function(){};Function.prototype.bind||(Function.prototype.bind=function(r){var i=this,s=e.call(arguments,1),o;return s.length?o=function(){return t.call(i,this instanceof n?this:r,s.concat(e.call(arguments)))}:o=function(){return t.call(i,this instanceof n?this:r,arguments)},n.prototype=this.prototype,o.prototype=new n,o})}(),function(){function i(){}function s(t){var n=this.constructor.superclass.prototype[t];return arguments.length>1?n.apply(this,e.call(arguments,1)):n.call(this)}function o(){function u(){this.initialize.apply(this,arguments)}var n=null,o=e.call(arguments,0);typeof o[0]=="function"&&(n=o.shift()),u.superclass=n,u.subclasses=[],n&&(i.prototype=n.prototype,u.prototype=new i,n.subclasses.push(u));for(var a=0,f=o.length;a-1?s(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var r in t)if(r==="opacity")s(e,t[r]);else{var i=r==="float"||r==="cssFloat"?typeof n.styleFloat=="undefined"?"cssFloat":"styleFloat":r;n[i]=t[r]}return e}var t=fabric.document.createElement("div"),n=typeof t.style.opacity=="string",r=typeof t.style.filter=="string",i=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,s=function(e){return e};n?s=function(e,t){return e.style.opacity=t,e}:r&&(s=function(e,t){var n=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(n.zoom=1),i.test(n.filter)?(t=t>=.9999?"":"alpha(opacity="+t*100+")",n.filter=n.filter.replace(i,t)):n.filter+=" alpha(opacity="+t*100+")",e}),fabric.util.setStyle=e}(),function(){function t(e){return typeof e=="string"?fabric.document.getElementById(e):e}function s(e,t){var n=fabric.document.createElement(e);for(var r in t)r==="class"?n.className=t[r]:r==="for"?n.htmlFor=t[r]:n.setAttribute(r,t[r]);return n}function o(e,t){(" "+e.className+" ").indexOf(" "+t+" ")===-1&&(e.className+=(e.className?" ":"")+t)}function u(e,t,n){return typeof t=="string"&&(t=s(t,n)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t}function a(e){var t=0,n=0;do t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent;while(e);return{left:n,top:t}}var e=Array.prototype.slice,n=function(t){return e.call(t,0)},r;try{r=n(fabric.document.childNodes)instanceof Array}catch(i){}r||(n=function(e){var t=new Array(e.length),n=e.length;while(n--)t[n]=e[n];return t});var f;fabric.document.defaultView&&fabric.document.defaultView.getComputedStyle?f=function(e){return fabric.document.defaultView.getComputedStyle(e,null).position}:f=function(e){var t=e.style.position;return!t&&e.currentStyle&&(t=e.currentStyle.position),t},function(){function n(e){return typeof e.onselectstart!="undefined"&&(e.onselectstart=fabric.util.falseFunction),t?e.style[t]="none":typeof e.unselectable=="string"&&(e.unselectable="on"),e}function r(e){return typeof e.onselectstart!="undefined"&&(e.onselectstart=null),t?e.style[t]="":typeof e.unselectable=="string"&&(e.unselectable=""),e}var e=fabric.document.documentElement.style,t="userSelect"in e?"userSelect":"MozUserSelect"in e?"MozUserSelect":"WebkitUserSelect"in e?"WebkitUserSelect":"KhtmlUserSelect"in e?"KhtmlUserSelect":"";fabric.util.makeElementUnselectable=n,fabric.util.makeElementSelectable=r}(),function(){function e(e,t){var n=fabric.document.getElementsByTagName("head")[0],r=fabric.document.createElement("script"),i=!0;r.type="text/javascript",r.setAttribute("runat","server"),r.onload=r.onreadystatechange=function(e){if(i){if(typeof this.readyState=="string"&&this.readyState!=="loaded"&&this.readyState!=="complete")return; i=!1,t(e||fabric.window.event),r=r.onload=r.onreadystatechange=null}},r.src=e,n.appendChild(r)}fabric.util.getScript=e}(),fabric.util.getById=t,fabric.util.toArray=n,fabric.util.makeElement=s,fabric.util.addClass=o,fabric.util.wrapElement=u,fabric.util.getElementOffset=a,fabric.util.getElementPosition=f}(),function(){function e(e,t){return e+(/\?/.test(e)?"&":"?")+t}function n(){}function r(r,i){i||(i={});var s=i.method?i.method.toUpperCase():"GET",o=i.onComplete||function(){},u=t(),a;return u.onreadystatechange=function(){u.readyState===4&&(o(u),u.onreadystatechange=n)},s==="GET"&&(a=null,typeof i.parameters=="string"&&(r=e(r,i.parameters))),u.open(s,r,!0),(s==="POST"||s==="PUT")&&u.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),u.send(a),u}var t=function(){var e=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP.3.0")},function(){return new XMLHttpRequest}];for(var t=e.length;t--;)try{var n=e[t]();if(n)return e[t]}catch(r){}}();fabric.util.request=r}(),function(){function e(e,t,n,r){return n*(e/=r)*e+t}function t(e,t,n,r){return-n*(e/=r)*(e-2)+t}function n(e,t,n,r){return e/=r/2,e<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}function r(e,t,n,r){return n*(e/=r)*e*e+t}function i(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function s(e,t,n,r){return e/=r/2,e<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t}function o(e,t,n,r){return n*(e/=r)*e*e*e+t}function u(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t}function a(e,t,n,r){return e/=r/2,e<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t}function f(e,t,n,r){return n*(e/=r)*e*e*e*e+t}function l(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t}function c(e,t,n,r){return e/=r/2,e<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t}function h(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}function p(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t}function d(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t}function v(e,t,n,r){return e===0?t:n*Math.pow(2,10*(e/r-1))+t}function m(e,t,n,r){return e===r?t+n:n*(-Math.pow(2,-10*e/r)+1)+t}function g(e,t,n,r){return e===0?t:e===r?t+n:(e/=r/2,e<1?n/2*Math.pow(2,10*(e-1))+t:n/2*(-Math.pow(2,-10*--e)+2)+t)}function y(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t}function b(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t}function w(e,t,n,r){return e/=r/2,e<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t}function E(e,t,n,r){var i=1.70158,s=0,o=n;return e===0?t:(e/=r,e===1?t+n:(s||(s=r*.3),o-1;e=e.split(/\s+/);var n=[],r,i;if(t){r=0,i=e.length;for(;r/i,"")));if(!s.documentElement)return;t.parseSVGDocument(s.documentElement,function(r,i){d.set(e,{objects:t.util.array.invoke(r,"toObject"),options:i}),n(r,i)},r)}e=e.replace(/^\n\s*/,"").trim(),d.has(e,function(r){r?d.get(e,function(e){var t=m(e);n(t.objects,t.options)}):new t.util.request(e,{method:"get",onComplete:i})})}function m(e){var n=e.objects,i=e.options;return n=n.map(function(e){return t[r(e.type)].fromObject(e)}),{objects:n,options:i}}function g(e,n,r){e=e.trim();var i;if(typeof DOMParser!="undefined"){var s=new DOMParser;s&&s.parseFromString&&(i=s.parseFromString(e,"text/xml"))}else t.window.ActiveXObject&&(i=new ActiveXObject("Microsoft.XMLDOM"),i.async="false",i.loadXML(e.replace(//i,"")));t.parseSVGDocument(i.documentElement,function(e,t){n(e,t)},r)}function y(e){var t="";for(var n=0,r=e.length;n",'",""].join("")),t}var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.string.capitalize,i=t.util.object.clone,s={cx:"left",x:"left",cy:"top",y:"top",r:"radius","fill-opacity":"opacity","fill-rule":"fillRule","stroke-width":"strokeWidth",transform:"transformMatrix","text-decoration":"textDecoration","font-size":"fontSize","font-weight":"fontWeight","font-style":"fontStyle","font-family":"fontFamily"};t.parseTransformAttribute=function(){function e(e,t){var n=t[0];e[0]=Math.cos(n),e[1]=Math.sin(n),e[2]=-Math.sin(n),e[3]=Math.cos(n)}function t(e,t){var n=t[0],r=t.length===2?t[1]:t[0];e[0]=n,e[3]=r}function n(e,t){e[2]=t[0]}function r(e,t){e[1]=t[0]}function i(e,t){e[4]=t[0],t.length===2&&(e[5]=t[1])}var s=[1,0,0,1,0,0],o="(?:[-+]?\\d+(?:\\.\\d+)?(?:e[-+]?\\d+)?)",u="(?:\\s+,?\\s*|,\\s*)",a="(?:(skewX)\\s*\\(\\s*("+o+")\\s*\\))",f="(?:(skewY)\\s*\\(\\s*("+o+")\\s*\\))",l="(?:(rotate)\\s*\\(\\s*("+o+")(?:"+u+"("+o+")"+u+"("+o+"))?\\s*\\))",c="(?:(scale)\\s*\\(\\s*("+o+")(?:"+u+"("+o+"))?\\s*\\))",h="(?:(translate)\\s*\\(\\s*("+o+")(?:"+u+"("+o+"))?\\s*\\))",p="(?:(matrix)\\s*\\(\\s*("+o+")"+u+"("+o+")"+u+"("+o+")"+u+"("+o+")"+u+"("+o+")"+u+"("+o+")"+"\\s*\\))",d="(?:"+p+"|"+h+"|"+c+"|"+l+"|"+a+"|"+f+")",v="(?:"+d+"(?:"+u+d+")*"+")",m="^\\s*(?:"+v+"?)\\s*$",g=new RegExp(m),y=new RegExp(d);return function(o){var u=s.concat();return!o||o&&!g.test(o)?u:(o.replace(y,function(s){var o=(new RegExp(d)).exec(s).filter(function(e){return e!==""&&e!=null}),a=o[1],f=o.slice(2).map(parseFloat);switch(a){case"translate":i(u,f);break;case"rotate":e(u,f);break;case"scale":t(u,f);break;case"skewX":n(u,f);break;case"skewY":r(u,f);break;case"matrix":u=f}}),u)}}(),t.parseSVGDocument=function(){function s(e,t){while(e&&(e=e.parentNode))if(t.test(e.nodeName))return!0;return!1}var e=/^(path|circle|polygon|polyline|ellipse|rect|line|image|text)$/,n="(?:[-+]?\\d+(?:\\.\\d+)?(?:e[-+]?\\d+)?)",r=new RegExp("^\\s*("+n+"+)\\s*,?"+"\\s*("+n+"+)\\s*,?"+"\\s*("+n+"+)\\s*,?"+"\\s*("+n+"+)\\s*"+"$");return function(n,o,u){if(!n)return;var a=new Date,f=t.util.toArray(n.getElementsByTagName("*"));if(f.length===0){f=n.selectNodes("//*[name(.)!='svg']");var l=[];for(var c=0,p=f.length;c0&&this.init(e,t)}var t=e.fabric||(e.fabric={});if(t.Point){t.warn("fabric.Point is already defined");return}t.Point=n,n.prototype={constructor:n,init:function(e,t){this.x=e,this.y=t},add:function(e){return new n(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new n(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new n(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new n(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new n(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new n(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.xe.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return new n(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},midPointFrom:function(e){return new n(this.x+(e.x-this.x)/2,this.y+(e.y-this.y)/2)},min:function(e){return new n(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new n(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){this.x=e,this.y=t},setFromPoint:function(e){this.x=e.x,this.y=e.y},swap:function(e){var t=this.x,n=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=n}}}(typeof exports!="undefined"?exports:this),function(e){"use strict";function n(e){arguments.length>0&&this.init(e)}var t=e.fabric||(e.fabric={});if(t.Intersection){t.warn("fabric.Intersection is already defined");return}t.Intersection=n,t.Intersection.prototype={init:function(e){this.status=e,this.points=[]},appendPoint:function(e){this.points.push(e)},appendPoints:function(e){this.points=this.points.concat(e)}},t.Intersection.intersectLineLine=function(e,r,i,s){var o,u=(s.x-i.x)*(e.y-i.y)-(s.y-i.y)*(e.x-i.x),a=(r.x-e.x)*(e.y-i.y)-(r.y-e.y)*(e.x-i.x),f=(s.y-i.y)*(r.x-e.x)-(s.x-i.x)*(r.y-e.y);if(f!==0){var l=u/f,c=a/f;0<=l&&l<=1&&0<=c&&c<=1?(o=new n("Intersection"),o.points.push(new t.Point(e.x+l*(r.x-e.x),e.y+l*(r.y-e.y)))):o=new n("No Intersection")}else u===0||a===0?o=new n("Coincident"):o=new n("Parallel");return o},t.Intersection.intersectLinePolygon=function(e,t,r){var i=new n("No Intersection"),s=r.length;for(var o=0;o0&&(i.status="Intersection"),i},t.Intersection.intersectPolygonPolygon=function(e,t){var r=new n("No Intersection"),i=e.length;for(var s=0;s0&&(r.status="Intersection"),r},t.Intersection.intersectPolygonRectangle=function(e,r,i){var s=r.min(i),o=r.max(i),u=new t.Point(o.x,s.y),a=new t.Point(s.x,o.y),f=n.intersectLinePolygon(s,u,e),l=n.intersectLinePolygon(u,o,e),c=n.intersectLinePolygon(o,a,e),h=n.intersectLinePolygon(a,s,e),p=new n("No Intersection");return p.appendPoints(f.points),p.appendPoints(l.points),p.appendPoints(c.points),p.appendPoints(h.points),p.points.length>0&&(p.status="Intersection"),p}}(typeof exports!="undefined"?exports:this),function(e){"use strict";function n(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}var t=e.fabric||(e.fabric={});if(t.Color){t.warn("fabric.Color is already defined.");return}t.Color=n,t.Color.prototype={_tryParsingColor:function(e){var t=n.sourceFromHex(e);t||(t=n.sourceFromRgb(e)),t&&this.setSource(t)},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return"rgb("+e[0]+","+e[1]+","+e[2]+")"},toRgba:function(){var e=this.getSource();return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},toHex:function(){var e=this.getSource(),t=e[0].toString(16);t=t.length===1?"0"+t:t;var n=e[1].toString(16);n=n.length===1?"0"+n:n;var r=e[2].toString(16);return r=r.length===1?"0"+r:r,t.toUpperCase()+n.toUpperCase()+r.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((e[0]*.3+e[1]*.59+e[2]*.11).toFixed(0),10),n=e[3];return this.setSource([t,t,t,n]),this},toBlackWhite:function(e){var t=this.getSource(),n=(t[0]*.3+t[1]*.59+t[2]*.11).toFixed(0),r=t[3];return e=e||127,n=Number(n)','',"',"Created with Fabric.js ",fabric.version,"",fabric.createSVGFontFacesMarkup(this.getObjects())];this.backgroundImage&&e.push(''),this.overlayImage&&e.push('');for(var t=0,n=this.getObjects(),r=n.length;t"),e.join("")},isEmpty:function(){return this._objects.length===0},remove:function(e){return n(this._objects,e),this.getActiveObject()===e&&(this.fire("before:selection:cleared",{target:e}),this.discardActiveObject(),this.fire("selection:cleared")),this.renderAll(),e},sendToBack:function(e){return n(this._objects,e),this._objects.unshift(e),this.renderAll()},bringToFront:function(e){return n(this._objects,e),this._objects.push(e),this.renderAll()},sendBackwards:function(e){var t=this._objects.indexOf(e),r=t;if(t!==0){for(var i=t-1;i>=0;--i){var s=e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e);if(s){r=i;break}}n(this._objects,e),this._objects.splice(r,0,e)}return this.renderAll()},bringForward:function(e){var t=this.getObjects(),r=t.indexOf(e),i=r;if(r!==t.length-1){for(var s=r+1,o=this._objects.length;s"},e(fabric.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',toGrayscale:function(e){var t=e.getContext("2d"),n=t.getImageData(0,0,e.width,e.height),r=n.data,i=n.width,s=n.height,o,u,a,f;for(a=0;a0&&(t>this.targetFindTolerance?t-=this.targetFindTolerance:t=0,n>this.targetFindTolerance?n-=this.targetFindTolerance:n=0);var o=!0,u=r.getImageData(t,n,this.targetFindTolerance*2||1,this.targetFindTolerance*2||1);for(var a=3;a0?0:-n),t.ey-(r>0?0:-r),i,s),e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor;if(this.selectionDashArray.length>1){var o=t.ex+p-(n>0?0:i),u=t.ey+p-(r>0?0:s);e.beginPath(),this.drawDashedLine(e,o,u,o+i,u,this.selectionDashArray),this.drawDashedLine(e,o,u+s-1,o+i,u+s-1,this.selectionDashArray),this.drawDashedLine(e,o,u,o,u+s,this.selectionDashArray),this.drawDashedLine(e,o+i-1,u,o+i-1,u+s,this.selectionDashArray),e.closePath(),e.stroke()}else e.strokeRect(t.ex+p-(n>0?0:i),t.ey+p-(r>0?0:s),i,s)},drawDashedLine:function(e,t,n,r,i,s){var o=r-t,u=i-n,a=Math.sqrt(o*o+u*u),f=Math.atan2(u,o),l=s.length,c=0,h=!0;e.save(),e.translate(t,n),e.moveTo(0,0),e.rotate(f),t=0;while(a>t)t+=s[c++%l],t>a&&(t=a),e[h?"lineTo":"moveTo"](t,0),h=!h;e.restore()},_findSelectedObjects:function(e){var t=[],n=this._groupSelector.ex,r=this._groupSelector.ey,i=n+this._groupSelector.left,s=r+this._groupSelector.top,o,u=new fabric.Point(c(n,i),c(r,s)),a=new fabric.Point(h(n,i),h(r,s));for(var f=0,l=this._objects.length;f1&&(t=new fabric.Group(t),this.setActiveGroup(t),t.saveCoords(),this.fire("selection:created",{target:t})),this.renderAll()},findTarget:function(e,t){var n,r=this.getPointer(e);if(this.controlsAboveOverlay&&this.lastRenderedObjectWithControlsAboveOverlay&&this.containsPoint(e,this.lastRenderedObjectWithControlsAboveOverlay))return n=this.lastRenderedObjectWithControlsAboveOverlay,n;var i=this.getActiveGroup();if(i&&!t&&this.containsPoint(e,i))return n=i,n;var s=[];for(var o=this._objects.length;o--;)if(this._objects[o]&&this.containsPoint(e,this._objects[o])){if(!this.perPixelTargetFind&&!this._objects[o].perPixelTargetFind){n=this._objects[o],this.relatedTarget=n;break}s[s.length]=this._objects[o]}for(var u=0,a=s.length;u"},set:function(e,t){if(typeof e=="object")for(var n in e)this._set(n,e[n]);else typeof t=="function"?this._set(e,t(this.get(e))):this._set(e,t);return this},_set:function(e,n){var r=(e==="scaleX"||e==="scaleY")&&n1?this.strokeWidth:0,t=this.padding,n=o(this.angle);this.currentWidth=(this.width+e)*this.scaleX+t*2,this.currentHeight=(this.height+e)*this.scaleY+t*2,this.currentWidth<0&&(this.currentWidth=Math.abs(this.currentWidth));var r=Math.sqrt(Math.pow(this.currentWidth/2,2)+Math.pow(this.currentHeight/2,2)),i=Math.atan(this.currentHeight/this.currentWidth),s=Math.cos(i+n)*r,u=Math.sin(i+n)*r,a=Math.sin(n),f=Math.cos(n),l={x:this.left-s,y:this.top-u},c={x:l.x+this.currentWidth*f,y:l.y+this.currentWidth*a},h={x:c.x-this.currentHeight*a,y:c.y+this.currentHeight*f},p={x:l.x-this.currentHeight*a,y:l.y+this.currentHeight*f},d={x:l.x-this.currentHeight/2*a,y:l.y+this.currentHeight/2*f},v={x:l.x+this.currentWidth/2*f,y:l.y+this.currentWidth/2*a},m={x:c.x-this.currentHeight/2*a,y:c.y+this.currentHeight/2*f},g={x:p.x+this.currentWidth/2*f,y:p.y+this.currentWidth/2*a},y={x:l.x+this.currentWidth/2*f,y:l.y+this.currentWidth/2*a};return this.oCoords={tl:l,tr:c,br:h,bl:p,ml:d,mt:v,mr:m,mb:g,mtr:y},this._setCornerCoords(),this},getBoundingRectWidth:function(){this.oCoords||this.setCoords();var e=[this.oCoords.tl.x,this.oCoords.tr.x,this.oCoords.br.x,this.oCoords.bl.x],n=t.util.array.min(e),r=t.util.array.max(e);return Math.abs(n-r)},getBoundingRectHeight:function(){this.oCoords||this.setCoords();var e=[this.oCoords.tl.y,this.oCoords.tr.y,this.oCoords.br.y,this.oCoords.bl.y],n=t.util.array.min(e),r=t.util.array.max(e);return Math.abs(n-r)},drawBorders:function(e){if(!this.hasBorders)return;var n=t.Object.MIN_SCALE_LIMIT,r=this.padding,i=r*2,s=this.strokeWidth>1?this.strokeWidth:0;e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,e.strokeStyle=this.borderColor;var o=1/(this.scaleXc&&(l=f-c),u?n+=h*u-(l*u||0):r+=h*a-(l*a||0),e[1&t?"moveTo":"lineTo"](n,r),t>=o&&(t=0)}}1&this.strokeDashArray.length&&this.strokeDashArray.push.apply(this.strokeDashArray,this.strokeDashArray);var t=0,n=-this.width/2,r=-this.height/2,i=this,s=this.padding,o=this.strokeDashArray.length;e.save(),e.beginPath(),u(1,0),u(0,1),u(-1,0),u(0,-1),e.stroke(),e.closePath(),e.restore()},drawCorners:function(e){if(!this.hasControls)return;var t=this.cornersize,n=t/2,r=this.strokeWidth/2,i=-(this.width/2),s=-(this.height/2),o,u,a=t/this.scaleX,f=t/this.scaleY,l=this.padding/this.scaleX,c=this.padding/this.scaleY,h=n/this.scaleY,p=n/this.scaleX,d=(n-t)/this.scaleX,v=(n-t)/this.scaleY,m=this.height,g=this.width,y=this.transparentCorners?"strokeRect":"fillRect";return e.save(),e.lineWidth=1/Math.max(this.scaleX,this.scaleY),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,e.strokeStyle=e.fillStyle=this.cornerColor,o=i-p-r-l,u=s-h-r-c,e.clearRect(o,u,a,f),e[y](o,u,a,f),o=i+g-p+r+l,u=s-h-r-c,e.clearRect(o,u,a,f),e[y](o,u,a,f),o=i-p-r-l,u=s+m+v+r+c,e.clearRect(o,u,a,f),e[y](o,u,a,f),o=i+g+d+r+l,u=s+m+v+r+c,e.clearRect(o,u,a,f),e[y](o,u,a,f),this.get("lockUniScaling")||(o=i+g/2-p,u=s-h-r-c,e.clearRect(o,u,a,f),e[y](o,u,a,f),o=i+g/2-p,u=s+m+v+r+c,e.clearRect(o,u,a,f),e[y](o,u,a,f),o=i+g+d+r+l,u=s+m/2-h,e.clearRect(o,u,a,f),e[y](o,u,a,f),o=i-p-r-l,u=s+m/2-h,e.clearRect(o,u,a,f),e[y](o,u,a,f)),this.hasRotatingPoint&&(o=i+g/2-p,u=this.flipY?s+m+this.rotatingPointOffset/this.scaleY-f/2+r+c:s-this.rotatingPointOffset/this.scaleY-f/2-r-c,e.clearRect(o,u,a,f),e[y](o,u,a,f)),e.restore(),this},clone:function(e,n){return this.constructor.fromObject?this.constructor.fromObject(this.toObject(n),e):new t.Object(this.toObject(n))},cloneAsImage:function(e){if(t.Image){var n=new Image;n.onload=function(){e&&e(new t.Image(n),r),n=n.onload=null};var r={angle:this.get("angle"),flipX:this.get("flipX"),flipY:this.get("flipY")};this.set("angle",0).set("flipX",!1).set("flipY",!1),this.toDataURL(function(e){n.src=e})}return this},toDataURL:function(e){function i(t){t.left=n.width/2,t.top=n.height/2,t.setActive(!1),r.add(t);var i=r.toDataURL("png");r.dispose(),r=t=null,e&&e(i)}var n=t.document.createElement("canvas");!n.getContext&&typeof G_vmlCanvasManager!="undefined"&&G_vmlCanvasManager.initElement(n),n.width=this.getBoundingRectWidth(),n.height=this.getBoundingRectHeight(),t.util.wrapElement(n,"div");var r=new t.Canvas(n);r.backgroundColor="transparent",r.renderAll(),this.constructor.async?this.clone(i):i(this.clone())},hasStateChanged:function(){return this.stateProperties.some(function(e){return this[e]!==this.originalState[e]},this)},saveState:function(){return this.stateProperties.forEach(function(e){this.originalState[e]=this.get(e)},this),this},setupState:function(){this.originalState={},this.saveState()},intersectsWithRect:function(e,n){var r=this.oCoords,i=new t.Point(r.tl.x,r.tl.y),s=new t.Point(r.tr.x,r.tr.y),o=new t.Point(r.bl.x,r.bl.y),u=new t.Point(r.br.x,r.br.y),a=t.Intersection.intersectPolygonRectangle([i,s,u,o],e,n);return a.status==="Intersection"},intersectsWithObject:function(e){function n(e){return{tl:new t.Point(e.tl.x,e.tl.y),tr:new t.Point(e.tr.x,e.tr.y),bl:new t.Point(e.bl.x,e.bl.y),br:new t.Point(e.br.x,e.br.y)}}var r=n(this.oCoords),i=n(e.oCoords),s=t.Intersection.intersectPolygonPolygon([r.tl,r.tr,r.br,r.bl],[i.tl,i.tr,i.br,i.bl]);return s.status==="Intersection"},isContainedWithinObject:function(e){return this.isContainedWithinRect(e.oCoords.tl,e.oCoords.br)},isContainedWithinRect:function(e,n){var r=this.oCoords,i=new t.Point(r.tl.x,r.tl.y),s=new t.Point(r.tr.x,r.tr.y),o=new t.Point(r.bl.x,r.bl.y);return i.x>e.x&&s.xe.y&&o.y=t&&l.d.y>=t)continue;l.o.x===l.d.x&&l.o.x>=e?(u=l.o.x,a=t):(r=0,i=(l.d.y-l.o.y)/(l.d.x-l.o.x),s=t-r*e,o=l.o.y-i*l.o.x,u=-(s-o)/(r-i),a=s+r*u),u>=e&&(f+=1);if(f===2)break}return f},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_setCornerCoords:function(){var e=this.oCoords,t=o(this.angle),n=o(45-this.angle),r=Math.sqrt(2*Math.pow(this.cornersize,2))/2,i=r*Math.cos(n),s=r*Math.sin(n),u=Math.sin(t),a=Math.cos(t);e.tl.corner={tl:{x:e.tl.x-s,y:e.tl.y-i},tr:{x:e.tl.x+i,y:e.tl.y-s},bl:{x:e.tl.x-i,y:e.tl.y+s},br:{x:e.tl.x+s,y:e.tl.y+i}},e.tr.corner={tl:{x:e.tr.x-s,y:e.tr.y-i},tr:{x:e.tr.x+i,y:e.tr.y-s},br:{x:e.tr.x+s,y:e.tr.y+i},bl:{x:e.tr.x-i,y:e.tr.y+s}},e.bl.corner={tl:{x:e.bl.x-s,y:e.bl.y-i},bl:{x:e.bl.x-i,y:e.bl.y+s},br:{x:e.bl.x+s,y:e.bl.y+i},tr:{x:e.bl.x+i,y:e.bl.y-s}},e.br.corner={tr:{x:e.br.x+i,y:e.br.y-s},bl:{x:e.br.x-i,y:e.br.y+s},br:{x:e.br.x+s,y:e.br.y+i},tl:{x:e.br.x-s,y:e.br.y-i}},e.ml.corner={tl:{x:e.ml.x-s,y:e.ml.y-i},tr:{x:e.ml.x+i,y:e.ml.y-s},bl:{x:e.ml.x-i,y:e.ml.y+s},br:{x:e.ml.x+s,y:e.ml.y+i}},e.mt.corner={tl:{x:e.mt.x-s,y:e.mt.y-i},tr:{x:e.mt.x+i,y:e.mt.y-s},bl:{x:e.mt.x-i,y:e.mt.y+s},br:{x:e.mt.x+s,y:e.mt.y+i}},e.mr.corner={tl:{x:e.mr.x-s,y:e.mr.y-i},tr:{x:e.mr.x+i,y:e.mr.y-s},bl:{x:e.mr.x-i,y:e.mr.y+s},br:{x:e.mr.x+s,y:e.mr.y+i}},e.mb.corner={tl:{x:e.mb.x-s,y:e.mb.y-i},tr:{x:e.mb.x+i,y:e.mb.y-s},bl:{x:e.mb.x-i,y:e.mb.y+s},br:{x:e.mb.x+s,y:e.mb.y+i}},e.mtr.corner={tl:{x:e.mtr.x-s+u*this.rotatingPointOffset,y:e.mtr.y-i-a*this.rotatingPointOffset},tr:{x:e.mtr.x+i+u*this.rotatingPointOffset,y:e.mtr.y-s-a*this.rotatingPointOffset},bl:{x:e.mtr.x-i+u*this.rotatingPointOffset,y:e.mtr.y+s-a*this.rotatingPointOffset},br:{x:e.mtr.x+s+u*this.rotatingPointOffset,y:e.mtr.y+i-a*this.rotatingPointOffset}}},toGrayscale:function(){var e=this.get("fill");return e&&this.set("overlayFill",(new t.Color(e)).toGrayscale().toRgb()),this},complexity:function(){return 0},toJSON:function(e){return this.toObject(e)},setGradientFill:function(e){this.set("fill",t.Gradient.forObject(this,e))},animate:function(){if(arguments[0]&&typeof arguments[0]=="object")for(var e in arguments[0])this._animate(e,arguments[0][e],arguments[1]);else this._animate.apply(this,arguments);return this},_animate:function(e,n,r){ -var i=this;r||(r={}),"from"in r||(r.from=this.get(e)),/[+\-]/.test((n+"").charAt(0))&&(n=this.get(e)+parseFloat(n)),t.util.animate({startValue:r.from,endValue:n,byValue:r.by,easing:r.easing,duration:r.duration,onChange:function(t){i.set(e,t),r.onChange&&r.onChange()},onComplete:function(){i.setCoords(),r.onComplete&&r.onComplete()}})},centerH:function(){return this.canvas.centerObjectH(this),this},centerV:function(){return this.canvas.centerObjectV(this),this},center:function(){return this.centerH().centerV()},remove:function(){return this.canvas.remove(this)},sendToBack:function(){return this.canvas.sendToBack(this),this},bringToFront:function(){return this.canvas.bringToFront(this),this},sendBackwards:function(){return this.canvas.sendBackwards(this),this},bringForward:function(){return this.canvas.bringForward(this),this}});var u=t.Object.prototype;for(var a=u.stateProperties.length;a--;){var f=u.stateProperties[a],l=f.charAt(0).toUpperCase()+f.slice(1),c="set"+l,h="get"+l;u[h]||(u[h]=function(e){return new Function('return this.get("'+e+'")')}(f)),u[c]||(u[c]=function(e){return new Function("value",'return this.set("'+e+'", value)')}(f))}t.Object.prototype.rotate=t.Object.prototype.setAngle,n(t.Object.prototype,t.Observable),n(t.Object,{NUM_FRACTION_DIGITS:2,MIN_SCALE_LIMIT:.1})}(typeof exports!="undefined"?exports:this),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r={x1:1,x2:1,y1:1,y2:1};if(t.Line){t.warn("fabric.Line is already defined");return}t.Line=t.util.createClass(t.Object,{type:"line",initialize:function(e,t){t=t||{},e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.set("width",this.x2-this.x1||1),this.set("height",this.y2-this.y1||1),this.set("left","left"in e?e.left:this.x1+this.width/2),this.set("top","top"in e?e.top:this.y1+this.height/2)},_set:function(e,t){return this[e]=t,e in r&&this._setWidthHeight(),this},_render:function(e){e.beginPath(),this.group&&e.translate(-this.group.width/2+this.left,-this.group.height/2+this.top),e.moveTo(this.width===1?0:-this.width/2,this.height===1?0:-this.height/2),e.lineTo(this.width===1?0:this.width/2,this.height===1?0:this.height/2),e.lineWidth=this.strokeWidth;var t=e.strokeStyle;e.strokeStyle=e.fillStyle,e.stroke(),e.strokeStyle=t},complexity:function(){return 1},toObject:function(e){return n(this.callSuper("toObject",e),{x1:this.get("x1"),y1:this.get("y1"),x2:this.get("x2"),y2:this.get("y2")})},toSVG:function(){return[""].join("")}}),t.Line.ATTRIBUTE_NAMES="x1 y1 x2 y2 stroke stroke-width transform".split(" "),t.Line.fromElement=function(e,r){var i=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),s=[i.x1||0,i.y1||0,i.x2||0,i.y2||0];return new t.Line(s,n(i,r))},t.Line.fromObject=function(e){var n=[e.x1,e.y1,e.x2,e.y2];return new t.Line(n,e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";function i(e){return"radius"in e&&e.radius>0}var t=e.fabric||(e.fabric={}),n=Math.PI*2,r=t.util.object.extend;if(t.Circle){t.warn("fabric.Circle is already defined.");return}t.Circle=t.util.createClass(t.Object,{type:"circle",initialize:function(e){e=e||{},this.set("radius",e.radius||0),this.callSuper("initialize",e);var t=this.get("radius")*2;this.set("width",t).set("height",t)},toObject:function(e){return r(this.callSuper("toObject",e),{radius:this.get("radius")})},toSVG:function(){return'"},_render:function(e,t){e.beginPath(),e.globalAlpha=this.group?e.globalAlpha*this.opacity:this.opacity,e.arc(t?this.left:0,t?this.top:0,this.radius,0,n,!1),e.closePath(),this.fill&&e.fill(),this.stroke&&e.stroke()},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){this.radius=e,this.set("width",e*2).set("height",e*2)},complexity:function(){return 1}}),t.Circle.ATTRIBUTE_NAMES="cx cy r fill fill-opacity opacity stroke stroke-width transform".split(" "),t.Circle.fromElement=function(e,n){n||(n={});var s=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!i(s))throw new Error("value of `r` attribute is required and can not be negative");return"left"in s&&(s.left-=n.width/2||0),"top"in s&&(s.top-=n.height/2||0),new t.Circle(r(s,n))},t.Circle.fromObject=function(e){return new t.Circle(e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";var t=e.fabric||(e.fabric={});if(t.Triangle){t.warn("fabric.Triangle is already defined");return}t.Triangle=t.util.createClass(t.Object,{type:"triangle",initialize:function(e){e=e||{},this.callSuper("initialize",e),this.set("width",e.width||100).set("height",e.height||100)},_render:function(e){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,n),e.lineTo(0,-n),e.lineTo(t,n),e.closePath(),this.fill&&e.fill(),this.stroke&&e.stroke()},complexity:function(){return 1},toSVG:function(){var e=this.width/2,t=this.height/2,n=[-e+" "+t,"0 "+ -t,e+" "+t].join(",");return'"}}),t.Triangle.fromObject=function(e){return new t.Triangle(e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=Math.PI*2,r=t.util.object.extend;if(t.Ellipse){t.warn("fabric.Ellipse is already defined.");return}t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",initialize:function(e){e=e||{},this.callSuper("initialize",e),this.set("rx",e.rx||0),this.set("ry",e.ry||0),this.set("width",this.get("rx")*2),this.set("height",this.get("ry")*2)},toObject:function(e){return r(this.callSuper("toObject",e),{rx:this.get("rx"),ry:this.get("ry")})},toSVG:function(){return[""].join("")},render:function(e,t){if(this.rx===0||this.ry===0)return;return this.callSuper("render",e,t)},_render:function(e,t){e.beginPath(),e.save(),e.globalAlpha=this.group?e.globalAlpha*this.opacity:this.opacity,this.transformMatrix&&this.group&&e.translate(this.cx,this.cy),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(t?this.left:0,t?this.top:0,this.rx,0,n,!1),this.stroke&&e.stroke(),this.fill&&e.fill(),e.restore()},complexity:function(){return 1}}),t.Ellipse.ATTRIBUTE_NAMES="cx cy rx ry fill fill-opacity opacity stroke stroke-width transform".split(" "),t.Ellipse.fromElement=function(e,n){n||(n={});var i=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES),s=i.left,o=i.top;"left"in i&&(i.left-=n.width/2||0),"top"in i&&(i.top-=n.height/2||0);var u=new t.Ellipse(r(i,n));return u.cx=s||0,u.cy=o||0,u},t.Ellipse.fromObject=function(e){return new t.Ellipse(e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";function r(e){return e.left=e.left||0,e.top=e.top||0,e}var t=e.fabric||(e.fabric={}),n=t.util.object.extend;if(t.Rect){console.warn("fabric.Rect is already defined");return}t.Rect=t.util.createClass(t.Object,{type:"rect",rx:0,ry:0,initialize:function(e){e=e||{},this._initStateProperties(),this.callSuper("initialize",e),this._initRxRy()},_initStateProperties:function(){this.stateProperties=this.stateProperties.concat(["rx","ry"])},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx||0,n=this.ry||0,r=-this.width/2,i=-this.height/2,s=this.width,o=this.height;e.beginPath(),e.globalAlpha=this.group?e.globalAlpha*this.opacity:this.opacity,this.transformMatrix&&this.group&&e.translate(this.width/2+this.x,this.height/2+this.y),!this.transformMatrix&&this.group&&e.translate(-this.group.width/2+this.width/2+this.x,-this.group.height/2+this.height/2+this.y),e.moveTo(r+t,i),e.lineTo(r+s-t,i),e.quadraticCurveTo(r+s,i,r+s,i+n,r+s,i+n),e.lineTo(r+s,i+o-n),e.quadraticCurveTo(r+s,i+o,r+s-t,i+o,r+s-t,i+o),e.lineTo(r+t,i+o),e.quadraticCurveTo(r,i+o,r,i+o-n,r,i+o-n),e.lineTo(r,i+n),e.quadraticCurveTo(r,i,r+t,i,r+t,i),e.closePath(),this.fill&&e.fill(),this.strokeDashArray?this._renderDashedStroke(e):this.stroke&&e.stroke()},_normalizeLeftTopProperties:function(e){return e.left&&this.set("left",e.left+this.getWidth()/2),this.set("x",e.left||0),e.top&&this.set("top",e.top+this.getHeight()/2),this.set("y",e.top||0),this},complexity:function(){return 1},toObject:function(e){return n(this.callSuper("toObject",e),{rx:this.get("rx")||0,ry:this.get("ry")||0})},toSVG:function(){return'"}}),t.Rect.ATTRIBUTE_NAMES="x y width height rx ry fill fill-opacity opacity stroke stroke-width transform".split(" "),t.Rect.fromElement=function(e,i){if(!e)return null;var s=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);s=r(s);var o=new t.Rect(n(i?t.util.object.clone(i):{},s));return o._normalizeLeftTopProperties(s),o},t.Rect.fromObject=function(e){return new t.Rect(e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.toFixed;if(t.Polyline){t.warn("fabric.Polyline is already defined");return}t.Polyline=t.util.createClass(t.Object,{type:"polyline",initialize:function(e,t){t=t||{},this.set("points",e),this.callSuper("initialize",t),this._calcDimensions()},_calcDimensions:function(){return t.Polygon.prototype._calcDimensions.call(this)},toObject:function(e){return t.Polygon.prototype.toObject.call(this,e)},toSVG:function(){var e=[];for(var t=0,r=this.points.length;t"].join("")},_render:function(e){var t;e.beginPath(),e.moveTo(this.points[0].x,this.points[0].y);for(var n=0,r=this.points.length;n"].join("")},_render:function(e){var t;e.beginPath(),e.moveTo(this.points[0].x,this.points[0].y);for(var n=0,r=this.points.length;n1&&(g=Math.sqrt(g),n*=g,i*=g);var y=d/n,b=p/n,w=-p/i,E=d/i,S=y*l+b*c,x=w*l+E*c,T=y*e+b*t,N=w*e+E*t,C=(T-S)*(T-S)+(N-x)*(N-x),k=1/C-.25;k<0&&(k=0);var L=Math.sqrt(k);a===u&&(L=-L);var A=.5*(S+T)-L*(N-x),O=.5*(x+N)+L*(T-S),M=Math.atan2(x-O,S-A),_=Math.atan2(N-O,T-A),D=_-M;D<0&&a===1?D+=2*Math.PI:D>0&&a===0&&(D-=2*Math.PI);var P=Math.ceil(Math.abs(D/(Math.PI*.5+.001))),H=[];for(var B=0;B"},toObject:function(e){var t=h(this.callSuper("toObject",e),{path:this.path});return this.sourcePath&&(t.sourcePath=this.sourcePath),this.transformMatrix&&(t.transformMatrix=this.transformMatrix),t},toDatalessObject:function(e){var t=this.toObject(e);return this.sourcePath&&(t.path=this.sourcePath),delete t.sourcePath,t},toSVG:function(){var e=[];for(var t=0,n=this.path.length;t',"',""].join("")},complexity:function(){return this.path.length},_parsePath:function(){var e=[],n,r,i;for(var s=0,o,u=this.path.length;sc)for(var h=1,p=o.length;h"];for(var n=0,r=e.length;n"),t.join("")},toString:function(){return"#"},isSameColor:function(){var e=this.getObjects()[0].get("fill");return this.getObjects().every(function(t){return t.get("fill")===e})},complexity:function(){return this.paths.reduce(function(e,t){return e+(t&&t.complexity?t.complexity():0)},0)},toGrayscale:function(){var e=this.paths.length;while(e--)this.paths[e].toGrayscale();return this},getObjects:function(){return this.paths}}),t.PathGroup.fromObject=function(e){var n=u(e.paths);return new t.PathGroup(n,e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.array.min,i=t.util.array.max,s=t.util.array.invoke,o=t.util.removeFromArray;if(t.Group)return;var u={lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0};t.Group=t.util.createClass(t.Object,{type:"group",initialize:function(e,t){t=t||{},this.objects=e||[],this.originalState={},this.callSuper("initialize"),this._calcBounds(),this._updateObjectsCoords(),t&&n(this,t),this._setOpacityIfSame(),this.setCoords(!0),this.saveCoords()},_updateObjectsCoords:function(){var e=this.left,t=this.top;this.forEachObject(function(n){var r=n.get("left"),i=n.get("top");n.set("originalLeft",r),n.set("originalTop",i),n.set("left",r-e),n.set("top",i-t),n.setCoords(),n.hideCorners=!0},this)},toString:function(){return"#"},getObjects:function(){return this.objects},addWithUpdate:function(e){return this._restoreObjectsState(),this.objects.push(e),this._calcBounds(),this._updateObjectsCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),o(this.objects,e),e.setActive(!1),this._calcBounds(),this._updateObjectsCoords(),this},add:function(e){return this.objects.push(e),this},remove:function(e){return o(this.objects,e),this},size:function(){return this.getObjects().length},_set:function(e,t){if(e==="fill"||e==="opacity"){var n=this.objects.length;this[e]=t;while(n--)this.objects[n].set(e,t)}else this[e]=t},contains:function(e){return this.objects.indexOf(e)>-1},toObject:function(e){return n(this.callSuper("toObject",e),{objects:s(this.objects,"toObject",e)})},render:function(e,t){e.save(),this.transform(e);var n=Math.max(this.scaleX,this.scaleY);for(var r=this.objects.length;r>0;r--){var i=this.objects[r-1],s=i.borderScaleFactor,o=i.hasRotatingPoint;i.borderScaleFactor=n,i.hasRotatingPoint=!1,i.render(e),i.borderScaleFactor=s,i.hasRotatingPoint=o}!t&&this.active&&(this.drawBorders(e),this.hideCorners||this.drawCorners(e)),e.restore(),this.setCoords()},item:function(e){return this.getObjects()[e]},complexity:function(){return this.getObjects().reduce(function(e,t){return e+=typeof t.complexity=="function"?t.complexity():0,e},0)},_restoreObjectsState:function(){return this.objects.forEach(this._restoreObjectState,this),this},_restoreObjectState:function(e){var t=this.get("left"),n=this.get("top"),r=this.getAngle()*(Math.PI/180),i=Math.cos(r)*e.get("top")+Math.sin(r)*e.get("left"),s=-Math.sin(r)*e.get("top")+Math.cos(r)*e.get("left");return e.setAngle(e.getAngle()+this.getAngle()),e.set("left",t+s*this.get("scaleX")),e.set("top",n+i*this.get("scaleY")),e.set("scaleX",e.get("scaleX")*this.get("scaleX")),e.set("scaleY",e.get("scaleY")*this.get("scaleY")),e.setCoords(),e.hideCorners=!1,e.setActive(!1),e.setCoords(),this},destroy:function(){return this._restoreObjectsState()},saveCoords:function(){return this._originalLeft=this.get("left"),this._originalTop=this.get("top"),this},hasMoved:function(){return this._originalLeft!==this.get("left")||this._originalTop!==this.get("top")},setObjectsCoords:function(){return this.forEachObject(function(e){e.setCoords()}),this},activateAllObjects:function(){return this.forEachObject(function(e){e.setActive()}),this},forEachObject:t.StaticCanvas.prototype.forEachObject,_setOpacityIfSame:function(){var e=this.getObjects(),t=e[0]?e[0].get("opacity"):1,n=e.every(function(e){return e.get("opacity")===t});n&&(this.opacity=t)},_calcBounds:function(){var e=[],t=[],n,s,o,u,a,f,l,c=0,h=this.objects.length;for(;ce.x&&i-ne.y},toGrayscale:function(){var e=this.objects.length;while(e--)this.objects[e].toGrayscale()},toSVG:function(){var e=[];for(var t=0,n=this.objects.length;t'+e.join("")+""},get:function(e){if(e in u){if(this[e])return this[e];for(var t=0,n=this.objects.length;t'+'"+""},getSrc:function(){return this.getElement().src||this.getElement()._src},toString:function(){return'#'},clone:function(e,t){this.constructor.fromObject(this.toObject(t),e)},applyFilters:function(e){if(this.filters.length===0){this.setElement(this._originalImage),e&&e();return}var t=typeof Buffer!="undefined"&&typeof window=="undefined",n=this._originalImage,r=fabric.document.createElement("canvas"),i=t?new(require("canvas").Image):fabric.document.createElement("img"),s=this;!r.getContext&&typeof G_vmlCanvasManager!="undefined"&&G_vmlCanvasManager.initElement(r),r.width=n.width,r.height=n.height,r.getContext("2d").drawImage(n,0,0,n.width,n.height),this.filters.forEach(function(e){e&&e.applyTo(r)}),i.onload=function(){s._element=i,e&&e(),i.onload=r=n=null},i.width=n.width,i.height=n.height;if(t){var o=r.toDataURL("image/png").replace(/data:image\/png;base64,/,"");i.src=new Buffer(o,"base64"),s._element=i,e&&e()}else i.src=r.toDataURL("image/png");return this},_render:function(e){e.drawImage(this.getElement(),-this.width/2,-this.height/2,this.width,this.height)},_resetWidthHeight:function(){var e=this.getElement();this.set("width",e.width),this.set("height",e.height)},_initElement:function(e){this.setElement(fabric.util.getById(e)),fabric.util.addClass(this.getElement(),fabric.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e){e.filters&&e.filters.length&&(this.filters=e.filters.map(function(e){return e&&fabric.Image.filters[e.type].fromObject(e)}))},_setWidthHeight:function(e){this.width="width"in e?e.width:this.getElement().width||0,this.height="height"in e?e.height:this.getElement().height||0},complexity:function(){return 1}}),fabric.Image.CSS_CANVAS="canvas-img",fabric.Image.prototype.getSvgSrc=fabric.Image.prototype.getSrc,fabric.Image.fromObject=function(e,t){var n=fabric.document.createElement("img"),r=e.src;e.width&&(n.width=e.width),e.height&&(n.height=e.height),n.onload=function(){fabric.Image.prototype._initFilters.call(e,e);var r=new fabric.Image(n,e);t&&t(r),n=n.onload=null},n.src=r},fabric.Image.fromURL=function(e,t,n){var r=fabric.document.createElement("img");r.onload=function(){t&&t(new fabric.Image(r,n)),r=r.onload=null},r.src=e},fabric.Image.ATTRIBUTE_NAMES="x y width height fill fill-opacity opacity stroke stroke-width transform xlink:href".split(" "),fabric.Image.fromElement=function(e,n,r){r||(r={});var i=fabric.parseAttributes(e,fabric.Image.ATTRIBUTE_NAMES);fabric.Image.fromURL(i["xlink:href"],n,t(i,r))},fabric.Image.async=!0}(typeof exports!="undefined"?exports:this),fabric.util.object.extend(fabric.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.get("angle");return e>-225&&e<=-135?-180:e>-135&&e<=-45?-90:e>-45&&e<=45?0:e>45&&e<=135?90:e>135&&e<=225?180:e>225&&e<=315?270:e>315?360:0},straighten:function(){var e=this._getAngleValueForStraighten();return this.setAngle(e),this},fxStraighten:function(e){e=e||{};var t=function(){},n=e.onComplete||t,r=e.onChange||t,i=this;return fabric.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){i.setAngle(e),r()},onComplete:function(){i.setCoords(),n()},onStart:function(){i.setActive(!1)}}),this}}),fabric.util.object.extend(fabric.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.renderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.renderAll.bind(this)}),this}}),fabric.Image.filters={},fabric.Image.filters.Grayscale=fabric.util.createClass({type:"Grayscale",applyTo:function(e){var t=e.getContext("2d"),n=t.getImageData(0,0,e.width,e.height),r=n.data,i=n.width,s=n.height,o,u,a,f;for(a=0;ao&&f>o&&l>o&&u(a-f)"].join("")}}),t.Line.ATTRIBUTE_NAMES="x1 y1 x2 y2 stroke stroke-width transform".split(" "),t.Line.fromElement=function(e,r){var i=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),s=[i.x1||0,i.y1||0,i.x2||0,i.y2||0];return new t.Line(s,n(i,r))},t.Line.fromObject=function(e){var n=[e.x1,e.y1,e.x2,e.y2];return new t.Line(n,e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";function i(e){return"radius"in e&&e.radius>0}var t=e.fabric||(e.fabric={}),n=Math.PI*2,r=t.util.object.extend;if(t.Circle){t.warn("fabric.Circle is already defined.");return}t.Circle=t.util.createClass(t.Object,{type:"circle",initialize:function(e){e=e||{},this.set("radius",e.radius||0),this.callSuper("initialize",e);var t=this.get("radius")*2;this.set("width",t).set("height",t)},toObject:function(e){return r(this.callSuper("toObject",e),{radius:this.get("radius")})},toSVG:function(){return'"},_render:function(e,t){e.beginPath(),e.globalAlpha=this.group?e.globalAlpha*this.opacity:this.opacity,e.arc(t?this.left:0,t?this.top:0,this.radius,0,n,!1),e.closePath(),this.fill&&e.fill(),this.stroke&&e.stroke()},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){this.radius=e,this.set("width",e*2).set("height",e*2)},complexity:function(){return 1}}),t.Circle.ATTRIBUTE_NAMES="cx cy r fill fill-opacity opacity stroke stroke-width transform".split(" "),t.Circle.fromElement=function(e,n){n||(n={});var s=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!i(s))throw new Error("value of `r` attribute is required and can not be negative");return"left"in s&&(s.left-=n.width/2||0),"top"in s&&(s.top-=n.height/2||0),new t.Circle(r(s,n))},t.Circle.fromObject=function(e){return new t.Circle(e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";var t=e.fabric||(e.fabric={});if(t.Triangle){t.warn("fabric.Triangle is already defined");return}t.Triangle=t.util.createClass(t.Object,{type:"triangle",initialize:function(e){e=e||{},this.callSuper("initialize",e),this.set("width",e.width||100).set("height",e.height||100)},_render:function(e){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,n),e.lineTo(0,-n),e.lineTo(t,n),e.closePath(),this.fill&&e.fill(),this.stroke&&e.stroke()},complexity:function(){return 1},toSVG:function(){var e=this.width/2,t=this.height/2,n=[-e+" "+t,"0 "+ -t,e+" "+t].join(",");return'"}}),t.Triangle.fromObject=function(e){return new t.Triangle(e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=Math.PI*2,r=t.util.object.extend;if(t.Ellipse){t.warn("fabric.Ellipse is already defined.");return}t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",initialize:function(e){e=e||{},this.callSuper("initialize",e),this.set("rx",e.rx||0),this.set("ry",e.ry||0),this.set("width",this.get("rx")*2),this.set("height",this.get("ry")*2)},toObject:function(e){return r(this.callSuper("toObject",e),{rx:this.get("rx"),ry:this.get("ry")})},toSVG:function(){return[""].join("")},render:function(e,t){if(this.rx===0||this.ry===0)return;return this.callSuper("render",e,t)},_render:function(e,t){e.beginPath(),e.save(),e.globalAlpha=this.group?e.globalAlpha*this.opacity:this.opacity,this.transformMatrix&&this.group&&e.translate(this.cx,this.cy),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(t?this.left:0,t?this.top:0,this.rx,0,n,!1),this.stroke&&e.stroke(),this.fill&&e.fill(),e.restore()},complexity:function(){return 1}}),t.Ellipse.ATTRIBUTE_NAMES="cx cy rx ry fill fill-opacity opacity stroke stroke-width transform".split(" "),t.Ellipse.fromElement=function(e,n){n||(n={});var i=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES),s=i.left,o=i.top;"left"in i&&(i.left-=n.width/2||0),"top"in i&&(i.top-=n.height/2||0);var u=new t.Ellipse(r(i,n));return u.cx=s||0,u.cy=o||0,u},t.Ellipse.fromObject=function(e){return new t.Ellipse(e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";function r(e){return e.left=e.left||0,e.top=e.top||0,e}var t=e.fabric||(e.fabric={}),n=t.util.object.extend;if(t.Rect){console.warn("fabric.Rect is already defined");return}t.Rect=t.util.createClass(t.Object,{type:"rect",rx:0,ry:0,initialize:function(e){e=e||{},this._initStateProperties(),this.callSuper("initialize",e),this._initRxRy(),this.x=0,this.y=0},_initStateProperties:function(){this.stateProperties=this.stateProperties.concat(["rx","ry"])},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx||0,n=this.ry||0,r=-this.width/2,i=-this.height/2,s=this.width,o=this.height;e.beginPath(),e.globalAlpha=this.group?e.globalAlpha*this.opacity:this.opacity,this.transformMatrix&&this.group&&e.translate(this.width/2+this.x,this.height/2+this.y),!this.transformMatrix&&this.group&&e.translate(-this.group.width/2+this.width/2+this.x,-this.group.height/2+this.height/2+this.y),e.moveTo(r+t,i),e.lineTo(r+s-t,i),e.quadraticCurveTo(r+s,i,r+s,i+n,r+s,i+n),e.lineTo(r+s,i+o-n),e.quadraticCurveTo(r+s,i+o,r+s-t,i+o,r+s-t,i+o),e.lineTo(r+t,i+o),e.quadraticCurveTo(r,i+o,r,i+o-n,r,i+o-n),e.lineTo(r,i+n),e.quadraticCurveTo(r,i,r+t,i,r+t,i),e.closePath(),this.fill&&e.fill(),this.strokeDashArray?this._renderDashedStroke(e):this.stroke&&e.stroke()},_normalizeLeftTopProperties:function(e){return e.left&&this.set("left",e.left+this.getWidth()/2),this.set("x",e.left||0),e.top&&this.set("top",e.top+this.getHeight()/2),this.set("y",e.top||0),this},complexity:function(){return 1},toObject:function(e){return n(this.callSuper("toObject",e),{rx:this.get("rx")||0,ry:this.get("ry")||0})},toSVG:function(){return'"}}),t.Rect.ATTRIBUTE_NAMES="x y width height rx ry fill fill-opacity opacity stroke stroke-width transform".split(" "),t.Rect.fromElement=function(e,i){if(!e)return null;var s=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);s=r(s);var o=new t.Rect(n(i?t.util.object.clone(i):{},s));return o._normalizeLeftTopProperties(s),o},t.Rect.fromObject=function(e){return new t.Rect(e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.toFixed;if(t.Polyline){t.warn("fabric.Polyline is already defined");return}t.Polyline=t.util.createClass(t.Object,{type:"polyline",initialize:function(e,t){t=t||{},this.set("points",e),this.callSuper("initialize",t),this._calcDimensions()},_calcDimensions:function(){return t.Polygon.prototype._calcDimensions.call(this)},toObject:function(e){return t.Polygon.prototype.toObject.call(this,e)},toSVG:function(){var e=[];for(var t=0,r=this.points.length;t"].join("")},_render:function(e){var t;e.beginPath(),e.moveTo(this.points[0].x,this.points[0].y);for(var n=0,r=this.points.length;n"].join("")},_render:function(e){var t;e.beginPath(),e.moveTo(this.points[0].x,this.points[0].y);for(var n=0,r=this.points.length;n1&&(g=Math.sqrt(g),n*=g,i*=g);var y=d/n,b=p/n,w=-p/i,E=d/i,S=y*l+b*c,x=w*l+E*c,T=y*e+b*t,N=w*e+E*t,C=(T-S)*(T-S)+(N-x)*(N-x),k=1/C-.25;k<0&&(k=0);var L=Math.sqrt(k);a===u&&(L=-L);var A=.5*(S+T)-L*(N-x),O=.5*(x+N)+L*(T-S),M=Math.atan2(x-O,S-A),_=Math.atan2(N-O,T-A),D=_-M;D<0&&a===1?D+=2*Math.PI:D>0&&a===0&&(D-=2*Math.PI);var P=Math.ceil(Math.abs(D/(Math.PI*.5+.001))),H=[];for(var B=0;B"},toObject:function(e){var t=h(this.callSuper("toObject",e),{path:this.path});return this.sourcePath&&(t.sourcePath=this.sourcePath),this.transformMatrix&&(t.transformMatrix=this.transformMatrix),t},toDatalessObject:function(e){var t=this.toObject(e);return this.sourcePath&&(t.path=this.sourcePath),delete t.sourcePath,t},toSVG:function(){var e=[];for(var t=0,n=this.path.length;t',"',""].join("")},complexity:function(){return this.path.length},_parsePath:function(){var e=[],n,r,i;for(var s=0,o,u=this.path.length;sc)for(var h=1,p=o.length;h"];for(var n=0,r=e.length;n"),t.join("")},toString:function(){return"#"},isSameColor:function(){var e=this.getObjects()[0].get("fill");return this.getObjects().every(function(t){return t.get("fill")===e})},complexity:function(){return this.paths.reduce(function(e,t){return e+(t&&t.complexity?t.complexity():0)},0)},toGrayscale:function(){var e=this.paths.length;while(e--)this.paths[e].toGrayscale();return this},getObjects:function(){return this.paths}}),t.PathGroup.fromObject=function(e){var n=u(e.paths);return new t.PathGroup(n,e)}}(typeof exports!="undefined"?exports:this),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.array.min,i=t.util.array.max,s=t.util.array.invoke,o=t.util.removeFromArray;if(t.Group)return;var u={lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0};t.Group=t.util.createClass(t.Object,{type:"group",initialize:function(e,t){t=t||{},this.objects=e||[],this.originalState={},this.callSuper("initialize"),this._calcBounds(),this._updateObjectsCoords(),t&&n(this,t),this._setOpacityIfSame(),this.setCoords(!0),this.saveCoords()},_updateObjectsCoords:function(){var e=this.left,t=this.top;this.forEachObject(function(n){var r=n.get("left"),i=n.get("top");n.set("originalLeft",r),n.set("originalTop",i),n.set("left",r-e),n.set("top",i-t),n.setCoords(),n.hideCorners=!0},this)},toString:function(){return"#"},getObjects:function(){return this.objects},addWithUpdate:function(e){return this._restoreObjectsState(),this.objects.push(e),this._calcBounds(),this._updateObjectsCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),o(this.objects,e),e.setActive(!1),this._calcBounds(),this._updateObjectsCoords(),this},add:function(e){return this.objects.push(e),this},remove:function(e){return o(this.objects,e),this},size:function(){return this.getObjects().length},_set:function(e,t){if(e==="fill"||e==="opacity"){var n=this.objects.length;this[e]=t;while(n--)this.objects[n].set(e,t)}else this[e]=t},contains:function(e){return this.objects.indexOf(e)>-1},toObject:function(e){return n(this.callSuper("toObject",e),{objects:s(this.objects,"toObject",e)})},render:function(e,t){e.save(),this.transform(e);var n=Math.max(this.scaleX,this.scaleY);for(var r=this.objects.length;r>0;r--){var i=this.objects[r-1],s=i.borderScaleFactor,o=i.hasRotatingPoint;i.borderScaleFactor=n,i.hasRotatingPoint=!1,i.render(e),i.borderScaleFactor=s,i.hasRotatingPoint=o}!t&&this.active&&(this.drawBorders(e),this.hideCorners||this.drawCorners(e)),e.restore(),this.setCoords()},item:function(e){return this.getObjects()[e]},complexity:function(){return this.getObjects().reduce(function(e,t){return e+=typeof t.complexity=="function"?t.complexity():0,e},0)},_restoreObjectsState:function(){return this.objects.forEach(this._restoreObjectState,this),this},_restoreObjectState:function(e){var t=this.get("left"),n=this.get("top"),r=this.getAngle()*(Math.PI/180),i=Math.cos(r)*e.get("top")+Math.sin(r)*e.get("left"),s=-Math.sin(r)*e.get("top")+Math.cos(r)*e.get("left");return e.setAngle(e.getAngle()+this.getAngle()),e.set("left",t+s*this.get("scaleX")),e.set("top",n+i*this.get("scaleY")),e.set("scaleX",e.get("scaleX")*this.get("scaleX")),e.set("scaleY",e.get("scaleY")*this.get("scaleY")),e.setCoords(),e.hideCorners=!1,e.setActive(!1),e.setCoords(),this},destroy:function(){return this._restoreObjectsState()},saveCoords:function(){return this._originalLeft=this.get("left"),this._originalTop=this.get("top"),this},hasMoved:function(){return this._originalLeft!==this.get("left")||this._originalTop!==this.get("top")},setObjectsCoords:function(){return this.forEachObject(function(e){e.setCoords()}),this},activateAllObjects:function(){return this.forEachObject(function(e){e.setActive()}),this},forEachObject:t.StaticCanvas.prototype.forEachObject,_setOpacityIfSame:function(){var e=this.getObjects(),t=e[0]?e[0].get("opacity"):1,n=e.every(function(e){return e.get("opacity")===t});n&&(this.opacity=t)},_calcBounds:function(){var e=[],t=[],n,s,o,u,a,f,l,c=0,h=this.objects.length;for(;ce.x&&i-ne.y},toGrayscale:function(){var e=this.objects.length;while(e--)this.objects[e].toGrayscale()},toSVG:function(){var e=[];for(var t=0,n=this.objects.length;t'+e.join("")+""},get:function(e){if(e in u){if(this[e])return this[e];for(var t=0,n=this.objects.length;t'+'"+""},getSrc:function(){return this.getElement().src||this.getElement()._src},toString:function(){return'#'},clone:function(e,t){this.constructor.fromObject(this.toObject(t),e)},applyFilters:function(e){if(this.filters.length===0){this.setElement(this._originalImage),e&&e();return}var t=typeof Buffer!="undefined"&&typeof window=="undefined",n=this._originalImage,r=fabric.document.createElement("canvas"),i=t?new(require("canvas").Image):fabric.document.createElement("img"),s=this;!r.getContext&&typeof G_vmlCanvasManager!="undefined"&&G_vmlCanvasManager.initElement(r),r.width=n.width,r.height=n.height,r.getContext("2d").drawImage(n,0,0,n.width,n.height),this.filters.forEach(function(e){e&&e.applyTo(r)}),i.onload=function(){s._element=i,e&&e(),i.onload=r=n=null},i.width=n.width,i.height=n.height;if(t){var o=r.toDataURL("image/png").replace(/data:image\/png;base64,/,"");i.src=new Buffer(o,"base64"),s._element=i,e&&e()}else i.src=r.toDataURL("image/png");return this},_render:function(e){e.drawImage(this.getElement(),-this.width/2,-this.height/2,this.width,this.height)},_resetWidthHeight:function(){var e=this.getElement();this.set("width",e.width),this.set("height",e.height)},_initElement:function(e){this.setElement(fabric.util.getById(e)),fabric.util.addClass(this.getElement(),fabric.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e){e.filters&&e.filters.length&&(this.filters=e.filters.map(function(e){return e&&fabric.Image.filters[e.type].fromObject(e)}))},_setWidthHeight:function(e){this.width="width"in e?e.width:this.getElement().width||0,this.height="height"in e?e.height:this.getElement().height||0},complexity:function(){return 1}}),fabric.Image.CSS_CANVAS="canvas-img",fabric.Image.prototype.getSvgSrc=fabric.Image.prototype.getSrc,fabric.Image.fromObject=function(e,t){var n=fabric.document.createElement("img"),r=e.src;e.width&&(n.width=e.width),e.height&&(n.height=e.height),n.onload=function(){fabric.Image.prototype._initFilters.call(e,e);var r=new fabric.Image(n,e);t&&t(r),n=n.onload=null},n.src=r},fabric.Image.fromURL=function(e,t,n){var r=fabric.document.createElement("img");r.onload=function(){t&&t(new fabric.Image(r,n)),r=r.onload=null},r.src=e},fabric.Image.ATTRIBUTE_NAMES="x y width height fill fill-opacity opacity stroke stroke-width transform xlink:href".split(" "),fabric.Image.fromElement=function(e,n,r){r||(r={});var i=fabric.parseAttributes(e,fabric.Image.ATTRIBUTE_NAMES);fabric.Image.fromURL(i["xlink:href"],n,t(i,r))},fabric.Image.async=!0}(typeof exports!="undefined"?exports:this),fabric.util.object.extend(fabric.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.get("angle");return e>-225&&e<=-135?-180:e>-135&&e<=-45?-90:e>-45&&e<=45?0:e>45&&e<=135?90:e>135&&e<=225?180:e>225&&e<=315?270:e>315?360:0},straighten:function(){var e=this._getAngleValueForStraighten();return this.setAngle(e),this},fxStraighten:function(e){e=e||{};var t=function(){},n=e.onComplete||t,r=e.onChange||t,i=this;return fabric.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){i.setAngle(e),r()},onComplete:function(){i.setCoords(),n()},onStart:function(){i.setActive(!1)}}),this}}),fabric.util.object.extend(fabric.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.renderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.renderAll.bind(this)}),this}}),fabric.Image.filters={},fabric.Image.filters.Grayscale=fabric.util.createClass({type:"Grayscale",applyTo:function(e){var t=e.getContext("2d"),n=t.getImageData(0,0,e.width,e.height),r=n.data,i=n.width,s=n.height,o,u,a,f;for(a=0;ao&&f>o&&l>o&&u(a-f)0&&(r[s]=a,r[s+1]=f,r[s+2]=l);t.putImageData(n,0,0)},toJSON:function(){return{type:this.type,color:this.color}}}),fabric.Image.filters.Tint.fromObject=function(e){return new fabric.Image.filters.Tint(e)},fabric.Image.filters.Convolute=fabric.util.createClass({type:"Convolute",initialize:function(e){e||(e={}),this.opaque=e.opaque,this.matrix=e.matrix||[0,0,0,0,1,0,0,0,0],this.tmpCtx=fabric.document.createElement("canvas").getContext("2d")},_createImageData:function(e,t){return this.tmpCtx.createImageData(e,t)},applyTo:function(e){var t=this.matrix,n=e.getContext("2d"),r=n.getImageData(0,0,e.width,e.height),i=Math.round(Math.sqrt(t.length)),s=Math.floor(i/2),o=r.data,u=r.width,a=r.height,f=u,l=a,c=this._createImageData(f,l),h=c.data,p=this.opaque?1:0;for(var d=0;d=0&&N=0&&C'},_render:function(e){typeof Cufon=="undefined"||this.useNative===!0?this._renderViaNative(e):this._renderViaCufon(e)},_renderViaCufon:function(e){var t=Cufon.textOptions||(Cufon.textOptions={});t.left=this.left,t.top=this.top,t.context=e,t.color=this.fill;var n=this._initDummyElementForCufon();this.transform(e),Cufon.replaceElement(n,{engine:"canvas",separate:"none",fontFamily:this.fontFamily,fontWeight:this.fontWeight,textDecoration:this.textDecoration,textShadow:this.textShadow,textAlign:this.textAlign,fontStyle:this.fontStyle,lineHeight:this.lineHeight,strokeStyle:this.strokeStyle,strokeWidth:this.strokeWidth,backgroundColor:this.backgroundColor,textBackgroundColor:this.textBackgroundColor}),this.width=t.width,this.height=t.height,this._totalLineHeight=t.totalLineHeight,this._fontAscent=t.fontAscent,this._boundaries=t.boundaries,this._shadowOffsets=t.shadowOffsets,this._shadows=t.shadows||[],n=null,this.setCoords()},_renderViaNative:function(e){this.transform(e),this._setTextStyles(e);var t=this.text.split(/\r?\n/);this.width=this._getTextWidth(e,t),this.height=this._getTextHeight(e,t),this._renderTextBackground(e,t),this.textAlign!=="left"&&(e.save(),e.translate(this.textAlign==="center"?this.width/2:this.width,0)),this._setTextShadow(e),this._renderTextFill(e,t),this.textShadow&&e.restore(),this._renderTextStroke(e,t),this.textAlign!=="left"&&e.restore(),this._renderTextDecoration(e,t),this._setBoundaries(e,t),this._totalLineHeight=0,this.setCoords()},_setBoundaries:function(e,t){this._boundaries=[];for(var n=0,r=t.length;nn&&(n=s)}return n},_setTextShadow:function(e){if(this.textShadow){var t=/\s+(-?\d+)(?:px)?\s+(-?\d+)(?:px)?\s+(\d+)(?:px)?\s*/,n=this.textShadow,r=t.exec(this.textShadow),i=n.replace(t,"");e.save(),e.shadowColor=i,e.shadowOffsetX=parseInt(r[1],10),e.shadowOffsetY=parseInt(r[2],10),e.shadowBlur=parseInt(r[3],10),this._shadows=[{blur:e.shadowBlur,color:e.shadowColor,offX:e.shadowOffsetX,offY:e.shadowOffsetY}],this._shadowOffsets=[[parseInt(e.shadowOffsetX,10),parseInt(e.shadowOffsetY,10)]]}},_renderTextFill:function(e,t){this._boundaries=[];for(var n=0,r=t.length;n-1&&i(this.fontSize),this.textDecoration.indexOf("line-through")>-1&&i(this.fontSize/2),this.textDecoration.indexOf("overline")>-1&&i(0)},_getFontDeclaration:function(){return[this.fontStyle,this.fontWeight,this.fontSize+"px",t.isLikelyNode?'"'+this.fontFamily+'"':this.fontFamily].join(" ")},_initDummyElementForCufon:function(){var e=t.document.createElement("pre"),n=t.document.createElement("div");return n.appendChild(e),typeof G_vmlCanvasManager=="undefined"?e.innerHTML=this.text:e.innerText=this.text.replace(/\r?\n/gi,"\r"),e.style.fontSize=this.fontSize+"px",e.style.letterSpacing="normal",e},render:function(e,t){e.save(),this._render(e),!t&&this.active&&(this.drawBorders(e),this.hideCorners||this.drawCorners(e)),e.restore()},toObject:function(e){return n(this.callSuper("toObject",e),{text:this.text,fontSize:this.fontSize,fontWeight:this.fontWeight,fontFamily:this.fontFamily,fontStyle:this.fontStyle,lineHeight:this.lineHeight,textDecoration:this.textDecoration,textShadow:this.textShadow,textAlign:this.textAlign,path:this.path,strokeStyle:this.strokeStyle,strokeWidth:this.strokeWidth,backgroundColor:this.backgroundColor,textBackgroundColor:this.textBackgroundColor,useNative:this.useNative})},toSVG:function(){var e=this.text.split(/\r?\n/),t=this.useNative?this.fontSize*this.lineHeight:-this._fontAscent-this._fontAscent/5*this.lineHeight,n=-(this.width/2),r=this.useNative?this.fontSize-1:this.height/2-e.length*this.fontSize-this._totalLineHeight,s=this._getSVGTextAndBg(t,n,e),o=this._getSVGShadows(t,e);return r+=this._fontAscent?this._fontAscent/5*this.lineHeight:0,['',s.textBgRects.join(""),"',o.join(""),s.textSpans.join(""),"",""].join("")},_getSVGShadows:function(e,n){var r=[],s,o,u,a,f=1;if(!this._shadows||!this._boundaries)return r;for(s=0,u=this._shadows.length;s",t.util.string.escapeXml(n[o]),""),f=1}else f++;return r},_getSVGTextAndBg:function(e,n,r){var s=[],o=[],u,a,f,l=1;this.backgroundColor&&this._boundaries&&o.push("');for(u=0,f=r.length;u",t.util.string.escapeXml(r[u]),""),l=1):l++;if(!this.textBackgroundColor||!this._boundaries)continue;o.push("')}return{textSpans:s,textBgRects:o}},_getFillAttributes:function(e){var n=e?new t.Color(e):"";return!n||!n.getSource()||n.getAlpha()===1?'fill="'+e+'"':'opacity="'+n.getAlpha()+'" fill="'+n.setAlpha(1).toRgb()+'"'},setColor:function(e){return this.set("fill",e),this},setFontsize:function(e){return this.set("fontSize",e),this._initDimensions(),this.setCoords(),this},getText:function(){return this.text},setText:function(e){return this.set("text",e),this._initDimensions(),this.setCoords(),this},_set:function(e,t){e==="fontFamily"&&this.path&&(this.path=this.path.replace(/(.*?)([^\/]*)(\.font\.js)/,"$1"+t+"$3")),this.callSuper("_set",e,t)}}),t.Text.ATTRIBUTE_NAMES="x y fill fill-opacity opacity stroke stroke-width transform font-family font-style font-weight font-size text-decoration".split(" "),t.Text.fromObject=function(e){return new t.Text(e.text,r(e))},t.Text.fromElement=function(e,n){if(!e)return null;var r=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES);n=t.util.object.extend(n?t.util.object.clone(n):{},r);var i=new t.Text(e.textContent,n);return i.set({left:i.getLeft()+i.getWidth()/2,top:i.getTop()-i.getHeight()/2}),i}}(typeof exports!="undefined"?exports:this),function(){function request(e,t,n){var r=URL.parse(e),i=HTTP.createClient(r.port,r.hostname),s=i.request("GET",r.pathname,{host:r.hostname});i.addListener("error",function(e){e.errno===process.ECONNREFUSED?fabric.log("ECONNREFUSED: connection refused to "+i.host+":"+i.port):fabric.log(e.message)}),s.end(),s.on("response",function(e){var r="";t&&e.setEncoding(t),e.on("end",function(){n(r)}),e.on("data",function(t){e.statusCode===200&&(r+=t)})})}if(typeof document!="undefined"&&typeof window!="undefined")return;var DOMParser=(new require("xmldom")).DOMParser,URL=require("url"),HTTP=require("http"),Canvas=require("canvas"),Image=require("canvas").Image;fabric.util.loadImage=function(e,t){var n=new Image;e&&e.indexOf("data")===0?(n.src=n._src=e,t(n)):e&&request(e,"binary",function(r){n.src=new Buffer(r,"binary"),n._src=e,t(n)})},fabric.loadSVGFromURL=function(e,t){e=e.replace(/^\n\s*/,"").replace(/\?.*$/,"").trim(),request(e,"",function(e){fabric.loadSVGFromString(e,t)})},fabric.loadSVGFromString=function(e,t){var n=(new DOMParser).parseFromString(e);fabric.parseSVGDocument(n.documentElement,function(e,n){t(e,n)})},fabric.util.getScript=function(url,callback){request(url,"",function(body){eval(body),callback&&callback()})},fabric.Image.fromObject=function(e,t){fabric.util.loadImage(e.src,function(n){var r=new fabric.Image(n);r._initConfig(e),r._initFilters(e),t(r)})},fabric.createCanvasForNode=function(e,t){var n=fabric.document.createElement("canvas"),r=new Canvas(e||600,t||600);n.style={},n.width=r.width,n.height=r.height;var i=fabric.Canvas||fabric.StaticCanvas,s=new i(n);return s.contextContainer=r.getContext("2d"),s.nodeCanvas=r,s},fabric.StaticCanvas.prototype.createPNGStream=function(){return this.nodeCanvas.createPNGStream()};var origSetWidth=fabric.StaticCanvas.prototype.setWidth;fabric.StaticCanvas.prototype.setWidth=function(e){return origSetWidth.call(this),this.nodeCanvas.width=e,this},fabric.Canvas&&(fabric.Canvas.prototype.setWidth=fabric.StaticCanvas.prototype.setWidth);var origSetHeight=fabric.StaticCanvas.prototype.setHeight;fabric.StaticCanvas.prototype.setHeight=function(e){return origSetHeight.call(this),this.nodeCanvas.height=e,this},fabric.Canvas&&(fabric.Canvas.prototype.setHeight=fabric.StaticCanvas.prototype.setHeight)}(); \ No newline at end of file diff --git a/dist/all.min.js.gz b/dist/all.min.js.gz index fc5f6a29b9abca2f0df5fe0352c290de3b775a48..6e97680a4521fef52e511fe983216f226ac65ad2 100644 GIT binary patch delta 10304 zcmV-GD8JX|!2;>Q0tX+92nc5A$*~6od4DZ^k=(?5hi>8_hqJRvZs-bI?>Mn55cRNU zN$sD}v4+I^T%hG)?Ts?a8=)^)a;T+}8!w6DrrgLBHv&We=rNDm&tB5ODws<;PNfyx zCuI<3a%`1uOjYRYT!Sn9=hJFKM12z)EoXs1#E(9&;8qd1Rav_*ywL*5u$RF0W`7!s zUiPX!5BbMBnU~}_a$dG0UEElUo{MGY{ z_PBC}RB|Z$`x%!I3)IYE1}jl$T(_1FIm|Kbcm#reTdZ8W*ruMkehYW=PT}&_AYfAr z=JG})W5%yYaP@-d?T12TF%k~ND1T?elS%gWk9|>SFt0=hZ2lDjcS;D6Xm^lxg)7{s zYitl;DmO-i+z{+uMjUU?Yy(CSyW2CH!LzU@AQ8*(Ss;eL{fKam!tzI65b;cNygzg{ zCe-WKWU{Er77i;jG3`5OIJHy03WVA5qnr4k?aumXT{SV@HDSz1`~)V zre@Fc{0E4iJ_vB-W#(eOFlYjH6D3z!BE2dkOkE_0W0@$Q z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