vendor: 4,145 bytes, lines 1-124
1//This is required for using tooltips or popovers 2 3/** 4 * @popperjs/core v2.9.2 - MIT License 5 */ 6 7(function (global, factory) { 8 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 9 typeof define === 'function' && define.amd ? define(['exports'], factory) : 10 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Popper = {})); 11}(this, (function (exports) { 'use strict'; 12 13 function getBoundingClientRect(element) { 14 var rect = element.getBoundingClientRect(); 15 return { 16 width: rect.width, 17 height: rect.height, 18 top: rect.top, 19 right: rect.right, 20 bottom: rect.bottom, 21 left: rect.left, 22 x: rect.left, 23 y: rect.top 24 }; 25 } 26 27 function getWindow(node) { 28 if (node == null) { 29 return window; 30 } 31 32 if (node.toString() !== '[object Window]') { 33 var ownerDocument = node.ownerDocument; 34 return ownerDocument ? ownerDocument.defaultView || window : window; 35 } 36 37 return node; 38 } 39 40 function getWindowScroll(node) { 41 var win = getWindow(node); 42 var scrollLeft = win.pageXOffset; 43 var scrollTop = win.pageYOffset; 44 return { 45 scrollLeft: scrollLeft, 46 scrollTop: scrollTop 47 }; 48 } 49 50 function isElement(node) { 51 var OwnElement = getWindow(node).Element; 52 return node instanceof OwnElement || node instanceof Element; 53 } 54 55 function isHTMLElement(node) { 56 var OwnElement = getWindow(node).HTMLElement; 57 return node instanceof OwnElement || node instanceof HTMLElement; 58 } 59 60 function isShadowRoot(node) { 61 // IE 11 has no ShadowRoot 62 if (typeof ShadowRoot === 'undefined') { 63 return false; 64 } 65 66 var OwnElement = getWindow(node).ShadowRoot; 67 return node instanceof OwnElement || node instanceof ShadowRoot; 68 } 69 70 function getHTMLElementScroll(element) { 71 return { 72 scrollLeft: element.scrollLeft, 73 scrollTop: element.scrollTop 74 }; 75 } 76 77 function getNodeScroll(node) { 78 if (node === getWindow(node) || !isHTMLElement(node)) { 79 return getWindowScroll(node); 80 } else { 81 return getHTMLElementScroll(node); 82 } 83 } 84 85 function getNodeName(element) { 86 return element ? (element.nodeName || '').toLowerCase() : null; 87 } 88 89 function getDocumentElement(element) { 90 // $FlowFixMe[incompatible-return]: assume body is always available 91 return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] 92 element.document) || window.document).documentElement; 93 } 94 95 function getWindowScrollBarX(element) { 96 // If <html> has a CSS width greater than the viewport, then this will be 97 // incorrect for RTL. 98 // Popper 1 is broken in this case and never had a bug report so let's assume 99 // it's not an issue. I don't think anyone ever specifies width on <html> 100 // anyway. 101 // Browsers where the left scrollbar doesn't cause an issue report `0` for 102 // this (e.g. Edge 2019, IE11, Safari) 103 return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; 104 } 105 106 function getComputedStyle(element) { 107 return getWindow(element).getComputedStyle(element); 108 } 109 110 function isScrollParent(element) { 111 // Firefox wants us to check `-x` and `-y` variations as well 112 var _getComputedStyle = getComputedStyle(element), 113 overflow = _getComputedStyle.overflow, 114 overflowX = _getComputedStyle.overflowX, 115 overflowY = _getComputedStyle.overflowY; 116 117 return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); 118 } 119 120 // Composite means it takes into account transforms as well as layout. 121 122 function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { 123 if (isFixed === void 0) { 124 isFixed = false;
vendor: 8,174 bytes, lines 125-337
125 } 126 127 var documentElement = getDocumentElement(offsetParent); 128 var rect = getBoundingClientRect(elementOrVirtualElement); 129 var isOffsetParentAnElement = isHTMLElement(offsetParent); 130 var scroll = { 131 scrollLeft: 0, 132 scrollTop: 0 133 }; 134 var offsets = { 135 x: 0, 136 y: 0 137 }; 138 139 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 140 if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 141 isScrollParent(documentElement)) { 142 scroll = getNodeScroll(offsetParent); 143 } 144 145 if (isHTMLElement(offsetParent)) { 146 offsets = getBoundingClientRect(offsetParent); 147 offsets.x += offsetParent.clientLeft; 148 offsets.y += offsetParent.clientTop; 149 } else if (documentElement) { 150 offsets.x = getWindowScrollBarX(documentElement); 151 } 152 } 153 154 return { 155 x: rect.left + scroll.scrollLeft - offsets.x, 156 y: rect.top + scroll.scrollTop - offsets.y, 157 width: rect.width, 158 height: rect.height 159 }; 160 } 161 162 // means it doesn't take into account transforms. 163 164 function getLayoutRect(element) { 165 var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. 166 // Fixes https://github.com/popperjs/popper-core/issues/1223 167 168 var width = element.offsetWidth; 169 var height = element.offsetHeight; 170 171 if (Math.abs(clientRect.width - width) <= 1) { 172 width = clientRect.width; 173 } 174 175 if (Math.abs(clientRect.height - height) <= 1) { 176 height = clientRect.height; 177 } 178 179 return { 180 x: element.offsetLeft, 181 y: element.offsetTop, 182 width: width, 183 height: height 184 }; 185 } 186 187 function getParentNode(element) { 188 if (getNodeName(element) === 'html') { 189 return element; 190 } 191 192 return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle 193 // $FlowFixMe[incompatible-return] 194 // $FlowFixMe[prop-missing] 195 element.assignedSlot || // step into the shadow DOM of the parent of a slotted node 196 element.parentNode || ( // DOM Element detected 197 isShadowRoot(element) ? element.host : null) || // ShadowRoot detected 198 // $FlowFixMe[incompatible-call]: HTMLElement is a Node 199 getDocumentElement(element) // fallback 200 201 ); 202 } 203 204 function getScrollParent(node) { 205 if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { 206 // $FlowFixMe[incompatible-return]: assume body is always available 207 return node.ownerDocument.body; 208 } 209 210 if (isHTMLElement(node) && isScrollParent(node)) { 211 return node; 212 } 213 214 return getScrollParent(getParentNode(node)); 215 } 216 217 /* 218 given a DOM element, return the list of all scroll parents, up the list of ancesors 219 until we get to the top window object. This list is what we attach scroll listeners 220 to, because if any of these parent elements scroll, we'll need to re-calculate the 221 reference element's position. 222 */ 223 224 function listScrollParents(element, list) { 225 var _element$ownerDocumen; 226 227 if (list === void 0) { 228 list = []; 229 } 230 231 var scrollParent = getScrollParent(element); 232 var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); 233 var win = getWindow(scrollParent); 234 var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; 235 var updatedList = list.concat(target); 236 return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here 237 updatedList.concat(listScrollParents(getParentNode(target))); 238 } 239 240 function isTableElement(element) { 241 return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; 242 } 243 244 function getTrueOffsetParent(element) { 245 if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 246 getComputedStyle(element).position === 'fixed') { 247 return null; 248 } 249 250 return element.offsetParent; 251 } // `.offsetParent` reports `null` for fixed elements, while absolute elements 252 // return the containing block 253 254 255 function getContainingBlock(element) { 256 var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; 257 var isIE = navigator.userAgent.indexOf('Trident') !== -1; 258 259 if (isIE && isHTMLElement(element)) { 260 // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport 261 var elementCss = getComputedStyle(element); 262 263 if (elementCss.position === 'fixed') { 264 return null; 265 } 266 } 267 268 var currentNode = getParentNode(element); 269 270 while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { 271 var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that 272 // create a containing block. 273 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 274 275 if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { 276 return currentNode; 277 } else { 278 currentNode = currentNode.parentNode; 279 } 280 } 281 282 return null; 283 } // Gets the closest ancestor positioned element. Handles some edge cases, 284 // such as table ancestors and cross browser bugs. 285 286 287 function getOffsetParent(element) { 288 var window = getWindow(element); 289 var offsetParent = getTrueOffsetParent(element); 290 291 while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { 292 offsetParent = getTrueOffsetParent(offsetParent); 293 } 294 295 if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { 296 return window; 297 } 298 299 return offsetParent || getContainingBlock(element) || window; 300 } 301 302 var top = 'top'; 303 var bottom = 'bottom'; 304 var right = 'right'; 305 var left = 'left'; 306 var auto = 'auto'; 307 var basePlacements = [top, bottom, right, left]; 308 var start = 'start'; 309 var end = 'end'; 310 var clippingParents = 'clippingParents'; 311 var viewport = 'viewport'; 312 var popper = 'popper'; 313 var reference = 'reference'; 314 var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { 315 return acc.concat([placement + "-" + start, placement + "-" + end]); 316 }, []); 317 var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { 318 return acc.concat([placement, placement + "-" + start, placement + "-" + end]); 319 }, []); // modifiers that need to read the DOM 320 321 var beforeRead = 'beforeRead'; 322 var read = 'read'; 323 var afterRead = 'afterRead'; // pure-logic modifiers 324 325 var beforeMain = 'beforeMain'; 326 var main = 'main'; 327 var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) 328 329 var beforeWrite = 'beforeWrite'; 330 var write = 'write'; 331 var afterWrite = 'afterWrite'; 332 var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; 333 334 function order(modifiers) { 335 var map = new Map(); 336 var visited = new Set(); 337 var result = [];
vendor: 7,368 bytes, lines 338-523
338 modifiers.forEach(function (modifier) { 339 map.set(modifier.name, modifier); 340 }); // On visiting object, check for its dependencies and visit them recursively 341 342 function sort(modifier) { 343 visited.add(modifier.name); 344 var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); 345 requires.forEach(function (dep) { 346 if (!visited.has(dep)) { 347 var depModifier = map.get(dep); 348 349 if (depModifier) { 350 sort(depModifier); 351 } 352 } 353 }); 354 result.push(modifier); 355 } 356 357 modifiers.forEach(function (modifier) { 358 if (!visited.has(modifier.name)) { 359 // check for visited object 360 sort(modifier); 361 } 362 }); 363 return result; 364 } 365 366 function orderModifiers(modifiers) { 367 // order based on dependencies 368 var orderedModifiers = order(modifiers); // order based on phase 369 370 return modifierPhases.reduce(function (acc, phase) { 371 return acc.concat(orderedModifiers.filter(function (modifier) { 372 return modifier.phase === phase; 373 })); 374 }, []); 375 } 376 377 function debounce(fn) { 378 var pending; 379 return function () { 380 if (!pending) { 381 pending = new Promise(function (resolve) { 382 Promise.resolve().then(function () { 383 pending = undefined; 384 resolve(fn()); 385 }); 386 }); 387 } 388 389 return pending; 390 }; 391 } 392 393 function format(str) { 394 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 395 args[_key - 1] = arguments[_key]; 396 } 397 398 return [].concat(args).reduce(function (p, c) { 399 return p.replace(/%s/, c); 400 }, str); 401 } 402 403 var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'; 404 var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'; 405 var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']; 406 function validateModifiers(modifiers) { 407 modifiers.forEach(function (modifier) { 408 Object.keys(modifier).forEach(function (key) { 409 switch (key) { 410 case 'name': 411 if (typeof modifier.name !== 'string') { 412 console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\"")); 413 } 414 415 break; 416 417 case 'enabled': 418 if (typeof modifier.enabled !== 'boolean') { 419 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\"")); 420 } 421 422 case 'phase': 423 if (modifierPhases.indexOf(modifier.phase) < 0) { 424 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\"")); 425 } 426 427 break; 428 429 case 'fn': 430 if (typeof modifier.fn !== 'function') { 431 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\"")); 432 } 433 434 break; 435 436 case 'effect': 437 if (typeof modifier.effect !== 'function') { 438 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\"")); 439 } 440 441 break; 442 443 case 'requires': 444 if (!Array.isArray(modifier.requires)) { 445 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\"")); 446 } 447 448 break; 449 450 case 'requiresIfExists': 451 if (!Array.isArray(modifier.requiresIfExists)) { 452 console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\"")); 453 } 454 455 break; 456 457 case 'options': 458 case 'data': 459 break; 460 461 default: 462 console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) { 463 return "\"" + s + "\""; 464 }).join(', ') + "; but \"" + key + "\" was provided."); 465 } 466 467 modifier.requires && modifier.requires.forEach(function (requirement) { 468 if (modifiers.find(function (mod) { 469 return mod.name === requirement; 470 }) == null) { 471 console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement)); 472 } 473 }); 474 }); 475 }); 476 } 477 478 function uniqueBy(arr, fn) { 479 var identifiers = new Set(); 480 return arr.filter(function (item) { 481 var identifier = fn(item); 482 483 if (!identifiers.has(identifier)) { 484 identifiers.add(identifier); 485 return true; 486 } 487 }); 488 } 489 490 function getBasePlacement(placement) { 491 return placement.split('-')[0]; 492 } 493 494 function mergeByName(modifiers) { 495 var merged = modifiers.reduce(function (merged, current) { 496 var existing = merged[current.name]; 497 merged[current.name] = existing ? Object.assign({}, existing, current, { 498 options: Object.assign({}, existing.options, current.options), 499 data: Object.assign({}, existing.data, current.data) 500 }) : current; 501 return merged; 502 }, {}); // IE11 does not support Object.values 503 504 return Object.keys(merged).map(function (key) { 505 return merged[key]; 506 }); 507 } 508 509 function getViewportRect(element) { 510 var win = getWindow(element); 511 var html = getDocumentElement(element); 512 var visualViewport = win.visualViewport; 513 var width = html.clientWidth; 514 var height = html.clientHeight; 515 var x = 0; 516 var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper 517 // can be obscured underneath it. 518 // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even 519 // if it isn't open, so if this isn't available, the popper will be detected 520 // to overflow the bottom of the screen too early. 521 522 if (visualViewport) { 523 width = visualViewport.width;
vendor: 14,521 bytes, lines 524-874
524 height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) 525 // In Chrome, it returns a value very close to 0 (+/-) but contains rounding 526 // errors due to floating point numbers, so we need to check precision. 527 // Safari returns a number <= 0, usually < -1 when pinch-zoomed 528 // Feature detection fails in mobile emulation mode in Chrome. 529 // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < 530 // 0.001 531 // Fallback here: "Not Safari" userAgent 532 533 if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { 534 x = visualViewport.offsetLeft; 535 y = visualViewport.offsetTop; 536 } 537 } 538 539 return { 540 width: width, 541 height: height, 542 x: x + getWindowScrollBarX(element), 543 y: y 544 }; 545 } 546 547 var max = Math.max; 548 var min = Math.min; 549 var round = Math.round; 550 551 // of the `<html>` and `<body>` rect bounds if horizontally scrollable 552 553 function getDocumentRect(element) { 554 var _element$ownerDocumen; 555 556 var html = getDocumentElement(element); 557 var winScroll = getWindowScroll(element); 558 var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; 559 var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); 560 var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); 561 var x = -winScroll.scrollLeft + getWindowScrollBarX(element); 562 var y = -winScroll.scrollTop; 563 564 if (getComputedStyle(body || html).direction === 'rtl') { 565 x += max(html.clientWidth, body ? body.clientWidth : 0) - width; 566 } 567 568 return { 569 width: width, 570 height: height, 571 x: x, 572 y: y 573 }; 574 } 575 576 function contains(parent, child) { 577 var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method 578 579 if (parent.contains(child)) { 580 return true; 581 } // then fallback to custom implementation with Shadow DOM support 582 else if (rootNode && isShadowRoot(rootNode)) { 583 var next = child; 584 585 do { 586 if (next && parent.isSameNode(next)) { 587 return true; 588 } // $FlowFixMe[prop-missing]: need a better way to handle this... 589 590 591 next = next.parentNode || next.host; 592 } while (next); 593 } // Give up, the result is false 594 595 596 return false; 597 } 598 599 function rectToClientRect(rect) { 600 return Object.assign({}, rect, { 601 left: rect.x, 602 top: rect.y, 603 right: rect.x + rect.width, 604 bottom: rect.y + rect.height 605 }); 606 } 607 608 function getInnerBoundingClientRect(element) { 609 var rect = getBoundingClientRect(element); 610 rect.top = rect.top + element.clientTop; 611 rect.left = rect.left + element.clientLeft; 612 rect.bottom = rect.top + element.clientHeight; 613 rect.right = rect.left + element.clientWidth; 614 rect.width = element.clientWidth; 615 rect.height = element.clientHeight; 616 rect.x = rect.left; 617 rect.y = rect.top; 618 return rect; 619 } 620 621 function getClientRectFromMixedType(element, clippingParent) { 622 return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); 623 } // A "clipping parent" is an overflowable container with the characteristic of 624 // clipping (or hiding) overflowing elements with a position different from 625 // `initial` 626 627 628 function getClippingParents(element) { 629 var clippingParents = listScrollParents(getParentNode(element)); 630 var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; 631 var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; 632 633 if (!isElement(clipperElement)) { 634 return []; 635 } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 636 637 638 return clippingParents.filter(function (clippingParent) { 639 return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; 640 }); 641 } // Gets the maximum area that the element is visible in due to any number of 642 // clipping parents 643 644 645 function getClippingRect(element, boundary, rootBoundary) { 646 var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); 647 var clippingParents = [].concat(mainClippingParents, [rootBoundary]); 648 var firstClippingParent = clippingParents[0]; 649 var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { 650 var rect = getClientRectFromMixedType(element, clippingParent); 651 accRect.top = max(rect.top, accRect.top); 652 accRect.right = min(rect.right, accRect.right); 653 accRect.bottom = min(rect.bottom, accRect.bottom); 654 accRect.left = max(rect.left, accRect.left); 655 return accRect; 656 }, getClientRectFromMixedType(element, firstClippingParent)); 657 clippingRect.width = clippingRect.right - clippingRect.left; 658 clippingRect.height = clippingRect.bottom - clippingRect.top; 659 clippingRect.x = clippingRect.left; 660 clippingRect.y = clippingRect.top; 661 return clippingRect; 662 } 663 664 function getVariation(placement) { 665 return placement.split('-')[1]; 666 } 667 668 function getMainAxisFromPlacement(placement) { 669 return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; 670 } 671 672 function computeOffsets(_ref) { 673 var reference = _ref.reference, 674 element = _ref.element, 675 placement = _ref.placement; 676 var basePlacement = placement ? getBasePlacement(placement) : null; 677 var variation = placement ? getVariation(placement) : null; 678 var commonX = reference.x + reference.width / 2 - element.width / 2; 679 var commonY = reference.y + reference.height / 2 - element.height / 2; 680 var offsets; 681 682 switch (basePlacement) { 683 case top: 684 offsets = { 685 x: commonX, 686 y: reference.y - element.height 687 }; 688 break; 689 690 case bottom: 691 offsets = { 692 x: commonX, 693 y: reference.y + reference.height 694 }; 695 break; 696 697 case right: 698 offsets = { 699 x: reference.x + reference.width, 700 y: commonY 701 }; 702 break; 703 704 case left: 705 offsets = { 706 x: reference.x - element.width, 707 y: commonY 708 }; 709 break; 710 711 default: 712 offsets = { 713 x: reference.x, 714 y: reference.y 715 }; 716 } 717 718 var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; 719 720 if (mainAxis != null) { 721 var len = mainAxis === 'y' ? 'height' : 'width'; 722 723 switch (variation) { 724 case start: 725 offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); 726 break; 727 728 case end: 729 offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); 730 break; 731 } 732 } 733 734 return offsets; 735 } 736 737 function getFreshSideObject() { 738 return { 739 top: 0, 740 right: 0, 741 bottom: 0, 742 left: 0 743 }; 744 } 745 746 function mergePaddingObject(paddingObject) { 747 return Object.assign({}, getFreshSideObject(), paddingObject); 748 } 749 750 function expandToHashMap(value, keys) { 751 return keys.reduce(function (hashMap, key) { 752 hashMap[key] = value; 753 return hashMap; 754 }, {}); 755 } 756 757 function detectOverflow(state, options) { 758 if (options === void 0) { 759 options = {}; 760 } 761 762 var _options = options, 763 _options$placement = _options.placement, 764 placement = _options$placement === void 0 ? state.placement : _options$placement, 765 _options$boundary = _options.boundary, 766 boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, 767 _options$rootBoundary = _options.rootBoundary, 768 rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, 769 _options$elementConte = _options.elementContext, 770 elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, 771 _options$altBoundary = _options.altBoundary, 772 altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, 773 _options$padding = _options.padding, 774 padding = _options$padding === void 0 ? 0 : _options$padding; 775 var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 776 var altContext = elementContext === popper ? reference : popper; 777 var referenceElement = state.elements.reference; 778 var popperRect = state.rects.popper; 779 var element = state.elements[altBoundary ? altContext : elementContext]; 780 var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); 781 var referenceClientRect = getBoundingClientRect(referenceElement); 782 var popperOffsets = computeOffsets({ 783 reference: referenceClientRect, 784 element: popperRect, 785 strategy: 'absolute', 786 placement: placement 787 }); 788 var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); 789 var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect 790 // 0 or negative = within the clipping rect 791 792 var overflowOffsets = { 793 top: clippingClientRect.top - elementClientRect.top + paddingObject.top, 794 bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, 795 left: clippingClientRect.left - elementClientRect.left + paddingObject.left, 796 right: elementClientRect.right - clippingClientRect.right + paddingObject.right 797 }; 798 var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element 799 800 if (elementContext === popper && offsetData) { 801 var offset = offsetData[placement]; 802 Object.keys(overflowOffsets).forEach(function (key) { 803 var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; 804 var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; 805 overflowOffsets[key] += offset[axis] * multiply; 806 }); 807 } 808 809 return overflowOffsets; 810 } 811 812 var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; 813 var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; 814 var DEFAULT_OPTIONS = { 815 placement: 'bottom', 816 modifiers: [], 817 strategy: 'absolute' 818 }; 819 820 function areValidElements() { 821 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 822 args[_key] = arguments[_key]; 823 } 824 825 return !args.some(function (element) { 826 return !(element && typeof element.getBoundingClientRect === 'function'); 827 }); 828 } 829 830 function popperGenerator(generatorOptions) { 831 if (generatorOptions === void 0) { 832 generatorOptions = {}; 833 } 834 835 var _generatorOptions = generatorOptions, 836 _generatorOptions$def = _generatorOptions.defaultModifiers, 837 defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, 838 _generatorOptions$def2 = _generatorOptions.defaultOptions, 839 defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; 840 return function createPopper(reference, popper, options) { 841 if (options === void 0) { 842 options = defaultOptions; 843 } 844 845 var state = { 846 placement: 'bottom', 847 orderedModifiers: [], 848 options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), 849 modifiersData: {}, 850 elements: { 851 reference: reference, 852 popper: popper 853 }, 854 attributes: {}, 855 styles: {} 856 }; 857 var effectCleanupFns = []; 858 var isDestroyed = false; 859 var instance = { 860 state: state, 861 setOptions: function setOptions(options) { 862 cleanupModifierEffects(); 863 state.options = Object.assign({}, defaultOptions, state.options, options); 864 state.scrollParents = { 865 reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], 866 popper: listScrollParents(popper) 867 }; // Orders the modifiers based on their dependencies and `phase` 868 // properties 869 870 var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers 871 872 state.orderedModifiers = orderedModifiers.filter(function (m) { 873 return m.enabled; 874 }); // Validate the provided modifiers so that the consumer will get warned
vendor: 4,262 bytes, lines 875-951
875 // if one of the modifiers is invalid for any reason 876 877 { 878 var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) { 879 var name = _ref.name; 880 return name; 881 }); 882 validateModifiers(modifiers); 883 884 if (getBasePlacement(state.options.placement) === auto) { 885 var flipModifier = state.orderedModifiers.find(function (_ref2) { 886 var name = _ref2.name; 887 return name === 'flip'; 888 }); 889 890 if (!flipModifier) { 891 console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' ')); 892 } 893 } 894 895 var _getComputedStyle = getComputedStyle(popper), 896 marginTop = _getComputedStyle.marginTop, 897 marginRight = _getComputedStyle.marginRight, 898 marginBottom = _getComputedStyle.marginBottom, 899 marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can 900 // cause bugs with positioning, so we'll warn the consumer 901 902 903 if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) { 904 return parseFloat(margin); 905 })) { 906 console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' ')); 907 } 908 } 909 910 runModifierEffects(); 911 return instance.update(); 912 }, 913 // Sync update – it will always be executed, even if not necessary. This 914 // is useful for low frequency updates where sync behavior simplifies the 915 // logic. 916 // For high frequency updates (e.g. `resize` and `scroll` events), always 917 // prefer the async Popper#update method 918 forceUpdate: function forceUpdate() { 919 if (isDestroyed) { 920 return; 921 } 922 923 var _state$elements = state.elements, 924 reference = _state$elements.reference, 925 popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements 926 // anymore 927 928 if (!areValidElements(reference, popper)) { 929 { 930 console.error(INVALID_ELEMENT_ERROR); 931 } 932 933 return; 934 } // Store the reference and popper rects to be read by modifiers 935 936 937 state.rects = { 938 reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), 939 popper: getLayoutRect(popper) 940 }; // Modifiers have the ability to reset the current update cycle. The 941 // most common use case for this is the `flip` modifier changing the 942 // placement, which then needs to re-run all the modifiers, because the 943 // logic was previously ran for the previous placement and is therefore 944 // stale/incorrect 945 946 state.reset = false; 947 state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier 948 // is filled with the initial data specified by the modifier. This means 949 // it doesn't persist and is fresh on each update. 950 // To ensure persistent data, use `${name}#persistent` 951
vendor: 4,656 bytes, lines 952-1069
952 state.orderedModifiers.forEach(function (modifier) { 953 return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); 954 }); 955 var __debug_loops__ = 0; 956 957 for (var index = 0; index < state.orderedModifiers.length; index++) { 958 { 959 __debug_loops__ += 1; 960 961 if (__debug_loops__ > 100) { 962 console.error(INFINITE_LOOP_ERROR); 963 break; 964 } 965 } 966 967 if (state.reset === true) { 968 state.reset = false; 969 index = -1; 970 continue; 971 } 972 973 var _state$orderedModifie = state.orderedModifiers[index], 974 fn = _state$orderedModifie.fn, 975 _state$orderedModifie2 = _state$orderedModifie.options, 976 _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, 977 name = _state$orderedModifie.name; 978 979 if (typeof fn === 'function') { 980 state = fn({ 981 state: state, 982 options: _options, 983 name: name, 984 instance: instance 985 }) || state; 986 } 987 } 988 }, 989 // Async and optimistically optimized update – it will not be executed if 990 // not necessary (debounced to run at most once-per-tick) 991 update: debounce(function () { 992 return new Promise(function (resolve) { 993 instance.forceUpdate(); 994 resolve(state); 995 }); 996 }), 997 destroy: function destroy() { 998 cleanupModifierEffects(); 999 isDestroyed = true; 1000 } 1001 }; 1002 1003 if (!areValidElements(reference, popper)) { 1004 { 1005 console.error(INVALID_ELEMENT_ERROR); 1006 } 1007 1008 return instance; 1009 } 1010 1011 instance.setOptions(options).then(function (state) { 1012 if (!isDestroyed && options.onFirstUpdate) { 1013 options.onFirstUpdate(state); 1014 } 1015 }); // Modifiers have the ability to execute arbitrary code before the first 1016 // update cycle runs. They will be executed in the same order as the update 1017 // cycle. This is useful when a modifier adds some persistent data that 1018 // other modifiers need to use, but the modifier is run after the dependent 1019 // one. 1020 1021 function runModifierEffects() { 1022 state.orderedModifiers.forEach(function (_ref3) { 1023 var name = _ref3.name, 1024 _ref3$options = _ref3.options, 1025 options = _ref3$options === void 0 ? {} : _ref3$options, 1026 effect = _ref3.effect; 1027 1028 if (typeof effect === 'function') { 1029 var cleanupFn = effect({ 1030 state: state, 1031 name: name, 1032 instance: instance, 1033 options: options 1034 }); 1035 1036 var noopFn = function noopFn() {}; 1037 1038 effectCleanupFns.push(cleanupFn || noopFn); 1039 } 1040 }); 1041 } 1042 1043 function cleanupModifierEffects() { 1044 effectCleanupFns.forEach(function (fn) { 1045 return fn(); 1046 }); 1047 effectCleanupFns = []; 1048 } 1049 1050 return instance; 1051 }; 1052 } 1053 1054 var passive = { 1055 passive: true 1056 }; 1057 1058 function effect$2(_ref) { 1059 var state = _ref.state, 1060 instance = _ref.instance, 1061 options = _ref.options; 1062 var _options$scroll = options.scroll, 1063 scroll = _options$scroll === void 0 ? true : _options$scroll, 1064 _options$resize = options.resize, 1065 resize = _options$resize === void 0 ? true : _options$resize; 1066 var window = getWindow(state.elements.popper); 1067 var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); 1068 1069 if (scroll) {
vendor: 9,552 bytes, lines 1070-1324
1070 scrollParents.forEach(function (scrollParent) { 1071 scrollParent.addEventListener('scroll', instance.update, passive); 1072 }); 1073 } 1074 1075 if (resize) { 1076 window.addEventListener('resize', instance.update, passive); 1077 } 1078 1079 return function () { 1080 if (scroll) { 1081 scrollParents.forEach(function (scrollParent) { 1082 scrollParent.removeEventListener('scroll', instance.update, passive); 1083 }); 1084 } 1085 1086 if (resize) { 1087 window.removeEventListener('resize', instance.update, passive); 1088 } 1089 }; 1090 } // eslint-disable-next-line import/no-unused-modules 1091 1092 1093 var eventListeners = { 1094 name: 'eventListeners', 1095 enabled: true, 1096 phase: 'write', 1097 fn: function fn() {}, 1098 effect: effect$2, 1099 data: {} 1100 }; 1101 1102 function popperOffsets(_ref) { 1103 var state = _ref.state, 1104 name = _ref.name; 1105 // Offsets are the actual position the popper needs to have to be 1106 // properly positioned near its reference element 1107 // This is the most basic placement, and will be adjusted by 1108 // the modifiers in the next step 1109 state.modifiersData[name] = computeOffsets({ 1110 reference: state.rects.reference, 1111 element: state.rects.popper, 1112 strategy: 'absolute', 1113 placement: state.placement 1114 }); 1115 } // eslint-disable-next-line import/no-unused-modules 1116 1117 1118 var popperOffsets$1 = { 1119 name: 'popperOffsets', 1120 enabled: true, 1121 phase: 'read', 1122 fn: popperOffsets, 1123 data: {} 1124 }; 1125 1126 var unsetSides = { 1127 top: 'auto', 1128 right: 'auto', 1129 bottom: 'auto', 1130 left: 'auto' 1131 }; // Round the offsets to the nearest suitable subpixel based on the DPR. 1132 // Zooming can change the DPR, but it seems to report a value that will 1133 // cleanly divide the values into the appropriate subpixels. 1134 1135 function roundOffsetsByDPR(_ref) { 1136 var x = _ref.x, 1137 y = _ref.y; 1138 var win = window; 1139 var dpr = win.devicePixelRatio || 1; 1140 return { 1141 x: round(round(x * dpr) / dpr) || 0, 1142 y: round(round(y * dpr) / dpr) || 0 1143 }; 1144 } 1145 1146 function mapToStyles(_ref2) { 1147 var _Object$assign2; 1148 1149 var popper = _ref2.popper, 1150 popperRect = _ref2.popperRect, 1151 placement = _ref2.placement, 1152 offsets = _ref2.offsets, 1153 position = _ref2.position, 1154 gpuAcceleration = _ref2.gpuAcceleration, 1155 adaptive = _ref2.adaptive, 1156 roundOffsets = _ref2.roundOffsets; 1157 1158 var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets, 1159 _ref3$x = _ref3.x, 1160 x = _ref3$x === void 0 ? 0 : _ref3$x, 1161 _ref3$y = _ref3.y, 1162 y = _ref3$y === void 0 ? 0 : _ref3$y; 1163 1164 var hasX = offsets.hasOwnProperty('x'); 1165 var hasY = offsets.hasOwnProperty('y'); 1166 var sideX = left; 1167 var sideY = top; 1168 var win = window; 1169 1170 if (adaptive) { 1171 var offsetParent = getOffsetParent(popper); 1172 var heightProp = 'clientHeight'; 1173 var widthProp = 'clientWidth'; 1174 1175 if (offsetParent === getWindow(popper)) { 1176 offsetParent = getDocumentElement(popper); 1177 1178 if (getComputedStyle(offsetParent).position !== 'static') { 1179 heightProp = 'scrollHeight'; 1180 widthProp = 'scrollWidth'; 1181 } 1182 } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it 1183 1184 1185 offsetParent = offsetParent; 1186 1187 if (placement === top) { 1188 sideY = bottom; // $FlowFixMe[prop-missing] 1189 1190 y -= offsetParent[heightProp] - popperRect.height; 1191 y *= gpuAcceleration ? 1 : -1; 1192 } 1193 1194 if (placement === left) { 1195 sideX = right; // $FlowFixMe[prop-missing] 1196 1197 x -= offsetParent[widthProp] - popperRect.width; 1198 x *= gpuAcceleration ? 1 : -1; 1199 } 1200 } 1201 1202 var commonStyles = Object.assign({ 1203 position: position 1204 }, adaptive && unsetSides); 1205 1206 if (gpuAcceleration) { 1207 var _Object$assign; 1208 1209 return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); 1210 } 1211 1212 return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); 1213 } 1214 1215 function computeStyles(_ref4) { 1216 var state = _ref4.state, 1217 options = _ref4.options; 1218 var _options$gpuAccelerat = options.gpuAcceleration, 1219 gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, 1220 _options$adaptive = options.adaptive, 1221 adaptive = _options$adaptive === void 0 ? true : _options$adaptive, 1222 _options$roundOffsets = options.roundOffsets, 1223 roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; 1224 1225 { 1226 var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || ''; 1227 1228 if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) { 1229 return transitionProperty.indexOf(property) >= 0; 1230 })) { 1231 console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' ')); 1232 } 1233 } 1234 1235 var commonStyles = { 1236 placement: getBasePlacement(state.placement), 1237 popper: state.elements.popper, 1238 popperRect: state.rects.popper, 1239 gpuAcceleration: gpuAcceleration 1240 }; 1241 1242 if (state.modifiersData.popperOffsets != null) { 1243 state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { 1244 offsets: state.modifiersData.popperOffsets, 1245 position: state.options.strategy, 1246 adaptive: adaptive, 1247 roundOffsets: roundOffsets 1248 }))); 1249 } 1250 1251 if (state.modifiersData.arrow != null) { 1252 state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { 1253 offsets: state.modifiersData.arrow, 1254 position: 'absolute', 1255 adaptive: false, 1256 roundOffsets: roundOffsets 1257 }))); 1258 } 1259 1260 state.attributes.popper = Object.assign({}, state.attributes.popper, { 1261 'data-popper-placement': state.placement 1262 }); 1263 } // eslint-disable-next-line import/no-unused-modules 1264 1265 1266 var computeStyles$1 = { 1267 name: 'computeStyles', 1268 enabled: true, 1269 phase: 'beforeWrite', 1270 fn: computeStyles, 1271 data: {} 1272 }; 1273 1274 // and applies them to the HTMLElements such as popper and arrow 1275 1276 function applyStyles(_ref) { 1277 var state = _ref.state; 1278 Object.keys(state.elements).forEach(function (name) { 1279 var style = state.styles[name] || {}; 1280 var attributes = state.attributes[name] || {}; 1281 var element = state.elements[name]; // arrow is optional + virtual elements 1282 1283 if (!isHTMLElement(element) || !getNodeName(element)) { 1284 return; 1285 } // Flow doesn't support to extend this property, but it's the most 1286 // effective way to apply styles to an HTMLElement 1287 // $FlowFixMe[cannot-write] 1288 1289 1290 Object.assign(element.style, style); 1291 Object.keys(attributes).forEach(function (name) { 1292 var value = attributes[name]; 1293 1294 if (value === false) { 1295 element.removeAttribute(name); 1296 } else { 1297 element.setAttribute(name, value === true ? '' : value); 1298 } 1299 }); 1300 }); 1301 } 1302 1303 function effect$1(_ref2) { 1304 var state = _ref2.state; 1305 var initialStyles = { 1306 popper: { 1307 position: state.options.strategy, 1308 left: '0', 1309 top: '0', 1310 margin: '0' 1311 }, 1312 arrow: { 1313 position: 'absolute' 1314 }, 1315 reference: {} 1316 }; 1317 Object.assign(state.elements.popper.style, initialStyles.popper); 1318 state.styles = initialStyles; 1319 1320 if (state.elements.arrow) { 1321 Object.assign(state.elements.arrow.style, initialStyles.arrow); 1322 } 1323 1324 return function () {
vendor: 8,191 bytes, lines 1325-1532
1325 Object.keys(state.elements).forEach(function (name) { 1326 var element = state.elements[name]; 1327 var attributes = state.attributes[name] || {}; 1328 var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them 1329 1330 var style = styleProperties.reduce(function (style, property) { 1331 style[property] = ''; 1332 return style; 1333 }, {}); // arrow is optional + virtual elements 1334 1335 if (!isHTMLElement(element) || !getNodeName(element)) { 1336 return; 1337 } 1338 1339 Object.assign(element.style, style); 1340 Object.keys(attributes).forEach(function (attribute) { 1341 element.removeAttribute(attribute); 1342 }); 1343 }); 1344 }; 1345 } // eslint-disable-next-line import/no-unused-modules 1346 1347 1348 var applyStyles$1 = { 1349 name: 'applyStyles', 1350 enabled: true, 1351 phase: 'write', 1352 fn: applyStyles, 1353 effect: effect$1, 1354 requires: ['computeStyles'] 1355 }; 1356 1357 function distanceAndSkiddingToXY(placement, rects, offset) { 1358 var basePlacement = getBasePlacement(placement); 1359 var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; 1360 1361 var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { 1362 placement: placement 1363 })) : offset, 1364 skidding = _ref[0], 1365 distance = _ref[1]; 1366 1367 skidding = skidding || 0; 1368 distance = (distance || 0) * invertDistance; 1369 return [left, right].indexOf(basePlacement) >= 0 ? { 1370 x: distance, 1371 y: skidding 1372 } : { 1373 x: skidding, 1374 y: distance 1375 }; 1376 } 1377 1378 function offset(_ref2) { 1379 var state = _ref2.state, 1380 options = _ref2.options, 1381 name = _ref2.name; 1382 var _options$offset = options.offset, 1383 offset = _options$offset === void 0 ? [0, 0] : _options$offset; 1384 var data = placements.reduce(function (acc, placement) { 1385 acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); 1386 return acc; 1387 }, {}); 1388 var _data$state$placement = data[state.placement], 1389 x = _data$state$placement.x, 1390 y = _data$state$placement.y; 1391 1392 if (state.modifiersData.popperOffsets != null) { 1393 state.modifiersData.popperOffsets.x += x; 1394 state.modifiersData.popperOffsets.y += y; 1395 } 1396 1397 state.modifiersData[name] = data; 1398 } // eslint-disable-next-line import/no-unused-modules 1399 1400 1401 var offset$1 = { 1402 name: 'offset', 1403 enabled: true, 1404 phase: 'main', 1405 requires: ['popperOffsets'], 1406 fn: offset 1407 }; 1408 1409 var hash$1 = { 1410 left: 'right', 1411 right: 'left', 1412 bottom: 'top', 1413 top: 'bottom' 1414 }; 1415 function getOppositePlacement(placement) { 1416 return placement.replace(/left|right|bottom|top/g, function (matched) { 1417 return hash$1[matched]; 1418 }); 1419 } 1420 1421 var hash = { 1422 start: 'end', 1423 end: 'start' 1424 }; 1425 function getOppositeVariationPlacement(placement) { 1426 return placement.replace(/start|end/g, function (matched) { 1427 return hash[matched]; 1428 }); 1429 } 1430 1431 function computeAutoPlacement(state, options) { 1432 if (options === void 0) { 1433 options = {}; 1434 } 1435 1436 var _options = options, 1437 placement = _options.placement, 1438 boundary = _options.boundary, 1439 rootBoundary = _options.rootBoundary, 1440 padding = _options.padding, 1441 flipVariations = _options.flipVariations, 1442 _options$allowedAutoP = _options.allowedAutoPlacements, 1443 allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; 1444 var variation = getVariation(placement); 1445 var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { 1446 return getVariation(placement) === variation; 1447 }) : basePlacements; 1448 var allowedPlacements = placements$1.filter(function (placement) { 1449 return allowedAutoPlacements.indexOf(placement) >= 0; 1450 }); 1451 1452 if (allowedPlacements.length === 0) { 1453 allowedPlacements = placements$1; 1454 1455 { 1456 console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' ')); 1457 } 1458 } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... 1459 1460 1461 var overflows = allowedPlacements.reduce(function (acc, placement) { 1462 acc[placement] = detectOverflow(state, { 1463 placement: placement, 1464 boundary: boundary, 1465 rootBoundary: rootBoundary, 1466 padding: padding 1467 })[getBasePlacement(placement)]; 1468 return acc; 1469 }, {}); 1470 return Object.keys(overflows).sort(function (a, b) { 1471 return overflows[a] - overflows[b]; 1472 }); 1473 } 1474 1475 function getExpandedFallbackPlacements(placement) { 1476 if (getBasePlacement(placement) === auto) { 1477 return []; 1478 } 1479 1480 var oppositePlacement = getOppositePlacement(placement); 1481 return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; 1482 } 1483 1484 function flip(_ref) { 1485 var state = _ref.state, 1486 options = _ref.options, 1487 name = _ref.name; 1488 1489 if (state.modifiersData[name]._skip) { 1490 return; 1491 } 1492 1493 var _options$mainAxis = options.mainAxis, 1494 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 1495 _options$altAxis = options.altAxis, 1496 checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, 1497 specifiedFallbackPlacements = options.fallbackPlacements, 1498 padding = options.padding, 1499 boundary = options.boundary, 1500 rootBoundary = options.rootBoundary, 1501 altBoundary = options.altBoundary, 1502 _options$flipVariatio = options.flipVariations, 1503 flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, 1504 allowedAutoPlacements = options.allowedAutoPlacements; 1505 var preferredPlacement = state.options.placement; 1506 var basePlacement = getBasePlacement(preferredPlacement); 1507 var isBasePlacement = basePlacement === preferredPlacement; 1508 var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); 1509 var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { 1510 return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { 1511 placement: placement, 1512 boundary: boundary, 1513 rootBoundary: rootBoundary, 1514 padding: padding, 1515 flipVariations: flipVariations, 1516 allowedAutoPlacements: allowedAutoPlacements 1517 }) : placement); 1518 }, []); 1519 var referenceRect = state.rects.reference; 1520 var popperRect = state.rects.popper; 1521 var checksMap = new Map(); 1522 var makeFallbackChecks = true; 1523 var firstFittingPlacement = placements[0]; 1524 1525 for (var i = 0; i < placements.length; i++) { 1526 var placement = placements[i]; 1527 1528 var _basePlacement = getBasePlacement(placement); 1529 1530 var isStartVariation = getVariation(placement) === start; 1531 var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; 1532 var len = isVertical ? 'width' : 'height';
vendor: 10,170 bytes, lines 1533-1771
1533 var overflow = detectOverflow(state, { 1534 placement: placement, 1535 boundary: boundary, 1536 rootBoundary: rootBoundary, 1537 altBoundary: altBoundary, 1538 padding: padding 1539 }); 1540 var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; 1541 1542 if (referenceRect[len] > popperRect[len]) { 1543 mainVariationSide = getOppositePlacement(mainVariationSide); 1544 } 1545 1546 var altVariationSide = getOppositePlacement(mainVariationSide); 1547 var checks = []; 1548 1549 if (checkMainAxis) { 1550 checks.push(overflow[_basePlacement] <= 0); 1551 } 1552 1553 if (checkAltAxis) { 1554 checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); 1555 } 1556 1557 if (checks.every(function (check) { 1558 return check; 1559 })) { 1560 firstFittingPlacement = placement; 1561 makeFallbackChecks = false; 1562 break; 1563 } 1564 1565 checksMap.set(placement, checks); 1566 } 1567 1568 if (makeFallbackChecks) { 1569 // `2` may be desired in some cases – research later 1570 var numberOfChecks = flipVariations ? 3 : 1; 1571 1572 var _loop = function _loop(_i) { 1573 var fittingPlacement = placements.find(function (placement) { 1574 var checks = checksMap.get(placement); 1575 1576 if (checks) { 1577 return checks.slice(0, _i).every(function (check) { 1578 return check; 1579 }); 1580 } 1581 }); 1582 1583 if (fittingPlacement) { 1584 firstFittingPlacement = fittingPlacement; 1585 return "break"; 1586 } 1587 }; 1588 1589 for (var _i = numberOfChecks; _i > 0; _i--) { 1590 var _ret = _loop(_i); 1591 1592 if (_ret === "break") break; 1593 } 1594 } 1595 1596 if (state.placement !== firstFittingPlacement) { 1597 state.modifiersData[name]._skip = true; 1598 state.placement = firstFittingPlacement; 1599 state.reset = true; 1600 } 1601 } // eslint-disable-next-line import/no-unused-modules 1602 1603 1604 var flip$1 = { 1605 name: 'flip', 1606 enabled: true, 1607 phase: 'main', 1608 fn: flip, 1609 requiresIfExists: ['offset'], 1610 data: { 1611 _skip: false 1612 } 1613 }; 1614 1615 function getAltAxis(axis) { 1616 return axis === 'x' ? 'y' : 'x'; 1617 } 1618 1619 function within(min$1, value, max$1) { 1620 return max(min$1, min(value, max$1)); 1621 } 1622 1623 function preventOverflow(_ref) { 1624 var state = _ref.state, 1625 options = _ref.options, 1626 name = _ref.name; 1627 var _options$mainAxis = options.mainAxis, 1628 checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, 1629 _options$altAxis = options.altAxis, 1630 checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, 1631 boundary = options.boundary, 1632 rootBoundary = options.rootBoundary, 1633 altBoundary = options.altBoundary, 1634 padding = options.padding, 1635 _options$tether = options.tether, 1636 tether = _options$tether === void 0 ? true : _options$tether, 1637 _options$tetherOffset = options.tetherOffset, 1638 tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; 1639 var overflow = detectOverflow(state, { 1640 boundary: boundary, 1641 rootBoundary: rootBoundary, 1642 padding: padding, 1643 altBoundary: altBoundary 1644 }); 1645 var basePlacement = getBasePlacement(state.placement); 1646 var variation = getVariation(state.placement); 1647 var isBasePlacement = !variation; 1648 var mainAxis = getMainAxisFromPlacement(basePlacement); 1649 var altAxis = getAltAxis(mainAxis); 1650 var popperOffsets = state.modifiersData.popperOffsets; 1651 var referenceRect = state.rects.reference; 1652 var popperRect = state.rects.popper; 1653 var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { 1654 placement: state.placement 1655 })) : tetherOffset; 1656 var data = { 1657 x: 0, 1658 y: 0 1659 }; 1660 1661 if (!popperOffsets) { 1662 return; 1663 } 1664 1665 if (checkMainAxis || checkAltAxis) { 1666 var mainSide = mainAxis === 'y' ? top : left; 1667 var altSide = mainAxis === 'y' ? bottom : right; 1668 var len = mainAxis === 'y' ? 'height' : 'width'; 1669 var offset = popperOffsets[mainAxis]; 1670 var min$1 = popperOffsets[mainAxis] + overflow[mainSide]; 1671 var max$1 = popperOffsets[mainAxis] - overflow[altSide]; 1672 var additive = tether ? -popperRect[len] / 2 : 0; 1673 var minLen = variation === start ? referenceRect[len] : popperRect[len]; 1674 var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go 1675 // outside the reference bounds 1676 1677 var arrowElement = state.elements.arrow; 1678 var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { 1679 width: 0, 1680 height: 0 1681 }; 1682 var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); 1683 var arrowPaddingMin = arrowPaddingObject[mainSide]; 1684 var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want 1685 // to include its full size in the calculation. If the reference is small 1686 // and near the edge of a boundary, the popper can overflow even if the 1687 // reference is not overflowing as well (e.g. virtual elements with no 1688 // width or height) 1689 1690 var arrowLen = within(0, referenceRect[len], arrowRect[len]); 1691 var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue; 1692 var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue; 1693 var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); 1694 var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; 1695 var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0; 1696 var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset; 1697 var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue; 1698 1699 if (checkMainAxis) { 1700 var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1); 1701 popperOffsets[mainAxis] = preventedOffset; 1702 data[mainAxis] = preventedOffset - offset; 1703 } 1704 1705 if (checkAltAxis) { 1706 var _mainSide = mainAxis === 'x' ? top : left; 1707 1708 var _altSide = mainAxis === 'x' ? bottom : right; 1709 1710 var _offset = popperOffsets[altAxis]; 1711 1712 var _min = _offset + overflow[_mainSide]; 1713 1714 var _max = _offset - overflow[_altSide]; 1715 1716 var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max); 1717 1718 popperOffsets[altAxis] = _preventedOffset; 1719 data[altAxis] = _preventedOffset - _offset; 1720 } 1721 } 1722 1723 state.modifiersData[name] = data; 1724 } // eslint-disable-next-line import/no-unused-modules 1725 1726 1727 var preventOverflow$1 = { 1728 name: 'preventOverflow', 1729 enabled: true, 1730 phase: 'main', 1731 fn: preventOverflow, 1732 requiresIfExists: ['offset'] 1733 }; 1734 1735 var toPaddingObject = function toPaddingObject(padding, state) { 1736 padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { 1737 placement: state.placement 1738 })) : padding; 1739 return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); 1740 }; 1741 1742 function arrow(_ref) { 1743 var _state$modifiersData$; 1744 1745 var state = _ref.state, 1746 name = _ref.name, 1747 options = _ref.options; 1748 var arrowElement = state.elements.arrow; 1749 var popperOffsets = state.modifiersData.popperOffsets; 1750 var basePlacement = getBasePlacement(state.placement); 1751 var axis = getMainAxisFromPlacement(basePlacement); 1752 var isVertical = [left, right].indexOf(basePlacement) >= 0; 1753 var len = isVertical ? 'height' : 'width'; 1754 1755 if (!arrowElement || !popperOffsets) { 1756 return; 1757 } 1758 1759 var paddingObject = toPaddingObject(options.padding, state); 1760 var arrowRect = getLayoutRect(arrowElement); 1761 var minProp = axis === 'y' ? top : left; 1762 var maxProp = axis === 'y' ? bottom : right; 1763 var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; 1764 var startDiff = popperOffsets[axis] - state.rects.reference[axis]; 1765 var arrowOffsetParent = getOffsetParent(arrowElement); 1766 var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; 1767 var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is 1768 // outside of the popper bounds 1769 1770 var min = paddingObject[minProp]; 1771 var max = clientSize - arrowRect[len] - paddingObject[maxPro
vendor: 6,047 bytes, lines 1771-1931
1771p]; 1772 var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; 1773 var offset = within(min, center, max); // Prevents breaking syntax highlighting... 1774 1775 var axisProp = axis; 1776 state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); 1777 } 1778 1779 function effect(_ref2) { 1780 var state = _ref2.state, 1781 options = _ref2.options; 1782 var _options$element = options.element, 1783 arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; 1784 1785 if (arrowElement == null) { 1786 return; 1787 } // CSS selector 1788 1789 1790 if (typeof arrowElement === 'string') { 1791 arrowElement = state.elements.popper.querySelector(arrowElement); 1792 1793 if (!arrowElement) { 1794 return; 1795 } 1796 } 1797 1798 { 1799 if (!isHTMLElement(arrowElement)) { 1800 console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' ')); 1801 } 1802 } 1803 1804 if (!contains(state.elements.popper, arrowElement)) { 1805 { 1806 console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' ')); 1807 } 1808 1809 return; 1810 } 1811 1812 state.elements.arrow = arrowElement; 1813 } // eslint-disable-next-line import/no-unused-modules 1814 1815 1816 var arrow$1 = { 1817 name: 'arrow', 1818 enabled: true, 1819 phase: 'main', 1820 fn: arrow, 1821 effect: effect, 1822 requires: ['popperOffsets'], 1823 requiresIfExists: ['preventOverflow'] 1824 }; 1825 1826 function getSideOffsets(overflow, rect, preventedOffsets) { 1827 if (preventedOffsets === void 0) { 1828 preventedOffsets = { 1829 x: 0, 1830 y: 0 1831 }; 1832 } 1833 1834 return { 1835 top: overflow.top - rect.height - preventedOffsets.y, 1836 right: overflow.right - rect.width + preventedOffsets.x, 1837 bottom: overflow.bottom - rect.height + preventedOffsets.y, 1838 left: overflow.left - rect.width - preventedOffsets.x 1839 }; 1840 } 1841 1842 function isAnySideFullyClipped(overflow) { 1843 return [top, right, bottom, left].some(function (side) { 1844 return overflow[side] >= 0; 1845 }); 1846 } 1847 1848 function hide(_ref) { 1849 var state = _ref.state, 1850 name = _ref.name; 1851 var referenceRect = state.rects.reference; 1852 var popperRect = state.rects.popper; 1853 var preventedOffsets = state.modifiersData.preventOverflow; 1854 var referenceOverflow = detectOverflow(state, { 1855 elementContext: 'reference' 1856 }); 1857 var popperAltOverflow = detectOverflow(state, { 1858 altBoundary: true 1859 }); 1860 var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); 1861 var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); 1862 var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); 1863 var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); 1864 state.modifiersData[name] = { 1865 referenceClippingOffsets: referenceClippingOffsets, 1866 popperEscapeOffsets: popperEscapeOffsets, 1867 isReferenceHidden: isReferenceHidden, 1868 hasPopperEscaped: hasPopperEscaped 1869 }; 1870 state.attributes.popper = Object.assign({}, state.attributes.popper, { 1871 'data-popper-reference-hidden': isReferenceHidden, 1872 'data-popper-escaped': hasPopperEscaped 1873 }); 1874 } // eslint-disable-next-line import/no-unused-modules 1875 1876 1877 var hide$1 = { 1878 name: 'hide', 1879 enabled: true, 1880 phase: 'main', 1881 requiresIfExists: ['preventOverflow'], 1882 fn: hide 1883 }; 1884 1885 var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1]; 1886 var createPopper$1 = /*#__PURE__*/popperGenerator({ 1887 defaultModifiers: defaultModifiers$1 1888 }); // eslint-disable-next-line import/no-unused-modules 1889 1890 var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1]; 1891 var createPopper = /*#__PURE__*/popperGenerator({ 1892 defaultModifiers: defaultModifiers 1893 }); // eslint-disable-next-line import/no-unused-modules 1894 1895 exports.applyStyles = applyStyles$1; 1896 exports.arrow = arrow$1; 1897 exports.computeStyles = computeStyles$1; 1898 exports.createPopper = createPopper; 1899 exports.createPopperLite = createPopper$1; 1900 exports.defaultModifiers = defaultModifiers; 1901 exports.detectOverflow = detectOverflow; 1902 exports.eventListeners = eventListeners; 1903 exports.flip = flip$1; 1904 exports.hide = hide$1; 1905 exports.offset = offset$1; 1906 exports.popperGenerator = popperGenerator; 1907 exports.popperOffsets = popperOffsets$1; 1908 exports.preventOverflow = preventOverflow$1; 1909 1910 Object.defineProperty(exports, '__esModule', { value: true }); 1911 1912}))); 1913//# sourceMappingURL=popper.js.map 1914 1915/*! 1916 * Bootstrap v5.0.2 (https://getbootstrap.com/) 1917 * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 1918 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 1919 */ 1920 1921/*! 1922 * Customizations: 1923 * To process this file for IGHF project, realignment of jQuery object initialization in getJquery method. 1924* */ 1925(function (global, factory) { 1926 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core')) : 1927 typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) : 1928 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper)); 1929}(this, (function (Popper) { 'use strict'; 1930 1931 function _interopNamespace(e) {
1932 if (e && e.__esModule) return e; 1933 var n = Object.create(null); 1934 if (e) { 1935 Object.keys(e).forEach(function (k) { 1936 if (k !== 'default') { 1937 var d = Object.getOwnPropertyDescriptor(e, k); 1938 Object.defineProperty(n, k, d.get ? d : { 1939 enumerable: true, 1940 get: function () { 1941 return e[k]; 1942 } 1943 }); 1944 } 1945 }); 1946 } 1947 n['default'] = e; 1948 return Object.freeze(n); 1949 } 1950 1951 var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper); 1952 1953 /** 1954 * -------------------------------------------------------------------------- 1955 * Bootstrap (v5.0.2): dom/selector-engine.js 1956 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 1957 * -------------------------------------------------------------------------- 1958 */ 1959 1960 /** 1961 * ------------------------------------------------------------------------ 1962 * Constants 1963 * ------------------------------------------------------------------------ 1964 */ 1965 const NODE_TEXT = 3; 1966 const SelectorEngine = { 1967 find(selector, element = document.documentElement) { 1968 return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); 1969 }, 1970 1971 findOne(selector, element = document.documentElement) { 1972 return Element.prototype.querySelector.call(element, selector); 1973 }, 1974 1975 children(element, selector) { 1976 return [].concat(...element.children).filter(child => child.matches(selector)); 1977 }, 1978 1979 parents(element, selector) { 1980 const parents = []; 1981 let ancestor = element.parentNode; 1982 1983 while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) { 1984 if (ancestor.matches(selector)) { 1985 parents.push(ancestor); 1986 } 1987 1988 ancestor = ancestor.parentNode; 1989 } 1990 1991 return parents; 1992 }, 1993 1994 prev(element, selector) { 1995 let previous = element.previousElementSibling; 1996 1997 while (previous) { 1998 if (previous.matches(selector)) { 1999 return [previous]; 2000 } 2001 2002 previous = previous.previousElementSibling; 2003 } 2004 2005 return []; 2006 }, 2007 2008 next(element, selector) { 2009 let next = element.nextElementSibling; 2010 2011 while (next) { 2012 if (next.matches(selector)) { 2013 return [next]; 2014 } 2015 2016 next = next.nextElementSibling; 2017 } 2018 2019 return []; 2020 } 2021 2022 }; 2023 2024 /** 2025 * -------------------------------------------------------------------------- 2026 * Bootstrap (v5.0.2): util/index.js 2027 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 2028 * -------------------------------------------------------------------------- 2029 */ 2030 2031 const MAX_UID = 1000000; 2032 const MILLISECONDS_MULTIPLIER = 1000; 2033 const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 2034 2035 const toType = obj => { 2036 if (obj === null || obj === undefined) { 2037 return `${obj}`; 2038 } 2039 2040 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 2041 }; 2042 /** 2043 * -------------------------------------------------------------------------- 2044 * Public Util Api 2045 * -------------------------------------------------------------------------- 2046 */ 2047 2048 2049 const getUID = prefix => { 2050 do { 2051 prefix += Math.floor(Math.random() * MAX_UID); 2052 } while (document.getElementById(prefix)); 2053 2054 return prefix; 2055 }; 2056 2057 const getSelector = element => { 2058 let selector = element.getAttribute('data-bs-target'); 2059 2060 if (!selector || selector === '#') { 2061 let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes, 2062 // so everything starting with `#` or `.`. If a "real" URL is used as the selector, 2063 // `document.querySelector` will rightfully complain it is invali
vendor: 6,366 bytes, lines 2063-2273
2063d. 2064 // See https://github.com/twbs/bootstrap/issues/32273 2065 2066 if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) { 2067 return null; 2068 } // Just in case some CMS puts out a full URL with the anchor appended 2069 2070 2071 if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) { 2072 hrefAttr = `#${hrefAttr.split('#')[1]}`; 2073 } 2074 2075 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null; 2076 } 2077 2078 return selector; 2079 }; 2080 2081 const getSelectorFromElement = element => { 2082 const selector = getSelector(element); 2083 2084 if (selector) { 2085 return document.querySelector(selector) ? selector : null; 2086 } 2087 2088 return null; 2089 }; 2090 2091 const getElementFromSelector = element => { 2092 const selector = getSelector(element); 2093 return selector ? document.querySelector(selector) : null; 2094 }; 2095 2096 const getTransitionDurationFromElement = element => { 2097 if (!element) { 2098 return 0; 2099 } // Get transition-duration of the element 2100 2101 2102 let { 2103 transitionDuration, 2104 transitionDelay 2105 } = window.getComputedStyle(element); 2106 const floatTransitionDuration = Number.parseFloat(transitionDuration); 2107 const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 2108 2109 if (!floatTransitionDuration && !floatTransitionDelay) { 2110 return 0; 2111 } // If multiple durations are defined, take the first 2112 2113 2114 transitionDuration = transitionDuration.split(',')[0]; 2115 transitionDelay = transitionDelay.split(',')[0]; 2116 return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 2117 }; 2118 2119 const triggerTransitionEnd = element => { 2120 element.dispatchEvent(new Event(TRANSITION_END)); 2121 }; 2122 2123 const isElement = obj => { 2124 if (!obj || typeof obj !== 'object') { 2125 return false; 2126 } 2127 2128 if (typeof obj.jquery !== 'undefined') { 2129 obj = obj[0]; 2130 } 2131 2132 return typeof obj.nodeType !== 'undefined'; 2133 }; 2134 2135 const getElement = obj => { 2136 if (isElement(obj)) { 2137 // it's a jQuery object or a node element 2138 return obj.jquery ? obj[0] : obj; 2139 } 2140 2141 if (typeof obj === 'string' && obj.length > 0) { 2142 return SelectorEngine.findOne(obj); 2143 } 2144 2145 return null; 2146 }; 2147 2148 const typeCheckConfig = (componentName, config, configTypes) => { 2149 Object.keys(configTypes).forEach(property => { 2150 const expectedTypes = configTypes[property]; 2151 const value = config[property]; 2152 const valueType = value && isElement(value) ? 'element' : toType(value); 2153 2154 if (!new RegExp(expectedTypes).test(valueType)) { 2155 throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`); 2156 } 2157 }); 2158 }; 2159 2160 const isVisible = element => { 2161 if (!isElement(element) || element.getClientRects().length === 0) { 2162 return false; 2163 } 2164 2165 return getComputedStyle(element).getPropertyValue('visibility') === 'visible'; 2166 }; 2167 2168 const isDisabled = element => { 2169 if (!element || element.nodeType !== Node.ELEMENT_NODE) { 2170 return true; 2171 } 2172 2173 if (element.classList.contains('disabled')) { 2174 return true; 2175 } 2176 2177 if (typeof element.disabled !== 'undefined') { 2178 return element.disabled; 2179 } 2180 2181 return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'; 2182 }; 2183 2184 const findShadowRoot = element => { 2185 if (!document.documentElement.attachShadow) { 2186 return null; 2187 } // Can find the shadow root otherwise it'll return the document 2188 2189 2190 if (typeof element.getRootNode === 'function') { 2191 const root = element.getRootNode(); 2192 return root instanceof ShadowRoot ? root : null; 2193 } 2194 2195 if (element instanceof ShadowRoot) { 2196 return element; 2197 } // when we don't find a shadow root 2198 2199 2200 if (!element.parentNode) { 2201 return null; 2202 } 2203 2204 return findShadowRoot(element.parentNode); 2205 }; 2206 2207 const noop = () => {}; 2208 2209 const reflow = element => element.offsetHeight; 2210 2211 const getjQuery = () => { 2212 const {jQuery} = window; 2213 2214 if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { 2215 return jQuery; 2216 } 2217 2218 return null; 2219 }; 2220 2221 const DOMContentLoadedCallbacks = []; 2222 2223 const onDOMContentLoaded = callback => { 2224 if (document.readyState === 'loading') { 2225 // add listener on the first call when the document is in loading state 2226 if (!DOMContentLoadedCallbacks.length) { 2227 document.addEventListener('DOMContentLoaded', () => { 2228 DOMContentLoadedCallbacks.forEach(callback => callback()); 2229 }); 2230 } 2231 2232 DOMContentLoadedCallbacks.push(callback); 2233 } else { 2234 callback(); 2235 } 2236 }; 2237 2238 const isRTL = () => document.documentElement.dir === 'rtl'; 2239 2240 const defineJQueryPlugin = plugin => { 2241 onDOMContentLoaded(() => { 2242 const $ = getjQuery(); 2243 /* istanbul ignore if */ 2244 2245 if ($) { 2246 const name = plugin.NAME; 2247 const JQUERY_NO_CONFLICT = $.fn[name]; 2248 $.fn[name] = plugin.jQueryInterface; 2249 $.fn[name].Constructor = plugin; 2250 2251 $.fn[name].noConflict = () => { 2252 $.fn[name] = JQUERY_NO_CONFLICT; 2253 return plugin.jQueryInterface; 2254 }; 2255 } 2256 }); 2257 }; 2258 2259 const execute = callback => { 2260 if (typeof callback === 'function') { 2261 callback(); 2262 } 2263 }; 2264 2265 const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { 2266 if (!waitForTransition) { 2267 execute(callback); 2268 return; 2269 } 2270 2271 const durationPadding = 5; 2272 const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; 2273 let called = false;
2274 2275 const handler = ({ 2276 target 2277 }) => { 2278 if (target !== transitionElement) { 2279 return; 2280 } 2281 2282 called = true; 2283 transitionElement.removeEventListener(TRANSITION_END, handler); 2284 execute(callback); 2285 }; 2286 2287 transitionElement.addEventListener(TRANSITION_END, handler); 2288 setTimeout(() => { 2289 if (!called) { 2290 triggerTransitionEnd(transitionElement); 2291 } 2292 }, emulatedDuration); 2293 }; 2294 /** 2295 * Return the previous/next element of a list. 2296 * 2297 * @param {array} list The list of elements 2298 * @param activeElement The active element 2299 * @param shouldGetNext Choose to get next or previous element 2300 * @param isCycleAllowed 2301 * @return {Element|elem} The proper element 2302 */ 2303 2304 2305 const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { 2306 let index = list.indexOf(activeElement); // if the element does not exist in the list return an element depending on the direction and if cycle is allowed 2307 2308 if (index === -1) { 2309 return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0]; 2310 } 2311 2312 const listLength = list.length; 2313 index += shouldGetNext ? 1 : -1; 2314 2315 if (isCycleAllowed) { 2316 index = (index + listLength) % listLength; 2317 } 2318 2319 return list[Math.max(0, Math.min(index, listLength - 1))]; 2320 }; 2321 2322 /** 2323 * -------------------------------------------------------------------------- 2324 * Bootstrap (v5.0.2): dom/event-handler.js 2325 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 2326 * -------------------------------------------------------------------------- 2327 */ 2328 /** 2329 * ------------------------------------------------------------------------ 2330 * Constants 2331 * ------------------------------------------------------------------------ 2332 */ 2333 2334 const namespaceRegex = /[^.]*(?=\..*)\.|.*/; 2335 const stripNameRegex = /\..*/; 2336 const stripUidRegex = /::\d+$/; 2337 const eventRegistry = {}; // Events storage 2338 2339 let uidEvent = 1; 2340 const customEvents = { 2341 mouseenter: 'mouseover', 2342 mouseleave: 'mouseout' 2343 }; 2344 const customEventsRegex = /^(mouseenter|mouseleave)/i; 2345 const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); 2346 /** 2347 * ------------------------------------------------------------------------ 2348 * Private methods 2349 * ------------------------------------------------------------------------ 2350 */ 2351 2352 function getUidEvent(element, uid) { 2353 return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; 2354 } 2355 2356 function getEvent(element) { 2357 const uid = getUidEvent(element); 2358 element.uidEvent = uid; 2359 eventRegistry[uid] = eventRegistry[uid] || {}; 2360 return eventRegistry[uid]; 2361 } 2362 2363 function bootstrapHandler(element, fn) { 2364 return function handler(event) { 2365 event.delegateTarget = element; 2366 2367 if (handler.oneOff) { 2368 EventHandler.off(element, event.type, fn); 2369 } 2370 2371 return fn.apply(element, [event]); 2372 }; 2373 } 2374 2375 function bootstrapDelegationHandler(element, selector, fn) { 2376 return function handler(event) { 2377 const domElements = element.querySelectorAll(selector); 2378 2379 for (let { 2380 target 2381 } = event; target && target !== this; target = target.parentNode) { 2382 for (let i = domElements.length; i--;) { 2383 if (domElements[i] === target) { 2384 event.delegateTarget = target; 2385 2386 if (handler.oneOff) { 2387 // eslint-disable-next-line unicorn/consistent-destructuring 2388 EventHandler.off(element, event.type, selector, fn); 2389 } 2390 2391 return fn.apply(target, [event]); 2392 } 2393 } 2394 } // To please ESLint 2395 2396 2397 return null; 2398 }; 2399 } 2400 2401 function findHandler(events, handler, delegationSelector = null) { 2402 const uidEventList = Object.keys(events); 2403 2404 for (let i = 0, len = uidEventList.length; i < len; i++) { 2405 const event = events[uidEventList[i]]; 2406 2407 if (event.originalHandler === handler && event.delegationSelector === delegationSelector) { 2408 return event; 2409 } 2410 } 2411 2412 return null; 2413 } 2414 2415 function normalizeParams(originalTypeEvent, handler, delegationFn) { 2416 const delegation = typeof handler === 'string'; 2417 const originalHandler = delegation ? delegationFn : handler; 2418 let typeEvent = getTypeEvent(originalTypeEvent); 2419 const isNative = nativeEvents.has(typeEvent); 2420 2421 if (!isNative) { 2422 typeEvent = originalTypeEvent; 2423 } 2424 2425 return [delegation, originalHandler, typeEvent]; 2426 } 2427 2428 function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) { 2429 if (typeof originalTypeEvent !== 'string' || !element) { 2430 return; 2431 } 2432 2433 if (!handler) { 2434 handler = delegationFn; 2435 delegationFn = null; 2436 } // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position 2437 // this prevents the handler from being dispatched the same way as mouseover or mouseout does 2438 2439 2440 if (customEventsRegex.test(originalTypeEvent)) { 2441 const wrapFn = fn => { 2442 return function (event) { 2443 if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
2444 return fn.call(this, event); 2445 } 2446 }; 2447 }; 2448 2449 if (delegationFn) { 2450 delegationFn = wrapFn(delegationFn); 2451 } else { 2452 handler = wrapFn(handler); 2453 } 2454 } 2455 2456 const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn); 2457 const events = getEvent(element); 2458 const handlers = events[typeEvent] || (events[typeEvent] = {}); 2459 const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null); 2460 2461 if (previousFn) { 2462 previousFn.oneOff = previousFn.oneOff && oneOff; 2463 return; 2464 } 2465 2466 const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, '')); 2467 const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler); 2468 fn.delegationSelector = delegation ? handler : null; 2469 fn.originalHandler = originalHandler; 2470 fn.oneOff = oneOff; 2471 fn.uidEvent = uid; 2472 handlers[uid] = fn; 2473 element.addEventListener(typeEvent, fn, delegation); 2474 } 2475 2476 function removeHandler(element, events, typeEvent, handler, delegationSelector) { 2477 const fn = findHandler(events[typeEvent], handler, delegationSelector); 2478 2479 if (!fn) { 2480 return; 2481 } 2482 2483 element.removeEventListener(typeEvent, fn, Boolean(delegationSelector)); 2484 delete events[typeEvent][fn.uidEvent]; 2485 } 2486 2487 function removeNamespacedHandlers(element, events, typeEvent, namespace) { 2488 const storeElementEvent = events[typeEvent] || {}; 2489 Object.keys(storeElementEvent).forEach(handlerKey => { 2490 if (handlerKey.includes(namespace)) { 2491 const event = storeElementEvent[handlerKey]; 2492 removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector); 2493 } 2494 }); 2495 } 2496 2497 function getTypeEvent(event) { 2498 // allow to get the native events from namespaced events ('click.bs.button' --> 'click') 2499 event = event.replace(stripNameRegex, ''); 2500 return customEvents[event] || event; 2501 } 2502 2503 const EventHandler = { 2504 on(element, event, handler, delegationFn) { 2505 addHandler(element, event, handler, delegationFn, false); 2506 }, 2507 2508 one(element, event, handler, delegationFn) { 2509 addHandler(element, event, handler, delegationFn, true); 2510 }, 2511 2512 off(element, originalTypeEvent, handler, delegationFn) { 2513 if (typeof originalTypeEvent !== 'string' || !element) { 2514 return; 2515 } 2516 2517 const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn); 2518 const inNamespace = typeEvent !== originalTypeEvent; 2519 const events = getEvent(element); 2520 const isNamespace = originalTypeEvent.startsWith('.'); 2521 2522 if (typeof originalHandler !== 'undefined') { 2523 // Simplest case: handler is passed, remove that listener ONLY. 2524 if (!events || !events[typeEvent]) { 2525 return; 2526 } 2527 2528 removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null); 2529 return; 2530 } 2531 2532 if (isNamespace) { 2533 Object.keys(events).forEach(elementEvent => { 2534 removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); 2535 }); 2536 } 2537 2538 const storeElementEvent = events[typeEvent] || {}; 2539 Object.keys(storeElementEvent).forEach(keyHandlers => { 2540 const handlerKey = keyHandlers.replace(stripUidRegex, ''); 2541 2542 if (!inNamespace || originalTypeEvent.includes(handlerKey)) { 2543 const event = storeElementEvent[keyHandlers]; 2544 removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector); 2545 } 2546 }); 2547 }, 2548 2549 trigger(element, event, args) { 2550 if (typeof event !== 'string' || !element) { 2551 return null; 2552 } 2553 2554 const $ = getjQuery(); 2555 const typeEvent = getTypeEvent(event); 2556 const inNamespace = event !== typeEvent; 2557 const isNative = nativeEvents.has(typeEvent); 2558 let jQueryEvent; 2559 let bubbles = true; 2560 let nativeDispatch = true; 2561 let defaultPrevented = false;
2562 let evt = null; 2563 2564 if (inNamespace && $) { 2565 jQueryEvent = $.Event(event, args); 2566 $(element).trigger(jQueryEvent); 2567 bubbles = !jQueryEvent.isPropagationStopped(); 2568 nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); 2569 defaultPrevented = jQueryEvent.isDefaultPrevented(); 2570 } 2571 2572 if (isNative) { 2573 evt = document.createEvent('HTMLEvents'); 2574 evt.initEvent(typeEvent, bubbles, true); 2575 } else { 2576 evt = new CustomEvent(event, { 2577 bubbles, 2578 cancelable: true 2579 }); 2580 } // merge custom information in our event 2581 2582 2583 if (typeof args !== 'undefined') { 2584 Object.keys(args).forEach(key => { 2585 Object.defineProperty(evt, key, { 2586 get() { 2587 return args[key]; 2588 } 2589 2590 }); 2591 }); 2592 } 2593 2594 if (defaultPrevented) { 2595 evt.preventDefault(); 2596 } 2597 2598 if (nativeDispatch) { 2599 element.dispatchEvent(evt); 2600 } 2601 2602 if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') { 2603 jQueryEvent.preventDefault(); 2604 } 2605 2606 return evt; 2607 } 2608 2609 }; 2610 2611 /** 2612 * -------------------------------------------------------------------------- 2613 * Bootstrap (v5.0.2): dom/data.js 2614 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 2615 * -------------------------------------------------------------------------- 2616 */ 2617 2618 /** 2619 * ------------------------------------------------------------------------ 2620 * Constants 2621 * ------------------------------------------------------------------------ 2622 */ 2623 const elementMap = new Map(); 2624 var Data = { 2625 set(element, key, instance) { 2626 if (!elementMap.has(element)) { 2627 elementMap.set(element, new Map()); 2628 } 2629 2630 const instanceMap = elementMap.get(element); // make it clear we only want one instance per element 2631 // can be removed later when multiple key/instances are fine to be used 2632 2633 if (!instanceMap.has(key) && instanceMap.size !== 0) { 2634 // eslint-disable-next-line no-console 2635 console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`); 2636 return; 2637 } 2638 2639 instanceMap.set(key, instance); 2640 }, 2641 2642 get(element, key) { 2643 if (elementMap.has(element)) { 2644 return elementMap.get(element).get(key) || null; 2645 } 2646 2647 return null; 2648 }, 2649 2650 remove(element, key) { 2651 if (!elementMap.has(element)) { 2652 return; 2653 } 2654 2655 const instanceMap = elementMap.get(element); 2656 instanceMap.delete(key); // free up element references if there are no instances left for an element 2657 2658 if (instanceMap.size === 0) { 2659 elementMap.delete(element); 2660 } 2661 } 2662 2663 }; 2664 2665 /** 2666 * -------------------------------------------------------------------------- 2667 * Bootstrap (v5.0.2): base-component.js 2668 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 2669 * -------------------------------------------------------------------------- 2670 */ 2671 /** 2672 * ------------------------------------------------------------------------ 2673 * Constants 2674 * ------------------------------------------------------------------------ 2675 */ 2676 2677 const VERSION = '5.0.2'; 2678 2679 class BaseComponent { 2680 constructor(element) { 2681 element = getElement(element); 2682 2683 if (!element) { 2684 return; 2685 } 2686 2687 this._element = element; 2688 Data.set(this._element, this.constructor.DATA_KEY, this); 2689 } 2690 2691 dispose() { 2692 Data.remove(this._element, this.constructor.DATA_KEY); 2693 EventHandler.off(this._element, this.constructor.EVENT_KEY);
2694 Object.getOwnPropertyNames(this).forEach(propertyName => { 2695 this[propertyName] = null; 2696 }); 2697 } 2698 2699 _queueCallback(callback, element, isAnimated = true) { 2700 executeAfterTransition(callback, element, isAnimated); 2701 } 2702 /** Static */ 2703 2704 2705 static getInstance(element) { 2706 return Data.get(element, this.DATA_KEY); 2707 } 2708 2709 static getOrCreateInstance(element, config = {}) { 2710 return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); 2711 } 2712 2713 static get VERSION() { 2714 return VERSION; 2715 } 2716 2717 static get NAME() { 2718 throw new Error('You have to implement the static method "NAME", for each component!'); 2719 } 2720 2721 static get DATA_KEY() { 2722 return `bs.${this.NAME}`; 2723 } 2724 2725 static get EVENT_KEY() { 2726 return `.${this.DATA_KEY}`; 2727 } 2728 2729 } 2730 2731 /** 2732 * -------------------------------------------------------------------------- 2733 * Bootstrap (v5.0.2): alert.js 2734 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 2735 * -------------------------------------------------------------------------- 2736 */ 2737 /** 2738 * ------------------------------------------------------------------------ 2739 * Constants 2740 * ------------------------------------------------------------------------ 2741 */ 2742 2743 const NAME$c = 'alert'; 2744 const DATA_KEY$b = 'bs.alert'; 2745 const EVENT_KEY$b = `.${DATA_KEY$b}`; 2746 const DATA_API_KEY$8 = '.data-api'; 2747 const SELECTOR_DISMISS = '[data-bs-dismiss="alert"]'; 2748 const EVENT_CLOSE = `close${EVENT_KEY$b}`; 2749 const EVENT_CLOSED = `closed${EVENT_KEY$b}`; 2750 const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$b}${DATA_API_KEY$8}`; 2751 const CLASS_NAME_ALERT = 'alert'; 2752 const CLASS_NAME_FADE$6 = 'fade'; 2753 const CLASS_NAME_SHOW$9 = 'show'; 2754 /** 2755 * ------------------------------------------------------------------------ 2756 * Class Definition 2757 * ------------------------------------------------------------------------ 2758 */ 2759 2760 class Alert extends BaseComponent { 2761 // Getters 2762 static get NAME() { 2763 return NAME$c; 2764 } // Public 2765 2766 2767 close(element) { 2768 const rootElement = element ? this._getRootElement(element) : this._element; 2769 2770 const customEvent = this._triggerCloseEvent(rootElement); 2771 2772 if (customEvent === null || customEvent.defaultPrevented) { 2773 return; 2774 } 2775 2776 this._removeElement(rootElement); 2777 } // Private 2778 2779 2780 _getRootElement(element) { 2781 return getElementFromSelector(element) || element.closest(`.${CLASS_NAME_ALERT}`); 2782 } 2783 2784 _triggerCloseEvent(element) { 2785 return EventHandler.trigger(element, EVENT_CLOSE); 2786 } 2787 2788 _removeElement(element) { 2789 element.classList.remove(CLASS_NAME_SHOW$9); 2790 const isAnimated = element.classList.contains(CLASS_NAME_FADE$6); 2791 2792 this._queueCallback(() => this._destroyElement(element), element, isAnimated); 2793 } 2794 2795 _destroyElement(element) { 2796 element.remove(); 2797 EventHandler.trigger(element, EVENT_CLOSED); 2798 } // Static 2799 2800 2801 static jQueryInterface(config) { 2802 return this.each(function () { 2803 const data = Alert.getOrCreateInstance(this); 2804 2805 if (config === 'close') { 2806 data[config](this); 2807 } 2808 }); 2809 } 2810 2811 static handleDismiss(alertInstance) { 2812 return function (event) { 2813 if (event) { 2814 event.preventDefault(); 2815 } 2816 2817 alertInstance.close(this); 2818 }; 2819 } 2820 2821 } 2822 /** 2823 * ------------------------------------------------------------------------ 2824 * Data Api implementation 2825 * ------------------------------------------------------------------------ 2826 */ 2827 2828 2829 EventHandler.on(document, EVENT_CLICK_DATA_API$7, SELECTOR_DISMISS, Alert.handleDismiss(new Alert())); 2830 /** 2831 * ------------------------------------------------------------------------ 2832 * jQuery 2833 * ------------------------------------------------------------------------ 2834 * add .Alert to jQuery only if jQuery is present 2835 */ 2836 2837 defineJQueryPlugin(Alert); 2838 2839 /** 2840 * -------------------------------------------------------------------------- 2841 * Bootstrap (v5.0.2): button.js 2842 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 2843 * -------------------------------------------------------------------------- 2844 */ 2845 /** 2846 * ------------------------------------------------------------------------ 2847 * Constants 2848 * ------------------------------------------------------------------------ 2849 */ 2850 2851 const NAME$b = 'button'; 2852 const DATA_KEY$a = 'bs.button'; 2853 const EVENT_KEY$a = `.${DATA_KEY$a}`; 2854 const DATA_API_KEY$7 = '.data-api'; 2855 const CLASS_NAME_ACTIVE$3 = 'active'; 2856 const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; 2857 const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$7}`; 2858 /** 2859 * ------------------------------------------------------------------------ 2860 * Class Definition 2861 * ------------------------------------------------------------------------ 2862 */ 2863 2864 class Button extends BaseComponent { 2865 // Getters 2866 static get NAME() { 2867 return NAME$b; 2868 } // Public 2869 2870 2871 toggle() { 2872 // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle(
2872)` method 2873 this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); 2874 } // Static 2875 2876 2877 static jQueryInterface(config) { 2878 return this.each(function () { 2879 const data = Button.getOrCreateInstance(this); 2880 2881 if (config === 'toggle') { 2882 data[config](); 2883 } 2884 }); 2885 } 2886 2887 } 2888 /** 2889 * ------------------------------------------------------------------------ 2890 * Data Api implementation 2891 * ------------------------------------------------------------------------ 2892 */ 2893 2894 2895 EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => { 2896 event.preventDefault(); 2897 const button = event.target.closest(SELECTOR_DATA_TOGGLE$5); 2898 const data = Button.getOrCreateInstance(button); 2899 data.toggle(); 2900 }); 2901 /** 2902 * ------------------------------------------------------------------------ 2903 * jQuery 2904 * ------------------------------------------------------------------------ 2905 * add .Button to jQuery only if jQuery is present 2906 */ 2907 2908 defineJQueryPlugin(Button); 2909 2910 /** 2911 * -------------------------------------------------------------------------- 2912 * Bootstrap (v5.0.2): dom/manipulator.js 2913 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 2914 * -------------------------------------------------------------------------- 2915 */ 2916 function normalizeData(val) { 2917 if (val === 'true') { 2918 return true; 2919 } 2920 2921 if (val === 'false') { 2922 return false; 2923 } 2924 2925 if (val === Number(val).toString()) { 2926 return Number(val); 2927 } 2928 2929 if (val === '' || val === 'null') { 2930 return null; 2931 } 2932 2933 return val; 2934 } 2935 2936 function normalizeDataKey(key) { 2937 return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); 2938 } 2939 2940 const Manipulator = { 2941 setDataAttribute(element, key, value) { 2942 element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value); 2943 }, 2944 2945 removeDataAttribute(element, key) { 2946 element.removeAttribute(`data-bs-${normalizeDataKey(key)}`); 2947 }, 2948 2949 getDataAttributes(element) { 2950 if (!element) { 2951 return {}; 2952 } 2953 2954 const attributes = {}; 2955 Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => { 2956 let pureKey = key.replace(/^bs/, ''); 2957 pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); 2958 attributes[pureKey] = normalizeData(element.dataset[key]); 2959 }); 2960 return attributes; 2961 }, 2962 2963 getDataAttribute(element, key) { 2964 return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)); 2965 }, 2966 2967 offset(element) { 2968 const rect = element.getBoundingClientRect(); 2969 return { 2970 top: rect.top + document.body.scrollTop, 2971 left: rect.left + document.body.scrollLeft 2972 }; 2973 }, 2974 2975 position(element) { 2976 return { 2977 top: element.offsetTop, 2978 left: element.offsetLeft 2979 }; 2980 } 2981 2982 }; 2983 2984 /** 2985 * -------------------------------------------------------------------------- 2986 * Bootstrap (v5.0.2): carousel.js 2987 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 2988 * -------------------------------------------------------------------------- 2989 */ 2990 /** 2991 * ------------------------------------------------------------------------ 2992 * Constants 2993 * ------------------------------------------------------------------------ 2994 */ 2995 2996 const NAME$a = 'carousel'; 2997 const DATA_KEY$9 = 'bs.carousel'; 2998 const EVENT_KEY$9 = `.${DATA_KEY$9}`; 2999 const DATA_API_KEY$6 = '.data-api'; 3000 const ARROW_LEFT_KEY = 'ArrowLeft'; 3001 const ARROW_RIGHT_KEY = 'ArrowRight'; 3002 const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 3003 3004 const SWIPE_THRESHOLD = 40; 3005 const Default$9 = { 3006 interval: 5000, 3007 keyboard: true, 3008 slide: false, 3009 pause: 'hover', 3010 wrap: true, 3011 touch: true 3012 }; 3013 const DefaultType$9 = { 3014 interval: '(number|boolean)', 3015 keyboard: 'boolean', 3016 slide: '(boolean|string)', 3017 pause: '(string|boolean)', 3018 wrap: 'boolean', 3019 touch: 'boolean' 3020 }; 3021 const ORDER_NEXT = 'next'; 3022 const ORDER_PREV = 'prev'; 3023 const DIRECTION_LEFT = 'left'; 3024 const DIRECTION_RIGHT = 'right'; 3025 const KEY_TO_DIRECTION = { 3026 [ARROW_LEFT_KEY]: DIRECTION_RIGHT, 3027 [ARROW_RIGHT_KEY]: DIRECTION_LEFT 3028 }; 3029 const EVENT_SLIDE = `slide${EVENT_KEY$9}`; 3030 const EVENT_SLID = `slid${EVENT_KEY$9}`; 3031 const EVENT_KEYDOWN = `keydown${EVENT_KEY$9}`; 3032 const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$9}`; 3033 const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$9}`; 3034 const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`; 3035 const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`; 3036 const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`; 3037 const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`; 3038 const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`; 3039 const EVENT_DRAG_START = `dragstart${EVENT_KEY$9}`; 3040 const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$9}${DATA_API_KEY$6}`; 3041 const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$9}${DATA_API_KEY$6}`; 3042 const CLASS_NAME_CAROUSEL = 'carousel'; 3043 const CLASS_NAME_ACTIVE$2 = 'active'; 3044 const CLASS_NAME_SLIDE = 'slide'; 3045 const CLASS_NAME_END = 'carousel-item-end'; 3046 const CLASS_NAME_START = 'carousel-item-start'; 3047 const CLASS_NAME_NEXT = 'carousel-item-next'; 3048 const CLASS_NAME_PREV = 'carousel-item-prev'; 3049 const CLASS_NAME_POINTER_EVENT = 'pointer-event'; 3050 const SELECTOR_ACTIVE$1 = '.active'; 3051 const SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
3052 const SELECTOR_ITEM = '.carousel-item'; 3053 const SELECTOR_ITEM_IMG = '.carousel-item img'; 3054 const SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; 3055 const SELECTOR_INDICATORS = '.carousel-indicators'; 3056 const SELECTOR_INDICATOR = '[data-bs-target]'; 3057 const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; 3058 const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; 3059 const POINTER_TYPE_TOUCH = 'touch'; 3060 const POINTER_TYPE_PEN = 'pen'; 3061 /** 3062 * ------------------------------------------------------------------------ 3063 * Class Definition 3064 * ------------------------------------------------------------------------ 3065 */ 3066 3067 class Carousel extends BaseComponent { 3068 constructor(element, config) { 3069 super(element); 3070 this._items = null; 3071 this._interval = null; 3072 this._activeElement = null; 3073 this._isPaused = false; 3074 this._isSliding = false; 3075 this.touchTimeout = null; 3076 this.touchStartX = 0; 3077 this.touchDeltaX = 0; 3078 this._config = this._getConfig(config); 3079 this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); 3080 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 3081 this._pointerEvent = Boolean(window.PointerEvent); 3082 3083 this._addEventListeners(); 3084 } // Getters 3085 3086 3087 static get Default() { 3088 return Default$9; 3089 } 3090 3091 static get NAME() { 3092 return NAME$a; 3093 } // Public 3094 3095 3096 next() { 3097 this._slide(ORDER_NEXT); 3098 } 3099 3100 nextWhenVisible() { 3101 // Don't call next when the page isn't visible 3102 // or the carousel or its parent isn't visible 3103 if (!document.hidden && isVisible(this._element)) { 3104 this.next(); 3105 } 3106 } 3107 3108 prev() { 3109 this._slide(ORDER_PREV); 3110 } 3111 3112 pause(event) { 3113 if (!event) { 3114 this._isPaused = true; 3115 } 3116 3117 if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) { 3118 triggerTransitionEnd(this._element); 3119 this.cycle(true); 3120 } 3121 3122 clearInterval(this._interval); 3123 this._interval = null; 3124 } 3125 3126 cycle(event) { 3127 if (!event) { 3128 this._isPaused = false; 3129 } 3130 3131 if (this._interval) { 3132 clearInterval(this._interval); 3133 this._interval = null; 3134 } 3135 3136 if (this._config && this._config.interval && !this._isPaused) { 3137 this._updateInterval(); 3138 3139 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 3140 } 3141 } 3142 3143 to(index) { 3144 this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); 3145 3146 const activeIndex = this._getItemIndex(this._activeElement); 3147 3148 if (index > this._items.length - 1 || index < 0) { 3149 return; 3150 } 3151 3152 if (this._isSliding) { 3153 EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); 3154 return; 3155 } 3156 3157 if (activeIndex === index) { 3158 this.pause(); 3159 this.cycle(); 3160 return; 3161 } 3162 3163 const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; 3164 3165 this._slide(order, this._items[index]); 3166 } // Private 3167 3168 3169 _getConfig(config) { 3170 config = { ...Default$9, 3171 ...Manipulator.getDataAttributes(this._element), 3172 ...(typeof config === 'object' ? config : {}) 3173 }; 3174 typeCheckConfig(NAME$a, config, DefaultType$9); 3175 return config; 3176 } 3177 3178 _handleSwipe() { 3179 const absDeltax = Math.abs(this.touchDeltaX); 3180 3181 if (absDeltax <= SWIPE_THRESHOLD) { 3182 return; 3183 } 3184 3185 const direction = absDeltax / this.touchDeltaX; 3186 this.touchDeltaX = 0; 3187 3188 if (!direction) { 3189 return; 3190 } 3191 3192 this._slide(direction > 0 ? DIRECTION_RIGHT : DIRECTION_LEFT); 3193 } 3194 3195 _addEventListeners() { 3196 if (this._config.keyboard) { 3197 EventHandler.on(this._element, EVENT_KEYDOWN, event =>
3197 this._keydown(event)); 3198 } 3199 3200 if (this._config.pause === 'hover') { 3201 EventHandler.on(this._element, EVENT_MOUSEENTER, event => this.pause(event)); 3202 EventHandler.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event)); 3203 } 3204 3205 if (this._config.touch && this._touchSupported) { 3206 this._addTouchEventListeners(); 3207 } 3208 } 3209 3210 _addTouchEventListeners() { 3211 const start = event => { 3212 if (this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) { 3213 this.touchStartX = event.clientX; 3214 } else if (!this._pointerEvent) { 3215 this.touchStartX = event.touches[0].clientX; 3216 } 3217 }; 3218 3219 const move = event => { 3220 // ensure swiping with one touch and not pinching 3221 this.touchDeltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this.touchStartX; 3222 }; 3223 3224 const end = event => { 3225 if (this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)) { 3226 this.touchDeltaX = event.clientX - this.touchStartX; 3227 } 3228 3229 this._handleSwipe(); 3230 3231 if (this._config.pause === 'hover') { 3232 // If it's a touch-enabled device, mouseenter/leave are fired as 3233 // part of the mouse compatibility events on first tap - the carousel 3234 // would stop cycling until user tapped out of it; 3235 // here, we listen for touchend, explicitly pause the carousel 3236 // (as if it's the second time we tap on it, mouseenter compat event 3237 // is NOT fired) and after a timeout (to allow for mouse compatibility 3238 // events to fire) we explicitly restart cycling 3239 this.pause(); 3240 3241 if (this.touchTimeout) { 3242 clearTimeout(this.touchTimeout); 3243 } 3244 3245 this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval); 3246 } 3247 }; 3248 3249 SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => { 3250 EventHandler.on(itemImg, EVENT_DRAG_START, e => e.preventDefault()); 3251 }); 3252 3253 if (this._pointerEvent) { 3254 EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event)); 3255 EventHandler.on(this._element, EVENT_POINTERUP, event => end(event)); 3256 3257 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 3258 } else { 3259 EventHandler.on(this._element, EVENT_TOUCHSTART, event => start(event)); 3260 EventHandler.on(this._element, EVENT_TOUCHMOVE, event => move(event)); 3261 EventHandler.on(this._element, EVENT_TOUCHEND, event => end(event)); 3262 } 3263 } 3264 3265 _keydown(event) { 3266 if (/input|textarea/i.test(event.target.tagName)) { 3267 return; 3268 } 3269 3270 const direction = KEY_TO_DIRECTION[event.key]; 3271 3272 if (direction) { 3273 event.preventDefault(); 3274 3275 this._slide(direction); 3276 } 3277 } 3278 3279 _getItemIndex(element) { 3280 this._items = element && element.parentNode ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : []; 3281 return this._items.indexOf(element); 3282 } 3283 3284 _getItemByOrder(order, activeElement) { 3285 const isNext = order === ORDER_NEXT; 3286 return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap); 3287 } 3288 3289 _triggerSlideEvent(relatedTarget, eventDirectionName) { 3290 const targetIndex = this._getItemIndex(relatedTarget); 3291 3292 const fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)); 3293 3294 return EventHandler.trigger(this._element, EVENT_SLIDE, { 3295 relatedTarget, 3296 direction: eventDirectionName, 3297 from: fromIndex, 3298 to: targetIndex 3299 }); 3300 } 3301
3302 _setActiveIndicatorElement(element) { 3303 if (this._indicatorsElement) { 3304 const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE$1, this._indicatorsElement); 3305 activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); 3306 activeIndicator.removeAttribute('aria-current'); 3307 const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement); 3308 3309 for (let i = 0; i < indicators.length; i++) { 3310 if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) { 3311 indicators[i].classList.add(CLASS_NAME_ACTIVE$2); 3312 indicators[i].setAttribute('aria-current', 'true'); 3313 break; 3314 } 3315 } 3316 } 3317 } 3318 3319 _updateInterval() { 3320 const element = this._activeElement || SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); 3321 3322 if (!element) { 3323 return; 3324 } 3325 3326 const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); 3327 3328 if (elementInterval) { 3329 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 3330 this._config.interval = elementInterval; 3331 } else { 3332 this._config.interval = this._config.defaultInterval || this._config.interval; 3333 } 3334 } 3335 3336 _slide(directionOrOrder, element) { 3337 const order = this._directionToOrder(directionOrOrder); 3338 3339 const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); 3340 3341 const activeElementIndex = this._getItemIndex(activeElement); 3342 3343 const nextElement = element || this._getItemByOrder(order, activeElement); 3344 3345 const nextElementIndex = this._getItemIndex(nextElement); 3346 3347 const isCycling = Boolean(this._interval); 3348 const isNext = order === ORDER_NEXT; 3349 const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; 3350 const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; 3351 3352 const eventDirectionName = this._orderToDirection(order); 3353 3354 if (nextElement && nextElement.classList.contains(CLASS_NAME_ACTIVE$2)) { 3355 this._isSliding = false; 3356 return; 3357 } 3358 3359 if (this._isSliding) { 3360 return; 3361 } 3362 3363 const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 3364 3365 if (slideEvent.defaultPrevented) { 3366 return; 3367 } 3368 3369 if (!activeElement || !nextElement) { 3370 // Some weirdness is happening, so we bail 3371 return; 3372 } 3373 3374 this._isSliding = true; 3375 3376 if (isCycling) { 3377 this.pause(); 3378 } 3379 3380 this._setActiveIndicatorElement(nextElement); 3381 3382 this._activeElement = nextElement; 3383 3384 const triggerSlidEvent = () => { 3385 EventHandler.trigger(this._element, EVENT_SLID, { 3386 relatedTarget: nextElement, 3387 direction: eventDirectionName, 3388 from: activeElementIndex, 3389 to: nextElementIndex 3390 }); 3391 }; 3392 3393 if (this._element.classList.contains(CLASS_NAME_SLIDE)) { 3394 nextElement.classList.add(orderClassName); 3395 reflow(nextElement); 3396 activeElement.classList.add(directionalClassName); 3397 nextElement.classList.add(directionalClassName); 3398 3399 const completeCallBack = () => { 3400 nextElement.classList.remove(directionalClassName, orderClassName); 3401 nextElement.classList.add(CLASS_NAME_ACTIVE$2); 3402 activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); 3403 this._isSliding = false; 3404 setTimeout(triggerSlidEvent, 0); 3405 }; 3406 3407 this._queueCallback(completeCallBack, activeElement, true); 3408 } else { 3409 activeElement.classList.remove(CLASS_NAME_ACTIVE$2); 3410 nextElement.classList.add(CLASS_NAME_ACTIVE$2); 3411 this._isSliding = false;
3412 triggerSlidEvent(); 3413 } 3414 3415 if (isCycling) { 3416 this.cycle(); 3417 } 3418 } 3419 3420 _directionToOrder(direction) { 3421 if (![DIRECTION_RIGHT, DIRECTION_LEFT].includes(direction)) { 3422 return direction; 3423 } 3424 3425 if (isRTL()) { 3426 return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; 3427 } 3428 3429 return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; 3430 } 3431 3432 _orderToDirection(order) { 3433 if (![ORDER_NEXT, ORDER_PREV].includes(order)) { 3434 return order; 3435 } 3436 3437 if (isRTL()) { 3438 return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; 3439 } 3440 3441 return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; 3442 } // Static 3443 3444 3445 static carouselInterface(element, config) { 3446 const data = Carousel.getOrCreateInstance(element, config); 3447 let { 3448 _config 3449 } = data; 3450 3451 if (typeof config === 'object') { 3452 _config = { ..._config, 3453 ...config 3454 }; 3455 } 3456 3457 const action = typeof config === 'string' ? config : _config.slide; 3458 3459 if (typeof config === 'number') { 3460 data.to(config); 3461 } else if (typeof action === 'string') { 3462 if (typeof data[action] === 'undefined') { 3463 throw new TypeError(`No method named "${action}"`); 3464 } 3465 3466 data[action](); 3467 } else if (_config.interval && _config.ride) { 3468 data.pause(); 3469 data.cycle(); 3470 } 3471 } 3472 3473 static jQueryInterface(config) { 3474 return this.each(function () { 3475 Carousel.carouselInterface(this, config); 3476 }); 3477 } 3478 3479 static dataApiClickHandler(event) { 3480 const target = getElementFromSelector(this); 3481 3482 if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { 3483 return; 3484 } 3485 3486 const config = { ...Manipulator.getDataAttributes(target), 3487 ...Manipulator.getDataAttributes(this) 3488 }; 3489 const slideIndex = this.getAttribute('data-bs-slide-to'); 3490 3491 if (slideIndex) { 3492 config.interval = false; 3493 } 3494 3495 Carousel.carouselInterface(target, config); 3496 3497 if (slideIndex) { 3498 Carousel.getInstance(target).to(slideIndex); 3499 } 3500 3501 event.preventDefault(); 3502 } 3503 3504 } 3505 /** 3506 * ------------------------------------------------------------------------ 3507 * Data Api implementation 3508 * ------------------------------------------------------------------------ 3509 */ 3510 3511 3512 EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler); 3513 EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => { 3514 const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); 3515 3516 for (let i = 0, len = carousels.length; i < len; i++) { 3517 Carousel.carouselInterface(carousels[i], Carousel.getInstance(carou
3517sels[i])); 3518 } 3519 }); 3520 /** 3521 * ------------------------------------------------------------------------ 3522 * jQuery 3523 * ------------------------------------------------------------------------ 3524 * add .Carousel to jQuery only if jQuery is present 3525 */ 3526 3527 defineJQueryPlugin(Carousel); 3528 3529 /** 3530 * -------------------------------------------------------------------------- 3531 * Bootstrap (v5.0.2): collapse.js 3532 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 3533 * -------------------------------------------------------------------------- 3534 */ 3535 /** 3536 * ------------------------------------------------------------------------ 3537 * Constants 3538 * ------------------------------------------------------------------------ 3539 */ 3540 3541 const NAME$9 = 'collapse'; 3542 const DATA_KEY$8 = 'bs.collapse'; 3543 const EVENT_KEY$8 = `.${DATA_KEY$8}`; 3544 const DATA_API_KEY$5 = '.data-api'; 3545 const Default$8 = { 3546 toggle: true, 3547 parent: '' 3548 }; 3549 const DefaultType$8 = { 3550 toggle: 'boolean', 3551 parent: '(string|element)' 3552 }; 3553 const EVENT_SHOW$5 = `show${EVENT_KEY$8}`; 3554 const EVENT_SHOWN$5 = `shown${EVENT_KEY$8}`; 3555 const EVENT_HIDE$5 = `hide${EVENT_KEY$8}`; 3556 const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$8}`; 3557 const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`; 3558 const CLASS_NAME_SHOW$8 = 'show'; 3559 const CLASS_NAME_COLLAPSE = 'collapse'; 3560 const CLASS_NAME_COLLAPSING = 'collapsing'; 3561 const CLASS_NAME_COLLAPSED = 'collapsed'; 3562 const WIDTH = 'width'; 3563 const HEIGHT = 'height'; 3564 const SELECTOR_ACTIVES = '.show, .collapsing'; 3565 const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; 3566 /** 3567 * ------------------------------------------------------------------------ 3568 * Class Definition 3569 * ------------------------------------------------------------------------ 3570 */ 3571 3572 class Collapse extends BaseComponent { 3573 constructor(element, config) { 3574 super(element); 3575 this._isTransitioning = false; 3576 this._config = this._getConfig(config); 3577 this._triggerArray = SelectorEngine.find(`${SELECTOR_DATA_TOGGLE$4}[href="#${this._element.id}"],` + `${SELECTOR_DATA_TOGGLE$4}[data-bs-target="#${this._element.id}"]`); 3578 const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); 3579 3580 for (let i = 0, len = toggleList.length; i < len; i++) { 3581 const elem = toggleList[i]; 3582 const selector = getSelectorFromElement(elem); 3583 const filterElement = SelectorEngine.find(selector).filter(foundElem => foundElem === this._element); 3584 3585 if (selector !== null && filterElement.length) { 3586 this._selector = selector; 3587 3588 this._triggerArray.push(elem); 3589 } 3590 } 3591 3592 this._parent = this._config.parent ? this._getParent() : null; 3593 3594 if (!this._config.parent) { 3595 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 3596 } 3597 3598 if (this._config.toggle) { 3599 this.toggle(); 3600 } 3601 } // Getters 3602 3603 3604 static get Default() { 3605 return Default$8; 3606 } 3607 3608 static get NAME() { 3609 return NAME$9; 3610 } // Public 3611 3612 3613 toggle() { 3614 if (this._element.classList.contains(CLASS_NAME_SHOW$8)) { 3615 this.hide(); 3616 } else { 3617 this.show(); 3618 } 3619 } 3620 3621 show() { 3622 if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW$8)) { 3623 return; 3624 } 3625 3626 let actives; 3627 let activesData; 3628 3629 if (this._parent) { 3630 actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent).filter(elem => { 3631 if (typeof this._config.parent === 'string') { 3632 return elem.getAttribute('data-bs-parent') === this._config.parent; 3633 } 3634 3635 return elem.classList.contains(CLASS_NAME_COLLAPSE); 3636 }); 3637 3638 if (actives.length === 0) { 3639 actives = null; 3640 } 3641 } 3642 3643 const container = SelectorEngine.findOne(this._selector); 3644 3645 if (actives) { 3646 const tempActiveData = actives.find(elem => container !== elem); 3647 activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null; 3648 3649 if (activesData && activesData._isTransitioning) { 3650 return; 3651 } 3652 } 3653 3654 const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$5); 3655 3656 if (startEvent.defaultPrevented) { 3657 return; 3658 } 3659 3660 if (actives) {
3661 actives.forEach(elemActive => { 3662 if (container !== elemActive) { 3663 Collapse.collapseInterface(elemActive, 'hide'); 3664 } 3665 3666 if (!activesData) { 3667 Data.set(elemActive, DATA_KEY$8, null); 3668 } 3669 }); 3670 } 3671 3672 const dimension = this._getDimension(); 3673 3674 this._element.classList.remove(CLASS_NAME_COLLAPSE); 3675 3676 this._element.classList.add(CLASS_NAME_COLLAPSING); 3677 3678 this._element.style[dimension] = 0; 3679 3680 if (this._triggerArray.length) { 3681 this._triggerArray.forEach(element => { 3682 element.classList.remove(CLASS_NAME_COLLAPSED); 3683 element.setAttribute('aria-expanded', true); 3684 }); 3685 } 3686 3687 this.setTransitioning(true); 3688 3689 const complete = () => { 3690 this._element.classList.remove(CLASS_NAME_COLLAPSING); 3691 3692 this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$8); 3693 3694 this._element.style[dimension] = ''; 3695 this.setTransitioning(false); 3696 EventHandler.trigger(this._element, EVENT_SHOWN$5); 3697 }; 3698 3699 const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 3700 const scrollSize = `scroll${capitalizedDimension}`; 3701 3702 this._queueCallback(complete, this._element, true); 3703 3704 this._element.style[dimension] = `${this._element[scrollSize]}px`; 3705 } 3706 3707 hide() { 3708 if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW$8)) { 3709 return; 3710 } 3711 3712 const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$5); 3713 3714 if (startEvent.defaultPrevented) { 3715 return; 3716 } 3717 3718 const dimension = this._getDimension(); 3719 3720 this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; 3721 reflow(this._element); 3722 3723 this._element.classList.add(CLASS_NAME_COLLAPSING); 3724 3725 this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$8); 3726 3727 const triggerArrayLength = this._triggerArray.length; 3728 3729 if (triggerArrayLength > 0) { 3730 for (let i = 0; i < triggerArrayLength; i++) { 3731 const trigger = this._triggerArray[i]; 3732 const elem = getElementFromSelector(trigger); 3733 3734 if (elem && !elem.classList.contains(CLASS_NAME_SHOW$8)) { 3735 trigger.classList.add(CLASS_NAME_COLLAPSED); 3736 trigger.setAttribute('aria-expanded', false); 3737 } 3738 } 3739 } 3740 3741 this.setTransitioning(true); 3742 3743 const complete = () => { 3744 this.setTransitioning(false); 3745 3746 this._element.classList.remove(CLASS_NAME_COLLAPSING); 3747 3748 this._element.classList.add(CLASS_NAME_COLLAPSE); 3749 3750 EventHandler.trigger(this._element, EVENT_HIDDEN$5); 3751 }; 3752 3753 this._element.style[dimension] = ''; 3754 3755 this._queueCallback(complete, this._element, true); 3756 } 3757 3758 setTransitioning(isTransitioning) { 3759 this._isTransitioning = isTransitioning; 3760 } // Private 3761 3762 3763 _getConfig(config) { 3764 config = { ...Default$8, 3765 ...config 3766 }; 3767 config.toggle = Boolean(config.toggle); // Coerce string values 3768 3769 typeCheckConfig(NAME$9, config, DefaultType$8); 3770 return config; 3771 } 3772 3773 _getDimension() { 3774 return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT; 3775 } 3776 3777 _getParent() { 3778 let { 3779 parent 3780 } = this._config; 3781 parent = getElement(parent); 3782 const selector = `${SELECTOR_DATA_TOGGLE$4}[data-bs-parent="${parent}"]`; 3783 SelectorEngine.find(selector, parent).forEach(element => { 3784 const selected = getElementFromSelector(element); 3785 3786 this._addAriaAndCollapsedClass(selected, [element]); 3787 }); 3788 return parent; 3789 } 3790 3791 _addAriaAndCollapsedClass(element, triggerArray) { 3792 if (!element || !triggerArray.length) { 3793 return; 3794 } 3795 3796 const isOpen = element.classList.contains(CLASS_NAME_SHOW$8); 3797 triggerArray.forEach(elem => { 3798 if (isOpen) { 3799 elem.classList.remove(CLASS_NAME_COLLAPSED); 3800 } else { 3801 elem.classList.add(CLASS_NAME_COLLAPSED); 3802 } 3803 3804 elem.setAttribute('aria-expanded', isOpen); 3805 }); 3806 } // Static 3807 3808 3809 static collapseInterface(element, config) { 3810 let data = Collapse.getInstance(element); 3811 const _config = { ...Default$8, 3812 ...Manipulator.getDataAttributes(element), 3813 ...(typeof config === 'object' && config ? config : {}) 3814 }; 3815 3816 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { 3817 _config.toggle = false;
3818 } 3819 3820 if (!data) { 3821 data = new Collapse(element, _config); 3822 } 3823 3824 if (typeof config === 'string') { 3825 if (typeof data[config] === 'undefined') { 3826 throw new TypeError(`No method named "${config}"`); 3827 } 3828 3829 data[config](); 3830 } 3831 } 3832 3833 static jQueryInterface(config) { 3834 return this.each(function () { 3835 Collapse.collapseInterface(this, config); 3836 }); 3837 } 3838 3839 } 3840 /** 3841 * ------------------------------------------------------------------------ 3842 * Data Api implementation 3843 * ------------------------------------------------------------------------ 3844 */ 3845 3846 3847 EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) { 3848 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 3849 if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') { 3850 event.preventDefault(); 3851 } 3852 3853 const triggerData = Manipulator.getDataAttributes(this); 3854 const selector = getSelectorFromElement(this); 3855 const selectorElements = SelectorEngine.find(selector); 3856 selectorElements.forEach(element => { 3857 const data = Collapse.getInstance(element); 3858 let config; 3859 3860 if (data) { 3861 // update parent attribute 3862 if (data._parent === null && typeof triggerData.parent === 'string') { 3863 data._config.parent = triggerData.parent; 3864 data._parent = data._getParent(); 3865 } 3866 3867 config = 'toggle'; 3868 } else { 3869 config = triggerData; 3870 } 3871 3872 Collapse.collapseInterface(element, config); 3873 }); 3874 }); 3875 /** 3876 * ------------------------------------------------------------------------ 3877 * jQuery 3878 * ------------------------------------------------------------------------ 3879 * add .Collapse to jQuery only if jQuery is present 3880 */ 3881 3882 defineJQueryPlugin(Collapse); 3883 3884 /** 3885 * -------------------------------------------------------------------------- 3886 * Bootstrap (v5.0.2): dropdown.js 3887 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 3888 * -------------------------------------------------------------------------- 3889 */ 3890 /** 3891 * ------------------------------------------------------------------------ 3892 * Constants 3893 * ------------------------------------------------------------------------ 3894 */ 3895 3896 const NAME$8 = 'dropdown'; 3897 const DATA_KEY$7 = 'bs.dropdown'; 3898 const EVENT_KEY$7 = `.${DATA_KEY$7}`; 3899 const DATA_API_KEY$4 = '.data-api'; 3900 const ESCAPE_KEY$2 = 'Escape'; 3901 const SPACE_KEY = 'Space'; 3902 const TAB_KEY = 'Tab'; 3903 const ARROW_UP_KEY = 'ArrowUp'; 3904 const ARROW_DOWN_KEY = 'ArrowDown'; 3905 const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button 3906 3907 const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`); 3908 const EVENT_HIDE$4 = `hide${EVENT_KEY$7}`; 3909 const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$7}`; 3910 const EVENT_SHOW$4 = `show${EVENT_KEY$7}`; 3911 const EVENT_SHOWN$4 = `shown${EVENT_KEY$7}`; 3912 const EVENT_CLICK = `click${EVENT_KEY$7}`; 3913 const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`; 3914 const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$7}${DATA_API_KEY$4}`; 3915 const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$7}${DATA_API_KEY$4}`; 3916 const CLASS_NAME_SHOW$7 = 'show'; 3917 const CLASS_NAME_DROPUP = 'dropup'; 3918 const CLASS_NAME_DROPEND = 'dropend'; 3919 const CLASS_NAME_DROPSTART = 'dropstart'; 3920 const CLASS_NAME_NAVBAR = 'navbar'; 3921 const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]'; 3922 const SELECTOR_MENU = '.dropdown-menu'; 3923 const SELECTOR_NAVBAR_NAV = '.navbar-nav'; 3924 const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 3925 const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; 3926 const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; 3927 const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; 3928 const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; 3929 const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; 3930 const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; 3931 const Default$7 = { 3932 offset: [0, 2], 3933 boundary: 'clippingParents', 3934 reference: 'toggle', 3935 display: 'dynamic', 3936 popperConfig: null, 3937 autoClose: true 3938 }; 3939 const DefaultType$7 = { 3940 offset: '(array|string|function)', 3941 boundary: '(string|element)', 3942 reference: '(string|element|object)', 3943 display: 'string', 3944 popperConfig: '(null|object|function)', 3945 autoClose: '(boolean|string)' 3946 }; 3947 /** 3948 * ------------------------------------------------------------------------ 3949 * Class Definition 3950 * ------------------------------------------------------------------------ 3951 */ 3952 3953 class Dropdown extends BaseComponent { 3954 constructor(element, config) { 3955 super(element); 3956 this._popper = null; 3957 this._config = this._getConfig(config); 3958 this._menu = this._getMenuElement(); 3959 this._inNavbar = this._detectNavbar(); 3960 3961 this._addEventListeners(); 3962 } // Getters 3963 3964 3965 static get Default() { 3966 return Default$7; 3967 } 3968 3969 static get DefaultType() { 3970 return DefaultType$7; 3971 } 3972 3973 static get NAME() { 3974 return NAME$8; 3975 } // Public 3976 3977 3978 toggle() { 3979 if (isDisabled(this._element)) { 3980 return; 3981 } 3982 3983 const isActive = this._element.classList.contains(CLASS_NAME_SHOW$7); 3984 3985 if (isActive) { 3986 this.hide(); 3987 return; 3988 } 3989 3990 this.show(); 3991 } 3992 3993 show() { 3994 if (isDisabled(this._element) || this._menu.classList.contains(CLASS_NAME_SHOW$7)) { 3995 return; 3996 } 3997 3998 const parent = Dropdown.getParentFromElement(this._element); 3999 const relatedTarget = { 4000 relatedTarget: this._element 4001 }; 4002 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, relatedTarget); 4003 4004 if (showEvent.defaultPrevented) { 4005 return; 4006 } // Totally disable Popper for Dropdowns in Navbar 4007 4008 4009 if (this._inNavbar) { 4010 Manipulator.setDataAttribute(this._menu, 'popper', 'none'); 4011 } else { 4012 if (typeof Popper__namespace === 'undefined') { 4013 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); 4014 } 4015 4016 let referenceElement = this._element; 4017 4018 if (this._config.reference === 'parent') { 4019 referenceElement = parent; 4020 } else if (isElement(this._config.reference)) { 4021 referenceElement = getElement(this._config.reference); 4022 } else if (typeof this._config.reference === 'object') { 4023 referenceElement = this._config.reference; 4024 } 4025 4026 const popperConfig = this._getPopperConfig(); 4027 4028 const isDisplayStatic = popperConfig.modifiers.find(modifier =>
4028 modifier.name === 'applyStyles' && modifier.enabled === false); 4029 this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig); 4030 4031 if (isDisplayStatic) { 4032 Manipulator.setDataAttribute(this._menu, 'popper', 'static'); 4033 } 4034 } // If this is a touch-enabled device we add extra 4035 // empty mouseover listeners to the body's immediate children; 4036 // only needed because of broken event delegation on iOS 4037 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 4038 4039 4040 if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) { 4041 [].concat(...document.body.children).forEach(elem => EventHandler.on(elem, 'mouseover', noop)); 4042 } 4043 4044 this._element.focus(); 4045 4046 this._element.setAttribute('aria-expanded', true); 4047 4048 this._menu.classList.toggle(CLASS_NAME_SHOW$7); 4049 4050 this._element.classList.toggle(CLASS_NAME_SHOW$7); 4051 4052 EventHandler.trigger(this._element, EVENT_SHOWN$4, relatedTarget); 4053 } 4054 4055 hide() { 4056 if (isDisabled(this._element) || !this._menu.classList.contains(CLASS_NAME_SHOW$7)) { 4057 return; 4058 } 4059 4060 const relatedTarget = { 4061 relatedTarget: this._element 4062 }; 4063 4064 this._completeHide(relatedTarget); 4065 } 4066 4067 dispose() { 4068 if (this._popper) { 4069 this._popper.destroy(); 4070 } 4071 4072 super.dispose(); 4073 } 4074 4075 update() { 4076 this._inNavbar = this._detectNavbar(); 4077 4078 if (this._popper) { 4079 this._popper.update(); 4080 } 4081 } // Private 4082 4083 4084 _addEventListeners() { 4085 EventHandler.on(this._element, EVENT_CLICK, event => { 4086 event.preventDefault(); 4087 this.toggle(); 4088 }); 4089 } 4090 4091 _completeHide(relatedTarget) { 4092 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget); 4093 4094 if (hideEvent.defaultPrevented) { 4095 return; 4096 } // If this is a touch-enabled device we remove the extra 4097 // empty mouseover listeners we added for iOS support 4098 4099 4100 if ('ontouchstart' in document.documentElement) { 4101 [].concat(...document.body.children).forEach(elem => EventHandler.off(elem, 'mouseover', noop)); 4102 } 4103 4104 if (this._popper) { 4105 this._popper.destroy(); 4106 } 4107 4108 this._menu.classList.remove(CLASS_NAME_SHOW$7); 4109 4110 this._element.classList.remove(CLASS_NAME_SHOW$7); 4111 4112 this._element.setAttribute('aria-expanded', 'false'); 4113 4114 Manipulator.removeDataAttribute(this._menu, 'popper'); 4115 EventHandler.trigger(this._element, EVENT_HIDDEN$4, relatedTarget); 4116 } 4117 4118 _getConfig(config) { 4119 config = { ...this.constructor.Default, 4120 ...Manipulator.getDataAttributes(this._element), 4121 ...config 4122 }; 4123 typeCheckConfig(NAME$8, config, this.constructor.DefaultType); 4124 4125 if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { 4126 // Popper virtual elements require a getBoundingClientRect method 4127 throw new TypeError(`${NAME$8.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); 4128 } 4129 4130 return config; 4131 } 4132 4133 _getMenuElement() { 4134 return SelectorEngine.next(this._element, SELECTOR_MENU)[0]; 4135 } 4136 4137 _getPlacement() { 4138 const parentDropdown = this._element.parentNode; 4139 4140 if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { 4141 return PLACEMENT_RIGHT; 4142 } 4143 4144 if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { 4145 return PLACEMENT_LEFT; 4146 } // We need to trim the value because custom properties can also include spaces 4147 4148 4149 const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; 4150 4151 if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { 4152 return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; 4153 } 4154 4155 return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; 4156 } 4157 4158 _detectNavbar() { 4159 return this._element.closest(`.${CLASS_NAME_NAVBAR}`) !== null; 4160 } 4161 4162 _getOffset() { 4163 const { 4164 offset 4165 } = this._config; 4166 4167 if (typeof offset === 'string') { 4168 return offset.split(',').map(val => Number.parseInt(val, 10)); 4169 } 4170 4171 if (typeof offset === 'function') { 4172 return popperData => offset(popperData, this._element); 4173 } 4174 4175 return offset; 4176 } 4177 4178 _getPopperConfig() { 4179 const defaultBsPopperConfig = { 4180 placement: this._getPlacement(), 4181 modifiers: [{ 4182 name: 'preventOverflow', 4183 options: {
4184 boundary: this._config.boundary 4185 } 4186 }, { 4187 name: 'offset', 4188 options: { 4189 offset: this._getOffset() 4190 } 4191 }] 4192 }; // Disable Popper if we have a static display 4193 4194 if (this._config.display === 'static') { 4195 defaultBsPopperConfig.modifiers = [{ 4196 name: 'applyStyles', 4197 enabled: false 4198 }]; 4199 } 4200 4201 return { ...defaultBsPopperConfig, 4202 ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig) 4203 }; 4204 } 4205 4206 _selectMenuItem({ 4207 key, 4208 target 4209 }) { 4210 const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible); 4211 4212 if (!items.length) { 4213 return; 4214 } // if target isn't included in items (e.g. when expanding the dropdown) 4215 // allow cycling to get the last item in case key equals ARROW_UP_KEY 4216 4217 4218 getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus(); 4219 } // Static 4220 4221 4222 static dropdownInterface(element, config) { 4223 const data = Dropdown.getOrCreateInstance(element, config); 4224 4225 if (typeof config === 'string') { 4226 if (typeof data[config] === 'undefined') { 4227 throw new TypeError(`No method named "${config}"`); 4228 } 4229 4230 data[config](); 4231 } 4232 } 4233 4234 static jQueryInterface(config) { 4235 return this.each(function () { 4236 Dropdown.dropdownInterface(this, config); 4237 }); 4238 } 4239 4240 static clearMenus(event) { 4241 if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) { 4242 return; 4243 } 4244 4245 const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$3); 4246 4247 for (let i = 0, len = toggles.length; i < len; i++) { 4248 const context = Dropdown.getInstance(toggles[i]); 4249 4250 if (!context || context._config.autoClose === false) { 4251 continue; 4252 } 4253 4254 if (!context._element.classList.contains(CLASS_NAME_SHOW$7)) { 4255 continue; 4256 } 4257 4258 const relatedTarget = { 4259 relatedTarget: context._element 4260 }; 4261 4262 if (event) { 4263 const composedPath = event.composedPath(); 4264 const isMenuTarget = composedPath.includes(context._menu); 4265 4266 if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { 4267 continue; 4268 } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu 4269 4270 4271 if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) { 4272 continue; 4273 } 4274 4275 if (event.type === 'click') { 4276 relatedTarget.clickEvent = event; 4277 } 4278 } 4279 4280 context._completeHide(relatedTarget); 4281 } 4282 } 4283 4284 static getParentFromElement(element) { 4285 return getElementFromSelector(element) || element.parentNode; 4286 } 4287 4288 static dataApiKeydownHandler(event) { 4289 // If not input/textarea: 4290 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 4291 // If input/textarea: 4292 // - If space key => not a dropdown command 4293 // - If key is other than escape 4294 // - If key is not up or down => not a dropdown command 4295 // - If trigger inside the menu =>
4295 not a dropdown command 4296 if (/input|textarea/i.test(event.target.tagName) ? event.key === SPACE_KEY || event.key !== ESCAPE_KEY$2 && (event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY || event.target.closest(SELECTOR_MENU)) : !REGEXP_KEYDOWN.test(event.key)) { 4297 return; 4298 } 4299 4300 const isActive = this.classList.contains(CLASS_NAME_SHOW$7); 4301 4302 if (!isActive && event.key === ESCAPE_KEY$2) { 4303 return; 4304 } 4305 4306 event.preventDefault(); 4307 event.stopPropagation(); 4308 4309 if (isDisabled(this)) { 4310 return; 4311 } 4312 4313 const getToggleButton = () => this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0]; 4314 4315 if (event.key === ESCAPE_KEY$2) { 4316 getToggleButton().focus(); 4317 Dropdown.clearMenus(); 4318 return; 4319 } 4320 4321 if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) { 4322 if (!isActive) { 4323 getToggleButton().click(); 4324 } 4325 4326 Dropdown.getInstance(getToggleButton())._selectMenuItem(event); 4327 4328 return; 4329 } 4330 4331 if (!isActive || event.key === SPACE_KEY) { 4332 Dropdown.clearMenus(); 4333 } 4334 } 4335 4336 } 4337 /** 4338 * ------------------------------------------------------------------------ 4339 * Data Api implementation 4340 * ------------------------------------------------------------------------ 4341 */ 4342 4343 4344 EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler); 4345 EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); 4346 EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus); 4347 EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus); 4348 EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { 4349 event.preventDefault(); 4350 Dropdown.dropdownInterface(this); 4351 }); 4352 /** 4353 * ------------------------------------------------------------------------ 4354 * jQuery 4355 * ------------------------------------------------------------------------ 4356 * add .Dropdown to jQuery only if jQuery is present 4357 */ 4358 4359 defineJQueryPlugin(Dropdown); 4360 4361 /** 4362 * -------------------------------------------------------------------------- 4363 * Bootstrap (v5.0.2): util/scrollBar.js 4364 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 4365 * -------------------------------------------------------------------------- 4366 */ 4367 const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 4368 const SELECTOR_STICKY_CONTENT = '.sticky-top'; 4369 4370 class ScrollBarHelper { 4371 constructor() { 4372 this._element = document.body; 4373 } 4374 4375 getWidth() { 4376 // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes 4377 const documentWidth = document.documentElement.clientWidth; 4378 return Math.abs(window.innerWidth - documentWidth); 4379 } 4380 4381 hide() { 4382 const width = this.getWidth(); 4383 4384 this._disableOverFlow(); // give padding to element to balance the hidden scrollbar width 4385 4386 4387 this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth 4388 4389 4390 this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width); 4391 4392 this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width); 4393 } 4394 4395 _disableOverFlow() { 4396 this._saveInitialAttribute(this._element, 'overflow'); 4397 4398 this._element.style.overflow = 'hidden'; 4399 } 4400 4401 _setElementAttributes(selector, styleProp, callback) { 4402 const scrollbarWidth = this.getWidth(); 4403 4404 const manipulationCallBack = element => { 4405 if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { 4406 return; 4407 } 4408 4409 this._saveInitialAttribute(element, styleProp); 4410 4411 const calculatedValue = window.getComputedStyle(element)[styleProp]; 4412 element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`; 4413 }; 4414 4415 this._applyManipulationCallback(selector, manipulationCallBack); 4416 } 4417 4418 reset() { 4419 this._resetElementAttributes(this._element, 'overflow'); 4420 4421 this._resetElementAttributes(this._element, 'paddingRight'); 4422 4423 this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight'); 4424 4425 this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight'); 4426 } 4427 4428 _saveInitialAttribute(element, styleProp) { 4429 const actualValue = element.style[styleProp]; 4430 4431 if (actualValue) { 4432 Manipulator.setDataAttribute(element, styleProp, actualValue); 4433 } 4434 } 4435 4436 _resetElementAttributes(selector, styleProp) { 4437 const manipulationCallBack = element => { 4438 const value = Manipulator.getDataAttribute(element, styleProp); 4439 4440 if (typeof value === 'undefined') { 4441 element.style.removeProperty(styleProp); 4442 } else { 4443 Manipulator.removeDataAttribute(element, styleProp); 4444 element.style[styleProp] = value; 4445 } 4446 }; 4447 4448 this._applyManipulationCallback(selector, manipulationCallBack); 4449 } 4450 4451 _applyManipulationCallback(selector, callBack) { 4452 if (isElement(selector)) { 4453 callBack(selector); 4454 } else { 4455 SelectorEngine.find(selector, this._element).forEach(callBack); 4456 } 4457 } 4458 4459 isOverflowing() { 4460 return this.getWidth() > 0; 4461 } 4462 4463 } 4464 4465 /** 4466 * -------------------------------------------------------------------------- 4467 * Bootstrap (v5.0.2): util/backdrop.js 4468 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 4469 * -------------------------------------------------------------------------- 4470 */ 4471 const Default$6 = { 4472 isVisible: true, 4473 // if false, we use the backdrop helper without adding any element to the dom 4474 isAnimated: false, 4475 rootElement: 'body', 4476 // give the choice to place backdrop under different elements 4477 clickCallback: null 4478 }; 4479 const DefaultType$6 = { 4480 isVisible: 'boolean', 4481 isAnimated: 'boolean', 4482 rootElement: '(element|string)', 4483 clickCallback: '(function|null)' 4484 }; 4485 const NAME$7 = 'backdrop'; 4486 const CLASS_NAME_BACKDROP = 'modal-backdrop'; 4487 const CLASS_NAME_FADE$5 = 'fade'; 4488 const CLASS_NAME_SHOW$6 = 'show'; 4489 const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$7}`; 4490 4491 class Backdrop { 4492 constructor(config) { 4493 this._config = this._getConfig(config); 4494 this._isAppended = false;
4495 this._element = null; 4496 } 4497 4498 show(callback) { 4499 if (!this._config.isVisible) { 4500 execute(callback); 4501 return; 4502 } 4503 4504 this._append(); 4505 4506 if (this._config.isAnimated) { 4507 reflow(this._getElement()); 4508 } 4509 4510 this._getElement().classList.add(CLASS_NAME_SHOW$6); 4511 4512 this._emulateAnimation(() => { 4513 execute(callback); 4514 }); 4515 } 4516 4517 hide(callback) { 4518 if (!this._config.isVisible) { 4519 execute(callback); 4520 return; 4521 } 4522 4523 this._getElement().classList.remove(CLASS_NAME_SHOW$6); 4524 4525 this._emulateAnimation(() => { 4526 this.dispose(); 4527 execute(callback); 4528 }); 4529 } // Private 4530 4531 4532 _getElement() { 4533 if (!this._element) { 4534 const backdrop = document.createElement('div'); 4535 backdrop.className = CLASS_NAME_BACKDROP; 4536 4537 if (this._config.isAnimated) { 4538 backdrop.classList.add(CLASS_NAME_FADE$5); 4539 } 4540 4541 this._element = backdrop; 4542 } 4543 4544 return this._element; 4545 } 4546 4547 _getConfig(config) { 4548 config = { ...Default$6, 4549 ...(typeof config === 'object' ? config : {}) 4550 }; // use getElement() with the default "body" to get a fresh Element on each instantiation 4551 4552 config.rootElement = getElement(config.rootElement); 4553 typeCheckConfig(NAME$7, config, DefaultType$6); 4554 return config; 4555 } 4556 4557 _append() { 4558 if (this._isAppended) { 4559 return; 4560 } 4561 4562 this._config.rootElement.appendChild(this._getElement()); 4563 4564 EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => { 4565 execute(this._config.clickCallback); 4566 }); 4567 this._isAppended = true; 4568 } 4569 4570 dispose() { 4571 if (!this._isAppended) { 4572 return; 4573 } 4574 4575 EventHandler.off(this._element, EVENT_MOUSEDOWN); 4576 4577 this._element.remove(); 4578 4579 this._isAppended = false; 4580 } 4581 4582 _emulateAnimation(callback) { 4583 executeAfterTransition(callback, this._getElement(), this._config.isAnimated); 4584 } 4585 4586 } 4587 4588 /** 4589 * -------------------------------------------------------------------------- 4590 * Bootstrap (v5.0.2): modal.js 4591 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 4592 * -------------------------------------------------------------------------- 4593 */ 4594 /** 4595 * ------------------------------------------------------------------------ 4596 * Constants 4597 * ------------------------------------------------------------------------ 4598 */ 4599 4600 const NAME$6 = 'modal'; 4601 const DATA_KEY$6 = 'bs.modal'; 4602 const EVENT_KEY$6 = `.${DATA_KEY$6}`; 4603 const DATA_API_KEY$3 = '.data-api'; 4604 const ESCAPE_KEY$1 = 'Escape'; 4605 const Default$5 = { 4606 backdrop: true, 4607 keyboard: true, 4608 focus: true 4609 }; 4610 const DefaultType$5 = { 4611 backdrop: '(boolean|string)', 4612 keyboard: 'boolean', 4613 focus: 'boolean' 4614 }; 4615 const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`; 4616 const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$6}`; 4617 const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`; 4618 const EVENT_SHOW$3 = `show${EVENT_KEY$6}`; 4619 const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`; 4620 const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$6}`; 4621 const EVENT_RESIZE = `resize${EVENT_KEY$6}`; 4622 const EVENT_CLICK_DISMISS$2 = `click.dismiss${EVENT_KEY$6}`; 4623 const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`; 4624 const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`; 4625 const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`; 4626 const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`; 4627 const CLASS_NAME_OPEN = 'modal-open'; 4628 const CLASS_NAME_FADE$4 = 'fade'; 4629 const CLASS_NAME_SHOW$5 = 'show'; 4630 const CLASS_NAME_STATIC = 'modal-static'; 4631 const SELECTOR_DIALOG = '.modal-dialog'; 4632 const SELECTOR_MODAL_BODY = '.modal-body'; 4633 const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; 4634 const SELECTOR_DATA_DISMISS$2 = '[data-bs-dismiss="modal"]'; 4635 /** 4636 * ------------------------------------------------------------------------ 4637 * Class Definition 4638 * ------------------------------------------------------------------------ 4639 */ 4640 4641 class Modal extends BaseComponent { 4642 constructor(element, config) { 4643 super(element); 4644 this._config = this._getConfig(config); 4645 this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element); 4646 this._backdrop = this._initializeBackDrop(); 4647 this._isShown = false;
4648 this._ignoreBackdropClick = false; 4649 this._isTransitioning = false; 4650 this._scrollBar = new ScrollBarHelper(); 4651 } // Getters 4652 4653 4654 static get Default() { 4655 return Default$5; 4656 } 4657 4658 static get NAME() { 4659 return NAME$6; 4660 } // Public 4661 4662 4663 toggle(relatedTarget) { 4664 return this._isShown ? this.hide() : this.show(relatedTarget); 4665 } 4666 4667 show(relatedTarget) { 4668 if (this._isShown || this._isTransitioning) { 4669 return; 4670 } 4671 4672 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { 4673 relatedTarget 4674 }); 4675 4676 if (showEvent.defaultPrevented) { 4677 return; 4678 } 4679 4680 this._isShown = true; 4681 4682 if (this._isAnimated()) { 4683 this._isTransitioning = true; 4684 } 4685 4686 this._scrollBar.hide(); 4687 4688 document.body.classList.add(CLASS_NAME_OPEN); 4689 4690 this._adjustDialog(); 4691 4692 this._setEscapeEvent(); 4693 4694 this._setResizeEvent(); 4695 4696 EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, SELECTOR_DATA_DISMISS$2, event => this.hide(event)); 4697 EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => { 4698 EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => { 4699 if (event.target === this._element) { 4700 this._ignoreBackdropClick = true; 4701 } 4702 }); 4703 }); 4704 4705 this._showBackdrop(() => this._showElement(relatedTarget)); 4706 } 4707 4708 hide(event) { 4709 if (event && ['A', 'AREA'].includes(event.target.tagName)) { 4710 event.preventDefault(); 4711 } 4712 4713 if (!this._isShown || this._isTransitioning) { 4714 return; 4715 } 4716 4717 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3); 4718 4719 if (hideEvent.defaultPrevented) { 4720 return; 4721 } 4722 4723 this._isShown = false; 4724 4725 const isAnimated = this._isAnimated(); 4726 4727 if (isAnimated) { 4728 this._isTransitioning = true; 4729 } 4730 4731 this._setEscapeEvent(); 4732 4733 this._setResizeEvent(); 4734 4735 EventHandler.off(document, EVENT_FOCUSIN$2); 4736 4737 this._element.classList.remove(CLASS_NAME_SHOW$5); 4738 4739 EventHandler.off(this._element, EVENT_CLICK_DISMISS$2); 4740 EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS); 4741 4742 this._queueCallback(() => this._hideModal(), this._element, isAnimated); 4743 } 4744 4745 dispose() { 4746 [window, this._dialog].forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY$6)); 4747 4748 this._backdrop.dispose(); 4749 4750 super.dispose(); 4751 /** 4752 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` 4753 * Do not move `document` in `htmlElements` array 4754 * It will remove `EVENT_CLICK_DATA_API` event that should remain 4755 */ 4756 4757 EventHandler.off(document, EVENT_FOCUSIN$2); 4758 } 4759 4760 handleUpdate() { 4761 this._adjustDialog(); 4762 } // Private 4763 4764 4765 _initializeBackDrop() { 4766 return new Backdrop({ 4767 isVisible: Boolean(this._config.backdrop), 4768 // 'static' option will be translated to true, and booleans will keep their value 4769 isAnimated: this._isAnimated() 4770 }); 4771 } 4772 4773 _getConfig(config) { 4774 config = { ...Default$5, 4775 ...Manipulator.getDataAttributes(this._element), 4776 ...(typeof config === 'object' ? config : {}) 4777 }; 4778 typeCheckConfig(NAME$6, config, DefaultType$5); 4779 return config; 4780 } 4781 4782 _showElement(relatedTarget) { 4783 const isAnimated = this._isAnimated(); 4784 4785 const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); 4786 4787 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 4788 // Don't move modal's DOM position 4789 document.body.appendChild(this._element); 4790 } 4791 4792 this._element.style.display = 'block'; 4793 4794 this._element.removeAttribute('aria-hidden'); 4795 4796 this._element.setAttribute('aria-modal', true); 4797 4798 this._element.setAttribute('role', 'dialog'); 4799 4800 this._element.scrollTop = 0; 4801 4802 if (modalBody) { 4803 modalBody.scrollTop = 0; 4804 } 4805 4806 if (isAnimated) { 4807 reflow(this._element); 4808 } 4809 4810 this._element.classList.add(CLASS_NAME_SHOW$5); 4811 4812 if (this._config.focus) { 4813 this._enforceFocus(); 4814 } 4815 4816 const transitionComplete = () => { 4817 if (this._config.focus) { 4818 this._element.focus(); 4819 } 4820 4821 this._isTransitioning = false;
4822 EventHandler.trigger(this._element, EVENT_SHOWN$3, { 4823 relatedTarget 4824 }); 4825 }; 4826 4827 this._queueCallback(transitionComplete, this._dialog, isAnimated); 4828 } 4829 4830 _enforceFocus() { 4831 EventHandler.off(document, EVENT_FOCUSIN$2); // guard against infinite focus loop 4832 4833 EventHandler.on(document, EVENT_FOCUSIN$2, event => { 4834 if (document !== event.target && this._element !== event.target && !this._element.contains(event.target)) { 4835 this._element.focus(); 4836 } 4837 }); 4838 } 4839 4840 _setEscapeEvent() { 4841 if (this._isShown) { 4842 EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => { 4843 if (this._config.keyboard && event.key === ESCAPE_KEY$1) { 4844 event.preventDefault(); 4845 this.hide(); 4846 } else if (!this._config.keyboard && event.key === ESCAPE_KEY$1) { 4847 this._triggerBackdropTransition(); 4848 } 4849 }); 4850 } else { 4851 EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS$1); 4852 } 4853 } 4854 4855 _setResizeEvent() { 4856 if (this._isShown) { 4857 EventHandler.on(window, EVENT_RESIZE, () => this._adjustDialog()); 4858 } else { 4859 EventHandler.off(window, EVENT_RESIZE); 4860 } 4861 } 4862 4863 _hideModal() { 4864 this._element.style.display = 'none'; 4865 4866 this._element.setAttribute('aria-hidden', true); 4867 4868 this._element.removeAttribute('aria-modal'); 4869 4870 this._element.removeAttribute('role'); 4871 4872 this._isTransitioning = false; 4873 4874 this._backdrop.hide(() => { 4875 document.body.classList.remove(CLASS_NAME_OPEN); 4876 4877 this._resetAdjustments(); 4878 4879 this._scrollBar.reset(); 4880 4881 EventHandler.trigger(this._element, EVENT_HIDDEN$3); 4882 }); 4883 } 4884 4885 _showBackdrop(callback) { 4886 EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, event => { 4887 if (this._ignoreBackdropClick) { 4888 this._ignoreBackdropClick = false; 4889 return; 4890 } 4891 4892 if (event.target !== event.currentTarget) { 4893 return; 4894 } 4895 4896 if (this._config.backdrop === true) { 4897 this.hide(); 4898 } else if (this._config.backdrop === 'static') { 4899 this._triggerBackdropTransition(); 4900 } 4901 }); 4902 4903 this._backdrop.show(callback); 4904 } 4905 4906 _isAnimated() { 4907 return this._element.classList.contains(CLASS_NAME_FADE$4); 4908 } 4909 4910 _triggerBackdropTransition() { 4911 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); 4912 4913 if (hideEvent.defaultPrevented) { 4914 return; 4915 } 4916 4917 const { 4918 classList, 4919 scrollHeight, 4920 style 4921 } = this._element; 4922 const isModalOverflowing = scrollHeight > document.documentElement.clientHeight; // return if the following background transition hasn't yet completed 4923 4924 if (!isModalOverflowing && style.overflowY === 'hidden' || classList.contains(CLASS_NAME_STATIC)) { 4925 return; 4926 } 4927 4928 if (!isModalOverflowing) { 4929 style.overflowY = 'hidden'; 4930 } 4931 4932 classList.add(CLASS_NAME_STATIC); 4933 4934 this._queueCallback(() => { 4935 classList.remove(CLASS_NAME_STATIC); 4936 4937 if (!isModalOverflowing) { 4938 this._queueCallback(() => { 4939 style.overflowY = ''; 4940 }, this._dialog); 4941 } 4942 }, this._dialog); 4943 4944 this._element.focus(); 4945 } // ---------------------------------------------------------------------- 4946 // the following methods are used to handle overflowing modals 4947 // ---------------------------------------------------------------------- 4948 4949 4950 _adjustDialog() { 4951 const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 4952 4953 const scrollbarWidth = this._scrollBar.getWidth(); 4954 4955 const isBodyOverflowing = scrollbarWidth > 0; 4956 4957 if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) { 4958 this._element.style.paddingLeft = `${scrollbarWidth}px`; 4959 } 4960 4961 if (isBodyOverflowing && !isModalOverflowing && !isRTL() || !isBodyOverflowing && isModalOverflowing && isRTL()) { 4962 this._element.style.paddingRight = `${scrollbarWidth}px`; 4963 } 4964 } 4965 4966 _resetAdjustments() { 4967 this._element.style.paddingLeft = ''; 4968 this._element.style.paddingRight = ''; 4969 } // Static 4970 4971 4972 static jQueryInterface(config, relatedTarget) { 4973 return this.each(function () { 4974 const data = Modal.getOrCreateInstance(this, config); 4975 4976 if (typeof config !== 'string') { 4977 return; 4978 } 4979 4980 if (typeof data[config] === 'undefined') {
vendor: 5,335 bytes, lines 4981-5153
4981 throw new TypeError(`No method named "${config}"`); 4982 } 4983 4984 data[config](relatedTarget); 4985 }); 4986 } 4987 4988 } 4989 /** 4990 * ------------------------------------------------------------------------ 4991 * Data Api implementation 4992 * ------------------------------------------------------------------------ 4993 */ 4994 4995 4996 EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { 4997 const target = getElementFromSelector(this); 4998 4999 if (['A', 'AREA'].includes(this.tagName)) { 5000 event.preventDefault(); 5001 } 5002 5003 EventHandler.one(target, EVENT_SHOW$3, showEvent => { 5004 if (showEvent.defaultPrevented) { 5005 // only register focus restorer if modal will actually get shown 5006 return; 5007 } 5008 5009 EventHandler.one(target, EVENT_HIDDEN$3, () => { 5010 if (isVisible(this)) { 5011 this.focus(); 5012 } 5013 }); 5014 }); 5015 const data = Modal.getOrCreateInstance(target); 5016 data.toggle(this); 5017 }); 5018 /** 5019 * ------------------------------------------------------------------------ 5020 * jQuery 5021 * ------------------------------------------------------------------------ 5022 * add .Modal to jQuery only if jQuery is present 5023 */ 5024 5025 defineJQueryPlugin(Modal); 5026 5027 /** 5028 * -------------------------------------------------------------------------- 5029 * Bootstrap (v5.0.2): offcanvas.js 5030 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5031 * -------------------------------------------------------------------------- 5032 */ 5033 /** 5034 * ------------------------------------------------------------------------ 5035 * Constants 5036 * ------------------------------------------------------------------------ 5037 */ 5038 5039 const NAME$5 = 'offcanvas'; 5040 const DATA_KEY$5 = 'bs.offcanvas'; 5041 const EVENT_KEY$5 = `.${DATA_KEY$5}`; 5042 const DATA_API_KEY$2 = '.data-api'; 5043 const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$5}${DATA_API_KEY$2}`; 5044 const ESCAPE_KEY = 'Escape'; 5045 const Default$4 = { 5046 backdrop: true, 5047 keyboard: true, 5048 scroll: false 5049 }; 5050 const DefaultType$4 = { 5051 backdrop: 'boolean', 5052 keyboard: 'boolean', 5053 scroll: 'boolean' 5054 }; 5055 const CLASS_NAME_SHOW$4 = 'show'; 5056 const OPEN_SELECTOR = '.offcanvas.show'; 5057 const EVENT_SHOW$2 = `show${EVENT_KEY$5}`; 5058 const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`; 5059 const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`; 5060 const EVENT_HIDDEN$2 = `hidden${EVENT_KEY$5}`; 5061 const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$5}`; 5062 const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`; 5063 const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$5}`; 5064 const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`; 5065 const SELECTOR_DATA_DISMISS$1 = '[data-bs-dismiss="offcanvas"]'; 5066 const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]'; 5067 /** 5068 * ------------------------------------------------------------------------ 5069 * Class Definition 5070 * ------------------------------------------------------------------------ 5071 */ 5072 5073 class Offcanvas extends BaseComponent { 5074 constructor(element, config) { 5075 super(element); 5076 this._config = this._getConfig(config); 5077 this._isShown = false; 5078 this._backdrop = this._initializeBackDrop(); 5079 5080 this._addEventListeners(); 5081 } // Getters 5082 5083 5084 static get NAME() { 5085 return NAME$5; 5086 } 5087 5088 static get Default() { 5089 return Default$4; 5090 } // Public 5091 5092 5093 toggle(relatedTarget) { 5094 return this._isShown ? this.hide() : this.show(relatedTarget); 5095 } 5096 5097 show(relatedTarget) { 5098 if (this._isShown) { 5099 return; 5100 } 5101 5102 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$2, { 5103 relatedTarget 5104 }); 5105 5106 if (showEvent.defaultPrevented) { 5107 return; 5108 } 5109 5110 this._isShown = true; 5111 this._element.style.visibility = 'visible'; 5112 5113 this._backdrop.show(); 5114 5115 if (!this._config.scroll) { 5116 new ScrollBarHelper().hide(); 5117 5118 this._enforceFocusOnElement(this._element); 5119 } 5120 5121 this._element.removeAttribute('aria-hidden'); 5122 5123 this._element.setAttribute('aria-modal', true); 5124 5125 this._element.setAttribute('role', 'dialog'); 5126 5127 this._element.classList.add(CLASS_NAME_SHOW$4); 5128 5129 const completeCallBack = () => { 5130 EventHandler.trigger(this._element, EVENT_SHOWN$2, { 5131 relatedTarget 5132 }); 5133 }; 5134 5135 this._queueCallback(completeCallBack, this._element, true); 5136 } 5137 5138 hide() { 5139 if (!this._isShown) { 5140 return; 5141 } 5142 5143 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$2); 5144 5145 if (hideEvent.defaultPrevented) { 5146 return; 5147 } 5148 5149 EventHandler.off(document, EVENT_FOCUSIN$1); 5150 5151 this._element.blur(); 5152 5153 this._isShown = false;
5154 5155 this._element.classList.remove(CLASS_NAME_SHOW$4); 5156 5157 this._backdrop.hide(); 5158 5159 const completeCallback = () => { 5160 this._element.setAttribute('aria-hidden', true); 5161 5162 this._element.removeAttribute('aria-modal'); 5163 5164 this._element.removeAttribute('role'); 5165 5166 this._element.style.visibility = 'hidden'; 5167 5168 if (!this._config.scroll) { 5169 new ScrollBarHelper().reset(); 5170 } 5171 5172 EventHandler.trigger(this._element, EVENT_HIDDEN$2); 5173 }; 5174 5175 this._queueCallback(completeCallback, this._element, true); 5176 } 5177 5178 dispose() { 5179 this._backdrop.dispose(); 5180 5181 super.dispose(); 5182 EventHandler.off(document, EVENT_FOCUSIN$1); 5183 } // Private 5184 5185 5186 _getConfig(config) { 5187 config = { ...Default$4, 5188 ...Manipulator.getDataAttributes(this._element), 5189 ...(typeof config === 'object' ? config : {}) 5190 }; 5191 typeCheckConfig(NAME$5, config, DefaultType$4); 5192 return config; 5193 } 5194 5195 _initializeBackDrop() { 5196 return new Backdrop({ 5197 isVisible: this._config.backdrop, 5198 isAnimated: true, 5199 rootElement: this._element.parentNode, 5200 clickCallback: () => this.hide() 5201 }); 5202 } 5203 5204 _enforceFocusOnElement(element) { 5205 EventHandler.off(document, EVENT_FOCUSIN$1); // guard against infinite focus loop 5206 5207 EventHandler.on(document, EVENT_FOCUSIN$1, event => { 5208 if (document !== event.target && element !== event.target && !element.contains(event.target)) { 5209 element.focus(); 5210 } 5211 }); 5212 element.focus(); 5213 } 5214 5215 _addEventListeners() { 5216 EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide()); 5217 EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { 5218 if (this._config.keyboard && event.key === ESCAPE_KEY) { 5219 this.hide(); 5220 } 5221 }); 5222 } // Static 5223 5224 5225 static jQueryInterface(config) { 5226 return this.each(function () { 5227 const data = Offcanvas.getOrCreateInstance(this, config); 5228 5229 if (typeof config !== 'string') { 5230 return; 5231 } 5232 5233 if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { 5234 throw new TypeError(`No method named "${config}"`); 5235 } 5236 5237 data[config](this); 5238 }); 5239 } 5240 5241 } 5242 /** 5243 * ------------------------------------------------------------------------ 5244 * Data Api implementation 5245 * ------------------------------------------------------------------------ 5246 */ 5247 5248 5249 EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { 5250 const target = getElementFromSelector(this); 5251 5252 if (['A', 'AREA'].includes(this.tagName)) { 5253 event.preventDefault(); 5254 } 5255 5256 if (isDisabled(this)) { 5257 return; 5258 } 5259 5260 EventHandler.one(target, EVENT_HIDDEN$2, () => { 5261 // focus on trigger when it is closed 5262 if (isVisible(this)) { 5263 this.focus(); 5264 } 5265 }); // avoid conflict when clicking a toggler of an offcanvas, while another is open 5266 5267 const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); 5268 5269 if (allReadyOpen && allReadyOpen !== target) { 5270 Offcanvas.getInstance(allReadyOpen).hide(); 5271 } 5272 5273 const data = Offcanvas.getOrCreateInstance(target); 5274 data.toggle(this); 5275 }); 5276 EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show())); 5277 /** 5278 * ------------------------------------------------------------------------ 5279 * jQuery 5280 * ------------------------------------------------------------------------ 5281 */ 5282 5283 defineJQueryPlugin(Offcanvas); 5284 5285 /** 5286 * -------------------------------------------------------------------------- 5287 * Bootstrap (v5.0.2): util/sanitizer.js 5288 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 5289 * -------------------------------------------------------------------------- 5290 */ 5291 const uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); 5292 const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 5293 /** 5294 * A pattern that recognizes a commonly useful subset of URLs that are safe. 5295 * 5296 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5297 */ 5298 5299 const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i; 5300 /** 5301 * A pattern that matches safe data URLs. Only matches image, video and audio types. 5302 * 5303 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5304 */ 5305 5306 const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; 5307 5308 const allowedAttribute = (attr, allowedAttributeList) => { 5309 const attrName = attr.nodeName.toLowerCase(); 5310 5311 if (allowedAttributeList.includes(attrName)) { 5312 if (uriAttrs.has(attrName)) { 5313 return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)); 5314 } 5315 5316 return true; 5317 } 5318 5319 const regExp = allowedAttributeList.filter(attrRegex =>
5319 attrRegex instanceof RegExp); // Check if a regular expression validates the attribute. 5320 5321 for (let i = 0, len = regExp.length; i < len; i++) { 5322 if (regExp[i].test(attrName)) { 5323 return true; 5324 } 5325 } 5326 5327 return false; 5328 }; 5329 5330 const DefaultAllowlist = { 5331 // Global attributes allowed on any supplied element below. 5332 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 5333 a: ['target', 'href', 'title', 'rel'], 5334 area: [], 5335 b: [], 5336 br: [], 5337 col: [], 5338 code: [], 5339 div: [], 5340 em: [], 5341 hr: [], 5342 h1: [], 5343 h2: [], 5344 h3: [], 5345 h4: [], 5346 h5: [], 5347 h6: [], 5348 i: [], 5349 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 5350 li: [], 5351 ol: [], 5352 p: [], 5353 pre: [], 5354 s: [], 5355 small: [], 5356 span: [], 5357 sub: [], 5358 sup: [], 5359 strong: [], 5360 u: [], 5361 ul: [] 5362 }; 5363 function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) { 5364 if (!unsafeHtml.length) { 5365 return unsafeHtml; 5366 } 5367 5368 if (sanitizeFn && typeof sanitizeFn === 'function') { 5369 return sanitizeFn(unsafeHtml); 5370 } 5371 5372 const domParser = new window.DOMParser(); 5373 const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 5374 const allowlistKeys = Object.keys(allowList); 5375 const elements = [].concat(...createdDocument.body.querySelectorAll('*')); 5376 5377 for (let i = 0, len = elements.length; i < len; i++) { 5378 const el = elements[i]; 5379 const elName = el.nodeName.toLowerCase(); 5380 5381 if (!allowlistKeys.includes(elName)) { 5382 el.remove(); 5383 continue; 5384 } 5385 5386 const attributeList = [].concat(...el.attributes); 5387 const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []); 5388 attributeList.forEach(attr => { 5389 if (!allowedAttribute(attr, allowedAttributes)) { 5390 el.removeAttribute(attr.nodeName); 5391 } 5392 }); 5393 } 5394 5395 return createdDocument.body.innerHTML; 5396 } 5397 5398 /** 5399 * -------------------------------------------------------------------------- 5400 * Bootstrap (v5.0.2): tooltip.js 5401 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 5402 * -------------------------------------------------------------------------- 5403 */ 5404 /** 5405 * ------------------------------------------------------------------------ 5406 * Constants 5407 * ------------------------------------------------------------------------ 5408 */ 5409 5410 const NAME$4 = 'tooltip'; 5411 const DATA_KEY$4 = 'bs.tooltip'; 5412 const EVENT_KEY$4 = `.${DATA_KEY$4}`; 5413 const CLASS_PREFIX$1 = 'bs-tooltip'; 5414 const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g'); 5415 const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); 5416 const DefaultType$3 = { 5417 animation: 'boolean', 5418 template: 'string', 5419 title: '(string|element|function)', 5420 trigger: 'string', 5421 delay: '(number|object)', 5422 html: 'boolean', 5423 selector: '(string|boolean)', 5424 placement: '(string|function)', 5425 offset: '(array|string|function)', 5426 container: '(string|element|boolean)', 5427 fallbackPlacements: 'array', 5428 boundary: '(string|element)', 5429 customClass: '(string|function)', 5430 sanitize: 'boolean', 5431 sanitizeFn: '(null|function)', 5432 allowList: 'object', 5433 popperConfig: '(null|object|function)' 5434 }; 5435 const AttachmentMap = { 5436 AUTO: 'auto', 5437 TOP: 'top', 5438 RIGHT: isRTL() ? 'left' : 'right', 5439 BOTTOM: 'bottom', 5440 LEFT: isRTL() ? 'right' : 'left' 5441 }; 5442 const Default$3 = { 5443 animation: true, 5444 template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>', 5445 trigger: 'hover focus', 5446 title: '', 5447 delay: 0, 5448 html: false, 5449 selector: false, 5450 placement: 'top', 5451 offset: [0, 0], 5452 container: false, 5453 fallbackPlacements: ['top', 'right', 'bottom', 'left'], 5454 boundary: 'clippingParents', 5455 customClass: '', 5456 sanitize: true, 5457 sanitizeFn: null, 5458 allowList: DefaultAllowlist, 5459 popperConfig: null 5460 }; 5461 const Event$2 = { 5462 HIDE: `hide${EVENT_KEY$4}`, 5463 HIDDEN: `hidden${EVENT_KEY$4}`, 5464 SHOW: `show${EVENT_KEY$4}`, 5465 SHOWN: `shown${EVENT_KEY$4}`, 5466 INSERTED: `inserted${EVENT_KEY$4}`, 5467 CLICK: `click${EVENT_KEY$4}`, 5468 FOCUSIN: `focusin${EVENT_KEY$4}`, 5469 FOCUSOUT: `focusout${EVENT_KEY$4}`, 5470 MOUSEENTER: `mouseenter${EVENT_KEY$4}`, 5471 MOUSELEAVE: `mouseleave${EVENT_KEY$4}` 5472 }; 5473 const CLASS_NAME_FADE$3 = 'fade'; 5474 const CLASS_NAME_MODAL = 'modal'; 5475 const CLASS_NAME_SHOW$3 = 'show'; 5476 const HOVER_STATE_SHOW = 'show'; 5477 const HOVER_STATE_OUT = 'out'; 5478 const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 5479 const TRIGGER_HOVER = 'hover'; 5480 const TRIGGER_FOCUS = 'focus'; 5481 const TRIGGER_CLICK = 'click'; 5482 const TRIGGER_MANUAL = 'manual'; 5483 /** 5484 * ------------------------------------------------------------------------ 5485 * Class Definition 5486 * ------------------------------------------------------------------------ 5487 */ 5488 5489 class Tooltip extends BaseComponent { 5490 constructor(element, config) { 5491 if (typeof Popper__namespace === 'undefined') { 5492 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); 5493 } 5494 5495 super(element); // private 5496 5497 this._isEnabled = true; 5498 this._timeout = 0; 5499 this._hoverState = ''; 5500 this._activeTrigger = {}; 5501 this._popper = null; // Protected 5502 5503 this._config = this._getConfig(config); 5504 this.tip = null; 5505 5506 this._setListeners(); 5507 } // Getters 5508 5509 5510 static get Default() { 5511 return Default$3; 5512 } 5513 5514 static get NAME() { 5515 return NAME$4; 5516 } 5517 5518 static get Event() { 5519 return Event$2; 5520 } 5521 5522 static get DefaultType() { 5523 return DefaultType$3; 5524 } // Public 5525 5526 5527 enable() { 5528 this._isEnabled = true; 5529 } 5530 5531 disable() { 5532 this._isEnabled = false;
5533 } 5534 5535 toggleEnabled() { 5536 this._isEnabled = !this._isEnabled; 5537 } 5538 5539 toggle(event) { 5540 if (!this._isEnabled) { 5541 return; 5542 } 5543 5544 if (event) { 5545 const context = this._initializeOnDelegatedTarget(event); 5546 5547 context._activeTrigger.click = !context._activeTrigger.click; 5548 5549 if (context._isWithActiveTrigger()) { 5550 context._enter(null, context); 5551 } else { 5552 context._leave(null, context); 5553 } 5554 } else { 5555 if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$3)) { 5556 this._leave(null, this); 5557 5558 return; 5559 } 5560 5561 this._enter(null, this); 5562 } 5563 } 5564 5565 dispose() { 5566 clearTimeout(this._timeout); 5567 EventHandler.off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler); 5568 5569 if (this.tip) { 5570 this.tip.remove(); 5571 } 5572 5573 if (this._popper) { 5574 this._popper.destroy(); 5575 } 5576 5577 super.dispose(); 5578 } 5579 5580 show() { 5581 if (this._element.style.display === 'none') { 5582 throw new Error('Please use show on visible elements'); 5583 } 5584 5585 if (!(this.isWithContent() && this._isEnabled)) { 5586 return; 5587 } 5588 5589 const showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW); 5590 const shadowRoot = findShadowRoot(this._element); 5591 const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element); 5592 5593 if (showEvent.defaultPrevented || !isInTheDom) { 5594 return; 5595 } 5596 5597 const tip = this.getTipElement(); 5598 const tipId = getUID(this.constructor.NAME);
5599 tip.setAttribute('id', tipId); 5600 5601 this._element.setAttribute('aria-describedby', tipId); 5602 5603 this.setContent(); 5604 5605 if (this._config.animation) { 5606 tip.classList.add(CLASS_NAME_FADE$3); 5607 } 5608 5609 const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement; 5610 5611 const attachment = this._getAttachment(placement); 5612 5613 this._addAttachmentClass(attachment); 5614 5615 const { 5616 container 5617 } = this._config; 5618 Data.set(tip, this.constructor.DATA_KEY, this); 5619 5620 if (!this._element.ownerDocument.documentElement.contains(this.tip)) { 5621 container.appendChild(tip); 5622 EventHandler.trigger(this._element, this.constructor.Event.INSERTED); 5623 } 5624 5625 if (this._popper) { 5626 this._popper.update(); 5627 } else { 5628 this._popper = Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment)); 5629 } 5630 5631 tip.classList.add(CLASS_NAME_SHOW$3); 5632 const customClass = typeof this._config.customClass === 'function' ? this._config.customClass() : this._config.customClass; 5633 5634 if (customClass) { 5635 tip.classList.add(...customClass.split(' ')); 5636 } // If this is a touch-enabled device we add extra 5637 // empty mouseover listeners to the body's immediate children; 5638 // only needed because of broken event delegation on iOS 5639 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 5640 5641 5642 if ('ontouchstart' in document.documentElement) { 5643 [].concat(...document.body.children).forEach(element => { 5644 EventHandler.on(element, 'mouseover', noop); 5645 }); 5646 } 5647 5648 const complete = () => { 5649 const prevHoverState = this._hoverState; 5650 this._hoverState = null; 5651 EventHandler.trigger(this._element, this.constructor.Event.SHOWN); 5652 5653 if (prevHoverState === HOVER_STATE_OUT) { 5654 this._leave(null, this); 5655 } 5656 }; 5657 5658 const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3); 5659 5660 this._queueCallback(complete, this.tip, isAnimated); 5661 } 5662 5663 hide() { 5664 if (!this._popper) { 5665 return; 5666 } 5667 5668 const tip = this.getTipElement(); 5669 5670 const complete = () => { 5671 if (this._isWithActiveTrigger()) { 5672 return; 5673 } 5674 5675 if (this._hoverState !== HOVER_STATE_SHOW) { 5676 tip.remove(); 5677 } 5678 5679 this._cleanTipClass(); 5680 5681 this._element.removeAttribute('aria-describedby'); 5682 5683 EventHandler.trigger(this._element, this.constructor.Event.HIDDEN); 5684 5685 if (this._popper) { 5686 this._popper.destroy(); 5687 5688 this._popper = null; 5689 } 5690 }; 5691 5692 const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE); 5693 5694 if (hideEvent.defaultPrevented) { 5695 return; 5696 } 5697 5698 tip.classList.remove(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra 5699 // empty mouseover listeners we added for iOS support 5700 5701 if ('ontouchstart' in document.documentElement) { 5702 [].concat(...document.body.children).forEach(element => EventHandler.off(element, 'mouseover', noop)); 5703 } 5704 5705 this._activeTrigger[TRIGGER_CLICK] = false; 5706 this._activeTrigger[TRIGGER_FOCUS] = false; 5707 this._activeTrigger[TRIGGER_HOVER] = false; 5708 const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$3); 5709 5710 this._queueCallback(complete, this.tip, isAnimated); 5711 5712 this._hoverState = ''; 5713 } 5714 5715 update() { 5716 if (this._popper !== null) {
5717 this._popper.update(); 5718 } 5719 } // Protected 5720 5721 5722 isWithContent() { 5723 return Boolean(this.getTitle()); 5724 } 5725 5726 getTipElement() { 5727 if (this.tip) { 5728 return this.tip; 5729 } 5730 5731 const element = document.createElement('div'); 5732 element.innerHTML = this._config.template; 5733 this.tip = element.children[0]; 5734 return this.tip; 5735 } 5736 5737 setContent() { 5738 const tip = this.getTipElement(); 5739 this.setElementContent(SelectorEngine.findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle()); 5740 tip.classList.remove(CLASS_NAME_FADE$3, CLASS_NAME_SHOW$3); 5741 } 5742 5743 setElementContent(element, content) { 5744 if (element === null) { 5745 return; 5746 } 5747 5748 if (isElement(content)) { 5749 content = getElement(content); // content is a DOM node or a jQuery 5750 5751 if (this._config.html) { 5752 if (content.parentNode !== element) { 5753 element.innerHTML = ''; 5754 element.appendChild(content); 5755 } 5756 } else { 5757 element.textContent = content.textContent; 5758 } 5759 5760 return; 5761 } 5762 5763 if (this._config.html) { 5764 if (this._config.sanitize) { 5765 content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn); 5766 } 5767 5768 element.innerHTML = content; 5769 } else { 5770 element.textContent = content; 5771 } 5772 } 5773 5774 getTitle() { 5775 let title = this._element.getAttribute('data-bs-original-title'); 5776 5777 if (!title) { 5778 title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title; 5779 } 5780 5781 return title; 5782 } 5783 5784 updateAttachment(attachment) { 5785 if (attachment === 'right') { 5786 return 'end'; 5787 } 5788 5789 if (attachment === 'left') { 5790 return 'start'; 5791 } 5792 5793 return attachment; 5794 } // Private 5795 5796 5797 _initializeOnDelegatedTarget(event, context) { 5798 const dataKey = this.constructor.DATA_KEY; 5799 context = context || Data.get(event.delegateTarget, dataKey); 5800 5801 if (!context) { 5802 context = new this.constructor(event.delegateTarget, this._getDelegateConfig()); 5803 Data.set(event.delegateTarget, dataKey, context); 5804 } 5805 5806 return context; 5807 } 5808 5809 _getOffset() { 5810 const { 5811 offset 5812 } = this._config; 5813 5814 if (typeof offset === 'string') { 5815 return offset.split(',').map(val => Number.parseInt(val, 10)); 5816 } 5817 5818 if (typeof offset === 'function') { 5819 return popperData => offset(popperData, this._element); 5820 } 5821 5822 return offset; 5823 } 5824 5825 _getPopperConfig(attachment) { 5826 const defaultBsPopperConfig = { 5827 placement: attachment, 5828 modifiers: [{ 5829 name: 'flip', 5830 options: { 5831 fallbackPlacements: this._config.fallbackPlacements 5832 } 5833 }, { 5834 name: 'offset', 5835 options: { 5836 offset: this._getOffset() 5837 } 5838 }, { 5839 name: 'preventOverflow', 5840 options: { 5841 boundary: this._config.boundary 5842 } 5843 }, { 5844 name: 'arrow', 5845 options: { 5846 element: `.${this.constructor.NAME}-arrow` 5847 } 5848 }, { 5849 name: 'onChange', 5850 enabled: true, 5851 phase: 'afterWrite', 5852 fn: data => this._handlePopperPlacementChange(data) 5853 }], 5854 onFirstUpdate: data => { 5855 if (data.options.placement !== data.placement) { 5856 this._handlePopperPlacementChange(data); 5857 } 5858 } 5859 }; 5860 return { ...defaultBsPopperConfig, 5861 ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig) 5862 }; 5863 } 5864 5865 _addAttachmentClass(attachment) { 5866 this.getTipElement().classList.add(`${CLASS_PREFIX$1}-${this.updateAttachment(attachment)}`); 5867 } 5868 5869 _getAttachment(placement) { 5870 return AttachmentMap[placement.toUpperCase()]; 5871 } 5872 5873 _setListeners() { 5874 const triggers = this._config.trigger.split(' '); 5875
5876 triggers.forEach(trigger => { 5877 if (trigger === 'click') { 5878 EventHandler.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event)); 5879 } else if (trigger !== TRIGGER_MANUAL) { 5880 const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN; 5881 const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT; 5882 EventHandler.on(this._element, eventIn, this._config.selector, event => this._enter(event)); 5883 EventHandler.on(this._element, eventOut, this._config.selector, event => this._leave(event)); 5884 } 5885 }); 5886 5887 this._hideModalHandler = () => { 5888 if (this._element) { 5889 this.hide(); 5890 } 5891 }; 5892 5893 EventHandler.on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler); 5894 5895 if (this._config.selector) { 5896 this._config = { ...this._config, 5897 trigger: 'manual', 5898 selector: '' 5899 }; 5900 } else { 5901 this._fixTitle(); 5902 } 5903 } 5904 5905 _fixTitle() { 5906 const title = this._element.getAttribute('title'); 5907 5908 const originalTitleType = typeof this._element.getAttribute('data-bs-original-title'); 5909 5910 if (title || originalTitleType !== 'string') { 5911 this._element.setAttribute('data-bs-original-title', title || ''); 5912 5913 if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) { 5914 this._element.setAttribute('aria-label', title); 5915 } 5916 5917 this._element.setAttribute('title', ''); 5918 } 5919 } 5920 5921 _enter(event, context) { 5922 context = this._initializeOnDelegatedTarget(event, context); 5923 5924 if (event) { 5925 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 5926 } 5927 5928 if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) { 5929 context._hoverState = HOVER_STATE_SHOW; 5930 return; 5931 } 5932 5933 clearTimeout(context._timeout); 5934 context._hoverState = HOVER_STATE_SHOW; 5935 5936 if (!context._config.delay || !context._config.delay.show) { 5937 context.show(); 5938 return; 5939 } 5940 5941 context._timeout = setTimeout(() => { 5942 if (context._hoverState === HOVER_STATE_SHOW) { 5943 context.show(); 5944 } 5945 }, context._config.delay.show); 5946 } 5947 5948 _leave(event, context) { 5949 context = this._initializeOnDelegatedTarget(event, context); 5950 5951 if (event) { 5952 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); 5953 } 5954 5955 if (context._isWithActiveTrigger()) { 5956 return; 5957 } 5958 5959 clearTimeout(context._timeout); 5960 context._hoverState = HOVER_STATE_OUT; 5961 5962 if (!context._config.delay || !context._config.delay.hide) { 5963 context.hide(); 5964 return; 5965 } 5966 5967 context._timeout = setTimeout(() => { 5968 if (context._hoverState === HOVER_STATE_OUT) { 5969 context.hide(); 5970 } 5971 }, context._config.delay.hide); 5972 } 5973 5974 _isWithActiveTrigger() { 5975 for (const trigger in this._activeTrigger) { 5976 if (this._activeTrigger[trigger]) { 5977 return true; 5978 } 5979 } 5980 5981 return false; 5982 } 5983 5984 _getConfig(config) { 5985 const dataAttributes = Manipulator.getDataAttributes(this._element);
5986 Object.keys(dataAttributes).forEach(dataAttr => { 5987 if (DISALLOWED_ATTRIBUTES.has(dataAttr)) { 5988 delete dataAttributes[dataAttr]; 5989 } 5990 }); 5991 config = { ...this.constructor.Default, 5992 ...dataAttributes, 5993 ...(typeof config === 'object' && config ? config : {}) 5994 }; 5995 config.container = config.container === false ? document.body : getElement(config.container); 5996 5997 if (typeof config.delay === 'number') { 5998 config.delay = { 5999 show: config.delay, 6000 hide: config.delay 6001 }; 6002 } 6003 6004 if (typeof config.title === 'number') { 6005 config.title = config.title.toString(); 6006 } 6007 6008 if (typeof config.content === 'number') { 6009 config.content = config.content.toString(); 6010 } 6011 6012 typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 6013 6014 if (config.sanitize) { 6015 config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn); 6016 } 6017 6018 return config; 6019 } 6020 6021 _getDelegateConfig() { 6022 const config = {}; 6023 6024 if (this._config) { 6025 for (const key in this._config) { 6026 if (this.constructor.Default[key] !== this._config[key]) { 6027 config[key] = this._config[key]; 6028 } 6029 } 6030 } 6031 6032 return config; 6033 } 6034 6035 _cleanTipClass() { 6036 const tip = this.getTipElement(); 6037 const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1); 6038 6039 if (tabClass !== null && tabClass.length > 0) { 6040 tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass)); 6041 } 6042 } 6043 6044 _handlePopperPlacementChange(popperData) { 6045 const { 6046 state 6047 } = popperData; 6048 6049 if (!state) { 6050 return; 6051 } 6052 6053 this.tip = state.elements.popper; 6054 6055 this._cleanTipClass(); 6056 6057 this._addAttachmentClass(this._getAttachment(state.placement)); 6058 } // Static 6059 6060 6061 static jQueryInterface(config) { 6062 return this.each(function () { 6063 const data = Tooltip.getOrCreateInstance(this, config); 6064 6065 if (typeof config === 'string') { 6066 if (typeof data[config] === 'undefined') { 6067 throw new TypeError(`No method named "${config}"`); 6068 } 6069 6070 data[config](); 6071 } 6072 }); 6073 } 6074 6075 } 6076 /** 6077 * ------------------------------------------------------------------------ 6078 * jQuery 6079 * ------------------------------------------------------------------------ 6080 * add .Tooltip to jQuery only if jQuery is present 6081 */ 6082 6083 6084 defineJQueryPlugin(Tooltip); 6085 6086 /** 6087 * -------------------------------------------------------------------------- 6088 * Bootstrap (v5.0.2): popover.js 6089 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6090 * -------------------------------------------------------------------------- 6091 */ 6092 /** 6093 * ------------------------------------------------------------------------ 6094 * Constants 6095 * ------------------------------------------------------------------------ 6096 */ 6097 6098 const NAME$3 = 'popover'; 6099 const DATA_KEY$3 = 'bs.popover'; 6100 const EVENT_KEY$3 = `.${DATA_KEY$3}`; 6101 const CLASS_PREFIX = 'bs-popover'; 6102 const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g'); 6103 const Default$2 = { ...Tooltip.Default, 6104 placement: 'right', 6105 offset: [0, 8], 6106 trigger: 'click', 6107 content: '', 6108 template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>' 6109 }; 6110 const DefaultType$2 = { ...Tooltip.DefaultType, 6111 content: '(string|element|function)' 6112 }; 6113 const Event$1 = { 6114 HIDE: `hide${EVENT_KEY$3}`, 6115 HIDDEN: `hidden${EVENT_KEY$3}`, 6116 SHOW: `show${EVENT_KEY$3}`, 6117 SHOWN: `shown${EVENT_KEY$3}`, 6118 INSERTED: `inserted${EVENT_KEY$3}`, 6119 CLICK: `click${EVENT_KEY$3}`, 6120 FOCUSIN: `focusin${EVENT_KEY$3}`, 6121 FOCUSOUT: `focusout${EVENT_KEY$3}`, 6122 MOUSEENTER: `mouseenter${EVENT_KEY$3}`, 6123 MOUSELEAVE: `mouseleave${EVENT_KEY$3}` 6124 }; 6125 const CLASS_NAME_FADE$2 = 'fade'; 6126 const CLASS_NAME_SHOW$2 = 'show'; 6127 const SELECTOR_TITLE = '.popover-header'; 6128 const SELECTOR_CONTENT = '.popover-body'; 6129 /** 6130 * ------------------------------------------------------------------------ 6131 * Class Definition 6132 * ------------------------------------------------------------------------ 6133 */ 6134 6135 class Popover extends Tooltip { 6136 // Getters 6137 static get Default() { 6138 return Default$2; 6139 } 6140 6141 static get NAME() { 6142 return NAME$3; 6143 } 6144 6145 static get Event() { 6146 return Event$1; 6147 } 6148 6149 static get DefaultType() { 6150 return DefaultType$2; 6151 } // Overrides 6152 6153 6154 isWithContent() { 6155 return this.getTitle() || this._getContent(); 6156 } 6157 6158 getTipElement() { 6159 if (this.tip) { 6160 return this.tip; 6161 } 6162 6163 this.tip = super.getTipElement(); 6164 6165 if (!this.getTitle()) { 6166 SelectorEngine.findOne(SELECTOR_TITLE, this.tip).remove(); 6167 } 6168 6169 if (!this._getContent()) { 6170 SelectorEngine.findOne(SELECTOR_CONTENT, this.tip).remove(); 6171 } 6172 6173 return this.tip; 6174 } 6175 6176 setContent() { 6177 const tip = this.getTipElement(); // we use append for html objects to maintain js events 6178 6179 this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle()); 6180 6181 let content = this._getContent(); 6182 6183 if (typeof content === 'function') { 6184 content = content.call(this._element); 6185 } 6186 6187 this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content); 6188 tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2); 6189 } // Private 6190 6191 6192 _addAttachmentClass(attachment) { 6193 this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`); 6194 } 6195 6196 _getContent() { 6197 return this._element.getAttribute('data-bs-content') || this._config.content; 6198 } 6199 6200 _cleanTipClass() { 6201 const tip = this.getTipElement(); 6202 const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX); 6203 6204 if (tabClass !== null && tabClass.length > 0) { 6205 tabClass.map(token =>
6205 token.trim()).forEach(tClass => tip.classList.remove(tClass)); 6206 } 6207 } // Static 6208 6209 6210 static jQueryInterface(config) { 6211 return this.each(function () { 6212 const data = Popover.getOrCreateInstance(this, config); 6213 6214 if (typeof config === 'string') { 6215 if (typeof data[config] === 'undefined') { 6216 throw new TypeError(`No method named "${config}"`); 6217 } 6218 6219 data[config](); 6220 } 6221 }); 6222 } 6223 6224 } 6225 /** 6226 * ------------------------------------------------------------------------ 6227 * jQuery 6228 * ------------------------------------------------------------------------ 6229 * add .Popover to jQuery only if jQuery is present 6230 */ 6231 6232 6233 defineJQueryPlugin(Popover); 6234 6235 /** 6236 * -------------------------------------------------------------------------- 6237 * Bootstrap (v5.0.2): scrollspy.js 6238 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6239 * -------------------------------------------------------------------------- 6240 */ 6241 /** 6242 * ------------------------------------------------------------------------ 6243 * Constants 6244 * ------------------------------------------------------------------------ 6245 */ 6246 6247 const NAME$2 = 'scrollspy'; 6248 const DATA_KEY$2 = 'bs.scrollspy'; 6249 const EVENT_KEY$2 = `.${DATA_KEY$2}`; 6250 const DATA_API_KEY$1 = '.data-api'; 6251 const Default$1 = { 6252 offset: 10, 6253 method: 'auto', 6254 target: '' 6255 }; 6256 const DefaultType$1 = { 6257 offset: 'number', 6258 method: 'string', 6259 target: '(string|element)' 6260 }; 6261 const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`; 6262 const EVENT_SCROLL = `scroll${EVENT_KEY$2}`; 6263 const EVENT_LOAD_DATA_API = `load${EVENT_KEY$2}${DATA_API_KEY$1}`; 6264 const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 6265 const CLASS_NAME_ACTIVE$1 = 'active'; 6266 const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; 6267 const SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; 6268 const SELECTOR_NAV_LINKS = '.nav-link'; 6269 const SELECTOR_NAV_ITEMS = '.nav-item'; 6270 const SELECTOR_LIST_ITEMS = '.list-group-item'; 6271 const SELECTOR_DROPDOWN$1 = '.dropdown'; 6272 const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 6273 const METHOD_OFFSET = 'offset'; 6274 const METHOD_POSITION = 'position'; 6275 /** 6276 * ------------------------------------------------------------------------ 6277 * Class Definition 6278 * ------------------------------------------------------------------------ 6279 */ 6280 6281 class ScrollSpy extends BaseComponent { 6282 constructor(element, config) { 6283 super(element); 6284 this._scrollElement = this._element.tagName === 'BODY' ? window : this._element; 6285 this._config = this._getConfig(config); 6286 this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS}, ${this._config.target} ${SELECTOR_LIST_ITEMS}, ${this._config.target} .${CLASS_NAME_DROPDOWN_ITEM}`; 6287 this._offsets = []; 6288 this._targets = []; 6289 this._activeTarget = null; 6290 this._scrollHeight = 0; 6291 EventHandler.on(this._scrollElement, EVENT_SCROLL, () => this._process()); 6292 this.refresh(); 6293 6294 this._process(); 6295 } // Getters 6296 6297 6298 static get Default() { 6299 return Default$1; 6300 } 6301 6302 static get NAME() { 6303 return NAME$2; 6304 } // Public 6305 6306 6307 refresh() { 6308 const autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; 6309 const offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 6310 const offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; 6311 this._offsets = []; 6312 this._targets = []; 6313 this._scrollHeight = this._getScrollHeight(); 6314 const targets = SelectorEngine.find(this._selector); 6315 targets.map(element => { 6316 const targetSelector = getSelectorFromElement(element); 6317 const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null; 6318 6319 if (target) { 6320 const targetBCR = target.getBoundingClientRect(); 6321 6322 if (targetBCR.width || targetBCR.height) { 6323 return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector]; 6324 } 6325 } 6326 6327 return null; 6328 }).filter(item => item).sort((a, b) =>
6328 a[0] - b[0]).forEach(item => { 6329 this._offsets.push(item[0]); 6330 6331 this._targets.push(item[1]); 6332 }); 6333 } 6334 6335 dispose() { 6336 EventHandler.off(this._scrollElement, EVENT_KEY$2); 6337 super.dispose(); 6338 } // Private 6339 6340 6341 _getConfig(config) { 6342 config = { ...Default$1, 6343 ...Manipulator.getDataAttributes(this._element), 6344 ...(typeof config === 'object' && config ? config : {}) 6345 }; 6346 6347 if (typeof config.target !== 'string' && isElement(config.target)) { 6348 let { 6349 id 6350 } = config.target; 6351 6352 if (!id) { 6353 id = getUID(NAME$2); 6354 config.target.id = id; 6355 } 6356 6357 config.target = `#${id}`; 6358 } 6359 6360 typeCheckConfig(NAME$2, config, DefaultType$1); 6361 return config; 6362 } 6363 6364 _getScrollTop() { 6365 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 6366 } 6367 6368 _getScrollHeight() { 6369 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 6370 } 6371 6372 _getOffsetHeight() { 6373 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 6374 } 6375 6376 _process() { 6377 const scrollTop = this._getScrollTop() + this._config.offset; 6378 6379 const scrollHeight = this._getScrollHeight(); 6380 6381 const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 6382 6383 if (this._scrollHeight !== scrollHeight) { 6384 this.refresh(); 6385 } 6386 6387 if (scrollTop >= maxScroll) { 6388 const target = this._targets[this._targets.length - 1]; 6389 6390 if (this._activeTarget !== target) { 6391 this._activate(target); 6392 } 6393 6394 return; 6395 } 6396 6397 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 6398 this._activeTarget = null; 6399 6400 this._clear(); 6401 6402 return; 6403 } 6404 6405 for (let i = this._offsets.length; i--;) { 6406 const isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 6407 6408 if (isActiveTarget) { 6409 this._activate(this._targets[i]); 6410 } 6411 } 6412 } 6413 6414 _activate(target) { 6415 this._activeTarget = target; 6416 6417 this._clear(); 6418 6419 const queries = this._selector.split(',').map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`); 6420 6421 const link = SelectorEngine.findOne(queries.join(',')); 6422 6423 if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) { 6424 SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, link.closest(SELECTOR_DROPDOWN$1)).classList.add(CLASS_NAME_ACTIVE$1); 6425 link.classList.add(CLASS_NAME_ACTIVE$1); 6426 } else { 6427 // Set triggered link as active 6428 link.classList.add(CLASS_NAME_ACTIVE$1); 6429 SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP$1).forEach(listGroup => { 6430 // Set triggered links parents as active
6431 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 6432 SelectorEngine.prev(listGroup, `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1)); // Handle special case when .nav-link is inside .nav-item 6433 6434 SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS).forEach(navItem => { 6435 SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(item => item.classList.add(CLASS_NAME_ACTIVE$1)); 6436 }); 6437 }); 6438 } 6439 6440 EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, { 6441 relatedTarget: target 6442 }); 6443 } 6444 6445 _clear() { 6446 SelectorEngine.find(this._selector).filter(node => node.classList.contains(CLASS_NAME_ACTIVE$1)).forEach(node => node.classList.remove(CLASS_NAME_ACTIVE$1)); 6447 } // Static 6448 6449 6450 static jQueryInterface(config) { 6451 return this.each(function () { 6452 const data = ScrollSpy.getOrCreateInstance(this, config); 6453 6454 if (typeof config !== 'string') { 6455 return; 6456 } 6457 6458 if (typeof data[config] === 'undefined') { 6459 throw new TypeError(`No method named "${config}"`); 6460 } 6461 6462 data[config](); 6463 }); 6464 } 6465 6466 } 6467 /** 6468 * ------------------------------------------------------------------------ 6469 * Data Api implementation 6470 * ------------------------------------------------------------------------ 6471 */ 6472 6473 6474 EventHandler.on(window, EVENT_LOAD_DATA_API, () => { 6475 SelectorEngine.find(SELECTOR_DATA_SPY).forEach(spy => new ScrollSpy(spy)); 6476 }); 6477 /** 6478 * ------------------------------------------------------------------------ 6479 * jQuery 6480 * ------------------------------------------------------------------------ 6481 * add .ScrollSpy to jQuery only if jQuery is present 6482 */ 6483 6484 defineJQueryPlugin(ScrollSpy); 6485 6486 /** 6487 * -------------------------------------------------------------------------- 6488 * Bootstrap (v5.0.2): tab.js 6489 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6490 * -------------------------------------------------------------------------- 6491 */ 6492 /** 6493 * ------------------------------------------------------------------------ 6494 * Constants 6495 * ------------------------------------------------------------------------ 6496 */ 6497 6498 const NAME$1 = 'tab'; 6499 const DATA_KEY$1 = 'bs.tab'; 6500 const EVENT_KEY$1 = `.${DATA_KEY$1}`; 6501 const DATA_API_KEY = '.data-api'; 6502 const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`; 6503 const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`; 6504 const EVENT_SHOW$1 = `show${EVENT_KEY$1}`; 6505 const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`; 6506 const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}${DATA_API_KEY}`; 6507 const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 6508 const CLASS_NAME_ACTIVE = 'active'; 6509 const CLASS_NAME_FADE$1 = 'fade'; 6510 const CLASS_NAME_SHOW$1 = 'show'; 6511 const SELECTOR_DROPDOWN = '.dropdown'; 6512 const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 6513 const SELECTOR_ACTIVE = '.active'; 6514 const SELECTOR_ACTIVE_UL = ':scope > li > .active'; 6515 const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; 6516 const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 6517 const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active'; 6518 /** 6519 * ------------------------------------------------------------------------ 6520 * Class Definition 6521 * ------------------------------------------------------------------------ 6522 */ 6523 6524 class Tab extends BaseComponent { 6525 // Getters 6526 static get NAME() { 6527 return NAME$1; 6528 } // Public 6529 6530 6531 show() { 6532 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE)) { 6533 return; 6534 } 6535 6536 let previous; 6537 const target = getElementFromSelector(this._element); 6538 6539 const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP); 6540 6541 if (listElement) { 6542 const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE; 6543 previous = SelectorEngine.find(itemSelector, listElement); 6544 previous = previous[previous.length - 1]; 6545 } 6546 6547 const hideEvent = previous ? EventHandler.trigger(previous, EVENT_HIDE$1, { 6548 relatedTarget: this._element 6549 }) : null; 6550 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$1, { 6551 relatedTarget: previous 6552 }); 6553 6554 if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) { 6555 return; 6556 } 6557 6558 this._activate(this._element, listElement); 6559 6560 const complete = () => { 6561 EventHandler.trigger(previous, EVENT_HIDDEN$1, { 6562 relatedTarget: this._element 6563 }); 6564 EventHandler.trigger(this._element, EVENT_SHOWN$1, { 6565 relatedTarget: previous 6566 }); 6567 }; 6568 6569 if (target) { 6570 this._activate(target, target.parentNode, complete); 6571 } else { 6572 complete(); 6573 } 6574 } // Private 6575 6576 6577 _activate(element, container, callback) { 6578 const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE); 6579 const active = activeElements[0]; 6580 const isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE$1); 6581 6582 const complete = () => this._transitionComplete(element, active, callback); 6583 6584 if (active && isTransitioning) { 6585 active.classList.remove(CLASS_NAME_SHOW$1); 6586 6587 this._queueCallback(complete, element, true); 6588 } else { 6589 complete(); 6590 } 6591 } 6592 6593 _transitionComplete(element, active, callback) { 6594 if (active) { 6595 active.classList.remove(CLASS_NAME_ACTIVE);
6596 const dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode); 6597 6598 if (dropdownChild) { 6599 dropdownChild.classList.remove(CLASS_NAME_ACTIVE); 6600 } 6601 6602 if (active.getAttribute('role') === 'tab') { 6603 active.setAttribute('aria-selected', false); 6604 } 6605 } 6606 6607 element.classList.add(CLASS_NAME_ACTIVE); 6608 6609 if (element.getAttribute('role') === 'tab') { 6610 element.setAttribute('aria-selected', true); 6611 } 6612 6613 reflow(element); 6614 6615 if (element.classList.contains(CLASS_NAME_FADE$1)) { 6616 element.classList.add(CLASS_NAME_SHOW$1); 6617 } 6618 6619 let parent = element.parentNode; 6620 6621 if (parent && parent.nodeName === 'LI') { 6622 parent = parent.parentNode; 6623 } 6624 6625 if (parent && parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)) { 6626 const dropdownElement = element.closest(SELECTOR_DROPDOWN); 6627 6628 if (dropdownElement) { 6629 SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE, dropdownElement).forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE)); 6630 } 6631 6632 element.setAttribute('aria-expanded', true); 6633 } 6634 6635 if (callback) { 6636 callback(); 6637 } 6638 } // Static 6639 6640 6641 static jQueryInterface(config) { 6642 return this.each(function () { 6643 const data = Tab.getOrCreateInstance(this); 6644 6645 if (typeof config === 'string') { 6646 if (typeof data[config] === 'undefined') { 6647 throw new TypeError(`No method named "${config}"`); 6648 } 6649 6650 data[config](); 6651 } 6652 }); 6653 } 6654 6655 } 6656 /** 6657 * ------------------------------------------------------------------------ 6658 * Data Api implementation 6659 * ------------------------------------------------------------------------ 6660 */ 6661 6662 6663 EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 6664 if (['A', 'AREA'].includes(this.tagName)) { 6665 event.preventDefault(); 6666 } 6667 6668 if (isDisabled(this)) { 6669 return; 6670 } 6671 6672 const data = Tab.getOrCreateInstance(this); 6673 data.show(); 6674 }); 6675 /** 6676 * ------------------------------------------------------------------------ 6677 * jQuery 6678 * ------------------------------------------------------------------------ 6679 * add .Tab to jQuery only if jQuery is present 6680 */ 6681 6682 defineJQueryPlugin(Tab); 6683 6684 /** 6685 * -------------------------------------------------------------------------- 6686 * Bootstrap (v5.0.2): toast.js 6687 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6688 * -------------------------------------------------------------------------- 6689 */ 6690 /** 6691 * ------------------------------------------------------------------------ 6692 * Constants 6693 * ------------------------------------------------------------------------ 6694 */ 6695 6696 const NAME = 'toast'; 6697 const DATA_KEY = 'bs.toast'; 6698 const EVENT_KEY = `.${DATA_KEY}`; 6699 const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`; 6700 const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`; 6701 const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`; 6702 const EVENT_FOCUSIN = `focusin${EVENT_KEY}`; 6703 const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`; 6704 const EVENT_HIDE = `hide${EVENT_KEY}`; 6705 const EVENT_HIDDEN = `hidden${EVENT_KEY}`; 6706 const EVENT_SHOW = `show${EVENT_KEY}`; 6707 const EVENT_SHOWN = `shown${EVENT_KEY}`; 6708 const CLASS_NAME_FADE = 'fade'; 6709 const CLASS_NAME_HIDE = 'hide'; 6710 const CLASS_NAME_SHOW = 'show'; 6711 const CLASS_NAME_SHOWING = 'showing'; 6712 const DefaultType = { 6713 animation: 'boolean', 6714 autohide: 'boolean', 6715 delay: 'number' 6716 }; 6717 const Default = { 6718 animation: true, 6719 autohide: true, 6720 delay: 5000 6721 }; 6722 const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]'; 6723 /** 6724 * ------------------------------------------------------------------------ 6725 * Class Definition 6726 * ------------------------------------------------------------------------ 6727 */ 6728 6729 class Toast extends BaseComponent { 6730 constructor(element, config) { 6731 super(element); 6732 this._config = this._getConfig(config); 6733 this._timeout = null; 6734 this._hasMouseInteraction = false;
vendor: 4,481 bytes, lines 6735-6889
6735 this._hasKeyboardInteraction = false; 6736 6737 this._setListeners(); 6738 } // Getters 6739 6740 6741 static get DefaultType() { 6742 return DefaultType; 6743 } 6744 6745 static get Default() { 6746 return Default; 6747 } 6748 6749 static get NAME() { 6750 return NAME; 6751 } // Public 6752 6753 6754 show() { 6755 const showEvent = EventHandler.trigger(this._element, EVENT_SHOW); 6756 6757 if (showEvent.defaultPrevented) { 6758 return; 6759 } 6760 6761 this._clearTimeout(); 6762 6763 if (this._config.animation) { 6764 this._element.classList.add(CLASS_NAME_FADE); 6765 } 6766 6767 const complete = () => { 6768 this._element.classList.remove(CLASS_NAME_SHOWING); 6769 6770 this._element.classList.add(CLASS_NAME_SHOW); 6771 6772 EventHandler.trigger(this._element, EVENT_SHOWN); 6773 6774 this._maybeScheduleHide(); 6775 }; 6776 6777 this._element.classList.remove(CLASS_NAME_HIDE); 6778 6779 reflow(this._element); 6780 6781 this._element.classList.add(CLASS_NAME_SHOWING); 6782 6783 this._queueCallback(complete, this._element, this._config.animation); 6784 } 6785 6786 hide() { 6787 if (!this._element.classList.contains(CLASS_NAME_SHOW)) { 6788 return; 6789 } 6790 6791 const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); 6792 6793 if (hideEvent.defaultPrevented) { 6794 return; 6795 } 6796 6797 const complete = () => { 6798 this._element.classList.add(CLASS_NAME_HIDE); 6799 6800 EventHandler.trigger(this._element, EVENT_HIDDEN); 6801 }; 6802 6803 this._element.classList.remove(CLASS_NAME_SHOW); 6804 6805 this._queueCallback(complete, this._element, this._config.animation); 6806 } 6807 6808 dispose() { 6809 this._clearTimeout(); 6810 6811 if (this._element.classList.contains(CLASS_NAME_SHOW)) { 6812 this._element.classList.remove(CLASS_NAME_SHOW); 6813 } 6814 6815 super.dispose(); 6816 } // Private 6817 6818 6819 _getConfig(config) { 6820 config = { ...Default, 6821 ...Manipulator.getDataAttributes(this._element), 6822 ...(typeof config === 'object' && config ? config : {}) 6823 }; 6824 typeCheckConfig(NAME, config, this.constructor.DefaultType); 6825 return config; 6826 } 6827 6828 _maybeScheduleHide() { 6829 if (!this._config.autohide) { 6830 return; 6831 } 6832 6833 if (this._hasMouseInteraction || this._hasKeyboardInteraction) { 6834 return; 6835 } 6836 6837 this._timeout = setTimeout(() => { 6838 this.hide(); 6839 }, this._config.delay); 6840 } 6841 6842 _onInteraction(event, isInteracting) { 6843 switch (event.type) { 6844 case 'mouseover': 6845 case 'mouseout': 6846 this._hasMouseInteraction = isInteracting; 6847 break; 6848 6849 case 'focusin': 6850 case 'focusout': 6851 this._hasKeyboardInteraction = isInteracting; 6852 break; 6853 } 6854 6855 if (isInteracting) { 6856 this._clearTimeout(); 6857 6858 return; 6859 } 6860 6861 const nextElement = event.relatedTarget; 6862 6863 if (this._element === nextElement || this._element.contains(nextElement)) { 6864 return; 6865 } 6866 6867 this._maybeScheduleHide(); 6868 } 6869 6870 _setListeners() { 6871 EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide()); 6872 EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true)); 6873 EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false)); 6874 EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true)); 6875 EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false)); 6876 } 6877 6878 _clearTimeout() { 6879 clearTimeout(this._timeout); 6880 this._timeout = null; 6881 } // Static 6882 6883 6884 static jQueryInterface(config) { 6885 return this.each(function () { 6886 const data = Toast.getOrCreateInstance(this, config); 6887 6888 if (typeof config === 'string') { 6889 if (typeof data[config] === 'undefined') {
6890 throw new TypeError(`No method named "${config}"`); 6891 } 6892 6893 data[config](this); 6894 } 6895 }); 6896 } 6897 6898 } 6899 /** 6900 * ------------------------------------------------------------------------ 6901 * jQuery 6902 * ------------------------------------------------------------------------ 6903 * add .Toast to jQuery only if jQuery is present 6904 */ 6905 6906 6907 defineJQueryPlugin(Toast); 6908 6909 /** 6910 * -------------------------------------------------------------------------- 6911 * Bootstrap (v5.0.2): index.umd.js 6912 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6913 * -------------------------------------------------------------------------- 6914 */ 6915 var index_umd = { 6916 Alert, 6917 Button, 6918 Carousel, 6919 Collapse, 6920 Dropdown, 6921 Modal, 6922 Offcanvas, 6923 Popover, 6924 ScrollSpy, 6925 Tab, 6926 Toast, 6927 Tooltip 6928 }; 6929 6930 return index_umd; 6931 6932}))); 6933//# sourceMappingURL=bootstrap.js.map 6934
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.