bootstrap.js 74 KB

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