/** * Minified by jsDelivr using Terser v3.14.1. * Original file: /npm/jquery.json-viewer@1.4.0/json-viewer/jquery.json-viewer.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function (s) { function e(s) { return s instanceof Object && Object.keys(s).length > 0 } s.fn.jsonViewer = function (l, a) { return a = Object.assign({}, { collapsed: !1, rootCollapsable: !0, withQuotes: !1, withLinks: !0 }, a), this.each(function () { var t = function s(l, a) { var t = ""; if ("string" == typeof l) l = l.replace(/&/g, "&").replace(//g, ">").replace(/'/g, "'").replace(/"/g, """), a.withLinks && /^(https?:\/\/|ftps?:\/\/)?([a-z0-9%-]+\.){1,}([a-z0-9-]+)?(:(\d{1,5}))?(\/([a-z0-9\-._~:\/?#[\]@!$&'()*+,;=%]+)?)?$/i.test(l) ? t += '' + l + "" : t += '"' + (l = l.replace(/"/g, "\\"")) + '"'; else if ("number" == typeof l) t += '' + l + ""; else if ("boolean" == typeof l) t += '' + l + ""; else if (null === l) t += 'null'; else if (l instanceof Array) if (l.length > 0) { t += '[
    '; for (var n = 0; n < l.length; ++n) t += "
  1. ", e(l[n]) && (t += ''), t += s(l[n], a), n < l.length - 1 && (t += ","), t += "
  2. "; t += "
]" } else t += "[]"; else if ("object" == typeof l) { var o = Object.keys(l).length; if (o > 0) { for (var i in t += '{}" } else t += "{}" } return t }(l, a); a.rootCollapsable && e(l) && (t = '' + t), s(this).html(t), s(this).addClass("json-document"), s(this).off("click"), s(this).on("click", "a.json-toggle", function () { var e = s(this).toggleClass("collapsed").siblings("ul.json-dict, ol.json-array"); if (e.toggle(), e.is(":visible")) e.siblings(".json-placeholder").remove(); else { var l = e.children("li").length, a = l + (l > 1 ? " items" : " item"); e.after('' + a + "") } return !1 }), s(this).on("click", "a.json-placeholder", function () { return s(this).siblings("a.json-toggle").click(), !1 }), 1 == a.collapsed && s(this).find("a.json-toggle").click() }) } }(jQuery); //# sourceMappingURL=/sm/2eabfda485458aa3aa101e518dd23623b568b299b2883e2315ffe59e7b2e718b.map