raphael.min.js 147 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556
  1. // ┌────────────────────────────────────────────────────────────────────┐ \\
  2. // │ Raphaël 2.1.3 - JavaScript Vector Library │ \\
  3. // ├────────────────────────────────────────────────────────────────────┤ \\
  4. // │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
  5. // │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\
  6. // ├────────────────────────────────────────────────────────────────────┤ \\
  7. // │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
  8. // └────────────────────────────────────────────────────────────────────┘ \\
  9. !function (a) {
  10. var b, c, d = "0.4.2", e = "hasOwnProperty", f = /[\.\/]/, g = "*", h = function () {
  11. }, i = function (a, b) {
  12. return a - b
  13. }, j = {n: {}}, k = function (a, d) {
  14. a = String(a);
  15. var e, f = c, g = Array.prototype.slice.call(arguments, 2), h = k.listeners(a), j = 0, l = [], m = {}, n = [],
  16. o = b;
  17. b = a, c = 0;
  18. for (var p = 0, q = h.length; q > p; p++) "zIndex" in h[p] && (l.push(h[p].zIndex), h[p].zIndex < 0 && (m[h[p].zIndex] = h[p]));
  19. for (l.sort(i); l[j] < 0;) if (e = m[l[j++]], n.push(e.apply(d, g)), c) return c = f, n;
  20. for (p = 0; q > p; p++) if (e = h[p], "zIndex" in e) if (e.zIndex == l[j]) {
  21. if (n.push(e.apply(d, g)), c) break;
  22. do if (j++, e = m[l[j]], e && n.push(e.apply(d, g)), c) break; while (e)
  23. } else m[e.zIndex] = e; else if (n.push(e.apply(d, g)), c) break;
  24. return c = f, b = o, n.length ? n : null
  25. };
  26. k._events = j, k.listeners = function (a) {
  27. var b, c, d, e, h, i, k, l, m = a.split(f), n = j, o = [n], p = [];
  28. for (e = 0, h = m.length; h > e; e++) {
  29. for (l = [], i = 0, k = o.length; k > i; i++) for (n = o[i].n, c = [n[m[e]], n[g]], d = 2; d--;) b = c[d], b && (l.push(b), p = p.concat(b.f || []));
  30. o = l
  31. }
  32. return p
  33. }, k.on = function (a, b) {
  34. if (a = String(a), "function" != typeof b) return function () {
  35. };
  36. for (var c = a.split(f), d = j, e = 0, g = c.length; g > e; e++) d = d.n, d = d.hasOwnProperty(c[e]) && d[c[e]] || (d[c[e]] = {n: {}});
  37. for (d.f = d.f || [], e = 0, g = d.f.length; g > e; e++) if (d.f[e] == b) return h;
  38. return d.f.push(b), function (a) {
  39. +a == +a && (b.zIndex = +a)
  40. }
  41. }, k.f = function (a) {
  42. var b = [].slice.call(arguments, 1);
  43. return function () {
  44. k.apply(null, [a, null].concat(b).concat([].slice.call(arguments, 0)))
  45. }
  46. }, k.stop = function () {
  47. c = 1
  48. }, k.nt = function (a) {
  49. return a ? new RegExp("(?:\\.|\\/|^)" + a + "(?:\\.|\\/|$)").test(b) : b
  50. }, k.nts = function () {
  51. return b.split(f)
  52. }, k.off = k.unbind = function (a, b) {
  53. if (!a) return void (k._events = j = {n: {}});
  54. var c, d, h, i, l, m, n, o = a.split(f), p = [j];
  55. for (i = 0, l = o.length; l > i; i++) for (m = 0; m < p.length; m += h.length - 2) {
  56. if (h = [m, 1], c = p[m].n, o[i] != g) c[o[i]] && h.push(c[o[i]]); else for (d in c) c[e](d) && h.push(c[d]);
  57. p.splice.apply(p, h)
  58. }
  59. for (i = 0, l = p.length; l > i; i++) for (c = p[i]; c.n;) {
  60. if (b) {
  61. if (c.f) {
  62. for (m = 0, n = c.f.length; n > m; m++) if (c.f[m] == b) {
  63. c.f.splice(m, 1);
  64. break
  65. }
  66. !c.f.length && delete c.f
  67. }
  68. for (d in c.n) if (c.n[e](d) && c.n[d].f) {
  69. var q = c.n[d].f;
  70. for (m = 0, n = q.length; n > m; m++) if (q[m] == b) {
  71. q.splice(m, 1);
  72. break
  73. }
  74. !q.length && delete c.n[d].f
  75. }
  76. } else {
  77. delete c.f;
  78. for (d in c.n) c.n[e](d) && c.n[d].f && delete c.n[d].f
  79. }
  80. c = c.n
  81. }
  82. }, k.once = function (a, b) {
  83. var c = function () {
  84. return k.unbind(a, c), b.apply(this, arguments)
  85. };
  86. return k.on(a, c)
  87. }, k.version = d, k.toString = function () {
  88. return "You are running Eve " + d
  89. }, "undefined" != typeof module && module.exports ? module.exports = k : "undefined" != typeof define ? define("eve", [], function () {
  90. return k
  91. }) : a.eve = k
  92. }(window || this), function (a, b) {
  93. "function" == typeof define && define.amd ? define(["eve"], function (c) {
  94. return b(a, c)
  95. }) : b(a, a.eve || "function" == typeof require && require("eve"))
  96. }(this, function (a, b) {
  97. function c(a) {
  98. if (c.is(a, "function")) return u ? a() : b.on("raphael.DOMload", a);
  99. if (c.is(a, V)) return c._engine.create[D](c, a.splice(0, 3 + c.is(a[0], T))).add(a);
  100. var d = Array.prototype.slice.call(arguments, 0);
  101. if (c.is(d[d.length - 1], "function")) {
  102. var e = d.pop();
  103. return u ? e.call(c._engine.create[D](c, d)) : b.on("raphael.DOMload", function () {
  104. e.call(c._engine.create[D](c, d))
  105. })
  106. }
  107. return c._engine.create[D](c, arguments)
  108. }
  109. function d(a) {
  110. if ("function" == typeof a || Object(a) !== a) return a;
  111. var b = new a.constructor;
  112. for (var c in a) a[z](c) && (b[c] = d(a[c]));
  113. return b
  114. }
  115. function e(a, b) {
  116. for (var c = 0, d = a.length; d > c; c++) if (a[c] === b) return a.push(a.splice(c, 1)[0])
  117. }
  118. function f(a, b, c) {
  119. function d() {
  120. var f = Array.prototype.slice.call(arguments, 0), g = f.join("␀"), h = d.cache = d.cache || {},
  121. i = d.count = d.count || [];
  122. return h[z](g) ? (e(i, g), c ? c(h[g]) : h[g]) : (i.length >= 1e3 && delete h[i.shift()], i.push(g), h[g] = a[D](b, f), c ? c(h[g]) : h[g])
  123. }
  124. return d
  125. }
  126. function g() {
  127. return this.hex
  128. }
  129. function h(a, b) {
  130. for (var c = [], d = 0, e = a.length; e - 2 * !b > d; d += 2) {
  131. var f = [{x: +a[d - 2], y: +a[d - 1]}, {x: +a[d], y: +a[d + 1]}, {
  132. x: +a[d + 2],
  133. y: +a[d + 3]
  134. }, {x: +a[d + 4], y: +a[d + 5]}];
  135. b ? d ? e - 4 == d ? f[3] = {x: +a[0], y: +a[1]} : e - 2 == d && (f[2] = {
  136. x: +a[0],
  137. y: +a[1]
  138. }, f[3] = {x: +a[2], y: +a[3]}) : f[0] = {
  139. x: +a[e - 2],
  140. y: +a[e - 1]
  141. } : e - 4 == d ? f[3] = f[2] : d || (f[0] = {
  142. x: +a[d],
  143. y: +a[d + 1]
  144. }), c.push(["C", (-f[0].x + 6 * f[1].x + f[2].x) / 6, (-f[0].y + 6 * f[1].y + f[2].y) / 6, (f[1].x + 6 * f[2].x - f[3].x) / 6, (f[1].y + 6 * f[2].y - f[3].y) / 6, f[2].x, f[2].y])
  145. }
  146. return c
  147. }
  148. function i(a, b, c, d, e) {
  149. var f = -3 * b + 9 * c - 9 * d + 3 * e, g = a * f + 6 * b - 12 * c + 6 * d;
  150. return a * g - 3 * b + 3 * c
  151. }
  152. function j(a, b, c, d, e, f, g, h, j) {
  153. null == j && (j = 1), j = j > 1 ? 1 : 0 > j ? 0 : j;
  154. for (var k = j / 2, l = 12, m = [-.1252, .1252, -.3678, .3678, -.5873, .5873, -.7699, .7699, -.9041, .9041, -.9816, .9816], n = [.2491, .2491, .2335, .2335, .2032, .2032, .1601, .1601, .1069, .1069, .0472, .0472], o = 0, p = 0; l > p; p++) {
  155. var q = k * m[p] + k, r = i(q, a, c, e, g), s = i(q, b, d, f, h), t = r * r + s * s;
  156. o += n[p] * N.sqrt(t)
  157. }
  158. return k * o
  159. }
  160. function k(a, b, c, d, e, f, g, h, i) {
  161. if (!(0 > i || j(a, b, c, d, e, f, g, h) < i)) {
  162. var k, l = 1, m = l / 2, n = l - m, o = .01;
  163. for (k = j(a, b, c, d, e, f, g, h, n); Q(k - i) > o;) m /= 2, n += (i > k ? 1 : -1) * m, k = j(a, b, c, d, e, f, g, h, n);
  164. return n
  165. }
  166. }
  167. function l(a, b, c, d, e, f, g, h) {
  168. if (!(O(a, c) < P(e, g) || P(a, c) > O(e, g) || O(b, d) < P(f, h) || P(b, d) > O(f, h))) {
  169. var i = (a * d - b * c) * (e - g) - (a - c) * (e * h - f * g),
  170. j = (a * d - b * c) * (f - h) - (b - d) * (e * h - f * g), k = (a - c) * (f - h) - (b - d) * (e - g);
  171. if (k) {
  172. var l = i / k, m = j / k, n = +l.toFixed(2), o = +m.toFixed(2);
  173. if (!(n < +P(a, c).toFixed(2) || n > +O(a, c).toFixed(2) || n < +P(e, g).toFixed(2) || n > +O(e, g).toFixed(2) || o < +P(b, d).toFixed(2) || o > +O(b, d).toFixed(2) || o < +P(f, h).toFixed(2) || o > +O(f, h).toFixed(2))) return {
  174. x: l,
  175. y: m
  176. }
  177. }
  178. }
  179. }
  180. function m(a, b, d) {
  181. var e = c.bezierBBox(a), f = c.bezierBBox(b);
  182. if (!c.isBBoxIntersect(e, f)) return d ? 0 : [];
  183. for (var g = j.apply(0, a), h = j.apply(0, b), i = O(~~(g / 5), 1), k = O(~~(h / 5), 1), m = [], n = [], o = {}, p = d ? 0 : [], q = 0; i + 1 > q; q++) {
  184. var r = c.findDotsAtSegment.apply(c, a.concat(q / i));
  185. m.push({x: r.x, y: r.y, t: q / i})
  186. }
  187. for (q = 0; k + 1 > q; q++) r = c.findDotsAtSegment.apply(c, b.concat(q / k)), n.push({
  188. x: r.x,
  189. y: r.y,
  190. t: q / k
  191. });
  192. for (q = 0; i > q; q++) for (var s = 0; k > s; s++) {
  193. var t = m[q], u = m[q + 1], v = n[s], w = n[s + 1], x = Q(u.x - t.x) < .001 ? "y" : "x",
  194. y = Q(w.x - v.x) < .001 ? "y" : "x", z = l(t.x, t.y, u.x, u.y, v.x, v.y, w.x, w.y);
  195. if (z) {
  196. if (o[z.x.toFixed(4)] == z.y.toFixed(4)) continue;
  197. o[z.x.toFixed(4)] = z.y.toFixed(4);
  198. var A = t.t + Q((z[x] - t[x]) / (u[x] - t[x])) * (u.t - t.t),
  199. B = v.t + Q((z[y] - v[y]) / (w[y] - v[y])) * (w.t - v.t);
  200. A >= 0 && 1.001 >= A && B >= 0 && 1.001 >= B && (d ? p++ : p.push({
  201. x: z.x,
  202. y: z.y,
  203. t1: P(A, 1),
  204. t2: P(B, 1)
  205. }))
  206. }
  207. }
  208. return p
  209. }
  210. function n(a, b, d) {
  211. a = c._path2curve(a), b = c._path2curve(b);
  212. for (var e, f, g, h, i, j, k, l, n, o, p = d ? 0 : [], q = 0, r = a.length; r > q; q++) {
  213. var s = a[q];
  214. if ("M" == s[0]) e = i = s[1], f = j = s[2]; else {
  215. "C" == s[0] ? (n = [e, f].concat(s.slice(1)), e = n[6], f = n[7]) : (n = [e, f, e, f, i, j, i, j], e = i, f = j);
  216. for (var t = 0, u = b.length; u > t; t++) {
  217. var v = b[t];
  218. if ("M" == v[0]) g = k = v[1], h = l = v[2]; else {
  219. "C" == v[0] ? (o = [g, h].concat(v.slice(1)), g = o[6], h = o[7]) : (o = [g, h, g, h, k, l, k, l], g = k, h = l);
  220. var w = m(n, o, d);
  221. if (d) p += w; else {
  222. for (var x = 0, y = w.length; y > x; x++) w[x].segment1 = q, w[x].segment2 = t, w[x].bez1 = n, w[x].bez2 = o;
  223. p = p.concat(w)
  224. }
  225. }
  226. }
  227. }
  228. }
  229. return p
  230. }
  231. function o(a, b, c, d, e, f) {
  232. null != a ? (this.a = +a, this.b = +b, this.c = +c, this.d = +d, this.e = +e, this.f = +f) : (this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.e = 0, this.f = 0)
  233. }
  234. function p() {
  235. return this.x + H + this.y + H + this.width + " × " + this.height
  236. }
  237. function q(a, b, c, d, e, f) {
  238. function g(a) {
  239. return ((l * a + k) * a + j) * a
  240. }
  241. function h(a, b) {
  242. var c = i(a, b);
  243. return ((o * c + n) * c + m) * c
  244. }
  245. function i(a, b) {
  246. var c, d, e, f, h, i;
  247. for (e = a, i = 0; 8 > i; i++) {
  248. if (f = g(e) - a, Q(f) < b) return e;
  249. if (h = (3 * l * e + 2 * k) * e + j, Q(h) < 1e-6) break;
  250. e -= f / h
  251. }
  252. if (c = 0, d = 1, e = a, c > e) return c;
  253. if (e > d) return d;
  254. for (; d > c;) {
  255. if (f = g(e), Q(f - a) < b) return e;
  256. a > f ? c = e : d = e, e = (d - c) / 2 + c
  257. }
  258. return e
  259. }
  260. var j = 3 * b, k = 3 * (d - b) - j, l = 1 - j - k, m = 3 * c, n = 3 * (e - c) - m, o = 1 - m - n;
  261. return h(a, 1 / (200 * f))
  262. }
  263. function r(a, b) {
  264. var c = [], d = {};
  265. if (this.ms = b, this.times = 1, a) {
  266. for (var e in a) a[z](e) && (d[_(e)] = a[e], c.push(_(e)));
  267. c.sort(lb)
  268. }
  269. this.anim = d, this.top = c[c.length - 1], this.percents = c
  270. }
  271. function s(a, d, e, f, g, h) {
  272. e = _(e);
  273. var i, j, k, l, m, n, p = a.ms, r = {}, s = {}, t = {};
  274. if (f) for (v = 0, x = ic.length; x > v; v++) {
  275. var u = ic[v];
  276. if (u.el.id == d.id && u.anim == a) {
  277. u.percent != e ? (ic.splice(v, 1), k = 1) : j = u, d.attr(u.totalOrigin);
  278. break
  279. }
  280. } else f = +s;
  281. for (var v = 0, x = a.percents.length; x > v; v++) {
  282. if (a.percents[v] == e || a.percents[v] > f * a.top) {
  283. e = a.percents[v], m = a.percents[v - 1] || 0, p = p / a.top * (e - m), l = a.percents[v + 1], i = a.anim[e];
  284. break
  285. }
  286. f && d.attr(a.anim[a.percents[v]])
  287. }
  288. if (i) {
  289. if (j) j.initstatus = f, j.start = new Date - j.ms * f; else {
  290. for (var y in i) if (i[z](y) && (db[z](y) || d.paper.customAttributes[z](y))) switch (r[y] = d.attr(y), null == r[y] && (r[y] = cb[y]), s[y] = i[y], db[y]) {
  291. case T:
  292. t[y] = (s[y] - r[y]) / p;
  293. break;
  294. case"colour":
  295. r[y] = c.getRGB(r[y]);
  296. var A = c.getRGB(s[y]);
  297. t[y] = {r: (A.r - r[y].r) / p, g: (A.g - r[y].g) / p, b: (A.b - r[y].b) / p};
  298. break;
  299. case"path":
  300. var B = Kb(r[y], s[y]), C = B[1];
  301. for (r[y] = B[0], t[y] = [], v = 0, x = r[y].length; x > v; v++) {
  302. t[y][v] = [0];
  303. for (var D = 1, F = r[y][v].length; F > D; D++) t[y][v][D] = (C[v][D] - r[y][v][D]) / p
  304. }
  305. break;
  306. case"transform":
  307. var G = d._, H = Pb(G[y], s[y]);
  308. if (H) for (r[y] = H.from, s[y] = H.to, t[y] = [], t[y].real = !0, v = 0, x = r[y].length; x > v; v++) for (t[y][v] = [r[y][v][0]], D = 1, F = r[y][v].length; F > D; D++) t[y][v][D] = (s[y][v][D] - r[y][v][D]) / p; else {
  309. var K = d.matrix || new o, L = {
  310. _: {transform: G.transform}, getBBox: function () {
  311. return d.getBBox(1)
  312. }
  313. };
  314. r[y] = [K.a, K.b, K.c, K.d, K.e, K.f], Nb(L, s[y]), s[y] = L._.transform, t[y] = [(L.matrix.a - K.a) / p, (L.matrix.b - K.b) / p, (L.matrix.c - K.c) / p, (L.matrix.d - K.d) / p, (L.matrix.e - K.e) / p, (L.matrix.f - K.f) / p]
  315. }
  316. break;
  317. case"csv":
  318. var M = I(i[y])[J](w), N = I(r[y])[J](w);
  319. if ("clip-rect" == y) for (r[y] = N, t[y] = [], v = N.length; v--;) t[y][v] = (M[v] - r[y][v]) / p;
  320. s[y] = M;
  321. break;
  322. default:
  323. for (M = [][E](i[y]), N = [][E](r[y]), t[y] = [], v = d.paper.customAttributes[y].length; v--;) t[y][v] = ((M[v] || 0) - (N[v] || 0)) / p
  324. }
  325. var O = i.easing, P = c.easing_formulas[O];
  326. if (!P) if (P = I(O).match(Z), P && 5 == P.length) {
  327. var Q = P;
  328. P = function (a) {
  329. return q(a, +Q[1], +Q[2], +Q[3], +Q[4], p)
  330. }
  331. } else P = nb;
  332. if (n = i.start || a.start || +new Date, u = {
  333. anim: a,
  334. percent: e,
  335. timestamp: n,
  336. start: n + (a.del || 0),
  337. status: 0,
  338. initstatus: f || 0,
  339. stop: !1,
  340. ms: p,
  341. easing: P,
  342. from: r,
  343. diff: t,
  344. to: s,
  345. el: d,
  346. callback: i.callback,
  347. prev: m,
  348. next: l,
  349. repeat: h || a.times,
  350. origin: d.attr(),
  351. totalOrigin: g
  352. }, ic.push(u), f && !j && !k && (u.stop = !0, u.start = new Date - p * f, 1 == ic.length)) return kc();
  353. k && (u.start = new Date - u.ms * f), 1 == ic.length && jc(kc)
  354. }
  355. b("raphael.anim.start." + d.id, d, a)
  356. }
  357. }
  358. function t(a) {
  359. for (var b = 0; b < ic.length; b++) ic[b].el.paper == a && ic.splice(b--, 1)
  360. }
  361. c.version = "2.1.2", c.eve = b;
  362. var u, v, w = /[, ]+/, x = {circle: 1, rect: 1, path: 1, ellipse: 1, text: 1, image: 1}, y = /\{(\d+)\}/g,
  363. z = "hasOwnProperty", A = {doc: document, win: a},
  364. B = {was: Object.prototype[z].call(A.win, "Raphael"), is: A.win.Raphael}, C = function () {
  365. this.ca = this.customAttributes = {}
  366. }, D = "apply", E = "concat", F = "ontouchstart" in A.win || A.win.DocumentTouch && A.doc instanceof DocumentTouch,
  367. G = "", H = " ", I = String, J = "split",
  368. K = "click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[J](H),
  369. L = {mousedown: "touchstart", mousemove: "touchmove", mouseup: "touchend"}, M = I.prototype.toLowerCase,
  370. N = Math, O = N.max, P = N.min, Q = N.abs, R = N.pow, S = N.PI, T = "number", U = "string", V = "array",
  371. W = Object.prototype.toString,
  372. X = (c._ISURL = /^url\(['"]?(.+?)['"]?\)$/i, /^\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),
  373. Y = {NaN: 1, Infinity: 1, "-Infinity": 1}, Z = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
  374. $ = N.round, _ = parseFloat, ab = parseInt, bb = I.prototype.toUpperCase, cb = c._availableAttrs = {
  375. "arrow-end": "none",
  376. "arrow-start": "none",
  377. blur: 0,
  378. "clip-rect": "0 0 1e9 1e9",
  379. cursor: "default",
  380. cx: 0,
  381. cy: 0,
  382. fill: "#fff",
  383. "fill-opacity": 1,
  384. font: '10px "Arial"',
  385. "font-family": '"Arial"',
  386. "font-size": "10",
  387. "font-style": "normal",
  388. "font-weight": 400,
  389. gradient: 0,
  390. height: 0,
  391. href: "http://raphaeljs.com/",
  392. "letter-spacing": 0,
  393. opacity: 1,
  394. path: "M0,0",
  395. r: 0,
  396. rx: 0,
  397. ry: 0,
  398. src: "",
  399. stroke: "#000",
  400. "stroke-dasharray": "",
  401. "stroke-linecap": "butt",
  402. "stroke-linejoin": "butt",
  403. "stroke-miterlimit": 0,
  404. "stroke-opacity": 1,
  405. "stroke-width": 1,
  406. target: "_blank",
  407. "text-anchor": "middle",
  408. title: "Raphael",
  409. transform: "",
  410. width: 0,
  411. x: 0,
  412. y: 0
  413. }, db = c._availableAnimAttrs = {
  414. blur: T,
  415. "clip-rect": "csv",
  416. cx: T,
  417. cy: T,
  418. fill: "colour",
  419. "fill-opacity": T,
  420. "font-size": T,
  421. height: T,
  422. opacity: T,
  423. path: "path",
  424. r: T,
  425. rx: T,
  426. ry: T,
  427. stroke: "colour",
  428. "stroke-opacity": T,
  429. "stroke-width": T,
  430. transform: "transform",
  431. width: T,
  432. x: T,
  433. y: T
  434. },
  435. eb = /[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,
  436. fb = {hs: 1, rg: 1}, gb = /,?([achlmqrstvxz]),?/gi,
  437. hb = /([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,
  438. ib = /([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,
  439. jb = /(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,
  440. kb = (c._radial_gradient = /^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/, {}),
  441. lb = function (a, b) {
  442. return _(a) - _(b)
  443. }, mb = function () {
  444. }, nb = function (a) {
  445. return a
  446. }, ob = c._rectPath = function (a, b, c, d, e) {
  447. return e ? [["M", a + e, b], ["l", c - 2 * e, 0], ["a", e, e, 0, 0, 1, e, e], ["l", 0, d - 2 * e], ["a", e, e, 0, 0, 1, -e, e], ["l", 2 * e - c, 0], ["a", e, e, 0, 0, 1, -e, -e], ["l", 0, 2 * e - d], ["a", e, e, 0, 0, 1, e, -e], ["z"]] : [["M", a, b], ["l", c, 0], ["l", 0, d], ["l", -c, 0], ["z"]]
  448. }, pb = function (a, b, c, d) {
  449. return null == d && (d = c), [["M", a, b], ["m", 0, -d], ["a", c, d, 0, 1, 1, 0, 2 * d], ["a", c, d, 0, 1, 1, 0, -2 * d], ["z"]]
  450. }, qb = c._getPath = {
  451. path: function (a) {
  452. return a.attr("path")
  453. }, circle: function (a) {
  454. var b = a.attrs;
  455. return pb(b.cx, b.cy, b.r)
  456. }, ellipse: function (a) {
  457. var b = a.attrs;
  458. return pb(b.cx, b.cy, b.rx, b.ry)
  459. }, rect: function (a) {
  460. var b = a.attrs;
  461. return ob(b.x, b.y, b.width, b.height, b.r)
  462. }, image: function (a) {
  463. var b = a.attrs;
  464. return ob(b.x, b.y, b.width, b.height)
  465. }, text: function (a) {
  466. var b = a._getBBox();
  467. return ob(b.x, b.y, b.width, b.height)
  468. }, set: function (a) {
  469. var b = a._getBBox();
  470. return ob(b.x, b.y, b.width, b.height)
  471. }
  472. }, rb = c.mapPath = function (a, b) {
  473. if (!b) return a;
  474. var c, d, e, f, g, h, i;
  475. for (a = Kb(a), e = 0, g = a.length; g > e; e++) for (i = a[e], f = 1, h = i.length; h > f; f += 2) c = b.x(i[f], i[f + 1]), d = b.y(i[f], i[f + 1]), i[f] = c, i[f + 1] = d;
  476. return a
  477. };
  478. if (c._g = A, c.type = A.win.SVGAngle || A.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") ? "SVG" : "VML", "VML" == c.type) {
  479. var sb, tb = A.doc.createElement("div");
  480. if (tb.innerHTML = '<v:shape adj="1"/>', sb = tb.firstChild, sb.style.behavior = "url(#default#VML)", !sb || "object" != typeof sb.adj) return c.type = G;
  481. tb = null
  482. }
  483. c.svg = !(c.vml = "VML" == c.type), c._Paper = C, c.fn = v = C.prototype = c.prototype, c._id = 0, c._oid = 0, c.is = function (a, b) {
  484. return b = M.call(b), "finite" == b ? !Y[z](+a) : "array" == b ? a instanceof Array : "null" == b && null === a || b == typeof a && null !== a || "object" == b && a === Object(a) || "array" == b && Array.isArray && Array.isArray(a) || W.call(a).slice(8, -1).toLowerCase() == b
  485. }, c.angle = function (a, b, d, e, f, g) {
  486. if (null == f) {
  487. var h = a - d, i = b - e;
  488. return h || i ? (180 + 180 * N.atan2(-i, -h) / S + 360) % 360 : 0
  489. }
  490. return c.angle(a, b, f, g) - c.angle(d, e, f, g)
  491. }, c.rad = function (a) {
  492. return a % 360 * S / 180
  493. }, c.deg = function (a) {
  494. return 180 * a / S % 360
  495. }, c.snapTo = function (a, b, d) {
  496. if (d = c.is(d, "finite") ? d : 10, c.is(a, V)) {
  497. for (var e = a.length; e--;) if (Q(a[e] - b) <= d) return a[e]
  498. } else {
  499. a = +a;
  500. var f = b % a;
  501. if (d > f) return b - f;
  502. if (f > a - d) return b - f + a
  503. }
  504. return b
  505. };
  506. c.createUUID = function (a, b) {
  507. return function () {
  508. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a, b).toUpperCase()
  509. }
  510. }(/[xy]/g, function (a) {
  511. var b = 16 * N.random() | 0, c = "x" == a ? b : 3 & b | 8;
  512. return c.toString(16)
  513. });
  514. c.setWindow = function (a) {
  515. b("raphael.setWindow", c, A.win, a), A.win = a, A.doc = A.win.document, c._engine.initWin && c._engine.initWin(A.win)
  516. };
  517. var ub = function (a) {
  518. if (c.vml) {
  519. var b, d = /^\s+|\s+$/g;
  520. try {
  521. var e = new ActiveXObject("htmlfile");
  522. e.write("<body>"), e.close(), b = e.body
  523. } catch (g) {
  524. b = createPopup().document.body
  525. }
  526. var h = b.createTextRange();
  527. ub = f(function (a) {
  528. try {
  529. b.style.color = I(a).replace(d, G);
  530. var c = h.queryCommandValue("ForeColor");
  531. return c = (255 & c) << 16 | 65280 & c | (16711680 & c) >>> 16, "#" + ("000000" + c.toString(16)).slice(-6)
  532. } catch (e) {
  533. return "none"
  534. }
  535. })
  536. } else {
  537. var i = A.doc.createElement("i");
  538. i.title = "Raphaël Colour Picker", i.style.display = "none", A.doc.body.appendChild(i), ub = f(function (a) {
  539. return i.style.color = a, A.doc.defaultView.getComputedStyle(i, G).getPropertyValue("color")
  540. })
  541. }
  542. return ub(a)
  543. }, vb = function () {
  544. return "hsb(" + [this.h, this.s, this.b] + ")"
  545. }, wb = function () {
  546. return "hsl(" + [this.h, this.s, this.l] + ")"
  547. }, xb = function () {
  548. return this.hex
  549. }, yb = function (a, b, d) {
  550. if (null == b && c.is(a, "object") && "r" in a && "g" in a && "b" in a && (d = a.b, b = a.g, a = a.r), null == b && c.is(a, U)) {
  551. var e = c.getRGB(a);
  552. a = e.r, b = e.g, d = e.b
  553. }
  554. return (a > 1 || b > 1 || d > 1) && (a /= 255, b /= 255, d /= 255), [a, b, d]
  555. }, zb = function (a, b, d, e) {
  556. a *= 255, b *= 255, d *= 255;
  557. var f = {r: a, g: b, b: d, hex: c.rgb(a, b, d), toString: xb};
  558. return c.is(e, "finite") && (f.opacity = e), f
  559. };
  560. c.color = function (a) {
  561. var b;
  562. return c.is(a, "object") && "h" in a && "s" in a && "b" in a ? (b = c.hsb2rgb(a), a.r = b.r, a.g = b.g, a.b = b.b, a.hex = b.hex) : c.is(a, "object") && "h" in a && "s" in a && "l" in a ? (b = c.hsl2rgb(a), a.r = b.r, a.g = b.g, a.b = b.b, a.hex = b.hex) : (c.is(a, "string") && (a = c.getRGB(a)), c.is(a, "object") && "r" in a && "g" in a && "b" in a ? (b = c.rgb2hsl(a), a.h = b.h, a.s = b.s, a.l = b.l, b = c.rgb2hsb(a), a.v = b.b) : (a = {hex: "none"}, a.r = a.g = a.b = a.h = a.s = a.v = a.l = -1)), a.toString = xb, a
  563. }, c.hsb2rgb = function (a, b, c, d) {
  564. this.is(a, "object") && "h" in a && "s" in a && "b" in a && (c = a.b, b = a.s, d = a.o, a = a.h), a *= 360;
  565. var e, f, g, h, i;
  566. return a = a % 360 / 60, i = c * b, h = i * (1 - Q(a % 2 - 1)), e = f = g = c - i, a = ~~a, e += [i, h, 0, 0, h, i][a], f += [h, i, i, h, 0, 0][a], g += [0, 0, h, i, i, h][a], zb(e, f, g, d)
  567. }, c.hsl2rgb = function (a, b, c, d) {
  568. this.is(a, "object") && "h" in a && "s" in a && "l" in a && (c = a.l, b = a.s, a = a.h), (a > 1 || b > 1 || c > 1) && (a /= 360, b /= 100, c /= 100), a *= 360;
  569. var e, f, g, h, i;
  570. return a = a % 360 / 60, i = 2 * b * (.5 > c ? c : 1 - c), h = i * (1 - Q(a % 2 - 1)), e = f = g = c - i / 2, a = ~~a, e += [i, h, 0, 0, h, i][a], f += [h, i, i, h, 0, 0][a], g += [0, 0, h, i, i, h][a], zb(e, f, g, d)
  571. }, c.rgb2hsb = function (a, b, c) {
  572. c = yb(a, b, c), a = c[0], b = c[1], c = c[2];
  573. var d, e, f, g;
  574. return f = O(a, b, c), g = f - P(a, b, c), d = 0 == g ? null : f == a ? (b - c) / g : f == b ? (c - a) / g + 2 : (a - b) / g + 4, d = (d + 360) % 6 * 60 / 360, e = 0 == g ? 0 : g / f, {
  575. h: d,
  576. s: e,
  577. b: f,
  578. toString: vb
  579. }
  580. }, c.rgb2hsl = function (a, b, c) {
  581. c = yb(a, b, c), a = c[0], b = c[1], c = c[2];
  582. var d, e, f, g, h, i;
  583. return g = O(a, b, c), h = P(a, b, c), i = g - h, d = 0 == i ? null : g == a ? (b - c) / i : g == b ? (c - a) / i + 2 : (a - b) / i + 4, d = (d + 360) % 6 * 60 / 360, f = (g + h) / 2, e = 0 == i ? 0 : .5 > f ? i / (2 * f) : i / (2 - 2 * f), {
  584. h: d,
  585. s: e,
  586. l: f,
  587. toString: wb
  588. }
  589. }, c._path2string = function () {
  590. return this.join(",").replace(gb, "$1")
  591. };
  592. c._preload = function (a, b) {
  593. var c = A.doc.createElement("img");
  594. c.style.cssText = "position:absolute;left:-9999em;top:-9999em", c.onload = function () {
  595. b.call(this), this.onload = null, A.doc.body.removeChild(this)
  596. }, c.onerror = function () {
  597. A.doc.body.removeChild(this)
  598. }, A.doc.body.appendChild(c), c.src = a
  599. };
  600. c.getRGB = f(function (a) {
  601. if (!a || (a = I(a)).indexOf("-") + 1) return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: g};
  602. if ("none" == a) return {r: -1, g: -1, b: -1, hex: "none", toString: g};
  603. !(fb[z](a.toLowerCase().substring(0, 2)) || "#" == a.charAt()) && (a = ub(a));
  604. var b, d, e, f, h, i, j = a.match(X);
  605. return j ? (j[2] && (e = ab(j[2].substring(5), 16), d = ab(j[2].substring(3, 5), 16), b = ab(j[2].substring(1, 3), 16)), j[3] && (e = ab((h = j[3].charAt(3)) + h, 16), d = ab((h = j[3].charAt(2)) + h, 16), b = ab((h = j[3].charAt(1)) + h, 16)), j[4] && (i = j[4][J](eb), b = _(i[0]), "%" == i[0].slice(-1) && (b *= 2.55), d = _(i[1]), "%" == i[1].slice(-1) && (d *= 2.55), e = _(i[2]), "%" == i[2].slice(-1) && (e *= 2.55), "rgba" == j[1].toLowerCase().slice(0, 4) && (f = _(i[3])), i[3] && "%" == i[3].slice(-1) && (f /= 100)), j[5] ? (i = j[5][J](eb), b = _(i[0]), "%" == i[0].slice(-1) && (b *= 2.55), d = _(i[1]), "%" == i[1].slice(-1) && (d *= 2.55), e = _(i[2]), "%" == i[2].slice(-1) && (e *= 2.55), ("deg" == i[0].slice(-3) || "°" == i[0].slice(-1)) && (b /= 360), "hsba" == j[1].toLowerCase().slice(0, 4) && (f = _(i[3])), i[3] && "%" == i[3].slice(-1) && (f /= 100), c.hsb2rgb(b, d, e, f)) : j[6] ? (i = j[6][J](eb), b = _(i[0]), "%" == i[0].slice(-1) && (b *= 2.55), d = _(i[1]), "%" == i[1].slice(-1) && (d *= 2.55), e = _(i[2]), "%" == i[2].slice(-1) && (e *= 2.55), ("deg" == i[0].slice(-3) || "°" == i[0].slice(-1)) && (b /= 360), "hsla" == j[1].toLowerCase().slice(0, 4) && (f = _(i[3])), i[3] && "%" == i[3].slice(-1) && (f /= 100), c.hsl2rgb(b, d, e, f)) : (j = {
  606. r: b,
  607. g: d,
  608. b: e,
  609. toString: g
  610. }, j.hex = "#" + (16777216 | e | d << 8 | b << 16).toString(16).slice(1), c.is(f, "finite") && (j.opacity = f), j)) : {
  611. r: -1,
  612. g: -1,
  613. b: -1,
  614. hex: "none",
  615. error: 1,
  616. toString: g
  617. }
  618. }, c), c.hsb = f(function (a, b, d) {
  619. return c.hsb2rgb(a, b, d).hex
  620. }), c.hsl = f(function (a, b, d) {
  621. return c.hsl2rgb(a, b, d).hex
  622. }), c.rgb = f(function (a, b, c) {
  623. return "#" + (16777216 | c | b << 8 | a << 16).toString(16).slice(1)
  624. }), c.getColor = function (a) {
  625. var b = this.getColor.start = this.getColor.start || {h: 0, s: 1, b: a || .75}, c = this.hsb2rgb(b.h, b.s, b.b);
  626. return b.h += .075, b.h > 1 && (b.h = 0, b.s -= .2, b.s <= 0 && (this.getColor.start = {
  627. h: 0,
  628. s: 1,
  629. b: b.b
  630. })), c.hex
  631. }, c.getColor.reset = function () {
  632. delete this.start
  633. }, c.parsePathString = function (a) {
  634. if (!a) return null;
  635. var b = Ab(a);
  636. if (b.arr) return Cb(b.arr);
  637. var d = {a: 7, c: 6, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, z: 0}, e = [];
  638. return c.is(a, V) && c.is(a[0], V) && (e = Cb(a)), e.length || I(a).replace(hb, function (a, b, c) {
  639. var f = [], g = b.toLowerCase();
  640. if (c.replace(jb, function (a, b) {
  641. b && f.push(+b)
  642. }), "m" == g && f.length > 2 && (e.push([b][E](f.splice(0, 2))), g = "l", b = "m" == b ? "l" : "L"), "r" == g) e.push([b][E](f)); else for (; f.length >= d[g] && (e.push([b][E](f.splice(0, d[g]))), d[g]);) ;
  643. }), e.toString = c._path2string, b.arr = Cb(e), e
  644. }, c.parseTransformString = f(function (a) {
  645. if (!a) return null;
  646. var b = [];
  647. return c.is(a, V) && c.is(a[0], V) && (b = Cb(a)), b.length || I(a).replace(ib, function (a, c, d) {
  648. {
  649. var e = [];
  650. M.call(c)
  651. }
  652. d.replace(jb, function (a, b) {
  653. b && e.push(+b)
  654. }), b.push([c][E](e))
  655. }), b.toString = c._path2string, b
  656. });
  657. var Ab = function (a) {
  658. var b = Ab.ps = Ab.ps || {};
  659. return b[a] ? b[a].sleep = 100 : b[a] = {sleep: 100}, setTimeout(function () {
  660. for (var c in b) b[z](c) && c != a && (b[c].sleep--, !b[c].sleep && delete b[c])
  661. }), b[a]
  662. };
  663. c.findDotsAtSegment = function (a, b, c, d, e, f, g, h, i) {
  664. var j = 1 - i, k = R(j, 3), l = R(j, 2), m = i * i, n = m * i,
  665. o = k * a + 3 * l * i * c + 3 * j * i * i * e + n * g,
  666. p = k * b + 3 * l * i * d + 3 * j * i * i * f + n * h, q = a + 2 * i * (c - a) + m * (e - 2 * c + a),
  667. r = b + 2 * i * (d - b) + m * (f - 2 * d + b), s = c + 2 * i * (e - c) + m * (g - 2 * e + c),
  668. t = d + 2 * i * (f - d) + m * (h - 2 * f + d), u = j * a + i * c, v = j * b + i * d, w = j * e + i * g,
  669. x = j * f + i * h, y = 90 - 180 * N.atan2(q - s, r - t) / S;
  670. return (q > s || t > r) && (y += 180), {
  671. x: o,
  672. y: p,
  673. m: {x: q, y: r},
  674. n: {x: s, y: t},
  675. start: {x: u, y: v},
  676. end: {x: w, y: x},
  677. alpha: y
  678. }
  679. }, c.bezierBBox = function (a, b, d, e, f, g, h, i) {
  680. c.is(a, "array") || (a = [a, b, d, e, f, g, h, i]);
  681. var j = Jb.apply(null, a);
  682. return {x: j.min.x, y: j.min.y, x2: j.max.x, y2: j.max.y, width: j.max.x - j.min.x, height: j.max.y - j.min.y}
  683. }, c.isPointInsideBBox = function (a, b, c) {
  684. return b >= a.x && b <= a.x2 && c >= a.y && c <= a.y2
  685. }, c.isBBoxIntersect = function (a, b) {
  686. var d = c.isPointInsideBBox;
  687. return d(b, a.x, a.y) || d(b, a.x2, a.y) || d(b, a.x, a.y2) || d(b, a.x2, a.y2) || d(a, b.x, b.y) || d(a, b.x2, b.y) || d(a, b.x, b.y2) || d(a, b.x2, b.y2) || (a.x < b.x2 && a.x > b.x || b.x < a.x2 && b.x > a.x) && (a.y < b.y2 && a.y > b.y || b.y < a.y2 && b.y > a.y)
  688. }, c.pathIntersection = function (a, b) {
  689. return n(a, b)
  690. }, c.pathIntersectionNumber = function (a, b) {
  691. return n(a, b, 1)
  692. }, c.isPointInsidePath = function (a, b, d) {
  693. var e = c.pathBBox(a);
  694. return c.isPointInsideBBox(e, b, d) && n(a, [["M", b, d], ["H", e.x2 + 10]], 1) % 2 == 1
  695. }, c._removedFactory = function (a) {
  696. return function () {
  697. b("raphael.log", null, "Raphaël: you are calling to method “" + a + "” of removed object", a)
  698. }
  699. };
  700. var Bb = c.pathBBox = function (a) {
  701. var b = Ab(a);
  702. if (b.bbox) return d(b.bbox);
  703. if (!a) return {x: 0, y: 0, width: 0, height: 0, x2: 0, y2: 0};
  704. a = Kb(a);
  705. for (var c, e = 0, f = 0, g = [], h = [], i = 0, j = a.length; j > i; i++) if (c = a[i], "M" == c[0]) e = c[1], f = c[2], g.push(e), h.push(f); else {
  706. var k = Jb(e, f, c[1], c[2], c[3], c[4], c[5], c[6]);
  707. g = g[E](k.min.x, k.max.x), h = h[E](k.min.y, k.max.y), e = c[5], f = c[6]
  708. }
  709. var l = P[D](0, g), m = P[D](0, h), n = O[D](0, g), o = O[D](0, h), p = n - l, q = o - m,
  710. r = {x: l, y: m, x2: n, y2: o, width: p, height: q, cx: l + p / 2, cy: m + q / 2};
  711. return b.bbox = d(r), r
  712. }, Cb = function (a) {
  713. var b = d(a);
  714. return b.toString = c._path2string, b
  715. }, Db = c._pathToRelative = function (a) {
  716. var b = Ab(a);
  717. if (b.rel) return Cb(b.rel);
  718. c.is(a, V) && c.is(a && a[0], V) || (a = c.parsePathString(a));
  719. var d = [], e = 0, f = 0, g = 0, h = 0, i = 0;
  720. "M" == a[0][0] && (e = a[0][1], f = a[0][2], g = e, h = f, i++, d.push(["M", e, f]));
  721. for (var j = i, k = a.length; k > j; j++) {
  722. var l = d[j] = [], m = a[j];
  723. if (m[0] != M.call(m[0])) switch (l[0] = M.call(m[0]), l[0]) {
  724. case"a":
  725. l[1] = m[1], l[2] = m[2], l[3] = m[3], l[4] = m[4], l[5] = m[5], l[6] = +(m[6] - e).toFixed(3), l[7] = +(m[7] - f).toFixed(3);
  726. break;
  727. case"v":
  728. l[1] = +(m[1] - f).toFixed(3);
  729. break;
  730. case"m":
  731. g = m[1], h = m[2];
  732. default:
  733. for (var n = 1, o = m.length; o > n; n++) l[n] = +(m[n] - (n % 2 ? e : f)).toFixed(3)
  734. } else {
  735. l = d[j] = [], "m" == m[0] && (g = m[1] + e, h = m[2] + f);
  736. for (var p = 0, q = m.length; q > p; p++) d[j][p] = m[p]
  737. }
  738. var r = d[j].length;
  739. switch (d[j][0]) {
  740. case"z":
  741. e = g, f = h;
  742. break;
  743. case"h":
  744. e += +d[j][r - 1];
  745. break;
  746. case"v":
  747. f += +d[j][r - 1];
  748. break;
  749. default:
  750. e += +d[j][r - 2], f += +d[j][r - 1]
  751. }
  752. }
  753. return d.toString = c._path2string, b.rel = Cb(d), d
  754. }, Eb = c._pathToAbsolute = function (a) {
  755. var b = Ab(a);
  756. if (b.abs) return Cb(b.abs);
  757. if (c.is(a, V) && c.is(a && a[0], V) || (a = c.parsePathString(a)), !a || !a.length) return [["M", 0, 0]];
  758. var d = [], e = 0, f = 0, g = 0, i = 0, j = 0;
  759. "M" == a[0][0] && (e = +a[0][1], f = +a[0][2], g = e, i = f, j++, d[0] = ["M", e, f]);
  760. for (var k, l, m = 3 == a.length && "M" == a[0][0] && "R" == a[1][0].toUpperCase() && "Z" == a[2][0].toUpperCase(), n = j, o = a.length; o > n; n++) {
  761. if (d.push(k = []), l = a[n], l[0] != bb.call(l[0])) switch (k[0] = bb.call(l[0]), k[0]) {
  762. case"A":
  763. k[1] = l[1], k[2] = l[2], k[3] = l[3], k[4] = l[4], k[5] = l[5], k[6] = +(l[6] + e), k[7] = +(l[7] + f);
  764. break;
  765. case"V":
  766. k[1] = +l[1] + f;
  767. break;
  768. case"H":
  769. k[1] = +l[1] + e;
  770. break;
  771. case"R":
  772. for (var p = [e, f][E](l.slice(1)), q = 2, r = p.length; r > q; q++) p[q] = +p[q] + e, p[++q] = +p[q] + f;
  773. d.pop(), d = d[E](h(p, m));
  774. break;
  775. case"M":
  776. g = +l[1] + e, i = +l[2] + f;
  777. default:
  778. for (q = 1, r = l.length; r > q; q++) k[q] = +l[q] + (q % 2 ? e : f)
  779. } else if ("R" == l[0]) p = [e, f][E](l.slice(1)), d.pop(), d = d[E](h(p, m)), k = ["R"][E](l.slice(-2)); else for (var s = 0, t = l.length; t > s; s++) k[s] = l[s];
  780. switch (k[0]) {
  781. case"Z":
  782. e = g, f = i;
  783. break;
  784. case"H":
  785. e = k[1];
  786. break;
  787. case"V":
  788. f = k[1];
  789. break;
  790. case"M":
  791. g = k[k.length - 2], i = k[k.length - 1];
  792. default:
  793. e = k[k.length - 2], f = k[k.length - 1]
  794. }
  795. }
  796. return d.toString = c._path2string, b.abs = Cb(d), d
  797. }, Fb = function (a, b, c, d) {
  798. return [a, b, c, d, c, d]
  799. }, Gb = function (a, b, c, d, e, f) {
  800. var g = 1 / 3, h = 2 / 3;
  801. return [g * a + h * c, g * b + h * d, g * e + h * c, g * f + h * d, e, f]
  802. }, Hb = function (a, b, c, d, e, g, h, i, j, k) {
  803. var l, m = 120 * S / 180, n = S / 180 * (+e || 0), o = [], p = f(function (a, b, c) {
  804. var d = a * N.cos(c) - b * N.sin(c), e = a * N.sin(c) + b * N.cos(c);
  805. return {x: d, y: e}
  806. });
  807. if (k) y = k[0], z = k[1], w = k[2], x = k[3]; else {
  808. l = p(a, b, -n), a = l.x, b = l.y, l = p(i, j, -n), i = l.x, j = l.y;
  809. var q = (N.cos(S / 180 * e), N.sin(S / 180 * e), (a - i) / 2), r = (b - j) / 2,
  810. s = q * q / (c * c) + r * r / (d * d);
  811. s > 1 && (s = N.sqrt(s), c = s * c, d = s * d);
  812. var t = c * c, u = d * d,
  813. v = (g == h ? -1 : 1) * N.sqrt(Q((t * u - t * r * r - u * q * q) / (t * r * r + u * q * q))),
  814. w = v * c * r / d + (a + i) / 2, x = v * -d * q / c + (b + j) / 2, y = N.asin(((b - x) / d).toFixed(9)),
  815. z = N.asin(((j - x) / d).toFixed(9));
  816. y = w > a ? S - y : y, z = w > i ? S - z : z, 0 > y && (y = 2 * S + y), 0 > z && (z = 2 * S + z), h && y > z && (y -= 2 * S), !h && z > y && (z -= 2 * S)
  817. }
  818. var A = z - y;
  819. if (Q(A) > m) {
  820. var B = z, C = i, D = j;
  821. z = y + m * (h && z > y ? 1 : -1), i = w + c * N.cos(z), j = x + d * N.sin(z), o = Hb(i, j, c, d, e, 0, h, C, D, [z, B, w, x])
  822. }
  823. A = z - y;
  824. var F = N.cos(y), G = N.sin(y), H = N.cos(z), I = N.sin(z), K = N.tan(A / 4), L = 4 / 3 * c * K,
  825. M = 4 / 3 * d * K, O = [a, b], P = [a + L * G, b - M * F], R = [i + L * I, j - M * H], T = [i, j];
  826. if (P[0] = 2 * O[0] - P[0], P[1] = 2 * O[1] - P[1], k) return [P, R, T][E](o);
  827. o = [P, R, T][E](o).join()[J](",");
  828. for (var U = [], V = 0, W = o.length; W > V; V++) U[V] = V % 2 ? p(o[V - 1], o[V], n).y : p(o[V], o[V + 1], n).x;
  829. return U
  830. }, Ib = function (a, b, c, d, e, f, g, h, i) {
  831. var j = 1 - i;
  832. return {
  833. x: R(j, 3) * a + 3 * R(j, 2) * i * c + 3 * j * i * i * e + R(i, 3) * g,
  834. y: R(j, 3) * b + 3 * R(j, 2) * i * d + 3 * j * i * i * f + R(i, 3) * h
  835. }
  836. }, Jb = f(function (a, b, c, d, e, f, g, h) {
  837. var i, j = e - 2 * c + a - (g - 2 * e + c), k = 2 * (c - a) - 2 * (e - c), l = a - c,
  838. m = (-k + N.sqrt(k * k - 4 * j * l)) / 2 / j, n = (-k - N.sqrt(k * k - 4 * j * l)) / 2 / j, o = [b, h],
  839. p = [a, g];
  840. return Q(m) > "1e12" && (m = .5), Q(n) > "1e12" && (n = .5), m > 0 && 1 > m && (i = Ib(a, b, c, d, e, f, g, h, m), p.push(i.x), o.push(i.y)), n > 0 && 1 > n && (i = Ib(a, b, c, d, e, f, g, h, n), p.push(i.x), o.push(i.y)), j = f - 2 * d + b - (h - 2 * f + d), k = 2 * (d - b) - 2 * (f - d), l = b - d, m = (-k + N.sqrt(k * k - 4 * j * l)) / 2 / j, n = (-k - N.sqrt(k * k - 4 * j * l)) / 2 / j, Q(m) > "1e12" && (m = .5), Q(n) > "1e12" && (n = .5), m > 0 && 1 > m && (i = Ib(a, b, c, d, e, f, g, h, m), p.push(i.x), o.push(i.y)), n > 0 && 1 > n && (i = Ib(a, b, c, d, e, f, g, h, n), p.push(i.x), o.push(i.y)), {
  841. min: {
  842. x: P[D](0, p),
  843. y: P[D](0, o)
  844. }, max: {x: O[D](0, p), y: O[D](0, o)}
  845. }
  846. }), Kb = c._path2curve = f(function (a, b) {
  847. var c = !b && Ab(a);
  848. if (!b && c.curve) return Cb(c.curve);
  849. for (var d = Eb(a), e = b && Eb(b), f = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null}, g = {
  850. x: 0,
  851. y: 0,
  852. bx: 0,
  853. by: 0,
  854. X: 0,
  855. Y: 0,
  856. qx: null,
  857. qy: null
  858. }, h = (function (a, b, c) {
  859. var d, e, f = {T: 1, Q: 1};
  860. if (!a) return ["C", b.x, b.y, b.x, b.y, b.x, b.y];
  861. switch (!(a[0] in f) && (b.qx = b.qy = null), a[0]) {
  862. case"M":
  863. b.X = a[1], b.Y = a[2];
  864. break;
  865. case"A":
  866. a = ["C"][E](Hb[D](0, [b.x, b.y][E](a.slice(1))));
  867. break;
  868. case"S":
  869. "C" == c || "S" == c ? (d = 2 * b.x - b.bx, e = 2 * b.y - b.by) : (d = b.x, e = b.y), a = ["C", d, e][E](a.slice(1));
  870. break;
  871. case"T":
  872. "Q" == c || "T" == c ? (b.qx = 2 * b.x - b.qx, b.qy = 2 * b.y - b.qy) : (b.qx = b.x, b.qy = b.y), a = ["C"][E](Gb(b.x, b.y, b.qx, b.qy, a[1], a[2]));
  873. break;
  874. case"Q":
  875. b.qx = a[1], b.qy = a[2], a = ["C"][E](Gb(b.x, b.y, a[1], a[2], a[3], a[4]));
  876. break;
  877. case"L":
  878. a = ["C"][E](Fb(b.x, b.y, a[1], a[2]));
  879. break;
  880. case"H":
  881. a = ["C"][E](Fb(b.x, b.y, a[1], b.y));
  882. break;
  883. case"V":
  884. a = ["C"][E](Fb(b.x, b.y, b.x, a[1]));
  885. break;
  886. case"Z":
  887. a = ["C"][E](Fb(b.x, b.y, b.X, b.Y))
  888. }
  889. return a
  890. }), i = function (a, b) {
  891. if (a[b].length > 7) {
  892. a[b].shift();
  893. for (var c = a[b]; c.length;) k[b] = "A", e && (l[b] = "A"), a.splice(b++, 0, ["C"][E](c.splice(0, 6)));
  894. a.splice(b, 1), p = O(d.length, e && e.length || 0)
  895. }
  896. }, j = function (a, b, c, f, g) {
  897. a && b && "M" == a[g][0] && "M" != b[g][0] && (b.splice(g, 0, ["M", f.x, f.y]), c.bx = 0, c.by = 0, c.x = a[g][1], c.y = a[g][2], p = O(d.length, e && e.length || 0))
  898. }, k = [], l = [], m = "", n = "", o = 0, p = O(d.length, e && e.length || 0); p > o; o++) {
  899. d[o] && (m = d[o][0]), "C" != m && (k[o] = m, o && (n = k[o - 1])), d[o] = h(d[o], f, n), "A" != k[o] && "C" == m && (k[o] = "C"), i(d, o), e && (e[o] && (m = e[o][0]), "C" != m && (l[o] = m, o && (n = l[o - 1])), e[o] = h(e[o], g, n), "A" != l[o] && "C" == m && (l[o] = "C"), i(e, o)), j(d, e, f, g, o), j(e, d, g, f, o);
  900. var q = d[o], r = e && e[o], s = q.length, t = e && r.length;
  901. f.x = q[s - 2], f.y = q[s - 1], f.bx = _(q[s - 4]) || f.x, f.by = _(q[s - 3]) || f.y, g.bx = e && (_(r[t - 4]) || g.x), g.by = e && (_(r[t - 3]) || g.y), g.x = e && r[t - 2], g.y = e && r[t - 1]
  902. }
  903. return e || (c.curve = Cb(d)), e ? [d, e] : d
  904. }, null, Cb), Lb = (c._parseDots = f(function (a) {
  905. for (var b = [], d = 0, e = a.length; e > d; d++) {
  906. var f = {}, g = a[d].match(/^([^:]*):?([\d\.]*)/);
  907. if (f.color = c.getRGB(g[1]), f.color.error) return null;
  908. f.color = f.color.hex, g[2] && (f.offset = g[2] + "%"), b.push(f)
  909. }
  910. for (d = 1, e = b.length - 1; e > d; d++) if (!b[d].offset) {
  911. for (var h = _(b[d - 1].offset || 0), i = 0, j = d + 1; e > j; j++) if (b[j].offset) {
  912. i = b[j].offset;
  913. break
  914. }
  915. i || (i = 100, j = e), i = _(i);
  916. for (var k = (i - h) / (j - d + 1); j > d; d++) h += k, b[d].offset = h + "%"
  917. }
  918. return b
  919. }), c._tear = function (a, b) {
  920. a == b.top && (b.top = a.prev), a == b.bottom && (b.bottom = a.next), a.next && (a.next.prev = a.prev), a.prev && (a.prev.next = a.next)
  921. }), Mb = (c._tofront = function (a, b) {
  922. b.top !== a && (Lb(a, b), a.next = null, a.prev = b.top, b.top.next = a, b.top = a)
  923. }, c._toback = function (a, b) {
  924. b.bottom !== a && (Lb(a, b), a.next = b.bottom, a.prev = null, b.bottom.prev = a, b.bottom = a)
  925. }, c._insertafter = function (a, b, c) {
  926. Lb(a, c), b == c.top && (c.top = a), b.next && (b.next.prev = a), a.next = b.next, a.prev = b, b.next = a
  927. }, c._insertbefore = function (a, b, c) {
  928. Lb(a, c), b == c.bottom && (c.bottom = a), b.prev && (b.prev.next = a), a.prev = b.prev, b.prev = a, a.next = b
  929. }, c.toMatrix = function (a, b) {
  930. var c = Bb(a), d = {
  931. _: {transform: G}, getBBox: function () {
  932. return c
  933. }
  934. };
  935. return Nb(d, b), d.matrix
  936. }), Nb = (c.transformPath = function (a, b) {
  937. return rb(a, Mb(a, b))
  938. }, c._extractTransform = function (a, b) {
  939. if (null == b) return a._.transform;
  940. b = I(b).replace(/\.{3}|\u2026/g, a._.transform || G);
  941. var d = c.parseTransformString(b), e = 0, f = 0, g = 0, h = 1, i = 1, j = a._, k = new o;
  942. if (j.transform = d || [], d) for (var l = 0, m = d.length; m > l; l++) {
  943. var n, p, q, r, s, t = d[l], u = t.length, v = I(t[0]).toLowerCase(), w = t[0] != v, x = w ? k.invert() : 0;
  944. "t" == v && 3 == u ? w ? (n = x.x(0, 0), p = x.y(0, 0), q = x.x(t[1], t[2]), r = x.y(t[1], t[2]), k.translate(q - n, r - p)) : k.translate(t[1], t[2]) : "r" == v ? 2 == u ? (s = s || a.getBBox(1), k.rotate(t[1], s.x + s.width / 2, s.y + s.height / 2), e += t[1]) : 4 == u && (w ? (q = x.x(t[2], t[3]), r = x.y(t[2], t[3]), k.rotate(t[1], q, r)) : k.rotate(t[1], t[2], t[3]), e += t[1]) : "s" == v ? 2 == u || 3 == u ? (s = s || a.getBBox(1), k.scale(t[1], t[u - 1], s.x + s.width / 2, s.y + s.height / 2), h *= t[1], i *= t[u - 1]) : 5 == u && (w ? (q = x.x(t[3], t[4]), r = x.y(t[3], t[4]), k.scale(t[1], t[2], q, r)) : k.scale(t[1], t[2], t[3], t[4]), h *= t[1], i *= t[2]) : "m" == v && 7 == u && k.add(t[1], t[2], t[3], t[4], t[5], t[6]), j.dirtyT = 1, a.matrix = k
  945. }
  946. a.matrix = k, j.sx = h, j.sy = i, j.deg = e, j.dx = f = k.e, j.dy = g = k.f, 1 == h && 1 == i && !e && j.bbox ? (j.bbox.x += +f, j.bbox.y += +g) : j.dirtyT = 1
  947. }), Ob = function (a) {
  948. var b = a[0];
  949. switch (b.toLowerCase()) {
  950. case"t":
  951. return [b, 0, 0];
  952. case"m":
  953. return [b, 1, 0, 0, 1, 0, 0];
  954. case"r":
  955. return 4 == a.length ? [b, 0, a[2], a[3]] : [b, 0];
  956. case"s":
  957. return 5 == a.length ? [b, 1, 1, a[3], a[4]] : 3 == a.length ? [b, 1, 1] : [b, 1]
  958. }
  959. }, Pb = c._equaliseTransform = function (a, b) {
  960. b = I(b).replace(/\.{3}|\u2026/g, a), a = c.parseTransformString(a) || [], b = c.parseTransformString(b) || [];
  961. for (var d, e, f, g, h = O(a.length, b.length), i = [], j = [], k = 0; h > k; k++) {
  962. if (f = a[k] || Ob(b[k]), g = b[k] || Ob(f), f[0] != g[0] || "r" == f[0].toLowerCase() && (f[2] != g[2] || f[3] != g[3]) || "s" == f[0].toLowerCase() && (f[3] != g[3] || f[4] != g[4])) return;
  963. for (i[k] = [], j[k] = [], d = 0, e = O(f.length, g.length); e > d; d++) d in f && (i[k][d] = f[d]), d in g && (j[k][d] = g[d])
  964. }
  965. return {from: i, to: j}
  966. };
  967. c._getContainer = function (a, b, d, e) {
  968. var f;
  969. return f = null != e || c.is(a, "object") ? a : A.doc.getElementById(a), null != f ? f.tagName ? null == b ? {
  970. container: f,
  971. width: f.style.pixelWidth || f.offsetWidth,
  972. height: f.style.pixelHeight || f.offsetHeight
  973. } : {container: f, width: b, height: d} : {container: 1, x: a, y: b, width: d, height: e} : void 0
  974. }, c.pathToRelative = Db, c._engine = {}, c.path2curve = Kb, c.matrix = function (a, b, c, d, e, f) {
  975. return new o(a, b, c, d, e, f)
  976. }, function (a) {
  977. function b(a) {
  978. return a[0] * a[0] + a[1] * a[1]
  979. }
  980. function d(a) {
  981. var c = N.sqrt(b(a));
  982. a[0] && (a[0] /= c), a[1] && (a[1] /= c)
  983. }
  984. a.add = function (a, b, c, d, e, f) {
  985. var g, h, i, j, k = [[], [], []], l = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],
  986. m = [[a, c, e], [b, d, f], [0, 0, 1]];
  987. for (a && a instanceof o && (m = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]]), g = 0; 3 > g; g++) for (h = 0; 3 > h; h++) {
  988. for (j = 0, i = 0; 3 > i; i++) j += l[g][i] * m[i][h];
  989. k[g][h] = j
  990. }
  991. this.a = k[0][0], this.b = k[1][0], this.c = k[0][1], this.d = k[1][1], this.e = k[0][2], this.f = k[1][2]
  992. }, a.invert = function () {
  993. var a = this, b = a.a * a.d - a.b * a.c;
  994. return new o(a.d / b, -a.b / b, -a.c / b, a.a / b, (a.c * a.f - a.d * a.e) / b, (a.b * a.e - a.a * a.f) / b)
  995. }, a.clone = function () {
  996. return new o(this.a, this.b, this.c, this.d, this.e, this.f)
  997. }, a.translate = function (a, b) {
  998. this.add(1, 0, 0, 1, a, b)
  999. }, a.scale = function (a, b, c, d) {
  1000. null == b && (b = a), (c || d) && this.add(1, 0, 0, 1, c, d), this.add(a, 0, 0, b, 0, 0), (c || d) && this.add(1, 0, 0, 1, -c, -d)
  1001. }, a.rotate = function (a, b, d) {
  1002. a = c.rad(a), b = b || 0, d = d || 0;
  1003. var e = +N.cos(a).toFixed(9), f = +N.sin(a).toFixed(9);
  1004. this.add(e, f, -f, e, b, d), this.add(1, 0, 0, 1, -b, -d)
  1005. }, a.x = function (a, b) {
  1006. return a * this.a + b * this.c + this.e
  1007. }, a.y = function (a, b) {
  1008. return a * this.b + b * this.d + this.f
  1009. }, a.get = function (a) {
  1010. return +this[I.fromCharCode(97 + a)].toFixed(4)
  1011. }, a.toString = function () {
  1012. return c.svg ? "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")" : [this.get(0), this.get(2), this.get(1), this.get(3), 0, 0].join()
  1013. }, a.toFilter = function () {
  1014. return "progid:DXImageTransform.Microsoft.Matrix(M11=" + this.get(0) + ", M12=" + this.get(2) + ", M21=" + this.get(1) + ", M22=" + this.get(3) + ", Dx=" + this.get(4) + ", Dy=" + this.get(5) + ", sizingmethod='auto expand')"
  1015. }, a.offset = function () {
  1016. return [this.e.toFixed(4), this.f.toFixed(4)]
  1017. }, a.split = function () {
  1018. var a = {};
  1019. a.dx = this.e, a.dy = this.f;
  1020. var e = [[this.a, this.c], [this.b, this.d]];
  1021. a.scalex = N.sqrt(b(e[0])), d(e[0]), a.shear = e[0][0] * e[1][0] + e[0][1] * e[1][1], e[1] = [e[1][0] - e[0][0] * a.shear, e[1][1] - e[0][1] * a.shear], a.scaley = N.sqrt(b(e[1])), d(e[1]), a.shear /= a.scaley;
  1022. var f = -e[0][1], g = e[1][1];
  1023. return 0 > g ? (a.rotate = c.deg(N.acos(g)), 0 > f && (a.rotate = 360 - a.rotate)) : a.rotate = c.deg(N.asin(f)), a.isSimple = !(+a.shear.toFixed(9) || a.scalex.toFixed(9) != a.scaley.toFixed(9) && a.rotate), a.isSuperSimple = !+a.shear.toFixed(9) && a.scalex.toFixed(9) == a.scaley.toFixed(9) && !a.rotate, a.noRotation = !+a.shear.toFixed(9) && !a.rotate, a
  1024. }, a.toTransformString = function (a) {
  1025. var b = a || this[J]();
  1026. return b.isSimple ? (b.scalex = +b.scalex.toFixed(4), b.scaley = +b.scaley.toFixed(4), b.rotate = +b.rotate.toFixed(4), (b.dx || b.dy ? "t" + [b.dx, b.dy] : G) + (1 != b.scalex || 1 != b.scaley ? "s" + [b.scalex, b.scaley, 0, 0] : G) + (b.rotate ? "r" + [b.rotate, 0, 0] : G)) : "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)]
  1027. }
  1028. }(o.prototype);
  1029. var Qb = navigator.userAgent.match(/Version\/(.*?)\s/) || navigator.userAgent.match(/Chrome\/(\d+)/);
  1030. v.safari = "Apple Computer, Inc." == navigator.vendor && (Qb && Qb[1] < 4 || "iP" == navigator.platform.slice(0, 2)) || "Google Inc." == navigator.vendor && Qb && Qb[1] < 8 ? function () {
  1031. var a = this.rect(-99, -99, this.width + 99, this.height + 99).attr({stroke: "none"});
  1032. setTimeout(function () {
  1033. a.remove()
  1034. })
  1035. } : mb;
  1036. for (var Rb = function () {
  1037. this.returnValue = !1
  1038. }, Sb = function () {
  1039. return this.originalEvent.preventDefault()
  1040. }, Tb = function () {
  1041. this.cancelBubble = !0
  1042. }, Ub = function () {
  1043. return this.originalEvent.stopPropagation()
  1044. }, Vb = function (a) {
  1045. var b = A.doc.documentElement.scrollTop || A.doc.body.scrollTop,
  1046. c = A.doc.documentElement.scrollLeft || A.doc.body.scrollLeft;
  1047. return {x: a.clientX + c, y: a.clientY + b}
  1048. }, Wb = function () {
  1049. return A.doc.addEventListener ? function (a, b, c, d) {
  1050. var e = function (a) {
  1051. var b = Vb(a);
  1052. return c.call(d, a, b.x, b.y)
  1053. };
  1054. if (a.addEventListener(b, e, !1), F && L[b]) {
  1055. var f = function (b) {
  1056. for (var e = Vb(b), f = b, g = 0, h = b.targetTouches && b.targetTouches.length; h > g; g++) if (b.targetTouches[g].target == a) {
  1057. b = b.targetTouches[g], b.originalEvent = f, b.preventDefault = Sb, b.stopPropagation = Ub;
  1058. break
  1059. }
  1060. return c.call(d, b, e.x, e.y)
  1061. };
  1062. a.addEventListener(L[b], f, !1)
  1063. }
  1064. return function () {
  1065. return a.removeEventListener(b, e, !1), F && L[b] && a.removeEventListener(L[b], f, !1), !0
  1066. }
  1067. } : A.doc.attachEvent ? function (a, b, c, d) {
  1068. var e = function (a) {
  1069. a = a || A.win.event;
  1070. var b = A.doc.documentElement.scrollTop || A.doc.body.scrollTop,
  1071. e = A.doc.documentElement.scrollLeft || A.doc.body.scrollLeft, f = a.clientX + e, g = a.clientY + b;
  1072. return a.preventDefault = a.preventDefault || Rb, a.stopPropagation = a.stopPropagation || Tb, c.call(d, a, f, g)
  1073. };
  1074. a.attachEvent("on" + b, e);
  1075. var f = function () {
  1076. return a.detachEvent("on" + b, e), !0
  1077. };
  1078. return f
  1079. } : void 0
  1080. }(), Xb = [], Yb = function (a) {
  1081. for (var c, d = a.clientX, e = a.clientY, f = A.doc.documentElement.scrollTop || A.doc.body.scrollTop, g = A.doc.documentElement.scrollLeft || A.doc.body.scrollLeft, h = Xb.length; h--;) {
  1082. if (c = Xb[h], F && a.touches) {
  1083. for (var i, j = a.touches.length; j--;) if (i = a.touches[j], i.identifier == c.el._drag.id) {
  1084. d = i.clientX, e = i.clientY, (a.originalEvent ? a.originalEvent : a).preventDefault();
  1085. break
  1086. }
  1087. } else a.preventDefault();
  1088. var k, l = c.el.node, m = l.nextSibling, n = l.parentNode, o = l.style.display;
  1089. A.win.opera && n.removeChild(l), l.style.display = "none", k = c.el.paper.getElementByPoint(d, e), l.style.display = o, A.win.opera && (m ? n.insertBefore(l, m) : n.appendChild(l)), k && b("raphael.drag.over." + c.el.id, c.el, k), d += g, e += f, b("raphael.drag.move." + c.el.id, c.move_scope || c.el, d - c.el._drag.x, e - c.el._drag.y, d, e, a)
  1090. }
  1091. }, Zb = function (a) {
  1092. c.unmousemove(Yb).unmouseup(Zb);
  1093. for (var d, e = Xb.length; e--;) d = Xb[e], d.el._drag = {}, b("raphael.drag.end." + d.el.id, d.end_scope || d.start_scope || d.move_scope || d.el, a);
  1094. Xb = []
  1095. }, $b = c.el = {}, _b = K.length; _b--;) !function (a) {
  1096. c[a] = $b[a] = function (b, d) {
  1097. return c.is(b, "function") && (this.events = this.events || [], this.events.push({
  1098. name: a,
  1099. f: b,
  1100. unbind: Wb(this.shape || this.node || A.doc, a, b, d || this)
  1101. })), this
  1102. }, c["un" + a] = $b["un" + a] = function (b) {
  1103. for (var d = this.events || [], e = d.length; e--;) d[e].name != a || !c.is(b, "undefined") && d[e].f != b || (d[e].unbind(), d.splice(e, 1), !d.length && delete this.events);
  1104. return this
  1105. }
  1106. }(K[_b]);
  1107. $b.data = function (a, d) {
  1108. var e = kb[this.id] = kb[this.id] || {};
  1109. if (0 == arguments.length) return e;
  1110. if (1 == arguments.length) {
  1111. if (c.is(a, "object")) {
  1112. for (var f in a) a[z](f) && this.data(f, a[f]);
  1113. return this
  1114. }
  1115. return b("raphael.data.get." + this.id, this, e[a], a), e[a]
  1116. }
  1117. return e[a] = d, b("raphael.data.set." + this.id, this, d, a), this
  1118. }, $b.removeData = function (a) {
  1119. return null == a ? kb[this.id] = {} : kb[this.id] && delete kb[this.id][a], this
  1120. }, $b.getData = function () {
  1121. return d(kb[this.id] || {})
  1122. }, $b.hover = function (a, b, c, d) {
  1123. return this.mouseover(a, c).mouseout(b, d || c)
  1124. }, $b.unhover = function (a, b) {
  1125. return this.unmouseover(a).unmouseout(b)
  1126. };
  1127. var ac = [];
  1128. $b.drag = function (a, d, e, f, g, h) {
  1129. function i(i) {
  1130. (i.originalEvent || i).preventDefault();
  1131. var j = i.clientX, k = i.clientY, l = A.doc.documentElement.scrollTop || A.doc.body.scrollTop,
  1132. m = A.doc.documentElement.scrollLeft || A.doc.body.scrollLeft;
  1133. if (this._drag.id = i.identifier, F && i.touches) for (var n, o = i.touches.length; o--;) if (n = i.touches[o], this._drag.id = n.identifier, n.identifier == this._drag.id) {
  1134. j = n.clientX, k = n.clientY;
  1135. break
  1136. }
  1137. this._drag.x = j + m, this._drag.y = k + l, !Xb.length && c.mousemove(Yb).mouseup(Zb), Xb.push({
  1138. el: this,
  1139. move_scope: f,
  1140. start_scope: g,
  1141. end_scope: h
  1142. }), d && b.on("raphael.drag.start." + this.id, d), a && b.on("raphael.drag.move." + this.id, a), e && b.on("raphael.drag.end." + this.id, e), b("raphael.drag.start." + this.id, g || f || this, i.clientX + m, i.clientY + l, i)
  1143. }
  1144. return this._drag = {}, ac.push({el: this, start: i}), this.mousedown(i), this
  1145. }, $b.onDragOver = function (a) {
  1146. a ? b.on("raphael.drag.over." + this.id, a) : b.unbind("raphael.drag.over." + this.id)
  1147. }, $b.undrag = function () {
  1148. for (var a = ac.length; a--;) ac[a].el == this && (this.unmousedown(ac[a].start), ac.splice(a, 1), b.unbind("raphael.drag.*." + this.id));
  1149. !ac.length && c.unmousemove(Yb).unmouseup(Zb), Xb = []
  1150. }, v.circle = function (a, b, d) {
  1151. var e = c._engine.circle(this, a || 0, b || 0, d || 0);
  1152. return this.__set__ && this.__set__.push(e), e
  1153. }, v.rect = function (a, b, d, e, f) {
  1154. var g = c._engine.rect(this, a || 0, b || 0, d || 0, e || 0, f || 0);
  1155. return this.__set__ && this.__set__.push(g), g
  1156. }, v.ellipse = function (a, b, d, e) {
  1157. var f = c._engine.ellipse(this, a || 0, b || 0, d || 0, e || 0);
  1158. return this.__set__ && this.__set__.push(f), f
  1159. }, v.path = function (a) {
  1160. a && !c.is(a, U) && !c.is(a[0], V) && (a += G);
  1161. var b = c._engine.path(c.format[D](c, arguments), this);
  1162. return this.__set__ && this.__set__.push(b), b
  1163. }, v.image = function (a, b, d, e, f) {
  1164. var g = c._engine.image(this, a || "about:blank", b || 0, d || 0, e || 0, f || 0);
  1165. return this.__set__ && this.__set__.push(g), g
  1166. }, v.text = function (a, b, d) {
  1167. var e = c._engine.text(this, a || 0, b || 0, I(d));
  1168. return this.__set__ && this.__set__.push(e), e
  1169. }, v.set = function (a) {
  1170. !c.is(a, "array") && (a = Array.prototype.splice.call(arguments, 0, arguments.length));
  1171. var b = new mc(a);
  1172. return this.__set__ && this.__set__.push(b), b.paper = this, b.type = "set", b
  1173. }, v.setStart = function (a) {
  1174. this.__set__ = a || this.set()
  1175. }, v.setFinish = function () {
  1176. var a = this.__set__;
  1177. return delete this.__set__, a
  1178. }, v.getSize = function () {
  1179. var a = this.canvas.parentNode;
  1180. return {width: a.offsetWidth, height: a.offsetHeight}
  1181. }, v.setSize = function (a, b) {
  1182. return c._engine.setSize.call(this, a, b)
  1183. }, v.setViewBox = function (a, b, d, e, f) {
  1184. return c._engine.setViewBox.call(this, a, b, d, e, f)
  1185. }, v.top = v.bottom = null, v.raphael = c;
  1186. var bc = function (a) {
  1187. var b = a.getBoundingClientRect(), c = a.ownerDocument, d = c.body, e = c.documentElement,
  1188. f = e.clientTop || d.clientTop || 0, g = e.clientLeft || d.clientLeft || 0,
  1189. h = b.top + (A.win.pageYOffset || e.scrollTop || d.scrollTop) - f,
  1190. i = b.left + (A.win.pageXOffset || e.scrollLeft || d.scrollLeft) - g;
  1191. return {y: h, x: i}
  1192. };
  1193. v.getElementByPoint = function (a, b) {
  1194. var c = this, d = c.canvas, e = A.doc.elementFromPoint(a, b);
  1195. if (A.win.opera && "svg" == e.tagName) {
  1196. var f = bc(d), g = d.createSVGRect();
  1197. g.x = a - f.x, g.y = b - f.y, g.width = g.height = 1;
  1198. var h = d.getIntersectionList(g, null);
  1199. h.length && (e = h[h.length - 1])
  1200. }
  1201. if (!e) return null;
  1202. for (; e.parentNode && e != d.parentNode && !e.raphael;) e = e.parentNode;
  1203. return e == c.canvas.parentNode && (e = d), e = e && e.raphael ? c.getById(e.raphaelid) : null
  1204. }, v.getElementsByBBox = function (a) {
  1205. var b = this.set();
  1206. return this.forEach(function (d) {
  1207. c.isBBoxIntersect(d.getBBox(), a) && b.push(d)
  1208. }), b
  1209. }, v.getById = function (a) {
  1210. for (var b = this.bottom; b;) {
  1211. if (b.id == a) return b;
  1212. b = b.next
  1213. }
  1214. return null
  1215. }, v.forEach = function (a, b) {
  1216. for (var c = this.bottom; c;) {
  1217. if (a.call(b, c) === !1) return this;
  1218. c = c.next
  1219. }
  1220. return this
  1221. }, v.getElementsByPoint = function (a, b) {
  1222. var c = this.set();
  1223. return this.forEach(function (d) {
  1224. d.isPointInside(a, b) && c.push(d)
  1225. }), c
  1226. }, $b.isPointInside = function (a, b) {
  1227. var d = this.realPath = qb[this.type](this);
  1228. return this.attr("transform") && this.attr("transform").length && (d = c.transformPath(d, this.attr("transform"))), c.isPointInsidePath(d, a, b)
  1229. }, $b.getBBox = function (a) {
  1230. if (this.removed) return {};
  1231. var b = this._;
  1232. return a ? ((b.dirty || !b.bboxwt) && (this.realPath = qb[this.type](this), b.bboxwt = Bb(this.realPath), b.bboxwt.toString = p, b.dirty = 0), b.bboxwt) : ((b.dirty || b.dirtyT || !b.bbox) && ((b.dirty || !this.realPath) && (b.bboxwt = 0, this.realPath = qb[this.type](this)), b.bbox = Bb(rb(this.realPath, this.matrix)), b.bbox.toString = p, b.dirty = b.dirtyT = 0), b.bbox)
  1233. }, $b.clone = function () {
  1234. if (this.removed) return null;
  1235. var a = this.paper[this.type]().attr(this.attr());
  1236. return this.__set__ && this.__set__.push(a), a
  1237. }, $b.glow = function (a) {
  1238. if ("text" == this.type) return null;
  1239. a = a || {};
  1240. var b = {
  1241. width: (a.width || 10) + (+this.attr("stroke-width") || 1),
  1242. fill: a.fill || !1,
  1243. opacity: a.opacity || .5,
  1244. offsetx: a.offsetx || 0,
  1245. offsety: a.offsety || 0,
  1246. color: a.color || "#000"
  1247. }, c = b.width / 2, d = this.paper, e = d.set(), f = this.realPath || qb[this.type](this);
  1248. f = this.matrix ? rb(f, this.matrix) : f;
  1249. for (var g = 1; c + 1 > g; g++) e.push(d.path(f).attr({
  1250. stroke: b.color,
  1251. fill: b.fill ? b.color : "none",
  1252. "stroke-linejoin": "round",
  1253. "stroke-linecap": "round",
  1254. "stroke-width": +(b.width / c * g).toFixed(3),
  1255. opacity: +(b.opacity / c).toFixed(3)
  1256. }));
  1257. return e.insertBefore(this).translate(b.offsetx, b.offsety)
  1258. };
  1259. var cc = function (a, b, d, e, f, g, h, i, l) {
  1260. return null == l ? j(a, b, d, e, f, g, h, i) : c.findDotsAtSegment(a, b, d, e, f, g, h, i, k(a, b, d, e, f, g, h, i, l))
  1261. }, dc = function (a, b) {
  1262. return function (d, e, f) {
  1263. d = Kb(d);
  1264. for (var g, h, i, j, k, l = "", m = {}, n = 0, o = 0, p = d.length; p > o; o++) {
  1265. if (i = d[o], "M" == i[0]) g = +i[1], h = +i[2]; else {
  1266. if (j = cc(g, h, i[1], i[2], i[3], i[4], i[5], i[6]), n + j > e) {
  1267. if (b && !m.start) {
  1268. if (k = cc(g, h, i[1], i[2], i[3], i[4], i[5], i[6], e - n), l += ["C" + k.start.x, k.start.y, k.m.x, k.m.y, k.x, k.y], f) return l;
  1269. m.start = l, l = ["M" + k.x, k.y + "C" + k.n.x, k.n.y, k.end.x, k.end.y, i[5], i[6]].join(), n += j, g = +i[5], h = +i[6];
  1270. continue
  1271. }
  1272. if (!a && !b) return k = cc(g, h, i[1], i[2], i[3], i[4], i[5], i[6], e - n), {
  1273. x: k.x,
  1274. y: k.y,
  1275. alpha: k.alpha
  1276. }
  1277. }
  1278. n += j, g = +i[5], h = +i[6]
  1279. }
  1280. l += i.shift() + i
  1281. }
  1282. return m.end = l, k = a ? n : b ? m : c.findDotsAtSegment(g, h, i[0], i[1], i[2], i[3], i[4], i[5], 1), k.alpha && (k = {
  1283. x: k.x,
  1284. y: k.y,
  1285. alpha: k.alpha
  1286. }), k
  1287. }
  1288. }, ec = dc(1), fc = dc(), gc = dc(0, 1);
  1289. c.getTotalLength = ec, c.getPointAtLength = fc, c.getSubpath = function (a, b, c) {
  1290. if (this.getTotalLength(a) - c < 1e-6) return gc(a, b).end;
  1291. var d = gc(a, c, 1);
  1292. return b ? gc(d, b).end : d
  1293. }, $b.getTotalLength = function () {
  1294. var a = this.getPath();
  1295. if (a) return this.node.getTotalLength ? this.node.getTotalLength() : ec(a)
  1296. }, $b.getPointAtLength = function (a) {
  1297. var b = this.getPath();
  1298. if (b) return fc(b, a)
  1299. }, $b.getPath = function () {
  1300. var a, b = c._getPath[this.type];
  1301. if ("text" != this.type && "set" != this.type) return b && (a = b(this)), a
  1302. }, $b.getSubpath = function (a, b) {
  1303. var d = this.getPath();
  1304. if (d) return c.getSubpath(d, a, b)
  1305. };
  1306. var hc = c.easing_formulas = {
  1307. linear: function (a) {
  1308. return a
  1309. }, "<": function (a) {
  1310. return R(a, 1.7)
  1311. }, ">": function (a) {
  1312. return R(a, .48)
  1313. }, "<>": function (a) {
  1314. var b = .48 - a / 1.04, c = N.sqrt(.1734 + b * b), d = c - b, e = R(Q(d), 1 / 3) * (0 > d ? -1 : 1),
  1315. f = -c - b, g = R(Q(f), 1 / 3) * (0 > f ? -1 : 1), h = e + g + .5;
  1316. return 3 * (1 - h) * h * h + h * h * h
  1317. }, backIn: function (a) {
  1318. var b = 1.70158;
  1319. return a * a * ((b + 1) * a - b)
  1320. }, backOut: function (a) {
  1321. a -= 1;
  1322. var b = 1.70158;
  1323. return a * a * ((b + 1) * a + b) + 1
  1324. }, elastic: function (a) {
  1325. return a == !!a ? a : R(2, -10 * a) * N.sin(2 * (a - .075) * S / .3) + 1
  1326. }, bounce: function (a) {
  1327. var b, c = 7.5625, d = 2.75;
  1328. return 1 / d > a ? b = c * a * a : 2 / d > a ? (a -= 1.5 / d, b = c * a * a + .75) : 2.5 / d > a ? (a -= 2.25 / d, b = c * a * a + .9375) : (a -= 2.625 / d, b = c * a * a + .984375), b
  1329. }
  1330. };
  1331. hc.easeIn = hc["ease-in"] = hc["<"], hc.easeOut = hc["ease-out"] = hc[">"], hc.easeInOut = hc["ease-in-out"] = hc["<>"], hc["back-in"] = hc.backIn, hc["back-out"] = hc.backOut;
  1332. var ic = [],
  1333. jc = a.requestAnimationFrame || a.webkitRequestAnimationFrame || a.mozRequestAnimationFrame || a.oRequestAnimationFrame || a.msRequestAnimationFrame || function (a) {
  1334. setTimeout(a, 16)
  1335. }, kc = function () {
  1336. for (var a = +new Date, d = 0; d < ic.length; d++) {
  1337. var e = ic[d];
  1338. if (!e.el.removed && !e.paused) {
  1339. var f, g, h = a - e.start, i = e.ms, j = e.easing, k = e.from, l = e.diff, m = e.to, n = (e.t, e.el),
  1340. o = {}, p = {};
  1341. if (e.initstatus ? (h = (e.initstatus * e.anim.top - e.prev) / (e.percent - e.prev) * i, e.status = e.initstatus, delete e.initstatus, e.stop && ic.splice(d--, 1)) : e.status = (e.prev + (e.percent - e.prev) * (h / i)) / e.anim.top, !(0 > h)) if (i > h) {
  1342. var q = j(h / i);
  1343. for (var r in k) if (k[z](r)) {
  1344. switch (db[r]) {
  1345. case T:
  1346. f = +k[r] + q * i * l[r];
  1347. break;
  1348. case"colour":
  1349. f = "rgb(" + [lc($(k[r].r + q * i * l[r].r)), lc($(k[r].g + q * i * l[r].g)), lc($(k[r].b + q * i * l[r].b))].join(",") + ")";
  1350. break;
  1351. case"path":
  1352. f = [];
  1353. for (var t = 0, u = k[r].length; u > t; t++) {
  1354. f[t] = [k[r][t][0]];
  1355. for (var v = 1, w = k[r][t].length; w > v; v++) f[t][v] = +k[r][t][v] + q * i * l[r][t][v];
  1356. f[t] = f[t].join(H)
  1357. }
  1358. f = f.join(H);
  1359. break;
  1360. case"transform":
  1361. if (l[r].real) for (f = [], t = 0, u = k[r].length; u > t; t++) for (f[t] = [k[r][t][0]], v = 1, w = k[r][t].length; w > v; v++) f[t][v] = k[r][t][v] + q * i * l[r][t][v]; else {
  1362. var x = function (a) {
  1363. return +k[r][a] + q * i * l[r][a]
  1364. };
  1365. f = [["m", x(0), x(1), x(2), x(3), x(4), x(5)]]
  1366. }
  1367. break;
  1368. case"csv":
  1369. if ("clip-rect" == r) for (f = [], t = 4; t--;) f[t] = +k[r][t] + q * i * l[r][t];
  1370. break;
  1371. default:
  1372. var y = [][E](k[r]);
  1373. for (f = [], t = n.paper.customAttributes[r].length; t--;) f[t] = +y[t] + q * i * l[r][t]
  1374. }
  1375. o[r] = f
  1376. }
  1377. n.attr(o), function (a, c, d) {
  1378. setTimeout(function () {
  1379. b("raphael.anim.frame." + a, c, d)
  1380. })
  1381. }(n.id, n, e.anim)
  1382. } else {
  1383. if (function (a, d, e) {
  1384. setTimeout(function () {
  1385. b("raphael.anim.frame." + d.id, d, e), b("raphael.anim.finish." + d.id, d, e), c.is(a, "function") && a.call(d)
  1386. })
  1387. }(e.callback, n, e.anim), n.attr(m), ic.splice(d--, 1), e.repeat > 1 && !e.next) {
  1388. for (g in m) m[z](g) && (p[g] = e.totalOrigin[g]);
  1389. e.el.attr(p), s(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1)
  1390. }
  1391. e.next && !e.stop && s(e.anim, e.el, e.next, null, e.totalOrigin, e.repeat)
  1392. }
  1393. }
  1394. }
  1395. c.svg && n && n.paper && n.paper.safari(), ic.length && jc(kc)
  1396. }, lc = function (a) {
  1397. return a > 255 ? 255 : 0 > a ? 0 : a
  1398. };
  1399. $b.animateWith = function (a, b, d, e, f, g) {
  1400. var h = this;
  1401. if (h.removed) return g && g.call(h), h;
  1402. var i = d instanceof r ? d : c.animation(d, e, f, g);
  1403. s(i, h, i.percents[0], null, h.attr());
  1404. for (var j = 0, k = ic.length; k > j; j++) if (ic[j].anim == b && ic[j].el == a) {
  1405. ic[k - 1].start = ic[j].start;
  1406. break
  1407. }
  1408. return h
  1409. }, $b.onAnimation = function (a) {
  1410. return a ? b.on("raphael.anim.frame." + this.id, a) : b.unbind("raphael.anim.frame." + this.id), this
  1411. }, r.prototype.delay = function (a) {
  1412. var b = new r(this.anim, this.ms);
  1413. return b.times = this.times, b.del = +a || 0, b
  1414. }, r.prototype.repeat = function (a) {
  1415. var b = new r(this.anim, this.ms);
  1416. return b.del = this.del, b.times = N.floor(O(a, 0)) || 1, b
  1417. }, c.animation = function (a, b, d, e) {
  1418. if (a instanceof r) return a;
  1419. (c.is(d, "function") || !d) && (e = e || d || null, d = null), a = Object(a), b = +b || 0;
  1420. var f, g, h = {};
  1421. for (g in a) a[z](g) && _(g) != g && _(g) + "%" != g && (f = !0, h[g] = a[g]);
  1422. if (f) return d && (h.easing = d), e && (h.callback = e), new r({100: h}, b);
  1423. if (e) {
  1424. var i = 0;
  1425. for (var j in a) {
  1426. var k = ab(j);
  1427. a[z](j) && k > i && (i = k)
  1428. }
  1429. i += "%", !a[i].callback && (a[i].callback = e)
  1430. }
  1431. return new r(a, b)
  1432. }, $b.animate = function (a, b, d, e) {
  1433. var f = this;
  1434. if (f.removed) return e && e.call(f), f;
  1435. var g = a instanceof r ? a : c.animation(a, b, d, e);
  1436. return s(g, f, g.percents[0], null, f.attr()), f
  1437. }, $b.setTime = function (a, b) {
  1438. return a && null != b && this.status(a, P(b, a.ms) / a.ms), this
  1439. }, $b.status = function (a, b) {
  1440. var c, d, e = [], f = 0;
  1441. if (null != b) return s(a, this, -1, P(b, 1)), this;
  1442. for (c = ic.length; c > f; f++) if (d = ic[f], d.el.id == this.id && (!a || d.anim == a)) {
  1443. if (a) return d.status;
  1444. e.push({anim: d.anim, status: d.status})
  1445. }
  1446. return a ? 0 : e
  1447. }, $b.pause = function (a) {
  1448. for (var c = 0; c < ic.length; c++) ic[c].el.id != this.id || a && ic[c].anim != a || b("raphael.anim.pause." + this.id, this, ic[c].anim) !== !1 && (ic[c].paused = !0);
  1449. return this
  1450. }, $b.resume = function (a) {
  1451. for (var c = 0; c < ic.length; c++) if (ic[c].el.id == this.id && (!a || ic[c].anim == a)) {
  1452. var d = ic[c];
  1453. b("raphael.anim.resume." + this.id, this, d.anim) !== !1 && (delete d.paused, this.status(d.anim, d.status))
  1454. }
  1455. return this
  1456. }, $b.stop = function (a) {
  1457. for (var c = 0; c < ic.length; c++) ic[c].el.id != this.id || a && ic[c].anim != a || b("raphael.anim.stop." + this.id, this, ic[c].anim) !== !1 && ic.splice(c--, 1);
  1458. return this
  1459. }, b.on("raphael.remove", t), b.on("raphael.clear", t), $b.toString = function () {
  1460. return "Raphaël’s object"
  1461. };
  1462. var mc = function (a) {
  1463. if (this.items = [], this.length = 0, this.type = "set", a) for (var b = 0, c = a.length; c > b; b++) !a[b] || a[b].constructor != $b.constructor && a[b].constructor != mc || (this[this.items.length] = this.items[this.items.length] = a[b], this.length++)
  1464. }, nc = mc.prototype;
  1465. nc.push = function () {
  1466. for (var a, b, c = 0, d = arguments.length; d > c; c++) a = arguments[c], !a || a.constructor != $b.constructor && a.constructor != mc || (b = this.items.length, this[b] = this.items[b] = a, this.length++);
  1467. return this
  1468. }, nc.pop = function () {
  1469. return this.length && delete this[this.length--], this.items.pop()
  1470. }, nc.forEach = function (a, b) {
  1471. for (var c = 0, d = this.items.length; d > c; c++) if (a.call(b, this.items[c], c) === !1) return this;
  1472. return this
  1473. };
  1474. for (var oc in $b) $b[z](oc) && (nc[oc] = function (a) {
  1475. return function () {
  1476. var b = arguments;
  1477. return this.forEach(function (c) {
  1478. c[a][D](c, b)
  1479. })
  1480. }
  1481. }(oc));
  1482. return nc.attr = function (a, b) {
  1483. if (a && c.is(a, V) && c.is(a[0], "object")) for (var d = 0, e = a.length; e > d; d++) this.items[d].attr(a[d]); else for (var f = 0, g = this.items.length; g > f; f++) this.items[f].attr(a, b);
  1484. return this
  1485. }, nc.clear = function () {
  1486. for (; this.length;) this.pop()
  1487. }, nc.splice = function (a, b) {
  1488. a = 0 > a ? O(this.length + a, 0) : a, b = O(0, P(this.length - a, b));
  1489. var c, d = [], e = [], f = [];
  1490. for (c = 2; c < arguments.length; c++) f.push(arguments[c]);
  1491. for (c = 0; b > c; c++) e.push(this[a + c]);
  1492. for (; c < this.length - a; c++) d.push(this[a + c]);
  1493. var g = f.length;
  1494. for (c = 0; c < g + d.length; c++) this.items[a + c] = this[a + c] = g > c ? f[c] : d[c - g];
  1495. for (c = this.items.length = this.length -= b - g; this[c];) delete this[c++];
  1496. return new mc(e)
  1497. }, nc.exclude = function (a) {
  1498. for (var b = 0, c = this.length; c > b; b++) if (this[b] == a) return this.splice(b, 1), !0
  1499. }, nc.animate = function (a, b, d, e) {
  1500. (c.is(d, "function") || !d) && (e = d || null);
  1501. var f, g, h = this.items.length, i = h, j = this;
  1502. if (!h) return this;
  1503. e && (g = function () {
  1504. !--h && e.call(j)
  1505. }), d = c.is(d, U) ? d : g;
  1506. var k = c.animation(a, b, d, g);
  1507. for (f = this.items[--i].animate(k); i--;) this.items[i] && !this.items[i].removed && this.items[i].animateWith(f, k, k), this.items[i] && !this.items[i].removed || h--;
  1508. return this
  1509. }, nc.insertAfter = function (a) {
  1510. for (var b = this.items.length; b--;) this.items[b].insertAfter(a);
  1511. return this
  1512. }, nc.getBBox = function () {
  1513. for (var a = [], b = [], c = [], d = [], e = this.items.length; e--;) if (!this.items[e].removed) {
  1514. var f = this.items[e].getBBox();
  1515. a.push(f.x), b.push(f.y), c.push(f.x + f.width), d.push(f.y + f.height)
  1516. }
  1517. return a = P[D](0, a), b = P[D](0, b), c = O[D](0, c), d = O[D](0, d), {
  1518. x: a,
  1519. y: b,
  1520. x2: c,
  1521. y2: d,
  1522. width: c - a,
  1523. height: d - b
  1524. }
  1525. }, nc.clone = function (a) {
  1526. a = this.paper.set();
  1527. for (var b = 0, c = this.items.length; c > b; b++) a.push(this.items[b].clone());
  1528. return a
  1529. }, nc.toString = function () {
  1530. return "Raphaël‘s set"
  1531. }, nc.glow = function (a) {
  1532. var b = this.paper.set();
  1533. return this.forEach(function (c) {
  1534. var d = c.glow(a);
  1535. null != d && d.forEach(function (a) {
  1536. b.push(a)
  1537. })
  1538. }), b
  1539. }, nc.isPointInside = function (a, b) {
  1540. var c = !1;
  1541. return this.forEach(function (d) {
  1542. return d.isPointInside(a, b) ? (c = !0, !1) : void 0
  1543. }), c
  1544. }, c.registerFont = function (a) {
  1545. if (!a.face) return a;
  1546. this.fonts = this.fonts || {};
  1547. var b = {w: a.w, face: {}, glyphs: {}}, c = a.face["font-family"];
  1548. for (var d in a.face) a.face[z](d) && (b.face[d] = a.face[d]);
  1549. if (this.fonts[c] ? this.fonts[c].push(b) : this.fonts[c] = [b], !a.svg) {
  1550. b.face["units-per-em"] = ab(a.face["units-per-em"], 10);
  1551. for (var e in a.glyphs) if (a.glyphs[z](e)) {
  1552. var f = a.glyphs[e];
  1553. if (b.glyphs[e] = {
  1554. w: f.w, k: {}, d: f.d && "M" + f.d.replace(/[mlcxtrv]/g, function (a) {
  1555. return {l: "L", c: "C", x: "z", t: "m", r: "l", v: "c"}[a] || "M"
  1556. }) + "z"
  1557. }, f.k) for (var g in f.k) f[z](g) && (b.glyphs[e].k[g] = f.k[g])
  1558. }
  1559. }
  1560. return a
  1561. }, v.getFont = function (a, b, d, e) {
  1562. if (e = e || "normal", d = d || "normal", b = +b || {
  1563. normal: 400,
  1564. bold: 700,
  1565. lighter: 300,
  1566. bolder: 800
  1567. }[b] || 400, c.fonts) {
  1568. var f = c.fonts[a];
  1569. if (!f) {
  1570. var g = new RegExp("(^|\\s)" + a.replace(/[^\w\d\s+!~.:_-]/g, G) + "(\\s|$)", "i");
  1571. for (var h in c.fonts) if (c.fonts[z](h) && g.test(h)) {
  1572. f = c.fonts[h];
  1573. break
  1574. }
  1575. }
  1576. var i;
  1577. if (f) for (var j = 0, k = f.length; k > j && (i = f[j], i.face["font-weight"] != b || i.face["font-style"] != d && i.face["font-style"] || i.face["font-stretch"] != e); j++) ;
  1578. return i
  1579. }
  1580. }, v.print = function (a, b, d, e, f, g, h, i) {
  1581. g = g || "middle", h = O(P(h || 0, 1), -1), i = O(P(i || 1, 3), 1);
  1582. var j, k = I(d)[J](G), l = 0, m = 0, n = G;
  1583. if (c.is(e, "string") && (e = this.getFont(e)), e) {
  1584. j = (f || 16) / e.face["units-per-em"];
  1585. for (var o = e.face.bbox[J](w), p = +o[0], q = o[3] - o[1], r = 0, s = +o[1] + ("baseline" == g ? q + +e.face.descent : q / 2), t = 0, u = k.length; u > t; t++) {
  1586. if ("\n" == k[t]) l = 0, x = 0, m = 0, r += q * i; else {
  1587. var v = m && e.glyphs[k[t - 1]] || {}, x = e.glyphs[k[t]];
  1588. l += m ? (v.w || e.w) + (v.k && v.k[k[t]] || 0) + e.w * h : 0, m = 1
  1589. }
  1590. x && x.d && (n += c.transformPath(x.d, ["t", l * j, r * j, "s", j, j, p, s, "t", (a - p) / j, (b - s) / j]))
  1591. }
  1592. }
  1593. return this.path(n).attr({fill: "#000", stroke: "none"})
  1594. }, v.add = function (a) {
  1595. if (c.is(a, "array")) for (var b, d = this.set(), e = 0, f = a.length; f > e; e++) b = a[e] || {}, x[z](b.type) && d.push(this[b.type]().attr(b));
  1596. return d
  1597. }, c.format = function (a, b) {
  1598. var d = c.is(b, V) ? [0][E](b) : arguments;
  1599. return a && c.is(a, U) && d.length - 1 && (a = a.replace(y, function (a, b) {
  1600. return null == d[++b] ? G : d[b]
  1601. })), a || G
  1602. }, c.fullfill = function () {
  1603. var a = /\{([^\}]+)\}/g, b = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,
  1604. c = function (a, c, d) {
  1605. var e = d;
  1606. return c.replace(b, function (a, b, c, d, f) {
  1607. b = b || d, e && (b in e && (e = e[b]), "function" == typeof e && f && (e = e()))
  1608. }), e = (null == e || e == d ? a : e) + ""
  1609. };
  1610. return function (b, d) {
  1611. return String(b).replace(a, function (a, b) {
  1612. return c(a, b, d)
  1613. })
  1614. }
  1615. }(), c.ninja = function () {
  1616. return B.was ? A.win.Raphael = B.is : delete Raphael, c
  1617. }, c.st = nc, b.on("raphael.DOMload", function () {
  1618. u = !0
  1619. }), function (a, b, d) {
  1620. function e() {
  1621. /in/.test(a.readyState) ? setTimeout(e, 9) : c.eve("raphael.DOMload")
  1622. }
  1623. null == a.readyState && a.addEventListener && (a.addEventListener(b, d = function () {
  1624. a.removeEventListener(b, d, !1), a.readyState = "complete"
  1625. }, !1), a.readyState = "loading"), e()
  1626. }(document, "DOMContentLoaded"), function () {
  1627. if (c.svg) {
  1628. var a = "hasOwnProperty", b = String, d = parseFloat, e = parseInt, f = Math, g = f.max, h = f.abs,
  1629. i = f.pow, j = /[, ]+/, k = c.eve, l = "", m = " ", n = "http://www.w3.org/1999/xlink", o = {
  1630. block: "M5,0 0,2.5 5,5z",
  1631. classic: "M5,0 0,2.5 5,5 3.5,3 3.5,2z",
  1632. diamond: "M2.5,0 5,2.5 2.5,5 0,2.5z",
  1633. open: "M6,1 1,3.5 6,6",
  1634. oval: "M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"
  1635. }, p = {};
  1636. c.toString = function () {
  1637. return "Your browser supports SVG.\nYou are running Raphaël " + this.version
  1638. };
  1639. var q = function (d, e) {
  1640. if (e) {
  1641. "string" == typeof d && (d = q(d));
  1642. for (var f in e) e[a](f) && ("xlink:" == f.substring(0, 6) ? d.setAttributeNS(n, f.substring(6), b(e[f])) : d.setAttribute(f, b(e[f])))
  1643. } else d = c._g.doc.createElementNS("http://www.w3.org/2000/svg", d), d.style && (d.style.webkitTapHighlightColor = "rgba(0,0,0,0)");
  1644. return d
  1645. }, r = function (a, e) {
  1646. var j = "linear", k = a.id + e, m = .5, n = .5, o = a.node, p = a.paper, r = o.style,
  1647. s = c._g.doc.getElementById(k);
  1648. if (!s) {
  1649. if (e = b(e).replace(c._radial_gradient, function (a, b, c) {
  1650. if (j = "radial", b && c) {
  1651. m = d(b), n = d(c);
  1652. var e = 2 * (n > .5) - 1;
  1653. i(m - .5, 2) + i(n - .5, 2) > .25 && (n = f.sqrt(.25 - i(m - .5, 2)) * e + .5) && .5 != n && (n = n.toFixed(5) - 1e-5 * e)
  1654. }
  1655. return l
  1656. }), e = e.split(/\s*\-\s*/), "linear" == j) {
  1657. var t = e.shift();
  1658. if (t = -d(t), isNaN(t)) return null;
  1659. var u = [0, 0, f.cos(c.rad(t)), f.sin(c.rad(t))], v = 1 / (g(h(u[2]), h(u[3])) || 1);
  1660. u[2] *= v, u[3] *= v, u[2] < 0 && (u[0] = -u[2], u[2] = 0), u[3] < 0 && (u[1] = -u[3], u[3] = 0)
  1661. }
  1662. var w = c._parseDots(e);
  1663. if (!w) return null;
  1664. if (k = k.replace(/[\(\)\s,\xb0#]/g, "_"), a.gradient && k != a.gradient.id && (p.defs.removeChild(a.gradient), delete a.gradient), !a.gradient) {
  1665. s = q(j + "Gradient", {id: k}), a.gradient = s, q(s, "radial" == j ? {fx: m, fy: n} : {
  1666. x1: u[0],
  1667. y1: u[1],
  1668. x2: u[2],
  1669. y2: u[3],
  1670. gradientTransform: a.matrix.invert()
  1671. }), p.defs.appendChild(s);
  1672. for (var x = 0, y = w.length; y > x; x++) s.appendChild(q("stop", {
  1673. offset: w[x].offset ? w[x].offset : x ? "100%" : "0%",
  1674. "stop-color": w[x].color || "#fff"
  1675. }))
  1676. }
  1677. }
  1678. return q(o, {
  1679. fill: "url(" + document.location + "#" + k + ")",
  1680. opacity: 1,
  1681. "fill-opacity": 1
  1682. }), r.fill = l, r.opacity = 1, r.fillOpacity = 1, 1
  1683. }, s = function (a) {
  1684. var b = a.getBBox(1);
  1685. q(a.pattern, {patternTransform: a.matrix.invert() + " translate(" + b.x + "," + b.y + ")"})
  1686. }, t = function (d, e, f) {
  1687. if ("path" == d.type) {
  1688. for (var g, h, i, j, k, m = b(e).toLowerCase().split("-"), n = d.paper, r = f ? "end" : "start", s = d.node, t = d.attrs, u = t["stroke-width"], v = m.length, w = "classic", x = 3, y = 3, z = 5; v--;) switch (m[v]) {
  1689. case"block":
  1690. case"classic":
  1691. case"oval":
  1692. case"diamond":
  1693. case"open":
  1694. case"none":
  1695. w = m[v];
  1696. break;
  1697. case"wide":
  1698. y = 5;
  1699. break;
  1700. case"narrow":
  1701. y = 2;
  1702. break;
  1703. case"long":
  1704. x = 5;
  1705. break;
  1706. case"short":
  1707. x = 2
  1708. }
  1709. if ("open" == w ? (x += 2, y += 2, z += 2, i = 1, j = f ? 4 : 1, k = {
  1710. fill: "none",
  1711. stroke: t.stroke
  1712. }) : (j = i = x / 2, k = {
  1713. fill: t.stroke,
  1714. stroke: "none"
  1715. }), d._.arrows ? f ? (d._.arrows.endPath && p[d._.arrows.endPath]--, d._.arrows.endMarker && p[d._.arrows.endMarker]--) : (d._.arrows.startPath && p[d._.arrows.startPath]--, d._.arrows.startMarker && p[d._.arrows.startMarker]--) : d._.arrows = {}, "none" != w) {
  1716. var A = "raphael-marker-" + w, B = "raphael-marker-" + r + w + x + y + "-obj" + d.id;
  1717. c._g.doc.getElementById(A) ? p[A]++ : (n.defs.appendChild(q(q("path"), {
  1718. "stroke-linecap": "round",
  1719. d: o[w],
  1720. id: A
  1721. })), p[A] = 1);
  1722. var C, D = c._g.doc.getElementById(B);
  1723. D ? (p[B]++, C = D.getElementsByTagName("use")[0]) : (D = q(q("marker"), {
  1724. id: B,
  1725. markerHeight: y,
  1726. markerWidth: x,
  1727. orient: "auto",
  1728. refX: j,
  1729. refY: y / 2
  1730. }), C = q(q("use"), {
  1731. "xlink:href": "#" + A,
  1732. transform: (f ? "rotate(180 " + x / 2 + " " + y / 2 + ") " : l) + "scale(" + x / z + "," + y / z + ")",
  1733. "stroke-width": (1 / ((x / z + y / z) / 2)).toFixed(4)
  1734. }), D.appendChild(C), n.defs.appendChild(D), p[B] = 1), q(C, k);
  1735. var E = i * ("diamond" != w && "oval" != w);
  1736. f ? (g = d._.arrows.startdx * u || 0, h = c.getTotalLength(t.path) - E * u) : (g = E * u, h = c.getTotalLength(t.path) - (d._.arrows.enddx * u || 0)), k = {}, k["marker-" + r] = "url(#" + B + ")", (h || g) && (k.d = c.getSubpath(t.path, g, h)), q(s, k), d._.arrows[r + "Path"] = A, d._.arrows[r + "Marker"] = B, d._.arrows[r + "dx"] = E, d._.arrows[r + "Type"] = w, d._.arrows[r + "String"] = e
  1737. } else f ? (g = d._.arrows.startdx * u || 0, h = c.getTotalLength(t.path) - g) : (g = 0, h = c.getTotalLength(t.path) - (d._.arrows.enddx * u || 0)), d._.arrows[r + "Path"] && q(s, {d: c.getSubpath(t.path, g, h)}), delete d._.arrows[r + "Path"], delete d._.arrows[r + "Marker"], delete d._.arrows[r + "dx"], delete d._.arrows[r + "Type"], delete d._.arrows[r + "String"];
  1738. for (k in p) if (p[a](k) && !p[k]) {
  1739. var F = c._g.doc.getElementById(k);
  1740. F && F.parentNode.removeChild(F)
  1741. }
  1742. }
  1743. }, u = {
  1744. "": [0],
  1745. none: [0],
  1746. "-": [3, 1],
  1747. ".": [1, 1],
  1748. "-.": [3, 1, 1, 1],
  1749. "-..": [3, 1, 1, 1, 1, 1],
  1750. ". ": [1, 3],
  1751. "- ": [4, 3],
  1752. "--": [8, 3],
  1753. "- .": [4, 3, 1, 3],
  1754. "--.": [8, 3, 1, 3],
  1755. "--..": [8, 3, 1, 3, 1, 3]
  1756. }, v = function (a, c, d) {
  1757. if (c = u[b(c).toLowerCase()]) {
  1758. for (var e = a.attrs["stroke-width"] || "1", f = {
  1759. round: e,
  1760. square: e,
  1761. butt: 0
  1762. }[a.attrs["stroke-linecap"] || d["stroke-linecap"]] || 0, g = [], h = c.length; h--;) g[h] = c[h] * e + (h % 2 ? 1 : -1) * f;
  1763. q(a.node, {"stroke-dasharray": g.join(",")})
  1764. }
  1765. }, w = function (d, f) {
  1766. var i = d.node, k = d.attrs, m = i.style.visibility;
  1767. i.style.visibility = "hidden";
  1768. for (var o in f) if (f[a](o)) {
  1769. if (!c._availableAttrs[a](o)) continue;
  1770. var p = f[o];
  1771. switch (k[o] = p, o) {
  1772. case"blur":
  1773. d.blur(p);
  1774. break;
  1775. case"title":
  1776. var u = i.getElementsByTagName("title");
  1777. if (u.length && (u = u[0])) u.firstChild.nodeValue = p; else {
  1778. u = q("title");
  1779. var w = c._g.doc.createTextNode(p);
  1780. u.appendChild(w), i.appendChild(u)
  1781. }
  1782. break;
  1783. case"href":
  1784. case"target":
  1785. var x = i.parentNode;
  1786. if ("a" != x.tagName.toLowerCase()) {
  1787. var z = q("a");
  1788. x.insertBefore(z, i), z.appendChild(i), x = z
  1789. }
  1790. "target" == o ? x.setAttributeNS(n, "show", "blank" == p ? "new" : p) : x.setAttributeNS(n, o, p);
  1791. break;
  1792. case"cursor":
  1793. i.style.cursor = p;
  1794. break;
  1795. case"transform":
  1796. d.transform(p);
  1797. break;
  1798. case"arrow-start":
  1799. t(d, p);
  1800. break;
  1801. case"arrow-end":
  1802. t(d, p, 1);
  1803. break;
  1804. case"clip-rect":
  1805. var A = b(p).split(j);
  1806. if (4 == A.length) {
  1807. d.clip && d.clip.parentNode.parentNode.removeChild(d.clip.parentNode);
  1808. var B = q("clipPath"), C = q("rect");
  1809. B.id = c.createUUID(), q(C, {
  1810. x: A[0],
  1811. y: A[1],
  1812. width: A[2],
  1813. height: A[3]
  1814. }), B.appendChild(C), d.paper.defs.appendChild(B), q(i, {"clip-path": "url(#" + B.id + ")"}), d.clip = C
  1815. }
  1816. if (!p) {
  1817. var D = i.getAttribute("clip-path");
  1818. if (D) {
  1819. var E = c._g.doc.getElementById(D.replace(/(^url\(#|\)$)/g, l));
  1820. E && E.parentNode.removeChild(E), q(i, {"clip-path": l}), delete d.clip
  1821. }
  1822. }
  1823. break;
  1824. case"path":
  1825. "path" == d.type && (q(i, {d: p ? k.path = c._pathToAbsolute(p) : "M0,0"}), d._.dirty = 1, d._.arrows && ("startString" in d._.arrows && t(d, d._.arrows.startString), "endString" in d._.arrows && t(d, d._.arrows.endString, 1)));
  1826. break;
  1827. case"width":
  1828. if (i.setAttribute(o, p), d._.dirty = 1, !k.fx) break;
  1829. o = "x", p = k.x;
  1830. case"x":
  1831. k.fx && (p = -k.x - (k.width || 0));
  1832. case"rx":
  1833. if ("rx" == o && "rect" == d.type) break;
  1834. case"cx":
  1835. i.setAttribute(o, p), d.pattern && s(d), d._.dirty = 1;
  1836. break;
  1837. case"height":
  1838. if (i.setAttribute(o, p), d._.dirty = 1, !k.fy) break;
  1839. o = "y", p = k.y;
  1840. case"y":
  1841. k.fy && (p = -k.y - (k.height || 0));
  1842. case"ry":
  1843. if ("ry" == o && "rect" == d.type) break;
  1844. case"cy":
  1845. i.setAttribute(o, p), d.pattern && s(d), d._.dirty = 1;
  1846. break;
  1847. case"r":
  1848. "rect" == d.type ? q(i, {rx: p, ry: p}) : i.setAttribute(o, p), d._.dirty = 1;
  1849. break;
  1850. case"src":
  1851. "image" == d.type && i.setAttributeNS(n, "href", p);
  1852. break;
  1853. case"stroke-width":
  1854. (1 != d._.sx || 1 != d._.sy) && (p /= g(h(d._.sx), h(d._.sy)) || 1), i.setAttribute(o, p), k["stroke-dasharray"] && v(d, k["stroke-dasharray"], f), d._.arrows && ("startString" in d._.arrows && t(d, d._.arrows.startString), "endString" in d._.arrows && t(d, d._.arrows.endString, 1));
  1855. break;
  1856. case"stroke-dasharray":
  1857. v(d, p, f);
  1858. break;
  1859. case"fill":
  1860. var F = b(p).match(c._ISURL);
  1861. if (F) {
  1862. B = q("pattern");
  1863. var G = q("image");
  1864. B.id = c.createUUID(), q(B, {
  1865. x: 0,
  1866. y: 0,
  1867. patternUnits: "userSpaceOnUse",
  1868. height: 1,
  1869. width: 1
  1870. }), q(G, {x: 0, y: 0, "xlink:href": F[1]}), B.appendChild(G), function (a) {
  1871. c._preload(F[1], function () {
  1872. var b = this.offsetWidth, c = this.offsetHeight;
  1873. q(a, {width: b, height: c}), q(G, {width: b, height: c}), d.paper.safari()
  1874. })
  1875. }(B), d.paper.defs.appendChild(B), q(i, {fill: "url(#" + B.id + ")"}), d.pattern = B, d.pattern && s(d);
  1876. break
  1877. }
  1878. var H = c.getRGB(p);
  1879. if (H.error) {
  1880. if (("circle" == d.type || "ellipse" == d.type || "r" != b(p).charAt()) && r(d, p)) {
  1881. if ("opacity" in k || "fill-opacity" in k) {
  1882. var I = c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g, l));
  1883. if (I) {
  1884. var J = I.getElementsByTagName("stop");
  1885. q(J[J.length - 1], {"stop-opacity": ("opacity" in k ? k.opacity : 1) * ("fill-opacity" in k ? k["fill-opacity"] : 1)})
  1886. }
  1887. }
  1888. k.gradient = p, k.fill = "none";
  1889. break
  1890. }
  1891. } else delete f.gradient, delete k.gradient, !c.is(k.opacity, "undefined") && c.is(f.opacity, "undefined") && q(i, {opacity: k.opacity}), !c.is(k["fill-opacity"], "undefined") && c.is(f["fill-opacity"], "undefined") && q(i, {"fill-opacity": k["fill-opacity"]});
  1892. H[a]("opacity") && q(i, {"fill-opacity": H.opacity > 1 ? H.opacity / 100 : H.opacity});
  1893. case"stroke":
  1894. H = c.getRGB(p), i.setAttribute(o, H.hex), "stroke" == o && H[a]("opacity") && q(i, {"stroke-opacity": H.opacity > 1 ? H.opacity / 100 : H.opacity}), "stroke" == o && d._.arrows && ("startString" in d._.arrows && t(d, d._.arrows.startString), "endString" in d._.arrows && t(d, d._.arrows.endString, 1));
  1895. break;
  1896. case"gradient":
  1897. ("circle" == d.type || "ellipse" == d.type || "r" != b(p).charAt()) && r(d, p);
  1898. break;
  1899. case"opacity":
  1900. k.gradient && !k[a]("stroke-opacity") && q(i, {"stroke-opacity": p > 1 ? p / 100 : p});
  1901. case"fill-opacity":
  1902. if (k.gradient) {
  1903. I = c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g, l)), I && (J = I.getElementsByTagName("stop"), q(J[J.length - 1], {"stop-opacity": p}));
  1904. break
  1905. }
  1906. default:
  1907. "font-size" == o && (p = e(p, 10) + "px");
  1908. var K = o.replace(/(\-.)/g, function (a) {
  1909. return a.substring(1).toUpperCase()
  1910. });
  1911. i.style[K] = p, d._.dirty = 1, i.setAttribute(o, p)
  1912. }
  1913. }
  1914. y(d, f), i.style.visibility = m
  1915. }, x = 1.2, y = function (d, f) {
  1916. if ("text" == d.type && (f[a]("text") || f[a]("font") || f[a]("font-size") || f[a]("x") || f[a]("y"))) {
  1917. var g = d.attrs, h = d.node,
  1918. i = h.firstChild ? e(c._g.doc.defaultView.getComputedStyle(h.firstChild, l).getPropertyValue("font-size"), 10) : 10;
  1919. if (f[a]("text")) {
  1920. for (g.text = f.text; h.firstChild;) h.removeChild(h.firstChild);
  1921. for (var j, k = b(f.text).split("\n"), m = [], n = 0, o = k.length; o > n; n++) j = q("tspan"), n && q(j, {
  1922. dy: i * x,
  1923. x: g.x
  1924. }), j.appendChild(c._g.doc.createTextNode(k[n])), h.appendChild(j), m[n] = j
  1925. } else for (m = h.getElementsByTagName("tspan"), n = 0, o = m.length; o > n; n++) n ? q(m[n], {
  1926. dy: i * x,
  1927. x: g.x
  1928. }) : q(m[0], {dy: 0});
  1929. q(h, {x: g.x, y: g.y}), d._.dirty = 1;
  1930. var p = d._getBBox(), r = g.y - (p.y + p.height / 2);
  1931. r && c.is(r, "finite") && q(m[0], {dy: r})
  1932. }
  1933. }, z = function (a) {
  1934. return a.parentNode && "a" === a.parentNode.tagName.toLowerCase() ? a.parentNode : a
  1935. };
  1936. Element = function (a, b) {
  1937. this[0] = this.node = a, a.raphael = !0, this.id = c._oid++, a.raphaelid = this.id, this.matrix = c.matrix(), this.realPath = null, this.paper = b, this.attrs = this.attrs || {}, this._ = {
  1938. transform: [],
  1939. sx: 1,
  1940. sy: 1,
  1941. deg: 0,
  1942. dx: 0,
  1943. dy: 0,
  1944. dirty: 1
  1945. }, !b.bottom && (b.bottom = this), this.prev = b.top, b.top && (b.top.next = this), b.top = this, this.next = null
  1946. }, $b = c.el, Element.prototype = $b, $b.constructor = Element, c._engine.path = function (a, b) {
  1947. var c = q("path");
  1948. b.canvas && b.canvas.appendChild(c);
  1949. var d = new Element(c, b);
  1950. return d.type = "path", w(d, {fill: "none", stroke: "#000", path: a}), d
  1951. }, $b.rotate = function (a, c, e) {
  1952. if (this.removed) return this;
  1953. if (a = b(a).split(j), a.length - 1 && (c = d(a[1]), e = d(a[2])), a = d(a[0]), null == e && (c = e), null == c || null == e) {
  1954. var f = this.getBBox(1);
  1955. c = f.x + f.width / 2, e = f.y + f.height / 2
  1956. }
  1957. return this.transform(this._.transform.concat([["r", a, c, e]])), this
  1958. }, $b.scale = function (a, c, e, f) {
  1959. if (this.removed) return this;
  1960. if (a = b(a).split(j), a.length - 1 && (c = d(a[1]), e = d(a[2]), f = d(a[3])), a = d(a[0]), null == c && (c = a), null == f && (e = f), null == e || null == f) var g = this.getBBox(1);
  1961. return e = null == e ? g.x + g.width / 2 : e, f = null == f ? g.y + g.height / 2 : f, this.transform(this._.transform.concat([["s", a, c, e, f]])), this
  1962. }, $b.translate = function (a, c) {
  1963. return this.removed ? this : (a = b(a).split(j), a.length - 1 && (c = d(a[1])), a = d(a[0]) || 0, c = +c || 0, this.transform(this._.transform.concat([["t", a, c]])), this)
  1964. }, $b.transform = function (b) {
  1965. var d = this._;
  1966. if (null == b) return d.transform;
  1967. if (c._extractTransform(this, b), this.clip && q(this.clip, {transform: this.matrix.invert()}), this.pattern && s(this), this.node && q(this.node, {transform: this.matrix}), 1 != d.sx || 1 != d.sy) {
  1968. var e = this.attrs[a]("stroke-width") ? this.attrs["stroke-width"] : 1;
  1969. this.attr({"stroke-width": e})
  1970. }
  1971. return this
  1972. }, $b.hide = function () {
  1973. return !this.removed && this.paper.safari(this.node.style.display = "none"), this
  1974. }, $b.show = function () {
  1975. return !this.removed && this.paper.safari(this.node.style.display = ""), this
  1976. }, $b.remove = function () {
  1977. var a = z(this.node);
  1978. if (!this.removed && a.parentNode) {
  1979. var b = this.paper;
  1980. b.__set__ && b.__set__.exclude(this), k.unbind("raphael.*.*." + this.id), this.gradient && b.defs.removeChild(this.gradient), c._tear(this, b), a.parentNode.removeChild(a), this.removeData();
  1981. for (var d in this) this[d] = "function" == typeof this[d] ? c._removedFactory(d) : null;
  1982. this.removed = !0
  1983. }
  1984. }, $b._getBBox = function () {
  1985. if ("none" == this.node.style.display) {
  1986. this.show();
  1987. var a = !0
  1988. }
  1989. var b, c = !1;
  1990. this.paper.canvas.parentElement ? b = this.paper.canvas.parentElement.style : this.paper.canvas.parentNode && (b = this.paper.canvas.parentNode.style), b && "none" == b.display && (c = !0, b.display = "");
  1991. var d = {};
  1992. try {
  1993. d = this.node.getBBox()
  1994. } catch (e) {
  1995. d = {
  1996. x: this.node.clientLeft,
  1997. y: this.node.clientTop,
  1998. width: this.node.clientWidth,
  1999. height: this.node.clientHeight
  2000. }
  2001. } finally {
  2002. d = d || {}, c && (b.display = "none")
  2003. }
  2004. return a && this.hide(), d
  2005. }, $b.attr = function (b, d) {
  2006. if (this.removed) return this;
  2007. if (null == b) {
  2008. var e = {};
  2009. for (var f in this.attrs) this.attrs[a](f) && (e[f] = this.attrs[f]);
  2010. return e.gradient && "none" == e.fill && (e.fill = e.gradient) && delete e.gradient, e.transform = this._.transform, e
  2011. }
  2012. if (null == d && c.is(b, "string")) {
  2013. if ("fill" == b && "none" == this.attrs.fill && this.attrs.gradient) return this.attrs.gradient;
  2014. if ("transform" == b) return this._.transform;
  2015. for (var g = b.split(j), h = {}, i = 0, l = g.length; l > i; i++) b = g[i], h[b] = b in this.attrs ? this.attrs[b] : c.is(this.paper.customAttributes[b], "function") ? this.paper.customAttributes[b].def : c._availableAttrs[b];
  2016. return l - 1 ? h : h[g[0]]
  2017. }
  2018. if (null == d && c.is(b, "array")) {
  2019. for (h = {}, i = 0, l = b.length; l > i; i++) h[b[i]] = this.attr(b[i]);
  2020. return h
  2021. }
  2022. if (null != d) {
  2023. var m = {};
  2024. m[b] = d
  2025. } else null != b && c.is(b, "object") && (m = b);
  2026. for (var n in m) k("raphael.attr." + n + "." + this.id, this, m[n]);
  2027. for (n in this.paper.customAttributes) if (this.paper.customAttributes[a](n) && m[a](n) && c.is(this.paper.customAttributes[n], "function")) {
  2028. var o = this.paper.customAttributes[n].apply(this, [].concat(m[n]));
  2029. this.attrs[n] = m[n];
  2030. for (var p in o) o[a](p) && (m[p] = o[p])
  2031. }
  2032. return w(this, m), this
  2033. }, $b.toFront = function () {
  2034. if (this.removed) return this;
  2035. var a = z(this.node);
  2036. a.parentNode.appendChild(a);
  2037. var b = this.paper;
  2038. return b.top != this && c._tofront(this, b), this
  2039. }, $b.toBack = function () {
  2040. if (this.removed) return this;
  2041. var a = z(this.node), b = a.parentNode;
  2042. b.insertBefore(a, b.firstChild), c._toback(this, this.paper);
  2043. this.paper;
  2044. return this
  2045. }, $b.insertAfter = function (a) {
  2046. if (this.removed || !a) return this;
  2047. var b = z(this.node), d = z(a.node || a[a.length - 1].node);
  2048. return d.nextSibling ? d.parentNode.insertBefore(b, d.nextSibling) : d.parentNode.appendChild(b), c._insertafter(this, a, this.paper), this
  2049. }, $b.insertBefore = function (a) {
  2050. if (this.removed || !a) return this;
  2051. var b = z(this.node), d = z(a.node || a[0].node);
  2052. return d.parentNode.insertBefore(b, d), c._insertbefore(this, a, this.paper), this
  2053. }, $b.blur = function (a) {
  2054. var b = this;
  2055. if (0 !== +a) {
  2056. var d = q("filter"), e = q("feGaussianBlur");
  2057. b.attrs.blur = a, d.id = c.createUUID(), q(e, {stdDeviation: +a || 1.5}), d.appendChild(e), b.paper.defs.appendChild(d), b._blur = d, q(b.node, {filter: "url(#" + d.id + ")"})
  2058. } else b._blur && (b._blur.parentNode.removeChild(b._blur), delete b._blur, delete b.attrs.blur), b.node.removeAttribute("filter");
  2059. return b
  2060. }, c._engine.circle = function (a, b, c, d) {
  2061. var e = q("circle");
  2062. a.canvas && a.canvas.appendChild(e);
  2063. var f = new Element(e, a);
  2064. return f.attrs = {cx: b, cy: c, r: d, fill: "none", stroke: "#000"}, f.type = "circle", q(e, f.attrs), f
  2065. }, c._engine.rect = function (a, b, c, d, e, f) {
  2066. var g = q("rect");
  2067. a.canvas && a.canvas.appendChild(g);
  2068. var h = new Element(g, a);
  2069. return h.attrs = {
  2070. x: b,
  2071. y: c,
  2072. width: d,
  2073. height: e,
  2074. rx: f || 0,
  2075. ry: f || 0,
  2076. fill: "none",
  2077. stroke: "#000"
  2078. }, h.type = "rect", q(g, h.attrs), h
  2079. }, c._engine.ellipse = function (a, b, c, d, e) {
  2080. var f = q("ellipse");
  2081. a.canvas && a.canvas.appendChild(f);
  2082. var g = new Element(f, a);
  2083. return g.attrs = {
  2084. cx: b,
  2085. cy: c,
  2086. rx: d,
  2087. ry: e,
  2088. fill: "none",
  2089. stroke: "#000"
  2090. }, g.type = "ellipse", q(f, g.attrs), g
  2091. }, c._engine.image = function (a, b, c, d, e, f) {
  2092. var g = q("image");
  2093. q(g, {
  2094. x: c,
  2095. y: d,
  2096. width: e,
  2097. height: f,
  2098. preserveAspectRatio: "none"
  2099. }), g.setAttributeNS(n, "href", b), a.canvas && a.canvas.appendChild(g);
  2100. var h = new Element(g, a);
  2101. return h.attrs = {x: c, y: d, width: e, height: f, src: b}, h.type = "image", h
  2102. }, c._engine.text = function (a, b, d, e) {
  2103. var f = q("text");
  2104. a.canvas && a.canvas.appendChild(f);
  2105. var g = new Element(f, a);
  2106. return g.attrs = {
  2107. x: b,
  2108. y: d,
  2109. "text-anchor": "middle",
  2110. text: e,
  2111. "font-family": c._availableAttrs["font-family"],
  2112. "font-size": c._availableAttrs["font-size"],
  2113. stroke: "none",
  2114. fill: "#000"
  2115. }, g.type = "text", w(g, g.attrs), g
  2116. }, c._engine.setSize = function (a, b) {
  2117. return this.width = a || this.width, this.height = b || this.height, this.canvas.setAttribute("width", this.width), this.canvas.setAttribute("height", this.height), this._viewBox && this.setViewBox.apply(this, this._viewBox), this
  2118. }, c._engine.create = function () {
  2119. var a = c._getContainer.apply(0, arguments), b = a && a.container, d = a.x, e = a.y, f = a.width,
  2120. g = a.height;
  2121. if (!b) throw new Error("SVG container not found.");
  2122. var h, i = q("svg"), j = "overflow:hidden;";
  2123. return d = d || 0, e = e || 0, f = f || 512, g = g || 342, q(i, {
  2124. height: g,
  2125. version: 1.1,
  2126. width: f,
  2127. xmlns: "http://www.w3.org/2000/svg",
  2128. "xmlns:xlink": "http://www.w3.org/1999/xlink"
  2129. }), 1 == b ? (i.style.cssText = j + "position:absolute;left:" + d + "px;top:" + e + "px", c._g.doc.body.appendChild(i), h = 1) : (i.style.cssText = j + "position:relative", b.firstChild ? b.insertBefore(i, b.firstChild) : b.appendChild(i)), b = new c._Paper, b.width = f, b.height = g, b.canvas = i, b.clear(), b._left = b._top = 0, h && (b.renderfix = function () {
  2130. }), b.renderfix(), b
  2131. }, c._engine.setViewBox = function (a, b, c, d, e) {
  2132. k("raphael.setViewBox", this, this._viewBox, [a, b, c, d, e]);
  2133. var f, h, i = this.getSize(), j = g(c / i.width, d / i.height), l = this.top,
  2134. n = e ? "xMidYMid meet" : "xMinYMin";
  2135. for (null == a ? (this._vbSize && (j = 1), delete this._vbSize, f = "0 0 " + this.width + m + this.height) : (this._vbSize = j, f = a + m + b + m + c + m + d), q(this.canvas, {
  2136. viewBox: f,
  2137. preserveAspectRatio: n
  2138. }); j && l;) h = "stroke-width" in l.attrs ? l.attrs["stroke-width"] : 1, l.attr({"stroke-width": h}), l._.dirty = 1, l._.dirtyT = 1, l = l.prev;
  2139. return this._viewBox = [a, b, c, d, !!e], this
  2140. }, c.prototype.renderfix = function () {
  2141. var a, b = this.canvas, c = b.style;
  2142. try {
  2143. a = b.getScreenCTM() || b.createSVGMatrix()
  2144. } catch (d) {
  2145. a = b.createSVGMatrix()
  2146. }
  2147. var e = -a.e % 1, f = -a.f % 1;
  2148. (e || f) && (e && (this._left = (this._left + e) % 1, c.left = this._left + "px"), f && (this._top = (this._top + f) % 1, c.top = this._top + "px"))
  2149. }, c.prototype.clear = function () {
  2150. c.eve("raphael.clear", this);
  2151. for (var a = this.canvas; a.firstChild;) a.removeChild(a.firstChild);
  2152. this.bottom = this.top = null, (this.desc = q("desc")).appendChild(c._g.doc.createTextNode("Created with Raphaël " + c.version)), a.appendChild(this.desc), a.appendChild(this.defs = q("defs"))
  2153. }, c.prototype.remove = function () {
  2154. k("raphael.remove", this), this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
  2155. for (var a in this) this[a] = "function" == typeof this[a] ? c._removedFactory(a) : null
  2156. };
  2157. var A = c.st;
  2158. for (var B in $b) $b[a](B) && !A[a](B) && (A[B] = function (a) {
  2159. return function () {
  2160. var b = arguments;
  2161. return this.forEach(function (c) {
  2162. c[a].apply(c, b)
  2163. })
  2164. }
  2165. }(B))
  2166. }
  2167. }(), function () {
  2168. if (c.vml) {
  2169. var a = "hasOwnProperty", b = String, d = parseFloat, e = Math, f = e.round, g = e.max, h = e.min,
  2170. i = e.abs, j = "fill", k = /[, ]+/, l = c.eve, m = " progid:DXImageTransform.Microsoft", n = " ",
  2171. o = "", p = {M: "m", L: "l", C: "c", Z: "x", m: "t", l: "r", c: "v", z: "x"},
  2172. q = /([clmz]),?([^clmz]*)/gi, r = / progid:\S+Blur\([^\)]+\)/g, s = /-?[^,\s-]+/g,
  2173. t = "position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)", u = 21600,
  2174. v = {path: 1, rect: 1, image: 1}, w = {circle: 1, ellipse: 1}, x = function (a) {
  2175. var d = /[ahqstv]/gi, e = c._pathToAbsolute;
  2176. if (b(a).match(d) && (e = c._path2curve), d = /[clmz]/g, e == c._pathToAbsolute && !b(a).match(d)) {
  2177. var g = b(a).replace(q, function (a, b, c) {
  2178. var d = [], e = "m" == b.toLowerCase(), g = p[b];
  2179. return c.replace(s, function (a) {
  2180. e && 2 == d.length && (g += d + p["m" == b ? "l" : "L"], d = []), d.push(f(a * u))
  2181. }), g + d
  2182. });
  2183. return g
  2184. }
  2185. var h, i, j = e(a);
  2186. g = [];
  2187. for (var k = 0, l = j.length; l > k; k++) {
  2188. h = j[k], i = j[k][0].toLowerCase(), "z" == i && (i = "x");
  2189. for (var m = 1, r = h.length; r > m; m++) i += f(h[m] * u) + (m != r - 1 ? "," : o);
  2190. g.push(i)
  2191. }
  2192. return g.join(n)
  2193. }, y = function (a, b, d) {
  2194. var e = c.matrix();
  2195. return e.rotate(-a, .5, .5), {dx: e.x(b, d), dy: e.y(b, d)}
  2196. }, z = function (a, b, c, d, e, f) {
  2197. var g = a._, h = a.matrix, k = g.fillpos, l = a.node, m = l.style, o = 1, p = "", q = u / b, r = u / c;
  2198. if (m.visibility = "hidden", b && c) {
  2199. if (l.coordsize = i(q) + n + i(r), m.rotation = f * (0 > b * c ? -1 : 1), f) {
  2200. var s = y(f, d, e);
  2201. d = s.dx, e = s.dy
  2202. }
  2203. if (0 > b && (p += "x"), 0 > c && (p += " y") && (o = -1), m.flip = p, l.coordorigin = d * -q + n + e * -r, k || g.fillsize) {
  2204. var t = l.getElementsByTagName(j);
  2205. t = t && t[0], l.removeChild(t), k && (s = y(f, h.x(k[0], k[1]), h.y(k[0], k[1])), t.position = s.dx * o + n + s.dy * o), g.fillsize && (t.size = g.fillsize[0] * i(b) + n + g.fillsize[1] * i(c)), l.appendChild(t)
  2206. }
  2207. m.visibility = "visible"
  2208. }
  2209. };
  2210. c.toString = function () {
  2211. return "Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël " + this.version
  2212. };
  2213. var A = function (a, c, d) {
  2214. for (var e = b(c).toLowerCase().split("-"), f = d ? "end" : "start", g = e.length, h = "classic", i = "medium", j = "medium"; g--;) switch (e[g]) {
  2215. case"block":
  2216. case"classic":
  2217. case"oval":
  2218. case"diamond":
  2219. case"open":
  2220. case"none":
  2221. h = e[g];
  2222. break;
  2223. case"wide":
  2224. case"narrow":
  2225. j = e[g];
  2226. break;
  2227. case"long":
  2228. case"short":
  2229. i = e[g]
  2230. }
  2231. var k = a.node.getElementsByTagName("stroke")[0];
  2232. k[f + "arrow"] = h, k[f + "arrowlength"] = i, k[f + "arrowwidth"] = j
  2233. }, B = function (e, i) {
  2234. e.attrs = e.attrs || {};
  2235. var l = e.node, m = e.attrs, p = l.style,
  2236. q = v[e.type] && (i.x != m.x || i.y != m.y || i.width != m.width || i.height != m.height || i.cx != m.cx || i.cy != m.cy || i.rx != m.rx || i.ry != m.ry || i.r != m.r),
  2237. r = w[e.type] && (m.cx != i.cx || m.cy != i.cy || m.r != i.r || m.rx != i.rx || m.ry != i.ry),
  2238. s = e;
  2239. for (var t in i) i[a](t) && (m[t] = i[t]);
  2240. if (q && (m.path = c._getPath[e.type](e), e._.dirty = 1), i.href && (l.href = i.href), i.title && (l.title = i.title), i.target && (l.target = i.target), i.cursor && (p.cursor = i.cursor), "blur" in i && e.blur(i.blur), (i.path && "path" == e.type || q) && (l.path = x(~b(m.path).toLowerCase().indexOf("r") ? c._pathToAbsolute(m.path) : m.path), e._.dirty = 1, "image" == e.type && (e._.fillpos = [m.x, m.y], e._.fillsize = [m.width, m.height], z(e, 1, 1, 0, 0, 0))), "transform" in i && e.transform(i.transform), r) {
  2241. var y = +m.cx, B = +m.cy, D = +m.rx || +m.r || 0, E = +m.ry || +m.r || 0;
  2242. l.path = c.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x", f((y - D) * u), f((B - E) * u), f((y + D) * u), f((B + E) * u), f(y * u)), e._.dirty = 1
  2243. }
  2244. if ("clip-rect" in i) {
  2245. var G = b(i["clip-rect"]).split(k);
  2246. if (4 == G.length) {
  2247. G[2] = +G[2] + +G[0], G[3] = +G[3] + +G[1];
  2248. var H = l.clipRect || c._g.doc.createElement("div"), I = H.style;
  2249. I.clip = c.format("rect({1}px {2}px {3}px {0}px)", G), l.clipRect || (I.position = "absolute", I.top = 0, I.left = 0, I.width = e.paper.width + "px", I.height = e.paper.height + "px", l.parentNode.insertBefore(H, l), H.appendChild(l), l.clipRect = H)
  2250. }
  2251. i["clip-rect"] || l.clipRect && (l.clipRect.style.clip = "auto")
  2252. }
  2253. if (e.textpath) {
  2254. var J = e.textpath.style;
  2255. i.font && (J.font = i.font), i["font-family"] && (J.fontFamily = '"' + i["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, o) + '"'), i["font-size"] && (J.fontSize = i["font-size"]), i["font-weight"] && (J.fontWeight = i["font-weight"]), i["font-style"] && (J.fontStyle = i["font-style"])
  2256. }
  2257. if ("arrow-start" in i && A(s, i["arrow-start"]), "arrow-end" in i && A(s, i["arrow-end"], 1), null != i.opacity || null != i["stroke-width"] || null != i.fill || null != i.src || null != i.stroke || null != i["stroke-width"] || null != i["stroke-opacity"] || null != i["fill-opacity"] || null != i["stroke-dasharray"] || null != i["stroke-miterlimit"] || null != i["stroke-linejoin"] || null != i["stroke-linecap"]) {
  2258. var K = l.getElementsByTagName(j), L = !1;
  2259. if (K = K && K[0], !K && (L = K = F(j)), "image" == e.type && i.src && (K.src = i.src), i.fill && (K.on = !0), (null == K.on || "none" == i.fill || null === i.fill) && (K.on = !1), K.on && i.fill) {
  2260. var M = b(i.fill).match(c._ISURL);
  2261. if (M) {
  2262. K.parentNode == l && l.removeChild(K), K.rotate = !0, K.src = M[1], K.type = "tile";
  2263. var N = e.getBBox(1);
  2264. K.position = N.x + n + N.y, e._.fillpos = [N.x, N.y], c._preload(M[1], function () {
  2265. e._.fillsize = [this.offsetWidth, this.offsetHeight]
  2266. })
  2267. } else K.color = c.getRGB(i.fill).hex, K.src = o, K.type = "solid", c.getRGB(i.fill).error && (s.type in {
  2268. circle: 1,
  2269. ellipse: 1
  2270. } || "r" != b(i.fill).charAt()) && C(s, i.fill, K) && (m.fill = "none", m.gradient = i.fill, K.rotate = !1)
  2271. }
  2272. if ("fill-opacity" in i || "opacity" in i) {
  2273. var O = ((+m["fill-opacity"] + 1 || 2) - 1) * ((+m.opacity + 1 || 2) - 1) * ((+c.getRGB(i.fill).o + 1 || 2) - 1);
  2274. O = h(g(O, 0), 1), K.opacity = O, K.src && (K.color = "none")
  2275. }
  2276. l.appendChild(K);
  2277. var P = l.getElementsByTagName("stroke") && l.getElementsByTagName("stroke")[0], Q = !1;
  2278. !P && (Q = P = F("stroke")), (i.stroke && "none" != i.stroke || i["stroke-width"] || null != i["stroke-opacity"] || i["stroke-dasharray"] || i["stroke-miterlimit"] || i["stroke-linejoin"] || i["stroke-linecap"]) && (P.on = !0), ("none" == i.stroke || null === i.stroke || null == P.on || 0 == i.stroke || 0 == i["stroke-width"]) && (P.on = !1);
  2279. var R = c.getRGB(i.stroke);
  2280. P.on && i.stroke && (P.color = R.hex), O = ((+m["stroke-opacity"] + 1 || 2) - 1) * ((+m.opacity + 1 || 2) - 1) * ((+R.o + 1 || 2) - 1);
  2281. var S = .75 * (d(i["stroke-width"]) || 1);
  2282. if (O = h(g(O, 0), 1), null == i["stroke-width"] && (S = m["stroke-width"]), i["stroke-width"] && (P.weight = S), S && 1 > S && (O *= S) && (P.weight = 1), P.opacity = O, i["stroke-linejoin"] && (P.joinstyle = i["stroke-linejoin"] || "miter"), P.miterlimit = i["stroke-miterlimit"] || 8, i["stroke-linecap"] && (P.endcap = "butt" == i["stroke-linecap"] ? "flat" : "square" == i["stroke-linecap"] ? "square" : "round"), "stroke-dasharray" in i) {
  2283. var T = {
  2284. "-": "shortdash",
  2285. ".": "shortdot",
  2286. "-.": "shortdashdot",
  2287. "-..": "shortdashdotdot",
  2288. ". ": "dot",
  2289. "- ": "dash",
  2290. "--": "longdash",
  2291. "- .": "dashdot",
  2292. "--.": "longdashdot",
  2293. "--..": "longdashdotdot"
  2294. };
  2295. P.dashstyle = T[a](i["stroke-dasharray"]) ? T[i["stroke-dasharray"]] : o
  2296. }
  2297. Q && l.appendChild(P)
  2298. }
  2299. if ("text" == s.type) {
  2300. s.paper.canvas.style.display = o;
  2301. var U = s.paper.span, V = 100, W = m.font && m.font.match(/\d+(?:\.\d*)?(?=px)/);
  2302. p = U.style, m.font && (p.font = m.font), m["font-family"] && (p.fontFamily = m["font-family"]), m["font-weight"] && (p.fontWeight = m["font-weight"]), m["font-style"] && (p.fontStyle = m["font-style"]), W = d(m["font-size"] || W && W[0]) || 10, p.fontSize = W * V + "px", s.textpath.string && (U.innerHTML = b(s.textpath.string).replace(/</g, "&#60;").replace(/&/g, "&#38;").replace(/\n/g, "<br>"));
  2303. var X = U.getBoundingClientRect();
  2304. s.W = m.w = (X.right - X.left) / V, s.H = m.h = (X.bottom - X.top) / V, s.X = m.x, s.Y = m.y + s.H / 2, ("x" in i || "y" in i) && (s.path.v = c.format("m{0},{1}l{2},{1}", f(m.x * u), f(m.y * u), f(m.x * u) + 1));
  2305. for (var Y = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"], Z = 0, $ = Y.length; $ > Z; Z++) if (Y[Z] in i) {
  2306. s._.dirty = 1;
  2307. break
  2308. }
  2309. switch (m["text-anchor"]) {
  2310. case"start":
  2311. s.textpath.style["v-text-align"] = "left", s.bbx = s.W / 2;
  2312. break;
  2313. case"end":
  2314. s.textpath.style["v-text-align"] = "right", s.bbx = -s.W / 2;
  2315. break;
  2316. default:
  2317. s.textpath.style["v-text-align"] = "center", s.bbx = 0
  2318. }
  2319. s.textpath.style["v-text-kern"] = !0
  2320. }
  2321. }, C = function (a, f, g) {
  2322. a.attrs = a.attrs || {};
  2323. var h = (a.attrs, Math.pow), i = "linear", j = ".5 .5";
  2324. if (a.attrs.gradient = f, f = b(f).replace(c._radial_gradient, function (a, b, c) {
  2325. return i = "radial", b && c && (b = d(b), c = d(c), h(b - .5, 2) + h(c - .5, 2) > .25 && (c = e.sqrt(.25 - h(b - .5, 2)) * (2 * (c > .5) - 1) + .5), j = b + n + c), o
  2326. }), f = f.split(/\s*\-\s*/), "linear" == i) {
  2327. var k = f.shift();
  2328. if (k = -d(k), isNaN(k)) return null
  2329. }
  2330. var l = c._parseDots(f);
  2331. if (!l) return null;
  2332. if (a = a.shape || a.node, l.length) {
  2333. a.removeChild(g), g.on = !0, g.method = "none", g.color = l[0].color, g.color2 = l[l.length - 1].color;
  2334. for (var m = [], p = 0, q = l.length; q > p; p++) l[p].offset && m.push(l[p].offset + n + l[p].color);
  2335. g.colors = m.length ? m.join() : "0% " + g.color, "radial" == i ? (g.type = "gradientTitle", g.focus = "100%", g.focussize = "0 0", g.focusposition = j, g.angle = 0) : (g.type = "gradient", g.angle = (270 - k) % 360), a.appendChild(g)
  2336. }
  2337. return 1
  2338. }, D = function (a, b) {
  2339. this[0] = this.node = a, a.raphael = !0, this.id = c._oid++, a.raphaelid = this.id, this.X = 0, this.Y = 0, this.attrs = {}, this.paper = b, this.matrix = c.matrix(), this._ = {
  2340. transform: [],
  2341. sx: 1,
  2342. sy: 1,
  2343. dx: 0,
  2344. dy: 0,
  2345. deg: 0,
  2346. dirty: 1,
  2347. dirtyT: 1
  2348. }, !b.bottom && (b.bottom = this), this.prev = b.top, b.top && (b.top.next = this), b.top = this, this.next = null
  2349. }, E = c.el;
  2350. D.prototype = E, E.constructor = D, E.transform = function (a) {
  2351. if (null == a) return this._.transform;
  2352. var d, e = this.paper._viewBoxShift, f = e ? "s" + [e.scale, e.scale] + "-1-1t" + [e.dx, e.dy] : o;
  2353. e && (d = a = b(a).replace(/\.{3}|\u2026/g, this._.transform || o)), c._extractTransform(this, f + a);
  2354. var g, h = this.matrix.clone(), i = this.skew, j = this.node, k = ~b(this.attrs.fill).indexOf("-"),
  2355. l = !b(this.attrs.fill).indexOf("url(");
  2356. if (h.translate(1, 1), l || k || "image" == this.type) if (i.matrix = "1 0 0 1", i.offset = "0 0", g = h.split(), k && g.noRotation || !g.isSimple) {
  2357. j.style.filter = h.toFilter();
  2358. var m = this.getBBox(), p = this.getBBox(1), q = m.x - p.x, r = m.y - p.y;
  2359. j.coordorigin = q * -u + n + r * -u, z(this, 1, 1, q, r, 0)
  2360. } else j.style.filter = o, z(this, g.scalex, g.scaley, g.dx, g.dy, g.rotate); else j.style.filter = o, i.matrix = b(h), i.offset = h.offset();
  2361. return null !== d && (this._.transform = d, c._extractTransform(this, d)), this
  2362. }, E.rotate = function (a, c, e) {
  2363. if (this.removed) return this;
  2364. if (null != a) {
  2365. if (a = b(a).split(k), a.length - 1 && (c = d(a[1]), e = d(a[2])), a = d(a[0]), null == e && (c = e), null == c || null == e) {
  2366. var f = this.getBBox(1);
  2367. c = f.x + f.width / 2, e = f.y + f.height / 2
  2368. }
  2369. return this._.dirtyT = 1, this.transform(this._.transform.concat([["r", a, c, e]])), this
  2370. }
  2371. }, E.translate = function (a, c) {
  2372. return this.removed ? this : (a = b(a).split(k), a.length - 1 && (c = d(a[1])), a = d(a[0]) || 0, c = +c || 0, this._.bbox && (this._.bbox.x += a, this._.bbox.y += c), this.transform(this._.transform.concat([["t", a, c]])), this)
  2373. }, E.scale = function (a, c, e, f) {
  2374. if (this.removed) return this;
  2375. if (a = b(a).split(k), a.length - 1 && (c = d(a[1]), e = d(a[2]), f = d(a[3]), isNaN(e) && (e = null), isNaN(f) && (f = null)), a = d(a[0]), null == c && (c = a), null == f && (e = f), null == e || null == f) var g = this.getBBox(1);
  2376. return e = null == e ? g.x + g.width / 2 : e, f = null == f ? g.y + g.height / 2 : f, this.transform(this._.transform.concat([["s", a, c, e, f]])), this._.dirtyT = 1, this
  2377. }, E.hide = function () {
  2378. return !this.removed && (this.node.style.display = "none"), this
  2379. }, E.show = function () {
  2380. return !this.removed && (this.node.style.display = o), this
  2381. }, E.auxGetBBox = c.el.getBBox, E.getBBox = function () {
  2382. var a = this.auxGetBBox();
  2383. if (this.paper && this.paper._viewBoxShift) {
  2384. var b = {}, c = 1 / this.paper._viewBoxShift.scale;
  2385. return b.x = a.x - this.paper._viewBoxShift.dx, b.x *= c, b.y = a.y - this.paper._viewBoxShift.dy, b.y *= c, b.width = a.width * c, b.height = a.height * c, b.x2 = b.x + b.width, b.y2 = b.y + b.height, b
  2386. }
  2387. return a
  2388. }, E._getBBox = function () {
  2389. return this.removed ? {} : {
  2390. x: this.X + (this.bbx || 0) - this.W / 2,
  2391. y: this.Y - this.H,
  2392. width: this.W,
  2393. height: this.H
  2394. }
  2395. }, E.remove = function () {
  2396. if (!this.removed && this.node.parentNode) {
  2397. this.paper.__set__ && this.paper.__set__.exclude(this), c.eve.unbind("raphael.*.*." + this.id), c._tear(this, this.paper), this.node.parentNode.removeChild(this.node), this.shape && this.shape.parentNode.removeChild(this.shape);
  2398. for (var a in this) this[a] = "function" == typeof this[a] ? c._removedFactory(a) : null;
  2399. this.removed = !0
  2400. }
  2401. }, E.attr = function (b, d) {
  2402. if (this.removed) return this;
  2403. if (null == b) {
  2404. var e = {};
  2405. for (var f in this.attrs) this.attrs[a](f) && (e[f] = this.attrs[f]);
  2406. return e.gradient && "none" == e.fill && (e.fill = e.gradient) && delete e.gradient, e.transform = this._.transform, e
  2407. }
  2408. if (null == d && c.is(b, "string")) {
  2409. if (b == j && "none" == this.attrs.fill && this.attrs.gradient) return this.attrs.gradient;
  2410. for (var g = b.split(k), h = {}, i = 0, m = g.length; m > i; i++) b = g[i], h[b] = b in this.attrs ? this.attrs[b] : c.is(this.paper.customAttributes[b], "function") ? this.paper.customAttributes[b].def : c._availableAttrs[b];
  2411. return m - 1 ? h : h[g[0]]
  2412. }
  2413. if (this.attrs && null == d && c.is(b, "array")) {
  2414. for (h = {}, i = 0, m = b.length; m > i; i++) h[b[i]] = this.attr(b[i]);
  2415. return h
  2416. }
  2417. var n;
  2418. null != d && (n = {}, n[b] = d), null == d && c.is(b, "object") && (n = b);
  2419. for (var o in n) l("raphael.attr." + o + "." + this.id, this, n[o]);
  2420. if (n) {
  2421. for (o in this.paper.customAttributes) if (this.paper.customAttributes[a](o) && n[a](o) && c.is(this.paper.customAttributes[o], "function")) {
  2422. var p = this.paper.customAttributes[o].apply(this, [].concat(n[o]));
  2423. this.attrs[o] = n[o];
  2424. for (var q in p) p[a](q) && (n[q] = p[q])
  2425. }
  2426. n.text && "text" == this.type && (this.textpath.string = n.text), B(this, n)
  2427. }
  2428. return this
  2429. }, E.toFront = function () {
  2430. return !this.removed && this.node.parentNode.appendChild(this.node), this.paper && this.paper.top != this && c._tofront(this, this.paper), this
  2431. }, E.toBack = function () {
  2432. return this.removed ? this : (this.node.parentNode.firstChild != this.node && (this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild), c._toback(this, this.paper)), this)
  2433. }, E.insertAfter = function (a) {
  2434. return this.removed ? this : (a.constructor == c.st.constructor && (a = a[a.length - 1]), a.node.nextSibling ? a.node.parentNode.insertBefore(this.node, a.node.nextSibling) : a.node.parentNode.appendChild(this.node), c._insertafter(this, a, this.paper), this)
  2435. }, E.insertBefore = function (a) {
  2436. return this.removed ? this : (a.constructor == c.st.constructor && (a = a[0]), a.node.parentNode.insertBefore(this.node, a.node), c._insertbefore(this, a, this.paper), this)
  2437. }, E.blur = function (a) {
  2438. var b = this.node.runtimeStyle, d = b.filter;
  2439. return d = d.replace(r, o), 0 !== +a ? (this.attrs.blur = a, b.filter = d + n + m + ".Blur(pixelradius=" + (+a || 1.5) + ")", b.margin = c.format("-{0}px 0 0 -{0}px", f(+a || 1.5))) : (b.filter = d, b.margin = 0, delete this.attrs.blur), this
  2440. }, c._engine.path = function (a, b) {
  2441. var c = F("shape");
  2442. c.style.cssText = t, c.coordsize = u + n + u, c.coordorigin = b.coordorigin;
  2443. var d = new D(c, b), e = {fill: "none", stroke: "#000"};
  2444. a && (e.path = a), d.type = "path", d.path = [], d.Path = o, B(d, e), b.canvas.appendChild(c);
  2445. var f = F("skew");
  2446. return f.on = !0, c.appendChild(f), d.skew = f, d.transform(o), d
  2447. }, c._engine.rect = function (a, b, d, e, f, g) {
  2448. var h = c._rectPath(b, d, e, f, g), i = a.path(h), j = i.attrs;
  2449. return i.X = j.x = b, i.Y = j.y = d, i.W = j.width = e, i.H = j.height = f, j.r = g, j.path = h, i.type = "rect", i
  2450. }, c._engine.ellipse = function (a, b, c, d, e) {
  2451. {
  2452. var f = a.path();
  2453. f.attrs
  2454. }
  2455. return f.X = b - d, f.Y = c - e, f.W = 2 * d, f.H = 2 * e, f.type = "ellipse", B(f, {
  2456. cx: b,
  2457. cy: c,
  2458. rx: d,
  2459. ry: e
  2460. }), f
  2461. }, c._engine.circle = function (a, b, c, d) {
  2462. {
  2463. var e = a.path();
  2464. e.attrs
  2465. }
  2466. return e.X = b - d, e.Y = c - d, e.W = e.H = 2 * d, e.type = "circle", B(e, {cx: b, cy: c, r: d}), e
  2467. }, c._engine.image = function (a, b, d, e, f, g) {
  2468. var h = c._rectPath(d, e, f, g), i = a.path(h).attr({stroke: "none"}), k = i.attrs, l = i.node,
  2469. m = l.getElementsByTagName(j)[0];
  2470. return k.src = b, i.X = k.x = d, i.Y = k.y = e, i.W = k.width = f, i.H = k.height = g, k.path = h, i.type = "image", m.parentNode == l && l.removeChild(m), m.rotate = !0, m.src = b, m.type = "tile", i._.fillpos = [d, e], i._.fillsize = [f, g], l.appendChild(m), z(i, 1, 1, 0, 0, 0), i
  2471. }, c._engine.text = function (a, d, e, g) {
  2472. var h = F("shape"), i = F("path"), j = F("textpath");
  2473. d = d || 0, e = e || 0, g = g || "", i.v = c.format("m{0},{1}l{2},{1}", f(d * u), f(e * u), f(d * u) + 1), i.textpathok = !0, j.string = b(g), j.on = !0, h.style.cssText = t, h.coordsize = u + n + u, h.coordorigin = "0 0";
  2474. var k = new D(h, a), l = {fill: "#000", stroke: "none", font: c._availableAttrs.font, text: g};
  2475. k.shape = h, k.path = i, k.textpath = j, k.type = "text", k.attrs.text = b(g), k.attrs.x = d, k.attrs.y = e, k.attrs.w = 1, k.attrs.h = 1, B(k, l), h.appendChild(j), h.appendChild(i), a.canvas.appendChild(h);
  2476. var m = F("skew");
  2477. return m.on = !0, h.appendChild(m), k.skew = m, k.transform(o), k
  2478. }, c._engine.setSize = function (a, b) {
  2479. var d = this.canvas.style;
  2480. return this.width = a, this.height = b, a == +a && (a += "px"), b == +b && (b += "px"), d.width = a, d.height = b, d.clip = "rect(0 " + a + " " + b + " 0)", this._viewBox && c._engine.setViewBox.apply(this, this._viewBox), this
  2481. }, c._engine.setViewBox = function (a, b, d, e, f) {
  2482. c.eve("raphael.setViewBox", this, this._viewBox, [a, b, d, e, f]);
  2483. var g, h, i = this.getSize(), j = i.width, k = i.height;
  2484. return f && (g = k / e, h = j / d, j > d * g && (a -= (j - d * g) / 2 / g), k > e * h && (b -= (k - e * h) / 2 / h)), this._viewBox = [a, b, d, e, !!f], this._viewBoxShift = {
  2485. dx: -a,
  2486. dy: -b,
  2487. scale: size
  2488. }, this.forEach(function (a) {
  2489. a.transform("...")
  2490. }), this
  2491. };
  2492. var F;
  2493. c._engine.initWin = function (a) {
  2494. var b = a.document;
  2495. b.styleSheets.length < 31 ? b.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)") : b.styleSheets[0].addRule(".rvml", "behavior:url(#default#VML)");
  2496. try {
  2497. !b.namespaces.rvml && b.namespaces.add("rvml", "urn:schemas-microsoft-com:vml"), F = function (a) {
  2498. return b.createElement("<rvml:" + a + ' class="rvml">')
  2499. }
  2500. } catch (c) {
  2501. F = function (a) {
  2502. return b.createElement("<" + a + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')
  2503. }
  2504. }
  2505. }, c._engine.initWin(c._g.win), c._engine.create = function () {
  2506. var a = c._getContainer.apply(0, arguments), b = a.container, d = a.height, e = a.width, f = a.x,
  2507. g = a.y;
  2508. if (!b) throw new Error("VML container not found.");
  2509. var h = new c._Paper, i = h.canvas = c._g.doc.createElement("div"), j = i.style;
  2510. return f = f || 0, g = g || 0, e = e || 512, d = d || 342, h.width = e, h.height = d, e == +e && (e += "px"), d == +d && (d += "px"), h.coordsize = 1e3 * u + n + 1e3 * u, h.coordorigin = "0 0", h.span = c._g.doc.createElement("span"), h.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;", i.appendChild(h.span), j.cssText = c.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden", e, d), 1 == b ? (c._g.doc.body.appendChild(i), j.left = f + "px", j.top = g + "px", j.position = "absolute") : b.firstChild ? b.insertBefore(i, b.firstChild) : b.appendChild(i), h.renderfix = function () {
  2511. }, h
  2512. }, c.prototype.clear = function () {
  2513. c.eve("raphael.clear", this), this.canvas.innerHTML = o, this.span = c._g.doc.createElement("span"), this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;", this.canvas.appendChild(this.span), this.bottom = this.top = null
  2514. }, c.prototype.remove = function () {
  2515. c.eve("raphael.remove", this), this.canvas.parentNode.removeChild(this.canvas);
  2516. for (var a in this) this[a] = "function" == typeof this[a] ? c._removedFactory(a) : null;
  2517. return !0
  2518. };
  2519. var G = c.st;
  2520. for (var H in E) E[a](H) && !G[a](H) && (G[H] = function (a) {
  2521. return function () {
  2522. var b = arguments;
  2523. return this.forEach(function (c) {
  2524. c[a].apply(c, b)
  2525. })
  2526. }
  2527. }(H))
  2528. }
  2529. }(), B.was ? A.win.Raphael = c : Raphael = c, "object" == typeof exports && (module.exports = c), c
  2530. });