index.esm.mjs 37 KB

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