mermaid
Version:
Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.
45 lines (41 loc) • 30.3 kB
JavaScript
!(function () { if ('ontouchstart' in window) { var t, e, n, r, i, a, o = {}; t = function (t, e) { return Math.abs(t[0] - e[0]) > 5 || Math.abs(t[1] - e[1]) > 5 }, e = function (t) { this.startXY = [t.touches[0].clientX, t.touches[0].clientY], this.threshold = !1 }, n = function (e) { return this.threshold ? !1 : void (this.threshold = t(this.startXY, [e.touches[0].clientX, e.touches[0].clientY])) }, r = function (e) { if (!this.threshold && !t(this.startXY, [e.changedTouches[0].clientX, e.changedTouches[0].clientY])) { var n = e.changedTouches[0], r = document.createEvent('MouseEvents'); r.initMouseEvent('click', !0, !0, window, 0, n.screenX, n.screenY, n.clientX, n.clientY, !1, !1, !1, !1, 0, null), r.simulated = !0, e.target.dispatchEvent(r) } }, i = function (t) { var e = Date.now(), n = e - o.time, r = t.clientX, i = t.clientY, u = [Math.abs(o.x - r), Math.abs(o.y - i)], s = a(t.target, 'A') || t.target, c = s.nodeName, l = c === 'A', h = window.navigator.standalone && l && t.target.getAttribute('href'); return o.time = e, o.x = r, o.y = i, (!t.simulated && (n < 500 || n < 1500 && u[0] < 50 && u[1] < 50) || h) && (t.preventDefault(), t.stopPropagation(), !h) ? !1 : (h && (window.location = s.getAttribute('href')), void (s && s.classList && (s.classList.add('energize-focus'), window.setTimeout(function () { s.classList.remove('energize-focus') }, 150)))) }, a = function (t, e) { for (var n = t; n !== document.body;) { if (!n || n.nodeName === e) return n; n = n.parentNode } return null }, document.addEventListener('touchstart', e, !1), document.addEventListener('touchmove', n, !1), document.addEventListener('touchend', r, !1), document.addEventListener('click', i, !0) } }()), /*
Copyright 2008-2013 Concur Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
*/
(function (t) { 'use strict'; function e (e) { if (e && e !== '') { $('.lang-selector a').removeClass('active'), $(".lang-selector a[data-language-name='" + e + "']").addClass('active'); for (var n = 0; n < s.length; n++)$('.highlight.' + s[n]).hide(); $('.highlight.' + e).show(), t.toc.calculateHeights(), $(window.location.hash).get(0) && $(window.location.hash).get(0).scrollIntoView(!0) } } function n (t) { return typeof t !== 'string' ? {} : (t = t.trim().replace(/^(\?|#|&)/, ''), t ? t.split('&').reduce(function (t, e) { var n = e.replace(/\+/g, ' ').split('='), r = n[0], i = n[1]; return r = decodeURIComponent(r), i = void 0 === i ? null : decodeURIComponent(i), t.hasOwnProperty(r) ? Array.isArray(t[r]) ? t[r].push(i) : t[r] = [t[r], i] : t[r] = i, t }, {}) : {}) } function r (t) { return t ? Object.keys(t).sort().map(function (e) { var n = t[e]; return Array.isArray(n) ? n.sort().map(function (t) { return encodeURIComponent(e) + '=' + encodeURIComponent(t) }).join('&') : encodeURIComponent(e) + '=' + encodeURIComponent(n) }).join('&') : '' } function i () { if (location.search.length >= 1) { var t = n(location.search).language; if (t) return t; if (jQuery.inArray(location.search.substr(1), s) != -1) return location.search.substr(1) } return !1 } function a (t) { var e = n(location.search); return e.language ? (e.language = t, r(e)) : t } function o (t) { if (history) { var e = window.location.hash; e && (e = e.replace(/^#+/, '')), history.pushState({}, '', '?' + a(t) + '#' + e), localStorage.setItem('language', t) } } function u (t) { var n = localStorage.getItem('language'); s = t; var r = i(); r ? (e(r), localStorage.setItem('language', r)) : e(n !== null && jQuery.inArray(n, s) != -1 ? n : s[0]) } var s = []; t.setupLanguages = u, t.activateLanguage = e, $(function () { $('.lang-selector a').on('click', function () { var t = $(this).data('language-name'); return o(t), e(t), !1 }), window.onpopstate = function () { e(i()) } }) }(window)), /*! jQuery UI - v1.11.3 - 2015-02-12
* http://jqueryui.com
* Includes: widget.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
(function (t) { typeof define === 'function' && define.amd ? define(['jquery'], t) : t(jQuery) }(function (t) { /*!
* jQuery UI Widget 1.11.3
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/jQuery.widget/
*/
var e = 0, n = Array.prototype.slice; t.cleanData = (function (e) { return function (n) { var r, i, a; for (a = 0; (i = n[a]) != null; a++) try { r = t._data(i, 'events'), r && r.remove && t(i).triggerHandler('remove') } catch (o) {}e(n) } }(t.cleanData)), t.widget = function (e, n, r) { var i, a, o, u, s = {}, c = e.split('.')[0]; return e = e.split('.')[1], i = c + '-' + e, r || (r = n, n = t.Widget), t.expr[':'][i.toLowerCase()] = function (e) { return !!t.data(e, i) }, t[c] = t[c] || {}, a = t[c][e], o = t[c][e] = function (t, e) { return this._createWidget ? void (arguments.length && this._createWidget(t, e)) : new o(t, e) }, t.extend(o, a, {version: r.version, _proto: t.extend({}, r), _childConstructors: []}), u = new n(), u.options = t.widget.extend({}, u.options), t.each(r, function (e, r) { return t.isFunction(r) ? void (s[e] = (function () { var t = function () { return n.prototype[e].apply(this, arguments) }, i = function (t) { return n.prototype[e].apply(this, t) }; return function () { var e, n = this._super, a = this._superApply; return this._super = t, this._superApply = i, e = r.apply(this, arguments), this._super = n, this._superApply = a, e } }())) : void (s[e] = r) }), o.prototype = t.widget.extend(u, {widgetEventPrefix: a ? u.widgetEventPrefix || e : e}, s, {constructor: o, namespace: c, widgetName: e, widgetFullName: i}), a ? (t.each(a._childConstructors, function (e, n) { var r = n.prototype; t.widget(r.namespace + '.' + r.widgetName, o, n._proto) }), delete a._childConstructors) : n._childConstructors.push(o), t.widget.bridge(e, o), o }, t.widget.extend = function (e) { for (var r, i, a = n.call(arguments, 1), o = 0, u = a.length; u > o; o++) for (r in a[o])i = a[o][r], a[o].hasOwnProperty(r) && void 0 !== i && (e[r] = t.isPlainObject(i) ? t.isPlainObject(e[r]) ? t.widget.extend({}, e[r], i) : t.widget.extend({}, i) : i); return e }, t.widget.bridge = function (e, r) { var i = r.prototype.widgetFullName || e; t.fn[e] = function (a) { var o = typeof a === 'string', u = n.call(arguments, 1), s = this; return o ? this.each(function () { var n, r = t.data(this, i); return a === 'instance' ? (s = r, !1) : r ? t.isFunction(r[a]) && a.charAt(0) !== '_' ? (n = r[a].apply(r, u), n !== r && void 0 !== n ? (s = n && n.jquery ? s.pushStack(n.get()) : n, !1) : void 0) : t.error("no such method '" + a + "' for " + e + ' widget instance') : t.error('cannot call methods on ' + e + " prior to initialization; attempted to call method '" + a + "'") }) : (u.length && (a = t.widget.extend.apply(null, [a].concat(u))), this.each(function () { var e = t.data(this, i); e ? (e.option(a || {}), e._init && e._init()) : t.data(this, i, new r(a, this)) })), s } }, t.Widget = function () {}, t.Widget._childConstructors = [], t.Widget.prototype = {widgetName: 'widget', widgetEventPrefix: '', defaultElement: '<div>', options: {disabled: !1, create: null}, _createWidget: function (n, r) { r = t(r || this.defaultElement || this)[0], this.element = t(r), this.uuid = e++, this.eventNamespace = '.' + this.widgetName + this.uuid, this.bindings = t(), this.hoverable = t(), this.focusable = t(), r !== this && (t.data(r, this.widgetFullName, this), this._on(!0, this.element, {remove: function (t) { t.target === r && this.destroy() }}), this.document = t(r.style ? r.ownerDocument : r.document || r), this.window = t(this.document[0].defaultView || this.document[0].parentWindow)), this.options = t.widget.extend({}, this.options, this._getCreateOptions(), n), this._create(), this._trigger('create', null, this._getCreateEventData()), this._init() }, _getCreateOptions: t.noop, _getCreateEventData: t.noop, _create: t.noop, _init: t.noop, destroy: function () { this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr('aria-disabled').removeClass(this.widgetFullName + '-disabled ui-state-disabled'), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass('ui-state-hover'), this.focusable.removeClass('ui-state-focus') }, _destroy: t.noop, widget: function () { return this.element }, option: function (e, n) { var r, i, a, o = e; if (arguments.length === 0) return t.widget.extend({}, this.options); if (typeof e === 'string') if (o = {}, r = e.split('.'), e = r.shift(), r.length) { for (i = o[e] = t.widget.extend({}, this.options[e]), a = 0; a < r.length - 1; a++)i[r[a]] = i[r[a]] || {}, i = i[r[a]]; if (e = r.pop(), arguments.length === 1) return void 0 === i[e] ? null : i[e]; i[e] = n } else { if (arguments.length === 1) return void 0 === this.options[e] ? null : this.options[e]; o[e] = n } return this._setOptions(o), this }, _setOptions: function (t) { var e; for (e in t) this._setOption(e, t[e]); return this }, _setOption: function (t, e) { return this.options[t] = e, t === 'disabled' && (this.widget().toggleClass(this.widgetFullName + '-disabled', !!e), e && (this.hoverable.removeClass('ui-state-hover'), this.focusable.removeClass('ui-state-focus'))), this }, enable: function () { return this._setOptions({disabled: !1}) }, disable: function () { return this._setOptions({disabled: !0}) }, _on: function (e, n, r) { var i, a = this; typeof e !== 'boolean' && (r = n, n = e, e = !1), r ? (n = i = t(n), this.bindings = this.bindings.add(n)) : (r = n, n = this.element, i = this.widget()), t.each(r, function (r, o) { function u () { return e || a.options.disabled !== !0 && !t(this).hasClass('ui-state-disabled') ? (typeof o === 'string' ? a[o] : o).apply(a, arguments) : void 0 } typeof o !== 'string' && (u.guid = o.guid = o.guid || u.guid || t.guid++); var s = r.match(/^([\w:-]*)\s*(.*)$/), c = s[1] + a.eventNamespace, l = s[2]; l ? i.delegate(l, c, u) : n.bind(c, u) }) }, _off: function (e, n) { n = (n || '').split(' ').join(this.eventNamespace + ' ') + this.eventNamespace, e.unbind(n).undelegate(n), this.bindings = t(this.bindings.not(e).get()), this.focusable = t(this.focusable.not(e).get()), this.hoverable = t(this.hoverable.not(e).get()) }, _delay: function (t, e) { function n () { return (typeof t === 'string' ? r[t] : t).apply(r, arguments) } var r = this; return setTimeout(n, e || 0) }, _hoverable: function (e) { this.hoverable = this.hoverable.add(e), this._on(e, {mouseenter: function (e) { t(e.currentTarget).addClass('ui-state-hover') }, mouseleave: function (e) { t(e.currentTarget).removeClass('ui-state-hover') }}) }, _focusable: function (e) { this.focusable = this.focusable.add(e), this._on(e, {focusin: function (e) { t(e.currentTarget).addClass('ui-state-focus') }, focusout: function (e) { t(e.currentTarget).removeClass('ui-state-focus') }}) }, _trigger: function (e, n, r) { var i, a, o = this.options[e]; if (r = r || {}, n = t.Event(n), n.type = (e === this.widgetEventPrefix ? e : this.widgetEventPrefix + e).toLowerCase(), n.target = this.element[0], a = n.originalEvent) for (i in a)i in n || (n[i] = a[i]); return this.element.trigger(n, r), !(t.isFunction(o) && o.apply(this.element[0], [n].concat(r)) === !1 || n.isDefaultPrevented()) }}, t.each({show: 'fadeIn', hide: 'fadeOut'}, function (e, n) { t.Widget.prototype['_' + e] = function (r, i, a) { typeof i === 'string' && (i = {effect: i}); var o, u = i ? i === !0 || typeof i === 'number' ? n : i.effect || n : e; i = i || {}, typeof i === 'number' && (i = {duration: i}), o = !t.isEmptyObject(i), i.complete = a, i.delay && r.delay(i.delay), o && t.effects && t.effects.effect[u] ? r[e](i) : u !== e && r[u] ? r[u](i.duration, i.easing, a) : r.queue(function (n) { t(this)[e](), a && a.call(r[0]), n() }) } }); t.widget
})), /* jquery Tocify - v1.8.0 - 2013-09-16
* http://www.gregfranko.com/jquery.tocify.js/
* Copyright (c) 2013 Greg Franko; Licensed MIT
* Modified lightly by Robert Lord to fix a bug I found,
* and also so it adds ids to headers
* also because I want height caching, since the
* height lookup for h1s and h2s was causing serious
* lag spikes below 30 fps */
(function (t) { 'use strict'; t(window.jQuery, window, document) }(function (t, e, n, r) { 'use strict'; var i = 'tocify', a = 'tocify-focus', o = 'tocify-hover', u = 'tocify-hide', s = 'tocify-header', c = '.' + s, l = 'tocify-subheader', h = '.' + l, f = 'tocify-item', d = '.' + f, p = 'tocify-extend-page', g = '.' + p; t.widget('toc.tocify', {version: '1.8.0', options: {context: 'body', ignoreSelector: null, selectors: 'h1, h2, h3', showAndHide: !0, showEffect: 'slideDown', showEffectSpeed: 'medium', hideEffect: 'slideUp', hideEffectSpeed: 'medium', smoothScroll: !0, smoothScrollSpeed: 'medium', scrollTo: 0, showAndHideOnScroll: !0, highlightOnScroll: !0, highlightOffset: 40, theme: 'bootstrap', extendPage: !0, extendPageOffset: 100, history: !0, scrollHistory: !1, hashGenerator: 'compact', highlightDefault: !0}, _create: function () { var n = this; n.tocifyWrapper = t('.tocify-wrapper'), n.extendPageScroll = !0, n.items = [], n._generateToc(), n.cachedHeights = [], n.cachedAnchors = [], n._addCSSClasses(), n.webkit = (function () { for (var t in e) if (t && t.toLowerCase().indexOf('webkit') !== -1) return !0; return !1 }()), n._setEventHandlers(), t(e).load(function () { n._setActiveElement(!0), t('html, body').promise().done(function () { setTimeout(function () { n.extendPageScroll = !1 }, 0) }) }) }, _generateToc: function () { var e, n, r = this, a = r.options.ignoreSelector; return e = t(this.options.context).find(this.options.selectors.indexOf(',') !== -1 ? this.options.selectors.replace(/ /g, '').substr(0, this.options.selectors.indexOf(',')) : this.options.selectors.replace(/ /g, '')), e.length ? (r.element.addClass(i), void e.each(function (e) { t(this).is(a) || (n = t('<ul/>', {id: s + e, 'class': s}).append(r._nestElements(t(this), e)), r.element.append(n), t(this).nextUntil(this.nodeName.toLowerCase()).each(function () { t(this).find(r.options.selectors).length === 0 ? t(this).filter(r.options.selectors).each(function () { t(this).is(a) || r._appendSubheaders.call(this, r, n) }) : t(this).find(r.options.selectors).each(function () { t(this).is(a) || r._appendSubheaders.call(this, r, n) }) })) })) : void r.element.addClass(u) }, _setActiveElement: function (t) { var n = this, r = e.location.hash.substring(1), i = n.element.find("li[data-unique='" + r + "']"); return r.length ? (n.element.find('.' + n.focusClass).removeClass(n.focusClass), i.addClass(n.focusClass), n.options.showAndHide && i.click()) : (n.element.find('.' + n.focusClass).removeClass(n.focusClass), !r.length && t && n.options.highlightDefault && n.element.find(d).first().addClass(n.focusClass)), n }, _nestElements: function (e, n) { var r, i, a; return r = t.grep(this.items, function (t) { return t === e.text() }), this.items.push(r.length ? e.text() + n : e.text()), a = this._generateHashValue(r, e, n), i = t('<li/>', {'class': f, 'data-unique': a}).append(t('<a/>', {text: e.text()})), e.before(t('<div/>', {name: a, 'data-unique': a})), i }, _generateHashValue: function (t, e, n) { var r = '', i = this.options.hashGenerator; if (i === 'pretty') { for (r = e.text().toLowerCase().replace(/\s/g, '-'), r = r.replace(/[^\x00-\x7F]/g, ''); r.indexOf('--') > -1;)r = r.replace(/--/g, '-'); for (;r.indexOf(':-') > -1;)r = r.replace(/:-/g, '-') } else r = typeof i === 'function' ? i(e.text(), e) : e.text().replace(/\s/g, ''); return t.length && (r += '' + n), r }, _appendSubheaders: function (e, n) { var r = t(this).index(e.options.selectors), i = t(e.options.selectors).eq(r - 1), a = +t(this).prop('tagName').charAt(1), o = +i.prop('tagName').charAt(1); o > a ? e.element.find(h + '[data-tag=' + a + ']').last().append(e._nestElements(t(this), r)) : a === o ? n.find(d).last().after(e._nestElements(t(this), r)) : n.find(d).last().after(t('<ul/>', {'class': l, 'data-tag': a})).next(h).append(e._nestElements(t(this), r)) }, _setEventHandlers: function () { var i = this; this.element.on('click.tocify', 'li', function () { if (i.options.history && (e.location.hash = t(this).attr('data-unique')), i.element.find('.' + i.focusClass).removeClass(i.focusClass), t(this).addClass(i.focusClass), i.options.showAndHide) { var n = t('li[data-unique="' + t(this).attr('data-unique') + '"]'); i._triggerShow(n) }i._scrollTo(t(this)) }), this.element.find('li').on({'mouseenter.tocify': function () { t(this).addClass(i.hoverClass), t(this).css('cursor', 'pointer') }, 'mouseleave.tocify': function () { i.options.theme !== 'bootstrap' && t(this).removeClass(i.hoverClass) }}), t(e).on('resize', function () { i.calculateHeights() }), t(e).on('scroll.tocify', function () { t('html, body').promise().done(function () { var a, o, u, s, c = t(e).scrollTop(), l = t(e).height(), h = t(n).height(), f = t('body')[0].scrollHeight; if (i.options.extendPage && (i.webkit && c >= f - l - i.options.extendPageOffset || !i.webkit && l + c > h - i.options.extendPageOffset) && !t(g).length) { if (o = t('div[data-unique="' + t(d).last().attr('data-unique') + '"]'), !o.length) return; u = o.offset().top, t(i.options.context).append(t('<div />', {'class': p, height: Math.abs(u - c) + 'px', 'data-unique': p})), i.extendPageScroll && (s = i.element.find('li.active'), i._scrollTo(t('div[data-unique=' + s.attr('data-unique') + ']'))) }setTimeout(function () { var o, u = null; i.cachedHeights.length == 0 && i.calculateHeights(); var s = t(e).scrollTop(); if (i.cachedAnchors.each(function (t) { return i.cachedHeights[t] - s < 0 ? void (u = t) : !1 }), o = t(i.cachedAnchors[u]).attr('data-unique'), a = t('li[data-unique="' + o + '"]'), i.options.highlightOnScroll && a.length && !a.hasClass(i.focusClass)) { i.element.find('.' + i.focusClass).removeClass(i.focusClass), a.addClass(i.focusClass); var c = i.tocifyWrapper, l = t(a).closest('.tocify-header'), h = l.offset().top, f = c.offset().top, d = h - f; if (d >= t(e).height()) { var p = d + c.scrollTop(); c.scrollTop(p) } else d < 0 && c.scrollTop(0) }i.options.scrollHistory && e.location.hash !== '#' + o && o !== r && (history.replaceState ? history.replaceState({}, '', '#' + o) : (scrollV = n.body.scrollTop, scrollH = n.body.scrollLeft, location.hash = '#' + o, n.body.scrollTop = scrollV, n.body.scrollLeft = scrollH)), i.options.showAndHideOnScroll && i.options.showAndHide && i._triggerShow(a, !0) }, 0) }) }) }, calculateHeights: function () { var e = this; e.cachedHeights = [], e.cachedAnchors = []; var n = t(e.options.context).find('div[data-unique]'); n.each(function (n) { var r = (t(this).next().length ? t(this).next() : t(this)).offset().top - e.options.highlightOffset; e.cachedHeights[n] = r }), e.cachedAnchors = n }, show: function (e) { var n = this; if (!e.is(':visible')) switch (e.find(h).length || e.parent().is(c) || e.parent().is(':visible') ? e.children(h).length || e.parent().is(c) || (e = e.closest(h)) : e = e.parents(h).add(e), n.options.showEffect) { case 'none':e.show(); break; case 'show':e.show(n.options.showEffectSpeed); break; case 'slideDown':e.slideDown(n.options.showEffectSpeed); break; case 'fadeIn':e.fadeIn(n.options.showEffectSpeed); break; default:e.show() } return n.hide(t(h).not(e.parent().is(c) ? e : e.closest(c).find(h).not(e.siblings()))), n }, hide: function (t) { var e = this; switch (e.options.hideEffect) { case 'none':t.hide(); break; case 'hide':t.hide(e.options.hideEffectSpeed); break; case 'slideUp':t.slideUp(e.options.hideEffectSpeed); break; case 'fadeOut':t.fadeOut(e.options.hideEffectSpeed); break; default:t.hide() } return e }, _triggerShow: function (t, e) { var n = this; return t.parent().is(c) || t.next().is(h) ? n.show(t.next(h), e) : t.parent().is(h) && n.show(t.parent(), e), n }, _addCSSClasses: function () { return this.options.theme === 'jqueryui' ? (this.focusClass = 'ui-state-default', this.hoverClass = 'ui-state-hover', this.element.addClass('ui-widget').find('.toc-title').addClass('ui-widget-header').end().find('li').addClass('ui-widget-content')) : this.options.theme === 'bootstrap' ? (this.element.find(c + ',' + h).addClass('nav nav-list'), this.focusClass = 'active') : (this.focusClass = a, this.hoverClass = o), this }, setOption: function () { t.Widget.prototype._setOption.apply(this, arguments) }, setOptions: function () { t.Widget.prototype._setOptions.apply(this, arguments) }, _scrollTo: function (e) { var n = this, r = n.options.smoothScroll || 0, i = n.options.scrollTo; return t('html, body').promise().done(function () { t('html, body').animate({scrollTop: t('div[data-unique="' + e.attr('data-unique') + '"]').next().offset().top - (t.isFunction(i) ? i.call() : i) + 'px'}, {duration: r}) }), n }}) })), /*!
* imagesLoaded PACKAGED v3.1.8
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
(function () { function t () {} function e (t, e) { for (var n = t.length; n--;) if (t[n].listener === e) return n; return -1 } function n (t) { return function () { return this[t].apply(this, arguments) } } var r = t.prototype, i = this, a = i.EventEmitter; r.getListeners = function (t) { var e, n, r = this._getEvents(); if (typeof t === 'object') { e = {}; for (n in r)r.hasOwnProperty(n) && t.test(n) && (e[n] = r[n]) } else e = r[t] || (r[t] = []); return e }, r.flattenListeners = function (t) { var e, n = []; for (e = 0; t.length > e; e += 1)n.push(t[e].listener); return n }, r.getListenersAsObject = function (t) { var e, n = this.getListeners(t); return n instanceof Array && (e = {}, e[t] = n), e || n }, r.addListener = function (t, n) { var r, i = this.getListenersAsObject(t), a = typeof n === 'object'; for (r in i)i.hasOwnProperty(r) && e(i[r], n) === -1 && i[r].push(a ? n : {listener: n, once: !1}); return this }, r.on = n('addListener'), r.addOnceListener = function (t, e) { return this.addListener(t, {listener: e, once: !0}) }, r.once = n('addOnceListener'), r.defineEvent = function (t) { return this.getListeners(t), this }, r.defineEvents = function (t) { for (var e = 0; t.length > e; e += 1) this.defineEvent(t[e]); return this }, r.removeListener = function (t, n) { var r, i, a = this.getListenersAsObject(t); for (i in a)a.hasOwnProperty(i) && (r = e(a[i], n), r !== -1 && a[i].splice(r, 1)); return this }, r.off = n('removeListener'), r.addListeners = function (t, e) { return this.manipulateListeners(!1, t, e) }, r.removeListeners = function (t, e) { return this.manipulateListeners(!0, t, e) }, r.manipulateListeners = function (t, e, n) { var r, i, a = t ? this.removeListener : this.addListener, o = t ? this.removeListeners : this.addListeners; if (typeof e !== 'object' || e instanceof RegExp) for (r = n.length; r--;)a.call(this, e, n[r]); else for (r in e)e.hasOwnProperty(r) && (i = e[r]) && (typeof i === 'function' ? a.call(this, r, i) : o.call(this, r, i)); return this }, r.removeEvent = function (t) { var e, n = typeof t, r = this._getEvents(); if (n === 'string') delete r[t]; else if (n === 'object') for (e in r)r.hasOwnProperty(e) && t.test(e) && delete r[e]; else delete this._events; return this }, r.removeAllListeners = n('removeEvent'), r.emitEvent = function (t, e) { var n, r, i, a, o = this.getListenersAsObject(t); for (i in o) if (o.hasOwnProperty(i)) for (r = o[i].length; r--;)n = o[i][r], n.once === !0 && this.removeListener(t, n.listener), a = n.listener.apply(this, e || []), a === this._getOnceReturnValue() && this.removeListener(t, n.listener); return this }, r.trigger = n('emitEvent'), r.emit = function (t) { var e = Array.prototype.slice.call(arguments, 1); return this.emitEvent(t, e) }, r.setOnceReturnValue = function (t) { return this._onceReturnValue = t, this }, r._getOnceReturnValue = function () { return this.hasOwnProperty('_onceReturnValue') ? this._onceReturnValue : !0 }, r._getEvents = function () { return this._events || (this._events = {}) }, t.noConflict = function () { return i.EventEmitter = a, t }, typeof define === 'function' && define.amd ? define('eventEmitter/EventEmitter', [], function () { return t }) : typeof module === 'object' && module.exports ? module.exports = t : this.EventEmitter = t }.call(this)), (function (t) { function e (e) { var n = t.event; return n.target = n.target || n.srcElement || e, n } var n = document.documentElement, r = function () {}; n.addEventListener ? r = function (t, e, n) { t.addEventListener(e, n, !1) } : n.attachEvent && (r = function (t, n, r) { t[n + r] = r.handleEvent ? function () { var n = e(t); r.handleEvent.call(r, n) } : function () { var n = e(t); r.call(t, n) }, t.attachEvent('on' + n, t[n + r]) }); var i = function () {}; n.removeEventListener ? i = function (t, e, n) { t.removeEventListener(e, n, !1) } : n.detachEvent && (i = function (t, e, n) { t.detachEvent('on' + e, t[e + n]); try { delete t[e + n] } catch (r) { t[e + n] = void 0 } }); var a = {bind: r, unbind: i}; typeof define === 'function' && define.amd ? define('eventie/eventie', a) : t.eventie = a }(this)), (function (t, e) { typeof define === 'function' && define.amd ? define(['eventEmitter/EventEmitter', 'eventie/eventie'], function (n, r) { return e(t, n, r) }) : typeof exports === 'object' ? module.exports = e(t, require('wolfy87-eventemitter'), require('eventie')) : t.imagesLoaded = e(t, t.EventEmitter, t.eventie) }(window, function (t, e, n) { function r (t, e) { for (var n in e)t[n] = e[n]; return t } function i (t) { return f.call(t) === '[object Array]' } function a (t) { var e = []; if (i(t))e = t; else if (typeof t.length === 'number') for (var n = 0, r = t.length; r > n; n++)e.push(t[n]); else e.push(t); return e } function o (t, e, n) { if (!(this instanceof o)) return new o(t, e); typeof t === 'string' && (t = document.querySelectorAll(t)), this.elements = a(t), this.options = r({}, this.options), typeof e === 'function' ? n = e : r(this.options, e), n && this.on('always', n), this.getImages(), c && (this.jqDeferred = new c.Deferred()); var i = this; setTimeout(function () { i.check() }) } function u (t) { this.img = t } function s (t) { this.src = t, d[t] = this } var c = t.jQuery, l = t.console, h = void 0 !== l, f = Object.prototype.toString; o.prototype = new e(), o.prototype.options = {}, o.prototype.getImages = function () { this.images = []; for (var t = 0, e = this.elements.length; e > t; t++) { var n = this.elements[t]; n.nodeName === 'IMG' && this.addImage(n); var r = n.nodeType; if (r && (r === 1 || r === 9 || r === 11)) for (var i = n.querySelectorAll('img'), a = 0, o = i.length; o > a; a++) { var u = i[a]; this.addImage(u) } } }, o.prototype.addImage = function (t) { var e = new u(t); this.images.push(e) }, o.prototype.check = function () { function t (t, i) { return e.options.debug && h && l.log('confirm', t, i), e.progress(t), n++, n === r && e.complete(), !0 } var e = this, n = 0, r = this.images.length; if (this.hasAnyBroken = !1, !r) return void this.complete(); for (var i = 0; r > i; i++) { var a = this.images[i]; a.on('confirm', t), a.check() } }, o.prototype.progress = function (t) { this.hasAnyBroken = this.hasAnyBroken || !t.isLoaded; var e = this; setTimeout(function () { e.emit('progress', e, t), e.jqDeferred && e.jqDeferred.notify && e.jqDeferred.notify(e, t) }) }, o.prototype.complete = function () { var t = this.hasAnyBroken ? 'fail' : 'done'; this.isComplete = !0; var e = this; setTimeout(function () { if (e.emit(t, e), e.emit('always', e), e.jqDeferred) { var n = e.hasAnyBroken ? 'reject' : 'resolve'; e.jqDeferred[n](e) } }) }, c && (c.fn.imagesLoaded = function (t, e) { var n = new o(this, t, e); return n.jqDeferred.promise(c(this)) }), u.prototype = new e(), u.prototype.check = function () { var t = d[this.img.src] || new s(this.img.src); if (t.isConfirmed) return void this.confirm(t.isLoaded, 'cached was confirmed'); if (this.img.complete && void 0 !== this.img.naturalWidth) return void this.confirm(this.img.naturalWidth !== 0, 'naturalWidth'); var e = this; t.on('confirm', function (t, n) { return e.confirm(t.isLoaded, n), !0 }), t.check() }, u.prototype.confirm = function (t, e) { this.isLoaded = t, this.emit('confirm', this, e) }; var d = {}; return s.prototype = new e(), s.prototype.check = function () { if (!this.isChecked) { var t = new Image(); n.bind(t, 'load', this), n.bind(t, 'error', this), t.src = this.src, this.isChecked = !0 } }, s.prototype.handleEvent = function (t) { var e = 'on' + t.type; this[e] && this[e](t) }, s.prototype.onload = function (t) { this.confirm(!0, 'onload'), this.unbindProxyEvents(t) }, s.prototype.onerror = function (t) { this.confirm(!1, 'onerror'), this.unbindProxyEvents(t) }, s.prototype.confirm = function (t, e) { this.isConfirmed = !0, this.isLoaded = t, this.emit('confirm', this, e) }, s.prototype.unbindProxyEvents = function (t) { n.unbind(t.target, 'load', this), n.unbind(t.target, 'error', this) }, o })), (function (t) { 'use strict'; function e () { setTimeout(function () { toc.setOption('showEffectSpeed', 180) }, 50) } var n = function () { $('.tocify-wrapper').removeClass('open'), $('#nav-button').removeClass('open') }, r = function () { t.toc = $('#toc').tocify({selectors: 'h1, h2', extendPage: !1, theme: 'none', smoothScroll: !1, showEffectSpeed: 0, hideEffectSpeed: 180, ignoreSelector: '.toc-ignore', highlightOffset: 60, scrollTo: -1, scrollHistory: !0, hashGenerator: function (t, e) { return e.prop('id') }}).data('toc-tocify'), $('#nav-button').click(function () { return $('.tocify-wrapper').toggleClass('open'), $('#nav-button').toggleClass('open'), !1 }), $('.page-wrapper').click(n), $('.tocify-item').click(n) }; $(function () { r(), e(), $('.content').imagesLoaded(function () { t.toc.calculateHeights() }) }) }(window))