@learncard/react 2.6.79 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/dist/cjs/{CertificateDisplayCard-2283f3de.js → CertificateDisplayCard-74de3c56.js} +72 -52
  2. package/dist/cjs/CertificateDisplayCard-74de3c56.js.map +1 -0
  3. package/dist/{esm/numeral-804ed0c4.js → cjs/CircleIcon-5587a585.js} +97 -2
  4. package/dist/cjs/CircleIcon-5587a585.js.map +1 -0
  5. package/dist/cjs/{User-dde46685.js → Coins-acd63f46.js} +1 -85
  6. package/dist/cjs/Coins-acd63f46.js.map +1 -0
  7. package/dist/cjs/{Notification-0bc2680c.js → Notification-d212fa7b.js} +2 -2
  8. package/dist/cjs/{Notification-0bc2680c.js.map → Notification-d212fa7b.js.map} +1 -1
  9. package/dist/cjs/{NotificationBoostCard-194ae55a.js → NotificationBoostCard-70dfa17e.js} +2 -2
  10. package/dist/cjs/{NotificationBoostCard-194ae55a.js.map → NotificationBoostCard-70dfa17e.js.map} +1 -1
  11. package/dist/cjs/PuzzlePiece-937c216a.js +31 -0
  12. package/dist/cjs/PuzzlePiece-937c216a.js.map +1 -0
  13. package/dist/cjs/{react-barcode-1a2c5694.js → SchoolIDCard-c7b4153a.js} +61 -1185
  14. package/dist/cjs/SchoolIDCard-c7b4153a.js.map +1 -0
  15. package/dist/cjs/User-301088ac.js +93 -0
  16. package/dist/cjs/User-301088ac.js.map +1 -0
  17. package/dist/cjs/{VCCard-55f7738e.js → VCCard-98ab4879.js} +4 -31
  18. package/dist/{esm/VCCard-caeb4bbd.js.map → cjs/VCCard-98ab4879.js.map} +1 -1
  19. package/dist/cjs/{VCDisplayBackFace-42f41d3f.js → VCDisplayBackFace-a3cd6ad2.js} +3 -3
  20. package/dist/cjs/{VCDisplayBackFace-42f41d3f.js.map → VCDisplayBackFace-a3cd6ad2.js.map} +1 -1
  21. package/dist/cjs/{VCDisplayCard-3c50142e.js → VCDisplayCard-f0783ca4.js} +3 -3
  22. package/dist/cjs/{VCDisplayCard-3c50142e.js.map → VCDisplayCard-f0783ca4.js.map} +1 -1
  23. package/dist/cjs/{VCDisplayCard2-de2f603c.js → VCDisplayCard2-e09f4a0a.js} +272 -39
  24. package/dist/cjs/VCDisplayCard2-e09f4a0a.js.map +1 -0
  25. package/dist/cjs/VCVerificationPill-43201cac.js +75 -0
  26. package/dist/cjs/VCVerificationPill-43201cac.js.map +1 -0
  27. package/dist/cjs/{constants-93a826a5.js → constants-3359aea1.js} +52 -2
  28. package/dist/cjs/constants-3359aea1.js.map +1 -0
  29. package/dist/cjs/{credential.helpers-adf7af7c.js → credential.helpers-ccf9ea86.js} +8 -48
  30. package/dist/cjs/{credential.helpers-adf7af7c.js.map → credential.helpers-ccf9ea86.js.map} +1 -1
  31. package/dist/cjs/index-838fa72c.js +1186 -0
  32. package/dist/cjs/index-838fa72c.js.map +1 -0
  33. package/dist/cjs/index.js +35 -34
  34. package/dist/cjs/index.js.map +1 -1
  35. package/dist/cjs/index13.js +35 -34
  36. package/dist/cjs/index13.js.map +1 -1
  37. package/dist/cjs/index22.js +5 -3
  38. package/dist/cjs/index22.js.map +1 -1
  39. package/dist/cjs/index23.js +5 -3
  40. package/dist/cjs/index23.js.map +1 -1
  41. package/dist/cjs/index28.js +3 -5
  42. package/dist/cjs/index28.js.map +1 -1
  43. package/dist/cjs/index29.js +2 -2
  44. package/dist/cjs/index35.js +3 -2
  45. package/dist/cjs/index35.js.map +1 -1
  46. package/dist/cjs/index36.js +17 -79
  47. package/dist/cjs/index36.js.map +1 -1
  48. package/dist/cjs/index37.js +6 -85
  49. package/dist/cjs/index37.js.map +1 -1
  50. package/dist/cjs/index38.js +9 -86
  51. package/dist/cjs/index38.js.map +1 -1
  52. package/dist/cjs/index39.js +10 -79
  53. package/dist/cjs/index39.js.map +1 -1
  54. package/dist/cjs/index40.js +1 -87
  55. package/dist/cjs/index40.js.map +1 -1
  56. package/dist/cjs/index43.js +2 -1
  57. package/dist/cjs/index43.js.map +1 -1
  58. package/dist/cjs/index6.js +10 -82
  59. package/dist/cjs/index6.js.map +1 -1
  60. package/dist/cjs/index8.js +1 -2
  61. package/dist/cjs/index8.js.map +1 -1
  62. package/dist/cjs/{types-7f6324ea.js → types-8eab1382.js} +6 -26
  63. package/dist/cjs/types-8eab1382.js.map +1 -0
  64. package/dist/{esm/VCVerificationPill-2c48beee.js → cjs/types.esm-2ec4fa7e.js} +3 -63
  65. package/dist/cjs/types.esm-2ec4fa7e.js.map +1 -0
  66. package/dist/esm/{CertificateDisplayCard-711f2e93.js → CertificateDisplayCard-b3c93952.js} +66 -46
  67. package/dist/esm/CertificateDisplayCard-b3c93952.js.map +1 -0
  68. package/dist/{cjs/numeral-d057158c.js → esm/CircleIcon-b527bf95.js} +89 -3
  69. package/dist/esm/CircleIcon-b527bf95.js.map +1 -0
  70. package/dist/esm/{User-9f253521.js → Coins-ed119ec6.js} +2 -83
  71. package/dist/esm/Coins-ed119ec6.js.map +1 -0
  72. package/dist/esm/{Notification-78a215ff.js → Notification-95d159d2.js} +2 -2
  73. package/dist/esm/{Notification-78a215ff.js.map → Notification-95d159d2.js.map} +1 -1
  74. package/dist/esm/{NotificationBoostCard-9e7197eb.js → NotificationBoostCard-e614c341.js} +2 -2
  75. package/dist/esm/{NotificationBoostCard-9e7197eb.js.map → NotificationBoostCard-e614c341.js.map} +1 -1
  76. package/dist/esm/PuzzlePiece-1fb12c2e.js +25 -0
  77. package/dist/esm/PuzzlePiece-1fb12c2e.js.map +1 -0
  78. package/dist/esm/{react-barcode-150610c2.js → SchoolIDCard-01422d53.js} +60 -1184
  79. package/dist/esm/SchoolIDCard-01422d53.js.map +1 -0
  80. package/dist/esm/User-161c7f37.js +85 -0
  81. package/dist/esm/User-161c7f37.js.map +1 -0
  82. package/dist/esm/{VCCard-caeb4bbd.js → VCCard-b0347a85.js} +4 -31
  83. package/dist/{cjs/VCCard-55f7738e.js.map → esm/VCCard-b0347a85.js.map} +1 -1
  84. package/dist/esm/{VCDisplayBackFace-e13869e2.js → VCDisplayBackFace-1a581f1c.js} +3 -3
  85. package/dist/esm/{VCDisplayBackFace-e13869e2.js.map → VCDisplayBackFace-1a581f1c.js.map} +1 -1
  86. package/dist/esm/{VCDisplayCard-04dcc183.js → VCDisplayCard-ac914ce3.js} +3 -3
  87. package/dist/esm/{VCDisplayCard-04dcc183.js.map → VCDisplayCard-ac914ce3.js.map} +1 -1
  88. package/dist/esm/{VCDisplayCard2-e2e1d9f1.js → VCDisplayCard2-b0f44405.js} +251 -19
  89. package/dist/esm/VCDisplayCard2-b0f44405.js.map +1 -0
  90. package/dist/esm/VCVerificationPill-3e38a718.js +65 -0
  91. package/dist/esm/VCVerificationPill-3e38a718.js.map +1 -0
  92. package/dist/esm/constants-f2a32f0c.js +107 -0
  93. package/dist/esm/constants-f2a32f0c.js.map +1 -0
  94. package/dist/esm/{credential.helpers-20680b00.js → credential.helpers-c06a1aa8.js} +5 -45
  95. package/dist/esm/{credential.helpers-20680b00.js.map → credential.helpers-c06a1aa8.js.map} +1 -1
  96. package/dist/esm/index-4fa491c1.js +1184 -0
  97. package/dist/esm/index-4fa491c1.js.map +1 -0
  98. package/dist/esm/index.js +26 -26
  99. package/dist/esm/index13.js +26 -26
  100. package/dist/esm/index22.js +5 -3
  101. package/dist/esm/index22.js.map +1 -1
  102. package/dist/esm/index23.js +5 -3
  103. package/dist/esm/index23.js.map +1 -1
  104. package/dist/esm/index28.js +2 -4
  105. package/dist/esm/index28.js.map +1 -1
  106. package/dist/esm/index29.js +2 -2
  107. package/dist/esm/index35.js +2 -1
  108. package/dist/esm/index35.js.map +1 -1
  109. package/dist/esm/index36.js +17 -79
  110. package/dist/esm/index36.js.map +1 -1
  111. package/dist/esm/index37.js +6 -85
  112. package/dist/esm/index37.js.map +1 -1
  113. package/dist/esm/index38.js +9 -86
  114. package/dist/esm/index38.js.map +1 -1
  115. package/dist/esm/index39.js +9 -78
  116. package/dist/esm/index39.js.map +1 -1
  117. package/dist/esm/index40.js +1 -87
  118. package/dist/esm/index40.js.map +1 -1
  119. package/dist/esm/index43.js +2 -1
  120. package/dist/esm/index43.js.map +1 -1
  121. package/dist/esm/index6.js +9 -82
  122. package/dist/esm/index6.js.map +1 -1
  123. package/dist/esm/index8.js +1 -2
  124. package/dist/esm/index8.js.map +1 -1
  125. package/dist/esm/{types-c31e4bae.js → types-cfde3c2b.js} +5 -24
  126. package/dist/esm/types-cfde3c2b.js.map +1 -0
  127. package/dist/{cjs/VCVerificationPill-b4b96a9f.js → esm/types.esm-8f6a5623.js} +2 -75
  128. package/dist/esm/types.esm-8f6a5623.js.map +1 -0
  129. package/dist/index.d.ts +10 -1
  130. package/dist/main.css +1 -1
  131. package/dist/main.js +1 -1
  132. package/package.json +1 -1
  133. package/dist/cjs/CertificateDisplayCard-2283f3de.js.map +0 -1
  134. package/dist/cjs/CircleIcon-dace003c.js +0 -98
  135. package/dist/cjs/CircleIcon-dace003c.js.map +0 -1
  136. package/dist/cjs/RoundedSquare-fc16f13f.js +0 -58
  137. package/dist/cjs/RoundedSquare-fc16f13f.js.map +0 -1
  138. package/dist/cjs/SchoolIDCard-44ef96bd.js +0 -68
  139. package/dist/cjs/SchoolIDCard-44ef96bd.js.map +0 -1
  140. package/dist/cjs/User-dde46685.js.map +0 -1
  141. package/dist/cjs/VCDisplayCard2-de2f603c.js.map +0 -1
  142. package/dist/cjs/VCVerificationPill-b4b96a9f.js.map +0 -1
  143. package/dist/cjs/constants-93a826a5.js.map +0 -1
  144. package/dist/cjs/index.es-05e5f438.js +0 -194
  145. package/dist/cjs/index.es-05e5f438.js.map +0 -1
  146. package/dist/cjs/numeral-d057158c.js.map +0 -1
  147. package/dist/cjs/react-barcode-1a2c5694.js.map +0 -1
  148. package/dist/cjs/types-7f6324ea.js.map +0 -1
  149. package/dist/esm/CertificateDisplayCard-711f2e93.js.map +0 -1
  150. package/dist/esm/CircleIcon-b45511e1.js +0 -91
  151. package/dist/esm/CircleIcon-b45511e1.js.map +0 -1
  152. package/dist/esm/RoundedSquare-0d25f9ef.js +0 -52
  153. package/dist/esm/RoundedSquare-0d25f9ef.js.map +0 -1
  154. package/dist/esm/SchoolIDCard-91bade9a.js +0 -62
  155. package/dist/esm/SchoolIDCard-91bade9a.js.map +0 -1
  156. package/dist/esm/User-9f253521.js.map +0 -1
  157. package/dist/esm/VCDisplayCard2-e2e1d9f1.js.map +0 -1
  158. package/dist/esm/VCVerificationPill-2c48beee.js.map +0 -1
  159. package/dist/esm/constants-ee2b8bc3.js +0 -59
  160. package/dist/esm/constants-ee2b8bc3.js.map +0 -1
  161. package/dist/esm/index.es-0cc0c240.js +0 -187
  162. package/dist/esm/index.es-0cc0c240.js.map +0 -1
  163. package/dist/esm/numeral-804ed0c4.js.map +0 -1
  164. package/dist/esm/react-barcode-150610c2.js.map +0 -1
  165. package/dist/esm/types-c31e4bae.js.map +0 -1
