bootstrap.js 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583
  1. /*!
  2. * Generated using the Bootstrap Customizer (https://v3.bootcss.com/customize/)
  3. */
  4. /*!
  5. * Bootstrap v3.4.1 (https://getbootstrap.com/)
  6. * Copyright 2011-2021 Twitter, Inc.
  7. * Licensed under the MIT license
  8. */
  9. if (typeof jQuery === 'undefined') {
  10. throw new Error('Bootstrap\'s JavaScript requires jQuery')
  11. }
  12. +function ($) {
  13. 'use strict';
  14. var version = $.fn.jquery.split(' ')[0].split('.')
  15. if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
  16. throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
  17. }
  18. }(jQuery);
  19. /* ========================================================================
  20. * Bootstrap: alert.js v3.4.1
  21. * https://getbootstrap.com/docs/3.4/javascript/#alerts
  22. * ========================================================================
  23. * Copyright 2011-2019 Twitter, Inc.
  24. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  25. * ======================================================================== */
  26. +function ($) {
  27. 'use strict';
  28. // ALERT CLASS DEFINITION
  29. // ======================
  30. var dismiss = '[data-dismiss="alert"]'
  31. var Alert = function (el) {
  32. $(el).on('click', dismiss, this.close)
  33. }
  34. Alert.VERSION = '3.4.1'
  35. Alert.TRANSITION_DURATION = 150
  36. Alert.prototype.close = function (e) {
  37. var $this = $(this)
  38. var selector = $this.attr('data-target')
  39. if (!selector) {
  40. selector = $this.attr('href')
  41. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  42. }
  43. selector = selector === '#' ? [] : selector
  44. var $parent = $(document).find(selector)
  45. if (e) e.preventDefault()
  46. if (!$parent.length) {
  47. $parent = $this.closest('.alert')
  48. }
  49. $parent.trigger(e = $.Event('close.bs.alert'))
  50. if (e.isDefaultPrevented()) return
  51. $parent.removeClass('in')
  52. function removeElement() {
  53. // detach from parent, fire event then clean up data
  54. $parent.detach().trigger('closed.bs.alert').remove()
  55. }
  56. $.support.transition && $parent.hasClass('fade') ?
  57. $parent
  58. .one('bsTransitionEnd', removeElement)
  59. .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
  60. removeElement()
  61. }
  62. // ALERT PLUGIN DEFINITION
  63. // =======================
  64. function Plugin(option) {
  65. return this.each(function () {
  66. var $this = $(this)
  67. var data = $this.data('bs.alert')
  68. if (!data) $this.data('bs.alert', (data = new Alert(this)))
  69. if (typeof option == 'string') data[option].call($this)
  70. })
  71. }
  72. var old = $.fn.alert
  73. $.fn.alert = Plugin
  74. $.fn.alert.Constructor = Alert
  75. // ALERT NO CONFLICT
  76. // =================
  77. $.fn.alert.noConflict = function () {
  78. $.fn.alert = old
  79. return this
  80. }
  81. // ALERT DATA-API
  82. // ==============
  83. $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
  84. }(jQuery);
  85. /* ========================================================================
  86. * Bootstrap: button.js v3.4.1
  87. * https://getbootstrap.com/docs/3.4/javascript/#buttons
  88. * ========================================================================
  89. * Copyright 2011-2019 Twitter, Inc.
  90. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  91. * ======================================================================== */
  92. +function ($) {
  93. 'use strict';
  94. // BUTTON PUBLIC CLASS DEFINITION
  95. // ==============================
  96. var Button = function (element, options) {
  97. this.$element = $(element)
  98. this.options = $.extend({}, Button.DEFAULTS, options)
  99. this.isLoading = false
  100. }
  101. Button.VERSION = '3.4.1'
  102. Button.DEFAULTS = {
  103. loadingText: 'loading...'
  104. }
  105. Button.prototype.setState = function (state) {
  106. var d = 'disabled'
  107. var $el = this.$element
  108. var val = $el.is('input') ? 'val' : 'html'
  109. var data = $el.data()
  110. state += 'Text'
  111. if (data.resetText == null) $el.data('resetText', $el[val]())
  112. // push to event loop to allow forms to submit
  113. setTimeout($.proxy(function () {
  114. $el[val](data[state] == null ? this.options[state] : data[state])
  115. if (state == 'loadingText') {
  116. this.isLoading = true
  117. $el.addClass(d).attr(d, d).prop(d, true)
  118. } else if (this.isLoading) {
  119. this.isLoading = false
  120. $el.removeClass(d).removeAttr(d).prop(d, false)
  121. }
  122. }, this), 0)
  123. }
  124. Button.prototype.toggle = function () {
  125. var changed = true
  126. var $parent = this.$element.closest('[data-toggle="buttons"]')
  127. if ($parent.length) {
  128. var $input = this.$element.find('input')
  129. if ($input.prop('type') == 'radio') {
  130. if ($input.prop('checked')) changed = false
  131. $parent.find('.active').removeClass('active')
  132. this.$element.addClass('active')
  133. } else if ($input.prop('type') == 'checkbox') {
  134. if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
  135. this.$element.toggleClass('active')
  136. }
  137. $input.prop('checked', this.$element.hasClass('active'))
  138. if (changed) $input.trigger('change')
  139. } else {
  140. this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
  141. this.$element.toggleClass('active')
  142. }
  143. }
  144. // BUTTON PLUGIN DEFINITION
  145. // ========================
  146. function Plugin(option) {
  147. return this.each(function () {
  148. var $this = $(this)
  149. var data = $this.data('bs.button')
  150. var options = typeof option == 'object' && option
  151. if (!data) $this.data('bs.button', (data = new Button(this, options)))
  152. if (option == 'toggle') data.toggle()
  153. else if (option) data.setState(option)
  154. })
  155. }
  156. var old = $.fn.button
  157. $.fn.button = Plugin
  158. $.fn.button.Constructor = Button
  159. // BUTTON NO CONFLICT
  160. // ==================
  161. $.fn.button.noConflict = function () {
  162. $.fn.button = old
  163. return this
  164. }
  165. // BUTTON DATA-API
  166. // ===============
  167. $(document)
  168. .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
  169. var $btn = $(e.target).closest('.btn')
  170. Plugin.call($btn, 'toggle')
  171. if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
  172. // Prevent double click on radios, and the double selections (so cancellation) on checkboxes
  173. e.preventDefault()
  174. // The target component still receive the focus
  175. if ($btn.is('input,button')) $btn.trigger('focus')
  176. else $btn.find('input:visible,button:visible').first().trigger('focus')
  177. }
  178. })
  179. .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
  180. $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
  181. })
  182. }(jQuery);
  183. /* ========================================================================
  184. * Bootstrap: carousel.js v3.4.1
  185. * https://getbootstrap.com/docs/3.4/javascript/#carousel
  186. * ========================================================================
  187. * Copyright 2011-2019 Twitter, Inc.
  188. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  189. * ======================================================================== */
  190. +function ($) {
  191. 'use strict';
  192. // CAROUSEL CLASS DEFINITION
  193. // =========================
  194. var Carousel = function (element, options) {
  195. this.$element = $(element)
  196. this.$indicators = this.$element.find('.carousel-indicators')
  197. this.options = options
  198. this.paused = null
  199. this.sliding = null
  200. this.interval = null
  201. this.$active = null
  202. this.$items = null
  203. this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
  204. this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
  205. .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
  206. .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
  207. }
  208. Carousel.VERSION = '3.4.1'
  209. Carousel.TRANSITION_DURATION = 600
  210. Carousel.DEFAULTS = {
  211. interval: 5000,
  212. pause: 'hover',
  213. wrap: true,
  214. keyboard: true
  215. }
  216. Carousel.prototype.keydown = function (e) {
  217. if (/input|textarea/i.test(e.target.tagName)) return
  218. switch (e.which) {
  219. case 37: this.prev(); break
  220. case 39: this.next(); break
  221. default: return
  222. }
  223. e.preventDefault()
  224. }
  225. Carousel.prototype.cycle = function (e) {
  226. e || (this.paused = false)
  227. this.interval && clearInterval(this.interval)
  228. this.options.interval
  229. && !this.paused
  230. && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
  231. return this
  232. }
  233. Carousel.prototype.getItemIndex = function (item) {
  234. this.$items = item.parent().children('.item')
  235. return this.$items.index(item || this.$active)
  236. }
  237. Carousel.prototype.getItemForDirection = function (direction, active) {
  238. var activeIndex = this.getItemIndex(active)
  239. var willWrap = (direction == 'prev' && activeIndex === 0)
  240. || (direction == 'next' && activeIndex == (this.$items.length - 1))
  241. if (willWrap && !this.options.wrap) return active
  242. var delta = direction == 'prev' ? -1 : 1
  243. var itemIndex = (activeIndex + delta) % this.$items.length
  244. return this.$items.eq(itemIndex)
  245. }
  246. Carousel.prototype.to = function (pos) {
  247. var that = this
  248. var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
  249. if (pos > (this.$items.length - 1) || pos < 0) return
  250. if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
  251. if (activeIndex == pos) return this.pause().cycle()
  252. return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
  253. }
  254. Carousel.prototype.pause = function (e) {
  255. e || (this.paused = true)
  256. if (this.$element.find('.next, .prev').length && $.support.transition) {
  257. this.$element.trigger($.support.transition.end)
  258. this.cycle(true)
  259. }
  260. this.interval = clearInterval(this.interval)
  261. return this
  262. }
  263. Carousel.prototype.next = function () {
  264. if (this.sliding) return
  265. return this.slide('next')
  266. }
  267. Carousel.prototype.prev = function () {
  268. if (this.sliding) return
  269. return this.slide('prev')
  270. }
  271. Carousel.prototype.slide = function (type, next) {
  272. var $active = this.$element.find('.item.active')
  273. var $next = next || this.getItemForDirection(type, $active)
  274. var isCycling = this.interval
  275. var direction = type == 'next' ? 'left' : 'right'
  276. var that = this
  277. if ($next.hasClass('active')) return (this.sliding = false)
  278. var relatedTarget = $next[0]
  279. var slideEvent = $.Event('slide.bs.carousel', {
  280. relatedTarget: relatedTarget,
  281. direction: direction
  282. })
  283. this.$element.trigger(slideEvent)
  284. if (slideEvent.isDefaultPrevented()) return
  285. this.sliding = true
  286. isCycling && this.pause()
  287. if (this.$indicators.length) {
  288. this.$indicators.find('.active').removeClass('active')
  289. var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
  290. $nextIndicator && $nextIndicator.addClass('active')
  291. }
  292. var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
  293. if ($.support.transition && this.$element.hasClass('slide')) {
  294. $next.addClass(type)
  295. if (typeof $next === 'object' && $next.length) {
  296. $next[0].offsetWidth // force reflow
  297. }
  298. $active.addClass(direction)
  299. $next.addClass(direction)
  300. $active
  301. .one('bsTransitionEnd', function () {
  302. $next.removeClass([type, direction].join(' ')).addClass('active')
  303. $active.removeClass(['active', direction].join(' '))
  304. that.sliding = false
  305. setTimeout(function () {
  306. that.$element.trigger(slidEvent)
  307. }, 0)
  308. })
  309. .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
  310. } else {
  311. $active.removeClass('active')
  312. $next.addClass('active')
  313. this.sliding = false
  314. this.$element.trigger(slidEvent)
  315. }
  316. isCycling && this.cycle()
  317. return this
  318. }
  319. // CAROUSEL PLUGIN DEFINITION
  320. // ==========================
  321. function Plugin(option) {
  322. return this.each(function () {
  323. var $this = $(this)
  324. var data = $this.data('bs.carousel')
  325. var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
  326. var action = typeof option == 'string' ? option : options.slide
  327. if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
  328. if (typeof option == 'number') data.to(option)
  329. else if (action) data[action]()
  330. else if (options.interval) data.pause().cycle()
  331. })
  332. }
  333. var old = $.fn.carousel
  334. $.fn.carousel = Plugin
  335. $.fn.carousel.Constructor = Carousel
  336. // CAROUSEL NO CONFLICT
  337. // ====================
  338. $.fn.carousel.noConflict = function () {
  339. $.fn.carousel = old
  340. return this
  341. }
  342. // CAROUSEL DATA-API
  343. // =================
  344. var clickHandler = function (e) {
  345. var $this = $(this)
  346. var href = $this.attr('href')
  347. if (href) {
  348. href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
  349. }
  350. var target = $this.attr('data-target') || href
  351. var $target = $(document).find(target)
  352. if (!$target.hasClass('carousel')) return
  353. var options = $.extend({}, $target.data(), $this.data())
  354. var slideIndex = $this.attr('data-slide-to')
  355. if (slideIndex) options.interval = false
  356. Plugin.call($target, options)
  357. if (slideIndex) {
  358. $target.data('bs.carousel').to(slideIndex)
  359. }
  360. e.preventDefault()
  361. }
  362. $(document)
  363. .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
  364. .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
  365. $(window).on('load', function () {
  366. $('[data-ride="carousel"]').each(function () {
  367. var $carousel = $(this)
  368. Plugin.call($carousel, $carousel.data())
  369. })
  370. })
  371. }(jQuery);
  372. /* ========================================================================
  373. * Bootstrap: dropdown.js v3.4.1
  374. * https://getbootstrap.com/docs/3.4/javascript/#dropdowns
  375. * ========================================================================
  376. * Copyright 2011-2019 Twitter, Inc.
  377. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  378. * ======================================================================== */
  379. +function ($) {
  380. 'use strict';
  381. // DROPDOWN CLASS DEFINITION
  382. // =========================
  383. var backdrop = '.dropdown-backdrop'
  384. var toggle = '[data-toggle="dropdown"]'
  385. var Dropdown = function (element) {
  386. $(element).on('click.bs.dropdown', this.toggle)
  387. }
  388. Dropdown.VERSION = '3.4.1'
  389. function getParent($this) {
  390. var selector = $this.attr('data-target')
  391. if (!selector) {
  392. selector = $this.attr('href')
  393. selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  394. }
  395. var $parent = selector !== '#' ? $(document).find(selector) : null
  396. return $parent && $parent.length ? $parent : $this.parent()
  397. }
  398. function clearMenus(e) {
  399. if (e && e.which === 3) return
  400. $(backdrop).remove()
  401. $(toggle).each(function () {
  402. var $this = $(this)
  403. var $parent = getParent($this)
  404. var relatedTarget = { relatedTarget: this }
  405. if (!$parent.hasClass('open')) return
  406. if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
  407. $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
  408. if (e.isDefaultPrevented()) return
  409. $this.attr('aria-expanded', 'false')
  410. $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
  411. })
  412. }
  413. Dropdown.prototype.toggle = function (e) {
  414. var $this = $(this)
  415. if ($this.is('.disabled, :disabled')) return
  416. var $parent = getParent($this)
  417. var isActive = $parent.hasClass('open')
  418. clearMenus()
  419. if (!isActive) {
  420. if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
  421. // if mobile we use a backdrop because click events don't delegate
  422. $(document.createElement('div'))
  423. .addClass('dropdown-backdrop')
  424. .insertAfter($(this))
  425. .on('click', clearMenus)
  426. }
  427. var relatedTarget = { relatedTarget: this }
  428. $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
  429. if (e.isDefaultPrevented()) return
  430. $this
  431. .trigger('focus')
  432. .attr('aria-expanded', 'true')
  433. $parent
  434. .toggleClass('open')
  435. .trigger($.Event('shown.bs.dropdown', relatedTarget))
  436. }
  437. return false
  438. }
  439. Dropdown.prototype.keydown = function (e) {
  440. if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
  441. var $this = $(this)
  442. e.preventDefault()
  443. e.stopPropagation()
  444. if ($this.is('.disabled, :disabled')) return
  445. var $parent = getParent($this)
  446. var isActive = $parent.hasClass('open')
  447. if (!isActive && e.which != 27 || isActive && e.which == 27) {
  448. if (e.which == 27) $parent.find(toggle).trigger('focus')
  449. return $this.trigger('click')
  450. }
  451. var desc = ' li:not(.disabled):visible a'
  452. var $items = $parent.find('.dropdown-menu' + desc)
  453. if (!$items.length) return
  454. var index = $items.index(e.target)
  455. if (e.which == 38 && index > 0) index-- // up
  456. if (e.which == 40 && index < $items.length - 1) index++ // down
  457. if (!~index) index = 0
  458. $items.eq(index).trigger('focus')
  459. }
  460. // DROPDOWN PLUGIN DEFINITION
  461. // ==========================
  462. function Plugin(option) {
  463. return this.each(function () {
  464. var $this = $(this)
  465. var data = $this.data('bs.dropdown')
  466. if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
  467. if (typeof option == 'string') data[option].call($this)
  468. })
  469. }
  470. var old = $.fn.dropdown
  471. $.fn.dropdown = Plugin
  472. $.fn.dropdown.Constructor = Dropdown
  473. // DROPDOWN NO CONFLICT
  474. // ====================
  475. $.fn.dropdown.noConflict = function () {
  476. $.fn.dropdown = old
  477. return this
  478. }
  479. // APPLY TO STANDARD DROPDOWN ELEMENTS
  480. // ===================================
  481. $(document)
  482. .on('click.bs.dropdown.data-api', clearMenus)
  483. .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
  484. .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
  485. .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
  486. .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
  487. }(jQuery);
  488. /* ========================================================================
  489. * Bootstrap: modal.js v3.4.1
  490. * https://getbootstrap.com/docs/3.4/javascript/#modals
  491. * ========================================================================
  492. * Copyright 2011-2019 Twitter, Inc.
  493. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  494. * ======================================================================== */
  495. +function ($) {
  496. 'use strict';
  497. // MODAL CLASS DEFINITION
  498. // ======================
  499. var Modal = function (element, options) {
  500. this.options = options
  501. this.$body = $(document.body)
  502. this.$element = $(element)
  503. this.$dialog = this.$element.find('.modal-dialog')
  504. this.$backdrop = null
  505. this.isShown = null
  506. this.originalBodyPad = null
  507. this.scrollbarWidth = 0
  508. this.ignoreBackdropClick = false
  509. this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom'
  510. if (this.options.remote) {
  511. this.$element
  512. .find('.modal-content')
  513. .load(this.options.remote, $.proxy(function () {
  514. this.$element.trigger('loaded.bs.modal')
  515. }, this))
  516. }
  517. }
  518. Modal.VERSION = '3.4.1'
  519. Modal.TRANSITION_DURATION = 300
  520. Modal.BACKDROP_TRANSITION_DURATION = 150
  521. Modal.DEFAULTS = {
  522. backdrop: true,
  523. keyboard: true,
  524. show: true
  525. }
  526. Modal.prototype.toggle = function (_relatedTarget) {
  527. return this.isShown ? this.hide() : this.show(_relatedTarget)
  528. }
  529. Modal.prototype.show = function (_relatedTarget) {
  530. var that = this
  531. var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
  532. this.$element.trigger(e)
  533. if (this.isShown || e.isDefaultPrevented()) return
  534. this.isShown = true
  535. this.checkScrollbar()
  536. this.setScrollbar()
  537. this.$body.addClass('modal-open')
  538. this.escape()
  539. this.resize()
  540. this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
  541. this.$dialog.on('mousedown.dismiss.bs.modal', function () {
  542. that.$element.one('mouseup.dismiss.bs.modal', function (e) {
  543. if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
  544. })
  545. })
  546. this.backdrop(function () {
  547. var transition = $.support.transition && that.$element.hasClass('fade')
  548. if (!that.$element.parent().length) {
  549. that.$element.appendTo(that.$body) // don't move modals dom position
  550. }
  551. that.$element
  552. .show()
  553. .scrollTop(0)
  554. that.adjustDialog()
  555. if (transition) {
  556. that.$element[0].offsetWidth // force reflow
  557. }
  558. that.$element.addClass('in')
  559. that.enforceFocus()
  560. var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
  561. transition ?
  562. that.$dialog // wait for modal to slide in
  563. .one('bsTransitionEnd', function () {
  564. that.$element.trigger('focus').trigger(e)
  565. })
  566. .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
  567. that.$element.trigger('focus').trigger(e)
  568. })
  569. }
  570. Modal.prototype.hide = function (e) {
  571. if (e) e.preventDefault()
  572. e = $.Event('hide.bs.modal')
  573. this.$element.trigger(e)
  574. if (!this.isShown || e.isDefaultPrevented()) return
  575. this.isShown = false
  576. this.escape()
  577. this.resize()
  578. $(document).off('focusin.bs.modal')
  579. this.$element
  580. .removeClass('in')
  581. .off('click.dismiss.bs.modal')
  582. .off('mouseup.dismiss.bs.modal')
  583. this.$dialog.off('mousedown.dismiss.bs.modal')
  584. $.support.transition && this.$element.hasClass('fade') ?
  585. this.$element
  586. .one('bsTransitionEnd', $.proxy(this.hideModal, this))
  587. .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
  588. this.hideModal()
  589. }
  590. Modal.prototype.enforceFocus = function () {
  591. $(document)
  592. .off('focusin.bs.modal') // guard against infinite focus loop
  593. .on('focusin.bs.modal', $.proxy(function (e) {
  594. if (document !== e.target &&
  595. this.$element[0] !== e.target &&
  596. !this.$element.has(e.target).length) {
  597. this.$element.trigger('focus')
  598. }
  599. }, this))
  600. }
  601. Modal.prototype.escape = function () {
  602. if (this.isShown && this.options.keyboard) {
  603. this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
  604. e.which == 27 && this.hide()
  605. }, this))
  606. } else if (!this.isShown) {
  607. this.$element.off('keydown.dismiss.bs.modal')
  608. }
  609. }
  610. Modal.prototype.resize = function () {
  611. if (this.isShown) {
  612. $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
  613. } else {
  614. $(window).off('resize.bs.modal')
  615. }
  616. }
  617. Modal.prototype.hideModal = function () {
  618. var that = this
  619. this.$element.hide()
  620. this.backdrop(function () {
  621. that.$body.removeClass('modal-open')
  622. that.resetAdjustments()
  623. that.resetScrollbar()
  624. that.$element.trigger('hidden.bs.modal')
  625. })
  626. }
  627. Modal.prototype.removeBackdrop = function () {
  628. this.$backdrop && this.$backdrop.remove()
  629. this.$backdrop = null
  630. }
  631. Modal.prototype.backdrop = function (callback) {
  632. var that = this
  633. var animate = this.$element.hasClass('fade') ? 'fade' : ''
  634. if (this.isShown && this.options.backdrop) {
  635. var doAnimate = $.support.transition && animate
  636. this.$backdrop = $(document.createElement('div'))
  637. .addClass('modal-backdrop ' + animate)
  638. .appendTo(this.$body)
  639. this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
  640. if (this.ignoreBackdropClick) {
  641. this.ignoreBackdropClick = false
  642. return
  643. }
  644. if (e.target !== e.currentTarget) return
  645. this.options.backdrop == 'static'
  646. ? this.$element[0].focus()
  647. : this.hide()
  648. }, this))
  649. if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
  650. this.$backdrop.addClass('in')
  651. if (!callback) return
  652. doAnimate ?
  653. this.$backdrop
  654. .one('bsTransitionEnd', callback)
  655. .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
  656. callback()
  657. } else if (!this.isShown && this.$backdrop) {
  658. this.$backdrop.removeClass('in')
  659. var callbackRemove = function () {
  660. that.removeBackdrop()
  661. callback && callback()
  662. }
  663. $.support.transition && this.$element.hasClass('fade') ?
  664. this.$backdrop
  665. .one('bsTransitionEnd', callbackRemove)
  666. .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
  667. callbackRemove()
  668. } else if (callback) {
  669. callback()
  670. }
  671. }
  672. // these following methods are used to handle overflowing modals
  673. Modal.prototype.handleUpdate = function () {
  674. this.adjustDialog()
  675. }
  676. Modal.prototype.adjustDialog = function () {
  677. var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
  678. this.$element.css({
  679. paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
  680. paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
  681. })
  682. }
  683. Modal.prototype.resetAdjustments = function () {
  684. this.$element.css({
  685. paddingLeft: '',
  686. paddingRight: ''
  687. })
  688. }
  689. Modal.prototype.checkScrollbar = function () {
  690. var fullWindowWidth = window.innerWidth
  691. if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
  692. var documentElementRect = document.documentElement.getBoundingClientRect()
  693. fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
  694. }
  695. this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
  696. this.scrollbarWidth = this.measureScrollbar()
  697. }
  698. Modal.prototype.setScrollbar = function () {
  699. var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
  700. this.originalBodyPad = document.body.style.paddingRight || ''
  701. var scrollbarWidth = this.scrollbarWidth
  702. if (this.bodyIsOverflowing) {
  703. this.$body.css('padding-right', bodyPad + scrollbarWidth)
  704. $(this.fixedContent).each(function (index, element) {
  705. var actualPadding = element.style.paddingRight
  706. var calculatedPadding = $(element).css('padding-right')
  707. $(element)
  708. .data('padding-right', actualPadding)
  709. .css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px')
  710. })
  711. }
  712. }
  713. Modal.prototype.resetScrollbar = function () {
  714. this.$body.css('padding-right', this.originalBodyPad)
  715. $(this.fixedContent).each(function (index, element) {
  716. var padding = $(element).data('padding-right')
  717. $(element).removeData('padding-right')
  718. element.style.paddingRight = padding ? padding : ''
  719. })
  720. }
  721. Modal.prototype.measureScrollbar = function () { // thx walsh
  722. var scrollDiv = document.createElement('div')
  723. scrollDiv.className = 'modal-scrollbar-measure'
  724. this.$body.append(scrollDiv)
  725. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
  726. this.$body[0].removeChild(scrollDiv)
  727. return scrollbarWidth
  728. }
  729. // MODAL PLUGIN DEFINITION
  730. // =======================
  731. function Plugin(option, _relatedTarget) {
  732. return this.each(function () {
  733. var $this = $(this)
  734. var data = $this.data('bs.modal')
  735. var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
  736. if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
  737. if (typeof option == 'string') data[option](_relatedTarget)
  738. else if (options.show) data.show(_relatedTarget)
  739. })
  740. }
  741. var old = $.fn.modal
  742. $.fn.modal = Plugin
  743. $.fn.modal.Constructor = Modal
  744. // MODAL NO CONFLICT
  745. // =================
  746. $.fn.modal.noConflict = function () {
  747. $.fn.modal = old
  748. return this
  749. }
  750. // MODAL DATA-API
  751. // ==============
  752. $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
  753. var $this = $(this)
  754. var href = $this.attr('href')
  755. var target = $this.attr('data-target') ||
  756. (href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
  757. var $target = $(document).find(target)
  758. var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
  759. if ($this.is('a')) e.preventDefault()
  760. $target.one('show.bs.modal', function (showEvent) {
  761. if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
  762. $target.one('hidden.bs.modal', function () {
  763. $this.is(':visible') && $this.trigger('focus')
  764. })
  765. })
  766. Plugin.call($target, option, this)
  767. })
  768. }(jQuery);
  769. /* ========================================================================
  770. * Bootstrap: tooltip.js v3.4.1
  771. * https://getbootstrap.com/docs/3.4/javascript/#tooltip
  772. * Inspired by the original jQuery.tipsy by Jason Frame
  773. * ========================================================================
  774. * Copyright 2011-2019 Twitter, Inc.
  775. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  776. * ======================================================================== */
  777. +function ($) {
  778. 'use strict';
  779. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']
  780. var uriAttrs = [
  781. 'background',
  782. 'cite',
  783. 'href',
  784. 'itemtype',
  785. 'longdesc',
  786. 'poster',
  787. 'src',
  788. 'xlink:href'
  789. ]
  790. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
  791. var DefaultWhitelist = {
  792. // Global attributes allowed on any supplied element below.
  793. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  794. a: ['target', 'href', 'title', 'rel'],
  795. area: [],
  796. b: [],
  797. br: [],
  798. col: [],
  799. code: [],
  800. div: [],
  801. em: [],
  802. hr: [],
  803. h1: [],
  804. h2: [],
  805. h3: [],
  806. h4: [],
  807. h5: [],
  808. h6: [],
  809. i: [],
  810. img: ['src', 'alt', 'title', 'width', 'height'],
  811. li: [],
  812. ol: [],
  813. p: [],
  814. pre: [],
  815. s: [],
  816. small: [],
  817. span: [],
  818. sub: [],
  819. sup: [],
  820. strong: [],
  821. u: [],
  822. ul: []
  823. }
  824. /**
  825. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  826. *
  827. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  828. */
  829. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
  830. /**
  831. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  832. *
  833. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  834. */
  835. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
  836. function allowedAttribute(attr, allowedAttributeList) {
  837. var attrName = attr.nodeName.toLowerCase()
  838. if ($.inArray(attrName, allowedAttributeList) !== -1) {
  839. if ($.inArray(attrName, uriAttrs) !== -1) {
  840. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
  841. }
  842. return true
  843. }
  844. var regExp = $(allowedAttributeList).filter(function (index, value) {
  845. return value instanceof RegExp
  846. })
  847. // Check if a regular expression validates the attribute.
  848. for (var i = 0, l = regExp.length; i < l; i++) {
  849. if (attrName.match(regExp[i])) {
  850. return true
  851. }
  852. }
  853. return false
  854. }
  855. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  856. if (unsafeHtml.length === 0) {
  857. return unsafeHtml
  858. }
  859. if (sanitizeFn && typeof sanitizeFn === 'function') {
  860. return sanitizeFn(unsafeHtml)
  861. }
  862. // IE 8 and below don't support createHTMLDocument
  863. if (!document.implementation || !document.implementation.createHTMLDocument) {
  864. return unsafeHtml
  865. }
  866. var createdDocument = document.implementation.createHTMLDocument('sanitization')
  867. createdDocument.body.innerHTML = unsafeHtml
  868. var whitelistKeys = $.map(whiteList, function (el, i) { return i })
  869. var elements = $(createdDocument.body).find('*')
  870. for (var i = 0, len = elements.length; i < len; i++) {
  871. var el = elements[i]
  872. var elName = el.nodeName.toLowerCase()
  873. if ($.inArray(elName, whitelistKeys) === -1) {
  874. el.parentNode.removeChild(el)
  875. continue
  876. }
  877. var attributeList = $.map(el.attributes, function (el) { return el })
  878. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
  879. for (var j = 0, len2 = attributeList.length; j < len2; j++) {
  880. if (!allowedAttribute(attributeList[j], whitelistedAttributes)) {
  881. el.removeAttribute(attributeList[j].nodeName)
  882. }
  883. }
  884. }
  885. return createdDocument.body.innerHTML
  886. }
  887. // TOOLTIP PUBLIC CLASS DEFINITION
  888. // ===============================
  889. var Tooltip = function (element, options) {
  890. this.type = null
  891. this.options = null
  892. this.enabled = null
  893. this.timeout = null
  894. this.hoverState = null
  895. this.$element = null
  896. this.inState = null
  897. this.init('tooltip', element, options)
  898. }
  899. Tooltip.VERSION = '3.4.1'
  900. Tooltip.TRANSITION_DURATION = 150
  901. Tooltip.DEFAULTS = {
  902. animation: true,
  903. placement: 'top',
  904. selector: false,
  905. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  906. trigger: 'hover focus',
  907. title: '',
  908. delay: 0,
  909. html: false,
  910. container: false,
  911. viewport: {
  912. selector: 'body',
  913. padding: 0
  914. },
  915. sanitize : true,
  916. sanitizeFn : null,
  917. whiteList : DefaultWhitelist
  918. }
  919. Tooltip.prototype.init = function (type, element, options) {
  920. this.enabled = true
  921. this.type = type
  922. this.$element = $(element)
  923. this.options = this.getOptions(options)
  924. this.$viewport = this.options.viewport && $(document).find($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
  925. this.inState = { click: false, hover: false, focus: false }
  926. if (this.$element[0] instanceof document.constructor && !this.options.selector) {
  927. throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
  928. }
  929. var triggers = this.options.trigger.split(' ')
  930. for (var i = triggers.length; i--;) {
  931. var trigger = triggers[i]
  932. if (trigger == 'click') {
  933. this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
  934. } else if (trigger != 'manual') {
  935. var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
  936. var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
  937. this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
  938. this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
  939. }
  940. }
  941. this.options.selector ?
  942. (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
  943. this.fixTitle()
  944. }
  945. Tooltip.prototype.getDefaults = function () {
  946. return Tooltip.DEFAULTS
  947. }
  948. Tooltip.prototype.getOptions = function (options) {
  949. var dataAttributes = this.$element.data()
  950. for (var dataAttr in dataAttributes) {
  951. if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
  952. delete dataAttributes[dataAttr]
  953. }
  954. }
  955. options = $.extend({}, this.getDefaults(), dataAttributes, options)
  956. if (options.delay && typeof options.delay == 'number') {
  957. options.delay = {
  958. show: options.delay,
  959. hide: options.delay
  960. }
  961. }
  962. if (options.sanitize) {
  963. options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn)
  964. }
  965. return options
  966. }
  967. Tooltip.prototype.getDelegateOptions = function () {
  968. var options = {}
  969. var defaults = this.getDefaults()
  970. this._options && $.each(this._options, function (key, value) {
  971. if (defaults[key] != value) options[key] = value
  972. })
  973. return options
  974. }
  975. Tooltip.prototype.enter = function (obj) {
  976. var self = obj instanceof this.constructor ?
  977. obj : $(obj.currentTarget).data('bs.' + this.type)
  978. if (!self) {
  979. self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
  980. $(obj.currentTarget).data('bs.' + this.type, self)
  981. }
  982. if (obj instanceof $.Event) {
  983. self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
  984. }
  985. if (self.tip().hasClass('in') || self.hoverState == 'in') {
  986. self.hoverState = 'in'
  987. return
  988. }
  989. clearTimeout(self.timeout)
  990. self.hoverState = 'in'
  991. if (!self.options.delay || !self.options.delay.show) return self.show()
  992. self.timeout = setTimeout(function () {
  993. if (self.hoverState == 'in') self.show()
  994. }, self.options.delay.show)
  995. }
  996. Tooltip.prototype.isInStateTrue = function () {
  997. for (var key in this.inState) {
  998. if (this.inState[key]) return true
  999. }
  1000. return false
  1001. }
  1002. Tooltip.prototype.leave = function (obj) {
  1003. var self = obj instanceof this.constructor ?
  1004. obj : $(obj.currentTarget).data('bs.' + this.type)
  1005. if (!self) {
  1006. self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
  1007. $(obj.currentTarget).data('bs.' + this.type, self)
  1008. }
  1009. if (obj instanceof $.Event) {
  1010. self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
  1011. }
  1012. if (self.isInStateTrue()) return
  1013. clearTimeout(self.timeout)
  1014. self.hoverState = 'out'
  1015. if (!self.options.delay || !self.options.delay.hide) return self.hide()
  1016. self.timeout = setTimeout(function () {
  1017. if (self.hoverState == 'out') self.hide()
  1018. }, self.options.delay.hide)
  1019. }
  1020. Tooltip.prototype.show = function () {
  1021. var e = $.Event('show.bs.' + this.type)
  1022. if (this.hasContent() && this.enabled) {
  1023. this.$element.trigger(e)
  1024. var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
  1025. if (e.isDefaultPrevented() || !inDom) return
  1026. var that = this
  1027. var $tip = this.tip()
  1028. var tipId = this.getUID(this.type)
  1029. this.setContent()
  1030. $tip.attr('id', tipId)
  1031. this.$element.attr('aria-describedby', tipId)
  1032. if (this.options.animation) $tip.addClass('fade')
  1033. var placement = typeof this.options.placement == 'function' ?
  1034. this.options.placement.call(this, $tip[0], this.$element[0]) :
  1035. this.options.placement
  1036. var autoToken = /\s?auto?\s?/i
  1037. var autoPlace = autoToken.test(placement)
  1038. if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
  1039. $tip
  1040. .detach()
  1041. .css({ top: 0, left: 0, display: 'block' })
  1042. .addClass(placement)
  1043. .data('bs.' + this.type, this)
  1044. this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element)
  1045. this.$element.trigger('inserted.bs.' + this.type)
  1046. var pos = this.getPosition()
  1047. var actualWidth = $tip[0].offsetWidth
  1048. var actualHeight = $tip[0].offsetHeight
  1049. if (autoPlace) {
  1050. var orgPlacement = placement
  1051. var viewportDim = this.getPosition(this.$viewport)
  1052. placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
  1053. placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
  1054. placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
  1055. placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
  1056. placement
  1057. $tip
  1058. .removeClass(orgPlacement)
  1059. .addClass(placement)
  1060. }
  1061. var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
  1062. this.applyPlacement(calculatedOffset, placement)
  1063. var complete = function () {
  1064. var prevHoverState = that.hoverState
  1065. that.$element.trigger('shown.bs.' + that.type)
  1066. that.hoverState = null
  1067. if (prevHoverState == 'out') that.leave(that)
  1068. }
  1069. $.support.transition && this.$tip.hasClass('fade') ?
  1070. $tip
  1071. .one('bsTransitionEnd', complete)
  1072. .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
  1073. complete()
  1074. }
  1075. }
  1076. Tooltip.prototype.applyPlacement = function (offset, placement) {
  1077. var $tip = this.tip()
  1078. var width = $tip[0].offsetWidth
  1079. var height = $tip[0].offsetHeight
  1080. // manually read margins because getBoundingClientRect includes difference
  1081. var marginTop = parseInt($tip.css('margin-top'), 10)
  1082. var marginLeft = parseInt($tip.css('margin-left'), 10)
  1083. // we must check for NaN for ie 8/9
  1084. if (isNaN(marginTop)) marginTop = 0
  1085. if (isNaN(marginLeft)) marginLeft = 0
  1086. offset.top += marginTop
  1087. offset.left += marginLeft
  1088. // $.fn.offset doesn't round pixel values
  1089. // so we use setOffset directly with our own function B-0
  1090. $.offset.setOffset($tip[0], $.extend({
  1091. using: function (props) {
  1092. $tip.css({
  1093. top: Math.round(props.top),
  1094. left: Math.round(props.left)
  1095. })
  1096. }
  1097. }, offset), 0)
  1098. $tip.addClass('in')
  1099. // check to see if placing tip in new offset caused the tip to resize itself
  1100. var actualWidth = $tip[0].offsetWidth
  1101. var actualHeight = $tip[0].offsetHeight
  1102. if (placement == 'top' && actualHeight != height) {
  1103. offset.top = offset.top + height - actualHeight
  1104. }
  1105. var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
  1106. if (delta.left) offset.left += delta.left
  1107. else offset.top += delta.top
  1108. var isVertical = /top|bottom/.test(placement)
  1109. var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
  1110. var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
  1111. $tip.offset(offset)
  1112. this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
  1113. }
  1114. Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
  1115. this.arrow()
  1116. .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
  1117. .css(isVertical ? 'top' : 'left', '')
  1118. }
  1119. Tooltip.prototype.setContent = function () {
  1120. var $tip = this.tip()
  1121. var title = this.getTitle()
  1122. if (this.options.html) {
  1123. if (this.options.sanitize) {
  1124. title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn)
  1125. }
  1126. $tip.find('.tooltip-inner').html(title)
  1127. } else {
  1128. $tip.find('.tooltip-inner').text(title)
  1129. }
  1130. $tip.removeClass('fade in top bottom left right')
  1131. }
  1132. Tooltip.prototype.hide = function (callback) {
  1133. var that = this
  1134. var $tip = $(this.$tip)
  1135. var e = $.Event('hide.bs.' + this.type)
  1136. function complete() {
  1137. if (that.hoverState != 'in') $tip.detach()
  1138. if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
  1139. that.$element
  1140. .removeAttr('aria-describedby')
  1141. .trigger('hidden.bs.' + that.type)
  1142. }
  1143. callback && callback()
  1144. }
  1145. this.$element.trigger(e)
  1146. if (e.isDefaultPrevented()) return
  1147. $tip.removeClass('in')
  1148. $.support.transition && $tip.hasClass('fade') ?
  1149. $tip
  1150. .one('bsTransitionEnd', complete)
  1151. .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
  1152. complete()
  1153. this.hoverState = null
  1154. return this
  1155. }
  1156. Tooltip.prototype.fixTitle = function () {
  1157. var $e = this.$element
  1158. if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
  1159. $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
  1160. }
  1161. }
  1162. Tooltip.prototype.hasContent = function () {
  1163. return this.getTitle()
  1164. }
  1165. Tooltip.prototype.getPosition = function ($element) {
  1166. $element = $element || this.$element
  1167. var el = $element[0]
  1168. var isBody = el.tagName == 'BODY'
  1169. var elRect = el.getBoundingClientRect()
  1170. if (elRect.width == null) {
  1171. // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
  1172. elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
  1173. }
  1174. var isSvg = window.SVGElement && el instanceof window.SVGElement
  1175. // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
  1176. // See https://github.com/twbs/bootstrap/issues/20280
  1177. var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
  1178. var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
  1179. var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
  1180. return $.extend({}, elRect, scroll, outerDims, elOffset)
  1181. }
  1182. Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
  1183. return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
  1184. placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
  1185. placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
  1186. /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
  1187. }
  1188. Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
  1189. var delta = { top: 0, left: 0 }
  1190. if (!this.$viewport) return delta
  1191. var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
  1192. var viewportDimensions = this.getPosition(this.$viewport)
  1193. if (/right|left/.test(placement)) {
  1194. var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
  1195. var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
  1196. if (topEdgeOffset < viewportDimensions.top) { // top overflow
  1197. delta.top = viewportDimensions.top - topEdgeOffset
  1198. } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
  1199. delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
  1200. }
  1201. } else {
  1202. var leftEdgeOffset = pos.left - viewportPadding
  1203. var rightEdgeOffset = pos.left + viewportPadding + actualWidth
  1204. if (leftEdgeOffset < viewportDimensions.left) { // left overflow
  1205. delta.left = viewportDimensions.left - leftEdgeOffset
  1206. } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
  1207. delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
  1208. }
  1209. }
  1210. return delta
  1211. }
  1212. Tooltip.prototype.getTitle = function () {
  1213. var title
  1214. var $e = this.$element
  1215. var o = this.options
  1216. title = $e.attr('data-original-title')
  1217. || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
  1218. return title
  1219. }
  1220. Tooltip.prototype.getUID = function (prefix) {
  1221. do prefix += ~~(Math.random() * 1000000)
  1222. while (document.getElementById(prefix))
  1223. return prefix
  1224. }
  1225. Tooltip.prototype.tip = function () {
  1226. if (!this.$tip) {
  1227. this.$tip = $(this.options.template)
  1228. if (this.$tip.length != 1) {
  1229. throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
  1230. }
  1231. }
  1232. return this.$tip
  1233. }
  1234. Tooltip.prototype.arrow = function () {
  1235. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  1236. }
  1237. Tooltip.prototype.enable = function () {
  1238. this.enabled = true
  1239. }
  1240. Tooltip.prototype.disable = function () {
  1241. this.enabled = false
  1242. }
  1243. Tooltip.prototype.toggleEnabled = function () {
  1244. this.enabled = !this.enabled
  1245. }
  1246. Tooltip.prototype.toggle = function (e) {
  1247. var self = this
  1248. if (e) {
  1249. self = $(e.currentTarget).data('bs.' + this.type)
  1250. if (!self) {
  1251. self = new this.constructor(e.currentTarget, this.getDelegateOptions())
  1252. $(e.currentTarget).data('bs.' + this.type, self)
  1253. }
  1254. }
  1255. if (e) {
  1256. self.inState.click = !self.inState.click
  1257. if (self.isInStateTrue()) self.enter(self)
  1258. else self.leave(self)
  1259. } else {
  1260. self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
  1261. }
  1262. }
  1263. Tooltip.prototype.destroy = function () {
  1264. var that = this
  1265. clearTimeout(this.timeout)
  1266. this.hide(function () {
  1267. that.$element.off('.' + that.type).removeData('bs.' + that.type)
  1268. if (that.$tip) {
  1269. that.$tip.detach()
  1270. }
  1271. that.$tip = null
  1272. that.$arrow = null
  1273. that.$viewport = null
  1274. that.$element = null
  1275. })
  1276. }
  1277. Tooltip.prototype.sanitizeHtml = function (unsafeHtml) {
  1278. return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn)
  1279. }
  1280. // TOOLTIP PLUGIN DEFINITION
  1281. // =========================
  1282. function Plugin(option) {
  1283. return this.each(function () {
  1284. var $this = $(this)
  1285. var data = $this.data('bs.tooltip')
  1286. var options = typeof option == 'object' && option
  1287. if (!data && /destroy|hide/.test(option)) return
  1288. if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
  1289. if (typeof option == 'string') data[option]()
  1290. })
  1291. }
  1292. var old = $.fn.tooltip
  1293. $.fn.tooltip = Plugin
  1294. $.fn.tooltip.Constructor = Tooltip
  1295. // TOOLTIP NO CONFLICT
  1296. // ===================
  1297. $.fn.tooltip.noConflict = function () {
  1298. $.fn.tooltip = old
  1299. return this
  1300. }
  1301. }(jQuery);
  1302. /* ========================================================================
  1303. * Bootstrap: popover.js v3.4.1
  1304. * https://getbootstrap.com/docs/3.4/javascript/#popovers
  1305. * ========================================================================
  1306. * Copyright 2011-2019 Twitter, Inc.
  1307. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1308. * ======================================================================== */
  1309. +function ($) {
  1310. 'use strict';
  1311. // POPOVER PUBLIC CLASS DEFINITION
  1312. // ===============================
  1313. var Popover = function (element, options) {
  1314. this.init('popover', element, options)
  1315. }
  1316. if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
  1317. Popover.VERSION = '3.4.1'
  1318. Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
  1319. placement: 'right',
  1320. trigger: 'click',
  1321. content: '',
  1322. template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
  1323. })
  1324. // NOTE: POPOVER EXTENDS tooltip.js
  1325. // ================================
  1326. Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
  1327. Popover.prototype.constructor = Popover
  1328. Popover.prototype.getDefaults = function () {
  1329. return Popover.DEFAULTS
  1330. }
  1331. Popover.prototype.setContent = function () {
  1332. var $tip = this.tip()
  1333. var title = this.getTitle()
  1334. var content = this.getContent()
  1335. if (this.options.html) {
  1336. var typeContent = typeof content
  1337. if (this.options.sanitize) {
  1338. title = this.sanitizeHtml(title)
  1339. if (typeContent === 'string') {
  1340. content = this.sanitizeHtml(content)
  1341. }
  1342. }
  1343. $tip.find('.popover-title').html(title)
  1344. $tip.find('.popover-content').children().detach().end()[
  1345. typeContent === 'string' ? 'html' : 'append'
  1346. ](content)
  1347. } else {
  1348. $tip.find('.popover-title').text(title)
  1349. $tip.find('.popover-content').children().detach().end().text(content)
  1350. }
  1351. $tip.removeClass('fade top bottom left right in')
  1352. // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
  1353. // this manually by checking the contents.
  1354. if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
  1355. }
  1356. Popover.prototype.hasContent = function () {
  1357. return this.getTitle() || this.getContent()
  1358. }
  1359. Popover.prototype.getContent = function () {
  1360. var $e = this.$element
  1361. var o = this.options
  1362. return $e.attr('data-content')
  1363. || (typeof o.content == 'function' ?
  1364. o.content.call($e[0]) :
  1365. o.content)
  1366. }
  1367. Popover.prototype.arrow = function () {
  1368. return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
  1369. }
  1370. // POPOVER PLUGIN DEFINITION
  1371. // =========================
  1372. function Plugin(option) {
  1373. return this.each(function () {
  1374. var $this = $(this)
  1375. var data = $this.data('bs.popover')
  1376. var options = typeof option == 'object' && option
  1377. if (!data && /destroy|hide/.test(option)) return
  1378. if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
  1379. if (typeof option == 'string') data[option]()
  1380. })
  1381. }
  1382. var old = $.fn.popover
  1383. $.fn.popover = Plugin
  1384. $.fn.popover.Constructor = Popover
  1385. // POPOVER NO CONFLICT
  1386. // ===================
  1387. $.fn.popover.noConflict = function () {
  1388. $.fn.popover = old
  1389. return this
  1390. }
  1391. }(jQuery);
  1392. /* ========================================================================
  1393. * Bootstrap: tab.js v3.4.1
  1394. * https://getbootstrap.com/docs/3.4/javascript/#tabs
  1395. * ========================================================================
  1396. * Copyright 2011-2019 Twitter, Inc.
  1397. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1398. * ======================================================================== */
  1399. +function ($) {
  1400. 'use strict';
  1401. // TAB CLASS DEFINITION
  1402. // ====================
  1403. var Tab = function (element) {
  1404. // jscs:disable requireDollarBeforejQueryAssignment
  1405. this.element = $(element)
  1406. // jscs:enable requireDollarBeforejQueryAssignment
  1407. }
  1408. Tab.VERSION = '3.4.1'
  1409. Tab.TRANSITION_DURATION = 150
  1410. Tab.prototype.show = function () {
  1411. var $this = this.element
  1412. var $ul = $this.closest('ul:not(.dropdown-menu)')
  1413. var selector = $this.data('target')
  1414. if (!selector) {
  1415. selector = $this.attr('href')
  1416. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  1417. }
  1418. if ($this.parent('li').hasClass('active')) return
  1419. var $previous = $ul.find('.active:last a')
  1420. var hideEvent = $.Event('hide.bs.tab', {
  1421. relatedTarget: $this[0]
  1422. })
  1423. var showEvent = $.Event('show.bs.tab', {
  1424. relatedTarget: $previous[0]
  1425. })
  1426. $previous.trigger(hideEvent)
  1427. $this.trigger(showEvent)
  1428. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
  1429. var $target = $(document).find(selector)
  1430. this.activate($this.closest('li'), $ul)
  1431. this.activate($target, $target.parent(), function () {
  1432. $previous.trigger({
  1433. type: 'hidden.bs.tab',
  1434. relatedTarget: $this[0]
  1435. })
  1436. $this.trigger({
  1437. type: 'shown.bs.tab',
  1438. relatedTarget: $previous[0]
  1439. })
  1440. })
  1441. }
  1442. Tab.prototype.activate = function (element, container, callback) {
  1443. var $active = container.find('> .active')
  1444. var transition = callback
  1445. && $.support.transition
  1446. && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
  1447. function next() {
  1448. $active
  1449. .removeClass('active')
  1450. .find('> .dropdown-menu > .active')
  1451. .removeClass('active')
  1452. .end()
  1453. .find('[data-toggle="tab"]')
  1454. .attr('aria-expanded', false)
  1455. element
  1456. .addClass('active')
  1457. .find('[data-toggle="tab"]')
  1458. .attr('aria-expanded', true)
  1459. if (transition) {
  1460. element[0].offsetWidth // reflow for transition
  1461. element.addClass('in')
  1462. } else {
  1463. element.removeClass('fade')
  1464. }
  1465. if (element.parent('.dropdown-menu').length) {
  1466. element
  1467. .closest('li.dropdown')
  1468. .addClass('active')
  1469. .end()
  1470. .find('[data-toggle="tab"]')
  1471. .attr('aria-expanded', true)
  1472. }
  1473. callback && callback()
  1474. }
  1475. $active.length && transition ?
  1476. $active
  1477. .one('bsTransitionEnd', next)
  1478. .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
  1479. next()
  1480. $active.removeClass('in')
  1481. }
  1482. // TAB PLUGIN DEFINITION
  1483. // =====================
  1484. function Plugin(option) {
  1485. return this.each(function () {
  1486. var $this = $(this)
  1487. var data = $this.data('bs.tab')
  1488. if (!data) $this.data('bs.tab', (data = new Tab(this)))
  1489. if (typeof option == 'string') data[option]()
  1490. })
  1491. }
  1492. var old = $.fn.tab
  1493. $.fn.tab = Plugin
  1494. $.fn.tab.Constructor = Tab
  1495. // TAB NO CONFLICT
  1496. // ===============
  1497. $.fn.tab.noConflict = function () {
  1498. $.fn.tab = old
  1499. return this
  1500. }
  1501. // TAB DATA-API
  1502. // ============
  1503. var clickHandler = function (e) {
  1504. e.preventDefault()
  1505. Plugin.call($(this), 'show')
  1506. }
  1507. $(document)
  1508. .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
  1509. .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
  1510. }(jQuery);
  1511. /* ========================================================================
  1512. * Bootstrap: affix.js v3.4.1
  1513. * https://getbootstrap.com/docs/3.4/javascript/#affix
  1514. * ========================================================================
  1515. * Copyright 2011-2019 Twitter, Inc.
  1516. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1517. * ======================================================================== */
  1518. +function ($) {
  1519. 'use strict';
  1520. // AFFIX CLASS DEFINITION
  1521. // ======================
  1522. var Affix = function (element, options) {
  1523. this.options = $.extend({}, Affix.DEFAULTS, options)
  1524. var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)
  1525. this.$target = target
  1526. .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
  1527. .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
  1528. this.$element = $(element)
  1529. this.affixed = null
  1530. this.unpin = null
  1531. this.pinnedOffset = null
  1532. this.checkPosition()
  1533. }
  1534. Affix.VERSION = '3.4.1'
  1535. Affix.RESET = 'affix affix-top affix-bottom'
  1536. Affix.DEFAULTS = {
  1537. offset: 0,
  1538. target: window
  1539. }
  1540. Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
  1541. var scrollTop = this.$target.scrollTop()
  1542. var position = this.$element.offset()
  1543. var targetHeight = this.$target.height()
  1544. if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
  1545. if (this.affixed == 'bottom') {
  1546. if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
  1547. return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
  1548. }
  1549. var initializing = this.affixed == null
  1550. var colliderTop = initializing ? scrollTop : position.top
  1551. var colliderHeight = initializing ? targetHeight : height
  1552. if (offsetTop != null && scrollTop <= offsetTop) return 'top'
  1553. if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
  1554. return false
  1555. }
  1556. Affix.prototype.getPinnedOffset = function () {
  1557. if (this.pinnedOffset) return this.pinnedOffset
  1558. this.$element.removeClass(Affix.RESET).addClass('affix')
  1559. var scrollTop = this.$target.scrollTop()
  1560. var position = this.$element.offset()
  1561. return (this.pinnedOffset = position.top - scrollTop)
  1562. }
  1563. Affix.prototype.checkPositionWithEventLoop = function () {
  1564. setTimeout($.proxy(this.checkPosition, this), 1)
  1565. }
  1566. Affix.prototype.checkPosition = function () {
  1567. if (!this.$element.is(':visible')) return
  1568. var height = this.$element.height()
  1569. var offset = this.options.offset
  1570. var offsetTop = offset.top
  1571. var offsetBottom = offset.bottom
  1572. var scrollHeight = Math.max($(document).height(), $(document.body).height())
  1573. if (typeof offset != 'object') offsetBottom = offsetTop = offset
  1574. if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
  1575. if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
  1576. var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
  1577. if (this.affixed != affix) {
  1578. if (this.unpin != null) this.$element.css('top', '')
  1579. var affixType = 'affix' + (affix ? '-' + affix : '')
  1580. var e = $.Event(affixType + '.bs.affix')
  1581. this.$element.trigger(e)
  1582. if (e.isDefaultPrevented()) return
  1583. this.affixed = affix
  1584. this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
  1585. this.$element
  1586. .removeClass(Affix.RESET)
  1587. .addClass(affixType)
  1588. .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
  1589. }
  1590. if (affix == 'bottom') {
  1591. this.$element.offset({
  1592. top: scrollHeight - height - offsetBottom
  1593. })
  1594. }
  1595. }
  1596. // AFFIX PLUGIN DEFINITION
  1597. // =======================
  1598. function Plugin(option) {
  1599. return this.each(function () {
  1600. var $this = $(this)
  1601. var data = $this.data('bs.affix')
  1602. var options = typeof option == 'object' && option
  1603. if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
  1604. if (typeof option == 'string') data[option]()
  1605. })
  1606. }
  1607. var old = $.fn.affix
  1608. $.fn.affix = Plugin
  1609. $.fn.affix.Constructor = Affix
  1610. // AFFIX NO CONFLICT
  1611. // =================
  1612. $.fn.affix.noConflict = function () {
  1613. $.fn.affix = old
  1614. return this
  1615. }
  1616. // AFFIX DATA-API
  1617. // ==============
  1618. $(window).on('load', function () {
  1619. $('[data-spy="affix"]').each(function () {
  1620. var $spy = $(this)
  1621. var data = $spy.data()
  1622. data.offset = data.offset || {}
  1623. if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
  1624. if (data.offsetTop != null) data.offset.top = data.offsetTop
  1625. Plugin.call($spy, data)
  1626. })
  1627. })
  1628. }(jQuery);
  1629. /* ========================================================================
  1630. * Bootstrap: collapse.js v3.4.1
  1631. * https://getbootstrap.com/docs/3.4/javascript/#collapse
  1632. * ========================================================================
  1633. * Copyright 2011-2019 Twitter, Inc.
  1634. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1635. * ======================================================================== */
  1636. /* jshint latedef: false */
  1637. +function ($) {
  1638. 'use strict';
  1639. // COLLAPSE PUBLIC CLASS DEFINITION
  1640. // ================================
  1641. var Collapse = function (element, options) {
  1642. this.$element = $(element)
  1643. this.options = $.extend({}, Collapse.DEFAULTS, options)
  1644. this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
  1645. '[data-toggle="collapse"][data-target="#' + element.id + '"]')
  1646. this.transitioning = null
  1647. if (this.options.parent) {
  1648. this.$parent = this.getParent()
  1649. } else {
  1650. this.addAriaAndCollapsedClass(this.$element, this.$trigger)
  1651. }
  1652. if (this.options.toggle) this.toggle()
  1653. }
  1654. Collapse.VERSION = '3.4.1'
  1655. Collapse.TRANSITION_DURATION = 350
  1656. Collapse.DEFAULTS = {
  1657. toggle: true
  1658. }
  1659. Collapse.prototype.dimension = function () {
  1660. var hasWidth = this.$element.hasClass('width')
  1661. return hasWidth ? 'width' : 'height'
  1662. }
  1663. Collapse.prototype.show = function () {
  1664. if (this.transitioning || this.$element.hasClass('in')) return
  1665. var activesData
  1666. var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
  1667. if (actives && actives.length) {
  1668. activesData = actives.data('bs.collapse')
  1669. if (activesData && activesData.transitioning) return
  1670. }
  1671. var startEvent = $.Event('show.bs.collapse')
  1672. this.$element.trigger(startEvent)
  1673. if (startEvent.isDefaultPrevented()) return
  1674. if (actives && actives.length) {
  1675. Plugin.call(actives, 'hide')
  1676. activesData || actives.data('bs.collapse', null)
  1677. }
  1678. var dimension = this.dimension()
  1679. this.$element
  1680. .removeClass('collapse')
  1681. .addClass('collapsing')[dimension](0)
  1682. .attr('aria-expanded', true)
  1683. this.$trigger
  1684. .removeClass('collapsed')
  1685. .attr('aria-expanded', true)
  1686. this.transitioning = 1
  1687. var complete = function () {
  1688. this.$element
  1689. .removeClass('collapsing')
  1690. .addClass('collapse in')[dimension]('')
  1691. this.transitioning = 0
  1692. this.$element
  1693. .trigger('shown.bs.collapse')
  1694. }
  1695. if (!$.support.transition) return complete.call(this)
  1696. var scrollSize = $.camelCase(['scroll', dimension].join('-'))
  1697. this.$element
  1698. .one('bsTransitionEnd', $.proxy(complete, this))
  1699. .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
  1700. }
  1701. Collapse.prototype.hide = function () {
  1702. if (this.transitioning || !this.$element.hasClass('in')) return
  1703. var startEvent = $.Event('hide.bs.collapse')
  1704. this.$element.trigger(startEvent)
  1705. if (startEvent.isDefaultPrevented()) return
  1706. var dimension = this.dimension()
  1707. this.$element[dimension](this.$element[dimension]())[0].offsetHeight
  1708. this.$element
  1709. .addClass('collapsing')
  1710. .removeClass('collapse in')
  1711. .attr('aria-expanded', false)
  1712. this.$trigger
  1713. .addClass('collapsed')
  1714. .attr('aria-expanded', false)
  1715. this.transitioning = 1
  1716. var complete = function () {
  1717. this.transitioning = 0
  1718. this.$element
  1719. .removeClass('collapsing')
  1720. .addClass('collapse')
  1721. .trigger('hidden.bs.collapse')
  1722. }
  1723. if (!$.support.transition) return complete.call(this)
  1724. this.$element
  1725. [dimension](0)
  1726. .one('bsTransitionEnd', $.proxy(complete, this))
  1727. .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
  1728. }
  1729. Collapse.prototype.toggle = function () {
  1730. this[this.$element.hasClass('in') ? 'hide' : 'show']()
  1731. }
  1732. Collapse.prototype.getParent = function () {
  1733. return $(document).find(this.options.parent)
  1734. .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
  1735. .each($.proxy(function (i, element) {
  1736. var $element = $(element)
  1737. this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
  1738. }, this))
  1739. .end()
  1740. }
  1741. Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
  1742. var isOpen = $element.hasClass('in')
  1743. $element.attr('aria-expanded', isOpen)
  1744. $trigger
  1745. .toggleClass('collapsed', !isOpen)
  1746. .attr('aria-expanded', isOpen)
  1747. }
  1748. function getTargetFromTrigger($trigger) {
  1749. var href
  1750. var target = $trigger.attr('data-target')
  1751. || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
  1752. return $(document).find(target)
  1753. }
  1754. // COLLAPSE PLUGIN DEFINITION
  1755. // ==========================
  1756. function Plugin(option) {
  1757. return this.each(function () {
  1758. var $this = $(this)
  1759. var data = $this.data('bs.collapse')
  1760. var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
  1761. if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
  1762. if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
  1763. if (typeof option == 'string') data[option]()
  1764. })
  1765. }
  1766. var old = $.fn.collapse
  1767. $.fn.collapse = Plugin
  1768. $.fn.collapse.Constructor = Collapse
  1769. // COLLAPSE NO CONFLICT
  1770. // ====================
  1771. $.fn.collapse.noConflict = function () {
  1772. $.fn.collapse = old
  1773. return this
  1774. }
  1775. // COLLAPSE DATA-API
  1776. // =================
  1777. $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
  1778. var $this = $(this)
  1779. if (!$this.attr('data-target')) e.preventDefault()
  1780. var $target = getTargetFromTrigger($this)
  1781. var data = $target.data('bs.collapse')
  1782. var option = data ? 'toggle' : $this.data()
  1783. Plugin.call($target, option)
  1784. })
  1785. }(jQuery);
  1786. /* ========================================================================
  1787. * Bootstrap: scrollspy.js v3.4.1
  1788. * https://getbootstrap.com/docs/3.4/javascript/#scrollspy
  1789. * ========================================================================
  1790. * Copyright 2011-2019 Twitter, Inc.
  1791. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1792. * ======================================================================== */
  1793. +function ($) {
  1794. 'use strict';
  1795. // SCROLLSPY CLASS DEFINITION
  1796. // ==========================
  1797. function ScrollSpy(element, options) {
  1798. this.$body = $(document.body)
  1799. this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
  1800. this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
  1801. this.selector = (this.options.target || '') + ' .nav li > a'
  1802. this.offsets = []
  1803. this.targets = []
  1804. this.activeTarget = null
  1805. this.scrollHeight = 0
  1806. this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
  1807. this.refresh()
  1808. this.process()
  1809. }
  1810. ScrollSpy.VERSION = '3.4.1'
  1811. ScrollSpy.DEFAULTS = {
  1812. offset: 10
  1813. }
  1814. ScrollSpy.prototype.getScrollHeight = function () {
  1815. return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
  1816. }
  1817. ScrollSpy.prototype.refresh = function () {
  1818. var that = this
  1819. var offsetMethod = 'offset'
  1820. var offsetBase = 0
  1821. this.offsets = []
  1822. this.targets = []
  1823. this.scrollHeight = this.getScrollHeight()
  1824. if (!$.isWindow(this.$scrollElement[0])) {
  1825. offsetMethod = 'position'
  1826. offsetBase = this.$scrollElement.scrollTop()
  1827. }
  1828. this.$body
  1829. .find(this.selector)
  1830. .map(function () {
  1831. var $el = $(this)
  1832. var href = $el.data('target') || $el.attr('href')
  1833. var $href = /^#./.test(href) && $(href)
  1834. return ($href
  1835. && $href.length
  1836. && $href.is(':visible')
  1837. && [[$href[offsetMethod]().top + offsetBase, href]]) || null
  1838. })
  1839. .sort(function (a, b) { return a[0] - b[0] })
  1840. .each(function () {
  1841. that.offsets.push(this[0])
  1842. that.targets.push(this[1])
  1843. })
  1844. }
  1845. ScrollSpy.prototype.process = function () {
  1846. var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
  1847. var scrollHeight = this.getScrollHeight()
  1848. var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
  1849. var offsets = this.offsets
  1850. var targets = this.targets
  1851. var activeTarget = this.activeTarget
  1852. var i
  1853. if (this.scrollHeight != scrollHeight) {
  1854. this.refresh()
  1855. }
  1856. if (scrollTop >= maxScroll) {
  1857. return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
  1858. }
  1859. if (activeTarget && scrollTop < offsets[0]) {
  1860. this.activeTarget = null
  1861. return this.clear()
  1862. }
  1863. for (i = offsets.length; i--;) {
  1864. activeTarget != targets[i]
  1865. && scrollTop >= offsets[i]
  1866. && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
  1867. && this.activate(targets[i])
  1868. }
  1869. }
  1870. ScrollSpy.prototype.activate = function (target) {
  1871. this.activeTarget = target
  1872. this.clear()
  1873. var selector = this.selector +
  1874. '[data-target="' + target + '"],' +
  1875. this.selector + '[href="' + target + '"]'
  1876. var active = $(selector)
  1877. .parents('li')
  1878. .addClass('active')
  1879. if (active.parent('.dropdown-menu').length) {
  1880. active = active
  1881. .closest('li.dropdown')
  1882. .addClass('active')
  1883. }
  1884. active.trigger('activate.bs.scrollspy')
  1885. }
  1886. ScrollSpy.prototype.clear = function () {
  1887. $(this.selector)
  1888. .parentsUntil(this.options.target, '.active')
  1889. .removeClass('active')
  1890. }
  1891. // SCROLLSPY PLUGIN DEFINITION
  1892. // ===========================
  1893. function Plugin(option) {
  1894. return this.each(function () {
  1895. var $this = $(this)
  1896. var data = $this.data('bs.scrollspy')
  1897. var options = typeof option == 'object' && option
  1898. if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
  1899. if (typeof option == 'string') data[option]()
  1900. })
  1901. }
  1902. var old = $.fn.scrollspy
  1903. $.fn.scrollspy = Plugin
  1904. $.fn.scrollspy.Constructor = ScrollSpy
  1905. // SCROLLSPY NO CONFLICT
  1906. // =====================
  1907. $.fn.scrollspy.noConflict = function () {
  1908. $.fn.scrollspy = old
  1909. return this
  1910. }
  1911. // SCROLLSPY DATA-API
  1912. // ==================
  1913. $(window).on('load.bs.scrollspy.data-api', function () {
  1914. $('[data-spy="scroll"]').each(function () {
  1915. var $spy = $(this)
  1916. Plugin.call($spy, $spy.data())
  1917. })
  1918. })
  1919. }(jQuery);
  1920. /* ========================================================================
  1921. * Bootstrap: transition.js v3.4.1
  1922. * https://getbootstrap.com/docs/3.4/javascript/#transitions
  1923. * ========================================================================
  1924. * Copyright 2011-2019 Twitter, Inc.
  1925. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1926. * ======================================================================== */
  1927. +function ($) {
  1928. 'use strict';
  1929. // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)
  1930. // ============================================================
  1931. function transitionEnd() {
  1932. var el = document.createElement('bootstrap')
  1933. var transEndEventNames = {
  1934. WebkitTransition : 'webkitTransitionEnd',
  1935. MozTransition : 'transitionend',
  1936. OTransition : 'oTransitionEnd otransitionend',
  1937. transition : 'transitionend'
  1938. }
  1939. for (var name in transEndEventNames) {
  1940. if (el.style[name] !== undefined) {
  1941. return { end: transEndEventNames[name] }
  1942. }
  1943. }
  1944. return false // explicit for ie8 ( ._.)
  1945. }
  1946. // https://blog.alexmaccaw.com/css-transitions
  1947. $.fn.emulateTransitionEnd = function (duration) {
  1948. var called = false
  1949. var $el = this
  1950. $(this).one('bsTransitionEnd', function () { called = true })
  1951. var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
  1952. setTimeout(callback, duration)
  1953. return this
  1954. }
  1955. $(function () {
  1956. $.support.transition = transitionEnd()
  1957. if (!$.support.transition) return
  1958. $.event.special.bsTransitionEnd = {
  1959. bindType: $.support.transition.end,
  1960. delegateType: $.support.transition.end,
  1961. handle: function (e) {
  1962. if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
  1963. }
  1964. }
  1965. })
  1966. }(jQuery);