diff --git a/.gitignore b/.gitignore index 68cf937..c2ef6f2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ build/svg-edit-2.6-src.tar.gz build/svg-edit-2.6.wgt build/svg-edit-2.6.xpi build/svg-edit-2.6.zip -.DS_Store \ No newline at end of file +.DS_Store +deploy.sh \ No newline at end of file diff --git a/editor/method-draw.compiled.js b/editor/method-draw.compiled.js new file mode 100644 index 0000000..aa94b68 --- /dev/null +++ b/editor/method-draw.compiled.js @@ -0,0 +1,754 @@ +(function(){if(!("SVGPathSeg"in window)){window.SVGPathSeg=function(a,n,e){this.pathSegType=a;this.pathSegTypeAsLetter=n;this._owningPathSegList=e};SVGPathSeg.PATHSEG_UNKNOWN=0;SVGPathSeg.PATHSEG_CLOSEPATH=1;SVGPathSeg.PATHSEG_MOVETO_ABS=2;SVGPathSeg.PATHSEG_MOVETO_REL=3;SVGPathSeg.PATHSEG_LINETO_ABS=4;SVGPathSeg.PATHSEG_LINETO_REL=5;SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6;SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7;SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8;SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9;SVGPathSeg.PATHSEG_ARC_ABS= +10;SVGPathSeg.PATHSEG_ARC_REL=11;SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12;SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13;SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14;SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15;SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16;SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17;SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18;SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19;SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)}; +window.SVGPathSegClosePath=function(a){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CLOSEPATH,"z",a)};SVGPathSegClosePath.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"};SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter};SVGPathSegClosePath.prototype.clone=function(){return new SVGPathSegClosePath(undefined)};window.SVGPathSegMovetoAbs=function(a,n,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_ABS, +"M",a);this._x=n;this._y=e};SVGPathSegMovetoAbs.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"};SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y};SVGPathSegMovetoAbs.prototype.clone=function(){return new SVGPathSegMovetoAbs(undefined,this._x,this._y)};Object.defineProperty(SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x= +a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true});window.SVGPathSegMovetoRel=function(a,n,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_REL,"m",a);this._x=n;this._y=e};SVGPathSegMovetoRel.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"};SVGPathSegMovetoRel.prototype._asPathString= +function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y};SVGPathSegMovetoRel.prototype.clone=function(){return new SVGPathSegMovetoRel(undefined,this._x,this._y)};Object.defineProperty(SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true});window.SVGPathSegLinetoAbs= +function(a,n,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_ABS,"L",a);this._x=n;this._y=e};SVGPathSegLinetoAbs.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"};SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y};SVGPathSegLinetoAbs.prototype.clone=function(){return new SVGPathSegLinetoAbs(undefined,this._x,this._y)};Object.defineProperty(SVGPathSegLinetoAbs.prototype, +"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true});window.SVGPathSegLinetoRel=function(a,n,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_REL,"l",a);this._x=n;this._y=e};SVGPathSegLinetoRel.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"}; +SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y};SVGPathSegLinetoRel.prototype.clone=function(){return new SVGPathSegLinetoRel(undefined,this._x,this._y)};Object.defineProperty(SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()}, +enumerable:true});window.SVGPathSegCurvetoCubicAbs=function(a,n,e,c,l,u,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",a);this._x=n;this._y=e;this._x1=c;this._y1=l;this._x2=u;this._y2=b};SVGPathSegCurvetoCubicAbs.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"};SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+ +" "+this._y2+" "+this._x+" "+this._y};SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicAbs(undefined,this._x,this._y,this._x1,this._y1,this._x2,this._y2)};Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true}); +Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, +"y2",{get:function(){return this._y2},set:function(a){this._y2=a;this._segmentChanged()},enumerable:true});window.SVGPathSegCurvetoCubicRel=function(a,n,e,c,l,u,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",a);this._x=n;this._y=e;this._x1=c;this._y1=l;this._x2=u;this._y2=b};SVGPathSegCurvetoCubicRel.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"};SVGPathSegCurvetoCubicRel.prototype._asPathString= +function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y};SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicRel(undefined,this._x,this._y,this._x1,this._y1,this._x2,this._y2)};Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y}, +set:function(a){this._y=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2= +a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a;this._segmentChanged()},enumerable:true});window.SVGPathSegCurvetoQuadraticAbs=function(a,n,e,c,l){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",a);this._x=n;this._y=e;this._x1=c;this._y1=l};SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegCurvetoQuadraticAbs.prototype.toString= +function(){return"[object SVGPathSegCurvetoQuadraticAbs]"};SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y};SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticAbs(undefined,this._x,this._y,this._x1,this._y1)};Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true}); +Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a;this._segmentChanged()},enumerable:true}); +window.SVGPathSegCurvetoQuadraticRel=function(a,n,e,c,l){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",a);this._x=n;this._y=e;this._x1=c;this._y1=l};SVGPathSegCurvetoQuadraticRel.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"};SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y}; +SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticRel(undefined,this._x,this._y,this._x1,this._y1)};Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype, +"x1",{get:function(){return this._x1},set:function(a){this._x1=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a;this._segmentChanged()},enumerable:true});window.SVGPathSegArcAbs=function(a,n,e,c,l,u,b,k){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_ABS,"A",a);this._x=n;this._y=e;this._r1=c;this._r2=l;this._angle=u;this._largeArcFlag=b;this._sweepFlag=k};SVGPathSegArcAbs.prototype= +Object.create(SVGPathSeg.prototype);SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"};SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y};SVGPathSegArcAbs.prototype.clone=function(){return new SVGPathSegArcAbs(undefined,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)};Object.defineProperty(SVGPathSegArcAbs.prototype, +"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(a){this._r1=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(a){this._r2= +a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(a){this._angle=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(a){this._largeArcFlag=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(a){this._sweepFlag= +a;this._segmentChanged()},enumerable:true});window.SVGPathSegArcRel=function(a,n,e,c,l,u,b,k){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_REL,"a",a);this._x=n;this._y=e;this._r1=c;this._r2=l;this._angle=u;this._largeArcFlag=b;this._sweepFlag=k};SVGPathSegArcRel.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"};SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+ +this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y};SVGPathSegArcRel.prototype.clone=function(){return new SVGPathSegArcRel(undefined,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)};Object.defineProperty(SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcRel.prototype,"y",{get:function(){return this._y}, +set:function(a){this._y=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(a){this._r1=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(a){this._r2=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(a){this._angle= +a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(a){this._largeArcFlag=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(a){this._sweepFlag=a;this._segmentChanged()},enumerable:true});window.SVGPathSegLinetoHorizontalAbs=function(a,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, +"H",a);this._x=n};SVGPathSegLinetoHorizontalAbs.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"};SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x};SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new SVGPathSegLinetoHorizontalAbs(undefined,this._x)};Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x}, +set:function(a){this._x=a;this._segmentChanged()},enumerable:true});window.SVGPathSegLinetoHorizontalRel=function(a,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",a);this._x=n};SVGPathSegLinetoHorizontalRel.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"};SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x};SVGPathSegLinetoHorizontalRel.prototype.clone= +function(){return new SVGPathSegLinetoHorizontalRel(undefined,this._x)};Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});window.SVGPathSegLinetoVerticalAbs=function(a,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",a);this._y=n};SVGPathSegLinetoVerticalAbs.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"}; +SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y};SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new SVGPathSegLinetoVerticalAbs(undefined,this._y)};Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true});window.SVGPathSegLinetoVerticalRel=function(a,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",a); +this._y=n};SVGPathSegLinetoVerticalRel.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"};SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y};SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new SVGPathSegLinetoVerticalRel(undefined,this._y)};Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y}, +set:function(a){this._y=a;this._segmentChanged()},enumerable:true});window.SVGPathSegCurvetoCubicSmoothAbs=function(a,n,e,c,l){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",a);this._x=n;this._y=e;this._x2=c;this._y2=l};SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"};SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+ +" "+this._x2+" "+this._y2+" "+this._x+" "+this._y};SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothAbs(undefined,this._x,this._y,this._x2,this._y2)};Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()}, +enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a;this._segmentChanged()},enumerable:true});window.SVGPathSegCurvetoCubicSmoothRel=function(a,n,e,c,l){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",a);this._x=n; +this._y=e;this._x2=c;this._y2=l};SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"};SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y};SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothRel(undefined,this._x,this._y, +this._x2,this._y2)};Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a;this._segmentChanged()}, +enumerable:true});Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a;this._segmentChanged()},enumerable:true});window.SVGPathSegCurvetoQuadraticSmoothAbs=function(a,n,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",a);this._x=n;this._y=e};SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"}; +SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y};SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined,this._x,this._y)};Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype, +"y",{get:function(){return this._y},set:function(a){this._y=a;this._segmentChanged()},enumerable:true});window.SVGPathSegCurvetoQuadraticSmoothRel=function(a,n,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",a);this._x=n;this._y=e};SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(SVGPathSeg.prototype);SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"};SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString= +function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y};SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothRel(undefined,this._x,this._y)};Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a;this._segmentChanged()},enumerable:true});Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y= +a;this._segmentChanged()},enumerable:true});SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new SVGPathSegClosePath(undefined)};SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(a,n){return new SVGPathSegMovetoAbs(undefined,a,n)};SVGPathElement.prototype.createSVGPathSegMovetoRel=function(a,n){return new SVGPathSegMovetoRel(undefined,a,n)};SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(a,n){return new SVGPathSegLinetoAbs(undefined,a,n)};SVGPathElement.prototype.createSVGPathSegLinetoRel= +function(a,n){return new SVGPathSegLinetoRel(undefined,a,n)};SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(a,n,e,c,l,u){return new SVGPathSegCurvetoCubicAbs(undefined,a,n,e,c,l,u)};SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(a,n,e,c,l,u){return new SVGPathSegCurvetoCubicRel(undefined,a,n,e,c,l,u)};SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(a,n,e,c){return new SVGPathSegCurvetoQuadraticAbs(undefined,a,n,e,c)};SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel= +function(a,n,e,c){return new SVGPathSegCurvetoQuadraticRel(undefined,a,n,e,c)};SVGPathElement.prototype.createSVGPathSegArcAbs=function(a,n,e,c,l,u,b){return new SVGPathSegArcAbs(undefined,a,n,e,c,l,u,b)};SVGPathElement.prototype.createSVGPathSegArcRel=function(a,n,e,c,l,u,b){return new SVGPathSegArcRel(undefined,a,n,e,c,l,u,b)};SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(a){return new SVGPathSegLinetoHorizontalAbs(undefined,a)};SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel= +function(a){return new SVGPathSegLinetoHorizontalRel(undefined,a)};SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(a){return new SVGPathSegLinetoVerticalAbs(undefined,a)};SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(a){return new SVGPathSegLinetoVerticalRel(undefined,a)};SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(a,n,e,c){return new SVGPathSegCurvetoCubicSmoothAbs(undefined,a,n,e,c)};SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel= +function(a,n,e,c){return new SVGPathSegCurvetoCubicSmoothRel(undefined,a,n,e,c)};SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(a,n){return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined,a,n)};SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(a,n){return new SVGPathSegCurvetoQuadraticSmoothRel(undefined,a,n)}}if(!("SVGPathSegList"in window)){window.SVGPathSegList=function(a){this._pathElement=a;this._list=this._parsePath(this._pathElement.getAttribute("d")); +this._mutationObserverConfig={attributes:true,attributeFilter:["d"]};this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this));this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)};Object.defineProperty(SVGPathSegList.prototype,"numberOfItems",{get:function(){this._checkPathSynchronizedToList();return this._list.length},enumerable:true});Object.defineProperty(SVGPathElement.prototype,"pathSegList",{get:function(){if(!this._pathSegList)this._pathSegList= +new SVGPathSegList(this);return this._pathSegList},enumerable:true});Object.defineProperty(SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:true});Object.defineProperty(SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:true});Object.defineProperty(SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:true});SVGPathSegList.prototype._checkPathSynchronizedToList= +function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())};SVGPathSegList.prototype._updateListFromPathMutations=function(a){if(this._pathElement){var n=false;a.forEach(function(e){if(e.attributeName=="d")n=true});if(n)this._list=this._parsePath(this._pathElement.getAttribute("d"))}};SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect();this._pathElement.setAttribute("d",SVGPathSegList._pathSegArrayAsString(this._list)); +this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)};SVGPathSegList.prototype.segmentChanged=function(){this._writeListToPath()};SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList();this._list.forEach(function(a){a._owningPathSegList=null});this._list=[];this._writeListToPath()};SVGPathSegList.prototype.initialize=function(a){this._checkPathSynchronizedToList();this._list=[a];a._owningPathSegList=this;this._writeListToPath();return a}; +SVGPathSegList.prototype._checkValidIndex=function(a){if(isNaN(a)||a<0||a>=this.numberOfItems)throw"INDEX_SIZE_ERR";};SVGPathSegList.prototype.getItem=function(a){this._checkPathSynchronizedToList();this._checkValidIndex(a);return this._list[a]};SVGPathSegList.prototype.insertItemBefore=function(a,n){this._checkPathSynchronizedToList();if(n>this.numberOfItems)n=this.numberOfItems;if(a._owningPathSegList)a=a.clone();this._list.splice(n,0,a);a._owningPathSegList=this;this._writeListToPath();return a}; +SVGPathSegList.prototype.replaceItem=function(a,n){this._checkPathSynchronizedToList();if(a._owningPathSegList)a=a.clone();this._checkValidIndex(n);this._list[n]=a;a._owningPathSegList=this;this._writeListToPath();return a};SVGPathSegList.prototype.removeItem=function(a){this._checkPathSynchronizedToList();this._checkValidIndex(a);var n=this._list[a];this._list.splice(a,1);this._writeListToPath();return n};SVGPathSegList.prototype.appendItem=function(a){this._checkPathSynchronizedToList();if(a._owningPathSegList)a= +a.clone();this._list.push(a);a._owningPathSegList=this;this._writeListToPath();return a};SVGPathSegList._pathSegArrayAsString=function(a){var n="",e=true;a.forEach(function(c){if(e){e=false;n+=c._asPathString()}else n+=" "+c._asPathString()});return n};SVGPathSegList.prototype._parsePath=function(a){if(!a||a.length==0)return[];var n=this,e=function(){this.pathSegList=[]};e.prototype.appendSegment=function(l){this.pathSegList.push(l)};var c=function(l){this._string=l;this._currentIndex=0;this._endIndex= +this._string.length;this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN;this._skipOptionalSpaces()};c.prototype._isCurrentSpace=function(){var l=this._string[this._currentIndex];return l<=" "&&(l==" "||l=="\n"||l=="\t"||l=="\r"||l=="\u000c")};c.prototype._skipOptionalSpaces=function(){for(;this._currentIndex="0"&&l<="9")&&u!=SVGPathSeg.PATHSEG_CLOSEPATH){if(u==SVGPathSeg.PATHSEG_MOVETO_ABS)return SVGPathSeg.PATHSEG_LINETO_ABS;if(u==SVGPathSeg.PATHSEG_MOVETO_REL)return SVGPathSeg.PATHSEG_LINETO_REL;return u}return SVGPathSeg.PATHSEG_UNKNOWN};c.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return true;var l=this.peekSegmentType();return l==SVGPathSeg.PATHSEG_MOVETO_ABS|| +l==SVGPathSeg.PATHSEG_MOVETO_REL};c.prototype._parseNumber=function(){var l=0,u=0,b=1,k=0,d=1,q=1,z=this._currentIndex;this._skipOptionalSpaces();if(this._currentIndex"9")&&this._string.charAt(this._currentIndex)!= +".")){for(var D=this._currentIndex;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=D)for(var w=this._currentIndex-1,K=1;w>=D;){u+=K*(this._string.charAt(w--)-"0");K*=10}if(this._currentIndex=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)> +"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";)k+=(this._string.charAt(this._currentIndex++)-"0")*(b*=0.1)}if(this._currentIndex!=z&&this._currentIndex+1=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex="0"&&this._string.charAt(this._currentIndex)<="9";){l*=10;l+=this._string.charAt(this._currentIndex)-"0";this._currentIndex++}}u=u+k;u*=d;if(l)u*=Math.pow(10,q*l);if(z!=this._currentIndex){this._skipOptionalSpacesOrDelimiter(); +return u}}};c.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var l=false;l=this._string.charAt(this._currentIndex++);if(l=="0")l=false;else if(l=="1")l=true;else return;this._skipOptionalSpacesOrDelimiter();return l}};c.prototype.parseSegment=function(){var l=this._string[this._currentIndex],u=this._pathSegTypeFromChar(l);if(u==SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==SVGPathSeg.PATHSEG_UNKNOWN)return null;u=this._nextCommandHelper(l,this._previousCommand); +if(u==SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;this._previousCommand=u;switch(u){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(n,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(n,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(n,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(n,this._parseNumber(), +this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(n,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(n,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(n,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(n,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:this._skipOptionalSpaces(); +return new SVGPathSegClosePath(n);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:l={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(n,l.x,l.y,l.x1,l.y1,l.x2,l.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:l={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(n, +l.x,l.y,l.x1,l.y1,l.x2,l.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:l={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(n,l.x,l.y,l.x2,l.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:l={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(n,l.x,l.y,l.x2,l.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:l={x1:this._parseNumber(), +y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(n,l.x,l.y,l.x1,l.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:l={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(n,l.x,l.y,l.x1,l.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(n,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(n, +this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:l={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(n,l.x,l.y,l.x1,l.y1,l.arcAngle,l.arcLarge,l.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:l={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(), +x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(n,l.x,l.y,l.x1,l.y1,l.arcAngle,l.arcLarge,l.arcSweep);default:throw"Unknown path seg type.";}};e=new e;a=new c(a);if(!a.initialCommandIsMoveTo())return[];for(;a.hasMoreData();){c=a.parseSegment();if(!c)return[];e.appendSegment(c)}return e.pathSegList}}})();(function(){function a(n){var e=n.changedTouches,c=e[0],l="";switch(n.type){case "touchstart":l="mousedown";break;case "touchmove":l="mousemove";break;case "touchend":l="mouseup";break;default:return}n=document.createEvent("MouseEvent");n.initMouseEvent(l,true,true,window,1,c.screenX,c.screenY,c.clientX,c.clientY,false,false,false,false,0,null);e.length<2&&c.target.dispatchEvent(n)}document.addEventListener("touchstart",a,true);document.addEventListener("touchmove",a,true);document.addEventListener("touchend", +a,true);document.addEventListener("touchcancel",a,true)})();(function(a){function n(e){if(typeof e.data==="string"){var c=e.handler,l=e.data.toLowerCase().split(" ");e.handler=function(u){if(!(this!==u.target&&(/textarea|select/i.test(u.target.nodeName)||u.target.type==="text"))){var b=u.type!=="keypress"&&a.hotkeys.specialKeys[u.which],k=String.fromCharCode(u.which).toLowerCase(),d="",q={};if(u.altKey&&b!=="alt")d+="alt+";if(u.ctrlKey&&b!=="ctrl")d+="ctrl+";if(u.metaKey&&!u.ctrlKey&&b!=="meta")d+="meta+";if(u.shiftKey&&b!=="shift")d+="shift+";if(b)q[d+b]= +true;else{q[d+k]=true;q[d+a.hotkeys.shiftNums[k]]=true;if(d==="shift+")q[a.hotkeys.shiftNums[k]]=true}b=0;for(k=l.length;b","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:n}})})(jQuery);(function(a){var n={},e;a.svgIcons=function(c,l){function u(la,Y){if(la!=="ajax"){if(U)return;var ca=(L=ga[0].contentDocument)&&L.getElementById("svg_eof");if(!ca&&!(Y&&ca)){S++;if(S<50)setTimeout(u,20);else{k();U=true}return}U=true}K=a(L.firstChild).children();if(l.no_img)setTimeout(function(){H||b()},500);else{ca=ia+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";N=a(new Image).attr({src:ca,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} +function b(la,Y){if(!H){if(l.no_img)la=false;if(la){var ca=a(document.createElement("div"));ca.hide().appendTo("body")}if(Y){var pa=l.fallback_path?l.fallback_path:"";a.each(Y,function(Ua,La){a("#"+Ua);var qa=a(new Image).attr({"class":"svg_icon",src:pa+La,width:D,height:w,alt:"icon"});ja(qa,Ua)})}else for(var oa=K.length,na=0;na0&&!la)wa=e(wa,qa,true);ua(a(this),wa,La)})});if(!Y){la&&ca.remove();ga&&ga.remove();N&&N.remove()}l.resize&&a.resizeSvgIcons(l.resize);H=true;l.callback&&l.callback(n)}}function k(){if(c.indexOf(".svgz")!=-1){var la=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(la,l)}else l.fallback&&b(false,l.fallback)} +function d(la){if(window.btoa)return window.btoa(la);var Y=Array(Math.floor((la.length+2)/3)*4),ca,pa,oa,na,ma,Ha,Ia=0,Ea=0;do{ca=la.charCodeAt(Ia++);pa=la.charCodeAt(Ia++);oa=la.charCodeAt(Ia++);na=ca>>2;ca=(ca&3)<<4|pa>>4;ma=(pa&15)<<2|oa>>6;Ha=oa&63;if(isNaN(pa))ma=Ha=64;else if(isNaN(oa))Ha=64;Y[Ea++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(na);Y[Ea++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(ca);Y[Ea++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(ma); +Y[Ea++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Ha)}while(Ia-1&&M.indexOf("Chrome/");var ia="data:image/svg+xml;charset=utf-8;base64,";if(l.svgz){var ga=a('').appendTo("body").hide();try{L=ga[0].contentDocument;ga.load(u); +u(0,true)}catch(Z){k()}}else{var fa=new DOMParser;a.ajax({url:c,dataType:"string",success:function(la){if(la){L=fa.parseFromString(la,"text/xml");a(function(){u("ajax")})}else a(k)},error:function(la){if(window.opera)a(function(){k()});else if(la.responseText){L=fa.parseFromString(la.responseText,"text/xml");L.childNodes.length||a(k);a(function(){u("ajax")})}else a(k)}})}var ua=function(la,Y,ca,pa){T&&Y.css("visibility","hidden");if(l.replace){pa&&Y.attr("id",ca);(ca=la.attr("class"))&&Y.attr("class", +"svg_icon "+ca);la.replaceWith(Y)}else la.append(Y);T&&setTimeout(function(){Y.removeAttr("style")},1)},ja=function(la,Y){if(l.id_match===undefined||l.id_match!==false)ua(holder,la,Y,true);n[Y]=la};e=function(la,Y){var ca=la.find("defs");if(!ca.length)return la;ca=T?ca.find("*").filter(function(){return!!this.id}):ca.find("[id]");var pa=la[0].getElementsByTagName("*"),oa=pa.length;ca.each(function(na){var ma=this.id;a(L).find("#"+ma);this.id=na="x"+ma+Y+na;ma="url(#"+ma+")";var Ha="url(#"+na+")"; +for(na=0;na=0;jQuery.fn.jGraduate=function(c){var l= +arguments;return this.each(function(){function u(ha,V,da,R,P){var ba=P||a("stop",{"stop-color":V,"stop-opacity":da,offset:ha},fa);if(P){V=P.getAttribute("stop-color");da=P.getAttribute("stop-opacity");ha=P.getAttribute("offset")}else fa.appendChild(ba);if(da===null)da=1;P=a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:"url(#jGraduate_trans)",transform:"translate("+(10+ha*T)+", 26)"},ub);var Ba= +a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:V,"fill-opacity":da,transform:"translate("+(10+ha*T)+", 26)",stroke:"#000","stroke-width":1.5},ub);$(Ba).mousedown(function(Pa){b(this);Xa=gb;U.mousemove(q).mouseup(k);sa=nb.offset();Pa.preventDefault();return false}).data("stop",ba).data("bg",P).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Pa=this,Ra=+ba.getAttribute("stop-opacity")|| +1,eb=ba.getAttribute("stop-color")||1,Wa=(parseFloat(Ra)*255).toString(16);Wa.length<2;)Wa="0"+Wa;V=eb.substr(1)+Wa;$("#"+w+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:D.images.clientPath},color:{active:V,alphaSupport:true}},function(Da){eb=Da.val("hex")?"#"+Da.val("hex"):"none";Ra=Da.val("a")!==null?Da.val("a")/256:1;Pa.setAttribute("fill",eb);Pa.setAttribute("fill-opacity",Ra);ba.setAttribute("stop-color", +eb);ba.setAttribute("stop-opacity",Ra);$("div.jGraduate_LightBox").hide();$("#"+w+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+w+"_jGraduate_stopPicker").hide()})});$(fa).find("stop").each(function(){var Pa=$(this);if(+this.getAttribute("offset")>ha){if(!V){var Ra=this.getAttribute("stop-color"),eb=this.getAttribute("stop-opacity");ba.setAttribute("stop-color",Ra);Ba.setAttribute("fill",Ra);ba.setAttribute("stop-opacity",eb===null?1:eb);Ba.setAttribute("fill-opacity", +eb===null?1:eb)}Pa.before(ba);return false}});R&&b(Ba);return ba}function b(ha){gb&&gb.setAttribute("stroke","#000");ha.setAttribute("stroke","blue");gb=ha;gb.parentNode.appendChild(gb)}function k(){U.unbind("mousemove",q);if(ya.getAttribute("display")!=="none"){ya.setAttribute("display","none");var ha=$(gb),V=ha.data("stop");ha=ha.data("bg");$([gb,V,ha]).remove()}Xa=null}function d(){var ha=xa?"rotate("+xa+","+bb+","+jb+") ":"";Fa===1&&Qa===1?fa.removeAttribute("gradientTransform"):fa.setAttribute("gradientTransform", +ha+"translate("+-bb*(Fa-1)+","+-jb*(Qa-1)+") scale("+Fa+","+Qa+")")}function q(ha){var V=ha.pageX-sa.left;ha=ha.pageY-sa.top;V=V<10?10:V>T+10?T+10:V;var da="translate("+V+", 26)";if(ha<-60||ha>130){ya.setAttribute("display","block");ya.setAttribute("transform",da)}else ya.setAttribute("display","none");Xa.setAttribute("transform",da);$.data(Xa,"bg").setAttribute("transform",da);$.data(Xa,"stop").setAttribute("offset",(V-10)/T);var R=0;$(fa).find("stop").each(function(){var P=this.getAttribute("offset"), +ba=$(this);if(P
  • Solid Color
  • Linear Gradient
  • Radial Gradient
  • ');var S=$(K+"> .jGraduate_colPick"),M=$(K+"> .jGraduate_gradPick");M.html('

    '+D.window.pickerTitle+'


    ');var T=256,ia=T-0,ga=T-0,Z,fa,ua,ja={};$(".jGraduate_SliderBar").width(145);var la=$("#"+w+"_jGraduate_GradContainer")[0],Y=a("svg",{id:w+"_jgraduate_svg",width:T,height:T,xmlns:n.svg},la);Z=Z||z.paint.type;var ca=fa=z.paint[Z],pa=z.paint.alpha,oa=Z==="solidColor";switch(Z){case "solidColor":case "linearGradient":if(!oa){fa.id=w+"_lg_jgraduate_grad"; +ca=fa=Y.appendChild(fa)}a("radialGradient",{id:w+"_rg_jgraduate_grad"},Y);if(Z==="linearGradient")break;case "radialGradient":if(!oa){fa.id=w+"_rg_jgraduate_grad";ca=fa=Y.appendChild(fa)}a("linearGradient",{id:w+"_lg_jgraduate_grad",x1:0,y1:0,x2:1,y2:0},Y)}if(oa){ca=fa=$("#"+w+"_lg_jgraduate_grad")[0];H=z.paint[Z];u(0,"#"+H,1);var na=typeof D.newstop;if(na==="string")switch(D.newstop){case "same":u(1,"#"+H,1);break;case "inverse":na="";if(H.length===3)H=H.split("").map(function(ha){return ha+""+ha}).join(""); +for(var ma=0;ma<6;ma+=2){H.substr(ma,2);var Ha=(255-parseInt(H.substr(ma,2),16)).toString(16);if(Ha.length<2)Ha=0+Ha;na+=Ha}u(1,"#"+na,1);break;case "white":u(1,"#ffffff",1);break;case "black":u(1,"#000000",1)}else if(na==="object")u(1,D.newstop.color||"#"+H,"opac"in D.newstop?D.newstop.opac:1)}H=parseFloat(ca.getAttribute("x1")||0);na=parseFloat(ca.getAttribute("y1")||0);ma=parseFloat(ca.getAttribute("x2")||1);Ha=parseFloat(ca.getAttribute("y2")||0);var Ia=parseFloat(ca.getAttribute("cx")||0.5), +Ea=parseFloat(ca.getAttribute("cy")||0.5),Va=parseFloat(ca.getAttribute("fx")||Ia),Ua=parseFloat(ca.getAttribute("fy")||Ea);ua=a("rect",{id:w+"_jgraduate_rect",x:0,y:0,width:ia,height:ga,fill:"url(#"+w+"_jgraduate_grad)","fill-opacity":pa/100},Y);var La=$("
    ").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:na*T,left:H*T}).data("coord","start").appendTo(la),qa=La.clone().text(2).css({top:Ha*T,left:ma*T}).attr("title","End stop").data("coord","end").appendTo(la), +wa=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ea*T,left:Ia*T}).data("coord","center").appendTo(la),za=wa.clone().text("F").css({top:Ua*T,left:Va*T,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(la);za[0].id=w+"_jGraduate_focusCoord";$(K+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(ha,V){var da=fa.getAttribute(V),R=isNaN(V[1]);da||(da=R?"0.5":V==="x2"?"1.0":"0.0");ja[V]=$("#"+w+"_jGraduate_"+ +V).val(da).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value>1)this.value=1;if(!(V[0]==="f"&&!cb))if(R&&Z==="radialGradient"||!R&&Z==="linearGradient")fa.setAttribute(V,this.value);var P=R?V[0]==="c"?wa:za:V[1]==="1"?La:qa,ba=V.indexOf("x")>=0?"left":"top";P.css(ba,this.value*T)}).change()});var va,ub,nb=$("#"+w+"_jGraduate_StopSlider"),gb,Sa,Xa,ya=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"}, +Sa),sa,Fa=1,Qa=1,xa=0,bb=Ia,jb=Ea;Sa=a("svg",{width:"100%",height:45},nb[0]);la=a("pattern",{width:16,height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},Sa);a("image",{width:16,height:16},la).setAttributeNS(n.xlink,"xlink:href",D.images.clientPath+"map-opacity.png");$(Sa).on("click touchstart",function(ha){sa=nb.offset();if(ha.target.tagName!=="path"){var V=ha.pageX-sa.left-8;V=V<10?10:V>T+10?T+10:V;u(V/T,0,0,true);ha.stopPropagation()}});$(Sa).mouseover(function(){Sa.appendChild(ya)}); +ub=a("g",{},Sa);a("line",{x1:10,y1:15,x2:T+10,y2:15,"stroke-width":2,stroke:"#000"},Sa);var Ya=M.find(".jGraduate_spreadMethod").change(function(){fa.setAttribute("spreadMethod",$(this).val())}),Ta=null,rb=function(ha){var V=ha.pageX-pb.left,da=ha.pageY-pb.top;V=V<0?0:V>T?T:V;da=da<0?0:da>T?T:da;Ta.css("left",V).css("top",da);V=V/ia;da=da/ga;var R=Ta.data("coord"),P=fa;switch(R){case "start":ja.x1.val(V);ja.y1.val(da);P.setAttribute("x1",V);P.setAttribute("y1",da);break;case "end":ja.x2.val(V);ja.y2.val(da); +P.setAttribute("x2",V);P.setAttribute("y2",da);break;case "center":ja.cx.val(V);ja.cy.val(da);P.setAttribute("cx",V);P.setAttribute("cy",da);bb=V;jb=da;d();break;case "focus":ja.fx.val(V);ja.fy.val(da);P.setAttribute("fx",V);P.setAttribute("fy",da);d()}ha.preventDefault()},Ja=function(){Ta=null;U.unbind("mousemove",rb).unbind("mouseup",Ja)};va=fa.getElementsByTagNameNS(n.svg,"stop");if(Ka<2){for(;Ka<2;){fa.appendChild(document.createElementNS(n.svg,"stop"));++Ka}va=fa.getElementsByTagNameNS(n.svg, +"stop")}var Ka=va.length;for(ma=0;ma99.5)R=99.5;if(R>0)Qa=1-R/100;else Fa=-(R/100)-1;P=145*((R+100)/2)/100;ba&&d();break;case "angle":xa=R;P=xa/180;P+=0.5;P*=145;ba&&d()}if(P>145)P=145;else if(P<0)P=0;da.css({"margin-left":P-5})}).change()});var Za=function(ha){var V=ha.pageX-db.offset.left-parseInt(db.parent.css("border-left-width"));if(V>145)V=145;if(V<=0)V=0;var da=V-5;V/=145;switch(db.type){case "radius":V=Math.pow(V*2,2.5);if(V>0.98&&V<1.02)V=1;if(V<=0.01)V=0.01;fa.setAttribute("r",V);break;case "opacity":z.paint.alpha= +parseInt(V*100);ua.setAttribute("fill-opacity",V);break;case "ellip":Qa=Fa=1;if(V<0.5){V/=0.5;Fa=V<=0?0.01:V}else if(V>0.5){V/=0.5;V=2-V;Qa=V<=0?0.01:V}d();V-=1;if(Qa===V+1)V=Math.abs(V);break;case "angle":V-=0.5;xa=V*=180;d();V/=100}db.elem.css({"margin-left":da});V=Math.round(V*100);db.input.val(V);ha.preventDefault()},vb=function(){U.unbind("mousemove",Za).unbind("mouseup",vb);db=null};for(M=(z.paint.alpha*255/100).toString(16);M.length<2;)M="0"+M;M=M.split(".")[0];H=z.paint.solidColor=="none"? +"":z.paint.solidColor+M;oa||(H=va[0].getAttribute("stop-color"));$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});S.jPicker({window:{title:D.window.pickerTitle},images:{clientPath:D.images.clientPath},color:{active:H,alphaSupport:true}},function(ha){z.paint.type="solidColor";z.paint.alpha=ha.val("ahex")?Math.round(ha.val("a")/255*100):100;z.paint.solidColor=ha.val("hex")?ha.val("hex"):"none";z.paint.radialGradient=null;L()},null,function(){N()});var qb=$(K+ +" .jGraduate_tabs li");qb.on("click touchstart",function(){qb.removeClass("jGraduate_tab_current");$(this).addClass("jGraduate_tab_current");$(K+" > div").hide();var ha=$(this).attr("data-type");$(K+" .jGraduate_gradPick").show();if(ha==="rg"||ha==="lg"){$(".jGraduate_"+ha+"_field").show();$(".jGraduate_"+(ha==="lg"?"rg":"lg")+"_field").hide();$("#"+w+"_jgraduate_rect")[0].setAttribute("fill","url(#"+w+"_"+ha+"_jgraduate_grad)");Z=ha==="lg"?"linearGradient":"radialGradient";$("#"+w+"_jGraduate_OpacInput").val(z.paint.alpha).change(); +var V=$("#"+w+"_"+ha+"_jgraduate_grad")[0];if(fa!==V){var da=$(fa).find("stop");$(V).empty().append(da);fa=V;V=Ya.val();fa.setAttribute("spreadMethod",V)}cb=ha==="rg"&&fa.getAttribute("fx")!=null&&!(Ia==Va&&Ea==Ua);$("#"+w+"_jGraduate_focusCoord").toggle(cb);if(cb)$("#"+w+"_jGraduate_match_ctr")[0].checked=false}else{$(K+" .jGraduate_gradPick").hide();$(K+" .jGraduate_colPick").show()}});$(K+" > div").hide();qb.removeClass("jGraduate_tab_current");var lb;switch(z.paint.type){case "linearGradient":lb= +$(K+" .jGraduate_tab_lingrad");break;case "radialGradient":lb=$(K+" .jGraduate_tab_radgrad");break;default:lb=$(K+" .jGraduate_tab_color")}z.show();setTimeout(function(){lb.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();jQuery&&function(){var a=$(window),n=$(document);$.extend($.fn,{contextMenu:function(e,c){if(e.menu==undefined)return false;if(e.inSpeed==undefined)e.inSpeed=150;if(e.outSpeed==undefined)e.outSpeed=75;if(e.inSpeed==0)e.inSpeed=-1;if(e.outSpeed==0)e.outSpeed=-1;$(this).each(function(){var l=$(this),u=$(l).offset(),b=$("#"+e.menu);b.addClass("contextMenu");$(this).bind("mousedown",function(d){$(this).on("mouseup",function(q){var z=$(this);z.unbind("mouseup");$(".contextMenu").hide();if(d.button===2|| +e.allowLeft||d.ctrlKey&&svgedit.browser.isMac())svgedit.browser.isTouch()||k(q,d,z)})});svgedit.browser.isTouch()&&$(this).bind("taphold",function(d){var q=$(this);q.unbind("mouseup");k(d,d,q)});var k=function(d,q,z){if(typeof q=="undefined")q=d;d.stopPropagation();if(l.hasClass("disabled")||q.altKey)return false;var D=d.pageX,w=d.pageY;if(svgedit.browser.isTouch()){D=d.originalEvent.touches[0].pageX;w=d.originalEvent.touches[0].pageY}d=a.width()-b.width();q=a.height()-b.height();if(D>d-15)D=d-15; +if(w>q-30)w=q-30;if(svgedit.browser.isTouch())w-=b.height()/2;n.unbind("click");b.css({top:w,left:D}).fadeIn(e.inSpeed);b.find("A").mouseover(function(){b.find("LI.hover").removeClass("hover");$(this).parent().addClass("hover")}).mouseout(function(){b.find("LI.hover").removeClass("hover")});n.keypress(function(K){switch(K.keyCode){case 38:if(b.find("LI.hover").length){b.find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover");b.find("LI.hover").length||b.find("LI:last").addClass("hover")}else b.find("LI:last").addClass("hover"); +break;case 40:if(b.find("LI.hover").length==0)b.find("LI:first").addClass("hover");else{b.find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover");b.find("LI.hover").length||b.find("LI:first").addClass("hover")}break;case 13:b.find("LI.hover A").trigger("click");break;case 27:n.trigger("click")}});b.find("A").unbind("mouseup");b.find("LI:not(.disabled) A").mouseup(function(){n.unbind("click").unbind("keypress");$(".contextMenu").hide();c&&c($(this).attr("href").substr(1), +$(z),{x:D-u.left,y:w-u.top,docX:D,docY:w});return false});setTimeout(function(){n.click(function(){n.unbind("click").unbind("keypress");b.fadeOut(e.outSpeed);return false})},0)};$(l).add($("UL.contextMenu")).bind("contextmenu",function(){return false})});return $(this)},disableContextMenuItems:function(e){if(e==undefined){$(this).find("LI").addClass("disabled");return $(this)}$(this).each(function(){if(e!=undefined)for(var c=e.split(","),l=0;l=0,u=n.indexOf("Gecko/")>=0,b=n.indexOf("MSIE")>=0,k=n.indexOf("Chrome/")>=0,d=n.indexOf("Windows")>=0,q=n.indexOf("Macintosh")>= +0,z="ontouchstart"in window,D=!!e.querySelector,w=!!document.evaluate,K=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","svg"),ia=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(T);ia.setAttribute("x",5);T.appendChild(ia);var ga=document.createElementNS("http://www.w3.org/2000/svg","text");ga.textContent="a";ia.appendChild(ga);ia=ga.getStartPositionOfChar(0);ia=ia.x;document.documentElement.removeChild(T);return ia===0}(),L= +function(){var T=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(T);var ia=document.createElementNS("http://www.w3.org/2000/svg","path");ia.setAttribute("d","M0,0 C0,0 10,10 10,0");T.appendChild(ia);ia=ia.getBBox();document.documentElement.removeChild(T);return ia.height>4&&ia.height<5}(),N=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(T);var ia=document.createElementNS("http://www.w3.org/2000/svg", +"path");ia.setAttribute("d","M0,0 10,0");var ga=document.createElementNS("http://www.w3.org/2000/svg","path");ga.setAttribute("d","M5,0 15,0");var Z=document.createElementNS("http://www.w3.org/2000/svg","g");Z.appendChild(ia);Z.appendChild(ga);T.appendChild(Z);ia=Z.getBBox();document.documentElement.removeChild(T);return ia.width==15}(),H=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","rect");T.setAttribute("x",0.1);(T=T.cloneNode(false).getAttribute("x").indexOf(",")==-1)|| +$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n Please upgrade to the latest version in which the problems have been fixed.");return T}(),U=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","rect");T.setAttribute("style","vector-effect:non-scaling-stroke");return T.style.vectorEffect==="non-scaling-stroke"}(),S=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,ia=e.createSVGTransform(); +T.appendItem(ia);return T.getItem(0)==ia}(),M=function(){if(typeof Blob!="function")return false;var T=new Blob([""],{type:"image/svg+xml;charset=utf-8"}),ia=new Image;ia.onload=function(){svgedit.browser.supportsBlobs=function(){return true}};ia.onerror=function(){svgedit.browser.supportsBlobs=function(){return false}};ia.src=URL.createObjectURL(T);return false}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return l}; +svgedit.browser.isGecko=function(){return u};svgedit.browser.isIE=function(){return b};svgedit.browser.isChrome=function(){return k};svgedit.browser.isWindows=function(){return d};svgedit.browser.isMac=function(){return q};svgedit.browser.isTouch=function(){return z};svgedit.browser.supportsSelectors=function(){return D};svgedit.browser.supportsXpath=function(){return w};svgedit.browser.supportsPathBBox=function(){return L};svgedit.browser.supportsHVLineContainerBBox=function(){return N};svgedit.browser.supportsGoodTextCharPos= +function(){return K};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return H};svgedit.browser.supportsNonScalingStroke=function(){return U};svgedit.browser.supportsNativeTransformLists=function(){return S};svgedit.browser.supportsBlobs=function(){return M}}else window.location="browser-not-supported.html"})();svgedit=svgedit||{}; +(function(){if(!svgedit.transformlist)svgedit.transformlist={};var a=document.createElementNS("http://www.w3.org/2000/svg","svg"),n={};svgedit.transformlist.SVGTransformList=function(e){this._elem=e||null;this._xforms=[];this._update=function(){var c="";a.createSVGMatrix();for(var l=0;l=0)return this._xforms[c];throw{code:1};};this.insertItemBefore=function(c,l){var u=null;if(l>=0)if(l=0){this._removeFromOtherLists(c);u=this._xforms[l]=c;this._list._update()}return u};this.removeItem=function(c){if(c=0){for(var l=this._xforms[c],u=Array(this.numberOfItems- +1),b=0;b1;)c=n[e-1].multiply(c);if(Math.abs(c.a)<1.0E-14)c.a=0;if(Math.abs(c.b)<1.0E-14)c.b=0;if(Math.abs(c.c)<1.0E-14)c.c=0;if(Math.abs(c.d)< +1.0E-14)c.d=0;if(Math.abs(c.e)<1.0E-14)c.e=0;if(Math.abs(c.f)<1.0E-14)c.f=0;return c};svgedit.math.hasMatrixTransform=function(n){if(!n)return false;for(var e=n.numberOfItems;e--;){var c=n.getItem(e);if(c.type==1&&!svgedit.math.isIdentity(c.matrix))return true}return false};svgedit.math.transformBox=function(n,e,c,l,u){var b={x:n,y:e},k={x:n+c,y:e};c={x:n+c,y:e+l};n={x:n,y:e+l};e=svgedit.math.transformPoint;b=e(b.x,b.y,u);var d=l=b.x,q=b.y,z=b.y;k=e(k.x,k.y,u);l=Math.min(l,k.x);d=Math.max(d,k.x); +q=Math.min(q,k.y);z=Math.max(z,k.y);n=e(n.x,n.y,u);l=Math.min(l,n.x);d=Math.max(d,n.x);q=Math.min(q,n.y);z=Math.max(z,n.y);c=e(c.x,c.y,u);l=Math.min(l,c.x);d=Math.max(d,c.x);q=Math.min(q,c.y);z=Math.max(z,c.y);return{tl:b,tr:k,bl:n,br:c,aabox:{x:l,y:q,width:d-l,height:z-q}}};svgedit.math.transformListToTransform=function(n,e,c){if(n==null)return a.createSVGTransformFromMatrix(a.createSVGMatrix());e=e==undefined?0:e;c=c==undefined?n.numberOfItems-1:c;e=parseInt(e);c=parseInt(c);if(e>c){var l=c;c=e; +e=l}l=a.createSVGMatrix();for(e=e;e<=c;++e){var u=e>=0&&en.x&&e.yn.y}})();svgedit=svgedit||{}; +(function(){if(!svgedit.units)svgedit.units={};var a=["x","x1","cx","rx","width"],n=["y","y1","cy","ry","height"],e=$.merge(["r","radius"],a);$.merge(e,n);var c,l={px:1};svgedit.units.init=function(b){c=b;b=document.createElementNS("http://www.w3.org/2000/svg","svg");document.body.appendChild(b);var k=document.createElementNS("http://www.w3.org/2000/svg","rect");k.setAttribute("width","1em");k.setAttribute("height","1ex");k.setAttribute("x","1in");b.appendChild(k);k=k.getBBox();document.body.removeChild(b); +b=k.x;l.em=k.width;l.ex=k.height;l["in"]=b;l.cm=b/2.54;l.mm=b/25.4;l.pt=b/72;l.pc=b/6;l["%"]=0};svgedit.units.getTypeMap=function(){return l};svgedit.units.shortFloat=function(b){var k=c.getRoundDigits();if(isNaN(b)){if($.isArray(b))return svgedit.units.shortFloat(b[0])+","+svgedit.units.shortFloat(b[1])}else return+(+b).toFixed(k);return parseFloat(b).toFixed(k)-0};svgedit.units.convertUnit=function(b,k){k=k||c.getBaseUnit();return svgedit.unit.shortFloat(b/l[k])};svgedit.units.setUnitAttr=function(b, +k,d){isNaN(d)||b.getAttribute(k);b.setAttribute(k,d)};var u={line:["x1","x2","y1","y2"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],foreignObject:["x","y","width","height"],rect:["x","y","width","height"],image:["x","y","width","height"],use:["x","y","width","height"],text:["x","y"]};svgedit.units.convertAttrs=function(b){var k=b.tagName,d=c.getBaseUnit();if(k=u[k])for(var q=k.length,z=0;z=0?d*q:n.indexOf(b)>=0?d*z:d*Math.sqrt(q*q+z*z)/Math.sqrt(2)}else{q=k.substr(-2);d=k.substr(0,k.length-2);return d*l[q]}};svgedit.units.isValidUnit=function(b,k,d){var q=false;if(e.indexOf(b)>=0)if(isNaN(k)){k=k.toLowerCase();$.each(l,function(w){if(!q)if(RegExp("^-?[\\d\\.]+"+w+"$").test(k))q=true})}else q=true;else if(b=="id"){b=false;try{var z=c.getElement(k); +b=z==null||z===d}catch(D){}return b}else q=true;return q}})();svgedit=svgedit||{}; +(function(){function a(b){if(svgedit.browser.supportsHVLineContainerBBox())try{return b.getBBox()}catch(k){}var d=$.data(b,"ref"),q=null;if(d){var z=$(d).children().clone().attr("visibility","hidden");$(u).append(z);q=z.filter("line, path")}else q=$(b).find("line, path");var D=false;if(q.length){q.each(function(){var w=this.getBBox();if(!w.width||!w.height)D=true});if(D){b=d?z:$(b).children();ret=getStrokedBBox(b)}else ret=b.getBBox()}else ret=b.getBBox();d&&z.remove();return ret}if(!svgedit.utilities)svgedit.utilities= +{};var n="a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use".split(","),e=null,c=null,l=null,u=null;svgedit.utilities.init=function(b){e=b;c=b.getDOMDocument();l=b.getDOMContainer();u=b.getSVGRoot()};svgedit.utilities.toXml=function(b){return $("

    ").text(b).html()};svgedit.utilities.fromXml=function(b){return $("

    ").html(b).text()};svgedit.utilities.encode64=function(b){b=svgedit.utilities.convertToXMLReferences(b);if(window.btoa)return window.btoa(b); +var k=Array(Math.floor((b.length+2)/3)*4),d,q,z,D,w,K,L=0,N=0;do{d=b.charCodeAt(L++);q=b.charCodeAt(L++);z=b.charCodeAt(L++);D=d>>2;d=(d&3)<<4|q>>4;w=(q&15)<<2|z>>6;K=z&63;if(isNaN(q))w=K=64;else if(isNaN(z))K=64;k[N++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(D);k[N++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d);k[N++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(w);k[N++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(K)}while(L< +b.length);return k.join("")};svgedit.utilities.decode64=function(b){if(window.atob)return window.atob(b);var k="",d,q,z="",D,w="",K=0;b=b.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++));q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++));D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++));w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++)); +d=d<<2|q>>4;q=(q&15)<<4|D>>2;z=(D&3)<<6|w;k+=String.fromCharCode(d);if(D!=64)k+=String.fromCharCode(q);if(w!=64)k+=String.fromCharCode(z)}while(K=0?atob(b.split(",")[1]):unescape(b.split(",")[1]);k=b.split(",")[0].split(":")[1].split(";")[0];for(var q=new Uint8Array(d.length),z=0;z127)k+="&#"+q+";"}return k};svgedit.utilities.text2xml=function(b){if(b.indexOf("=0)b=b.replace(/<(\/?)svg:/g,"<$1").replace("xmlns:svg","xmlns");var k;try{var d=window.DOMParser?new DOMParser:new ActiveXObject("Microsoft.XMLDOM");d.async=false}catch(q){throw Error("XML Parser could not be instantiated");}try{k=d.loadXML?d.loadXML(b)?d:false:d.parseFromString(b,"text/xml")}catch(z){throw Error("Error parsing XML string"); +}return k};svgedit.utilities.bboxToObj=function(b){return{x:b.x,y:b.y,width:b.width,height:b.height}};svgedit.utilities.walkTree=function(b,k){if(b&&b.nodeType==1){k(b);for(var d=b.childNodes.length;d--;)svgedit.utilities.walkTree(b.childNodes.item(d),k)}};svgedit.utilities.walkTreePost=function(b,k){if(b&&b.nodeType==1){for(var d=b.childNodes.length;d--;)svgedit.utilities.walkTree(b.childNodes.item(d),k);k(b)}};svgedit.utilities.getUrlFromAttr=function(b){if(b)if(b.indexOf('url("')===0)return b.substring(5, +b.indexOf('"',6));else if(b.indexOf("url('")===0)return b.substring(5,b.indexOf("'",6));else if(b.indexOf("url(")===0)return b.substring(4,b.indexOf(")"));return null};svgedit.utilities.getHref=function(b){if(b)return b.getAttributeNS("http://www.w3.org/1999/xlink","href")};svgedit.utilities.setHref=function(b,k){b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",k)};svgedit.utilities.findDefs=function(b){b=e.getSVGContent().documentElement;var k=b.getElementsByTagNameNS("http://www.w3.org/2000/svg", +"defs");return k=k.length>0?k[0]:b.insertBefore(b.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),b.firstChild.nextSibling)};svgedit.utilities.getPathBBox=function(b){var k=b.pathSegList,d=k.numberOfItems;b=[[],[]];var q=k.getItem(0),z=[q.x,q.y];for(q=0;q=0){var q=d.split(":");b[q[1]]=n[q[0]]}else b[d]=d=="xmlns"?"http://www.w3.org/2000/xmlns/":null});c[l]=b});svgedit.sanitize.getNSMap=function(){return a};svgedit.sanitize.sanitizeSvg=function(l){if(l.nodeType==3){l.nodeValue=l.nodeValue.replace(/^\s+|\s+$/g,"");l.nodeValue.length||l.parentNode.removeChild(l)}if(l.nodeType==1){var u=l.parentNode;if(l.ownerDocument&&u){var b=e[l.nodeName],k=c[l.nodeName];if(b!= +undefined){for(var d=[],q=l.attributes.length;q--;){var z=l.attributes.item(q),D=z.nodeName,w=z.localName,K=z.namespaceURI;if(!(k.hasOwnProperty(w)&&K==k[w]&&K!="http://www.w3.org/2000/xmlns/")&&!(K=="http://www.w3.org/2000/xmlns/"&&a[z.nodeValue])){D.indexOf("se:")==0&&d.push([D,z.nodeValue]);l.removeAttributeNS(K,w)}if(svgedit.browser.isGecko())switch(D){case "transform":case "gradientTransform":case "patternTransform":w=z.nodeValue.replace(/(\d)-/g,"$1 -");l.setAttribute(D,w)}if(D=="style"){z= +z.nodeValue.split(";");for(D=z.length;D--;){w=z[D].split(":");b.indexOf(w[0])>=0&&l.setAttribute(w[0],w[1])}l.removeAttribute("style")}}$.each(d,function(L,N){l.setAttributeNS("http://svg-edit.googlecode.com",N[0],N[1])});if((q=svgedit.utilities.getHref(l))&&["filter","linearGradient","pattern","radialGradient","textPath","use"].indexOf(l.nodeName)>=0)if(q[0]!="#"){svgedit.utilities.setHref(l,"");l.removeAttributeNS("http://www.w3.org/1999/xlink","href")}if(l.nodeName=="use"&&!svgedit.utilities.getHref(l))u.removeChild(l); +else{$.each(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"],function(L,N){var H=l.getAttribute(N);if(H)if((H=svgedit.utilities.getUrlFromAttr(H))&&H[0]!=="#"){l.setAttribute(N,"");l.removeAttribute(N)}});for(q=l.childNodes.length;q--;)svgedit.sanitize.sanitizeSvg(l.childNodes.item(q))}}else{for(b=[];l.hasChildNodes();)b.push(u.insertBefore(l.firstChild,l));u.removeChild(l);for(q=b.length;q--;)svgedit.sanitize.sanitizeSvg(b[q])}}}}})();svgedit=svgedit||{}; +(function(){if(!svgedit.history)svgedit.history={};svgedit.history.HistoryEventTypes={BEFORE_APPLY:"before_apply",AFTER_APPLY:"after_apply",BEFORE_UNAPPLY:"before_unapply",AFTER_UNAPPLY:"after_unapply"};svgedit.history.MoveElementCommand=function(a,n,e,c){this.elem=a;this.text=c?"Move "+a.tagName+" to "+c:"Move "+a.tagName;this.oldNextSibling=n;this.oldParent=e;this.newNextSibling=a.nextSibling;this.newParent=a.parentNode};svgedit.history.MoveElementCommand.type=function(){return"svgedit.history.MoveElementCommand"};svgedit.history.MoveElementCommand.prototype.type= +svgedit.history.MoveElementCommand.type;svgedit.history.MoveElementCommand.prototype.getText=function(){return this.text};svgedit.history.MoveElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);this.elem=this.newParent.insertBefore(this.elem,this.newNextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY,this)};svgedit.history.MoveElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY, +this);this.elem=this.oldParent.insertBefore(this.elem,this.oldNextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this)};svgedit.history.MoveElementCommand.prototype.elements=function(){return[this.elem]};svgedit.history.InsertElementCommand=function(a,n){this.elem=a;this.text=n||"Create "+a.tagName;this.parent=a.parentNode;this.nextSibling=this.elem.nextSibling};svgedit.history.InsertElementCommand.type=function(){return"svgedit.history.InsertElementCommand"};svgedit.history.InsertElementCommand.prototype.type= +svgedit.history.InsertElementCommand.type;svgedit.history.InsertElementCommand.prototype.getText=function(){return this.text};svgedit.history.InsertElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);this.elem=this.parent.insertBefore(this.elem,this.nextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY,this)};svgedit.history.InsertElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY, +this);this.parent=this.elem.parentNode;this.elem=this.elem.parentNode.removeChild(this.elem);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this)};svgedit.history.InsertElementCommand.prototype.elements=function(){return[this.elem]};svgedit.history.RemoveElementCommand=function(a,n,e,c){this.elem=a;this.text=c||"Delete "+a.tagName;this.nextSibling=n;this.parent=e;svgedit.transformlist.removeElementFromListMap(a)};svgedit.history.RemoveElementCommand.type=function(){return"svgedit.history.RemoveElementCommand"}; +svgedit.history.RemoveElementCommand.prototype.type=svgedit.history.RemoveElementCommand.type;svgedit.history.RemoveElementCommand.prototype.getText=function(){return this.text};svgedit.history.RemoveElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);svgedit.transformlist.removeElementFromListMap(this.elem);this.parent=this.elem.parentNode;this.elem=this.parent.removeChild(this.elem);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY, +this)};svgedit.history.RemoveElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY,this);svgedit.transformlist.removeElementFromListMap(this.elem);this.nextSibling==null&&window.console&&console.log("Error: reference element was lost");this.parent.insertBefore(this.elem,this.nextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this)};svgedit.history.RemoveElementCommand.prototype.elements=function(){return[this.elem]}; +svgedit.history.ChangeElementCommand=function(a,n,e){this.elem=a;this.text=e?"Change "+a.tagName+" "+e:"Change "+a.tagName;this.newValues={};this.oldValues=n;for(var c in n)this.newValues[c]=c=="#text"?a.textContent:c=="#href"?svgedit.utilities.getHref(a):a.getAttribute(c)};svgedit.history.ChangeElementCommand.type=function(){return"svgedit.history.ChangeElementCommand"};svgedit.history.ChangeElementCommand.prototype.type=svgedit.history.ChangeElementCommand.type;svgedit.history.ChangeElementCommand.prototype.getText= +function(){return this.text};svgedit.history.ChangeElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);var n=false,e;for(e in this.newValues){if(this.newValues[e])if(e=="#text")this.elem.textContent=this.newValues[e];else e=="#href"?svgedit.utilities.setHref(this.elem,this.newValues[e]):this.elem.setAttribute(e,this.newValues[e]);else if(e=="#text")this.elem.textContent="";else{this.elem.setAttribute(e,"");this.elem.removeAttribute(e)}if(e== +"transform")n=true}if(!n)if(n=svgedit.utilities.getRotationAngle(this.elem)){e=elem.getBBox();n=["rotate(",n," ",e.x+e.width/2,",",e.y+e.height/2,")"].join("");n!=elem.getAttribute("transform")&&elem.setAttribute("transform",n)}a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY,this);return true};svgedit.history.ChangeElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY,this);var n=false,e;for(e in this.oldValues){if(this.oldValues[e])if(e== +"#text")this.elem.textContent=this.oldValues[e];else e=="#href"?svgedit.utilities.setHref(this.elem,this.oldValues[e]):this.elem.setAttribute(e,this.oldValues[e]);else if(e=="#text")this.elem.textContent="";else this.elem.removeAttribute(e);if(e=="transform")n=true}if(!n)if(n=svgedit.utilities.getRotationAngle(this.elem)){e=this.elem.getBBox();n=["rotate(",n," ",e.x+e.width/2,",",e.y+e.height/2,")"].join("");n!=this.elem.getAttribute("transform")&&this.elem.setAttribute("transform",n)}svgedit.transformlist.removeElementFromListMap(this.elem); +a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this);return true};svgedit.history.ChangeElementCommand.prototype.elements=function(){return[this.elem]};svgedit.history.BatchCommand=function(a){this.text=a||"Batch Command";this.stack=[]};svgedit.history.BatchCommand.type=function(){return"svgedit.history.BatchCommand"};svgedit.history.BatchCommand.prototype.type=svgedit.history.BatchCommand.type;svgedit.history.BatchCommand.prototype.getText=function(){return this.text};svgedit.history.BatchCommand.prototype.apply= +function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);for(var n=this.stack.length,e=0;e=0;n--)this.stack[n].unapply(a);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY, +this)};svgedit.history.BatchCommand.prototype.elements=function(){for(var a=[],n=this.stack.length;n--;)for(var e=this.stack[n].elements(),c=e.length;c--;)a.indexOf(e[c])==-1&&a.push(e[c]);return a};svgedit.history.BatchCommand.prototype.addSubCommand=function(a){this.stack.push(a)};svgedit.history.BatchCommand.prototype.isEmpty=function(){return this.stack.length==0};svgedit.history.UndoManager=function(a){this.handler_=a||null;this.undoStackPointer=0;this.undoStack=[];this.undoChangeStackPointer= +-1;this.undoableChangeStack=[]};svgedit.history.UndoManager.prototype.resetUndoStack=function(){this.undoStack=[];this.undoStackPointer=0};svgedit.history.UndoManager.prototype.getUndoStackSize=function(){return this.undoStackPointer};svgedit.history.UndoManager.prototype.getRedoStackSize=function(){return this.undoStack.length-this.undoStackPointer};svgedit.history.UndoManager.prototype.getNextUndoCommandText=function(){return this.undoStackPointer>0?this.undoStack[this.undoStackPointer-1].getText(): +""};svgedit.history.UndoManager.prototype.getNextRedoCommandText=function(){return this.undoStackPointer0&&this.undoStack[--this.undoStackPointer].unapply(this.handler_)};svgedit.history.UndoManager.prototype.redo=function(){this.undoStackPointer0&&this.undoStack[this.undoStackPointer++].apply(this.handler_)}; +svgedit.history.UndoManager.prototype.addCommandToHistory=function(a){if(this.undoStackPointer0)this.undoStack=this.undoStack.splice(0,this.undoStackPointer);this.undoStack.push(a);this.undoStackPointer=this.undoStack.length};svgedit.history.UndoManager.prototype.beginUndoableChange=function(a,n){for(var e=++this.undoChangeStackPointer,c=n.length,l=Array(c),u=Array(c);c--;){var b=n[c];if(b!=null){u[c]=b;l[c]=b.getAttribute(a)}}this.undoableChangeStack[e]= +{attrName:a,oldValues:l,elements:u}};svgedit.history.UndoManager.prototype.finishUndoableChange=function(){for(var a=this.undoChangeStackPointer--,n=this.undoableChangeStack[a],e=n.elements.length,c=n.attrName,l=new svgedit.history.BatchCommand("Change "+c);e--;){var u=n.elements[e];if(u!=null){var b={};b[c]=n.oldValues[e];b[c]!=u.getAttribute(c)&&l.addSubCommand(new svgedit.history.ChangeElementCommand(u,b,c))}}this.undoableChangeStack[a]=null;return l}})();svgedit=svgedit||{}; +(function(){if(!svgedit.select)svgedit.select={};var a,n,e;svgedit.select.Selector=function(c,l){this.id=c;this.selectedElement=l;this.locked=true;this.selectorGroup=a.createSVGElement({element:"g",attr:{id:"selectorGroup"+this.id}});this.selectorRect=this.selectorGroup.appendChild(a.createSVGElement({element:"path",attr:{id:"selectedBox"+this.id,fill:"none",stroke:"#4F80FF","stroke-width":"1","shape-rendering":"crispEdges",style:"pointer-events:none"}}));svgedit.browser.isTouch()&&this.selectorRect.setAttribute("stroke-opacity", +0.3);this.gripCoords={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null};this.reset(this.selectedElement)};svgedit.select.Selector.prototype.reset=function(c){this.locked=true;this.selectedElement=c;this.resize();this.selectorGroup.setAttribute("display","inline")};svgedit.select.Selector.prototype.updateGripCursors=function(c){var l=[];c=Math.round(c/45);if(c<0)c+=8;for(var u in e.selectorGrips)l.push(u);for(;c>0;){l.push(l.shift());c--}c=0;for(u in e.selectorGrips){e.selectorGrips[u].setAttribute("style", +"cursor:"+l[c]+"-resize");c++}};svgedit.select.Selector.prototype.showGrips=function(c){e.selectorGripsGroup.setAttribute("display",c?"inline":"none");var l=this.selectedElement;this.hasGrips=c;if(l&&c){this.selectorGroup.appendChild(e.selectorGripsGroup);this.updateGripCursors(svgedit.utilities.getRotationAngle(l))}};svgedit.select.Selector.prototype.resize=function(){var c=this.selectorRect,l=e,u=l.selectorGrips,b=this.selectedElement,k=b.getAttribute("stroke-width"),d=a.currentZoom(),q=1/d;if(b.getAttribute("stroke")!== +"none"&&!isNaN(k))q+=k/2;var z=b.tagName;if(z==="text")q+=2/d;k=svgedit.transformlist.getTransformList(b);k=svgedit.math.transformListToTransform(k).matrix;k.e*=d;k.f*=d;var D=svgedit.utilities.getBBox(b);if(z==="g"&&!$.data(b,"gsvg"))if(z=a.getStrokedBBox(b.childNodes))D=z;z=D.x;var w=D.y,K=D.width;D=D.height;q*=d;d=svgedit.math.transformBox(z*d,w*d,K*d,D*d,k);k=d.aabox;z=k.x-q;w=k.y-q;var L=k.width+q*2;K=k.height+q*2;k=z+L/2;D=w+K/2;if(b=svgedit.utilities.getRotationAngle(b)){z=a.svgRoot().createSVGTransform(); +z.setRotate(-b,k,D);z=z.matrix;d.tl=svgedit.math.transformPoint(d.tl.x,d.tl.y,z);d.tr=svgedit.math.transformPoint(d.tr.x,d.tr.y,z);d.bl=svgedit.math.transformPoint(d.bl.x,d.bl.y,z);d.br=svgedit.math.transformPoint(d.br.x,d.br.y,z);z=d.tl;L=z.x;K=z.y;var N=z.x,H=z.y;z=Math.min;w=Math.max;L=z(L,z(d.tr.x,z(d.bl.x,d.br.x)))-q;K=z(K,z(d.tr.y,z(d.bl.y,d.br.y)))-q;N=w(N,w(d.tr.x,w(d.bl.x,d.br.x)))+q;H=w(H,w(d.tr.y,w(d.bl.y,d.br.y)))+q;z=L;w=K;L=N-L;K=H-K}c.setAttribute("d","M"+z+","+w+" L"+(z+L)+","+w+" "+ +(z+L)+","+(w+K)+" "+z+","+(w+K)+"z");this.selectorGroup.setAttribute("transform",b?"rotate("+[b,k,D].join(",")+")":"");if(svgedit.browser.isTouch()){z-=15.75;w-=15.75}else{z-=4;w-=4}this.gripCoords={nw:[z,w].map(Math.round),ne:[z+L,w].map(Math.round),sw:[z,w+K].map(Math.round),se:[z+L,w+K].map(Math.round),n:[z+L/2,w].map(Math.round),w:[z,w+K/2].map(Math.round),e:[z+L,w+K/2].map(Math.round),s:[z+L/2,w+K].map(Math.round)};for(var U in this.gripCoords){c=this.gripCoords[U];u[U].setAttribute("x",c[0]); +u[U].setAttribute("y",c[1])}this.rotateCoords={nw:[z,w],ne:[z+L+8,w],sw:[z,w+K+8],se:[z+L+8,w+K+8]};for(U in this.rotateCoords){c=this.rotateCoords[U];l.rotateGrips[U].setAttribute("cx",c[0]);l.rotateGrips[U].setAttribute("cy",c[1])}};svgedit.select.SelectorManager=function(){this.rubberBandBox=this.selectorParentGroup=null;this.selectors=[];this.selectorMap={};this.selectorGrips={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null};this.selectorGripsGroup=null;this.rotateGrips={nw:null,ne:null, +se:null,sw:null};this.initGroup()};svgedit.select.SelectorManager.prototype.initGroup=function(){this.selectorParentGroup&&this.selectorParentGroup.parentNode&&this.selectorParentGroup.parentNode.removeChild(this.selectorParentGroup);this.selectorParentGroup=a.createSVGElement({element:"g",attr:{id:"selectorParentGroup"}});this.selectorGripsGroup=a.createSVGElement({element:"g",attr:{display:"none"}});this.selectorParentGroup.appendChild(this.selectorGripsGroup);a.svgRoot().appendChild(this.selectorParentGroup); +this.selectorMap={};this.selectors=[];this.rubberBandBox=null;for(var c in this.rotateGrips){var l=a.createSVGElement({element:"circle",attr:{id:"selectorGrip_rotate_"+c,fill:"#000",r:8,stroke:"#000","fill-opacity":0,"stroke-opacity":0,"stroke-width":0,style:"cursor:url("+n.imgPath+"rotate.png) 12 12, auto;"}});$.data(l,"dir",c);$.data(l,"type","rotate");this.rotateGrips[c]=this.selectorGripsGroup.appendChild(l)}for(c in this.selectorGrips){l=a.createSVGElement({element:"rect",attr:{id:"selectorGrip_resize_"+ +c,width:8,height:8,fill:"#4F80FF",stroke:"rgba(0,0,0,0)","stroke-width":1,style:"cursor:"+c+"-resize","pointer-events":"all"}});if(svgedit.browser.isTouch()){l.setAttribute("width",30.5);l.setAttribute("height",30.5);l.setAttribute("fill-opacity",0.3)}$.data(l,"dir",c);$.data(l,"type","resize");this.selectorGrips[c]=this.selectorGripsGroup.appendChild(l)}if(!$("#canvasBackground").length){c=n.dimensions;c=a.createSVGElement({element:"svg",attr:{id:"canvasBackground",width:c[0],height:c[1],x:0,y:0, +overflow:svgedit.browser.isWebkit()?"none":"visible",style:"pointer-events:none"}});l=a.createSVGElement({element:"defs",attr:{id:"placeholder_defs"}});var u=a.createSVGElement({element:"pattern",attr:{id:"checkerPattern",patternUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20,viewBox:"0 0 10 10"}}),b=a.createSVGElement({element:"rect",attr:{x:0,y:0,width:10,height:10,fill:"#fff"}}),k=a.createSVGElement({element:"rect",attr:{x:0,y:0,width:5,height:5,fill:"#eee"}}),d=a.createSVGElement({element:"rect", +attr:{x:5,y:5,width:5,height:5,fill:"#eee"}}),q=a.createSVGElement({element:"rect",attr:{width:"100%",height:"100%",x:0,y:0,"stroke-width":1,stroke:"#000",fill:"url(#checkerPattern)",style:"pointer-events:none"}});c.appendChild(l);l.appendChild(u);u.appendChild(b);u.appendChild(k);u.appendChild(d);c.appendChild(q);a.svgRoot().insertBefore(c,a.svgContent())}};svgedit.select.SelectorManager.prototype.requestSelector=function(c){if(c==null)return null;var l=this.selectors.length;if(typeof this.selectorMap[c.id]== +"object"){this.selectorMap[c.id].locked=true;return this.selectorMap[c.id]}for(var u=0;u element";this.svgElem_=c;this.obj_num=0;this.idPrefix=l||"svg_";this.releasedNums=[];this.all_layers=[];this.current_layer=null;this.nonce_= +"";var u=this.svgElem_.getAttributeNS("http://svg-edit.googlecode.com","nonce");if(u&&e!=n.NEVER_RANDOMIZE)this.nonce_=u;else e==n.ALWAYS_RANDOMIZE&&this.setNonce(Math.floor(Math.random()*100001))};svgedit.draw.Drawing.prototype.getElem_=function(c){return this.svgElem_.querySelector?this.svgElem_.querySelector("#"+c):$(this.svgElem_).find("[id="+c+"]")[0]};svgedit.draw.Drawing.prototype.getSvgElem=function(){return this.svgElem_};svgedit.draw.Drawing.prototype.getNonce=function(){return this.nonce_}; +svgedit.draw.Drawing.prototype.setNonce=function(c){this.svgElem_.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:se","http://svg-edit.googlecode.com");this.svgElem_.setAttributeNS("http://svg-edit.googlecode.com","se:nonce",c);this.nonce_=c};svgedit.draw.Drawing.prototype.clearNonce=function(){this.nonce_=""};svgedit.draw.Drawing.prototype.getId=function(){return this.nonce_?this.idPrefix+this.nonce_+"_"+this.obj_num:this.idPrefix+this.obj_num};svgedit.draw.Drawing.prototype.getNextId=function(){var c= +this.obj_num,l=false;if(this.releasedNums.length>0){this.obj_num=this.releasedNums.pop();l=true}else this.obj_num++;for(var u=this.getId();this.getElem_(u);){if(l){this.obj_num=c;l=false}this.obj_num++;u=this.getId()}if(l)this.obj_num=c;return u};svgedit.draw.Drawing.prototype.releaseId=function(c){var l=this.idPrefix+(this.nonce_?this.nonce_+"_":"");if(typeof c!="string"||c.indexOf(l)!=0)return false;c=parseInt(c.substr(l.length));if(typeof c!="number"||c<=0||this.releasedNums.indexOf(c)!=-1)return false; +this.releasedNums.push(c);return true};svgedit.draw.Drawing.prototype.getNumLayers=function(){return this.all_layers.length};svgedit.draw.Drawing.prototype.hasLayer=function(c){for(var l=0;l=0&&c1){var c=this.current_layer.parentNode.removeChild(this.current_layer);this.identifyLayers();return c}return null};svgedit.draw.Drawing.prototype.identifyLayers=function(){this.all_layers=[];for(var c=this.svgElem_.childNodes.length,l=[],u=[],b=null,k=false,d=0;d0||!k){for(d=1;u.indexOf("Layer "+d)>=0;)d++;u="Layer "+d;b=c.createElementNS("http://www.w3.org/2000/svg","g");k=c.createElementNS("http://www.w3.org/2000/svg","title");k.textContent=u; +b.appendChild(k);for(k=0;k1))for(var u= +0;u0){b=K element";this.elem=b;this.segs=[];this.selected_pts=[];svgedit.path.path=this;this.init()};svgedit.path.Path.prototype.init=function(){$(svgedit.path.getGripContainer()).find("*").attr("display", +"none");var b=this.elem.pathSegList,k=b.numberOfItems;this.segs=[];this.selected_pts=[];this.first_seg=null;for(var d=0;d=k?null:b[d+1],w=d-1<0?null:b[d-1];if(z.type===2){if(w&&w.type!==1){D=b[q];D.next=b[q+1];D.next.prev=D;D.addGrip()}q=d}else if(D&&D.type===1){z.next=b[q+1];z.next.prev=z;z.mate=b[q];z.addGrip();if(this.first_seg==null)this.first_seg=z}else if(D){if(z.type!== +1){z.addGrip();if(D&&D.type!==2){z.next=D;z.next.prev=z}}}else if(z.type!==1){D=b[q];D.next=b[q+1];D.next.prev=D;D.addGrip();z.addGrip();if(!this.first_seg)this.first_seg=b[q]}}return this};svgedit.path.Path.prototype.eachSeg=function(b){for(var k=this.segs.length,d=0;d=0)o=p=b.convertToPath(s,true);else if(s.tagName=="rect"){var B=s.getAttribute("rx"),F=s.getAttribute("ry");if(B||F)o=p=b.convertToPath(s,true)}if(!p){var I=s.cloneNode(true),J=document.createElementNS(c,"g"),O=s.parentNode;O.appendChild(J);J.appendChild(I);o=svgedit.utilities.bboxToObj(J.getBBox());O.removeChild(J)}}return o}catch(W){console.log(s,W)}},m;$.each(g,function(){if(!m)if(this.parentNode)m=h(this)});if(m==null)return null; +var C=m.x+m.width,A=m.y+m.height,G=m.x,E=m.y,v=function(s){var o=s.getAttribute("stroke-width"),p=0;if(s.getAttribute("stroke")!="none"&&!isNaN(o))p+=o/2;return p},f=[];$.each(g,function(s,o){var p=h(o);if(p){var B=v(o);G=Math.min(G,p.x-B);E=Math.min(E,p.y-B);f.push(p)}});m.x=G;m.y=E;$.each(g,function(s,o){var p=f[s];if(p&&o.nodeType==1){var B=v(o);C=Math.max(C,p.x+p.width+B);A=Math.max(A,p.y+p.height+B)}});m.width=C-G;m.height=A-E;return m};var Za=this.getVisibleElements=function(g){g||(g=$(q).children()); +g.find("#canvas_background").length&&g.splice(0,1);var h=[];$(g).children().each(function(m,C){try{C.getBBox()&&h.push(C)}catch(A){}});return h.reverse()},vb=this.getVisibleElementsAndBBoxes=function(g){g||(g=$(q).children());var h=[];$(g).children().each(function(m,C){try{C.getBBox()&&h.push({elem:C,bbox:getStrokedBBox([C])})}catch(A){}});return h.reverse()},qb=this.groupSvgElem=function(g){var h=document.createElementNS(c,"g");g.parentNode.replaceChild(h,g);$(h).append(g).data("gsvg",g)[0].id=V()}, +lb=function(g){var h=document.createElementNS(g.namespaceURI,g.nodeName);h.removeAttribute("id");$.each(g.attributes,function(C,A){A.localName!="-moz-math-font-style"&&h.setAttributeNS(A.namespaceURI,A.nodeName,A.nodeValue)});if(svgedit.browser.isWebkit()&&g.nodeName=="path"){var m=Ca.convertPath(g);h.setAttribute("d",m)}$.each(g.childNodes,function(C,A){switch(A.nodeType){case 1:h.appendChild(lb(A));break;case 3:h.textContent=A.nodeValue}});if($(g).data("gsvg"))$(h).data("gsvg",h.firstChild);else if($(g).data("symbol")){g= +$(g).data("symbol");$(h).data("ref",g).data("symbol",g)}else h.tagName=="image"&&Bb(h);h.id=V();return h},ha,V,da;(function(g){var h={};ha=g.getId=function(){return D().getId()};V=g.getNextId=function(){return D().getNextId()};da=g.call=function(m,C){if(h[m])return h[m](this,C)};g.bind=function(m,C){var A=h[m];h[m]=C;return A}})(b);this.prepareSvg=function(g){this.sanitizeSvg(g.documentElement);g=g.getElementsByTagNameNS(c,"path");for(var h=0,m=g.length;h0&&A.getItem(0).type== +4&&A.removeItem(0);if(g!=0){G=M(G,E,ga(A).matrix);E=d.createSVGTransform();E.setRotate(g,G.x,G.y);A.numberOfItems?A.insertItemBefore(E,0):A.appendItem(E)}else A.numberOfItems==0&&m.removeAttribute("transform");if(!h){A=m.getAttribute("transform");m.setAttribute("transform",C);$a("transform",A,H);da("changed",H)}oa("pathpointgrip_container");m=za.requestSelector(H[0]);m.resize();m.updateGripCursors(g)}};var ba=this.recalculateAllSelectedDimensions=function(){for(var g=new qa(bb=="none"?"position": +"size"),h=H.length;h--;){var m=Wa(H[h]);m&&g.addSubCommand(m)}if(!g.isEmpty()){wa(g);da("changed",H)}},Ba=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],Pa=function(g){console.log([g.a,g.b,g.c,g.d,g.e,g.f])},Ra=this.remapElement=function(g,h,m){var C=l.gridSnapping&&g.parentNode.parentNode.localName==="svg",A=function(){if(C)for(var p in h)h[p]=va(h[p]);na(g,h,1E3,true)};box=svgedit.utilities.getBBox(g);for(var G=0;G<2;G++){var E=G===0?"fill":"stroke",v=g.getAttribute(E); +if(v&&v.indexOf("url(")===0)if(m.a<0||m.d<0){v=R(v).cloneNode(true);if(m.a<0){var f=v.getAttribute("x1"),s=v.getAttribute("x2");v.setAttribute("x1",-(f-1));v.setAttribute("x2",-(s-1))}if(m.d<0){f=v.getAttribute("y1");s=v.getAttribute("y2");v.setAttribute("y1",-(f-1));v.setAttribute("y2",-(s-1))}v.id=V();hb().appendChild(v);g.setAttribute(E,"url(#"+v.id+")")}}G=g.tagName;if(G==="g"||G==="text"||G==="use")if(m.a==1&&m.b==0&&m.c==0&&m.d==1&&(m.e!=0||m.f!=0)){E=ga(g).matrix;E=T(E.inverse(),m,E);h.x=parseFloat(h.x)+ +E.e;h.y=parseFloat(h.y)+E.f}else{E=S(g);v=d.createSVGTransform();v.setMatrix(T(ga(E).matrix,m));E.clear();E.appendItem(v)}switch(G){case "foreignObject":case "rect":case "image":if(G==="image"&&(m.a<0||m.d<0)){E=S(g);v=d.createSVGTransform();v.setMatrix(T(ga(E).matrix,m));E.clear();E.appendItem(v)}else{E=M(h.x,h.y,m);h.width=m.a*h.width;h.height=m.d*h.height;h.x=E.x+Math.min(0,h.width);h.y=E.y+Math.min(0,h.height);h.width=Math.abs(h.width);h.height=Math.abs(h.height)}A();break;case "ellipse":G=M(h.cx, +h.cy,m);h.cx=G.x;h.cy=G.y;h.rx=m.a*h.rx;h.ry=m.d*h.ry;h.rx=Math.abs(h.rx);h.ry=Math.abs(h.ry);A();break;case "circle":G=M(h.cx,h.cy,m);h.cx=G.x;h.cy=G.y;G=svgedit.math.transformBox(box.x,box.y,box.width,box.height,m);h.r=Math.min((G.tr.x-G.tl.x)/2,(G.bl.y-G.tl.y)/2);if(h.r)h.r=Math.abs(h.r);A();break;case "line":E=M(h.x1,h.y1,m);f=M(h.x2,h.y2,m);h.x1=E.x;h.y1=E.y;h.x2=f.x;h.y2=f.y;case "text":m=g.querySelectorAll("tspan");for(G=m.length;G--;){E=ua("x",g.getAttribute("x"));v=ua("x",m[G].getAttribute("x")); +f=ua("y",g.getAttribute("y"));s=ua("y",m[G].getAttribute("y"));var o={};if(!isNaN(E)&&!isNaN(v)&&E!=0&&v!=0&&h.x)o.x=h.x-(E-v);if(!isNaN(f)&&!isNaN(s)&&f!=0&&s!=0&&h.y)o.y=h.y-(f-s);if(o.x||o.y)na(m[G],o,1E3,true)}A();break;case "use":A();break;case "g":(A=$(g).data("gsvg"))&&na(A,h,1E3,true);break;case "polyline":case "polygon":A=h.points.length;for(G=0;G0){for(var m=h.numberOfItems;m--;){var C=h.getItem(m);if(C.type===0)h.removeItem(m);else if(C.type===1)svgedit.math.isIdentity(C.matrix)&&h.removeItem(m);else C.type=== +4&&C.angle===0&&h.removeItem(m)}if(h.numberOfItems===1&&pa(g))return null}if(!h||h.numberOfItems==0){g.removeAttribute("transform");return null}if(h){m=h.numberOfItems;for(var A=[];m--;){C=h.getItem(m);if(C.type===1)A.push([C.matrix,m]);else if(A.length)A=[]}if(A.length===2){m=d.createSVGTransformFromMatrix(T(A[1][0],A[0][0]));h.removeItem(A[0][1]);h.removeItem(A[1][1]);h.insertItemBefore(m,A[1][1])}m=h.numberOfItems;if(m>=2&&h.getItem(m-2).type===1&&h.getItem(m-1).type===2){A=d.createSVGTransform(); +C=T(h.getItem(m-2).matrix,h.getItem(m-1).matrix);A.setMatrix(C);h.removeItem(m-2);h.removeItem(m-2);h.appendItem(A)}}switch(g.tagName){case "line":case "polyline":case "polygon":case "path":break;default:if(h.numberOfItems===1&&h.getItem(0).type===1||h.numberOfItems===2&&h.getItem(0).type===1&&h.getItem(0).type===4)return null}var G=$(g).data("gsvg");m=new qa("Transform");var E={},v=null;C=[];switch(g.tagName){case "line":C=["x1","y1","x2","y2"];break;case "circle":C=["cx","cy","r"];break;case "ellipse":C= +["cx","cy","rx","ry"];break;case "foreignObject":case "rect":case "image":C=["width","height","x","y"];break;case "use":case "text":case "tspan":C=["x","y"];break;case "polygon":case "polyline":v={};v.points=g.getAttribute("points");A=g.points;var f=A.numberOfItems;E.points=Array(f);for(var s=0;s1.0E-10?Math.sin(s)/(1-Math.cos(s)):2/s;for(s=0;s=3&&h.getItem(F-2).type==3&&h.getItem(F-3).type==2&&h.getItem(F-1).type==2){s=3;var J=h.getItem(F-3).matrix,O=h.getItem(F-2).matrix,W=h.getItem(F-1).matrix;f=g.childNodes;for(o=f.length;o--;){var aa=f.item(o);C=G=0;if(aa.nodeType==1){var X=S(aa);if(X){C=ga(X).matrix;G=pa(aa);var ea=Qa,Q=[];Qa=aa.getAttribute("transform");if(G||ia(X)){var ka=d.createSVGTransform();ka.setMatrix(T(J,O,W,C));X.clear();X.appendItem(ka); +Q.push(ka)}else{G=T(C.inverse(),W,C);ka=d.createSVGMatrix();ka.e=-G.e;ka.f=-G.f;C=T(ka.inverse(),C.inverse(),J,O,W,C,G.inverse());var ra=d.createSVGTransform(),ta=d.createSVGTransform(),Aa=d.createSVGTransform();ra.setTranslate(G.e,G.f);ta.setScale(C.a,C.d);Aa.setTranslate(ka.e,ka.f);X.appendItem(Aa);X.appendItem(ta);X.appendItem(ra);Q.push(Aa);Q.push(ta);Q.push(ra)}m.addSubCommand(Wa(aa));Qa=ea}}}h.removeItem(F-1);h.removeItem(F-2);h.removeItem(F-3)}else if(F>=3&&h.getItem(F-1).type==1){s=3;C=ga(h).matrix; +ka=d.createSVGTransform();ka.setMatrix(C);h.clear();h.appendItem(ka)}else if((F==1||F>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){s=2;G=ga(h).matrix;h.removeItem(0);C=ga(h).matrix.inverse();C=T(C,G);G=C.e;C=C.f;if(G!=0||C!=0){f=g.childNodes;o=f.length;for(F=[];o--;){aa=f.item(o);if(aa.nodeType==1){if(aa.getAttribute("clip-path")){ea=aa.getAttribute("clip-path");if(F.indexOf(ea)===-1){eb(ea,G,C);F.push(ea)}}ea=Qa;Qa=aa.getAttribute("transform");if(X=S(aa)){J=d.createSVGTransform();J.setTranslate(G, +C);X.numberOfItems?X.insertItemBefore(J,0):X.appendItem(J);m.addSubCommand(Wa(aa));X=g.getElementsByTagNameNS(c,"use");aa="#"+aa.id;for(J=X.length;J--;){O=X.item(J);if(aa==la(O)){W=d.createSVGTransform();W.setTranslate(-G,-C);S(O).insertItemBefore(W,0);m.addSubCommand(Wa(O))}}Qa=ea}}}F=[];Qa=ea}}else if(F==1&&h.getItem(0).type==1&&!A){s=1;C=h.getItem(0).matrix;f=g.childNodes;for(o=f.length;o--;){aa=f.item(o);if(aa.nodeType==1){ea=Qa;Qa=aa.getAttribute("transform");if(X=S(aa)){G=T(C,ga(X).matrix); +F=d.createSVGTransform();F.setMatrix(G);X.clear();X.appendItem(F,0);m.addSubCommand(Wa(aa));Qa=ea;ea=aa.getAttribute("stroke-width");aa.getAttribute("stroke")!=="none"&&!isNaN(ea)&&aa.setAttribute("stroke-width",ea*((Math.abs(G.a)+Math.abs(G.d))/2))}}}h.clear()}else{if(A){p=d.createSVGTransform();p.setRotate(A,B.x,B.y);h.numberOfItems?h.insertItemBefore(p,0):h.appendItem(p)}h.numberOfItems==0&&g.removeAttribute("transform");return null}if(s==2){if(A){B={x:p.x+I.e,y:p.y+I.f};p=d.createSVGTransform(); +p.setRotate(A,B.x,B.y);h.numberOfItems?h.insertItemBefore(p,0):h.appendItem(p)}}else if(s==3){C=ga(h).matrix;I=d.createSVGTransform();I.setRotate(A,p.x,p.y);I=I.matrix;p=d.createSVGTransform();p.setRotate(A,B.x,B.y);B=p.matrix.inverse();ea=C.inverse();B=T(ea,B,I,C);G=B.e;C=B.f;if(G!=0||C!=0){f=g.childNodes;for(o=f.length;o--;){aa=f.item(o);if(aa.nodeType==1){ea=Qa;Qa=aa.getAttribute("transform");X=S(aa);J=d.createSVGTransform();J.setTranslate(G,C);X.numberOfItems?X.insertItemBefore(J,0):X.appendItem(J); +m.addSubCommand(Wa(aa));Qa=ea}}}if(A)h.numberOfItems?h.insertItemBefore(p,0):h.appendItem(p)}}else{A=svgedit.utilities.getBBox(g);if(!A&&g.tagName!="path")return null;C=d.createSVGMatrix();if(G=pa(g)){p={x:A.x+A.width/2,y:A.y+A.height/2};B=M(A.x+A.width/2,A.y+A.height/2,ga(h).matrix);s=G*Math.PI/180;f=Math.abs(s)>1.0E-10?Math.sin(s)/(1-Math.cos(s)):2/s;for(s=0;s=3&&h.getItem(F-2).type==3&&h.getItem(F-3).type==2&&h.getItem(F-1).type==2){s=3;C=ga(h,F-3,F-1).matrix;h.removeItem(F-1);h.removeItem(F-2);h.removeItem(F-3)}else if(F==4&&h.getItem(F- +1).type==1){s=3;C=ga(h).matrix;ka=d.createSVGTransform();ka.setMatrix(C);h.clear();h.appendItem(ka);C=d.createSVGMatrix()}else if((F==1||F>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){s=2;I=h.getItem(0).matrix;ea=ga(h,1).matrix;A=ea.inverse();C=T(A,I,ea);h.removeItem(0)}else if(F==1&&h.getItem(0).type==1&&!G){C=ga(h).matrix;switch(g.tagName){case "line":E=$(g).attr(["x1","y1","x2","y2"]);case "polyline":case "polygon":E.points=g.getAttribute("points");if(E.points){A=g.points;f=A.numberOfItems; +E.points=Array(f);for(s=0;s1&&A.showGrips(false)}}}da("selected",H);h||H.length==1?za.requestSelector(H[0]).showGrips(true):za.requestSelector(H[0]).showGrips(false);for(H.sort(function(G,E){if(G&&E&&G.compareDocumentPosition)return 3- +(E.compareDocumentPosition(G)&6);else if(G==null)return 1});H[0]==null;)H.shift(0)}},mb=this.selectOnly=function(g,h){Na(true);ib(g,h)};this.removeFromSelection=function(g){if(H[0]!=null)if(g.length!=0){var h=Array(H.length);j=0;len=H.length;for(var m=0;m=0&&g.id!="svgcanvas")for(;g.nodeName!="foreignObject";){g=g.parentNode;if(!g)return d}var h=D().getCurrentLayer();if([d,a,q,h].indexOf(g)>=0)return d;if($(g).closest("#selectorParentGroup").length)return za.selectorParentGroup;for(;g.parentNode&&g.parentNode!==(K||h);)g=g.parentNode;return g};(function(){var g= +null,h=null,m=null,C=null,A=null,G={},E={minx:null,miny:null,maxx:null,maxy:null};$(a).mousedown(function(v){if(!b.spaceKey){var f=v.button===2;Da=q.querySelector("g").getScreenCTM().inverse();var s=M(v.pageX,v.pageY,Da),o=s.x*w;s=s.y*w;v.preventDefault();if(f)xa="select";o=o/w;s=s/w;var p=Cb(v);if(p.tagName==="a"&&p.childNodes.length===1)p=p.firstChild;var B=C=h=o,F=A=m=s;if(l.gridSnapping){o=va(o);s=va(s);h=va(h);m=va(m)}if(p==za.selectorParentGroup&&H[0]!=null){p=v.target;var I=nb(p,"type");if(I== +"rotate"){xa="rotate";current_rotate_mode=nb(p,"dir")}else if(I=="resize"){xa="resize";bb=nb(p,"dir")}p=H[0]}Qa=p.getAttribute("transform");I=S(p);switch(xa){case "select":Fa=true;bb="none";if(f)Fa=false;if(p!=d){if(H.indexOf(p)==-1){v.shiftKey||Na(true);ib([p]);rb=p;Ca.clear()}if(!f)for(f=0;f1))if(Fa)if(!(v.button===1||b.spaceKey)){var f=H[0],s=M(v.pageX,v.pageY, +Da),o=s.x*w;s=s.y*w;var p=oa(ha()),B=x=o/w,F=y=s/w;if(l.gridSnapping){x=va(x);y=va(y)}v.preventDefault();switch(xa){case "select":if(H[0]!==null){B=x-h;var I=y-m;if(l.gridSnapping){B=va(B);I=va(I)}if(v.shiftKey){var J=Z(h,m,x,y);x=J.x;y=J.y}if(B!=0||I!=0){F=H.length;for(var O=0;O0&&b.removeFromSelection(p);B.length>0&&ib(B);break;case "resize":p=S(f);B=(J=ia(p))?G:svgedit.utilities.getBBox(f);F=B.x;O=B.y;var aa=B.width,X=B.height;B=x-h;I=y-m;if(l.gridSnapping){B=va(B);I=va(I);X=va(X);aa=va(aa)}if(W=pa(f)){var ea=Math.sqrt(B*B+I*I);I=Math.atan2(I,B)-W*Math.PI/180;B=ea*Math.cos(I);I=ea*Math.sin(I)}if(bb.indexOf("n")==-1&&bb.indexOf("s")==-1)I=0;if(bb.indexOf("e")==-1&&bb.indexOf("w")==-1)B=0;var Q=ea=0,ka=X?(X+I)/X:1,ra=aa?(aa+B)/aa:1;if(bb.indexOf("n")>=0){ka=X?(X- +I)/X:1;Q=X}if(bb.indexOf("w")>=0){ra=aa?(aa-B)/aa:1;ea=aa}B=d.createSVGTransform();I=d.createSVGTransform();aa=d.createSVGTransform();if(l.gridSnapping){F=va(F);ea=va(ea);O=va(O);Q=va(Q)}B.setTranslate(-(F+ea),-(O+Q));if(v.shiftKey)if(ra==1)ra=ka;else ka=ra;I.setScale(ra,ka);aa.setTranslate(F+ea,O+Q);if(J){J=W?1:0;p.replaceItem(B,2+J);p.replaceItem(I,1+J);p.replaceItem(aa,0+J)}else{J=p.numberOfItems;p.replaceItem(aa,J-3);p.replaceItem(I,J-2);p.replaceItem(B,J-1)}za.requestSelector(f).resize();da("transition", +H);break;case "zoom":B*=w;F*=w;na(Ja,{x:Math.min(C*w,B),y:Math.min(A*w,F),width:Math.abs(B-C*w),height:Math.abs(F-A*w)},100);break;case "text":na(p,{x:x,y:y},1E3);break;case "line":if(l.gridSnapping){x=va(x);y=va(y)}B=x;J=y;if(v.shiftKey){J=Z(h,m,B,J);B=J.x;J=J.y}p.setAttributeNS(null,"x2",B);p.setAttributeNS(null,"y2",J);break;case "foreignObject":case "square":case "rect":case "image":B=Math.abs(x-h);J=Math.abs(y-m);if(xa=="square"||v.shiftKey){B=J=Math.max(B,J);F=hm?m+B:m- +B}if(v.altKey){J=h;F=m;B=Math.abs(x-J);O=v.shiftKey?B:Math.abs(y-F)}p.setAttributeNS(null,"rx",B);p.setAttributeNS(null,"ry",O);p.setAttributeNS(null,"cx",J);p.setAttributeNS(null,"cy",F);break;case "fhellipse":case "fhrect":E.minx=Math.min(B,E.minx);E.maxx=Math.max(B,E.maxx);E.miny=Math.min(F,E.miny);E.maxy=Math.max(F,E.maxy);case "fhpath":g+=+B+","+F+" ";p.setAttributeNS(null,"points",g);break;case "path":case "pathedit":x*=w;y*=w;if(l.gridSnapping){x=va(x);y=va(y);h=va(h);m=va(m)}if(v.shiftKey){if(J= +svgedit.path.path){p=J.dragging?J.dragging[0]:h;J=J.dragging?J.dragging[1]:m}else{p=h;J=m}J=Z(p,J,x,y);x=J.x;y=J.y}if(Ja&&Ja.getAttribute("display")!=="none"){B*=w;F*=w;na(Ja,{x:Math.min(C*w,B),y:Math.min(A*w,F),width:Math.abs(B-C*w),height:Math.abs(F-A*w)},100)}Ca.mouseMove(v,x,y);break;case "textedit":x*=w;y*=w;ab.mouseMove(o,s);break;case "rotate":B=svgedit.utilities.getBBox(f);J=B.x+B.width/2;F=B.y+B.height/2;p=fa(f);p=M(J,F,p);J=p.x;F=p.y;p=B.x;O=B.y;if(current_rotate_mode=="nw")p=B.x+B.width; +if(current_rotate_mode=="se")O=B.y+B.height;if(current_rotate_mode=="sw"){p=B.x+B.width;O=B.y+B.height}compensation_angle=(Math.atan2(F-O,J-p)*(180/Math.PI)-90)%360;W=(Math.atan2(F-y,J-x)*(180/Math.PI)-90)%360;W+=compensation_angle;if(l.gridSnapping)W=va(W);if(v.shiftKey)W=Math.round(W/45)*45;b.setRotationAngle(W<-180?360+W:W,true);da("transition",H)}ob("mouseMove",{event:v,mouse_x:o,mouse_y:s,selected:f})}}).click(function(v){v.preventDefault();return false}).dblclick(function(v){var f=v.target.parentNode, +s=Cb(v),o=s.tagName;if(f!==K){if(o==="text"&&xa!=="textedit"){v=M(v.pageX,v.pageY,Da);ab.select(s,v.x,v.y)}if((o==="g"||o==="a")&&pa(s)){xb(s);s=H[0];Na(true)}K&&Ab();f.tagName!=="g"&&f.tagName!=="a"||f===D().getCurrentLayer()||s===za.selectorParentGroup||Jb(s)}}).mouseup(function(v){b.addClones=false;window.removeEventListener("keyup",b.removeClones);H=H.filter(Boolean);if(v.button!==2){var f=rb;rb=null;if(Fa){var s=M(v.pageX,v.pageY,Da),o=s.x*w;s=s.y*w;var p=o/w,B=s/w,F=oa(ha()),I=false;Fa=false; +switch(xa){case "resize":case "multiselect":if(Ja!=null){Ja.setAttribute("display","none");Ka=[]}xa="select";case "select":if(H[0]!=null){if(H.length==1){o=H[0];switch(o.tagName){case "g":case "use":case "image":case "foreignObject":break;default:Ta.fill=o.getAttribute("fill");Ta.fill_opacity=o.getAttribute("fill-opacity");Ta.stroke=o.getAttribute("stroke");Ta.stroke_opacity=o.getAttribute("stroke-opacity");Ta.stroke_width=o.getAttribute("stroke-width");Ta.stroke_dasharray=o.getAttribute("stroke-dasharray"); +Ta.stroke_linejoin=o.getAttribute("stroke-linejoin");Ta.stroke_linecap=o.getAttribute("stroke-linecap")}if(o.tagName=="text"){Ya.font_size=o.getAttribute("font-size");Ya.font_family=o.getAttribute("font-family")}za.requestSelector(o).showGrips(true)}ba();C=C;A=A;o=Math.abs(B-A);if(o>1||o>1){v=H.length;for(o=0;o=0?f.indexOf(",",B+1)>=0:f.indexOf(" ",f.indexOf(" ")+1)>=0)F=Ca.smoothPolylineIntoPath(F);break;case "line":f=$(F).attr(["x1","x2","y1","y2"]);I=f.x1!= +f.x2||f.y1!=f.y2;break;case "foreignObject":case "square":case "rect":case "image":f=$(F).attr(["width","height"]);I=f.width!=0||f.height!=0||xa==="image";break;case "circle":I=F.getAttribute("r")!=0;break;case "ellipse":f=$(F).attr(["rx","ry"]);I=f.rx!=null||f.ry!=null;break;case "fhellipse":if(E.maxx-E.minx>0&&E.maxy-E.miny>0){F=U({element:"ellipse",curStyles:true,attr:{cx:(E.minx+E.maxx)/2,cy:(E.miny+E.maxy)/2,rx:(E.maxx-E.minx)/2,ry:(E.maxy-E.miny)/2,id:ha()}});da("changed",[F]);I=true}break; +case "fhrect":if(E.maxx-E.minx>0&&E.maxy-E.miny>0){F=U({element:"rect",curStyles:true,attr:{x:E.minx,y:E.miny,width:E.maxx-E.minx,height:E.maxy-E.miny,id:ha()}});da("changed",[F]);I=true}break;case "text":I=true;mb([F]);ab.start(F);break;case "path":F=null;Fa=true;f=Ca.mouseUp(v,F,o,s);F=f.element;I=f.keep;break;case "pathedit":I=true;F=null;Ca.mouseUp(v);break;case "textedit":I=false;F=null;ab.mouseUp(v,o,s);break;case "rotate":I=true;F=null;xa="select";f=b.undoMgr.finishUndoableChange();f.isEmpty()|| +wa(f);ba();da("changed",H)}o=ob("mouseUp",{event:v,mouse_x:o,mouse_y:s},true);$.each(o,function(W,aa){if(aa){I=aa.keep||I;F=aa.element;Fa=aa.started||Fa}});if(!I&&F!=null){D().releaseId(ha());F.parentNode.removeChild(F);F=null;for(o=v.target;o.parentNode.parentNode.tagName=="g";)o=o.parentNode;if((xa!="path"||!drawn_path)&&o.parentNode.id!="selectorParentGroup"&&o.id!="svgcanvas"&&o.id!="svgroot"){b.setMode("select");mb([o],true)}}else if(F!=null){b.addedNew=true;v=0.2;var J;if(false.beginElement&& +F.getAttribute("opacity")!=N.opacity){J=$(false).clone().attr({to:N.opacity,dur:v}).appendTo(F);try{J[0].beginElement()}catch(O){}}else v=0;setTimeout(function(){J&&J.remove();F.setAttribute("opacity",N.opacity);F.setAttribute("style","pointer-events:inherit");ma(F);if(xa==="path")Ca.toEditMode(F);else l.selectNew&&mb([F],true);wa(new Va(F));da("changed",[F])},v*1E3)}Qa=null}}});$(a).bind("mousewheel DOMMouseScroll",function(v){if(v.shiftKey){v.preventDefault();Da=q.getScreenCTM().inverse();var f= +M(v.pageX,v.pageY,Da);f={x:f.x,y:f.y,width:0,height:0};if(v.wheelDelta)if(v.wheelDelta>=120)f.factor=2;else{if(v.wheelDelta<=-120)f.factor=0.5}else if(v.detail)if(v.detail>0)f.factor=0.5;else if(v.detail<0)f.factor=2;f.factor&&da("zoomed",f)}})})();var Bb=function(g){$(g).click(function(h){h.preventDefault()})},ab=b.textActions=function(){function g(X){var ea=s.value==="";$(s).focus();if(!arguments.length)if(ea)X=0;else{if(s.selectionEnd!==s.selectionStart)return;X=s.selectionEnd}var Q;Q=F[X];ea|| +s.setSelectionRange(X,X);o=oa("text_cursor");if(!o){o=document.createElementNS(c,"line");na(o,{id:"text_cursor",stroke:"#333","stroke-width":1});o=oa("selectorParentGroup").appendChild(o)}B||(B=setInterval(function(){var ka=o.getAttribute("display")==="none";o.setAttribute("display",ka?"inline":"none")},600));ea=G(Q.x,I.y);Q=G(Q.x,I.y+I.height);na(o,{x1:ea.x,y1:ea.y,x2:Q.x,y2:Q.y,visibility:"visible",display:"inline"});p&&p.setAttribute("d","M 0 0")}function h(X,ea,Q){if(X===ea)g(ea);else{Q||s.setSelectionRange(X, +ea);p=oa("text_selectblock");if(!p){p=document.createElementNS(c,"path");na(p,{id:"text_selectblock",fill:"green",opacity:0.5,style:"pointer-events:none"});oa("selectorParentGroup").appendChild(p)}X=F[X];var ka=F[ea];o.setAttribute("visibility","hidden");ea=G(X.x,I.y);Q=G(X.x+(ka.x-X.x),I.y);var ra=G(X.x,I.y+I.height);X=G(X.x+(ka.x-X.x),I.y+I.height);na(p,{d:"M"+ea.x+","+ea.y+" L"+Q.x+","+Q.y+" "+X.x+","+X.y+" "+ra.x+","+ra.y+"z",display:"inline"})}}function m(X,ea){var Q=d.createSVGPoint();Q.x=X; +Q.y=ea;if(F.length==1)return 0;Q=f.getCharNumAtPosition(Q);if(Q<0){Q=F.length-2;if(X<=F[0].x)Q=0}else if(Q>=F.length-2)Q=F.length-2;var ka=F[Q];X>ka.x+ka.width/2&&Q++;return Q}function C(X,ea,Q){var ka=s.selectionStart;X=m(X,ea);h(Math.min(ka,X),Math.max(ka,X),!Q)}function A(X,ea){var Q={x:X,y:ea};Q.x/=w;Q.y/=w;if(J){var ka=M(Q.x,Q.y,J.inverse());Q.x=ka.x;Q.y=ka.y}return Q}function G(X,ea){var Q={x:X,y:ea};if(J){var ka=M(Q.x,Q.y,J);Q.x=ka.x;Q.y=ka.y}Q.x*=w;Q.y*=w;return Q}function E(X){h(0,f.textContent.length); +$(this).unbind(X)}function v(X){if(aa&&f){var ea=M(X.pageX,X.pageY,Da);ea=A(ea.x*w,ea.y*w);ea=m(ea.x,ea.y);var Q=f.textContent,ka=Q.substr(0,ea).replace(/[a-z0-9]+$/i,"").length;Q=Q.substr(ea).match(/^[a-z0-9]+/i);h(ka,(Q?Q[0].length:0)+ea);$(X.target).click(E);setTimeout(function(){$(X.target).unbind("click",E)},300)}}var f,s,o,p,B,F=[],I,J,O,W,aa;return{select:function(X,ea,Q){f=X;ab.toEditMode(ea,Q)},start:function(X){f=X;ab.toEditMode()},mouseDown:function(X,ea,Q,ka){X=A(Q,ka);s.focus();g(m(X.x, +X.y));O=Q;W=ka},mouseMove:function(X,ea){var Q=A(X,ea);C(Q.x,Q.y)},mouseUp:function(X,ea,Q){var ka=A(ea,Q);C(ka.x,ka.y,true);X.target!==f&&eaO-2&&QW-2&&ab.toSelectMode(true)},setCursor:g,toEditMode:function(X,ea){mb([f],false);aa=false;xa="textedit";za.requestSelector(f).showGrips(false);za.requestSelector(f);ab.init();$(f).css("cursor","text");if(arguments.length){var Q=A(X,ea);g(m(Q.x,Q.y))}else g();setTimeout(function(){aa=true},300)},toSelectMode:function(X){xa="select";clearInterval(B); +B=null;p&&$(p).attr("display","none");o&&$(o).attr("visibility","hidden");$(f).css("cursor","move");if(X){Na();$(f).css("cursor","move");da("selected",[f]);ib([f],true)}f&&!f.textContent.length&&b.deleteSelectedElements();$(s).blur();f=false},setInputElem:function(X){s=X},clear:function(){xa=="textedit"&&ab.toSelectMode()},init:function(){if(f){if(!f.parentNode){f=H[0];za.requestSelector(f).showGrips(false)}var X=f.textContent.length,ea=f.getAttribute("transform");I=svgedit.utilities.getBBox(f);J= +ea?fa(f):null;F=Array(X);s.focus();$(f).unbind("dblclick",v).dblclick(v);if(!X)var Q={x:I.x+I.width/2,width:0};for(ea=0;ea=0&&this.selected_pts.push(f)}this.selected_pts.sort();v=this.selected_pts.length;for(E=Array(v);v--;){s=this.segs[this.selected_pts[v]];s.select(true);E[v]= +s.ptgrip}Ca.canDeleteNodes=true;Ca.closed_subpath=this.subpathIsClosed(this.selected_pts[0]);da("selected",E)};var A=h=null,G=false;this.lastCtrlPoint=[0,0];return{mouseDown:function(E,v,f,s){if(xa==="path"){mouse_x=f;mouse_y=s;f=mouse_x/w;v=mouse_y/w;s=oa("path_stretch_line");m=[f,v];if(l.gridSnapping){f=va(f);v=va(v);mouse_x=va(mouse_x);mouse_y=va(mouse_y)}if(!s){s=document.createElementNS(c,"path");na(s,{id:"path_stretch_line",stroke:"#22C","stroke-width":"0.5",fill:"none"});s=oa("selectorParentGroup").appendChild(s)}s.setAttribute("display", +"inline");this.stretchy=s;var o=null;if(A){o=A.pathSegList;for(var p=o.numberOfItems,B=6/w,F=false;p;){p--;var I=o.getItem(p),J=I.x;I=I.y;if(f>=J-B&&f<=J+B&&v>=I-B&&v<=I+B){F=true;break}}B=ha();svgedit.path.removePath_(B);B=oa(B);J=o.numberOfItems;if(F){if(p<=1&&J>=2){f=o.getItem(0).x;v=o.getItem(0).y;p=svgedit.path.first_grip?svgedit.path.first_grip[0]/w:o.getItem(0).x;F=svgedit.path.first_grip?svgedit.path.first_grip[1]/w:o.getItem(0).y;E=s.pathSegList.getItem(1);E=E.pathSegType===4?A.createSVGPathSegLinetoAbs(f, +v):A.createSVGPathSegCurvetoCubicAbs(f,v,E.x1/w,E.y1/w,p,F);f=A.createSVGPathSegClosePath();o.appendItem(E);o.appendItem(f)}else if(J<3)return o=false;$(s).remove();element=B;A=null;Fa=false;if(g){svgedit.path.path.matrix&&Ra(B,{},svgedit.path.path.matrix.inverse());f=B.getAttribute("d");s=$(svgedit.path.path.elem).attr("d");$(svgedit.path.path.elem).attr("d",s+f);$(B).remove();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();svgedit.path.path.init();Ca.toEditMode(svgedit.path.path.elem); +svgedit.path.path.selectPt();return false}}else{if(!$.contains(a,Cb(E))){console.log("Clicked outside canvas");return false}o=A.pathSegList.numberOfItems;p=A.pathSegList.getItem(o-1);B=p.x;p=p.y;if(E.shiftKey){v=Z(B,p,f,v);f=v.x;v=v.y}E=s.pathSegList.getItem(1);E=E.pathSegType===4?A.createSVGPathSegLinetoAbs(kb(f),kb(v)):A.createSVGPathSegCurvetoCubicAbs(kb(f),kb(v),E.x1/w,E.y1/w,E.x2/w,E.y2/w);A.pathSegList.appendItem(E);f*=w;v*=w;s.setAttribute("d",["M",f,v,f,v].join(" "));s=svgedit.path.addCtrlGrip("1c1"); +E=svgedit.path.addCtrlGrip("0c2");B=svgedit.path.getCtrlLine(1);p=svgedit.path.getCtrlLine(2);s.setAttribute("cx",f);s.setAttribute("cy",v);E.setAttribute("cx",f);E.setAttribute("cy",v);B.setAttribute("x1",f);B.setAttribute("x2",f);B.setAttribute("y1",v);B.setAttribute("y2",v);p.setAttribute("x1",f);p.setAttribute("x2",f);p.setAttribute("y1",v);p.setAttribute("y2",v);s=o;if(g)s+=svgedit.path.path.segs.length;svgedit.path.addPointGrip(s,f,v)}o=true}else{d_attr="M"+f+","+v+" ";A=U({element:"path",curStyles:true, +attr:{d:d_attr,id:V(),opacity:N.opacity/2}});s.setAttribute("d",["M",mouse_x,mouse_y,mouse_x,mouse_y].join(" "));s=g?svgedit.path.path.segs.length:0;svgedit.path.addPointGrip(s,mouse_x,mouse_y);svgedit.path.first_grip=null}}else if(svgedit.path.path){svgedit.path.path.storeD();B=E.target.id;if(B.substr(0,14)=="pathpointgrip_"){v=svgedit.path.path.cur_pt=parseInt(B.substr(14));svgedit.path.path.dragging=[f,s];B=svgedit.path.path.segs[v];if(E.shiftKey)B.selected?svgedit.path.path.removePtFromSelection(v): +svgedit.path.path.addPtsToSelection(v);else{if(svgedit.path.path.selected_pts.length<=1||!B.selected)svgedit.path.path.clearSelection();svgedit.path.path.addPtsToSelection(v)}}else if(B.indexOf("ctrlpointgrip_")==0){svgedit.path.path.dragging=[f,s];E=B.split("_")[1].split("c");v=E[0]-0;o=E=E[1]-0;p=svgedit.path.path.segs[v];svgedit.path.path.selectPt(v,E);if(o==2){F=1;B=p.next}else{F=2;B=p.prev}if(!B)return;E=function(O,W){return Math.sqrt(Math.pow(O.x-W.x,2)+Math.pow(O.y-W.y,2))};v={x:p.item["x"+ +o],y:p.item["y"+o]};o=o==2?{x:p.item.x,y:p.item.y}:{x:B.item.x,y:B.item.y};p={x:B.item["x"+F],y:B.item["y"+F]};B=E(v,o);E=E(p,o);v=Math.abs(Math.round(Math.atan2(v.y-o.y,v.x-o.x)*(180/Math.PI),0)-Math.round(Math.atan2(p.y-o.y,p.x-o.x)*(180/Math.PI),0))==180;if(Math.abs(B-E)<5&&v){svgedit.path.setLinkControlPoints(true);svgedit.path.is_linked=true}else{svgedit.path.setLinkControlPoints(false);svgedit.path.is_linked=false}}if(!svgedit.path.path.dragging){if(Ja==null)Ja=za.getRubberBandBox();na(Ja,{x:f* +w,y:s*w,width:0,height:0,display:"inline"},100)}}},mouseMove:function(E,v,f){G=true;var s=!E.altKey;if(xa==="path"){if(A){var o=A.pathSegList,p=o.numberOfItems-1,B=svgedit.path.addCtrlGrip("1c1"),F=svgedit.path.addCtrlGrip("0c2");if(m){var I=F.getAttribute("cx")/w||0,J=F.getAttribute("cy")/w||0;B.setAttribute("cx",v);B.setAttribute("cy",f);B.setAttribute("display","inline");E=m[0];B=m[1];o.getItem(p);var O=v/w,W=f/w;I=s?E+(E-O):I;s=s?B+(B-W):J;F.setAttribute("cx",I*w);F.setAttribute("cy",s*w);F.setAttribute("display", +"inline");F=svgedit.path.getCtrlLine(1);J=svgedit.path.getCtrlLine(2);na(F,{x1:v,y1:f,x2:E*w,y2:B*w,display:"inline"});na(J,{x1:I*w,y1:s*w,x2:E*w,y2:B*w,display:"inline"});if(p===0)C=[v,f];else{o=o.getItem(p-1);v=o.x;f=o.y;if(o.pathSegType===6){v+=v-o.x2;f+=f-o.y2}else if(C){v=C[0]/w;f=C[1]/w}svgedit.path.replacePathSeg(6,p,[E,B,this.lastCtrlPoint[0]/w,this.lastCtrlPoint[1]/w,I,s],A)}}else if(s=this.stretchy){p=o.getItem(p);o=v;B=f;if(E.target.id==="pathpointgrip_0"&&svgedit.path.first_grip){o=svgedit.path.first_grip[0]; +B=svgedit.path.first_grip[1]}if(p.pathSegType===6)svgedit.path.replacePathSeg(6,1,[v,f,(this.lastCtrlPoint[0]/w||p.x+(p.x-p.x2))*w,(this.lastCtrlPoint[1]/w||p.y+(p.y-p.y2))*w,o,B],s);else C?svgedit.path.replacePathSeg(6,1,[v,f,C[0],C[1],v,f],s):svgedit.path.replacePathSeg(4,1,[v,f],s)}}}else if(svgedit.path.path.dragging){o=svgedit.path.getPointFromGrip({x:svgedit.path.path.dragging[0],y:svgedit.path.path.dragging[1]},svgedit.path.path);E=svgedit.path.getPointFromGrip({x:v,y:f},svgedit.path.path); +p=E.x-o.x;o=E.y-o.y;svgedit.path.path.dragging=[v,f];!s||!svgedit.path.is_linked?svgedit.path.setLinkControlPoints(false):svgedit.path.setLinkControlPoints(true);svgedit.path.path.dragctrl?svgedit.path.path.moveCtrl(p,o):svgedit.path.path.movePts(p,o)}else{svgedit.path.path.selected_pts=[];svgedit.path.path.eachSeg(function(){if(this.next||this.prev){var aa=Ja.getBBox(),X=svgedit.path.getGripPt(this);aa=svgedit.math.rectsIntersect(aa,{x:X.x,y:X.y,width:0,height:0});this.select(aa);aa&&svgedit.path.path.selected_pts.push(this.index)}})}}, +mouseUp:function(E,v,f,s){var o=oa("ctrlpointgrip_1c1"),p=oa("ctrlpointgrip_0c2");this.lastCtrlPoint=o?[o.getAttribute("cx"),o.getAttribute("cy")]:[f,s];if(!svgedit.path.first_grip)svgedit.path.first_grip=p?[p.getAttribute("cx"),p.getAttribute("cy")]:[f,s];if(xa==="path"){m=null;if(!A){v=oa(ha());Fa=false;C=null}return{keep:true,element:v}}if(svgedit.path.path.dragging){v=svgedit.path.path.cur_pt;svgedit.path.path.dragging=false;svgedit.path.path.dragctrl=false;svgedit.path.path.update();G&&svgedit.path.path.endChanges("Move path point(s)"); +!E.shiftKey&&!G&&svgedit.path.path.selectPt(v)}else if(Ja&&Ja.getAttribute("display")!="none"){Ja.setAttribute("display","none");Ja.getAttribute("width")<=2&&Ja.getAttribute("height")<=2&&Ca.toSelectMode(E.target)}else Ca.toSelectMode(E.target);G=false},toEditMode:function(E){svgedit.path.path=svgedit.path.getPath_(E);xa="pathedit";Na();svgedit.path.path.show(true).update();svgedit.path.path.oldbbox=svgedit.utilities.getBBox(svgedit.path.path.elem);g=false},toSelectMode:function(E){var v=E==svgedit.path.path.elem; +xa="select";svgedit.path.path.show(false);h=false;Na();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();if(v){da("selected",[E]);ib([E],true)}},addSubPath:function(E){if(E){xa="path";g=true}else{Ca.clear(true);Ca.toEditMode(svgedit.path.path.elem)}},select:function(E){if(h===E){Ca.toEditMode(E);xa="pathedit"}else h=E},reorient:function(){var E=H[0];if(E)if(pa(E)!=0){var v=new qa("Reorient path"),f={d:E.getAttribute("d"),transform:E.getAttribute("transform")};v.addSubCommand(new La(E,f)); +Na();this.resetOrientation(E);wa(v);svgedit.path.getPath_(E).show(false).matrix=null;this.clear();ib([E],true);da("changed",H)}},clear:function(E){h=null;if(A){var v=oa(ha());$(oa("path_stretch_line")).remove();E&&$(v).remove();$(oa("pathpointgrip_container")).find("*").attr("display","none");A=C=null;Fa=false}else xa=="pathedit"&&this.toSelectMode();svgedit.path.path&&svgedit.path.path.init().show(false)},resetOrientation:function(E){if(E==null||E.nodeName!="path")return false;var v=S(E),f=ga(v).matrix; +v.clear();E.removeAttribute("transform");v=E.pathSegList;for(var s=v.numberOfItems,o=0;o0){B=s.getItem(o-1).pathSegType;if(B===2){p(o-1,1);f();break}else if(B=== +1&&s.numberOfItems-1===o){p(o,1);f();break}}}return false};f();if(svgedit.path.path.elem.pathSegList.numberOfItems<=1){b.setMode("select");b.deleteSelectedElements()}else{svgedit.path.path.init();svgedit.path.path.clearSelection();if(window.opera){E=$(svgedit.path.path.elem);E.attr("d",E.attr("d"))}svgedit.path.path.endChanges("Delete path node(s)")}}},smoothPolylineIntoPath:function(E){var v=E.points,f=v.numberOfItems;if(f>=4){var s=v.getItem(0),o=null;E=[];E.push(["M",s.x,",",s.y," C"].join("")); +for(var p=1;p<=f-4;p+=3){var B=v.getItem(p),F=v.getItem(p+1),I=v.getItem(p+2);if(o)if((s=svgedit.path.smoothControlPoints(o,B,s))&&s.length==2){B=E[E.length-1].split(",");B[2]=s[0].x;B[3]=s[0].y;E[E.length-1]=B.join(",");B=s[1]}E.push([B.x,B.y,F.x,F.y,I.x,I.y].join(","));s=I;o=F}for(E.push("L");p0;);Ca.clear(true);$.each(q.childNodes,function(m, +C){m&&C.nodeType===8&&C.data.indexOf("Created with")>=0&&q.insertBefore(C,q.firstChild)});if(K){Ab();mb([K])}$("#canvasGrid").attr("display","none");var g=[];$(q).find("g:data(gsvg)").each(function(){for(var m=this.attributes,C=m.length,A=0;A=0;f--){v=E.item(f);p=C(v.nodeValue);if(!(B.indexOf(v.localName)>= +0))if(p!="")if(p.indexOf("pointer-events")!==0)if(!(v.localName==="class"&&p.indexOf("se_")===0)){m.push(" ");if(v.localName==="d")p=Ca.convertPath(g,true);if(isNaN(p)){if(G.test(p))p=svgedit.units.shortFloat(p)+A}else p=svgedit.units.shortFloat(p);if(sa.apply&&g.nodeName==="image"&&v.localName==="href"&&sa.images&&sa.images==="embed"){var F=Sa[p];if(F)p=F}if(!v.namespaceURI||v.namespaceURI==c||Ha[v.namespaceURI]){m.push(v.nodeName);m.push('="');m.push(p);m.push('"')}}}}if(g.hasChildNodes()){m.push(">"); +h++;E=false;for(f=0;f");break;case 8:m.push("\n");m.push(Array(h+1).join(" "));m.push("