@@ -1,13 +1,14 @@
1
- import React, { useRef, useEffect, useState, useLayoutEffect } from 'react';
2
- import { h, v } from './index.es-0cc0c240.js';
1
+ import React, { useRef, useEffect, useState, createContext, Component, Children, cloneElement, useLayoutEffect } from 'react';
2
+ import './index-4fa491c1.js';
3
3
  import { a as VCVerificationCheckWithSpinner } from './VCVerificationCheck-80249524.js';
4
4
  import DefaultFace from './default-face.jpeg';
5
- import { g as getColorForVerificationStatus, j as format, h as getNameFromProfile, i as getImageFromProfile, k as getCategoryColor, a as getInfoFromCredential } from './credential.helpers-20680b00.js';
6
- import { g as getBaseUrl, c as VideoIcon, d as Camera, G as GenericDocumentIcon, L as LinkIcon, p as prettyBytes, e as capitalize, X, E as ExclamationPoint, A as AcuteCheckmark, I as InfoIcon, f as LeftArrow, h as SkillsBox, i as AlignmentsBox, t as truncateWithEllipsis, P as PersonBadge, j as VerifiedBadge, U as UnknownVerifierBadge, R as RedFlag, a as CertificateDisplayCard, V as VCDisplayCardSkillsCount } from './CertificateDisplayCard-711f2e93.js';
5
+ import { a as getColorForVerificationStatus, j as format$1, h as getNameFromProfile, i as getImageFromProfile, k as getCategoryColor, g as getTotalCountOfSkills, c as categorizeSkills, b as getInfoFromCredential } from './credential.helpers-c06a1aa8.js';
6
+ import { g as getBaseUrl, V as VideoIcon, d as Camera, G as GenericDocumentIcon, L as LinkIcon, p as prettyBytes, e as capitalize, X, E as ExclamationPoint, A as AcuteCheckmark, I as InfoIcon, f as LeftArrow, h as SkillsBox, i as AlignmentsBox, t as truncateWithEllipsis, P as PersonBadge, j as VerifiedBadge, U as UnknownVerifierBadge, R as RedFlag, b as CertificateDisplayCard } from './CertificateDisplayCard-b3c93952.js';
7
7
  import { L as Lightbox } from './Lightbox-a1aab9ea.js';
