index.cjs.js 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  1. "use strict";
  2. var __defProp = Object.defineProperty;
  3. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  4. var __getOwnPropNames = Object.getOwnPropertyNames;
  5. var __hasOwnProp = Object.prototype.hasOwnProperty;
  6. var __export = (target, all) => {
  7. for (var name in all)
  8. __defProp(target, name, { get: all[name], enumerable: true });
  9. };
  10. var __copyProps = (to, from, except, desc) => {
  11. if (from && typeof from === "object" || typeof from === "function") {
  12. for (let key of __getOwnPropNames(from))
  13. if (!__hasOwnProp.call(to, key) && key !== except)
  14. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  15. }
  16. return to;
  17. };
  18. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  19. // src/index.ts
  20. var src_exports = {};
  21. __export(src_exports, {
  22. createPopper: () => createPopper,
  23. offsetModifier: () => offset_default
  24. });
  25. module.exports = __toCommonJS(src_exports);
  26. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindow.js
  27. function getWindow(node) {
  28. if (node == null) {
  29. return window;
  30. }
  31. if (node.toString() !== "[object Window]") {
  32. var ownerDocument = node.ownerDocument;
  33. return ownerDocument ? ownerDocument.defaultView || window : window;
  34. }
  35. return node;
  36. }
  37. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
  38. function isElement(node) {
  39. var OwnElement = getWindow(node).Element;
  40. return node instanceof OwnElement || node instanceof Element;
  41. }
  42. function isHTMLElement(node) {
  43. var OwnElement = getWindow(node).HTMLElement;
  44. return node instanceof OwnElement || node instanceof HTMLElement;
  45. }
  46. function isShadowRoot(node) {
  47. if (typeof ShadowRoot === "undefined") {
  48. return false;
  49. }
  50. var OwnElement = getWindow(node).ShadowRoot;
  51. return node instanceof OwnElement || node instanceof ShadowRoot;
  52. }
  53. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/math.js
  54. var round = Math.round;
  55. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/userAgent.js
  56. function getUAString() {
  57. var uaData = navigator.userAgentData;
  58. if (uaData != null && uaData.brands) {
  59. return uaData.brands.map(function(item) {
  60. return item.brand + "/" + item.version;
  61. }).join(" ");
  62. }
  63. return navigator.userAgent;
  64. }
  65. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
  66. function isLayoutViewport() {
  67. return !/^((?!chrome|android).)*safari/i.test(getUAString());
  68. }
  69. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
  70. function getBoundingClientRect(element, includeScale, isFixedStrategy) {
  71. if (includeScale === void 0) {
  72. includeScale = false;
  73. }
  74. if (isFixedStrategy === void 0) {
  75. isFixedStrategy = false;
  76. }
  77. var clientRect = element.getBoundingClientRect();
  78. var scaleX = 1;
  79. var scaleY = 1;
  80. if (includeScale && isHTMLElement(element)) {
  81. scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
  82. scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
  83. }
  84. var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
  85. var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
  86. var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
  87. var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
  88. var width = clientRect.width / scaleX;
  89. var height = clientRect.height / scaleY;
  90. return {
  91. width,
  92. height,
  93. top: y,
  94. right: x + width,
  95. bottom: y + height,
  96. left: x,
  97. x,
  98. y
  99. };
  100. }
  101. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
  102. function getWindowScroll(node) {
  103. var win = getWindow(node);
  104. var scrollLeft = win.pageXOffset;
  105. var scrollTop = win.pageYOffset;
  106. return {
  107. scrollLeft,
  108. scrollTop
  109. };
  110. }
  111. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
  112. function getHTMLElementScroll(element) {
  113. return {
  114. scrollLeft: element.scrollLeft,
  115. scrollTop: element.scrollTop
  116. };
  117. }
  118. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
  119. function getNodeScroll(node) {
  120. if (node === getWindow(node) || !isHTMLElement(node)) {
  121. return getWindowScroll(node);
  122. } else {
  123. return getHTMLElementScroll(node);
  124. }
  125. }
  126. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
  127. function getNodeName(element) {
  128. return element ? (element.nodeName || "").toLowerCase() : null;
  129. }
  130. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
  131. function getDocumentElement(element) {
  132. return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
  133. }
  134. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
  135. function getWindowScrollBarX(element) {
  136. return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
  137. }
  138. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
  139. function getComputedStyle(element) {
  140. return getWindow(element).getComputedStyle(element);
  141. }
  142. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
  143. function isScrollParent(element) {
  144. var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
  145. return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
  146. }
  147. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
  148. function isElementScaled(element) {
  149. var rect = element.getBoundingClientRect();
  150. var scaleX = round(rect.width) / element.offsetWidth || 1;
  151. var scaleY = round(rect.height) / element.offsetHeight || 1;
  152. return scaleX !== 1 || scaleY !== 1;
  153. }
  154. function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
  155. if (isFixed === void 0) {
  156. isFixed = false;
  157. }
  158. var isOffsetParentAnElement = isHTMLElement(offsetParent);
  159. var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
  160. var documentElement = getDocumentElement(offsetParent);
  161. var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
  162. var scroll = {
  163. scrollLeft: 0,
  164. scrollTop: 0
  165. };
  166. var offsets = {
  167. x: 0,
  168. y: 0
  169. };
  170. if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
  171. if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
  172. scroll = getNodeScroll(offsetParent);
  173. }
  174. if (isHTMLElement(offsetParent)) {
  175. offsets = getBoundingClientRect(offsetParent, true);
  176. offsets.x += offsetParent.clientLeft;
  177. offsets.y += offsetParent.clientTop;
  178. } else if (documentElement) {
  179. offsets.x = getWindowScrollBarX(documentElement);
  180. }
  181. }
  182. return {
  183. x: rect.left + scroll.scrollLeft - offsets.x,
  184. y: rect.top + scroll.scrollTop - offsets.y,
  185. width: rect.width,
  186. height: rect.height
  187. };
  188. }
  189. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
  190. function getLayoutRect(element) {
  191. var clientRect = getBoundingClientRect(element);
  192. var width = element.offsetWidth;
  193. var height = element.offsetHeight;
  194. if (Math.abs(clientRect.width - width) <= 1) {
  195. width = clientRect.width;
  196. }
  197. if (Math.abs(clientRect.height - height) <= 1) {
  198. height = clientRect.height;
  199. }
  200. return {
  201. x: element.offsetLeft,
  202. y: element.offsetTop,
  203. width,
  204. height
  205. };
  206. }
  207. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
  208. function getParentNode(element) {
  209. if (getNodeName(element) === "html") {
  210. return element;
  211. }
  212. return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
  213. }
  214. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
  215. function getScrollParent(node) {
  216. if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
  217. return node.ownerDocument.body;
  218. }
  219. if (isHTMLElement(node) && isScrollParent(node)) {
  220. return node;
  221. }
  222. return getScrollParent(getParentNode(node));
  223. }
  224. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
  225. function listScrollParents(element, list) {
  226. var _element$ownerDocumen;
  227. if (list === void 0) {
  228. list = [];
  229. }
  230. var scrollParent = getScrollParent(element);
  231. var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
  232. var win = getWindow(scrollParent);
  233. var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
  234. var updatedList = list.concat(target);
  235. return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
  236. }
  237. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
  238. function isTableElement(element) {
  239. return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
  240. }
  241. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
  242. function getTrueOffsetParent(element) {
  243. if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
  244. return null;
  245. }
  246. return element.offsetParent;
  247. }
  248. function getContainingBlock(element) {
  249. var isFirefox = /firefox/i.test(getUAString());
  250. var isIE = /Trident/i.test(getUAString());
  251. if (isIE && isHTMLElement(element)) {
  252. var elementCss = getComputedStyle(element);
  253. if (elementCss.position === "fixed") {
  254. return null;
  255. }
  256. }
  257. var currentNode = getParentNode(element);
  258. if (isShadowRoot(currentNode)) {
  259. currentNode = currentNode.host;
  260. }
  261. while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
  262. var css = getComputedStyle(currentNode);
  263. 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") {
  264. return currentNode;
  265. } else {
  266. currentNode = currentNode.parentNode;
  267. }
  268. }
  269. return null;
  270. }
  271. function getOffsetParent(element) {
  272. var window2 = getWindow(element);
  273. var offsetParent = getTrueOffsetParent(element);
  274. while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
  275. offsetParent = getTrueOffsetParent(offsetParent);
  276. }
  277. if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
  278. return window2;
  279. }
  280. return offsetParent || getContainingBlock(element) || window2;
  281. }
  282. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/enums.js
  283. var top = "top";
  284. var bottom = "bottom";
  285. var right = "right";
  286. var left = "left";
  287. var auto = "auto";
  288. var basePlacements = [top, bottom, right, left];
  289. var start = "start";
  290. var end = "end";
  291. var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
  292. return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
  293. }, []);
  294. var beforeRead = "beforeRead";
  295. var read = "read";
  296. var afterRead = "afterRead";
  297. var beforeMain = "beforeMain";
  298. var main = "main";
  299. var afterMain = "afterMain";
  300. var beforeWrite = "beforeWrite";
  301. var write = "write";
  302. var afterWrite = "afterWrite";
  303. var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
  304. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/orderModifiers.js
  305. function order(modifiers) {
  306. var map = /* @__PURE__ */ new Map();
  307. var visited = /* @__PURE__ */ new Set();
  308. var result = [];
  309. modifiers.forEach(function(modifier) {
  310. map.set(modifier.name, modifier);
  311. });
  312. function sort(modifier) {
  313. visited.add(modifier.name);
  314. var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
  315. requires.forEach(function(dep) {
  316. if (!visited.has(dep)) {
  317. var depModifier = map.get(dep);
  318. if (depModifier) {
  319. sort(depModifier);
  320. }
  321. }
  322. });
  323. result.push(modifier);
  324. }
  325. modifiers.forEach(function(modifier) {
  326. if (!visited.has(modifier.name)) {
  327. sort(modifier);
  328. }
  329. });
  330. return result;
  331. }
  332. function orderModifiers(modifiers) {
  333. var orderedModifiers = order(modifiers);
  334. return modifierPhases.reduce(function(acc, phase) {
  335. return acc.concat(orderedModifiers.filter(function(modifier) {
  336. return modifier.phase === phase;
  337. }));
  338. }, []);
  339. }
  340. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/debounce.js
  341. function debounce(fn2) {
  342. var pending;
  343. return function() {
  344. if (!pending) {
  345. pending = new Promise(function(resolve) {
  346. Promise.resolve().then(function() {
  347. pending = void 0;
  348. resolve(fn2());
  349. });
  350. });
  351. }
  352. return pending;
  353. };
  354. }
  355. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/format.js
  356. function format(str) {
  357. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  358. args[_key - 1] = arguments[_key];
  359. }
  360. return [].concat(args).reduce(function(p, c) {
  361. return p.replace(/%s/, c);
  362. }, str);
  363. }
  364. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/validateModifiers.js
  365. var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
  366. var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
  367. var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
  368. function validateModifiers(modifiers) {
  369. modifiers.forEach(function(modifier) {
  370. [].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index, self) {
  371. return self.indexOf(value) === index;
  372. }).forEach(function(key) {
  373. switch (key) {
  374. case "name":
  375. if (typeof modifier.name !== "string") {
  376. console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"'));
  377. }
  378. break;
  379. case "enabled":
  380. if (typeof modifier.enabled !== "boolean") {
  381. console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"'));
  382. }
  383. break;
  384. case "phase":
  385. if (modifierPhases.indexOf(modifier.phase) < 0) {
  386. console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"'));
  387. }
  388. break;
  389. case "fn":
  390. if (typeof modifier.fn !== "function") {
  391. console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"'));
  392. }
  393. break;
  394. case "effect":
  395. if (modifier.effect != null && typeof modifier.effect !== "function") {
  396. console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"'));
  397. }
  398. break;
  399. case "requires":
  400. if (modifier.requires != null && !Array.isArray(modifier.requires)) {
  401. console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"'));
  402. }
  403. break;
  404. case "requiresIfExists":
  405. if (!Array.isArray(modifier.requiresIfExists)) {
  406. console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"'));
  407. }
  408. break;
  409. case "options":
  410. case "data":
  411. break;
  412. default:
  413. console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) {
  414. return '"' + s + '"';
  415. }).join(", ") + '; but "' + key + '" was provided.');
  416. }
  417. modifier.requires && modifier.requires.forEach(function(requirement) {
  418. if (modifiers.find(function(mod) {
  419. return mod.name === requirement;
  420. }) == null) {
  421. console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
  422. }
  423. });
  424. });
  425. });
  426. }
  427. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/uniqueBy.js
  428. function uniqueBy(arr, fn2) {
  429. var identifiers = /* @__PURE__ */ new Set();
  430. return arr.filter(function(item) {
  431. var identifier = fn2(item);
  432. if (!identifiers.has(identifier)) {
  433. identifiers.add(identifier);
  434. return true;
  435. }
  436. });
  437. }
  438. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getBasePlacement.js
  439. function getBasePlacement(placement) {
  440. return placement.split("-")[0];
  441. }
  442. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/mergeByName.js
  443. function mergeByName(modifiers) {
  444. var merged = modifiers.reduce(function(merged2, current) {
  445. var existing = merged2[current.name];
  446. merged2[current.name] = existing ? Object.assign({}, existing, current, {
  447. options: Object.assign({}, existing.options, current.options),
  448. data: Object.assign({}, existing.data, current.data)
  449. }) : current;
  450. return merged2;
  451. }, {});
  452. return Object.keys(merged).map(function(key) {
  453. return merged[key];
  454. });
  455. }
  456. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getVariation.js
  457. function getVariation(placement) {
  458. return placement.split("-")[1];
  459. }
  460. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
  461. function getMainAxisFromPlacement(placement) {
  462. return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
  463. }
  464. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/computeOffsets.js
  465. function computeOffsets(_ref) {
  466. var reference = _ref.reference, element = _ref.element, placement = _ref.placement;
  467. var basePlacement = placement ? getBasePlacement(placement) : null;
  468. var variation = placement ? getVariation(placement) : null;
  469. var commonX = reference.x + reference.width / 2 - element.width / 2;
  470. var commonY = reference.y + reference.height / 2 - element.height / 2;
  471. var offsets;
  472. switch (basePlacement) {
  473. case top:
  474. offsets = {
  475. x: commonX,
  476. y: reference.y - element.height
  477. };
  478. break;
  479. case bottom:
  480. offsets = {
  481. x: commonX,
  482. y: reference.y + reference.height
  483. };
  484. break;
  485. case right:
  486. offsets = {
  487. x: reference.x + reference.width,
  488. y: commonY
  489. };
  490. break;
  491. case left:
  492. offsets = {
  493. x: reference.x - element.width,
  494. y: commonY
  495. };
  496. break;
  497. default:
  498. offsets = {
  499. x: reference.x,
  500. y: reference.y
  501. };
  502. }
  503. var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
  504. if (mainAxis != null) {
  505. var len = mainAxis === "y" ? "height" : "width";
  506. switch (variation) {
  507. case start:
  508. offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
  509. break;
  510. case end:
  511. offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
  512. break;
  513. default:
  514. }
  515. }
  516. return offsets;
  517. }
  518. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/createPopper.js
  519. var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.";
  520. 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.";
  521. var DEFAULT_OPTIONS = {
  522. placement: "bottom",
  523. modifiers: [],
  524. strategy: "absolute"
  525. };
  526. function areValidElements() {
  527. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  528. args[_key] = arguments[_key];
  529. }
  530. return !args.some(function(element) {
  531. return !(element && typeof element.getBoundingClientRect === "function");
  532. });
  533. }
  534. function popperGenerator(generatorOptions) {
  535. if (generatorOptions === void 0) {
  536. generatorOptions = {};
  537. }
  538. var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
  539. return function createPopper2(reference, popper, options) {
  540. if (options === void 0) {
  541. options = defaultOptions;
  542. }
  543. var state = {
  544. placement: "bottom",
  545. orderedModifiers: [],
  546. options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
  547. modifiersData: {},
  548. elements: {
  549. reference,
  550. popper
  551. },
  552. attributes: {},
  553. styles: {}
  554. };
  555. var effectCleanupFns = [];
  556. var isDestroyed = false;
  557. var instance = {
  558. state,
  559. setOptions: function setOptions(setOptionsAction) {
  560. var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
  561. cleanupModifierEffects();
  562. state.options = Object.assign({}, defaultOptions, state.options, options2);
  563. state.scrollParents = {
  564. reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
  565. popper: listScrollParents(popper)
  566. };
  567. var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
  568. state.orderedModifiers = orderedModifiers.filter(function(m) {
  569. return m.enabled;
  570. });
  571. if (true) {
  572. var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) {
  573. var name = _ref.name;
  574. return name;
  575. });
  576. validateModifiers(modifiers);
  577. if (getBasePlacement(state.options.placement) === auto) {
  578. var flipModifier = state.orderedModifiers.find(function(_ref2) {
  579. var name = _ref2.name;
  580. return name === "flip";
  581. });
  582. if (!flipModifier) {
  583. console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
  584. }
  585. }
  586. var _getComputedStyle = getComputedStyle(popper), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;
  587. if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) {
  588. return parseFloat(margin);
  589. })) {
  590. console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
  591. }
  592. }
  593. runModifierEffects();
  594. return instance.update();
  595. },
  596. forceUpdate: function forceUpdate() {
  597. if (isDestroyed) {
  598. return;
  599. }
  600. var _state$elements = state.elements, reference2 = _state$elements.reference, popper2 = _state$elements.popper;
  601. if (!areValidElements(reference2, popper2)) {
  602. if (true) {
  603. console.error(INVALID_ELEMENT_ERROR);
  604. }
  605. return;
  606. }
  607. state.rects = {
  608. reference: getCompositeRect(reference2, getOffsetParent(popper2), state.options.strategy === "fixed"),
  609. popper: getLayoutRect(popper2)
  610. };
  611. state.reset = false;
  612. state.placement = state.options.placement;
  613. state.orderedModifiers.forEach(function(modifier) {
  614. return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
  615. });
  616. var __debug_loops__ = 0;
  617. for (var index = 0; index < state.orderedModifiers.length; index++) {
  618. if (true) {
  619. __debug_loops__ += 1;
  620. if (__debug_loops__ > 100) {
  621. console.error(INFINITE_LOOP_ERROR);
  622. break;
  623. }
  624. }
  625. if (state.reset === true) {
  626. state.reset = false;
  627. index = -1;
  628. continue;
  629. }
  630. var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
  631. if (typeof fn2 === "function") {
  632. state = fn2({
  633. state,
  634. options: _options,
  635. name,
  636. instance
  637. }) || state;
  638. }
  639. }
  640. },
  641. update: debounce(function() {
  642. return new Promise(function(resolve) {
  643. instance.forceUpdate();
  644. resolve(state);
  645. });
  646. }),
  647. destroy: function destroy() {
  648. cleanupModifierEffects();
  649. isDestroyed = true;
  650. }
  651. };
  652. if (!areValidElements(reference, popper)) {
  653. if (true) {
  654. console.error(INVALID_ELEMENT_ERROR);
  655. }
  656. return instance;
  657. }
  658. instance.setOptions(options).then(function(state2) {
  659. if (!isDestroyed && options.onFirstUpdate) {
  660. options.onFirstUpdate(state2);
  661. }
  662. });
  663. function runModifierEffects() {
  664. state.orderedModifiers.forEach(function(_ref3) {
  665. var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect3 = _ref3.effect;
  666. if (typeof effect3 === "function") {
  667. var cleanupFn = effect3({
  668. state,
  669. name,
  670. instance,
  671. options: options2
  672. });
  673. var noopFn = function noopFn2() {
  674. };
  675. effectCleanupFns.push(cleanupFn || noopFn);
  676. }
  677. });
  678. }
  679. function cleanupModifierEffects() {
  680. effectCleanupFns.forEach(function(fn2) {
  681. return fn2();
  682. });
  683. effectCleanupFns = [];
  684. }
  685. return instance;
  686. };
  687. }
  688. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/eventListeners.js
  689. var passive = {
  690. passive: true
  691. };
  692. function effect(_ref) {
  693. var state = _ref.state, instance = _ref.instance, options = _ref.options;
  694. var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
  695. var window2 = getWindow(state.elements.popper);
  696. var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
  697. if (scroll) {
  698. scrollParents.forEach(function(scrollParent) {
  699. scrollParent.addEventListener("scroll", instance.update, passive);
  700. });
  701. }
  702. if (resize) {
  703. window2.addEventListener("resize", instance.update, passive);
  704. }
  705. return function() {
  706. if (scroll) {
  707. scrollParents.forEach(function(scrollParent) {
  708. scrollParent.removeEventListener("scroll", instance.update, passive);
  709. });
  710. }
  711. if (resize) {
  712. window2.removeEventListener("resize", instance.update, passive);
  713. }
  714. };
  715. }
  716. var eventListeners_default = {
  717. name: "eventListeners",
  718. enabled: true,
  719. phase: "write",
  720. fn: function fn() {
  721. },
  722. effect,
  723. data: {}
  724. };
  725. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
  726. function popperOffsets(_ref) {
  727. var state = _ref.state, name = _ref.name;
  728. state.modifiersData[name] = computeOffsets({
  729. reference: state.rects.reference,
  730. element: state.rects.popper,
  731. strategy: "absolute",
  732. placement: state.placement
  733. });
  734. }
  735. var popperOffsets_default = {
  736. name: "popperOffsets",
  737. enabled: true,
  738. phase: "read",
  739. fn: popperOffsets,
  740. data: {}
  741. };
  742. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/computeStyles.js
  743. var unsetSides = {
  744. top: "auto",
  745. right: "auto",
  746. bottom: "auto",
  747. left: "auto"
  748. };
  749. function roundOffsetsByDPR(_ref) {
  750. var x = _ref.x, y = _ref.y;
  751. var win = window;
  752. var dpr = win.devicePixelRatio || 1;
  753. return {
  754. x: round(x * dpr) / dpr || 0,
  755. y: round(y * dpr) / dpr || 0
  756. };
  757. }
  758. function mapToStyles(_ref2) {
  759. var _Object$assign2;
  760. var popper = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
  761. var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
  762. var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
  763. x,
  764. y
  765. }) : {
  766. x,
  767. y
  768. };
  769. x = _ref3.x;
  770. y = _ref3.y;
  771. var hasX = offsets.hasOwnProperty("x");
  772. var hasY = offsets.hasOwnProperty("y");
  773. var sideX = left;
  774. var sideY = top;
  775. var win = window;
  776. if (adaptive) {
  777. var offsetParent = getOffsetParent(popper);
  778. var heightProp = "clientHeight";
  779. var widthProp = "clientWidth";
  780. if (offsetParent === getWindow(popper)) {
  781. offsetParent = getDocumentElement(popper);
  782. if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
  783. heightProp = "scrollHeight";
  784. widthProp = "scrollWidth";
  785. }
  786. }
  787. offsetParent = offsetParent;
  788. if (placement === top || (placement === left || placement === right) && variation === end) {
  789. sideY = bottom;
  790. var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
  791. y -= offsetY - popperRect.height;
  792. y *= gpuAcceleration ? 1 : -1;
  793. }
  794. if (placement === left || (placement === top || placement === bottom) && variation === end) {
  795. sideX = right;
  796. var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
  797. x -= offsetX - popperRect.width;
  798. x *= gpuAcceleration ? 1 : -1;
  799. }
  800. }
  801. var commonStyles = Object.assign({
  802. position
  803. }, adaptive && unsetSides);
  804. var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
  805. x,
  806. y
  807. }) : {
  808. x,
  809. y
  810. };
  811. x = _ref4.x;
  812. y = _ref4.y;
  813. if (gpuAcceleration) {
  814. var _Object$assign;
  815. return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
  816. }
  817. return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
  818. }
  819. function computeStyles(_ref5) {
  820. var state = _ref5.state, options = _ref5.options;
  821. var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
  822. if (true) {
  823. var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || "";
  824. if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) {
  825. return transitionProperty.indexOf(property) >= 0;
  826. })) {
  827. console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
  828. }
  829. }
  830. var commonStyles = {
  831. placement: getBasePlacement(state.placement),
  832. variation: getVariation(state.placement),
  833. popper: state.elements.popper,
  834. popperRect: state.rects.popper,
  835. gpuAcceleration,
  836. isFixed: state.options.strategy === "fixed"
  837. };
  838. if (state.modifiersData.popperOffsets != null) {
  839. state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
  840. offsets: state.modifiersData.popperOffsets,
  841. position: state.options.strategy,
  842. adaptive,
  843. roundOffsets
  844. })));
  845. }
  846. if (state.modifiersData.arrow != null) {
  847. state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
  848. offsets: state.modifiersData.arrow,
  849. position: "absolute",
  850. adaptive: false,
  851. roundOffsets
  852. })));
  853. }
  854. state.attributes.popper = Object.assign({}, state.attributes.popper, {
  855. "data-popper-placement": state.placement
  856. });
  857. }
  858. var computeStyles_default = {
  859. name: "computeStyles",
  860. enabled: true,
  861. phase: "beforeWrite",
  862. fn: computeStyles,
  863. data: {}
  864. };
  865. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/applyStyles.js
  866. function applyStyles(_ref) {
  867. var state = _ref.state;
  868. Object.keys(state.elements).forEach(function(name) {
  869. var style = state.styles[name] || {};
  870. var attributes = state.attributes[name] || {};
  871. var element = state.elements[name];
  872. if (!isHTMLElement(element) || !getNodeName(element)) {
  873. return;
  874. }
  875. Object.assign(element.style, style);
  876. Object.keys(attributes).forEach(function(name2) {
  877. var value = attributes[name2];
  878. if (value === false) {
  879. element.removeAttribute(name2);
  880. } else {
  881. element.setAttribute(name2, value === true ? "" : value);
  882. }
  883. });
  884. });
  885. }
  886. function effect2(_ref2) {
  887. var state = _ref2.state;
  888. var initialStyles = {
  889. popper: {
  890. position: state.options.strategy,
  891. left: "0",
  892. top: "0",
  893. margin: "0"
  894. },
  895. arrow: {
  896. position: "absolute"
  897. },
  898. reference: {}
  899. };
  900. Object.assign(state.elements.popper.style, initialStyles.popper);
  901. state.styles = initialStyles;
  902. if (state.elements.arrow) {
  903. Object.assign(state.elements.arrow.style, initialStyles.arrow);
  904. }
  905. return function() {
  906. Object.keys(state.elements).forEach(function(name) {
  907. var element = state.elements[name];
  908. var attributes = state.attributes[name] || {};
  909. var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
  910. var style = styleProperties.reduce(function(style2, property) {
  911. style2[property] = "";
  912. return style2;
  913. }, {});
  914. if (!isHTMLElement(element) || !getNodeName(element)) {
  915. return;
  916. }
  917. Object.assign(element.style, style);
  918. Object.keys(attributes).forEach(function(attribute) {
  919. element.removeAttribute(attribute);
  920. });
  921. });
  922. };
  923. }
  924. var applyStyles_default = {
  925. name: "applyStyles",
  926. enabled: true,
  927. phase: "write",
  928. fn: applyStyles,
  929. effect: effect2,
  930. requires: ["computeStyles"]
  931. };
  932. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/popper-lite.js
  933. var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default];
  934. var createPopper = /* @__PURE__ */ popperGenerator({
  935. defaultModifiers
  936. });
  937. // ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/offset.js
  938. function distanceAndSkiddingToXY(placement, rects, offset2) {
  939. var basePlacement = getBasePlacement(placement);
  940. var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
  941. var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
  942. placement
  943. })) : offset2, skidding = _ref[0], distance = _ref[1];
  944. skidding = skidding || 0;
  945. distance = (distance || 0) * invertDistance;
  946. return [left, right].indexOf(basePlacement) >= 0 ? {
  947. x: distance,
  948. y: skidding
  949. } : {
  950. x: skidding,
  951. y: distance
  952. };
  953. }
  954. function offset(_ref2) {
  955. var state = _ref2.state, options = _ref2.options, name = _ref2.name;
  956. var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
  957. var data = placements.reduce(function(acc, placement) {
  958. acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
  959. return acc;
  960. }, {});
  961. var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
  962. if (state.modifiersData.popperOffsets != null) {
  963. state.modifiersData.popperOffsets.x += x;
  964. state.modifiersData.popperOffsets.y += y;
  965. }
  966. state.modifiersData[name] = data;
  967. }
  968. var offset_default = {
  969. name: "offset",
  970. enabled: true,
  971. phase: "main",
  972. requires: ["popperOffsets"],
  973. fn: offset
  974. };