E-2&&aaP-2&&hb.toSelectMode(true)},setCursor:e,toEditMode:function(S,X){U=false;Ea="textedit";Ha.requestSelector(F).showGrips(false);Ha.requestSelector(F);hb.init();$(F).css("cursor","text");if(arguments.length){var aa=w(S,X);e(m(aa.x,aa.y))}else e();setTimeout(function(){U=
-true},300)},toSelectMode:function(S){Ea="select";clearInterval(L);L=null;G&&$(G).attr("display","none");D&&$(D).attr("visibility","hidden");$(F).css("cursor","move");if(S){Pa();$(F).css("cursor","move");N("selected",[F]);vb([F],true)}F&&!F.textContent.length&&b.deleteSelectedElements();$(I).blur();F=false},setInputElem:function(S){I=S},clear:function(){Ea=="textedit"&&hb.toSelectMode()},init:function(){if(F){if(!F.parentNode){F=J[0];Ha.requestSelector(F).showGrips(false)}var S=F.textContent.length,
-X=F.getAttribute("transform");u=svgedit.utilities.getBBox(F);C=X?W(F):null;k=Array(S);I.focus();$(F).unbind("dblclick",v).dblclick(v);if(!S)var aa={x:u.x+u.width/2,width:0};for(X=0;X=0&&this.selected_pts.push(F)}this.selected_pts.sort();v=this.selected_pts.length;for(A=Array(v);v--;){I=
-this.segs[this.selected_pts[v]];I.select(true);A[v]=I.ptgrip}Ja.canDeleteNodes=true;Ja.closed_subpath=this.subpathIsClosed(this.selected_pts[0]);N("selected",A)};var w=h=null,H=false;return{mouseDown:function(A,v,F,I){if(Ea==="path"){mouse_x=F;mouse_y=I;I=mouse_x/o;v=mouse_y/o;F=qa("path_stretch_line");m=[I,v];if(n.gridSnapping){I=wa(I);v=wa(v);mouse_x=wa(mouse_x);mouse_y=wa(mouse_y)}if(!F){F=document.createElementNS(c,"path");ma(F,{id:"path_stretch_line",stroke:"#22C","stroke-width":"0.5",fill:"none"});
-F=qa("selectorParentGroup").appendChild(F)}F.setAttribute("display","inline");var D=null;if(w){D=w.pathSegList;for(var G=D.numberOfItems,L=6/o,k=false;G;){G--;var u=D.getItem(G),C=u.x;u=u.y;if(I>=C-L&&I<=C+L&&v>=u-L&&v<=u+L){k=true;break}}L=ca();svgedit.path.removePath_(L);L=qa(L);C=D.numberOfItems;if(k){if(G<=1&&C>=2){I=D.getItem(0).x;v=D.getItem(0).y;A=F.pathSegList.getItem(1);A=A.pathSegType===4?w.createSVGPathSegLinetoAbs(I,v):w.createSVGPathSegCurvetoCubicAbs(I,v,A.x1/o,A.y1/o,I,v);I=w.createSVGPathSegClosePath();
-D.appendItem(A);D.appendItem(I)}else if(C<3)return D=false;$(F).remove();element=L;w=null;La=false;if(e){svgedit.path.path.matrix&&db(L,{},svgedit.path.path.matrix.inverse());F=L.getAttribute("d");A=$(svgedit.path.path.elem).attr("d");$(svgedit.path.path.elem).attr("d",A+F);$(L).remove();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();svgedit.path.path.init();Ja.toEditMode(svgedit.path.path.elem);svgedit.path.path.selectPt();return false}}else{if(!$.contains(a,Ib(A))){console.log("Clicked outside canvas");
-return false}D=w.pathSegList.numberOfItems;G=w.pathSegList.getItem(D-1);L=G.x;G=G.y;if(A.shiftKey){A=ba(L,G,I,v);I=A.x;v=A.y}A=F.pathSegList.getItem(1);A=A.pathSegType===4?w.createSVGPathSegLinetoAbs(eb(I),eb(v)):w.createSVGPathSegCurvetoCubicAbs(eb(I),eb(v),A.x1/o,A.y1/o,A.x2/o,A.y2/o);w.pathSegList.appendItem(A);I*=o;v*=o;F.setAttribute("d",["M",I,v,I,v].join(" "));F=D;if(e)F+=svgedit.path.path.segs.length;svgedit.path.addPointGrip(F,I,v)}}else{d_attr="M"+I+","+v+" ";w=Q({element:"path",curStyles:true,
-attr:{d:d_attr,id:ja(),opacity:M.opacity/2}});F.setAttribute("d",["M",mouse_x,mouse_y,mouse_x,mouse_y].join(" "));F=e?svgedit.path.path.segs.length:0;svgedit.path.addPointGrip(F,mouse_x,mouse_y)}}else if(svgedit.path.path){svgedit.path.path.storeD();L=A.target.id;if(L.substr(0,14)=="pathpointgrip_"){v=svgedit.path.path.cur_pt=parseInt(L.substr(14));svgedit.path.path.dragging=[F,I];D=svgedit.path.path.segs[v];if(A.shiftKey)D.selected?svgedit.path.path.removePtFromSelection(v):svgedit.path.path.addPtsToSelection(v);
-else{if(svgedit.path.path.selected_pts.length<=1||!D.selected)svgedit.path.path.clearSelection();svgedit.path.path.addPtsToSelection(v)}}else if(L.indexOf("ctrlpointgrip_")==0){svgedit.path.path.dragging=[F,I];A=L.split("_")[1].split("c");v=A[0]-0;svgedit.path.path.selectPt(v,A[1]-0)}if(!svgedit.path.path.dragging){if(ta==null)ta=Ha.getRubberBandBox();ma(ta,{x:F*o,y:I*o,width:0,height:0,display:"inline"},100)}}},mouseMove:function(A,v,F){H=true;if(Ea==="path"){if(w){var I=w.pathSegList;A=I.numberOfItems-
-1;if(m){var D=svgedit.path.addCtrlGrip("1c1"),G=svgedit.path.addCtrlGrip("0c2");G.getAttribute("cx");G.getAttribute("cy");D.setAttribute("cx",v);D.setAttribute("cy",F);D.setAttribute("display","inline");D=m[0];var L=m[1];I.getItem(A);var k=D+(D-v/o),u=L+(L-F/o);G.setAttribute("cx",k*o);G.setAttribute("cy",u*o);G.setAttribute("display","inline");G=svgedit.path.getCtrlLine(1);var C=svgedit.path.getCtrlLine(2);ma(G,{x1:v,y1:F,x2:D*o,y2:L*o,display:"inline"});ma(C,{x1:k*o,y1:u*o,x2:D*o,y2:L*o,display:"inline"});
-if(A===0)z=[v,F];else{I=I.getItem(A-1);v=I.x;F=I.y;if(I.pathSegType===6){v+=v-I.x2;F+=F-I.y2}else if(z){v=z[0]/o;F=z[1]/o}svgedit.path.replacePathSeg(6,A,[D,L,v,F,k,u],w)}}else if(D=qa("path_stretch_line")){A=I.getItem(A);if(A.pathSegType===6)svgedit.path.replacePathSeg(6,1,[v,F,(A.x+(A.x-A.x2))*o,(A.y+(A.y-A.y2))*o,v,F],D);else z?svgedit.path.replacePathSeg(6,1,[v,F,z[0],z[1],v,F],D):svgedit.path.replacePathSeg(4,1,[v,F],D)}}}else if(svgedit.path.path.dragging){D=svgedit.path.getPointFromGrip({x:svgedit.path.path.dragging[0],
-y:svgedit.path.path.dragging[1]},svgedit.path.path);L=svgedit.path.getPointFromGrip({x:v,y:F},svgedit.path.path);A=L.x-D.x;D=L.y-D.y;svgedit.path.path.dragging=[v,F];svgedit.path.path.dragctrl?svgedit.path.path.moveCtrl(A,D):svgedit.path.path.movePts(A,D)}else{svgedit.path.path.selected_pts=[];svgedit.path.path.eachSeg(function(){if(this.next||this.prev){var E=ta.getBBox(),P=svgedit.path.getGripPt(this);E=svgedit.math.rectsIntersect(E,{x:P.x,y:P.y,width:0,height:0});this.select(E);E&&svgedit.path.path.selected_pts.push(this.index)}})}},
-mouseUp:function(A,v){if(Ea==="path"){m=null;if(!w){v=qa(ca());La=false;z=null}return{keep:true,element:v}}if(svgedit.path.path.dragging){var F=svgedit.path.path.cur_pt;svgedit.path.path.dragging=false;svgedit.path.path.dragctrl=false;svgedit.path.path.update();H&&svgedit.path.path.endChanges("Move path point(s)");!A.shiftKey&&!H&&svgedit.path.path.selectPt(F)}else if(ta&&ta.getAttribute("display")!="none"){ta.setAttribute("display","none");ta.getAttribute("width")<=2&&ta.getAttribute("height")<=
-2&&Ja.toSelectMode(A.target)}else Ja.toSelectMode(A.target);H=false},toEditMode:function(A){svgedit.path.path=svgedit.path.getPath_(A);Ea="pathedit";Pa();svgedit.path.path.show(true).update();svgedit.path.path.oldbbox=svgedit.utilities.getBBox(svgedit.path.path.elem);e=false},toSelectMode:function(A){var v=A==svgedit.path.path.elem;Ea="select";svgedit.path.path.show(false);h=false;Pa();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();if(v){N("selected",[A]);vb([A],true)}},addSubPath:function(A){if(A){Ea=
-"path";e=true}else{Ja.clear(true);Ja.toEditMode(svgedit.path.path.elem)}},select:function(A){if(h===A){Ja.toEditMode(A);Ea="pathedit"}else h=A},reorient:function(){var A=J[0];if(A)if(oa(A)!=0){var v=new za("Reorient path"),F={d:A.getAttribute("d"),transform:A.getAttribute("transform")};v.addSubCommand(new Na(A,F));Pa();this.resetOrientation(A);ya(v);svgedit.path.getPath_(A).show(false).matrix=null;this.clear();vb([A],true);N("changed",J)}},clear:function(){h=null;if(w){var A=qa(ca());$(qa("path_stretch_line")).remove();
-$(A).remove();$(qa("pathpointgrip_container")).find("*").attr("display","none");w=z=null;La=false}else Ea=="pathedit"&&this.toSelectMode();svgedit.path.path&&svgedit.path.path.init().show(false)},resetOrientation:function(A){if(A==null||A.nodeName!="path")return false;var v=Y(A),F=fa(v).matrix;v.clear();A.removeAttribute("transform");v=A.pathSegList;for(var I=v.numberOfItems,D=0;D0){L=I.getItem(D-1).pathSegType;if(L===2){G(D-1,1);F();break}else if(L===1&&I.numberOfItems-1===D){G(D,1);F();break}}}return false};F();if(svgedit.path.path.elem.pathSegList.numberOfItems<=1){Ja.toSelectMode(svgedit.path.path.elem);
-b.deleteSelectedElements()}else{svgedit.path.path.init();svgedit.path.path.clearSelection();if(window.opera){A=$(svgedit.path.path.elem);A.attr("d",A.attr("d"))}svgedit.path.path.endChanges("Delete path node(s)")}}},smoothPolylineIntoPath:function(A){var v=A.points,F=v.numberOfItems;if(F>=4){var I=v.getItem(0),D=null;A=[];A.push(["M",I.x,",",I.y," C"].join(""));for(var G=1;G<=F-4;G+=3){var L=v.getItem(G),k=v.getItem(G+1),u=v.getItem(G+2);if(D)if((I=svgedit.path.smoothControlPoints(D,L,I))&&I.length==
-2){L=A[A.length-1].split(",");L[2]=I[0].x;L[3]=I[0].y;A[A.length-1]=L.join(",");L=I[1]}A.push([L.x,L.y,k.x,k.y,u.x,u.y].join(","));I=u;D=k}for(A.push("L");G0;);Ja.clear(true);$.each(l.childNodes,function(m,z){m&&z.nodeType===8&&z.data.indexOf("Created with")>=0&&l.insertBefore(z,l.firstChild)});if(K){Jb();Bb([K])}var e=
-[];$(l).find("g:data(gsvg)").each(function(){for(var m=this.attributes,z=m.length,w=0;w0&&b.removeFromSelection(G);
+L.length>0&&vb(L);break;case "resize":G=X(F);L=(D=pa(G))?H:svgedit.utilities.getBBox(F);C=L.x;k=L.y;var P=L.width,U=L.height;L=x-h;u=y-m;if(n.gridSnapping){L=wa(L);u=wa(u);U=wa(U);P=wa(P)}var S=oa(F);if(S){var Y=Math.sqrt(L*L+u*u);u=Math.atan2(u,L)-S*Math.PI/180;L=Y*Math.cos(u);u=Y*Math.sin(u)}if(kb.indexOf("n")==-1&&kb.indexOf("s")==-1)u=0;if(kb.indexOf("e")==-1&&kb.indexOf("w")==-1)L=0;var aa=Y=0,ga=U?(U+u)/U:1,ra=P?(P+L)/P:1;if(kb.indexOf("n")>=0){ga=U?(U-u)/U:1;aa=U}if(kb.indexOf("w")>=0){ra=
+P?(P-L)/P:1;Y=P}L=d.createSVGTransform();u=d.createSVGTransform();P=d.createSVGTransform();if(n.gridSnapping){C=wa(C);Y=wa(Y);k=wa(k);aa=wa(aa)}L.setTranslate(-(C+Y),-(k+aa));if(v.shiftKey)if(ra==1)ra=ga;else ga=ra;u.setScale(ra,ga);P.setTranslate(C+Y,k+aa);if(D){D=S?1:0;G.replaceItem(L,2+D);G.replaceItem(u,1+D);G.replaceItem(P,0+D)}else{D=G.numberOfItems;G.replaceItem(P,D-3);G.replaceItem(u,D-2);G.replaceItem(L,D-1)}Ha.requestSelector(F).resize();N("transition",J);break;case "zoom":L*=o;k*=o;ma(ua,
+{x:Math.min(z*o,L),y:Math.min(w*o,k),width:Math.abs(L-z*o),height:Math.abs(k-w*o)},100);break;case "text":ma(G,{x:x,y:y},1E3);break;case "line":L=null;window.opera||d.suspendRedraw(1E3);if(n.gridSnapping){x=wa(x);y=wa(y)}D=x;C=y;if(v.shiftKey){C=ba(h,m,D,C);D=C.x;C=C.y}G.setAttributeNS(null,"x2",D);G.setAttributeNS(null,"y2",C);window.opera||d.unsuspendRedraw(L);break;case "foreignObject":case "square":case "rect":case "image":L=Math.abs(x-h);D=Math.abs(y-m);if(Ea=="square"||v.shiftKey){L=D=Math.max(L,
+D);C=hm?m+k:m-k}if(v.altKey){D=h;C=m;k=Math.abs(x-D);u=v.shiftKey?k:Math.abs(y-C)}G.setAttributeNS(null,"rx",k);G.setAttributeNS(null,"ry",u);G.setAttributeNS(null,"cx",D);G.setAttributeNS(null,"cy",C);window.opera||d.unsuspendRedraw(L);break;case "fhellipse":case "fhrect":A.minx=Math.min(L,A.minx);A.maxx=Math.max(L,A.maxx);A.miny=Math.min(k,A.miny);A.maxy=Math.max(k,A.maxy);case "fhpath":e+=+L+","+k+" ";G.setAttributeNS(null,
+"points",e);break;case "path":case "pathedit":x*=o;y*=o;if(n.gridSnapping){x=wa(x);y=wa(y);h=wa(h);m=wa(m)}if(v.shiftKey){if(D=svgedit.path.path){G=D.dragging?D.dragging[0]:h;D=D.dragging?D.dragging[1]:m}else{G=h;D=m}C=ba(G,D,x,y);x=C.x;y=C.y}if(ua&&ua.getAttribute("display")!=="none"){L*=o;k*=o;ma(ua,{x:Math.min(z*o,L),y:Math.min(w*o,k),width:Math.abs(L-z*o),height:Math.abs(k-w*o)},100)}Ja.mouseMove(v,x,y);break;case "textedit":x*=o;y*=o;hb.mouseMove(E,I);break;case "rotate":L=svgedit.utilities.getBBox(F);
+D=L.x+L.width/2;C=L.y+L.height/2;G=W(F);G=O(D,C,G);D=G.x;C=G.y;G=L.x;k=L.y;if(current_rotate_mode=="nw")G=L.x+L.width;if(current_rotate_mode=="se")k=L.y+L.height;if(current_rotate_mode=="sw"){G=L.x+L.width;k=L.y+L.height}compensation_angle=(Math.atan2(C-k,D-G)*(180/Math.PI)-90)%360;S=(Math.atan2(C-y,D-x)*(180/Math.PI)-90)%360;S+=compensation_angle;if(n.gridSnapping)S=wa(S);if(v.shiftKey)S=Math.round(S/45)*45;b.setRotationAngle(S<-180?360+S:S,true);N("transition",J)}ob("mouseMove",{event:v,mouse_x:E,
+mouse_y:I,selected:F})}}).click(function(v){v.preventDefault();return false}).dblclick(function(v){var F=v.target.parentNode;if(F!==K){var I=Ib(v),E=I.tagName;if(E==="text"&&Ea!=="textedit"){v=O(v.pageX,v.pageY,rb);hb.select(I,v.x,v.y)}if((E==="g"||E==="a")&&oa(I)){Mb(I);I=J[0];Qa(true)}K&&Jb();F.tagName!=="g"&&F.tagName!=="a"||F===B().getCurrentLayer()||I===Ha.selectorParentGroup||Rb(I)}}).mouseup(function(v){b.addClones=false;window.removeEventListener("keyup",b.removeClones);if(v.button!==2){var F=
+Cb;Cb=null;if(La){var I=O(v.pageX,v.pageY,rb),E=I.x*o;I=I.y*o;var G=E/o,L=I/o,k=qa(ca()),u=false;La=false;switch(Ea){case "resize":case "multiselect":if(ua!=null){ua.setAttribute("display","none");mb=[]}Ea="select";case "select":if(J[0]!=null){if(J[1]==null){E=J[0];switch(E.tagName){case "g":case "use":case "image":case "foreignObject":break;default:bb.fill=E.getAttribute("fill");bb.fill_opacity=E.getAttribute("fill-opacity");bb.stroke=E.getAttribute("stroke");bb.stroke_opacity=E.getAttribute("stroke-opacity");
+bb.stroke_width=E.getAttribute("stroke-width");bb.stroke_dasharray=E.getAttribute("stroke-dasharray");bb.stroke_linejoin=E.getAttribute("stroke-linejoin");bb.stroke_linecap=E.getAttribute("stroke-linecap")}if(E.tagName=="text"){Za.font_size=E.getAttribute("font-size");Za.font_family=E.getAttribute("font-family")}Ha.requestSelector(E).showGrips(true)}Ga();if(G!=z||L!=w){v=J.length;for(E=0;E=0?F.indexOf(",",
+G+1)>=0:F.indexOf(" ",F.indexOf(" ")+1)>=0)k=Ja.smoothPolylineIntoPath(k);break;case "line":F=$(k).attr(["x1","x2","y1","y2"]);u=F.x1!=F.x2||F.y1!=F.y2;break;case "foreignObject":case "square":case "rect":case "image":F=$(k).attr(["width","height"]);u=F.width!=0||F.height!=0||Ea==="image";break;case "circle":u=k.getAttribute("r")!=0;break;case "ellipse":F=$(k).attr(["rx","ry"]);u=F.rx!=null||F.ry!=null;break;case "fhellipse":if(A.maxx-A.minx>0&&A.maxy-A.miny>0){k=Q({element:"ellipse",curStyles:true,
+attr:{cx:(A.minx+A.maxx)/2,cy:(A.miny+A.maxy)/2,rx:(A.maxx-A.minx)/2,ry:(A.maxy-A.miny)/2,id:ca()}});N("changed",[k]);u=true}break;case "fhrect":if(A.maxx-A.minx>0&&A.maxy-A.miny>0){k=Q({element:"rect",curStyles:true,attr:{x:A.minx,y:A.miny,width:A.maxx-A.minx,height:A.maxy-A.miny,id:ca()}});N("changed",[k]);u=true}break;case "text":u=true;xb([k]);hb.start(k);break;case "path":k=null;La=true;F=Ja.mouseUp(v,k,E,I);k=F.element;u=F.keep;break;case "pathedit":u=true;k=null;Ja.mouseUp(v);break;case "textedit":u=
+false;k=null;hb.mouseUp(v,E,I);break;case "rotate":u=true;k=null;Ea="select";F=b.undoMgr.finishUndoableChange();F.isEmpty()||ya(F);Ga();N("changed",J)}E=ob("mouseUp",{event:v,mouse_x:E,mouse_y:I},true);$.each(E,function(P,U){if(U){u=U.keep||u;k=U.element;La=U.started||La}});if(!u&&k!=null){B().releaseId(ca());k.parentNode.removeChild(k);k=null;for(E=v.target;E.parentNode.parentNode.tagName=="g";)E=E.parentNode;if((Ea!="path"||!drawn_path)&&E.parentNode.id!="selectorParentGroup"&&E.id!="svgcanvas"&&
+E.id!="svgroot"){b.setMode("select");xb([E],true)}}else if(k!=null){b.addedNew=true;v=0.2;var C;if(false.beginElement&&k.getAttribute("opacity")!=M.opacity){C=$(false).clone().attr({to:M.opacity,dur:v}).appendTo(k);try{C[0].beginElement()}catch(D){}}else v=0;setTimeout(function(){C&&C.remove();k.setAttribute("opacity",M.opacity);k.setAttribute("style","pointer-events:inherit");na(k);if(Ea==="path")Ja.toEditMode(k);else n.selectNew&&xb([k],true);ya(new Ca(k));N("changed",[k])},v*1E3)}Va=null}}});$(a).bind("mousewheel DOMMouseScroll",
+function(v){if(v.shiftKey){v.preventDefault();rb=l.getScreenCTM().inverse();var F=O(v.pageX,v.pageY,rb);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&&N("zoomed",F)}})})();var pb=function(e){$(e).click(function(h){h.preventDefault()})},hb=b.textActions=function(){function e(S){var Y=I.value==="";$(I).focus();if(!arguments.length)if(Y)S=0;else{if(I.selectionEnd!==
+I.selectionStart)return;S=I.selectionEnd}var aa;aa=k[S];Y||I.setSelectionRange(S,S);E=qa("text_cursor");if(!E){E=document.createElementNS(c,"line");ma(E,{id:"text_cursor",stroke:"#333","stroke-width":1});E=qa("selectorParentGroup").appendChild(E)}L||(L=setInterval(function(){var ga=E.getAttribute("display")==="none";E.setAttribute("display",ga?"inline":"none")},600));Y=H(aa.x,u.y);aa=H(aa.x,u.y+u.height);ma(E,{x1:Y.x,y1:Y.y,x2:aa.x,y2:aa.y,visibility:"visible",display:"inline"});G&&G.setAttribute("d",
+"")}function h(S,Y,aa){if(S===Y)e(Y);else{aa||I.setSelectionRange(S,Y);G=qa("text_selectblock");if(!G){G=document.createElementNS(c,"path");ma(G,{id:"text_selectblock",fill:"green",opacity:0.5,style:"pointer-events:none"});qa("selectorParentGroup").appendChild(G)}S=k[S];var ga=k[Y];E.setAttribute("visibility","hidden");Y=H(S.x,u.y);aa=H(S.x+(ga.x-S.x),u.y);var ra=H(S.x,u.y+u.height);S=H(S.x+(ga.x-S.x),u.y+u.height);ma(G,{d:"M"+Y.x+","+Y.y+" L"+aa.x+","+aa.y+" "+S.x+","+S.y+" "+ra.x+","+ra.y+"z",display:"inline"})}}
+function m(S,Y){var aa=d.createSVGPoint();aa.x=S;aa.y=Y;if(k.length==1)return 0;aa=F.getCharNumAtPosition(aa);if(aa<0){aa=k.length-2;if(S<=k[0].x)aa=0}else if(aa>=k.length-2)aa=k.length-2;var ga=k[aa];S>ga.x+ga.width/2&&aa++;return aa}function z(S,Y,aa){var ga=I.selectionStart;S=m(S,Y);h(Math.min(ga,S),Math.max(ga,S),!aa)}function w(S,Y){var aa={x:S,y:Y};aa.x/=o;aa.y/=o;if(C){var ga=O(aa.x,aa.y,C.inverse());aa.x=ga.x;aa.y=ga.y}return aa}function H(S,Y){var aa={x:S,y:Y};if(C){var ga=O(aa.x,aa.y,C);
+aa.x=ga.x;aa.y=ga.y}aa.x*=o;aa.y*=o;return aa}function A(S){h(0,F.textContent.length);$(this).unbind(S)}function v(S){if(U&&F){var Y=O(S.pageX,S.pageY,rb);Y=w(Y.x*o,Y.y*o);Y=m(Y.x,Y.y);var aa=F.textContent,ga=aa.substr(0,Y).replace(/[a-z0-9]+$/i,"").length;aa=aa.substr(Y).match(/^[a-z0-9]+/i);h(ga,(aa?aa[0].length:0)+Y);$(S.target).click(A);setTimeout(function(){$(S.target).unbind("click",A)},300)}}var F,I,E,G,L,k=[],u,C,D,P,U;return{select:function(S,Y,aa){F=S;hb.toEditMode(Y,aa)},start:function(S){F=
+S;hb.toEditMode()},mouseDown:function(S,Y,aa,ga){S=w(aa,ga);I.focus();e(m(S.x,S.y));D=aa;P=ga},mouseMove:function(S,Y){var aa=w(S,Y);z(aa.x,aa.y)},mouseUp:function(S,Y,aa){var ga=w(Y,aa);z(ga.x,ga.y,true);S.target!==F&&YD-2&&aaP-2&&hb.toSelectMode(true)},setCursor:e,toEditMode:function(S,Y){xb([F],false);U=false;Ea="textedit";Ha.requestSelector(F);hb.init();$(F).css("cursor","text");if(arguments.length){var aa=w(S,Y);e(m(aa.x,aa.y))}else e();setTimeout(function(){U=true},300)},toSelectMode:function(S){Ea=
+"select";clearInterval(L);L=null;G&&$(G).attr("display","none");E&&$(E).attr("visibility","hidden");$(F).css("cursor","move");if(S){Qa();$(F).css("cursor","move");N("selected",[F]);vb([F],true)}F&&!F.textContent.length&&b.deleteSelectedElements();$(I).blur();F=false},setInputElem:function(S){I=S},clear:function(){Ea=="textedit"&&hb.toSelectMode()},init:function(){if(F){if(!F.parentNode){F=J[0];Ha.requestSelector(F).showGrips(false)}var S=F.textContent.length,Y=F.getAttribute("transform");u=svgedit.utilities.getBBox(F);
+C=Y?W(F):null;k=Array(S);I.focus();$(F).unbind("dblclick",v).dblclick(v);if(!S)var aa={x:u.x+u.width/2,width:0};for(Y=0;Y=0&&this.selected_pts.push(F)}this.selected_pts.sort();v=this.selected_pts.length;for(A=Array(v);v--;){I=this.segs[this.selected_pts[v]];I.select(true);A[v]=
+I.ptgrip}Ja.canDeleteNodes=true;Ja.closed_subpath=this.subpathIsClosed(this.selected_pts[0]);N("selected",A)};var w=h=null,H=false;return{mouseDown:function(A,v,F,I){if(Ea==="path"){mouse_x=F;mouse_y=I;I=mouse_x/o;v=mouse_y/o;F=qa("path_stretch_line");m=[I,v];if(n.gridSnapping){I=wa(I);v=wa(v);mouse_x=wa(mouse_x);mouse_y=wa(mouse_y)}if(!F){F=document.createElementNS(c,"path");ma(F,{id:"path_stretch_line",stroke:"#22C","stroke-width":"0.5",fill:"none"});F=qa("selectorParentGroup").appendChild(F)}F.setAttribute("display",
+"inline");var E=null;if(w){E=w.pathSegList;for(var G=E.numberOfItems,L=6/o,k=false;G;){G--;var u=E.getItem(G),C=u.x;u=u.y;if(I>=C-L&&I<=C+L&&v>=u-L&&v<=u+L){k=true;break}}L=ca();svgedit.path.removePath_(L);L=qa(L);C=E.numberOfItems;if(k){if(G<=1&&C>=2){I=E.getItem(0).x;v=E.getItem(0).y;A=F.pathSegList.getItem(1);A=A.pathSegType===4?w.createSVGPathSegLinetoAbs(I,v):w.createSVGPathSegCurvetoCubicAbs(I,v,A.x1/o,A.y1/o,I,v);I=w.createSVGPathSegClosePath();E.appendItem(A);E.appendItem(I)}else if(C<3)return E=
+false;$(F).remove();element=L;w=null;La=false;if(e){svgedit.path.path.matrix&&db(L,{},svgedit.path.path.matrix.inverse());F=L.getAttribute("d");A=$(svgedit.path.path.elem).attr("d");$(svgedit.path.path.elem).attr("d",A+F);$(L).remove();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();svgedit.path.path.init();Ja.toEditMode(svgedit.path.path.elem);svgedit.path.path.selectPt();return false}}else{if(!$.contains(a,Ib(A))){console.log("Clicked outside canvas");return false}E=w.pathSegList.numberOfItems;
+G=w.pathSegList.getItem(E-1);L=G.x;G=G.y;if(A.shiftKey){A=ba(L,G,I,v);I=A.x;v=A.y}A=F.pathSegList.getItem(1);A=A.pathSegType===4?w.createSVGPathSegLinetoAbs(eb(I),eb(v)):w.createSVGPathSegCurvetoCubicAbs(eb(I),eb(v),A.x1/o,A.y1/o,A.x2/o,A.y2/o);w.pathSegList.appendItem(A);I*=o;v*=o;F.setAttribute("d",["M",I,v,I,v].join(" "));F=E;if(e)F+=svgedit.path.path.segs.length;svgedit.path.addPointGrip(F,I,v)}}else{d_attr="M"+I+","+v+" ";w=Q({element:"path",curStyles:true,attr:{d:d_attr,id:ja(),opacity:M.opacity/
+2}});F.setAttribute("d",["M",mouse_x,mouse_y,mouse_x,mouse_y].join(" "));F=e?svgedit.path.path.segs.length:0;svgedit.path.addPointGrip(F,mouse_x,mouse_y)}}else if(svgedit.path.path){svgedit.path.path.storeD();L=A.target.id;if(L.substr(0,14)=="pathpointgrip_"){v=svgedit.path.path.cur_pt=parseInt(L.substr(14));svgedit.path.path.dragging=[F,I];E=svgedit.path.path.segs[v];if(A.shiftKey)E.selected?svgedit.path.path.removePtFromSelection(v):svgedit.path.path.addPtsToSelection(v);else{if(svgedit.path.path.selected_pts.length<=
+1||!E.selected)svgedit.path.path.clearSelection();svgedit.path.path.addPtsToSelection(v)}}else if(L.indexOf("ctrlpointgrip_")==0){svgedit.path.path.dragging=[F,I];A=L.split("_")[1].split("c");v=A[0]-0;svgedit.path.path.selectPt(v,A[1]-0)}if(!svgedit.path.path.dragging){if(ua==null)ua=Ha.getRubberBandBox();ma(ua,{x:F*o,y:I*o,width:0,height:0,display:"inline"},100)}}},mouseMove:function(A,v,F){H=true;if(Ea==="path"){if(w){var I=w.pathSegList;A=I.numberOfItems-1;if(m){var E=svgedit.path.addCtrlGrip("1c1"),
+G=svgedit.path.addCtrlGrip("0c2");G.getAttribute("cx");G.getAttribute("cy");E.setAttribute("cx",v);E.setAttribute("cy",F);E.setAttribute("display","inline");E=m[0];var L=m[1];I.getItem(A);var k=E+(E-v/o),u=L+(L-F/o);G.setAttribute("cx",k*o);G.setAttribute("cy",u*o);G.setAttribute("display","inline");G=svgedit.path.getCtrlLine(1);var C=svgedit.path.getCtrlLine(2);ma(G,{x1:v,y1:F,x2:E*o,y2:L*o,display:"inline"});ma(C,{x1:k*o,y1:u*o,x2:E*o,y2:L*o,display:"inline"});if(A===0)z=[v,F];else{I=I.getItem(A-
+1);v=I.x;F=I.y;if(I.pathSegType===6){v+=v-I.x2;F+=F-I.y2}else if(z){v=z[0]/o;F=z[1]/o}svgedit.path.replacePathSeg(6,A,[E,L,v,F,k,u],w)}}else if(E=qa("path_stretch_line")){A=I.getItem(A);if(A.pathSegType===6)svgedit.path.replacePathSeg(6,1,[v,F,(A.x+(A.x-A.x2))*o,(A.y+(A.y-A.y2))*o,v,F],E);else z?svgedit.path.replacePathSeg(6,1,[v,F,z[0],z[1],v,F],E):svgedit.path.replacePathSeg(4,1,[v,F],E)}}}else if(svgedit.path.path.dragging){E=svgedit.path.getPointFromGrip({x:svgedit.path.path.dragging[0],y:svgedit.path.path.dragging[1]},
+svgedit.path.path);L=svgedit.path.getPointFromGrip({x:v,y:F},svgedit.path.path);A=L.x-E.x;E=L.y-E.y;svgedit.path.path.dragging=[v,F];svgedit.path.path.dragctrl?svgedit.path.path.moveCtrl(A,E):svgedit.path.path.movePts(A,E)}else{svgedit.path.path.selected_pts=[];svgedit.path.path.eachSeg(function(){if(this.next||this.prev){var D=ua.getBBox(),P=svgedit.path.getGripPt(this);D=svgedit.math.rectsIntersect(D,{x:P.x,y:P.y,width:0,height:0});this.select(D);D&&svgedit.path.path.selected_pts.push(this.index)}})}},
+mouseUp:function(A,v){if(Ea==="path"){m=null;if(!w){v=qa(ca());La=false;z=null}return{keep:true,element:v}}if(svgedit.path.path.dragging){var F=svgedit.path.path.cur_pt;svgedit.path.path.dragging=false;svgedit.path.path.dragctrl=false;svgedit.path.path.update();H&&svgedit.path.path.endChanges("Move path point(s)");!A.shiftKey&&!H&&svgedit.path.path.selectPt(F)}else if(ua&&ua.getAttribute("display")!="none"){ua.setAttribute("display","none");ua.getAttribute("width")<=2&&ua.getAttribute("height")<=
+2&&Ja.toSelectMode(A.target)}else Ja.toSelectMode(A.target);H=false},toEditMode:function(A){svgedit.path.path=svgedit.path.getPath_(A);Ea="pathedit";Qa();svgedit.path.path.show(true).update();svgedit.path.path.oldbbox=svgedit.utilities.getBBox(svgedit.path.path.elem);e=false},toSelectMode:function(A){var v=A==svgedit.path.path.elem;Ea="select";svgedit.path.path.show(false);h=false;Qa();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();if(v){N("selected",[A]);vb([A],true)}},addSubPath:function(A){if(A){Ea=
+"path";e=true}else{Ja.clear(true);Ja.toEditMode(svgedit.path.path.elem)}},select:function(A){if(h===A){Ja.toEditMode(A);Ea="pathedit"}else h=A},reorient:function(){var A=J[0];if(A)if(oa(A)!=0){var v=new za("Reorient path"),F={d:A.getAttribute("d"),transform:A.getAttribute("transform")};v.addSubCommand(new Na(A,F));Qa();this.resetOrientation(A);ya(v);svgedit.path.getPath_(A).show(false).matrix=null;this.clear();vb([A],true);N("changed",J)}},clear:function(){h=null;if(w){var A=qa(ca());$(qa("path_stretch_line")).remove();
+$(A).remove();$(qa("pathpointgrip_container")).find("*").attr("display","none");w=z=null;La=false}else Ea=="pathedit"&&this.toSelectMode();svgedit.path.path&&svgedit.path.path.init().show(false)},resetOrientation:function(A){if(A==null||A.nodeName!="path")return false;var v=X(A),F=fa(v).matrix;v.clear();A.removeAttribute("transform");v=A.pathSegList;for(var I=v.numberOfItems,E=0;E0){L=I.getItem(E-1).pathSegType;if(L===2){G(E-1,1);F();break}else if(L===1&&I.numberOfItems-1===E){G(E,1);F();break}}}return false};F();if(svgedit.path.path.elem.pathSegList.numberOfItems<=1){Ja.toSelectMode(svgedit.path.path.elem);
+b.deleteSelectedElements()}else{svgedit.path.path.init();svgedit.path.path.clearSelection();if(window.opera){A=$(svgedit.path.path.elem);A.attr("d",A.attr("d"))}svgedit.path.path.endChanges("Delete path node(s)")}}},smoothPolylineIntoPath:function(A){var v=A.points,F=v.numberOfItems;if(F>=4){var I=v.getItem(0),E=null;A=[];A.push(["M",I.x,",",I.y," C"].join(""));for(var G=1;G<=F-4;G+=3){var L=v.getItem(G),k=v.getItem(G+1),u=v.getItem(G+2);if(E)if((I=svgedit.path.smoothControlPoints(E,L,I))&&I.length==
+2){L=A[A.length-1].split(",");L[2]=I[0].x;L[3]=I[0].y;A[A.length-1]=L.join(",");L=I[1]}A.push([L.x,L.y,k.x,k.y,u.x,u.y].join(","));I=u;E=k}for(A.push("L");G0;);Ja.clear(true);$.each(l.childNodes,function(m,z){m&&z.nodeType===8&&z.data.indexOf("Created with")>=0&&l.insertBefore(z,l.firstChild)});if(K){Jb();xb([K])}var e=
+[];$(l).find("g:data(gsvg)").each(function(){for(var m=this.attributes,z=m.length,w=0;w=0;F--){v=A.item(F);G=z(v.nodeValue);if(!(L.indexOf(v.localName)>=0))if(G!="")if(G.indexOf("pointer-events")!==0)if(!(v.localName==="class"&&G.indexOf("se_")===0)){m.push(" ");if(v.localName==="d")G=Ja.convertPath(e,true);if(isNaN(G)){if(H.test(G))G=
-svgedit.units.shortFloat(G)+w}else G=svgedit.units.shortFloat(G);if(fb.apply&&e.nodeName==="image"&&v.localName==="href"&&fb.images&&fb.images==="embed"){var k=Ra[G];if(k)G=k}if(!v.namespaceURI||v.namespaceURI==c||Aa[v.namespaceURI]){m.push(v.nodeName);m.push('="');m.push(G);m.push('"')}}}}if(e.hasChildNodes()){m.push(">");h++;A=false;for(F=0;F");h++;A=false;for(F=0;F");break;case 8:m.push("\n");m.push(Array(h+1).join(" "));m.push("
@@ -101,6 +102,8 @@ $(function(){
@@ -108,8 +111,8 @@ $(function(){
diff --git a/method-draw/svg-editor.js b/method-draw/svg-editor.js
index bf9814e..e918348 100644
--- a/method-draw/svg-editor.js
+++ b/method-draw/svg-editor.js
@@ -240,11 +240,11 @@
'spapelib':'shapelib.png',
'node_delete':'node_delete.png',
'align_left':'align-left.png',
- 'align_center':'align-center',
- 'align_right':'align-right',
- 'align_top':'align-top',
- 'align_middle':'align-middle',
- 'align_bottom':'align-bottom',
+ 'align_center':'align-center.png',
+ 'align_right':'align-right.png',
+ 'align_top':'align-top.png',
+ 'align_middle':'align-middle.png',
+ 'align_bottom':'align-bottom.png',
'arrow_right':'flyouth.png',
'arrow_down':'dropdown.gif'
},
@@ -1005,17 +1005,16 @@
var icon;
var id = btn.id;
var num = i;
-
// Give button a unique ID
while($('#'+id).length) {
id = btn.id + '_' + (++num);
}
-
if(!svgicons) {
icon = (btn.type == "menu") ? "" : $('');
} else {
fallback_obj[id] = btn.icon;
- var svgicon = btn.svgicon?btn.svgicon:btn.id;
+ var svgicon = btn.svgicon ? btn.svgicon : btn.id;
+ console.log(svgicon);
if(btn.type == 'app_menu') {
placement_obj['#' + id + ' > div'] = svgicon;
} else {
@@ -1391,6 +1390,7 @@
//hack to show the proper multialign box
if (multiselected) {
+ multiselected = multiselected.filter(Boolean)
elem = (svgCanvas.elementsAreSame(multiselected)) ? multiselected[0] : null
if (elem) $("#tools_top").addClass("multiselected")
}
@@ -1534,20 +1534,14 @@
});
if(el_name == 'text') {
+ var font_family = elem.getAttribute("font-family");
+ var select = document.getElementById("font_family_dropdown");
+ select.selectedIndex = 3
+
$('#text_panel').css("display", "inline");
- if (svgCanvas.getItalic()) {
- $('#tool_italic').addClass('push_button_pressed').removeClass('tool_button');
- }
- else {
- $('#tool_italic').removeClass('push_button_pressed').addClass('tool_button');
- }
- if (svgCanvas.getBold()) {
- $('#tool_bold').addClass('push_button_pressed').removeClass('tool_button');
- }
- else {
- $('#tool_bold').removeClass('push_button_pressed').addClass('tool_button');
- }
- $('#font_family').val(elem.getAttribute("font-family"));
+ $('#tool_italic').toggleClass('active', svgCanvas.getItalic())
+ $('#tool_bold').toggleClass('active', svgCanvas.getBold())
+ $('#font_family').val(font_family);
$('#font_size').val(elem.getAttribute("font-size"));
$('#text').val(elem.textContent);
if (svgCanvas.addedNew) {
@@ -1889,17 +1883,12 @@
top.exports.setEditorFocus();
}
}
- if (!$(e.target).hasClass("menu_title") && !$(e.target).parent().hasClass("menu_title")) {
- if(!$(e.target).hasClass("disabled") && $(e.target).hasClass("menu_item")) {
- blinker(e);
- return;
- }
- else {
- $('#menu_bar').removeClass('active')
- }
-
- }
-
+ if (e.target.nodeName.toLowerCase() === "input") return false;
+ if (!$(e.target).hasClass("menu_title") && !$(e.target).parent().hasClass("menu_title")) {
+ if(!$(e.target).hasClass("disabled") && $(e.target).hasClass("menu_item")) blinker(e)
+ else $('#menu_bar').removeClass('active')
+
+ }
}
diff --git a/method-draw/svgcanvas.js b/method-draw/svgcanvas.js
index b51a118..e328e0c 100644
--- a/method-draw/svgcanvas.js
+++ b/method-draw/svgcanvas.js
@@ -2216,13 +2216,8 @@ var addToSelection = this.addToSelection = function(elemsToAdd, showGrips) {
}
}
call("selected", selectedElements);
-
- if (showGrips || selectedElements.length == 1) {
- selectorManager.requestSelector(selectedElements[0]).showGrips(true);
- }
- else {
- selectorManager.requestSelector(selectedElements[0]).showGrips(false);
- }
+ if (showGrips || selectedElements.length == 1) selectorManager.requestSelector(selectedElements[0]).showGrips(true)
+ else selectorManager.requestSelector(selectedElements[0]).showGrips(false);
// make sure the elements are in the correct order
// See: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-compareDocumentPosition
@@ -2801,16 +2796,17 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
// alt drag = create a clone and save the reference
if(evt.altKey) {
//clone doesn't exist yet
- if (!canvas.addClone) {
- canvas.addClone = canvas.cloneSelectedElements(0,0, xform);
- canvas.removeClone = function(){
- parent = canvas.addClone.parentNode
- if (parent) {
- parent.removeChild(canvas.addClone)
- canvas.addClone = false;
+ if (!canvas.addClones) {
+ canvas.addClones = canvas.cloneSelectedElements(0,0, xform);
+ canvas.removeClones = function(){
+ if (canvas.addClones) {
+ canvas.addClones.forEach(function(clone){
+ if (clone.parentNode) clone.parentNode.removeChild(clone)
+ canvas.addClones = false;
+ })
}
}
- window.addEventListener("keyup", canvas.removeClone)
+ window.addEventListener("keyup", canvas.removeClones)
}
}
@@ -3209,8 +3205,8 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
// this is done in when we recalculate the selected dimensions()
var mouseUp = function(evt)
{
- canvas.addClone = false;
- window.removeEventListener("keyup", canvas.removeClone)
+ canvas.addClones = false;
+ window.removeEventListener("keyup", canvas.removeClones)
if(evt.button === 2) return;
var tempJustSelected = justSelected;
@@ -3887,9 +3883,11 @@ var textActions = canvas.textActions = function() {
},
setCursor: setCursor,
toEditMode: function(x, y) {
+ selectOnly([curtext], false)
allow_dbl = false;
current_mode = "textedit";
- selectorManager.requestSelector(curtext).showGrips(false);
+ //selectorManager.requestSelector(curtext).showGrips(false);
+
// Make selector group accept clicks
var sel = selectorManager.requestSelector(curtext).selectorRect;
@@ -8582,21 +8580,28 @@ this.cloneSelectedElements = function(x,y, drag) {
// note that we loop in the reverse way because of the way elements are added
// to the selectedElements array (top-first)
var i = copiedElements.length;
+ clones = []
while (i--) {
// clone each element and replace it within copiedElements
var elem = copiedElements[i]
var clone = copyElem(copiedElements[i]);
- if (drag) clone.setAttribute("transform", "");
+ if (drag) {
+ //removed the dragged transform until that moment
+ tlist = getTransformList(clone)
+ tlist.removeItem(drag)
+ recalculateDimensions(clone)
+ }
(current_group || getCurrentDrawing().getCurrentLayer()).appendChild(clone);
+ clones.push(clone)
batchCmd.addSubCommand(new InsertElementCommand(clone));
}
if (!batchCmd.isEmpty()) {
addToSelection(copiedElements.reverse()); // Need to reverse for correct selection-adding
- this.moveSelectedElements(x,y,false);
+ if (!drag) this.moveSelectedElements(x,y,false);
addCommandToHistory(batchCmd);
}
- return clone
+ return clones
};
// Function: alignSelectedElements
diff --git a/method-draw/svgedit.compiled.js b/method-draw/svgedit.compiled.js
index 9123b18..61f8012 100644
--- a/method-draw/svgedit.compiled.js
+++ b/method-draw/svgedit.compiled.js
@@ -1,18 +1,18 @@
function touchHandler(a){var p=a.changedTouches,g=p[0],c="";switch(a.type){case "touchstart":c="mousedown";break;case "touchmove":c="mousemove";break;case "touchend":c="mouseup";break;default:return}var n=document.createEvent("MouseEvent");n.initMouseEvent(c,true,true,window,1,g.screenX,g.screenY,g.clientX,g.clientY,false,false,false,false,0,null);if(p.length<2){g.target.dispatchEvent(n);a.preventDefault()}};(function(a){function p(g){if(typeof g.data==="string"){var c=g.handler,n=g.data.toLowerCase().split(" ");g.handler=function(s){if(!(this!==s.target&&(/textarea|select/i.test(s.target.nodeName)||s.target.type==="text"))){var b=s.type!=="keypress"&&a.hotkeys.specialKeys[s.which],f=String.fromCharCode(s.which).toLowerCase(),d="",l={};if(s.altKey&&b!=="alt")d+="alt+";if(s.ctrlKey&&b!=="ctrl")d+="ctrl+";if(s.metaKey&&!s.ctrlKey&&b!=="meta")d+="meta+";if(s.shiftKey&&b!=="shift")d+="shift+";if(b)l[d+b]=
true;else{l[d+f]=true;l[d+a.hotkeys.shiftNums[f]]=true;if(d==="shift+")l[a.hotkeys.shiftNums[f]]=true}b=0;for(f=n.length;b","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:p}})})(jQuery);(function(a,p){function g(da){return typeof da==="string"}function c(da){var V=d.call(arguments,1);return function(){return da.apply(this,V.concat(d.call(arguments)))}}function n(da,V,Z,oa,qa){var ma;if(oa!==f){V=Z.match(da?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);Z=V[3]||"";if(qa===2&&g(oa))oa=oa.replace(da?W:ba,"");else{ma=o(V[2]);oa=g(oa)?o[da?ia:O](oa):oa;oa=qa===2?oa:qa===1?a.extend({},oa,ma):a.extend({},ma,oa);oa=q(oa);if(da)oa=oa.replace(sa,l)}da=V[1]+(da?"#":oa||!V[1]?"?":"")+oa+Z}else da=
-V(Z!==f?Z:p[pa][fa]);return da}function s(da,V,Z){if(V===f||typeof V==="boolean"){Z=V;V=q[da?ia:O]()}else V=g(V)?V.replace(da?W:ba,""):V;return o(V,Z)}function b(da,V,Z,oa){if(!g(Z)&&typeof Z!=="object"){oa=Z;Z=V;V=f}return this.each(function(){var qa=a(this),ma=V||Q()[(this.nodeName||"").toLowerCase()]||"",na=ma&&qa.attr(ma)||"";qa.attr(ma,q[da](na,Z,oa))})}var f,d=Array.prototype.slice,l=decodeURIComponent,q=a.param,B,o,K,T=a.bbq=a.bbq||{},M,J,Q,Y=a.event.special,O="querystring",ia="fragment",pa=
+V(Z!==f?Z:p[pa][fa]);return da}function s(da,V,Z){if(V===f||typeof V==="boolean"){Z=V;V=q[da?ia:O]()}else V=g(V)?V.replace(da?W:ba,""):V;return o(V,Z)}function b(da,V,Z,oa){if(!g(Z)&&typeof Z!=="object"){oa=Z;Z=V;V=f}return this.each(function(){var qa=a(this),ma=V||Q()[(this.nodeName||"").toLowerCase()]||"",na=ma&&qa.attr(ma)||"";qa.attr(ma,q[da](na,Z,oa))})}var f,d=Array.prototype.slice,l=decodeURIComponent,q=a.param,B,o,K,T=a.bbq=a.bbq||{},M,J,Q,X=a.event.special,O="querystring",ia="fragment",pa=
"location",fa="href",ba=/^.*\?|#.*$/g,W=/^.*\#/,sa,ka={};q[O]=c(n,0,function(da){return da.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});q[ia]=B=c(n,1,function(da){return da.replace(/^[^#]*#?(.*)$/,"$1")});B.noEscape=function(da){da=da||"";da=a.map(da.split(""),encodeURIComponent);sa=RegExp(da.join("|"),"g")};B.noEscape(",/");a.deparam=o=function(da,V){var Z={},oa={"true":true,"false":false,"null":null};a.each(da.replace(/\+/g," ").split("&"),function(qa,ma){var na=ma.split("="),Aa=l(na[0]),Fa=Z,Ia=
0,Ca=Aa.split("]["),Ka=Ca.length-1;if(/\[/.test(Ca[0])&&/\]$/.test(Ca[Ka])){Ca[Ka]=Ca[Ka].replace(/\]$/,"");Ca=Ca.shift().split("[").concat(Ca);Ka=Ca.length-1}else Ka=0;if(na.length===2){na=l(na[1]);if(V)na=na&&!isNaN(na)?+na:na==="undefined"?f:oa[na]!==f?oa[na]:na;if(Ka)for(;Ia<=Ka;Ia++){Aa=Ca[Ia]===""?Fa.length:Ca[Ia];Fa=Fa[Aa]=Ia').hide().insertAfter("body")[0].contentWindow;
-J=function(){return c(T.document[b][f])};M=function(Q,Y){if(Q!==Y){var O=T.document;O.open().close();O[b].hash="#"+Q}};M(c())}}var o={},K,T,M,J;o.start=function(){if(!K){var Q=c();M||B();(function Y(){var O=c(),ia=J(Q);if(O!==Q){M(Q=O,ia);a(p).trigger("hashchange")}else if(ia!==Q)p[b][f]=p[b][f].replace(/#.*/,"")+"#"+ia;K=setTimeout(Y,a.hashchangeDelay)})()}};o.stop=function(){if(!T){K&&clearTimeout(K);K=0}};return o}()})(jQuery,this);(function(a){var p={},g;a.svgIcons=function(c,n){function s(da,V){if(da!=="ajax"){if(Q)return;var Z=(T=fa[0].contentDocument)&&T.getElementById("svg_eof");if(!Z&&!(V&&Z)){Y++;if(Y<50)setTimeout(s,20);else{f();Q=true}return}Q=true}K=a(T.firstChild).children();if(n.no_img)setTimeout(function(){J||b()},500);else{Z=pa+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:Z,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}}
+J=function(){return c(T.document[b][f])};M=function(Q,X){if(Q!==X){var O=T.document;O.open().close();O[b].hash="#"+Q}};M(c())}}var o={},K,T,M,J;o.start=function(){if(!K){var Q=c();M||B();(function X(){var O=c(),ia=J(Q);if(O!==Q){M(Q=O,ia);a(p).trigger("hashchange")}else if(ia!==Q)p[b][f]=p[b][f].replace(/#.*/,"")+"#"+ia;K=setTimeout(X,a.hashchangeDelay)})()}};o.stop=function(){if(!T){K&&clearTimeout(K);K=0}};return o}()})(jQuery,this);(function(a){var p={},g;a.svgIcons=function(c,n){function s(da,V){if(da!=="ajax"){if(Q)return;var Z=(T=fa[0].contentDocument)&&T.getElementById("svg_eof");if(!Z&&!(V&&Z)){X++;if(X<50)setTimeout(s,20);else{f();Q=true}return}Q=true}K=a(T.firstChild).children();if(n.no_img)setTimeout(function(){J||b()},500);else{Z=pa+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:Z,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}}
function b(da,V){if(!J){if(n.no_img)da=false;if(da){var Z=a(document.createElement("div"));Z.hide().appendTo("body")}if(V){var oa=n.fallback_path?n.fallback_path:"";a.each(V,function(Ka,Na){a("#"+Ka);var za=a(new Image).attr({"class":"svg_icon",src:oa+Na,width:B,height:o,alt:"icon"});ka(za,Ka)})}else for(var qa=K.length,ma=0;ma0&&!da)ya=g(ya,za,true);sa(a(this),ya,Na)})});if(!V){da&&Z.remove();fa&&fa.remove();M&&M.remove()}n.resize&&a.resizeSvgIcons(n.resize);J=true;n.callback&&n.callback(p)}}function f(){if(c.indexOf(".svgz")!=-1){var da=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(da,n)}else n.fallback&&b(false,n.fallback)}
function d(da){if(window.btoa)return window.btoa(da);var V=Array(Math.floor((da.length+2)/3)*4),Z,oa,qa,ma,na,Aa,Fa=0,Ia=0;do{Z=da.charCodeAt(Fa++);oa=da.charCodeAt(Fa++);qa=da.charCodeAt(Fa++);ma=Z>>2;Z=(Z&3)<<4|oa>>4;na=(oa&15)<<2|qa>>6;Aa=qa&63;if(isNaN(oa))na=Aa=64;else if(isNaN(qa))Aa=64;V[Ia++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(ma);V[Ia++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Z);V[Ia++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(na);
-V[Ia++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Aa)}while(Fa-1&&O.indexOf("Chrome/");var pa="data:image/svg+xml;charset=utf-8;base64,";if(n.svgz){var fa=a('