8
- import { a as VerificationStatusEnum } from './VCVerificationPill-2c48beee.js';
8
+ import { V as VerificationStatusEnum } from './types.esm-8f6a5623.js';
9
9
  import { I as IDIcon, Q as QRCodeIcon, A as AwardRibbon } from './QRCodeIcon-e9569804.js';
10
10
  import { a as LCCategoryEnum } from './index-43f63ea7.js';
11
+ import { P as PuzzlePiece } from './PuzzlePiece-1fb12c2e.js';
11
12
  import IDSleeve from './id-sleeve.png';
12
13
  import './CaretRightFilled.svg';
13
14
  import 'react-dom';
@@ -103,7 +104,10 @@ const InfoBox = ({ text, handleClose, backgroundColor = "#6366F1" }) => {
103
104
  className: "info-box p-[10px] rounded-[10px] w-full font-poppins text-[12px] leading[18px]",
104
105
  style: { backgroundColor: bgColorWithOpacity }
105
106
  }, text, " ", /* @__PURE__ */ React.createElement("button", {
106
- onClick: handleClose,
107
+ onClick: (e) => {
108
+ e.stopPropagation();
109
+ handleClose();
110
+ },
107
111
  className: "text-indigo-500 font-[700] select-none"
108
112
  }, "Close"));
109
113
  };
@@ -291,7 +295,10 @@ const MediaAttachmentsBox = ({
291
295
  return /* @__PURE__ */ React.createElement("button", {
292
296
  key: index,
293
297
  className,
294
- onClick: () => handleMediaAttachmentClick(media.url, media.type)
298
+ onClick: (e) => {
299
+ e.stopPropagation();
300
+ handleMediaAttachmentClick(media.url, media.type);
301
+ }
295
302
  }, innerContent);
296
303
  }
297
304
  return /* @__PURE__ */ React.createElement("div", {
@@ -322,21 +329,26 @@ const MediaAttachmentsBox = ({
322
329
  href: docOrLink.url,
323
330
  target: "_blank",
324
331
  rel: "noreferrer",
325
- className: "text-grayscale-600 font-[600] px-[5px] hover:underline"
332
+ className: "text-grayscale-600 font-[600] px-[5px] hover:underline",
333
+ onClick: (e) => e.stopPropagation()
326
334
  }, fileExtension && /* @__PURE__ */ React.createElement("span", {
327
335
  className: "uppercase"
328
336
  }, fileExtension), fileExtension && (numberOfPages || sizeInBytes) && " \u2022 ", numberOfPages && /* @__PURE__ */ React.createElement("span", null, numberOfPages, " page", numberOfPages === 1 ? "" : "s"), numberOfPages && sizeInBytes && " \u2022 ", sizeInBytes && /* @__PURE__ */ React.createElement("span", null, prettyBytes(sizeInBytes))), docOrLink.type === "link" && /* @__PURE__ */ React.createElement("a", {
329
337
  href: docOrLink.url,
330
338
  target: "_blank",
331
339
  rel: "noreferrer",
332
- className: "text-indigo-500 font-[600] px-[5px] hover:underline"
340
+ className: "text-indigo-500 font-[600] px-[5px] hover:underline",
341
+ onClick: (e) => e.stopPropagation()
333
342
  }, baseUrl));
334
343
  const className = `row-attachment ${docOrLink.type} bg-grayscale-100 rounded-[15px] p-[10px] w-full font-poppins text-[12px] leading-[18px] tracking-[-0.33px] text-left`;
335
344
  if (onMediaAttachmentClick) {
336
345
  return /* @__PURE__ */ React.createElement("button", {
337
346
  key: index,
338
347
  className,
339
- onClick: () => handleMediaAttachmentClick(docOrLink.url, docOrLink.type)
348
+ onClick: (e) => {
349
+ e.stopPropagation();
350
+ handleMediaAttachmentClick(docOrLink.url, docOrLink.type);
351
+ }
340
352
  }, innerContent);
341
353
  }
342
354
  return /* @__PURE__ */ React.createElement("div", {
@@ -428,10 +440,16 @@ const TruncateTextBox = ({
428
440
  className: `text-[12px] text-grayscale-700 leading-[18px] font-poppins font-[400] mb-0 ${textClassName}`
429
441
  }, displayText, truncated && /* @__PURE__ */ React.createElement(React.Fragment, null, "...", " ", /* @__PURE__ */ React.createElement("button", {
430
442
  className: "text-indigo-500 font-[700]",
431
- onClick: () => setShowFullText(true)
443
+ onClick: (e) => {
444
+ e.stopPropagation();
445
+ setShowFullText(true);
446
+ }
432
447
  }, "More")), needsTruncate && showFullText && /* @__PURE__ */ React.createElement(React.Fragment, null, " ", /* @__PURE__ */ React.createElement("button", {
433
448
  className: "text-indigo-500 font-[700]",
434
- onClick: () => setShowFullText(false)
449
+ onClick: (e) => {
450
+ e.stopPropagation();
451
+ setShowFullText(false);
452
+ }
435
453
  }, "Close"))), children);
436
454
  };
437
455
 
@@ -477,7 +495,10 @@ const VerificationsBox = ({ verificationItems }) => {
477
495
  className: "text-[20px] leading-[20px] text-grayscale-900"
478
496
  }, "Credential Verifications"), /* @__PURE__ */ React.createElement("button", {
479
497
  className: "absolute top-[17px] right-[17px]",
480
- onClick: () => setShowInfo(!showInfo)
498
+ onClick: (e) => {
499
+ e.stopPropagation();
500
+ setShowInfo(!showInfo);
501
+ }
481
502
  }, /* @__PURE__ */ React.createElement(InfoIcon, {
482
503
  color: showInfo ? "#6366F1" : void 0
483
504
  })), showInfo && /* @__PURE__ */ React.createElement(InfoBox, {
@@ -505,7 +526,7 @@ const VC2BackFace = ({
505
526
  enableLightbox
506
527
  }) => {
507
528
  var _a, _b, _c, _d;
508
- const expiration = credential.expirationDate ? format(new Date(credential.expirationDate), "MMM dd, yyyy") : void 0;
529
+ const expiration = credential.expirationDate ? format$1(new Date(credential.expirationDate), "MMM dd, yyyy") : void 0;
509
530
  const isExpired = credential.expirationDate && Number(new Date(credential.expirationDate)) < Number(new Date());
510
531
  const achievement = "achievement" in credential.credentialSubject ? credential.credentialSubject.achievement : void 0;
511
532
  const criteria = (_a = achievement == null ? void 0 : achievement.criteria) == null ? void 0 : _a.narrative;
@@ -612,6 +633,188 @@ const VC2FrontFaceInfo = ({
612
633
  }, issuerName))))));
