chunk-U4764Y4W.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. // node_modules/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
  2. var MapShim = function() {
  3. if (typeof Map !== "undefined") {
  4. return Map;
  5. }
  6. function getIndex(arr, key) {
  7. var result = -1;
  8. arr.some(function(entry, index2) {
  9. if (entry[0] === key) {
  10. result = index2;
  11. return true;
  12. }
  13. return false;
  14. });
  15. return result;
  16. }
  17. return (
  18. /** @class */
  19. function() {
  20. function class_1() {
  21. this.__entries__ = [];
  22. }
  23. Object.defineProperty(class_1.prototype, "size", {
  24. /**
  25. * @returns {boolean}
  26. */
  27. get: function() {
  28. return this.__entries__.length;
  29. },
  30. enumerable: true,
  31. configurable: true
  32. });
  33. class_1.prototype.get = function(key) {
  34. var index2 = getIndex(this.__entries__, key);
  35. var entry = this.__entries__[index2];
  36. return entry && entry[1];
  37. };
  38. class_1.prototype.set = function(key, value) {
  39. var index2 = getIndex(this.__entries__, key);
  40. if (~index2) {
  41. this.__entries__[index2][1] = value;
  42. } else {
  43. this.__entries__.push([key, value]);
  44. }
  45. };
  46. class_1.prototype.delete = function(key) {
  47. var entries = this.__entries__;
  48. var index2 = getIndex(entries, key);
  49. if (~index2) {
  50. entries.splice(index2, 1);
  51. }
  52. };
  53. class_1.prototype.has = function(key) {
  54. return !!~getIndex(this.__entries__, key);
  55. };
  56. class_1.prototype.clear = function() {
  57. this.__entries__.splice(0);
  58. };
  59. class_1.prototype.forEach = function(callback, ctx) {
  60. if (ctx === void 0) {
  61. ctx = null;
  62. }
  63. for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
  64. var entry = _a[_i];
  65. callback.call(ctx, entry[1], entry[0]);
  66. }
  67. };
  68. return class_1;
  69. }()
  70. );
  71. }();
  72. var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
  73. var global$1 = function() {
  74. if (typeof global !== "undefined" && global.Math === Math) {
  75. return global;
  76. }
  77. if (typeof self !== "undefined" && self.Math === Math) {
  78. return self;
  79. }
  80. if (typeof window !== "undefined" && window.Math === Math) {
  81. return window;
  82. }
  83. return Function("return this")();
  84. }();
  85. var requestAnimationFrame$1 = function() {
  86. if (typeof requestAnimationFrame === "function") {
  87. return requestAnimationFrame.bind(global$1);
  88. }
  89. return function(callback) {
  90. return setTimeout(function() {
  91. return callback(Date.now());
  92. }, 1e3 / 60);
  93. };
  94. }();
  95. var trailingTimeout = 2;
  96. function throttle(callback, delay) {
  97. var leadingCall = false, trailingCall = false, lastCallTime = 0;
  98. function resolvePending() {
  99. if (leadingCall) {
  100. leadingCall = false;
  101. callback();
  102. }
  103. if (trailingCall) {
  104. proxy();
  105. }
  106. }
  107. function timeoutCallback() {
  108. requestAnimationFrame$1(resolvePending);
  109. }
  110. function proxy() {
  111. var timeStamp = Date.now();
  112. if (leadingCall) {
  113. if (timeStamp - lastCallTime < trailingTimeout) {
  114. return;
  115. }
  116. trailingCall = true;
  117. } else {
  118. leadingCall = true;
  119. trailingCall = false;
  120. setTimeout(timeoutCallback, delay);
  121. }
  122. lastCallTime = timeStamp;
  123. }
  124. return proxy;
  125. }
  126. var REFRESH_DELAY = 20;
  127. var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"];
  128. var mutationObserverSupported = typeof MutationObserver !== "undefined";
  129. var ResizeObserverController = (
  130. /** @class */
  131. function() {
  132. function ResizeObserverController2() {
  133. this.connected_ = false;
  134. this.mutationEventsAdded_ = false;
  135. this.mutationsObserver_ = null;
  136. this.observers_ = [];
  137. this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
  138. this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
  139. }
  140. ResizeObserverController2.prototype.addObserver = function(observer) {
  141. if (!~this.observers_.indexOf(observer)) {
  142. this.observers_.push(observer);
  143. }
  144. if (!this.connected_) {
  145. this.connect_();
  146. }
  147. };
  148. ResizeObserverController2.prototype.removeObserver = function(observer) {
  149. var observers2 = this.observers_;
  150. var index2 = observers2.indexOf(observer);
  151. if (~index2) {
  152. observers2.splice(index2, 1);
  153. }
  154. if (!observers2.length && this.connected_) {
  155. this.disconnect_();
  156. }
  157. };
  158. ResizeObserverController2.prototype.refresh = function() {
  159. var changesDetected = this.updateObservers_();
  160. if (changesDetected) {
  161. this.refresh();
  162. }
  163. };
  164. ResizeObserverController2.prototype.updateObservers_ = function() {
  165. var activeObservers = this.observers_.filter(function(observer) {
  166. return observer.gatherActive(), observer.hasActive();
  167. });
  168. activeObservers.forEach(function(observer) {
  169. return observer.broadcastActive();
  170. });
  171. return activeObservers.length > 0;
  172. };
  173. ResizeObserverController2.prototype.connect_ = function() {
  174. if (!isBrowser || this.connected_) {
  175. return;
  176. }
  177. document.addEventListener("transitionend", this.onTransitionEnd_);
  178. window.addEventListener("resize", this.refresh);
  179. if (mutationObserverSupported) {
  180. this.mutationsObserver_ = new MutationObserver(this.refresh);
  181. this.mutationsObserver_.observe(document, {
  182. attributes: true,
  183. childList: true,
  184. characterData: true,
  185. subtree: true
  186. });
  187. } else {
  188. document.addEventListener("DOMSubtreeModified", this.refresh);
  189. this.mutationEventsAdded_ = true;
  190. }
  191. this.connected_ = true;
  192. };
  193. ResizeObserverController2.prototype.disconnect_ = function() {
  194. if (!isBrowser || !this.connected_) {
  195. return;
  196. }
  197. document.removeEventListener("transitionend", this.onTransitionEnd_);
  198. window.removeEventListener("resize", this.refresh);
  199. if (this.mutationsObserver_) {
  200. this.mutationsObserver_.disconnect();
  201. }
  202. if (this.mutationEventsAdded_) {
  203. document.removeEventListener("DOMSubtreeModified", this.refresh);
  204. }
  205. this.mutationsObserver_ = null;
  206. this.mutationEventsAdded_ = false;
  207. this.connected_ = false;
  208. };
  209. ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
  210. var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b;
  211. var isReflowProperty = transitionKeys.some(function(key) {
  212. return !!~propertyName.indexOf(key);
  213. });
  214. if (isReflowProperty) {
  215. this.refresh();
  216. }
  217. };
  218. ResizeObserverController2.getInstance = function() {
  219. if (!this.instance_) {
  220. this.instance_ = new ResizeObserverController2();
  221. }
  222. return this.instance_;
  223. };
  224. ResizeObserverController2.instance_ = null;
  225. return ResizeObserverController2;
  226. }()
  227. );
  228. var defineConfigurable = function(target, props) {
  229. for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
  230. var key = _a[_i];
  231. Object.defineProperty(target, key, {
  232. value: props[key],
  233. enumerable: false,
  234. writable: false,
  235. configurable: true
  236. });
  237. }
  238. return target;
  239. };
  240. var getWindowOf = function(target) {
  241. var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
  242. return ownerGlobal || global$1;
  243. };
  244. var emptyRect = createRectInit(0, 0, 0, 0);
  245. function toFloat(value) {
  246. return parseFloat(value) || 0;
  247. }
  248. function getBordersSize(styles) {
  249. var positions = [];
  250. for (var _i = 1; _i < arguments.length; _i++) {
  251. positions[_i - 1] = arguments[_i];
  252. }
  253. return positions.reduce(function(size, position) {
  254. var value = styles["border-" + position + "-width"];
  255. return size + toFloat(value);
  256. }, 0);
  257. }
  258. function getPaddings(styles) {
  259. var positions = ["top", "right", "bottom", "left"];
  260. var paddings = {};
  261. for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
  262. var position = positions_1[_i];
  263. var value = styles["padding-" + position];
  264. paddings[position] = toFloat(value);
  265. }
  266. return paddings;
  267. }
  268. function getSVGContentRect(target) {
  269. var bbox = target.getBBox();
  270. return createRectInit(0, 0, bbox.width, bbox.height);
  271. }
  272. function getHTMLElementContentRect(target) {
  273. var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
  274. if (!clientWidth && !clientHeight) {
  275. return emptyRect;
  276. }
  277. var styles = getWindowOf(target).getComputedStyle(target);
  278. var paddings = getPaddings(styles);
  279. var horizPad = paddings.left + paddings.right;
  280. var vertPad = paddings.top + paddings.bottom;
  281. var width = toFloat(styles.width), height = toFloat(styles.height);
  282. if (styles.boxSizing === "border-box") {
  283. if (Math.round(width + horizPad) !== clientWidth) {
  284. width -= getBordersSize(styles, "left", "right") + horizPad;
  285. }
  286. if (Math.round(height + vertPad) !== clientHeight) {
  287. height -= getBordersSize(styles, "top", "bottom") + vertPad;
  288. }
  289. }
  290. if (!isDocumentElement(target)) {
  291. var vertScrollbar = Math.round(width + horizPad) - clientWidth;
  292. var horizScrollbar = Math.round(height + vertPad) - clientHeight;
  293. if (Math.abs(vertScrollbar) !== 1) {
  294. width -= vertScrollbar;
  295. }
  296. if (Math.abs(horizScrollbar) !== 1) {
  297. height -= horizScrollbar;
  298. }
  299. }
  300. return createRectInit(paddings.left, paddings.top, width, height);
  301. }
  302. var isSVGGraphicsElement = function() {
  303. if (typeof SVGGraphicsElement !== "undefined") {
  304. return function(target) {
  305. return target instanceof getWindowOf(target).SVGGraphicsElement;
  306. };
  307. }
  308. return function(target) {
  309. return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function";
  310. };
  311. }();
  312. function isDocumentElement(target) {
  313. return target === getWindowOf(target).document.documentElement;
  314. }
  315. function getContentRect(target) {
  316. if (!isBrowser) {
  317. return emptyRect;
  318. }
  319. if (isSVGGraphicsElement(target)) {
  320. return getSVGContentRect(target);
  321. }
  322. return getHTMLElementContentRect(target);
  323. }
  324. function createReadOnlyRect(_a) {
  325. var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
  326. var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object;
  327. var rect = Object.create(Constr.prototype);
  328. defineConfigurable(rect, {
  329. x,
  330. y,
  331. width,
  332. height,
  333. top: y,
  334. right: x + width,
  335. bottom: height + y,
  336. left: x
  337. });
  338. return rect;
  339. }
  340. function createRectInit(x, y, width, height) {
  341. return { x, y, width, height };
  342. }
  343. var ResizeObservation = (
  344. /** @class */
  345. function() {
  346. function ResizeObservation2(target) {
  347. this.broadcastWidth = 0;
  348. this.broadcastHeight = 0;
  349. this.contentRect_ = createRectInit(0, 0, 0, 0);
  350. this.target = target;
  351. }
  352. ResizeObservation2.prototype.isActive = function() {
  353. var rect = getContentRect(this.target);
  354. this.contentRect_ = rect;
  355. return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
  356. };
  357. ResizeObservation2.prototype.broadcastRect = function() {
  358. var rect = this.contentRect_;
  359. this.broadcastWidth = rect.width;
  360. this.broadcastHeight = rect.height;
  361. return rect;
  362. };
  363. return ResizeObservation2;
  364. }()
  365. );
  366. var ResizeObserverEntry = (
  367. /** @class */
  368. function() {
  369. function ResizeObserverEntry2(target, rectInit) {
  370. var contentRect = createReadOnlyRect(rectInit);
  371. defineConfigurable(this, { target, contentRect });
  372. }
  373. return ResizeObserverEntry2;
  374. }()
  375. );
  376. var ResizeObserverSPI = (
  377. /** @class */
  378. function() {
  379. function ResizeObserverSPI2(callback, controller, callbackCtx) {
  380. this.activeObservations_ = [];
  381. this.observations_ = new MapShim();
  382. if (typeof callback !== "function") {
  383. throw new TypeError("The callback provided as parameter 1 is not a function.");
  384. }
  385. this.callback_ = callback;
  386. this.controller_ = controller;
  387. this.callbackCtx_ = callbackCtx;
  388. }
  389. ResizeObserverSPI2.prototype.observe = function(target) {
  390. if (!arguments.length) {
  391. throw new TypeError("1 argument required, but only 0 present.");
  392. }
  393. if (typeof Element === "undefined" || !(Element instanceof Object)) {
  394. return;
  395. }
  396. if (!(target instanceof getWindowOf(target).Element)) {
  397. throw new TypeError('parameter 1 is not of type "Element".');
  398. }
  399. var observations = this.observations_;
  400. if (observations.has(target)) {
  401. return;
  402. }
  403. observations.set(target, new ResizeObservation(target));
  404. this.controller_.addObserver(this);
  405. this.controller_.refresh();
  406. };
  407. ResizeObserverSPI2.prototype.unobserve = function(target) {
  408. if (!arguments.length) {
  409. throw new TypeError("1 argument required, but only 0 present.");
  410. }
  411. if (typeof Element === "undefined" || !(Element instanceof Object)) {
  412. return;
  413. }
  414. if (!(target instanceof getWindowOf(target).Element)) {
  415. throw new TypeError('parameter 1 is not of type "Element".');
  416. }
  417. var observations = this.observations_;
  418. if (!observations.has(target)) {
  419. return;
  420. }
  421. observations.delete(target);
  422. if (!observations.size) {
  423. this.controller_.removeObserver(this);
  424. }
  425. };
  426. ResizeObserverSPI2.prototype.disconnect = function() {
  427. this.clearActive();
  428. this.observations_.clear();
  429. this.controller_.removeObserver(this);
  430. };
  431. ResizeObserverSPI2.prototype.gatherActive = function() {
  432. var _this = this;
  433. this.clearActive();
  434. this.observations_.forEach(function(observation) {
  435. if (observation.isActive()) {
  436. _this.activeObservations_.push(observation);
  437. }
  438. });
  439. };
  440. ResizeObserverSPI2.prototype.broadcastActive = function() {
  441. if (!this.hasActive()) {
  442. return;
  443. }
  444. var ctx = this.callbackCtx_;
  445. var entries = this.activeObservations_.map(function(observation) {
  446. return new ResizeObserverEntry(observation.target, observation.broadcastRect());
  447. });
  448. this.callback_.call(ctx, entries, ctx);
  449. this.clearActive();
  450. };
  451. ResizeObserverSPI2.prototype.clearActive = function() {
  452. this.activeObservations_.splice(0);
  453. };
  454. ResizeObserverSPI2.prototype.hasActive = function() {
  455. return this.activeObservations_.length > 0;
  456. };
  457. return ResizeObserverSPI2;
  458. }()
  459. );
  460. var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim();
  461. var ResizeObserver = (
  462. /** @class */
  463. function() {
  464. function ResizeObserver2(callback) {
  465. if (!(this instanceof ResizeObserver2)) {
  466. throw new TypeError("Cannot call a class as a function.");
  467. }
  468. if (!arguments.length) {
  469. throw new TypeError("1 argument required, but only 0 present.");
  470. }
  471. var controller = ResizeObserverController.getInstance();
  472. var observer = new ResizeObserverSPI(callback, controller, this);
  473. observers.set(this, observer);
  474. }
  475. return ResizeObserver2;
  476. }()
  477. );
  478. [
  479. "observe",
  480. "unobserve",
  481. "disconnect"
  482. ].forEach(function(method) {
  483. ResizeObserver.prototype[method] = function() {
  484. var _a;
  485. return (_a = observers.get(this))[method].apply(_a, arguments);
  486. };
  487. });
  488. var index = function() {
  489. if (typeof global$1.ResizeObserver !== "undefined") {
  490. return global$1.ResizeObserver;
  491. }
  492. return ResizeObserver;
  493. }();
  494. var ResizeObserver_es_default = index;
  495. export {
  496. ResizeObserver_es_default
  497. };
  498. //# sourceMappingURL=chunk-U4764Y4W.js.map