@orbit-software/sdk 1.10.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 (189) hide show
  1. package/dist/esm/Overlay.d.ts +2 -0
  2. package/dist/esm/app/helpers.d.ts +2 -0
  3. package/dist/esm/app/ui/assets/IconBack.d.ts +1 -0
  4. package/dist/esm/app/ui/assets/IconClosePlain.d.ts +3 -0
  5. package/dist/esm/app/ui/components/AvatarProgress.d.ts +13 -0
  6. package/dist/esm/app/ui/components/ClosableModal.d.ts +11 -0
  7. package/dist/esm/app/ui/components/IconBalance.d.ts +3 -0
  8. package/dist/esm/app/ui/components/InputSwitch.d.ts +9 -0
  9. package/dist/esm/app/ui/components/Inventory/Inventory.d.ts +2 -0
  10. package/dist/esm/app/ui/components/Inventory/context.d.ts +10 -0
  11. package/dist/esm/app/ui/components/XsButton.d.ts +6 -0
  12. package/dist/esm/app/ui/hooks/useAnimateNumber.d.ts +1 -0
  13. package/dist/esm/app/utils.d.ts +2 -0
  14. package/dist/esm/boolean-D78EXBUO.mjs +1986 -0
  15. package/dist/esm/bootstrap.d.ts +1 -0
  16. package/dist/esm/features/profile/assets/IconAd.d.ts +1 -0
  17. package/dist/esm/features/profile/assets/IconAddCircle.d.ts +1 -0
  18. package/dist/esm/features/profile/assets/IconCurrencyStar.d.ts +3 -0
  19. package/dist/esm/features/profile/assets/IconDrag.d.ts +2 -0
  20. package/dist/esm/features/profile/assets/IconEdit.d.ts +2 -0
  21. package/dist/esm/features/profile/assets/IconGame.d.ts +2 -0
  22. package/dist/esm/features/profile/assets/IconNoSign.d.ts +1 -0
  23. package/dist/esm/features/profile/assets/IconProfile.d.ts +1 -0
  24. package/dist/esm/features/profile/assets/moneyTongue.json.d.ts +3 -0
  25. package/dist/esm/features/profile/assets/newspaper.json.d.ts +3 -0
  26. package/dist/esm/features/profile/assets/profileBgGradients.d.ts +6 -0
  27. package/dist/esm/features/profile/components/Avatars.d.ts +8 -0
  28. package/dist/esm/features/profile/components/BalanceConfetti.d.ts +6 -0
  29. package/dist/esm/features/profile/components/BuyMenu.d.ts +8 -0
  30. package/dist/esm/features/profile/components/CircleParticles.d.ts +10 -0
  31. package/dist/esm/features/profile/components/FormattedXP.d.ts +8 -0
  32. package/dist/esm/features/profile/components/LevelInfoModal.d.ts +9 -0
  33. package/dist/esm/features/profile/components/ModalContainer.d.ts +6 -0
  34. package/dist/esm/features/profile/components/OverlayProfile.d.ts +8 -0
  35. package/dist/esm/features/profile/components/Profile.d.ts +3 -0
  36. package/dist/esm/features/profile/components/PurchaseConfirm.d.ts +9 -0
  37. package/dist/esm/features/profile/components/Ribbon.d.ts +6 -0
  38. package/dist/esm/features/profile/components/StarParticles.d.ts +10 -0
  39. package/dist/esm/features/profile/components/TaskCard.d.ts +21 -0
  40. package/dist/esm/features/profile/components/XpProgress.d.ts +14 -0
  41. package/dist/esm/features/profile/hooks/useAnimatedProfile.d.ts +5 -0
  42. package/dist/esm/gaussian-splat-compression-CzzkTP3L.mjs +1632 -0
  43. package/dist/esm/hooks/useForceRerender.d.ts +1 -0
  44. package/dist/esm/hooks/useMiniApp.d.ts +3 -0
  45. package/dist/esm/howler-Mh6LB0k5.mjs +572 -0
  46. package/dist/esm/i18n/index.d.ts +2 -0
  47. package/dist/esm/i18n/locales/translations/en.json.d.ts +213 -0
  48. package/dist/esm/i18n/locales/translations/ru.json.d.ts +210 -0
  49. package/dist/esm/launcherSrc/App.d.ts +2 -0
  50. package/dist/esm/launcherSrc/api/client.d.ts +3 -0
  51. package/dist/esm/launcherSrc/api/types.d.ts +181 -0
  52. package/dist/esm/launcherSrc/api/userApi.d.ts +22 -0
  53. package/dist/esm/launcherSrc/app/components/DebugConsole.d.ts +2 -0
  54. package/dist/esm/launcherSrc/app/contexts/SnackbarContext.d.ts +18 -0
  55. package/dist/esm/launcherSrc/app/helpers.d.ts +5 -0
  56. package/dist/esm/launcherSrc/app/hooks/forceRerender.d.ts +1 -0
  57. package/dist/esm/launcherSrc/app/hooks/useMainButtonControl.d.ts +7 -0
  58. package/dist/esm/launcherSrc/app/hooks/useMiniApp.d.ts +3 -0
  59. package/dist/esm/launcherSrc/app/hooks.d.ts +11 -0
  60. package/dist/esm/launcherSrc/app/store.d.ts +19 -0
  61. package/dist/esm/launcherSrc/app/ui/assets/IconBack.d.ts +1 -0
  62. package/dist/esm/launcherSrc/app/ui/assets/IconCheck.d.ts +2 -0
  63. package/dist/esm/launcherSrc/app/ui/assets/IconCheckThin.d.ts +2 -0
  64. package/dist/esm/launcherSrc/app/ui/assets/IconCross.d.ts +2 -0
  65. package/dist/esm/launcherSrc/app/ui/assets/IconSearch.d.ts +2 -0
  66. package/dist/esm/launcherSrc/app/ui/components/AvatarProgress.d.ts +13 -0
  67. package/dist/esm/launcherSrc/app/ui/components/ClosableModal.d.ts +10 -0
  68. package/dist/esm/launcherSrc/app/ui/components/FormattedXP.d.ts +8 -0
  69. package/dist/esm/launcherSrc/app/ui/components/IconBalance.d.ts +3 -0
  70. package/dist/esm/launcherSrc/app/ui/components/InputSwitch.d.ts +9 -0
  71. package/dist/esm/launcherSrc/app/ui/components/Twemoji.d.ts +8 -0
  72. package/dist/esm/launcherSrc/app/ui/components/UICell.d.ts +16 -0
  73. package/dist/esm/launcherSrc/app/ui/components/UIDateInput.d.ts +21 -0
  74. package/dist/esm/launcherSrc/app/ui/components/UIDivider.d.ts +4 -0
  75. package/dist/esm/launcherSrc/app/ui/components/UIEmoji.d.ts +8 -0
  76. package/dist/esm/launcherSrc/app/ui/components/UIHero.d.ts +10 -0
  77. package/dist/esm/launcherSrc/app/ui/components/UISection.d.ts +9 -0
  78. package/dist/esm/launcherSrc/app/ui/components/UITextarea.d.ts +7 -0
  79. package/dist/esm/launcherSrc/app/ui/components/XpProgress.d.ts +13 -0
  80. package/dist/esm/launcherSrc/app/ui/components/XsButton.d.ts +6 -0
  81. package/dist/esm/launcherSrc/app/ui/hooks/useAnimateNumber.d.ts +1 -0
  82. package/dist/esm/launcherSrc/app/utils.d.ts +13 -0
  83. package/dist/esm/launcherSrc/assets/Icon28Edit.d.ts +2 -0
  84. package/dist/esm/launcherSrc/assets/Icon28Game.d.ts +1 -0
  85. package/dist/esm/launcherSrc/assets/Icon28Link.d.ts +1 -0
  86. package/dist/esm/launcherSrc/features/admin/components/Admin.d.ts +3 -0
  87. package/dist/esm/launcherSrc/features/admin/components/OverlayControl.d.ts +2 -0
  88. package/dist/esm/launcherSrc/features/games/assets/IconFilter.d.ts +1 -0
  89. package/dist/esm/launcherSrc/features/games/assets/IconPlayers.d.ts +2 -0
  90. package/dist/esm/launcherSrc/features/games/assets/IconQuestion.d.ts +2 -0
  91. package/dist/esm/launcherSrc/features/games/assets/IconQuestionCircle.d.ts +2 -0
  92. package/dist/esm/launcherSrc/features/games/assets/IconStar.d.ts +4 -0
  93. package/dist/esm/launcherSrc/features/games/assets/IconThumbsDownFilled.d.ts +2 -0
  94. package/dist/esm/launcherSrc/features/games/assets/IconThumbsDownOutlined.d.ts +2 -0
  95. package/dist/esm/launcherSrc/features/games/assets/IconThumbsUpFilled.d.ts +2 -0
  96. package/dist/esm/launcherSrc/features/games/assets/IconThumbsUpOutlined.d.ts +2 -0
  97. package/dist/esm/launcherSrc/features/games/components/GameItem.d.ts +10 -0
  98. package/dist/esm/launcherSrc/features/games/components/GamePage/GamePage.d.ts +6 -0
  99. package/dist/esm/launcherSrc/features/games/components/GamePage/GameReview.d.ts +10 -0
  100. package/dist/esm/launcherSrc/features/games/components/GamePage/GameReviews.d.ts +9 -0
  101. package/dist/esm/launcherSrc/features/games/components/Games.d.ts +3 -0
  102. package/dist/esm/launcherSrc/features/games/components/ResetStorageButton.d.ts +3 -0
  103. package/dist/esm/launcherSrc/features/games/components/ReviewModal.d.ts +10 -0
  104. package/dist/esm/launcherSrc/features/games/hooks/useGamesData.d.ts +13 -0
  105. package/dist/esm/launcherSrc/features/games/redux/gamesSlice.d.ts +34 -0
  106. package/dist/esm/launcherSrc/features/games/service/gamesService.d.ts +3 -0
  107. package/dist/esm/launcherSrc/features/leaderboard/components/Rating.d.ts +1 -0
  108. package/dist/esm/launcherSrc/features/leaderboard/components/RatingCard/RatingCard.d.ts +10 -0
  109. package/dist/esm/launcherSrc/features/leaderboard/components/RatingInfo/RatingInfo.d.ts +1 -0
  110. package/dist/esm/launcherSrc/features/leaderboard/components/RatingLevel/IconWreaths.d.ts +3 -0
  111. package/dist/esm/launcherSrc/features/leaderboard/components/RatingLevel/RatingLevel.d.ts +6 -0
  112. package/dist/esm/launcherSrc/features/leaderboard/components/RatingLevel/lock.d.ts +3 -0
  113. package/dist/esm/launcherSrc/features/leaderboard/hooks/useLeaderboardData.d.ts +10 -0
  114. package/dist/esm/launcherSrc/features/leaderboard/index.d.ts +1 -0
  115. package/dist/esm/launcherSrc/features/leaderboard/redux/leaderboardSlice.d.ts +18 -0
  116. package/dist/esm/launcherSrc/features/leaderboard/services/leaderboardService.d.ts +2 -0
  117. package/dist/esm/launcherSrc/features/navigation/assets/IconGame.d.ts +1 -0
  118. package/dist/esm/launcherSrc/features/navigation/assets/IconProfile.d.ts +1 -0
  119. package/dist/esm/launcherSrc/features/navigation/assets/IconSmile.d.ts +2 -0
  120. package/dist/esm/launcherSrc/features/navigation/components/FloatingProfile.d.ts +2 -0
  121. package/dist/esm/launcherSrc/features/navigation/components/IconWithCounter.d.ts +7 -0
  122. package/dist/esm/launcherSrc/features/navigation/redux/navigationSlice.d.ts +15 -0
  123. package/dist/esm/launcherSrc/features/navigation/redux/tabsSlice.d.ts +12 -0
  124. package/dist/esm/launcherSrc/features/profile/assets/IconAd.d.ts +1 -0
  125. package/dist/esm/launcherSrc/features/profile/assets/IconAddCircle.d.ts +1 -0
  126. package/dist/esm/launcherSrc/features/profile/assets/IconChevronRight.d.ts +2 -0
  127. package/dist/esm/launcherSrc/features/profile/assets/IconColorPicker.d.ts +1 -0
  128. package/dist/esm/launcherSrc/features/profile/assets/IconCurrencyStar.d.ts +3 -0
  129. package/dist/esm/launcherSrc/features/profile/assets/IconGlobe.d.ts +2 -0
  130. package/dist/esm/launcherSrc/features/profile/assets/IconLock.d.ts +2 -0
  131. package/dist/esm/launcherSrc/features/profile/assets/IconNoSign.d.ts +1 -0
  132. package/dist/esm/launcherSrc/features/profile/assets/IconSignature.d.ts +5 -0
  133. package/dist/esm/launcherSrc/features/profile/assets/profileBgGradients.d.ts +50 -0
  134. package/dist/esm/launcherSrc/features/profile/components/AdsFree/BuyAdsFreeButton.d.ts +3 -0
  135. package/dist/esm/launcherSrc/features/profile/components/AdsFree/PurchaseAdsFree.d.ts +9 -0
  136. package/dist/esm/launcherSrc/features/profile/components/Avatars/AvatarCreation.d.ts +2 -0
  137. package/dist/esm/launcherSrc/features/profile/components/Avatars/Avatars.d.ts +11 -0
  138. package/dist/esm/launcherSrc/features/profile/components/Avatars/EditAvatarButton.d.ts +1 -0
  139. package/dist/esm/launcherSrc/features/profile/components/Balance/ProfileBalance.d.ts +6 -0
  140. package/dist/esm/launcherSrc/features/profile/components/Balance/TopUpModal/BuyMenu.d.ts +8 -0
  141. package/dist/esm/launcherSrc/features/profile/components/Balance/TopUpModal/BuyOption.d.ts +10 -0
  142. package/dist/esm/launcherSrc/features/profile/components/Balance/TopUpModal/Ribbon.d.ts +6 -0
  143. package/dist/esm/launcherSrc/features/profile/components/BoxOpeningModal.d.ts +3 -0
  144. package/dist/esm/launcherSrc/features/profile/components/DailyModal.d.ts +3 -0
  145. package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FIllBirthdate.d.ts +3 -0
  146. package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FillCountry.d.ts +3 -0
  147. package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FillEmail.d.ts +3 -0
  148. package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FillProfile.d.ts +3 -0
  149. package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FillProfileLayout.d.ts +4 -0
  150. package/dist/esm/launcherSrc/features/profile/components/LevelInfoModal.d.ts +9 -0
  151. package/dist/esm/launcherSrc/features/profile/components/Profile.d.ts +3 -0
  152. package/dist/esm/launcherSrc/features/profile/components/ProfileGames.d.ts +6 -0
  153. package/dist/esm/launcherSrc/features/profile/components/ProfileInventory.d.ts +2 -0
  154. package/dist/esm/launcherSrc/features/profile/components/ProfileLeaderboard.d.ts +6 -0
  155. package/dist/esm/launcherSrc/features/profile/components/ProfileReviews.d.ts +6 -0
  156. package/dist/esm/launcherSrc/features/profile/components/ProfileTrophies.d.ts +2 -0
  157. package/dist/esm/launcherSrc/features/profile/components/Tasks/TaskCard.d.ts +24 -0
  158. package/dist/esm/launcherSrc/features/profile/components/Tasks/Tasks.d.ts +2 -0
  159. package/dist/esm/launcherSrc/features/profile/components/particles/BalanceConfetti.d.ts +6 -0
  160. package/dist/esm/launcherSrc/features/profile/components/particles/CircleParticles.d.ts +10 -0
  161. package/dist/esm/launcherSrc/features/profile/components/particles/ConfettiParticles.d.ts +10 -0
  162. package/dist/esm/launcherSrc/features/profile/components/particles/StarParticles.d.ts +10 -0
  163. package/dist/esm/launcherSrc/features/profile/contexts/BoxOpeningContext.d.ts +12 -0
  164. package/dist/esm/launcherSrc/features/profile/data/countries.d.ts +10 -0
  165. package/dist/esm/launcherSrc/features/profile/hooks/useProfileData.d.ts +26 -0
  166. package/dist/esm/launcherSrc/features/profile/redux/profileSlice.d.ts +131 -0
  167. package/dist/esm/launcherSrc/features/profile/redux/shopSlice.d.ts +18 -0
  168. package/dist/esm/launcherSrc/features/profile/services/buyMenuService.d.ts +1 -0
  169. package/dist/esm/launcherSrc/features/profile/services/profileService.d.ts +12 -0
  170. package/dist/esm/launcherSrc/features/profile/services/shopService.d.ts +2 -0
  171. package/dist/esm/launcherSrc/i18n/index.d.ts +2 -0
  172. package/dist/esm/launcherSrc/index.d.ts +0 -0
  173. package/dist/esm/launcherSrc/setupTests.d.ts +0 -0
  174. package/dist/esm/launcherSrc/utils/openTelegramLinkFixed.d.ts +1 -0
  175. package/dist/esm/navmesh-BbINhDrO.mjs +1336 -0
  176. package/dist/esm/opentype-PR7hcvG5.mjs +4286 -0
  177. package/dist/esm/physics-B9pWoHiG.mjs +4375 -0
  178. package/dist/esm/process-DGf1Bnd3.mjs +2274 -0
  179. package/dist/esm/sdk-4y_oRGP7.mjs +76474 -0
  180. package/dist/esm/sdk.d.ts +130 -0
  181. package/dist/esm/sdk.mjs +9 -0
  182. package/dist/esm/sdk.umd.js +8382 -0
  183. package/dist/esm/stores/profileStore.d.ts +16 -0
  184. package/dist/esm/ui-C32u2WA-.mjs +2678 -0
  185. package/dist/esm/utils/global.d.ts +1 -0
  186. package/dist/umd/sdk.umd.js +8382 -0
  187. package/dist/umd_react/sdk_react.umd.js +8562 -0
  188. package/index.html +13 -0
  189. package/package.json +96 -0
