-
Notifications
You must be signed in to change notification settings - Fork 1
/
777cf710-7df4cff8823f19a3d8fb.js.map
1 lines (1 loc) · 370 KB
/
777cf710-7df4cff8823f19a3d8fb.js.map
1
{"version":3,"sources":["webpack:///./node_modules/snapsvg-cjs/dist/snap.svg-cjs.js"],"names":["window","eve","mina","requestID","animations","requestAnimFrame","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","callback","setTimeout","Date","getTime","isArray","Array","a","Object","prototype","toString","call","idgen","idprefix","timer","now","sta","val","this","s","ds","b","dur","B","speed","spd","duration","stopit","id","update","pause","pdif","get","resume","frame","res","start","j","jj","length","end","easing","set","timeStamp","len","i","hasOwnProperty","A","anim","linear","status","stop","time","getById","n","easeout","Math","pow","easein","easeinout","q","Q","sqrt","x","y","t","abs","backin","backout","elastic","sin","PI","bounce","p","Snap","root","w","h","nodeType","wrap","is","apply","Element","glob","doc","querySelector","String","e","Paper","version","_","win","document","tokenRegex","objNotationRegex","has","Str","toFloat","parseFloat","toInt","parseInt","math","mmax","max","mmin","min","objectToString","round","colourRegExp","commaSpaces","separator","hsrg","hs","rg","pathCommand","tCommand","pathValues","ID","el","type","xlink","xmlns","hub","url","$","attr","createTextNode","text","createComment","substring","getAttributeNS","getAttribute","nodeValue","key","setAttributeNS","setAttribute","removeAttribute","createElementNS","o","toLowerCase","isFinite","slice","repush","array","item","ii","push","splice","cacher","f","scope","postprocessor","newf","arg","arguments","args","join","cache","count","shift","rad","deg","format","str","obj","replace","all","name","quote","quotedName","isFunc","replacer","clone","constructor","angle","tan","cos","asin","num","acos","atan","atan2","x1","y1","x2","y2","x3","y3","len2","closestPoint","path","distance2","dx","dy","best","bestLength","scan","scanDistance","pathNode","node","pathLength","getTotalLength","precision","pathSegList","numberOfItems","bestDistance","Infinity","scanLength","getPointAtLength","before","after","beforeLength","afterLength","beforeDistance","afterDistance","distance","snapTo","values","value","tolerance","rem","getRGB","colour","indexOf","r","g","hex","error","rgbtoString","charAt","_toHex","red","green","blue","opacity","rgb","match","split","hsb2rgb","hsl2rgb","hsb","hsl","l","toFixed","color","getElementsByTagName","style","out","defaultView","getComputedStyle","getPropertyValue","hsbtoString","hsltoString","prepareRGB","string","clr","packageRGB","rgb2hsl","rgb2hsb","v","R","G","X","C","V","L","M","m","parsePathString","pathString","pth","arr","paramCounts","c","u","z","data","params","concat","parseTransformString","TString","svgTransform2string","tstr","rgTransform","transform2matrix","bbox","tdata","Matrix","bb","tlen","command","absolute","inver","invert","translate","rotate","width","height","scale","add","_unit2px","svg","getSomeSVG","mgr","fill","appendChild","getW","getBBox","getH","nam","removeChild","contains","compareDocumentPosition","ownerSVGElement","select","add2group","list","forEach","children","childNodes","snap","paper","tagName","nodeName","anims","transform","mask","pattern","symbol","method","Fragment","frag","make","parent","desc","defs","proto","ownerDocument","body","dom","contentDocument","getSomeDefs","parentNode","pdefs","query","selectAll","nodelist","querySelectorAll","setInterval","attributes","firstDefined","json","att","parse","createDocumentFragment","full","div","createElement","innerHTML","firstChild","fragment","ch","toJSON","jsonFiller","on","nt","css","lastIndexOf","letter","cssAttr","toUpperCase","ajax","postData","req","XMLHttpRequest","pd","encodeURIComponent","open","setRequestHeader","once","onreadystatechange","readyState","send","load","responseText","getElementByPoint","canvas","elem","box","docElem","clientTop","clientLeft","target","elementFromPoint","opera","so","getBoundingClientRect","documentElement","top","pageYOffset","scrollTop","left","pageXOffset","scrollLeft","sr","createSVGRect","hits","getIntersectionList","plugin","elproto","unit2px","isWithoutTransform","getClientRects","removed","localMatrix","original","href","getElementById","pathfinder","deflt","bboxwt","realPath","matrix","map","propString","extractTransform","doReturn","test","papa","global","getCTM","local","ms","localString","toTransformString","globalMatrix","totalMatrix","diffMatrix","total","gradientTransform","patternTransform","append","it","appendTo","prepend","first","insertBefore","prependTo","nextSibling","insertAfter","remove","asPX","use","cloneNode","els","ids","uses","urltest","linktest","oldid","old","fs","fixids","toDefs","toPattern","patternUnits","viewBox","marker","refX","refY","cx","cy","markerWidth","markerHeight","orient","eldata","chld","removeData","outerSVG","innerSVG","toDataURL","btoa","contents","unescape","d","matrixproto","norm","normalize","mag","aNew","bNew","multLeft","cNew","eNew","me","skewX","skew","skewY","fromCharCode","offset","determinant","row","scalex","shear","scaley","isSimple","isSuperSimple","noRotation","shorter","clipIt","reURLValue","URL","fillStroke","grad","gradient","attrs","deurl","clip","undefined","gradrg","setFontSize","fontSize","getFontSize","tokens","stops","seed","step","k","toAbsolute","txt","className","baseVal","vb","rx","ry","tp","textPath","tuned","tuner","chunk","getter","setter","textExtract","chi","textContent","internal","rgNotSpace","addClass","clazz","finalValue","classes","curClasses","removeClass","pos","hasClass","toggleClass","flag","operators","reUnit","reAddon","getNumber","getUnit","unit","plus","evnt","atr","aUnit","op","isNaN","bplus","from","to","rect","circle","preload","onerror","src","img","cssText","onload","image","preserveAspectRatio","offsetWidth","offsetHeight","ellipse","group","vbx","vby","vbw","vbh","ptrn","vx","vy","vw","vh","line","polyline","points","polygon","Gstops","GaddStop","inserted","GgetBBox","GsetStops","addStop","gradientLinear","setStops","gradientRadial","fx","fy","unshift","gradientUnits","clear","next","p2s","paths","ps","sleep","r1","r2","r0","rectPath","pathClone","pathArray","getPointAtSegmentLength","p1x","p1y","c1x","c1y","c2x","c2y","p2x","p2y","bezlen","findDotsAtSegment","x4","y4","ll","t2","getTotLen","getLengthFactory","istotal","subpath","O","onlystart","point","sp","subpaths","path2curve","getSubpathsAtLength","t1","t13","t12","t3","mx","my","nx","ny","alpha","bezierBBox","curveDim","isPointInsideBBox","isBBoxIntersect","bbox1","bbox2","base3","p1","p2","p3","p4","z2","Tvalues","Cvalues","sum","ct","xbase","ybase","comb","intersect","denominator","px","py","px2","py2","interHelper","bez1","bez2","justCount","n1","n2","dots1","dots2","xy","di","di1","dj","dj1","ci","cj","interPathHelper","path1","path2","x1m","y1m","x2m","y2m","pi","pj","intr","kk","segment1","segment2","pathBBox","Y","dim","xmin","ymin","ellipsePath","getPath","pathToAbsolute","pa0","pa","crz","dots","pop","catmullRom2bezier","l2c","q2c","ax","ay","a2c","large_arc_flag","sweep_flag","recursive","_120","f1","f2","rx2","ry2","df","f2old","x2old","y2old","c1","s1","c2","s2","hx","hy","m1","m2","m3","m4","newres","x0","y0","b2ac","sqrtb2ac","tvalues","bounds","mt","jlen","curve","bx","by","qx","qy","attrs2","processPath","pcom","T","fixArc","pp","pcoms1","pcoms2","fixM","a1","a2","pfirst","seg","seg2","seglen","seg2len","crp","iLen","getSubpath","closest","inside","found","intersection","intersectionNumber","isPointInside","toRelative","lowerCase","rel","toCubic","pathi","Set","items","bindings","setproto","thisArg","animate","Animation","each","begin","handler","cb","callbacker","bind","aname","unbound","index","insertion","tail","todel","arglen","exclude","names","getEmpty","getViewBox","getColour","Function","path2array","isNumeric","stroke","equal","Number","tt1","tt2","maxlength","equaliseTransform","arr1","arr2","bUnit","supportsTouch","events","touchMap","mousedown","mousemove","mouseup","getScroll","preventTouch","originalEvent","preventDefault","stopTouch","stopPropagation","addEvent","fn","element","realName","scrollY","scrollX","targetTouches","olde","clientX","clientY","addEventListener","removeEventListener","drag","dragMove","dragi","touch","touches","identifier","_drag","display","move_scope","dragUp","unmousemove","unmouseup","end_scope","start_scope","off","eventName","unbind","hover","f_in","f_out","scope_in","scope_out","mouseover","mouseout","unhover","unmouseover","unmouseout","draggable","onmove","onstart","onend","origTransform","init","undrag","unmousedown","pproto","rgurl","filter","filstr","filterUnits","blur","def","shadow","grayscale","amount","sepia","saturate","hueRotate","amount2","brightness","contrast","firstLetter","getAlign","way","align","animation","inAnim","_attrs","_callback","curStatus","eq","fkeys","tkeys","keys","saveColor","colors","A100","A200","A400","A700","mui","flat","pink","purple","deeppurple","indigo","lightblue","cyan","teal","lightgreen","lime","yellow","amber","orange","deeporange","brown","grey","bluegrey","turquoise","greensea","sunflower","emerland","nephritis","carrot","pumpkin","peterriver","belizehole","alizarin","pomegranate","amethyst","wisteria","clouds","silver","wetasphalt","midnightblue","concrete","asbestos","importMUICol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Kw1B,KAAKiC,aAAe,UACzBz3B,EAAKw1B,KAAKkC,SAAW,UACrB13B,EAAKw1B,KAAKmC,SAAW,UAWrB33B,EAAK43B,gBAAkB,WACrB,IAAK,IAAIltB,KAAS1K,EAAKu1B,IACjBv1B,EAAKu1B,IAAIn3B,eAAesM,KAC1B9P,OAAO8P,GAAS1K,EAAKu1B,IAAI7qB,QAKjCmtB,EAAOC,QAAU93B","file":"777cf710-7df4cff8823f19a3d8fb.js","sourcesContent":["require(\"core-js/modules/es.array.flat\");\n\nrequire(\"core-js/modules/es.array.unscopables.flat\");\n\nwindow.eve = require('eve'); // Copyright (c) 2017 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nvar mina = function (eve) {\n var animations = {},\n requestAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {\n setTimeout(callback, 16, new Date().getTime());\n return true;\n },\n requestID,\n isArray = Array.isArray || function (a) {\n return a instanceof Array || Object.prototype.toString.call(a) == \"[object Array]\";\n },\n idgen = 0,\n idprefix = \"M\" + (+new Date()).toString(36),\n ID = function ID() {\n return idprefix + (idgen++).toString(36);\n },\n diff = function diff(a, b, A, B) {\n if (isArray(a)) {\n res = [];\n\n for (var i = 0, ii = a.length; i < ii; i++) {\n res[i] = diff(a[i], b, A[i], B);\n }\n\n return res;\n }\n\n var dif = (A - a) / (B - b);\n return function (bb) {\n return a + dif * (bb - b);\n };\n },\n timer = Date.now || function () {\n return +new Date();\n },\n sta = function sta(val) {\n var a = this;\n\n if (val == null) {\n return a.s;\n }\n\n var ds = a.s - val;\n a.b += a.dur * ds;\n a.B += a.dur * ds;\n a.s = val;\n },\n speed = function speed(val) {\n var a = this;\n\n if (val == null) {\n return a.spd;\n }\n\n a.spd = val;\n },\n duration = function duration(val) {\n var a = this;\n\n if (val == null) {\n return a.dur;\n }\n\n a.s = a.s * val / a.dur;\n a.dur = val;\n },\n stopit = function stopit() {\n var a = this;\n delete animations[a.id];\n a.update();\n eve(\"mina.stop.\" + a.id, a);\n },\n pause = function pause() {\n var a = this;\n\n if (a.pdif) {\n return;\n }\n\n delete animations[a.id];\n a.update();\n a.pdif = a.get() - a.b;\n },\n resume = function resume() {\n var a = this;\n\n if (!a.pdif) {\n return;\n }\n\n a.b = a.get() - a.pdif;\n delete a.pdif;\n animations[a.id] = a;\n frame();\n },\n update = function update() {\n var a = this,\n res;\n\n if (isArray(a.start)) {\n res = [];\n\n for (var j = 0, jj = a.start.length; j < jj; j++) {\n res[j] = +a.start[j] + (a.end[j] - a.start[j]) * a.easing(a.s);\n }\n } else {\n res = +a.start + (a.end - a.start) * a.easing(a.s);\n }\n\n a.set(res);\n },\n frame = function frame(timeStamp) {\n // Manual invokation?\n if (!timeStamp) {\n // Frame loop stopped?\n if (!requestID) {\n // Start frame loop...\n requestID = requestAnimFrame(frame);\n }\n\n return;\n }\n\n var len = 0;\n\n for (var i in animations) {\n if (animations.hasOwnProperty(i)) {\n var a = animations[i],\n b = a.get(),\n res;\n len++;\n a.s = (b - a.b) / (a.dur / a.spd);\n\n if (a.s >= 1) {\n delete animations[i];\n a.s = 1;\n len--;\n\n (function (a) {\n setTimeout(function () {\n eve(\"mina.finish.\" + a.id, a);\n });\n })(a);\n }\n\n a.update();\n }\n }\n\n requestID = len ? requestAnimFrame(frame) : false;\n },\n\n /*\\\n * mina\n [ method ]\n **\n * Generic animation of numbers\n **\n - a (number) start _slave_ number\n - A (number) end _slave_ number\n - b (number) start _master_ number (start time in general case)\n - B (number) end _master_ number (end time in general case)\n - get (function) getter of _master_ number (see @mina.time)\n - set (function) setter of _slave_ number\n - easing (function) #optional easing function, default is @mina.linear\n = (object) animation descriptor\n o {\n o id (string) animation id,\n o start (number) start _slave_ number,\n o end (number) end _slave_ number,\n o b (number) start _master_ number,\n o s (number) animation status (0..1),\n o dur (number) animation duration,\n o spd (number) animation speed,\n o get (function) getter of _master_ number (see @mina.time),\n o set (function) setter of _slave_ number,\n o easing (function) easing function, default is @mina.linear,\n o status (function) status getter/setter,\n o speed (function) speed getter/setter,\n o duration (function) duration getter/setter,\n o stop (function) animation stopper\n o pause (function) pauses the animation\n o resume (function) resumes the animation\n o update (function) calles setter with the right value of the animation\n o }\n \\*/\n mina = function mina(a, A, b, B, get, set, easing) {\n var anim = {\n id: ID(),\n start: a,\n end: A,\n b: b,\n s: 0,\n dur: B - b,\n spd: 1,\n get: get,\n set: set,\n easing: easing || mina.linear,\n status: sta,\n speed: speed,\n duration: duration,\n stop: stopit,\n pause: pause,\n resume: resume,\n update: update\n };\n animations[anim.id] = anim;\n var len = 0,\n i;\n\n for (i in animations) {\n if (animations.hasOwnProperty(i)) {\n len++;\n\n if (len == 2) {\n break;\n }\n }\n }\n\n len == 1 && frame();\n return anim;\n };\n /*\\\n * mina.time\n [ method ]\n **\n * Returns the current time. Equivalent to:\n | function () {\n | return (new Date).getTime();\n | }\n \\*/\n\n\n mina.time = timer;\n /*\\\n * mina.getById\n [ method ]\n **\n * Returns an animation by its id\n - id (string) animation's id\n = (object) See @mina\n \\*/\n\n mina.getById = function (id) {\n return animations[id] || null;\n };\n /*\\\n * mina.linear\n [ method ]\n **\n * Default linear easing\n - n (number) input 0..1\n = (number) output 0..1\n \\*/\n\n\n mina.linear = function (n) {\n return n;\n };\n /*\\\n * mina.easeout\n [ method ]\n **\n * Easeout easing\n - n (number) input 0..1\n = (number) output 0..1\n \\*/\n\n\n mina.easeout = function (n) {\n return Math.pow(n, 1.7);\n };\n /*\\\n * mina.easein\n [ method ]\n **\n * Easein easing\n - n (number) input 0..1\n = (number) output 0..1\n \\*/\n\n\n mina.easein = function (n) {\n return Math.pow(n, .48);\n };\n /*\\\n * mina.easeinout\n [ method ]\n **\n * Easeinout easing\n - n (number) input 0..1\n = (number) output 0..1\n \\*/\n\n\n mina.easeinout = function (n) {\n if (n == 1) {\n return 1;\n }\n\n if (n == 0) {\n return 0;\n }\n\n var q = .48 - n / 1.04,\n Q = Math.sqrt(.1734 + q * q),\n x = Q - q,\n X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),\n y = -Q - q,\n Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),\n t = X + Y + .5;\n return (1 - t) * 3 * t * t + t * t * t;\n };\n /*\\\n * mina.backin\n [ method ]\n **\n * Backin easing\n - n (number) input 0..1\n = (number) output 0..1\n \\*/\n\n\n mina.backin = function (n) {\n if (n == 1) {\n return 1;\n }\n\n var s = 1.70158;\n return n * n * ((s + 1) * n - s);\n };\n /*\\\n * mina.backout\n [ method ]\n **\n * Backout easing\n - n (number) input 0..1\n = (number) output 0..1\n \\*/\n\n\n mina.backout = function (n) {\n if (n == 0) {\n return 0;\n }\n\n n = n - 1;\n var s = 1.70158;\n return n * n * ((s + 1) * n + s) + 1;\n };\n /*\\\n * mina.elastic\n [ method ]\n **\n * Elastic easing\n - n (number) input 0..1\n = (number) output 0..1\n \\*/\n\n\n mina.elastic = function (n) {\n if (n == !!n) {\n return n;\n }\n\n return Math.pow(2, -10 * n) * Math.sin((n - .075) * (2 * Math.PI) / .3) + 1;\n };\n /*\\\n * mina.bounce\n [ method ]\n **\n * Bounce easing\n - n (number) input 0..1\n = (number) output 0..1\n \\*/\n\n\n mina.bounce = function (n) {\n var s = 7.5625,\n p = 2.75,\n l;\n\n if (n < 1 / p) {\n l = s * n * n;\n } else {\n if (n < 2 / p) {\n n -= 1.5 / p;\n l = s * n * n + .75;\n } else {\n if (n < 2.5 / p) {\n n -= 2.25 / p;\n l = s * n * n + .9375;\n } else {\n n -= 2.625 / p;\n l = s * n * n + .984375;\n }\n }\n }\n\n return l;\n };\n\n window.mina = mina;\n return mina;\n}(typeof eve == \"undefined\" ? function () {} : eve); // Copyright (c) 2013 - 2017 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n\nvar Snap = function (root) {\n Snap.version = \"0.5.1\";\n /*\\\n * Snap\n [ method ]\n **\n * Creates a drawing surface or wraps existing SVG element.\n **\n - width (number|string) width of surface\n - height (number|string) height of surface\n * or\n - DOM (SVGElement) element to be wrapped into Snap structure\n * or\n - array (array) array of elements (will return set of elements)\n * or\n - query (string) CSS query selector\n = (object) @Element\n \\*/\n\n function Snap(w, h) {\n if (w) {\n if (w.nodeType) {\n return wrap(w);\n }\n\n if (is(w, \"array\") && Snap.set) {\n return Snap.set.apply(Snap, w);\n }\n\n if (w instanceof Element) {\n return w;\n }\n\n if (h == null) {\n try {\n w = glob.doc.querySelector(String(w));\n return wrap(w);\n } catch (e) {\n return null;\n }\n }\n }\n\n w = w == null ? \"100%\" : w;\n h = h == null ? \"100%\" : h;\n return new Paper(w, h);\n }\n\n Snap.toString = function () {\n return \"Snap v\" + this.version;\n };\n\n Snap._ = {};\n var glob = {\n win: root.window,\n doc: root.window.document\n };\n Snap._.glob = glob;\n\n var has = \"hasOwnProperty\",\n Str = String,\n toFloat = parseFloat,\n toInt = parseInt,\n math = Math,\n mmax = math.max,\n mmin = math.min,\n abs = math.abs,\n pow = math.pow,\n PI = math.PI,\n round = math.round,\n E = \"\",\n S = \" \",\n objectToString = Object.prototype.toString,\n ISURL = /^url\\(['\"]?([^\\)]+?)['\"]?\\)$/i,\n colourRegExp = /^\\s*((#[a-f\\d]{6})|(#[a-f\\d]{3})|rgba?\\(\\s*([\\d\\.]+%?\\s*,\\s*[\\d\\.]+%?\\s*,\\s*[\\d\\.]+%?(?:\\s*,\\s*[\\d\\.]+%?)?)\\s*\\)|hsba?\\(\\s*([\\d\\.]+(?:deg|\\xb0|%)?\\s*,\\s*[\\d\\.]+%?\\s*,\\s*[\\d\\.]+(?:%?\\s*,\\s*[\\d\\.]+)?%?)\\s*\\)|hsla?\\(\\s*([\\d\\.]+(?:deg|\\xb0|%)?\\s*,\\s*[\\d\\.]+%?\\s*,\\s*[\\d\\.]+(?:%?\\s*,\\s*[\\d\\.]+)?%?)\\s*\\))\\s*$/i,\n bezierrg = /^(?:cubic-)?bezier\\(([^,]+),([^,]+),([^,]+),([^\\)]+)\\)/,\n separator = Snap._.separator = /[,\\s]+/,\n whitespace = /[\\s]/g,\n commaSpaces = /[\\s]*,[\\s]*/,\n hsrg = {\n hs: 1,\n rg: 1\n },\n pathCommand = /([a-z])[\\s,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\s]*,?[\\s]*)+)/ig,\n tCommand = /([rstm])[\\s,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\s]*,?[\\s]*)+)/ig,\n pathValues = /(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\\s]*,?[\\s]*/ig,\n idgen = 0,\n idprefix = \"S\" + (+new Date()).toString(36),\n ID = function ID(el) {\n return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);\n },\n xlink = \"http://www.w3.org/1999/xlink\",\n xmlns = \"http://www.w3.org/2000/svg\",\n hub = {},\n\n /*\\\n * Snap.url\n [ method ]\n **\n * Wraps path into `\"url('<path>')\"`.\n - value (string) path\n = (string) wrapped path\n \\*/\n URL = Snap.url = function (url) {\n return \"url('#\" + url + \"')\";\n };\n\n function $(el, attr) {\n if (attr) {\n if (el == \"#text\") {\n el = glob.doc.createTextNode(attr.text || attr[\"#text\"] || \"\");\n }\n\n if (el == \"#comment\") {\n el = glob.doc.createComment(attr.text || attr[\"#text\"] || \"\");\n }\n\n if (typeof el == \"string\") {\n el = $(el);\n }\n\n if (typeof attr == \"string\") {\n if (el.nodeType == 1) {\n if (attr.substring(0, 6) == \"xlink:\") {\n return el.getAttributeNS(xlink, attr.substring(6));\n }\n\n if (attr.substring(0, 4) == \"xml:\") {\n return el.getAttributeNS(xmlns, attr.substring(4));\n }\n\n return el.getAttribute(attr);\n } else if (attr == \"text\") {\n return el.nodeValue;\n } else {\n return null;\n }\n }\n\n if (el.nodeType == 1) {\n for (var key in attr) {\n if (attr[has](key)) {\n var val = Str(attr[key]);\n\n if (val) {\n if (key.substring(0, 6) == \"xlink:\") {\n el.setAttributeNS(xlink, key.substring(6), val);\n } else if (key.substring(0, 4) == \"xml:\") {\n el.setAttributeNS(xmlns, key.substring(4), val);\n } else {\n el.setAttribute(key, val);\n }\n } else {\n el.removeAttribute(key);\n }\n }\n }\n } else if (\"text\" in attr) {\n el.nodeValue = attr.text;\n }\n } else {\n el = glob.doc.createElementNS(xmlns, el);\n }\n\n return el;\n }\n\n Snap._.$ = $;\n Snap._.id = ID;\n\n function getAttrs(el) {\n var attrs = el.attributes,\n name,\n out = {};\n\n for (var i = 0; i < attrs.length; i++) {\n if (attrs[i].namespaceURI == xlink) {\n name = \"xlink:\";\n } else {\n name = \"\";\n }\n\n name += attrs[i].name;\n out[name] = attrs[i].textContent;\n }\n\n return out;\n }\n\n function is(o, type) {\n type = Str.prototype.toLowerCase.call(type);\n\n if (type == \"finite\") {\n return isFinite(o);\n }\n\n if (type == \"array\" && (o instanceof Array || Array.isArray && Array.isArray(o))) {\n return true;\n }\n\n return type == \"null\" && o === null || type == typeof o && o !== null || type == \"object\" && o === Object(o) || objectToString.call(o).slice(8, -1).toLowerCase() == type;\n }\n /*\\\n * Snap.format\n [ method ]\n **\n * Replaces construction of type `{<name>}` to the corresponding argument\n **\n - token (string) string to format\n - json (object) object which properties are used as a replacement\n = (string) formatted string\n > Usage\n | // this draws a rectangular shape equivalent to \"M10,20h40v50h-40z\"\n | paper.path(Snap.format(\"M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z\", {\n | x: 10,\n | y: 20,\n | dim: {\n | width: 40,\n | height: 50,\n | \"negative width\": -40\n | }\n | }));\n \\*/\n\n\n Snap.format = function () {\n var tokenRegex = /\\{([^\\}]+)\\}/g,\n objNotationRegex = /(?:(?:^|\\.)(.+?)(?=\\[|\\.|$|\\()|\\[('|\")(.+?)\\2\\])(\\(\\))?/g,\n // matches .xxxxx or [\"xxxxx\"] to run over object properties\n replacer = function replacer(all, key, obj) {\n var res = obj;\n key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {\n name = name || quotedName;\n\n if (res) {\n if (name in res) {\n res = res[name];\n }\n\n typeof res == \"function\" && isFunc && (res = res());\n }\n });\n res = (res == null || res == obj ? all : res) + \"\";\n return res;\n };\n\n return function (str, obj) {\n return Str(str).replace(tokenRegex, function (all, key) {\n return replacer(all, key, obj);\n });\n };\n }();\n\n function clone(obj) {\n if (typeof obj == \"function\" || Object(obj) !== obj) {\n return obj;\n }\n\n var res = new obj.constructor();\n\n for (var key in obj) {\n if (obj[has](key)) {\n res[key] = clone(obj[key]);\n }\n }\n\n return res;\n }\n\n Snap._.clone = clone;\n\n function repush(array, item) {\n for (var i = 0, ii = array.length; i < ii; i++) {\n if (array[i] === item) {\n return array.push(array.splice(i, 1)[0]);\n }\n }\n }\n\n function cacher(f, scope, postprocessor) {\n function newf() {\n var arg = Array.prototype.slice.call(arguments, 0),\n args = arg.join(\"\\u2400\"),\n cache = newf.cache = newf.cache || {},\n count = newf.count = newf.count || [];\n\n if (cache[has](args)) {\n repush(count, args);\n return postprocessor ? postprocessor(cache[args]) : cache[args];\n }\n\n count.length >= 1e3 && delete cache[count.shift()];\n count.push(args);\n cache[args] = f.apply(scope, arg);\n return postprocessor ? postprocessor(cache[args]) : cache[args];\n }\n\n return newf;\n }\n\n Snap._.cacher = cacher;\n\n function angle(x1, y1, x2, y2, x3, y3) {\n if (x3 == null) {\n var x = x1 - x2,\n y = y1 - y2;\n\n if (!x && !y) {\n return 0;\n }\n\n return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;\n } else {\n return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);\n }\n }\n\n function rad(deg) {\n return deg % 360 * PI / 180;\n }\n\n function deg(rad) {\n return rad * 180 / PI % 360;\n }\n\n function x_y() {\n return this.x + S + this.y;\n }\n\n function x_y_w_h() {\n return this.x + S + this.y + S + this.width + \" \\xd7 \" + this.height;\n }\n /*\\\n * Snap.rad\n [ method ]\n **\n * Transform angle to radians\n - deg (number) angle in degrees\n = (number) angle in radians\n \\*/\n\n\n Snap.rad = rad;\n /*\\\n * Snap.deg\n [ method ]\n **\n * Transform angle to degrees\n - rad (number) angle in radians\n = (number) angle in degrees\n \\*/\n\n Snap.deg = deg;\n /*\\\n * Snap.sin\n [ method ]\n **\n * Equivalent to `Math.sin()` only works with degrees, not radians.\n - angle (number) angle in degrees\n = (number) sin\n \\*/\n\n Snap.sin = function (angle) {\n return math.sin(Snap.rad(angle));\n };\n /*\\\n * Snap.tan\n [ method ]\n **\n * Equivalent to `Math.tan()` only works with degrees, not radians.\n - angle (number) angle in degrees\n = (number) tan\n \\*/\n\n\n Snap.tan = function (angle) {\n return math.tan(Snap.rad(angle));\n };\n /*\\\n * Snap.cos\n [ method ]\n **\n * Equivalent to `Math.cos()` only works with degrees, not radians.\n - angle (number) angle in degrees\n = (number) cos\n \\*/\n\n\n Snap.cos = function (angle) {\n return math.cos(Snap.rad(angle));\n };\n /*\\\n * Snap.asin\n [ method ]\n **\n * Equivalent to `Math.asin()` only works with degrees, not radians.\n - num (number) value\n = (number) asin in degrees\n \\*/\n\n\n Snap.asin = function (num) {\n return Snap.deg(math.asin(num));\n };\n /*\\\n * Snap.acos\n [ method ]\n **\n * Equivalent to `Math.acos()` only works with degrees, not radians.\n - num (number) value\n = (number) acos in degrees\n \\*/\n\n\n Snap.acos = function (num) {\n return Snap.deg(math.acos(num));\n };\n /*\\\n * Snap.atan\n [ method ]\n **\n * Equivalent to `Math.atan()` only works with degrees, not radians.\n - num (number) value\n = (number) atan in degrees\n \\*/\n\n\n Snap.atan = function (num) {\n return Snap.deg(math.atan(num));\n };\n /*\\\n * Snap.atan2\n [ method ]\n **\n * Equivalent to `Math.atan2()` only works with degrees, not radians.\n - num (number) value\n = (number) atan2 in degrees\n \\*/\n\n\n Snap.atan2 = function (num) {\n return Snap.deg(math.atan2(num));\n };\n /*\\\n * Snap.angle\n [ method ]\n **\n * Returns an angle between two or three points\n - x1 (number) x coord of first point\n - y1 (number) y coord of first point\n - x2 (number) x coord of second point\n - y2 (number) y coord of second point\n - x3 (number) #optional x coord of third point\n - y3 (number) #optional y coord of third point\n = (number) angle in degrees\n \\*/\n\n\n Snap.angle = angle;\n /*\\\n * Snap.len\n [ method ]\n **\n * Returns distance between two points\n - x1 (number) x coord of first point\n - y1 (number) y coord of first point\n - x2 (number) x coord of second point\n - y2 (number) y coord of second point\n = (number) distance\n \\*/\n\n Snap.len = function (x1, y1, x2, y2) {\n return Math.sqrt(Snap.len2(x1, y1, x2, y2));\n };\n /*\\\n * Snap.len2\n [ method ]\n **\n * Returns squared distance between two points\n - x1 (number) x coord of first point\n - y1 (number) y coord of first point\n - x2 (number) x coord of second point\n - y2 (number) y coord of second point\n = (number) distance\n \\*/\n\n\n Snap.len2 = function (x1, y1, x2, y2) {\n return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\n };\n /*\\\n * Snap.closestPoint\n [ method ]\n **\n * Returns closest point to a given one on a given path.\n - path (Element) path element\n - x (number) x coord of a point\n - y (number) y coord of a point\n = (object) in format\n {\n x (number) x coord of the point on the path\n y (number) y coord of the point on the path\n length (number) length of the path to the point\n distance (number) distance from the given point to the path\n }\n \\*/\n // Copied from http://bl.ocks.org/mbostock/8027637\n\n\n Snap.closestPoint = function (path, x, y) {\n function distance2(p) {\n var dx = p.x - x,\n dy = p.y - y;\n return dx * dx + dy * dy;\n }\n\n var pathNode = path.node,\n pathLength = pathNode.getTotalLength(),\n precision = pathLength / pathNode.pathSegList.numberOfItems * .125,\n best,\n bestLength,\n bestDistance = Infinity; // linear scan for coarse approximation\n\n for (var scan, scanLength = 0, scanDistance; scanLength <= pathLength; scanLength += precision) {\n if ((scanDistance = distance2(scan = pathNode.getPointAtLength(scanLength))) < bestDistance) {\n best = scan;\n bestLength = scanLength;\n bestDistance = scanDistance;\n }\n } // binary search for precise estimate\n\n\n precision *= .5;\n\n while (precision > .5) {\n var before, after, beforeLength, afterLength, beforeDistance, afterDistance;\n\n if ((beforeLength = bestLength - precision) >= 0 && (beforeDistance = distance2(before = pathNode.getPointAtLength(beforeLength))) < bestDistance) {\n best = before;\n bestLength = beforeLength;\n bestDistance = beforeDistance;\n } else if ((afterLength = bestLength + precision) <= pathLength && (afterDistance = distance2(after = pathNode.getPointAtLength(afterLength))) < bestDistance) {\n best = after;\n bestLength = afterLength;\n bestDistance = afterDistance;\n } else {\n precision *= .5;\n }\n }\n\n best = {\n x: best.x,\n y: best.y,\n length: bestLength,\n distance: Math.sqrt(bestDistance)\n };\n return best;\n };\n /*\\\n * Snap.is\n [ method ]\n **\n * Handy replacement for the `typeof` operator\n - o (…) any object or primitive\n - type (string) name of the type, e.g., `string`, `function`, `number`, etc.\n = (boolean) `true` if given value is of given type\n \\*/\n\n\n Snap.is = is;\n /*\\\n * Snap.snapTo\n [ method ]\n **\n * Snaps given value to given grid\n - values (array|number) given array of values or step of the grid\n - value (number) value to adjust\n - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.\n = (number) adjusted value\n \\*/\n\n Snap.snapTo = function (values, value, tolerance) {\n tolerance = is(tolerance, \"finite\") ? tolerance : 10;\n\n if (is(values, \"array\")) {\n var i = values.length;\n\n while (i--) {\n if (abs(values[i] - value) <= tolerance) {\n return values[i];\n }\n }\n } else {\n values = +values;\n var rem = value % values;\n\n if (rem < tolerance) {\n return value - rem;\n }\n\n if (rem > values - tolerance) {\n return value - rem + values;\n }\n }\n\n return value;\n }; // Colour\n\n /*\\\n * Snap.getRGB\n [ method ]\n **\n * Parses color string as RGB object\n - color (string) color string in one of the following formats:\n # <ul>\n # <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>\n # <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>\n # <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>\n # <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200, 100, 0)</code>)</li>\n # <li>rgba(•••, •••, •••, •••) — also with opacity</li>\n # <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%, 175%, 0%)</code>)</li>\n # <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>\n # <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5, 0.25, 1)</code>)</li>\n # <li>hsba(•••, •••, •••, •••) — also with opacity</li>\n # <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>\n # <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>\n # <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5, 0.25, 0.5)</code>)</li>\n # <li>hsla(•••, •••, •••, •••) — also with opacity</li>\n # <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>\n # <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>\n # </ul>\n * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••,\n o error (boolean) true if string can't be parsed\n o }\n \\*/\n\n\n Snap.getRGB = cacher(function (colour) {\n if (!colour || !!((colour = Str(colour)).indexOf(\"-\") + 1)) {\n return {\n r: -1,\n g: -1,\n b: -1,\n hex: \"none\",\n error: 1,\n toString: rgbtoString\n };\n }\n\n if (colour == \"none\") {\n return {\n r: -1,\n g: -1,\n b: -1,\n hex: \"none\",\n toString: rgbtoString\n };\n }\n\n !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == \"#\") && (colour = _toHex(colour));\n\n if (!colour) {\n return {\n r: -1,\n g: -1,\n b: -1,\n hex: \"none\",\n error: 1,\n toString: rgbtoString\n };\n }\n\n var res,\n red,\n green,\n blue,\n opacity,\n t,\n values,\n rgb = colour.match(colourRegExp);\n\n if (rgb) {\n if (rgb[2]) {\n blue = toInt(rgb[2].substring(5), 16);\n green = toInt(rgb[2].substring(3, 5), 16);\n red = toInt(rgb[2].substring(1, 3), 16);\n }\n\n if (rgb[3]) {\n blue = toInt((t = rgb[3].charAt(3)) + t, 16);\n green = toInt((t = rgb[3].charAt(2)) + t, 16);\n red = toInt((t = rgb[3].charAt(1)) + t, 16);\n }\n\n if (rgb[4]) {\n values = rgb[4].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red *= 2.55);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green *= 2.55);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue *= 2.55);\n rgb[1].toLowerCase().slice(0, 4) == \"rgba\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n }\n\n if (rgb[5]) {\n values = rgb[5].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red /= 100);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green /= 100);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue /= 100);\n (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"\\xb0\") && (red /= 360);\n rgb[1].toLowerCase().slice(0, 4) == \"hsba\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n return Snap.hsb2rgb(red, green, blue, opacity);\n }\n\n if (rgb[6]) {\n values = rgb[6].split(commaSpaces);\n red = toFloat(values[0]);\n values[0].slice(-1) == \"%\" && (red /= 100);\n green = toFloat(values[1]);\n values[1].slice(-1) == \"%\" && (green /= 100);\n blue = toFloat(values[2]);\n values[2].slice(-1) == \"%\" && (blue /= 100);\n (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"\\xb0\") && (red /= 360);\n rgb[1].toLowerCase().slice(0, 4) == \"hsla\" && (opacity = toFloat(values[3]));\n values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n return Snap.hsl2rgb(red, green, blue, opacity);\n }\n\n red = mmin(math.round(red), 255);\n green = mmin(math.round(green), 255);\n blue = mmin(math.round(blue), 255);\n opacity = mmin(mmax(opacity, 0), 1);\n rgb = {\n r: red,\n g: green,\n b: blue,\n toString: rgbtoString\n };\n rgb.hex = \"#\" + (16777216 | blue | green << 8 | red << 16).toString(16).slice(1);\n rgb.opacity = is(opacity, \"finite\") ? opacity : 1;\n return rgb;\n }\n\n return {\n r: -1,\n g: -1,\n b: -1,\n hex: \"none\",\n error: 1,\n toString: rgbtoString\n };\n }, Snap);\n /*\\\n * Snap.hsb\n [ method ]\n **\n * Converts HSB values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - b (number) value or brightness\n = (string) hex representation of the color\n \\*/\n\n Snap.hsb = cacher(function (h, s, b) {\n return Snap.hsb2rgb(h, s, b).hex;\n });\n /*\\\n * Snap.hsl\n [ method ]\n **\n * Converts HSL values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (string) hex representation of the color\n \\*/\n\n Snap.hsl = cacher(function (h, s, l) {\n return Snap.hsl2rgb(h, s, l).hex;\n });\n /*\\\n * Snap.rgb\n [ method ]\n **\n * Converts RGB values to a hex representation of the color\n - r (number) red\n - g (number) green\n - b (number) blue\n = (string) hex representation of the color\n \\*/\n\n Snap.rgb = cacher(function (r, g, b, o) {\n if (is(o, \"finite\")) {\n var round = math.round;\n return \"rgba(\" + [round(r), round(g), round(b), +o.toFixed(2)] + \")\";\n }\n\n return \"#\" + (16777216 | b | g << 8 | r << 16).toString(16).slice(1);\n });\n\n var _toHex = function toHex(color) {\n var i = glob.doc.getElementsByTagName(\"head\")[0] || glob.doc.getElementsByTagName(\"svg\")[0],\n red = \"rgb(255, 0, 0)\";\n _toHex = cacher(function (color) {\n if (color.toLowerCase() == \"red\") {\n return red;\n }\n\n i.style.color = red;\n i.style.color = color;\n var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue(\"color\");\n return out == red ? null : out;\n });\n return _toHex(color);\n },\n hsbtoString = function hsbtoString() {\n return \"hsb(\" + [this.h, this.s, this.b] + \")\";\n },\n hsltoString = function hsltoString() {\n return \"hsl(\" + [this.h, this.s, this.l] + \")\";\n },\n rgbtoString = function rgbtoString() {\n return this.opacity == 1 || this.opacity == null ? this.hex : \"rgba(\" + [this.r, this.g, this.b, this.opacity] + \")\";\n },\n prepareRGB = function prepareRGB(r, g, b) {\n if (g == null && is(r, \"object\") && \"r\" in r && \"g\" in r && \"b\" in r) {\n b = r.b;\n g = r.g;\n r = r.r;\n }\n\n if (g == null && is(r, string)) {\n var clr = Snap.getRGB(r);\n r = clr.r;\n g = clr.g;\n b = clr.b;\n }\n\n if (r > 1 || g > 1 || b > 1) {\n r /= 255;\n g /= 255;\n b /= 255;\n }\n\n return [r, g, b];\n },\n packageRGB = function packageRGB(r, g, b, o) {\n r = math.round(r * 255);\n g = math.round(g * 255);\n b = math.round(b * 255);\n var rgb = {\n r: r,\n g: g,\n b: b,\n opacity: is(o, \"finite\") ? o : 1,\n hex: Snap.rgb(r, g, b),\n toString: rgbtoString\n };\n is(o, \"finite\") && (rgb.opacity = o);\n return rgb;\n };\n /*\\\n * Snap.color\n [ method ]\n **\n * Parses the color string and returns an object featuring the color's component values\n - clr (string) color string in one of the supported formats (see @Snap.getRGB)\n = (object) Combined RGB/HSB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••,\n o error (boolean) `true` if string can't be parsed,\n o h (number) hue,\n o s (number) saturation,\n o v (number) value (brightness),\n o l (number) lightness\n o }\n \\*/\n\n\n Snap.color = function (clr) {\n var rgb;\n\n if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"b\" in clr) {\n rgb = Snap.hsb2rgb(clr);\n clr.r = rgb.r;\n clr.g = rgb.g;\n clr.b = rgb.b;\n clr.opacity = 1;\n clr.hex = rgb.hex;\n } else if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"l\" in clr) {\n rgb = Snap.hsl2rgb(clr);\n clr.r = rgb.r;\n clr.g = rgb.g;\n clr.b = rgb.b;\n clr.opacity = 1;\n clr.hex = rgb.hex;\n } else {\n if (is(clr, \"string\")) {\n clr = Snap.getRGB(clr);\n }\n\n if (is(clr, \"object\") && \"r\" in clr && \"g\" in clr && \"b\" in clr && !(\"error\" in clr)) {\n rgb = Snap.rgb2hsl(clr);\n clr.h = rgb.h;\n clr.s = rgb.s;\n clr.l = rgb.l;\n rgb = Snap.rgb2hsb(clr);\n clr.v = rgb.b;\n } else {\n clr = {\n hex: \"none\"\n };\n clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;\n clr.error = 1;\n }\n }\n\n clr.toString = rgbtoString;\n return clr;\n };\n /*\\\n * Snap.hsb2rgb\n [ method ]\n **\n * Converts HSB values to an RGB object\n - h (number) hue\n - s (number) saturation\n - v (number) value or brightness\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••\n o }\n \\*/\n\n\n Snap.hsb2rgb = function (h, s, v, o) {\n if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"b\" in h) {\n v = h.b;\n s = h.s;\n o = h.o;\n h = h.h;\n }\n\n h *= 360;\n var R, G, B, X, C;\n h = h % 360 / 60;\n C = v * s;\n X = C * (1 - abs(h % 2 - 1));\n R = G = B = v - C;\n h = ~~h;\n R += [C, X, 0, 0, X, C][h];\n G += [X, C, C, X, 0, 0][h];\n B += [0, 0, X, C, C, X][h];\n return packageRGB(R, G, B, o);\n };\n /*\\\n * Snap.hsl2rgb\n [ method ]\n **\n * Converts HSL values to an RGB object\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (object) RGB object in the following format:\n o {\n o r (number) red,\n o g (number) green,\n o b (number) blue,\n o hex (string) color in HTML/CSS format: #••••••\n o }\n \\*/\n\n\n Snap.hsl2rgb = function (h, s, l, o) {\n if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"l\" in h) {\n l = h.l;\n s = h.s;\n h = h.h;\n }\n\n if (h > 1 || s > 1 || l > 1) {\n h /= 360;\n s /= 100;\n l /= 100;\n }\n\n h *= 360;\n var R, G, B, X, C;\n h = h % 360 / 60;\n C = 2 * s * (l < .5 ? l : 1 - l);\n X = C * (1 - abs(h % 2 - 1));\n R = G = B = l - C / 2;\n h = ~~h;\n R += [C, X, 0, 0, X, C][h];\n G += [X, C, C, X, 0, 0][h];\n B += [0, 0, X, C, C, X][h];\n return packageRGB(R, G, B, o);\n };\n /*\\\n * Snap.rgb2hsb\n [ method ]\n **\n * Converts RGB values to an HSB object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSB object in the following format:\n o {\n o h (number) hue,\n o s (number) saturation,\n o b (number) brightness\n o }\n \\*/\n\n\n Snap.rgb2hsb = function (r, g, b) {\n b = prepareRGB(r, g, b);\n r = b[0];\n g = b[1];\n b = b[2];\n var H, S, V, C;\n V = mmax(r, g, b);\n C = V - mmin(r, g, b);\n H = C == 0 ? null : V == r ? (g - b) / C : V == g ? (b - r) / C + 2 : (r - g) / C + 4;\n H = (H + 360) % 6 * 60 / 360;\n S = C == 0 ? 0 : C / V;\n return {\n h: H,\n s: S,\n b: V,\n toString: hsbtoString\n };\n };\n /*\\\n * Snap.rgb2hsl\n [ method ]\n **\n * Converts RGB values to an HSL object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSL object in the following format:\n o {\n o h (number) hue,\n o s (number) saturation,\n o l (number) luminosity\n o }\n \\*/\n\n\n Snap.rgb2hsl = function (r, g, b) {\n b = prepareRGB(r, g, b);\n r = b[0];\n g = b[1];\n b = b[2];\n var H, S, L, M, m, C;\n M = mmax(r, g, b);\n m = mmin(r, g, b);\n C = M - m;\n H = C == 0 ? null : M == r ? (g - b) / C : M == g ? (b - r) / C + 2 : (r - g) / C + 4;\n H = (H + 360) % 6 * 60 / 360;\n L = (M + m) / 2;\n S = C == 0 ? 0 : L < .5 ? C / (2 * L) : C / (2 - 2 * L);\n return {\n h: H,\n s: S,\n l: L,\n toString: hsltoString\n };\n }; // Transformations\n\n /*\\\n * Snap.parsePathString\n [ method ]\n **\n * Utility method\n **\n * Parses given path string into an array of arrays of path segments\n - pathString (string|array) path string or array of segments (in the last case it is returned straight away)\n = (array) array of segments\n \\*/\n\n\n Snap.parsePathString = function (pathString) {\n if (!pathString) {\n return null;\n }\n\n var pth = Snap.path(pathString);\n\n if (pth.arr) {\n return Snap.path.clone(pth.arr);\n }\n\n var paramCounts = {\n a: 7,\n c: 6,\n o: 2,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\n s: 4,\n t: 2,\n v: 1,\n u: 3,\n z: 0\n },\n data = [];\n\n if (is(pathString, \"array\") && is(pathString[0], \"array\")) {\n // rough assumption\n data = Snap.path.clone(pathString);\n }\n\n if (!data.length) {\n Str(pathString).replace(pathCommand, function (a, b, c) {\n var params = [],\n name = b.toLowerCase();\n c.replace(pathValues, function (a, b) {\n b && params.push(+b);\n });\n\n if (name == \"m\" && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = \"l\";\n b = b == \"m\" ? \"l\" : \"L\";\n }\n\n if (name == \"o\" && params.length == 1) {\n data.push([b, params[0]]);\n }\n\n if (name == \"r\") {\n data.push([b].concat(params));\n } else while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n\n if (!paramCounts[name]) {\n break;\n }\n }\n });\n }\n\n data.toString = Snap.path.toString;\n pth.arr = Snap.path.clone(data);\n return data;\n };\n /*\\\n * Snap.parseTransformString\n [ method ]\n **\n * Utility method\n **\n * Parses given transform string into an array of transformations\n - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)\n = (array) array of transformations\n \\*/\n\n\n var parseTransformString = Snap.parseTransformString = function (TString) {\n if (!TString) {\n return null;\n }\n\n var paramCounts = {\n r: 3,\n s: 4,\n t: 2,\n m: 6\n },\n data = [];\n\n if (is(TString, \"array\") && is(TString[0], \"array\")) {\n // rough assumption\n data = Snap.path.clone(TString);\n }\n\n if (!data.length) {\n Str(TString).replace(tCommand, function (a, b, c) {\n var params = [],\n name = b.toLowerCase();\n c.replace(pathValues, function (a, b) {\n b && params.push(+b);\n });\n data.push([b].concat(params));\n });\n }\n\n data.toString = Snap.path.toString;\n return data;\n };\n\n function svgTransform2string(tstr) {\n var res = [];\n tstr = tstr.replace(/(?:^|\\s)(\\w+)\\(([^)]+)\\)/g, function (all, name, params) {\n params = params.split(/\\s*,\\s*|\\s+/);\n\n if (name == \"rotate\" && params.length == 1) {\n params.push(0, 0);\n }\n\n if (name == \"scale\") {\n if (params.length > 2) {\n params = params.slice(0, 2);\n } else if (params.length == 2) {\n params.push(0, 0);\n }\n\n if (params.length == 1) {\n params.push(params[0], 0, 0);\n }\n }\n\n if (name == \"skewX\") {\n res.push([\"m\", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);\n } else if (name == \"skewY\") {\n res.push([\"m\", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);\n } else {\n res.push([name.charAt(0)].concat(params));\n }\n\n return all;\n });\n return res;\n }\n\n Snap._.svgTransform2string = svgTransform2string;\n Snap._.rgTransform = /^[a-z][\\s]*-?\\.?\\d/i;\n\n function transform2matrix(tstr, bbox) {\n var tdata = parseTransformString(tstr),\n m = new Snap.Matrix();\n\n if (tdata) {\n for (var i = 0, ii = tdata.length; i < ii; i++) {\n var t = tdata[i],\n tlen = t.length,\n command = Str(t[0]).toLowerCase(),\n absolute = t[0] != command,\n inver = absolute ? m.invert() : 0,\n x1,\n y1,\n x2,\n y2,\n bb;\n\n if (command == \"t\" && tlen == 2) {\n m.translate(t[1], 0);\n } else if (command == \"t\" && tlen == 3) {\n if (absolute) {\n x1 = inver.x(0, 0);\n y1 = inver.y(0, 0);\n x2 = inver.x(t[1], t[2]);\n y2 = inver.y(t[1], t[2]);\n m.translate(x2 - x1, y2 - y1);\n } else {\n m.translate(t[1], t[2]);\n }\n } else if (command == \"r\") {\n if (tlen == 2) {\n bb = bb || bbox;\n m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n } else if (tlen == 4) {\n if (absolute) {\n x2 = inver.x(t[2], t[3]);\n y2 = inver.y(t[2], t[3]);\n m.rotate(t[1], x2, y2);\n } else {\n m.rotate(t[1], t[2], t[3]);\n }\n }\n } else if (command == \"s\") {\n if (tlen == 2 || tlen == 3) {\n bb = bb || bbox;\n m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n } else if (tlen == 4) {\n if (absolute) {\n x2 = inver.x(t[2], t[3]);\n y2 = inver.y(t[2], t[3]);\n m.scale(t[1], t[1], x2, y2);\n } else {\n m.scale(t[1], t[1], t[2], t[3]);\n }\n } else if (tlen == 5) {\n if (absolute) {\n x2 = inver.x(t[3], t[4]);\n y2 = inver.y(t[3], t[4]);\n m.scale(t[1], t[2], x2, y2);\n } else {\n m.scale(t[1], t[2], t[3], t[4]);\n }\n }\n } else if (command == \"m\" && tlen == 7) {\n m.add(t[1], t[2], t[3], t[4], t[5], t[6]);\n }\n }\n }\n\n return m;\n }\n\n Snap._.transform2matrix = transform2matrix;\n Snap._unit2px = unit2px;\n var contains = glob.doc.contains || glob.doc.compareDocumentPosition ? function (a, b) {\n var adown = a.nodeType == 9 ? a.documentElement : a,\n bup = b && b.parentNode;\n return a == bup || !!(bup && bup.nodeType == 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));\n } : function (a, b) {\n if (b) {\n while (b) {\n b = b.parentNode;\n\n if (b == a) {\n return true;\n }\n }\n }\n\n return false;\n };\n\n function getSomeDefs(el) {\n var p = el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || el.node.parentNode && wrap(el.node.parentNode) || Snap.select(\"svg\") || Snap(0, 0),\n pdefs = p.select(\"defs\"),\n defs = pdefs == null ? false : pdefs.node;\n\n if (!defs) {\n defs = make(\"defs\", p.node).node;\n }\n\n return defs;\n }\n\n function getSomeSVG(el) {\n return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select(\"svg\");\n }\n\n Snap._.getSomeDefs = getSomeDefs;\n Snap._.getSomeSVG = getSomeSVG;\n\n function unit2px(el, name, value) {\n var svg = getSomeSVG(el).node,\n out = {},\n mgr = svg.querySelector(\".svg---mgr\");\n\n if (!mgr) {\n mgr = $(\"rect\");\n $(mgr, {\n x: -9e9,\n y: -9e9,\n width: 10,\n height: 10,\n \"class\": \"svg---mgr\",\n fill: \"none\"\n });\n svg.appendChild(mgr);\n }\n\n function getW(val) {\n if (val == null) {\n return E;\n }\n\n if (val == +val) {\n return val;\n }\n\n $(mgr, {\n width: val\n });\n\n try {\n return mgr.getBBox().width;\n } catch (e) {\n return 0;\n }\n }\n\n function getH(val) {\n if (val == null) {\n return E;\n }\n\n if (val == +val) {\n return val;\n }\n\n $(mgr, {\n height: val\n });\n\n try {\n return mgr.getBBox().height;\n } catch (e) {\n return 0;\n }\n }\n\n function set(nam, f) {\n if (name == null) {\n out[nam] = f(el.attr(nam) || 0);\n } else if (nam == name) {\n out = f(value == null ? el.attr(nam) || 0 : value);\n }\n }\n\n switch (el.type) {\n case \"rect\":\n set(\"rx\", getW);\n set(\"ry\", getH);\n\n case \"image\":\n set(\"width\", getW);\n set(\"height\", getH);\n\n case \"text\":\n set(\"x\", getW);\n set(\"y\", getH);\n break;\n\n case \"circle\":\n set(\"cx\", getW);\n set(\"cy\", getH);\n set(\"r\", getW);\n break;\n\n case \"ellipse\":\n set(\"cx\", getW);\n set(\"cy\", getH);\n set(\"rx\", getW);\n set(\"ry\", getH);\n break;\n\n case \"line\":\n set(\"x1\", getW);\n set(\"x2\", getW);\n set(\"y1\", getH);\n set(\"y2\", getH);\n break;\n\n case \"marker\":\n set(\"refX\", getW);\n set(\"markerWidth\", getW);\n set(\"refY\", getH);\n set(\"markerHeight\", getH);\n break;\n\n case \"radialGradient\":\n set(\"fx\", getW);\n set(\"fy\", getH);\n break;\n\n case \"tspan\":\n set(\"dx\", getW);\n set(\"dy\", getH);\n break;\n\n default:\n set(name, getW);\n }\n\n svg.removeChild(mgr);\n return out;\n }\n /*\\\n * Snap.select\n [ method ]\n **\n * Wraps a DOM element specified by CSS selector as @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n \\*/\n\n\n Snap.select = function (query) {\n query = Str(query).replace(/([^\\\\]):/g, \"$1\\\\:\");\n return wrap(glob.doc.querySelector(query));\n };\n /*\\\n * Snap.selectAll\n [ method ]\n **\n * Wraps DOM elements specified by CSS selector as set or array of @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n \\*/\n\n\n Snap.selectAll = function (query) {\n var nodelist = glob.doc.querySelectorAll(query),\n set = (Snap.set || Array)();\n\n for (var i = 0; i < nodelist.length; i++) {\n set.push(wrap(nodelist[i]));\n }\n\n return set;\n };\n\n function add2group(list) {\n if (!is(list, \"array\")) {\n list = Array.prototype.slice.call(arguments, 0);\n }\n\n var i = 0,\n j = 0,\n node = this.node;\n\n while (this[i]) {\n delete this[i++];\n }\n\n for (i = 0; i < list.length; i++) {\n if (list[i].type == \"set\") {\n list[i].forEach(function (el) {\n node.appendChild(el.node);\n });\n } else {\n node.appendChild(list[i].node);\n }\n }\n\n var children = node.childNodes;\n\n for (i = 0; i < children.length; i++) {\n this[j++] = wrap(children[i]);\n }\n\n return this;\n } // Hub garbage collector every 10s\n\n\n setInterval(function () {\n for (var key in hub) {\n if (hub[has](key)) {\n var el = hub[key],\n node = el.node;\n\n if (el.type != \"svg\" && !node.ownerSVGElement || el.type == \"svg\" && (!node.parentNode || \"ownerSVGElement\" in node.parentNode && !node.ownerSVGElement)) {\n delete hub[key];\n }\n }\n }\n }, 1e4);\n\n function Element(el) {\n if (el.snap in hub) {\n return hub[el.snap];\n }\n\n var svg;\n\n try {\n svg = el.ownerSVGElement;\n } catch (e) {}\n /*\\\n * Element.node\n [ property (object) ]\n **\n * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.\n > Usage\n | // draw a circle at coordinate 10,10 with radius of 10\n | var c = paper.circle(10, 10, 10);\n | c.node.onclick = function () {\n | c.attr(\"fill\", \"red\");\n | };\n \\*/\n\n\n this.node = el;\n\n if (svg) {\n this.paper = new Paper(svg);\n }\n /*\\\n * Element.type\n [ property (string) ]\n **\n * SVG tag name of the given element.\n \\*/\n\n\n this.type = el.tagName || el.nodeName;\n var id = this.id = ID(this);\n this.anims = {};\n this._ = {\n transform: []\n };\n el.snap = id;\n hub[id] = this;\n\n if (this.type == \"g\") {\n this.add = add2group;\n }\n\n if (this.type in {\n g: 1,\n mask: 1,\n pattern: 1,\n symbol: 1\n }) {\n for (var method in Paper.prototype) {\n if (Paper.prototype[has](method)) {\n this[method] = Paper.prototype[method];\n }\n }\n }\n }\n /*\\\n * Element.attr\n [ method ]\n **\n * Gets or sets given attributes of the element.\n **\n - params (object) contains key-value pairs of attributes you want to set\n * or\n - param (string) name of the attribute\n = (Element) the current element\n * or\n = (string) value of attribute\n > Usage\n | el.attr({\n | fill: \"#fc0\",\n | stroke: \"#000\",\n | strokeWidth: 2, // CamelCase...\n | \"fill-opacity\": 0.5, // or dash-separated names\n | width: \"*=2\" // prefixed values\n | });\n | console.log(el.attr(\"fill\")); // #fc0\n * Prefixed values in format `\"+=10\"` supported. All four operations\n * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`\n * and `-`: `\"+=2em\"`.\n \\*/\n\n\n Element.prototype.attr = function (params, value) {\n var el = this,\n node = el.node;\n\n if (!params) {\n if (node.nodeType != 1) {\n return {\n text: node.nodeValue\n };\n }\n\n var attr = node.attributes,\n out = {};\n\n for (var i = 0, ii = attr.length; i < ii; i++) {\n out[attr[i].nodeName] = attr[i].nodeValue;\n }\n\n return out;\n }\n\n if (is(params, \"string\")) {\n if (arguments.length > 1) {\n var json = {};\n json[params] = value;\n params = json;\n } else {\n return eve(\"snap.util.getattr.\" + params, el).firstDefined();\n }\n }\n\n for (var att in params) {\n if (params[has](att)) {\n eve(\"snap.util.attr.\" + att, el, params[att]);\n }\n }\n\n return el;\n };\n /*\\\n * Snap.parse\n [ method ]\n **\n * Parses SVG fragment and converts it into a @Fragment\n **\n - svg (string) SVG string\n = (Fragment) the @Fragment\n \\*/\n\n\n Snap.parse = function (svg) {\n var f = glob.doc.createDocumentFragment(),\n full = true,\n div = glob.doc.createElement(\"div\");\n svg = Str(svg);\n\n if (!svg.match(/^\\s*<\\s*svg(?:\\s|>)/)) {\n svg = \"<svg>\" + svg + \"</svg>\";\n full = false;\n }\n\n div.innerHTML = svg;\n svg = div.getElementsByTagName(\"svg\")[0];\n\n if (svg) {\n if (full) {\n f = svg;\n } else {\n while (svg.firstChild) {\n f.appendChild(svg.firstChild);\n }\n }\n }\n\n return new Fragment(f);\n };\n\n function Fragment(frag) {\n this.node = frag;\n }\n /*\\\n * Snap.fragment\n [ method ]\n **\n * Creates a DOM fragment from a given list of elements or strings\n **\n - varargs (…) SVG string\n = (Fragment) the @Fragment\n \\*/\n\n\n Snap.fragment = function () {\n var args = Array.prototype.slice.call(arguments, 0),\n f = glob.doc.createDocumentFragment();\n\n for (var i = 0, ii = args.length; i < ii; i++) {\n var item = args[i];\n\n if (item.node && item.node.nodeType) {\n f.appendChild(item.node);\n }\n\n if (item.nodeType) {\n f.appendChild(item);\n }\n\n if (typeof item == \"string\") {\n f.appendChild(Snap.parse(item).node);\n }\n }\n\n return new Fragment(f);\n };\n\n function make(name, parent) {\n var res = $(name);\n parent.appendChild(res);\n var el = wrap(res);\n return el;\n }\n\n function Paper(w, h) {\n var res,\n desc,\n defs,\n proto = Paper.prototype;\n\n if (w && w.tagName && w.tagName.toLowerCase() == \"svg\") {\n if (w.snap in hub) {\n return hub[w.snap];\n }\n\n var doc = w.ownerDocument;\n res = new Element(w);\n desc = w.getElementsByTagName(\"desc\")[0];\n defs = w.getElementsByTagName(\"defs\")[0];\n\n if (!desc) {\n desc = $(\"desc\");\n desc.appendChild(doc.createTextNode(\"Created with Snap\"));\n res.node.appendChild(desc);\n }\n\n if (!defs) {\n defs = $(\"defs\");\n res.node.appendChild(defs);\n }\n\n res.defs = defs;\n\n for (var key in proto) {\n if (proto[has](key)) {\n res[key] = proto[key];\n }\n }\n\n res.paper = res.root = res;\n } else {\n res = make(\"svg\", glob.doc.body);\n $(res.node, {\n height: h,\n version: 1.1,\n width: w,\n xmlns: xmlns\n });\n }\n\n return res;\n }\n\n function wrap(dom) {\n if (!dom) {\n return dom;\n }\n\n if (dom instanceof Element || dom instanceof Fragment) {\n return dom;\n }\n\n if (dom.tagName && dom.tagName.toLowerCase() == \"svg\") {\n return new Paper(dom);\n }\n\n if (dom.tagName && dom.tagName.toLowerCase() == \"object\" && dom.type == \"image/svg+xml\") {\n return new Paper(dom.contentDocument.getElementsByTagName(\"svg\")[0]);\n }\n\n return new Element(dom);\n }\n\n Snap._.make = make;\n Snap._.wrap = wrap;\n /*\\\n * Paper.el\n [ method ]\n **\n * Creates an element on paper with a given name and no attributes\n **\n - name (string) tag name\n - attr (object) attributes\n = (Element) the current element\n > Usage\n | var c = paper.circle(10, 10, 10); // is the same as...\n | var c = paper.el(\"circle\").attr({\n | cx: 10,\n | cy: 10,\n | r: 10\n | });\n | // and the same as\n | var c = paper.el(\"circle\", {\n | cx: 10,\n | cy: 10,\n | r: 10\n | });\n \\*/\n\n Paper.prototype.el = function (name, attr) {\n var el = make(name, this.node);\n attr && el.attr(attr);\n return el;\n };\n /*\\\n * Element.children\n [ method ]\n **\n * Returns array of all the children of the element.\n = (array) array of Elements\n \\*/\n\n\n Element.prototype.children = function () {\n var out = [],\n ch = this.node.childNodes;\n\n for (var i = 0, ii = ch.length; i < ii; i++) {\n out[i] = Snap(ch[i]);\n }\n\n return out;\n };\n\n function jsonFiller(root, o) {\n for (var i = 0, ii = root.length; i < ii; i++) {\n var item = {\n type: root[i].type,\n attr: root[i].attr()\n },\n children = root[i].children();\n o.push(item);\n\n if (children.length) {\n jsonFiller(children, item.childNodes = []);\n }\n }\n }\n /*\\\n * Element.toJSON\n [ method ]\n **\n * Returns object representation of the given element and all its children.\n = (object) in format\n o {\n o type (string) this.type,\n o attr (object) attributes map,\n o childNodes (array) optional array of children in the same format\n o }\n \\*/\n\n\n Element.prototype.toJSON = function () {\n var out = [];\n jsonFiller([this], out);\n return out[0];\n }; // default\n\n\n eve.on(\"snap.util.getattr\", function () {\n var att = eve.nt();\n att = att.substring(att.lastIndexOf(\".\") + 1);\n var css = att.replace(/[A-Z]/g, function (letter) {\n return \"-\" + letter.toLowerCase();\n });\n\n if (cssAttr[has](css)) {\n return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);\n } else {\n return $(this.node, att);\n }\n });\n var cssAttr = {\n \"alignment-baseline\": 0,\n \"baseline-shift\": 0,\n \"clip\": 0,\n \"clip-path\": 0,\n \"clip-rule\": 0,\n \"color\": 0,\n \"color-interpolation\": 0,\n \"color-interpolation-filters\": 0,\n \"color-profile\": 0,\n \"color-rendering\": 0,\n \"cursor\": 0,\n \"direction\": 0,\n \"display\": 0,\n \"dominant-baseline\": 0,\n \"enable-background\": 0,\n \"fill\": 0,\n \"fill-opacity\": 0,\n \"fill-rule\": 0,\n \"filter\": 0,\n \"flood-color\": 0,\n \"flood-opacity\": 0,\n \"font\": 0,\n \"font-family\": 0,\n \"font-size\": 0,\n \"font-size-adjust\": 0,\n \"font-stretch\": 0,\n \"font-style\": 0,\n \"font-variant\": 0,\n \"font-weight\": 0,\n \"glyph-orientation-horizontal\": 0,\n \"glyph-orientation-vertical\": 0,\n \"image-rendering\": 0,\n \"kerning\": 0,\n \"letter-spacing\": 0,\n \"lighting-color\": 0,\n \"marker\": 0,\n \"marker-end\": 0,\n \"marker-mid\": 0,\n \"marker-start\": 0,\n \"mask\": 0,\n \"opacity\": 0,\n \"overflow\": 0,\n \"pointer-events\": 0,\n \"shape-rendering\": 0,\n \"stop-color\": 0,\n \"stop-opacity\": 0,\n \"stroke\": 0,\n \"stroke-dasharray\": 0,\n \"stroke-dashoffset\": 0,\n \"stroke-linecap\": 0,\n \"stroke-linejoin\": 0,\n \"stroke-miterlimit\": 0,\n \"stroke-opacity\": 0,\n \"stroke-width\": 0,\n \"text-anchor\": 0,\n \"text-decoration\": 0,\n \"text-rendering\": 0,\n \"unicode-bidi\": 0,\n \"visibility\": 0,\n \"word-spacing\": 0,\n \"writing-mode\": 0\n };\n eve.on(\"snap.util.attr\", function (value) {\n var att = eve.nt(),\n attr = {};\n att = att.substring(att.lastIndexOf(\".\") + 1);\n attr[att] = value;\n var style = att.replace(/-(\\w)/gi, function (all, letter) {\n return letter.toUpperCase();\n }),\n css = att.replace(/[A-Z]/g, function (letter) {\n return \"-\" + letter.toLowerCase();\n });\n\n if (cssAttr[has](css)) {\n this.node.style[style] = value == null ? E : value;\n } else {\n $(this.node, attr);\n }\n });\n\n (function (proto) {})(Paper.prototype); // simple ajax\n\n /*\\\n * Snap.ajax\n [ method ]\n **\n * Simple implementation of Ajax\n **\n - url (string) URL\n - postData (object|string) data for post request\n - callback (function) callback\n - scope (object) #optional scope of callback\n * or\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n = (XMLHttpRequest) the XMLHttpRequest object, just in case\n \\*/\n\n\n Snap.ajax = function (url, postData, callback, scope) {\n var req = new XMLHttpRequest(),\n id = ID();\n\n if (req) {\n if (is(postData, \"function\")) {\n scope = callback;\n callback = postData;\n postData = null;\n } else if (is(postData, \"object\")) {\n var pd = [];\n\n for (var key in postData) {\n if (postData.hasOwnProperty(key)) {\n pd.push(encodeURIComponent(key) + \"=\" + encodeURIComponent(postData[key]));\n }\n }\n\n postData = pd.join(\"&\");\n }\n\n req.open(postData ? \"POST\" : \"GET\", url, true);\n\n if (postData) {\n req.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n }\n\n if (callback) {\n eve.once(\"snap.ajax.\" + id + \".0\", callback);\n eve.once(\"snap.ajax.\" + id + \".200\", callback);\n eve.once(\"snap.ajax.\" + id + \".304\", callback);\n }\n\n req.onreadystatechange = function () {\n if (req.readyState != 4) return;\n eve(\"snap.ajax.\" + id + \".\" + req.status, scope, req);\n };\n\n if (req.readyState == 4) {\n return req;\n }\n\n req.send(postData);\n return req;\n }\n };\n /*\\\n * Snap.load\n [ method ]\n **\n * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)\n **\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n \\*/\n\n\n Snap.load = function (url, callback, scope) {\n Snap.ajax(url, function (req) {\n var f = Snap.parse(req.responseText);\n scope ? callback.call(scope, f) : callback(f);\n });\n };\n\n var getOffset = function getOffset(elem) {\n var box = elem.getBoundingClientRect(),\n doc = elem.ownerDocument,\n body = doc.body,\n docElem = doc.documentElement,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop) - clientTop,\n left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;\n return {\n y: top,\n x: left\n };\n };\n /*\\\n * Snap.getElementByPoint\n [ method ]\n **\n * Returns you topmost element under given point.\n **\n = (object) Snap element object\n - x (number) x coordinate from the top left corner of the window\n - y (number) y coordinate from the top left corner of the window\n > Usage\n | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: \"#f00\"});\n \\*/\n\n\n Snap.getElementByPoint = function (x, y) {\n var paper = this,\n svg = paper.canvas,\n target = glob.doc.elementFromPoint(x, y);\n\n if (glob.win.opera && target.tagName == \"svg\") {\n var so = getOffset(target),\n sr = target.createSVGRect();\n sr.x = x - so.x;\n sr.y = y - so.y;\n sr.width = sr.height = 1;\n var hits = target.getIntersectionList(sr, null);\n\n if (hits.length) {\n target = hits[hits.length - 1];\n }\n }\n\n if (!target) {\n return null;\n }\n\n return wrap(target);\n };\n /*\\\n * Snap.plugin\n [ method ]\n **\n * Let you write plugins. You pass in a function with five arguments, like this:\n | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {\n | Snap.newmethod = function () {};\n | Element.prototype.newmethod = function () {};\n | Paper.prototype.newmethod = function () {};\n | });\n * Inside the function you have access to all main objects (and their\n * prototypes). This allow you to extend anything you want.\n **\n - f (function) your plugin body\n \\*/\n\n\n Snap.plugin = function (f) {\n f(Snap, Element, Paper, glob, Fragment);\n };\n\n glob.win.Snap = Snap;\n return Snap;\n}(window || this); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var elproto = Element.prototype,\n is = Snap.is,\n Str = String,\n unit2px = Snap._unit2px,\n $ = Snap._.$,\n make = Snap._.make,\n getSomeDefs = Snap._.getSomeDefs,\n has = \"hasOwnProperty\",\n wrap = Snap._.wrap;\n /*\\\n * Element.getBBox\n [ method ]\n **\n * Returns the bounding box descriptor for the given element\n **\n = (object) bounding box descriptor:\n o {\n o cx: (number) x of the center,\n o cy: (number) x of the center,\n o h: (number) height,\n o height: (number) height,\n o path: (string) path command for the box,\n o r0: (number) radius of a circle that fully encloses the box,\n o r1: (number) radius of the smallest circle that can be enclosed,\n o r2: (number) radius of the largest circle that can be enclosed,\n o vb: (string) box as a viewbox command,\n o w: (number) width,\n o width: (number) width,\n o x2: (number) x of the right side,\n o x: (number) x of the left side,\n o y2: (number) y of the bottom edge,\n o y: (number) y of the top edge\n o }\n \\*/\n\n elproto.getBBox = function (isWithoutTransform) {\n if (this.type == \"tspan\") {\n return Snap._.box(this.node.getClientRects().item(0));\n }\n\n if (!Snap.Matrix || !Snap.path) {\n return this.node.getBBox();\n }\n\n var el = this,\n m = new Snap.Matrix();\n\n if (el.removed) {\n return Snap._.box();\n }\n\n while (el.type == \"use\") {\n if (!isWithoutTransform) {\n m = m.add(el.transform().localMatrix.translate(el.attr(\"x\") || 0, el.attr(\"y\") || 0));\n }\n\n if (el.original) {\n el = el.original;\n } else {\n var href = el.attr(\"xlink:href\");\n el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf(\"#\") + 1));\n }\n }\n\n var _ = el._,\n pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;\n\n try {\n if (isWithoutTransform) {\n _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());\n return Snap._.box(_.bboxwt);\n } else {\n el.realPath = pathfinder(el);\n el.matrix = el.transform().localMatrix;\n _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));\n return Snap._.box(_.bbox);\n }\n } catch (e) {\n // Firefox doesn’t give you bbox of hidden element\n return Snap._.box();\n }\n };\n\n var propString = function propString() {\n return this.string;\n };\n\n function extractTransform(el, tstr) {\n if (tstr == null) {\n var doReturn = true;\n\n if (el.type == \"linearGradient\" || el.type == \"radialGradient\") {\n tstr = el.node.getAttribute(\"gradientTransform\");\n } else if (el.type == \"pattern\") {\n tstr = el.node.getAttribute(\"patternTransform\");\n } else {\n tstr = el.node.getAttribute(\"transform\");\n }\n\n if (!tstr) {\n return new Snap.Matrix();\n }\n\n tstr = Snap._.svgTransform2string(tstr);\n } else {\n if (!Snap._.rgTransform.test(tstr)) {\n tstr = Snap._.svgTransform2string(tstr);\n } else {\n tstr = Str(tstr).replace(/\\.{3}|\\u2026/g, el._.transform || \"\");\n }\n\n if (is(tstr, \"array\")) {\n tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);\n }\n\n el._.transform = tstr;\n }\n\n var m = Snap._.transform2matrix(tstr, el.getBBox(1));\n\n if (doReturn) {\n return m;\n } else {\n el.matrix = m;\n }\n }\n /*\\\n * Element.transform\n [ method ]\n **\n * Gets or sets transformation of the element\n **\n - tstr (string) transform string in Snap or SVG format\n = (Element) the current element\n * or\n = (object) transformation descriptor:\n o {\n o string (string) transform string,\n o globalMatrix (Matrix) matrix of all transformations applied to element or its parents,\n o localMatrix (Matrix) matrix of transformations applied only to the element,\n o diffMatrix (Matrix) matrix of difference between global and local transformations,\n o global (string) global transformation as string,\n o local (string) local transformation as string,\n o toString (function) returns `string` property\n o }\n \\*/\n\n\n elproto.transform = function (tstr) {\n var _ = this._;\n\n if (tstr == null) {\n var papa = this,\n global = new Snap.Matrix(this.node.getCTM()),\n local = extractTransform(this),\n ms = [local],\n m = new Snap.Matrix(),\n i,\n localString = local.toTransformString(),\n string = Str(local) == Str(this.matrix) ? Str(_.transform) : localString;\n\n while (papa.type != \"svg\" && (papa = papa.parent())) {\n ms.push(extractTransform(papa));\n }\n\n i = ms.length;\n\n while (i--) {\n m.add(ms[i]);\n }\n\n return {\n string: string,\n globalMatrix: global,\n totalMatrix: m,\n localMatrix: local,\n diffMatrix: global.clone().add(local.invert()),\n global: global.toTransformString(),\n total: m.toTransformString(),\n local: localString,\n toString: propString\n };\n }\n\n if (tstr instanceof Snap.Matrix) {\n this.matrix = tstr;\n this._.transform = tstr.toTransformString();\n } else {\n extractTransform(this, tstr);\n }\n\n if (this.node) {\n if (this.type == \"linearGradient\" || this.type == \"radialGradient\") {\n $(this.node, {\n gradientTransform: this.matrix\n });\n } else if (this.type == \"pattern\") {\n $(this.node, {\n patternTransform: this.matrix\n });\n } else {\n $(this.node, {\n transform: this.matrix\n });\n }\n }\n\n return this;\n };\n /*\\\n * Element.parent\n [ method ]\n **\n * Returns the element's parent\n **\n = (Element) the parent element\n \\*/\n\n\n elproto.parent = function () {\n return wrap(this.node.parentNode);\n };\n /*\\\n * Element.append\n [ method ]\n **\n * Appends the given element to current one\n **\n - el (Element|Set) element to append\n = (Element) the parent element\n \\*/\n\n /*\\\n * Element.add\n [ method ]\n **\n * See @Element.append\n \\*/\n\n\n elproto.append = elproto.add = function (el) {\n if (el) {\n if (el.type == \"set\") {\n var it = this;\n el.forEach(function (el) {\n it.add(el);\n });\n return this;\n }\n\n el = wrap(el);\n this.node.appendChild(el.node);\n el.paper = this.paper;\n }\n\n return this;\n };\n /*\\\n * Element.appendTo\n [ method ]\n **\n * Appends the current element to the given one\n **\n - el (Element) parent element to append to\n = (Element) the child element\n \\*/\n\n\n elproto.appendTo = function (el) {\n if (el) {\n el = wrap(el);\n el.append(this);\n }\n\n return this;\n };\n /*\\\n * Element.prepend\n [ method ]\n **\n * Prepends the given element to the current one\n **\n - el (Element) element to prepend\n = (Element) the parent element\n \\*/\n\n\n elproto.prepend = function (el) {\n if (el) {\n if (el.type == \"set\") {\n var it = this,\n first;\n el.forEach(function (el) {\n if (first) {\n first.after(el);\n } else {\n it.prepend(el);\n }\n\n first = el;\n });\n return this;\n }\n\n el = wrap(el);\n var parent = el.parent();\n this.node.insertBefore(el.node, this.node.firstChild);\n this.add && this.add();\n el.paper = this.paper;\n this.parent() && this.parent().add();\n parent && parent.add();\n }\n\n return this;\n };\n /*\\\n * Element.prependTo\n [ method ]\n **\n * Prepends the current element to the given one\n **\n - el (Element) parent element to prepend to\n = (Element) the child element\n \\*/\n\n\n elproto.prependTo = function (el) {\n el = wrap(el);\n el.prepend(this);\n return this;\n };\n /*\\\n * Element.before\n [ method ]\n **\n * Inserts given element before the current one\n **\n - el (Element) element to insert\n = (Element) the parent element\n \\*/\n\n\n elproto.before = function (el) {\n if (el.type == \"set\") {\n var it = this;\n el.forEach(function (el) {\n var parent = el.parent();\n it.node.parentNode.insertBefore(el.node, it.node);\n parent && parent.add();\n });\n this.parent().add();\n return this;\n }\n\n el = wrap(el);\n var parent = el.parent();\n this.node.parentNode.insertBefore(el.node, this.node);\n this.parent() && this.parent().add();\n parent && parent.add();\n el.paper = this.paper;\n return this;\n };\n /*\\\n * Element.after\n [ method ]\n **\n * Inserts given element after the current one\n **\n - el (Element) element to insert\n = (Element) the parent element\n \\*/\n\n\n elproto.after = function (el) {\n el = wrap(el);\n var parent = el.parent();\n\n if (this.node.nextSibling) {\n this.node.parentNode.insertBefore(el.node, this.node.nextSibling);\n } else {\n this.node.parentNode.appendChild(el.node);\n }\n\n this.parent() && this.parent().add();\n parent && parent.add();\n el.paper = this.paper;\n return this;\n };\n /*\\\n * Element.insertBefore\n [ method ]\n **\n * Inserts the element after the given one\n **\n - el (Element) element next to whom insert to\n = (Element) the parent element\n \\*/\n\n\n elproto.insertBefore = function (el) {\n el = wrap(el);\n var parent = this.parent();\n el.node.parentNode.insertBefore(this.node, el.node);\n this.paper = el.paper;\n parent && parent.add();\n el.parent() && el.parent().add();\n return this;\n };\n /*\\\n * Element.insertAfter\n [ method ]\n **\n * Inserts the element after the given one\n **\n - el (Element) element next to whom insert to\n = (Element) the parent element\n \\*/\n\n\n elproto.insertAfter = function (el) {\n el = wrap(el);\n var parent = this.parent();\n el.node.parentNode.insertBefore(this.node, el.node.nextSibling);\n this.paper = el.paper;\n parent && parent.add();\n el.parent() && el.parent().add();\n return this;\n };\n /*\\\n * Element.remove\n [ method ]\n **\n * Removes element from the DOM\n = (Element) the detached element\n \\*/\n\n\n elproto.remove = function () {\n var parent = this.parent();\n this.node.parentNode && this.node.parentNode.removeChild(this.node);\n delete this.paper;\n this.removed = true;\n parent && parent.add();\n return this;\n };\n /*\\\n * Element.select\n [ method ]\n **\n * Gathers the nested @Element matching the given set of CSS selectors\n **\n - query (string) CSS selector\n = (Element) result of query selection\n \\*/\n\n\n elproto.select = function (query) {\n return wrap(this.node.querySelector(query));\n };\n /*\\\n * Element.selectAll\n [ method ]\n **\n * Gathers nested @Element objects matching the given set of CSS selectors\n **\n - query (string) CSS selector\n = (Set|array) result of query selection\n \\*/\n\n\n elproto.selectAll = function (query) {\n var nodelist = this.node.querySelectorAll(query),\n set = (Snap.set || Array)();\n\n for (var i = 0; i < nodelist.length; i++) {\n set.push(wrap(nodelist[i]));\n }\n\n return set;\n };\n /*\\\n * Element.asPX\n [ method ]\n **\n * Returns given attribute of the element as a `px` value (not %, em, etc.)\n **\n - attr (string) attribute name\n - value (string) #optional attribute value\n = (Element) result of query selection\n \\*/\n\n\n elproto.asPX = function (attr, value) {\n if (value == null) {\n value = this.attr(attr);\n }\n\n return +unit2px(this, attr, value);\n }; // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.\n\n /*\\\n * Element.use\n [ method ]\n **\n * Creates a `<use>` element linked to the current element\n **\n = (Element) the `<use>` element\n \\*/\n\n\n elproto.use = function () {\n var use,\n id = this.node.id;\n\n if (!id) {\n id = this.id;\n $(this.node, {\n id: id\n });\n }\n\n if (this.type == \"linearGradient\" || this.type == \"radialGradient\" || this.type == \"pattern\") {\n use = make(this.type, this.node.parentNode);\n } else {\n use = make(\"use\", this.node.parentNode);\n }\n\n $(use.node, {\n \"xlink:href\": \"#\" + id\n });\n use.original = this;\n return use;\n };\n\n function fixids(el) {\n var els = el.selectAll(\"*\"),\n it,\n url = /^\\s*url\\((\"|'|)(.*)\\1\\)\\s*$/,\n ids = [],\n uses = {};\n\n function urltest(it, name) {\n var val = $(it.node, name);\n val = val && val.match(url);\n val = val && val[2];\n\n if (val && val.charAt() == \"#\") {\n val = val.substring(1);\n } else {\n return;\n }\n\n if (val) {\n uses[val] = (uses[val] || []).concat(function (id) {\n var attr = {};\n attr[name] = Snap.url(id);\n $(it.node, attr);\n });\n }\n }\n\n function linktest(it) {\n var val = $(it.node, \"xlink:href\");\n\n if (val && val.charAt() == \"#\") {\n val = val.substring(1);\n } else {\n return;\n }\n\n if (val) {\n uses[val] = (uses[val] || []).concat(function (id) {\n it.attr(\"xlink:href\", \"#\" + id);\n });\n }\n }\n\n for (var i = 0, ii = els.length; i < ii; i++) {\n it = els[i];\n urltest(it, \"fill\");\n urltest(it, \"stroke\");\n urltest(it, \"filter\");\n urltest(it, \"mask\");\n urltest(it, \"clip-path\");\n linktest(it);\n var oldid = $(it.node, \"id\");\n\n if (oldid) {\n $(it.node, {\n id: it.id\n });\n ids.push({\n old: oldid,\n id: it.id\n });\n }\n }\n\n for (i = 0, ii = ids.length; i < ii; i++) {\n var fs = uses[ids[i].old];\n\n if (fs) {\n for (var j = 0, jj = fs.length; j < jj; j++) {\n fs[j](ids[i].id);\n }\n }\n }\n }\n /*\\\n * Element.clone\n [ method ]\n **\n * Creates a clone of the element and inserts it after the element\n **\n = (Element) the clone\n \\*/\n\n\n elproto.clone = function () {\n var clone = wrap(this.node.cloneNode(true));\n\n if ($(clone.node, \"id\")) {\n $(clone.node, {\n id: clone.id\n });\n }\n\n fixids(clone);\n clone.insertAfter(this);\n return clone;\n };\n /*\\\n * Element.toDefs\n [ method ]\n **\n * Moves element to the shared `<defs>` area\n **\n = (Element) the element\n \\*/\n\n\n elproto.toDefs = function () {\n var defs = getSomeDefs(this);\n defs.appendChild(this.node);\n return this;\n };\n /*\\\n * Element.toPattern\n [ method ]\n **\n * Creates a `<pattern>` element from the current element\n **\n * To create a pattern you have to specify the pattern rect:\n - x (string|number)\n - y (string|number)\n - width (string|number)\n - height (string|number)\n = (Element) the `<pattern>` element\n * You can use pattern later on as an argument for `fill` attribute:\n | var p = paper.path(\"M10-5-10,15M15,0,0,15M0-5-20,15\").attr({\n | fill: \"none\",\n | stroke: \"#bada55\",\n | strokeWidth: 5\n | }).pattern(0, 0, 10, 10),\n | c = paper.circle(200, 200, 100);\n | c.attr({\n | fill: p\n | });\n \\*/\n\n\n elproto.pattern = elproto.toPattern = function (x, y, width, height) {\n var p = make(\"pattern\", getSomeDefs(this));\n\n if (x == null) {\n x = this.getBBox();\n }\n\n if (is(x, \"object\") && \"x\" in x) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n\n $(p.node, {\n x: x,\n y: y,\n width: width,\n height: height,\n patternUnits: \"userSpaceOnUse\",\n id: p.id,\n viewBox: [x, y, width, height].join(\" \")\n });\n p.node.appendChild(this.node);\n return p;\n }; // SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.\n // SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?\n\n /*\\\n * Element.marker\n [ method ]\n **\n * Creates a `<marker>` element from the current element\n **\n * To create a marker you have to specify the bounding rect and reference point:\n - x (number)\n - y (number)\n - width (number)\n - height (number)\n - refX (number)\n - refY (number)\n = (Element) the `<marker>` element\n * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.\n \\*/\n // TODO add usage for markers\n\n\n elproto.marker = function (x, y, width, height, refX, refY) {\n var p = make(\"marker\", getSomeDefs(this));\n\n if (x == null) {\n x = this.getBBox();\n }\n\n if (is(x, \"object\") && \"x\" in x) {\n y = x.y;\n width = x.width;\n height = x.height;\n refX = x.refX || x.cx;\n refY = x.refY || x.cy;\n x = x.x;\n }\n\n $(p.node, {\n viewBox: [x, y, width, height].join(\" \"),\n markerWidth: width,\n markerHeight: height,\n orient: \"auto\",\n refX: refX || 0,\n refY: refY || 0,\n id: p.id\n });\n p.node.appendChild(this.node);\n return p;\n };\n\n var eldata = {};\n /*\\\n * Element.data\n [ method ]\n **\n * Adds or retrieves given value associated with given key. (Don’t confuse\n * with `data-` attributes)\n *\n * See also @Element.removeData\n - key (string) key to store data\n - value (any) #optional value to store\n = (object) @Element\n * or, if value is not specified:\n = (any) value\n > Usage\n | for (var i = 0, i < 5, i++) {\n | paper.circle(10 + 15 * i, 10, 10)\n | .attr({fill: \"#000\"})\n | .data(\"i\", i)\n | .click(function () {\n | alert(this.data(\"i\"));\n | });\n | }\n \\*/\n\n elproto.data = function (key, value) {\n var data = eldata[this.id] = eldata[this.id] || {};\n\n if (arguments.length == 0) {\n eve(\"snap.data.get.\" + this.id, this, data, null);\n return data;\n }\n\n if (arguments.length == 1) {\n if (Snap.is(key, \"object\")) {\n for (var i in key) {\n if (key[has](i)) {\n this.data(i, key[i]);\n }\n }\n\n return this;\n }\n\n eve(\"snap.data.get.\" + this.id, this, data[key], key);\n return data[key];\n }\n\n data[key] = value;\n eve(\"snap.data.set.\" + this.id, this, value, key);\n return this;\n };\n /*\\\n * Element.removeData\n [ method ]\n **\n * Removes value associated with an element by given key.\n * If key is not provided, removes all the data of the element.\n - key (string) #optional key\n = (object) @Element\n \\*/\n\n\n elproto.removeData = function (key) {\n if (key == null) {\n eldata[this.id] = {};\n } else {\n eldata[this.id] && delete eldata[this.id][key];\n }\n\n return this;\n };\n /*\\\n * Element.outerSVG\n [ method ]\n **\n * Returns SVG code for the element, equivalent to HTML's `outerHTML`.\n *\n * See also @Element.innerSVG\n = (string) SVG code for the element\n \\*/\n\n /*\\\n * Element.toString\n [ method ]\n **\n * See @Element.outerSVG\n \\*/\n\n\n elproto.outerSVG = elproto.toString = toString(1);\n /*\\\n * Element.innerSVG\n [ method ]\n **\n * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`\n = (string) SVG code for the element\n \\*/\n\n elproto.innerSVG = toString();\n\n function toString(type) {\n return function () {\n var res = type ? \"<\" + this.type : \"\",\n attr = this.node.attributes,\n chld = this.node.childNodes;\n\n if (type) {\n for (var i = 0, ii = attr.length; i < ii; i++) {\n res += \" \" + attr[i].name + '=\"' + attr[i].value.replace(/\"/g, '\\\\\"') + '\"';\n }\n }\n\n if (chld.length) {\n type && (res += \">\");\n\n for (i = 0, ii = chld.length; i < ii; i++) {\n if (chld[i].nodeType == 3) {\n res += chld[i].nodeValue;\n } else if (chld[i].nodeType == 1) {\n res += wrap(chld[i]).toString();\n }\n }\n\n type && (res += \"</\" + this.type + \">\");\n } else {\n type && (res += \"/>\");\n }\n\n return res;\n };\n }\n\n elproto.toDataURL = function () {\n if (window && window.btoa) {\n var bb = this.getBBox(),\n svg = Snap.format('<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"{width}\" height=\"{height}\" viewBox=\"{x} {y} {width} {height}\">{contents}</svg>', {\n x: +bb.x.toFixed(3),\n y: +bb.y.toFixed(3),\n width: +bb.width.toFixed(3),\n height: +bb.height.toFixed(3),\n contents: this.outerSVG()\n });\n return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(svg)));\n }\n };\n /*\\\n * Fragment.select\n [ method ]\n **\n * See @Element.select\n \\*/\n\n\n Fragment.prototype.select = elproto.select;\n /*\\\n * Fragment.selectAll\n [ method ]\n **\n * See @Element.selectAll\n \\*/\n\n Fragment.prototype.selectAll = elproto.selectAll;\n}); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var objectToString = Object.prototype.toString,\n Str = String,\n math = Math,\n E = \"\";\n\n function Matrix(a, b, c, d, e, f) {\n if (b == null && objectToString.call(a) == \"[object SVGMatrix]\") {\n this.a = a.a;\n this.b = a.b;\n this.c = a.c;\n this.d = a.d;\n this.e = a.e;\n this.f = a.f;\n return;\n }\n\n if (a != null) {\n this.a = +a;\n this.b = +b;\n this.c = +c;\n this.d = +d;\n this.e = +e;\n this.f = +f;\n } else {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.e = 0;\n this.f = 0;\n }\n }\n\n (function (matrixproto) {\n /*\\\n * Matrix.add\n [ method ]\n **\n * Adds the given matrix to existing one\n - a (number)\n - b (number)\n - c (number)\n - d (number)\n - e (number)\n - f (number)\n * or\n - matrix (object) @Matrix\n \\*/\n matrixproto.add = function (a, b, c, d, e, f) {\n if (a && a instanceof Matrix) {\n return this.add(a.a, a.b, a.c, a.d, a.e, a.f);\n }\n\n var aNew = a * this.a + b * this.c,\n bNew = a * this.b + b * this.d;\n this.e += e * this.a + f * this.c;\n this.f += e * this.b + f * this.d;\n this.c = c * this.a + d * this.c;\n this.d = c * this.b + d * this.d;\n this.a = aNew;\n this.b = bNew;\n return this;\n };\n /*\\\n * Matrix.multLeft\n [ method ]\n **\n * Multiplies a passed affine transform to the left: M * this.\n - a (number)\n - b (number)\n - c (number)\n - d (number)\n - e (number)\n - f (number)\n * or\n - matrix (object) @Matrix\n \\*/\n\n\n Matrix.prototype.multLeft = function (a, b, c, d, e, f) {\n if (a && a instanceof Matrix) {\n return this.multLeft(a.a, a.b, a.c, a.d, a.e, a.f);\n }\n\n var aNew = a * this.a + c * this.b,\n cNew = a * this.c + c * this.d,\n eNew = a * this.e + c * this.f + e;\n this.b = b * this.a + d * this.b;\n this.d = b * this.c + d * this.d;\n this.f = b * this.e + d * this.f + f;\n this.a = aNew;\n this.c = cNew;\n this.e = eNew;\n return this;\n };\n /*\\\n * Matrix.invert\n [ method ]\n **\n * Returns an inverted version of the matrix\n = (object) @Matrix\n \\*/\n\n\n matrixproto.invert = function () {\n var me = this,\n x = me.a * me.d - me.b * me.c;\n return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);\n };\n /*\\\n * Matrix.clone\n [ method ]\n **\n * Returns a copy of the matrix\n = (object) @Matrix\n \\*/\n\n\n matrixproto.clone = function () {\n return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);\n };\n /*\\\n * Matrix.translate\n [ method ]\n **\n * Translate the matrix\n - x (number) horizontal offset distance\n - y (number) vertical offset distance\n \\*/\n\n\n matrixproto.translate = function (x, y) {\n this.e += x * this.a + y * this.c;\n this.f += x * this.b + y * this.d;\n return this;\n };\n /*\\\n * Matrix.scale\n [ method ]\n **\n * Scales the matrix\n - x (number) amount to be scaled, with `1` resulting in no change\n - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)\n - cx (number) #optional horizontal origin point from which to scale\n - cy (number) #optional vertical origin point from which to scale\n * Default cx, cy is the middle point of the element.\n \\*/\n\n\n matrixproto.scale = function (x, y, cx, cy) {\n y == null && (y = x);\n (cx || cy) && this.translate(cx, cy);\n this.a *= x;\n this.b *= x;\n this.c *= y;\n this.d *= y;\n (cx || cy) && this.translate(-cx, -cy);\n return this;\n };\n /*\\\n * Matrix.rotate\n [ method ]\n **\n * Rotates the matrix\n - a (number) angle of rotation, in degrees\n - x (number) horizontal origin point from which to rotate\n - y (number) vertical origin point from which to rotate\n \\*/\n\n\n matrixproto.rotate = function (a, x, y) {\n a = Snap.rad(a);\n x = x || 0;\n y = y || 0;\n var cos = +math.cos(a).toFixed(9),\n sin = +math.sin(a).toFixed(9);\n this.add(cos, sin, -sin, cos, x, y);\n return this.add(1, 0, 0, 1, -x, -y);\n };\n /*\\\n * Matrix.skewX\n [ method ]\n **\n * Skews the matrix along the x-axis\n - x (number) Angle to skew along the x-axis (in degrees).\n \\*/\n\n\n matrixproto.skewX = function (x) {\n return this.skew(x, 0);\n };\n /*\\\n * Matrix.skewY\n [ method ]\n **\n * Skews the matrix along the y-axis\n - y (number) Angle to skew along the y-axis (in degrees).\n \\*/\n\n\n matrixproto.skewY = function (y) {\n return this.skew(0, y);\n };\n /*\\\n * Matrix.skew\n [ method ]\n **\n * Skews the matrix\n - y (number) Angle to skew along the y-axis (in degrees).\n - x (number) Angle to skew along the x-axis (in degrees).\n \\*/\n\n\n matrixproto.skew = function (x, y) {\n x = x || 0;\n y = y || 0;\n x = Snap.rad(x);\n y = Snap.rad(y);\n var c = math.tan(x).toFixed(9);\n var b = math.tan(y).toFixed(9);\n return this.add(1, b, c, 1, 0, 0);\n };\n /*\\\n * Matrix.x\n [ method ]\n **\n * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y\n - x (number)\n - y (number)\n = (number) x\n \\*/\n\n\n matrixproto.x = function (x, y) {\n return x * this.a + y * this.c + this.e;\n };\n /*\\\n * Matrix.y\n [ method ]\n **\n * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x\n - x (number)\n - y (number)\n = (number) y\n \\*/\n\n\n matrixproto.y = function (x, y) {\n return x * this.b + y * this.d + this.f;\n };\n\n matrixproto.get = function (i) {\n return +this[Str.fromCharCode(97 + i)].toFixed(4);\n };\n\n matrixproto.toString = function () {\n return \"matrix(\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + \")\";\n };\n\n matrixproto.offset = function () {\n return [this.e.toFixed(4), this.f.toFixed(4)];\n };\n\n function norm(a) {\n return a[0] * a[0] + a[1] * a[1];\n }\n\n function normalize(a) {\n var mag = math.sqrt(norm(a));\n a[0] && (a[0] /= mag);\n a[1] && (a[1] /= mag);\n }\n /*\\\n * Matrix.determinant\n [ method ]\n **\n * Finds determinant of the given matrix.\n = (number) determinant\n \\*/\n\n\n matrixproto.determinant = function () {\n return this.a * this.d - this.b * this.c;\n };\n /*\\\n * Matrix.split\n [ method ]\n **\n * Splits matrix into primitive transformations\n = (object) in format:\n o dx (number) translation by x\n o dy (number) translation by y\n o scalex (number) scale by x\n o scaley (number) scale by y\n o shear (number) shear\n o rotate (number) rotation in deg\n o isSimple (boolean) could it be represented via simple transformations\n \\*/\n\n\n matrixproto.split = function () {\n var out = {}; // translation\n\n out.dx = this.e;\n out.dy = this.f; // scale and shear\n\n var row = [[this.a, this.b], [this.c, this.d]];\n out.scalex = math.sqrt(norm(row[0]));\n normalize(row[0]);\n out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];\n row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];\n out.scaley = math.sqrt(norm(row[1]));\n normalize(row[1]);\n out.shear /= out.scaley;\n\n if (this.determinant() < 0) {\n out.scalex = -out.scalex;\n } // rotation\n\n\n var sin = row[0][1],\n cos = row[1][1];\n\n if (cos < 0) {\n out.rotate = Snap.deg(math.acos(cos));\n\n if (sin < 0) {\n out.rotate = 360 - out.rotate;\n }\n } else {\n out.rotate = Snap.deg(math.asin(sin));\n }\n\n out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);\n out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;\n out.noRotation = !+out.shear.toFixed(9) && !out.rotate;\n return out;\n };\n /*\\\n * Matrix.toTransformString\n [ method ]\n **\n * Returns transform string that represents given matrix\n = (string) transform string\n \\*/\n\n\n matrixproto.toTransformString = function (shorter) {\n var s = shorter || this.split();\n\n if (!+s.shear.toFixed(9)) {\n s.scalex = +s.scalex.toFixed(4);\n s.scaley = +s.scaley.toFixed(4);\n s.rotate = +s.rotate.toFixed(4);\n return (s.dx || s.dy ? \"t\" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) + (s.rotate ? \"r\" + [+s.rotate.toFixed(4), 0, 0] : E) + (s.scalex != 1 || s.scaley != 1 ? \"s\" + [s.scalex, s.scaley, 0, 0] : E);\n } else {\n return \"m\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];\n }\n };\n })(Matrix.prototype);\n /*\\\n * Snap.Matrix\n [ method ]\n **\n * Matrix constructor, extend on your own risk.\n * To create matrices use @Snap.matrix.\n \\*/\n\n\n Snap.Matrix = Matrix;\n /*\\\n * Snap.matrix\n [ method ]\n **\n * Utility method\n **\n * Returns a matrix based on the given parameters\n - a (number)\n - b (number)\n - c (number)\n - d (number)\n - e (number)\n - f (number)\n * or\n - svgMatrix (SVGMatrix)\n = (object) @Matrix\n \\*/\n\n Snap.matrix = function (a, b, c, d, e, f) {\n return new Matrix(a, b, c, d, e, f);\n };\n}); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var has = \"hasOwnProperty\",\n make = Snap._.make,\n wrap = Snap._.wrap,\n is = Snap.is,\n getSomeDefs = Snap._.getSomeDefs,\n reURLValue = /^url\\((['\"]?)([^)]+)\\1\\)$/,\n $ = Snap._.$,\n URL = Snap.url,\n Str = String,\n separator = Snap._.separator,\n E = \"\";\n /*\\\n * Snap.deurl\n [ method ]\n **\n * Unwraps path from `\"url(<path>)\"`.\n - value (string) url path\n = (string) unwrapped path\n \\*/\n\n Snap.deurl = function (value) {\n var res = String(value).match(reURLValue);\n return res ? res[2] : value;\n }; // Attributes event handlers\n\n\n eve.on(\"snap.util.attr.mask\", function (value) {\n if (value instanceof Element || value instanceof Fragment) {\n eve.stop();\n\n if (value instanceof Fragment && value.node.childNodes.length == 1) {\n value = value.node.firstChild;\n getSomeDefs(this).appendChild(value);\n value = wrap(value);\n }\n\n if (value.type == \"mask\") {\n var mask = value;\n } else {\n mask = make(\"mask\", getSomeDefs(this));\n mask.node.appendChild(value.node);\n }\n\n !mask.node.id && $(mask.node, {\n id: mask.id\n });\n $(this.node, {\n mask: URL(mask.id)\n });\n }\n });\n\n (function (clipIt) {\n eve.on(\"snap.util.attr.clip\", clipIt);\n eve.on(\"snap.util.attr.clip-path\", clipIt);\n eve.on(\"snap.util.attr.clipPath\", clipIt);\n })(function (value) {\n if (value instanceof Element || value instanceof Fragment) {\n eve.stop();\n var clip,\n node = value.node;\n\n while (node) {\n if (node.nodeName === \"clipPath\") {\n clip = new Element(node);\n break;\n }\n\n if (node.nodeName === \"svg\") {\n clip = undefined;\n break;\n }\n\n node = node.parentNode;\n }\n\n if (!clip) {\n clip = make(\"clipPath\", getSomeDefs(this));\n clip.node.appendChild(value.node);\n !clip.node.id && $(clip.node, {\n id: clip.id\n });\n }\n\n $(this.node, {\n \"clip-path\": URL(clip.node.id || clip.id)\n });\n }\n });\n\n function fillStroke(name) {\n return function (value) {\n eve.stop();\n\n if (value instanceof Fragment && value.node.childNodes.length == 1 && (value.node.firstChild.tagName == \"radialGradient\" || value.node.firstChild.tagName == \"linearGradient\" || value.node.firstChild.tagName == \"pattern\")) {\n value = value.node.firstChild;\n getSomeDefs(this).appendChild(value);\n value = wrap(value);\n }\n\n if (value instanceof Element) {\n if (value.type == \"radialGradient\" || value.type == \"linearGradient\" || value.type == \"pattern\") {\n if (!value.node.id) {\n $(value.node, {\n id: value.id\n });\n }\n\n var fill = URL(value.node.id);\n } else {\n fill = value.attr(name);\n }\n } else {\n fill = Snap.color(value);\n\n if (fill.error) {\n var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);\n\n if (grad) {\n if (!grad.node.id) {\n $(grad.node, {\n id: grad.id\n });\n }\n\n fill = URL(grad.node.id);\n } else {\n fill = value;\n }\n } else {\n fill = Str(fill);\n }\n }\n\n var attrs = {};\n attrs[name] = fill;\n $(this.node, attrs);\n this.node.style[name] = E;\n };\n }\n\n eve.on(\"snap.util.attr.fill\", fillStroke(\"fill\"));\n eve.on(\"snap.util.attr.stroke\", fillStroke(\"stroke\"));\n var gradrg = /^([lr])(?:\\(([^)]*)\\))?(.*)$/i;\n eve.on(\"snap.util.grad.parse\", function parseGrad(string) {\n string = Str(string);\n var tokens = string.match(gradrg);\n\n if (!tokens) {\n return null;\n }\n\n var type = tokens[1],\n params = tokens[2],\n stops = tokens[3];\n params = params.split(/\\s*,\\s*/).map(function (el) {\n return +el == el ? +el : el;\n });\n\n if (params.length == 1 && params[0] == 0) {\n params = [];\n }\n\n stops = stops.split(\"-\");\n stops = stops.map(function (el) {\n el = el.split(\":\");\n var out = {\n color: el[0]\n };\n\n if (el[1]) {\n out.offset = parseFloat(el[1]);\n }\n\n return out;\n });\n var len = stops.length,\n start = 0,\n j = 0;\n\n function seed(i, end) {\n var step = (end - start) / (i - j);\n\n for (var k = j; k < i; k++) {\n stops[k].offset = +(+start + step * (k - j)).toFixed(2);\n }\n\n j = i;\n start = end;\n }\n\n len--;\n\n for (var i = 0; i < len; i++) {\n if (\"offset\" in stops[i]) {\n seed(i, stops[i].offset);\n }\n }\n\n stops[len].offset = stops[len].offset || 100;\n seed(len, stops[len].offset);\n return {\n type: type,\n params: params,\n stops: stops\n };\n });\n eve.on(\"snap.util.attr.d\", function (value) {\n eve.stop();\n\n if (is(value, \"array\") && is(value[0], \"array\")) {\n value = Snap.path.toString.call(value);\n }\n\n value = Str(value);\n\n if (value.match(/[ruo]/i)) {\n value = Snap.path.toAbsolute(value);\n }\n\n $(this.node, {\n d: value\n });\n })(-1);\n eve.on(\"snap.util.attr.#text\", function (value) {\n eve.stop();\n value = Str(value);\n var txt = glob.doc.createTextNode(value);\n\n while (this.node.firstChild) {\n this.node.removeChild(this.node.firstChild);\n }\n\n this.node.appendChild(txt);\n })(-1);\n eve.on(\"snap.util.attr.path\", function (value) {\n eve.stop();\n this.attr({\n d: value\n });\n })(-1);\n eve.on(\"snap.util.attr.class\", function (value) {\n eve.stop();\n this.node.className.baseVal = value;\n })(-1);\n eve.on(\"snap.util.attr.viewBox\", function (value) {\n var vb;\n\n if (is(value, \"object\") && \"x\" in value) {\n vb = [value.x, value.y, value.width, value.height].join(\" \");\n } else if (is(value, \"array\")) {\n vb = value.join(\" \");\n } else {\n vb = value;\n }\n\n $(this.node, {\n viewBox: vb\n });\n eve.stop();\n })(-1);\n eve.on(\"snap.util.attr.transform\", function (value) {\n this.transform(value);\n eve.stop();\n })(-1);\n eve.on(\"snap.util.attr.r\", function (value) {\n if (this.type == \"rect\") {\n eve.stop();\n $(this.node, {\n rx: value,\n ry: value\n });\n }\n })(-1);\n eve.on(\"snap.util.attr.textpath\", function (value) {\n eve.stop();\n\n if (this.type == \"text\") {\n var id, tp, node;\n\n if (!value && this.textPath) {\n tp = this.textPath;\n\n while (tp.node.firstChild) {\n this.node.appendChild(tp.node.firstChild);\n }\n\n tp.remove();\n delete this.textPath;\n return;\n }\n\n if (is(value, \"string\")) {\n var defs = getSomeDefs(this),\n path = wrap(defs.parentNode).path(value);\n defs.appendChild(path.node);\n id = path.id;\n path.attr({\n id: id\n });\n } else {\n value = wrap(value);\n\n if (value instanceof Element) {\n id = value.attr(\"id\");\n\n if (!id) {\n id = value.id;\n value.attr({\n id: id\n });\n }\n }\n }\n\n if (id) {\n tp = this.textPath;\n node = this.node;\n\n if (tp) {\n tp.attr({\n \"xlink:href\": \"#\" + id\n });\n } else {\n tp = $(\"textPath\", {\n \"xlink:href\": \"#\" + id\n });\n\n while (node.firstChild) {\n tp.appendChild(node.firstChild);\n }\n\n node.appendChild(tp);\n this.textPath = wrap(tp);\n }\n }\n }\n })(-1);\n eve.on(\"snap.util.attr.text\", function (value) {\n if (this.type == \"text\") {\n var i = 0,\n node = this.node,\n tuner = function tuner(chunk) {\n var out = $(\"tspan\");\n\n if (is(chunk, \"array\")) {\n for (var i = 0; i < chunk.length; i++) {\n out.appendChild(tuner(chunk[i]));\n }\n } else {\n out.appendChild(glob.doc.createTextNode(chunk));\n }\n\n out.normalize && out.normalize();\n return out;\n };\n\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n\n var tuned = tuner(value);\n\n while (tuned.firstChild) {\n node.appendChild(tuned.firstChild);\n }\n }\n\n eve.stop();\n })(-1);\n\n function setFontSize(value) {\n eve.stop();\n\n if (value == +value) {\n value += \"px\";\n }\n\n this.node.style.fontSize = value;\n }\n\n eve.on(\"snap.util.attr.fontSize\", setFontSize)(-1);\n eve.on(\"snap.util.attr.font-size\", setFontSize)(-1);\n eve.on(\"snap.util.getattr.transform\", function () {\n eve.stop();\n return this.transform();\n })(-1);\n eve.on(\"snap.util.getattr.textpath\", function () {\n eve.stop();\n return this.textPath;\n })(-1); // Markers\n\n (function () {\n function getter(end) {\n return function () {\n eve.stop();\n var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue(\"marker-\" + end);\n\n if (style == \"none\") {\n return style;\n } else {\n return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));\n }\n };\n }\n\n function setter(end) {\n return function (value) {\n eve.stop();\n var name = \"marker\" + end.charAt(0).toUpperCase() + end.substring(1);\n\n if (value == \"\" || !value) {\n this.node.style[name] = \"none\";\n return;\n }\n\n if (value.type == \"marker\") {\n var id = value.node.id;\n\n if (!id) {\n $(value.node, {\n id: value.id\n });\n }\n\n this.node.style[name] = URL(id);\n return;\n }\n };\n }\n\n eve.on(\"snap.util.getattr.marker-end\", getter(\"end\"))(-1);\n eve.on(\"snap.util.getattr.markerEnd\", getter(\"end\"))(-1);\n eve.on(\"snap.util.getattr.marker-start\", getter(\"start\"))(-1);\n eve.on(\"snap.util.getattr.markerStart\", getter(\"start\"))(-1);\n eve.on(\"snap.util.getattr.marker-mid\", getter(\"mid\"))(-1);\n eve.on(\"snap.util.getattr.markerMid\", getter(\"mid\"))(-1);\n eve.on(\"snap.util.attr.marker-end\", setter(\"end\"))(-1);\n eve.on(\"snap.util.attr.markerEnd\", setter(\"end\"))(-1);\n eve.on(\"snap.util.attr.marker-start\", setter(\"start\"))(-1);\n eve.on(\"snap.util.attr.markerStart\", setter(\"start\"))(-1);\n eve.on(\"snap.util.attr.marker-mid\", setter(\"mid\"))(-1);\n eve.on(\"snap.util.attr.markerMid\", setter(\"mid\"))(-1);\n })();\n\n eve.on(\"snap.util.getattr.r\", function () {\n if (this.type == \"rect\" && $(this.node, \"rx\") == $(this.node, \"ry\")) {\n eve.stop();\n return $(this.node, \"rx\");\n }\n })(-1);\n\n function textExtract(node) {\n var out = [];\n var children = node.childNodes;\n\n for (var i = 0, ii = children.length; i < ii; i++) {\n var chi = children[i];\n\n if (chi.nodeType == 3) {\n out.push(chi.nodeValue);\n }\n\n if (chi.tagName == \"tspan\") {\n if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {\n out.push(chi.firstChild.nodeValue);\n } else {\n out.push(textExtract(chi));\n }\n }\n }\n\n return out;\n }\n\n eve.on(\"snap.util.getattr.text\", function () {\n if (this.type == \"text\" || this.type == \"tspan\") {\n eve.stop();\n var out = textExtract(this.node);\n return out.length == 1 ? out[0] : out;\n }\n })(-1);\n eve.on(\"snap.util.getattr.#text\", function () {\n return this.node.textContent;\n })(-1);\n eve.on(\"snap.util.getattr.fill\", function (internal) {\n if (internal) {\n return;\n }\n\n eve.stop();\n var value = eve(\"snap.util.getattr.fill\", this, true).firstDefined();\n return Snap(Snap.deurl(value)) || value;\n })(-1);\n eve.on(\"snap.util.getattr.stroke\", function (internal) {\n if (internal) {\n return;\n }\n\n eve.stop();\n var value = eve(\"snap.util.getattr.stroke\", this, true).firstDefined();\n return Snap(Snap.deurl(value)) || value;\n })(-1);\n eve.on(\"snap.util.getattr.viewBox\", function () {\n eve.stop();\n var vb = $(this.node, \"viewBox\");\n\n if (vb) {\n vb = vb.split(separator);\n return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);\n } else {\n return;\n }\n })(-1);\n eve.on(\"snap.util.getattr.points\", function () {\n var p = $(this.node, \"points\");\n eve.stop();\n\n if (p) {\n return p.split(separator);\n } else {\n return;\n }\n })(-1);\n eve.on(\"snap.util.getattr.path\", function () {\n var p = $(this.node, \"d\");\n eve.stop();\n return p;\n })(-1);\n eve.on(\"snap.util.getattr.class\", function () {\n return this.node.className.baseVal;\n })(-1);\n\n function getFontSize() {\n eve.stop();\n return this.node.style.fontSize;\n }\n\n eve.on(\"snap.util.getattr.fontSize\", getFontSize)(-1);\n eve.on(\"snap.util.getattr.font-size\", getFontSize)(-1);\n}); // Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var rgNotSpace = /\\S+/g,\n rgBadSpace = /[\\t\\r\\n\\f]/g,\n rgTrim = /(^\\s+|\\s+$)/g,\n Str = String,\n elproto = Element.prototype;\n /*\\\n * Element.addClass\n [ method ]\n **\n * Adds given class name or list of class names to the element.\n - value (string) class name or space separated list of class names\n **\n = (Element) original element.\n \\*/\n\n elproto.addClass = function (value) {\n var classes = Str(value || \"\").match(rgNotSpace) || [],\n elem = this.node,\n className = elem.className.baseVal,\n curClasses = className.match(rgNotSpace) || [],\n j,\n pos,\n clazz,\n finalValue;\n\n if (classes.length) {\n j = 0;\n\n while (clazz = classes[j++]) {\n pos = curClasses.indexOf(clazz);\n\n if (!~pos) {\n curClasses.push(clazz);\n }\n }\n\n finalValue = curClasses.join(\" \");\n\n if (className != finalValue) {\n elem.className.baseVal = finalValue;\n }\n }\n\n return this;\n };\n /*\\\n * Element.removeClass\n [ method ]\n **\n * Removes given class name or list of class names from the element.\n - value (string) class name or space separated list of class names\n **\n = (Element) original element.\n \\*/\n\n\n elproto.removeClass = function (value) {\n var classes = Str(value || \"\").match(rgNotSpace) || [],\n elem = this.node,\n className = elem.className.baseVal,\n curClasses = className.match(rgNotSpace) || [],\n j,\n pos,\n clazz,\n finalValue;\n\n if (curClasses.length) {\n j = 0;\n\n while (clazz = classes[j++]) {\n pos = curClasses.indexOf(clazz);\n\n if (~pos) {\n curClasses.splice(pos, 1);\n }\n }\n\n finalValue = curClasses.join(\" \");\n\n if (className != finalValue) {\n elem.className.baseVal = finalValue;\n }\n }\n\n return this;\n };\n /*\\\n * Element.hasClass\n [ method ]\n **\n * Checks if the element has a given class name in the list of class names applied to it.\n - value (string) class name\n **\n = (boolean) `true` if the element has given class\n \\*/\n\n\n elproto.hasClass = function (value) {\n var elem = this.node,\n className = elem.className.baseVal,\n curClasses = className.match(rgNotSpace) || [];\n return !!~curClasses.indexOf(value);\n };\n /*\\\n * Element.toggleClass\n [ method ]\n **\n * Add or remove one or more classes from the element, depending on either\n * the class’s presence or the value of the `flag` argument.\n - value (string) class name or space separated list of class names\n - flag (boolean) value to determine whether the class should be added or removed\n **\n = (Element) original element.\n \\*/\n\n\n elproto.toggleClass = function (value, flag) {\n if (flag != null) {\n if (flag) {\n return this.addClass(value);\n } else {\n return this.removeClass(value);\n }\n }\n\n var classes = (value || \"\").match(rgNotSpace) || [],\n elem = this.node,\n className = elem.className.baseVal,\n curClasses = className.match(rgNotSpace) || [],\n j,\n pos,\n clazz,\n finalValue;\n j = 0;\n\n while (clazz = classes[j++]) {\n pos = curClasses.indexOf(clazz);\n\n if (~pos) {\n curClasses.splice(pos, 1);\n } else {\n curClasses.push(clazz);\n }\n }\n\n finalValue = curClasses.join(\" \");\n\n if (className != finalValue) {\n elem.className.baseVal = finalValue;\n }\n\n return this;\n };\n}); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var operators = {\n \"+\": function _(x, y) {\n return x + y;\n },\n \"-\": function _(x, y) {\n return x - y;\n },\n \"/\": function _(x, y) {\n return x / y;\n },\n \"*\": function _(x, y) {\n return x * y;\n }\n },\n Str = String,\n reUnit = /[a-z]+$/i,\n reAddon = /^\\s*([+\\-\\/*])\\s*=\\s*([\\d.eE+\\-]+)\\s*([^\\d\\s]+)?\\s*$/;\n\n function getNumber(val) {\n return val;\n }\n\n function getUnit(unit) {\n return function (val) {\n return +val.toFixed(3) + unit;\n };\n }\n\n eve.on(\"snap.util.attr\", function (val) {\n var plus = Str(val).match(reAddon);\n\n if (plus) {\n var evnt = eve.nt(),\n name = evnt.substring(evnt.lastIndexOf(\".\") + 1),\n a = this.attr(name),\n atr = {};\n eve.stop();\n var unit = plus[3] || \"\",\n aUnit = a.match(reUnit),\n op = operators[plus[1]];\n\n if (aUnit && aUnit == unit) {\n val = op(parseFloat(a), +plus[2]);\n } else {\n a = this.asPX(name);\n val = op(this.asPX(name), this.asPX(name, plus[2] + unit));\n }\n\n if (isNaN(a) || isNaN(val)) {\n return;\n }\n\n atr[name] = val;\n this.attr(atr);\n }\n })(-10);\n eve.on(\"snap.util.equal\", function (name, b) {\n var A,\n B,\n a = Str(this.attr(name) || \"\"),\n el = this,\n bplus = Str(b).match(reAddon);\n\n if (bplus) {\n eve.stop();\n var unit = bplus[3] || \"\",\n aUnit = a.match(reUnit),\n op = operators[bplus[1]];\n\n if (aUnit && aUnit == unit) {\n return {\n from: parseFloat(a),\n to: op(parseFloat(a), +bplus[2]),\n f: getUnit(aUnit)\n };\n } else {\n a = this.asPX(name);\n return {\n from: a,\n to: op(a, this.asPX(name, bplus[2] + unit)),\n f: getNumber\n };\n }\n }\n })(-10);\n}); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var proto = Paper.prototype,\n is = Snap.is;\n /*\\\n * Paper.rect\n [ method ]\n *\n * Draws a rectangle\n **\n - x (number) x coordinate of the top left corner\n - y (number) y coordinate of the top left corner\n - width (number) width\n - height (number) height\n - rx (number) #optional horizontal radius for rounded corners, default is 0\n - ry (number) #optional vertical radius for rounded corners, default is rx or 0\n = (object) the `rect` element\n **\n > Usage\n | // regular rectangle\n | var c = paper.rect(10, 10, 50, 50);\n | // rectangle with rounded corners\n | var c = paper.rect(40, 40, 50, 50, 10);\n \\*/\n\n proto.rect = function (x, y, w, h, rx, ry) {\n var attr;\n\n if (ry == null) {\n ry = rx;\n }\n\n if (is(x, \"object\") && x == \"[object Object]\") {\n attr = x;\n } else if (x != null) {\n attr = {\n x: x,\n y: y,\n width: w,\n height: h\n };\n\n if (rx != null) {\n attr.rx = rx;\n attr.ry = ry;\n }\n }\n\n return this.el(\"rect\", attr);\n };\n /*\\\n * Paper.circle\n [ method ]\n **\n * Draws a circle\n **\n - x (number) x coordinate of the centre\n - y (number) y coordinate of the centre\n - r (number) radius\n = (object) the `circle` element\n **\n > Usage\n | var c = paper.circle(50, 50, 40);\n \\*/\n\n\n proto.circle = function (cx, cy, r) {\n var attr;\n\n if (is(cx, \"object\") && cx == \"[object Object]\") {\n attr = cx;\n } else if (cx != null) {\n attr = {\n cx: cx,\n cy: cy,\n r: r\n };\n }\n\n return this.el(\"circle\", attr);\n };\n\n var preload = function () {\n function onerror() {\n this.parentNode.removeChild(this);\n }\n\n return function (src, f) {\n var img = glob.doc.createElement(\"img\"),\n body = glob.doc.body;\n img.style.cssText = \"position:absolute;left:-9999em;top:-9999em\";\n\n img.onload = function () {\n f.call(img);\n img.onload = img.onerror = null;\n body.removeChild(img);\n };\n\n img.onerror = onerror;\n body.appendChild(img);\n img.src = src;\n };\n }();\n /*\\\n * Paper.image\n [ method ]\n **\n * Places an image on the surface\n **\n - src (string) URI of the source image\n - x (number) x offset position\n - y (number) y offset position\n - width (number) width of the image\n - height (number) height of the image\n = (object) the `image` element\n * or\n = (object) Snap element object with type `image`\n **\n > Usage\n | var c = paper.image(\"apple.png\", 10, 10, 80, 80);\n \\*/\n\n\n proto.image = function (src, x, y, width, height) {\n var el = this.el(\"image\");\n\n if (is(src, \"object\") && \"src\" in src) {\n el.attr(src);\n } else if (src != null) {\n var set = {\n \"xlink:href\": src,\n preserveAspectRatio: \"none\"\n };\n\n if (x != null && y != null) {\n set.x = x;\n set.y = y;\n }\n\n if (width != null && height != null) {\n set.width = width;\n set.height = height;\n } else {\n preload(src, function () {\n Snap._.$(el.node, {\n width: this.offsetWidth,\n height: this.offsetHeight\n });\n });\n }\n\n Snap._.$(el.node, set);\n }\n\n return el;\n };\n /*\\\n * Paper.ellipse\n [ method ]\n **\n * Draws an ellipse\n **\n - x (number) x coordinate of the centre\n - y (number) y coordinate of the centre\n - rx (number) horizontal radius\n - ry (number) vertical radius\n = (object) the `ellipse` element\n **\n > Usage\n | var c = paper.ellipse(50, 50, 40, 20);\n \\*/\n\n\n proto.ellipse = function (cx, cy, rx, ry) {\n var attr;\n\n if (is(cx, \"object\") && cx == \"[object Object]\") {\n attr = cx;\n } else if (cx != null) {\n attr = {\n cx: cx,\n cy: cy,\n rx: rx,\n ry: ry\n };\n }\n\n return this.el(\"ellipse\", attr);\n }; // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.\n\n /*\\\n * Paper.path\n [ method ]\n **\n * Creates a `<path>` element using the given string as the path's definition\n - pathString (string) #optional path string in SVG format\n * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:\n | \"M10,20L30,40\"\n * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.\n *\n # <p>Here is short list of commands available, for more details see <a href=\"http://www.w3.org/TR/SVG/paths.html#PathData\" title=\"Details of a path's data attribute's format are described in the SVG specification.\">SVG path string format</a> or <a href=\"https://developer.mozilla.org/en/SVG/Tutorial/Paths\">article about path strings at MDN</a>.</p>\n # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>\n # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>\n # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>\n # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>\n # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>\n # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>\n # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>\n # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>\n # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>\n # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>\n # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>\n # <tr><td>R</td><td><a href=\"http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline\">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>\n * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.\n * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.\n > Usage\n | var c = paper.path(\"M10 10L90 90\");\n | // draw a diagonal line:\n | // move to 10,10, line to 90,90\n \\*/\n\n\n proto.path = function (d) {\n var attr;\n\n if (is(d, \"object\") && !is(d, \"array\")) {\n attr = d;\n } else if (d) {\n attr = {\n d: d\n };\n }\n\n return this.el(\"path\", attr);\n };\n /*\\\n * Paper.g\n [ method ]\n **\n * Creates a group element\n **\n - varargs (…) #optional elements to nest within the group\n = (object) the `g` element\n **\n > Usage\n | var c1 = paper.circle(),\n | c2 = paper.rect(),\n | g = paper.g(c2, c1); // note that the order of elements is different\n * or\n | var c1 = paper.circle(),\n | c2 = paper.rect(),\n | g = paper.g();\n | g.add(c2, c1);\n \\*/\n\n /*\\\n * Paper.group\n [ method ]\n **\n * See @Paper.g\n \\*/\n\n\n proto.group = proto.g = function (first) {\n var attr,\n el = this.el(\"g\");\n\n if (arguments.length == 1 && first && !first.type) {\n el.attr(first);\n } else if (arguments.length) {\n el.add(Array.prototype.slice.call(arguments, 0));\n }\n\n return el;\n };\n /*\\\n * Paper.svg\n [ method ]\n **\n * Creates a nested SVG element.\n - x (number) @optional X of the element\n - y (number) @optional Y of the element\n - width (number) @optional width of the element\n - height (number) @optional height of the element\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n **\n = (object) the `svg` element\n **\n \\*/\n\n\n proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {\n var attrs = {};\n\n if (is(x, \"object\") && y == null) {\n attrs = x;\n } else {\n if (x != null) {\n attrs.x = x;\n }\n\n if (y != null) {\n attrs.y = y;\n }\n\n if (width != null) {\n attrs.width = width;\n }\n\n if (height != null) {\n attrs.height = height;\n }\n\n if (vbx != null && vby != null && vbw != null && vbh != null) {\n attrs.viewBox = [vbx, vby, vbw, vbh];\n }\n }\n\n return this.el(\"svg\", attrs);\n };\n /*\\\n * Paper.mask\n [ method ]\n **\n * Equivalent in behaviour to @Paper.g, except it’s a mask.\n **\n = (object) the `mask` element\n **\n \\*/\n\n\n proto.mask = function (first) {\n var attr,\n el = this.el(\"mask\");\n\n if (arguments.length == 1 && first && !first.type) {\n el.attr(first);\n } else if (arguments.length) {\n el.add(Array.prototype.slice.call(arguments, 0));\n }\n\n return el;\n };\n /*\\\n * Paper.ptrn\n [ method ]\n **\n * Equivalent in behaviour to @Paper.g, except it’s a pattern.\n - x (number) @optional X of the element\n - y (number) @optional Y of the element\n - width (number) @optional width of the element\n - height (number) @optional height of the element\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n **\n = (object) the `pattern` element\n **\n \\*/\n\n\n proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {\n if (is(x, \"object\")) {\n var attr = x;\n } else {\n attr = {\n patternUnits: \"userSpaceOnUse\"\n };\n\n if (x) {\n attr.x = x;\n }\n\n if (y) {\n attr.y = y;\n }\n\n if (width != null) {\n attr.width = width;\n }\n\n if (height != null) {\n attr.height = height;\n }\n\n if (vx != null && vy != null && vw != null && vh != null) {\n attr.viewBox = [vx, vy, vw, vh];\n } else {\n attr.viewBox = [x || 0, y || 0, width || 0, height || 0];\n }\n }\n\n return this.el(\"pattern\", attr);\n };\n /*\\\n * Paper.use\n [ method ]\n **\n * Creates a <use> element.\n - id (string) @optional id of element to link\n * or\n - id (Element) @optional element to link\n **\n = (object) the `use` element\n **\n \\*/\n\n\n proto.use = function (id) {\n if (id != null) {\n if (id instanceof Element) {\n if (!id.attr(\"id\")) {\n id.attr({\n id: Snap._.id(id)\n });\n }\n\n id = id.attr(\"id\");\n }\n\n if (String(id).charAt() == \"#\") {\n id = id.substring(1);\n }\n\n return this.el(\"use\", {\n \"xlink:href\": \"#\" + id\n });\n } else {\n return Element.prototype.use.call(this);\n }\n };\n /*\\\n * Paper.symbol\n [ method ]\n **\n * Creates a <symbol> element.\n - vbx (number) @optional viewbox X\n - vby (number) @optional viewbox Y\n - vbw (number) @optional viewbox width\n - vbh (number) @optional viewbox height\n = (object) the `symbol` element\n **\n \\*/\n\n\n proto.symbol = function (vx, vy, vw, vh) {\n var attr = {};\n\n if (vx != null && vy != null && vw != null && vh != null) {\n attr.viewBox = [vx, vy, vw, vh];\n }\n\n return this.el(\"symbol\", attr);\n };\n /*\\\n * Paper.text\n [ method ]\n **\n * Draws a text string\n **\n - x (number) x coordinate position\n - y (number) y coordinate position\n - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements\n = (object) the `text` element\n **\n > Usage\n | var t1 = paper.text(50, 50, \"Snap\");\n | var t2 = paper.text(50, 50, [\"S\",\"n\",\"a\",\"p\"]);\n | // Text path usage\n | t1.attr({textpath: \"M10,10L100,100\"});\n | // or\n | var pth = paper.path(\"M10,10L100,100\");\n | t1.attr({textpath: pth});\n \\*/\n\n\n proto.text = function (x, y, text) {\n var attr = {};\n\n if (is(x, \"object\")) {\n attr = x;\n } else if (x != null) {\n attr = {\n x: x,\n y: y,\n text: text || \"\"\n };\n }\n\n return this.el(\"text\", attr);\n };\n /*\\\n * Paper.line\n [ method ]\n **\n * Draws a line\n **\n - x1 (number) x coordinate position of the start\n - y1 (number) y coordinate position of the start\n - x2 (number) x coordinate position of the end\n - y2 (number) y coordinate position of the end\n = (object) the `line` element\n **\n > Usage\n | var t1 = paper.line(50, 50, 100, 100);\n \\*/\n\n\n proto.line = function (x1, y1, x2, y2) {\n var attr = {};\n\n if (is(x1, \"object\")) {\n attr = x1;\n } else if (x1 != null) {\n attr = {\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n }\n\n return this.el(\"line\", attr);\n };\n /*\\\n * Paper.polyline\n [ method ]\n **\n * Draws a polyline\n **\n - points (array) array of points\n * or\n - varargs (…) points\n = (object) the `polyline` element\n **\n > Usage\n | var p1 = paper.polyline([10, 10, 100, 100]);\n | var p2 = paper.polyline(10, 10, 100, 100);\n \\*/\n\n\n proto.polyline = function (points) {\n if (arguments.length > 1) {\n points = Array.prototype.slice.call(arguments, 0);\n }\n\n var attr = {};\n\n if (is(points, \"object\") && !is(points, \"array\")) {\n attr = points;\n } else if (points != null) {\n attr = {\n points: points\n };\n }\n\n return this.el(\"polyline\", attr);\n };\n /*\\\n * Paper.polygon\n [ method ]\n **\n * Draws a polygon. See @Paper.polyline\n \\*/\n\n\n proto.polygon = function (points) {\n if (arguments.length > 1) {\n points = Array.prototype.slice.call(arguments, 0);\n }\n\n var attr = {};\n\n if (is(points, \"object\") && !is(points, \"array\")) {\n attr = points;\n } else if (points != null) {\n attr = {\n points: points\n };\n }\n\n return this.el(\"polygon\", attr);\n }; // gradients\n\n\n (function () {\n var $ = Snap._.$; // gradients' helpers\n\n /*\\\n * Element.stops\n [ method ]\n **\n * Only for gradients!\n * Returns array of gradient stops elements.\n = (array) the stops array.\n \\*/\n\n function Gstops() {\n return this.selectAll(\"stop\");\n }\n /*\\\n * Element.addStop\n [ method ]\n **\n * Only for gradients!\n * Adds another stop to the gradient.\n - color (string) stops color\n - offset (number) stops offset 0..100\n = (object) gradient element\n \\*/\n\n\n function GaddStop(color, offset) {\n var stop = $(\"stop\"),\n attr = {\n offset: +offset + \"%\"\n };\n color = Snap.color(color);\n attr[\"stop-color\"] = color.hex;\n\n if (color.opacity < 1) {\n attr[\"stop-opacity\"] = color.opacity;\n }\n\n $(stop, attr);\n var stops = this.stops(),\n inserted;\n\n for (var i = 0; i < stops.length; i++) {\n var stopOffset = parseFloat(stops[i].attr(\"offset\"));\n\n if (stopOffset > offset) {\n this.node.insertBefore(stop, stops[i].node);\n inserted = true;\n break;\n }\n }\n\n if (!inserted) {\n this.node.appendChild(stop);\n }\n\n return this;\n }\n\n function GgetBBox() {\n if (this.type == \"linearGradient\") {\n var x1 = $(this.node, \"x1\") || 0,\n x2 = $(this.node, \"x2\") || 1,\n y1 = $(this.node, \"y1\") || 0,\n y2 = $(this.node, \"y2\") || 0;\n return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));\n } else {\n var cx = this.node.cx || .5,\n cy = this.node.cy || .5,\n r = this.node.r || 0;\n return Snap._.box(cx - r, cy - r, r * 2, r * 2);\n }\n }\n /*\\\n * Element.setStops\n [ method ]\n **\n * Only for gradients!\n * Updates stops of the gradient based on passed gradient descriptor. See @Ppaer.gradient\n - str (string) gradient descriptor part after `()`.\n = (object) gradient element\n | var g = paper.gradient(\"l(0, 0, 1, 1)#000-#f00-#fff\");\n | g.setStops(\"#fff-#000-#f00-#fc0\");\n \\*/\n\n\n function GsetStops(str) {\n var grad = str,\n stops = this.stops();\n\n if (typeof str == \"string\") {\n grad = eve(\"snap.util.grad.parse\", null, \"l(0,0,0,1)\" + str).firstDefined().stops;\n }\n\n if (!Snap.is(grad, \"array\")) {\n return;\n }\n\n for (var i = 0; i < stops.length; i++) {\n if (grad[i]) {\n var color = Snap.color(grad[i].color),\n attr = {\n \"offset\": grad[i].offset + \"%\"\n };\n attr[\"stop-color\"] = color.hex;\n\n if (color.opacity < 1) {\n attr[\"stop-opacity\"] = color.opacity;\n }\n\n stops[i].attr(attr);\n } else {\n stops[i].remove();\n }\n }\n\n for (i = stops.length; i < grad.length; i++) {\n this.addStop(grad[i].color, grad[i].offset);\n }\n\n return this;\n }\n\n function gradient(defs, str) {\n var grad = eve(\"snap.util.grad.parse\", null, str).firstDefined(),\n el;\n\n if (!grad) {\n return null;\n }\n\n grad.params.unshift(defs);\n\n if (grad.type.toLowerCase() == \"l\") {\n el = gradientLinear.apply(0, grad.params);\n } else {\n el = gradientRadial.apply(0, grad.params);\n }\n\n if (grad.type != grad.type.toLowerCase()) {\n $(el.node, {\n gradientUnits: \"userSpaceOnUse\"\n });\n }\n\n var stops = grad.stops,\n len = stops.length;\n\n for (var i = 0; i < len; i++) {\n var stop = stops[i];\n el.addStop(stop.color, stop.offset);\n }\n\n return el;\n }\n\n function gradientLinear(defs, x1, y1, x2, y2) {\n var el = Snap._.make(\"linearGradient\", defs);\n\n el.stops = Gstops;\n el.addStop = GaddStop;\n el.getBBox = GgetBBox;\n el.setStops = GsetStops;\n\n if (x1 != null) {\n $(el.node, {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2\n });\n }\n\n return el;\n }\n\n function gradientRadial(defs, cx, cy, r, fx, fy) {\n var el = Snap._.make(\"radialGradient\", defs);\n\n el.stops = Gstops;\n el.addStop = GaddStop;\n el.getBBox = GgetBBox;\n\n if (cx != null) {\n $(el.node, {\n cx: cx,\n cy: cy,\n r: r\n });\n }\n\n if (fx != null && fy != null) {\n $(el.node, {\n fx: fx,\n fy: fy\n });\n }\n\n return el;\n }\n /*\\\n * Paper.gradient\n [ method ]\n **\n * Creates a gradient element\n **\n - gradient (string) gradient descriptor\n > Gradient Descriptor\n * The gradient descriptor is an expression formatted as\n * follows: `<type>(<coords>)<colors>`. The `<type>` can be\n * either linear or radial. The uppercase `L` or `R` letters\n * indicate absolute coordinates offset from the SVG surface.\n * Lowercase `l` or `r` letters indicate coordinates\n * calculated relative to the element to which the gradient is\n * applied. Coordinates specify a linear gradient vector as\n * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,\n * `r` and optional `fx`, `fy` specifying a focal point away\n * from the center of the circle. Specify `<colors>` as a list\n * of dash-separated CSS color values. Each color may be\n * followed by a custom offset value, separated with a colon\n * character.\n > Examples\n * Linear gradient, relative from top-left corner to bottom-right\n * corner, from black through red to white:\n | var g = paper.gradient(\"l(0, 0, 1, 1)#000-#f00-#fff\");\n * Linear gradient, absolute from (0, 0) to (100, 100), from black\n * through red at 25% to white:\n | var g = paper.gradient(\"L(0, 0, 100, 100)#000-#f00:25-#fff\");\n * Radial gradient, relative from the center of the element with radius\n * half the width, from black to white:\n | var g = paper.gradient(\"r(0.5, 0.5, 0.5)#000-#fff\");\n * To apply the gradient:\n | paper.circle(50, 50, 40).attr({\n | fill: g\n | });\n = (object) the `gradient` element\n \\*/\n\n\n proto.gradient = function (str) {\n return gradient(this.defs, str);\n };\n\n proto.gradientLinear = function (x1, y1, x2, y2) {\n return gradientLinear(this.defs, x1, y1, x2, y2);\n };\n\n proto.gradientRadial = function (cx, cy, r, fx, fy) {\n return gradientRadial(this.defs, cx, cy, r, fx, fy);\n };\n /*\\\n * Paper.toString\n [ method ]\n **\n * Returns SVG code for the @Paper\n = (string) SVG code for the @Paper\n \\*/\n\n\n proto.toString = function () {\n var doc = this.node.ownerDocument,\n f = doc.createDocumentFragment(),\n d = doc.createElement(\"div\"),\n svg = this.node.cloneNode(true),\n res;\n f.appendChild(d);\n d.appendChild(svg);\n\n Snap._.$(svg, {\n xmlns: \"http://www.w3.org/2000/svg\"\n });\n\n res = d.innerHTML;\n f.removeChild(f.firstChild);\n return res;\n };\n /*\\\n * Paper.toDataURL\n [ method ]\n **\n * Returns SVG code for the @Paper as Data URI string.\n = (string) Data URI string\n \\*/\n\n\n proto.toDataURL = function () {\n if (window && window.btoa) {\n return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(this)));\n }\n };\n /*\\\n * Paper.clear\n [ method ]\n **\n * Removes all child nodes of the paper, except <defs>.\n \\*/\n\n\n proto.clear = function () {\n var node = this.node.firstChild,\n next;\n\n while (node) {\n next = node.nextSibling;\n\n if (node.tagName != \"defs\") {\n node.parentNode.removeChild(node);\n } else {\n proto.clear.call({\n node: node\n });\n }\n\n node = next;\n }\n };\n })();\n}); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n is = Snap.is,\n clone = Snap._.clone,\n has = \"hasOwnProperty\",\n p2s = /,?([a-z]),?/gi,\n toFloat = parseFloat,\n math = Math,\n PI = math.PI,\n mmin = math.min,\n mmax = math.max,\n pow = math.pow,\n abs = math.abs;\n\n function paths(ps) {\n var p = paths.ps = paths.ps || {};\n\n if (p[ps]) {\n p[ps].sleep = 100;\n } else {\n p[ps] = {\n sleep: 100\n };\n }\n\n setTimeout(function () {\n for (var key in p) {\n if (p[has](key) && key != ps) {\n p[key].sleep--;\n !p[key].sleep && delete p[key];\n }\n }\n });\n return p[ps];\n }\n\n function box(x, y, width, height) {\n if (x == null) {\n x = y = width = height = 0;\n }\n\n if (y == null) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n\n return {\n x: x,\n y: y,\n width: width,\n w: width,\n height: height,\n h: height,\n x2: x + width,\n y2: y + height,\n cx: x + width / 2,\n cy: y + height / 2,\n r1: math.min(width, height) / 2,\n r2: math.max(width, height) / 2,\n r0: math.sqrt(width * width + height * height) / 2,\n path: rectPath(x, y, width, height),\n vb: [x, y, width, height].join(\" \")\n };\n }\n\n function toString() {\n return this.join(\",\").replace(p2s, \"$1\");\n }\n\n function pathClone(pathArray) {\n var res = clone(pathArray);\n res.toString = toString;\n return res;\n }\n\n function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {\n if (length == null) {\n return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);\n } else {\n return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));\n }\n }\n\n function getLengthFactory(istotal, subpath) {\n function O(val) {\n return +(+val).toFixed(3);\n }\n\n return Snap._.cacher(function (path, length, onlystart) {\n if (path instanceof Element) {\n path = path.attr(\"d\");\n }\n\n path = path2curve(path);\n var x,\n y,\n p,\n l,\n sp = \"\",\n subpaths = {},\n point,\n len = 0;\n\n for (var i = 0, ii = path.length; i < ii; i++) {\n p = path[i];\n\n if (p[0] == \"M\") {\n x = +p[1];\n y = +p[2];\n } else {\n l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n\n if (len + l > length) {\n if (subpath && !subpaths.start) {\n point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n sp += [\"C\" + O(point.start.x), O(point.start.y), O(point.m.x), O(point.m.y), O(point.x), O(point.y)];\n\n if (onlystart) {\n return sp;\n }\n\n subpaths.start = sp;\n sp = [\"M\" + O(point.x), O(point.y) + \"C\" + O(point.n.x), O(point.n.y), O(point.end.x), O(point.end.y), O(p[5]), O(p[6])].join();\n len += l;\n x = +p[5];\n y = +p[6];\n continue;\n }\n\n if (!istotal && !subpath) {\n point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n return point;\n }\n }\n\n len += l;\n x = +p[5];\n y = +p[6];\n }\n\n sp += p.shift() + p;\n }\n\n subpaths.end = sp;\n point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);\n return point;\n }, null, Snap._.clone);\n }\n\n var getTotalLength = getLengthFactory(1),\n getPointAtLength = getLengthFactory(),\n getSubpathsAtLength = getLengthFactory(0, 1);\n\n function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t,\n t13 = pow(t1, 3),\n t12 = pow(t1, 2),\n t2 = t * t,\n t3 = t2 * t,\n x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,\n y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,\n mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),\n my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),\n nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),\n ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),\n ax = t1 * p1x + t * c1x,\n ay = t1 * p1y + t * c1y,\n cx = t1 * c2x + t * p2x,\n cy = t1 * c2y + t * p2y,\n alpha = 90 - math.atan2(mx - nx, my - ny) * 180 / PI; // (mx > nx || my < ny) && (alpha += 180);\n\n return {\n x: x,\n y: y,\n m: {\n x: mx,\n y: my\n },\n n: {\n x: nx,\n y: ny\n },\n start: {\n x: ax,\n y: ay\n },\n end: {\n x: cx,\n y: cy\n },\n alpha: alpha\n };\n }\n\n function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {\n if (!Snap.is(p1x, \"array\")) {\n p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];\n }\n\n var bbox = curveDim.apply(null, p1x);\n return box(bbox.min.x, bbox.min.y, bbox.max.x - bbox.min.x, bbox.max.y - bbox.min.y);\n }\n\n function isPointInsideBBox(bbox, x, y) {\n return x >= bbox.x && x <= bbox.x + bbox.width && y >= bbox.y && y <= bbox.y + bbox.height;\n }\n\n function isBBoxIntersect(bbox1, bbox2) {\n bbox1 = box(bbox1);\n bbox2 = box(bbox2);\n return isPointInsideBBox(bbox2, bbox1.x, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2) || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);\n }\n\n function base3(t, p1, p2, p3, p4) {\n var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,\n t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;\n return t * t2 - 3 * p1 + 3 * p2;\n }\n\n function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {\n if (z == null) {\n z = 1;\n }\n\n z = z > 1 ? 1 : z < 0 ? 0 : z;\n var z2 = z / 2,\n n = 12,\n Tvalues = [-.1252, .1252, -.3678, .3678, -.5873, .5873, -.7699, .7699, -.9041, .9041, -.9816, .9816],\n Cvalues = [0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472],\n sum = 0;\n\n for (var i = 0; i < n; i++) {\n var ct = z2 * Tvalues[i] + z2,\n xbase = base3(ct, x1, x2, x3, x4),\n ybase = base3(ct, y1, y2, y3, y4),\n comb = xbase * xbase + ybase * ybase;\n sum += Cvalues[i] * math.sqrt(comb);\n }\n\n return z2 * sum;\n }\n\n function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {\n if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {\n return;\n }\n\n var t = 1,\n step = t / 2,\n t2 = t - step,\n l,\n e = .01;\n l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n\n while (abs(l - ll) > e) {\n step /= 2;\n t2 += (l < ll ? 1 : -1) * step;\n l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n }\n\n return t2;\n }\n\n function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n if (mmax(x1, x2) < mmin(x3, x4) || mmin(x1, x2) > mmax(x3, x4) || mmax(y1, y2) < mmin(y3, y4) || mmin(y1, y2) > mmax(y3, y4)) {\n return;\n }\n\n var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),\n ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),\n denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n\n if (!denominator) {\n return;\n }\n\n var px = nx / denominator,\n py = ny / denominator,\n px2 = +px.toFixed(2),\n py2 = +py.toFixed(2);\n\n if (px2 < +mmin(x1, x2).toFixed(2) || px2 > +mmax(x1, x2).toFixed(2) || px2 < +mmin(x3, x4).toFixed(2) || px2 > +mmax(x3, x4).toFixed(2) || py2 < +mmin(y1, y2).toFixed(2) || py2 > +mmax(y1, y2).toFixed(2) || py2 < +mmin(y3, y4).toFixed(2) || py2 > +mmax(y3, y4).toFixed(2)) {\n return;\n }\n\n return {\n x: px,\n y: py\n };\n }\n\n function inter(bez1, bez2) {\n return interHelper(bez1, bez2);\n }\n\n function interCount(bez1, bez2) {\n return interHelper(bez1, bez2, 1);\n }\n\n function interHelper(bez1, bez2, justCount) {\n var bbox1 = bezierBBox(bez1),\n bbox2 = bezierBBox(bez2);\n\n if (!isBBoxIntersect(bbox1, bbox2)) {\n return justCount ? 0 : [];\n }\n\n var l1 = bezlen.apply(0, bez1),\n l2 = bezlen.apply(0, bez2),\n n1 = ~~(l1 / 8),\n n2 = ~~(l2 / 8),\n dots1 = [],\n dots2 = [],\n xy = {},\n res = justCount ? 0 : [];\n\n for (var i = 0; i < n1 + 1; i++) {\n var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));\n dots1.push({\n x: p.x,\n y: p.y,\n t: i / n1\n });\n }\n\n for (i = 0; i < n2 + 1; i++) {\n p = findDotsAtSegment.apply(0, bez2.concat(i / n2));\n dots2.push({\n x: p.x,\n y: p.y,\n t: i / n2\n });\n }\n\n for (i = 0; i < n1; i++) {\n for (var j = 0; j < n2; j++) {\n var di = dots1[i],\n di1 = dots1[i + 1],\n dj = dots2[j],\n dj1 = dots2[j + 1],\n ci = abs(di1.x - di.x) < .001 ? \"y\" : \"x\",\n cj = abs(dj1.x - dj.x) < .001 ? \"y\" : \"x\",\n is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);\n\n if (is) {\n if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {\n continue;\n }\n\n xy[is.x.toFixed(4)] = is.y.toFixed(4);\n var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),\n t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);\n\n if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {\n if (justCount) {\n res++;\n } else {\n res.push({\n x: is.x,\n y: is.y,\n t1: t1,\n t2: t2\n });\n }\n }\n }\n }\n }\n\n return res;\n }\n\n function pathIntersection(path1, path2) {\n return interPathHelper(path1, path2);\n }\n\n function pathIntersectionNumber(path1, path2) {\n return interPathHelper(path1, path2, 1);\n }\n\n function interPathHelper(path1, path2, justCount) {\n path1 = path2curve(path1);\n path2 = path2curve(path2);\n var x1,\n y1,\n x2,\n y2,\n x1m,\n y1m,\n x2m,\n y2m,\n bez1,\n bez2,\n res = justCount ? 0 : [];\n\n for (var i = 0, ii = path1.length; i < ii; i++) {\n var pi = path1[i];\n\n if (pi[0] == \"M\") {\n x1 = x1m = pi[1];\n y1 = y1m = pi[2];\n } else {\n if (pi[0] == \"C\") {\n bez1 = [x1, y1].concat(pi.slice(1));\n x1 = bez1[6];\n y1 = bez1[7];\n } else {\n bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];\n x1 = x1m;\n y1 = y1m;\n }\n\n for (var j = 0, jj = path2.length; j < jj; j++) {\n var pj = path2[j];\n\n if (pj[0] == \"M\") {\n x2 = x2m = pj[1];\n y2 = y2m = pj[2];\n } else {\n if (pj[0] == \"C\") {\n bez2 = [x2, y2].concat(pj.slice(1));\n x2 = bez2[6];\n y2 = bez2[7];\n } else {\n bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];\n x2 = x2m;\n y2 = y2m;\n }\n\n var intr = interHelper(bez1, bez2, justCount);\n\n if (justCount) {\n res += intr;\n } else {\n for (var k = 0, kk = intr.length; k < kk; k++) {\n intr[k].segment1 = i;\n intr[k].segment2 = j;\n intr[k].bez1 = bez1;\n intr[k].bez2 = bez2;\n }\n\n res = res.concat(intr);\n }\n }\n }\n }\n }\n\n return res;\n }\n\n function isPointInsidePath(path, x, y) {\n var bbox = pathBBox(path);\n return isPointInsideBBox(bbox, x, y) && interPathHelper(path, [[\"M\", x, y], [\"H\", bbox.x2 + 10]], 1) % 2 == 1;\n }\n\n function pathBBox(path) {\n var pth = paths(path);\n\n if (pth.bbox) {\n return clone(pth.bbox);\n }\n\n if (!path) {\n return box();\n }\n\n path = path2curve(path);\n var x = 0,\n y = 0,\n X = [],\n Y = [],\n p;\n\n for (var i = 0, ii = path.length; i < ii; i++) {\n p = path[i];\n\n if (p[0] == \"M\") {\n x = p[1];\n y = p[2];\n X.push(x);\n Y.push(y);\n } else {\n var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n X = X.concat(dim.min.x, dim.max.x);\n Y = Y.concat(dim.min.y, dim.max.y);\n x = p[5];\n y = p[6];\n }\n }\n\n var xmin = mmin.apply(0, X),\n ymin = mmin.apply(0, Y),\n xmax = mmax.apply(0, X),\n ymax = mmax.apply(0, Y),\n bb = box(xmin, ymin, xmax - xmin, ymax - ymin);\n pth.bbox = clone(bb);\n return bb;\n }\n\n function rectPath(x, y, w, h, r) {\n if (r) {\n return [[\"M\", +x + +r, y], [\"l\", w - r * 2, 0], [\"a\", r, r, 0, 0, 1, r, r], [\"l\", 0, h - r * 2], [\"a\", r, r, 0, 0, 1, -r, r], [\"l\", r * 2 - w, 0], [\"a\", r, r, 0, 0, 1, -r, -r], [\"l\", 0, r * 2 - h], [\"a\", r, r, 0, 0, 1, r, -r], [\"z\"]];\n }\n\n var res = [[\"M\", x, y], [\"l\", w, 0], [\"l\", 0, h], [\"l\", -w, 0], [\"z\"]];\n res.toString = toString;\n return res;\n }\n\n function ellipsePath(x, y, rx, ry, a) {\n if (a == null && ry == null) {\n ry = rx;\n }\n\n x = +x;\n y = +y;\n rx = +rx;\n ry = +ry;\n\n if (a != null) {\n var rad = Math.PI / 180,\n x1 = x + rx * Math.cos(-ry * rad),\n x2 = x + rx * Math.cos(-a * rad),\n y1 = y + rx * Math.sin(-ry * rad),\n y2 = y + rx * Math.sin(-a * rad),\n res = [[\"M\", x1, y1], [\"A\", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];\n } else {\n res = [[\"M\", x, y], [\"m\", 0, -ry], [\"a\", rx, ry, 0, 1, 1, 0, 2 * ry], [\"a\", rx, ry, 0, 1, 1, 0, -2 * ry], [\"z\"]];\n }\n\n res.toString = toString;\n return res;\n }\n\n var unit2px = Snap._unit2px,\n getPath = {\n path: function path(el) {\n return el.attr(\"path\");\n },\n circle: function circle(el) {\n var attr = unit2px(el);\n return ellipsePath(attr.cx, attr.cy, attr.r);\n },\n ellipse: function ellipse(el) {\n var attr = unit2px(el);\n return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);\n },\n rect: function rect(el) {\n var attr = unit2px(el);\n return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);\n },\n image: function image(el) {\n var attr = unit2px(el);\n return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);\n },\n line: function line(el) {\n return \"M\" + [el.attr(\"x1\") || 0, el.attr(\"y1\") || 0, el.attr(\"x2\"), el.attr(\"y2\")];\n },\n polyline: function polyline(el) {\n return \"M\" + el.attr(\"points\");\n },\n polygon: function polygon(el) {\n return \"M\" + el.attr(\"points\") + \"z\";\n },\n deflt: function deflt(el) {\n var bbox = el.node.getBBox();\n return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);\n }\n };\n\n function pathToRelative(pathArray) {\n var pth = paths(pathArray),\n lowerCase = String.prototype.toLowerCase;\n\n if (pth.rel) {\n return pathClone(pth.rel);\n }\n\n if (!Snap.is(pathArray, \"array\") || !Snap.is(pathArray && pathArray[0], \"array\")) {\n pathArray = Snap.parsePathString(pathArray);\n }\n\n var res = [],\n x = 0,\n y = 0,\n mx = 0,\n my = 0,\n start = 0;\n\n if (pathArray[0][0] == \"M\") {\n x = pathArray[0][1];\n y = pathArray[0][2];\n mx = x;\n my = y;\n start++;\n res.push([\"M\", x, y]);\n }\n\n for (var i = start, ii = pathArray.length; i < ii; i++) {\n var r = res[i] = [],\n pa = pathArray[i];\n\n if (pa[0] != lowerCase.call(pa[0])) {\n r[0] = lowerCase.call(pa[0]);\n\n switch (r[0]) {\n case \"a\":\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +(pa[6] - x).toFixed(3);\n r[7] = +(pa[7] - y).toFixed(3);\n break;\n\n case \"v\":\n r[1] = +(pa[1] - y).toFixed(3);\n break;\n\n case \"m\":\n mx = pa[1];\n my = pa[2];\n\n default:\n for (var j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +(pa[j] - (j % 2 ? x : y)).toFixed(3);\n }\n\n }\n } else {\n r = res[i] = [];\n\n if (pa[0] == \"m\") {\n mx = pa[1] + x;\n my = pa[2] + y;\n }\n\n for (var k = 0, kk = pa.length; k < kk; k++) {\n res[i][k] = pa[k];\n }\n }\n\n var len = res[i].length;\n\n switch (res[i][0]) {\n case \"z\":\n x = mx;\n y = my;\n break;\n\n case \"h\":\n x += +res[i][len - 1];\n break;\n\n case \"v\":\n y += +res[i][len - 1];\n break;\n\n default:\n x += +res[i][len - 2];\n y += +res[i][len - 1];\n }\n }\n\n res.toString = toString;\n pth.rel = pathClone(res);\n return res;\n }\n\n function pathToAbsolute(pathArray) {\n var pth = paths(pathArray);\n\n if (pth.abs) {\n return pathClone(pth.abs);\n }\n\n if (!is(pathArray, \"array\") || !is(pathArray && pathArray[0], \"array\")) {\n // rough assumption\n pathArray = Snap.parsePathString(pathArray);\n }\n\n if (!pathArray || !pathArray.length) {\n return [[\"M\", 0, 0]];\n }\n\n var res = [],\n x = 0,\n y = 0,\n mx = 0,\n my = 0,\n start = 0,\n pa0;\n\n if (pathArray[0][0] == \"M\") {\n x = +pathArray[0][1];\n y = +pathArray[0][2];\n mx = x;\n my = y;\n start++;\n res[0] = [\"M\", x, y];\n }\n\n var crz = pathArray.length == 3 && pathArray[0][0] == \"M\" && pathArray[1][0].toUpperCase() == \"R\" && pathArray[2][0].toUpperCase() == \"Z\";\n\n for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {\n res.push(r = []);\n pa = pathArray[i];\n pa0 = pa[0];\n\n if (pa0 != pa0.toUpperCase()) {\n r[0] = pa0.toUpperCase();\n\n switch (r[0]) {\n case \"A\":\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +pa[6] + x;\n r[7] = +pa[7] + y;\n break;\n\n case \"V\":\n r[1] = +pa[1] + y;\n break;\n\n case \"H\":\n r[1] = +pa[1] + x;\n break;\n\n case \"R\":\n var dots = [x, y].concat(pa.slice(1));\n\n for (var j = 2, jj = dots.length; j < jj; j++) {\n dots[j] = +dots[j] + x;\n dots[++j] = +dots[j] + y;\n }\n\n res.pop();\n res = res.concat(catmullRom2bezier(dots, crz));\n break;\n\n case \"O\":\n res.pop();\n dots = ellipsePath(x, y, pa[1], pa[2]);\n dots.push(dots[0]);\n res = res.concat(dots);\n break;\n\n case \"U\":\n res.pop();\n res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n r = [\"U\"].concat(res[res.length - 1].slice(-2));\n break;\n\n case \"M\":\n mx = +pa[1] + x;\n my = +pa[2] + y;\n\n default:\n for (j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +pa[j] + (j % 2 ? x : y);\n }\n\n }\n } else if (pa0 == \"R\") {\n dots = [x, y].concat(pa.slice(1));\n res.pop();\n res = res.concat(catmullRom2bezier(dots, crz));\n r = [\"R\"].concat(pa.slice(-2));\n } else if (pa0 == \"O\") {\n res.pop();\n dots = ellipsePath(x, y, pa[1], pa[2]);\n dots.push(dots[0]);\n res = res.concat(dots);\n } else if (pa0 == \"U\") {\n res.pop();\n res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n r = [\"U\"].concat(res[res.length - 1].slice(-2));\n } else {\n for (var k = 0, kk = pa.length; k < kk; k++) {\n r[k] = pa[k];\n }\n }\n\n pa0 = pa0.toUpperCase();\n\n if (pa0 != \"O\") {\n switch (r[0]) {\n case \"Z\":\n x = +mx;\n y = +my;\n break;\n\n case \"H\":\n x = r[1];\n break;\n\n case \"V\":\n y = r[1];\n break;\n\n case \"M\":\n mx = r[r.length - 2];\n my = r[r.length - 1];\n\n default:\n x = r[r.length - 2];\n y = r[r.length - 1];\n }\n }\n }\n\n res.toString = toString;\n pth.abs = pathClone(res);\n return res;\n }\n\n function l2c(x1, y1, x2, y2) {\n return [x1, y1, x2, y2, x2, y2];\n }\n\n function q2c(x1, y1, ax, ay, x2, y2) {\n var _13 = 1 / 3,\n _23 = 2 / 3;\n\n return [_13 * x1 + _23 * ax, _13 * y1 + _23 * ay, _13 * x2 + _23 * ax, _13 * y2 + _23 * ay, x2, y2];\n }\n\n function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {\n // for more information of where this math came from visit:\n // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n var _120 = PI * 120 / 180,\n rad = PI / 180 * (+angle || 0),\n res = [],\n xy,\n rotate = Snap._.cacher(function (x, y, rad) {\n var X = x * math.cos(rad) - y * math.sin(rad),\n Y = x * math.sin(rad) + y * math.cos(rad);\n return {\n x: X,\n y: Y\n };\n });\n\n if (!rx || !ry) {\n return [x1, y1, x2, y2, x2, y2];\n }\n\n if (!recursive) {\n xy = rotate(x1, y1, -rad);\n x1 = xy.x;\n y1 = xy.y;\n xy = rotate(x2, y2, -rad);\n x2 = xy.x;\n y2 = xy.y;\n var cos = math.cos(PI / 180 * angle),\n sin = math.sin(PI / 180 * angle),\n x = (x1 - x2) / 2,\n y = (y1 - y2) / 2;\n var h = x * x / (rx * rx) + y * y / (ry * ry);\n\n if (h > 1) {\n h = math.sqrt(h);\n rx = h * rx;\n ry = h * ry;\n }\n\n var rx2 = rx * rx,\n ry2 = ry * ry,\n k = (large_arc_flag == sweep_flag ? -1 : 1) * math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),\n cx = k * rx * y / ry + (x1 + x2) / 2,\n cy = k * -ry * x / rx + (y1 + y2) / 2,\n f1 = math.asin(((y1 - cy) / ry).toFixed(9)),\n f2 = math.asin(((y2 - cy) / ry).toFixed(9));\n f1 = x1 < cx ? PI - f1 : f1;\n f2 = x2 < cx ? PI - f2 : f2;\n f1 < 0 && (f1 = PI * 2 + f1);\n f2 < 0 && (f2 = PI * 2 + f2);\n\n if (sweep_flag && f1 > f2) {\n f1 = f1 - PI * 2;\n }\n\n if (!sweep_flag && f2 > f1) {\n f2 = f2 - PI * 2;\n }\n } else {\n f1 = recursive[0];\n f2 = recursive[1];\n cx = recursive[2];\n cy = recursive[3];\n }\n\n var df = f2 - f1;\n\n if (abs(df) > _120) {\n var f2old = f2,\n x2old = x2,\n y2old = y2;\n f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);\n x2 = cx + rx * math.cos(f2);\n y2 = cy + ry * math.sin(f2);\n res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);\n }\n\n df = f2 - f1;\n var c1 = math.cos(f1),\n s1 = math.sin(f1),\n c2 = math.cos(f2),\n s2 = math.sin(f2),\n t = math.tan(df / 4),\n hx = 4 / 3 * rx * t,\n hy = 4 / 3 * ry * t,\n m1 = [x1, y1],\n m2 = [x1 + hx * s1, y1 - hy * c1],\n m3 = [x2 + hx * s2, y2 - hy * c2],\n m4 = [x2, y2];\n m2[0] = 2 * m1[0] - m2[0];\n m2[1] = 2 * m1[1] - m2[1];\n\n if (recursive) {\n return [m2, m3, m4].concat(res);\n } else {\n res = [m2, m3, m4].concat(res).join().split(\",\");\n var newres = [];\n\n for (var i = 0, ii = res.length; i < ii; i++) {\n newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;\n }\n\n return newres;\n }\n }\n\n function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t;\n return {\n x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,\n y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y\n };\n } // Returns bounding box of cubic bezier curve.\n // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html\n // Original version: NISHIO Hirokazu\n // Modifications: https://github.com/timo22345\n\n\n function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {\n var tvalues = [],\n bounds = [[], []],\n a,\n b,\n c,\n t,\n t1,\n t2,\n b2ac,\n sqrtb2ac;\n\n for (var i = 0; i < 2; ++i) {\n if (i == 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n\n if (abs(a) < 1e-12) {\n if (abs(b) < 1e-12) {\n continue;\n }\n\n t = -c / b;\n\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n\n continue;\n }\n\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = math.sqrt(b2ac);\n\n if (b2ac < 0) {\n continue;\n }\n\n t1 = (-b + sqrtb2ac) / (2 * a);\n\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n\n t2 = (-b - sqrtb2ac) / (2 * a);\n\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n var x,\n y,\n j = tvalues.length,\n jlen = j,\n mt;\n\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;\n bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n return {\n min: {\n x: mmin.apply(0, bounds[0]),\n y: mmin.apply(0, bounds[1])\n },\n max: {\n x: mmax.apply(0, bounds[0]),\n y: mmax.apply(0, bounds[1])\n }\n };\n }\n\n function path2curve(path, path2) {\n var pth = !path2 && paths(path);\n\n if (!path2 && pth.curve) {\n return pathClone(pth.curve);\n }\n\n var p = pathToAbsolute(path),\n p2 = path2 && pathToAbsolute(path2),\n attrs = {\n x: 0,\n y: 0,\n bx: 0,\n by: 0,\n X: 0,\n Y: 0,\n qx: null,\n qy: null\n },\n attrs2 = {\n x: 0,\n y: 0,\n bx: 0,\n by: 0,\n X: 0,\n Y: 0,\n qx: null,\n qy: null\n },\n processPath = function processPath(path, d, pcom) {\n var nx, ny;\n\n if (!path) {\n return [\"C\", d.x, d.y, d.x, d.y, d.x, d.y];\n }\n\n !(path[0] in {\n T: 1,\n Q: 1\n }) && (d.qx = d.qy = null);\n\n switch (path[0]) {\n case \"M\":\n d.X = path[1];\n d.Y = path[2];\n break;\n\n case \"A\":\n path = [\"C\"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));\n break;\n\n case \"S\":\n if (pcom == \"C\" || pcom == \"S\") {\n // In \"S\" case we have to take into account, if the previous command is C/S.\n nx = d.x * 2 - d.bx; // And reflect the previous\n\n ny = d.y * 2 - d.by; // command's control point relative to the current point.\n } else {\n // or some else or nothing\n nx = d.x;\n ny = d.y;\n }\n\n path = [\"C\", nx, ny].concat(path.slice(1));\n break;\n\n case \"T\":\n if (pcom == \"Q\" || pcom == \"T\") {\n // In \"T\" case we have to take into account, if the previous command is Q/T.\n d.qx = d.x * 2 - d.qx; // And make a reflection similar\n\n d.qy = d.y * 2 - d.qy; // to case \"S\".\n } else {\n // or something else or nothing\n d.qx = d.x;\n d.qy = d.y;\n }\n\n path = [\"C\"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));\n break;\n\n case \"Q\":\n d.qx = path[1];\n d.qy = path[2];\n path = [\"C\"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));\n break;\n\n case \"L\":\n path = [\"C\"].concat(l2c(d.x, d.y, path[1], path[2]));\n break;\n\n case \"H\":\n path = [\"C\"].concat(l2c(d.x, d.y, path[1], d.y));\n break;\n\n case \"V\":\n path = [\"C\"].concat(l2c(d.x, d.y, d.x, path[1]));\n break;\n\n case \"Z\":\n path = [\"C\"].concat(l2c(d.x, d.y, d.X, d.Y));\n break;\n }\n\n return path;\n },\n fixArc = function fixArc(pp, i) {\n if (pp[i].length > 7) {\n pp[i].shift();\n var pi = pp[i];\n\n while (pi.length) {\n pcoms1[i] = \"A\"; // if created multiple C:s, their original seg is saved\n\n p2 && (pcoms2[i] = \"A\"); // the same as above\n\n pp.splice(i++, 0, [\"C\"].concat(pi.splice(0, 6)));\n }\n\n pp.splice(i, 1);\n ii = mmax(p.length, p2 && p2.length || 0);\n }\n },\n fixM = function fixM(path1, path2, a1, a2, i) {\n if (path1 && path2 && path1[i][0] == \"M\" && path2[i][0] != \"M\") {\n path2.splice(i, 0, [\"M\", a2.x, a2.y]);\n a1.bx = 0;\n a1.by = 0;\n a1.x = path1[i][1];\n a1.y = path1[i][2];\n ii = mmax(p.length, p2 && p2.length || 0);\n }\n },\n pcoms1 = [],\n // path commands of original path p\n pcoms2 = [],\n // path commands of original path p2\n pfirst = \"\",\n // temporary holder for original path command\n pcom = \"\"; // holder for previous path command of original path\n\n\n for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {\n p[i] && (pfirst = p[i][0]); // save current path command\n\n if (pfirst != \"C\") // C is not saved yet, because it may be result of conversion\n {\n pcoms1[i] = pfirst; // Save current path command\n\n i && (pcom = pcoms1[i - 1]); // Get previous path command pcom\n }\n\n p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath\n\n if (pcoms1[i] != \"A\" && pfirst == \"C\") pcoms1[i] = \"C\"; // A is the only command\n // which may produce multiple C:s\n // so we have to make sure that C is also C in original path\n\n fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1\n\n if (p2) {\n // the same procedures is done to p2\n p2[i] && (pfirst = p2[i][0]);\n\n if (pfirst != \"C\") {\n pcoms2[i] = pfirst;\n i && (pcom = pcoms2[i - 1]);\n }\n\n p2[i] = processPath(p2[i], attrs2, pcom);\n\n if (pcoms2[i] != \"A\" && pfirst == \"C\") {\n pcoms2[i] = \"C\";\n }\n\n fixArc(p2, i);\n }\n\n fixM(p, p2, attrs, attrs2, i);\n fixM(p2, p, attrs2, attrs, i);\n var seg = p[i],\n seg2 = p2 && p2[i],\n seglen = seg.length,\n seg2len = p2 && seg2.length;\n attrs.x = seg[seglen - 2];\n attrs.y = seg[seglen - 1];\n attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;\n attrs.by = toFloat(seg[seglen - 3]) || attrs.y;\n attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);\n attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);\n attrs2.x = p2 && seg2[seg2len - 2];\n attrs2.y = p2 && seg2[seg2len - 1];\n }\n\n if (!p2) {\n pth.curve = pathClone(p);\n }\n\n return p2 ? [p, p2] : p;\n }\n\n function mapPath(path, matrix) {\n if (!matrix) {\n return path;\n }\n\n var x, y, i, j, ii, jj, pathi;\n path = path2curve(path);\n\n for (i = 0, ii = path.length; i < ii; i++) {\n pathi = path[i];\n\n for (j = 1, jj = pathi.length; j < jj; j += 2) {\n x = matrix.x(pathi[j], pathi[j + 1]);\n y = matrix.y(pathi[j], pathi[j + 1]);\n pathi[j] = x;\n pathi[j + 1] = y;\n }\n }\n\n return path;\n } // http://schepers.cc/getting-to-the-point\n\n\n function catmullRom2bezier(crp, z) {\n var d = [];\n\n for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {\n var p = [{\n x: +crp[i - 2],\n y: +crp[i - 1]\n }, {\n x: +crp[i],\n y: +crp[i + 1]\n }, {\n x: +crp[i + 2],\n y: +crp[i + 3]\n }, {\n x: +crp[i + 4],\n y: +crp[i + 5]\n }];\n\n if (z) {\n if (!i) {\n p[0] = {\n x: +crp[iLen - 2],\n y: +crp[iLen - 1]\n };\n } else if (iLen - 4 == i) {\n p[3] = {\n x: +crp[0],\n y: +crp[1]\n };\n } else if (iLen - 2 == i) {\n p[2] = {\n x: +crp[0],\n y: +crp[1]\n };\n p[3] = {\n x: +crp[2],\n y: +crp[3]\n };\n }\n } else {\n if (iLen - 4 == i) {\n p[3] = p[2];\n } else if (!i) {\n p[0] = {\n x: +crp[i],\n y: +crp[i + 1]\n };\n }\n }\n\n d.push([\"C\", (-p[0].x + 6 * p[1].x + p[2].x) / 6, (-p[0].y + 6 * p[1].y + p[2].y) / 6, (p[1].x + 6 * p[2].x - p[3].x) / 6, (p[1].y + 6 * p[2].y - p[3].y) / 6, p[2].x, p[2].y]);\n }\n\n return d;\n } // export\n\n\n Snap.path = paths;\n /*\\\n * Snap.path.getTotalLength\n [ method ]\n **\n * Returns the length of the given path in pixels\n **\n - path (string) SVG path string\n **\n = (number) length\n \\*/\n\n Snap.path.getTotalLength = getTotalLength;\n /*\\\n * Snap.path.getPointAtLength\n [ method ]\n **\n * Returns the coordinates of the point located at the given length along the given path\n **\n - path (string) SVG path string\n - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n **\n = (object) representation of the point:\n o {\n o x: (number) x coordinate,\n o y: (number) y coordinate,\n o alpha: (number) angle of derivative\n o }\n \\*/\n\n Snap.path.getPointAtLength = getPointAtLength;\n /*\\\n * Snap.path.getSubpath\n [ method ]\n **\n * Returns the subpath of a given path between given start and end lengths\n **\n - path (string) SVG path string\n - from (number) length, in pixels, from the start of the path to the start of the segment\n - to (number) length, in pixels, from the start of the path to the end of the segment\n **\n = (string) path string definition for the segment\n \\*/\n\n Snap.path.getSubpath = function (path, from, to) {\n if (this.getTotalLength(path) - to < 1e-6) {\n return getSubpathsAtLength(path, from).end;\n }\n\n var a = getSubpathsAtLength(path, to, 1);\n return from ? getSubpathsAtLength(a, from).end : a;\n };\n /*\\\n * Element.getTotalLength\n [ method ]\n **\n * Returns the length of the path in pixels (only works for `path` elements)\n = (number) length\n \\*/\n\n\n elproto.getTotalLength = function () {\n if (this.node.getTotalLength) {\n return this.node.getTotalLength();\n }\n }; // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?\n\n /*\\\n * Element.getPointAtLength\n [ method ]\n **\n * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)\n **\n - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n **\n = (object) representation of the point:\n o {\n o x: (number) x coordinate,\n o y: (number) y coordinate,\n o alpha: (number) angle of derivative\n o }\n \\*/\n\n\n elproto.getPointAtLength = function (length) {\n return getPointAtLength(this.attr(\"d\"), length);\n }; // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.\n\n /*\\\n * Element.getSubpath\n [ method ]\n **\n * Returns subpath of a given element from given start and end lengths (only works for `path` elements)\n **\n - from (number) length, in pixels, from the start of the path to the start of the segment\n - to (number) length, in pixels, from the start of the path to the end of the segment\n **\n = (string) path string definition for the segment\n \\*/\n\n\n elproto.getSubpath = function (from, to) {\n return Snap.path.getSubpath(this.attr(\"d\"), from, to);\n };\n\n Snap._.box = box;\n /*\\\n * Snap.path.findDotsAtSegment\n [ method ]\n **\n * Utility method\n **\n * Finds dot coordinates on the given cubic beziér curve at the given t\n - p1x (number) x of the first point of the curve\n - p1y (number) y of the first point of the curve\n - c1x (number) x of the first anchor of the curve\n - c1y (number) y of the first anchor of the curve\n - c2x (number) x of the second anchor of the curve\n - c2y (number) y of the second anchor of the curve\n - p2x (number) x of the second point of the curve\n - p2y (number) y of the second point of the curve\n - t (number) position on the curve (0..1)\n = (object) point information in format:\n o {\n o x: (number) x coordinate of the point,\n o y: (number) y coordinate of the point,\n o m: {\n o x: (number) x coordinate of the left anchor,\n o y: (number) y coordinate of the left anchor\n o },\n o n: {\n o x: (number) x coordinate of the right anchor,\n o y: (number) y coordinate of the right anchor\n o },\n o start: {\n o x: (number) x coordinate of the start of the curve,\n o y: (number) y coordinate of the start of the curve\n o },\n o end: {\n o x: (number) x coordinate of the end of the curve,\n o y: (number) y coordinate of the end of the curve\n o },\n o alpha: (number) angle of the curve derivative at the point\n o }\n \\*/\n\n Snap.path.findDotsAtSegment = findDotsAtSegment;\n /*\\\n * Snap.path.bezierBBox\n [ method ]\n **\n * Utility method\n **\n * Returns the bounding box of a given cubic beziér curve\n - p1x (number) x of the first point of the curve\n - p1y (number) y of the first point of the curve\n - c1x (number) x of the first anchor of the curve\n - c1y (number) y of the first anchor of the curve\n - c2x (number) x of the second anchor of the curve\n - c2y (number) y of the second anchor of the curve\n - p2x (number) x of the second point of the curve\n - p2y (number) y of the second point of the curve\n * or\n - bez (array) array of six points for beziér curve\n = (object) bounding box\n o {\n o x: (number) x coordinate of the left top point of the box,\n o y: (number) y coordinate of the left top point of the box,\n o x2: (number) x coordinate of the right bottom point of the box,\n o y2: (number) y coordinate of the right bottom point of the box,\n o width: (number) width of the box,\n o height: (number) height of the box\n o }\n \\*/\n\n Snap.path.bezierBBox = bezierBBox;\n /*\\\n * Snap.path.isPointInsideBBox\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if given point is inside bounding box\n - bbox (string) bounding box\n - x (string) x coordinate of the point\n - y (string) y coordinate of the point\n = (boolean) `true` if point is inside\n \\*/\n\n Snap.path.isPointInsideBBox = isPointInsideBBox;\n\n Snap.closest = function (x, y, X, Y) {\n var r = 100,\n b = box(x - r / 2, y - r / 2, r, r),\n inside = [],\n getter = X[0].hasOwnProperty(\"x\") ? function (i) {\n return {\n x: X[i].x,\n y: X[i].y\n };\n } : function (i) {\n return {\n x: X[i],\n y: Y[i]\n };\n },\n found = 0;\n\n while (r <= 1e6 && !found) {\n for (var i = 0, ii = X.length; i < ii; i++) {\n var xy = getter(i);\n\n if (isPointInsideBBox(b, xy.x, xy.y)) {\n found++;\n inside.push(xy);\n break;\n }\n }\n\n if (!found) {\n r *= 2;\n b = box(x - r / 2, y - r / 2, r, r);\n }\n }\n\n if (r == 1e6) {\n return;\n }\n\n var len = Infinity,\n res;\n\n for (i = 0, ii = inside.length; i < ii; i++) {\n var l = Snap.len(x, y, inside[i].x, inside[i].y);\n\n if (len > l) {\n len = l;\n inside[i].len = l;\n res = inside[i];\n }\n }\n\n return res;\n };\n /*\\\n * Snap.path.isBBoxIntersect\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if two bounding boxes intersect\n - bbox1 (string) first bounding box\n - bbox2 (string) second bounding box\n = (boolean) `true` if bounding boxes intersect\n \\*/\n\n\n Snap.path.isBBoxIntersect = isBBoxIntersect;\n /*\\\n * Snap.path.intersection\n [ method ]\n **\n * Utility method\n **\n * Finds intersections of two paths\n - path1 (string) path string\n - path2 (string) path string\n = (array) dots of intersection\n o [\n o {\n o x: (number) x coordinate of the point,\n o y: (number) y coordinate of the point,\n o t1: (number) t value for segment of path1,\n o t2: (number) t value for segment of path2,\n o segment1: (number) order number for segment of path1,\n o segment2: (number) order number for segment of path2,\n o bez1: (array) eight coordinates representing beziér curve for the segment of path1,\n o bez2: (array) eight coordinates representing beziér curve for the segment of path2\n o }\n o ]\n \\*/\n\n Snap.path.intersection = pathIntersection;\n Snap.path.intersectionNumber = pathIntersectionNumber;\n /*\\\n * Snap.path.isPointInside\n [ method ]\n **\n * Utility method\n **\n * Returns `true` if given point is inside a given closed path.\n *\n * Note: fill mode doesn’t affect the result of this method.\n - path (string) path string\n - x (number) x of the point\n - y (number) y of the point\n = (boolean) `true` if point is inside the path\n \\*/\n\n Snap.path.isPointInside = isPointInsidePath;\n /*\\\n * Snap.path.getBBox\n [ method ]\n **\n * Utility method\n **\n * Returns the bounding box of a given path\n - path (string) path string\n = (object) bounding box\n o {\n o x: (number) x coordinate of the left top point of the box,\n o y: (number) y coordinate of the left top point of the box,\n o x2: (number) x coordinate of the right bottom point of the box,\n o y2: (number) y coordinate of the right bottom point of the box,\n o width: (number) width of the box,\n o height: (number) height of the box\n o }\n \\*/\n\n Snap.path.getBBox = pathBBox;\n Snap.path.get = getPath;\n /*\\\n * Snap.path.toRelative\n [ method ]\n **\n * Utility method\n **\n * Converts path coordinates into relative values\n - path (string) path string\n = (array) path string\n \\*/\n\n Snap.path.toRelative = pathToRelative;\n /*\\\n * Snap.path.toAbsolute\n [ method ]\n **\n * Utility method\n **\n * Converts path coordinates into absolute values\n - path (string) path string\n = (array) path string\n \\*/\n\n Snap.path.toAbsolute = pathToAbsolute;\n /*\\\n * Snap.path.toCubic\n [ method ]\n **\n * Utility method\n **\n * Converts path to a new path where all segments are cubic beziér curves\n - pathString (string|array) path string or array of segments\n = (array) array of segments\n \\*/\n\n Snap.path.toCubic = path2curve;\n /*\\\n * Snap.path.map\n [ method ]\n **\n * Transform the path string with the given matrix\n - path (string) path string\n - matrix (object) see @Matrix\n = (string) transformed path string\n \\*/\n\n Snap.path.map = mapPath;\n Snap.path.toString = toString;\n Snap.path.clone = pathClone;\n}); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var mmax = Math.max,\n mmin = Math.min; // Set\n\n var Set = function Set(items) {\n this.items = [];\n this.bindings = {};\n this.length = 0;\n this.type = \"set\";\n\n if (items) {\n for (var i = 0, ii = items.length; i < ii; i++) {\n if (items[i]) {\n this[this.items.length] = this.items[this.items.length] = items[i];\n this.length++;\n }\n }\n }\n },\n setproto = Set.prototype;\n /*\\\n * Set.push\n [ method ]\n **\n * Adds each argument to the current set\n = (object) original element\n \\*/\n\n\n setproto.push = function () {\n var item, len;\n\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n item = arguments[i];\n\n if (item) {\n len = this.items.length;\n this[len] = this.items[len] = item;\n this.length++;\n }\n }\n\n return this;\n };\n /*\\\n * Set.pop\n [ method ]\n **\n * Removes last element and returns it\n = (object) element\n \\*/\n\n\n setproto.pop = function () {\n this.length && delete this[this.length--];\n return this.items.pop();\n };\n /*\\\n * Set.forEach\n [ method ]\n **\n * Executes given function for each element in the set\n *\n * If the function returns `false`, the loop stops running.\n **\n - callback (function) function to run\n - thisArg (object) context object for the callback\n = (object) Set object\n \\*/\n\n\n setproto.forEach = function (callback, thisArg) {\n for (var i = 0, ii = this.items.length; i < ii; i++) {\n if (callback.call(thisArg, this.items[i], i) === false) {\n return this;\n }\n }\n\n return this;\n };\n /*\\\n * Set.animate\n [ method ]\n **\n * Animates each element in set in sync.\n *\n **\n - attrs (object) key-value pairs of destination attributes\n - duration (number) duration of the animation in milliseconds\n - easing (function) #optional easing function from @mina or custom\n - callback (function) #optional callback function that executes when the animation ends\n * or\n - animation (array) array of animation parameter for each element in set in format `[attrs, duration, easing, callback]`\n > Usage\n | // animate all elements in set to radius 10\n | set.animate({r: 10}, 500, mina.easein);\n | // or\n | // animate first element to radius 10, but second to radius 20 and in different time\n | set.animate([{r: 10}, 500, mina.easein], [{r: 20}, 1500, mina.easein]);\n = (Element) the current element\n \\*/\n\n\n setproto.animate = function (attrs, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n\n if (attrs instanceof Snap._.Animation) {\n callback = attrs.callback;\n easing = attrs.easing;\n ms = easing.dur;\n attrs = attrs.attr;\n }\n\n var args = arguments;\n\n if (Snap.is(attrs, \"array\") && Snap.is(args[args.length - 1], \"array\")) {\n var each = true;\n }\n\n var begin,\n handler = function handler() {\n if (begin) {\n this.b = begin;\n } else {\n begin = this.b;\n }\n },\n cb = 0,\n set = this,\n callbacker = callback && function () {\n if (++cb == set.length) {\n callback.call(this);\n }\n };\n\n return this.forEach(function (el, i) {\n eve.once(\"snap.animcreated.\" + el.id, handler);\n\n if (each) {\n args[i] && el.animate.apply(el, args[i]);\n } else {\n el.animate(attrs, ms, easing, callbacker);\n }\n });\n };\n /*\\\n * Set.remove\n [ method ]\n **\n * Removes all children of the set.\n *\n = (object) Set object\n \\*/\n\n\n setproto.remove = function () {\n while (this.length) {\n this.pop().remove();\n }\n\n return this;\n };\n /*\\\n * Set.bind\n [ method ]\n **\n * Specifies how to handle a specific attribute when applied\n * to a set.\n *\n **\n - attr (string) attribute name\n - callback (function) function to run\n * or\n - attr (string) attribute name\n - element (Element) specific element in the set to apply the attribute to\n * or\n - attr (string) attribute name\n - element (Element) specific element in the set to apply the attribute to\n - eattr (string) attribute on the element to bind the attribute to\n = (object) Set object\n \\*/\n\n\n setproto.bind = function (attr, a, b) {\n var data = {};\n\n if (typeof a == \"function\") {\n this.bindings[attr] = a;\n } else {\n var aname = b || attr;\n\n this.bindings[attr] = function (v) {\n data[aname] = v;\n a.attr(data);\n };\n }\n\n return this;\n };\n /*\\\n * Set.attr\n [ method ]\n **\n * Equivalent of @Element.attr.\n = (object) Set object\n \\*/\n\n\n setproto.attr = function (value) {\n var unbound = {};\n\n for (var k in value) {\n if (this.bindings[k]) {\n this.bindings[k](value[k]);\n } else {\n unbound[k] = value[k];\n }\n }\n\n for (var i = 0, ii = this.items.length; i < ii; i++) {\n this.items[i].attr(unbound);\n }\n\n return this;\n };\n /*\\\n * Set.clear\n [ method ]\n **\n * Removes all elements from the set\n \\*/\n\n\n setproto.clear = function () {\n while (this.length) {\n this.pop();\n }\n };\n /*\\\n * Set.splice\n [ method ]\n **\n * Removes range of elements from the set\n **\n - index (number) position of the deletion\n - count (number) number of element to remove\n - insertion… (object) #optional elements to insert\n = (object) set elements that were deleted\n \\*/\n\n\n setproto.splice = function (index, count, insertion) {\n index = index < 0 ? mmax(this.length + index, 0) : index;\n count = mmax(0, mmin(this.length - index, count));\n var tail = [],\n todel = [],\n args = [],\n i;\n\n for (i = 2; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n for (i = 0; i < count; i++) {\n todel.push(this[index + i]);\n }\n\n for (; i < this.length - index; i++) {\n tail.push(this[index + i]);\n }\n\n var arglen = args.length;\n\n for (i = 0; i < arglen + tail.length; i++) {\n this.items[index + i] = this[index + i] = i < arglen ? args[i] : tail[i - arglen];\n }\n\n i = this.items.length = this.length -= count - arglen;\n\n while (this[i]) {\n delete this[i++];\n }\n\n return new Set(todel);\n };\n /*\\\n * Set.exclude\n [ method ]\n **\n * Removes given element from the set\n **\n - element (object) element to remove\n = (boolean) `true` if object was found and removed from the set\n \\*/\n\n\n setproto.exclude = function (el) {\n for (var i = 0, ii = this.length; i < ii; i++) {\n if (this[i] == el) {\n this.splice(i, 1);\n return true;\n }\n }\n\n return false;\n };\n /*\\\n * Set.insertAfter\n [ method ]\n **\n * Inserts set elements after given element.\n **\n - element (object) set will be inserted after this element\n = (object) Set object\n \\*/\n\n\n setproto.insertAfter = function (el) {\n var i = this.items.length;\n\n while (i--) {\n this.items[i].insertAfter(el);\n }\n\n return this;\n };\n /*\\\n * Set.getBBox\n [ method ]\n **\n * Union of all bboxes of the set. See @Element.getBBox.\n = (object) bounding box descriptor. See @Element.getBBox.\n \\*/\n\n\n setproto.getBBox = function () {\n var x = [],\n y = [],\n x2 = [],\n y2 = [];\n\n for (var i = this.items.length; i--;) {\n if (!this.items[i].removed) {\n var box = this.items[i].getBBox();\n x.push(box.x);\n y.push(box.y);\n x2.push(box.x + box.width);\n y2.push(box.y + box.height);\n }\n }\n\n x = mmin.apply(0, x);\n y = mmin.apply(0, y);\n x2 = mmax.apply(0, x2);\n y2 = mmax.apply(0, y2);\n return {\n x: x,\n y: y,\n x2: x2,\n y2: y2,\n width: x2 - x,\n height: y2 - y,\n cx: x + (x2 - x) / 2,\n cy: y + (y2 - y) / 2\n };\n };\n /*\\\n * Set.insertAfter\n [ method ]\n **\n * Creates a clone of the set.\n **\n = (object) New Set object\n \\*/\n\n\n setproto.clone = function (s) {\n s = new Set();\n\n for (var i = 0, ii = this.items.length; i < ii; i++) {\n s.push(this.items[i].clone());\n }\n\n return s;\n };\n\n setproto.toString = function () {\n return \"Snap\\u2018s set\";\n };\n\n setproto.type = \"set\"; // export\n\n /*\\\n * Snap.Set\n [ property ]\n **\n * Set constructor.\n \\*/\n\n Snap.Set = Set;\n /*\\\n * Snap.set\n [ method ]\n **\n * Creates a set and fills it with list of arguments.\n **\n = (object) New Set object\n | var r = paper.rect(0, 0, 10, 10),\n | s1 = Snap.set(), // empty set\n | s2 = Snap.set(r, paper.circle(100, 100, 20)); // prefilled set\n \\*/\n\n Snap.set = function () {\n var set = new Set();\n\n if (arguments.length) {\n set.push.apply(set, Array.prototype.slice.call(arguments, 0));\n }\n\n return set;\n };\n}); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var names = {},\n reUnit = /[%a-z]+$/i,\n Str = String;\n names.stroke = names.fill = \"colour\";\n\n function getEmpty(item) {\n var l = item[0];\n\n switch (l.toLowerCase()) {\n case \"t\":\n return [l, 0, 0];\n\n case \"m\":\n return [l, 1, 0, 0, 1, 0, 0];\n\n case \"r\":\n if (item.length == 4) {\n return [l, 0, item[2], item[3]];\n } else {\n return [l, 0];\n }\n\n case \"s\":\n if (item.length == 5) {\n return [l, 1, 1, item[3], item[4]];\n } else if (item.length == 3) {\n return [l, 1, 1];\n } else {\n return [l, 1];\n }\n\n }\n }\n\n function equaliseTransform(t1, t2, getBBox) {\n t1 = t1 || new Snap.Matrix();\n t2 = t2 || new Snap.Matrix();\n t1 = Snap.parseTransformString(t1.toTransformString()) || [];\n t2 = Snap.parseTransformString(t2.toTransformString()) || [];\n var maxlength = Math.max(t1.length, t2.length),\n from = [],\n to = [],\n i = 0,\n j,\n jj,\n tt1,\n tt2;\n\n for (; i < maxlength; i++) {\n tt1 = t1[i] || getEmpty(t2[i]);\n tt2 = t2[i] || getEmpty(tt1);\n\n if (tt1[0] != tt2[0] || tt1[0].toLowerCase() == \"r\" && (tt1[2] != tt2[2] || tt1[3] != tt2[3]) || tt1[0].toLowerCase() == \"s\" && (tt1[3] != tt2[3] || tt1[4] != tt2[4])) {\n t1 = Snap._.transform2matrix(t1, getBBox());\n t2 = Snap._.transform2matrix(t2, getBBox());\n from = [[\"m\", t1.a, t1.b, t1.c, t1.d, t1.e, t1.f]];\n to = [[\"m\", t2.a, t2.b, t2.c, t2.d, t2.e, t2.f]];\n break;\n }\n\n from[i] = [];\n to[i] = [];\n\n for (j = 0, jj = Math.max(tt1.length, tt2.length); j < jj; j++) {\n j in tt1 && (from[i][j] = tt1[j]);\n j in tt2 && (to[i][j] = tt2[j]);\n }\n }\n\n return {\n from: path2array(from),\n to: path2array(to),\n f: getPath(from)\n };\n }\n\n function getNumber(val) {\n return val;\n }\n\n function getUnit(unit) {\n return function (val) {\n return +val.toFixed(3) + unit;\n };\n }\n\n function getViewBox(val) {\n return val.join(\" \");\n }\n\n function getColour(clr) {\n return Snap.rgb(clr[0], clr[1], clr[2], clr[3]);\n }\n\n function getPath(path) {\n var k = 0,\n i,\n ii,\n j,\n jj,\n out,\n a,\n b = [];\n\n for (i = 0, ii = path.length; i < ii; i++) {\n out = \"[\";\n a = ['\"' + path[i][0] + '\"'];\n\n for (j = 1, jj = path[i].length; j < jj; j++) {\n a[j] = \"val[\" + k++ + \"]\";\n }\n\n out += a + \"]\";\n b[i] = out;\n }\n\n return Function(\"val\", \"return Snap.path.toString.call([\" + b + \"])\");\n }\n\n function path2array(path) {\n var out = [];\n\n for (var i = 0, ii = path.length; i < ii; i++) {\n for (var j = 1, jj = path[i].length; j < jj; j++) {\n out.push(path[i][j]);\n }\n }\n\n return out;\n }\n\n function isNumeric(obj) {\n return isFinite(obj);\n }\n\n function arrayEqual(arr1, arr2) {\n if (!Snap.is(arr1, \"array\") || !Snap.is(arr2, \"array\")) {\n return false;\n }\n\n return arr1.toString() == arr2.toString();\n }\n\n Element.prototype.equal = function (name, b) {\n return eve(\"snap.util.equal\", this, name, b).firstDefined();\n };\n\n eve.on(\"snap.util.equal\", function (name, b) {\n var A,\n B,\n a = Str(this.attr(name) || \"\"),\n el = this;\n\n if (names[name] == \"colour\") {\n A = Snap.color(a);\n B = Snap.color(b);\n return {\n from: [A.r, A.g, A.b, A.opacity],\n to: [B.r, B.g, B.b, B.opacity],\n f: getColour\n };\n }\n\n if (name == \"viewBox\") {\n A = this.attr(name).vb.split(\" \").map(Number);\n B = b.split(\" \").map(Number);\n return {\n from: A,\n to: B,\n f: getViewBox\n };\n }\n\n if (name == \"transform\" || name == \"gradientTransform\" || name == \"patternTransform\") {\n if (typeof b == \"string\") {\n b = Str(b).replace(/\\.{3}|\\u2026/g, a);\n }\n\n a = this.matrix;\n\n if (!Snap._.rgTransform.test(b)) {\n b = Snap._.transform2matrix(Snap._.svgTransform2string(b), this.getBBox());\n } else {\n b = Snap._.transform2matrix(b, this.getBBox());\n }\n\n return equaliseTransform(a, b, function () {\n return el.getBBox(1);\n });\n }\n\n if (name == \"d\" || name == \"path\") {\n A = Snap.path.toCubic(a, b);\n return {\n from: path2array(A[0]),\n to: path2array(A[1]),\n f: getPath(A[0])\n };\n }\n\n if (name == \"points\") {\n A = Str(a).split(Snap._.separator);\n B = Str(b).split(Snap._.separator);\n return {\n from: A,\n to: B,\n f: function f(val) {\n return val;\n }\n };\n }\n\n if (isNumeric(a) && isNumeric(b)) {\n return {\n from: parseFloat(a),\n to: parseFloat(b),\n f: getNumber\n };\n }\n\n var aUnit = a.match(reUnit),\n bUnit = Str(b).match(reUnit);\n\n if (aUnit && arrayEqual(aUnit, bUnit)) {\n return {\n from: parseFloat(a),\n to: parseFloat(b),\n f: getUnit(aUnit)\n };\n } else {\n return {\n from: this.asPX(name),\n to: this.asPX(name, b),\n f: getNumber\n };\n }\n });\n}); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n has = \"hasOwnProperty\",\n supportsTouch = (\"createTouch\" in glob.doc),\n events = [\"click\", \"dblclick\", \"mousedown\", \"mousemove\", \"mouseout\", \"mouseover\", \"mouseup\", \"touchstart\", \"touchmove\", \"touchend\", \"touchcancel\"],\n touchMap = {\n mousedown: \"touchstart\",\n mousemove: \"touchmove\",\n mouseup: \"touchend\"\n },\n getScroll = function getScroll(xy, el) {\n var name = xy == \"y\" ? \"scrollTop\" : \"scrollLeft\",\n doc = el && el.node ? el.node.ownerDocument : glob.doc;\n return doc[name in doc.documentElement ? \"documentElement\" : \"body\"][name];\n },\n preventDefault = function preventDefault() {\n this.returnValue = false;\n },\n preventTouch = function preventTouch() {\n return this.originalEvent.preventDefault();\n },\n stopPropagation = function stopPropagation() {\n this.cancelBubble = true;\n },\n stopTouch = function stopTouch() {\n return this.originalEvent.stopPropagation();\n },\n addEvent = function addEvent(obj, type, fn, element) {\n var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,\n f = function f(e) {\n var scrollY = getScroll(\"y\", element),\n scrollX = getScroll(\"x\", element);\n\n if (supportsTouch && touchMap[has](type)) {\n for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {\n if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {\n var olde = e;\n e = e.targetTouches[i];\n e.originalEvent = olde;\n e.preventDefault = preventTouch;\n e.stopPropagation = stopTouch;\n break;\n }\n }\n }\n\n var x = e.clientX + scrollX,\n y = e.clientY + scrollY;\n return fn.call(element, e, x, y);\n };\n\n if (type !== realName) {\n obj.addEventListener(type, f, false);\n }\n\n obj.addEventListener(realName, f, false);\n return function () {\n if (type !== realName) {\n obj.removeEventListener(type, f, false);\n }\n\n obj.removeEventListener(realName, f, false);\n return true;\n };\n },\n drag = [],\n dragMove = function dragMove(e) {\n var x = e.clientX,\n y = e.clientY,\n scrollY = getScroll(\"y\"),\n scrollX = getScroll(\"x\"),\n dragi,\n j = drag.length;\n\n while (j--) {\n dragi = drag[j];\n\n if (supportsTouch) {\n var i = e.touches && e.touches.length,\n touch;\n\n while (i--) {\n touch = e.touches[i];\n\n if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {\n x = touch.clientX;\n y = touch.clientY;\n (e.originalEvent ? e.originalEvent : e).preventDefault();\n break;\n }\n }\n } else {\n e.preventDefault();\n }\n\n var node = dragi.el.node,\n o,\n next = node.nextSibling,\n parent = node.parentNode,\n display = node.style.display; // glob.win.opera && parent.removeChild(node);\n // node.style.display = \"none\";\n // o = dragi.el.paper.getElementByPoint(x, y);\n // node.style.display = display;\n // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));\n // o && eve(\"snap.drag.over.\" + dragi.el.id, dragi.el, o);\n\n x += scrollX;\n y += scrollY;\n eve(\"snap.drag.move.\" + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);\n }\n },\n dragUp = function dragUp(e) {\n Snap.unmousemove(dragMove).unmouseup(dragUp);\n var i = drag.length,\n dragi;\n\n while (i--) {\n dragi = drag[i];\n dragi.el._drag = {};\n eve(\"snap.drag.end.\" + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);\n eve.off(\"snap.drag.*.\" + dragi.el.id);\n }\n\n drag = [];\n };\n /*\\\n * Element.click\n [ method ]\n **\n * Adds a click event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.unclick\n [ method ]\n **\n * Removes a click event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.dblclick\n [ method ]\n **\n * Adds a double click event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.undblclick\n [ method ]\n **\n * Removes a double click event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.mousedown\n [ method ]\n **\n * Adds a mousedown event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.unmousedown\n [ method ]\n **\n * Removes a mousedown event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.mousemove\n [ method ]\n **\n * Adds a mousemove event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.unmousemove\n [ method ]\n **\n * Removes a mousemove event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.mouseout\n [ method ]\n **\n * Adds a mouseout event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.unmouseout\n [ method ]\n **\n * Removes a mouseout event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.mouseover\n [ method ]\n **\n * Adds a mouseover event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.unmouseover\n [ method ]\n **\n * Removes a mouseover event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.mouseup\n [ method ]\n **\n * Adds a mouseup event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.unmouseup\n [ method ]\n **\n * Removes a mouseup event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.touchstart\n [ method ]\n **\n * Adds a touchstart event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.untouchstart\n [ method ]\n **\n * Removes a touchstart event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.touchmove\n [ method ]\n **\n * Adds a touchmove event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.untouchmove\n [ method ]\n **\n * Removes a touchmove event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.touchend\n [ method ]\n **\n * Adds a touchend event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.untouchend\n [ method ]\n **\n * Removes a touchend event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.touchcancel\n [ method ]\n **\n * Adds a touchcancel event handler to the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n /*\\\n * Element.untouchcancel\n [ method ]\n **\n * Removes a touchcancel event handler from the element\n - handler (function) handler for the event\n = (object) @Element\n \\*/\n\n\n for (var i = events.length; i--;) {\n (function (eventName) {\n Snap[eventName] = elproto[eventName] = function (fn, scope) {\n if (Snap.is(fn, \"function\")) {\n this.events = this.events || [];\n this.events.push({\n name: eventName,\n f: fn,\n unbind: addEvent(this.node || document, eventName, fn, scope || this)\n });\n } else {\n for (var i = 0, ii = this.events.length; i < ii; i++) {\n if (this.events[i].name == eventName) {\n try {\n this.events[i].f.call(this);\n } catch (e) {}\n }\n }\n }\n\n return this;\n };\n\n Snap[\"un\" + eventName] = elproto[\"un\" + eventName] = function (fn) {\n var events = this.events || [],\n l = events.length;\n\n while (l--) {\n if (events[l].name == eventName && (events[l].f == fn || !fn)) {\n events[l].unbind();\n events.splice(l, 1);\n !events.length && delete this.events;\n return this;\n }\n }\n\n return this;\n };\n })(events[i]);\n }\n /*\\\n * Element.hover\n [ method ]\n **\n * Adds hover event handlers to the element\n - f_in (function) handler for hover in\n - f_out (function) handler for hover out\n - icontext (object) #optional context for hover in handler\n - ocontext (object) #optional context for hover out handler\n = (object) @Element\n \\*/\n\n\n elproto.hover = function (f_in, f_out, scope_in, scope_out) {\n return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);\n };\n /*\\\n * Element.unhover\n [ method ]\n **\n * Removes hover event handlers from the element\n - f_in (function) handler for hover in\n - f_out (function) handler for hover out\n = (object) @Element\n \\*/\n\n\n elproto.unhover = function (f_in, f_out) {\n return this.unmouseover(f_in).unmouseout(f_out);\n };\n\n var draggable = []; // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.\n // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?\n // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.\n // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?\n\n /*\\\n * Element.drag\n [ method ]\n **\n * Adds event handlers for an element's drag gesture\n **\n - onmove (function) handler for moving\n - onstart (function) handler for drag start\n - onend (function) handler for drag end\n - mcontext (object) #optional context for moving handler\n - scontext (object) #optional context for drag start handler\n - econtext (object) #optional context for drag end handler\n * Additionaly following `drag` events are triggered: `drag.start.<id>` on start, \n * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element \n * `drag.over.<id>` fires as well.\n *\n * Start event and start handler are called in specified context or in context of the element with following parameters:\n o x (number) x position of the mouse\n o y (number) y position of the mouse\n o event (object) DOM event object\n * Move event and move handler are called in specified context or in context of the element with following parameters:\n o dx (number) shift by x from the start point\n o dy (number) shift by y from the start point\n o x (number) x position of the mouse\n o y (number) y position of the mouse\n o event (object) DOM event object\n * End event and end handler are called in specified context or in context of the element with following parameters:\n o event (object) DOM event object\n = (object) @Element\n \\*/\n\n elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {\n var el = this;\n\n if (!arguments.length) {\n var origTransform;\n return el.drag(function (dx, dy) {\n this.attr({\n transform: origTransform + (origTransform ? \"T\" : \"t\") + [dx, dy]\n });\n }, function () {\n origTransform = this.transform().local;\n });\n }\n\n function start(e, x, y) {\n (e.originalEvent || e).preventDefault();\n el._drag.x = x;\n el._drag.y = y;\n el._drag.id = e.identifier;\n !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);\n drag.push({\n el: el,\n move_scope: move_scope,\n start_scope: start_scope,\n end_scope: end_scope\n });\n onstart && eve.on(\"snap.drag.start.\" + el.id, onstart);\n onmove && eve.on(\"snap.drag.move.\" + el.id, onmove);\n onend && eve.on(\"snap.drag.end.\" + el.id, onend);\n eve(\"snap.drag.start.\" + el.id, start_scope || move_scope || el, x, y, e);\n }\n\n function init(e, x, y) {\n eve(\"snap.draginit.\" + el.id, el, e, x, y);\n }\n\n eve.on(\"snap.draginit.\" + el.id, start);\n el._drag = {};\n draggable.push({\n el: el,\n start: start,\n init: init\n });\n el.mousedown(init);\n return el;\n };\n /*\n * Element.onDragOver\n [ method ]\n **\n * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)\n - f (function) handler for event, first argument would be the element you are dragging over\n \\*/\n // elproto.onDragOver = function (f) {\n // f ? eve.on(\"snap.drag.over.\" + this.id, f) : eve.unbind(\"snap.drag.over.\" + this.id);\n // };\n\n /*\\\n * Element.undrag\n [ method ]\n **\n * Removes all drag event handlers from the given element\n \\*/\n\n\n elproto.undrag = function () {\n var i = draggable.length;\n\n while (i--) {\n if (draggable[i].el == this) {\n this.unmousedown(draggable[i].init);\n draggable.splice(i, 1);\n eve.unbind(\"snap.drag.*.\" + this.id);\n eve.unbind(\"snap.draginit.\" + this.id);\n }\n }\n\n !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);\n return this;\n };\n}); // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob) {\n var elproto = Element.prototype,\n pproto = Paper.prototype,\n rgurl = /^\\s*url\\((.+)\\)/,\n Str = String,\n $ = Snap._.$;\n Snap.filter = {};\n /*\\\n * Paper.filter\n [ method ]\n **\n * Creates a `<filter>` element\n **\n - filstr (string) SVG fragment of filter provided as a string\n = (object) @Element\n * Note: It is recommended to use filters embedded into the page inside an empty SVG element.\n > Usage\n | var f = paper.filter('<feGaussianBlur stdDeviation=\"2\"/>'),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n \\*/\n\n pproto.filter = function (filstr) {\n var paper = this;\n\n if (paper.type != \"svg\") {\n paper = paper.paper;\n }\n\n var f = Snap.parse(Str(filstr)),\n id = Snap._.id(),\n width = paper.node.offsetWidth,\n height = paper.node.offsetHeight,\n filter = $(\"filter\");\n\n $(filter, {\n id: id,\n filterUnits: \"userSpaceOnUse\"\n });\n filter.appendChild(f.node);\n paper.defs.appendChild(filter);\n return new Element(filter);\n };\n\n eve.on(\"snap.util.getattr.filter\", function () {\n eve.stop();\n var p = $(this.node, \"filter\");\n\n if (p) {\n var match = Str(p).match(rgurl);\n return match && Snap.select(match[1]);\n }\n });\n eve.on(\"snap.util.attr.filter\", function (value) {\n if (value instanceof Element && value.type == \"filter\") {\n eve.stop();\n var id = value.node.id;\n\n if (!id) {\n $(value.node, {\n id: value.id\n });\n id = value.id;\n }\n\n $(this.node, {\n filter: Snap.url(id)\n });\n }\n\n if (!value || value == \"none\") {\n eve.stop();\n this.node.removeAttribute(\"filter\");\n }\n });\n /*\\\n * Snap.filter.blur\n [ method ]\n **\n * Returns an SVG markup string for the blur filter\n **\n - x (number) amount of horizontal blur, in pixels\n - y (number) #optional amount of vertical blur, in pixels\n = (string) filter representation\n > Usage\n | var f = paper.filter(Snap.filter.blur(5, 10)),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n \\*/\n\n Snap.filter.blur = function (x, y) {\n if (x == null) {\n x = 2;\n }\n\n var def = y == null ? x : [x, y];\n return Snap.format('\\<feGaussianBlur stdDeviation=\"{def}\"/>', {\n def: def\n });\n };\n\n Snap.filter.blur.toString = function () {\n return this();\n };\n /*\\\n * Snap.filter.shadow\n [ method ]\n **\n * Returns an SVG markup string for the shadow filter\n **\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - blur (number) #optional amount of blur\n - color (string) #optional color of the shadow\n - opacity (number) #optional `0..1` opacity of the shadow\n * or\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - color (string) #optional color of the shadow\n - opacity (number) #optional `0..1` opacity of the shadow\n * which makes blur default to `4`. Or\n - dx (number) #optional horizontal shift of the shadow, in pixels\n - dy (number) #optional vertical shift of the shadow, in pixels\n - opacity (number) #optional `0..1` opacity of the shadow\n = (string) filter representation\n > Usage\n | var f = paper.filter(Snap.filter.shadow(0, 2, .3)),\n | c = paper.circle(10, 10, 10).attr({\n | filter: f\n | });\n \\*/\n\n\n Snap.filter.shadow = function (dx, dy, blur, color, opacity) {\n if (opacity == null) {\n if (color == null) {\n opacity = blur;\n blur = 4;\n color = \"#000\";\n } else {\n opacity = color;\n color = blur;\n blur = 4;\n }\n }\n\n if (blur == null) {\n blur = 4;\n }\n\n if (opacity == null) {\n opacity = 1;\n }\n\n if (dx == null) {\n dx = 0;\n dy = 2;\n }\n\n if (dy == null) {\n dy = dx;\n }\n\n color = Snap.color(color);\n return Snap.format('<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"{blur}\"/><feOffset dx=\"{dx}\" dy=\"{dy}\" result=\"offsetblur\"/><feFlood flood-color=\"{color}\"/><feComposite in2=\"offsetblur\" operator=\"in\"/><feComponentTransfer><feFuncA type=\"linear\" slope=\"{opacity}\"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in=\"SourceGraphic\"/></feMerge>', {\n color: color,\n dx: dx,\n dy: dy,\n blur: blur,\n opacity: opacity\n });\n };\n\n Snap.filter.shadow.toString = function () {\n return this();\n };\n /*\\\n * Snap.filter.grayscale\n [ method ]\n **\n * Returns an SVG markup string for the grayscale filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n \\*/\n\n\n Snap.filter.grayscale = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n\n return Snap.format('<feColorMatrix type=\"matrix\" values=\"{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0\"/>', {\n a: 0.2126 + 0.7874 * (1 - amount),\n b: 0.7152 - 0.7152 * (1 - amount),\n c: 0.0722 - 0.0722 * (1 - amount),\n d: 0.2126 - 0.2126 * (1 - amount),\n e: 0.7152 + 0.2848 * (1 - amount),\n f: 0.0722 - 0.0722 * (1 - amount),\n g: 0.2126 - 0.2126 * (1 - amount),\n h: 0.0722 + 0.9278 * (1 - amount)\n });\n };\n\n Snap.filter.grayscale.toString = function () {\n return this();\n };\n /*\\\n * Snap.filter.sepia\n [ method ]\n **\n * Returns an SVG markup string for the sepia filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n \\*/\n\n\n Snap.filter.sepia = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n\n return Snap.format('<feColorMatrix type=\"matrix\" values=\"{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0\"/>', {\n a: 0.393 + 0.607 * (1 - amount),\n b: 0.769 - 0.769 * (1 - amount),\n c: 0.189 - 0.189 * (1 - amount),\n d: 0.349 - 0.349 * (1 - amount),\n e: 0.686 + 0.314 * (1 - amount),\n f: 0.168 - 0.168 * (1 - amount),\n g: 0.272 - 0.272 * (1 - amount),\n h: 0.534 - 0.534 * (1 - amount),\n i: 0.131 + 0.869 * (1 - amount)\n });\n };\n\n Snap.filter.sepia.toString = function () {\n return this();\n };\n /*\\\n * Snap.filter.saturate\n [ method ]\n **\n * Returns an SVG markup string for the saturate filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n \\*/\n\n\n Snap.filter.saturate = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n\n return Snap.format('<feColorMatrix type=\"saturate\" values=\"{amount}\"/>', {\n amount: 1 - amount\n });\n };\n\n Snap.filter.saturate.toString = function () {\n return this();\n };\n /*\\\n * Snap.filter.hueRotate\n [ method ]\n **\n * Returns an SVG markup string for the hue-rotate filter\n **\n - angle (number) angle of rotation\n = (string) filter representation\n \\*/\n\n\n Snap.filter.hueRotate = function (angle) {\n angle = angle || 0;\n return Snap.format('<feColorMatrix type=\"hueRotate\" values=\"{angle}\"/>', {\n angle: angle\n });\n };\n\n Snap.filter.hueRotate.toString = function () {\n return this();\n };\n /*\\\n * Snap.filter.invert\n [ method ]\n **\n * Returns an SVG markup string for the invert filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n \\*/\n\n\n Snap.filter.invert = function (amount) {\n if (amount == null) {\n amount = 1;\n } // <feColorMatrix type=\"matrix\" values=\"-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0\" color-interpolation-filters=\"sRGB\"/>\n\n\n return Snap.format('<feComponentTransfer><feFuncR type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncG type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncB type=\"table\" tableValues=\"{amount} {amount2}\"/></feComponentTransfer>', {\n amount: amount,\n amount2: 1 - amount\n });\n };\n\n Snap.filter.invert.toString = function () {\n return this();\n };\n /*\\\n * Snap.filter.brightness\n [ method ]\n **\n * Returns an SVG markup string for the brightness filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n \\*/\n\n\n Snap.filter.brightness = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n\n return Snap.format('<feComponentTransfer><feFuncR type=\"linear\" slope=\"{amount}\"/><feFuncG type=\"linear\" slope=\"{amount}\"/><feFuncB type=\"linear\" slope=\"{amount}\"/></feComponentTransfer>', {\n amount: amount\n });\n };\n\n Snap.filter.brightness.toString = function () {\n return this();\n };\n /*\\\n * Snap.filter.contrast\n [ method ]\n **\n * Returns an SVG markup string for the contrast filter\n **\n - amount (number) amount of filter (`0..1`)\n = (string) filter representation\n \\*/\n\n\n Snap.filter.contrast = function (amount) {\n if (amount == null) {\n amount = 1;\n }\n\n return Snap.format('<feComponentTransfer><feFuncR type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/><feFuncG type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/><feFuncB type=\"linear\" slope=\"{amount}\" intercept=\"{amount2}\"/></feComponentTransfer>', {\n amount: amount,\n amount2: .5 - amount / 2\n });\n };\n\n Snap.filter.contrast.toString = function () {\n return this();\n };\n}); // Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var box = Snap._.box,\n is = Snap.is,\n firstLetter = /^[^a-z]*([tbmlrc])/i,\n toString = function toString() {\n return \"T\" + this.dx + \",\" + this.dy;\n };\n /*\\\n * Element.getAlign\n [ method ]\n **\n * Returns shift needed to align the element relatively to given element.\n * If no elements specified, parent `<svg>` container will be used.\n - el (object) @optional alignment element\n - way (string) one of six values: `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"left\"`, `\"center\"`, `\"right\"`\n = (object|string) Object in format `{dx: , dy: }` also has a string representation as a transformation string\n > Usage\n | el.transform(el.getAlign(el2, \"top\"));\n * or\n | var dy = el.getAlign(el2, \"top\").dy;\n \\*/\n\n\n Element.prototype.getAlign = function (el, way) {\n if (way == null && is(el, \"string\")) {\n way = el;\n el = null;\n }\n\n el = el || this.paper;\n var bx = el.getBBox ? el.getBBox() : box(el),\n bb = this.getBBox(),\n out = {};\n way = way && way.match(firstLetter);\n way = way ? way[1].toLowerCase() : \"c\";\n\n switch (way) {\n case \"t\":\n out.dx = 0;\n out.dy = bx.y - bb.y;\n break;\n\n case \"b\":\n out.dx = 0;\n out.dy = bx.y2 - bb.y2;\n break;\n\n case \"m\":\n out.dx = 0;\n out.dy = bx.cy - bb.cy;\n break;\n\n case \"l\":\n out.dx = bx.x - bb.x;\n out.dy = 0;\n break;\n\n case \"r\":\n out.dx = bx.x2 - bb.x2;\n out.dy = 0;\n break;\n\n default:\n out.dx = bx.cx - bb.cx;\n out.dy = 0;\n break;\n }\n\n out.toString = toString;\n return out;\n };\n /*\\\n * Element.align\n [ method ]\n **\n * Aligns the element relatively to given one via transformation.\n * If no elements specified, parent `<svg>` container will be used.\n - el (object) @optional alignment element\n - way (string) one of six values: `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"left\"`, `\"center\"`, `\"right\"`\n = (object) this element\n > Usage\n | el.align(el2, \"top\");\n * or\n | el.align(\"middle\");\n \\*/\n\n\n Element.prototype.align = function (el, way) {\n return this.transform(\"...\" + this.getAlign(el, way));\n };\n}); // Copyright (c) 2016 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n var elproto = Element.prototype,\n is = Snap.is,\n Str = String,\n has = \"hasOwnProperty\";\n\n function slice(from, to, f) {\n return function (arr) {\n var res = arr.slice(from, to);\n\n if (res.length == 1) {\n res = res[0];\n }\n\n return f ? f(res) : res;\n };\n }\n\n var Animation = function Animation(attr, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n\n this.attr = attr;\n this.dur = ms;\n easing && (this.easing = easing);\n callback && (this.callback = callback);\n };\n\n Snap._.Animation = Animation;\n /*\\\n * Snap.animation\n [ method ]\n **\n * Creates an animation object\n **\n - attr (object) attributes of final destination\n - duration (number) duration of the animation, in milliseconds\n - easing (function) #optional one of easing functions of @mina or custom one\n - callback (function) #optional callback function that fires when animation ends\n = (object) animation object\n \\*/\n\n Snap.animation = function (attr, ms, easing, callback) {\n return new Animation(attr, ms, easing, callback);\n };\n /*\\\n * Element.inAnim\n [ method ]\n **\n * Returns a set of animations that may be able to manipulate the current element\n **\n = (object) in format:\n o {\n o anim (object) animation object,\n o mina (object) @mina object,\n o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,\n o status (function) gets or sets the status of the animation,\n o stop (function) stops the animation\n o }\n \\*/\n\n\n elproto.inAnim = function () {\n var el = this,\n res = [];\n\n for (var id in el.anims) {\n if (el.anims[has](id)) {\n (function (a) {\n res.push({\n anim: new Animation(a._attrs, a.dur, a.easing, a._callback),\n mina: a,\n curStatus: a.status(),\n status: function status(val) {\n return a.status(val);\n },\n stop: function stop() {\n a.stop();\n }\n });\n })(el.anims[id]);\n }\n }\n\n return res;\n };\n /*\\\n * Snap.animate\n [ method ]\n **\n * Runs generic animation of one number into another with a caring function\n **\n - from (number|array) number or array of numbers\n - to (number|array) number or array of numbers\n - setter (function) caring function that accepts one number argument\n - duration (number) duration, in milliseconds\n - easing (function) #optional easing function from @mina or custom\n - callback (function) #optional callback function to execute when animation ends\n = (object) animation object in @mina format\n o {\n o id (string) animation id, consider it read-only,\n o duration (function) gets or sets the duration of the animation,\n o easing (function) easing,\n o speed (function) gets or sets the speed of the animation,\n o status (function) gets or sets the status of the animation,\n o stop (function) stops the animation\n o }\n | var rect = Snap().rect(0, 0, 10, 10);\n | Snap.animate(0, 10, function (val) {\n | rect.attr({\n | x: val\n | });\n | }, 1000);\n | // in given context is equivalent to\n | rect.animate({x: 10}, 1000);\n \\*/\n\n\n Snap.animate = function (from, to, setter, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n\n var now = mina.time(),\n anim = mina(from, to, now, now + ms, mina.time, setter, easing);\n callback && eve.once(\"mina.finish.\" + anim.id, callback);\n return anim;\n };\n /*\\\n * Element.stop\n [ method ]\n **\n * Stops all the animations for the current element\n **\n = (Element) the current element\n \\*/\n\n\n elproto.stop = function () {\n var anims = this.inAnim();\n\n for (var i = 0, ii = anims.length; i < ii; i++) {\n anims[i].stop();\n }\n\n return this;\n };\n /*\\\n * Element.animate\n [ method ]\n **\n * Animates the given attributes of the element\n **\n - attrs (object) key-value pairs of destination attributes\n - duration (number) duration of the animation in milliseconds\n - easing (function) #optional easing function from @mina or custom\n - callback (function) #optional callback function that executes when the animation ends\n = (Element) the current element\n \\*/\n\n\n elproto.animate = function (attrs, ms, easing, callback) {\n if (typeof easing == \"function\" && !easing.length) {\n callback = easing;\n easing = mina.linear;\n }\n\n if (attrs instanceof Animation) {\n callback = attrs.callback;\n easing = attrs.easing;\n ms = attrs.dur;\n attrs = attrs.attr;\n }\n\n var fkeys = [],\n tkeys = [],\n keys = {},\n from,\n to,\n f,\n eq,\n el = this;\n\n for (var key in attrs) {\n if (attrs[has](key)) {\n if (el.equal) {\n eq = el.equal(key, Str(attrs[key]));\n from = eq.from;\n to = eq.to;\n f = eq.f;\n } else {\n from = +el.attr(key);\n to = +attrs[key];\n }\n\n var len = is(from, \"array\") ? from.length : 1;\n keys[key] = slice(fkeys.length, fkeys.length + len, f);\n fkeys = fkeys.concat(from);\n tkeys = tkeys.concat(to);\n }\n }\n\n var now = mina.time(),\n anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {\n var attr = {};\n\n for (var key in keys) {\n if (keys[has](key)) {\n attr[key] = keys[key](val);\n }\n }\n\n el.attr(attr);\n }, easing);\n el.anims[anim.id] = anim;\n anim._attrs = attrs;\n anim._callback = callback;\n eve(\"snap.animcreated.\" + el.id, anim);\n eve.once(\"mina.finish.\" + anim.id, function () {\n eve.off(\"mina.*.\" + anim.id);\n delete el.anims[anim.id];\n callback && callback.call(el);\n });\n eve.once(\"mina.stop.\" + anim.id, function () {\n eve.off(\"mina.*.\" + anim.id);\n delete el.anims[anim.id];\n });\n return el;\n };\n}); // Copyright (c) 2017 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nSnap.plugin(function (Snap, Element, Paper, glob) {\n // Colours are from https://www.materialui.co\n var red = \"#ffebee#ffcdd2#ef9a9a#e57373#ef5350#f44336#e53935#d32f2f#c62828#b71c1c#ff8a80#ff5252#ff1744#d50000\",\n pink = \"#FCE4EC#F8BBD0#F48FB1#F06292#EC407A#E91E63#D81B60#C2185B#AD1457#880E4F#FF80AB#FF4081#F50057#C51162\",\n purple = \"#F3E5F5#E1BEE7#CE93D8#BA68C8#AB47BC#9C27B0#8E24AA#7B1FA2#6A1B9A#4A148C#EA80FC#E040FB#D500F9#AA00FF\",\n deeppurple = \"#EDE7F6#D1C4E9#B39DDB#9575CD#7E57C2#673AB7#5E35B1#512DA8#4527A0#311B92#B388FF#7C4DFF#651FFF#6200EA\",\n indigo = \"#E8EAF6#C5CAE9#9FA8DA#7986CB#5C6BC0#3F51B5#3949AB#303F9F#283593#1A237E#8C9EFF#536DFE#3D5AFE#304FFE\",\n blue = \"#E3F2FD#BBDEFB#90CAF9#64B5F6#64B5F6#2196F3#1E88E5#1976D2#1565C0#0D47A1#82B1FF#448AFF#2979FF#2962FF\",\n lightblue = \"#E1F5FE#B3E5FC#81D4FA#4FC3F7#29B6F6#03A9F4#039BE5#0288D1#0277BD#01579B#80D8FF#40C4FF#00B0FF#0091EA\",\n cyan = \"#E0F7FA#B2EBF2#80DEEA#4DD0E1#26C6DA#00BCD4#00ACC1#0097A7#00838F#006064#84FFFF#18FFFF#00E5FF#00B8D4\",\n teal = \"#E0F2F1#B2DFDB#80CBC4#4DB6AC#26A69A#009688#00897B#00796B#00695C#004D40#A7FFEB#64FFDA#1DE9B6#00BFA5\",\n green = \"#E8F5E9#C8E6C9#A5D6A7#81C784#66BB6A#4CAF50#43A047#388E3C#2E7D32#1B5E20#B9F6CA#69F0AE#00E676#00C853\",\n lightgreen = \"#F1F8E9#DCEDC8#C5E1A5#AED581#9CCC65#8BC34A#7CB342#689F38#558B2F#33691E#CCFF90#B2FF59#76FF03#64DD17\",\n lime = \"#F9FBE7#F0F4C3#E6EE9C#DCE775#D4E157#CDDC39#C0CA33#AFB42B#9E9D24#827717#F4FF81#EEFF41#C6FF00#AEEA00\",\n yellow = \"#FFFDE7#FFF9C4#FFF59D#FFF176#FFEE58#FFEB3B#FDD835#FBC02D#F9A825#F57F17#FFFF8D#FFFF00#FFEA00#FFD600\",\n amber = \"#FFF8E1#FFECB3#FFE082#FFD54F#FFCA28#FFC107#FFB300#FFA000#FF8F00#FF6F00#FFE57F#FFD740#FFC400#FFAB00\",\n orange = \"#FFF3E0#FFE0B2#FFCC80#FFB74D#FFA726#FF9800#FB8C00#F57C00#EF6C00#E65100#FFD180#FFAB40#FF9100#FF6D00\",\n deeporange = \"#FBE9E7#FFCCBC#FFAB91#FF8A65#FF7043#FF5722#F4511E#E64A19#D84315#BF360C#FF9E80#FF6E40#FF3D00#DD2C00\",\n brown = \"#EFEBE9#D7CCC8#BCAAA4#A1887F#8D6E63#795548#6D4C41#5D4037#4E342E#3E2723\",\n grey = \"#FAFAFA#F5F5F5#EEEEEE#E0E0E0#BDBDBD#9E9E9E#757575#616161#424242#212121\",\n bluegrey = \"#ECEFF1#CFD8DC#B0BEC5#90A4AE#78909C#607D8B#546E7A#455A64#37474F#263238\";\n /*\\\n * Snap.mui\n [ property ]\n **\n * Contain Material UI colours.\n | Snap().rect(0, 0, 10, 10).attr({fill: Snap.mui.deeppurple, stroke: Snap.mui.amber[600]});\n # For colour reference: <a href=\"https://www.materialui.co\">https://www.materialui.co</a>.\n \\*/\n\n Snap.mui = {};\n /*\\\n * Snap.flat\n [ property ]\n **\n * Contain Flat UI colours.\n | Snap().rect(0, 0, 10, 10).attr({fill: Snap.flat.carrot, stroke: Snap.flat.wetasphalt});\n # For colour reference: <a href=\"https://www.materialui.co\">https://www.materialui.co</a>.\n \\*/\n\n Snap.flat = {};\n\n function saveColor(colors) {\n colors = colors.split(/(?=#)/);\n var color = new String(colors[5]);\n color[50] = colors[0];\n color[100] = colors[1];\n color[200] = colors[2];\n color[300] = colors[3];\n color[400] = colors[4];\n color[500] = colors[5];\n color[600] = colors[6];\n color[700] = colors[7];\n color[800] = colors[8];\n color[900] = colors[9];\n\n if (colors[10]) {\n color.A100 = colors[10];\n color.A200 = colors[11];\n color.A400 = colors[12];\n color.A700 = colors[13];\n }\n\n return color;\n }\n\n Snap.mui.red = saveColor(red);\n Snap.mui.pink = saveColor(pink);\n Snap.mui.purple = saveColor(purple);\n Snap.mui.deeppurple = saveColor(deeppurple);\n Snap.mui.indigo = saveColor(indigo);\n Snap.mui.blue = saveColor(blue);\n Snap.mui.lightblue = saveColor(lightblue);\n Snap.mui.cyan = saveColor(cyan);\n Snap.mui.teal = saveColor(teal);\n Snap.mui.green = saveColor(green);\n Snap.mui.lightgreen = saveColor(lightgreen);\n Snap.mui.lime = saveColor(lime);\n Snap.mui.yellow = saveColor(yellow);\n Snap.mui.amber = saveColor(amber);\n Snap.mui.orange = saveColor(orange);\n Snap.mui.deeporange = saveColor(deeporange);\n Snap.mui.brown = saveColor(brown);\n Snap.mui.grey = saveColor(grey);\n Snap.mui.bluegrey = saveColor(bluegrey);\n Snap.flat.turquoise = \"#1abc9c\";\n Snap.flat.greensea = \"#16a085\";\n Snap.flat.sunflower = \"#f1c40f\";\n Snap.flat.orange = \"#f39c12\";\n Snap.flat.emerland = \"#2ecc71\";\n Snap.flat.nephritis = \"#27ae60\";\n Snap.flat.carrot = \"#e67e22\";\n Snap.flat.pumpkin = \"#d35400\";\n Snap.flat.peterriver = \"#3498db\";\n Snap.flat.belizehole = \"#2980b9\";\n Snap.flat.alizarin = \"#e74c3c\";\n Snap.flat.pomegranate = \"#c0392b\";\n Snap.flat.amethyst = \"#9b59b6\";\n Snap.flat.wisteria = \"#8e44ad\";\n Snap.flat.clouds = \"#ecf0f1\";\n Snap.flat.silver = \"#bdc3c7\";\n Snap.flat.wetasphalt = \"#34495e\";\n Snap.flat.midnightblue = \"#2c3e50\";\n Snap.flat.concrete = \"#95a5a6\";\n Snap.flat.asbestos = \"#7f8c8d\";\n /*\\\n * Snap.importMUIColors\n [ method ]\n **\n * Imports Material UI colours into global object.\n | Snap.importMUIColors();\n | Snap().rect(0, 0, 10, 10).attr({fill: deeppurple, stroke: amber[600]});\n # For colour reference: <a href=\"https://www.materialui.co\">https://www.materialui.co</a>.\n \\*/\n\n Snap.importMUIColors = function () {\n for (var color in Snap.mui) {\n if (Snap.mui.hasOwnProperty(color)) {\n window[color] = Snap.mui[color];\n }\n }\n };\n});\nmodule.exports = Snap;"],"sourceRoot":""}