vendor: 7,524 bytes, lines 1-190
1(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[609],{ 2 3/***/ 3541: 4/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 5 6"use strict"; 7/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8/* harmony export */ Ry: function() { return /* binding */ hideOthers; } 9/* harmony export */ }); 10/* unused harmony exports inertOthers, supportsInert, suppressOthers */ 11var getDefaultParent = function (originalTarget) { 12 if (typeof document === 'undefined') { 13 return null; 14 } 15 var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; 16 return sampleTarget.ownerDocument.body; 17}; 18var counterMap = new WeakMap(); 19var uncontrolledNodes = new WeakMap(); 20var markerMap = {}; 21var lockCount = 0; 22var unwrapHost = function (node) { 23 return node && (node.host || unwrapHost(node.parentNode)); 24}; 25var correctTargets = function (parent, targets) { 26 return targets 27 .map(function (target) { 28 if (parent.contains(target)) { 29 return target; 30 } 31 var correctedTarget = unwrapHost(target); 32 if (correctedTarget && parent.contains(correctedTarget)) { 33 return correctedTarget; 34 } 35 console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); 36 return null; 37 }) 38 .filter(function (x) { return Boolean(x); }); 39}; 40/** 41 * Marks everything except given node(or nodes) as aria-hidden 42 * @param {Element | Element[]} originalTarget - elements to keep on the page 43 * @param [parentNode] - top element, defaults to document.body 44 * @param {String} [markerName] - a special attribute to mark every node 45 * @param {String} [controlAttribute] - html Attribute to control 46 * @return {Undo} undo command 47 */ 48var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { 49 var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); 50 if (!markerMap[markerName]) { 51 markerMap[markerName] = new WeakMap(); 52 } 53 var markerCounter = markerMap[markerName]; 54 var hiddenNodes = []; 55 var elementsToKeep = new Set(); 56 var elementsToStop = new Set(targets); 57 var keep = function (el) { 58 if (!el || elementsToKeep.has(el)) { 59 return; 60 } 61 elementsToKeep.add(el); 62 keep(el.parentNode); 63 }; 64 targets.forEach(keep); 65 var deep = function (parent) { 66 if (!parent || elementsToStop.has(parent)) { 67 return; 68 } 69 Array.prototype.forEach.call(parent.children, function (node) { 70 if (elementsToKeep.has(node)) { 71 deep(node); 72 } 73 else { 74 try { 75 var attr = node.getAttribute(controlAttribute); 76 var alreadyHidden = attr !== null && attr !== 'false'; 77 var counterValue = (counterMap.get(node) || 0) + 1; 78 var markerValue = (markerCounter.get(node) || 0) + 1; 79 counterMap.set(node, counterValue); 80 markerCounter.set(node, markerValue); 81 hiddenNodes.push(node); 82 if (counterValue === 1 && alreadyHidden) { 83 uncontrolledNodes.set(node, true); 84 } 85 if (markerValue === 1) { 86 node.setAttribute(markerName, 'true'); 87 } 88 if (!alreadyHidden) { 89 node.setAttribute(controlAttribute, 'true'); 90 } 91 } 92 catch (e) { 93 console.error('aria-hidden: cannot operate on ', node, e); 94 } 95 } 96 }); 97 }; 98 deep(parentNode); 99 elementsToKeep.clear(); 100 lockCount++; 101 return function () { 102 hiddenNodes.forEach(function (node) { 103 var counterValue = counterMap.get(node) - 1; 104 var markerValue = markerCounter.get(node) - 1; 105 counterMap.set(node, counterValue); 106 markerCounter.set(node, markerValue); 107 if (!counterValue) { 108 if (!uncontrolledNodes.has(node)) { 109 node.removeAttribute(controlAttribute); 110 } 111 uncontrolledNodes.delete(node); 112 } 113 if (!markerValue) { 114 node.removeAttribute(markerName); 115 } 116 }); 117 lockCount--; 118 if (!lockCount) { 119 // clear 120 counterMap = new WeakMap(); 121 counterMap = new WeakMap(); 122 uncontrolledNodes = new WeakMap(); 123 markerMap = {}; 124 } 125 }; 126}; 127/** 128 * Marks everything except given node(or nodes) as aria-hidden 129 * @param {Element | Element[]} originalTarget - elements to keep on the page 130 * @param [parentNode] - top element, defaults to document.body 131 * @param {String} [markerName] - a special attribute to mark every node 132 * @return {Undo} undo command 133 */ 134var hideOthers = function (originalTarget, parentNode, markerName) { 135 if (markerName === void 0) { markerName = 'data-aria-hidden'; } 136 var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); 137 var activeParentNode = parentNode || getDefaultParent(originalTarget); 138 if (!activeParentNode) { 139 return function () { return null; }; 140 } 141 // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10 142 targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]'))); 143 return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); 144}; 145/** 146 * Marks everything except given node(or nodes) as inert 147 * @param {Element | Element[]} originalTarget - elements to keep on the page 148 * @param [parentNode] - top element, defaults to document.body 149 * @param {String} [markerName] - a special attribute to mark every node 150 * @return {Undo} undo command 151 */ 152var inertOthers = function (originalTarget, parentNode, markerName) { 153 if (markerName === void 0) { markerName = 'data-inert-ed'; } 154 var activeParentNode = parentNode || getDefaultParent(originalTarget); 155 if (!activeParentNode) { 156 return function () { return null; }; 157 } 158 return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); 159}; 160/** 161 * @returns if current browser supports inert 162 */ 163var supportsInert = function () { 164 return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); 165}; 166/** 167 * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way 168 * @param {Element | Element[]} originalTarget - elements to keep on the page 169 * @param [parentNode] - top element, defaults to document.body 170 * @param {String} [markerName] - a special attribute to mark every node 171 * @return {Undo} undo command 172 */ 173var suppressOthers = function (originalTarget, parentNode, markerName) { 174 if (markerName === void 0) { markerName = 'data-suppressed'; } 175 return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); 176}; 177 178 179/***/ }), 180 181/***/ 452: 182/***/ (function(module, exports, __webpack_require__) { 183 184;(function (root, factory, undef) { 185 if (true) { 186 // CommonJS 187 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(3125), __webpack_require__(888), __webpack_require__(5109)); 188 } 189 else {} 190}(this
vendor: 8,196 bytes, lines 190-410
190, function (CryptoJS) { 191 192 (function () { 193 // Shortcuts 194 var C = CryptoJS; 195 var C_lib = C.lib; 196 var BlockCipher = C_lib.BlockCipher; 197 var C_algo = C.algo; 198 199 // Lookup tables 200 var SBOX = []; 201 var INV_SBOX = []; 202 var SUB_MIX_0 = []; 203 var SUB_MIX_1 = []; 204 var SUB_MIX_2 = []; 205 var SUB_MIX_3 = []; 206 var INV_SUB_MIX_0 = []; 207 var INV_SUB_MIX_1 = []; 208 var INV_SUB_MIX_2 = []; 209 var INV_SUB_MIX_3 = []; 210 211 // Compute lookup tables 212 (function () { 213 // Compute double table 214 var d = []; 215 for (var i = 0; i < 256; i++) { 216 if (i < 128) { 217 d[i] = i << 1; 218 } else { 219 d[i] = (i << 1) ^ 0x11b; 220 } 221 } 222 223 // Walk GF(2^8) 224 var x = 0; 225 var xi = 0; 226 for (var i = 0; i < 256; i++) { 227 // Compute sbox 228 var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); 229 sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; 230 SBOX[x] = sx; 231 INV_SBOX[sx] = x; 232 233 // Compute multiplication 234 var x2 = d[x]; 235 var x4 = d[x2]; 236 var x8 = d[x4]; 237 238 // Compute sub bytes, mix columns tables 239 var t = (d[sx] * 0x101) ^ (sx * 0x1010100); 240 SUB_MIX_0[x] = (t << 24) | (t >>> 8); 241 SUB_MIX_1[x] = (t << 16) | (t >>> 16); 242 SUB_MIX_2[x] = (t << 8) | (t >>> 24); 243 SUB_MIX_3[x] = t; 244 245 // Compute inv sub bytes, inv mix columns tables 246 var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); 247 INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); 248 INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); 249 INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); 250 INV_SUB_MIX_3[sx] = t; 251 252 // Compute next counter 253 if (!x) { 254 x = xi = 1; 255 } else { 256 x = x2 ^ d[d[d[x8 ^ x2]]]; 257 xi ^= d[d[xi]]; 258 } 259 } 260 }()); 261 262 // Precomputed Rcon lookup 263 var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; 264 265 /** 266 * AES block cipher algorithm. 267 */ 268 var AES = C_algo.AES = BlockCipher.extend({ 269 _doReset: function () { 270 var t; 271 272 // Skip reset of nRounds has been set before and key did not change 273 if (this._nRounds && this._keyPriorReset === this._key) { 274 return; 275 } 276 277 // Shortcuts 278 var key = this._keyPriorReset = this._key; 279 var keyWords = key.words; 280 var keySize = key.sigBytes / 4; 281 282 // Compute number of rounds 283 var nRounds = this._nRounds = keySize + 6; 284 285 // Compute number of key schedule rows 286 var ksRows = (nRounds + 1) * 4; 287 288 // Compute key schedule 289 var keySchedule = this._keySchedule = []; 290 for (var ksRow = 0; ksRow < ksRows; ksRow++) { 291 if (ksRow < keySize) { 292 keySchedule[ksRow] = keyWords[ksRow]; 293 } else { 294 t = keySchedule[ksRow - 1]; 295 296 if (!(ksRow % keySize)) { 297 // Rot word 298 t = (t << 8) | (t >>> 24); 299 300 // Sub word 301 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; 302 303 // Mix Rcon 304 t ^= RCON[(ksRow / keySize) | 0] << 24; 305 } else if (keySize > 6 && ksRow % keySize == 4) { 306 // Sub word 307 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; 308 } 309 310 keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; 311 } 312 } 313 314 // Compute inv key schedule 315 var invKeySchedule = this._invKeySchedule = []; 316 for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { 317 var ksRow = ksRows - invKsRow; 318 319 if (invKsRow % 4) { 320 var t = keySchedule[ksRow]; 321 } else { 322 var t = keySchedule[ksRow - 4]; 323 } 324 325 if (invKsRow < 4 || ksRow <= 4) { 326 invKeySchedule[invKsRow] = t; 327 } else { 328 invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ 329 INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; 330 } 331 } 332 }, 333 334 encryptBlock: function (M, offset) { 335 this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); 336 }, 337 338 decryptBlock: function (M, offset) { 339 // Swap 2nd and 4th rows 340 var t = M[offset + 1]; 341 M[offset + 1] = M[offset + 3]; 342 M[offset + 3] = t; 343 344 this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); 345 346 // Inv swap 2nd and 4th rows 347 var t = M[offset + 1]; 348 M[offset + 1] = M[offset + 3]; 349 M[offset + 3] = t; 350 }, 351 352 _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { 353 // Shortcut 354 var nRounds = this._nRounds; 355 356 // Get input, add round key 357 var s0 = M[offset] ^ keySchedule[0]; 358 var s1 = M[offset + 1] ^ keySchedule[1]; 359 var s2 = M[offset + 2] ^ keySchedule[2]; 360 var s3 = M[offset + 3] ^ keySchedule[3]; 361 362 // Key schedule row counter 363 var ksRow = 4; 364 365 // Rounds 366 for (var round = 1; round < nRounds; round++) { 367 // Shift rows, sub bytes, mix columns, add round key 368 var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; 369 var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; 370 var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; 371 var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; 372 373 // Update state 374 s0 = t0; 375 s1 = t1; 376 s2 = t2; 377 s3 = t3; 378 } 379 380 // Shift rows, sub bytes, add round key 381 var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; 382 var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; 383 var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; 384 var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; 385 386 // Set output 387 M[offset] = t0; 388 M[offset + 1] = t1; 389 M[offset + 2] = t2; 390 M[offset + 3] = t3; 391 }, 392 393 keySize: 256/32 394 }); 395 396 /** 397 * Shortcut functions to the cipher's object interface. 398 * 399 * @example 400 * 401 * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); 402 * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); 403 */ 404 C.AES = BlockCipher._createHelper(AES); 405 }()); 406 407 408 return CryptoJS.AES; 409 410}));
411 412/***/ }), 413 414/***/ 7407: 415/***/ (function(module, exports, __webpack_require__) { 416 417;(function (root, factory, undef) { 418 if (true) { 419 // CommonJS 420 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(3125), __webpack_require__(888), __webpack_require__(5109)); 421 } 422 else {} 423}(this, function (CryptoJS) {
vendor: 20,583 bytes, lines 423-878
423 424 425 (function () { 426 // Shortcuts 427 var C = CryptoJS; 428 var C_lib = C.lib; 429 var BlockCipher = C_lib.BlockCipher; 430 var C_algo = C.algo; 431 432 const N = 16; 433 434 //Origin pbox and sbox, derived from PI 435 const ORIG_P = [ 436 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 437 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, 438 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, 439 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, 440 0x9216D5D9, 0x8979FB1B 441 ]; 442 443 const ORIG_S = [ 444 [ 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 445 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99, 446 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, 447 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, 448 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE, 449 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, 450 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, 451 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E, 452 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, 453 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, 454 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, 455 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, 456 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, 457 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677, 458 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, 459 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, 460 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88, 461 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, 462 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, 463 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0, 464 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, 465 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, 466 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88, 467 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, 468 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, 469 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D, 470 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, 471 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, 472 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA, 473 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, 474 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, 475 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09, 476 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, 477 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, 478 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279, 479 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, 480 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, 481 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82, 482 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, 483 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, 484 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0, 485 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, 486 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, 487 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8, 488 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, 489 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, 490 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7, 491 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, 492 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, 493 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1, 494 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, 495 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, 496 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477, 497 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, 498 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, 499 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF, 500 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, 501 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, 502 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41, 503 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, 504 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, 505 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915, 506 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, 507 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A ], 508 [ 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, 509 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, 510 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, 511 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, 512 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6, 513 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, 514 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E, 515 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1, 516 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, 517 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, 518 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, 519 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, 520 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701, 521 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7, 522 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, 523 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, 524 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF, 525 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, 526 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E, 527 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87, 528 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, 529 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2, 530 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16, 531 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, 532 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B, 533 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509, 534 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, 535 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3, 536 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F, 537 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, 538 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, 539 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960, 540 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, 541 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28, 542 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802, 543 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, 544 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510, 545 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF, 546 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, 547 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E, 548 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50, 549 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, 550 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8, 551 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281, 552 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, 553 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, 554 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128, 555 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, 556 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0, 557 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0, 558 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, 559 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250, 560 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3, 561 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, 562 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00, 563 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061, 564 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, 565 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E, 566 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735, 567 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, 568 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, 569 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340, 570 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, 571 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 ], 572 [ 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, 573 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, 574 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF, 575 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, 576 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45, 577 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, 578 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A, 579 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, 580 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE, 581 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, 582 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, 583 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, 584 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2, 585 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB, 586 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527, 587 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, 588 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33, 589 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C, 590 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3, 591 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC, 592 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, 593 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564, 594 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B, 595 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115, 596 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922, 597 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, 598 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0, 599 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E, 600 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37, 601 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D, 602 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, 603 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B, 604 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3, 605 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB, 606 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D, 607 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, 608 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350, 609 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9, 610 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A, 611 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE, 612 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, 613 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC, 614 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F, 615 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61, 616 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2, 617 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, 618 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2, 619 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C, 620 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E, 621 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633, 622 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, 623 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169, 624 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52, 625 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027, 626 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5, 627 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, 628 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634, 629 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76, 630 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24, 631 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC, 632 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, 633 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C, 634 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837, 635 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 ], 636 [ 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, 637 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE, 638 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B, 639 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, 640 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8, 641 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, 642 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, 643 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22, 644 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4, 645 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, 646 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, 647 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59, 648 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, 649 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51, 650 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28, 651 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, 652 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B, 653 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28, 654 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, 655 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD, 656 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, 657 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, 658 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB, 659 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F, 660 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, 661 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32, 662 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680, 663 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, 664 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE, 665 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB, 666 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, 667 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47, 668 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370, 669 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, 670 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84, 671 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, 672 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, 673 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD, 674 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9, 675 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, 676 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38, 677 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F, 678 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, 679 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525, 680 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1, 681 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, 682 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964, 683 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E, 684 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, 685 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D, 686 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, 687 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, 688 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02, 689 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC, 690 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, 691 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A, 692 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, 693 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, 694 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0, 695 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060, 696 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, 697 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9, 698 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F, 699 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 ] 700 ]; 701 702 var BLOWFISH_CTX = { 703 pbox: [], 704 sbox: [] 705 } 706 707 function F(ctx, x){ 708 let a = (x >> 24) & 0xFF; 709 let b = (x >> 16) & 0xFF; 710 let c = (x >> 8) & 0xFF; 711 let d = x & 0xFF; 712 713 let y = ctx.sbox[0][a] + ctx.sbox[1][b]; 714 y = y ^ ctx.sbox[2][c]; 715 y = y + ctx.sbox[3][d]; 716 717 return y; 718 } 719 720 function BlowFish_Encrypt(ctx, left, right){ 721 let Xl = left; 722 let Xr = right; 723 let temp; 724 725 for(let i = 0; i < N; ++i){ 726 Xl = Xl ^ ctx.pbox[i]; 727 Xr = F(ctx, Xl) ^ Xr; 728 729 temp = Xl; 730 Xl = Xr; 731 Xr = temp; 732 } 733 734 temp = Xl; 735 Xl = Xr; 736 Xr = temp; 737 738 Xr = Xr ^ ctx.pbox[N]; 739 Xl = Xl ^ ctx.pbox[N + 1]; 740 741 return {left: Xl, right: Xr}; 742 } 743 744 function BlowFish_Decrypt(ctx, left, right){ 745 let Xl = left; 746 let Xr = right; 747 let temp; 748 749 for(let i = N + 1; i > 1; --i){ 750 Xl = Xl ^ ctx.pbox[i]; 751 Xr = F(ctx, Xl) ^ Xr; 752 753 temp = Xl; 754 Xl = Xr; 755 Xr = temp; 756 } 757 758 temp = Xl; 759 Xl = Xr; 760 Xr = temp; 761 762 Xr = Xr ^ ctx.pbox[1]; 763 Xl = Xl ^ ctx.pbox[0]; 764 765 return {left: Xl, right: Xr}; 766 } 767 768 /** 769 * Initialization ctx's pbox and sbox. 770 * 771 * @param {Object} ctx The object has pbox and sbox. 772 * @param {Array} key An array of 32-bit words. 773 * @param {int} keysize The length of the key. 774 * 775 * @example 776 * 777 * BlowFishInit(BLOWFISH_CTX, key, 128/32); 778 */ 779 function BlowFishInit(ctx, key, keysize) 780 { 781 for(let Row = 0; Row < 4; Row++) 782 { 783 ctx.sbox[Row] = []; 784 for(let Col = 0; Col < 256; Col++) 785 { 786 ctx.sbox[Row][Col] = ORIG_S[Row][Col]; 787 } 788 } 789 790 let keyIndex = 0; 791 for(let index = 0; index < N + 2; index++) 792 { 793 ctx.pbox[index] = ORIG_P[index] ^ key[keyIndex]; 794 keyIndex++; 795 if(keyIndex >= keysize) 796 { 797 keyIndex = 0; 798 } 799 } 800 801 let Data1 = 0; 802 let Data2 = 0; 803 let res = 0; 804 for(let i = 0; i < N + 2; i += 2) 805 { 806 res = BlowFish_Encrypt(ctx, Data1, Data2); 807 Data1 = res.left; 808 Data2 = res.right; 809 ctx.pbox[i] = Data1; 810 ctx.pbox[i + 1] = Data2; 811 } 812 813 for(let i = 0; i < 4; i++) 814 { 815 for(let j = 0; j < 256; j += 2) 816 { 817 res = BlowFish_Encrypt(ctx, Data1, Data2); 818 Data1 = res.left; 819 Data2 = res.right; 820 ctx.sbox[i][j] = Data1; 821 ctx.sbox[i][j + 1] = Data2; 822 } 823 } 824 825 return true; 826 } 827 828 /** 829 * Blowfish block cipher algorithm. 830 */ 831 var Blowfish = C_algo.Blowfish = BlockCipher.extend({ 832 _doReset: function () { 833 // Skip reset of nRounds has been set before and key did not change 834 if (this._keyPriorReset === this._key) { 835 return; 836 } 837 838 // Shortcuts 839 var key = this._keyPriorReset = this._key; 840 var keyWords = key.words; 841 var keySize = key.sigBytes / 4; 842 843 //Initialization pbox and sbox 844 BlowFishInit(BLOWFISH_CTX, keyWords, keySize); 845 }, 846 847 encryptBlock: function (M, offset) { 848 var res = BlowFish_Encrypt(BLOWFISH_CTX, M[offset], M[offset + 1]); 849 M[offset] = res.left; 850 M[offset + 1] = res.right; 851 }, 852 853 decryptBlock: function (M, offset) { 854 var res = BlowFish_Decrypt(BLOWFISH_CTX, M[offset], M[offset + 1]); 855 M[offset] = res.left; 856 M[offset + 1] = res.right; 857 }, 858 859 blockSize: 64/32, 860 861 keySize: 128/32, 862 863 ivSize: 64/32 864 }); 865 866 /** 867 * Shortcut functions to the cipher's object interface. 868 * 869 * @example 870 * 871 * var ciphertext = CryptoJS.Blowfish.encrypt(message, key, cfg); 872 * var plaintext = CryptoJS.Blowfish.decrypt(ciphertext, key, cfg); 873 */ 874 C.Blowfish = BlockCipher._createHelper(Blowfish); 875 }()); 876 877 878 return CryptoJS
878.Blowfish; 879 880})); 881 882/***/ }), 883 884/***/ 5109: 885/***/ (function(module, exports, __webpack_require__) { 886 887;(function (root, factory, undef) { 888 if (true) { 889 // CommonJS 890 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(888)); 891 } 892 else {
vendor: 17,896 bytes, lines 892-1459
892} 893}(this, function (CryptoJS) { 894 895 /** 896 * Cipher core components. 897 */ 898 CryptoJS.lib.Cipher || (function (undefined) { 899 // Shortcuts 900 var C = CryptoJS; 901 var C_lib = C.lib; 902 var Base = C_lib.Base; 903 var WordArray = C_lib.WordArray; 904 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; 905 var C_enc = C.enc; 906 var Utf8 = C_enc.Utf8; 907 var Base64 = C_enc.Base64; 908 var C_algo = C.algo; 909 var EvpKDF = C_algo.EvpKDF; 910 911 /** 912 * Abstract base cipher template. 913 * 914 * @property {number} keySize This cipher's key size. Default: 4 (128 bits) 915 * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) 916 * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. 917 * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. 918 */ 919 var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ 920 /** 921 * Configuration options. 922 * 923 * @property {WordArray} iv The IV to use for this operation. 924 */ 925 cfg: Base.extend(), 926 927 /** 928 * Creates this cipher in encryption mode. 929 * 930 * @param {WordArray} key The key. 931 * @param {Object} cfg (Optional) The configuration options to use for this operation. 932 * 933 * @return {Cipher} A cipher instance. 934 * 935 * @static 936 * 937 * @example 938 * 939 * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); 940 */ 941 createEncryptor: function (key, cfg) { 942 return this.create(this._ENC_XFORM_MODE, key, cfg); 943 }, 944 945 /** 946 * Creates this cipher in decryption mode. 947 * 948 * @param {WordArray} key The key. 949 * @param {Object} cfg (Optional) The configuration options to use for this operation. 950 * 951 * @return {Cipher} A cipher instance. 952 * 953 * @static 954 * 955 * @example 956 * 957 * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); 958 */ 959 createDecryptor: function (key, cfg) { 960 return this.create(this._DEC_XFORM_MODE, key, cfg); 961 }, 962 963 /** 964 * Initializes a newly created cipher. 965 * 966 * @param {number} xformMode Either the encryption or decryption transormation mode constant. 967 * @param {WordArray} key The key. 968 * @param {Object} cfg (Optional) The configuration options to use for this operation. 969 * 970 * @example 971 * 972 * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); 973 */ 974 init: function (xformMode, key, cfg) { 975 // Apply config defaults 976 this.cfg = this.cfg.extend(cfg); 977 978 // Store transform mode and key 979 this._xformMode = xformMode; 980 this._key = key; 981 982 // Set initial values 983 this.reset(); 984 }, 985 986 /** 987 * Resets this cipher to its initial state. 988 * 989 * @example 990 * 991 * cipher.reset(); 992 */ 993 reset: function () { 994 // Reset data buffer 995 BufferedBlockAlgorithm.reset.call(this); 996 997 // Perform concrete-cipher logic 998 this._doReset(); 999 }, 1000 1001 /** 1002 * Adds data to be encrypted or decrypted. 1003 * 1004 * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. 1005 * 1006 * @return {WordArray} The data after processing. 1007 * 1008 * @example 1009 * 1010 * var encrypted = cipher.process('data'); 1011 * var encrypted = cipher.process(wordArray); 1012 */ 1013 process: function (dataUpdate) { 1014 // Append 1015 this._append(dataUpdate); 1016 1017 // Process available blocks 1018 return this._process(); 1019 }, 1020 1021 /** 1022 * Finalizes the encryption or decryption process. 1023 * Note that the finalize operation is effectively a destructive, read-once operation. 1024 * 1025 * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. 1026 * 1027 * @return {WordArray} The data after final processing. 1028 * 1029 * @example 1030 * 1031 * var encrypted = cipher.finalize(); 1032 * var encrypted = cipher.finalize('data'); 1033 * var encrypted = cipher.finalize(wordArray); 1034 */ 1035 finalize: function (dataUpdate) { 1036 // Final data update 1037 if (dataUpdate) { 1038 this._append(dataUpdate); 1039 } 1040 1041 // Perform concrete-cipher logic 1042 var finalProcessedData = this._doFinalize(); 1043 1044 return finalProcessedData; 1045 }, 1046 1047 keySize: 128/32, 1048 1049 ivSize: 128/32, 1050 1051 _ENC_XFORM_MODE: 1, 1052 1053 _DEC_XFORM_MODE: 2, 1054 1055 /** 1056 * Creates shortcut functions to a cipher's object interface. 1057 * 1058 * @param {Cipher} cipher The cipher to create a helper for. 1059 * 1060 * @return {Object} An object with encrypt and decrypt shortcut functions. 1061 * 1062 * @static 1063 * 1064 * @example 1065 * 1066 * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); 1067 */ 1068 _createHelper: (function () { 1069 function selectCipherStrategy(key) { 1070 if (typeof key == 'string') { 1071 return PasswordBasedCipher; 1072 } else { 1073 return SerializableCipher; 1074 } 1075 } 1076 1077 return function (cipher) { 1078 return { 1079 encrypt: function (message, key, cfg) { 1080 return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); 1081 }, 1082 1083 decrypt: function (ciphertext, key, cfg) { 1084 return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); 1085 } 1086 }; 1087 }; 1088 }()) 1089 }); 1090 1091 /** 1092 * Abstract base stream cipher template. 1093 * 1094 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) 1095 */ 1096 var StreamCipher = C_lib.StreamCipher = Cipher.extend({ 1097 _doFinalize: function () { 1098 // Process partial blocks 1099 var finalProcessedBlocks = this._process(!!'flush'); 1100 1101 return finalProcessedBlocks; 1102 }, 1103 1104 blockSize: 1 1105 }); 1106 1107 /** 1108 * Mode namespace. 1109 */ 1110 var C_mode = C.mode = {}; 1111 1112 /** 1113 * Abstract base block cipher mode template. 1114 */ 1115 var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ 1116 /** 1117 * Creates this mode for encryption. 1118 * 1119 * @param {Cipher} cipher A block cipher instance. 1120 * @param {Array} iv The IV words. 1121 * 1122 * @static 1123 * 1124 * @example 1125 * 1126 * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); 1127 */ 1128 createEncryptor: function (cipher, iv) { 1129 return this.Encryptor.create(cipher, iv); 1130 }, 1131 1132 /** 1133 * Creates this mode for decryption. 1134 * 1135 * @param {Cipher} cipher A block cipher instance. 1136 * @param {Array} iv The IV words. 1137 * 1138 * @static 1139 * 1140 * @example 1141 * 1142 * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); 1143 */ 1144 createDecryptor: function (cipher, iv) { 1145 return this.Decryptor.create(cipher, iv); 1146 }, 1147 1148 /** 1149 * Initializes a newly created mode. 1150 * 1151 * @param {Cipher} cipher A block cipher instance. 1152 * @param {Array} iv The IV words. 1153 * 1154 * @example 1155 * 1156 * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); 1157 */ 1158 init: function (cipher, iv) { 1159 this._cipher = cipher; 1160 this._iv = iv; 1161 } 1162 }); 1163 1164 /** 1165 * Cipher Block Chaining mode. 1166 */ 1167 var CBC = C_mode.CBC = (function () { 1168 /** 1169 * Abstract base CBC mode. 1170 */ 1171 var CBC = BlockCipherMode.extend(); 1172 1173 /** 1174 * CBC encryptor. 1175 */ 1176 CBC.Encryptor = CBC.extend({ 1177 /** 1178 * Processes the data block at offset. 1179 * 1180 * @param {Array} words The data words to operate on. 1181 * @param {number} offset The offset where the block starts. 1182 * 1183 * @example 1184 * 1185 * mode.processBlock(data.words, offset); 1186 */ 1187 processBlock: function (words, offset) { 1188 // Shortcuts 1189 var cipher = this._cipher; 1190 var blockSize = cipher.blockSize; 1191 1192 // XOR and encrypt 1193 xorBlock.call(this, words, offset, blockSize); 1194 cipher.encryptBlock(words, offset); 1195 1196 // Remember this block to use with next block 1197 this._prevBlock = words.slice(offset, offset + blockSize); 1198 } 1199 }); 1200 1201 /** 1202 * CBC decryptor. 1203 */ 1204 CBC.Decryptor = CBC.extend({ 1205 /** 1206 * Processes the data block at offset. 1207 * 1208 * @param {Array} words The data words to operate on. 1209 * @param {number} offset The offset where the block starts. 1210 * 1211 * @example 1212 * 1213 * mode.processBlock(data.words, offset); 1214 */ 1215 processBlock: function (words, offset) { 1216 // Shortcuts 1217 var cipher = this._cipher; 1218 var blockSize = cipher.blockSize; 1219 1220 // Remember this block to use with next block 1221 var thisBlock = words.slice(offset, offset + blockSize); 1222 1223 // Decrypt and XOR 1224 cipher.decryptBlock(words, offset); 1225 xorBlock.call(this, words, offset, blockSize); 1226 1227 // This block becomes the previous block 1228 this._prevBlock = thisBlock; 1229 } 1230 }); 1231 1232 function xorBlock(words, offset, blockSize) { 1233 var block; 1234 1235 // Shortcut 1236 var iv = this._iv; 1237 1238 // Choose mixing block 1239 if (iv) { 1240 block = iv; 1241 1242 // Remove IV for subsequent blocks 1243 this._iv = undefined; 1244 } else { 1245 block = this._prevBlock; 1246 } 1247 1248 // XOR blocks 1249 for (var i = 0; i < blockSize; i++) { 1250 words[offset + i] ^= block[i]; 1251 } 1252 } 1253 1254 return CBC; 1255 }()); 1256 1257 /** 1258 * Padding namespace. 1259 */ 1260 var C_pad = C.pad = {}; 1261 1262 /** 1263 * PKCS #5/7 padding strategy. 1264 */ 1265 var Pkcs7 = C_pad.Pkcs7 = { 1266 /** 1267 * Pads data using the algorithm defined in PKCS #5/7. 1268 * 1269 * @param {WordArray} data The data to pad. 1270 * @param {number} blockSize The multiple that the data should be padded to. 1271 * 1272 * @static 1273 * 1274 * @example 1275 * 1276 * CryptoJS.pad.Pkcs7.pad(wordArray, 4); 1277 */ 1278 pad: function (data, blockSize) { 1279 // Shortcut 1280 var blockSizeBytes = blockSize * 4; 1281 1282 // Count padding bytes 1283 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; 1284 1285 // Create padding word 1286 var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; 1287 1288 // Create padding 1289 var paddingWords = []; 1290 for (var i = 0; i < nPaddingBytes; i += 4) { 1291 paddingWords.push(paddingWord); 1292 } 1293 var padding = WordArray.create(paddingWords, nPaddingBytes); 1294 1295 // Add padding 1296 data.concat(padding); 1297 }, 1298 1299 /** 1300 * Unpads data that had been padded using the algorithm defined in PKCS #5/7. 1301 * 1302 * @param {WordArray} data The data to unpad. 1303 * 1304 * @static 1305 * 1306 * @example 1307 * 1308 * CryptoJS.pad.Pkcs7.unpad(wordArray); 1309 */ 1310 unpad: function (data) { 1311 // Get number of padding bytes from last byte 1312 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; 1313 1314 // Remove padding 1315 data.sigBytes -= nPaddingBytes; 1316 } 1317 }; 1318 1319 /** 1320 * Abstract base block cipher template. 1321 * 1322 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) 1323 */ 1324 var BlockCipher = C_lib.BlockCipher = Cipher.extend({ 1325 /** 1326 * Configuration options. 1327 * 1328 * @property {Mode} mode The block mode to use. Default: CBC 1329 * @property {Padding} padding The padding strategy to use. Default: Pkcs7 1330 */ 1331 cfg: Cipher.cfg.extend({ 1332 mode: CBC, 1333 padding: Pkcs7 1334 }), 1335 1336 reset: function () { 1337 var modeCreator; 1338 1339 // Reset cipher 1340 Cipher.reset.call(this); 1341 1342 // Shortcuts 1343 var cfg = this.cfg; 1344 var iv = cfg.iv; 1345 var mode = cfg.mode; 1346 1347 // Reset block mode 1348 if (this._xformMode == this._ENC_XFORM_MODE) { 1349 modeCreator = mode.createEncryptor; 1350 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { 1351 modeCreator = mode.createDecryptor; 1352 // Keep at least one block in the buffer for unpadding 1353 this._minBufferSize = 1; 1354 } 1355 1356 if (this._mode && this._mode.__creator == modeCreator) { 1357 this._mode.init(this, iv && iv.words); 1358 } else { 1359 this._mode = modeCreator.call(mode, this, iv && iv.words); 1360 this._mode.__creator = modeCreator; 1361 } 1362 }, 1363 1364 _doProcessBlock: function (words, offset) { 1365 this._mode.processBlock(words, offset); 1366 }, 1367 1368 _doFinalize: function () { 1369 var finalProcessedBlocks; 1370 1371 // Shortcut 1372 var padding = this.cfg.padding; 1373 1374 // Finalize 1375 if (this._xformMode == this._ENC_XFORM_MODE) { 1376 // Pad data 1377 padding.pad(this._data, this.blockSize); 1378 1379 // Process final blocks 1380 finalProcessedBlocks = this._process(!!'flush'); 1381 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { 1382 // Process final blocks 1383 finalProcessedBlocks = this._process(!!'flush'); 1384 1385 // Unpad data 1386 padding.unpad(finalProcessedBlocks); 1387 } 1388 1389 return finalProcessedBlocks; 1390 }, 1391 1392 blockSize: 128/32 1393 }); 1394 1395 /** 1396 * A collection of cipher parameters. 1397 * 1398 * @property {WordArray} ciphertext The raw ciphertext. 1399 * @property {WordArray} key The key to this ciphertext. 1400 * @property {WordArray} iv The IV used in the ciphering operation. 1401 * @property {WordArray} salt The salt used with a key derivation function. 1402 * @property {Cipher} algorithm The cipher algorithm. 1403 * @property {Mode} mode The block mode used in the ciphering operation. 1404 * @property {Padding} padding The padding scheme used in the ciphering operation. 1405 * @property {number} blockSize The block size of the cipher. 1406 * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. 1407 */ 1408 var CipherParams = C_lib.CipherParams = Base.extend({ 1409 /** 1410 * Initializes a newly created cipher params object. 1411 * 1412 * @param {Object} cipherParams An object with any of the possible cipher parameters. 1413 * 1414 * @example 1415 * 1416 * var cipherParams = CryptoJS.lib.CipherParams.create({ 1417 * ciphertext: ciphertextWordArray, 1418 * key: keyWordArray, 1419 * iv: ivWordArray, 1420 * salt: saltWordArray, 1421 * algorithm: CryptoJS.algo.AES, 1422 * mode: CryptoJS.mode.CBC, 1423 * padding: CryptoJS.pad.PKCS7, 1424 * blockSize: 4, 1425 * formatter: CryptoJS.format.OpenSSL 1426 * }); 1427 */ 1428 init: function (cipherParams) { 1429 this.mixIn(cipherParams); 1430 }, 1431 1432 /** 1433 * Converts this cipher params object to a string. 1434 * 1435 * @param {Format} formatter (Optional) The formatting strategy to use. 1436 * 1437 * @return {string} The stringified cipher params. 1438 * 1439 * @throws Error If neither the formatter nor the default formatter is set. 1440 * 1441 * @example 1442 * 1443 * var string = cipherParams + ''; 1444 * var string = cipherParams.toString(); 1445 * var string = cipherParams.toString(CryptoJS.format.OpenSSL); 1446 */ 1447 toString: function (formatter) { 1448 return (formatter || this.formatter).stringify(this); 1449 } 1450 }); 1451 1452 /** 1453 * Format namespace. 1454 */ 1455 var C_format = C.format = {}; 1456 1457 /** 1458 * OpenSSL formatting strategy. 1459 */
vendor: 11,645 bytes, lines 1460-1774
1460 var OpenSSLFormatter = C_format.OpenSSL = { 1461 /** 1462 * Converts a cipher params object to an OpenSSL-compatible string. 1463 * 1464 * @param {CipherParams} cipherParams The cipher params object. 1465 * 1466 * @return {string} The OpenSSL-compatible string. 1467 * 1468 * @static 1469 * 1470 * @example 1471 * 1472 * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); 1473 */ 1474 stringify: function (cipherParams) { 1475 var wordArray; 1476 1477 // Shortcuts 1478 var ciphertext = cipherParams.ciphertext; 1479 var salt = cipherParams.salt; 1480 1481 // Format 1482 if (salt) { 1483 wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); 1484 } else { 1485 wordArray = ciphertext; 1486 } 1487 1488 return wordArray.toString(Base64); 1489 }, 1490 1491 /** 1492 * Converts an OpenSSL-compatible string to a cipher params object. 1493 * 1494 * @param {string} openSSLStr The OpenSSL-compatible string. 1495 * 1496 * @return {CipherParams} The cipher params object. 1497 * 1498 * @static 1499 * 1500 * @example 1501 * 1502 * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); 1503 */ 1504 parse: function (openSSLStr) { 1505 var salt; 1506 1507 // Parse base64 1508 var ciphertext = Base64.parse(openSSLStr); 1509 1510 // Shortcut 1511 var ciphertextWords = ciphertext.words; 1512 1513 // Test for salt 1514 if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { 1515 // Extract salt 1516 salt = WordArray.create(ciphertextWords.slice(2, 4)); 1517 1518 // Remove salt from ciphertext 1519 ciphertextWords.splice(0, 4); 1520 ciphertext.sigBytes -= 16; 1521 } 1522 1523 return CipherParams.create({ ciphertext: ciphertext, salt: salt }); 1524 } 1525 }; 1526 1527 /** 1528 * A cipher wrapper that returns ciphertext as a serializable cipher params object. 1529 */ 1530 var SerializableCipher = C_lib.SerializableCipher = Base.extend({ 1531 /** 1532 * Configuration options. 1533 * 1534 * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL 1535 */ 1536 cfg: Base.extend({ 1537 format: OpenSSLFormatter 1538 }), 1539 1540 /** 1541 * Encrypts a message. 1542 * 1543 * @param {Cipher} cipher The cipher algorithm to use. 1544 * @param {WordArray|string} message The message to encrypt. 1545 * @param {WordArray} key The key. 1546 * @param {Object} cfg (Optional) The configuration options to use for this operation. 1547 * 1548 * @return {CipherParams} A cipher params object. 1549 * 1550 * @static 1551 * 1552 * @example 1553 * 1554 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); 1555 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); 1556 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); 1557 */ 1558 encrypt: function (cipher, message, key, cfg) { 1559 // Apply config defaults 1560 cfg = this.cfg.extend(cfg); 1561 1562 // Encrypt 1563 var encryptor = cipher.createEncryptor(key, cfg); 1564 var ciphertext = encryptor.finalize(message); 1565 1566 // Shortcut 1567 var cipherCfg = encryptor.cfg; 1568 1569 // Create and return serializable cipher params 1570 return CipherParams.create({ 1571 ciphertext: ciphertext, 1572 key: key, 1573 iv: cipherCfg.iv, 1574 algorithm: cipher, 1575 mode: cipherCfg.mode, 1576 padding: cipherCfg.padding, 1577 blockSize: cipher.blockSize, 1578 formatter: cfg.format 1579 }); 1580 }, 1581 1582 /** 1583 * Decrypts serialized ciphertext. 1584 * 1585 * @param {Cipher} cipher The cipher algorithm to use. 1586 * @param {CipherParams|string} ciphertext The ciphertext to decrypt. 1587 * @param {WordArray} key The key. 1588 * @param {Object} cfg (Optional) The configuration options to use for this operation. 1589 * 1590 * @return {WordArray} The plaintext. 1591 * 1592 * @static 1593 * 1594 * @example 1595 * 1596 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); 1597 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); 1598 */ 1599 decrypt: function (cipher, ciphertext, key, cfg) { 1600 // Apply config defaults 1601 cfg = this.cfg.extend(cfg); 1602 1603 // Convert string to CipherParams 1604 ciphertext = this._parse(ciphertext, cfg.format); 1605 1606 // Decrypt 1607 var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); 1608 1609 return plaintext; 1610 }, 1611 1612 /** 1613 * Converts serialized ciphertext to CipherParams, 1614 * else assumed CipherParams already and returns ciphertext unchanged. 1615 * 1616 * @param {CipherParams|string} ciphertext The ciphertext. 1617 * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. 1618 * 1619 * @return {CipherParams} The unserialized ciphertext. 1620 * 1621 * @static 1622 * 1623 * @example 1624 * 1625 * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); 1626 */ 1627 _parse: function (ciphertext, format) { 1628 if (typeof ciphertext == 'string') { 1629 return format.parse(ciphertext, this); 1630 } else { 1631 return ciphertext; 1632 } 1633 } 1634 }); 1635 1636 /** 1637 * Key derivation function namespace. 1638 */ 1639 var C_kdf = C.kdf = {}; 1640 1641 /** 1642 * OpenSSL key derivation function. 1643 */ 1644 var OpenSSLKdf = C_kdf.OpenSSL = { 1645 /** 1646 * Derives a key and IV from a password. 1647 * 1648 * @param {string} password The password to derive from. 1649 * @param {number} keySize The size in words of the key to generate. 1650 * @param {number} ivSize The size in words of the IV to generate. 1651 * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. 1652 * 1653 * @return {CipherParams} A cipher params object with the key, IV, and salt. 1654 * 1655 * @static 1656 * 1657 * @example 1658 * 1659 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); 1660 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); 1661 */ 1662 execute: function (password, keySize, ivSize, salt, hasher) { 1663 // Generate random salt 1664 if (!salt) { 1665 salt = WordArray.random(64/8); 1666 } 1667 1668 // Derive key and IV 1669 if (!hasher) { 1670 var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); 1671 } else { 1672 var key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt); 1673 } 1674 1675 1676 // Separate key and IV 1677 var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); 1678 key.sigBytes = keySize * 4; 1679 1680 // Return params 1681 return CipherParams.create({ key: key, iv: iv, salt: salt }); 1682 } 1683 }; 1684 1685 /** 1686 * A serializable cipher wrapper that derives the key from a password, 1687 * and returns ciphertext as a serializable cipher params object. 1688 */ 1689 var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ 1690 /** 1691 * Configuration options. 1692 * 1693 * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL 1694 */ 1695 cfg: SerializableCipher.cfg.extend({ 1696 kdf: OpenSSLKdf 1697 }), 1698 1699 /** 1700 * Encrypts a message using a password. 1701 * 1702 * @param {Cipher} cipher The cipher algorithm to use. 1703 * @param {WordArray|string} message The message to encrypt. 1704 * @param {string} password The password. 1705 * @param {Object} cfg (Optional) The configuration options to use for this operation. 1706 * 1707 * @return {CipherParams} A cipher params object. 1708 * 1709 * @static 1710 * 1711 * @example 1712 * 1713 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); 1714 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); 1715 */ 1716 encrypt: function (cipher, message, password, cfg) { 1717 // Apply config defaults 1718 cfg = this.cfg.extend(cfg); 1719 1720 // Derive key and other params 1721 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher); 1722 1723 // Add IV to config 1724 cfg.iv = derivedParams.iv; 1725 1726 // Encrypt 1727 var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); 1728 1729 // Mix in derived params 1730 ciphertext.mixIn(derivedParams); 1731 1732 return ciphertext; 1733 }, 1734 1735 /** 1736 * Decrypts serialized ciphertext using a password. 1737 * 1738 * @param {Cipher} cipher The cipher algorithm to use. 1739 * @param {CipherParams|string} ciphertext The ciphertext to decrypt. 1740 * @param {string} password The password. 1741 * @param {Object} cfg (Optional) The configuration options to use for this operation. 1742 * 1743 * @return {WordArray} The plaintext. 1744 * 1745 * @static 1746 * 1747 * @example 1748 * 1749 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); 1750 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); 1751 */ 1752 decrypt: function (cipher, ciphertext, password, cfg) { 1753 // Apply config defaults 1754 cfg = this.cfg.extend(cfg); 1755 1756 // Convert string to CipherParams 1757 ciphertext = this._parse(ciphertext, cfg.format); 1758 1759 // Derive key and other params 1760 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher); 1761 1762 // Add IV to config 1763 cfg.iv = derivedParams.iv; 1764 1765 // Decrypt 1766 var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); 1767 1768 return plaintext; 1769 } 1770 }); 1771 }()); 1772 1773 1774}));
vendor: 1,336 bytes, lines 1775-1826
1775 1776/***/ }), 1777 1778/***/ 8249: 1779/***/ (function(module, exports, __webpack_require__) { 1780 1781;(function (root, factory) { 1782 if (true) { 1783 // CommonJS 1784 module.exports = exports = factory(); 1785 } 1786 else {} 1787}(this, function () { 1788 1789 /*globals window, global, require*/ 1790 1791 /** 1792 * CryptoJS core components. 1793 */ 1794 var CryptoJS = CryptoJS || (function (Math, undefined) { 1795 1796 var crypto; 1797 1798 // Native crypto from window (Browser) 1799 if (typeof window !== 'undefined' && window.crypto) { 1800 crypto = window.crypto; 1801 } 1802 1803 // Native crypto in web worker (Browser) 1804 if (typeof self !== 'undefined' && self.crypto) { 1805 crypto = self.crypto; 1806 } 1807 1808 // Native crypto from worker 1809 if (typeof globalThis !== 'undefined' && globalThis.crypto) { 1810 crypto = globalThis.crypto; 1811 } 1812 1813 // Native (experimental IE 11) crypto from window (Browser) 1814 if (!crypto && typeof window !== 'undefined' && window.msCrypto) { 1815 crypto = window.msCrypto; 1816 } 1817 1818 // Native crypto from global (NodeJS) 1819 if (!crypto && typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.crypto) { 1820 crypto = __webpack_require__.g.crypto; 1821 } 1822 1823 // Native crypto import via require (NodeJS) 1824 if (!crypto && "function" === 'function') { 1825 try { 1826 crypto = __webpack_require__(2480
vendor: 5,309 bytes, lines 1826-2012
1826); 1827 } catch (err) {} 1828 } 1829 1830 /* 1831 * Cryptographically secure pseudorandom number generator 1832 * 1833 * As Math.random() is cryptographically not safe to use 1834 */ 1835 var cryptoSecureRandomInt = function () { 1836 if (crypto) { 1837 // Use getRandomValues method (Browser) 1838 if (typeof crypto.getRandomValues === 'function') { 1839 try { 1840 return crypto.getRandomValues(new Uint32Array(1))[0]; 1841 } catch (err) {} 1842 } 1843 1844 // Use randomBytes method (NodeJS) 1845 if (typeof crypto.randomBytes === 'function') { 1846 try { 1847 return crypto.randomBytes(4).readInt32LE(); 1848 } catch (err) {} 1849 } 1850 } 1851 1852 throw new Error('Native crypto module could not be used to get secure random number.'); 1853 }; 1854 1855 /* 1856 * Local polyfill of Object.create 1857 1858 */ 1859 var create = Object.create || (function () { 1860 function F() {} 1861 1862 return function (obj) { 1863 var subtype; 1864 1865 F.prototype = obj; 1866 1867 subtype = new F(); 1868 1869 F.prototype = null; 1870 1871 return subtype; 1872 }; 1873 }()); 1874 1875 /** 1876 * CryptoJS namespace. 1877 */ 1878 var C = {}; 1879 1880 /** 1881 * Library namespace. 1882 */ 1883 var C_lib = C.lib = {}; 1884 1885 /** 1886 * Base object for prototypal inheritance. 1887 */ 1888 var Base = C_lib.Base = (function () { 1889 1890 1891 return { 1892 /** 1893 * Creates a new object that inherits from this object. 1894 * 1895 * @param {Object} overrides Properties to copy into the new object. 1896 * 1897 * @return {Object} The new object. 1898 * 1899 * @static 1900 * 1901 * @example 1902 * 1903 * var MyType = CryptoJS.lib.Base.extend({ 1904 * field: 'value', 1905 * 1906 * method: function () { 1907 * } 1908 * }); 1909 */ 1910 extend: function (overrides) { 1911 // Spawn 1912 var subtype = create(this); 1913 1914 // Augment 1915 if (overrides) { 1916 subtype.mixIn(overrides); 1917 } 1918 1919 // Create default initializer 1920 if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { 1921 subtype.init = function () { 1922 subtype.$super.init.apply(this, arguments); 1923 }; 1924 } 1925 1926 // Initializer's prototype is the subtype object 1927 subtype.init.prototype = subtype; 1928 1929 // Reference supertype 1930 subtype.$super = this; 1931 1932 return subtype; 1933 }, 1934 1935 /** 1936 * Extends this object and runs the init method. 1937 * Arguments to create() will be passed to init(). 1938 * 1939 * @return {Object} The new object. 1940 * 1941 * @static 1942 * 1943 * @example 1944 * 1945 * var instance = MyType.create(); 1946 */ 1947 create: function () { 1948 var instance = this.extend(); 1949 instance.init.apply(instance, arguments); 1950 1951 return instance; 1952 }, 1953 1954 /** 1955 * Initializes a newly created object. 1956 * Override this method to add some logic when your objects are created. 1957 * 1958 * @example 1959 * 1960 * var MyType = CryptoJS.lib.Base.extend({ 1961 * init: function () { 1962 * // ... 1963 * } 1964 * }); 1965 */ 1966 init: function () { 1967 }, 1968 1969 /** 1970 * Copies properties into this object. 1971 * 1972 * @param {Object} properties The properties to mix in. 1973 * 1974 * @example 1975 * 1976 * MyType.mixIn({ 1977 * field: 'value' 1978 * }); 1979 */ 1980 mixIn: function (properties) { 1981 for (var propertyName in properties) { 1982 if (properties.hasOwnProperty(propertyName)) { 1983 this[propertyName] = properties[propertyName]; 1984 } 1985 } 1986 1987 // IE won't copy toString using the loop above 1988 if (properties.hasOwnProperty('toString')) { 1989 this.toString = properties.toString; 1990 } 1991 }, 1992 1993 /** 1994 * Creates a copy of this object. 1995 * 1996 * @return {Object} The clone. 1997 * 1998 * @example 1999 * 2000 * var clone = instance.clone(); 2001 */ 2002 clone: function () { 2003 return this.init.prototype.extend(this); 2004 } 2005 }; 2006 }()); 2007 2008 /** 2009 * An array of 32-bit words. 2010 * 2011 * @property {Array} words The array of 32-bit words. 2012 * @property {number} sigBytes The number of significant bytes in this word array.
vendor: 4,591 bytes, lines 2013-2163
2013 */ 2014 var WordArray = C_lib.WordArray = Base.extend({ 2015 /** 2016 * Initializes a newly created word array. 2017 * 2018 * @param {Array} words (Optional) An array of 32-bit words. 2019 * @param {number} sigBytes (Optional) The number of significant bytes in the words. 2020 * 2021 * @example 2022 * 2023 * var wordArray = CryptoJS.lib.WordArray.create(); 2024 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); 2025 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); 2026 */ 2027 init: function (words, sigBytes) { 2028 words = this.words = words || []; 2029 2030 if (sigBytes != undefined) { 2031 this.sigBytes = sigBytes; 2032 } else { 2033 this.sigBytes = words.length * 4; 2034 } 2035 }, 2036 2037 /** 2038 * Converts this word array to a string. 2039 * 2040 * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex 2041 * 2042 * @return {string} The stringified word array. 2043 * 2044 * @example 2045 * 2046 * var string = wordArray + ''; 2047 * var string = wordArray.toString(); 2048 * var string = wordArray.toString(CryptoJS.enc.Utf8); 2049 */ 2050 toString: function (encoder) { 2051 return (encoder || Hex).stringify(this); 2052 }, 2053 2054 /** 2055 * Concatenates a word array to this word array. 2056 * 2057 * @param {WordArray} wordArray The word array to append. 2058 * 2059 * @return {WordArray} This word array. 2060 * 2061 * @example 2062 * 2063 * wordArray1.concat(wordArray2); 2064 */ 2065 concat: function (wordArray) { 2066 // Shortcuts 2067 var thisWords = this.words; 2068 var thatWords = wordArray.words; 2069 var thisSigBytes = this.sigBytes; 2070 var thatSigBytes = wordArray.sigBytes; 2071 2072 // Clamp excess bits 2073 this.clamp(); 2074 2075 // Concat 2076 if (thisSigBytes % 4) { 2077 // Copy one byte at a time 2078 for (var i = 0; i < thatSigBytes; i++) { 2079 var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 2080 thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); 2081 } 2082 } else { 2083 // Copy one word at a time 2084 for (var j = 0; j < thatSigBytes; j += 4) { 2085 thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; 2086 } 2087 } 2088 this.sigBytes += thatSigBytes; 2089 2090 // Chainable 2091 return this; 2092 }, 2093 2094 /** 2095 * Removes insignificant bits. 2096 * 2097 * @example 2098 * 2099 * wordArray.clamp(); 2100 */ 2101 clamp: function () { 2102 // Shortcuts 2103 var words = this.words; 2104 var sigBytes = this.sigBytes; 2105 2106 // Clamp 2107 words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); 2108 words.length = Math.ceil(sigBytes / 4); 2109 }, 2110 2111 /** 2112 * Creates a copy of this word array. 2113 * 2114 * @return {WordArray} The clone. 2115 * 2116 * @example 2117 * 2118 * var clone = wordArray.clone(); 2119 */ 2120 clone: function () { 2121 var clone = Base.clone.call(this); 2122 clone.words = this.words.slice(0); 2123 2124 return clone; 2125 }, 2126 2127 /** 2128 * Creates a word array filled with random bytes. 2129 * 2130 * @param {number} nBytes The number of random bytes to generate. 2131 * 2132 * @return {WordArray} The random word array. 2133 * 2134 * @static 2135 * 2136 * @example 2137 * 2138 * var wordArray = CryptoJS.lib.WordArray.random(16); 2139 */ 2140 random: function (nBytes) { 2141 var words = []; 2142 2143 for (var i = 0; i < nBytes; i += 4) { 2144 words.push(cryptoSecureRandomInt()); 2145 } 2146 2147 return new WordArray.init(words, nBytes); 2148 } 2149 }); 2150 2151 /** 2152 * Encoder namespace. 2153 */ 2154 var C_enc = C.enc = {}; 2155 2156 /** 2157 * Hex encoding strategy. 2158 */ 2159 var Hex = C_enc.Hex = { 2160 /** 2161 * Converts a word array to a hex string. 2162 * 2163 * @param {WordArray} wordArray The word array.
vendor: 8,564 bytes, lines 2164-2441
2164 * 2165 * @return {string} The hex string. 2166 * 2167 * @static 2168 * 2169 * @example 2170 * 2171 * var hexString = CryptoJS.enc.Hex.stringify(wordArray); 2172 */ 2173 stringify: function (wordArray) { 2174 // Shortcuts 2175 var words = wordArray.words; 2176 var sigBytes = wordArray.sigBytes; 2177 2178 // Convert 2179 var hexChars = []; 2180 for (var i = 0; i < sigBytes; i++) { 2181 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 2182 hexChars.push((bite >>> 4).toString(16)); 2183 hexChars.push((bite & 0x0f).toString(16)); 2184 } 2185 2186 return hexChars.join(''); 2187 }, 2188 2189 /** 2190 * Converts a hex string to a word array. 2191 * 2192 * @param {string} hexStr The hex string. 2193 * 2194 * @return {WordArray} The word array. 2195 * 2196 * @static 2197 * 2198 * @example 2199 * 2200 * var wordArray = CryptoJS.enc.Hex.parse(hexString); 2201 */ 2202 parse: function (hexStr) { 2203 // Shortcut 2204 var hexStrLength = hexStr.length; 2205 2206 // Convert 2207 var words = []; 2208 for (var i = 0; i < hexStrLength; i += 2) { 2209 words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); 2210 } 2211 2212 return new WordArray.init(words, hexStrLength / 2); 2213 } 2214 }; 2215 2216 /** 2217 * Latin1 encoding strategy. 2218 */ 2219 var Latin1 = C_enc.Latin1 = { 2220 /** 2221 * Converts a word array to a Latin1 string. 2222 * 2223 * @param {WordArray} wordArray The word array. 2224 * 2225 * @return {string} The Latin1 string. 2226 * 2227 * @static 2228 * 2229 * @example 2230 * 2231 * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); 2232 */ 2233 stringify: function (wordArray) { 2234 // Shortcuts 2235 var words = wordArray.words; 2236 var sigBytes = wordArray.sigBytes; 2237 2238 // Convert 2239 var latin1Chars = []; 2240 for (var i = 0; i < sigBytes; i++) { 2241 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 2242 latin1Chars.push(String.fromCharCode(bite)); 2243 } 2244 2245 return latin1Chars.join(''); 2246 }, 2247 2248 /** 2249 * Converts a Latin1 string to a word array. 2250 * 2251 * @param {string} latin1Str The Latin1 string. 2252 * 2253 * @return {WordArray} The word array. 2254 * 2255 * @static 2256 * 2257 * @example 2258 * 2259 * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); 2260 */ 2261 parse: function (latin1Str) { 2262 // Shortcut 2263 var latin1StrLength = latin1Str.length; 2264 2265 // Convert 2266 var words = []; 2267 for (var i = 0; i < latin1StrLength; i++) { 2268 words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); 2269 } 2270 2271 return new WordArray.init(words, latin1StrLength); 2272 } 2273 }; 2274 2275 /** 2276 * UTF-8 encoding strategy. 2277 */ 2278 var Utf8 = C_enc.Utf8 = { 2279 /** 2280 * Converts a word array to a UTF-8 string. 2281 * 2282 * @param {WordArray} wordArray The word array. 2283 * 2284 * @return {string} The UTF-8 string. 2285 * 2286 * @static 2287 * 2288 * @example 2289 * 2290 * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); 2291 */ 2292 stringify: function (wordArray) { 2293 try { 2294 return decodeURIComponent(escape(Latin1.stringify(wordArray))); 2295 } catch (e) { 2296 throw new Error('Malformed UTF-8 data'); 2297 } 2298 }, 2299 2300 /** 2301 * Converts a UTF-8 string to a word array. 2302 * 2303 * @param {string} utf8Str The UTF-8 string. 2304 * 2305 * @return {WordArray} The word array. 2306 * 2307 * @static 2308 * 2309 * @example 2310 * 2311 * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); 2312 */ 2313 parse: function (utf8Str) { 2314 return Latin1.parse(unescape(encodeURIComponent(utf8Str))); 2315 } 2316 }; 2317 2318 /** 2319 * Abstract buffered block algorithm template. 2320 * 2321 * The property blockSize must be implemented in a concrete subtype. 2322 * 2323 * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 2324 */ 2325 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ 2326 /** 2327 * Resets this block algorithm's data buffer to its initial state. 2328 * 2329 * @example 2330 * 2331 * bufferedBlockAlgorithm.reset(); 2332 */ 2333 reset: function () { 2334 // Initial values 2335 this._data = new WordArray.init(); 2336 this._nDataBytes = 0; 2337 }, 2338 2339 /** 2340 * Adds new data to this block algorithm's buffer. 2341 * 2342 * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. 2343 * 2344 * @example 2345 * 2346 * bufferedBlockAlgorithm._append('data'); 2347 * bufferedBlockAlgorithm._append(wordArray); 2348 */ 2349 _append: function (data) { 2350 // Convert string to WordArray, else assume WordArray already 2351 if (typeof data == 'string') { 2352 data = Utf8.parse(data); 2353 } 2354 2355 // Append 2356 this._data.concat(data); 2357 this._nDataBytes += data.sigBytes; 2358 }, 2359 2360 /** 2361 * Processes available data blocks. 2362 * 2363 * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. 2364 * 2365 * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. 2366 * 2367 * @return {WordArray} The processed data. 2368 * 2369 * @example 2370 * 2371 * var processedData = bufferedBlockAlgorithm._process(); 2372 * var processedData = bufferedBlockAlgorithm._process(!!'flush'); 2373 */ 2374 _process: function (doFlush) { 2375 var processedWords; 2376 2377 // Shortcuts 2378 var data = this._data; 2379 var dataWords = data.words; 2380 var dataSigBytes = data.sigBytes; 2381 var blockSize = this.blockSize; 2382 var blockSizeBytes = blockSize * 4; 2383 2384 // Count blocks ready 2385 var nBlocksReady = dataSigBytes / blockSizeBytes; 2386 if (doFlush) { 2387 // Round up to include partial blocks 2388 nBlocksReady = Math.ceil(nBlocksReady); 2389 } else { 2390 // Round down to include only full blocks, 2391 // less the number of blocks that must remain in the buffer 2392 nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); 2393 } 2394 2395 // Count words ready 2396 var nWordsReady = nBlocksReady * blockSize; 2397 2398 // Count bytes ready 2399 var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); 2400 2401 // Process blocks 2402 if (nWordsReady) { 2403 for (var offset = 0; offset < nWordsReady; offset += blockSize) { 2404 // Perform concrete-algorithm logic 2405 this._doProcessBlock(dataWords, offset); 2406 } 2407 2408 // Remove processed words 2409 processedWords = dataWords.splice(0, nWordsReady); 2410 data.sigBytes -= nBytesReady; 2411 } 2412 2413 // Return processed words 2414 return new WordArray.init(processedWords, nBytesReady); 2415 }, 2416 2417 /** 2418 * Creates a copy of this object. 2419 * 2420 * @return {Object} The clone. 2421 * 2422 * @example 2423 * 2424 * var clone = bufferedBlockAlgorithm.clone(); 2425 */ 2426 clone: function () { 2427 var clone = Base.clone.call(this); 2428 clone._data = this._data.clone(); 2429 2430 return clone; 2431 }, 2432 2433 _minBufferSize: 0 2434 }); 2435 2436 /** 2437 * Abstract hasher template. 2438 * 2439 * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) 2440 */ 2441
vendor: 56,184 bytes, lines 2441-4439
2441var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ 2442 /** 2443 * Configuration options. 2444 */ 2445 cfg: Base.extend(), 2446 2447 /** 2448 * Initializes a newly created hasher. 2449 * 2450 * @param {Object} cfg (Optional) The configuration options to use for this hash computation. 2451 * 2452 * @example 2453 * 2454 * var hasher = CryptoJS.algo.SHA256.create(); 2455 */ 2456 init: function (cfg) { 2457 // Apply config defaults 2458 this.cfg = this.cfg.extend(cfg); 2459 2460 // Set initial values 2461 this.reset(); 2462 }, 2463 2464 /** 2465 * Resets this hasher to its initial state. 2466 * 2467 * @example 2468 * 2469 * hasher.reset(); 2470 */ 2471 reset: function () { 2472 // Reset data buffer 2473 BufferedBlockAlgorithm.reset.call(this); 2474 2475 // Perform concrete-hasher logic 2476 this._doReset(); 2477 }, 2478 2479 /** 2480 * Updates this hasher with a message. 2481 * 2482 * @param {WordArray|string} messageUpdate The message to append. 2483 * 2484 * @return {Hasher} This hasher. 2485 * 2486 * @example 2487 * 2488 * hasher.update('message'); 2489 * hasher.update(wordArray); 2490 */ 2491 update: function (messageUpdate) { 2492 // Append 2493 this._append(messageUpdate); 2494 2495 // Update the hash 2496 this._process(); 2497 2498 // Chainable 2499 return this; 2500 }, 2501 2502 /** 2503 * Finalizes the hash computation. 2504 * Note that the finalize operation is effectively a destructive, read-once operation. 2505 * 2506 * @param {WordArray|string} messageUpdate (Optional) A final message update. 2507 * 2508 * @return {WordArray} The hash. 2509 * 2510 * @example 2511 * 2512 * var hash = hasher.finalize(); 2513 * var hash = hasher.finalize('message'); 2514 * var hash = hasher.finalize(wordArray); 2515 */ 2516 finalize: function (messageUpdate) { 2517 // Final message update 2518 if (messageUpdate) { 2519 this._append(messageUpdate); 2520 } 2521 2522 // Perform concrete-hasher logic 2523 var hash = this._doFinalize(); 2524 2525 return hash; 2526 }, 2527 2528 blockSize: 512/32, 2529 2530 /** 2531 * Creates a shortcut function to a hasher's object interface. 2532 * 2533 * @param {Hasher} hasher The hasher to create a helper for. 2534 * 2535 * @return {Function} The shortcut function. 2536 * 2537 * @static 2538 * 2539 * @example 2540 * 2541 * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); 2542 */ 2543 _createHelper: function (hasher) { 2544 return function (message, cfg) { 2545 return new hasher.init(cfg).finalize(message); 2546 }; 2547 }, 2548 2549 /** 2550 * Creates a shortcut function to the HMAC's object interface. 2551 * 2552 * @param {Hasher} hasher The hasher to use in this HMAC helper. 2553 * 2554 * @return {Function} The shortcut function. 2555 * 2556 * @static 2557 * 2558 * @example 2559 * 2560 * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); 2561 */ 2562 _createHmacHelper: function (hasher) { 2563 return function (message, key) { 2564 return new C_algo.HMAC.init(hasher, key).finalize(message); 2565 }; 2566 } 2567 }); 2568 2569 /** 2570 * Algorithm namespace. 2571 */ 2572 var C_algo = C.algo = {}; 2573 2574 return C; 2575 }(Math)); 2576 2577 2578 return CryptoJS; 2579 2580})); 2581 2582/***/ }), 2583 2584/***/ 8269: 2585/***/ (function(module, exports, __webpack_require__) { 2586 2587;(function (root, factory) { 2588 if (true) { 2589 // CommonJS 2590 module.exports = exports = factory(__webpack_require__(8249)); 2591 } 2592 else {} 2593}(this, function (CryptoJS) { 2594 2595 (function () { 2596 // Shortcuts 2597 var C = CryptoJS; 2598 var C_lib = C.lib; 2599 var WordArray = C_lib.WordArray; 2600 var C_enc = C.enc; 2601 2602 /** 2603 * Base64 encoding strategy. 2604 */ 2605 var Base64 = C_enc.Base64 = { 2606 /** 2607 * Converts a word array to a Base64 string. 2608 * 2609 * @param {WordArray} wordArray The word array. 2610 * 2611 * @return {string} The Base64 string. 2612 * 2613 * @static 2614 * 2615 * @example 2616 * 2617 * var base64String = CryptoJS.enc.Base64.stringify(wordArray); 2618 */ 2619 stringify: function (wordArray) { 2620 // Shortcuts 2621 var words = wordArray.words; 2622 var sigBytes = wordArray.sigBytes; 2623 var map = this._map; 2624 2625 // Clamp excess bits 2626 wordArray.clamp(); 2627 2628 // Convert 2629 var base64Chars = []; 2630 for (var i = 0; i < sigBytes; i += 3) { 2631 var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 2632 var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; 2633 var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; 2634 2635 var triplet = (byte1 << 16) | (byte2 << 8) | byte3; 2636 2637 for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { 2638 base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); 2639 } 2640 } 2641 2642 // Add padding 2643 var paddingChar = map.charAt(64); 2644 if (paddingChar) { 2645 while (base64Chars.length % 4) { 2646 base64Chars.push(paddingChar); 2647 } 2648 } 2649 2650 return base64Chars.join(''); 2651 }, 2652 2653 /** 2654 * Converts a Base64 string to a word array. 2655 * 2656 * @param {string} base64Str The Base64 string. 2657 * 2658 * @return {WordArray} The word array. 2659 * 2660 * @static 2661 * 2662 * @example 2663 * 2664 * var wordArray = CryptoJS.enc.Base64.parse(base64String); 2665 */ 2666 parse: function (base64Str) { 2667 // Shortcuts 2668 var base64StrLength = base64Str.length; 2669 var map = this._map; 2670 var reverseMap = this._reverseMap; 2671 2672 if (!reverseMap) { 2673 reverseMap = this._reverseMap = []; 2674 for (var j = 0; j < map.length; j++) { 2675 reverseMap[map.charCodeAt(j)] = j; 2676 } 2677 } 2678 2679 // Ignore padding 2680 var paddingChar = map.charAt(64); 2681 if (paddingChar) { 2682 var paddingIndex = base64Str.indexOf(paddingChar); 2683 if (paddingIndex !== -1) { 2684 base64StrLength = paddingIndex; 2685 } 2686 } 2687 2688 // Convert 2689 return parseLoop(base64Str, base64StrLength, reverseMap); 2690 2691 }, 2692 2693 _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' 2694 }; 2695 2696 function parseLoop(base64Str, base64StrLength, reverseMap) { 2697 var words = []; 2698 var nBytes = 0; 2699 for (var i = 0; i < base64StrLength; i++) { 2700 if (i % 4) { 2701 var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); 2702 var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); 2703 var bitsCombined = bits1 | bits2; 2704 words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); 2705 nBytes++; 2706 } 2707 } 2708 return WordArray.create(words, nBytes); 2709 } 2710 }()); 2711 2712 2713 return CryptoJS.enc.Base64; 2714 2715})); 2716 2717/***/ }), 2718 2719/***/ 3786: 2720/***/ (function(module, exports, __webpack_require__) { 2721 2722;(function (root, factory) { 2723 if (true) { 2724 // CommonJS 2725 module.exports = exports = factory(__webpack_require__(8249)); 2726 } 2727 else {} 2728}(this, function (CryptoJS) { 2729 2730 (function () { 2731 // Shortcuts 2732 var C = CryptoJS; 2733 var C_lib = C.lib; 2734 var WordArray = C_lib.WordArray; 2735 var C_enc = C.enc; 2736 2737 /** 2738 * Base64url encoding strategy. 2739 */ 2740 var Base64url = C_enc.Base64url = { 2741 /** 2742 * Converts a word array to a Base64url string. 2743 * 2744 * @param {WordArray} wordArray The word array. 2745 * 2746 * @param {boolean} urlSafe Whether to use url safe 2747 * 2748 * @return {string} The Base64url string. 2749 * 2750 * @static 2751 * 2752 * @example 2753 * 2754 * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); 2755 */ 2756 stringify: function (wordArray, urlSafe) { 2757 if (urlSafe === undefined) { 2758 urlSafe = true 2759 } 2760 // Shortcuts 2761 var words = wordArray.words; 2762 var sigBytes = wordArray.sigBytes; 2763 var map = urlSafe ? this._safe_map : this._map; 2764 2765 // Clamp excess bits 2766 wordArray.clamp(); 2767 2768 // Convert 2769 var base64Chars = []; 2770 for (var i = 0; i < sigBytes; i += 3) { 2771 var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 2772 var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; 2773 var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; 2774 2775 var triplet = (byte1 << 16) | (byte2 << 8) | byte3; 2776 2777 for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { 2778 base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); 2779 } 2780 } 2781 2782 // Add padding 2783 var paddingChar = map.charAt(64); 2784 if (paddingChar) { 2785 while (base64Chars.length % 4) { 2786 base64Chars.push(paddingChar); 2787 } 2788 } 2789 2790 return base64Chars.join(''); 2791 }, 2792 2793 /** 2794 * Converts a Base64url string to a word array. 2795 * 2796 * @param {string} base64Str The Base64url string. 2797 * 2798 * @param {boolean} urlSafe Whether to use url safe 2799 * 2800 * @return {WordArray} The word array. 2801 * 2802 * @static 2803 * 2804 * @example 2805 * 2806 * var wordArray = CryptoJS.enc.Base64url.parse(base64String); 2807 */ 2808 parse: function (base64Str, urlSafe) { 2809 if (urlSafe === undefined) { 2810 urlSafe = true 2811 } 2812 2813 // Shortcuts 2814 var base64StrLength = base64Str.length; 2815 var map = urlSafe ? this._safe_map : this._map; 2816 var reverseMap = this._reverseMap; 2817 2818 if (!reverseMap) { 2819 reverseMap = this._reverseMap = []; 2820 for (var j = 0; j < map.length; j++) { 2821 reverseMap[map.charCodeAt(j)] = j; 2822 } 2823 } 2824 2825 // Ignore padding 2826 var paddingChar = map.charAt(64); 2827 if (paddingChar) { 2828 var paddingIndex = base64Str.indexOf(paddingChar); 2829 if (paddingIndex !== -1) { 2830 base64StrLength = paddingIndex; 2831 } 2832 } 2833 2834 // Convert 2835 return parseLoop(base64Str, base64StrLength, reverseMap); 2836 2837 }, 2838 2839 _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', 2840 _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', 2841 }; 2842 2843 function parseLoop(base64Str, base64StrLength, reverseMap) { 2844 var words = []; 2845 var nBytes = 0; 2846 for (var i = 0; i < base64StrLength; i++) { 2847 if (i % 4) { 2848 var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); 2849 var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); 2850 var bitsCombined = bits1 | bits2; 2851 words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); 2852 nBytes++; 2853 } 2854 } 2855 return WordArray.create(words, nBytes); 2856 } 2857 }()); 2858 2859 2860 return CryptoJS.enc.Base64url; 2861 2862})); 2863 2864/***/ }), 2865 2866/***/ 298: 2867/***/ (function(module, exports, __webpack_require__) { 2868 2869;(function (root, factory) { 2870 if (true) { 2871 // CommonJS 2872 module.exports = exports = factory(__webpack_require__(8249)); 2873 } 2874 else {} 2875}(this, function (CryptoJS) { 2876 2877 (function () { 2878 // Shortcuts 2879 var C = CryptoJS; 2880 var C_lib = C.lib; 2881 var WordArray = C_lib.WordArray; 2882 var C_enc = C.enc; 2883 2884 /** 2885 * UTF-16 BE encoding strategy. 2886 */ 2887 var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { 2888 /** 2889 * Converts a word array to a UTF-16 BE string. 2890 * 2891 * @param {WordArray} wordArray The word array. 2892 * 2893 * @return {string} The UTF-16 BE string. 2894 * 2895 * @static 2896 * 2897 * @example 2898 * 2899 * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); 2900 */ 2901 stringify: function (wordArray) { 2902 // Shortcuts 2903 var words = wordArray.words; 2904 var sigBytes = wordArray.sigBytes; 2905 2906 // Convert 2907 var utf16Chars = []; 2908 for (var i = 0; i < sigBytes; i += 2) { 2909 var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; 2910 utf16Chars.push(String.fromCharCode(codePoint)); 2911 } 2912 2913 return utf16Chars.join(''); 2914 }, 2915 2916 /** 2917 * Converts a UTF-16 BE string to a word array. 2918 * 2919 * @param {string} utf16Str The UTF-16 BE string. 2920 * 2921 * @return {WordArray} The word array. 2922 * 2923 * @static 2924 * 2925 * @example 2926 * 2927 * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); 2928 */ 2929 parse: function (utf16Str) { 2930 // Shortcut 2931 var utf16StrLength = utf16Str.length; 2932 2933 // Convert 2934 var words = []; 2935 for (var i = 0; i < utf16StrLength; i++) { 2936 words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); 2937 } 2938 2939 return WordArray.create(words, utf16StrLength * 2); 2940 } 2941 }; 2942 2943 /** 2944 * UTF-16 LE encoding strategy. 2945 */ 2946 C_enc.Utf16LE = { 2947 /** 2948 * Converts a word array to a UTF-16 LE string. 2949 * 2950 * @param {WordArray} wordArray The word array. 2951 * 2952 * @return {string} The UTF-16 LE string. 2953 * 2954 * @static 2955 * 2956 * @example 2957 * 2958 * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); 2959 */ 2960 stringify: function (wordArray) { 2961 // Shortcuts 2962 var words = wordArray.words; 2963 var sigBytes = wordArray.sigBytes; 2964 2965 // Convert 2966 var utf16Chars = []; 2967 for (var i = 0; i < sigBytes; i += 2) { 2968 var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); 2969 utf16Chars.push(String.fromCharCode(codePoint)); 2970 } 2971 2972 return utf16Chars.join(''); 2973 }, 2974 2975 /** 2976 * Converts a UTF-16 LE string to a word array. 2977 * 2978 * @param {string} utf16Str The UTF-16 LE string. 2979 * 2980 * @return {WordArray} The word array. 2981 * 2982 * @static 2983 * 2984 * @example 2985 * 2986 * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); 2987 */ 2988 parse: function (utf16Str) { 2989 // Shortcut 2990 var utf16StrLength = utf16Str.length; 2991 2992 // Convert 2993 var words = []; 2994 for (var i = 0; i < utf16StrLength; i++) { 2995 words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); 2996 } 2997 2998 return WordArray.create(words, utf16StrLength * 2); 2999 } 3000 }; 3001 3002 function swapEndian(word) { 3003 return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); 3004 } 3005 }()); 3006 3007 3008 return CryptoJS.enc.Utf16; 3009 3010})); 3011 3012/***/ }), 3013 3014/***/ 888: 3015/***/ (function(module, exports, __webpack_require__) { 3016 3017;(function (root, factory, undef) { 3018 if (true) { 3019 // CommonJS 3020 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(2783), __webpack_require__(9824)); 3021 } 3022 else {} 3023}(this, function (CryptoJS) { 3024 3025 (function () { 3026 // Shortcuts 3027 var C = CryptoJS; 3028 var C_lib = C.lib; 3029 var Base = C_lib.Base; 3030 var WordArray = C_lib.WordArray; 3031 var C_algo = C.algo; 3032 var MD5 = C_algo.MD5; 3033 3034 /** 3035 * This key derivation function is meant to conform with EVP_BytesToKey. 3036 * www.openssl.org/docs/crypto/EVP_BytesToKey.html 3037 */ 3038 var EvpKDF = C_algo.EvpKDF = Base.extend({ 3039 /** 3040 * Configuration options. 3041 * 3042 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) 3043 * @property {Hasher} hasher The hash algorithm to use. Default: MD5 3044 * @property {number} iterations The number of iterations to perform. Default: 1 3045 */ 3046 cfg: Base.extend({ 3047 keySize: 128/32, 3048 hasher: MD5, 3049 iterations: 1 3050 }), 3051 3052 /** 3053 * Initializes a newly created key derivation function. 3054 * 3055 * @param {Object} cfg (Optional) The configuration options to use for the derivation. 3056 * 3057 * @example 3058 * 3059 * var kdf = CryptoJS.algo.EvpKDF.create(); 3060 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); 3061 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); 3062 */ 3063 init: function (cfg) { 3064 this.cfg = this.cfg.extend(cfg); 3065 }, 3066 3067 /** 3068 * Derives a key from a password. 3069 * 3070 * @param {WordArray|string} password The password. 3071 * @param {WordArray|string} salt A salt. 3072 * 3073 * @return {WordArray} The derived key. 3074 * 3075 * @example 3076 * 3077 * var key = kdf.compute(password, salt); 3078 */ 3079 compute: function (password, salt) { 3080 var block; 3081 3082 // Shortcut 3083 var cfg = this.cfg; 3084 3085 // Init hasher 3086 var hasher = cfg.hasher.create(); 3087 3088 // Initial values 3089 var derivedKey = WordArray.create(); 3090 3091 // Shortcuts 3092 var derivedKeyWords = derivedKey.words; 3093 var keySize = cfg.keySize; 3094 var iterations = cfg.iterations; 3095 3096 // Generate key 3097 while (derivedKeyWords.length < keySize) { 3098 if (block) { 3099 hasher.update(block); 3100 } 3101 block = hasher.update(password).finalize(salt); 3102 hasher.reset(); 3103 3104 // Iterations 3105 for (var i = 1; i < iterations; i++) { 3106 block = hasher.finalize(block); 3107 hasher.reset(); 3108 } 3109 3110 derivedKey.concat(block); 3111 } 3112 derivedKey.sigBytes = keySize * 4; 3113 3114 return derivedKey; 3115 } 3116 }); 3117 3118 /** 3119 * Derives a key from a password. 3120 * 3121 * @param {WordArray|string} password The password. 3122 * @param {WordArray|string} salt A salt. 3123 * @param {Object} cfg (Optional) The configuration options to use for this computation. 3124 * 3125 * @return {WordArray} The derived key. 3126 * 3127 * @static 3128 * 3129 * @example 3130 * 3131 * var key = CryptoJS.EvpKDF(password, salt); 3132 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); 3133 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); 3134 */ 3135 C.EvpKDF = function (password, salt, cfg) { 3136 return EvpKDF.create(cfg).compute(password, salt); 3137 }; 3138 }()); 3139 3140 3141 return CryptoJS.EvpKDF; 3142 3143})); 3144 3145/***/ }), 3146 3147/***/ 2209: 3148/***/ (function(module, exports, __webpack_require__) { 3149 3150;(function (root, factory, undef) { 3151 if (true) { 3152 // CommonJS 3153 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 3154 } 3155 else {} 3156}(this, function (CryptoJS) { 3157 3158 (function (undefined) { 3159 // Shortcuts 3160 var C = CryptoJS; 3161 var C_lib = C.lib; 3162 var CipherParams = C_lib.CipherParams; 3163 var C_enc = C.enc; 3164 var Hex = C_enc.Hex; 3165 var C_format = C.format; 3166 3167 var HexFormatter = C_format.Hex = { 3168 /** 3169 * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. 3170 * 3171 * @param {CipherParams} cipherParams The cipher params object. 3172 * 3173 * @return {string} The hexadecimally encoded string. 3174 * 3175 * @static 3176 * 3177 * @example 3178 * 3179 * var hexString = CryptoJS.format.Hex.stringify(cipherParams); 3180 */ 3181 stringify: function (cipherParams) { 3182 return cipherParams.ciphertext.toString(Hex); 3183 }, 3184 3185 /** 3186 * Converts a hexadecimally encoded ciphertext string to a cipher params object. 3187 * 3188 * @param {string} input The hexadecimally encoded string. 3189 * 3190 * @return {CipherParams} The cipher params object. 3191 * 3192 * @static 3193 * 3194 * @example 3195 * 3196 * var cipherParams = CryptoJS.format.Hex.parse(hexString); 3197 */ 3198 parse: function (input) { 3199 var ciphertext = Hex.parse(input); 3200 return CipherParams.create({ ciphertext: ciphertext }); 3201 } 3202 }; 3203 }()); 3204 3205 3206 return CryptoJS.format.Hex; 3207 3208})); 3209 3210/***/ }), 3211 3212/***/ 9824: 3213/***/ (function(module, exports, __webpack_require__) { 3214 3215;(function (root, factory) { 3216 if (true) { 3217 // CommonJS 3218 module.exports = exports = factory(__webpack_require__(8249)); 3219 } 3220 else {} 3221}(this, function (CryptoJS) { 3222 3223 (function () { 3224 // Shortcuts 3225 var C = CryptoJS; 3226 var C_lib = C.lib; 3227 var Base = C_lib.Base; 3228 var C_enc = C.enc; 3229 var Utf8 = C_enc.Utf8; 3230 var C_algo = C.algo; 3231 3232 /** 3233 * HMAC algorithm. 3234 */ 3235 var HMAC = C_algo.HMAC = Base.extend({ 3236 /** 3237 * Initializes a newly created HMAC. 3238 * 3239 * @param {Hasher} hasher The hash algorithm to use. 3240 * @param {WordArray|string} key The secret key. 3241 * 3242 * @example 3243 * 3244 * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); 3245 */ 3246 init: function (hasher, key) { 3247 // Init hasher 3248 hasher = this._hasher = new hasher.init(); 3249 3250 // Convert string to WordArray, else assume WordArray already 3251 if (typeof key == 'string') { 3252 key = Utf8.parse(key); 3253 } 3254 3255 // Shortcuts 3256 var hasherBlockSize = hasher.blockSize; 3257 var hasherBlockSizeBytes = hasherBlockSize * 4; 3258 3259 // Allow arbitrary length keys 3260 if (key.sigBytes > hasherBlockSizeBytes) { 3261 key = hasher.finalize(key); 3262 } 3263 3264 // Clamp excess bits 3265 key.clamp(); 3266 3267 // Clone key for inner and outer pads 3268 var oKey = this._oKey = key.clone(); 3269 var iKey = this._iKey = key.clone(); 3270 3271 // Shortcuts 3272 var oKeyWords = oKey.words; 3273 var iKeyWords = iKey.words; 3274 3275 // XOR keys with pad constants 3276 for (var i = 0; i < hasherBlockSize; i++) { 3277 oKeyWords[i] ^= 0x5c5c5c5c; 3278 iKeyWords[i] ^= 0x36363636; 3279 } 3280 oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; 3281 3282 // Set initial values 3283 this.reset(); 3284 }, 3285 3286 /** 3287 * Resets this HMAC to its initial state. 3288 * 3289 * @example 3290 * 3291 * hmacHasher.reset(); 3292 */ 3293 reset: function () { 3294 // Shortcut 3295 var hasher = this._hasher; 3296 3297 // Reset 3298 hasher.reset(); 3299 hasher.update(this._iKey); 3300 }, 3301 3302 /** 3303 * Updates this HMAC with a message. 3304 * 3305 * @param {WordArray|string} messageUpdate The message to append. 3306 * 3307 * @return {HMAC} This HMAC instance. 3308 * 3309 * @example 3310 * 3311 * hmacHasher.update('message'); 3312 * hmacHasher.update(wordArray); 3313 */ 3314 update: function (messageUpdate) { 3315 this._hasher.update(messageUpdate); 3316 3317 // Chainable 3318 return this; 3319 }, 3320 3321 /** 3322 * Finalizes the HMAC computation. 3323 * Note that the finalize operation is effectively a destructive, read-once operation. 3324 * 3325 * @param {WordArray|string} messageUpdate (Optional) A final message update. 3326 * 3327 * @return {WordArray} The HMAC. 3328 * 3329 * @example 3330 * 3331 * var hmac = hmacHasher.finalize(); 3332 * var hmac = hmacHasher.finalize('message'); 3333 * var hmac = hmacHasher.finalize(wordArray); 3334 */ 3335 finalize: function (messageUpdate) { 3336 // Shortcut 3337 var hasher = this._hasher; 3338 3339 // Compute HMAC 3340 var innerHash = hasher.finalize(messageUpdate); 3341 hasher.reset(); 3342 var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); 3343 3344 return hmac; 3345 } 3346 }); 3347 }()); 3348 3349 3350})); 3351 3352/***/ }), 3353 3354/***/ 1354: 3355/***/ (function(module, exports, __webpack_require__) { 3356 3357;(function (root, factory, undef) { 3358 if (true) { 3359 // CommonJS 3360 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(4938), __webpack_require__(4433), __webpack_require__(298), __webpack_require__(8269), __webpack_require__(3786), __webpack_require__(3125), __webpack_require__(2783), __webpack_require__(2153), __webpack_require__(7792), __webpack_require__(34), __webpack_require__(7460), __webpack_require__(3327), __webpack_require__(706), __webpack_require__(9824), __webpack_require__(2112), __webpack_require__(888), __webpack_require__(5109), __webpack_require__(8568), __webpack_require__(4242), __webpack_require__(9968), __webpack_require__(7660), __webpack_require__(1148), __webpack_require__(3615), __webpack_require__(2807), __webpack_require__(1077), __webpack_require__(6475), __webpack_require__(6991), __webpack_require__(2209), __webpack_require__(452), __webpack_require__(4253), __webpack_require__(1857), __webpack_require__(4454), __webpack_require__(3974), __webpack_require__(7407)); 3361 } 3362 else {} 3363}(this, function (CryptoJS) { 3364 3365 return CryptoJS; 3366 3367})); 3368 3369/***/ }), 3370 3371/***/ 4433: 3372/***/ (function(module, exports, __webpack_require__) { 3373 3374;(function (root, factory) { 3375 if (true) { 3376 // CommonJS 3377 module.exports = exports = factory(__webpack_require__(8249)); 3378 } 3379 else {} 3380}(this, function (CryptoJS) { 3381 3382 (function () { 3383 // Check if typed arrays are supported 3384 if (typeof ArrayBuffer != 'function') { 3385 return; 3386 } 3387 3388 // Shortcuts 3389 var C = CryptoJS; 3390 var C_lib = C.lib; 3391 var WordArray = C_lib.WordArray; 3392 3393 // Reference original init 3394 var superInit = WordArray.init; 3395 3396 // Augment WordArray.init to handle typed arrays 3397 var subInit = WordArray.init = function (typedArray) { 3398 // Convert buffers to uint8 3399 if (typedArray instanceof ArrayBuffer) { 3400 typedArray = new Uint8Array(typedArray); 3401 } 3402 3403 // Convert other array views to uint8 3404 if ( 3405 typedArray instanceof Int8Array || 3406 (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || 3407 typedArray instanceof Int16Array || 3408 typedArray instanceof Uint16Array || 3409 typedArray instanceof Int32Array || 3410 typedArray instanceof Uint32Array || 3411 typedArray instanceof Float32Array || 3412 typedArray instanceof Float64Array 3413 ) { 3414 typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); 3415 } 3416 3417 // Handle Uint8Array 3418 if (typedArray instanceof Uint8Array) { 3419 // Shortcut 3420 var typedArrayByteLength = typedArray.byteLength; 3421 3422 // Extract bytes 3423 var words = []; 3424 for (var i = 0; i < typedArrayByteLength; i++) { 3425 words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); 3426 } 3427 3428 // Initialize this word array 3429 superInit.call(this, words, typedArrayByteLength); 3430 } else { 3431 // Else call normal init 3432 superInit.apply(this, arguments); 3433 } 3434 }; 3435 3436 subInit.prototype = WordArray; 3437 }()); 3438 3439 3440 return CryptoJS.lib.WordArray; 3441 3442})); 3443 3444/***/ }), 3445 3446/***/ 3125: 3447/***/ (function(module, exports, __webpack_require__) { 3448 3449;(function (root, factory) { 3450 if (true) { 3451 // CommonJS 3452 module.exports = exports = factory(__webpack_require__(8249)); 3453 } 3454 else {} 3455}(this, function (CryptoJS) { 3456 3457 (function (Math) { 3458 // Shortcuts 3459 var C = CryptoJS; 3460 var C_lib = C.lib; 3461 var WordArray = C_lib.WordArray; 3462 var Hasher = C_lib.Hasher; 3463 var C_algo = C.algo; 3464 3465 // Constants table 3466 var T = []; 3467 3468 // Compute constants 3469 (function () { 3470 for (var i = 0; i < 64; i++) { 3471 T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; 3472 } 3473 }()); 3474 3475 /** 3476 * MD5 hash algorithm. 3477 */ 3478 var MD5 = C_algo.MD5 = Hasher.extend({ 3479 _doReset: function () { 3480 this._hash = new WordArray.init([ 3481 0x67452301, 0xefcdab89, 3482 0x98badcfe, 0x10325476 3483 ]); 3484 }, 3485 3486 _doProcessBlock: function (M, offset) { 3487 // Swap endian 3488 for (var i = 0; i < 16; i++) { 3489 // Shortcuts 3490 var offset_i = offset + i; 3491 var M_offset_i = M[offset_i]; 3492 3493 M[offset_i] = ( 3494 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | 3495 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) 3496 ); 3497 } 3498 3499 // Shortcuts 3500 var H = this._hash.words; 3501 3502 var M_offset_0 = M[offset + 0]; 3503 var M_offset_1 = M[offset + 1]; 3504 var M_offset_2 = M[offset + 2]; 3505 var M_offset_3 = M[offset + 3]; 3506 var M_offset_4 = M[offset + 4]; 3507 var M_offset_5 = M[offset + 5]; 3508 var M_offset_6 = M[offset + 6]; 3509 var M_offset_7 = M[offset + 7]; 3510 var M_offset_8 = M[offset + 8]; 3511 var M_offset_9 = M[offset + 9]; 3512 var M_offset_10 = M[offset + 10]; 3513 var M_offset_11 = M[offset + 11]; 3514 var M_offset_12 = M[offset + 12]; 3515 var M_offset_13 = M[offset + 13]; 3516 var M_offset_14 = M[offset + 14]; 3517 var M_offset_15 = M[offset + 15]; 3518 3519 // Working variables 3520 var a = H[0]; 3521 var b = H[1]; 3522 var c = H[2]; 3523 var d = H[3]; 3524 3525 // Computation 3526 a = FF(a, b, c, d, M_offset_0, 7, T[0]); 3527 d = FF(d, a, b, c, M_offset_1, 12, T[1]); 3528 c = FF(c, d, a, b, M_offset_2, 17, T[2]); 3529 b = FF(b, c, d, a, M_offset_3, 22, T[3]); 3530 a = FF(a, b, c, d, M_offset_4, 7, T[4]); 3531 d = FF(d, a, b, c, M_offset_5, 12, T[5]); 3532 c = FF(c, d, a, b, M_offset_6, 17, T[6]); 3533 b = FF(b, c, d, a, M_offset_7, 22, T[7]); 3534 a = FF(a, b, c, d, M_offset_8, 7, T[8]); 3535 d = FF(d, a, b, c, M_offset_9, 12, T[9]); 3536 c = FF(c, d, a, b, M_offset_10, 17, T[10]); 3537 b = FF(b, c, d, a, M_offset_11, 22, T[11]); 3538 a = FF(a, b, c, d, M_offset_12, 7, T[12]); 3539 d = FF(d, a, b, c, M_offset_13, 12, T[13]); 3540 c = FF(c, d, a, b, M_offset_14, 17, T[14]); 3541 b = FF(b, c, d, a, M_offset_15, 22, T[15]); 3542 3543 a = GG(a, b, c, d, M_offset_1, 5, T[16]); 3544 d = GG(d, a, b, c, M_offset_6, 9, T[17]); 3545 c = GG(c, d, a, b, M_offset_11, 14, T[18]); 3546 b = GG(b, c, d, a, M_offset_0, 20, T[19]); 3547 a = GG(a, b, c, d, M_offset_5, 5, T[20]); 3548 d = GG(d, a, b, c, M_offset_10, 9, T[21]); 3549 c = GG(c, d, a, b, M_offset_15, 14, T[22]); 3550 b = GG(b, c, d, a, M_offset_4, 20, T[23]); 3551 a = GG(a, b, c, d, M_offset_9, 5, T[24]); 3552 d = GG(d, a, b, c, M_offset_14, 9, T[25]); 3553 c = GG(c, d, a, b, M_offset_3, 14, T[26]); 3554 b = GG(b, c, d, a, M_offset_8, 20, T[27]); 3555 a = GG(a, b, c, d, M_offset_13, 5, T[28]); 3556 d = GG(d, a, b, c, M_offset_2, 9, T[29]); 3557 c = GG(c, d, a, b, M_offset_7, 14, T[30]); 3558 b = GG(b, c, d, a, M_offset_12, 20, T[31]); 3559 3560 a = HH(a, b, c, d, M_offset_5, 4, T[32]); 3561 d = HH(d, a, b, c, M_offset_8, 11, T[33]); 3562 c = HH(c, d, a, b, M_offset_11, 16, T[34]); 3563 b = HH(b, c, d, a, M_offset_14, 23, T[35]); 3564 a = HH(a, b, c, d, M_offset_1, 4, T[36]); 3565 d = HH(d, a, b, c, M_offset_4, 11, T[37]); 3566 c = HH(c, d, a, b, M_offset_7, 16, T[38]); 3567 b = HH(b, c, d, a, M_offset_10, 23, T[39]); 3568 a = HH(a, b, c, d, M_offset_13, 4, T[40]); 3569 d = HH(d, a, b, c, M_offset_0, 11, T[41]); 3570 c = HH(c, d, a, b, M_offset_3, 16, T[42]); 3571 b = HH(b, c, d, a, M_offset_6, 23, T[43]); 3572 a = HH(a, b, c, d, M_offset_9, 4, T[44]); 3573 d = HH(d, a, b, c, M_offset_12, 11, T[45]); 3574 c = HH(c, d, a, b, M_offset_15, 16, T[46]); 3575 b = HH(b, c, d, a, M_offset_2, 23, T[47]); 3576 3577 a = II(a, b, c, d, M_offset_0, 6, T[48]); 3578 d = II(d, a, b, c, M_offset_7, 10, T[49]); 3579 c = II(c, d, a, b, M_offset_14, 15, T[50]); 3580 b = II(b, c, d, a, M_offset_5, 21, T[51]); 3581 a = II(a, b, c, d, M_offset_12, 6, T[52]); 3582 d = II(d, a, b, c, M_offset_3, 10, T[53]); 3583 c = II(c, d, a, b, M_offset_10, 15, T[54]); 3584 b = II(b, c, d, a, M_offset_1, 21, T[55]); 3585 a = II(a, b, c, d, M_offset_8, 6, T[56]); 3586 d = II(d, a, b, c, M_offset_15, 10, T[57]); 3587 c = II(c, d, a, b, M_offset_6, 15, T[58]); 3588 b = II(b, c, d, a, M_offset_13, 21, T[59]); 3589 a = II(a, b, c, d, M_offset_4, 6, T[60]); 3590 d = II(d, a, b, c, M_offset_11, 10, T[61]); 3591 c = II(c, d, a, b, M_offset_2, 15, T[62]); 3592 b = II(b, c, d, a, M_offset_9, 21, T[63]); 3593 3594 // Intermediate hash value 3595 H[0] = (H[0] + a) | 0; 3596 H[1] = (H[1] + b) | 0; 3597 H[2] = (H[2] + c) | 0; 3598 H[3] = (H[3] + d) | 0; 3599 }, 3600 3601 _doFinalize: function () { 3602 // Shortcuts 3603 var data = this._data; 3604 var dataWords = data.words; 3605 3606 var nBitsTotal = this._nDataBytes * 8; 3607 var nBitsLeft = data.sigBytes * 8; 3608 3609 // Add padding 3610 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 3611 3612 var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); 3613 var nBitsTotalL = nBitsTotal; 3614 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( 3615 (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | 3616 (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) 3617 ); 3618 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( 3619 (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | 3620 (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) 3621 ); 3622 3623 data.sigBytes = (dataWords.length + 1) * 4; 3624 3625 // Hash final blocks 3626 this._process(); 3627 3628 // Shortcuts 3629 var hash = this._hash; 3630 var H = hash.words; 3631 3632 // Swap endian 3633 for (var i = 0; i < 4; i++) { 3634 // Shortcut 3635 var H_i = H[i]; 3636 3637 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | 3638 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); 3639 } 3640 3641 // Return final computed hash 3642 return hash; 3643 }, 3644 3645 clone: function () { 3646 var clone = Hasher.clone.call(this); 3647 clone._hash = this._hash.clone(); 3648 3649 return clone; 3650 } 3651 }); 3652 3653 function FF(a, b, c, d, x, s, t) { 3654 var n = a + ((b & c) | (~b & d)) + x + t; 3655 return ((n << s) | (n >>> (32 - s))) + b; 3656 } 3657 3658 function GG(a, b, c, d, x, s, t) { 3659 var n = a + ((b & d) | (c & ~d)) + x + t; 3660 return ((n << s) | (n >>> (32 - s))) + b; 3661 } 3662 3663 function HH(a, b, c, d, x, s, t) { 3664 var n = a + (b ^ c ^ d) + x + t; 3665 return ((n << s) | (n >>> (32 - s))) + b; 3666 } 3667 3668 function II(a, b, c, d, x, s, t) { 3669 var n = a + (c ^ (b | ~d)) + x + t; 3670 return ((n << s) | (n >>> (32 - s))) + b; 3671 } 3672 3673 /** 3674 * Shortcut function to the hasher's object interface. 3675 * 3676 * @param {WordArray|string} message The message to hash. 3677 * 3678 * @return {WordArray} The hash. 3679 * 3680 * @static 3681 * 3682 * @example 3683 * 3684 * var hash = CryptoJS.MD5('message'); 3685 * var hash = CryptoJS.MD5(wordArray); 3686 */ 3687 C.MD5 = Hasher._createHelper(MD5); 3688 3689 /** 3690 * Shortcut function to the HMAC's object interface. 3691 * 3692 * @param {WordArray|string} message The message to hash. 3693 * @param {WordArray|string} key The secret key. 3694 * 3695 * @return {WordArray} The HMAC. 3696 * 3697 * @static 3698 * 3699 * @example 3700 * 3701 * var hmac = CryptoJS.HmacMD5(message, key); 3702 */ 3703 C.HmacMD5 = Hasher._createHmacHelper(MD5); 3704 }(Math)); 3705 3706 3707 return CryptoJS.MD5; 3708 3709})); 3710 3711/***/ }), 3712 3713/***/ 8568: 3714/***/ (function(module, exports, __webpack_require__) { 3715 3716;(function (root, factory, undef) { 3717 if (true) { 3718 // CommonJS 3719 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 3720 } 3721 else {} 3722}(this, function (CryptoJS) { 3723 3724 /** 3725 * Cipher Feedback block mode. 3726 */ 3727 CryptoJS.mode.CFB = (function () { 3728 var CFB = CryptoJS.lib.BlockCipherMode.extend(); 3729 3730 CFB.Encryptor = CFB.extend({ 3731 processBlock: function (words, offset) { 3732 // Shortcuts 3733 var cipher = this._cipher; 3734 var blockSize = cipher.blockSize; 3735 3736 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); 3737 3738 // Remember this block to use with next block 3739 this._prevBlock = words.slice(offset, offset + blockSize); 3740 } 3741 }); 3742 3743 CFB.Decryptor = CFB.extend({ 3744 processBlock: function (words, offset) { 3745 // Shortcuts 3746 var cipher = this._cipher; 3747 var blockSize = cipher.blockSize; 3748 3749 // Remember this block to use with next block 3750 var thisBlock = words.slice(offset, offset + blockSize); 3751 3752 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); 3753 3754 // This block becomes the previous block 3755 this._prevBlock = thisBlock; 3756 } 3757 }); 3758 3759 function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { 3760 var keystream; 3761 3762 // Shortcut 3763 var iv = this._iv; 3764 3765 // Generate keystream 3766 if (iv) { 3767 keystream = iv.slice(0); 3768 3769 // Remove IV for subsequent blocks 3770 this._iv = undefined; 3771 } else { 3772 keystream = this._prevBlock; 3773 } 3774 cipher.encryptBlock(keystream, 0); 3775 3776 // Encrypt 3777 for (var i = 0; i < blockSize; i++) { 3778 words[offset + i] ^= keystream[i]; 3779 } 3780 } 3781 3782 return CFB; 3783 }()); 3784 3785 3786 return CryptoJS.mode.CFB; 3787 3788})); 3789 3790/***/ }), 3791 3792/***/ 9968: 3793/***/ (function(module, exports, __webpack_require__) { 3794 3795;(function (root, factory, undef) { 3796 if (true) { 3797 // CommonJS 3798 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 3799 } 3800 else {} 3801}(this, function (CryptoJS) { 3802 3803 /** @preserve 3804 * Counter block mode compatible with Dr Brian Gladman fileenc.c 3805 * derived from CryptoJS.mode.CTR 3806 * Jan Hruby [email protected] 3807 */ 3808 CryptoJS.mode.CTRGladman = (function () { 3809 var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); 3810 3811 function incWord(word) 3812 { 3813 if (((word >> 24) & 0xff) === 0xff) { //overflow 3814 var b1 = (word >> 16)&0xff; 3815 var b2 = (word >> 8)&0xff; 3816 var b3 = word & 0xff; 3817 3818 if (b1 === 0xff) // overflow b1 3819 { 3820 b1 = 0; 3821 if (b2 === 0xff) 3822 { 3823 b2 = 0; 3824 if (b3 === 0xff) 3825 { 3826 b3 = 0; 3827 } 3828 else 3829 { 3830 ++b3; 3831 } 3832 } 3833 else 3834 { 3835 ++b2; 3836 } 3837 } 3838 else 3839 { 3840 ++b1; 3841 } 3842 3843 word = 0; 3844 word += (b1 << 16); 3845 word += (b2 << 8); 3846 word += b3; 3847 } 3848 else 3849 { 3850 word += (0x01 << 24); 3851 } 3852 return word; 3853 } 3854 3855 function incCounter(counter) 3856 { 3857 if ((counter[0] = incWord(counter[0])) === 0) 3858 { 3859 // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 3860 counter[1] = incWord(counter[1]); 3861 } 3862 return counter; 3863 } 3864 3865 var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ 3866 processBlock: function (words, offset) { 3867 // Shortcuts 3868 var cipher = this._cipher 3869 var blockSize = cipher.blockSize; 3870 var iv = this._iv; 3871 var counter = this._counter; 3872 3873 // Generate keystream 3874 if (iv) { 3875 counter = this._counter = iv.slice(0); 3876 3877 // Remove IV for subsequent blocks 3878 this._iv = undefined; 3879 } 3880 3881 incCounter(counter); 3882 3883 var keystream = counter.slice(0); 3884 cipher.encryptBlock(keystream, 0); 3885 3886 // Encrypt 3887 for (var i = 0; i < blockSize; i++) { 3888 words[offset + i] ^= keystream[i]; 3889 } 3890 } 3891 }); 3892 3893 CTRGladman.Decryptor = Encryptor; 3894 3895 return CTRGladman; 3896 }()); 3897 3898 3899 3900 3901 return CryptoJS.mode.CTRGladman; 3902 3903})); 3904 3905/***/ }), 3906 3907/***/ 4242: 3908/***/ (function(module, exports, __webpack_require__) { 3909 3910;(function (root, factory, undef) { 3911 if (true) { 3912 // CommonJS 3913 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 3914 } 3915 else {} 3916}(this, function (CryptoJS) { 3917 3918 /** 3919 * Counter block mode. 3920 */ 3921 CryptoJS.mode.CTR = (function () { 3922 var CTR = CryptoJS.lib.BlockCipherMode.extend(); 3923 3924 var Encryptor = CTR.Encryptor = CTR.extend({ 3925 processBlock: function (words, offset) { 3926 // Shortcuts 3927 var cipher = this._cipher 3928 var blockSize = cipher.blockSize; 3929 var iv = this._iv; 3930 var counter = this._counter; 3931 3932 // Generate keystream 3933 if (iv) { 3934 counter = this._counter = iv.slice(0); 3935 3936 // Remove IV for subsequent blocks 3937 this._iv = undefined; 3938 } 3939 var keystream = counter.slice(0); 3940 cipher.encryptBlock(keystream, 0); 3941 3942 // Increment counter 3943 counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 3944 3945 // Encrypt 3946 for (var i = 0; i < blockSize; i++) { 3947 words[offset + i] ^= keystream[i]; 3948 } 3949 } 3950 }); 3951 3952 CTR.Decryptor = Encryptor; 3953 3954 return CTR; 3955 }()); 3956 3957 3958 return CryptoJS.mode.CTR; 3959 3960})); 3961 3962/***/ }), 3963 3964/***/ 1148: 3965/***/ (function(module, exports, __webpack_require__) { 3966 3967;(function (root, factory, undef) { 3968 if (true) { 3969 // CommonJS 3970 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 3971 } 3972 else {} 3973}(this, function (CryptoJS) { 3974 3975 /** 3976 * Electronic Codebook block mode. 3977 */ 3978 CryptoJS.mode.ECB = (function () { 3979 var ECB = CryptoJS.lib.BlockCipherMode.extend(); 3980 3981 ECB.Encryptor = ECB.extend({ 3982 processBlock: function (words, offset) { 3983 this._cipher.encryptBlock(words, offset); 3984 } 3985 }); 3986 3987 ECB.Decryptor = ECB.extend({ 3988 processBlock: function (words, offset) { 3989 this._cipher.decryptBlock(words, offset); 3990 } 3991 }); 3992 3993 return ECB; 3994 }()); 3995 3996 3997 return CryptoJS.mode.ECB; 3998 3999})); 4000 4001/***/ }), 4002 4003/***/ 7660: 4004/***/ (function(module, exports, __webpack_require__) { 4005 4006;(function (root, factory, undef) { 4007 if (true) { 4008 // CommonJS 4009 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 4010 } 4011 else {} 4012}(this, function (CryptoJS) { 4013 4014 /** 4015 * Output Feedback block mode. 4016 */ 4017 CryptoJS.mode.OFB = (function () { 4018 var OFB = CryptoJS.lib.BlockCipherMode.extend(); 4019 4020 var Encryptor = OFB.Encryptor = OFB.extend({ 4021 processBlock: function (words, offset) { 4022 // Shortcuts 4023 var cipher = this._cipher 4024 var blockSize = cipher.blockSize; 4025 var iv = this._iv; 4026 var keystream = this._keystream; 4027 4028 // Generate keystream 4029 if (iv) { 4030 keystream = this._keystream = iv.slice(0); 4031 4032 // Remove IV for subsequent blocks 4033 this._iv = undefined; 4034 } 4035 cipher.encryptBlock(keystream, 0); 4036 4037 // Encrypt 4038 for (var i = 0; i < blockSize; i++) { 4039 words[offset + i] ^= keystream[i]; 4040 } 4041 } 4042 }); 4043 4044 OFB.Decryptor = Encryptor; 4045 4046 return OFB; 4047 }()); 4048 4049 4050 return CryptoJS.mode.OFB; 4051 4052})); 4053 4054/***/ }), 4055 4056/***/ 3615: 4057/***/ (function(module, exports, __webpack_require__) { 4058 4059;(function (root, factory, undef) { 4060 if (true) { 4061 // CommonJS 4062 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 4063 } 4064 else {} 4065}(this, function (CryptoJS) { 4066 4067 /** 4068 * ANSI X.923 padding strategy. 4069 */ 4070 CryptoJS.pad.AnsiX923 = { 4071 pad: function (data, blockSize) { 4072 // Shortcuts 4073 var dataSigBytes = data.sigBytes; 4074 var blockSizeBytes = blockSize * 4; 4075 4076 // Count padding bytes 4077 var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; 4078 4079 // Compute last byte position 4080 var lastBytePos = dataSigBytes + nPaddingBytes - 1; 4081 4082 // Pad 4083 data.clamp(); 4084 data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); 4085 data.sigBytes += nPaddingBytes; 4086 }, 4087 4088 unpad: function (data) { 4089 // Get number of padding bytes from last byte 4090 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; 4091 4092 // Remove padding 4093 data.sigBytes -= nPaddingBytes; 4094 } 4095 }; 4096 4097 4098 return CryptoJS.pad.Ansix923; 4099 4100})); 4101 4102/***/ }), 4103 4104/***/ 2807: 4105/***/ (function(module, exports, __webpack_require__) { 4106 4107;(function (root, factory, undef) { 4108 if (true) { 4109 // CommonJS 4110 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 4111 } 4112 else {} 4113}(this, function (CryptoJS) { 4114 4115 /** 4116 * ISO 10126 padding strategy. 4117 */ 4118 CryptoJS.pad.Iso10126 = { 4119 pad: function (data, blockSize) { 4120 // Shortcut 4121 var blockSizeBytes = blockSize * 4; 4122 4123 // Count padding bytes 4124 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; 4125 4126 // Pad 4127 data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). 4128 concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); 4129 }, 4130 4131 unpad: function (data) { 4132 // Get number of padding bytes from last byte 4133 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; 4134 4135 // Remove padding 4136 data.sigBytes -= nPaddingBytes; 4137 } 4138 }; 4139 4140 4141 return CryptoJS.pad.Iso10126; 4142 4143})); 4144 4145/***/ }), 4146 4147/***/ 1077: 4148/***/ (function(module, exports, __webpack_require__) { 4149 4150;(function (root, factory, undef) { 4151 if (true) { 4152 // CommonJS 4153 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 4154 } 4155 else {} 4156}(this, function (CryptoJS) { 4157 4158 /** 4159 * ISO/IEC 9797-1 Padding Method 2. 4160 */ 4161 CryptoJS.pad.Iso97971 = { 4162 pad: function (data, blockSize) { 4163 // Add 0x80 byte 4164 data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); 4165 4166 // Zero pad the rest 4167 CryptoJS.pad.ZeroPadding.pad(data, blockSize); 4168 }, 4169 4170 unpad: function (data) { 4171 // Remove zero padding 4172 CryptoJS.pad.ZeroPadding.unpad(data); 4173 4174 // Remove one more byte -- the 0x80 byte 4175 data.sigBytes--; 4176 } 4177 }; 4178 4179 4180 return CryptoJS.pad.Iso97971; 4181 4182})); 4183 4184/***/ }), 4185 4186/***/ 6991: 4187/***/ (function(module, exports, __webpack_require__) { 4188 4189;(function (root, factory, undef) { 4190 if (true) { 4191 // CommonJS 4192 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 4193 } 4194 else {} 4195}(this, function (CryptoJS) { 4196 4197 /** 4198 * A noop padding strategy. 4199 */ 4200 CryptoJS.pad.NoPadding = { 4201 pad: function () { 4202 }, 4203 4204 unpad: function () { 4205 } 4206 }; 4207 4208 4209 return CryptoJS.pad.NoPadding; 4210 4211})); 4212 4213/***/ }), 4214 4215/***/ 6475: 4216/***/ (function(module, exports, __webpack_require__) { 4217 4218;(function (root, factory, undef) { 4219 if (true) { 4220 // CommonJS 4221 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(5109)); 4222 } 4223 else {} 4224}(this, function (CryptoJS) { 4225 4226 /** 4227 * Zero padding strategy. 4228 */ 4229 CryptoJS.pad.ZeroPadding = { 4230 pad: function (data, blockSize) { 4231 // Shortcut 4232 var blockSizeBytes = blockSize * 4; 4233 4234 // Pad 4235 data.clamp(); 4236 data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); 4237 }, 4238 4239 unpad: function (data) { 4240 // Shortcut 4241 var dataWords = data.words; 4242 4243 // Unpad 4244 var i = data.sigBytes - 1; 4245 for (var i = data.sigBytes - 1; i >= 0; i--) { 4246 if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { 4247 data.sigBytes = i + 1; 4248 break; 4249 } 4250 } 4251 } 4252 }; 4253 4254 4255 return CryptoJS.pad.ZeroPadding; 4256 4257})); 4258 4259/***/ }), 4260 4261/***/ 2112: 4262/***/ (function(module, exports, __webpack_require__) { 4263 4264;(function (root, factory, undef) { 4265 if (true) { 4266 // CommonJS 4267 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(2153), __webpack_require__(9824)); 4268 } 4269 else {} 4270}(this, function (CryptoJS) { 4271 4272 (function () { 4273 // Shortcuts 4274 var C = CryptoJS; 4275 var C_lib = C.lib; 4276 var Base = C_lib.Base; 4277 var WordArray = C_lib.WordArray; 4278 var C_algo = C.algo; 4279 var SHA256 = C_algo.SHA256; 4280 var HMAC = C_algo.HMAC; 4281 4282 /** 4283 * Password-Based Key Derivation Function 2 algorithm. 4284 */ 4285 var PBKDF2 = C_algo.PBKDF2 = Base.extend({ 4286 /** 4287 * Configuration options. 4288 * 4289 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) 4290 * @property {Hasher} hasher The hasher to use. Default: SHA256 4291 * @property {number} iterations The number of iterations to perform. Default: 250000 4292 */ 4293 cfg: Base.extend({ 4294 keySize: 128/32, 4295 hasher: SHA256, 4296 iterations: 250000 4297 }), 4298 4299 /** 4300 * Initializes a newly created key derivation function. 4301 * 4302 * @param {Object} cfg (Optional) The configuration options to use for the derivation. 4303 * 4304 * @example 4305 * 4306 * var kdf = CryptoJS.algo.PBKDF2.create(); 4307 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); 4308 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); 4309 */ 4310 init: function (cfg) { 4311 this.cfg = this.cfg.extend(cfg); 4312 }, 4313 4314 /** 4315 * Computes the Password-Based Key Derivation Function 2. 4316 * 4317 * @param {WordArray|string} password The password. 4318 * @param {WordArray|string} salt A salt. 4319 * 4320 * @return {WordArray} The derived key. 4321 * 4322 * @example 4323 * 4324 * var key = kdf.compute(password, salt); 4325 */ 4326 compute: function (password, salt) { 4327 // Shortcut 4328 var cfg = this.cfg; 4329 4330 // Init HMAC 4331 var hmac = HMAC.create(cfg.hasher, password); 4332 4333 // Initial values 4334 var derivedKey = WordArray.create(); 4335 var blockIndex = WordArray.create([0x00000001]); 4336 4337 // Shortcuts 4338 var derivedKeyWords = derivedKey.words; 4339 var blockIndexWords = blockIndex.words; 4340 var keySize = cfg.keySize; 4341 var iterations = cfg.iterations; 4342 4343 // Generate key 4344 while (derivedKeyWords.length < keySize) { 4345 var block = hmac.update(salt).finalize(blockIndex); 4346 hmac.reset(); 4347 4348 // Shortcuts 4349 var blockWords = block.words; 4350 var blockWordsLength = blockWords.length; 4351 4352 // Iterations 4353 var intermediate = block; 4354 for (var i = 1; i < iterations; i++) { 4355 intermediate = hmac.finalize(intermediate); 4356 hmac.reset(); 4357 4358 // Shortcut 4359 var intermediateWords = intermediate.words; 4360 4361 // XOR intermediate with block 4362 for (var j = 0; j < blockWordsLength; j++) { 4363 blockWords[j] ^= intermediateWords[j]; 4364 } 4365 } 4366 4367 derivedKey.concat(block); 4368 blockIndexWords[0]++; 4369 } 4370 derivedKey.sigBytes = keySize * 4; 4371 4372 return derivedKey; 4373 } 4374 }); 4375 4376 /** 4377 * Computes the Password-Based Key Derivation Function 2. 4378 * 4379 * @param {WordArray|string} password The password. 4380 * @param {WordArray|string} salt A salt. 4381 * @param {Object} cfg (Optional) The configuration options to use for this computation. 4382 * 4383 * @return {WordArray} The derived key. 4384 * 4385 * @static 4386 * 4387 * @example 4388 * 4389 * var key = CryptoJS.PBKDF2(password, salt); 4390 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); 4391 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); 4392 */ 4393 C.PBKDF2 = function (password, salt, cfg) { 4394 return PBKDF2.create(cfg).compute(password, salt); 4395 }; 4396 }()); 4397 4398 4399 return CryptoJS.PBKDF2; 4400 4401})); 4402 4403/***/ }), 4404 4405/***/ 3974: 4406/***/ (function(module, exports, __webpack_require__) { 4407 4408;(function (root, factory, undef) { 4409 if (true) { 4410 // CommonJS 4411 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(3125), __webpack_require__(888), __webpack_require__(5109)); 4412 } 4413 else {} 4414}(this, function (CryptoJS) { 4415 4416 (function () { 4417 // Shortcuts 4418 var C = CryptoJS; 4419 var C_lib = C.lib; 4420 var StreamCipher = C_lib.StreamCipher; 4421 var C_algo = C.algo; 4422 4423 // Reusable objects 4424 var S = []; 4425 var C_ = []; 4426 var G = []; 4427 4428 /** 4429 * Rabbit stream cipher algorithm. 4430 * 4431 * This is a legacy version that neglected to convert the key to little-endian. 4432 * This error doesn't affect the cipher's security, 4433 * but it does affect its compatibility with other implementations. 4434 */ 4435 var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ 4436 _doReset: function () { 4437 // Shortcuts 4438 var K = this._key.words; 4439 var iv = this.cfg.iv;
vendor: 5,524 bytes, lines 4439-4590
4439 4440 4441 // Generate initial state values 4442 var X = this._X = [ 4443 K[0], (K[3] << 16) | (K[2] >>> 16), 4444 K[1], (K[0] << 16) | (K[3] >>> 16), 4445 K[2], (K[1] << 16) | (K[0] >>> 16), 4446 K[3], (K[2] << 16) | (K[1] >>> 16) 4447 ]; 4448 4449 // Generate initial counter values 4450 var C = this._C = [ 4451 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), 4452 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), 4453 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), 4454 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) 4455 ]; 4456 4457 // Carry bit 4458 this._b = 0; 4459 4460 // Iterate the system four times 4461 for (var i = 0; i < 4; i++) { 4462 nextState.call(this); 4463 } 4464 4465 // Modify the counters 4466 for (var i = 0; i < 8; i++) { 4467 C[i] ^= X[(i + 4) & 7]; 4468 } 4469 4470 // IV setup 4471 if (iv) { 4472 // Shortcuts 4473 var IV = iv.words; 4474 var IV_0 = IV[0]; 4475 var IV_1 = IV[1]; 4476 4477 // Generate four subvectors 4478 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); 4479 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); 4480 var i1 = (i0 >>> 16) | (i2 & 0xffff0000); 4481 var i3 = (i2 << 16) | (i0 & 0x0000ffff); 4482 4483 // Modify counter values 4484 C[0] ^= i0; 4485 C[1] ^= i1; 4486 C[2] ^= i2; 4487 C[3] ^= i3; 4488 C[4] ^= i0; 4489 C[5] ^= i1; 4490 C[6] ^= i2; 4491 C[7] ^= i3; 4492 4493 // Iterate the system four times 4494 for (var i = 0; i < 4; i++) { 4495 nextState.call(this); 4496 } 4497 } 4498 }, 4499 4500 _doProcessBlock: function (M, offset) { 4501 // Shortcut 4502 var X = this._X; 4503 4504 // Iterate the system 4505 nextState.call(this); 4506 4507 // Generate four keystream words 4508 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); 4509 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); 4510 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); 4511 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); 4512 4513 for (var i = 0; i < 4; i++) { 4514 // Swap endian 4515 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | 4516 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); 4517 4518 // Encrypt 4519 M[offset + i] ^= S[i]; 4520 } 4521 }, 4522 4523 blockSize: 128/32, 4524 4525 ivSize: 64/32 4526 }); 4527 4528 function nextState() { 4529 // Shortcuts 4530 var X = this._X; 4531 var C = this._C; 4532 4533 // Save old counter values 4534 for (var i = 0; i < 8; i++) { 4535 C_[i] = C[i]; 4536 } 4537 4538 // Calculate new counter values 4539 C[0] = (C[0] + 0x4d34d34d + this._b) | 0; 4540 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; 4541 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; 4542 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; 4543 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; 4544 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; 4545 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; 4546 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; 4547 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; 4548 4549 // Calculate the g-values 4550 for (var i = 0; i < 8; i++) { 4551 var gx = X[i] + C[i]; 4552 4553 // Construct high and low argument for squaring 4554 var ga = gx & 0xffff; 4555 var gb = gx >>> 16; 4556 4557 // Calculate high and low result of squaring 4558 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; 4559 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); 4560 4561 // High XOR low 4562 G[i] = gh ^ gl; 4563 } 4564 4565 // Calculate new state values 4566 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; 4567 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; 4568 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; 4569 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; 4570 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; 4571 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; 4572 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; 4573 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; 4574 } 4575 4576 /** 4577 * Shortcut functions to the cipher's object interface. 4578 * 4579 * @example 4580 * 4581 * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); 4582 * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); 4583 */ 4584 C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); 4585 }()); 4586 4587 4588 return CryptoJS.RabbitLegacy; 4589 4590}));
vendor: 43,569 bytes, lines 4591-6031
4591 4592/***/ }), 4593 4594/***/ 4454: 4595/***/ (function(module, exports, __webpack_require__) { 4596 4597;(function (root, factory, undef) { 4598 if (true) { 4599 // CommonJS 4600 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(3125), __webpack_require__(888), __webpack_require__(5109)); 4601 } 4602 else {} 4603}(this, function (CryptoJS) { 4604 4605 (function () { 4606 // Shortcuts 4607 var C = CryptoJS; 4608 var C_lib = C.lib; 4609 var StreamCipher = C_lib.StreamCipher; 4610 var C_algo = C.algo; 4611 4612 // Reusable objects 4613 var S = []; 4614 var C_ = []; 4615 var G = []; 4616 4617 /** 4618 * Rabbit stream cipher algorithm 4619 */ 4620 var Rabbit = C_algo.Rabbit = StreamCipher.extend({ 4621 _doReset: function () { 4622 // Shortcuts 4623 var K = this._key.words; 4624 var iv = this.cfg.iv; 4625 4626 // Swap endian 4627 for (var i = 0; i < 4; i++) { 4628 K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | 4629 (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); 4630 } 4631 4632 // Generate initial state values 4633 var X = this._X = [ 4634 K[0], (K[3] << 16) | (K[2] >>> 16), 4635 K[1], (K[0] << 16) | (K[3] >>> 16), 4636 K[2], (K[1] << 16) | (K[0] >>> 16), 4637 K[3], (K[2] << 16) | (K[1] >>> 16) 4638 ]; 4639 4640 // Generate initial counter values 4641 var C = this._C = [ 4642 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), 4643 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), 4644 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), 4645 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) 4646 ]; 4647 4648 // Carry bit 4649 this._b = 0; 4650 4651 // Iterate the system four times 4652 for (var i = 0; i < 4; i++) { 4653 nextState.call(this); 4654 } 4655 4656 // Modify the counters 4657 for (var i = 0; i < 8; i++) { 4658 C[i] ^= X[(i + 4) & 7]; 4659 } 4660 4661 // IV setup 4662 if (iv) { 4663 // Shortcuts 4664 var IV = iv.words; 4665 var IV_0 = IV[0]; 4666 var IV_1 = IV[1]; 4667 4668 // Generate four subvectors 4669 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); 4670 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); 4671 var i1 = (i0 >>> 16) | (i2 & 0xffff0000); 4672 var i3 = (i2 << 16) | (i0 & 0x0000ffff); 4673 4674 // Modify counter values 4675 C[0] ^= i0; 4676 C[1] ^= i1; 4677 C[2] ^= i2; 4678 C[3] ^= i3; 4679 C[4] ^= i0; 4680 C[5] ^= i1; 4681 C[6] ^= i2; 4682 C[7] ^= i3; 4683 4684 // Iterate the system four times 4685 for (var i = 0; i < 4; i++) { 4686 nextState.call(this); 4687 } 4688 } 4689 }, 4690 4691 _doProcessBlock: function (M, offset) { 4692 // Shortcut 4693 var X = this._X; 4694 4695 // Iterate the system 4696 nextState.call(this); 4697 4698 // Generate four keystream words 4699 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); 4700 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); 4701 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); 4702 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); 4703 4704 for (var i = 0; i < 4; i++) { 4705 // Swap endian 4706 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | 4707 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); 4708 4709 // Encrypt 4710 M[offset + i] ^= S[i]; 4711 } 4712 }, 4713 4714 blockSize: 128/32, 4715 4716 ivSize: 64/32 4717 }); 4718 4719 function nextState() { 4720 // Shortcuts 4721 var X = this._X; 4722 var C = this._C; 4723 4724 // Save old counter values 4725 for (var i = 0; i < 8; i++) { 4726 C_[i] = C[i]; 4727 } 4728 4729 // Calculate new counter values 4730 C[0] = (C[0] + 0x4d34d34d + this._b) | 0; 4731 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; 4732 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; 4733 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; 4734 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; 4735 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; 4736 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; 4737 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; 4738 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; 4739 4740 // Calculate the g-values 4741 for (var i = 0; i < 8; i++) { 4742 var gx = X[i] + C[i]; 4743 4744 // Construct high and low argument for squaring 4745 var ga = gx & 0xffff; 4746 var gb = gx >>> 16; 4747 4748 // Calculate high and low result of squaring 4749 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; 4750 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); 4751 4752 // High XOR low 4753 G[i] = gh ^ gl; 4754 } 4755 4756 // Calculate new state values 4757 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; 4758 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; 4759 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; 4760 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; 4761 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; 4762 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; 4763 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; 4764 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; 4765 } 4766 4767 /** 4768 * Shortcut functions to the cipher's object interface. 4769 * 4770 * @example 4771 * 4772 * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); 4773 * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); 4774 */ 4775 C.Rabbit = StreamCipher._createHelper(Rabbit); 4776 }()); 4777 4778 4779 return CryptoJS.Rabbit; 4780 4781})); 4782 4783/***/ }), 4784 4785/***/ 1857: 4786/***/ (function(module, exports, __webpack_require__) { 4787 4788;(function (root, factory, undef) { 4789 if (true) { 4790 // CommonJS 4791 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(3125), __webpack_require__(888), __webpack_require__(5109)); 4792 } 4793 else {} 4794}(this, function (CryptoJS) { 4795 4796 (function () { 4797 // Shortcuts 4798 var C = CryptoJS; 4799 var C_lib = C.lib; 4800 var StreamCipher = C_lib.StreamCipher; 4801 var C_algo = C.algo; 4802 4803 /** 4804 * RC4 stream cipher algorithm. 4805 */ 4806 var RC4 = C_algo.RC4 = StreamCipher.extend({ 4807 _doReset: function () { 4808 // Shortcuts 4809 var key = this._key; 4810 var keyWords = key.words; 4811 var keySigBytes = key.sigBytes; 4812 4813 // Init sbox 4814 var S = this._S = []; 4815 for (var i = 0; i < 256; i++) { 4816 S[i] = i; 4817 } 4818 4819 // Key setup 4820 for (var i = 0, j = 0; i < 256; i++) { 4821 var keyByteIndex = i % keySigBytes; 4822 var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; 4823 4824 j = (j + S[i] + keyByte) % 256; 4825 4826 // Swap 4827 var t = S[i]; 4828 S[i] = S[j]; 4829 S[j] = t; 4830 } 4831 4832 // Counters 4833 this._i = this._j = 0; 4834 }, 4835 4836 _doProcessBlock: function (M, offset) { 4837 M[offset] ^= generateKeystreamWord.call(this); 4838 }, 4839 4840 keySize: 256/32, 4841 4842 ivSize: 0 4843 }); 4844 4845 function generateKeystreamWord() { 4846 // Shortcuts 4847 var S = this._S; 4848 var i = this._i; 4849 var j = this._j; 4850 4851 // Generate keystream word 4852 var keystreamWord = 0; 4853 for (var n = 0; n < 4; n++) { 4854 i = (i + 1) % 256; 4855 j = (j + S[i]) % 256; 4856 4857 // Swap 4858 var t = S[i]; 4859 S[i] = S[j]; 4860 S[j] = t; 4861 4862 keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); 4863 } 4864 4865 // Update counters 4866 this._i = i; 4867 this._j = j; 4868 4869 return keystreamWord; 4870 } 4871 4872 /** 4873 * Shortcut functions to the cipher's object interface. 4874 * 4875 * @example 4876 * 4877 * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); 4878 * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); 4879 */ 4880 C.RC4 = StreamCipher._createHelper(RC4); 4881 4882 /** 4883 * Modified RC4 stream cipher algorithm. 4884 */ 4885 var RC4Drop = C_algo.RC4Drop = RC4.extend({ 4886 /** 4887 * Configuration options. 4888 * 4889 * @property {number} drop The number of keystream words to drop. Default 192 4890 */ 4891 cfg: RC4.cfg.extend({ 4892 drop: 192 4893 }), 4894 4895 _doReset: function () { 4896 RC4._doReset.call(this); 4897 4898 // Drop 4899 for (var i = this.cfg.drop; i > 0; i--) { 4900 generateKeystreamWord.call(this); 4901 } 4902 } 4903 }); 4904 4905 /** 4906 * Shortcut functions to the cipher's object interface. 4907 * 4908 * @example 4909 * 4910 * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); 4911 * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); 4912 */ 4913 C.RC4Drop = StreamCipher._createHelper(RC4Drop); 4914 }()); 4915 4916 4917 return CryptoJS.RC4; 4918 4919})); 4920 4921/***/ }), 4922 4923/***/ 706: 4924/***/ (function(module, exports, __webpack_require__) { 4925 4926;(function (root, factory) { 4927 if (true) { 4928 // CommonJS 4929 module.exports = exports = factory(__webpack_require__(8249)); 4930 } 4931 else {} 4932}(this, function (CryptoJS) { 4933 4934 /** @preserve 4935 (c) 2012 by Cédric Mesnil. All rights reserved. 4936 4937 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4938 4939 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 4940 - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 4941 4942 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 4943 */ 4944 4945 (function (Math) { 4946 // Shortcuts 4947 var C = CryptoJS; 4948 var C_lib = C.lib; 4949 var WordArray = C_lib.WordArray; 4950 var Hasher = C_lib.Hasher; 4951 var C_algo = C.algo; 4952 4953 // Constants table 4954 var _zl = WordArray.create([ 4955 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 4956 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 4957 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 4958 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4959 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); 4960 var _zr = WordArray.create([ 4961 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 4962 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 4963 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 4964 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 4965 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); 4966 var _sl = WordArray.create([ 4967 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 4968 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 4969 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 4970 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 4971 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); 4972 var _sr = WordArray.create([ 4973 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 4974 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 4975 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 4976 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 4977 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); 4978 4979 var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); 4980 var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); 4981 4982 /** 4983 * RIPEMD160 hash algorithm. 4984 */ 4985 var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ 4986 _doReset: function () { 4987 this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); 4988 }, 4989 4990 _doProcessBlock: function (M, offset) { 4991 4992 // Swap endian 4993 for (var i = 0; i < 16; i++) { 4994 // Shortcuts 4995 var offset_i = offset + i; 4996 var M_offset_i = M[offset_i]; 4997 4998 // Swap 4999 M[offset_i] = ( 5000 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | 5001 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) 5002 ); 5003 } 5004 // Shortcut 5005 var H = this._hash.words; 5006 var hl = _hl.words; 5007 var hr = _hr.words; 5008 var zl = _zl.words; 5009 var zr = _zr.words; 5010 var sl = _sl.words; 5011 var sr = _sr.words; 5012 5013 // Working variables 5014 var al, bl, cl, dl, el; 5015 var ar, br, cr, dr, er; 5016 5017 ar = al = H[0]; 5018 br = bl = H[1]; 5019 cr = cl = H[2]; 5020 dr = dl = H[3]; 5021 er = el = H[4]; 5022 // Computation 5023 var t; 5024 for (var i = 0; i < 80; i += 1) { 5025 t = (al + M[offset+zl[i]])|0; 5026 if (i<16){ 5027 t += f1(bl,cl,dl) + hl[0]; 5028 } else if (i<32) { 5029 t += f2(bl,cl,dl) + hl[1]; 5030 } else if (i<48) { 5031 t += f3(bl,cl,dl) + hl[2]; 5032 } else if (i<64) { 5033 t += f4(bl,cl,dl) + hl[3]; 5034 } else {// if (i<80) { 5035 t += f5(bl,cl,dl) + hl[4]; 5036 } 5037 t = t|0; 5038 t = rotl(t,sl[i]); 5039 t = (t+el)|0; 5040 al = el; 5041 el = dl; 5042 dl = rotl(cl, 10); 5043 cl = bl; 5044 bl = t; 5045 5046 t = (ar + M[offset+zr[i]])|0; 5047 if (i<16){ 5048 t += f5(br,cr,dr) + hr[0]; 5049 } else if (i<32) { 5050 t += f4(br,cr,dr) + hr[1]; 5051 } else if (i<48) { 5052 t += f3(br,cr,dr) + hr[2]; 5053 } else if (i<64) { 5054 t += f2(br,cr,dr) + hr[3]; 5055 } else {// if (i<80) { 5056 t += f1(br,cr,dr) + hr[4]; 5057 } 5058 t = t|0; 5059 t = rotl(t,sr[i]) ; 5060 t = (t+er)|0; 5061 ar = er; 5062 er = dr; 5063 dr = rotl(cr, 10); 5064 cr = br; 5065 br = t; 5066 } 5067 // Intermediate hash value 5068 t = (H[1] + cl + dr)|0; 5069 H[1] = (H[2] + dl + er)|0; 5070 H[2] = (H[3] + el + ar)|0; 5071 H[3] = (H[4] + al + br)|0; 5072 H[4] = (H[0] + bl + cr)|0; 5073 H[0] = t; 5074 }, 5075 5076 _doFinalize: function () { 5077 // Shortcuts 5078 var data = this._data; 5079 var dataWords = data.words; 5080 5081 var nBitsTotal = this._nDataBytes * 8; 5082 var nBitsLeft = data.sigBytes * 8; 5083 5084 // Add padding 5085 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 5086 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( 5087 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | 5088 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) 5089 ); 5090 data.sigBytes = (dataWords.length + 1) * 4; 5091 5092 // Hash final blocks 5093 this._process(); 5094 5095 // Shortcuts 5096 var hash = this._hash; 5097 var H = hash.words; 5098 5099 // Swap endian 5100 for (var i = 0; i < 5; i++) { 5101 // Shortcut 5102 var H_i = H[i]; 5103 5104 // Swap 5105 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | 5106 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); 5107 } 5108 5109 // Return final computed hash 5110 return hash; 5111 }, 5112 5113 clone: function () { 5114 var clone = Hasher.clone.call(this); 5115 clone._hash = this._hash.clone(); 5116 5117 return clone; 5118 } 5119 }); 5120 5121 5122 function f1(x, y, z) { 5123 return ((x) ^ (y) ^ (z)); 5124 5125 } 5126 5127 function f2(x, y, z) { 5128 return (((x)&(y)) | ((~x)&(z))); 5129 } 5130 5131 function f3(x, y, z) { 5132 return (((x) | (~(y))) ^ (z)); 5133 } 5134 5135 function f4(x, y, z) { 5136 return (((x) & (z)) | ((y)&(~(z)))); 5137 } 5138 5139 function f5(x, y, z) { 5140 return ((x) ^ ((y) |(~(z)))); 5141 5142 } 5143 5144 function rotl(x,n) { 5145 return (x<<n) | (x>>>(32-n)); 5146 } 5147 5148 5149 /** 5150 * Shortcut function to the hasher's object interface. 5151 * 5152 * @param {WordArray|string} message The message to hash. 5153 * 5154 * @return {WordArray} The hash. 5155 * 5156 * @static 5157 * 5158 * @example 5159 * 5160 * var hash = CryptoJS.RIPEMD160('message'); 5161 * var hash = CryptoJS.RIPEMD160(wordArray); 5162 */ 5163 C.RIPEMD160 = Hasher._createHelper(RIPEMD160); 5164 5165 /** 5166 * Shortcut function to the HMAC's object interface. 5167 * 5168 * @param {WordArray|string} message The message to hash. 5169 * @param {WordArray|string} key The secret key. 5170 * 5171 * @return {WordArray} The HMAC. 5172 * 5173 * @static 5174 * 5175 * @example 5176 * 5177 * var hmac = CryptoJS.HmacRIPEMD160(message, key); 5178 */ 5179 C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); 5180 }(Math)); 5181 5182 5183 return CryptoJS.RIPEMD160; 5184 5185})); 5186 5187/***/ }), 5188 5189/***/ 2783: 5190/***/ (function(module, exports, __webpack_require__) { 5191 5192;(function (root, factory) { 5193 if (true) { 5194 // CommonJS 5195 module.exports = exports = factory(__webpack_require__(8249)); 5196 } 5197 else {} 5198}(this, function (CryptoJS) { 5199 5200 (function () { 5201 // Shortcuts 5202 var C = CryptoJS; 5203 var C_lib = C.lib; 5204 var WordArray = C_lib.WordArray; 5205 var Hasher = C_lib.Hasher; 5206 var C_algo = C.algo; 5207 5208 // Reusable object 5209 var W = []; 5210 5211 /** 5212 * SHA-1 hash algorithm. 5213 */ 5214 var SHA1 = C_algo.SHA1 = Hasher.extend({ 5215 _doReset: function () { 5216 this._hash = new WordArray.init([ 5217 0x67452301, 0xefcdab89, 5218 0x98badcfe, 0x10325476, 5219 0xc3d2e1f0 5220 ]); 5221 }, 5222 5223 _doProcessBlock: function (M, offset) { 5224 // Shortcut 5225 var H = this._hash.words; 5226 5227 // Working variables 5228 var a = H[0]; 5229 var b = H[1]; 5230 var c = H[2]; 5231 var d = H[3]; 5232 var e = H[4]; 5233 5234 // Computation 5235 for (var i = 0; i < 80; i++) { 5236 if (i < 16) { 5237 W[i] = M[offset + i] | 0; 5238 } else { 5239 var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; 5240 W[i] = (n << 1) | (n >>> 31); 5241 } 5242 5243 var t = ((a << 5) | (a >>> 27)) + e + W[i]; 5244 if (i < 20) { 5245 t += ((b & c) | (~b & d)) + 0x5a827999; 5246 } else if (i < 40) { 5247 t += (b ^ c ^ d) + 0x6ed9eba1; 5248 } else if (i < 60) { 5249 t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; 5250 } else /* if (i < 80) */ { 5251 t += (b ^ c ^ d) - 0x359d3e2a; 5252 } 5253 5254 e = d; 5255 d = c; 5256 c = (b << 30) | (b >>> 2); 5257 b = a; 5258 a = t; 5259 } 5260 5261 // Intermediate hash value 5262 H[0] = (H[0] + a) | 0; 5263 H[1] = (H[1] + b) | 0; 5264 H[2] = (H[2] + c) | 0; 5265 H[3] = (H[3] + d) | 0; 5266 H[4] = (H[4] + e) | 0; 5267 }, 5268 5269 _doFinalize: function () { 5270 // Shortcuts 5271 var data = this._data; 5272 var dataWords = data.words; 5273 5274 var nBitsTotal = this._nDataBytes * 8; 5275 var nBitsLeft = data.sigBytes * 8; 5276 5277 // Add padding 5278 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 5279 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); 5280 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; 5281 data.sigBytes = dataWords.length * 4; 5282 5283 // Hash final blocks 5284 this._process(); 5285 5286 // Return final computed hash 5287 return this._hash; 5288 }, 5289 5290 clone: function () { 5291 var clone = Hasher.clone.call(this); 5292 clone._hash = this._hash.clone(); 5293 5294 return clone; 5295 } 5296 }); 5297 5298 /** 5299 * Shortcut function to the hasher's object interface. 5300 * 5301 * @param {WordArray|string} message The message to hash. 5302 * 5303 * @return {WordArray} The hash. 5304 * 5305 * @static 5306 * 5307 * @example 5308 * 5309 * var hash = CryptoJS.SHA1('message'); 5310 * var hash = CryptoJS.SHA1(wordArray); 5311 */ 5312 C.SHA1 = Hasher._createHelper(SHA1); 5313 5314 /** 5315 * Shortcut function to the HMAC's object interface. 5316 * 5317 * @param {WordArray|string} message The message to hash. 5318 * @param {WordArray|string} key The secret key. 5319 * 5320 * @return {WordArray} The HMAC. 5321 * 5322 * @static 5323 * 5324 * @example 5325 * 5326 * var hmac = CryptoJS.HmacSHA1(message, key); 5327 */ 5328 C.HmacSHA1 = Hasher._createHmacHelper(SHA1); 5329 }()); 5330 5331 5332 return CryptoJS.SHA1; 5333 5334})); 5335 5336/***/ }), 5337 5338/***/ 7792: 5339/***/ (function(module, exports, __webpack_require__) { 5340 5341;(function (root, factory, undef) { 5342 if (true) { 5343 // CommonJS 5344 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(2153)); 5345 } 5346 else {} 5347}(this, function (CryptoJS) { 5348 5349 (function () { 5350 // Shortcuts 5351 var C = CryptoJS; 5352 var C_lib = C.lib; 5353 var WordArray = C_lib.WordArray; 5354 var C_algo = C.algo; 5355 var SHA256 = C_algo.SHA256; 5356 5357 /** 5358 * SHA-224 hash algorithm. 5359 */ 5360 var SHA224 = C_algo.SHA224 = SHA256.extend({ 5361 _doReset: function () { 5362 this._hash = new WordArray.init([ 5363 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 5364 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 5365 ]); 5366 }, 5367 5368 _doFinalize: function () { 5369 var hash = SHA256._doFinalize.call(this); 5370 5371 hash.sigBytes -= 4; 5372 5373 return hash; 5374 } 5375 }); 5376 5377 /** 5378 * Shortcut function to the hasher's object interface. 5379 * 5380 * @param {WordArray|string} message The message to hash. 5381 * 5382 * @return {WordArray} The hash. 5383 * 5384 * @static 5385 * 5386 * @example 5387 * 5388 * var hash = CryptoJS.SHA224('message'); 5389 * var hash = CryptoJS.SHA224(wordArray); 5390 */ 5391 C.SHA224 = SHA256._createHelper(SHA224); 5392 5393 /** 5394 * Shortcut function to the HMAC's object interface. 5395 * 5396 * @param {WordArray|string} message The message to hash. 5397 * @param {WordArray|string} key The secret key. 5398 * 5399 * @return {WordArray} The HMAC. 5400 * 5401 * @static 5402 * 5403 * @example 5404 * 5405 * var hmac = CryptoJS.HmacSHA224(message, key); 5406 */ 5407 C.HmacSHA224 = SHA256._createHmacHelper(SHA224); 5408 }()); 5409 5410 5411 return CryptoJS.SHA224; 5412 5413})); 5414 5415/***/ }), 5416 5417/***/ 2153: 5418/***/ (function(module, exports, __webpack_require__) { 5419 5420;(function (root, factory) { 5421 if (true) { 5422 // CommonJS 5423 module.exports = exports = factory(__webpack_require__(8249)); 5424 } 5425 else {} 5426}(this, function (CryptoJS) { 5427 5428 (function (Math) { 5429 // Shortcuts 5430 var C = CryptoJS; 5431 var C_lib = C.lib; 5432 var WordArray = C_lib.WordArray; 5433 var Hasher = C_lib.Hasher; 5434 var C_algo = C.algo; 5435 5436 // Initialization and round constants tables 5437 var H = []; 5438 var K = []; 5439 5440 // Compute constants 5441 (function () { 5442 function isPrime(n) { 5443 var sqrtN = Math.sqrt(n); 5444 for (var factor = 2; factor <= sqrtN; factor++) { 5445 if (!(n % factor)) { 5446 return false; 5447 } 5448 } 5449 5450 return true; 5451 } 5452 5453 function getFractionalBits(n) { 5454 return ((n - (n | 0)) * 0x100000000) | 0; 5455 } 5456 5457 var n = 2; 5458 var nPrime = 0; 5459 while (nPrime < 64) { 5460 if (isPrime(n)) { 5461 if (nPrime < 8) { 5462 H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); 5463 } 5464 K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); 5465 5466 nPrime++; 5467 } 5468 5469 n++; 5470 } 5471 }()); 5472 5473 // Reusable object 5474 var W = []; 5475 5476 /** 5477 * SHA-256 hash algorithm. 5478 */ 5479 var SHA256 = C_algo.SHA256 = Hasher.extend({ 5480 _doReset: function () { 5481 this._hash = new WordArray.init(H.slice(0)); 5482 }, 5483 5484 _doProcessBlock: function (M, offset) { 5485 // Shortcut 5486 var H = this._hash.words; 5487 5488 // Working variables 5489 var a = H[0]; 5490 var b = H[1]; 5491 var c = H[2]; 5492 var d = H[3]; 5493 var e = H[4]; 5494 var f = H[5]; 5495 var g = H[6]; 5496 var h = H[7]; 5497 5498 // Computation 5499 for (var i = 0; i < 64; i++) { 5500 if (i < 16) { 5501 W[i] = M[offset + i] | 0; 5502 } else { 5503 var gamma0x = W[i - 15]; 5504 var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ 5505 ((gamma0x << 14) | (gamma0x >>> 18)) ^ 5506 (gamma0x >>> 3); 5507 5508 var gamma1x = W[i - 2]; 5509 var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ 5510 ((gamma1x << 13) | (gamma1x >>> 19)) ^ 5511 (gamma1x >>> 10); 5512 5513 W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; 5514 } 5515 5516 var ch = (e & f) ^ (~e & g); 5517 var maj = (a & b) ^ (a & c) ^ (b & c); 5518 5519 var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); 5520 var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); 5521 5522 var t1 = h + sigma1 + ch + K[i] + W[i]; 5523 var t2 = sigma0 + maj; 5524 5525 h = g; 5526 g = f; 5527 f = e; 5528 e = (d + t1) | 0; 5529 d = c; 5530 c = b; 5531 b = a; 5532 a = (t1 + t2) | 0; 5533 } 5534 5535 // Intermediate hash value 5536 H[0] = (H[0] + a) | 0; 5537 H[1] = (H[1] + b) | 0; 5538 H[2] = (H[2] + c) | 0; 5539 H[3] = (H[3] + d) | 0; 5540 H[4] = (H[4] + e) | 0; 5541 H[5] = (H[5] + f) | 0; 5542 H[6] = (H[6] + g) | 0; 5543 H[7] = (H[7] + h) | 0; 5544 }, 5545 5546 _doFinalize: function () { 5547 // Shortcuts 5548 var data = this._data; 5549 var dataWords = data.words; 5550 5551 var nBitsTotal = this._nDataBytes * 8; 5552 var nBitsLeft = data.sigBytes * 8; 5553 5554 // Add padding 5555 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 5556 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); 5557 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; 5558 data.sigBytes = dataWords.length * 4; 5559 5560 // Hash final blocks 5561 this._process(); 5562 5563 // Return final computed hash 5564 return this._hash; 5565 }, 5566 5567 clone: function () { 5568 var clone = Hasher.clone.call(this); 5569 clone._hash = this._hash.clone(); 5570 5571 return clone; 5572 } 5573 }); 5574 5575 /** 5576 * Shortcut function to the hasher's object interface. 5577 * 5578 * @param {WordArray|string} message The message to hash. 5579 * 5580 * @return {WordArray} The hash. 5581 * 5582 * @static 5583 * 5584 * @example 5585 * 5586 * var hash = CryptoJS.SHA256('message'); 5587 * var hash = CryptoJS.SHA256(wordArray); 5588 */ 5589 C.SHA256 = Hasher._createHelper(SHA256); 5590 5591 /** 5592 * Shortcut function to the HMAC's object interface. 5593 * 5594 * @param {WordArray|string} message The message to hash. 5595 * @param {WordArray|string} key The secret key. 5596 * 5597 * @return {WordArray} The HMAC. 5598 * 5599 * @static 5600 * 5601 * @example 5602 * 5603 * var hmac = CryptoJS.HmacSHA256(message, key); 5604 */ 5605 C.HmacSHA256 = Hasher._createHmacHelper(SHA256); 5606 }(Math)); 5607 5608 5609 return CryptoJS.SHA256; 5610 5611})); 5612 5613/***/ }), 5614 5615/***/ 3327: 5616/***/ (function(module, exports, __webpack_require__) { 5617 5618;(function (root, factory, undef) { 5619 if (true) { 5620 // CommonJS 5621 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(4938)); 5622 } 5623 else {} 5624}(this, function (CryptoJS) { 5625 5626 (function (Math) { 5627 // Shortcuts 5628 var C = CryptoJS; 5629 var C_lib = C.lib; 5630 var WordArray = C_lib.WordArray; 5631 var Hasher = C_lib.Hasher; 5632 var C_x64 = C.x64; 5633 var X64Word = C_x64.Word; 5634 var C_algo = C.algo; 5635 5636 // Constants tables 5637 var RHO_OFFSETS = []; 5638 var PI_INDEXES = []; 5639 var ROUND_CONSTANTS = []; 5640 5641 // Compute Constants 5642 (function () { 5643 // Compute rho offset constants 5644 var x = 1, y = 0; 5645 for (var t = 0; t < 24; t++) { 5646 RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; 5647 5648 var newX = y % 5; 5649 var newY = (2 * x + 3 * y) % 5; 5650 x = newX; 5651 y = newY; 5652 } 5653 5654 // Compute pi index constants 5655 for (var x = 0; x < 5; x++) { 5656 for (var y = 0; y < 5; y++) { 5657 PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; 5658 } 5659 } 5660 5661 // Compute round constants 5662 var LFSR = 0x01; 5663 for (var i = 0; i < 24; i++) { 5664 var roundConstantMsw = 0; 5665 var roundConstantLsw = 0; 5666 5667 for (var j = 0; j < 7; j++) { 5668 if (LFSR & 0x01) { 5669 var bitPosition = (1 << j) - 1; 5670 if (bitPosition < 32) { 5671 roundConstantLsw ^= 1 << bitPosition; 5672 } else /* if (bitPosition >= 32) */ { 5673 roundConstantMsw ^= 1 << (bitPosition - 32); 5674 } 5675 } 5676 5677 // Compute next LFSR 5678 if (LFSR & 0x80) { 5679 // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 5680 LFSR = (LFSR << 1) ^ 0x71; 5681 } else { 5682 LFSR <<= 1; 5683 } 5684 } 5685 5686 ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); 5687 } 5688 }()); 5689 5690 // Reusable objects for temporary values 5691 var T = []; 5692 (function () { 5693 for (var i = 0; i < 25; i++) { 5694 T[i] = X64Word.create(); 5695 } 5696 }()); 5697 5698 /** 5699 * SHA-3 hash algorithm. 5700 */ 5701 var SHA3 = C_algo.SHA3 = Hasher.extend({ 5702 /** 5703 * Configuration options. 5704 * 5705 * @property {number} outputLength 5706 * The desired number of bits in the output hash. 5707 * Only values permitted are: 224, 256, 384, 512. 5708 * Default: 512 5709 */ 5710 cfg: Hasher.cfg.extend({ 5711 outputLength: 512 5712 }), 5713 5714 _doReset: function () { 5715 var state = this._state = [] 5716 for (var i = 0; i < 25; i++) { 5717 state[i] = new X64Word.init(); 5718 } 5719 5720 this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; 5721 }, 5722 5723 _doProcessBlock: function (M, offset) { 5724 // Shortcuts 5725 var state = this._state; 5726 var nBlockSizeLanes = this.blockSize / 2; 5727 5728 // Absorb 5729 for (var i = 0; i < nBlockSizeLanes; i++) { 5730 // Shortcuts 5731 var M2i = M[offset + 2 * i]; 5732 var M2i1 = M[offset + 2 * i + 1]; 5733 5734 // Swap endian 5735 M2i = ( 5736 (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | 5737 (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) 5738 ); 5739 M2i1 = ( 5740 (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | 5741 (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) 5742 ); 5743 5744 // Absorb message into state 5745 var lane = state[i]; 5746 lane.high ^= M2i1; 5747 lane.low ^= M2i; 5748 } 5749 5750 // Rounds 5751 for (var round = 0; round < 24; round++) { 5752 // Theta 5753 for (var x = 0; x < 5; x++) { 5754 // Mix column lanes 5755 var tMsw = 0, tLsw = 0; 5756 for (var y = 0; y < 5; y++) { 5757 var lane = state[x + 5 * y]; 5758 tMsw ^= lane.high; 5759 tLsw ^= lane.low; 5760 } 5761 5762 // Temporary values 5763 var Tx = T[x]; 5764 Tx.high = tMsw; 5765 Tx.low = tLsw; 5766 } 5767 for (var x = 0; x < 5; x++) { 5768 // Shortcuts 5769 var Tx4 = T[(x + 4) % 5]; 5770 var Tx1 = T[(x + 1) % 5]; 5771 var Tx1Msw = Tx1.high; 5772 var Tx1Lsw = Tx1.low; 5773 5774 // Mix surrounding columns 5775 var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); 5776 var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); 5777 for (var y = 0; y < 5; y++) { 5778 var lane = state[x + 5 * y]; 5779 lane.high ^= tMsw; 5780 lane.low ^= tLsw; 5781 } 5782 } 5783 5784 // Rho Pi 5785 for (var laneIndex = 1; laneIndex < 25; laneIndex++) { 5786 var tMsw; 5787 var tLsw; 5788 5789 // Shortcuts 5790 var lane = state[laneIndex]; 5791 var laneMsw = lane.high; 5792 var laneLsw = lane.low; 5793 var rhoOffset = RHO_OFFSETS[laneIndex]; 5794 5795 // Rotate lanes 5796 if (rhoOffset < 32) { 5797 tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); 5798 tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); 5799 } else /* if (rhoOffset >= 32) */ { 5800 tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); 5801 tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); 5802 } 5803 5804 // Transpose lanes 5805 var TPiLane = T[PI_INDEXES[laneIndex]]; 5806 TPiLane.high = tMsw; 5807 TPiLane.low = tLsw; 5808 } 5809 5810 // Rho pi at x = y = 0 5811 var T0 = T[0]; 5812 var state0 = state[0]; 5813 T0.high = state0.high; 5814 T0.low = state0.low; 5815 5816 // Chi 5817 for (var x = 0; x < 5; x++) { 5818 for (var y = 0; y < 5; y++) { 5819 // Shortcuts 5820 var laneIndex = x + 5 * y; 5821 var lane = state[laneIndex]; 5822 var TLane = T[laneIndex]; 5823 var Tx1Lane = T[((x + 1) % 5) + 5 * y]; 5824 var Tx2Lane = T[((x + 2) % 5) + 5 * y]; 5825 5826 // Mix rows 5827 lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); 5828 lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); 5829 } 5830 } 5831 5832 // Iota 5833 var lane = state[0]; 5834 var roundConstant = ROUND_CONSTANTS[round]; 5835 lane.high ^= roundConstant.high; 5836 lane.low ^= roundConstant.low; 5837 } 5838 }, 5839 5840 _doFinalize: function () { 5841 // Shortcuts 5842 var data = this._data; 5843 var dataWords = data.words; 5844 var nBitsTotal = this._nDataBytes * 8; 5845 var nBitsLeft = data.sigBytes * 8; 5846 var blockSizeBits = this.blockSize * 32; 5847 5848 // Add padding 5849 dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); 5850 dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; 5851 data.sigBytes = dataWords.length * 4; 5852 5853 // Hash final blocks 5854 this._process(); 5855 5856 // Shortcuts 5857 var state = this._state; 5858 var outputLengthBytes = this.cfg.outputLength / 8; 5859 var outputLengthLanes = outputLengthBytes / 8; 5860 5861 // Squeeze 5862 var hashWords = []; 5863 for (var i = 0; i < outputLengthLanes; i++) { 5864 // Shortcuts 5865 var lane = state[i]; 5866 var laneMsw = lane.high; 5867 var laneLsw = lane.low; 5868 5869 // Swap endian 5870 laneMsw = ( 5871 (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | 5872 (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) 5873 ); 5874 laneLsw = ( 5875 (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | 5876 (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) 5877 ); 5878 5879 // Squeeze state to retrieve hash 5880 hashWords.push(laneLsw); 5881 hashWords.push(laneMsw); 5882 } 5883 5884 // Return final computed hash 5885 return new WordArray.init(hashWords, outputLengthBytes); 5886 }, 5887 5888 clone: function () { 5889 var clone = Hasher.clone.call(this); 5890 5891 var state = clone._state = this._state.slice(0); 5892 for (var i = 0; i < 25; i++) { 5893 state[i] = state[i].clone(); 5894 } 5895 5896 return clone; 5897 } 5898 }); 5899 5900 /** 5901 * Shortcut function to the hasher's object interface. 5902 * 5903 * @param {WordArray|string} message The message to hash. 5904 * 5905 * @return {WordArray} The hash. 5906 * 5907 * @static 5908 * 5909 * @example 5910 * 5911 * var hash = CryptoJS.SHA3('message'); 5912 * var hash = CryptoJS.SHA3(wordArray); 5913 */ 5914 C.SHA3 = Hasher._createHelper(SHA3); 5915 5916 /** 5917 * Shortcut function to the HMAC's object interface. 5918 * 5919 * @param {WordArray|string} message The message to hash. 5920 * @param {WordArray|string} key The secret key. 5921 * 5922 * @return {WordArray} The HMAC. 5923 * 5924 * @static 5925 * 5926 * @example 5927 * 5928 * var hmac = CryptoJS.HmacSHA3(message, key); 5929 */ 5930 C.HmacSHA3 = Hasher._createHmacHelper(SHA3); 5931 }(Math)); 5932 5933 5934 return CryptoJS.SHA3; 5935 5936})); 5937 5938/***/ }), 5939 5940/***/ 7460: 5941/***/ (function(module, exports, __webpack_require__) { 5942 5943;(function (root, factory, undef) { 5944 if (true) { 5945 // CommonJS 5946 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(4938), __webpack_require__(34)); 5947 } 5948 else {} 5949}(this, function (CryptoJS) { 5950 5951 (function () { 5952 // Shortcuts 5953 var C = CryptoJS; 5954 var C_x64 = C.x64; 5955 var X64Word = C_x64.Word; 5956 var X64WordArray = C_x64.WordArray; 5957 var C_algo = C.algo; 5958 var SHA512 = C_algo.SHA512; 5959 5960 /** 5961 * SHA-384 hash algorithm. 5962 */ 5963 var SHA384 = C_algo.SHA384 = SHA512.extend({ 5964 _doReset: function () { 5965 this._hash = new X64WordArray.init([ 5966 new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), 5967 new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), 5968 new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), 5969 new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) 5970 ]); 5971 }, 5972 5973 _doFinalize: function () { 5974 var hash = SHA512._doFinalize.call(this); 5975 5976 hash.sigBytes -= 16; 5977 5978 return hash; 5979 } 5980 }); 5981 5982 /** 5983 * Shortcut function to the hasher's object interface. 5984 * 5985 * @param {WordArray|string} message The message to hash. 5986 * 5987 * @return {WordArray} The hash. 5988 * 5989 * @static 5990 * 5991 * @example 5992 * 5993 * var hash = CryptoJS.SHA384('message'); 5994 * var hash = CryptoJS.SHA384(wordArray); 5995 */ 5996 C.SHA384 = SHA512._createHelper(SHA384); 5997 5998 /** 5999 * Shortcut function to the HMAC's object interface. 6000 * 6001 * @param {WordArray|string} message The message to hash. 6002 * @param {WordArray|string} key The secret key. 6003 * 6004 * @return {WordArray} The HMAC. 6005 * 6006 * @static 6007 * 6008 * @example 6009 * 6010 * var hmac = CryptoJS.HmacSHA384(message, key); 6011 */ 6012 C.HmacSHA384 = SHA512._createHmacHelper(SHA384); 6013 }()); 6014 6015 6016 return CryptoJS.SHA384; 6017 6018})); 6019 6020/***/ }), 6021 6022/***/ 34: 6023/***/ (function(module, exports, __webpack_require__) { 6024 6025;(function (root, factory, undef) { 6026 if (true) { 6027 // CommonJS 6028 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(4938)); 6029 } 6030 else {} 6031}(this, function (CryptoJS) {
vendor: 13,070 bytes, lines 6031-6341
6031 6032 6033 (function () { 6034 // Shortcuts 6035 var C = CryptoJS; 6036 var C_lib = C.lib; 6037 var Hasher = C_lib.Hasher; 6038 var C_x64 = C.x64; 6039 var X64Word = C_x64.Word; 6040 var X64WordArray = C_x64.WordArray; 6041 var C_algo = C.algo; 6042 6043 function X64Word_create() { 6044 return X64Word.create.apply(X64Word, arguments); 6045 } 6046 6047 // Constants 6048 var K = [ 6049 X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), 6050 X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), 6051 X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), 6052 X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), 6053 X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), 6054 X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), 6055 X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), 6056 X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), 6057 X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), 6058 X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), 6059 X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), 6060 X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), 6061 X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), 6062 X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), 6063 X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), 6064 X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), 6065 X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), 6066 X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), 6067 X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), 6068 X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), 6069 X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), 6070 X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), 6071 X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), 6072 X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), 6073 X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), 6074 X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), 6075 X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), 6076 X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), 6077 X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), 6078 X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), 6079 X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), 6080 X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), 6081 X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), 6082 X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), 6083 X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), 6084 X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), 6085 X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), 6086 X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), 6087 X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), 6088 X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) 6089 ]; 6090 6091 // Reusable objects 6092 var W = []; 6093 (function () { 6094 for (var i = 0; i < 80; i++) { 6095 W[i] = X64Word_create(); 6096 } 6097 }()); 6098 6099 /** 6100 * SHA-512 hash algorithm. 6101 */ 6102 var SHA512 = C_algo.SHA512 = Hasher.extend({ 6103 _doReset: function () { 6104 this._hash = new X64WordArray.init([ 6105 new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), 6106 new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), 6107 new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), 6108 new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) 6109 ]); 6110 }, 6111 6112 _doProcessBlock: function (M, offset) { 6113 // Shortcuts 6114 var H = this._hash.words; 6115 6116 var H0 = H[0]; 6117 var H1 = H[1]; 6118 var H2 = H[2]; 6119 var H3 = H[3]; 6120 var H4 = H[4]; 6121 var H5 = H[5]; 6122 var H6 = H[6]; 6123 var H7 = H[7]; 6124 6125 var H0h = H0.high; 6126 var H0l = H0.low; 6127 var H1h = H1.high; 6128 var H1l = H1.low; 6129 var H2h = H2.high; 6130 var H2l = H2.low; 6131 var H3h = H3.high; 6132 var H3l = H3.low; 6133 var H4h = H4.high; 6134 var H4l = H4.low; 6135 var H5h = H5.high; 6136 var H5l = H5.low; 6137 var H6h = H6.high; 6138 var H6l = H6.low; 6139 var H7h = H7.high; 6140 var H7l = H7.low; 6141 6142 // Working variables 6143 var ah = H0h; 6144 var al = H0l; 6145 var bh = H1h; 6146 var bl = H1l; 6147 var ch = H2h; 6148 var cl = H2l; 6149 var dh = H3h; 6150 var dl = H3l; 6151 var eh = H4h; 6152 var el = H4l; 6153 var fh = H5h; 6154 var fl = H5l; 6155 var gh = H6h; 6156 var gl = H6l; 6157 var hh = H7h; 6158 var hl = H7l; 6159 6160 // Rounds 6161 for (var i = 0; i < 80; i++) { 6162 var Wil; 6163 var Wih; 6164 6165 // Shortcut 6166 var Wi = W[i]; 6167 6168 // Extend message 6169 if (i < 16) { 6170 Wih = Wi.high = M[offset + i * 2] | 0; 6171 Wil = Wi.low = M[offset + i * 2 + 1] | 0; 6172 } else { 6173 // Gamma0 6174 var gamma0x = W[i - 15]; 6175 var gamma0xh = gamma0x.high; 6176 var gamma0xl = gamma0x.low; 6177 var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); 6178 var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); 6179 6180 // Gamma1 6181 var gamma1x = W[i - 2]; 6182 var gamma1xh = gamma1x.high; 6183 var gamma1xl = gamma1x.low; 6184 var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); 6185 var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); 6186 6187 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] 6188 var Wi7 = W[i - 7]; 6189 var Wi7h = Wi7.high; 6190 var Wi7l = Wi7.low; 6191 6192 var Wi16 = W[i - 16]; 6193 var Wi16h = Wi16.high; 6194 var Wi16l = Wi16.low; 6195 6196 Wil = gamma0l + Wi7l; 6197 Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); 6198 Wil = Wil + gamma1l; 6199 Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); 6200 Wil = Wil + Wi16l; 6201 Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); 6202 6203 Wi.high = Wih; 6204 Wi.low = Wil; 6205 } 6206 6207 var chh = (eh & fh) ^ (~eh & gh); 6208 var chl = (el & fl) ^ (~el & gl); 6209 var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); 6210 var majl = (al & bl) ^ (al & cl) ^ (bl & cl); 6211 6212 var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); 6213 var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); 6214 var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); 6215 var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); 6216 6217 // t1 = h + sigma1 + ch + K[i] + W[i] 6218 var Ki = K[i]; 6219 var Kih = Ki.high; 6220 var Kil = Ki.low; 6221 6222 var t1l = hl + sigma1l; 6223 var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); 6224 var t1l = t1l + chl; 6225 var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); 6226 var t1l = t1l + Kil; 6227 var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); 6228 var t1l = t1l + Wil; 6229 var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); 6230 6231 // t2 = sigma0 + maj 6232 var t2l = sigma0l + majl; 6233 var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); 6234 6235 // Update working variables 6236 hh = gh; 6237 hl = gl; 6238 gh = fh; 6239 gl = fl; 6240 fh = eh; 6241 fl = el; 6242 el = (dl + t1l) | 0; 6243 eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; 6244 dh = ch; 6245 dl = cl; 6246 ch = bh; 6247 cl = bl; 6248 bh = ah; 6249 bl = al; 6250 al = (t1l + t2l) | 0; 6251 ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; 6252 } 6253 6254 // Intermediate hash value 6255 H0l = H0.low = (H0l + al); 6256 H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); 6257 H1l = H1.low = (H1l + bl); 6258 H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); 6259 H2l = H2.low = (H2l + cl); 6260 H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); 6261 H3l = H3.low = (H3l + dl); 6262 H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); 6263 H4l = H4.low = (H4l + el); 6264 H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); 6265 H5l = H5.low = (H5l + fl); 6266 H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); 6267 H6l = H6.low = (H6l + gl); 6268 H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); 6269 H7l = H7.low = (H7l + hl); 6270 H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); 6271 }, 6272 6273 _doFinalize: function () { 6274 // Shortcuts 6275 var data = this._data; 6276 var dataWords = data.words; 6277 6278 var nBitsTotal = this._nDataBytes * 8; 6279 var nBitsLeft = data.sigBytes * 8; 6280 6281 // Add padding 6282 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); 6283 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); 6284 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; 6285 data.sigBytes = dataWords.length * 4; 6286 6287 // Hash final blocks 6288 this._process(); 6289 6290 // Convert hash to 32-bit word array before returning 6291 var hash = this._hash.toX32(); 6292 6293 // Return final computed hash 6294 return hash; 6295 }, 6296 6297 clone: function () { 6298 var clone = Hasher.clone.call(this); 6299 clone._hash = this._hash.clone(); 6300 6301 return clone; 6302 }, 6303 6304 blockSize: 1024/32 6305 }); 6306 6307 /** 6308 * Shortcut function to the hasher's object interface. 6309 * 6310 * @param {WordArray|string} message The message to hash. 6311 * 6312 * @return {WordArray} The hash. 6313 * 6314 * @static 6315 * 6316 * @example 6317 * 6318 * var hash = CryptoJS.SHA512('message'); 6319 * var hash = CryptoJS.SHA512(wordArray); 6320 */ 6321 C.SHA512 = Hasher._createHelper(SHA512); 6322 6323 /** 6324 * Shortcut function to the HMAC's object interface. 6325 * 6326 * @param {WordArray|string} message The message to hash. 6327 * @param {WordArray|string} key The secret key. 6328 * 6329 * @return {WordArray} The HMAC. 6330 * 6331 * @static 6332 * 6333 * @example 6334 * 6335 * var hmac = CryptoJS.HmacSHA512(message, key); 6336 */ 6337 C.HmacSHA512 = Hasher._createHmacHelper(SHA512); 6338 }()); 6339 6340 6341
6341return CryptoJS.SHA512; 6342 6343})); 6344 6345/***/ }), 6346 6347/***/ 4253: 6348/***/ (function(module, exports, __webpack_require__) { 6349 6350;(function (root, factory, undef) { 6351 if (true) { 6352 // CommonJS 6353 module.exports = exports = factory(__webpack_require__(8249), __webpack_require__(8269), __webpack_require__(3125), __webpack_require__(888), __webpack_require__(5
vendor: 12,368 bytes, lines 6353-6744
6353109)); 6354 } 6355 else {} 6356}(this, function (CryptoJS) { 6357 6358 (function () { 6359 // Shortcuts 6360 var C = CryptoJS; 6361 var C_lib = C.lib; 6362 var WordArray = C_lib.WordArray; 6363 var BlockCipher = C_lib.BlockCipher; 6364 var C_algo = C.algo; 6365 6366 // Permuted Choice 1 constants 6367 var PC1 = [ 6368 57, 49, 41, 33, 25, 17, 9, 1, 6369 58, 50, 42, 34, 26, 18, 10, 2, 6370 59, 51, 43, 35, 27, 19, 11, 3, 6371 60, 52, 44, 36, 63, 55, 47, 39, 6372 31, 23, 15, 7, 62, 54, 46, 38, 6373 30, 22, 14, 6, 61, 53, 45, 37, 6374 29, 21, 13, 5, 28, 20, 12, 4 6375 ]; 6376 6377 // Permuted Choice 2 constants 6378 var PC2 = [ 6379 14, 17, 11, 24, 1, 5, 6380 3, 28, 15, 6, 21, 10, 6381 23, 19, 12, 4, 26, 8, 6382 16, 7, 27, 20, 13, 2, 6383 41, 52, 31, 37, 47, 55, 6384 30, 40, 51, 45, 33, 48, 6385 44, 49, 39, 56, 34, 53, 6386 46, 42, 50, 36, 29, 32 6387 ]; 6388 6389 // Cumulative bit shift constants 6390 var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; 6391 6392 // SBOXes and round permutation constants 6393 var SBOX_P = [ 6394 { 6395 0x0: 0x808200, 6396 0x10000000: 0x8000, 6397 0x20000000: 0x808002, 6398 0x30000000: 0x2, 6399 0x40000000: 0x200, 6400 0x50000000: 0x808202, 6401 0x60000000: 0x800202, 6402 0x70000000: 0x800000, 6403 0x80000000: 0x202, 6404 0x90000000: 0x800200, 6405 0xa0000000: 0x8200, 6406 0xb0000000: 0x808000, 6407 0xc0000000: 0x8002, 6408 0xd0000000: 0x800002, 6409 0xe0000000: 0x0, 6410 0xf0000000: 0x8202, 6411 0x8000000: 0x0, 6412 0x18000000: 0x808202, 6413 0x28000000: 0x8202, 6414 0x38000000: 0x8000, 6415 0x48000000: 0x808200, 6416 0x58000000: 0x200, 6417 0x68000000: 0x808002, 6418 0x78000000: 0x2, 6419 0x88000000: 0x800200, 6420 0x98000000: 0x8200, 6421 0xa8000000: 0x808000, 6422 0xb8000000: 0x800202, 6423 0xc8000000: 0x800002, 6424 0xd8000000: 0x8002, 6425 0xe8000000: 0x202, 6426 0xf8000000: 0x800000, 6427 0x1: 0x8000, 6428 0x10000001: 0x2, 6429 0x20000001: 0x808200, 6430 0x30000001: 0x800000, 6431 0x40000001: 0x808002, 6432 0x50000001: 0x8200, 6433 0x60000001: 0x200, 6434 0x70000001: 0x800202, 6435 0x80000001: 0x808202, 6436 0x90000001: 0x808000, 6437 0xa0000001: 0x800002, 6438 0xb0000001: 0x8202, 6439 0xc0000001: 0x202, 6440 0xd0000001: 0x800200, 6441 0xe0000001: 0x8002, 6442 0xf0000001: 0x0, 6443 0x8000001: 0x808202, 6444 0x18000001: 0x808000, 6445 0x28000001: 0x800000, 6446 0x38000001: 0x200, 6447 0x48000001: 0x8000, 6448 0x58000001: 0x800002, 6449 0x68000001: 0x2, 6450 0x78000001: 0x8202, 6451 0x88000001: 0x8002, 6452 0x98000001: 0x800202, 6453 0xa8000001: 0x202, 6454 0xb8000001: 0x808200, 6455 0xc8000001: 0x800200, 6456 0xd8000001: 0x0, 6457 0xe8000001: 0x8200, 6458 0xf8000001: 0x808002 6459 }, 6460 { 6461 0x0: 0x40084010, 6462 0x1000000: 0x4000, 6463 0x2000000: 0x80000, 6464 0x3000000: 0x40080010, 6465 0x4000000: 0x40000010, 6466 0x5000000: 0x40084000, 6467 0x6000000: 0x40004000, 6468 0x7000000: 0x10, 6469 0x8000000: 0x84000, 6470 0x9000000: 0x40004010, 6471 0xa000000: 0x40000000, 6472 0xb000000: 0x84010, 6473 0xc000000: 0x80010, 6474 0xd000000: 0x0, 6475 0xe000000: 0x4010, 6476 0xf000000: 0x40080000, 6477 0x800000: 0x40004000, 6478 0x1800000: 0x84010, 6479 0x2800000: 0x10, 6480 0x3800000: 0x40004010, 6481 0x4800000: 0x40084010, 6482 0x5800000: 0x40000000, 6483 0x6800000: 0x80000, 6484 0x7800000: 0x40080010, 6485 0x8800000: 0x80010, 6486 0x9800000: 0x0, 6487 0xa800000: 0x4000, 6488 0xb800000: 0x40080000, 6489 0xc800000: 0x40000010, 6490 0xd800000: 0x84000, 6491 0xe800000: 0x40084000, 6492 0xf800000: 0x4010, 6493 0x10000000: 0x0, 6494 0x11000000: 0x40080010, 6495 0x12000000: 0x40004010, 6496 0x13000000: 0x40084000, 6497 0x14000000: 0x40080000, 6498 0x15000000: 0x10, 6499 0x16000000: 0x84010, 6500 0x17000000: 0x4000, 6501 0x18000000: 0x4010, 6502 0x19000000: 0x80000, 6503 0x1a000000: 0x80010, 6504 0x1b000000: 0x40000010, 6505 0x1c000000: 0x84000, 6506 0x1d000000: 0x40004000, 6507 0x1e000000: 0x40000000, 6508 0x1f000000: 0x40084010, 6509 0x10800000: 0x84010, 6510 0x11800000: 0x80000, 6511 0x12800000: 0x40080000, 6512 0x13800000: 0x4000, 6513 0x14800000: 0x40004000, 6514 0x15800000: 0x40084010, 6515 0x16800000: 0x10, 6516 0x17800000: 0x40000000, 6517 0x18800000: 0x40084000, 6518 0x19800000: 0x40000010, 6519 0x1a800000: 0x40004010, 6520 0x1b800000: 0x80010, 6521 0x1c800000: 0x0, 6522 0x1d800000: 0x4010, 6523 0x1e800000: 0x40080010, 6524 0x1f800000: 0x84000 6525 }, 6526 { 6527 0x0: 0x104, 6528 0x100000: 0x0, 6529 0x200000: 0x4000100, 6530 0x300000: 0x10104, 6531 0x400000: 0x10004, 6532 0x500000: 0x4000004, 6533 0x600000: 0x4010104, 6534 0x700000: 0x4010000, 6535 0x800000: 0x4000000, 6536 0x900000: 0x4010100, 6537 0xa00000: 0x10100, 6538 0xb00000: 0x4010004, 6539 0xc00000: 0x4000104, 6540 0xd00000: 0x10000, 6541 0xe00000: 0x4, 6542 0xf00000: 0x100, 6543 0x80000: 0x4010100, 6544 0x180000: 0x4010004, 6545 0x280000: 0x0, 6546 0x380000: 0x4000100, 6547 0x480000: 0x4000004, 6548 0x580000: 0x10000, 6549 0x680000: 0x10004, 6550 0x780000: 0x104, 6551 0x880000: 0x4, 6552 0x980000: 0x100, 6553 0xa80000: 0x4010000, 6554 0xb80000: 0x10104, 6555 0xc80000: 0x10100, 6556 0xd80000: 0x4000104, 6557 0xe80000: 0x4010104, 6558 0xf80000: 0x4000000, 6559 0x1000000: 0x4010100, 6560 0x1100000: 0x10004, 6561 0x1200000: 0x10000, 6562 0x1300000: 0x4000100, 6563 0x1400000: 0x100, 6564 0x1500000: 0x4010104, 6565 0x1600000: 0x4000004, 6566 0x1700000: 0x0, 6567 0x1800000: 0x4000104, 6568 0x1900000: 0x4000000, 6569 0x1a00000: 0x4, 6570 0x1b00000: 0x10100, 6571 0x1c00000: 0x4010000, 6572 0x1d00000: 0x104, 6573 0x1e00000: 0x10104, 6574 0x1f00000: 0x4010004, 6575 0x1080000: 0x4000000, 6576 0x1180000: 0x104, 6577 0x1280000: 0x4010100, 6578 0x1380000: 0x0, 6579 0x1480000: 0x10004, 6580 0x1580000: 0x4000100, 6581 0x1680000: 0x100, 6582 0x1780000: 0x4010004, 6583 0x1880000: 0x10000, 6584 0x1980000: 0x4010104, 6585 0x1a80000: 0x10104, 6586 0x1b80000: 0x4000004, 6587 0x1c80000: 0x4000104, 6588 0x1d80000: 0x4010000, 6589 0x1e80000: 0x4, 6590 0x1f80000: 0x10100 6591 }, 6592 { 6593 0x0: 0x80401000, 6594 0x10000: 0x80001040, 6595 0x20000: 0x401040, 6596 0x30000: 0x80400000, 6597 0x40000: 0x0, 6598 0x50000: 0x401000, 6599 0x60000: 0x80000040, 6600 0x70000: 0x400040, 6601 0x80000: 0x80000000, 6602 0x90000: 0x400000, 6603 0xa0000: 0x40, 6604 0xb0000: 0x80001000, 6605 0xc0000: 0x80400040, 6606 0xd0000: 0x1040, 6607 0xe0000: 0x1000, 6608 0xf0000: 0x80401040, 6609 0x8000: 0x80001040, 6610 0x18000: 0x40, 6611 0x28000: 0x80400040, 6612 0x38000: 0x80001000, 6613 0x48000: 0x401000, 6614 0x58000: 0x80401040, 6615 0x68000: 0x0, 6616 0x78000: 0x80400000, 6617 0x88000: 0x1000, 6618 0x98000: 0x80401000, 6619 0xa8000: 0x400000, 6620 0xb8000: 0x1040, 6621 0xc8000: 0x80000000, 6622 0xd8000: 0x400040, 6623 0xe8000: 0x401040, 6624 0xf8000: 0x80000040, 6625 0x100000: 0x400040, 6626 0x110000: 0x401000, 6627 0x120000: 0x80000040, 6628 0x130000: 0x0, 6629 0x140000: 0x1040, 6630 0x150000: 0x80400040, 6631 0x160000: 0x80401000, 6632 0x170000: 0x80001040, 6633 0x180000: 0x80401040, 6634 0x190000: 0x80000000, 6635 0x1a0000: 0x80400000, 6636 0x1b0000: 0x401040, 6637 0x1c0000: 0x80001000, 6638 0x1d0000: 0x400000, 6639 0x1e0000: 0x40, 6640 0x1f0000: 0x1000, 6641 0x108000: 0x80400000, 6642 0x118000: 0x80401040, 6643 0x128000: 0x0, 6644 0x138000: 0x401000, 6645 0x148000: 0x400040, 6646 0x158000: 0x80000000, 6647 0x168000: 0x80001040, 6648 0x178000: 0x40, 6649 0x188000: 0x80000040, 6650 0x198000: 0x1000, 6651 0x1a8000: 0x80001000, 6652 0x1b8000: 0x80400040, 6653 0x1c8000: 0x1040, 6654 0x1d8000: 0x80401000, 6655 0x1e8000: 0x400000, 6656 0x1f8000: 0x401040 6657 }, 6658 { 6659 0x0: 0x80, 6660 0x1000: 0x1040000, 6661 0x2000: 0x40000, 6662 0x3000: 0x20000000, 6663 0x4000: 0x20040080, 6664 0x5000: 0x1000080, 6665 0x6000: 0x21000080, 6666 0x7000: 0x40080, 6667 0x8000: 0x1000000, 6668 0x9000: 0x20040000, 6669 0xa000: 0x20000080, 6670 0xb000: 0x21040080, 6671 0xc000: 0x21040000, 6672 0xd000: 0x0, 6673 0xe000: 0x1040080, 6674 0xf000: 0x21000000, 6675 0x800: 0x1040080, 6676 0x1800: 0x21000080, 6677 0x2800: 0x80, 6678 0x3800: 0x1040000, 6679 0x4800: 0x40000, 6680 0x5800: 0x20040080, 6681 0x6800: 0x21040000, 6682 0x7800: 0x20000000, 6683 0x8800: 0x20040000, 6684 0x9800: 0x0, 6685 0xa800: 0x21040080, 6686 0xb800: 0x1000080, 6687 0xc800: 0x20000080, 6688 0xd800: 0x21000000, 6689 0xe800: 0x1000000, 6690 0xf800: 0x40080, 6691 0x10000: 0x40000, 6692 0x11000: 0x80, 6693 0x12000: 0x20000000, 6694 0x13000: 0x21000080, 6695 0x14000: 0x1000080, 6696 0x15000: 0x21040000, 6697 0x16000: 0x20040080, 6698 0x17000: 0x1000000, 6699 0x18000: 0x21040080, 6700 0x19000: 0x21000000, 6701 0x1a000: 0x1040000, 6702 0x1b000: 0x20040000, 6703 0x1c000: 0x40080, 6704 0x1d000: 0x20000080, 6705 0x1e000: 0x0, 6706 0x1f000: 0x1040080, 6707 0x10800: 0x21000080, 6708 0x11800: 0x1000000, 6709 0x12800: 0x1040000, 6710 0x13800: 0x20040080, 6711 0x14800: 0x20000000, 6712 0x15800: 0x1040080, 6713 0x16800: 0x80, 6714 0x17800: 0x21040000, 6715 0x18800: 0x40080, 6716 0x19800: 0x21040080, 6717 0x1a800: 0x0, 6718 0x1b800: 0x21000000, 6719 0x1c800: 0x1000080, 6720 0x1d800: 0x40000, 6721 0x1e800: 0x20040000, 6722 0x1f800: 0x20000080 6723 }, 6724 { 6725 0x0: 0x10000008, 6726 0x100: 0x2000, 6727 0x200: 0x10200000, 6728 0x300: 0x10202008, 6729 0x400: 0x10002000, 6730 0x500: 0x200000, 6731 0x600: 0x200008, 6732 0x700: 0x10000000, 6733 0x800: 0x0, 6734 0x900: 0x10002008, 6735 0xa00: 0x202000, 6736 0xb00: 0x8, 6737 0xc00: 0x10200008, 6738 0xd00: 0x202008, 6739 0xe00: 0x2008, 6740 0xf00: 0x10202000, 6741 0x80: 0x10200000, 6742 0x180: 0x10202008, 6743 0x280: 0x8, 6744 0x380: 0x200000,
vendor: 12,082 bytes, lines 6745-7121
6745 0x480: 0x202008, 6746 0x580: 0x10000008, 6747 0x680: 0x10002000, 6748 0x780: 0x2008, 6749 0x880: 0x200008, 6750 0x980: 0x2000, 6751 0xa80: 0x10002008, 6752 0xb80: 0x10200008, 6753 0xc80: 0x0, 6754 0xd80: 0x10202000, 6755 0xe80: 0x202000, 6756 0xf80: 0x10000000, 6757 0x1000: 0x10002000, 6758 0x1100: 0x10200008, 6759 0x1200: 0x10202008, 6760 0x1300: 0x2008, 6761 0x1400: 0x200000, 6762 0x1500: 0x10000000, 6763 0x1600: 0x10000008, 6764 0x1700: 0x202000, 6765 0x1800: 0x202008, 6766 0x1900: 0x0, 6767 0x1a00: 0x8, 6768 0x1b00: 0x10200000, 6769 0x1c00: 0x2000, 6770 0x1d00: 0x10002008, 6771 0x1e00: 0x10202000, 6772 0x1f00: 0x200008, 6773 0x1080: 0x8, 6774 0x1180: 0x202000, 6775 0x1280: 0x200000, 6776 0x1380: 0x10000008, 6777 0x1480: 0x10002000, 6778 0x1580: 0x2008, 6779 0x1680: 0x10202008, 6780 0x1780: 0x10200000, 6781 0x1880: 0x10202000, 6782 0x1980: 0x10200008, 6783 0x1a80: 0x2000, 6784 0x1b80: 0x202008, 6785 0x1c80: 0x200008, 6786 0x1d80: 0x0, 6787 0x1e80: 0x10000000, 6788 0x1f80: 0x10002008 6789 }, 6790 { 6791 0x0: 0x100000, 6792 0x10: 0x2000401, 6793 0x20: 0x400, 6794 0x30: 0x100401, 6795 0x40: 0x2100401, 6796 0x50: 0x0, 6797 0x60: 0x1, 6798 0x70: 0x2100001, 6799 0x80: 0x2000400, 6800 0x90: 0x100001, 6801 0xa0: 0x2000001, 6802 0xb0: 0x2100400, 6803 0xc0: 0x2100000, 6804 0xd0: 0x401, 6805 0xe0: 0x100400, 6806 0xf0: 0x2000000, 6807 0x8: 0x2100001, 6808 0x18: 0x0, 6809 0x28: 0x2000401, 6810 0x38: 0x2100400, 6811 0x48: 0x100000, 6812 0x58: 0x2000001, 6813 0x68: 0x2000000, 6814 0x78: 0x401, 6815 0x88: 0x100401, 6816 0x98: 0x2000400, 6817 0xa8: 0x2100000, 6818 0xb8: 0x100001, 6819 0xc8: 0x400, 6820 0xd8: 0x2100401, 6821 0xe8: 0x1, 6822 0xf8: 0x100400, 6823 0x100: 0x2000000, 6824 0x110: 0x100000, 6825 0x120: 0x2000401, 6826 0x130: 0x2100001, 6827 0x140: 0x100001, 6828 0x150: 0x2000400, 6829 0x160: 0x2100400, 6830 0x170: 0x100401, 6831 0x180: 0x401, 6832 0x190: 0x2100401, 6833 0x1a0: 0x100400, 6834 0x1b0: 0x1, 6835 0x1c0: 0x0, 6836 0x1d0: 0x2100000, 6837 0x1e0: 0x2000001, 6838 0x1f0: 0x400, 6839 0x108: 0x100400, 6840 0x118: 0x2000401, 6841 0x128: 0x2100001, 6842 0x138: 0x1, 6843 0x148: 0x2000000, 6844 0x158: 0x100000, 6845 0x168: 0x401, 6846 0x178: 0x2100400, 6847 0x188: 0x2000001, 6848 0x198: 0x2100000, 6849 0x1a8: 0x0, 6850 0x1b8: 0x2100401, 6851 0x1c8: 0x100401, 6852 0x1d8: 0x400, 6853 0x1e8: 0x2000400, 6854 0x1f8: 0x100001 6855 }, 6856 { 6857 0x0: 0x8000820, 6858 0x1: 0x20000, 6859 0x2: 0x8000000, 6860 0x3: 0x20, 6861 0x4: 0x20020, 6862 0x5: 0x8020820, 6863 0x6: 0x8020800, 6864 0x7: 0x800, 6865 0x8: 0x8020000, 6866 0x9: 0x8000800, 6867 0xa: 0x20800, 6868 0xb: 0x8020020, 6869 0xc: 0x820, 6870 0xd: 0x0, 6871 0xe: 0x8000020, 6872 0xf: 0x20820, 6873 0x80000000: 0x800, 6874 0x80000001: 0x8020820, 6875 0x80000002: 0x8000820, 6876 0x80000003: 0x8000000, 6877 0x80000004: 0x8020000, 6878 0x80000005: 0x20800, 6879 0x80000006: 0x20820, 6880 0x80000007: 0x20, 6881 0x80000008: 0x8000020, 6882 0x80000009: 0x820, 6883 0x8000000a: 0x20020, 6884 0x8000000b: 0x8020800, 6885 0x8000000c: 0x0, 6886 0x8000000d: 0x8020020, 6887 0x8000000e: 0x8000800, 6888 0x8000000f: 0x20000, 6889 0x10: 0x20820, 6890 0x11: 0x8020800, 6891 0x12: 0x20, 6892 0x13: 0x800, 6893 0x14: 0x8000800, 6894 0x15: 0x8000020, 6895 0x16: 0x8020020, 6896 0x17: 0x20000, 6897 0x18: 0x0, 6898 0x19: 0x20020, 6899 0x1a: 0x8020000, 6900 0x1b: 0x8000820, 6901 0x1c: 0x8020820, 6902 0x1d: 0x20800, 6903 0x1e: 0x820, 6904 0x1f: 0x8000000, 6905 0x80000010: 0x20000, 6906 0x80000011: 0x800, 6907 0x80000012: 0x8020020, 6908 0x80000013: 0x20820, 6909 0x80000014: 0x20, 6910 0x80000015: 0x8020000, 6911 0x80000016: 0x8000000, 6912 0x80000017: 0x8000820, 6913 0x80000018: 0x8020820, 6914 0x80000019: 0x8000020, 6915 0x8000001a: 0x8000800, 6916 0x8000001b: 0x0, 6917 0x8000001c: 0x20800, 6918 0x8000001d: 0x820, 6919 0x8000001e: 0x20020, 6920 0x8000001f: 0x8020800 6921 } 6922 ]; 6923 6924 // Masks that select the SBOX input 6925 var SBOX_MASK = [ 6926 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, 6927 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f 6928 ]; 6929 6930 /** 6931 * DES block cipher algorithm. 6932 */ 6933 var DES = C_algo.DES = BlockCipher.extend({ 6934 _doReset: function () { 6935 // Shortcuts 6936 var key = this._key; 6937 var keyWords = key.words; 6938 6939 // Select 56 bits according to PC1 6940 var keyBits = []; 6941 for (var i = 0; i < 56; i++) { 6942 var keyBitPos = PC1[i] - 1; 6943 keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; 6944 } 6945 6946 // Assemble 16 subkeys 6947 var subKeys = this._subKeys = []; 6948 for (var nSubKey = 0; nSubKey < 16; nSubKey++) { 6949 // Create subkey 6950 var subKey = subKeys[nSubKey] = []; 6951 6952 // Shortcut 6953 var bitShift = BIT_SHIFTS[nSubKey]; 6954 6955 // Select 48 bits according to PC2 6956 for (var i = 0; i < 24; i++) { 6957 // Select from the left 28 key bits 6958 subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); 6959 6960 // Select from the right 28 key bits 6961 subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); 6962 } 6963 6964 // Since each subkey is applied to an expanded 32-bit input, 6965 // the subkey can be broken into 8 values scaled to 32-bits, 6966 // which allows the key to be used without expansion 6967 subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); 6968 for (var i = 1; i < 7; i++) { 6969 subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); 6970 } 6971 subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); 6972 } 6973 6974 // Compute inverse subkeys 6975 var invSubKeys = this._invSubKeys = []; 6976 for (var i = 0; i < 16; i++) { 6977 invSubKeys[i] = subKeys[15 - i]; 6978 } 6979 }, 6980 6981 encryptBlock: function (M, offset) { 6982 this._doCryptBlock(M, offset, this._subKeys); 6983 }, 6984 6985 decryptBlock: function (M, offset) { 6986 this._doCryptBlock(M, offset, this._invSubKeys); 6987 }, 6988 6989 _doCryptBlock: function (M, offset, subKeys) { 6990 // Get input 6991 this._lBlock = M[offset]; 6992 this._rBlock = M[offset + 1]; 6993 6994 // Initial permutation 6995 exchangeLR.call(this, 4, 0x0f0f0f0f); 6996 exchangeLR.call(this, 16, 0x0000ffff); 6997 exchangeRL.call(this, 2, 0x33333333); 6998 exchangeRL.call(this, 8, 0x00ff00ff); 6999 exchangeLR.call(this, 1, 0x55555555); 7000 7001 // Rounds 7002 for (var round = 0; round < 16; round++) { 7003 // Shortcuts 7004 var subKey = subKeys[round]; 7005 var lBlock = this._lBlock; 7006 var rBlock = this._rBlock; 7007 7008 // Feistel function 7009 var f = 0; 7010 for (var i = 0; i < 8; i++) { 7011 f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; 7012 } 7013 this._lBlock = rBlock; 7014 this._rBlock = lBlock ^ f; 7015 } 7016 7017 // Undo swap from last round 7018 var t = this._lBlock; 7019 this._lBlock = this._rBlock; 7020 this._rBlock = t; 7021 7022 // Final permutation 7023 exchangeLR.call(this, 1, 0x55555555); 7024 exchangeRL.call(this, 8, 0x00ff00ff); 7025 exchangeRL.call(this, 2, 0x33333333); 7026 exchangeLR.call(this, 16, 0x0000ffff); 7027 exchangeLR.call(this, 4, 0x0f0f0f0f); 7028 7029 // Set output 7030 M[offset] = this._lBlock; 7031 M[offset + 1] = this._rBlock; 7032 }, 7033 7034 keySize: 64/32, 7035 7036 ivSize: 64/32, 7037 7038 blockSize: 64/32 7039 }); 7040 7041 // Swap bits across the left and right words 7042 function exchangeLR(offset, mask) { 7043 var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; 7044 this._rBlock ^= t; 7045 this._lBlock ^= t << offset; 7046 } 7047 7048 function exchangeRL(offset, mask) { 7049 var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; 7050 this._lBlock ^= t; 7051 this._rBlock ^= t << offset; 7052 } 7053 7054 /** 7055 * Shortcut functions to the cipher's object interface. 7056 * 7057 * @example 7058 * 7059 * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); 7060 * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); 7061 */ 7062 C.DES = BlockCipher._createHelper(DES); 7063 7064 /** 7065 * Triple-DES block cipher algorithm. 7066 */ 7067 var TripleDES = C_algo.TripleDES = BlockCipher.extend({ 7068 _doReset: function () { 7069 // Shortcuts 7070 var key = this._key; 7071 var keyWords = key.words; 7072 // Make sure the key length is valid (64, 128 or >= 192 bit) 7073 if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { 7074 throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.'); 7075 } 7076 7077 // Extend the key according to the keying options defined in 3DES standard 7078 var key1 = keyWords.slice(0, 2); 7079 var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); 7080 var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); 7081 7082 // Create DES instances 7083 this._des1 = DES.createEncryptor(WordArray.create(key1)); 7084 this._des2 = DES.createEncryptor(WordArray.create(key2)); 7085 this._des3 = DES.createEncryptor(WordArray.create(key3)); 7086 }, 7087 7088 encryptBlock: function (M, offset) { 7089 this._des1.encryptBlock(M, offset); 7090 this._des2.decryptBlock(M, offset); 7091 this._des3.encryptBlock(M, offset); 7092 }, 7093 7094 decryptBlock: function (M, offset) { 7095 this._des3.decryptBlock(M, offset); 7096 this._des2.encryptBlock(M, offset); 7097 this._des1.decryptBlock(M, offset); 7098 }, 7099 7100 keySize: 192/32, 7101 7102 ivSize: 64/32, 7103 7104 blockSize: 64/32 7105 }); 7106 7107 /** 7108 * Shortcut functions to the cipher's object interface. 7109 * 7110 * @example 7111 * 7112 * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); 7113 * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); 7114 */ 7115 C.TripleDES = BlockCipher._createHelper(TripleDES); 7116 }()); 7117 7118 7119 return CryptoJS.TripleDES; 7120 7121}));
vendor: 6,138 bytes, lines 7122-7337
7122 7123/***/ }), 7124 7125/***/ 4938: 7126/***/ (function(module, exports, __webpack_require__) { 7127 7128;(function (root, factory) { 7129 if (true) { 7130 // CommonJS 7131 module.exports = exports = factory(__webpack_require__(8249)); 7132 } 7133 else {} 7134}(this, function (CryptoJS) { 7135 7136 (function (undefined) { 7137 // Shortcuts 7138 var C = CryptoJS; 7139 var C_lib = C.lib; 7140 var Base = C_lib.Base; 7141 var X32WordArray = C_lib.WordArray; 7142 7143 /** 7144 * x64 namespace. 7145 */ 7146 var C_x64 = C.x64 = {}; 7147 7148 /** 7149 * A 64-bit word. 7150 */ 7151 var X64Word = C_x64.Word = Base.extend({ 7152 /** 7153 * Initializes a newly created 64-bit word. 7154 * 7155 * @param {number} high The high 32 bits. 7156 * @param {number} low The low 32 bits. 7157 * 7158 * @example 7159 * 7160 * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); 7161 */ 7162 init: function (high, low) { 7163 this.high = high; 7164 this.low = low; 7165 } 7166 7167 /** 7168 * Bitwise NOTs this word. 7169 * 7170 * @return {X64Word} A new x64-Word object after negating. 7171 * 7172 * @example 7173 * 7174 * var negated = x64Word.not(); 7175 */ 7176 // not: function () { 7177 // var high = ~this.high; 7178 // var low = ~this.low; 7179 7180 // return X64Word.create(high, low); 7181 // }, 7182 7183 /** 7184 * Bitwise ANDs this word with the passed word. 7185 * 7186 * @param {X64Word} word The x64-Word to AND with this word. 7187 * 7188 * @return {X64Word} A new x64-Word object after ANDing. 7189 * 7190 * @example 7191 * 7192 * var anded = x64Word.and(anotherX64Word); 7193 */ 7194 // and: function (word) { 7195 // var high = this.high & word.high; 7196 // var low = this.low & word.low; 7197 7198 // return X64Word.create(high, low); 7199 // }, 7200 7201 /** 7202 * Bitwise ORs this word with the passed word. 7203 * 7204 * @param {X64Word} word The x64-Word to OR with this word. 7205 * 7206 * @return {X64Word} A new x64-Word object after ORing. 7207 * 7208 * @example 7209 * 7210 * var ored = x64Word.or(anotherX64Word); 7211 */ 7212 // or: function (word) { 7213 // var high = this.high | word.high; 7214 // var low = this.low | word.low; 7215 7216 // return X64Word.create(high, low); 7217 // }, 7218 7219 /** 7220 * Bitwise XORs this word with the passed word. 7221 * 7222 * @param {X64Word} word The x64-Word to XOR with this word. 7223 * 7224 * @return {X64Word} A new x64-Word object after XORing. 7225 * 7226 * @example 7227 * 7228 * var xored = x64Word.xor(anotherX64Word); 7229 */ 7230 // xor: function (word) { 7231 // var high = this.high ^ word.high; 7232 // var low = this.low ^ word.low; 7233 7234 // return X64Word.create(high, low); 7235 // }, 7236 7237 /** 7238 * Shifts this word n bits to the left. 7239 * 7240 * @param {number} n The number of bits to shift. 7241 * 7242 * @return {X64Word} A new x64-Word object after shifting. 7243 * 7244 * @example 7245 * 7246 * var shifted = x64Word.shiftL(25); 7247 */ 7248 // shiftL: function (n) { 7249 // if (n < 32) { 7250 // var high = (this.high << n) | (this.low >>> (32 - n)); 7251 // var low = this.low << n; 7252 // } else { 7253 // var high = this.low << (n - 32); 7254 // var low = 0; 7255 // } 7256 7257 // return X64Word.create(high, low); 7258 // }, 7259 7260 /** 7261 * Shifts this word n bits to the right. 7262 * 7263 * @param {number} n The number of bits to shift. 7264 * 7265 * @return {X64Word} A new x64-Word object after shifting. 7266 * 7267 * @example 7268 * 7269 * var shifted = x64Word.shiftR(7); 7270 */ 7271 // shiftR: function (n) { 7272 // if (n < 32) { 7273 // var low = (this.low >>> n) | (this.high << (32 - n)); 7274 // var high = this.high >>> n; 7275 // } else { 7276 // var low = this.high >>> (n - 32); 7277 // var high = 0; 7278 // } 7279 7280 // return X64Word.create(high, low); 7281 // }, 7282 7283 /** 7284 * Rotates this word n bits to the left. 7285 * 7286 * @param {number} n The number of bits to rotate. 7287 * 7288 * @return {X64Word} A new x64-Word object after rotating. 7289 * 7290 * @example 7291 * 7292 * var rotated = x64Word.rotL(25); 7293 */ 7294 // rotL: function (n) { 7295 // return this.shiftL(n).or(this.shiftR(64 - n)); 7296 // }, 7297 7298 /** 7299 * Rotates this word n bits to the right. 7300 * 7301 * @param {number} n The number of bits to rotate. 7302 * 7303 * @return {X64Word} A new x64-Word object after rotating. 7304 * 7305 * @example 7306 * 7307 * var rotated = x64Word.rotR(7); 7308 */ 7309 // rotR: function (n) { 7310 // return this.shiftR(n).or(this.shiftL(64 - n)); 7311 // }, 7312 7313 /** 7314 * Adds this word with the passed word. 7315 * 7316 * @param {X64Word} word The x64-Word to add with this word. 7317 * 7318 * @return {X64Word} A new x64-Word object after adding. 7319 * 7320 * @example 7321 * 7322 * var added = x64Word.add(anotherX64Word); 7323 */ 7324 // add: function (word) { 7325 // var low = (this.low + word.low) | 0; 7326 // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; 7327 // var high = (this.high + word.high + carry) | 0; 7328 7329 // return X64Word.create(high, low); 7330 // } 7331 }); 7332 7333 /** 7334 * An array of 64-bit words. 7335 * 7336 * @property {Array} words The array of CryptoJS.x64.Word objects. 7337 * @property {number} sigBytes The number of significant bytes in this word array.
7338 */ 7339 var X64WordArray = C_x64.WordArray = Base.extend({ 7340 /** 7341 * Initializes a newly created word array. 7342 * 7343 * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. 7344 * @param {number} sigBytes (Optional) The number of significant bytes in the words. 7345 * 7346 * @example 7347 * 7348 * var wordArray = CryptoJS.x64.WordArray.create(); 7349 * 7350 * var wordArray = CryptoJS.x64.WordArray.create([ 7351 * CryptoJS.x64.Word.create(0x00010203, 0x04050607), 7352 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) 7353 * ]); 7354 * 7355 * var wordArray = CryptoJS.x64.WordArray.create([ 7356 * CryptoJS.x64.Word.create(0x00010203, 0x04050607), 7357 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) 7358 * ], 10); 7359 */ 7360 init: function (words, sigBytes) { 7361 words = this.words = words || []; 7362 7363 if (sigBytes != undefined) { 7364 this.sigBytes = sigBytes; 7365 } else { 7366 this.sigBytes = words.length * 8; 7367 } 7368 }, 7369 7370 /** 7371 * Converts this 64-bit word array to a 32-bit word array. 7372 * 7373 * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. 7374 * 7375 * @example 7376 * 7377 * var x32WordArray = x64WordArray.toX32(); 7378 */ 7379 toX32: function () { 7380 // Shortcuts 7381 var x64Words = this.words; 7382 var x64WordsLength = x64Words.length; 7383 7384 // Convert 7385 var x32Words = []; 7386 for (var i = 0; i < x64WordsLength; i++) { 7387 var x64Word = x64Words[i]; 7388 x32Words.push(x64Word.high); 7389 x32Words.push(x64Word.low); 7390 } 7391 7392 return X32WordArray.create(x32Words, this.sigBytes); 7393 }, 7394 7395 /** 7396 * Creates a copy of this word array. 7397 * 7398 * @return {X64WordArray} The clone. 7399 * 7400 * @example 7401 * 7402 * var clone = x64WordArray.clone(); 7403 */ 7404 clone: function () { 7405 var clone = Base.clone.call(this); 7406 7407 // Clone "words" array 7408 var words = clone.words = this.words.slice(0); 7409 7410 // Clone each X64Word object 7411 var wordsLength = words.length; 7412 for (var i = 0; i < wordsLength; i++) { 7413 words[i] = words[i].clone(); 7414 } 7415 7416 return clone; 7417 } 7418 }); 7419 }()); 7420 7421 7422 return CryptoJS; 7423 7424})); 7425 7426/***/ }), 7427 7428/***/ 3525: 7429/***/ (function(module, exports, __webpack_require__) { 7430 7431"use strict"; 7432 7433Object.defineProperty(exports, "__esModule", ({ 7434 value: true 7435})); 7436Object.defineProperty(exports, "actionAsyncStorage", ({ 7437 enumerable: true, 7438 get: function() { 7439 return actionAsyncStorage; 7440 } 7441})); 7442const _asynclocalstorage = __webpack_require__(4001); 7443const actionAsyncStorage = (0, _asynclocalstorage.createAsyncLocalStorage)(); 7444if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 7445 Object.defineProperty(exports.default, "__esModule", { 7446 value: true 7447 }); 7448 Object.assign(exports.default, exports); 7449 module.exports = exports.default; 7450} //# sourceMappingURL=action-async-storage-instance.js.map 7451 7452 7453/***/ }), 7454 7455/***/ 6361: 7456/***/ (function(module, exports, __webpack_require__) { 7457 7458"TURBOPACK { transition: next-shared }"; 7459"use strict"; 7460Object.defineProperty(exports, "__esModule", ({ 7461 value: true 7462})); 7463Object.defineProperty(exports, "actionAsyncStorage", ({ 7464 enumerable: true, 7465 get: function() { 7466 return _actionasyncstorageinstance.actionAsyncStorage; 7467 } 7468})); 7469const _actionasyncstorageinstance = __webpack_require__(3525); 7470if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 7471 Object.defineProperty(exports.default, "__esModule", { 7472 value: true 7473 });
7474 Object.assign(exports.default, exports); 7475 module.exports = exports.default; 7476} //# sourceMappingURL=action-async-storage.external.js.map 7477 7478 7479/***/ }), 7480 7481/***/ 4001: 7482/***/ (function(module, exports) { 7483 7484"use strict"; 7485 7486Object.defineProperty(exports, "__esModule", ({ 7487 value: true 7488})); 7489Object.defineProperty(exports, "createAsyncLocalStorage", ({ 7490 enumerable: true, 7491 get: function() { 7492 return createAsyncLocalStorage; 7493 } 7494})); 7495const sharedAsyncLocalStorageNotAvailableError = new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"); 7496class FakeAsyncLocalStorage { 7497 disable() { 7498 throw sharedAsyncLocalStorageNotAvailableError; 7499 } 7500 getStore() { 7501 // This fake implementation of AsyncLocalStorage always returns `undefined`. 7502 return undefined; 7503 } 7504 run() { 7505 throw sharedAsyncLocalStorageNotAvailableError; 7506 } 7507 exit() { 7508 throw sharedAsyncLocalStorageNotAvailableError; 7509 } 7510 enterWith() { 7511 throw sharedAsyncLocalStorageNotAvailableError; 7512 } 7513} 7514const maybeGlobalAsyncLocalStorage = globalThis.AsyncLocalStorage; 7515function createAsyncLocalStorage() { 7516 if (maybeGlobalAsyncLocalStorage) { 7517 return new maybeGlobalAsyncLocalStorage(); 7518 } 7519 return new FakeAsyncLocalStorage(); 7520} 7521if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 7522 Object.defineProperty(exports.default, "__esModule", { 7523 value: true 7524 }); 7525 Object.assign(exports.default, exports); 7526 module.exports = exports.default; 7527} //# sourceMappingURL=async-local-storage.js.map 7528 7529 7530/***/ }), 7531 7532/***/ 8199: 7533/***/ (function(module, exports, __webpack_require__) { 7534 7535"use strict"; 7536 7537Object.defineProperty(exports, "__esModule", ({ 7538 value: true 7539})); 75400 && (0); 7541function _export(target, all) { 7542 for(var name in all)Object.defineProperty(target, name, { 7543 enumerable: true, 7544 get: all[name] 7545 }); 7546} 7547_export(exports, { 7548 ReadonlyURLSearchParams: function() { 7549 return _navigationreactserver.ReadonlyURLSearchParams; 7550 }, 7551 RedirectType: function() { 7552 return _navigationreactserver.RedirectType; 7553 }, 7554 ServerInsertedHTMLContext: function() { 7555 return _serverinsertedhtmlsharedruntime.ServerInsertedHTMLContext; 7556 }, 7557 notFound: function() { 7558 return _navigationreactserver.notFound; 7559 }, 7560 permanentRedirect: function() { 7561 return _navigationreactserver.permanentRedirect; 7562 }, 7563 redirect: function() { 7564 return _navigationreactserver.redirect; 7565 }, 7566 useParams: function() { 7567 return useParams; 7568 }, 7569 usePathname: function() { 7570 return usePathname; 7571 }, 7572 useRouter: function() { 7573 return useRouter; 7574 }, 7575 useSearchParams: function() { 7576 return useSearchParams; 7577 }, 7578 useSelectedLayoutSegment: function() { 7579 return useSelectedLayoutSegment; 7580 }, 7581 useSelectedLayoutSegments: function() { 7582 return useSelectedLayoutSegments; 7583 }, 7584 useServerInsertedHTML: function() { 7585 return _serverinsertedhtmlsharedruntime.useServerInsertedHTML; 7586 } 7587}); 7588const _react = __webpack_require__(7294); 7589const _approutercontextsharedruntime = __webpack_require__(257); 7590const _hooksclientcontextsharedruntime = __webpack_require__(2608); 7591const _getsegmentvalue = __webpack_require__(1288); 7592const _segment = __webpack_require__(6406); 7593const _navigationreactserver = __webpack_require__(2717); 7594const _serverinsertedhtmlsharedruntime = __webpack_require__(5988); 7595/** 7596 * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook 7597 * that lets you *read* the current URL's search parameters. 7598 * 7599 * Learn more about [`URLSearchParams` on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams) 7600 * 7601 * @example 7602 * ```ts 7603 * "use client" 7604 * import { useSearchParams } from 'next/navigation' 7605 * 7606 * export default function Page() { 7607 * const searchParams = useSearchParams() 7608 * searchParams.get('foo') // returns 'bar' when ?foo=bar 7609 * // ... 7610 * } 7611 * ``` 7612 * 7613 * Read more: [Next.js Docs: `useSearchParams`](https://nextjs.org/docs/app/api-reference/functions/use-search-params) 7614 */ function useSearchParams() { 7615 const searchParams = (0, _react.useContext)(_hooksclientcontextsharedruntime.SearchParamsContext); 7616 // In the case where this is `null`, the compat types added in 7617 // `next-env.d.ts` will add a new overload that changes the return type to 7618 // include `null`. 7619 const readonlySearchParams = (0, _react.useMemo)(()=>{ 7620 if (!searchParams) { 7621 // When the router is not ready in pages, we won't have the search params 7622 // available. 7623 return null; 7624 } 7625 return new _navigationreactserver.ReadonlyURLSearchParams(searchParams); 7626 }, [ 7627 searchParams 7628 ]); 7629 if (false) {} 7630 return readonlySearchParams; 7631} 7632/** 7633 * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook 7634 * that lets you read the current URL's pathname. 7635 * 7636 * @example 7637 * ```ts 7638 * "use client" 7639 * import { usePathname } from 'next/navigation' 7640 * 7641 * export default function Page() { 7642 * const pathname = usePathname() // returns "/dashboard" on /dashboard?foo=bar 7643 * // ... 7644 * } 7645 * ``` 7646 * 7647 * Read more: [Next.js Docs: `usePathname`](https://nextjs.org/docs/app/api-reference/functions/use-pathname) 7648 */ function usePathname() { 7649 // In the case where this is `null`, the compat types added in `next-env.d.ts` 7650 // will add a new overload that changes the return type to include `null`. 7651 return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathnameContext); 7652} 7653/** 7654 * 7655 * This hook allows you to programmatically change routes inside [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components). 7656 * 7657 * @example 7658 * ```ts 7659 * "use client" 7660 * import { useRouter } from 'next/navigation' 7661 * 7662 * export default function Page() { 7663 * const router = useRouter() 7664 * // ... 7665 * router.push('/dashboard') // Navigate to /dashboard 7666 * } 7667 * ``` 7668 * 7669 * Read more: [Next.js Docs: `useRouter`](https://nextjs.org/docs/app/api-reference/functions/use-router) 7670 */ function useRouter() { 7671 const router = (0, _react.useContext)(_approutercontextsharedruntime.AppRouterContext); 7672 if (router === null) { 7673 throw new Error("invariant expected app router to be mou
7673nted"); 7674 } 7675 return router; 7676} 7677/** 7678 * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook 7679 * that lets you read a route's dynamic params filled in by the current URL. 7680 * 7681 * @example 7682 * ```ts 7683 * "use client" 7684 * import { useParams } from 'next/navigation' 7685 * 7686 * export default function Page() { 7687 * // on /dashboard/[team] where pathname is /dashboard/nextjs 7688 * const { team } = useParams() // team === "nextjs" 7689 * } 7690 * ``` 7691 * 7692 * Read more: [Next.js Docs: `useParams`](https://nextjs.org/docs/app/api-reference/functions/use-params) 7693 */ function useParams() { 7694 return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathParamsContext); 7695} 7696/** Get the canonical parameters from the current level to the leaf node. */ function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first, segmentPath) { 7697 if (first === void 0) first = true; 7698 if (segmentPath === void 0) segmentPath = []; 7699 let node; 7700 if (first) { 7701 // Use the provided parallel route key on the first parallel route 7702 node = tree[1][parallelRouteKey]; 7703 } else { 7704 // After first parallel route prefer children, if there's no children pick the first parallel route. 7705 const parallelRoutes = tree[1]; 7706 var _parallelRoutes_children; 7707 node = (_parallelRoutes_children = parallelRoutes.children) != null ? _parallelRoutes_children : Object.values(parallelRoutes)[0]; 7708 } 7709 if (!node) return segmentPath; 7710 const segment = node[0]; 7711 const segmentValue = (0, _getsegmentvalue.getSegmentValue)(segment); 7712 if (!segmentValue || segmentValue.startsWith(_segment.PAGE_SEGMENT_KEY)) { 7713 return segmentPath; 7714 } 7715 segmentPath.push(segmentValue); 7716 return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath); 7717} 7718/** 7719 * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook 7720 * that lets you read the active route segments **below** the Layout it is called from. 7721 * 7722 * @example 7723 * ```ts 7724 * 'use client' 7725 * 7726 * import { useSelectedLayoutSegments } from 'next/navigation' 7727 * 7728 * export default function ExampleClientComponent() { 7729 * const segments = useSelectedLayoutSegments() 7730 * 7731 * return ( 7732 * <ul> 7733 * {segments.map((segment, index) => ( 7734 * <li key={index}>{segment}</li> 7735 * ))} 7736 * </ul> 7737 * ) 7738 * } 7739 * ``` 7740 * 7741 * Read more: [Next.js Docs: `useSelectedLayoutSegments`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segments) 7742 */ function useSelectedLayoutSegments(parallelRouteKey) { 7743 if (parallelRouteKey === void 0) parallelRouteKey = "children"; 7744 const context = (0, _react.useContext)(_approutercontextsharedruntime.LayoutRouterContext); 7745 // @ts-expect-error This only happens in `pages`. Type is overwritten in navigation.d.ts 7746 if (!context) return null; 7747 return getSelectedLayoutSegmentPath(context.tree, parallelRouteKey); 7748} 7749/** 7750 * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook 7751 * that lets you read the active route segment **one level below** the Layout it is called from. 7752 * 7753 * @example 7754 * ```ts 7755 * 'use client' 7756 * import { useSelectedLayoutSegment } from 'next/navigation' 7757 * 7758 * export default function ExampleClientComponent() { 7759 * const segment = useSelectedLayoutSegment() 7760 * 7761 * return <p>Active segment: {segment}</p> 7762 * } 7763 * ``` 7764 * 7765 * Read more: [Next.js Docs: `useSelectedLayoutSegment`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segment) 7766 */ function useSelectedLayoutSegment(parallelRouteKey) { 7767 if (parallelRouteKey === void 0) parallelRouteKey = "children"; 7768 const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey); 7769 if (!selectedLayoutSegments || selectedLayoutSegments.length === 0) { 7770 return null; 7771 } 7772 const selectedLayoutSegment = parallelRouteKey === "children" ? selectedLayoutSegments[0] : selectedLayoutSegments[selectedLayoutSegments.length - 1]; 7773 // if the default slot is showing, we return null since it's not technically "selected" (it's a fallback) 7774 // and returning an internal value like `__DEFAULT__` would be confusing. 7775 return selectedLayoutSegment === _segment.DEFAULT_SEGMENT_KEY ? null : selectedLayoutSegment; 7776} 7777if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 7778 Object.defineProperty(exports.default, "__esModule", { 7779 value: true 7780 });
7781 Object.assign(exports.default, exports); 7782 module.exports = exports.default; 7783} //# sourceMappingURL=navigation.js.map 7784 7785 7786/***/ }), 7787 7788/***/ 2717: 7789/***/ (function(module, exports, __webpack_require__) { 7790 7791"use strict"; 7792/** @internal */ 7793Object.defineProperty(exports, "__esModule", ({ 7794 value: true 7795})); 77960 && (0); 7797function _export(target, all) { 7798 for(var name in all)Object.defineProperty(target, name, { 7799 enumerable: true, 7800 get: all[name] 7801 }); 7802} 7803_export(exports, { 7804 ReadonlyURLSearchParams: function() { 7805 return ReadonlyURLSearchParams; 7806 }, 7807 RedirectType: function() { 7808 return _redirect.RedirectType; 7809 }, 7810 notFound: function() { 7811 return _notfound.notFound; 7812 }, 7813 permanentRedirect: function() { 7814 return _redirect.permanentRedirect; 7815 }, 7816 redirect: function() { 7817 return _redirect.redirect; 7818 } 7819}); 7820const _redirect = __webpack_require__(7511); 7821const _notfound = __webpack_require__(3394); 7822class ReadonlyURLSearchParamsError extends Error { 7823 constructor(){ 7824 super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams"); 7825 } 7826} 7827class ReadonlyURLSearchParams extends URLSearchParams { 7828 /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ append() { 7829 throw new ReadonlyURLSearchParamsError(); 7830 } 7831 /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ delete() { 7832 throw new ReadonlyURLSearchParamsError(); 7833 } 7834 /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ set() { 7835 throw new ReadonlyURLSearchParamsError(); 7836 } 7837 /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ sort() { 7838 throw new ReadonlyURLSearchParamsError(); 7839 } 7840} 7841if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 7842 Object.defineProperty(exports.default, "__esModule", { 7843 value: true 7844 }); 7845 Object.assign(exports.default, exports); 7846 module.exports = exports.default; 7847} //# sourceMappingURL=navigation.react-server.js.map 7848 7849 7850/***/ }), 7851 7852/***/ 3394: 7853/***/ (function(module, exports) { 7854 7855"use strict"; 7856 7857Object.defineProperty(exports, "__esModule", ({ 7858 value: true 7859})); 78600 && (0); 7861function _export(target, all) { 7862 for(var name in all)Object.defineProperty(target, name, { 7863 enumerable: true, 7864 get: all[name] 7865 }); 7866} 7867_export(exports, { 7868 isNotFoundError: function() { 7869 return isNotFoundError; 7870 }, 7871 notFound: function() { 7872 return notFound; 7873 } 7874}); 7875const NOT_FOUND_ERROR_CODE = "NEXT_NOT_FOUND"; 7876function notFound() { 7877 // eslint-disable-next-line no-throw-literal 7878 const error = new Error(NOT_FOUND_ERROR_CODE); 7879 error.digest = NOT_FOUND_ERROR_CODE; 7880 throw error; 7881} 7882function isNotFoundError(error) { 7883 if (typeof error !== "object" || error === null || !("digest" in error)) { 7884 return false; 7885 } 7886 return error.digest === NOT_FOUND_ERROR_CODE; 7887} 7888if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 7889 Object.defineProperty(exports.default, "__esModule", { 7890 value: true 7891 }); 7892 Object.assign(exports.default, exports); 7893 module.exports = exports.default; 7894} //# sourceMappingURL=not-found.js.map 7895 7896 7897/***/ }), 7898 7899/***/ 4234: 7900/***/ (function(module, exports) { 7901 7902"use strict"; 7903 7904Object.defineProperty(exports, "__esModule", ({ 7905 value: true 7906})); 7907Object.defineProperty(exports, "RedirectStatusCode", ({ 7908 enumerable: true, 7909 get: function() { 7910 return RedirectStatusCode; 7911 } 7912})); 7913var RedirectStatusCode; 7914(function(RedirectStatusCode) { 7915 RedirectStatusCode[RedirectStatusCode["SeeOther"] = 303] = "SeeOther"; 7916 RedirectStatusCode[RedirectStatusCode["TemporaryRedirect"] = 307] = "TemporaryRedirect"; 7917 RedirectStatusCode[RedirectStatusCode["PermanentRedirect"] = 308] = "PermanentRedirect"; 7918})(RedirectStatusCode || (RedirectStatusCode = {})); 7919if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 7920 Object.defineProperty(exports.default, "__esModule", { 7921 value: true 7922 });
7923 Object.assign(exports.default, exports); 7924 module.exports = exports.default; 7925} //# sourceMappingURL=redirect-status-code.js.map 7926 7927 7928/***/ }), 7929 7930/***/ 7511: 7931/***/ (function(module, exports, __webpack_require__) { 7932 7933"use strict"; 7934 7935Object.defineProperty(exports, "__esModule", ({ 7936 value: true 7937})); 79380 && (0); 7939function _export(target, all) { 7940 for(var name in all)Object.defineProperty(target, name, { 7941 enumerable: true, 7942 get: all[name] 7943 }); 7944} 7945_export(exports, { 7946 RedirectType: function() { 7947 return RedirectType; 7948 }, 7949 getRedirectError: function() { 7950 return getRedirectError; 7951 }, 7952 getRedirectStatusCodeFromError: function() { 7953 return getRedirectStatusCodeFromError; 7954 }, 7955 getRedirectTypeFromError: function() { 7956 return getRedirectTypeFromError; 7957 }, 7958 getURLFromRedirectError: function() { 7959 return getURLFromRedirectError; 7960 }, 7961 isRedirectError: function() { 7962 return isRedirectError; 7963 }, 7964 permanentRedirect: function() { 7965 return permanentRedirect; 7966 }, 7967 redirect: function() { 7968 return redirect; 7969 } 7970}); 7971const _requestasyncstorageexternal = __webpack_require__(2595); 7972const _actionasyncstorageexternal = __webpack_require__(6361); 7973const _redirectstatuscode = __webpack_require__(4234); 7974const REDIRECT_ERROR_CODE = "NEXT_REDIRECT"; 7975var RedirectType; 7976(function(RedirectType) { 7977 RedirectType["push"] = "push"; 7978 RedirectType["replace"] = "replace"; 7979})(RedirectType || (RedirectType = {})); 7980function getRedirectError(url, type, statusCode) { 7981 if (statusCode === void 0) statusCode = _redirectstatuscode.RedirectStatusCode.TemporaryRedirect; 7982 const error = new Error(REDIRECT_ERROR_CODE); 7983 error.digest = REDIRECT_ERROR_CODE + ";" + type + ";" + url + ";" + statusCode + ";"; 7984 const requestStore = _requestasyncstorageexternal.requestAsyncStorage.getStore(); 7985 if (requestStore) { 7986 error.mutableCookies = requestStore.mutableCookies; 7987 } 7988 return error; 7989} 7990function redirect(/** The URL to redirect to */ url, type) { 7991 if (type === void 0) type = "replace"; 7992 const actionStore = _actionasyncstorageexternal.actionAsyncStorage.getStore(); 7993 throw getRedirectError(url, type, // as we don't want the POST request to follow the redirect, 7994 // as it could result in erroneous re-submissions. 7995 (actionStore == null ? void 0 : actionStore.isAction) ? _redirectstatuscode.RedirectStatusCode.SeeOther : _redirectstatuscode.RedirectStatusCode.TemporaryRedirect); 7996} 7997function permanentRedirect(/** The URL to redirect to */ url, type) { 7998 if (type === void 0) type = "replace"; 7999 const actionStore = _actionasyncstorageexternal.actionAsyncStorage.getStore(); 8000 throw getRedirectError(url, type, // as we don't want the POST request to follow the redirect, 8001 // as it could result in erroneous re-submissions. 8002 (actionStore == null ? void 0 : actionStore.isAction) ? _redirectstatuscode.RedirectStatusCode.SeeOther : _redirectstatuscode.RedirectStatusCode.PermanentRedirect); 8003} 8004function isRedirectError(error) { 8005 if (typeof error !== "object" || error === null || !("digest" in error) || typeof error.digest !== "string") { 8006 return false; 8007 } 8008 const [errorCode, type, destination, status] = error.digest.split(";", 4); 8009 const statusCode = Number(status); 8010 return errorCode === REDIRECT_ERROR_CODE && (type === "replace" || type === "push") && typeof destination === "string" && !isNaN(statusCode) && statusCode in _redirectstatuscode.RedirectStatusCode; 8011} 8012function getURLFromRedirectError(error) { 8013 if (!isRedirectError(error)) return null; 8014 // Slices off the beginning of the digest that contains the code and the 8015 // separating ';'. 8016 return error.digest.split(";", 3)[2]; 8017} 8018function getRedirectTypeFromError(error) { 8019 if (!isRedirectError(error)) { 8020 throw new Error("Not a redirect error"); 8021 } 8022 return error.digest.split(";", 2)[1]; 8023} 8024function getRedirectStatusCodeFromError(error) { 8025 if (!isRedirectError(error)) { 8026 throw new Error("Not a redirect error"); 8027 } 8028 return Number(error.digest.split(";", 4)[3]); 8029} 8030if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 8031 Object.defineProperty(exports.default, "__esModule", { 8032 value: true 8033 });
8034 Object.assign(exports.default, exports); 8035 module.exports = exports.default; 8036} //# sourceMappingURL=redirect.js.map 8037 8038 8039/***/ }), 8040 8041/***/ 5329: 8042/***/ (function(module, exports, __webpack_require__) { 8043 8044"use strict"; 8045 8046Object.defineProperty(exports, "__esModule", ({ 8047 value: true 8048})); 8049Object.defineProperty(exports, "requestAsyncStorage", ({ 8050 enumerable: true, 8051 get: function() { 8052 return requestAsyncStorage; 8053 } 8054})); 8055const _asynclocalstorage = __webpack_require__(4001); 8056const requestAsyncStorage = (0, _asynclocalstorage.createAsyncLocalStorage)(); 8057if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 8058 Object.defineProperty(exports.default, "__esModule", { 8059 value: true 8060 }); 8061 Object.assign(exports.default, exports); 8062 module.exports = exports.default; 8063} //# sourceMappingURL=request-async-storage-instance.js.map 8064 8065 8066/***/ }), 8067 8068/***/ 2595: 8069/***/ (function(module, exports, __webpack_require__) { 8070 8071"TURBOPACK { transition: next-shared }"; 8072"use strict"; 8073Object.defineProperty(exports, "__esModule", ({ 8074 value: true 8075})); 80760 && (0); 8077function _export(target, all) { 8078 for(var name in all)Object.defineProperty(target, name, { 8079 enumerable: true, 8080 get: all[name] 8081 }); 8082} 8083_export(exports, { 8084 getExpectedRequestStore: function() { 8085 return getExpectedRequestStore; 8086 }, 8087 requestAsyncStorage: function() { 8088 return _requestasyncstorageinstance.requestAsyncStorage; 8089 } 8090}); 8091const _requestasyncstorageinstance = __webpack_require__(5329); 8092function getExpectedRequestStore(callingExpression) { 8093 const store = _requestasyncstorageinstance.requestAsyncStorage.getStore(); 8094 if (store) return store; 8095 throw new Error("`" + callingExpression + "` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context"); 8096} 8097if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 8098 Object.defineProperty(exports.default, "__esModule", { 8099 value: true 8100 }); 8101 Object.assign(exports.default, exports); 8102 module.exports = exports.default; 8103} //# sourceMappingURL=request-async-storage.external.js.map 8104 8105 8106/***/ }), 8107 8108/***/ 1288: 8109/***/ (function(module, exports) { 8110 8111"use strict"; 8112 8113Object.defineProperty(exports, "__esModule", ({ 8114 value: true 8115})); 8116Object.defineProperty(exports, "getSegmentValue", ({ 8117 enumerable: true, 8118 get: function() { 8119 return getSegmentValue; 8120 } 8121})); 8122function getSegmentValue(segment) { 8123 return Array.isArray(segment) ? segment[1] : segment; 8124} 8125if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 8126 Object.defineProperty(exports.default, "__esModule", { 8127 value: true 8128 }); 8129 Object.assign(exports.default, exports); 8130 module.exports = exports.default; 8131} //# sourceMappingURL=get-segment-value.js.map 8132 8133 8134/***/ }), 8135 8136/***/ 4080: 8137/***/ (function(module, exports, __webpack_require__) { 8138 8139"use strict"; 8140/* __next_internal_client_entry_do_not_use__ cjs */ 8141Object.defineProperty(exports, "__esModule", ({ 8142 value: true 8143})); 8144Object.defineProperty(exports, "Image", ({ 8145 enumerable: true, 8146 get: function() { 8147 return Image; 8148 } 8149})); 8150const _interop_require_default = __webpack_require__(8754); 8151const _interop_require_wildcard = __webpack_require__(1757); 8152const _jsxruntime = __webpack_require__(5893); 8153const _react = /*#__PURE__*/ _interop_require_wildcard._(__webpack_require__(7294)); 8154const _reactdom = /*#__PURE__*/ _interop_require_default._(__webpack_require__(3935)); 8155const _head = /*#__PURE__*/ _interop_require_default._(__webpack_require__(3867)); 8156const _getimgprops = __webpack_require__(5283); 8157const _imageconfig = __webpack_require__(6594); 8158const _imageconfigcontextsharedruntime = __webpack_require__(3945); 8159const _warnonce = __webpack_require__(3179); 8160const _routercontextsharedruntime = __webpack_require__(1928); 8161const _imageloader = /*#__PURE__*/ _interop_require_default._(__webpack_require__(3872)); 8162// This is replaced by webpack define plugin 8163const configEnv = {"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","dangerouslyAllowSVG":false,"unoptimized":false}; 8164if (false) {} 8165// See https://stackoverflow.com/q/39777833/266535 for why we use this ref 8166// handler instead of the img's onLoad attribute. 8167function handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput) { 8168 const src = img == null ? void 0 : img.src; 8169 if (!img || img["data-loaded-src"] === src) { 8170 return; 8171 } 8172 img["data-loaded-src"] = src; 8173 const p = "decode" in img ? img.decode() : Promise.resolve(); 8174 p.catch(()=>{}).then(()=>{ 8175 if (!img.parentElement || !img.isConnected) { 8176 // Exit early in case of race condition: 8177 // - onload() is called 8178 // - decode() is called but incomplete 8179 // - unmount is called 8180 // - decode() completes 8181 return; 8182 } 8183 if (placeholder !== "empty") { 8184 setBlurComplete(true); 8185 } 8186 if (onLoadRef == null ? void 0 : onLoadRef.current) { 8187 // Since we don't have the SyntheticEvent here, 8188 // we must create one with the same shape. 8189 // See https://reactjs.org/docs/events.html 8190 const event = new Event("load"); 8191 Object.defineProperty(event, "target", { 8192 writable: false, 8193 value: img 8194 }); 8195 let prevented = false;
8196 let stopped = false; 8197 onLoadRef.current({ 8198 ...event, 8199 nativeEvent: event, 8200 currentTarget: img, 8201 target: img, 8202 isDefaultPrevented: ()=>prevented, 8203 isPropagationStopped: ()=>stopped, 8204 persist: ()=>{}, 8205 preventDefault: ()=>{ 8206 prevented = true; 8207 event.preventDefault(); 8208 }, 8209 stopPropagation: ()=>{ 8210 stopped = true; 8211 event.stopPropagation(); 8212 } 8213 }); 8214 } 8215 if (onLoadingCompleteRef == null ? void 0 : onLoadingCompleteRef.current) { 8216 onLoadingCompleteRef.current(img); 8217 } 8218 if (false) {} 8219 }); 8220} 8221function getDynamicProps(fetchPriority) { 8222 if (Boolean(_react.use)) { 8223 // In React 19.0.0 or newer, we must use camelCase 8224 // prop to avoid "Warning: Invalid DOM property". 8225 // See https://github.com/facebook/react/pull/25927 8226 return { 8227 fetchPriority 8228 }; 8229 } 8230 // In React 18.2.0 or older, we must use lowercase prop 8231 // to avoid "Warning: Invalid DOM property". 8232 return { 8233 fetchpriority: fetchPriority 8234 }; 8235} 8236const ImageElement = /*#__PURE__*/ (0, _react.forwardRef)((param, forwardedRef)=>{ 8237 let { src, srcSet, sizes, height, width, decoding, className, style, fetchPriority, placeholder, loading, unoptimized, fill, onLoadRef, onLoadingCompleteRef, setBlurComplete, setShowAltText, sizesInput, onLoad, onError, ...rest } = param; 8238 return /*#__PURE__*/ (0, _jsxruntime.jsx)("img", { 8239 ...rest, 8240 ...getDynamicProps(fetchPriority), 8241 // It's intended to keep `loading` before `src` because React updates 8242 // props in order which causes Safari/Firefox to not lazy load properly. 8243 // See https://github.com/facebook/react/issues/25883 8244 loading: loading, 8245 width: width, 8246 height: height, 8247 decoding: decoding, 8248 "data-nimg": fill ? "fill" : "1", 8249 className: className, 8250 style: style, 8251 // It's intended to keep `src` the last attribute because React updates 8252 // attributes in order. If we keep `src` the first one, Safari will 8253 // immediately start to fetch `src`, before `sizes` and `srcSet` are even 8254 // updated by React. That causes multiple unnecessary requests if `srcSet` 8255 // and `sizes` are defined. 8256 // This bug cannot be reproduced in Chrome or Firefox. 8257 sizes: sizes, 8258 srcSet: srcSet, 8259 src: src, 8260 ref: (0, _react.useCallback)((img)=>{ 8261 if (forwardedRef) { 8262 if (typeof forwardedRef === "function") forwardedRef(img); 8263 else if (typeof forwardedRef === "object") { 8264 // @ts-ignore - .current is read only it's usually assigned by react internally 8265 forwardedRef.current = img; 8266 } 8267 } 8268 if (!img) { 8269 return; 8270 } 8271 if (onError) { 8272 // If the image has an error before react hydrates, then the error is lost. 8273 // The workaround is to wait until the image is mounted which is after hydration, 8274 // then we set the src again to trigger the error handler (if there was an error). 8275 // eslint-disable-next-line no-self-assign 8276 img.src = img.src; 8277 } 8278 if (false) {} 8279 if (img.complete) { 8280 handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput); 8281 } 8282 }, [ 8283 src, 8284 placeholder, 8285 onLoadRef, 8286 onLoadingCompleteRef, 8287 setBlurComplete, 8288 onError, 8289 unoptimized, 8290 sizesInput, 8291 forwardedRef 8292 ]), 8293 onLoad: (event)=>{ 8294 const img = event.currentTarget; 8295 handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput); 8296 }, 8297 onError: (event)=>{ 8298 // if the real image fails to load, this will ensure "alt" is visible 8299 setShowAltText(true); 8300 if (placeholder !== "empty") { 8301 // If the real image fails to load, this will still remove the placeholder. 8302 setBlurComplete(true); 8303 } 8304 if (onError) { 8305 onError(event); 8306 } 8307 } 8308 }); 8309}); 8310function ImagePreload(param) { 8311 let { isAppRouter, imgAttributes } = param; 8312 const opts = { 8313 as: "image", 8314 imageSrcSet: imgAttributes.srcSet, 8315 imageSizes: imgAttributes.sizes, 8316 crossOrigin: imgAttributes.crossOrigin, 8317 referrerPolicy: imgAttributes.referrerPolicy, 8318 ...getDynamicProps(imgAttributes.fetchPriority) 8319 }; 8320 if (isAppRouter && _reactdom.default.preload) { 8321 // See https://github.com/facebook/react/pull/26940 8322 _reactdom.default.preload(imgAttributes.src, opts); 8323 return null; 8324 } 8325 return /*#__PURE__*/ (0, _jsxruntime.jsx)(_head.default, { 8326 children: /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { 8327 rel: "preload", 8328 // Note how we omit the `href` attribute, as it would only be relevant 8329 // for browsers that do not support `imagesrcset`, and in those cases 8330 // it would cause the incorrect image to be preloaded. 8331 // 8332 // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset 8333 href: imgAttributes.srcSet ? undefined : imgAttributes.src, 8334 ...opts 8335 }, "__nimg-" + imgAttributes.src + imgAttributes.srcSet + imgAttributes.sizes) 8336 }); 8337} 8338const Image = /*#__PURE__*/ (0, _react.forwardRef)((props, forwardedRef)=>{ 8339 const pagesRouter = (0, _react.useContext)(_routercontextsharedruntime.RouterContext); 8340 // We're in the app directory if there is no pages router. 8341 const isAppRouter = !pagesRouter; 8342 const configContext = (0, _react.useContext)(_imageconfigcontextsharedruntime.ImageConfigContext); 8343 const config = (0, _react.useMemo)(()=>{ 8344 var _c_qualities; 8345 const c = configEnv || configContext || _imageconfig.imageConfigDefault; 8346 const allSizes = [ 8347 ...c.deviceSizes, 8348 ...c.imageSizes 8349 ].sort((a, b)=>a - b); 8350 const deviceSizes = c.deviceSizes.sort((a, b)=>a - b); 8351 const qualities = (_c_qualities = c.qualities) == null ? void 0 : _c_qualities.sort((a, b)=>a - b); 8352 return { 8353 ...c, 8354 allSizes, 8355 deviceSizes, 8356 qualities 8357 }; 8358 }, [ 8359 configContext 8360 ]); 8361 const { onLoad, onLoadingComplete } = props; 8362 const onLoadRef = (0, _react.useRef)(onLoad); 8363 (0, _react.useEffect)(()=>{ 8364 onLoadRef.current = onLoad; 8365 }, [ 8366 onLoad 8367 ]); 8368 const onLoadingCompleteRef = (0, _react.useRef)(onLoadingComplete); 8369 (0, _react.useEffect)(()=>{ 8370 onLoadingCompleteRef.current = onLoadingComplete; 8371 }, [ 8372 onLoadingComplete 8373 ]); 8374 const [blurComplete, setBlurComplete] = (0, _react.useState)(false); 8375 const [showAltText, setShowAltText] = (0, _react.useState)(false); 8376 const { props: imgAttributes, meta: imgMeta } = (0, _getimgprops.getImgProps)(props, { 8377 defaultLoader: _imageloader.default, 8378 imgConf: config, 8379 blurComplete, 8380 showAltText 8381 }); 8382 return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { 8383 children: [ 8384 /*#__PURE__*/ (0, _jsxruntime.jsx)(ImageElement, { 8385 ...imgAttributes, 8386 unoptimized: imgMeta.unoptimized, 8387 placeholder: imgMeta.placeholder, 8388 fill: imgMeta.fill, 8389 onLoadRef: onLoadRef, 8390 onLoadingCompleteRef: onLoadingCompleteRef, 8391 setBlurComplete: setBlurComplete, 8392 setShowAltText: setShowAltText, 8393 sizesInput: props.sizes, 8394 ref: forwardedRef 8395 }), 8396 imgMeta.priority ? /*#__PURE__*/ (0, _jsxruntime.jsx)(ImagePreload, { 8397 isAppRouter: isAppRouter, 8398 imgAttributes: imgAttributes 8399 }) : null 8400 ] 8401 }); 8402}); 8403if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 8404 Object.defineProperty(exports.default, "__esModule", { 8405 value: true 8406 });
8407 Object.assign(exports.default, exports); 8408 module.exports = exports.default; 8409} //# sourceMappingURL=image-component.js.map 8410 8411 8412/***/ }), 8413 8414/***/ 5283: 8415/***/ (function(__unused_webpack_module, exports, __webpack_require__) { 8416 8417"use strict"; 8418 8419Object.defineProperty(exports, "__esModule", ({ 8420 value: true 8421})); 8422Object.defineProperty(exports, "getImgProps", ({ 8423 enumerable: true, 8424 get: function() { 8425 return getImgProps; 8426 } 8427})); 8428const _warnonce = __webpack_require__(3179); 8429const _imageblursvg = __webpack_require__(6630); 8430const _imageconfig = __webpack_require__(6594); 8431const VALID_LOADING_VALUES = (/* unused pure expression or super */ null && ([ 8432 "lazy", 8433 "eager", 8434 undefined 8435])); 8436function isStaticRequire(src) { 8437 return src.default !== undefined; 8438} 8439function isStaticImageData(src) { 8440 return src.src !== undefined; 8441} 8442function isStaticImport(src) { 8443 return typeof src === "object" && (isStaticRequire(src) || isStaticImageData(src)); 8444} 8445const allImgs = new Map(); 8446let perfObserver; 8447function getInt(x) { 8448 if (typeof x === "undefined") { 8449 return x; 8450 } 8451 if (typeof x === "number") { 8452 return Number.isFinite(x) ? x : NaN; 8453 } 8454 if (typeof x === "string" && /^[0-9]+$/.test(x)) { 8455 return parseInt(x, 10); 8456 } 8457 return NaN; 8458} 8459function getWidths(param, width, sizes) { 8460 let { deviceSizes, allSizes } = param; 8461 if (sizes) { 8462 // Find all the "vw" percent sizes used in the sizes prop 8463 const viewportWidthRe = /(^|\s)(1?\d?\d)vw/g; 8464 const percentSizes = []; 8465 for(let match; match = viewportWidthRe.exec(sizes); match){ 8466 percentSizes.push(parseInt(match[2])); 8467 } 8468 if (percentSizes.length) { 8469 const smallestRatio = Math.min(...percentSizes) * 0.01; 8470 return { 8471 widths: allSizes.filter((s)=>s >= deviceSizes[0] * smallestRatio), 8472 kind: "w" 8473 }; 8474 } 8475 return { 8476 widths: allSizes, 8477 kind: "w" 8478 }; 8479 } 8480 if (typeof width !== "number") { 8481 return { 8482 widths: deviceSizes, 8483 kind: "w" 8484 }; 8485 } 8486 const widths = [ 8487 ...new Set(// > are actually 3x in the green color, but only 1.5x in the red and 8488 // > blue colors. Showing a 3x resolution image in the app vs a 2x 8489 // > resolution image will be visually the same, though the 3x image 8490 // > takes significantly more data. Even true 3x resolution screens are 8491 // > wasteful as the human eye cannot see that level of detail without 8492 // > something like a magnifying glass. 8493 // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html 8494 [ 8495 width, 8496 width * 2 /*, width * 3*/ 8497 ].map((w)=>allSizes.find((p)=>p >= w) || allSizes[allSizes.length - 1])) 8498 ]; 8499 return { 8500 widths, 8501 kind: "x" 8502 }; 8503} 8504function generateImgAttrs(param) { 8505 let { config, src, unoptimized, width, quality, sizes, loader } = param; 8506 if (unoptimized) { 8507 return { 8508 src, 8509 srcSet: undefined, 8510 sizes: undefined 8511 }; 8512 } 8513 const { widths, kind } = getWidths(config, width, sizes); 8514 const last = widths.length - 1; 8515 return { 8516 sizes: !sizes && kind === "w" ? "100vw" : sizes, 8517 srcSet: widths.map((w, i)=>loader({ 8518 config, 8519 src, 8520 quality, 8521 width: w 8522 }) + " " + (kind === "w" ? w : i + 1) + kind).join(", "), 8523 // It's intended to keep `src` the last attribute because React updates 8524 // attributes in order. If we keep `src` the first one, Safari will 8525 // immediately start to fetch `src`, before `sizes` and `srcSet` are even 8526 // updated by React. That causes multiple unnecessary requests if `srcSet` 8527 // and `sizes` are defined. 8528 // This bug cannot be reproduced in Chrome or Firefox. 8529 src: loader({ 8530 config, 8531 src, 8532 quality, 8533 width: widths[last] 8534 }) 8535 }; 8536} 8537function getImgProps(param, _state) { 8538 let { src, sizes, unoptimized = false, priority = false, loading, className, quality, width, height, fill = false, style, overrideSrc, onLoad, onLoadingComplete, placeholder = "empty", blurDataURL, fetchPriority, decoding = "async", layout, objectFit, objectPosition, lazyBoundary, lazyRoot, ...rest } = param; 8539 const { imgConf, showAltText, blurComplete, defaultLoader } = _state;
8540 let config; 8541 let c = imgConf || _imageconfig.imageConfigDefault; 8542 if ("allSizes" in c) { 8543 config = c; 8544 } else { 8545 var _c_qualities; 8546 const allSizes = [ 8547 ...c.deviceSizes, 8548 ...c.imageSizes 8549 ].sort((a, b)=>a - b); 8550 const deviceSizes = c.deviceSizes.sort((a, b)=>a - b); 8551 const qualities = (_c_qualities = c.qualities) == null ? void 0 : _c_qualities.sort((a, b)=>a - b); 8552 config = { 8553 ...c, 8554 allSizes, 8555 deviceSizes, 8556 qualities 8557 }; 8558 } 8559 if (typeof defaultLoader === "undefined") { 8560 throw new Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"); 8561 } 8562 let loader = rest.loader || defaultLoader; 8563 // Remove property so it's not spread on <img> element 8564 delete rest.loader; 8565 delete rest.srcSet; 8566 // This special value indicates that the user 8567 // didn't define a "loader" prop or "loader" config. 8568 const isDefaultLoader = "__next_img_default" in loader; 8569 if (isDefaultLoader) { 8570 if (config.loader === "custom") { 8571 throw new Error('Image with src "' + src + '" is missing "loader" prop.' + "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader"); 8572 } 8573 } else { 8574 // The user defined a "loader" prop or config. 8575 // Since the config object is internal only, we 8576 // must not pass it to the user-defined "loader". 8577 const customImageLoader = loader; 8578 loader = (obj)=>{ 8579 const { config: _, ...opts } = obj; 8580 return customImageLoader(opts); 8581 }; 8582 } 8583 if (layout) { 8584 if (layout === "fill") { 8585 fill = true; 8586 } 8587 const layoutToStyle = { 8588 intrinsic: { 8589 maxWidth: "100%", 8590 height: "auto" 8591 }, 8592 responsive: { 8593 width: "100%", 8594 height: "auto" 8595 } 8596 }; 8597 const layoutToSizes = { 8598 responsive: "100vw", 8599 fill: "100vw" 8600 }; 8601 const layoutStyle = layoutToStyle[layout]; 8602 if (layoutStyle) { 8603 style = { 8604 ...style, 8605 ...layoutStyle 8606 }; 8607 } 8608 const layoutSizes = layoutToSizes[layout]; 8609 if (layoutSizes && !sizes) { 8610 sizes = layoutSizes; 8611 } 8612 } 8613 let staticSrc = ""; 8614 let widthInt = getInt(width); 8615 let heightInt = getInt(height); 8616 let blurWidth; 8617 let blurHeight; 8618 if (isStaticImport(src)) { 8619 const staticImageData = isStaticRequire(src) ? src.default : src; 8620 if (!staticImageData.src) { 8621 throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " + JSON.stringify(staticImageData)); 8622 } 8623 if (!staticImageData.height || !staticImageData.width) { 8624 throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " + JSON.stringify(staticImageData)); 8625 } 8626 blurWidth = staticImageData.blurWidth; 8627 blurHeight = staticImageData.blurHeight; 8628 blurDataURL = blurDataURL || staticImageData.blurDataURL; 8629 staticSrc = staticImageData.src; 8630 if (!fill) { 8631 if (!widthInt && !heightInt) { 8632 widthInt = staticImageData.width; 8633 heightInt = staticImageData.height; 8634 } else if (widthInt && !heightInt) { 8635 const ratio = widthInt / staticImageData.width; 8636 heightInt = Math.round(staticImageData.height * ratio); 8637 } else if (!widthInt && heightInt) { 8638 const ratio = heightInt / staticImageData.height; 8639 widthInt = Math.round(staticImageData.width * ratio); 8640 } 8641 } 8642 } 8643 src = typeof src === "string" ? src : staticSrc; 8644 let isLazy = !priority && (loading === "lazy" || typeof loading === "undefined"); 8645 if (!src || src.startsWith("data:") || src.startsWith("blob:")) { 8646 // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs 8647 unoptimized = true; 8648 isLazy = false;
8649 } 8650 if (config.unoptimized) { 8651 unoptimized = true; 8652 } 8653 if (isDefaultLoader && src.endsWith(".svg") && !config.dangerouslyAllowSVG) { 8654 // Special case to make svg serve as-is to avoid proxying 8655 // through the built-in Image Optimization API. 8656 unoptimized = true; 8657 } 8658 if (priority) { 8659 fetchPriority = "high"; 8660 } 8661 const qualityInt = getInt(quality); 8662 if (false) {} 8663 const imgStyle = Object.assign(fill ? { 8664 position: "absolute", 8665 height: "100%", 8666 width: "100%", 8667 left: 0, 8668 top: 0, 8669 right: 0, 8670 bottom: 0, 8671 objectFit, 8672 objectPosition 8673 } : {}, showAltText ? {} : { 8674 color: "transparent" 8675 }, style); 8676 const backgroundImage = !blurComplete && placeholder !== "empty" ? placeholder === "blur" ? 'url("data:image/svg+xml;charset=utf-8,' + (0, _imageblursvg.getImageBlurSvg)({ 8677 widthInt, 8678 heightInt, 8679 blurWidth, 8680 blurHeight, 8681 blurDataURL: blurDataURL || "", 8682 objectFit: imgStyle.objectFit 8683 }) + '")' : 'url("' + placeholder + '")' // assume `data:image/` 8684 : null; 8685 let placeholderStyle = backgroundImage ? { 8686 backgroundSize: imgStyle.objectFit || "cover", 8687 backgroundPosition: imgStyle.objectPosition || "50% 50%", 8688 backgroundRepeat: "no-repeat", 8689 backgroundImage 8690 } : {}; 8691 if (false) {} 8692 const imgAttributes = generateImgAttrs({ 8693 config, 8694 src, 8695 unoptimized, 8696 width: widthInt, 8697 quality: qualityInt, 8698 sizes, 8699 loader 8700 }); 8701 if (false) {} 8702 const props = { 8703 ...rest, 8704 loading: isLazy ? "lazy" : loading, 8705 fetchPriority, 8706 width: widthInt, 8707 height: heightInt, 8708 decoding, 8709 className, 8710 style: { 8711 ...imgStyle, 8712 ...placeholderStyle 8713 }, 8714 sizes: imgAttributes.sizes, 8715 srcSet: imgAttributes.srcSet, 8716 src: overrideSrc || imgAttributes.src 8717 }; 8718 const meta = { 8719 unoptimized, 8720 priority, 8721 placeholder, 8722 fill 8723 }; 8724 return { 8725 props, 8726 meta 8727 }; 8728} //# sourceMappingURL=get-img-props.js.map 8729 8730 8731/***/ }), 8732 8733/***/ 6630: 8734/***/ (function(__unused_webpack_module, exports) { 8735 8736"use strict"; 8737/** 8738 * A shared function, used on both client and server, to generate a SVG blur placeholder. 8739 */ 8740Object.defineProperty(exports, "__esModule", ({ 8741 value: true 8742})); 8743Object.defineProperty(exports, "getImageBlurSvg", ({ 8744 enumerable: true, 8745 get: function() { 8746 return getImageBlurSvg; 8747 } 8748})); 8749function getImageBlurSvg(param) { 8750 let { widthInt, heightInt, blurWidth, blurHeight, blurDataURL, objectFit } = param; 8751 const std = 20; 8752 const svgWidth = blurWidth ? blurWidth * 40 : widthInt; 8753 const svgHeight = blurHeight ? blurHeight * 40 : heightInt; 8754 const viewBox = svgWidth && svgHeight ? "viewBox='0 0 " + svgWidth + " " + svgHeight + "'" : ""; 8755 const preserveAspectRatio = viewBox ? "none" : objectFit === "contain" ? "xMidYMid" : objectFit === "cover" ? "xMidYMid slice" : "none"; 8756 return "%3Csvg xmlns='http://www.w3.org/2000/svg' " + viewBox + "%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='" + std + "'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='" + std + "'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='" + preserveAspectRatio + "' style='filter: url(%23b);' href='" + blurDataURL + "'/%3E%3C/svg%3E"; 8757} //# sourceMappingURL=image-blur-svg.js.map 8758 8759 8760/***/ }), 8761 8762/***/ 6210: 8763/***/ (function(__unused_webpack_module, exports, __webpack_require__) { 8764 8765"use strict"; 8766 8767Object.defineProperty(exports, "__esModule", ({ 8768 value: true 8769})); 87700 && (0); 8771function _export(target, all) { 8772 for(var name in all)Object.defineProperty(target, name, { 8773 enumerable: true, 8774 get: all[name] 8775 }); 8776} 8777_export(exports, { 8778 default: function() { 8779 return _default; 8780 }, 8781 getImageProps: function() { 8782 return getImageProps; 8783 } 8784}); 8785const _interop_require_default = __webpack_require__(8754); 8786const _getimgprops = __webpack_require__(5283); 8787const _imagecomponent = __webpack_require__(4080); 8788const _imageloader = /*#__PURE__*/ _interop_require_default._(__webpack_require__(3872)); 8789function getImageProps(imgProps) { 8790 const { props } = (0, _getimgprops.getImgProps)(imgProps, { 8791 defaultLoader: _imageloader.default, 8792 // This is replaced by webpack define plugin 8793 imgConf: {"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","dangerouslyAllowSVG":false,"unoptimized":false} 8794 }); 8795 // Normally we don't care about undefined props because we pass to JSX, 8796 // but this exported function could be used by the end user for anything 8797 // so we delete undefined props to clean it up a little. 8798 for (const [key, value] of Object.entries(props)){ 8799 if (value === undefined) { 8800 delete props[key]; 8801 } 8802 } 8803 return { 8804 props 8805 }; 8806} 8807const _default = _imagecomponent.Image; //# sourceMappingURL=image-external.js.map 8808 8809 8810/***/ }), 8811 8812/***/ 3872:
8813/***/ (function(__unused_webpack_module, exports) { 8814 8815"use strict"; 8816 8817Object.defineProperty(exports, "__esModule", ({ 8818 value: true 8819})); 8820Object.defineProperty(exports, "default", ({ 8821 enumerable: true, 8822 get: function() { 8823 return _default; 8824 } 8825})); 8826const DEFAULT_Q = 75; 8827function defaultLoader(param) { 8828 let { config, src, width, quality } = param; 8829 var _config_qualities; 8830 if (false) {} 8831 const q = quality || ((_config_qualities = config.qualities) == null ? void 0 : _config_qualities.reduce((prev, cur)=>Math.abs(cur - DEFAULT_Q) < Math.abs(prev - DEFAULT_Q) ? cur : prev)) || DEFAULT_Q; 8832 return config.path + "?url=" + encodeURIComponent(src) + "&w=" + width + "&q=" + q + ( false ? 0 : ""); 8833} 8834// We use this to determine if the import is the default loader 8835// or a custom loader defined by the user in next.config.js 8836defaultLoader.__next_img_default = true; 8837const _default = defaultLoader; //# sourceMappingURL=image-loader.js.map 8838 8839 8840/***/ }), 8841 8842/***/ 5988: 8843/***/ (function(__unused_webpack_module, exports, __webpack_require__) { 8844 8845"use strict"; 8846/* __next_internal_client_entry_do_not_use__ cjs */ 8847Object.defineProperty(exports, "__esModule", ({ 8848 value: true 8849})); 88500 && (0); 8851function _export(target, all) { 8852 for(var name in all)Object.defineProperty(target, name, { 8853 enumerable: true, 8854 get: all[name] 8855 }); 8856} 8857_export(exports, { 8858 ServerInsertedHTMLContext: function() { 8859 return ServerInsertedHTMLContext; 8860 }, 8861 useServerInsertedHTML: function() { 8862 return useServerInsertedHTML; 8863 } 8864}); 8865const _interop_require_wildcard = __webpack_require__(1757); 8866const _react = /*#__PURE__*/ _interop_require_wildcard._(__webpack_require__(7294)); 8867const ServerInsertedHTMLContext = /*#__PURE__*/ _react.default.createContext(null); 8868function useServerInsertedHTML(callback) { 8869 const addInsertedServerHTMLCallback = (0, _react.useContext)(ServerInsertedHTMLContext); 8870 // Should have no effects on client where there's no flush effects provider 8871 if (addInsertedServerHTMLCallback) { 8872 addInsertedServerHTMLCallback(callback); 8873 } 8874} //# sourceMappingURL=server-inserted-html.shared-runtime.js.map 8875 8876 8877/***/ }), 8878 8879/***/ 7677: 8880/***/ (function() { 8881 8882// extracted by mini-css-extract-plugin 8883 8884/***/ }), 8885 8886/***/ 9008: 8887/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 8888 8889module.exports = __webpack_require__(3867) 8890 8891 8892/***/ }), 8893 8894/***/ 5675: 8895/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 8896 8897module.exports = __webpack_require__(6210) 8898 8899 8900/***/ }), 8901 8902/***/ 9332: 8903/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 8904 8905module.exports = __webpack_require__(8199) 8906 8907 8908/***/ }), 8909 8910/***/ 1163: 8911/***/ (function(module, __unused_webpack_exports, __webpack_require__) { 8912 8913module.exports = __webpack_require__(3079) 8914 8915 8916/***/ }), 8917 8918/***/ 6223: 8919/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 8920 8921"use strict"; 8922 8923// EXPORTS 8924__webpack_require__.d(__webpack_exports__, { 8925 Z: function() { return /* binding */ Combination; } 8926}); 8927 8928;// CONCATENATED MODULE:
vendor: 7,855 bytes, lines 8928-9077
8928 ./node_modules/tslib/tslib.es6.mjs 8929/****************************************************************************** 8930Copyright (c) Microsoft Corporation. 8931 8932Permission to use, copy, modify, and/or distribute this software for any 8933purpose with or without fee is hereby granted. 8934 8935THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8936REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 8937AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 8938INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 8939LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 8940OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 8941PERFORMANCE OF THIS SOFTWARE. 8942***************************************************************************** */ 8943/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 8944 8945var extendStatics = function(d, b) { 8946 extendStatics = Object.setPrototypeOf || 8947 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 8948 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 8949 return extendStatics(d, b); 8950}; 8951 8952function __extends(d, b) { 8953 if (typeof b !== "function" && b !== null) 8954 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 8955 extendStatics(d, b); 8956 function __() { this.constructor = d; } 8957 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 8958} 8959 8960var __assign = function() { 8961 __assign = Object.assign || function __assign(t) { 8962 for (var s, i = 1, n = arguments.length; i < n; i++) { 8963 s = arguments[i]; 8964 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 8965 } 8966 return t; 8967 } 8968 return __assign.apply(this, arguments); 8969} 8970 8971function __rest(s, e) { 8972 var t = {}; 8973 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 8974 t[p] = s[p]; 8975 if (s != null && typeof Object.getOwnPropertySymbols === "function") 8976 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 8977 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 8978 t[p[i]] = s[p[i]]; 8979 } 8980 return t; 8981} 8982 8983function __decorate(decorators, target, key, desc) { 8984 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 8985 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 8986 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 8987 return c > 3 && r && Object.defineProperty(target, key, r), r; 8988} 8989 8990function __param(paramIndex, decorator) { 8991 return function (target, key) { decorator(target, key, paramIndex); } 8992} 8993 8994function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { 8995 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } 8996 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; 8997 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; 8998 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); 8999 var _, done = false; 9000 for (var i = decorators.length - 1; i >= 0; i--) { 9001 var context = {}; 9002 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; 9003 for (var p in contextIn.access) context.access[p] = contextIn.access[p]; 9004 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; 9005 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); 9006 if (kind === "accessor") { 9007 if (result === void 0) continue; 9008 if (result === null || typeof result !== "object") throw new TypeError("Object expected"); 9009 if (_ = accept(result.get)) descriptor.get = _; 9010 if (_ = accept(result.set)) descriptor.set = _; 9011 if (_ = accept(result.init)) initializers.unshift(_); 9012 } 9013 else if (_ = accept(result)) { 9014 if (kind === "field") initializers.unshift(_); 9015 else descriptor[key] = _; 9016 } 9017 } 9018 if (target) Object.defineProperty(target, contextIn.name, descriptor); 9019 done = true; 9020}; 9021 9022function __runInitializers(thisArg, initializers, value) { 9023 var useValue = arguments.length > 2; 9024 for (var i = 0; i < initializers.length; i++) { 9025 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); 9026 } 9027 return useValue ? value : void 0; 9028}; 9029 9030function __propKey(x) { 9031 return typeof x === "symbol" ? x : "".concat(x); 9032}; 9033 9034function __setFunctionName(f, name, prefix) { 9035 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; 9036 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); 9037}; 9038 9039function __metadata(metadataKey, metadataValue) { 9040 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 9041} 9042 9043function __awaiter(thisArg, _arguments, P, generator) { 9044 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 9045 return new (P || (P = Promise))(function (resolve, reject) { 9046 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 9047 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 9048 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 9049 step((generator = generator.apply(thisArg, _arguments || [])).next()); 9050 }); 9051} 9052 9053function __generator(thisArg, body) { 9054 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); 9055 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 9056 function verb(n) { return function (v) { return step([n, v]); }; } 9057 function step(op) { 9058 if (f) throw new TypeError("Generator is already executing."); 9059 while (g && (g = 0, op[0] && (_ = 0)), _) try { 9060 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 9061 if (y = 0, t) op = [op[0] & 2, t.value]; 9062 switch (op[0]) { 9063 case 0: case 1: t = op; break; 9064 case 4: _.label++; return { value: op[1], done: false }; 9065 case 5: _.label++; y = op[1]; op = [0]; continue; 9066 case 7: op = _.ops.pop(); _.trys.pop(); continue; 9067 default: 9068 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 9069 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 9070 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 9071 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 9072 if (t[2]) _.ops.pop(); 9073 _.trys.pop(); continue; 9074 } 9075 op = body.call(thisArg, _); 9076 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 9077 if (op[0] & 5) throw op[1];
vendor: 4,622 bytes, lines 9077-9186
9077 return { value: op[0] ? op[1] : void 0, done: true }; 9078 } 9079} 9080 9081var __createBinding = Object.create ? (function(o, m, k, k2) { 9082 if (k2 === undefined) k2 = k; 9083 var desc = Object.getOwnPropertyDescriptor(m, k); 9084 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 9085 desc = { enumerable: true, get: function() { return m[k]; } }; 9086 } 9087 Object.defineProperty(o, k2, desc); 9088}) : (function(o, m, k, k2) { 9089 if (k2 === undefined) k2 = k; 9090 o[k2] = m[k]; 9091}); 9092 9093function __exportStar(m, o) { 9094 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 9095} 9096 9097function __values(o) { 9098 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 9099 if (m) return m.call(o); 9100 if (o && typeof o.length === "number") return { 9101 next: function () { 9102 if (o && i >= o.length) o = void 0; 9103 return { value: o && o[i++], done: !o }; 9104 } 9105 }; 9106 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 9107} 9108 9109function __read(o, n) { 9110 var m = typeof Symbol === "function" && o[Symbol.iterator]; 9111 if (!m) return o; 9112 var i = m.call(o), r, ar = [], e; 9113 try { 9114 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 9115 } 9116 catch (error) { e = { error: error }; } 9117 finally { 9118 try { 9119 if (r && !r.done && (m = i["return"])) m.call(i); 9120 } 9121 finally { if (e) throw e.error; } 9122 } 9123 return ar; 9124} 9125 9126/** @deprecated */ 9127function __spread() { 9128 for (var ar = [], i = 0; i < arguments.length; i++) 9129 ar = ar.concat(__read(arguments[i])); 9130 return ar; 9131} 9132 9133/** @deprecated */ 9134function __spreadArrays() { 9135 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 9136 for (var r = Array(s), k = 0, i = 0; i < il; i++) 9137 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 9138 r[k] = a[j]; 9139 return r; 9140} 9141 9142function __spreadArray(to, from, pack) { 9143 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 9144 if (ar || !(i in from)) { 9145 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 9146 ar[i] = from[i]; 9147 } 9148 } 9149 return to.concat(ar || Array.prototype.slice.call(from)); 9150} 9151 9152function __await(v) { 9153 return this instanceof __await ? (this.v = v, this) : new __await(v); 9154} 9155 9156function __asyncGenerator(thisArg, _arguments, generator) { 9157 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 9158 var g = generator.apply(thisArg, _arguments || []), i, q = []; 9159 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; 9160 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } 9161 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } 9162 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 9163 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 9164 function fulfill(value) { resume("next", value); } 9165 function reject(value) { resume("throw", value); } 9166 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 9167} 9168 9169function __asyncDelegator(o) { 9170 var i, p; 9171 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 9172 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } 9173} 9174 9175function __asyncValues(o) { 9176 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 9177 var m = o[Symbol.asyncIterator], i; 9178 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 9179 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 9180 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 9181} 9182 9183function __makeTemplateObject(cooked, raw) { 9184 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 9185 return cooked; 9186}
vendor: 4,521 bytes, lines 9186-9302
9186; 9187 9188var __setModuleDefault = Object.create ? (function(o, v) { 9189 Object.defineProperty(o, "default", { enumerable: true, value: v }); 9190}) : function(o, v) { 9191 o["default"] = v; 9192}; 9193 9194var ownKeys = function(o) { 9195 ownKeys = Object.getOwnPropertyNames || function (o) { 9196 var ar = []; 9197 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; 9198 return ar; 9199 }; 9200 return ownKeys(o); 9201}; 9202 9203function __importStar(mod) { 9204 if (mod && mod.__esModule) return mod; 9205 var result = {}; 9206 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); 9207 __setModuleDefault(result, mod); 9208 return result; 9209} 9210 9211function __importDefault(mod) { 9212 return (mod && mod.__esModule) ? mod : { default: mod }; 9213} 9214 9215function __classPrivateFieldGet(receiver, state, kind, f) { 9216 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 9217 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 9218 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 9219} 9220 9221function __classPrivateFieldSet(receiver, state, value, kind, f) { 9222 if (kind === "m") throw new TypeError("Private method is not writable"); 9223 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 9224 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 9225 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 9226} 9227 9228function __classPrivateFieldIn(state, receiver) { 9229 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); 9230 return typeof state === "function" ? receiver === state : state.has(receiver); 9231} 9232 9233function __addDisposableResource(env, value, async) { 9234 if (value !== null && value !== void 0) { 9235 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); 9236 var dispose, inner; 9237 if (async) { 9238 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); 9239 dispose = value[Symbol.asyncDispose]; 9240 } 9241 if (dispose === void 0) { 9242 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); 9243 dispose = value[Symbol.dispose]; 9244 if (async) inner = dispose; 9245 } 9246 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); 9247 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; 9248 env.stack.push({ value: value, dispose: dispose, async: async }); 9249 } 9250 else if (async) { 9251 env.stack.push({ async: true }); 9252 } 9253 return value; 9254} 9255 9256var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 9257 var e = new Error(message); 9258 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 9259}; 9260 9261function __disposeResources(env) { 9262 function fail(e) { 9263 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; 9264 env.hasError = true; 9265 } 9266 var r, s = 0; 9267 function next() { 9268 while (r = env.stack.pop()) { 9269 try { 9270 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); 9271 if (r.dispose) { 9272 var result = r.dispose.call(r.value); 9273 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); 9274 } 9275 else s |= 1; 9276 } 9277 catch (e) { 9278 fail(e); 9279 } 9280 } 9281 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); 9282 if (env.hasError) throw env.error; 9283 } 9284 return next(); 9285} 9286 9287function __rewriteRelativeImportExtension(path, preserveJsx) { 9288 if (typeof path === "string" && /^\.\.?\//.test(path)) { 9289 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { 9290 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); 9291 }); 9292 } 9293 return path; 9294} 9295 9296/* harmony default export */ var tslib_es6 = ({ 9297 __extends, 9298 __assign, 9299 __rest, 9300 __decorate, 9301 __param, 9302 __esDecorate,
9303 __runInitializers, 9304 __propKey, 9305 __setFunctionName, 9306 __metadata, 9307 __awaiter, 9308 __generator, 9309 __createBinding, 9310 __exportStar, 9311 __values, 9312 __read, 9313 __spread, 9314 __spreadArrays, 9315 __spreadArray, 9316 __await, 9317 __asyncGenerator, 9318 __asyncDelegator, 9319 __asyncValues, 9320 __makeTemplateObject, 9321 __importStar, 9322 __importDefault, 9323 __classPrivateFieldGet, 9324 __classPrivateFieldSet, 9325 __classPrivateFieldIn, 9326 __addDisposableResource, 9327 __disposeResources, 9328 __rewriteRelativeImportExtension, 9329}); 9330 9331// EXTERNAL MODULE: ./node_modules/react/index.js 9332var react = __webpack_require__(7294); 9333;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/constants.js 9334var zeroRightClassName = 'right-scroll-bar-position'; 9335var fullWidthClassName = 'width-before-scroll-bar'; 9336var noScrollbarsClassName = 'with-scroll-bars-hidden'; 9337/** 9338 * Name of a CSS variable containing the amount of "hidden" scrollbar 9339 * ! might be undefined ! use will fallback! 9340 */ 9341var removedBarSizeVariable = '--removed-body-scroll-bar-size'; 9342 9343;// CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/assignRef.js 9344/** 9345 * Assigns a value for a given ref, no matter of the ref format 9346 * @param {RefObject} ref - a callback function or ref object 9347 * @param value - a new value 9348 * 9349 * @see https://github.com/theKashey/use-callback-ref#assignref 9350 * @example 9351 * const refObject = useRef(); 9352 * const refFn = (ref) => {....} 9353 * 9354 * assignRef(refObject, "refValue"); 9355 * assignRef(refFn, "refValue"); 9356 */ 9357function assignRef(ref, value) { 9358 if (typeof ref === 'function') { 9359 ref(value); 9360 } 9361 else if (ref) { 9362 ref.current = value; 9363 } 9364 return ref; 9365} 9366 9367;// CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/useRef.js 9368 9369/** 9370 * creates a MutableRef with ref change callback 9371 * @param initialValue - initial ref value 9372 * @param {Function} callback - a callback to run when value changes 9373 * 9374 * @example 9375 * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue); 9376 * ref.current = 1; 9377 * // prints 0 -> 1 9378 * 9379 * @see https://reactjs.org/docs/hooks-reference.html#useref 9380 * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref 9381 * @returns {MutableRefObject} 9382 */ 9383function useCallbackRef(initialValue, callback) { 9384 var ref = (0,react.useState)(function () { return ({ 9385 // value 9386 value: initialValue, 9387 // last callback 9388 callback: callback, 9389 // "memoized" public interface 9390 facade: { 9391 get current() { 9392 return ref.value; 9393 }, 9394 set current(value) { 9395 var last = ref.value; 9396 if (last !== value) { 9397 ref.value = value; 9398 ref.callback(value, last); 9399 } 9400 }, 9401 }, 9402 }); })[0]; 9403 // update callback 9404 ref.callback = callback; 9405 return ref.facade; 9406} 9407 9408;// CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/useMergeRef.js 9409 9410 9411 9412var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect; 9413var currentValues = new WeakMap(); 9414/** 9415 * Merges two or more refs together providing a single interface to set their value 9416 * @param {RefObject|Ref} refs 9417 * @returns {MutableRefObject} - a new ref, which translates all changes to {refs} 9418 * 9419 * @see {@link mergeRefs} a version without buit-in memoization 9420 * @see https://github.com/theKashey/use-callback-ref#usemergerefs 9421 * @example 9422 * const Component = React.forwardRef((props, ref) => { 9423 * const ownRef = useRef(); 9424 * const domRef = useMergeRefs([ref, ownRef]); // ð merge together 9425 * return <div ref={domRef}>...</div> 9426 * } 9427 */ 9428function useMergeRefs(refs, defaultValue) { 9429 var callbackRef = useCallbackRef(defaultValue || null, function (newValue) { 9430 return refs.forEach(function (ref) { return assignRef(ref, newValue); }); 9431 }); 9432 // handle refs changes - added or removed 9433 useIsomorphicLayoutEffect(function () { 9434 var oldValue = currentValues.get(callbackRef); 9435 if (oldValue) { 9436 var prevRefs_1 = new Set(oldValue); 9437 var nextRefs_1 = new Set(refs); 9438 var current_1 = callbackRef.current;
vendor: 13,256 bytes, lines 9439-9802
9439 prevRefs_1.forEach(function (ref) { 9440 if (!nextRefs_1.has(ref)) { 9441 assignRef(ref, null); 9442 } 9443 }); 9444 nextRefs_1.forEach(function (ref) { 9445 if (!prevRefs_1.has(ref)) { 9446 assignRef(ref, current_1); 9447 } 9448 }); 9449 } 9450 currentValues.set(callbackRef, refs); 9451 }, [refs]); 9452 return callbackRef; 9453} 9454 9455;// CONCATENATED MODULE: ./node_modules/use-sidecar/dist/es2015/medium.js 9456 9457function ItoI(a) { 9458 return a; 9459} 9460function innerCreateMedium(defaults, middleware) { 9461 if (middleware === void 0) { middleware = ItoI; } 9462 var buffer = []; 9463 var assigned = false; 9464 var medium = { 9465 read: function () { 9466 if (assigned) { 9467 throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.'); 9468 } 9469 if (buffer.length) { 9470 return buffer[buffer.length - 1]; 9471 } 9472 return defaults; 9473 }, 9474 useMedium: function (data) { 9475 var item = middleware(data, assigned); 9476 buffer.push(item); 9477 return function () { 9478 buffer = buffer.filter(function (x) { return x !== item; }); 9479 }; 9480 }, 9481 assignSyncMedium: function (cb) { 9482 assigned = true; 9483 while (buffer.length) { 9484 var cbs = buffer; 9485 buffer = []; 9486 cbs.forEach(cb); 9487 } 9488 buffer = { 9489 push: function (x) { return cb(x); }, 9490 filter: function () { return buffer; }, 9491 }; 9492 }, 9493 assignMedium: function (cb) { 9494 assigned = true; 9495 var pendingQueue = []; 9496 if (buffer.length) { 9497 var cbs = buffer; 9498 buffer = []; 9499 cbs.forEach(cb); 9500 pendingQueue = buffer; 9501 } 9502 var executeQueue = function () { 9503 var cbs = pendingQueue; 9504 pendingQueue = []; 9505 cbs.forEach(cb); 9506 }; 9507 var cycle = function () { return Promise.resolve().then(executeQueue); }; 9508 cycle(); 9509 buffer = { 9510 push: function (x) { 9511 pendingQueue.push(x); 9512 cycle(); 9513 }, 9514 filter: function (filter) { 9515 pendingQueue = pendingQueue.filter(filter); 9516 return buffer; 9517 }, 9518 }; 9519 }, 9520 }; 9521 return medium; 9522} 9523function createMedium(defaults, middleware) { 9524 if (middleware === void 0) { middleware = ItoI; } 9525 return innerCreateMedium(defaults, middleware); 9526} 9527// eslint-disable-next-line @typescript-eslint/ban-types 9528function createSidecarMedium(options) { 9529 if (options === void 0) { options = {}; } 9530 var medium = innerCreateMedium(null); 9531 medium.options = __assign({ async: true, ssr: false }, options); 9532 return medium; 9533} 9534 9535;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/medium.js 9536 9537var effectCar = createSidecarMedium(); 9538 9539;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/UI.js 9540 9541 9542 9543 9544 9545var nothing = function () { 9546 return; 9547}; 9548/** 9549 * Removes scrollbar from the page and contain the scroll within the Lock 9550 */ 9551var RemoveScroll = react.forwardRef(function (props, parentRef) { 9552 var ref = react.useRef(null); 9553 var _a = react.useState({ 9554 onScrollCapture: nothing, 9555 onWheelCapture: nothing, 9556 onTouchMoveCapture: nothing, 9557 }), callbacks = _a[0], setCallbacks = _a[1]; 9558 var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]); 9559 var SideCar = sideCar; 9560 var containerRef = useMergeRefs([ref, parentRef]); 9561 var containerProps = __assign(__assign({}, rest), callbacks); 9562 return (react.createElement(react.Fragment, null, 9563 enabled && (react.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode: gapMode })), 9564 forwardProps ? (react.cloneElement(react.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (react.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children)))); 9565}); 9566RemoveScroll.defaultProps = { 9567 enabled: true, 9568 removeScrollBar: true, 9569 inert: false, 9570}; 9571RemoveScroll.classNames = { 9572 fullWidth: fullWidthClassName, 9573 zeroRight: zeroRightClassName, 9574}; 9575 9576 9577;// CONCATENATED MODULE: ./node_modules/use-sidecar/dist/es2015/exports.js 9578 9579 9580var SideCar = function (_a) { 9581 var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]); 9582 if (!sideCar) { 9583 throw new Error('Sidecar: please provide `sideCar` property to import the right car'); 9584 } 9585 var Target = sideCar.read(); 9586 if (!Target) { 9587 throw new Error('Sidecar medium not found'); 9588 } 9589 return react.createElement(Target, __assign({}, rest)); 9590}; 9591SideCar.isSideCarExport = true; 9592function exportSidecar(medium, exported) { 9593 medium.useMedium(exported); 9594 return SideCar; 9595} 9596 9597;// CONCATENATED MODULE: ./node_modules/get-nonce/dist/es2015/index.js 9598var currentNonce; 9599var setNonce = function (nonce) { 9600 currentNonce = nonce; 9601}; 9602var getNonce = function () { 9603 if (currentNonce) { 9604 return currentNonce; 9605 } 9606 if (true) { 9607 return __webpack_require__.nc; 9608 } 9609 return undefined; 9610}; 9611 9612;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/singleton.js 9613 9614function makeStyleTag() { 9615 if (!document) 9616 return null; 9617 var tag = document.createElement('style'); 9618 tag.type = 'text/css'; 9619 var nonce = getNonce(); 9620 if (nonce) { 9621 tag.setAttribute('nonce', nonce); 9622 } 9623 return tag; 9624} 9625function injectStyles(tag, css) { 9626 // @ts-ignore 9627 if (tag.styleSheet) { 9628 // @ts-ignore 9629 tag.styleSheet.cssText = css; 9630 } 9631 else { 9632 tag.appendChild(document.createTextNode(css)); 9633 } 9634} 9635function insertStyleTag(tag) { 9636 var head = document.head || document.getElementsByTagName('head')[0]; 9637 head.appendChild(tag); 9638} 9639var stylesheetSingleton = function () { 9640 var counter = 0; 9641 var stylesheet = null; 9642 return { 9643 add: function (style) { 9644 if (counter == 0) { 9645 if ((stylesheet = makeStyleTag())) { 9646 injectStyles(stylesheet, style); 9647 insertStyleTag(stylesheet); 9648 } 9649 } 9650 counter++; 9651 }, 9652 remove: function () { 9653 counter--; 9654 if (!counter && stylesheet) { 9655 stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); 9656 stylesheet = null; 9657 } 9658 }, 9659 }; 9660}; 9661 9662;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/hook.js 9663 9664 9665/** 9666 * creates a hook to control style singleton 9667 * @see {@link styleSingleton} for a safer component version 9668 * @example 9669 * ```tsx 9670 * const useStyle = styleHookSingleton(); 9671 * /// 9672 * useStyle('body { overflow: hidden}'); 9673 */ 9674var styleHookSingleton = function () { 9675 var sheet = stylesheetSingleton(); 9676 return function (styles, isDynamic) { 9677 react.useEffect(function () { 9678 sheet.add(styles); 9679 return function () { 9680 sheet.remove(); 9681 }; 9682 }, [styles && isDynamic]); 9683 }; 9684}; 9685 9686;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/component.js 9687 9688/** 9689 * create a Component to add styles on demand 9690 * - styles are added when first instance is mounted 9691 * - styles are removed when the last instance is unmounted 9692 * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior 9693 */ 9694var styleSingleton = function () { 9695 var useStyle = styleHookSingleton(); 9696 var Sheet = function (_a) { 9697 var styles = _a.styles, dynamic = _a.dynamic; 9698 useStyle(styles, dynamic); 9699 return null; 9700 }; 9701 return Sheet; 9702}; 9703 9704;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/index.js 9705 9706 9707 9708 9709;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/utils.js 9710var zeroGap = { 9711 left: 0, 9712 top: 0, 9713 right: 0, 9714 gap: 0, 9715}; 9716var parse = function (x) { return parseInt(x || '', 10) || 0; }; 9717var getOffset = function (gapMode) { 9718 var cs = window.getComputedStyle(document.body); 9719 var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft']; 9720 var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop']; 9721 var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight']; 9722 return [parse(left), parse(top), parse(right)]; 9723}; 9724var getGapWidth = function (gapMode) { 9725 if (gapMode === void 0) { gapMode = 'margin'; } 9726 if (typeof window === 'undefined') { 9727 return zeroGap; 9728 } 9729 var offsets = getOffset(gapMode); 9730 var documentWidth = document.documentElement.clientWidth; 9731 var windowWidth = window.innerWidth; 9732 return { 9733 left: offsets[0], 9734 top: offsets[1], 9735 right: offsets[2], 9736 gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]), 9737 }; 9738}; 9739 9740;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/component.js 9741 9742 9743 9744 9745var Style = styleSingleton(); 9746var lockAttribute = 'data-scroll-locked'; 9747// important tip - once we measure scrollBar width and remove them 9748// we could not repeat this operation 9749// thus we are using style-singleton - only the first "yet correct" style will be applied. 9750var getStyles = function (_a, allowRelative, gapMode, important) { 9751 var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap; 9752 if (gapMode === void 0) { gapMode = 'margin'; } 9753 return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([ 9754 allowRelative && "position: relative ".concat(important, ";"), 9755 gapMode === 'margin' && 9756 "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "), 9757 gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"), 9758 ] 9759 .filter(Boolean) 9760 .join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n"); 9761}; 9762var getCurrentUseCounter = function () { 9763 var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10); 9764 return isFinite(counter) ? counter : 0; 9765}; 9766var useLockAttribute = function () { 9767 react.useEffect(function () { 9768 document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString()); 9769 return function () { 9770 var newCounter = getCurrentUseCounter() - 1; 9771 if (newCounter <= 0) { 9772 document.body.removeAttribute(lockAttribute); 9773 } 9774 else { 9775 document.body.setAttribute(lockAttribute, newCounter.toString()); 9776 } 9777 }; 9778 }, []); 9779}; 9780/** 9781 * Removes page scrollbar and blocks page scroll when mounted 9782 */ 9783var RemoveScrollBar = function (_a) { 9784 var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? 'margin' : _b; 9785 useLockAttribute(); 9786 /* 9787 gap will be measured on every component mount 9788 however it will be used only by the "first" invocation 9789 due to singleton nature of <Style 9790 */ 9791 var gap = react.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]); 9792 return react.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') }); 9793}; 9794 9795;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/index.js 9796 9797 9798 9799 9800 9801;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js 9802var passiveSupported = false;
vendor: 13,135 bytes, lines 9803-10114
9803if (typeof window !== 'undefined') { 9804 try { 9805 var options = Object.defineProperty({}, 'passive', { 9806 get: function () { 9807 passiveSupported = true; 9808 return true; 9809 }, 9810 }); 9811 // @ts-ignore 9812 window.addEventListener('test', options, options); 9813 // @ts-ignore 9814 window.removeEventListener('test', options, options); 9815 } 9816 catch (err) { 9817 passiveSupported = false; 9818 } 9819} 9820var nonPassive = passiveSupported ? { passive: false } : false; 9821 9822;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/handleScroll.js 9823var alwaysContainsScroll = function (node) { 9824 // textarea will always _contain_ scroll inside self. It only can be hidden 9825 return node.tagName === 'TEXTAREA'; 9826}; 9827var elementCanBeScrolled = function (node, overflow) { 9828 if (!(node instanceof Element)) { 9829 return false; 9830 } 9831 var styles = window.getComputedStyle(node); 9832 return ( 9833 // not-not-scrollable 9834 styles[overflow] !== 'hidden' && 9835 // contains scroll inside self 9836 !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible')); 9837}; 9838var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); }; 9839var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); }; 9840var locationCouldBeScrolled = function (axis, node) { 9841 var ownerDocument = node.ownerDocument; 9842 var current = node; 9843 do { 9844 // Skip over shadow root 9845 if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) { 9846 current = current.host; 9847 } 9848 var isScrollable = elementCouldBeScrolled(axis, current); 9849 if (isScrollable) { 9850 var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2]; 9851 if (scrollHeight > clientHeight) { 9852 return true; 9853 } 9854 } 9855 current = current.parentNode; 9856 } while (current && current !== ownerDocument.body); 9857 return false; 9858}; 9859var getVScrollVariables = function (_a) { 9860 var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight; 9861 return [ 9862 scrollTop, 9863 scrollHeight, 9864 clientHeight, 9865 ]; 9866}; 9867var getHScrollVariables = function (_a) { 9868 var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth; 9869 return [ 9870 scrollLeft, 9871 scrollWidth, 9872 clientWidth, 9873 ]; 9874}; 9875var elementCouldBeScrolled = function (axis, node) { 9876 return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node); 9877}; 9878var getScrollVariables = function (axis, node) { 9879 return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node); 9880}; 9881var getDirectionFactor = function (axis, direction) { 9882 /** 9883 * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position, 9884 * and then increasingly negative as you scroll towards the end of the content. 9885 * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft 9886 */ 9887 return axis === 'h' && direction === 'rtl' ? -1 : 1; 9888}; 9889var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) { 9890 var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); 9891 var delta = directionFactor * sourceDelta; 9892 // find scrollable target 9893 var target = event.target; 9894 var targetInLock = endTarget.contains(target); 9895 var shouldCancelScroll = false; 9896 var isDeltaPositive = delta > 0; 9897 var availableScroll = 0; 9898 var availableScrollTop = 0; 9899 do { 9900 var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2]; 9901 var elementScroll = scroll_1 - capacity - directionFactor * position; 9902 if (position || elementScroll) { 9903 if (elementCouldBeScrolled(axis, target)) { 9904 availableScroll += elementScroll; 9905 availableScrollTop += position; 9906 } 9907 } 9908 if (target instanceof ShadowRoot) { 9909 target = target.host; 9910 } 9911 else { 9912 target = target.parentNode; 9913 } 9914 } while ( 9915 // portaled content 9916 (!targetInLock && target !== document.body) || 9917 // self content 9918 (targetInLock && (endTarget.contains(target) || endTarget === target))); 9919 // handle epsilon around 0 (non standard zoom levels) 9920 if (isDeltaPositive && 9921 ((noOverscroll && Math.abs(availableScroll) < 1) || (!noOverscroll && delta > availableScroll))) { 9922 shouldCancelScroll = true; 9923 } 9924 else if (!isDeltaPositive && 9925 ((noOverscroll && Math.abs(availableScrollTop) < 1) || (!noOverscroll && -delta > availableScrollTop))) { 9926 shouldCancelScroll = true; 9927 } 9928 return shouldCancelScroll; 9929}; 9930 9931;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/SideEffect.js 9932 9933 9934 9935 9936 9937 9938var getTouchXY = function (event) { 9939 return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; 9940}; 9941var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; }; 9942var extractRef = function (ref) { 9943 return ref && 'current' in ref ? ref.current : ref; 9944}; 9945var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; }; 9946var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); }; 9947var idCounter = 0; 9948var lockStack = []; 9949function RemoveScrollSideCar(props) { 9950 var shouldPreventQueue = react.useRef([]); 9951 var touchStartRef = react.useRef([0, 0]); 9952 var activeAxis = react.useRef(); 9953 var id = react.useState(idCounter++)[0]; 9954 var Style = react.useState(styleSingleton)[0]; 9955 var lastProps = react.useRef(props); 9956 react.useEffect(function () { 9957 lastProps.current = props; 9958 }, [props]); 9959 react.useEffect(function () { 9960 if (props.inert) { 9961 document.body.classList.add("block-interactivity-".concat(id)); 9962 var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean); 9963 allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); }); 9964 return function () { 9965 document.body.classList.remove("block-interactivity-".concat(id)); 9966 allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); }); 9967 }; 9968 } 9969 return; 9970 }, [props.inert, props.lockRef.current, props.shards]); 9971 var shouldCancelEvent = react.useCallback(function (event, parent) { 9972 if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) { 9973 return !lastProps.current.allowPinchZoom; 9974 } 9975 var touch = getTouchXY(event); 9976 var touchStart = touchStartRef.current; 9977 var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0]; 9978 var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1]; 9979 var currentAxis; 9980 var target = event.target; 9981 var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v'; 9982 // allow horizontal touch move on Range inputs. They will not cause any scroll 9983 if ('touches' in event && moveDirection === 'h' && target.type === 'range') { 9984 return false; 9985 } 9986 var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 9987 if (!canBeScrolledInMainDirection) { 9988 return true; 9989 } 9990 if (canBeScrolledInMainDirection) { 9991 currentAxis = moveDirection; 9992 } 9993 else { 9994 currentAxis = moveDirection === 'v' ? 'h' : 'v'; 9995 canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 9996 // other axis might be not scrollable 9997 } 9998 if (!canBeScrolledInMainDirection) { 9999 return false; 10000 } 10001 if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) { 10002 activeAxis.current = currentAxis; 10003 } 10004 if (!currentAxis) { 10005 return true; 10006 } 10007 var cancelingAxis = activeAxis.current || currentAxis; 10008 return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true); 10009 }, []); 10010 var shouldPrevent = react.useCallback(function (_event) { 10011 var event = _event; 10012 if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) { 10013 // not the last active 10014 return; 10015 } 10016 var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event); 10017 var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0]; 10018 // self event, and should be canceled 10019 if (sourceEvent && sourceEvent.should) { 10020 if (event.cancelable) { 10021 event.preventDefault(); 10022 } 10023 return; 10024 } 10025 // outside or shard event 10026 if (!sourceEvent) { 10027 var shardNodes = (lastProps.current.shards || []) 10028 .map(extractRef) 10029 .filter(Boolean) 10030 .filter(function (node) { return node.contains(event.target); }); 10031 var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; 10032 if (shouldStop) { 10033 if (event.cancelable) { 10034 event.preventDefault(); 10035 } 10036 } 10037 } 10038 }, []); 10039 var shouldCancel = react.useCallback(function (name, delta, target, should) { 10040 var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) }; 10041 shouldPreventQueue.current.push(event); 10042 setTimeout(function () { 10043 shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; }); 10044 }, 1); 10045 }, []); 10046 var scrollTouchStart = react.useCallback(function (event) { 10047 touchStartRef.current = getTouchXY(event); 10048 activeAxis.current = undefined; 10049 }, []); 10050 var scrollWheel = react.useCallback(function (event) { 10051 shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 10052 }, []); 10053 var scrollTouchMove = react.useCallback(function (event) { 10054 shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 10055 }, []); 10056 react.useEffect(function () { 10057 lockStack.push(Style); 10058 props.setCallbacks({ 10059 onScrollCapture: scrollWheel, 10060 onWheelCapture: scrollWheel, 10061 onTouchMoveCapture: scrollTouchMove, 10062 }); 10063 document.addEventListener('wheel', shouldPrevent, nonPassive); 10064 document.addEventListener('touchmove', shouldPrevent, nonPassive); 10065 document.addEventListener('touchstart', scrollTouchStart, nonPassive); 10066 return function () { 10067 lockStack = lockStack.filter(function (inst) { return inst !== Style; }); 10068 document.removeEventListener('wheel', shouldPrevent, nonPassive); 10069 document.removeEventListener('touchmove', shouldPrevent, nonPassive); 10070 document.removeEventListener('touchstart', scrollTouchStart, nonPassive); 10071 }; 10072 }, []); 10073 var removeScrollBar = props.removeScrollBar, inert = props.inert; 10074 return (react.createElement(react.Fragment, null, 10075 inert ? react.createElement(Style, { styles: generateStyle(id) }) : null, 10076 removeScrollBar ? react.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null)); 10077} 10078function getOutermostShadowParent(node) { 10079 var shadowParent = null; 10080 while (node !== null) { 10081 if (node instanceof ShadowRoot) { 10082 shadowParent = node.host; 10083 node = node.host; 10084 } 10085 node = node.parentNode; 10086 } 10087 return shadowParent; 10088} 10089 10090;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/sidecar.js 10091 10092 10093 10094/* harmony default export */ var sidecar = (exportSidecar(effectCar, RemoveScrollSideCar)); 10095 10096;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/Combination.js 10097 10098 10099 10100 10101var ReactRemoveScroll = react.forwardRef(function (props, ref) { return (react.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: sidecar }))); }); 10102ReactRemoveScroll.classNames = RemoveScroll.classNames; 10103/* harmony default export */ var Combination = (ReactRemoveScroll); 10104 10105 10106/***/ }), 10107 10108/***/ 6206: 10109/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 10110 10111"use strict"; 10112/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10113/* harmony export */ M: function() { return /* binding */ composeEventHandlers; } 10114/* harmony export */ });
10115// packages/core/primitive/src/primitive.tsx 10116function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { 10117 return function handleEvent(event) { 10118 originalEventHandler?.(event); 10119 if (checkForDefaultPrevented === false || !event.defaultPrevented) { 10120 return ourEventHandler?.(event); 10121 } 10122 }; 10123} 10124 10125//# sourceMappingURL=index.mjs.map 10126 10127 10128/***/ }), 10129 10130/***/ 6069: 10131/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 10132 10133"use strict"; 10134/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10135/* harmony export */ fC: function() { return /* binding */ Root; }, 10136/* harmony export */ z$: function() { return /* binding */ Indicator; } 10137/* harmony export */ }); 10138/* unused harmony exports Checkbox, CheckboxIndicator, createCheckboxScope */ 10139/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 10140/* harmony import */ var _radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8771); 10141/* harmony import */ var _radix_ui_react_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5360); 10142/* harmony import */ var _radix_ui_primitive__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6206); 10143/* harmony import */ var _radix_ui_react_use_controllable_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7342); 10144/* harmony import */ var _radix_ui_react_use_previous__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7898); 10145/* harmony import */ var _radix_ui_react_use_size__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7546); 10146/* harmony import */ var _radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9115); 10147/* harmony import */ var _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5320); 10148/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893); 10149"use client"; 10150
10151// packages/react/checkbox/src/checkbox.tsx 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162var CHECKBOX_NAME = "Checkbox"; 10163var [createCheckboxContext, createCheckboxScope] = (0,_radix_ui_react_context__WEBPACK_IMPORTED_MODULE_2__/* .createContextScope */ .b)(CHECKBOX_NAME); 10164var [CheckboxProvider, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME); 10165var Checkbox = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10166 (props, forwardedRef) => { 10167 const { 10168 __scopeCheckbox, 10169 name, 10170 checked: checkedProp, 10171 defaultChecked, 10172 required, 10173 disabled, 10174 value = "on", 10175 onCheckedChange, 10176 form, 10177 ...checkboxProps 10178 } = props; 10179 const [button, setButton] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null); 10180 const composedRefs = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_3__/* .useComposedRefs */ .e)(forwardedRef, (node) => setButton(node)); 10181 const hasConsumerStoppedPropagationRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 10182 const isFormControl = button ? form || !!button.closest("form") : true; 10183 const [checked = false, setChecked] = (0,_radix_ui_react_use_controllable_state__WEBPACK_IMPORTED_MODULE_4__/* .useControllableState */ .T)({ 10184 prop: checkedProp, 10185 defaultProp: defaultChecked, 10186 onChange: onCheckedChange 10187 }); 10188 const initialCheckedStateRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(checked); 10189 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 10190 const form2 = button?.form; 10191 if (form2) { 10192 const reset = () => setChecked(initialCheckedStateRef.current); 10193 form2.addEventListener("reset", reset); 10194 return () => form2.removeEventListener("reset", reset); 10195 } 10196 }, [button, setChecked]); 10197 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(CheckboxProvider, { scope: __scopeCheckbox, state: checked, disabled, children: [
10198 /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10199 _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_5__/* .Primitive */ .WV.button, 10200 { 10201 type: "button", 10202 role: "checkbox", 10203 "aria-checked": isIndeterminate(checked) ? "mixed" : checked, 10204 "aria-required": required, 10205 "data-state": getState(checked), 10206 "data-disabled": disabled ? "" : void 0, 10207 disabled, 10208 value, 10209 ...checkboxProps, 10210 ref: composedRefs, 10211 onKeyDown: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_6__/* .composeEventHandlers */ .M)(props.onKeyDown, (event) => { 10212 if (event.key === "Enter") event.preventDefault(); 10213 }), 10214 onClick: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_6__/* .composeEventHandlers */ .M)(props.onClick, (event) => { 10215 setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked); 10216 if (isFormControl) { 10217 hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(); 10218 if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation(); 10219 } 10220 }) 10221 } 10222 ), 10223 isFormControl && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10224 BubbleInput, 10225 { 10226 control: button, 10227 bubbles: !hasConsumerStoppedPropagationRef.current, 10228 name, 10229 value, 10230 checked, 10231 required, 10232 disabled, 10233 form, 10234 style: { transform: "translateX(-100%)" }, 10235 defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked 10236 } 10237 ) 10238 ] }); 10239 } 10240); 10241Checkbox.displayName = CHECKBOX_NAME; 10242var INDICATOR_NAME = "CheckboxIndicator"; 10243var CheckboxIndicator = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10244 (props, forwardedRef) => { 10245 const { __scopeCheckbox, forceMount, ...indicatorProps } = props; 10246 const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox); 10247 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_7__/* .Presence */ .z, { present: forceMount || isIndeterminate(context.state) || context.state === true, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10248 _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_5__/* .Primitive */ .WV.span, 10249 { 10250 "data-state": getState(context.state), 10251 "data-disabled": context.disabled ? "" : void 0, 10252 ...indicatorProps, 10253 ref: forwardedRef, 10254 style: { pointerEvents: "none", ...props.style } 10255 } 10256 ) }); 10257 } 10258); 10259CheckboxIndicator.displayName = INDICATOR_NAME; 10260var BubbleInput = (props) => { 10261 const { control, checked, bubbles = true, defaultChecked, ...inputProps } = props; 10262 const ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 10263 const prevChecked = (0,_radix_ui_react_use_previous__WEBPACK_IMPORTED_MODULE_8__/* .usePrevious */ .D)(checked); 10264 const controlSize = (0,_radix_ui_react_use_size__WEBPACK_IMPORTED_MODULE_9__/* .useSize */ .t)(control); 10265 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 10266 const input = ref.current; 10267 const inputProto = window.HTMLInputElement.prototype; 10268 const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked"); 10269 const setChecked = descriptor.set; 10270 if (prevChecked !== checked && setChecked) { 10271 const event = new Event("click", { bubbles }); 10272 input.indeterminate = isIndeterminate(checked); 10273 setChecked.call(input, isIndeterminate(checked) ? false : checked); 10274 input.dispatchEvent(event); 10275 } 10276 }, [prevChecked, checked, bubbles]); 10277 const defaultCheckedRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(isIndeterminate(checked) ? false : checked); 10278 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10279 "input", 10280 { 10281 type: "checkbox", 10282 "aria-hidden": true, 10283 defaultChecked: defaultChecked ?? defaultCheckedRef.current, 10284 ...inputProps, 10285 tabIndex: -1, 10286 ref, 10287 style: { 10288 ...props.style, 10289 ...controlSize, 10290 position: "absolute", 10291 pointerEvents: "none", 10292 opacity: 0, 10293 margin: 0 10294 } 10295 } 10296 ); 10297}; 10298function isIndeterminate(checked) { 10299 return checked === "indeterminate"; 10300} 10301function getState(checked) { 10302 return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked"; 10303} 10304var Root = Checkbox; 10305var Indicator = CheckboxIndicator; 10306 10307//# sourceMappingURL=index.mjs.map 10308 10309 10310/***/ }), 10311 10312/***/ 5936: 10313/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 10314 10315"use strict"; 10316/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10317/* harmony export */ B: function() { return /* binding */ createCollection; } 10318/* harmony export */ }); 10319/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 10320/* harmony import */ var _radix_ui_react_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5360); 10321/* harmony import */ var _radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8771); 10322/* harmony import */ var _radix_ui_react_slot__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8426); 10323/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893); 10324"use client"; 10325
vendor: 2,285 bytes, lines 10326-10366
10326// packages/react/collection/src/collection.tsx 10327 10328 10329 10330 10331 10332function createCollection(name) { 10333 const PROVIDER_NAME = name + "CollectionProvider"; 10334 const [createCollectionContext, createCollectionScope] = (0,_radix_ui_react_context__WEBPACK_IMPORTED_MODULE_2__/* .createContextScope */ .b)(PROVIDER_NAME); 10335 const [CollectionProviderImpl, useCollectionContext] = createCollectionContext( 10336 PROVIDER_NAME, 10337 { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() } 10338 ); 10339 const CollectionProvider = (props) => { 10340 const { scope, children } = props; 10341 const ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 10342 const itemMap = react__WEBPACK_IMPORTED_MODULE_0__.useRef(/* @__PURE__ */ new Map()).current; 10343 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children }); 10344 }; 10345 CollectionProvider.displayName = PROVIDER_NAME; 10346 const COLLECTION_SLOT_NAME = name + "CollectionSlot"; 10347 const CollectionSlot = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10348 (props, forwardedRef) => { 10349 const { scope, children } = props; 10350 const context = useCollectionContext(COLLECTION_SLOT_NAME, scope); 10351 const composedRefs = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_3__/* .useComposedRefs */ .e)(forwardedRef, context.collectionRef); 10352 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_slot__WEBPACK_IMPORTED_MODULE_4__/* .Slot */ .g7, { ref: composedRefs, children }); 10353 } 10354 ); 10355 CollectionSlot.displayName = COLLECTION_SLOT_NAME; 10356 const ITEM_SLOT_NAME = name + "CollectionItemSlot"; 10357 const ITEM_DATA_ATTR = "data-radix-collection-item"; 10358 const CollectionItemSlot = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10359 (props, forwardedRef) => { 10360 const { scope, children, ...itemData } = props; 10361 const ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 10362 const composedRefs = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_3__/* .useComposedRefs */ .e)(forwardedRef, ref); 10363 const context = useCollectionContext(ITEM_SLOT_NAME, scope); 10364 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 10365 context.itemMap.set(ref, { ref, ...itemData }); 10366 return () =>
10366 void context.itemMap.delete(ref); 10367 }); 10368 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_slot__WEBPACK_IMPORTED_MODULE_4__/* .Slot */ .g7, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children }); 10369 } 10370 ); 10371 CollectionItemSlot.displayName = ITEM_SLOT_NAME; 10372 function useCollection(scope) { 10373 const context = useCollectionContext(name + "CollectionConsumer", scope); 10374 const getItems = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => { 10375 const collectionNode = context.collectionRef.current; 10376 if (!collectionNode) return []; 10377 const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)); 10378 const items = Array.from(context.itemMap.values()); 10379 const orderedItems = items.sort( 10380 (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current) 10381 ); 10382 return orderedItems; 10383 }, [context.collectionRef, context.itemMap]); 10384 return getItems; 10385 } 10386 return [ 10387 { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot }, 10388 useCollection, 10389 createCollectionScope 10390 ]; 10391} 10392 10393//# sourceMappingURL=index.mjs.map 10394 10395 10396/***/ }), 10397 10398/***/ 8771: 10399/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 10400 10401"use strict"; 10402/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10403/* harmony export */ F: function() { return /* binding */ composeRefs; }, 10404/* harmony export */ e: function() { return /* binding */ useComposedRefs; } 10405/* harmony export */ }); 10406/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294);
vendor: 5,823 bytes, lines 10407-10552
10407// packages/react/compose-refs/src/composeRefs.tsx 10408 10409function setRef(ref, value) { 10410 if (typeof ref === "function") { 10411 return ref(value); 10412 } else if (ref !== null && ref !== void 0) { 10413 ref.current = value; 10414 } 10415} 10416function composeRefs(...refs) { 10417 return (node) => { 10418 let hasCleanup = false; 10419 const cleanups = refs.map((ref) => { 10420 const cleanup = setRef(ref, node); 10421 if (!hasCleanup && typeof cleanup == "function") { 10422 hasCleanup = true; 10423 } 10424 return cleanup; 10425 }); 10426 if (hasCleanup) { 10427 return () => { 10428 for (let i = 0; i < cleanups.length; i++) { 10429 const cleanup = cleanups[i]; 10430 if (typeof cleanup == "function") { 10431 cleanup(); 10432 } else { 10433 setRef(refs[i], null); 10434 } 10435 } 10436 }; 10437 } 10438 }; 10439} 10440function useComposedRefs(...refs) { 10441 return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(composeRefs(...refs), refs); 10442} 10443 10444//# sourceMappingURL=index.mjs.map 10445 10446 10447/***/ }), 10448 10449/***/ 5360: 10450/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 10451 10452"use strict"; 10453/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10454/* harmony export */ b: function() { return /* binding */ createContextScope; }, 10455/* harmony export */ k: function() { return /* binding */ createContext2; } 10456/* harmony export */ }); 10457/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 10458/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893); 10459// packages/react/context/src/createContext.tsx 10460 10461 10462function createContext2(rootComponentName, defaultContext) { 10463 const Context = react__WEBPACK_IMPORTED_MODULE_0__.createContext(defaultContext); 10464 const Provider = (props) => { 10465 const { children, ...context } = props; 10466 const value = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => context, Object.values(context)); 10467 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Context.Provider, { value, children }); 10468 }; 10469 Provider.displayName = rootComponentName + "Provider"; 10470 function useContext2(consumerName) { 10471 const context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(Context); 10472 if (context) return context; 10473 if (defaultContext !== void 0) return defaultContext; 10474 throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); 10475 } 10476 return [Provider, useContext2]; 10477} 10478function createContextScope(scopeName, createContextScopeDeps = []) { 10479 let defaultContexts = []; 10480 function createContext3(rootComponentName, defaultContext) { 10481 const BaseContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(defaultContext); 10482 const index = defaultContexts.length; 10483 defaultContexts = [...defaultContexts, defaultContext]; 10484 const Provider = (props) => { 10485 const { scope, children, ...context } = props; 10486 const Context = scope?.[scopeName]?.[index] || BaseContext; 10487 const value = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => context, Object.values(context)); 10488 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Context.Provider, { value, children }); 10489 }; 10490 Provider.displayName = rootComponentName + "Provider"; 10491 function useContext2(consumerName, scope) { 10492 const Context = scope?.[scopeName]?.[index] || BaseContext; 10493 const context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(Context); 10494 if (context) return context; 10495 if (defaultContext !== void 0) return defaultContext; 10496 throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); 10497 } 10498 return [Provider, useContext2]; 10499 } 10500 const createScope = () => { 10501 const scopeContexts = defaultContexts.map((defaultContext) => { 10502 return react__WEBPACK_IMPORTED_MODULE_0__.createContext(defaultContext); 10503 }); 10504 return function useScope(scope) { 10505 const contexts = scope?.[scopeName] || scopeContexts; 10506 return react__WEBPACK_IMPORTED_MODULE_0__.useMemo( 10507 () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), 10508 [scope, contexts] 10509 ); 10510 }; 10511 }; 10512 createScope.scopeName = scopeName; 10513 return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)]; 10514} 10515function composeContextScopes(...scopes) { 10516 const baseScope = scopes[0]; 10517 if (scopes.length === 1) return baseScope; 10518 const createScope = () => { 10519 const scopeHooks = scopes.map((createScope2) => ({ 10520 useScope: createScope2(), 10521 scopeName: createScope2.scopeName 10522 })); 10523 return function useComposedScopes(overrideScopes) { 10524 const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { 10525 const scopeProps = useScope(overrideScopes); 10526 const currentScope = scopeProps[`__scope${scopeName}`]; 10527 return { ...nextScopes2, ...currentScope }; 10528 }, {}); 10529 return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); 10530 }; 10531 }; 10532 createScope.scopeName = baseScope.scopeName; 10533 return createScope; 10534} 10535 10536//# sourceMappingURL=index.mjs.map 10537 10538 10539/***/ }), 10540 10541/***/ 2854: 10542/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 10543 10544"use strict"; 10545/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10546/* harmony export */ Dx: function() { return /* binding */ Title; }, 10547/* harmony export */ VY: function() { return /* binding */ Content; }, 10548/* harmony export */ aV: function() { return /* binding */ Overlay; }, 10549/* harmony export */ dk: function() { return /* binding */ Description; }, 10550/* harmony export */ fC: function() { return /* binding */ Root; }, 10551/* harmony export */ h_: function() { return /* binding */ Portal; }, 10552/* harmony export */ x8: function() { return /* binding */ Close; },
10553/* harmony export */ xz: function() { return /* binding */ Trigger; } 10554/* harmony export */ }); 10555/* unused harmony exports Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, WarningProvider, createDialogScope */ 10556/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 10557/* harmony import */ var _radix_ui_primitive__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6206); 10558/* harmony import */ var _radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8771); 10559/* harmony import */ var _radix_ui_react_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5360); 10560/* harmony import */ var _radix_ui_react_id__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1276); 10561/* harmony import */ var _radix_ui_react_use_controllable_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7342); 10562/* harmony import */ var _radix_ui_react_dismissable_layer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(6063); 10563/* harmony import */ var _radix_ui_react_focus_scope__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(5420); 10564/* harmony import */ var _radix_ui_react_portal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2651); 10565/* harmony import */ var _radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9115); 10566/* harmony import */ var _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5320); 10567/* harmony import */ var _radix_ui_react_focus_guards__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7552); 10568/* harmony import */ var react_remove_scroll__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6223); 10569/* harmony import */ var aria_hidden__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(3541); 10570/* harmony import */ var _radix_ui_react_slot__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8426); 10571/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893); 10572"use client"; 10573
10574// packages/react/dialog/src/dialog.tsx 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591var DIALOG_NAME = "Dialog"; 10592var [createDialogContext, createDialogScope] = (0,_radix_ui_react_context__WEBPACK_IMPORTED_MODULE_2__/* .createContextScope */ .b)(DIALOG_NAME); 10593var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME); 10594var Dialog = (props) => { 10595 const { 10596 __scopeDialog, 10597 children, 10598 open: openProp, 10599 defaultOpen, 10600 onOpenChange, 10601 modal = true 10602 } = props; 10603 const triggerRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 10604 const contentRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 10605 const [open = false, setOpen] = (0,_radix_ui_react_use_controllable_state__WEBPACK_IMPORTED_MODULE_3__/* .useControllableState */ .T)({ 10606 prop: openProp, 10607 defaultProp: defaultOpen, 10608 onChange: onOpenChange 10609 }); 10610 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10611 DialogProvider, 10612 { 10613 scope: __scopeDialog, 10614 triggerRef, 10615 contentRef, 10616 contentId: (0,_radix_ui_react_id__WEBPACK_IMPORTED_MODULE_4__/* .useId */ .M)(), 10617 titleId: (0,_radix_ui_react_id__WEBPACK_IMPORTED_MODULE_4__/* .useId */ .M)(), 10618 descriptionId: (0,_radix_ui_react_id__WEBPACK_IMPORTED_MODULE_4__/* .useId */ .M)(), 10619 open, 10620 onOpenChange: setOpen, 10621 onOpenToggle: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), 10622 modal, 10623 children 10624 } 10625 ); 10626}; 10627Dialog.displayName = DIALOG_NAME; 10628var TRIGGER_NAME = "DialogTrigger"; 10629var DialogTrigger = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10630 (props, forwardedRef) => { 10631 const { __scopeDialog, ...triggerProps } = props; 10632 const context = useDialogContext(TRIGGER_NAME, __scopeDialog); 10633 const composedTriggerRef = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_5__/* .useComposedRefs */ .e)(forwardedRef, context.triggerRef); 10634 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10635 _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__/* .Primitive */ .WV.button, 10636 { 10637 type: "button", 10638 "aria-haspopup": "dialog", 10639 "aria-expanded": context.open, 10640 "aria-controls": context.contentId, 10641 "data-state": getState(context.open), 10642 ...triggerProps, 10643 ref: composedTriggerRef, 10644 onClick: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_7__/* .composeEventHandlers */ .M)(props.onClick, context.onOpenToggle) 10645 } 10646 ); 10647 } 10648); 10649DialogTrigger.displayName = TRIGGER_NAME; 10650var PORTAL_NAME = "DialogPortal"; 10651var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { 10652 forceMount: void 0 10653}); 10654var DialogPortal = (props) => { 10655 const { __scopeDialog, forceMount, children, container } = props; 10656 const context = useDialogContext(PORTAL_NAME, __scopeDialog); 10657 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: react__WEBPACK_IMPORTED_MODULE_0__.Children.map(children, (child) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_8__/* .Presence */ .z, { present: forceMount || context.open, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_portal__WEBPACK_IMPORTED_MODULE_9__/* .Portal */ .h, { asChild: true, container, children: child }) })) }); 10658}; 10659DialogPortal.displayName = PORTAL_NAME; 10660var OVERLAY_NAME = "DialogOverlay"; 10661var DialogOverlay = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10662 (props, forwardedRef) => { 10663 const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog); 10664 const { forceMount = portalContext.forceMount, ...overlayProps } = props; 10665 const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog); 10666 return context.modal ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_8__/* .Presence */ .z, { present: forceMount || context.open, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null; 10667 } 10668); 10669DialogOverlay.displayName = OVERLAY_NAME; 10670var DialogOverlayImpl = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10671 (props, forwardedRef) => { 10672 const { __scopeDialog, ...overlayProps } = props; 10673 const context = useDialogContext(OVERLAY_NAME, __scopeDialog); 10674 return ( 10675 // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` 10676 // ie. when `Overlay` and `Content` are siblings
10677 /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_remove_scroll__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, { as: _radix_ui_react_slot__WEBPACK_IMPORTED_MODULE_11__/* .Slot */ .g7, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10678 _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__/* .Primitive */ .WV.div, 10679 { 10680 "data-state": getState(context.open), 10681 ...overlayProps, 10682 ref: forwardedRef, 10683 style: { pointerEvents: "auto", ...overlayProps.style } 10684 } 10685 ) }) 10686 ); 10687 } 10688); 10689var CONTENT_NAME = "DialogContent"; 10690var DialogContent = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10691 (props, forwardedRef) => { 10692 const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog); 10693 const { forceMount = portalContext.forceMount, ...contentProps } = props; 10694 const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); 10695 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_8__/* .Presence */ .z, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) }); 10696 } 10697); 10698DialogContent.displayName = CONTENT_NAME; 10699var DialogContentModal = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10700 (props, forwardedRef) => { 10701 const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); 10702 const contentRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 10703 const composedRefs = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_5__/* .useComposedRefs */ .e)(forwardedRef, context.contentRef, contentRef); 10704 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 10705 const content = contentRef.current; 10706 if (content) return (0,aria_hidden__WEBPACK_IMPORTED_MODULE_12__/* .hideOthers */ .Ry)(content); 10707 }, []); 10708 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10709 DialogContentImpl, 10710 { 10711 ...props, 10712 ref: composedRefs, 10713 trapFocus: context.open, 10714 disableOutsidePointerEvents: true, 10715 onCloseAutoFocus: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_7__/* .composeEventHandlers */ .M)(props.onCloseAutoFocus, (event) => { 10716 event.preventDefault(); 10717 context.triggerRef.current?.focus(); 10718 }), 10719 onPointerDownOutside: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_7__/* .composeEventHandlers */ .M)(props.onPointerDownOutside, (event) => { 10720 const originalEvent = event.detail.originalEvent; 10721 const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; 10722 const isRightClick = originalEvent.button === 2 || ctrlLeftClick; 10723 if (isRightClick) event.preventDefault(); 10724 }), 10725 onFocusOutside: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_7__/* .composeEventHandlers */ .M)( 10726 props.onFocusOutside, 10727 (event) => event.preventDefault() 10728 ) 10729 } 10730 ); 10731 } 10732); 10733var DialogContentNonModal = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10734 (props, forwardedRef) => { 10735 const context = useDialogContext(CONTENT_NAME, props.__scopeDialog); 10736 const hasInteractedOutsideRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 10737 const hasPointerDownOutsideRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 10738 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10739 DialogContentImpl, 10740 { 10741 ...props, 10742 ref: forwardedRef, 10743 trapFocus: false, 10744 disableOutsidePointerEvents: false, 10745 onCloseAutoFocus: (event) => { 10746 props.onCloseAutoFocus?.(event); 10747 if (!event.defaultPrevented) { 10748 if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); 10749 event.preventDefault(); 10750 } 10751 hasInteractedOutsideRef.current = false;
10752 hasPointerDownOutsideRef.current = false; 10753 }, 10754 onInteractOutside: (event) => { 10755 props.onInteractOutside?.(event); 10756 if (!event.defaultPrevented) { 10757 hasInteractedOutsideRef.current = true; 10758 if (event.detail.originalEvent.type === "pointerdown") { 10759 hasPointerDownOutsideRef.current = true; 10760 } 10761 } 10762 const target = event.target; 10763 const targetIsTrigger = context.triggerRef.current?.contains(target); 10764 if (targetIsTrigger) event.preventDefault(); 10765 if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { 10766 event.preventDefault(); 10767 } 10768 } 10769 } 10770 ); 10771 } 10772); 10773var DialogContentImpl = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10774 (props, forwardedRef) => { 10775 const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props; 10776 const context = useDialogContext(CONTENT_NAME, __scopeDialog); 10777 const contentRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 10778 const composedRefs = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_5__/* .useComposedRefs */ .e)(forwardedRef, contentRef); 10779 (0,_radix_ui_react_focus_guards__WEBPACK_IMPORTED_MODULE_13__/* .useFocusGuards */ .EW)(); 10780 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children: [
10781 /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10782 _radix_ui_react_focus_scope__WEBPACK_IMPORTED_MODULE_14__/* .FocusScope */ .M, 10783 { 10784 asChild: true, 10785 loop: true, 10786 trapped: trapFocus, 10787 onMountAutoFocus: onOpenAutoFocus, 10788 onUnmountAutoFocus: onCloseAutoFocus, 10789 children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10790 _radix_ui_react_dismissable_layer__WEBPACK_IMPORTED_MODULE_15__/* .DismissableLayer */ .XB, 10791 { 10792 role: "dialog", 10793 id: context.contentId, 10794 "aria-describedby": context.descriptionId, 10795 "aria-labelledby": context.titleId, 10796 "data-state": getState(context.open), 10797 ...contentProps, 10798 ref: composedRefs, 10799 onDismiss: () => context.onOpenChange(false) 10800 } 10801 ) 10802 } 10803 ), 10804 /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children: [
vendor: 4,651 bytes, lines 10805-10906
10805 /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(TitleWarning, { titleId: context.titleId }), 10806 /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(DescriptionWarning, { contentRef, descriptionId: context.descriptionId }) 10807 ] }) 10808 ] }); 10809 } 10810); 10811var TITLE_NAME = "DialogTitle"; 10812var DialogTitle = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10813 (props, forwardedRef) => { 10814 const { __scopeDialog, ...titleProps } = props; 10815 const context = useDialogContext(TITLE_NAME, __scopeDialog); 10816 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__/* .Primitive */ .WV.h2, { id: context.titleId, ...titleProps, ref: forwardedRef }); 10817 } 10818); 10819DialogTitle.displayName = TITLE_NAME; 10820var DESCRIPTION_NAME = "DialogDescription"; 10821var DialogDescription = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10822 (props, forwardedRef) => { 10823 const { __scopeDialog, ...descriptionProps } = props; 10824 const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog); 10825 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__/* .Primitive */ .WV.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef }); 10826 } 10827); 10828DialogDescription.displayName = DESCRIPTION_NAME; 10829var CLOSE_NAME = "DialogClose"; 10830var DialogClose = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 10831 (props, forwardedRef) => { 10832 const { __scopeDialog, ...closeProps } = props; 10833 const context = useDialogContext(CLOSE_NAME, __scopeDialog); 10834 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 10835 _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_6__/* .Primitive */ .WV.button, 10836 { 10837 type: "button", 10838 ...closeProps, 10839 ref: forwardedRef, 10840 onClick: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_7__/* .composeEventHandlers */ .M)(props.onClick, () => context.onOpenChange(false)) 10841 } 10842 ); 10843 } 10844); 10845DialogClose.displayName = CLOSE_NAME; 10846function getState(open) { 10847 return open ? "open" : "closed"; 10848} 10849var TITLE_WARNING_NAME = "DialogTitleWarning"; 10850var [WarningProvider, useWarningContext] = (0,_radix_ui_react_context__WEBPACK_IMPORTED_MODULE_2__/* .createContext */ .k)(TITLE_WARNING_NAME, { 10851 contentName: CONTENT_NAME, 10852 titleName: TITLE_NAME, 10853 docsSlug: "dialog" 10854}); 10855var TitleWarning = ({ titleId }) => { 10856 const titleWarningContext = useWarningContext(TITLE_WARNING_NAME); 10857 const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users. 10858 10859If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component. 10860 10861For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`; 10862 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 10863 if (titleId) { 10864 const hasTitle = document.getElementById(titleId); 10865 if (!hasTitle) console.error(MESSAGE); 10866 } 10867 }, [MESSAGE, titleId]); 10868 return null; 10869}; 10870var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning"; 10871var DescriptionWarning = ({ contentRef, descriptionId }) => { 10872 const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME); 10873 const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`; 10874 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 10875 const describedById = contentRef.current?.getAttribute("aria-describedby"); 10876 if (descriptionId && describedById) { 10877 const hasDescription = document.getElementById(descriptionId); 10878 if (!hasDescription) console.warn(MESSAGE); 10879 } 10880 }, [MESSAGE, contentRef, descriptionId]); 10881 return null; 10882}; 10883var Root = Dialog; 10884var Trigger = DialogTrigger; 10885var Portal = DialogPortal; 10886var Overlay = DialogOverlay; 10887var Content = DialogContent; 10888var Title = DialogTitle; 10889var Description = DialogDescription; 10890var Close = DialogClose; 10891 10892//# sourceMappingURL=index.mjs.map 10893 10894 10895/***/ }), 10896 10897/***/ 8990: 10898/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 10899 10900"use strict"; 10901/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10902/* harmony export */ gm: function() { return /* binding */ useDirection; } 10903/* harmony export */ }); 10904/* unused harmony exports DirectionProvider, Provider */ 10905/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 10906/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893);
10907// packages/react/direction/src/Direction.tsx 10908 10909 10910var DirectionContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(void 0); 10911var DirectionProvider = (props) => { 10912 const { dir, children } = props; 10913 return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children }); 10914}; 10915function useDirection(localDir) { 10916 const globalDir = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DirectionContext); 10917 return localDir || globalDir || "ltr"; 10918} 10919var Provider = (/* unused pure expression or super */ null && (DirectionProvider)); 10920 10921//# sourceMappingURL=index.mjs.map 10922 10923 10924/***/ }), 10925 10926/***/ 6063: 10927/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 10928 10929"use strict"; 10930 10931// EXPORTS 10932__webpack_require__.d(__webpack_exports__, { 10933 XB: function() { return /* binding */ DismissableLayer; } 10934}); 10935 10936// UNUSED EXPORTS: Branch, DismissableLayerBranch, Root 10937 10938// EXTERNAL MODULE: ./node_modules/react/index.js 10939var react = __webpack_require__(7294); 10940// EXTERNAL MODULE: ./node_modules/@radix-ui/primitive/dist/index.mjs 10941var dist = __webpack_require__(6206); 10942// EXTERNAL MODULE: ./node_modules/@radix-ui/react-primitive/dist/index.mjs 10943var react_primitive_dist = __webpack_require__(5320); 10944// EXTERNAL MODULE: ./node_modules/@radix-ui/react-compose-refs/dist/index.mjs 10945var react_compose_refs_dist = __webpack_require__(8771); 10946// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs 10947var react_use_callback_ref_dist = __webpack_require__(9698); 10948;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
10949// packages/react/use-escape-keydown/src/useEscapeKeydown.tsx 10950 10951 10952function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) { 10953 const onEscapeKeyDown = (0,react_use_callback_ref_dist/* useCallbackRef */.W)(onEscapeKeyDownProp); 10954 react.useEffect(() => { 10955 const handleKeyDown = (event) => { 10956 if (event.key === "Escape") { 10957 onEscapeKeyDown(event); 10958 } 10959 }; 10960 ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true }); 10961 return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true }); 10962 }, [onEscapeKeyDown, ownerDocument]); 10963} 10964 10965//# sourceMappingURL=index.mjs.map 10966 10967// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 10968var jsx_runtime = __webpack_require__(5893); 10969;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs 10970"use client"; 10971
vendor: 6,804 bytes, lines 10972-11132
10972// packages/react/dismissable-layer/src/dismissable-layer.tsx 10973 10974 10975 10976 10977 10978 10979 10980var DISMISSABLE_LAYER_NAME = "DismissableLayer"; 10981var CONTEXT_UPDATE = "dismissableLayer.update"; 10982var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; 10983var FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; 10984var originalBodyPointerEvents; 10985var DismissableLayerContext = react.createContext({ 10986 layers: /* @__PURE__ */ new Set(), 10987 layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), 10988 branches: /* @__PURE__ */ new Set() 10989}); 10990var DismissableLayer = react.forwardRef( 10991 (props, forwardedRef) => { 10992 const { 10993 disableOutsidePointerEvents = false, 10994 onEscapeKeyDown, 10995 onPointerDownOutside, 10996 onFocusOutside, 10997 onInteractOutside, 10998 onDismiss, 10999 ...layerProps 11000 } = props; 11001 const context = react.useContext(DismissableLayerContext); 11002 const [node, setNode] = react.useState(null); 11003 const ownerDocument = node?.ownerDocument ?? globalThis?.document; 11004 const [, force] = react.useState({}); 11005 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, (node2) => setNode(node2)); 11006 const layers = Array.from(context.layers); 11007 const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); 11008 const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); 11009 const index = node ? layers.indexOf(node) : -1; 11010 const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; 11011 const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; 11012 const pointerDownOutside = usePointerDownOutside((event) => { 11013 const target = event.target; 11014 const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target)); 11015 if (!isPointerEventsEnabled || isPointerDownOnBranch) return; 11016 onPointerDownOutside?.(event); 11017 onInteractOutside?.(event); 11018 if (!event.defaultPrevented) onDismiss?.(); 11019 }, ownerDocument); 11020 const focusOutside = useFocusOutside((event) => { 11021 const target = event.target; 11022 const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target)); 11023 if (isFocusInBranch) return; 11024 onFocusOutside?.(event); 11025 onInteractOutside?.(event); 11026 if (!event.defaultPrevented) onDismiss?.(); 11027 }, ownerDocument); 11028 useEscapeKeydown((event) => { 11029 const isHighestLayer = index === context.layers.size - 1; 11030 if (!isHighestLayer) return; 11031 onEscapeKeyDown?.(event); 11032 if (!event.defaultPrevented && onDismiss) { 11033 event.preventDefault(); 11034 onDismiss(); 11035 } 11036 }, ownerDocument); 11037 react.useEffect(() => { 11038 if (!node) return; 11039 if (disableOutsidePointerEvents) { 11040 if (context.layersWithOutsidePointerEventsDisabled.size === 0) { 11041 originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; 11042 ownerDocument.body.style.pointerEvents = "none"; 11043 } 11044 context.layersWithOutsidePointerEventsDisabled.add(node); 11045 } 11046 context.layers.add(node); 11047 dispatchUpdate(); 11048 return () => { 11049 if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) { 11050 ownerDocument.body.style.pointerEvents = originalBodyPointerEvents; 11051 } 11052 }; 11053 }, [node, ownerDocument, disableOutsidePointerEvents, context]); 11054 react.useEffect(() => { 11055 return () => { 11056 if (!node) return; 11057 context.layers.delete(node); 11058 context.layersWithOutsidePointerEventsDisabled.delete(node); 11059 dispatchUpdate(); 11060 }; 11061 }, [node, context]); 11062 react.useEffect(() => { 11063 const handleUpdate = () => force({}); 11064 document.addEventListener(CONTEXT_UPDATE, handleUpdate); 11065 return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate); 11066 }, []); 11067 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 11068 react_primitive_dist/* Primitive */.WV.div, 11069 { 11070 ...layerProps, 11071 ref: composedRefs, 11072 style: { 11073 pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0, 11074 ...props.style 11075 }, 11076 onFocusCapture: (0,dist/* composeEventHandlers */.M)(props.onFocusCapture, focusOutside.onFocusCapture), 11077 onBlurCapture: (0,dist/* composeEventHandlers */.M)(props.onBlurCapture, focusOutside.onBlurCapture), 11078 onPointerDownCapture: (0,dist/* composeEventHandlers */.M)( 11079 props.onPointerDownCapture, 11080 pointerDownOutside.onPointerDownCapture 11081 ) 11082 } 11083 ); 11084 } 11085); 11086DismissableLayer.displayName = DISMISSABLE_LAYER_NAME; 11087var BRANCH_NAME = "DismissableLayerBranch"; 11088var DismissableLayerBranch = react.forwardRef((props, forwardedRef) => { 11089 const context = react.useContext(DismissableLayerContext); 11090 const ref = react.useRef(null); 11091 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, ref); 11092 react.useEffect(() => { 11093 const node = ref.current; 11094 if (node) { 11095 context.branches.add(node); 11096 return () => { 11097 context.branches.delete(node); 11098 }; 11099 } 11100 }, [context.branches]); 11101 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.div, { ...props, ref: composedRefs }); 11102}); 11103DismissableLayerBranch.displayName = BRANCH_NAME; 11104function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) { 11105 const handlePointerDownOutside = (0,react_use_callback_ref_dist/* useCallbackRef */.W)(onPointerDownOutside); 11106 const isPointerInsideReactTreeRef = react.useRef(false); 11107 const handleClickRef = react.useRef(() => { 11108 }); 11109 react.useEffect(() => { 11110 const handlePointerDown = (event) => { 11111 if (event.target && !isPointerInsideReactTreeRef.current) { 11112 let handleAndDispatchPointerDownOutsideEvent2 = function() { 11113 handleAndDispatchCustomEvent( 11114 POINTER_DOWN_OUTSIDE, 11115 handlePointerDownOutside, 11116 eventDetail, 11117 { discrete: true } 11118 ); 11119 }; 11120 var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2; 11121 const eventDetail = { originalEvent: event }; 11122 if (event.pointerType === "touch") { 11123 ownerDocument.removeEventListener("click", handleClickRef.current); 11124 handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2; 11125 ownerDocument.addEventListener("click", handleClickRef.current, { once: true }); 11126 } else { 11127 handleAndDispatchPointerDownOutsideEvent2(); 11128 } 11129 } else { 11130 ownerDocument.removeEventListener("click", handleClickRef.current); 11131 } 11132 isPointerInsideReactTreeRef.current = false;
vendor: 2,645 bytes, lines 11133-11200
11133 }; 11134 const timerId = window.setTimeout(() => { 11135 ownerDocument.addEventListener("pointerdown", handlePointerDown); 11136 }, 0); 11137 return () => { 11138 window.clearTimeout(timerId); 11139 ownerDocument.removeEventListener("pointerdown", handlePointerDown); 11140 ownerDocument.removeEventListener("click", handleClickRef.current); 11141 }; 11142 }, [ownerDocument, handlePointerDownOutside]); 11143 return { 11144 // ensures we check React component tree (not just DOM tree) 11145 onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true 11146 }; 11147} 11148function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) { 11149 const handleFocusOutside = (0,react_use_callback_ref_dist/* useCallbackRef */.W)(onFocusOutside); 11150 const isFocusInsideReactTreeRef = react.useRef(false); 11151 react.useEffect(() => { 11152 const handleFocus = (event) => { 11153 if (event.target && !isFocusInsideReactTreeRef.current) { 11154 const eventDetail = { originalEvent: event }; 11155 handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { 11156 discrete: false 11157 }); 11158 } 11159 }; 11160 ownerDocument.addEventListener("focusin", handleFocus); 11161 return () => ownerDocument.removeEventListener("focusin", handleFocus); 11162 }, [ownerDocument, handleFocusOutside]); 11163 return { 11164 onFocusCapture: () => isFocusInsideReactTreeRef.current = true, 11165 onBlurCapture: () => isFocusInsideReactTreeRef.current = false 11166 }; 11167} 11168function dispatchUpdate() { 11169 const event = new CustomEvent(CONTEXT_UPDATE); 11170 document.dispatchEvent(event); 11171} 11172function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) { 11173 const target = detail.originalEvent.target; 11174 const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); 11175 if (handler) target.addEventListener(name, handler, { once: true }); 11176 if (discrete) { 11177 (0,react_primitive_dist/* dispatchDiscreteCustomEvent */.jH)(target, event); 11178 } else { 11179 target.dispatchEvent(event); 11180 } 11181} 11182var Root = (/* unused pure expression or super */ null && (DismissableLayer)); 11183var Branch = (/* unused pure expression or super */ null && (DismissableLayerBranch)); 11184 11185//# sourceMappingURL=index.mjs.map 11186 11187 11188/***/ }), 11189 11190/***/ 7552: 11191/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 11192 11193"use strict"; 11194/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11195/* harmony export */ EW: function() { return /* binding */ useFocusGuards; } 11196/* harmony export */ }); 11197/* unused harmony exports FocusGuards, Root */ 11198/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 11199"use client"; 11200
11201// packages/react/focus-guards/src/FocusGuards.tsx 11202 11203var count = 0; 11204function FocusGuards(props) { 11205 useFocusGuards(); 11206 return props.children; 11207} 11208function useFocusGuards() { 11209 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 11210 const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]"); 11211 document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard()); 11212 document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard()); 11213 count++; 11214 return () => { 11215 if (count === 1) { 11216 document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove()); 11217 } 11218 count--; 11219 }; 11220 }, []); 11221} 11222function createFocusGuard() { 11223 const element = document.createElement("span"); 11224 element.setAttribute("data-radix-focus-guard", ""); 11225 element.tabIndex = 0; 11226 element.style.outline = "none"; 11227 element.style.opacity = "0"; 11228 element.style.position = "fixed"; 11229 element.style.pointerEvents = "none"; 11230 return element; 11231} 11232var Root = (/* unused pure expression or super */ null && (FocusGuards)); 11233 11234//# sourceMappingURL=index.mjs.map 11235 11236 11237/***/ }), 11238 11239/***/ 5420: 11240/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 11241 11242"use strict"; 11243/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11244/* harmony export */ M: function() { return /* binding */ FocusScope; } 11245/* harmony export */ }); 11246/* unused harmony export Root */ 11247/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 11248/* harmony import */ var _radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8771); 11249/* harmony import */ var _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5320); 11250/* harmony import */ var _radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9698); 11251/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893); 11252"use client"; 11253
vendor: 5,183 bytes, lines 11254-11367
11254// packages/react/focus-scope/src/focus-scope.tsx 11255 11256 11257 11258 11259 11260var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount"; 11261var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount"; 11262var EVENT_OPTIONS = { bubbles: false, cancelable: true }; 11263var FOCUS_SCOPE_NAME = "FocusScope"; 11264var FocusScope = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => { 11265 const { 11266 loop = false, 11267 trapped = false, 11268 onMountAutoFocus: onMountAutoFocusProp, 11269 onUnmountAutoFocus: onUnmountAutoFocusProp, 11270 ...scopeProps 11271 } = props; 11272 const [container, setContainer] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null); 11273 const onMountAutoFocus = (0,_radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_2__/* .useCallbackRef */ .W)(onMountAutoFocusProp); 11274 const onUnmountAutoFocus = (0,_radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_2__/* .useCallbackRef */ .W)(onUnmountAutoFocusProp); 11275 const lastFocusedElementRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 11276 const composedRefs = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_3__/* .useComposedRefs */ .e)(forwardedRef, (node) => setContainer(node)); 11277 const focusScope = react__WEBPACK_IMPORTED_MODULE_0__.useRef({ 11278 paused: false, 11279 pause() { 11280 this.paused = true; 11281 }, 11282 resume() { 11283 this.paused = false; 11284 } 11285 }).current; 11286 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 11287 if (trapped) { 11288 let handleFocusIn2 = function(event) { 11289 if (focusScope.paused || !container) return; 11290 const target = event.target; 11291 if (container.contains(target)) { 11292 lastFocusedElementRef.current = target; 11293 } else { 11294 focus(lastFocusedElementRef.current, { select: true }); 11295 } 11296 }, handleFocusOut2 = function(event) { 11297 if (focusScope.paused || !container) return; 11298 const relatedTarget = event.relatedTarget; 11299 if (relatedTarget === null) return; 11300 if (!container.contains(relatedTarget)) { 11301 focus(lastFocusedElementRef.current, { select: true }); 11302 } 11303 }, handleMutations2 = function(mutations) { 11304 const focusedElement = document.activeElement; 11305 if (focusedElement !== document.body) return; 11306 for (const mutation of mutations) { 11307 if (mutation.removedNodes.length > 0) focus(container); 11308 } 11309 }; 11310 var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2; 11311 document.addEventListener("focusin", handleFocusIn2); 11312 document.addEventListener("focusout", handleFocusOut2); 11313 const mutationObserver = new MutationObserver(handleMutations2); 11314 if (container) mutationObserver.observe(container, { childList: true, subtree: true }); 11315 return () => { 11316 document.removeEventListener("focusin", handleFocusIn2); 11317 document.removeEventListener("focusout", handleFocusOut2); 11318 mutationObserver.disconnect(); 11319 }; 11320 } 11321 }, [trapped, container, focusScope.paused]); 11322 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 11323 if (container) { 11324 focusScopesStack.add(focusScope); 11325 const previouslyFocusedElement = document.activeElement; 11326 const hasFocusedCandidate = container.contains(previouslyFocusedElement); 11327 if (!hasFocusedCandidate) { 11328 const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS); 11329 container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); 11330 container.dispatchEvent(mountEvent); 11331 if (!mountEvent.defaultPrevented) { 11332 focusFirst(removeLinks(getTabbableCandidates(container)), { select: true }); 11333 if (document.activeElement === previouslyFocusedElement) { 11334 focus(container); 11335 } 11336 } 11337 } 11338 return () => { 11339 container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); 11340 setTimeout(() => { 11341 const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS); 11342 container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); 11343 container.dispatchEvent(unmountEvent); 11344 if (!unmountEvent.defaultPrevented) { 11345 focus(previouslyFocusedElement ?? document.body, { select: true }); 11346 } 11347 container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); 11348 focusScopesStack.remove(focusScope); 11349 }, 0); 11350 }; 11351 } 11352 }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]); 11353 const handleKeyDown = react__WEBPACK_IMPORTED_MODULE_0__.useCallback( 11354 (event) => { 11355 if (!loop && !trapped) return; 11356 if (focusScope.paused) return; 11357 const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey; 11358 const focusedElement = document.activeElement; 11359 if (isTabKey && focusedElement) { 11360 const container2 = event.currentTarget; 11361 const [first, last] = getTabbableEdges(container2); 11362 const hasTabbableElementsInside = first && last; 11363 if (!hasTabbableElementsInside) { 11364 if (focusedElement === container2) event.preventDefault(); 11365 } else { 11366 if (!event.shiftKey && focusedElement === last) { 11367 event.preventDefault();
vendor: 3,869 bytes, lines 11368-11476
11368 if (loop) focus(first, { select: true }); 11369 } else if (event.shiftKey && focusedElement === first) { 11370 event.preventDefault(); 11371 if (loop) focus(last, { select: true }); 11372 } 11373 } 11374 } 11375 }, 11376 [loop, trapped, focusScope.paused] 11377 ); 11378 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_4__/* .Primitive */ .WV.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown }); 11379}); 11380FocusScope.displayName = FOCUS_SCOPE_NAME; 11381function focusFirst(candidates, { select = false } = {}) { 11382 const previouslyFocusedElement = document.activeElement; 11383 for (const candidate of candidates) { 11384 focus(candidate, { select }); 11385 if (document.activeElement !== previouslyFocusedElement) return; 11386 } 11387} 11388function getTabbableEdges(container) { 11389 const candidates = getTabbableCandidates(container); 11390 const first = findVisible(candidates, container); 11391 const last = findVisible(candidates.reverse(), container); 11392 return [first, last]; 11393} 11394function getTabbableCandidates(container) { 11395 const nodes = []; 11396 const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { 11397 acceptNode: (node) => { 11398 const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; 11399 if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; 11400 return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; 11401 } 11402 }); 11403 while (walker.nextNode()) nodes.push(walker.currentNode); 11404 return nodes; 11405} 11406function findVisible(elements, container) { 11407 for (const element of elements) { 11408 if (!isHidden(element, { upTo: container })) return element; 11409 } 11410} 11411function isHidden(node, { upTo }) { 11412 if (getComputedStyle(node).visibility === "hidden") return true; 11413 while (node) { 11414 if (upTo !== void 0 && node === upTo) return false; 11415 if (getComputedStyle(node).display === "none") return true; 11416 node = node.parentElement; 11417 } 11418 return false; 11419} 11420function isSelectableInput(element) { 11421 return element instanceof HTMLInputElement && "select" in element; 11422} 11423function focus(element, { select = false } = {}) { 11424 if (element && element.focus) { 11425 const previouslyFocusedElement = document.activeElement; 11426 element.focus({ preventScroll: true }); 11427 if (element !== previouslyFocusedElement && isSelectableInput(element) && select) 11428 element.select(); 11429 } 11430} 11431var focusScopesStack = createFocusScopesStack(); 11432function createFocusScopesStack() { 11433 let stack = []; 11434 return { 11435 add(focusScope) { 11436 const activeFocusScope = stack[0]; 11437 if (focusScope !== activeFocusScope) { 11438 activeFocusScope?.pause(); 11439 } 11440 stack = arrayRemove(stack, focusScope); 11441 stack.unshift(focusScope); 11442 }, 11443 remove(focusScope) { 11444 stack = arrayRemove(stack, focusScope); 11445 stack[0]?.resume(); 11446 } 11447 }; 11448} 11449function arrayRemove(array, item) { 11450 const updatedArray = [...array]; 11451 const index = updatedArray.indexOf(item); 11452 if (index !== -1) { 11453 updatedArray.splice(index, 1); 11454 } 11455 return updatedArray; 11456} 11457function removeLinks(items) { 11458 return items.filter((item) => item.tagName !== "A"); 11459} 11460var Root = (/* unused pure expression or super */ null && (FocusScope)); 11461 11462//# sourceMappingURL=index.mjs.map 11463 11464 11465/***/ }), 11466 11467/***/ 1276: 11468/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 11469 11470"use strict"; 11471var react__WEBPACK_IMPORTED_MODULE_0___namespace_cache; 11472/* harmony export */ __webpack_require__.d(__webpack_exports__, { 11473/* harmony export */ M: function() { return /* binding */ useId; } 11474/* harmony export */ }); 11475/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 11476/* harmony import */ var _radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9981);
11477// packages/react/id/src/id.tsx 11478 11479 11480var useReactId = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))["useId".toString()] || (() => void 0); 11481var count = 0; 11482function useId(deterministicId) { 11483 const [id, setId] = react__WEBPACK_IMPORTED_MODULE_0__.useState(useReactId()); 11484 (0,_radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_1__/* .useLayoutEffect */ .b)(() => { 11485 if (!deterministicId) setId((reactId) => reactId ?? String(count++)); 11486 }, [deterministicId]); 11487 return deterministicId || (id ? `radix-${id}` : ""); 11488} 11489 11490//# sourceMappingURL=index.mjs.map 11491 11492 11493/***/ }), 11494 11495/***/ 2234: 11496/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 11497 11498"use strict"; 11499 11500// EXPORTS 11501__webpack_require__.d(__webpack_exports__, { 11502 oC: function() { return /* binding */ CheckboxItem2; }, 11503 VY: function() { return /* binding */ dist_Content2; }, 11504 ck: function() { return /* binding */ Item3; }, 11505 wU: function() { return /* binding */ ItemIndicator2; }, 11506 __: function() { return /* binding */ Label2; }, 11507 v2: function() { return /* binding */ dist_Menu; }, 11508 h_: function() { return /* binding */ Portal2; }, 11509 Rk: function() { return /* binding */ RadioItem2; }, 11510 fC: function() { return /* binding */ dist_Root3; }, 11511 Z0: function() { return /* binding */ Separator2; }, 11512 Tr: function() { return /* binding */ Sub2; }, 11513 tu: function() { return /* binding */ SubContent2; }, 11514 fF: function() { return /* binding */ SubTrigger2; }, 11515 xz: function() { return /* binding */ Trigger; } 11516}); 11517 11518// UNUSED EXPORTS: Arrow, Group, Menubar, MenubarArrow, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarItemIndicator, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, RadioGroup, createMenubarScope 11519 11520// EXTERNAL MODULE: ./node_modules/react/index.js 11521var react = __webpack_require__(7294); 11522// EXTERNAL MODULE: ./node_modules/@radix-ui/react-collection/dist/index.mjs 11523var dist = __webpack_require__(5936); 11524// EXTERNAL MODULE: ./node_modules/@radix-ui/react-direction/dist/index.mjs 11525var react_direction_dist = __webpack_require__(8990); 11526// EXTERNAL MODULE: ./node_modules/@radix-ui/primitive/dist/index.mjs 11527var primitive_dist = __webpack_require__(6206); 11528// EXTERNAL MODULE: ./node_modules/@radix-ui/react-compose-refs/dist/index.mjs 11529var react_compose_refs_dist = __webpack_require__(8771); 11530// EXTERNAL MODULE: ./node_modules/@radix-ui/react-context/dist/index.mjs 11531var react_context_dist = __webpack_require__(5360); 11532// EXTERNAL MODULE: ./node_modules/@radix-ui/react-id/dist/index.mjs 11533var react_id_dist = __webpack_require__(1276); 11534// EXTERNAL MODULE: ./node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs + 1 modules
11535var react_dismissable_layer_dist = __webpack_require__(6063); 11536// EXTERNAL MODULE: ./node_modules/@radix-ui/react-focus-guards/dist/index.mjs 11537var react_focus_guards_dist = __webpack_require__(7552); 11538// EXTERNAL MODULE: ./node_modules/@radix-ui/react-focus-scope/dist/index.mjs 11539var react_focus_scope_dist = __webpack_require__(5420); 11540// EXTERNAL MODULE: ./node_modules/@radix-ui/react-popper/dist/index.mjs + 6 modules 11541var react_popper_dist = __webpack_require__(3990); 11542// EXTERNAL MODULE: ./node_modules/@radix-ui/react-portal/dist/index.mjs 11543var react_portal_dist = __webpack_require__(2651); 11544// EXTERNAL MODULE: ./node_modules/@radix-ui/react-presence/dist/index.mjs 11545var react_presence_dist = __webpack_require__(9115); 11546// EXTERNAL MODULE: ./node_modules/@radix-ui/react-primitive/dist/index.mjs 11547var react_primitive_dist = __webpack_require__(5320); 11548// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs 11549var react_use_callback_ref_dist = __webpack_require__(9698); 11550// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs 11551var react_use_controllable_state_dist = __webpack_require__(7342); 11552// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 11553var jsx_runtime = __webpack_require__(5893); 11554;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-roving-focus/dist/index.mjs 11555"use client"; 11556
vendor: 4,608 bytes, lines 11557-11665
11557// packages/react/roving-focus/src/roving-focus-group.tsx 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus"; 11570var EVENT_OPTIONS = { bubbles: false, cancelable: true }; 11571var GROUP_NAME = "RovingFocusGroup"; 11572var [Collection, useCollection, createCollectionScope] = (0,dist/* createCollection */.B)(GROUP_NAME); 11573var [createRovingFocusGroupContext, createRovingFocusGroupScope] = (0,react_context_dist/* createContextScope */.b)( 11574 GROUP_NAME, 11575 [createCollectionScope] 11576); 11577var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME); 11578var RovingFocusGroup = react.forwardRef( 11579 (props, forwardedRef) => { 11580 return /* @__PURE__ */ (0,jsx_runtime.jsx)(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) }); 11581 } 11582); 11583RovingFocusGroup.displayName = GROUP_NAME; 11584var RovingFocusGroupImpl = react.forwardRef((props, forwardedRef) => { 11585 const { 11586 __scopeRovingFocusGroup, 11587 orientation, 11588 loop = false, 11589 dir, 11590 currentTabStopId: currentTabStopIdProp, 11591 defaultCurrentTabStopId, 11592 onCurrentTabStopIdChange, 11593 onEntryFocus, 11594 preventScrollOnEntryFocus = false, 11595 ...groupProps 11596 } = props; 11597 const ref = react.useRef(null); 11598 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, ref); 11599 const direction = (0,react_direction_dist/* useDirection */.gm)(dir); 11600 const [currentTabStopId = null, setCurrentTabStopId] = (0,react_use_controllable_state_dist/* useControllableState */.T)({ 11601 prop: currentTabStopIdProp, 11602 defaultProp: defaultCurrentTabStopId, 11603 onChange: onCurrentTabStopIdChange 11604 }); 11605 const [isTabbingBackOut, setIsTabbingBackOut] = react.useState(false); 11606 const handleEntryFocus = (0,react_use_callback_ref_dist/* useCallbackRef */.W)(onEntryFocus); 11607 const getItems = useCollection(__scopeRovingFocusGroup); 11608 const isClickFocusRef = react.useRef(false); 11609 const [focusableItemsCount, setFocusableItemsCount] = react.useState(0); 11610 react.useEffect(() => { 11611 const node = ref.current; 11612 if (node) { 11613 node.addEventListener(ENTRY_FOCUS, handleEntryFocus); 11614 return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus); 11615 } 11616 }, [handleEntryFocus]); 11617 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 11618 RovingFocusProvider, 11619 { 11620 scope: __scopeRovingFocusGroup, 11621 orientation, 11622 dir: direction, 11623 loop, 11624 currentTabStopId, 11625 onItemFocus: react.useCallback( 11626 (tabStopId) => setCurrentTabStopId(tabStopId), 11627 [setCurrentTabStopId] 11628 ), 11629 onItemShiftTab: react.useCallback(() => setIsTabbingBackOut(true), []), 11630 onFocusableItemAdd: react.useCallback( 11631 () => setFocusableItemsCount((prevCount) => prevCount + 1), 11632 [] 11633 ), 11634 onFocusableItemRemove: react.useCallback( 11635 () => setFocusableItemsCount((prevCount) => prevCount - 1), 11636 [] 11637 ), 11638 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 11639 react_primitive_dist/* Primitive */.WV.div, 11640 { 11641 tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0, 11642 "data-orientation": orientation, 11643 ...groupProps, 11644 ref: composedRefs, 11645 style: { outline: "none", ...props.style }, 11646 onMouseDown: (0,primitive_dist/* composeEventHandlers */.M)(props.onMouseDown, () => { 11647 isClickFocusRef.current = true; 11648 }), 11649 onFocus: (0,primitive_dist/* composeEventHandlers */.M)(props.onFocus, (event) => { 11650 const isKeyboardFocus = !isClickFocusRef.current; 11651 if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) { 11652 const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS); 11653 event.currentTarget.dispatchEvent(entryFocusEvent); 11654 if (!entryFocusEvent.defaultPrevented) { 11655 const items = getItems().filter((item) => item.focusable); 11656 const activeItem = items.find((item) => item.active); 11657 const currentItem = items.find((item) => item.id === currentTabStopId); 11658 const candidateItems = [activeItem, currentItem, ...items].filter( 11659 Boolean 11660 ); 11661 const candidateNodes = candidateItems.map((item) => item.ref.current); 11662 focusFirst(candidateNodes, preventScrollOnEntryFocus); 11663 } 11664 } 11665 isClickFocusRef.current = false;
vendor: 4,815 bytes, lines 11666-11786
11666 }), 11667 onBlur: (0,primitive_dist/* composeEventHandlers */.M)(props.onBlur, () => setIsTabbingBackOut(false)) 11668 } 11669 ) 11670 } 11671 ); 11672}); 11673var ITEM_NAME = "RovingFocusGroupItem"; 11674var RovingFocusGroupItem = react.forwardRef( 11675 (props, forwardedRef) => { 11676 const { 11677 __scopeRovingFocusGroup, 11678 focusable = true, 11679 active = false, 11680 tabStopId, 11681 ...itemProps 11682 } = props; 11683 const autoId = (0,react_id_dist/* useId */.M)(); 11684 const id = tabStopId || autoId; 11685 const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup); 11686 const isCurrentTabStop = context.currentTabStopId === id; 11687 const getItems = useCollection(__scopeRovingFocusGroup); 11688 const { onFocusableItemAdd, onFocusableItemRemove } = context; 11689 react.useEffect(() => { 11690 if (focusable) { 11691 onFocusableItemAdd(); 11692 return () => onFocusableItemRemove(); 11693 } 11694 }, [focusable, onFocusableItemAdd, onFocusableItemRemove]); 11695 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 11696 Collection.ItemSlot, 11697 { 11698 scope: __scopeRovingFocusGroup, 11699 id, 11700 focusable, 11701 active, 11702 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 11703 react_primitive_dist/* Primitive */.WV.span, 11704 { 11705 tabIndex: isCurrentTabStop ? 0 : -1, 11706 "data-orientation": context.orientation, 11707 ...itemProps, 11708 ref: forwardedRef, 11709 onMouseDown: (0,primitive_dist/* composeEventHandlers */.M)(props.onMouseDown, (event) => { 11710 if (!focusable) event.preventDefault(); 11711 else context.onItemFocus(id); 11712 }), 11713 onFocus: (0,primitive_dist/* composeEventHandlers */.M)(props.onFocus, () => context.onItemFocus(id)), 11714 onKeyDown: (0,primitive_dist/* composeEventHandlers */.M)(props.onKeyDown, (event) => { 11715 if (event.key === "Tab" && event.shiftKey) { 11716 context.onItemShiftTab(); 11717 return; 11718 } 11719 if (event.target !== event.currentTarget) return; 11720 const focusIntent = getFocusIntent(event, context.orientation, context.dir); 11721 if (focusIntent !== void 0) { 11722 if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return; 11723 event.preventDefault(); 11724 const items = getItems().filter((item) => item.focusable); 11725 let candidateNodes = items.map((item) => item.ref.current); 11726 if (focusIntent === "last") candidateNodes.reverse(); 11727 else if (focusIntent === "prev" || focusIntent === "next") { 11728 if (focusIntent === "prev") candidateNodes.reverse(); 11729 const currentIndex = candidateNodes.indexOf(event.currentTarget); 11730 candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1); 11731 } 11732 setTimeout(() => focusFirst(candidateNodes)); 11733 } 11734 }) 11735 } 11736 ) 11737 } 11738 ); 11739 } 11740); 11741RovingFocusGroupItem.displayName = ITEM_NAME; 11742var MAP_KEY_TO_FOCUS_INTENT = { 11743 ArrowLeft: "prev", 11744 ArrowUp: "prev", 11745 ArrowRight: "next", 11746 ArrowDown: "next", 11747 PageUp: "first", 11748 Home: "first", 11749 PageDown: "last", 11750 End: "last" 11751}; 11752function getDirectionAwareKey(key, dir) { 11753 if (dir !== "rtl") return key; 11754 return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key; 11755} 11756function getFocusIntent(event, orientation, dir) { 11757 const key = getDirectionAwareKey(event.key, dir); 11758 if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0; 11759 if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0; 11760 return MAP_KEY_TO_FOCUS_INTENT[key]; 11761} 11762function focusFirst(candidates, preventScroll = false) { 11763 const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; 11764 for (const candidate of candidates) { 11765 if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; 11766 candidate.focus({ preventScroll }); 11767 if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; 11768 } 11769} 11770function wrapArray(array, startIndex) { 11771 return array.map((_, index) => array[(startIndex + index) % array.length]); 11772} 11773var Root = RovingFocusGroup; 11774var Item = RovingFocusGroupItem; 11775 11776//# sourceMappingURL=index.mjs.map 11777 11778// EXTERNAL MODULE: ./node_modules/@radix-ui/react-slot/dist/index.mjs 11779var react_slot_dist = __webpack_require__(8426); 11780// EXTERNAL MODULE: ./node_modules/aria-hidden/dist/es2015/index.js 11781var es2015 = __webpack_require__(3541); 11782// EXTERNAL MODULE: ./node_modules/react-remove-scroll/dist/es2015/Combination.js + 21 modules 11783var Combination = __webpack_require__(6223); 11784;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-menu/dist/index.mjs 11785"use client"; 11786
11787// packages/react/menu/src/menu.tsx 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810var SELECTION_KEYS = ["Enter", " "]; 11811var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"]; 11812var LAST_KEYS = ["ArrowUp", "PageDown", "End"]; 11813var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS]; 11814var SUB_OPEN_KEYS = { 11815 ltr: [...SELECTION_KEYS, "ArrowRight"], 11816 rtl: [...SELECTION_KEYS, "ArrowLeft"] 11817}; 11818var SUB_CLOSE_KEYS = { 11819 ltr: ["ArrowLeft"], 11820 rtl: ["ArrowRight"] 11821}; 11822var MENU_NAME = "Menu"; 11823var [dist_Collection, dist_useCollection, dist_createCollectionScope] = (0,dist/* createCollection */.B)(MENU_NAME); 11824var [createMenuContext, createMenuScope] = (0,react_context_dist/* createContextScope */.b)(MENU_NAME, [ 11825 dist_createCollectionScope, 11826 react_popper_dist/* createPopperScope */.D7, 11827 createRovingFocusGroupScope 11828]); 11829var usePopperScope = (0,react_popper_dist/* createPopperScope */.D7)(); 11830var useRovingFocusGroupScope = createRovingFocusGroupScope(); 11831var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME); 11832var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME); 11833var Menu = (props) => { 11834 const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props; 11835 const popperScope = usePopperScope(__scopeMenu); 11836 const [content, setContent] = react.useState(null); 11837 const isUsingKeyboardRef = react.useRef(false); 11838 const handleOpenChange = (0,react_use_callback_ref_dist/* useCallbackRef */.W)(onOpenChange); 11839 const direction = (0,react_direction_dist/* useDirection */.gm)(dir); 11840 react.useEffect(() => { 11841 const handleKeyDown = () => { 11842 isUsingKeyboardRef.current = true; 11843 document.addEventListener("pointerdown", handlePointer, { capture: true, once: true }); 11844 document.addEventListener("pointermove", handlePointer, { capture: true, once: true }); 11845 }; 11846 const handlePointer = () => isUsingKeyboardRef.current = false; 11847 document.addEventListener("keydown", handleKeyDown, { capture: true }); 11848 return () => { 11849 document.removeEventListener("keydown", handleKeyDown, { capture: true }); 11850 document.removeEventListener("pointerdown", handlePointer, { capture: true }); 11851 document.removeEventListener("pointermove", handlePointer, { capture: true }); 11852 }; 11853 }, []); 11854 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_popper_dist/* Root */.fC, { ...popperScope, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 11855 MenuProvider, 11856 { 11857 scope: __scopeMenu, 11858 open, 11859 onOpenChange: handleOpenChange, 11860 content, 11861 onContentChange: setContent, 11862 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 11863 MenuRootProvider, 11864 { 11865 scope: __scopeMenu, 11866 onClose: react.useCallback(() => handleOpenChange(false), [handleOpenChange]), 11867 isUsingKeyboardRef, 11868 dir: direction, 11869 modal, 11870 children 11871 } 11872 ) 11873 } 11874 ) }); 11875}; 11876Menu.displayName = MENU_NAME; 11877var ANCHOR_NAME = "MenuAnchor"; 11878var MenuAnchor = react.forwardRef( 11879 (props, forwardedRef) => { 11880 const { __scopeMenu, ...anchorProps } = props; 11881 const popperScope = usePopperScope(__scopeMenu); 11882 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_popper_dist/* Anchor */.ee, { ...popperScope, ...anchorProps, ref: forwardedRef }); 11883 } 11884); 11885MenuAnchor.displayName = ANCHOR_NAME; 11886var PORTAL_NAME = "MenuPortal"; 11887var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, { 11888 forceMount: void 0 11889}); 11890var MenuPortal = (props) => { 11891 const { __scopeMenu, forceMount, children, container } = props; 11892 const context = useMenuContext(PORTAL_NAME, __scopeMenu); 11893 return /* @__PURE__ */ (0,jsx_runtime.jsx)(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(react_presence_dist/* Presence */.z, { present: forceMount || context.open, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(react_portal_dist/* Portal */.h, { asChild: true, container, children }) }) }); 11894}; 11895MenuPortal.displayName = PORTAL_NAME; 11896var CONTENT_NAME = "MenuContent"; 11897var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME); 11898var MenuContent = react.forwardRef( 11899 (props, forwardedRef) => { 11900 const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu); 11901 const { forceMount = portalContext.forceMount, ...contentProps } = props; 11902 const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); 11903 const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu); 11904 return /* @__PURE__ */ (0,jsx_runtime.jsx)(dist_Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(react_presence_dist/* Presence */.z, { present: forceMount || context.open, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(dist_Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__P
vendor: 10,452 bytes, lines 11904-12138
11904URE__ */ (0,jsx_runtime.jsx)(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) }); 11905 } 11906); 11907var MenuRootContentModal = react.forwardRef( 11908 (props, forwardedRef) => { 11909 const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); 11910 const ref = react.useRef(null); 11911 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, ref); 11912 react.useEffect(() => { 11913 const content = ref.current; 11914 if (content) return (0,es2015/* hideOthers */.Ry)(content); 11915 }, []); 11916 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 11917 MenuContentImpl, 11918 { 11919 ...props, 11920 ref: composedRefs, 11921 trapFocus: context.open, 11922 disableOutsidePointerEvents: context.open, 11923 disableOutsideScroll: true, 11924 onFocusOutside: (0,primitive_dist/* composeEventHandlers */.M)( 11925 props.onFocusOutside, 11926 (event) => event.preventDefault(), 11927 { checkForDefaultPrevented: false } 11928 ), 11929 onDismiss: () => context.onOpenChange(false) 11930 } 11931 ); 11932 } 11933); 11934var MenuRootContentNonModal = react.forwardRef((props, forwardedRef) => { 11935 const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); 11936 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 11937 MenuContentImpl, 11938 { 11939 ...props, 11940 ref: forwardedRef, 11941 trapFocus: false, 11942 disableOutsidePointerEvents: false, 11943 disableOutsideScroll: false, 11944 onDismiss: () => context.onOpenChange(false) 11945 } 11946 ); 11947}); 11948var MenuContentImpl = react.forwardRef( 11949 (props, forwardedRef) => { 11950 const { 11951 __scopeMenu, 11952 loop = false, 11953 trapFocus, 11954 onOpenAutoFocus, 11955 onCloseAutoFocus, 11956 disableOutsidePointerEvents, 11957 onEntryFocus, 11958 onEscapeKeyDown, 11959 onPointerDownOutside, 11960 onFocusOutside, 11961 onInteractOutside, 11962 onDismiss, 11963 disableOutsideScroll, 11964 ...contentProps 11965 } = props; 11966 const context = useMenuContext(CONTENT_NAME, __scopeMenu); 11967 const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu); 11968 const popperScope = usePopperScope(__scopeMenu); 11969 const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu); 11970 const getItems = dist_useCollection(__scopeMenu); 11971 const [currentItemId, setCurrentItemId] = react.useState(null); 11972 const contentRef = react.useRef(null); 11973 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, contentRef, context.onContentChange); 11974 const timerRef = react.useRef(0); 11975 const searchRef = react.useRef(""); 11976 const pointerGraceTimerRef = react.useRef(0); 11977 const pointerGraceIntentRef = react.useRef(null); 11978 const pointerDirRef = react.useRef("right"); 11979 const lastPointerXRef = react.useRef(0); 11980 const ScrollLockWrapper = disableOutsideScroll ? Combination/* default */.Z : react.Fragment; 11981 const scrollLockWrapperProps = disableOutsideScroll ? { as: react_slot_dist/* Slot */.g7, allowPinchZoom: true } : void 0; 11982 const handleTypeaheadSearch = (key) => { 11983 const search = searchRef.current + key; 11984 const items = getItems().filter((item) => !item.disabled); 11985 const currentItem = document.activeElement; 11986 const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue; 11987 const values = items.map((item) => item.textValue); 11988 const nextMatch = getNextMatch(values, search, currentMatch); 11989 const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current; 11990 (function updateSearch(value) { 11991 searchRef.current = value; 11992 window.clearTimeout(timerRef.current); 11993 if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3); 11994 })(search); 11995 if (newItem) { 11996 setTimeout(() => newItem.focus()); 11997 } 11998 }; 11999 react.useEffect(() => { 12000 return () => window.clearTimeout(timerRef.current); 12001 }, []); 12002 (0,react_focus_guards_dist/* useFocusGuards */.EW)(); 12003 const isPointerMovingToSubmenu = react.useCallback((event) => { 12004 const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side; 12005 return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area); 12006 }, []); 12007 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 12008 MenuContentProvider, 12009 { 12010 scope: __scopeMenu, 12011 searchRef, 12012 onItemEnter: react.useCallback( 12013 (event) => { 12014 if (isPointerMovingToSubmenu(event)) event.preventDefault(); 12015 }, 12016 [isPointerMovingToSubmenu] 12017 ), 12018 onItemLeave: react.useCallback( 12019 (event) => { 12020 if (isPointerMovingToSubmenu(event)) return; 12021 contentRef.current?.focus(); 12022 setCurrentItemId(null); 12023 }, 12024 [isPointerMovingToSubmenu] 12025 ), 12026 onTriggerLeave: react.useCallback( 12027 (event) => { 12028 if (isPointerMovingToSubmenu(event)) event.preventDefault(); 12029 }, 12030 [isPointerMovingToSubmenu] 12031 ), 12032 pointerGraceTimerRef, 12033 onPointerGraceIntentChange: react.useCallback((intent) => { 12034 pointerGraceIntentRef.current = intent; 12035 }, []), 12036 children: /* @__PURE__ */ (0,jsx_runtime.jsx)(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12037 react_focus_scope_dist/* FocusScope */.M, 12038 { 12039 asChild: true, 12040 trapped: trapFocus, 12041 onMountAutoFocus: (0,primitive_dist/* composeEventHandlers */.M)(onOpenAutoFocus, (event) => { 12042 event.preventDefault(); 12043 contentRef.current?.focus({ preventScroll: true }); 12044 }), 12045 onUnmountAutoFocus: onCloseAutoFocus, 12046 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12047 react_dismissable_layer_dist/* DismissableLayer */.XB, 12048 { 12049 asChild: true, 12050 disableOutsidePointerEvents, 12051 onEscapeKeyDown, 12052 onPointerDownOutside, 12053 onFocusOutside, 12054 onInteractOutside, 12055 onDismiss, 12056 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12057 Root, 12058 { 12059 asChild: true, 12060 ...rovingFocusGroupScope, 12061 dir: rootContext.dir, 12062 orientation: "vertical", 12063 loop, 12064 currentTabStopId: currentItemId, 12065 onCurrentTabStopIdChange: setCurrentItemId, 12066 onEntryFocus: (0,primitive_dist/* composeEventHandlers */.M)(onEntryFocus, (event) => { 12067 if (!rootContext.isUsingKeyboardRef.current) event.preventDefault(); 12068 }), 12069 preventScrollOnEntryFocus: true, 12070 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12071 react_popper_dist/* Content */.VY, 12072 { 12073 role: "menu", 12074 "aria-orientation": "vertical", 12075 "data-state": getOpenState(context.open), 12076 "data-radix-menu-content": "", 12077 dir: rootContext.dir, 12078 ...popperScope, 12079 ...contentProps, 12080 ref: composedRefs, 12081 style: { outline: "none", ...contentProps.style }, 12082 onKeyDown: (0,primitive_dist/* composeEventHandlers */.M)(contentProps.onKeyDown, (event) => { 12083 const target = event.target; 12084 const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget; 12085 const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; 12086 const isCharacterKey = event.key.length === 1; 12087 if (isKeyDownInside) { 12088 if (event.key === "Tab") event.preventDefault(); 12089 if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key); 12090 } 12091 const content = contentRef.current; 12092 if (event.target !== content) return; 12093 if (!FIRST_LAST_KEYS.includes(event.key)) return; 12094 event.preventDefault(); 12095 const items = getItems().filter((item) => !item.disabled); 12096 const candidateNodes = items.map((item) => item.ref.current); 12097 if (LAST_KEYS.includes(event.key)) candidateNodes.reverse(); 12098 dist_focusFirst(candidateNodes); 12099 }), 12100 onBlur: (0,primitive_dist/* composeEventHandlers */.M)(props.onBlur, (event) => { 12101 if (!event.currentTarget.contains(event.target)) { 12102 window.clearTimeout(timerRef.current); 12103 searchRef.current = ""; 12104 } 12105 }), 12106 onPointerMove: (0,primitive_dist/* composeEventHandlers */.M)( 12107 props.onPointerMove, 12108 whenMouse((event) => { 12109 const target = event.target; 12110 const pointerXHasChanged = lastPointerXRef.current !== event.clientX; 12111 if (event.currentTarget.contains(target) && pointerXHasChanged) { 12112 const newDir = event.clientX > lastPointerXRef.current ? "right" : "left"; 12113 pointerDirRef.current = newDir; 12114 lastPointerXRef.current = event.clientX; 12115 } 12116 }) 12117 ) 12118 } 12119 ) 12120 } 12121 ) 12122 } 12123 ) 12124 } 12125 ) }) 12126 } 12127 ); 12128 } 12129); 12130MenuContent.displayName = CONTENT_NAME; 12131var dist_GROUP_NAME = "MenuGroup"; 12132var MenuGroup = react.forwardRef( 12133 (props, forwardedRef) => { 12134 const { __scopeMenu, ...groupProps } = props; 12135 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.div, { role: "group", ...groupProps, ref: forwardedRef }); 12136 } 12137); 12138MenuGroup.displayName = dist_GROUP_NAME;
12139var LABEL_NAME = "MenuLabel"; 12140var MenuLabel = react.forwardRef( 12141 (props, forwardedRef) => { 12142 const { __scopeMenu, ...labelProps } = props; 12143 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.div, { ...labelProps, ref: forwardedRef }); 12144 } 12145); 12146MenuLabel.displayName = LABEL_NAME; 12147var dist_ITEM_NAME = "MenuItem"; 12148var ITEM_SELECT = "menu.itemSelect"; 12149var MenuItem = react.forwardRef( 12150 (props, forwardedRef) => { 12151 const { disabled = false, onSelect, ...itemProps } = props; 12152 const ref = react.useRef(null); 12153 const rootContext = useMenuRootContext(dist_ITEM_NAME, props.__scopeMenu); 12154 const contentContext = useMenuContentContext(dist_ITEM_NAME, props.__scopeMenu); 12155 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, ref); 12156 const isPointerDownRef = react.useRef(false); 12157 const handleSelect = () => { 12158 const menuItem = ref.current; 12159 if (!disabled && menuItem) { 12160 const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true }); 12161 menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true }); 12162 (0,react_primitive_dist/* dispatchDiscreteCustomEvent */.jH)(menuItem, itemSelectEvent); 12163 if (itemSelectEvent.defaultPrevented) { 12164 isPointerDownRef.current = false; 12165 } else { 12166 rootContext.onClose(); 12167 } 12168 } 12169 }; 12170 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 12171 MenuItemImpl, 12172 { 12173 ...itemProps, 12174 ref: composedRefs, 12175 disabled, 12176 onClick: (0,primitive_dist/* composeEventHandlers */.M)(props.onClick, handleSelect), 12177 onPointerDown: (event) => { 12178 props.onPointerDown?.(event); 12179 isPointerDownRef.current = true; 12180 }, 12181 onPointerUp: (0,primitive_dist/* composeEventHandlers */.M)(props.onPointerUp, (event) => { 12182 if (!isPointerDownRef.current) event.currentTarget?.click(); 12183 }), 12184 onKeyDown: (0,primitive_dist/* composeEventHandlers */.M)(props.onKeyDown, (event) => { 12185 const isTypingAhead = contentContext.searchRef.current !== ""; 12186 if (disabled || isTypingAhead && event.key === " ") return; 12187 if (SELECTION_KEYS.includes(event.key)) { 12188 event.currentTarget.click(); 12189 event.preventDefault(); 12190 } 12191 }) 12192 } 12193 ); 12194 } 12195); 12196MenuItem.displayName = dist_ITEM_NAME; 12197var MenuItemImpl = react.forwardRef( 12198 (props, forwardedRef) => { 12199 const { __scopeMenu, disabled = false, textValue, ...itemProps } = props; 12200 const contentContext = useMenuContentContext(dist_ITEM_NAME, __scopeMenu); 12201 const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu); 12202 const ref = react.useRef(null); 12203 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, ref); 12204 const [isFocused, setIsFocused] = react.useState(false); 12205 const [textContent, setTextContent] = react.useState(""); 12206 react.useEffect(() => { 12207 const menuItem = ref.current; 12208 if (menuItem) { 12209 setTextContent((menuItem.textContent ?? "").trim()); 12210 } 12211 }, [itemProps.children]); 12212 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 12213 dist_Collection.ItemSlot, 12214 { 12215 scope: __scopeMenu, 12216 disabled, 12217 textValue: textValue ?? textContent, 12218 children: /* @__PURE__ */ (0,jsx_runtime.jsx)(Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12219 react_primitive_dist/* Primitive */.WV.div, 12220 { 12221 role: "menuitem", 12222 "data-highlighted": isFocused ? "" : void 0, 12223 "aria-disabled": disabled || void 0, 12224 "data-disabled": disabled ? "" : void 0, 12225 ...itemProps, 12226 ref: composedRefs, 12227 onPointerMove: (0,primitive_dist/* composeEventHandlers */.M)( 12228 props.onPointerMove, 12229 whenMouse((event) => { 12230 if (disabled) { 12231 contentContext.onItemLeave(event); 12232 } else { 12233 contentContext.onItemEnter(event); 12234 if (!event.defaultPrevented) { 12235 const item = event.currentTarget; 12236 item.focus({ preventScroll: true }); 12237 } 12238 } 12239 }) 12240 ), 12241 onPointerLeave: (0,primitive_dist/* composeEventHandlers */.M)( 12242 props.onPointerLeave, 12243 whenMouse((event) => contentContext.onItemLeave(event)) 12244 ), 12245 onFocus: (0,primitive_dist/* composeEventHandlers */.M)(props.onFocus, () => setIsFocused(true)), 12246 onBlur: (0,primitive_dist/* composeEventHandlers */.M)(props.onBlur, () => setIsFocused(false)) 12247 } 12248 ) }) 12249 } 12250 ); 12251 } 12252); 12253var CHECKBOX_ITEM_NAME = "MenuCheckboxItem"; 12254var MenuCheckboxItem = react.forwardRef( 12255 (props, forwardedRef) => { 12256 const { checked = false, onCheckedChange, ...checkboxItemProps } = props; 12257 return /* @__PURE__ */ (0,jsx_runtime.jsx)(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12258 MenuItem, 12259 { 12260 role: "menuitemcheckbox", 12261 "aria-checked": isIndeterminate(checked) ? "mixed" : checked, 12262 ...checkboxItemProps, 12263 ref: forwardedRef, 12264 "data-state": getCheckedState(checked), 12265 onSelect: (0,primitive_dist/* composeEventHandlers */.M)( 12266 checkboxItemProps.onSelect, 12267 () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked), 12268 { checkForDefaultPrevented: false } 12269 ) 12270 } 12271 ) }); 12272 } 12273); 12274MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME; 12275var RADIO_GROUP_NAME = "MenuRadioGroup"; 12276var [RadioGroupProvider, useRadioGroupContext] = createMenuContext( 12277 RADIO_GROUP_NAME, 12278 { value: void 0, onValueChange: () => { 12279 } } 12280); 12281var MenuRadioGroup = react.forwardRef( 12282 (props, forwardedRef) => { 12283 const { value, onValueChange, ...groupProps } = props; 12284 const handleValueChange = (0,react_use_callback_ref_dist/* useCallbackRef */.W)(onValueChange); 12285 return /* @__PURE__ */ (0,jsx_runtime.jsx)(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuGroup, { ...groupProps, ref: forwardedRef }) }); 12286 } 12287); 12288MenuRadioGroup.displayName = RADIO_GROUP_NAME; 12289var RADIO_ITEM_NAME = "MenuRadioItem"; 12290var MenuRadioItem = react.forwardRef( 12291 (props, forwardedRef) => { 12292 const { value, ...radioItemProps } = props; 12293 const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu); 12294 const checked = value === context.value; 12295 return /* @__PURE__ */ (0,jsx_runtime.jsx)(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12296 MenuItem, 12297 { 12298 role: "menuitemradio", 12299 "aria-checked": checked, 12300 ...radioItemProps, 12301 ref: forwardedRef, 12302 "data-state": getCheckedState(checked), 12303 onSelect: (0,primitive_dist/* composeEventHandlers */.M)( 12304 radioItemProps.onSelect, 12305 () => context.onValueChange?.(value), 12306 { checkForDefaultPrevented: false } 12307 ) 12308 } 12309 ) }); 12310 } 12311); 12312MenuRadioItem.displayName = RADIO_ITEM_NAME;
12313var ITEM_INDICATOR_NAME = "MenuItemIndicator"; 12314var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext( 12315 ITEM_INDICATOR_NAME, 12316 { checked: false } 12317); 12318var MenuItemIndicator = react.forwardRef( 12319 (props, forwardedRef) => { 12320 const { __scopeMenu, forceMount, ...itemIndicatorProps } = props; 12321 const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu); 12322 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 12323 react_presence_dist/* Presence */.z, 12324 { 12325 present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true, 12326 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12327 react_primitive_dist/* Primitive */.WV.span, 12328 { 12329 ...itemIndicatorProps, 12330 ref: forwardedRef, 12331 "data-state": getCheckedState(indicatorContext.checked) 12332 } 12333 ) 12334 } 12335 ); 12336 } 12337); 12338MenuItemIndicator.displayName = ITEM_INDICATOR_NAME; 12339var SEPARATOR_NAME = "MenuSeparator"; 12340var MenuSeparator = react.forwardRef( 12341 (props, forwardedRef) => { 12342 const { __scopeMenu, ...separatorProps } = props; 12343 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 12344 react_primitive_dist/* Primitive */.WV.div, 12345 { 12346 role: "separator", 12347 "aria-orientation": "horizontal", 12348 ...separatorProps, 12349 ref: forwardedRef 12350 } 12351 ); 12352 } 12353); 12354MenuSeparator.displayName = SEPARATOR_NAME; 12355var ARROW_NAME = "MenuArrow"; 12356var MenuArrow = react.forwardRef( 12357 (props, forwardedRef) => { 12358 const { __scopeMenu, ...arrowProps } = props; 12359 const popperScope = usePopperScope(__scopeMenu); 12360 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_popper_dist/* Arrow */.Eh, { ...popperScope, ...arrowProps, ref: forwardedRef }); 12361 } 12362); 12363MenuArrow.displayName = ARROW_NAME; 12364var SUB_NAME = "MenuSub";
vendor: 4,498 bytes, lines 12365-12465
12365var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME); 12366var MenuSub = (props) => { 12367 const { __scopeMenu, children, open = false, onOpenChange } = props; 12368 const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu); 12369 const popperScope = usePopperScope(__scopeMenu); 12370 const [trigger, setTrigger] = react.useState(null); 12371 const [content, setContent] = react.useState(null); 12372 const handleOpenChange = (0,react_use_callback_ref_dist/* useCallbackRef */.W)(onOpenChange); 12373 react.useEffect(() => { 12374 if (parentMenuContext.open === false) handleOpenChange(false); 12375 return () => handleOpenChange(false); 12376 }, [parentMenuContext.open, handleOpenChange]); 12377 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_popper_dist/* Root */.fC, { ...popperScope, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12378 MenuProvider, 12379 { 12380 scope: __scopeMenu, 12381 open, 12382 onOpenChange: handleOpenChange, 12383 content, 12384 onContentChange: setContent, 12385 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12386 MenuSubProvider, 12387 { 12388 scope: __scopeMenu, 12389 contentId: (0,react_id_dist/* useId */.M)(), 12390 triggerId: (0,react_id_dist/* useId */.M)(), 12391 trigger, 12392 onTriggerChange: setTrigger, 12393 children 12394 } 12395 ) 12396 } 12397 ) }); 12398}; 12399MenuSub.displayName = SUB_NAME; 12400var SUB_TRIGGER_NAME = "MenuSubTrigger"; 12401var MenuSubTrigger = react.forwardRef( 12402 (props, forwardedRef) => { 12403 const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu); 12404 const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu); 12405 const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu); 12406 const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu); 12407 const openTimerRef = react.useRef(null); 12408 const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext; 12409 const scope = { __scopeMenu: props.__scopeMenu }; 12410 const clearOpenTimer = react.useCallback(() => { 12411 if (openTimerRef.current) window.clearTimeout(openTimerRef.current); 12412 openTimerRef.current = null; 12413 }, []); 12414 react.useEffect(() => clearOpenTimer, [clearOpenTimer]); 12415 react.useEffect(() => { 12416 const pointerGraceTimer = pointerGraceTimerRef.current; 12417 return () => { 12418 window.clearTimeout(pointerGraceTimer); 12419 onPointerGraceIntentChange(null); 12420 }; 12421 }, [pointerGraceTimerRef, onPointerGraceIntentChange]); 12422 return /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12423 MenuItemImpl, 12424 { 12425 id: subContext.triggerId, 12426 "aria-haspopup": "menu", 12427 "aria-expanded": context.open, 12428 "aria-controls": subContext.contentId, 12429 "data-state": getOpenState(context.open), 12430 ...props, 12431 ref: (0,react_compose_refs_dist/* composeRefs */.F)(forwardedRef, subContext.onTriggerChange), 12432 onClick: (event) => { 12433 props.onClick?.(event); 12434 if (props.disabled || event.defaultPrevented) return; 12435 event.currentTarget.focus(); 12436 if (!context.open) context.onOpenChange(true); 12437 }, 12438 onPointerMove: (0,primitive_dist/* composeEventHandlers */.M)( 12439 props.onPointerMove, 12440 whenMouse((event) => { 12441 contentContext.onItemEnter(event); 12442 if (event.defaultPrevented) return; 12443 if (!props.disabled && !context.open && !openTimerRef.current) { 12444 contentContext.onPointerGraceIntentChange(null); 12445 openTimerRef.current = window.setTimeout(() => { 12446 context.onOpenChange(true); 12447 clearOpenTimer(); 12448 }, 100); 12449 } 12450 }) 12451 ), 12452 onPointerLeave: (0,primitive_dist/* composeEventHandlers */.M)( 12453 props.onPointerLeave, 12454 whenMouse((event) => { 12455 clearOpenTimer(); 12456 const contentRect = context.content?.getBoundingClientRect(); 12457 if (contentRect) { 12458 const side = context.content?.dataset.side; 12459 const rightSide = side === "right"; 12460 const bleed = rightSide ? -5 : 5; 12461 const contentNearEdge = contentRect[rightSide ? "left" : "right"]; 12462 const contentFarEdge = contentRect[rightSide ? "right" : "left"]; 12463 contentContext.onPointerGraceIntentChange({ 12464 area: [ 12465 // Apply a bleed on clientX to ensure that our exit point is
vendor: 5,380 bytes, lines 12466-12583
12466 // consistently within polygon bounds 12467 { x: event.clientX + bleed, y: event.clientY }, 12468 { x: contentNearEdge, y: contentRect.top }, 12469 { x: contentFarEdge, y: contentRect.top }, 12470 { x: contentFarEdge, y: contentRect.bottom }, 12471 { x: contentNearEdge, y: contentRect.bottom } 12472 ], 12473 side 12474 }); 12475 window.clearTimeout(pointerGraceTimerRef.current); 12476 pointerGraceTimerRef.current = window.setTimeout( 12477 () => contentContext.onPointerGraceIntentChange(null), 12478 300 12479 ); 12480 } else { 12481 contentContext.onTriggerLeave(event); 12482 if (event.defaultPrevented) return; 12483 contentContext.onPointerGraceIntentChange(null); 12484 } 12485 }) 12486 ), 12487 onKeyDown: (0,primitive_dist/* composeEventHandlers */.M)(props.onKeyDown, (event) => { 12488 const isTypingAhead = contentContext.searchRef.current !== ""; 12489 if (props.disabled || isTypingAhead && event.key === " ") return; 12490 if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) { 12491 context.onOpenChange(true); 12492 context.content?.focus(); 12493 event.preventDefault(); 12494 } 12495 }) 12496 } 12497 ) }); 12498 } 12499); 12500MenuSubTrigger.displayName = SUB_TRIGGER_NAME; 12501var SUB_CONTENT_NAME = "MenuSubContent"; 12502var MenuSubContent = react.forwardRef( 12503 (props, forwardedRef) => { 12504 const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu); 12505 const { forceMount = portalContext.forceMount, ...subContentProps } = props; 12506 const context = useMenuContext(CONTENT_NAME, props.__scopeMenu); 12507 const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu); 12508 const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu); 12509 const ref = react.useRef(null); 12510 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, ref); 12511 return /* @__PURE__ */ (0,jsx_runtime.jsx)(dist_Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(react_presence_dist/* Presence */.z, { present: forceMount || context.open, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(dist_Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12512 MenuContentImpl, 12513 { 12514 id: subContext.contentId, 12515 "aria-labelledby": subContext.triggerId, 12516 ...subContentProps, 12517 ref: composedRefs, 12518 align: "start", 12519 side: rootContext.dir === "rtl" ? "left" : "right", 12520 disableOutsidePointerEvents: false, 12521 disableOutsideScroll: false, 12522 trapFocus: false, 12523 onOpenAutoFocus: (event) => { 12524 if (rootContext.isUsingKeyboardRef.current) ref.current?.focus(); 12525 event.preventDefault(); 12526 }, 12527 onCloseAutoFocus: (event) => event.preventDefault(), 12528 onFocusOutside: (0,primitive_dist/* composeEventHandlers */.M)(props.onFocusOutside, (event) => { 12529 if (event.target !== subContext.trigger) context.onOpenChange(false); 12530 }), 12531 onEscapeKeyDown: (0,primitive_dist/* composeEventHandlers */.M)(props.onEscapeKeyDown, (event) => { 12532 rootContext.onClose(); 12533 event.preventDefault(); 12534 }), 12535 onKeyDown: (0,primitive_dist/* composeEventHandlers */.M)(props.onKeyDown, (event) => { 12536 const isKeyDownInside = event.currentTarget.contains(event.target); 12537 const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key); 12538 if (isKeyDownInside && isCloseKey) { 12539 context.onOpenChange(false); 12540 subContext.trigger?.focus(); 12541 event.preventDefault(); 12542 } 12543 }) 12544 } 12545 ) }) }) }); 12546 } 12547); 12548MenuSubContent.displayName = SUB_CONTENT_NAME; 12549function getOpenState(open) { 12550 return open ? "open" : "closed"; 12551} 12552function isIndeterminate(checked) { 12553 return checked === "indeterminate"; 12554} 12555function getCheckedState(checked) { 12556 return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked"; 12557} 12558function dist_focusFirst(candidates) { 12559 const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; 12560 for (const candidate of candidates) { 12561 if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; 12562 candidate.focus(); 12563 if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; 12564 } 12565} 12566function dist_wrapArray(array, startIndex) { 12567 return array.map((_, index) => array[(startIndex + index) % array.length]); 12568} 12569function getNextMatch(values, search, currentMatch) { 12570 const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]); 12571 const normalizedSearch = isRepeated ? search[0] : search; 12572 const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1; 12573 let wrappedValues = dist_wrapArray(values, Math.max(currentMatchIndex, 0)); 12574 const excludeCurrentMatch = normalizedSearch.length === 1; 12575 if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch); 12576 const nextMatch = wrappedValues.find( 12577 (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase()) 12578 ); 12579 return nextMatch !== currentMatch ? nextMatch : void 0; 12580} 12581function isPointInPolygon(point, polygon) { 12582 const { x, y } = point; 12583 let inside = false;
vendor: 1,198 bytes, lines 12584-12623
12584 for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { 12585 const xi = polygon[i].x; 12586 const yi = polygon[i].y; 12587 const xj = polygon[j].x; 12588 const yj = polygon[j].y; 12589 const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; 12590 if (intersect) inside = !inside; 12591 } 12592 return inside; 12593} 12594function isPointerInGraceArea(event, area) { 12595 if (!area) return false; 12596 const cursorPos = { x: event.clientX, y: event.clientY }; 12597 return isPointInPolygon(cursorPos, area); 12598} 12599function whenMouse(handler) { 12600 return (event) => event.pointerType === "mouse" ? handler(event) : void 0; 12601} 12602var Root3 = Menu; 12603var Anchor2 = MenuAnchor; 12604var Portal = MenuPortal; 12605var Content2 = MenuContent; 12606var Group = MenuGroup; 12607var Label = MenuLabel; 12608var Item2 = MenuItem; 12609var CheckboxItem = MenuCheckboxItem; 12610var RadioGroup = MenuRadioGroup; 12611var RadioItem = MenuRadioItem; 12612var ItemIndicator = MenuItemIndicator; 12613var Separator = MenuSeparator; 12614var Arrow2 = MenuArrow; 12615var Sub = MenuSub; 12616var SubTrigger = MenuSubTrigger; 12617var SubContent = MenuSubContent; 12618 12619//# sourceMappingURL=index.mjs.map 12620 12621;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-menubar/dist/index.mjs 12622"use client"; 12623
12624// packages/react/menubar/src/menubar.tsx 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639var MENUBAR_NAME = "Menubar"; 12640var [react_menubar_dist_Collection, react_menubar_dist_useCollection, react_menubar_dist_createCollectionScope] = (0,dist/* createCollection */.B)(MENUBAR_NAME); 12641var [createMenubarContext, createMenubarScope] = (0,react_context_dist/* createContextScope */.b)(MENUBAR_NAME, [ 12642 react_menubar_dist_createCollectionScope, 12643 createRovingFocusGroupScope 12644]); 12645var useMenuScope = createMenuScope(); 12646var dist_useRovingFocusGroupScope = createRovingFocusGroupScope(); 12647var [MenubarContextProvider, useMenubarContext] = createMenubarContext(MENUBAR_NAME); 12648var Menubar = react.forwardRef( 12649 (props, forwardedRef) => { 12650 const { 12651 __scopeMenubar, 12652 value: valueProp, 12653 onValueChange, 12654 defaultValue, 12655 loop = true, 12656 dir, 12657 ...menubarProps 12658 } = props; 12659 const direction = (0,react_direction_dist/* useDirection */.gm)(dir); 12660 const rovingFocusGroupScope = dist_useRovingFocusGroupScope(__scopeMenubar); 12661 const [value = "", setValue] = (0,react_use_controllable_state_dist/* useControllableState */.T)({ 12662 prop: valueProp, 12663 onChange: onValueChange, 12664 defaultProp: defaultValue 12665 }); 12666 const [currentTabStopId, setCurrentTabStopId] = react.useState(null); 12667 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 12668 MenubarContextProvider, 12669 { 12670 scope: __scopeMenubar, 12671 value, 12672 onMenuOpen: react.useCallback( 12673 (value2) => { 12674 setValue(value2); 12675 setCurrentTabStopId(value2); 12676 }, 12677 [setValue] 12678 ), 12679 onMenuClose: react.useCallback(() => setValue(""), [setValue]), 12680 onMenuToggle: react.useCallback( 12681 (value2) => { 12682 setValue((prevValue) => prevValue ? "" : value2); 12683 setCurrentTabStopId(value2); 12684 }, 12685 [setValue] 12686 ), 12687 dir: direction, 12688 loop, 12689 children: /* @__PURE__ */ (0,jsx_runtime.jsx)(react_menubar_dist_Collection.Provider, { scope: __scopeMenubar, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(react_menubar_dist_Collection.Slot, { scope: __scopeMenubar, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12690 Root, 12691 { 12692 asChild: true, 12693 ...rovingFocusGroupScope, 12694 orientation: "horizontal", 12695 loop, 12696 dir: direction, 12697 currentTabStopId, 12698 onCurrentTabStopIdChange: setCurrentTabStopId, 12699 children: /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.div, { role: "menubar", ...menubarProps, ref: forwardedRef }) 12700 } 12701 ) }) }) 12702 } 12703 ); 12704 } 12705); 12706Menubar.displayName = MENUBAR_NAME; 12707var dist_MENU_NAME = "MenubarMenu"; 12708var [MenubarMenuProvider, useMenubarMenuContext] = createMenubarContext(dist_MENU_NAME); 12709var MenubarMenu = (props) => { 12710 const { __scopeMenubar, value: valueProp, ...menuProps } = props; 12711 const autoValue = (0,react_id_dist/* useId */.M)(); 12712 const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE"; 12713 const context = useMenubarContext(dist_MENU_NAME, __scopeMenubar); 12714 const menuScope = useMenuScope(__scopeMenubar); 12715 const triggerRef = react.useRef(null); 12716 const wasKeyboardTriggerOpenRef = react.useRef(false); 12717 const open = context.value === value; 12718 react.useEffect(() => { 12719 if (!open) wasKeyboardTriggerOpenRef.current = false; 12720 }, [open]); 12721 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 12722 MenubarMenuProvider, 12723 { 12724 scope: __scopeMenubar, 12725 value, 12726 triggerId: (0,react_id_dist/* useId */.M)(), 12727 triggerRef, 12728 contentId: (0,react_id_dist/* useId */.M)(), 12729 wasKeyboardTriggerOpenRef, 12730 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12731 Root3, 12732 { 12733 ...menuScope, 12734 open, 12735 onOpenChange: (open2) => { 12736 if (!open2) context.onMenuClose(); 12737 }, 12738 modal: false, 12739 dir: context.dir, 12740 ...menuProps 12741 } 12742 ) 12743 } 12744 ); 12745}; 12746MenubarMenu.displayName = dist_MENU_NAME; 12747var TRIGGER_NAME = "MenubarTrigger"; 12748var MenubarTrigger = react.forwardRef( 12749 (props, forwardedRef) => { 12750 const { __scopeMenubar, disabled = false, ...triggerProps } = props; 12751 const rovingFocusGroupScope = dist_useRovingFocusGroupScope(__scopeMenubar); 12752 const menuScope = useMenuScope(__scopeMenubar); 12753 const context = useMenubarContext(TRIGGER_NAME, __scopeMenubar); 12754 const menuContext = useMenubarMenuContext(TRIGGER_NAME, __scopeMenubar); 12755 const ref = react.useRef(null); 12756 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, ref, menuContext.triggerRef); 12757 const [isFocused, setIsFocused] = react.useState(false); 12758 const open = context.value === menuContext.value; 12759 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_menubar_dist_Collection.ItemSlot, { scope: __scopeMenubar, value: menuContext.value, disabled, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12760 Item, 12761 { 12762 asChild: true, 12763 ...rovingFocusGroupScope, 12764 focusable: !disabled, 12765 tabStopId: menuContext.value, 12766 children: /* @__PURE__ */ (0,jsx_runtime.jsx)(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 12767 react_primitive_dist/* Primitive */.WV.button, 12768 { 12769 type: "button", 12770 role: "menuitem", 12771 id: menuContext.triggerId, 12772 "aria-haspopup": "menu", 12773 "aria-expanded": open, 12774 "aria-controls": open ? menuContext.contentId : void 0, 12775 "data-highlighted": isFocused ? "" : void 0, 12776 "data-state": open ? "open" : "closed", 12777 "data-disabled": disabled ? "" : void 0, 12778 disabled, 12779 ...triggerProps, 12780 ref: composedRefs, 12781 onPointerDown: (0,primitive_dist/* composeEventHandlers */.M)(props.onPointerDown, (event) => { 12782 if (!disabled && event.button === 0 && event.ctrlKey === false) { 12783 context.onMenuOpen(menuContext.value); 12784 if (!open) event.preventDefault(); 12785 } 12786 }), 12787 onPointerEnter: (0,primitive_dist/* composeEventHandlers */.M)(props.onPointerEnter, () => { 12788 const menubarOpen = Boolean(context.value); 12789 if (menubarOpen && !open) { 12790 context.onMenuOpen(menuContext.value); 12791 ref.current?.focus(); 12792 } 12793 }), 12794 onKeyDown: (0,primitive_dist/* composeEventHandlers */.M)(props.onKeyDown, (event) => { 12795 if (disabled) return; 12796 if (["Enter", " "].includes(event.key)) context.onMenuToggle(menuContext.value); 12797 if (event.key === "ArrowDown") context.onMenuOpen(menuContext.value); 12798 if (["Enter", " ", "ArrowDown"].includes(event.key)) { 12799 menuContext.wasKeyboardTriggerOpenRef.current = true; 12800 event.preventDefault(); 12801 } 12802 }), 12803 onFocus: (0,primitive_dist/* composeEventHandlers */.M)(props.onFocus, () => setIsFocused(true)), 12804 onBlur: (0,primitive_dist/* composeEventHandlers */.M)(props.onBlur, () => setIsFocused(false)) 12805 } 12806 ) }) 12807 } 12808 ) }); 12809 } 12810); 12811MenubarTrigger.displayName = TRIGGER_NAME; 12812var dist_PORTAL_NAME = "MenubarPortal"; 12813var MenubarPortal = (props) => { 12814 const { __scopeMenubar, ...portalProps } = props; 12815 const menuScope = useMenuScope(__scopeMenubar); 12816 return /* @__PURE__ */ (0,jsx_runtime.jsx)(Portal, { ...menuScope, ...portalProps }); 12817}; 12818MenubarPortal.displayName = dist_PORTAL_NAME; 12819var dist_CONTENT_NAME = "MenubarContent"; 12820var MenubarContent = react.forwardRef( 12821 (props, forwardedRef) => { 12822 const { __scopeMenubar, align = "start", ...contentProps } = props; 12823 const menuScope = useMenuScope(__scopeMenubar); 12824 const context = useMenubarContext(dist_CONTENT_NAME, __scopeMenubar); 12825 const menuContext = useMenubarMenuContext(dist_CONTENT_NAME, __scopeMenubar); 12826 const getItems = react_menubar_dist_useCollection(__scopeMenubar); 12827 const hasInteractedOutsideRef = react.useRef(false); 12828 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 12829 Content2, 12830 { 12831 id: menuContext.contentId, 12832 "aria-labelledby": menuContext.triggerId, 12833 "data-radix-menubar-content": "", 12834 ...menuScope, 12835 ...contentProps, 12836 ref: forwardedRef, 12837 align, 12838 onCloseAutoFocus: (0,primitive_dist/* composeEventHandlers */.M)(props.onCloseAutoFocus, (event) => { 12839 const menubarOpen = Boolean(context.value); 12840 if (!menubarOpen && !hasInteractedOutsideRef.current) { 12841 menuContext.triggerRef.current?.focus(); 12842 } 12843 hasInteractedOutsideRef.current = false;
vendor: 1,890 bytes, lines 12844-12874
12844 event.preventDefault(); 12845 }), 12846 onFocusOutside: (0,primitive_dist/* composeEventHandlers */.M)(props.onFocusOutside, (event) => { 12847 const target = event.target; 12848 const isMenubarTrigger = getItems().some((item) => item.ref.current?.contains(target)); 12849 if (isMenubarTrigger) event.preventDefault(); 12850 }), 12851 onInteractOutside: (0,primitive_dist/* composeEventHandlers */.M)(props.onInteractOutside, () => { 12852 hasInteractedOutsideRef.current = true; 12853 }), 12854 onEntryFocus: (event) => { 12855 if (!menuContext.wasKeyboardTriggerOpenRef.current) event.preventDefault(); 12856 }, 12857 onKeyDown: (0,primitive_dist/* composeEventHandlers */.M)( 12858 props.onKeyDown, 12859 (event) => { 12860 if (["ArrowRight", "ArrowLeft"].includes(event.key)) { 12861 const target = event.target; 12862 const targetIsSubTrigger = target.hasAttribute("data-radix-menubar-subtrigger"); 12863 const isKeyDownInsideSubMenu = target.closest("[data-radix-menubar-content]") !== event.currentTarget; 12864 const prevMenuKey = context.dir === "rtl" ? "ArrowRight" : "ArrowLeft"; 12865 const isPrevKey = prevMenuKey === event.key; 12866 const isNextKey = !isPrevKey; 12867 if (isNextKey && targetIsSubTrigger) return; 12868 if (isKeyDownInsideSubMenu && isPrevKey) return; 12869 const items = getItems().filter((item) => !item.disabled); 12870 let candidateValues = items.map((item) => item.value); 12871 if (isPrevKey) candidateValues.reverse(); 12872 const currentIndex = candidateValues.indexOf(menuContext.value); 12873 candidateValues = context.loop ? react_menubar_dist_wrapArray(candidateValues, currentIndex + 1) : candidateValues.slice(currentIndex + 1); 12874 const [nextValue] = candidateValues;
12875 if (nextValue) context.onMenuOpen(nextValue); 12876 } 12877 }, 12878 { checkForDefaultPrevented: false } 12879 ), 12880 style: { 12881 ...props.style, 12882 // re-namespace exposed content custom properties 12883 ...{ 12884 "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)", 12885 "--radix-menubar-content-available-width": "var(--radix-popper-available-width)", 12886 "--radix-menubar-content-available-height": "var(--radix-popper-available-height)", 12887 "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)", 12888 "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)" 12889 } 12890 } 12891 } 12892 ); 12893 } 12894); 12895MenubarContent.displayName = dist_CONTENT_NAME; 12896var react_menubar_dist_GROUP_NAME = "MenubarGroup"; 12897var MenubarGroup = react.forwardRef( 12898 (props, forwardedRef) => { 12899 const { __scopeMenubar, ...groupProps } = props; 12900 const menuScope = useMenuScope(__scopeMenubar); 12901 return /* @__PURE__ */ (0,jsx_runtime.jsx)(Group, { ...menuScope, ...groupProps, ref: forwardedRef }); 12902 } 12903); 12904MenubarGroup.displayName = react_menubar_dist_GROUP_NAME; 12905var dist_LABEL_NAME = "MenubarLabel"; 12906var MenubarLabel = react.forwardRef( 12907 (props, forwardedRef) => { 12908 const { __scopeMenubar, ...labelProps } = props; 12909 const menuScope = useMenuScope(__scopeMenubar); 12910 return /* @__PURE__ */ (0,jsx_runtime.jsx)(Label, { ...menuScope, ...labelProps, ref: forwardedRef }); 12911 } 12912); 12913MenubarLabel.displayName = dist_LABEL_NAME; 12914var react_menubar_dist_ITEM_NAME = "MenubarItem"; 12915var MenubarItem = react.forwardRef( 12916 (props, forwardedRef) => { 12917 const { __scopeMenubar, ...itemProps } = props; 12918 const menuScope = useMenuScope(__scopeMenubar); 12919 return /* @__PURE__ */ (0,jsx_runtime.jsx)(Item2, { ...menuScope, ...itemProps, ref: forwardedRef }); 12920 } 12921); 12922MenubarItem.displayName = react_menubar_dist_ITEM_NAME; 12923var dist_CHECKBOX_ITEM_NAME = "MenubarCheckboxItem"; 12924var MenubarCheckboxItem = react.forwardRef( 12925 (props, forwardedRef) => { 12926 const { __scopeMenubar, ...checkboxItemProps } = props; 12927 const menuScope = useMenuScope(__scopeMenubar); 12928 return /* @__PURE__ */ (0,jsx_runtime.jsx)(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef }); 12929 } 12930); 12931MenubarCheckboxItem.displayName = dist_CHECKBOX_ITEM_NAME; 12932var dist_RADIO_GROUP_NAME = "MenubarRadioGroup"; 12933var MenubarRadioGroup = react.forwardRef( 12934 (props, forwardedRef) => { 12935 const { __scopeMenubar, ...radioGroupProps } = props; 12936 const menuScope = useMenuScope(__scopeMenubar); 12937 return /* @__PURE__ */ (0,jsx_runtime.jsx)(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef }); 12938 } 12939); 12940MenubarRadioGroup.displayName = dist_RADIO_GROUP_NAME; 12941var dist_RADIO_ITEM_NAME = "MenubarRadioItem"; 12942var MenubarRadioItem = react.forwardRef( 12943 (props, forwardedRef) => { 12944 const { __scopeMenubar, ...radioItemProps } = props; 12945 const menuScope = useMenuScope(__scopeMenubar); 12946 return /* @__PURE__ */ (0,jsx_runtime.jsx)(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef }); 12947 } 12948); 12949MenubarRadioItem.displayName = dist_RADIO_ITEM_NAME; 12950var INDICATOR_NAME = "MenubarItemIndicator"; 12951var MenubarItemIndicator = react.forwardRef((props, forwardedRef) => { 12952 const { __scopeMenubar, ...itemIndicatorProps } = props; 12953 const menuScope = useMenuScope(__scopeMenubar); 12954 return /* @__PURE__ */ (0,jsx_runtime.jsx)(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef }); 12955}); 12956MenubarItemIndicator.displayName = INDICATOR_NAME; 12957var dist_SEPARATOR_NAME = "MenubarSeparator"; 12958var MenubarSeparator = react.forwardRef( 12959 (props, forwardedRef) => { 12960 const { __scopeMenubar, ...separatorProps } = props; 12961 const menuScope = useMenuScope(__scopeMenubar); 12962 return /* @__PURE__ */ (0,jsx_runtime.jsx)(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef }); 12963 } 12964); 12965MenubarSeparator.displayName = dist_SEPARATOR_NAME; 12966var dist_ARROW_NAME = "MenubarArrow"; 12967var MenubarArrow = react.forwardRef( 12968 (props, forwardedRef) => { 12969 const { __scopeMenubar, ...arrowProps } = props; 12970 const menuScope = useMenuScope(__scopeMenubar); 12971 return /* @__PURE__ */ (0,jsx_runtime.jsx)(Arrow2, { ...menuScope, ...arrowProps, ref: forwardedRef }); 12972 } 12973); 12974MenubarArrow.displayName = dist_ARROW_NAME; 12975var dist_SUB_NAME = "MenubarSub"; 12976var MenubarSub = (props) => { 12977 const { __scopeMenubar, children, open: openProp, onOpenChange, defaultOpen } = props; 12978 const menuScope = useMenuScope(__scopeMenubar); 12979 const [open = false, setOpen] = (0,react_use_controllable_state_dist/* useControllableState */.T)({ 12980 prop: openProp, 12981 defaultProp: defaultOpen, 12982 onChange: onOpenChange 12983 }); 12984 return /* @__PURE__ */ (0,jsx_runtime.jsx)(Sub, { ...menuScope, open, onOpenChange: setOpen, children }); 12985}; 12986MenubarSub.displayName = dist_SUB_NAME; 12987var dist_SUB_TRIGGER_NAME = "MenubarSubTrigger"; 12988var MenubarSubTrigger = react.forwardRef( 12989 (props, forwardedRef) => { 12990 const { __scopeMenubar, ...subTriggerProps } = props; 12991 const menuScope = useMenuScope(__scopeMenubar); 12992 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 12993 SubTrigger, 12994 { 12995 "data-radix-menubar-subtrigger": "", 12996 ...menuScope, 12997 ...subTriggerProps, 12998 ref: forwardedRef 12999 } 13000 ); 13001 } 13002); 13003MenubarSubTrigger.displayName = dist_SUB_TRIGGER_NAME; 13004var dist_SUB_CONTENT_NAME = "MenubarSubContent"; 13005var MenubarSubContent = react.forwardRef( 13006 (props, forwardedRef) => { 13007 const { __scopeMenubar, ...subContentProps } = props; 13008 const menuScope = useMenuScope(__scopeMenubar); 13009 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 13010 SubContent, 13011 { 13012 ...menuScope, 13013 "data-radix-menubar-content": "", 13014 ...subContentProps, 13015 ref: forwardedRef, 13016 style: { 13017 ...props.style, 13018 // re-namespace exposed content custom properties 13019 ...{ 13020 "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)", 13021 "--radix-menubar-content-available-width": "var(--radix-popper-available-width)", 13022 "--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
13023 "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)", 13024 "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)" 13025 } 13026 } 13027 } 13028 ); 13029 } 13030); 13031MenubarSubContent.displayName = dist_SUB_CONTENT_NAME; 13032function react_menubar_dist_wrapArray(array, startIndex) { 13033 return array.map((_, index) => array[(startIndex + index) % array.length]); 13034} 13035var dist_Root3 = Menubar; 13036var dist_Menu = MenubarMenu; 13037var Trigger = MenubarTrigger; 13038var Portal2 = MenubarPortal; 13039var dist_Content2 = MenubarContent; 13040var Group2 = (/* unused pure expression or super */ null && (MenubarGroup)); 13041var Label2 = MenubarLabel; 13042var Item3 = MenubarItem; 13043var CheckboxItem2 = MenubarCheckboxItem; 13044var RadioGroup2 = (/* unused pure expression or super */ null && (MenubarRadioGroup)); 13045var RadioItem2 = MenubarRadioItem; 13046var ItemIndicator2 = MenubarItemIndicator; 13047var Separator2 = MenubarSeparator; 13048var dist_Arrow2 = (/* unused pure expression or super */ null && (MenubarArrow)); 13049var Sub2 = MenubarSub; 13050var SubTrigger2 = MenubarSubTrigger; 13051var SubContent2 = MenubarSubContent; 13052 13053//# sourceMappingURL=index.mjs.map 13054 13055 13056/***/ }), 13057 13058/***/ 6419: 13059/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 13060 13061"use strict"; 13062/* harmony export */ __webpack_require__.d(__webpack_exports__, { 13063/* harmony export */ VY: function() { return /* binding */ Content2; }, 13064/* harmony export */ ee: function() { return /* binding */ Anchor2; }, 13065/* harmony export */ fC: function() { return /* binding */ Root2; }, 13066/* harmony export */ h_: function() { return /* binding */ Portal; }, 13067/* harmony export */ xz: function() { return /* binding */ Trigger; } 13068/* harmony export */ }); 13069/* unused harmony exports Arrow, Close, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, createPopoverScope */ 13070/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 13071/* harmony import */ var _radix_ui_primitive__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6206); 13072/* harmony import */ var _radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(8771); 13073/* harmony import */ var _radix_ui_react_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5360); 13074/* harmony import */ var _radix_ui_react_dismissable_layer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6063); 13075/* harmony import */ var _radix_ui_react_focus_guards__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7552); 13076/* harmony import */ var _radix_ui_react_focus_scope__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5420); 13077/* harmony import */ var _radix_ui_react_id__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1276); 13078/* harmony import */ var _radix_ui_react_popper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3990); 13079/* harmony import */ var _radix_ui_react_portal__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2651); 13080/* harmony import */ var _radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9115); 13081/* harmony import */ var _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5320); 13082/* harmony import */ var _radix_ui_react_slot__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(8426); 13083/* harmony import */ var _radix_ui_react_use_controllable_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7342); 13084/* harmony import */ var aria_hidden__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(3541); 13085/* harmony import */ var react_remove_scroll__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6223); 13086/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893); 13087"use client"; 13088
13089// packages/react/popover/src/popover.tsx 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108var POPOVER_NAME = "Popover"; 13109var [createPopoverContext, createPopoverScope] = (0,_radix_ui_react_context__WEBPACK_IMPORTED_MODULE_2__/* .createContextScope */ .b)(POPOVER_NAME, [ 13110 _radix_ui_react_popper__WEBPACK_IMPORTED_MODULE_3__/* .createPopperScope */ .D7 13111]); 13112var usePopperScope = (0,_radix_ui_react_popper__WEBPACK_IMPORTED_MODULE_3__/* .createPopperScope */ .D7)(); 13113var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME); 13114var Popover = (props) => { 13115 const { 13116 __scopePopover, 13117 children, 13118 open: openProp, 13119 defaultOpen, 13120 onOpenChange, 13121 modal = false 13122 } = props; 13123 const popperScope = usePopperScope(__scopePopover); 13124 const triggerRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 13125 const [hasCustomAnchor, setHasCustomAnchor] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false); 13126 const [open = false, setOpen] = (0,_radix_ui_react_use_controllable_state__WEBPACK_IMPORTED_MODULE_4__/* .useControllableState */ .T)({ 13127 prop: openProp, 13128 defaultProp: defaultOpen, 13129 onChange: onOpenChange 13130 }); 13131 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_popper__WEBPACK_IMPORTED_MODULE_3__/* .Root */ .fC, { ...popperScope, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 13132 PopoverProvider, 13133 { 13134 scope: __scopePopover, 13135 contentId: (0,_radix_ui_react_id__WEBPACK_IMPORTED_MODULE_5__/* .useId */ .M)(), 13136 triggerRef, 13137 open, 13138 onOpenChange: setOpen, 13139 onOpenToggle: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), 13140 hasCustomAnchor, 13141 onCustomAnchorAdd: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => setHasCustomAnchor(true), []), 13142 onCustomAnchorRemove: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => setHasCustomAnchor(false), []), 13143 modal, 13144 children 13145 } 13146 ) }); 13147}; 13148Popover.displayName = POPOVER_NAME; 13149var ANCHOR_NAME = "PopoverAnchor"; 13150var PopoverAnchor = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 13151 (props, forwardedRef) => { 13152 const { __scopePopover, ...anchorProps } = props; 13153 const context = usePopoverContext(ANCHOR_NAME, __scopePopover); 13154 const popperScope = usePopperScope(__scopePopover); 13155 const { onCustomAnchorAdd, onCustomAnchorRemove } = context; 13156 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 13157 onCustomAnchorAdd(); 13158 return () => onCustomAnchorRemove(); 13159 }, [onCustomAnchorAdd, onCustomAnchorRemove]); 13160 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_popper__WEBPACK_IMPORTED_MODULE_3__/* .Anchor */ .ee, { ...popperScope, ...anchorProps, ref: forwardedRef }); 13161 } 13162); 13163PopoverAnchor.displayName = ANCHOR_NAME; 13164var TRIGGER_NAME = "PopoverTrigger"; 13165var PopoverTrigger = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 13166 (props, forwardedRef) => { 13167 const { __scopePopover, ...triggerProps } = props; 13168 const context = usePopoverContext(TRIGGER_NAME, __scopePopover); 13169 const popperScope = usePopperScope(__scopePopover); 13170 const composedTriggerRef = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_6__/* .useComposedRefs */ .e)(forwardedRef, context.triggerRef); 13171 const trigger = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 13172 _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_7__/* .Primitive */ .WV.button, 13173 { 13174 type: "button", 13175 "aria-haspopup": "dialog", 13176 "aria-expanded": context.open, 13177 "aria-controls": context.contentId, 13178 "data-state": getState(context.open), 13179 ...triggerProps, 13180 ref: composedTriggerRef, 13181 onClick: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_8__/* .composeEventHandlers */ .M)(props.onClick, context.onOpenToggle) 13182 } 13183 ); 13184 return context.hasCustomAnchor ? trigger : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_popper__WEBPACK_IMPORTED_MODULE_3__/* .Anchor */ .ee, { asChild: true, ...popperScope, children: trigger }); 13185 } 13186); 13187PopoverTrigger.displayName = TRIGGER_NAME; 13188var PORTAL_NAME = "PopoverPortal"; 13189var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, { 13190 forceMount: void 0 13191}); 13192var PopoverPortal = (props) => { 13193 const { __scopePopover, forceMount, children, container } = props; 13194 const context = usePopoverContext(PORTAL_NAME, __scopePopover); 13195 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_9__/* .Presence */ .z, { present: forceMount || context.open, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_portal__WEBPACK_IMPORTED_MODULE_10__/* .Portal */ .h, { asChild: true, container, children }) }) }); 13196}; 13197PopoverPortal.displayName = PORTAL_NAME; 13198var CONTENT_NAME = "PopoverContent"; 13199var PopoverContent = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 13200 (props, forwardedRef) => { 13201 const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover); 13202 const { forceMount = portalContext.forceMount, ...contentProps } = props; 13203 const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); 13204 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_presence__WEBPACK_IMPORTED_MODULE_9__/* .Presence */ .z, { present: forceMount || context.open, children: context.modal ? /* @__P
13204URE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) }); 13205 } 13206); 13207PopoverContent.displayName = CONTENT_NAME; 13208var PopoverContentModal = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 13209 (props, forwardedRef) => { 13210 const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); 13211 const contentRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); 13212 const composedRefs = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_6__/* .useComposedRefs */ .e)(forwardedRef, contentRef); 13213 const isRightClickOutsideRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 13214 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 13215 const content = contentRef.current; 13216 if (content) return (0,aria_hidden__WEBPACK_IMPORTED_MODULE_11__/* .hideOthers */ .Ry)(content); 13217 }, []); 13218 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_remove_scroll__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, { as: _radix_ui_react_slot__WEBPACK_IMPORTED_MODULE_13__/* .Slot */ .g7, allowPinchZoom: true, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 13219 PopoverContentImpl, 13220 { 13221 ...props, 13222 ref: composedRefs, 13223 trapFocus: context.open, 13224 disableOutsidePointerEvents: true, 13225 onCloseAutoFocus: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_8__/* .composeEventHandlers */ .M)(props.onCloseAutoFocus, (event) => { 13226 event.preventDefault(); 13227 if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus(); 13228 }), 13229 onPointerDownOutside: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_8__/* .composeEventHandlers */ .M)( 13230 props.onPointerDownOutside, 13231 (event) => { 13232 const originalEvent = event.detail.originalEvent; 13233 const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; 13234 const isRightClick = originalEvent.button === 2 || ctrlLeftClick; 13235 isRightClickOutsideRef.current = isRightClick; 13236 }, 13237 { checkForDefaultPrevented: false } 13238 ), 13239 onFocusOutside: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_8__/* .composeEventHandlers */ .M)( 13240 props.onFocusOutside, 13241 (event) => event.preventDefault(), 13242 { checkForDefaultPrevented: false } 13243 ) 13244 } 13245 ) }); 13246 } 13247); 13248var PopoverContentNonModal = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 13249 (props, forwardedRef) => { 13250 const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); 13251 const hasInteractedOutsideRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 13252 const hasPointerDownOutsideRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false); 13253 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 13254 PopoverContentImpl, 13255 { 13256 ...props, 13257 ref: forwardedRef, 13258 trapFocus: false, 13259 disableOutsidePointerEvents: false, 13260 onCloseAutoFocus: (event) => { 13261 props.onCloseAutoFocus?.(event); 13262 if (!event.defaultPrevented) { 13263 if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); 13264 event.preventDefault(); 13265 } 13266 hasInteractedOutsideRef.current = false; 13267 hasPointerDownOutsideRef.current = false; 13268 }, 13269 onInteractOutside: (event) => { 13270 props.onInteractOutside?.(event); 13271 if (!event.defaultPrevented) { 13272 hasInteractedOutsideRef.current = true; 13273 if (event.detail.originalEvent.type === "pointerdown") { 13274 hasPointerDownOutsideRef.current = true; 13275 } 13276 } 13277 const target = event.target; 13278 const targetIsTrigger = context.triggerRef.current?.contains(target); 13279 if (targetIsTrigger) event.preventDefault(); 13280 if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { 13281 event.preventDefault(); 13282 } 13283 } 13284 } 13285 ); 13286 } 13287); 13288var PopoverContentImpl = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 13289 (props, forwardedRef) => { 13290 const { 13291 __scopePopover, 13292 trapFocus, 13293 onOpenAutoFocus, 13294 onCloseAutoFocus, 13295 disableOutsidePointerEvents, 13296 onEscapeKeyDown, 13297 onPointerDownOutside, 13298 onFocusOutside, 13299 onInteractOutside, 13300 ...contentProps 13301 } = props; 13302 const context = usePopoverContext(CONTENT_NAME, __scopePopover); 13303 const popperScope = usePopperScope(__scopePopover); 13304 (0,_radix_ui_react_focus_guards__WEBPACK_IMPORTED_MODULE_14__/* .useFocusGuards */ .EW)(); 13305 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 13306 _radix_ui_react_focus_scope__WEBPACK_IMPORTED_MODULE_15__/* .FocusScope */ .M, 13307 { 13308 asChild: true, 13309 loop: true, 13310 trapped: trapFocus, 13311 onMountAutoFocus: onOpenAutoFocus, 13312 onUnmountAutoFocus: onCloseAutoFocus, 13313 children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
13314 _radix_ui_react_dismissable_layer__WEBPACK_IMPORTED_MODULE_16__/* .DismissableLayer */ .XB, 13315 { 13316 asChild: true, 13317 disableOutsidePointerEvents, 13318 onInteractOutside, 13319 onEscapeKeyDown, 13320 onPointerDownOutside, 13321 onFocusOutside, 13322 onDismiss: () => context.onOpenChange(false), 13323 children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 13324 _radix_ui_react_popper__WEBPACK_IMPORTED_MODULE_3__/* .Content */ .VY, 13325 { 13326 "data-state": getState(context.open), 13327 role: "dialog", 13328 id: context.contentId, 13329 ...popperScope, 13330 ...contentProps, 13331 ref: forwardedRef, 13332 style: { 13333 ...contentProps.style, 13334 // re-namespace exposed content custom properties 13335 ...{ 13336 "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)", 13337 "--radix-popover-content-available-width": "var(--radix-popper-available-width)", 13338 "--radix-popover-content-available-height": "var(--radix-popper-available-height)", 13339 "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)", 13340 "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)" 13341 } 13342 } 13343 } 13344 ) 13345 } 13346 ) 13347 } 13348 ); 13349 } 13350); 13351var CLOSE_NAME = "PopoverClose"; 13352var PopoverClose = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 13353 (props, forwardedRef) => { 13354 const { __scopePopover, ...closeProps } = props; 13355 const context = usePopoverContext(CLOSE_NAME, __scopePopover); 13356 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( 13357 _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_7__/* .Primitive */ .WV.button, 13358 { 13359 type: "button", 13360 ...closeProps, 13361 ref: forwardedRef, 13362 onClick: (0,_radix_ui_primitive__WEBPACK_IMPORTED_MODULE_8__/* .composeEventHandlers */ .M)(props.onClick, () => context.onOpenChange(false)) 13363 } 13364 ); 13365 } 13366); 13367PopoverClose.displayName = CLOSE_NAME; 13368var ARROW_NAME = "PopoverArrow"; 13369var PopoverArrow = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef( 13370 (props, forwardedRef) => { 13371 const { __scopePopover, ...arrowProps } = props; 13372 const popperScope = usePopperScope(__scopePopover); 13373 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_radix_ui_react_popper__WEBPACK_IMPORTED_MODULE_3__/* .Arrow */ .Eh, { ...popperScope, ...arrowProps, ref: forwardedRef }); 13374 } 13375); 13376PopoverArrow.displayName = ARROW_NAME; 13377function getState(open) { 13378 return open ? "open" : "closed"; 13379} 13380var Root2 = Popover; 13381var Anchor2 = PopoverAnchor; 13382var Trigger = PopoverTrigger; 13383var Portal = PopoverPortal; 13384var Content2 = PopoverContent; 13385var Close = (/* unused pure expression or super */ null && (PopoverClose)); 13386var Arrow2 = (/* unused pure expression or super */ null && (PopoverArrow)); 13387 13388//# sourceMappingURL=index.mjs.map 13389 13390 13391/***/ }), 13392 13393/***/ 3990: 13394/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 13395 13396"use strict"; 13397 13398// EXPORTS 13399__webpack_require__.d(__webpack_exports__, { 13400 ee: function() { return /* binding */ Anchor; }, 13401 Eh: function() { return /* binding */ dist_Arrow; }, 13402 VY: function() { return /* binding */ Content; }, 13403 fC: function() { return /* binding */ Root2; }, 13404 D7: function() { return /* binding */ createPopperScope; } 13405}); 13406 13407// UNUSED EXPORTS: ALIGN_OPTIONS, Popper, PopperAnchor, PopperArrow, PopperContent, SIDE_OPTIONS 13408 13409// EXTERNAL MODULE: ./node_modules/react/index.js 13410var react = __webpack_require__(7294); 13411;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 13412/** 13413 * Custom positioning reference element. 13414 * @see https://floating-ui.com/docs/virtual-elements 13415 */ 13416 13417const sides = ['top', 'right', 'bottom', 'left'];
vendor: 5,678 bytes, lines 13418-13612
13418const alignments = (/* unused pure expression or super */ null && (['start', 'end'])); 13419const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []))); 13420const floating_ui_utils_min = Math.min; 13421const floating_ui_utils_max = Math.max; 13422const round = Math.round; 13423const floor = Math.floor; 13424const createCoords = v => ({ 13425 x: v, 13426 y: v 13427}); 13428const oppositeSideMap = { 13429 left: 'right', 13430 right: 'left', 13431 bottom: 'top', 13432 top: 'bottom' 13433}; 13434const oppositeAlignmentMap = { 13435 start: 'end', 13436 end: 'start' 13437}; 13438function clamp(start, value, end) { 13439 return floating_ui_utils_max(start, floating_ui_utils_min(value, end)); 13440} 13441function floating_ui_utils_evaluate(value, param) { 13442 return typeof value === 'function' ? value(param) : value; 13443} 13444function floating_ui_utils_getSide(placement) { 13445 return placement.split('-')[0]; 13446} 13447function floating_ui_utils_getAlignment(placement) { 13448 return placement.split('-')[1]; 13449} 13450function getOppositeAxis(axis) { 13451 return axis === 'x' ? 'y' : 'x'; 13452} 13453function getAxisLength(axis) { 13454 return axis === 'y' ? 'height' : 'width'; 13455} 13456function floating_ui_utils_getSideAxis(placement) { 13457 return ['top', 'bottom'].includes(floating_ui_utils_getSide(placement)) ? 'y' : 'x'; 13458} 13459function getAlignmentAxis(placement) { 13460 return getOppositeAxis(floating_ui_utils_getSideAxis(placement)); 13461} 13462function floating_ui_utils_getAlignmentSides(placement, rects, rtl) { 13463 if (rtl === void 0) { 13464 rtl = false; 13465 } 13466 const alignment = floating_ui_utils_getAlignment(placement); 13467 const alignmentAxis = getAlignmentAxis(placement); 13468 const length = getAxisLength(alignmentAxis); 13469 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; 13470 if (rects.reference[length] > rects.floating[length]) { 13471 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 13472 } 13473 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 13474} 13475function getExpandedPlacements(placement) { 13476 const oppositePlacement = getOppositePlacement(placement); 13477 return [floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)]; 13478} 13479function floating_ui_utils_getOppositeAlignmentPlacement(placement) { 13480 return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); 13481} 13482function getSideList(side, isStart, rtl) { 13483 const lr = ['left', 'right']; 13484 const rl = ['right', 'left']; 13485 const tb = ['top', 'bottom']; 13486 const bt = ['bottom', 'top']; 13487 switch (side) { 13488 case 'top': 13489 case 'bottom': 13490 if (rtl) return isStart ? rl : lr; 13491 return isStart ? lr : rl; 13492 case 'left': 13493 case 'right': 13494 return isStart ? tb : bt; 13495 default: 13496 return []; 13497 } 13498} 13499function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 13500 const alignment = floating_ui_utils_getAlignment(placement); 13501 let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl); 13502 if (alignment) { 13503 list = list.map(side => side + "-" + alignment); 13504 if (flipAlignment) { 13505 list = list.concat(list.map(floating_ui_utils_getOppositeAlignmentPlacement)); 13506 } 13507 } 13508 return list; 13509} 13510function getOppositePlacement(placement) { 13511 return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); 13512} 13513function expandPaddingObject(padding) { 13514 return { 13515 top: 0, 13516 right: 0, 13517 bottom: 0, 13518 left: 0, 13519 ...padding 13520 }; 13521} 13522function floating_ui_utils_getPaddingObject(padding) { 13523 return typeof padding !== 'number' ? expandPaddingObject(padding) : { 13524 top: padding, 13525 right: padding, 13526 bottom: padding, 13527 left: padding 13528 }; 13529} 13530function floating_ui_utils_rectToClientRect(rect) { 13531 const { 13532 x, 13533 y, 13534 width, 13535 height 13536 } = rect; 13537 return { 13538 width, 13539 height, 13540 top: y, 13541 left: x, 13542 right: x + width, 13543 bottom: y + height, 13544 x, 13545 y 13546 }; 13547} 13548 13549 13550 13551;// CONCATENATED MODULE: ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs 13552 13553 13554 13555function computeCoordsFromPlacement(_ref, placement, rtl) { 13556 let { 13557 reference, 13558 floating 13559 } = _ref; 13560 const sideAxis = floating_ui_utils_getSideAxis(placement); 13561 const alignmentAxis = getAlignmentAxis(placement); 13562 const alignLength = getAxisLength(alignmentAxis); 13563 const side = floating_ui_utils_getSide(placement); 13564 const isVertical = sideAxis === 'y'; 13565 const commonX = reference.x + reference.width / 2 - floating.width / 2; 13566 const commonY = reference.y + reference.height / 2 - floating.height / 2; 13567 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 13568 let coords; 13569 switch (side) { 13570 case 'top': 13571 coords = { 13572 x: commonX, 13573 y: reference.y - floating.height 13574 }; 13575 break; 13576 case 'bottom': 13577 coords = { 13578 x: commonX, 13579 y: reference.y + reference.height 13580 }; 13581 break; 13582 case 'right': 13583 coords = { 13584 x: reference.x + reference.width, 13585 y: commonY 13586 }; 13587 break; 13588 case 'left': 13589 coords = { 13590 x: reference.x - floating.width, 13591 y: commonY 13592 }; 13593 break; 13594 default: 13595 coords = { 13596 x: reference.x, 13597 y: reference.y 13598 }; 13599 } 13600 switch (floating_ui_utils_getAlignment(placement)) { 13601 case 'start': 13602 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 13603 break; 13604 case 'end': 13605 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 13606 break; 13607 } 13608 return coords; 13609} 13610 13611/** 13612 * Computes the `x` and `y` coordinates that will place the floating element
vendor: 5,267 bytes, lines 13613-13792
13613 * next to a given reference element. 13614 * 13615 * This export does not have any `platform` interface logic. You will need to 13616 * write one for the platform you are using Floating UI with. 13617 */ 13618const computePosition = async (reference, floating, config) => { 13619 const { 13620 placement = 'bottom', 13621 strategy = 'absolute', 13622 middleware = [], 13623 platform 13624 } = config; 13625 const validMiddleware = middleware.filter(Boolean); 13626 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); 13627 let rects = await platform.getElementRects({ 13628 reference, 13629 floating, 13630 strategy 13631 }); 13632 let { 13633 x, 13634 y 13635 } = computeCoordsFromPlacement(rects, placement, rtl); 13636 let statefulPlacement = placement; 13637 let middlewareData = {}; 13638 let resetCount = 0; 13639 for (let i = 0; i < validMiddleware.length; i++) { 13640 const { 13641 name, 13642 fn 13643 } = validMiddleware[i]; 13644 const { 13645 x: nextX, 13646 y: nextY, 13647 data, 13648 reset 13649 } = await fn({ 13650 x, 13651 y, 13652 initialPlacement: placement, 13653 placement: statefulPlacement, 13654 strategy, 13655 middlewareData, 13656 rects, 13657 platform, 13658 elements: { 13659 reference, 13660 floating 13661 } 13662 }); 13663 x = nextX != null ? nextX : x; 13664 y = nextY != null ? nextY : y; 13665 middlewareData = { 13666 ...middlewareData, 13667 [name]: { 13668 ...middlewareData[name], 13669 ...data 13670 } 13671 }; 13672 if (reset && resetCount <= 50) { 13673 resetCount++; 13674 if (typeof reset === 'object') { 13675 if (reset.placement) { 13676 statefulPlacement = reset.placement; 13677 } 13678 if (reset.rects) { 13679 rects = reset.rects === true ? await platform.getElementRects({ 13680 reference, 13681 floating, 13682 strategy 13683 }) : reset.rects; 13684 } 13685 ({ 13686 x, 13687 y 13688 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 13689 } 13690 i = -1; 13691 } 13692 } 13693 return { 13694 x, 13695 y, 13696 placement: statefulPlacement, 13697 strategy, 13698 middlewareData 13699 }; 13700}; 13701 13702/** 13703 * Resolves with an object of overflow side offsets that determine how much the 13704 * element is overflowing a given clipping boundary on each side. 13705 * - positive = overflowing the boundary by that number of pixels 13706 * - negative = how many pixels left before it will overflow 13707 * - 0 = lies flush with the boundary 13708 * @see https://floating-ui.com/docs/detectOverflow 13709 */ 13710async function detectOverflow(state, options) { 13711 var _await$platform$isEle; 13712 if (options === void 0) { 13713 options = {}; 13714 } 13715 const { 13716 x, 13717 y, 13718 platform, 13719 rects, 13720 elements, 13721 strategy 13722 } = state; 13723 const { 13724 boundary = 'clippingAncestors', 13725 rootBoundary = 'viewport', 13726 elementContext = 'floating', 13727 altBoundary = false, 13728 padding = 0 13729 } = floating_ui_utils_evaluate(options, state); 13730 const paddingObject = floating_ui_utils_getPaddingObject(padding); 13731 const altContext = elementContext === 'floating' ? 'reference' : 'floating'; 13732 const element = elements[altBoundary ? altContext : elementContext]; 13733 const clippingClientRect = floating_ui_utils_rectToClientRect(await platform.getClippingRect({ 13734 element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), 13735 boundary, 13736 rootBoundary, 13737 strategy 13738 })); 13739 const rect = elementContext === 'floating' ? { 13740 x, 13741 y, 13742 width: rects.floating.width, 13743 height: rects.floating.height 13744 } : rects.reference; 13745 const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); 13746 const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { 13747 x: 1, 13748 y: 1 13749 } : { 13750 x: 1, 13751 y: 1 13752 }; 13753 const elementClientRect = floating_ui_utils_rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ 13754 elements, 13755 rect, 13756 offsetParent, 13757 strategy 13758 }) : rect); 13759 return { 13760 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 13761 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 13762 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 13763 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 13764 }; 13765} 13766 13767/** 13768 * Provides data to position an inner element of the floating element so that it 13769 * appears centered to the reference element. 13770 * @see https://floating-ui.com/docs/arrow 13771 */ 13772const arrow = options => ({ 13773 name: 'arrow', 13774 options, 13775 async fn(state) { 13776 const { 13777 x, 13778 y, 13779 placement, 13780 rects, 13781 platform, 13782 elements, 13783 middlewareData 13784 } = state; 13785 // Since `element` is required, we don't Partial<> the type. 13786 const { 13787 element, 13788 padding = 0 13789 } = floating_ui_utils_evaluate(options, state) || {}; 13790 if (element == null) { 13791 return {}; 13792 }
vendor: 7,764 bytes, lines 13793-13979
13793 const paddingObject = floating_ui_utils_getPaddingObject(padding); 13794 const coords = { 13795 x, 13796 y 13797 }; 13798 const axis = getAlignmentAxis(placement); 13799 const length = getAxisLength(axis); 13800 const arrowDimensions = await platform.getDimensions(element); 13801 const isYAxis = axis === 'y'; 13802 const minProp = isYAxis ? 'top' : 'left'; 13803 const maxProp = isYAxis ? 'bottom' : 'right'; 13804 const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; 13805 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 13806 const startDiff = coords[axis] - rects.reference[axis]; 13807 const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); 13808 let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; 13809 13810 // DOM platform can return `window` as the `offsetParent`. 13811 if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { 13812 clientSize = elements.floating[clientProp] || rects.floating[length]; 13813 } 13814 const centerToReference = endDiff / 2 - startDiff / 2; 13815 13816 // If the padding is large enough that it causes the arrow to no longer be 13817 // centered, modify the padding so that it is centered. 13818 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 13819 const minPadding = floating_ui_utils_min(paddingObject[minProp], largestPossiblePadding); 13820 const maxPadding = floating_ui_utils_min(paddingObject[maxProp], largestPossiblePadding); 13821 13822 // Make sure the arrow doesn't overflow the floating element if the center 13823 // point is outside the floating element's bounds. 13824 const min$1 = minPadding; 13825 const max = clientSize - arrowDimensions[length] - maxPadding; 13826 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 13827 const offset = clamp(min$1, center, max); 13828 13829 // If the reference is small enough that the arrow's padding causes it to 13830 // to point to nothing for an aligned placement, adjust the offset of the 13831 // floating element itself. To ensure `shift()` continues to take action, 13832 // a single reset is performed when this is true. 13833 const shouldAddOffset = !middlewareData.arrow && floating_ui_utils_getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 13834 const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; 13835 return { 13836 [axis]: coords[axis] + alignmentOffset, 13837 data: { 13838 [axis]: offset, 13839 centerOffset: center - offset - alignmentOffset, 13840 ...(shouldAddOffset && { 13841 alignmentOffset 13842 }) 13843 }, 13844 reset: shouldAddOffset 13845 }; 13846 } 13847}); 13848 13849function getPlacementList(alignment, autoAlignment, allowedPlacements) { 13850 const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); 13851 return allowedPlacementsSortedByAlignment.filter(placement => { 13852 if (alignment) { 13853 return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); 13854 } 13855 return true; 13856 }); 13857} 13858/** 13859 * Optimizes the visibility of the floating element by choosing the placement 13860 * that has the most space available automatically, without needing to specify a 13861 * preferred placement. Alternative to `flip`. 13862 * @see https://floating-ui.com/docs/autoPlacement 13863 */ 13864const autoPlacement = function (options) { 13865 if (options === void 0) { 13866 options = {}; 13867 } 13868 return { 13869 name: 'autoPlacement', 13870 options, 13871 async fn(state) { 13872 var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; 13873 const { 13874 rects, 13875 middlewareData, 13876 placement, 13877 platform, 13878 elements 13879 } = state; 13880 const { 13881 crossAxis = false, 13882 alignment, 13883 allowedPlacements = placements, 13884 autoAlignment = true, 13885 ...detectOverflowOptions 13886 } = evaluate(options, state); 13887 const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; 13888 const overflow = await detectOverflow(state, detectOverflowOptions); 13889 const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; 13890 const currentPlacement = placements$1[currentIndex]; 13891 if (currentPlacement == null) { 13892 return {}; 13893 } 13894 const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); 13895 13896 // Make `computeCoords` start from the right place. 13897 if (placement !== currentPlacement) { 13898 return { 13899 reset: { 13900 placement: placements$1[0] 13901 } 13902 }; 13903 } 13904 const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; 13905 const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { 13906 placement: currentPlacement, 13907 overflows: currentOverflows 13908 }]; 13909 const nextPlacement = placements$1[currentIndex + 1]; 13910 13911 // There are more placements to check. 13912 if (nextPlacement) { 13913 return { 13914 data: { 13915 index: currentIndex + 1, 13916 overflows: allOverflows 13917 }, 13918 reset: { 13919 placement: nextPlacement 13920 } 13921 }; 13922 } 13923 const placementsSortedByMostSpace = allOverflows.map(d => { 13924 const alignment = getAlignment(d.placement); 13925 return [d.placement, alignment && crossAxis ? 13926 // Check along the mainAxis and main crossAxis side. 13927 d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : 13928 // Check only the mainAxis. 13929 d.overflows[0], d.overflows]; 13930 }).sort((a, b) => a[1] - b[1]); 13931 const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, 13932 // Aligned placements should not check their opposite crossAxis 13933 // side. 13934 getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); 13935 const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; 13936 if (resetPlacement !== placement) { 13937 return { 13938 data: { 13939 index: currentIndex + 1, 13940 overflows: allOverflows 13941 }, 13942 reset: { 13943 placement: resetPlacement 13944 } 13945 }; 13946 } 13947 return {}; 13948 } 13949 }; 13950}; 13951 13952/** 13953 * Optimizes the visibility of the floating element by flipping the `placement` 13954 * in order to keep it in view when the preferred placement(s) will overflow the 13955 * clipping boundary. Alternative to `autoPlacement`. 13956 * @see https://floating-ui.com/docs/flip 13957 */ 13958const flip = function (options) { 13959 if (options === void 0) { 13960 options = {}; 13961 } 13962 return { 13963 name: 'flip', 13964 options, 13965 async fn(state) { 13966 var _middlewareData$arrow, _middlewareData$flip; 13967 const { 13968 placement, 13969 middlewareData, 13970 rects, 13971 initialPlacement, 13972 platform, 13973 elements 13974 } = state; 13975 const { 13976 mainAxis: checkMainAxis = true, 13977 crossAxis: checkCrossAxis = true, 13978 fallbackPlacements: specifiedFallbackPlacements, 13979 fallbackStrategy = 'bestFit',
vendor: 6,294 bytes, lines 13980-14146
13980 fallbackAxisSideDirection = 'none', 13981 flipAlignment = true, 13982 ...detectOverflowOptions 13983 } = floating_ui_utils_evaluate(options, state); 13984 13985 // If a reset by the arrow was caused due to an alignment offset being 13986 // added, we should skip any logic now since `flip()` has already done its 13987 // work. 13988 // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 13989 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 13990 return {}; 13991 } 13992 const side = floating_ui_utils_getSide(placement); 13993 const initialSideAxis = floating_ui_utils_getSideAxis(initialPlacement); 13994 const isBasePlacement = floating_ui_utils_getSide(initialPlacement) === initialPlacement; 13995 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 13996 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 13997 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; 13998 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 13999 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 14000 } 14001 const placements = [initialPlacement, ...fallbackPlacements]; 14002 const overflow = await detectOverflow(state, detectOverflowOptions); 14003 const overflows = []; 14004 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 14005 if (checkMainAxis) { 14006 overflows.push(overflow[side]); 14007 } 14008 if (checkCrossAxis) { 14009 const sides = floating_ui_utils_getAlignmentSides(placement, rects, rtl); 14010 overflows.push(overflow[sides[0]], overflow[sides[1]]); 14011 } 14012 overflowsData = [...overflowsData, { 14013 placement, 14014 overflows 14015 }]; 14016 14017 // One or more sides is overflowing. 14018 if (!overflows.every(side => side <= 0)) { 14019 var _middlewareData$flip2, _overflowsData$filter; 14020 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 14021 const nextPlacement = placements[nextIndex]; 14022 if (nextPlacement) { 14023 // Try next placement and re-run the lifecycle. 14024 return { 14025 data: { 14026 index: nextIndex, 14027 overflows: overflowsData 14028 }, 14029 reset: { 14030 placement: nextPlacement 14031 } 14032 }; 14033 } 14034 14035 // First, find the candidates that fit on the mainAxis side of overflow, 14036 // then find the placement that fits the best on the main crossAxis side. 14037 let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 14038 14039 // Otherwise fallback. 14040 if (!resetPlacement) { 14041 switch (fallbackStrategy) { 14042 case 'bestFit': 14043 { 14044 var _overflowsData$filter2; 14045 const placement = (_overflowsData$filter2 = overflowsData.filter(d => { 14046 if (hasFallbackAxisSideDirection) { 14047 const currentSideAxis = floating_ui_utils_getSideAxis(d.placement); 14048 return currentSideAxis === initialSideAxis || 14049 // Create a bias to the `y` side axis due to horizontal 14050 // reading directions favoring greater width. 14051 currentSideAxis === 'y'; 14052 } 14053 return true; 14054 }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 14055 if (placement) { 14056 resetPlacement = placement; 14057 } 14058 break; 14059 } 14060 case 'initialPlacement': 14061 resetPlacement = initialPlacement; 14062 break; 14063 } 14064 } 14065 if (placement !== resetPlacement) { 14066 return { 14067 reset: { 14068 placement: resetPlacement 14069 } 14070 }; 14071 } 14072 } 14073 return {}; 14074 } 14075 }; 14076}; 14077 14078function getSideOffsets(overflow, rect) { 14079 return { 14080 top: overflow.top - rect.height, 14081 right: overflow.right - rect.width, 14082 bottom: overflow.bottom - rect.height, 14083 left: overflow.left - rect.width 14084 }; 14085} 14086function isAnySideFullyClipped(overflow) { 14087 return sides.some(side => overflow[side] >= 0); 14088} 14089/** 14090 * Provides data to hide the floating element in applicable situations, such as 14091 * when it is not in the same clipping context as the reference element. 14092 * @see https://floating-ui.com/docs/hide 14093 */ 14094const hide = function (options) { 14095 if (options === void 0) { 14096 options = {}; 14097 } 14098 return { 14099 name: 'hide', 14100 options, 14101 async fn(state) { 14102 const { 14103 rects 14104 } = state; 14105 const { 14106 strategy = 'referenceHidden', 14107 ...detectOverflowOptions 14108 } = floating_ui_utils_evaluate(options, state); 14109 switch (strategy) { 14110 case 'referenceHidden': 14111 { 14112 const overflow = await detectOverflow(state, { 14113 ...detectOverflowOptions, 14114 elementContext: 'reference' 14115 }); 14116 const offsets = getSideOffsets(overflow, rects.reference); 14117 return { 14118 data: { 14119 referenceHiddenOffsets: offsets, 14120 referenceHidden: isAnySideFullyClipped(offsets) 14121 } 14122 }; 14123 } 14124 case 'escaped': 14125 { 14126 const overflow = await detectOverflow(state, { 14127 ...detectOverflowOptions, 14128 altBoundary: true 14129 }); 14130 const offsets = getSideOffsets(overflow, rects.floating); 14131 return { 14132 data: { 14133 escapedOffsets: offsets, 14134 escaped: isAnySideFullyClipped(offsets) 14135 } 14136 }; 14137 } 14138 default: 14139 { 14140 return {}; 14141 } 14142 } 14143 } 14144 }; 14145}; 14146
vendor: 5,310 bytes, lines 14147-14298
14147function getBoundingRect(rects) { 14148 const minX = min(...rects.map(rect => rect.left)); 14149 const minY = min(...rects.map(rect => rect.top)); 14150 const maxX = max(...rects.map(rect => rect.right)); 14151 const maxY = max(...rects.map(rect => rect.bottom)); 14152 return { 14153 x: minX, 14154 y: minY, 14155 width: maxX - minX, 14156 height: maxY - minY 14157 }; 14158} 14159function getRectsByLine(rects) { 14160 const sortedRects = rects.slice().sort((a, b) => a.y - b.y); 14161 const groups = []; 14162 let prevRect = null; 14163 for (let i = 0; i < sortedRects.length; i++) { 14164 const rect = sortedRects[i]; 14165 if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { 14166 groups.push([rect]); 14167 } else { 14168 groups[groups.length - 1].push(rect); 14169 } 14170 prevRect = rect; 14171 } 14172 return groups.map(rect => rectToClientRect(getBoundingRect(rect))); 14173} 14174/** 14175 * Provides improved positioning for inline reference elements that can span 14176 * over multiple lines, such as hyperlinks or range selections. 14177 * @see https://floating-ui.com/docs/inline 14178 */ 14179const inline = function (options) { 14180 if (options === void 0) { 14181 options = {}; 14182 } 14183 return { 14184 name: 'inline', 14185 options, 14186 async fn(state) { 14187 const { 14188 placement, 14189 elements, 14190 rects, 14191 platform, 14192 strategy 14193 } = state; 14194 // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a 14195 // ClientRect's bounds, despite the event listener being triggered. A 14196 // padding of 2 seems to handle this issue. 14197 const { 14198 padding = 2, 14199 x, 14200 y 14201 } = evaluate(options, state); 14202 const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); 14203 const clientRects = getRectsByLine(nativeClientRects); 14204 const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); 14205 const paddingObject = getPaddingObject(padding); 14206 function getBoundingClientRect() { 14207 // There are two rects and they are disjoined. 14208 if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { 14209 // Find the first rect in which the point is fully inside. 14210 return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; 14211 } 14212 14213 // There are 2 or more connected rects. 14214 if (clientRects.length >= 2) { 14215 if (getSideAxis(placement) === 'y') { 14216 const firstRect = clientRects[0]; 14217 const lastRect = clientRects[clientRects.length - 1]; 14218 const isTop = getSide(placement) === 'top'; 14219 const top = firstRect.top; 14220 const bottom = lastRect.bottom; 14221 const left = isTop ? firstRect.left : lastRect.left; 14222 const right = isTop ? firstRect.right : lastRect.right; 14223 const width = right - left; 14224 const height = bottom - top; 14225 return { 14226 top, 14227 bottom, 14228 left, 14229 right, 14230 width, 14231 height, 14232 x: left, 14233 y: top 14234 }; 14235 } 14236 const isLeftSide = getSide(placement) === 'left'; 14237 const maxRight = max(...clientRects.map(rect => rect.right)); 14238 const minLeft = min(...clientRects.map(rect => rect.left)); 14239 const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); 14240 const top = measureRects[0].top; 14241 const bottom = measureRects[measureRects.length - 1].bottom; 14242 const left = minLeft; 14243 const right = maxRight; 14244 const width = right - left; 14245 const height = bottom - top; 14246 return { 14247 top, 14248 bottom, 14249 left, 14250 right, 14251 width, 14252 height, 14253 x: left, 14254 y: top 14255 }; 14256 } 14257 return fallback; 14258 } 14259 const resetRects = await platform.getElementRects({ 14260 reference: { 14261 getBoundingClientRect 14262 }, 14263 floating: elements.floating, 14264 strategy 14265 }); 14266 if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { 14267 return { 14268 reset: { 14269 rects: resetRects 14270 } 14271 }; 14272 } 14273 return {}; 14274 } 14275 }; 14276}; 14277 14278// For type backwards-compatibility, the `OffsetOptions` type was also 14279// Derivable. 14280 14281async function convertValueToCoords(state, options) { 14282 const { 14283 placement, 14284 platform, 14285 elements 14286 } = state; 14287 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 14288 const side = floating_ui_utils_getSide(placement); 14289 const alignment = floating_ui_utils_getAlignment(placement); 14290 const isVertical = floating_ui_utils_getSideAxis(placement) === 'y'; 14291 const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1; 14292 const crossAxisMulti = rtl && isVertical ? -1 : 1; 14293 const rawValue = floating_ui_utils_evaluate(options, state); 14294 14295 // eslint-disable-next-line prefer-const 14296 let { 14297 mainAxis, 14298 crossAxis,
vendor: 9,843 bytes, lines 14299-14594
14299 alignmentAxis 14300 } = typeof rawValue === 'number' ? { 14301 mainAxis: rawValue, 14302 crossAxis: 0, 14303 alignmentAxis: null 14304 } : { 14305 mainAxis: rawValue.mainAxis || 0, 14306 crossAxis: rawValue.crossAxis || 0, 14307 alignmentAxis: rawValue.alignmentAxis 14308 }; 14309 if (alignment && typeof alignmentAxis === 'number') { 14310 crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; 14311 } 14312 return isVertical ? { 14313 x: crossAxis * crossAxisMulti, 14314 y: mainAxis * mainAxisMulti 14315 } : { 14316 x: mainAxis * mainAxisMulti, 14317 y: crossAxis * crossAxisMulti 14318 }; 14319} 14320 14321/** 14322 * Modifies the placement by translating the floating element along the 14323 * specified axes. 14324 * A number (shorthand for `mainAxis` or distance), or an axes configuration 14325 * object may be passed. 14326 * @see https://floating-ui.com/docs/offset 14327 */ 14328const offset = function (options) { 14329 if (options === void 0) { 14330 options = 0; 14331 } 14332 return { 14333 name: 'offset', 14334 options, 14335 async fn(state) { 14336 var _middlewareData$offse, _middlewareData$arrow; 14337 const { 14338 x, 14339 y, 14340 placement, 14341 middlewareData 14342 } = state; 14343 const diffCoords = await convertValueToCoords(state, options); 14344 14345 // If the placement is the same and the arrow caused an alignment offset 14346 // then we don't need to change the positioning coordinates. 14347 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 14348 return {}; 14349 } 14350 return { 14351 x: x + diffCoords.x, 14352 y: y + diffCoords.y, 14353 data: { 14354 ...diffCoords, 14355 placement 14356 } 14357 }; 14358 } 14359 }; 14360}; 14361 14362/** 14363 * Optimizes the visibility of the floating element by shifting it in order to 14364 * keep it in view when it will overflow the clipping boundary. 14365 * @see https://floating-ui.com/docs/shift 14366 */ 14367const shift = function (options) { 14368 if (options === void 0) { 14369 options = {}; 14370 } 14371 return { 14372 name: 'shift', 14373 options, 14374 async fn(state) { 14375 const { 14376 x, 14377 y, 14378 placement 14379 } = state; 14380 const { 14381 mainAxis: checkMainAxis = true, 14382 crossAxis: checkCrossAxis = false, 14383 limiter = { 14384 fn: _ref => { 14385 let { 14386 x, 14387 y 14388 } = _ref; 14389 return { 14390 x, 14391 y 14392 }; 14393 } 14394 }, 14395 ...detectOverflowOptions 14396 } = floating_ui_utils_evaluate(options, state); 14397 const coords = { 14398 x, 14399 y 14400 }; 14401 const overflow = await detectOverflow(state, detectOverflowOptions); 14402 const crossAxis = floating_ui_utils_getSideAxis(floating_ui_utils_getSide(placement)); 14403 const mainAxis = getOppositeAxis(crossAxis); 14404 let mainAxisCoord = coords[mainAxis]; 14405 let crossAxisCoord = coords[crossAxis]; 14406 if (checkMainAxis) { 14407 const minSide = mainAxis === 'y' ? 'top' : 'left'; 14408 const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; 14409 const min = mainAxisCoord + overflow[minSide]; 14410 const max = mainAxisCoord - overflow[maxSide]; 14411 mainAxisCoord = clamp(min, mainAxisCoord, max); 14412 } 14413 if (checkCrossAxis) { 14414 const minSide = crossAxis === 'y' ? 'top' : 'left'; 14415 const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; 14416 const min = crossAxisCoord + overflow[minSide]; 14417 const max = crossAxisCoord - overflow[maxSide]; 14418 crossAxisCoord = clamp(min, crossAxisCoord, max); 14419 } 14420 const limitedCoords = limiter.fn({ 14421 ...state, 14422 [mainAxis]: mainAxisCoord, 14423 [crossAxis]: crossAxisCoord 14424 }); 14425 return { 14426 ...limitedCoords, 14427 data: { 14428 x: limitedCoords.x - x, 14429 y: limitedCoords.y - y, 14430 enabled: { 14431 [mainAxis]: checkMainAxis, 14432 [crossAxis]: checkCrossAxis 14433 } 14434 } 14435 }; 14436 } 14437 }; 14438}; 14439/** 14440 * Built-in `limiter` that will stop `shift()` at a certain point. 14441 */ 14442const limitShift = function (options) { 14443 if (options === void 0) { 14444 options = {}; 14445 } 14446 return { 14447 options, 14448 fn(state) { 14449 const { 14450 x, 14451 y, 14452 placement, 14453 rects, 14454 middlewareData 14455 } = state; 14456 const { 14457 offset = 0, 14458 mainAxis: checkMainAxis = true, 14459 crossAxis: checkCrossAxis = true 14460 } = floating_ui_utils_evaluate(options, state); 14461 const coords = { 14462 x, 14463 y 14464 }; 14465 const crossAxis = floating_ui_utils_getSideAxis(placement); 14466 const mainAxis = getOppositeAxis(crossAxis); 14467 let mainAxisCoord = coords[mainAxis]; 14468 let crossAxisCoord = coords[crossAxis]; 14469 const rawOffset = floating_ui_utils_evaluate(offset, state); 14470 const computedOffset = typeof rawOffset === 'number' ? { 14471 mainAxis: rawOffset, 14472 crossAxis: 0 14473 } : { 14474 mainAxis: 0, 14475 crossAxis: 0, 14476 ...rawOffset 14477 }; 14478 if (checkMainAxis) { 14479 const len = mainAxis === 'y' ? 'height' : 'width'; 14480 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 14481 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 14482 if (mainAxisCoord < limitMin) { 14483 mainAxisCoord = limitMin; 14484 } else if (mainAxisCoord > limitMax) { 14485 mainAxisCoord = limitMax; 14486 } 14487 } 14488 if (checkCrossAxis) { 14489 var _middlewareData$offse, _middlewareData$offse2; 14490 const len = mainAxis === 'y' ? 'width' : 'height'; 14491 const isOriginSide = ['top', 'left'].includes(floating_ui_utils_getSide(placement)); 14492 const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); 14493 const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); 14494 if (crossAxisCoord < limitMin) { 14495 crossAxisCoord = limitMin; 14496 } else if (crossAxisCoord > limitMax) { 14497 crossAxisCoord = limitMax; 14498 } 14499 } 14500 return { 14501 [mainAxis]: mainAxisCoord, 14502 [crossAxis]: crossAxisCoord 14503 }; 14504 } 14505 }; 14506}; 14507 14508/** 14509 * Provides data that allows you to change the size of the floating element â 14510 * for instance, prevent it from overflowing the clipping boundary or match the 14511 * width of the reference element. 14512 * @see https://floating-ui.com/docs/size 14513 */ 14514const size = function (options) { 14515 if (options === void 0) { 14516 options = {}; 14517 } 14518 return { 14519 name: 'size', 14520 options, 14521 async fn(state) { 14522 var _state$middlewareData, _state$middlewareData2; 14523 const { 14524 placement, 14525 rects, 14526 platform, 14527 elements 14528 } = state; 14529 const { 14530 apply = () => {}, 14531 ...detectOverflowOptions 14532 } = floating_ui_utils_evaluate(options, state); 14533 const overflow = await detectOverflow(state, detectOverflowOptions); 14534 const side = floating_ui_utils_getSide(placement); 14535 const alignment = floating_ui_utils_getAlignment(placement); 14536 const isYAxis = floating_ui_utils_getSideAxis(placement) === 'y'; 14537 const { 14538 width, 14539 height 14540 } = rects.floating; 14541 let heightSide; 14542 let widthSide; 14543 if (side === 'top' || side === 'bottom') { 14544 heightSide = side; 14545 widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; 14546 } else { 14547 widthSide = side; 14548 heightSide = alignment === 'end' ? 'top' : 'bottom'; 14549 } 14550 const maximumClippingHeight = height - overflow.top - overflow.bottom; 14551 const maximumClippingWidth = width - overflow.left - overflow.right; 14552 const overflowAvailableHeight = floating_ui_utils_min(height - overflow[heightSide], maximumClippingHeight); 14553 const overflowAvailableWidth = floating_ui_utils_min(width - overflow[widthSide], maximumClippingWidth); 14554 const noShift = !state.middlewareData.shift; 14555 let availableHeight = overflowAvailableHeight; 14556 let availableWidth = overflowAvailableWidth; 14557 if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { 14558 availableWidth = maximumClippingWidth; 14559 } 14560 if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { 14561 availableHeight = maximumClippingHeight; 14562 } 14563 if (noShift && !alignment) { 14564 const xMin = floating_ui_utils_max(overflow.left, 0); 14565 const xMax = floating_ui_utils_max(overflow.right, 0); 14566 const yMin = floating_ui_utils_max(overflow.top, 0); 14567 const yMax = floating_ui_utils_max(overflow.bottom, 0); 14568 if (isYAxis) { 14569 availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : floating_ui_utils_max(overflow.left, overflow.right)); 14570 } else { 14571 availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : floating_ui_utils_max(overflow.top, overflow.bottom)); 14572 } 14573 } 14574 await apply({ 14575 ...state, 14576 availableWidth, 14577 availableHeight 14578 }); 14579 const nextDimensions = await platform.getDimensions(elements.floating); 14580 if (width !== nextDimensions.width || height !== nextDimensions.height) { 14581 return { 14582 reset: { 14583 rects: true 14584 } 14585 }; 14586 } 14587 return {}; 14588 } 14589 }; 14590}; 14591 14592 14593 14594;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
vendor: 5,494 bytes, lines 14594-14747
14594 14595function hasWindow() { 14596 return typeof window !== 'undefined'; 14597} 14598function getNodeName(node) { 14599 if (isNode(node)) { 14600 return (node.nodeName || '').toLowerCase(); 14601 } 14602 // Mocked nodes in testing environments may not be instances of Node. By 14603 // returning `#document` an infinite loop won't occur. 14604 // https://github.com/floating-ui/floating-ui/issues/2317 14605 return '#document'; 14606} 14607function getWindow(node) { 14608 var _node$ownerDocument; 14609 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 14610} 14611function getDocumentElement(node) { 14612 var _ref; 14613 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 14614} 14615function isNode(value) { 14616 if (!hasWindow()) { 14617 return false; 14618 } 14619 return value instanceof Node || value instanceof getWindow(value).Node; 14620} 14621function isElement(value) { 14622 if (!hasWindow()) { 14623 return false; 14624 } 14625 return value instanceof Element || value instanceof getWindow(value).Element; 14626} 14627function isHTMLElement(value) { 14628 if (!hasWindow()) { 14629 return false; 14630 } 14631 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 14632} 14633function isShadowRoot(value) { 14634 if (!hasWindow() || typeof ShadowRoot === 'undefined') { 14635 return false; 14636 } 14637 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 14638} 14639function isOverflowElement(element) { 14640 const { 14641 overflow, 14642 overflowX, 14643 overflowY, 14644 display 14645 } = getComputedStyle(element); 14646 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display); 14647} 14648function isTableElement(element) { 14649 return ['table', 'td', 'th'].includes(getNodeName(element)); 14650} 14651function isTopLayer(element) { 14652 return [':popover-open', ':modal'].some(selector => { 14653 try { 14654 return element.matches(selector); 14655 } catch (e) { 14656 return false; 14657 } 14658 }); 14659} 14660function isContainingBlock(elementOrCss) { 14661 const webkit = isWebKit(); 14662 const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss; 14663 14664 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 14665 // https://drafts.csswg.org/css-transforms-2/#individual-transforms 14666 return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value)); 14667} 14668function getContainingBlock(element) { 14669 let currentNode = getParentNode(element); 14670 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 14671 if (isContainingBlock(currentNode)) { 14672 return currentNode; 14673 } else if (isTopLayer(currentNode)) { 14674 return null; 14675 } 14676 currentNode = getParentNode(currentNode); 14677 } 14678 return null; 14679} 14680function isWebKit() { 14681 if (typeof CSS === 'undefined' || !CSS.supports) return false; 14682 return CSS.supports('-webkit-backdrop-filter', 'none'); 14683} 14684function isLastTraversableNode(node) { 14685 return ['html', 'body', '#document'].includes(getNodeName(node)); 14686} 14687function getComputedStyle(element) { 14688 return getWindow(element).getComputedStyle(element); 14689} 14690function getNodeScroll(element) { 14691 if (isElement(element)) { 14692 return { 14693 scrollLeft: element.scrollLeft, 14694 scrollTop: element.scrollTop 14695 }; 14696 } 14697 return { 14698 scrollLeft: element.scrollX, 14699 scrollTop: element.scrollY 14700 }; 14701} 14702function getParentNode(node) { 14703 if (getNodeName(node) === 'html') { 14704 return node; 14705 } 14706 const result = 14707 // Step into the shadow DOM of the parent of a slotted node. 14708 node.assignedSlot || 14709 // DOM Element detected. 14710 node.parentNode || 14711 // ShadowRoot detected. 14712 isShadowRoot(node) && node.host || 14713 // Fallback. 14714 getDocumentElement(node); 14715 return isShadowRoot(result) ? result.host : result; 14716} 14717function getNearestOverflowAncestor(node) { 14718 const parentNode = getParentNode(node); 14719 if (isLastTraversableNode(parentNode)) { 14720 return node.ownerDocument ? node.ownerDocument.body : node.body; 14721 } 14722 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 14723 return parentNode; 14724 } 14725 return getNearestOverflowAncestor(parentNode); 14726} 14727function getOverflowAncestors(node, list, traverseIframes) { 14728 var _node$ownerDocument2; 14729 if (list === void 0) { 14730 list = []; 14731 } 14732 if (traverseIframes === void 0) { 14733 traverseIframes = true; 14734 } 14735 const scrollableAncestor = getNearestOverflowAncestor(node); 14736 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 14737 const win = getWindow(scrollableAncestor); 14738 if (isBody) { 14739 const frameElement = getFrameElement(win); 14740 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 14741 } 14742 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 14743} 14744function getFrameElement(win) { 14745 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 14746} 14747
vendor: 3,062 bytes, lines 14748-14856
14748 14749 14750;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 14751 14752 14753 14754 14755 14756function getCssDimensions(element) { 14757 const css = getComputedStyle(element); 14758 // In testing environments, the `width` and `height` properties are empty 14759 // strings for SVG elements, returning NaN. Fallback to `0` in this case. 14760 let width = parseFloat(css.width) || 0; 14761 let height = parseFloat(css.height) || 0; 14762 const hasOffset = isHTMLElement(element); 14763 const offsetWidth = hasOffset ? element.offsetWidth : width; 14764 const offsetHeight = hasOffset ? element.offsetHeight : height; 14765 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 14766 if (shouldFallback) { 14767 width = offsetWidth; 14768 height = offsetHeight; 14769 } 14770 return { 14771 width, 14772 height, 14773 $: shouldFallback 14774 }; 14775} 14776 14777function unwrapElement(element) { 14778 return !isElement(element) ? element.contextElement : element; 14779} 14780 14781function getScale(element) { 14782 const domElement = unwrapElement(element); 14783 if (!isHTMLElement(domElement)) { 14784 return createCoords(1); 14785 } 14786 const rect = domElement.getBoundingClientRect(); 14787 const { 14788 width, 14789 height, 14790 $ 14791 } = getCssDimensions(domElement); 14792 let x = ($ ? round(rect.width) : rect.width) / width; 14793 let y = ($ ? round(rect.height) : rect.height) / height; 14794 14795 // 0, NaN, or Infinity should always fallback to 1. 14796 14797 if (!x || !Number.isFinite(x)) { 14798 x = 1; 14799 } 14800 if (!y || !Number.isFinite(y)) { 14801 y = 1; 14802 } 14803 return { 14804 x, 14805 y 14806 }; 14807} 14808 14809const noOffsets = /*#__PURE__*/createCoords(0); 14810function getVisualOffsets(element) { 14811 const win = getWindow(element); 14812 if (!isWebKit() || !win.visualViewport) { 14813 return noOffsets; 14814 } 14815 return { 14816 x: win.visualViewport.offsetLeft, 14817 y: win.visualViewport.offsetTop 14818 }; 14819} 14820function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 14821 if (isFixed === void 0) { 14822 isFixed = false; 14823 } 14824 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { 14825 return false; 14826 } 14827 return isFixed; 14828} 14829 14830function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 14831 if (includeScale === void 0) { 14832 includeScale = false; 14833 } 14834 if (isFixedStrategy === void 0) { 14835 isFixedStrategy = false; 14836 } 14837 const clientRect = element.getBoundingClientRect(); 14838 const domElement = unwrapElement(element); 14839 let scale = createCoords(1); 14840 if (includeScale) { 14841 if (offsetParent) { 14842 if (isElement(offsetParent)) { 14843 scale = getScale(offsetParent); 14844 } 14845 } else { 14846 scale = getScale(element); 14847 } 14848 } 14849 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 14850 let x = (clientRect.left + visualOffsets.x) / scale.x; 14851 let y = (clientRect.top + visualOffsets.y) / scale.y; 14852 let width = clientRect.width / scale.x; 14853 let height = clientRect.height / scale.y; 14854 if (domElement) { 14855 const win = getWindow(domElement); 14856 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
vendor: 14,082 bytes, lines 14857-15249
14857 let currentWin = win; 14858 let currentIFrame = getFrameElement(currentWin); 14859 while (currentIFrame && offsetParent && offsetWin !== currentWin) { 14860 const iframeScale = getScale(currentIFrame); 14861 const iframeRect = currentIFrame.getBoundingClientRect(); 14862 const css = getComputedStyle(currentIFrame); 14863 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 14864 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 14865 x *= iframeScale.x; 14866 y *= iframeScale.y; 14867 width *= iframeScale.x; 14868 height *= iframeScale.y; 14869 x += left; 14870 y += top; 14871 currentWin = getWindow(currentIFrame); 14872 currentIFrame = getFrameElement(currentWin); 14873 } 14874 } 14875 return floating_ui_utils_rectToClientRect({ 14876 width, 14877 height, 14878 x, 14879 y 14880 }); 14881} 14882 14883// If <html> has a CSS width greater than the viewport, then this will be 14884// incorrect for RTL. 14885function getWindowScrollBarX(element, rect) { 14886 const leftScroll = getNodeScroll(element).scrollLeft; 14887 if (!rect) { 14888 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 14889 } 14890 return rect.left + leftScroll; 14891} 14892 14893function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) { 14894 if (ignoreScrollbarX === void 0) { 14895 ignoreScrollbarX = false; 14896 } 14897 const htmlRect = documentElement.getBoundingClientRect(); 14898 const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : 14899 // RTL <body> scrollbar. 14900 getWindowScrollBarX(documentElement, htmlRect)); 14901 const y = htmlRect.top + scroll.scrollTop; 14902 return { 14903 x, 14904 y 14905 }; 14906} 14907 14908function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 14909 let { 14910 elements, 14911 rect, 14912 offsetParent, 14913 strategy 14914 } = _ref; 14915 const isFixed = strategy === 'fixed'; 14916 const documentElement = getDocumentElement(offsetParent); 14917 const topLayer = elements ? isTopLayer(elements.floating) : false; 14918 if (offsetParent === documentElement || topLayer && isFixed) { 14919 return rect; 14920 } 14921 let scroll = { 14922 scrollLeft: 0, 14923 scrollTop: 0 14924 }; 14925 let scale = createCoords(1); 14926 const offsets = createCoords(0); 14927 const isOffsetParentAnElement = isHTMLElement(offsetParent); 14928 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 14929 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { 14930 scroll = getNodeScroll(offsetParent); 14931 } 14932 if (isHTMLElement(offsetParent)) { 14933 const offsetRect = getBoundingClientRect(offsetParent); 14934 scale = getScale(offsetParent); 14935 offsets.x = offsetRect.x + offsetParent.clientLeft; 14936 offsets.y = offsetRect.y + offsetParent.clientTop; 14937 } 14938 } 14939 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0); 14940 return { 14941 width: rect.width * scale.x, 14942 height: rect.height * scale.y, 14943 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 14944 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 14945 }; 14946} 14947 14948function getClientRects(element) { 14949 return Array.from(element.getClientRects()); 14950} 14951 14952// Gets the entire size of the scrollable document area, even extending outside 14953// of the `<html>` and `<body>` rect bounds if horizontally scrollable. 14954function getDocumentRect(element) { 14955 const html = getDocumentElement(element); 14956 const scroll = getNodeScroll(element); 14957 const body = element.ownerDocument.body; 14958 const width = floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 14959 const height = floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 14960 let x = -scroll.scrollLeft + getWindowScrollBarX(element); 14961 const y = -scroll.scrollTop; 14962 if (getComputedStyle(body).direction === 'rtl') { 14963 x += floating_ui_utils_max(html.clientWidth, body.clientWidth) - width; 14964 } 14965 return { 14966 width, 14967 height, 14968 x, 14969 y 14970 }; 14971} 14972 14973function getViewportRect(element, strategy) { 14974 const win = getWindow(element); 14975 const html = getDocumentElement(element); 14976 const visualViewport = win.visualViewport; 14977 let width = html.clientWidth; 14978 let height = html.clientHeight; 14979 let x = 0; 14980 let y = 0; 14981 if (visualViewport) { 14982 width = visualViewport.width; 14983 height = visualViewport.height; 14984 const visualViewportBased = isWebKit(); 14985 if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { 14986 x = visualViewport.offsetLeft; 14987 y = visualViewport.offsetTop; 14988 } 14989 } 14990 return { 14991 width, 14992 height, 14993 x, 14994 y 14995 }; 14996} 14997 14998// Returns the inner client rect, subtracting scrollbars if present. 14999function getInnerBoundingClientRect(element, strategy) { 15000 const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); 15001 const top = clientRect.top + element.clientTop; 15002 const left = clientRect.left + element.clientLeft; 15003 const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); 15004 const width = element.clientWidth * scale.x; 15005 const height = element.clientHeight * scale.y; 15006 const x = left * scale.x; 15007 const y = top * scale.y; 15008 return { 15009 width, 15010 height, 15011 x, 15012 y 15013 }; 15014} 15015function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 15016 let rect; 15017 if (clippingAncestor === 'viewport') { 15018 rect = getViewportRect(element, strategy); 15019 } else if (clippingAncestor === 'document') { 15020 rect = getDocumentRect(getDocumentElement(element)); 15021 } else if (isElement(clippingAncestor)) { 15022 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 15023 } else { 15024 const visualOffsets = getVisualOffsets(element); 15025 rect = { 15026 x: clippingAncestor.x - visualOffsets.x, 15027 y: clippingAncestor.y - visualOffsets.y, 15028 width: clippingAncestor.width, 15029 height: clippingAncestor.height 15030 }; 15031 } 15032 return floating_ui_utils_rectToClientRect(rect); 15033} 15034function hasFixedPositionAncestor(element, stopNode) { 15035 const parentNode = getParentNode(element); 15036 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { 15037 return false; 15038 } 15039 return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); 15040} 15041 15042// A "clipping ancestor" is an `overflow` element with the characteristic of 15043// clipping (or hiding) child elements. This returns all clipping ancestors 15044// of the given element up the tree. 15045function getClippingElementAncestors(element, cache) { 15046 const cachedResult = cache.get(element); 15047 if (cachedResult) { 15048 return cachedResult; 15049 } 15050 let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); 15051 let currentContainingBlockComputedStyle = null; 15052 const elementIsFixed = getComputedStyle(element).position === 'fixed'; 15053 let currentNode = elementIsFixed ? getParentNode(element) : element; 15054 15055 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 15056 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 15057 const computedStyle = getComputedStyle(currentNode); 15058 const currentNodeIsContaining = isContainingBlock(currentNode); 15059 if (!currentNodeIsContaining && computedStyle.position === 'fixed') { 15060 currentContainingBlockComputedStyle = null; 15061 } 15062 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); 15063 if (shouldDropCurrentNode) { 15064 // Drop non-containing blocks. 15065 result = result.filter(ancestor => ancestor !== currentNode); 15066 } else { 15067 // Record last containing block for next iteration. 15068 currentContainingBlockComputedStyle = computedStyle; 15069 } 15070 currentNode = getParentNode(currentNode); 15071 } 15072 cache.set(element, result); 15073 return result; 15074} 15075 15076// Gets the maximum area that the element is visible in due to any number of 15077// clipping ancestors. 15078function getClippingRect(_ref) { 15079 let { 15080 element, 15081 boundary, 15082 rootBoundary, 15083 strategy 15084 } = _ref; 15085 const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 15086 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 15087 const firstClippingAncestor = clippingAncestors[0]; 15088 const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { 15089 const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); 15090 accRect.top = floating_ui_utils_max(rect.top, accRect.top); 15091 accRect.right = floating_ui_utils_min(rect.right, accRect.right); 15092 accRect.bottom = floating_ui_utils_min(rect.bottom, accRect.bottom); 15093 accRect.left = floating_ui_utils_max(rect.left, accRect.left); 15094 return accRect; 15095 }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); 15096 return { 15097 width: clippingRect.right - clippingRect.left, 15098 height: clippingRect.bottom - clippingRect.top, 15099 x: clippingRect.left, 15100 y: clippingRect.top 15101 }; 15102} 15103 15104function getDimensions(element) { 15105 const { 15106 width, 15107 height 15108 } = getCssDimensions(element); 15109 return { 15110 width, 15111 height 15112 }; 15113} 15114 15115function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 15116 const isOffsetParentAnElement = isHTMLElement(offsetParent); 15117 const documentElement = getDocumentElement(offsetParent); 15118 const isFixed = strategy === 'fixed'; 15119 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 15120 let scroll = { 15121 scrollLeft: 0, 15122 scrollTop: 0 15123 }; 15124 const offsets = createCoords(0); 15125 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 15126 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { 15127 scroll = getNodeScroll(offsetParent); 15128 } 15129 if (isOffsetParentAnElement) { 15130 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 15131 offsets.x = offsetRect.x + offsetParent.clientLeft; 15132 offsets.y = offsetRect.y + offsetParent.clientTop; 15133 } else if (documentElement) { 15134 // If the <body> scrollbar appears on the left (e.g. RTL systems). Use 15135 // Firefox with layout.scrollbar.side = 3 in about:config to test this. 15136 offsets.x = getWindowScrollBarX(documentElement); 15137 } 15138 } 15139 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 15140 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 15141 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 15142 return { 15143 x, 15144 y, 15145 width: rect.width, 15146 height: rect.height 15147 }; 15148} 15149 15150function isStaticPositioned(element) { 15151 return getComputedStyle(element).position === 'static'; 15152} 15153 15154function getTrueOffsetParent(element, polyfill) { 15155 if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') { 15156 return null; 15157 } 15158 if (polyfill) { 15159 return polyfill(element); 15160 } 15161 let rawOffsetParent = element.offsetParent; 15162 15163 // Firefox returns the <html> element as the offsetParent if it's non-static, 15164 // while Chrome and Safari return the <body> element. The <body> element must 15165 // be used to perform the correct calculations even if the <html> element is 15166 // non-static. 15167 if (getDocumentElement(element) === rawOffsetParent) { 15168 rawOffsetParent = rawOffsetParent.ownerDocument.body; 15169 } 15170 return rawOffsetParent; 15171} 15172 15173// Gets the closest ancestor positioned element. Handles some edge cases, 15174// such as table ancestors and cross browser bugs. 15175function getOffsetParent(element, polyfill) { 15176 const win = getWindow(element); 15177 if (isTopLayer(element)) { 15178 return win; 15179 } 15180 if (!isHTMLElement(element)) { 15181 let svgOffsetParent = getParentNode(element); 15182 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 15183 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 15184 return svgOffsetParent; 15185 } 15186 svgOffsetParent = getParentNode(svgOffsetParent); 15187 } 15188 return win; 15189 } 15190 let offsetParent = getTrueOffsetParent(element, polyfill); 15191 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 15192 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 15193 } 15194 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 15195 return win; 15196 } 15197 return offsetParent || getContainingBlock(element) || win; 15198} 15199 15200const getElementRects = async function (data) { 15201 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 15202 const getDimensionsFn = this.getDimensions; 15203 const floatingDimensions = await getDimensionsFn(data.floating); 15204 return { 15205 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 15206 floating: { 15207 x: 0, 15208 y: 0, 15209 width: floatingDimensions.width, 15210 height: floatingDimensions.height 15211 } 15212 }; 15213}; 15214 15215function isRTL(element) { 15216 return getComputedStyle(element).direction === 'rtl'; 15217} 15218 15219const platform = { 15220 convertOffsetParentRelativeRectToViewportRelativeRect, 15221 getDocumentElement: getDocumentElement, 15222 getClippingRect, 15223 getOffsetParent, 15224 getElementRects, 15225 getClientRects, 15226 getDimensions, 15227 getScale, 15228 isElement: isElement, 15229 isRTL 15230}; 15231 15232function rectsAreEqual(a, b) { 15233 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 15234} 15235 15236// https://samthor.au/2021/observing-dom/ 15237function observeMove(element, onMove) { 15238 let io = null; 15239 let timeoutId; 15240 const root = getDocumentElement(element); 15241 function cleanup() { 15242 var _io; 15243 clearTimeout(timeoutId); 15244 (_io = io) == null || _io.disconnect(); 15245 io = null; 15246 } 15247 function refresh(skip, threshold) { 15248 if (skip === void 0) { 15249 skip = false;
vendor: 4,868 bytes, lines 15250-15389
15250 } 15251 if (threshold === void 0) { 15252 threshold = 1; 15253 } 15254 cleanup(); 15255 const elementRectForRootMargin = element.getBoundingClientRect(); 15256 const { 15257 left, 15258 top, 15259 width, 15260 height 15261 } = elementRectForRootMargin; 15262 if (!skip) { 15263 onMove(); 15264 } 15265 if (!width || !height) { 15266 return; 15267 } 15268 const insetTop = floor(top); 15269 const insetRight = floor(root.clientWidth - (left + width)); 15270 const insetBottom = floor(root.clientHeight - (top + height)); 15271 const insetLeft = floor(left); 15272 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 15273 const options = { 15274 rootMargin, 15275 threshold: floating_ui_utils_max(0, floating_ui_utils_min(1, threshold)) || 1 15276 }; 15277 let isFirstUpdate = true; 15278 function handleObserve(entries) { 15279 const ratio = entries[0].intersectionRatio; 15280 if (ratio !== threshold) { 15281 if (!isFirstUpdate) { 15282 return refresh(); 15283 } 15284 if (!ratio) { 15285 // If the reference is clipped, the ratio is 0. Throttle the refresh 15286 // to prevent an infinite loop of updates. 15287 timeoutId = setTimeout(() => { 15288 refresh(false, 1e-7); 15289 }, 1000); 15290 } else { 15291 refresh(false, ratio); 15292 } 15293 } 15294 if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 15295 // It's possible that even though the ratio is reported as 1, the 15296 // element is not actually fully within the IntersectionObserver's root 15297 // area anymore. This can happen under performance constraints. This may 15298 // be a bug in the browser's IntersectionObserver implementation. To 15299 // work around this, we compare the element's bounding rect now with 15300 // what it was at the time we created the IntersectionObserver. If they 15301 // are not equal then the element moved, so we refresh. 15302 refresh(); 15303 } 15304 isFirstUpdate = false; 15305 } 15306 15307 // Older browsers don't support a `document` as the root and will throw an 15308 // error. 15309 try { 15310 io = new IntersectionObserver(handleObserve, { 15311 ...options, 15312 // Handle <iframe>s 15313 root: root.ownerDocument 15314 }); 15315 } catch (e) { 15316 io = new IntersectionObserver(handleObserve, options); 15317 } 15318 io.observe(element); 15319 } 15320 refresh(true); 15321 return cleanup; 15322} 15323 15324/** 15325 * Automatically updates the position of the floating element when necessary. 15326 * Should only be called when the floating element is mounted on the DOM or 15327 * visible on the screen. 15328 * @returns cleanup function that should be invoked when the floating element is 15329 * removed from the DOM or hidden from the screen. 15330 * @see https://floating-ui.com/docs/autoUpdate 15331 */ 15332function autoUpdate(reference, floating, update, options) { 15333 if (options === void 0) { 15334 options = {}; 15335 } 15336 const { 15337 ancestorScroll = true, 15338 ancestorResize = true, 15339 elementResize = typeof ResizeObserver === 'function', 15340 layoutShift = typeof IntersectionObserver === 'function', 15341 animationFrame = false 15342 } = options; 15343 const referenceEl = unwrapElement(reference); 15344 const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : []; 15345 ancestors.forEach(ancestor => { 15346 ancestorScroll && ancestor.addEventListener('scroll', update, { 15347 passive: true 15348 }); 15349 ancestorResize && ancestor.addEventListener('resize', update); 15350 }); 15351 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; 15352 let reobserveFrame = -1; 15353 let resizeObserver = null; 15354 if (elementResize) { 15355 resizeObserver = new ResizeObserver(_ref => { 15356 let [firstEntry] = _ref; 15357 if (firstEntry && firstEntry.target === referenceEl && resizeObserver) { 15358 // Prevent update loops when using the `size` middleware. 15359 // https://github.com/floating-ui/floating-ui/issues/1740 15360 resizeObserver.unobserve(floating); 15361 cancelAnimationFrame(reobserveFrame); 15362 reobserveFrame = requestAnimationFrame(() => { 15363 var _resizeObserver; 15364 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 15365 }); 15366 } 15367 update(); 15368 }); 15369 if (referenceEl && !animationFrame) { 15370 resizeObserver.observe(referenceEl); 15371 } 15372 resizeObserver.observe(floating); 15373 } 15374 let frameId; 15375 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 15376 if (animationFrame) { 15377 frameLoop(); 15378 } 15379 function frameLoop() { 15380 const nextRefRect = getBoundingClientRect(reference); 15381 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 15382 update(); 15383 } 15384 prevRefRect = nextRefRect; 15385 frameId = requestAnimationFrame(frameLoop); 15386 } 15387 update(); 15388 return () => { 15389 var _resizeObserver2;
15390 ancestors.forEach(ancestor => { 15391 ancestorScroll && ancestor.removeEventListener('scroll', update); 15392 ancestorResize && ancestor.removeEventListener('resize', update); 15393 }); 15394 cleanupIo == null || cleanupIo(); 15395 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 15396 resizeObserver = null; 15397 if (animationFrame) { 15398 cancelAnimationFrame(frameId); 15399 } 15400 }; 15401} 15402 15403/** 15404 * Resolves with an object of overflow side offsets that determine how much the 15405 * element is overflowing a given clipping boundary on each side. 15406 * - positive = overflowing the boundary by that number of pixels 15407 * - negative = how many pixels left before it will overflow 15408 * - 0 = lies flush with the boundary 15409 * @see https://floating-ui.com/docs/detectOverflow 15410 */ 15411const floating_ui_dom_detectOverflow = (/* unused pure expression or super */ null && (detectOverflow$1)); 15412 15413/** 15414 * Modifies the placement by translating the floating element along the 15415 * specified axes. 15416 * A number (shorthand for `mainAxis` or distance), or an axes configuration 15417 * object may be passed. 15418 * @see https://floating-ui.com/docs/offset 15419 */ 15420const floating_ui_dom_offset = offset; 15421 15422/** 15423 * Optimizes the visibility of the floating element by choosing the placement 15424 * that has the most space available automatically, without needing to specify a 15425 * preferred placement. Alternative to `flip`. 15426 * @see https://floating-ui.com/docs/autoPlacement 15427 */ 15428const floating_ui_dom_autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1)); 15429 15430/** 15431 * Optimizes the visibility of the floating element by shifting it in order to 15432 * keep it in view when it will overflow the clipping boundary. 15433 * @see https://floating-ui.com/docs/shift 15434 */ 15435const floating_ui_dom_shift = shift; 15436 15437/** 15438 * Optimizes the visibility of the floating element by flipping the `placement` 15439 * in order to keep it in view when the preferred placement(s) will overflow the 15440 * clipping boundary. Alternative to `autoPlacement`. 15441 * @see https://floating-ui.com/docs/flip 15442 */ 15443const floating_ui_dom_flip = flip; 15444 15445/** 15446 * Provides data that allows you to change the size of the floating element â 15447 * for instance, prevent it from overflowing the clipping boundary or match the 15448 * width of the reference element. 15449 * @see https://floating-ui.com/docs/size 15450 */ 15451const floating_ui_dom_size = size; 15452 15453/** 15454 * Provides data to hide the floating element in applicable situations, such as 15455 * when it is not in the same clipping context as the reference element. 15456 * @see https://floating-ui.com/docs/hide 15457 */ 15458const floating_ui_dom_hide = hide; 15459 15460/** 15461 * Provides data to position an inner element of the floating element so that it 15462 * appears centered to the reference element. 15463 * @see https://floating-ui.com/docs/arrow 15464 */ 15465const floating_ui_dom_arrow = arrow; 15466 15467/** 15468 * Provides improved positioning for inline reference elements that can span 15469 * over multiple lines, such as hyperlinks or range selections. 15470 * @see https://floating-ui.com/docs/inline 15471 */ 15472const floating_ui_dom_inline = (/* unused pure expression or super */ null && (inline$1)); 15473 15474/** 15475 * Built-in `limiter` that will stop `shift()` at a certain point. 15476 */ 15477const floating_ui_dom_limitShift = limitShift; 15478 15479/** 15480 * Computes the `x` and `y` coordinates that will place the floating element 15481 * next to a given reference element. 15482 */ 15483const floating_ui_dom_computePosition = (reference, floating, options) => { 15484 // This caches the expensive `getClippingElementAncestors` function so that 15485 // multiple lifecycle resets re-use the same result. It only lives for a 15486 // single call. If other functions become expensive, we can add them as well. 15487 const cache = new Map(); 15488 const mergedOptions = { 15489 platform, 15490 ...options 15491 }; 15492 const platformWithCache = { 15493 ...mergedOptions.platform, 15494 _c: cache 15495 }; 15496 return computePosition(reference, floating, { 15497 ...mergedOptions, 15498 platform: platformWithCache 15499 }); 15500}; 15501 15502 15503 15504// EXTERNAL MODULE: ./node_modules/react-dom/index.js 15505var react_dom = __webpack_require__(3935); 15506;// CONCATENATED MODULE: ./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs 15507 15508 15509 15510 15511 15512 15513var index = typeof document !== 'undefined' ? react.useLayoutEffect : react.useEffect; 15514 15515// Fork of `fast-deep-equal` that only does the comparisons we need and compares 15516// functions 15517function deepEqual(a, b) { 15518 if (a === b) { 15519 return true; 15520 } 15521 if (typeof a !== typeof b) { 15522 return false;
vendor: 4,200 bytes, lines 15523-15673
15523 } 15524 if (typeof a === 'function' && a.toString() === b.toString()) { 15525 return true; 15526 } 15527 let length; 15528 let i; 15529 let keys; 15530 if (a && b && typeof a === 'object') { 15531 if (Array.isArray(a)) { 15532 length = a.length; 15533 if (length !== b.length) return false; 15534 for (i = length; i-- !== 0;) { 15535 if (!deepEqual(a[i], b[i])) { 15536 return false; 15537 } 15538 } 15539 return true; 15540 } 15541 keys = Object.keys(a); 15542 length = keys.length; 15543 if (length !== Object.keys(b).length) { 15544 return false; 15545 } 15546 for (i = length; i-- !== 0;) { 15547 if (!{}.hasOwnProperty.call(b, keys[i])) { 15548 return false; 15549 } 15550 } 15551 for (i = length; i-- !== 0;) { 15552 const key = keys[i]; 15553 if (key === '_owner' && a.$$typeof) { 15554 continue; 15555 } 15556 if (!deepEqual(a[key], b[key])) { 15557 return false; 15558 } 15559 } 15560 return true; 15561 } 15562 return a !== a && b !== b; 15563} 15564 15565function getDPR(element) { 15566 if (typeof window === 'undefined') { 15567 return 1; 15568 } 15569 const win = element.ownerDocument.defaultView || window; 15570 return win.devicePixelRatio || 1; 15571} 15572 15573function roundByDPR(element, value) { 15574 const dpr = getDPR(element); 15575 return Math.round(value * dpr) / dpr; 15576} 15577 15578function useLatestRef(value) { 15579 const ref = react.useRef(value); 15580 index(() => { 15581 ref.current = value; 15582 }); 15583 return ref; 15584} 15585 15586/** 15587 * Provides data to position a floating element. 15588 * @see https://floating-ui.com/docs/useFloating 15589 */ 15590function useFloating(options) { 15591 if (options === void 0) { 15592 options = {}; 15593 } 15594 const { 15595 placement = 'bottom', 15596 strategy = 'absolute', 15597 middleware = [], 15598 platform, 15599 elements: { 15600 reference: externalReference, 15601 floating: externalFloating 15602 } = {}, 15603 transform = true, 15604 whileElementsMounted, 15605 open 15606 } = options; 15607 const [data, setData] = react.useState({ 15608 x: 0, 15609 y: 0, 15610 strategy, 15611 placement, 15612 middlewareData: {}, 15613 isPositioned: false 15614 }); 15615 const [latestMiddleware, setLatestMiddleware] = react.useState(middleware); 15616 if (!deepEqual(latestMiddleware, middleware)) { 15617 setLatestMiddleware(middleware); 15618 } 15619 const [_reference, _setReference] = react.useState(null); 15620 const [_floating, _setFloating] = react.useState(null); 15621 const setReference = react.useCallback(node => { 15622 if (node !== referenceRef.current) { 15623 referenceRef.current = node; 15624 _setReference(node); 15625 } 15626 }, []); 15627 const setFloating = react.useCallback(node => { 15628 if (node !== floatingRef.current) { 15629 floatingRef.current = node; 15630 _setFloating(node); 15631 } 15632 }, []); 15633 const referenceEl = externalReference || _reference; 15634 const floatingEl = externalFloating || _floating; 15635 const referenceRef = react.useRef(null); 15636 const floatingRef = react.useRef(null); 15637 const dataRef = react.useRef(data); 15638 const hasWhileElementsMounted = whileElementsMounted != null; 15639 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 15640 const platformRef = useLatestRef(platform); 15641 const openRef = useLatestRef(open); 15642 const update = react.useCallback(() => { 15643 if (!referenceRef.current || !floatingRef.current) { 15644 return; 15645 } 15646 const config = { 15647 placement, 15648 strategy, 15649 middleware: latestMiddleware 15650 }; 15651 if (platformRef.current) { 15652 config.platform = platformRef.current; 15653 } 15654 floating_ui_dom_computePosition(referenceRef.current, floatingRef.current, config).then(data => { 15655 const fullData = { 15656 ...data, 15657 // The floating element's position may be recomputed while it's closed 15658 // but still mounted (such as when transitioning out). To ensure 15659 // `isPositioned` will be `false` initially on the next open, avoid 15660 // setting it to `true` when `open === false` (must be specified). 15661 isPositioned: openRef.current !== false 15662 }; 15663 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 15664 dataRef.current = fullData; 15665 react_dom.flushSync(() => { 15666 setData(fullData); 15667 }); 15668 } 15669 }); 15670 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 15671 index(() => { 15672 if (open === false && dataRef.current.isPositioned) { 15673 dataRef.current.isPositioned = false;
vendor: 6,101 bytes, lines 15674-15880
15674 setData(data => ({ 15675 ...data, 15676 isPositioned: false 15677 })); 15678 } 15679 }, [open]); 15680 const isMountedRef = react.useRef(false); 15681 index(() => { 15682 isMountedRef.current = true; 15683 return () => { 15684 isMountedRef.current = false; 15685 }; 15686 }, []); 15687 index(() => { 15688 if (referenceEl) referenceRef.current = referenceEl; 15689 if (floatingEl) floatingRef.current = floatingEl; 15690 if (referenceEl && floatingEl) { 15691 if (whileElementsMountedRef.current) { 15692 return whileElementsMountedRef.current(referenceEl, floatingEl, update); 15693 } 15694 update(); 15695 } 15696 }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]); 15697 const refs = react.useMemo(() => ({ 15698 reference: referenceRef, 15699 floating: floatingRef, 15700 setReference, 15701 setFloating 15702 }), [setReference, setFloating]); 15703 const elements = react.useMemo(() => ({ 15704 reference: referenceEl, 15705 floating: floatingEl 15706 }), [referenceEl, floatingEl]); 15707 const floatingStyles = react.useMemo(() => { 15708 const initialStyles = { 15709 position: strategy, 15710 left: 0, 15711 top: 0 15712 }; 15713 if (!elements.floating) { 15714 return initialStyles; 15715 } 15716 const x = roundByDPR(elements.floating, data.x); 15717 const y = roundByDPR(elements.floating, data.y); 15718 if (transform) { 15719 return { 15720 ...initialStyles, 15721 transform: "translate(" + x + "px, " + y + "px)", 15722 ...(getDPR(elements.floating) >= 1.5 && { 15723 willChange: 'transform' 15724 }) 15725 }; 15726 } 15727 return { 15728 position: strategy, 15729 left: x, 15730 top: y 15731 }; 15732 }, [strategy, transform, elements.floating, data.x, data.y]); 15733 return react.useMemo(() => ({ 15734 ...data, 15735 update, 15736 refs, 15737 elements, 15738 floatingStyles 15739 }), [data, update, refs, elements, floatingStyles]); 15740} 15741 15742/** 15743 * Provides data to position an inner element of the floating element so that it 15744 * appears centered to the reference element. 15745 * This wraps the core `arrow` middleware to allow React refs as the element. 15746 * @see https://floating-ui.com/docs/arrow 15747 */ 15748const arrow$1 = options => { 15749 function isRef(value) { 15750 return {}.hasOwnProperty.call(value, 'current'); 15751 } 15752 return { 15753 name: 'arrow', 15754 options, 15755 fn(state) { 15756 const { 15757 element, 15758 padding 15759 } = typeof options === 'function' ? options(state) : options; 15760 if (element && isRef(element)) { 15761 if (element.current != null) { 15762 return floating_ui_dom_arrow({ 15763 element: element.current, 15764 padding 15765 }).fn(state); 15766 } 15767 return {}; 15768 } 15769 if (element) { 15770 return floating_ui_dom_arrow({ 15771 element, 15772 padding 15773 }).fn(state); 15774 } 15775 return {}; 15776 } 15777 }; 15778}; 15779 15780/** 15781 * Modifies the placement by translating the floating element along the 15782 * specified axes. 15783 * A number (shorthand for `mainAxis` or distance), or an axes configuration 15784 * object may be passed. 15785 * @see https://floating-ui.com/docs/offset 15786 */ 15787const floating_ui_react_dom_offset = (options, deps) => ({ 15788 ...floating_ui_dom_offset(options), 15789 options: [options, deps] 15790}); 15791 15792/** 15793 * Optimizes the visibility of the floating element by shifting it in order to 15794 * keep it in view when it will overflow the clipping boundary. 15795 * @see https://floating-ui.com/docs/shift 15796 */ 15797const floating_ui_react_dom_shift = (options, deps) => ({ 15798 ...floating_ui_dom_shift(options), 15799 options: [options, deps] 15800}); 15801 15802/** 15803 * Built-in `limiter` that will stop `shift()` at a certain point. 15804 */ 15805const floating_ui_react_dom_limitShift = (options, deps) => ({ 15806 ...floating_ui_dom_limitShift(options), 15807 options: [options, deps] 15808}); 15809 15810/** 15811 * Optimizes the visibility of the floating element by flipping the `placement` 15812 * in order to keep it in view when the preferred placement(s) will overflow the 15813 * clipping boundary. Alternative to `autoPlacement`. 15814 * @see https://floating-ui.com/docs/flip 15815 */ 15816const floating_ui_react_dom_flip = (options, deps) => ({ 15817 ...floating_ui_dom_flip(options), 15818 options: [options, deps] 15819}); 15820 15821/** 15822 * Provides data that allows you to change the size of the floating element â 15823 * for instance, prevent it from overflowing the clipping boundary or match the 15824 * width of the reference element. 15825 * @see https://floating-ui.com/docs/size 15826 */ 15827const floating_ui_react_dom_size = (options, deps) => ({ 15828 ...floating_ui_dom_size(options), 15829 options: [options, deps] 15830}); 15831 15832/** 15833 * Optimizes the visibility of the floating element by choosing the placement 15834 * that has the most space available automatically, without needing to specify a 15835 * preferred placement. Alternative to `flip`. 15836 * @see https://floating-ui.com/docs/autoPlacement 15837 */ 15838const floating_ui_react_dom_autoPlacement = (options, deps) => ({ 15839 ...autoPlacement$1(options), 15840 options: [options, deps] 15841}); 15842 15843/** 15844 * Provides data to hide the floating element in applicable situations, such as 15845 * when it is not in the same clipping context as the reference element. 15846 * @see https://floating-ui.com/docs/hide 15847 */ 15848const floating_ui_react_dom_hide = (options, deps) => ({ 15849 ...floating_ui_dom_hide(options), 15850 options: [options, deps] 15851}); 15852 15853/** 15854 * Provides improved positioning for inline reference elements that can span 15855 * over multiple lines, such as hyperlinks or range selections. 15856 * @see https://floating-ui.com/docs/inline 15857 */ 15858const floating_ui_react_dom_inline = (options, deps) => ({ 15859 ...inline$1(options), 15860 options: [options, deps] 15861}); 15862 15863/** 15864 * Provides data to position an inner element of the floating element so that it 15865 * appears centered to the reference element. 15866 * This wraps the core `arrow` middleware to allow React refs as the element. 15867 * @see https://floating-ui.com/docs/arrow 15868 */ 15869const floating_ui_react_dom_arrow = (options, deps) => ({ 15870 ...arrow$1(options), 15871 options: [options, deps] 15872}); 15873 15874 15875 15876// EXTERNAL MODULE: ./node_modules/@radix-ui/react-primitive/dist/index.mjs 15877var dist = __webpack_require__(5320); 15878// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 15879var jsx_runtime = __webpack_require__(5893); 15880;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-arrow/dist/index.mjs
15881// packages/react/arrow/src/arrow.tsx 15882 15883 15884 15885var NAME = "Arrow"; 15886var Arrow = react.forwardRef((props, forwardedRef) => { 15887 const { children, width = 10, height = 5, ...arrowProps } = props; 15888 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 15889 dist/* Primitive */.WV.svg, 15890 { 15891 ...arrowProps, 15892 ref: forwardedRef, 15893 width, 15894 height, 15895 viewBox: "0 0 30 10", 15896 preserveAspectRatio: "none", 15897 children: props.asChild ? children : /* @__PURE__ */ (0,jsx_runtime.jsx)("polygon", { points: "0,0 30,0 15,10" }) 15898 } 15899 ); 15900}); 15901Arrow.displayName = NAME; 15902var Root = Arrow; 15903 15904//# sourceMappingURL=index.mjs.map 15905 15906// EXTERNAL MODULE: ./node_modules/@radix-ui/react-compose-refs/dist/index.mjs 15907var react_compose_refs_dist = __webpack_require__(8771); 15908// EXTERNAL MODULE: ./node_modules/@radix-ui/react-context/dist/index.mjs 15909var react_context_dist = __webpack_require__(5360); 15910// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs 15911var react_use_callback_ref_dist = __webpack_require__(9698); 15912// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs 15913var react_use_layout_effect_dist = __webpack_require__(9981); 15914// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-size/dist/index.mjs 15915var react_use_size_dist = __webpack_require__(7546); 15916;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-popper/dist/index.mjs 15917"use client"; 15918
vendor: 5,110 bytes, lines 15919-16030
15919// packages/react/popper/src/popper.tsx 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930var SIDE_OPTIONS = (/* unused pure expression or super */ null && (["top", "right", "bottom", "left"])); 15931var ALIGN_OPTIONS = (/* unused pure expression or super */ null && (["start", "center", "end"])); 15932var POPPER_NAME = "Popper"; 15933var [createPopperContext, createPopperScope] = (0,react_context_dist/* createContextScope */.b)(POPPER_NAME); 15934var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME); 15935var Popper = (props) => { 15936 const { __scopePopper, children } = props; 15937 const [anchor, setAnchor] = react.useState(null); 15938 return /* @__PURE__ */ (0,jsx_runtime.jsx)(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children }); 15939}; 15940Popper.displayName = POPPER_NAME; 15941var ANCHOR_NAME = "PopperAnchor"; 15942var PopperAnchor = react.forwardRef( 15943 (props, forwardedRef) => { 15944 const { __scopePopper, virtualRef, ...anchorProps } = props; 15945 const context = usePopperContext(ANCHOR_NAME, __scopePopper); 15946 const ref = react.useRef(null); 15947 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, ref); 15948 react.useEffect(() => { 15949 context.onAnchorChange(virtualRef?.current || ref.current); 15950 }); 15951 return virtualRef ? null : /* @__PURE__ */ (0,jsx_runtime.jsx)(dist/* Primitive */.WV.div, { ...anchorProps, ref: composedRefs }); 15952 } 15953); 15954PopperAnchor.displayName = ANCHOR_NAME; 15955var CONTENT_NAME = "PopperContent"; 15956var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME); 15957var PopperContent = react.forwardRef( 15958 (props, forwardedRef) => { 15959 const { 15960 __scopePopper, 15961 side = "bottom", 15962 sideOffset = 0, 15963 align = "center", 15964 alignOffset = 0, 15965 arrowPadding = 0, 15966 avoidCollisions = true, 15967 collisionBoundary = [], 15968 collisionPadding: collisionPaddingProp = 0, 15969 sticky = "partial", 15970 hideWhenDetached = false, 15971 updatePositionStrategy = "optimized", 15972 onPlaced, 15973 ...contentProps 15974 } = props; 15975 const context = usePopperContext(CONTENT_NAME, __scopePopper); 15976 const [content, setContent] = react.useState(null); 15977 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, (node) => setContent(node)); 15978 const [arrow, setArrow] = react.useState(null); 15979 const arrowSize = (0,react_use_size_dist/* useSize */.t)(arrow); 15980 const arrowWidth = arrowSize?.width ?? 0; 15981 const arrowHeight = arrowSize?.height ?? 0; 15982 const desiredPlacement = side + (align !== "center" ? "-" + align : ""); 15983 const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp }; 15984 const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary]; 15985 const hasExplicitBoundaries = boundary.length > 0; 15986 const detectOverflowOptions = { 15987 padding: collisionPadding, 15988 boundary: boundary.filter(isNotNull), 15989 // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries 15990 altBoundary: hasExplicitBoundaries 15991 }; 15992 const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({ 15993 // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues 15994 strategy: "fixed", 15995 placement: desiredPlacement, 15996 whileElementsMounted: (...args) => { 15997 const cleanup = autoUpdate(...args, { 15998 animationFrame: updatePositionStrategy === "always" 15999 }); 16000 return cleanup; 16001 }, 16002 elements: { 16003 reference: context.anchor 16004 }, 16005 middleware: [ 16006 floating_ui_react_dom_offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }), 16007 avoidCollisions && floating_ui_react_dom_shift({ 16008 mainAxis: true, 16009 crossAxis: false, 16010 limiter: sticky === "partial" ? floating_ui_react_dom_limitShift() : void 0, 16011 ...detectOverflowOptions 16012 }), 16013 avoidCollisions && floating_ui_react_dom_flip({ ...detectOverflowOptions }), 16014 floating_ui_react_dom_size({ 16015 ...detectOverflowOptions, 16016 apply: ({ elements, rects, availableWidth, availableHeight }) => { 16017 const { width: anchorWidth, height: anchorHeight } = rects.reference; 16018 const contentStyle = elements.floating.style; 16019 contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`); 16020 contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`); 16021 contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`); 16022 contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`); 16023 } 16024 }), 16025 arrow && floating_ui_react_dom_arrow({ element: arrow, padding: arrowPadding }), 16026 transformOrigin({ arrowWidth, arrowHeight }), 16027 hideWhenDetached && floating_ui_react_dom_hide({ strategy: "referenceHidden", ...detectOverflowOptions }) 16028 ] 16029 }); 16030 const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
vendor: 6,397 bytes, lines 16031-16207
16031 const handlePlaced = (0,react_use_callback_ref_dist/* useCallbackRef */.W)(onPlaced); 16032 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => { 16033 if (isPositioned) { 16034 handlePlaced?.(); 16035 } 16036 }, [isPositioned, handlePlaced]); 16037 const arrowX = middlewareData.arrow?.x; 16038 const arrowY = middlewareData.arrow?.y; 16039 const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0; 16040 const [contentZIndex, setContentZIndex] = react.useState(); 16041 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => { 16042 if (content) setContentZIndex(window.getComputedStyle(content).zIndex); 16043 }, [content]); 16044 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 16045 "div", 16046 { 16047 ref: refs.setFloating, 16048 "data-radix-popper-content-wrapper": "", 16049 style: { 16050 ...floatingStyles, 16051 transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)", 16052 // keep off the page when measuring 16053 minWidth: "max-content", 16054 zIndex: contentZIndex, 16055 ["--radix-popper-transform-origin"]: [ 16056 middlewareData.transformOrigin?.x, 16057 middlewareData.transformOrigin?.y 16058 ].join(" "), 16059 // hide the content if using the hide middleware and should be hidden 16060 // set visibility to hidden and disable pointer events so the UI behaves 16061 // as if the PopperContent isn't there at all 16062 ...middlewareData.hide?.referenceHidden && { 16063 visibility: "hidden", 16064 pointerEvents: "none" 16065 } 16066 }, 16067 dir: props.dir, 16068 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 16069 PopperContentProvider, 16070 { 16071 scope: __scopePopper, 16072 placedSide, 16073 onArrowChange: setArrow, 16074 arrowX, 16075 arrowY, 16076 shouldHideArrow: cannotCenterArrow, 16077 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 16078 dist/* Primitive */.WV.div, 16079 { 16080 "data-side": placedSide, 16081 "data-align": placedAlign, 16082 ...contentProps, 16083 ref: composedRefs, 16084 style: { 16085 ...contentProps.style, 16086 // if the PopperContent hasn't been placed yet (not all measurements done) 16087 // we prevent animations so that users's animation don't kick in too early referring wrong sides 16088 animation: !isPositioned ? "none" : void 0 16089 } 16090 } 16091 ) 16092 } 16093 ) 16094 } 16095 ); 16096 } 16097); 16098PopperContent.displayName = CONTENT_NAME; 16099var ARROW_NAME = "PopperArrow"; 16100var OPPOSITE_SIDE = { 16101 top: "bottom", 16102 right: "left", 16103 bottom: "top", 16104 left: "right" 16105}; 16106var PopperArrow = react.forwardRef(function PopperArrow2(props, forwardedRef) { 16107 const { __scopePopper, ...arrowProps } = props; 16108 const contentContext = useContentContext(ARROW_NAME, __scopePopper); 16109 const baseSide = OPPOSITE_SIDE[contentContext.placedSide]; 16110 return ( 16111 // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`) 16112 // doesn't report size as we'd expect on SVG elements. 16113 // it reports their bounding box which is effectively the largest path inside the SVG. 16114 /* @__PURE__ */ (0,jsx_runtime.jsx)( 16115 "span", 16116 { 16117 ref: contentContext.onArrowChange, 16118 style: { 16119 position: "absolute", 16120 left: contentContext.arrowX, 16121 top: contentContext.arrowY, 16122 [baseSide]: 0, 16123 transformOrigin: { 16124 top: "", 16125 right: "0 0", 16126 bottom: "center 0", 16127 left: "100% 0" 16128 }[contentContext.placedSide], 16129 transform: { 16130 top: "translateY(100%)", 16131 right: "translateY(50%) rotate(90deg) translateX(-50%)", 16132 bottom: `rotate(180deg)`, 16133 left: "translateY(50%) rotate(-90deg) translateX(50%)" 16134 }[contentContext.placedSide], 16135 visibility: contentContext.shouldHideArrow ? "hidden" : void 0 16136 }, 16137 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 16138 Root, 16139 { 16140 ...arrowProps, 16141 ref: forwardedRef, 16142 style: { 16143 ...arrowProps.style, 16144 // ensures the element can be measured correctly (mostly for if SVG) 16145 display: "block" 16146 } 16147 } 16148 ) 16149 } 16150 ) 16151 ); 16152}); 16153PopperArrow.displayName = ARROW_NAME; 16154function isNotNull(value) { 16155 return value !== null; 16156} 16157var transformOrigin = (options) => ({ 16158 name: "transformOrigin", 16159 options, 16160 fn(data) { 16161 const { placement, rects, middlewareData } = data; 16162 const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0; 16163 const isArrowHidden = cannotCenterArrow; 16164 const arrowWidth = isArrowHidden ? 0 : options.arrowWidth; 16165 const arrowHeight = isArrowHidden ? 0 : options.arrowHeight; 16166 const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement); 16167 const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign]; 16168 const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2; 16169 const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2; 16170 let x = ""; 16171 let y = ""; 16172 if (placedSide === "bottom") { 16173 x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; 16174 y = `${-arrowHeight}px`; 16175 } else if (placedSide === "top") { 16176 x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; 16177 y = `${rects.floating.height + arrowHeight}px`; 16178 } else if (placedSide === "right") { 16179 x = `${-arrowHeight}px`; 16180 y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; 16181 } else if (placedSide === "left") { 16182 x = `${rects.floating.width + arrowHeight}px`; 16183 y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; 16184 } 16185 return { data: { x, y } }; 16186 } 16187}); 16188function getSideAndAlignFromPlacement(placement) { 16189 const [side, align = "center"] = placement.split("-"); 16190 return [side, align]; 16191} 16192var Root2 = Popper; 16193var Anchor = PopperAnchor; 16194var Content = PopperContent; 16195var dist_Arrow = PopperArrow; 16196 16197//# sourceMappingURL=index.mjs.map 16198 16199 16200/***/ }), 16201 16202/***/ 2651: 16203/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 16204 16205"use strict"; 16206/* harmony export */ __webpack_require__.d(__webpack_exports__, { 16207/* harmony export */ h: function() { return /* binding */ Portal; }
16208/* harmony export */ }); 16209/* unused harmony export Root */ 16210/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 16211/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3935); 16212/* harmony import */ var _radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5320); 16213/* harmony import */ var _radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9981); 16214/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5893); 16215"use client"; 16216
16217// packages/react/portal/src/portal.tsx 16218 16219 16220 16221 16222 16223var PORTAL_NAME = "Portal"; 16224var Portal = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => { 16225 const { container: containerProp, ...portalProps } = props; 16226 const [mounted, setMounted] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false); 16227 (0,_radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_3__/* .useLayoutEffect */ .b)(() => setMounted(true), []); 16228 const container = containerProp || mounted && globalThis?.document?.body; 16229 return container ? react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal(/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_radix_ui_react_primitive__WEBPACK_IMPORTED_MODULE_4__/* .Primitive */ .WV.div, { ...portalProps, ref: forwardedRef }), container) : null; 16230}); 16231Portal.displayName = PORTAL_NAME; 16232var Root = (/* unused pure expression or super */ null && (Portal)); 16233 16234//# sourceMappingURL=index.mjs.map 16235 16236 16237/***/ }), 16238 16239/***/ 9115: 16240/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 16241 16242"use strict"; 16243/* harmony export */ __webpack_require__.d(__webpack_exports__, { 16244/* harmony export */ z: function() { return /* binding */ Presence; } 16245/* harmony export */ }); 16246/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 16247/* harmony import */ var _radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8771); 16248/* harmony import */ var _radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9981); 16249"use client"; 16250
16251// packages/react/presence/src/Presence.tsx 16252 16253 16254 16255
16256// packages/react/presence/src/useStateMachine.tsx 16257 16258function useStateMachine(initialState, machine) { 16259 return react__WEBPACK_IMPORTED_MODULE_0__.useReducer((state, event) => { 16260 const nextState = machine[state][event]; 16261 return nextState ?? state; 16262 }, initialState); 16263} 16264
vendor: 5,694 bytes, lines 16265-16400
16265// packages/react/presence/src/Presence.tsx 16266var Presence = (props) => { 16267 const { present, children } = props; 16268 const presence = usePresence(present); 16269 const child = typeof children === "function" ? children({ present: presence.isPresent }) : react__WEBPACK_IMPORTED_MODULE_0__.Children.only(children); 16270 const ref = (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_1__/* .useComposedRefs */ .e)(presence.ref, getElementRef(child)); 16271 const forceMount = typeof children === "function"; 16272 return forceMount || presence.isPresent ? react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(child, { ref }) : null; 16273}; 16274Presence.displayName = "Presence"; 16275function usePresence(present) { 16276 const [node, setNode] = react__WEBPACK_IMPORTED_MODULE_0__.useState(); 16277 const stylesRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef({}); 16278 const prevPresentRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(present); 16279 const prevAnimationNameRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef("none"); 16280 const initialState = present ? "mounted" : "unmounted"; 16281 const [state, send] = useStateMachine(initialState, { 16282 mounted: { 16283 UNMOUNT: "unmounted", 16284 ANIMATION_OUT: "unmountSuspended" 16285 }, 16286 unmountSuspended: { 16287 MOUNT: "mounted", 16288 ANIMATION_END: "unmounted" 16289 }, 16290 unmounted: { 16291 MOUNT: "mounted" 16292 } 16293 }); 16294 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 16295 const currentAnimationName = getAnimationName(stylesRef.current); 16296 prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none"; 16297 }, [state]); 16298 (0,_radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_2__/* .useLayoutEffect */ .b)(() => { 16299 const styles = stylesRef.current; 16300 const wasPresent = prevPresentRef.current; 16301 const hasPresentChanged = wasPresent !== present; 16302 if (hasPresentChanged) { 16303 const prevAnimationName = prevAnimationNameRef.current; 16304 const currentAnimationName = getAnimationName(styles); 16305 if (present) { 16306 send("MOUNT"); 16307 } else if (currentAnimationName === "none" || styles?.display === "none") { 16308 send("UNMOUNT"); 16309 } else { 16310 const isAnimating = prevAnimationName !== currentAnimationName; 16311 if (wasPresent && isAnimating) { 16312 send("ANIMATION_OUT"); 16313 } else { 16314 send("UNMOUNT"); 16315 } 16316 } 16317 prevPresentRef.current = present; 16318 } 16319 }, [present, send]); 16320 (0,_radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_2__/* .useLayoutEffect */ .b)(() => { 16321 if (node) { 16322 let timeoutId; 16323 const ownerWindow = node.ownerDocument.defaultView ?? window; 16324 const handleAnimationEnd = (event) => { 16325 const currentAnimationName = getAnimationName(stylesRef.current); 16326 const isCurrentAnimation = currentAnimationName.includes(event.animationName); 16327 if (event.target === node && isCurrentAnimation) { 16328 send("ANIMATION_END"); 16329 if (!prevPresentRef.current) { 16330 const currentFillMode = node.style.animationFillMode; 16331 node.style.animationFillMode = "forwards"; 16332 timeoutId = ownerWindow.setTimeout(() => { 16333 if (node.style.animationFillMode === "forwards") { 16334 node.style.animationFillMode = currentFillMode; 16335 } 16336 }); 16337 } 16338 } 16339 }; 16340 const handleAnimationStart = (event) => { 16341 if (event.target === node) { 16342 prevAnimationNameRef.current = getAnimationName(stylesRef.current); 16343 } 16344 }; 16345 node.addEventListener("animationstart", handleAnimationStart); 16346 node.addEventListener("animationcancel", handleAnimationEnd); 16347 node.addEventListener("animationend", handleAnimationEnd); 16348 return () => { 16349 ownerWindow.clearTimeout(timeoutId); 16350 node.removeEventListener("animationstart", handleAnimationStart); 16351 node.removeEventListener("animationcancel", handleAnimationEnd); 16352 node.removeEventListener("animationend", handleAnimationEnd); 16353 }; 16354 } else { 16355 send("ANIMATION_END"); 16356 } 16357 }, [node, send]); 16358 return { 16359 isPresent: ["mounted", "unmountSuspended"].includes(state), 16360 ref: react__WEBPACK_IMPORTED_MODULE_0__.useCallback((node2) => { 16361 if (node2) stylesRef.current = getComputedStyle(node2); 16362 setNode(node2); 16363 }, []) 16364 }; 16365} 16366function getAnimationName(styles) { 16367 return styles?.animationName || "none"; 16368} 16369function getElementRef(element) { 16370 let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; 16371 let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 16372 if (mayWarn) { 16373 return element.ref; 16374 } 16375 getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; 16376 mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 16377 if (mayWarn) { 16378 return element.props.ref; 16379 } 16380 return element.props.ref || element.ref; 16381} 16382 16383//# sourceMappingURL=index.mjs.map 16384 16385 16386/***/ }), 16387 16388/***/ 5320: 16389/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 16390 16391"use strict"; 16392/* harmony export */ __webpack_require__.d(__webpack_exports__, { 16393/* harmony export */ WV: function() { return /* binding */ Primitive; }, 16394/* harmony export */ jH: function() { return /* binding */ dispatchDiscreteCustomEvent; } 16395/* harmony export */ }); 16396/* unused harmony export Root */ 16397/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 16398/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3935); 16399/* harmony import */ var _radix_ui_react_slot__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8426); 16400/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5893);
16401// packages/react/primitive/src/primitive.tsx 16402 16403 16404 16405 16406var NODES = [ 16407 "a", 16408 "button", 16409 "div", 16410 "form", 16411 "h2", 16412 "h3", 16413 "img", 16414 "input", 16415 "label", 16416 "li", 16417 "nav", 16418 "ol", 16419 "p", 16420 "span", 16421 "svg", 16422 "ul" 16423]; 16424var Primitive = NODES.reduce((primitive, node) => { 16425 const Node = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => { 16426 const { asChild, ...primitiveProps } = props; 16427 const Comp = asChild ? _radix_ui_react_slot__WEBPACK_IMPORTED_MODULE_3__/* .Slot */ .g7 : node; 16428 if (typeof window !== "undefined") { 16429 window[Symbol.for("radix-ui")] = true; 16430 } 16431 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Comp, { ...primitiveProps, ref: forwardedRef }); 16432 }); 16433 Node.displayName = `Primitive.${node}`; 16434 return { ...primitive, [node]: Node }; 16435}, {}); 16436function dispatchDiscreteCustomEvent(target, event) { 16437 if (target) react_dom__WEBPACK_IMPORTED_MODULE_1__.flushSync(() => target.dispatchEvent(event)); 16438} 16439var Root = (/* unused pure expression or super */ null && (Primitive)); 16440 16441//# sourceMappingURL=index.mjs.map 16442 16443 16444/***/ }), 16445 16446/***/ 3952: 16447/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 16448 16449"use strict"; 16450 16451// EXPORTS 16452__webpack_require__.d(__webpack_exports__, { 16453 VY: function() { return /* binding */ Content2; }, 16454 ZA: function() { return /* binding */ Group; }, 16455 JO: function() { return /* binding */ Icon; }, 16456 ck: function() { return /* binding */ Item; }, 16457 wU: function() { return /* binding */ ItemIndicator; }, 16458 eT: function() { return /* binding */ ItemText; }, 16459 __: function() { return /* binding */ Label; }, 16460 h_: function() { return /* binding */ Portal; }, 16461 fC: function() { return /* binding */ Root2; },
16462 $G: function() { return /* binding */ ScrollDownButton; }, 16463 u_: function() { return /* binding */ ScrollUpButton; }, 16464 Z0: function() { return /* binding */ Separator; }, 16465 xz: function() { return /* binding */ Trigger; }, 16466 B4: function() { return /* binding */ Value; }, 16467 l_: function() { return /* binding */ Viewport; } 16468}); 16469 16470// UNUSED EXPORTS: Arrow, Select, SelectArrow, SelectContent, SelectGroup, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectLabel, SelectPortal, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectViewport, createSelectScope 16471 16472// EXTERNAL MODULE: ./node_modules/react/index.js 16473var react = __webpack_require__(7294); 16474// EXTERNAL MODULE: ./node_modules/react-dom/index.js 16475var react_dom = __webpack_require__(3935); 16476;// CONCATENATED MODULE: ./node_modules/@radix-ui/number/dist/index.mjs
16477// packages/core/number/src/number.ts 16478function clamp(value, [min, max]) { 16479 return Math.min(max, Math.max(min, value)); 16480} 16481 16482//# sourceMappingURL=index.mjs.map 16483 16484// EXTERNAL MODULE: ./node_modules/@radix-ui/primitive/dist/index.mjs 16485var dist = __webpack_require__(6206); 16486// EXTERNAL MODULE: ./node_modules/@radix-ui/react-collection/dist/index.mjs 16487var react_collection_dist = __webpack_require__(5936); 16488// EXTERNAL MODULE: ./node_modules/@radix-ui/react-compose-refs/dist/index.mjs 16489var react_compose_refs_dist = __webpack_require__(8771); 16490// EXTERNAL MODULE: ./node_modules/@radix-ui/react-context/dist/index.mjs 16491var react_context_dist = __webpack_require__(5360); 16492// EXTERNAL MODULE: ./node_modules/@radix-ui/react-direction/dist/index.mjs 16493var react_direction_dist = __webpack_require__(8990); 16494// EXTERNAL MODULE: ./node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs + 1 modules 16495var react_dismissable_layer_dist = __webpack_require__(6063); 16496// EXTERNAL MODULE: ./node_modules/@radix-ui/react-focus-guards/dist/index.mjs 16497var react_focus_guards_dist = __webpack_require__(7552); 16498// EXTERNAL MODULE: ./node_modules/@radix-ui/react-focus-scope/dist/index.mjs 16499var react_focus_scope_dist = __webpack_require__(5420); 16500// EXTERNAL MODULE: ./node_modules/@radix-ui/react-id/dist/index.mjs 16501var react_id_dist = __webpack_require__(1276); 16502// EXTERNAL MODULE: ./node_modules/@radix-ui/react-popper/dist/index.mjs + 6 modules 16503var react_popper_dist = __webpack_require__(3990); 16504// EXTERNAL MODULE: ./node_modules/@radix-ui/react-portal/dist/index.mjs 16505var react_portal_dist = __webpack_require__(2651); 16506// EXTERNAL MODULE: ./node_modules/@radix-ui/react-primitive/dist/index.mjs 16507var react_primitive_dist = __webpack_require__(5320); 16508// EXTERNAL MODULE: ./node_modules/@radix-ui/react-slot/dist/index.mjs 16509var react_slot_dist = __webpack_require__(8426); 16510// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs 16511var react_use_callback_ref_dist = __webpack_require__(9698); 16512// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs 16513var react_use_controllable_state_dist = __webpack_require__(7342); 16514// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs 16515var react_use_layout_effect_dist = __webpack_require__(9981); 16516// EXTERNAL MODULE: ./node_modules/@radix-ui/react-use-previous/dist/index.mjs 16517var react_use_previous_dist = __webpack_require__(7898); 16518// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 16519var jsx_runtime = __webpack_require__(5893); 16520;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
16521// packages/react/visually-hidden/src/visually-hidden.tsx 16522 16523 16524 16525var NAME = "VisuallyHidden"; 16526var VisuallyHidden = react.forwardRef( 16527 (props, forwardedRef) => { 16528 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 16529 react_primitive_dist/* Primitive */.WV.span, 16530 { 16531 ...props, 16532 ref: forwardedRef, 16533 style: { 16534 // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss 16535 position: "absolute", 16536 border: 0, 16537 width: 1, 16538 height: 1, 16539 padding: 0, 16540 margin: -1, 16541 overflow: "hidden", 16542 clip: "rect(0, 0, 0, 0)", 16543 whiteSpace: "nowrap", 16544 wordWrap: "normal", 16545 ...props.style 16546 } 16547 } 16548 ); 16549 } 16550); 16551VisuallyHidden.displayName = NAME; 16552var Root = (/* unused pure expression or super */ null && (VisuallyHidden)); 16553 16554//# sourceMappingURL=index.mjs.map 16555 16556// EXTERNAL MODULE: ./node_modules/aria-hidden/dist/es2015/index.js 16557var es2015 = __webpack_require__(3541); 16558// EXTERNAL MODULE: ./node_modules/react-remove-scroll/dist/es2015/Combination.js + 21 modules 16559var Combination = __webpack_require__(6223); 16560;// CONCATENATED MODULE: ./node_modules/@radix-ui/react-select/dist/index.mjs 16561"use client"; 16562
16563// packages/react/select/src/select.tsx 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"]; 16590var SELECTION_KEYS = [" ", "Enter"]; 16591var SELECT_NAME = "Select"; 16592var [Collection, useCollection, createCollectionScope] = (0,react_collection_dist/* createCollection */.B)(SELECT_NAME); 16593var [createSelectContext, createSelectScope] = (0,react_context_dist/* createContextScope */.b)(SELECT_NAME, [ 16594 createCollectionScope, 16595 react_popper_dist/* createPopperScope */.D7 16596]); 16597var usePopperScope = (0,react_popper_dist/* createPopperScope */.D7)(); 16598var [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME); 16599var [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME); 16600var Select = (props) => { 16601 const { 16602 __scopeSelect, 16603 children, 16604 open: openProp, 16605 defaultOpen, 16606 onOpenChange, 16607 value: valueProp, 16608 defaultValue, 16609 onValueChange, 16610 dir, 16611 name, 16612 autoComplete, 16613 disabled, 16614 required, 16615 form 16616 } = props; 16617 const popperScope = usePopperScope(__scopeSelect); 16618 const [trigger, setTrigger] = react.useState(null); 16619 const [valueNode, setValueNode] = react.useState(null); 16620 const [valueNodeHasChildren, setValueNodeHasChildren] = react.useState(false); 16621 const direction = (0,react_direction_dist/* useDirection */.gm)(dir); 16622 const [open = false, setOpen] = (0,react_use_controllable_state_dist/* useControllableState */.T)({ 16623 prop: openProp, 16624 defaultProp: defaultOpen, 16625 onChange: onOpenChange 16626 }); 16627 const [value, setValue] = (0,react_use_controllable_state_dist/* useControllableState */.T)({ 16628 prop: valueProp, 16629 defaultProp: defaultValue, 16630 onChange: onValueChange 16631 }); 16632 const triggerPointerDownPosRef = react.useRef(null); 16633 const isFormControl = trigger ? form || !!trigger.closest("form") : true; 16634 const [nativeOptionsSet, setNativeOptionsSet] = react.useState(/* @__PURE__ */ new Set()); 16635 const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";"); 16636 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_popper_dist/* Root */.fC, { ...popperScope, children: /* @__PURE__ */ (0,jsx_runtime.jsxs)( 16637 SelectProvider, 16638 { 16639 required, 16640 scope: __scopeSelect, 16641 trigger, 16642 onTriggerChange: setTrigger, 16643 valueNode, 16644 onValueNodeChange: setValueNode, 16645 valueNodeHasChildren, 16646 onValueNodeHasChildrenChange: setValueNodeHasChildren, 16647 contentId: (0,react_id_dist/* useId */.M)(), 16648 value, 16649 onValueChange: setValue, 16650 open, 16651 onOpenChange: setOpen, 16652 dir: direction, 16653 triggerPointerDownPosRef, 16654 disabled, 16655 children: [
16656 /* @__PURE__ */ (0,jsx_runtime.jsx)(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 16657 SelectNativeOptionsProvider, 16658 { 16659 scope: props.__scopeSelect, 16660 onNativeOptionAdd: react.useCallback((option) => { 16661 setNativeOptionsSet((prev) => new Set(prev).add(option)); 16662 }, []), 16663 onNativeOptionRemove: react.useCallback((option) => { 16664 setNativeOptionsSet((prev) => { 16665 const optionsSet = new Set(prev); 16666 optionsSet.delete(option); 16667 return optionsSet; 16668 }); 16669 }, []), 16670 children 16671 } 16672 ) }), 16673 isFormControl ? /* @__PURE__ */ (0,jsx_runtime.jsxs)( 16674 BubbleSelect, 16675 { 16676 "aria-hidden": true, 16677 required, 16678 tabIndex: -1, 16679 name, 16680 autoComplete, 16681 value, 16682 onChange: (event) => setValue(event.target.value), 16683 disabled, 16684 form, 16685 children: [ 16686 value === void 0 ? /* @__PURE__ */ (0,jsx_runtime.jsx)("option", { value: "" }) : null, 16687 Array.from(nativeOptionsSet) 16688 ] 16689 }, 16690 nativeSelectKey 16691 ) : null 16692 ] 16693 } 16694 ) }); 16695}; 16696Select.displayName = SELECT_NAME; 16697var TRIGGER_NAME = "SelectTrigger"; 16698var SelectTrigger = react.forwardRef( 16699 (props, forwardedRef) => { 16700 const { __scopeSelect, disabled = false, ...triggerProps } = props; 16701 const popperScope = usePopperScope(__scopeSelect); 16702 const context = useSelectContext(TRIGGER_NAME, __scopeSelect); 16703 const isDisabled = context.disabled || disabled; 16704 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, context.onTriggerChange); 16705 const getItems = useCollection(__scopeSelect); 16706 const pointerTypeRef = react.useRef("touch"); 16707 const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => { 16708 const enabledItems = getItems().filter((item) => !item.disabled); 16709 const currentItem = enabledItems.find((item) => item.value === context.value); 16710 const nextItem = findNextItem(enabledItems, search, currentItem); 16711 if (nextItem !== void 0) { 16712 context.onValueChange(nextItem.value); 16713 } 16714 }); 16715 const handleOpen = (pointerEvent) => { 16716 if (!isDisabled) { 16717 context.onOpenChange(true); 16718 resetTypeahead(); 16719 } 16720 if (pointerEvent) { 16721 context.triggerPointerDownPosRef.current = { 16722 x: Math.round(pointerEvent.pageX), 16723 y: Math.round(pointerEvent.pageY) 16724 }; 16725 } 16726 }; 16727 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_popper_dist/* Anchor */.ee, { asChild: true, ...popperScope, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 16728 react_primitive_dist/* Primitive */.WV.button, 16729 { 16730 type: "button", 16731 role: "combobox", 16732 "aria-controls": context.contentId, 16733 "aria-expanded": context.open, 16734 "aria-required": context.required, 16735 "aria-autocomplete": "none", 16736 dir: context.dir, 16737 "data-state": context.open ? "open" : "closed", 16738 disabled: isDisabled, 16739 "data-disabled": isDisabled ? "" : void 0, 16740 "data-placeholder": shouldShowPlaceholder(context.value) ? "" : void 0, 16741 ...triggerProps, 16742 ref: composedRefs, 16743 onClick: (0,dist/* composeEventHandlers */.M)(triggerProps.onClick, (event) => { 16744 event.currentTarget.focus(); 16745 if (pointerTypeRef.current !== "mouse") { 16746 handleOpen(event); 16747 } 16748 }), 16749 onPointerDown: (0,dist/* composeEventHandlers */.M)(triggerProps.onPointerDown, (event) => { 16750 pointerTypeRef.current = event.pointerType; 16751 const target = event.target; 16752 if (target.hasPointerCapture(event.pointerId)) { 16753 target.releasePointerCapture(event.pointerId); 16754 } 16755 if (event.button === 0 && event.ctrlKey === false && event.pointerType === "mouse") { 16756 handleOpen(event); 16757 event.preventDefault(); 16758 } 16759 }), 16760 onKeyDown: (0,dist/* composeEventHandlers */.M)(triggerProps.onKeyDown, (event) => { 16761 const isTypingAhead = searchRef.current !== ""; 16762 const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; 16763 if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key); 16764 if (isTypingAhead && event.key === " ") return; 16765 if (OPEN_KEYS.includes(event.key)) { 16766 handleOpen(); 16767 event.preventDefault(); 16768 } 16769 }) 16770 } 16771 ) }); 16772 } 16773); 16774SelectTrigger.displayName = TRIGGER_NAME;
16775var VALUE_NAME = "SelectValue"; 16776var SelectValue = react.forwardRef( 16777 (props, forwardedRef) => { 16778 const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props; 16779 const context = useSelectContext(VALUE_NAME, __scopeSelect); 16780 const { onValueNodeHasChildrenChange } = context; 16781 const hasChildren = children !== void 0; 16782 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, context.onValueNodeChange); 16783 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => { 16784 onValueNodeHasChildrenChange(hasChildren); 16785 }, [onValueNodeHasChildrenChange, hasChildren]); 16786 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 16787 react_primitive_dist/* Primitive */.WV.span, 16788 { 16789 ...valueProps, 16790 ref: composedRefs, 16791 style: { pointerEvents: "none" }, 16792 children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ (0,jsx_runtime.jsx)(jsx_runtime.Fragment, { children: placeholder }) : children 16793 } 16794 ); 16795 } 16796); 16797SelectValue.displayName = VALUE_NAME; 16798var ICON_NAME = "SelectIcon"; 16799var SelectIcon = react.forwardRef( 16800 (props, forwardedRef) => { 16801 const { __scopeSelect, children, ...iconProps } = props; 16802 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" }); 16803 } 16804); 16805SelectIcon.displayName = ICON_NAME; 16806var PORTAL_NAME = "SelectPortal"; 16807var SelectPortal = (props) => { 16808 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_portal_dist/* Portal */.h, { asChild: true, ...props }); 16809}; 16810SelectPortal.displayName = PORTAL_NAME; 16811var CONTENT_NAME = "SelectContent"; 16812var SelectContent = react.forwardRef( 16813 (props, forwardedRef) => { 16814 const context = useSelectContext(CONTENT_NAME, props.__scopeSelect); 16815 const [fragment, setFragment] = react.useState(); 16816 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => { 16817 setFragment(new DocumentFragment()); 16818 }, []); 16819 if (!context.open) { 16820 const frag = fragment; 16821 return frag ? react_dom.createPortal(
vendor: 25,072 bytes, lines 16822-17370
16822 /* @__PURE__ */ (0,jsx_runtime.jsx)(SelectContentProvider, { scope: props.__scopeSelect, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(Collection.Slot, { scope: props.__scopeSelect, children: /* @__PURE__ */ (0,jsx_runtime.jsx)("div", { children: props.children }) }) }), 16823 frag 16824 ) : null; 16825 } 16826 return /* @__PURE__ */ (0,jsx_runtime.jsx)(SelectContentImpl, { ...props, ref: forwardedRef }); 16827 } 16828); 16829SelectContent.displayName = CONTENT_NAME; 16830var CONTENT_MARGIN = 10; 16831var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME); 16832var CONTENT_IMPL_NAME = "SelectContentImpl"; 16833var SelectContentImpl = react.forwardRef( 16834 (props, forwardedRef) => { 16835 const { 16836 __scopeSelect, 16837 position = "item-aligned", 16838 onCloseAutoFocus, 16839 onEscapeKeyDown, 16840 onPointerDownOutside, 16841 // 16842 // PopperContent props 16843 side, 16844 sideOffset, 16845 align, 16846 alignOffset, 16847 arrowPadding, 16848 collisionBoundary, 16849 collisionPadding, 16850 sticky, 16851 hideWhenDetached, 16852 avoidCollisions, 16853 // 16854 ...contentProps 16855 } = props; 16856 const context = useSelectContext(CONTENT_NAME, __scopeSelect); 16857 const [content, setContent] = react.useState(null); 16858 const [viewport, setViewport] = react.useState(null); 16859 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, (node) => setContent(node)); 16860 const [selectedItem, setSelectedItem] = react.useState(null); 16861 const [selectedItemText, setSelectedItemText] = react.useState( 16862 null 16863 ); 16864 const getItems = useCollection(__scopeSelect); 16865 const [isPositioned, setIsPositioned] = react.useState(false); 16866 const firstValidItemFoundRef = react.useRef(false); 16867 react.useEffect(() => { 16868 if (content) return (0,es2015/* hideOthers */.Ry)(content); 16869 }, [content]); 16870 (0,react_focus_guards_dist/* useFocusGuards */.EW)(); 16871 const focusFirst = react.useCallback( 16872 (candidates) => { 16873 const [firstItem, ...restItems] = getItems().map((item) => item.ref.current); 16874 const [lastItem] = restItems.slice(-1); 16875 const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; 16876 for (const candidate of candidates) { 16877 if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; 16878 candidate?.scrollIntoView({ block: "nearest" }); 16879 if (candidate === firstItem && viewport) viewport.scrollTop = 0; 16880 if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight; 16881 candidate?.focus(); 16882 if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; 16883 } 16884 }, 16885 [getItems, viewport] 16886 ); 16887 const focusSelectedItem = react.useCallback( 16888 () => focusFirst([selectedItem, content]), 16889 [focusFirst, selectedItem, content] 16890 ); 16891 react.useEffect(() => { 16892 if (isPositioned) { 16893 focusSelectedItem(); 16894 } 16895 }, [isPositioned, focusSelectedItem]); 16896 const { onOpenChange, triggerPointerDownPosRef } = context; 16897 react.useEffect(() => { 16898 if (content) { 16899 let pointerMoveDelta = { x: 0, y: 0 }; 16900 const handlePointerMove = (event) => { 16901 pointerMoveDelta = { 16902 x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)), 16903 y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0)) 16904 }; 16905 }; 16906 const handlePointerUp = (event) => { 16907 if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) { 16908 event.preventDefault(); 16909 } else { 16910 if (!content.contains(event.target)) { 16911 onOpenChange(false); 16912 } 16913 } 16914 document.removeEventListener("pointermove", handlePointerMove); 16915 triggerPointerDownPosRef.current = null; 16916 }; 16917 if (triggerPointerDownPosRef.current !== null) { 16918 document.addEventListener("pointermove", handlePointerMove); 16919 document.addEventListener("pointerup", handlePointerUp, { capture: true, once: true }); 16920 } 16921 return () => { 16922 document.removeEventListener("pointermove", handlePointerMove); 16923 document.removeEventListener("pointerup", handlePointerUp, { capture: true }); 16924 }; 16925 } 16926 }, [content, onOpenChange, triggerPointerDownPosRef]); 16927 react.useEffect(() => { 16928 const close = () => onOpenChange(false); 16929 window.addEventListener("blur", close); 16930 window.addEventListener("resize", close); 16931 return () => { 16932 window.removeEventListener("blur", close); 16933 window.removeEventListener("resize", close); 16934 }; 16935 }, [onOpenChange]); 16936 const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => { 16937 const enabledItems = getItems().filter((item) => !item.disabled); 16938 const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement); 16939 const nextItem = findNextItem(enabledItems, search, currentItem); 16940 if (nextItem) { 16941 setTimeout(() => nextItem.ref.current.focus()); 16942 } 16943 }); 16944 const itemRefCallback = react.useCallback( 16945 (node, value, disabled) => { 16946 const isFirstValidItem = !firstValidItemFoundRef.current && !disabled; 16947 const isSelectedItem = context.value !== void 0 && context.value === value; 16948 if (isSelectedItem || isFirstValidItem) { 16949 setSelectedItem(node); 16950 if (isFirstValidItem) firstValidItemFoundRef.current = true; 16951 } 16952 }, 16953 [context.value] 16954 ); 16955 const handleItemLeave = react.useCallback(() => content?.focus(), [content]); 16956 const itemTextRefCallback = react.useCallback( 16957 (node, value, disabled) => { 16958 const isFirstValidItem = !firstValidItemFoundRef.current && !disabled; 16959 const isSelectedItem = context.value !== void 0 && context.value === value; 16960 if (isSelectedItem || isFirstValidItem) { 16961 setSelectedItemText(node); 16962 } 16963 }, 16964 [context.value] 16965 ); 16966 const SelectPosition = position === "popper" ? SelectPopperPosition : SelectItemAlignedPosition; 16967 const popperContentProps = SelectPosition === SelectPopperPosition ? { 16968 side, 16969 sideOffset, 16970 align, 16971 alignOffset, 16972 arrowPadding, 16973 collisionBoundary, 16974 collisionPadding, 16975 sticky, 16976 hideWhenDetached, 16977 avoidCollisions 16978 } : {}; 16979 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 16980 SelectContentProvider, 16981 { 16982 scope: __scopeSelect, 16983 content, 16984 viewport, 16985 onViewportChange: setViewport, 16986 itemRefCallback, 16987 selectedItem, 16988 onItemLeave: handleItemLeave, 16989 itemTextRefCallback, 16990 focusSelectedItem, 16991 selectedItemText, 16992 position, 16993 isPositioned, 16994 searchRef, 16995 children: /* @__PURE__ */ (0,jsx_runtime.jsx)(Combination/* default */.Z, { as: react_slot_dist/* Slot */.g7, allowPinchZoom: true, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 16996 react_focus_scope_dist/* FocusScope */.M, 16997 { 16998 asChild: true, 16999 trapped: context.open, 17000 onMountAutoFocus: (event) => { 17001 event.preventDefault(); 17002 }, 17003 onUnmountAutoFocus: (0,dist/* composeEventHandlers */.M)(onCloseAutoFocus, (event) => { 17004 context.trigger?.focus({ preventScroll: true }); 17005 event.preventDefault(); 17006 }), 17007 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 17008 react_dismissable_layer_dist/* DismissableLayer */.XB, 17009 { 17010 asChild: true, 17011 disableOutsidePointerEvents: true, 17012 onEscapeKeyDown, 17013 onPointerDownOutside, 17014 onFocusOutside: (event) => event.preventDefault(), 17015 onDismiss: () => context.onOpenChange(false), 17016 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 17017 SelectPosition, 17018 { 17019 role: "listbox", 17020 id: context.contentId, 17021 "data-state": context.open ? "open" : "closed", 17022 dir: context.dir, 17023 onContextMenu: (event) => event.preventDefault(), 17024 ...contentProps, 17025 ...popperContentProps, 17026 onPlaced: () => setIsPositioned(true), 17027 ref: composedRefs, 17028 style: { 17029 // flex layout so we can place the scroll buttons properly 17030 display: "flex", 17031 flexDirection: "column", 17032 // reset the outline by default as the content MAY get focused 17033 outline: "none", 17034 ...contentProps.style 17035 }, 17036 onKeyDown: (0,dist/* composeEventHandlers */.M)(contentProps.onKeyDown, (event) => { 17037 const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; 17038 if (event.key === "Tab") event.preventDefault(); 17039 if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key); 17040 if (["ArrowUp", "ArrowDown", "Home", "End"].includes(event.key)) { 17041 const items = getItems().filter((item) => !item.disabled); 17042 let candidateNodes = items.map((item) => item.ref.current); 17043 if (["ArrowUp", "End"].includes(event.key)) { 17044 candidateNodes = candidateNodes.slice().reverse(); 17045 } 17046 if (["ArrowUp", "ArrowDown"].includes(event.key)) { 17047 const currentElement = event.target; 17048 const currentIndex = candidateNodes.indexOf(currentElement); 17049 candidateNodes = candidateNodes.slice(currentIndex + 1); 17050 } 17051 setTimeout(() => focusFirst(candidateNodes)); 17052 event.preventDefault(); 17053 } 17054 }) 17055 } 17056 ) 17057 } 17058 ) 17059 } 17060 ) }) 17061 } 17062 ); 17063 } 17064); 17065SelectContentImpl.displayName = CONTENT_IMPL_NAME; 17066var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition"; 17067var SelectItemAlignedPosition = react.forwardRef((props, forwardedRef) => { 17068 const { __scopeSelect, onPlaced, ...popperProps } = props; 17069 const context = useSelectContext(CONTENT_NAME, __scopeSelect); 17070 const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect); 17071 const [contentWrapper, setContentWrapper] = react.useState(null); 17072 const [content, setContent] = react.useState(null); 17073 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, (node) => setContent(node)); 17074 const getItems = useCollection(__scopeSelect); 17075 const shouldExpandOnScrollRef = react.useRef(false); 17076 const shouldRepositionRef = react.useRef(true); 17077 const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext; 17078 const position = react.useCallback(() => { 17079 if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) { 17080 const triggerRect = context.trigger.getBoundingClientRect(); 17081 const contentRect = content.getBoundingClientRect(); 17082 const valueNodeRect = context.valueNode.getBoundingClientRect(); 17083 const itemTextRect = selectedItemText.getBoundingClientRect(); 17084 if (context.dir !== "rtl") { 17085 const itemTextOffset = itemTextRect.left - contentRect.left; 17086 const left = valueNodeRect.left - itemTextOffset; 17087 const leftDelta = triggerRect.left - left; 17088 const minContentWidth = triggerRect.width + leftDelta; 17089 const contentWidth = Math.max(minContentWidth, contentRect.width); 17090 const rightEdge = window.innerWidth - CONTENT_MARGIN; 17091 const clampedLeft = clamp(left, [ 17092 CONTENT_MARGIN, 17093 // Prevents the content from going off the starting edge of the 17094 // viewport. It may still go off the ending edge, but this can be 17095 // controlled by the user since they may want to manage overflow in a 17096 // specific way. 17097 // https://github.com/radix-ui/primitives/issues/2049 17098 Math.max(CONTENT_MARGIN, rightEdge - contentWidth) 17099 ]); 17100 contentWrapper.style.minWidth = minContentWidth + "px"; 17101 contentWrapper.style.left = clampedLeft + "px"; 17102 } else { 17103 const itemTextOffset = contentRect.right - itemTextRect.right; 17104 const right = window.innerWidth - valueNodeRect.right - itemTextOffset; 17105 const rightDelta = window.innerWidth - triggerRect.right - right; 17106 const minContentWidth = triggerRect.width + rightDelta; 17107 const contentWidth = Math.max(minContentWidth, contentRect.width); 17108 const leftEdge = window.innerWidth - CONTENT_MARGIN; 17109 const clampedRight = clamp(right, [ 17110 CONTENT_MARGIN, 17111 Math.max(CONTENT_MARGIN, leftEdge - contentWidth) 17112 ]); 17113 contentWrapper.style.minWidth = minContentWidth + "px"; 17114 contentWrapper.style.right = clampedRight + "px"; 17115 } 17116 const items = getItems(); 17117 const availableHeight = window.innerHeight - CONTENT_MARGIN * 2; 17118 const itemsHeight = viewport.scrollHeight; 17119 const contentStyles = window.getComputedStyle(content); 17120 const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10); 17121 const contentPaddingTop = parseInt(contentStyles.paddingTop, 10); 17122 const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10); 17123 const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10); 17124 const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; 17125 const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight); 17126 const viewportStyles = window.getComputedStyle(viewport); 17127 const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10); 17128 const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10); 17129 const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN; 17130 const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle; 17131 const selectedItemHalfHeight = selectedItem.offsetHeight / 2; 17132 const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight; 17133 const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle; 17134 const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle; 17135 const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle; 17136 if (willAlignWithoutTopOverflow) { 17137 const isLastItem = items.length > 0 && selectedItem === items[items.length - 1].ref.current; 17138 contentWrapper.style.bottom = "0px"; 17139 const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight; 17140 const clampedTriggerMiddleToBottomEdge = Math.max( 17141 triggerMiddleToBottomEdge, 17142 selectedItemHalfHeight + // viewport might have padding bottom, include it to avoid a scrollable viewport 17143 (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth 17144 ); 17145 const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge; 17146 contentWrapper.style.height = height + "px"; 17147 } else { 17148 const isFirstItem = items.length > 0 && selectedItem === items[0].ref.current; 17149 contentWrapper.style.top = "0px"; 17150 const clampedTopEdgeToTriggerMiddle = Math.max( 17151 topEdgeToTriggerMiddle, 17152 contentBorderTopWidth + viewport.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport 17153 (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight 17154 ); 17155 const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom; 17156 contentWrapper.style.height = height + "px"; 17157 viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop; 17158 } 17159 contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`; 17160 contentWrapper.style.minHeight = minContentHeight + "px"; 17161 contentWrapper.style.maxHeight = availableHeight + "px"; 17162 onPlaced?.(); 17163 requestAnimationFrame(() => shouldExpandOnScrollRef.current = true); 17164 } 17165 }, [ 17166 getItems, 17167 context.trigger, 17168 context.valueNode, 17169 contentWrapper, 17170 content, 17171 viewport, 17172 selectedItem, 17173 selectedItemText, 17174 context.dir, 17175 onPlaced 17176 ]); 17177 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => position(), [position]); 17178 const [contentZIndex, setContentZIndex] = react.useState(); 17179 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => { 17180 if (content) setContentZIndex(window.getComputedStyle(content).zIndex); 17181 }, [content]); 17182 const handleScrollButtonChange = react.useCallback( 17183 (node) => { 17184 if (node && shouldRepositionRef.current === true) { 17185 position(); 17186 focusSelectedItem?.(); 17187 shouldRepositionRef.current = false; 17188 } 17189 }, 17190 [position, focusSelectedItem] 17191 ); 17192 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 17193 SelectViewportProvider, 17194 { 17195 scope: __scopeSelect, 17196 contentWrapper, 17197 shouldExpandOnScrollRef, 17198 onScrollButtonChange: handleScrollButtonChange, 17199 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 17200 "div", 17201 { 17202 ref: setContentWrapper, 17203 style: { 17204 display: "flex", 17205 flexDirection: "column", 17206 position: "fixed", 17207 zIndex: contentZIndex 17208 }, 17209 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 17210 react_primitive_dist/* Primitive */.WV.div, 17211 { 17212 ...popperProps, 17213 ref: composedRefs, 17214 style: { 17215 // When we get the height of the content, it includes borders. If we were to set 17216 // the height without having `boxSizing: 'border-box'` it would be too big. 17217 boxSizing: "border-box", 17218 // We need to ensure the content doesn't get taller than the wrapper 17219 maxHeight: "100%", 17220 ...popperProps.style 17221 } 17222 } 17223 ) 17224 } 17225 ) 17226 } 17227 ); 17228}); 17229SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME; 17230var POPPER_POSITION_NAME = "SelectPopperPosition"; 17231var SelectPopperPosition = react.forwardRef((props, forwardedRef) => { 17232 const { 17233 __scopeSelect, 17234 align = "start", 17235 collisionPadding = CONTENT_MARGIN, 17236 ...popperProps 17237 } = props; 17238 const popperScope = usePopperScope(__scopeSelect); 17239 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 17240 react_popper_dist/* Content */.VY, 17241 { 17242 ...popperScope, 17243 ...popperProps, 17244 ref: forwardedRef, 17245 align, 17246 collisionPadding, 17247 style: { 17248 // Ensure border-box for floating-ui calculations 17249 boxSizing: "border-box", 17250 ...popperProps.style, 17251 // re-namespace exposed content custom properties 17252 ...{ 17253 "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)", 17254 "--radix-select-content-available-width": "var(--radix-popper-available-width)", 17255 "--radix-select-content-available-height": "var(--radix-popper-available-height)", 17256 "--radix-select-trigger-width": "var(--radix-popper-anchor-width)", 17257 "--radix-select-trigger-height": "var(--radix-popper-anchor-height)" 17258 } 17259 } 17260 } 17261 ); 17262}); 17263SelectPopperPosition.displayName = POPPER_POSITION_NAME; 17264var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME, {}); 17265var VIEWPORT_NAME = "SelectViewport"; 17266var SelectViewport = react.forwardRef( 17267 (props, forwardedRef) => { 17268 const { __scopeSelect, nonce, ...viewportProps } = props; 17269 const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect); 17270 const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect); 17271 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, contentContext.onViewportChange); 17272 const prevScrollTopRef = react.useRef(0); 17273 return /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ 17274 /* @__PURE__ */ (0,jsx_runtime.jsx)( 17275 "style", 17276 { 17277 dangerouslySetInnerHTML: { 17278 __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}` 17279 }, 17280 nonce 17281 } 17282 ), 17283 /* @__PURE__ */ (0,jsx_runtime.jsx)(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 17284 react_primitive_dist/* Primitive */.WV.div, 17285 { 17286 "data-radix-select-viewport": "", 17287 role: "presentation", 17288 ...viewportProps, 17289 ref: composedRefs, 17290 style: { 17291 // we use position: 'relative' here on the `viewport` so that when we call 17292 // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport 17293 // (independent of the scrollUpButton). 17294 position: "relative", 17295 flex: 1, 17296 // Viewport should only be scrollable in the vertical direction. 17297 // This won't work in vertical writing modes, so we'll need to 17298 // revisit this if/when that is supported 17299 // https://developer.chrome.com/blog/vertical-form-controls 17300 overflow: "hidden auto", 17301 ...viewportProps.style 17302 }, 17303 onScroll: (0,dist/* composeEventHandlers */.M)(viewportProps.onScroll, (event) => { 17304 const viewport = event.currentTarget; 17305 const { contentWrapper, shouldExpandOnScrollRef } = viewportContext; 17306 if (shouldExpandOnScrollRef?.current && contentWrapper) { 17307 const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop); 17308 if (scrolledBy > 0) { 17309 const availableHeight = window.innerHeight - CONTENT_MARGIN * 2; 17310 const cssMinHeight = parseFloat(contentWrapper.style.minHeight); 17311 const cssHeight = parseFloat(contentWrapper.style.height); 17312 const prevHeight = Math.max(cssMinHeight, cssHeight); 17313 if (prevHeight < availableHeight) { 17314 const nextHeight = prevHeight + scrolledBy; 17315 const clampedNextHeight = Math.min(availableHeight, nextHeight); 17316 const heightDiff = nextHeight - clampedNextHeight; 17317 contentWrapper.style.height = clampedNextHeight + "px"; 17318 if (contentWrapper.style.bottom === "0px") { 17319 viewport.scrollTop = heightDiff > 0 ? heightDiff : 0; 17320 contentWrapper.style.justifyContent = "flex-end"; 17321 } 17322 } 17323 } 17324 } 17325 prevScrollTopRef.current = viewport.scrollTop; 17326 }) 17327 } 17328 ) }) 17329 ] }); 17330 } 17331); 17332SelectViewport.displayName = VIEWPORT_NAME; 17333var GROUP_NAME = "SelectGroup"; 17334var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME); 17335var SelectGroup = react.forwardRef( 17336 (props, forwardedRef) => { 17337 const { __scopeSelect, ...groupProps } = props; 17338 const groupId = (0,react_id_dist/* useId */.M)(); 17339 return /* @__PURE__ */ (0,jsx_runtime.jsx)(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) }); 17340 } 17341); 17342SelectGroup.displayName = GROUP_NAME; 17343var LABEL_NAME = "SelectLabel"; 17344var SelectLabel = react.forwardRef( 17345 (props, forwardedRef) => { 17346 const { __scopeSelect, ...labelProps } = props; 17347 const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect); 17348 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.div, { id: groupContext.id, ...labelProps, ref: forwardedRef }); 17349 } 17350); 17351SelectLabel.displayName = LABEL_NAME; 17352var ITEM_NAME = "SelectItem"; 17353var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME); 17354var SelectItem = react.forwardRef( 17355 (props, forwardedRef) => { 17356 const { 17357 __scopeSelect, 17358 value, 17359 disabled = false, 17360 textValue: textValueProp, 17361 ...itemProps 17362 } = props; 17363 const context = useSelectContext(ITEM_NAME, __scopeSelect); 17364 const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect); 17365 const isSelected = context.value === value; 17366 const [textValue, setTextValue] = react.useState(textValueProp ?? ""); 17367 const [isFocused, setIsFocused] = react.useState(false); 17368 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)( 17369 forwardedRef, 17370 (node) =>
17370 contentContext.itemRefCallback?.(node, value, disabled) 17371 ); 17372 const textId = (0,react_id_dist/* useId */.M)(); 17373 const pointerTypeRef = react.useRef("touch"); 17374 const handleSelect = () => { 17375 if (!disabled) { 17376 context.onValueChange(value); 17377 context.onOpenChange(false); 17378 } 17379 }; 17380 if (value === "") { 17381 throw new Error( 17382 "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder." 17383 ); 17384 } 17385 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 17386 SelectItemContextProvider, 17387 { 17388 scope: __scopeSelect, 17389 value, 17390 disabled, 17391 textId, 17392 isSelected, 17393 onItemTextChange: react.useCallback((node) => { 17394 setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim()); 17395 }, []), 17396 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 17397 Collection.ItemSlot, 17398 { 17399 scope: __scopeSelect, 17400 value, 17401 disabled, 17402 textValue, 17403 children: /* @__PURE__ */ (0,jsx_runtime.jsx)( 17404 react_primitive_dist/* Primitive */.WV.div, 17405 { 17406 role: "option", 17407 "aria-labelledby": textId, 17408 "data-highlighted": isFocused ? "" : void 0, 17409 "aria-selected": isSelected && isFocused, 17410 "data-state": isSelected ? "checked" : "unchecked", 17411 "aria-disabled": disabled || void 0, 17412 "data-disabled": disabled ? "" : void 0, 17413 tabIndex: disabled ? void 0 : -1, 17414 ...itemProps, 17415 ref: composedRefs, 17416 onFocus: (0,dist/* composeEventHandlers */.M)(itemProps.onFocus, () => setIsFocused(true)), 17417 onBlur: (0,dist/* composeEventHandlers */.M)(itemProps.onBlur, () => setIsFocused(false)), 17418 onClick: (0,dist/* composeEventHandlers */.M)(itemProps.onClick, () => { 17419 if (pointerTypeRef.current !== "mouse") handleSelect(); 17420 }), 17421 onPointerUp: (0,dist/* composeEventHandlers */.M)(itemProps.onPointerUp, () => { 17422 if (pointerTypeRef.current === "mouse") handleSelect(); 17423 }), 17424 onPointerDown: (0,dist/* composeEventHandlers */.M)(itemProps.onPointerDown, (event) => { 17425 pointerTypeRef.current = event.pointerType; 17426 }), 17427 onPointerMove: (0,dist/* composeEventHandlers */.M)(itemProps.onPointerMove, (event) => { 17428 pointerTypeRef.current = event.pointerType; 17429 if (disabled) { 17430 contentContext.onItemLeave?.(); 17431 } else if (pointerTypeRef.current === "mouse") { 17432 event.currentTarget.focus({ preventScroll: true }); 17433 } 17434 }), 17435 onPointerLeave: (0,dist/* composeEventHandlers */.M)(itemProps.onPointerLeave, (event) => { 17436 if (event.currentTarget === document.activeElement) { 17437 contentContext.onItemLeave?.(); 17438 } 17439 }), 17440 onKeyDown: (0,dist/* composeEventHandlers */.M)(itemProps.onKeyDown, (event) => { 17441 const isTypingAhead = contentContext.searchRef?.current !== ""; 17442 if (isTypingAhead && event.key === " ") return; 17443 if (SELECTION_KEYS.includes(event.key)) handleSelect(); 17444 if (event.key === " ") event.preventDefault(); 17445 }) 17446 } 17447 ) 17448 } 17449 ) 17450 } 17451 ); 17452 } 17453); 17454SelectItem.displayName = ITEM_NAME; 17455var ITEM_TEXT_NAME = "SelectItemText"; 17456var SelectItemText = react.forwardRef( 17457 (props, forwardedRef) => { 17458 const { __scopeSelect, className, style, ...itemTextProps } = props; 17459 const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect); 17460 const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
17461 const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect); 17462 const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect); 17463 const [itemTextNode, setItemTextNode] = react.useState(null); 17464 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)( 17465 forwardedRef, 17466 (node) => setItemTextNode(node), 17467 itemContext.onItemTextChange, 17468 (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled) 17469 ); 17470 const textContent = itemTextNode?.textContent; 17471 const nativeOption = react.useMemo( 17472 () => /* @__PURE__ */ (0,jsx_runtime.jsx)("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value), 17473 [itemContext.disabled, itemContext.value, textContent] 17474 ); 17475 const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext; 17476 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => { 17477 onNativeOptionAdd(nativeOption); 17478 return () => onNativeOptionRemove(nativeOption); 17479 }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]); 17480 return /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [
17481 /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }), 17482 itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? react_dom.createPortal(itemTextProps.children, context.valueNode) : null 17483 ] }); 17484 } 17485); 17486SelectItemText.displayName = ITEM_TEXT_NAME; 17487var ITEM_INDICATOR_NAME = "SelectItemIndicator"; 17488var SelectItemIndicator = react.forwardRef( 17489 (props, forwardedRef) => { 17490 const { __scopeSelect, ...itemIndicatorProps } = props; 17491 const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect); 17492 return itemContext.isSelected ? /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null; 17493 } 17494); 17495SelectItemIndicator.displayName = ITEM_INDICATOR_NAME; 17496var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton"; 17497var SelectScrollUpButton = react.forwardRef((props, forwardedRef) => { 17498 const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect); 17499 const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect); 17500 const [canScrollUp, setCanScrollUp] = react.useState(false); 17501 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, viewportContext.onScrollButtonChange); 17502 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => { 17503 if (contentContext.viewport && contentContext.isPositioned) { 17504 let handleScroll2 = function() { 17505 const canScrollUp2 = viewport.scrollTop > 0; 17506 setCanScrollUp(canScrollUp2); 17507 }; 17508 var handleScroll = handleScroll2; 17509 const viewport = contentContext.viewport; 17510 handleScroll2(); 17511 viewport.addEventListener("scroll", handleScroll2); 17512 return () => viewport.removeEventListener("scroll", handleScroll2); 17513 } 17514 }, [contentContext.viewport, contentContext.isPositioned]); 17515 return canScrollUp ? /* @__PURE__ */ (0,jsx_runtime.jsx)( 17516 SelectScrollButtonImpl, 17517 { 17518 ...props, 17519 ref: composedRefs, 17520 onAutoScroll: () => { 17521 const { viewport, selectedItem } = contentContext; 17522 if (viewport && selectedItem) { 17523 viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight; 17524 } 17525 } 17526 } 17527 ) : null; 17528}); 17529SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME; 17530var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton"; 17531var SelectScrollDownButton = react.forwardRef((props, forwardedRef) => { 17532 const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect); 17533 const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect); 17534 const [canScrollDown, setCanScrollDown] = react.useState(false); 17535 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, viewportContext.onScrollButtonChange); 17536 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => { 17537 if (contentContext.viewport && contentContext.isPositioned) { 17538 let handleScroll2 = function() { 17539 const maxScroll = viewport.scrollHeight - viewport.clientHeight; 17540 const canScrollDown2 = Math.ceil(viewport.scrollTop) < maxScroll; 17541 setCanScrollDown(canScrollDown2); 17542 }; 17543 var handleScroll = handleScroll2; 17544 const viewport = contentContext.viewport; 17545 handleScroll2(); 17546 viewport.addEventListener("scroll", handleScroll2); 17547 return () => viewport.removeEventListener("scroll", handleScroll2); 17548 } 17549 }, [contentContext.viewport, contentContext.isPositioned]); 17550 return canScrollDown ? /* @__PURE__ */ (0,jsx_runtime.jsx)( 17551 SelectScrollButtonImpl, 17552 { 17553 ...props, 17554 ref: composedRefs, 17555 onAutoScroll: () => { 17556 const { viewport, selectedItem } = contentContext; 17557 if (viewport && selectedItem) { 17558 viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight; 17559 } 17560 } 17561 } 17562 ) : null; 17563}); 17564SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME; 17565var SelectScrollButtonImpl = react.forwardRef((props, forwardedRef) => { 17566 const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props; 17567 const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect); 17568 const autoScrollTimerRef = react.useRef(null); 17569 const getItems = useCollection(__scopeSelect); 17570 const clearAutoScrollTimer = react.useCallback(() => { 17571 if (autoScrollTimerRef.current !== null) { 17572 window.clearInterval(autoScrollTimerRef.current); 17573 autoScrollTimerRef.current = null; 17574 } 17575 }, []); 17576 react.useEffect(() => { 17577 return () => clearAutoScrollTimer(); 17578 }, [clearAutoScrollTimer]); 17579 (0,react_use_layout_effect_dist/* useLayoutEffect */.b)(() => { 17580 const activeItem = getItems().find((item) => item.ref.current === document.activeElement); 17581 activeItem?.ref.current?.scrollIntoView({ block: "nearest" }); 17582 }, [getItems]); 17583 return /* @__PURE__ */ (0,jsx_runtime.jsx)( 17584 react_primitive_dist/* Primitive */.WV.div, 17585 { 17586 "aria-hidden": true, 17587 ...scrollIndicatorProps, 17588 ref: forwardedRef, 17589 style: { flexShrink: 0, ...scrollIndicatorProps.style }, 17590 onPointerDown: (0,dist/* composeEventHandlers */.M)(scrollIndicatorProps.onPointerDown, () => { 17591 if (autoScrollTimerRef.current === null) { 17592 autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50); 17593 } 17594 }), 17595 onPointerMove: (0,dist/* composeEventHandlers */.M)(scrollIndicatorProps.onPointerMove, () => { 17596 contentContext.onItemLeave?.(); 17597 if (autoScrollTimerRef.current === null) { 17598 autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50); 17599 } 17600 }), 17601 onPointerLeave: (0,dist/* composeEventHandlers */.M)(scrollIndicatorProps.onPointerLeave, () => { 17602 clearAutoScrollTimer(); 17603 }) 17604 } 17605 ); 17606});
vendor: 9,234 bytes, lines 17607-17818
17607var SEPARATOR_NAME = "SelectSeparator"; 17608var SelectSeparator = react.forwardRef( 17609 (props, forwardedRef) => { 17610 const { __scopeSelect, ...separatorProps } = props; 17611 return /* @__PURE__ */ (0,jsx_runtime.jsx)(react_primitive_dist/* Primitive */.WV.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef }); 17612 } 17613); 17614SelectSeparator.displayName = SEPARATOR_NAME; 17615var ARROW_NAME = "SelectArrow"; 17616var SelectArrow = react.forwardRef( 17617 (props, forwardedRef) => { 17618 const { __scopeSelect, ...arrowProps } = props; 17619 const popperScope = usePopperScope(__scopeSelect); 17620 const context = useSelectContext(ARROW_NAME, __scopeSelect); 17621 const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect); 17622 return context.open && contentContext.position === "popper" ? /* @__PURE__ */ (0,jsx_runtime.jsx)(react_popper_dist/* Arrow */.Eh, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null; 17623 } 17624); 17625SelectArrow.displayName = ARROW_NAME; 17626function shouldShowPlaceholder(value) { 17627 return value === "" || value === void 0; 17628} 17629var BubbleSelect = react.forwardRef( 17630 (props, forwardedRef) => { 17631 const { value, ...selectProps } = props; 17632 const ref = react.useRef(null); 17633 const composedRefs = (0,react_compose_refs_dist/* useComposedRefs */.e)(forwardedRef, ref); 17634 const prevValue = (0,react_use_previous_dist/* usePrevious */.D)(value); 17635 react.useEffect(() => { 17636 const select = ref.current; 17637 const selectProto = window.HTMLSelectElement.prototype; 17638 const descriptor = Object.getOwnPropertyDescriptor( 17639 selectProto, 17640 "value" 17641 ); 17642 const setValue = descriptor.set; 17643 if (prevValue !== value && setValue) { 17644 const event = new Event("change", { bubbles: true }); 17645 setValue.call(select, value); 17646 select.dispatchEvent(event); 17647 } 17648 }, [prevValue, value]); 17649 return /* @__PURE__ */ (0,jsx_runtime.jsx)(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ (0,jsx_runtime.jsx)("select", { ...selectProps, ref: composedRefs, defaultValue: value }) }); 17650 } 17651); 17652BubbleSelect.displayName = "BubbleSelect"; 17653function useTypeaheadSearch(onSearchChange) { 17654 const handleSearchChange = (0,react_use_callback_ref_dist/* useCallbackRef */.W)(onSearchChange); 17655 const searchRef = react.useRef(""); 17656 const timerRef = react.useRef(0); 17657 const handleTypeaheadSearch = react.useCallback( 17658 (key) => { 17659 const search = searchRef.current + key; 17660 handleSearchChange(search); 17661 (function updateSearch(value) { 17662 searchRef.current = value; 17663 window.clearTimeout(timerRef.current); 17664 if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3); 17665 })(search); 17666 }, 17667 [handleSearchChange] 17668 ); 17669 const resetTypeahead = react.useCallback(() => { 17670 searchRef.current = ""; 17671 window.clearTimeout(timerRef.current); 17672 }, []); 17673 react.useEffect(() => { 17674 return () => window.clearTimeout(timerRef.current); 17675 }, []); 17676 return [searchRef, handleTypeaheadSearch, resetTypeahead]; 17677} 17678function findNextItem(items, search, currentItem) { 17679 const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]); 17680 const normalizedSearch = isRepeated ? search[0] : search; 17681 const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1; 17682 let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0)); 17683 const excludeCurrentItem = normalizedSearch.length === 1; 17684 if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem); 17685 const nextItem = wrappedItems.find( 17686 (item) => item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase()) 17687 ); 17688 return nextItem !== currentItem ? nextItem : void 0; 17689} 17690function wrapArray(array, startIndex) { 17691 return array.map((_, index) => array[(startIndex + index) % array.length]); 17692} 17693var Root2 = Select; 17694var Trigger = SelectTrigger; 17695var Value = SelectValue; 17696var Icon = SelectIcon; 17697var Portal = SelectPortal; 17698var Content2 = SelectContent; 17699var Viewport = SelectViewport; 17700var Group = SelectGroup; 17701var Label = SelectLabel; 17702var Item = SelectItem; 17703var ItemText = SelectItemText; 17704var ItemIndicator = SelectItemIndicator; 17705var ScrollUpButton = SelectScrollUpButton; 17706var ScrollDownButton = SelectScrollDownButton; 17707var Separator = SelectSeparator; 17708var Arrow2 = (/* unused pure expression or super */ null && (SelectArrow)); 17709 17710//# sourceMappingURL=index.mjs.map 17711 17712 17713/***/ }), 17714 17715/***/ 8426: 17716/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 17717 17718"use strict"; 17719/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17720/* harmony export */ g7: function() { return /* binding */ Slot; } 17721/* harmony export */ }); 17722/* unused harmony exports Root, Slottable */ 17723/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 17724/* harmony import */ var _radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8771); 17725/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893); 17726// packages/react/slot/src/slot.tsx 17727 17728 17729 17730var Slot = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => { 17731 const { children, ...slotProps } = props; 17732 const childrenArray = react__WEBPACK_IMPORTED_MODULE_0__.Children.toArray(children); 17733 const slottable = childrenArray.find(isSlottable); 17734 if (slottable) { 17735 const newElement = slottable.props.children; 17736 const newChildren = childrenArray.map((child) => { 17737 if (child === slottable) { 17738 if (react__WEBPACK_IMPORTED_MODULE_0__.Children.count(newElement) > 1) return react__WEBPACK_IMPORTED_MODULE_0__.Children.only(null); 17739 return react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(newElement) ? newElement.props.children : null; 17740 } else { 17741 return child; 17742 } 17743 }); 17744 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(newElement) ? react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(newElement, void 0, newChildren) : null }); 17745 } 17746 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children }); 17747}); 17748Slot.displayName = "Slot"; 17749var SlotClone = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => { 17750 const { children, ...slotProps } = props; 17751 if (react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(children)) { 17752 const childrenRef = getElementRef(children); 17753 const props2 = mergeProps(slotProps, children.props); 17754 if (children.type !== react__WEBPACK_IMPORTED_MODULE_0__.Fragment) { 17755 props2.ref = forwardedRef ? (0,_radix_ui_react_compose_refs__WEBPACK_IMPORTED_MODULE_2__/* .composeRefs */ .F)(forwardedRef, childrenRef) : childrenRef; 17756 } 17757 return react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(children, props2); 17758 } 17759 return react__WEBPACK_IMPORTED_MODULE_0__.Children.count(children) > 1 ? react__WEBPACK_IMPORTED_MODULE_0__.Children.only(null) : null; 17760}); 17761SlotClone.displayName = "SlotClone"; 17762var Slottable = ({ children }) => { 17763 return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children }); 17764}; 17765function isSlottable(child) { 17766 return react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(child) && child.type === Slottable; 17767} 17768function mergeProps(slotProps, childProps) { 17769 const overrideProps = { ...childProps }; 17770 for (const propName in childProps) { 17771 const slotPropValue = slotProps[propName]; 17772 const childPropValue = childProps[propName]; 17773 const isHandler = /^on[A-Z]/.test(propName); 17774 if (isHandler) { 17775 if (slotPropValue && childPropValue) { 17776 overrideProps[propName] = (...args) => { 17777 childPropValue(...args); 17778 slotPropValue(...args); 17779 }; 17780 } else if (slotPropValue) { 17781 overrideProps[propName] = slotPropValue; 17782 } 17783 } else if (propName === "style") { 17784 overrideProps[propName] = { ...slotPropValue, ...childPropValue }; 17785 } else if (propName === "className") { 17786 overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); 17787 } 17788 } 17789 return { ...slotProps, ...overrideProps }; 17790} 17791function getElementRef(element) { 17792 let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; 17793 let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 17794 if (mayWarn) { 17795 return element.ref; 17796 } 17797 getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; 17798 mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 17799 if (mayWarn) { 17800 return element.props.ref; 17801 } 17802 return element.props.ref || element.ref; 17803} 17804var Root = (/* unused pure expression or super */ null && (Slot)); 17805 17806//# sourceMappingURL=index.mjs.map 17807 17808 17809/***/ }), 17810 17811/***/ 9698: 17812/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 17813 17814"use strict"; 17815/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17816/* harmony export */ W: function() { return /* binding */ useCallbackRef; } 17817/* harmony export */ }); 17818/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294);
17819// packages/react/use-callback-ref/src/useCallbackRef.tsx 17820 17821function useCallbackRef(callback) { 17822 const callbackRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(callback); 17823 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 17824 callbackRef.current = callback; 17825 }); 17826 return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => (...args) => callbackRef.current?.(...args), []); 17827} 17828 17829//# sourceMappingURL=index.mjs.map 17830 17831 17832/***/ }), 17833 17834/***/ 7342: 17835/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 17836 17837"use strict"; 17838/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17839/* harmony export */ T: function() { return /* binding */ useControllableState; } 17840/* harmony export */ }); 17841/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 17842/* harmony import */ var _radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9698);
vendor: 1,978 bytes, lines 17843-17899
17843// packages/react/use-controllable-state/src/useControllableState.tsx 17844 17845 17846function useControllableState({ 17847 prop, 17848 defaultProp, 17849 onChange = () => { 17850 } 17851}) { 17852 const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange }); 17853 const isControlled = prop !== void 0; 17854 const value = isControlled ? prop : uncontrolledProp; 17855 const handleChange = (0,_radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_1__/* .useCallbackRef */ .W)(onChange); 17856 const setValue = react__WEBPACK_IMPORTED_MODULE_0__.useCallback( 17857 (nextValue) => { 17858 if (isControlled) { 17859 const setter = nextValue; 17860 const value2 = typeof nextValue === "function" ? setter(prop) : nextValue; 17861 if (value2 !== prop) handleChange(value2); 17862 } else { 17863 setUncontrolledProp(nextValue); 17864 } 17865 }, 17866 [isControlled, prop, setUncontrolledProp, handleChange] 17867 ); 17868 return [value, setValue]; 17869} 17870function useUncontrolledState({ 17871 defaultProp, 17872 onChange 17873}) { 17874 const uncontrolledState = react__WEBPACK_IMPORTED_MODULE_0__.useState(defaultProp); 17875 const [value] = uncontrolledState; 17876 const prevValueRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(value); 17877 const handleChange = (0,_radix_ui_react_use_callback_ref__WEBPACK_IMPORTED_MODULE_1__/* .useCallbackRef */ .W)(onChange); 17878 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => { 17879 if (prevValueRef.current !== value) { 17880 handleChange(value); 17881 prevValueRef.current = value; 17882 } 17883 }, [value, prevValueRef, handleChange]); 17884 return uncontrolledState; 17885} 17886 17887//# sourceMappingURL=index.mjs.map 17888 17889 17890/***/ }), 17891 17892/***/ 9981: 17893/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 17894 17895"use strict"; 17896/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17897/* harmony export */ b: function() { return /* binding */ useLayoutEffect2; } 17898/* harmony export */ }); 17899/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294);
17900// packages/react/use-layout-effect/src/useLayoutEffect.tsx 17901 17902var useLayoutEffect2 = Boolean(globalThis?.document) ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : () => { 17903}; 17904 17905//# sourceMappingURL=index.mjs.map 17906 17907 17908/***/ }), 17909 17910/***/ 7898: 17911/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 17912 17913"use strict"; 17914/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17915/* harmony export */ D: function() { return /* binding */ usePrevious; } 17916/* harmony export */ }); 17917/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294);
17918// packages/react/use-previous/src/usePrevious.tsx 17919 17920function usePrevious(value) { 17921 const ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef({ value, previous: value }); 17922 return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => { 17923 if (ref.current.value !== value) { 17924 ref.current.previous = ref.current.value; 17925 ref.current.value = value; 17926 } 17927 return ref.current.previous; 17928 }, [value]); 17929} 17930 17931//# sourceMappingURL=index.mjs.map 17932 17933 17934/***/ }), 17935 17936/***/ 7546: 17937/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 17938 17939"use strict"; 17940/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17941/* harmony export */ t: function() { return /* binding */ useSize; } 17942/* harmony export */ }); 17943/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 17944/* harmony import */ var _radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9981);
vendor: 6,259 bytes, lines 17945-18086
17945// packages/react/use-size/src/useSize.tsx 17946 17947 17948function useSize(element) { 17949 const [size, setSize] = react__WEBPACK_IMPORTED_MODULE_0__.useState(void 0); 17950 (0,_radix_ui_react_use_layout_effect__WEBPACK_IMPORTED_MODULE_1__/* .useLayoutEffect */ .b)(() => { 17951 if (element) { 17952 setSize({ width: element.offsetWidth, height: element.offsetHeight }); 17953 const resizeObserver = new ResizeObserver((entries) => { 17954 if (!Array.isArray(entries)) { 17955 return; 17956 } 17957 if (!entries.length) { 17958 return; 17959 } 17960 const entry = entries[0]; 17961 let width; 17962 let height; 17963 if ("borderBoxSize" in entry) { 17964 const borderSizeEntry = entry["borderBoxSize"]; 17965 const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry; 17966 width = borderSize["inlineSize"]; 17967 height = borderSize["blockSize"]; 17968 } else { 17969 width = element.offsetWidth; 17970 height = element.offsetHeight; 17971 } 17972 setSize({ width, height }); 17973 }); 17974 resizeObserver.observe(element, { box: "border-box" }); 17975 return () => resizeObserver.unobserve(element); 17976 } else { 17977 setSize(void 0); 17978 } 17979 }, [element]); 17980 return size; 17981} 17982 17983//# sourceMappingURL=index.mjs.map 17984 17985 17986/***/ }), 17987 17988/***/ 2003: 17989/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 17990 17991"use strict"; 17992/* harmony export */ __webpack_require__.d(__webpack_exports__, { 17993/* harmony export */ j: function() { return /* binding */ cva; } 17994/* harmony export */ }); 17995/* unused harmony export cx */ 17996/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(512); 17997/** 17998 * Copyright 2022 Joe Bell. All rights reserved. 17999 * 18000 * This file is licensed to you under the Apache License, Version 2.0 18001 * (the "License"); you may not use this file except in compliance with the 18002 * License. You may obtain a copy of the License at 18003 * 18004 * http://www.apache.org/licenses/LICENSE-2.0 18005 * 18006 * Unless required by applicable law or agreed to in writing, software 18007 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 18008 * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the 18009 * License for the specific language governing permissions and limitations under 18010 * the License. 18011 */ 18012const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value; 18013const cx = clsx__WEBPACK_IMPORTED_MODULE_0__/* .clsx */ .W; 18014const cva = (base, config)=>(props)=>{ 18015 var _config_compoundVariants; 18016 if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className); 18017 const { variants, defaultVariants } = config; 18018 const getVariantClassNames = Object.keys(variants).map((variant)=>{ 18019 const variantProp = props === null || props === void 0 ? void 0 : props[variant]; 18020 const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant]; 18021 if (variantProp === null) return null; 18022 const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp); 18023 return variants[variant][variantKey]; 18024 }); 18025 const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{ 18026 let [key, value] = param; 18027 if (value === undefined) { 18028 return acc; 18029 } 18030 acc[key] = value; 18031 return acc; 18032 }, {}); 18033 const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{ 18034 let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param; 18035 return Object.entries(compoundVariantOptions).every((param)=>{ 18036 let [key, value] = param; 18037 return Array.isArray(value) ? value.includes({ 18038 ...defaultVariants, 18039 ...propsWithoutUndefined 18040 }[key]) : ({ 18041 ...defaultVariants, 18042 ...propsWithoutUndefined 18043 })[key] === value; 18044 }) ? [ 18045 ...acc, 18046 cvClass, 18047 cvClassName 18048 ] : acc; 18049 }, []); 18050 return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className); 18051 }; 18052 18053 18054 18055/***/ }), 18056 18057/***/ 512: 18058/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 18059 18060"use strict"; 18061/* harmony export */ __webpack_require__.d(__webpack_exports__, { 18062/* harmony export */ W: function() { return /* binding */ clsx; } 18063/* harmony export */ }); 18064function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ __webpack_exports__.Z = (clsx); 18065 18066/***/ }), 18067 18068/***/ 3114: 18069/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 18070 18071"use strict"; 18072 18073// EXPORTS 18074__webpack_require__.d(__webpack_exports__, { 18075 M: function() { return /* binding */ AnimatePresence; } 18076}); 18077 18078// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 18079var jsx_runtime = __webpack_require__(5893); 18080// EXTERNAL MODULE: ./node_modules/react/index.js 18081var react = __webpack_require__(7294); 18082// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs 18083var LayoutGroupContext = __webpack_require__(5364); 18084// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/utils/use-constant.mjs 18085var use_constant = __webpack_require__(6681); 18086// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs
18087var use_isomorphic_effect = __webpack_require__(8868); 18088// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/context/PresenceContext.mjs 18089var PresenceContext = __webpack_require__(240); 18090// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs 18091var MotionConfigContext = __webpack_require__(6014); 18092;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs 18093"use client"; 18094 18095 18096 18097 18098 18099/** 18100 * Measurement functionality has to be within a separate component 18101 * to leverage snapshot lifecycle. 18102 */ 18103class PopChildMeasure extends react.Component { 18104 getSnapshotBeforeUpdate(prevProps) { 18105 const element = this.props.childRef.current; 18106 if (element && prevProps.isPresent && !this.props.isPresent) { 18107 const parent = element.offsetParent; 18108 const parentWidth = parent instanceof HTMLElement ? parent.offsetWidth || 0 : 0; 18109 const size = this.props.sizeRef.current; 18110 size.height = element.offsetHeight || 0; 18111 size.width = element.offsetWidth || 0; 18112 size.top = element.offsetTop; 18113 size.left = element.offsetLeft; 18114 size.right = parentWidth - size.width - size.left; 18115 } 18116 return null; 18117 } 18118 /** 18119 * Required with getSnapshotBeforeUpdate to stop React complaining. 18120 */ 18121 componentDidUpdate() { } 18122 render() { 18123 return this.props.children; 18124 } 18125} 18126function PopChild({ children, isPresent, anchorX }) { 18127 const id = (0,react.useId)(); 18128 const ref = (0,react.useRef)(null); 18129 const size = (0,react.useRef)({ 18130 width: 0, 18131 height: 0, 18132 top: 0, 18133 left: 0, 18134 right: 0, 18135 }); 18136 const { nonce } = (0,react.useContext)(MotionConfigContext/* MotionConfigContext */._); 18137 /** 18138 * We create and inject a style block so we can apply this explicit 18139 * sizing in a non-destructive manner by just deleting the style block. 18140 * 18141 * We can't apply size via render as the measurement happens 18142 * in getSnapshotBeforeUpdate (post-render), likewise if we apply the 18143 * styles directly on the DOM node, we might be overwriting 18144 * styles set via the style prop. 18145 */ 18146 (0,react.useInsertionEffect)(() => { 18147 const { width, height, top, left, right } = size.current; 18148 if (isPresent || !ref.current || !width || !height) 18149 return; 18150 const x = anchorX === "left" ? `left: ${left}` : `right: ${right}`; 18151 ref.current.dataset.motionPopId = id; 18152 const style = document.createElement("style"); 18153 if (nonce) 18154 style.nonce = nonce; 18155 document.head.appendChild(style); 18156 if (style.sheet) { 18157 style.sheet.insertRule(` 18158 [data-motion-pop-id="${id}"] { 18159 position: absolute !important; 18160 width: ${width}px !important; 18161 height: ${height}px !important; 18162 ${x}px !important; 18163 top: ${top}px !important; 18164 } 18165 `); 18166 } 18167 return () => { 18168 document.head.removeChild(style); 18169 }; 18170 }, [isPresent]); 18171 return ((0,jsx_runtime.jsx)(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: react.cloneElement(children, { ref }) })); 18172} 18173 18174 18175 18176;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs 18177"use client"; 18178 18179 18180 18181 18182 18183 18184 18185const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, }) => { 18186 const presenceChildren = (0,use_constant/* useConstant */.h)(newChildrenMap); 18187 const id = (0,react.useId)(); 18188 const memoizedOnExitComplete = (0,react.useCallback)((childId) => { 18189 presenceChildren.set(childId, true); 18190 for (const isComplete of presenceChildren.values()) { 18191 if (!isComplete) 18192 return; // can stop searching when any is incomplete 18193 } 18194 onExitComplete && onExitComplete(); 18195 }, [presenceChildren, onExitComplete]); 18196 const context = (0,react.useMemo)(() => ({ 18197 id, 18198 initial, 18199 isPresent, 18200 custom, 18201 onExitComplete: memoizedOnExitComplete, 18202 register: (childId) => { 18203 presenceChildren.set(childId, false); 18204 return () => presenceChildren.delete(childId); 18205 }, 18206 }), 18207 /** 18208 * If the presence of a child affects the layout of the components around it, 18209 * we want to make a new context value to ensure they get re-rendered 18210 * so they can detect that layout change. 18211 */ 18212 presenceAffectsLayout 18213 ? [Math.random(), memoizedOnExitComplete] 18214 : [isPresent, memoizedOnExitComplete]); 18215 (0,react.useMemo)(() => {
18216 presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); 18217 }, [isPresent]); 18218 /** 18219 * If there's no `motion` components to fire exit animations, we want to remove this 18220 * component immediately. 18221 */ 18222 react.useEffect(() => { 18223 !isPresent && 18224 !presenceChildren.size && 18225 onExitComplete && 18226 onExitComplete(); 18227 }, [isPresent]); 18228 if (mode === "popLayout") { 18229 children = ((0,jsx_runtime.jsx)(PopChild, { isPresent: isPresent, anchorX: anchorX, children: children })); 18230 } 18231 return ((0,jsx_runtime.jsx)(PresenceContext/* PresenceContext */.O.Provider, { value: context, children: children })); 18232}; 18233function newChildrenMap() { 18234 return new Map(); 18235} 18236 18237 18238 18239// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs 18240var use_presence = __webpack_require__(6302); 18241;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs 18242 18243 18244const getChildKey = (child) => child.key || ""; 18245function onlyElements(children) { 18246 const filtered = []; 18247 // We use forEach here instead of map as map mutates the component key by preprending `.$` 18248 react.Children.forEach(children, (child) => { 18249 if ((0,react.isValidElement)(child)) 18250 filtered.push(child); 18251 }); 18252 return filtered; 18253} 18254 18255 18256 18257;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs 18258"use client"; 18259 18260 18261 18262 18263 18264 18265 18266 18267 18268/** 18269 * `AnimatePresence` enables the animation of components that have been removed from the tree. 18270 * 18271 * When adding/removing more than a single child, every child **must** be given a unique `key` prop. 18272 * 18273 * Any `motion` components that have an `exit` property defined will animate out when removed from 18274 * the tree. 18275 * 18276 * ```jsx 18277 * import { motion, AnimatePresence } from 'framer-motion' 18278 * 18279 * export const Items = ({ items }) => ( 18280 * <AnimatePresence> 18281 * {items.map(item => ( 18282 * <motion.div 18283 * key={item.id} 18284 * initial={{ opacity: 0 }} 18285 * animate={{ opacity: 1 }} 18286 * exit={{ opacity: 0 }} 18287 * /> 18288 * ))} 18289 * </AnimatePresence> 18290 * ) 18291 * ``` 18292 * 18293 * You can sequence exit animations throughout a tree using variants. 18294 * 18295 * If a child contains multiple `motion` components with `exit` props, it will only unmount the child 18296 * once all `motion` components have finished animating out. Likewise, any components using 18297 * `usePresence` all need to call `safeToRemove`. 18298 * 18299 * @public 18300 */ 18301const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", }) => { 18302 const [isParentPresent, safeToRemove] = (0,use_presence/* usePresence */.oO)(propagate); 18303 /** 18304 * Filter any children that aren't ReactElements. We can only track components 18305 * between renders with a props.key. 18306 */ 18307 const presentChildren = (0,react.useMemo)(() => onlyElements(children), [children]); 18308 /** 18309 * Track the keys of the currently rendered children. This is used to 18310 * determine which children are exiting. 18311 */ 18312 const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); 18313 /** 18314 * If `initial={false}` we only want to pass this to components in the first render. 18315 */ 18316 const isInitialRender = (0,react.useRef)(true); 18317 /** 18318 * A ref containing the currently present children. When all exit animations 18319 * are complete, we use this to re-render the component with the latest children 18320 * *committed* rather than the latest children *rendered*. 18321 */ 18322 const pendingPresentChildren = (0,react.useRef)(presentChildren); 18323 /** 18324 * Track which exiting children have finished animating out. 18325 */ 18326 const exitComplete = (0,use_constant/* useConstant */.h)(() => new Map()); 18327 /** 18328 * Save children to render as React state. To ensure this component is concurrent-safe, 18329 * we check for exiting children via an effect. 18330 */ 18331 const [diffedChildren, setDiffedChildren] = (0,react.useState)(presentChildren); 18332 const [renderedChildren, setRenderedChildren] = (0,react.useState)(presentChildren); 18333 (0,use_isomorphic_effect/* useIsomorphicLayoutEffect */.L)(() => { 18334 isInitialRender.current = false;
18335 pendingPresentChildren.current = presentChildren; 18336 /** 18337 * Update complete status of exiting children. 18338 */ 18339 for (let i = 0; i < renderedChildren.length; i++) { 18340 const key = getChildKey(renderedChildren[i]); 18341 if (!presentKeys.includes(key)) { 18342 if (exitComplete.get(key) !== true) { 18343 exitComplete.set(key, false); 18344 } 18345 } 18346 else { 18347 exitComplete.delete(key); 18348 } 18349 } 18350 }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); 18351 const exitingChildren = []; 18352 if (presentChildren !== diffedChildren) { 18353 let nextChildren = [...presentChildren]; 18354 /** 18355 * Loop through all the currently rendered components and decide which 18356 * are exiting. 18357 */ 18358 for (let i = 0; i < renderedChildren.length; i++) { 18359 const child = renderedChildren[i]; 18360 const key = getChildKey(child); 18361 if (!presentKeys.includes(key)) { 18362 nextChildren.splice(i, 0, child); 18363 exitingChildren.push(child); 18364 } 18365 } 18366 /** 18367 * If we're in "wait" mode, and we have exiting children, we want to 18368 * only render these until they've all exited. 18369 */ 18370 if (mode === "wait" && exitingChildren.length) { 18371 nextChildren = exitingChildren; 18372 } 18373 setRenderedChildren(onlyElements(nextChildren)); 18374 setDiffedChildren(presentChildren); 18375 /** 18376 * Early return to ensure once we've set state with the latest diffed 18377 * children, we can immediately re-render. 18378 */ 18379 return null; 18380 } 18381 if (false) {} 18382 /** 18383 * If we've been provided a forceRender function by the LayoutGroupContext, 18384 * we can use it to force a re-render amongst all surrounding components once 18385 * all components have finished animating out. 18386 */ 18387 const { forceRender } = (0,react.useContext)(LayoutGroupContext/* LayoutGroupContext */.p); 18388 return ((0,jsx_runtime.jsx)(jsx_runtime.Fragment, { children: renderedChildren.map((child) => { 18389 const key = getChildKey(child); 18390 const isPresent = propagate && !isParentPresent 18391 ? false 18392 : presentChildren === renderedChildren || 18393 presentKeys.includes(key); 18394 const onExit = () => { 18395 if (exitComplete.has(key)) { 18396 exitComplete.set(key, true); 18397 } 18398 else { 18399 return; 18400 } 18401 let isEveryExitComplete = true; 18402 exitComplete.forEach((isExitComplete) => { 18403 if (!isExitComplete) 18404 isEveryExitComplete = false; 18405 }); 18406 if (isEveryExitComplete) { 18407 forceRender === null || forceRender === void 0 ? void 0 : forceRender(); 18408 setRenderedChildren(pendingPresentChildren.current); 18409 propagate && (safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove()); 18410 onExitComplete && onExitComplete(); 18411 } 18412 }; 18413 return ((0,jsx_runtime.jsx)(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial 18414 ? undefined 18415 : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, children: child }, key)); 18416 }) })); 18417}; 18418 18419 18420 18421 18422/***/ }), 18423 18424/***/ 6302: 18425/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 18426 18427"use strict"; 18428/* harmony export */ __webpack_require__.d(__webpack_exports__, { 18429/* harmony export */ oO: function() { return /* binding */ usePresence; } 18430/* harmony export */ }); 18431/* unused harmony exports isPresent, useIsPresent */ 18432/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 18433/* harmony import */ var _context_PresenceContext_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(240); 18434 18435 18436 18437/** 18438 * When a component is the child of `AnimatePresence`, it can use `usePresence` 18439 * to access information about whether it's still present in the React tree. 18440 * 18441 * ```jsx 18442 * import { usePresence } from "framer-motion" 18443 * 18444 * export const Component = () => { 18445 * const [isPresent, safeToRemove] = usePresence() 18446 * 18447 * useEffect(() => { 18448 * !isPresent && setTimeout(safeToRemove, 1000) 18449 * }, [isPresent]) 18450 * 18451 * return <div /> 18452 * } 18453 * ``` 18454 * 18455 * If `isPresent` is `false`, it means that a component has been removed the tree, but 18456 * `AnimatePresence` won't really remove it until `safeToRemove` has been called. 18457 * 18458 * @public 18459 */ 18460function usePresence(subscribe = true) { 18461 const context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_context_PresenceContext_mjs__WEBPACK_IMPORTED_MODULE_1__/* .PresenceContext */ .O); 18462 if (context === null) 18463 return [true, null]; 18464 const { isPresent, onExitComplete, register } = context; 18465 // It's safe to call the following hooks conditionally (after an early return) because the context will always 18466 // either be null or non-null for the lifespan of the component. 18467 const id = (0,react__WEBPACK_IMPORTED_MODULE_0__.useId)(); 18468 (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { 18469 if (subscribe) { 18470 return register(id); 18471 } 18472 }, [subscribe]); 18473 const safeToRemove = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); 18474 return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; 18475} 18476/** 18477 * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. 18478 * There is no `safeToRemove` function. 18479 * 18480 * ```jsx 18481 * import { useIsPresent } from "framer-motion" 18482 * 18483 * export const Component = () => { 18484 * const isPresent = useIsPresent() 18485 * 18486 * useEffect(() => { 18487 * !isPresent && console.log("I've been removed!") 18488 * }, [isPresent]) 18489 * 18490 * return <div /> 18491 * } 18492 * ``` 18493 * 18494 * @public 18495 */ 18496function useIsPresent() { 18497 return isPresent(useContext(PresenceContext)); 18498} 18499function isPresent(context) {
18500 return context === null ? true : context.isPresent; 18501} 18502 18503 18504 18505 18506/***/ }), 18507 18508/***/ 5364: 18509/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 18510 18511"use strict"; 18512/* harmony export */ __webpack_require__.d(__webpack_exports__, { 18513/* harmony export */ p: function() { return /* binding */ LayoutGroupContext; } 18514/* harmony export */ }); 18515/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 18516"use client"; 18517 18518 18519const LayoutGroupContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({}); 18520 18521 18522 18523 18524/***/ }), 18525 18526/***/ 6014: 18527/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 18528 18529"use strict"; 18530/* harmony export */ __webpack_require__.d(__webpack_exports__, { 18531/* harmony export */ _: function() { return /* binding */ MotionConfigContext; } 18532/* harmony export */ }); 18533/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 18534"use client"; 18535 18536 18537/** 18538 * @public 18539 */ 18540const MotionConfigContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({ 18541 transformPagePoint: (p) => p, 18542 isStatic: false, 18543 reducedMotion: "never", 18544}); 18545 18546 18547 18548 18549/***/ }), 18550 18551/***/ 240: 18552/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 18553 18554"use strict"; 18555/* harmony export */ __webpack_require__.d(__webpack_exports__, { 18556/* harmony export */ O: function() { return /* binding */ PresenceContext; } 18557/* harmony export */ }); 18558/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 18559"use client"; 18560 18561 18562/** 18563 * @public 18564 */ 18565const PresenceContext = 18566/* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null); 18567 18568 18569 18570 18571/***/ }), 18572 18573/***/ 6764: 18574/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 18575 18576"use strict"; 18577 18578// EXPORTS 18579__webpack_require__.d(__webpack_exports__, { 18580 E: function() { return /* binding */ motion; } 18581}); 18582 18583;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/array.mjs 18584function addUniqueItem(arr, item) { 18585 if (arr.indexOf(item) === -1) 18586 arr.push(item); 18587} 18588function array_removeItem(arr, item) { 18589 const index = arr.indexOf(item); 18590 if (index > -1) 18591 arr.splice(index, 1); 18592} 18593// Adapted from array-move 18594function moveItem([...arr], fromIndex, toIndex) { 18595 const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; 18596 if (startIndex >= 0 && startIndex < arr.length) { 18597 const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; 18598 const [item] = arr.splice(fromIndex, 1); 18599 arr.splice(endIndex, 0, item); 18600 } 18601 return arr; 18602} 18603 18604 18605 18606;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/noop.mjs 18607/*#__NO_SIDE_EFFECTS__*/ 18608const noop_noop = (any) => any; 18609 18610 18611 18612;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/errors.mjs 18613 18614 18615let warning = noop_noop; 18616let invariant = noop_noop; 18617if (false) {} 18618 18619 18620 18621;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/global-config.mjs 18622const MotionGlobalConfig = { 18623 skipAnimations: false, 18624 useManualTiming: false, 18625}; 18626 18627 18628 18629;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/memo.mjs 18630/*#__NO_SIDE_EFFECTS__*/ 18631function memo(callback) { 18632 let result; 18633 return () => { 18634 if (result === undefined) 18635 result = callback(); 18636 return result; 18637 }; 18638} 18639 18640 18641 18642;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/progress.mjs 18643/* 18644 Progress within given range 18645 18646 Given a lower limit and an upper limit, we return the progress 18647 (expressed as a number 0-1) represented by the given value, and 18648 limit that progress to within 0-1. 18649 18650 @param [number]: Lower limit 18651 @param [number]: Upper limit 18652 @param [number]: Value to find progress within given range 18653 @return [number]: Progress of value within range as expressed 0-1 18654*/ 18655/*#__NO_SIDE_EFFECTS__*/ 18656const progress = (from, to, value) => { 18657 const toFromDifference = to - from; 18658 return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; 18659}; 18660 18661 18662 18663;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/subscription-manager.mjs 18664 18665 18666class SubscriptionManager { 18667 constructor() { 18668 this.subscriptions = []; 18669 } 18670 add(handler) { 18671 addUniqueItem(this.subscriptions, handler); 18672 return () => array_removeItem(this.subscriptions, handler); 18673 } 18674 notify(a, b, c) { 18675 const numSubscriptions = this.subscriptions.length; 18676 if (!numSubscriptions) 18677 return; 18678 if (numSubscriptions === 1) { 18679 /** 18680 * If there's only a single handler we can just call it without invoking a loop. 18681 */ 18682 this.subscriptions[0](a, b, c); 18683 } 18684 else { 18685 for (let i = 0; i < numSubscriptions; i++) { 18686 /** 18687 * Check whether the handler exists before firing as it's possible 18688 * the subscriptions were modified during this loop running. 18689 */ 18690 const handler = this.subscriptions[i]; 18691 handler && handler(a, b, c); 18692 } 18693 } 18694 } 18695 getSize() { 18696 return this.subscriptions.length; 18697 } 18698 clear() { 18699 this.subscriptions.length = 0; 18700 } 18701} 18702 18703 18704 18705;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/time-conversion.mjs 18706/** 18707 * Converts seconds to milliseconds 18708 * 18709 * @param seconds - Time in seconds. 18710 * @return milliseconds - Converted time in milliseconds. 18711 */ 18712/*#__NO_SIDE_EFFECTS__*/ 18713const time_conversion_secondsToMilliseconds = (seconds) => seconds * 1000; 18714/*#__NO_SIDE_EFFECTS__*/ 18715const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; 18716 18717 18718 18719;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/velocity-per-second.mjs 18720/* 18721 Convert velocity into velocity per second 18722 18723 @param [number]: Unit per frame 18724 @param [number]: Frame duration in ms 18725*/ 18726function velocityPerSecond(velocity, frameDuration) { 18727 return frameDuration ? velocity * (1000 / frameDuration) : 0; 18728} 18729 18730 18731 18732;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/warn-once.mjs 18733const warned = new Set(); 18734function hasWarned(message) { 18735 return warned.has(message); 18736} 18737function warnOnce(condition, message, element) { 18738 if (condition || warned.has(message)) 18739 return; 18740 console.warn(message); 18741 if (element) 18742 console.warn(element); 18743 warned.add(message); 18744} 18745 18746 18747 18748;// CONCATENATED MODULE: ./node_modules/motion-utils/dist/es/index.mjs 18749 18750 18751 18752 18753 18754 18755 18756 18757 18758 18759 18760;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/components/create-proxy.mjs 18761 18762 18763function createDOMMotionComponentProxy(componentFactory) { 18764 if (typeof Proxy === "undefined") { 18765 return componentFactory; 18766 } 18767 /** 18768 * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. 18769 * Rather than generating them anew every render. 18770 */ 18771 const componentCache = new Map(); 18772 const deprecatedFactoryFunction = (...args) => { 18773 if (false) {} 18774 return componentFactory(...args); 18775 }; 18776 return new Proxy(deprecatedFactoryFunction, { 18777 /** 18778 * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
18779 * The prop name is passed through as `key` and we can use that to generate a `motion` 18780 * DOM component with that name. 18781 */ 18782 get: (_target, key) => { 18783 if (key === "create") 18784 return componentFactory; 18785 /** 18786 * If this element doesn't exist in the component cache, create it and cache. 18787 */ 18788 if (!componentCache.has(key)) { 18789 componentCache.set(key, componentFactory(key)); 18790 } 18791 return componentCache.get(key); 18792 }, 18793 }); 18794} 18795 18796 18797 18798;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs 18799function isAnimationControls(v) { 18800 return (v !== null && 18801 typeof v === "object" && 18802 typeof v.start === "function"); 18803} 18804 18805 18806 18807;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs 18808function getValueState(visualElement) { 18809 const state = [{}, {}]; 18810 visualElement === null || visualElement === void 0 ? void 0 : visualElement.values.forEach((value, key) => { 18811 state[0][key] = value.get(); 18812 state[1][key] = value.getVelocity(); 18813 }); 18814 return state; 18815} 18816function resolveVariantFromProps(props, definition, custom, visualElement) { 18817 /** 18818 * If the variant definition is a function, resolve. 18819 */ 18820 if (typeof definition === "function") { 18821 const [current, velocity] = getValueState(visualElement); 18822 definition = definition(custom !== undefined ? custom : props.custom, current, velocity); 18823 } 18824 /** 18825 * If the variant definition is a variant label, or 18826 * the function returned a variant label, resolve. 18827 */ 18828 if (typeof definition === "string") { 18829 definition = props.variants && props.variants[definition]; 18830 } 18831 /** 18832 * At this point we've resolved both functions and variant labels, 18833 * but the resolved variant label might itself have been a function. 18834 * If so, resolve. This can only have returned a valid target object. 18835 */ 18836 if (typeof definition === "function") { 18837 const [current, velocity] = getValueState(visualElement); 18838 definition = definition(custom !== undefined ? custom : props.custom, current, velocity); 18839 } 18840 return definition; 18841} 18842 18843 18844 18845;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs 18846 18847 18848function resolveVariant(visualElement, definition, custom) { 18849 const props = visualElement.getProps(); 18850 return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); 18851} 18852 18853 18854 18855;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs 18856 18857 18858const supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== undefined); 18859 18860 18861 18862;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/controls/BaseGroup.mjs 18863 18864 18865class BaseGroup_BaseGroupPlaybackControls { 18866 constructor(animations) { 18867 // Bound to accomodate common `return animation.stop` pattern 18868 this.stop = () => this.runAll("stop"); 18869 this.animations = animations.filter(Boolean); 18870 } 18871 get finished() { 18872 // Support for new finished Promise and legacy thennable API 18873 return Promise.all(this.animations.map((animation) => "finished" in animation ? animation.finished : animation)); 18874 } 18875 /** 18876 * TODO: Filter out cancelled or stopped animations before returning 18877 */ 18878 getAll(propName) { 18879 return this.animations[0][propName]; 18880 } 18881 setAll(propName, newValue) { 18882 for (let i = 0; i < this.animations.length; i++) { 18883 this.animations[i][propName] = newValue; 18884 } 18885 } 18886 attachTimeline(timeline, fallback) { 18887 const subscriptions = this.animations.map((animation) => { 18888 if (supportsScrollTimeline() && animation.attachTimeline) { 18889 return animation.attachTimeline(timeline); 18890 } 18891 else if (typeof fallback === "function") { 18892 return fallback(animation); 18893 } 18894 }); 18895 return () => { 18896 subscriptions.forEach((cancel, i) => { 18897 cancel && cancel(); 18898 this.animations[i].stop(); 18899 }); 18900 }; 18901 } 18902 get time() { 18903 return this.getAll("time"); 18904 } 18905 set time(time) { 18906 this.setAll("time", time); 18907 } 18908 get speed() { 18909 return this.getAll("speed"); 18910 } 18911 set speed(speed) { 18912 this.setAll("speed", speed); 18913 } 18914 get startTime() { 18915 return this.getAll("startTime"); 18916 } 18917 get duration() { 18918 let max = 0; 18919 for (let i = 0; i < this.animations.length; i++) { 18920 max = Math.max(max, this.animations[i].duration); 18921 } 18922 return max; 18923 } 18924 runAll(methodName) { 18925 this.animations.forEach((controls) => controls[methodName]()); 18926 } 18927 flatten() { 18928 this.runAll("flatten"); 18929 } 18930 play() { 18931 this.runAll("play"); 18932 } 18933 pause() { 18934 this.runAll("pause"); 18935 } 18936 cancel() { 18937 this.runAll("cancel"); 18938 } 18939 complete() { 18940 this.runAll("complete"); 18941 } 18942} 18943 18944 18945 18946;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/control
18946s/Group.mjs 18947 18948 18949/** 18950 * TODO: This is a temporary class to support the legacy 18951 * thennable API 18952 */ 18953class GroupPlaybackControls extends BaseGroup_BaseGroupPlaybackControls { 18954 then(onResolve, onReject) { 18955 return Promise.all(this.animations).then(onResolve).catch(onReject); 18956 } 18957} 18958 18959 18960 18961;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs 18962function get_value_transition_getValueTransition(transition, key) { 18963 return transition 18964 ? transition[key] || 18965 transition["default"] || 18966 transition 18967 : undefined; 18968} 18969 18970 18971 18972;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs 18973/** 18974 * Implement a practical max duration for keyframe generation 18975 * to prevent infinite loops 18976 */ 18977const maxGeneratorDuration = 20000; 18978function calcGeneratorDuration(generator) { 18979 let duration = 0; 18980 const timeStep = 50; 18981 let state = generator.next(duration); 18982 while (!state.done && duration < maxGeneratorDuration) { 18983 duration += timeStep; 18984 state = generator.next(duration); 18985 } 18986 return duration >= maxGeneratorDuration ? Infinity : duration; 18987} 18988 18989 18990 18991;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs 18992 18993 18994 18995/** 18996 * Create a progress => progress easing function from a generator. 18997 */ 18998function createGeneratorEasing(options, scale = 100, createGenerator) { 18999 const generator = createGenerator({ ...options, keyframes: [0, scale] }); 19000 const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); 19001 return { 19002 type: "keyframes", 19003 ease: (progress) => { 19004 return generator.next(duration * progress).value / scale; 19005 }, 19006 duration: millisecondsToSeconds(duration), 19007 }; 19008} 19009 19010 19011 19012;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs 19013function isGenerator(type) { 19014 return typeof type === "function"; 19015} 19016 19017 19018 19019;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs 19020function attachTimeline(animation, timeline) { 19021 animation.timeline = timeline; 19022 animation.onfinish = null; 19023} 19024 19025 19026 19027;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/waapi/NativeAnimationControls.mjs 19028 19029 19030 19031class NativeAnimationControls_NativeAnimationControls { 19032 constructor(animation) { 19033 this.animation = animation; 19034 } 19035 get duration() { 19036 var _a, _b, _c; 19037 const durationInMs = ((_b = (_a = this.animation) === null || _a === void 0 ? void 0 : _a.effect) === null || _b === void 0 ? void 0 : _b.getComputedTiming().duration) || 19038 ((_c = this.options) === null || _c === void 0 ? void 0 : _c.duration) || 19039 300; 19040 return millisecondsToSeconds(Number(durationInMs)); 19041 } 19042 get time() { 19043 var _a; 19044 if (this.animation) { 19045 return millisecondsToSeconds(((_a = this.animation) === null || _a === void 0 ? void 0 : _a.currentTime) || 0); 19046 } 19047 return 0; 19048 } 19049 set time(newTime) { 19050 if (this.animation) { 19051 this.animation.currentTime = time_conversion_secondsToMilliseconds(newTime); 19052 } 19053 } 19054 get speed() { 19055 return this.animation ? this.animation.playbackRate : 1; 19056 } 19057 set speed(newSpeed) { 19058 if (this.animation) { 19059 this.animation.playbackRate = newSpeed; 19060 } 19061 } 19062 get state() { 19063 return this.animation ? this.animation.playState : "finished"; 19064 } 19065 get startTime() { 19066 return this.animation ? this.animation.startTime : null; 19067 } 19068 get finished() { 19069 return this.animation ? this.animation.finished : Promise.resolve(); 19070 } 19071 play() { 19072 this.animation && this.animation.play(); 19073 } 19074 pause() { 19075 this.animation && this.animation.pause(); 19076 } 19077 stop() { 19078 if (!this.animation || 19079 this.state === "idle" || 19080 this.state === "finished") { 19081 return; 19082 } 19083 if (this.animation.commitStyles) { 19084 this.animation.commitStyles(); 19085 } 19086 this.cancel(); 19087 } 19088 flatten() { 19089 var _a, _b; 19090 if (!this.animation || !((_a = this.options) === null || _a === void 0 ? void 0 : _a.allowFlatten)) 19091 return; 19092 (_b = this.animation.effect) === null || _b === void 0 ? void 0 : _b.updateTiming({ easing: "linear" }); 19093 } 19094 attachTimeline(timeline) { 19095 if (this.animation) 19096 attachTimeline(this.animation, timeline); 19097 return noop_noop; 19098 } 19099 complete() { 19100 this.animation && this.animation.finish(); 19101 } 19102 cancel() { 19103 try { 19104 this.animation && this.animation.cancel(); 19105 } 19106 catch (e) { } 19107 } 19108} 19109 19110 19111 19112;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/utils/is-bezier-definition.mjs 19113const isBezierDefinition = (easing) =>
19113 Array.isArray(easing) && typeof easing[0] === "number"; 19114 19115 19116 19117;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/utils/supports/flags.mjs 19118/** 19119 * Add the ability for test suites to manually set support flags 19120 * to better test more environments. 19121 */ 19122const supportsFlags = { 19123 linearEasing: undefined, 19124}; 19125 19126 19127 19128;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/utils/supports/memo.mjs 19129 19130 19131 19132function memoSupports(callback, supportsFlag) { 19133 const memoized = memo(callback); 19134 return () => { var _a; return (_a = supportsFlags[supportsFlag]) !== null && _a !== void 0 ? _a : memoized(); }; 19135} 19136 19137 19138 19139;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs 19140 19141 19142const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { 19143 try { 19144 document 19145 .createElement("div") 19146 .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); 19147 } 19148 catch (e) { 19149 return false; 19150 } 19151 return true; 19152}, "linearEasing"); 19153 19154 19155 19156;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs 19157 19158 19159const generateLinearEasing = (easing, duration, // as milliseconds 19160resolution = 10 // as milliseconds 19161) => { 19162 let points = ""; 19163 const numPoints = Math.max(Math.round(duration / resolution), 2); 19164 for (let i = 0; i < numPoints; i++) { 19165 points += easing(progress(0, numPoints - 1, i)) + ", "; 19166 } 19167 return `linear(${points.substring(0, points.length - 2)})`; 19168}; 19169 19170 19171 19172;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/waapi/utils/easing.mjs 19173 19174 19175 19176 19177function isWaapiSupportedEasing(easing) { 19178 return Boolean((typeof easing === "function" && supportsLinearEasing()) || 19179 !easing || 19180 (typeof easing === "string" && 19181 (easing in supportedWaapiEasing || supportsLinearEasing())) || 19182 isBezierDefinition(easing) || 19183 (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); 19184} 19185const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; 19186const supportedWaapiEasing = { 19187 linear: "linear", 19188 ease: "ease", 19189 easeIn: "ease-in", 19190 easeOut: "ease-out", 19191 easeInOut: "ease-in-out", 19192 circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), 19193 circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), 19194 backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), 19195 backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), 19196}; 19197function easing_mapEasingToNativeEasing(easing, duration) { 19198 if (!easing) { 19199 return undefined; 19200 } 19201 else if (typeof easing === "function" && supportsLinearEasing()) { 19202 return generateLinearEasing(easing, duration); 19203 } 19204 else if (isBezierDefinition(easing)) { 19205 return cubicBezierAsString(easing); 19206 } 19207 else if (Array.isArray(easing)) { 19208 return easing.map((segmentEasing) => easing_mapEasingToNativeEasing(segmentEasing, duration) || 19209 supportedWaapiEasing.easeOut); 19210 } 19211 else { 19212 return supportedWaapiEasing[easing]; 19213 } 19214} 19215 19216 19217 19218;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/frameloop/order.mjs 19219const stepsOrder = [ 19220 "read", // Read 19221 "resolveKeyframes", // Write/Read/Write/Read 19222 "update", // Compute 19223 "preRender", // Compute 19224 "render", // Write 19225 "postRender", // Compute 19226]; 19227 19228 19229 19230;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/stats/buffer.mjs 19231const buffer_statsBuffer = { 19232 value: null, 19233 addProjectionMetrics: null, 19234}; 19235 19236 19237 19238;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/frameloop/render-step.mjs 19239 19240 19241function createRenderStep(runNextFrame, stepName) { 19242 /** 19243 * We create and reuse two queues, one to queue jobs for the current frame 19244 * and one for the next. We reuse to avoid triggering GC after x frames. 19245 */ 19246 let thisFrame = new Set(); 19247 let nextFrame = new Set(); 19248 /** 19249 * Track whether we're currently processing jobs in this step. This way 19250 * we can decide whether to schedule new jobs for this frame or next. 19251 */ 19252 let isProcessing = false; 19253 let flushNextFrame = false; 19254 /** 19255 * A set of processes which were marked keepAlive when scheduled. 19256 */ 19257 const toKeepAlive = new WeakSet(); 19258 let latestFrameData = { 19259 delta: 0.0, 19260 timestamp: 0.0, 19261 isProcessing: false, 19262 }; 19263 let numCalls = 0; 19264 function triggerCallback(callback) { 19265 if (toKeepAlive.has(callback)) { 19266 step.schedule(callback); 19267 runNextFrame(); 19268 } 19269 numCalls++; 19270 callback(latestFrameData); 19271 } 19272 const step = { 19273 /** 19274 * Schedule a process to run on the next frame. 19275 */ 19276 schedule: (callback, keepAlive = false, immediate = false) => { 19277 const addToCurrentFrame = immediate && isProcessing; 19278 const queue = addToCurrentFrame ? thisFrame : nextFrame; 19279 if (keepAlive) 19280 toKeepAlive.add(callback); 19281 if (!queue.has(callback)) 19282 queue.add(callback); 19283 return callback; 19284 }, 19285 /** 19286 * Cancel the provided callback from running on the next frame. 19287 */ 19288 cancel: (callback) => { 19289 nextFrame.delete(callback); 19290 toKeepAlive.delete(callback); 19291 }, 19292 /** 19293 * Execute all schedule callbacks. 19294 */ 19295 process: (frameData) => { 19296 latestFrameData = frameData; 19297 /** 19298 * If we're already processing we've probably been triggered by a flushSync 19299 * inside an existing process. Instead of executing, mark flushNextFrame 19300 * as true and ensure we flush the following frame at the end of this one. 19301 */ 19302 if (isProcessing) { 19303 flushNextFrame = true; 19304 return; 19305 } 19306 isProcessing = true; 19307 [thisFrame, nextFrame] = [nextFrame, thisFrame]; 19308 // Execute this frame 19309 thisFrame.forEach(triggerCallback); 19310 /** 19311 * If we're recording stats then 19312 */ 19313 if (stepName && buffer_statsBuffer.value) { 19314 buffer_statsBuffer.value.frameloop[stepName].push(numCalls); 19315 } 19316 numCalls = 0; 19317 // Clear the frame so no callbacks remain. This is to avoid 19318 // memory leaks should this render step not run for a
vendor: 4,509 bytes, lines 19318-19474
19318while. 19319 thisFrame.clear(); 19320 isProcessing = false; 19321 if (flushNextFrame) { 19322 flushNextFrame = false; 19323 step.process(frameData); 19324 } 19325 }, 19326 }; 19327 return step; 19328} 19329 19330 19331 19332;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/frameloop/batcher.mjs 19333 19334 19335 19336 19337const maxElapsed = 40; 19338function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { 19339 let runNextFrame = false; 19340 let useDefaultElapsed = true; 19341 const state = { 19342 delta: 0.0, 19343 timestamp: 0.0, 19344 isProcessing: false, 19345 }; 19346 const flagRunNextFrame = () => (runNextFrame = true); 19347 const steps = stepsOrder.reduce((acc, key) => { 19348 acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined); 19349 return acc; 19350 }, {}); 19351 const { read, resolveKeyframes, update, preRender, render, postRender } = steps; 19352 const processBatch = () => { 19353 const timestamp = MotionGlobalConfig.useManualTiming 19354 ? state.timestamp 19355 : performance.now(); 19356 runNextFrame = false; 19357 if (!MotionGlobalConfig.useManualTiming) { 19358 state.delta = useDefaultElapsed 19359 ? 1000 / 60 19360 : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); 19361 } 19362 state.timestamp = timestamp; 19363 state.isProcessing = true; 19364 // Unrolled render loop for better per-frame performance 19365 read.process(state); 19366 resolveKeyframes.process(state); 19367 update.process(state); 19368 preRender.process(state); 19369 render.process(state); 19370 postRender.process(state); 19371 state.isProcessing = false; 19372 if (runNextFrame && allowKeepAlive) { 19373 useDefaultElapsed = false; 19374 scheduleNextBatch(processBatch); 19375 } 19376 }; 19377 const wake = () => { 19378 runNextFrame = true; 19379 useDefaultElapsed = true; 19380 if (!state.isProcessing) { 19381 scheduleNextBatch(processBatch); 19382 } 19383 }; 19384 const schedule = stepsOrder.reduce((acc, key) => { 19385 const step = steps[key]; 19386 acc[key] = (process, keepAlive = false, immediate = false) => { 19387 if (!runNextFrame) 19388 wake(); 19389 return step.schedule(process, keepAlive, immediate); 19390 }; 19391 return acc; 19392 }, {}); 19393 const cancel = (process) => { 19394 for (let i = 0; i < stepsOrder.length; i++) { 19395 steps[stepsOrder[i]].cancel(process); 19396 } 19397 }; 19398 return { schedule, cancel, state, steps }; 19399} 19400 19401 19402 19403;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/frameloop/frame.mjs 19404 19405 19406 19407const { schedule: frame_frame, cancel: frame_cancelFrame, state: frame_frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop_noop, true); 19408 19409 19410 19411;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/frameloop/microtask.mjs 19412 19413 19414const { schedule: microtask_microtask, cancel: cancelMicrotask } = 19415/* @__PURE__ */ createRenderBatcher(queueMicrotask, false); 19416 19417 19418 19419;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/frameloop/sync-time.mjs 19420 19421 19422 19423let now; 19424function clearTime() { 19425 now = undefined; 19426} 19427/** 19428 * An eventloop-synchronous alternative to performance.now(). 19429 * 19430 * Ensures that time measurements remain consistent within a synchronous context. 19431 * Usually calling performance.now() twice within the same synchronous context 19432 * will return different values which isn't useful for animations when we're usually 19433 * trying to sync animations to the same frame. 19434 */ 19435const time = { 19436 now: () => { 19437 if (now === undefined) { 19438 time.set(frame_frameData.isProcessing || MotionGlobalConfig.useManualTiming 19439 ? frame_frameData.timestamp 19440 : performance.now()); 19441 } 19442 return now; 19443 }, 19444 set: (newTime) => { 19445 now = newTime; 19446 queueMicrotask(clearTime); 19447 }, 19448}; 19449 19450 19451 19452;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs 19453const isDragging = { 19454 x: false, 19455 y: false, 19456}; 19457function isDragActive() { 19458 return isDragging.x || isDragging.y; 19459} 19460 19461 19462 19463;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs 19464 19465 19466function setDragLock(axis) { 19467 if (axis === "x" || axis === "y") { 19468 if (isDragging[axis]) { 19469 return null; 19470 } 19471 else { 19472 isDragging[axis] = true; 19473 return () => { 19474 isDragging[axis] = false;
19475 }; 19476 } 19477 } 19478 else { 19479 if (isDragging.x || isDragging.y) { 19480 return null; 19481 } 19482 else { 19483 isDragging.x = isDragging.y = true; 19484 return () => { 19485 isDragging.x = isDragging.y = false; 19486 }; 19487 } 19488 } 19489} 19490 19491 19492 19493;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/utils/resolve-elements.mjs 19494function resolveElements(elementOrSelector, scope, selectorCache) { 19495 var _a; 19496 if (elementOrSelector instanceof EventTarget) { 19497 return [elementOrSelector]; 19498 } 19499 else if (typeof elementOrSelector === "string") { 19500 let root = document; 19501 if (scope) { 19502 // TODO: Refactor to utils package 19503 // invariant( 19504 // Boolean(scope.current), 19505 // "Scope provided, but no element detected." 19506 // ) 19507 root = scope.current; 19508 } 19509 const elements = (_a = selectorCache === null || selectorCache === void 0 ? void 0 : selectorCache[elementOrSelector]) !== null && _a !== void 0 ? _a : root.querySelectorAll(elementOrSelector); 19510 return elements ? Array.from(elements) : []; 19511 } 19512 return Array.from(elementOrSelector); 19513} 19514 19515 19516 19517;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/utils/setup.mjs 19518 19519 19520function setupGesture(elementOrSelector, options) { 19521 const elements = resolveElements(elementOrSelector); 19522 const gestureAbortController = new AbortController(); 19523 const eventOptions = { 19524 passive: true, 19525 ...options, 19526 signal: gestureAbortController.signal, 19527 }; 19528 const cancel = () => gestureAbortController.abort(); 19529 return [elements, eventOptions, cancel]; 19530} 19531 19532 19533 19534;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/hover.mjs 19535 19536 19537 19538function isValidHover(event) { 19539 return !(event.pointerType === "touch" || isDragActive()); 19540} 19541/** 19542 * Create a hover gesture. hover() is different to .addEventListener("pointerenter") 19543 * in that it has an easier syntax, filters out polyfilled touch events, interoperates 19544 * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. 19545 * 19546 * @public 19547 */ 19548function hover(elementOrSelector, onHoverStart, options = {}) { 19549 const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); 19550 const onPointerEnter = (enterEvent) => { 19551 if (!isValidHover(enterEvent)) 19552 return; 19553 const { target } = enterEvent; 19554 const onHoverEnd = onHoverStart(target, enterEvent); 19555 if (typeof onHoverEnd !== "function" || !target) 19556 return; 19557 const onPointerLeave = (leaveEvent) => { 19558 if (!isValidHover(leaveEvent)) 19559 return; 19560 onHoverEnd(leaveEvent); 19561 target.removeEventListener("pointerleave", onPointerLeave); 19562 }; 19563 target.addEventListener("pointerleave", onPointerLeave, eventOptions); 19564 }; 19565 elements.forEach((element) => { 19566 element.addEventListener("pointerenter", onPointerEnter, eventOptions); 19567 }); 19568 return cancel; 19569} 19570 19571 19572 19573;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/utils/capture-pointer.mjs 19574function capturePointer(event, action) { 19575 const actionName = `${action}PointerCapture`; 19576 if (event.target instanceof Element && 19577 actionName in event.target && 19578 event.pointerId !== undefined) { 19579 try { 19580 event.target[actionName](event.pointerId); 19581 } 19582 catch (e) { } 19583 } 19584} 19585 19586 19587 19588;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs 19589/** 19590 * Recursively traverse up the tree to check whether the provided child node 19591 * is the parent or a descendant of it. 19592 * 19593 * @param parent - Element to find 19594 * @param child - Element to test against parent 19595 */ 19596const isNodeOrChild = (parent, child) => { 19597 if (!child) { 19598 return false; 19599 } 19600 else if (parent === child) { 19601 return true; 19602 } 19603 else { 19604 return isNodeOrChild(parent, child.parentElement); 19605 } 19606}; 19607 19608 19609 19610;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs 19611const isPrimaryPointer = (event) => { 19612 if (event.pointerType === "mouse") { 19613 return typeof event.button !== "number" || event.button <= 0; 19614 } 19615 else { 19616 /** 19617 * isPrimary is true for all mice buttons, whereas every touch point 19618 * is regarded as its own input. So subsequent concurrent touch points 19619 * will be false. 19620 * 19621 * Specifically match against false here as incomplete versions of 19622 * PointerEvents in very old browser might have it set as undefined. 19623 */ 19624 return event.isPrimary !== false; 19625 } 19626}; 19627 19628 19629 19630;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs 19631const focusableElements = new Set([ 19632 "BUTTON", 19633 "INPUT", 19634 "SELECT", 19635 "TEXTAREA", 19636 "A", 19637]); 19638function isElementKeyboardAccessible(element) { 19639 return (focusableElements.has(element.tagName) || 19640 element.tabIndex !== -1); 19641} 19642 19643 19644 19645;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs 19646const isPressing = new WeakSet(); 19647 19648 19649 19650;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs 19651 19652 19653/** 19654 * Filter out events that are not "Enter" keys. 19655 */ 19656function filterEvents(callback) { 19657 return (event) => { 19658 if (event.key !== "Enter") 19659 return; 19660 callback(event); 19661 }; 19662} 19663function firePointerEvent(target, type) { 19664 target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); 19665} 19666const enableKeyboardPress = (focusEvent, eventOptions) => { 19667 const element = focusEvent.currentTarget; 19668 if (!element) 19669 return; 19670 const handleKeydown = filterEvents(() => { 19671 if (isPressing.has(element)) 19672 return; 19673 firePointerEvent(element, "down"); 19674 const handleKeyup = filterEvents(() => { 19675 firePointerEvent(element, "up"); 19676 }); 19677 const handleBlur = () => firePointerEvent(element, "cancel"); 19678 element.addEventListener("keyup", handleKeyup, eventOptions); 19679 element.addEventListener("blur", handleBlur, eventOptions); 19680 }); 19681 element.addEventListener("keydown", handleKeydown, eventOptions); 19682 /** 19683 * Add an event listener that fires on blur to remove the keydown events. 19684 */ 19685 element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); 19686}; 19687 19688 19689 19690;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/gestures/press/index.mjs 19691 19692 19693 19694 19695 19696 19697 19698 19699 19700/** 19701 * Filter out events that are not primary pointer events, or are triggering 19702 * while a Motion gesture is active. 19703 */ 19704function isValidPressEvent(event) { 19705 return isPrimaryPointer(event) && !isDragActive(); 19706} 19707/** 19708 * Create a press gesture. 19709 * 19710 * Press is different to `"pointerdown"`, `"pointerup"` in that it 19711 * automatically filters out secondary pointer events like right 19712 * click and multitouch. 19713 * 19714 * It also adds accessibility support for keyboards, where 19715 * an element with a press gesture will receive focus and 19716 * trigger on Enter `"keydown"` and `"keyup"` events. 19717 * 19718 * This is different to a browser's `"click"` event, which does 19719 * respond to keyboards but only for the `"click"` itself, rather 19720 * than the press start and end/cancel. The element also needs 19721 * to be focusable for this to work, whereas a press gesture will 19722 * make an element focusable by default. 19723 * 19724 * @public 19725 */ 19726function press(targetOrSelector, onPressStart, options = {}) { 19727 const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); 19728 const startPress = (startEvent) => { 19729 const target = startEvent.currentTarget; 19730 if (!target || !isValidPressEvent(startEvent) || isPressing.has(target)) 19731 return; 19732 isPressing.add(target); 19733 capturePointer(startEvent, "set"); 19734 const onPressEnd = onPressStart(target, startEvent); 19735 const onPointerEnd = (endEvent, success) => { 19736 target.removeEventListener("pointerup", onPointerUp); 19737 target.removeEventListener("pointercancel", onPointerCancel); 19738 capturePointer(endEvent, "release"); 19739 if (!isValidPressEvent(endEvent) || !isPressing.has(target)) { 19740 return; 19741 } 19742 isPressing.delete(target); 19743 if (typeof onPressEnd === "function") { 19744 onPressEnd(endEvent, { success }); 19745 } 19746 }; 19747 const onPointerUp = (upEvent) => { 19748 const isOutside = !upEvent.isTrusted 19749 ? false 19750 : checkOutside(upEvent, target instanceof Element 19751 ? target.getBoundingClientRect() 19752 : { 19753 left: 0, 19754 top: 0, 19755 right: window.innerWidth, 19756 bottom: window.innerHeight, 19757 }); 19758 if (isOutside) { 19759 onPointerEnd(upEvent, false); 19760 } 19761 else { 19762 onPointerEnd(upEvent, !(target instanceof Element) || 19763 isNodeOrChild(target, upEvent.target)); 19764 } 19765 }; 19766 const onPointerCancel = (cancelEvent) => { 19767 onPointerEnd(cancelEvent, false); 19768 }; 19769 target.addEventListener("pointerup", onPointerUp, eventOptions); 19770 target.addEventListener("pointercancel", onPointerCancel, eventOptions); 19771 target.addEventListener("lostpointercapture", onPointerCancel, eventOptions); 19772 };
19773 targets.forEach((target) => { 19774 target = options.useGlobalTarget ? window : target; 19775 let canAddKeyboardAccessibility = false; 19776 if (target instanceof HTMLElement) { 19777 canAddKeyboardAccessibility = true; 19778 if (!isElementKeyboardAccessible(target) && 19779 target.getAttribute("tabindex") === null) { 19780 target.tabIndex = 0; 19781 } 19782 } 19783 target.addEventListener("pointerdown", startPress, eventOptions); 19784 if (canAddKeyboardAccessibility) { 19785 target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions), eventOptions); 19786 } 19787 }); 19788 return cancelEvents; 19789} 19790function checkOutside(event, rect) { 19791 return (event.clientX < rect.left || 19792 event.clientX > rect.right || 19793 event.clientY < rect.top || 19794 event.clientY > rect.bottom); 19795} 19796 19797 19798 19799;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/stats/animation-count.mjs 19800const animation_count_activeAnimations = { 19801 layout: 0, 19802 mainThread: 0, 19803 waapi: 0, 19804}; 19805 19806 19807 19808;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/stats/index.mjs 19809 19810 19811 19812 19813function record() { 19814 const { value } = statsBuffer; 19815 if (value === null) { 19816 cancelFrame(record); 19817 return; 19818 } 19819 value.frameloop.rate.push(frameData.delta); 19820 value.animations.mainThread.push(activeAnimations.mainThread); 19821 value.animations.waapi.push(activeAnimations.waapi); 19822 value.animations.layout.push(activeAnimations.layout); 19823} 19824function mean(values) { 19825 return values.reduce((acc, value) => acc + value, 0) / values.length; 19826} 19827function summarise(values, calcAverage = mean) { 19828 if (values.length === 0) { 19829 return { 19830 min: 0, 19831 max: 0, 19832 avg: 0, 19833 }; 19834 } 19835 return { 19836 min: Math.min(...values), 19837 max: Math.max(...values), 19838 avg: calcAverage(values), 19839 }; 19840} 19841const msToFps = (ms) => Math.round(1000 / ms); 19842function clearStatsBuffer() { 19843 statsBuffer.value = null; 19844 statsBuffer.addProjectionMetrics = null; 19845} 19846function reportStats() { 19847 const { value } = statsBuffer; 19848 if (!value) { 19849 throw new Error("Stats are not being measured"); 19850 } 19851 clearStatsBuffer(); 19852 cancelFrame(record); 19853 const summary = { 19854 frameloop: { 19855 rate: summarise(value.frameloop.rate), 19856 read: summarise(value.frameloop.read), 19857 resolveKeyframes: summarise(value.frameloop.resolveKeyframes), 19858 update: summarise(value.frameloop.update), 19859 preRender: summarise(value.frameloop.preRender), 19860 render: summarise(value.frameloop.render), 19861 postRender: summarise(value.frameloop.postRender), 19862 }, 19863 animations: { 19864 mainThread: summarise(value.animations.mainThread), 19865 waapi: summarise(value.animations.waapi), 19866 layout: summarise(value.animations.layout), 19867 }, 19868 layoutProjection: { 19869 nodes: summarise(value.layoutProjection.nodes), 19870 calculatedTargetDeltas: summarise(value.layoutProjection.calculatedTargetDeltas), 19871 calculatedProjections: summarise(value.layoutProjection.calculatedProjections), 19872 }, 19873 }; 19874 /** 19875 * Convert the rate to FPS 19876 */ 19877 const { rate } = summary.frameloop; 19878 rate.min = msToFps(rate.min); 19879 rate.max = msToFps(rate.max); 19880 rate.avg = msToFps(rate.avg); 19881 [rate.min, rate.max] = [rate.max, rate.min]; 19882 return summary; 19883} 19884function recordStats() { 19885 if (statsBuffer.value) { 19886 clearStatsBuffer(); 19887 throw new Error("Stats are already being measured"); 19888 } 19889 const newStatsBuffer = statsBuffer; 19890 newStatsBuffer.value = { 19891 frameloop: { 19892 rate: [], 19893 read: [], 19894 resolveKeyframes: [], 19895 update: [], 19896 preRender: [], 19897 render: [], 19898 postRender: [], 19899 }, 19900 animations: { 19901 mainThread: [], 19902 waapi: [], 19903 layout: [], 19904 }, 19905 layoutProjection: { 19906 nodes: [], 19907 calculatedTargetDeltas: [], 19908 calculatedProjections: [], 19909 }, 19910 }; 19911 newStatsBuffer.addProjectionMetrics = (metrics) => { 19912 const { layoutProjection } = newStatsBuffer.value; 19913 layoutProjection.nodes.push(metrics.nodes); 19914 layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); 19915 layoutProjection.calculatedProjections.push(metrics.calculatedProjections); 19916 }; 19917 frame.postRender(record, true); 19918 return reportStats; 19919} 19920 19921 19922 19923;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/value/index.mjs 19924 19925 19926 19927 19928/** 19929 * Maximum time between the value of two frames, beyond which we 19930 * assume the velocity has since been 0. 19931 */ 19932const MAX_VELOCITY_DELTA = 30; 19933const isFloat = (value) => { 19934 return !isNaN(parseFloat(value)); 19935}; 19936const collectMotionValues = { 19937 current: undefined, 19938}; 19939/** 19940 * `MotionValue` is used to track the state and velocity of motion values. 19941 * 19942 * @public 19943 */ 19944class MotionValue { 19945 /** 19946 * @param init - The initiating value 19947 * @param config - Optional configuration options 19948 * 19949 * - `transformer`: A function to transform incoming values with. 19950 */ 19951 constructor(init, options = {}) { 19952 /** 19953 * This will be replaced by the build step with the latest version number. 19954 * When MotionValues are provided to motion components, warn if versions are mixed. 19955 */ 19956 this.version = "12.6.0"; 19957 /** 19958 * Tracks whether this value can output a velocity. Currently this is only true 19959 * if the value is numerical, but we might be able to widen the scope here and support 19960 * other value types. 19961 * 19962 * @internal 19963 */ 19964 this.canTrackVelocity = null; 19965 /**
19966 * An object containing a SubscriptionManager for each active event. 19967 */ 19968 this.events = {}; 19969 this.updateAndNotify = (v, render = true) => { 19970 const currentTime = time.now(); 19971 /** 19972 * If we're updating the value during another frame or eventloop 19973 * than the previous frame, then the we set the previous frame value 19974 * to current. 19975 */ 19976 if (this.updatedAt !== currentTime) { 19977 this.setPrevFrameValue(); 19978 } 19979 this.prev = this.current; 19980 this.setCurrent(v); 19981 // Update update subscribers 19982 if (this.current !== this.prev && this.events.change) { 19983 this.events.change.notify(this.current); 19984 } 19985 // Update render subscribers 19986 if (render && this.events.renderRequest) { 19987 this.events.renderRequest.notify(this.current); 19988 } 19989 }; 19990 this.hasAnimated = false; 19991 this.setCurrent(init); 19992 this.owner = options.owner; 19993 } 19994 setCurrent(current) { 19995 this.current = current; 19996 this.updatedAt = time.now(); 19997 if (this.canTrackVelocity === null && current !== undefined) { 19998 this.canTrackVelocity = isFloat(this.current); 19999 } 20000 } 20001 setPrevFrameValue(prevFrameValue = this.current) { 20002 this.prevFrameValue = prevFrameValue; 20003 this.prevUpdatedAt = this.updatedAt; 20004 } 20005 /** 20006 * Adds a function that will be notified when the `MotionValue` is updated. 20007 * 20008 * It returns a function that, when called, will cancel the subscription. 20009 * 20010 * When calling `onChange` inside a React component, it should be wrapped with the 20011 * `useEffect` hook. As it returns an unsubscribe function, this should be returned 20012 * from the `useEffect` function to ensure you don't add duplicate subscribers.. 20013 * 20014 * ```jsx 20015 * export const MyComponent = () => { 20016 * const x = useMotionValue(0) 20017 * const y = useMotionValue(0) 20018 * const opacity = useMotionValue(1) 20019 * 20020 * useEffect(() => { 20021 * function updateOpacity() { 20022 * const maxXY = Math.max(x.get(), y.get()) 20023 * const newOpacity = transform(maxXY, [0, 100], [1, 0]) 20024 * opacity.set(newOpacity) 20025 * } 20026 * 20027 * const unsubscribeX = x.on("change", updateOpacity) 20028 * const unsubscribeY = y.on("change", updateOpacity) 20029 * 20030 * return () => { 20031 * unsubscribeX() 20032 * unsubscribeY() 20033 * } 20034 * }, []) 20035 * 20036 * return <motion.div style={{ x }} /> 20037 * } 20038 * ``` 20039 * 20040 * @param subscriber - A function that receives the latest value. 20041 * @returns A function that, when called, will cancel this subscription. 20042 * 20043 * @deprecated 20044 */ 20045 onChange(subscription) { 20046 if (false) {} 20047 return this.on("change", subscription); 20048 } 20049 on(eventName, callback) { 20050 if (!this.events[eventName]) { 20051 this.events[eventName] = new SubscriptionManager(); 20052 } 20053 const unsubscribe = this.events[eventName].add(callback); 20054 if (eventName === "change") { 20055 return () => { 20056 unsubscribe(); 20057 /** 20058 * If we have no more change listeners by the start 20059 * of the next frame, stop active animations. 20060 */ 20061 frame_frame.read(() => { 20062 if (!this.events.change.getSize()) { 20063 this.stop(); 20064 } 20065 }); 20066 }; 20067 } 20068 return unsubscribe; 20069 } 20070 clearListeners() { 20071 for (const eventManagers in this.events) { 20072 this.events[eventManagers].clear(); 20073 } 20074 } 20075 /** 20076 * Attaches a passive effect to the `MotionValue`. 20077 */ 20078 attach(passiveEffect, stopPassiveEffect) { 20079 this.passiveEffect = passiveEffect; 20080 this.stopPassiveEffect = stopPassiveEffect; 20081 } 20082 /** 20083 * Sets the state of the `MotionValue`. 20084 * 20085 * @remarks 20086 * 20087 * ```jsx 20088 * const x = useMotionValue(0) 20089 * x.set(10) 20090 * ``` 20091 * 20092 * @param latest - Latest value to set. 20093 * @param render - Whether to notify render subscribers. Defaults to `true` 20094 * 20095 * @public 20096 */ 20097 set(v, render = true) { 20098 if (!render || !this.passiveEffect) { 20099 this.updateAndNotify(v, render); 20100 } 20101 else { 20102 this.passiveEffect(v, this.updateAndNotify); 20103 } 20104 } 20105 setWithVelocity(prev, current, delta) { 20106 this.set(current); 20107 this.prev = undefined; 20108 this.prevFrameValue = prev; 20109 this.prevUpdatedAt = this.updatedAt - delta; 20110 } 20111 /** 20112 * Set the state of the `MotionValue`, stopping any active animations, 20113 * effects, and resets velocity to `0`. 20114 */ 20115 jump(v, endAnimation = true) { 20116 this.updateAndNotify(v); 20117 this.prev = v; 20118 this.prevUpdatedAt = this.prevFrameValue = undefined; 20119 endAnimation && this.stop(); 20120 if (this.stopPassiveEffect) 20121 this.stopPassiveEffect(); 20122 } 20123 /** 20124 * Returns the latest state of `MotionValue` 20125 * 20126 * @returns - The latest state of `MotionValue` 20127 * 20128 * @public 20129 */ 20130 get() { 20131 if (collectMotionValues.current) { 20132 collectMotionValues.current.push(this); 20133 } 20134 return this.current; 20135 } 20136 /** 20137 * @public 20138 */ 20139 getPrevious() { 20140 return this.prev; 20141 } 20142 /** 20143 * Returns the latest velocity of `MotionValue` 20144 * 20145 * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. 20146 * 20147 * @public 20148 */ 20149 getVelocity() { 20150 const currentTime = time.now(); 20151 if (!this.canTrackVelocity || 20152 this.prevFrameValue === undefined || 20153 currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { 20154 return 0; 20155 } 20156 const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); 20157 // Casts because of parseFloat's poor typing 20158 return velocityPerSecond(parseFloat(this.current) - 20159 parseFloat(this.prevFrameValue), delta); 20160 } 20161 /** 20162 * Registers a new animation to control this `MotionValue`. Only one 20163 * animation can drive a `MotionValue` at one time. 20164 * 20165 * ```jsx 20166 * value.start() 20167 * ``` 20168 * 20169 * @param animation - A function that starts the provided animation 20170 */ 20171 start(startAnimation) { 20172 this.stop(); 20173 return new Promise((resolve) => { 20174 this.hasAnimated = true; 20175 this.animation = startAnimation(resolve); 20176 if (this.events.animationStart) { 20177 this.events.animationStart.notify(); 20178 } 20179 }).then(() => { 20180 if (this.events.animationComplete) { 20181 this.events.animationComplete.notify(); 20182 } 20183 this.clearAnimation(); 20184 }); 20185 } 20186 /** 20187 * Stop the currently active animation. 20188 * 20189 * @public 20190 */ 20191 stop() { 20192 if (this.animation) { 20193 this.animation.stop(); 20194 if (this.events.animationCancel) { 20195 this.events.animationCancel.notify(); 20196 } 20197 } 20198 this.clearAnimation(); 20199 } 20200 /** 20201 * Returns `true` if this value is currently animating. 20202 * 20203 * @public 20204 */ 20205 isAnimating() { 20206 return !!this.animation; 20207 } 20208 clearAnimation() { 20209 delete this.animation; 20210 } 20211 /** 20212 * Destroy and clean up subscribers to this `MotionValue`. 20213 * 20214 * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically 20215 * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually 20216 * created a `MotionValue` via the `motionValue` function. 20217 * 20218 * @public 20219 */ 20220 destroy() { 20221 this.clearListeners(); 20222 this.stop(); 20223 if (this.stopPassiveEffect) { 20224 this.stopPassiveEffect(); 20225 } 20226 } 20227} 20228function motionValue(init, options) { 20229 return new MotionValue(init, options); 20230} 20231 20232 20233 20234;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/waapi/utils/convert-options.mjs 20235 20236 20237 20238 20239 20240 20241const defaultEasing = "easeOut"; 20242function convert_options_applyGeneratorOptions(options) { 20243 var _a; 20244 if (isGenerator(options.type)) { 20245 const generatorOptions = createGeneratorEasing(options, 100, options.type); 20246 options.ease = supportsLinearEasing() 20247 ? generatorOptions.ease 20248 : defaultEasing; 20249 options.duration = time_conversion_secondsToMilliseconds(generatorOptions.duration); 20250 options.type = "keyframes"; 20251 } 20252 else { 20253 options.duration = time_conversion_secondsToMilliseconds((_a = options.duration) !== null && _a !== void 0 ? _a : 0.3); 20254 options.ease = options.ease || defaultEasing; 20255 } 20256} 20257// TODO: Reuse for NativeAnimation 20258function convertMotionOptionsToNative(valueName, keyframes, options) { 20259 var _a; 20260 const nativeKeyframes = {}; 20261 const nativeOptions = { 20262 fill: "both", 20263 easing: "linear", 20264 composite: "replace", 20265 }; 20266 nativeOptions.delay = time_conversion_secondsToMilliseconds((_a = options.delay) !== null && _a !== void 0 ? _a : 0); 20267 convert_options_applyGeneratorOptions(options); 20268 nativeOptions.duration = options.duration; 20269 const { ease, times } = options; 20270 if (times) 20271 nativeKeyframes.offset = times; 20272 nativeKeyframes[valueName] = keyframes; 20273 const easing = easing_mapEasingToNativeEasing(ease, options.duration); 20274 /** 20275 * If this is an easing array, apply to keyframes, not animation as a whole 20276 */ 20277 if (Array.isArray(easing)) { 20278 nativeKeyframes.easing = easing; 20279 } 20280 else { 20281 nativeOptions.easing = easing; 20282 } 20283 return { 20284 keyframes: nativeKeyframes, 20285 options: nativeOptions, 20286 }; 20287} 20288 20289 20290 20291;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/animation/waapi/PseudoAnimation.mjs 20292 20293 20294 20295class PseudoAnimation_PseudoAnimation extends NativeAnimationControls_NativeAnimationControls { 20296 constructor(target, pseudoElement, valueName, keyframes, options) { 20297 const animationOptions = convertMotionOptionsToNative(valueName, keyframes, options); 20298 const animation = target.animate(animationOptions.keyframes, { 20299 pseudoElement, 20300 ...animationOptions.options, 20301 }); 20302 super(animation); 20303 } 20304} 20305 20306 20307 20308;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/view/utils/css.mjs 20309let pendingRules = {}; 20310let style = null; 20311const css_css = { 20312 set: (selector, values) => { 20313 pendingRules[selector] = values; 20314 }, 20315 commit: () => { 20316 if (!style) { 20317 style = document.createElement("style"); 20318 style.id = "motion-view"; 20319 } 20320 let cssText = ""; 20321 for (const selector in pendingRules) { 20322 const rule = pendingRules[selector]; 20323 cssText += `${selector} {\n`; 20324 for (const [property, value] of Object.entries(rule)) { 20325 cssText += ` ${property}: ${value};\n`; 20326 } 20327 cssText += "}\n"; 20328 } 20329 style.textContent = cssText; 20330 document.head.appendChild(style); 20331 pendingRules = {}; 20332 }, 20333 remove: () => { 20334 if (style && style.parentElement) { 20335 style.parentElement.removeChild(style); 20336 } 20337 }, 20338}; 20339 20340 20341 20342;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/view/start.mjs 20343 20344 20345 20346 20347 20348 20349 20350 20351 20352 20353 20354 20355 20356const definitionNames = (/* unused pure expression or super */ null && (["layout", "enter", "exit", "new", "old"])); 20357function start_startViewAnimation(builder) { 20358 const { update, targets, options: defaultOptions } = builder; 20359 if (!document.startViewTransition) { 20360 return new Promise(async (resolve) => { 20361 await update(); 20362 resolve(new BaseGroupPlaybackControls([])); 20363 }); 20364 } 20365 // TODO: Go over existing targets and ensure they all have ids 20366 /** 20367 * If we don't have any animations defined for the root target, 20368 * remove it from being captured. 20369 */ 20370 if (!hasTarget("root", targets)) { 20371 css.set(":root", { 20372 "view-transition-name": "none", 20373 }); 20374 } 20375 /** 20376 * Set the timing curve to linear for all view transition layers. 20377 * This gets baked into the keyframes, which can't be changed 20378 * without breaking the generated animation. 20379 * 20380 * This allows us to set easing via updateTiming - which can be changed. 20381 */ 20382 css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); 20383 css.commit(); // Write 20384 const transition = document.startViewTransition(async () => { 20385 await update(); 20386 // TODO: Go over new targets and ensure they all have ids 20387 }); 20388 transition.finished.finally(() => { 20389 css.remove(); // Write 20390 }); 20391 return new Promise((resolve) => { 20392 transition.ready.then(() => { 20393 var _a; 20394 const generatedViewAnimations = getViewAnimations(); 20395 const animations = []; 20396 /** 20397 * Create animations for our definitions 20398 */
20399 targets.forEach((definition, target) => { 20400 // TODO: If target is not "root", resolve elements 20401 // and iterate over each 20402 for (const key of definitionNames) { 20403 if (!definition[key]) 20404 continue; 20405 const { keyframes, options } = definition[key]; 20406 for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { 20407 if (!valueKeyframes) 20408 continue; 20409 const valueOptions = { 20410 ...getValueTransition(defaultOptions, valueName), 20411 ...getValueTransition(options, valueName), 20412 }; 20413 const type = chooseLayerType(key); 20414 /** 20415 * If this is an opacity animation, and keyframes are not an array, 20416 * we need to convert them into an array and set an initial value. 20417 */ 20418 if (valueName === "opacity" && 20419 !Array.isArray(valueKeyframes)) { 20420 const initialValue = type === "new" ? 0 : 1; 20421 valueKeyframes = [initialValue, valueKeyframes]; 20422 } 20423 /** 20424 * Resolve stagger function if provided. 20425 */ 20426 if (typeof valueOptions.delay === "function") { 20427 valueOptions.delay = valueOptions.delay(0, 1); 20428 } 20429 const animation = new PseudoAnimation(document.documentElement, `::view-transition-${type}(${target})`, valueName, valueKeyframes, valueOptions); 20430 animations.push(animation); 20431 } 20432 } 20433 }); 20434 /** 20435 * Handle browser generated animations 20436 */ 20437 for (const animation of generatedViewAnimations) { 20438 if (animation.playState === "finished") 20439 continue; 20440 const { effect } = animation; 20441 if (!effect || !(effect instanceof KeyframeEffect)) 20442 continue; 20443 const { pseudoElement } = effect; 20444 if (!pseudoElement) 20445 continue; 20446 const name = getLayerName(pseudoElement); 20447 if (!name) 20448 continue; 20449 const targetDefinition = targets.get(name.layer); 20450 if (!targetDefinition) { 20451 /** 20452 * If transition name is group then update the timing of the animation 20453 * whereas if it's old or new then we could possibly replace it using 20454 * the above method. 20455 */ 20456 const transitionName = name.type === "group" ? "layout" : ""; 20457 const animationTransition = { 20458 ...getValueTransition(defaultOptions, transitionName), 20459 }; 20460 applyGeneratorOptions(animationTransition); 20461 const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration); 20462 effect.updateTiming({ 20463 delay: secondsToMilliseconds((_a = animationTransition.delay) !== null && _a !== void 0 ? _a : 0), 20464 duration: animationTransition.duration, 20465 easing, 20466 }); 20467 animations.push(new NativeAnimationControls(animation)); 20468 } 20469 else if (hasOpacity(targetDefinition, "enter") && 20470 hasOpacity(targetDefinition, "exit") && 20471 effect 20472 .getKeyframes() 20473 .some((keyframe) => keyframe.mixBlendMode)) { 20474 animations.push(new NativeAnimationControls(animation)); 20475 } 20476 else { 20477 animation.cancel(); 20478 } 20479 } 20480 resolve(new BaseGroupPlaybackControls(animations)); 20481 }); 20482 }); 20483} 20484function hasOpacity(target, key) { 20485 var _a; 20486 return (_a = target === null || target === void 0 ? void 0 : target[key]) === null || _a === void 0 ? void 0 : _a.keyframes.opacity; 20487} 20488 20489 20490 20491;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/view/queue.mjs 20492 20493 20494 20495 20496let builders = (/* unused pure expression or super */ null && ([])); 20497let current = null; 20498function next() { 20499 current = null; 20500 const [nextBuilder] = builders; 20501 if (nextBuilder) 20502 start(nextBuilder); 20503} 20504function start(builder) { 20505 removeItem(builders, builder); 20506 current = builder; 20507 startViewAnimation(builder).then((animation) => { 20508 builder.notifyReady(animation); 20509 animation.finished.finally(next); 20510 }); 20511} 20512function processQueue() { 20513 var _a; 20514 /** 20515 * Iterate backwards over the builders array. We can ignore the 20516 * "wait" animations. If we have an interrupting animation in the 20517 * queue then we need to batch all preceeding animations into it. 20518 * Currently this only batches the update functions but will also 20519 * need to batch the targets. 20520 */ 20521 for (let i = builders.length - 1; i >= 0; i--) { 20522 const builder = builders[i]; 20523 const { interrupt } = builder.options; 20524 if (interrupt === "immediate") { 20525 const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); 20526 const remaining = builders.slice(i + 1); 20527 builder.update = () => {
20528 batchedUpdates.forEach((update) => update()); 20529 }; 20530 // Put the current builder at the front, followed by any "wait" builders 20531 builders = [builder, ...remaining]; 20532 break; 20533 } 20534 } 20535 if (!current || ((_a = builders[0]) === null || _a === void 0 ? void 0 : _a.options.interrupt) === "immediate") { 20536 next(); 20537 } 20538} 20539function queue_addToQueue(builder) { 20540 builders.push(builder); 20541 microtask.render(processQueue); 20542} 20543 20544 20545 20546;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/view/index.mjs 20547 20548 20549 20550class ViewTransitionBuilder { 20551 constructor(update, options = {}) { 20552 this.currentTarget = "root"; 20553 this.targets = new Map(); 20554 this.notifyReady = noop; 20555 this.readyPromise = new Promise((resolve) => { 20556 this.notifyReady = resolve; 20557 }); 20558 this.update = update; 20559 this.options = { 20560 interrupt: "wait", 20561 ...options, 20562 }; 20563 addToQueue(this); 20564 } 20565 get(selector) { 20566 this.currentTarget = selector; 20567 return this; 20568 } 20569 layout(keyframes, options) { 20570 this.updateTarget("layout", keyframes, options); 20571 return this; 20572 } 20573 new(keyframes, options) { 20574 this.updateTarget("new", keyframes, options); 20575 return this; 20576 } 20577 old(keyframes, options) { 20578 this.updateTarget("old", keyframes, options); 20579 return this; 20580 } 20581 enter(keyframes, options) { 20582 this.updateTarget("enter", keyframes, options); 20583 return this; 20584 } 20585 exit(keyframes, options) { 20586 this.updateTarget("exit", keyframes, options); 20587 return this; 20588 } 20589 crossfade(options) { 20590 this.updateTarget("enter", { opacity: 1 }, options); 20591 this.updateTarget("exit", { opacity: 0 }, options); 20592 return this; 20593 } 20594 updateTarget(target, keyframes, options = {}) { 20595 const { currentTarget, targets } = this; 20596 if (!targets.has(currentTarget)) { 20597 targets.set(currentTarget, {}); 20598 } 20599 const targetData = targets.get(currentTarget); 20600 targetData[target] = { keyframes, options }; 20601 } 20602 then(resolve, reject) { 20603 return this.readyPromise.then(resolve, reject); 20604 } 20605} 20606function animateView(update, defaultOptions = {}) { 20607 return new ViewTransitionBuilder(update, defaultOptions); 20608} 20609 20610 20611 20612;// CONCATENATED MODULE: ./node_modules/motion-dom/dist/es/index.mjs 20613 20614 20615 20616 20617 20618 20619 20620 20621 20622 20623 20624 20625 20626 20627 20628 20629 20630 20631 20632 20633 20634 20635 20636 20637 20638 20639 20640 20641 20642 20643 20644;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/keys-transform.mjs 20645/** 20646 * Generate a list of every possible transform key. 20647 */ 20648const transformPropOrder = [ 20649 "transformPerspective", 20650 "x", 20651 "y", 20652 "z", 20653 "translateX", 20654 "translateY", 20655 "translateZ", 20656 "scale", 20657 "scaleX", 20658 "scaleY", 20659 "rotate", 20660 "rotateX", 20661 "rotateY", 20662 "rotateZ", 20663 "skew", 20664 "skewX", 20665 "skewY", 20666]; 20667/** 20668 * A quick lookup for transform props. 20669 */ 20670const transformProps = new Set(transformPropOrder); 20671 20672 20673 20674;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/keys-position.mjs 20675 20676 20677const positionalKeys = new Set([ 20678 "width", 20679 "height", 20680 "top", 20681 "left", 20682 "right", 20683 "bottom", 20684 ...transformPropOrder, 20685]); 20686 20687 20688 20689;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs 20690const isKeyframesTarget = (v) => { 20691 return Array.isArray(v); 20692}; 20693 20694 20695 20696;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/resolve-value.mjs 20697 20698 20699const isCustomValue = (v) => { 20700 return Boolean(v && typeof v === "object" && v.mix && v.toValue); 20701}; 20702const resolveFinalValueInKeyframes = (v) => { 20703 // TODO maybe throw if v.length - 1 is placeholder token? 20704 return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; 20705}; 20706 20707 20708 20709;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/setters.mjs 20710 20711 20712 20713 20714/** 20715 * Set VisualElement's MotionValue, creating a new MotionValue for it if 20716 * it doesn't exist. 20717 */ 20718function setMotionValue(visualElement, key, value) { 20719 if (visualElement.hasValue(key)) { 20720 visualElement.getValue(key).set(value); 20721 } 20722 else { 20723 visualElement.addValue(key, motionValue(value)); 20724 } 20725} 20726function setTarget(visualElement, definition) { 20727 const resolved = resolveVariant(visualElement, definition); 20728 let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; 20729 target = { ...target, ...transitionEnd }; 20730 for (const key in target) { 20731 const value = resolveFinalValueInKeyframes(target[key]); 20732 setMotionValue(visualElement, key, value); 20733 } 20734} 20735 20736 20737 20738;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs 20739const isMotionValue = (value) => Boolean(value && value.getVelocity); 20740 20741 20742 20743;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/use-will-change/is.mjs 20744 20745 20746function isWillChangeMotionValue(value) { 20747 return Boolean(isMotionValue(value) && value.add); 20748} 20749 20750 20751 20752;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.mjs 20753 20754 20755function addValueToWillChange(visualElement, key) { 20756 const willChange = visualElement.getValue("willChange"); 20757 /** 20758 * It could be that a user has set willChange to a regular MotionValue, 20759 * in which case we can't add the value to it. 20760 */ 20761 if (isWillChangeMotionValue(willChange)) { 20762 return willChange.add(key); 20763 } 20764} 20765 20766 20767 20768;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/ut
20768ils/camel-to-dash.mjs 20769/** 20770 * Convert camelCase to dash-case properties. 20771 */ 20772const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(); 20773 20774 20775 20776;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs 20777 20778 20779const optimizedAppearDataId = "framerAppearId"; 20780const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); 20781 20782 20783 20784;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs 20785 20786 20787function getOptimisedAppearId(visualElement) { 20788 return visualElement.props[optimizedAppearDataAttribute]; 20789} 20790 20791 20792 20793;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs 20794const instantAnimationState = { 20795 current: false, 20796}; 20797 20798 20799 20800;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs 20801 20802 20803/* 20804 Bezier function generator 20805 This has been modified from Gaëtan Renaudeau's BezierEasing 20806 https://github.com/gre/bezier-easing/blob/master/src/index.js 20807 https://github.com/gre/bezier-easing/blob/master/LICENSE 20808 20809 I've removed the newtonRaphsonIterate algo because in benchmarking it 20810 wasn't noticiably faster than binarySubdivision, indeed removing it 20811 usually improved times, depending on the curve. 20812 I also removed the lookup table, as for the added bundle size and loop we're 20813 only cutting ~4 or so subdivision iterations. I bumped the max iterations up 20814 to 12 to compensate and this still tended to be faster for no perceivable 20815 loss in accuracy. 20816 Usage 20817 const easeOut = cubicBezier(.17,.67,.83,.67); 20818 const x = easeOut(0.5); // returns 0.627... 20819*/ 20820// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. 20821const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * 20822 t; 20823const subdivisionPrecision = 0.0000001; 20824const subdivisionMaxIterations = 12; 20825function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { 20826 let currentX; 20827 let currentT; 20828 let i = 0; 20829 do { 20830 currentT = lowerBound + (upperBound - lowerBound) / 2.0; 20831 currentX = calcBezier(currentT, mX1, mX2) - x; 20832 if (currentX > 0.0) { 20833 upperBound = currentT; 20834 } 20835 else { 20836 lowerBound = currentT; 20837 } 20838 } while (Math.abs(currentX) > subdivisionPrecision && 20839 ++i < subdivisionMaxIterations); 20840 return currentT; 20841} 20842function cubicBezier(mX1, mY1, mX2, mY2) { 20843 // If this is a linear gradient, return linear easing 20844 if (mX1 === mY1 && mX2 === mY2) 20845 return noop_noop; 20846 const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); 20847 // If animation is at start/end, return t without easing 20848 return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); 20849} 20850 20851 20852 20853;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs 20854// Accepts an easing function and returns a new one that outputs mirrored values for 20855// the second half of the animation. Turns easeIn into easeInOut. 20856const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; 20857 20858 20859 20860;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs 20861// Accepts an easing function and returns a new one that outputs reversed values. 20862// Turns easeIn into easeOut. 20863const reverseEasing = (easing) => (p) => 1 - easing(1 - p); 20864 20865 20866 20867;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/back.mjs 20868 20869 20870 20871 20872const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); 20873const backIn = /*@__PURE__*/ reverseEasing(backOut); 20874const backInOut = /*@__PURE__*/ mirrorEasing(backIn); 20875 20876 20877 20878;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/anticipate.mjs 20879 20880 20881const anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); 20882 20883 20884 20885;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/circ.mjs 20886 20887 20888 20889const circIn = (p) => 1 - Math.sin(Math.acos(p)); 20890const circOut = reverseEasing(circIn); 20891const circInOut = mirrorEasing(circIn); 20892 20893 20894 20895;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs 20896/** 20897 * Check if the value is a zero value string like "0px" or "0%" 20898 */ 20899const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); 20900 20901 20902 20903;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-none.mjs 20904 20905 20906function isNone(value) { 20907 if (typeof value === "number") { 20908 return value === 0; 20909 } 20910 else if (value !== null) { 20911 return value === "none" || value === "0" || isZeroValueString(value); 20912 } 20913 else { 20914 return true; 20915 } 20916} 20917 20918 20919 20920;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/clamp.mjs 20921const clamp = (min, max, v) => { 20922 if (v > max) 20923 return max; 20924 if (v < min) 20925 return min; 20926 return v; 20927}; 20928 20929 20930 20931;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/numbers/index.mjs 20932 20933 20934const number = { 20935 test: (v) => typeof v === "number", 20936 parse: parseFloat, 20937 transform: (v) => v, 20938};
20939const alpha = { 20940 ...number, 20941 transform: (v) => clamp(0, 1, v), 20942}; 20943const scale = { 20944 ...number, 20945 default: 1, 20946}; 20947 20948 20949 20950;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/utils/sanitize.mjs 20951// If this number is a decimal, make it just five decimal places 20952// to avoid exponents 20953const sanitize = (v) => Math.round(v * 100000) / 100000; 20954 20955 20956 20957;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/utils/float-regex.mjs 20958const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; 20959 20960 20961 20962;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/utils/is-nullish.mjs 20963function isNullish(v) { 20964 return v == null; 20965} 20966 20967 20968 20969;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/utils/single-color-regex.mjs 20970const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; 20971 20972 20973 20974;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/color/utils.mjs 20975 20976 20977 20978 20979/** 20980 * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, 20981 * but false if a number or multiple colors 20982 */ 20983const isColorString = (type, testProp) => (v) => { 20984 return Boolean((typeof v === "string" && 20985 singleColorRegex.test(v) && 20986 v.startsWith(type)) || 20987 (testProp && 20988 !isNullish(v) && 20989 Object.prototype.hasOwnProperty.call(v, testProp))); 20990}; 20991const splitColor = (aName, bName, cName) => (v) => { 20992 if (typeof v !== "string") 20993 return v; 20994 const [a, b, c, alpha] = v.match(floatRegex); 20995 return { 20996 [aName]: parseFloat(a), 20997 [bName]: parseFloat(b), 20998 [cName]: parseFloat(c), 20999 alpha: alpha !== undefined ? parseFloat(alpha) : 1, 21000 }; 21001}; 21002 21003 21004 21005;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/color/rgba.mjs 21006 21007 21008 21009 21010 21011const clampRgbUnit = (v) => clamp(0, 255, v); 21012const rgbUnit = { 21013 ...number, 21014 transform: (v) => Math.round(clampRgbUnit(v)), 21015}; 21016const rgba = { 21017 test: /*@__PURE__*/ isColorString("rgb", "red"), 21018 parse: /*@__PURE__*/ splitColor("red", "green", "blue"), 21019 transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + 21020 rgbUnit.transform(red) + 21021 ", " + 21022 rgbUnit.transform(green) + 21023 ", " + 21024 rgbUnit.transform(blue) + 21025 ", " + 21026 sanitize(alpha.transform(alpha$1)) + 21027 ")", 21028}; 21029 21030 21031 21032;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/color/hex.mjs 21033 21034 21035 21036function parseHex(v) { 21037 let r = ""; 21038 let g = ""; 21039 let b = ""; 21040 let a = ""; 21041 // If we have 6 characters, ie #FF0000 21042 if (v.length > 5) { 21043 r = v.substring(1, 3); 21044 g = v.substring(3, 5); 21045 b = v.substring(5, 7); 21046 a = v.substring(7, 9); 21047 // Or we have 3 characters, ie #F00 21048 } 21049 else { 21050 r = v.substring(1, 2); 21051 g = v.substring(2, 3); 21052 b = v.substring(3, 4); 21053 a = v.substring(4, 5); 21054 r += r; 21055 g += g; 21056 b += b; 21057 a += a; 21058 } 21059 return { 21060 red: parseInt(r, 16), 21061 green: parseInt(g, 16), 21062 blue: parseInt(b, 16),
21063 alpha: a ? parseInt(a, 16) / 255 : 1, 21064 }; 21065} 21066const hex = { 21067 test: /*@__PURE__*/ isColorString("#"), 21068 parse: parseHex, 21069 transform: rgba.transform, 21070}; 21071 21072 21073 21074;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/numbers/units.mjs 21075const createUnitType = (unit) => ({ 21076 test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, 21077 parse: parseFloat, 21078 transform: (v) => `${v}${unit}`, 21079}); 21080const degrees = /*@__PURE__*/ createUnitType("deg"); 21081const percent = /*@__PURE__*/ createUnitType("%"); 21082const px = /*@__PURE__*/ createUnitType("px"); 21083const vh = /*@__PURE__*/ createUnitType("vh"); 21084const vw = /*@__PURE__*/ createUnitType("vw"); 21085const progressPercentage = { 21086 ...percent, 21087 parse: (v) => percent.parse(v) / 100, 21088 transform: (v) => percent.transform(v * 100), 21089}; 21090 21091 21092 21093;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/color/hsla.mjs 21094 21095 21096 21097 21098 21099const hsla = { 21100 test: /*@__PURE__*/ isColorString("hsl", "hue"), 21101 parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), 21102 transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { 21103 return ("hsla(" + 21104 Math.round(hue) + 21105 ", " + 21106 percent.transform(sanitize(saturation)) + 21107 ", " + 21108 percent.transform(sanitize(lightness)) + 21109 ", " + 21110 sanitize(alpha.transform(alpha$1)) + 21111 ")"); 21112 }, 21113}; 21114 21115 21116 21117;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/color/index.mjs 21118 21119 21120 21121 21122const color = { 21123 test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), 21124 parse: (v) => { 21125 if (rgba.test(v)) { 21126 return rgba.parse(v); 21127 } 21128 else if (hsla.test(v)) { 21129 return hsla.parse(v); 21130 } 21131 else { 21132 return hex.parse(v); 21133 } 21134 }, 21135 transform: (v) => { 21136 return typeof v === "string" 21137 ? v 21138 : v.hasOwnProperty("red") 21139 ? rgba.transform(v) 21140 : hsla.transform(v); 21141 }, 21142}; 21143 21144 21145 21146;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/utils/color-regex.mjs 21147const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; 21148 21149 21150 21151;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/complex/index.mjs 21152 21153 21154 21155 21156 21157function test(v) { 21158 var _a, _b; 21159 return (isNaN(v) && 21160 typeof v === "string" && 21161 (((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) + 21162 (((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) > 21163 0); 21164} 21165const NUMBER_TOKEN = "number"; 21166const COLOR_TOKEN = "color"; 21167const VAR_TOKEN = "var"; 21168const VAR_FUNCTION_TOKEN = "var("; 21169const SPLIT_TOKEN = "${}"; 21170// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` 21171const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; 21172function analyseComplexValue(value) { 21173 const originalValue = value.toString(); 21174 const values = []; 21175 const indexes = { 21176 color: [], 21177 number: [], 21178 var: [], 21179 }; 21180 const types = []; 21181 let i = 0; 21182 const tokenised = originalValue.replace(complexRegex, (parsedValue) => { 21183 if (color.test(parsedValue)) { 21184 indexes.color.push(i); 21185 types.push(COLOR_TOKEN); 21186 values.push(color.parse(parsedValue)); 21187 } 21188 else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { 21189 indexes.var.push(i); 21190 types.push(VAR_TOKEN); 21191 values.push(parsedValue); 21192 } 21193 else { 21194 indexes.number.push(i); 21195 types.push(NUMBER_TOKEN); 21196 values.push(parseFloat(parsedValue)); 21197 } 21198 ++i; 21199 return SPLIT_TOKEN; 21200 }); 21201 const split = tokenised.split(SPLIT_TOKEN); 21202 return { values, split, indexes, types }; 21203} 21204function parseComplexValue(v) { 21205 return analyseComplexValue(v).values; 21206} 21207function createTransformer(source) { 21208 const { split, types } = analyseComplexValue(source); 21209 const numSections = split.length; 21210 return (v) => { 21211 let output = ""; 21212 for (let i = 0; i < numSections; i++) { 21213 output += split[i]; 21214 if (v[i] !== undefined) { 21215 const type = types[i]; 21216 if (type === NUMBER_TOKEN) { 21217 output += sanitize(v[i]); 21218 } 21219 else if (type === COLOR_TOKEN) { 21220 output += color.transform(v[i]); 21221 } 21222 else { 21223 output += v[i]; 21224 } 21225 } 21226 } 21227 return output; 21228 }; 21229} 21230const convertNumbersToZero = (v) => typeof v === "number" ? 0 : v; 21231function getAnimatableNone(v) { 21232 const parsed = parseComplexValue(v); 21233 const transformer = createTransformer(v); 21234 return transformer(parsed.map(convertNumbersToZero)); 21235} 21236const complex = { 21237 test, 21238 parse: parseComplexValue, 21239 createTransformer, 21240 getAnimatableNone, 21241}; 21242 21243 21244 21245;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/types/complex/filter.mjs 21246 21247 21248 21249/** 21250 * Properties that should default to 1 or 100% 21251 */ 21252const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); 21253function applyDefaultFilter(v) { 21254 const [name, value] = v.slice(0, -1).split("("); 21255 if (name === "drop-shadow") 21256 return v; 21257 const [number] = value.match(floatRegex) || []; 21258 if (!number) 21259 return v; 21260 const unit = value.replace(number, ""); 21261 let defaultValue = maxDefaults.has(name) ? 1 : 0; 21262 if (number !== value) 21263 defaultValue *= 100; 21264 return name + "(" + defaultValue + unit + ")"; 21265} 21266const functionRegex = /\b([a-z-]*)\(.*?\)/gu; 21267const filter = { 21268 ...complex, 21269 getAnimatableNone: (v) => { 21270 const functions = v.match(functionRegex); 21271 return functions ? functions.map(applyDefaultFilter).join(" ") : v; 21272 }, 21273}; 21274 21275 21276 21277;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/number-browser.mjs 21278 21279 21280const browserNumberValueTypes = { 21281 // Border props 21282 borderWidth: px, 21283 borderTopWidth: px, 21284 borderRightWidth: px, 21285 borderBottomWidth: px, 21286 borderLeftWidth: px, 21287 borderRadius: px, 21288 radius: px, 21289 borderTopLeftRadius: px, 21290 borderTopRightRadius: px, 21291 borderBottomRightRadius: px, 21292 borderBottomLeftRadius: px, 21293 // Positioning props 21294 width: px, 21295 maxWidth: px, 21296 height: px, 21297 maxHeight: px, 21298 top: px, 21299 right: px, 21300 bottom: px, 21301 left: px, 21302 // Spacing props 21303 padding: px, 21304 paddingTop: px, 21305 paddingRight: px, 21306 paddingBottom: px, 21307 paddingLeft: px, 21308 margin: px, 21309 marginTop: px, 21310 marginRight: px, 21311 marginBottom: px, 21312 marginLeft: px, 21313 // Misc 21314 backgroundPositionX: px, 21315 backgroundPositionY: px, 21316}; 21317 21318 21319 21320;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/transform.mjs 21321 21322 21323 21324const transformValueTypes = { 21325 rotate: degrees, 21326 rotateX: degrees, 21327 rotateY: degrees, 21328 rotateZ: degrees, 21329 scale: scale, 21330 scaleX: scale, 21331 scaleY: scale, 21332 scaleZ: scale, 21333 skew: degrees, 21334 skewX: degrees, 21335 skewY: degrees, 21336 distance: px, 21337 translateX: px, 21338 translateY: px, 21339 translateZ: px, 21340 x: px, 21341 y: px, 21342 z: px, 21343 perspective: px, 21344 transformPerspective: px, 21345 opacity: alpha, 21346 originX: progressPercentage, 21347 originY: progressPercentage, 21348 originZ: px, 21349}; 21350 21351 21352 21353;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs 21354 21355 21356const type_int_int = { 21357 ...number, 21358 transform: Math.round, 21359}; 21360 21361 21362 21363;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs 21364 21365 21366 21367 21368 21369 21370const numberValueTypes = { 21371 ...browserNumberValueTypes, 21372 ...transformValueTypes, 21373 zIndex: type_int_int, 21374 size: px, 21375 // SVG 21376 fillOpacity: alpha, 21377 strokeOpacity: alpha, 21378 numOctaves: type_int_int, 21379}; 21380 21381 21382 21383;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs 21384 21385 21386 21387 21388/** 21389 * A map of default value types for common values 21390 */ 21391const defaultValueTypes = { 21392 ...numberValueTypes, 21393 // Color props 21394 color: color, 21395 backgroundColor: color, 21396 outlineColor: color, 21397 fill: color, 21398 stroke: color, 21399 // Border props 21400 borderColor: color, 21401 borderTopColor: color, 21402 borderRightColor: color, 21403 borderBottomColor: color, 21404 borderLeftColor: color, 21405 filter: filter, 21406 WebkitFilter: filter, 21407}; 21408/** 21409 * Gets the default ValueType for the provided value key 21410 */ 21411const getDefaultValueType = (key) => defaultValueTypes[key]; 21412 21413 21414 21415;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs 21416 21417 21418 21419 21420function animatable_none_getAnimatableNone(key, value) { 21421 let defaultValueType = getDefaultValueType(key); 21422 if (defaultValueType !== filter) 21423 defaultValueType = complex; 21424 // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target 21425 return defaultValueType.getAnimatableNone 21426 ? defaultValueType.getAnimatableNone(value) 21427 : undefined; 21428} 21429 21430 21431 21432;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs 21433 21434 21435 21436/** 21437 * If we encounter keyframes like "none" or "0" and we also have keyframes like 21438 * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for 21439 * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into 21440 * zero equivalents, i.e. "#fff0" or "0px 0px". 21441 */ 21442const invalidTemplates = new Set(["auto", "none", "0"]); 21443function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { 21444 let i = 0; 21445 let animatableTemplate = undefined; 21446 while (i < unresolvedKeyframes.length && !animatableTemplate) {
vendor: 8,861 bytes, lines 21447-21703
21447 const keyframe = unresolvedKeyframes[i]; 21448 if (typeof keyframe === "string" && 21449 !invalidTemplates.has(keyframe) && 21450 analyseComplexValue(keyframe).values.length) { 21451 animatableTemplate = unresolvedKeyframes[i]; 21452 } 21453 i++; 21454 } 21455 if (animatableTemplate && name) { 21456 for (const noneIndex of noneKeyframeIndexes) { 21457 unresolvedKeyframes[noneIndex] = animatable_none_getAnimatableNone(name, animatableTemplate); 21458 } 21459 } 21460} 21461 21462 21463 21464;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/parse-transform.mjs 21465const radToDeg = (rad) => (rad * 180) / Math.PI; 21466const rotate = (v) => { 21467 const angle = radToDeg(Math.atan2(v[1], v[0])); 21468 return rebaseAngle(angle); 21469}; 21470const matrix2dParsers = { 21471 x: 4, 21472 y: 5, 21473 translateX: 4, 21474 translateY: 5, 21475 scaleX: 0, 21476 scaleY: 3, 21477 scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, 21478 rotate, 21479 rotateZ: rotate, 21480 skewX: (v) => radToDeg(Math.atan(v[1])), 21481 skewY: (v) => radToDeg(Math.atan(v[2])), 21482 skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, 21483}; 21484const rebaseAngle = (angle) => { 21485 angle = angle % 360; 21486 if (angle < 0) 21487 angle += 360; 21488 return angle; 21489}; 21490const rotateZ = rotate; 21491const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); 21492const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); 21493const matrix3dParsers = { 21494 x: 12, 21495 y: 13, 21496 z: 14, 21497 translateX: 12, 21498 translateY: 13, 21499 translateZ: 14, 21500 scaleX, 21501 scaleY, 21502 scale: (v) => (scaleX(v) + scaleY(v)) / 2, 21503 rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), 21504 rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), 21505 rotateZ, 21506 rotate: rotateZ, 21507 skewX: (v) => radToDeg(Math.atan(v[4])), 21508 skewY: (v) => radToDeg(Math.atan(v[1])), 21509 skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, 21510}; 21511function defaultTransformValue(name) { 21512 return name.includes("scale") ? 1 : 0; 21513} 21514function parseValueFromTransform(transform, name) { 21515 if (!transform || transform === "none") { 21516 return defaultTransformValue(name); 21517 } 21518 const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); 21519 let parsers; 21520 let match; 21521 if (matrix3dMatch) { 21522 parsers = matrix3dParsers; 21523 match = matrix3dMatch; 21524 } 21525 else { 21526 const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); 21527 parsers = matrix2dParsers; 21528 match = matrix2dMatch; 21529 } 21530 if (!match) { 21531 return defaultTransformValue(name); 21532 } 21533 const valueParser = parsers[name]; 21534 const values = match[1].split(",").map(convertTransformToNumber); 21535 return typeof valueParser === "function" 21536 ? valueParser(values) 21537 : values[valueParser]; 21538} 21539const readTransformValue = (instance, name) => { 21540 const { transform = "none" } = getComputedStyle(instance); 21541 return parseValueFromTransform(transform, name); 21542}; 21543function convertTransformToNumber(value) { 21544 return parseFloat(value.trim()); 21545} 21546 21547 21548 21549;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs 21550 21551 21552 21553 21554 21555const isNumOrPxType = (v) => v === number || v === px; 21556const transformKeys = new Set(["x", "y", "z"]); 21557const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); 21558function removeNonTranslationalTransform(visualElement) { 21559 const removedTransforms = []; 21560 nonTranslationalTransformKeys.forEach((key) => { 21561 const value = visualElement.getValue(key); 21562 if (value !== undefined) { 21563 removedTransforms.push([key, value.get()]); 21564 value.set(key.startsWith("scale") ? 1 : 0); 21565 } 21566 }); 21567 return removedTransforms; 21568} 21569const positionalValues = { 21570 // Dimensions 21571 width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight), 21572 height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom), 21573 top: (_bbox, { top }) => parseFloat(top), 21574 left: (_bbox, { left }) => parseFloat(left), 21575 bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), 21576 right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), 21577 // Transform 21578 x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), 21579 y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), 21580}; 21581// Alias translate longform names 21582positionalValues.translateX = positionalValues.x; 21583positionalValues.translateY = positionalValues.y; 21584 21585 21586 21587;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.mjs 21588 21589 21590 21591const toResolve = new Set(); 21592let isScheduled = false; 21593let anyNeedsMeasurement = false; 21594function measureAllKeyframes() { 21595 if (anyNeedsMeasurement) { 21596 const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); 21597 const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); 21598 const transformsToRestore = new Map(); 21599 /** 21600 * Write pass 21601 * If we're measuring elements we want to remove bounding box-changing transforms. 21602 */ 21603 elementsToMeasure.forEach((element) => { 21604 const removedTransforms = removeNonTranslationalTransform(element); 21605 if (!removedTransforms.length) 21606 return; 21607 transformsToRestore.set(element, removedTransforms); 21608 element.render(); 21609 }); 21610 // Read 21611 resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); 21612 // Write 21613 elementsToMeasure.forEach((element) => { 21614 element.render(); 21615 const restore = transformsToRestore.get(element); 21616 if (restore) { 21617 restore.forEach(([key, value]) => { 21618 var _a; 21619 (_a = element.getValue(key)) === null || _a === void 0 ? void 0 : _a.set(value); 21620 }); 21621 } 21622 }); 21623 // Read 21624 resolversToMeasure.forEach((resolver) => resolver.measureEndState()); 21625 // Write 21626 resolversToMeasure.forEach((resolver) => { 21627 if (resolver.suspendedScrollY !== undefined) { 21628 window.scrollTo(0, resolver.suspendedScrollY); 21629 } 21630 }); 21631 } 21632 anyNeedsMeasurement = false; 21633 isScheduled = false; 21634 toResolve.forEach((resolver) => resolver.complete()); 21635 toResolve.clear(); 21636} 21637function readAllKeyframes() { 21638 toResolve.forEach((resolver) => { 21639 resolver.readKeyframes(); 21640 if (resolver.needsMeasurement) { 21641 anyNeedsMeasurement = true; 21642 } 21643 }); 21644} 21645function flushKeyframeResolvers() { 21646 readAllKeyframes(); 21647 measureAllKeyframes(); 21648} 21649class KeyframeResolver { 21650 constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { 21651 /** 21652 * Track whether this resolver has completed. Once complete, it never 21653 * needs to attempt keyframe resolution again. 21654 */ 21655 this.isComplete = false; 21656 /** 21657 * Track whether this resolver is async. If it is, it'll be added to the 21658 * resolver queue and flushed in the next frame. Resolvers that aren't going 21659 * to trigger read/write thrashing don't need to be async. 21660 */ 21661 this.isAsync = false; 21662 /** 21663 * Track whether this resolver needs to perform a measurement 21664 * to resolve its keyframes. 21665 */ 21666 this.needsMeasurement = false; 21667 /** 21668 * Track whether this resolver is currently scheduled to resolve 21669 * to allow it to be cancelled and resumed externally. 21670 */ 21671 this.isScheduled = false; 21672 this.unresolvedKeyframes = [...unresolvedKeyframes]; 21673 this.onComplete = onComplete; 21674 this.name = name; 21675 this.motionValue = motionValue; 21676 this.element = element; 21677 this.isAsync = isAsync; 21678 } 21679 scheduleResolve() { 21680 this.isScheduled = true; 21681 if (this.isAsync) { 21682 toResolve.add(this); 21683 if (!isScheduled) { 21684 isScheduled = true; 21685 frame_frame.read(readAllKeyframes); 21686 frame_frame.resolveKeyframes(measureAllKeyframes); 21687 } 21688 } 21689 else { 21690 this.readKeyframes(); 21691 this.complete(); 21692 } 21693 } 21694 readKeyframes() { 21695 const { unresolvedKeyframes, name, element, motionValue } = this; 21696 /** 21697 * If a keyframe is null, we hydrate it either by reading it from 21698 * the instance, or propagating from previous keyframes. 21699 */ 21700 for (let i = 0; i < unresolvedKeyframes.length; i++) { 21701 if (unresolvedKeyframes[i] === null) { 21702 /** 21703 * If the first keyframe is null, we need to find its value b
21703y sampling the element 21704 */ 21705 if (i === 0) { 21706 const currentValue = motionValue === null || motionValue === void 0 ? void 0 : motionValue.get(); 21707 const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; 21708 if (currentValue !== undefined) { 21709 unresolvedKeyframes[0] = currentValue; 21710 } 21711 else if (element && name) { 21712 const valueAsRead = element.readValue(name, finalKeyframe); 21713 if (valueAsRead !== undefined && valueAsRead !== null) { 21714 unresolvedKeyframes[0] = valueAsRead; 21715 } 21716 } 21717 if (unresolvedKeyframes[0] === undefined) { 21718 unresolvedKeyframes[0] = finalKeyframe; 21719 } 21720 if (motionValue && currentValue === undefined) { 21721 motionValue.set(unresolvedKeyframes[0]); 21722 } 21723 } 21724 else { 21725 unresolvedKeyframes[i] = unresolvedKeyframes[i - 1]; 21726 } 21727 } 21728 } 21729 } 21730 setFinalKeyframe() { } 21731 measureInitialState() { } 21732 renderEndStyles() { } 21733 measureEndState() { } 21734 complete() { 21735 this.isComplete = true; 21736 this.onComplete(this.unresolvedKeyframes, this.finalKeyframe); 21737 toResolve.delete(this); 21738 } 21739 cancel() { 21740 if (!this.isComplete) { 21741 this.isScheduled = false; 21742 toResolve.delete(this); 21743 } 21744 } 21745 resume() { 21746 if (!this.isComplete) 21747 this.scheduleResolve(); 21748 } 21749} 21750 21751 21752 21753;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs 21754/** 21755 * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" 21756 */ 21757const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); 21758 21759 21760 21761;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs 21762const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); 21763const isCSSVariableName = 21764/*@__PURE__*/ checkStringStartsWith("--"); 21765const startsAsVariableToken = 21766/*@__PURE__*/ checkStringStartsWith("var(--"); 21767const isCSSVariableToken = (value) => { 21768 const startsWithToken = startsAsVariableToken(value); 21769 if (!startsWithToken) 21770 return false; 21771 // Ensure any comments are stripped from the value as this can harm performance of the regex. 21772 return singleCssVariableRegex.test(value.split("/*")[0].trim()); 21773}; 21774const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; 21775 21776 21777 21778;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs 21779 21780 21781 21782 21783/** 21784 * Parse Framer's special CSS variable format into a CSS token and a fallback. 21785 * 21786 * ``` 21787 * `var(--foo, #fff)` => [`--foo`, '#fff'] 21788 * ``` 21789 * 21790 * @param current 21791 */ 21792const splitCSSVariableRegex = 21793// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words 21794/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; 21795function parseCSSVariable(current) { 21796 const match = splitCSSVariableRegex.exec(current); 21797 if (!match) 21798 return [,]; 21799 const [, token1, token2, fallback] = match; 21800 return [`--${token1 !== null && token1 !== void 0 ? token1 : token2}`, fallback]; 21801} 21802const maxDepth = 4; 21803function getVariableValue(current, element, depth = 1) { 21804 invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`); 21805 const [token, fallback] = parseCSSVariable(current); 21806 // No CSS variable detected 21807 if (!token) 21808 return; 21809 // Attempt to read this CSS variable off the element 21810 const resolved = window.getComputedStyle(element).getPropertyValue(token); 21811 if (resolved) { 21812 const trimmed = resolved.trim(); 21813 return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; 21814 } 21815 return isCSSVariableToken(fallback) 21816 ? getVariableValue(fallback, element, depth + 1) 21817 : fallback; 21818} 21819 21820 21821 21822;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs 21823/** 21824 * Tests a provided value against a ValueType 21825 */ 21826const testValueType = (v) => (type) => type.test(v); 21827 21828 21829 21830;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs 21831/** 21832 * ValueType for "auto" 21833 */ 21834const auto = { 21835 test: (v) => v === "auto", 21836 parse: (v) => v, 21837}; 21838 21839 21840 21841;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs 21842 21843 21844 21845 21846 21847/** 21848 * A list of value types commonly used for dimensions 21849 */ 21850const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; 21851/** 21852 * Tests a dimensional value against the list of dimension ValueTypes 21853 */ 21854const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); 21855 21856 21857 21858;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs 21859 21860 21861 21862 21863 21864 21865 21866 21867 21868class DOMKeyframesResolver extends KeyframeResolver { 21869 constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { 21870 super(unresolvedKeyframes, onComplete, name, motionValue, element, true); 21871 } 21872 readKeyframes() { 21873 const { unresolvedKeyframes, element, name } = this; 21874 if (!element || !element.current) 21875 return; 21876 super.readKeyframes(); 21877 /** 21878 * If any keyframe is a CSS variable, we need to find its value b
vendor: 4,512 bytes, lines 21878-21978
21878y sampling the element 21879 */ 21880 for (let i = 0; i < unresolvedKeyframes.length; i++) { 21881 let keyframe = unresolvedKeyframes[i]; 21882 if (typeof keyframe === "string") { 21883 keyframe = keyframe.trim(); 21884 if (isCSSVariableToken(keyframe)) { 21885 const resolved = getVariableValue(keyframe, element.current); 21886 if (resolved !== undefined) { 21887 unresolvedKeyframes[i] = resolved; 21888 } 21889 if (i === unresolvedKeyframes.length - 1) { 21890 this.finalKeyframe = keyframe; 21891 } 21892 } 21893 } 21894 } 21895 /** 21896 * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. 21897 * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which 21898 * have a far bigger performance impact. 21899 */ 21900 this.resolveNoneKeyframes(); 21901 /** 21902 * Check to see if unit type has changed. If so schedule jobs that will 21903 * temporarily set styles to the destination keyframes. 21904 * Skip if we have more than two keyframes or this isn't a positional value. 21905 * TODO: We can throw if there are multiple keyframes and the value type changes. 21906 */ 21907 if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { 21908 return; 21909 } 21910 const [origin, target] = unresolvedKeyframes; 21911 const originType = findDimensionValueType(origin); 21912 const targetType = findDimensionValueType(target); 21913 /** 21914 * Either we don't recognise these value types or we can animate between them. 21915 */ 21916 if (originType === targetType) 21917 return; 21918 /** 21919 * If both values are numbers or pixels, we can animate between them by 21920 * converting them to numbers. 21921 */ 21922 if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { 21923 for (let i = 0; i < unresolvedKeyframes.length; i++) { 21924 const value = unresolvedKeyframes[i]; 21925 if (typeof value === "string") { 21926 unresolvedKeyframes[i] = parseFloat(value); 21927 } 21928 } 21929 } 21930 else { 21931 /** 21932 * Else, the only way to resolve this is by measuring the element. 21933 */ 21934 this.needsMeasurement = true; 21935 } 21936 } 21937 resolveNoneKeyframes() { 21938 const { unresolvedKeyframes, name } = this; 21939 const noneKeyframeIndexes = []; 21940 for (let i = 0; i < unresolvedKeyframes.length; i++) { 21941 if (isNone(unresolvedKeyframes[i])) { 21942 noneKeyframeIndexes.push(i); 21943 } 21944 } 21945 if (noneKeyframeIndexes.length) { 21946 makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); 21947 } 21948 } 21949 measureInitialState() { 21950 const { element, unresolvedKeyframes, name } = this; 21951 if (!element || !element.current) 21952 return; 21953 if (name === "height") { 21954 this.suspendedScrollY = window.pageYOffset; 21955 } 21956 this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); 21957 unresolvedKeyframes[0] = this.measuredOrigin; 21958 // Set final key frame to measure after next render 21959 const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; 21960 if (measureKeyframe !== undefined) { 21961 element.getValue(name, measureKeyframe).jump(measureKeyframe, false); 21962 } 21963 } 21964 measureEndState() { 21965 var _a; 21966 const { element, name, unresolvedKeyframes } = this; 21967 if (!element || !element.current) 21968 return; 21969 const value = element.getValue(name); 21970 value && value.jump(this.measuredOrigin, false); 21971 const finalKeyframeIndex = unresolvedKeyframes.length - 1; 21972 const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; 21973 unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); 21974 if (finalKeyframe !== null && this.finalKeyframe === undefined) { 21975 this.finalKeyframe = finalKeyframe; 21976 } 21977 // If we removed transform values, reapply them before the next render 21978 if ((_a = this.removedTransforms) === null || _a === void 0 ? void 0 : _a.length) {
21979 this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { 21980 element 21981 .getValue(unsetTransformName) 21982 .set(unsetTransformValue); 21983 }); 21984 } 21985 this.resolveNoneKeyframes(); 21986 } 21987} 21988 21989 21990 21991;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs 21992 21993 21994/** 21995 * Check if a value is animatable. Examples: 21996 * 21997 * â : 100, "100px", "#fff" 21998 * â: "block", "url(2.jpg)" 21999 * @param value 22000 * 22001 * @internal 22002 */ 22003const isAnimatable = (value, name) => { 22004 // If the list of keys tat might be non-animatable grows, replace with Set 22005 if (name === "zIndex") 22006 return false; 22007 // If it's a number or a keyframes array, we can animate it. We might at some point 22008 // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, 22009 // but for now lets leave it like this for performance reasons 22010 if (typeof value === "number" || Array.isArray(value)) 22011 return true; 22012 if (typeof value === "string" && // It's animatable if we have a string 22013 (complex.test(value) || value === "0") && // And it contains numbers and/or colors 22014 !value.startsWith("url(") // Unless it starts with "url(" 22015 ) { 22016 return true; 22017 } 22018 return false; 22019}; 22020 22021 22022 22023;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/utils/can-animate.mjs 22024 22025 22026 22027 22028function hasKeyframesChanged(keyframes) { 22029 const current = keyframes[0]; 22030 if (keyframes.length === 1) 22031 return true; 22032 for (let i = 0; i < keyframes.length; i++) { 22033 if (keyframes[i] !== current) 22034 return true; 22035 } 22036} 22037function canAnimate(keyframes, name, type, velocity) { 22038 /** 22039 * Check if we're able to animate between the start and end keyframes, 22040 * and throw a warning if we're attempting to animate between one that's 22041 * animatable and another that isn't. 22042 */ 22043 const originKeyframe = keyframes[0]; 22044 if (originKeyframe === null) 22045 return false; 22046 /** 22047 * These aren't traditionally animatable but we do support them. 22048 * In future we could look into making this more generic or replacing 22049 * this function with mix() === mixImmediate 22050 */ 22051 if (name === "display" || name === "visibility") 22052 return true; 22053 const targetKeyframe = keyframes[keyframes.length - 1]; 22054 const isOriginAnimatable = isAnimatable(originKeyframe, name); 22055 const isTargetAnimatable = isAnimatable(targetKeyframe, name); 22056 warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \`style\` property.`); 22057 // Always skip if any of these are true 22058 if (!isOriginAnimatable || !isTargetAnimatable) { 22059 return false; 22060 } 22061 return (hasKeyframesChanged(keyframes) || 22062 ((type === "spring" || isGenerator(type)) && velocity)); 22063} 22064 22065 22066 22067;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs 22068const isNotNull = (value) => value !== null; 22069function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe) { 22070 const resolvedKeyframes = keyframes.filter(isNotNull); 22071 const index = repeat && repeatType !== "loop" && repeat % 2 === 1 22072 ? 0 22073 : resolvedKeyframes.length - 1; 22074 return !index || finalKeyframe === undefined 22075 ? resolvedKeyframes[index] 22076 : finalKeyframe; 22077} 22078 22079 22080 22081;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs 22082 22083 22084 22085 22086 22087 22088/** 22089 * Maximum time allowed between an animation being created and it being 22090 * resolved for us to use the latter as the start time. 22091 * 22092 * This is to ensure that while we prefer to "start" an animation as soon 22093 * as it's triggered, we also want to avoid a visual jump if there's a big delay 22094 * between these two moments. 22095 */ 22096const MAX_RESOLVE_DELAY = 40; 22097class BaseAnimation { 22098 constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", ...options }) { 22099 // Track whether the animation has been stopped. Stopped animations won't restart. 22100 this.isStopped = false;
22101 this.hasAttemptedResolve = false; 22102 this.createdAt = time.now(); 22103 this.options = { 22104 autoplay, 22105 delay, 22106 type, 22107 repeat, 22108 repeatDelay, 22109 repeatType, 22110 ...options, 22111 }; 22112 this.updateFinishedPromise(); 22113 } 22114 /** 22115 * This method uses the createdAt and resolvedAt to calculate the 22116 * animation startTime. *Ideally*, we would use the createdAt time as t=0 22117 * as the following frame would then be the first frame of the animation in 22118 * progress, which would feel snappier. 22119 * 22120 * However, if there's a delay (main thread work) between the creation of 22121 * the animation and the first commited frame, we prefer to use resolvedAt 22122 * to avoid a sudden jump into the animation. 22123 */ 22124 calcStartTime() { 22125 if (!this.resolvedAt) 22126 return this.createdAt; 22127 return this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY 22128 ? this.resolvedAt 22129 : this.createdAt; 22130 } 22131 /** 22132 * A getter for resolved data. If keyframes are not yet resolved, accessing 22133 * this.resolved will synchronously flush all pending keyframe resolvers. 22134 * This is a deoptimisation, but at its worst still batches read/writes. 22135 */ 22136 get resolved() { 22137 if (!this._resolved && !this.hasAttemptedResolve) { 22138 flushKeyframeResolvers(); 22139 } 22140 return this._resolved; 22141 } 22142 /** 22143 * A method to be called when the keyframes resolver completes. This method 22144 * will check if its possible to run the animation and, if not, skip it. 22145 * Otherwise, it will call initPlayback on the implementing class. 22146 */ 22147 onKeyframesResolved(keyframes, finalKeyframe) { 22148 this.resolvedAt = time.now(); 22149 this.hasAttemptedResolve = true; 22150 const { name, type, velocity, delay, onComplete, onUpdate, isGenerator, } = this.options; 22151 /** 22152 * If we can't animate this value with the resolved keyframes 22153 * then we should complete it immediately. 22154 */ 22155 if (!isGenerator && !canAnimate(keyframes, name, type, velocity)) { 22156 // Finish immediately 22157 if (instantAnimationState.current || !delay) { 22158 onUpdate && 22159 onUpdate(getFinalKeyframe(keyframes, this.options, finalKeyframe)); 22160 onComplete && onComplete(); 22161 this.resolveFinishedPromise(); 22162 return; 22163 } 22164 // Finish after a delay 22165 else { 22166 this.options.duration = 0; 22167 } 22168 } 22169 const resolvedAnimation = this.initPlayback(keyframes, finalKeyframe); 22170 if (resolvedAnimation === false) 22171 return; 22172 this._resolved = { 22173 keyframes, 22174 finalKeyframe, 22175 ...resolvedAnimation, 22176 }; 22177 this.onPostResolved(); 22178 } 22179 onPostResolved() { } 22180 /** 22181 * Allows the returned animation to be awaited or promise-chained. Currently 22182 * resolves when the animation finishes at all but in a future update could/should 22183 * reject if its cancels. 22184 */ 22185 then(resolve, reject) { 22186 return this.currentFinishedPromise.then(resolve, reject); 22187 } 22188 flatten() { 22189 if (!this.options.allowFlatten) 22190 return; 22191 this.options.type = "keyframes"; 22192 this.options.ease = "linear"; 22193 } 22194 updateFinishedPromise() { 22195 this.currentFinishedPromise = new Promise((resolve) => { 22196 this.resolveFinishedPromise = resolve; 22197 }); 22198 } 22199} 22200 22201 22202 22203;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/mix/number.mjs 22204/* 22205 Value in range from progress 22206 22207 Given a lower limit and an upper limit, we return the value within 22208 that range as expressed by progress (usually a number from 0 to 1) 22209 22210 So progress = 0.5 would change 22211 22212 from -------- to 22213 22214 to 22215 22216 from ---- to 22217 22218 E.g. from = 10, to = 20, progress = 0.5 => 15 22219 22220 @param [number]: Lower limit of range 22221 @param [number]: Upper limit of range 22222 @param [number]: The progress between lower and upper limits expressed 0-1 22223 @return [number]: Value as calculated from progress within range (not limited within range) 22224*/ 22225const mixNumber = (from, to, progress) => { 22226 return from + (to - from) * progress; 22227}; 22228 22229 22230 22231;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs 22232// Adapted from https://gist.github.com/mjackson/5311256 22233function hueToRgb(p, q, t) { 22234 if (t < 0) 22235 t += 1; 22236 if (t > 1) 22237 t -= 1; 22238 if (t < 1 / 6) 22239 return p + (q - p) * 6 * t; 22240 if (t < 1 / 2) 22241 return q; 22242 if (t < 2 / 3) 22243 return p + (q - p) * (2 / 3 - t) * 6; 22244 return p; 22245} 22246function hslaToRgba({ hue, saturation, lightness, alpha }) { 22247 hue /= 360; 22248 saturation /= 100; 22249 lightness /= 100; 22250 let red = 0; 22251 let green = 0; 22252 let blue = 0; 22253 if (!saturation) { 22254 red = green = blue = lightness; 22255 } 22256 else { 22257 const q = lightness < 0.5 22258 ? lightness * (1 + saturation) 22259 : lightness + saturation - lightness * saturation; 22260 const p = 2 * lightness - q; 22261 red = hueToRgb(p, q, hue + 1 / 3); 22262 green = hueToRgb(p, q, hue); 22263 blue = hueToRgb(p, q, hue - 1 / 3); 22264 } 22265 return { 22266 red: Math.round(red * 255), 22267 green: Math.round(green * 255), 22268 blue: Math.round(blue * 255), 22269 alpha, 22270 }; 22271} 22272 22273 22274 22275;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/mix/immediate.mjs 22276function mixImmediate(a, b) { 22277 return (p) => (p > 0 ? b : a); 22278} 22279 22280 22281 22282;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/mix/color.mjs 22283 22284 22285 22286 22287 22288 22289 22290
vendor: 17,689 bytes, lines 22291-22796
22291// Linear color space blending 22292// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw 22293// Demonstrated http://codepen.io/osublake/pen/xGVVaN 22294const mixLinearColor = (from, to, v) => { 22295 const fromExpo = from * from; 22296 const expo = v * (to * to - fromExpo) + fromExpo; 22297 return expo < 0 ? 0 : Math.sqrt(expo); 22298}; 22299const colorTypes = [hex, rgba, hsla]; 22300const getColorType = (v) => colorTypes.find((type) => type.test(v)); 22301function asRGBA(color) { 22302 const type = getColorType(color); 22303 warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`); 22304 if (!Boolean(type)) 22305 return false; 22306 let model = type.parse(color); 22307 if (type === hsla) { 22308 // TODO Remove this cast - needed since Motion's stricter typing 22309 model = hslaToRgba(model); 22310 } 22311 return model; 22312} 22313const mixColor = (from, to) => { 22314 const fromRGBA = asRGBA(from); 22315 const toRGBA = asRGBA(to); 22316 if (!fromRGBA || !toRGBA) { 22317 return mixImmediate(from, to); 22318 } 22319 const blended = { ...fromRGBA }; 22320 return (v) => { 22321 blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); 22322 blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); 22323 blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); 22324 blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v); 22325 return rgba.transform(blended); 22326 }; 22327}; 22328 22329 22330 22331;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/pipe.mjs 22332/** 22333 * Pipe 22334 * Compose other transformers to run linearily 22335 * pipe(min(20), max(40)) 22336 * @param {...functions} transformers 22337 * @return {function} 22338 */ 22339const combineFunctions = (a, b) => (v) => b(a(v)); 22340const pipe = (...transformers) => transformers.reduce(combineFunctions); 22341 22342 22343 22344;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/mix/visibility.mjs 22345const invisibleValues = new Set(["none", "hidden"]); 22346/** 22347 * Returns a function that, when provided a progress value between 0 and 1, 22348 * will return the "none" or "hidden" string only when the progress is that of 22349 * the origin or target. 22350 */ 22351function mixVisibility(origin, target) { 22352 if (invisibleValues.has(origin)) { 22353 return (p) => (p <= 0 ? origin : target); 22354 } 22355 else { 22356 return (p) => (p >= 1 ? target : origin); 22357 } 22358} 22359 22360 22361 22362;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/mix/complex.mjs 22363 22364 22365 22366 22367 22368 22369 22370 22371 22372 22373function complex_mixNumber(a, b) { 22374 return (p) => mixNumber(a, b, p); 22375} 22376function getMixer(a) { 22377 if (typeof a === "number") { 22378 return complex_mixNumber; 22379 } 22380 else if (typeof a === "string") { 22381 return isCSSVariableToken(a) 22382 ? mixImmediate 22383 : color.test(a) 22384 ? mixColor 22385 : mixComplex; 22386 } 22387 else if (Array.isArray(a)) { 22388 return mixArray; 22389 } 22390 else if (typeof a === "object") { 22391 return color.test(a) ? mixColor : mixObject; 22392 } 22393 return mixImmediate; 22394} 22395function mixArray(a, b) { 22396 const output = [...a]; 22397 const numValues = output.length; 22398 const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); 22399 return (p) => { 22400 for (let i = 0; i < numValues; i++) { 22401 output[i] = blendValue[i](p); 22402 } 22403 return output; 22404 }; 22405} 22406function mixObject(a, b) { 22407 const output = { ...a, ...b }; 22408 const blendValue = {}; 22409 for (const key in output) { 22410 if (a[key] !== undefined && b[key] !== undefined) { 22411 blendValue[key] = getMixer(a[key])(a[key], b[key]); 22412 } 22413 } 22414 return (v) => { 22415 for (const key in blendValue) { 22416 output[key] = blendValue[key](v); 22417 } 22418 return output; 22419 }; 22420} 22421function matchOrder(origin, target) { 22422 var _a; 22423 const orderedOrigin = []; 22424 const pointers = { color: 0, var: 0, number: 0 }; 22425 for (let i = 0; i < target.values.length; i++) { 22426 const type = target.types[i]; 22427 const originIndex = origin.indexes[type][pointers[type]]; 22428 const originValue = (_a = origin.values[originIndex]) !== null && _a !== void 0 ? _a : 0; 22429 orderedOrigin[i] = originValue; 22430 pointers[type]++; 22431 } 22432 return orderedOrigin; 22433} 22434const mixComplex = (origin, target) => { 22435 const template = complex.createTransformer(target); 22436 const originStats = analyseComplexValue(origin); 22437 const targetStats = analyseComplexValue(target); 22438 const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && 22439 originStats.indexes.color.length === targetStats.indexes.color.length && 22440 originStats.indexes.number.length >= targetStats.indexes.number.length; 22441 if (canInterpolate) { 22442 if ((invisibleValues.has(origin) && 22443 !targetStats.values.length) || 22444 (invisibleValues.has(target) && 22445 !originStats.values.length)) { 22446 return mixVisibility(origin, target); 22447 } 22448 return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); 22449 } 22450 else { 22451 warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`); 22452 return mixImmediate(origin, target); 22453 } 22454}; 22455 22456 22457 22458;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/mix/index.mjs 22459 22460 22461 22462function mix(from, to, p) { 22463 if (typeof from === "number" && 22464 typeof to === "number" && 22465 typeof p === "number") { 22466 return mixNumber(from, to, p); 22467 } 22468 const mixer = getMixer(from); 22469 return mixer(from, to); 22470} 22471 22472 22473 22474;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs 22475 22476 22477const velocitySampleDuration = 5; // ms 22478function calcGeneratorVelocity(resolveValue, t, current) { 22479 const prevT = Math.max(t - velocitySampleDuration, 0); 22480 return velocityPerSecond(current - resolveValue(prevT), t - prevT); 22481} 22482 22483 22484 22485;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/generators/spring/defaults.mjs 22486const springDefaults = { 22487 // Default spring physics 22488 stiffness: 100, 22489 damping: 10, 22490 mass: 1.0, 22491 velocity: 0.0, 22492 // Default duration/bounce-based options 22493 duration: 800, // in ms 22494 bounce: 0.3, 22495 visualDuration: 0.3, // in seconds 22496 // Rest thresholds 22497 restSpeed: { 22498 granular: 0.01, 22499 default: 2, 22500 }, 22501 restDelta: { 22502 granular: 0.005, 22503 default: 0.5, 22504 }, 22505 // Limits 22506 minDuration: 0.01, // in seconds 22507 maxDuration: 10.0, // in seconds 22508 minDamping: 0.05, 22509 maxDamping: 1, 22510}; 22511 22512 22513 22514;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs 22515 22516 22517 22518 22519const safeMin = 0.001; 22520function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { 22521 let envelope; 22522 let derivative; 22523 warning(duration <= time_conversion_secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less"); 22524 let dampingRatio = 1 - bounce; 22525 /** 22526 * Restrict dampingRatio and duration to within acceptable ranges. 22527 */ 22528 dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); 22529 duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); 22530 if (dampingRatio < 1) { 22531 /** 22532 * Underdamped spring 22533 */ 22534 envelope = (undampedFreq) => { 22535 const exponentialDecay = undampedFreq * dampingRatio; 22536 const delta = exponentialDecay * duration; 22537 const a = exponentialDecay - velocity; 22538 const b = calcAngularFreq(undampedFreq, dampingRatio); 22539 const c = Math.exp(-delta); 22540 return safeMin - (a / b) * c; 22541 }; 22542 derivative = (undampedFreq) => { 22543 const exponentialDecay = undampedFreq * dampingRatio; 22544 const delta = exponentialDecay * duration; 22545 const d = delta * velocity + velocity; 22546 const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; 22547 const f = Math.exp(-delta); 22548 const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); 22549 const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; 22550 return (factor * ((d - e) * f)) / g; 22551 }; 22552 } 22553 else { 22554 /** 22555 * Critically-damped spring 22556 */ 22557 envelope = (undampedFreq) => { 22558 const a = Math.exp(-undampedFreq * duration); 22559 const b = (undampedFreq - velocity) * duration + 1; 22560 return -safeMin + a * b; 22561 }; 22562 derivative = (undampedFreq) => { 22563 const a = Math.exp(-undampedFreq * duration); 22564 const b = (velocity - undampedFreq) * (duration * duration); 22565 return a * b; 22566 }; 22567 } 22568 const initialGuess = 5 / duration; 22569 const undampedFreq = approximateRoot(envelope, derivative, initialGuess); 22570 duration = time_conversion_secondsToMilliseconds(duration); 22571 if (isNaN(undampedFreq)) { 22572 return { 22573 stiffness: springDefaults.stiffness, 22574 damping: springDefaults.damping, 22575 duration, 22576 }; 22577 } 22578 else { 22579 const stiffness = Math.pow(undampedFreq, 2) * mass; 22580 return { 22581 stiffness, 22582 damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), 22583 duration, 22584 }; 22585 } 22586} 22587const rootIterations = 12; 22588function approximateRoot(envelope, derivative, initialGuess) { 22589 let result = initialGuess; 22590 for (let i = 1; i < rootIterations; i++) { 22591 result = result - envelope(result) / derivative(result); 22592 } 22593 return result; 22594} 22595function calcAngularFreq(undampedFreq, dampingRatio) { 22596 return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); 22597} 22598 22599 22600 22601;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs 22602 22603 22604 22605 22606 22607 22608 22609const durationKeys = ["duration", "bounce"]; 22610const physicsKeys = ["stiffness", "damping", "mass"]; 22611function isSpringType(options, keys) { 22612 return keys.some((key) => options[key] !== undefined); 22613} 22614function getSpringOptions(options) { 22615 let springOptions = { 22616 velocity: springDefaults.velocity, 22617 stiffness: springDefaults.stiffness, 22618 damping: springDefaults.damping, 22619 mass: springDefaults.mass, 22620 isResolvedFromDuration: false, 22621 ...options, 22622 }; 22623 // stiffness/damping/mass overrides duration/bounce 22624 if (!isSpringType(options, physicsKeys) && 22625 isSpringType(options, durationKeys)) { 22626 if (options.visualDuration) { 22627 const visualDuration = options.visualDuration; 22628 const root = (2 * Math.PI) / (visualDuration * 1.2); 22629 const stiffness = root * root; 22630 const damping = 2 * 22631 clamp(0.05, 1, 1 - (options.bounce || 0)) * 22632 Math.sqrt(stiffness); 22633 springOptions = { 22634 ...springOptions, 22635 mass: springDefaults.mass, 22636 stiffness, 22637 damping, 22638 }; 22639 } 22640 else { 22641 const derived = findSpring(options); 22642 springOptions = { 22643 ...springOptions, 22644 ...derived, 22645 mass: springDefaults.mass, 22646 }; 22647 springOptions.isResolvedFromDuration = true; 22648 } 22649 } 22650 return springOptions; 22651} 22652function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { 22653 const options = typeof optionsOrVisualDuration !== "object" 22654 ? { 22655 visualDuration: optionsOrVisualDuration, 22656 keyframes: [0, 1], 22657 bounce, 22658 } 22659 : optionsOrVisualDuration; 22660 let { restSpeed, restDelta } = options; 22661 const origin = options.keyframes[0]; 22662 const target = options.keyframes[options.keyframes.length - 1]; 22663 /** 22664 * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator 22665 * to reduce GC during animation. 22666 */ 22667 const state = { done: false, value: origin }; 22668 const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ 22669 ...options, 22670 velocity: -millisecondsToSeconds(options.velocity || 0), 22671 }); 22672 const initialVelocity = velocity || 0.0; 22673 const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); 22674 const initialDelta = target - origin; 22675 const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); 22676 /** 22677 * If we're working on a granular scale, use smaller defaults for determining 22678 * when the spring is finished. 22679 * 22680 * These defaults have been selected emprically based on what strikes a good 22681 * ratio between feeling good and finishing as soon as changes are imperceptible. 22682 */ 22683 const isGranularScale = Math.abs(initialDelta) < 5; 22684 restSpeed || (restSpeed = isGranularScale 22685 ? springDefaults.restSpeed.granular 22686 : springDefaults.restSpeed.default); 22687 restDelta || (restDelta = isGranularScale 22688 ? springDefaults.restDelta.granular 22689 : springDefaults.restDelta.default); 22690 let resolveSpring; 22691 if (dampingRatio < 1) { 22692 const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); 22693 // Underdamped spring 22694 resolveSpring = (t) => { 22695 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); 22696 return (target - 22697 envelope * 22698 (((initialVelocity + 22699 dampingRatio * undampedAngularFreq * initialDelta) / 22700 angularFreq) * 22701 Math.sin(angularFreq * t) + 22702 initialDelta * Math.cos(angularFreq * t))); 22703 }; 22704 } 22705 else if (dampingRatio === 1) { 22706 // Critically damped spring 22707 resolveSpring = (t) => target - 22708 Math.exp(-undampedAngularFreq * t) * 22709 (initialDelta + 22710 (initialVelocity + undampedAngularFreq * initialDelta) * t); 22711 } 22712 else { 22713 // Overdamped spring 22714 const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); 22715 resolveSpring = (t) => { 22716 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); 22717 // When performing sinh or cosh values can hit Infinity so we cap them here 22718 const freqForT = Math.min(dampedAngularFreq * t, 300); 22719 return (target - 22720 (envelope * 22721 ((initialVelocity + 22722 dampingRatio * undampedAngularFreq * initialDelta) * 22723 Math.sinh(freqForT) + 22724 dampedAngularFreq * 22725 initialDelta * 22726 Math.cosh(freqForT))) / 22727 dampedAngularFreq); 22728 }; 22729 } 22730 const generator = { 22731 calculatedDuration: isResolvedFromDuration ? duration || null : null, 22732 next: (t) => { 22733 const current = resolveSpring(t); 22734 if (!isResolvedFromDuration) { 22735 let currentVelocity = 0.0; 22736 /** 22737 * We only need to calculate velocity for under-damped springs 22738 * as over- and critically-damped springs can't overshoot, so 22739 * checking only for displacement is enough. 22740 */ 22741 if (dampingRatio < 1) { 22742 currentVelocity = 22743 t === 0 22744 ? time_conversion_secondsToMilliseconds(initialVelocity) 22745 : calcGeneratorVelocity(resolveSpring, t, current); 22746 } 22747 const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; 22748 const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta; 22749 state.done = 22750 isBelowVelocityThreshold && isBelowDisplacementThreshold; 22751 } 22752 else { 22753 state.done = t >= duration; 22754 } 22755 state.value = state.done ? target : current; 22756 return state; 22757 }, 22758 toString: () => { 22759 const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); 22760 const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); 22761 return calculatedDuration + "ms " + easing; 22762 }, 22763 }; 22764 return generator; 22765} 22766 22767 22768 22769;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/generators/inertia.mjs 22770 22771 22772 22773function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { 22774 const origin = keyframes[0]; 22775 const state = { 22776 done: false, 22777 value: origin, 22778 }; 22779 const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); 22780 const nearestBoundary = (v) => { 22781 if (min === undefined) 22782 return max; 22783 if (max === undefined) 22784 return min; 22785 return Math.abs(min - v) < Math.abs(max - v) ? min : max; 22786 }; 22787 let amplitude = power * velocity; 22788 const ideal = origin + amplitude; 22789 const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); 22790 /** 22791 * If the target has changed we need to re-calculate the amplitude, otherwise 22792 * the animation will start from the wrong position. 22793 */ 22794 if (target !== ideal) 22795 amplitude = target - origin; 22796 const calcDelta = (t) =>
22796 -amplitude * Math.exp(-t / timeConstant); 22797 const calcLatest = (t) => target + calcDelta(t); 22798 const applyFriction = (t) => { 22799 const delta = calcDelta(t); 22800 const latest = calcLatest(t); 22801 state.done = Math.abs(delta) <= restDelta; 22802 state.value = state.done ? target : latest; 22803 }; 22804 /** 22805 * Ideally this would resolve for t in a stateless way, we could 22806 * do that by always precalculating the animation but as we know 22807 * this will be done anyway we can assume that spring will 22808 * be discovered during that. 22809 */ 22810 let timeReachedBoundary; 22811 let spring$1; 22812 const checkCatchBoundary = (t) => { 22813 if (!isOutOfBounds(state.value)) 22814 return; 22815 timeReachedBoundary = t; 22816 spring$1 = spring({ 22817 keyframes: [state.value, nearestBoundary(state.value)], 22818 velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 22819 damping: bounceDamping, 22820 stiffness: bounceStiffness, 22821 restDelta, 22822 restSpeed, 22823 }); 22824 }; 22825 checkCatchBoundary(0); 22826 return { 22827 calculatedDuration: null, 22828 next: (t) => { 22829 /** 22830 * We need to resolve the friction to figure out if we need a 22831 * spring but we don't want to do this twice per frame. So here 22832 * we flag if we updated for this frame and later if we did 22833 * we can skip doing it again. 22834 */ 22835 let hasUpdatedFrame = false; 22836 if (!spring$1 && timeReachedBoundary === undefined) { 22837 hasUpdatedFrame = true; 22838 applyFriction(t); 22839 checkCatchBoundary(t); 22840 } 22841 /** 22842 * If we have a spring and the provided t is beyond the moment the friction 22843 * animation crossed the min/max boundary, use the spring. 22844 */ 22845 if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { 22846 return spring$1.next(t - timeReachedBoundary); 22847 } 22848 else { 22849 !hasUpdatedFrame && applyFriction(t); 22850 return state; 22851 } 22852 }, 22853 }; 22854} 22855 22856 22857 22858;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/ease.mjs 22859 22860 22861const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); 22862const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); 22863const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); 22864 22865 22866 22867;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs 22868const isEasingArray = (ease) => { 22869 return Array.isArray(ease) && typeof ease[0] !== "number"; 22870}; 22871 22872 22873 22874;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/utils/map.mjs 22875 22876 22877 22878 22879 22880 22881 22882 22883const easingLookup = { 22884 linear: noop_noop, 22885 easeIn: easeIn, 22886 easeInOut: easeInOut, 22887 easeOut: easeOut, 22888 circIn: circIn, 22889 circInOut: circInOut, 22890 circOut: circOut, 22891 backIn: backIn, 22892 backInOut: backInOut, 22893 backOut: backOut, 22894 anticipate: anticipate, 22895}; 22896const easingDefinitionToFunction = (definition) => { 22897 if (isBezierDefinition(definition)) { 22898 // If cubic bezier definition, create bezier curve 22899 invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`); 22900 const [x1, y1, x2, y2] = definition; 22901 return cubicBezier(x1, y1, x2, y2); 22902 } 22903 else if (typeof definition === "string") { 22904 // Else lookup from table 22905 invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`); 22906 return easingLookup[definition]; 22907 } 22908 return definition; 22909}; 22910 22911 22912 22913;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/interpolate.mjs 22914 22915 22916 22917 22918 22919function createMixers(output, ease, customMixer) { 22920 const mixers = []; 22921 const mixerFactory = customMixer || mix; 22922 const numMixers = output.length - 1; 22923 for (let i = 0; i < numMixers; i++) { 22924 let mixer = mixerFactory(output[i], output[i + 1]); 22925 if (ease) { 22926 const easingFunction = Array.isArray(ease) ? ease[i] || noop_noop : ease; 22927 mixer = pipe(easingFunction, mixer); 22928 } 22929 mixers.push(mixer); 22930 } 22931 return mixers; 22932} 22933/** 22934 * Create a function that maps from a numerical input array to a generic output array. 22935 * 22936 * Accepts: 22937 * - Numbers 22938 * - Colors (hex, hsl, hsla, rgb, rgba) 22939 * - Complex (combinations of one or more numbers or strings) 22940 * 22941 * ```jsx 22942 * const mixColor = interpolate([0, 1], ['#fff', '#000']) 22943 * 22944 * mixColor(0.5) // 'rgba(128, 128, 128, 1)' 22945 * ``` 22946 * 22947 * TODO Revist this approach once we've moved to data models for values, 22948 * probably not needed to pregenerate mixer functions. 22949 * 22950 * @public 22951 */ 22952function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { 22953 const inputLength = input.length; 22954 invariant(inputLength === output.length, "Both input and output ranges must be the same length"); 22955 /** 22956 * If we're only provided a single input, we can just make a function 22957 * that returns the output. 22958 */ 22959 if (inputLength === 1) 22960 return () => output[0]; 22961 if (inputLength === 2 && output[0] === output[1]) 22962 return () => output[1]; 22963 const isZeroDeltaRange = input[0] === input[1]; 22964 // If input runs highest -> lowest, reverse both arrays 22965 if (input[0] >
22965 input[inputLength - 1]) { 22966 input = [...input].reverse(); 22967 output = [...output].reverse(); 22968 } 22969 const mixers = createMixers(output, ease, mixer); 22970 const numMixers = mixers.length; 22971 const interpolator = (v) => { 22972 if (isZeroDeltaRange && v < input[0]) 22973 return output[0]; 22974 let i = 0; 22975 if (numMixers > 1) { 22976 for (; i < input.length - 2; i++) { 22977 if (v < input[i + 1]) 22978 break; 22979 } 22980 } 22981 const progressInRange = progress(input[i], input[i + 1], v); 22982 return mixers[i](progressInRange); 22983 }; 22984 return isClamp 22985 ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) 22986 : interpolator; 22987} 22988 22989 22990 22991;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/offsets/fill.mjs 22992 22993 22994 22995function fillOffset(offset, remaining) { 22996 const min = offset[offset.length - 1]; 22997 for (let i = 1; i <= remaining; i++) { 22998 const offsetProgress = progress(0, remaining, i); 22999 offset.push(mixNumber(min, 1, offsetProgress)); 23000 } 23001} 23002 23003 23004 23005;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/offsets/default.mjs 23006 23007 23008function defaultOffset(arr) { 23009 const offset = [0]; 23010 fillOffset(offset, arr.length - 1); 23011 return offset; 23012} 23013 23014 23015 23016;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/offsets/time.mjs 23017function convertOffsetToTimes(offset, duration) { 23018 return offset.map((o) => o * duration); 23019} 23020 23021 23022 23023;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs 23024 23025 23026 23027 23028 23029 23030 23031function keyframes_defaultEasing(values, easing) { 23032 return values.map(() => easing || easeInOut).splice(0, values.length - 1); 23033} 23034function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { 23035 /** 23036 * Easing functions can be externally defined as strings. Here we convert them 23037 * into actual functions. 23038 */ 23039 const easingFunctions = isEasingArray(ease) 23040 ? ease.map(easingDefinitionToFunction) 23041 : easingDefinitionToFunction(ease); 23042 /** 23043 * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator 23044 * to reduce GC during animation. 23045 */ 23046 const state = { 23047 done: false, 23048 value: keyframeValues[0], 23049 }; 23050 /** 23051 * Create a times array based on the provided 0-1 offsets 23052 */ 23053 const absoluteTimes = convertOffsetToTimes( 23054 // Only use the provided offsets if they're the correct length 23055 // TODO Maybe we should warn here if there's a length mismatch 23056 times && times.length === keyframeValues.length 23057 ? times 23058 : defaultOffset(keyframeValues), duration); 23059 const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { 23060 ease: Array.isArray(easingFunctions) 23061 ? easingFunctions 23062 : keyframes_defaultEasing(keyframeValues, easingFunctions), 23063 }); 23064 return { 23065 calculatedDuration: duration, 23066 next: (t) => { 23067 state.value = mapTimeToKeyframe(t); 23068 state.done = t >= duration; 23069 return state; 23070 }, 23071 }; 23072} 23073 23074 23075 23076;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs 23077 23078 23079const frameloopDriver = (update) => { 23080 const passTimestamp = ({ timestamp }) => update(timestamp); 23081 return { 23082 start: () => frame_frame.update(passTimestamp, true), 23083 stop: () => frame_cancelFrame(passTimestamp), 23084 /** 23085 * If we're processing this frame we can use the 23086 * framelocked timestamp to keep things in sync. 23087 */ 23088 now: () => (frame_frameData.isProcessing ? frame_frameData.timestamp : time.now()), 23089 }; 23090}; 23091 23092 23093 23094;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs 23095 23096 23097 23098 23099 23100 23101 23102 23103 23104 23105 23106 23107 23108const generators = { 23109 decay: inertia, 23110 inertia: inertia, 23111 tween: keyframes, 23112 keyframes: keyframes, 23113 spring: spring, 23114}; 23115const percentToProgress = (percent) => percent / 100; 23116/** 23117 * Animation that runs on the main thread. Designed to be WAAPI-spec in the subset of 23118 * features we expose publically. Mostly the compatibility is to ensure visual identity 23119 * between both WAAPI and main thread animations. 23120 */ 23121class MainThreadAnimation extends BaseAnimation { 23122 constructor(options) { 23123 super(options); 23124 /** 23125 * The time at which the animation was paused. 23126 */ 23127 this.holdTime = null; 23128 /** 23129 * The time at which the animation was cancelled. 23130 */ 23131 this.cancelTime = null; 23132 /** 23133 * The current time of the animation. 23134 */ 23135 this.currentTime = 0; 23136 /** 23137 * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. 23138 */ 23139 this.playbackSpeed = 1; 23140 /** 23141 * The state of the animation to apply when the animation is resolved. This 23142 * allows calls to the public API to control the animation before it is resolved, 23143 * without us having to resolve it first. 23144 */ 23145 this.pendingPlayState = "running"; 23146 /** 23147 * The time at which the animation was started. 23148 */ 23149 this.startTime = null; 23150 this.state = "idle"; 23151 /** 23152 * This method is bound to the instance to fix a pattern where 23153 * animation.stop is returned as a reference from a useEffect. 23154 */ 23155 this.stop = () => { 23156 this.resolver.cancel(); 23157 this.isStopped = true;
23158 if (this.state === "idle") 23159 return; 23160 this.teardown(); 23161 const { onStop } = this.options; 23162 onStop && onStop(); 23163 }; 23164 const { name, motionValue, element, keyframes } = this.options; 23165 const KeyframeResolver$1 = (element === null || element === void 0 ? void 0 : element.KeyframeResolver) || KeyframeResolver; 23166 const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe); 23167 this.resolver = new KeyframeResolver$1(keyframes, onResolved, name, motionValue, element); 23168 this.resolver.scheduleResolve(); 23169 } 23170 flatten() { 23171 super.flatten(); 23172 // If we've already resolved the animation, re-initialise it 23173 if (this._resolved) { 23174 Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes)); 23175 } 23176 } 23177 initPlayback(keyframes$1) { 23178 const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = this.options; 23179 const generatorFactory = isGenerator(type) 23180 ? type 23181 : generators[type] || keyframes; 23182 /** 23183 * If our generator doesn't support mixing numbers, we need to replace keyframes with 23184 * [0, 100] and then make a function that maps that to the actual keyframes. 23185 * 23186 * 100 is chosen instead of 1 as it works nicer with spring animations. 23187 */ 23188 let mapPercentToKeyframes; 23189 let mirroredGenerator; 23190 if (false) {} 23191 if (generatorFactory !== keyframes && 23192 typeof keyframes$1[0] !== "number") { 23193 mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); 23194 keyframes$1 = [0, 100]; 23195 } 23196 const generator = generatorFactory({ ...this.options, keyframes: keyframes$1 }); 23197 /** 23198 * If we have a mirror repeat type we need to create a second generator that outputs the 23199 * mirrored (not reversed) animation and later ping pong between the two generators. 23200 */ 23201 if (repeatType === "mirror") { 23202 mirroredGenerator = generatorFactory({ 23203 ...this.options, 23204 keyframes: [...keyframes$1].reverse(), 23205 velocity: -velocity, 23206 }); 23207 } 23208 /** 23209 * If duration is undefined and we have repeat options, 23210 * we need to calculate a duration from the generator. 23211 * 23212 * We set it to the generator itself to cache the duration. 23213 * Any timeline resolver will need to have already precalculated 23214 * the duration by this step. 23215 */ 23216 if (generator.calculatedDuration === null) { 23217 generator.calculatedDuration = calcGeneratorDuration(generator); 23218 } 23219 const { calculatedDuration } = generator; 23220 const resolvedDuration = calculatedDuration + repeatDelay; 23221 const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay; 23222 return { 23223 generator, 23224 mirroredGenerator, 23225 mapPercentToKeyframes, 23226 calculatedDuration, 23227 resolvedDuration, 23228 totalDuration, 23229 }; 23230 } 23231 onPostResolved() { 23232 const { autoplay = true } = this.options; 23233 animation_count_activeAnimations.mainThread++; 23234 this.play(); 23235 if (this.pendingPlayState === "paused" || !autoplay) { 23236 this.pause(); 23237 } 23238 else { 23239 this.state = this.pendingPlayState; 23240 } 23241 } 23242 tick(timestamp, sample = false) { 23243 const { resolved } = this; 23244 // If the animations has failed to resolve, return the final keyframe. 23245 if (!resolved) { 23246 const { keyframes } = this.options; 23247 return { done: true, value: keyframes[keyframes.length - 1] }; 23248 } 23249 const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved; 23250 if (this.startTime === null) 23251 return generator.next(0);
23252 const { delay, repeat, repeatType, repeatDelay, onUpdate } = this.options; 23253 /** 23254 * requestAnimationFrame timestamps can come through as lower than 23255 * the startTime as set by performance.now(). Here we prevent this, 23256 * though in the future it could be possible to make setting startTime 23257 * a pending operation that gets resolved here. 23258 */ 23259 if (this.speed > 0) { 23260 this.startTime = Math.min(this.startTime, timestamp); 23261 } 23262 else if (this.speed < 0) { 23263 this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); 23264 } 23265 // Update currentTime 23266 if (sample) { 23267 this.currentTime = timestamp; 23268 } 23269 else if (this.holdTime !== null) { 23270 this.currentTime = this.holdTime; 23271 } 23272 else { 23273 // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = 23274 // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for 23275 // example. 23276 this.currentTime = 23277 Math.round(timestamp - this.startTime) * this.speed; 23278 } 23279 // Rebase on delay 23280 const timeWithoutDelay = this.currentTime - delay * (this.speed >= 0 ? 1 : -1); 23281 const isInDelayPhase = this.speed >= 0 23282 ? timeWithoutDelay < 0 23283 : timeWithoutDelay > totalDuration; 23284 this.currentTime = Math.max(timeWithoutDelay, 0); 23285 // If this animation has finished, set the current time to the total duration. 23286 if (this.state === "finished" && this.holdTime === null) { 23287 this.currentTime = totalDuration; 23288 } 23289 let elapsed = this.currentTime; 23290 let frameGenerator = generator; 23291 if (repeat) { 23292 /** 23293 * Get the current progress (0-1) of the animation. If t is > 23294 * than duration we'll get values like 2.5 (midway through the 23295 * third iteration) 23296 */ 23297 const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; 23298 /** 23299 * Get the current iteration (0 indexed). For instance the floor of 23300 * 2.5 is 2. 23301 */ 23302 let currentIteration = Math.floor(progress); 23303 /** 23304 * Get the current progress of the iteration by taking the remainder 23305 * so 2.5 is 0.5 through iteration 2 23306 */ 23307 let iterationProgress = progress % 1.0; 23308 /** 23309 * If iteration progress is 1 we count that as the end 23310 * of the previous iteration. 23311 */ 23312 if (!iterationProgress && progress >= 1) { 23313 iterationProgress = 1; 23314 } 23315 iterationProgress === 1 && currentIteration--; 23316 currentIteration = Math.min(currentIteration, repeat + 1); 23317 /** 23318 * Reverse progress if we're not running in "normal" direction 23319 */ 23320 const isOddIteration = Boolean(currentIteration % 2); 23321 if (isOddIteration) { 23322 if (repeatType === "reverse") { 23323 iterationProgress = 1 - iterationProgress; 23324 if (repeatDelay) { 23325 iterationProgress -= repeatDelay / resolvedDuration; 23326 } 23327 } 23328 else if (repeatType === "mirror") { 23329 frameGenerator = mirroredGenerator; 23330 } 23331 } 23332 elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; 23333 } 23334 /** 23335 * If we're in negative time, set state as the initial keyframe. 23336 * This prevents delay: x, duration: 0 animations from finishing 23337 * instantly. 23338 */ 23339 const state = isInDelayPhase 23340 ? { done: false, value: keyframes[0] } 23341 : frameGenerator.next(elapsed); 23342 if (mapPercentToKeyframes) { 23343 state.value = mapPercentToKeyframes(state.value); 23344 } 23345 let { done } = state; 23346 if (!isInDelayPhase && calculatedDuration !== null) { 23347 done = 23348 this.speed >= 0 23349 ? this.currentTime >= totalDuration 23350 : this.currentTime <= 0; 23351 } 23352 const isAnimationFinished = this.holdTime === null && 23353 (this.state === "finished" || (this.state === "running" && done)); 23354 if (isAnimationFinished && finalKeyframe !== undefined) { 23355 state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe); 23356 } 23357 if (onUpdate) { 23358 onUpdate(state.value); 23359 } 23360 if (isAnimationFinished) { 23361 this.finish(); 23362 } 23363 return state; 23364 } 23365 get duration() { 23366 const { resolved } = this; 23367 return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0; 23368 } 23369 get time() { 23370 return millisecondsToSeconds(this.currentTime); 23371 } 23372 set time(newTime) { 23373 newTime = time_conversion_secondsToMilliseconds(newTime); 23374 this.currentTime = newTime; 23375 if (this.holdTime !== null || this.speed === 0) { 23376 this.holdTime = newTime; 23377 } 23378 else if (this.driver) { 23379 this.startTime = this.driver.now() - newTime / this.speed; 23380 } 23381 } 23382 get speed() { 23383 return this.playbackSpeed; 23384 } 23385 set speed(newSpeed) { 23386 const hasChanged = this.playbackSpeed !== newSpeed; 23387 this.playbackSpeed = newSpeed; 23388 if (hasChanged) { 23389 this.time = millisecondsToSeconds(this.currentTime); 23390 } 23391 } 23392 play() { 23393 if (!this.resolver.isScheduled) { 23394 this.resolver.resume(); 23395 } 23396 if (!this._resolved) { 23397 this.pendingPlayState = "running"; 23398 return; 23399 } 23400 if (this.isStopped) 23401 return; 23402 const { driver = frameloopDriver, onPlay, startTime } = this.options; 23403 if (!this.driver) { 23404 this.driver = driver((timestamp) => this.tick(timestamp)); 23405 } 23406 onPlay && onPlay(); 23407 const now = this.driver.now(); 23408 if (this.holdTime !== null) {
23409 this.startTime = now - this.holdTime; 23410 } 23411 else if (!this.startTime) { 23412 this.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime(); 23413 } 23414 else if (this.state === "finished") { 23415 this.startTime = now; 23416 } 23417 if (this.state === "finished") { 23418 this.updateFinishedPromise(); 23419 } 23420 this.cancelTime = this.startTime; 23421 this.holdTime = null; 23422 /** 23423 * Set playState to running only after we've used it in 23424 * the previous logic. 23425 */ 23426 this.state = "running"; 23427 this.driver.start(); 23428 } 23429 pause() { 23430 var _a; 23431 if (!this._resolved) { 23432 this.pendingPlayState = "paused"; 23433 return; 23434 } 23435 this.state = "paused"; 23436 this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0; 23437 } 23438 complete() { 23439 if (this.state !== "running") { 23440 this.play(); 23441 } 23442 this.pendingPlayState = this.state = "finished"; 23443 this.holdTime = null; 23444 } 23445 finish() { 23446 this.teardown(); 23447 this.state = "finished"; 23448 const { onComplete } = this.options; 23449 onComplete && onComplete(); 23450 } 23451 cancel() { 23452 if (this.cancelTime !== null) { 23453 this.tick(this.cancelTime); 23454 } 23455 this.teardown(); 23456 this.updateFinishedPromise(); 23457 } 23458 teardown() { 23459 this.state = "idle"; 23460 this.stopDriver(); 23461 this.resolveFinishedPromise(); 23462 this.updateFinishedPromise(); 23463 this.startTime = this.cancelTime = null; 23464 this.resolver.cancel(); 23465 animation_count_activeAnimations.mainThread--; 23466 } 23467 stopDriver() { 23468 if (!this.driver) 23469 return; 23470 this.driver.stop(); 23471 this.driver = undefined; 23472 } 23473 sample(time) { 23474 this.startTime = 0; 23475 return this.tick(time, true); 23476 } 23477} 23478// Legacy interface 23479function animateValue(options) { 23480 return new MainThreadAnimation(options); 23481} 23482 23483 23484 23485;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs 23486/** 23487 * A list of values that can be hardware-accelerated. 23488 */ 23489const acceleratedValues = new Set([ 23490 "opacity", 23491 "clipPath", 23492 "filter", 23493 "transform", 23494 // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved 23495 // or until we implement support for linear() easing. 23496 // "background-color" 23497]); 23498 23499 23500 23501;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs 23502 23503 23504function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeInOut", times, } = {}) { 23505 const keyframeOptions = { [valueName]: keyframes }; 23506 if (times) 23507 keyframeOptions.offset = times; 23508 const easing = easing_mapEasingToNativeEasing(ease, duration); 23509 /** 23510 * If this is an easing array, apply to keyframes, not animation as a whole 23511 */ 23512 if (Array.isArray(easing)) 23513 keyframeOptions.easing = easing; 23514 if (buffer_statsBuffer.value) { 23515 animation_count_activeAnimations.waapi++; 23516 } 23517 const animation = element.animate(keyframeOptions, { 23518 delay, 23519 duration, 23520 easing: !Array.isArray(easing) ? easing : "linear", 23521 fill: "both", 23522 iterations: repeat + 1, 23523 direction: repeatType === "reverse" ? "alternate" : "normal", 23524 }); 23525 if (buffer_statsBuffer.value) { 23526 animation.finished.finally(() => { 23527 animation_count_activeAnimations.waapi--; 23528 }); 23529 } 23530 return animation; 23531} 23532 23533 23534 23535;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs 23536 23537 23538const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); 23539 23540 23541 23542;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs 23543 23544 23545 23546 23547 23548 23549 23550 23551 23552 23553 23554 23555 23556/** 23557 * 10ms is chosen here as it strikes a balance between smooth 23558 * results (more than one keyframe per frame at 60fps) and 23559 * keyframe quantity. 23560 */ 23561const sampleDelta = 10; //ms 23562/** 23563 * Implement a practical max duration for keyframe generation 23564 * to prevent infinite loops 23565 */ 23566const maxDuration = 20000; 23567/** 23568 * Check if an animation can run natively via WAAPI or requires pregenerated keyframes.
23569 * WAAPI doesn't support spring or function easings so we run these as JS animation before 23570 * handing off. 23571 */ 23572function requiresPregeneratedKeyframes(options) { 23573 return (isGenerator(options.type) || 23574 options.type === "spring" || 23575 !isWaapiSupportedEasing(options.ease)); 23576} 23577function pregenerateKeyframes(keyframes, options) { 23578 /** 23579 * Create a main-thread animation to pregenerate keyframes. 23580 * We sample this at regular intervals to generate keyframes that we then 23581 * linearly interpolate between. 23582 */ 23583 const sampleAnimation = new MainThreadAnimation({ 23584 ...options, 23585 keyframes, 23586 repeat: 0, 23587 delay: 0, 23588 isGenerator: true, 23589 }); 23590 let state = { done: false, value: keyframes[0] }; 23591 const pregeneratedKeyframes = []; 23592 /** 23593 * Bail after 20 seconds of pre-generated keyframes as it's likely 23594 * we're heading for an infinite loop. 23595 */ 23596 let t = 0; 23597 while (!state.done && t < maxDuration) { 23598 state = sampleAnimation.sample(t); 23599 pregeneratedKeyframes.push(state.value); 23600 t += sampleDelta; 23601 } 23602 return { 23603 times: undefined, 23604 keyframes: pregeneratedKeyframes, 23605 duration: t - sampleDelta, 23606 ease: "linear", 23607 }; 23608} 23609const unsupportedEasingFunctions = { 23610 anticipate: anticipate, 23611 backInOut: backInOut, 23612 circInOut: circInOut, 23613}; 23614function isUnsupportedEase(key) { 23615 return key in unsupportedEasingFunctions; 23616} 23617class AcceleratedAnimation extends BaseAnimation { 23618 constructor(options) { 23619 super(options); 23620 const { name, motionValue, element, keyframes } = this.options; 23621 this.resolver = new DOMKeyframesResolver(keyframes, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue, element); 23622 this.resolver.scheduleResolve(); 23623 } 23624 initPlayback(keyframes, finalKeyframe) { 23625 let { duration = 300, times, ease, type, motionValue, name, startTime, } = this.options; 23626 /** 23627 * If element has since been unmounted, return false to indicate 23628 * the animation failed to initialised. 23629 */ 23630 if (!motionValue.owner || !motionValue.owner.current) { 23631 return false; 23632 } 23633 /** 23634 * If the user has provided an easing function name that isn't supported 23635 * by WAAPI (like "anticipate"), we need to provide the corressponding 23636 * function. This will later get converted to a linear() easing function. 23637 */ 23638 if (typeof ease === "string" && 23639 supportsLinearEasing() && 23640 isUnsupportedEase(ease)) { 23641 ease = unsupportedEasingFunctions[ease]; 23642 } 23643 /** 23644 * If this animation needs pre-generated keyframes then generate. 23645 */ 23646 if (requiresPregeneratedKeyframes(this.options)) { 23647 const { onComplete, onUpdate, motionValue, element, ...options } = this.options; 23648 const pregeneratedAnimation = pregenerateKeyframes(keyframes, options); 23649 keyframes = pregeneratedAnimation.keyframes; 23650 // If this is a very short animation, ensure we have 23651 // at least two keyframes to animate between as older browsers 23652 // can't animate between a single keyframe. 23653 if (keyframes.length === 1) { 23654 keyframes[1] = keyframes[0]; 23655 } 23656 duration = pregeneratedAnimation.duration; 23657 times = pregeneratedAnimation.times; 23658 ease = pregeneratedAnimation.ease; 23659 type = "keyframes"; 23660 } 23661 const animation = startWaapiAnimation(motionValue.owner.current, name, keyframes, { ...this.options, duration, times, ease }); 23662 // Override the browser calculated startTime with one synchronised to other JS 23663 // and WAAPI animations starting this event loop. 23664 animation.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime(); 23665 if (this.pendingTimeline) { 23666 attachTimeline(animation, this.pendingTimeline); 23667 this.pendingTimeline = undefined; 23668 } 23669 else { 23670 /** 23671 * Prefer the `onfinish` prop as it's more widely supported than 23672 * the `finished` promise. 23673 * 23674 * Here, we synchronously set the provided MotionValue to the end 23675 * keyframe. If we didn't, when the WAAPI animation is finished it would 23676 * be removed from the element which would then revert to its old styles. 23677 */ 23678 animation.onfinish = () => { 23679 const { onComplete } = this.options; 23680 motionValue.set(getFinalKeyframe(keyframes, this.options, finalKeyframe)); 23681 onComplete && onComplete(); 23682 this.cancel();
23683 this.resolveFinishedPromise(); 23684 }; 23685 } 23686 return { 23687 animation, 23688 duration, 23689 times, 23690 type, 23691 ease, 23692 keyframes: keyframes, 23693 }; 23694 } 23695 get duration() { 23696 const { resolved } = this; 23697 if (!resolved) 23698 return 0; 23699 const { duration } = resolved; 23700 return millisecondsToSeconds(duration); 23701 } 23702 get time() { 23703 const { resolved } = this; 23704 if (!resolved) 23705 return 0; 23706 const { animation } = resolved; 23707 return millisecondsToSeconds(animation.currentTime || 0); 23708 } 23709 set time(newTime) { 23710 const { resolved } = this; 23711 if (!resolved) 23712 return; 23713 const { animation } = resolved; 23714 animation.currentTime = time_conversion_secondsToMilliseconds(newTime); 23715 } 23716 get speed() { 23717 const { resolved } = this; 23718 if (!resolved) 23719 return 1; 23720 const { animation } = resolved; 23721 return animation.playbackRate; 23722 } 23723 set speed(newSpeed) { 23724 const { resolved } = this; 23725 if (!resolved) 23726 return; 23727 const { animation } = resolved; 23728 animation.playbackRate = newSpeed; 23729 } 23730 get state() { 23731 const { resolved } = this; 23732 if (!resolved) 23733 return "idle"; 23734 const { animation } = resolved; 23735 return animation.playState; 23736 } 23737 get startTime() { 23738 const { resolved } = this; 23739 if (!resolved) 23740 return null; 23741 const { animation } = resolved; 23742 // Coerce to number as TypeScript incorrectly types this 23743 // as CSSNumberish 23744 return animation.startTime; 23745 } 23746 /** 23747 * Replace the default DocumentTimeline with another AnimationTimeline. 23748 * Currently used for scroll animations. 23749 */ 23750 attachTimeline(timeline) { 23751 if (!this._resolved) { 23752 this.pendingTimeline = timeline; 23753 } 23754 else { 23755 const { resolved } = this; 23756 if (!resolved) 23757 return noop_noop; 23758 const { animation } = resolved; 23759 attachTimeline(animation, timeline); 23760 } 23761 return noop_noop; 23762 } 23763 play() { 23764 if (this.isStopped) 23765 return; 23766 const { resolved } = this; 23767 if (!resolved) 23768 return; 23769 const { animation } = resolved; 23770 if (animation.playState === "finished") { 23771 this.updateFinishedPromise(); 23772 } 23773 animation.play(); 23774 } 23775 pause() { 23776 const { resolved } = this; 23777 if (!resolved) 23778 return; 23779 const { animation } = resolved; 23780 animation.pause(); 23781 } 23782 stop() { 23783 this.resolver.cancel(); 23784 this.isStopped = true; 23785 if (this.state === "idle") 23786 return; 23787 this.resolveFinishedPromise(); 23788 this.updateFinishedPromise(); 23789 const { resolved } = this; 23790 if (!resolved) 23791 return; 23792 const { animation, keyframes, duration, type, ease, times } = resolved; 23793 if (animation.playState === "idle" || 23794 animation.playState === "finished") { 23795 return; 23796 } 23797 /** 23798 * WAAPI doesn't natively have any interruption capabilities. 23799 * 23800 * Rather than read commited styles back out of the DOM, we can 23801 * create a renderless JS animation and sample it twice to calculate 23802 * its current value, "previous" value, and therefore allow 23803 * Motion to calculate velocity for any subsequent animation. 23804 */ 23805 if (this.time) { 23806 const { motionValue, onUpdate, onComplete, element, ...options } = this.options; 23807 const sampleAnimation = new MainThreadAnimation({ 23808 ...options, 23809 keyframes, 23810 duration, 23811 type, 23812 ease, 23813 times, 23814 isGenerator: true, 23815 }); 23816 const sampleTime = time_conversion_secondsToMilliseconds(this.time); 23817 motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta); 23818 } 23819 const { onStop } = this.options; 23820 onStop && onStop(); 23821 this.cancel(); 23822 } 23823 complete() { 23824 const { resolved } = this; 23825 if (!resolved) 23826 return; 23827 resolved.animation.finish(); 23828 } 23829 cancel() { 23830 const { resolved } = this; 23831 if (!resolved) 23832 return; 23833 resolved.animation.cancel(); 23834 }
23835 static supports(options) { 23836 const { motionValue, name, repeatDelay, repeatType, damping, type } = options; 23837 if (!motionValue || 23838 !motionValue.owner || 23839 !(motionValue.owner.current instanceof HTMLElement)) { 23840 return false; 23841 } 23842 const { onUpdate, transformTemplate } = motionValue.owner.getProps(); 23843 return (supportsWaapi() && 23844 name && 23845 acceleratedValues.has(name) && 23846 /** 23847 * If we're outputting values to onUpdate then we can't use WAAPI as there's 23848 * no way to read the value from WAAPI every frame. 23849 */ 23850 !onUpdate && 23851 !transformTemplate && 23852 !repeatDelay && 23853 repeatType !== "mirror" && 23854 damping !== 0 && 23855 type !== "inertia"); 23856 } 23857} 23858 23859 23860 23861;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs 23862 23863 23864const underDampedSpring = { 23865 type: "spring", 23866 stiffness: 500, 23867 damping: 25, 23868 restSpeed: 10, 23869}; 23870const criticallyDampedSpring = (target) => ({ 23871 type: "spring", 23872 stiffness: 550, 23873 damping: target === 0 ? 2 * Math.sqrt(550) : 30, 23874 restSpeed: 10, 23875}); 23876const keyframesTransition = { 23877 type: "keyframes", 23878 duration: 0.8, 23879}; 23880/** 23881 * Default easing curve is a slightly shallower version of 23882 * the default browser easing curve. 23883 */ 23884const ease = { 23885 type: "keyframes", 23886 ease: [0.25, 0.1, 0.35, 1], 23887 duration: 0.3, 23888}; 23889const getDefaultTransition = (valueKey, { keyframes }) => { 23890 if (keyframes.length > 2) { 23891 return keyframesTransition; 23892 } 23893 else if (transformProps.has(valueKey)) { 23894 return valueKey.startsWith("scale") 23895 ? criticallyDampedSpring(keyframes[1]) 23896 : underDampedSpring; 23897 } 23898 return ease; 23899}; 23900 23901 23902 23903;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs 23904/** 23905 * Decide whether a transition is defined on a given Transition. 23906 * This filters out orchestration options and returns true 23907 * if any options are left. 23908 */ 23909function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) { 23910 return !!Object.keys(transition).length; 23911} 23912 23913 23914 23915;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs 23916 23917 23918 23919 23920 23921 23922 23923 23924 23925const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { 23926 const valueTransition = get_value_transition_getValueTransition(transition, name) || {}; 23927 /** 23928 * Most transition values are currently completely overwritten by value-specific 23929 * transitions. In the future it'd be nicer to blend these transitions. But for now 23930 * delay actually does inherit from the root transition if not value-specific. 23931 */ 23932 const delay = valueTransition.delay || transition.delay || 0; 23933 /** 23934 * Elapsed isn't a public transition option but can be passed through from 23935 * optimized appear effects in milliseconds. 23936 */
23937 let { elapsed = 0 } = transition; 23938 elapsed = elapsed - time_conversion_secondsToMilliseconds(delay); 23939 let options = { 23940 keyframes: Array.isArray(target) ? target : [null, target], 23941 ease: "easeOut", 23942 velocity: value.getVelocity(), 23943 ...valueTransition, 23944 delay: -elapsed, 23945 onUpdate: (v) => { 23946 value.set(v); 23947 valueTransition.onUpdate && valueTransition.onUpdate(v); 23948 }, 23949 onComplete: () => { 23950 onComplete(); 23951 valueTransition.onComplete && valueTransition.onComplete(); 23952 }, 23953 name, 23954 motionValue: value, 23955 element: isHandoff ? undefined : element, 23956 }; 23957 /** 23958 * If there's no transition defined for this value, we can generate 23959 * unique transition settings for this value. 23960 */ 23961 if (!isTransitionDefined(valueTransition)) { 23962 options = { 23963 ...options, 23964 ...getDefaultTransition(name, options), 23965 }; 23966 } 23967 /** 23968 * Both WAAPI and our internal animation functions use durations 23969 * as defined by milliseconds, while our external API defines them 23970 * as seconds. 23971 */ 23972 if (options.duration) { 23973 options.duration = time_conversion_secondsToMilliseconds(options.duration); 23974 } 23975 if (options.repeatDelay) { 23976 options.repeatDelay = time_conversion_secondsToMilliseconds(options.repeatDelay); 23977 } 23978 if (options.from !== undefined) { 23979 options.keyframes[0] = options.from; 23980 } 23981 let shouldSkip = false; 23982 if (options.type === false || 23983 (options.duration === 0 && !options.repeatDelay)) { 23984 options.duration = 0; 23985 if (options.delay === 0) { 23986 shouldSkip = true; 23987 } 23988 } 23989 if (instantAnimationState.current || 23990 MotionGlobalConfig.skipAnimations) { 23991 shouldSkip = true; 23992 options.duration = 0; 23993 options.delay = 0; 23994 } 23995 /** 23996 * If the transition type or easing has been explicitly set by the user 23997 * then we don't want to allow flattening the animation. 23998 */ 23999 options.allowFlatten = !valueTransition.type && !valueTransition.ease; 24000 /** 24001 * If we can or must skip creating the animation, and apply only 24002 * the final keyframe, do so. We also check once keyframes are resolved but 24003 * this early check prevents the need to create an animation at all. 24004 */ 24005 if (shouldSkip && !isHandoff && value.get() !== undefined) { 24006 const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); 24007 if (finalKeyframe !== undefined) { 24008 frame_frame.update(() => { 24009 options.onUpdate(finalKeyframe); 24010 options.onComplete(); 24011 }); 24012 // We still want to return some animation controls here rather 24013 // than returning undefined 24014 return new GroupPlaybackControls([]); 24015 } 24016 } 24017 /** 24018 * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via 24019 * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the 24020 * optimised animation. 24021 */ 24022 if (!isHandoff && AcceleratedAnimation.supports(options)) { 24023 return new AcceleratedAnimation(options); 24024 } 24025 else { 24026 return new MainThreadAnimation(options); 24027 } 24028}; 24029 24030 24031 24032;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs 24033 24034 24035 24036 24037 24038 24039 24040/** 24041 * Decide whether we should block this animation. Previously, we achieved this 24042 * just by checking whether the key was listed in protectedKeys, but this 24043 * posed problems if an animation was triggered by afterChildren and protectedKeys 24044 * had been set to true in the meantime. 24045 */ 24046function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { 24047 const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; 24048 needsAnimating[key] = false; 24049 return shouldBlock; 24050} 24051function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { 24052 var _a; 24053 let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition; 24054 if (transitionOverride) 24055 transition = transitionOverride; 24056 const animations = []; 24057 const animationTypeState = type && 24058 visualElement.animationState && 24059 visualElement.animationState.getState()[type]; 24060 for (const key in target) { 24061 const value = visualElement.getValue(key, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : null); 24062 const valueTarget = target[key]; 24063 if (valueTarget === undefined || 24064 (animationTypeState && 24065 shouldBlockAnimation(animationTypeState, key))) { 24066 continue; 24067 } 24068 const valueTransition = { 24069 delay, 24070 ...get_value_transition_getValueTransition(transition || {}, key), 24071 }; 24072 /** 24073 * If this is the first time a value is being animated, check 24074 * to see if we're handling off from an existing animation. 24075 */ 24076 let isHandoff = false;
24077 if (window.MotionHandoffAnimation) { 24078 const appearId = getOptimisedAppearId(visualElement); 24079 if (appearId) { 24080 const startTime = window.MotionHandoffAnimation(appearId, key, frame_frame); 24081 if (startTime !== null) { 24082 valueTransition.startTime = startTime; 24083 isHandoff = true; 24084 } 24085 } 24086 } 24087 addValueToWillChange(visualElement, key); 24088 value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key) 24089 ? { type: false } 24090 : valueTransition, visualElement, isHandoff)); 24091 const animation = value.animation; 24092 if (animation) { 24093 animations.push(animation); 24094 } 24095 } 24096 if (transitionEnd) { 24097 Promise.all(animations).then(() => { 24098 frame_frame.update(() => { 24099 transitionEnd && setTarget(visualElement, transitionEnd); 24100 }); 24101 }); 24102 } 24103 return animations; 24104} 24105 24106 24107 24108;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs 24109 24110 24111 24112function animateVariant(visualElement, variant, options = {}) { 24113 var _a; 24114 const resolved = resolveVariant(visualElement, variant, options.type === "exit" 24115 ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom 24116 : undefined); 24117 let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; 24118 if (options.transitionOverride) { 24119 transition = options.transitionOverride; 24120 } 24121 /** 24122 * If we have a variant, create a callback that runs it as an animation. 24123 * Otherwise, we resolve a Promise immediately for a composable no-op. 24124 */ 24125 const getAnimation = resolved 24126 ? () => Promise.all(animateTarget(visualElement, resolved, options)) 24127 : () => Promise.resolve(); 24128 /** 24129 * If we have children, create a callback that runs all their animations. 24130 * Otherwise, we resolve a Promise immediately for a composable no-op. 24131 */ 24132 const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size 24133 ? (forwardDelay = 0) => { 24134 const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; 24135 return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options); 24136 } 24137 : () => Promise.resolve(); 24138 /** 24139 * If the transition explicitly defines a "when" option, we need to resolve either 24140 * this animation or all children animations before playing the other. 24141 */ 24142 const { when } = transition; 24143 if (when) { 24144 const [first, last] = when === "beforeChildren" 24145 ? [getAnimation, getChildAnimations] 24146 : [getChildAnimations, getAnimation]; 24147 return first().then(() => last()); 24148 } 24149 else { 24150 return Promise.all([getAnimation(), getChildAnimations(options.delay)]); 24151 } 24152} 24153function animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { 24154 const animations = []; 24155 const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; 24156 const generateStaggerDuration = staggerDirection === 1 24157 ? (i = 0) => i * staggerChildren 24158 : (i = 0) => maxStaggerDuration - i * staggerChildren; 24159 Array.from(visualElement.variantChildren) 24160 .sort(sortByTreeOrder) 24161 .forEach((child, i) => { 24162 child.notify("AnimationStart", variant); 24163 animations.push(animateVariant(child, variant, { 24164 ...options, 24165 delay: delayChildren + generateStaggerDuration(i), 24166 }).then(() => child.notify("AnimationComplete", variant))); 24167 }); 24168 return Promise.all(animations); 24169} 24170function sortByTreeOrder(a, b) { 24171 return a.sortNodePosition(b); 24172} 24173 24174 24175 24176;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs 24177 24178 24179 24180 24181function animateVisualElement(visualElement, definition, options = {}) { 24182 visualElement.notify("AnimationStart", definition); 24183 let animation; 24184 if (Array.isArray(definition)) { 24185 const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); 24186 animation = Promise.all(animations); 24187 } 24188 else if (typeof definition === "string") { 24189 animation = animateVariant(visualElement, definition, options); 24190 } 24191 else { 24192 const resolvedDefinition = typeof definition === "function" 24193 ? resolveVariant(visualElement, definition, options.custom) 24194 : definition; 24195 animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); 24196 } 24197 return animation.then(() => { 24198 visualElement.notify("AnimationComplete", definition); 24199 }); 24200} 24201 24202 24203 24204;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/shallow-compare.mjs 24205function shallowCompare(next, prev) { 24206 if (!Array.isArray(prev)) 24207 return false;
24208 const prevLength = prev.length; 24209 if (prevLength !== next.length) 24210 return false; 24211 for (let i = 0; i < prevLength; i++) { 24212 if (prev[i] !== next[i]) 24213 return false; 24214 } 24215 return true; 24216} 24217 24218 24219 24220;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs 24221/** 24222 * Decides if the supplied variable is variant label 24223 */ 24224function isVariantLabel(v) { 24225 return typeof v === "string" || Array.isArray(v); 24226} 24227 24228 24229 24230;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/variant-props.mjs 24231const variantPriorityOrder = [ 24232 "animate", 24233 "whileInView", 24234 "whileFocus", 24235 "whileHover", 24236 "whileTap", 24237 "whileDrag", 24238 "exit", 24239]; 24240const variantProps = ["initial", ...variantPriorityOrder]; 24241 24242 24243 24244;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/get-variant-context.mjs 24245 24246 24247 24248const numVariantProps = variantProps.length; 24249function getVariantContext(visualElement) { 24250 if (!visualElement) 24251 return undefined; 24252 if (!visualElement.isControllingVariants) { 24253 const context = visualElement.parent 24254 ? getVariantContext(visualElement.parent) || {} 24255 : {}; 24256 if (visualElement.props.initial !== undefined) { 24257 context.initial = visualElement.props.initial; 24258 } 24259 return context; 24260 } 24261 const context = {}; 24262 for (let i = 0; i < numVariantProps; i++) { 24263 const name = variantProps[i]; 24264 const prop = visualElement.props[name]; 24265 if (isVariantLabel(prop) || prop === false) { 24266 context[name] = prop; 24267 } 24268 } 24269 return context; 24270} 24271 24272 24273 24274;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation-state.mjs 24275 24276 24277 24278 24279 24280 24281 24282 24283 24284const reversePriorityOrder = [...variantPriorityOrder].reverse(); 24285const numAnimationTypes = variantPriorityOrder.length; 24286function animateList(visualElement) { 24287 return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); 24288} 24289function createAnimationState(visualElement) { 24290 let animate = animateList(visualElement); 24291 let state = createState(); 24292 let isInitialRender = true; 24293 /** 24294 * This function will be used to reduce the animation definitions for 24295 * each active animation type into an object of resolved values for it. 24296 */ 24297 const buildResolvedTypeValues = (type) => (acc, definition) => { 24298 var _a; 24299 const resolved = resolveVariant(visualElement, definition, type === "exit" 24300 ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom 24301 : undefined); 24302 if (resolved) { 24303 const { transition, transitionEnd, ...target } = resolved; 24304 acc = { ...acc, ...target, ...transitionEnd }; 24305 } 24306 return acc; 24307 }; 24308 /** 24309 * This just allows us to inject mocked animation functions 24310 * @internal 24311 */ 24312 function setAnimateFunction(makeAnimator) { 24313 animate = makeAnimator(visualElement); 24314 } 24315 /** 24316 * When we receive new props, we need to: 24317 * 1. Create a list of protected keys for each type. This is a directory of 24318 * value keys that are currently being "handled" by types of a higher priority 24319 * so that whenever an animation is played of a given type, these values are 24320 * protected from being animated. 24321 * 2. Determine if an animation type needs animating. 24322 * 3. Determine if any values have been removed from a type and figure out 24323 * what to animate those to. 24324 */ 24325 function animateChanges(changedActiveType) { 24326 const { props } = visualElement; 24327 const context = getVariantContext(visualElement.parent) || {}; 24328 /** 24329 * A list of animations that we'll build into as we iterate through the animation 24330 * types. This will get executed at the end of the function. 24331 */ 24332 const animations = []; 24333 /** 24334 * Keep track of which values have been removed. Then, as we hit lower priority 24335 * animation types, we can check if they contain removed values and animate to that. 24336 */ 24337 const removedKeys = new Set(); 24338 /** 24339 * A dictionary of all encountered keys. This is an object to let us build into and 24340 * copy it without iteration. Each time we hit an animation type we set its protected 24341 * keys - the keys its not allowed to animate - to the latest version of this object. 24342 */ 24343 let encounteredKeys = {}; 24344 /** 24345 * If a variant has been removed at a given index, and this component is controlling 24346 * variant animations, we want to ensure lower-priority variants are forced to animate. 24347 */ 24348 let removedVariantIndex = Infinity; 24349 /** 24350 * Iterate through all animation types in reverse priority order. For each, we want to 24351 * detect which values it's handling and whether or not they've changed (and therefore 24352 * need to be animated). If any values have been removed, we want to detect those in 24353 * lower priority props and flag for animation. 24354 */ 24355 for (let i = 0; i < numAnimationTypes; i++) { 24356 const type = reversePriorityOrder[i]; 24357 const typeState = state[type]; 24358 const prop = props[type] !== undefined 24359 ? props[type] 24360 : context[type]; 24361 const propIsVariant = isVariantLabel(prop); 24362 /** 24363 * If this type has *just* changed isActive status, set activeDelta 24364 * to that status. Otherwise set to null. 24365 */ 24366 const activeDelta = type === changedActiveType ? typeState.isActive : null; 24367 if (activeDelta === false) 24368 removedVariantIndex = i; 24369 /** 24370 * If this prop is an inherited variant, rather than been set directly on the 24371 * component itself, we want to make sure we allow the parent to trigger animations. 24372 * 24373 * TODO: Can probably change this to a !isControllingVariants check 24374 */ 24375 let isInherited = prop === context[type] && 24376 prop !== props[type] && 24377 propIsVariant; 24378 /** 24379 * 24380 */
vendor: 5,748 bytes, lines 24380-24501
24380 24381 if (isInherited && 24382 isInitialRender && 24383 visualElement.manuallyAnimateOnMount) { 24384 isInherited = false; 24385 } 24386 /** 24387 * Set all encountered keys so far as the protected keys for this type. This will 24388 * be any key that has been animated or otherwise handled by active, higher-priortiy types. 24389 */ 24390 typeState.protectedKeys = { ...encounteredKeys }; 24391 // Check if we can skip analysing this prop early 24392 if ( 24393 // If it isn't active and hasn't *just* been set as inactive 24394 (!typeState.isActive && activeDelta === null) || 24395 // If we didn't and don't have any defined prop for this animation type 24396 (!prop && !typeState.prevProp) || 24397 // Or if the prop doesn't define an animation 24398 isAnimationControls(prop) || 24399 typeof prop === "boolean") { 24400 continue; 24401 } 24402 /** 24403 * As we go look through the values defined on this type, if we detect 24404 * a changed value or a value that was removed in a higher priority, we set 24405 * this to true and add this prop to the animation list. 24406 */ 24407 const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); 24408 let shouldAnimateType = variantDidChange || 24409 // If we're making this variant active, we want to always make it active 24410 (type === changedActiveType && 24411 typeState.isActive && 24412 !isInherited && 24413 propIsVariant) || 24414 // If we removed a higher-priority variant (i is in reverse order) 24415 (i > removedVariantIndex && propIsVariant); 24416 let handledRemovedValues = false; 24417 /** 24418 * As animations can be set as variant lists, variants or target objects, we 24419 * coerce everything to an array if it isn't one already 24420 */ 24421 const definitionList = Array.isArray(prop) ? prop : [prop]; 24422 /** 24423 * Build an object of all the resolved values. We'll use this in the subsequent 24424 * animateChanges calls to determine whether a value has changed. 24425 */ 24426 let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); 24427 if (activeDelta === false) 24428 resolvedValues = {}; 24429 /** 24430 * Now we need to loop through all the keys in the prev prop and this prop, 24431 * and decide: 24432 * 1. If the value has changed, and needs animating 24433 * 2. If it has been removed, and needs adding to the removedKeys set 24434 * 3. If it has been removed in a higher priority type and needs animating 24435 * 4. If it hasn't been removed in a higher priority but hasn't changed, and 24436 * needs adding to the type's protectedKeys list. 24437 */ 24438 const { prevResolvedValues = {} } = typeState; 24439 const allKeys = { 24440 ...prevResolvedValues, 24441 ...resolvedValues, 24442 }; 24443 const markToAnimate = (key) => { 24444 shouldAnimateType = true; 24445 if (removedKeys.has(key)) { 24446 handledRemovedValues = true; 24447 removedKeys.delete(key); 24448 } 24449 typeState.needsAnimating[key] = true; 24450 const motionValue = visualElement.getValue(key); 24451 if (motionValue) 24452 motionValue.liveStyle = false; 24453 }; 24454 for (const key in allKeys) { 24455 const next = resolvedValues[key]; 24456 const prev = prevResolvedValues[key]; 24457 // If we've already handled this we can just skip ahead 24458 if (encounteredKeys.hasOwnProperty(key)) 24459 continue; 24460 /** 24461 * If the value has changed, we probably want to animate it. 24462 */ 24463 let valueHasChanged = false; 24464 if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { 24465 valueHasChanged = !shallowCompare(next, prev); 24466 } 24467 else { 24468 valueHasChanged = next !== prev; 24469 } 24470 if (valueHasChanged) { 24471 if (next !== undefined && next !== null) { 24472 // If next is defined and doesn't equal prev, it needs animating 24473 markToAnimate(key); 24474 } 24475 else { 24476 // If it's undefined, it's been removed. 24477 removedKeys.add(key); 24478 } 24479 } 24480 else if (next !== undefined && removedKeys.has(key)) { 24481 /** 24482 * If next hasn't changed and it isn't undefined, we want to check if it's 24483 * been removed by a higher priority 24484 */ 24485 markToAnimate(key); 24486 } 24487 else { 24488 /** 24489 * If it hasn't changed, we add it to the list of protected values 24490 * to ensure it doesn't get animated. 24491 */ 24492 typeState.protectedKeys[key] = true; 24493 } 24494 } 24495 /** 24496 * Update the typeState so next time animateChanges is called we can compare the 24497 * latest prop and resolvedValues to these. 24498 */ 24499 typeState.prevProp = prop; 24500 typeState.prevResolvedValues = resolvedValues; 24501
24501/** 24502 * 24503 */ 24504 if (typeState.isActive) { 24505 encounteredKeys = { ...encounteredKeys, ...resolvedValues }; 24506 } 24507 if (isInitialRender && visualElement.blockInitialAnimation) { 24508 shouldAnimateType = false;
24509 } 24510 /** 24511 * If this is an inherited prop we want to skip this animation 24512 * unless the inherited variants haven't changed on this render. 24513 */ 24514 const willAnimateViaParent = isInherited && variantDidChange; 24515 const needsAnimating = !willAnimateViaParent || handledRemovedValues; 24516 if (shouldAnimateType && needsAnimating) { 24517 animations.push(...definitionList.map((animation) => ({ 24518 animation: animation, 24519 options: { type }, 24520 }))); 24521 } 24522 } 24523 /** 24524 * If there are some removed value that haven't been dealt with, 24525 * we need to create a new animation that falls back either to the value 24526 * defined in the style prop, or the last read value. 24527 */ 24528 if (removedKeys.size) { 24529 const fallbackAnimation = {}; 24530 /** 24531 * If the initial prop contains a transition we can use that, otherwise 24532 * allow the animation function to use the visual element's default. 24533 */ 24534 if (typeof props.initial !== "boolean") { 24535 const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) 24536 ? props.initial[0] 24537 : props.initial); 24538 if (initialTransition && initialTransition.transition) { 24539 fallbackAnimation.transition = initialTransition.transition; 24540 } 24541 } 24542 removedKeys.forEach((key) => { 24543 const fallbackTarget = visualElement.getBaseTarget(key); 24544 const motionValue = visualElement.getValue(key); 24545 if (motionValue) 24546 motionValue.liveStyle = true; 24547 // @ts-expect-error - @mattgperry to figure if we should do something here 24548 fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null; 24549 }); 24550 animations.push({ animation: fallbackAnimation }); 24551 } 24552 let shouldAnimate = Boolean(animations.length); 24553 if (isInitialRender && 24554 (props.initial === false || props.initial === props.animate) && 24555 !visualElement.manuallyAnimateOnMount) { 24556 shouldAnimate = false; 24557 } 24558 isInitialRender = false;
24559 return shouldAnimate ? animate(animations) : Promise.resolve(); 24560 } 24561 /** 24562 * Change whether a certain animation type is active. 24563 */ 24564 function setActive(type, isActive) { 24565 var _a; 24566 // If the active state hasn't changed, we can safely do nothing here 24567 if (state[type].isActive === isActive) 24568 return Promise.resolve(); 24569 // Propagate active change to children 24570 (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); }); 24571 state[type].isActive = isActive; 24572 const animations = animateChanges(type); 24573 for (const key in state) { 24574 state[key].protectedKeys = {}; 24575 } 24576 return animations; 24577 } 24578 return { 24579 animateChanges, 24580 setActive, 24581 setAnimateFunction, 24582 getState: () => state, 24583 reset: () => { 24584 state = createState(); 24585 isInitialRender = true; 24586 }, 24587 }; 24588} 24589function checkVariantsDidChange(prev, next) { 24590 if (typeof next === "string") { 24591 return next !== prev; 24592 } 24593 else if (Array.isArray(next)) { 24594 return !shallowCompare(next, prev); 24595 } 24596 return false; 24597} 24598function createTypeState(isActive = false) { 24599 return { 24600 isActive, 24601 protectedKeys: {}, 24602 needsAnimating: {}, 24603 prevResolvedValues: {}, 24604 }; 24605} 24606function createState() { 24607 return { 24608 animate: createTypeState(true), 24609 whileInView: createTypeState(), 24610 whileHover: createTypeState(), 24611 whileTap: createTypeState(), 24612 whileDrag: createTypeState(), 24613 whileFocus: createTypeState(), 24614 exit: createTypeState(), 24615 }; 24616} 24617 24618 24619 24620;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/Feature.mjs 24621class Feature { 24622 constructor(node) { 24623 this.isMounted = false; 24624 this.node = node; 24625 } 24626 update() { } 24627} 24628 24629 24630 24631;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/animation/index.mjs 24632 24633 24634 24635 24636class AnimationFeature extends Feature { 24637 /** 24638 * We dynamically generate the AnimationState manager as it contains a reference 24639 * to the underlying animation library. We only want to load that if we load this, 24640 * so people can optionally code split it out using the `m` component. 24641 */ 24642 constructor(node) { 24643 super(node); 24644 node.animationState || (node.animationState = createAnimationState(node)); 24645 } 24646 updateAnimationControlsSubscription() { 24647 const { animate } = this.node.getProps(); 24648 if (isAnimationControls(animate)) { 24649 this.unmountControls = animate.subscribe(this.node); 24650 } 24651 } 24652 /** 24653 * Subscribe any provided AnimationControls to the component's VisualElement 24654 */ 24655 mount() { 24656 this.updateAnimationControlsSubscription(); 24657 } 24658 update() { 24659 const { animate } = this.node.getProps(); 24660 const { animate: prevAnimate } = this.node.prevProps || {}; 24661 if (animate !== prevAnimate) { 24662 this.updateAnimationControlsSubscription(); 24663 } 24664 } 24665 unmount() { 24666 var _a; 24667 this.node.animationState.reset(); 24668 (_a = this.unmountControls) === null || _a === void 0 ? void 0 : _a.call(this); 24669 } 24670} 24671 24672 24673 24674;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs 24675 24676 24677let id = 0; 24678class ExitAnimationFeature extends Feature { 24679 constructor() { 24680 super(...arguments); 24681 this.id = id++; 24682 } 24683 update() { 24684 if (!this.node.presenceContext) 24685 return; 24686 const { isPresent, onExitComplete } = this.node.presenceContext; 24687 const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; 24688 if (!this.node.animationState || isPresent === prevIsPresent) { 24689 return; 24690 } 24691 const exitAnimation = this.node.animationState.setActive("exit", !isPresent); 24692 if (onExitComplete && !isPresent) { 24693 exitAnimation.then(() => {
vendor: 44,567 bytes, lines 24694-25933
24694 onExitComplete(this.id); 24695 }); 24696 } 24697 } 24698 mount() { 24699 const { register, onExitComplete } = this.node.presenceContext || {}; 24700 if (onExitComplete) { 24701 onExitComplete(this.id); 24702 } 24703 if (register) { 24704 this.unmount = register(this.id); 24705 } 24706 } 24707 unmount() { } 24708} 24709 24710 24711 24712;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/animations.mjs 24713 24714 24715 24716const animations = { 24717 animation: { 24718 Feature: AnimationFeature, 24719 }, 24720 exit: { 24721 Feature: ExitAnimationFeature, 24722 }, 24723}; 24724 24725 24726 24727;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/add-dom-event.mjs 24728function addDomEvent(target, eventName, handler, options = { passive: true }) { 24729 target.addEventListener(eventName, handler, options); 24730 return () => target.removeEventListener(eventName, handler); 24731} 24732 24733 24734 24735;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/event-info.mjs 24736 24737 24738function extractEventInfo(event) { 24739 return { 24740 point: { 24741 x: event.pageX, 24742 y: event.pageY, 24743 }, 24744 }; 24745} 24746const addPointerInfo = (handler) => { 24747 return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); 24748}; 24749 24750 24751 24752;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/add-pointer-event.mjs 24753 24754 24755 24756function addPointerEvent(target, eventName, handler, options) { 24757 return addDomEvent(target, eventName, addPointerInfo(handler), options); 24758} 24759 24760 24761 24762;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs 24763/** 24764 * Bounding boxes tend to be defined as top, left, right, bottom. For various operations 24765 * it's easier to consider each axis individually. This function returns a bounding box 24766 * as a map of single-axis min/max values. 24767 */ 24768function convertBoundingBoxToBox({ top, left, right, bottom, }) { 24769 return { 24770 x: { min: left, max: right }, 24771 y: { min: top, max: bottom }, 24772 }; 24773} 24774function convertBoxToBoundingBox({ x, y }) { 24775 return { top: y.min, right: x.max, bottom: y.max, left: x.min }; 24776} 24777/** 24778 * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function 24779 * provided by Framer to allow measured points to be corrected for device scaling. This is used 24780 * when measuring DOM elements and DOM event points. 24781 */ 24782function transformBoxPoints(point, transformPoint) { 24783 if (!transformPoint) 24784 return point; 24785 const topLeft = transformPoint({ x: point.left, y: point.top }); 24786 const bottomRight = transformPoint({ x: point.right, y: point.bottom }); 24787 return { 24788 top: topLeft.y, 24789 left: topLeft.x, 24790 bottom: bottomRight.y, 24791 right: bottomRight.x, 24792 }; 24793} 24794 24795 24796 24797;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs 24798 24799 24800const SCALE_PRECISION = 0.0001; 24801const SCALE_MIN = 1 - SCALE_PRECISION; 24802const SCALE_MAX = 1 + SCALE_PRECISION; 24803const TRANSLATE_PRECISION = 0.01; 24804const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; 24805const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; 24806function calcLength(axis) { 24807 return axis.max - axis.min; 24808} 24809function isNear(value, target, maxDistance) { 24810 return Math.abs(value - target) <= maxDistance; 24811} 24812function calcAxisDelta(delta, source, target, origin = 0.5) { 24813 delta.origin = origin; 24814 delta.originPoint = mixNumber(source.min, source.max, delta.origin); 24815 delta.scale = calcLength(target) / calcLength(source); 24816 delta.translate = 24817 mixNumber(target.min, target.max, delta.origin) - delta.originPoint; 24818 if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || 24819 isNaN(delta.scale)) { 24820 delta.scale = 1.0; 24821 } 24822 if ((delta.translate >= TRANSLATE_MIN && 24823 delta.translate <= TRANSLATE_MAX) || 24824 isNaN(delta.translate)) { 24825 delta.translate = 0.0; 24826 } 24827} 24828function calcBoxDelta(delta, source, target, origin) { 24829 calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); 24830 calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); 24831} 24832function calcRelativeAxis(target, relative, parent) { 24833 target.min = parent.min + relative.min; 24834 target.max = target.min + calcLength(relative); 24835} 24836function calcRelativeBox(target, relative, parent) { 24837 calcRelativeAxis(target.x, relative.x, parent.x); 24838 calcRelativeAxis(target.y, relative.y, parent.y); 24839} 24840function calcRelativeAxisPosition(target, layout, parent) { 24841 target.min = layout.min - parent.min; 24842 target.max = target.min + calcLength(layout); 24843} 24844function calcRelativePosition(target, layout, parent) { 24845 calcRelativeAxisPosition(target.x, layout.x, parent.x); 24846 calcRelativeAxisPosition(target.y, layout.y, parent.y); 24847} 24848 24849 24850 24851;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/models.mjs 24852const createAxisDelta = () => ({ 24853 translate: 0, 24854 scale: 1, 24855 origin: 0, 24856 originPoint: 0, 24857}); 24858const createDelta = () => ({ 24859 x: createAxisDelta(), 24860 y: createAxisDelta(), 24861}); 24862const createAxis = () => ({ min: 0, max: 0 }); 24863const createBox = () => ({ 24864 x: createAxis(), 24865 y: createAxis(), 24866}); 24867 24868 24869 24870;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs 24871function eachAxis(callback) { 24872 return [callback("x"), callback("y")]; 24873} 24874 24875 24876 24877;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs 24878function isIdentityScale(scale) { 24879 return scale === undefined || scale === 1; 24880} 24881function hasScale({ scale, scaleX, scaleY }) { 24882 return (!isIdentityScale(scale) || 24883 !isIdentityScale(scaleX) || 24884 !isIdentityScale(scaleY)); 24885} 24886function hasTransform(values) { 24887 return (hasScale(values) || 24888 has2DTranslate(values) || 24889 values.z || 24890 values.rotate || 24891 values.rotateX || 24892 values.rotateY || 24893 values.skewX || 24894 values.skewY); 24895} 24896function has2DTranslate(values) { 24897 return is2DTranslate(values.x) || is2DTranslate(values.y); 24898} 24899function is2DTranslate(value) { 24900 return value && value !== "0%"; 24901} 24902 24903 24904 24905;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs 24906 24907 24908 24909/** 24910 * Scales a point based on a factor and an originPoint 24911 */ 24912function scalePoint(point, scale, originPoint) { 24913 const distanceFromOrigin = point - originPoint; 24914 const scaled = scale * distanceFromOrigin; 24915 return originPoint + scaled; 24916} 24917/** 24918 * Applies a translate/scale delta to a point 24919 */ 24920function applyPointDelta(point, translate, scale, originPoint, boxScale) { 24921 if (boxScale !== undefined) { 24922 point = scalePoint(point, boxScale, originPoint); 24923 } 24924 return scalePoint(point, scale, originPoint) + translate; 24925} 24926/** 24927 * Applies a translate/scale delta to an axis 24928 */ 24929function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { 24930 axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); 24931 axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); 24932} 24933/** 24934 * Applies a translate/scale delta to a box 24935 */ 24936function applyBoxDelta(box, { x, y }) { 24937 applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); 24938 applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); 24939} 24940const TREE_SCALE_SNAP_MIN = 0.999999999999; 24941const TREE_SCALE_SNAP_MAX = 1.0000000000001; 24942/** 24943 * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms 24944 * in a tree upon our box before then calculating how to project it into our desired viewport-relative box 24945 * 24946 * This is the final nested loop within updateLayoutDelta for future refactoring 24947 */ 24948function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { 24949 const treeLength = treePath.length; 24950 if (!treeLength) 24951 return; 24952 // Reset the treeScale 24953 treeScale.x = treeScale.y = 1; 24954 let node; 24955 let delta; 24956 for (let i = 0; i < treeLength; i++) { 24957 node = treePath[i]; 24958 delta = node.projectionDelta; 24959 /** 24960 * TODO: Prefer to remove this, but currently we have motion components with 24961 * display: contents in Framer. 24962 */ 24963 const { visualElement } = node.options; 24964 if (visualElement && 24965 visualElement.props.style && 24966 visualElement.props.style.display === "contents") { 24967 continue; 24968 } 24969 if (isSharedTransition && 24970 node.options.layoutScroll && 24971 node.scroll && 24972 node !== node.root) { 24973 transformBox(box, { 24974 x: -node.scroll.offset.x, 24975 y: -node.scroll.offset.y, 24976 }); 24977 } 24978 if (delta) { 24979 // Incoporate each ancestor's scale into a culmulative treeScale for this component 24980 treeScale.x *= delta.x.scale; 24981 treeScale.y *= delta.y.scale; 24982 // Apply each ancestor's calculated delta into this component's recorded layout box 24983 applyBoxDelta(box, delta); 24984 } 24985 if (isSharedTransition && hasTransform(node.latestValues)) { 24986 transformBox(box, node.latestValues); 24987 } 24988 } 24989 /** 24990 * Snap tree scale back to 1 if it's within a non-perceivable threshold. 24991 * This will help reduce useless scales getting rendered. 24992 */ 24993 if (treeScale.x < TREE_SCALE_SNAP_MAX && 24994 treeScale.x > TREE_SCALE_SNAP_MIN) { 24995 treeScale.x = 1.0; 24996 } 24997 if (treeScale.y < TREE_SCALE_SNAP_MAX && 24998 treeScale.y > TREE_SCALE_SNAP_MIN) { 24999 treeScale.y = 1.0; 25000 } 25001} 25002function translateAxis(axis, distance) { 25003 axis.min = axis.min + distance; 25004 axis.max = axis.max + distance; 25005} 25006/** 25007 * Apply a transform to an axis from the latest resolved motion values. 25008 * This function basically acts as a bridge between a flat motion value map 25009 * and applyAxisDelta 25010 */ 25011function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { 25012 const originPoint = mixNumber(axis.min, axis.max, axisOrigin); 25013 // Apply the axis delta to the final axis 25014 applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); 25015} 25016/** 25017 * Apply a transform to a box from the latest resolved motion values. 25018 */ 25019function transformBox(box, transform) { 25020 transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX); 25021 transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY); 25022} 25023 25024 25025 25026;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/utils/measure.mjs 25027 25028 25029 25030function measureViewportBox(instance, transformPoint) { 25031 return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); 25032} 25033function measurePageBox(element, rootProjectionNode, transformPagePoint) { 25034 const viewportBox = measureViewportBox(element, transformPagePoint); 25035 const { scroll } = rootProjectionNode; 25036 if (scroll) { 25037 translateAxis(viewportBox.x, scroll.offset.x); 25038 translateAxis(viewportBox.y, scroll.offset.y); 25039 } 25040 return viewportBox; 25041} 25042 25043 25044 25045;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/get-context-window.mjs 25046// Fixes https://github.com/motiondivision/motion/issues/2270 25047const getContextWindow = ({ current }) => { 25048 return current ? current.ownerDocument.defaultView : null; 25049}; 25050 25051 25052 25053;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-ref-object.mjs 25054function isRefObject(ref) { 25055 return (ref && 25056 typeof ref === "object" && 25057 Object.prototype.hasOwnProperty.call(ref, "current")); 25058} 25059 25060 25061 25062;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/distance.mjs 25063const distance = (a, b) => Math.abs(a - b); 25064function distance2D(a, b) { 25065 // Multi-dimensional 25066 const xDelta = distance(a.x, b.x); 25067 const yDelta = distance(a.y, b.y); 25068 return Math.sqrt(xDelta ** 2 + yDelta ** 2); 25069} 25070 25071 25072 25073;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs 25074 25075 25076 25077 25078 25079 25080 25081/** 25082 * @internal 25083 */ 25084class PanSession { 25085 constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) { 25086 /** 25087 * @internal 25088 */ 25089 this.startEvent = null; 25090 /** 25091 * @internal 25092 */ 25093 this.lastMoveEvent = null; 25094 /** 25095 * @internal 25096 */ 25097 this.lastMoveEventInfo = null; 25098 /** 25099 * @internal 25100 */ 25101 this.handlers = {}; 25102 /** 25103 * @internal 25104 */ 25105 this.contextWindow = window; 25106 this.updatePoint = () => { 25107 if (!(this.lastMoveEvent && this.lastMoveEventInfo)) 25108 return; 25109 const info = getPanInfo(this.lastMoveEventInfo, this.history); 25110 const isPanStarted = this.startEvent !== null; 25111 // Only start panning if the offset is larger than 3 pixels. If we make it 25112 // any larger than this we'll want to reset the pointer history 25113 // on the first update to avoid visual snapping to the cursoe. 25114 const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3; 25115 if (!isPanStarted && !isDistancePastThreshold) 25116 return; 25117 const { point } = info; 25118 const { timestamp } = frame_frameData; 25119 this.history.push({ ...point, timestamp }); 25120 const { onStart, onMove } = this.handlers; 25121 if (!isPanStarted) { 25122 onStart && onStart(this.lastMoveEvent, info); 25123 this.startEvent = this.lastMoveEvent; 25124 } 25125 onMove && onMove(this.lastMoveEvent, info); 25126 }; 25127 this.handlePointerMove = (event, info) => { 25128 this.lastMoveEvent = event; 25129 this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); 25130 // Throttle mouse move event to once per frame 25131 frame_frame.update(this.updatePoint, true); 25132 }; 25133 this.handlePointerUp = (event, info) => { 25134 this.end(); 25135 const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; 25136 if (this.dragSnapToOrigin) 25137 resumeAnimation && resumeAnimation(); 25138 if (!(this.lastMoveEvent && this.lastMoveEventInfo)) 25139 return; 25140 const panInfo = getPanInfo(event.type === "pointercancel" 25141 ? this.lastMoveEventInfo 25142 : transformPoint(info, this.transformPagePoint), this.history); 25143 if (this.startEvent && onEnd) { 25144 onEnd(event, panInfo); 25145 } 25146 onSessionEnd && onSessionEnd(event, panInfo); 25147 }; 25148 // If we have more than one touch, don't start detecting this gesture 25149 if (!isPrimaryPointer(event)) 25150 return; 25151 this.dragSnapToOrigin = dragSnapToOrigin; 25152 this.handlers = handlers; 25153 this.transformPagePoint = transformPagePoint; 25154 this.contextWindow = contextWindow || window; 25155 const info = extractEventInfo(event); 25156 const initialInfo = transformPoint(info, this.transformPagePoint); 25157 const { point } = initialInfo; 25158 const { timestamp } = frame_frameData; 25159 this.history = [{ ...point, timestamp }]; 25160 const { onSessionStart } = handlers; 25161 onSessionStart && 25162 onSessionStart(event, getPanInfo(initialInfo, this.history)); 25163 this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp)); 25164 } 25165 updateHandlers(handlers) { 25166 this.handlers = handlers; 25167 } 25168 end() { 25169 this.removeListeners && this.removeListeners(); 25170 frame_cancelFrame(this.updatePoint); 25171 } 25172} 25173function transformPoint(info, transformPagePoint) { 25174 return transformPagePoint ? { point: transformPagePoint(info.point) } : info; 25175} 25176function subtractPoint(a, b) { 25177 return { x: a.x - b.x, y: a.y - b.y }; 25178} 25179function getPanInfo({ point }, history) { 25180 return { 25181 point, 25182 delta: subtractPoint(point, lastDevicePoint(history)), 25183 offset: subtractPoint(point, startDevicePoint(history)), 25184 velocity: getVelocity(history, 0.1), 25185 }; 25186} 25187function startDevicePoint(history) { 25188 return history[0]; 25189} 25190function lastDevicePoint(history) { 25191 return history[history.length - 1]; 25192} 25193function getVelocity(history, timeDelta) { 25194 if (history.length < 2) { 25195 return { x: 0, y: 0 }; 25196 } 25197 let i = history.length - 1; 25198 let timestampedPoint = null; 25199 const lastPoint = lastDevicePoint(history); 25200 while (i >= 0) { 25201 timestampedPoint = history[i]; 25202 if (lastPoint.timestamp - timestampedPoint.timestamp > 25203 time_conversion_secondsToMilliseconds(timeDelta)) { 25204 break; 25205 } 25206 i--; 25207 } 25208 if (!timestampedPoint) { 25209 return { x: 0, y: 0 }; 25210 } 25211 const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); 25212 if (time === 0) { 25213 return { x: 0, y: 0 }; 25214 } 25215 const currentVelocity = { 25216 x: (lastPoint.x - timestampedPoint.x) / time, 25217 y: (lastPoint.y - timestampedPoint.y) / time, 25218 }; 25219 if (currentVelocity.x === Infinity) { 25220 currentVelocity.x = 0; 25221 } 25222 if (currentVelocity.y === Infinity) { 25223 currentVelocity.y = 0; 25224 } 25225 return currentVelocity; 25226} 25227 25228 25229 25230;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs 25231 25232 25233 25234 25235 25236/** 25237 * Apply constraints to a point. These constraints are both physical along an 25238 * axis, and an elastic factor that determines how much to constrain the point 25239 * by if it does lie outside the defined parameters. 25240 */ 25241function applyConstraints(point, { min, max }, elastic) { 25242 if (min !== undefined && point < min) { 25243 // If we have a min point defined, and this is outside of that, constrain 25244 point = elastic 25245 ? mixNumber(min, point, elastic.min) 25246 : Math.max(point, min); 25247 } 25248 else if (max !== undefined && point > max) { 25249 // If we have a max point defined, and this is outside of that, constrain 25250 point = elastic 25251 ? mixNumber(max, point, elastic.max) 25252 : Math.min(point, max); 25253 } 25254 return point; 25255} 25256/** 25257 * Calculate constraints in terms of the viewport when defined relatively to the 25258 * measured axis. This is measured from the nearest edge, so a max constraint of 200 25259 * on an axis with a max value of 300 would return a constraint of 500 - axis length 25260 */ 25261function calcRelativeAxisConstraints(axis, min, max) { 25262 return { 25263 min: min !== undefined ? axis.min + min : undefined, 25264 max: max !== undefined 25265 ? axis.max + max - (axis.max - axis.min) 25266 : undefined, 25267 }; 25268} 25269/** 25270 * Calculate constraints in terms of the viewport when 25271 * defined relatively to the measured bounding box. 25272 */ 25273function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { 25274 return { 25275 x: calcRelativeAxisConstraints(layoutBox.x, left, right), 25276 y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), 25277 }; 25278} 25279/** 25280 * Calculate viewport constraints when defined as another viewport-relative axis 25281 */ 25282function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { 25283 let min = constraintsAxis.min - layoutAxis.min; 25284 let max = constraintsAxis.max - layoutAxis.max; 25285 // If the constraints axis is actually smaller than the layout axis then we can 25286 // flip the constraints 25287 if (constraintsAxis.max - constraintsAxis.min < 25288 layoutAxis.max - layoutAxis.min) { 25289 [min, max] = [max, min]; 25290 } 25291 return { min, max }; 25292} 25293/** 25294 * Calculate viewport constraints when defined as another viewport-relative box 25295 */ 25296function calcViewportConstraints(layoutBox, constraintsBox) { 25297 return { 25298 x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), 25299 y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), 25300 }; 25301} 25302/** 25303 * Calculate a transform origin relative to the source axis, between 0-1, that results 25304 * in an asthetically pleasing scale/transform needed to project from source to target. 25305 */ 25306function calcOrigin(source, target) { 25307 let origin = 0.5; 25308 const sourceLength = calcLength(source); 25309 const targetLength = calcLength(target); 25310 if (targetLength > sourceLength) { 25311 origin = progress(target.min, target.max - sourceLength, source.min); 25312 } 25313 else if (sourceLength > targetLength) { 25314 origin = progress(source.min, source.max - targetLength, target.min); 25315 } 25316 return clamp(0, 1, origin); 25317} 25318/** 25319 * Rebase the calculated viewport constraints relative to the layout.min point. 25320 */ 25321function rebaseAxisConstraints(layout, constraints) { 25322 const relativeConstraints = {}; 25323 if (constraints.min !== undefined) { 25324 relativeConstraints.min = constraints.min - layout.min; 25325 } 25326 if (constraints.max !== undefined) { 25327 relativeConstraints.max = constraints.max - layout.min; 25328 } 25329 return relativeConstraints; 25330} 25331const defaultElastic = 0.35; 25332/** 25333 * Accepts a dragElastic prop and returns resolved elastic values for each axis. 25334 */ 25335function resolveDragElastic(dragElastic = defaultElastic) { 25336 if (dragElastic === false) { 25337 dragElastic = 0; 25338 } 25339 else if (dragElastic === true) { 25340 dragElastic = defaultElastic; 25341 } 25342 return { 25343 x: resolveAxisElastic(dragElastic, "left", "right"), 25344 y: resolveAxisElastic(dragElastic, "top", "bottom"), 25345 }; 25346} 25347function resolveAxisElastic(dragElastic, minLabel, maxLabel) { 25348 return { 25349 min: resolvePointElastic(dragElastic, minLabel), 25350 max: resolvePointElastic(dragElastic, maxLabel), 25351 }; 25352} 25353function resolvePointElastic(dragElastic, label) { 25354 return typeof dragElastic === "number" 25355 ? dragElastic 25356 : dragElastic[label] || 0; 25357} 25358 25359 25360 25361;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs 25362 25363 25364 25365 25366 25367 25368 25369 25370 25371 25372 25373 25374 25375 25376 25377 25378 25379 25380 25381const elementDragControls = new WeakMap(); 25382/** 25383 * 25384 */ 25385// let latestPointerEvent: PointerEvent 25386class VisualElementDragControls { 25387 constructor(visualElement) { 25388 this.openDragLock = null; 25389 this.isDragging = false; 25390 this.currentDirection = null; 25391 this.originPoint = { x: 0, y: 0 }; 25392 /** 25393 * The permitted boundaries of travel, in pixels. 25394 */ 25395 this.constraints = false; 25396 this.hasMutatedConstraints = false; 25397 /** 25398 * The per-axis resolved elastic values. 25399 */ 25400 this.elastic = createBox(); 25401 this.visualElement = visualElement; 25402 } 25403 start(originEvent, { snapToCursor = false } = {}) { 25404 /** 25405 * Don't start dragging if this component is exiting 25406 */ 25407 const { presenceContext } = this.visualElement; 25408 if (presenceContext && presenceContext.isPresent === false) 25409 return; 25410 const onSessionStart = (event) => { 25411 const { dragSnapToOrigin } = this.getProps(); 25412 // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch 25413 // the component. 25414 dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation(); 25415 if (snapToCursor) { 25416 this.snapToCursor(extractEventInfo(event).point); 25417 } 25418 }; 25419 const onStart = (event, info) => { 25420 // Attempt to grab the global drag gesture lock - maybe make this part of PanSession 25421 const { drag, dragPropagation, onDragStart } = this.getProps(); 25422 if (drag && !dragPropagation) { 25423 if (this.openDragLock) 25424 this.openDragLock(); 25425 this.openDragLock = setDragLock(drag); 25426 // If we don 't have the lock, don't start dragging 25427 if (!this.openDragLock) 25428 return; 25429 } 25430 this.isDragging = true; 25431 this.currentDirection = null; 25432 this.resolveConstraints(); 25433 if (this.visualElement.projection) { 25434 this.visualElement.projection.isAnimationBlocked = true; 25435 this.visualElement.projection.target = undefined; 25436 } 25437 /** 25438 * Record gesture origin 25439 */ 25440 eachAxis((axis) => { 25441 let current = this.getAxisMotionValue(axis).get() || 0; 25442 /** 25443 * If the MotionValue is a percentage value convert to px 25444 */ 25445 if (percent.test(current)) { 25446 const { projection } = this.visualElement; 25447 if (projection && projection.layout) { 25448 const measuredAxis = projection.layout.layoutBox[axis]; 25449 if (measuredAxis) { 25450 const length = calcLength(measuredAxis); 25451 current = length * (parseFloat(current) / 100); 25452 } 25453 } 25454 } 25455 this.originPoint[axis] = current; 25456 }); 25457 // Fire onDragStart event 25458 if (onDragStart) { 25459 frame_frame.postRender(() => onDragStart(event, info)); 25460 } 25461 addValueToWillChange(this.visualElement, "transform"); 25462 const { animationState } = this.visualElement; 25463 animationState && animationState.setActive("whileDrag", true); 25464 }; 25465 const onMove = (event, info) => { 25466 // latestPointerEvent = event 25467 const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); 25468 // If we didn't successfully receive the gesture lock, early return. 25469 if (!dragPropagation && !this.openDragLock) 25470 return; 25471 const { offset } = info; 25472 // Attempt to detect drag direction if directionLock is true 25473 if (dragDirectionLock && this.currentDirection === null) { 25474 this.currentDirection = getCurrentDirection(offset); 25475 // If we've successfully set a direction, notify listener 25476 if (this.currentDirection !== null) { 25477 onDirectionLock && onDirectionLock(this.currentDirection); 25478 } 25479 return; 25480 } 25481 // Update each point with the latest position 25482 this.updateAxis("x", info.point, offset); 25483 this.updateAxis("y", info.point, offset); 25484 /** 25485 * Ideally we would leave the renderer to fire naturally at the end of 25486 * this frame but if the element is about to change layout as the result 25487 * of a re-render we want to ensure the browser can read the latest 25488 * bounding box to ensure the pointer and element don't fall out of sync. 25489 */ 25490 this.visualElement.render(); 25491 /** 25492 * This must fire after the render call as it might trigger a state 25493 * change which itself might trigger a layout update. 25494 */ 25495 onDrag && onDrag(event, info); 25496 }; 25497 const onSessionEnd = (event, info) => this.stop(event, info); 25498 const resumeAnimation = () => eachAxis((axis) => { 25499 var _a; 25500 return this.getAnimationState(axis) === "paused" && 25501 ((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play()); 25502 }); 25503 const { dragSnapToOrigin } = this.getProps(); 25504 this.panSession = new PanSession(originEvent, { 25505 onSessionStart, 25506 onStart, 25507 onMove, 25508 onSessionEnd, 25509 resumeAnimation, 25510 }, { 25511 transformPagePoint: this.visualElement.getTransformPagePoint(), 25512 dragSnapToOrigin, 25513 contextWindow: getContextWindow(this.visualElement), 25514 }); 25515 } 25516 stop(event, info) { 25517 const isDragging = this.isDragging; 25518 this.cancel(); 25519 if (!isDragging) 25520 return; 25521 const { velocity } = info; 25522 this.startAnimation(velocity); 25523 const { onDragEnd } = this.getProps(); 25524 if (onDragEnd) { 25525 frame_frame.postRender(() => onDragEnd(event, info)); 25526 } 25527 } 25528 cancel() { 25529 this.isDragging = false; 25530 const { projection, animationState } = this.visualElement; 25531 if (projection) { 25532 projection.isAnimationBlocked = false; 25533 } 25534 this.panSession && this.panSession.end(); 25535 this.panSession = undefined; 25536 const { dragPropagation } = this.getProps(); 25537 if (!dragPropagation && this.openDragLock) { 25538 this.openDragLock(); 25539 this.openDragLock = null; 25540 } 25541 animationState && animationState.setActive("whileDrag", false); 25542 } 25543 updateAxis(axis, _point, offset) { 25544 const { drag } = this.getProps(); 25545 // If we're not dragging this axis, do an early return. 25546 if (!offset || !shouldDrag(axis, drag, this.currentDirection)) 25547 return; 25548 const axisValue = this.getAxisMotionValue(axis); 25549 let next = this.originPoint[axis] + offset[axis]; 25550 // Apply constraints 25551 if (this.constraints && this.constraints[axis]) { 25552 next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); 25553 } 25554 axisValue.set(next); 25555 } 25556 resolveConstraints() { 25557 var _a; 25558 const { dragConstraints, dragElastic } = this.getProps(); 25559 const layout = this.visualElement.projection && 25560 !this.visualElement.projection.layout 25561 ? this.visualElement.projection.measure(false) 25562 : (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout; 25563 const prevConstraints = this.constraints; 25564 if (dragConstraints && isRefObject(dragConstraints)) { 25565 if (!this.constraints) { 25566 this.constraints = this.resolveRefConstraints(); 25567 } 25568 } 25569 else { 25570 if (dragConstraints && layout) { 25571 this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); 25572 } 25573 else { 25574 this.constraints = false; 25575 } 25576 } 25577 this.elastic = resolveDragElastic(dragElastic); 25578 /** 25579 * If we're outputting to external MotionValues, we want to rebase the measured constraints 25580 * from viewport-relative to component-relative. 25581 */ 25582 if (prevConstraints !== this.constraints && 25583 layout && 25584 this.constraints && 25585 !this.hasMutatedConstraints) { 25586 eachAxis((axis) => { 25587 if (this.constraints !== false && 25588 this.getAxisMotionValue(axis)) { 25589 this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); 25590 } 25591 }); 25592 } 25593 } 25594 resolveRefConstraints() { 25595 const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); 25596 if (!constraints || !isRefObject(constraints)) 25597 return false; 25598 const constraintsElement = constraints.current; 25599 invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."); 25600 const { projection } = this.visualElement; 25601 // TODO 25602 if (!projection || !projection.layout) 25603 return false; 25604 const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); 25605 let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); 25606 /** 25607 * If there's an onMeasureDragConstraints listener we call it and 25608 * if different constraints are returned, set constraints to that 25609 */ 25610 if (onMeasureDragConstraints) { 25611 const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); 25612 this.hasMutatedConstraints = !!userConstraints; 25613 if (userConstraints) { 25614 measuredConstraints = convertBoundingBoxToBox(userConstraints); 25615 } 25616 } 25617 return measuredConstraints; 25618 } 25619 startAnimation(velocity) { 25620 const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); 25621 const constraints = this.constraints || {}; 25622 const momentumAnimations = eachAxis((axis) => { 25623 if (!shouldDrag(axis, drag, this.currentDirection)) { 25624 return; 25625 } 25626 let transition = (constraints && constraints[axis]) || {}; 25627 if (dragSnapToOrigin) 25628 transition = { min: 0, max: 0 }; 25629 /** 25630 * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame 25631 * of spring animations so we should look into adding a disable spring option to `inertia`. 25632 * We could do something here where we affect the `bounceStiffness` and `bounceDamping` 25633 * using the value of `dragElastic`. 25634 */ 25635 const bounceStiffness = dragElastic ? 200 : 1000000; 25636 const bounceDamping = dragElastic ? 40 : 10000000; 25637 const inertia = { 25638 type: "inertia", 25639 velocity: dragMomentum ? velocity[axis] : 0, 25640 bounceStiffness, 25641 bounceDamping, 25642 timeConstant: 750, 25643 restDelta: 1, 25644 restSpeed: 10, 25645 ...dragTransition, 25646 ...transition, 25647 }; 25648 // If we're not animating on an externally-provided `MotionValue` we can use the 25649 // component's animation controls which will handle interactions with whileHover (etc), 25650 // otherwise we just have to animate the `MotionValue` itself. 25651 return this.startAxisValueAnimation(axis, inertia); 25652 }); 25653 // Run all animations and then resolve the new drag constraints. 25654 return Promise.all(momentumAnimations).then(onDragTransitionEnd); 25655 } 25656 startAxisValueAnimation(axis, transition) { 25657 const axisValue = this.getAxisMotionValue(axis); 25658 addValueToWillChange(this.visualElement, axis); 25659 return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); 25660 } 25661 stopAnimation() { 25662 eachAxis((axis) => this.getAxisMotionValue(axis).stop()); 25663 } 25664 pauseAnimation() { 25665 eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); }); 25666 } 25667 getAnimationState(axis) { 25668 var _a; 25669 return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state; 25670 } 25671 /** 25672 * Drag works differently depending on which props are provided. 25673 * 25674 * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. 25675 * - Otherwise, we apply the delta to the x/y motion values. 25676 */ 25677 getAxisMotionValue(axis) { 25678 const dragKey = `_drag${axis.toUpperCase()}`; 25679 const props = this.visualElement.getProps(); 25680 const externalMotionValue = props[dragKey]; 25681 return externalMotionValue 25682 ? externalMotionValue 25683 : this.visualElement.getValue(axis, (props.initial 25684 ? props.initial[axis] 25685 : undefined) || 0); 25686 } 25687 snapToCursor(point) { 25688 eachAxis((axis) => { 25689 const { drag } = this.getProps(); 25690 // If we're not dragging this axis, do an early return. 25691 if (!shouldDrag(axis, drag, this.currentDirection)) 25692 return; 25693 const { projection } = this.visualElement; 25694 const axisValue = this.getAxisMotionValue(axis); 25695 if (projection && projection.layout) { 25696 const { min, max } = projection.layout.layoutBox[axis]; 25697 axisValue.set(point[axis] - mixNumber(min, max, 0.5)); 25698 } 25699 }); 25700 } 25701 /** 25702 * When the viewport resizes we want to check if the measured constraints 25703 * have changed and, if so, reposition the element within those new constraints 25704 * relative to where it was before the resize. 25705 */ 25706 scalePositionWithinConstraints() { 25707 if (!this.visualElement.current) 25708 return; 25709 const { drag, dragConstraints } = this.getProps(); 25710 const { projection } = this.visualElement; 25711 if (!isRefObject(dragConstraints) || !projection || !this.constraints) 25712 return; 25713 /** 25714 * Stop current animations as there can be visual glitching if we try to do 25715 * this mid-animation 25716 */ 25717 this.stopAnimation(); 25718 /** 25719 * Record the relative position of the dragged element relative to the 25720 * constraints box and save as a progress value. 25721 */ 25722 const boxProgress = { x: 0, y: 0 }; 25723 eachAxis((axis) => { 25724 const axisValue = this.getAxisMotionValue(axis); 25725 if (axisValue && this.constraints !== false) { 25726 const latest = axisValue.get(); 25727 boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); 25728 } 25729 }); 25730 /** 25731 * Update the layout of this element and resolve the latest drag constraints 25732 */ 25733 const { transformTemplate } = this.visualElement.getProps(); 25734 this.visualElement.current.style.transform = transformTemplate 25735 ? transformTemplate({}, "") 25736 : "none"; 25737 projection.root && projection.root.updateScroll(); 25738 projection.updateLayout(); 25739 this.resolveConstraints(); 25740 /** 25741 * For each axis, calculate the current progress of the layout axis 25742 * within the new constraints. 25743 */ 25744 eachAxis((axis) => { 25745 if (!shouldDrag(axis, drag, null)) 25746 return; 25747 /** 25748 * Calculate a new transform based on the previous box progress 25749 */ 25750 const axisValue = this.getAxisMotionValue(axis); 25751 const { min, max } = this.constraints[axis]; 25752 axisValue.set(mixNumber(min, max, boxProgress[axis])); 25753 }); 25754 } 25755 addListeners() { 25756 if (!this.visualElement.current) 25757 return; 25758 elementDragControls.set(this.visualElement, this); 25759 const element = this.visualElement.current; 25760 /** 25761 * Attach a pointerdown event listener on this DOM element to initiate drag tracking. 25762 */ 25763 const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { 25764 const { drag, dragListener = true } = this.getProps(); 25765 drag && dragListener && this.start(event); 25766 }); 25767 const measureDragConstraints = () => { 25768 const { dragConstraints } = this.getProps(); 25769 if (isRefObject(dragConstraints) && dragConstraints.current) { 25770 this.constraints = this.resolveRefConstraints(); 25771 } 25772 }; 25773 const { projection } = this.visualElement; 25774 const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); 25775 if (projection && !projection.layout) { 25776 projection.root && projection.root.updateScroll(); 25777 projection.updateLayout(); 25778 } 25779 frame_frame.read(measureDragConstraints); 25780 /** 25781 * Attach a window resize listener to scale the draggable target within its defined 25782 * constraints as the window resizes. 25783 */ 25784 const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); 25785 /** 25786 * If the element's layout changes, calculate the delta and apply that to 25787 * the drag gesture's origin point. 25788 */ 25789 const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { 25790 if (this.isDragging && hasLayoutChanged) { 25791 eachAxis((axis) => { 25792 const motionValue = this.getAxisMotionValue(axis); 25793 if (!motionValue) 25794 return; 25795 this.originPoint[axis] += delta[axis].translate; 25796 motionValue.set(motionValue.get() + delta[axis].translate); 25797 }); 25798 this.visualElement.render(); 25799 } 25800 })); 25801 return () => { 25802 stopResizeListener(); 25803 stopPointerListener(); 25804 stopMeasureLayoutListener(); 25805 stopLayoutUpdateListener && stopLayoutUpdateListener(); 25806 }; 25807 } 25808 getProps() { 25809 const props = this.visualElement.getProps(); 25810 const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; 25811 return { 25812 ...props, 25813 drag, 25814 dragDirectionLock, 25815 dragPropagation, 25816 dragConstraints, 25817 dragElastic, 25818 dragMomentum, 25819 }; 25820 } 25821} 25822function shouldDrag(direction, drag, currentDirection) { 25823 return ((drag === true || drag === direction) && 25824 (currentDirection === null || currentDirection === direction)); 25825} 25826/** 25827 * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower 25828 * than the provided threshold, return `null`. 25829 * 25830 * @param offset - The x/y offset from origin. 25831 * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. 25832 */ 25833function getCurrentDirection(offset, lockThreshold = 10) { 25834 let direction = null; 25835 if (Math.abs(offset.y) > lockThreshold) { 25836 direction = "y"; 25837 } 25838 else if (Math.abs(offset.x) > lockThreshold) { 25839 direction = "x"; 25840 } 25841 return direction; 25842} 25843 25844 25845 25846;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/index.mjs 25847 25848 25849 25850 25851class DragGesture extends Feature { 25852 constructor(node) { 25853 super(node); 25854 this.removeGroupControls = noop_noop; 25855 this.removeListeners = noop_noop; 25856 this.controls = new VisualElementDragControls(node); 25857 } 25858 mount() { 25859 // If we've been provided a DragControls for manual control over the drag gesture, 25860 // subscribe this component to it on mount. 25861 const { dragControls } = this.node.getProps(); 25862 if (dragControls) { 25863 this.removeGroupControls = dragControls.subscribe(this.controls); 25864 } 25865 this.removeListeners = this.controls.addListeners() || noop_noop; 25866 } 25867 unmount() { 25868 this.removeGroupControls(); 25869 this.removeListeners(); 25870 } 25871} 25872 25873 25874 25875;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/pan/index.mjs 25876 25877 25878 25879 25880 25881 25882 25883const asyncHandler = (handler) => (event, info) => { 25884 if (handler) { 25885 frame_frame.postRender(() => handler(event, info)); 25886 } 25887}; 25888class PanGesture extends Feature { 25889 constructor() { 25890 super(...arguments); 25891 this.removePointerDownListener = noop_noop; 25892 } 25893 onPointerDown(pointerDownEvent) { 25894 this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { 25895 transformPagePoint: this.node.getTransformPagePoint(), 25896 contextWindow: getContextWindow(this.node), 25897 }); 25898 } 25899 createPanHandlers() { 25900 const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); 25901 return { 25902 onSessionStart: asyncHandler(onPanSessionStart), 25903 onStart: asyncHandler(onPanStart), 25904 onMove: onPan, 25905 onEnd: (event, info) => { 25906 delete this.session; 25907 if (onPanEnd) { 25908 frame_frame.postRender(() => onPanEnd(event, info)); 25909 } 25910 }, 25911 }; 25912 } 25913 mount() { 25914 this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); 25915 } 25916 update() { 25917 this.session && this.session.updateHandlers(this.createPanHandlers()); 25918 } 25919 unmount() { 25920 this.removePointerDownListener(); 25921 this.session && this.session.end(); 25922 } 25923} 25924 25925 25926 25927// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 25928var jsx_runtime = __webpack_require__(5893); 25929// EXTERNAL MODULE: ./node_modules/react/index.js 25930var react = __webpack_require__(7294); 25931// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs 25932var use_presence = __webpack_require__(6302); 25933// EXTERNAL MODULE: ./node_modules
25933/framer-motion/dist/es/context/LayoutGroupContext.mjs 25934var LayoutGroupContext = __webpack_require__(5364); 25935;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs 25936"use client"; 25937 25938 25939/** 25940 * Internal, exported only for usage in Framer 25941 */ 25942const SwitchLayoutGroupContext = (0,react.createContext)({}); 25943 25944 25945 25946;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/state.mjs 25947/** 25948 * This should only ever be modified on the client otherwise it'll 25949 * persist through server requests. If we need instanced states we 25950 * could lazy-init via root. 25951 */ 25952const globalProjectionState = { 25953 /** 25954 * Global flag as to whether the tree has animated since the last time 25955 * we resized the window 25956 */ 25957 hasAnimatedSinceResize: true, 25958 /** 25959 * We set this to true once, on the first update. Any nodes added to the tree beyond that 25960 * update will be given a `data-projection-id` attribute. 25961 */ 25962 hasEverUpdated: false, 25963}; 25964 25965 25966 25967;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs 25968 25969 25970function pixelsToPercent(pixels, axis) { 25971 if (axis.max === axis.min) 25972 return 0; 25973 return (pixels / (axis.max - axis.min)) * 100; 25974} 25975/** 25976 * We always correct borderRadius as a percentage rather than pixels to reduce paints. 25977 * For example, if you are projecting a box that is 100px wide with a 10px borderRadius
25978 * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% 25979 * borderRadius in both states. If we animate between the two in pixels that will trigger 25980 * a paint each time. If we animate between the two in percentage we'll avoid a paint. 25981 */ 25982const correctBorderRadius = { 25983 correct: (latest, node) => { 25984 if (!node.target) 25985 return latest; 25986 /** 25987 * If latest is a string, if it's a percentage we can return immediately as it's 25988 * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. 25989 */ 25990 if (typeof latest === "string") { 25991 if (px.test(latest)) { 25992 latest = parseFloat(latest); 25993 } 25994 else { 25995 return latest; 25996 } 25997 } 25998 /** 25999 * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that 26000 * pixel value as a percentage of each axis 26001 */ 26002 const x = pixelsToPercent(latest, node.target.x); 26003 const y = pixelsToPercent(latest, node.target.y); 26004 return `${x}% ${y}%`; 26005 }, 26006}; 26007 26008 26009 26010;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs 26011 26012 26013 26014const correctBoxShadow = { 26015 correct: (latest, { treeScale, projectionDelta }) => { 26016 const original = latest; 26017 const shadow = complex.parse(latest); 26018 // TODO: Doesn't support multiple shadows 26019 if (shadow.length > 5) 26020 return original; 26021 const template = complex.createTransformer(latest); 26022 const offset = typeof shadow[0] !== "number" ? 1 : 0; 26023 // Calculate the overall context scale 26024 const xScale = projectionDelta.x.scale * treeScale.x; 26025 const yScale = projectionDelta.y.scale * treeScale.y; 26026 shadow[0 + offset] /= xScale; 26027 shadow[1 + offset] /= yScale; 26028 /** 26029 * Ideally we'd correct x and y scales individually, but because blur and 26030 * spread apply to both we have to take a scale average and apply that instead. 26031 * We could potentially improve the outcome of this by incorporating the ratio between 26032 * the two scales. 26033 */ 26034 const averageScale = mixNumber(xScale, yScale, 0.5); 26035 // Blur 26036 if (typeof shadow[2 + offset] === "number") 26037 shadow[2 + offset] /= averageScale; 26038 // Spread 26039 if (typeof shadow[3 + offset] === "number") 26040 shadow[3 + offset] /= averageScale; 26041 return template(shadow); 26042 }, 26043}; 26044 26045 26046 26047;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs 26048 26049 26050const scaleCorrectors = {}; 26051function addScaleCorrector(correctors) { 26052 for (const key in correctors) { 26053 scaleCorrectors[key] = correctors[key]; 26054 if (isCSSVariableName(key)) { 26055 scaleCorrectors[key].isCSSVariable = true; 26056 } 26057 } 26058} 26059 26060 26061 26062;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs 26063"use client"; 26064 26065 26066 26067 26068 26069 26070 26071 26072 26073 26074 26075class MeasureLayoutWithContext extends react.Component { 26076 /** 26077 * This only mounts projection nodes for components that 26078 * need measuring, we might want to do it for all components 26079 * in order to incorporate transforms 26080 */ 26081 componentDidMount() { 26082 const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; 26083 const { projection } = visualElement; 26084 addScaleCorrector(defaultScaleCorrectors); 26085 if (projection) { 26086 if (layoutGroup.group) 26087 layoutGroup.group.add(projection); 26088 if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { 26089 switchLayoutGroup.register(projection); 26090 } 26091 projection.root.didUpdate(); 26092 projection.addEventListener("animationComplete", () => { 26093 this.safeToRemove(); 26094 }); 26095 projection.setOptions({ 26096 ...projection.options, 26097 onExitComplete: () => this.safeToRemove(), 26098 }); 26099 } 26100 globalProjectionState.hasEverUpdated = true; 26101 } 26102 getSnapshotBeforeUpdate(prevProps) { 26103 const { layoutDependency, visualElement, drag, isPresent } = this.props; 26104 const projection = visualElement.projection; 26105 if (!projection) 26106 return null; 26107 /** 26108 * TODO: We use this data in relegate to determine whether to 26109 * promote a previous element. There's no guarantee its presence data 26110 * will have updated by this point - if a bug like this arises it will 26111 * have to be that we markForRelegation and then find a new lead some other way, 26112 * perhaps in didUpdate 26113 */ 26114 projection.isPresent = isPresent; 26115 if (drag || 26116 prevProps.layoutDependency !== layoutDependency || 26117 layoutDependency === undefined || 26118 prevProps.isPresent !== isPresent) { 26119 projection.willUpdate(); 26120 } 26121 else { 26122 this.safeToRemove(); 26123 } 26124 if (prevProps.isPresent !== isPresent) { 26125 if (isPresent) { 26126 projection.promote(); 26127 } 26128 else if (!projection.relegate()) { 26129 /** 26130 * If there's another stack member taking over from this one, 26131 * it's in charge of the exit animation and therefore should 26132 * be in charge of the safe to remove. Otherwise we call it here. 26133 */ 26134 frame_frame.postRender(() => { 26135 const stack = projection.getStack(); 26136 if (!stack || !stack.members.length) { 26137 this.safeToRemove(); 26138 } 26139 }); 26140 } 26141 } 26142 return null; 26143 } 26144 componentDidUpdate() { 26145 const { projection } = this.props.visualElement; 26146 if (projection) { 26147 projection.root.didUpdate(); 26148 microtask_microtask.postRender(() => { 26149 if (!projection.currentAnimation && projection.isLead()) { 26150 this.safeToRemove(); 26151 } 26152 }); 26153 } 26154 } 26155 componentWillUnmount() { 26156 const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; 26157 const { projection } = visualElement; 26158 if (projection) { 26159 projection.scheduleCheckAfterUnmount(); 26160 if (layoutGroup && layoutGroup.group) 26161 layoutGroup.group.remove(projection); 26162 if (promoteContext && promoteContext.deregister) 26163 promoteContext.deregister(projection); 26164 } 26165 } 26166 safeToRemove() { 26167 const { safeToRemove } = this.props; 26168 safeToRemove && safeToRemove(); 26169 } 26170 render() { 26171 return null; 26172 } 26173} 26174function MeasureLayout(props) { 26175 const [isPresent, safeToRemove] = (0,use_presence/* usePresence */.oO)(); 26176 const layoutGroup = (0,react.useContext)(LayoutGroupContext/* LayoutGroupContext */.p); 26177 return ((0,jsx_runtime.jsx)(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: (0,react.useContext)(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); 26178} 26179const defaultScaleCorrectors = { 26180 borderRadius: { 26181 ...correctBorderRadius, 26182 applyTo: [ 26183 "borderTopLeftRadius", 26184 "borderTopRightRadius", 26185 "borderBottomLeftRadius", 26186 "borderBottomRightRadius", 26187 ], 26188 }, 26189 borderTopLeftRadius: correctBorderRadius, 26190 borderTopRightRadius: correctBorderRadius, 26191 borderBottomLeftRadius: correctBorderRadius, 26192 borderBottomRightRadius: correctBorderRadius, 26193 boxShadow: correctBoxShadow, 26194}; 26195 26196 26197 26198;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animate/single-value.mjs 26199 26200 26201 26202 26203function animateSingleValue(value, keyframes, options) { 26204 const motionValue$1 = isMotionValue(value) ? value : motionValue(value); 26205 motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); 26206 return motionValue$1.animation; 26207} 26208 26209 26210 26211;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/ut
vendor: 7,335 bytes, lines 26211-26443
26211ils/is-svg-element.mjs 26212function isSVGElement(element) { 26213 return element instanceof SVGElement && element.tagName !== "svg"; 26214} 26215 26216 26217 26218;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs 26219const compareByDepth = (a, b) => a.depth - b.depth; 26220 26221 26222 26223;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs 26224 26225 26226 26227class FlatTree { 26228 constructor() { 26229 this.children = []; 26230 this.isDirty = false; 26231 } 26232 add(child) { 26233 addUniqueItem(this.children, child); 26234 this.isDirty = true; 26235 } 26236 remove(child) { 26237 array_removeItem(this.children, child); 26238 this.isDirty = true; 26239 } 26240 forEach(callback) { 26241 this.isDirty && this.children.sort(compareByDepth); 26242 this.isDirty = false; 26243 this.children.forEach(callback); 26244 } 26245} 26246 26247 26248 26249;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/delay.mjs 26250 26251 26252 26253/** 26254 * Timeout defined in ms 26255 */ 26256function delay(callback, timeout) { 26257 const start = time.now(); 26258 const checkElapsed = ({ timestamp }) => { 26259 const elapsed = timestamp - start; 26260 if (elapsed >= timeout) { 26261 frame_cancelFrame(checkElapsed); 26262 callback(elapsed - timeout); 26263 } 26264 }; 26265 frame_frame.read(checkElapsed, true); 26266 return () => frame_cancelFrame(checkElapsed); 26267} 26268function delayInSeconds(callback, timeout) { 26269 return delay(callback, secondsToMilliseconds(timeout)); 26270} 26271 26272 26273 26274;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs 26275 26276 26277 26278/** 26279 * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself 26280 * 26281 * TODO: Remove and move to library 26282 */ 26283function resolveMotionValue(value) { 26284 const unwrappedValue = isMotionValue(value) ? value.get() : value; 26285 return isCustomValue(unwrappedValue) 26286 ? unwrappedValue.toValue() 26287 : unwrappedValue; 26288} 26289 26290 26291 26292;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs 26293 26294 26295 26296 26297 26298const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; 26299const numBorders = borders.length; 26300const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; 26301const isPx = (value) => typeof value === "number" || px.test(value); 26302function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { 26303 if (shouldCrossfadeOpacity) { 26304 target.opacity = mixNumber(0, 26305 // TODO Reinstate this if only child 26306 lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress)); 26307 target.opacityExit = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress)); 26308 } 26309 else if (isOnlyMember) { 26310 target.opacity = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress); 26311 } 26312 /** 26313 * Mix border radius 26314 */ 26315 for (let i = 0; i < numBorders; i++) { 26316 const borderLabel = `border${borders[i]}Radius`; 26317 let followRadius = getRadius(follow, borderLabel); 26318 let leadRadius = getRadius(lead, borderLabel); 26319 if (followRadius === undefined && leadRadius === undefined) 26320 continue; 26321 followRadius || (followRadius = 0); 26322 leadRadius || (leadRadius = 0); 26323 const canMix = followRadius === 0 || 26324 leadRadius === 0 || 26325 isPx(followRadius) === isPx(leadRadius); 26326 if (canMix) { 26327 target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0); 26328 if (percent.test(leadRadius) || percent.test(followRadius)) { 26329 target[borderLabel] += "%"; 26330 } 26331 } 26332 else { 26333 target[borderLabel] = leadRadius; 26334 } 26335 } 26336 /** 26337 * Mix rotation 26338 */ 26339 if (follow.rotate || lead.rotate) { 26340 target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress); 26341 } 26342} 26343function getRadius(values, radiusName) { 26344 return values[radiusName] !== undefined 26345 ? values[radiusName] 26346 : values.borderRadius; 26347} 26348// /** 26349// * We only want to mix the background color if there's a follow element 26350// * that we're not crossfading opacity between. For instance with switch 26351// * AnimateSharedLayout animations, this helps the illusion of a continuous 26352// * element being animated but also cuts down on the number of paints triggered 26353// * for elements where opacity is doing that work for us. 26354// */ 26355// if ( 26356// !hasFollowElement && 26357// latestLeadValues.backgroundColor && 26358// latestFollowValues.backgroundColor 26359// ) { 26360// /** 26361// * This isn't ideal performance-wise as mixColor is creating a new function every frame. 26362// * We could probably create a mixer that runs at the start of the animation but 26363// * the idea behind the crossfader is that it runs dynamically between two potentially 26364// * changing targets (ie opacity or borderRadius may be animating independently via variants) 26365// */ 26366// leadState.backgroundColor = followState.backgroundColor = mixColor( 26367// latestFollowValues.backgroundColor as string, 26368// latestLeadValues.backgroundColor as string 26369// )(p) 26370// } 26371const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut); 26372const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop_noop); 26373function compress(min, max, easing) { 26374 return (p) => { 26375 // Could replace ifs with clamp 26376 if (p < min) 26377 return 0; 26378 if (p > max) 26379 return 1; 26380 return easing(progress(min, max, p)); 26381 }; 26382} 26383 26384 26385 26386;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/copy.mjs 26387/** 26388 * Reset an axis to the provided origin box. 26389 * 26390 * This is a mutative operation. 26391 */ 26392function copyAxisInto(axis, originAxis) { 26393 axis.min = originAxis.min; 26394 axis.max = originAxis.max; 26395} 26396/** 26397 * Reset a box to the provided origin box. 26398 * 26399 * This is a mutative operation. 26400 */ 26401function copyBoxInto(box, originBox) { 26402 copyAxisInto(box.x, originBox.x); 26403 copyAxisInto(box.y, originBox.y); 26404} 26405/** 26406 * Reset a delta to the provided origin box. 26407 * 26408 * This is a mutative operation. 26409 */ 26410function copyAxisDeltaInto(delta, originDelta) { 26411 delta.translate = originDelta.translate; 26412 delta.scale = originDelta.scale; 26413 delta.originPoint = originDelta.originPoint; 26414 delta.origin = originDelta.origin; 26415} 26416 26417 26418 26419;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs 26420 26421 26422 26423 26424/** 26425 * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse 26426 */ 26427function removePointDelta(point, translate, scale, originPoint, boxScale) { 26428 point -= translate; 26429 point = scalePoint(point, 1 / scale, originPoint); 26430 if (boxScale !== undefined) { 26431 point = scalePoint(point, 1 / boxScale, originPoint); 26432 } 26433 return point; 26434} 26435/** 26436 * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse 26437 */ 26438function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { 26439 if (percent.test(translate)) { 26440 translate = parseFloat(translate); 26441 const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100); 26442 translate = relativeProgress - sourceAxis.min; 26443 }
vendor: 7,732 bytes, lines 26444-26653
26444 if (typeof translate !== "number") 26445 return; 26446 let originPoint = mixNumber(originAxis.min, originAxis.max, origin); 26447 if (axis === originAxis) 26448 originPoint -= translate; 26449 axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); 26450 axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); 26451} 26452/** 26453 * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse 26454 * and acts as a bridge between motion values and removeAxisDelta 26455 */ 26456function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { 26457 removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); 26458} 26459/** 26460 * The names of the motion values we want to apply as translation, scale and origin. 26461 */ 26462const xKeys = ["x", "scaleX", "originX"]; 26463const yKeys = ["y", "scaleY", "originY"]; 26464/** 26465 * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse 26466 * and acts as a bridge between motion values and removeAxisDelta 26467 */ 26468function removeBoxTransforms(box, transforms, originBox, sourceBox) { 26469 removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); 26470 removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); 26471} 26472 26473 26474 26475;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/utils.mjs 26476 26477 26478function isAxisDeltaZero(delta) { 26479 return delta.translate === 0 && delta.scale === 1; 26480} 26481function isDeltaZero(delta) { 26482 return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); 26483} 26484function axisEquals(a, b) { 26485 return a.min === b.min && a.max === b.max; 26486} 26487function boxEquals(a, b) { 26488 return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); 26489} 26490function axisEqualsRounded(a, b) { 26491 return (Math.round(a.min) === Math.round(b.min) && 26492 Math.round(a.max) === Math.round(b.max)); 26493} 26494function boxEqualsRounded(a, b) { 26495 return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); 26496} 26497function aspectRatio(box) { 26498 return calcLength(box.x) / calcLength(box.y); 26499} 26500function axisDeltaEquals(a, b) { 26501 return (a.translate === b.translate && 26502 a.scale === b.scale && 26503 a.originPoint === b.originPoint); 26504} 26505 26506 26507 26508;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/shared/stack.mjs 26509 26510 26511class NodeStack { 26512 constructor() { 26513 this.members = []; 26514 } 26515 add(node) { 26516 addUniqueItem(this.members, node); 26517 node.scheduleRender(); 26518 } 26519 remove(node) { 26520 array_removeItem(this.members, node); 26521 if (node === this.prevLead) { 26522 this.prevLead = undefined; 26523 } 26524 if (node === this.lead) { 26525 const prevLead = this.members[this.members.length - 1]; 26526 if (prevLead) { 26527 this.promote(prevLead); 26528 } 26529 } 26530 } 26531 relegate(node) { 26532 const indexOfNode = this.members.findIndex((member) => node === member); 26533 if (indexOfNode === 0) 26534 return false; 26535 /** 26536 * Find the next projection node that is present 26537 */ 26538 let prevLead; 26539 for (let i = indexOfNode; i >= 0; i--) { 26540 const member = this.members[i]; 26541 if (member.isPresent !== false) { 26542 prevLead = member; 26543 break; 26544 } 26545 } 26546 if (prevLead) { 26547 this.promote(prevLead); 26548 return true; 26549 } 26550 else { 26551 return false; 26552 } 26553 } 26554 promote(node, preserveFollowOpacity) { 26555 const prevLead = this.lead; 26556 if (node === prevLead) 26557 return; 26558 this.prevLead = prevLead; 26559 this.lead = node; 26560 node.show(); 26561 if (prevLead) { 26562 prevLead.instance && prevLead.scheduleRender(); 26563 node.scheduleRender(); 26564 node.resumeFrom = prevLead; 26565 if (preserveFollowOpacity) { 26566 node.resumeFrom.preserveOpacity = true; 26567 } 26568 if (prevLead.snapshot) { 26569 node.snapshot = prevLead.snapshot; 26570 node.snapshot.latestValues = 26571 prevLead.animationValues || prevLead.latestValues; 26572 } 26573 if (node.root && node.root.isUpdating) { 26574 node.isLayoutDirty = true; 26575 } 26576 const { crossfade } = node.options; 26577 if (crossfade === false) { 26578 prevLead.hide(); 26579 } 26580 /** 26581 * TODO: 26582 * - Test border radius when previous node was deleted 26583 * - boxShadow mixing 26584 * - Shared between element A in scrolled container and element B (scroll stays the same or changes) 26585 * - Shared between element A in transformed container and element B (transform stays the same or changes) 26586 * - Shared between element A in scrolled page and element B (scroll stays the same or changes) 26587 * --- 26588 * - Crossfade opacity of root nodes 26589 * - layoutId changes after animation 26590 * - layoutId changes mid animation 26591 */ 26592 } 26593 } 26594 exitAnimationComplete() { 26595 this.members.forEach((node) => { 26596 const { options, resumingFrom } = node; 26597 options.onExitComplete && options.onExitComplete(); 26598 if (resumingFrom) { 26599 resumingFrom.options.onExitComplete && 26600 resumingFrom.options.onExitComplete(); 26601 } 26602 }); 26603 } 26604 scheduleRender() { 26605 this.members.forEach((node) => { 26606 node.instance && node.scheduleRender(false); 26607 }); 26608 } 26609 /** 26610 * Clear any leads that have been removed this render to prevent them from being 26611 * used in future animations and to prevent memory leaks 26612 */ 26613 removeLeadSnapshot() { 26614 if (this.lead && this.lead.snapshot) { 26615 this.lead.snapshot = undefined; 26616 } 26617 } 26618} 26619 26620 26621 26622;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/transform.mjs 26623function buildProjectionTransform(delta, treeScale, latestTransform) { 26624 let transform = ""; 26625 /** 26626 * The translations we use to calculate are always relative to the viewport coordinate space. 26627 * But when we apply scales, we also scale the coordinate space of an element and its children. 26628 * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need 26629 * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. 26630 */ 26631 const xTranslate = delta.x.translate / treeScale.x; 26632 const yTranslate = delta.y.translate / treeScale.y; 26633 const zTranslate = (latestTransform === null || latestTransform === void 0 ? void 0 : latestTransform.z) || 0; 26634 if (xTranslate || yTranslate || zTranslate) { 26635 transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; 26636 } 26637 /** 26638 * Apply scale correction for the tree transform. 26639 * This will apply scale to the screen-orientated axes. 26640 */ 26641 if (treeScale.x !== 1 || treeScale.y !== 1) { 26642 transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; 26643 } 26644 if (latestTransform) { 26645 const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform; 26646 if (transformPerspective) 26647 transform = `perspective(${transformPerspective}px) ${transform}`; 26648 if (rotate) 26649 transform += `rotate(${rotate}deg) `; 26650 if (rotateX) 26651 transform += `rotateX(${rotateX}deg) `; 26652 if (rotateY) 26653 transform += `rotateY(${rotateY}deg) `;
vendor: 4,153 bytes, lines 26654-26775
26654 if (skewX) 26655 transform += `skewX(${skewX}deg) `; 26656 if (skewY) 26657 transform += `skewY(${skewY}deg) `; 26658 } 26659 /** 26660 * Apply scale to match the size of the element to the size we want it. 26661 * This will apply scale to the element-orientated axes. 26662 */ 26663 const elementScaleX = delta.x.scale * treeScale.x; 26664 const elementScaleY = delta.y.scale * treeScale.y; 26665 if (elementScaleX !== 1 || elementScaleY !== 1) { 26666 transform += `scale(${elementScaleX}, ${elementScaleY})`; 26667 } 26668 return transform || "none"; 26669} 26670 26671 26672 26673;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs 26674 26675 26676 26677 26678 26679 26680 26681 26682 26683 26684 26685 26686 26687 26688 26689 26690 26691 26692 26693 26694 26695 26696 26697 26698const metrics = { 26699 nodes: 0, 26700 calculatedTargetDeltas: 0, 26701 calculatedProjections: 0, 26702}; 26703const transformAxes = ["", "X", "Y", "Z"]; 26704const hiddenVisibility = { visibility: "hidden" }; 26705/** 26706 * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 26707 * which has a noticeable difference in spring animations 26708 */ 26709const animationTarget = 1000; 26710let create_projection_node_id = 0; 26711function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { 26712 const { latestValues } = visualElement; 26713 // Record the distorting transform and then temporarily set it to 0 26714 if (latestValues[key]) { 26715 values[key] = latestValues[key]; 26716 visualElement.setStaticValue(key, 0); 26717 if (sharedAnimationValues) { 26718 sharedAnimationValues[key] = 0; 26719 } 26720 } 26721} 26722function cancelTreeOptimisedTransformAnimations(projectionNode) { 26723 projectionNode.hasCheckedOptimisedAppear = true; 26724 if (projectionNode.root === projectionNode) 26725 return; 26726 const { visualElement } = projectionNode.options; 26727 if (!visualElement) 26728 return; 26729 const appearId = getOptimisedAppearId(visualElement); 26730 if (window.MotionHasOptimisedAnimation(appearId, "transform")) { 26731 const { layout, layoutId } = projectionNode.options; 26732 window.MotionCancelOptimisedAnimation(appearId, "transform", frame_frame, !(layout || layoutId)); 26733 } 26734 const { parent } = projectionNode; 26735 if (parent && !parent.hasCheckedOptimisedAppear) { 26736 cancelTreeOptimisedTransformAnimations(parent); 26737 } 26738} 26739function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { 26740 return class ProjectionNode { 26741 constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) { 26742 /** 26743 * A unique ID generated for every projection node. 26744 */ 26745 this.id = create_projection_node_id++; 26746 /** 26747 * An id that represents a unique session instigated by startUpdate. 26748 */ 26749 this.animationId = 0; 26750 /** 26751 * A Set containing all this component's children. This is used to iterate 26752 * through the children. 26753 * 26754 * TODO: This could be faster to iterate as a flat array stored on the root node. 26755 */ 26756 this.children = new Set(); 26757 /** 26758 * Options for the node. We use this to configure what kind of layout animations 26759 * we should perform (if any). 26760 */ 26761 this.options = {}; 26762 /** 26763 * We use this to detect when its safe to shut down part of a projection tree. 26764 * We have to keep projecting children for scale correction and relative projection 26765 * until all their parents stop performing layout animations. 26766 */ 26767 this.isTreeAnimating = false; 26768 this.isAnimationBlocked = false; 26769 /** 26770 * Flag to true if we think this layout has been changed. We can't always know this, 26771 * currently we set it to true every time a component renders, or if it has a layoutDependency 26772 * if that has changed between renders. Additionally, components can be grouped by LayoutGroup 26773 * and if one node is dirtied, they all are. 26774 */ 26775 this.isLayoutDirty = false;
26776 /** 26777 * Flag to true if we think the projection calculations for this node needs 26778 * recalculating as a result of an updated transform or layout animation. 26779 */ 26780 this.isProjectionDirty = false; 26781 /** 26782 * Flag to true if the layout *or* transform has changed. This then gets propagated 26783 * throughout the projection tree, forcing any element below to recalculate on the next frame. 26784 */ 26785 this.isSharedProjectionDirty = false; 26786 /** 26787 * Flag transform dirty. This gets propagated throughout the whole tree but is only 26788 * respected by shared nodes. 26789 */ 26790 this.isTransformDirty = false; 26791 /** 26792 * Block layout updates for instant layout transitions throughout the tree. 26793 */ 26794 this.updateManuallyBlocked = false; 26795 this.updateBlockedByResize = false; 26796 /** 26797 * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` 26798 * call. 26799 */ 26800 this.isUpdating = false; 26801 /** 26802 * If this is an SVG element we currently disable projection transforms 26803 */ 26804 this.isSVG = false; 26805 /** 26806 * Flag to true (during promotion) if a node doing an instant layout transition needs to reset 26807 * its projection styles. 26808 */ 26809 this.needsReset = false; 26810 /** 26811 * Flags whether this node should have its transform reset prior to measuring. 26812 */ 26813 this.shouldResetTransform = false; 26814 /** 26815 * Store whether this node has been checked for optimised appear animations. As 26816 * effects fire bottom-up, and we want to look up the tree for appear animations, 26817 * this makes sure we only check each path once, stopping at nodes that 26818 * have already been checked. 26819 */ 26820 this.hasCheckedOptimisedAppear = false; 26821 /** 26822 * An object representing the calculated contextual/accumulated/tree scale. 26823 * This will be used to scale calculcated projection transforms, as these are 26824 * calculated in screen-space but need to be scaled for elements to layoutly 26825 * make it to their calculated destinations. 26826 * 26827 * TODO: Lazy-init 26828 */ 26829 this.treeScale = { x: 1, y: 1 }; 26830 /** 26831 * 26832 */ 26833 this.eventHandlers = new Map(); 26834 this.hasTreeAnimated = false; 26835 // Note: Currently only running on root node 26836 this.updateScheduled = false; 26837 this.scheduleUpdate = () => this.update(); 26838 this.projectionUpdateScheduled = false; 26839 this.checkUpdateFailed = () => { 26840 if (this.isUpdating) { 26841 this.isUpdating = false; 26842 this.clearAllSnapshots(); 26843 } 26844 }; 26845 /** 26846 * This is a multi-step process as shared nodes might be of different depths. Nodes 26847 * are sorted by depth order, so we need to resolve the entire tree before moving to 26848 * the next step. 26849 */ 26850 this.updateProjection = () => { 26851 this.projectionUpdateScheduled = false; 26852 /** 26853 * Reset debug counts. Manually resetting rather than creating a new 26854 * object each frame. 26855 */ 26856 if (buffer_statsBuffer.value) { 26857 metrics.nodes = 26858 metrics.calculatedTargetDeltas = 26859 metrics.calculatedProjections = 26860 0; 26861 } 26862 this.nodes.forEach(propagateDirtyNodes); 26863 this.nodes.forEach(resolveTargetDelta); 26864 this.nodes.forEach(calcProjection); 26865 this.nodes.forEach(cleanDirtyNodes); 26866 if (buffer_statsBuffer.addProjectionMetrics) { 26867 buffer_statsBuffer.addProjectionMetrics(metrics); 26868 } 26869 }; 26870 /** 26871 * Frame calculations 26872 */ 26873 this.resolvedRelativeTargetAt = 0.0; 26874 this.hasProjected = false;
vendor: 5,795 bytes, lines 26875-26990
26875 this.isVisible = true; 26876 this.animationProgress = 0; 26877 /** 26878 * Shared layout 26879 */ 26880 // TODO Only running on root node 26881 this.sharedNodes = new Map(); 26882 this.latestValues = latestValues; 26883 this.root = parent ? parent.root || parent : this; 26884 this.path = parent ? [...parent.path, parent] : []; 26885 this.parent = parent; 26886 this.depth = parent ? parent.depth + 1 : 0; 26887 for (let i = 0; i < this.path.length; i++) { 26888 this.path[i].shouldResetTransform = true; 26889 } 26890 if (this.root === this) 26891 this.nodes = new FlatTree(); 26892 } 26893 addEventListener(name, handler) { 26894 if (!this.eventHandlers.has(name)) { 26895 this.eventHandlers.set(name, new SubscriptionManager()); 26896 } 26897 return this.eventHandlers.get(name).add(handler); 26898 } 26899 notifyListeners(name, ...args) { 26900 const subscriptionManager = this.eventHandlers.get(name); 26901 subscriptionManager && subscriptionManager.notify(...args); 26902 } 26903 hasListeners(name) { 26904 return this.eventHandlers.has(name); 26905 } 26906 /** 26907 * Lifecycles 26908 */ 26909 mount(instance, isLayoutDirty = this.root.hasTreeAnimated) { 26910 if (this.instance) 26911 return; 26912 this.isSVG = isSVGElement(instance); 26913 this.instance = instance; 26914 const { layoutId, layout, visualElement } = this.options; 26915 if (visualElement && !visualElement.current) { 26916 visualElement.mount(instance); 26917 } 26918 this.root.nodes.add(this); 26919 this.parent && this.parent.children.add(this); 26920 if (isLayoutDirty && (layout || layoutId)) { 26921 this.isLayoutDirty = true; 26922 } 26923 if (attachResizeListener) { 26924 let cancelDelay; 26925 const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); 26926 attachResizeListener(instance, () => { 26927 this.root.updateBlockedByResize = true; 26928 cancelDelay && cancelDelay(); 26929 cancelDelay = delay(resizeUnblockUpdate, 250); 26930 if (globalProjectionState.hasAnimatedSinceResize) { 26931 globalProjectionState.hasAnimatedSinceResize = false; 26932 this.nodes.forEach(finishAnimation); 26933 } 26934 }); 26935 } 26936 if (layoutId) { 26937 this.root.registerSharedNode(layoutId, this); 26938 } 26939 // Only register the handler if it requires layout animation 26940 if (this.options.animate !== false && 26941 visualElement && 26942 (layoutId || layout)) { 26943 this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { 26944 if (this.isTreeAnimationBlocked()) { 26945 this.target = undefined; 26946 this.relativeTarget = undefined; 26947 return; 26948 } 26949 // TODO: Check here if an animation exists 26950 const layoutTransition = this.options.transition || 26951 visualElement.getDefaultTransition() || 26952 defaultLayoutTransition; 26953 const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); 26954 /** 26955 * The target layout of the element might stay the same, 26956 * but its position relative to its parent has changed. 26957 */ 26958 const hasTargetChanged = !this.targetLayout || 26959 !boxEqualsRounded(this.targetLayout, newLayout); 26960 /* 26961 * Note: Disabled to fix relative animations always triggering new 26962 * layout animations. If this causes further issues, we can try 26963 * a different approach to detecting relative target changes. 26964 */ 26965 // || hasRelativeLayoutChanged 26966 /** 26967 * If the layout hasn't seemed to have changed, it might be that the 26968 * element is visually in the same place in the document but its position 26969 * relative to its parent has indeed changed. So here we check for that. 26970 */ 26971 const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; 26972 if (this.options.layoutRoot || 26973 this.resumeFrom || 26974 hasOnlyRelativeTargetChanged || 26975 (hasLayoutChanged && 26976 (hasTargetChanged || !this.currentAnimation))) { 26977 if (this.resumeFrom) { 26978 this.resumingFrom = this.resumeFrom; 26979 this.resumingFrom.resumingFrom = undefined; 26980 } 26981 this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); 26982 const animationOptions = { 26983 ...get_value_transition_getValueTransition(layoutTransition, "layout"), 26984 onPlay: onLayoutAnimationStart, 26985 onComplete: onLayoutAnimationComplete, 26986 }; 26987 if (visualElement.shouldReduceMotion || 26988 this.options.layoutRoot) { 26989 animationOptions.delay = 0; 26990 animationOptions.type = false;
vendor: 34,857 bytes, lines 26991-27774
26991 } 26992 this.startAnimation(animationOptions); 26993 } 26994 else { 26995 /** 26996 * If the layout hasn't changed and we have an animation that hasn't started yet, 26997 * finish it immediately. Otherwise it will be animating from a location 26998 * that was probably never commited to screen and look like a jumpy box. 26999 */ 27000 if (!hasLayoutChanged) { 27001 finishAnimation(this); 27002 } 27003 if (this.isLead() && this.options.onExitComplete) { 27004 this.options.onExitComplete(); 27005 } 27006 } 27007 this.targetLayout = newLayout; 27008 }); 27009 } 27010 } 27011 unmount() { 27012 this.options.layoutId && this.willUpdate(); 27013 this.root.nodes.remove(this); 27014 const stack = this.getStack(); 27015 stack && stack.remove(this); 27016 this.parent && this.parent.children.delete(this); 27017 this.instance = undefined; 27018 frame_cancelFrame(this.updateProjection); 27019 } 27020 // only on the root 27021 blockUpdate() { 27022 this.updateManuallyBlocked = true; 27023 } 27024 unblockUpdate() { 27025 this.updateManuallyBlocked = false; 27026 } 27027 isUpdateBlocked() { 27028 return this.updateManuallyBlocked || this.updateBlockedByResize; 27029 } 27030 isTreeAnimationBlocked() { 27031 return (this.isAnimationBlocked || 27032 (this.parent && this.parent.isTreeAnimationBlocked()) || 27033 false); 27034 } 27035 // Note: currently only running on root node 27036 startUpdate() { 27037 if (this.isUpdateBlocked()) 27038 return; 27039 this.isUpdating = true; 27040 this.nodes && this.nodes.forEach(resetSkewAndRotation); 27041 this.animationId++; 27042 } 27043 getTransformTemplate() { 27044 const { visualElement } = this.options; 27045 return visualElement && visualElement.getProps().transformTemplate; 27046 } 27047 willUpdate(shouldNotifyListeners = true) { 27048 this.root.hasTreeAnimated = true; 27049 if (this.root.isUpdateBlocked()) { 27050 this.options.onExitComplete && this.options.onExitComplete(); 27051 return; 27052 } 27053 /** 27054 * If we're running optimised appear animations then these must be 27055 * cancelled before measuring the DOM. This is so we can measure 27056 * the true layout of the element rather than the WAAPI animation 27057 * which will be unaffected by the resetSkewAndRotate step. 27058 * 27059 * Note: This is a DOM write. Worst case scenario is this is sandwiched 27060 * between other snapshot reads which will cause unnecessary style recalculations. 27061 * This has to happen here though, as we don't yet know which nodes will need 27062 * snapshots in startUpdate(), but we only want to cancel optimised animations 27063 * if a layout animation measurement is actually going to be affected by them. 27064 */ 27065 if (window.MotionCancelOptimisedAnimation && 27066 !this.hasCheckedOptimisedAppear) { 27067 cancelTreeOptimisedTransformAnimations(this); 27068 } 27069 !this.root.isUpdating && this.root.startUpdate(); 27070 if (this.isLayoutDirty) 27071 return; 27072 this.isLayoutDirty = true; 27073 for (let i = 0; i < this.path.length; i++) { 27074 const node = this.path[i]; 27075 node.shouldResetTransform = true; 27076 node.updateScroll("snapshot"); 27077 if (node.options.layoutRoot) { 27078 node.willUpdate(false); 27079 } 27080 } 27081 const { layoutId, layout } = this.options; 27082 if (layoutId === undefined && !layout) 27083 return; 27084 const transformTemplate = this.getTransformTemplate(); 27085 this.prevTransformTemplateValue = transformTemplate 27086 ? transformTemplate(this.latestValues, "") 27087 : undefined; 27088 this.updateSnapshot(); 27089 shouldNotifyListeners && this.notifyListeners("willUpdate"); 27090 } 27091 update() { 27092 this.updateScheduled = false; 27093 const updateWasBlocked = this.isUpdateBlocked(); 27094 // When doing an instant transition, we skip the layout update, 27095 // but should still clean up the measurements so that the next 27096 // snapshot could be taken correctly. 27097 if (updateWasBlocked) { 27098 this.unblockUpdate(); 27099 this.clearAllSnapshots(); 27100 this.nodes.forEach(clearMeasurements); 27101 return; 27102 } 27103 if (!this.isUpdating) { 27104 this.nodes.forEach(clearIsLayoutDirty); 27105 } 27106 this.isUpdating = false; 27107 /** 27108 * Write 27109 */ 27110 this.nodes.forEach(resetTransformStyle); 27111 /** 27112 * Read ================== 27113 */ 27114 // Update layout measurements of updated children 27115 this.nodes.forEach(updateLayout); 27116 /** 27117 * Write 27118 */ 27119 // Notify listeners that the layout is updated 27120 this.nodes.forEach(notifyLayoutUpdate); 27121 this.clearAllSnapshots(); 27122 /** 27123 * Manually flush any pending updates. Ideally 27124 * we could leave this to the following requestAnimationFrame but this seems 27125 * to leave a flash of incorrectly styled content. 27126 */ 27127 const now = time.now(); 27128 frame_frameData.delta = clamp(0, 1000 / 60, now - frame_frameData.timestamp); 27129 frame_frameData.timestamp = now; 27130 frame_frameData.isProcessing = true; 27131 frameSteps.update.process(frame_frameData); 27132 frameSteps.preRender.process(frame_frameData); 27133 frameSteps.render.process(frame_frameData); 27134 frame_frameData.isProcessing = false; 27135 } 27136 didUpdate() { 27137 if (!this.updateScheduled) { 27138 this.updateScheduled = true; 27139 microtask_microtask.read(this.scheduleUpdate); 27140 } 27141 } 27142 clearAllSnapshots() { 27143 this.nodes.forEach(clearSnapshot); 27144 this.sharedNodes.forEach(removeLeadSnapshots); 27145 } 27146 scheduleUpdateProjection() { 27147 if (!this.projectionUpdateScheduled) { 27148 this.projectionUpdateScheduled = true; 27149 frame_frame.preRender(this.updateProjection, false, true); 27150 } 27151 } 27152 scheduleCheckAfterUnmount() { 27153 /** 27154 * If the unmounting node is in a layoutGroup and did trigger a willUpdate, 27155 * we manually call didUpdate to give a chance to the siblings to animate. 27156 * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. 27157 */ 27158 frame_frame.postRender(() => { 27159 if (this.isLayoutDirty) { 27160 this.root.didUpdate(); 27161 } 27162 else { 27163 this.root.checkUpdateFailed(); 27164 } 27165 }); 27166 } 27167 /** 27168 * Update measurements 27169 */ 27170 updateSnapshot() { 27171 if (this.snapshot || !this.instance) 27172 return; 27173 this.snapshot = this.measure(); 27174 if (this.snapshot && 27175 !calcLength(this.snapshot.measuredBox.x) && 27176 !calcLength(this.snapshot.measuredBox.y)) { 27177 this.snapshot = undefined; 27178 } 27179 } 27180 updateLayout() { 27181 if (!this.instance) 27182 return; 27183 // TODO: Incorporate into a forwarded scroll offset 27184 this.updateScroll(); 27185 if (!(this.options.alwaysMeasureLayout && this.isLead()) && 27186 !this.isLayoutDirty) { 27187 return; 27188 } 27189 /** 27190 * When a node is mounted, it simply resumes from the prevLead's 27191 * snapshot instead of taking a new one, but the ancestors scroll 27192 * might have updated while the prevLead is unmounted. We need to 27193 * update the scroll again to make sure the layout we measure is 27194 * up to date. 27195 */ 27196 if (this.resumeFrom && !this.resumeFrom.instance) { 27197 for (let i = 0; i < this.path.length; i++) { 27198 const node = this.path[i]; 27199 node.updateScroll(); 27200 } 27201 } 27202 const prevLayout = this.layout; 27203 this.layout = this.measure(false); 27204 this.layoutCorrected = createBox(); 27205 this.isLayoutDirty = false; 27206 this.projectionDelta = undefined; 27207 this.notifyListeners("measure", this.layout.layoutBox); 27208 const { visualElement } = this.options; 27209 visualElement && 27210 visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); 27211 } 27212 updateScroll(phase = "measure") { 27213 let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); 27214 if (this.scroll && 27215 this.scroll.animationId === this.root.animationId && 27216 this.scroll.phase === phase) { 27217 needsMeasurement = false; 27218 } 27219 if (needsMeasurement) { 27220 const isRoot = checkIsScrollRoot(this.instance); 27221 this.scroll = { 27222 animationId: this.root.animationId, 27223 phase, 27224 isRoot, 27225 offset: measureScroll(this.instance), 27226 wasRoot: this.scroll ? this.scroll.isRoot : isRoot, 27227 }; 27228 } 27229 } 27230 resetTransform() { 27231 if (!resetTransform) 27232 return; 27233 const isResetRequested = this.isLayoutDirty || 27234 this.shouldResetTransform || 27235 this.options.alwaysMeasureLayout; 27236 const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); 27237 const transformTemplate = this.getTransformTemplate(); 27238 const transformTemplateValue = transformTemplate 27239 ? transformTemplate(this.latestValues, "") 27240 : undefined; 27241 const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; 27242 if (isResetRequested && 27243 (hasProjection || 27244 hasTransform(this.latestValues) || 27245 transformTemplateHasChanged)) { 27246 resetTransform(this.instance, transformTemplateValue); 27247 this.shouldResetTransform = false; 27248 this.scheduleRender(); 27249 } 27250 } 27251 measure(removeTransform = true) { 27252 const pageBox = this.measurePageBox(); 27253 let layoutBox = this.removeElementScroll(pageBox); 27254 /** 27255 * Measurements taken during the pre-render stage 27256 * still have transforms applied so we remove them 27257 * via calculation. 27258 */ 27259 if (removeTransform) { 27260 layoutBox = this.removeTransform(layoutBox); 27261 } 27262 roundBox(layoutBox); 27263 return { 27264 animationId: this.root.animationId, 27265 measuredBox: pageBox, 27266 layoutBox, 27267 latestValues: {}, 27268 source: this.id, 27269 }; 27270 } 27271 measurePageBox() { 27272 var _a; 27273 const { visualElement } = this.options; 27274 if (!visualElement) 27275 return createBox(); 27276 const box = visualElement.measureViewportBox(); 27277 const wasInScrollRoot = ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) || this.path.some(checkNodeWasScrollRoot); 27278 if (!wasInScrollRoot) { 27279 // Remove viewport scroll to give page-relative coordinates 27280 const { scroll } = this.root; 27281 if (scroll) { 27282 translateAxis(box.x, scroll.offset.x); 27283 translateAxis(box.y, scroll.offset.y); 27284 } 27285 } 27286 return box; 27287 } 27288 removeElementScroll(box) { 27289 var _a; 27290 const boxWithoutScroll = createBox(); 27291 copyBoxInto(boxWithoutScroll, box); 27292 if ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) { 27293 return boxWithoutScroll; 27294 } 27295 /** 27296 * Performance TODO: Keep a cumulative scroll offset down the tree 27297 * rather than loop back up the path. 27298 */ 27299 for (let i = 0; i < this.path.length; i++) { 27300 const node = this.path[i]; 27301 const { scroll, options } = node; 27302 if (node !== this.root && scroll && options.layoutScroll) { 27303 /** 27304 * If this is a new scroll root, we want to remove all previous scrolls 27305 * from the viewport box. 27306 */ 27307 if (scroll.wasRoot) { 27308 copyBoxInto(boxWithoutScroll, box); 27309 } 27310 translateAxis(boxWithoutScroll.x, scroll.offset.x); 27311 translateAxis(boxWithoutScroll.y, scroll.offset.y); 27312 } 27313 } 27314 return boxWithoutScroll; 27315 } 27316 applyTransform(box, transformOnly = false) { 27317 const withTransforms = createBox(); 27318 copyBoxInto(withTransforms, box); 27319 for (let i = 0; i < this.path.length; i++) { 27320 const node = this.path[i]; 27321 if (!transformOnly && 27322 node.options.layoutScroll && 27323 node.scroll && 27324 node !== node.root) { 27325 transformBox(withTransforms, { 27326 x: -node.scroll.offset.x, 27327 y: -node.scroll.offset.y, 27328 }); 27329 } 27330 if (!hasTransform(node.latestValues)) 27331 continue; 27332 transformBox(withTransforms, node.latestValues); 27333 } 27334 if (hasTransform(this.latestValues)) { 27335 transformBox(withTransforms, this.latestValues); 27336 } 27337 return withTransforms; 27338 } 27339 removeTransform(box) { 27340 const boxWithoutTransform = createBox(); 27341 copyBoxInto(boxWithoutTransform, box); 27342 for (let i = 0; i < this.path.length; i++) { 27343 const node = this.path[i]; 27344 if (!node.instance) 27345 continue; 27346 if (!hasTransform(node.latestValues)) 27347 continue; 27348 hasScale(node.latestValues) && node.updateSnapshot(); 27349 const sourceBox = createBox(); 27350 const nodeBox = node.measurePageBox(); 27351 copyBoxInto(sourceBox, nodeBox); 27352 removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox); 27353 } 27354 if (hasTransform(this.latestValues)) { 27355 removeBoxTransforms(boxWithoutTransform, this.latestValues); 27356 } 27357 return boxWithoutTransform; 27358 } 27359 setTargetDelta(delta) { 27360 this.targetDelta = delta; 27361 this.root.scheduleUpdateProjection(); 27362 this.isProjectionDirty = true; 27363 } 27364 setOptions(options) { 27365 this.options = { 27366 ...this.options, 27367 ...options, 27368 crossfade: options.crossfade !== undefined ? options.crossfade : true, 27369 }; 27370 } 27371 clearMeasurements() { 27372 this.scroll = undefined; 27373 this.layout = undefined; 27374 this.snapshot = undefined; 27375 this.prevTransformTemplateValue = undefined; 27376 this.targetDelta = undefined; 27377 this.target = undefined; 27378 this.isLayoutDirty = false; 27379 } 27380 forceRelativeParentToResolveTarget() { 27381 if (!this.relativeParent) 27382 return; 27383 /** 27384 * If the parent target isn't up-to-date, force it to update. 27385 * This is an unfortunate de-optimisation as it means any updating relative 27386 * projection will cause all the relative parents to recalculate back 27387 * up the tree. 27388 */ 27389 if (this.relativeParent.resolvedRelativeTargetAt !== 27390 frame_frameData.timestamp) { 27391 this.relativeParent.resolveTargetDelta(true); 27392 } 27393 } 27394 resolveTargetDelta(forceRecalculation = false) { 27395 var _a; 27396 /** 27397 * Once the dirty status of nodes has been spread through the tree, we also 27398 * need to check if we have a shared node of a different depth that has itself 27399 * been dirtied. 27400 */ 27401 const lead = this.getLead(); 27402 this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); 27403 this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); 27404 this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); 27405 const isShared = Boolean(this.resumingFrom) || this !== lead; 27406 /** 27407 * We don't use transform for this step of processing so we don't 27408 * need to check whether any nodes have changed transform. 27409 */ 27410 const canSkip = !(forceRecalculation || 27411 (isShared && this.isSharedProjectionDirty) || 27412 this.isProjectionDirty || 27413 ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) || 27414 this.attemptToResolveRelativeTarget || 27415 this.root.updateBlockedByResize); 27416 if (canSkip) 27417 return; 27418 const { layout, layoutId } = this.options; 27419 /** 27420 * If we have no layout, we can't perform projection, so early return 27421 */ 27422 if (!this.layout || !(layout || layoutId)) 27423 return; 27424 this.resolvedRelativeTargetAt = frame_frameData.timestamp; 27425 /** 27426 * If we don't have a targetDelta but do have a layout, we can attempt to resolve 27427 * a relativeParent. This will allow a component to perform scale correction 27428 * even if no animation has started. 27429 */ 27430 if (!this.targetDelta && !this.relativeTarget) { 27431 const relativeParent = this.getClosestProjectingParent(); 27432 if (relativeParent && 27433 relativeParent.layout && 27434 this.animationProgress !== 1) { 27435 this.relativeParent = relativeParent; 27436 this.forceRelativeParentToResolveTarget(); 27437 this.relativeTarget = createBox(); 27438 this.relativeTargetOrigin = createBox(); 27439 calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox); 27440 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); 27441 } 27442 else { 27443 this.relativeParent = this.relativeTarget = undefined; 27444 } 27445 } 27446 /** 27447 * If we have no relative target or no target delta our target isn't valid 27448 * for this frame. 27449 */ 27450 if (!this.relativeTarget && !this.targetDelta) 27451 return; 27452 /** 27453 * Lazy-init target data structure 27454 */ 27455 if (!this.target) { 27456 this.target = createBox(); 27457 this.targetWithTransforms = createBox(); 27458 } 27459 /** 27460 * If we've got a relative box for this component, resolve it into a target relative to the parent. 27461 */ 27462 if (this.relativeTarget && 27463 this.relativeTargetOrigin && 27464 this.relativeParent && 27465 this.relativeParent.target) { 27466 this.forceRelativeParentToResolveTarget(); 27467 calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); 27468 /** 27469 * If we've only got a targetDelta, resolve it into a target 27470 */ 27471 } 27472 else if (this.targetDelta) { 27473 if (Boolean(this.resumingFrom)) { 27474 // TODO: This is creating a new object every frame 27475 this.target = this.applyTransform(this.layout.layoutBox); 27476 } 27477 else { 27478 copyBoxInto(this.target, this.layout.layoutBox); 27479 } 27480 applyBoxDelta(this.target, this.targetDelta); 27481 } 27482 else { 27483 /** 27484 * If no target, use own layout as target 27485 */ 27486 copyBoxInto(this.target, this.layout.layoutBox); 27487 } 27488 /** 27489 * If we've been told to attempt to resolve a relative target, do so. 27490 */ 27491 if (this.attemptToResolveRelativeTarget) { 27492 this.attemptToResolveRelativeTarget = false; 27493 const relativeParent = this.getClosestProjectingParent(); 27494 if (relativeParent && 27495 Boolean(relativeParent.resumingFrom) === 27496 Boolean(this.resumingFrom) && 27497 !relativeParent.options.layoutScroll && 27498 relativeParent.target && 27499 this.animationProgress !== 1) { 27500 this.relativeParent = relativeParent; 27501 this.forceRelativeParentToResolveTarget(); 27502 this.relativeTarget = createBox(); 27503 this.relativeTargetOrigin = createBox(); 27504 calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target); 27505 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); 27506 } 27507 else { 27508 this.relativeParent = this.relativeTarget = undefined; 27509 } 27510 } 27511 /** 27512 * Increase debug counter for resolved target deltas 27513 */ 27514 if (buffer_statsBuffer.value) { 27515 metrics.calculatedTargetDeltas++; 27516 } 27517 } 27518 getClosestProjectingParent() { 27519 if (!this.parent || 27520 hasScale(this.parent.latestValues) || 27521 has2DTranslate(this.parent.latestValues)) { 27522 return undefined; 27523 } 27524 if (this.parent.isProjecting()) { 27525 return this.parent; 27526 } 27527 else { 27528 return this.parent.getClosestProjectingParent(); 27529 } 27530 } 27531 isProjecting() { 27532 return Boolean((this.relativeTarget || 27533 this.targetDelta || 27534 this.options.layoutRoot) && 27535 this.layout); 27536 } 27537 calcProjection() { 27538 var _a; 27539 const lead = this.getLead(); 27540 const isShared = Boolean(this.resumingFrom) || this !== lead; 27541 let canSkip = true; 27542 /** 27543 * If this is a normal layout animation and neither this node nor its nearest projecting 27544 * is dirty then we can't skip. 27545 */ 27546 if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) { 27547 canSkip = false; 27548 } 27549 /** 27550 * If this is a shared layout animation and this node's shared projection is dirty then 27551 * we can't skip. 27552 */ 27553 if (isShared && 27554 (this.isSharedProjectionDirty || this.isTransformDirty)) { 27555 canSkip = false; 27556 } 27557 /** 27558 * If we have resolved the target this frame we must recalculate the 27559 * projection to ensure it visually represents the internal calculations. 27560 */ 27561 if (this.resolvedRelativeTargetAt === frame_frameData.timestamp) { 27562 canSkip = false; 27563 } 27564 if (canSkip) 27565 return; 27566 const { layout, layoutId } = this.options; 27567 /** 27568 * If this section of the tree isn't animating we can 27569 * delete our target sources for the following frame. 27570 */ 27571 this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || 27572 this.currentAnimation || 27573 this.pendingAnimation); 27574 if (!this.isTreeAnimating) { 27575 this.targetDelta = this.relativeTarget = undefined; 27576 } 27577 if (!this.layout || !(layout || layoutId)) 27578 return; 27579 /** 27580 * Reset the corrected box with the latest values from box, as we're then going 27581 * to perform mutative operations on it. 27582 */ 27583 copyBoxInto(this.layoutCorrected, this.layout.layoutBox); 27584 /** 27585 * Record previous tree scales before updating. 27586 */ 27587 const prevTreeScaleX = this.treeScale.x; 27588 const prevTreeScaleY = this.treeScale.y; 27589 /** 27590 * Apply all the parent deltas to this box to produce the corrected box. This 27591 * is the layout box, as it will appear on screen as a result of the transforms of its parents. 27592 */ 27593 applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); 27594 /** 27595 * If this layer needs to perform scale correction but doesn't have a target, 27596 * use the layout as the target. 27597 */ 27598 if (lead.layout && 27599 !lead.target && 27600 (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { 27601 lead.target = lead.layout.layoutBox; 27602 lead.targetWithTransforms = createBox(); 27603 } 27604 const { target } = lead; 27605 if (!target) { 27606 /** 27607 * If we don't have a target to project into, but we were previously 27608 * projecting, we want to remove the stored transform and schedule 27609 * a render to ensure the elements reflect the removed transform. 27610 */ 27611 if (this.prevProjectionDelta) { 27612 this.createProjectionDeltas(); 27613 this.scheduleRender(); 27614 } 27615 return; 27616 } 27617 if (!this.projectionDelta || !this.prevProjectionDelta) { 27618 this.createProjectionDeltas(); 27619 } 27620 else { 27621 copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); 27622 copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); 27623 } 27624 /** 27625 * Update the delta between the corrected box and the target box before user-set transforms were applied. 27626 * This will allow us to calculate the corrected borderRadius and boxShadow to compensate 27627 * for our layout reprojection, but still allow them to be scaled correctly by the user. 27628 * It might be that to simplify this we may want to accept that user-set scale is also corrected 27629 * and we wouldn't have to keep and calc both deltas, OR we could support a user setting 27630 * to allow people to choose whether these styles are corrected based on just the 27631 * layout reprojection or the final bounding box. 27632 */ 27633 calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); 27634 if (this.treeScale.x !== prevTreeScaleX || 27635 this.treeScale.y !== prevTreeScaleY || 27636 !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || 27637 !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { 27638 this.hasProjected = true; 27639 this.scheduleRender(); 27640 this.notifyListeners("projectionUpdate", target); 27641 } 27642 /** 27643 * Increase debug counter for recalculated projections 27644 */ 27645 if (buffer_statsBuffer.value) { 27646 metrics.calculatedProjections++; 27647 } 27648 } 27649 hide() { 27650 this.isVisible = false; 27651 // TODO: Schedule render 27652 } 27653 show() { 27654 this.isVisible = true; 27655 // TODO: Schedule render 27656 } 27657 scheduleRender(notifyAll = true) { 27658 var _a; 27659 (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.scheduleRender(); 27660 if (notifyAll) { 27661 const stack = this.getStack(); 27662 stack && stack.scheduleRender(); 27663 } 27664 if (this.resumingFrom && !this.resumingFrom.instance) { 27665 this.resumingFrom = undefined; 27666 } 27667 } 27668 createProjectionDeltas() { 27669 this.prevProjectionDelta = createDelta(); 27670 this.projectionDelta = createDelta(); 27671 this.projectionDeltaWithTransform = createDelta(); 27672 } 27673 setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) { 27674 const snapshot = this.snapshot; 27675 const snapshotLatestValues = snapshot 27676 ? snapshot.latestValues 27677 : {}; 27678 const mixedValues = { ...this.latestValues }; 27679 const targetDelta = createDelta(); 27680 if (!this.relativeParent || 27681 !this.relativeParent.options.layoutRoot) { 27682 this.relativeTarget = this.relativeTargetOrigin = undefined; 27683 } 27684 this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; 27685 const relativeLayout = createBox(); 27686 const snapshotSource = snapshot ? snapshot.source : undefined; 27687 const layoutSource = this.layout ? this.layout.source : undefined; 27688 const isSharedLayoutAnimation = snapshotSource !== layoutSource; 27689 const stack = this.getStack(); 27690 const isOnlyMember = !stack || stack.members.length <= 1; 27691 const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && 27692 !isOnlyMember && 27693 this.options.crossfade === true && 27694 !this.path.some(hasOpacityCrossfade)); 27695 this.animationProgress = 0; 27696 let prevRelativeTarget; 27697 this.mixTargetDelta = (latest) => { 27698 const progress = latest / 1000; 27699 mixAxisDelta(targetDelta.x, delta.x, progress); 27700 mixAxisDelta(targetDelta.y, delta.y, progress); 27701 this.setTargetDelta(targetDelta); 27702 if (this.relativeTarget && 27703 this.relativeTargetOrigin && 27704 this.layout && 27705 this.relativeParent && 27706 this.relativeParent.layout) { 27707 calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox); 27708 mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); 27709 /** 27710 * If this is an unchanged relative target we can consider the 27711 * projection not dirty. 27712 */ 27713 if (prevRelativeTarget && 27714 boxEquals(this.relativeTarget, prevRelativeTarget)) { 27715 this.isProjectionDirty = false; 27716 } 27717 if (!prevRelativeTarget) 27718 prevRelativeTarget = createBox(); 27719 copyBoxInto(prevRelativeTarget, this.relativeTarget); 27720 } 27721 if (isSharedLayoutAnimation) { 27722 this.animationValues = mixedValues; 27723 mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); 27724 } 27725 this.root.scheduleUpdateProjection(); 27726 this.scheduleRender(); 27727 this.animationProgress = progress; 27728 }; 27729 this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); 27730 } 27731 startAnimation(options) { 27732 this.notifyListeners("animationStart"); 27733 this.currentAnimation && this.currentAnimation.stop(); 27734 if (this.resumingFrom && this.resumingFrom.currentAnimation) { 27735 this.resumingFrom.currentAnimation.stop(); 27736 } 27737 if (this.pendingAnimation) { 27738 frame_cancelFrame(this.pendingAnimation); 27739 this.pendingAnimation = undefined; 27740 } 27741 /** 27742 * Start the animation in the next frame to have a frame with progress 0, 27743 * where the target is the same as when the animation started, so we can 27744 * calculate the relative positions correctly for instant transitions. 27745 */ 27746 this.pendingAnimation = frame_frame.update(() => { 27747 globalProjectionState.hasAnimatedSinceResize = true; 27748 animation_count_activeAnimations.layout++; 27749 this.currentAnimation = animateSingleValue(0, animationTarget, { 27750 ...options, 27751 onUpdate: (latest) => { 27752 this.mixTargetDelta(latest); 27753 options.onUpdate && options.onUpdate(latest); 27754 }, 27755 onStop: () => { 27756 animation_count_activeAnimations.layout--; 27757 }, 27758 onComplete: () => { 27759 animation_count_activeAnimations.layout--; 27760 options.onComplete && options.onComplete(); 27761 this.completeAnimation(); 27762 }, 27763 }); 27764 if (this.resumingFrom) { 27765 this.resumingFrom.currentAnimation = this.currentAnimation; 27766 } 27767 this.pendingAnimation = undefined; 27768 }); 27769 } 27770 completeAnimation() { 27771 if (this.resumingFrom) { 27772 this.resumingFrom.currentAnimation = undefined; 27773 this.resumingFrom.preserveOpacity = undefined; 27774 }
vendor: 4,397 bytes, lines 27775-27871
27775 const stack = this.getStack(); 27776 stack && stack.exitAnimationComplete(); 27777 this.resumingFrom = 27778 this.currentAnimation = 27779 this.animationValues = 27780 undefined; 27781 this.notifyListeners("animationComplete"); 27782 } 27783 finishAnimation() { 27784 if (this.currentAnimation) { 27785 this.mixTargetDelta && this.mixTargetDelta(animationTarget); 27786 this.currentAnimation.stop(); 27787 } 27788 this.completeAnimation(); 27789 } 27790 applyTransformsToTarget() { 27791 const lead = this.getLead(); 27792 let { targetWithTransforms, target, layout, latestValues } = lead; 27793 if (!targetWithTransforms || !target || !layout) 27794 return; 27795 /** 27796 * If we're only animating position, and this element isn't the lead element, 27797 * then instead of projecting into the lead box we instead want to calculate 27798 * a new target that aligns the two boxes but maintains the layout shape. 27799 */ 27800 if (this !== lead && 27801 this.layout && 27802 layout && 27803 shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { 27804 target = this.target || createBox(); 27805 const xLength = calcLength(this.layout.layoutBox.x); 27806 target.x.min = lead.target.x.min; 27807 target.x.max = target.x.min + xLength; 27808 const yLength = calcLength(this.layout.layoutBox.y); 27809 target.y.min = lead.target.y.min; 27810 target.y.max = target.y.min + yLength; 27811 } 27812 copyBoxInto(targetWithTransforms, target); 27813 /** 27814 * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. 27815 * This is the final box that we will then project into by calculating a transform delta and 27816 * applying it to the corrected box. 27817 */ 27818 transformBox(targetWithTransforms, latestValues); 27819 /** 27820 * Update the delta between the corrected box and the final target box, after 27821 * user-set transforms are applied to it. This will be used by the renderer to 27822 * create a transform style that will reproject the element from its layout layout 27823 * into the desired bounding box. 27824 */ 27825 calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); 27826 } 27827 registerSharedNode(layoutId, node) { 27828 if (!this.sharedNodes.has(layoutId)) { 27829 this.sharedNodes.set(layoutId, new NodeStack()); 27830 } 27831 const stack = this.sharedNodes.get(layoutId); 27832 stack.add(node); 27833 const config = node.options.initialPromotionConfig; 27834 node.promote({ 27835 transition: config ? config.transition : undefined, 27836 preserveFollowOpacity: config && config.shouldPreserveFollowOpacity 27837 ? config.shouldPreserveFollowOpacity(node) 27838 : undefined, 27839 }); 27840 } 27841 isLead() { 27842 const stack = this.getStack(); 27843 return stack ? stack.lead === this : true; 27844 } 27845 getLead() { 27846 var _a; 27847 const { layoutId } = this.options; 27848 return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this; 27849 } 27850 getPrevLead() { 27851 var _a; 27852 const { layoutId } = this.options; 27853 return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined; 27854 } 27855 getStack() { 27856 const { layoutId } = this.options; 27857 if (layoutId) 27858 return this.root.sharedNodes.get(layoutId); 27859 } 27860 promote({ needsReset, transition, preserveFollowOpacity, } = {}) { 27861 const stack = this.getStack(); 27862 if (stack) 27863 stack.promote(this, preserveFollowOpacity); 27864 if (needsReset) { 27865 this.projectionDelta = undefined; 27866 this.needsReset = true; 27867 } 27868 if (transition) 27869 this.setOptions({ transition }); 27870 } 27871 relegate() {
27872 const stack = this.getStack(); 27873 if (stack) { 27874 return stack.relegate(this); 27875 } 27876 else { 27877 return false; 27878 } 27879 } 27880 resetSkewAndRotation() { 27881 const { visualElement } = this.options; 27882 if (!visualElement) 27883 return; 27884 // If there's no detected skew or rotation values, we can early return without a forced render. 27885 let hasDistortingTransform = false; 27886 /** 27887 * An unrolled check for rotation values. Most elements don't have any rotation and 27888 * skipping the nested loop and new object creation is 50% faster. 27889 */ 27890 const { latestValues } = visualElement; 27891 if (latestValues.z || 27892 latestValues.rotate || 27893 latestValues.rotateX || 27894 latestValues.rotateY || 27895 latestValues.rotateZ || 27896 latestValues.skewX || 27897 latestValues.skewY) { 27898 hasDistortingTransform = true; 27899 } 27900 // If there's no distorting values, we don't need to do any more. 27901 if (!hasDistortingTransform) 27902 return; 27903 const resetValues = {}; 27904 if (latestValues.z) { 27905 resetDistortingTransform("z", visualElement, resetValues, this.animationValues); 27906 } 27907 // Check the skew and rotate value of all axes and reset to 0 27908 for (let i = 0; i < transformAxes.length; i++) { 27909 resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); 27910 resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); 27911 } 27912 // Force a render of this element to apply the transform with all skews and rotations 27913 // set to 0. 27914 visualElement.render(); 27915 // Put back all the values we reset 27916 for (const key in resetValues) { 27917 visualElement.setStaticValue(key, resetValues[key]); 27918 if (this.animationValues) { 27919 this.animationValues[key] = resetValues[key]; 27920 } 27921 } 27922 // Schedule a render for the next frame. This ensures we won't visually 27923 // see the element with the reset rotate value applied. 27924 visualElement.scheduleRender(); 27925 } 27926 getProjectionStyles(styleProp) { 27927 var _a, _b; 27928 if (!this.instance || this.isSVG) 27929 return undefined; 27930 if (!this.isVisible) { 27931 return hiddenVisibility; 27932 } 27933 const styles = { 27934 visibility: "", 27935 }; 27936 const transformTemplate = this.getTransformTemplate(); 27937 if (this.needsReset) { 27938 this.needsReset = false; 27939 styles.opacity = ""; 27940 styles.pointerEvents = 27941 resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || ""; 27942 styles.transform = transformTemplate 27943 ? transformTemplate(this.latestValues, "") 27944 : "none"; 27945 return styles; 27946 } 27947 const lead = this.getLead(); 27948 if (!this.projectionDelta || !this.layout || !lead.target) { 27949 const emptyStyles = {}; 27950 if (this.options.layoutId) { 27951 emptyStyles.opacity = 27952 this.latestValues.opacity !== undefined 27953 ? this.latestValues.opacity 27954 : 1; 27955 emptyStyles.pointerEvents = 27956 resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || ""; 27957 } 27958 if (this.hasProjected && !hasTransform(this.latestValues)) { 27959 emptyStyles.transform = transformTemplate 27960 ? transformTemplate({}, "") 27961 : "none"; 27962 this.hasProjected = false;
27963 } 27964 return emptyStyles; 27965 } 27966 const valuesToRender = lead.animationValues || lead.latestValues; 27967 this.applyTransformsToTarget(); 27968 styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); 27969 if (transformTemplate) { 27970 styles.transform = transformTemplate(valuesToRender, styles.transform); 27971 } 27972 const { x, y } = this.projectionDelta; 27973 styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; 27974 if (lead.animationValues) { 27975 /** 27976 * If the lead component is animating, assign this either the entering/leaving 27977 * opacity 27978 */ 27979 styles.opacity = 27980 lead === this 27981 ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1 27982 : this.preserveOpacity 27983 ? this.latestValues.opacity 27984 : valuesToRender.opacityExit; 27985 } 27986 else { 27987 /** 27988 * Or we're not animating at all, set the lead component to its layout 27989 * opacity and other components to hidden. 27990 */ 27991 styles.opacity = 27992 lead === this 27993 ? valuesToRender.opacity !== undefined 27994 ? valuesToRender.opacity 27995 : "" 27996 : valuesToRender.opacityExit !== undefined 27997 ? valuesToRender.opacityExit 27998 : 0; 27999 } 28000 /** 28001 * Apply scale correction 28002 */ 28003 for (const key in scaleCorrectors) { 28004 if (valuesToRender[key] === undefined) 28005 continue; 28006 const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; 28007 /** 28008 * Only apply scale correction to the value if we have an 28009 * active projection transform. Otherwise these values become 28010 * vulnerable to distortion if the element changes size without 28011 * a corresponding layout animation. 28012 */ 28013 const corrected = styles.transform === "none" 28014 ? valuesToRender[key] 28015 : correct(valuesToRender[key], lead); 28016 if (applyTo) { 28017 const num = applyTo.length; 28018 for (let i = 0; i < num; i++) { 28019 styles[applyTo[i]] = corrected; 28020 } 28021 } 28022 else { 28023 // If this is a CSS variable, set it directly on the instance. 28024 // Replacing this function from creating styles to setting them 28025 // would be a good place to remove per frame object creation 28026 if (isCSSVariable) { 28027 this.options.visualElement.renderState.vars[key] = corrected; 28028 } 28029 else { 28030 styles[key] = corrected; 28031 } 28032 } 28033 } 28034 /** 28035 * Disable pointer events on follow components. This is to ensure 28036 * that if a follow component covers a lead component it doesn't block 28037 * pointer events on the lead. 28038 */ 28039 if (this.options.layoutId) { 28040 styles.pointerEvents = 28041 lead === this 28042 ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "" 28043 : "none"; 28044 } 28045 return styles; 28046 } 28047 clearSnapshot() { 28048 this.resumeFrom = this.snapshot = undefined; 28049 } 28050 // Only run on root 28051 resetTree() { 28052 this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });
vendor: 20,622 bytes, lines 28053-28691
28053 this.root.nodes.forEach(clearMeasurements); 28054 this.root.sharedNodes.clear(); 28055 } 28056 }; 28057} 28058function updateLayout(node) { 28059 node.updateLayout(); 28060} 28061function notifyLayoutUpdate(node) { 28062 var _a; 28063 const snapshot = ((_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node.snapshot; 28064 if (node.isLead() && 28065 node.layout && 28066 snapshot && 28067 node.hasListeners("didUpdate")) { 28068 const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; 28069 const { animationType } = node.options; 28070 const isShared = snapshot.source !== node.layout.source; 28071 // TODO Maybe we want to also resize the layout snapshot so we don't trigger 28072 // animations for instance if layout="size" and an element has only changed position 28073 if (animationType === "size") { 28074 eachAxis((axis) => { 28075 const axisSnapshot = isShared 28076 ? snapshot.measuredBox[axis] 28077 : snapshot.layoutBox[axis]; 28078 const length = calcLength(axisSnapshot); 28079 axisSnapshot.min = layout[axis].min; 28080 axisSnapshot.max = axisSnapshot.min + length; 28081 }); 28082 } 28083 else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { 28084 eachAxis((axis) => { 28085 const axisSnapshot = isShared 28086 ? snapshot.measuredBox[axis] 28087 : snapshot.layoutBox[axis]; 28088 const length = calcLength(layout[axis]); 28089 axisSnapshot.max = axisSnapshot.min + length; 28090 /** 28091 * Ensure relative target gets resized and rerendererd 28092 */ 28093 if (node.relativeTarget && !node.currentAnimation) { 28094 node.isProjectionDirty = true; 28095 node.relativeTarget[axis].max = 28096 node.relativeTarget[axis].min + length; 28097 } 28098 }); 28099 } 28100 const layoutDelta = createDelta(); 28101 calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); 28102 const visualDelta = createDelta(); 28103 if (isShared) { 28104 calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); 28105 } 28106 else { 28107 calcBoxDelta(visualDelta, layout, snapshot.layoutBox); 28108 } 28109 const hasLayoutChanged = !isDeltaZero(layoutDelta); 28110 let hasRelativeLayoutChanged = false; 28111 if (!node.resumeFrom) { 28112 const relativeParent = node.getClosestProjectingParent(); 28113 /** 28114 * If the relativeParent is itself resuming from a different element then 28115 * the relative snapshot is not relavent 28116 */ 28117 if (relativeParent && !relativeParent.resumeFrom) { 28118 const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; 28119 if (parentSnapshot && parentLayout) { 28120 const relativeSnapshot = createBox(); 28121 calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox); 28122 const relativeLayout = createBox(); 28123 calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox); 28124 if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { 28125 hasRelativeLayoutChanged = true; 28126 } 28127 if (relativeParent.options.layoutRoot) { 28128 node.relativeTarget = relativeLayout; 28129 node.relativeTargetOrigin = relativeSnapshot; 28130 node.relativeParent = relativeParent; 28131 } 28132 } 28133 } 28134 } 28135 node.notifyListeners("didUpdate", { 28136 layout, 28137 snapshot, 28138 delta: visualDelta, 28139 layoutDelta, 28140 hasLayoutChanged, 28141 hasRelativeLayoutChanged, 28142 }); 28143 } 28144 else if (node.isLead()) { 28145 const { onExitComplete } = node.options; 28146 onExitComplete && onExitComplete(); 28147 } 28148 /** 28149 * Clearing transition 28150 * TODO: Investigate why this transition is being passed in as {type: false } from Framer 28151 * and why we need it at all 28152 */ 28153 node.options.transition = undefined; 28154} 28155function propagateDirtyNodes(node) { 28156 /** 28157 * Increase debug counter for nodes encountered this frame 28158 */ 28159 if (buffer_statsBuffer.value) { 28160 metrics.nodes++; 28161 } 28162 if (!node.parent) 28163 return; 28164 /** 28165 * If this node isn't projecting, propagate isProjectionDirty. It will have 28166 * no performance impact but it will allow the next child that *is* projecting 28167 * but *isn't* dirty to just check its parent to see if *any* ancestor needs 28168 * correcting. 28169 */ 28170 if (!node.isProjecting()) { 28171 node.isProjectionDirty = node.parent.isProjectionDirty; 28172 } 28173 /** 28174 * Propagate isSharedProjectionDirty and isTransformDirty 28175 * throughout the whole tree. A future revision can take another look at 28176 * this but for safety we still recalcualte shared nodes. 28177 */ 28178 node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || 28179 node.parent.isProjectionDirty || 28180 node.parent.isSharedProjectionDirty)); 28181 node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); 28182} 28183function cleanDirtyNodes(node) { 28184 node.isProjectionDirty = 28185 node.isSharedProjectionDirty = 28186 node.isTransformDirty = 28187 false; 28188} 28189function clearSnapshot(node) { 28190 node.clearSnapshot(); 28191} 28192function clearMeasurements(node) { 28193 node.clearMeasurements(); 28194} 28195function clearIsLayoutDirty(node) { 28196 node.isLayoutDirty = false; 28197} 28198function resetTransformStyle(node) { 28199 const { visualElement } = node.options; 28200 if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { 28201 visualElement.notify("BeforeLayoutMeasure"); 28202 } 28203 node.resetTransform(); 28204} 28205function finishAnimation(node) { 28206 node.finishAnimation(); 28207 node.targetDelta = node.relativeTarget = node.target = undefined; 28208 node.isProjectionDirty = true; 28209} 28210function resolveTargetDelta(node) { 28211 node.resolveTargetDelta(); 28212} 28213function calcProjection(node) { 28214 node.calcProjection(); 28215} 28216function resetSkewAndRotation(node) { 28217 node.resetSkewAndRotation(); 28218} 28219function removeLeadSnapshots(stack) { 28220 stack.removeLeadSnapshot(); 28221} 28222function mixAxisDelta(output, delta, p) { 28223 output.translate = mixNumber(delta.translate, 0, p); 28224 output.scale = mixNumber(delta.scale, 1, p); 28225 output.origin = delta.origin; 28226 output.originPoint = delta.originPoint; 28227} 28228function mixAxis(output, from, to, p) { 28229 output.min = mixNumber(from.min, to.min, p); 28230 output.max = mixNumber(from.max, to.max, p); 28231} 28232function mixBox(output, from, to, p) { 28233 mixAxis(output.x, from.x, to.x, p); 28234 mixAxis(output.y, from.y, to.y, p); 28235} 28236function hasOpacityCrossfade(node) { 28237 return (node.animationValues && node.animationValues.opacityExit !== undefined); 28238} 28239const defaultLayoutTransition = { 28240 duration: 0.45, 28241 ease: [0.4, 0, 0.1, 1], 28242}; 28243const userAgentContains = (string) => typeof navigator !== "undefined" && 28244 navigator.userAgent && 28245 navigator.userAgent.toLowerCase().includes(string); 28246/** 28247 * Measured bounding boxes must be rounded in Safari and 28248 * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements 28249 * can appear to jump. 28250 */ 28251const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") 28252 ? Math.round 28253 : noop_noop; 28254function roundAxis(axis) { 28255 // Round to the nearest .5 pixels to support subpixel layouts 28256 axis.min = roundPoint(axis.min); 28257 axis.max = roundPoint(axis.max); 28258} 28259function roundBox(box) { 28260 roundAxis(box.x); 28261 roundAxis(box.y); 28262} 28263function shouldAnimatePositionOnly(animationType, snapshot, layout) { 28264 return (animationType === "position" || 28265 (animationType === "preserve-aspect" && 28266 !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); 28267} 28268function checkNodeWasScrollRoot(node) { 28269 var _a; 28270 return node !== node.root && ((_a = node.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot); 28271} 28272 28273 28274 28275;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs 28276 28277 28278 28279const DocumentProjectionNode = createProjectionNode({ 28280 attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), 28281 measureScroll: () => ({ 28282 x: document.documentElement.scrollLeft || document.body.scrollLeft, 28283 y: document.documentElement.scrollTop || document.body.scrollTop, 28284 }), 28285 checkIsScrollRoot: () => true, 28286}); 28287 28288 28289 28290;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs 28291 28292 28293 28294const rootProjectionNode = { 28295 current: undefined, 28296}; 28297const HTMLProjectionNode = createProjectionNode({ 28298 measureScroll: (instance) => ({ 28299 x: instance.scrollLeft, 28300 y: instance.scrollTop, 28301 }), 28302 defaultParent: () => { 28303 if (!rootProjectionNode.current) { 28304 const documentNode = new DocumentProjectionNode({}); 28305 documentNode.mount(window); 28306 documentNode.setOptions({ layoutScroll: true }); 28307 rootProjectionNode.current = documentNode; 28308 } 28309 return rootProjectionNode.current; 28310 }, 28311 resetTransform: (instance, value) => { 28312 instance.style.transform = value !== undefined ? value : "none"; 28313 }, 28314 checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), 28315}); 28316 28317 28318 28319;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/drag.mjs 28320 28321 28322 28323 28324 28325const drag = { 28326 pan: { 28327 Feature: PanGesture, 28328 }, 28329 drag: { 28330 Feature: DragGesture, 28331 ProjectionNode: HTMLProjectionNode, 28332 MeasureLayout: MeasureLayout, 28333 }, 28334}; 28335 28336 28337 28338;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/hover.mjs 28339 28340 28341 28342 28343function handleHoverEvent(node, event, lifecycle) { 28344 const { props } = node; 28345 if (node.animationState && props.whileHover) { 28346 node.animationState.setActive("whileHover", lifecycle === "Start"); 28347 } 28348 const eventName = ("onHover" + lifecycle); 28349 const callback = props[eventName]; 28350 if (callback) { 28351 frame_frame.postRender(() => callback(event, extractEventInfo(event))); 28352 } 28353} 28354class HoverGesture extends Feature { 28355 mount() { 28356 const { current } = this.node; 28357 if (!current) 28358 return; 28359 this.unmount = hover(current, (_element, startEvent) => { 28360 handleHoverEvent(this.node, startEvent, "Start"); 28361 return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); 28362 }); 28363 } 28364 unmount() { } 28365} 28366 28367 28368 28369;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/focus.mjs 28370 28371 28372 28373 28374class FocusGesture extends Feature { 28375 constructor() { 28376 super(...arguments); 28377 this.isActive = false; 28378 } 28379 onFocus() { 28380 let isFocusVisible = false; 28381 /** 28382 * If this element doesn't match focus-visible then don't 28383 * apply whileHover. But, if matches throws that focus-visible 28384 * is not a valid selector then in that browser outline styles will be applied 28385 * to the element by default and we want to match that behaviour with whileFocus. 28386 */ 28387 try { 28388 isFocusVisible = this.node.current.matches(":focus-visible"); 28389 } 28390 catch (e) { 28391 isFocusVisible = true; 28392 } 28393 if (!isFocusVisible || !this.node.animationState) 28394 return; 28395 this.node.animationState.setActive("whileFocus", true); 28396 this.isActive = true; 28397 } 28398 onBlur() { 28399 if (!this.isActive || !this.node.animationState) 28400 return; 28401 this.node.animationState.setActive("whileFocus", false); 28402 this.isActive = false; 28403 } 28404 mount() { 28405 this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); 28406 } 28407 unmount() { } 28408} 28409 28410 28411 28412;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/press.mjs 28413 28414 28415 28416 28417function handlePressEvent(node, event, lifecycle) { 28418 const { props } = node; 28419 if (node.current instanceof HTMLButtonElement && node.current.disabled) { 28420 return; 28421 } 28422 if (node.animationState && props.whileTap) { 28423 node.animationState.setActive("whileTap", lifecycle === "Start"); 28424 } 28425 const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); 28426 const callback = props[eventName]; 28427 if (callback) { 28428 frame_frame.postRender(() => callback(event, extractEventInfo(event))); 28429 } 28430} 28431class PressGesture extends Feature { 28432 mount() { 28433 const { current } = this.node; 28434 if (!current) 28435 return; 28436 this.unmount = press(current, (_element, startEvent) => { 28437 handlePressEvent(this.node, startEvent, "Start"); 28438 return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); 28439 }, { useGlobalTarget: this.node.props.globalTapTarget }); 28440 } 28441 unmount() { } 28442} 28443 28444 28445 28446;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs 28447/** 28448 * Map an IntersectionHandler callback to an element. We only ever make one handler for one 28449 * element, so even though these handlers might all be triggered by different 28450 * observers, we can keep them in the same map. 28451 */ 28452const observerCallbacks = new WeakMap(); 28453/** 28454 * Multiple observers can be created for multiple element/document roots. Each with 28455 * different settings. So here we store dictionaries of observers to each root, 28456 * using serialised settings (threshold/margin) as lookup keys. 28457 */ 28458const observers = new WeakMap(); 28459const fireObserverCallback = (entry) => { 28460 const callback = observerCallbacks.get(entry.target); 28461 callback && callback(entry); 28462}; 28463const fireAllObserverCallbacks = (entries) => { 28464 entries.forEach(fireObserverCallback); 28465}; 28466function initIntersectionObserver({ root, ...options }) { 28467 const lookupRoot = root || document; 28468 /** 28469 * If we don't have an observer lookup map for this root, create one. 28470 */ 28471 if (!observers.has(lookupRoot)) { 28472 observers.set(lookupRoot, {}); 28473 } 28474 const rootObservers = observers.get(lookupRoot); 28475 const key = JSON.stringify(options); 28476 /** 28477 * If we don't have an observer for this combination of root and settings, 28478 * create one. 28479 */ 28480 if (!rootObservers[key]) { 28481 rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); 28482 } 28483 return rootObservers[key]; 28484} 28485function observeIntersection(element, options, callback) { 28486 const rootInteresectionObserver = initIntersectionObserver(options); 28487 observerCallbacks.set(element, callback); 28488 rootInteresectionObserver.observe(element); 28489 return () => { 28490 observerCallbacks.delete(element); 28491 rootInteresectionObserver.unobserve(element); 28492 }; 28493} 28494 28495 28496 28497;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs 28498 28499 28500 28501const thresholdNames = { 28502 some: 0, 28503 all: 1, 28504}; 28505class InViewFeature extends Feature { 28506 constructor() { 28507 super(...arguments); 28508 this.hasEnteredView = false; 28509 this.isInView = false; 28510 } 28511 startObserver() { 28512 this.unmount(); 28513 const { viewport = {} } = this.node.getProps(); 28514 const { root, margin: rootMargin, amount = "some", once } = viewport; 28515 const options = { 28516 root: root ? root.current : undefined, 28517 rootMargin, 28518 threshold: typeof amount === "number" ? amount : thresholdNames[amount], 28519 }; 28520 const onIntersectionUpdate = (entry) => { 28521 const { isIntersecting } = entry; 28522 /** 28523 * If there's been no change in the viewport state, early return. 28524 */ 28525 if (this.isInView === isIntersecting) 28526 return; 28527 this.isInView = isIntersecting; 28528 /** 28529 * Handle hasEnteredView. If this is only meant to run once, and 28530 * element isn't visible, early return. Otherwise set hasEnteredView to true. 28531 */ 28532 if (once && !isIntersecting && this.hasEnteredView) { 28533 return; 28534 } 28535 else if (isIntersecting) { 28536 this.hasEnteredView = true; 28537 } 28538 if (this.node.animationState) { 28539 this.node.animationState.setActive("whileInView", isIntersecting); 28540 } 28541 /** 28542 * Use the latest committed props rather than the ones in scope 28543 * when this observer is created 28544 */ 28545 const { onViewportEnter, onViewportLeave } = this.node.getProps(); 28546 const callback = isIntersecting ? onViewportEnter : onViewportLeave; 28547 callback && callback(entry); 28548 }; 28549 return observeIntersection(this.node.current, options, onIntersectionUpdate); 28550 } 28551 mount() { 28552 this.startObserver(); 28553 } 28554 update() { 28555 if (typeof IntersectionObserver === "undefined") 28556 return; 28557 const { props, prevProps } = this.node; 28558 const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); 28559 if (hasOptionsChanged) { 28560 this.startObserver(); 28561 } 28562 } 28563 unmount() { } 28564} 28565function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { 28566 return (name) => viewport[name] !== prevViewport[name]; 28567} 28568 28569 28570 28571;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/gestures.mjs 28572 28573 28574 28575 28576 28577const gestureAnimations = { 28578 inView: { 28579 Feature: InViewFeature, 28580 }, 28581 tap: { 28582 Feature: PressGesture, 28583 }, 28584 focus: { 28585 Feature: FocusGesture, 28586 }, 28587 hover: { 28588 Feature: HoverGesture, 28589 }, 28590}; 28591 28592 28593 28594;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout.mjs 28595 28596 28597 28598const layout = { 28599 layout: { 28600 ProjectionNode: HTMLProjectionNode, 28601 MeasureLayout: MeasureLayout, 28602 }, 28603}; 28604 28605 28606 28607;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LazyContext.mjs 28608"use client"; 28609 28610 28611const LazyContext = (0,react.createContext)({ strict: false }); 28612 28613 28614 28615// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs 28616var MotionConfigContext = __webpack_require__(6014); 28617;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/index.mjs 28618"use client"; 28619 28620 28621const MotionContext = /* @__PURE__ */ (0,react.createContext)({}); 28622 28623 28624 28625;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs 28626 28627 28628 28629 28630function isControllingVariants(props) { 28631 return (isAnimationControls(props.animate) || 28632 variantProps.some((name) => isVariantLabel(props[name]))); 28633} 28634function isVariantNode(props) { 28635 return Boolean(isControllingVariants(props) || props.variants); 28636} 28637 28638 28639 28640;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs 28641 28642 28643 28644function getCurrentTreeVariants(props, context) { 28645 if (isControllingVariants(props)) { 28646 const { initial, animate } = props; 28647 return { 28648 initial: initial === false || isVariantLabel(initial) 28649 ? initial 28650 : undefined, 28651 animate: isVariantLabel(animate) ? animate : undefined, 28652 }; 28653 } 28654 return props.inherit !== false ? context : {}; 28655} 28656 28657 28658 28659;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/create.mjs 28660 28661 28662 28663 28664function useCreateMotionContext(props) { 28665 const { initial, animate } = getCurrentTreeVariants(props, (0,react.useContext)(MotionContext)); 28666 return (0,react.useMemo)(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); 28667} 28668function variantLabelsAsDependency(prop) { 28669 return Array.isArray(prop) ? prop.join(" ") : prop; 28670} 28671 28672 28673 28674// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/utils/is-browser.mjs 28675var is_browser = __webpack_require__(1741); 28676;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/definitions.mjs 28677const featureProps = { 28678 animation: [ 28679 "animate", 28680 "variants", 28681 "whileHover", 28682 "whileTap", 28683 "exit", 28684 "whileInView", 28685 "whileFocus", 28686 "whileDrag", 28687 ], 28688 exit: ["exit"], 28689 drag: ["drag", "dragControls"], 28690 focus: ["whileFocus"], 28691 hover: ["whileHover", "onHoverStart", "onHoverEnd"],
28692 tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], 28693 pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], 28694 inView: ["whileInView", "onViewportEnter", "onViewportLeave"], 28695 layout: ["layout", "layoutId"], 28696}; 28697const featureDefinitions = {}; 28698for (const key in featureProps) { 28699 featureDefinitions[key] = { 28700 isEnabled: (props) => featureProps[key].some((name) => !!props[name]), 28701 }; 28702} 28703 28704 28705 28706;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/load-features.mjs 28707 28708 28709function loadFeatures(features) { 28710 for (const key in features) { 28711 featureDefinitions[key] = { 28712 ...featureDefinitions[key], 28713 ...features[key], 28714 }; 28715 } 28716} 28717 28718 28719 28720;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/symbol.mjs 28721const motionComponentSymbol = Symbol.for("motionComponentSymbol"); 28722 28723 28724 28725;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs 28726 28727 28728 28729/** 28730 * Creates a ref function that, when called, hydrates the provided 28731 * external ref and VisualElement. 28732 */ 28733function useMotionRef(visualState, visualElement, externalRef) { 28734 return (0,react.useCallback)((instance) => { 28735 if (instance) { 28736 visualState.onMount && visualState.onMount(instance); 28737 } 28738 if (visualElement) { 28739 if (instance) { 28740 visualElement.mount(instance); 28741 } 28742 else { 28743 visualElement.unmount(); 28744 } 28745 } 28746 if (externalRef) { 28747 if (typeof externalRef === "function") { 28748 externalRef(instance); 28749 } 28750 else if (isRefObject(externalRef)) { 28751 externalRef.current = instance; 28752 } 28753 } 28754 }, 28755 /** 28756 * Only pass a new ref callback to React if we've received a visual element 28757 * factory. Otherwise we'll be mounting/remounting every time externalRef 28758 * or other dependencies change. 28759 */ 28760 [visualElement]); 28761} 28762 28763 28764 28765// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/context/PresenceContext.mjs 28766var PresenceContext = __webpack_require__(240); 28767// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs 28768var use_isomorphic_effect = __webpack_require__(8868); 28769;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs 28770 28771 28772 28773 28774 28775 28776 28777 28778 28779 28780 28781function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) { 28782 var _a, _b; 28783 const { visualElement: parent } = (0,react.useContext)(MotionContext); 28784 const lazyContext = (0,react.useContext)(LazyContext); 28785 const presenceContext = (0,react.useContext)(PresenceContext/* PresenceContext */.O); 28786 const reducedMotionConfig = (0,react.useContext)(MotionConfigContext/* MotionConfigContext */._).reducedMotion; 28787 const visualElementRef = (0,react.useRef)(null); 28788 /** 28789 * If we haven't preloaded a renderer, check to see if we have one lazy-loaded 28790 */ 28791 createVisualElement = createVisualElement || lazyContext.renderer; 28792 if (!visualElementRef.current && createVisualElement) { 28793 visualElementRef.current = createVisualElement(Component, { 28794 visualState, 28795 parent, 28796 props, 28797 presenceContext, 28798 blockInitialAnimation: presenceContext 28799 ? presenceContext.initial === false 28800 : false, 28801 reducedMotionConfig, 28802 }); 28803 } 28804 const visualElement = visualElementRef.current; 28805 /** 28806 * Load Motion gesture and animation features. These are rendered as renderless 28807 * components so each feature can optionally make use of React lifecycle methods. 28808 */ 28809 const initialLayoutGroupConfig = (0,react.useContext)(SwitchLayoutGroupContext); 28810 if (visualElement && 28811 !visualElement.projection && 28812 ProjectionNodeConstructor && 28813 (visualElement.type === "html" || visualElement.type === "svg")) { 28814 use_visual_element_createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); 28815 } 28816 const isMounted = (0,react.useRef)(false); 28817 (0,react.useInsertionEffect)(() => { 28818 /** 28819 * Check the component has already mounted before calling 28820 * `update` unnecessarily. This ensures we skip the initial update. 28821 */ 28822 if (visualElement && isMounted.current) { 28823 visualElement.update(props, presenceContext); 28824 } 28825 }); 28826 /** 28827 * Cache this value as we want to know whether HandoffAppearAnimations 28828 * was present on initial render - it will be deleted after this. 28829 */ 28830 const optimisedAppearId = props[optimizedAppearDataAttribute]; 28831 const wantsHandoff = (0,react.useRef)(Boolean(optimisedAppearId) && 28832 !((_a = window.MotionHandoffIsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)) && 28833 ((_b = window.MotionHasOptimisedAnimation) === null || _b === void 0 ? void 0 : _b.call(window, optimisedAppearId))); 28834 (0,use_isomorphic_effect/* useIsomorphicLayoutEffect */.L)(() => { 28835 if (!visualElement) 28836 return; 28837 isMounted.current = true; 28838 window.MotionIsMounted = true; 28839 visualElement.updateFeatures(); 28840 microtask_microtask.render(visualElement.render); 28841 /** 28842 * Ideally this function would always run in a useEffect. 28843 * 28844 * However, if we have optimised appear animations to handoff from, 28845 * it needs to happen synchronously to ensure there's no flash of 28846 * incorrect styles in the event of a hydration error. 28847 * 28848 * So if we detect a situtation where optimised appear animations 28849 * are running, we use useLayoutEffect to trigger animations. 28850 */ 28851 if (wantsHandoff.current && visualElement.animationState) { 28852 visualElement.animationState.animateChanges(); 28853 } 28854 }); 28855 (0,react.useEffect)(() => { 28856 if (!visualElement) 28857 return; 28858 if (!wantsHandoff.current && visualElement.animationState) { 28859 visualElement.animationState.animateChanges(); 28860 } 28861 if (wantsHandoff.current) { 28862 // This ensures all future calls to animateChanges() in this component will run in useEffect 28863 queueMicrotask(() => { 28864 var _a; 28865 (_a = window.MotionHandoffMarkAsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId); 28866 }); 28867 wantsHandoff.current = false;
28868 } 28869 }); 28870 return visualElement; 28871} 28872function use_visual_element_createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { 28873 const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props; 28874 visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] 28875 ? undefined 28876 : getClosestProjectingNode(visualElement.parent)); 28877 visualElement.projection.setOptions({ 28878 layoutId, 28879 layout, 28880 alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), 28881 visualElement, 28882 /** 28883 * TODO: Update options in an effect. This could be tricky as it'll be too late 28884 * to update by the time layout animations run. 28885 * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, 28886 * ensuring it gets called if there's no potential layout animations. 28887 * 28888 */ 28889 animationType: typeof layout === "string" ? layout : "both", 28890 initialPromotionConfig, 28891 layoutScroll, 28892 layoutRoot, 28893 }); 28894} 28895function getClosestProjectingNode(visualElement) { 28896 if (!visualElement) 28897 return undefined; 28898 return visualElement.options.allowProjection !== false 28899 ? visualElement.projection 28900 : getClosestProjectingNode(visualElement.parent); 28901} 28902 28903 28904 28905;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/index.mjs 28906"use client"; 28907 28908 28909 28910 28911 28912 28913 28914 28915 28916 28917 28918 28919 28920 28921 28922/** 28923 * Create a `motion` component. 28924 * 28925 * This function accepts a Component argument, which can be either a string (ie "div" 28926 * for `motion.div`), or an actual React component. 28927 * 28928 * Alongside this is a config option which provides a way of rendering the provided 28929 * component "offline", or outside the React render cycle. 28930 */ 28931function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }) { 28932 var _a, _b; 28933 preloadedFeatures && loadFeatures(preloadedFeatures); 28934 function MotionComponent(props, externalRef) { 28935 /** 28936 * If we need to measure the element we load this functionality in a 28937 * separate class component in order to gain access to getSnapshotBeforeUpdate. 28938 */ 28939 let MeasureLayout; 28940 const configAndProps = { 28941 ...(0,react.useContext)(MotionConfigContext/* MotionConfigContext */._), 28942 ...props, 28943 layoutId: useLayoutId(props), 28944 }; 28945 const { isStatic } = configAndProps; 28946 const context = useCreateMotionContext(props); 28947 const visualState = useVisualState(props, isStatic); 28948 if (!isStatic && is_browser/* isBrowser */.j) { 28949 useStrictMode(configAndProps, preloadedFeatures); 28950 const layoutProjection = getProjectionFunctionality(configAndProps); 28951 MeasureLayout = layoutProjection.MeasureLayout; 28952 /** 28953 * Create a VisualElement for this component. A VisualElement provides a common 28954 * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as 28955 * providing a way of rendering to these APIs outside of the React render loop 28956 * for more performant animations and interactions 28957 */ 28958 context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode); 28959 } 28960 /** 28961 * The mount order and hierarchy is specific to ensure our element ref 28962 * is hydrated by the time features fire their effects. 28963 */ 28964 return ((0,jsx_runtime.jsxs)(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? ((0,jsx_runtime.jsx)(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] })); 28965 } 28966 MotionComponent.displayName = `motion.${typeof Component === "string" 28967 ? Component 28968 : `create(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : ""})`}`; 28969 const ForwardRefMotionComponent = (0,react.forwardRef)(MotionComponent); 28970 ForwardRefMotionComponent[motionComponentSymbol] = Component; 28971 return ForwardRefMotionComponent; 28972} 28973function useLayoutId({ layoutId }) { 28974 const layoutGroupId = (0,react.useContext)(LayoutGroupContext/* LayoutGroupContext */.p).id; 28975 return layoutGroupId && layoutId !== undefined 28976 ? layoutGroupId + "-" + layoutId 28977 : layoutId; 28978} 28979function useStrictMode(configAndProps, preloadedFeatures) { 28980 const isStrict = (0,react.useContext)(LazyContext).strict; 28981 /** 28982 * If we're in development mode, check to make sure we're not rendering a motion component 28983 * as a child of LazyMotion, as this will break the file-size benefits of using it. 28984 */ 28985 if (false) {} 28986} 28987function getProjectionFunctionality(props) { 28988 const { drag, layout } = featureDefinitions; 28989 if (!drag && !layout) 28990 return {}; 28991 const combined = { ...drag, ...layout }; 28992 return { 28993 MeasureLayout: (drag === null || drag === void 0 ? void 0 : drag.isEnabled(props)) || (layout === null || layout === void 0 ? void 0 : layout.isEnabled(props)) 28994 ? combined.MeasureLayout 28995 : undefined, 28996 ProjectionNode: combined.ProjectionNode, 28997 }; 28998} 28999 29000 29001 29002;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs 29003 29004 29005 29006function isForcedMotionValue(key, { layout, layoutId }) { 29007 return (transformProps.has(key) || 29008 key.startsWith("origin") || 29009 ((layout || layoutId !== undefined) && 29010 (!!scaleCorrectors[key] || key === "opacity"))); 29011} 29012 29013 29014 29015;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs 29016/** 29017 * Provided a value and a ValueType, returns the value as that value type. 29018 */ 29019const getValueAsType = (value, type) => { 29020 return type && typeof value === "number" 29021 ? type.transform(value) 29022 : value; 29023}; 29024 29025 29026 29027;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs 29028 29029
vendor: 2,048 bytes, lines 29030-29088
29030 29031 29032const translateAlias = { 29033 x: "translateX", 29034 y: "translateY", 29035 z: "translateZ", 29036 transformPerspective: "perspective", 29037}; 29038const numTransforms = transformPropOrder.length; 29039/** 29040 * Build a CSS transform style from individual x/y/scale etc properties. 29041 * 29042 * This outputs with a default order of transforms/scales/rotations, this can be customised by 29043 * providing a transformTemplate function. 29044 */ 29045function buildTransform(latestValues, transform, transformTemplate) { 29046 // The transform string we're going to build into. 29047 let transformString = ""; 29048 let transformIsDefault = true; 29049 /** 29050 * Loop over all possible transforms in order, adding the ones that 29051 * are present to the transform string. 29052 */ 29053 for (let i = 0; i < numTransforms; i++) { 29054 const key = transformPropOrder[i]; 29055 const value = latestValues[key]; 29056 if (value === undefined) 29057 continue; 29058 let valueIsDefault = true; 29059 if (typeof value === "number") { 29060 valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); 29061 } 29062 else { 29063 valueIsDefault = parseFloat(value) === 0; 29064 } 29065 if (!valueIsDefault || transformTemplate) { 29066 const valueAsType = getValueAsType(value, numberValueTypes[key]); 29067 if (!valueIsDefault) { 29068 transformIsDefault = false; 29069 const transformName = translateAlias[key] || key; 29070 transformString += `${transformName}(${valueAsType}) `; 29071 } 29072 if (transformTemplate) { 29073 transform[key] = valueAsType; 29074 } 29075 } 29076 } 29077 transformString = transformString.trim(); 29078 // If we have a custom `transform` template, pass our transform values and 29079 // generated transformString to that before returning 29080 if (transformTemplate) { 29081 transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); 29082 } 29083 else if (transformIsDefault) { 29084 transformString = "none"; 29085 } 29086 return transformString; 29087} 29088
vendor: 3,744 bytes, lines 29089-29205
29089 29090 29091;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs 29092 29093 29094 29095 29096 29097 29098function buildHTMLStyles(state, latestValues, transformTemplate) { 29099 const { style, vars, transformOrigin } = state; 29100 // Track whether we encounter any transform or transformOrigin values. 29101 let hasTransform = false; 29102 let hasTransformOrigin = false; 29103 /** 29104 * Loop over all our latest animated values and decide whether to handle them 29105 * as a style or CSS variable. 29106 * 29107 * Transforms and transform origins are kept separately for further processing. 29108 */ 29109 for (const key in latestValues) { 29110 const value = latestValues[key]; 29111 if (transformProps.has(key)) { 29112 // If this is a transform, flag to enable further transform processing 29113 hasTransform = true; 29114 continue; 29115 } 29116 else if (isCSSVariableName(key)) { 29117 vars[key] = value; 29118 continue; 29119 } 29120 else { 29121 // Convert the value to its default value type, ie 0 -> "0px" 29122 const valueAsType = getValueAsType(value, numberValueTypes[key]); 29123 if (key.startsWith("origin")) { 29124 // If this is a transform origin, flag and enable further transform-origin processing 29125 hasTransformOrigin = true; 29126 transformOrigin[key] = 29127 valueAsType; 29128 } 29129 else { 29130 style[key] = valueAsType; 29131 } 29132 } 29133 } 29134 if (!latestValues.transform) { 29135 if (hasTransform || transformTemplate) { 29136 style.transform = buildTransform(latestValues, state.transform, transformTemplate); 29137 } 29138 else if (style.transform) { 29139 /** 29140 * If we have previously created a transform but currently don't have any, 29141 * reset transform style to none. 29142 */ 29143 style.transform = "none"; 29144 } 29145 } 29146 /** 29147 * Build a transformOrigin style. Uses the same defaults as the browser for 29148 * undefined origins. 29149 */ 29150 if (hasTransformOrigin) { 29151 const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; 29152 style.transformOrigin = `${originX} ${originY} ${originZ}`; 29153 } 29154} 29155 29156 29157 29158;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs 29159const createHtmlRenderState = () => ({ 29160 style: {}, 29161 transform: {}, 29162 transformOrigin: {}, 29163 vars: {}, 29164}); 29165 29166 29167 29168;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/use-props.mjs 29169 29170 29171 29172 29173 29174 29175function copyRawValuesOnly(target, source, props) { 29176 for (const key in source) { 29177 if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { 29178 target[key] = source[key]; 29179 } 29180 } 29181} 29182function useInitialMotionValues({ transformTemplate }, visualState) { 29183 return (0,react.useMemo)(() => { 29184 const state = createHtmlRenderState(); 29185 buildHTMLStyles(state, visualState, transformTemplate); 29186 return Object.assign({}, state.vars, state.style); 29187 }, [visualState]); 29188} 29189function useStyle(props, visualState) { 29190 const styleProp = props.style || {}; 29191 const style = {}; 29192 /** 29193 * Copy non-Motion Values straight into style 29194 */ 29195 copyRawValuesOnly(style, styleProp, props); 29196 Object.assign(style, useInitialMotionValues(props, visualState)); 29197 return style; 29198} 29199function useHTMLProps(props, visualState) { 29200 // The `any` isn't ideal but it is the type of createElement props argument 29201 const htmlProps = {}; 29202 const style = useStyle(props, visualState); 29203 if (props.drag && props.dragListener !== false) { 29204 // Disable the ghost element when a user drags 29205 htmlProps.draggable = false;
vendor: 5,116 bytes, lines 29206-29382
29206 // Disable text selection 29207 style.userSelect = 29208 style.WebkitUserSelect = 29209 style.WebkitTouchCallout = 29210 "none"; 29211 // Disable scrolling on the draggable direction 29212 style.touchAction = 29213 props.drag === true 29214 ? "none" 29215 : `pan-${props.drag === "x" ? "y" : "x"}`; 29216 } 29217 if (props.tabIndex === undefined && 29218 (props.onTap || props.onTapStart || props.whileTap)) { 29219 htmlProps.tabIndex = 0; 29220 } 29221 htmlProps.style = style; 29222 return htmlProps; 29223} 29224 29225 29226 29227;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs 29228/** 29229 * A list of all valid MotionProps. 29230 * 29231 * @privateRemarks 29232 * This doesn't throw if a `MotionProp` name is missing - it should. 29233 */ 29234const validMotionProps = new Set([ 29235 "animate", 29236 "exit", 29237 "variants", 29238 "initial", 29239 "style", 29240 "values", 29241 "variants", 29242 "transition", 29243 "transformTemplate", 29244 "custom", 29245 "inherit", 29246 "onBeforeLayoutMeasure", 29247 "onAnimationStart", 29248 "onAnimationComplete", 29249 "onUpdate", 29250 "onDragStart", 29251 "onDrag", 29252 "onDragEnd", 29253 "onMeasureDragConstraints", 29254 "onDirectionLock", 29255 "onDragTransitionEnd", 29256 "_dragX", 29257 "_dragY", 29258 "onHoverStart", 29259 "onHoverEnd", 29260 "onViewportEnter", 29261 "onViewportLeave", 29262 "globalTapTarget", 29263 "ignoreStrict", 29264 "viewport", 29265]); 29266/** 29267 * Check whether a prop name is a valid `MotionProp` key. 29268 * 29269 * @param key - Name of the property to check 29270 * @returns `true` is key is a valid `MotionProp`. 29271 * 29272 * @public 29273 */ 29274function isValidMotionProp(key) { 29275 return (key.startsWith("while") || 29276 (key.startsWith("drag") && key !== "draggable") || 29277 key.startsWith("layout") || 29278 key.startsWith("onTap") || 29279 key.startsWith("onPan") || 29280 key.startsWith("onLayout") || 29281 validMotionProps.has(key)); 29282} 29283 29284 29285 29286;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs 29287 29288 29289let shouldForward = (key) => !isValidMotionProp(key); 29290function loadExternalIsValidProp(isValidProp) { 29291 if (!isValidProp) 29292 return; 29293 // Explicitly filter our events 29294 shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); 29295} 29296/** 29297 * Emotion and Styled Components both allow users to pass through arbitrary props to their components 29298 * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which 29299 * of these should be passed to the underlying DOM node. 29300 * 29301 * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props 29302 * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props 29303 * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of 29304 * `@emotion/is-prop-valid`, however to fix this problem we need to use it. 29305 * 29306 * By making it an optionalDependency we can offer this functionality only in the situations where it's 29307 * actually required. 29308 */ 29309try { 29310 /** 29311 * We attempt to import this package but require won't be defined in esm environments, in that case 29312 * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed 29313 * in favour of explicit injection. 29314 */ 29315 loadExternalIsValidProp(require("@emotion/is-prop-valid").default); 29316} 29317catch (_a) { 29318 // We don't need to actually do anything here - the fallback is the existing `isPropValid`. 29319} 29320function filterProps(props, isDom, forwardMotionProps) { 29321 const filteredProps = {}; 29322 for (const key in props) { 29323 /** 29324 * values is considered a valid prop by Emotion, so if it's present 29325 * this will be rendered out to the DOM unless explicitly filtered. 29326 * 29327 * We check the type as it could be used with the `feColorMatrix` 29328 * element, which we support. 29329 */ 29330 if (key === "values" && typeof props.values === "object") 29331 continue; 29332 if (shouldForward(key) || 29333 (forwardMotionProps === true && isValidMotionProp(key)) || 29334 (!isDom && !isValidMotionProp(key)) || 29335 // If trying to use native HTML drag events, forward drag listeners 29336 (props["draggable"] && 29337 key.startsWith("onDrag"))) { 29338 filteredProps[key] = 29339 props[key]; 29340 } 29341 } 29342 return filteredProps; 29343} 29344 29345 29346 29347;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs 29348/** 29349 * We keep these listed separately as we use the lowercase tag names as part 29350 * of the runtime bundle to detect SVG components 29351 */ 29352const lowercaseSVGElements = [ 29353 "animate", 29354 "circle", 29355 "defs", 29356 "desc", 29357 "ellipse", 29358 "g", 29359 "image", 29360 "line", 29361 "filter", 29362 "marker", 29363 "mask", 29364 "metadata", 29365 "path", 29366 "pattern", 29367 "polygon", 29368 "polyline", 29369 "rect", 29370 "stop", 29371 "switch", 29372 "symbol", 29373 "svg", 29374 "text", 29375 "tspan", 29376 "use", 29377 "view", 29378]; 29379 29380 29381 29382;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/ut
vendor: 4,267 bytes, lines 29382-29514
29382ils/is-svg-component.mjs 29383 29384 29385function isSVGComponent(Component) { 29386 if ( 29387 /** 29388 * If it's not a string, it's a custom React component. Currently we only support 29389 * HTML custom React components. 29390 */ 29391 typeof Component !== "string" || 29392 /** 29393 * If it contains a dash, the element is a custom HTML webcomponent. 29394 */ 29395 Component.includes("-")) { 29396 return false; 29397 } 29398 else if ( 29399 /** 29400 * If it's in our list of lowercase SVG tags, it's an SVG component 29401 */ 29402 lowercaseSVGElements.indexOf(Component) > -1 || 29403 /** 29404 * If it contains a capital letter, it's an SVG component 29405 */ 29406 /[A-Z]/u.test(Component)) { 29407 return true; 29408 } 29409 return false; 29410} 29411 29412 29413 29414;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/path.mjs 29415 29416 29417const dashKeys = { 29418 offset: "stroke-dashoffset", 29419 array: "stroke-dasharray", 29420}; 29421const camelKeys = { 29422 offset: "strokeDashoffset", 29423 array: "strokeDasharray", 29424}; 29425/** 29426 * Build SVG path properties. Uses the path's measured length to convert 29427 * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset 29428 * and stroke-dasharray attributes. 29429 * 29430 * This function is mutative to reduce per-frame GC. 29431 */ 29432function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { 29433 // Normalise path length by setting SVG attribute pathLength to 1 29434 attrs.pathLength = 1; 29435 // We use dash case when setting attributes directly to the DOM node and camel case 29436 // when defining props on a React component. 29437 const keys = useDashCase ? dashKeys : camelKeys; 29438 // Build the dash offset 29439 attrs[keys.offset] = px.transform(-offset); 29440 // Build the dash array 29441 const pathLength = px.transform(length); 29442 const pathSpacing = px.transform(spacing); 29443 attrs[keys.array] = `${pathLength} ${pathSpacing}`; 29444} 29445 29446 29447 29448;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs 29449 29450 29451function transform_origin_calcOrigin(origin, offset, size) { 29452 return typeof origin === "string" 29453 ? origin 29454 : px.transform(offset + size * origin); 29455} 29456/** 29457 * The SVG transform origin defaults are different to CSS and is less intuitive, 29458 * so we use the measured dimensions of the SVG to reconcile these. 29459 */ 29460function calcSVGTransformOrigin(dimensions, originX, originY) { 29461 const pxOriginX = transform_origin_calcOrigin(originX, dimensions.x, dimensions.width); 29462 const pxOriginY = transform_origin_calcOrigin(originY, dimensions.y, dimensions.height); 29463 return `${pxOriginX} ${pxOriginY}`; 29464} 29465 29466 29467 29468;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs 29469 29470 29471 29472 29473/** 29474 * Build SVG visual attrbutes, like cx and style.transform 29475 */ 29476function buildSVGAttrs(state, { attrX, attrY, attrScale, originX, originY, pathLength, pathSpacing = 1, pathOffset = 0, 29477// This is object creation, which we try to avoid per-frame. 29478...latest }, isSVGTag, transformTemplate) { 29479 buildHTMLStyles(state, latest, transformTemplate); 29480 /** 29481 * For svg tags we just want to make sure viewBox is animatable and treat all the styles 29482 * as normal HTML tags. 29483 */ 29484 if (isSVGTag) { 29485 if (state.style.viewBox) { 29486 state.attrs.viewBox = state.style.viewBox; 29487 } 29488 return; 29489 } 29490 state.attrs = state.style; 29491 state.style = {}; 29492 const { attrs, style, dimensions } = state; 29493 /** 29494 * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs 29495 * and copy it into style. 29496 */ 29497 if (attrs.transform) { 29498 if (dimensions) 29499 style.transform = attrs.transform; 29500 delete attrs.transform; 29501 } 29502 // Parse transformOrigin 29503 if (dimensions && 29504 (originX !== undefined || originY !== undefined || style.transform)) { 29505 style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5); 29506 } 29507 // Render attrX/attrY/attrScale as attributes 29508 if (attrX !== undefined) 29509 attrs.x = attrX; 29510 if (attrY !== undefined) 29511 attrs.y = attrY; 29512 if (attrScale !== undefined) 29513 attrs.scale = attrScale; 29514 // Build SVG path if one has been defined
29515 if (pathLength !== undefined) { 29516 buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); 29517 } 29518} 29519 29520 29521 29522;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs 29523 29524 29525const createSvgRenderState = () => ({ 29526 ...createHtmlRenderState(), 29527 attrs: {}, 29528}); 29529 29530 29531 29532;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs 29533const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; 29534 29535 29536 29537;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/use-props.mjs 29538 29539 29540 29541 29542 29543 29544function useSVGProps(props, visualState, _isStatic, Component) { 29545 const visualProps = (0,react.useMemo)(() => { 29546 const state = createSvgRenderState(); 29547 buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate); 29548 return { 29549 ...state.attrs, 29550 style: { ...state.style }, 29551 }; 29552 }, [visualState]); 29553 if (props.style) { 29554 const rawStyles = {}; 29555 copyRawValuesOnly(rawStyles, props.style, props); 29556 visualProps.style = { ...rawStyles, ...visualProps.style }; 29557 } 29558 return visualProps; 29559} 29560 29561 29562 29563;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/use-render.mjs 29564 29565 29566 29567 29568 29569 29570 29571function createUseRender(forwardMotionProps = false) { 29572 const useRender = (Component, props, ref, { latestValues }, isStatic) => { 29573 const useVisualProps = isSVGComponent(Component) 29574 ? useSVGProps 29575 : useHTMLProps; 29576 const visualProps = useVisualProps(props, latestValues, isStatic, Component); 29577 const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); 29578 const elementProps = Component !== react.Fragment 29579 ? { ...filteredProps, ...visualProps, ref } 29580 : {}; 29581 /** 29582 * If component has been handed a motion value as its child, 29583 * memoise its initial value and render that. Subsequent updates 29584 * will be handled by the onChange handler 29585 */ 29586 const { children } = props; 29587 const renderedChildren = (0,react.useMemo)(() => (isMotionValue(children) ? children.get() : children), [children]); 29588 return (0,react.createElement)(Component, { 29589 ...elementProps, 29590 children: renderedChildren, 29591 }); 29592 }; 29593 return useRender; 29594} 29595 29596 29597 29598// EXTERNAL MODULE: ./node_modules/framer-motion/dist/es/utils/use-constant.mjs 29599var use_constant = __webpack_require__(6681); 29600;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs 29601 29602 29603 29604 29605 29606 29607 29608 29609 29610function makeState({ scrapeMotionValuesFromProps, createRenderState, onUpdate, }, props, context, presenceContext) { 29611 const state = { 29612 latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), 29613 renderState: createRenderState(), 29614 }; 29615 if (onUpdate) { 29616 /** 29617 * onMount works without the VisualElement because it could be 29618 * called before the VisualElement payload has been hydrated. 29619 * (e.g. if someone is using m components <m.circle />) 29620 */ 29621 state.onMount = (instance) => onUpdate({ props, current: instance, ...state }); 29622 state.onUpdate = (visualElement) => onUpdate(visualElement); 29623 } 29624 return state; 29625} 29626const makeUseVisualState = (config) => (props, isStatic) => { 29627 const context = (0,react.useContext)(MotionContext); 29628 const presenceContext = (0,react.useContext)(PresenceContext/* PresenceContext */.O); 29629 const make = () => makeState(config, props, context, presenceContext); 29630 return isStatic ? make() : (0,use_constant/* useConstant */.h)(make); 29631}; 29632function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { 29633 const values = {}; 29634 const motionValues = scrapeMotionValues(props, {}); 29635 for (const key in motionValues) { 29636 values[key] = resolveMotionValue(motionValues[key]); 29637 } 29638 let { initial, animate } = props; 29639 const isControllingVariants$1 = isControllingVariants(props); 29640 const isVariantNode$1 = isVariantNode(props); 29641 if (context && 29642 isVariantNode$1 && 29643 !isControllingVariants$1 && 29644 props.inherit !== false) { 29645 if (initial === undefined)
29646 initial = context.initial; 29647 if (animate === undefined) 29648 animate = context.animate; 29649 } 29650 let isInitialAnimationBlocked = presenceContext 29651 ? presenceContext.initial === false 29652 : false; 29653 isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; 29654 const variantToSet = isInitialAnimationBlocked ? animate : initial; 29655 if (variantToSet && 29656 typeof variantToSet !== "boolean" && 29657 !isAnimationControls(variantToSet)) { 29658 const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; 29659 for (let i = 0; i < list.length; i++) { 29660 const resolved = resolveVariantFromProps(props, list[i]); 29661 if (resolved) { 29662 const { transitionEnd, transition, ...target } = resolved; 29663 for (const key in target) { 29664 let valueTarget = target[key]; 29665 if (Array.isArray(valueTarget)) { 29666 /** 29667 * Take final keyframe if the initial animation is blocked because 29668 * we want to initialise at the end of that blocked animation. 29669 */ 29670 const index = isInitialAnimationBlocked 29671 ? valueTarget.length - 1 29672 : 0; 29673 valueTarget = valueTarget[index]; 29674 } 29675 if (valueTarget !== null) { 29676 values[key] = valueTarget; 29677 } 29678 } 29679 for (const key in transitionEnd) { 29680 values[key] = transitionEnd[key]; 29681 } 29682 } 29683 } 29684 } 29685 return values; 29686} 29687 29688 29689 29690;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs 29691 29692 29693 29694function scrapeMotionValuesFromProps(props, prevProps, visualElement) { 29695 var _a; 29696 const { style } = props; 29697 const newValues = {}; 29698 for (const key in style) { 29699 if (isMotionValue(style[key]) || 29700 (prevProps.style && 29701 isMotionValue(prevProps.style[key])) || 29702 isForcedMotionValue(key, props) || 29703 ((_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== undefined) { 29704 newValues[key] = style[key]; 29705 } 29706 } 29707 return newValues; 29708} 29709 29710 29711 29712;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/config-motion.mjs 29713 29714 29715 29716 29717const htmlMotionConfig = { 29718 useVisualState: makeUseVisualState({ 29719 scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, 29720 createRenderState: createHtmlRenderState, 29721 }), 29722}; 29723 29724 29725 29726;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/measure.mjs 29727function updateSVGDimensions(instance, renderState) { 29728 try { 29729 renderState.dimensions = 29730 typeof instance.getBBox === "function" 29731 ? instance.getBBox() 29732 : instance.getBoundingClientRect(); 29733 } 29734 catch (e) { 29735 // Most likely trying to measure an unrendered element under Firefox 29736 renderState.dimensions = { 29737 x: 0, 29738 y: 0, 29739 width: 0, 29740 height: 0, 29741 }; 29742 } 29743} 29744 29745 29746 29747;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/render.mjs 29748function renderHTML(element, { style, vars }, styleProp, projection) { 29749 Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp)); 29750 // Loop over any CSS variables and assign those. 29751 for (const key in vars) { 29752 element.style.setProperty(key, vars[key]); 29753 } 29754} 29755 29756 29757 29758;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs 29759/** 29760 * A set of attribute names that are always read/written as camel case. 29761 */ 29762const camelCaseAttributes = new Set([ 29763 "baseFrequency", 29764 "diffuseConstant", 29765 "kernelMatrix", 29766 "kernelUnitLength", 29767 "keySplines", 29768 "keyTimes", 29769 "limitingConeAngle", 29770 "markerHeight", 29771 "markerWidth", 29772 "numOctaves", 29773 "targetX", 29774 "targetY", 29775 "surfaceScale", 29776 "specularConstant", 29777 "specularExponent", 29778 "stdDeviation", 29779 "tableValues", 29780 "viewBox", 29781 "gradientTransform", 29782 "pathLength", 29783 "startOffset", 29784 "textLength", 29785 "lengthAdjust", 29786]); 29787 29788 29789 29790;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/render.mjs 29791 29792 29793 29794
29795function renderSVG(element, renderState, _styleProp, projection) { 29796 renderHTML(element, renderState, undefined, projection); 29797 for (const key in renderState.attrs) { 29798 element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); 29799 } 29800} 29801 29802 29803 29804;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs 29805 29806 29807 29808 29809function scrape_motion_values_scrapeMotionValuesFromProps(props, prevProps, visualElement) { 29810 const newValues = scrapeMotionValuesFromProps(props, prevProps, visualElement); 29811 for (const key in props) { 29812 if (isMotionValue(props[key]) || 29813 isMotionValue(prevProps[key])) { 29814 const targetKey = transformPropOrder.indexOf(key) !== -1 29815 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) 29816 : key; 29817 newValues[targetKey] = props[key]; 29818 } 29819 } 29820 return newValues; 29821} 29822 29823 29824 29825;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/config-motion.mjs 29826 29827 29828 29829 29830 29831 29832 29833 29834 29835 29836const layoutProps = ["x", "y", "width", "height", "cx", "cy", "r"]; 29837const svgMotionConfig = { 29838 useVisualState: makeUseVisualState({ 29839 scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps, 29840 createRenderState: createSvgRenderState, 29841 onUpdate: ({ props, prevProps, current, renderState, latestValues, }) => { 29842 if (!current) 29843 return; 29844 let hasTransform = !!props.drag; 29845 if (!hasTransform) { 29846 for (const key in latestValues) { 29847 if (transformProps.has(key)) { 29848 hasTransform = true; 29849 break; 29850 } 29851 } 29852 } 29853 if (!hasTransform) 29854 return; 29855 let needsMeasure = !prevProps; 29856 if (prevProps) { 29857 /** 29858 * Check the layout props for changes, if any are found we need to 29859 * measure the element again. 29860 */ 29861 for (let i = 0; i < layoutProps.length; i++) { 29862 const key = layoutProps[i]; 29863 if (props[key] !== 29864 prevProps[key]) { 29865 needsMeasure = true; 29866 } 29867 } 29868 } 29869 if (!needsMeasure) 29870 return; 29871 frame_frame.read(() => { 29872 updateSVGDimensions(current, renderState); 29873 frame_frame.render(() => { 29874 buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate); 29875 renderSVG(current, renderState); 29876 }); 29877 }); 29878 }, 29879 }), 29880}; 29881 29882 29883 29884;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/components/create-factory.mjs 29885 29886 29887 29888 29889 29890 29891function createMotionComponentFactory(preloadedFeatures, createVisualElement) { 29892 return function createMotionComponent(Component, { forwardMotionProps } = { forwardMotionProps: false }) { 29893 const baseConfig = isSVGComponent(Component) 29894 ? svgMotionConfig 29895 : htmlMotionConfig; 29896 const config = { 29897 ...baseConfig, 29898 preloadedFeatures, 29899 useRender: createUseRender(forwardMotionProps), 29900 createVisualElement, 29901 Component, 29902 }; 29903 return createRendererMotionComponent(config); 29904 }; 29905} 29906 29907 29908 29909;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs 29910// Does this device prefer reduced motion? Returns `null` server-side. 29911const prefersReducedMotion = { current: null }; 29912const hasReducedMotionListener = { current: false }; 29913 29914 29915 29916;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs 29917 29918 29919 29920function initPrefersReducedMotion() { 29921 hasReducedMotionListener.current = true; 29922 if (!is_browser/* isBrowser */.j) 29923 return; 29924 if (window.matchMedia) { 29925 const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); 29926 const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); 29927 motionMediaQuery.addListener(setReducedMotionPreferences); 29928 setReducedMotionPreferences(); 29929 } 29930 else { 29931 prefersReducedMotion.current = false;
vendor: 22,913 bytes, lines 29932-30603
29932 } 29933} 29934 29935 29936 29937;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs 29938 29939 29940 29941 29942 29943/** 29944 * A list of all ValueTypes 29945 */ 29946const valueTypes = [...dimensionValueTypes, color, complex]; 29947/** 29948 * Tests a value against the list of ValueTypes 29949 */ 29950const findValueType = (v) => valueTypes.find(testValueType(v)); 29951 29952 29953 29954;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/store.mjs 29955const visualElementStore = new WeakMap(); 29956 29957 29958 29959;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/motion-values.mjs 29960 29961 29962 29963 29964function updateMotionValuesFromProps(element, next, prev) { 29965 for (const key in next) { 29966 const nextValue = next[key]; 29967 const prevValue = prev[key]; 29968 if (isMotionValue(nextValue)) { 29969 /** 29970 * If this is a motion value found in props or style, we want to add it 29971 * to our visual element's motion value map. 29972 */ 29973 element.addValue(key, nextValue); 29974 /** 29975 * Check the version of the incoming motion value with this version 29976 * and warn against mismatches. 29977 */ 29978 if (false) {} 29979 } 29980 else if (isMotionValue(prevValue)) { 29981 /** 29982 * If we're swapping from a motion value to a static value, 29983 * create a new motion value from that 29984 */ 29985 element.addValue(key, motionValue(nextValue, { owner: element })); 29986 } 29987 else if (prevValue !== nextValue) { 29988 /** 29989 * If this is a flat value that has changed, update the motion value 29990 * or create one if it doesn't exist. We only want to do this if we're 29991 * not handling the value with our animation state. 29992 */ 29993 if (element.hasValue(key)) { 29994 const existingValue = element.getValue(key); 29995 if (existingValue.liveStyle === true) { 29996 existingValue.jump(nextValue); 29997 } 29998 else if (!existingValue.hasAnimated) { 29999 existingValue.set(nextValue); 30000 } 30001 } 30002 else { 30003 const latestValue = element.getStaticValue(key); 30004 element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); 30005 } 30006 } 30007 } 30008 // Handle removed values 30009 for (const key in prev) { 30010 if (next[key] === undefined) 30011 element.removeValue(key); 30012 } 30013 return next; 30014} 30015 30016 30017 30018;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/VisualElement.mjs 30019 30020 30021 30022 30023 30024 30025 30026 30027 30028 30029 30030 30031 30032 30033 30034 30035 30036 30037 30038const propEventHandlers = [ 30039 "AnimationStart", 30040 "AnimationComplete", 30041 "Update", 30042 "BeforeLayoutMeasure", 30043 "LayoutMeasure", 30044 "LayoutAnimationStart", 30045 "LayoutAnimationComplete", 30046]; 30047/** 30048 * A VisualElement is an imperative abstraction around UI elements such as 30049 * HTMLElement, SVGElement, Three.Object3D etc. 30050 */ 30051class VisualElement { 30052 /** 30053 * This method takes React props and returns found MotionValues. For example, HTML 30054 * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. 30055 * 30056 * This isn't an abstract method as it needs calling in the constructor, but it is 30057 * intended to be one. 30058 */ 30059 scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { 30060 return {}; 30061 } 30062 constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }, options = {}) { 30063 /** 30064 * A reference to the current underlying Instance, e.g. a HTMLElement 30065 * or Three.Mesh etc. 30066 */ 30067 this.current = null; 30068 /** 30069 * A set containing references to this VisualElement's children. 30070 */ 30071 this.children = new Set(); 30072 /** 30073 * Determine what role this visual element should take in the variant tree. 30074 */ 30075 this.isVariantNode = false; 30076 this.isControllingVariants = false; 30077 /** 30078 * Decides whether this VisualElement should animate in reduced motion 30079 * mode. 30080 * 30081 * TODO: This is currently set on every individual VisualElement but feels 30082 * like it could be set globally. 30083 */ 30084 this.shouldReduceMotion = null; 30085 /** 30086 * A map of all motion values attached to this visual element. Motion 30087 * values are source of truth for any given animated value. A motion 30088 * value might be provided externally by the component via props. 30089 */ 30090 this.values = new Map(); 30091 this.KeyframeResolver = KeyframeResolver; 30092 /** 30093 * Cleanup functions for active features (hover/tap/exit etc) 30094 */ 30095 this.features = {}; 30096 /** 30097 * A map of every subscription that binds the provided or generated 30098 * motion values onChange listeners to this visual element. 30099 */ 30100 this.valueSubscriptions = new Map(); 30101 /** 30102 * A reference to the previously-provided motion values as returned 30103 * from scrapeMotionValuesFromProps. We use the keys in here to determine 30104 * if any motion values need to be removed after props are updated. 30105 */ 30106 this.prevMotionValues = {}; 30107 /** 30108 * An object containing a SubscriptionManager for each active event. 30109 */ 30110 this.events = {}; 30111 /** 30112 * An object containing an unsubscribe function for each prop event subscription. 30113 * For example, every "Update" event can have multiple subscribers via 30114 * VisualElement.on(), but only one of those can be defined via the onUpdate prop. 30115 */ 30116 this.propEventSubscriptions = {}; 30117 this.notifyUpdate = () => this.notify("Update", this.latestValues); 30118 this.render = () => { 30119 if (!this.current) 30120 return; 30121 this.triggerBuild(); 30122 this.renderInstance(this.current, this.renderState, this.props.style, this.projection); 30123 }; 30124 this.renderScheduledAt = 0.0; 30125 this.scheduleRender = () => { 30126 const now = time.now(); 30127 if (this.renderScheduledAt < now) { 30128 this.renderScheduledAt = now; 30129 frame_frame.render(this.render, false, true); 30130 } 30131 }; 30132 const { latestValues, renderState, onUpdate } = visualState; 30133 this.onUpdate = onUpdate; 30134 this.latestValues = latestValues; 30135 this.baseTarget = { ...latestValues }; 30136 this.initialValues = props.initial ? { ...latestValues } : {}; 30137 this.renderState = renderState; 30138 this.parent = parent; 30139 this.props = props; 30140 this.presenceContext = presenceContext; 30141 this.depth = parent ? parent.depth + 1 : 0; 30142 this.reducedMotionConfig = reducedMotionConfig; 30143 this.options = options; 30144 this.blockInitialAnimation = Boolean(blockInitialAnimation); 30145 this.isControllingVariants = isControllingVariants(props); 30146 this.isVariantNode = isVariantNode(props); 30147 if (this.isVariantNode) { 30148 this.variantChildren = new Set(); 30149 } 30150 this.manuallyAnimateOnMount = Boolean(parent && parent.current); 30151 /** 30152 * Any motion values that are provided to the element when created 30153 * aren't yet bound to the element, as this would technically be impure. 30154 * However, we iterate through the motion values and set them to the 30155 * initial values for this component. 30156 * 30157 * TODO: This is impure and we should look at changing this to run on mount. 30158 * Doing so will break some tests but this isn't necessarily a breaking change, 30159 * more a reflection of the test. 30160 */ 30161 const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); 30162 for (const key in initialMotionValues) { 30163 const value = initialMotionValues[key]; 30164 if (latestValues[key] !== undefined && isMotionValue(value)) { 30165 value.set(latestValues[key], false); 30166 } 30167 } 30168 } 30169 mount(instance) { 30170 this.current = instance; 30171 visualElementStore.set(instance, this); 30172 if (this.projection && !this.projection.instance) { 30173 this.projection.mount(instance); 30174 } 30175 if (this.parent && this.isVariantNode && !this.isControllingVariants) { 30176 this.removeFromVariantTree = this.parent.addVariantChild(this); 30177 } 30178 this.values.forEach((value, key) => this.bindToMotionValue(key, value)); 30179 if (!hasReducedMotionListener.current) { 30180 initPrefersReducedMotion(); 30181 } 30182 this.shouldReduceMotion = 30183 this.reducedMotionConfig === "never" 30184 ? false 30185 : this.reducedMotionConfig === "always" 30186 ? true 30187 : prefersReducedMotion.current; 30188 if (false) {} 30189 if (this.parent) 30190 this.parent.children.add(this); 30191 this.update(this.props, this.presenceContext); 30192 } 30193 unmount() { 30194 this.projection && this.projection.unmount(); 30195 frame_cancelFrame(this.notifyUpdate); 30196 frame_cancelFrame(this.render); 30197 this.valueSubscriptions.forEach((remove) => remove()); 30198 this.valueSubscriptions.clear(); 30199 this.removeFromVariantTree && this.removeFromVariantTree(); 30200 this.parent && this.parent.children.delete(this); 30201 for (const key in this.events) { 30202 this.events[key].clear(); 30203 } 30204 for (const key in this.features) { 30205 const feature = this.features[key]; 30206 if (feature) { 30207 feature.unmount(); 30208 feature.isMounted = false; 30209 } 30210 } 30211 this.current = null; 30212 } 30213 bindToMotionValue(key, value) { 30214 if (this.valueSubscriptions.has(key)) { 30215 this.valueSubscriptions.get(key)(); 30216 } 30217 const valueIsTransform = transformProps.has(key); 30218 if (valueIsTransform && this.onBindTransform) { 30219 this.onBindTransform(); 30220 } 30221 const removeOnChange = value.on("change", (latestValue) => { 30222 this.latestValues[key] = latestValue; 30223 this.props.onUpdate && frame_frame.preRender(this.notifyUpdate); 30224 if (valueIsTransform && this.projection) { 30225 this.projection.isTransformDirty = true; 30226 } 30227 }); 30228 const removeOnRenderRequest = value.on("renderRequest", this.scheduleRender); 30229 let removeSyncCheck; 30230 if (window.MotionCheckAppearSync) { 30231 removeSyncCheck = window.MotionCheckAppearSync(this, key, value); 30232 } 30233 this.valueSubscriptions.set(key, () => { 30234 removeOnChange(); 30235 removeOnRenderRequest(); 30236 if (removeSyncCheck) 30237 removeSyncCheck(); 30238 if (value.owner) 30239 value.stop(); 30240 }); 30241 } 30242 sortNodePosition(other) { 30243 /** 30244 * If these nodes aren't even of the same type we can't compare their depth. 30245 */ 30246 if (!this.current || 30247 !this.sortInstanceNodePosition || 30248 this.type !== other.type) { 30249 return 0; 30250 } 30251 return this.sortInstanceNodePosition(this.current, other.current); 30252 } 30253 updateFeatures() { 30254 let key = "animation"; 30255 for (key in featureDefinitions) { 30256 const featureDefinition = featureDefinitions[key]; 30257 if (!featureDefinition) 30258 continue; 30259 const { isEnabled, Feature: FeatureConstructor } = featureDefinition; 30260 /** 30261 * If this feature is enabled but not active, make a new instance. 30262 */ 30263 if (!this.features[key] && 30264 FeatureConstructor && 30265 isEnabled(this.props)) { 30266 this.features[key] = new FeatureConstructor(this); 30267 } 30268 /** 30269 * If we have a feature, mount or update it. 30270 */ 30271 if (this.features[key]) { 30272 const feature = this.features[key]; 30273 if (feature.isMounted) { 30274 feature.update(); 30275 } 30276 else { 30277 feature.mount(); 30278 feature.isMounted = true; 30279 } 30280 } 30281 } 30282 } 30283 triggerBuild() { 30284 this.build(this.renderState, this.latestValues, this.props); 30285 } 30286 /** 30287 * Measure the current viewport box with or without transforms. 30288 * Only measures axis-aligned boxes, rotate and skew must be manually 30289 * removed with a re-render to work. 30290 */ 30291 measureViewportBox() { 30292 return this.current 30293 ? this.measureInstanceViewportBox(this.current, this.props) 30294 : createBox(); 30295 } 30296 getStaticValue(key) { 30297 return this.latestValues[key]; 30298 } 30299 setStaticValue(key, value) { 30300 this.latestValues[key] = value; 30301 } 30302 /** 30303 * Update the provided props. Ensure any newly-added motion values are 30304 * added to our map, old ones removed, and listeners updated. 30305 */ 30306 update(props, presenceContext) { 30307 if (props.transformTemplate || this.props.transformTemplate) { 30308 this.scheduleRender(); 30309 } 30310 this.prevProps = this.props; 30311 this.props = props; 30312 this.prevPresenceContext = this.presenceContext; 30313 this.presenceContext = presenceContext; 30314 /** 30315 * Update prop event handlers ie onAnimationStart, onAnimationComplete 30316 */ 30317 for (let i = 0; i < propEventHandlers.length; i++) { 30318 const key = propEventHandlers[i]; 30319 if (this.propEventSubscriptions[key]) { 30320 this.propEventSubscriptions[key](); 30321 delete this.propEventSubscriptions[key]; 30322 } 30323 const listenerName = ("on" + key); 30324 const listener = props[listenerName]; 30325 if (listener) { 30326 this.propEventSubscriptions[key] = this.on(key, listener); 30327 } 30328 } 30329 this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues); 30330 if (this.handleChildMotionValue) { 30331 this.handleChildMotionValue(); 30332 } 30333 this.onUpdate && this.onUpdate(this); 30334 } 30335 getProps() { 30336 return this.props; 30337 } 30338 /** 30339 * Returns the variant definition with a given name. 30340 */ 30341 getVariant(name) { 30342 return this.props.variants ? this.props.variants[name] : undefined; 30343 } 30344 /** 30345 * Returns the defined default transition on this component. 30346 */ 30347 getDefaultTransition() { 30348 return this.props.transition; 30349 } 30350 getTransformPagePoint() { 30351 return this.props.transformPagePoint; 30352 } 30353 getClosestVariantNode() { 30354 return this.isVariantNode 30355 ? this 30356 : this.parent 30357 ? this.parent.getClosestVariantNode() 30358 : undefined; 30359 } 30360 /** 30361 * Add a child visual element to our set of children. 30362 */ 30363 addVariantChild(child) { 30364 const closestVariantNode = this.getClosestVariantNode(); 30365 if (closestVariantNode) { 30366 closestVariantNode.variantChildren && 30367 closestVariantNode.variantChildren.add(child); 30368 return () => closestVariantNode.variantChildren.delete(child); 30369 } 30370 } 30371 /** 30372 * Add a motion value and bind it to this visual element. 30373 */ 30374 addValue(key, value) { 30375 // Remove existing value if it exists 30376 const existingValue = this.values.get(key); 30377 if (value !== existingValue) { 30378 if (existingValue) 30379 this.removeValue(key); 30380 this.bindToMotionValue(key, value); 30381 this.values.set(key, value); 30382 this.latestValues[key] = value.get(); 30383 } 30384 } 30385 /** 30386 * Remove a motion value and unbind any active subscriptions. 30387 */ 30388 removeValue(key) { 30389 this.values.delete(key); 30390 const unsubscribe = this.valueSubscriptions.get(key); 30391 if (unsubscribe) { 30392 unsubscribe(); 30393 this.valueSubscriptions.delete(key); 30394 } 30395 delete this.latestValues[key]; 30396 this.removeValueFromRenderState(key, this.renderState); 30397 } 30398 /** 30399 * Check whether we have a motion value for this key 30400 */ 30401 hasValue(key) { 30402 return this.values.has(key); 30403 } 30404 getValue(key, defaultValue) { 30405 if (this.props.values && this.props.values[key]) { 30406 return this.props.values[key]; 30407 } 30408 let value = this.values.get(key); 30409 if (value === undefined && defaultValue !== undefined) { 30410 value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); 30411 this.addValue(key, value); 30412 } 30413 return value; 30414 } 30415 /** 30416 * If we're trying to animate to a previously unencountered value, 30417 * we need to check for it in our state and as a last resort read it 30418 * directly from the instance (which might have performance implications). 30419 */ 30420 readValue(key, target) { 30421 var _a; 30422 let value = this.latestValues[key] !== undefined || !this.current 30423 ? this.latestValues[key] 30424 : (_a = this.getBaseTargetFromProps(this.props, key)) !== null && _a !== void 0 ? _a : this.readValueFromInstance(this.current, key, this.options); 30425 if (value !== undefined && value !== null) { 30426 if (typeof value === "string" && 30427 (isNumericalString(value) || isZeroValueString(value))) { 30428 // If this is a number read as a string, ie "0" or "200", convert it to a number 30429 value = parseFloat(value); 30430 } 30431 else if (!findValueType(value) && complex.test(target)) { 30432 value = animatable_none_getAnimatableNone(key, target); 30433 } 30434 this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); 30435 } 30436 return isMotionValue(value) ? value.get() : value; 30437 } 30438 /** 30439 * Set the base target to later animate back to. This is currently 30440 * only hydrated on creation and when we first read a value. 30441 */ 30442 setBaseTarget(key, value) { 30443 this.baseTarget[key] = value; 30444 } 30445 /** 30446 * Find the base target for a value thats been removed from all animation 30447 * props. 30448 */ 30449 getBaseTarget(key) { 30450 var _a; 30451 const { initial } = this.props; 30452 let valueFromInitial; 30453 if (typeof initial === "string" || typeof initial === "object") { 30454 const variant = resolveVariantFromProps(this.props, initial, (_a = this.presenceContext) === null || _a === void 0 ? void 0 : _a.custom); 30455 if (variant) { 30456 valueFromInitial = variant[key]; 30457 } 30458 } 30459 /** 30460 * If this value still exists in the current initial variant, read that. 30461 */ 30462 if (initial && valueFromInitial !== undefined) { 30463 return valueFromInitial; 30464 } 30465 /** 30466 * Alternatively, if this VisualElement config has defined a getBaseTarget 30467 * so we can read the value from an alternative source, try that. 30468 */ 30469 const target = this.getBaseTargetFromProps(this.props, key); 30470 if (target !== undefined && !isMotionValue(target)) 30471 return target; 30472 /** 30473 * If the value was initially defined on initial, but it doesn't any more, 30474 * return undefined. Otherwise return the value as initially read from the DOM. 30475 */ 30476 return this.initialValues[key] !== undefined && 30477 valueFromInitial === undefined 30478 ? undefined 30479 : this.baseTarget[key]; 30480 } 30481 on(eventName, callback) { 30482 if (!this.events[eventName]) { 30483 this.events[eventName] = new SubscriptionManager(); 30484 } 30485 return this.events[eventName].add(callback); 30486 } 30487 notify(eventName, ...args) { 30488 if (this.events[eventName]) { 30489 this.events[eventName].notify(...args); 30490 } 30491 } 30492} 30493 30494 30495 30496;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs 30497 30498 30499 30500 30501class DOMVisualElement extends VisualElement { 30502 constructor() { 30503 super(...arguments); 30504 this.KeyframeResolver = DOMKeyframesResolver; 30505 } 30506 sortInstanceNodePosition(a, b) { 30507 /** 30508 * compareDocumentPosition returns a bitmask, by using the bitwise & 30509 * we're returning true if 2 in that bitmask is set to true. 2 is set 30510 * to true if b preceeds a. 30511 */ 30512 return a.compareDocumentPosition(b) & 2 ? 1 : -1; 30513 } 30514 getBaseTargetFromProps(props, key) { 30515 return props.style 30516 ? props.style[key] 30517 : undefined; 30518 } 30519 removeValueFromRenderState(key, { vars, style }) { 30520 delete vars[key]; 30521 delete style[key]; 30522 } 30523 handleChildMotionValue() { 30524 if (this.childSubscription) { 30525 this.childSubscription(); 30526 delete this.childSubscription; 30527 } 30528 const { children } = this.props; 30529 if (isMotionValue(children)) { 30530 this.childSubscription = children.on("change", (latest) => { 30531 if (this.current) { 30532 this.current.textContent = `${latest}`; 30533 } 30534 }); 30535 } 30536 } 30537} 30538 30539 30540 30541;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs 30542 30543 30544 30545 30546 30547 30548 30549 30550 30551function HTMLVisualElement_getComputedStyle(element) { 30552 return window.getComputedStyle(element); 30553} 30554class HTMLVisualElement extends DOMVisualElement { 30555 constructor() { 30556 super(...arguments); 30557 this.type = "html"; 30558 this.renderInstance = renderHTML; 30559 } 30560 readValueFromInstance(instance, key) { 30561 if (transformProps.has(key)) { 30562 return readTransformValue(instance, key); 30563 } 30564 else { 30565 const computedStyle = HTMLVisualElement_getComputedStyle(instance); 30566 const value = (isCSSVariableName(key) 30567 ? computedStyle.getPropertyValue(key) 30568 : computedStyle[key]) || 0; 30569 return typeof value === "string" ? value.trim() : value; 30570 } 30571 } 30572 measureInstanceViewportBox(instance, { transformPagePoint }) { 30573 return measureViewportBox(instance, transformPagePoint); 30574 } 30575 build(renderState, latestValues, props) { 30576 buildHTMLStyles(renderState, latestValues, props.transformTemplate); 30577 } 30578 scrapeMotionValuesFromProps(props, prevProps, visualElement) { 30579 return scrapeMotionValuesFromProps(props, prevProps, visualElement); 30580 } 30581} 30582 30583 30584 30585;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs 30586 30587 30588 30589 30590 30591 30592 30593 30594 30595 30596 30597 30598 30599class SVGVisualElement extends DOMVisualElement { 30600 constructor() { 30601 super(...arguments); 30602 this.type = "svg"; 30603 this.isSVGTag = false;
30604 this.measureInstanceViewportBox = createBox; 30605 this.updateDimensions = () => { 30606 if (this.current && !this.renderState.dimensions) { 30607 updateSVGDimensions(this.current, this.renderState); 30608 } 30609 }; 30610 } 30611 getBaseTargetFromProps(props, key) { 30612 return props[key]; 30613 } 30614 readValueFromInstance(instance, key) { 30615 if (transformProps.has(key)) { 30616 const defaultType = getDefaultValueType(key); 30617 return defaultType ? defaultType.default || 0 : 0; 30618 } 30619 key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; 30620 return instance.getAttribute(key); 30621 } 30622 scrapeMotionValuesFromProps(props, prevProps, visualElement) { 30623 return scrape_motion_values_scrapeMotionValuesFromProps(props, prevProps, visualElement); 30624 } 30625 onBindTransform() { 30626 if (this.current && !this.renderState.dimensions) { 30627 frame_frame.postRender(this.updateDimensions); 30628 } 30629 } 30630 build(renderState, latestValues, props) { 30631 buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate); 30632 } 30633 renderInstance(instance, renderState, styleProp, projection) { 30634 renderSVG(instance, renderState, styleProp, projection); 30635 } 30636 mount(instance) { 30637 this.isSVGTag = isSVGTag(instance.tagName); 30638 super.mount(instance); 30639 } 30640} 30641 30642 30643 30644;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs 30645 30646 30647 30648 30649 30650const createDomVisualElement = (Component, options) => { 30651 return isSVGComponent(Component) 30652 ? new SVGVisualElement(options) 30653 : new HTMLVisualElement(options, { 30654 allowProjection: Component !== react.Fragment, 30655 }); 30656}; 30657 30658 30659 30660;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/components/motion/create.mjs 30661 30662 30663 30664 30665 30666 30667 30668const createMotionComponent = /*@__PURE__*/ createMotionComponentFactory({ 30669 ...animations, 30670 ...gestureAnimations, 30671 ...drag, 30672 ...layout, 30673}, createDomVisualElement); 30674 30675 30676 30677;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs 30678 30679 30680 30681const motion = /*@__PURE__*/ createDOMMotionComponentProxy(createMotionComponent); 30682 30683 30684 30685 30686/***/ }), 30687 30688/***/ 1741: 30689/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30690 30691"use strict"; 30692/* harmony export */ __webpack_require__.d(__webpack_exports__, { 30693/* harmony export */ j: function() { return /* binding */ isBrowser; } 30694/* harmony export */ }); 30695const isBrowser = typeof window !== "undefined"; 30696 30697 30698 30699 30700/***/ }), 30701 30702/***/ 6681: 30703/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30704 30705"use strict"; 30706/* harmony export */ __webpack_require__.d(__webpack_exports__, { 30707/* harmony export */ h: function() { return /* binding */ useConstant; } 30708/* harmony export */ }); 30709/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 30710 30711 30712/** 30713 * Creates a constant value over the lifecycle of a component. 30714 * 30715 * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer 30716 * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` 30717 * you can ensure that initialisers don't execute twice or more. 30718 */ 30719function useConstant(init) { 30720 const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null); 30721 if (ref.current === null) { 30722 ref.current = init(); 30723 } 30724 return ref.current; 30725} 30726 30727 30728 30729 30730/***/ }), 30731 30732/***/ 8868: 30733/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30734 30735"use strict"; 30736/* harmony export */ __webpack_require__.d(__webpack_exports__, { 30737/* harmony export */ L: function() { return /* binding */ useIsomorphicLayoutEffect; } 30738/* harmony export */ }); 30739/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 30740/* harmony import */ var _is_browser_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1741); 30741 30742 30743 30744const useIsomorphicLayoutEffect = _is_browser_mjs__WEBPACK_IMPORTED_MODULE_1__/* .isBrowser */ .j ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect; 30745 30746 30747 30748 30749/***/ }), 30750 30751/***/ 1692: 30752/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30753 30754"use strict"; 30755 30756// EXPORTS 30757__webpack_require__.d(__webpack_exports__, { 30758 Z: function() { return /* binding */ createLucideIcon; } 30759}); 30760 30761// EXTERNAL MODULE: ./node_modules/react/index.js 30762var react = __webpack_require__(7294); 30763;// CONCATENATED MODULE: ./node_modules/lucide-react/dist/esm/shared/src/utils.js 30764/** 30765 * @license lucide-react v0.475.0 - ISC 30766 * 30767 * This source code is licensed under the ISC license. 30768 * See the LICENSE file in the root directory of this source tree. 30769 */ const toKebabCase = (string)=>string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); 30770const mergeClasses = function() { 30771 for(var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++){ 30772 classes[_key] = arguments[_key]; 30773 } 30774 return classes.filter((className, index, array)=>{ 30775 return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index; 30776 }).join(" ").trim(); 30777}; 30778 //# sourceMappingURL=utils.js.map 30779 30780;// CONCATENATED MODULE: ./node_modules/lucide-react/dist/esm/defaultAttributes.js 30781/** 30782 * @license lucide-react v0.475.0 - ISC 30783 * 30784 * This source code is licensed under the ISC license. 30785 * See the LICENSE file in the root directory of this source tree. 30786 */ var defaultAttributes = { 30787 xmlns: "http://www.w3.org/2000/svg", 30788 width: 24, 30789 height: 24,
30790 viewBox: "0 0 24 24", 30791 fill: "none", 30792 stroke: "currentColor", 30793 strokeWidth: 2, 30794 strokeLinecap: "round", 30795 strokeLinejoin: "round" 30796}; 30797 //# sourceMappingURL=defaultAttributes.js.map 30798 30799;// CONCATENATED MODULE: ./node_modules/lucide-react/dist/esm/Icon.js 30800/** 30801 * @license lucide-react v0.475.0 - ISC 30802 * 30803 * This source code is licensed under the ISC license. 30804 * See the LICENSE file in the root directory of this source tree. 30805 */ 30806 30807 30808const Icon = /*#__PURE__*/ (0,react.forwardRef)((param, ref)=>{ 30809 let { color = "currentColor", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children, iconNode, ...rest } = param; 30810 return /*#__PURE__*/ (0,react.createElement)("svg", { 30811 ref, 30812 ...defaultAttributes, 30813 width: size, 30814 height: size, 30815 stroke: color, 30816 strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth, 30817 className: mergeClasses("lucide", className), 30818 ...rest 30819 }, [ 30820 ...iconNode.map((param)=>{ 30821 let [tag, attrs] = param; 30822 return /*#__PURE__*/ (0,react.createElement)(tag, attrs); 30823 }), 30824 ...Array.isArray(children) ? children : [ 30825 children 30826 ] 30827 ]); 30828}); 30829 //# sourceMappingURL=Icon.js.map 30830 30831;// CONCATENATED MODULE: ./node_modules/lucide-react/dist/esm/createLucideIcon.js 30832/** 30833 * @license lucide-react v0.475.0 - ISC 30834 * 30835 * This source code is licensed under the ISC license. 30836 * See the LICENSE file in the root directory of this source tree. 30837 */ 30838 30839 30840const createLucideIcon = (iconName, iconNode)=>{ 30841 const Component = /*#__PURE__*/ (0,react.forwardRef)((param, ref)=>{ 30842 let { className, ...props } = param; 30843 return /*#__PURE__*/ (0,react.createElement)(Icon, { 30844 ref, 30845 iconNode, 30846 className: mergeClasses("lucide-".concat(toKebabCase(iconName)), className), 30847 ...props 30848 }); 30849 }); 30850 Component.displayName = "".concat(iconName); 30851 return Component; 30852}; 30853 //# sourceMappingURL=createLucideIcon.js.map 30854 30855 30856/***/ }), 30857 30858/***/ 6961: 30859/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30860 30861"use strict"; 30862/* harmony export */ __webpack_require__.d(__webpack_exports__, { 30863/* harmony export */ Z: function() { return /* binding */ Check; } 30864/* harmony export */ }); 30865/* unused harmony export __iconNode */ 30866/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 30867/** 30868 * @license lucide-react v0.475.0 - ISC 30869 * 30870 * This source code is licensed under the ISC license. 30871 * See the LICENSE file in the root directory of this source tree. 30872 */ 30873const __iconNode = [ 30874 [ 30875 "path", 30876 { 30877 d: "M20 6 9 17l-5-5", 30878 key: "1gmf2c" 30879 } 30880 ] 30881]; 30882const Check = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)("Check", __iconNode); 30883 //# sourceMappingURL=check.js.map 30884 30885 30886/***/ }), 30887 30888/***/ 4705: 30889/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30890 30891"use strict"; 30892/* harmony export */ __webpack_require__.d(__webpack_exports__, { 30893/* harmony export */ Z: function() { return /* binding */ ChevronDown; } 30894/* harmony export */ }); 30895/* unused harmony export __iconNode */ 30896/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 30897/** 30898 * @license lucide-react v0.475.0 - ISC 30899 * 30900 * This source code is licensed under the ISC license. 30901 * See the LICENSE file in the root directory of this source tree. 30902 */ 30903const __iconNode = [ 30904 [ 30905 "path", 30906 { 30907 d: "m6 9 6 6 6-6", 30908 key: "qrunsl" 30909 } 30910 ] 30911]; 30912const ChevronDown = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)("ChevronDown", __iconNode); 30913 //# sourceMappingURL=chevron-down.js.map 30914 30915 30916/***/ }), 30917 30918/***/ 4204: 30919/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30920 30921"use strict"; 30922/* harmony export */ __webpack_require__.d(__webpack_exports__, { 30923/* harmony export */ Z: function() { return /* binding */ ChevronLeft; } 30924/* harmony export */ }); 30925/* unused harmony export __iconNode */ 30926/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 30927/** 30928 * @license lucide-react v0.475.0 - ISC 30929 * 30930 * This source code is licensed under the ISC license. 30931 * See the LICENSE file in the root directory of this source tree. 30932 */ 30933const __iconNode = [ 30934 [ 30935 "path", 30936 { 30937 d: "m15 18-6-6 6-6", 30938 key: "1wnfg3" 30939 } 30940 ] 30941]; 30942const ChevronLeft = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)("ChevronLeft", __iconNode); 30943 //# sourceMappingURL=chevron-left.js.map 30944 30945 30946/***/ }), 30947 30948/***/ 2466: 30949/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30950 30951"use strict"; 30952/* harmony export */ __webpack_require__.d(__webpack_exports__, { 30953/* harmony export */ Z: function() { return /* binding */ ChevronRight; } 30954/* harmony export */ }); 30955/* unused harmony export __iconNode */ 30956/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 30957/** 30958 * @license lucide-react v0.475.0 - ISC 30959 * 30960 * This source code is licensed under the ISC license. 30961 * See the LICENSE file in the root directory of this source tree. 30962 */ 30963const __iconNode = [ 30964 [ 30965 "path", 30966 { 30967 d: "m9 18 6-6-6-6", 30968 key: "mthhwq" 30969 } 30970 ] 30971]; 30972const ChevronRight = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)("ChevronRight", __iconNode); 30973 //# sourceMappingURL=chevron-right.js.map 30974 30975 30976/***/ }), 30977 30978/***/ 9577: 30979/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 30980 30981"use strict"; 30982/* harmony export */ __webpack_require__.d(__webpack_exports__, { 30983/* harmony export */ Z: function() { return /* binding */ ChevronUp; } 30984/* harmony export */ }); 30985/* unused harmony export __iconNode */ 30986/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 30987/** 30988 * @license lucide-react v0.475.0 - ISC 30989 * 30990 * This source code is licensed under the ISC license. 30991 * See the LICENSE file in the root directory of this source tree. 30992 */ 30993const __iconNode = [ 30994 [ 30995 "path", 30996 { 30997 d: "m18 15-6-6-6 6", 30998 key: "153udz" 30999 } 31000 ] 31001]; 31002const ChevronUp = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)("ChevronUp", __iconNode); 31003 //# sourceMappingURL=chevron-up.js.map 31004 31005 31006/***/ }), 31007 31008/***/ 7072: 31009/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31010 31011"use strict"; 31012/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31013/* harmony export */ Z: function() { return /* binding */ Circle; } 31014/* harmony export */ }); 31015/* unused harmony export __iconNode */ 31016/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 31017/** 31018 * @license lucide-react v0.475.0 - ISC 31019 * 31020 * This source code is licensed under the ISC license. 31021 * See the LICENSE file in the root directory of this source tree. 31022 */ 31023const __iconNode = [ 31024 [ 31025 "circle", 31026 { 31027 cx: "12", 31028 cy: "12", 31029 r: "10", 31030 key: "1mglay" 31031 } 31032 ] 31033]; 31034const Circle = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)("Circle", __iconNode); 31035 //# sourceMappingURL=circle.js.map 31036 31037 31038/***/ }), 31039 31040/***/ 5837: 31041/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31042 31043"use strict"; 31044/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31045/* harmony export */ Z: function() { return /* binding */ Menu; } 31046/* harmony export */ }); 31047/* unused harmony export __iconNode */ 31048/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 31049/** 31050 * @license lucide-react v0.475.0 - ISC 31051 * 31052 * This source code is licensed under the ISC license. 31053 * See the LICENSE file in the root directory of this source tree. 31054 */ 31055const __iconNode = [ 31056 [ 31057 "line", 31058 { 31059 x1: "4", 31060 x2: "20", 31061 y1: "12", 31062 y2: "12", 31063 key: "1e0a9i" 31064 } 31065 ], 31066 [ 31067 "line", 31068 { 31069 x1: "4", 31070 x2: "20", 31071 y1: "6", 31072 y2: "6", 31073 key: "1owob3" 31074 } 31075 ], 31076 [ 31077 "line", 31078 { 31079 x1: "4", 31080 x2: "20", 31081 y1: "18", 31082 y2: "18", 31083 key: "yk5zj1" 31084 } 31085 ] 31086]; 31087const Menu = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)("Menu", __iconNode); 31088 //# sourceMappingURL=menu.js.map 31089 31090 31091/***/ }), 31092 31093/***/ 3075: 31094/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31095 31096"use strict"; 31097/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31098/* harmony export */ Z: function() { return /* binding */ Search; } 31099/* harmony export */ }); 31100/* unused harmony export __iconNode */ 31101/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 31102/** 31103 * @license lucide-react v0.475.0 - ISC 31104 * 31105 * This source code is licensed under the ISC license. 31106 * See the LICENSE file in the root directory of this source tree. 31107 */ 31108const __iconNode = [ 31109 [ 31110 "circle", 31111 { 31112 cx: "11", 31113 cy: "11", 31114 r: "8", 31115 key: "4ej97u" 31116 } 31117 ], 31118 [ 31119 "path", 31120 { 31121 d: "m21 21-4.3-4.3", 31122 key: "1qie3q" 31123 } 31124 ] 31125]; 31126const Search = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)("Search", __iconNode); 31127 //# sourceMappingURL=search.js.map 31128 31129 31130/***/ }), 31131 31132/***/ 5781: 31133/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31134 31135"use strict"; 31136/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31137/* harmony export */ Z: function() { return /* binding */ X; } 31138/* harmony export */ }); 31139/* unused harmony export __iconNode */ 31140/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1692); 31141/** 31142 * @license lucide-react v0.475.0 - ISC 31143 * 31144 * This source code is licensed under the ISC license. 31145 * See the LICENSE file in the root directory of this source tree. 31146 */ 31147const __iconNode = [ 31148 [ 31149 "path", 31150 { 31151 d: "M18 6 6 18", 31152 key: "1bl5f8" 31153 } 31154 ], 31155 [ 31156 "path", 31157 { 31158 d: "m6 6 12 12", 31159 key: "d8bk6v" 31160 } 31161 ] 31162]; 31163const X = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)("X", __iconNode); 31164 //# sourceMappingURL=x.js.map 31165 31166 31167/***/ }), 31168 31169/***/ 7796: 31170/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31171 31172"use strict"; 31173 31174// EXPORTS 31175__webpack_require__.d(__webpack_exports__, { 31176 w_: function() { return /* reexport */ GenIcon; } 31177}); 31178 31179// UNUSED EXPORTS: DefaultContext, IconBase, IconContext, IconsManifest 31180 31181;// CONCATENATED MODULE: ./node_modules/react-icons/lib/iconsManifest.mjs 31182var IconsManifest = [ 31183 { 31184 "id": "ci", 31185 "name": "Circum Icons", 31186 "projectUrl": "https://circumicons.com/", 31187 "license": "MPL-2.0 license", 31188 "licenseUrl": "https://github.com/Klarr-Agency/Circum-Icons/blob/main/LICENSE" 31189 }, 31190 { 31191 "id": "fa", 31192 "name": "Font Awesome 5", 31193 "projectUrl": "https://fontawesome.com/", 31194 "license": "CC BY 4.0 License", 31195 "licenseUrl": "https://creativecommons.org/licenses/by/4.0/" 31196 }, 31197 { 31198 "id": "fa6", 31199 "name": "Font Awesome 6", 31200 "projectUrl": "https://fontawesome.com/", 31201 "license": "CC BY 4.0 License", 31202 "licenseUrl": "https://creativecommons.org/licenses/by/4.0/" 31203 }, 31204 { 31205 "id": "io", 31206 "name": "Ionicons 4", 31207 "projectUrl": "https://ionicons.com/", 31208 "license": "MIT", 31209 "licenseUrl": "https://github.com/ionic-team/ionicons/blob/master/LICENSE" 31210 }, 31211 { 31212 "id": "io5", 31213 "name": "Ionicons 5", 31214 "projectUrl": "https://ionicons.com/", 31215 "license": "MIT", 31216 "licenseUrl": "https://github.com/ionic-team/ionicons/blob/master/LICENSE" 31217 }, 31218 { 31219 "id": "md", 31220 "name": "Material Design icons", 31221 "projectUrl": "http://google.github.io/material-design-icons/", 31222 "license": "Apache License Version 2.0", 31223 "licenseUrl": "https://github.com/google/material-design-icons/blob/master/LICENSE" 31224 }, 31225 { 31226 "id": "ti", 31227 "name": "Typicons", 31228 "projectUrl": "http://s-ings.com/typicons/", 31229 "license": "CC BY-SA 3.0", 31230 "licenseUrl": "https://creativecommons.org/licenses/by-sa/3.0/" 31231 }, 31232 { 31233 "id": "go", 31234 "name": "Github Octicons icons", 31235 "projectUrl": "https://octicons.github.com/", 31236 "license": "MIT", 31237 "licenseUrl": "https://github.com/primer/octicons/blob/master/LICENSE" 31238 }, 31239 { 31240 "id": "fi", 31241 "name": "Feather", 31242 "projectUrl": "https://feathericons.com/", 31243 "license": "MIT", 31244 "licenseUrl": "https://github.com/feathericons/feather/blob/master/LICENSE" 31245 }, 31246 { 31247 "id": "lu", 31248 "name": "Lucide", 31249 "projectUrl": "https://lucide.dev/", 31250 "license": "ISC", 31251 "licenseUrl": "https://github.com/lucide-icons/lucide/blob/main/LICENSE" 31252 }, 31253 { 31254 "id": "gi", 31255 "name": "Game Icons", 31256 "projectUrl": "https://game-icons.net/", 31257 "license": "CC BY 3.0", 31258 "licenseUrl": "https://creativecommons.org/licenses/by/3.0/" 31259 }, 31260 { 31261 "id": "wi", 31262 "name": "Weather Icons", 31263 "projectUrl": "https://erikflowers.github.io/weather-icons/", 31264 "license": "SIL OFL 1.1", 31265 "licenseUrl": "http://scripts.sil.org/OFL" 31266 }, 31267 { 31268 "id": "di", 31269 "name": "Devicons", 31270 "projectUrl": "https://vorillaz.github.io/devicons/", 31271 "license": "MIT", 31272 "licenseUrl": "https://opensource.org/licenses/MIT" 31273 }, 31274 { 31275 "id": "ai", 31276 "name": "Ant Design Icons", 31277 "projectUrl": "https://github.com/ant-design/ant-design-icons", 31278 "license": "MIT", 31279 "licenseUrl": "https://opensource.org/licenses/MIT" 31280 }, 31281 { 31282 "id": "bs", 31283 "name": "Bootstrap Icons", 31284 "projectUrl": "https://github.com/twbs/icons", 31285 "license": "MIT", 31286 "licenseUrl": "https://opensource.org/licenses/MIT" 31287 }, 31288 { 31289 "id": "ri", 31290 "name": "Remix Icon", 31291 "projectUrl": "https://github.com/Remix-Design/RemixIcon", 31292 "license": "Apache License Version 2.0", 31293 "licenseUrl": "http://www.apache.org/licenses/" 31294 }, 31295 { 31296 "id": "fc", 31297 "name": "Flat Color Icons", 31298 "projectUrl": "https://github.com/icons8/flat-color-icons", 31299 "license": "MIT", 31300 "licenseUrl": "https://opensource.org/licenses/MIT" 31301 }, 31302 { 31303 "id": "gr", 31304 "name": "Grommet-Icons", 31305 "projectUrl": "https://github.com/grommet/grommet-icons", 31306 "license": "Apache License Version 2.0", 31307 "licenseUrl": "http://www.apache.org/licenses/" 31308 }, 31309 { 31310 "id": "hi", 31311 "name": "Heroicons", 31312 "projectUrl": "https://github.com/tailwindlabs/heroicons", 31313 "license": "MIT", 31314 "licenseUrl": "https://opensource.org/licenses/MIT" 31315 }, 31316 { 31317 "id": "hi2", 31318 "name": "Heroicons 2", 31319 "projectUrl": "https://github.com/tailwindlabs/heroicons", 31320 "license": "MIT", 31321 "licenseUrl": "https://opensource.org/licenses/MIT" 31322 }, 31323 { 31324 "id": "si", 31325 "name": "Simple Icons", 31326 "projectUrl": "https://simpleicons.org/", 31327 "license": "CC0 1.0 Universal", 31328 "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/" 31329 }, 31330 { 31331 "id": "sl", 31332 "name": "Simple Line Icons", 31333 "projectUrl": "https://thesabbir.github.io/simple-line-icons/", 31334 "license": "MIT", 31335 "licenseUrl": "https://opensource.org/licenses/MIT" 31336 }, 31337 { 31338 "id": "im", 31339 "name": "IcoMoon Free", 31340 "projectUrl": "https://github.com/Keyamoon/IcoMoon-Free", 31341 "license": "CC BY 4.0 License", 31342 "licenseUrl": "https://github.
31342com/Keyamoon/IcoMoon-Free/blob/master/License.txt" 31343 }, 31344 { 31345 "id": "bi", 31346 "name": "BoxIcons", 31347 "projectUrl": "https://github.com/atisawd/boxicons", 31348 "license": "MIT", 31349 "licenseUrl": "https://github.com/atisawd/boxicons/blob/master/LICENSE" 31350 }, 31351 { 31352 "id": "cg", 31353 "name": "css.gg", 31354 "projectUrl": "https://github.com/astrit/css.gg", 31355 "license": "MIT", 31356 "licenseUrl": "https://opensource.org/licenses/MIT" 31357 }, 31358 { 31359 "id": "vsc", 31360 "name": "VS Code Icons", 31361 "projectUrl": "https://github.com/microsoft/vscode-codicons", 31362 "license": "CC BY 4.0", 31363 "licenseUrl": "https://creativecommons.org/licenses/by/4.0/" 31364 }, 31365 { 31366 "id": "tb", 31367 "name": "Tabler Icons", 31368 "projectUrl": "https://github.com/tabler/tabler-icons", 31369 "license": "MIT", 31370 "licenseUrl": "https://opensource.org/licenses/MIT" 31371 }, 31372 { 31373 "id": "tfi", 31374 "name": "Themify Icons", 31375 "projectUrl": "https://github.com/lykmapipo/themify-icons", 31376 "license": "MIT", 31377 "licenseUrl": "https://github.com/thecreation/standard-icons/blob/master/modules/themify-icons/LICENSE" 31378 }, 31379 { 31380 "id": "rx", 31381 "name": "Radix Icons", 31382 "projectUrl": "https://icons.radix-ui.com", 31383 "license": "MIT", 31384 "licenseUrl": "https://github.com/radix-ui/icons/blob/master/LICENSE" 31385 }, 31386 { 31387 "id": "pi", 31388 "name": "Phosphor Icons", 31389 "projectUrl": "https://github.com/phosphor-icons/core", 31390 "license": "MIT", 31391 "licenseUrl": "https://github.com/phosphor-icons/core/blob/main/LICENSE" 31392 }, 31393 { 31394 "id": "lia", 31395 "name": "Icons8 Line Awesome", 31396 "projectUrl": "https://icons8.com/line-awesome", 31397 "license": "MIT", 31398 "licenseUrl": "https://github.com/icons8/line-awesome/blob/master/LICENSE.md" 31399 } 31400]; 31401 31402// EXTERNAL MODULE: ./node_modules/react/index.js 31403var react = __webpack_require__(7294); 31404;// CONCATENATED MODULE: ./node_modules/react-icons/lib/iconContext.mjs 31405 31406var DefaultContext = { 31407 color: undefined, 31408 size: undefined, 31409 className: undefined, 31410 style: undefined, 31411 attr: undefined 31412}; 31413var IconContext = react.createContext && /*#__PURE__*/ react.createContext(DefaultContext); 31414 31415;// CONCATENATED MODULE: ./node_modules/react-icons/lib/iconBase.mjs 31416var _excluded = [ 31417 "attr", 31418 "size", 31419 "title" 31420]; 31421function _objectWithoutProperties(source, excluded) { 31422 if (source == null) return {}; 31423 var target = _objectWithoutPropertiesLoose(source, excluded); 31424 var key, i; 31425 if (Object.getOwnPropertySymbols) { 31426 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); 31427 for(i = 0; i < sourceSymbolKeys.length; i++){ 31428 key = sourceSymbolKeys[i]; 31429 if (excluded.indexOf(key) >= 0) continue; 31430 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; 31431 target[key] = source[key]; 31432 } 31433 } 31434 return target; 31435} 31436function _objectWithoutPropertiesLoose(source, excluded) { 31437 if (source == null) return {}; 31438 var target = {}; 31439 for(var key in source){ 31440 if (Object.prototype.hasOwnProperty.call(source, key)) { 31441 if (excluded.indexOf(key) >= 0) continue; 31442 target[key] = source[key]; 31443 } 31444 } 31445 return target; 31446} 31447function _extends() { 31448 _extends = Object.assign ? Object.assign.bind() : function(target) { 31449 for(var i = 1; i < arguments.length; i++){ 31450 var source = arguments[i]; 31451 for(var key in source){ 31452 if (Object.prototype.hasOwnProperty.call(source, key)) { 31453 target[key] = source[key]; 31454 } 31455 } 31456 } 31457 return target; 31458 }; 31459 return _extends.apply(this, arguments); 31460} 31461function ownKeys(e, r) { 31462 var t = Object.keys(e); 31463 if (Object.getOwnPropertySymbols) { 31464 var o = Object.getOwnPropertySymbols(e); 31465 r && (o = o.filter(function(r) { 31466 return Object.getOwnPropertyDescriptor(e, r).enumerable; 31467 })), t.push.apply(t, o); 31468 } 31469 return t; 31470} 31471function _objectSpread(e) { 31472 for(var r = 1; r < arguments.length; r++){ 31473 var t = null != arguments[r] ? arguments[r] : {};
31474 r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { 31475 _defineProperty(e, r, t[r]); 31476 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { 31477 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); 31478 }); 31479 } 31480 return e; 31481} 31482function _defineProperty(obj, key, value) { 31483 key = _toPropertyKey(key); 31484 if (key in obj) { 31485 Object.defineProperty(obj, key, { 31486 value: value, 31487 enumerable: true, 31488 configurable: true, 31489 writable: true 31490 }); 31491 } else { 31492 obj[key] = value; 31493 } 31494 return obj; 31495} 31496function _toPropertyKey(t) { 31497 var i = _toPrimitive(t, "string"); 31498 return "symbol" == typeof i ? i : i + ""; 31499} 31500function _toPrimitive(t, r) { 31501 if ("object" != typeof t || !t) return t; 31502 var e = t[Symbol.toPrimitive]; 31503 if (void 0 !== e) { 31504 var i = e.call(t, r || "default"); 31505 if ("object" != typeof i) return i; 31506 throw new TypeError("@@toPrimitive must return a primitive value."); 31507 } 31508 return ("string" === r ? String : Number)(t); 31509} 31510 31511 31512function Tree2Element(tree) { 31513 return tree && tree.map((node, i)=>/*#__PURE__*/ react.createElement(node.tag, _objectSpread({ 31514 key: i 31515 }, node.attr), Tree2Element(node.child))); 31516} 31517function GenIcon(data) { 31518 return (props)=>/*#__PURE__*/ react.createElement(IconBase, _extends({ 31519 attr: _objectSpread({}, data.attr) 31520 }, props), Tree2Element(data.child)); 31521} 31522function IconBase(props) { 31523 var elem = (conf)=>{ 31524 var { attr, size, title } = props, svgProps = _objectWithoutProperties(props, _excluded); 31525 var computedSize = size || conf.size || "1em"; 31526 var className; 31527 if (conf.className) className = conf.className; 31528 if (props.className) className = (className ? className + " " : "") + props.className; 31529 return /*#__PURE__*/ react.createElement("svg", _extends({ 31530 stroke: "currentColor", 31531 fill: "currentColor", 31532 strokeWidth: "0" 31533 }, conf.attr, attr, svgProps, { 31534 className: className, 31535 style: _objectSpread(_objectSpread({ 31536 color: props.color || conf.color 31537 }, conf.style), props.style), 31538 height: computedSize, 31539 width: computedSize, 31540 xmlns: "http://www.w3.org/2000/svg" 31541 }), title && /*#__PURE__*/ react.createElement("title", null, title), props.children); 31542 }; 31543 return IconContext !== undefined ? /*#__PURE__*/ react.createElement(IconContext.Consumer, null, (conf)=>elem(conf)) : elem(DefaultContext); 31544} 31545 31546;// CONCATENATED MODULE: ./node_modules/react-icons/lib/index.mjs 31547 31548 31549 31550 31551 31552/***/ }), 31553 31554/***/ 5678: 31555/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31556 31557"use strict"; 31558/* unused harmony exports Bounce, Flip, Icons, Slide, ToastContainer, Zoom, collapseToast, cssTransition, toast, useToast, useToastContainer */ 31559/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 31560'use client'; 31561const c=e=>"number"==typeof e&&!isNaN(e),d=e=>"string"==typeof e,u=e=>"function"==typeof e,p=e=>d(e)||u(e)?e:null,m=e=>(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(e)||d(e)||u(e)||c(e);function f(e,t,n){void 0===n&&(n=300);const{scrollHeight:o,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=o+"px",s.transition=`all ${n}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function g(t){let{enter:a,exit:r,appendPosition:i=!1,collapse:l=!0,collapseDuration:c=300}=t;return function(t){let{children:d,position:u,preventExitTransition:p,done:m,nodeRef:g,isIn:y,playToast:v}=t;const h=i?`${a}--${u}`:a,T=i?`${r}--${u}`:r,E=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(0);return (0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(()=>{const e=g.current,t=h.split(" "),n=o=>{o.target===g.current&&(v(),e.removeEventListener("animationend",n),e.removeEventListener("animationcancel",n),0===E.current&&"animationcancel"!==o.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",n),e.addEventListener("animationcancel",n)},[]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(()=>{const e=g.current,t=()=>{e.removeEventListener("animationend",t),l?f(e,m,c):m()};y||(p?t():(E.current=1,e.className+=` ${T}`,e.addEventListener("animationend",t)))},[y]),react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,d)}}function y(e,t){return null!=e?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const v=new Map;let h=[];const T=new Set,E=e=>T.forEach(t=>t(e)),b=()=>v.size>0;function I(e,t){var n;if(t)return!(null==(n=v.get(t))||!n.isToastActive(e));let o=!1;return v.forEach(t=>{t.isToastActive(e)&&(o=!0)}),o}function _(e,t){m(e)&&(b()||h.push({content:e,options:t}),v.forEach(n=>
31561{n.buildToast(e,t)}))}function C(e,t){v.forEach(n=>{null!=t&&null!=t&&t.containerId?(null==t?void 0:t.containerId)===n.id&&n.toggle(e,null==t?void 0:t.id):n.toggle(e,null==t?void 0:t.id)})}function L(e){const{subscribe:o,getSnapshot:s,setProps:i}=n(function(e){const n=e.containerId||1;return{subscribe(o){const s=function(e,n,o){let s=1,r=0,i=[],l=[],f=[],g=n;const v=new Map,h=new Set,T=()=>{f=Array.from(v.values()),h.forEach(e=>e())},E=e=>{l=null==e?[]:l.filter(t=>t!==e),T()},b=e=>{const{toastId:n,onOpen:s,updateId:a,children:r}=e.props,i=null==a;e.staleId&&v.delete(e.staleId),v.set(n,e),l=[...l,e.props.toastId].filter(t=>t!==e.staleId),T(),o(y(e,i?"added":"updated")),i&&u(s)&&s(t(r)&&r.props)};return{id:e,props:g,observe:e=>(h.add(e),()=>h.delete(e)),toggle:(e,t)=>{v.forEach(n=>{null!=t&&t!==n.props.toastId||u(n.toggle)&&n.toggle(e)})},removeToast:E,toasts:v,clearQueue:()=>{r-=i.length,i=[]},buildToast:(n,l)=>{if((t=>{let{containerId:n,toastId:o,updateId:s}=t;const a=n?n!==e:1!==e,r=v.has(o)&&null==s;return a||r})(l))return;const{toastId:f,updateId:h,data:I,staleId:_,delay:C}=l,L=()=>{E(f)},N=null==h;N&&r++;const $={...g,style:g.toastStyle,key:s++,...Object.fromEntries(Object.entries(l).filter(e=>{let[t,n]=e;return null!=n})),toastId:f,updateId:h,data:I,closeToast:L,isIn:!1,className:p(l.className||g.toastClassName),bodyClassName:p(l.bodyClassName||g.bodyClassName),progressClassName:p(l.progressClassName||g.progressClassName),autoClose:!l.isLoading&&(w=l.autoClose,k=g.autoClose,!1===w||c(w)&&w>0?w:k),deleteToast(){const e=v.get(f),{onClose:n,children:s}=e.props;u(n)&&n(t(s)&&s.props),o(y(e,"removed")),v.delete(f),r--,r<0&&(r=0),i.length>0?b(i.shift()):T()}};var w,k;$.closeButton=g.closeButton,!1===l.closeButton||m(l.closeButton)?$.closeButton=l.closeButton:!0===l.closeButton&&($.closeButton=!m(g.closeButton)||g.closeButton);let P=n;t(n)&&!d(n.type)?P=a(n,{closeToast:L,toastProps:$,data:I}):u(n)&&(P=n({closeToast:L,toastProps:$,data:I}));const M={content:P,props:$,staleId:_};g.limit&&g.limit>0&&r>g.limit&&N?i.push(M):c(C)?setTimeout(()=>{b(M)},C):b(M)},setProps(e){g=e},setToggle:(e,t)=>{v.get(e).toggle=t},isToastActive:e=>l.some(t=>t===e),getSnapshot:()=>f}}(n,e,E);v.set(n,s);const r=s.observe(o);return h.forEach(e=>_(e.content,e.options)),h=[],()=>{r(),v.delete(n)}},setProps(e){var t;null==(t=v.get(n))||t.setProps(e)},getSnapshot(){var e;return null==(e=v.get(n))?void 0:e.getSnapshot()}}}(e)).current;i(e);const l=r(o,s,s);return{getToastToRender:function(t){if(!l)return[];const n=new Map;return e.newestOnTop&&l.reverse(),l.forEach(e=>{const{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,e=>t(e[0],e[1]))},isToastActive:I,count:null==l?void 0:l.length}}function N(e){const[t,o]=i(!1),[a,r]=i(!1),l=n(null),c=n({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:d,pauseOnHover:u,closeToast:p,onClick:m,closeOnClick:f}=e;var g,y;function h(){o(!0)}function T(){o(!1)}function E(n){const o=l.current;c.canDrag&&o&&(c.didMove=!0,t&&T(),c.delta="x"===e.draggableDirection?n.clientX-c.start:n.clientY-c.start,c.start!==n.clientX&&(c.canCloseOnClick=!1),o.style.transform=`translate3d(${"x"===e.draggableDirection?`${c.delta}px, var(--y)`:`0, calc(${c.delta}px + var(--y))`},0)`,o.style.opacity=""+(1-Math.abs(c.delta/c.removalDistance)))}function b(){document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",b);const t=l.current;if(c.canDrag&&c.didMove&&t){if(c.canDrag=!1,Math.abs(c.delta)>c.removalDistance)return r(!0),e.closeToast(),void e.collapseAll();t.style.transition="transform 0.2s, opacity 0.2s",t.style.removeProperty("transform"),t.style.removeProperty("opacity")}}null==(y=v.get((g={id:e.toastId,containerId:e.containerId,fn:o}).containerId||1))||y.setToggle(g.id,g.fn),s(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||T(),window.addEventListener("focus",h),window.addEventListener("blur",T),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",T)}},[e.pauseOnFocusLoss]);const I={onPointerDown:function(t){if(!0===e.draggable||e.draggable===t.pointerType){c.didMove=!1,document.addEventListener("pointermove",E),document.addEventListener("pointerup",b);const n=l.current;c.canCloseOnClick=!0,c.canDrag=!0,n.style.transition="none","x"===e.draggableDirection?(c.start=t.clientX,c.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(c.start=t.clientY,c.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent)/100)}}
31561,onPointerUp:function(t){const{top:n,bottom:o,left:s,right:a}=l.current.getBoundingClientRect();"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&t.clientX>=s&&t.clientX<=a&&t.clientY>=n&&t.clientY<=o?T():h()}};return d&&u&&(I.onMouseEnter=T,e.stacked||(I.onMouseLeave=h)),f&&(I.onClick=e=>{m&&m(e),c.canCloseOnClick&&p()}),{playToast:h,pauseToast:T,isRunning:t,preventExitTransition:a,toastRef:l,eventHandlers:I}}function $(t){let{delay:n,isRunning:o,closeToast:s,type:a="default",hide:r,className:i,style:c,controlledProgress:d,progress:p,rtl:m,isIn:f,theme:g}=t;const y=r||d&&0===p,v={...c,animationDuration:`${n}ms`,animationPlayState:o?"running":"paused"};d&&(v.transform=`scaleX(${p})`);const h=l("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${a}`,{"Toastify__progress-bar--rtl":m}),T=u(i)?i({rtl:m,type:a,defaultClassName:h}):l(h,i),E={[d&&p>=1?"onTransitionEnd":"onAnimationEnd"]:d&&p<1?null:()=>{f&&s()}};return e.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":y},e.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${a}`}),e.createElement("div",{role:"progressbar","aria-hidden":y?"true":"false","aria-label":"notification timer",className:T,style:v,...E}))}let w=1;const k=()=>""+w++;function P(e){return e&&(d(e.toastId)||c(e.toastId))?e.toastId:k()}function M(e,t){return _(e,t),t.toastId}function x(e,t){return{...t,type:t&&t.type||e,toastId:P(t)}}function A(e){return(t,n)=>M(t,x(e,n))}function B(e,t){return M(e,x("default",t))}B.loading=(e,t)=>
31561M(e,x("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),B.promise=function(e,t,n){let o,{pending:s,error:a,success:r}=t;s&&(o=d(s)?B.loading(s,n):B.loading(s.render,{...n,...s}));const i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(e,t,s)=>{if(null==t)return void B.dismiss(o);const a={type:e,...i,...n,data:s},r=d(t)?{render:t}:t;return o?B.update(o,{...a,...r}):B(r.render,{...a,...r}),s},c=u(e)?e():e;return c.then(e=>l("success",r,e)).catch(e=>l("error",a,e)),c},B.success=A("success"),B.info=A("info"),B.error=A("error"),B.warning=A("warning"),B.warn=B.warning,B.dark=(e,t)=>M(e,x("default",{theme:"dark",...t})),B.dismiss=function(e){!function(e){var t;if(b()){if(null==e||d(t=e)||c(t))v.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const t=v.get(e.containerId);t?t.removeToast(e.id):v.forEach(t=>{t.removeToast(e.id)})}}else h=h.filter(t=>null!=e&&t.options.toastId!==e)}(e)},B.clearWaitingQueue=function(e){void 0===e&&(e={}),v.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},B.isActive=I,B.update=function(e,t){void 0===t&&(t={});const n=((e,t)=>{var n;let{containerId:o}=t;return null==(n=v.get(o||1))?void 0:n.toasts.get(e)})(e,t);if(n){const{props:o,content:s}=n,a={delay:100,...o,...t,toastId:t.toastId||e,updateId:k()};a.toastId!==e&&(a.staleId=e);const r=a.render||s;delete a.render,M(r,a)}},B.done=e=>{B.update(e,{progress:1})},B.onChange=function(e){return T.add(e),()=>{T.delete(e)}},B.play=e=>C(!0,e),B.pause=e=>C(!1,e);const O="undefined"!=typeof window?react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect:react__WEBPACK_IMPORTED_MODULE_0__.useEffect,D=t=>{let{theme:n,type:o,isLoading:s,...a}=t;return react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===n?"currentColor":`var(--toastify-icon-color-${o})`,...a})},z={info:function(t){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(D,{...t},react__WEBPACK_IMPORTED_MODULE_0__.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(D,{...t},react__WEBPACK_IMPORTED_MODULE_0__.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(D,{...t},react__WEBPACK_IMPORTED_MODULE_0__.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(D,{...t},react__WEBPACK_IMPORTED_MODULE_0__.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div",{className:"Toastify__spinner"})}},R=n=>{const{isRunning:o,preventExitTransition:s,toastRef:r,eventHandlers:i,playToast:c}=N(n),{closeButton:d,children:p,autoClose:m,onClick:f,type:g,hideProgressBar:y,closeToast:v,transition:h,position:T,className:E,style:b,bodyClassName:I,bodyStyle:_,progressClassName:C,progressStyle:L,updateId:w,role:k,progress:P,rtl:M,toastId:x,deleteToast:A,isIn:B,isLoading:O,closeOnClick:D,theme:R}=n,S=l("Toastify__toast",`Toastify__toast-theme--${R}`,`Toastify__toast--${g}`,{"Toastify__toast--rtl":M},{"Toastify__toast--close-on-click":D}),H=u(E)?E({rtl:M,position:T,type:g,defaultClassName:S}):l(S,E),F=function(e){let{theme:n,type:o,isLoading:s,icon:r}=e,i=null;const l={theme:n,type:o};return!1===r||(u(r)?i=r({...l,isLoading:s}):t(r)?i=a(r,l):s?i=z.spinner():(e=>
31561e in z)(o)&&(i=z[o](l))),i}(n),X=!!P||!m,Y={closeToast:v,type:g,theme:R};let q=null;return!1===d||(q=u(d)?d(Y):t(d)?a(d,Y):function(t){let{closeToast:n,theme:o,ariaLabel:s="close"}=t;return e.createElement("button",{className:`Toastify__close-button Toastify__close-button--${o}`,type:"button",onClick:e=>{e.stopPropagation(),n(e)},"aria-label":s},e.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},e.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(Y)),e.createElement(h,{isIn:B,done:A,position:T,preventExitTransition:s,nodeRef:r,playToast:c},e.createElement("div",{id:x,onClick:f,"data-in":B,className:H,...i,style:b,ref:r},e.createElement("div",{...B&&{role:k},className:u(I)?I({type:g}):l("Toastify__toast-body",I),style:_},null!=F&&e.createElement("div",{className:l("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!O})},F),e.createElement("div",null,p)),q,e.createElement($,{...w&&!X?{key:`pb-${w}`}:{},rtl:M,theme:R,delay:m,isRunning:o,isIn:B,closeToast:v,hide:y,type:g,style:L,className:C,controlledProgress:X,progress:P||0})))}
31561,S=function(e,t){return void 0===t&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},H=g(S("bounce",!0)),F=g(S("slide",!0)),X=g(S("zoom")),Y=g(S("flip")),q={position:"top-right",transition:H,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Q(t){let o={...q,...t};const s=t.stacked,[a,r]=i(!0),c=n(null),{getToastToRender:d,isToastActive:m,count:f}=L(o),{className:g,style:y,rtl:v,containerId:h}=o;function T(e){const t=l("Toastify__toast-container",`Toastify__toast-container--${e}`,{"Toastify__toast-container--rtl":v});return u(g)?g({position:e,rtl:v,defaultClassName:t}):l(t,p(g))}function E(){s&&(r(!0),B.play())}return O(()=>{if(s){var e;const t=c.current.querySelectorAll('[data-in="true"]'),n=12,s=null==(e=o.position)?void 0:e.includes("top");let r=0,i=0;Array.from(t).reverse().forEach((e,t)=>{const o=e;o.classList.add("Toastify__toast--stacked"),t>0&&(o.dataset.collapsed=`${a}`),o.dataset.pos||(o.dataset.pos=s?"top":"bot");const l=r*(a?.2:1)+(a?0:n*t);o.style.setProperty("--y",`${s?l:-1*l}px`),o.style.setProperty("--g",`${n}`),o.style.setProperty("--s",""+(1-(a?i:0))),r+=o.offsetHeight,i+=.025})}},[a,f,s]),e.createElement("div",{ref:c,className:"Toastify",id:h,onMouseEnter:()=>{s&&(r(!1),B.pause())},onMouseLeave:E},d((t,n)=>{const o=n.length?{...y}:{...y,pointerEvents:"none"};return e.createElement("div",{className:T(t),style:o,key:`container-${t}`},n.map(t=>{let{content:n,props:o}=t;return e.createElement(R,{...o,stacked:s,collapseAll:E,isIn:m(o.toastId,o.containerId),style:o.style,key:`toast-${o.key}`},n)}))}))} 31562//# sourceMappingURL=react-toastify.esm.mjs.map 31563 31564 31565/***/ }), 31566 31567/***/ 8388: 31568/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 31569 31570"use strict"; 31571/* harmony export */ __webpack_require__.d(__webpack_exports__, { 31572/* harmony export */ m6: function() { return /* binding */ twMerge; } 31573/* harmony export */ }); 31574/* unused harmony exports createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, validators */ 31575const CLASS_PART_SEPARATOR = '-'; 31576const createClassGroupUtils = config => { 31577 const classMap = createClassMap(config); 31578 const { 31579 conflictingClassGroups, 31580 conflictingClassGroupModifiers 31581 } = config; 31582 const getClassGroupId = className => { 31583 const classParts = className.split(CLASS_PART_SEPARATOR); 31584 // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts. 31585 if (classParts[0] === '' && classParts.length !== 1) { 31586 classParts.shift(); 31587 } 31588 return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className); 31589 }; 31590 const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => { 31591 const conflicts = conflictingClassGroups[classGroupId] || []; 31592 if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) { 31593 return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]]; 31594 } 31595 return conflicts; 31596 }; 31597 return { 31598 getClassGroupId, 31599 getConflictingClassGroupIds 31600 }; 31601}; 31602const getGroupRecursive = (classParts, classPartObject) => { 31603 if (classParts.length === 0) { 31604 return classPartObject.classGroupId; 31605 } 31606 const currentClassPart = classParts[0]; 31607 const nextClassPartObject = classPartObject.nextPart.get(currentClassPart); 31608 const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined; 31609 if (classGroupFromNextClassPart) { 31610 return classGroupFromNextClassPart; 31611 } 31612 if (classPartObject.validators.length === 0) { 31613 return undefined; 31614 } 31615 const classRest = classParts.join(CLASS_PART_SEPARATOR); 31616 return classPartObject.validators.find(({ 31617 validator 31618 }) => validator(classRest))?.classGroupId; 31619}; 31620const arbitraryPropertyRegex = /^\[(.+)\]$/; 31621const getGroupIdForArbitraryProperty = className => {
vendor: 36,073 bytes, lines 31622-32734
31622 if (arbitraryPropertyRegex.test(className)) { 31623 const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1]; 31624 const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':')); 31625 if (property) { 31626 // I use two dots here because one dot is used as prefix for class groups in plugins 31627 return 'arbitrary..' + property; 31628 } 31629 } 31630}; 31631/** 31632 * Exported for testing only 31633 */ 31634const createClassMap = config => { 31635 const { 31636 theme, 31637 classGroups 31638 } = config; 31639 const classMap = { 31640 nextPart: new Map(), 31641 validators: [] 31642 }; 31643 for (const classGroupId in classGroups) { 31644 processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme); 31645 } 31646 return classMap; 31647}; 31648const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => { 31649 classGroup.forEach(classDefinition => { 31650 if (typeof classDefinition === 'string') { 31651 const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition); 31652 classPartObjectToEdit.classGroupId = classGroupId; 31653 return; 31654 } 31655 if (typeof classDefinition === 'function') { 31656 if (isThemeGetter(classDefinition)) { 31657 processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme); 31658 return; 31659 } 31660 classPartObject.validators.push({ 31661 validator: classDefinition, 31662 classGroupId 31663 }); 31664 return; 31665 } 31666 Object.entries(classDefinition).forEach(([key, classGroup]) => { 31667 processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme); 31668 }); 31669 }); 31670}; 31671const getPart = (classPartObject, path) => { 31672 let currentClassPartObject = classPartObject; 31673 path.split(CLASS_PART_SEPARATOR).forEach(pathPart => { 31674 if (!currentClassPartObject.nextPart.has(pathPart)) { 31675 currentClassPartObject.nextPart.set(pathPart, { 31676 nextPart: new Map(), 31677 validators: [] 31678 }); 31679 } 31680 currentClassPartObject = currentClassPartObject.nextPart.get(pathPart); 31681 }); 31682 return currentClassPartObject; 31683}; 31684const isThemeGetter = func => func.isThemeGetter; 31685 31686// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance 31687const createLruCache = maxCacheSize => { 31688 if (maxCacheSize < 1) { 31689 return { 31690 get: () => undefined, 31691 set: () => {} 31692 }; 31693 } 31694 let cacheSize = 0; 31695 let cache = new Map(); 31696 let previousCache = new Map(); 31697 const update = (key, value) => { 31698 cache.set(key, value); 31699 cacheSize++; 31700 if (cacheSize > maxCacheSize) { 31701 cacheSize = 0; 31702 previousCache = cache; 31703 cache = new Map(); 31704 } 31705 }; 31706 return { 31707 get(key) { 31708 let value = cache.get(key); 31709 if (value !== undefined) { 31710 return value; 31711 } 31712 if ((value = previousCache.get(key)) !== undefined) { 31713 update(key, value); 31714 return value; 31715 } 31716 }, 31717 set(key, value) { 31718 if (cache.has(key)) { 31719 cache.set(key, value); 31720 } else { 31721 update(key, value); 31722 } 31723 } 31724 }; 31725}; 31726const IMPORTANT_MODIFIER = '!'; 31727const MODIFIER_SEPARATOR = ':'; 31728const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length; 31729const createParseClassName = config => { 31730 const { 31731 prefix, 31732 experimentalParseClassName 31733 } = config; 31734 /** 31735 * Parse class name into parts. 31736 * 31737 * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS 31738 * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js 31739 */ 31740 let parseClassName = className => { 31741 const modifiers = []; 31742 let bracketDepth = 0; 31743 let parenDepth = 0; 31744 let modifierStart = 0; 31745 let postfixModifierPosition; 31746 for (let index = 0; index < className.length; index++) { 31747 let currentCharacter = className[index]; 31748 if (bracketDepth === 0 && parenDepth === 0) { 31749 if (currentCharacter === MODIFIER_SEPARATOR) { 31750 modifiers.push(className.slice(modifierStart, index)); 31751 modifierStart = index + MODIFIER_SEPARATOR_LENGTH; 31752 continue; 31753 } 31754 if (currentCharacter === '/') { 31755 postfixModifierPosition = index; 31756 continue; 31757 } 31758 } 31759 if (currentCharacter === '[') { 31760 bracketDepth++; 31761 } else if (currentCharacter === ']') { 31762 bracketDepth--; 31763 } else if (currentCharacter === '(') { 31764 parenDepth++; 31765 } else if (currentCharacter === ')') { 31766 parenDepth--; 31767 } 31768 } 31769 const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart); 31770 const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier); 31771 const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier; 31772 const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined; 31773 return { 31774 modifiers, 31775 hasImportantModifier, 31776 baseClassName, 31777 maybePostfixModifierPosition 31778 }; 31779 }; 31780 if (prefix) { 31781 const fullPrefix = prefix + MODIFIER_SEPARATOR; 31782 const parseClassNameOriginal = parseClassName; 31783 parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : { 31784 isExternal: true, 31785 modifiers: [], 31786 hasImportantModifier: false, 31787 baseClassName: className, 31788 maybePostfixModifierPosition: undefined 31789 }; 31790 } 31791 if (experimentalParseClassName) { 31792 const parseClassNameOriginal = parseClassName; 31793 parseClassName = className => experimentalParseClassName({ 31794 className, 31795 parseClassName: parseClassNameOriginal 31796 }); 31797 } 31798 return parseClassName; 31799}; 31800const stripImportantModifier = baseClassName => { 31801 if (baseClassName.endsWith(IMPORTANT_MODIFIER)) { 31802 return baseClassName.substring(0, baseClassName.length - 1); 31803 } 31804 /** 31805 * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons. 31806 * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864 31807 */ 31808 if (baseClassName.startsWith(IMPORTANT_MODIFIER)) { 31809 return baseClassName.substring(1); 31810 } 31811 return baseClassName; 31812}; 31813 31814/** 31815 * Sorts modifiers according to following schema: 31816 * - Predefined modifiers are sorted alphabetically 31817 * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it 31818 */ 31819const createSortModifiers = config => { 31820 const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map(modifier => [modifier, true])); 31821 const sortModifiers = modifiers => { 31822 if (modifiers.length <= 1) { 31823 return modifiers; 31824 } 31825 const sortedModifiers = []; 31826 let unsortedModifiers = []; 31827 modifiers.forEach(modifier => { 31828 const isPositionSensitive = modifier[0] === '[' || orderSensitiveModifiers[modifier]; 31829 if (isPositionSensitive) { 31830 sortedModifiers.push(...unsortedModifiers.sort(), modifier); 31831 unsortedModifiers = []; 31832 } else { 31833 unsortedModifiers.push(modifier); 31834 } 31835 }); 31836 sortedModifiers.push(...unsortedModifiers.sort()); 31837 return sortedModifiers; 31838 }; 31839 return sortModifiers; 31840}; 31841const createConfigUtils = config => ({ 31842 cache: createLruCache(config.cacheSize), 31843 parseClassName: createParseClassName(config), 31844 sortModifiers: createSortModifiers(config), 31845 ...createClassGroupUtils(config) 31846}); 31847const SPLIT_CLASSES_REGEX = /\s+/; 31848const mergeClassList = (classList, configUtils) => { 31849 const { 31850 parseClassName, 31851 getClassGroupId, 31852 getConflictingClassGroupIds, 31853 sortModifiers 31854 } = configUtils; 31855 /** 31856 * Set of classGroupIds in following format: 31857 * `{importantModifier}{variantModifiers}{classGroupId}` 31858 * @example 'float' 31859 * @example 'hover:focus:bg-color' 31860 * @example 'md:!pr' 31861 */ 31862 const classGroupsInConflict = []; 31863 const classNames = classList.trim().split(SPLIT_CLASSES_REGEX); 31864 let result = ''; 31865 for (let index = classNames.length - 1; index >= 0; index -= 1) { 31866 const originalClassName = classNames[index]; 31867 const { 31868 isExternal, 31869 modifiers, 31870 hasImportantModifier, 31871 baseClassName, 31872 maybePostfixModifierPosition 31873 } = parseClassName(originalClassName); 31874 if (isExternal) { 31875 result = originalClassName + (result.length > 0 ? ' ' + result : result); 31876 continue; 31877 } 31878 let hasPostfixModifier = !!maybePostfixModifierPosition; 31879 let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName); 31880 if (!classGroupId) { 31881 if (!hasPostfixModifier) { 31882 // Not a Tailwind class 31883 result = originalClassName + (result.length > 0 ? ' ' + result : result); 31884 continue; 31885 } 31886 classGroupId = getClassGroupId(baseClassName); 31887 if (!classGroupId) { 31888 // Not a Tailwind class 31889 result = originalClassName + (result.length > 0 ? ' ' + result : result); 31890 continue; 31891 } 31892 hasPostfixModifier = false; 31893 } 31894 const variantModifier = sortModifiers(modifiers).join(':'); 31895 const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier; 31896 const classId = modifierId + classGroupId; 31897 if (classGroupsInConflict.includes(classId)) { 31898 // Tailwind class omitted due to conflict 31899 continue; 31900 } 31901 classGroupsInConflict.push(classId); 31902 const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier); 31903 for (let i = 0; i < conflictGroups.length; ++i) { 31904 const group = conflictGroups[i]; 31905 classGroupsInConflict.push(modifierId + group); 31906 } 31907 // Tailwind class not in conflict 31908 result = originalClassName + (result.length > 0 ? ' ' + result : result); 31909 } 31910 return result; 31911}; 31912 31913/** 31914 * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better. 31915 * 31916 * Specifically: 31917 * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js 31918 * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts 31919 * 31920 * Original code has MIT license: Copyright (c) Luke Edwards <[email protected]> (lukeed.com) 31921 */ 31922function twJoin() { 31923 let index = 0; 31924 let argument; 31925 let resolvedValue; 31926 let string = ''; 31927 while (index < arguments.length) { 31928 if (argument = arguments[index++]) { 31929 if (resolvedValue = toValue(argument)) { 31930 string && (string += ' '); 31931 string += resolvedValue; 31932 } 31933 } 31934 } 31935 return string; 31936} 31937const toValue = mix => { 31938 if (typeof mix === 'string') { 31939 return mix; 31940 } 31941 let resolvedValue; 31942 let string = ''; 31943 for (let k = 0; k < mix.length; k++) { 31944 if (mix[k]) { 31945 if (resolvedValue = toValue(mix[k])) { 31946 string && (string += ' '); 31947 string += resolvedValue; 31948 } 31949 } 31950 } 31951 return string; 31952}; 31953function createTailwindMerge(createConfigFirst, ...createConfigRest) { 31954 let configUtils; 31955 let cacheGet; 31956 let cacheSet; 31957 let functionToCall = initTailwindMerge; 31958 function initTailwindMerge(classList) { 31959 const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()); 31960 configUtils = createConfigUtils(config); 31961 cacheGet = configUtils.cache.get; 31962 cacheSet = configUtils.cache.set; 31963 functionToCall = tailwindMerge; 31964 return tailwindMerge(classList); 31965 } 31966 function tailwindMerge(classList) { 31967 const cachedResult = cacheGet(classList); 31968 if (cachedResult) { 31969 return cachedResult; 31970 } 31971 const result = mergeClassList(classList, configUtils); 31972 cacheSet(classList, result); 31973 return result; 31974 } 31975 return function callTailwindMerge() { 31976 return functionToCall(twJoin.apply(null, arguments)); 31977 }; 31978} 31979const fromTheme = key => { 31980 const themeGetter = theme => theme[key] || []; 31981 themeGetter.isThemeGetter = true; 31982 return themeGetter; 31983}; 31984const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i; 31985const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i; 31986const fractionRegex = /^\d+\/\d+$/; 31987const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/; 31988const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/; 31989const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/; 31990// Shadow always begins with x and y offset separated by underscore optionally prepended by inset 31991const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/; 31992const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/; 31993const isFraction = value => fractionRegex.test(value); 31994const isNumber = value => Boolean(value) && !Number.isNaN(Number(value)); 31995const isInteger = value => Boolean(value) && Number.isInteger(Number(value)); 31996const isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1)); 31997const isTshirtSize = value => tshirtUnitRegex.test(value); 31998const isAny = () => true; 31999const isLengthOnly = value => 32000// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths. 32001// For example, `hsl(0 0% 0%)` would be classified as a length without this check. 32002// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough. 32003lengthUnitRegex.test(value) && !colorFunctionRegex.test(value); 32004const isNever = () => false; 32005const isShadow = value => shadowRegex.test(value); 32006const isImage = value => imageRegex.test(value); 32007const isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value); 32008const isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever); 32009const isArbitraryValue = value => arbitraryValueRegex.test(value); 32010const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly); 32011const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber); 32012const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever); 32013const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage); 32014const isArbitraryShadow = value => getIsArbitraryValue(value, isNever, isShadow); 32015const isArbitraryVariable = value => arbitraryVariableRegex.test(value); 32016const isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength); 32017const isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName); 32018const isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition); 32019const isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize); 32020const isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage); 32021const isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true); 32022// Helpers 32023const getIsArbitraryValue = (value, testLabel, testValue) => { 32024 const result = arbitraryValueRegex.exec(value); 32025 if (result) { 32026 if (result[1]) { 32027 return testLabel(result[1]); 32028 } 32029 return testValue(result[2]); 32030 } 32031 return false; 32032}; 32033const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => { 32034 const result = arbitraryVariableRegex.exec(value); 32035 if (result) { 32036 if (result[1]) { 32037 return testLabel(result[1]); 32038 } 32039 return shouldMatchNoLabel; 32040 } 32041 return false; 32042}; 32043// Labels 32044const isLabelPosition = label => label === 'position'; 32045const imageLabels = /*#__PURE__*/new Set(['image', 'url']); 32046const isLabelImage = label => imageLabels.has(label); 32047const sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']); 32048const isLabelSize = label => sizeLabels.has(label); 32049const isLabelLength = label => label === 'length'; 32050const isLabelNumber = label => label === 'number'; 32051const isLabelFamilyName = label => label === 'family-name'; 32052const isLabelShadow = label => label === 'shadow'; 32053const validators = /*#__PURE__*/Object.defineProperty({ 32054 __proto__: null, 32055 isAny, 32056 isAnyNonArbitrary, 32057 isArbitraryImage, 32058 isArbitraryLength, 32059 isArbitraryNumber, 32060 isArbitraryPosition, 32061 isArbitraryShadow, 32062 isArbitrarySize, 32063 isArbitraryValue, 32064 isArbitraryVariable, 32065 isArbitraryVariableFamilyName, 32066 isArbitraryVariableImage, 32067 isArbitraryVariableLength, 32068 isArbitraryVariablePosition, 32069 isArbitraryVariableShadow, 32070 isArbitraryVariableSize, 32071 isFraction, 32072 isInteger, 32073 isNumber, 32074 isPercent, 32075 isTshirtSize 32076}, Symbol.toStringTag, { 32077 value: 'Module' 32078}); 32079const getDefaultConfig = () => { 32080 /** 32081 * Theme getters for theme variable namespaces 32082 * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces 32083 */ 32084 /***/ 32085 const themeColor = fromTheme('color'); 32086 const themeFont = fromTheme('font'); 32087 const themeText = fromTheme('text'); 32088 const themeFontWeight = fromTheme('font-weight'); 32089 const themeTracking = fromTheme('tracking'); 32090 const themeLeading = fromTheme('leading'); 32091 const themeBreakpoint = fromTheme('breakpoint'); 32092 const themeContainer = fromTheme('container'); 32093 const themeSpacing = fromTheme('spacing'); 32094 const themeRadius = fromTheme('radius'); 32095 const themeShadow = fromTheme('shadow'); 32096 const themeInsetShadow = fromTheme('inset-shadow'); 32097 const themeDropShadow = fromTheme('drop-shadow'); 32098 const themeBlur = fromTheme('blur'); 32099 const themePerspective = fromTheme('perspective'); 32100 const themeAspect = fromTheme('aspect'); 32101 const themeEase = fromTheme('ease'); 32102 const themeAnimate = fromTheme('animate'); 32103 /** 32104 * Helpers to avoid repeating the same scales 32105 * 32106 * We use functions that create a new array every time they're called instead of static arrays. 32107 * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config. 32108 */ 32109 /***/ 32110 const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column']; 32111 const scalePosition = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top']; 32112 const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll']; 32113 const scaleOverscroll = () => ['auto', 'contain', 'none']; 32114 const scaleInset = () => [isFraction, 'px', 'full', 'auto', isArbitraryVariable, isArbitraryValue, themeSpacing]; 32115 const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue]; 32116 const scaleGridColRowStartAndEnd = () => ['auto', { 32117 span: ['full', isInteger, isArbitraryVariable, isArbitraryValue] 32118 }, isArbitraryVariable, isArbitraryValue]; 32119 const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]; 32120 const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue]; 32121 const scaleGap = () => [isArbitraryVariable, isArbitraryValue, themeSpacing]; 32122 const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline']; 32123 const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch']; 32124 const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing]; 32125 const scalePadding = () => ['px', ...scaleUnambiguousSpacing()]; 32126 const scaleMargin = () => ['px', 'auto', ...scaleUnambiguousSpacing()]; 32127 const scaleSizing = () => [isFraction, 'auto', 'px', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', isArbitraryVariable, isArbitraryValue, themeSpacing]; 32128 const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue]; 32129 const scaleGradientStopPosition = () => [isPercent, isArbitraryLength]; 32130 const scaleRadius = () => [ 32131 // Deprecated since Tailwind CSS v4.0.0 32132 '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue]; 32133 const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength]; 32134 const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double']; 32135 const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity']; 32136 const scaleBlur = () => [ 32137 // Deprecated since Tailwind CSS v4.0.0 32138 '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue]; 32139 const scaleOrigin = () => ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryVariable, isArbitraryValue]; 32140 const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue]; 32141 const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue]; 32142 const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue]; 32143 const scaleTranslate = () => [isFraction, 'full', 'px', isArbitraryVariable, isArbitraryValue, themeSpacing]; 32144 return { 32145 cacheSize: 500, 32146 theme: { 32147 animate: ['spin', 'ping', 'pulse', 'bounce'], 32148 aspect: ['video'], 32149 blur: [isTshirtSize], 32150 breakpoint: [isTshirtSize], 32151 color: [isAny], 32152 container: [isTshirtSize], 32153 'drop-shadow': [isTshirtSize], 32154 ease: ['in', 'out', 'in-out'], 32155 font: [isAnyNonArbitrary], 32156 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'], 32157 'inset-shadow': [isTshirtSize], 32158 leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'], 32159 perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'], 32160 radius: [isTshirtSize], 32161 shadow: [isTshirtSize], 32162 spacing: [isNumber], 32163 text: [isTshirtSize], 32164 tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest'] 32165 }, 32166 classGroups: { 32167 // -------------- 32168 // --- Layout --- 32169 // -------------- 32170 /** 32171 * Aspect Ratio 32172 * @see https://tailwindcss.com/docs/aspect-ratio 32173 */ 32174 aspect: [{ 32175 aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect] 32176 }], 32177 /** 32178 * Container 32179 * @see https://tailwindcss.com/docs/container 32180 * @deprecated since Tailwind CSS v4.0.0 32181 */ 32182 container: ['container'], 32183 /** 32184 * Columns 32185 * @see https://tailwindcss.com/docs/columns 32186 */ 32187 columns: [{ 32188 columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer] 32189 }], 32190 /** 32191 * Break After 32192 * @see https://tailwindcss.com/docs/break-after 32193 */ 32194 'break-after': [{ 32195 'break-after': scaleBreak() 32196 }], 32197 /** 32198 * Break Before 32199 * @see https://tailwindcss.com/docs/break-before 32200 */ 32201 'break-before': [{ 32202 'break-before': scaleBreak() 32203 }], 32204 /** 32205 * Break Inside 32206 * @see https://tailwindcss.com/docs/break-inside 32207 */ 32208 'break-inside': [{ 32209 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column'] 32210 }], 32211 /** 32212 * Box Decoration Break 32213 * @see https://tailwindcss.com/docs/box-decoration-break 32214 */ 32215 'box-decoration': [{ 32216 'box-decoration': ['slice', 'clone'] 32217 }], 32218 /** 32219 * Box Sizing 32220 * @see https://tailwindcss.com/docs/box-sizing 32221 */ 32222 box: [{ 32223 box: ['border', 'content'] 32224 }], 32225 /** 32226 * Display 32227 * @see https://tailwindcss.com/docs/display 32228 */ 32229 display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'], 32230 /** 32231 * Screen Reader Only 32232 * @see https://tailwindcss.com/docs/display#screen-reader-only 32233 */ 32234 sr: ['sr-only', 'not-sr-only'], 32235 /** 32236 * Floats 32237 * @see https://tailwindcss.com/docs/float 32238 */ 32239 float: [{ 32240 float: ['right', 'left', 'none', 'start', 'end'] 32241 }], 32242 /** 32243 * Clear 32244 * @see https://tailwindcss.com/docs/clear 32245 */ 32246 clear: [{ 32247 clear: ['left', 'right', 'both', 'none', 'start', 'end'] 32248 }], 32249 /** 32250 * Isolation 32251 * @see https://tailwindcss.com/docs/isolation 32252 */ 32253 isolation: ['isolate', 'isolation-auto'], 32254 /** 32255 * Object Fit 32256 * @see https://tailwindcss.com/docs/object-fit 32257 */ 32258 'object-fit': [{ 32259 object: ['contain', 'cover', 'fill', 'none', 'scale-down'] 32260 }], 32261 /** 32262 * Object Position 32263 * @see https://tailwindcss.com/docs/object-position 32264 */ 32265 'object-position': [{ 32266 object: [...scalePosition(), isArbitraryValue, isArbitraryVariable] 32267 }], 32268 /** 32269 * Overflow 32270 * @see https://tailwindcss.com/docs/overflow 32271 */ 32272 overflow: [{ 32273 overflow: scaleOverflow() 32274 }], 32275 /** 32276 * Overflow X 32277 * @see https://tailwindcss.com/docs/overflow 32278 */ 32279 'overflow-x': [{ 32280 'overflow-x': scaleOverflow() 32281 }], 32282 /** 32283 * Overflow Y 32284 * @see https://tailwindcss.com/docs/overflow 32285 */ 32286 'overflow-y': [{ 32287 'overflow-y': scaleOverflow() 32288 }], 32289 /** 32290 * Overscroll Behavior 32291 * @see https://tailwindcss.com/docs/overscroll-behavior 32292 */ 32293 overscroll: [{ 32294 overscroll: scaleOverscroll() 32295 }], 32296 /** 32297 * Overscroll Behavior X 32298 * @see https://tailwindcss.com/docs/overscroll-behavior 32299 */ 32300 'overscroll-x': [{ 32301 'overscroll-x': scaleOverscroll() 32302 }], 32303 /** 32304 * Overscroll Behavior Y 32305 * @see https://tailwindcss.com/docs/overscroll-behavior 32306 */ 32307 'overscroll-y': [{ 32308 'overscroll-y': scaleOverscroll() 32309 }], 32310 /** 32311 * Position 32312 * @see https://tailwindcss.com/docs/position 32313 */ 32314 position: ['static', 'fixed', 'absolute', 'relative', 'sticky'], 32315 /** 32316 * Top / Right / Bottom / Left 32317 * @see https://tailwindcss.com/docs/top-right-bottom-left 32318 */ 32319 inset: [{ 32320 inset: scaleInset() 32321 }], 32322 /** 32323 * Right / Left 32324 * @see https://tailwindcss.com/docs/top-right-bottom-left 32325 */ 32326 'inset-x': [{ 32327 'inset-x': scaleInset() 32328 }], 32329 /** 32330 * Top / Bottom 32331 * @see https://tailwindcss.com/docs/top-right-bottom-left 32332 */ 32333 'inset-y': [{ 32334 'inset-y': scaleInset() 32335 }], 32336 /** 32337 * Start 32338 * @see https://tailwindcss.com/docs/top-right-bottom-left 32339 */ 32340 start: [{ 32341 start: scaleInset() 32342 }], 32343 /** 32344 * End 32345 * @see https://tailwindcss.com/docs/top-right-bottom-left 32346 */ 32347 end: [{ 32348 end: scaleInset() 32349 }], 32350 /** 32351 * Top 32352 * @see https://tailwindcss.com/docs/top-right-bottom-left 32353 */ 32354 top: [{ 32355 top: scaleInset() 32356 }], 32357 /** 32358 * Right 32359 * @see https://tailwindcss.com/docs/top-right-bottom-left 32360 */ 32361 right: [{ 32362 right: scaleInset() 32363 }], 32364 /** 32365 * Bottom 32366 * @see https://tailwindcss.com/docs/top-right-bottom-left 32367 */ 32368 bottom: [{ 32369 bottom: scaleInset() 32370 }], 32371 /** 32372 * Left 32373 * @see https://tailwindcss.com/docs/top-right-bottom-left 32374 */ 32375 left: [{ 32376 left: scaleInset() 32377 }], 32378 /** 32379 * Visibility 32380 * @see https://tailwindcss.com/docs/visibility 32381 */ 32382 visibility: ['visible', 'invisible', 'collapse'], 32383 /** 32384 * Z-Index 32385 * @see https://tailwindcss.com/docs/z-index 32386 */ 32387 z: [{ 32388 z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue] 32389 }], 32390 // ------------------------ 32391 // --- Flexbox and Grid --- 32392 // ------------------------ 32393 /** 32394 * Flex Basis 32395 * @see https://tailwindcss.com/docs/flex-basis 32396 */ 32397 basis: [{ 32398 basis: [isFraction, 'full', 'auto', isArbitraryVariable, isArbitraryValue, themeContainer, themeSpacing] 32399 }], 32400 /** 32401 * Flex Direction 32402 * @see https://tailwindcss.com/docs/flex-direction 32403 */ 32404 'flex-direction': [{ 32405 flex: ['row', 'row-reverse', 'col', 'col-reverse'] 32406 }], 32407 /** 32408 * Flex Wrap 32409 * @see https://tailwindcss.com/docs/flex-wrap 32410 */ 32411 'flex-wrap': [{ 32412 flex: ['nowrap', 'wrap', 'wrap-reverse'] 32413 }], 32414 /** 32415 * Flex 32416 * @see https://tailwindcss.com/docs/flex 32417 */ 32418 flex: [{ 32419 flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue] 32420 }], 32421 /** 32422 * Flex Grow 32423 * @see https://tailwindcss.com/docs/flex-grow 32424 */ 32425 grow: [{ 32426 grow: ['', isNumber, isArbitraryVariable, isArbitraryValue] 32427 }], 32428 /** 32429 * Flex Shrink 32430 * @see https://tailwindcss.com/docs/flex-shrink 32431 */ 32432 shrink: [{ 32433 shrink: ['', isNumber, isArbitraryVariable, isArbitraryValue] 32434 }], 32435 /** 32436 * Order 32437 * @see https://tailwindcss.com/docs/order 32438 */ 32439 order: [{ 32440 order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue] 32441 }], 32442 /** 32443 * Grid Template Columns 32444 * @see https://tailwindcss.com/docs/grid-template-columns 32445 */ 32446 'grid-cols': [{ 32447 'grid-cols': scaleGridTemplateColsRows() 32448 }], 32449 /** 32450 * Grid Column Start / End 32451 * @see https://tailwindcss.com/docs/grid-column 32452 */ 32453 'col-start-end': [{ 32454 col: scaleGridColRowStartAndEnd() 32455 }], 32456 /** 32457 * Grid Column Start 32458 * @see https://tailwindcss.com/docs/grid-column 32459 */ 32460 'col-start': [{ 32461 'col-start': scaleGridColRowStartOrEnd() 32462 }], 32463 /** 32464 * Grid Column End 32465 * @see https://tailwindcss.com/docs/grid-column 32466 */ 32467 'col-end': [{ 32468 'col-end': scaleGridColRowStartOrEnd() 32469 }], 32470 /** 32471 * Grid Template Rows 32472 * @see https://tailwindcss.com/docs/grid-template-rows 32473 */ 32474 'grid-rows': [{ 32475 'grid-rows': scaleGridTemplateColsRows() 32476 }], 32477 /** 32478 * Grid Row Start / End 32479 * @see https://tailwindcss.com/docs/grid-row 32480 */ 32481 'row-start-end': [{ 32482 row: scaleGridColRowStartAndEnd() 32483 }], 32484 /** 32485 * Grid Row Start 32486 * @see https://tailwindcss.com/docs/grid-row 32487 */ 32488 'row-start': [{ 32489 'row-start': scaleGridColRowStartOrEnd() 32490 }], 32491 /** 32492 * Grid Row End 32493 * @see https://tailwindcss.com/docs/grid-row 32494 */ 32495 'row-end': [{ 32496 'row-end': scaleGridColRowStartOrEnd() 32497 }], 32498 /** 32499 * Grid Auto Flow 32500 * @see https://tailwindcss.com/docs/grid-auto-flow 32501 */ 32502 'grid-flow': [{ 32503 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense'] 32504 }], 32505 /** 32506 * Grid Auto Columns 32507 * @see https://tailwindcss.com/docs/grid-auto-columns 32508 */ 32509 'auto-cols': [{ 32510 'auto-cols': scaleGridAutoColsRows() 32511 }], 32512 /** 32513 * Grid Auto Rows 32514 * @see https://tailwindcss.com/docs/grid-auto-rows 32515 */ 32516 'auto-rows': [{ 32517 'auto-rows': scaleGridAutoColsRows() 32518 }], 32519 /** 32520 * Gap 32521 * @see https://tailwindcss.com/docs/gap 32522 */ 32523 gap: [{ 32524 gap: scaleGap() 32525 }], 32526 /** 32527 * Gap X 32528 * @see https://tailwindcss.com/docs/gap 32529 */ 32530 'gap-x': [{ 32531 'gap-x': scaleGap() 32532 }], 32533 /** 32534 * Gap Y 32535 * @see https://tailwindcss.com/docs/gap 32536 */ 32537 'gap-y': [{ 32538 'gap-y': scaleGap() 32539 }], 32540 /** 32541 * Justify Content 32542 * @see https://tailwindcss.com/docs/justify-content 32543 */ 32544 'justify-content': [{ 32545 justify: [...scaleAlignPrimaryAxis(), 'normal'] 32546 }], 32547 /** 32548 * Justify Items 32549 * @see https://tailwindcss.com/docs/justify-items 32550 */ 32551 'justify-items': [{ 32552 'justify-items': [...scaleAlignSecondaryAxis(), 'normal'] 32553 }], 32554 /** 32555 * Justify Self 32556 * @see https://tailwindcss.com/docs/justify-self 32557 */ 32558 'justify-self': [{ 32559 'justify-self': ['auto', ...scaleAlignSecondaryAxis()] 32560 }], 32561 /** 32562 * Align Content 32563 * @see https://tailwindcss.com/docs/align-content 32564 */ 32565 'align-content': [{ 32566 content: ['normal', ...scaleAlignPrimaryAxis()] 32567 }], 32568 /** 32569 * Align Items 32570 * @see https://tailwindcss.com/docs/align-items 32571 */ 32572 'align-items': [{ 32573 items: [...scaleAlignSecondaryAxis(), 'baseline'] 32574 }], 32575 /** 32576 * Align Self 32577 * @see https://tailwindcss.com/docs/align-self 32578 */ 32579 'align-self': [{ 32580 self: ['auto', ...scaleAlignSecondaryAxis(), 'baseline'] 32581 }], 32582 /** 32583 * Place Content 32584 * @see https://tailwindcss.com/docs/place-content 32585 */ 32586 'place-content': [{ 32587 'place-content': scaleAlignPrimaryAxis() 32588 }], 32589 /** 32590 * Place Items 32591 * @see https://tailwindcss.com/docs/place-items 32592 */ 32593 'place-items': [{ 32594 'place-items': [...scaleAlignSecondaryAxis(), 'baseline'] 32595 }], 32596 /** 32597 * Place Self 32598 * @see https://tailwindcss.com/docs/place-self 32599 */ 32600 'place-self': [{ 32601 'place-self': ['auto', ...scaleAlignSecondaryAxis()] 32602 }], 32603 // Spacing 32604 /** 32605 * Padding 32606 * @see https://tailwindcss.com/docs/padding 32607 */ 32608 p: [{ 32609 p: scalePadding() 32610 }], 32611 /** 32612 * Padding X 32613 * @see https://tailwindcss.com/docs/padding 32614 */ 32615 px: [{ 32616 px: scalePadding() 32617 }], 32618 /** 32619 * Padding Y 32620 * @see https://tailwindcss.com/docs/padding 32621 */ 32622 py: [{ 32623 py: scalePadding() 32624 }], 32625 /** 32626 * Padding Start 32627 * @see https://tailwindcss.com/docs/padding 32628 */ 32629 ps: [{ 32630 ps: scalePadding() 32631 }], 32632 /** 32633 * Padding End 32634 * @see https://tailwindcss.com/docs/padding 32635 */ 32636 pe: [{ 32637 pe: scalePadding() 32638 }], 32639 /** 32640 * Padding Top 32641 * @see https://tailwindcss.com/docs/padding 32642 */ 32643 pt: [{ 32644 pt: scalePadding() 32645 }], 32646 /** 32647 * Padding Right 32648 * @see https://tailwindcss.com/docs/padding 32649 */ 32650 pr: [{ 32651 pr: scalePadding() 32652 }], 32653 /** 32654 * Padding Bottom 32655 * @see https://tailwindcss.com/docs/padding 32656 */ 32657 pb: [{ 32658 pb: scalePadding() 32659 }], 32660 /** 32661 * Padding Left 32662 * @see https://tailwindcss.com/docs/padding 32663 */ 32664 pl: [{ 32665 pl: scalePadding() 32666 }], 32667 /** 32668 * Margin 32669 * @see https://tailwindcss.com/docs/margin 32670 */ 32671 m: [{ 32672 m: scaleMargin() 32673 }], 32674 /** 32675 * Margin X 32676 * @see https://tailwindcss.com/docs/margin 32677 */ 32678 mx: [{ 32679 mx: scaleMargin() 32680 }], 32681 /** 32682 * Margin Y 32683 * @see https://tailwindcss.com/docs/margin 32684 */ 32685 my: [{ 32686 my: scaleMargin() 32687 }], 32688 /** 32689 * Margin Start 32690 * @see https://tailwindcss.com/docs/margin 32691 */ 32692 ms: [{ 32693 ms: scaleMargin() 32694 }], 32695 /** 32696 * Margin End 32697 * @see https://tailwindcss.com/docs/margin 32698 */ 32699 me: [{ 32700 me: scaleMargin() 32701 }], 32702 /** 32703 * Margin Top 32704 * @see https://tailwindcss.com/docs/margin 32705 */ 32706 mt: [{ 32707 mt: scaleMargin() 32708 }], 32709 /** 32710 * Margin Right 32711 * @see https://tailwindcss.com/docs/margin 32712 */ 32713 mr: [{ 32714 mr: scaleMargin() 32715 }], 32716 /** 32717 * Margin Bottom 32718 * @see https://tailwindcss.com/docs/margin 32719 */ 32720 mb: [{ 32721 mb: scaleMargin() 32722 }], 32723 /** 32724 * Margin Left 32725 * @see https://tailwindcss.com/docs/margin 32726 */ 32727 ml: [{ 32728 ml: scaleMargin() 32729 }], 32730 /** 32731 * Space Between X 32732 * @see https://tailwindcss.com/docs/margin#adding-space-between-children 32733 */ 32734 'space-x': [{
vendor: 8,368 bytes, lines 32735-33001
32735 'space-x': scaleUnambiguousSpacing() 32736 }], 32737 /** 32738 * Space Between X Reverse 32739 * @see https://tailwindcss.com/docs/margin#adding-space-between-children 32740 */ 32741 'space-x-reverse': ['space-x-reverse'], 32742 /** 32743 * Space Between Y 32744 * @see https://tailwindcss.com/docs/margin#adding-space-between-children 32745 */ 32746 'space-y': [{ 32747 'space-y': scaleUnambiguousSpacing() 32748 }], 32749 /** 32750 * Space Between Y Reverse 32751 * @see https://tailwindcss.com/docs/margin#adding-space-between-children 32752 */ 32753 'space-y-reverse': ['space-y-reverse'], 32754 // -------------- 32755 // --- Sizing --- 32756 // -------------- 32757 /** 32758 * Width 32759 * @see https://tailwindcss.com/docs/width 32760 */ 32761 /** 32762 * Size 32763 * @see https://tailwindcss.com/docs/width#setting-both-width-and-height 32764 */ 32765 size: [{ 32766 size: scaleSizing() 32767 }], 32768 w: [{ 32769 w: [themeContainer, 'screen', ...scaleSizing()] 32770 }], 32771 /** 32772 * Min-Width 32773 * @see https://tailwindcss.com/docs/min-width 32774 */ 32775 'min-w': [{ 32776 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 32777 'none', ...scaleSizing()] 32778 }], 32779 /** 32780 * Max-Width 32781 * @see https://tailwindcss.com/docs/max-width 32782 */ 32783 'max-w': [{ 32784 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 32785 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 32786 { 32787 screen: [themeBreakpoint] 32788 }, ...scaleSizing()] 32789 }], 32790 /** 32791 * Height 32792 * @see https://tailwindcss.com/docs/height 32793 */ 32794 h: [{ 32795 h: ['screen', ...scaleSizing()] 32796 }], 32797 /** 32798 * Min-Height 32799 * @see https://tailwindcss.com/docs/min-height 32800 */ 32801 'min-h': [{ 32802 'min-h': ['screen', 'none', ...scaleSizing()] 32803 }], 32804 /** 32805 * Max-Height 32806 * @see https://tailwindcss.com/docs/max-height 32807 */ 32808 'max-h': [{ 32809 'max-h': ['screen', ...scaleSizing()] 32810 }], 32811 // ------------------ 32812 // --- Typography --- 32813 // ------------------ 32814 /** 32815 * Font Size 32816 * @see https://tailwindcss.com/docs/font-size 32817 */ 32818 'font-size': [{ 32819 text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength] 32820 }], 32821 /** 32822 * Font Smoothing 32823 * @see https://tailwindcss.com/docs/font-smoothing 32824 */ 32825 'font-smoothing': ['antialiased', 'subpixel-antialiased'], 32826 /** 32827 * Font Style 32828 * @see https://tailwindcss.com/docs/font-style 32829 */ 32830 'font-style': ['italic', 'not-italic'], 32831 /** 32832 * Font Weight 32833 * @see https://tailwindcss.com/docs/font-weight 32834 */ 32835 'font-weight': [{ 32836 font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber] 32837 }], 32838 /** 32839 * Font Stretch 32840 * @see https://tailwindcss.com/docs/font-stretch 32841 */ 32842 'font-stretch': [{ 32843 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue] 32844 }], 32845 /** 32846 * Font Family 32847 * @see https://tailwindcss.com/docs/font-family 32848 */ 32849 'font-family': [{ 32850 font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont] 32851 }], 32852 /** 32853 * Font Variant Numeric 32854 * @see https://tailwindcss.com/docs/font-variant-numeric 32855 */ 32856 'fvn-normal': ['normal-nums'], 32857 /** 32858 * Font Variant Numeric 32859 * @see https://tailwindcss.com/docs/font-variant-numeric 32860 */ 32861 'fvn-ordinal': ['ordinal'], 32862 /** 32863 * Font Variant Numeric 32864 * @see https://tailwindcss.com/docs/font-variant-numeric 32865 */ 32866 'fvn-slashed-zero': ['slashed-zero'], 32867 /** 32868 * Font Variant Numeric 32869 * @see https://tailwindcss.com/docs/font-variant-numeric 32870 */ 32871 'fvn-figure': ['lining-nums', 'oldstyle-nums'], 32872 /** 32873 * Font Variant Numeric 32874 * @see https://tailwindcss.com/docs/font-variant-numeric 32875 */ 32876 'fvn-spacing': ['proportional-nums', 'tabular-nums'], 32877 /** 32878 * Font Variant Numeric 32879 * @see https://tailwindcss.com/docs/font-variant-numeric 32880 */ 32881 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'], 32882 /** 32883 * Letter Spacing 32884 * @see https://tailwindcss.com/docs/letter-spacing 32885 */ 32886 tracking: [{ 32887 tracking: [themeTracking, isArbitraryVariable, isArbitraryValue] 32888 }], 32889 /** 32890 * Line Clamp 32891 * @see https://tailwindcss.com/docs/line-clamp 32892 */ 32893 'line-clamp': [{ 32894 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber] 32895 }], 32896 /** 32897 * Line Height 32898 * @see https://tailwindcss.com/docs/line-height 32899 */ 32900 leading: [{ 32901 leading: [isArbitraryVariable, isArbitraryValue, /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 32902 themeLeading, themeSpacing] 32903 }], 32904 /** 32905 * List Style Image 32906 * @see https://tailwindcss.com/docs/list-style-image 32907 */ 32908 'list-image': [{ 32909 'list-image': ['none', isArbitraryVariable, isArbitraryValue] 32910 }], 32911 /** 32912 * List Style Position 32913 * @see https://tailwindcss.com/docs/list-style-position 32914 */ 32915 'list-style-position': [{ 32916 list: ['inside', 'outside'] 32917 }], 32918 /** 32919 * List Style Type 32920 * @see https://tailwindcss.com/docs/list-style-type 32921 */ 32922 'list-style-type': [{ 32923 list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue] 32924 }], 32925 /** 32926 * Text Alignment 32927 * @see https://tailwindcss.com/docs/text-align 32928 */ 32929 'text-alignment': [{ 32930 text: ['left', 'center', 'right', 'justify', 'start', 'end'] 32931 }], 32932 /** 32933 * Placeholder Color 32934 * @deprecated since Tailwind CSS v3.0.0 32935 * @see https://v3.tailwindcss.com/docs/placeholder-color 32936 */ 32937 'placeholder-color': [{ 32938 placeholder: scaleColor() 32939 }], 32940 /** 32941 * Text Color 32942 * @see https://tailwindcss.com/docs/text-color 32943 */ 32944 'text-color': [{ 32945 text: scaleColor() 32946 }], 32947 /** 32948 * Text Decoration 32949 * @see https://tailwindcss.com/docs/text-decoration 32950 */ 32951 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'], 32952 /** 32953 * Text Decoration Style 32954 * @see https://tailwindcss.com/docs/text-decoration-style 32955 */ 32956 'text-decoration-style': [{ 32957 decoration: [...scaleLineStyle(), 'wavy'] 32958 }], 32959 /** 32960 * Text Decoration Thickness 32961 * @see https://tailwindcss.com/docs/text-decoration-thickness 32962 */ 32963 'text-decoration-thickness': [{ 32964 decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength] 32965 }], 32966 /** 32967 * Text Decoration Color 32968 * @see https://tailwindcss.com/docs/text-decoration-color 32969 */ 32970 'text-decoration-color': [{ 32971 decoration: scaleColor() 32972 }], 32973 /** 32974 * Text Underline Offset 32975 * @see https://tailwindcss.com/docs/text-underline-offset 32976 */ 32977 'underline-offset': [{ 32978 'underline-offset': [isNumber, 'auto', isArbitraryVariable, isArbitraryValue] 32979 }], 32980 /** 32981 * Text Transform 32982 * @see https://tailwindcss.com/docs/text-transform 32983 */ 32984 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'], 32985 /** 32986 * Text Overflow 32987 * @see https://tailwindcss.com/docs/text-overflow 32988 */ 32989 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'], 32990 /** 32991 * Text Wrap 32992 * @see https://tailwindcss.com/docs/text-wrap 32993 */ 32994 'text-wrap': [{ 32995 text: ['wrap', 'nowrap', 'balance', 'pretty'] 32996 }], 32997 /** 32998 * Text Indent 32999 * @see https://tailwindcss.com/docs/text-indent 33000 */ 33001 indent: [{
vendor: 12,538 bytes, lines 33002-33469
33002 indent: ['px', ...scaleUnambiguousSpacing()] 33003 }], 33004 /** 33005 * Vertical Alignment 33006 * @see https://tailwindcss.com/docs/vertical-align 33007 */ 33008 'vertical-align': [{ 33009 align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue] 33010 }], 33011 /** 33012 * Whitespace 33013 * @see https://tailwindcss.com/docs/whitespace 33014 */ 33015 whitespace: [{ 33016 whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'] 33017 }], 33018 /** 33019 * Word Break 33020 * @see https://tailwindcss.com/docs/word-break 33021 */ 33022 break: [{ 33023 break: ['normal', 'words', 'all', 'keep'] 33024 }], 33025 /** 33026 * Hyphens 33027 * @see https://tailwindcss.com/docs/hyphens 33028 */ 33029 hyphens: [{ 33030 hyphens: ['none', 'manual', 'auto'] 33031 }], 33032 /** 33033 * Content 33034 * @see https://tailwindcss.com/docs/content 33035 */ 33036 content: [{ 33037 content: ['none', isArbitraryVariable, isArbitraryValue] 33038 }], 33039 // ------------------- 33040 // --- Backgrounds --- 33041 // ------------------- 33042 /** 33043 * Background Attachment 33044 * @see https://tailwindcss.com/docs/background-attachment 33045 */ 33046 'bg-attachment': [{ 33047 bg: ['fixed', 'local', 'scroll'] 33048 }], 33049 /** 33050 * Background Clip 33051 * @see https://tailwindcss.com/docs/background-clip 33052 */ 33053 'bg-clip': [{ 33054 'bg-clip': ['border', 'padding', 'content', 'text'] 33055 }], 33056 /** 33057 * Background Origin 33058 * @see https://tailwindcss.com/docs/background-origin 33059 */ 33060 'bg-origin': [{ 33061 'bg-origin': ['border', 'padding', 'content'] 33062 }], 33063 /** 33064 * Background Position 33065 * @see https://tailwindcss.com/docs/background-position 33066 */ 33067 'bg-position': [{ 33068 bg: [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition] 33069 }], 33070 /** 33071 * Background Repeat 33072 * @see https://tailwindcss.com/docs/background-repeat 33073 */ 33074 'bg-repeat': [{ 33075 bg: ['no-repeat', { 33076 repeat: ['', 'x', 'y', 'space', 'round'] 33077 }] 33078 }], 33079 /** 33080 * Background Size 33081 * @see https://tailwindcss.com/docs/background-size 33082 */ 33083 'bg-size': [{ 33084 bg: ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize] 33085 }], 33086 /** 33087 * Background Image 33088 * @see https://tailwindcss.com/docs/background-image 33089 */ 33090 'bg-image': [{ 33091 bg: ['none', { 33092 linear: [{ 33093 to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl'] 33094 }, isInteger, isArbitraryVariable, isArbitraryValue], 33095 radial: ['', isArbitraryVariable, isArbitraryValue], 33096 conic: [isInteger, isArbitraryVariable, isArbitraryValue] 33097 }, isArbitraryVariableImage, isArbitraryImage] 33098 }], 33099 /** 33100 * Background Color 33101 * @see https://tailwindcss.com/docs/background-color 33102 */ 33103 'bg-color': [{ 33104 bg: scaleColor() 33105 }], 33106 /** 33107 * Gradient Color Stops From Position 33108 * @see https://tailwindcss.com/docs/gradient-color-stops 33109 */ 33110 'gradient-from-pos': [{ 33111 from: scaleGradientStopPosition() 33112 }], 33113 /** 33114 * Gradient Color Stops Via Position 33115 * @see https://tailwindcss.com/docs/gradient-color-stops 33116 */ 33117 'gradient-via-pos': [{ 33118 via: scaleGradientStopPosition() 33119 }], 33120 /** 33121 * Gradient Color Stops To Position 33122 * @see https://tailwindcss.com/docs/gradient-color-stops 33123 */ 33124 'gradient-to-pos': [{ 33125 to: scaleGradientStopPosition() 33126 }], 33127 /** 33128 * Gradient Color Stops From 33129 * @see https://tailwindcss.com/docs/gradient-color-stops 33130 */ 33131 'gradient-from': [{ 33132 from: scaleColor() 33133 }], 33134 /** 33135 * Gradient Color Stops Via 33136 * @see https://tailwindcss.com/docs/gradient-color-stops 33137 */ 33138 'gradient-via': [{ 33139 via: scaleColor() 33140 }], 33141 /** 33142 * Gradient Color Stops To 33143 * @see https://tailwindcss.com/docs/gradient-color-stops 33144 */ 33145 'gradient-to': [{ 33146 to: scaleColor() 33147 }], 33148 // --------------- 33149 // --- Borders --- 33150 // --------------- 33151 /** 33152 * Border Radius 33153 * @see https://tailwindcss.com/docs/border-radius 33154 */ 33155 rounded: [{ 33156 rounded: scaleRadius() 33157 }], 33158 /** 33159 * Border Radius Start 33160 * @see https://tailwindcss.com/docs/border-radius 33161 */ 33162 'rounded-s': [{ 33163 'rounded-s': scaleRadius() 33164 }], 33165 /** 33166 * Border Radius End 33167 * @see https://tailwindcss.com/docs/border-radius 33168 */ 33169 'rounded-e': [{ 33170 'rounded-e': scaleRadius() 33171 }], 33172 /** 33173 * Border Radius Top 33174 * @see https://tailwindcss.com/docs/border-radius 33175 */ 33176 'rounded-t': [{ 33177 'rounded-t': scaleRadius() 33178 }], 33179 /** 33180 * Border Radius Right 33181 * @see https://tailwindcss.com/docs/border-radius 33182 */ 33183 'rounded-r': [{ 33184 'rounded-r': scaleRadius() 33185 }], 33186 /** 33187 * Border Radius Bottom 33188 * @see https://tailwindcss.com/docs/border-radius 33189 */ 33190 'rounded-b': [{ 33191 'rounded-b': scaleRadius() 33192 }], 33193 /** 33194 * Border Radius Left 33195 * @see https://tailwindcss.com/docs/border-radius 33196 */ 33197 'rounded-l': [{ 33198 'rounded-l': scaleRadius() 33199 }], 33200 /** 33201 * Border Radius Start Start 33202 * @see https://tailwindcss.com/docs/border-radius 33203 */ 33204 'rounded-ss': [{ 33205 'rounded-ss': scaleRadius() 33206 }], 33207 /** 33208 * Border Radius Start End 33209 * @see https://tailwindcss.com/docs/border-radius 33210 */ 33211 'rounded-se': [{ 33212 'rounded-se': scaleRadius() 33213 }], 33214 /** 33215 * Border Radius End End 33216 * @see https://tailwindcss.com/docs/border-radius 33217 */ 33218 'rounded-ee': [{ 33219 'rounded-ee': scaleRadius() 33220 }], 33221 /** 33222 * Border Radius End Start 33223 * @see https://tailwindcss.com/docs/border-radius 33224 */ 33225 'rounded-es': [{ 33226 'rounded-es': scaleRadius() 33227 }], 33228 /** 33229 * Border Radius Top Left 33230 * @see https://tailwindcss.com/docs/border-radius 33231 */ 33232 'rounded-tl': [{ 33233 'rounded-tl': scaleRadius() 33234 }], 33235 /** 33236 * Border Radius Top Right 33237 * @see https://tailwindcss.com/docs/border-radius 33238 */ 33239 'rounded-tr': [{ 33240 'rounded-tr': scaleRadius() 33241 }], 33242 /** 33243 * Border Radius Bottom Right 33244 * @see https://tailwindcss.com/docs/border-radius 33245 */ 33246 'rounded-br': [{ 33247 'rounded-br': scaleRadius() 33248 }], 33249 /** 33250 * Border Radius Bottom Left 33251 * @see https://tailwindcss.com/docs/border-radius 33252 */ 33253 'rounded-bl': [{ 33254 'rounded-bl': scaleRadius() 33255 }], 33256 /** 33257 * Border Width 33258 * @see https://tailwindcss.com/docs/border-width 33259 */ 33260 'border-w': [{ 33261 border: scaleBorderWidth() 33262 }], 33263 /** 33264 * Border Width X 33265 * @see https://tailwindcss.com/docs/border-width 33266 */ 33267 'border-w-x': [{ 33268 'border-x': scaleBorderWidth() 33269 }], 33270 /** 33271 * Border Width Y 33272 * @see https://tailwindcss.com/docs/border-width 33273 */ 33274 'border-w-y': [{ 33275 'border-y': scaleBorderWidth() 33276 }], 33277 /** 33278 * Border Width Start 33279 * @see https://tailwindcss.com/docs/border-width 33280 */ 33281 'border-w-s': [{ 33282 'border-s': scaleBorderWidth() 33283 }], 33284 /** 33285 * Border Width End 33286 * @see https://tailwindcss.com/docs/border-width 33287 */ 33288 'border-w-e': [{ 33289 'border-e': scaleBorderWidth() 33290 }], 33291 /** 33292 * Border Width Top 33293 * @see https://tailwindcss.com/docs/border-width 33294 */ 33295 'border-w-t': [{ 33296 'border-t': scaleBorderWidth() 33297 }], 33298 /** 33299 * Border Width Right 33300 * @see https://tailwindcss.com/docs/border-width 33301 */ 33302 'border-w-r': [{ 33303 'border-r': scaleBorderWidth() 33304 }], 33305 /** 33306 * Border Width Bottom 33307 * @see https://tailwindcss.com/docs/border-width 33308 */ 33309 'border-w-b': [{ 33310 'border-b': scaleBorderWidth() 33311 }], 33312 /** 33313 * Border Width Left 33314 * @see https://tailwindcss.com/docs/border-width 33315 */ 33316 'border-w-l': [{ 33317 'border-l': scaleBorderWidth() 33318 }], 33319 /** 33320 * Divide Width X 33321 * @see https://tailwindcss.com/docs/border-width#between-children 33322 */ 33323 'divide-x': [{ 33324 'divide-x': scaleBorderWidth() 33325 }], 33326 /** 33327 * Divide Width X Reverse 33328 * @see https://tailwindcss.com/docs/border-width#between-children 33329 */ 33330 'divide-x-reverse': ['divide-x-reverse'], 33331 /** 33332 * Divide Width Y 33333 * @see https://tailwindcss.com/docs/border-width#between-children 33334 */ 33335 'divide-y': [{ 33336 'divide-y': scaleBorderWidth() 33337 }], 33338 /** 33339 * Divide Width Y Reverse 33340 * @see https://tailwindcss.com/docs/border-width#between-children 33341 */ 33342 'divide-y-reverse': ['divide-y-reverse'], 33343 /** 33344 * Border Style 33345 * @see https://tailwindcss.com/docs/border-style 33346 */ 33347 'border-style': [{ 33348 border: [...scaleLineStyle(), 'hidden', 'none'] 33349 }], 33350 /** 33351 * Divide Style 33352 * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style 33353 */ 33354 'divide-style': [{ 33355 divide: [...scaleLineStyle(), 'hidden', 'none'] 33356 }], 33357 /** 33358 * Border Color 33359 * @see https://tailwindcss.com/docs/border-color 33360 */ 33361 'border-color': [{ 33362 border: scaleColor() 33363 }], 33364 /** 33365 * Border Color X 33366 * @see https://tailwindcss.com/docs/border-color 33367 */ 33368 'border-color-x': [{ 33369 'border-x': scaleColor() 33370 }], 33371 /** 33372 * Border Color Y 33373 * @see https://tailwindcss.com/docs/border-color 33374 */ 33375 'border-color-y': [{ 33376 'border-y': scaleColor() 33377 }], 33378 /** 33379 * Border Color S 33380 * @see https://tailwindcss.com/docs/border-color 33381 */ 33382 'border-color-s': [{ 33383 'border-s': scaleColor() 33384 }], 33385 /** 33386 * Border Color E 33387 * @see https://tailwindcss.com/docs/border-color 33388 */ 33389 'border-color-e': [{ 33390 'border-e': scaleColor() 33391 }], 33392 /** 33393 * Border Color Top 33394 * @see https://tailwindcss.com/docs/border-color 33395 */ 33396 'border-color-t': [{ 33397 'border-t': scaleColor() 33398 }], 33399 /** 33400 * Border Color Right 33401 * @see https://tailwindcss.com/docs/border-color 33402 */ 33403 'border-color-r': [{ 33404 'border-r': scaleColor() 33405 }], 33406 /** 33407 * Border Color Bottom 33408 * @see https://tailwindcss.com/docs/border-color 33409 */ 33410 'border-color-b': [{ 33411 'border-b': scaleColor() 33412 }], 33413 /** 33414 * Border Color Left 33415 * @see https://tailwindcss.com/docs/border-color 33416 */ 33417 'border-color-l': [{ 33418 'border-l': scaleColor() 33419 }], 33420 /** 33421 * Divide Color 33422 * @see https://tailwindcss.com/docs/divide-color 33423 */ 33424 'divide-color': [{ 33425 divide: scaleColor() 33426 }], 33427 /** 33428 * Outline Style 33429 * @see https://tailwindcss.com/docs/outline-style 33430 */ 33431 'outline-style': [{ 33432 outline: [...scaleLineStyle(), 'none', 'hidden'] 33433 }], 33434 /** 33435 * Outline Offset 33436 * @see https://tailwindcss.com/docs/outline-offset 33437 */ 33438 'outline-offset': [{ 33439 'outline-offset': [isNumber, isArbitraryVariable, isArbitraryValue] 33440 }], 33441 /** 33442 * Outline Width 33443 * @see https://tailwindcss.com/docs/outline-width 33444 */ 33445 'outline-w': [{ 33446 outline: ['', isNumber, isArbitraryVariableLength, isArbitraryLength] 33447 }], 33448 /** 33449 * Outline Color 33450 * @see https://tailwindcss.com/docs/outline-color 33451 */ 33452 'outline-color': [{ 33453 outline: [themeColor] 33454 }], 33455 // --------------- 33456 // --- Effects --- 33457 // --------------- 33458 /** 33459 * Box Shadow 33460 * @see https://tailwindcss.com/docs/box-shadow 33461 */ 33462 shadow: [{ 33463 shadow: [ 33464 // Deprecated since Tailwind CSS v4.0.0 33465 '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow] 33466 }], 33467 /** 33468 * Box Shadow Color 33469 * @see https://tailwindcss.com/docs/box-shadow#setting-the-sh
vendor: 12,588 bytes, lines 33469-33919
33469adow-color 33470 */ 33471 'shadow-color': [{ 33472 shadow: scaleColor() 33473 }], 33474 /** 33475 * Inset Box Shadow 33476 * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow 33477 */ 33478 'inset-shadow': [{ 33479 'inset-shadow': ['none', isArbitraryVariable, isArbitraryValue, themeInsetShadow] 33480 }], 33481 /** 33482 * Inset Box Shadow Color 33483 * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color 33484 */ 33485 'inset-shadow-color': [{ 33486 'inset-shadow': scaleColor() 33487 }], 33488 /** 33489 * Ring Width 33490 * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring 33491 */ 33492 'ring-w': [{ 33493 ring: scaleBorderWidth() 33494 }], 33495 /** 33496 * Ring Width Inset 33497 * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings 33498 * @deprecated since Tailwind CSS v4.0.0 33499 * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158 33500 */ 33501 'ring-w-inset': ['ring-inset'], 33502 /** 33503 * Ring Color 33504 * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color 33505 */ 33506 'ring-color': [{ 33507 ring: scaleColor() 33508 }], 33509 /** 33510 * Ring Offset Width 33511 * @see https://v3.tailwindcss.com/docs/ring-offset-width 33512 * @deprecated since Tailwind CSS v4.0.0 33513 * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158 33514 */ 33515 'ring-offset-w': [{ 33516 'ring-offset': [isNumber, isArbitraryLength] 33517 }], 33518 /** 33519 * Ring Offset Color 33520 * @see https://v3.tailwindcss.com/docs/ring-offset-color 33521 * @deprecated since Tailwind CSS v4.0.0 33522 * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158 33523 */ 33524 'ring-offset-color': [{ 33525 'ring-offset': scaleColor() 33526 }], 33527 /** 33528 * Inset Ring Width 33529 * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring 33530 */ 33531 'inset-ring-w': [{ 33532 'inset-ring': scaleBorderWidth() 33533 }], 33534 /** 33535 * Inset Ring Color 33536 * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color 33537 */ 33538 'inset-ring-color': [{ 33539 'inset-ring': scaleColor() 33540 }], 33541 /** 33542 * Opacity 33543 * @see https://tailwindcss.com/docs/opacity 33544 */ 33545 opacity: [{ 33546 opacity: [isNumber, isArbitraryVariable, isArbitraryValue] 33547 }], 33548 /** 33549 * Mix Blend Mode 33550 * @see https://tailwindcss.com/docs/mix-blend-mode 33551 */ 33552 'mix-blend': [{ 33553 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter'] 33554 }], 33555 /** 33556 * Background Blend Mode 33557 * @see https://tailwindcss.com/docs/background-blend-mode 33558 */ 33559 'bg-blend': [{ 33560 'bg-blend': scaleBlendMode() 33561 }], 33562 // --------------- 33563 // --- Filters --- 33564 // --------------- 33565 /** 33566 * Filter 33567 * @see https://tailwindcss.com/docs/filter 33568 */ 33569 filter: [{ 33570 filter: [ 33571 // Deprecated since Tailwind CSS v3.0.0 33572 '', 'none', isArbitraryVariable, isArbitraryValue] 33573 }], 33574 /** 33575 * Blur 33576 * @see https://tailwindcss.com/docs/blur 33577 */ 33578 blur: [{ 33579 blur: scaleBlur() 33580 }], 33581 /** 33582 * Brightness 33583 * @see https://tailwindcss.com/docs/brightness 33584 */ 33585 brightness: [{ 33586 brightness: [isNumber, isArbitraryVariable, isArbitraryValue] 33587 }], 33588 /** 33589 * Contrast 33590 * @see https://tailwindcss.com/docs/contrast 33591 */ 33592 contrast: [{ 33593 contrast: [isNumber, isArbitraryVariable, isArbitraryValue] 33594 }], 33595 /** 33596 * Drop Shadow 33597 * @see https://tailwindcss.com/docs/drop-shadow 33598 */ 33599 'drop-shadow': [{ 33600 'drop-shadow': [ 33601 // Deprecated since Tailwind CSS v4.0.0 33602 '', 'none', themeDropShadow, isArbitraryVariable, isArbitraryValue] 33603 }], 33604 /** 33605 * Grayscale 33606 * @see https://tailwindcss.com/docs/grayscale 33607 */ 33608 grayscale: [{ 33609 grayscale: ['', isNumber, isArbitraryVariable, isArbitraryValue] 33610 }], 33611 /** 33612 * Hue Rotate 33613 * @see https://tailwindcss.com/docs/hue-rotate 33614 */ 33615 'hue-rotate': [{ 33616 'hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue] 33617 }], 33618 /** 33619 * Invert 33620 * @see https://tailwindcss.com/docs/invert 33621 */ 33622 invert: [{ 33623 invert: ['', isNumber, isArbitraryVariable, isArbitraryValue] 33624 }], 33625 /** 33626 * Saturate 33627 * @see https://tailwindcss.com/docs/saturate 33628 */ 33629 saturate: [{ 33630 saturate: [isNumber, isArbitraryVariable, isArbitraryValue] 33631 }], 33632 /** 33633 * Sepia 33634 * @see https://tailwindcss.com/docs/sepia 33635 */ 33636 sepia: [{ 33637 sepia: ['', isNumber, isArbitraryVariable, isArbitraryValue] 33638 }], 33639 /** 33640 * Backdrop Filter 33641 * @see https://tailwindcss.com/docs/backdrop-filter 33642 */ 33643 'backdrop-filter': [{ 33644 'backdrop-filter': [ 33645 // Deprecated since Tailwind CSS v3.0.0 33646 '', 'none', isArbitraryVariable, isArbitraryValue] 33647 }], 33648 /** 33649 * Backdrop Blur 33650 * @see https://tailwindcss.com/docs/backdrop-blur 33651 */ 33652 'backdrop-blur': [{ 33653 'backdrop-blur': scaleBlur() 33654 }], 33655 /** 33656 * Backdrop Brightness 33657 * @see https://tailwindcss.com/docs/backdrop-brightness 33658 */ 33659 'backdrop-brightness': [{ 33660 'backdrop-brightness': [isNumber, isArbitraryVariable, isArbitraryValue] 33661 }], 33662 /** 33663 * Backdrop Contrast 33664 * @see https://tailwindcss.com/docs/backdrop-contrast 33665 */ 33666 'backdrop-contrast': [{ 33667 'backdrop-contrast': [isNumber, isArbitraryVariable, isArbitraryValue] 33668 }], 33669 /** 33670 * Backdrop Grayscale 33671 * @see https://tailwindcss.com/docs/backdrop-grayscale 33672 */ 33673 'backdrop-grayscale': [{ 33674 'backdrop-grayscale': ['', isNumber, isArbitraryVariable, isArbitraryValue] 33675 }], 33676 /** 33677 * Backdrop Hue Rotate 33678 * @see https://tailwindcss.com/docs/backdrop-hue-rotate 33679 */ 33680 'backdrop-hue-rotate': [{ 33681 'backdrop-hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue] 33682 }], 33683 /** 33684 * Backdrop Invert 33685 * @see https://tailwindcss.com/docs/backdrop-invert 33686 */ 33687 'backdrop-invert': [{ 33688 'backdrop-invert': ['', isNumber, isArbitraryVariable, isArbitraryValue] 33689 }], 33690 /** 33691 * Backdrop Opacity 33692 * @see https://tailwindcss.com/docs/backdrop-opacity 33693 */ 33694 'backdrop-opacity': [{ 33695 'backdrop-opacity': [isNumber, isArbitraryVariable, isArbitraryValue] 33696 }], 33697 /** 33698 * Backdrop Saturate 33699 * @see https://tailwindcss.com/docs/backdrop-saturate 33700 */ 33701 'backdrop-saturate': [{ 33702 'backdrop-saturate': [isNumber, isArbitraryVariable, isArbitraryValue] 33703 }], 33704 /** 33705 * Backdrop Sepia 33706 * @see https://tailwindcss.com/docs/backdrop-sepia 33707 */ 33708 'backdrop-sepia': [{ 33709 'backdrop-sepia': ['', isNumber, isArbitraryVariable, isArbitraryValue] 33710 }], 33711 // -------------- 33712 // --- Tables --- 33713 // -------------- 33714 /** 33715 * Border Collapse 33716 * @see https://tailwindcss.com/docs/border-collapse 33717 */ 33718 'border-collapse': [{ 33719 border: ['collapse', 'separate'] 33720 }], 33721 /** 33722 * Border Spacing 33723 * @see https://tailwindcss.com/docs/border-spacing 33724 */ 33725 'border-spacing': [{ 33726 'border-spacing': scaleUnambiguousSpacing() 33727 }], 33728 /** 33729 * Border Spacing X 33730 * @see https://tailwindcss.com/docs/border-spacing 33731 */ 33732 'border-spacing-x': [{ 33733 'border-spacing-x': scaleUnambiguousSpacing() 33734 }], 33735 /** 33736 * Border Spacing Y 33737 * @see https://tailwindcss.com/docs/border-spacing 33738 */ 33739 'border-spacing-y': [{ 33740 'border-spacing-y': scaleUnambiguousSpacing() 33741 }], 33742 /** 33743 * Table Layout 33744 * @see https://tailwindcss.com/docs/table-layout 33745 */ 33746 'table-layout': [{ 33747 table: ['auto', 'fixed'] 33748 }], 33749 /** 33750 * Caption Side 33751 * @see https://tailwindcss.com/docs/caption-side 33752 */ 33753 caption: [{ 33754 caption: ['top', 'bottom'] 33755 }], 33756 // --------------------------------- 33757 // --- Transitions and Animation --- 33758 // --------------------------------- 33759 /** 33760 * Transition Property 33761 * @see https://tailwindcss.com/docs/transition-property 33762 */ 33763 transition: [{ 33764 transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue] 33765 }], 33766 /** 33767 * Transition Behavior 33768 * @see https://tailwindcss.com/docs/transition-behavior 33769 */ 33770 'transition-behavior': [{ 33771 transition: ['normal', 'discrete'] 33772 }], 33773 /** 33774 * Transition Duration 33775 * @see https://tailwindcss.com/docs/transition-duration 33776 */ 33777 duration: [{ 33778 duration: [isNumber, 'initial', isArbitraryVariable, isArbitraryValue] 33779 }], 33780 /** 33781 * Transition Timing Function 33782 * @see https://tailwindcss.com/docs/transition-timing-function 33783 */ 33784 ease: [{ 33785 ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue] 33786 }], 33787 /** 33788 * Transition Delay 33789 * @see https://tailwindcss.com/docs/transition-delay 33790 */ 33791 delay: [{ 33792 delay: [isNumber, isArbitraryVariable, isArbitraryValue] 33793 }], 33794 /** 33795 * Animation 33796 * @see https://tailwindcss.com/docs/animation 33797 */ 33798 animate: [{ 33799 animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue] 33800 }], 33801 // ------------------ 33802 // --- Transforms --- 33803 // ------------------ 33804 /** 33805 * Backface Visibility 33806 * @see https://tailwindcss.com/docs/backface-visibility 33807 */ 33808 backface: [{ 33809 backface: ['hidden', 'visible'] 33810 }], 33811 /** 33812 * Perspective 33813 * @see https://tailwindcss.com/docs/perspective 33814 */ 33815 perspective: [{ 33816 perspective: [themePerspective, isArbitraryVariable, isArbitraryValue] 33817 }], 33818 /** 33819 * Perspective Origin 33820 * @see https://tailwindcss.com/docs/perspective-origin 33821 */ 33822 'perspective-origin': [{ 33823 'perspective-origin': scaleOrigin() 33824 }], 33825 /** 33826 * Rotate 33827 * @see https://tailwindcss.com/docs/rotate 33828 */ 33829 rotate: [{ 33830 rotate: scaleRotate() 33831 }], 33832 /** 33833 * Rotate X 33834 * @see https://tailwindcss.com/docs/rotate 33835 */ 33836 'rotate-x': [{ 33837 'rotate-x': scaleRotate() 33838 }], 33839 /** 33840 * Rotate Y 33841 * @see https://tailwindcss.com/docs/rotate 33842 */ 33843 'rotate-y': [{ 33844 'rotate-y': scaleRotate() 33845 }], 33846 /** 33847 * Rotate Z 33848 * @see https://tailwindcss.com/docs/rotate 33849 */ 33850 'rotate-z': [{ 33851 'rotate-z': scaleRotate() 33852 }], 33853 /** 33854 * Scale 33855 * @see https://tailwindcss.com/docs/scale 33856 */ 33857 scale: [{ 33858 scale: scaleScale() 33859 }], 33860 /** 33861 * Scale X 33862 * @see https://tailwindcss.com/docs/scale 33863 */ 33864 'scale-x': [{ 33865 'scale-x': scaleScale() 33866 }], 33867 /** 33868 * Scale Y 33869 * @see https://tailwindcss.com/docs/scale 33870 */ 33871 'scale-y': [{ 33872 'scale-y': scaleScale() 33873 }], 33874 /** 33875 * Scale Z 33876 * @see https://tailwindcss.com/docs/scale 33877 */ 33878 'scale-z': [{ 33879 'scale-z': scaleScale() 33880 }], 33881 /** 33882 * Scale 3D 33883 * @see https://tailwindcss.com/docs/scale 33884 */ 33885 'scale-3d': ['scale-3d'], 33886 /** 33887 * Skew 33888 * @see https://tailwindcss.com/docs/skew 33889 */ 33890 skew: [{ 33891 skew: scaleSkew() 33892 }], 33893 /** 33894 * Skew X 33895 * @see https://tailwindcss.com/docs/skew 33896 */ 33897 'skew-x': [{ 33898 'skew-x': scaleSkew() 33899 }], 33900 /** 33901 * Skew Y 33902 * @see https://tailwindcss.com/docs/skew 33903 */ 33904 'skew-y': [{ 33905 'skew-y': scaleSkew() 33906 }], 33907 /** 33908 * Transform 33909 * @see https://tailwindcss.com/docs/transform 33910 */ 33911 transform: [{ 33912 transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu'] 33913 }], 33914 /** 33915 * Transform Origin 33916 * @see https://tailwindcss.com/docs/transform-origin 33917 */ 33918 'transform-origin': [{ 33919 origin: scaleOrigin
vendor: 10,657 bytes, lines 33919-34287
33919() 33920 }], 33921 /** 33922 * Transform Style 33923 * @see https://tailwindcss.com/docs/transform-style 33924 */ 33925 'transform-style': [{ 33926 transform: ['3d', 'flat'] 33927 }], 33928 /** 33929 * Translate 33930 * @see https://tailwindcss.com/docs/translate 33931 */ 33932 translate: [{ 33933 translate: scaleTranslate() 33934 }], 33935 /** 33936 * Translate X 33937 * @see https://tailwindcss.com/docs/translate 33938 */ 33939 'translate-x': [{ 33940 'translate-x': scaleTranslate() 33941 }], 33942 /** 33943 * Translate Y 33944 * @see https://tailwindcss.com/docs/translate 33945 */ 33946 'translate-y': [{ 33947 'translate-y': scaleTranslate() 33948 }], 33949 /** 33950 * Translate Z 33951 * @see https://tailwindcss.com/docs/translate 33952 */ 33953 'translate-z': [{ 33954 'translate-z': scaleTranslate() 33955 }], 33956 /** 33957 * Translate None 33958 * @see https://tailwindcss.com/docs/translate 33959 */ 33960 'translate-none': ['translate-none'], 33961 // --------------------- 33962 // --- Interactivity --- 33963 // --------------------- 33964 /** 33965 * Accent Color 33966 * @see https://tailwindcss.com/docs/accent-color 33967 */ 33968 accent: [{ 33969 accent: scaleColor() 33970 }], 33971 /** 33972 * Appearance 33973 * @see https://tailwindcss.com/docs/appearance 33974 */ 33975 appearance: [{ 33976 appearance: ['none', 'auto'] 33977 }], 33978 /** 33979 * Caret Color 33980 * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities 33981 */ 33982 'caret-color': [{ 33983 caret: scaleColor() 33984 }], 33985 /** 33986 * Color Scheme 33987 * @see https://tailwindcss.com/docs/color-scheme 33988 */ 33989 'color-scheme': [{ 33990 scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light'] 33991 }], 33992 /** 33993 * Cursor 33994 * @see https://tailwindcss.com/docs/cursor 33995 */ 33996 cursor: [{ 33997 cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryVariable, isArbitraryValue] 33998 }], 33999 /** 34000 * Field Sizing 34001 * @see https://tailwindcss.com/docs/field-sizing 34002 */ 34003 'field-sizing': [{ 34004 'field-sizing': ['fixed', 'content'] 34005 }], 34006 /** 34007 * Pointer Events 34008 * @see https://tailwindcss.com/docs/pointer-events 34009 */ 34010 'pointer-events': [{ 34011 'pointer-events': ['auto', 'none'] 34012 }], 34013 /** 34014 * Resize 34015 * @see https://tailwindcss.com/docs/resize 34016 */ 34017 resize: [{ 34018 resize: ['none', '', 'y', 'x'] 34019 }], 34020 /** 34021 * Scroll Behavior 34022 * @see https://tailwindcss.com/docs/scroll-behavior 34023 */ 34024 'scroll-behavior': [{ 34025 scroll: ['auto', 'smooth'] 34026 }], 34027 /** 34028 * Scroll Margin 34029 * @see https://tailwindcss.com/docs/scroll-margin 34030 */ 34031 'scroll-m': [{ 34032 'scroll-m': scaleUnambiguousSpacing() 34033 }], 34034 /** 34035 * Scroll Margin X 34036 * @see https://tailwindcss.com/docs/scroll-margin 34037 */ 34038 'scroll-mx': [{ 34039 'scroll-mx': scaleUnambiguousSpacing() 34040 }], 34041 /** 34042 * Scroll Margin Y 34043 * @see https://tailwindcss.com/docs/scroll-margin 34044 */ 34045 'scroll-my': [{ 34046 'scroll-my': scaleUnambiguousSpacing() 34047 }], 34048 /** 34049 * Scroll Margin Start 34050 * @see https://tailwindcss.com/docs/scroll-margin 34051 */ 34052 'scroll-ms': [{ 34053 'scroll-ms': scaleUnambiguousSpacing() 34054 }], 34055 /** 34056 * Scroll Margin End 34057 * @see https://tailwindcss.com/docs/scroll-margin 34058 */ 34059 'scroll-me': [{ 34060 'scroll-me': scaleUnambiguousSpacing() 34061 }], 34062 /** 34063 * Scroll Margin Top 34064 * @see https://tailwindcss.com/docs/scroll-margin 34065 */ 34066 'scroll-mt': [{ 34067 'scroll-mt': scaleUnambiguousSpacing() 34068 }], 34069 /** 34070 * Scroll Margin Right 34071 * @see https://tailwindcss.com/docs/scroll-margin 34072 */ 34073 'scroll-mr': [{ 34074 'scroll-mr': scaleUnambiguousSpacing() 34075 }], 34076 /** 34077 * Scroll Margin Bottom 34078 * @see https://tailwindcss.com/docs/scroll-margin 34079 */ 34080 'scroll-mb': [{ 34081 'scroll-mb': scaleUnambiguousSpacing() 34082 }], 34083 /** 34084 * Scroll Margin Left 34085 * @see https://tailwindcss.com/docs/scroll-margin 34086 */ 34087 'scroll-ml': [{ 34088 'scroll-ml': scaleUnambiguousSpacing() 34089 }], 34090 /** 34091 * Scroll Padding 34092 * @see https://tailwindcss.com/docs/scroll-padding 34093 */ 34094 'scroll-p': [{ 34095 'scroll-p': scaleUnambiguousSpacing() 34096 }], 34097 /** 34098 * Scroll Padding X 34099 * @see https://tailwindcss.com/docs/scroll-padding 34100 */ 34101 'scroll-px': [{ 34102 'scroll-px': scaleUnambiguousSpacing() 34103 }], 34104 /** 34105 * Scroll Padding Y 34106 * @see https://tailwindcss.com/docs/scroll-padding 34107 */ 34108 'scroll-py': [{ 34109 'scroll-py': scaleUnambiguousSpacing() 34110 }], 34111 /** 34112 * Scroll Padding Start 34113 * @see https://tailwindcss.com/docs/scroll-padding 34114 */ 34115 'scroll-ps': [{ 34116 'scroll-ps': scaleUnambiguousSpacing() 34117 }], 34118 /** 34119 * Scroll Padding End 34120 * @see https://tailwindcss.com/docs/scroll-padding 34121 */ 34122 'scroll-pe': [{ 34123 'scroll-pe': scaleUnambiguousSpacing() 34124 }], 34125 /** 34126 * Scroll Padding Top 34127 * @see https://tailwindcss.com/docs/scroll-padding 34128 */ 34129 'scroll-pt': [{ 34130 'scroll-pt': scaleUnambiguousSpacing() 34131 }], 34132 /** 34133 * Scroll Padding Right 34134 * @see https://tailwindcss.com/docs/scroll-padding 34135 */ 34136 'scroll-pr': [{ 34137 'scroll-pr': scaleUnambiguousSpacing() 34138 }], 34139 /** 34140 * Scroll Padding Bottom 34141 * @see https://tailwindcss.com/docs/scroll-padding 34142 */ 34143 'scroll-pb': [{ 34144 'scroll-pb': scaleUnambiguousSpacing() 34145 }], 34146 /** 34147 * Scroll Padding Left 34148 * @see https://tailwindcss.com/docs/scroll-padding 34149 */ 34150 'scroll-pl': [{ 34151 'scroll-pl': scaleUnambiguousSpacing() 34152 }], 34153 /** 34154 * Scroll Snap Align 34155 * @see https://tailwindcss.com/docs/scroll-snap-align 34156 */ 34157 'snap-align': [{ 34158 snap: ['start', 'end', 'center', 'align-none'] 34159 }], 34160 /** 34161 * Scroll Snap Stop 34162 * @see https://tailwindcss.com/docs/scroll-snap-stop 34163 */ 34164 'snap-stop': [{ 34165 snap: ['normal', 'always'] 34166 }], 34167 /** 34168 * Scroll Snap Type 34169 * @see https://tailwindcss.com/docs/scroll-snap-type 34170 */ 34171 'snap-type': [{ 34172 snap: ['none', 'x', 'y', 'both'] 34173 }], 34174 /** 34175 * Scroll Snap Type Strictness 34176 * @see https://tailwindcss.com/docs/scroll-snap-type 34177 */ 34178 'snap-strictness': [{ 34179 snap: ['mandatory', 'proximity'] 34180 }], 34181 /** 34182 * Touch Action 34183 * @see https://tailwindcss.com/docs/touch-action 34184 */ 34185 touch: [{ 34186 touch: ['auto', 'none', 'manipulation'] 34187 }], 34188 /** 34189 * Touch Action X 34190 * @see https://tailwindcss.com/docs/touch-action 34191 */ 34192 'touch-x': [{ 34193 'touch-pan': ['x', 'left', 'right'] 34194 }], 34195 /** 34196 * Touch Action Y 34197 * @see https://tailwindcss.com/docs/touch-action 34198 */ 34199 'touch-y': [{ 34200 'touch-pan': ['y', 'up', 'down'] 34201 }], 34202 /** 34203 * Touch Action Pinch Zoom 34204 * @see https://tailwindcss.com/docs/touch-action 34205 */ 34206 'touch-pz': ['touch-pinch-zoom'], 34207 /** 34208 * User Select 34209 * @see https://tailwindcss.com/docs/user-select 34210 */ 34211 select: [{ 34212 select: ['none', 'text', 'all', 'auto'] 34213 }], 34214 /** 34215 * Will Change 34216 * @see https://tailwindcss.com/docs/will-change 34217 */ 34218 'will-change': [{ 34219 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue] 34220 }], 34221 // ----------- 34222 // --- SVG --- 34223 // ----------- 34224 /** 34225 * Fill 34226 * @see https://tailwindcss.com/docs/fill 34227 */ 34228 fill: [{ 34229 fill: ['none', ...scaleColor()] 34230 }], 34231 /** 34232 * Stroke Width 34233 * @see https://tailwindcss.com/docs/stroke-width 34234 */ 34235 'stroke-w': [{ 34236 stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber] 34237 }], 34238 /** 34239 * Stroke 34240 * @see https://tailwindcss.com/docs/stroke 34241 */ 34242 stroke: [{ 34243 stroke: ['none', ...scaleColor()] 34244 }], 34245 // --------------------- 34246 // --- Accessibility --- 34247 // --------------------- 34248 /** 34249 * Forced Color Adjust 34250 * @see https://tailwindcss.com/docs/forced-color-adjust 34251 */ 34252 'forced-color-adjust': [{ 34253 'forced-color-adjust': ['auto', 'none'] 34254 }] 34255 }, 34256 conflictingClassGroups: { 34257 overflow: ['overflow-x', 'overflow-y'], 34258 overscroll: ['overscroll-x', 'overscroll-y'], 34259 inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'], 34260 'inset-x': ['right', 'left'], 34261 'inset-y': ['top', 'bottom'], 34262 flex: ['basis', 'grow', 'shrink'], 34263 gap: ['gap-x', 'gap-y'], 34264 p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'], 34265 px: ['pr', 'pl'], 34266 py: ['pt', 'pb'], 34267 m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'], 34268 mx: ['mr', 'ml'], 34269 my: ['mt', 'mb'], 34270 size: ['w', 'h'], 34271 'font-size': ['leading'], 34272 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'], 34273 'fvn-ordinal': ['fvn-normal'], 34274 'fvn-slashed-zero': ['fvn-normal'], 34275 'fvn-figure': ['fvn-normal'], 34276 'fvn-spacing': ['fvn-normal'], 34277 'fvn-fraction': ['fvn-normal'], 34278 'line-clamp': ['display', 'overflow'], 34279 rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'], 34280 'rounded-s': ['rounded-ss', 'rounded-es'], 34281 'rounded-e': ['rounded-se', 'rounded-ee'], 34282 'rounded-t': ['rounded-tl', 'rounded-tr'], 34283 'rounded-r': ['rounded-tr', 'rounded-br'], 34284 'rounded-b': ['rounded-br', 'rounded-bl'], 34285 'rounded-l': ['rounded-tl', 'rounded-bl'], 34286 'border-spacing': ['border-spacing-x', 'border-spacing-y'], 34287 'border-w': ['border-w-
34287s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'], 34288 'border-w-x': ['border-w-r', 'border-w-l'], 34289 'border-w-y': ['border-w-t', 'border-w-b'], 34290 'border-color': ['border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'], 34291 'border-color-x': ['border-color-r', 'border-color-l'], 34292 'border-color-y': ['border-color-t', 'border-color-b'], 34293 translate: ['translate-x', 'translate-y', 'translate-none'], 34294 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'], 34295 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'], 34296 'scroll-mx': ['scroll-mr', 'scroll-ml'], 34297 'scroll-my': ['scroll-mt', 'scroll-mb'], 34298 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'], 34299 'scroll-px': ['scroll-pr', 'scroll-pl'], 34300 'scroll-py': ['scroll-pt', 'scroll-pb'], 34301 touch: ['touch-x', 'touch-y', 'touch-pz'], 34302 'touch-x': ['touch'], 34303 'touch-y': ['touch'], 34304 'touch-pz': ['touch'] 34305 }, 34306 conflictingClassGroupModifiers: { 34307 'font-size': ['leading'] 34308 }, 34309 orderSensitiveModifiers: ['before', 'after', 'placeholder', 'file', 'marker', 'selection', 'first-line', 'first-letter', 'backdrop', '*', '**'] 34310 }; 34311}; 34312 34313/** 34314 * @param baseConfig Config where other config will be merged into. This object will be mutated. 34315 * @param configExtension Partial config to merge into the `baseConfig`. 34316 */ 34317const mergeConfigs = (baseConfig, {
vendor: 2,334 bytes, lines 34318-34372
34318 cacheSize, 34319 prefix, 34320 experimentalParseClassName, 34321 extend = {}, 34322 override = {} 34323}) => { 34324 overrideProperty(baseConfig, 'cacheSize', cacheSize); 34325 overrideProperty(baseConfig, 'prefix', prefix); 34326 overrideProperty(baseConfig, 'experimentalParseClassName', experimentalParseClassName); 34327 overrideConfigProperties(baseConfig.theme, override.theme); 34328 overrideConfigProperties(baseConfig.classGroups, override.classGroups); 34329 overrideConfigProperties(baseConfig.conflictingClassGroups, override.conflictingClassGroups); 34330 overrideConfigProperties(baseConfig.conflictingClassGroupModifiers, override.conflictingClassGroupModifiers); 34331 overrideProperty(baseConfig, 'orderSensitiveModifiers', override.orderSensitiveModifiers); 34332 mergeConfigProperties(baseConfig.theme, extend.theme); 34333 mergeConfigProperties(baseConfig.classGroups, extend.classGroups); 34334 mergeConfigProperties(baseConfig.conflictingClassGroups, extend.conflictingClassGroups); 34335 mergeConfigProperties(baseConfig.conflictingClassGroupModifiers, extend.conflictingClassGroupModifiers); 34336 mergeArrayProperties(baseConfig, extend, 'orderSensitiveModifiers'); 34337 return baseConfig; 34338}; 34339const overrideProperty = (baseObject, overrideKey, overrideValue) => { 34340 if (overrideValue !== undefined) { 34341 baseObject[overrideKey] = overrideValue; 34342 } 34343}; 34344const overrideConfigProperties = (baseObject, overrideObject) => { 34345 if (overrideObject) { 34346 for (const key in overrideObject) { 34347 overrideProperty(baseObject, key, overrideObject[key]); 34348 } 34349 } 34350}; 34351const mergeConfigProperties = (baseObject, mergeObject) => { 34352 if (mergeObject) { 34353 for (const key in mergeObject) { 34354 mergeArrayProperties(baseObject, mergeObject, key); 34355 } 34356 } 34357}; 34358const mergeArrayProperties = (baseObject, mergeObject, key) => { 34359 const mergeValue = mergeObject[key]; 34360 if (mergeValue !== undefined) { 34361 baseObject[key] = baseObject[key] ? baseObject[key].concat(mergeValue) : mergeValue; 34362 } 34363}; 34364const extendTailwindMerge = (configExtension, ...createConfig) => typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig); 34365const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig); 34366 34367//# sourceMappingURL=bundle-mjs.mjs.map 34368 34369 34370/***/ }) 34371 34372}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.