Rain Classroom PDF Direct Download

Automatic generation of direct download PDF on Rain Classroom

目前為 2021-11-13 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Rain Classroom PDF Direct Download
  3. // @name:zh-CN 雨课堂课件PDF下载工具
  4. // @namespace https://www.pizyds.com/
  5. // @version 1.3.1
  6. // @description Automatic generation of direct download PDF on Rain Classroom
  7. // @description:zh-CN 在雨课堂页面自动生成PDF版本课件提供下载
  8. // @author PillarsZhang
  9. // @homepage https://www.pizyds.com/rain-classroom-pdf-direct-download
  10. // @supportURL https://www.pizyds.com/rain-classroom-pdf-direct-download
  11. // @license MIT
  12. // @match https://*.yuketang.cn/*
  13. // @icon https://www.yuketang.cn/static/images/favicon.ico
  14. // @require https://cdn.jsdelivr.net/npm/jspdf@2.4.0/dist/jspdf.umd.min.js
  15. // @require https://cdn.jsdelivr.net/npm/html2canvas@0.5.0-beta4/dist/html2canvas.min.js
  16. // @require https://cdn.jsdelivr.net/npm/hybrid-crypto-js@0.2.4/web/hybrid-crypto.min.js
  17. // @require https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js
  18. // @grant GM_getValue
  19. // @grant GM_setValue
  20. // ==/UserScript==
  21.  
  22. /* eslint-disable */
  23. /* spell-checker: disable */
  24.  
  25. // @[ The code below is generated by webpack ]
  26. // @[ 下面的代码由 webpack 生成 ]
  27. // @[ You can find all source codes in GitHub repo ]
  28. // @[ 你可以在 GitHub 仓库中找到所有源代码 ]
  29. // @[ https://github.com/PillarsZhang/Rain-Classroom-PDF-Direct-Download ]
  30.  
  31. /******/ (() => { // webpackBootstrap
  32. /******/ var __webpack_modules__ = ({
  33.  
  34. /***/ 518:
  35. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  36.  
  37. "use strict";
  38. // ESM COMPAT FLAG
  39. __webpack_require__.r(__webpack_exports__);
  40.  
  41. // EXPORTS
  42. __webpack_require__.d(__webpack_exports__, {
  43. "afterMain": () => (/* reexport */ afterMain),
  44. "afterRead": () => (/* reexport */ afterRead),
  45. "afterWrite": () => (/* reexport */ afterWrite),
  46. "applyStyles": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_modifiers_applyStyles),
  47. "arrow": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_modifiers_arrow),
  48. "auto": () => (/* reexport */ auto),
  49. "basePlacements": () => (/* reexport */ basePlacements),
  50. "beforeMain": () => (/* reexport */ beforeMain),
  51. "beforeRead": () => (/* reexport */ beforeRead),
  52. "beforeWrite": () => (/* reexport */ beforeWrite),
  53. "bottom": () => (/* reexport */ bottom),
  54. "clippingParents": () => (/* reexport */ clippingParents),
  55. "computeStyles": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_modifiers_computeStyles),
  56. "createPopper": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_popper_createPopper),
  57. "createPopperBase": () => (/* reexport */ createPopper),
  58. "createPopperLite": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_popper_lite_createPopper),
  59. "detectOverflow": () => (/* reexport */ detectOverflow),
  60. "end": () => (/* reexport */ end),
  61. "eventListeners": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_modifiers_eventListeners),
  62. "flip": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_modifiers_flip),
  63. "hide": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_modifiers_hide),
  64. "left": () => (/* reexport */ left),
  65. "main": () => (/* reexport */ main),
  66. "modifierPhases": () => (/* reexport */ modifierPhases),
  67. "offset": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_modifiers_offset),
  68. "placements": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_enums_placements),
  69. "popper": () => (/* reexport */ popper),
  70. "popperGenerator": () => (/* reexport */ popperGenerator),
  71. "popperOffsets": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_modifiers_popperOffsets),
  72. "preventOverflow": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_modifiers_preventOverflow),
  73. "read": () => (/* reexport */ read),
  74. "reference": () => (/* reexport */ reference),
  75. "right": () => (/* reexport */ right),
  76. "start": () => (/* reexport */ start),
  77. "top": () => (/* reexport */ PRPU_node_modules_popperjs_core_lib_enums_top),
  78. "variationPlacements": () => (/* reexport */ variationPlacements),
  79. "viewport": () => (/* reexport */ viewport),
  80. "write": () => (/* reexport */ write)
  81. });
  82.  
  83. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\enums.js
  84. var PRPU_node_modules_popperjs_core_lib_enums_top = 'top';
  85. var bottom = 'bottom';
  86. var right = 'right';
  87. var left = 'left';
  88. var auto = 'auto';
  89. var basePlacements = [PRPU_node_modules_popperjs_core_lib_enums_top, bottom, right, left];
  90. var start = 'start';
  91. var end = 'end';
  92. var clippingParents = 'clippingParents';
  93. var viewport = 'viewport';
  94. var popper = 'popper';
  95. var reference = 'reference';
  96. var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
  97. return acc.concat([placement + "-" + start, placement + "-" + end]);
  98. }, []);
  99. var PRPU_node_modules_popperjs_core_lib_enums_placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
  100. return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
  101. }, []); // modifiers that need to read the DOM
  102.  
  103. var beforeRead = 'beforeRead';
  104. var read = 'read';
  105. var afterRead = 'afterRead'; // pure-logic modifiers
  106.  
  107. var beforeMain = 'beforeMain';
  108. var main = 'main';
  109. var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
  110.  
  111. var beforeWrite = 'beforeWrite';
  112. var write = 'write';
  113. var afterWrite = 'afterWrite';
  114. var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
  115. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getNodeName.js
  116. function getNodeName(element) {
  117. return element ? (element.nodeName || '').toLowerCase() : null;
  118. }
  119. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getWindow.js
  120. function getWindow(node) {
  121. if (node == null) {
  122. return window;
  123. }
  124.  
  125. if (node.toString() !== '[object Window]') {
  126. var ownerDocument = node.ownerDocument;
  127. return ownerDocument ? ownerDocument.defaultView || window : window;
  128. }
  129.  
  130. return node;
  131. }
  132. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\instanceOf.js
  133.  
  134.  
  135. function isElement(node) {
  136. var OwnElement = getWindow(node).Element;
  137. return node instanceof OwnElement || node instanceof Element;
  138. }
  139.  
  140. function isHTMLElement(node) {
  141. var OwnElement = getWindow(node).HTMLElement;
  142. return node instanceof OwnElement || node instanceof HTMLElement;
  143. }
  144.  
  145. function isShadowRoot(node) {
  146. // IE 11 has no ShadowRoot
  147. if (typeof ShadowRoot === 'undefined') {
  148. return false;
  149. }
  150.  
  151. var OwnElement = getWindow(node).ShadowRoot;
  152. return node instanceof OwnElement || node instanceof ShadowRoot;
  153. }
  154.  
  155.  
  156. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\applyStyles.js
  157.  
  158. // This modifier takes the styles prepared by the `computeStyles` modifier
  159. // and applies them to the HTMLElements such as popper and arrow
  160.  
  161. function applyStyles(_ref) {
  162. var state = _ref.state;
  163. Object.keys(state.elements).forEach(function (name) {
  164. var style = state.styles[name] || {};
  165. var attributes = state.attributes[name] || {};
  166. var element = state.elements[name]; // arrow is optional + virtual elements
  167.  
  168. if (!isHTMLElement(element) || !getNodeName(element)) {
  169. return;
  170. } // Flow doesn't support to extend this property, but it's the most
  171. // effective way to apply styles to an HTMLElement
  172. // $FlowFixMe[cannot-write]
  173.  
  174.  
  175. Object.assign(element.style, style);
  176. Object.keys(attributes).forEach(function (name) {
  177. var value = attributes[name];
  178.  
  179. if (value === false) {
  180. element.removeAttribute(name);
  181. } else {
  182. element.setAttribute(name, value === true ? '' : value);
  183. }
  184. });
  185. });
  186. }
  187.  
  188. function effect(_ref2) {
  189. var state = _ref2.state;
  190. var initialStyles = {
  191. popper: {
  192. position: state.options.strategy,
  193. left: '0',
  194. top: '0',
  195. margin: '0'
  196. },
  197. arrow: {
  198. position: 'absolute'
  199. },
  200. reference: {}
  201. };
  202. Object.assign(state.elements.popper.style, initialStyles.popper);
  203. state.styles = initialStyles;
  204.  
  205. if (state.elements.arrow) {
  206. Object.assign(state.elements.arrow.style, initialStyles.arrow);
  207. }
  208.  
  209. return function () {
  210. Object.keys(state.elements).forEach(function (name) {
  211. var element = state.elements[name];
  212. var attributes = state.attributes[name] || {};
  213. var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
  214.  
  215. var style = styleProperties.reduce(function (style, property) {
  216. style[property] = '';
  217. return style;
  218. }, {}); // arrow is optional + virtual elements
  219.  
  220. if (!isHTMLElement(element) || !getNodeName(element)) {
  221. return;
  222. }
  223.  
  224. Object.assign(element.style, style);
  225. Object.keys(attributes).forEach(function (attribute) {
  226. element.removeAttribute(attribute);
  227. });
  228. });
  229. };
  230. } // eslint-disable-next-line import/no-unused-modules
  231.  
  232.  
  233. /* harmony default export */ const PRPU_node_modules_popperjs_core_lib_modifiers_applyStyles = ({
  234. name: 'applyStyles',
  235. enabled: true,
  236. phase: 'write',
  237. fn: applyStyles,
  238. effect: effect,
  239. requires: ['computeStyles']
  240. });
  241. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\getBasePlacement.js
  242.  
  243. function getBasePlacement(placement) {
  244. return placement.split('-')[0];
  245. }
  246. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getBoundingClientRect.js
  247. function getBoundingClientRect(element) {
  248. var rect = element.getBoundingClientRect();
  249. return {
  250. width: rect.width,
  251. height: rect.height,
  252. top: rect.top,
  253. right: rect.right,
  254. bottom: rect.bottom,
  255. left: rect.left,
  256. x: rect.left,
  257. y: rect.top
  258. };
  259. }
  260. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getLayoutRect.js
  261. // Returns the layout rect of an element relative to its offsetParent. Layout
  262. // means it doesn't take into account transforms.
  263.  
  264. function getLayoutRect(element) {
  265. var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
  266. // Fixes https://github.com/popperjs/popper-core/issues/1223
  267.  
  268. var width = element.offsetWidth;
  269. var height = element.offsetHeight;
  270.  
  271. if (Math.abs(clientRect.width - width) <= 1) {
  272. width = clientRect.width;
  273. }
  274.  
  275. if (Math.abs(clientRect.height - height) <= 1) {
  276. height = clientRect.height;
  277. }
  278.  
  279. return {
  280. x: element.offsetLeft,
  281. y: element.offsetTop,
  282. width: width,
  283. height: height
  284. };
  285. }
  286. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\contains.js
  287.  
  288. function contains(parent, child) {
  289. var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
  290.  
  291. if (parent.contains(child)) {
  292. return true;
  293. } // then fallback to custom implementation with Shadow DOM support
  294. else if (rootNode && isShadowRoot(rootNode)) {
  295. var next = child;
  296.  
  297. do {
  298. if (next && parent.isSameNode(next)) {
  299. return true;
  300. } // $FlowFixMe[prop-missing]: need a better way to handle this...
  301.  
  302.  
  303. next = next.parentNode || next.host;
  304. } while (next);
  305. } // Give up, the result is false
  306.  
  307.  
  308. return false;
  309. }
  310. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getComputedStyle.js
  311.  
  312. function getComputedStyle(element) {
  313. return getWindow(element).getComputedStyle(element);
  314. }
  315. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\isTableElement.js
  316.  
  317. function isTableElement(element) {
  318. return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
  319. }
  320. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getDocumentElement.js
  321.  
  322. function getDocumentElement(element) {
  323. // $FlowFixMe[incompatible-return]: assume body is always available
  324. return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
  325. element.document) || window.document).documentElement;
  326. }
  327. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getParentNode.js
  328.  
  329.  
  330.  
  331. function getParentNode(element) {
  332. if (getNodeName(element) === 'html') {
  333. return element;
  334. }
  335.  
  336. return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
  337. // $FlowFixMe[incompatible-return]
  338. // $FlowFixMe[prop-missing]
  339. element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
  340. element.parentNode || ( // DOM Element detected
  341. isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
  342. // $FlowFixMe[incompatible-call]: HTMLElement is a Node
  343. getDocumentElement(element) // fallback
  344.  
  345. );
  346. }
  347. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getOffsetParent.js
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355. function getTrueOffsetParent(element) {
  356. if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
  357. getComputedStyle(element).position === 'fixed') {
  358. return null;
  359. }
  360.  
  361. return element.offsetParent;
  362. } // `.offsetParent` reports `null` for fixed elements, while absolute elements
  363. // return the containing block
  364.  
  365.  
  366. function getContainingBlock(element) {
  367. var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
  368. var isIE = navigator.userAgent.indexOf('Trident') !== -1;
  369.  
  370. if (isIE && isHTMLElement(element)) {
  371. // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
  372. var elementCss = getComputedStyle(element);
  373.  
  374. if (elementCss.position === 'fixed') {
  375. return null;
  376. }
  377. }
  378.  
  379. var currentNode = getParentNode(element);
  380.  
  381. while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
  382. var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
  383. // create a containing block.
  384. // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
  385.  
  386. 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') {
  387. return currentNode;
  388. } else {
  389. currentNode = currentNode.parentNode;
  390. }
  391. }
  392.  
  393. return null;
  394. } // Gets the closest ancestor positioned element. Handles some edge cases,
  395. // such as table ancestors and cross browser bugs.
  396.  
  397.  
  398. function getOffsetParent(element) {
  399. var window = getWindow(element);
  400. var offsetParent = getTrueOffsetParent(element);
  401.  
  402. while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
  403. offsetParent = getTrueOffsetParent(offsetParent);
  404. }
  405.  
  406. if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
  407. return window;
  408. }
  409.  
  410. return offsetParent || getContainingBlock(element) || window;
  411. }
  412. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\getMainAxisFromPlacement.js
  413. function getMainAxisFromPlacement(placement) {
  414. return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
  415. }
  416. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\math.js
  417. var PRPU_node_modules_popperjs_core_lib_utils_math_max = Math.max;
  418. var PRPU_node_modules_popperjs_core_lib_utils_math_min = Math.min;
  419. var round = Math.round;
  420. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\within.js
  421.  
  422. function within(min, value, max) {
  423. return PRPU_node_modules_popperjs_core_lib_utils_math_max(min, PRPU_node_modules_popperjs_core_lib_utils_math_min(value, max));
  424. }
  425. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\getFreshSideObject.js
  426. function getFreshSideObject() {
  427. return {
  428. top: 0,
  429. right: 0,
  430. bottom: 0,
  431. left: 0
  432. };
  433. }
  434. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\mergePaddingObject.js
  435.  
  436. function mergePaddingObject(paddingObject) {
  437. return Object.assign({}, getFreshSideObject(), paddingObject);
  438. }
  439. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\expandToHashMap.js
  440. function expandToHashMap(value, keys) {
  441. return keys.reduce(function (hashMap, key) {
  442. hashMap[key] = value;
  443. return hashMap;
  444. }, {});
  445. }
  446. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\arrow.js
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456. // eslint-disable-next-line import/no-unused-modules
  457.  
  458. var toPaddingObject = function toPaddingObject(padding, state) {
  459. padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
  460. placement: state.placement
  461. })) : padding;
  462. return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
  463. };
  464.  
  465. function arrow(_ref) {
  466. var _state$modifiersData$;
  467.  
  468. var state = _ref.state,
  469. name = _ref.name,
  470. options = _ref.options;
  471. var arrowElement = state.elements.arrow;
  472. var popperOffsets = state.modifiersData.popperOffsets;
  473. var basePlacement = getBasePlacement(state.placement);
  474. var axis = getMainAxisFromPlacement(basePlacement);
  475. var isVertical = [left, right].indexOf(basePlacement) >= 0;
  476. var len = isVertical ? 'height' : 'width';
  477.  
  478. if (!arrowElement || !popperOffsets) {
  479. return;
  480. }
  481.  
  482. var paddingObject = toPaddingObject(options.padding, state);
  483. var arrowRect = getLayoutRect(arrowElement);
  484. var minProp = axis === 'y' ? PRPU_node_modules_popperjs_core_lib_enums_top : left;
  485. var maxProp = axis === 'y' ? bottom : right;
  486. var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
  487. var startDiff = popperOffsets[axis] - state.rects.reference[axis];
  488. var arrowOffsetParent = getOffsetParent(arrowElement);
  489. var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
  490. var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
  491. // outside of the popper bounds
  492.  
  493. var min = paddingObject[minProp];
  494. var max = clientSize - arrowRect[len] - paddingObject[maxProp];
  495. var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
  496. var offset = within(min, center, max); // Prevents breaking syntax highlighting...
  497.  
  498. var axisProp = axis;
  499. state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
  500. }
  501.  
  502. function PRPU_node_modules_popperjs_core_lib_modifiers_arrow_effect(_ref2) {
  503. var state = _ref2.state,
  504. options = _ref2.options;
  505. var _options$element = options.element,
  506. arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
  507.  
  508. if (arrowElement == null) {
  509. return;
  510. } // CSS selector
  511.  
  512.  
  513. if (typeof arrowElement === 'string') {
  514. arrowElement = state.elements.popper.querySelector(arrowElement);
  515.  
  516. if (!arrowElement) {
  517. return;
  518. }
  519. }
  520.  
  521. if (false) {}
  522.  
  523. if (!contains(state.elements.popper, arrowElement)) {
  524. if (false) {}
  525.  
  526. return;
  527. }
  528.  
  529. state.elements.arrow = arrowElement;
  530. } // eslint-disable-next-line import/no-unused-modules
  531.  
  532.  
  533. /* harmony default export */ const PRPU_node_modules_popperjs_core_lib_modifiers_arrow = ({
  534. name: 'arrow',
  535. enabled: true,
  536. phase: 'main',
  537. fn: arrow,
  538. effect: PRPU_node_modules_popperjs_core_lib_modifiers_arrow_effect,
  539. requires: ['popperOffsets'],
  540. requiresIfExists: ['preventOverflow']
  541. });
  542. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\computeStyles.js
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549. // eslint-disable-next-line import/no-unused-modules
  550.  
  551. var unsetSides = {
  552. top: 'auto',
  553. right: 'auto',
  554. bottom: 'auto',
  555. left: 'auto'
  556. }; // Round the offsets to the nearest suitable subpixel based on the DPR.
  557. // Zooming can change the DPR, but it seems to report a value that will
  558. // cleanly divide the values into the appropriate subpixels.
  559.  
  560. function roundOffsetsByDPR(_ref) {
  561. var x = _ref.x,
  562. y = _ref.y;
  563. var win = window;
  564. var dpr = win.devicePixelRatio || 1;
  565. return {
  566. x: round(round(x * dpr) / dpr) || 0,
  567. y: round(round(y * dpr) / dpr) || 0
  568. };
  569. }
  570.  
  571. function mapToStyles(_ref2) {
  572. var _Object$assign2;
  573.  
  574. var popper = _ref2.popper,
  575. popperRect = _ref2.popperRect,
  576. placement = _ref2.placement,
  577. offsets = _ref2.offsets,
  578. position = _ref2.position,
  579. gpuAcceleration = _ref2.gpuAcceleration,
  580. adaptive = _ref2.adaptive,
  581. roundOffsets = _ref2.roundOffsets;
  582.  
  583. var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
  584. _ref3$x = _ref3.x,
  585. x = _ref3$x === void 0 ? 0 : _ref3$x,
  586. _ref3$y = _ref3.y,
  587. y = _ref3$y === void 0 ? 0 : _ref3$y;
  588.  
  589. var hasX = offsets.hasOwnProperty('x');
  590. var hasY = offsets.hasOwnProperty('y');
  591. var sideX = left;
  592. var sideY = PRPU_node_modules_popperjs_core_lib_enums_top;
  593. var win = window;
  594.  
  595. if (adaptive) {
  596. var offsetParent = getOffsetParent(popper);
  597. var heightProp = 'clientHeight';
  598. var widthProp = 'clientWidth';
  599.  
  600. if (offsetParent === getWindow(popper)) {
  601. offsetParent = getDocumentElement(popper);
  602.  
  603. if (getComputedStyle(offsetParent).position !== 'static') {
  604. heightProp = 'scrollHeight';
  605. widthProp = 'scrollWidth';
  606. }
  607. } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
  608.  
  609.  
  610. offsetParent = offsetParent;
  611.  
  612. if (placement === PRPU_node_modules_popperjs_core_lib_enums_top) {
  613. sideY = bottom; // $FlowFixMe[prop-missing]
  614.  
  615. y -= offsetParent[heightProp] - popperRect.height;
  616. y *= gpuAcceleration ? 1 : -1;
  617. }
  618.  
  619. if (placement === left) {
  620. sideX = right; // $FlowFixMe[prop-missing]
  621.  
  622. x -= offsetParent[widthProp] - popperRect.width;
  623. x *= gpuAcceleration ? 1 : -1;
  624. }
  625. }
  626.  
  627. var commonStyles = Object.assign({
  628. position: position
  629. }, adaptive && unsetSides);
  630.  
  631. if (gpuAcceleration) {
  632. var _Object$assign;
  633.  
  634. 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));
  635. }
  636.  
  637. return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
  638. }
  639.  
  640. function computeStyles(_ref4) {
  641. var state = _ref4.state,
  642. options = _ref4.options;
  643. var _options$gpuAccelerat = options.gpuAcceleration,
  644. gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
  645. _options$adaptive = options.adaptive,
  646. adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
  647. _options$roundOffsets = options.roundOffsets,
  648. roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
  649.  
  650. if (false) { var transitionProperty; }
  651.  
  652. var commonStyles = {
  653. placement: getBasePlacement(state.placement),
  654. popper: state.elements.popper,
  655. popperRect: state.rects.popper,
  656. gpuAcceleration: gpuAcceleration
  657. };
  658.  
  659. if (state.modifiersData.popperOffsets != null) {
  660. state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
  661. offsets: state.modifiersData.popperOffsets,
  662. position: state.options.strategy,
  663. adaptive: adaptive,
  664. roundOffsets: roundOffsets
  665. })));
  666. }
  667.  
  668. if (state.modifiersData.arrow != null) {
  669. state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
  670. offsets: state.modifiersData.arrow,
  671. position: 'absolute',
  672. adaptive: false,
  673. roundOffsets: roundOffsets
  674. })));
  675. }
  676.  
  677. state.attributes.popper = Object.assign({}, state.attributes.popper, {
  678. 'data-popper-placement': state.placement
  679. });
  680. } // eslint-disable-next-line import/no-unused-modules
  681.  
  682.  
  683. /* harmony default export */ const PRPU_node_modules_popperjs_core_lib_modifiers_computeStyles = ({
  684. name: 'computeStyles',
  685. enabled: true,
  686. phase: 'beforeWrite',
  687. fn: computeStyles,
  688. data: {}
  689. });
  690. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\eventListeners.js
  691. // eslint-disable-next-line import/no-unused-modules
  692.  
  693. var passive = {
  694. passive: true
  695. };
  696.  
  697. function PRPU_node_modules_popperjs_core_lib_modifiers_eventListeners_effect(_ref) {
  698. var state = _ref.state,
  699. instance = _ref.instance,
  700. options = _ref.options;
  701. var _options$scroll = options.scroll,
  702. scroll = _options$scroll === void 0 ? true : _options$scroll,
  703. _options$resize = options.resize,
  704. resize = _options$resize === void 0 ? true : _options$resize;
  705. var window = getWindow(state.elements.popper);
  706. var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
  707.  
  708. if (scroll) {
  709. scrollParents.forEach(function (scrollParent) {
  710. scrollParent.addEventListener('scroll', instance.update, passive);
  711. });
  712. }
  713.  
  714. if (resize) {
  715. window.addEventListener('resize', instance.update, passive);
  716. }
  717.  
  718. return function () {
  719. if (scroll) {
  720. scrollParents.forEach(function (scrollParent) {
  721. scrollParent.removeEventListener('scroll', instance.update, passive);
  722. });
  723. }
  724.  
  725. if (resize) {
  726. window.removeEventListener('resize', instance.update, passive);
  727. }
  728. };
  729. } // eslint-disable-next-line import/no-unused-modules
  730.  
  731.  
  732. /* harmony default export */ const PRPU_node_modules_popperjs_core_lib_modifiers_eventListeners = ({
  733. name: 'eventListeners',
  734. enabled: true,
  735. phase: 'write',
  736. fn: function fn() {},
  737. effect: PRPU_node_modules_popperjs_core_lib_modifiers_eventListeners_effect,
  738. data: {}
  739. });
  740. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\getOppositePlacement.js
  741. var hash = {
  742. left: 'right',
  743. right: 'left',
  744. bottom: 'top',
  745. top: 'bottom'
  746. };
  747. function getOppositePlacement(placement) {
  748. return placement.replace(/left|right|bottom|top/g, function (matched) {
  749. return hash[matched];
  750. });
  751. }
  752. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\getOppositeVariationPlacement.js
  753. var PRPU_node_modules_popperjs_core_lib_utils_getOppositeVariationPlacement_hash = {
  754. start: 'end',
  755. end: 'start'
  756. };
  757. function getOppositeVariationPlacement(placement) {
  758. return placement.replace(/start|end/g, function (matched) {
  759. return PRPU_node_modules_popperjs_core_lib_utils_getOppositeVariationPlacement_hash[matched];
  760. });
  761. }
  762. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getWindowScroll.js
  763.  
  764. function getWindowScroll(node) {
  765. var win = getWindow(node);
  766. var scrollLeft = win.pageXOffset;
  767. var scrollTop = win.pageYOffset;
  768. return {
  769. scrollLeft: scrollLeft,
  770. scrollTop: scrollTop
  771. };
  772. }
  773. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getWindowScrollBarX.js
  774.  
  775.  
  776.  
  777. function getWindowScrollBarX(element) {
  778. // If <html> has a CSS width greater than the viewport, then this will be
  779. // incorrect for RTL.
  780. // Popper 1 is broken in this case and never had a bug report so let's assume
  781. // it's not an issue. I don't think anyone ever specifies width on <html>
  782. // anyway.
  783. // Browsers where the left scrollbar doesn't cause an issue report `0` for
  784. // this (e.g. Edge 2019, IE11, Safari)
  785. return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
  786. }
  787. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getViewportRect.js
  788.  
  789.  
  790.  
  791. function getViewportRect(element) {
  792. var win = getWindow(element);
  793. var html = getDocumentElement(element);
  794. var visualViewport = win.visualViewport;
  795. var width = html.clientWidth;
  796. var height = html.clientHeight;
  797. var x = 0;
  798. var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
  799. // can be obscured underneath it.
  800. // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
  801. // if it isn't open, so if this isn't available, the popper will be detected
  802. // to overflow the bottom of the screen too early.
  803.  
  804. if (visualViewport) {
  805. width = visualViewport.width;
  806. height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
  807. // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
  808. // errors due to floating point numbers, so we need to check precision.
  809. // Safari returns a number <= 0, usually < -1 when pinch-zoomed
  810. // Feature detection fails in mobile emulation mode in Chrome.
  811. // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
  812. // 0.001
  813. // Fallback here: "Not Safari" userAgent
  814.  
  815. if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
  816. x = visualViewport.offsetLeft;
  817. y = visualViewport.offsetTop;
  818. }
  819. }
  820.  
  821. return {
  822. width: width,
  823. height: height,
  824. x: x + getWindowScrollBarX(element),
  825. y: y
  826. };
  827. }
  828. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getDocumentRect.js
  829.  
  830.  
  831.  
  832.  
  833. // Gets the entire size of the scrollable document area, even extending outside
  834. // of the `<html>` and `<body>` rect bounds if horizontally scrollable
  835.  
  836. function getDocumentRect(element) {
  837. var _element$ownerDocumen;
  838.  
  839. var html = getDocumentElement(element);
  840. var winScroll = getWindowScroll(element);
  841. var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
  842. var width = PRPU_node_modules_popperjs_core_lib_utils_math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
  843. var height = PRPU_node_modules_popperjs_core_lib_utils_math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
  844. var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
  845. var y = -winScroll.scrollTop;
  846.  
  847. if (getComputedStyle(body || html).direction === 'rtl') {
  848. x += PRPU_node_modules_popperjs_core_lib_utils_math_max(html.clientWidth, body ? body.clientWidth : 0) - width;
  849. }
  850.  
  851. return {
  852. width: width,
  853. height: height,
  854. x: x,
  855. y: y
  856. };
  857. }
  858. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\isScrollParent.js
  859.  
  860. function isScrollParent(element) {
  861. // Firefox wants us to check `-x` and `-y` variations as well
  862. var _getComputedStyle = getComputedStyle(element),
  863. overflow = _getComputedStyle.overflow,
  864. overflowX = _getComputedStyle.overflowX,
  865. overflowY = _getComputedStyle.overflowY;
  866.  
  867. return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
  868. }
  869. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getScrollParent.js
  870.  
  871.  
  872.  
  873.  
  874. function getScrollParent(node) {
  875. if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
  876. // $FlowFixMe[incompatible-return]: assume body is always available
  877. return node.ownerDocument.body;
  878. }
  879.  
  880. if (isHTMLElement(node) && isScrollParent(node)) {
  881. return node;
  882. }
  883.  
  884. return getScrollParent(getParentNode(node));
  885. }
  886. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\listScrollParents.js
  887.  
  888.  
  889.  
  890.  
  891. /*
  892. given a DOM element, return the list of all scroll parents, up the list of ancesors
  893. until we get to the top window object. This list is what we attach scroll listeners
  894. to, because if any of these parent elements scroll, we'll need to re-calculate the
  895. reference element's position.
  896. */
  897.  
  898. function listScrollParents(element, list) {
  899. var _element$ownerDocumen;
  900.  
  901. if (list === void 0) {
  902. list = [];
  903. }
  904.  
  905. var scrollParent = getScrollParent(element);
  906. var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
  907. var win = getWindow(scrollParent);
  908. var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
  909. var updatedList = list.concat(target);
  910. return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
  911. updatedList.concat(listScrollParents(getParentNode(target)));
  912. }
  913. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\rectToClientRect.js
  914. function rectToClientRect(rect) {
  915. return Object.assign({}, rect, {
  916. left: rect.x,
  917. top: rect.y,
  918. right: rect.x + rect.width,
  919. bottom: rect.y + rect.height
  920. });
  921. }
  922. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getClippingRect.js
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938. function getInnerBoundingClientRect(element) {
  939. var rect = getBoundingClientRect(element);
  940. rect.top = rect.top + element.clientTop;
  941. rect.left = rect.left + element.clientLeft;
  942. rect.bottom = rect.top + element.clientHeight;
  943. rect.right = rect.left + element.clientWidth;
  944. rect.width = element.clientWidth;
  945. rect.height = element.clientHeight;
  946. rect.x = rect.left;
  947. rect.y = rect.top;
  948. return rect;
  949. }
  950.  
  951. function getClientRectFromMixedType(element, clippingParent) {
  952. return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
  953. } // A "clipping parent" is an overflowable container with the characteristic of
  954. // clipping (or hiding) overflowing elements with a position different from
  955. // `initial`
  956.  
  957.  
  958. function getClippingParents(element) {
  959. var clippingParents = listScrollParents(getParentNode(element));
  960. var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
  961. var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
  962.  
  963. if (!isElement(clipperElement)) {
  964. return [];
  965. } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
  966.  
  967.  
  968. return clippingParents.filter(function (clippingParent) {
  969. return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
  970. });
  971. } // Gets the maximum area that the element is visible in due to any number of
  972. // clipping parents
  973.  
  974.  
  975. function getClippingRect(element, boundary, rootBoundary) {
  976. var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
  977. var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
  978. var firstClippingParent = clippingParents[0];
  979. var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
  980. var rect = getClientRectFromMixedType(element, clippingParent);
  981. accRect.top = PRPU_node_modules_popperjs_core_lib_utils_math_max(rect.top, accRect.top);
  982. accRect.right = PRPU_node_modules_popperjs_core_lib_utils_math_min(rect.right, accRect.right);
  983. accRect.bottom = PRPU_node_modules_popperjs_core_lib_utils_math_min(rect.bottom, accRect.bottom);
  984. accRect.left = PRPU_node_modules_popperjs_core_lib_utils_math_max(rect.left, accRect.left);
  985. return accRect;
  986. }, getClientRectFromMixedType(element, firstClippingParent));
  987. clippingRect.width = clippingRect.right - clippingRect.left;
  988. clippingRect.height = clippingRect.bottom - clippingRect.top;
  989. clippingRect.x = clippingRect.left;
  990. clippingRect.y = clippingRect.top;
  991. return clippingRect;
  992. }
  993. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\getVariation.js
  994. function getVariation(placement) {
  995. return placement.split('-')[1];
  996. }
  997. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\computeOffsets.js
  998.  
  999.  
  1000.  
  1001.  
  1002. function computeOffsets(_ref) {
  1003. var reference = _ref.reference,
  1004. element = _ref.element,
  1005. placement = _ref.placement;
  1006. var basePlacement = placement ? getBasePlacement(placement) : null;
  1007. var variation = placement ? getVariation(placement) : null;
  1008. var commonX = reference.x + reference.width / 2 - element.width / 2;
  1009. var commonY = reference.y + reference.height / 2 - element.height / 2;
  1010. var offsets;
  1011.  
  1012. switch (basePlacement) {
  1013. case PRPU_node_modules_popperjs_core_lib_enums_top:
  1014. offsets = {
  1015. x: commonX,
  1016. y: reference.y - element.height
  1017. };
  1018. break;
  1019.  
  1020. case bottom:
  1021. offsets = {
  1022. x: commonX,
  1023. y: reference.y + reference.height
  1024. };
  1025. break;
  1026.  
  1027. case right:
  1028. offsets = {
  1029. x: reference.x + reference.width,
  1030. y: commonY
  1031. };
  1032. break;
  1033.  
  1034. case left:
  1035. offsets = {
  1036. x: reference.x - element.width,
  1037. y: commonY
  1038. };
  1039. break;
  1040.  
  1041. default:
  1042. offsets = {
  1043. x: reference.x,
  1044. y: reference.y
  1045. };
  1046. }
  1047.  
  1048. var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
  1049.  
  1050. if (mainAxis != null) {
  1051. var len = mainAxis === 'y' ? 'height' : 'width';
  1052.  
  1053. switch (variation) {
  1054. case start:
  1055. offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
  1056. break;
  1057.  
  1058. case end:
  1059. offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
  1060. break;
  1061.  
  1062. default:
  1063. }
  1064. }
  1065.  
  1066. return offsets;
  1067. }
  1068. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\detectOverflow.js
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077. // eslint-disable-next-line import/no-unused-modules
  1078.  
  1079. function detectOverflow(state, options) {
  1080. if (options === void 0) {
  1081. options = {};
  1082. }
  1083.  
  1084. var _options = options,
  1085. _options$placement = _options.placement,
  1086. placement = _options$placement === void 0 ? state.placement : _options$placement,
  1087. _options$boundary = _options.boundary,
  1088. boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
  1089. _options$rootBoundary = _options.rootBoundary,
  1090. rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
  1091. _options$elementConte = _options.elementContext,
  1092. elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
  1093. _options$altBoundary = _options.altBoundary,
  1094. altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
  1095. _options$padding = _options.padding,
  1096. padding = _options$padding === void 0 ? 0 : _options$padding;
  1097. var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
  1098. var altContext = elementContext === popper ? reference : popper;
  1099. var referenceElement = state.elements.reference;
  1100. var popperRect = state.rects.popper;
  1101. var element = state.elements[altBoundary ? altContext : elementContext];
  1102. var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
  1103. var referenceClientRect = getBoundingClientRect(referenceElement);
  1104. var popperOffsets = computeOffsets({
  1105. reference: referenceClientRect,
  1106. element: popperRect,
  1107. strategy: 'absolute',
  1108. placement: placement
  1109. });
  1110. var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
  1111. var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
  1112. // 0 or negative = within the clipping rect
  1113.  
  1114. var overflowOffsets = {
  1115. top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
  1116. bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
  1117. left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
  1118. right: elementClientRect.right - clippingClientRect.right + paddingObject.right
  1119. };
  1120. var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
  1121.  
  1122. if (elementContext === popper && offsetData) {
  1123. var offset = offsetData[placement];
  1124. Object.keys(overflowOffsets).forEach(function (key) {
  1125. var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
  1126. var axis = [PRPU_node_modules_popperjs_core_lib_enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
  1127. overflowOffsets[key] += offset[axis] * multiply;
  1128. });
  1129. }
  1130.  
  1131. return overflowOffsets;
  1132. }
  1133. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\computeAutoPlacement.js
  1134.  
  1135.  
  1136.  
  1137.  
  1138. function computeAutoPlacement(state, options) {
  1139. if (options === void 0) {
  1140. options = {};
  1141. }
  1142.  
  1143. var _options = options,
  1144. placement = _options.placement,
  1145. boundary = _options.boundary,
  1146. rootBoundary = _options.rootBoundary,
  1147. padding = _options.padding,
  1148. flipVariations = _options.flipVariations,
  1149. _options$allowedAutoP = _options.allowedAutoPlacements,
  1150. allowedAutoPlacements = _options$allowedAutoP === void 0 ? PRPU_node_modules_popperjs_core_lib_enums_placements : _options$allowedAutoP;
  1151. var variation = getVariation(placement);
  1152. var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
  1153. return getVariation(placement) === variation;
  1154. }) : basePlacements;
  1155. var allowedPlacements = placements.filter(function (placement) {
  1156. return allowedAutoPlacements.indexOf(placement) >= 0;
  1157. });
  1158.  
  1159. if (allowedPlacements.length === 0) {
  1160. allowedPlacements = placements;
  1161.  
  1162. if (false) {}
  1163. } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
  1164.  
  1165.  
  1166. var overflows = allowedPlacements.reduce(function (acc, placement) {
  1167. acc[placement] = detectOverflow(state, {
  1168. placement: placement,
  1169. boundary: boundary,
  1170. rootBoundary: rootBoundary,
  1171. padding: padding
  1172. })[getBasePlacement(placement)];
  1173. return acc;
  1174. }, {});
  1175. return Object.keys(overflows).sort(function (a, b) {
  1176. return overflows[a] - overflows[b];
  1177. });
  1178. }
  1179. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\flip.js
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186. // eslint-disable-next-line import/no-unused-modules
  1187.  
  1188. function getExpandedFallbackPlacements(placement) {
  1189. if (getBasePlacement(placement) === auto) {
  1190. return [];
  1191. }
  1192.  
  1193. var oppositePlacement = getOppositePlacement(placement);
  1194. return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
  1195. }
  1196.  
  1197. function flip(_ref) {
  1198. var state = _ref.state,
  1199. options = _ref.options,
  1200. name = _ref.name;
  1201.  
  1202. if (state.modifiersData[name]._skip) {
  1203. return;
  1204. }
  1205.  
  1206. var _options$mainAxis = options.mainAxis,
  1207. checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
  1208. _options$altAxis = options.altAxis,
  1209. checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
  1210. specifiedFallbackPlacements = options.fallbackPlacements,
  1211. padding = options.padding,
  1212. boundary = options.boundary,
  1213. rootBoundary = options.rootBoundary,
  1214. altBoundary = options.altBoundary,
  1215. _options$flipVariatio = options.flipVariations,
  1216. flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
  1217. allowedAutoPlacements = options.allowedAutoPlacements;
  1218. var preferredPlacement = state.options.placement;
  1219. var basePlacement = getBasePlacement(preferredPlacement);
  1220. var isBasePlacement = basePlacement === preferredPlacement;
  1221. var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
  1222. var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
  1223. return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
  1224. placement: placement,
  1225. boundary: boundary,
  1226. rootBoundary: rootBoundary,
  1227. padding: padding,
  1228. flipVariations: flipVariations,
  1229. allowedAutoPlacements: allowedAutoPlacements
  1230. }) : placement);
  1231. }, []);
  1232. var referenceRect = state.rects.reference;
  1233. var popperRect = state.rects.popper;
  1234. var checksMap = new Map();
  1235. var makeFallbackChecks = true;
  1236. var firstFittingPlacement = placements[0];
  1237.  
  1238. for (var i = 0; i < placements.length; i++) {
  1239. var placement = placements[i];
  1240.  
  1241. var _basePlacement = getBasePlacement(placement);
  1242.  
  1243. var isStartVariation = getVariation(placement) === start;
  1244. var isVertical = [PRPU_node_modules_popperjs_core_lib_enums_top, bottom].indexOf(_basePlacement) >= 0;
  1245. var len = isVertical ? 'width' : 'height';
  1246. var overflow = detectOverflow(state, {
  1247. placement: placement,
  1248. boundary: boundary,
  1249. rootBoundary: rootBoundary,
  1250. altBoundary: altBoundary,
  1251. padding: padding
  1252. });
  1253. var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : PRPU_node_modules_popperjs_core_lib_enums_top;
  1254.  
  1255. if (referenceRect[len] > popperRect[len]) {
  1256. mainVariationSide = getOppositePlacement(mainVariationSide);
  1257. }
  1258.  
  1259. var altVariationSide = getOppositePlacement(mainVariationSide);
  1260. var checks = [];
  1261.  
  1262. if (checkMainAxis) {
  1263. checks.push(overflow[_basePlacement] <= 0);
  1264. }
  1265.  
  1266. if (checkAltAxis) {
  1267. checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
  1268. }
  1269.  
  1270. if (checks.every(function (check) {
  1271. return check;
  1272. })) {
  1273. firstFittingPlacement = placement;
  1274. makeFallbackChecks = false;
  1275. break;
  1276. }
  1277.  
  1278. checksMap.set(placement, checks);
  1279. }
  1280.  
  1281. if (makeFallbackChecks) {
  1282. // `2` may be desired in some cases – research later
  1283. var numberOfChecks = flipVariations ? 3 : 1;
  1284.  
  1285. var _loop = function _loop(_i) {
  1286. var fittingPlacement = placements.find(function (placement) {
  1287. var checks = checksMap.get(placement);
  1288.  
  1289. if (checks) {
  1290. return checks.slice(0, _i).every(function (check) {
  1291. return check;
  1292. });
  1293. }
  1294. });
  1295.  
  1296. if (fittingPlacement) {
  1297. firstFittingPlacement = fittingPlacement;
  1298. return "break";
  1299. }
  1300. };
  1301.  
  1302. for (var _i = numberOfChecks; _i > 0; _i--) {
  1303. var _ret = _loop(_i);
  1304.  
  1305. if (_ret === "break") break;
  1306. }
  1307. }
  1308.  
  1309. if (state.placement !== firstFittingPlacement) {
  1310. state.modifiersData[name]._skip = true;
  1311. state.placement = firstFittingPlacement;
  1312. state.reset = true;
  1313. }
  1314. } // eslint-disable-next-line import/no-unused-modules
  1315.  
  1316.  
  1317. /* harmony default export */ const PRPU_node_modules_popperjs_core_lib_modifiers_flip = ({
  1318. name: 'flip',
  1319. enabled: true,
  1320. phase: 'main',
  1321. fn: flip,
  1322. requiresIfExists: ['offset'],
  1323. data: {
  1324. _skip: false
  1325. }
  1326. });
  1327. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\hide.js
  1328.  
  1329.  
  1330.  
  1331. function getSideOffsets(overflow, rect, preventedOffsets) {
  1332. if (preventedOffsets === void 0) {
  1333. preventedOffsets = {
  1334. x: 0,
  1335. y: 0
  1336. };
  1337. }
  1338.  
  1339. return {
  1340. top: overflow.top - rect.height - preventedOffsets.y,
  1341. right: overflow.right - rect.width + preventedOffsets.x,
  1342. bottom: overflow.bottom - rect.height + preventedOffsets.y,
  1343. left: overflow.left - rect.width - preventedOffsets.x
  1344. };
  1345. }
  1346.  
  1347. function isAnySideFullyClipped(overflow) {
  1348. return [PRPU_node_modules_popperjs_core_lib_enums_top, right, bottom, left].some(function (side) {
  1349. return overflow[side] >= 0;
  1350. });
  1351. }
  1352.  
  1353. function hide(_ref) {
  1354. var state = _ref.state,
  1355. name = _ref.name;
  1356. var referenceRect = state.rects.reference;
  1357. var popperRect = state.rects.popper;
  1358. var preventedOffsets = state.modifiersData.preventOverflow;
  1359. var referenceOverflow = detectOverflow(state, {
  1360. elementContext: 'reference'
  1361. });
  1362. var popperAltOverflow = detectOverflow(state, {
  1363. altBoundary: true
  1364. });
  1365. var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
  1366. var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
  1367. var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
  1368. var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
  1369. state.modifiersData[name] = {
  1370. referenceClippingOffsets: referenceClippingOffsets,
  1371. popperEscapeOffsets: popperEscapeOffsets,
  1372. isReferenceHidden: isReferenceHidden,
  1373. hasPopperEscaped: hasPopperEscaped
  1374. };
  1375. state.attributes.popper = Object.assign({}, state.attributes.popper, {
  1376. 'data-popper-reference-hidden': isReferenceHidden,
  1377. 'data-popper-escaped': hasPopperEscaped
  1378. });
  1379. } // eslint-disable-next-line import/no-unused-modules
  1380.  
  1381.  
  1382. /* harmony default export */ const PRPU_node_modules_popperjs_core_lib_modifiers_hide = ({
  1383. name: 'hide',
  1384. enabled: true,
  1385. phase: 'main',
  1386. requiresIfExists: ['preventOverflow'],
  1387. fn: hide
  1388. });
  1389. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\offset.js
  1390.  
  1391.  
  1392. function distanceAndSkiddingToXY(placement, rects, offset) {
  1393. var basePlacement = getBasePlacement(placement);
  1394. var invertDistance = [left, PRPU_node_modules_popperjs_core_lib_enums_top].indexOf(basePlacement) >= 0 ? -1 : 1;
  1395.  
  1396. var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
  1397. placement: placement
  1398. })) : offset,
  1399. skidding = _ref[0],
  1400. distance = _ref[1];
  1401.  
  1402. skidding = skidding || 0;
  1403. distance = (distance || 0) * invertDistance;
  1404. return [left, right].indexOf(basePlacement) >= 0 ? {
  1405. x: distance,
  1406. y: skidding
  1407. } : {
  1408. x: skidding,
  1409. y: distance
  1410. };
  1411. }
  1412.  
  1413. function offset(_ref2) {
  1414. var state = _ref2.state,
  1415. options = _ref2.options,
  1416. name = _ref2.name;
  1417. var _options$offset = options.offset,
  1418. offset = _options$offset === void 0 ? [0, 0] : _options$offset;
  1419. var data = PRPU_node_modules_popperjs_core_lib_enums_placements.reduce(function (acc, placement) {
  1420. acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
  1421. return acc;
  1422. }, {});
  1423. var _data$state$placement = data[state.placement],
  1424. x = _data$state$placement.x,
  1425. y = _data$state$placement.y;
  1426.  
  1427. if (state.modifiersData.popperOffsets != null) {
  1428. state.modifiersData.popperOffsets.x += x;
  1429. state.modifiersData.popperOffsets.y += y;
  1430. }
  1431.  
  1432. state.modifiersData[name] = data;
  1433. } // eslint-disable-next-line import/no-unused-modules
  1434.  
  1435.  
  1436. /* harmony default export */ const PRPU_node_modules_popperjs_core_lib_modifiers_offset = ({
  1437. name: 'offset',
  1438. enabled: true,
  1439. phase: 'main',
  1440. requires: ['popperOffsets'],
  1441. fn: offset
  1442. });
  1443. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\popperOffsets.js
  1444.  
  1445.  
  1446. function popperOffsets(_ref) {
  1447. var state = _ref.state,
  1448. name = _ref.name;
  1449. // Offsets are the actual position the popper needs to have to be
  1450. // properly positioned near its reference element
  1451. // This is the most basic placement, and will be adjusted by
  1452. // the modifiers in the next step
  1453. state.modifiersData[name] = computeOffsets({
  1454. reference: state.rects.reference,
  1455. element: state.rects.popper,
  1456. strategy: 'absolute',
  1457. placement: state.placement
  1458. });
  1459. } // eslint-disable-next-line import/no-unused-modules
  1460.  
  1461.  
  1462. /* harmony default export */ const PRPU_node_modules_popperjs_core_lib_modifiers_popperOffsets = ({
  1463. name: 'popperOffsets',
  1464. enabled: true,
  1465. phase: 'read',
  1466. fn: popperOffsets,
  1467. data: {}
  1468. });
  1469. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\getAltAxis.js
  1470. function getAltAxis(axis) {
  1471. return axis === 'x' ? 'y' : 'x';
  1472. }
  1473. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\preventOverflow.js
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486. function preventOverflow(_ref) {
  1487. var state = _ref.state,
  1488. options = _ref.options,
  1489. name = _ref.name;
  1490. var _options$mainAxis = options.mainAxis,
  1491. checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
  1492. _options$altAxis = options.altAxis,
  1493. checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
  1494. boundary = options.boundary,
  1495. rootBoundary = options.rootBoundary,
  1496. altBoundary = options.altBoundary,
  1497. padding = options.padding,
  1498. _options$tether = options.tether,
  1499. tether = _options$tether === void 0 ? true : _options$tether,
  1500. _options$tetherOffset = options.tetherOffset,
  1501. tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
  1502. var overflow = detectOverflow(state, {
  1503. boundary: boundary,
  1504. rootBoundary: rootBoundary,
  1505. padding: padding,
  1506. altBoundary: altBoundary
  1507. });
  1508. var basePlacement = getBasePlacement(state.placement);
  1509. var variation = getVariation(state.placement);
  1510. var isBasePlacement = !variation;
  1511. var mainAxis = getMainAxisFromPlacement(basePlacement);
  1512. var altAxis = getAltAxis(mainAxis);
  1513. var popperOffsets = state.modifiersData.popperOffsets;
  1514. var referenceRect = state.rects.reference;
  1515. var popperRect = state.rects.popper;
  1516. var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
  1517. placement: state.placement
  1518. })) : tetherOffset;
  1519. var data = {
  1520. x: 0,
  1521. y: 0
  1522. };
  1523.  
  1524. if (!popperOffsets) {
  1525. return;
  1526. }
  1527.  
  1528. if (checkMainAxis || checkAltAxis) {
  1529. var mainSide = mainAxis === 'y' ? PRPU_node_modules_popperjs_core_lib_enums_top : left;
  1530. var altSide = mainAxis === 'y' ? bottom : right;
  1531. var len = mainAxis === 'y' ? 'height' : 'width';
  1532. var offset = popperOffsets[mainAxis];
  1533. var min = popperOffsets[mainAxis] + overflow[mainSide];
  1534. var max = popperOffsets[mainAxis] - overflow[altSide];
  1535. var additive = tether ? -popperRect[len] / 2 : 0;
  1536. var minLen = variation === start ? referenceRect[len] : popperRect[len];
  1537. var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
  1538. // outside the reference bounds
  1539.  
  1540. var arrowElement = state.elements.arrow;
  1541. var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
  1542. width: 0,
  1543. height: 0
  1544. };
  1545. var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
  1546. var arrowPaddingMin = arrowPaddingObject[mainSide];
  1547. var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
  1548. // to include its full size in the calculation. If the reference is small
  1549. // and near the edge of a boundary, the popper can overflow even if the
  1550. // reference is not overflowing as well (e.g. virtual elements with no
  1551. // width or height)
  1552.  
  1553. var arrowLen = within(0, referenceRect[len], arrowRect[len]);
  1554. var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
  1555. var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
  1556. var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
  1557. var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
  1558. var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
  1559. var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
  1560. var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
  1561.  
  1562. if (checkMainAxis) {
  1563. var preventedOffset = within(tether ? PRPU_node_modules_popperjs_core_lib_utils_math_min(min, tetherMin) : min, offset, tether ? PRPU_node_modules_popperjs_core_lib_utils_math_max(max, tetherMax) : max);
  1564. popperOffsets[mainAxis] = preventedOffset;
  1565. data[mainAxis] = preventedOffset - offset;
  1566. }
  1567.  
  1568. if (checkAltAxis) {
  1569. var _mainSide = mainAxis === 'x' ? PRPU_node_modules_popperjs_core_lib_enums_top : left;
  1570.  
  1571. var _altSide = mainAxis === 'x' ? bottom : right;
  1572.  
  1573. var _offset = popperOffsets[altAxis];
  1574.  
  1575. var _min = _offset + overflow[_mainSide];
  1576.  
  1577. var _max = _offset - overflow[_altSide];
  1578.  
  1579. var _preventedOffset = within(tether ? PRPU_node_modules_popperjs_core_lib_utils_math_min(_min, tetherMin) : _min, _offset, tether ? PRPU_node_modules_popperjs_core_lib_utils_math_max(_max, tetherMax) : _max);
  1580.  
  1581. popperOffsets[altAxis] = _preventedOffset;
  1582. data[altAxis] = _preventedOffset - _offset;
  1583. }
  1584. }
  1585.  
  1586. state.modifiersData[name] = data;
  1587. } // eslint-disable-next-line import/no-unused-modules
  1588.  
  1589.  
  1590. /* harmony default export */ const PRPU_node_modules_popperjs_core_lib_modifiers_preventOverflow = ({
  1591. name: 'preventOverflow',
  1592. enabled: true,
  1593. phase: 'main',
  1594. fn: preventOverflow,
  1595. requiresIfExists: ['offset']
  1596. });
  1597. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\modifiers\index.js
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getHTMLElementScroll.js
  1608. function getHTMLElementScroll(element) {
  1609. return {
  1610. scrollLeft: element.scrollLeft,
  1611. scrollTop: element.scrollTop
  1612. };
  1613. }
  1614. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getNodeScroll.js
  1615.  
  1616.  
  1617.  
  1618.  
  1619. function getNodeScroll(node) {
  1620. if (node === getWindow(node) || !isHTMLElement(node)) {
  1621. return getWindowScroll(node);
  1622. } else {
  1623. return getHTMLElementScroll(node);
  1624. }
  1625. }
  1626. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\dom-utils\getCompositeRect.js
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633. // Returns the composite rect of an element relative to its offsetParent.
  1634. // Composite means it takes into account transforms as well as layout.
  1635.  
  1636. function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
  1637. if (isFixed === void 0) {
  1638. isFixed = false;
  1639. }
  1640.  
  1641. var documentElement = getDocumentElement(offsetParent);
  1642. var rect = getBoundingClientRect(elementOrVirtualElement);
  1643. var isOffsetParentAnElement = isHTMLElement(offsetParent);
  1644. var scroll = {
  1645. scrollLeft: 0,
  1646. scrollTop: 0
  1647. };
  1648. var offsets = {
  1649. x: 0,
  1650. y: 0
  1651. };
  1652.  
  1653. if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
  1654. if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
  1655. isScrollParent(documentElement)) {
  1656. scroll = getNodeScroll(offsetParent);
  1657. }
  1658.  
  1659. if (isHTMLElement(offsetParent)) {
  1660. offsets = getBoundingClientRect(offsetParent);
  1661. offsets.x += offsetParent.clientLeft;
  1662. offsets.y += offsetParent.clientTop;
  1663. } else if (documentElement) {
  1664. offsets.x = getWindowScrollBarX(documentElement);
  1665. }
  1666. }
  1667.  
  1668. return {
  1669. x: rect.left + scroll.scrollLeft - offsets.x,
  1670. y: rect.top + scroll.scrollTop - offsets.y,
  1671. width: rect.width,
  1672. height: rect.height
  1673. };
  1674. }
  1675. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\orderModifiers.js
  1676. // source: https://stackoverflow.com/questions/49875255
  1677.  
  1678. function order(modifiers) {
  1679. var map = new Map();
  1680. var visited = new Set();
  1681. var result = [];
  1682. modifiers.forEach(function (modifier) {
  1683. map.set(modifier.name, modifier);
  1684. }); // On visiting object, check for its dependencies and visit them recursively
  1685.  
  1686. function sort(modifier) {
  1687. visited.add(modifier.name);
  1688. var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
  1689. requires.forEach(function (dep) {
  1690. if (!visited.has(dep)) {
  1691. var depModifier = map.get(dep);
  1692.  
  1693. if (depModifier) {
  1694. sort(depModifier);
  1695. }
  1696. }
  1697. });
  1698. result.push(modifier);
  1699. }
  1700.  
  1701. modifiers.forEach(function (modifier) {
  1702. if (!visited.has(modifier.name)) {
  1703. // check for visited object
  1704. sort(modifier);
  1705. }
  1706. });
  1707. return result;
  1708. }
  1709.  
  1710. function orderModifiers(modifiers) {
  1711. // order based on dependencies
  1712. var orderedModifiers = order(modifiers); // order based on phase
  1713.  
  1714. return modifierPhases.reduce(function (acc, phase) {
  1715. return acc.concat(orderedModifiers.filter(function (modifier) {
  1716. return modifier.phase === phase;
  1717. }));
  1718. }, []);
  1719. }
  1720. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\debounce.js
  1721. function debounce(fn) {
  1722. var pending;
  1723. return function () {
  1724. if (!pending) {
  1725. pending = new Promise(function (resolve) {
  1726. Promise.resolve().then(function () {
  1727. pending = undefined;
  1728. resolve(fn());
  1729. });
  1730. });
  1731. }
  1732.  
  1733. return pending;
  1734. };
  1735. }
  1736. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\utils\mergeByName.js
  1737. function mergeByName(modifiers) {
  1738. var merged = modifiers.reduce(function (merged, current) {
  1739. var existing = merged[current.name];
  1740. merged[current.name] = existing ? Object.assign({}, existing, current, {
  1741. options: Object.assign({}, existing.options, current.options),
  1742. data: Object.assign({}, existing.data, current.data)
  1743. }) : current;
  1744. return merged;
  1745. }, {}); // IE11 does not support Object.values
  1746.  
  1747. return Object.keys(merged).map(function (key) {
  1748. return merged[key];
  1749. });
  1750. }
  1751. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\createPopper.js
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766. var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
  1767. 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.';
  1768. var DEFAULT_OPTIONS = {
  1769. placement: 'bottom',
  1770. modifiers: [],
  1771. strategy: 'absolute'
  1772. };
  1773.  
  1774. function areValidElements() {
  1775. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  1776. args[_key] = arguments[_key];
  1777. }
  1778.  
  1779. return !args.some(function (element) {
  1780. return !(element && typeof element.getBoundingClientRect === 'function');
  1781. });
  1782. }
  1783.  
  1784. function popperGenerator(generatorOptions) {
  1785. if (generatorOptions === void 0) {
  1786. generatorOptions = {};
  1787. }
  1788.  
  1789. var _generatorOptions = generatorOptions,
  1790. _generatorOptions$def = _generatorOptions.defaultModifiers,
  1791. defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
  1792. _generatorOptions$def2 = _generatorOptions.defaultOptions,
  1793. defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
  1794. return function createPopper(reference, popper, options) {
  1795. if (options === void 0) {
  1796. options = defaultOptions;
  1797. }
  1798.  
  1799. var state = {
  1800. placement: 'bottom',
  1801. orderedModifiers: [],
  1802. options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
  1803. modifiersData: {},
  1804. elements: {
  1805. reference: reference,
  1806. popper: popper
  1807. },
  1808. attributes: {},
  1809. styles: {}
  1810. };
  1811. var effectCleanupFns = [];
  1812. var isDestroyed = false;
  1813. var instance = {
  1814. state: state,
  1815. setOptions: function setOptions(options) {
  1816. cleanupModifierEffects();
  1817. state.options = Object.assign({}, defaultOptions, state.options, options);
  1818. state.scrollParents = {
  1819. reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
  1820. popper: listScrollParents(popper)
  1821. }; // Orders the modifiers based on their dependencies and `phase`
  1822. // properties
  1823.  
  1824. var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
  1825.  
  1826. state.orderedModifiers = orderedModifiers.filter(function (m) {
  1827. return m.enabled;
  1828. }); // Validate the provided modifiers so that the consumer will get warned
  1829. // if one of the modifiers is invalid for any reason
  1830.  
  1831. if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; }
  1832.  
  1833. runModifierEffects();
  1834. return instance.update();
  1835. },
  1836. // Sync update – it will always be executed, even if not necessary. This
  1837. // is useful for low frequency updates where sync behavior simplifies the
  1838. // logic.
  1839. // For high frequency updates (e.g. `resize` and `scroll` events), always
  1840. // prefer the async Popper#update method
  1841. forceUpdate: function forceUpdate() {
  1842. if (isDestroyed) {
  1843. return;
  1844. }
  1845.  
  1846. var _state$elements = state.elements,
  1847. reference = _state$elements.reference,
  1848. popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
  1849. // anymore
  1850.  
  1851. if (!areValidElements(reference, popper)) {
  1852. if (false) {}
  1853.  
  1854. return;
  1855. } // Store the reference and popper rects to be read by modifiers
  1856.  
  1857.  
  1858. state.rects = {
  1859. reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
  1860. popper: getLayoutRect(popper)
  1861. }; // Modifiers have the ability to reset the current update cycle. The
  1862. // most common use case for this is the `flip` modifier changing the
  1863. // placement, which then needs to re-run all the modifiers, because the
  1864. // logic was previously ran for the previous placement and is therefore
  1865. // stale/incorrect
  1866.  
  1867. state.reset = false;
  1868. state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
  1869. // is filled with the initial data specified by the modifier. This means
  1870. // it doesn't persist and is fresh on each update.
  1871. // To ensure persistent data, use `${name}#persistent`
  1872.  
  1873. state.orderedModifiers.forEach(function (modifier) {
  1874. return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
  1875. });
  1876. var __debug_loops__ = 0;
  1877.  
  1878. for (var index = 0; index < state.orderedModifiers.length; index++) {
  1879. if (false) {}
  1880.  
  1881. if (state.reset === true) {
  1882. state.reset = false;
  1883. index = -1;
  1884. continue;
  1885. }
  1886.  
  1887. var _state$orderedModifie = state.orderedModifiers[index],
  1888. fn = _state$orderedModifie.fn,
  1889. _state$orderedModifie2 = _state$orderedModifie.options,
  1890. _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
  1891. name = _state$orderedModifie.name;
  1892.  
  1893. if (typeof fn === 'function') {
  1894. state = fn({
  1895. state: state,
  1896. options: _options,
  1897. name: name,
  1898. instance: instance
  1899. }) || state;
  1900. }
  1901. }
  1902. },
  1903. // Async and optimistically optimized update – it will not be executed if
  1904. // not necessary (debounced to run at most once-per-tick)
  1905. update: debounce(function () {
  1906. return new Promise(function (resolve) {
  1907. instance.forceUpdate();
  1908. resolve(state);
  1909. });
  1910. }),
  1911. destroy: function destroy() {
  1912. cleanupModifierEffects();
  1913. isDestroyed = true;
  1914. }
  1915. };
  1916.  
  1917. if (!areValidElements(reference, popper)) {
  1918. if (false) {}
  1919.  
  1920. return instance;
  1921. }
  1922.  
  1923. instance.setOptions(options).then(function (state) {
  1924. if (!isDestroyed && options.onFirstUpdate) {
  1925. options.onFirstUpdate(state);
  1926. }
  1927. }); // Modifiers have the ability to execute arbitrary code before the first
  1928. // update cycle runs. They will be executed in the same order as the update
  1929. // cycle. This is useful when a modifier adds some persistent data that
  1930. // other modifiers need to use, but the modifier is run after the dependent
  1931. // one.
  1932.  
  1933. function runModifierEffects() {
  1934. state.orderedModifiers.forEach(function (_ref3) {
  1935. var name = _ref3.name,
  1936. _ref3$options = _ref3.options,
  1937. options = _ref3$options === void 0 ? {} : _ref3$options,
  1938. effect = _ref3.effect;
  1939.  
  1940. if (typeof effect === 'function') {
  1941. var cleanupFn = effect({
  1942. state: state,
  1943. name: name,
  1944. instance: instance,
  1945. options: options
  1946. });
  1947.  
  1948. var noopFn = function noopFn() {};
  1949.  
  1950. effectCleanupFns.push(cleanupFn || noopFn);
  1951. }
  1952. });
  1953. }
  1954.  
  1955. function cleanupModifierEffects() {
  1956. effectCleanupFns.forEach(function (fn) {
  1957. return fn();
  1958. });
  1959. effectCleanupFns = [];
  1960. }
  1961.  
  1962. return instance;
  1963. };
  1964. }
  1965. var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
  1966.  
  1967.  
  1968. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\popper.js
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979. var defaultModifiers = [PRPU_node_modules_popperjs_core_lib_modifiers_eventListeners, PRPU_node_modules_popperjs_core_lib_modifiers_popperOffsets, PRPU_node_modules_popperjs_core_lib_modifiers_computeStyles, PRPU_node_modules_popperjs_core_lib_modifiers_applyStyles, PRPU_node_modules_popperjs_core_lib_modifiers_offset, PRPU_node_modules_popperjs_core_lib_modifiers_flip, PRPU_node_modules_popperjs_core_lib_modifiers_preventOverflow, PRPU_node_modules_popperjs_core_lib_modifiers_arrow, PRPU_node_modules_popperjs_core_lib_modifiers_hide];
  1980. var PRPU_node_modules_popperjs_core_lib_popper_createPopper = /*#__PURE__*/popperGenerator({
  1981. defaultModifiers: defaultModifiers
  1982. }); // eslint-disable-next-line import/no-unused-modules
  1983.  
  1984. // eslint-disable-next-line import/no-unused-modules
  1985.  
  1986. // eslint-disable-next-line import/no-unused-modules
  1987.  
  1988.  
  1989. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\popper-lite.js
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995. var PRPU_node_modules_popperjs_core_lib_popper_lite_defaultModifiers = [PRPU_node_modules_popperjs_core_lib_modifiers_eventListeners, PRPU_node_modules_popperjs_core_lib_modifiers_popperOffsets, PRPU_node_modules_popperjs_core_lib_modifiers_computeStyles, PRPU_node_modules_popperjs_core_lib_modifiers_applyStyles];
  1996. var PRPU_node_modules_popperjs_core_lib_popper_lite_createPopper = /*#__PURE__*/popperGenerator({
  1997. defaultModifiers: PRPU_node_modules_popperjs_core_lib_popper_lite_defaultModifiers
  1998. }); // eslint-disable-next-line import/no-unused-modules
  1999.  
  2000.  
  2001. ;// CONCATENATED MODULE: PRPS\node_modules\@popperjs\core\lib\index.js
  2002.  
  2003. // eslint-disable-next-line import/no-unused-modules
  2004.  
  2005. // eslint-disable-next-line import/no-unused-modules
  2006.  
  2007. // eslint-disable-next-line import/no-unused-modules
  2008.  
  2009.  
  2010.  
  2011. /***/ }),
  2012.  
  2013. /***/ 856:
  2014. /***/ ((module) => {
  2015.  
  2016. "use strict";
  2017. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-arrow-return-left\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M14.5 1.5a.5.5 0 0 1 .5.5v4.8a2.5 2.5 0 0 1-2.5 2.5H2.707l3.347 3.346a.5.5 0 0 1-.708.708l-4.2-4.2a.5.5 0 0 1 0-.708l4-4a.5.5 0 1 1 .708.708L2.707 8.3H12.5A1.5 1.5 0 0 0 14 6.8V2a.5.5 0 0 1 .5-.5z\"/>\n</svg>";
  2018.  
  2019. /***/ }),
  2020.  
  2021. /***/ 376:
  2022. /***/ ((module) => {
  2023.  
  2024. "use strict";
  2025. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-code-slash\" viewBox=\"0 0 16 16\">\n <path d=\"M10.478 1.647a.5.5 0 1 0-.956-.294l-4 13a.5.5 0 0 0 .956.294l4-13zM4.854 4.146a.5.5 0 0 1 0 .708L1.707 8l3.147 3.146a.5.5 0 0 1-.708.708l-3.5-3.5a.5.5 0 0 1 0-.708l3.5-3.5a.5.5 0 0 1 .708 0zm6.292 0a.5.5 0 0 0 0 .708L14.293 8l-3.147 3.146a.5.5 0 0 0 .708.708l3.5-3.5a.5.5 0 0 0 0-.708l-3.5-3.5a.5.5 0 0 0-.708 0z\"/>\n</svg>";
  2026.  
  2027. /***/ }),
  2028.  
  2029. /***/ 154:
  2030. /***/ ((module) => {
  2031.  
  2032. "use strict";
  2033. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-file-earmark-pdf\" viewBox=\"0 0 16 16\">\n <path d=\"M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z\"/>\n <path d=\"M4.603 14.087a.81.81 0 0 1-.438-.42c-.195-.388-.13-.776.08-1.102.198-.307.526-.568.897-.787a7.68 7.68 0 0 1 1.482-.645 19.697 19.697 0 0 0 1.062-2.227 7.269 7.269 0 0 1-.43-1.295c-.086-.4-.119-.796-.046-1.136.075-.354.274-.672.65-.823.192-.077.4-.12.602-.077a.7.7 0 0 1 .477.365c.088.164.12.356.127.538.007.188-.012.396-.047.614-.084.51-.27 1.134-.52 1.794a10.954 10.954 0 0 0 .98 1.686 5.753 5.753 0 0 1 1.334.05c.364.066.734.195.96.465.12.144.193.32.2.518.007.192-.047.382-.138.563a1.04 1.04 0 0 1-.354.416.856.856 0 0 1-.51.138c-.331-.014-.654-.196-.933-.417a5.712 5.712 0 0 1-.911-.95 11.651 11.651 0 0 0-1.997.406 11.307 11.307 0 0 1-1.02 1.51c-.292.35-.609.656-.927.787a.793.793 0 0 1-.58.029zm1.379-1.901c-.166.076-.32.156-.459.238-.328.194-.541.383-.647.547-.094.145-.096.25-.04.361.01.022.02.036.026.044a.266.266 0 0 0 .035-.012c.137-.056.355-.235.635-.572a8.18 8.18 0 0 0 .45-.606zm1.64-1.33a12.71 12.71 0 0 1 1.01-.193 11.744 11.744 0 0 1-.51-.858 20.801 20.801 0 0 1-.5 1.05zm2.446.45c.15.163.296.3.435.41.24.19.407.253.498.256a.107.107 0 0 0 .07-.015.307.307 0 0 0 .094-.125.436.436 0 0 0 .059-.2.095.095 0 0 0-.026-.063c-.052-.062-.2-.152-.518-.209a3.876 3.876 0 0 0-.612-.053zM8.078 7.8a6.7 6.7 0 0 0 .2-.828c.031-.188.043-.343.038-.465a.613.613 0 0 0-.032-.198.517.517 0 0 0-.145.04c-.087.035-.158.106-.196.283-.04.192-.03.469.046.822.024.111.054.227.09.346z\"/>\n</svg>";
  2034.  
  2035. /***/ }),
  2036.  
  2037. /***/ 984:
  2038. /***/ ((module) => {
  2039.  
  2040. "use strict";
  2041. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-gear-fill\" viewBox=\"0 0 16 16\">\n <path d=\"M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z\"/>\n</svg>";
  2042.  
  2043. /***/ }),
  2044.  
  2045. /***/ 739:
  2046. /***/ ((module) => {
  2047.  
  2048. "use strict";
  2049. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-github\" viewBox=\"0 0 16 16\">\n <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z\"/>\n</svg>";
  2050.  
  2051. /***/ }),
  2052.  
  2053. /***/ 185:
  2054. /***/ ((module) => {
  2055.  
  2056. "use strict";
  2057. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-house\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M2 13.5V7h1v6.5a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5V7h1v6.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5zm11-11V6l-2-2V2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z\"/>\n <path fill-rule=\"evenodd\" d=\"M7.293 1.5a1 1 0 0 1 1.414 0l6.647 6.646a.5.5 0 0 1-.708.708L8 2.207 1.354 8.854a.5.5 0 1 1-.708-.708L7.293 1.5z\"/>\n</svg>";
  2058.  
  2059. /***/ }),
  2060.  
  2061. /***/ 762:
  2062. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  2063.  
  2064. /*!
  2065. * Bootstrap base-component.js v5.0.2 (https://getbootstrap.com/)
  2066. * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  2067. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2068. */
  2069. (function (global, factory) {
  2070. true ? module.exports = factory(__webpack_require__(252), __webpack_require__(983), __webpack_require__(955)) :
  2071. 0;
  2072. }(this, (function (Data, SelectorEngine, EventHandler) { 'use strict';
  2073.  
  2074. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  2075.  
  2076. var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
  2077. var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
  2078. var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
  2079.  
  2080. const MILLISECONDS_MULTIPLIER = 1000;
  2081. const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  2082.  
  2083. const getTransitionDurationFromElement = element => {
  2084. if (!element) {
  2085. return 0;
  2086. } // Get transition-duration of the element
  2087.  
  2088.  
  2089. let {
  2090. transitionDuration,
  2091. transitionDelay
  2092. } = window.getComputedStyle(element);
  2093. const floatTransitionDuration = Number.parseFloat(transitionDuration);
  2094. const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  2095.  
  2096. if (!floatTransitionDuration && !floatTransitionDelay) {
  2097. return 0;
  2098. } // If multiple durations are defined, take the first
  2099.  
  2100.  
  2101. transitionDuration = transitionDuration.split(',')[0];
  2102. transitionDelay = transitionDelay.split(',')[0];
  2103. return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  2104. };
  2105.  
  2106. const triggerTransitionEnd = element => {
  2107. element.dispatchEvent(new Event(TRANSITION_END));
  2108. };
  2109.  
  2110. const isElement = obj => {
  2111. if (!obj || typeof obj !== 'object') {
  2112. return false;
  2113. }
  2114.  
  2115. if (typeof obj.jquery !== 'undefined') {
  2116. obj = obj[0];
  2117. }
  2118.  
  2119. return typeof obj.nodeType !== 'undefined';
  2120. };
  2121.  
  2122. const getElement = obj => {
  2123. if (isElement(obj)) {
  2124. // it's a jQuery object or a node element
  2125. return obj.jquery ? obj[0] : obj;
  2126. }
  2127.  
  2128. if (typeof obj === 'string' && obj.length > 0) {
  2129. return SelectorEngine__default['default'].findOne(obj);
  2130. }
  2131.  
  2132. return null;
  2133. };
  2134.  
  2135. const execute = callback => {
  2136. if (typeof callback === 'function') {
  2137. callback();
  2138. }
  2139. };
  2140.  
  2141. const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
  2142. if (!waitForTransition) {
  2143. execute(callback);
  2144. return;
  2145. }
  2146.  
  2147. const durationPadding = 5;
  2148. const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
  2149. let called = false;
  2150.  
  2151. const handler = ({
  2152. target
  2153. }) => {
  2154. if (target !== transitionElement) {
  2155. return;
  2156. }
  2157.  
  2158. called = true;
  2159. transitionElement.removeEventListener(TRANSITION_END, handler);
  2160. execute(callback);
  2161. };
  2162.  
  2163. transitionElement.addEventListener(TRANSITION_END, handler);
  2164. setTimeout(() => {
  2165. if (!called) {
  2166. triggerTransitionEnd(transitionElement);
  2167. }
  2168. }, emulatedDuration);
  2169. };
  2170.  
  2171. /**
  2172. * --------------------------------------------------------------------------
  2173. * Bootstrap (v5.0.2): base-component.js
  2174. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2175. * --------------------------------------------------------------------------
  2176. */
  2177. /**
  2178. * ------------------------------------------------------------------------
  2179. * Constants
  2180. * ------------------------------------------------------------------------
  2181. */
  2182.  
  2183. const VERSION = '5.0.2';
  2184.  
  2185. class BaseComponent {
  2186. constructor(element) {
  2187. element = getElement(element);
  2188.  
  2189. if (!element) {
  2190. return;
  2191. }
  2192.  
  2193. this._element = element;
  2194. Data__default['default'].set(this._element, this.constructor.DATA_KEY, this);
  2195. }
  2196.  
  2197. dispose() {
  2198. Data__default['default'].remove(this._element, this.constructor.DATA_KEY);
  2199. EventHandler__default['default'].off(this._element, this.constructor.EVENT_KEY);
  2200. Object.getOwnPropertyNames(this).forEach(propertyName => {
  2201. this[propertyName] = null;
  2202. });
  2203. }
  2204.  
  2205. _queueCallback(callback, element, isAnimated = true) {
  2206. executeAfterTransition(callback, element, isAnimated);
  2207. }
  2208. /** Static */
  2209.  
  2210.  
  2211. static getInstance(element) {
  2212. return Data__default['default'].get(element, this.DATA_KEY);
  2213. }
  2214.  
  2215. static getOrCreateInstance(element, config = {}) {
  2216. return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
  2217. }
  2218.  
  2219. static get VERSION() {
  2220. return VERSION;
  2221. }
  2222.  
  2223. static get NAME() {
  2224. throw new Error('You have to implement the static method "NAME", for each component!');
  2225. }
  2226.  
  2227. static get DATA_KEY() {
  2228. return `bs.${this.NAME}`;
  2229. }
  2230.  
  2231. static get EVENT_KEY() {
  2232. return `.${this.DATA_KEY}`;
  2233. }
  2234.  
  2235. }
  2236.  
  2237. return BaseComponent;
  2238.  
  2239. })));
  2240. //# sourceMappingURL=base-component.js.map
  2241.  
  2242.  
  2243. /***/ }),
  2244.  
  2245. /***/ 252:
  2246. /***/ (function(module) {
  2247.  
  2248. /*!
  2249. * Bootstrap data.js v5.0.2 (https://getbootstrap.com/)
  2250. * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  2251. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2252. */
  2253. (function (global, factory) {
  2254. true ? module.exports = factory() :
  2255. 0;
  2256. }(this, (function () { 'use strict';
  2257.  
  2258. /**
  2259. * --------------------------------------------------------------------------
  2260. * Bootstrap (v5.0.2): dom/data.js
  2261. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2262. * --------------------------------------------------------------------------
  2263. */
  2264.  
  2265. /**
  2266. * ------------------------------------------------------------------------
  2267. * Constants
  2268. * ------------------------------------------------------------------------
  2269. */
  2270. const elementMap = new Map();
  2271. var data = {
  2272. set(element, key, instance) {
  2273. if (!elementMap.has(element)) {
  2274. elementMap.set(element, new Map());
  2275. }
  2276.  
  2277. const instanceMap = elementMap.get(element); // make it clear we only want one instance per element
  2278. // can be removed later when multiple key/instances are fine to be used
  2279.  
  2280. if (!instanceMap.has(key) && instanceMap.size !== 0) {
  2281. // eslint-disable-next-line no-console
  2282. console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
  2283. return;
  2284. }
  2285.  
  2286. instanceMap.set(key, instance);
  2287. },
  2288.  
  2289. get(element, key) {
  2290. if (elementMap.has(element)) {
  2291. return elementMap.get(element).get(key) || null;
  2292. }
  2293.  
  2294. return null;
  2295. },
  2296.  
  2297. remove(element, key) {
  2298. if (!elementMap.has(element)) {
  2299. return;
  2300. }
  2301.  
  2302. const instanceMap = elementMap.get(element);
  2303. instanceMap.delete(key); // free up element references if there are no instances left for an element
  2304.  
  2305. if (instanceMap.size === 0) {
  2306. elementMap.delete(element);
  2307. }
  2308. }
  2309.  
  2310. };
  2311.  
  2312. return data;
  2313.  
  2314. })));
  2315. //# sourceMappingURL=data.js.map
  2316.  
  2317.  
  2318. /***/ }),
  2319.  
  2320. /***/ 955:
  2321. /***/ (function(module) {
  2322.  
  2323. /*!
  2324. * Bootstrap event-handler.js v5.0.2 (https://getbootstrap.com/)
  2325. * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  2326. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2327. */
  2328. (function (global, factory) {
  2329. true ? module.exports = factory() :
  2330. 0;
  2331. }(this, (function () { 'use strict';
  2332.  
  2333. const getjQuery = () => {
  2334. const {
  2335. jQuery
  2336. } = window;
  2337.  
  2338. if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
  2339. return jQuery;
  2340. }
  2341.  
  2342. return null;
  2343. };
  2344.  
  2345. /**
  2346. * --------------------------------------------------------------------------
  2347. * Bootstrap (v5.0.2): dom/event-handler.js
  2348. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2349. * --------------------------------------------------------------------------
  2350. */
  2351. /**
  2352. * ------------------------------------------------------------------------
  2353. * Constants
  2354. * ------------------------------------------------------------------------
  2355. */
  2356.  
  2357. const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
  2358. const stripNameRegex = /\..*/;
  2359. const stripUidRegex = /::\d+$/;
  2360. const eventRegistry = {}; // Events storage
  2361.  
  2362. let uidEvent = 1;
  2363. const customEvents = {
  2364. mouseenter: 'mouseover',
  2365. mouseleave: 'mouseout'
  2366. };
  2367. const customEventsRegex = /^(mouseenter|mouseleave)/i;
  2368. 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']);
  2369. /**
  2370. * ------------------------------------------------------------------------
  2371. * Private methods
  2372. * ------------------------------------------------------------------------
  2373. */
  2374.  
  2375. function getUidEvent(element, uid) {
  2376. return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
  2377. }
  2378.  
  2379. function getEvent(element) {
  2380. const uid = getUidEvent(element);
  2381. element.uidEvent = uid;
  2382. eventRegistry[uid] = eventRegistry[uid] || {};
  2383. return eventRegistry[uid];
  2384. }
  2385.  
  2386. function bootstrapHandler(element, fn) {
  2387. return function handler(event) {
  2388. event.delegateTarget = element;
  2389.  
  2390. if (handler.oneOff) {
  2391. EventHandler.off(element, event.type, fn);
  2392. }
  2393.  
  2394. return fn.apply(element, [event]);
  2395. };
  2396. }
  2397.  
  2398. function bootstrapDelegationHandler(element, selector, fn) {
  2399. return function handler(event) {
  2400. const domElements = element.querySelectorAll(selector);
  2401.  
  2402. for (let {
  2403. target
  2404. } = event; target && target !== this; target = target.parentNode) {
  2405. for (let i = domElements.length; i--;) {
  2406. if (domElements[i] === target) {
  2407. event.delegateTarget = target;
  2408.  
  2409. if (handler.oneOff) {
  2410. // eslint-disable-next-line unicorn/consistent-destructuring
  2411. EventHandler.off(element, event.type, selector, fn);
  2412. }
  2413.  
  2414. return fn.apply(target, [event]);
  2415. }
  2416. }
  2417. } // To please ESLint
  2418.  
  2419.  
  2420. return null;
  2421. };
  2422. }
  2423.  
  2424. function findHandler(events, handler, delegationSelector = null) {
  2425. const uidEventList = Object.keys(events);
  2426.  
  2427. for (let i = 0, len = uidEventList.length; i < len; i++) {
  2428. const event = events[uidEventList[i]];
  2429.  
  2430. if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
  2431. return event;
  2432. }
  2433. }
  2434.  
  2435. return null;
  2436. }
  2437.  
  2438. function normalizeParams(originalTypeEvent, handler, delegationFn) {
  2439. const delegation = typeof handler === 'string';
  2440. const originalHandler = delegation ? delegationFn : handler;
  2441. let typeEvent = getTypeEvent(originalTypeEvent);
  2442. const isNative = nativeEvents.has(typeEvent);
  2443.  
  2444. if (!isNative) {
  2445. typeEvent = originalTypeEvent;
  2446. }
  2447.  
  2448. return [delegation, originalHandler, typeEvent];
  2449. }
  2450.  
  2451. function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
  2452. if (typeof originalTypeEvent !== 'string' || !element) {
  2453. return;
  2454. }
  2455.  
  2456. if (!handler) {
  2457. handler = delegationFn;
  2458. delegationFn = null;
  2459. } // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
  2460. // this prevents the handler from being dispatched the same way as mouseover or mouseout does
  2461.  
  2462.  
  2463. if (customEventsRegex.test(originalTypeEvent)) {
  2464. const wrapFn = fn => {
  2465. return function (event) {
  2466. if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
  2467. return fn.call(this, event);
  2468. }
  2469. };
  2470. };
  2471.  
  2472. if (delegationFn) {
  2473. delegationFn = wrapFn(delegationFn);
  2474. } else {
  2475. handler = wrapFn(handler);
  2476. }
  2477. }
  2478.  
  2479. const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
  2480. const events = getEvent(element);
  2481. const handlers = events[typeEvent] || (events[typeEvent] = {});
  2482. const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
  2483.  
  2484. if (previousFn) {
  2485. previousFn.oneOff = previousFn.oneOff && oneOff;
  2486. return;
  2487. }
  2488.  
  2489. const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
  2490. const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
  2491. fn.delegationSelector = delegation ? handler : null;
  2492. fn.originalHandler = originalHandler;
  2493. fn.oneOff = oneOff;
  2494. fn.uidEvent = uid;
  2495. handlers[uid] = fn;
  2496. element.addEventListener(typeEvent, fn, delegation);
  2497. }
  2498.  
  2499. function removeHandler(element, events, typeEvent, handler, delegationSelector) {
  2500. const fn = findHandler(events[typeEvent], handler, delegationSelector);
  2501.  
  2502. if (!fn) {
  2503. return;
  2504. }
  2505.  
  2506. element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
  2507. delete events[typeEvent][fn.uidEvent];
  2508. }
  2509.  
  2510. function removeNamespacedHandlers(element, events, typeEvent, namespace) {
  2511. const storeElementEvent = events[typeEvent] || {};
  2512. Object.keys(storeElementEvent).forEach(handlerKey => {
  2513. if (handlerKey.includes(namespace)) {
  2514. const event = storeElementEvent[handlerKey];
  2515. removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
  2516. }
  2517. });
  2518. }
  2519.  
  2520. function getTypeEvent(event) {
  2521. // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
  2522. event = event.replace(stripNameRegex, '');
  2523. return customEvents[event] || event;
  2524. }
  2525.  
  2526. const EventHandler = {
  2527. on(element, event, handler, delegationFn) {
  2528. addHandler(element, event, handler, delegationFn, false);
  2529. },
  2530.  
  2531. one(element, event, handler, delegationFn) {
  2532. addHandler(element, event, handler, delegationFn, true);
  2533. },
  2534.  
  2535. off(element, originalTypeEvent, handler, delegationFn) {
  2536. if (typeof originalTypeEvent !== 'string' || !element) {
  2537. return;
  2538. }
  2539.  
  2540. const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
  2541. const inNamespace = typeEvent !== originalTypeEvent;
  2542. const events = getEvent(element);
  2543. const isNamespace = originalTypeEvent.startsWith('.');
  2544.  
  2545. if (typeof originalHandler !== 'undefined') {
  2546. // Simplest case: handler is passed, remove that listener ONLY.
  2547. if (!events || !events[typeEvent]) {
  2548. return;
  2549. }
  2550.  
  2551. removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
  2552. return;
  2553. }
  2554.  
  2555. if (isNamespace) {
  2556. Object.keys(events).forEach(elementEvent => {
  2557. removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
  2558. });
  2559. }
  2560.  
  2561. const storeElementEvent = events[typeEvent] || {};
  2562. Object.keys(storeElementEvent).forEach(keyHandlers => {
  2563. const handlerKey = keyHandlers.replace(stripUidRegex, '');
  2564.  
  2565. if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
  2566. const event = storeElementEvent[keyHandlers];
  2567. removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
  2568. }
  2569. });
  2570. },
  2571.  
  2572. trigger(element, event, args) {
  2573. if (typeof event !== 'string' || !element) {
  2574. return null;
  2575. }
  2576.  
  2577. const $ = getjQuery();
  2578. const typeEvent = getTypeEvent(event);
  2579. const inNamespace = event !== typeEvent;
  2580. const isNative = nativeEvents.has(typeEvent);
  2581. let jQueryEvent;
  2582. let bubbles = true;
  2583. let nativeDispatch = true;
  2584. let defaultPrevented = false;
  2585. let evt = null;
  2586.  
  2587. if (inNamespace && $) {
  2588. jQueryEvent = $.Event(event, args);
  2589. $(element).trigger(jQueryEvent);
  2590. bubbles = !jQueryEvent.isPropagationStopped();
  2591. nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
  2592. defaultPrevented = jQueryEvent.isDefaultPrevented();
  2593. }
  2594.  
  2595. if (isNative) {
  2596. evt = document.createEvent('HTMLEvents');
  2597. evt.initEvent(typeEvent, bubbles, true);
  2598. } else {
  2599. evt = new CustomEvent(event, {
  2600. bubbles,
  2601. cancelable: true
  2602. });
  2603. } // merge custom information in our event
  2604.  
  2605.  
  2606. if (typeof args !== 'undefined') {
  2607. Object.keys(args).forEach(key => {
  2608. Object.defineProperty(evt, key, {
  2609. get() {
  2610. return args[key];
  2611. }
  2612.  
  2613. });
  2614. });
  2615. }
  2616.  
  2617. if (defaultPrevented) {
  2618. evt.preventDefault();
  2619. }
  2620.  
  2621. if (nativeDispatch) {
  2622. element.dispatchEvent(evt);
  2623. }
  2624.  
  2625. if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
  2626. jQueryEvent.preventDefault();
  2627. }
  2628.  
  2629. return evt;
  2630. }
  2631.  
  2632. };
  2633.  
  2634. return EventHandler;
  2635.  
  2636. })));
  2637. //# sourceMappingURL=event-handler.js.map
  2638.  
  2639.  
  2640. /***/ }),
  2641.  
  2642. /***/ 301:
  2643. /***/ (function(module) {
  2644.  
  2645. /*!
  2646. * Bootstrap manipulator.js v5.0.2 (https://getbootstrap.com/)
  2647. * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  2648. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2649. */
  2650. (function (global, factory) {
  2651. true ? module.exports = factory() :
  2652. 0;
  2653. }(this, (function () { 'use strict';
  2654.  
  2655. /**
  2656. * --------------------------------------------------------------------------
  2657. * Bootstrap (v5.0.2): dom/manipulator.js
  2658. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2659. * --------------------------------------------------------------------------
  2660. */
  2661. function normalizeData(val) {
  2662. if (val === 'true') {
  2663. return true;
  2664. }
  2665.  
  2666. if (val === 'false') {
  2667. return false;
  2668. }
  2669.  
  2670. if (val === Number(val).toString()) {
  2671. return Number(val);
  2672. }
  2673.  
  2674. if (val === '' || val === 'null') {
  2675. return null;
  2676. }
  2677.  
  2678. return val;
  2679. }
  2680.  
  2681. function normalizeDataKey(key) {
  2682. return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
  2683. }
  2684.  
  2685. const Manipulator = {
  2686. setDataAttribute(element, key, value) {
  2687. element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
  2688. },
  2689.  
  2690. removeDataAttribute(element, key) {
  2691. element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
  2692. },
  2693.  
  2694. getDataAttributes(element) {
  2695. if (!element) {
  2696. return {};
  2697. }
  2698.  
  2699. const attributes = {};
  2700. Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {
  2701. let pureKey = key.replace(/^bs/, '');
  2702. pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
  2703. attributes[pureKey] = normalizeData(element.dataset[key]);
  2704. });
  2705. return attributes;
  2706. },
  2707.  
  2708. getDataAttribute(element, key) {
  2709. return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
  2710. },
  2711.  
  2712. offset(element) {
  2713. const rect = element.getBoundingClientRect();
  2714. return {
  2715. top: rect.top + document.body.scrollTop,
  2716. left: rect.left + document.body.scrollLeft
  2717. };
  2718. },
  2719.  
  2720. position(element) {
  2721. return {
  2722. top: element.offsetTop,
  2723. left: element.offsetLeft
  2724. };
  2725. }
  2726.  
  2727. };
  2728.  
  2729. return Manipulator;
  2730.  
  2731. })));
  2732. //# sourceMappingURL=manipulator.js.map
  2733.  
  2734.  
  2735. /***/ }),
  2736.  
  2737. /***/ 983:
  2738. /***/ (function(module) {
  2739.  
  2740. /*!
  2741. * Bootstrap selector-engine.js v5.0.2 (https://getbootstrap.com/)
  2742. * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  2743. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2744. */
  2745. (function (global, factory) {
  2746. true ? module.exports = factory() :
  2747. 0;
  2748. }(this, (function () { 'use strict';
  2749.  
  2750. /**
  2751. * --------------------------------------------------------------------------
  2752. * Bootstrap (v5.0.2): dom/selector-engine.js
  2753. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2754. * --------------------------------------------------------------------------
  2755. */
  2756.  
  2757. /**
  2758. * ------------------------------------------------------------------------
  2759. * Constants
  2760. * ------------------------------------------------------------------------
  2761. */
  2762. const NODE_TEXT = 3;
  2763. const SelectorEngine = {
  2764. find(selector, element = document.documentElement) {
  2765. return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
  2766. },
  2767.  
  2768. findOne(selector, element = document.documentElement) {
  2769. return Element.prototype.querySelector.call(element, selector);
  2770. },
  2771.  
  2772. children(element, selector) {
  2773. return [].concat(...element.children).filter(child => child.matches(selector));
  2774. },
  2775.  
  2776. parents(element, selector) {
  2777. const parents = [];
  2778. let ancestor = element.parentNode;
  2779.  
  2780. while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
  2781. if (ancestor.matches(selector)) {
  2782. parents.push(ancestor);
  2783. }
  2784.  
  2785. ancestor = ancestor.parentNode;
  2786. }
  2787.  
  2788. return parents;
  2789. },
  2790.  
  2791. prev(element, selector) {
  2792. let previous = element.previousElementSibling;
  2793.  
  2794. while (previous) {
  2795. if (previous.matches(selector)) {
  2796. return [previous];
  2797. }
  2798.  
  2799. previous = previous.previousElementSibling;
  2800. }
  2801.  
  2802. return [];
  2803. },
  2804.  
  2805. next(element, selector) {
  2806. let next = element.nextElementSibling;
  2807.  
  2808. while (next) {
  2809. if (next.matches(selector)) {
  2810. return [next];
  2811. }
  2812.  
  2813. next = next.nextElementSibling;
  2814. }
  2815.  
  2816. return [];
  2817. }
  2818.  
  2819. };
  2820.  
  2821. return SelectorEngine;
  2822.  
  2823. })));
  2824. //# sourceMappingURL=selector-engine.js.map
  2825.  
  2826.  
  2827. /***/ }),
  2828.  
  2829. /***/ 960:
  2830. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  2831.  
  2832. /*!
  2833. * Bootstrap popover.js v5.0.2 (https://getbootstrap.com/)
  2834. * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  2835. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2836. */
  2837. (function (global, factory) {
  2838. true ? module.exports = factory(__webpack_require__(983), __webpack_require__(632)) :
  2839. 0;
  2840. }(this, (function (SelectorEngine, Tooltip) { 'use strict';
  2841.  
  2842. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  2843.  
  2844. var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
  2845. var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
  2846.  
  2847. const getjQuery = () => {
  2848. const {
  2849. jQuery
  2850. } = window;
  2851.  
  2852. if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
  2853. return jQuery;
  2854. }
  2855.  
  2856. return null;
  2857. };
  2858.  
  2859. const DOMContentLoadedCallbacks = [];
  2860.  
  2861. const onDOMContentLoaded = callback => {
  2862. if (document.readyState === 'loading') {
  2863. // add listener on the first call when the document is in loading state
  2864. if (!DOMContentLoadedCallbacks.length) {
  2865. document.addEventListener('DOMContentLoaded', () => {
  2866. DOMContentLoadedCallbacks.forEach(callback => callback());
  2867. });
  2868. }
  2869.  
  2870. DOMContentLoadedCallbacks.push(callback);
  2871. } else {
  2872. callback();
  2873. }
  2874. };
  2875.  
  2876. const defineJQueryPlugin = plugin => {
  2877. onDOMContentLoaded(() => {
  2878. const $ = getjQuery();
  2879. /* istanbul ignore if */
  2880.  
  2881. if ($) {
  2882. const name = plugin.NAME;
  2883. const JQUERY_NO_CONFLICT = $.fn[name];
  2884. $.fn[name] = plugin.jQueryInterface;
  2885. $.fn[name].Constructor = plugin;
  2886.  
  2887. $.fn[name].noConflict = () => {
  2888. $.fn[name] = JQUERY_NO_CONFLICT;
  2889. return plugin.jQueryInterface;
  2890. };
  2891. }
  2892. });
  2893. };
  2894.  
  2895. /**
  2896. * --------------------------------------------------------------------------
  2897. * Bootstrap (v5.0.2): popover.js
  2898. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  2899. * --------------------------------------------------------------------------
  2900. */
  2901. /**
  2902. * ------------------------------------------------------------------------
  2903. * Constants
  2904. * ------------------------------------------------------------------------
  2905. */
  2906.  
  2907. const NAME = 'popover';
  2908. const DATA_KEY = 'bs.popover';
  2909. const EVENT_KEY = `.${DATA_KEY}`;
  2910. const CLASS_PREFIX = 'bs-popover';
  2911. const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
  2912. const Default = { ...Tooltip__default['default'].Default,
  2913. placement: 'right',
  2914. offset: [0, 8],
  2915. trigger: 'click',
  2916. content: '',
  2917. template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>'
  2918. };
  2919. const DefaultType = { ...Tooltip__default['default'].DefaultType,
  2920. content: '(string|element|function)'
  2921. };
  2922. const Event = {
  2923. HIDE: `hide${EVENT_KEY}`,
  2924. HIDDEN: `hidden${EVENT_KEY}`,
  2925. SHOW: `show${EVENT_KEY}`,
  2926. SHOWN: `shown${EVENT_KEY}`,
  2927. INSERTED: `inserted${EVENT_KEY}`,
  2928. CLICK: `click${EVENT_KEY}`,
  2929. FOCUSIN: `focusin${EVENT_KEY}`,
  2930. FOCUSOUT: `focusout${EVENT_KEY}`,
  2931. MOUSEENTER: `mouseenter${EVENT_KEY}`,
  2932. MOUSELEAVE: `mouseleave${EVENT_KEY}`
  2933. };
  2934. const CLASS_NAME_FADE = 'fade';
  2935. const CLASS_NAME_SHOW = 'show';
  2936. const SELECTOR_TITLE = '.popover-header';
  2937. const SELECTOR_CONTENT = '.popover-body';
  2938. /**
  2939. * ------------------------------------------------------------------------
  2940. * Class Definition
  2941. * ------------------------------------------------------------------------
  2942. */
  2943.  
  2944. class Popover extends Tooltip__default['default'] {
  2945. // Getters
  2946. static get Default() {
  2947. return Default;
  2948. }
  2949.  
  2950. static get NAME() {
  2951. return NAME;
  2952. }
  2953.  
  2954. static get Event() {
  2955. return Event;
  2956. }
  2957.  
  2958. static get DefaultType() {
  2959. return DefaultType;
  2960. } // Overrides
  2961.  
  2962.  
  2963. isWithContent() {
  2964. return this.getTitle() || this._getContent();
  2965. }
  2966.  
  2967. getTipElement() {
  2968. if (this.tip) {
  2969. return this.tip;
  2970. }
  2971.  
  2972. this.tip = super.getTipElement();
  2973.  
  2974. if (!this.getTitle()) {
  2975. SelectorEngine__default['default'].findOne(SELECTOR_TITLE, this.tip).remove();
  2976. }
  2977.  
  2978. if (!this._getContent()) {
  2979. SelectorEngine__default['default'].findOne(SELECTOR_CONTENT, this.tip).remove();
  2980. }
  2981.  
  2982. return this.tip;
  2983. }
  2984.  
  2985. setContent() {
  2986. const tip = this.getTipElement(); // we use append for html objects to maintain js events
  2987.  
  2988. this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_TITLE, tip), this.getTitle());
  2989.  
  2990. let content = this._getContent();
  2991.  
  2992. if (typeof content === 'function') {
  2993. content = content.call(this._element);
  2994. }
  2995.  
  2996. this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_CONTENT, tip), content);
  2997. tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
  2998. } // Private
  2999.  
  3000.  
  3001. _addAttachmentClass(attachment) {
  3002. this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
  3003. }
  3004.  
  3005. _getContent() {
  3006. return this._element.getAttribute('data-bs-content') || this._config.content;
  3007. }
  3008.  
  3009. _cleanTipClass() {
  3010. const tip = this.getTipElement();
  3011. const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
  3012.  
  3013. if (tabClass !== null && tabClass.length > 0) {
  3014. tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
  3015. }
  3016. } // Static
  3017.  
  3018.  
  3019. static jQueryInterface(config) {
  3020. return this.each(function () {
  3021. const data = Popover.getOrCreateInstance(this, config);
  3022.  
  3023. if (typeof config === 'string') {
  3024. if (typeof data[config] === 'undefined') {
  3025. throw new TypeError(`No method named "${config}"`);
  3026. }
  3027.  
  3028. data[config]();
  3029. }
  3030. });
  3031. }
  3032.  
  3033. }
  3034. /**
  3035. * ------------------------------------------------------------------------
  3036. * jQuery
  3037. * ------------------------------------------------------------------------
  3038. * add .Popover to jQuery only if jQuery is present
  3039. */
  3040.  
  3041.  
  3042. defineJQueryPlugin(Popover);
  3043.  
  3044. return Popover;
  3045.  
  3046. })));
  3047. //# sourceMappingURL=popover.js.map
  3048.  
  3049.  
  3050. /***/ }),
  3051.  
  3052. /***/ 632:
  3053. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  3054.  
  3055. /*!
  3056. * Bootstrap tooltip.js v5.0.2 (https://getbootstrap.com/)
  3057. * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  3058. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  3059. */
  3060. (function (global, factory) {
  3061. true ? module.exports = factory(__webpack_require__(518), __webpack_require__(983), __webpack_require__(252), __webpack_require__(955), __webpack_require__(301), __webpack_require__(762)) :
  3062. 0;
  3063. }(this, (function (Popper, SelectorEngine, Data, EventHandler, Manipulator, BaseComponent) { 'use strict';
  3064.  
  3065. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  3066.  
  3067. function _interopNamespace(e) {
  3068. if (e && e.__esModule) return e;
  3069. var n = Object.create(null);
  3070. if (e) {
  3071. Object.keys(e).forEach(function (k) {
  3072. if (k !== 'default') {
  3073. var d = Object.getOwnPropertyDescriptor(e, k);
  3074. Object.defineProperty(n, k, d.get ? d : {
  3075. enumerable: true,
  3076. get: function () {
  3077. return e[k];
  3078. }
  3079. });
  3080. }
  3081. });
  3082. }
  3083. n['default'] = e;
  3084. return Object.freeze(n);
  3085. }
  3086.  
  3087. var Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
  3088. var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
  3089. var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
  3090. var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
  3091. var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
  3092. var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
  3093.  
  3094. /**
  3095. * --------------------------------------------------------------------------
  3096. * Bootstrap (v5.0.2): util/index.js
  3097. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  3098. * --------------------------------------------------------------------------
  3099. */
  3100.  
  3101. const MAX_UID = 1000000;
  3102.  
  3103. const toType = obj => {
  3104. if (obj === null || obj === undefined) {
  3105. return `${obj}`;
  3106. }
  3107.  
  3108. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  3109. };
  3110. /**
  3111. * --------------------------------------------------------------------------
  3112. * Public Util Api
  3113. * --------------------------------------------------------------------------
  3114. */
  3115.  
  3116.  
  3117. const getUID = prefix => {
  3118. do {
  3119. prefix += Math.floor(Math.random() * MAX_UID);
  3120. } while (document.getElementById(prefix));
  3121.  
  3122. return prefix;
  3123. };
  3124.  
  3125. const isElement = obj => {
  3126. if (!obj || typeof obj !== 'object') {
  3127. return false;
  3128. }
  3129.  
  3130. if (typeof obj.jquery !== 'undefined') {
  3131. obj = obj[0];
  3132. }
  3133.  
  3134. return typeof obj.nodeType !== 'undefined';
  3135. };
  3136.  
  3137. const getElement = obj => {
  3138. if (isElement(obj)) {
  3139. // it's a jQuery object or a node element
  3140. return obj.jquery ? obj[0] : obj;
  3141. }
  3142.  
  3143. if (typeof obj === 'string' && obj.length > 0) {
  3144. return SelectorEngine__default['default'].findOne(obj);
  3145. }
  3146.  
  3147. return null;
  3148. };
  3149.  
  3150. const typeCheckConfig = (componentName, config, configTypes) => {
  3151. Object.keys(configTypes).forEach(property => {
  3152. const expectedTypes = configTypes[property];
  3153. const value = config[property];
  3154. const valueType = value && isElement(value) ? 'element' : toType(value);
  3155.  
  3156. if (!new RegExp(expectedTypes).test(valueType)) {
  3157. throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
  3158. }
  3159. });
  3160. };
  3161.  
  3162. const findShadowRoot = element => {
  3163. if (!document.documentElement.attachShadow) {
  3164. return null;
  3165. } // Can find the shadow root otherwise it'll return the document
  3166.  
  3167.  
  3168. if (typeof element.getRootNode === 'function') {
  3169. const root = element.getRootNode();
  3170. return root instanceof ShadowRoot ? root : null;
  3171. }
  3172.  
  3173. if (element instanceof ShadowRoot) {
  3174. return element;
  3175. } // when we don't find a shadow root
  3176.  
  3177.  
  3178. if (!element.parentNode) {
  3179. return null;
  3180. }
  3181.  
  3182. return findShadowRoot(element.parentNode);
  3183. };
  3184.  
  3185. const noop = () => {};
  3186.  
  3187. const getjQuery = () => {
  3188. const {
  3189. jQuery
  3190. } = window;
  3191.  
  3192. if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
  3193. return jQuery;
  3194. }
  3195.  
  3196. return null;
  3197. };
  3198.  
  3199. const DOMContentLoadedCallbacks = [];
  3200.  
  3201. const onDOMContentLoaded = callback => {
  3202. if (document.readyState === 'loading') {
  3203. // add listener on the first call when the document is in loading state
  3204. if (!DOMContentLoadedCallbacks.length) {
  3205. document.addEventListener('DOMContentLoaded', () => {
  3206. DOMContentLoadedCallbacks.forEach(callback => callback());
  3207. });
  3208. }
  3209.  
  3210. DOMContentLoadedCallbacks.push(callback);
  3211. } else {
  3212. callback();
  3213. }
  3214. };
  3215.  
  3216. const isRTL = () => document.documentElement.dir === 'rtl';
  3217.  
  3218. const defineJQueryPlugin = plugin => {
  3219. onDOMContentLoaded(() => {
  3220. const $ = getjQuery();
  3221. /* istanbul ignore if */
  3222.  
  3223. if ($) {
  3224. const name = plugin.NAME;
  3225. const JQUERY_NO_CONFLICT = $.fn[name];
  3226. $.fn[name] = plugin.jQueryInterface;
  3227. $.fn[name].Constructor = plugin;
  3228.  
  3229. $.fn[name].noConflict = () => {
  3230. $.fn[name] = JQUERY_NO_CONFLICT;
  3231. return plugin.jQueryInterface;
  3232. };
  3233. }
  3234. });
  3235. };
  3236.  
  3237. /**
  3238. * --------------------------------------------------------------------------
  3239. * Bootstrap (v5.0.2): util/sanitizer.js
  3240. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  3241. * --------------------------------------------------------------------------
  3242. */
  3243. const uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
  3244. const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  3245. /**
  3246. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  3247. *
  3248. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  3249. */
  3250.  
  3251. const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
  3252. /**
  3253. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  3254. *
  3255. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  3256. */
  3257.  
  3258. 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;
  3259.  
  3260. const allowedAttribute = (attr, allowedAttributeList) => {
  3261. const attrName = attr.nodeName.toLowerCase();
  3262.  
  3263. if (allowedAttributeList.includes(attrName)) {
  3264. if (uriAttrs.has(attrName)) {
  3265. return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
  3266. }
  3267.  
  3268. return true;
  3269. }
  3270.  
  3271. const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp); // Check if a regular expression validates the attribute.
  3272.  
  3273. for (let i = 0, len = regExp.length; i < len; i++) {
  3274. if (regExp[i].test(attrName)) {
  3275. return true;
  3276. }
  3277. }
  3278.  
  3279. return false;
  3280. };
  3281.  
  3282. const DefaultAllowlist = {
  3283. // Global attributes allowed on any supplied element below.
  3284. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  3285. a: ['target', 'href', 'title', 'rel'],
  3286. area: [],
  3287. b: [],
  3288. br: [],
  3289. col: [],
  3290. code: [],
  3291. div: [],
  3292. em: [],
  3293. hr: [],
  3294. h1: [],
  3295. h2: [],
  3296. h3: [],
  3297. h4: [],
  3298. h5: [],
  3299. h6: [],
  3300. i: [],
  3301. img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
  3302. li: [],
  3303. ol: [],
  3304. p: [],
  3305. pre: [],
  3306. s: [],
  3307. small: [],
  3308. span: [],
  3309. sub: [],
  3310. sup: [],
  3311. strong: [],
  3312. u: [],
  3313. ul: []
  3314. };
  3315. function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
  3316. if (!unsafeHtml.length) {
  3317. return unsafeHtml;
  3318. }
  3319.  
  3320. if (sanitizeFn && typeof sanitizeFn === 'function') {
  3321. return sanitizeFn(unsafeHtml);
  3322. }
  3323.  
  3324. const domParser = new window.DOMParser();
  3325. const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  3326. const allowlistKeys = Object.keys(allowList);
  3327. const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
  3328.  
  3329. for (let i = 0, len = elements.length; i < len; i++) {
  3330. const el = elements[i];
  3331. const elName = el.nodeName.toLowerCase();
  3332.  
  3333. if (!allowlistKeys.includes(elName)) {
  3334. el.remove();
  3335. continue;
  3336. }
  3337.  
  3338. const attributeList = [].concat(...el.attributes);
  3339. const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
  3340. attributeList.forEach(attr => {
  3341. if (!allowedAttribute(attr, allowedAttributes)) {
  3342. el.removeAttribute(attr.nodeName);
  3343. }
  3344. });
  3345. }
  3346.  
  3347. return createdDocument.body.innerHTML;
  3348. }
  3349.  
  3350. /**
  3351. * --------------------------------------------------------------------------
  3352. * Bootstrap (v5.0.2): tooltip.js
  3353. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  3354. * --------------------------------------------------------------------------
  3355. */
  3356. /**
  3357. * ------------------------------------------------------------------------
  3358. * Constants
  3359. * ------------------------------------------------------------------------
  3360. */
  3361.  
  3362. const NAME = 'tooltip';
  3363. const DATA_KEY = 'bs.tooltip';
  3364. const EVENT_KEY = `.${DATA_KEY}`;
  3365. const CLASS_PREFIX = 'bs-tooltip';
  3366. const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
  3367. const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
  3368. const DefaultType = {
  3369. animation: 'boolean',
  3370. template: 'string',
  3371. title: '(string|element|function)',
  3372. trigger: 'string',
  3373. delay: '(number|object)',
  3374. html: 'boolean',
  3375. selector: '(string|boolean)',
  3376. placement: '(string|function)',
  3377. offset: '(array|string|function)',
  3378. container: '(string|element|boolean)',
  3379. fallbackPlacements: 'array',
  3380. boundary: '(string|element)',
  3381. customClass: '(string|function)',
  3382. sanitize: 'boolean',
  3383. sanitizeFn: '(null|function)',
  3384. allowList: 'object',
  3385. popperConfig: '(null|object|function)'
  3386. };
  3387. const AttachmentMap = {
  3388. AUTO: 'auto',
  3389. TOP: 'top',
  3390. RIGHT: isRTL() ? 'left' : 'right',
  3391. BOTTOM: 'bottom',
  3392. LEFT: isRTL() ? 'right' : 'left'
  3393. };
  3394. const Default = {
  3395. animation: true,
  3396. template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
  3397. trigger: 'hover focus',
  3398. title: '',
  3399. delay: 0,
  3400. html: false,
  3401. selector: false,
  3402. placement: 'top',
  3403. offset: [0, 0],
  3404. container: false,
  3405. fallbackPlacements: ['top', 'right', 'bottom', 'left'],
  3406. boundary: 'clippingParents',
  3407. customClass: '',
  3408. sanitize: true,
  3409. sanitizeFn: null,
  3410. allowList: DefaultAllowlist,
  3411. popperConfig: null
  3412. };
  3413. const Event = {
  3414. HIDE: `hide${EVENT_KEY}`,
  3415. HIDDEN: `hidden${EVENT_KEY}`,
  3416. SHOW: `show${EVENT_KEY}`,
  3417. SHOWN: `shown${EVENT_KEY}`,
  3418. INSERTED: `inserted${EVENT_KEY}`,
  3419. CLICK: `click${EVENT_KEY}`,
  3420. FOCUSIN: `focusin${EVENT_KEY}`,
  3421. FOCUSOUT: `focusout${EVENT_KEY}`,
  3422. MOUSEENTER: `mouseenter${EVENT_KEY}`,
  3423. MOUSELEAVE: `mouseleave${EVENT_KEY}`
  3424. };
  3425. const CLASS_NAME_FADE = 'fade';
  3426. const CLASS_NAME_MODAL = 'modal';
  3427. const CLASS_NAME_SHOW = 'show';
  3428. const HOVER_STATE_SHOW = 'show';
  3429. const HOVER_STATE_OUT = 'out';
  3430. const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
  3431. const TRIGGER_HOVER = 'hover';
  3432. const TRIGGER_FOCUS = 'focus';
  3433. const TRIGGER_CLICK = 'click';
  3434. const TRIGGER_MANUAL = 'manual';
  3435. /**
  3436. * ------------------------------------------------------------------------
  3437. * Class Definition
  3438. * ------------------------------------------------------------------------
  3439. */
  3440.  
  3441. class Tooltip extends BaseComponent__default['default'] {
  3442. constructor(element, config) {
  3443. if (typeof Popper__namespace === 'undefined') {
  3444. throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
  3445. }
  3446.  
  3447. super(element); // private
  3448.  
  3449. this._isEnabled = true;
  3450. this._timeout = 0;
  3451. this._hoverState = '';
  3452. this._activeTrigger = {};
  3453. this._popper = null; // Protected
  3454.  
  3455. this._config = this._getConfig(config);
  3456. this.tip = null;
  3457.  
  3458. this._setListeners();
  3459. } // Getters
  3460.  
  3461.  
  3462. static get Default() {
  3463. return Default;
  3464. }
  3465.  
  3466. static get NAME() {
  3467. return NAME;
  3468. }
  3469.  
  3470. static get Event() {
  3471. return Event;
  3472. }
  3473.  
  3474. static get DefaultType() {
  3475. return DefaultType;
  3476. } // Public
  3477.  
  3478.  
  3479. enable() {
  3480. this._isEnabled = true;
  3481. }
  3482.  
  3483. disable() {
  3484. this._isEnabled = false;
  3485. }
  3486.  
  3487. toggleEnabled() {
  3488. this._isEnabled = !this._isEnabled;
  3489. }
  3490.  
  3491. toggle(event) {
  3492. if (!this._isEnabled) {
  3493. return;
  3494. }
  3495.  
  3496. if (event) {
  3497. const context = this._initializeOnDelegatedTarget(event);
  3498.  
  3499. context._activeTrigger.click = !context._activeTrigger.click;
  3500.  
  3501. if (context._isWithActiveTrigger()) {
  3502. context._enter(null, context);
  3503. } else {
  3504. context._leave(null, context);
  3505. }
  3506. } else {
  3507. if (this.getTipElement().classList.contains(CLASS_NAME_SHOW)) {
  3508. this._leave(null, this);
  3509.  
  3510. return;
  3511. }
  3512.  
  3513. this._enter(null, this);
  3514. }
  3515. }
  3516.  
  3517. dispose() {
  3518. clearTimeout(this._timeout);
  3519. EventHandler__default['default'].off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
  3520.  
  3521. if (this.tip) {
  3522. this.tip.remove();
  3523. }
  3524.  
  3525. if (this._popper) {
  3526. this._popper.destroy();
  3527. }
  3528.  
  3529. super.dispose();
  3530. }
  3531.  
  3532. show() {
  3533. if (this._element.style.display === 'none') {
  3534. throw new Error('Please use show on visible elements');
  3535. }
  3536.  
  3537. if (!(this.isWithContent() && this._isEnabled)) {
  3538. return;
  3539. }
  3540.  
  3541. const showEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOW);
  3542. const shadowRoot = findShadowRoot(this._element);
  3543. const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
  3544.  
  3545. if (showEvent.defaultPrevented || !isInTheDom) {
  3546. return;
  3547. }
  3548.  
  3549. const tip = this.getTipElement();
  3550. const tipId = getUID(this.constructor.NAME);
  3551. tip.setAttribute('id', tipId);
  3552.  
  3553. this._element.setAttribute('aria-describedby', tipId);
  3554.  
  3555. this.setContent();
  3556.  
  3557. if (this._config.animation) {
  3558. tip.classList.add(CLASS_NAME_FADE);
  3559. }
  3560.  
  3561. const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
  3562.  
  3563. const attachment = this._getAttachment(placement);
  3564.  
  3565. this._addAttachmentClass(attachment);
  3566.  
  3567. const {
  3568. container
  3569. } = this._config;
  3570. Data__default['default'].set(tip, this.constructor.DATA_KEY, this);
  3571.  
  3572. if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
  3573. container.appendChild(tip);
  3574. EventHandler__default['default'].trigger(this._element, this.constructor.Event.INSERTED);
  3575. }
  3576.  
  3577. if (this._popper) {
  3578. this._popper.update();
  3579. } else {
  3580. this._popper = Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment));
  3581. }
  3582.  
  3583. tip.classList.add(CLASS_NAME_SHOW);
  3584. const customClass = typeof this._config.customClass === 'function' ? this._config.customClass() : this._config.customClass;
  3585.  
  3586. if (customClass) {
  3587. tip.classList.add(...customClass.split(' '));
  3588. } // If this is a touch-enabled device we add extra
  3589. // empty mouseover listeners to the body's immediate children;
  3590. // only needed because of broken event delegation on iOS
  3591. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  3592.  
  3593.  
  3594. if ('ontouchstart' in document.documentElement) {
  3595. [].concat(...document.body.children).forEach(element => {
  3596. EventHandler__default['default'].on(element, 'mouseover', noop);
  3597. });
  3598. }
  3599.  
  3600. const complete = () => {
  3601. const prevHoverState = this._hoverState;
  3602. this._hoverState = null;
  3603. EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOWN);
  3604.  
  3605. if (prevHoverState === HOVER_STATE_OUT) {
  3606. this._leave(null, this);
  3607. }
  3608. };
  3609.  
  3610. const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
  3611.  
  3612. this._queueCallback(complete, this.tip, isAnimated);
  3613. }
  3614.  
  3615. hide() {
  3616. if (!this._popper) {
  3617. return;
  3618. }
  3619.  
  3620. const tip = this.getTipElement();
  3621.  
  3622. const complete = () => {
  3623. if (this._isWithActiveTrigger()) {
  3624. return;
  3625. }
  3626.  
  3627. if (this._hoverState !== HOVER_STATE_SHOW) {
  3628. tip.remove();
  3629. }
  3630.  
  3631. this._cleanTipClass();
  3632.  
  3633. this._element.removeAttribute('aria-describedby');
  3634.  
  3635. EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDDEN);
  3636.  
  3637. if (this._popper) {
  3638. this._popper.destroy();
  3639.  
  3640. this._popper = null;
  3641. }
  3642. };
  3643.  
  3644. const hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
  3645.  
  3646. if (hideEvent.defaultPrevented) {
  3647. return;
  3648. }
  3649.  
  3650. tip.classList.remove(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
  3651. // empty mouseover listeners we added for iOS support
  3652.  
  3653. if ('ontouchstart' in document.documentElement) {
  3654. [].concat(...document.body.children).forEach(element => EventHandler__default['default'].off(element, 'mouseover', noop));
  3655. }
  3656.  
  3657. this._activeTrigger[TRIGGER_CLICK] = false;
  3658. this._activeTrigger[TRIGGER_FOCUS] = false;
  3659. this._activeTrigger[TRIGGER_HOVER] = false;
  3660. const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE);
  3661.  
  3662. this._queueCallback(complete, this.tip, isAnimated);
  3663.  
  3664. this._hoverState = '';
  3665. }
  3666.  
  3667. update() {
  3668. if (this._popper !== null) {
  3669. this._popper.update();
  3670. }
  3671. } // Protected
  3672.  
  3673.  
  3674. isWithContent() {
  3675. return Boolean(this.getTitle());
  3676. }
  3677.  
  3678. getTipElement() {
  3679. if (this.tip) {
  3680. return this.tip;
  3681. }
  3682.  
  3683. const element = document.createElement('div');
  3684. element.innerHTML = this._config.template;
  3685. this.tip = element.children[0];
  3686. return this.tip;
  3687. }
  3688.  
  3689. setContent() {
  3690. const tip = this.getTipElement();
  3691. this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
  3692. tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
  3693. }
  3694.  
  3695. setElementContent(element, content) {
  3696. if (element === null) {
  3697. return;
  3698. }
  3699.  
  3700. if (isElement(content)) {
  3701. content = getElement(content); // content is a DOM node or a jQuery
  3702.  
  3703. if (this._config.html) {
  3704. if (content.parentNode !== element) {
  3705. element.innerHTML = '';
  3706. element.appendChild(content);
  3707. }
  3708. } else {
  3709. element.textContent = content.textContent;
  3710. }
  3711.  
  3712. return;
  3713. }
  3714.  
  3715. if (this._config.html) {
  3716. if (this._config.sanitize) {
  3717. content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn);
  3718. }
  3719.  
  3720. element.innerHTML = content;
  3721. } else {
  3722. element.textContent = content;
  3723. }
  3724. }
  3725.  
  3726. getTitle() {
  3727. let title = this._element.getAttribute('data-bs-original-title');
  3728.  
  3729. if (!title) {
  3730. title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
  3731. }
  3732.  
  3733. return title;
  3734. }
  3735.  
  3736. updateAttachment(attachment) {
  3737. if (attachment === 'right') {
  3738. return 'end';
  3739. }
  3740.  
  3741. if (attachment === 'left') {
  3742. return 'start';
  3743. }
  3744.  
  3745. return attachment;
  3746. } // Private
  3747.  
  3748.  
  3749. _initializeOnDelegatedTarget(event, context) {
  3750. const dataKey = this.constructor.DATA_KEY;
  3751. context = context || Data__default['default'].get(event.delegateTarget, dataKey);
  3752.  
  3753. if (!context) {
  3754. context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
  3755. Data__default['default'].set(event.delegateTarget, dataKey, context);
  3756. }
  3757.  
  3758. return context;
  3759. }
  3760.  
  3761. _getOffset() {
  3762. const {
  3763. offset
  3764. } = this._config;
  3765.  
  3766. if (typeof offset === 'string') {
  3767. return offset.split(',').map(val => Number.parseInt(val, 10));
  3768. }
  3769.  
  3770. if (typeof offset === 'function') {
  3771. return popperData => offset(popperData, this._element);
  3772. }
  3773.  
  3774. return offset;
  3775. }
  3776.  
  3777. _getPopperConfig(attachment) {
  3778. const defaultBsPopperConfig = {
  3779. placement: attachment,
  3780. modifiers: [{
  3781. name: 'flip',
  3782. options: {
  3783. fallbackPlacements: this._config.fallbackPlacements
  3784. }
  3785. }, {
  3786. name: 'offset',
  3787. options: {
  3788. offset: this._getOffset()
  3789. }
  3790. }, {
  3791. name: 'preventOverflow',
  3792. options: {
  3793. boundary: this._config.boundary
  3794. }
  3795. }, {
  3796. name: 'arrow',
  3797. options: {
  3798. element: `.${this.constructor.NAME}-arrow`
  3799. }
  3800. }, {
  3801. name: 'onChange',
  3802. enabled: true,
  3803. phase: 'afterWrite',
  3804. fn: data => this._handlePopperPlacementChange(data)
  3805. }],
  3806. onFirstUpdate: data => {
  3807. if (data.options.placement !== data.placement) {
  3808. this._handlePopperPlacementChange(data);
  3809. }
  3810. }
  3811. };
  3812. return { ...defaultBsPopperConfig,
  3813. ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
  3814. };
  3815. }
  3816.  
  3817. _addAttachmentClass(attachment) {
  3818. this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
  3819. }
  3820.  
  3821. _getAttachment(placement) {
  3822. return AttachmentMap[placement.toUpperCase()];
  3823. }
  3824.  
  3825. _setListeners() {
  3826. const triggers = this._config.trigger.split(' ');
  3827.  
  3828. triggers.forEach(trigger => {
  3829. if (trigger === 'click') {
  3830. EventHandler__default['default'].on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event));
  3831. } else if (trigger !== TRIGGER_MANUAL) {
  3832. const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;
  3833. const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;
  3834. EventHandler__default['default'].on(this._element, eventIn, this._config.selector, event => this._enter(event));
  3835. EventHandler__default['default'].on(this._element, eventOut, this._config.selector, event => this._leave(event));
  3836. }
  3837. });
  3838.  
  3839. this._hideModalHandler = () => {
  3840. if (this._element) {
  3841. this.hide();
  3842. }
  3843. };
  3844.  
  3845. EventHandler__default['default'].on(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
  3846.  
  3847. if (this._config.selector) {
  3848. this._config = { ...this._config,
  3849. trigger: 'manual',
  3850. selector: ''
  3851. };
  3852. } else {
  3853. this._fixTitle();
  3854. }
  3855. }
  3856.  
  3857. _fixTitle() {
  3858. const title = this._element.getAttribute('title');
  3859.  
  3860. const originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
  3861.  
  3862. if (title || originalTitleType !== 'string') {
  3863. this._element.setAttribute('data-bs-original-title', title || '');
  3864.  
  3865. if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
  3866. this._element.setAttribute('aria-label', title);
  3867. }
  3868.  
  3869. this._element.setAttribute('title', '');
  3870. }
  3871. }
  3872.  
  3873. _enter(event, context) {
  3874. context = this._initializeOnDelegatedTarget(event, context);
  3875.  
  3876. if (event) {
  3877. context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
  3878. }
  3879.  
  3880. if (context.getTipElement().classList.contains(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
  3881. context._hoverState = HOVER_STATE_SHOW;
  3882. return;
  3883. }
  3884.  
  3885. clearTimeout(context._timeout);
  3886. context._hoverState = HOVER_STATE_SHOW;
  3887.  
  3888. if (!context._config.delay || !context._config.delay.show) {
  3889. context.show();
  3890. return;
  3891. }
  3892.  
  3893. context._timeout = setTimeout(() => {
  3894. if (context._hoverState === HOVER_STATE_SHOW) {
  3895. context.show();
  3896. }
  3897. }, context._config.delay.show);
  3898. }
  3899.  
  3900. _leave(event, context) {
  3901. context = this._initializeOnDelegatedTarget(event, context);
  3902.  
  3903. if (event) {
  3904. context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
  3905. }
  3906.  
  3907. if (context._isWithActiveTrigger()) {
  3908. return;
  3909. }
  3910.  
  3911. clearTimeout(context._timeout);
  3912. context._hoverState = HOVER_STATE_OUT;
  3913.  
  3914. if (!context._config.delay || !context._config.delay.hide) {
  3915. context.hide();
  3916. return;
  3917. }
  3918.  
  3919. context._timeout = setTimeout(() => {
  3920. if (context._hoverState === HOVER_STATE_OUT) {
  3921. context.hide();
  3922. }
  3923. }, context._config.delay.hide);
  3924. }
  3925.  
  3926. _isWithActiveTrigger() {
  3927. for (const trigger in this._activeTrigger) {
  3928. if (this._activeTrigger[trigger]) {
  3929. return true;
  3930. }
  3931. }
  3932.  
  3933. return false;
  3934. }
  3935.  
  3936. _getConfig(config) {
  3937. const dataAttributes = Manipulator__default['default'].getDataAttributes(this._element);
  3938. Object.keys(dataAttributes).forEach(dataAttr => {
  3939. if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
  3940. delete dataAttributes[dataAttr];
  3941. }
  3942. });
  3943. config = { ...this.constructor.Default,
  3944. ...dataAttributes,
  3945. ...(typeof config === 'object' && config ? config : {})
  3946. };
  3947. config.container = config.container === false ? document.body : getElement(config.container);
  3948.  
  3949. if (typeof config.delay === 'number') {
  3950. config.delay = {
  3951. show: config.delay,
  3952. hide: config.delay
  3953. };
  3954. }
  3955.  
  3956. if (typeof config.title === 'number') {
  3957. config.title = config.title.toString();
  3958. }
  3959.  
  3960. if (typeof config.content === 'number') {
  3961. config.content = config.content.toString();
  3962. }
  3963.  
  3964. typeCheckConfig(NAME, config, this.constructor.DefaultType);
  3965.  
  3966. if (config.sanitize) {
  3967. config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
  3968. }
  3969.  
  3970. return config;
  3971. }
  3972.  
  3973. _getDelegateConfig() {
  3974. const config = {};
  3975.  
  3976. if (this._config) {
  3977. for (const key in this._config) {
  3978. if (this.constructor.Default[key] !== this._config[key]) {
  3979. config[key] = this._config[key];
  3980. }
  3981. }
  3982. }
  3983.  
  3984. return config;
  3985. }
  3986.  
  3987. _cleanTipClass() {
  3988. const tip = this.getTipElement();
  3989. const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
  3990.  
  3991. if (tabClass !== null && tabClass.length > 0) {
  3992. tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
  3993. }
  3994. }
  3995.  
  3996. _handlePopperPlacementChange(popperData) {
  3997. const {
  3998. state
  3999. } = popperData;
  4000.  
  4001. if (!state) {
  4002. return;
  4003. }
  4004.  
  4005. this.tip = state.elements.popper;
  4006.  
  4007. this._cleanTipClass();
  4008.  
  4009. this._addAttachmentClass(this._getAttachment(state.placement));
  4010. } // Static
  4011.  
  4012.  
  4013. static jQueryInterface(config) {
  4014. return this.each(function () {
  4015. const data = Tooltip.getOrCreateInstance(this, config);
  4016.  
  4017. if (typeof config === 'string') {
  4018. if (typeof data[config] === 'undefined') {
  4019. throw new TypeError(`No method named "${config}"`);
  4020. }
  4021.  
  4022. data[config]();
  4023. }
  4024. });
  4025. }
  4026.  
  4027. }
  4028. /**
  4029. * ------------------------------------------------------------------------
  4030. * jQuery
  4031. * ------------------------------------------------------------------------
  4032. * add .Tooltip to jQuery only if jQuery is present
  4033. */
  4034.  
  4035.  
  4036. defineJQueryPlugin(Tooltip);
  4037.  
  4038. return Tooltip;
  4039.  
  4040. })));
  4041. //# sourceMappingURL=tooltip.js.map
  4042.  
  4043.  
  4044. /***/ }),
  4045.  
  4046. /***/ 324:
  4047. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  4048.  
  4049. "use strict";
  4050. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  4051. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  4052. /* harmony export */ });
  4053. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(718);
  4054. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  4055. // Imports
  4056.  
  4057. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  4058. // Module
  4059. ___CSS_LOADER_EXPORT___.push([module.id, ".pizyds_rain .disabledField{pointer-events:none;opacity:.8}.pizyds_rain .pizyds_rain_button_field_type_1{right:110px !important}.pizyds_rain .rotating{-webkit-animation:rotation 2s infinite linear;animation:rotation 2s infinite linear}@-webkit-keyframes rotation{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes rotation{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}.pizyds_rain .noselect{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pizyds_rain #pizyds_rain_answer_font_size_default{cursor:pointer}.pizyds_rain #pizyds_rain_answer_font_size_show{display:inline-block;width:20px}.pizyds_rain .no-text-decoration{text-decoration:none !important}.pizyds_rain .inherit-color{color:inherit !important}.pizyds_rain .footer-span{text-align:center;display:block;opacity:.5}.pizyds_rain .footer-span a{text-decoration:none !important;color:inherit !important}.pizyds_rain #pizyds_rain_footer_field{padding-top:10px}.pizyds_rain #pizyds_rain_header_message{color:red}.pizyds_rain :root{--bs-blue: #0d6efd;--bs-indigo: #6610f2;--bs-purple: #6f42c1;--bs-pink: #d63384;--bs-red: #dc3545;--bs-orange: #fd7e14;--bs-yellow: #ffc107;--bs-green: #198754;--bs-teal: #20c997;--bs-cyan: #0dcaf0;--bs-white: #fff;--bs-gray: #6c757d;--bs-gray-dark: #343a40;--bs-primary: #0d6efd;--bs-secondary: #6c757d;--bs-success: #198754;--bs-info: #0dcaf0;--bs-warning: #ffc107;--bs-danger: #dc3545;--bs-light: #f8f9fa;--bs-dark: #212529;--bs-font-sans-serif: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0))}.pizyds_rain *,.pizyds_rain *::before,.pizyds_rain *::after{box-sizing:border-box}@media(prefers-reduced-motion: no-preference){.pizyds_rain :root{scroll-behavior:smooth}}.pizyds_rain body{margin:0;font-family:var(--bs-font-sans-serif);font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}.pizyds_rain hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}.pizyds_rain hr:not([size]){height:1px}.pizyds_rain h6,.pizyds_rain .h6,.pizyds_rain h5,.pizyds_rain .h5,.pizyds_rain h4,.pizyds_rain .h4,.pizyds_rain h3,.pizyds_rain .h3,.pizyds_rain h2,.pizyds_rain .h2,.pizyds_rain h1,.pizyds_rain .h1{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}.pizyds_rain h1,.pizyds_rain .h1{font-size:calc(1.375rem + 1.5vw)}@media(min-width: 1200px){.pizyds_rain h1,.pizyds_rain .h1{font-size:2.5rem}}.pizyds_rain h2,.pizyds_rain .h2{font-size:calc(1.325rem + 0.9vw)}@media(min-width: 1200px){.pizyds_rain h2,.pizyds_rain .h2{font-size:2rem}}.pizyds_rain h3,.pizyds_rain .h3{font-size:calc(1.3rem + 0.6vw)}@media(min-width: 1200px){.pizyds_rain h3,.pizyds_rain .h3{font-size:1.75rem}}.pizyds_rain h4,.pizyds_rain .h4{font-size:calc(1.275rem + 0.3vw)}@media(min-width: 1200px){.pizyds_rain h4,.pizyds_rain .h4{font-size:1.5rem}}.pizyds_rain h5,.pizyds_rain .h5{font-size:1.25rem}.pizyds_rain h6,.pizyds_rain .h6{font-size:1rem}.pizyds_rain p{margin-top:0;margin-bottom:1rem}.pizyds_rain abbr[title],.pizyds_rain abbr[data-bs-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.pizyds_rain address{margin-bottom:1rem;font-style:normal;line-height:inherit}.pizyds_rain ol,.pizyds_rain ul{padding-left:2rem}.pizyds_rain ol,.pizyds_rain ul,.pizyds_rain dl{margin-top:0;margin-bottom:1rem}.pizyds_rain ol ol,.pizyds_rain ul ul,.pizyds_rain ol ul,.pizyds_rain ul ol{margin-bottom:0}.pizyds_rain dt{font-weight:700}.pizyds_rain dd{margin-bottom:.5rem;margin-left:0}.pizyds_rain blockquote{margin:0 0 1rem}.pizyds_rain b,.pizyds_rain strong{font-weight:bolder}.pizyds_rain small,.pizyds_rain .small{font-size:0.875em}.pizyds_rain mark,.pizyds_rain .mark{padding:.2em;background-color:#fcf8e3}.pizyds_rain sub,.pizyds_rain sup{position:relative;font-size:0.75em;line-height:0;vertical-align:baseline}.pizyds_rain sub{bottom:-0.25em}.pizyds_rain sup{top:-0.5em}.pizyds_rain a{color:#0d6efd;text-decoration:underline}.pizyds_rain a:hover{color:#0a58ca}.pizyds_rain a:not([href]):not([class]),.pizyds_rain a:not([href]):not([class]):hover{color:inherit;text-decoration:none}.pizyds_rain pre,.pizyds_rain code,.pizyds_rain kbd,.pizyds_rain samp{font-family:var(--bs-font-monospace);font-size:1em;direction:ltr /* rtl:ignore */;unicode-bidi:bidi-override}.pizyds_rain pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:0.875em}.pizyds_rain pre code{font-size:inherit;color:inherit;word-break:normal}.pizyds_rain code{font-size:0.875em;color:#d63384;word-wrap:break-word}a>.pizyds_rain code{color:inherit}.pizyds_rain kbd{padding:.2rem .4rem;font-size:0.875em;color:#fff;background-color:#212529;border-radius:.2rem}.pizyds_rain kbd kbd{padding:0;font-size:1em;font-weight:700}.pizyds_rain figure{margin:0 0 1rem}.pizyds_rain img,.pizyds_rain svg{vertical-align:middle}.pizyds_rain table{caption-side:bottom;border-collapse:collapse}.pizyds_rain caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}.pizyds_rain th{text-align:inherit;text-align:-webkit-match-parent}.pizyds_rain thead,.pizyds_rain tbody,.pizyds_rain tfoot,.pizyds_rain tr,.pizyds_rain td,.pizyds_rain th{border-color:inherit;border-style:solid;border-width:0}.pizyds_rain label{display:inline-block}.pizyds_rain button{border-radius:0}.pizyds_rain button:focus:not(:focus-visible){outline:0}.pizyds_rain input,.pizyds_rain button,.pizyds_rain select,.pizyds_rain optgroup,.pizyds_rain textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}.pizyds_rain button,.pizyds_rain select{text-transform:none}.pizyds_rain [role=button]{cursor:pointer}.pizyds_rain select{word-wrap:normal}.pizyds_rain select:disabled{opacity:1}.pizyds_rain [list]::-webkit-calendar-picker-indicator{display:none}.pizyds_rain button,.pizyds_rain [type=button],.pizyds_rain [type=reset],.pizyds_rain [type=submit]{-webkit-appearance:button}.pizyds_rain button:not(:disabled),.pizyds_rain [type=button]:not(:disabled),.pizyds_rain [type=reset]:not(:disabled),.pizyds_rain [type=submit]:not(:disabled){cursor:pointer}.pizyds_rain ::-moz-focus-inner{padding:0;border-style:none}.pizyds_rain textarea{resize:vertical}.pizyds_rain fieldset{min-width:0;padding:0;margin:0;border:0}.pizyds_rain legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + 0.3vw);line-height:inherit}@media(min-width: 1200px){.pizyds_rain legend{font-size:1.5rem}}.pizyds_rain legend+*{clear:left}.pizyds_rain ::-webkit-datetime-edit-fields-wrapper,.pizyds_rain ::-webkit-datetime-edit-text,.pizyds_rain ::-webkit-datetime-edit-minute,.pizyds_rain ::-webkit-datetime-edit-hour-field,.pizyds_rain ::-webkit-datetime-edit-day-field,.pizyds_rain ::-webkit-datetime-edit-month-field,.pizyds_rain ::-webkit-datetime-edit-year-field{padding:0}.pizyds_rain ::-webkit-inner-spin-button{height:auto}.pizyds_rain [type=search]{outline-offset:-2px;-webkit-appearance:textfield}.pizyds_rain ::-webkit-search-decoration{-webkit-appearance:none}.pizyds_rain ::-webkit-color-swatch-wrapper{padding:0}.pizyds_rain ::file-selector-button{font:inherit}.pizyds_rain ::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}.pizyds_rain output{display:inline-block}.pizyds_rain iframe{border:0}.pizyds_rain summary{display:list-item;cursor:pointer}.pizyds_rain progress{vertical-align:baseline}.pizyds_rain [hidden]{display:none !important}.pizyds_rain .lead{font-size:1.25rem;font-weight:300}.pizyds_rain .display-1{font-size:calc(1.625rem + 4.5vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.pizyds_rain .display-1{font-size:5rem}}.pizyds_rain .display-2{font-size:calc(1.575rem + 3.9vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.pizyds_rain .display-2{font-size:4.5rem}}.pizyds_rain .display-3{font-size:calc(1.525rem + 3.3vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.pizyds_rain .display-3{font-size:4rem}}.pizyds_rain .display-4{font-size:calc(1.475rem + 2.7vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.pizyds_rain .display-4{font-size:3.5rem}}.pizyds_rain .display-5{font-size:calc(1.425rem + 2.1vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.pizyds_rain .display-5{font-size:3rem}}.pizyds_rain .display-6{font-size:calc(1.375rem + 1.5vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.pizyds_rain .display-6{font-size:2.5rem}}.pizyds_rain .list-unstyled{padding-left:0;list-style:none}.pizyds_rain .list-inline{padding-left:0;list-style:none}.pizyds_rain .list-inline-item{display:inline-block}.pizyds_rain .list-inline-item:not(:last-child){margin-right:.5rem}.pizyds_rain .initialism{font-size:0.875em;text-transform:uppercase}.pizyds_rain .blockquote{margin-bottom:1rem;font-size:1.25rem}.pizyds_rain .blockquote>:last-child{margin-bottom:0}.pizyds_rain .blockquote-footer{margin-top:-1rem;margin-bottom:1rem;font-size:0.875em;color:#6c757d}.pizyds_rain .blockquote-footer::before{content:\"— \"}.pizyds_rain .popover{position:absolute;top:0;left:0 /* rtl:ignore */;z-index:1070;display:block;max-width:276px;font-family:var(--bs-font-sans-serif);font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:0.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.pizyds_rain .popover .popover-arrow{position:absolute;display:block;width:1rem;height:.5rem}.pizyds_rain .popover .popover-arrow::before,.pizyds_rain .popover .popover-arrow::after{position:absolute;display:block;content:\"\";border-color:transparent;border-style:solid}.pizyds_rain .bs-popover-top>.popover-arrow,.pizyds_rain .bs-popover-auto[data-popper-placement^=top]>.popover-arrow{bottom:calc(-0.5rem - 1px)}.pizyds_rain .bs-popover-top>.popover-arrow::before,.pizyds_rain .bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.pizyds_rain .bs-popover-top>.popover-arrow::after,.pizyds_rain .bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.pizyds_rain .bs-popover-end>.popover-arrow,.pizyds_rain .bs-popover-auto[data-popper-placement^=right]>.popover-arrow{left:calc(-0.5rem - 1px);width:.5rem;height:1rem}.pizyds_rain .bs-popover-end>.popover-arrow::before,.pizyds_rain .bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.pizyds_rain .bs-popover-end>.popover-arrow::after,.pizyds_rain .bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.pizyds_rain .bs-popover-bottom>.popover-arrow,.pizyds_rain .bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow{top:calc(-0.5rem - 1px)}.pizyds_rain .bs-popover-bottom>.popover-arrow::before,.pizyds_rain .bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before{top:0;border-width:0 .5rem .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.pizyds_rain .bs-popover-bottom>.popover-arrow::after,.pizyds_rain .bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after{top:1px;border-width:0 .5rem .5rem .5rem;border-bottom-color:#fff}.pizyds_rain .bs-popover-bottom .popover-header::before,.pizyds_rain .bs-popover-auto[data-popper-placement^=bottom] .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-0.5rem;content:\"\";border-bottom:1px solid #f0f0f0}.pizyds_rain .bs-popover-start>.popover-arrow,.pizyds_rain .bs-popover-auto[data-popper-placement^=left]>.popover-arrow{right:calc(-0.5rem - 1px);width:.5rem;height:1rem}.pizyds_rain .bs-popover-start>.popover-arrow::before,.pizyds_rain .bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.pizyds_rain .bs-popover-start>.popover-arrow::after,.pizyds_rain .bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.pizyds_rain .popover-header{padding:.5rem 1rem;margin-bottom:0;font-size:1rem;background-color:#f0f0f0;border-bottom:1px solid rgba(0,0,0,.2);border-top-left-radius:calc(0.3rem - 1px);border-top-right-radius:calc(0.3rem - 1px)}.pizyds_rain .popover-header:empty{display:none}.pizyds_rain .popover-body{padding:1rem 1rem;color:#212529}.pizyds_rain .form-label{margin-bottom:.5rem}.pizyds_rain .col-form-label{padding-top:calc(0.375rem + 1px);padding-bottom:calc(0.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.pizyds_rain .col-form-label-lg{padding-top:calc(0.5rem + 1px);padding-bottom:calc(0.5rem + 1px);font-size:1.25rem}.pizyds_rain .col-form-label-sm{padding-top:calc(0.25rem + 1px);padding-bottom:calc(0.25rem + 1px);font-size:0.875rem}.pizyds_rain .form-text{margin-top:.25rem;font-size:0.875em;color:#6c757d}.pizyds_rain .form-control{display:block;width:100%;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.pizyds_rain .form-control{transition:none}}.pizyds_rain .form-control[type=file]{overflow:hidden}.pizyds_rain .form-control[type=file]:not(:disabled):not([readonly]){cursor:pointer}.pizyds_rain .form-control:focus{color:#212529;background-color:#fff;border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.pizyds_rain .form-control::-webkit-date-and-time-value{height:1.5em}.pizyds_rain .form-control::-moz-placeholder{color:#6c757d;opacity:1}.pizyds_rain .form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.pizyds_rain .form-control::placeholder{color:#6c757d;opacity:1}.pizyds_rain .form-control:disabled,.pizyds_rain .form-control[readonly]{background-color:#e9ecef;opacity:1}.pizyds_rain .form-control::file-selector-button{padding:.375rem .75rem;margin:-0.375rem -0.75rem;-webkit-margin-end:.75rem;margin-inline-end:.75rem;color:#212529;background-color:#e9ecef;pointer-events:none;border-color:inherit;border-style:solid;border-width:0;border-inline-end-width:1px;border-radius:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.pizyds_rain .form-control::file-selector-button{transition:none}}.pizyds_rain .form-control:hover:not(:disabled):not([readonly])::file-selector-button{background-color:#dde0e3}.pizyds_rain .form-control::-webkit-file-upload-button{padding:.375rem .75rem;margin:-0.375rem -0.75rem;-webkit-margin-end:.75rem;margin-inline-end:.75rem;color:#212529;background-color:#e9ecef;pointer-events:none;border-color:inherit;border-style:solid;border-width:0;border-inline-end-width:1px;border-radius:0;-webkit-transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.pizyds_rain .form-control::-webkit-file-upload-button{-webkit-transition:none;transition:none}}.pizyds_rain .form-control:hover:not(:disabled):not([readonly])::-webkit-file-upload-button{background-color:#dde0e3}.pizyds_rain .form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.pizyds_rain .form-control-plaintext.form-control-sm,.pizyds_rain .form-control-plaintext.form-control-lg{padding-right:0;padding-left:0}.pizyds_rain .form-control-sm{min-height:calc(1.5em + (0.5rem + 2px));padding:.25rem .5rem;font-size:0.875rem;border-radius:.2rem}.pizyds_rain .form-control-sm::file-selector-button{padding:.25rem .5rem;margin:-0.25rem -0.5rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}.pizyds_rain .form-control-sm::-webkit-file-upload-button{padding:.25rem .5rem;margin:-0.25rem -0.5rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}.pizyds_rain .form-control-lg{min-height:calc(1.5em + (1rem + 2px));padding:.5rem 1rem;font-size:1.25rem;border-radius:.3rem}.pizyds_rain .form-control-lg::file-selector-button{padding:.5rem 1rem;margin:-0.5rem -1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.pizyds_rain .form-control-lg::-webkit-file-upload-button{padding:.5rem 1rem;margin:-0.5rem -1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.pizyds_rain textarea.form-control{min-height:calc(1.5em + (0.75rem + 2px))}.pizyds_rain textarea.form-control-sm{min-height:calc(1.5em + (0.5rem + 2px))}.pizyds_rain textarea.form-control-lg{min-height:calc(1.5em + (1rem + 2px))}.pizyds_rain .form-control-color{max-width:3rem;height:auto;padding:.375rem}.pizyds_rain .form-control-color:not(:disabled):not([readonly]){cursor:pointer}.pizyds_rain .form-control-color::-moz-color-swatch{height:1.5em;border-radius:.25rem}.pizyds_rain .form-control-color::-webkit-color-swatch{height:1.5em;border-radius:.25rem}.pizyds_rain .form-select{display:block;width:100%;padding:.375rem 2.25rem .375rem .75rem;-moz-padding-start:calc(0.75rem - 3px);font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;-moz-appearance:none;appearance:none}@media(prefers-reduced-motion: reduce){.pizyds_rain .form-select{transition:none}}.pizyds_rain .form-select:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.pizyds_rain .form-select[multiple],.pizyds_rain .form-select[size]:not([size=\"1\"]){padding-right:.75rem;background-image:none}.pizyds_rain .form-select:disabled{background-color:#e9ecef}.pizyds_rain .form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #212529}.pizyds_rain .form-select-sm{padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:0.875rem}.pizyds_rain .form-select-lg{padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.pizyds_rain .form-check{display:block;min-height:1.5rem;padding-left:1.5em;margin-bottom:.125rem}.pizyds_rain .form-check .form-check-input{float:left;margin-left:-1.5em}.pizyds_rain .form-check-input{width:1em;height:1em;margin-top:.25em;vertical-align:top;background-color:#fff;background-repeat:no-repeat;background-position:center;background-size:contain;border:1px solid rgba(0,0,0,.25);-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact}.pizyds_rain .form-check-input[type=checkbox]{border-radius:.25em}.pizyds_rain .form-check-input[type=radio]{border-radius:50%}.pizyds_rain .form-check-input:active{filter:brightness(90%)}.pizyds_rain .form-check-input:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.pizyds_rain .form-check-input:checked{background-color:#0d6efd;border-color:#0d6efd}.pizyds_rain .form-check-input:checked[type=checkbox]{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e\")}.pizyds_rain .form-check-input:checked[type=radio]{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e\")}.pizyds_rain .form-check-input[type=checkbox]:indeterminate{background-color:#0d6efd;border-color:#0d6efd;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e\")}.pizyds_rain .form-check-input:disabled{pointer-events:none;filter:none;opacity:.5}.pizyds_rain .form-check-input[disabled]~.form-check-label,.pizyds_rain .form-check-input:disabled~.form-check-label{opacity:.5}.pizyds_rain .form-switch{padding-left:2.5em}.pizyds_rain .form-switch .form-check-input{width:2em;margin-left:-2.5em;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e\");background-position:left center;border-radius:2em;transition:background-position .15s ease-in-out}@media(prefers-reduced-motion: reduce){.pizyds_rain .form-switch .form-check-input{transition:none}}.pizyds_rain .form-switch .form-check-input:focus{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2386b7fe'/%3e%3c/svg%3e\")}.pizyds_rain .form-switch .form-check-input:checked{background-position:right center;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e\")}.pizyds_rain .form-check-inline{display:inline-block;margin-right:1rem}.pizyds_rain .btn-check{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.pizyds_rain .btn-check[disabled]+.btn,.pizyds_rain .btn-check:disabled+.btn{pointer-events:none;filter:none;opacity:.65}.pizyds_rain .form-range{width:100%;height:1.5rem;padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.pizyds_rain .form-range:focus{outline:0}.pizyds_rain .form-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.pizyds_rain .form-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.pizyds_rain .form-range::-moz-focus-outer{border:0}.pizyds_rain .form-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-0.25rem;background-color:#0d6efd;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media(prefers-reduced-motion: reduce){.pizyds_rain .form-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.pizyds_rain .form-range::-webkit-slider-thumb:active{background-color:#b6d4fe}.pizyds_rain .form-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.pizyds_rain .form-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#0d6efd;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media(prefers-reduced-motion: reduce){.pizyds_rain .form-range::-moz-range-thumb{-moz-transition:none;transition:none}}.pizyds_rain .form-range::-moz-range-thumb:active{background-color:#b6d4fe}.pizyds_rain .form-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.pizyds_rain .form-range:disabled{pointer-events:none}.pizyds_rain .form-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.pizyds_rain .form-range:disabled::-moz-range-thumb{background-color:#adb5bd}.pizyds_rain .form-floating{position:relative}.pizyds_rain .form-floating>.form-control,.pizyds_rain .form-floating>.form-select{height:calc(3.5rem + 2px);line-height:1.25}.pizyds_rain .form-floating>label{position:absolute;top:0;left:0;height:100%;padding:1rem .75rem;pointer-events:none;border:1px solid transparent;transform-origin:0 0;transition:opacity .1s ease-in-out,transform .1s ease-in-out}@media(prefers-reduced-motion: reduce){.pizyds_rain .form-floating>label{transition:none}}.pizyds_rain .form-floating>.form-control{padding:1rem .75rem}.pizyds_rain .form-floating>.form-control::-moz-placeholder{color:transparent}.pizyds_rain .form-floating>.form-control:-ms-input-placeholder{color:transparent}.pizyds_rain .form-floating>.form-control::placeholder{color:transparent}.pizyds_rain .form-floating>.form-control:not(:-moz-placeholder-shown){padding-top:1.625rem;padding-bottom:.625rem}.pizyds_rain .form-floating>.form-control:not(:-ms-input-placeholder){padding-top:1.625rem;padding-bottom:.625rem}.pizyds_rain .form-floating>.form-control:focus,.pizyds_rain .form-floating>.form-control:not(:placeholder-shown){padding-top:1.625rem;padding-bottom:.625rem}.pizyds_rain .form-floating>.form-control:-webkit-autofill{padding-top:1.625rem;padding-bottom:.625rem}.pizyds_rain .form-floating>.form-select{padding-top:1.625rem;padding-bottom:.625rem}.pizyds_rain .form-floating>.form-control:not(:-moz-placeholder-shown)~label{opacity:.65;transform:scale(0.85) translateY(-0.5rem) translateX(0.15rem)}.pizyds_rain .form-floating>.form-control:not(:-ms-input-placeholder)~label{opacity:.65;transform:scale(0.85) translateY(-0.5rem) translateX(0.15rem)}.pizyds_rain .form-floating>.form-control:focus~label,.pizyds_rain .form-floating>.form-control:not(:placeholder-shown)~label,.pizyds_rain .form-floating>.form-select~label{opacity:.65;transform:scale(0.85) translateY(-0.5rem) translateX(0.15rem)}.pizyds_rain .form-floating>.form-control:-webkit-autofill~label{opacity:.65;transform:scale(0.85) translateY(-0.5rem) translateX(0.15rem)}.pizyds_rain .input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.pizyds_rain .input-group>.form-control,.pizyds_rain .input-group>.form-select{position:relative;flex:1 1 auto;width:1%;min-width:0}.pizyds_rain .input-group>.form-control:focus,.pizyds_rain .input-group>.form-select:focus{z-index:3}.pizyds_rain .input-group .btn{position:relative;z-index:2}.pizyds_rain .input-group .btn:focus{z-index:3}.pizyds_rain .input-group-text{display:flex;align-items:center;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.pizyds_rain .input-group-lg>.form-control,.pizyds_rain .input-group-lg>.form-select,.pizyds_rain .input-group-lg>.input-group-text,.pizyds_rain .input-group-lg>.btn{padding:.5rem 1rem;font-size:1.25rem;border-radius:.3rem}.pizyds_rain .input-group-sm>.form-control,.pizyds_rain .input-group-sm>.form-select,.pizyds_rain .input-group-sm>.input-group-text,.pizyds_rain .input-group-sm>.btn{padding:.25rem .5rem;font-size:0.875rem;border-radius:.2rem}.pizyds_rain .input-group-lg>.form-select,.pizyds_rain .input-group-sm>.form-select{padding-right:3rem}.pizyds_rain .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu),.pizyds_rain .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3){border-top-right-radius:0;border-bottom-right-radius:0}.pizyds_rain .input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu),.pizyds_rain .input-group.has-validation>.dropdown-toggle:nth-last-child(n+4){border-top-right-radius:0;border-bottom-right-radius:0}.pizyds_rain .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}.pizyds_rain .valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:0.875em;color:#198754}.pizyds_rain .valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:0.875rem;color:#fff;background-color:rgba(25,135,84,.9);border-radius:.25rem}.was-validated .pizyds_rain:valid~.valid-feedback,.was-validated .pizyds_rain:valid~.valid-tooltip,.pizyds_rain.is-valid~.valid-feedback,.pizyds_rain.is-valid~.valid-tooltip{display:block}.was-validated .pizyds_rain .form-control:valid,.pizyds_rain .form-control.is-valid{border-color:#198754;padding-right:calc(1.5em + 0.75rem);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right calc(0.375em + 0.1875rem) center;background-size:calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .pizyds_rain .form-control:valid:focus,.pizyds_rain .form-control.is-valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated .pizyds_rain textarea.form-control:valid,.pizyds_rain textarea.form-control.is-valid{padding-right:calc(1.5em + 0.75rem);background-position:top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem)}.was-validated .pizyds_rain .form-select:valid,.pizyds_rain .form-select.is-valid{border-color:#198754}.was-validated .pizyds_rain .form-select:valid:not([multiple]):not([size]),.was-validated .pizyds_rain .form-select:valid:not([multiple])[size=\"1\"],.pizyds_rain .form-select.is-valid:not([multiple]):not([size]),.pizyds_rain .form-select.is-valid:not([multiple])[size=\"1\"]{padding-right:4.125rem;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e\"),url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e\");background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .pizyds_rain .form-select:valid:focus,.pizyds_rain .form-select.is-valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated .pizyds_rain .form-check-input:valid,.pizyds_rain .form-check-input.is-valid{border-color:#198754}.was-validated .pizyds_rain .form-check-input:valid:checked,.pizyds_rain .form-check-input.is-valid:checked{background-color:#198754}.was-validated .pizyds_rain .form-check-input:valid:focus,.pizyds_rain .form-check-input.is-valid:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated .pizyds_rain .form-check-input:valid~.form-check-label,.pizyds_rain .form-check-input.is-valid~.form-check-label{color:#198754}.pizyds_rain .form-check-inline .form-check-input~.valid-feedback{margin-left:.5em}.was-validated .pizyds_rain .input-group .form-control:valid,.pizyds_rain .input-group .form-control.is-valid,.was-validated .pizyds_rain .input-group .form-select:valid,.pizyds_rain .input-group .form-select.is-valid{z-index:1}.was-validated .pizyds_rain .input-group .form-control:valid:focus,.pizyds_rain .input-group .form-control.is-valid:focus,.was-validated .pizyds_rain .input-group .form-select:valid:focus,.pizyds_rain .input-group .form-select.is-valid:focus{z-index:3}.pizyds_rain .invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:0.875em;color:#dc3545}.pizyds_rain .invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:0.875rem;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.was-validated .pizyds_rain:invalid~.invalid-feedback,.was-validated .pizyds_rain:invalid~.invalid-tooltip,.pizyds_rain.is-invalid~.invalid-feedback,.pizyds_rain.is-invalid~.invalid-tooltip{display:block}.was-validated .pizyds_rain .form-control:invalid,.pizyds_rain .form-control.is-invalid{border-color:#dc3545;padding-right:calc(1.5em + 0.75rem);background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right calc(0.375em + 0.1875rem) center;background-size:calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .pizyds_rain .form-control:invalid:focus,.pizyds_rain .form-control.is-invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated .pizyds_rain textarea.form-control:invalid,.pizyds_rain textarea.form-control.is-invalid{padding-right:calc(1.5em + 0.75rem);background-position:top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem)}.was-validated .pizyds_rain .form-select:invalid,.pizyds_rain .form-select.is-invalid{border-color:#dc3545}.was-validated .pizyds_rain .form-select:invalid:not([multiple]):not([size]),.was-validated .pizyds_rain .form-select:invalid:not([multiple])[size=\"1\"],.pizyds_rain .form-select.is-invalid:not([multiple]):not([size]),.pizyds_rain .form-select.is-invalid:not([multiple])[size=\"1\"]{padding-right:4.125rem;background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e\"),url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e\");background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .pizyds_rain .form-select:invalid:focus,.pizyds_rain .form-select.is-invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated .pizyds_rain .form-check-input:invalid,.pizyds_rain .form-check-input.is-invalid{border-color:#dc3545}.was-validated .pizyds_rain .form-check-input:invalid:checked,.pizyds_rain .form-check-input.is-invalid:checked{background-color:#dc3545}.was-validated .pizyds_rain .form-check-input:invalid:focus,.pizyds_rain .form-check-input.is-invalid:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated .pizyds_rain .form-check-input:invalid~.form-check-label,.pizyds_rain .form-check-input.is-invalid~.form-check-label{color:#dc3545}.pizyds_rain .form-check-inline .form-check-input~.invalid-feedback{margin-left:.5em}.was-validated .pizyds_rain .input-group .form-control:invalid,.pizyds_rain .input-group .form-control.is-invalid,.was-validated .pizyds_rain .input-group .form-select:invalid,.pizyds_rain .input-group .form-select.is-invalid{z-index:2}.was-validated .pizyds_rain .input-group .form-control:invalid:focus,.pizyds_rain .input-group .form-control.is-invalid:focus,.was-validated .pizyds_rain .input-group .form-select:invalid:focus,.pizyds_rain .input-group .form-select.is-invalid:focus{z-index:3}", ""]);
  4060. // Exports
  4061. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  4062.  
  4063.  
  4064. /***/ }),
  4065.  
  4066. /***/ 718:
  4067. /***/ ((module) => {
  4068.  
  4069. "use strict";
  4070.  
  4071.  
  4072. /*
  4073. MIT License http://www.opensource.org/licenses/mit-license.php
  4074. Author Tobias Koppers @sokra
  4075. */
  4076. // css base code, injected by the css-loader
  4077. // eslint-disable-next-line func-names
  4078. module.exports = function (cssWithMappingToString) {
  4079. var list = []; // return the list of modules as css string
  4080.  
  4081. list.toString = function toString() {
  4082. return this.map(function (item) {
  4083. var content = cssWithMappingToString(item);
  4084.  
  4085. if (item[2]) {
  4086. return "@media ".concat(item[2], " {").concat(content, "}");
  4087. }
  4088.  
  4089. return content;
  4090. }).join("");
  4091. }; // import a list of modules into the list
  4092. // eslint-disable-next-line func-names
  4093.  
  4094.  
  4095. list.i = function (modules, mediaQuery, dedupe) {
  4096. if (typeof modules === "string") {
  4097. // eslint-disable-next-line no-param-reassign
  4098. modules = [[null, modules, ""]];
  4099. }
  4100.  
  4101. var alreadyImportedModules = {};
  4102.  
  4103. if (dedupe) {
  4104. for (var i = 0; i < this.length; i++) {
  4105. // eslint-disable-next-line prefer-destructuring
  4106. var id = this[i][0];
  4107.  
  4108. if (id != null) {
  4109. alreadyImportedModules[id] = true;
  4110. }
  4111. }
  4112. }
  4113.  
  4114. for (var _i = 0; _i < modules.length; _i++) {
  4115. var item = [].concat(modules[_i]);
  4116.  
  4117. if (dedupe && alreadyImportedModules[item[0]]) {
  4118. // eslint-disable-next-line no-continue
  4119. continue;
  4120. }
  4121.  
  4122. if (mediaQuery) {
  4123. if (!item[2]) {
  4124. item[2] = mediaQuery;
  4125. } else {
  4126. item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
  4127. }
  4128. }
  4129.  
  4130. list.push(item);
  4131. }
  4132. };
  4133.  
  4134. return list;
  4135. };
  4136.  
  4137. /***/ }),
  4138.  
  4139. /***/ 56:
  4140. /***/ ((module) => {
  4141.  
  4142. (function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=undefined;if(!f&&c)return require(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=undefined,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  4143. /*
  4144. * EJS Embedded JavaScript templates
  4145. * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
  4146. *
  4147. * Licensed under the Apache License, Version 2.0 (the "License");
  4148. * you may not use this file except in compliance with the License.
  4149. * You may obtain a copy of the License at
  4150. *
  4151. * http://www.apache.org/licenses/LICENSE-2.0
  4152. *
  4153. * Unless required by applicable law or agreed to in writing, software
  4154. * distributed under the License is distributed on an "AS IS" BASIS,
  4155. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4156. * See the License for the specific language governing permissions and
  4157. * limitations under the License.
  4158. *
  4159. */
  4160.  
  4161. 'use strict';
  4162.  
  4163. /**
  4164. * @file Embedded JavaScript templating engine. {@link http://ejs.co}
  4165. * @author Matthew Eernisse <mde@fleegix.org>
  4166. * @author Tiancheng "Timothy" Gu <timothygu99@gmail.com>
  4167. * @project EJS
  4168. * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
  4169. */
  4170.  
  4171. /**
  4172. * EJS internal functions.
  4173. *
  4174. * Technically this "module" lies in the same file as {@link module:ejs}, for
  4175. * the sake of organization all the private functions re grouped into this
  4176. * module.
  4177. *
  4178. * @module ejs-internal
  4179. * @private
  4180. */
  4181.  
  4182. /**
  4183. * Embedded JavaScript templating engine.
  4184. *
  4185. * @module ejs
  4186. * @public
  4187. */
  4188.  
  4189. var fs = require('fs');
  4190. var path = require('path');
  4191. var utils = require('./utils');
  4192.  
  4193. var scopeOptionWarned = false;
  4194. /** @type {string} */
  4195. var _VERSION_STRING = require('../package.json').version;
  4196. var _DEFAULT_OPEN_DELIMITER = '<';
  4197. var _DEFAULT_CLOSE_DELIMITER = '>';
  4198. var _DEFAULT_DELIMITER = '%';
  4199. var _DEFAULT_LOCALS_NAME = 'locals';
  4200. var _NAME = 'ejs';
  4201. var _REGEX_STRING = '(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)';
  4202. var _OPTS_PASSABLE_WITH_DATA = ['delimiter', 'scope', 'context', 'debug', 'compileDebug',
  4203. 'client', '_with', 'rmWhitespace', 'strict', 'filename', 'async'];
  4204. // We don't allow 'cache' option to be passed in the data obj for
  4205. // the normal `render` call, but this is where Express 2 & 3 put it
  4206. // so we make an exception for `renderFile`
  4207. var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat('cache');
  4208. var _BOM = /^\uFEFF/;
  4209.  
  4210. /**
  4211. * EJS template function cache. This can be a LRU object from lru-cache NPM
  4212. * module. By default, it is {@link module:utils.cache}, a simple in-process
  4213. * cache that grows continuously.
  4214. *
  4215. * @type {Cache}
  4216. */
  4217.  
  4218. exports.cache = utils.cache;
  4219.  
  4220. /**
  4221. * Custom file loader. Useful for template preprocessing or restricting access
  4222. * to a certain part of the filesystem.
  4223. *
  4224. * @type {fileLoader}
  4225. */
  4226.  
  4227. exports.fileLoader = fs.readFileSync;
  4228.  
  4229. /**
  4230. * Name of the object containing the locals.
  4231. *
  4232. * This variable is overridden by {@link Options}`.localsName` if it is not
  4233. * `undefined`.
  4234. *
  4235. * @type {String}
  4236. * @public
  4237. */
  4238.  
  4239. exports.localsName = _DEFAULT_LOCALS_NAME;
  4240.  
  4241. /**
  4242. * Promise implementation -- defaults to the native implementation if available
  4243. * This is mostly just for testability
  4244. *
  4245. * @type {PromiseConstructorLike}
  4246. * @public
  4247. */
  4248.  
  4249. exports.promiseImpl = (new Function('return this;'))().Promise;
  4250.  
  4251. /**
  4252. * Get the path to the included file from the parent file path and the
  4253. * specified path.
  4254. *
  4255. * @param {String} name specified path
  4256. * @param {String} filename parent file path
  4257. * @param {Boolean} [isDir=false] whether the parent file path is a directory
  4258. * @return {String}
  4259. */
  4260. exports.resolveInclude = function(name, filename, isDir) {
  4261. var dirname = path.dirname;
  4262. var extname = path.extname;
  4263. var resolve = path.resolve;
  4264. var includePath = resolve(isDir ? filename : dirname(filename), name);
  4265. var ext = extname(name);
  4266. if (!ext) {
  4267. includePath += '.ejs';
  4268. }
  4269. return includePath;
  4270. };
  4271.  
  4272. /**
  4273. * Try to resolve file path on multiple directories
  4274. *
  4275. * @param {String} name specified path
  4276. * @param {Array<String>} paths list of possible parent directory paths
  4277. * @return {String}
  4278. */
  4279. function resolvePaths(name, paths) {
  4280. var filePath;
  4281. if (paths.some(function (v) {
  4282. filePath = exports.resolveInclude(name, v, true);
  4283. return fs.existsSync(filePath);
  4284. })) {
  4285. return filePath;
  4286. }
  4287. }
  4288.  
  4289. /**
  4290. * Get the path to the included file by Options
  4291. *
  4292. * @param {String} path specified path
  4293. * @param {Options} options compilation options
  4294. * @return {String}
  4295. */
  4296. function getIncludePath(path, options) {
  4297. var includePath;
  4298. var filePath;
  4299. var views = options.views;
  4300. var match = /^[A-Za-z]+:\\|^\//.exec(path);
  4301.  
  4302. // Abs path
  4303. if (match && match.length) {
  4304. path = path.replace(/^\/*/, '');
  4305. if (Array.isArray(options.root)) {
  4306. includePath = resolvePaths(path, options.root);
  4307. } else {
  4308. includePath = exports.resolveInclude(path, options.root || '/', true);
  4309. }
  4310. }
  4311. // Relative paths
  4312. else {
  4313. // Look relative to a passed filename first
  4314. if (options.filename) {
  4315. filePath = exports.resolveInclude(path, options.filename);
  4316. if (fs.existsSync(filePath)) {
  4317. includePath = filePath;
  4318. }
  4319. }
  4320. // Then look in any views directories
  4321. if (!includePath && Array.isArray(views)) {
  4322. includePath = resolvePaths(path, views);
  4323. }
  4324. if (!includePath && typeof options.includer !== 'function') {
  4325. throw new Error('Could not find the include file "' +
  4326. options.escapeFunction(path) + '"');
  4327. }
  4328. }
  4329. return includePath;
  4330. }
  4331.  
  4332. /**
  4333. * Get the template from a string or a file, either compiled on-the-fly or
  4334. * read from cache (if enabled), and cache the template if needed.
  4335. *
  4336. * If `template` is not set, the file specified in `options.filename` will be
  4337. * read.
  4338. *
  4339. * If `options.cache` is true, this function reads the file from
  4340. * `options.filename` so it must be set prior to calling this function.
  4341. *
  4342. * @memberof module:ejs-internal
  4343. * @param {Options} options compilation options
  4344. * @param {String} [template] template source
  4345. * @return {(TemplateFunction|ClientFunction)}
  4346. * Depending on the value of `options.client`, either type might be returned.
  4347. * @static
  4348. */
  4349.  
  4350. function handleCache(options, template) {
  4351. var func;
  4352. var filename = options.filename;
  4353. var hasTemplate = arguments.length > 1;
  4354.  
  4355. if (options.cache) {
  4356. if (!filename) {
  4357. throw new Error('cache option requires a filename');
  4358. }
  4359. func = exports.cache.get(filename);
  4360. if (func) {
  4361. return func;
  4362. }
  4363. if (!hasTemplate) {
  4364. template = fileLoader(filename).toString().replace(_BOM, '');
  4365. }
  4366. }
  4367. else if (!hasTemplate) {
  4368. // istanbul ignore if: should not happen at all
  4369. if (!filename) {
  4370. throw new Error('Internal EJS error: no file name or template '
  4371. + 'provided');
  4372. }
  4373. template = fileLoader(filename).toString().replace(_BOM, '');
  4374. }
  4375. func = exports.compile(template, options);
  4376. if (options.cache) {
  4377. exports.cache.set(filename, func);
  4378. }
  4379. return func;
  4380. }
  4381.  
  4382. /**
  4383. * Try calling handleCache with the given options and data and call the
  4384. * callback with the result. If an error occurs, call the callback with
  4385. * the error. Used by renderFile().
  4386. *
  4387. * @memberof module:ejs-internal
  4388. * @param {Options} options compilation options
  4389. * @param {Object} data template data
  4390. * @param {RenderFileCallback} cb callback
  4391. * @static
  4392. */
  4393.  
  4394. function tryHandleCache(options, data, cb) {
  4395. var result;
  4396. if (!cb) {
  4397. if (typeof exports.promiseImpl == 'function') {
  4398. return new exports.promiseImpl(function (resolve, reject) {
  4399. try {
  4400. result = handleCache(options)(data);
  4401. resolve(result);
  4402. }
  4403. catch (err) {
  4404. reject(err);
  4405. }
  4406. });
  4407. }
  4408. else {
  4409. throw new Error('Please provide a callback function');
  4410. }
  4411. }
  4412. else {
  4413. try {
  4414. result = handleCache(options)(data);
  4415. }
  4416. catch (err) {
  4417. return cb(err);
  4418. }
  4419.  
  4420. cb(null, result);
  4421. }
  4422. }
  4423.  
  4424. /**
  4425. * fileLoader is independent
  4426. *
  4427. * @param {String} filePath ejs file path.
  4428. * @return {String} The contents of the specified file.
  4429. * @static
  4430. */
  4431.  
  4432. function fileLoader(filePath){
  4433. return exports.fileLoader(filePath);
  4434. }
  4435.  
  4436. /**
  4437. * Get the template function.
  4438. *
  4439. * If `options.cache` is `true`, then the template is cached.
  4440. *
  4441. * @memberof module:ejs-internal
  4442. * @param {String} path path for the specified file
  4443. * @param {Options} options compilation options
  4444. * @return {(TemplateFunction|ClientFunction)}
  4445. * Depending on the value of `options.client`, either type might be returned
  4446. * @static
  4447. */
  4448.  
  4449. function includeFile(path, options) {
  4450. var opts = utils.shallowCopy({}, options);
  4451. opts.filename = getIncludePath(path, opts);
  4452. if (typeof options.includer === 'function') {
  4453. var includerResult = options.includer(path, opts.filename);
  4454. if (includerResult) {
  4455. if (includerResult.filename) {
  4456. opts.filename = includerResult.filename;
  4457. }
  4458. if (includerResult.template) {
  4459. return handleCache(opts, includerResult.template);
  4460. }
  4461. }
  4462. }
  4463. return handleCache(opts);
  4464. }
  4465.  
  4466. /**
  4467. * Re-throw the given `err` in context to the `str` of ejs, `filename`, and
  4468. * `lineno`.
  4469. *
  4470. * @implements {RethrowCallback}
  4471. * @memberof module:ejs-internal
  4472. * @param {Error} err Error object
  4473. * @param {String} str EJS source
  4474. * @param {String} flnm file name of the EJS file
  4475. * @param {Number} lineno line number of the error
  4476. * @param {EscapeCallback} esc
  4477. * @static
  4478. */
  4479.  
  4480. function rethrow(err, str, flnm, lineno, esc) {
  4481. var lines = str.split('\n');
  4482. var start = Math.max(lineno - 3, 0);
  4483. var end = Math.min(lines.length, lineno + 3);
  4484. var filename = esc(flnm);
  4485. // Error context
  4486. var context = lines.slice(start, end).map(function (line, i){
  4487. var curr = i + start + 1;
  4488. return (curr == lineno ? ' >> ' : ' ')
  4489. + curr
  4490. + '| '
  4491. + line;
  4492. }).join('\n');
  4493.  
  4494. // Alter exception message
  4495. err.path = filename;
  4496. err.message = (filename || 'ejs') + ':'
  4497. + lineno + '\n'
  4498. + context + '\n\n'
  4499. + err.message;
  4500.  
  4501. throw err;
  4502. }
  4503.  
  4504. function stripSemi(str){
  4505. return str.replace(/;(\s*$)/, '$1');
  4506. }
  4507.  
  4508. /**
  4509. * Compile the given `str` of ejs into a template function.
  4510. *
  4511. * @param {String} template EJS template
  4512. *
  4513. * @param {Options} [opts] compilation options
  4514. *
  4515. * @return {(TemplateFunction|ClientFunction)}
  4516. * Depending on the value of `opts.client`, either type might be returned.
  4517. * Note that the return type of the function also depends on the value of `opts.async`.
  4518. * @public
  4519. */
  4520.  
  4521. exports.compile = function compile(template, opts) {
  4522. var templ;
  4523.  
  4524. // v1 compat
  4525. // 'scope' is 'context'
  4526. // FIXME: Remove this in a future version
  4527. if (opts && opts.scope) {
  4528. if (!scopeOptionWarned){
  4529. console.warn('`scope` option is deprecated and will be removed in EJS 3');
  4530. scopeOptionWarned = true;
  4531. }
  4532. if (!opts.context) {
  4533. opts.context = opts.scope;
  4534. }
  4535. delete opts.scope;
  4536. }
  4537. templ = new Template(template, opts);
  4538. return templ.compile();
  4539. };
  4540.  
  4541. /**
  4542. * Render the given `template` of ejs.
  4543. *
  4544. * If you would like to include options but not data, you need to explicitly
  4545. * call this function with `data` being an empty object or `null`.
  4546. *
  4547. * @param {String} template EJS template
  4548. * @param {Object} [data={}] template data
  4549. * @param {Options} [opts={}] compilation and rendering options
  4550. * @return {(String|Promise<String>)}
  4551. * Return value type depends on `opts.async`.
  4552. * @public
  4553. */
  4554.  
  4555. exports.render = function (template, d, o) {
  4556. var data = d || {};
  4557. var opts = o || {};
  4558.  
  4559. // No options object -- if there are optiony names
  4560. // in the data, copy them to options
  4561. if (arguments.length == 2) {
  4562. utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);
  4563. }
  4564.  
  4565. return handleCache(opts, template)(data);
  4566. };
  4567.  
  4568. /**
  4569. * Render an EJS file at the given `path` and callback `cb(err, str)`.
  4570. *
  4571. * If you would like to include options but not data, you need to explicitly
  4572. * call this function with `data` being an empty object or `null`.
  4573. *
  4574. * @param {String} path path to the EJS file
  4575. * @param {Object} [data={}] template data
  4576. * @param {Options} [opts={}] compilation and rendering options
  4577. * @param {RenderFileCallback} cb callback
  4578. * @public
  4579. */
  4580.  
  4581. exports.renderFile = function () {
  4582. var args = Array.prototype.slice.call(arguments);
  4583. var filename = args.shift();
  4584. var cb;
  4585. var opts = {filename: filename};
  4586. var data;
  4587. var viewOpts;
  4588.  
  4589. // Do we have a callback?
  4590. if (typeof arguments[arguments.length - 1] == 'function') {
  4591. cb = args.pop();
  4592. }
  4593. // Do we have data/opts?
  4594. if (args.length) {
  4595. // Should always have data obj
  4596. data = args.shift();
  4597. // Normal passed opts (data obj + opts obj)
  4598. if (args.length) {
  4599. // Use shallowCopy so we don't pollute passed in opts obj with new vals
  4600. utils.shallowCopy(opts, args.pop());
  4601. }
  4602. // Special casing for Express (settings + opts-in-data)
  4603. else {
  4604. // Express 3 and 4
  4605. if (data.settings) {
  4606. // Pull a few things from known locations
  4607. if (data.settings.views) {
  4608. opts.views = data.settings.views;
  4609. }
  4610. if (data.settings['view cache']) {
  4611. opts.cache = true;
  4612. }
  4613. // Undocumented after Express 2, but still usable, esp. for
  4614. // items that are unsafe to be passed along with data, like `root`
  4615. viewOpts = data.settings['view options'];
  4616. if (viewOpts) {
  4617. utils.shallowCopy(opts, viewOpts);
  4618. }
  4619. }
  4620. // Express 2 and lower, values set in app.locals, or people who just
  4621. // want to pass options in their data. NOTE: These values will override
  4622. // anything previously set in settings or settings['view options']
  4623. utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);
  4624. }
  4625. opts.filename = filename;
  4626. }
  4627. else {
  4628. data = {};
  4629. }
  4630.  
  4631. return tryHandleCache(opts, data, cb);
  4632. };
  4633.  
  4634. /**
  4635. * Clear intermediate JavaScript cache. Calls {@link Cache#reset}.
  4636. * @public
  4637. */
  4638.  
  4639. /**
  4640. * EJS template class
  4641. * @public
  4642. */
  4643. exports.Template = Template;
  4644.  
  4645. exports.clearCache = function () {
  4646. exports.cache.reset();
  4647. };
  4648.  
  4649. function Template(text, opts) {
  4650. opts = opts || {};
  4651. var options = {};
  4652. this.templateText = text;
  4653. /** @type {string | null} */
  4654. this.mode = null;
  4655. this.truncate = false;
  4656. this.currentLine = 1;
  4657. this.source = '';
  4658. options.client = opts.client || false;
  4659. options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;
  4660. options.compileDebug = opts.compileDebug !== false;
  4661. options.debug = !!opts.debug;
  4662. options.filename = opts.filename;
  4663. options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER;
  4664. options.closeDelimiter = opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
  4665. options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;
  4666. options.strict = opts.strict || false;
  4667. options.context = opts.context;
  4668. options.cache = opts.cache || false;
  4669. options.rmWhitespace = opts.rmWhitespace;
  4670. options.root = opts.root;
  4671. options.includer = opts.includer;
  4672. options.outputFunctionName = opts.outputFunctionName;
  4673. options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME;
  4674. options.views = opts.views;
  4675. options.async = opts.async;
  4676. options.destructuredLocals = opts.destructuredLocals;
  4677. options.legacyInclude = typeof opts.legacyInclude != 'undefined' ? !!opts.legacyInclude : true;
  4678.  
  4679. if (options.strict) {
  4680. options._with = false;
  4681. }
  4682. else {
  4683. options._with = typeof opts._with != 'undefined' ? opts._with : true;
  4684. }
  4685.  
  4686. this.opts = options;
  4687.  
  4688. this.regex = this.createRegex();
  4689. }
  4690.  
  4691. Template.modes = {
  4692. EVAL: 'eval',
  4693. ESCAPED: 'escaped',
  4694. RAW: 'raw',
  4695. COMMENT: 'comment',
  4696. LITERAL: 'literal'
  4697. };
  4698.  
  4699. Template.prototype = {
  4700. createRegex: function () {
  4701. var str = _REGEX_STRING;
  4702. var delim = utils.escapeRegExpChars(this.opts.delimiter);
  4703. var open = utils.escapeRegExpChars(this.opts.openDelimiter);
  4704. var close = utils.escapeRegExpChars(this.opts.closeDelimiter);
  4705. str = str.replace(/%/g, delim)
  4706. .replace(/</g, open)
  4707. .replace(/>/g, close);
  4708. return new RegExp(str);
  4709. },
  4710.  
  4711. compile: function () {
  4712. /** @type {string} */
  4713. var src;
  4714. /** @type {ClientFunction} */
  4715. var fn;
  4716. var opts = this.opts;
  4717. var prepended = '';
  4718. var appended = '';
  4719. /** @type {EscapeCallback} */
  4720. var escapeFn = opts.escapeFunction;
  4721. /** @type {FunctionConstructor} */
  4722. var ctor;
  4723. /** @type {string} */
  4724. var sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : 'undefined';
  4725.  
  4726. if (!this.source) {
  4727. this.generateSource();
  4728. prepended +=
  4729. ' var __output = "";\n' +
  4730. ' function __append(s) { if (s !== undefined && s !== null) __output += s }\n';
  4731. if (opts.outputFunctionName) {
  4732. prepended += ' var ' + opts.outputFunctionName + ' = __append;' + '\n';
  4733. }
  4734. if (opts.destructuredLocals && opts.destructuredLocals.length) {
  4735. var destructuring = ' var __locals = (' + opts.localsName + ' || {}),\n';
  4736. for (var i = 0; i < opts.destructuredLocals.length; i++) {
  4737. var name = opts.destructuredLocals[i];
  4738. if (i > 0) {
  4739. destructuring += ',\n ';
  4740. }
  4741. destructuring += name + ' = __locals.' + name;
  4742. }
  4743. prepended += destructuring + ';\n';
  4744. }
  4745. if (opts._with !== false) {
  4746. prepended += ' with (' + opts.localsName + ' || {}) {' + '\n';
  4747. appended += ' }' + '\n';
  4748. }
  4749. appended += ' return __output;' + '\n';
  4750. this.source = prepended + this.source + appended;
  4751. }
  4752.  
  4753. if (opts.compileDebug) {
  4754. src = 'var __line = 1' + '\n'
  4755. + ' , __lines = ' + JSON.stringify(this.templateText) + '\n'
  4756. + ' , __filename = ' + sanitizedFilename + ';' + '\n'
  4757. + 'try {' + '\n'
  4758. + this.source
  4759. + '} catch (e) {' + '\n'
  4760. + ' rethrow(e, __lines, __filename, __line, escapeFn);' + '\n'
  4761. + '}' + '\n';
  4762. }
  4763. else {
  4764. src = this.source;
  4765. }
  4766.  
  4767. if (opts.client) {
  4768. src = 'escapeFn = escapeFn || ' + escapeFn.toString() + ';' + '\n' + src;
  4769. if (opts.compileDebug) {
  4770. src = 'rethrow = rethrow || ' + rethrow.toString() + ';' + '\n' + src;
  4771. }
  4772. }
  4773.  
  4774. if (opts.strict) {
  4775. src = '"use strict";\n' + src;
  4776. }
  4777. if (opts.debug) {
  4778. console.log(src);
  4779. }
  4780. if (opts.compileDebug && opts.filename) {
  4781. src = src + '\n'
  4782. + '//# sourceURL=' + sanitizedFilename + '\n';
  4783. }
  4784.  
  4785. try {
  4786. if (opts.async) {
  4787. // Have to use generated function for this, since in envs without support,
  4788. // it breaks in parsing
  4789. try {
  4790. ctor = (new Function('return (async function(){}).constructor;'))();
  4791. }
  4792. catch(e) {
  4793. if (e instanceof SyntaxError) {
  4794. throw new Error('This environment does not support async/await');
  4795. }
  4796. else {
  4797. throw e;
  4798. }
  4799. }
  4800. }
  4801. else {
  4802. ctor = Function;
  4803. }
  4804. fn = new ctor(opts.localsName + ', escapeFn, include, rethrow', src);
  4805. }
  4806. catch(e) {
  4807. // istanbul ignore else
  4808. if (e instanceof SyntaxError) {
  4809. if (opts.filename) {
  4810. e.message += ' in ' + opts.filename;
  4811. }
  4812. e.message += ' while compiling ejs\n\n';
  4813. e.message += 'If the above error is not helpful, you may want to try EJS-Lint:\n';
  4814. e.message += 'https://github.com/RyanZim/EJS-Lint';
  4815. if (!opts.async) {
  4816. e.message += '\n';
  4817. e.message += 'Or, if you meant to create an async function, pass `async: true` as an option.';
  4818. }
  4819. }
  4820. throw e;
  4821. }
  4822.  
  4823. // Return a callable function which will execute the function
  4824. // created by the source-code, with the passed data as locals
  4825. // Adds a local `include` function which allows full recursive include
  4826. var returnedFn = opts.client ? fn : function anonymous(data) {
  4827. var include = function (path, includeData) {
  4828. var d = utils.shallowCopy({}, data);
  4829. if (includeData) {
  4830. d = utils.shallowCopy(d, includeData);
  4831. }
  4832. return includeFile(path, opts)(d);
  4833. };
  4834. return fn.apply(opts.context, [data || {}, escapeFn, include, rethrow]);
  4835. };
  4836. if (opts.filename && typeof Object.defineProperty === 'function') {
  4837. var filename = opts.filename;
  4838. var basename = path.basename(filename, path.extname(filename));
  4839. try {
  4840. Object.defineProperty(returnedFn, 'name', {
  4841. value: basename,
  4842. writable: false,
  4843. enumerable: false,
  4844. configurable: true
  4845. });
  4846. } catch (e) {/* ignore */}
  4847. }
  4848. return returnedFn;
  4849. },
  4850.  
  4851. generateSource: function () {
  4852. var opts = this.opts;
  4853.  
  4854. if (opts.rmWhitespace) {
  4855. // Have to use two separate replace here as `^` and `$` operators don't
  4856. // work well with `\r` and empty lines don't work well with the `m` flag.
  4857. this.templateText =
  4858. this.templateText.replace(/[\r\n]+/g, '\n').replace(/^\s+|\s+$/gm, '');
  4859. }
  4860.  
  4861. // Slurp spaces and tabs before <%_ and after _%>
  4862. this.templateText =
  4863. this.templateText.replace(/[ \t]*<%_/gm, '<%_').replace(/_%>[ \t]*/gm, '_%>');
  4864.  
  4865. var self = this;
  4866. var matches = this.parseTemplateText();
  4867. var d = this.opts.delimiter;
  4868. var o = this.opts.openDelimiter;
  4869. var c = this.opts.closeDelimiter;
  4870.  
  4871. if (matches && matches.length) {
  4872. matches.forEach(function (line, index) {
  4873. var closing;
  4874. // If this is an opening tag, check for closing tags
  4875. // FIXME: May end up with some false positives here
  4876. // Better to store modes as k/v with openDelimiter + delimiter as key
  4877. // Then this can simply check against the map
  4878. if ( line.indexOf(o + d) === 0 // If it is a tag
  4879. && line.indexOf(o + d + d) !== 0) { // and is not escaped
  4880. closing = matches[index + 2];
  4881. if (!(closing == d + c || closing == '-' + d + c || closing == '_' + d + c)) {
  4882. throw new Error('Could not find matching close tag for "' + line + '".');
  4883. }
  4884. }
  4885. self.scanLine(line);
  4886. });
  4887. }
  4888.  
  4889. },
  4890.  
  4891. parseTemplateText: function () {
  4892. var str = this.templateText;
  4893. var pat = this.regex;
  4894. var result = pat.exec(str);
  4895. var arr = [];
  4896. var firstPos;
  4897.  
  4898. while (result) {
  4899. firstPos = result.index;
  4900.  
  4901. if (firstPos !== 0) {
  4902. arr.push(str.substring(0, firstPos));
  4903. str = str.slice(firstPos);
  4904. }
  4905.  
  4906. arr.push(result[0]);
  4907. str = str.slice(result[0].length);
  4908. result = pat.exec(str);
  4909. }
  4910.  
  4911. if (str) {
  4912. arr.push(str);
  4913. }
  4914.  
  4915. return arr;
  4916. },
  4917.  
  4918. _addOutput: function (line) {
  4919. if (this.truncate) {
  4920. // Only replace single leading linebreak in the line after
  4921. // -%> tag -- this is the single, trailing linebreak
  4922. // after the tag that the truncation mode replaces
  4923. // Handle Win / Unix / old Mac linebreaks -- do the \r\n
  4924. // combo first in the regex-or
  4925. line = line.replace(/^(?:\r\n|\r|\n)/, '');
  4926. this.truncate = false;
  4927. }
  4928. if (!line) {
  4929. return line;
  4930. }
  4931.  
  4932. // Preserve literal slashes
  4933. line = line.replace(/\\/g, '\\\\');
  4934.  
  4935. // Convert linebreaks
  4936. line = line.replace(/\n/g, '\\n');
  4937. line = line.replace(/\r/g, '\\r');
  4938.  
  4939. // Escape double-quotes
  4940. // - this will be the delimiter during execution
  4941. line = line.replace(/"/g, '\\"');
  4942. this.source += ' ; __append("' + line + '")' + '\n';
  4943. },
  4944.  
  4945. scanLine: function (line) {
  4946. var self = this;
  4947. var d = this.opts.delimiter;
  4948. var o = this.opts.openDelimiter;
  4949. var c = this.opts.closeDelimiter;
  4950. var newLineCount = 0;
  4951.  
  4952. newLineCount = (line.split('\n').length - 1);
  4953.  
  4954. switch (line) {
  4955. case o + d:
  4956. case o + d + '_':
  4957. this.mode = Template.modes.EVAL;
  4958. break;
  4959. case o + d + '=':
  4960. this.mode = Template.modes.ESCAPED;
  4961. break;
  4962. case o + d + '-':
  4963. this.mode = Template.modes.RAW;
  4964. break;
  4965. case o + d + '#':
  4966. this.mode = Template.modes.COMMENT;
  4967. break;
  4968. case o + d + d:
  4969. this.mode = Template.modes.LITERAL;
  4970. this.source += ' ; __append("' + line.replace(o + d + d, o + d) + '")' + '\n';
  4971. break;
  4972. case d + d + c:
  4973. this.mode = Template.modes.LITERAL;
  4974. this.source += ' ; __append("' + line.replace(d + d + c, d + c) + '")' + '\n';
  4975. break;
  4976. case d + c:
  4977. case '-' + d + c:
  4978. case '_' + d + c:
  4979. if (this.mode == Template.modes.LITERAL) {
  4980. this._addOutput(line);
  4981. }
  4982.  
  4983. this.mode = null;
  4984. this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0;
  4985. break;
  4986. default:
  4987. // In script mode, depends on type of tag
  4988. if (this.mode) {
  4989. // If '//' is found without a line break, add a line break.
  4990. switch (this.mode) {
  4991. case Template.modes.EVAL:
  4992. case Template.modes.ESCAPED:
  4993. case Template.modes.RAW:
  4994. if (line.lastIndexOf('//') > line.lastIndexOf('\n')) {
  4995. line += '\n';
  4996. }
  4997. }
  4998. switch (this.mode) {
  4999. // Just executing code
  5000. case Template.modes.EVAL:
  5001. this.source += ' ; ' + line + '\n';
  5002. break;
  5003. // Exec, esc, and output
  5004. case Template.modes.ESCAPED:
  5005. this.source += ' ; __append(escapeFn(' + stripSemi(line) + '))' + '\n';
  5006. break;
  5007. // Exec and output
  5008. case Template.modes.RAW:
  5009. this.source += ' ; __append(' + stripSemi(line) + ')' + '\n';
  5010. break;
  5011. case Template.modes.COMMENT:
  5012. // Do nothing
  5013. break;
  5014. // Literal <%% mode, append as raw output
  5015. case Template.modes.LITERAL:
  5016. this._addOutput(line);
  5017. break;
  5018. }
  5019. }
  5020. // In string mode, just add the output
  5021. else {
  5022. this._addOutput(line);
  5023. }
  5024. }
  5025.  
  5026. if (self.opts.compileDebug && newLineCount) {
  5027. this.currentLine += newLineCount;
  5028. this.source += ' ; __line = ' + this.currentLine + '\n';
  5029. }
  5030. }
  5031. };
  5032.  
  5033. /**
  5034. * Escape characters reserved in XML.
  5035. *
  5036. * This is simply an export of {@link module:utils.escapeXML}.
  5037. *
  5038. * If `markup` is `undefined` or `null`, the empty string is returned.
  5039. *
  5040. * @param {String} markup Input string
  5041. * @return {String} Escaped string
  5042. * @public
  5043. * @func
  5044. * */
  5045. exports.escapeXML = utils.escapeXML;
  5046.  
  5047. /**
  5048. * Express.js support.
  5049. *
  5050. * This is an alias for {@link module:ejs.renderFile}, in order to support
  5051. * Express.js out-of-the-box.
  5052. *
  5053. * @func
  5054. */
  5055.  
  5056. exports.__express = exports.renderFile;
  5057.  
  5058. /**
  5059. * Version of EJS.
  5060. *
  5061. * @readonly
  5062. * @type {String}
  5063. * @public
  5064. */
  5065.  
  5066. exports.VERSION = _VERSION_STRING;
  5067.  
  5068. /**
  5069. * Name for detection of EJS.
  5070. *
  5071. * @readonly
  5072. * @type {String}
  5073. * @public
  5074. */
  5075.  
  5076. exports.name = _NAME;
  5077.  
  5078. /* istanbul ignore if */
  5079. if (typeof window != 'undefined') {
  5080. window.ejs = exports;
  5081. }
  5082.  
  5083. },{"../package.json":6,"./utils":2,"fs":3,"path":4}],2:[function(require,module,exports){
  5084. /*
  5085. * EJS Embedded JavaScript templates
  5086. * Copyright 2112 Matthew Eernisse (mde@fleegix.org)
  5087. *
  5088. * Licensed under the Apache License, Version 2.0 (the "License");
  5089. * you may not use this file except in compliance with the License.
  5090. * You may obtain a copy of the License at
  5091. *
  5092. * http://www.apache.org/licenses/LICENSE-2.0
  5093. *
  5094. * Unless required by applicable law or agreed to in writing, software
  5095. * distributed under the License is distributed on an "AS IS" BASIS,
  5096. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5097. * See the License for the specific language governing permissions and
  5098. * limitations under the License.
  5099. *
  5100. */
  5101.  
  5102. /**
  5103. * Private utility functions
  5104. * @module utils
  5105. * @private
  5106. */
  5107.  
  5108. 'use strict';
  5109.  
  5110. var regExpChars = /[|\\{}()[\]^$+*?.]/g;
  5111.  
  5112. /**
  5113. * Escape characters reserved in regular expressions.
  5114. *
  5115. * If `string` is `undefined` or `null`, the empty string is returned.
  5116. *
  5117. * @param {String} string Input string
  5118. * @return {String} Escaped string
  5119. * @static
  5120. * @private
  5121. */
  5122. exports.escapeRegExpChars = function (string) {
  5123. // istanbul ignore if
  5124. if (!string) {
  5125. return '';
  5126. }
  5127. return String(string).replace(regExpChars, '\\$&');
  5128. };
  5129.  
  5130. var _ENCODE_HTML_RULES = {
  5131. '&': '&amp;',
  5132. '<': '&lt;',
  5133. '>': '&gt;',
  5134. '"': '&#34;',
  5135. "'": '&#39;'
  5136. };
  5137. var _MATCH_HTML = /[&<>'"]/g;
  5138.  
  5139. function encode_char(c) {
  5140. return _ENCODE_HTML_RULES[c] || c;
  5141. }
  5142.  
  5143. /**
  5144. * Stringified version of constants used by {@link module:utils.escapeXML}.
  5145. *
  5146. * It is used in the process of generating {@link ClientFunction}s.
  5147. *
  5148. * @readonly
  5149. * @type {String}
  5150. */
  5151.  
  5152. var escapeFuncStr =
  5153. 'var _ENCODE_HTML_RULES = {\n'
  5154. + ' "&": "&amp;"\n'
  5155. + ' , "<": "&lt;"\n'
  5156. + ' , ">": "&gt;"\n'
  5157. + ' , \'"\': "&#34;"\n'
  5158. + ' , "\'": "&#39;"\n'
  5159. + ' }\n'
  5160. + ' , _MATCH_HTML = /[&<>\'"]/g;\n'
  5161. + 'function encode_char(c) {\n'
  5162. + ' return _ENCODE_HTML_RULES[c] || c;\n'
  5163. + '};\n';
  5164.  
  5165. /**
  5166. * Escape characters reserved in XML.
  5167. *
  5168. * If `markup` is `undefined` or `null`, the empty string is returned.
  5169. *
  5170. * @implements {EscapeCallback}
  5171. * @param {String} markup Input string
  5172. * @return {String} Escaped string
  5173. * @static
  5174. * @private
  5175. */
  5176.  
  5177. exports.escapeXML = function (markup) {
  5178. return markup == undefined
  5179. ? ''
  5180. : String(markup)
  5181. .replace(_MATCH_HTML, encode_char);
  5182. };
  5183. exports.escapeXML.toString = function () {
  5184. return Function.prototype.toString.call(this) + ';\n' + escapeFuncStr;
  5185. };
  5186.  
  5187. /**
  5188. * Naive copy of properties from one object to another.
  5189. * Does not recurse into non-scalar properties
  5190. * Does not check to see if the property has a value before copying
  5191. *
  5192. * @param {Object} to Destination object
  5193. * @param {Object} from Source object
  5194. * @return {Object} Destination object
  5195. * @static
  5196. * @private
  5197. */
  5198. exports.shallowCopy = function (to, from) {
  5199. from = from || {};
  5200. for (var p in from) {
  5201. to[p] = from[p];
  5202. }
  5203. return to;
  5204. };
  5205.  
  5206. /**
  5207. * Naive copy of a list of key names, from one object to another.
  5208. * Only copies property if it is actually defined
  5209. * Does not recurse into non-scalar properties
  5210. *
  5211. * @param {Object} to Destination object
  5212. * @param {Object} from Source object
  5213. * @param {Array} list List of properties to copy
  5214. * @return {Object} Destination object
  5215. * @static
  5216. * @private
  5217. */
  5218. exports.shallowCopyFromList = function (to, from, list) {
  5219. for (var i = 0; i < list.length; i++) {
  5220. var p = list[i];
  5221. if (typeof from[p] != 'undefined') {
  5222. to[p] = from[p];
  5223. }
  5224. }
  5225. return to;
  5226. };
  5227.  
  5228. /**
  5229. * Simple in-process cache implementation. Does not implement limits of any
  5230. * sort.
  5231. *
  5232. * @implements {Cache}
  5233. * @static
  5234. * @private
  5235. */
  5236. exports.cache = {
  5237. _data: {},
  5238. set: function (key, val) {
  5239. this._data[key] = val;
  5240. },
  5241. get: function (key) {
  5242. return this._data[key];
  5243. },
  5244. remove: function (key) {
  5245. delete this._data[key];
  5246. },
  5247. reset: function () {
  5248. this._data = {};
  5249. }
  5250. };
  5251.  
  5252. /**
  5253. * Transforms hyphen case variable into camel case.
  5254. *
  5255. * @param {String} string Hyphen case string
  5256. * @return {String} Camel case string
  5257. * @static
  5258. * @private
  5259. */
  5260. exports.hyphenToCamel = function (str) {
  5261. return str.replace(/-[a-z]/g, function (match) { return match[1].toUpperCase(); });
  5262. };
  5263.  
  5264. },{}],3:[function(require,module,exports){
  5265.  
  5266. },{}],4:[function(require,module,exports){
  5267. (function (process){
  5268. // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  5269. // backported and transplited with Babel, with backwards-compat fixes
  5270.  
  5271. // Copyright Joyent, Inc. and other Node contributors.
  5272. //
  5273. // Permission is hereby granted, free of charge, to any person obtaining a
  5274. // copy of this software and associated documentation files (the
  5275. // "Software"), to deal in the Software without restriction, including
  5276. // without limitation the rights to use, copy, modify, merge, publish,
  5277. // distribute, sublicense, and/or sell copies of the Software, and to permit
  5278. // persons to whom the Software is furnished to do so, subject to the
  5279. // following conditions:
  5280. //
  5281. // The above copyright notice and this permission notice shall be included
  5282. // in all copies or substantial portions of the Software.
  5283. //
  5284. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  5285. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  5286. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  5287. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  5288. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  5289. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  5290. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  5291.  
  5292. // resolves . and .. elements in a path array with directory names there
  5293. // must be no slashes, empty elements, or device names (c:\) in the array
  5294. // (so also no leading and trailing slashes - it does not distinguish
  5295. // relative and absolute paths)
  5296. function normalizeArray(parts, allowAboveRoot) {
  5297. // if the path tries to go above the root, `up` ends up > 0
  5298. var up = 0;
  5299. for (var i = parts.length - 1; i >= 0; i--) {
  5300. var last = parts[i];
  5301. if (last === '.') {
  5302. parts.splice(i, 1);
  5303. } else if (last === '..') {
  5304. parts.splice(i, 1);
  5305. up++;
  5306. } else if (up) {
  5307. parts.splice(i, 1);
  5308. up--;
  5309. }
  5310. }
  5311.  
  5312. // if the path is allowed to go above the root, restore leading ..s
  5313. if (allowAboveRoot) {
  5314. for (; up--; up) {
  5315. parts.unshift('..');
  5316. }
  5317. }
  5318.  
  5319. return parts;
  5320. }
  5321.  
  5322. // path.resolve([from ...], to)
  5323. // posix version
  5324. exports.resolve = function() {
  5325. var resolvedPath = '',
  5326. resolvedAbsolute = false;
  5327.  
  5328. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  5329. var path = (i >= 0) ? arguments[i] : process.cwd();
  5330.  
  5331. // Skip empty and invalid entries
  5332. if (typeof path !== 'string') {
  5333. throw new TypeError('Arguments to path.resolve must be strings');
  5334. } else if (!path) {
  5335. continue;
  5336. }
  5337.  
  5338. resolvedPath = path + '/' + resolvedPath;
  5339. resolvedAbsolute = path.charAt(0) === '/';
  5340. }
  5341.  
  5342. // At this point the path should be resolved to a full absolute path, but
  5343. // handle relative paths to be safe (might happen when process.cwd() fails)
  5344.  
  5345. // Normalize the path
  5346. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  5347. return !!p;
  5348. }), !resolvedAbsolute).join('/');
  5349.  
  5350. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  5351. };
  5352.  
  5353. // path.normalize(path)
  5354. // posix version
  5355. exports.normalize = function(path) {
  5356. var isAbsolute = exports.isAbsolute(path),
  5357. trailingSlash = substr(path, -1) === '/';
  5358.  
  5359. // Normalize the path
  5360. path = normalizeArray(filter(path.split('/'), function(p) {
  5361. return !!p;
  5362. }), !isAbsolute).join('/');
  5363.  
  5364. if (!path && !isAbsolute) {
  5365. path = '.';
  5366. }
  5367. if (path && trailingSlash) {
  5368. path += '/';
  5369. }
  5370.  
  5371. return (isAbsolute ? '/' : '') + path;
  5372. };
  5373.  
  5374. // posix version
  5375. exports.isAbsolute = function(path) {
  5376. return path.charAt(0) === '/';
  5377. };
  5378.  
  5379. // posix version
  5380. exports.join = function() {
  5381. var paths = Array.prototype.slice.call(arguments, 0);
  5382. return exports.normalize(filter(paths, function(p, index) {
  5383. if (typeof p !== 'string') {
  5384. throw new TypeError('Arguments to path.join must be strings');
  5385. }
  5386. return p;
  5387. }).join('/'));
  5388. };
  5389.  
  5390.  
  5391. // path.relative(from, to)
  5392. // posix version
  5393. exports.relative = function(from, to) {
  5394. from = exports.resolve(from).substr(1);
  5395. to = exports.resolve(to).substr(1);
  5396.  
  5397. function trim(arr) {
  5398. var start = 0;
  5399. for (; start < arr.length; start++) {
  5400. if (arr[start] !== '') break;
  5401. }
  5402.  
  5403. var end = arr.length - 1;
  5404. for (; end >= 0; end--) {
  5405. if (arr[end] !== '') break;
  5406. }
  5407.  
  5408. if (start > end) return [];
  5409. return arr.slice(start, end - start + 1);
  5410. }
  5411.  
  5412. var fromParts = trim(from.split('/'));
  5413. var toParts = trim(to.split('/'));
  5414.  
  5415. var length = Math.min(fromParts.length, toParts.length);
  5416. var samePartsLength = length;
  5417. for (var i = 0; i < length; i++) {
  5418. if (fromParts[i] !== toParts[i]) {
  5419. samePartsLength = i;
  5420. break;
  5421. }
  5422. }
  5423.  
  5424. var outputParts = [];
  5425. for (var i = samePartsLength; i < fromParts.length; i++) {
  5426. outputParts.push('..');
  5427. }
  5428.  
  5429. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  5430.  
  5431. return outputParts.join('/');
  5432. };
  5433.  
  5434. exports.sep = '/';
  5435. exports.delimiter = ':';
  5436.  
  5437. exports.dirname = function (path) {
  5438. if (typeof path !== 'string') path = path + '';
  5439. if (path.length === 0) return '.';
  5440. var code = path.charCodeAt(0);
  5441. var hasRoot = code === 47 /*/*/;
  5442. var end = -1;
  5443. var matchedSlash = true;
  5444. for (var i = path.length - 1; i >= 1; --i) {
  5445. code = path.charCodeAt(i);
  5446. if (code === 47 /*/*/) {
  5447. if (!matchedSlash) {
  5448. end = i;
  5449. break;
  5450. }
  5451. } else {
  5452. // We saw the first non-path separator
  5453. matchedSlash = false;
  5454. }
  5455. }
  5456.  
  5457. if (end === -1) return hasRoot ? '/' : '.';
  5458. if (hasRoot && end === 1) {
  5459. // return '//';
  5460. // Backwards-compat fix:
  5461. return '/';
  5462. }
  5463. return path.slice(0, end);
  5464. };
  5465.  
  5466. function basename(path) {
  5467. if (typeof path !== 'string') path = path + '';
  5468.  
  5469. var start = 0;
  5470. var end = -1;
  5471. var matchedSlash = true;
  5472. var i;
  5473.  
  5474. for (i = path.length - 1; i >= 0; --i) {
  5475. if (path.charCodeAt(i) === 47 /*/*/) {
  5476. // If we reached a path separator that was not part of a set of path
  5477. // separators at the end of the string, stop now
  5478. if (!matchedSlash) {
  5479. start = i + 1;
  5480. break;
  5481. }
  5482. } else if (end === -1) {
  5483. // We saw the first non-path separator, mark this as the end of our
  5484. // path component
  5485. matchedSlash = false;
  5486. end = i + 1;
  5487. }
  5488. }
  5489.  
  5490. if (end === -1) return '';
  5491. return path.slice(start, end);
  5492. }
  5493.  
  5494. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  5495. // in new Node.js versions, so only basename() above is backported here
  5496. exports.basename = function (path, ext) {
  5497. var f = basename(path);
  5498. if (ext && f.substr(-1 * ext.length) === ext) {
  5499. f = f.substr(0, f.length - ext.length);
  5500. }
  5501. return f;
  5502. };
  5503.  
  5504. exports.extname = function (path) {
  5505. if (typeof path !== 'string') path = path + '';
  5506. var startDot = -1;
  5507. var startPart = 0;
  5508. var end = -1;
  5509. var matchedSlash = true;
  5510. // Track the state of characters (if any) we see before our first dot and
  5511. // after any path separator we find
  5512. var preDotState = 0;
  5513. for (var i = path.length - 1; i >= 0; --i) {
  5514. var code = path.charCodeAt(i);
  5515. if (code === 47 /*/*/) {
  5516. // If we reached a path separator that was not part of a set of path
  5517. // separators at the end of the string, stop now
  5518. if (!matchedSlash) {
  5519. startPart = i + 1;
  5520. break;
  5521. }
  5522. continue;
  5523. }
  5524. if (end === -1) {
  5525. // We saw the first non-path separator, mark this as the end of our
  5526. // extension
  5527. matchedSlash = false;
  5528. end = i + 1;
  5529. }
  5530. if (code === 46 /*.*/) {
  5531. // If this is our first dot, mark it as the start of our extension
  5532. if (startDot === -1)
  5533. startDot = i;
  5534. else if (preDotState !== 1)
  5535. preDotState = 1;
  5536. } else if (startDot !== -1) {
  5537. // We saw a non-dot and non-path separator before our dot, so we should
  5538. // have a good chance at having a non-empty extension
  5539. preDotState = -1;
  5540. }
  5541. }
  5542.  
  5543. if (startDot === -1 || end === -1 ||
  5544. // We saw a non-dot character immediately before the dot
  5545. preDotState === 0 ||
  5546. // The (right-most) trimmed path component is exactly '..'
  5547. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  5548. return '';
  5549. }
  5550. return path.slice(startDot, end);
  5551. };
  5552.  
  5553. function filter (xs, f) {
  5554. if (xs.filter) return xs.filter(f);
  5555. var res = [];
  5556. for (var i = 0; i < xs.length; i++) {
  5557. if (f(xs[i], i, xs)) res.push(xs[i]);
  5558. }
  5559. return res;
  5560. }
  5561.  
  5562. // String.prototype.substr - negative index don't work in IE8
  5563. var substr = true
  5564. ? function (str, start, len) { return str.substr(start, len) }
  5565. : 0
  5566. ;
  5567.  
  5568. }).call(this,require('_process'))
  5569. },{"_process":5}],5:[function(require,module,exports){
  5570. // shim for using process in browser
  5571. var process = module.exports = {};
  5572.  
  5573. // cached from whatever global is present so that test runners that stub it
  5574. // don't break things. But we need to wrap it in a try catch in case it is
  5575. // wrapped in strict mode code which doesn't define any globals. It's inside a
  5576. // function because try/catches deoptimize in certain engines.
  5577.  
  5578. var cachedSetTimeout;
  5579. var cachedClearTimeout;
  5580.  
  5581. function defaultSetTimout() {
  5582. throw new Error('setTimeout has not been defined');
  5583. }
  5584. function defaultClearTimeout () {
  5585. throw new Error('clearTimeout has not been defined');
  5586. }
  5587. (function () {
  5588. try {
  5589. if (typeof setTimeout === 'function') {
  5590. cachedSetTimeout = setTimeout;
  5591. } else {
  5592. cachedSetTimeout = defaultSetTimout;
  5593. }
  5594. } catch (e) {
  5595. cachedSetTimeout = defaultSetTimout;
  5596. }
  5597. try {
  5598. if (typeof clearTimeout === 'function') {
  5599. cachedClearTimeout = clearTimeout;
  5600. } else {
  5601. cachedClearTimeout = defaultClearTimeout;
  5602. }
  5603. } catch (e) {
  5604. cachedClearTimeout = defaultClearTimeout;
  5605. }
  5606. } ())
  5607. function runTimeout(fun) {
  5608. if (cachedSetTimeout === setTimeout) {
  5609. //normal enviroments in sane situations
  5610. return setTimeout(fun, 0);
  5611. }
  5612. // if setTimeout wasn't available but was latter defined
  5613. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  5614. cachedSetTimeout = setTimeout;
  5615. return setTimeout(fun, 0);
  5616. }
  5617. try {
  5618. // when when somebody has screwed with setTimeout but no I.E. maddness
  5619. return cachedSetTimeout(fun, 0);
  5620. } catch(e){
  5621. try {
  5622. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  5623. return cachedSetTimeout.call(null, fun, 0);
  5624. } catch(e){
  5625. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  5626. return cachedSetTimeout.call(this, fun, 0);
  5627. }
  5628. }
  5629.  
  5630.  
  5631. }
  5632. function runClearTimeout(marker) {
  5633. if (cachedClearTimeout === clearTimeout) {
  5634. //normal enviroments in sane situations
  5635. return clearTimeout(marker);
  5636. }
  5637. // if clearTimeout wasn't available but was latter defined
  5638. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  5639. cachedClearTimeout = clearTimeout;
  5640. return clearTimeout(marker);
  5641. }
  5642. try {
  5643. // when when somebody has screwed with setTimeout but no I.E. maddness
  5644. return cachedClearTimeout(marker);
  5645. } catch (e){
  5646. try {
  5647. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  5648. return cachedClearTimeout.call(null, marker);
  5649. } catch (e){
  5650. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  5651. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  5652. return cachedClearTimeout.call(this, marker);
  5653. }
  5654. }
  5655.  
  5656.  
  5657.  
  5658. }
  5659. var queue = [];
  5660. var draining = false;
  5661. var currentQueue;
  5662. var queueIndex = -1;
  5663.  
  5664. function cleanUpNextTick() {
  5665. if (!draining || !currentQueue) {
  5666. return;
  5667. }
  5668. draining = false;
  5669. if (currentQueue.length) {
  5670. queue = currentQueue.concat(queue);
  5671. } else {
  5672. queueIndex = -1;
  5673. }
  5674. if (queue.length) {
  5675. drainQueue();
  5676. }
  5677. }
  5678.  
  5679. function drainQueue() {
  5680. if (draining) {
  5681. return;
  5682. }
  5683. var timeout = runTimeout(cleanUpNextTick);
  5684. draining = true;
  5685.  
  5686. var len = queue.length;
  5687. while(len) {
  5688. currentQueue = queue;
  5689. queue = [];
  5690. while (++queueIndex < len) {
  5691. if (currentQueue) {
  5692. currentQueue[queueIndex].run();
  5693. }
  5694. }
  5695. queueIndex = -1;
  5696. len = queue.length;
  5697. }
  5698. currentQueue = null;
  5699. draining = false;
  5700. runClearTimeout(timeout);
  5701. }
  5702.  
  5703. process.nextTick = function (fun) {
  5704. var args = new Array(arguments.length - 1);
  5705. if (arguments.length > 1) {
  5706. for (var i = 1; i < arguments.length; i++) {
  5707. args[i - 1] = arguments[i];
  5708. }
  5709. }
  5710. queue.push(new Item(fun, args));
  5711. if (queue.length === 1 && !draining) {
  5712. runTimeout(drainQueue);
  5713. }
  5714. };
  5715.  
  5716. // v8 likes predictible objects
  5717. function Item(fun, array) {
  5718. this.fun = fun;
  5719. this.array = array;
  5720. }
  5721. Item.prototype.run = function () {
  5722. this.fun.apply(null, this.array);
  5723. };
  5724. process.title = 'browser';
  5725. process.browser = true;
  5726. process.env = {};
  5727. process.argv = [];
  5728. process.version = ''; // empty string to avoid regexp issues
  5729. process.versions = {};
  5730.  
  5731. function noop() {}
  5732.  
  5733. process.on = noop;
  5734. process.addListener = noop;
  5735. process.once = noop;
  5736. process.off = noop;
  5737. process.removeListener = noop;
  5738. process.removeAllListeners = noop;
  5739. process.emit = noop;
  5740. process.prependListener = noop;
  5741. process.prependOnceListener = noop;
  5742.  
  5743. process.listeners = function (name) { return [] }
  5744.  
  5745. process.binding = function (name) {
  5746. throw new Error('process.binding is not supported');
  5747. };
  5748.  
  5749. process.cwd = function () { return '/' };
  5750. process.chdir = function (dir) {
  5751. throw new Error('process.chdir is not supported');
  5752. };
  5753. process.umask = function() { return 0; };
  5754.  
  5755. },{}],6:[function(require,module,exports){
  5756. module.exports={
  5757. "name": "ejs",
  5758. "description": "Embedded JavaScript templates",
  5759. "keywords": [
  5760. "template",
  5761. "engine",
  5762. "ejs"
  5763. ],
  5764. "version": "3.1.6",
  5765. "author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
  5766. "license": "Apache-2.0",
  5767. "bin": {
  5768. "ejs": "./bin/cli.js"
  5769. },
  5770. "main": "./lib/ejs.js",
  5771. "jsdelivr": "ejs.min.js",
  5772. "unpkg": "ejs.min.js",
  5773. "repository": {
  5774. "type": "git",
  5775. "url": "git://github.com/mde/ejs.git"
  5776. },
  5777. "bugs": "https://github.com/mde/ejs/issues",
  5778. "homepage": "https://github.com/mde/ejs",
  5779. "dependencies": {
  5780. "jake": "^10.6.1"
  5781. },
  5782. "devDependencies": {
  5783. "browserify": "^16.5.1",
  5784. "eslint": "^6.8.0",
  5785. "git-directory-deploy": "^1.5.1",
  5786. "jsdoc": "^3.6.4",
  5787. "lru-cache": "^4.0.1",
  5788. "mocha": "^7.1.1",
  5789. "uglify-js": "^3.3.16"
  5790. },
  5791. "engines": {
  5792. "node": ">=0.10.0"
  5793. },
  5794. "scripts": {
  5795. "test": "mocha"
  5796. }
  5797. }
  5798.  
  5799. },{}]},{},[1])(1)
  5800. });
  5801.  
  5802.  
  5803. /***/ }),
  5804.  
  5805. /***/ 776:
  5806. /***/ ((module, exports) => {
  5807.  
  5808. exports = module.exports = SemVer
  5809.  
  5810. var debug
  5811. /* istanbul ignore next */
  5812. if (typeof process === 'object' &&
  5813. process.env &&
  5814. process.env.NODE_DEBUG &&
  5815. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  5816. debug = function () {
  5817. var args = Array.prototype.slice.call(arguments, 0)
  5818. args.unshift('SEMVER')
  5819. console.log.apply(console, args)
  5820. }
  5821. } else {
  5822. debug = function () {}
  5823. }
  5824.  
  5825. // Note: this is the semver.org version of the spec that it implements
  5826. // Not necessarily the package version of this code.
  5827. exports.SEMVER_SPEC_VERSION = '2.0.0'
  5828.  
  5829. var MAX_LENGTH = 256
  5830. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  5831. /* istanbul ignore next */ 9007199254740991
  5832.  
  5833. // Max safe segment length for coercion.
  5834. var MAX_SAFE_COMPONENT_LENGTH = 16
  5835.  
  5836. // The actual regexps go on exports.re
  5837. var re = exports.re = []
  5838. var src = exports.src = []
  5839. var t = exports.tokens = {}
  5840. var R = 0
  5841.  
  5842. function tok (n) {
  5843. t[n] = R++
  5844. }
  5845.  
  5846. // The following Regular Expressions can be used for tokenizing,
  5847. // validating, and parsing SemVer version strings.
  5848.  
  5849. // ## Numeric Identifier
  5850. // A single `0`, or a non-zero digit followed by zero or more digits.
  5851.  
  5852. tok('NUMERICIDENTIFIER')
  5853. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  5854. tok('NUMERICIDENTIFIERLOOSE')
  5855. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  5856.  
  5857. // ## Non-numeric Identifier
  5858. // Zero or more digits, followed by a letter or hyphen, and then zero or
  5859. // more letters, digits, or hyphens.
  5860.  
  5861. tok('NONNUMERICIDENTIFIER')
  5862. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  5863.  
  5864. // ## Main Version
  5865. // Three dot-separated numeric identifiers.
  5866.  
  5867. tok('MAINVERSION')
  5868. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  5869. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  5870. '(' + src[t.NUMERICIDENTIFIER] + ')'
  5871.  
  5872. tok('MAINVERSIONLOOSE')
  5873. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  5874. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  5875. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  5876.  
  5877. // ## Pre-release Version Identifier
  5878. // A numeric identifier, or a non-numeric identifier.
  5879.  
  5880. tok('PRERELEASEIDENTIFIER')
  5881. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  5882. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  5883.  
  5884. tok('PRERELEASEIDENTIFIERLOOSE')
  5885. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  5886. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  5887.  
  5888. // ## Pre-release Version
  5889. // Hyphen, followed by one or more dot-separated pre-release version
  5890. // identifiers.
  5891.  
  5892. tok('PRERELEASE')
  5893. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  5894. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  5895.  
  5896. tok('PRERELEASELOOSE')
  5897. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  5898. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  5899.  
  5900. // ## Build Metadata Identifier
  5901. // Any combination of digits, letters, or hyphens.
  5902.  
  5903. tok('BUILDIDENTIFIER')
  5904. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  5905.  
  5906. // ## Build Metadata
  5907. // Plus sign, followed by one or more period-separated build metadata
  5908. // identifiers.
  5909.  
  5910. tok('BUILD')
  5911. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  5912. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  5913.  
  5914. // ## Full Version String
  5915. // A main version, followed optionally by a pre-release version and
  5916. // build metadata.
  5917.  
  5918. // Note that the only major, minor, patch, and pre-release sections of
  5919. // the version string are capturing groups. The build metadata is not a
  5920. // capturing group, because it should not ever be used in version
  5921. // comparison.
  5922.  
  5923. tok('FULL')
  5924. tok('FULLPLAIN')
  5925. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  5926. src[t.PRERELEASE] + '?' +
  5927. src[t.BUILD] + '?'
  5928.  
  5929. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  5930.  
  5931. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  5932. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  5933. // common in the npm registry.
  5934. tok('LOOSEPLAIN')
  5935. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  5936. src[t.PRERELEASELOOSE] + '?' +
  5937. src[t.BUILD] + '?'
  5938.  
  5939. tok('LOOSE')
  5940. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  5941.  
  5942. tok('GTLT')
  5943. src[t.GTLT] = '((?:<|>)?=?)'
  5944.  
  5945. // Something like "2.*" or "1.2.x".
  5946. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  5947. // Only the first item is strictly required.
  5948. tok('XRANGEIDENTIFIERLOOSE')
  5949. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  5950. tok('XRANGEIDENTIFIER')
  5951. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  5952.  
  5953. tok('XRANGEPLAIN')
  5954. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  5955. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  5956. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  5957. '(?:' + src[t.PRERELEASE] + ')?' +
  5958. src[t.BUILD] + '?' +
  5959. ')?)?'
  5960.  
  5961. tok('XRANGEPLAINLOOSE')
  5962. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  5963. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  5964. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  5965. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  5966. src[t.BUILD] + '?' +
  5967. ')?)?'
  5968.  
  5969. tok('XRANGE')
  5970. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  5971. tok('XRANGELOOSE')
  5972. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  5973.  
  5974. // Coercion.
  5975. // Extract anything that could conceivably be a part of a valid semver
  5976. tok('COERCE')
  5977. src[t.COERCE] = '(^|[^\\d])' +
  5978. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  5979. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  5980. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  5981. '(?:$|[^\\d])'
  5982. tok('COERCERTL')
  5983. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  5984.  
  5985. // Tilde ranges.
  5986. // Meaning is "reasonably at or greater than"
  5987. tok('LONETILDE')
  5988. src[t.LONETILDE] = '(?:~>?)'
  5989.  
  5990. tok('TILDETRIM')
  5991. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  5992. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  5993. var tildeTrimReplace = '$1~'
  5994.  
  5995. tok('TILDE')
  5996. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  5997. tok('TILDELOOSE')
  5998. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  5999.  
  6000. // Caret ranges.
  6001. // Meaning is "at least and backwards compatible with"
  6002. tok('LONECARET')
  6003. src[t.LONECARET] = '(?:\\^)'
  6004.  
  6005. tok('CARETTRIM')
  6006. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  6007. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  6008. var caretTrimReplace = '$1^'
  6009.  
  6010. tok('CARET')
  6011. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  6012. tok('CARETLOOSE')
  6013. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  6014.  
  6015. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  6016. tok('COMPARATORLOOSE')
  6017. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  6018. tok('COMPARATOR')
  6019. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  6020.  
  6021. // An expression to strip any whitespace between the gtlt and the thing
  6022. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  6023. tok('COMPARATORTRIM')
  6024. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  6025. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  6026.  
  6027. // this one has to use the /g flag
  6028. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  6029. var comparatorTrimReplace = '$1$2$3'
  6030.  
  6031. // Something like `1.2.3 - 1.2.4`
  6032. // Note that these all use the loose form, because they'll be
  6033. // checked against either the strict or loose comparator form
  6034. // later.
  6035. tok('HYPHENRANGE')
  6036. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  6037. '\\s+-\\s+' +
  6038. '(' + src[t.XRANGEPLAIN] + ')' +
  6039. '\\s*$'
  6040.  
  6041. tok('HYPHENRANGELOOSE')
  6042. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  6043. '\\s+-\\s+' +
  6044. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  6045. '\\s*$'
  6046.  
  6047. // Star ranges basically just allow anything at all.
  6048. tok('STAR')
  6049. src[t.STAR] = '(<|>)?=?\\s*\\*'
  6050.  
  6051. // Compile to actual regexp objects.
  6052. // All are flag-free, unless they were created above with a flag.
  6053. for (var i = 0; i < R; i++) {
  6054. debug(i, src[i])
  6055. if (!re[i]) {
  6056. re[i] = new RegExp(src[i])
  6057. }
  6058. }
  6059.  
  6060. exports.parse = parse
  6061. function parse (version, options) {
  6062. if (!options || typeof options !== 'object') {
  6063. options = {
  6064. loose: !!options,
  6065. includePrerelease: false
  6066. }
  6067. }
  6068.  
  6069. if (version instanceof SemVer) {
  6070. return version
  6071. }
  6072.  
  6073. if (typeof version !== 'string') {
  6074. return null
  6075. }
  6076.  
  6077. if (version.length > MAX_LENGTH) {
  6078. return null
  6079. }
  6080.  
  6081. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  6082. if (!r.test(version)) {
  6083. return null
  6084. }
  6085.  
  6086. try {
  6087. return new SemVer(version, options)
  6088. } catch (er) {
  6089. return null
  6090. }
  6091. }
  6092.  
  6093. exports.valid = valid
  6094. function valid (version, options) {
  6095. var v = parse(version, options)
  6096. return v ? v.version : null
  6097. }
  6098.  
  6099. exports.clean = clean
  6100. function clean (version, options) {
  6101. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  6102. return s ? s.version : null
  6103. }
  6104.  
  6105. exports.SemVer = SemVer
  6106.  
  6107. function SemVer (version, options) {
  6108. if (!options || typeof options !== 'object') {
  6109. options = {
  6110. loose: !!options,
  6111. includePrerelease: false
  6112. }
  6113. }
  6114. if (version instanceof SemVer) {
  6115. if (version.loose === options.loose) {
  6116. return version
  6117. } else {
  6118. version = version.version
  6119. }
  6120. } else if (typeof version !== 'string') {
  6121. throw new TypeError('Invalid Version: ' + version)
  6122. }
  6123.  
  6124. if (version.length > MAX_LENGTH) {
  6125. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  6126. }
  6127.  
  6128. if (!(this instanceof SemVer)) {
  6129. return new SemVer(version, options)
  6130. }
  6131.  
  6132. debug('SemVer', version, options)
  6133. this.options = options
  6134. this.loose = !!options.loose
  6135.  
  6136. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  6137.  
  6138. if (!m) {
  6139. throw new TypeError('Invalid Version: ' + version)
  6140. }
  6141.  
  6142. this.raw = version
  6143.  
  6144. // these are actually numbers
  6145. this.major = +m[1]
  6146. this.minor = +m[2]
  6147. this.patch = +m[3]
  6148.  
  6149. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  6150. throw new TypeError('Invalid major version')
  6151. }
  6152.  
  6153. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  6154. throw new TypeError('Invalid minor version')
  6155. }
  6156.  
  6157. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  6158. throw new TypeError('Invalid patch version')
  6159. }
  6160.  
  6161. // numberify any prerelease numeric ids
  6162. if (!m[4]) {
  6163. this.prerelease = []
  6164. } else {
  6165. this.prerelease = m[4].split('.').map(function (id) {
  6166. if (/^[0-9]+$/.test(id)) {
  6167. var num = +id
  6168. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  6169. return num
  6170. }
  6171. }
  6172. return id
  6173. })
  6174. }
  6175.  
  6176. this.build = m[5] ? m[5].split('.') : []
  6177. this.format()
  6178. }
  6179.  
  6180. SemVer.prototype.format = function () {
  6181. this.version = this.major + '.' + this.minor + '.' + this.patch
  6182. if (this.prerelease.length) {
  6183. this.version += '-' + this.prerelease.join('.')
  6184. }
  6185. return this.version
  6186. }
  6187.  
  6188. SemVer.prototype.toString = function () {
  6189. return this.version
  6190. }
  6191.  
  6192. SemVer.prototype.compare = function (other) {
  6193. debug('SemVer.compare', this.version, this.options, other)
  6194. if (!(other instanceof SemVer)) {
  6195. other = new SemVer(other, this.options)
  6196. }
  6197.  
  6198. return this.compareMain(other) || this.comparePre(other)
  6199. }
  6200.  
  6201. SemVer.prototype.compareMain = function (other) {
  6202. if (!(other instanceof SemVer)) {
  6203. other = new SemVer(other, this.options)
  6204. }
  6205.  
  6206. return compareIdentifiers(this.major, other.major) ||
  6207. compareIdentifiers(this.minor, other.minor) ||
  6208. compareIdentifiers(this.patch, other.patch)
  6209. }
  6210.  
  6211. SemVer.prototype.comparePre = function (other) {
  6212. if (!(other instanceof SemVer)) {
  6213. other = new SemVer(other, this.options)
  6214. }
  6215.  
  6216. // NOT having a prerelease is > having one
  6217. if (this.prerelease.length && !other.prerelease.length) {
  6218. return -1
  6219. } else if (!this.prerelease.length && other.prerelease.length) {
  6220. return 1
  6221. } else if (!this.prerelease.length && !other.prerelease.length) {
  6222. return 0
  6223. }
  6224.  
  6225. var i = 0
  6226. do {
  6227. var a = this.prerelease[i]
  6228. var b = other.prerelease[i]
  6229. debug('prerelease compare', i, a, b)
  6230. if (a === undefined && b === undefined) {
  6231. return 0
  6232. } else if (b === undefined) {
  6233. return 1
  6234. } else if (a === undefined) {
  6235. return -1
  6236. } else if (a === b) {
  6237. continue
  6238. } else {
  6239. return compareIdentifiers(a, b)
  6240. }
  6241. } while (++i)
  6242. }
  6243.  
  6244. SemVer.prototype.compareBuild = function (other) {
  6245. if (!(other instanceof SemVer)) {
  6246. other = new SemVer(other, this.options)
  6247. }
  6248.  
  6249. var i = 0
  6250. do {
  6251. var a = this.build[i]
  6252. var b = other.build[i]
  6253. debug('prerelease compare', i, a, b)
  6254. if (a === undefined && b === undefined) {
  6255. return 0
  6256. } else if (b === undefined) {
  6257. return 1
  6258. } else if (a === undefined) {
  6259. return -1
  6260. } else if (a === b) {
  6261. continue
  6262. } else {
  6263. return compareIdentifiers(a, b)
  6264. }
  6265. } while (++i)
  6266. }
  6267.  
  6268. // preminor will bump the version up to the next minor release, and immediately
  6269. // down to pre-release. premajor and prepatch work the same way.
  6270. SemVer.prototype.inc = function (release, identifier) {
  6271. switch (release) {
  6272. case 'premajor':
  6273. this.prerelease.length = 0
  6274. this.patch = 0
  6275. this.minor = 0
  6276. this.major++
  6277. this.inc('pre', identifier)
  6278. break
  6279. case 'preminor':
  6280. this.prerelease.length = 0
  6281. this.patch = 0
  6282. this.minor++
  6283. this.inc('pre', identifier)
  6284. break
  6285. case 'prepatch':
  6286. // If this is already a prerelease, it will bump to the next version
  6287. // drop any prereleases that might already exist, since they are not
  6288. // relevant at this point.
  6289. this.prerelease.length = 0
  6290. this.inc('patch', identifier)
  6291. this.inc('pre', identifier)
  6292. break
  6293. // If the input is a non-prerelease version, this acts the same as
  6294. // prepatch.
  6295. case 'prerelease':
  6296. if (this.prerelease.length === 0) {
  6297. this.inc('patch', identifier)
  6298. }
  6299. this.inc('pre', identifier)
  6300. break
  6301.  
  6302. case 'major':
  6303. // If this is a pre-major version, bump up to the same major version.
  6304. // Otherwise increment major.
  6305. // 1.0.0-5 bumps to 1.0.0
  6306. // 1.1.0 bumps to 2.0.0
  6307. if (this.minor !== 0 ||
  6308. this.patch !== 0 ||
  6309. this.prerelease.length === 0) {
  6310. this.major++
  6311. }
  6312. this.minor = 0
  6313. this.patch = 0
  6314. this.prerelease = []
  6315. break
  6316. case 'minor':
  6317. // If this is a pre-minor version, bump up to the same minor version.
  6318. // Otherwise increment minor.
  6319. // 1.2.0-5 bumps to 1.2.0
  6320. // 1.2.1 bumps to 1.3.0
  6321. if (this.patch !== 0 || this.prerelease.length === 0) {
  6322. this.minor++
  6323. }
  6324. this.patch = 0
  6325. this.prerelease = []
  6326. break
  6327. case 'patch':
  6328. // If this is not a pre-release version, it will increment the patch.
  6329. // If it is a pre-release it will bump up to the same patch version.
  6330. // 1.2.0-5 patches to 1.2.0
  6331. // 1.2.0 patches to 1.2.1
  6332. if (this.prerelease.length === 0) {
  6333. this.patch++
  6334. }
  6335. this.prerelease = []
  6336. break
  6337. // This probably shouldn't be used publicly.
  6338. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  6339. case 'pre':
  6340. if (this.prerelease.length === 0) {
  6341. this.prerelease = [0]
  6342. } else {
  6343. var i = this.prerelease.length
  6344. while (--i >= 0) {
  6345. if (typeof this.prerelease[i] === 'number') {
  6346. this.prerelease[i]++
  6347. i = -2
  6348. }
  6349. }
  6350. if (i === -1) {
  6351. // didn't increment anything
  6352. this.prerelease.push(0)
  6353. }
  6354. }
  6355. if (identifier) {
  6356. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  6357. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  6358. if (this.prerelease[0] === identifier) {
  6359. if (isNaN(this.prerelease[1])) {
  6360. this.prerelease = [identifier, 0]
  6361. }
  6362. } else {
  6363. this.prerelease = [identifier, 0]
  6364. }
  6365. }
  6366. break
  6367.  
  6368. default:
  6369. throw new Error('invalid increment argument: ' + release)
  6370. }
  6371. this.format()
  6372. this.raw = this.version
  6373. return this
  6374. }
  6375.  
  6376. exports.inc = inc
  6377. function inc (version, release, loose, identifier) {
  6378. if (typeof (loose) === 'string') {
  6379. identifier = loose
  6380. loose = undefined
  6381. }
  6382.  
  6383. try {
  6384. return new SemVer(version, loose).inc(release, identifier).version
  6385. } catch (er) {
  6386. return null
  6387. }
  6388. }
  6389.  
  6390. exports.diff = diff
  6391. function diff (version1, version2) {
  6392. if (eq(version1, version2)) {
  6393. return null
  6394. } else {
  6395. var v1 = parse(version1)
  6396. var v2 = parse(version2)
  6397. var prefix = ''
  6398. if (v1.prerelease.length || v2.prerelease.length) {
  6399. prefix = 'pre'
  6400. var defaultResult = 'prerelease'
  6401. }
  6402. for (var key in v1) {
  6403. if (key === 'major' || key === 'minor' || key === 'patch') {
  6404. if (v1[key] !== v2[key]) {
  6405. return prefix + key
  6406. }
  6407. }
  6408. }
  6409. return defaultResult // may be undefined
  6410. }
  6411. }
  6412.  
  6413. exports.compareIdentifiers = compareIdentifiers
  6414.  
  6415. var numeric = /^[0-9]+$/
  6416. function compareIdentifiers (a, b) {
  6417. var anum = numeric.test(a)
  6418. var bnum = numeric.test(b)
  6419.  
  6420. if (anum && bnum) {
  6421. a = +a
  6422. b = +b
  6423. }
  6424.  
  6425. return a === b ? 0
  6426. : (anum && !bnum) ? -1
  6427. : (bnum && !anum) ? 1
  6428. : a < b ? -1
  6429. : 1
  6430. }
  6431.  
  6432. exports.rcompareIdentifiers = rcompareIdentifiers
  6433. function rcompareIdentifiers (a, b) {
  6434. return compareIdentifiers(b, a)
  6435. }
  6436.  
  6437. exports.major = major
  6438. function major (a, loose) {
  6439. return new SemVer(a, loose).major
  6440. }
  6441.  
  6442. exports.minor = minor
  6443. function minor (a, loose) {
  6444. return new SemVer(a, loose).minor
  6445. }
  6446.  
  6447. exports.patch = patch
  6448. function patch (a, loose) {
  6449. return new SemVer(a, loose).patch
  6450. }
  6451.  
  6452. exports.compare = compare
  6453. function compare (a, b, loose) {
  6454. return new SemVer(a, loose).compare(new SemVer(b, loose))
  6455. }
  6456.  
  6457. exports.compareLoose = compareLoose
  6458. function compareLoose (a, b) {
  6459. return compare(a, b, true)
  6460. }
  6461.  
  6462. exports.compareBuild = compareBuild
  6463. function compareBuild (a, b, loose) {
  6464. var versionA = new SemVer(a, loose)
  6465. var versionB = new SemVer(b, loose)
  6466. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  6467. }
  6468.  
  6469. exports.rcompare = rcompare
  6470. function rcompare (a, b, loose) {
  6471. return compare(b, a, loose)
  6472. }
  6473.  
  6474. exports.sort = sort
  6475. function sort (list, loose) {
  6476. return list.sort(function (a, b) {
  6477. return exports.compareBuild(a, b, loose)
  6478. })
  6479. }
  6480.  
  6481. exports.rsort = rsort
  6482. function rsort (list, loose) {
  6483. return list.sort(function (a, b) {
  6484. return exports.compareBuild(b, a, loose)
  6485. })
  6486. }
  6487.  
  6488. exports.gt = gt
  6489. function gt (a, b, loose) {
  6490. return compare(a, b, loose) > 0
  6491. }
  6492.  
  6493. exports.lt = lt
  6494. function lt (a, b, loose) {
  6495. return compare(a, b, loose) < 0
  6496. }
  6497.  
  6498. exports.eq = eq
  6499. function eq (a, b, loose) {
  6500. return compare(a, b, loose) === 0
  6501. }
  6502.  
  6503. exports.neq = neq
  6504. function neq (a, b, loose) {
  6505. return compare(a, b, loose) !== 0
  6506. }
  6507.  
  6508. exports.gte = gte
  6509. function gte (a, b, loose) {
  6510. return compare(a, b, loose) >= 0
  6511. }
  6512.  
  6513. exports.lte = lte
  6514. function lte (a, b, loose) {
  6515. return compare(a, b, loose) <= 0
  6516. }
  6517.  
  6518. exports.cmp = cmp
  6519. function cmp (a, op, b, loose) {
  6520. switch (op) {
  6521. case '===':
  6522. if (typeof a === 'object')
  6523. a = a.version
  6524. if (typeof b === 'object')
  6525. b = b.version
  6526. return a === b
  6527.  
  6528. case '!==':
  6529. if (typeof a === 'object')
  6530. a = a.version
  6531. if (typeof b === 'object')
  6532. b = b.version
  6533. return a !== b
  6534.  
  6535. case '':
  6536. case '=':
  6537. case '==':
  6538. return eq(a, b, loose)
  6539.  
  6540. case '!=':
  6541. return neq(a, b, loose)
  6542.  
  6543. case '>':
  6544. return gt(a, b, loose)
  6545.  
  6546. case '>=':
  6547. return gte(a, b, loose)
  6548.  
  6549. case '<':
  6550. return lt(a, b, loose)
  6551.  
  6552. case '<=':
  6553. return lte(a, b, loose)
  6554.  
  6555. default:
  6556. throw new TypeError('Invalid operator: ' + op)
  6557. }
  6558. }
  6559.  
  6560. exports.Comparator = Comparator
  6561. function Comparator (comp, options) {
  6562. if (!options || typeof options !== 'object') {
  6563. options = {
  6564. loose: !!options,
  6565. includePrerelease: false
  6566. }
  6567. }
  6568.  
  6569. if (comp instanceof Comparator) {
  6570. if (comp.loose === !!options.loose) {
  6571. return comp
  6572. } else {
  6573. comp = comp.value
  6574. }
  6575. }
  6576.  
  6577. if (!(this instanceof Comparator)) {
  6578. return new Comparator(comp, options)
  6579. }
  6580.  
  6581. debug('comparator', comp, options)
  6582. this.options = options
  6583. this.loose = !!options.loose
  6584. this.parse(comp)
  6585.  
  6586. if (this.semver === ANY) {
  6587. this.value = ''
  6588. } else {
  6589. this.value = this.operator + this.semver.version
  6590. }
  6591.  
  6592. debug('comp', this)
  6593. }
  6594.  
  6595. var ANY = {}
  6596. Comparator.prototype.parse = function (comp) {
  6597. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  6598. var m = comp.match(r)
  6599.  
  6600. if (!m) {
  6601. throw new TypeError('Invalid comparator: ' + comp)
  6602. }
  6603.  
  6604. this.operator = m[1] !== undefined ? m[1] : ''
  6605. if (this.operator === '=') {
  6606. this.operator = ''
  6607. }
  6608.  
  6609. // if it literally is just '>' or '' then allow anything.
  6610. if (!m[2]) {
  6611. this.semver = ANY
  6612. } else {
  6613. this.semver = new SemVer(m[2], this.options.loose)
  6614. }
  6615. }
  6616.  
  6617. Comparator.prototype.toString = function () {
  6618. return this.value
  6619. }
  6620.  
  6621. Comparator.prototype.test = function (version) {
  6622. debug('Comparator.test', version, this.options.loose)
  6623.  
  6624. if (this.semver === ANY || version === ANY) {
  6625. return true
  6626. }
  6627.  
  6628. if (typeof version === 'string') {
  6629. try {
  6630. version = new SemVer(version, this.options)
  6631. } catch (er) {
  6632. return false
  6633. }
  6634. }
  6635.  
  6636. return cmp(version, this.operator, this.semver, this.options)
  6637. }
  6638.  
  6639. Comparator.prototype.intersects = function (comp, options) {
  6640. if (!(comp instanceof Comparator)) {
  6641. throw new TypeError('a Comparator is required')
  6642. }
  6643.  
  6644. if (!options || typeof options !== 'object') {
  6645. options = {
  6646. loose: !!options,
  6647. includePrerelease: false
  6648. }
  6649. }
  6650.  
  6651. var rangeTmp
  6652.  
  6653. if (this.operator === '') {
  6654. if (this.value === '') {
  6655. return true
  6656. }
  6657. rangeTmp = new Range(comp.value, options)
  6658. return satisfies(this.value, rangeTmp, options)
  6659. } else if (comp.operator === '') {
  6660. if (comp.value === '') {
  6661. return true
  6662. }
  6663. rangeTmp = new Range(this.value, options)
  6664. return satisfies(comp.semver, rangeTmp, options)
  6665. }
  6666.  
  6667. var sameDirectionIncreasing =
  6668. (this.operator === '>=' || this.operator === '>') &&
  6669. (comp.operator === '>=' || comp.operator === '>')
  6670. var sameDirectionDecreasing =
  6671. (this.operator === '<=' || this.operator === '<') &&
  6672. (comp.operator === '<=' || comp.operator === '<')
  6673. var sameSemVer = this.semver.version === comp.semver.version
  6674. var differentDirectionsInclusive =
  6675. (this.operator === '>=' || this.operator === '<=') &&
  6676. (comp.operator === '>=' || comp.operator === '<=')
  6677. var oppositeDirectionsLessThan =
  6678. cmp(this.semver, '<', comp.semver, options) &&
  6679. ((this.operator === '>=' || this.operator === '>') &&
  6680. (comp.operator === '<=' || comp.operator === '<'))
  6681. var oppositeDirectionsGreaterThan =
  6682. cmp(this.semver, '>', comp.semver, options) &&
  6683. ((this.operator === '<=' || this.operator === '<') &&
  6684. (comp.operator === '>=' || comp.operator === '>'))
  6685.  
  6686. return sameDirectionIncreasing || sameDirectionDecreasing ||
  6687. (sameSemVer && differentDirectionsInclusive) ||
  6688. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  6689. }
  6690.  
  6691. exports.Range = Range
  6692. function Range (range, options) {
  6693. if (!options || typeof options !== 'object') {
  6694. options = {
  6695. loose: !!options,
  6696. includePrerelease: false
  6697. }
  6698. }
  6699.  
  6700. if (range instanceof Range) {
  6701. if (range.loose === !!options.loose &&
  6702. range.includePrerelease === !!options.includePrerelease) {
  6703. return range
  6704. } else {
  6705. return new Range(range.raw, options)
  6706. }
  6707. }
  6708.  
  6709. if (range instanceof Comparator) {
  6710. return new Range(range.value, options)
  6711. }
  6712.  
  6713. if (!(this instanceof Range)) {
  6714. return new Range(range, options)
  6715. }
  6716.  
  6717. this.options = options
  6718. this.loose = !!options.loose
  6719. this.includePrerelease = !!options.includePrerelease
  6720.  
  6721. // First, split based on boolean or ||
  6722. this.raw = range
  6723. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  6724. return this.parseRange(range.trim())
  6725. }, this).filter(function (c) {
  6726. // throw out any that are not relevant for whatever reason
  6727. return c.length
  6728. })
  6729.  
  6730. if (!this.set.length) {
  6731. throw new TypeError('Invalid SemVer Range: ' + range)
  6732. }
  6733.  
  6734. this.format()
  6735. }
  6736.  
  6737. Range.prototype.format = function () {
  6738. this.range = this.set.map(function (comps) {
  6739. return comps.join(' ').trim()
  6740. }).join('||').trim()
  6741. return this.range
  6742. }
  6743.  
  6744. Range.prototype.toString = function () {
  6745. return this.range
  6746. }
  6747.  
  6748. Range.prototype.parseRange = function (range) {
  6749. var loose = this.options.loose
  6750. range = range.trim()
  6751. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  6752. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  6753. range = range.replace(hr, hyphenReplace)
  6754. debug('hyphen replace', range)
  6755. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  6756. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  6757. debug('comparator trim', range, re[t.COMPARATORTRIM])
  6758.  
  6759. // `~ 1.2.3` => `~1.2.3`
  6760. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  6761.  
  6762. // `^ 1.2.3` => `^1.2.3`
  6763. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  6764.  
  6765. // normalize spaces
  6766. range = range.split(/\s+/).join(' ')
  6767.  
  6768. // At this point, the range is completely trimmed and
  6769. // ready to be split into comparators.
  6770.  
  6771. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  6772. var set = range.split(' ').map(function (comp) {
  6773. return parseComparator(comp, this.options)
  6774. }, this).join(' ').split(/\s+/)
  6775. if (this.options.loose) {
  6776. // in loose mode, throw out any that are not valid comparators
  6777. set = set.filter(function (comp) {
  6778. return !!comp.match(compRe)
  6779. })
  6780. }
  6781. set = set.map(function (comp) {
  6782. return new Comparator(comp, this.options)
  6783. }, this)
  6784.  
  6785. return set
  6786. }
  6787.  
  6788. Range.prototype.intersects = function (range, options) {
  6789. if (!(range instanceof Range)) {
  6790. throw new TypeError('a Range is required')
  6791. }
  6792.  
  6793. return this.set.some(function (thisComparators) {
  6794. return (
  6795. isSatisfiable(thisComparators, options) &&
  6796. range.set.some(function (rangeComparators) {
  6797. return (
  6798. isSatisfiable(rangeComparators, options) &&
  6799. thisComparators.every(function (thisComparator) {
  6800. return rangeComparators.every(function (rangeComparator) {
  6801. return thisComparator.intersects(rangeComparator, options)
  6802. })
  6803. })
  6804. )
  6805. })
  6806. )
  6807. })
  6808. }
  6809.  
  6810. // take a set of comparators and determine whether there
  6811. // exists a version which can satisfy it
  6812. function isSatisfiable (comparators, options) {
  6813. var result = true
  6814. var remainingComparators = comparators.slice()
  6815. var testComparator = remainingComparators.pop()
  6816.  
  6817. while (result && remainingComparators.length) {
  6818. result = remainingComparators.every(function (otherComparator) {
  6819. return testComparator.intersects(otherComparator, options)
  6820. })
  6821.  
  6822. testComparator = remainingComparators.pop()
  6823. }
  6824.  
  6825. return result
  6826. }
  6827.  
  6828. // Mostly just for testing and legacy API reasons
  6829. exports.toComparators = toComparators
  6830. function toComparators (range, options) {
  6831. return new Range(range, options).set.map(function (comp) {
  6832. return comp.map(function (c) {
  6833. return c.value
  6834. }).join(' ').trim().split(' ')
  6835. })
  6836. }
  6837.  
  6838. // comprised of xranges, tildes, stars, and gtlt's at this point.
  6839. // already replaced the hyphen ranges
  6840. // turn into a set of JUST comparators.
  6841. function parseComparator (comp, options) {
  6842. debug('comp', comp, options)
  6843. comp = replaceCarets(comp, options)
  6844. debug('caret', comp)
  6845. comp = replaceTildes(comp, options)
  6846. debug('tildes', comp)
  6847. comp = replaceXRanges(comp, options)
  6848. debug('xrange', comp)
  6849. comp = replaceStars(comp, options)
  6850. debug('stars', comp)
  6851. return comp
  6852. }
  6853.  
  6854. function isX (id) {
  6855. return !id || id.toLowerCase() === 'x' || id === '*'
  6856. }
  6857.  
  6858. // ~, ~> --> * (any, kinda silly)
  6859. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  6860. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  6861. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  6862. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  6863. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  6864. function replaceTildes (comp, options) {
  6865. return comp.trim().split(/\s+/).map(function (comp) {
  6866. return replaceTilde(comp, options)
  6867. }).join(' ')
  6868. }
  6869.  
  6870. function replaceTilde (comp, options) {
  6871. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  6872. return comp.replace(r, function (_, M, m, p, pr) {
  6873. debug('tilde', comp, _, M, m, p, pr)
  6874. var ret
  6875.  
  6876. if (isX(M)) {
  6877. ret = ''
  6878. } else if (isX(m)) {
  6879. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  6880. } else if (isX(p)) {
  6881. // ~1.2 == >=1.2.0 <1.3.0
  6882. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  6883. } else if (pr) {
  6884. debug('replaceTilde pr', pr)
  6885. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  6886. ' <' + M + '.' + (+m + 1) + '.0'
  6887. } else {
  6888. // ~1.2.3 == >=1.2.3 <1.3.0
  6889. ret = '>=' + M + '.' + m + '.' + p +
  6890. ' <' + M + '.' + (+m + 1) + '.0'
  6891. }
  6892.  
  6893. debug('tilde return', ret)
  6894. return ret
  6895. })
  6896. }
  6897.  
  6898. // ^ --> * (any, kinda silly)
  6899. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  6900. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  6901. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  6902. // ^1.2.3 --> >=1.2.3 <2.0.0
  6903. // ^1.2.0 --> >=1.2.0 <2.0.0
  6904. function replaceCarets (comp, options) {
  6905. return comp.trim().split(/\s+/).map(function (comp) {
  6906. return replaceCaret(comp, options)
  6907. }).join(' ')
  6908. }
  6909.  
  6910. function replaceCaret (comp, options) {
  6911. debug('caret', comp, options)
  6912. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  6913. return comp.replace(r, function (_, M, m, p, pr) {
  6914. debug('caret', comp, _, M, m, p, pr)
  6915. var ret
  6916.  
  6917. if (isX(M)) {
  6918. ret = ''
  6919. } else if (isX(m)) {
  6920. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  6921. } else if (isX(p)) {
  6922. if (M === '0') {
  6923. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  6924. } else {
  6925. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  6926. }
  6927. } else if (pr) {
  6928. debug('replaceCaret pr', pr)
  6929. if (M === '0') {
  6930. if (m === '0') {
  6931. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  6932. ' <' + M + '.' + m + '.' + (+p + 1)
  6933. } else {
  6934. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  6935. ' <' + M + '.' + (+m + 1) + '.0'
  6936. }
  6937. } else {
  6938. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  6939. ' <' + (+M + 1) + '.0.0'
  6940. }
  6941. } else {
  6942. debug('no pr')
  6943. if (M === '0') {
  6944. if (m === '0') {
  6945. ret = '>=' + M + '.' + m + '.' + p +
  6946. ' <' + M + '.' + m + '.' + (+p + 1)
  6947. } else {
  6948. ret = '>=' + M + '.' + m + '.' + p +
  6949. ' <' + M + '.' + (+m + 1) + '.0'
  6950. }
  6951. } else {
  6952. ret = '>=' + M + '.' + m + '.' + p +
  6953. ' <' + (+M + 1) + '.0.0'
  6954. }
  6955. }
  6956.  
  6957. debug('caret return', ret)
  6958. return ret
  6959. })
  6960. }
  6961.  
  6962. function replaceXRanges (comp, options) {
  6963. debug('replaceXRanges', comp, options)
  6964. return comp.split(/\s+/).map(function (comp) {
  6965. return replaceXRange(comp, options)
  6966. }).join(' ')
  6967. }
  6968.  
  6969. function replaceXRange (comp, options) {
  6970. comp = comp.trim()
  6971. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  6972. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  6973. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  6974. var xM = isX(M)
  6975. var xm = xM || isX(m)
  6976. var xp = xm || isX(p)
  6977. var anyX = xp
  6978.  
  6979. if (gtlt === '=' && anyX) {
  6980. gtlt = ''
  6981. }
  6982.  
  6983. // if we're including prereleases in the match, then we need
  6984. // to fix this to -0, the lowest possible prerelease value
  6985. pr = options.includePrerelease ? '-0' : ''
  6986.  
  6987. if (xM) {
  6988. if (gtlt === '>' || gtlt === '<') {
  6989. // nothing is allowed
  6990. ret = '<0.0.0-0'
  6991. } else {
  6992. // nothing is forbidden
  6993. ret = '*'
  6994. }
  6995. } else if (gtlt && anyX) {
  6996. // we know patch is an x, because we have any x at all.
  6997. // replace X with 0
  6998. if (xm) {
  6999. m = 0
  7000. }
  7001. p = 0
  7002.  
  7003. if (gtlt === '>') {
  7004. // >1 => >=2.0.0
  7005. // >1.2 => >=1.3.0
  7006. // >1.2.3 => >= 1.2.4
  7007. gtlt = '>='
  7008. if (xm) {
  7009. M = +M + 1
  7010. m = 0
  7011. p = 0
  7012. } else {
  7013. m = +m + 1
  7014. p = 0
  7015. }
  7016. } else if (gtlt === '<=') {
  7017. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  7018. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  7019. gtlt = '<'
  7020. if (xm) {
  7021. M = +M + 1
  7022. } else {
  7023. m = +m + 1
  7024. }
  7025. }
  7026.  
  7027. ret = gtlt + M + '.' + m + '.' + p + pr
  7028. } else if (xm) {
  7029. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  7030. } else if (xp) {
  7031. ret = '>=' + M + '.' + m + '.0' + pr +
  7032. ' <' + M + '.' + (+m + 1) + '.0' + pr
  7033. }
  7034.  
  7035. debug('xRange return', ret)
  7036.  
  7037. return ret
  7038. })
  7039. }
  7040.  
  7041. // Because * is AND-ed with everything else in the comparator,
  7042. // and '' means "any version", just remove the *s entirely.
  7043. function replaceStars (comp, options) {
  7044. debug('replaceStars', comp, options)
  7045. // Looseness is ignored here. star is always as loose as it gets!
  7046. return comp.trim().replace(re[t.STAR], '')
  7047. }
  7048.  
  7049. // This function is passed to string.replace(re[t.HYPHENRANGE])
  7050. // M, m, patch, prerelease, build
  7051. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  7052. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  7053. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  7054. function hyphenReplace ($0,
  7055. from, fM, fm, fp, fpr, fb,
  7056. to, tM, tm, tp, tpr, tb) {
  7057. if (isX(fM)) {
  7058. from = ''
  7059. } else if (isX(fm)) {
  7060. from = '>=' + fM + '.0.0'
  7061. } else if (isX(fp)) {
  7062. from = '>=' + fM + '.' + fm + '.0'
  7063. } else {
  7064. from = '>=' + from
  7065. }
  7066.  
  7067. if (isX(tM)) {
  7068. to = ''
  7069. } else if (isX(tm)) {
  7070. to = '<' + (+tM + 1) + '.0.0'
  7071. } else if (isX(tp)) {
  7072. to = '<' + tM + '.' + (+tm + 1) + '.0'
  7073. } else if (tpr) {
  7074. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  7075. } else {
  7076. to = '<=' + to
  7077. }
  7078.  
  7079. return (from + ' ' + to).trim()
  7080. }
  7081.  
  7082. // if ANY of the sets match ALL of its comparators, then pass
  7083. Range.prototype.test = function (version) {
  7084. if (!version) {
  7085. return false
  7086. }
  7087.  
  7088. if (typeof version === 'string') {
  7089. try {
  7090. version = new SemVer(version, this.options)
  7091. } catch (er) {
  7092. return false
  7093. }
  7094. }
  7095.  
  7096. for (var i = 0; i < this.set.length; i++) {
  7097. if (testSet(this.set[i], version, this.options)) {
  7098. return true
  7099. }
  7100. }
  7101. return false
  7102. }
  7103.  
  7104. function testSet (set, version, options) {
  7105. for (var i = 0; i < set.length; i++) {
  7106. if (!set[i].test(version)) {
  7107. return false
  7108. }
  7109. }
  7110.  
  7111. if (version.prerelease.length && !options.includePrerelease) {
  7112. // Find the set of versions that are allowed to have prereleases
  7113. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  7114. // That should allow `1.2.3-pr.2` to pass.
  7115. // However, `1.2.4-alpha.notready` should NOT be allowed,
  7116. // even though it's within the range set by the comparators.
  7117. for (i = 0; i < set.length; i++) {
  7118. debug(set[i].semver)
  7119. if (set[i].semver === ANY) {
  7120. continue
  7121. }
  7122.  
  7123. if (set[i].semver.prerelease.length > 0) {
  7124. var allowed = set[i].semver
  7125. if (allowed.major === version.major &&
  7126. allowed.minor === version.minor &&
  7127. allowed.patch === version.patch) {
  7128. return true
  7129. }
  7130. }
  7131. }
  7132.  
  7133. // Version has a -pre, but it's not one of the ones we like.
  7134. return false
  7135. }
  7136.  
  7137. return true
  7138. }
  7139.  
  7140. exports.satisfies = satisfies
  7141. function satisfies (version, range, options) {
  7142. try {
  7143. range = new Range(range, options)
  7144. } catch (er) {
  7145. return false
  7146. }
  7147. return range.test(version)
  7148. }
  7149.  
  7150. exports.maxSatisfying = maxSatisfying
  7151. function maxSatisfying (versions, range, options) {
  7152. var max = null
  7153. var maxSV = null
  7154. try {
  7155. var rangeObj = new Range(range, options)
  7156. } catch (er) {
  7157. return null
  7158. }
  7159. versions.forEach(function (v) {
  7160. if (rangeObj.test(v)) {
  7161. // satisfies(v, range, options)
  7162. if (!max || maxSV.compare(v) === -1) {
  7163. // compare(max, v, true)
  7164. max = v
  7165. maxSV = new SemVer(max, options)
  7166. }
  7167. }
  7168. })
  7169. return max
  7170. }
  7171.  
  7172. exports.minSatisfying = minSatisfying
  7173. function minSatisfying (versions, range, options) {
  7174. var min = null
  7175. var minSV = null
  7176. try {
  7177. var rangeObj = new Range(range, options)
  7178. } catch (er) {
  7179. return null
  7180. }
  7181. versions.forEach(function (v) {
  7182. if (rangeObj.test(v)) {
  7183. // satisfies(v, range, options)
  7184. if (!min || minSV.compare(v) === 1) {
  7185. // compare(min, v, true)
  7186. min = v
  7187. minSV = new SemVer(min, options)
  7188. }
  7189. }
  7190. })
  7191. return min
  7192. }
  7193.  
  7194. exports.minVersion = minVersion
  7195. function minVersion (range, loose) {
  7196. range = new Range(range, loose)
  7197.  
  7198. var minver = new SemVer('0.0.0')
  7199. if (range.test(minver)) {
  7200. return minver
  7201. }
  7202.  
  7203. minver = new SemVer('0.0.0-0')
  7204. if (range.test(minver)) {
  7205. return minver
  7206. }
  7207.  
  7208. minver = null
  7209. for (var i = 0; i < range.set.length; ++i) {
  7210. var comparators = range.set[i]
  7211.  
  7212. comparators.forEach(function (comparator) {
  7213. // Clone to avoid manipulating the comparator's semver object.
  7214. var compver = new SemVer(comparator.semver.version)
  7215. switch (comparator.operator) {
  7216. case '>':
  7217. if (compver.prerelease.length === 0) {
  7218. compver.patch++
  7219. } else {
  7220. compver.prerelease.push(0)
  7221. }
  7222. compver.raw = compver.format()
  7223. /* fallthrough */
  7224. case '':
  7225. case '>=':
  7226. if (!minver || gt(minver, compver)) {
  7227. minver = compver
  7228. }
  7229. break
  7230. case '<':
  7231. case '<=':
  7232. /* Ignore maximum versions */
  7233. break
  7234. /* istanbul ignore next */
  7235. default:
  7236. throw new Error('Unexpected operation: ' + comparator.operator)
  7237. }
  7238. })
  7239. }
  7240.  
  7241. if (minver && range.test(minver)) {
  7242. return minver
  7243. }
  7244.  
  7245. return null
  7246. }
  7247.  
  7248. exports.validRange = validRange
  7249. function validRange (range, options) {
  7250. try {
  7251. // Return '*' instead of '' so that truthiness works.
  7252. // This will throw if it's invalid anyway
  7253. return new Range(range, options).range || '*'
  7254. } catch (er) {
  7255. return null
  7256. }
  7257. }
  7258.  
  7259. // Determine if version is less than all the versions possible in the range
  7260. exports.ltr = ltr
  7261. function ltr (version, range, options) {
  7262. return outside(version, range, '<', options)
  7263. }
  7264.  
  7265. // Determine if version is greater than all the versions possible in the range.
  7266. exports.gtr = gtr
  7267. function gtr (version, range, options) {
  7268. return outside(version, range, '>', options)
  7269. }
  7270.  
  7271. exports.outside = outside
  7272. function outside (version, range, hilo, options) {
  7273. version = new SemVer(version, options)
  7274. range = new Range(range, options)
  7275.  
  7276. var gtfn, ltefn, ltfn, comp, ecomp
  7277. switch (hilo) {
  7278. case '>':
  7279. gtfn = gt
  7280. ltefn = lte
  7281. ltfn = lt
  7282. comp = '>'
  7283. ecomp = '>='
  7284. break
  7285. case '<':
  7286. gtfn = lt
  7287. ltefn = gte
  7288. ltfn = gt
  7289. comp = '<'
  7290. ecomp = '<='
  7291. break
  7292. default:
  7293. throw new TypeError('Must provide a hilo val of "<" or ">"')
  7294. }
  7295.  
  7296. // If it satisifes the range it is not outside
  7297. if (satisfies(version, range, options)) {
  7298. return false
  7299. }
  7300.  
  7301. // From now on, variable terms are as if we're in "gtr" mode.
  7302. // but note that everything is flipped for the "ltr" function.
  7303.  
  7304. for (var i = 0; i < range.set.length; ++i) {
  7305. var comparators = range.set[i]
  7306.  
  7307. var high = null
  7308. var low = null
  7309.  
  7310. comparators.forEach(function (comparator) {
  7311. if (comparator.semver === ANY) {
  7312. comparator = new Comparator('>=0.0.0')
  7313. }
  7314. high = high || comparator
  7315. low = low || comparator
  7316. if (gtfn(comparator.semver, high.semver, options)) {
  7317. high = comparator
  7318. } else if (ltfn(comparator.semver, low.semver, options)) {
  7319. low = comparator
  7320. }
  7321. })
  7322.  
  7323. // If the edge version comparator has a operator then our version
  7324. // isn't outside it
  7325. if (high.operator === comp || high.operator === ecomp) {
  7326. return false
  7327. }
  7328.  
  7329. // If the lowest version comparator has an operator and our version
  7330. // is less than it then it isn't higher than the range
  7331. if ((!low.operator || low.operator === comp) &&
  7332. ltefn(version, low.semver)) {
  7333. return false
  7334. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  7335. return false
  7336. }
  7337. }
  7338. return true
  7339. }
  7340.  
  7341. exports.prerelease = prerelease
  7342. function prerelease (version, options) {
  7343. var parsed = parse(version, options)
  7344. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  7345. }
  7346.  
  7347. exports.intersects = intersects
  7348. function intersects (r1, r2, options) {
  7349. r1 = new Range(r1, options)
  7350. r2 = new Range(r2, options)
  7351. return r1.intersects(r2)
  7352. }
  7353.  
  7354. exports.coerce = coerce
  7355. function coerce (version, options) {
  7356. if (version instanceof SemVer) {
  7357. return version
  7358. }
  7359.  
  7360. if (typeof version === 'number') {
  7361. version = String(version)
  7362. }
  7363.  
  7364. if (typeof version !== 'string') {
  7365. return null
  7366. }
  7367.  
  7368. options = options || {}
  7369.  
  7370. var match = null
  7371. if (!options.rtl) {
  7372. match = version.match(re[t.COERCE])
  7373. } else {
  7374. // Find the right-most coercible string that does not share
  7375. // a terminus with a more left-ward coercible string.
  7376. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  7377. //
  7378. // Walk through the string checking with a /g regexp
  7379. // Manually set the index so as to pick up overlapping matches.
  7380. // Stop when we get a match that ends at the string end, since no
  7381. // coercible string can be more right-ward without the same terminus.
  7382. var next
  7383. while ((next = re[t.COERCERTL].exec(version)) &&
  7384. (!match || match.index + match[0].length !== version.length)
  7385. ) {
  7386. if (!match ||
  7387. next.index + next[0].length !== match.index + match[0].length) {
  7388. match = next
  7389. }
  7390. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  7391. }
  7392. // leave it in a clean state
  7393. re[t.COERCERTL].lastIndex = -1
  7394. }
  7395.  
  7396. if (match === null) {
  7397. return null
  7398. }
  7399.  
  7400. return parse(match[2] +
  7401. '.' + (match[3] || '0') +
  7402. '.' + (match[4] || '0'), options)
  7403. }
  7404.  
  7405.  
  7406. /***/ }),
  7407.  
  7408. /***/ 316:
  7409. /***/ ((module) => {
  7410.  
  7411. "use strict";
  7412.  
  7413.  
  7414. var memo = {};
  7415. /* istanbul ignore next */
  7416.  
  7417. function getTarget(target) {
  7418. if (typeof memo[target] === "undefined") {
  7419. var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
  7420.  
  7421. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  7422. try {
  7423. // This will throw an exception if access to iframe is blocked
  7424. // due to cross-origin restrictions
  7425. styleTarget = styleTarget.contentDocument.head;
  7426. } catch (e) {
  7427. // istanbul ignore next
  7428. styleTarget = null;
  7429. }
  7430. }
  7431.  
  7432. memo[target] = styleTarget;
  7433. }
  7434.  
  7435. return memo[target];
  7436. }
  7437.  
  7438. module.exports = getTarget;
  7439.  
  7440. /***/ }),
  7441.  
  7442. /***/ 597:
  7443. /***/ ((module) => {
  7444.  
  7445. "use strict";
  7446.  
  7447.  
  7448. var stylesInDom = [];
  7449.  
  7450. function getIndexByIdentifier(identifier) {
  7451. var result = -1;
  7452.  
  7453. for (var i = 0; i < stylesInDom.length; i++) {
  7454. if (stylesInDom[i].identifier === identifier) {
  7455. result = i;
  7456. break;
  7457. }
  7458. }
  7459.  
  7460. return result;
  7461. }
  7462.  
  7463. function modulesToDom(list, options) {
  7464. var idCountMap = {};
  7465. var identifiers = [];
  7466.  
  7467. for (var i = 0; i < list.length; i++) {
  7468. var item = list[i];
  7469. var id = options.base ? item[0] + options.base : item[0];
  7470. var count = idCountMap[id] || 0;
  7471. var identifier = "".concat(id, " ").concat(count);
  7472. idCountMap[id] = count + 1;
  7473. var index = getIndexByIdentifier(identifier);
  7474. var obj = {
  7475. css: item[1],
  7476. media: item[2],
  7477. sourceMap: item[3]
  7478. };
  7479.  
  7480. if (index !== -1) {
  7481. stylesInDom[index].references++;
  7482. stylesInDom[index].updater(obj);
  7483. } else {
  7484. stylesInDom.push({
  7485. identifier: identifier,
  7486. updater: addStyle(obj, options),
  7487. references: 1
  7488. });
  7489. }
  7490.  
  7491. identifiers.push(identifier);
  7492. }
  7493.  
  7494. return identifiers;
  7495. }
  7496.  
  7497. function addStyle(obj, options) {
  7498. var api = options.domAPI(options);
  7499. api.update(obj);
  7500. return function updateStyle(newObj) {
  7501. if (newObj) {
  7502. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
  7503. return;
  7504. }
  7505.  
  7506. api.update(obj = newObj);
  7507. } else {
  7508. api.remove();
  7509. }
  7510. };
  7511. }
  7512.  
  7513. module.exports = function (list, options) {
  7514. options = options || {};
  7515. list = list || [];
  7516. var lastIdentifiers = modulesToDom(list, options);
  7517. return function update(newList) {
  7518. newList = newList || [];
  7519.  
  7520. for (var i = 0; i < lastIdentifiers.length; i++) {
  7521. var identifier = lastIdentifiers[i];
  7522. var index = getIndexByIdentifier(identifier);
  7523. stylesInDom[index].references--;
  7524. }
  7525.  
  7526. var newLastIdentifiers = modulesToDom(newList, options);
  7527.  
  7528. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  7529. var _identifier = lastIdentifiers[_i];
  7530.  
  7531. var _index = getIndexByIdentifier(_identifier);
  7532.  
  7533. if (stylesInDom[_index].references === 0) {
  7534. stylesInDom[_index].updater();
  7535.  
  7536. stylesInDom.splice(_index, 1);
  7537. }
  7538. }
  7539.  
  7540. lastIdentifiers = newLastIdentifiers;
  7541. };
  7542. };
  7543.  
  7544. /***/ }),
  7545.  
  7546. /***/ 667:
  7547. /***/ ((module) => {
  7548.  
  7549. "use strict";
  7550.  
  7551.  
  7552. /* istanbul ignore next */
  7553. function insertStyleElement(options) {
  7554. var style = document.createElement("style");
  7555. options.setAttributes(style, options.attributes);
  7556. options.insert(style);
  7557. return style;
  7558. }
  7559.  
  7560. module.exports = insertStyleElement;
  7561.  
  7562. /***/ }),
  7563.  
  7564. /***/ 774:
  7565. /***/ ((module) => {
  7566.  
  7567. "use strict";
  7568.  
  7569.  
  7570. /* istanbul ignore next */
  7571. function apply(style, options, obj) {
  7572. var css = obj.css;
  7573. var media = obj.media;
  7574. var sourceMap = obj.sourceMap;
  7575.  
  7576. if (media) {
  7577. style.setAttribute("media", media);
  7578. } else {
  7579. style.removeAttribute("media");
  7580. }
  7581.  
  7582. if (sourceMap && typeof btoa !== "undefined") {
  7583. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  7584. } // For old IE
  7585.  
  7586. /* istanbul ignore if */
  7587.  
  7588.  
  7589. options.styleTagTransform(css, style);
  7590. }
  7591.  
  7592. function removeStyleElement(style) {
  7593. // istanbul ignore if
  7594. if (style.parentNode === null) {
  7595. return false;
  7596. }
  7597.  
  7598. style.parentNode.removeChild(style);
  7599. }
  7600. /* istanbul ignore next */
  7601.  
  7602.  
  7603. function domAPI(options) {
  7604. var style = options.insertStyleElement(options);
  7605. return {
  7606. update: function update(obj) {
  7607. apply(style, options, obj);
  7608. },
  7609. remove: function remove() {
  7610. removeStyleElement(style);
  7611. }
  7612. };
  7613. }
  7614.  
  7615. module.exports = domAPI;
  7616.  
  7617. /***/ }),
  7618.  
  7619. /***/ 766:
  7620. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  7621.  
  7622. var v1 = __webpack_require__(616);
  7623. var v4 = __webpack_require__(358);
  7624.  
  7625. var uuid = v4;
  7626. uuid.v1 = v1;
  7627. uuid.v4 = v4;
  7628.  
  7629. module.exports = uuid;
  7630.  
  7631.  
  7632. /***/ }),
  7633.  
  7634. /***/ 594:
  7635. /***/ ((module) => {
  7636.  
  7637. /**
  7638. * Convert array of 16 byte values to UUID string format of the form:
  7639. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7640. */
  7641. var byteToHex = [];
  7642. for (var i = 0; i < 256; ++i) {
  7643. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7644. }
  7645.  
  7646. function bytesToUuid(buf, offset) {
  7647. var i = offset || 0;
  7648. var bth = byteToHex;
  7649. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7650. return ([
  7651. bth[buf[i++]], bth[buf[i++]],
  7652. bth[buf[i++]], bth[buf[i++]], '-',
  7653. bth[buf[i++]], bth[buf[i++]], '-',
  7654. bth[buf[i++]], bth[buf[i++]], '-',
  7655. bth[buf[i++]], bth[buf[i++]], '-',
  7656. bth[buf[i++]], bth[buf[i++]],
  7657. bth[buf[i++]], bth[buf[i++]],
  7658. bth[buf[i++]], bth[buf[i++]]
  7659. ]).join('');
  7660. }
  7661.  
  7662. module.exports = bytesToUuid;
  7663.  
  7664.  
  7665. /***/ }),
  7666.  
  7667. /***/ 880:
  7668. /***/ ((module) => {
  7669.  
  7670. // Unique ID creation requires a high quality random # generator. In the
  7671. // browser this is a little complicated due to unknown quality of Math.random()
  7672. // and inconsistent support for the `crypto` API. We do the best we can via
  7673. // feature-detection
  7674.  
  7675. // getRandomValues needs to be invoked in a context where "this" is a Crypto
  7676. // implementation. Also, find the complete implementation of crypto on IE11.
  7677. var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
  7678. (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
  7679.  
  7680. if (getRandomValues) {
  7681. // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
  7682. var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
  7683.  
  7684. module.exports = function whatwgRNG() {
  7685. getRandomValues(rnds8);
  7686. return rnds8;
  7687. };
  7688. } else {
  7689. // Math.random()-based (RNG)
  7690. //
  7691. // If all else fails, use Math.random(). It's fast, but is of unspecified
  7692. // quality.
  7693. var rnds = new Array(16);
  7694.  
  7695. module.exports = function mathRNG() {
  7696. for (var i = 0, r; i < 16; i++) {
  7697. if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
  7698. rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
  7699. }
  7700.  
  7701. return rnds;
  7702. };
  7703. }
  7704.  
  7705.  
  7706. /***/ }),
  7707.  
  7708. /***/ 616:
  7709. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  7710.  
  7711. var rng = __webpack_require__(880);
  7712. var bytesToUuid = __webpack_require__(594);
  7713.  
  7714. // **`v1()` - Generate time-based UUID**
  7715. //
  7716. // Inspired by https://github.com/LiosK/UUID.js
  7717. // and http://docs.python.org/library/uuid.html
  7718.  
  7719. var _nodeId;
  7720. var _clockseq;
  7721.  
  7722. // Previous uuid creation time
  7723. var _lastMSecs = 0;
  7724. var _lastNSecs = 0;
  7725.  
  7726. // See https://github.com/uuidjs/uuid for API details
  7727. function v1(options, buf, offset) {
  7728. var i = buf && offset || 0;
  7729. var b = buf || [];
  7730.  
  7731. options = options || {};
  7732. var node = options.node || _nodeId;
  7733. var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
  7734.  
  7735. // node and clockseq need to be initialized to random values if they're not
  7736. // specified. We do this lazily to minimize issues related to insufficient
  7737. // system entropy. See #189
  7738. if (node == null || clockseq == null) {
  7739. var seedBytes = rng();
  7740. if (node == null) {
  7741. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  7742. node = _nodeId = [
  7743. seedBytes[0] | 0x01,
  7744. seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
  7745. ];
  7746. }
  7747. if (clockseq == null) {
  7748. // Per 4.2.2, randomize (14 bit) clockseq
  7749. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  7750. }
  7751. }
  7752.  
  7753. // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  7754. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  7755. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  7756. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  7757. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
  7758.  
  7759. // Per 4.2.1.2, use count of uuid's generated during the current clock
  7760. // cycle to simulate higher resolution clock
  7761. var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
  7762.  
  7763. // Time since last uuid creation (in msecs)
  7764. var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
  7765.  
  7766. // Per 4.2.1.2, Bump clockseq on clock regression
  7767. if (dt < 0 && options.clockseq === undefined) {
  7768. clockseq = clockseq + 1 & 0x3fff;
  7769. }
  7770.  
  7771. // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  7772. // time interval
  7773. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  7774. nsecs = 0;
  7775. }
  7776.  
  7777. // Per 4.2.1.2 Throw error if too many uuids are requested
  7778. if (nsecs >= 10000) {
  7779. throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  7780. }
  7781.  
  7782. _lastMSecs = msecs;
  7783. _lastNSecs = nsecs;
  7784. _clockseq = clockseq;
  7785.  
  7786. // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  7787. msecs += 12219292800000;
  7788.  
  7789. // `time_low`
  7790. var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  7791. b[i++] = tl >>> 24 & 0xff;
  7792. b[i++] = tl >>> 16 & 0xff;
  7793. b[i++] = tl >>> 8 & 0xff;
  7794. b[i++] = tl & 0xff;
  7795.  
  7796. // `time_mid`
  7797. var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
  7798. b[i++] = tmh >>> 8 & 0xff;
  7799. b[i++] = tmh & 0xff;
  7800.  
  7801. // `time_high_and_version`
  7802. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  7803. b[i++] = tmh >>> 16 & 0xff;
  7804.  
  7805. // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  7806. b[i++] = clockseq >>> 8 | 0x80;
  7807.  
  7808. // `clock_seq_low`
  7809. b[i++] = clockseq & 0xff;
  7810.  
  7811. // `node`
  7812. for (var n = 0; n < 6; ++n) {
  7813. b[i + n] = node[n];
  7814. }
  7815.  
  7816. return buf ? buf : bytesToUuid(b);
  7817. }
  7818.  
  7819. module.exports = v1;
  7820.  
  7821.  
  7822. /***/ }),
  7823.  
  7824. /***/ 358:
  7825. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  7826.  
  7827. var rng = __webpack_require__(880);
  7828. var bytesToUuid = __webpack_require__(594);
  7829.  
  7830. function v4(options, buf, offset) {
  7831. var i = buf && offset || 0;
  7832.  
  7833. if (typeof(options) == 'string') {
  7834. buf = options === 'binary' ? new Array(16) : null;
  7835. options = null;
  7836. }
  7837. options = options || {};
  7838.  
  7839. var rnds = options.random || (options.rng || rng)();
  7840.  
  7841. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7842. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7843. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7844.  
  7845. // Copy bytes to buffer, if provided
  7846. if (buf) {
  7847. for (var ii = 0; ii < 16; ++ii) {
  7848. buf[i + ii] = rnds[ii];
  7849. }
  7850. }
  7851.  
  7852. return buf || bytesToUuid(rnds);
  7853. }
  7854.  
  7855. module.exports = v4;
  7856.  
  7857.  
  7858. /***/ }),
  7859.  
  7860. /***/ 391:
  7861. /***/ ((module) => {
  7862.  
  7863. "use strict";
  7864. module.exports = "<div id=\"pizyds_rain_header_field\">\r\n <p>\r\n 版本:<%= BUILD_VERSION %>&nbsp;&nbsp;|&nbsp;&nbsp;编译时间:<%= BUILD_TIME %><br/>\r\n 脚本开源维护中,欢迎&nbsp;<a href=\"https://www.pizyds.com/rain-classroom-pdf-direct-download/\" target=\"_blank\" class=\"no-text-decoration\">反馈问题</a><br/>\r\n </p>\r\n <p id=\"pizyds_rain_header_message\" class=\"text-emphasis\">\r\n <%- HEADER_MESSAGE %>\r\n </p>\r\n</div>\r\n\r\n<hr/>\r\n\r\n<div id=\"pizyds_rain_switch_field\">\r\n <div class=\"form-check form-switch form-check-inline\">\r\n <input class=\"form-check-input\" type=\"checkbox\" id=\"pizyds_rain_answer_switch\" <%= ANS_ENABLED ? \"checked\" : \"\" %>>\r\n <label class=\"form-check-label\" for=\"pizyds_rain_answer_switch\" title=\"仅支持“课堂”类型的课件\">选择题答案</label>\r\n </div>\r\n\r\n <div class=\"form-check form-switch form-check-inline\">\r\n <input class=\"form-check-input\" type=\"checkbox\" id=\"pizyds_rain_drm_switch\" <%= DRM_ENABLED ? \"checked\" : \"\" %> disabled>\r\n <label class=\"form-check-label\" for=\"pizyds_rain_drm_switch\" title=\"默认不可更改,请查看帮助\">\r\n DRM&nbsp;<a href=\"https://www.pizyds.com/rain-classroom-pdf-direct-download-pizyds-rain-drm/\" target=\"_blank\" class=\"no-text-decoration\">(&nbsp;?&nbsp;)</a>\r\n </label>\r\n </div>\r\n</div>\r\n\r\n<hr/>\r\n\r\n<div id=\"pizyds_rain_answer_font_size_field\" class=\"<%= ANS_ENABLED ? \"\" : \"disabledField\" %>\">\r\n <label for=\"pizyds_rain_answer_font_size_range\" class=\"form-label\">\r\n 答案字号&nbsp;\r\n <span id=\"pizyds_rain_answer_font_size_show\"><%= FONT_SIZE %></span>\r\n </label>\r\n <span id=\"pizyds_rain_answer_font_size_default\" title=\"复位\">\r\n <%- DEFAULT_SVG %>\r\n </span>\r\n <input id=\"pizyds_rain_answer_font_size_range\" type=\"range\" class=\"form-range\" min=\"0\" max=\"80\" step=\"1\" value=\"<%= FONT_SIZE %>\" <%= ANS_ENABLED ? \"\" : \"disabled\" %>>\r\n</div>\r\n\r\n<div id=\"pizyds_rain_footer_field\">\r\n <span class=\"footer-span\">\r\n - &nbsp; \r\n <a href=\"https://www.pizyds.com/rain-classroom-pdf-direct-download/\" target=\"_blank\" title=\"主页\">\r\n <%- HOUSE_SVG %>\r\n </a>\r\n &nbsp; | &nbsp; \r\n <a href=\"https://github.com/PillarsZhang/Rain-Classroom-PDF-Direct-Download\" target=\"_blank\" title=\"Github\">\r\n <%- GITHUB_SVG %>\r\n </a>\r\n &nbsp; | &nbsp; \r\n <a href=\"https://greasyfork.org/scripts/424050\" target=\"_blank\" title=\"Greasy Fork\">\r\n <%- CODE_SVG %>\r\n </a>\r\n &nbsp; -\r\n </span>\r\n</div>";
  7865.  
  7866. /***/ }),
  7867.  
  7868. /***/ 666:
  7869. /***/ ((module) => {
  7870.  
  7871. "use strict";
  7872. module.exports = "雨课堂课件PDF下载工具";
  7873.  
  7874. /***/ }),
  7875.  
  7876. /***/ 351:
  7877. /***/ ((module) => {
  7878.  
  7879. "use strict";
  7880. module.exports = "<span id=\"pizyds_rain_button_field\" class=\"<%= FIELD_CLASS %> <%= CLASS %> noselect\">\r\n <span id=\"pizyds_rain_waiting\">\r\n <span id=\"pizyds_rain_download_button\" title=\"点击下载PPT\">\r\n <%- DOWNLOAD_BUTTON_ICON %> 下载课件\r\n </span>\r\n <span id=\"pizyds_rain_config_button\">\r\n [ <%- CONFIG_BUTTON_ICON %> ]\r\n </span>\r\n </span>\r\n <span id=\"pizyds_rain_running\" hidden>\r\n <span title=\"运行中\">\r\n <%- DOWNLOAD_BUTTON_ICON %> <span id=\"pizyds_rain_running_text\">运行中</span>\r\n </span>\r\n <span>\r\n [ <%- RUNNING_BUTTON_ICON %> ]\r\n </span>\r\n </span>\r\n</span>";
  7881.  
  7882. /***/ }),
  7883.  
  7884. /***/ 507:
  7885. /***/ ((module) => {
  7886.  
  7887. "use strict";
  7888. module.exports = "-----BEGIN PUBLIC KEY-----\r\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2N75k3SL4PqTifrjSHj\r\n0CdMMoKwPgzb64Z6UuuTvn3vSn6l9tJ/9gRNZTrQ8B0aphtK3sAPUBuadcOplAap\r\nbJsuEizydGgvdNvKNlNL1OzSvrvjkHe5OxYzW+0A00U4l1zyzZJ0TW06cHpi8Pcq\r\nIRv3hNJ5nHXHnLudsxxQ4XiiSpvIs8fUuO6PAJkCPYFnH2fWUVo22xqwbQBSowot\r\njzLOwNugoq85aSPNBJZR9pQcerr3X7kowK+Ul6Hk9k+ZKL1pZ0NS1o/N/qFgD9Ow\r\nvr2vW8ylIAAb4B6vhPxOXkFKcIYiA+Kj+Ich7d3TNpeY5/nOCovp2xPQqCiplmGB\r\nKQIDAQAB\r\n-----END PUBLIC KEY-----\r\n";
  7889.  
  7890. /***/ })
  7891.  
  7892. /******/ });
  7893. /************************************************************************/
  7894. /******/ // The module cache
  7895. /******/ var __webpack_module_cache__ = {};
  7896. /******/
  7897. /******/ // The require function
  7898. /******/ function __webpack_require__(moduleId) {
  7899. /******/ // Check if module is in cache
  7900. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  7901. /******/ if (cachedModule !== undefined) {
  7902. /******/ return cachedModule.exports;
  7903. /******/ }
  7904. /******/ // Create a new module (and put it into the cache)
  7905. /******/ var module = __webpack_module_cache__[moduleId] = {
  7906. /******/ id: moduleId,
  7907. /******/ // no module.loaded needed
  7908. /******/ exports: {}
  7909. /******/ };
  7910. /******/
  7911. /******/ // Execute the module function
  7912. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  7913. /******/
  7914. /******/ // Return the exports of the module
  7915. /******/ return module.exports;
  7916. /******/ }
  7917. /******/
  7918. /************************************************************************/
  7919. /******/ /* webpack/runtime/compat get default export */
  7920. /******/ (() => {
  7921. /******/ // getDefaultExport function for compatibility with non-harmony modules
  7922. /******/ __webpack_require__.n = (module) => {
  7923. /******/ var getter = module && module.__esModule ?
  7924. /******/ () => (module['default']) :
  7925. /******/ () => (module);
  7926. /******/ __webpack_require__.d(getter, { a: getter });
  7927. /******/ return getter;
  7928. /******/ };
  7929. /******/ })();
  7930. /******/
  7931. /******/ /* webpack/runtime/define property getters */
  7932. /******/ (() => {
  7933. /******/ // define getter functions for harmony exports
  7934. /******/ __webpack_require__.d = (exports, definition) => {
  7935. /******/ for(var key in definition) {
  7936. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  7937. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  7938. /******/ }
  7939. /******/ }
  7940. /******/ };
  7941. /******/ })();
  7942. /******/
  7943. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  7944. /******/ (() => {
  7945. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  7946. /******/ })();
  7947. /******/
  7948. /******/ /* webpack/runtime/make namespace object */
  7949. /******/ (() => {
  7950. /******/ // define __esModule on exports
  7951. /******/ __webpack_require__.r = (exports) => {
  7952. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  7953. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  7954. /******/ }
  7955. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  7956. /******/ };
  7957. /******/ })();
  7958. /******/
  7959. /************************************************************************/
  7960. var __webpack_exports__ = {};
  7961. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  7962. (() => {
  7963. "use strict";
  7964.  
  7965. ;// CONCATENATED MODULE: PRPS\src\libs\common.js
  7966. //运行环境配置
  7967. var env_config = {
  7968. _version: "0.0.0",
  7969. log: {
  7970. config: false
  7971. }
  7972. }
  7973. autoGMValue(env_config, "env_config");
  7974.  
  7975. //编译信息
  7976. var build_info = {
  7977. name: "rain-classroom-pdf-direct-download",
  7978. version: "1.3.1",
  7979. timestamp: 1636822729351,
  7980. }
  7981.  
  7982. //对自动添加客观题答案到PPT页面的配置
  7983. var ans_config = {
  7984. _enabled: true,
  7985. _fontSize: 40,
  7986. right: 30,
  7987. up: 20,
  7988. fontColor: "#000000",
  7989. text: {
  7990. enabled: "课件附答案",
  7991. fontSize: "答案字号"
  7992. }
  7993. };
  7994. autoGMValue(ans_config, "ans_config");
  7995.  
  7996. var drm_config = {
  7997. _enabled: true,
  7998. text: {
  7999. enabled: "DRM"
  8000. }
  8001. };
  8002. autoGMValue(drm_config, "drm_config");
  8003.  
  8004. //网址分类规则
  8005. var url_match = [{
  8006. reg: /https:\/\/.*\.yuketang\.cn\/v2\/web\/student\/.*/,
  8007. type: 1
  8008. },{
  8009. reg: /https:\/\/.*\.yuketang\.cn\/v2\/web\/student-v3\/.*/,
  8010. type: 1
  8011. },{
  8012. reg: /https:\/\/.*\.yuketang\.cn\/v2\/web\/studentCards\/.*/,
  8013. type: 2
  8014. }];
  8015.  
  8016. env_config.log.config = true;
  8017.  
  8018. function autoGMValue(obj, objName){
  8019. for (let keyTemp in obj){
  8020. if (keyTemp.startsWith('_')){
  8021. let _key = keyTemp; //内置值
  8022. let key = _key.substring(1); //操作值
  8023. let $key = '$' + key; //默认值
  8024. let GMValueName = `${objName}.${key}`;
  8025. obj[$key] = obj[_key];
  8026. Object.defineProperty(obj, key, {
  8027. set: function(val) {
  8028. this[_key] = val;
  8029. GM_setValue(GMValueName, this[_key]);
  8030. env_config.log.config && console.log(`雨课堂课件PDF下载工具:${this.text&&this.text[key]||GMValueName} - ${this[_key]}`);
  8031. },
  8032. get: function() {
  8033. this[_key] = GM_getValue(GMValueName, this[_key]);
  8034. return this[_key];
  8035. },
  8036. });
  8037. refreshGMValue(obj, key);
  8038. }
  8039. }
  8040. }
  8041.  
  8042. function refreshGMValue(obj, key){
  8043. obj[key] = obj[key].valueOf();
  8044. }
  8045.  
  8046. var time_object = {
  8047. popover_can_hide: Date.now()
  8048. }
  8049.  
  8050. var update_info_list = {
  8051. '1.3.1': `优化了生成速度、报错信息,修复了图片格式兼容、面板不刷新的Bug`
  8052. }
  8053.  
  8054. var update_info = update_info_list[build_info.version] ?
  8055. update_info_list[build_info.version] :
  8056. '好像没有更新信息';
  8057. // EXTERNAL MODULE: PRPS\node_modules\bootstrap-icons\icons\file-earmark-pdf.svg
  8058. var PRPU_node_modules_bootstrap_icons_icons_file_earmark_pdf = __webpack_require__(154);
  8059. // EXTERNAL MODULE: PRPS\node_modules\bootstrap-icons\icons\gear-fill.svg
  8060. var PRPU_node_modules_bootstrap_icons_icons_gear_fill = __webpack_require__(984);
  8061. ;// CONCATENATED MODULE: external "jQuery"
  8062. const external_jQuery_namespaceObject = jQuery;
  8063. var external_jQuery_default = /*#__PURE__*/__webpack_require__.n(external_jQuery_namespaceObject);
  8064. // EXTERNAL MODULE: PRPS\node_modules\semver\semver.js
  8065. var PRPU_node_modules_semver_semver = __webpack_require__(776);
  8066. ;// CONCATENATED MODULE: PRPS\src\libs\public.js
  8067.  
  8068.  
  8069.  
  8070.  
  8071. //按钮文本刷新
  8072. function refreshProcessStatus(processStatus){
  8073. if (!processStatus){
  8074. external_jQuery_default()("#pizyds_rain_running").attr("hidden", "");
  8075. external_jQuery_default()("#pizyds_rain_waiting").removeAttr("hidden");
  8076. } else{
  8077. external_jQuery_default()("#pizyds_rain_running_text").html(processStatus);
  8078. external_jQuery_default()("#pizyds_rain_waiting").attr("hidden", "");
  8079. external_jQuery_default()("#pizyds_rain_running").removeAttr("hidden");
  8080. }
  8081. }
  8082.  
  8083. //修改自:http://www.jsfun.cn/#textBecomeImg
  8084. //js使用canvas将文字转换成ImageData对象
  8085. function text2img(text, fontsize, fontcolor){
  8086. var canvas = document.createElement('canvas');
  8087. canvas.height = parseInt(fontsize * 1.2);
  8088. var ctx = canvas.getContext('2d');
  8089.  
  8090. ctx.clearRect(0, 0, canvas.width, canvas.height);
  8091. ctx.fillStyle = fontcolor;
  8092. ctx.font = fontsize + "px Arial";
  8093.  
  8094. ctx.textBaseline = 'middle';
  8095. ctx.fillText(text, 0, fontsize/2);
  8096.  
  8097. canvas.width = ctx.measureText(text).width;
  8098. ctx.fillStyle = fontcolor;
  8099. ctx.font = fontsize + "px Arial";
  8100. ctx.textBaseline = 'middle';
  8101. ctx.fillText(text, 0, fontsize/2);
  8102.  
  8103. var dta = ctx.getImageData(0, 0, canvas.width, canvas.height);
  8104. dta.url = canvas.toDataURL();
  8105. return dta;
  8106. }
  8107.  
  8108. //来自:https://www.cnblogs.com/ranyonsue/p/7596347.html
  8109. //HTML删除节点
  8110. function removeElement(_element){
  8111. var _parentElement = _element.parentNode;
  8112. if(_parentElement){
  8113. _parentElement.removeChild(_element);
  8114. }
  8115. }
  8116.  
  8117. //休眠
  8118. var sleep = (time) => new Promise(reslove => setTimeout(reslove, time));
  8119.  
  8120. /**
  8121. * 调整 SVG 尺寸
  8122. * @param {string} svg SVG 字符串
  8123. * @param {number} width 宽度
  8124. * @param {number} height 高度
  8125. * @return {void}
  8126. */
  8127. function adjustSVGSize(svg, width, height = null){
  8128. var node = external_jQuery_default().parseHTML(svg)[0];
  8129. var newHeight = height ? height : width / parseInt(external_jQuery_default()(node).attr("width")) * parseInt(external_jQuery_default()(node).attr("height"));
  8130. var newWidth = width ? width : height / parseInt(external_jQuery_default()(node).attr("height")) * parseInt(external_jQuery_default()(node).attr("width"));
  8131. external_jQuery_default()(node).attr("height", newHeight);
  8132. external_jQuery_default()(node).attr("width", newWidth);
  8133. return node.outerHTML;
  8134. }
  8135.  
  8136. /**
  8137. * 给 SVG 添加 css
  8138. * @param {string} svg SVG 字符串
  8139. * @param {string} css css
  8140. * @return {void}
  8141. */
  8142. function addSVGClass(svg, css){
  8143. var node = external_jQuery_default().parseHTML(svg)[0];
  8144. external_jQuery_default()(node).addClass(css);
  8145. return node.outerHTML;
  8146. }
  8147.  
  8148. function judgeVersionUpdate() {
  8149. if (PRPU_node_modules_semver_semver.SemVer.neq(env_config.version, build_info.version)){
  8150. if (PRPU_node_modules_semver_semver.SemVer.eq(env_config.version, "0.0.0")){
  8151. return "new";
  8152. } else if (PRPU_node_modules_semver_semver.SemVer.gt(env_config.version, build_info.version)){
  8153. return "down";
  8154. } else if (PRPU_node_modules_semver_semver.SemVer.lt(env_config.version, build_info.version)){
  8155. return "up";
  8156. }
  8157. } else {
  8158. return false;
  8159. }
  8160. }
  8161.  
  8162.  
  8163. var textVersionUpdate = {
  8164. "new": `感谢!新安装:${env_config.version} -> ${build_info.version},更新内容:${update_info}`,
  8165. "up": `感谢!已升级:${env_config.version} -> ${build_info.version},更新内容:${update_info}`,
  8166. "down": `啊?已降级:${env_config.version} -> ${build_info.version}`
  8167. }
  8168.  
  8169. function clearVersionUpdate () {
  8170. if (judgeVersionUpdate()){
  8171. env_config.version = build_info.version;
  8172. return true;
  8173. } else {
  8174. return false;
  8175. }
  8176. }
  8177.  
  8178. //https://stackoverflow.com/questions/52059596/loading-an-image-on-web-browser-using-promise/52060802
  8179. /**
  8180. * 将图片链接转化为HTMLImageElement对象
  8181. * @param {string} url 图片链接
  8182. * @return {HTMLImageElement} HTMLImageElement对象
  8183. */
  8184. const url2HTMLImageElement = (url) => new Promise((resolve, reject) => {
  8185. const img = new Image();
  8186. img.addEventListener('load', () => resolve(img));
  8187. img.addEventListener('error', (err) => reject(err));
  8188. img.crossOrigin = "anonymous";
  8189. img.src = url;
  8190. });
  8191.  
  8192. /**
  8193. * 将图片链接转化为ImageData对象
  8194. * @param {string} url 图片链接
  8195. * @return {ImageData} ImageData对象
  8196. */
  8197. async function url2ImgData(url){
  8198. var img = await url2HTMLImageElement(url);
  8199. var canvas = document.createElement('canvas');
  8200. canvas.height = img.height;
  8201. canvas.width = img.width;
  8202. var ctx = canvas.getContext('2d');
  8203. ctx.drawImage(img, 0, 0);
  8204. var dta = ctx.getImageData(0, 0, canvas.width, canvas.height);
  8205. dta.url = canvas.toDataURL();
  8206. return dta;
  8207. }
  8208.  
  8209. var headerMessage = [];
  8210. //控制面板信息刷新
  8211. function refreshHeaderMessage(message, type = 'Info', show = true){
  8212. var suffix = {
  8213. 'Warn': '具体请参考控制台报错信息',
  8214. 'Info': ''
  8215. }
  8216. if (!message){
  8217. headerMessage = []
  8218. } else{
  8219. time_object.popover_can_hide = Date.now() + 500;
  8220. headerMessage.push(`[${type}] ${message} ${suffix[type]}`);
  8221. show && external_jQuery_default()('#pizyds_rain_config_button').popover('show');
  8222. }
  8223. }
  8224.  
  8225. function getHeaderMessage(){
  8226. var temp = headerMessage.join('<br>');
  8227. headerMessage = [];
  8228. return temp
  8229. }
  8230. // EXTERNAL MODULE: PRPS\src\ejs\ejs_pizyds_rain_conf_panel.ejs
  8231. var PRPU_src_ejs_ejs_pizyds_rain_conf_panel = __webpack_require__(391);
  8232. // EXTERNAL MODULE: PRPS\src\ejs\ejs_pizyds_rain_conf_title.ejs
  8233. var PRPU_src_ejs_ejs_pizyds_rain_conf_title = __webpack_require__(666);
  8234. // EXTERNAL MODULE: PRPS\node_modules\ejs\ejs.js
  8235. var PRPU_node_modules_ejs_ejs = __webpack_require__(56);
  8236. var PRPU_node_modules_ejs_ejs_default = /*#__PURE__*/__webpack_require__.n(PRPU_node_modules_ejs_ejs);
  8237. // EXTERNAL MODULE: PRPS\node_modules\bootstrap\js\dist\popover.js
  8238. var PRPU_node_modules_bootstrap_js_dist_popover = __webpack_require__(960);
  8239. // EXTERNAL MODULE: PRPS\node_modules\style-loader\dist\runtime\injectStylesIntoStyleTag.js
  8240. var PRPU_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag = __webpack_require__(597);
  8241. var PRPU_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(PRPU_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag);
  8242. // EXTERNAL MODULE: PRPS\node_modules\style-loader\dist\runtime\styleDomAPI.js
  8243. var PRPU_node_modules_style_loader_dist_runtime_styleDomAPI = __webpack_require__(774);
  8244. var PRPU_node_modules_style_loader_dist_runtime_styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(PRPU_node_modules_style_loader_dist_runtime_styleDomAPI);
  8245. // EXTERNAL MODULE: PRPS\node_modules\style-loader\dist\runtime\getTarget.js
  8246. var PRPU_node_modules_style_loader_dist_runtime_getTarget = __webpack_require__(316);
  8247. var PRPU_node_modules_style_loader_dist_runtime_getTarget_default = /*#__PURE__*/__webpack_require__.n(PRPU_node_modules_style_loader_dist_runtime_getTarget);
  8248. // EXTERNAL MODULE: PRPS\node_modules\style-loader\dist\runtime\insertStyleElement.js
  8249. var PRPU_node_modules_style_loader_dist_runtime_insertStyleElement = __webpack_require__(667);
  8250. var PRPU_node_modules_style_loader_dist_runtime_insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(PRPU_node_modules_style_loader_dist_runtime_insertStyleElement);
  8251. // EXTERNAL MODULE: PRPS\node_modules\css-loader\dist\cjs.js!PRPS\node_modules\postcss-loader\dist\cjs.js!PRPS\node_modules\sass-loader\dist\cjs.js!PRPS\src\styles\css_pizyds_rain.scss
  8252. var PRPU_node_modules_css_loader_dist_cjs_js_PRPU_node_modules_postcss_loader_dist_cjs_js_PRPU_node_modules_sass_loader_dist_cjs_js_PRPU_src_styles_css_pizyds_rain = __webpack_require__(324);
  8253. ;// CONCATENATED MODULE: PRPS\src\styles\css_pizyds_rain.scss
  8254.  
  8255.  
  8256. var options = {};
  8257.  
  8258. options.styleTagTransform = function(css, style){
  8259. if (style.styleSheet) {
  8260. style.styleSheet.cssText = css;
  8261. } else {
  8262. while (style.firstChild) {
  8263. style.removeChild(style.firstChild);
  8264. }
  8265.  
  8266. style.appendChild(document.createTextNode(css));
  8267. }
  8268. };
  8269. options.setAttributes = function(style) {
  8270. var nonce =
  8271. true ? __webpack_require__.nc : 0;
  8272.  
  8273. if (nonce) {
  8274. style.setAttribute("nonce", nonce);
  8275. }
  8276. };
  8277. options.insert = function(style){
  8278. var target = PRPU_node_modules_style_loader_dist_runtime_getTarget_default()("head");
  8279.  
  8280. if (!target) {
  8281. throw new Error(
  8282. "Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."
  8283. );
  8284. }
  8285.  
  8286. target.appendChild(style);
  8287. };
  8288. options.domAPI = (PRPU_node_modules_style_loader_dist_runtime_styleDomAPI_default());
  8289. options.insertStyleElement = (PRPU_node_modules_style_loader_dist_runtime_insertStyleElement_default());
  8290.  
  8291. var update = PRPU_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_default()(PRPU_node_modules_css_loader_dist_cjs_js_PRPU_node_modules_postcss_loader_dist_cjs_js_PRPU_node_modules_sass_loader_dist_cjs_js_PRPU_src_styles_css_pizyds_rain/* default */.Z, options);
  8292.  
  8293.  
  8294.  
  8295.  
  8296. /* harmony default export */ const PRPU_src_styles_css_pizyds_rain = (PRPU_node_modules_css_loader_dist_cjs_js_PRPU_node_modules_postcss_loader_dist_cjs_js_PRPU_node_modules_sass_loader_dist_cjs_js_PRPU_src_styles_css_pizyds_rain/* default */.Z && PRPU_node_modules_css_loader_dist_cjs_js_PRPU_node_modules_postcss_loader_dist_cjs_js_PRPU_node_modules_sass_loader_dist_cjs_js_PRPU_src_styles_css_pizyds_rain/* default.locals */.Z.locals ? PRPU_node_modules_css_loader_dist_cjs_js_PRPU_node_modules_postcss_loader_dist_cjs_js_PRPU_node_modules_sass_loader_dist_cjs_js_PRPU_src_styles_css_pizyds_rain/* default.locals */.Z.locals : undefined);
  8297.  
  8298. // EXTERNAL MODULE: PRPS\node_modules\bootstrap-icons\icons\arrow-return-left.svg
  8299. var PRPU_node_modules_bootstrap_icons_icons_arrow_return_left = __webpack_require__(856);
  8300. // EXTERNAL MODULE: PRPS\node_modules\bootstrap-icons\icons\github.svg
  8301. var PRPU_node_modules_bootstrap_icons_icons_github = __webpack_require__(739);
  8302. // EXTERNAL MODULE: PRPS\node_modules\bootstrap-icons\icons\house.svg
  8303. var PRPU_node_modules_bootstrap_icons_icons_house = __webpack_require__(185);
  8304. // EXTERNAL MODULE: PRPS\node_modules\bootstrap-icons\icons\code-slash.svg
  8305. var PRPU_node_modules_bootstrap_icons_icons_code_slash = __webpack_require__(376);
  8306. ;// CONCATENATED MODULE: PRPS\src\libs\conf_panel.js
  8307.  
  8308.  
  8309.  
  8310.  
  8311.  
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.  
  8318.  
  8319.  
  8320. /**
  8321. * 悬浮窗注入
  8322. * @param {Element} buttonEle 需要注入悬浮窗的按钮
  8323. * @return {void}
  8324. */
  8325. /* harmony default export */ function PRPU_src_libs_conf_panel(buttonEle){
  8326. var form_templ = PRPU_src_ejs_ejs_pizyds_rain_conf_panel;
  8327. var form_html = () => PRPU_node_modules_ejs_ejs_default().render(form_templ, {
  8328. BUILD_VERSION: build_info.version,
  8329. BUILD_TIME: formatDate(new Date(build_info.timestamp)),
  8330. ANS_ENABLED: ans_config.enabled,
  8331. DRM_ENABLED: drm_config.enabled,
  8332. FONT_SIZE: ans_config.fontSize,
  8333. HEADER_MESSAGE: getHeaderMessage(),
  8334. DEFAULT_SVG: adjustSVGSize(PRPU_node_modules_bootstrap_icons_icons_arrow_return_left, 12),
  8335. HOUSE_SVG: adjustSVGSize(PRPU_node_modules_bootstrap_icons_icons_house, 12),
  8336. GITHUB_SVG: adjustSVGSize(PRPU_node_modules_bootstrap_icons_icons_github, 12),
  8337. CODE_SVG: adjustSVGSize(PRPU_node_modules_bootstrap_icons_icons_code_slash, 12)
  8338. });
  8339. var container = external_jQuery_default()(".pizyds_rain")[0];
  8340. external_jQuery_default()(container).off();
  8341.  
  8342. // eslint-disable-next-line no-unused-vars
  8343. external_jQuery_default()(buttonEle).popover({
  8344. title: PRPU_node_modules_ejs_ejs_default().render(PRPU_src_ejs_ejs_pizyds_rain_conf_title),
  8345. container,
  8346. content: form_html,
  8347. html: true,
  8348. sanitize: false,
  8349. placement: "bottom",
  8350. customClass: "pizyds_rain_conf_popover",
  8351. trigger: "click",
  8352. offset: [-80, 8]
  8353. })
  8354.  
  8355. external_jQuery_default()("html").off();
  8356. external_jQuery_default()("html").on('click', function (e) {
  8357. var popoverEle = external_jQuery_default()('.pizyds_rain_conf_popover')[0];
  8358. if (
  8359. time_object.popover_can_hide < Date.now() &&
  8360. popoverEle &&
  8361. !external_jQuery_default()(buttonEle).is(e.target) &&
  8362. external_jQuery_default()(buttonEle).has(e.target).length == 0 &&
  8363. !external_jQuery_default()(popoverEle).is(e.target) &&
  8364. external_jQuery_default()(popoverEle).has(e.target).length == 0
  8365. ) {
  8366. external_jQuery_default()(popoverEle).popover('hide');
  8367. }
  8368. });
  8369.  
  8370. external_jQuery_default()(container).on('input change', "#pizyds_rain_answer_font_size_range", function(){
  8371. external_jQuery_default()("#pizyds_rain_answer_font_size_show").html(this.value);
  8372. })
  8373.  
  8374. external_jQuery_default()(container).on('change', "#pizyds_rain_answer_font_size_range", function(){
  8375. ans_config.fontSize = this.value;
  8376. })
  8377.  
  8378. external_jQuery_default()(container).on('change', "#pizyds_rain_answer_switch", function(){
  8379. ans_config.enabled = this.checked;
  8380. if (!ans_config.enabled) {
  8381. external_jQuery_default()("#pizyds_rain_answer_font_size_field")
  8382. .addClass("disabledField")
  8383. .find('input')
  8384. .attr('disabled', '');
  8385. } else{
  8386. external_jQuery_default()("#pizyds_rain_answer_font_size_field")
  8387. .removeClass("disabledField")
  8388. .find('input')
  8389. .removeAttr('disabled');
  8390. }
  8391. })
  8392.  
  8393. external_jQuery_default()(container).on('click', "#pizyds_rain_answer_font_size_default", function(){
  8394. external_jQuery_default()("#pizyds_rain_answer_font_size_range")
  8395. .prop("value", ans_config.$fontSize)
  8396. .trigger("change");
  8397. })
  8398.  
  8399. external_jQuery_default()(container).on('change', "#pizyds_rain_drm_switch", function(){
  8400. drm_config.enabled = this.checked;
  8401. })
  8402.  
  8403. //更新提示
  8404. if (judgeVersionUpdate()){
  8405. refreshHeaderMessage(textVersionUpdate[judgeVersionUpdate()]);
  8406. clearVersionUpdate();
  8407. }
  8408. }
  8409.  
  8410. /**
  8411. * Date对象转yyyy-MM-dd
  8412. * @param {Date} date Date对象
  8413. * @return {string} yyyy-MM-dd
  8414. */
  8415. function formatDate(date){
  8416. var yyyy = (date.getFullYear()).toString().padStart(4, "0");
  8417. var MM = (date.getMonth()+1).toString().padStart(2, "0");
  8418. var dd = (date.getDate()).toString().padStart(2, "0");
  8419. return [yyyy, MM, dd].join('-')
  8420. }
  8421.  
  8422. ;// CONCATENATED MODULE: PRPS\src\libs\get_url_slides.js
  8423. /**
  8424. * PPT图片链接提取
  8425. * @param {HTMLElement} el_dialog 整体 dialog DOM 对象
  8426. * @return {Array} 链接列表
  8427. */
  8428. function get_url_slides(el_dialog){
  8429. try{
  8430. var el_swiper = el_dialog.getElementsByClassName("pptSwiper")[0];
  8431. var el_slides = el_swiper.getElementsByClassName("swiper-slide");
  8432. var url_slides = new Array(el_slides.length);
  8433. for (let i = 0; i < el_slides.length; i++){
  8434. url_slides[i] = el_slides[i].getElementsByTagName("img")[0].src;
  8435. }
  8436. console.groupCollapsed(`雨课堂课件PDF下载工具:提取到 ${url_slides.length} PPT`);
  8437. console.table(url_slides);
  8438. console.groupEnd();
  8439. return url_slides;
  8440. } catch(err){
  8441. return new Array();
  8442. }
  8443. }
  8444. ;// CONCATENATED MODULE: PRPS\src\libs\image_process.js
  8445.  
  8446.  
  8447. /**
  8448. * 借助Canvas,进行图片下载与并转化为ImageData(RGBAData)
  8449. * @param url_slides 图片链接列表
  8450. * @return {Promise}
  8451. */
  8452. /* harmony default export */ function PRPU_src_libs_image_process(url_slides){
  8453. var promiseList = new Array(url_slides.length);
  8454. var finished_num = 0;
  8455. var count_finished_num = (index) => {
  8456. var processStatus = `${++finished_num}/${url_slides.length}`;
  8457. refreshProcessStatus(`处理图片(${processStatus})`);
  8458. console.log(`雨课堂课件PDF下载工具:${processStatus} - ${index+1}页 - ${url_slides[index]}`);
  8459. }
  8460. for (let i = 0; i < url_slides.length; i++){
  8461. promiseList[i] = url2ImgData(url_slides[i]).then(ImageData => {
  8462. count_finished_num(i);
  8463. return ImageData;
  8464. }).catch(err => {
  8465. console.error(err);
  8466. refreshProcessStatus(false);
  8467. refreshHeaderMessage(`图像处理出错(第${i+1}页:${url_slides[i]})`, 'Warn');
  8468. throw err;
  8469. });
  8470. }
  8471. return Promise.all(promiseList);
  8472. }
  8473. ;// CONCATENATED MODULE: external "jspdf"
  8474. const external_jspdf_namespaceObject = jspdf;
  8475. // EXTERNAL MODULE: PRPS\src\key\rsa_2048_pub.pem
  8476. var PRPU_src_key_rsa_2048_pub = __webpack_require__(507);
  8477. // EXTERNAL MODULE: PRPS\node_modules\uuid\index.js
  8478. var PRPU_node_modules_uuid_index = __webpack_require__(766);
  8479. ;// CONCATENATED MODULE: external "Crypt"
  8480. const external_Crypt_namespaceObject = Crypt;
  8481. var external_Crypt_default = /*#__PURE__*/__webpack_require__.n(external_Crypt_namespaceObject);
  8482. ;// CONCATENATED MODULE: PRPS\src\libs\rsa_drm.js
  8483.  
  8484.  
  8485.  
  8486.  
  8487.  
  8488. //小众的库,CDN上对WEB的模块引出方式和NODE有一点不一样
  8489. var crypt = new (external_Crypt_default())({ aesKeySize: 128 });
  8490.  
  8491. /**
  8492. * 生成 DRM 信息
  8493. * @return {string}
  8494. */
  8495. function generateUserID(){
  8496. var drm_json = {
  8497. build_info: build_info,
  8498. page_info: {url: window.location.href, timestamp: Date.now()},
  8499. user_profile: generateUserProfile(),
  8500. salt: (0,PRPU_node_modules_uuid_index.v4)()
  8501. };
  8502. var drm_text = JSON.stringify(drm_json);
  8503. var drm_rsa_json = crypt.encrypt(PRPU_src_key_rsa_2048_pub, drm_text);
  8504. var drm_rsa_obj = JSON.parse(drm_rsa_json);
  8505. var drm_rsa_obj_keys = {};
  8506. drm_rsa_obj_keys.fingerprint = Object.keys(drm_rsa_obj.keys)[0];
  8507. drm_rsa_obj_keys.key = drm_rsa_obj.keys[drm_rsa_obj_keys.fingerprint];
  8508. var drm_pizyds_rain_arr = [
  8509. drm_rsa_obj.iv,
  8510. hexFingerprint2Base64(drm_rsa_obj_keys.fingerprint),
  8511. drm_rsa_obj_keys.key,
  8512. drm_rsa_obj.cipher
  8513. ];
  8514. return drm_pizyds_rain_arr.join(":");
  8515. }
  8516.  
  8517. /**
  8518. * 生成 DRM 中的用户信息
  8519. * @return {string}
  8520. */
  8521. function generateUserProfile(){
  8522. var way_1 = JSON.parse(localStorage.getItem("user_profile"));
  8523. var way_2 = JSON.parse(localStorage.getItem("vuex")) && JSON.parse(localStorage.getItem("vuex")).userInfo;
  8524. var user_profile_raw = way_1 || way_2 || {};
  8525. var user_profile_name_raw = user_profile_raw.name || user_profile_raw.nickname || '?';
  8526. var user_profile_name = "";
  8527. var user_profile_name_choose = randomIntFromInterval(0, user_profile_name_raw.length - 1);
  8528. for (let i = 0; i < user_profile_name_raw.length; i++) {
  8529. user_profile_name += (i == user_profile_name_choose) ? user_profile_name_raw[i] : '*';
  8530. }
  8531. var user_profile = {
  8532. user_id: user_profile_raw.user_id || '?',
  8533. school_number: user_profile_raw.school_number || '?',
  8534. name: user_profile_name
  8535. }
  8536. return user_profile;
  8537. }
  8538.  
  8539. function hexFingerprint2Base64(hex){
  8540. var keyHexs = hex.split(':');
  8541. var uint8 = new Uint8Array(keyHexs.length);
  8542. keyHexs.forEach((value, index) => uint8[index] = parseInt(value, 16));
  8543. return window.btoa(String.fromCharCode.apply(null, uint8));
  8544. }
  8545.  
  8546. function randomIntFromInterval(min, max) {
  8547. return Math.floor(Math.random() * (max - min + 1) + min)
  8548. }
  8549. ;// CONCATENATED MODULE: PRPS\src\libs\pdf_process.js
  8550.  
  8551.  
  8552.  
  8553.  
  8554.  
  8555. /**
  8556. * 借助jsPDF,进行PDF的生成
  8557. * @param img_list 图片列表
  8558. * @param filename 保存的文件名
  8559. * @param answer_list 答案列表
  8560. * @return {Promise}
  8561. */
  8562. /* harmony default export */ async function PRPU_src_libs_pdf_process(img_list, filename, answer_list){
  8563. console.groupCollapsed("雨课堂课件PDF下载工具:生成PDF...");
  8564. var doc = new external_jspdf_namespaceObject.jsPDF({
  8565. orientation: "landscape",
  8566. unit: "px",
  8567. format: [img_list[0].width, img_list[0].height],
  8568. hotfixes: ["px_scaling"]
  8569. });
  8570. injectXMP(doc, [img_list[0].width, img_list[0].height]);
  8571.  
  8572. for (let i = 0; i < img_list.length; i++){
  8573. i > 0 && doc.addPage([img_list[i].width, img_list[i].height], "landscape");
  8574. await addPPT(i, doc, img_list, answer_list);
  8575. refreshProcessStatus(`生成PDF(${i+1}/${img_list.length})`);
  8576. await sleep(10);
  8577. }
  8578. console.groupEnd();
  8579. doc.save(filename);
  8580. console.log(`雨课堂课件PDF下载工具:完成下载`);
  8581. console.log(`雨课堂课件PDF下载工具:https://www.pizyds.com/rain-classroom-pdf-direct-download/`);
  8582. }
  8583.  
  8584. /**
  8585. * 附加 PPT 页面
  8586. * @param {number} index
  8587. * @param {jsPDF} doc jsPDF 对象
  8588. * @param {Array} answer_list 答案列表
  8589. * @return {Promise}
  8590. */
  8591. async function addPPT(index, doc, img_list, answer_list){
  8592. console.log(`雨课堂课件PDF下载工具:第 ${index+1} - PPT`);
  8593. doc.addImage({
  8594. imageData: img_list[index].url,
  8595. format: 'PNG',
  8596. x: 0,
  8597. y: 0,
  8598. width: img_list[index].width,
  8599. height: img_list[index].height,
  8600. compression: 'FAST'
  8601. });
  8602. if (ans_config.enabled){
  8603. let answer_item = answer_list.find(obj => obj.index == index);
  8604. if (answer_item && answer_item.ans != "") {
  8605. let answer_img = text2img(answer_item.ans, ans_config.fontSize, ans_config.fontColor);
  8606. console.log(`雨课堂课件PDF下载工具:第 ${index+1} - 答案 - ${answer_item.ans}`);
  8607. doc.addImage({
  8608. imageData: answer_img.url,
  8609. format: 'PNG',
  8610. x: img_list[index].width - answer_img.width - ans_config.right,
  8611. y: ans_config.up,
  8612. width: answer_img.width,
  8613. height: answer_img.height,
  8614. compression: 'FAST'
  8615. });
  8616. }
  8617. }
  8618. }
  8619.  
  8620. /**
  8621. * 注入 DRM 信息
  8622. * @param {jsPDF} doc jsPDF 对象
  8623. * @param {Array} size 当前 PPT 页面尺寸
  8624. * @return {void}
  8625. */
  8626. function injectXMP(doc, size){
  8627. if (drm_config.enabled){
  8628. console.log(`雨课堂课件PDF下载工具:注入数字版权信息`);
  8629. var userID = generateUserID();
  8630. var drmURL = "https://www.pizyds.com/rain-classroom-pdf-direct-download-pizyds-rain-drm/"
  8631. doc.addMetadata(userID, drmURL);
  8632. var drm_explain = `This file is automatically generated by the tampermonkey script "Rain Classroom PDF Direct Download", ` +
  8633. `and injected with DRM information through RSA+AES hybrid encryption. Please respect the copyright of the PPT publisher.\n\n` +
  8634. `For detailed information, please refer to:\n${drmURL}\n\nDRM information:`;
  8635. doc.text(size[1]*0.1, size[1]*0.1, [drm_explain, userID], { baseline: "top", maxWidth: 1000});
  8636. }
  8637. }
  8638. ;// CONCATENATED MODULE: PRPS\src\libs\get_html_slides.js
  8639. /**
  8640. * PPT HTML Class 标注(针对发布的“课件”类型)
  8641. * @param el_dialog 整体 dialog DOM 对象
  8642. * @return {Boolean}
  8643. */
  8644. function get_html_slides(el_dialog){
  8645. try{
  8646. var el_swiper = el_dialog.getElementsByClassName("pptSwiper")[0];
  8647. var el_slides = el_swiper.getElementsByClassName("swiper-slide");
  8648. for (let i = 0; i < el_slides.length; i++){
  8649. el_slides[i].classList.add("pizyds_el_slide");
  8650. el_slides[i].getElementsByClassName("courseware heightPriority")[0].classList.add("pizyds_el_ppt");
  8651. }
  8652. console.log(`雨课堂课件PDF下载工具:提取到 ${el_slides.length} PPT`);
  8653. return true;
  8654. } catch(err){
  8655. console.error(err);
  8656. return false;
  8657. }
  8658. }
  8659. ;// CONCATENATED MODULE: external "html2canvas"
  8660. const external_html2canvas_namespaceObject = html2canvas;
  8661. var external_html2canvas_default = /*#__PURE__*/__webpack_require__.n(external_html2canvas_namespaceObject);
  8662. ;// CONCATENATED MODULE: PRPS\src\libs\html2canvas_hd.js
  8663.  
  8664.  
  8665.  
  8666. var hd_sample_sacle = 4;
  8667. var hd_output_sacle = 2;
  8668.  
  8669. function oncloneFunction(clonedDocument, index, { c, pos }){
  8670. //画布准备,高采样
  8671. var el_ppts = clonedDocument.getElementsByClassName("pizyds_el_ppt");
  8672. var el_ppt = el_ppts[index];
  8673. el_ppt.style.transform = "translate3d(-50%, -50%, 0px)";
  8674. pos.w = el_ppt.getBoundingClientRect();
  8675. pos.o = { width: parseInt(el_ppt.style.width), height: parseInt(el_ppt.style.height) };
  8676. pos.e = { width: pos.o.width * hd_sample_sacle, height: pos.o.height * hd_sample_sacle };
  8677. console.log(pos);
  8678. c.width = pos.e.width;
  8679. c.height = pos.e.height;
  8680. var ctx = c.getContext("2d");
  8681. //ctx.imageSmoothingEnabled = false;
  8682. ctx.scale(pos.e.width / pos.w.width, pos.e.height / pos.w.height);
  8683. ctx.translate(- pos.w.left, - pos.w.top);
  8684.  
  8685. var el_slides = clonedDocument.getElementsByClassName("pizyds_el_slide");
  8686. el_slides = Array.from(el_slides);
  8687. for (let i = 0; i < index; i++) removeElement(el_slides[i]);
  8688. el_slides[index].style.opacity = 1;
  8689. el_slides[index].style.transform = "translate3d(0px, 0px, 0px)";
  8690. }
  8691.  
  8692. async function render(index, { el_ppts, processStatus }){
  8693. var c = document.createElement("canvas");
  8694. var pos = { w: null, o: null, e: null };
  8695.  
  8696. console.log(`雨课堂课件PDF下载工具:${processStatus} - 高采样`);
  8697. var el_ppt = el_ppts[index];
  8698. //html2canvas
  8699. console.groupCollapsed(`雨课堂课件PDF下载工具:${processStatus} - html2canvas 日志`);
  8700. return external_html2canvas_default()(el_ppt, {
  8701. logging: true,
  8702. useCORS: true,
  8703. canvas:c,
  8704. onclone: clonedDocument => oncloneFunction(clonedDocument, index, { c, pos })
  8705. }).then(() => {
  8706. console.groupEnd();
  8707. //压缩尺寸,低采样
  8708. console.log(`雨课堂课件PDF下载工具:${processStatus} - 低采样`);
  8709. var c2 = document.createElement('canvas');
  8710. c2.width = pos.o.width * hd_output_sacle;
  8711. c2.height = pos.o.height * hd_output_sacle;
  8712. var ctx2 = c2.getContext('2d');
  8713. ctx2.drawImage(c, 0, 0, c2.width, c2.height);
  8714. var dta = ctx2.getImageData(0, 0, c2.width, c2.height);
  8715. dta.url = c2.toDataURL();
  8716. return dta;
  8717. }).catch(err => {
  8718. console.error(err);
  8719. refreshProcessStatus(false);
  8720. refreshHeaderMessage(`HTML转高清Canvas出错(第${index+1}页)`, 'Warn');
  8721. throw err;
  8722. });
  8723. }
  8724.  
  8725. /**
  8726. * HTML转高清Canvas,一大堆神奇操作驯服原版html2canvas
  8727. * @return {Array} PPT 的 RAW 图片
  8728. */
  8729. /* harmony default export */ async function PRPU_src_libs_html2canvas_hd() {
  8730. console.groupCollapsed("雨课堂课件PDF下载工具:HTML转高清Canvas...");
  8731.  
  8732. var RGBAData_ppts = [];
  8733. var el_ppts = document.getElementsByClassName("pizyds_el_ppt");
  8734. refreshProcessStatus("转换HTML...");
  8735. for (let i = 0; i < el_ppts.length; i++){
  8736. var processStatus = `${i+1}/${el_ppts.length}`;
  8737. refreshProcessStatus(`转换HTML(${processStatus})`);
  8738. RGBAData_ppts[i] = await render(i, { el_ppts, processStatus });
  8739. console.log(`雨课堂课件PDF下载工具:${processStatus} - ${i+1}页 - size: ${RGBAData_ppts[i].data.length}, ${RGBAData_ppts[i].width}x${RGBAData_ppts[i].height}`);
  8740. }
  8741. console.groupEnd();
  8742. console.log(`雨课堂课件PDF下载工具:完成转换`);
  8743. return RGBAData_ppts;
  8744. }
  8745. ;// CONCATENATED MODULE: PRPS\src\libs\get_answers.js
  8746. /**
  8747. * 获取客观题答案
  8748. * @param url_slides PPT URL 列表
  8749. * @return {Array} 答案列表
  8750. */
  8751. function get_answers(url_slides){
  8752. var el_problem = document.getElementById("problem");
  8753. var answer_list = [];
  8754. if (el_problem){
  8755. var el_exercises_info = el_problem.getElementsByClassName("exercises_info");
  8756. for (let i = 0; i < el_exercises_info.length; i++){
  8757. let el_url = el_exercises_info[i].querySelector(".img_box>img");
  8758. let el_ans = el_exercises_info[i].querySelector(".answer_info>.correct_answer");
  8759. var answer_item = { url: el_url ? el_url.src : "", ans: el_ans ? el_ans.innerText : "", index: -1 };
  8760. answer_item.index = url_slides.indexOf(answer_item.url);
  8761. answer_list.push(answer_item);
  8762. }
  8763. }
  8764. console.groupCollapsed(`雨课堂课件PDF下载工具:提取到 ${answer_list.length} 项答案`);
  8765. console.table(answer_list);
  8766. console.groupEnd();
  8767. return answer_list;
  8768. }
  8769. ;// CONCATENATED MODULE: PRPS\src\libs\download_process.js
  8770.  
  8771.  
  8772.  
  8773.  
  8774.  
  8775.  
  8776.  
  8777.  
  8778.  
  8779. /**
  8780. * 按钮触发PDF生成逻辑
  8781. * @param el_dialog 整体 dialog DOM 对象
  8782. * @param url_type URL 类型
  8783. * @return {void}
  8784. */
  8785. /* harmony default export */ function PRPU_src_libs_download_process(el_dialog, url_type = 1){
  8786. var type_fun = [{
  8787. type: 0,
  8788. fun: () => {
  8789. console.log(`雨课堂课件PDF下载工具:PDF生成逻辑未知错误 - type ${url_type}`);
  8790. return false;
  8791. }
  8792. },{
  8793. type: 1,
  8794. fun: () => {
  8795. var url_slides = get_url_slides(el_dialog);
  8796. if (url_slides.length > 0){
  8797. refreshProcessStatus("处理图片...");
  8798. console.groupCollapsed("雨课堂课件PDF下载工具:处理图片...");
  8799. PRPU_src_libs_image_process(url_slides)
  8800. .then(async img_list => {
  8801. console.groupEnd();
  8802. refreshProcessStatus("生成PDF...");
  8803. await sleep(200);
  8804. var ppt_name = document.getElementsByClassName("ppt_name")[0].innerText;
  8805. var filename = ppt_name + ".pdf";
  8806. var answer_list = ans_config.enabled ? get_answers(url_slides): [];
  8807. await PRPU_src_libs_pdf_process(img_list, filename, answer_list).catch(err => {
  8808. console.error(err);
  8809. refreshProcessStatus(false);
  8810. refreshHeaderMessage("PDF生成出错", 'Warn');
  8811. throw err;
  8812. });
  8813. refreshProcessStatus(false);
  8814. })
  8815. } else{
  8816. refreshProcessStatus(false);
  8817. refreshHeaderMessage("没有提取到图片", 'Warn');
  8818. }
  8819. }
  8820. },{
  8821. type: 2,
  8822. fun: () => {
  8823. var html_slides = get_html_slides(el_dialog);
  8824. if (html_slides){
  8825. refreshProcessStatus("处理HTML...");
  8826. //HTML转图片
  8827. PRPU_src_libs_html2canvas_hd().then(async img_list => {
  8828. refreshProcessStatus("生成PDF...");
  8829. await sleep(200);
  8830. var ppt_name = document.getElementsByClassName("ppt_name")[0].innerText;
  8831. var filename = ppt_name + ".pdf";
  8832. var answer_list = [];
  8833. await PRPU_src_libs_pdf_process(img_list, filename, answer_list).catch(err => {
  8834. console.error(err);
  8835. refreshProcessStatus(false);
  8836. refreshHeaderMessage("PDF生成出错", 'Warn');
  8837. throw err;
  8838. });
  8839. refreshProcessStatus(false);
  8840. })
  8841. } else{
  8842. refreshProcessStatus(false);
  8843. refreshHeaderMessage("没有提取到图片", 'Warn');
  8844. }
  8845. }
  8846. }];
  8847. return type_fun.find(value => value.type == url_type).fun();
  8848. }
  8849.  
  8850. // EXTERNAL MODULE: PRPS\src\ejs\ejs_pizyds_rain_download_button.ejs
  8851. var PRPU_src_ejs_ejs_pizyds_rain_download_button = __webpack_require__(351);
  8852. ;// CONCATENATED MODULE: PRPS\src\libs\button_download.js
  8853.  
  8854.  
  8855.  
  8856.  
  8857.  
  8858.  
  8859.  
  8860.  
  8861.  
  8862. /**
  8863. * 按钮注入
  8864. * @param el_dialog 整体 dialog DOM 对象
  8865. * @param url_type URL 类型
  8866. * @return {void}
  8867. */
  8868. function button_download(el_dialog, url_type = 1){
  8869. if (!data_on_type[url_type]){
  8870. console.log(`雨课堂课件PDF下载工具:按钮注入未知错误 - type ${url_type}`);
  8871. return false;
  8872. }
  8873. var el_header = header_on_type[url_type](el_dialog);
  8874. if (!el_header){
  8875. console.log(`雨课堂课件PDF下载工具:layout header 查找失败`);
  8876. return false;
  8877. }
  8878. if (external_jQuery_default()(el_header).find("#pizyds_rain_button_field").length == 0){
  8879. try {
  8880. external_jQuery_default()(el_dialog).addClass("pizyds_rain"); //自定义CSS启用的条件
  8881. var template = PRPU_node_modules_ejs_ejs_default().compile(PRPU_src_ejs_ejs_pizyds_rain_download_button);
  8882. var data = Object.assign(data_on_type["base"], data_on_type[url_type]);
  8883. var html = template(data);
  8884. external_jQuery_default()(el_header).find(`.${data.CLASS}`).first().before(html);
  8885. external_jQuery_default()("#pizyds_rain_download_button").off();
  8886. external_jQuery_default()("#pizyds_rain_download_button").on("click", () => PRPU_src_libs_download_process(el_dialog, url_type));
  8887. PRPU_src_libs_conf_panel(external_jQuery_default()("#pizyds_rain_config_button"));
  8888.  
  8889. if (url_type == 2) refreshHeaderMessage('“课件”类型不支持添加选择题答案', 'Info', false);
  8890. console.log(`雨课堂课件PDF下载工具:按钮注入成功 - type ${url_type}`);
  8891. } catch (err) {
  8892. return false;
  8893. }
  8894. }
  8895. return true;
  8896. }
  8897.  
  8898. var data_on_type = {
  8899. base: {
  8900. CLASS: "",
  8901. FIELD_CLASS: "",
  8902. DOWNLOAD_BUTTON_ICON: adjustSVGSize(PRPU_node_modules_bootstrap_icons_icons_file_earmark_pdf, 14),
  8903. CONFIG_BUTTON_ICON: adjustSVGSize(PRPU_node_modules_bootstrap_icons_icons_gear_fill, 14),
  8904. RUNNING_BUTTON_ICON: addSVGClass(adjustSVGSize(PRPU_node_modules_bootstrap_icons_icons_gear_fill, 14), 'rotating')
  8905. },
  8906. 1: {
  8907. CLASS: "print",
  8908. FIELD_CLASS: "pizyds_rain_button_field_type_1",
  8909. },
  8910. 2: {
  8911. CLASS: "button"
  8912. }
  8913. }
  8914.  
  8915. var header_on_type = {
  8916. 1: (el_dialog) => external_jQuery_default()(el_dialog).find(".layout_header").first(),
  8917. 2: (el_dialog) => external_jQuery_default()(el_dialog).find(".layout-header").first()
  8918. }
  8919. ;// CONCATENATED MODULE: PRPS\src\index.js
  8920.  
  8921.  
  8922.  
  8923. var realTimeSearchError = {
  8924. count: () => {
  8925. realTimeSearchError.num++;
  8926. if (realTimeSearchError.num > realTimeSearchError.maxNum){
  8927. clearInterval(realTimeSearchError.interval);
  8928. realTimeSearchError.num = 0;
  8929. console.log("雨课堂课件PDF下载工具:按钮注入超时,请重新刷新网页,或提交反馈");
  8930. alert("雨课堂课件PDF下载工具:按钮注入超时,请重新刷新网页,或提交反馈");
  8931. }
  8932. },
  8933. num: 0,
  8934. maxNum: 25,
  8935. interval: null
  8936. }
  8937.  
  8938. if (!checkFlagMeta()){
  8939. addFlagMeta();
  8940. console.log("雨课堂课件PDF下载工具:已载入");
  8941. //实时查找PPT窗口
  8942. realTimeSearchError.interval = setInterval(()=>{
  8943. var url_type, el_dialog;
  8944. (url_type = check_url()) && (el_dialog = find_basePPTDialog()) && !button_download(el_dialog, url_type) && realTimeSearchError.count();
  8945. }, 200);
  8946. }
  8947.  
  8948. function addFlagMeta(){
  8949. var flagMeta = document.createElement('meta');
  8950. flagMeta.name = 'pizyds_rain';
  8951. flagMeta.content = 'https://www.pizyds.com/rain-classroom-pdf-direct-download';
  8952. document.head.appendChild(flagMeta);
  8953. }
  8954.  
  8955. function checkFlagMeta(){
  8956. return document.head.querySelector("[name~=pizyds_rain]");
  8957. }
  8958.  
  8959. //更改为内部校验链接,因为大量ajax页面跳转的存在
  8960. function check_url(){
  8961. var url_found = url_match.find(value => value.reg.test(window.location.href));
  8962. if (url_found){
  8963. return url_found.type;
  8964. } else{
  8965. return false;
  8966. }
  8967. }
  8968.  
  8969. //查找PPT窗口
  8970. function find_basePPTDialog(){
  8971. var el_dialogs = document.getElementsByClassName("basePPTDialog");
  8972. if (el_dialogs.length == 1){
  8973. return el_dialogs[0];
  8974. } else{
  8975. return false;
  8976. }
  8977. }
  8978.  
  8979. })();
  8980.  
  8981. /******/ })()
  8982. ;