613
634
  };
614
635
 
636
+ /*! @license Rematrix v0.2.2
637
+
638
+ Copyright 2018 Fisssion LLC.
639
+
640
+ Permission is hereby granted, free of charge, to any person obtaining a copy
641
+ of this software and associated documentation files (the "Software"), to deal
642
+ in the Software without restriction, including without limitation the rights
643
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
644
+ copies of the Software, and to permit persons to whom the Software is
645
+ furnished to do so, subject to the following conditions:
646
+
647
+ The above copyright notice and this permission notice shall be included in
648
+ all copies or substantial portions of the Software.
649
+
650
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
651
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
652
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
653
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
654
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
655
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
656
+ THE SOFTWARE.
657
+ */
658
+ /**
659
+ * @module Rematrix
660
+ */
661
+
662
+ /**
663
+ * Transformation matrices in the browser come in two flavors:
664
+ *
665
+ * - `matrix` using 6 values (short)
666
+ * - `matrix3d` using 16 values (long)
667
+ *
668
+ * This utility follows this [conversion guide](https://goo.gl/EJlUQ1)
669
+ * to expand short form matrices to their equivalent long form.
670
+ *
671
+ * @param {array} source - Accepts both short and long form matrices.
672
+ * @return {array}
673
+ */
674
+ function format(source) {
675
+ if (source.constructor !== Array) {
676
+ throw new TypeError('Expected array.')
677
+ }
678
+ if (source.length === 16) {
679
+ return source
680
+ }
681
+ if (source.length === 6) {
682
+ var matrix = identity();
683
+ matrix[0] = source[0];
684
+ matrix[1] = source[1];
685
+ matrix[4] = source[2];
686
+ matrix[5] = source[3];
687
+ matrix[12] = source[4];
688
+ matrix[13] = source[5];
689
+ return matrix
690
+ }
691
+ throw new RangeError('Expected array with either 6 or 16 values.')
692
+ }
693
+
694
+ /**
695
+ * Returns a matrix representing no transformation. The product of any matrix
696
+ * multiplied by the identity matrix will be the original matrix.
697
+ *
698
+ * > **Tip:** Similar to how `5 * 1 === 5`, where `1` is the identity.
699
+ *
700
+ * @return {array}
701
+ */
702
+ function identity() {
703
+ var matrix = [];
704
+ for (var i = 0; i < 16; i++) {
705
+ i % 5 == 0 ? matrix.push(1) : matrix.push(0);
706
+ }
707
+ return matrix
708
+ }
709
+
710
+ /**
711
+ * Returns a 4x4 matrix describing the combined transformations
712
+ * of both arguments.
713
+ *
714
+ * > **Note:** Order is very important. For example, rotating 45°
715
+ * along the Z-axis, followed by translating 500 pixels along the
716
+ * Y-axis... is not the same as translating 500 pixels along the
717
+ * Y-axis, followed by rotating 45° along on the Z-axis.
718
+ *
719
+ * @param {array} m - Accepts both short and long form matrices.
720
+ * @param {array} x - Accepts both short and long form matrices.
721
+ * @return {array}
722
+ */
723
+ function multiply(m, x) {
724
+ var fm = format(m);
725
+ var fx = format(x);
726
+ var product = [];
727
+
728
+ for (var i = 0; i < 4; i++) {
729
+ var row = [fm[i], fm[i + 4], fm[i + 8], fm[i + 12]];
730
+ for (var j = 0; j < 4; j++) {
731
+ var k = j * 4;
732
+ var col = [fx[k], fx[k + 1], fx[k + 2], fx[k + 3]];
733
+ var result =
734
+ row[0] * col[0] + row[1] * col[1] + row[2] * col[2] + row[3] * col[3];
735
+
736
+ product[i + k] = result;
737
+ }
738
+ }
739
+
740
+ return product
741
+ }
742
+
743
+ /**
744
+ * Attempts to return a 4x4 matrix describing the CSS transform
745
+ * matrix passed in, but will return the identity matrix as a
746
+ * fallback.
747
+ *
748
+ * **Tip:** In virtually all cases, this method is used to convert
749
+ * a CSS matrix (retrieved as a `string` from computed styles) to
750
+ * its equivalent array format.
751
+ *
752
+ * @param {string} source - String containing a valid CSS `matrix` or `matrix3d` property.
753
+ * @return {array}
754
+ */
755
+ function parse(source) {
756
+ if (typeof source === 'string') {
757
+ var match = source.match(/matrix(3d)?\(([^)]+)\)/);
758
+ if (match) {
759
+ var raw = match[2].split(', ').map(parseFloat);
760
+ return format(raw)
761
+ }
762
+ }
763
+ return identity()
764
+ }
765
+
766
+ /**
767
+ * Returns a 4x4 matrix describing X-axis scaling.
768
+ *
769
+ * @param {number} scalar - Decimal multiplier.
770
+ * @return {array}
771
+ */
772
+ function scaleX(scalar) {
773
+ var matrix = identity();
774
+ matrix[0] = scalar;
775
+ return matrix
776
+ }
777
+
778
+ /**
779
+ * Returns a 4x4 matrix describing Y-axis scaling.
780
+ *
781
+ * @param {number} scalar - Decimal multiplier.
782
+ * @return {array}
783
+ */
784
+ function scaleY(scalar) {
785
+ var matrix = identity();
786
+ matrix[5] = scalar;
787
+ return matrix
788
+ }
789
+
790
+ /**
791
+ * Returns a 4x4 matrix describing X-axis translation.
792
+ *
793
+ * @param {number} distance - Measured in pixels.
794
+ * @return {array}
795
+ */
796
+ function translateX(distance) {
797
+ var matrix = identity();
798
+ matrix[12] = distance;
799
+ return matrix
800
+ }
801
+
802
+ /**
803
+ * Returns a 4x4 matrix describing Y-axis translation.
804
+ *
805
+ * @param {number} distance - Measured in pixels.
806
+ * @return {array}
807
+ */
808
+ function translateY(distance) {
809
+ var matrix = identity();
810
+ matrix[13] = distance;
811
+ return matrix
812
+ }
813
+
814
+ var e=function(t){return "number"==typeof t},i=function(t){return "function"==typeof t},n=function(t){return "[object Object]"===Object.prototype.toString.call(t)},r=function(t){return Array.prototype.slice.apply(t)},s$1=function(t){var e=t.reduce(function(t,e){return t[e]=(t[e]||0)+1,t},{});return Object.keys(e).filter(function(t){return e[t]>1})};function a(t){return [].slice.call(arguments,1).forEach(function(e){if(e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);}),t}var o,l=function(t,e,i){return t+(e-t)*i},p={__proto__:null,isNumber:e,isFunction:i,isObject:n,toArray:r,getDuplicateValsAsStrings:s$1,assign:a,tweenProp:l},c$1="data-flip-id",u$1="data-inverse-flip-id",d$1="data-portal-key",f$1="data-exit-container",h$1={__proto__:null,DATA_FLIP_ID:c$1,DATA_INVERSE_FLIP_ID:u$1,DATA_FLIP_COMPONENT_ID:"data-flip-component-id",DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:d$1,DATA_EXIT_CONTAINER:f$1},g$1={noWobble:{stiffness:200,damping:26},gentle:{stiffness:120,damping:14},veryGentle:{stiffness:130,damping:17},wobbly:{stiffness:180,damping:12},stiff:{stiffness:260,damping:26}},m$1=function(t){return n(t)?t:Object.keys(g$1).indexOf(t)>-1?g$1[t]:{}};"undefined"!=typeof window&&(o=window.requestAnimationFrame);var v$1=o=o||function(t){window.setTimeout(t,1e3/60);},y$1=Date.now(),_="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()-y$1};function S(t,e){var i=t.indexOf(e);-1!==i&&t.splice(i,1);}var E=/*#__PURE__*/function(){function t(){}return t.prototype.run=function(){var t=this;v$1(function(){t.springSystem.loop(_());});},t}(),A=function(){this.position=0,this.velocity=0;},C=0,b=.001,I=/*#__PURE__*/function(){function t(t){this._id="s"+C++,this._springSystem=t,this.listeners=[],this._startValue=0,this._currentState=new A,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new A,this._restSpeedThreshold=.001,this._tempState=new A,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={};}var e=t.prototype;return e.getId=function(){return this._id},e.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this);},e.setSpringConfig=function(t){return this._springConfig=t,this},e.getCurrentValue=function(){return this._currentState.position},e.getDisplacementDistanceForState=function(t){return Math.abs(this._endValue-t.position)},e.setEndValue=function(t){if(t===this._endValue)return this;if(this.prevEndValue=t,this._endValue===t&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=t,this._springSystem.activateSpring(this.getId());for(var e=0,i=this.listeners.length;e<i;e++){var n=this.listeners[e].onSpringEndStateChange;n&&n(this);}return this},e.setVelocity=function(t){return t===this._currentState.velocity||(this._currentState.velocity=t,this._springSystem.activateSpring(this.getId())),this},e.setCurrentValue=function(t){this._startValue=t,this._currentState.position=t;for(var e=0,i=this.listeners.length;e<i;e++){var n=this.listeners[e];n.onSpringUpdate&&n.onSpringUpdate(this);}return this},e.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},e.setOvershootClampingEnabled=function(t){return this._overshootClampingEnabled=t,this},e.isOvershooting=function(){var t=this._startValue,e=this._endValue;return this._springConfig.tension>0&&(t<e&&this.getCurrentValue()>e||t>e&&this.getCurrentValue()<e)},e.advance=function(t,e){var i=this.isAtRest();if(!i||!this._wasAtRest){var n=e;e>.064&&(n=.064),this._timeAccumulator+=n;for(var r,s,a,o,l,p,c=this._springConfig.tension,u=this._springConfig.friction,d=this._currentState.position,f=this._currentState.velocity,h=this._tempState.position,g=this._tempState.velocity;this._timeAccumulator>=b;)this._timeAccumulator-=b,this._timeAccumulator<b&&(this._previousState.position=d,this._previousState.velocity=f),s=c*(this._endValue-h)-u*f,o=c*(this._endValue-(h=d+(r=f)*b*.5))-u*(g=f+s*b*.5),p=c*(this._endValue-(h=d+(a=g)*b*.5))-u*(g=f+o*b*.5),h=d+(l=g)*b,d+=1/6*(r+2*(a+l)+(g=f+p*b))*b,f+=1/6*(s+2*(o+p)+(c*(this._endValue-h)-u*g))*b;this._tempState.position=h,this._tempState.velocity=g,this._currentState.position=d,this._currentState.velocity=f,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/b),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),i=!0);var m=!1;this._wasAtRest&&(this._wasAtRest=!1,m=!0);var v=!1;i&&(this._wasAtRest=!0,v=!0),this.notifyPositionUpdated(m,v);}},e.notifyPositionUpdated=function(t,e){var i=this;this.listeners.filter(Boolean).forEach(function(n){t&&n.onSpringActivate&&!i._onActivateCalled&&(n.onSpringActivate(i),i._onActivateCalled=!0),n.onSpringUpdate&&n.onSpringUpdate(i),e&&n.onSpringAtRest&&n.onSpringAtRest(i);});},e.systemShouldAdvance=function(){return !this.isAtRest()||!this.wasAtRest()},e.wasAtRest=function(){return this._wasAtRest},e.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||0===this._springConfig.tension)},e._interpolate=function(t){this._currentState.position=this._currentState.position*t+this._previousState.position*(1-t),this._currentState.velocity=this._currentState.velocity*t+this._previousState.velocity*(1-t);},e.addListener=function(t){return this.listeners.push(t),this},e.addOneTimeListener=function(t){var e=this;return Object.keys(t).forEach(function(i){var n;t[i]=(n=t[i],function(){n.apply(void 0,[].slice.call(arguments)),e.removeListener(t);});}),this.listeners.push(t),this},e.removeListener=function(t){return S(this.listeners,t),this},t}(),w=/*#__PURE__*/function(){function t(t){this.looper=t||new E,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={};}var e=t.prototype;return e.createSpring=function(t,e){return this.createSpringWithConfig({tension:t,friction:e})},e.createSpringWithConfig=function(t){var e=new I(this);return this.registerSpring(e),e.setSpringConfig(t),e},e.getIsIdle=function(){return this._isIdle},e.registerSpring=function(t){this._springRegistry[t.getId()]=t;},e.deregisterSpring=function(t){S(this._activeSprings,t),delete this._springRegistry[t.getId()];},e.advance=function(t,e){for(var i=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(n){n.systemShouldAdvance()?n.advance(t/1e3,e/1e3):i._idleSpringIndices.push(i._activeSprings.indexOf(n));});this._idleSpringIndices.length>0;){var n=this._idleSpringIndices.pop();n>=0&&this._activeSprings.splice(n,1);}},e.loop=function(t){var e;-1===this._lastTimeMillis&&(this._lastTimeMillis=t-1);var i=t-this._lastTimeMillis;this._lastTimeMillis=t;var n=0,r=this.listeners.length;for(n=0;n<r;n++)(e=this.listeners[n]).onBeforeIntegrate&&e.onBeforeIntegrate(this);for(this.advance(t,i),0===this._activeSprings.length&&(this._isIdle=!0,this._lastTimeMillis=-1),n=0;n<r;n++)(e=this.listeners[n]).onAfterIntegrate&&e.onAfterIntegrate(this);this._isIdle||this.looper.run();},e.activateSpring=function(t){var e=this._springRegistry[t];-1===this._activeSprings.indexOf(e)&&this._activeSprings.push(e),this.getIsIdle()&&(this._isIdle=!1,this.looper.run());},t}(),O=new w,x=function(t){var e=t.springConfig,i=e.overshootClamping,n=t.getOnUpdateFunc,r=t.onAnimationEnd,s=t.onSpringActivate,a=O.createSpring(e.stiffness,e.damping);a.setOvershootClampingEnabled(!!i);var o={onSpringActivate:s,onSpringAtRest:function(){a.destroy(),r();},onSpringUpdate:n({spring:a,onAnimationEnd:r})};return a.addListener(o),a},U=function(t){var e=x(t);return e.setEndValue(1),e},V=function(t,e){if(void 0===e&&(e={}),t&&t.length){e.reverse&&t.reverse();var i,n="number"!=typeof(i=e.speed)?1.1:1+Math.min(Math.max(5*i,0),5),r=1/Math.max(Math.min(t.length,100),10),s=t.map(function(t,e){var i=t.getOnUpdateFunc;return t.getOnUpdateFunc=function(t){var a=i(t);return function(t){var i=t.getCurrentValue();(i=i<.01?0:i>.99?1:i)>=r&&s[e+1]&&s[e+1](Math.max(Math.min(i*n,1),0)),a(t);}},t}).map(function(t){var e=x(t);if(e)return e.setEndValue.bind(e)}).filter(Boolean);s[0]&&s[0](1);}},F=function(t){return [0,1,4,5,12,13].map(function(e){return t[e]})},P=function(t){return t.top<window.innerHeight&&t.bottom>0&&t.left<window.innerWidth&&t.right>0};function D(t){return JSON.parse(t.dataset.flipConfig||"{}")}var R=function(t,e){var i;return a(t,((i={})[e[0]]=e[1],i))},T=function(t,e){return r(e?document.querySelectorAll("["+d$1+'="'+e+'"]'):t.querySelectorAll("["+c$1+"]"))},M=function(t){return t.map(function(t){return [t,t.getBoundingClientRect()]})},L=function(n){var o=n.cachedOrderedFlipIds,p=void 0===o?[]:o,f=n.inProgressAnimations,h=void 0===f?{}:f,v=n.flippedElementPositionsBeforeUpdate,y=void 0===v?{}:v,_=n.flipCallbacks,S=void 0===_?{}:_,E=n.containerEl,A=n.applyTransformOrigin,C=n.spring,b=n.debug,I=n.portalKey,w=n.staggerConfig,O=void 0===w?{}:w,x=n.decisionData,j=void 0===x?{}:x,B=n.handleEnterUpdateDelete,N=n.onComplete,L=n.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var q,X=M(T((q={element:E,portalKey:I}).element,q.portalKey)).map(function(t){var e=t[0],i=t[1],n=window.getComputedStyle(e);return [e.dataset.flipId,{element:e,rect:i,opacity:parseFloat(n.opacity),transform:n.transform}]}).reduce(R,{}),Y=function(t){var e=t.containerEl,i=t.portalKey;return i?function(t){return function(e){return r(document.querySelectorAll("["+d$1+'="'+t+'"]'+e))}}(i):e?function(t){var e=Math.random().toFixed(5);return t.dataset.flipperId=e,function(i){return r(t.querySelectorAll('[data-flipper-id="'+e+'"] '+i))}}(e):function(){return []}}({containerEl:E,portalKey:I}),W=function(t){return function(e){return t("["+c$1+'="'+e+'"]')[0]}}(Y),K=function(t){return y[t]&&X[t]},H=Object.keys(y).concat(Object.keys(X)).filter(function(t){return !K(t)}),J={flipCallbacks:S,getElement:W,flippedElementPositionsBeforeUpdate:y,flippedElementPositionsAfterUpdate:X,inProgressAnimations:h,decisionData:j},z=function(t){var e,i=t.unflippedIds,n=t.flipCallbacks,r=t.getElement,s=t.flippedElementPositionsBeforeUpdate,a=t.flippedElementPositionsAfterUpdate,o=t.inProgressAnimations,l=t.decisionData,p=i.filter(function(t){return a[t]}).filter(function(t){return n[t]&&n[t].onAppear}),c=i.filter(function(t){return s[t]&&n[t]&&n[t].onExit}),u=new Promise(function(t){e=t;}),d=[],f=0,h=c.map(function(t,i){var r=s[t].domDataForExitAnimations,a=r.element,p=r.parent,c=r.childPosition,u=c.top,h=c.left,g=c.width,m=c.height;"static"===getComputedStyle(p).position&&(p.style.position="relative"),a.style.transform="matrix(1, 0, 0, 1, 0, 0)",a.style.position="absolute",a.style.top=u+"px",a.style.left=h+"px",a.style.height=m+"px",a.style.width=g+"px";var v=d.filter(function(t){return t[0]===p})[0];v||(v=[p,document.createDocumentFragment()],d.push(v)),v[1].appendChild(a),f+=1;var y=function(){try{p.removeChild(a);}catch(t){}finally{0==(f-=1)&&e();}};return o[t]={stop:y},function(){return n[t].onExit(a,i,y,l)}});return d.forEach(function(t){t[0].appendChild(t[1]);}),h.length||e(),{hideEnteringElements:function(){p.forEach(function(t){var e=r(t);e&&(e.style.opacity="0");});},animateEnteringElements:function(){p.forEach(function(t,e){var i=r(t);i&&n[t].onAppear(i,e,l);});},animateExitingElements:function(){return h.forEach(function(t){return t()}),u}}}(a({},J,{unflippedIds:H})),G=z.hideEnteringElements,Q=z.animateEnteringElements,Z=z.animateExitingElements,$=a({},J,{containerEl:E,flippedIds:p.filter(K),applyTransformOrigin:A,spring:C,debug:b,staggerConfig:O,scopedSelector:Y,onComplete:N});L&&L(E,j);var tt=function(n){var o,p=n.flippedIds,c=n.flipCallbacks,d=n.inProgressAnimations,f=n.flippedElementPositionsBeforeUpdate,h=n.flippedElementPositionsAfterUpdate,v=n.applyTransformOrigin,y=n.spring,_=n.getElement,S=n.debug,E=n.staggerConfig,A=void 0===E?{}:E,C=n.decisionData,b=void 0===C?{}:C,I=n.onComplete,w=n.containerEl,O=new Promise(function(t){o=t;});if(I&&O.then(function(){return I(w,b)}),!p.length)return function(){return o([]),O};var x=[],R=_(p[0]),T=R?R.ownerDocument.querySelector("body"):document.querySelector("body");s$1(p);var M=p.map(function(n){var s=f[n].rect,p=h[n].rect,_=f[n].opacity,S=h[n].opacity,E=p.width<1||p.height<1,A=h[n].element;if(!P(s)&&!P(p))return !1;if(!A)return !1;var C,I,w,O=D(A),U=(w=(I=void 0===(C={flipperSpring:y,flippedSpring:O.spring})?{}:C).flippedSpring,a({},g$1.noWobble,m$1(I.flipperSpring),m$1(w))),V=!0===O.stagger?"default":O.stagger,R={element:A,id:n,stagger:V,springConfig:U};if(c[n]&&c[n].shouldFlip&&!c[n].shouldFlip(b.previous,b.current))return !1;var k=Math.abs(s.left-p.left)+Math.abs(s.top-p.top),j=Math.abs(s.width-p.width)+Math.abs(s.height-p.height),B=Math.abs(S-_);if(0===s.height&&0===p.height||0===s.width&&0===p.width||k<.5&&j<.5&&B<.01)return !1;var N=parse(h[n].transform),L={matrix:N},q={matrix:[]},X=[N];O.translate&&(X.push(translateX(s.left-p.left)),X.push(translateY(s.top-p.top))),O.scale&&(X.push(scaleX(Math.max(s.width,1)/Math.max(p.width,1))),X.push(scaleY(Math.max(s.height,1)/Math.max(p.height,1)))),O.opacity&&(q.opacity=_,L.opacity=S);var Y=[];if(!c[n]||!c[n].shouldInvert||c[n].shouldInvert(b.previous,b.current)){var W=function(t,e){return r(t.querySelectorAll("["+u$1+'="'+e+'"]'))}(A,n);Y=W.map(function(t){return [t,D(t)]});}q.matrix=F(X.reduce(multiply)),L.matrix=F(L.matrix);var K,H=function(t){var i=t.element,n=t.invertedChildren,r=t.body;return function(t){var s=t.matrix,a=t.opacity,o=t.forceMinVals;if(e(a)&&(i.style.opacity=a+""),o&&(i.style.minHeight="1px",i.style.minWidth="1px"),s){var l=function(t){return "matrix("+t.join(", ")+")"}(s);i.style.transform=l,n&&function(t){var e=t.matrix,i=t.body;t.invertedChildren.forEach(function(t){var n=t[0],r=t[1];if(i.contains(n)){var s=e[0],a=e[3],o=e[5],l={translateX:0,translateY:0,scaleX:1,scaleY:1},p="";r.translate&&(l.translateX=-e[4]/s,l.translateY=-o/a,p+="translate("+l.translateX+"px, "+l.translateY+"px)"),r.scale&&(l.scaleX=1/s,l.scaleY=1/a,p+=" scale("+l.scaleX+", "+l.scaleY+")"),n.style.transform=p;}});}({invertedChildren:n,matrix:s,body:r});}}}({element:A,invertedChildren:Y,body:T});if(c[n]&&c[n].onComplete){var J=c[n].onComplete;K=function(){return J(A,b)};}var z=e(q.opacity)&&e(L.opacity)&&q.opacity!==L.opacity,G=!1;return a({},R,{stagger:V,springConfig:U,getOnUpdateFunc:function(t){var e=t.spring,i=t.onAnimationEnd;return d[n]={destroy:e.destroy.bind(e),onAnimationEnd:i},function(t){c[n]&&c[n].onSpringUpdate&&c[n].onSpringUpdate(t.getCurrentValue()),G||(G=!0,c[n]&&c[n].onStart&&c[n].onStart(A,b));var e=t.getCurrentValue();if(T.contains(A)){var i={matrix:[]};i.matrix=q.matrix.map(function(t,i){return l(t,L.matrix[i],e)}),z&&(i.opacity=l(q.opacity,L.opacity,e)),H(i);}else t.destroy();}},initializeFlip:function(){H({matrix:q.matrix,opacity:z?q.opacity:void 0,forceMinVals:E}),c[n]&&c[n].onStartImmediate&&c[n].onStartImmediate(A,b),O.transformOrigin?A.style.transformOrigin=O.transformOrigin:v&&(A.style.transformOrigin="0 0"),Y.forEach(function(t){var e=t[0],i=t[1];i.transformOrigin?e.style.transformOrigin=i.transformOrigin:v&&(e.style.transformOrigin="0 0");});},onAnimationEnd:function(t){delete d[n],i(K)&&K(),A.style.transform="",Y.forEach(function(t){t[0].style.transform="";}),E&&A&&(A.style.minHeight="",A.style.minWidth=""),t||(x.push(n),x.length>=M.length&&o(x));},delayUntil:O.delayUntil})}).filter(Boolean);if(M.forEach(function(t){return (0, t.initializeFlip)()}),S)return function(){};var k=M.filter(function(t){return t.delayUntil&&(e=t.delayUntil,M.filter(function(t){return t.id===e}).length);var e;}),j={},B={},N={};k.forEach(function(t){t.stagger?(N[t.stagger]=!0,B[t.delayUntil]?B[t.delayUntil].push(t.stagger):B[t.delayUntil]=[t.stagger]):j[t.delayUntil]?j[t.delayUntil].push(t):j[t.delayUntil]=[t];});var L=M.filter(function(t){return t.stagger}).reduce(function(t,e){return t[e.stagger]?t[e.stagger].push(e):t[e.stagger]=[e],t},{}),q=M.filter(function(t){return -1===k.indexOf(t)});return q.forEach(function(t){t.onSpringActivate=function(){j[t.id]&&j[t.id].forEach(U),B[t.id]&&Object.keys(B[t.id].reduce(function(t,e){var i;return a(t,((i={})[e]=!0,i))},{})).forEach(function(t){V(L[t],A[t]);});};}),function(){return M.length||o([]),q.filter(function(t){return !t.stagger}).forEach(U),Object.keys(L).forEach(function(t){N[t]||V(L[t],A[t]);}),O}}($);B?B({hideEnteringElements:G,animateEnteringElements:Q,animateExitingElements:Z,animateFlippedElements:tt}):(G(),Z().then(Q),tt());}},q=function(t){var e=t.element,i=t.flipCallbacks,n=void 0===i?{}:i,s=t.inProgressAnimations,o=void 0===s?{}:s,l=T(e,t.portalKey),p=r(e.querySelectorAll("["+u$1+"]")),c={},d=[],h={};l.filter(function(t){return n&&n[t.dataset.flipId]&&n[t.dataset.flipId].onExit}).forEach(function(t){var e=t.parentNode;if(t.closest){var i=t.closest("["+f$1+"]");i&&(e=i);}var n=d.findIndex(function(t){return t[0]===e});-1===n&&(d.push([e,e.getBoundingClientRect()]),n=d.length-1),c[t.dataset.flipId]=d[n][1],h[t.dataset.flipId]=e;});var g=M(l),m=g.map(function(t){var e=t[0],i=t[1],r={};if(n&&n[e.dataset.flipId]&&n[e.dataset.flipId].onExit){var s=c[e.dataset.flipId];a(r,{element:e,parent:h[e.dataset.flipId],childPosition:{top:i.top-s.top,left:i.left-s.left,width:i.width,height:i.height}});}return [e.dataset.flipId,{rect:i,opacity:parseFloat(window.getComputedStyle(e).opacity||"1"),domDataForExitAnimations:r}]}).reduce(R,{});return function(t,e){Object.keys(t).forEach(function(e){t[e].destroy&&t[e].destroy(),t[e].onAnimationEnd&&t[e].onAnimationEnd(!0),delete t[e];}),e.forEach(function(t){t.style.transform="",t.style.opacity="";});}(o,l.concat(p)),{flippedElementPositions:m,cachedOrderedFlipIds:g.map(function(t){return t[0].dataset.flipId})}};new w;
815
+
816
+ function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},s.apply(this,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function d(e,t){if(null==e)return {};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}var f=/*#__PURE__*/createContext({}),u=/*#__PURE__*/createContext("portal"),h=/*#__PURE__*/function(r){var n,o;function p(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return (e=r.call.apply(r,[this].concat(n))||this).inProgressAnimations={},e.flipCallbacks={},e.el=void 0,e}o=r,(n=p).prototype=Object.create(o.prototype),n.prototype.constructor=n,c(n,o);var l=p.prototype;return l.getSnapshotBeforeUpdate=function(t){return t.flipKey!==this.props.flipKey&&this.el?q({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},l.componentDidUpdate=function(e,r,n){this.props.flipKey!==e.flipKey&&this.el&&L({flippedElementPositionsBeforeUpdate:n.flippedElementPositions,cachedOrderedFlipIds:n.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:e.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart});},l.render=function(){var e=this,t=this.props,r=t.portalKey,n=/*#__PURE__*/React.createElement(f.Provider,{value:this.flipCallbacks},/*#__PURE__*/React.createElement(t.element,{className:t.className,ref:function(t){return e.el=t}},this.props.children));return r&&(n=/*#__PURE__*/React.createElement(u.Provider,{value:r},n)),n},p}(Component);h.defaultProps={applyTransformOrigin:!0,element:"div"};var m=["children","flipId","inverseFlipId","portalKey"],y=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],g=function(e){var t,i=e.children,o=e.flipId,p$1=e.inverseFlipId,s=e.portalKey,c=d(e,m),f=i,u=function(e){return "function"==typeof e}(f);if(!u)try{f=Children.only(i);}catch(e){throw new Error("Each Flipped component must wrap a single child")}c.scale||c.translate||c.opacity||p.assign(c,{translate:!0,scale:!0,opacity:!0});var h=((t={})[h$1.DATA_FLIP_CONFIG]=JSON.stringify(c),t);return void 0!==o?h[h$1.DATA_FLIP_ID]=String(o):p$1&&(h[h$1.DATA_INVERSE_FLIP_ID]=String(p$1)),void 0!==s&&(h[h$1.DATA_PORTAL_KEY]=s),u?f(h):/*#__PURE__*/cloneElement(f,h)},v=function(e){var t=e.children,n=e.flipId,o=e.shouldFlip,p$1=e.shouldInvert,l=e.onAppear,a=e.onStart,c=e.onStartImmediate,h=e.onComplete,m=e.onExit,v=e.onSpringUpdate,I=d(e,y);return t?I.inverseFlipId?/*#__PURE__*/React.createElement(g,s({},I),t):/*#__PURE__*/React.createElement(u.Consumer,null,function(e){return React.createElement(f.Consumer,null,function(d){return p.isObject(d)&&n&&(d[n]={shouldFlip:o,shouldInvert:p$1,onAppear:l,onStart:a,onStartImmediate:c,onComplete:h,onExit:m,onSpringUpdate:v}),/*#__PURE__*/React.createElement(g,s({flipId:n},I,{portalKey:e}),t)})}):null};v.displayName="Flipped";
817
+
615
818
  const VCDisplayCardCategoryType = ({
616
819
  categoryType = LCCategoryEnum.achievement
617
820
  }) => {
@@ -621,6 +824,28 @@ const VCDisplayCardCategoryType = ({
621
824
  }, categoryType);
622
825
  };
623
826
 
827
+ const VCDisplayCardSkillsCount = ({ skills, onClick }) => {
828
+ const skillsCount = getTotalCountOfSkills(skills);
829
+ if (skillsCount === 0)
830
+ return /* @__PURE__ */ React.createElement(React.Fragment, null);
831
+ const skillsMap = categorizeSkills(skills);
832
+ const totalSkills = Object.values(skillsMap).reduce((total2, category) => total2 + (category == null ? void 0 : category.length), 0);
833
+ const totalSubskills = Object.values(skillsMap).reduce((total2, category) => total2 + ((category == null ? void 0 : category.totalSubskillsCount) || 0), 0);
834
+ const total = totalSkills + totalSubskills;
835
+ const text = skillsCount === 1 ? "Skill" : "Skills";
836
+ return /* @__PURE__ */ React.createElement("div", {
837
+ className: "flex items-center justify-center mt-8 cursor-pointer px-4 py-2 bg-white rounded-[20px] shadow-bottom",
838
+ onClick
839
+ }, /* @__PURE__ */ React.createElement("div", {
840
+ className: "text-violet-500 text-xl flex items-center justify-center tracking-[0.75px] font-poppins font-semibold"
841
+ }, "+", total, " ", text, " ", /* @__PURE__ */ React.createElement("div", {
842
+ className: "bg-violet-500 rounded-full flex items-center justify-center ml-2 h-[30px] w-[30px] p-1"
843
+ }, /* @__PURE__ */ React.createElement(PuzzlePiece, {
844
+ className: "text-white",
845
+ fill: "#fff"
846
+ }))));
847
+ };
848
+
624
849
  const VERIFIER_STATES = {
625
850
  selfVerified: "Self Verified",
626
851
  trustedVerifier: "Trusted Verifier",
@@ -666,7 +891,10 @@ const VCIDDisplayFrontFace = ({
666
891
  }), " ID"), /* @__PURE__ */ React.createElement("div", {
667
892
  className: "w-full relative"
668
893
  }, !hideQRCode && /* @__PURE__ */ React.createElement("button", {
669
- onClick: () => qrCodeOnClick == null ? void 0 : qrCodeOnClick(),
894
+ onClick: (e) => {
895
+ e.stopPropagation();
896
+ qrCodeOnClick == null ? void 0 : qrCodeOnClick();
897
+ },
670
898
  className: "text-grayscale-900 bg-white rounded-full p-[10px] absolute top-[-10px] right-[45%]"
671
899
  }, /* @__PURE__ */ React.createElement(QRCodeIcon, {
672
900
  className: "text-grayscale-900 "
@@ -754,7 +982,9 @@ const VCIDDisplayCard = ({
754
982
  className: `vc-display-card font-mouse flex flex-col items-center border-solid border-white rounded-[30px] z-10 max-w-[400px] relative bg-white shadow-3xl ${isFront ? "" : "min-h-[800px]"}`
755
983
  }, /* @__PURE__ */ React.createElement("div", {
756
984
  className: "relative vc-card-content-container flex flex-col items-center grow min-h-0 w-full rounded-t-[30px] rounded-b-[30px] overflow-hidden",
757
- style: backgroundStyle
985
+ style: backgroundStyle,
986
+ role: "button",
987
+ onClick: () => setIsFront(!isFront)
758
988
  }, /* @__PURE__ */ React.createElement(v, {
759
989
  flipId: "scroll-container"
760
990
  }, /* @__PURE__ */ React.createElement("div", {
@@ -928,7 +1158,9 @@ const VCDisplayCard2 = ({
928
1158
  }, /* @__PURE__ */ React.createElement(v, {
929
1159
  flipId: "card"
930
1160
  }, /* @__PURE__ */ React.createElement("section", {
931
- className: "vc-display-card font-mouse flex flex-col items-center border-solid border-[5px] border-white rounded-[30px] z-10 min-h-[800px] max-w-[400px] relative bg-white shadow-3xl"
1161
+ className: "vc-display-card font-mouse flex flex-col items-center border-solid border-[5px] border-white rounded-[30px] z-10 min-h-[800px] max-w-[400px] relative bg-white shadow-3xl",
1162
+ role: "button",
1163
+ onClick: () => setIsFront(!isFront)
932
1164
  }, /* @__PURE__ */ React.createElement(RibbonEnd, {
933
1165
  side: "left",
934
1166
  className: "absolute left-[-30px] top-[50px] z-0",
@@ -1027,5 +1259,5 @@ const VCDisplayCard2 = ({
1027
1259
  }, (_g = bottomRightIcon == null ? void 0 : bottomRightIcon.image) != null ? _g : /* @__PURE__ */ React.createElement(AwardRibbon, null)))))));
1028
1260
  };
1029
1261
 
1030
- export { VCDisplayCard2 as V, VCIDDisplayCard as a };
1031
- //# sourceMappingURL=VCDisplayCard2-e2e1d9f1.js.map
1262
+ export { VCDisplayCard2 as V, VCDisplayCardSkillsCount as a, VCIDDisplayCard as b };
1263
+ //# sourceMappingURL=VCDisplayCard2-b0f44405.js.map