@@ -0,0 +1,4286 @@
1
+ var vn = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), bt = vn(() => {
2
+ });
3
+ String.prototype.codePointAt || function() {
4
+ var e = function() {
5
+ try {
6
+ var r = {}, n = Object.defineProperty, a = n(r, r, r) && n;
7
+ } catch {
8
+ }
9
+ return a;
10
+ }(), t = function(r) {
11
+ if (this == null) throw TypeError();
12
+ var n = String(this), a = n.length, o = r ? Number(r) : 0;
13
+ if (o != o && (o = 0), !(o < 0 || o >= a)) {
14
+ var s = n.charCodeAt(o), u;
15
+ return s >= 55296 && s <= 56319 && a > o + 1 && (u = n.charCodeAt(o + 1), u >= 56320 && u <= 57343) ? (s - 55296) * 1024 + u - 56320 + 65536 : s;
16
+ }
17
+ };
18
+ e ? e(String.prototype, "codePointAt", { value: t, configurable: !0, writable: !0 }) : String.prototype.codePointAt = t;
19
+ }();
20
+ var St = 0, xr = -3;
21
+ function Oe() {
22
+ this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
23
+ }
24
+ function gn(e, t) {
25
+ this.source = e, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = t, this.destLen = 0, this.ltree = new Oe(), this.dtree = new Oe();
26
+ }
27
+ var br = new Oe(), Sr = new Oe(), Et = new Uint8Array(30), Ct = new Uint16Array(30), Er = new Uint8Array(30), Cr = new Uint16Array(30), mn = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Lt = new Oe(), oe = new Uint8Array(320);
28
+ function Tr(e, t, r, n) {
29
+ var a, o;
30
+ for (a = 0; a < r; ++a) e[a] = 0;
31
+ for (a = 0; a < 30 - r; ++a) e[a + r] = a / r | 0;
32
+ for (o = n, a = 0; a < 30; ++a) t[a] = o, o += 1 << e[a];
33
+ }
34
+ function yn(e, t) {
35
+ var r;
36
+ for (r = 0; r < 7; ++r) e.table[r] = 0;
37
+ for (e.table[7] = 24, e.table[8] = 152, e.table[9] = 112, r = 0; r < 24; ++r) e.trans[r] = 256 + r;
38
+ for (r = 0; r < 144; ++r) e.trans[24 + r] = r;
39
+ for (r = 0; r < 8; ++r) e.trans[168 + r] = 280 + r;
40
+ for (r = 0; r < 112; ++r) e.trans[176 + r] = 144 + r;
41
+ for (r = 0; r < 5; ++r) t.table[r] = 0;
42
+ for (t.table[5] = 32, r = 0; r < 32; ++r) t.trans[r] = r;
43
+ }
44
+ var It = new Uint16Array(16);
45
+ function rt(e, t, r, n) {
46
+ var a, o;
47
+ for (a = 0; a < 16; ++a) e.table[a] = 0;
48
+ for (a = 0; a < n; ++a) e.table[t[r + a]]++;
49
+ for (e.table[0] = 0, o = 0, a = 0; a < 16; ++a) It[a] = o, o += e.table[a];
50
+ for (a = 0; a < n; ++a) t[r + a] && (e.trans[It[t[r + a]]++] = a);
51
+ }
52
+ function xn(e) {
53
+ e.bitcount-- || (e.tag = e.source[e.sourceIndex++], e.bitcount = 7);
54
+ var t = e.tag & 1;
55
+ return e.tag >>>= 1, t;
56
+ }
57
+ function se(e, t, r) {
58
+ if (!t) return r;
59
+ for (; e.bitcount < 24; ) e.tag |= e.source[e.sourceIndex++] << e.bitcount, e.bitcount += 8;
60
+ var n = e.tag & 65535 >>> 16 - t;
61
+ return e.tag >>>= t, e.bitcount -= t, n + r;
62
+ }
63
+ function ct(e, t) {
64
+ for (; e.bitcount < 24; ) e.tag |= e.source[e.sourceIndex++] << e.bitcount, e.bitcount += 8;
65
+ var r = 0, n = 0, a = 0, o = e.tag;
66
+ do
67
+ n = 2 * n + (o & 1), o >>>= 1, ++a, r += t.table[a], n -= t.table[a];
68
+ while (n >= 0);
69
+ return e.tag = o, e.bitcount -= a, t.trans[r + n];
70
+ }
71
+ function bn(e, t, r) {
72
+ var n, a, o, s, u, i;
73
+ for (n = se(e, 5, 257), a = se(e, 5, 1), o = se(e, 4, 4), s = 0; s < 19; ++s) oe[s] = 0;
74
+ for (s = 0; s < o; ++s) {
75
+ var p = se(e, 3, 0);
76
+ oe[mn[s]] = p;
77
+ }
78
+ for (rt(Lt, oe, 0, 19), u = 0; u < n + a; ) {
79
+ var l = ct(e, Lt);
80
+ switch (l) {
81
+ case 16:
82
+ var h = oe[u - 1];
83
+ for (i = se(e, 2, 3); i; --i) oe[u++] = h;
84
+ break;
85
+ case 17:
86
+ for (i = se(e, 3, 3); i; --i) oe[u++] = 0;
87
+ break;
88
+ case 18:
89
+ for (i = se(e, 7, 11); i; --i) oe[u++] = 0;
90
+ break;
91
+ default:
92
+ oe[u++] = l;
93
+ break;
94
+ }
95
+ }
96
+ rt(t, oe, 0, n), rt(r, oe, n, a);
97
+ }
98
+ function Mt(e, t, r) {
99
+ for (; ; ) {
100
+ var n = ct(e, t);
101
+ if (n === 256) return St;
102
+ if (n < 256) e.dest[e.destLen++] = n;
103
+ else {
104
+ var a, o, s, u;
105
+ for (n -= 257, a = se(e, Et[n], Ct[n]), o = ct(e, r), s = e.destLen - se(e, Er[o], Cr[o]), u = s; u < s + a; ++u) e.dest[e.destLen++] = e.dest[u];
106
+ }
107
+ }
108
+ }
109
+ function Sn(e) {
110
+ for (var t, r, n; e.bitcount > 8; ) e.sourceIndex--, e.bitcount -= 8;
111
+ if (t = e.source[e.sourceIndex + 1], t = 256 * t + e.source[e.sourceIndex], r = e.source[e.sourceIndex + 3], r = 256 * r + e.source[e.sourceIndex + 2], t !== (~r & 65535)) return xr;
112
+ for (e.sourceIndex += 4, n = t; n; --n) e.dest[e.destLen++] = e.source[e.sourceIndex++];
113
+ return e.bitcount = 0, St;
114
+ }
115
+ function En(e, t) {
116
+ var r = new gn(e, t), n, a, o;
117
+ do {
118
+ switch (n = xn(r), a = se(r, 2, 0), a) {
119
+ case 0:
120
+ o = Sn(r);
121
+ break;
122
+ case 1:
123
+ o = Mt(r, br, Sr);
124
+ break;
125
+ case 2:
126
+ bn(r, r.ltree, r.dtree), o = Mt(r, r.ltree, r.dtree);
127
+ break;
128
+ default:
129
+ o = xr;
130
+ }
131
+ if (o !== St) throw new Error("Data error");
132
+ } while (!n);
133
+ return r.destLen < r.dest.length ? typeof r.dest.slice == "function" ? r.dest.slice(0, r.destLen) : r.dest.subarray(0, r.destLen) : r.dest;
134
+ }
135
+ yn(br, Sr);
136
+ Tr(Et, Ct, 4, 3);
137
+ Tr(Er, Cr, 2, 1);
138
+ Et[28] = 0;
139
+ Ct[28] = 258;
140
+ var Cn = En;
141
+ function Ee(e, t, r, n, a) {
142
+ return Math.pow(1 - a, 3) * e + 3 * Math.pow(1 - a, 2) * a * t + 3 * (1 - a) * Math.pow(a, 2) * r + Math.pow(a, 3) * n;
143
+ }
144
+ function ce() {
145
+ this.x1 = Number.NaN, this.y1 = Number.NaN, this.x2 = Number.NaN, this.y2 = Number.NaN;
146
+ }
147
+ ce.prototype.isEmpty = function() {
148
+ return isNaN(this.x1) || isNaN(this.y1) || isNaN(this.x2) || isNaN(this.y2);
149
+ };
150
+ ce.prototype.addPoint = function(e, t) {
151
+ typeof e == "number" && ((isNaN(this.x1) || isNaN(this.x2)) && (this.x1 = e, this.x2 = e), e < this.x1 && (this.x1 = e), e > this.x2 && (this.x2 = e)), typeof t == "number" && ((isNaN(this.y1) || isNaN(this.y2)) && (this.y1 = t, this.y2 = t), t < this.y1 && (this.y1 = t), t > this.y2 && (this.y2 = t));
152
+ };
153
+ ce.prototype.addX = function(e) {
154
+ this.addPoint(e, null);
155
+ };
156
+ ce.prototype.addY = function(e) {
157
+ this.addPoint(null, e);
158
+ };
159
+ ce.prototype.addBezier = function(e, t, r, n, a, o, s, u) {
160
+ var i = [e, t], p = [r, n], l = [a, o], h = [s, u];
161
+ this.addPoint(e, t), this.addPoint(s, u);
162
+ for (var c = 0; c <= 1; c++) {
163
+ var f = 6 * i[c] - 12 * p[c] + 6 * l[c], v = -3 * i[c] + 9 * p[c] - 9 * l[c] + 3 * h[c], x = 3 * p[c] - 3 * i[c];
164
+ if (v === 0) {
165
+ if (f === 0) continue;
166
+ var m = -x / f;
167
+ 0 < m && m < 1 && (c === 0 && this.addX(Ee(i[c], p[c], l[c], h[c], m)), c === 1 && this.addY(Ee(i[c], p[c], l[c], h[c], m)));
168
+ continue;
169
+ }
170
+ var y = Math.pow(f, 2) - 4 * x * v;
171
+ if (!(y < 0)) {
172
+ var U = (-f + Math.sqrt(y)) / (2 * v);
173
+ 0 < U && U < 1 && (c === 0 && this.addX(Ee(i[c], p[c], l[c], h[c], U)), c === 1 && this.addY(Ee(i[c], p[c], l[c], h[c], U)));
174
+ var S = (-f - Math.sqrt(y)) / (2 * v);
175
+ 0 < S && S < 1 && (c === 0 && this.addX(Ee(i[c], p[c], l[c], h[c], S)), c === 1 && this.addY(Ee(i[c], p[c], l[c], h[c], S)));
176
+ }
177
+ }
178
+ };
179
+ ce.prototype.addQuad = function(e, t, r, n, a, o) {
180
+ var s = e + 0.6666666666666666 * (r - e), u = t + 2 / 3 * (n - t), i = s + 1 / 3 * (a - e), p = u + 1 / 3 * (o - t);
181
+ this.addBezier(e, t, s, u, i, p, a, o);
182
+ };
183
+ function G() {
184
+ this.commands = [], this.fill = "black", this.stroke = null, this.strokeWidth = 1;
185
+ }
186
+ G.prototype.moveTo = function(e, t) {
187
+ this.commands.push({ type: "M", x: e, y: t });
188
+ };
189
+ G.prototype.lineTo = function(e, t) {
190
+ this.commands.push({ type: "L", x: e, y: t });
191
+ };
192
+ G.prototype.curveTo = G.prototype.bezierCurveTo = function(e, t, r, n, a, o) {
193
+ this.commands.push({ type: "C", x1: e, y1: t, x2: r, y2: n, x: a, y: o });
194
+ };
195
+ G.prototype.quadTo = G.prototype.quadraticCurveTo = function(e, t, r, n) {
196
+ this.commands.push({ type: "Q", x1: e, y1: t, x: r, y: n });
197
+ };
198
+ G.prototype.close = G.prototype.closePath = function() {
199
+ this.commands.push({ type: "Z" });
200
+ };
201
+ G.prototype.extend = function(e) {
202
+ if (e.commands) e = e.commands;
203
+ else if (e instanceof ce) {
204
+ var t = e;
205
+ this.moveTo(t.x1, t.y1), this.lineTo(t.x2, t.y1), this.lineTo(t.x2, t.y2), this.lineTo(t.x1, t.y2), this.close();
206
+ return;
207
+ }
208
+ Array.prototype.push.apply(this.commands, e);
209
+ };
210
+ G.prototype.getBoundingBox = function() {
211
+ for (var e = new ce(), t = 0, r = 0, n = 0, a = 0, o = 0; o < this.commands.length; o++) {
212
+ var s = this.commands[o];
213
+ switch (s.type) {
214
+ case "M":
215
+ e.addPoint(s.x, s.y), t = n = s.x, r = a = s.y;
216
+ break;
217
+ case "L":
218
+ e.addPoint(s.x, s.y), n = s.x, a = s.y;
219
+ break;
220
+ case "Q":
221
+ e.addQuad(n, a, s.x1, s.y1, s.x, s.y), n = s.x, a = s.y;
222
+ break;
223
+ case "C":
224
+ e.addBezier(n, a, s.x1, s.y1, s.x2, s.y2, s.x, s.y), n = s.x, a = s.y;
225
+ break;
226
+ case "Z":
227
+ n = t, a = r;
228
+ break;
229
+ default:
230
+ throw new Error("Unexpected path command " + s.type);
231
+ }
232
+ }
233
+ return e.isEmpty() && e.addPoint(0, 0), e;
234
+ };
235
+ G.prototype.draw = function(e) {
236
+ e.beginPath();
237
+ for (var t = 0; t < this.commands.length; t += 1) {
238
+ var r = this.commands[t];
239
+ r.type === "M" ? e.moveTo(r.x, r.y) : r.type === "L" ? e.lineTo(r.x, r.y) : r.type === "C" ? e.bezierCurveTo(r.x1, r.y1, r.x2, r.y2, r.x, r.y) : r.type === "Q" ? e.quadraticCurveTo(r.x1, r.y1, r.x, r.y) : r.type === "Z" && e.closePath();
240
+ }
241
+ this.fill && (e.fillStyle = this.fill, e.fill()), this.stroke && (e.strokeStyle = this.stroke, e.lineWidth = this.strokeWidth, e.stroke());
242
+ };
243
+ G.prototype.toPathData = function(e) {
244
+ e = e !== void 0 ? e : 2;
245
+ function t(s) {
246
+ return Math.round(s) === s ? "" + Math.round(s) : s.toFixed(e);
247
+ }
248
+ function r() {
249
+ for (var s = arguments, u = "", i = 0; i < arguments.length; i += 1) {
250
+ var p = s[i];
251
+ p >= 0 && i > 0 && (u += " "), u += t(p);
252
+ }
253
+ return u;
254
+ }
255
+ for (var n = "", a = 0; a < this.commands.length; a += 1) {
256
+ var o = this.commands[a];
257
+ o.type === "M" ? n += "M" + r(o.x, o.y) : o.type === "L" ? n += "L" + r(o.x, o.y) : o.type === "C" ? n += "C" + r(o.x1, o.y1, o.x2, o.y2, o.x, o.y) : o.type === "Q" ? n += "Q" + r(o.x1, o.y1, o.x, o.y) : o.type === "Z" && (n += "Z");
258
+ }
259
+ return n;
260
+ };
261
+ G.prototype.toSVG = function(e) {
262
+ var t = '<path d="';
263
+ return t += this.toPathData(e), t += '"', this.fill && this.fill !== "black" && (this.fill === null ? t += ' fill="none"' : t += ' fill="' + this.fill + '"'), this.stroke && (t += ' stroke="' + this.stroke + '" stroke-width="' + this.strokeWidth + '"'), t += "/>", t;
264
+ };
265
+ G.prototype.toDOMElement = function(e) {
266
+ var t = this.toPathData(e), r = document.createElementNS("http://www.w3.org/2000/svg", "path");
267
+ return r.setAttribute("d", t), r;
268
+ };
269
+ function kr(e) {
270
+ throw new Error(e);
271
+ }
272
+ function Gt(e, t) {
273
+ e || kr(t);
274
+ }
275
+ var k = { fail: kr, argument: Gt, assert: Gt }, Pt = 32768, Nt = 2147483648, Te = {}, g = {}, D = {};
276
+ function ne(e) {
277
+ return function() {
278
+ return e;
279
+ };
280
+ }
281
+ g.BYTE = function(e) {
282
+ return k.argument(e >= 0 && e <= 255, "Byte value should be between 0 and 255."), [e];
283
+ };
284
+ D.BYTE = ne(1);
285
+ g.CHAR = function(e) {
286
+ return [e.charCodeAt(0)];
287
+ };
288
+ D.CHAR = ne(1);
289
+ g.CHARARRAY = function(e) {
290
+ typeof e > "u" && (e = "", console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));
291
+ for (var t = [], r = 0; r < e.length; r += 1) t[r] = e.charCodeAt(r);
292
+ return t;
293
+ };
294
+ D.CHARARRAY = function(e) {
295
+ return typeof e > "u" ? 0 : e.length;
296
+ };
297
+ g.USHORT = function(e) {
298
+ return [e >> 8 & 255, e & 255];
299
+ };
300
+ D.USHORT = ne(2);
301
+ g.SHORT = function(e) {
302
+ return e >= Pt && (e = -(2 * Pt - e)), [e >> 8 & 255, e & 255];
303
+ };
304
+ D.SHORT = ne(2);
305
+ g.UINT24 = function(e) {
306
+ return [e >> 16 & 255, e >> 8 & 255, e & 255];
307
+ };
308
+ D.UINT24 = ne(3);
309
+ g.ULONG = function(e) {
310
+ return [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
311
+ };
312
+ D.ULONG = ne(4);
313
+ g.LONG = function(e) {
314
+ return e >= Nt && (e = -(2 * Nt - e)), [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
315
+ };
316
+ D.LONG = ne(4);
317
+ g.FIXED = g.ULONG;
318
+ D.FIXED = D.ULONG;
319
+ g.FWORD = g.SHORT;
320
+ D.FWORD = D.SHORT;
321
+ g.UFWORD = g.USHORT;
322
+ D.UFWORD = D.USHORT;
323
+ g.LONGDATETIME = function(e) {
324
+ return [0, 0, 0, 0, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
325
+ };
326
+ D.LONGDATETIME = ne(8);
327
+ g.TAG = function(e) {
328
+ return k.argument(e.length === 4, "Tag should be exactly 4 ASCII characters."), [e.charCodeAt(0), e.charCodeAt(1), e.charCodeAt(2), e.charCodeAt(3)];
329
+ };
330
+ D.TAG = ne(4);
331
+ g.Card8 = g.BYTE;
332
+ D.Card8 = D.BYTE;
333
+ g.Card16 = g.USHORT;
334
+ D.Card16 = D.USHORT;
335
+ g.OffSize = g.BYTE;
336
+ D.OffSize = D.BYTE;
337
+ g.SID = g.USHORT;
338
+ D.SID = D.USHORT;
339
+ g.NUMBER = function(e) {
340
+ return e >= -107 && e <= 107 ? [e + 139] : e >= 108 && e <= 1131 ? (e = e - 108, [(e >> 8) + 247, e & 255]) : e >= -1131 && e <= -108 ? (e = -e - 108, [(e >> 8) + 251, e & 255]) : e >= -32768 && e <= 32767 ? g.NUMBER16(e) : g.NUMBER32(e);
341
+ };
342
+ D.NUMBER = function(e) {
343
+ return g.NUMBER(e).length;
344
+ };
345
+ g.NUMBER16 = function(e) {
346
+ return [28, e >> 8 & 255, e & 255];
347
+ };
348
+ D.NUMBER16 = ne(3);
349
+ g.NUMBER32 = function(e) {
350
+ return [29, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
351
+ };
352
+ D.NUMBER32 = ne(5);
353
+ g.REAL = function(e) {
354
+ var t = e.toString(), r = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);
355
+ if (r) {
356
+ var n = parseFloat("1e" + ((r[2] ? +r[2] : 0) + r[1].length));
357
+ t = (Math.round(e * n) / n).toString();
358
+ }
359
+ for (var a = "", o = 0, s = t.length; o < s; o += 1) {
360
+ var u = t[o];
361
+ u === "e" ? a += t[++o] === "-" ? "c" : "b" : u === "." ? a += "a" : u === "-" ? a += "e" : a += u;
362
+ }
363
+ a += a.length & 1 ? "f" : "ff";
364
+ for (var i = [30], p = 0, l = a.length; p < l; p += 2) i.push(parseInt(a.substr(p, 2), 16));
365
+ return i;
366
+ };
367
+ D.REAL = function(e) {
368
+ return g.REAL(e).length;
369
+ };
370
+ g.NAME = g.CHARARRAY;
371
+ D.NAME = D.CHARARRAY;
372
+ g.STRING = g.CHARARRAY;
373
+ D.STRING = D.CHARARRAY;
374
+ Te.UTF8 = function(e, t, r) {
375
+ for (var n = [], a = r, o = 0; o < a; o++, t += 1) n[o] = e.getUint8(t);
376
+ return String.fromCharCode.apply(null, n);
377
+ };
378
+ Te.UTF16 = function(e, t, r) {
379
+ for (var n = [], a = r / 2, o = 0; o < a; o++, t += 2) n[o] = e.getUint16(t);
380
+ return String.fromCharCode.apply(null, n);
381
+ };
382
+ g.UTF16 = function(e) {
383
+ for (var t = [], r = 0; r < e.length; r += 1) {
384
+ var n = e.charCodeAt(r);
385
+ t[t.length] = n >> 8 & 255, t[t.length] = n & 255;
386
+ }
387
+ return t;
388
+ };
389
+ D.UTF16 = function(e) {
390
+ return e.length * 2;
391
+ };
392
+ var ht = { "x-mac-croatian": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ", "x-mac-cyrillic": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю", "x-mac-gaelic": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ", "x-mac-greek": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­", "x-mac-icelandic": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", "x-mac-inuit": "ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł", "x-mac-ce": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", macintosh: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", "x-mac-romanian": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", "x-mac-turkish": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ" };
393
+ Te.MACSTRING = function(e, t, r, n) {
394
+ var a = ht[n];
395
+ if (a !== void 0) {
396
+ for (var o = "", s = 0; s < r; s++) {
397
+ var u = e.getUint8(t + s);
398
+ u <= 127 ? o += String.fromCharCode(u) : o += a[u & 127];
399
+ }
400
+ return o;
401
+ }
402
+ };
403
+ var Ne = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), He, Tn = function(e) {
404
+ if (!He) {
405
+ He = {};
406
+ for (var t in ht) He[t] = new String(t);
407
+ }
408
+ var r = He[e];
409
+ if (r !== void 0) {
410
+ if (Ne) {
411
+ var n = Ne.get(r);
412
+ if (n !== void 0) return n;
413
+ }
414
+ var a = ht[e];
415
+ if (a !== void 0) {
416
+ for (var o = {}, s = 0; s < a.length; s++) o[a.charCodeAt(s)] = s + 128;
417
+ return Ne && Ne.set(r, o), o;
418
+ }
419
+ }
420
+ };
421
+ g.MACSTRING = function(e, t) {
422
+ var r = Tn(t);
423
+ if (r !== void 0) {
424
+ for (var n = [], a = 0; a < e.length; a++) {
425
+ var o = e.charCodeAt(a);
426
+ if (o >= 128 && (o = r[o], o === void 0)) return;
427
+ n[a] = o;
428
+ }
429
+ return n;
430
+ }
431
+ };
432
+ D.MACSTRING = function(e, t) {
433
+ var r = g.MACSTRING(e, t);
434
+ return r !== void 0 ? r.length : 0;
435
+ };
436
+ function ft(e) {
437
+ return e >= -128 && e <= 127;
438
+ }
439
+ function kn(e, t, r) {
440
+ for (var n = 0, a = e.length; t < a && n < 64 && e[t] === 0; ) ++t, ++n;
441
+ return r.push(128 | n - 1), t;
442
+ }
443
+ function Un(e, t, r) {
444
+ for (var n = 0, a = e.length, o = t; o < a && n < 64; ) {
445
+ var s = e[o];
446
+ if (!ft(s) || s === 0 && o + 1 < a && e[o + 1] === 0) break;
447
+ ++o, ++n;
448
+ }
449
+ r.push(n - 1);
450
+ for (var u = t; u < o; ++u) r.push(e[u] + 256 & 255);
451
+ return o;
452
+ }
453
+ function Dn(e, t, r) {
454
+ for (var n = 0, a = e.length, o = t; o < a && n < 64; ) {
455
+ var s = e[o];
456
+ if (s === 0 || ft(s) && o + 1 < a && ft(e[o + 1])) break;
457
+ ++o, ++n;
458
+ }
459
+ r.push(64 | n - 1);
460
+ for (var u = t; u < o; ++u) {
461
+ var i = e[u];
462
+ r.push(i + 65536 >> 8 & 255, i + 256 & 255);
463
+ }
464
+ return o;
465
+ }
466
+ g.VARDELTAS = function(e) {
467
+ for (var t = 0, r = []; t < e.length; ) {
468
+ var n = e[t];
469
+ n === 0 ? t = kn(e, t, r) : n >= -128 && n <= 127 ? t = Un(e, t, r) : t = Dn(e, t, r);
470
+ }
471
+ return r;
472
+ };
473
+ g.INDEX = function(e) {
474
+ for (var t = 1, r = [t], n = [], a = 0; a < e.length; a += 1) {
475
+ var o = g.OBJECT(e[a]);
476
+ Array.prototype.push.apply(n, o), t += o.length, r.push(t);
477
+ }
478
+ if (n.length === 0) return [0, 0];
479
+ for (var s = [], u = 1 + Math.floor(Math.log(t) / Math.log(2)) / 8 | 0, i = [void 0, g.BYTE, g.USHORT, g.UINT24, g.ULONG][u], p = 0; p < r.length; p += 1) {
480
+ var l = i(r[p]);
481
+ Array.prototype.push.apply(s, l);
482
+ }
483
+ return Array.prototype.concat(g.Card16(e.length), g.OffSize(u), s, n);
484
+ };
485
+ D.INDEX = function(e) {
486
+ return g.INDEX(e).length;
487
+ };
488
+ g.DICT = function(e) {
489
+ for (var t = [], r = Object.keys(e), n = r.length, a = 0; a < n; a += 1) {
490
+ var o = parseInt(r[a], 0), s = e[o];
491
+ t = t.concat(g.OPERAND(s.value, s.type)), t = t.concat(g.OPERATOR(o));
492
+ }
493
+ return t;
494
+ };
495
+ D.DICT = function(e) {
496
+ return g.DICT(e).length;
497
+ };
498
+ g.OPERATOR = function(e) {
499
+ return e < 1200 ? [e] : [12, e - 1200];
500
+ };
501
+ g.OPERAND = function(e, t) {
502
+ var r = [];
503
+ if (Array.isArray(t)) for (var n = 0; n < t.length; n += 1) k.argument(e.length === t.length, "Not enough arguments given for type" + t), r = r.concat(g.OPERAND(e[n], t[n]));
504
+ else if (t === "SID") r = r.concat(g.NUMBER(e));
505
+ else if (t === "offset") r = r.concat(g.NUMBER32(e));
506
+ else if (t === "number") r = r.concat(g.NUMBER(e));
507
+ else if (t === "real") r = r.concat(g.REAL(e));
508
+ else throw new Error("Unknown operand type " + t);
509
+ return r;
510
+ };
511
+ g.OP = g.BYTE;
512
+ D.OP = D.BYTE;
513
+ var ze = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
514
+ g.CHARSTRING = function(e) {
515
+ if (ze) {
516
+ var t = ze.get(e);
517
+ if (t !== void 0) return t;
518
+ }
519
+ for (var r = [], n = e.length, a = 0; a < n; a += 1) {
520
+ var o = e[a];
521
+ r = r.concat(g[o.type](o.value));
522
+ }
523
+ return ze && ze.set(e, r), r;
524
+ };
525
+ D.CHARSTRING = function(e) {
526
+ return g.CHARSTRING(e).length;
527
+ };
528
+ g.OBJECT = function(e) {
529
+ var t = g[e.type];
530
+ return k.argument(t !== void 0, "No encoding function for type " + e.type), t(e.value);
531
+ };
532
+ D.OBJECT = function(e) {
533
+ var t = D[e.type];
534
+ return k.argument(t !== void 0, "No sizeOf function for type " + e.type), t(e.value);
535
+ };
536
+ g.TABLE = function(e) {
537
+ for (var t = [], r = e.fields.length, n = [], a = [], o = 0; o < r; o += 1) {
538
+ var s = e.fields[o], u = g[s.type];
539
+ k.argument(u !== void 0, "No encoding function for field type " + s.type + " (" + s.name + ")");
540
+ var i = e[s.name];
541
+ i === void 0 && (i = s.value);
542
+ var p = u(i);
543
+ s.type === "TABLE" ? (a.push(t.length), t = t.concat([0, 0]), n.push(p)) : t = t.concat(p);
544
+ }
545
+ for (var l = 0; l < n.length; l += 1) {
546
+ var h = a[l], c = t.length;
547
+ k.argument(c < 65536, "Table " + e.tableName + " too big."), t[h] = c >> 8, t[h + 1] = c & 255, t = t.concat(n[l]);
548
+ }
549
+ return t;
550
+ };
551
+ D.TABLE = function(e) {
552
+ for (var t = 0, r = e.fields.length, n = 0; n < r; n += 1) {
553
+ var a = e.fields[n], o = D[a.type];
554
+ k.argument(o !== void 0, "No sizeOf function for field type " + a.type + " (" + a.name + ")");
555
+ var s = e[a.name];
556
+ s === void 0 && (s = a.value), t += o(s), a.type === "TABLE" && (t += 2);
557
+ }
558
+ return t;
559
+ };
560
+ g.RECORD = g.TABLE;
561
+ D.RECORD = D.TABLE;
562
+ g.LITERAL = function(e) {
563
+ return e;
564
+ };
565
+ D.LITERAL = function(e) {
566
+ return e.length;
567
+ };
568
+ function z(e, t, r) {
569
+ if (t.length && (t[0].name !== "coverageFormat" || t[0].value === 1)) for (var n = 0; n < t.length; n += 1) {
570
+ var a = t[n];
571
+ this[a.name] = a.value;
572
+ }
573
+ if (this.tableName = e, this.fields = t, r) for (var o = Object.keys(r), s = 0; s < o.length; s += 1) {
574
+ var u = o[s], i = r[u];
575
+ this[u] !== void 0 && (this[u] = i);
576
+ }
577
+ }
578
+ z.prototype.encode = function() {
579
+ return g.TABLE(this);
580
+ };
581
+ z.prototype.sizeOf = function() {
582
+ return D.TABLE(this);
583
+ };
584
+ function Be(e, t, r) {
585
+ r === void 0 && (r = t.length);
586
+ var n = new Array(t.length + 1);
587
+ n[0] = { name: e + "Count", type: "USHORT", value: r };
588
+ for (var a = 0; a < t.length; a++) n[a + 1] = { name: e + a, type: "USHORT", value: t[a] };
589
+ return n;
590
+ }
591
+ function dt(e, t, r) {
592
+ var n = t.length, a = new Array(n + 1);
593
+ a[0] = { name: e + "Count", type: "USHORT", value: n };
594
+ for (var o = 0; o < n; o++) a[o + 1] = { name: e + o, type: "TABLE", value: r(t[o], o) };
595
+ return a;
596
+ }
597
+ function Re(e, t, r) {
598
+ var n = t.length, a = [];
599
+ a[0] = { name: e + "Count", type: "USHORT", value: n };
600
+ for (var o = 0; o < n; o++) a = a.concat(r(t[o], o));
601
+ return a;
602
+ }
603
+ function Ve(e) {
604
+ e.format === 1 ? z.call(this, "coverageTable", [{ name: "coverageFormat", type: "USHORT", value: 1 }].concat(Be("glyph", e.glyphs))) : e.format === 2 ? z.call(this, "coverageTable", [{ name: "coverageFormat", type: "USHORT", value: 2 }].concat(Re("rangeRecord", e.ranges, function(t) {
605
+ return [{ name: "startGlyphID", type: "USHORT", value: t.start }, { name: "endGlyphID", type: "USHORT", value: t.end }, { name: "startCoverageIndex", type: "USHORT", value: t.index }];
606
+ }))) : k.assert(!1, "Coverage format must be 1 or 2.");
607
+ }
608
+ Ve.prototype = Object.create(z.prototype);
609
+ Ve.prototype.constructor = Ve;
610
+ function Ye(e) {
611
+ z.call(this, "scriptListTable", Re("scriptRecord", e, function(t, r) {
612
+ var n = t.script, a = n.defaultLangSys;
613
+ return k.assert(!!a, "Unable to write GSUB: script " + t.tag + " has no default language system."), [{ name: "scriptTag" + r, type: "TAG", value: t.tag }, { name: "script" + r, type: "TABLE", value: new z("scriptTable", [{ name: "defaultLangSys", type: "TABLE", value: new z("defaultLangSys", [{ name: "lookupOrder", type: "USHORT", value: 0 }, { name: "reqFeatureIndex", type: "USHORT", value: a.reqFeatureIndex }].concat(Be("featureIndex", a.featureIndexes))) }].concat(Re("langSys", n.langSysRecords, function(o, s) {
614
+ var u = o.langSys;
615
+ return [{ name: "langSysTag" + s, type: "TAG", value: o.tag }, { name: "langSys" + s, type: "TABLE", value: new z("langSys", [{ name: "lookupOrder", type: "USHORT", value: 0 }, { name: "reqFeatureIndex", type: "USHORT", value: u.reqFeatureIndex }].concat(Be("featureIndex", u.featureIndexes))) }];
616
+ }))) }];
617
+ }));
618
+ }
619
+ Ye.prototype = Object.create(z.prototype);
620
+ Ye.prototype.constructor = Ye;
621
+ function je(e) {
622
+ z.call(this, "featureListTable", Re("featureRecord", e, function(t, r) {
623
+ var n = t.feature;
624
+ return [{ name: "featureTag" + r, type: "TAG", value: t.tag }, { name: "feature" + r, type: "TABLE", value: new z("featureTable", [{ name: "featureParams", type: "USHORT", value: n.featureParams }].concat(Be("lookupListIndex", n.lookupListIndexes))) }];
625
+ }));
626
+ }
627
+ je.prototype = Object.create(z.prototype);
628
+ je.prototype.constructor = je;
629
+ function Ze(e, t) {
630
+ z.call(this, "lookupListTable", dt("lookup", e, function(r) {
631
+ var n = t[r.lookupType];
632
+ return k.assert(!!n, "Unable to write GSUB lookup type " + r.lookupType + " tables."), new z("lookupTable", [{ name: "lookupType", type: "USHORT", value: r.lookupType }, { name: "lookupFlag", type: "USHORT", value: r.lookupFlag }].concat(dt("subtable", r.subtables, n)));
633
+ }));
634
+ }
635
+ Ze.prototype = Object.create(z.prototype);
636
+ Ze.prototype.constructor = Ze;
637
+ var b = { Table: z, Record: z, Coverage: Ve, ScriptList: Ye, FeatureList: je, LookupList: Ze, ushortList: Be, tableList: dt, recordList: Re };
638
+ function Ht(e, t) {
639
+ return e.getUint8(t);
640
+ }
641
+ function Qe(e, t) {
642
+ return e.getUint16(t, !1);
643
+ }
644
+ function An(e, t) {
645
+ return e.getInt16(t, !1);
646
+ }
647
+ function Tt(e, t) {
648
+ return e.getUint32(t, !1);
649
+ }
650
+ function Ur(e, t) {
651
+ var r = e.getInt16(t, !1), n = e.getUint16(t + 2, !1);
652
+ return r + n / 65535;
653
+ }
654
+ function On(e, t) {
655
+ for (var r = "", n = t; n < t + 4; n += 1) r += String.fromCharCode(e.getInt8(n));
656
+ return r;
657
+ }
658
+ function Bn(e, t, r) {
659
+ for (var n = 0, a = 0; a < r; a += 1) n <<= 8, n += e.getUint8(t + a);
660
+ return n;
661
+ }
662
+ function Rn(e, t, r) {
663
+ for (var n = [], a = t; a < r; a += 1) n.push(e.getUint8(a));
664
+ return n;
665
+ }
666
+ function Fn(e) {
667
+ for (var t = "", r = 0; r < e.length; r += 1) t += String.fromCharCode(e[r]);
668
+ return t;
669
+ }
670
+ var wn = { byte: 1, uShort: 2, short: 2, uLong: 4, fixed: 4, longDateTime: 8, tag: 4 };
671
+ function d(e, t) {
672
+ this.data = e, this.offset = t, this.relativeOffset = 0;
673
+ }
674
+ d.prototype.parseByte = function() {
675
+ var e = this.data.getUint8(this.offset + this.relativeOffset);
676
+ return this.relativeOffset += 1, e;
677
+ };
678
+ d.prototype.parseChar = function() {
679
+ var e = this.data.getInt8(this.offset + this.relativeOffset);
680
+ return this.relativeOffset += 1, e;
681
+ };
682
+ d.prototype.parseCard8 = d.prototype.parseByte;
683
+ d.prototype.parseUShort = function() {
684
+ var e = this.data.getUint16(this.offset + this.relativeOffset);
685
+ return this.relativeOffset += 2, e;
686
+ };
687
+ d.prototype.parseCard16 = d.prototype.parseUShort;
688
+ d.prototype.parseSID = d.prototype.parseUShort;
689
+ d.prototype.parseOffset16 = d.prototype.parseUShort;
690
+ d.prototype.parseShort = function() {
691
+ var e = this.data.getInt16(this.offset + this.relativeOffset);
692
+ return this.relativeOffset += 2, e;
693
+ };
694
+ d.prototype.parseF2Dot14 = function() {
695
+ var e = this.data.getInt16(this.offset + this.relativeOffset) / 16384;
696
+ return this.relativeOffset += 2, e;
697
+ };
698
+ d.prototype.parseULong = function() {
699
+ var e = Tt(this.data, this.offset + this.relativeOffset);
700
+ return this.relativeOffset += 4, e;
701
+ };
702
+ d.prototype.parseOffset32 = d.prototype.parseULong;
703
+ d.prototype.parseFixed = function() {
704
+ var e = Ur(this.data, this.offset + this.relativeOffset);
705
+ return this.relativeOffset += 4, e;
706
+ };
707
+ d.prototype.parseString = function(e) {
708
+ var t = this.data, r = this.offset + this.relativeOffset, n = "";
709
+ this.relativeOffset += e;
710
+ for (var a = 0; a < e; a++) n += String.fromCharCode(t.getUint8(r + a));
711
+ return n;
712
+ };
713
+ d.prototype.parseTag = function() {
714
+ return this.parseString(4);
715
+ };
716
+ d.prototype.parseLongDateTime = function() {
717
+ var e = Tt(this.data, this.offset + this.relativeOffset + 4);
718
+ return e -= 2082844800, this.relativeOffset += 8, e;
719
+ };
720
+ d.prototype.parseVersion = function(e) {
721
+ var t = Qe(this.data, this.offset + this.relativeOffset), r = Qe(this.data, this.offset + this.relativeOffset + 2);
722
+ return this.relativeOffset += 4, e === void 0 && (e = 4096), t + r / e / 10;
723
+ };
724
+ d.prototype.skip = function(e, t) {
725
+ t === void 0 && (t = 1), this.relativeOffset += wn[e] * t;
726
+ };
727
+ d.prototype.parseULongList = function(e) {
728
+ e === void 0 && (e = this.parseULong());
729
+ for (var t = new Array(e), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < e; a++) t[a] = r.getUint32(n), n += 4;
730
+ return this.relativeOffset += e * 4, t;
731
+ };
732
+ d.prototype.parseOffset16List = d.prototype.parseUShortList = function(e) {
733
+ e === void 0 && (e = this.parseUShort());
734
+ for (var t = new Array(e), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < e; a++) t[a] = r.getUint16(n), n += 2;
735
+ return this.relativeOffset += e * 2, t;
736
+ };
737
+ d.prototype.parseShortList = function(e) {
738
+ for (var t = new Array(e), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < e; a++) t[a] = r.getInt16(n), n += 2;
739
+ return this.relativeOffset += e * 2, t;
740
+ };
741
+ d.prototype.parseByteList = function(e) {
742
+ for (var t = new Array(e), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < e; a++) t[a] = r.getUint8(n++);
743
+ return this.relativeOffset += e, t;
744
+ };
745
+ d.prototype.parseList = function(e, t) {
746
+ t || (t = e, e = this.parseUShort());
747
+ for (var r = new Array(e), n = 0; n < e; n++) r[n] = t.call(this);
748
+ return r;
749
+ };
750
+ d.prototype.parseList32 = function(e, t) {
751
+ t || (t = e, e = this.parseULong());
752
+ for (var r = new Array(e), n = 0; n < e; n++) r[n] = t.call(this);
753
+ return r;
754
+ };
755
+ d.prototype.parseRecordList = function(e, t) {
756
+ t || (t = e, e = this.parseUShort());
757
+ for (var r = new Array(e), n = Object.keys(t), a = 0; a < e; a++) {
758
+ for (var o = {}, s = 0; s < n.length; s++) {
759
+ var u = n[s], i = t[u];
760
+ o[u] = i.call(this);
761
+ }
762
+ r[a] = o;
763
+ }
764
+ return r;
765
+ };
766
+ d.prototype.parseRecordList32 = function(e, t) {
767
+ t || (t = e, e = this.parseULong());
768
+ for (var r = new Array(e), n = Object.keys(t), a = 0; a < e; a++) {
769
+ for (var o = {}, s = 0; s < n.length; s++) {
770
+ var u = n[s], i = t[u];
771
+ o[u] = i.call(this);
772
+ }
773
+ r[a] = o;
774
+ }
775
+ return r;
776
+ };
777
+ d.prototype.parseStruct = function(e) {
778
+ if (typeof e == "function") return e.call(this);
779
+ for (var t = Object.keys(e), r = {}, n = 0; n < t.length; n++) {
780
+ var a = t[n], o = e[a];
781
+ r[a] = o.call(this);
782
+ }
783
+ return r;
784
+ };
785
+ d.prototype.parseValueRecord = function(e) {
786
+ if (e === void 0 && (e = this.parseUShort()), e !== 0) {
787
+ var t = {};
788
+ return e & 1 && (t.xPlacement = this.parseShort()), e & 2 && (t.yPlacement = this.parseShort()), e & 4 && (t.xAdvance = this.parseShort()), e & 8 && (t.yAdvance = this.parseShort()), e & 16 && (t.xPlaDevice = void 0, this.parseShort()), e & 32 && (t.yPlaDevice = void 0, this.parseShort()), e & 64 && (t.xAdvDevice = void 0, this.parseShort()), e & 128 && (t.yAdvDevice = void 0, this.parseShort()), t;
789
+ }
790
+ };
791
+ d.prototype.parseValueRecordList = function() {
792
+ for (var e = this.parseUShort(), t = this.parseUShort(), r = new Array(t), n = 0; n < t; n++) r[n] = this.parseValueRecord(e);
793
+ return r;
794
+ };
795
+ d.prototype.parsePointer = function(e) {
796
+ var t = this.parseOffset16();
797
+ if (t > 0) return new d(this.data, this.offset + t).parseStruct(e);
798
+ };
799
+ d.prototype.parsePointer32 = function(e) {
800
+ var t = this.parseOffset32();
801
+ if (t > 0) return new d(this.data, this.offset + t).parseStruct(e);
802
+ };
803
+ d.prototype.parseListOfLists = function(e) {
804
+ for (var t = this.parseOffset16List(), r = t.length, n = this.relativeOffset, a = new Array(r), o = 0; o < r; o++) {
805
+ var s = t[o];
806
+ if (s === 0) {
807
+ a[o] = void 0;
808
+ continue;
809
+ }
810
+ if (this.relativeOffset = s, e) {
811
+ for (var u = this.parseOffset16List(), i = new Array(u.length), p = 0; p < u.length; p++) this.relativeOffset = s + u[p], i[p] = e.call(this);
812
+ a[o] = i;
813
+ } else a[o] = this.parseUShortList();
814
+ }
815
+ return this.relativeOffset = n, a;
816
+ };
817
+ d.prototype.parseCoverage = function() {
818
+ var e = this.offset + this.relativeOffset, t = this.parseUShort(), r = this.parseUShort();
819
+ if (t === 1) return { format: 1, glyphs: this.parseUShortList(r) };
820
+ if (t === 2) {
821
+ for (var n = new Array(r), a = 0; a < r; a++) n[a] = { start: this.parseUShort(), end: this.parseUShort(), index: this.parseUShort() };
822
+ return { format: 2, ranges: n };
823
+ }
824
+ throw new Error("0x" + e.toString(16) + ": Coverage format must be 1 or 2.");
825
+ };
826
+ d.prototype.parseClassDef = function() {
827
+ var e = this.offset + this.relativeOffset, t = this.parseUShort();
828
+ if (t === 1) return { format: 1, startGlyph: this.parseUShort(), classes: this.parseUShortList() };
829
+ if (t === 2) return { format: 2, ranges: this.parseRecordList({ start: d.uShort, end: d.uShort, classId: d.uShort }) };
830
+ throw new Error("0x" + e.toString(16) + ": ClassDef format must be 1 or 2.");
831
+ };
832
+ d.list = function(e, t) {
833
+ return function() {
834
+ return this.parseList(e, t);
835
+ };
836
+ };
837
+ d.list32 = function(e, t) {
838
+ return function() {
839
+ return this.parseList32(e, t);
840
+ };
841
+ };
842
+ d.recordList = function(e, t) {
843
+ return function() {
844
+ return this.parseRecordList(e, t);
845
+ };
846
+ };
847
+ d.recordList32 = function(e, t) {
848
+ return function() {
849
+ return this.parseRecordList32(e, t);
850
+ };
851
+ };
852
+ d.pointer = function(e) {
853
+ return function() {
854
+ return this.parsePointer(e);
855
+ };
856
+ };
857
+ d.pointer32 = function(e) {
858
+ return function() {
859
+ return this.parsePointer32(e);
860
+ };
861
+ };
862
+ d.tag = d.prototype.parseTag;
863
+ d.byte = d.prototype.parseByte;
864
+ d.uShort = d.offset16 = d.prototype.parseUShort;
865
+ d.uShortList = d.prototype.parseUShortList;
866
+ d.uLong = d.offset32 = d.prototype.parseULong;
867
+ d.uLongList = d.prototype.parseULongList;
868
+ d.struct = d.prototype.parseStruct;
869
+ d.coverage = d.prototype.parseCoverage;
870
+ d.classDef = d.prototype.parseClassDef;
871
+ var zt = { reserved: d.uShort, reqFeatureIndex: d.uShort, featureIndexes: d.uShortList };
872
+ d.prototype.parseScriptList = function() {
873
+ return this.parsePointer(d.recordList({ tag: d.tag, script: d.pointer({ defaultLangSys: d.pointer(zt), langSysRecords: d.recordList({ tag: d.tag, langSys: d.pointer(zt) }) }) })) || [];
874
+ };
875
+ d.prototype.parseFeatureList = function() {
876
+ return this.parsePointer(d.recordList({ tag: d.tag, feature: d.pointer({ featureParams: d.offset16, lookupListIndexes: d.uShortList }) })) || [];
877
+ };
878
+ d.prototype.parseLookupList = function(e) {
879
+ return this.parsePointer(d.list(d.pointer(function() {
880
+ var t = this.parseUShort();
881
+ k.argument(1 <= t && t <= 9, "GPOS/GSUB lookup type " + t + " unknown.");
882
+ var r = this.parseUShort(), n = r & 16;
883
+ return { lookupType: t, lookupFlag: r, subtables: this.parseList(d.pointer(e[t])), markFilteringSet: n ? this.parseUShort() : void 0 };
884
+ }))) || [];
885
+ };
886
+ d.prototype.parseFeatureVariationsList = function() {
887
+ return this.parsePointer32(function() {
888
+ var e = this.parseUShort(), t = this.parseUShort();
889
+ k.argument(e === 1 && t < 1, "GPOS/GSUB feature variations table unknown.");
890
+ var r = this.parseRecordList32({ conditionSetOffset: d.offset32, featureTableSubstitutionOffset: d.offset32 });
891
+ return r;
892
+ }) || [];
893
+ };
894
+ var C = { getByte: Ht, getCard8: Ht, getUShort: Qe, getCard16: Qe, getShort: An, getULong: Tt, getFixed: Ur, getTag: On, getOffset: Bn, getBytes: Rn, bytesToString: Fn, Parser: d };
895
+ function Ln(e, t) {
896
+ t.parseUShort(), e.length = t.parseULong(), e.language = t.parseULong();
897
+ var r;
898
+ e.groupCount = r = t.parseULong(), e.glyphIndexMap = {};
899
+ for (var n = 0; n < r; n += 1) for (var a = t.parseULong(), o = t.parseULong(), s = t.parseULong(), u = a; u <= o; u += 1) e.glyphIndexMap[u] = s, s++;
900
+ }
901
+ function In(e, t, r, n, a) {
902
+ e.length = t.parseUShort(), e.language = t.parseUShort();
903
+ var o;
904
+ e.segCount = o = t.parseUShort() >> 1, t.skip("uShort", 3), e.glyphIndexMap = {};
905
+ for (var s = new C.Parser(r, n + a + 14), u = new C.Parser(r, n + a + 16 + o * 2), i = new C.Parser(r, n + a + 16 + o * 4), p = new C.Parser(r, n + a + 16 + o * 6), l = n + a + 16 + o * 8, h = 0; h < o - 1; h += 1) for (var c = void 0, f = s.parseUShort(), v = u.parseUShort(), x = i.parseShort(), m = p.parseUShort(), y = v; y <= f; y += 1) m !== 0 ? (l = p.offset + p.relativeOffset - 2, l += m, l += (y - v) * 2, c = C.getUShort(r, l), c !== 0 && (c = c + x & 65535)) : c = y + x & 65535, e.glyphIndexMap[y] = c;
906
+ }
907
+ function Mn(e, t) {
908
+ var r = {};
909
+ r.version = C.getUShort(e, t), k.argument(r.version === 0, "cmap table version should be 0."), r.numTables = C.getUShort(e, t + 2);
910
+ for (var n = -1, a = r.numTables - 1; a >= 0; a -= 1) {
911
+ var o = C.getUShort(e, t + 4 + a * 8), s = C.getUShort(e, t + 4 + a * 8 + 2);
912
+ if (o === 3 && (s === 0 || s === 1 || s === 10) || o === 0 && (s === 0 || s === 1 || s === 2 || s === 3 || s === 4)) {
913
+ n = C.getULong(e, t + 4 + a * 8 + 4);
914
+ break;
915
+ }
916
+ }
917
+ if (n === -1) throw new Error("No valid cmap sub-tables found.");
918
+ var u = new C.Parser(e, t + n);
919
+ if (r.format = u.parseUShort(), r.format === 12) Ln(r, u);
920
+ else if (r.format === 4) In(r, u, e, t, n);
921
+ else throw new Error("Only format 4 and 12 cmap tables are supported (found format " + r.format + ").");
922
+ return r;
923
+ }
924
+ function Gn(e, t, r) {
925
+ e.segments.push({ end: t, start: t, delta: -(t - r), offset: 0, glyphIndex: r });
926
+ }
927
+ function Pn(e) {
928
+ e.segments.push({ end: 65535, start: 65535, delta: 1, offset: 0 });
929
+ }
930
+ function Nn(e) {
931
+ var t = !0, r;
932
+ for (r = e.length - 1; r > 0; r -= 1) {
933
+ var n = e.get(r);
934
+ if (n.unicode > 65535) {
935
+ console.log("Adding CMAP format 12 (needed!)"), t = !1;
936
+ break;
937
+ }
938
+ }
939
+ var a = [{ name: "version", type: "USHORT", value: 0 }, { name: "numTables", type: "USHORT", value: t ? 1 : 2 }, { name: "platformID", type: "USHORT", value: 3 }, { name: "encodingID", type: "USHORT", value: 1 }, { name: "offset", type: "ULONG", value: t ? 12 : 20 }];
940
+ t || (a = a.concat([{ name: "cmap12PlatformID", type: "USHORT", value: 3 }, { name: "cmap12EncodingID", type: "USHORT", value: 10 }, { name: "cmap12Offset", type: "ULONG", value: 0 }])), a = a.concat([{ name: "format", type: "USHORT", value: 4 }, { name: "cmap4Length", type: "USHORT", value: 0 }, { name: "language", type: "USHORT", value: 0 }, { name: "segCountX2", type: "USHORT", value: 0 }, { name: "searchRange", type: "USHORT", value: 0 }, { name: "entrySelector", type: "USHORT", value: 0 }, { name: "rangeShift", type: "USHORT", value: 0 }]);
941
+ var o = new b.Table("cmap", a);
942
+ for (o.segments = [], r = 0; r < e.length; r += 1) {
943
+ for (var s = e.get(r), u = 0; u < s.unicodes.length; u += 1) Gn(o, s.unicodes[u], r);
944
+ o.segments = o.segments.sort(function(U, S) {
945
+ return U.start - S.start;
946
+ });
947
+ }
948
+ Pn(o);
949
+ var i = o.segments.length, p = 0, l = [], h = [], c = [], f = [], v = [], x = [];
950
+ for (r = 0; r < i; r += 1) {
951
+ var m = o.segments[r];
952
+ m.end <= 65535 && m.start <= 65535 ? (l = l.concat({ name: "end_" + r, type: "USHORT", value: m.end }), h = h.concat({ name: "start_" + r, type: "USHORT", value: m.start }), c = c.concat({ name: "idDelta_" + r, type: "SHORT", value: m.delta }), f = f.concat({ name: "idRangeOffset_" + r, type: "USHORT", value: m.offset }), m.glyphId !== void 0 && (v = v.concat({ name: "glyph_" + r, type: "USHORT", value: m.glyphId }))) : p += 1, !t && m.glyphIndex !== void 0 && (x = x.concat({ name: "cmap12Start_" + r, type: "ULONG", value: m.start }), x = x.concat({ name: "cmap12End_" + r, type: "ULONG", value: m.end }), x = x.concat({ name: "cmap12Glyph_" + r, type: "ULONG", value: m.glyphIndex }));
953
+ }
954
+ if (o.segCountX2 = (i - p) * 2, o.searchRange = Math.pow(2, Math.floor(Math.log(i - p) / Math.log(2))) * 2, o.entrySelector = Math.log(o.searchRange / 2) / Math.log(2), o.rangeShift = o.segCountX2 - o.searchRange, o.fields = o.fields.concat(l), o.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), o.fields = o.fields.concat(h), o.fields = o.fields.concat(c), o.fields = o.fields.concat(f), o.fields = o.fields.concat(v), o.cmap4Length = 14 + l.length * 2 + 2 + h.length * 2 + c.length * 2 + f.length * 2 + v.length * 2, !t) {
955
+ var y = 16 + x.length * 4;
956
+ o.cmap12Offset = 12 + 2 * 2 + 4 + o.cmap4Length, o.fields = o.fields.concat([{ name: "cmap12Format", type: "USHORT", value: 12 }, { name: "cmap12Reserved", type: "USHORT", value: 0 }, { name: "cmap12Length", type: "ULONG", value: y }, { name: "cmap12Language", type: "ULONG", value: 0 }, { name: "cmap12nGroups", type: "ULONG", value: x.length / 3 }]), o.fields = o.fields.concat(x);
957
+ }
958
+ return o;
959
+ }
960
+ var Dr = { parse: Mn, make: Nn }, _e = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "266 ff", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"], Hn = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "", "endash", "dagger", "daggerdbl", "periodcentered", "", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "", "questiondown", "", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "", "ring", "cedilla", "", "hungarumlaut", "ogonek", "caron", "emdash", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "AE", "", "ordfeminine", "", "", "", "", "Lslash", "Oslash", "OE", "ordmasculine", "", "", "", "", "", "ae", "", "", "", "dotlessi", "", "", "lslash", "oslash", "oe", "germandbls"], zn = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "", "", "isuperior", "", "", "lsuperior", "msuperior", "nsuperior", "osuperior", "", "", "rsuperior", "ssuperior", "tsuperior", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdownsmall", "centoldstyle", "Lslashsmall", "", "", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "", "Dotaccentsmall", "", "", "Macronsmall", "", "", "figuredash", "hypheninferior", "", "", "Ogoneksmall", "Ringsmall", "Cedillasmall", "", "", "", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"], xe = [".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat"];
961
+ function Ar(e) {
962
+ this.font = e;
963
+ }
964
+ Ar.prototype.charToGlyphIndex = function(e) {
965
+ var t = e.codePointAt(0), r = this.font.glyphs;
966
+ if (r) {
967
+ for (var n = 0; n < r.length; n += 1) for (var a = r.get(n), o = 0; o < a.unicodes.length; o += 1) if (a.unicodes[o] === t) return n;
968
+ }
969
+ return null;
970
+ };
971
+ function Or(e) {
972
+ this.cmap = e;
973
+ }
974
+ Or.prototype.charToGlyphIndex = function(e) {
975
+ return this.cmap.glyphIndexMap[e.codePointAt(0)] || 0;
976
+ };
977
+ function Ke(e, t) {
978
+ this.encoding = e, this.charset = t;
979
+ }
980
+ Ke.prototype.charToGlyphIndex = function(e) {
981
+ var t = e.codePointAt(0), r = this.encoding[t];
982
+ return this.charset.indexOf(r);
983
+ };
984
+ function kt(e) {
985
+ switch (e.version) {
986
+ case 1:
987
+ this.names = xe.slice();
988
+ break;
989
+ case 2:
990
+ this.names = new Array(e.numberOfGlyphs);
991
+ for (var t = 0; t < e.numberOfGlyphs; t++) e.glyphNameIndex[t] < xe.length ? this.names[t] = xe[e.glyphNameIndex[t]] : this.names[t] = e.names[e.glyphNameIndex[t] - xe.length];
992
+ break;
993
+ case 2.5:
994
+ this.names = new Array(e.numberOfGlyphs);
995
+ for (var r = 0; r < e.numberOfGlyphs; r++) this.names[r] = xe[r + e.glyphNameIndex[r]];
996
+ break;
997
+ case 3:
998
+ this.names = [];
999
+ break;
1000
+ default:
1001
+ this.names = [];
1002
+ break;
1003
+ }
1004
+ }
1005
+ kt.prototype.nameToGlyphIndex = function(e) {
1006
+ return this.names.indexOf(e);
1007
+ };
1008
+ kt.prototype.glyphIndexToName = function(e) {
1009
+ return this.names[e];
1010
+ };
1011
+ function Wn(e) {
1012
+ for (var t, r = e.tables.cmap.glyphIndexMap, n = Object.keys(r), a = 0; a < n.length; a += 1) {
1013
+ var o = n[a], s = r[o];
1014
+ t = e.glyphs.get(s), t.addUnicode(parseInt(o));
1015
+ }
1016
+ for (var u = 0; u < e.glyphs.length; u += 1) t = e.glyphs.get(u), e.cffEncoding ? e.isCIDFont ? t.name = "gid" + u : t.name = e.cffEncoding.charset[u] : e.glyphNames.names && (t.name = e.glyphNames.glyphIndexToName(u));
1017
+ }
1018
+ function qn(e) {
1019
+ e._IndexToUnicodeMap = {};
1020
+ for (var t = e.tables.cmap.glyphIndexMap, r = Object.keys(t), n = 0; n < r.length; n += 1) {
1021
+ var a = r[n], o = t[a];
1022
+ e._IndexToUnicodeMap[o] === void 0 ? e._IndexToUnicodeMap[o] = { unicodes: [parseInt(a)] } : e._IndexToUnicodeMap[o].unicodes.push(parseInt(a));
1023
+ }
1024
+ }
1025
+ function _n(e, t) {
1026
+ t.lowMemory ? qn(e) : Wn(e);
1027
+ }
1028
+ function Xn(e, t, r, n, a) {
1029
+ e.beginPath(), e.moveTo(t, r), e.lineTo(n, a), e.stroke();
1030
+ }
1031
+ var ye = { line: Xn };
1032
+ function Vn(e, t) {
1033
+ var r = t || new G();
1034
+ return { configurable: !0, get: function() {
1035
+ return typeof r == "function" && (r = r()), r;
1036
+ }, set: function(n) {
1037
+ r = n;
1038
+ } };
1039
+ }
1040
+ function Z(e) {
1041
+ this.bindConstructorValues(e);
1042
+ }
1043
+ Z.prototype.bindConstructorValues = function(e) {
1044
+ this.index = e.index || 0, this.name = e.name || null, this.unicode = e.unicode || void 0, this.unicodes = e.unicodes || e.unicode !== void 0 ? [e.unicode] : [], "xMin" in e && (this.xMin = e.xMin), "yMin" in e && (this.yMin = e.yMin), "xMax" in e && (this.xMax = e.xMax), "yMax" in e && (this.yMax = e.yMax), "advanceWidth" in e && (this.advanceWidth = e.advanceWidth), Object.defineProperty(this, "path", Vn(this, e.path));
1045
+ };
1046
+ Z.prototype.addUnicode = function(e) {
1047
+ this.unicodes.length === 0 && (this.unicode = e), this.unicodes.push(e);
1048
+ };
1049
+ Z.prototype.getBoundingBox = function() {
1050
+ return this.path.getBoundingBox();
1051
+ };
1052
+ Z.prototype.getPath = function(e, t, r, n, a) {
1053
+ e = e !== void 0 ? e : 0, t = t !== void 0 ? t : 0, r = r !== void 0 ? r : 72;
1054
+ var o, s;
1055
+ n || (n = {});
1056
+ var u = n.xScale, i = n.yScale;
1057
+ if (n.hinting && a && a.hinting && (s = this.path && a.hinting.exec(this, r)), s) o = a.hinting.getCommands(s), e = Math.round(e), t = Math.round(t), u = i = 1;
1058
+ else {
1059
+ o = this.path.commands;
1060
+ var p = 1 / (this.path.unitsPerEm || 1e3) * r;
1061
+ u === void 0 && (u = p), i === void 0 && (i = p);
1062
+ }
1063
+ for (var l = new G(), h = 0; h < o.length; h += 1) {
1064
+ var c = o[h];
1065
+ c.type === "M" ? l.moveTo(e + c.x * u, t + -c.y * i) : c.type === "L" ? l.lineTo(e + c.x * u, t + -c.y * i) : c.type === "Q" ? l.quadraticCurveTo(e + c.x1 * u, t + -c.y1 * i, e + c.x * u, t + -c.y * i) : c.type === "C" ? l.curveTo(e + c.x1 * u, t + -c.y1 * i, e + c.x2 * u, t + -c.y2 * i, e + c.x * u, t + -c.y * i) : c.type === "Z" && l.closePath();
1066
+ }
1067
+ return l;
1068
+ };
1069
+ Z.prototype.getContours = function() {
1070
+ if (this.points === void 0) return [];
1071
+ for (var e = [], t = [], r = 0; r < this.points.length; r += 1) {
1072
+ var n = this.points[r];
1073
+ t.push(n), n.lastPointOfContour && (e.push(t), t = []);
1074
+ }
1075
+ return k.argument(t.length === 0, "There are still points left in the current contour."), e;
1076
+ };
1077
+ Z.prototype.getMetrics = function() {
1078
+ for (var e = this.path.commands, t = [], r = [], n = 0; n < e.length; n += 1) {
1079
+ var a = e[n];
1080
+ a.type !== "Z" && (t.push(a.x), r.push(a.y)), (a.type === "Q" || a.type === "C") && (t.push(a.x1), r.push(a.y1)), a.type === "C" && (t.push(a.x2), r.push(a.y2));
1081
+ }
1082
+ var o = { xMin: Math.min.apply(null, t), yMin: Math.min.apply(null, r), xMax: Math.max.apply(null, t), yMax: Math.max.apply(null, r), leftSideBearing: this.leftSideBearing };
1083
+ return isFinite(o.xMin) || (o.xMin = 0), isFinite(o.xMax) || (o.xMax = this.advanceWidth), isFinite(o.yMin) || (o.yMin = 0), isFinite(o.yMax) || (o.yMax = 0), o.rightSideBearing = this.advanceWidth - o.leftSideBearing - (o.xMax - o.xMin), o;
1084
+ };
1085
+ Z.prototype.draw = function(e, t, r, n, a) {
1086
+ this.getPath(t, r, n, a).draw(e);
1087
+ };
1088
+ Z.prototype.drawPoints = function(e, t, r, n) {
1089
+ function a(h, c, f, v) {
1090
+ e.beginPath();
1091
+ for (var x = 0; x < h.length; x += 1) e.moveTo(c + h[x].x * v, f + h[x].y * v), e.arc(c + h[x].x * v, f + h[x].y * v, 2, 0, Math.PI * 2, !1);
1092
+ e.closePath(), e.fill();
1093
+ }
1094
+ t = t !== void 0 ? t : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24;
1095
+ for (var o = 1 / this.path.unitsPerEm * n, s = [], u = [], i = this.path, p = 0; p < i.commands.length; p += 1) {
1096
+ var l = i.commands[p];
1097
+ l.x !== void 0 && s.push({ x: l.x, y: -l.y }), l.x1 !== void 0 && u.push({ x: l.x1, y: -l.y1 }), l.x2 !== void 0 && u.push({ x: l.x2, y: -l.y2 });
1098
+ }
1099
+ e.fillStyle = "blue", a(s, t, r, o), e.fillStyle = "red", a(u, t, r, o);
1100
+ };
1101
+ Z.prototype.drawMetrics = function(e, t, r, n) {
1102
+ var a;
1103
+ t = t !== void 0 ? t : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24, a = 1 / this.path.unitsPerEm * n, e.lineWidth = 1, e.strokeStyle = "black", ye.line(e, t, -1e4, t, 1e4), ye.line(e, -1e4, r, 1e4, r);
1104
+ var o = this.xMin || 0, s = this.yMin || 0, u = this.xMax || 0, i = this.yMax || 0, p = this.advanceWidth || 0;
1105
+ e.strokeStyle = "blue", ye.line(e, t + o * a, -1e4, t + o * a, 1e4), ye.line(e, t + u * a, -1e4, t + u * a, 1e4), ye.line(e, -1e4, r + -s * a, 1e4, r + -s * a), ye.line(e, -1e4, r + -i * a, 1e4, r + -i * a), e.strokeStyle = "green", ye.line(e, t + p * a, -1e4, t + p * a, 1e4);
1106
+ };
1107
+ function We(e, t, r) {
1108
+ Object.defineProperty(e, t, { get: function() {
1109
+ return e.path, e[r];
1110
+ }, set: function(n) {
1111
+ e[r] = n;
1112
+ }, enumerable: !0, configurable: !0 });
1113
+ }
1114
+ function Ut(e, t) {
1115
+ if (this.font = e, this.glyphs = {}, Array.isArray(t)) for (var r = 0; r < t.length; r++) {
1116
+ var n = t[r];
1117
+ n.path.unitsPerEm = e.unitsPerEm, this.glyphs[r] = n;
1118
+ }
1119
+ this.length = t && t.length || 0;
1120
+ }
1121
+ Ut.prototype.get = function(e) {
1122
+ if (this.glyphs[e] === void 0) {
1123
+ this.font._push(e), typeof this.glyphs[e] == "function" && (this.glyphs[e] = this.glyphs[e]());
1124
+ var t = this.glyphs[e], r = this.font._IndexToUnicodeMap[e];
1125
+ if (r) for (var n = 0; n < r.unicodes.length; n++) t.addUnicode(r.unicodes[n]);
1126
+ this.font.cffEncoding ? this.font.isCIDFont ? t.name = "gid" + e : t.name = this.font.cffEncoding.charset[e] : this.font.glyphNames.names && (t.name = this.font.glyphNames.glyphIndexToName(e)), this.glyphs[e].advanceWidth = this.font._hmtxTableData[e].advanceWidth, this.glyphs[e].leftSideBearing = this.font._hmtxTableData[e].leftSideBearing;
1127
+ } else typeof this.glyphs[e] == "function" && (this.glyphs[e] = this.glyphs[e]());
1128
+ return this.glyphs[e];
1129
+ };
1130
+ Ut.prototype.push = function(e, t) {
1131
+ this.glyphs[e] = t, this.length++;
1132
+ };
1133
+ function Yn(e, t) {
1134
+ return new Z({ index: t, font: e });
1135
+ }
1136
+ function jn(e, t, r, n, a, o) {
1137
+ return function() {
1138
+ var s = new Z({ index: t, font: e });
1139
+ return s.path = function() {
1140
+ r(s, n, a);
1141
+ var u = o(e.glyphs, s);
1142
+ return u.unitsPerEm = e.unitsPerEm, u;
1143
+ }, We(s, "xMin", "_xMin"), We(s, "xMax", "_xMax"), We(s, "yMin", "_yMin"), We(s, "yMax", "_yMax"), s;
1144
+ };
1145
+ }
1146
+ function Zn(e, t, r, n) {
1147
+ return function() {
1148
+ var a = new Z({ index: t, font: e });
1149
+ return a.path = function() {
1150
+ var o = r(e, a, n);
1151
+ return o.unitsPerEm = e.unitsPerEm, o;
1152
+ }, a;
1153
+ };
1154
+ }
1155
+ var ue = { GlyphSet: Ut, glyphLoader: Yn, ttfGlyphLoader: jn, cffGlyphLoader: Zn };
1156
+ function Br(e, t) {
1157
+ if (e === t) return !0;
1158
+ if (Array.isArray(e) && Array.isArray(t)) {
1159
+ if (e.length !== t.length) return !1;
1160
+ for (var r = 0; r < e.length; r += 1) if (!Br(e[r], t[r])) return !1;
1161
+ return !0;
1162
+ } else return !1;
1163
+ }
1164
+ function vt(e) {
1165
+ var t;
1166
+ return e.length < 1240 ? t = 107 : e.length < 33900 ? t = 1131 : t = 32768, t;
1167
+ }
1168
+ function de(e, t, r) {
1169
+ var n = [], a = [], o = C.getCard16(e, t), s, u;
1170
+ if (o !== 0) {
1171
+ var i = C.getByte(e, t + 2);
1172
+ s = t + (o + 1) * i + 2;
1173
+ for (var p = t + 3, l = 0; l < o + 1; l += 1) n.push(C.getOffset(e, p, i)), p += i;
1174
+ u = s + n[o];
1175
+ } else u = t + 2;
1176
+ for (var h = 0; h < n.length - 1; h += 1) {
1177
+ var c = C.getBytes(e, s + n[h], s + n[h + 1]);
1178
+ r && (c = r(c)), a.push(c);
1179
+ }
1180
+ return { objects: a, startOffset: t, endOffset: u };
1181
+ }
1182
+ function Qn(e, t) {
1183
+ var r = [], n = C.getCard16(e, t), a, o;
1184
+ if (n !== 0) {
1185
+ var s = C.getByte(e, t + 2);
1186
+ a = t + (n + 1) * s + 2;
1187
+ for (var u = t + 3, i = 0; i < n + 1; i += 1) r.push(C.getOffset(e, u, s)), u += s;
1188
+ o = a + r[n];
1189
+ } else o = t + 2;
1190
+ return { offsets: r, startOffset: t, endOffset: o };
1191
+ }
1192
+ function Kn(e, t, r, n, a) {
1193
+ var o = C.getCard16(r, n), s = 0;
1194
+ if (o !== 0) {
1195
+ var u = C.getByte(r, n + 2);
1196
+ s = n + (o + 1) * u + 2;
1197
+ }
1198
+ var i = C.getBytes(r, s + t[e], s + t[e + 1]);
1199
+ return i;
1200
+ }
1201
+ function Jn(e) {
1202
+ for (var t = "", r = 15, n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"]; ; ) {
1203
+ var a = e.parseByte(), o = a >> 4, s = a & 15;
1204
+ if (o === r || (t += n[o], s === r)) break;
1205
+ t += n[s];
1206
+ }
1207
+ return parseFloat(t);
1208
+ }
1209
+ function $n(e, t) {
1210
+ var r, n, a, o;
1211
+ if (t === 28) return r = e.parseByte(), n = e.parseByte(), r << 8 | n;
1212
+ if (t === 29) return r = e.parseByte(), n = e.parseByte(), a = e.parseByte(), o = e.parseByte(), r << 24 | n << 16 | a << 8 | o;
1213
+ if (t === 30) return Jn(e);
1214
+ if (t >= 32 && t <= 246) return t - 139;
1215
+ if (t >= 247 && t <= 250) return r = e.parseByte(), (t - 247) * 256 + r + 108;
1216
+ if (t >= 251 && t <= 254) return r = e.parseByte(), -(t - 251) * 256 - r - 108;
1217
+ throw new Error("Invalid b0 " + t);
1218
+ }
1219
+ function ea(e) {
1220
+ for (var t = {}, r = 0; r < e.length; r += 1) {
1221
+ var n = e[r][0], a = e[r][1], o = void 0;
1222
+ if (a.length === 1 ? o = a[0] : o = a, t.hasOwnProperty(n) && !isNaN(t[n])) throw new Error("Object " + t + " already has key " + n);
1223
+ t[n] = o;
1224
+ }
1225
+ return t;
1226
+ }
1227
+ function Rr(e, t, r) {
1228
+ t = t !== void 0 ? t : 0;
1229
+ var n = new C.Parser(e, t), a = [], o = [];
1230
+ for (r = r !== void 0 ? r : e.length; n.relativeOffset < r; ) {
1231
+ var s = n.parseByte();
1232
+ s <= 21 ? (s === 12 && (s = 1200 + n.parseByte()), a.push([s, o]), o = []) : o.push($n(n, s));
1233
+ }
1234
+ return ea(a);
1235
+ }
1236
+ function Ae(e, t) {
1237
+ return t <= 390 ? t = _e[t] : t = e[t - 391], t;
1238
+ }
1239
+ function Fr(e, t, r) {
1240
+ for (var n = {}, a, o = 0; o < t.length; o += 1) {
1241
+ var s = t[o];
1242
+ if (Array.isArray(s.type)) {
1243
+ var u = [];
1244
+ u.length = s.type.length;
1245
+ for (var i = 0; i < s.type.length; i++) a = e[s.op] !== void 0 ? e[s.op][i] : void 0, a === void 0 && (a = s.value !== void 0 && s.value[i] !== void 0 ? s.value[i] : null), s.type[i] === "SID" && (a = Ae(r, a)), u[i] = a;
1246
+ n[s.name] = u;
1247
+ } else a = e[s.op], a === void 0 && (a = s.value !== void 0 ? s.value : null), s.type === "SID" && (a = Ae(r, a)), n[s.name] = a;
1248
+ }
1249
+ return n;
1250
+ }
1251
+ function ta(e, t) {
1252
+ var r = {};
1253
+ return r.formatMajor = C.getCard8(e, t), r.formatMinor = C.getCard8(e, t + 1), r.size = C.getCard8(e, t + 2), r.offsetSize = C.getCard8(e, t + 3), r.startOffset = t, r.endOffset = t + 4, r;
1254
+ }
1255
+ var wr = [{ name: "version", op: 0, type: "SID" }, { name: "notice", op: 1, type: "SID" }, { name: "copyright", op: 1200, type: "SID" }, { name: "fullName", op: 2, type: "SID" }, { name: "familyName", op: 3, type: "SID" }, { name: "weight", op: 4, type: "SID" }, { name: "isFixedPitch", op: 1201, type: "number", value: 0 }, { name: "italicAngle", op: 1202, type: "number", value: 0 }, { name: "underlinePosition", op: 1203, type: "number", value: -100 }, { name: "underlineThickness", op: 1204, type: "number", value: 50 }, { name: "paintType", op: 1205, type: "number", value: 0 }, { name: "charstringType", op: 1206, type: "number", value: 2 }, { name: "fontMatrix", op: 1207, type: ["real", "real", "real", "real", "real", "real"], value: [1e-3, 0, 0, 1e-3, 0, 0] }, { name: "uniqueId", op: 13, type: "number" }, { name: "fontBBox", op: 5, type: ["number", "number", "number", "number"], value: [0, 0, 0, 0] }, { name: "strokeWidth", op: 1208, type: "number", value: 0 }, { name: "xuid", op: 14, type: [], value: null }, { name: "charset", op: 15, type: "offset", value: 0 }, { name: "encoding", op: 16, type: "offset", value: 0 }, { name: "charStrings", op: 17, type: "offset", value: 0 }, { name: "private", op: 18, type: ["number", "offset"], value: [0, 0] }, { name: "ros", op: 1230, type: ["SID", "SID", "number"] }, { name: "cidFontVersion", op: 1231, type: "number", value: 0 }, { name: "cidFontRevision", op: 1232, type: "number", value: 0 }, { name: "cidFontType", op: 1233, type: "number", value: 0 }, { name: "cidCount", op: 1234, type: "number", value: 8720 }, { name: "uidBase", op: 1235, type: "number" }, { name: "fdArray", op: 1236, type: "offset" }, { name: "fdSelect", op: 1237, type: "offset" }, { name: "fontName", op: 1238, type: "SID" }], Lr = [{ name: "subrs", op: 19, type: "offset", value: 0 }, { name: "defaultWidthX", op: 20, type: "number", value: 0 }, { name: "nominalWidthX", op: 21, type: "number", value: 0 }];
1256
+ function ra(e, t) {
1257
+ var r = Rr(e, 0, e.byteLength);
1258
+ return Fr(r, wr, t);
1259
+ }
1260
+ function Ir(e, t, r, n) {
1261
+ var a = Rr(e, t, r);
1262
+ return Fr(a, Lr, n);
1263
+ }
1264
+ function Wt(e, t, r, n) {
1265
+ for (var a = [], o = 0; o < r.length; o += 1) {
1266
+ var s = new DataView(new Uint8Array(r[o]).buffer), u = ra(s, n);
1267
+ u._subrs = [], u._subrsBias = 0, u._defaultWidthX = 0, u._nominalWidthX = 0;
1268
+ var i = u.private[0], p = u.private[1];
1269
+ if (i !== 0 && p !== 0) {
1270
+ var l = Ir(e, p + t, i, n);
1271
+ if (u._defaultWidthX = l.defaultWidthX, u._nominalWidthX = l.nominalWidthX, l.subrs !== 0) {
1272
+ var h = p + l.subrs, c = de(e, h + t);
1273
+ u._subrs = c.objects, u._subrsBias = vt(u._subrs);
1274
+ }
1275
+ u._privateDict = l;
1276
+ }
1277
+ a.push(u);
1278
+ }
1279
+ return a;
1280
+ }
1281
+ function na(e, t, r, n) {
1282
+ var a, o, s = new C.Parser(e, t);
1283
+ r -= 1;
1284
+ var u = [".notdef"], i = s.parseCard8();
1285
+ if (i === 0) for (var p = 0; p < r; p += 1) a = s.parseSID(), u.push(Ae(n, a));
1286
+ else if (i === 1) for (; u.length <= r; ) {
1287
+ a = s.parseSID(), o = s.parseCard8();
1288
+ for (var l = 0; l <= o; l += 1) u.push(Ae(n, a)), a += 1;
1289
+ }
1290
+ else if (i === 2) for (; u.length <= r; ) {
1291
+ a = s.parseSID(), o = s.parseCard16();
1292
+ for (var h = 0; h <= o; h += 1) u.push(Ae(n, a)), a += 1;
1293
+ }
1294
+ else throw new Error("Unknown charset format " + i);
1295
+ return u;
1296
+ }
1297
+ function aa(e, t, r) {
1298
+ var n, a = {}, o = new C.Parser(e, t), s = o.parseCard8();
1299
+ if (s === 0) for (var u = o.parseCard8(), i = 0; i < u; i += 1) n = o.parseCard8(), a[n] = i;
1300
+ else if (s === 1) {
1301
+ var p = o.parseCard8();
1302
+ n = 1;
1303
+ for (var l = 0; l < p; l += 1) for (var h = o.parseCard8(), c = o.parseCard8(), f = h; f <= h + c; f += 1) a[f] = n, n += 1;
1304
+ } else throw new Error("Unknown encoding format " + s);
1305
+ return new Ke(a, r);
1306
+ }
1307
+ function qt(e, t, r) {
1308
+ var n, a, o, s, u = new G(), i = [], p = 0, l = !1, h = !1, c = 0, f = 0, v, x, m, y;
1309
+ if (e.isCIDFont) {
1310
+ var U = e.tables.cff.topDict._fdSelect[t.index], S = e.tables.cff.topDict._fdArray[U];
1311
+ v = S._subrs, x = S._subrsBias, m = S._defaultWidthX, y = S._nominalWidthX;
1312
+ } else v = e.tables.cff.topDict._subrs, x = e.tables.cff.topDict._subrsBias, m = e.tables.cff.topDict._defaultWidthX, y = e.tables.cff.topDict._nominalWidthX;
1313
+ var B = m;
1314
+ function A(T, P) {
1315
+ h && u.closePath(), u.moveTo(T, P), h = !0;
1316
+ }
1317
+ function F() {
1318
+ var T;
1319
+ T = i.length % 2 !== 0, T && !l && (B = i.shift() + y), p += i.length >> 1, i.length = 0, l = !0;
1320
+ }
1321
+ function O(T) {
1322
+ for (var P, Y, j, J, $, M, N, W, q, _, H, V, w = 0; w < T.length; ) {
1323
+ var X = T[w];
1324
+ switch (w += 1, X) {
1325
+ case 1:
1326
+ F();
1327
+ break;
1328
+ case 3:
1329
+ F();
1330
+ break;
1331
+ case 4:
1332
+ i.length > 1 && !l && (B = i.shift() + y, l = !0), f += i.pop(), A(c, f);
1333
+ break;
1334
+ case 5:
1335
+ for (; i.length > 0; ) c += i.shift(), f += i.shift(), u.lineTo(c, f);
1336
+ break;
1337
+ case 6:
1338
+ for (; i.length > 0 && (c += i.shift(), u.lineTo(c, f), i.length !== 0); ) f += i.shift(), u.lineTo(c, f);
1339
+ break;
1340
+ case 7:
1341
+ for (; i.length > 0 && (f += i.shift(), u.lineTo(c, f), i.length !== 0); ) c += i.shift(), u.lineTo(c, f);
1342
+ break;
1343
+ case 8:
1344
+ for (; i.length > 0; ) n = c + i.shift(), a = f + i.shift(), o = n + i.shift(), s = a + i.shift(), c = o + i.shift(), f = s + i.shift(), u.curveTo(n, a, o, s, c, f);
1345
+ break;
1346
+ case 10:
1347
+ $ = i.pop() + x, M = v[$], M && O(M);
1348
+ break;
1349
+ case 11:
1350
+ return;
1351
+ case 12:
1352
+ switch (X = T[w], w += 1, X) {
1353
+ case 35:
1354
+ n = c + i.shift(), a = f + i.shift(), o = n + i.shift(), s = a + i.shift(), N = o + i.shift(), W = s + i.shift(), q = N + i.shift(), _ = W + i.shift(), H = q + i.shift(), V = _ + i.shift(), c = H + i.shift(), f = V + i.shift(), i.shift(), u.curveTo(n, a, o, s, N, W), u.curveTo(q, _, H, V, c, f);
1355
+ break;
1356
+ case 34:
1357
+ n = c + i.shift(), a = f, o = n + i.shift(), s = a + i.shift(), N = o + i.shift(), W = s, q = N + i.shift(), _ = s, H = q + i.shift(), V = f, c = H + i.shift(), u.curveTo(n, a, o, s, N, W), u.curveTo(q, _, H, V, c, f);
1358
+ break;
1359
+ case 36:
1360
+ n = c + i.shift(), a = f + i.shift(), o = n + i.shift(), s = a + i.shift(), N = o + i.shift(), W = s, q = N + i.shift(), _ = s, H = q + i.shift(), V = _ + i.shift(), c = H + i.shift(), u.curveTo(n, a, o, s, N, W), u.curveTo(q, _, H, V, c, f);
1361
+ break;
1362
+ case 37:
1363
+ n = c + i.shift(), a = f + i.shift(), o = n + i.shift(), s = a + i.shift(), N = o + i.shift(), W = s + i.shift(), q = N + i.shift(), _ = W + i.shift(), H = q + i.shift(), V = _ + i.shift(), Math.abs(H - c) > Math.abs(V - f) ? c = H + i.shift() : f = V + i.shift(), u.curveTo(n, a, o, s, N, W), u.curveTo(q, _, H, V, c, f);
1364
+ break;
1365
+ default:
1366
+ console.log("Glyph " + t.index + ": unknown operator 1200" + X), i.length = 0;
1367
+ }
1368
+ break;
1369
+ case 14:
1370
+ i.length > 0 && !l && (B = i.shift() + y, l = !0), h && (u.closePath(), h = !1);
1371
+ break;
1372
+ case 18:
1373
+ F();
1374
+ break;
1375
+ case 19:
1376
+ case 20:
1377
+ F(), w += p + 7 >> 3;
1378
+ break;
1379
+ case 21:
1380
+ i.length > 2 && !l && (B = i.shift() + y, l = !0), f += i.pop(), c += i.pop(), A(c, f);
1381
+ break;
1382
+ case 22:
1383
+ i.length > 1 && !l && (B = i.shift() + y, l = !0), c += i.pop(), A(c, f);
1384
+ break;
1385
+ case 23:
1386
+ F();
1387
+ break;
1388
+ case 24:
1389
+ for (; i.length > 2; ) n = c + i.shift(), a = f + i.shift(), o = n + i.shift(), s = a + i.shift(), c = o + i.shift(), f = s + i.shift(), u.curveTo(n, a, o, s, c, f);
1390
+ c += i.shift(), f += i.shift(), u.lineTo(c, f);
1391
+ break;
1392
+ case 25:
1393
+ for (; i.length > 6; ) c += i.shift(), f += i.shift(), u.lineTo(c, f);
1394
+ n = c + i.shift(), a = f + i.shift(), o = n + i.shift(), s = a + i.shift(), c = o + i.shift(), f = s + i.shift(), u.curveTo(n, a, o, s, c, f);
1395
+ break;
1396
+ case 26:
1397
+ for (i.length % 2 && (c += i.shift()); i.length > 0; ) n = c, a = f + i.shift(), o = n + i.shift(), s = a + i.shift(), c = o, f = s + i.shift(), u.curveTo(n, a, o, s, c, f);
1398
+ break;
1399
+ case 27:
1400
+ for (i.length % 2 && (f += i.shift()); i.length > 0; ) n = c + i.shift(), a = f, o = n + i.shift(), s = a + i.shift(), c = o + i.shift(), f = s, u.curveTo(n, a, o, s, c, f);
1401
+ break;
1402
+ case 28:
1403
+ P = T[w], Y = T[w + 1], i.push((P << 24 | Y << 16) >> 16), w += 2;
1404
+ break;
1405
+ case 29:
1406
+ $ = i.pop() + e.gsubrsBias, M = e.gsubrs[$], M && O(M);
1407
+ break;
1408
+ case 30:
1409
+ for (; i.length > 0 && (n = c, a = f + i.shift(), o = n + i.shift(), s = a + i.shift(), c = o + i.shift(), f = s + (i.length === 1 ? i.shift() : 0), u.curveTo(n, a, o, s, c, f), i.length !== 0); ) n = c + i.shift(), a = f, o = n + i.shift(), s = a + i.shift(), f = s + i.shift(), c = o + (i.length === 1 ? i.shift() : 0), u.curveTo(n, a, o, s, c, f);
1410
+ break;
1411
+ case 31:
1412
+ for (; i.length > 0 && (n = c + i.shift(), a = f, o = n + i.shift(), s = a + i.shift(), f = s + i.shift(), c = o + (i.length === 1 ? i.shift() : 0), u.curveTo(n, a, o, s, c, f), i.length !== 0); ) n = c, a = f + i.shift(), o = n + i.shift(), s = a + i.shift(), c = o + i.shift(), f = s + (i.length === 1 ? i.shift() : 0), u.curveTo(n, a, o, s, c, f);
1413
+ break;
1414
+ default:
1415
+ X < 32 ? console.log("Glyph " + t.index + ": unknown operator " + X) : X < 247 ? i.push(X - 139) : X < 251 ? (P = T[w], w += 1, i.push((X - 247) * 256 + P + 108)) : X < 255 ? (P = T[w], w += 1, i.push(-(X - 251) * 256 - P - 108)) : (P = T[w], Y = T[w + 1], j = T[w + 2], J = T[w + 3], w += 4, i.push((P << 24 | Y << 16 | j << 8 | J) / 65536));
1416
+ }
1417
+ }
1418
+ }
1419
+ return O(r), t.advanceWidth = B, u;
1420
+ }
1421
+ function oa(e, t, r, n) {
1422
+ var a = [], o, s = new C.Parser(e, t), u = s.parseCard8();
1423
+ if (u === 0) for (var i = 0; i < r; i++) {
1424
+ if (o = s.parseCard8(), o >= n) throw new Error("CFF table CID Font FDSelect has bad FD index value " + o + " (FD count " + n + ")");
1425
+ a.push(o);
1426
+ }
1427
+ else if (u === 3) {
1428
+ var p = s.parseCard16(), l = s.parseCard16();
1429
+ if (l !== 0) throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID " + l);
1430
+ for (var h, c = 0; c < p; c++) {
1431
+ if (o = s.parseCard8(), h = s.parseCard16(), o >= n) throw new Error("CFF table CID Font FDSelect has bad FD index value " + o + " (FD count " + n + ")");
1432
+ if (h > r) throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID " + h);
1433
+ for (; l < h; l++) a.push(o);
1434
+ l = h;
1435
+ }
1436
+ if (h !== r) throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID " + h);
1437
+ } else throw new Error("CFF Table CID Font FDSelect table has unsupported format " + u);
1438
+ return a;
1439
+ }
1440
+ function sa(e, t, r, n) {
1441
+ r.tables.cff = {};
1442
+ var a = ta(e, t), o = de(e, a.endOffset, C.bytesToString), s = de(e, o.endOffset), u = de(e, s.endOffset, C.bytesToString), i = de(e, u.endOffset);
1443
+ r.gsubrs = i.objects, r.gsubrsBias = vt(r.gsubrs);
1444
+ var p = Wt(e, t, s.objects, u.objects);
1445
+ if (p.length !== 1) throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + p.length);
1446
+ var l = p[0];
1447
+ if (r.tables.cff.topDict = l, l._privateDict && (r.defaultWidthX = l._privateDict.defaultWidthX, r.nominalWidthX = l._privateDict.nominalWidthX), l.ros[0] !== void 0 && l.ros[1] !== void 0 && (r.isCIDFont = !0), r.isCIDFont) {
1448
+ var h = l.fdArray, c = l.fdSelect;
1449
+ if (h === 0 || c === 0) throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
1450
+ h += t;
1451
+ var f = de(e, h), v = Wt(e, t, f.objects, u.objects);
1452
+ l._fdArray = v, c += t, l._fdSelect = oa(e, c, r.numGlyphs, v.length);
1453
+ }
1454
+ var x = t + l.private[1], m = Ir(e, x, l.private[0], u.objects);
1455
+ if (r.defaultWidthX = m.defaultWidthX, r.nominalWidthX = m.nominalWidthX, m.subrs !== 0) {
1456
+ var y = x + m.subrs, U = de(e, y);
1457
+ r.subrs = U.objects, r.subrsBias = vt(r.subrs);
1458
+ } else r.subrs = [], r.subrsBias = 0;
1459
+ var S;
1460
+ n.lowMemory ? (S = Qn(e, t + l.charStrings), r.nGlyphs = S.offsets.length) : (S = de(e, t + l.charStrings), r.nGlyphs = S.objects.length);
1461
+ var B = na(e, t + l.charset, r.nGlyphs, u.objects);
1462
+ if (l.encoding === 0 ? r.cffEncoding = new Ke(Hn, B) : l.encoding === 1 ? r.cffEncoding = new Ke(zn, B) : r.cffEncoding = aa(e, t + l.encoding, B), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new ue.GlyphSet(r), n.lowMemory) r._push = function(O) {
1463
+ var T = Kn(O, S.offsets, e, t + l.charStrings);
1464
+ r.glyphs.push(O, ue.cffGlyphLoader(r, O, qt, T));
1465
+ };
1466
+ else for (var A = 0; A < r.nGlyphs; A += 1) {
1467
+ var F = S.objects[A];
1468
+ r.glyphs.push(A, ue.cffGlyphLoader(r, A, qt, F));
1469
+ }
1470
+ }
1471
+ function Mr(e, t) {
1472
+ var r, n = _e.indexOf(e);
1473
+ return n >= 0 && (r = n), n = t.indexOf(e), n >= 0 ? r = n + _e.length : (r = _e.length + t.length, t.push(e)), r;
1474
+ }
1475
+ function ia() {
1476
+ return new b.Record("Header", [{ name: "major", type: "Card8", value: 1 }, { name: "minor", type: "Card8", value: 0 }, { name: "hdrSize", type: "Card8", value: 4 }, { name: "major", type: "Card8", value: 1 }]);
1477
+ }
1478
+ function ua(e) {
1479
+ var t = new b.Record("Name INDEX", [{ name: "names", type: "INDEX", value: [] }]);
1480
+ t.names = [];
1481
+ for (var r = 0; r < e.length; r += 1) t.names.push({ name: "name_" + r, type: "NAME", value: e[r] });
1482
+ return t;
1483
+ }
1484
+ function Gr(e, t, r) {
1485
+ for (var n = {}, a = 0; a < e.length; a += 1) {
1486
+ var o = e[a], s = t[o.name];
1487
+ s !== void 0 && !Br(s, o.value) && (o.type === "SID" && (s = Mr(s, r)), n[o.op] = { name: o.name, type: o.type, value: s });
1488
+ }
1489
+ return n;
1490
+ }
1491
+ function _t(e, t) {
1492
+ var r = new b.Record("Top DICT", [{ name: "dict", type: "DICT", value: {} }]);
1493
+ return r.dict = Gr(wr, e, t), r;
1494
+ }
1495
+ function Xt(e) {
1496
+ var t = new b.Record("Top DICT INDEX", [{ name: "topDicts", type: "INDEX", value: [] }]);
1497
+ return t.topDicts = [{ name: "topDict_0", type: "TABLE", value: e }], t;
1498
+ }
1499
+ function la(e) {
1500
+ var t = new b.Record("String INDEX", [{ name: "strings", type: "INDEX", value: [] }]);
1501
+ t.strings = [];
1502
+ for (var r = 0; r < e.length; r += 1) t.strings.push({ name: "string_" + r, type: "STRING", value: e[r] });
1503
+ return t;
1504
+ }
1505
+ function pa() {
1506
+ return new b.Record("Global Subr INDEX", [{ name: "subrs", type: "INDEX", value: [] }]);
1507
+ }
1508
+ function ca(e, t) {
1509
+ for (var r = new b.Record("Charsets", [{ name: "format", type: "Card8", value: 0 }]), n = 0; n < e.length; n += 1) {
1510
+ var a = e[n], o = Mr(a, t);
1511
+ r.fields.push({ name: "glyph_" + n, type: "SID", value: o });
1512
+ }
1513
+ return r;
1514
+ }
1515
+ function ha(e) {
1516
+ var t = [], r = e.path;
1517
+ t.push({ name: "width", type: "NUMBER", value: e.advanceWidth });
1518
+ for (var n = 0, a = 0, o = 0; o < r.commands.length; o += 1) {
1519
+ var s = void 0, u = void 0, i = r.commands[o];
1520
+ if (i.type === "Q") {
1521
+ var p = 0.3333333333333333, l = 2 / 3;
1522
+ i = { type: "C", x: i.x, y: i.y, x1: Math.round(p * n + l * i.x1), y1: Math.round(p * a + l * i.y1), x2: Math.round(p * i.x + l * i.x1), y2: Math.round(p * i.y + l * i.y1) };
1523
+ }
1524
+ if (i.type === "M") s = Math.round(i.x - n), u = Math.round(i.y - a), t.push({ name: "dx", type: "NUMBER", value: s }), t.push({ name: "dy", type: "NUMBER", value: u }), t.push({ name: "rmoveto", type: "OP", value: 21 }), n = Math.round(i.x), a = Math.round(i.y);
1525
+ else if (i.type === "L") s = Math.round(i.x - n), u = Math.round(i.y - a), t.push({ name: "dx", type: "NUMBER", value: s }), t.push({ name: "dy", type: "NUMBER", value: u }), t.push({ name: "rlineto", type: "OP", value: 5 }), n = Math.round(i.x), a = Math.round(i.y);
1526
+ else if (i.type === "C") {
1527
+ var h = Math.round(i.x1 - n), c = Math.round(i.y1 - a), f = Math.round(i.x2 - i.x1), v = Math.round(i.y2 - i.y1);
1528
+ s = Math.round(i.x - i.x2), u = Math.round(i.y - i.y2), t.push({ name: "dx1", type: "NUMBER", value: h }), t.push({ name: "dy1", type: "NUMBER", value: c }), t.push({ name: "dx2", type: "NUMBER", value: f }), t.push({ name: "dy2", type: "NUMBER", value: v }), t.push({ name: "dx", type: "NUMBER", value: s }), t.push({ name: "dy", type: "NUMBER", value: u }), t.push({ name: "rrcurveto", type: "OP", value: 8 }), n = Math.round(i.x), a = Math.round(i.y);
1529
+ }
1530
+ }
1531
+ return t.push({ name: "endchar", type: "OP", value: 14 }), t;
1532
+ }
1533
+ function fa(e) {
1534
+ for (var t = new b.Record("CharStrings INDEX", [{ name: "charStrings", type: "INDEX", value: [] }]), r = 0; r < e.length; r += 1) {
1535
+ var n = e.get(r), a = ha(n);
1536
+ t.charStrings.push({ name: n.name, type: "CHARSTRING", value: a });
1537
+ }
1538
+ return t;
1539
+ }
1540
+ function da(e, t) {
1541
+ var r = new b.Record("Private DICT", [{ name: "dict", type: "DICT", value: {} }]);
1542
+ return r.dict = Gr(Lr, e, t), r;
1543
+ }
1544
+ function va(e, t) {
1545
+ for (var r = new b.Table("CFF ", [{ name: "header", type: "RECORD" }, { name: "nameIndex", type: "RECORD" }, { name: "topDictIndex", type: "RECORD" }, { name: "stringIndex", type: "RECORD" }, { name: "globalSubrIndex", type: "RECORD" }, { name: "charsets", type: "RECORD" }, { name: "charStringsIndex", type: "RECORD" }, { name: "privateDict", type: "RECORD" }]), n = 1 / t.unitsPerEm, a = { version: t.version, fullName: t.fullName, familyName: t.familyName, weight: t.weightName, fontBBox: t.fontBBox || [0, 0, 0, 0], fontMatrix: [n, 0, 0, n, 0, 0], charset: 999, encoding: 0, charStrings: 999, private: [0, 999] }, o = {}, s = [], u, i = 1; i < e.length; i += 1) u = e.get(i), s.push(u.name);
1546
+ var p = [];
1547
+ r.header = ia(), r.nameIndex = ua([t.postScriptName]);
1548
+ var l = _t(a, p);
1549
+ r.topDictIndex = Xt(l), r.globalSubrIndex = pa(), r.charsets = ca(s, p), r.charStringsIndex = fa(e), r.privateDict = da(o, p), r.stringIndex = la(p);
1550
+ var h = r.header.sizeOf() + r.nameIndex.sizeOf() + r.topDictIndex.sizeOf() + r.stringIndex.sizeOf() + r.globalSubrIndex.sizeOf();
1551
+ return a.charset = h, a.encoding = 0, a.charStrings = a.charset + r.charsets.sizeOf(), a.private[1] = a.charStrings + r.charStringsIndex.sizeOf(), l = _t(a, p), r.topDictIndex = Xt(l), r;
1552
+ }
1553
+ var Pr = { parse: sa, make: va };
1554
+ function ga(e, t) {
1555
+ var r = {}, n = new C.Parser(e, t);
1556
+ return r.version = n.parseVersion(), r.fontRevision = Math.round(n.parseFixed() * 1e3) / 1e3, r.checkSumAdjustment = n.parseULong(), r.magicNumber = n.parseULong(), k.argument(r.magicNumber === 1594834165, "Font header has wrong magic number."), r.flags = n.parseUShort(), r.unitsPerEm = n.parseUShort(), r.created = n.parseLongDateTime(), r.modified = n.parseLongDateTime(), r.xMin = n.parseShort(), r.yMin = n.parseShort(), r.xMax = n.parseShort(), r.yMax = n.parseShort(), r.macStyle = n.parseUShort(), r.lowestRecPPEM = n.parseUShort(), r.fontDirectionHint = n.parseShort(), r.indexToLocFormat = n.parseShort(), r.glyphDataFormat = n.parseShort(), r;
1557
+ }
1558
+ function ma(e) {
1559
+ var t = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) + 2082844800, r = t;
1560
+ return e.createdTimestamp && (r = e.createdTimestamp + 2082844800), new b.Table("head", [{ name: "version", type: "FIXED", value: 65536 }, { name: "fontRevision", type: "FIXED", value: 65536 }, { name: "checkSumAdjustment", type: "ULONG", value: 0 }, { name: "magicNumber", type: "ULONG", value: 1594834165 }, { name: "flags", type: "USHORT", value: 0 }, { name: "unitsPerEm", type: "USHORT", value: 1e3 }, { name: "created", type: "LONGDATETIME", value: r }, { name: "modified", type: "LONGDATETIME", value: t }, { name: "xMin", type: "SHORT", value: 0 }, { name: "yMin", type: "SHORT", value: 0 }, { name: "xMax", type: "SHORT", value: 0 }, { name: "yMax", type: "SHORT", value: 0 }, { name: "macStyle", type: "USHORT", value: 0 }, { name: "lowestRecPPEM", type: "USHORT", value: 0 }, { name: "fontDirectionHint", type: "SHORT", value: 2 }, { name: "indexToLocFormat", type: "SHORT", value: 0 }, { name: "glyphDataFormat", type: "SHORT", value: 0 }], e);
1561
+ }
1562
+ var Nr = { parse: ga, make: ma };
1563
+ function ya(e, t) {
1564
+ var r = {}, n = new C.Parser(e, t);
1565
+ return r.version = n.parseVersion(), r.ascender = n.parseShort(), r.descender = n.parseShort(), r.lineGap = n.parseShort(), r.advanceWidthMax = n.parseUShort(), r.minLeftSideBearing = n.parseShort(), r.minRightSideBearing = n.parseShort(), r.xMaxExtent = n.parseShort(), r.caretSlopeRise = n.parseShort(), r.caretSlopeRun = n.parseShort(), r.caretOffset = n.parseShort(), n.relativeOffset += 8, r.metricDataFormat = n.parseShort(), r.numberOfHMetrics = n.parseUShort(), r;
1566
+ }
1567
+ function xa(e) {
1568
+ return new b.Table("hhea", [{ name: "version", type: "FIXED", value: 65536 }, { name: "ascender", type: "FWORD", value: 0 }, { name: "descender", type: "FWORD", value: 0 }, { name: "lineGap", type: "FWORD", value: 0 }, { name: "advanceWidthMax", type: "UFWORD", value: 0 }, { name: "minLeftSideBearing", type: "FWORD", value: 0 }, { name: "minRightSideBearing", type: "FWORD", value: 0 }, { name: "xMaxExtent", type: "FWORD", value: 0 }, { name: "caretSlopeRise", type: "SHORT", value: 1 }, { name: "caretSlopeRun", type: "SHORT", value: 0 }, { name: "caretOffset", type: "SHORT", value: 0 }, { name: "reserved1", type: "SHORT", value: 0 }, { name: "reserved2", type: "SHORT", value: 0 }, { name: "reserved3", type: "SHORT", value: 0 }, { name: "reserved4", type: "SHORT", value: 0 }, { name: "metricDataFormat", type: "SHORT", value: 0 }, { name: "numberOfHMetrics", type: "USHORT", value: 0 }], e);
1569
+ }
1570
+ var Hr = { parse: ya, make: xa };
1571
+ function ba(e, t, r, n, a) {
1572
+ for (var o, s, u = new C.Parser(e, t), i = 0; i < n; i += 1) {
1573
+ i < r && (o = u.parseUShort(), s = u.parseShort());
1574
+ var p = a.get(i);
1575
+ p.advanceWidth = o, p.leftSideBearing = s;
1576
+ }
1577
+ }
1578
+ function Sa(e, t, r, n, a) {
1579
+ e._hmtxTableData = {};
1580
+ for (var o, s, u = new C.Parser(t, r), i = 0; i < a; i += 1) i < n && (o = u.parseUShort(), s = u.parseShort()), e._hmtxTableData[i] = { advanceWidth: o, leftSideBearing: s };
1581
+ }
1582
+ function Ea(e, t, r, n, a, o, s) {
1583
+ s.lowMemory ? Sa(e, t, r, n, a) : ba(t, r, n, a, o);
1584
+ }
1585
+ function Ca(e) {
1586
+ for (var t = new b.Table("hmtx", []), r = 0; r < e.length; r += 1) {
1587
+ var n = e.get(r), a = n.advanceWidth || 0, o = n.leftSideBearing || 0;
1588
+ t.fields.push({ name: "advanceWidth_" + r, type: "USHORT", value: a }), t.fields.push({ name: "leftSideBearing_" + r, type: "SHORT", value: o });
1589
+ }
1590
+ return t;
1591
+ }
1592
+ var zr = { parse: Ea, make: Ca };
1593
+ function Ta(e) {
1594
+ for (var t = new b.Table("ltag", [{ name: "version", type: "ULONG", value: 1 }, { name: "flags", type: "ULONG", value: 0 }, { name: "numTags", type: "ULONG", value: e.length }]), r = "", n = 12 + e.length * 4, a = 0; a < e.length; ++a) {
1595
+ var o = r.indexOf(e[a]);
1596
+ o < 0 && (o = r.length, r += e[a]), t.fields.push({ name: "offset " + a, type: "USHORT", value: n + o }), t.fields.push({ name: "length " + a, type: "USHORT", value: e[a].length });
1597
+ }
1598
+ return t.fields.push({ name: "stringPool", type: "CHARARRAY", value: r }), t;
1599
+ }
1600
+ function ka(e, t) {
1601
+ var r = new C.Parser(e, t), n = r.parseULong();
1602
+ k.argument(n === 1, "Unsupported ltag table version."), r.skip("uLong", 1);
1603
+ for (var a = r.parseULong(), o = [], s = 0; s < a; s++) {
1604
+ for (var u = "", i = t + r.parseUShort(), p = r.parseUShort(), l = i; l < i + p; ++l) u += String.fromCharCode(e.getInt8(l));
1605
+ o.push(u);
1606
+ }
1607
+ return o;
1608
+ }
1609
+ var Wr = { make: Ta, parse: ka };
1610
+ function Ua(e, t) {
1611
+ var r = {}, n = new C.Parser(e, t);
1612
+ return r.version = n.parseVersion(), r.numGlyphs = n.parseUShort(), r.version === 1 && (r.maxPoints = n.parseUShort(), r.maxContours = n.parseUShort(), r.maxCompositePoints = n.parseUShort(), r.maxCompositeContours = n.parseUShort(), r.maxZones = n.parseUShort(), r.maxTwilightPoints = n.parseUShort(), r.maxStorage = n.parseUShort(), r.maxFunctionDefs = n.parseUShort(), r.maxInstructionDefs = n.parseUShort(), r.maxStackElements = n.parseUShort(), r.maxSizeOfInstructions = n.parseUShort(), r.maxComponentElements = n.parseUShort(), r.maxComponentDepth = n.parseUShort()), r;
1613
+ }
1614
+ function Da(e) {
1615
+ return new b.Table("maxp", [{ name: "version", type: "FIXED", value: 20480 }, { name: "numGlyphs", type: "USHORT", value: e }]);
1616
+ }
1617
+ var qr = { parse: Ua, make: Da }, _r = ["copyright", "fontFamily", "fontSubfamily", "uniqueID", "fullName", "version", "postScriptName", "trademark", "manufacturer", "designer", "description", "manufacturerURL", "designerURL", "license", "licenseURL", "reserved", "preferredFamily", "preferredSubfamily", "compatibleFullName", "sampleText", "postScriptFindFontName", "wwsFamily", "wwsSubfamily"], Xr = { 0: "en", 1: "fr", 2: "de", 3: "it", 4: "nl", 5: "sv", 6: "es", 7: "da", 8: "pt", 9: "no", 10: "he", 11: "ja", 12: "ar", 13: "fi", 14: "el", 15: "is", 16: "mt", 17: "tr", 18: "hr", 19: "zh-Hant", 20: "ur", 21: "hi", 22: "th", 23: "ko", 24: "lt", 25: "pl", 26: "hu", 27: "es", 28: "lv", 29: "se", 30: "fo", 31: "fa", 32: "ru", 33: "zh", 34: "nl-BE", 35: "ga", 36: "sq", 37: "ro", 38: "cz", 39: "sk", 40: "si", 41: "yi", 42: "sr", 43: "mk", 44: "bg", 45: "uk", 46: "be", 47: "uz", 48: "kk", 49: "az-Cyrl", 50: "az-Arab", 51: "hy", 52: "ka", 53: "mo", 54: "ky", 55: "tg", 56: "tk", 57: "mn-CN", 58: "mn", 59: "ps", 60: "ks", 61: "ku", 62: "sd", 63: "bo", 64: "ne", 65: "sa", 66: "mr", 67: "bn", 68: "as", 69: "gu", 70: "pa", 71: "or", 72: "ml", 73: "kn", 74: "ta", 75: "te", 76: "si", 77: "my", 78: "km", 79: "lo", 80: "vi", 81: "id", 82: "tl", 83: "ms", 84: "ms-Arab", 85: "am", 86: "ti", 87: "om", 88: "so", 89: "sw", 90: "rw", 91: "rn", 92: "ny", 93: "mg", 94: "eo", 128: "cy", 129: "eu", 130: "ca", 131: "la", 132: "qu", 133: "gn", 134: "ay", 135: "tt", 136: "ug", 137: "dz", 138: "jv", 139: "su", 140: "gl", 141: "af", 142: "br", 143: "iu", 144: "gd", 145: "gv", 146: "ga", 147: "to", 148: "el-polyton", 149: "kl", 150: "az", 151: "nn" }, Aa = { 0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0, 10: 5, 11: 1, 12: 4, 13: 0, 14: 6, 15: 0, 16: 0, 17: 0, 18: 0, 19: 2, 20: 4, 21: 9, 22: 21, 23: 3, 24: 29, 25: 29, 26: 29, 27: 29, 28: 29, 29: 0, 30: 0, 31: 4, 32: 7, 33: 25, 34: 0, 35: 0, 36: 0, 37: 0, 38: 29, 39: 29, 40: 0, 41: 5, 42: 7, 43: 7, 44: 7, 45: 7, 46: 7, 47: 7, 48: 7, 49: 7, 50: 4, 51: 24, 52: 23, 53: 7, 54: 7, 55: 7, 56: 7, 57: 27, 58: 7, 59: 4, 60: 4, 61: 4, 62: 4, 63: 26, 64: 9, 65: 9, 66: 9, 67: 13, 68: 13, 69: 11, 70: 10, 71: 12, 72: 17, 73: 16, 74: 14, 75: 15, 76: 18, 77: 19, 78: 20, 79: 22, 80: 30, 81: 0, 82: 0, 83: 0, 84: 4, 85: 28, 86: 28, 87: 28, 88: 0, 89: 0, 90: 0, 91: 0, 92: 0, 93: 0, 94: 0, 128: 0, 129: 0, 130: 0, 131: 0, 132: 0, 133: 0, 134: 0, 135: 7, 136: 4, 137: 26, 138: 0, 139: 0, 140: 0, 141: 0, 142: 0, 143: 28, 144: 0, 145: 0, 146: 0, 147: 0, 148: 6, 149: 0, 150: 0, 151: 0 }, Vr = { 1078: "af", 1052: "sq", 1156: "gsw", 1118: "am", 5121: "ar-DZ", 15361: "ar-BH", 3073: "ar", 2049: "ar-IQ", 11265: "ar-JO", 13313: "ar-KW", 12289: "ar-LB", 4097: "ar-LY", 6145: "ary", 8193: "ar-OM", 16385: "ar-QA", 1025: "ar-SA", 10241: "ar-SY", 7169: "aeb", 14337: "ar-AE", 9217: "ar-YE", 1067: "hy", 1101: "as", 2092: "az-Cyrl", 1068: "az", 1133: "ba", 1069: "eu", 1059: "be", 2117: "bn", 1093: "bn-IN", 8218: "bs-Cyrl", 5146: "bs", 1150: "br", 1026: "bg", 1027: "ca", 3076: "zh-HK", 5124: "zh-MO", 2052: "zh", 4100: "zh-SG", 1028: "zh-TW", 1155: "co", 1050: "hr", 4122: "hr-BA", 1029: "cs", 1030: "da", 1164: "prs", 1125: "dv", 2067: "nl-BE", 1043: "nl", 3081: "en-AU", 10249: "en-BZ", 4105: "en-CA", 9225: "en-029", 16393: "en-IN", 6153: "en-IE", 8201: "en-JM", 17417: "en-MY", 5129: "en-NZ", 13321: "en-PH", 18441: "en-SG", 7177: "en-ZA", 11273: "en-TT", 2057: "en-GB", 1033: "en", 12297: "en-ZW", 1061: "et", 1080: "fo", 1124: "fil", 1035: "fi", 2060: "fr-BE", 3084: "fr-CA", 1036: "fr", 5132: "fr-LU", 6156: "fr-MC", 4108: "fr-CH", 1122: "fy", 1110: "gl", 1079: "ka", 3079: "de-AT", 1031: "de", 5127: "de-LI", 4103: "de-LU", 2055: "de-CH", 1032: "el", 1135: "kl", 1095: "gu", 1128: "ha", 1037: "he", 1081: "hi", 1038: "hu", 1039: "is", 1136: "ig", 1057: "id", 1117: "iu", 2141: "iu-Latn", 2108: "ga", 1076: "xh", 1077: "zu", 1040: "it", 2064: "it-CH", 1041: "ja", 1099: "kn", 1087: "kk", 1107: "km", 1158: "quc", 1159: "rw", 1089: "sw", 1111: "kok", 1042: "ko", 1088: "ky", 1108: "lo", 1062: "lv", 1063: "lt", 2094: "dsb", 1134: "lb", 1071: "mk", 2110: "ms-BN", 1086: "ms", 1100: "ml", 1082: "mt", 1153: "mi", 1146: "arn", 1102: "mr", 1148: "moh", 1104: "mn", 2128: "mn-CN", 1121: "ne", 1044: "nb", 2068: "nn", 1154: "oc", 1096: "or", 1123: "ps", 1045: "pl", 1046: "pt", 2070: "pt-PT", 1094: "pa", 1131: "qu-BO", 2155: "qu-EC", 3179: "qu", 1048: "ro", 1047: "rm", 1049: "ru", 9275: "smn", 4155: "smj-NO", 5179: "smj", 3131: "se-FI", 1083: "se", 2107: "se-SE", 8251: "sms", 6203: "sma-NO", 7227: "sms", 1103: "sa", 7194: "sr-Cyrl-BA", 3098: "sr", 6170: "sr-Latn-BA", 2074: "sr-Latn", 1132: "nso", 1074: "tn", 1115: "si", 1051: "sk", 1060: "sl", 11274: "es-AR", 16394: "es-BO", 13322: "es-CL", 9226: "es-CO", 5130: "es-CR", 7178: "es-DO", 12298: "es-EC", 17418: "es-SV", 4106: "es-GT", 18442: "es-HN", 2058: "es-MX", 19466: "es-NI", 6154: "es-PA", 15370: "es-PY", 10250: "es-PE", 20490: "es-PR", 3082: "es", 1034: "es", 21514: "es-US", 14346: "es-UY", 8202: "es-VE", 2077: "sv-FI", 1053: "sv", 1114: "syr", 1064: "tg", 2143: "tzm", 1097: "ta", 1092: "tt", 1098: "te", 1054: "th", 1105: "bo", 1055: "tr", 1090: "tk", 1152: "ug", 1058: "uk", 1070: "hsb", 1056: "ur", 2115: "uz-Cyrl", 1091: "uz", 1066: "vi", 1106: "cy", 1160: "wo", 1157: "sah", 1144: "ii", 1130: "yo" };
1618
+ function Oa(e, t, r) {
1619
+ switch (e) {
1620
+ case 0:
1621
+ if (t === 65535) return "und";
1622
+ if (r) return r[t];
1623
+ break;
1624
+ case 1:
1625
+ return Xr[t];
1626
+ case 3:
1627
+ return Vr[t];
1628
+ }
1629
+ }
1630
+ var gt = "utf-16", Ba = { 0: "macintosh", 1: "x-mac-japanese", 2: "x-mac-chinesetrad", 3: "x-mac-korean", 6: "x-mac-greek", 7: "x-mac-cyrillic", 9: "x-mac-devanagai", 10: "x-mac-gurmukhi", 11: "x-mac-gujarati", 12: "x-mac-oriya", 13: "x-mac-bengali", 14: "x-mac-tamil", 15: "x-mac-telugu", 16: "x-mac-kannada", 17: "x-mac-malayalam", 18: "x-mac-sinhalese", 19: "x-mac-burmese", 20: "x-mac-khmer", 21: "x-mac-thai", 22: "x-mac-lao", 23: "x-mac-georgian", 24: "x-mac-armenian", 25: "x-mac-chinesesimp", 26: "x-mac-tibetan", 27: "x-mac-mongolian", 28: "x-mac-ethiopic", 29: "x-mac-ce", 30: "x-mac-vietnamese", 31: "x-mac-extarabic" }, Ra = { 15: "x-mac-icelandic", 17: "x-mac-turkish", 18: "x-mac-croatian", 24: "x-mac-ce", 25: "x-mac-ce", 26: "x-mac-ce", 27: "x-mac-ce", 28: "x-mac-ce", 30: "x-mac-icelandic", 37: "x-mac-romanian", 38: "x-mac-ce", 39: "x-mac-ce", 40: "x-mac-ce", 143: "x-mac-inuit", 146: "x-mac-gaelic" };
1631
+ function Yr(e, t, r) {
1632
+ switch (e) {
1633
+ case 0:
1634
+ return gt;
1635
+ case 1:
1636
+ return Ra[r] || Ba[t];
1637
+ case 3:
1638
+ if (t === 1 || t === 10) return gt;
1639
+ break;
1640
+ }
1641
+ }
1642
+ function Fa(e, t, r) {
1643
+ for (var n = {}, a = new C.Parser(e, t), o = a.parseUShort(), s = a.parseUShort(), u = a.offset + a.parseUShort(), i = 0; i < s; i++) {
1644
+ var p = a.parseUShort(), l = a.parseUShort(), h = a.parseUShort(), c = a.parseUShort(), f = _r[c] || c, v = a.parseUShort(), x = a.parseUShort(), m = Oa(p, h, r), y = Yr(p, l, h);
1645
+ if (y !== void 0 && m !== void 0) {
1646
+ var U = void 0;
1647
+ if (y === gt ? U = Te.UTF16(e, u + x, v) : U = Te.MACSTRING(e, u + x, v, y), U) {
1648
+ var S = n[f];
1649
+ S === void 0 && (S = n[f] = {}), S[m] = U;
1650
+ }
1651
+ }
1652
+ }
1653
+ return o === 1 && a.parseUShort(), n;
1654
+ }
1655
+ function nt(e) {
1656
+ var t = {};
1657
+ for (var r in e) t[e[r]] = parseInt(r);
1658
+ return t;
1659
+ }
1660
+ function Vt(e, t, r, n, a, o) {
1661
+ return new b.Record("NameRecord", [{ name: "platformID", type: "USHORT", value: e }, { name: "encodingID", type: "USHORT", value: t }, { name: "languageID", type: "USHORT", value: r }, { name: "nameID", type: "USHORT", value: n }, { name: "length", type: "USHORT", value: a }, { name: "offset", type: "USHORT", value: o }]);
1662
+ }
1663
+ function wa(e, t) {
1664
+ var r = e.length, n = t.length - r + 1;
1665
+ e: for (var a = 0; a < n; a++) for (; a < n; a++) {
1666
+ for (var o = 0; o < r; o++) if (t[a + o] !== e[o]) continue e;
1667
+ return a;
1668
+ }
1669
+ return -1;
1670
+ }
1671
+ function Yt(e, t) {
1672
+ var r = wa(e, t);
1673
+ if (r < 0) {
1674
+ r = t.length;
1675
+ for (var n = 0, a = e.length; n < a; ++n) t.push(e[n]);
1676
+ }
1677
+ return r;
1678
+ }
1679
+ function La(e, t) {
1680
+ var r, n = [], a = {}, o = nt(_r);
1681
+ for (var s in e) {
1682
+ var u = o[s];
1683
+ if (u === void 0 && (u = s), r = parseInt(u), isNaN(r)) throw new Error('Name table entry "' + s + '" does not exist, see nameTableNames for complete list.');
1684
+ a[r] = e[s], n.push(r);
1685
+ }
1686
+ for (var i = nt(Xr), p = nt(Vr), l = [], h = [], c = 0; c < n.length; c++) {
1687
+ r = n[c];
1688
+ var f = a[r];
1689
+ for (var v in f) {
1690
+ var x = f[v], m = 1, y = i[v], U = Aa[y], S = Yr(m, U, y), B = g.MACSTRING(x, S);
1691
+ B === void 0 && (m = 0, y = t.indexOf(v), y < 0 && (y = t.length, t.push(v)), U = 4, B = g.UTF16(x));
1692
+ var A = Yt(B, h);
1693
+ l.push(Vt(m, U, y, r, B.length, A));
1694
+ var F = p[v];
1695
+ if (F !== void 0) {
1696
+ var O = g.UTF16(x), T = Yt(O, h);
1697
+ l.push(Vt(3, 1, F, r, O.length, T));
1698
+ }
1699
+ }
1700
+ }
1701
+ l.sort(function(j, J) {
1702
+ return j.platformID - J.platformID || j.encodingID - J.encodingID || j.languageID - J.languageID || j.nameID - J.nameID;
1703
+ });
1704
+ for (var P = new b.Table("name", [{ name: "format", type: "USHORT", value: 0 }, { name: "count", type: "USHORT", value: l.length }, { name: "stringOffset", type: "USHORT", value: 6 + l.length * 12 }]), Y = 0; Y < l.length; Y++) P.fields.push({ name: "record_" + Y, type: "RECORD", value: l[Y] });
1705
+ return P.fields.push({ name: "strings", type: "LITERAL", value: h }), P;
1706
+ }
1707
+ var jr = { parse: Fa, make: La }, mt = [{ begin: 0, end: 127 }, { begin: 128, end: 255 }, { begin: 256, end: 383 }, { begin: 384, end: 591 }, { begin: 592, end: 687 }, { begin: 688, end: 767 }, { begin: 768, end: 879 }, { begin: 880, end: 1023 }, { begin: 11392, end: 11519 }, { begin: 1024, end: 1279 }, { begin: 1328, end: 1423 }, { begin: 1424, end: 1535 }, { begin: 42240, end: 42559 }, { begin: 1536, end: 1791 }, { begin: 1984, end: 2047 }, { begin: 2304, end: 2431 }, { begin: 2432, end: 2559 }, { begin: 2560, end: 2687 }, { begin: 2688, end: 2815 }, { begin: 2816, end: 2943 }, { begin: 2944, end: 3071 }, { begin: 3072, end: 3199 }, { begin: 3200, end: 3327 }, { begin: 3328, end: 3455 }, { begin: 3584, end: 3711 }, { begin: 3712, end: 3839 }, { begin: 4256, end: 4351 }, { begin: 6912, end: 7039 }, { begin: 4352, end: 4607 }, { begin: 7680, end: 7935 }, { begin: 7936, end: 8191 }, { begin: 8192, end: 8303 }, { begin: 8304, end: 8351 }, { begin: 8352, end: 8399 }, { begin: 8400, end: 8447 }, { begin: 8448, end: 8527 }, { begin: 8528, end: 8591 }, { begin: 8592, end: 8703 }, { begin: 8704, end: 8959 }, { begin: 8960, end: 9215 }, { begin: 9216, end: 9279 }, { begin: 9280, end: 9311 }, { begin: 9312, end: 9471 }, { begin: 9472, end: 9599 }, { begin: 9600, end: 9631 }, { begin: 9632, end: 9727 }, { begin: 9728, end: 9983 }, { begin: 9984, end: 10175 }, { begin: 12288, end: 12351 }, { begin: 12352, end: 12447 }, { begin: 12448, end: 12543 }, { begin: 12544, end: 12591 }, { begin: 12592, end: 12687 }, { begin: 43072, end: 43135 }, { begin: 12800, end: 13055 }, { begin: 13056, end: 13311 }, { begin: 44032, end: 55215 }, { begin: 55296, end: 57343 }, { begin: 67840, end: 67871 }, { begin: 19968, end: 40959 }, { begin: 57344, end: 63743 }, { begin: 12736, end: 12783 }, { begin: 64256, end: 64335 }, { begin: 64336, end: 65023 }, { begin: 65056, end: 65071 }, { begin: 65040, end: 65055 }, { begin: 65104, end: 65135 }, { begin: 65136, end: 65279 }, { begin: 65280, end: 65519 }, { begin: 65520, end: 65535 }, { begin: 3840, end: 4095 }, { begin: 1792, end: 1871 }, { begin: 1920, end: 1983 }, { begin: 3456, end: 3583 }, { begin: 4096, end: 4255 }, { begin: 4608, end: 4991 }, { begin: 5024, end: 5119 }, { begin: 5120, end: 5759 }, { begin: 5760, end: 5791 }, { begin: 5792, end: 5887 }, { begin: 6016, end: 6143 }, { begin: 6144, end: 6319 }, { begin: 10240, end: 10495 }, { begin: 40960, end: 42127 }, { begin: 5888, end: 5919 }, { begin: 66304, end: 66351 }, { begin: 66352, end: 66383 }, { begin: 66560, end: 66639 }, { begin: 118784, end: 119039 }, { begin: 119808, end: 120831 }, { begin: 1044480, end: 1048573 }, { begin: 65024, end: 65039 }, { begin: 917504, end: 917631 }, { begin: 6400, end: 6479 }, { begin: 6480, end: 6527 }, { begin: 6528, end: 6623 }, { begin: 6656, end: 6687 }, { begin: 11264, end: 11359 }, { begin: 11568, end: 11647 }, { begin: 19904, end: 19967 }, { begin: 43008, end: 43055 }, { begin: 65536, end: 65663 }, { begin: 65856, end: 65935 }, { begin: 66432, end: 66463 }, { begin: 66464, end: 66527 }, { begin: 66640, end: 66687 }, { begin: 66688, end: 66735 }, { begin: 67584, end: 67647 }, { begin: 68096, end: 68191 }, { begin: 119552, end: 119647 }, { begin: 73728, end: 74751 }, { begin: 119648, end: 119679 }, { begin: 7040, end: 7103 }, { begin: 7168, end: 7247 }, { begin: 7248, end: 7295 }, { begin: 43136, end: 43231 }, { begin: 43264, end: 43311 }, { begin: 43312, end: 43359 }, { begin: 43520, end: 43615 }, { begin: 65936, end: 65999 }, { begin: 66e3, end: 66047 }, { begin: 66208, end: 66271 }, { begin: 127024, end: 127135 }];
1708
+ function Ia(e) {
1709
+ for (var t = 0; t < mt.length; t += 1) {
1710
+ var r = mt[t];
1711
+ if (e >= r.begin && e < r.end) return t;
1712
+ }
1713
+ return -1;
1714
+ }
1715
+ function Ma(e, t) {
1716
+ var r = {}, n = new C.Parser(e, t);
1717
+ r.version = n.parseUShort(), r.xAvgCharWidth = n.parseShort(), r.usWeightClass = n.parseUShort(), r.usWidthClass = n.parseUShort(), r.fsType = n.parseUShort(), r.ySubscriptXSize = n.parseShort(), r.ySubscriptYSize = n.parseShort(), r.ySubscriptXOffset = n.parseShort(), r.ySubscriptYOffset = n.parseShort(), r.ySuperscriptXSize = n.parseShort(), r.ySuperscriptYSize = n.parseShort(), r.ySuperscriptXOffset = n.parseShort(), r.ySuperscriptYOffset = n.parseShort(), r.yStrikeoutSize = n.parseShort(), r.yStrikeoutPosition = n.parseShort(), r.sFamilyClass = n.parseShort(), r.panose = [];
1718
+ for (var a = 0; a < 10; a++) r.panose[a] = n.parseByte();
1719
+ return r.ulUnicodeRange1 = n.parseULong(), r.ulUnicodeRange2 = n.parseULong(), r.ulUnicodeRange3 = n.parseULong(), r.ulUnicodeRange4 = n.parseULong(), r.achVendID = String.fromCharCode(n.parseByte(), n.parseByte(), n.parseByte(), n.parseByte()), r.fsSelection = n.parseUShort(), r.usFirstCharIndex = n.parseUShort(), r.usLastCharIndex = n.parseUShort(), r.sTypoAscender = n.parseShort(), r.sTypoDescender = n.parseShort(), r.sTypoLineGap = n.parseShort(), r.usWinAscent = n.parseUShort(), r.usWinDescent = n.parseUShort(), r.version >= 1 && (r.ulCodePageRange1 = n.parseULong(), r.ulCodePageRange2 = n.parseULong()), r.version >= 2 && (r.sxHeight = n.parseShort(), r.sCapHeight = n.parseShort(), r.usDefaultChar = n.parseUShort(), r.usBreakChar = n.parseUShort(), r.usMaxContent = n.parseUShort()), r;
1720
+ }
1721
+ function Ga(e) {
1722
+ return new b.Table("OS/2", [{ name: "version", type: "USHORT", value: 3 }, { name: "xAvgCharWidth", type: "SHORT", value: 0 }, { name: "usWeightClass", type: "USHORT", value: 0 }, { name: "usWidthClass", type: "USHORT", value: 0 }, { name: "fsType", type: "USHORT", value: 0 }, { name: "ySubscriptXSize", type: "SHORT", value: 650 }, { name: "ySubscriptYSize", type: "SHORT", value: 699 }, { name: "ySubscriptXOffset", type: "SHORT", value: 0 }, { name: "ySubscriptYOffset", type: "SHORT", value: 140 }, { name: "ySuperscriptXSize", type: "SHORT", value: 650 }, { name: "ySuperscriptYSize", type: "SHORT", value: 699 }, { name: "ySuperscriptXOffset", type: "SHORT", value: 0 }, { name: "ySuperscriptYOffset", type: "SHORT", value: 479 }, { name: "yStrikeoutSize", type: "SHORT", value: 49 }, { name: "yStrikeoutPosition", type: "SHORT", value: 258 }, { name: "sFamilyClass", type: "SHORT", value: 0 }, { name: "bFamilyType", type: "BYTE", value: 0 }, { name: "bSerifStyle", type: "BYTE", value: 0 }, { name: "bWeight", type: "BYTE", value: 0 }, { name: "bProportion", type: "BYTE", value: 0 }, { name: "bContrast", type: "BYTE", value: 0 }, { name: "bStrokeVariation", type: "BYTE", value: 0 }, { name: "bArmStyle", type: "BYTE", value: 0 }, { name: "bLetterform", type: "BYTE", value: 0 }, { name: "bMidline", type: "BYTE", value: 0 }, { name: "bXHeight", type: "BYTE", value: 0 }, { name: "ulUnicodeRange1", type: "ULONG", value: 0 }, { name: "ulUnicodeRange2", type: "ULONG", value: 0 }, { name: "ulUnicodeRange3", type: "ULONG", value: 0 }, { name: "ulUnicodeRange4", type: "ULONG", value: 0 }, { name: "achVendID", type: "CHARARRAY", value: "XXXX" }, { name: "fsSelection", type: "USHORT", value: 0 }, { name: "usFirstCharIndex", type: "USHORT", value: 0 }, { name: "usLastCharIndex", type: "USHORT", value: 0 }, { name: "sTypoAscender", type: "SHORT", value: 0 }, { name: "sTypoDescender", type: "SHORT", value: 0 }, { name: "sTypoLineGap", type: "SHORT", value: 0 }, { name: "usWinAscent", type: "USHORT", value: 0 }, { name: "usWinDescent", type: "USHORT", value: 0 }, { name: "ulCodePageRange1", type: "ULONG", value: 0 }, { name: "ulCodePageRange2", type: "ULONG", value: 0 }, { name: "sxHeight", type: "SHORT", value: 0 }, { name: "sCapHeight", type: "SHORT", value: 0 }, { name: "usDefaultChar", type: "USHORT", value: 0 }, { name: "usBreakChar", type: "USHORT", value: 0 }, { name: "usMaxContext", type: "USHORT", value: 0 }], e);
1723
+ }
1724
+ var yt = { parse: Ma, make: Ga, unicodeRanges: mt, getUnicodeRange: Ia };
1725
+ function Pa(e, t) {
1726
+ var r = {}, n = new C.Parser(e, t);
1727
+ switch (r.version = n.parseVersion(), r.italicAngle = n.parseFixed(), r.underlinePosition = n.parseShort(), r.underlineThickness = n.parseShort(), r.isFixedPitch = n.parseULong(), r.minMemType42 = n.parseULong(), r.maxMemType42 = n.parseULong(), r.minMemType1 = n.parseULong(), r.maxMemType1 = n.parseULong(), r.version) {
1728
+ case 1:
1729
+ r.names = xe.slice();
1730
+ break;
1731
+ case 2:
1732
+ r.numberOfGlyphs = n.parseUShort(), r.glyphNameIndex = new Array(r.numberOfGlyphs);
1733
+ for (var a = 0; a < r.numberOfGlyphs; a++) r.glyphNameIndex[a] = n.parseUShort();
1734
+ r.names = [];
1735
+ for (var o = 0; o < r.numberOfGlyphs; o++) if (r.glyphNameIndex[o] >= xe.length) {
1736
+ var s = n.parseChar();
1737
+ r.names.push(n.parseString(s));
1738
+ }
1739
+ break;
1740
+ case 2.5:
1741
+ r.numberOfGlyphs = n.parseUShort(), r.offset = new Array(r.numberOfGlyphs);
1742
+ for (var u = 0; u < r.numberOfGlyphs; u++) r.offset[u] = n.parseChar();
1743
+ break;
1744
+ }
1745
+ return r;
1746
+ }
1747
+ function Na() {
1748
+ return new b.Table("post", [{ name: "version", type: "FIXED", value: 196608 }, { name: "italicAngle", type: "FIXED", value: 0 }, { name: "underlinePosition", type: "FWORD", value: 0 }, { name: "underlineThickness", type: "FWORD", value: 0 }, { name: "isFixedPitch", type: "ULONG", value: 0 }, { name: "minMemType42", type: "ULONG", value: 0 }, { name: "maxMemType42", type: "ULONG", value: 0 }, { name: "minMemType1", type: "ULONG", value: 0 }, { name: "maxMemType1", type: "ULONG", value: 0 }]);
1749
+ }
1750
+ var Zr = { parse: Pa, make: Na }, ee = new Array(9);
1751
+ ee[1] = function() {
1752
+ var e = this.offset + this.relativeOffset, t = this.parseUShort();
1753
+ if (t === 1) return { substFormat: 1, coverage: this.parsePointer(d.coverage), deltaGlyphId: this.parseUShort() };
1754
+ if (t === 2) return { substFormat: 2, coverage: this.parsePointer(d.coverage), substitute: this.parseOffset16List() };
1755
+ k.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
1756
+ };
1757
+ ee[2] = function() {
1758
+ var e = this.parseUShort();
1759
+ return k.argument(e === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), { substFormat: e, coverage: this.parsePointer(d.coverage), sequences: this.parseListOfLists() };
1760
+ };
1761
+ ee[3] = function() {
1762
+ var e = this.parseUShort();
1763
+ return k.argument(e === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), { substFormat: e, coverage: this.parsePointer(d.coverage), alternateSets: this.parseListOfLists() };
1764
+ };
1765
+ ee[4] = function() {
1766
+ var e = this.parseUShort();
1767
+ return k.argument(e === 1, "GSUB ligature table identifier-format must be 1"), { substFormat: e, coverage: this.parsePointer(d.coverage), ligatureSets: this.parseListOfLists(function() {
1768
+ return { ligGlyph: this.parseUShort(), components: this.parseUShortList(this.parseUShort() - 1) };
1769
+ }) };
1770
+ };
1771
+ var Ce = { sequenceIndex: d.uShort, lookupListIndex: d.uShort };
1772
+ ee[5] = function() {
1773
+ var e = this.offset + this.relativeOffset, t = this.parseUShort();
1774
+ if (t === 1) return { substFormat: t, coverage: this.parsePointer(d.coverage), ruleSets: this.parseListOfLists(function() {
1775
+ var a = this.parseUShort(), o = this.parseUShort();
1776
+ return { input: this.parseUShortList(a - 1), lookupRecords: this.parseRecordList(o, Ce) };
1777
+ }) };
1778
+ if (t === 2) return { substFormat: t, coverage: this.parsePointer(d.coverage), classDef: this.parsePointer(d.classDef), classSets: this.parseListOfLists(function() {
1779
+ var a = this.parseUShort(), o = this.parseUShort();
1780
+ return { classes: this.parseUShortList(a - 1), lookupRecords: this.parseRecordList(o, Ce) };
1781
+ }) };
1782
+ if (t === 3) {
1783
+ var r = this.parseUShort(), n = this.parseUShort();
1784
+ return { substFormat: t, coverages: this.parseList(r, d.pointer(d.coverage)), lookupRecords: this.parseRecordList(n, Ce) };
1785
+ }
1786
+ k.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
1787
+ };
1788
+ ee[6] = function() {
1789
+ var e = this.offset + this.relativeOffset, t = this.parseUShort();
1790
+ if (t === 1) return { substFormat: 1, coverage: this.parsePointer(d.coverage), chainRuleSets: this.parseListOfLists(function() {
1791
+ return { backtrack: this.parseUShortList(), input: this.parseUShortList(this.parseShort() - 1), lookahead: this.parseUShortList(), lookupRecords: this.parseRecordList(Ce) };
1792
+ }) };
1793
+ if (t === 2) return { substFormat: 2, coverage: this.parsePointer(d.coverage), backtrackClassDef: this.parsePointer(d.classDef), inputClassDef: this.parsePointer(d.classDef), lookaheadClassDef: this.parsePointer(d.classDef), chainClassSet: this.parseListOfLists(function() {
1794
+ return { backtrack: this.parseUShortList(), input: this.parseUShortList(this.parseShort() - 1), lookahead: this.parseUShortList(), lookupRecords: this.parseRecordList(Ce) };
1795
+ }) };
1796
+ if (t === 3) return { substFormat: 3, backtrackCoverage: this.parseList(d.pointer(d.coverage)), inputCoverage: this.parseList(d.pointer(d.coverage)), lookaheadCoverage: this.parseList(d.pointer(d.coverage)), lookupRecords: this.parseRecordList(Ce) };
1797
+ k.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
1798
+ };
1799
+ ee[7] = function() {
1800
+ var e = this.parseUShort();
1801
+ k.argument(e === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
1802
+ var t = this.parseUShort(), r = new d(this.data, this.offset + this.parseULong());
1803
+ return { substFormat: 1, lookupType: t, extension: ee[t].call(r) };
1804
+ };
1805
+ ee[8] = function() {
1806
+ var e = this.parseUShort();
1807
+ return k.argument(e === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), { substFormat: e, coverage: this.parsePointer(d.coverage), backtrackCoverage: this.parseList(d.pointer(d.coverage)), lookaheadCoverage: this.parseList(d.pointer(d.coverage)), substitutes: this.parseUShortList() };
1808
+ };
1809
+ function Ha(e, t) {
1810
+ t = t || 0;
1811
+ var r = new d(e, t), n = r.parseVersion(1);
1812
+ return k.argument(n === 1 || n === 1.1, "Unsupported GSUB table version."), n === 1 ? { version: n, scripts: r.parseScriptList(), features: r.parseFeatureList(), lookups: r.parseLookupList(ee) } : { version: n, scripts: r.parseScriptList(), features: r.parseFeatureList(), lookups: r.parseLookupList(ee), variations: r.parseFeatureVariationsList() };
1813
+ }
1814
+ var ke = new Array(9);
1815
+ ke[1] = function(e) {
1816
+ return e.substFormat === 1 ? new b.Table("substitutionTable", [{ name: "substFormat", type: "USHORT", value: 1 }, { name: "coverage", type: "TABLE", value: new b.Coverage(e.coverage) }, { name: "deltaGlyphID", type: "USHORT", value: e.deltaGlyphId }]) : new b.Table("substitutionTable", [{ name: "substFormat", type: "USHORT", value: 2 }, { name: "coverage", type: "TABLE", value: new b.Coverage(e.coverage) }].concat(b.ushortList("substitute", e.substitute)));
1817
+ };
1818
+ ke[2] = function(e) {
1819
+ return k.assert(e.substFormat === 1, "Lookup type 2 substFormat must be 1."), new b.Table("substitutionTable", [{ name: "substFormat", type: "USHORT", value: 1 }, { name: "coverage", type: "TABLE", value: new b.Coverage(e.coverage) }].concat(b.tableList("seqSet", e.sequences, function(t) {
1820
+ return new b.Table("sequenceSetTable", b.ushortList("sequence", t));
1821
+ })));
1822
+ };
1823
+ ke[3] = function(e) {
1824
+ return k.assert(e.substFormat === 1, "Lookup type 3 substFormat must be 1."), new b.Table("substitutionTable", [{ name: "substFormat", type: "USHORT", value: 1 }, { name: "coverage", type: "TABLE", value: new b.Coverage(e.coverage) }].concat(b.tableList("altSet", e.alternateSets, function(t) {
1825
+ return new b.Table("alternateSetTable", b.ushortList("alternate", t));
1826
+ })));
1827
+ };
1828
+ ke[4] = function(e) {
1829
+ return k.assert(e.substFormat === 1, "Lookup type 4 substFormat must be 1."), new b.Table("substitutionTable", [{ name: "substFormat", type: "USHORT", value: 1 }, { name: "coverage", type: "TABLE", value: new b.Coverage(e.coverage) }].concat(b.tableList("ligSet", e.ligatureSets, function(t) {
1830
+ return new b.Table("ligatureSetTable", b.tableList("ligature", t, function(r) {
1831
+ return new b.Table("ligatureTable", [{ name: "ligGlyph", type: "USHORT", value: r.ligGlyph }].concat(b.ushortList("component", r.components, r.components.length + 1)));
1832
+ }));
1833
+ })));
1834
+ };
1835
+ ke[6] = function(e) {
1836
+ if (e.substFormat === 1) {
1837
+ var t = new b.Table("chainContextTable", [{ name: "substFormat", type: "USHORT", value: e.substFormat }, { name: "coverage", type: "TABLE", value: new b.Coverage(e.coverage) }].concat(b.tableList("chainRuleSet", e.chainRuleSets, function(a) {
1838
+ return new b.Table("chainRuleSetTable", b.tableList("chainRule", a, function(o) {
1839
+ var s = b.ushortList("backtrackGlyph", o.backtrack, o.backtrack.length).concat(b.ushortList("inputGlyph", o.input, o.input.length + 1)).concat(b.ushortList("lookaheadGlyph", o.lookahead, o.lookahead.length)).concat(b.ushortList("substitution", [], o.lookupRecords.length));
1840
+ return o.lookupRecords.forEach(function(u, i) {
1841
+ s = s.concat({ name: "sequenceIndex" + i, type: "USHORT", value: u.sequenceIndex }).concat({ name: "lookupListIndex" + i, type: "USHORT", value: u.lookupListIndex });
1842
+ }), new b.Table("chainRuleTable", s);
1843
+ }));
1844
+ })));
1845
+ return t;
1846
+ } else if (e.substFormat === 2) k.assert(!1, "lookup type 6 format 2 is not yet supported.");
1847
+ else if (e.substFormat === 3) {
1848
+ var r = [{ name: "substFormat", type: "USHORT", value: e.substFormat }];
1849
+ r.push({ name: "backtrackGlyphCount", type: "USHORT", value: e.backtrackCoverage.length }), e.backtrackCoverage.forEach(function(a, o) {
1850
+ r.push({ name: "backtrackCoverage" + o, type: "TABLE", value: new b.Coverage(a) });
1851
+ }), r.push({ name: "inputGlyphCount", type: "USHORT", value: e.inputCoverage.length }), e.inputCoverage.forEach(function(a, o) {
1852
+ r.push({ name: "inputCoverage" + o, type: "TABLE", value: new b.Coverage(a) });
1853
+ }), r.push({ name: "lookaheadGlyphCount", type: "USHORT", value: e.lookaheadCoverage.length }), e.lookaheadCoverage.forEach(function(a, o) {
1854
+ r.push({ name: "lookaheadCoverage" + o, type: "TABLE", value: new b.Coverage(a) });
1855
+ }), r.push({ name: "substitutionCount", type: "USHORT", value: e.lookupRecords.length }), e.lookupRecords.forEach(function(a, o) {
1856
+ r = r.concat({ name: "sequenceIndex" + o, type: "USHORT", value: a.sequenceIndex }).concat({ name: "lookupListIndex" + o, type: "USHORT", value: a.lookupListIndex });
1857
+ });
1858
+ var n = new b.Table("chainContextTable", r);
1859
+ return n;
1860
+ }
1861
+ k.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
1862
+ };
1863
+ function za(e) {
1864
+ return new b.Table("GSUB", [{ name: "version", type: "ULONG", value: 65536 }, { name: "scripts", type: "TABLE", value: new b.ScriptList(e.scripts) }, { name: "features", type: "TABLE", value: new b.FeatureList(e.features) }, { name: "lookups", type: "TABLE", value: new b.LookupList(e.lookups, ke) }]);
1865
+ }
1866
+ var Qr = { parse: Ha, make: za };
1867
+ function Wa(e, t) {
1868
+ var r = new C.Parser(e, t), n = r.parseULong();
1869
+ k.argument(n === 1, "Unsupported META table version."), r.parseULong(), r.parseULong();
1870
+ for (var a = r.parseULong(), o = {}, s = 0; s < a; s++) {
1871
+ var u = r.parseTag(), i = r.parseULong(), p = r.parseULong(), l = Te.UTF8(e, t + i, p);
1872
+ o[u] = l;
1873
+ }
1874
+ return o;
1875
+ }
1876
+ function qa(e) {
1877
+ var t = Object.keys(e).length, r = "", n = 16 + t * 12, a = new b.Table("meta", [{ name: "version", type: "ULONG", value: 1 }, { name: "flags", type: "ULONG", value: 0 }, { name: "offset", type: "ULONG", value: n }, { name: "numTags", type: "ULONG", value: t }]);
1878
+ for (var o in e) {
1879
+ var s = r.length;
1880
+ r += e[o], a.fields.push({ name: "tag " + o, type: "TAG", value: o }), a.fields.push({ name: "offset " + o, type: "ULONG", value: n + s }), a.fields.push({ name: "length " + o, type: "ULONG", value: e[o].length });
1881
+ }
1882
+ return a.fields.push({ name: "stringPool", type: "CHARARRAY", value: r }), a;
1883
+ }
1884
+ var Kr = { parse: Wa, make: qa };
1885
+ function jt(e) {
1886
+ return Math.log(e) / Math.log(2) | 0;
1887
+ }
1888
+ function Dt(e) {
1889
+ for (; e.length % 4 !== 0; ) e.push(0);
1890
+ for (var t = 0, r = 0; r < e.length; r += 4) t += (e[r] << 24) + (e[r + 1] << 16) + (e[r + 2] << 8) + e[r + 3];
1891
+ return t %= Math.pow(2, 32), t;
1892
+ }
1893
+ function Zt(e, t, r, n) {
1894
+ return new b.Record("Table Record", [{ name: "tag", type: "TAG", value: e !== void 0 ? e : "" }, { name: "checkSum", type: "ULONG", value: t !== void 0 ? t : 0 }, { name: "offset", type: "ULONG", value: r !== void 0 ? r : 0 }, { name: "length", type: "ULONG", value: n !== void 0 ? n : 0 }]);
1895
+ }
1896
+ function Jr(e) {
1897
+ var t = new b.Table("sfnt", [{ name: "version", type: "TAG", value: "OTTO" }, { name: "numTables", type: "USHORT", value: 0 }, { name: "searchRange", type: "USHORT", value: 0 }, { name: "entrySelector", type: "USHORT", value: 0 }, { name: "rangeShift", type: "USHORT", value: 0 }]);
1898
+ t.tables = e, t.numTables = e.length;
1899
+ var r = Math.pow(2, jt(t.numTables));
1900
+ t.searchRange = 16 * r, t.entrySelector = jt(r), t.rangeShift = t.numTables * 16 - t.searchRange;
1901
+ for (var n = [], a = [], o = t.sizeOf() + Zt().sizeOf() * t.numTables; o % 4 !== 0; ) o += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
1902
+ for (var s = 0; s < e.length; s += 1) {
1903
+ var u = e[s];
1904
+ k.argument(u.tableName.length === 4, "Table name" + u.tableName + " is invalid.");
1905
+ var i = u.sizeOf(), p = Zt(u.tableName, Dt(u.encode()), o, i);
1906
+ for (n.push({ name: p.tag + " Table Record", type: "RECORD", value: p }), a.push({ name: u.tableName + " table", type: "RECORD", value: u }), o += i, k.argument(!isNaN(o), "Something went wrong calculating the offset."); o % 4 !== 0; ) o += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
1907
+ }
1908
+ return n.sort(function(l, h) {
1909
+ return l.value.tag > h.value.tag ? 1 : -1;
1910
+ }), t.fields = t.fields.concat(n), t.fields = t.fields.concat(a), t;
1911
+ }
1912
+ function Qt(e, t, r) {
1913
+ for (var n = 0; n < t.length; n += 1) {
1914
+ var a = e.charToGlyphIndex(t[n]);
1915
+ if (a > 0) {
1916
+ var o = e.glyphs.get(a);
1917
+ return o.getMetrics();
1918
+ }
1919
+ }
1920
+ return r;
1921
+ }
1922
+ function _a(e) {
1923
+ for (var t = 0, r = 0; r < e.length; r += 1) t += e[r];
1924
+ return t / e.length;
1925
+ }
1926
+ function Xa(e) {
1927
+ for (var t = [], r = [], n = [], a = [], o = [], s = [], u = [], i, p = 0, l = 0, h = 0, c = 0, f = 0, v = 0; v < e.glyphs.length; v += 1) {
1928
+ var x = e.glyphs.get(v), m = x.unicode | 0;
1929
+ if (isNaN(x.advanceWidth)) throw new Error("Glyph " + x.name + " (" + v + "): advanceWidth is not a number.");
1930
+ (i > m || i === void 0) && m > 0 && (i = m), p < m && (p = m);
1931
+ var y = yt.getUnicodeRange(m);
1932
+ if (y < 32) l |= 1 << y;
1933
+ else if (y < 64) h |= 1 << y - 32;
1934
+ else if (y < 96) c |= 1 << y - 64;
1935
+ else if (y < 123) f |= 1 << y - 96;
1936
+ else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");
1937
+ if (x.name !== ".notdef") {
1938
+ var U = x.getMetrics();
1939
+ t.push(U.xMin), r.push(U.yMin), n.push(U.xMax), a.push(U.yMax), s.push(U.leftSideBearing), u.push(U.rightSideBearing), o.push(x.advanceWidth);
1940
+ }
1941
+ }
1942
+ var S = { xMin: Math.min.apply(null, t), yMin: Math.min.apply(null, r), xMax: Math.max.apply(null, n), yMax: Math.max.apply(null, a), advanceWidthMax: Math.max.apply(null, o), advanceWidthAvg: _a(o), minLeftSideBearing: Math.min.apply(null, s), maxLeftSideBearing: Math.max.apply(null, s), minRightSideBearing: Math.min.apply(null, u) };
1943
+ S.ascender = e.ascender, S.descender = e.descender;
1944
+ var B = Nr.make({ flags: 3, unitsPerEm: e.unitsPerEm, xMin: S.xMin, yMin: S.yMin, xMax: S.xMax, yMax: S.yMax, lowestRecPPEM: 3, createdTimestamp: e.createdTimestamp }), A = Hr.make({ ascender: S.ascender, descender: S.descender, advanceWidthMax: S.advanceWidthMax, minLeftSideBearing: S.minLeftSideBearing, minRightSideBearing: S.minRightSideBearing, xMaxExtent: S.maxLeftSideBearing + (S.xMax - S.xMin), numberOfHMetrics: e.glyphs.length }), F = qr.make(e.glyphs.length), O = yt.make(Object.assign({ xAvgCharWidth: Math.round(S.advanceWidthAvg), usFirstCharIndex: i, usLastCharIndex: p, ulUnicodeRange1: l, ulUnicodeRange2: h, ulUnicodeRange3: c, ulUnicodeRange4: f, sTypoAscender: S.ascender, sTypoDescender: S.descender, sTypoLineGap: 0, usWinAscent: S.yMax, usWinDescent: Math.abs(S.yMin), ulCodePageRange1: 1, sxHeight: Qt(e, "xyvw", { yMax: Math.round(S.ascender / 2) }).yMax, sCapHeight: Qt(e, "HIKLEFJMNTZBDPRAGOQSUVWXY", S).yMax, usDefaultChar: e.hasChar(" ") ? 32 : 0, usBreakChar: e.hasChar(" ") ? 32 : 0 }, e.tables.os2)), T = zr.make(e.glyphs), P = Dr.make(e.glyphs), Y = e.getEnglishName("fontFamily"), j = e.getEnglishName("fontSubfamily"), J = Y + " " + j, $ = e.getEnglishName("postScriptName");
1945
+ $ || ($ = Y.replace(/\s/g, "") + "-" + j);
1946
+ var M = {};
1947
+ for (var N in e.names) M[N] = e.names[N];
1948
+ M.uniqueID || (M.uniqueID = { en: e.getEnglishName("manufacturer") + ":" + J }), M.postScriptName || (M.postScriptName = { en: $ }), M.preferredFamily || (M.preferredFamily = e.names.fontFamily), M.preferredSubfamily || (M.preferredSubfamily = e.names.fontSubfamily);
1949
+ var W = [], q = jr.make(M, W), _ = W.length > 0 ? Wr.make(W) : void 0, H = Zr.make(), V = Pr.make(e.glyphs, { version: e.getEnglishName("version"), fullName: J, familyName: Y, weightName: j, postScriptName: $, unitsPerEm: e.unitsPerEm, fontBBox: [0, S.yMin, S.ascender, S.advanceWidthMax] }), w = e.metas && Object.keys(e.metas).length > 0 ? Kr.make(e.metas) : void 0, X = [B, A, F, O, q, P, H, V, T];
1950
+ _ && X.push(_), e.tables.gsub && X.push(Qr.make(e.tables.gsub)), w && X.push(w);
1951
+ for (var et = Jr(X), fn = et.encode(), dn = Dt(fn), tt = et.fields, wt = !1, Pe = 0; Pe < tt.length; Pe += 1) if (tt[Pe].name === "head table") {
1952
+ tt[Pe].value.checkSumAdjustment = 2981146554 - dn, wt = !0;
1953
+ break;
1954
+ }
1955
+ if (!wt) throw new Error("Could not find head table with checkSum to adjust.");
1956
+ return et;
1957
+ }
1958
+ var Va = { make: Jr, fontToTable: Xa, computeCheckSum: Dt };
1959
+ function at(e, t) {
1960
+ for (var r = 0, n = e.length - 1; r <= n; ) {
1961
+ var a = r + n >>> 1, o = e[a].tag;
1962
+ if (o === t) return a;
1963
+ o < t ? r = a + 1 : n = a - 1;
1964
+ }
1965
+ return -r - 1;
1966
+ }
1967
+ function Kt(e, t) {
1968
+ for (var r = 0, n = e.length - 1; r <= n; ) {
1969
+ var a = r + n >>> 1, o = e[a];
1970
+ if (o === t) return a;
1971
+ o < t ? r = a + 1 : n = a - 1;
1972
+ }
1973
+ return -r - 1;
1974
+ }
1975
+ function Jt(e, t) {
1976
+ for (var r, n = 0, a = e.length - 1; n <= a; ) {
1977
+ var o = n + a >>> 1;
1978
+ r = e[o];
1979
+ var s = r.start;
1980
+ if (s === t) return r;
1981
+ s < t ? n = o + 1 : a = o - 1;
1982
+ }
1983
+ if (n > 0) return r = e[n - 1], t > r.end ? 0 : r;
1984
+ }
1985
+ function we(e, t) {
1986
+ this.font = e, this.tableName = t;
1987
+ }
1988
+ we.prototype = { searchTag: at, binSearch: Kt, getTable: function(e) {
1989
+ var t = this.font.tables[this.tableName];
1990
+ return !t && e && (t = this.font.tables[this.tableName] = this.createDefaultTable()), t;
1991
+ }, getScriptNames: function() {
1992
+ var e = this.getTable();
1993
+ return e ? e.scripts.map(function(t) {
1994
+ return t.tag;
1995
+ }) : [];
1996
+ }, getDefaultScriptName: function() {
1997
+ var e = this.getTable();
1998
+ if (e) {
1999
+ for (var t = !1, r = 0; r < e.scripts.length; r++) {
2000
+ var n = e.scripts[r].tag;
2001
+ if (n === "DFLT") return n;
2002
+ n === "latn" && (t = !0);
2003
+ }
2004
+ if (t) return "latn";
2005
+ }
2006
+ }, getScriptTable: function(e, t) {
2007
+ var r = this.getTable(t);
2008
+ if (r) {
2009
+ e = e || "DFLT";
2010
+ var n = r.scripts, a = at(r.scripts, e);
2011
+ if (a >= 0) return n[a].script;
2012
+ if (t) {
2013
+ var o = { tag: e, script: { defaultLangSys: { reserved: 0, reqFeatureIndex: 65535, featureIndexes: [] }, langSysRecords: [] } };
2014
+ return n.splice(-1 - a, 0, o), o.script;
2015
+ }
2016
+ }
2017
+ }, getLangSysTable: function(e, t, r) {
2018
+ var n = this.getScriptTable(e, r);
2019
+ if (n) {
2020
+ if (!t || t === "dflt" || t === "DFLT") return n.defaultLangSys;
2021
+ var a = at(n.langSysRecords, t);
2022
+ if (a >= 0) return n.langSysRecords[a].langSys;
2023
+ if (r) {
2024
+ var o = { tag: t, langSys: { reserved: 0, reqFeatureIndex: 65535, featureIndexes: [] } };
2025
+ return n.langSysRecords.splice(-1 - a, 0, o), o.langSys;
2026
+ }
2027
+ }
2028
+ }, getFeatureTable: function(e, t, r, n) {
2029
+ var a = this.getLangSysTable(e, t, n);
2030
+ if (a) {
2031
+ for (var o, s = a.featureIndexes, u = this.font.tables[this.tableName].features, i = 0; i < s.length; i++) if (o = u[s[i]], o.tag === r) return o.feature;
2032
+ if (n) {
2033
+ var p = u.length;
2034
+ return k.assert(p === 0 || r >= u[p - 1].tag, "Features must be added in alphabetical order."), o = { tag: r, feature: { params: 0, lookupListIndexes: [] } }, u.push(o), s.push(p), o.feature;
2035
+ }
2036
+ }
2037
+ }, getLookupTables: function(e, t, r, n, a) {
2038
+ var o = this.getFeatureTable(e, t, r, a), s = [];
2039
+ if (o) {
2040
+ for (var u, i = o.lookupListIndexes, p = this.font.tables[this.tableName].lookups, l = 0; l < i.length; l++) u = p[i[l]], u.lookupType === n && s.push(u);
2041
+ if (s.length === 0 && a) {
2042
+ u = { lookupType: n, lookupFlag: 0, subtables: [], markFilteringSet: void 0 };
2043
+ var h = p.length;
2044
+ return p.push(u), i.push(h), [u];
2045
+ }
2046
+ }
2047
+ return s;
2048
+ }, getGlyphClass: function(e, t) {
2049
+ switch (e.format) {
2050
+ case 1:
2051
+ return e.startGlyph <= t && t < e.startGlyph + e.classes.length ? e.classes[t - e.startGlyph] : 0;
2052
+ case 2:
2053
+ var r = Jt(e.ranges, t);
2054
+ return r ? r.classId : 0;
2055
+ }
2056
+ }, getCoverageIndex: function(e, t) {
2057
+ switch (e.format) {
2058
+ case 1:
2059
+ var r = Kt(e.glyphs, t);
2060
+ return r >= 0 ? r : -1;
2061
+ case 2:
2062
+ var n = Jt(e.ranges, t);
2063
+ return n ? n.index + t - n.start : -1;
2064
+ }
2065
+ }, expandCoverage: function(e) {
2066
+ if (e.format === 1) return e.glyphs;
2067
+ for (var t = [], r = e.ranges, n = 0; n < r.length; n++) for (var a = r[n], o = a.start, s = a.end, u = o; u <= s; u++) t.push(u);
2068
+ return t;
2069
+ } };
2070
+ function Le(e) {
2071
+ we.call(this, e, "gpos");
2072
+ }
2073
+ Le.prototype = we.prototype;
2074
+ Le.prototype.init = function() {
2075
+ var e = this.getDefaultScriptName();
2076
+ this.defaultKerningTables = this.getKerningTables(e);
2077
+ };
2078
+ Le.prototype.getKerningValue = function(e, t, r) {
2079
+ for (var n = 0; n < e.length; n++) for (var a = e[n].subtables, o = 0; o < a.length; o++) {
2080
+ var s = a[o], u = this.getCoverageIndex(s.coverage, t);
2081
+ if (!(u < 0)) switch (s.posFormat) {
2082
+ case 1:
2083
+ for (var i = s.pairSets[u], p = 0; p < i.length; p++) {
2084
+ var l = i[p];
2085
+ if (l.secondGlyph === r) return l.value1 && l.value1.xAdvance || 0;
2086
+ }
2087
+ break;
2088
+ case 2:
2089
+ var h = this.getGlyphClass(s.classDef1, t), c = this.getGlyphClass(s.classDef2, r), f = s.classRecords[h][c];
2090
+ return f.value1 && f.value1.xAdvance || 0;
2091
+ }
2092
+ }
2093
+ return 0;
2094
+ };
2095
+ Le.prototype.getKerningTables = function(e, t) {
2096
+ if (this.font.tables.gpos) return this.getLookupTables(e, t, "kern", 2);
2097
+ };
2098
+ function Q(e) {
2099
+ we.call(this, e, "gsub");
2100
+ }
2101
+ function Ya(e, t) {
2102
+ var r = e.length;
2103
+ if (r !== t.length) return !1;
2104
+ for (var n = 0; n < r; n++) if (e[n] !== t[n]) return !1;
2105
+ return !0;
2106
+ }
2107
+ function At(e, t, r) {
2108
+ for (var n = e.subtables, a = 0; a < n.length; a++) {
2109
+ var o = n[a];
2110
+ if (o.substFormat === t) return o;
2111
+ }
2112
+ if (r) return n.push(r), r;
2113
+ }
2114
+ Q.prototype = we.prototype;
2115
+ Q.prototype.createDefaultTable = function() {
2116
+ return { version: 1, scripts: [{ tag: "DFLT", script: { defaultLangSys: { reserved: 0, reqFeatureIndex: 65535, featureIndexes: [] }, langSysRecords: [] } }], features: [], lookups: [] };
2117
+ };
2118
+ Q.prototype.getSingle = function(e, t, r) {
2119
+ for (var n = [], a = this.getLookupTables(t, r, e, 1), o = 0; o < a.length; o++) for (var s = a[o].subtables, u = 0; u < s.length; u++) {
2120
+ var i = s[u], p = this.expandCoverage(i.coverage), l = void 0;
2121
+ if (i.substFormat === 1) {
2122
+ var h = i.deltaGlyphId;
2123
+ for (l = 0; l < p.length; l++) {
2124
+ var c = p[l];
2125
+ n.push({ sub: c, by: c + h });
2126
+ }
2127
+ } else {
2128
+ var f = i.substitute;
2129
+ for (l = 0; l < p.length; l++) n.push({ sub: p[l], by: f[l] });
2130
+ }
2131
+ }
2132
+ return n;
2133
+ };
2134
+ Q.prototype.getMultiple = function(e, t, r) {
2135
+ for (var n = [], a = this.getLookupTables(t, r, e, 2), o = 0; o < a.length; o++) for (var s = a[o].subtables, u = 0; u < s.length; u++) {
2136
+ var i = s[u], p = this.expandCoverage(i.coverage), l = void 0;
2137
+ for (l = 0; l < p.length; l++) {
2138
+ var h = p[l], c = i.sequences[l];
2139
+ n.push({ sub: h, by: c });
2140
+ }
2141
+ }
2142
+ return n;
2143
+ };
2144
+ Q.prototype.getAlternates = function(e, t, r) {
2145
+ for (var n = [], a = this.getLookupTables(t, r, e, 3), o = 0; o < a.length; o++) for (var s = a[o].subtables, u = 0; u < s.length; u++) for (var i = s[u], p = this.expandCoverage(i.coverage), l = i.alternateSets, h = 0; h < p.length; h++) n.push({ sub: p[h], by: l[h] });
2146
+ return n;
2147
+ };
2148
+ Q.prototype.getLigatures = function(e, t, r) {
2149
+ for (var n = [], a = this.getLookupTables(t, r, e, 4), o = 0; o < a.length; o++) for (var s = a[o].subtables, u = 0; u < s.length; u++) for (var i = s[u], p = this.expandCoverage(i.coverage), l = i.ligatureSets, h = 0; h < p.length; h++) for (var c = p[h], f = l[h], v = 0; v < f.length; v++) {
2150
+ var x = f[v];
2151
+ n.push({ sub: [c].concat(x.components), by: x.ligGlyph });
2152
+ }
2153
+ return n;
2154
+ };
2155
+ Q.prototype.addSingle = function(e, t, r, n) {
2156
+ var a = this.getLookupTables(r, n, e, 1, !0)[0], o = At(a, 2, { substFormat: 2, coverage: { format: 1, glyphs: [] }, substitute: [] });
2157
+ k.assert(o.coverage.format === 1, "Single: unable to modify coverage table format " + o.coverage.format);
2158
+ var s = t.sub, u = this.binSearch(o.coverage.glyphs, s);
2159
+ u < 0 && (u = -1 - u, o.coverage.glyphs.splice(u, 0, s), o.substitute.splice(u, 0, 0)), o.substitute[u] = t.by;
2160
+ };
2161
+ Q.prototype.addMultiple = function(e, t, r, n) {
2162
+ k.assert(t.by instanceof Array && t.by.length > 1, 'Multiple: "by" must be an array of two or more ids');
2163
+ var a = this.getLookupTables(r, n, e, 2, !0)[0], o = At(a, 1, { substFormat: 1, coverage: { format: 1, glyphs: [] }, sequences: [] });
2164
+ k.assert(o.coverage.format === 1, "Multiple: unable to modify coverage table format " + o.coverage.format);
2165
+ var s = t.sub, u = this.binSearch(o.coverage.glyphs, s);
2166
+ u < 0 && (u = -1 - u, o.coverage.glyphs.splice(u, 0, s), o.sequences.splice(u, 0, 0)), o.sequences[u] = t.by;
2167
+ };
2168
+ Q.prototype.addAlternate = function(e, t, r, n) {
2169
+ var a = this.getLookupTables(r, n, e, 3, !0)[0], o = At(a, 1, { substFormat: 1, coverage: { format: 1, glyphs: [] }, alternateSets: [] });
2170
+ k.assert(o.coverage.format === 1, "Alternate: unable to modify coverage table format " + o.coverage.format);
2171
+ var s = t.sub, u = this.binSearch(o.coverage.glyphs, s);
2172
+ u < 0 && (u = -1 - u, o.coverage.glyphs.splice(u, 0, s), o.alternateSets.splice(u, 0, 0)), o.alternateSets[u] = t.by;
2173
+ };
2174
+ Q.prototype.addLigature = function(e, t, r, n) {
2175
+ var a = this.getLookupTables(r, n, e, 4, !0)[0], o = a.subtables[0];
2176
+ o || (o = { substFormat: 1, coverage: { format: 1, glyphs: [] }, ligatureSets: [] }, a.subtables[0] = o), k.assert(o.coverage.format === 1, "Ligature: unable to modify coverage table format " + o.coverage.format);
2177
+ var s = t.sub[0], u = t.sub.slice(1), i = { ligGlyph: t.by, components: u }, p = this.binSearch(o.coverage.glyphs, s);
2178
+ if (p >= 0) {
2179
+ for (var l = o.ligatureSets[p], h = 0; h < l.length; h++) if (Ya(l[h].components, u)) return;
2180
+ l.push(i);
2181
+ } else p = -1 - p, o.coverage.glyphs.splice(p, 0, s), o.ligatureSets.splice(p, 0, [i]);
2182
+ };
2183
+ Q.prototype.getFeature = function(e, t, r) {
2184
+ if (/ss\d\d/.test(e)) return this.getSingle(e, t, r);
2185
+ switch (e) {
2186
+ case "aalt":
2187
+ case "salt":
2188
+ return this.getSingle(e, t, r).concat(this.getAlternates(e, t, r));
2189
+ case "dlig":
2190
+ case "liga":
2191
+ case "rlig":
2192
+ return this.getLigatures(e, t, r);
2193
+ case "ccmp":
2194
+ return this.getMultiple(e, t, r).concat(this.getLigatures(e, t, r));
2195
+ case "stch":
2196
+ return this.getMultiple(e, t, r);
2197
+ }
2198
+ };
2199
+ Q.prototype.add = function(e, t, r, n) {
2200
+ if (/ss\d\d/.test(e)) return this.addSingle(e, t, r, n);
2201
+ switch (e) {
2202
+ case "aalt":
2203
+ case "salt":
2204
+ return typeof t.by == "number" ? this.addSingle(e, t, r, n) : this.addAlternate(e, t, r, n);
2205
+ case "dlig":
2206
+ case "liga":
2207
+ case "rlig":
2208
+ return this.addLigature(e, t, r, n);
2209
+ case "ccmp":
2210
+ return t.by instanceof Array ? this.addMultiple(e, t, r, n) : this.addLigature(e, t, r, n);
2211
+ }
2212
+ };
2213
+ function ja() {
2214
+ return typeof window < "u";
2215
+ }
2216
+ function $r(e) {
2217
+ for (var t = new ArrayBuffer(e.length), r = new Uint8Array(t), n = 0; n < e.length; ++n) r[n] = e[n];
2218
+ return t;
2219
+ }
2220
+ function Za(e) {
2221
+ for (var t = new Buffer(e.byteLength), r = new Uint8Array(e), n = 0; n < t.length; ++n) t[n] = r[n];
2222
+ return t;
2223
+ }
2224
+ function De(e, t) {
2225
+ if (!e) throw t;
2226
+ }
2227
+ function $t(e, t, r, n, a) {
2228
+ var o;
2229
+ return (t & n) > 0 ? (o = e.parseByte(), !(t & a) && (o = -o), o = r + o) : (t & a) > 0 ? o = r : o = r + e.parseShort(), o;
2230
+ }
2231
+ function en(e, t, r) {
2232
+ var n = new C.Parser(t, r);
2233
+ e.numberOfContours = n.parseShort(), e._xMin = n.parseShort(), e._yMin = n.parseShort(), e._xMax = n.parseShort(), e._yMax = n.parseShort();
2234
+ var a, o;
2235
+ if (e.numberOfContours > 0) {
2236
+ for (var s = e.endPointIndices = [], u = 0; u < e.numberOfContours; u += 1) s.push(n.parseUShort());
2237
+ e.instructionLength = n.parseUShort(), e.instructions = [];
2238
+ for (var i = 0; i < e.instructionLength; i += 1) e.instructions.push(n.parseByte());
2239
+ var p = s[s.length - 1] + 1;
2240
+ a = [];
2241
+ for (var l = 0; l < p; l += 1) if (o = n.parseByte(), a.push(o), (o & 8) > 0) for (var h = n.parseByte(), c = 0; c < h; c += 1) a.push(o), l += 1;
2242
+ if (k.argument(a.length === p, "Bad flags."), s.length > 0) {
2243
+ var f = [], v;
2244
+ if (p > 0) {
2245
+ for (var x = 0; x < p; x += 1) o = a[x], v = {}, v.onCurve = !!(o & 1), v.lastPointOfContour = s.indexOf(x) >= 0, f.push(v);
2246
+ for (var m = 0, y = 0; y < p; y += 1) o = a[y], v = f[y], v.x = $t(n, o, m, 2, 16), m = v.x;
2247
+ for (var U = 0, S = 0; S < p; S += 1) o = a[S], v = f[S], v.y = $t(n, o, U, 4, 32), U = v.y;
2248
+ }
2249
+ e.points = f;
2250
+ } else e.points = [];
2251
+ } else if (e.numberOfContours === 0) e.points = [];
2252
+ else {
2253
+ e.isComposite = !0, e.points = [], e.components = [];
2254
+ for (var B = !0; B; ) {
2255
+ a = n.parseUShort();
2256
+ var A = { glyphIndex: n.parseUShort(), xScale: 1, scale01: 0, scale10: 0, yScale: 1, dx: 0, dy: 0 };
2257
+ (a & 1) > 0 ? (a & 2) > 0 ? (A.dx = n.parseShort(), A.dy = n.parseShort()) : A.matchedPoints = [n.parseUShort(), n.parseUShort()] : (a & 2) > 0 ? (A.dx = n.parseChar(), A.dy = n.parseChar()) : A.matchedPoints = [n.parseByte(), n.parseByte()], (a & 8) > 0 ? A.xScale = A.yScale = n.parseF2Dot14() : (a & 64) > 0 ? (A.xScale = n.parseF2Dot14(), A.yScale = n.parseF2Dot14()) : (a & 128) > 0 && (A.xScale = n.parseF2Dot14(), A.scale01 = n.parseF2Dot14(), A.scale10 = n.parseF2Dot14(), A.yScale = n.parseF2Dot14()), e.components.push(A), B = !!(a & 32);
2258
+ }
2259
+ if (a & 256) {
2260
+ e.instructionLength = n.parseUShort(), e.instructions = [];
2261
+ for (var F = 0; F < e.instructionLength; F += 1) e.instructions.push(n.parseByte());
2262
+ }
2263
+ }
2264
+ }
2265
+ function ot(e, t) {
2266
+ for (var r = [], n = 0; n < e.length; n += 1) {
2267
+ var a = e[n], o = { x: t.xScale * a.x + t.scale01 * a.y + t.dx, y: t.scale10 * a.x + t.yScale * a.y + t.dy, onCurve: a.onCurve, lastPointOfContour: a.lastPointOfContour };
2268
+ r.push(o);
2269
+ }
2270
+ return r;
2271
+ }
2272
+ function Qa(e) {
2273
+ for (var t = [], r = [], n = 0; n < e.length; n += 1) {
2274
+ var a = e[n];
2275
+ r.push(a), a.lastPointOfContour && (t.push(r), r = []);
2276
+ }
2277
+ return k.argument(r.length === 0, "There are still points left in the current contour."), t;
2278
+ }
2279
+ function tn(e) {
2280
+ var t = new G();
2281
+ if (!e) return t;
2282
+ for (var r = Qa(e), n = 0; n < r.length; ++n) {
2283
+ var a = r[n], o = null, s = a[a.length - 1], u = a[0];
2284
+ if (s.onCurve) t.moveTo(s.x, s.y);
2285
+ else if (u.onCurve) t.moveTo(u.x, u.y);
2286
+ else {
2287
+ var i = { x: (s.x + u.x) * 0.5, y: (s.y + u.y) * 0.5 };
2288
+ t.moveTo(i.x, i.y);
2289
+ }
2290
+ for (var p = 0; p < a.length; ++p) if (o = s, s = u, u = a[(p + 1) % a.length], s.onCurve) t.lineTo(s.x, s.y);
2291
+ else {
2292
+ var l = u;
2293
+ o.onCurve || ((s.x + o.x) * 0.5, (s.y + o.y) * 0.5), u.onCurve || (l = { x: (s.x + u.x) * 0.5, y: (s.y + u.y) * 0.5 }), t.quadraticCurveTo(s.x, s.y, l.x, l.y);
2294
+ }
2295
+ t.closePath();
2296
+ }
2297
+ return t;
2298
+ }
2299
+ function rn(e, t) {
2300
+ if (t.isComposite) for (var r = 0; r < t.components.length; r += 1) {
2301
+ var n = t.components[r], a = e.get(n.glyphIndex);
2302
+ if (a.getPath(), a.points) {
2303
+ var o = void 0;
2304
+ if (n.matchedPoints === void 0) o = ot(a.points, n);
2305
+ else {
2306
+ if (n.matchedPoints[0] > t.points.length - 1 || n.matchedPoints[1] > a.points.length - 1) throw Error("Matched points out of range in " + t.name);
2307
+ var s = t.points[n.matchedPoints[0]], u = a.points[n.matchedPoints[1]], i = { xScale: n.xScale, scale01: n.scale01, scale10: n.scale10, yScale: n.yScale, dx: 0, dy: 0 };
2308
+ u = ot([u], i)[0], i.dx = s.x - u.x, i.dy = s.y - u.y, o = ot(a.points, i);
2309
+ }
2310
+ t.points = t.points.concat(o);
2311
+ }
2312
+ }
2313
+ return tn(t.points);
2314
+ }
2315
+ function Ka(e, t, r, n) {
2316
+ for (var a = new ue.GlyphSet(n), o = 0; o < r.length - 1; o += 1) {
2317
+ var s = r[o], u = r[o + 1];
2318
+ s !== u ? a.push(o, ue.ttfGlyphLoader(n, o, en, e, t + s, rn)) : a.push(o, ue.glyphLoader(n, o));
2319
+ }
2320
+ return a;
2321
+ }
2322
+ function Ja(e, t, r, n) {
2323
+ var a = new ue.GlyphSet(n);
2324
+ return n._push = function(o) {
2325
+ var s = r[o], u = r[o + 1];
2326
+ s !== u ? a.push(o, ue.ttfGlyphLoader(n, o, en, e, t + s, rn)) : a.push(o, ue.glyphLoader(n, o));
2327
+ }, a;
2328
+ }
2329
+ function $a(e, t, r, n, a) {
2330
+ return a.lowMemory ? Ja(e, t, r, n) : Ka(e, t, r, n);
2331
+ }
2332
+ var nn = { getPath: tn, parse: $a }, an, Se, on, xt;
2333
+ function sn(e) {
2334
+ this.font = e, this.getCommands = function(t) {
2335
+ return nn.getPath(t).commands;
2336
+ }, this._fpgmState = this._prepState = void 0, this._errorState = 0;
2337
+ }
2338
+ function eo(e) {
2339
+ return e;
2340
+ }
2341
+ function un(e) {
2342
+ return Math.sign(e) * Math.round(Math.abs(e));
2343
+ }
2344
+ function to(e) {
2345
+ return Math.sign(e) * Math.round(Math.abs(e * 2)) / 2;
2346
+ }
2347
+ function ro(e) {
2348
+ return Math.sign(e) * (Math.round(Math.abs(e) + 0.5) - 0.5);
2349
+ }
2350
+ function no(e) {
2351
+ return Math.sign(e) * Math.ceil(Math.abs(e));
2352
+ }
2353
+ function ao(e) {
2354
+ return Math.sign(e) * Math.floor(Math.abs(e));
2355
+ }
2356
+ var ln = function(e) {
2357
+ var t = this.srPeriod, r = this.srPhase, n = this.srThreshold, a = 1;
2358
+ return e < 0 && (e = -e, a = -1), e += n - r, e = Math.trunc(e / t) * t, e += r, e < 0 ? r * a : e * a;
2359
+ }, ie = { x: 1, y: 0, axis: "x", distance: function(e, t, r, n) {
2360
+ return (r ? e.xo : e.x) - (n ? t.xo : t.x);
2361
+ }, interpolate: function(e, t, r, n) {
2362
+ var a, o, s, u, i, p, l;
2363
+ if (!n || n === this) {
2364
+ if (a = e.xo - t.xo, o = e.xo - r.xo, i = t.x - t.xo, p = r.x - r.xo, s = Math.abs(a), u = Math.abs(o), l = s + u, l === 0) {
2365
+ e.x = e.xo + (i + p) / 2;
2366
+ return;
2367
+ }
2368
+ e.x = e.xo + (i * u + p * s) / l;
2369
+ return;
2370
+ }
2371
+ if (a = n.distance(e, t, !0, !0), o = n.distance(e, r, !0, !0), i = n.distance(t, t, !1, !0), p = n.distance(r, r, !1, !0), s = Math.abs(a), u = Math.abs(o), l = s + u, l === 0) {
2372
+ ie.setRelative(e, e, (i + p) / 2, n, !0);
2373
+ return;
2374
+ }
2375
+ ie.setRelative(e, e, (i * u + p * s) / l, n, !0);
2376
+ }, normalSlope: Number.NEGATIVE_INFINITY, setRelative: function(e, t, r, n, a) {
2377
+ if (!n || n === this) {
2378
+ e.x = (a ? t.xo : t.x) + r;
2379
+ return;
2380
+ }
2381
+ var o = a ? t.xo : t.x, s = a ? t.yo : t.y, u = o + r * n.x, i = s + r * n.y;
2382
+ e.x = u + (e.y - i) / n.normalSlope;
2383
+ }, slope: 0, touch: function(e) {
2384
+ e.xTouched = !0;
2385
+ }, touched: function(e) {
2386
+ return e.xTouched;
2387
+ }, untouch: function(e) {
2388
+ e.xTouched = !1;
2389
+ } }, le = { x: 0, y: 1, axis: "y", distance: function(e, t, r, n) {
2390
+ return (r ? e.yo : e.y) - (n ? t.yo : t.y);
2391
+ }, interpolate: function(e, t, r, n) {
2392
+ var a, o, s, u, i, p, l;
2393
+ if (!n || n === this) {
2394
+ if (a = e.yo - t.yo, o = e.yo - r.yo, i = t.y - t.yo, p = r.y - r.yo, s = Math.abs(a), u = Math.abs(o), l = s + u, l === 0) {
2395
+ e.y = e.yo + (i + p) / 2;
2396
+ return;
2397
+ }
2398
+ e.y = e.yo + (i * u + p * s) / l;
2399
+ return;
2400
+ }
2401
+ if (a = n.distance(e, t, !0, !0), o = n.distance(e, r, !0, !0), i = n.distance(t, t, !1, !0), p = n.distance(r, r, !1, !0), s = Math.abs(a), u = Math.abs(o), l = s + u, l === 0) {
2402
+ le.setRelative(e, e, (i + p) / 2, n, !0);
2403
+ return;
2404
+ }
2405
+ le.setRelative(e, e, (i * u + p * s) / l, n, !0);
2406
+ }, normalSlope: 0, setRelative: function(e, t, r, n, a) {
2407
+ if (!n || n === this) {
2408
+ e.y = (a ? t.yo : t.y) + r;
2409
+ return;
2410
+ }
2411
+ var o = a ? t.xo : t.x, s = a ? t.yo : t.y, u = o + r * n.x, i = s + r * n.y;
2412
+ e.y = i + n.normalSlope * (e.x - u);
2413
+ }, slope: Number.POSITIVE_INFINITY, touch: function(e) {
2414
+ e.yTouched = !0;
2415
+ }, touched: function(e) {
2416
+ return e.yTouched;
2417
+ }, untouch: function(e) {
2418
+ e.yTouched = !1;
2419
+ } };
2420
+ Object.freeze(ie);
2421
+ Object.freeze(le);
2422
+ function Ie(e, t) {
2423
+ this.x = e, this.y = t, this.axis = void 0, this.slope = t / e, this.normalSlope = -e / t, Object.freeze(this);
2424
+ }
2425
+ Ie.prototype.distance = function(e, t, r, n) {
2426
+ return this.x * ie.distance(e, t, r, n) + this.y * le.distance(e, t, r, n);
2427
+ };
2428
+ Ie.prototype.interpolate = function(e, t, r, n) {
2429
+ var a, o, s, u, i, p, l;
2430
+ if (s = n.distance(e, t, !0, !0), u = n.distance(e, r, !0, !0), a = n.distance(t, t, !1, !0), o = n.distance(r, r, !1, !0), i = Math.abs(s), p = Math.abs(u), l = i + p, l === 0) {
2431
+ this.setRelative(e, e, (a + o) / 2, n, !0);
2432
+ return;
2433
+ }
2434
+ this.setRelative(e, e, (a * p + o * i) / l, n, !0);
2435
+ };
2436
+ Ie.prototype.setRelative = function(e, t, r, n, a) {
2437
+ n = n || this;
2438
+ var o = a ? t.xo : t.x, s = a ? t.yo : t.y, u = o + r * n.x, i = s + r * n.y, p = n.normalSlope, l = this.slope, h = e.x, c = e.y;
2439
+ e.x = (l * h - p * u + i - c) / (l - p), e.y = l * (e.x - h) + c;
2440
+ };
2441
+ Ie.prototype.touch = function(e) {
2442
+ e.xTouched = !0, e.yTouched = !0;
2443
+ };
2444
+ function Me(e, t) {
2445
+ var r = Math.sqrt(e * e + t * t);
2446
+ return e /= r, t /= r, e === 1 && t === 0 ? ie : e === 0 && t === 1 ? le : new Ie(e, t);
2447
+ }
2448
+ function pe(e, t, r, n) {
2449
+ this.x = this.xo = Math.round(e * 64) / 64, this.y = this.yo = Math.round(t * 64) / 64, this.lastPointOfContour = r, this.onCurve = n, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
2450
+ }
2451
+ pe.prototype.nextTouched = function(e) {
2452
+ for (var t = this.nextPointOnContour; !e.touched(t) && t !== this; ) t = t.nextPointOnContour;
2453
+ return t;
2454
+ };
2455
+ pe.prototype.prevTouched = function(e) {
2456
+ for (var t = this.prevPointOnContour; !e.touched(t) && t !== this; ) t = t.prevPointOnContour;
2457
+ return t;
2458
+ };
2459
+ var Fe = Object.freeze(new pe(0, 0)), oo = { cvCutIn: 17 / 16, deltaBase: 9, deltaShift: 0.125, loop: 1, minDis: 1, autoFlip: !0 };
2460
+ function ve(e, t) {
2461
+ switch (this.env = e, this.stack = [], this.prog = t, e) {
2462
+ case "glyf":
2463
+ this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
2464
+ case "prep":
2465
+ this.fv = this.pv = this.dpv = ie, this.round = un;
2466
+ }
2467
+ }
2468
+ sn.prototype.exec = function(e, t) {
2469
+ if (typeof t != "number") throw new Error("Point size is not a number!");
2470
+ if (!(this._errorState > 2)) {
2471
+ var r = this.font, n = this._prepState;
2472
+ if (!n || n.ppem !== t) {
2473
+ var a = this._fpgmState;
2474
+ if (!a) {
2475
+ ve.prototype = oo, a = this._fpgmState = new ve("fpgm", r.tables.fpgm), a.funcs = [], a.font = r, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
2476
+ try {
2477
+ Se(a);
2478
+ } catch (p) {
2479
+ console.log("Hinting error in FPGM:" + p), this._errorState = 3;
2480
+ return;
2481
+ }
2482
+ }
2483
+ ve.prototype = a, n = this._prepState = new ve("prep", r.tables.prep), n.ppem = t;
2484
+ var o = r.tables.cvt;
2485
+ if (o) for (var s = n.cvt = new Array(o.length), u = t / r.unitsPerEm, i = 0; i < o.length; i++) s[i] = o[i] * u;
2486
+ else n.cvt = [];
2487
+ exports.DEBUG && (console.log("---EXEC PREP---"), n.step = -1);
2488
+ try {
2489
+ Se(n);
2490
+ } catch (p) {
2491
+ this._errorState < 2 && console.log("Hinting error in PREP:" + p), this._errorState = 2;
2492
+ }
2493
+ }
2494
+ if (!(this._errorState > 1)) try {
2495
+ return on(e, n);
2496
+ } catch (p) {
2497
+ this._errorState < 1 && (console.log("Hinting error:" + p), console.log("Note: further hinting errors are silenced")), this._errorState = 1;
2498
+ return;
2499
+ }
2500
+ }
2501
+ };
2502
+ on = function(e, t) {
2503
+ var r = t.ppem / t.font.unitsPerEm, n = r, a = e.components, o, s, u;
2504
+ if (ve.prototype = t, !a) u = new ve("glyf", e.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), u.step = -1), xt(e, u, r, n), s = u.gZone;
2505
+ else {
2506
+ var i = t.font;
2507
+ s = [], o = [];
2508
+ for (var p = 0; p < a.length; p++) {
2509
+ var l = a[p], h = i.glyphs.get(l.glyphIndex);
2510
+ u = new ve("glyf", h.instructions), exports.DEBUG && (console.log("---EXEC COMP " + p + "---"), u.step = -1), xt(h, u, r, n);
2511
+ for (var c = Math.round(l.dx * r), f = Math.round(l.dy * n), v = u.gZone, x = u.contours, m = 0; m < v.length; m++) {
2512
+ var y = v[m];
2513
+ y.xTouched = y.yTouched = !1, y.xo = y.x = y.x + c, y.yo = y.y = y.y + f;
2514
+ }
2515
+ var U = s.length;
2516
+ s.push.apply(s, v);
2517
+ for (var S = 0; S < x.length; S++) o.push(x[S] + U);
2518
+ }
2519
+ e.instructions && !u.inhibitGridFit && (u = new ve("glyf", e.instructions), u.gZone = u.z0 = u.z1 = u.z2 = s, u.contours = o, s.push(new pe(0, 0), new pe(Math.round(e.advanceWidth * r), 0)), exports.DEBUG && (console.log("---EXEC COMPOSITE---"), u.step = -1), Se(u), s.length -= 2);
2520
+ }
2521
+ return s;
2522
+ };
2523
+ xt = function(e, t, r, n) {
2524
+ for (var a = e.points || [], o = a.length, s = t.gZone = t.z0 = t.z1 = t.z2 = [], u = t.contours = [], i, p = 0; p < o; p++) i = a[p], s[p] = new pe(i.x * r, i.y * n, i.lastPointOfContour, i.onCurve);
2525
+ for (var l, h, c = 0; c < o; c++) i = s[c], l || (l = i, u.push(c)), i.lastPointOfContour ? (i.nextPointOnContour = l, l.prevPointOnContour = i, l = void 0) : (h = s[c + 1], i.nextPointOnContour = h, h.prevPointOnContour = i);
2526
+ if (!t.inhibitGridFit) {
2527
+ if (exports.DEBUG) {
2528
+ console.log("PROCESSING GLYPH", t.stack);
2529
+ for (var f = 0; f < o; f++) console.log(f, s[f].x, s[f].y);
2530
+ }
2531
+ if (s.push(new pe(0, 0), new pe(Math.round(e.advanceWidth * r), 0)), Se(t), s.length -= 2, exports.DEBUG) {
2532
+ console.log("FINISHED GLYPH", t.stack);
2533
+ for (var v = 0; v < o; v++) console.log(v, s[v].x, s[v].y);
2534
+ }
2535
+ }
2536
+ };
2537
+ Se = function(e) {
2538
+ var t = e.prog;
2539
+ if (t) {
2540
+ var r = t.length, n;
2541
+ for (e.ip = 0; e.ip < r; e.ip++) {
2542
+ if (exports.DEBUG && e.step++, n = an[t[e.ip]], !n) throw new Error("unknown instruction: 0x" + Number(t[e.ip]).toString(16));
2543
+ n(e);
2544
+ }
2545
+ }
2546
+ };
2547
+ function Je(e) {
2548
+ for (var t = e.tZone = new Array(e.gZone.length), r = 0; r < t.length; r++) t[r] = new pe(0, 0);
2549
+ }
2550
+ function pn(e, t) {
2551
+ var r = e.prog, n = e.ip, a = 1, o;
2552
+ do
2553
+ if (o = r[++n], o === 88) a++;
2554
+ else if (o === 89) a--;
2555
+ else if (o === 64) n += r[n + 1] + 1;
2556
+ else if (o === 65) n += 2 * r[n + 1] + 1;
2557
+ else if (o >= 176 && o <= 183) n += o - 176 + 1;
2558
+ else if (o >= 184 && o <= 191) n += (o - 184 + 1) * 2;
2559
+ else if (t && a === 1 && o === 27) break;
2560
+ while (a > 0);
2561
+ e.ip = n;
2562
+ }
2563
+ function er(e, t) {
2564
+ exports.DEBUG && console.log(t.step, "SVTCA[" + e.axis + "]"), t.fv = t.pv = t.dpv = e;
2565
+ }
2566
+ function tr(e, t) {
2567
+ exports.DEBUG && console.log(t.step, "SPVTCA[" + e.axis + "]"), t.pv = t.dpv = e;
2568
+ }
2569
+ function rr(e, t) {
2570
+ exports.DEBUG && console.log(t.step, "SFVTCA[" + e.axis + "]"), t.fv = e;
2571
+ }
2572
+ function nr(e, t) {
2573
+ var r = t.stack, n = r.pop(), a = r.pop(), o = t.z2[n], s = t.z1[a];
2574
+ exports.DEBUG && console.log("SPVTL[" + e + "]", n, a);
2575
+ var u, i;
2576
+ e ? (u = o.y - s.y, i = s.x - o.x) : (u = s.x - o.x, i = s.y - o.y), t.pv = t.dpv = Me(u, i);
2577
+ }
2578
+ function ar(e, t) {
2579
+ var r = t.stack, n = r.pop(), a = r.pop(), o = t.z2[n], s = t.z1[a];
2580
+ exports.DEBUG && console.log("SFVTL[" + e + "]", n, a);
2581
+ var u, i;
2582
+ e ? (u = o.y - s.y, i = s.x - o.x) : (u = s.x - o.x, i = s.y - o.y), t.fv = Me(u, i);
2583
+ }
2584
+ function so(e) {
2585
+ var t = e.stack, r = t.pop(), n = t.pop();
2586
+ exports.DEBUG && console.log(e.step, "SPVFS[]", r, n), e.pv = e.dpv = Me(n, r);
2587
+ }
2588
+ function io(e) {
2589
+ var t = e.stack, r = t.pop(), n = t.pop();
2590
+ exports.DEBUG && console.log(e.step, "SPVFS[]", r, n), e.fv = Me(n, r);
2591
+ }
2592
+ function uo(e) {
2593
+ var t = e.stack, r = e.pv;
2594
+ exports.DEBUG && console.log(e.step, "GPV[]"), t.push(r.x * 16384), t.push(r.y * 16384);
2595
+ }
2596
+ function lo(e) {
2597
+ var t = e.stack, r = e.fv;
2598
+ exports.DEBUG && console.log(e.step, "GFV[]"), t.push(r.x * 16384), t.push(r.y * 16384);
2599
+ }
2600
+ function po(e) {
2601
+ e.fv = e.pv, exports.DEBUG && console.log(e.step, "SFVTPV[]");
2602
+ }
2603
+ function co(e) {
2604
+ var t = e.stack, r = t.pop(), n = t.pop(), a = t.pop(), o = t.pop(), s = t.pop(), u = e.z0, i = e.z1, p = u[r], l = u[n], h = i[a], c = i[o], f = e.z2[s];
2605
+ exports.DEBUG && console.log("ISECT[], ", r, n, a, o, s);
2606
+ var v = p.x, x = p.y, m = l.x, y = l.y, U = h.x, S = h.y, B = c.x, A = c.y, F = (v - m) * (S - A) - (x - y) * (U - B), O = v * y - x * m, T = U * A - S * B;
2607
+ f.x = (O * (U - B) - T * (v - m)) / F, f.y = (O * (S - A) - T * (x - y)) / F;
2608
+ }
2609
+ function ho(e) {
2610
+ e.rp0 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP0[]", e.rp0);
2611
+ }
2612
+ function fo(e) {
2613
+ e.rp1 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP1[]", e.rp1);
2614
+ }
2615
+ function vo(e) {
2616
+ e.rp2 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP2[]", e.rp2);
2617
+ }
2618
+ function go(e) {
2619
+ var t = e.stack.pop();
2620
+ switch (exports.DEBUG && console.log(e.step, "SZP0[]", t), e.zp0 = t, t) {
2621
+ case 0:
2622
+ e.tZone || Je(e), e.z0 = e.tZone;
2623
+ break;
2624
+ case 1:
2625
+ e.z0 = e.gZone;
2626
+ break;
2627
+ default:
2628
+ throw new Error("Invalid zone pointer");
2629
+ }
2630
+ }
2631
+ function mo(e) {
2632
+ var t = e.stack.pop();
2633
+ switch (exports.DEBUG && console.log(e.step, "SZP1[]", t), e.zp1 = t, t) {
2634
+ case 0:
2635
+ e.tZone || Je(e), e.z1 = e.tZone;
2636
+ break;
2637
+ case 1:
2638
+ e.z1 = e.gZone;
2639
+ break;
2640
+ default:
2641
+ throw new Error("Invalid zone pointer");
2642
+ }
2643
+ }
2644
+ function yo(e) {
2645
+ var t = e.stack.pop();
2646
+ switch (exports.DEBUG && console.log(e.step, "SZP2[]", t), e.zp2 = t, t) {
2647
+ case 0:
2648
+ e.tZone || Je(e), e.z2 = e.tZone;
2649
+ break;
2650
+ case 1:
2651
+ e.z2 = e.gZone;
2652
+ break;
2653
+ default:
2654
+ throw new Error("Invalid zone pointer");
2655
+ }
2656
+ }
2657
+ function xo(e) {
2658
+ var t = e.stack.pop();
2659
+ switch (exports.DEBUG && console.log(e.step, "SZPS[]", t), e.zp0 = e.zp1 = e.zp2 = t, t) {
2660
+ case 0:
2661
+ e.tZone || Je(e), e.z0 = e.z1 = e.z2 = e.tZone;
2662
+ break;
2663
+ case 1:
2664
+ e.z0 = e.z1 = e.z2 = e.gZone;
2665
+ break;
2666
+ default:
2667
+ throw new Error("Invalid zone pointer");
2668
+ }
2669
+ }
2670
+ function bo(e) {
2671
+ e.loop = e.stack.pop(), exports.DEBUG && console.log(e.step, "SLOOP[]", e.loop);
2672
+ }
2673
+ function So(e) {
2674
+ exports.DEBUG && console.log(e.step, "RTG[]"), e.round = un;
2675
+ }
2676
+ function Eo(e) {
2677
+ exports.DEBUG && console.log(e.step, "RTHG[]"), e.round = ro;
2678
+ }
2679
+ function Co(e) {
2680
+ var t = e.stack.pop();
2681
+ exports.DEBUG && console.log(e.step, "SMD[]", t), e.minDis = t / 64;
2682
+ }
2683
+ function To(e) {
2684
+ exports.DEBUG && console.log(e.step, "ELSE[]"), pn(e, !1);
2685
+ }
2686
+ function ko(e) {
2687
+ var t = e.stack.pop();
2688
+ exports.DEBUG && console.log(e.step, "JMPR[]", t), e.ip += t - 1;
2689
+ }
2690
+ function Uo(e) {
2691
+ var t = e.stack.pop();
2692
+ exports.DEBUG && console.log(e.step, "SCVTCI[]", t), e.cvCutIn = t / 64;
2693
+ }
2694
+ function Do(e) {
2695
+ var t = e.stack;
2696
+ exports.DEBUG && console.log(e.step, "DUP[]"), t.push(t[t.length - 1]);
2697
+ }
2698
+ function st(e) {
2699
+ exports.DEBUG && console.log(e.step, "POP[]"), e.stack.pop();
2700
+ }
2701
+ function Ao(e) {
2702
+ exports.DEBUG && console.log(e.step, "CLEAR[]"), e.stack.length = 0;
2703
+ }
2704
+ function Oo(e) {
2705
+ var t = e.stack, r = t.pop(), n = t.pop();
2706
+ exports.DEBUG && console.log(e.step, "SWAP[]"), t.push(r), t.push(n);
2707
+ }
2708
+ function Bo(e) {
2709
+ var t = e.stack;
2710
+ exports.DEBUG && console.log(e.step, "DEPTH[]"), t.push(t.length);
2711
+ }
2712
+ function Ro(e) {
2713
+ var t = e.stack, r = t.pop(), n = t.pop();
2714
+ exports.DEBUG && console.log(e.step, "LOOPCALL[]", r, n);
2715
+ var a = e.ip, o = e.prog;
2716
+ e.prog = e.funcs[r];
2717
+ for (var s = 0; s < n; s++) Se(e), exports.DEBUG && console.log(++e.step, s + 1 < n ? "next loopcall" : "done loopcall", s);
2718
+ e.ip = a, e.prog = o;
2719
+ }
2720
+ function Fo(e) {
2721
+ var t = e.stack.pop();
2722
+ exports.DEBUG && console.log(e.step, "CALL[]", t);
2723
+ var r = e.ip, n = e.prog;
2724
+ e.prog = e.funcs[t], Se(e), e.ip = r, e.prog = n, exports.DEBUG && console.log(++e.step, "returning from", t);
2725
+ }
2726
+ function wo(e) {
2727
+ var t = e.stack, r = t.pop();
2728
+ exports.DEBUG && console.log(e.step, "CINDEX[]", r), t.push(t[t.length - r]);
2729
+ }
2730
+ function Lo(e) {
2731
+ var t = e.stack, r = t.pop();
2732
+ exports.DEBUG && console.log(e.step, "MINDEX[]", r), t.push(t.splice(t.length - r, 1)[0]);
2733
+ }
2734
+ function Io(e) {
2735
+ if (e.env !== "fpgm") throw new Error("FDEF not allowed here");
2736
+ var t = e.stack, r = e.prog, n = e.ip, a = t.pop(), o = n;
2737
+ for (exports.DEBUG && console.log(e.step, "FDEF[]", a); r[++n] !== 45; ) ;
2738
+ e.ip = n, e.funcs[a] = r.slice(o + 1, n);
2739
+ }
2740
+ function or(e, t) {
2741
+ var r = t.stack.pop(), n = t.z0[r], a = t.fv, o = t.pv;
2742
+ exports.DEBUG && console.log(t.step, "MDAP[" + e + "]", r);
2743
+ var s = o.distance(n, Fe);
2744
+ e && (s = t.round(s)), a.setRelative(n, Fe, s, o), a.touch(n), t.rp0 = t.rp1 = r;
2745
+ }
2746
+ function sr(e, t) {
2747
+ var r = t.z2, n = r.length - 2, a, o, s;
2748
+ exports.DEBUG && console.log(t.step, "IUP[" + e.axis + "]");
2749
+ for (var u = 0; u < n; u++) a = r[u], !e.touched(a) && (o = a.prevTouched(e), o !== a && (s = a.nextTouched(e), o === s && e.setRelative(a, a, e.distance(o, o, !1, !0), e, !0), e.interpolate(a, o, s, e)));
2750
+ }
2751
+ function ir(e, t) {
2752
+ for (var r = t.stack, n = e ? t.rp1 : t.rp2, a = (e ? t.z0 : t.z1)[n], o = t.fv, s = t.pv, u = t.loop, i = t.z2; u--; ) {
2753
+ var p = r.pop(), l = i[p], h = s.distance(a, a, !1, !0);
2754
+ o.setRelative(l, l, h, s), o.touch(l), exports.DEBUG && console.log(t.step, (t.loop > 1 ? "loop " + (t.loop - u) + ": " : "") + "SHP[" + (e ? "rp1" : "rp2") + "]", p);
2755
+ }
2756
+ t.loop = 1;
2757
+ }
2758
+ function ur(e, t) {
2759
+ var r = t.stack, n = e ? t.rp1 : t.rp2, a = (e ? t.z0 : t.z1)[n], o = t.fv, s = t.pv, u = r.pop(), i = t.z2[t.contours[u]], p = i;
2760
+ exports.DEBUG && console.log(t.step, "SHC[" + e + "]", u);
2761
+ var l = s.distance(a, a, !1, !0);
2762
+ do
2763
+ p !== a && o.setRelative(p, p, l, s), p = p.nextPointOnContour;
2764
+ while (p !== i);
2765
+ }
2766
+ function lr(e, t) {
2767
+ var r = t.stack, n = e ? t.rp1 : t.rp2, a = (e ? t.z0 : t.z1)[n], o = t.fv, s = t.pv, u = r.pop();
2768
+ exports.DEBUG && console.log(t.step, "SHZ[" + e + "]", u);
2769
+ var i;
2770
+ switch (u) {
2771
+ case 0:
2772
+ i = t.tZone;
2773
+ break;
2774
+ case 1:
2775
+ i = t.gZone;
2776
+ break;
2777
+ default:
2778
+ throw new Error("Invalid zone");
2779
+ }
2780
+ for (var p, l = s.distance(a, a, !1, !0), h = i.length - 2, c = 0; c < h; c++) p = i[c], o.setRelative(p, p, l, s);
2781
+ }
2782
+ function Mo(e) {
2783
+ for (var t = e.stack, r = e.loop, n = e.fv, a = t.pop() / 64, o = e.z2; r--; ) {
2784
+ var s = t.pop(), u = o[s];
2785
+ exports.DEBUG && console.log(e.step, (e.loop > 1 ? "loop " + (e.loop - r) + ": " : "") + "SHPIX[]", s, a), n.setRelative(u, u, a), n.touch(u);
2786
+ }
2787
+ e.loop = 1;
2788
+ }
2789
+ function Go(e) {
2790
+ for (var t = e.stack, r = e.rp1, n = e.rp2, a = e.loop, o = e.z0[r], s = e.z1[n], u = e.fv, i = e.dpv, p = e.z2; a--; ) {
2791
+ var l = t.pop(), h = p[l];
2792
+ exports.DEBUG && console.log(e.step, (e.loop > 1 ? "loop " + (e.loop - a) + ": " : "") + "IP[]", l, r, "<->", n), u.interpolate(h, o, s, i), u.touch(h);
2793
+ }
2794
+ e.loop = 1;
2795
+ }
2796
+ function pr(e, t) {
2797
+ var r = t.stack, n = r.pop() / 64, a = r.pop(), o = t.z1[a], s = t.z0[t.rp0], u = t.fv, i = t.pv;
2798
+ u.setRelative(o, s, n, i), u.touch(o), exports.DEBUG && console.log(t.step, "MSIRP[" + e + "]", n, a), t.rp1 = t.rp0, t.rp2 = a, e && (t.rp0 = a);
2799
+ }
2800
+ function Po(e) {
2801
+ for (var t = e.stack, r = e.rp0, n = e.z0[r], a = e.loop, o = e.fv, s = e.pv, u = e.z1; a--; ) {
2802
+ var i = t.pop(), p = u[i];
2803
+ exports.DEBUG && console.log(e.step, (e.loop > 1 ? "loop " + (e.loop - a) + ": " : "") + "ALIGNRP[]", i), o.setRelative(p, n, 0, s), o.touch(p);
2804
+ }
2805
+ e.loop = 1;
2806
+ }
2807
+ function No(e) {
2808
+ exports.DEBUG && console.log(e.step, "RTDG[]"), e.round = to;
2809
+ }
2810
+ function cr(e, t) {
2811
+ var r = t.stack, n = r.pop(), a = r.pop(), o = t.z0[a], s = t.fv, u = t.pv, i = t.cvt[n];
2812
+ exports.DEBUG && console.log(t.step, "MIAP[" + e + "]", n, "(", i, ")", a);
2813
+ var p = u.distance(o, Fe);
2814
+ e && (Math.abs(p - i) < t.cvCutIn && (p = i), p = t.round(p)), s.setRelative(o, Fe, p, u), t.zp0 === 0 && (o.xo = o.x, o.yo = o.y), s.touch(o), t.rp0 = t.rp1 = a;
2815
+ }
2816
+ function Ho(e) {
2817
+ var t = e.prog, r = e.ip, n = e.stack, a = t[++r];
2818
+ exports.DEBUG && console.log(e.step, "NPUSHB[]", a);
2819
+ for (var o = 0; o < a; o++) n.push(t[++r]);
2820
+ e.ip = r;
2821
+ }
2822
+ function zo(e) {
2823
+ var t = e.ip, r = e.prog, n = e.stack, a = r[++t];
2824
+ exports.DEBUG && console.log(e.step, "NPUSHW[]", a);
2825
+ for (var o = 0; o < a; o++) {
2826
+ var s = r[++t] << 8 | r[++t];
2827
+ s & 32768 && (s = -((s ^ 65535) + 1)), n.push(s);
2828
+ }
2829
+ e.ip = t;
2830
+ }
2831
+ function Wo(e) {
2832
+ var t = e.stack, r = e.store;
2833
+ r || (r = e.store = []);
2834
+ var n = t.pop(), a = t.pop();
2835
+ exports.DEBUG && console.log(e.step, "WS", n, a), r[a] = n;
2836
+ }
2837
+ function qo(e) {
2838
+ var t = e.stack, r = e.store, n = t.pop();
2839
+ exports.DEBUG && console.log(e.step, "RS", n);
2840
+ var a = r && r[n] || 0;
2841
+ t.push(a);
2842
+ }
2843
+ function _o(e) {
2844
+ var t = e.stack, r = t.pop(), n = t.pop();
2845
+ exports.DEBUG && console.log(e.step, "WCVTP", r, n), e.cvt[n] = r / 64;
2846
+ }
2847
+ function Xo(e) {
2848
+ var t = e.stack, r = t.pop();
2849
+ exports.DEBUG && console.log(e.step, "RCVT", r), t.push(e.cvt[r] * 64);
2850
+ }
2851
+ function hr(e, t) {
2852
+ var r = t.stack, n = r.pop(), a = t.z2[n];
2853
+ exports.DEBUG && console.log(t.step, "GC[" + e + "]", n), r.push(t.dpv.distance(a, Fe, e, !1) * 64);
2854
+ }
2855
+ function fr(e, t) {
2856
+ var r = t.stack, n = r.pop(), a = r.pop(), o = t.z1[n], s = t.z0[a], u = t.dpv.distance(s, o, e, e);
2857
+ exports.DEBUG && console.log(t.step, "MD[" + e + "]", n, a, "->", u), t.stack.push(Math.round(u * 64));
2858
+ }
2859
+ function Vo(e) {
2860
+ exports.DEBUG && console.log(e.step, "MPPEM[]"), e.stack.push(e.ppem);
2861
+ }
2862
+ function Yo(e) {
2863
+ exports.DEBUG && console.log(e.step, "FLIPON[]"), e.autoFlip = !0;
2864
+ }
2865
+ function jo(e) {
2866
+ var t = e.stack, r = t.pop(), n = t.pop();
2867
+ exports.DEBUG && console.log(e.step, "LT[]", r, n), t.push(n < r ? 1 : 0);
2868
+ }
2869
+ function Zo(e) {
2870
+ var t = e.stack, r = t.pop(), n = t.pop();
2871
+ exports.DEBUG && console.log(e.step, "LTEQ[]", r, n), t.push(n <= r ? 1 : 0);
2872
+ }
2873
+ function Qo(e) {
2874
+ var t = e.stack, r = t.pop(), n = t.pop();
2875
+ exports.DEBUG && console.log(e.step, "GT[]", r, n), t.push(n > r ? 1 : 0);
2876
+ }
2877
+ function Ko(e) {
2878
+ var t = e.stack, r = t.pop(), n = t.pop();
2879
+ exports.DEBUG && console.log(e.step, "GTEQ[]", r, n), t.push(n >= r ? 1 : 0);
2880
+ }
2881
+ function Jo(e) {
2882
+ var t = e.stack, r = t.pop(), n = t.pop();
2883
+ exports.DEBUG && console.log(e.step, "EQ[]", r, n), t.push(r === n ? 1 : 0);
2884
+ }
2885
+ function $o(e) {
2886
+ var t = e.stack, r = t.pop(), n = t.pop();
2887
+ exports.DEBUG && console.log(e.step, "NEQ[]", r, n), t.push(r !== n ? 1 : 0);
2888
+ }
2889
+ function es(e) {
2890
+ var t = e.stack, r = t.pop();
2891
+ exports.DEBUG && console.log(e.step, "ODD[]", r), t.push(Math.trunc(r) % 2 ? 1 : 0);
2892
+ }
2893
+ function ts(e) {
2894
+ var t = e.stack, r = t.pop();
2895
+ exports.DEBUG && console.log(e.step, "EVEN[]", r), t.push(Math.trunc(r) % 2 ? 0 : 1);
2896
+ }
2897
+ function rs(e) {
2898
+ var t = e.stack.pop();
2899
+ exports.DEBUG && console.log(e.step, "IF[]", t), t || (pn(e, !0), exports.DEBUG && console.log(e.step, "EIF[]"));
2900
+ }
2901
+ function ns(e) {
2902
+ exports.DEBUG && console.log(e.step, "EIF[]");
2903
+ }
2904
+ function as(e) {
2905
+ var t = e.stack, r = t.pop(), n = t.pop();
2906
+ exports.DEBUG && console.log(e.step, "AND[]", r, n), t.push(r && n ? 1 : 0);
2907
+ }
2908
+ function os(e) {
2909
+ var t = e.stack, r = t.pop(), n = t.pop();
2910
+ exports.DEBUG && console.log(e.step, "OR[]", r, n), t.push(r || n ? 1 : 0);
2911
+ }
2912
+ function ss(e) {
2913
+ var t = e.stack, r = t.pop();
2914
+ exports.DEBUG && console.log(e.step, "NOT[]", r), t.push(r ? 0 : 1);
2915
+ }
2916
+ function it(e, t) {
2917
+ var r = t.stack, n = r.pop(), a = t.fv, o = t.pv, s = t.ppem, u = t.deltaBase + (e - 1) * 16, i = t.deltaShift, p = t.z0;
2918
+ exports.DEBUG && console.log(t.step, "DELTAP[" + e + "]", n, r);
2919
+ for (var l = 0; l < n; l++) {
2920
+ var h = r.pop(), c = r.pop(), f = u + ((c & 240) >> 4);
2921
+ if (f === s) {
2922
+ var v = (c & 15) - 8;
2923
+ v >= 0 && v++, exports.DEBUG && console.log(t.step, "DELTAPFIX", h, "by", v * i);
2924
+ var x = p[h];
2925
+ a.setRelative(x, x, v * i, o);
2926
+ }
2927
+ }
2928
+ }
2929
+ function is(e) {
2930
+ var t = e.stack, r = t.pop();
2931
+ exports.DEBUG && console.log(e.step, "SDB[]", r), e.deltaBase = r;
2932
+ }
2933
+ function us(e) {
2934
+ var t = e.stack, r = t.pop();
2935
+ exports.DEBUG && console.log(e.step, "SDS[]", r), e.deltaShift = Math.pow(0.5, r);
2936
+ }
2937
+ function ls(e) {
2938
+ var t = e.stack, r = t.pop(), n = t.pop();
2939
+ exports.DEBUG && console.log(e.step, "ADD[]", r, n), t.push(n + r);
2940
+ }
2941
+ function ps(e) {
2942
+ var t = e.stack, r = t.pop(), n = t.pop();
2943
+ exports.DEBUG && console.log(e.step, "SUB[]", r, n), t.push(n - r);
2944
+ }
2945
+ function cs(e) {
2946
+ var t = e.stack, r = t.pop(), n = t.pop();
2947
+ exports.DEBUG && console.log(e.step, "DIV[]", r, n), t.push(n * 64 / r);
2948
+ }
2949
+ function hs(e) {
2950
+ var t = e.stack, r = t.pop(), n = t.pop();
2951
+ exports.DEBUG && console.log(e.step, "MUL[]", r, n), t.push(n * r / 64);
2952
+ }
2953
+ function fs(e) {
2954
+ var t = e.stack, r = t.pop();
2955
+ exports.DEBUG && console.log(e.step, "ABS[]", r), t.push(Math.abs(r));
2956
+ }
2957
+ function ds(e) {
2958
+ var t = e.stack, r = t.pop();
2959
+ exports.DEBUG && console.log(e.step, "NEG[]", r), t.push(-r);
2960
+ }
2961
+ function vs(e) {
2962
+ var t = e.stack, r = t.pop();
2963
+ exports.DEBUG && console.log(e.step, "FLOOR[]", r), t.push(Math.floor(r / 64) * 64);
2964
+ }
2965
+ function gs(e) {
2966
+ var t = e.stack, r = t.pop();
2967
+ exports.DEBUG && console.log(e.step, "CEILING[]", r), t.push(Math.ceil(r / 64) * 64);
2968
+ }
2969
+ function qe(e, t) {
2970
+ var r = t.stack, n = r.pop();
2971
+ exports.DEBUG && console.log(t.step, "ROUND[]"), r.push(t.round(n / 64) * 64);
2972
+ }
2973
+ function ms(e) {
2974
+ var t = e.stack, r = t.pop(), n = t.pop();
2975
+ exports.DEBUG && console.log(e.step, "WCVTF[]", r, n), e.cvt[n] = r * e.ppem / e.font.unitsPerEm;
2976
+ }
2977
+ function ut(e, t) {
2978
+ var r = t.stack, n = r.pop(), a = t.ppem, o = t.deltaBase + (e - 1) * 16, s = t.deltaShift;
2979
+ exports.DEBUG && console.log(t.step, "DELTAC[" + e + "]", n, r);
2980
+ for (var u = 0; u < n; u++) {
2981
+ var i = r.pop(), p = r.pop(), l = o + ((p & 240) >> 4);
2982
+ if (l === a) {
2983
+ var h = (p & 15) - 8;
2984
+ h >= 0 && h++;
2985
+ var c = h * s;
2986
+ exports.DEBUG && console.log(t.step, "DELTACFIX", i, "by", c), t.cvt[i] += c;
2987
+ }
2988
+ }
2989
+ }
2990
+ function ys(e) {
2991
+ var t = e.stack.pop();
2992
+ exports.DEBUG && console.log(e.step, "SROUND[]", t), e.round = ln;
2993
+ var r;
2994
+ switch (t & 192) {
2995
+ case 0:
2996
+ r = 0.5;
2997
+ break;
2998
+ case 64:
2999
+ r = 1;
3000
+ break;
3001
+ case 128:
3002
+ r = 2;
3003
+ break;
3004
+ default:
3005
+ throw new Error("invalid SROUND value");
3006
+ }
3007
+ switch (e.srPeriod = r, t & 48) {
3008
+ case 0:
3009
+ e.srPhase = 0;
3010
+ break;
3011
+ case 16:
3012
+ e.srPhase = 0.25 * r;
3013
+ break;
3014
+ case 32:
3015
+ e.srPhase = 0.5 * r;
3016
+ break;
3017
+ case 48:
3018
+ e.srPhase = 0.75 * r;
3019
+ break;
3020
+ default:
3021
+ throw new Error("invalid SROUND value");
3022
+ }
3023
+ t &= 15, t === 0 ? e.srThreshold = 0 : e.srThreshold = (t / 8 - 0.5) * r;
3024
+ }
3025
+ function xs(e) {
3026
+ var t = e.stack.pop();
3027
+ exports.DEBUG && console.log(e.step, "S45ROUND[]", t), e.round = ln;
3028
+ var r;
3029
+ switch (t & 192) {
3030
+ case 0:
3031
+ r = Math.sqrt(2) / 2;
3032
+ break;
3033
+ case 64:
3034
+ r = Math.sqrt(2);
3035
+ break;
3036
+ case 128:
3037
+ r = 2 * Math.sqrt(2);
3038
+ break;
3039
+ default:
3040
+ throw new Error("invalid S45ROUND value");
3041
+ }
3042
+ switch (e.srPeriod = r, t & 48) {
3043
+ case 0:
3044
+ e.srPhase = 0;
3045
+ break;
3046
+ case 16:
3047
+ e.srPhase = 0.25 * r;
3048
+ break;
3049
+ case 32:
3050
+ e.srPhase = 0.5 * r;
3051
+ break;
3052
+ case 48:
3053
+ e.srPhase = 0.75 * r;
3054
+ break;
3055
+ default:
3056
+ throw new Error("invalid S45ROUND value");
3057
+ }
3058
+ t &= 15, t === 0 ? e.srThreshold = 0 : e.srThreshold = (t / 8 - 0.5) * r;
3059
+ }
3060
+ function bs(e) {
3061
+ exports.DEBUG && console.log(e.step, "ROFF[]"), e.round = eo;
3062
+ }
3063
+ function Ss(e) {
3064
+ exports.DEBUG && console.log(e.step, "RUTG[]"), e.round = no;
3065
+ }
3066
+ function Es(e) {
3067
+ exports.DEBUG && console.log(e.step, "RDTG[]"), e.round = ao;
3068
+ }
3069
+ function Cs(e) {
3070
+ var t = e.stack.pop();
3071
+ exports.DEBUG && console.log(e.step, "SCANCTRL[]", t);
3072
+ }
3073
+ function dr(e, t) {
3074
+ var r = t.stack, n = r.pop(), a = r.pop(), o = t.z2[n], s = t.z1[a];
3075
+ exports.DEBUG && console.log(t.step, "SDPVTL[" + e + "]", n, a);
3076
+ var u, i;
3077
+ e ? (u = o.y - s.y, i = s.x - o.x) : (u = s.x - o.x, i = s.y - o.y), t.dpv = Me(u, i);
3078
+ }
3079
+ function Ts(e) {
3080
+ var t = e.stack, r = t.pop(), n = 0;
3081
+ exports.DEBUG && console.log(e.step, "GETINFO[]", r), r & 1 && (n = 35), r & 32 && (n |= 4096), t.push(n);
3082
+ }
3083
+ function ks(e) {
3084
+ var t = e.stack, r = t.pop(), n = t.pop(), a = t.pop();
3085
+ exports.DEBUG && console.log(e.step, "ROLL[]"), t.push(n), t.push(r), t.push(a);
3086
+ }
3087
+ function Us(e) {
3088
+ var t = e.stack, r = t.pop(), n = t.pop();
3089
+ exports.DEBUG && console.log(e.step, "MAX[]", r, n), t.push(Math.max(n, r));
3090
+ }
3091
+ function Ds(e) {
3092
+ var t = e.stack, r = t.pop(), n = t.pop();
3093
+ exports.DEBUG && console.log(e.step, "MIN[]", r, n), t.push(Math.min(n, r));
3094
+ }
3095
+ function As(e) {
3096
+ var t = e.stack.pop();
3097
+ exports.DEBUG && console.log(e.step, "SCANTYPE[]", t);
3098
+ }
3099
+ function Os(e) {
3100
+ var t = e.stack.pop(), r = e.stack.pop();
3101
+ switch (exports.DEBUG && console.log(e.step, "INSTCTRL[]", t, r), t) {
3102
+ case 1:
3103
+ e.inhibitGridFit = !!r;
3104
+ return;
3105
+ case 2:
3106
+ e.ignoreCvt = !!r;
3107
+ return;
3108
+ default:
3109
+ throw new Error("invalid INSTCTRL[] selector");
3110
+ }
3111
+ }
3112
+ function he(e, t) {
3113
+ var r = t.stack, n = t.prog, a = t.ip;
3114
+ exports.DEBUG && console.log(t.step, "PUSHB[" + e + "]");
3115
+ for (var o = 0; o < e; o++) r.push(n[++a]);
3116
+ t.ip = a;
3117
+ }
3118
+ function fe(e, t) {
3119
+ var r = t.ip, n = t.prog, a = t.stack;
3120
+ exports.DEBUG && console.log(t.ip, "PUSHW[" + e + "]");
3121
+ for (var o = 0; o < e; o++) {
3122
+ var s = n[++r] << 8 | n[++r];
3123
+ s & 32768 && (s = -((s ^ 65535) + 1)), a.push(s);
3124
+ }
3125
+ t.ip = r;
3126
+ }
3127
+ function E(e, t, r, n, a, o) {
3128
+ var s = o.stack, u = e && s.pop(), i = s.pop(), p = o.rp0, l = o.z0[p], h = o.z1[i], c = o.minDis, f = o.fv, v = o.dpv, x, m, y, U;
3129
+ m = x = v.distance(h, l, !0, !0), y = m >= 0 ? 1 : -1, m = Math.abs(m), e && (U = o.cvt[u], n && Math.abs(m - U) < o.cvCutIn && (m = U)), r && m < c && (m = c), n && (m = o.round(m)), f.setRelative(h, l, y * m, v), f.touch(h), exports.DEBUG && console.log(o.step, (e ? "MIRP[" : "MDRP[") + (t ? "M" : "m") + (r ? ">" : "_") + (n ? "R" : "_") + (a === 0 ? "Gr" : a === 1 ? "Bl" : a === 2 ? "Wh" : "") + "]", e ? u + "(" + o.cvt[u] + "," + U + ")" : "", i, "(d =", x, "->", y * m, ")"), o.rp1 = o.rp0, o.rp2 = i, t && (o.rp0 = i);
3130
+ }
3131
+ an = [er.bind(void 0, le), er.bind(void 0, ie), tr.bind(void 0, le), tr.bind(void 0, ie), rr.bind(void 0, le), rr.bind(void 0, ie), nr.bind(void 0, 0), nr.bind(void 0, 1), ar.bind(void 0, 0), ar.bind(void 0, 1), so, io, uo, lo, po, co, ho, fo, vo, go, mo, yo, xo, bo, So, Eo, Co, To, ko, Uo, void 0, void 0, Do, st, Ao, Oo, Bo, wo, Lo, void 0, void 0, void 0, Ro, Fo, Io, void 0, or.bind(void 0, 0), or.bind(void 0, 1), sr.bind(void 0, le), sr.bind(void 0, ie), ir.bind(void 0, 0), ir.bind(void 0, 1), ur.bind(void 0, 0), ur.bind(void 0, 1), lr.bind(void 0, 0), lr.bind(void 0, 1), Mo, Go, pr.bind(void 0, 0), pr.bind(void 0, 1), Po, No, cr.bind(void 0, 0), cr.bind(void 0, 1), Ho, zo, Wo, qo, _o, Xo, hr.bind(void 0, 0), hr.bind(void 0, 1), void 0, fr.bind(void 0, 0), fr.bind(void 0, 1), Vo, void 0, Yo, void 0, void 0, jo, Zo, Qo, Ko, Jo, $o, es, ts, rs, ns, as, os, ss, it.bind(void 0, 1), is, us, ls, ps, cs, hs, fs, ds, vs, gs, qe.bind(void 0, 0), qe.bind(void 0, 1), qe.bind(void 0, 2), qe.bind(void 0, 3), void 0, void 0, void 0, void 0, ms, it.bind(void 0, 2), it.bind(void 0, 3), ut.bind(void 0, 1), ut.bind(void 0, 2), ut.bind(void 0, 3), ys, xs, void 0, void 0, bs, void 0, Ss, Es, st, st, void 0, void 0, void 0, void 0, void 0, Cs, dr.bind(void 0, 0), dr.bind(void 0, 1), Ts, void 0, ks, Us, Ds, As, Os, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, he.bind(void 0, 1), he.bind(void 0, 2), he.bind(void 0, 3), he.bind(void 0, 4), he.bind(void 0, 5), he.bind(void 0, 6), he.bind(void 0, 7), he.bind(void 0, 8), fe.bind(void 0, 1), fe.bind(void 0, 2), fe.bind(void 0, 3), fe.bind(void 0, 4), fe.bind(void 0, 5), fe.bind(void 0, 6), fe.bind(void 0, 7), fe.bind(void 0, 8), E.bind(void 0, 0, 0, 0, 0, 0), E.bind(void 0, 0, 0, 0, 0, 1), E.bind(void 0, 0, 0, 0, 0, 2), E.bind(void 0, 0, 0, 0, 0, 3), E.bind(void 0, 0, 0, 0, 1, 0), E.bind(void 0, 0, 0, 0, 1, 1), E.bind(void 0, 0, 0, 0, 1, 2), E.bind(void 0, 0, 0, 0, 1, 3), E.bind(void 0, 0, 0, 1, 0, 0), E.bind(void 0, 0, 0, 1, 0, 1), E.bind(void 0, 0, 0, 1, 0, 2), E.bind(void 0, 0, 0, 1, 0, 3), E.bind(void 0, 0, 0, 1, 1, 0), E.bind(void 0, 0, 0, 1, 1, 1), E.bind(void 0, 0, 0, 1, 1, 2), E.bind(void 0, 0, 0, 1, 1, 3), E.bind(void 0, 0, 1, 0, 0, 0), E.bind(void 0, 0, 1, 0, 0, 1), E.bind(void 0, 0, 1, 0, 0, 2), E.bind(void 0, 0, 1, 0, 0, 3), E.bind(void 0, 0, 1, 0, 1, 0), E.bind(void 0, 0, 1, 0, 1, 1), E.bind(void 0, 0, 1, 0, 1, 2), E.bind(void 0, 0, 1, 0, 1, 3), E.bind(void 0, 0, 1, 1, 0, 0), E.bind(void 0, 0, 1, 1, 0, 1), E.bind(void 0, 0, 1, 1, 0, 2), E.bind(void 0, 0, 1, 1, 0, 3), E.bind(void 0, 0, 1, 1, 1, 0), E.bind(void 0, 0, 1, 1, 1, 1), E.bind(void 0, 0, 1, 1, 1, 2), E.bind(void 0, 0, 1, 1, 1, 3), E.bind(void 0, 1, 0, 0, 0, 0), E.bind(void 0, 1, 0, 0, 0, 1), E.bind(void 0, 1, 0, 0, 0, 2), E.bind(void 0, 1, 0, 0, 0, 3), E.bind(void 0, 1, 0, 0, 1, 0), E.bind(void 0, 1, 0, 0, 1, 1), E.bind(void 0, 1, 0, 0, 1, 2), E.bind(void 0, 1, 0, 0, 1, 3), E.bind(void 0, 1, 0, 1, 0, 0), E.bind(void 0, 1, 0, 1, 0, 1), E.bind(void 0, 1, 0, 1, 0, 2), E.bind(void 0, 1, 0, 1, 0, 3), E.bind(void 0, 1, 0, 1, 1, 0), E.bind(void 0, 1, 0, 1, 1, 1), E.bind(void 0, 1, 0, 1, 1, 2), E.bind(void 0, 1, 0, 1, 1, 3), E.bind(void 0, 1, 1, 0, 0, 0), E.bind(void 0, 1, 1, 0, 0, 1), E.bind(void 0, 1, 1, 0, 0, 2), E.bind(void 0, 1, 1, 0, 0, 3), E.bind(void 0, 1, 1, 0, 1, 0), E.bind(void 0, 1, 1, 0, 1, 1), E.bind(void 0, 1, 1, 0, 1, 2), E.bind(void 0, 1, 1, 0, 1, 3), E.bind(void 0, 1, 1, 1, 0, 0), E.bind(void 0, 1, 1, 1, 0, 1), E.bind(void 0, 1, 1, 1, 0, 2), E.bind(void 0, 1, 1, 1, 0, 3), E.bind(void 0, 1, 1, 1, 1, 0), E.bind(void 0, 1, 1, 1, 1, 1), E.bind(void 0, 1, 1, 1, 1, 2), E.bind(void 0, 1, 1, 1, 1, 3)];
3132
+ function Ue(e) {
3133
+ this.char = e, this.state = {}, this.activeState = null;
3134
+ }
3135
+ function Ot(e, t, r) {
3136
+ this.contextName = r, this.startIndex = e, this.endOffset = t;
3137
+ }
3138
+ function Bs(e, t, r) {
3139
+ this.contextName = e, this.openRange = null, this.ranges = [], this.checkStart = t, this.checkEnd = r;
3140
+ }
3141
+ function te(e, t) {
3142
+ this.context = e, this.index = t, this.length = e.length, this.current = e[t], this.backtrack = e.slice(0, t), this.lookahead = e.slice(t + 1);
3143
+ }
3144
+ function $e(e) {
3145
+ this.eventId = e, this.subscribers = [];
3146
+ }
3147
+ function Rs(e) {
3148
+ var t = this, r = ["start", "end", "next", "newToken", "contextStart", "contextEnd", "insertToken", "removeToken", "removeRange", "replaceToken", "replaceRange", "composeRUD", "updateContextsRanges"];
3149
+ r.forEach(function(a) {
3150
+ Object.defineProperty(t.events, a, { value: new $e(a) });
3151
+ }), e && r.forEach(function(a) {
3152
+ var o = e[a];
3153
+ typeof o == "function" && t.events[a].subscribe(o);
3154
+ });
3155
+ var n = ["insertToken", "removeToken", "removeRange", "replaceToken", "replaceRange", "composeRUD"];
3156
+ n.forEach(function(a) {
3157
+ t.events[a].subscribe(t.updateContextsRanges);
3158
+ });
3159
+ }
3160
+ function L(e) {
3161
+ this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], Rs.call(this, e);
3162
+ }
3163
+ Ue.prototype.setState = function(e, t) {
3164
+ return this.state[e] = t, this.activeState = { key: e, value: this.state[e] }, this.activeState;
3165
+ };
3166
+ Ue.prototype.getState = function(e) {
3167
+ return this.state[e] || null;
3168
+ };
3169
+ L.prototype.inboundIndex = function(e) {
3170
+ return e >= 0 && e < this.tokens.length;
3171
+ };
3172
+ L.prototype.composeRUD = function(e) {
3173
+ var t = this, r = !0, n = e.map(function(o) {
3174
+ return t[o[0]].apply(t, o.slice(1).concat(r));
3175
+ }), a = function(o) {
3176
+ return typeof o == "object" && o.hasOwnProperty("FAIL");
3177
+ };
3178
+ if (n.every(a)) return { FAIL: "composeRUD: one or more operations hasn't completed successfully", report: n.filter(a) };
3179
+ this.dispatch("composeRUD", [n.filter(function(o) {
3180
+ return !a(o);
3181
+ })]);
3182
+ };
3183
+ L.prototype.replaceRange = function(e, t, r, n) {
3184
+ t = t !== null ? t : this.tokens.length;
3185
+ var a = r.every(function(s) {
3186
+ return s instanceof Ue;
3187
+ });
3188
+ if (!isNaN(e) && this.inboundIndex(e) && a) {
3189
+ var o = this.tokens.splice.apply(this.tokens, [e, t].concat(r));
3190
+ return n || this.dispatch("replaceToken", [e, t, r]), [o, r];
3191
+ } else return { FAIL: "replaceRange: invalid tokens or startIndex." };
3192
+ };
3193
+ L.prototype.replaceToken = function(e, t, r) {
3194
+ if (!isNaN(e) && this.inboundIndex(e) && t instanceof Ue) {
3195
+ var n = this.tokens.splice(e, 1, t);
3196
+ return r || this.dispatch("replaceToken", [e, t]), [n[0], t];
3197
+ } else return { FAIL: "replaceToken: invalid token or index." };
3198
+ };
3199
+ L.prototype.removeRange = function(e, t, r) {
3200
+ t = isNaN(t) ? this.tokens.length : t;
3201
+ var n = this.tokens.splice(e, t);
3202
+ return r || this.dispatch("removeRange", [n, e, t]), n;
3203
+ };
3204
+ L.prototype.removeToken = function(e, t) {
3205
+ if (!isNaN(e) && this.inboundIndex(e)) {
3206
+ var r = this.tokens.splice(e, 1);
3207
+ return t || this.dispatch("removeToken", [r, e]), r;
3208
+ } else return { FAIL: "removeToken: invalid token index." };
3209
+ };
3210
+ L.prototype.insertToken = function(e, t, r) {
3211
+ var n = e.every(function(a) {
3212
+ return a instanceof Ue;
3213
+ });
3214
+ return n ? (this.tokens.splice.apply(this.tokens, [t, 0].concat(e)), r || this.dispatch("insertToken", [e, t]), e) : { FAIL: "insertToken: invalid token(s)." };
3215
+ };
3216
+ L.prototype.registerModifier = function(e, t, r) {
3217
+ this.events.newToken.subscribe(function(n, a) {
3218
+ var o = [n, a], s = t === null || t.apply(this, o) === !0, u = [n, a];
3219
+ if (s) {
3220
+ var i = r.apply(this, u);
3221
+ n.setState(e, i);
3222
+ }
3223
+ }), this.registeredModifiers.push(e);
3224
+ };
3225
+ $e.prototype.subscribe = function(e) {
3226
+ return typeof e == "function" ? this.subscribers.push(e) - 1 : { FAIL: "invalid '" + this.eventId + "' event handler" };
3227
+ };
3228
+ $e.prototype.unsubscribe = function(e) {
3229
+ this.subscribers.splice(e, 1);
3230
+ };
3231
+ te.prototype.setCurrentIndex = function(e) {
3232
+ this.index = e, this.current = this.context[e], this.backtrack = this.context.slice(0, e), this.lookahead = this.context.slice(e + 1);
3233
+ };
3234
+ te.prototype.get = function(e) {
3235
+ switch (!0) {
3236
+ case e === 0:
3237
+ return this.current;
3238
+ case (e < 0 && Math.abs(e) <= this.backtrack.length):
3239
+ return this.backtrack.slice(e)[0];
3240
+ case (e > 0 && e <= this.lookahead.length):
3241
+ return this.lookahead[e - 1];
3242
+ default:
3243
+ return null;
3244
+ }
3245
+ };
3246
+ L.prototype.rangeToText = function(e) {
3247
+ if (e instanceof Ot) return this.getRangeTokens(e).map(function(t) {
3248
+ return t.char;
3249
+ }).join("");
3250
+ };
3251
+ L.prototype.getText = function() {
3252
+ return this.tokens.map(function(e) {
3253
+ return e.char;
3254
+ }).join("");
3255
+ };
3256
+ L.prototype.getContext = function(e) {
3257
+ var t = this.registeredContexts[e];
3258
+ return t || null;
3259
+ };
3260
+ L.prototype.on = function(e, t) {
3261
+ var r = this.events[e];
3262
+ return r ? r.subscribe(t) : null;
3263
+ };
3264
+ L.prototype.dispatch = function(e, t) {
3265
+ var r = this, n = this.events[e];
3266
+ n instanceof $e && n.subscribers.forEach(function(a) {
3267
+ a.apply(r, t || []);
3268
+ });
3269
+ };
3270
+ L.prototype.registerContextChecker = function(e, t, r) {
3271
+ if (this.getContext(e)) return { FAIL: "context name '" + e + "' is already registered." };
3272
+ if (typeof t != "function") return { FAIL: "missing context start check." };
3273
+ if (typeof r != "function") return { FAIL: "missing context end check." };
3274
+ var n = new Bs(e, t, r);
3275
+ return this.registeredContexts[e] = n, this.contextCheckers.push(n), n;
3276
+ };
3277
+ L.prototype.getRangeTokens = function(e) {
3278
+ var t = e.startIndex + e.endOffset;
3279
+ return [].concat(this.tokens.slice(e.startIndex, t));
3280
+ };
3281
+ L.prototype.getContextRanges = function(e) {
3282
+ var t = this.getContext(e);
3283
+ return t ? t.ranges : { FAIL: "context checker '" + e + "' is not registered." };
3284
+ };
3285
+ L.prototype.resetContextsRanges = function() {
3286
+ var e = this.registeredContexts;
3287
+ for (var t in e) if (e.hasOwnProperty(t)) {
3288
+ var r = e[t];
3289
+ r.ranges = [];
3290
+ }
3291
+ };
3292
+ L.prototype.updateContextsRanges = function() {
3293
+ this.resetContextsRanges();
3294
+ for (var e = this.tokens.map(function(n) {
3295
+ return n.char;
3296
+ }), t = 0; t < e.length; t++) {
3297
+ var r = new te(e, t);
3298
+ this.runContextCheck(r);
3299
+ }
3300
+ this.dispatch("updateContextsRanges", [this.registeredContexts]);
3301
+ };
3302
+ L.prototype.setEndOffset = function(e, t) {
3303
+ var r = this.getContext(t).openRange.startIndex, n = new Ot(r, e, t), a = this.getContext(t).ranges;
3304
+ return n.rangeId = t + "." + a.length, a.push(n), this.getContext(t).openRange = null, n;
3305
+ };
3306
+ L.prototype.runContextCheck = function(e) {
3307
+ var t = this, r = e.index;
3308
+ this.contextCheckers.forEach(function(n) {
3309
+ var a = n.contextName, o = t.getContext(a).openRange;
3310
+ if (!o && n.checkStart(e) && (o = new Ot(r, null, a), t.getContext(a).openRange = o, t.dispatch("contextStart", [a, r])), !!o && n.checkEnd(e)) {
3311
+ var s = r - o.startIndex + 1, u = t.setEndOffset(s, a);
3312
+ t.dispatch("contextEnd", [a, u]);
3313
+ }
3314
+ });
3315
+ };
3316
+ L.prototype.tokenize = function(e) {
3317
+ this.tokens = [], this.resetContextsRanges();
3318
+ var t = Array.from(e);
3319
+ this.dispatch("start");
3320
+ for (var r = 0; r < t.length; r++) {
3321
+ var n = t[r], a = new te(t, r);
3322
+ this.dispatch("next", [a]), this.runContextCheck(a);
3323
+ var o = new Ue(n);
3324
+ this.tokens.push(o), this.dispatch("newToken", [o, a]);
3325
+ }
3326
+ return this.dispatch("end", [this.tokens]), this.tokens;
3327
+ };
3328
+ function ge(e) {
3329
+ return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e);
3330
+ }
3331
+ function cn(e) {
3332
+ return /[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e);
3333
+ }
3334
+ function me(e) {
3335
+ return /[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e);
3336
+ }
3337
+ function Xe(e) {
3338
+ return /[A-z]/.test(e);
3339
+ }
3340
+ function Fs(e) {
3341
+ return /\s/.test(e);
3342
+ }
3343
+ function K(e) {
3344
+ this.font = e, this.features = {};
3345
+ }
3346
+ function be(e) {
3347
+ this.id = e.id, this.tag = e.tag, this.substitution = e.substitution;
3348
+ }
3349
+ function Ge(e, t) {
3350
+ if (!e) return -1;
3351
+ switch (t.format) {
3352
+ case 1:
3353
+ return t.glyphs.indexOf(e);
3354
+ case 2:
3355
+ for (var r = t.ranges, n = 0; n < r.length; n++) {
3356
+ var a = r[n];
3357
+ if (e >= a.start && e <= a.end) {
3358
+ var o = e - a.start;
3359
+ return a.index + o;
3360
+ }
3361
+ }
3362
+ break;
3363
+ default:
3364
+ return -1;
3365
+ }
3366
+ return -1;
3367
+ }
3368
+ function ws(e, t) {
3369
+ var r = Ge(e, t.coverage);
3370
+ return r === -1 ? null : e + t.deltaGlyphId;
3371
+ }
3372
+ function Ls(e, t) {
3373
+ var r = Ge(e, t.coverage);
3374
+ return r === -1 ? null : t.substitute[r];
3375
+ }
3376
+ function lt(e, t) {
3377
+ for (var r = [], n = 0; n < e.length; n++) {
3378
+ var a = e[n], o = t.current;
3379
+ o = Array.isArray(o) ? o[0] : o;
3380
+ var s = Ge(o, a);
3381
+ s !== -1 && r.push(s);
3382
+ }
3383
+ return r.length !== e.length ? -1 : r;
3384
+ }
3385
+ function Is(e, t) {
3386
+ var r = t.inputCoverage.length + t.lookaheadCoverage.length + t.backtrackCoverage.length;
3387
+ if (e.context.length < r) return [];
3388
+ var n = lt(t.inputCoverage, e);
3389
+ if (n === -1) return [];
3390
+ var a = t.inputCoverage.length - 1;
3391
+ if (e.lookahead.length < t.lookaheadCoverage.length) return [];
3392
+ for (var o = e.lookahead.slice(a); o.length && me(o[0].char); ) o.shift();
3393
+ var s = new te(o, 0), u = lt(t.lookaheadCoverage, s), i = [].concat(e.backtrack);
3394
+ for (i.reverse(); i.length && me(i[0].char); ) i.shift();
3395
+ if (i.length < t.backtrackCoverage.length) return [];
3396
+ var p = new te(i, 0), l = lt(t.backtrackCoverage, p), h = n.length === t.inputCoverage.length && u.length === t.lookaheadCoverage.length && l.length === t.backtrackCoverage.length, c = [];
3397
+ if (h) for (var f = 0; f < t.lookupRecords.length; f++) for (var v = t.lookupRecords[f], x = v.lookupListIndex, m = this.getLookupByIndex(x), y = 0; y < m.subtables.length; y++) {
3398
+ var U = m.subtables[y], S = this.getLookupMethod(m, U), B = this.getSubstitutionType(m, U);
3399
+ if (B === "12") for (var A = 0; A < n.length; A++) {
3400
+ var F = e.get(A), O = S(F);
3401
+ O && c.push(O);
3402
+ }
3403
+ }
3404
+ return c;
3405
+ }
3406
+ function Ms(e, t) {
3407
+ var r = e.current, n = Ge(r, t.coverage);
3408
+ if (n === -1) return null;
3409
+ for (var a, o = t.ligatureSets[n], s = 0; s < o.length; s++) {
3410
+ a = o[s];
3411
+ for (var u = 0; u < a.components.length; u++) {
3412
+ var i = e.lookahead[u], p = a.components[u];
3413
+ if (i !== p) break;
3414
+ if (u === a.components.length - 1) return a;
3415
+ }
3416
+ }
3417
+ return null;
3418
+ }
3419
+ function Gs(e, t) {
3420
+ var r = Ge(e, t.coverage);
3421
+ return r === -1 ? null : t.sequences[r];
3422
+ }
3423
+ K.prototype.getDefaultScriptFeaturesIndexes = function() {
3424
+ for (var e = this.font.tables.gsub.scripts, t = 0; t < e.length; t++) {
3425
+ var r = e[t];
3426
+ if (r.tag === "DFLT") return r.script.defaultLangSys.featureIndexes;
3427
+ }
3428
+ return [];
3429
+ };
3430
+ K.prototype.getScriptFeaturesIndexes = function(e) {
3431
+ var t = this.font.tables;
3432
+ if (!t.gsub) return [];
3433
+ if (!e) return this.getDefaultScriptFeaturesIndexes();
3434
+ for (var r = this.font.tables.gsub.scripts, n = 0; n < r.length; n++) {
3435
+ var a = r[n];
3436
+ if (a.tag === e && a.script.defaultLangSys) return a.script.defaultLangSys.featureIndexes;
3437
+ var o = a.langSysRecords;
3438
+ if (o) for (var s = 0; s < o.length; s++) {
3439
+ var u = o[s];
3440
+ if (u.tag === e) {
3441
+ var i = u.langSys;
3442
+ return i.featureIndexes;
3443
+ }
3444
+ }
3445
+ }
3446
+ return this.getDefaultScriptFeaturesIndexes();
3447
+ };
3448
+ K.prototype.mapTagsToFeatures = function(e, t) {
3449
+ for (var r = {}, n = 0; n < e.length; n++) {
3450
+ var a = e[n].tag, o = e[n].feature;
3451
+ r[a] = o;
3452
+ }
3453
+ this.features[t].tags = r;
3454
+ };
3455
+ K.prototype.getScriptFeatures = function(e) {
3456
+ var t = this.features[e];
3457
+ if (this.features.hasOwnProperty(e)) return t;
3458
+ var r = this.getScriptFeaturesIndexes(e);
3459
+ if (!r) return null;
3460
+ var n = this.font.tables.gsub;
3461
+ return t = r.map(function(a) {
3462
+ return n.features[a];
3463
+ }), this.features[e] = t, this.mapTagsToFeatures(t, e), t;
3464
+ };
3465
+ K.prototype.getSubstitutionType = function(e, t) {
3466
+ var r = e.lookupType.toString(), n = t.substFormat.toString();
3467
+ return r + n;
3468
+ };
3469
+ K.prototype.getLookupMethod = function(e, t) {
3470
+ var r = this, n = this.getSubstitutionType(e, t);
3471
+ switch (n) {
3472
+ case "11":
3473
+ return function(a) {
3474
+ return ws.apply(r, [a, t]);
3475
+ };
3476
+ case "12":
3477
+ return function(a) {
3478
+ return Ls.apply(r, [a, t]);
3479
+ };
3480
+ case "63":
3481
+ return function(a) {
3482
+ return Is.apply(r, [a, t]);
3483
+ };
3484
+ case "41":
3485
+ return function(a) {
3486
+ return Ms.apply(r, [a, t]);
3487
+ };
3488
+ case "21":
3489
+ return function(a) {
3490
+ return Gs.apply(r, [a, t]);
3491
+ };
3492
+ default:
3493
+ throw new Error("lookupType: " + e.lookupType + " - substFormat: " + t.substFormat + " is not yet supported");
3494
+ }
3495
+ };
3496
+ K.prototype.lookupFeature = function(e) {
3497
+ var t = e.contextParams, r = t.index, n = this.getFeature({ tag: e.tag, script: e.script });
3498
+ if (!n) return new Error("font '" + this.font.names.fullName.en + "' doesn't support feature '" + e.tag + "' for script '" + e.script + "'.");
3499
+ for (var a = this.getFeatureLookups(n), o = [].concat(t.context), s = 0; s < a.length; s++) for (var u = a[s], i = this.getLookupSubtables(u), p = 0; p < i.length; p++) {
3500
+ var l = i[p], h = this.getSubstitutionType(u, l), c = this.getLookupMethod(u, l), f = void 0;
3501
+ switch (h) {
3502
+ case "11":
3503
+ f = c(t.current), f && o.splice(r, 1, new be({ id: 11, tag: e.tag, substitution: f }));
3504
+ break;
3505
+ case "12":
3506
+ f = c(t.current), f && o.splice(r, 1, new be({ id: 12, tag: e.tag, substitution: f }));
3507
+ break;
3508
+ case "63":
3509
+ f = c(t), Array.isArray(f) && f.length && o.splice(r, 1, new be({ id: 63, tag: e.tag, substitution: f }));
3510
+ break;
3511
+ case "41":
3512
+ f = c(t), f && o.splice(r, 1, new be({ id: 41, tag: e.tag, substitution: f }));
3513
+ break;
3514
+ case "21":
3515
+ f = c(t.current), f && o.splice(r, 1, new be({ id: 21, tag: e.tag, substitution: f }));
3516
+ break;
3517
+ }
3518
+ t = new te(o, r), !(Array.isArray(f) && !f.length) && (f = null);
3519
+ }
3520
+ return o.length ? o : null;
3521
+ };
3522
+ K.prototype.supports = function(e) {
3523
+ if (!e.script) return !1;
3524
+ this.getScriptFeatures(e.script);
3525
+ var t = this.features.hasOwnProperty(e.script);
3526
+ if (!e.tag) return t;
3527
+ var r = this.features[e.script].some(function(n) {
3528
+ return n.tag === e.tag;
3529
+ });
3530
+ return t && r;
3531
+ };
3532
+ K.prototype.getLookupSubtables = function(e) {
3533
+ return e.subtables || null;
3534
+ };
3535
+ K.prototype.getLookupByIndex = function(e) {
3536
+ var t = this.font.tables.gsub.lookups;
3537
+ return t[e] || null;
3538
+ };
3539
+ K.prototype.getFeatureLookups = function(e) {
3540
+ return e.lookupListIndexes.map(this.getLookupByIndex.bind(this));
3541
+ };
3542
+ K.prototype.getFeature = function(e) {
3543
+ if (!this.font) return { FAIL: "No font was found" };
3544
+ this.features.hasOwnProperty(e.script) || this.getScriptFeatures(e.script);
3545
+ var t = this.features[e.script];
3546
+ return t ? t.tags[e.tag] ? this.features[e.script].tags[e.tag] : null : { FAIL: "No feature for script " + e.script };
3547
+ };
3548
+ function Ps(e) {
3549
+ var t = e.current, r = e.get(-1);
3550
+ return r === null && ge(t) || !ge(r) && ge(t);
3551
+ }
3552
+ function Ns(e) {
3553
+ var t = e.get(1);
3554
+ return t === null || !ge(t);
3555
+ }
3556
+ var Hs = { startCheck: Ps, endCheck: Ns };
3557
+ function zs(e) {
3558
+ var t = e.current, r = e.get(-1);
3559
+ return (ge(t) || me(t)) && !ge(r);
3560
+ }
3561
+ function Ws(e) {
3562
+ var t = e.get(1);
3563
+ switch (!0) {
3564
+ case t === null:
3565
+ return !0;
3566
+ case (!ge(t) && !me(t)):
3567
+ var r = Fs(t);
3568
+ if (!r) return !0;
3569
+ if (r) {
3570
+ var n = !1;
3571
+ if (n = e.lookahead.some(function(a) {
3572
+ return ge(a) || me(a);
3573
+ }), !n) return !0;
3574
+ }
3575
+ break;
3576
+ default:
3577
+ return !1;
3578
+ }
3579
+ }
3580
+ var qs = { startCheck: zs, endCheck: Ws };
3581
+ function _s(e, t, r) {
3582
+ t[r].setState(e.tag, e.substitution);
3583
+ }
3584
+ function Xs(e, t, r) {
3585
+ t[r].setState(e.tag, e.substitution);
3586
+ }
3587
+ function Vs(e, t, r) {
3588
+ e.substitution.forEach(function(n, a) {
3589
+ var o = t[r + a];
3590
+ o.setState(e.tag, n);
3591
+ });
3592
+ }
3593
+ function Ys(e, t, r) {
3594
+ var n = t[r];
3595
+ n.setState(e.tag, e.substitution.ligGlyph);
3596
+ for (var a = e.substitution.components.length, o = 0; o < a; o++) n = t[r + o + 1], n.setState("deleted", !0);
3597
+ }
3598
+ var vr = { 11: _s, 12: Xs, 63: Vs, 41: Ys };
3599
+ function Bt(e, t, r) {
3600
+ e instanceof be && vr[e.id] && vr[e.id](e, t, r);
3601
+ }
3602
+ function js(e) {
3603
+ for (var t = [].concat(e.backtrack), r = t.length - 1; r >= 0; r--) {
3604
+ var n = t[r], a = cn(n), o = me(n);
3605
+ if (!a && !o) return !0;
3606
+ if (a) return !1;
3607
+ }
3608
+ return !1;
3609
+ }
3610
+ function Zs(e) {
3611
+ if (cn(e.current)) return !1;
3612
+ for (var t = 0; t < e.lookahead.length; t++) {
3613
+ var r = e.lookahead[t], n = me(r);
3614
+ if (!n) return !0;
3615
+ }
3616
+ return !1;
3617
+ }
3618
+ function Qs(e) {
3619
+ var t = this, r = "arab", n = this.featuresTags[r], a = this.tokenizer.getRangeTokens(e);
3620
+ if (a.length !== 1) {
3621
+ var o = new te(a.map(function(u) {
3622
+ return u.getState("glyphIndex");
3623
+ }), 0), s = new te(a.map(function(u) {
3624
+ return u.char;
3625
+ }), 0);
3626
+ a.forEach(function(u, i) {
3627
+ if (!me(u.char)) {
3628
+ o.setCurrentIndex(i), s.setCurrentIndex(i);
3629
+ var p = 0;
3630
+ js(s) && (p |= 1), Zs(s) && (p |= 2);
3631
+ var l;
3632
+ switch (p) {
3633
+ case 1:
3634
+ l = "fina";
3635
+ break;
3636
+ case 2:
3637
+ l = "init";
3638
+ break;
3639
+ case 3:
3640
+ l = "medi";
3641
+ break;
3642
+ }
3643
+ if (n.indexOf(l) !== -1) {
3644
+ var h = t.query.lookupFeature({ tag: l, script: r, contextParams: o });
3645
+ if (h instanceof Error) return console.info(h.message);
3646
+ h.forEach(function(c, f) {
3647
+ c instanceof be && (Bt(c, a, f), o.context[f] = c.substitution);
3648
+ });
3649
+ }
3650
+ }
3651
+ });
3652
+ }
3653
+ }
3654
+ function gr(e, t) {
3655
+ var r = e.map(function(n) {
3656
+ return n.activeState.value;
3657
+ });
3658
+ return new te(r, 0);
3659
+ }
3660
+ function Ks(e) {
3661
+ var t = this, r = "arab", n = this.tokenizer.getRangeTokens(e), a = gr(n);
3662
+ a.context.forEach(function(o, s) {
3663
+ a.setCurrentIndex(s);
3664
+ var u = t.query.lookupFeature({ tag: "rlig", script: r, contextParams: a });
3665
+ u.length && (u.forEach(function(i) {
3666
+ return Bt(i, n, s);
3667
+ }), a = gr(n));
3668
+ });
3669
+ }
3670
+ function Js(e) {
3671
+ var t = e.current, r = e.get(-1);
3672
+ return r === null && Xe(t) || !Xe(r) && Xe(t);
3673
+ }
3674
+ function $s(e) {
3675
+ var t = e.get(1);
3676
+ return t === null || !Xe(t);
3677
+ }
3678
+ var ei = { startCheck: Js, endCheck: $s };
3679
+ function mr(e, t) {
3680
+ var r = e.map(function(n) {
3681
+ return n.activeState.value;
3682
+ });
3683
+ return new te(r, 0);
3684
+ }
3685
+ function ti(e) {
3686
+ var t = this, r = "latn", n = this.tokenizer.getRangeTokens(e), a = mr(n);
3687
+ a.context.forEach(function(o, s) {
3688
+ a.setCurrentIndex(s);
3689
+ var u = t.query.lookupFeature({ tag: "liga", script: r, contextParams: a });
3690
+ u.length && (u.forEach(function(i) {
3691
+ return Bt(i, n, s);
3692
+ }), a = mr(n));
3693
+ });
3694
+ }
3695
+ function ae(e) {
3696
+ this.baseDir = e || "ltr", this.tokenizer = new L(), this.featuresTags = {};
3697
+ }
3698
+ ae.prototype.setText = function(e) {
3699
+ this.text = e;
3700
+ };
3701
+ ae.prototype.contextChecks = { latinWordCheck: ei, arabicWordCheck: Hs, arabicSentenceCheck: qs };
3702
+ function pt(e) {
3703
+ var t = this.contextChecks[e + "Check"];
3704
+ return this.tokenizer.registerContextChecker(e, t.startCheck, t.endCheck);
3705
+ }
3706
+ function ri() {
3707
+ return pt.call(this, "latinWord"), pt.call(this, "arabicWord"), pt.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
3708
+ }
3709
+ function ni() {
3710
+ var e = this, t = this.tokenizer.getContextRanges("arabicSentence");
3711
+ t.forEach(function(r) {
3712
+ var n = e.tokenizer.getRangeTokens(r);
3713
+ e.tokenizer.replaceRange(r.startIndex, r.endOffset, n.reverse());
3714
+ });
3715
+ }
3716
+ ae.prototype.registerFeatures = function(e, t) {
3717
+ var r = this, n = t.filter(function(a) {
3718
+ return r.query.supports({ script: e, tag: a });
3719
+ });
3720
+ this.featuresTags.hasOwnProperty(e) ? this.featuresTags[e] = this.featuresTags[e].concat(n) : this.featuresTags[e] = n;
3721
+ };
3722
+ ae.prototype.applyFeatures = function(e, t) {
3723
+ if (!e) throw new Error("No valid font was provided to apply features");
3724
+ this.query || (this.query = new K(e));
3725
+ for (var r = 0; r < t.length; r++) {
3726
+ var n = t[r];
3727
+ !this.query.supports({ script: n.script }) || this.registerFeatures(n.script, n.tags);
3728
+ }
3729
+ };
3730
+ ae.prototype.registerModifier = function(e, t, r) {
3731
+ this.tokenizer.registerModifier(e, t, r);
3732
+ };
3733
+ function Rt() {
3734
+ if (this.tokenizer.registeredModifiers.indexOf("glyphIndex") === -1) throw new Error("glyphIndex modifier is required to apply arabic presentation features.");
3735
+ }
3736
+ function ai() {
3737
+ var e = this, t = "arab";
3738
+ if (this.featuresTags.hasOwnProperty(t)) {
3739
+ Rt.call(this);
3740
+ var r = this.tokenizer.getContextRanges("arabicWord");
3741
+ r.forEach(function(n) {
3742
+ Qs.call(e, n);
3743
+ });
3744
+ }
3745
+ }
3746
+ function oi() {
3747
+ var e = this, t = "arab";
3748
+ if (this.featuresTags.hasOwnProperty(t)) {
3749
+ var r = this.featuresTags[t];
3750
+ if (r.indexOf("rlig") !== -1) {
3751
+ Rt.call(this);
3752
+ var n = this.tokenizer.getContextRanges("arabicWord");
3753
+ n.forEach(function(a) {
3754
+ Ks.call(e, a);
3755
+ });
3756
+ }
3757
+ }
3758
+ }
3759
+ function si() {
3760
+ var e = this, t = "latn";
3761
+ if (this.featuresTags.hasOwnProperty(t)) {
3762
+ var r = this.featuresTags[t];
3763
+ if (r.indexOf("liga") !== -1) {
3764
+ Rt.call(this);
3765
+ var n = this.tokenizer.getContextRanges("latinWord");
3766
+ n.forEach(function(a) {
3767
+ ti.call(e, a);
3768
+ });
3769
+ }
3770
+ }
3771
+ }
3772
+ ae.prototype.checkContextReady = function(e) {
3773
+ return !!this.tokenizer.getContext(e);
3774
+ };
3775
+ ae.prototype.applyFeaturesToContexts = function() {
3776
+ this.checkContextReady("arabicWord") && (ai.call(this), oi.call(this)), this.checkContextReady("latinWord") && si.call(this), this.checkContextReady("arabicSentence") && ni.call(this);
3777
+ };
3778
+ ae.prototype.processText = function(e) {
3779
+ (!this.text || this.text !== e) && (this.setText(e), ri.call(this), this.applyFeaturesToContexts());
3780
+ };
3781
+ ae.prototype.getBidiText = function(e) {
3782
+ return this.processText(e), this.tokenizer.getText();
3783
+ };
3784
+ ae.prototype.getTextGlyphs = function(e) {
3785
+ this.processText(e);
3786
+ for (var t = [], r = 0; r < this.tokenizer.tokens.length; r++) {
3787
+ var n = this.tokenizer.tokens[r];
3788
+ if (!n.state.deleted) {
3789
+ var a = n.activeState.value;
3790
+ t.push(Array.isArray(a) ? a[0] : a);
3791
+ }
3792
+ }
3793
+ return t;
3794
+ };
3795
+ function R(e) {
3796
+ e = e || {}, e.tables = e.tables || {}, e.empty || (De(e.familyName, "When creating a new Font object, familyName is required."), De(e.styleName, "When creating a new Font object, styleName is required."), De(e.unitsPerEm, "When creating a new Font object, unitsPerEm is required."), De(e.ascender, "When creating a new Font object, ascender is required."), De(e.descender <= 0, "When creating a new Font object, negative descender value is required."), this.names = { fontFamily: { en: e.familyName || " " }, fontSubfamily: { en: e.styleName || " " }, fullName: { en: e.fullName || e.familyName + " " + e.styleName }, postScriptName: { en: e.postScriptName || (e.familyName + e.styleName).replace(/\s/g, "") }, designer: { en: e.designer || " " }, designerURL: { en: e.designerURL || " " }, manufacturer: { en: e.manufacturer || " " }, manufacturerURL: { en: e.manufacturerURL || " " }, license: { en: e.license || " " }, licenseURL: { en: e.licenseURL || " " }, version: { en: e.version || "Version 0.1" }, description: { en: e.description || " " }, copyright: { en: e.copyright || " " }, trademark: { en: e.trademark || " " } }, this.unitsPerEm = e.unitsPerEm || 1e3, this.ascender = e.ascender, this.descender = e.descender, this.createdTimestamp = e.createdTimestamp, this.tables = Object.assign(e.tables, { os2: Object.assign({ usWeightClass: e.weightClass || this.usWeightClasses.MEDIUM, usWidthClass: e.widthClass || this.usWidthClasses.MEDIUM, fsSelection: e.fsSelection || this.fsSelectionValues.REGULAR }, e.tables.os2) })), this.supported = !0, this.glyphs = new ue.GlyphSet(this, e.glyphs || []), this.encoding = new Ar(this), this.position = new Le(this), this.substitution = new Q(this), this.tables = this.tables || {}, this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", { get: function() {
3797
+ if (this._hinting) return this._hinting;
3798
+ if (this.outlinesFormat === "truetype") return this._hinting = new sn(this);
3799
+ } });
3800
+ }
3801
+ R.prototype.hasChar = function(e) {
3802
+ return this.encoding.charToGlyphIndex(e) !== null;
3803
+ };
3804
+ R.prototype.charToGlyphIndex = function(e) {
3805
+ return this.encoding.charToGlyphIndex(e);
3806
+ };
3807
+ R.prototype.charToGlyph = function(e) {
3808
+ var t = this.charToGlyphIndex(e), r = this.glyphs.get(t);
3809
+ return r || (r = this.glyphs.get(0)), r;
3810
+ };
3811
+ R.prototype.updateFeatures = function(e) {
3812
+ return this.defaultRenderOptions.features.map(function(t) {
3813
+ return t.script === "latn" ? { script: "latn", tags: t.tags.filter(function(r) {
3814
+ return e[r];
3815
+ }) } : t;
3816
+ });
3817
+ };
3818
+ R.prototype.stringToGlyphs = function(e, t) {
3819
+ var r = this, n = new ae(), a = function(h) {
3820
+ return r.charToGlyphIndex(h.char);
3821
+ };
3822
+ n.registerModifier("glyphIndex", null, a);
3823
+ var o = t ? this.updateFeatures(t.features) : this.defaultRenderOptions.features;
3824
+ n.applyFeatures(this, o);
3825
+ for (var s = n.getTextGlyphs(e), u = s.length, i = new Array(u), p = this.glyphs.get(0), l = 0; l < u; l += 1) i[l] = this.glyphs.get(s[l]) || p;
3826
+ return i;
3827
+ };
3828
+ R.prototype.nameToGlyphIndex = function(e) {
3829
+ return this.glyphNames.nameToGlyphIndex(e);
3830
+ };
3831
+ R.prototype.nameToGlyph = function(e) {
3832
+ var t = this.nameToGlyphIndex(e), r = this.glyphs.get(t);
3833
+ return r || (r = this.glyphs.get(0)), r;
3834
+ };
3835
+ R.prototype.glyphIndexToName = function(e) {
3836
+ return this.glyphNames.glyphIndexToName ? this.glyphNames.glyphIndexToName(e) : "";
3837
+ };
3838
+ R.prototype.getKerningValue = function(e, t) {
3839
+ e = e.index || e, t = t.index || t;
3840
+ var r = this.position.defaultKerningTables;
3841
+ return r ? this.position.getKerningValue(r, e, t) : this.kerningPairs[e + "," + t] || 0;
3842
+ };
3843
+ R.prototype.defaultRenderOptions = { kerning: !0, features: [{ script: "arab", tags: ["init", "medi", "fina", "rlig"] }, { script: "latn", tags: ["liga", "rlig"] }] };
3844
+ R.prototype.forEachGlyph = function(e, t, r, n, a, o) {
3845
+ t = t !== void 0 ? t : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 72, a = Object.assign({}, this.defaultRenderOptions, a);
3846
+ var s = 1 / this.unitsPerEm * n, u = this.stringToGlyphs(e, a), i;
3847
+ if (a.kerning) {
3848
+ var p = a.script || this.position.getDefaultScriptName();
3849
+ i = this.position.getKerningTables(p, a.language);
3850
+ }
3851
+ for (var l = 0; l < u.length; l += 1) {
3852
+ var h = u[l];
3853
+ if (o.call(this, h, t, r, n, a), h.advanceWidth && (t += h.advanceWidth * s), a.kerning && l < u.length - 1) {
3854
+ var c = i ? this.position.getKerningValue(i, h.index, u[l + 1].index) : this.getKerningValue(h, u[l + 1]);
3855
+ t += c * s;
3856
+ }
3857
+ a.letterSpacing ? t += a.letterSpacing * n : a.tracking && (t += a.tracking / 1e3 * n);
3858
+ }
3859
+ return t;
3860
+ };
3861
+ R.prototype.getPath = function(e, t, r, n, a) {
3862
+ var o = new G();
3863
+ return this.forEachGlyph(e, t, r, n, a, function(s, u, i, p) {
3864
+ var l = s.getPath(u, i, p, a, this);
3865
+ o.extend(l);
3866
+ }), o;
3867
+ };
3868
+ R.prototype.getPaths = function(e, t, r, n, a) {
3869
+ var o = [];
3870
+ return this.forEachGlyph(e, t, r, n, a, function(s, u, i, p) {
3871
+ var l = s.getPath(u, i, p, a, this);
3872
+ o.push(l);
3873
+ }), o;
3874
+ };
3875
+ R.prototype.getAdvanceWidth = function(e, t, r) {
3876
+ return this.forEachGlyph(e, 0, 0, t, r, function() {
3877
+ });
3878
+ };
3879
+ R.prototype.draw = function(e, t, r, n, a, o) {
3880
+ this.getPath(t, r, n, a, o).draw(e);
3881
+ };
3882
+ R.prototype.drawPoints = function(e, t, r, n, a, o) {
3883
+ this.forEachGlyph(t, r, n, a, o, function(s, u, i, p) {
3884
+ s.drawPoints(e, u, i, p);
3885
+ });
3886
+ };
3887
+ R.prototype.drawMetrics = function(e, t, r, n, a, o) {
3888
+ this.forEachGlyph(t, r, n, a, o, function(s, u, i, p) {
3889
+ s.drawMetrics(e, u, i, p);
3890
+ });
3891
+ };
3892
+ R.prototype.getEnglishName = function(e) {
3893
+ var t = this.names[e];
3894
+ if (t) return t.en;
3895
+ };
3896
+ R.prototype.validate = function() {
3897
+ var e = this;
3898
+ function t(r) {
3899
+ var n = e.getEnglishName(r);
3900
+ n && n.trim().length > 0;
3901
+ }
3902
+ t("fontFamily"), t("weightName"), t("manufacturer"), t("copyright"), t("version"), this.unitsPerEm > 0;
3903
+ };
3904
+ R.prototype.toTables = function() {
3905
+ return Va.fontToTable(this);
3906
+ };
3907
+ R.prototype.toBuffer = function() {
3908
+ return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."), this.toArrayBuffer();
3909
+ };
3910
+ R.prototype.toArrayBuffer = function() {
3911
+ for (var e = this.toTables(), t = e.encode(), r = new ArrayBuffer(t.length), n = new Uint8Array(r), a = 0; a < t.length; a++) n[a] = t[a];
3912
+ return r;
3913
+ };
3914
+ R.prototype.download = function(e) {
3915
+ var t = this.getEnglishName("fontFamily"), r = this.getEnglishName("fontSubfamily");
3916
+ e = e || t.replace(/\s/g, "") + "-" + r + ".otf";
3917
+ var n = this.toArrayBuffer();
3918
+ if (ja()) if (window.URL = window.URL || window.webkitURL, window.URL) {
3919
+ var a = new DataView(n), o = new Blob([a], { type: "font/opentype" }), s = document.createElement("a");
3920
+ s.href = window.URL.createObjectURL(o), s.download = e;
3921
+ var u = document.createEvent("MouseEvents");
3922
+ u.initEvent("click", !0, !1), s.dispatchEvent(u);
3923
+ } else console.warn("Font file could not be downloaded. Try using a different browser.");
3924
+ else {
3925
+ var i = bt(), p = Za(n);
3926
+ i.writeFileSync(e, p);
3927
+ }
3928
+ };
3929
+ R.prototype.fsSelectionValues = { ITALIC: 1, UNDERSCORE: 2, NEGATIVE: 4, OUTLINED: 8, STRIKEOUT: 16, BOLD: 32, REGULAR: 64, USER_TYPO_METRICS: 128, WWS: 256, OBLIQUE: 512 };
3930
+ R.prototype.usWidthClasses = { ULTRA_CONDENSED: 1, EXTRA_CONDENSED: 2, CONDENSED: 3, SEMI_CONDENSED: 4, MEDIUM: 5, SEMI_EXPANDED: 6, EXPANDED: 7, EXTRA_EXPANDED: 8, ULTRA_EXPANDED: 9 };
3931
+ R.prototype.usWeightClasses = { THIN: 100, EXTRA_LIGHT: 200, LIGHT: 300, NORMAL: 400, MEDIUM: 500, SEMI_BOLD: 600, BOLD: 700, EXTRA_BOLD: 800, BLACK: 900 };
3932
+ function hn(e, t) {
3933
+ var r = JSON.stringify(e), n = 256;
3934
+ for (var a in t) {
3935
+ var o = parseInt(a);
3936
+ if (!(!o || o < 256)) {
3937
+ if (JSON.stringify(t[a]) === r) return o;
3938
+ n <= o && (n = o + 1);
3939
+ }
3940
+ }
3941
+ return t[n] = e, n;
3942
+ }
3943
+ function ii(e, t, r) {
3944
+ var n = hn(t.name, r);
3945
+ return [{ name: "tag_" + e, type: "TAG", value: t.tag }, { name: "minValue_" + e, type: "FIXED", value: t.minValue << 16 }, { name: "defaultValue_" + e, type: "FIXED", value: t.defaultValue << 16 }, { name: "maxValue_" + e, type: "FIXED", value: t.maxValue << 16 }, { name: "flags_" + e, type: "USHORT", value: 0 }, { name: "nameID_" + e, type: "USHORT", value: n }];
3946
+ }
3947
+ function ui(e, t, r) {
3948
+ var n = {}, a = new C.Parser(e, t);
3949
+ return n.tag = a.parseTag(), n.minValue = a.parseFixed(), n.defaultValue = a.parseFixed(), n.maxValue = a.parseFixed(), a.skip("uShort", 1), n.name = r[a.parseUShort()] || {}, n;
3950
+ }
3951
+ function li(e, t, r, n) {
3952
+ for (var a = hn(t.name, n), o = [{ name: "nameID_" + e, type: "USHORT", value: a }, { name: "flags_" + e, type: "USHORT", value: 0 }], s = 0; s < r.length; ++s) {
3953
+ var u = r[s].tag;
3954
+ o.push({ name: "axis_" + e + " " + u, type: "FIXED", value: t.coordinates[u] << 16 });
3955
+ }
3956
+ return o;
3957
+ }
3958
+ function pi(e, t, r, n) {
3959
+ var a = {}, o = new C.Parser(e, t);
3960
+ a.name = n[o.parseUShort()] || {}, o.skip("uShort", 1), a.coordinates = {};
3961
+ for (var s = 0; s < r.length; ++s) a.coordinates[r[s].tag] = o.parseFixed();
3962
+ return a;
3963
+ }
3964
+ function ci(e, t) {
3965
+ var r = new b.Table("fvar", [{ name: "version", type: "ULONG", value: 65536 }, { name: "offsetToData", type: "USHORT", value: 0 }, { name: "countSizePairs", type: "USHORT", value: 2 }, { name: "axisCount", type: "USHORT", value: e.axes.length }, { name: "axisSize", type: "USHORT", value: 20 }, { name: "instanceCount", type: "USHORT", value: e.instances.length }, { name: "instanceSize", type: "USHORT", value: 4 + e.axes.length * 4 }]);
3966
+ r.offsetToData = r.sizeOf();
3967
+ for (var n = 0; n < e.axes.length; n++) r.fields = r.fields.concat(ii(n, e.axes[n], t));
3968
+ for (var a = 0; a < e.instances.length; a++) r.fields = r.fields.concat(li(a, e.instances[a], e.axes, t));
3969
+ return r;
3970
+ }
3971
+ function hi(e, t, r) {
3972
+ var n = new C.Parser(e, t), a = n.parseULong();
3973
+ k.argument(a === 65536, "Unsupported fvar table version.");
3974
+ var o = n.parseOffset16();
3975
+ n.skip("uShort", 1);
3976
+ for (var s = n.parseUShort(), u = n.parseUShort(), i = n.parseUShort(), p = n.parseUShort(), l = [], h = 0; h < s; h++) l.push(ui(e, t + o + h * u, r));
3977
+ for (var c = [], f = t + o + s * u, v = 0; v < i; v++) c.push(pi(e, f + v * p, l, r));
3978
+ return { axes: l, instances: c };
3979
+ }
3980
+ var fi = { make: ci, parse: hi }, di = function() {
3981
+ return { coverage: this.parsePointer(d.coverage), attachPoints: this.parseList(d.pointer(d.uShortList)) };
3982
+ }, vi = function() {
3983
+ var e = this.parseUShort();
3984
+ if (k.argument(e === 1 || e === 2 || e === 3, "Unsupported CaretValue table version."), e === 1) return { coordinate: this.parseShort() };
3985
+ if (e === 2) return { pointindex: this.parseShort() };
3986
+ if (e === 3) return { coordinate: this.parseShort() };
3987
+ }, gi = function() {
3988
+ return this.parseList(d.pointer(vi));
3989
+ }, mi = function() {
3990
+ return { coverage: this.parsePointer(d.coverage), ligGlyphs: this.parseList(d.pointer(gi)) };
3991
+ }, yi = function() {
3992
+ return this.parseUShort(), this.parseList(d.pointer(d.coverage));
3993
+ };
3994
+ function xi(e, t) {
3995
+ t = t || 0;
3996
+ var r = new d(e, t), n = r.parseVersion(1);
3997
+ k.argument(n === 1 || n === 1.2 || n === 1.3, "Unsupported GDEF table version.");
3998
+ var a = { version: n, classDef: r.parsePointer(d.classDef), attachList: r.parsePointer(di), ligCaretList: r.parsePointer(mi), markAttachClassDef: r.parsePointer(d.classDef) };
3999
+ return n >= 1.2 && (a.markGlyphSets = r.parsePointer(yi)), a;
4000
+ }
4001
+ var bi = { parse: xi }, re = new Array(10);
4002
+ re[1] = function() {
4003
+ var e = this.offset + this.relativeOffset, t = this.parseUShort();
4004
+ if (t === 1) return { posFormat: 1, coverage: this.parsePointer(d.coverage), value: this.parseValueRecord() };
4005
+ if (t === 2) return { posFormat: 2, coverage: this.parsePointer(d.coverage), values: this.parseValueRecordList() };
4006
+ k.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
4007
+ };
4008
+ re[2] = function() {
4009
+ var e = this.offset + this.relativeOffset, t = this.parseUShort();
4010
+ k.assert(t === 1 || t === 2, "0x" + e.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
4011
+ var r = this.parsePointer(d.coverage), n = this.parseUShort(), a = this.parseUShort();
4012
+ if (t === 1) return { posFormat: t, coverage: r, valueFormat1: n, valueFormat2: a, pairSets: this.parseList(d.pointer(d.list(function() {
4013
+ return { secondGlyph: this.parseUShort(), value1: this.parseValueRecord(n), value2: this.parseValueRecord(a) };
4014
+ }))) };
4015
+ if (t === 2) {
4016
+ var o = this.parsePointer(d.classDef), s = this.parsePointer(d.classDef), u = this.parseUShort(), i = this.parseUShort();
4017
+ return { posFormat: t, coverage: r, valueFormat1: n, valueFormat2: a, classDef1: o, classDef2: s, class1Count: u, class2Count: i, classRecords: this.parseList(u, d.list(i, function() {
4018
+ return { value1: this.parseValueRecord(n), value2: this.parseValueRecord(a) };
4019
+ })) };
4020
+ }
4021
+ };
4022
+ re[3] = function() {
4023
+ return { error: "GPOS Lookup 3 not supported" };
4024
+ };
4025
+ re[4] = function() {
4026
+ return { error: "GPOS Lookup 4 not supported" };
4027
+ };
4028
+ re[5] = function() {
4029
+ return { error: "GPOS Lookup 5 not supported" };
4030
+ };
4031
+ re[6] = function() {
4032
+ return { error: "GPOS Lookup 6 not supported" };
4033
+ };
4034
+ re[7] = function() {
4035
+ return { error: "GPOS Lookup 7 not supported" };
4036
+ };
4037
+ re[8] = function() {
4038
+ return { error: "GPOS Lookup 8 not supported" };
4039
+ };
4040
+ re[9] = function() {
4041
+ return { error: "GPOS Lookup 9 not supported" };
4042
+ };
4043
+ function Si(e, t) {
4044
+ t = t || 0;
4045
+ var r = new d(e, t), n = r.parseVersion(1);
4046
+ return k.argument(n === 1 || n === 1.1, "Unsupported GPOS table version " + n), n === 1 ? { version: n, scripts: r.parseScriptList(), features: r.parseFeatureList(), lookups: r.parseLookupList(re) } : { version: n, scripts: r.parseScriptList(), features: r.parseFeatureList(), lookups: r.parseLookupList(re), variations: r.parseFeatureVariationsList() };
4047
+ }
4048
+ var Ei = new Array(10);
4049
+ function Ci(e) {
4050
+ return new b.Table("GPOS", [{ name: "version", type: "ULONG", value: 65536 }, { name: "scripts", type: "TABLE", value: new b.ScriptList(e.scripts) }, { name: "features", type: "TABLE", value: new b.FeatureList(e.features) }, { name: "lookups", type: "TABLE", value: new b.LookupList(e.lookups, Ei) }]);
4051
+ }
4052
+ var Ti = { parse: Si, make: Ci };
4053
+ function ki(e) {
4054
+ var t = {};
4055
+ e.skip("uShort");
4056
+ var r = e.parseUShort();
4057
+ k.argument(r === 0, "Unsupported kern sub-table version."), e.skip("uShort", 2);
4058
+ var n = e.parseUShort();
4059
+ e.skip("uShort", 3);
4060
+ for (var a = 0; a < n; a += 1) {
4061
+ var o = e.parseUShort(), s = e.parseUShort(), u = e.parseShort();
4062
+ t[o + "," + s] = u;
4063
+ }
4064
+ return t;
4065
+ }
4066
+ function Ui(e) {
4067
+ var t = {};
4068
+ e.skip("uShort");
4069
+ var r = e.parseULong();
4070
+ r > 1 && console.warn("Only the first kern subtable is supported."), e.skip("uLong");
4071
+ var n = e.parseUShort(), a = n & 255;
4072
+ if (e.skip("uShort"), a === 0) {
4073
+ var o = e.parseUShort();
4074
+ e.skip("uShort", 3);
4075
+ for (var s = 0; s < o; s += 1) {
4076
+ var u = e.parseUShort(), i = e.parseUShort(), p = e.parseShort();
4077
+ t[u + "," + i] = p;
4078
+ }
4079
+ }
4080
+ return t;
4081
+ }
4082
+ function Di(e, t) {
4083
+ var r = new C.Parser(e, t), n = r.parseUShort();
4084
+ if (n === 0) return ki(r);
4085
+ if (n === 1) return Ui(r);
4086
+ throw new Error("Unsupported kern table version (" + n + ").");
4087
+ }
4088
+ var Ai = { parse: Di };
4089
+ function Oi(e, t, r, n) {
4090
+ for (var a = new C.Parser(e, t), o = n ? a.parseUShort : a.parseULong, s = [], u = 0; u < r + 1; u += 1) {
4091
+ var i = o.call(a);
4092
+ n && (i *= 2), s.push(i);
4093
+ }
4094
+ return s;
4095
+ }
4096
+ var Bi = { parse: Oi };
4097
+ function Ri(e, t) {
4098
+ var r = bt();
4099
+ r.readFile(e, function(n, a) {
4100
+ if (n) return t(n.message);
4101
+ t(null, $r(a));
4102
+ });
4103
+ }
4104
+ function Fi(e, t) {
4105
+ var r = new XMLHttpRequest();
4106
+ r.open("get", e, !0), r.responseType = "arraybuffer", r.onload = function() {
4107
+ return r.response ? t(null, r.response) : t("Font could not be loaded: " + r.statusText);
4108
+ }, r.onerror = function() {
4109
+ t("Font could not be loaded");
4110
+ }, r.send();
4111
+ }
4112
+ function yr(e, t) {
4113
+ for (var r = [], n = 12, a = 0; a < t; a += 1) {
4114
+ var o = C.getTag(e, n), s = C.getULong(e, n + 4), u = C.getULong(e, n + 8), i = C.getULong(e, n + 12);
4115
+ r.push({ tag: o, checksum: s, offset: u, length: i, compression: !1 }), n += 16;
4116
+ }
4117
+ return r;
4118
+ }
4119
+ function wi(e, t) {
4120
+ for (var r = [], n = 44, a = 0; a < t; a += 1) {
4121
+ var o = C.getTag(e, n), s = C.getULong(e, n + 4), u = C.getULong(e, n + 8), i = C.getULong(e, n + 12), p = void 0;
4122
+ u < i ? p = "WOFF" : p = !1, r.push({ tag: o, offset: s, compression: p, compressedLength: u, length: i }), n += 20;
4123
+ }
4124
+ return r;
4125
+ }
4126
+ function I(e, t) {
4127
+ if (t.compression === "WOFF") {
4128
+ var r = new Uint8Array(e.buffer, t.offset + 2, t.compressedLength - 2), n = new Uint8Array(t.length);
4129
+ if (Cn(r, n), n.byteLength !== t.length) throw new Error("Decompression error: " + t.tag + " decompressed length doesn't match recorded length");
4130
+ var a = new DataView(n.buffer, 0);
4131
+ return { data: a, offset: 0 };
4132
+ } else return { data: e, offset: t.offset };
4133
+ }
4134
+ function Ft(e, t) {
4135
+ t = t ?? {};
4136
+ var r, n, a = new R({ empty: !0 }), o = new DataView(e, 0), s, u = [], i = C.getTag(o, 0);
4137
+ if (i === "\0\0\0" || i === "true" || i === "typ1") a.outlinesFormat = "truetype", s = C.getUShort(o, 4), u = yr(o, s);
4138
+ else if (i === "OTTO") a.outlinesFormat = "cff", s = C.getUShort(o, 4), u = yr(o, s);
4139
+ else if (i === "wOFF") {
4140
+ var p = C.getTag(o, 4);
4141
+ if (p === "\0\0\0") a.outlinesFormat = "truetype";
4142
+ else if (p === "OTTO") a.outlinesFormat = "cff";
4143
+ else throw new Error("Unsupported OpenType flavor " + i);
4144
+ s = C.getUShort(o, 12), u = wi(o, s);
4145
+ } else throw new Error("Unsupported OpenType signature " + i);
4146
+ for (var l, h, c, f, v, x, m, y, U, S, B, A, F = 0; F < s; F += 1) {
4147
+ var O = u[F], T = void 0;
4148
+ switch (O.tag) {
4149
+ case "cmap":
4150
+ T = I(o, O), a.tables.cmap = Dr.parse(T.data, T.offset), a.encoding = new Or(a.tables.cmap);
4151
+ break;
4152
+ case "cvt ":
4153
+ T = I(o, O), A = new C.Parser(T.data, T.offset), a.tables.cvt = A.parseShortList(O.length / 2);
4154
+ break;
4155
+ case "fvar":
4156
+ h = O;
4157
+ break;
4158
+ case "fpgm":
4159
+ T = I(o, O), A = new C.Parser(T.data, T.offset), a.tables.fpgm = A.parseByteList(O.length);
4160
+ break;
4161
+ case "head":
4162
+ T = I(o, O), a.tables.head = Nr.parse(T.data, T.offset), a.unitsPerEm = a.tables.head.unitsPerEm, r = a.tables.head.indexToLocFormat;
4163
+ break;
4164
+ case "hhea":
4165
+ T = I(o, O), a.tables.hhea = Hr.parse(T.data, T.offset), a.ascender = a.tables.hhea.ascender, a.descender = a.tables.hhea.descender, a.numberOfHMetrics = a.tables.hhea.numberOfHMetrics;
4166
+ break;
4167
+ case "hmtx":
4168
+ m = O;
4169
+ break;
4170
+ case "ltag":
4171
+ T = I(o, O), n = Wr.parse(T.data, T.offset);
4172
+ break;
4173
+ case "maxp":
4174
+ T = I(o, O), a.tables.maxp = qr.parse(T.data, T.offset), a.numGlyphs = a.tables.maxp.numGlyphs;
4175
+ break;
4176
+ case "name":
4177
+ S = O;
4178
+ break;
4179
+ case "OS/2":
4180
+ T = I(o, O), a.tables.os2 = yt.parse(T.data, T.offset);
4181
+ break;
4182
+ case "post":
4183
+ T = I(o, O), a.tables.post = Zr.parse(T.data, T.offset), a.glyphNames = new kt(a.tables.post);
4184
+ break;
4185
+ case "prep":
4186
+ T = I(o, O), A = new C.Parser(T.data, T.offset), a.tables.prep = A.parseByteList(O.length);
4187
+ break;
4188
+ case "glyf":
4189
+ c = O;
4190
+ break;
4191
+ case "loca":
4192
+ U = O;
4193
+ break;
4194
+ case "CFF ":
4195
+ l = O;
4196
+ break;
4197
+ case "kern":
4198
+ y = O;
4199
+ break;
4200
+ case "GDEF":
4201
+ f = O;
4202
+ break;
4203
+ case "GPOS":
4204
+ v = O;
4205
+ break;
4206
+ case "GSUB":
4207
+ x = O;
4208
+ break;
4209
+ case "meta":
4210
+ B = O;
4211
+ break;
4212
+ }
4213
+ }
4214
+ var P = I(o, S);
4215
+ if (a.tables.name = jr.parse(P.data, P.offset, n), a.names = a.tables.name, c && U) {
4216
+ var Y = r === 0, j = I(o, U), J = Bi.parse(j.data, j.offset, a.numGlyphs, Y), $ = I(o, c);
4217
+ a.glyphs = nn.parse($.data, $.offset, J, a, t);
4218
+ } else if (l) {
4219
+ var M = I(o, l);
4220
+ Pr.parse(M.data, M.offset, a, t);
4221
+ } else throw new Error("Font doesn't contain TrueType or CFF outlines.");
4222
+ var N = I(o, m);
4223
+ if (zr.parse(a, N.data, N.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, t), _n(a, t), y) {
4224
+ var W = I(o, y);
4225
+ a.kerningPairs = Ai.parse(W.data, W.offset);
4226
+ } else a.kerningPairs = {};
4227
+ if (f) {
4228
+ var q = I(o, f);
4229
+ a.tables.gdef = bi.parse(q.data, q.offset);
4230
+ }
4231
+ if (v) {
4232
+ var _ = I(o, v);
4233
+ a.tables.gpos = Ti.parse(_.data, _.offset), a.position.init();
4234
+ }
4235
+ if (x) {
4236
+ var H = I(o, x);
4237
+ a.tables.gsub = Qr.parse(H.data, H.offset);
4238
+ }
4239
+ if (h) {
4240
+ var V = I(o, h);
4241
+ a.tables.fvar = fi.parse(V.data, V.offset, a.names);
4242
+ }
4243
+ if (B) {
4244
+ var w = I(o, B);
4245
+ a.tables.meta = Kr.parse(w.data, w.offset), a.metas = a.tables.meta;
4246
+ }
4247
+ return a;
4248
+ }
4249
+ function Li(e, t, r) {
4250
+ r = r ?? {};
4251
+ var n = typeof window > "u", a = n && !r.isUrl ? Ri : Fi;
4252
+ return new Promise(function(o, s) {
4253
+ a(e, function(u, i) {
4254
+ if (u) {
4255
+ if (t) return t(u);
4256
+ s(u);
4257
+ }
4258
+ var p;
4259
+ try {
4260
+ p = Ft(i, r);
4261
+ } catch (l) {
4262
+ if (t) return t(l, null);
4263
+ s(l);
4264
+ }
4265
+ if (t) return t(null, p);
4266
+ o(p);
4267
+ });
4268
+ });
4269
+ }
4270
+ function Ii(e, t) {
4271
+ var r = bt(), n = r.readFileSync(e);
4272
+ return Ft($r(n), t);
4273
+ }
4274
+ var Mi = Object.freeze({ __proto__: null, Font: R, Glyph: Z, Path: G, BoundingBox: ce, _parse: C, parse: Ft, load: Li, loadSync: Ii }), Gi = Mi;
4275
+ export {
4276
+ ae as Bidi,
4277
+ ce as BoundingBox,
4278
+ R as Font,
4279
+ Z as Glyph,
4280
+ G as Path,
4281
+ C as _parse,
4282
+ Gi as default,
4283
+ Li as load,
4284
+ Ii as loadSync,
4285
+ Ft as parse
4286
+ };