text: ﻿/* icoonies
   * version: 1.0 (04 Dec 2014)
   * Copyright (c) 2014 disapp 
   * disappteam@gmail.com
   
   * Permission is hereby granted, free of charge, to any person
     obtaining a copy of this software and associated documentation
     files (the "Software"), to deal in the Software without
     restriction, including without limitation the rights to use,
     copy, modify, merge, publish, distribute, sublicense, and/or sell
     copies of the Software, and to permit persons to whom the
     Software is furnished to do so, subject to the following
     conditions:
  
     The above copyright notice and this permission notice shall be
     included in all copies or substantial portions of the Software.
  
     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     OTHER DEALINGS IN THE SOFTWARE.
   */
  
  
  !function (o) { var e = o.fn.append, t = o.fn.html; o.fn.append = function () { var t = e.apply(this, arguments); return o(this).find(".icoonies").trigger("icooniesAppend"), t }, o.fn.html = function () { var e = t.apply(this, arguments); return o(this).find(".icoonies").trigger("icooniesAppend"), e } }(jQuery), function (o) { o.browser || "1.3.2" == o.fn.jquery || (o.extend({ browser: {} }), o.browser.init = function () { var e = {}; try { navigator.vendor ? /Chrome/.test(navigator.userAgent) ? (e.browser = "Chrome", e.version = parseFloat(navigator.userAgent.split("Chrome/")[1].split("Safari")[0])) : /Safari/.test(navigator.userAgent) ? (e.browser = "Safari", e.version = parseFloat(navigator.userAgent.split("Version/")[1].split("Safari")[0])) : /Opera/.test(navigator.userAgent) && (e.Opera = "Safari", e.version = parseFloat(navigator.userAgent.split("Version/")[1])) : /Firefox/.test(navigator.userAgent) ? (e.browser = "mozilla", e.version = parseFloat(navigator.userAgent.split("Firefox/")[1])) : (e.browser = "MSIE", e.version = /MSIE/.test(navigator.userAgent) ? parseFloat(navigator.userAgent.split("MSIE")[1]) : "edge") } catch (t) { e = t } e.browser || (e.browser = "none", e.version = 0), o.browser[e.browser.toLowerCase()] = e.browser.toLowerCase(), o.browser.browser = e.browser, o.browser.version = e.version, o.browser.msie = "msie" == o.browser.browser.toLowerCase() }, o.browser.init()) }(jQuery), jQuery.extend({ isValidSelector: function (o) { try { { $(o) } } catch (e) { return !1 } return !0 } }), "function" != typeof String.prototype.startsWith && (String.prototype.startsWith = function (o) { return 0 == this.indexOf(o) }); var icoo = function (o, e, t) { var s = { options: { mode: "image", basepath: "", parseAllCss: !1 }, stored_svg: [], noimage_encoded: "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA2NzkgNjc5IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA2NzkgNjc5IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnIGlkPSJMaXZlbGxvXzEiPg0KCTxwYXRoIGlkPSJpY29vLWFyZWEtMiIgc3R5bGU9ImZpbGw6I25vbmUgIWltcG9ydGFudDsgc3Ryb2tlOiM5QjAwN0UgIWltcG9ydGFudDsgc3Ryb2tlLXdpZHRoOjMxICFpbXBvcnRhbnQ7IGRpc3BsYXk6YmxvY2sgIWltcG9ydGFudDsgb3BhY2l0eTo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dCAhaW1wb3J0YW50Ow0KICAgIH0NCiAgICANCiAgICANCiAgPC9zdHlsZT4NCjwvc3ZnPg==", css_download: 0, css_length: 0, icooRules: [], icooBackgroundRules: [], icooSvgStyles: [], downloadconfiguration: 0, getRandomColor: function () { for (var o = "0123456789ABCDEF".split(""), e = "#", t = 0; 6 > t; t++) e += o[Math.floor(16 * Math.random())]; return e }, init: function (i) { if (!e["icoo-ready"]) { e["icoo-ready"] = !0, s.icooCss = e.icooStyle || {}, s.downloadconfiguration = 0, s.options = t.extend({}, s.options, i), s.css_length = t(".icoonies-css").length, s.css_download = 0, s.cssregex = new RegExp("([^{}/]+){( |\\t){0,}/\\*icoonies([^\\*]{0,})\\*/(.[^}]+)}", "gmi"), s.css_region_regex = new RegExp("/\\*region([^\\*]{0,})\\*/(.*?)/\\*endregion\\*/", "gmi"), s.icoonies_regex = new RegExp("/\\*icoonies([^\\*]{0,})\\*/", "gmi"), s.cssregex_commment = new RegExp("/\\*[^\\*/]+\\*/", "gmi"), s.background_showarea = []; var r = "link[rel*=stylesheet].icoonies-css"; s.options.parseAllCss && (r = "link[rel*=stylesheet]"), t(r).each(function () { var o = t(this).clone(); t.ajax({ url: o.attr("href").toString(), dataType: "text", cache: !1, success: function (o) { s.parseRegionCss(o), s.parseCss(o, this.url) }, error: function () { s.css_download += 1, s.icooCssParser(), s.icooParser() } }) }), r = "style.icoonies-css", s.options.parseAllCss && (r = "style"), t(r).each(function () { s.parseRegionCss(t(this).html()), s.parseCss(t(this).html(), o.location.href) }), s.icooCssParser(), s.icooParser() } }, parseCss: function (o, e) { var i = o.replace(/\\t{1,}|\\r|\\n/gim, "").replace(/\r/gim, " ").replace(/\n/gim, " ").replace(/@media screen/gim, "@screen").replace(/@media[^{]*\{(?:(?!\}\s*\}).)*/gim, "").replace(/screen/gim, "@media screen").match(s.cssregex); if (i) for (var r = 0; r < i.length; r++) { var a = i[r].replace(s.icoonies_regex, "$1").replace(s.cssregex_commment, "").split("{"); if (a.length > 0) for (var n = a[0].replace(/\//g, "").split(","), c = a[1].replace(/}/g, "").split(";"), l = "", g = "", d = 0; d < n.length; d++) if (g = n[d].trim(), t.isValidSelector(g)) { for (var u = { selector: g, rules: [], css_url: e.toString() }, p = 0; p < c.length; p++) { if (l = c[p].split(":"), l.length > 2) { var m = c[p].split(":"); l = [], l.push(m[0]), m.shift(), l.push(m.join(":")) } if (2 == l.length) { var v = { key: l[0].trim().replace("icoo-", "").trim(), value: l[1].trim(), css: !l[0].trim().startsWith("icoo-"), background: l[0].trim().replace("icoo-", "").toLowerCase().startsWith("background") && l[1].trim().toLowerCase().startsWith("url"), embedstyle: "icoo-region" == l[0].trim(), showarea: "icoo-showarea" == l[0].trim() }; u.rules.push(v) } } s.icooRules.push(u) } } s.css_download += 1, s.icooCssParser(), s.icooParser() }, parseRegionCss: function (o) { var e = o.replace(/\\t{1,}|\\r|\\n/gim, "").replace(/\r/gim, " ").replace(/\n/gim, " ").match(s.css_region_regex); if (e) for (var t = 0; t < e.length; t++) { var i = e[t].replace(s.css_region_regex, "$1").trim().toLowerCase(), r = e[t].replace(s.css_region_regex, "$2").trim(); s.icooSvgStyles[i] = s.icooSvgStyles[i] ? s.icooSvgStyles[i] + " " + r : r } }, getSvgUrl: function (e, t) { var s = o.createElement("a"); s.href = e; var i = s.href.split("/"); if (s = null, delete s, i.pop(), t.startsWith("/") || t.toLowerCase().startsWith("http")) return t; t = t.replace(/\.\.\//g, "|").split("|"); for (var r = 0; r < t.length; r++) "" == t[r] ? i.pop() : i.push(t[r]); return i.join("/") }, icooCssParser: function () { if (!(s.css_download < s.css_length)) { var o = new RegExp("url[ ]{0,}\\(['\\\"]{0,1}(.{1,}.svg)['\\\"]{0,1}\\)", "gmi"); s.icooBackgroundRules = []; for (var e = 0; e < s.icooRules.length; e++) for (var i = 0; i < s.icooRules[e].rules.length; i++) { var r = s.icooRules[e].rules[i].value.match(o); if (s.icooRules[e].rules[i].background && r) { for (var a = { main: s.icooRules[e].selector, url: s.getSvgUrl(s.icooRules[e].css_url, r[0].replace(o, "$1")), rules: [{ selector: "svg", rules: [] }], showarea: !1 }, n = 0; n < s.icooRules[e].rules.length; n++) (!s.icooRules[e].rules[n].css || s.icooRules[e].rules[n].embedstyle || s.icooRules[e].rules[n].showarea) && (a.rules[0].rules.push(s.icooRules[e].rules[n]), s.icooRules[e].rules[n].showarea && (a.showarea = !0)); s.icooBackgroundRules.push(a) } } for (var e = 0; e < s.icooBackgroundRules.length; e++) for (var i = 0; i < s.icooRules.length; i++) (s.icooRules[i].selector.startsWith(s.icooBackgroundRules[e].main + " ") || ".IE" == s.icooRules[i].selector) && s.icooBackgroundRules[e].rules.push({ selector: s.icooRules[i].selector.replace(s.icooBackgroundRules[e].main + " ", "").trim(), rules: s.icooRules[i].rules }); for (var e = 0; e < s.icooBackgroundRules.length; e++) { var c = t('<div data-mode="image" data-src="' + s.icooBackgroundRules[e].url + '" class="icoonies"></div> '); s.renderIcoo(c, s.icooBackgroundRules[e].rules, s.icooBackgroundRules[e].main) } } }, cssParser: function (o, e, i, r) { if (o) for (var a = 0; a < o.length; a++) { var n = o[a]; if (n.css && !n.background) { if (i.target.data("mode") && "image" == i.target.data("mode")) { var c = e.attr("style"); c || (c = ""), c += n.key + ":" + n.value + ";", e.attr("style", c) } } else if (n.embedstyle) { var l = null; r && 0 == r.find("style").length ? (l = t("<style></style>"), r.append(l)) : r && r.find("style").length > 0 && (l = r.find("style")); for (var g = n.value.split(","), d = 0; d < g.length; d++) { var u = g[d].trim().toLowerCase(); s.icooSvgStyles[u] && l.append(s.icooSvgStyles[u]) } } else n.background || e.attr(n.key, n.value) } }, icooParser: function () { s.css_download < s.css_length || (t(".icoonies").each(function () { t(this).removeClass("icoonies"), s.renderIcoo(t(this), s.icooRules) }), setTimeout(function () { for (var o = 0; o < s.icooBackgroundRules.length; o++) s.icooBackgroundRules[o].showarea && t(s.icooBackgroundRules[o].main).addClass("icoo-showarea").data("src", s.icooBackgroundRules[o].url), t.browser.msie && t(s.icooBackgroundRules[o].main).addClass("IE") }, 500), t(o).on("icooniesAppend", ".icoonies", function () { s.renderIcoo(t(this), s.icooRules) }), t(o).on("click", ".icoo-showarea", icoo.showPreview)) }, renderIcoo: function (o, e, i, r) { o.removeClass("icoonies"); { var a = o.data("class") || ""; (o.attr("class") || " ").split(/\s+/) } o.data("mode", o.data("mode") || s.options.mode); var n = (o.data("position") || "xMinYMin", { target: o, classList: o.attr("class").split(/\s+/), dataClassList: a, preserveAspectRatio: o.data("position") || "xMinYMin", showArea: o.data("showarea") || o.hasClass("icoo-showarea") || !1, icooCss: s.icooCss, svg_outer: "" }), c = o.data("src") || "icoonies-not-found"; if ("icoonies-not-found" != c) if (s.stored_svg[c]) { var l = { options: n, url: c }; s.svgparser(s.stored_svg[c], l, e, i, r) } else t.ajax({ options: n, url: c, dataType: "text", async: !1, success: function (o) { s.stored_svg[c] = o, s.svgparser(o, this, e, i, r) }, error: function () { s.svgparser(Base64.decode(s.noimage_encoded), this, e, i, r) } }) }, svgparser: function (o, e, i, r, a) { e.options.svg_outer = ""; var n = t("<div></div>"); if (n.append("img" != e.options.target.prop("tagName").toLowerCase() ? t(e.options.target[0].outerHTML).append(o) : o), !n.find("svg")[0]) return void e.options.target.remove(); var c = ""; e.options.showArea && (a ? e.options.target.data("mode", "svg") : e.options.target.addClass("icoo-showarea")), t.browser.msie && "image" == e.options.target.data("mode") && (c = "IE "), "img" == e.options.target.prop("tagName").toLowerCase() && (n.find("svg").attr("class", e.options.classList.join(" ")), n.find("svg").attr("class") && (c += n.find("svg").attr("class"))), c += " " + e.options.dataClassList, n.find("svg").attr("class", c.trim()); var l = 1; n.find("svg").find("*").each(function () { "defs" != t(this).prop("tagName").toLowerCase() && "g" != t(this).prop("tagName").toLowerCase() && (a ? t(this).attr("id", "icoo-previewarea-" + l++) : t(this).attr("id") || t(this).attr("id", "icoo-area-" + l++), a && (t(this).attr("onclick", "icoo.previewTitleClick(evt)"), t(this).attr("oldfill", s.getRandomColor()), t(this).attr("oldstroke", "#9B007E"), t(this).attr("oldstrokewidth", "4"), t(this).attr("fill", "transparent"), t(this).attr("fill") || t(this).attr("fill", "black"), t(this).attr("stroke") || t(this).attr("stroke", "black"), t(this).attr("stroke-width") || t(this).attr("stroke-width", "0"), t(this).append("<title>" + t(this).attr("id").replace("icoo-previewarea-", "icoo-area-") + "</title>"))) }); for (var g = 0; g < i.length; g++) try { var d = i[g]; n.find(d.selector).each(function () { t(this); s.cssParser(d.rules, t(this), e.options, n.find("svg")) }) } catch (u) { } switch (n.find("svg").removeAttr("width").removeAttr("height"), n = n.find("svg"), e.options.svg_outer = n[0].outerHTML ? n[0].outerHTML : n[0].xml ? n[0].xml : t("<object></object>").append(n[0]).html(), e.options.svg_outer = t(e.options.svg_outer), "img" != e.options.target.prop("tagName").toLowerCase() && e.options.svg_outer.addClass("zindex-area"), e.options.svg_outer = e.options.svg_outer[0].outerHTML ? e.options.svg_outer[0].outerHTML : e.options.svg_outer[0].xml ? e.options.svg_outer[0].xml : t("<object></object").append(n[0]).html(), e.options.target.data("mode")) { case "image": var p = "data:image/svg+xml;base64," + Base64.encode(s.webkitNamespaceBugWorkaround(e.options.svg_outer)); if ("img" == e.options.target.prop("tagName").toLowerCase()) e.options.target.attr("src", p); else if (r) t("head").append("<style> " + r + " { background-image:url(" + p + "); }    </style>"); else { var m = "icoonies_" + Math.ceil(1e7 * Math.random()); t("head").append('<style id="' + m + '"> .' + m + " { background-image:url(" + p + "); background-repeat:no-repeat; }   @media screen\x00 { ." + m + " { background-size:100%;  } }</style>"), e.options.target.addClass(m) } break; default: if ("img" == e.options.target.prop("tagName").toLowerCase()) { var v = t('<object class="obj"></object>'); a || e.options.showArea && (v.addClass("icoo-showarea"), v.attr("data-src", e.options.target.data("src"))), v.append(t(e.options.svg_outer)), v.insertBefore(e.options.target), e.options.target.remove() } else e.options.target.hasClass("icoonies-relative") || e.options.target.addClass("icoonies-relative"), e.options.svg_outer = t(e.options.svg_outer).clone(), e.options.svg_outer.attr("class", ("icoonies-bg" + (e.options.showArea ? " zindex-area" : "") + " " + this.options.dataClassList).trim()), e.options.svg_outer = e.options.svg_outer[0].outerHTML ? e.options.svg_outer[0].outerHTML : e.options.svg_outer[0].xml ? e.options.svg_outer[0].xml : (new XMLSerializer).serializeToString(e.options.svg_outer[0]), e.options.target.append(s.webkitNamespaceBugWorkaround(e.options.svg_outer)) } }, previewTitleClick: function (o) { var e = t(o.target), s = e.attr("oldstroke").toString(), i = e.attr("oldstrokewidth").toString(), r = e.attr("oldfill").toString(); e.attr("oldfill", e.attr("fill").toString()), e.attr("fill", r), e.attr("oldstroke", e.attr("stroke").toString()), e.attr("stroke", s), e.attr("oldstrokewidth", e.attr("stroke-width").toString()), e.attr("stroke-width", i) }, showPreview: function (o) { 0 == t("#icoo-img-modal").length && (t("body").append(t('<div class="icoo-modal-opacity" style="display:none;"><div class="icoo-modal"><a class="icoo-close-modal" href="#">close</a><div class="icoo-overflow-modal"><p>Point your mouse over the image to see the name of different areas. Click over the area to see the form.</p><div class="icoo-aree-modal" id="icoo-img-modal"></div></div></div></div>')), t(".icoo-close-modal").on("click", function () { return t(".icoo-modal-opacity").hide(), !1 })), o.preventDefault(), t("#icoo-img-modal").empty().append('<img id="icoo-preview-img" class="icoo-preview" data-src="' + t(this).data("src") + '"  data-mode="svg" " data-showarea="true" />'), s.renderIcoo(t("#icoo-preview-img"), s.icooRules, "", !0), t(".icoo-modal-opacity").show() }, webkitNamespaceBugWorkaround: function (o) { var e = o.replace(/\ xlink=/g, " xmlns:xlink=", "g"); return e = e.replace(/\ href=/g, " xlink:href=", "g") } }; return s }(document, window, jQuery);
  