@alphafi/alphafi-sdk 0.0.39 → 0.0.40

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 (291) hide show
  1. package/dist/cjs/adminFunctions.d.ts.map +1 -1
  2. package/dist/cjs/adminFunctions.js +9 -1
  3. package/dist/cjs/adminFunctions.js.map +1 -1
  4. package/dist/cjs/common/coins.d.ts.map +1 -1
  5. package/dist/cjs/common/coins.js +12 -0
  6. package/dist/cjs/common/coins.js.map +1 -1
  7. package/dist/cjs/common/constants.d.ts +135 -0
  8. package/dist/cjs/common/constants.d.ts.map +1 -1
  9. package/dist/cjs/common/constants.js +98 -7
  10. package/dist/cjs/common/constants.js.map +1 -1
  11. package/dist/cjs/common/maps.d.ts.map +1 -1
  12. package/dist/cjs/common/maps.js +103 -16
  13. package/dist/cjs/common/maps.js.map +1 -1
  14. package/dist/cjs/common/types.d.ts +58 -5
  15. package/dist/cjs/common/types.d.ts.map +1 -1
  16. package/dist/cjs/common/types.js.map +1 -1
  17. package/dist/cjs/index.d.ts +2 -1
  18. package/dist/cjs/index.d.ts.map +1 -1
  19. package/dist/cjs/index.js +9 -2
  20. package/dist/cjs/index.js.map +1 -1
  21. package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +1 -1
  22. package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js +2 -3
  23. package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js.map +1 -1
  24. package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
  25. package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js +5 -11
  26. package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
  27. package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +2 -2
  28. package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +1 -1
  29. package/dist/cjs/sui-sdk/functions/getReceipts.js +1 -1
  30. package/dist/cjs/sui-sdk/functions/getReceipts.js.map +1 -1
  31. package/dist/cjs/transactions/bluefin.d.ts +6 -0
  32. package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
  33. package/dist/cjs/transactions/bluefin.js +411 -34
  34. package/dist/cjs/transactions/bluefin.js.map +1 -1
  35. package/dist/cjs/transactions/cetus.d.ts +1 -1
  36. package/dist/cjs/transactions/cetus.d.ts.map +1 -1
  37. package/dist/cjs/transactions/cetus.js +3 -3
  38. package/dist/cjs/transactions/cetus.js.map +1 -1
  39. package/dist/cjs/transactions/deposit.d.ts.map +1 -1
  40. package/dist/cjs/transactions/deposit.js +9 -1
  41. package/dist/cjs/transactions/deposit.js.map +1 -1
  42. package/dist/cjs/transactions/withdraw.d.ts.map +1 -1
  43. package/dist/cjs/transactions/withdraw.js +9 -1
  44. package/dist/cjs/transactions/withdraw.js.map +1 -1
  45. package/dist/esm/adminFunctions.d.ts.map +1 -1
  46. package/dist/esm/adminFunctions.js +10 -2
  47. package/dist/esm/adminFunctions.js.map +1 -1
  48. package/dist/esm/common/coins.d.ts.map +1 -1
  49. package/dist/esm/common/coins.js +12 -0
  50. package/dist/esm/common/coins.js.map +1 -1
  51. package/dist/esm/common/constants.d.ts +135 -0
  52. package/dist/esm/common/constants.d.ts.map +1 -1
  53. package/dist/esm/common/constants.js +98 -7
  54. package/dist/esm/common/constants.js.map +1 -1
  55. package/dist/esm/common/maps.d.ts.map +1 -1
  56. package/dist/esm/common/maps.js +103 -16
  57. package/dist/esm/common/maps.js.map +1 -1
  58. package/dist/esm/common/types.d.ts +58 -5
  59. package/dist/esm/common/types.d.ts.map +1 -1
  60. package/dist/esm/common/types.js.map +1 -1
  61. package/dist/esm/index.d.ts +2 -1
  62. package/dist/esm/index.d.ts.map +1 -1
  63. package/dist/esm/index.js +2 -1
  64. package/dist/esm/index.js.map +1 -1
  65. package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +1 -1
  66. package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js +2 -3
  67. package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js.map +1 -1
  68. package/dist/esm/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
  69. package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js +5 -11
  70. package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
  71. package/dist/esm/sui-sdk/functions/getReceipts.d.ts +2 -2
  72. package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +1 -1
  73. package/dist/esm/sui-sdk/functions/getReceipts.js +1 -1
  74. package/dist/esm/sui-sdk/functions/getReceipts.js.map +1 -1
  75. package/dist/esm/transactions/bluefin.d.ts +6 -0
  76. package/dist/esm/transactions/bluefin.d.ts.map +1 -1
  77. package/dist/esm/transactions/bluefin.js +408 -33
  78. package/dist/esm/transactions/bluefin.js.map +1 -1
  79. package/dist/esm/transactions/cetus.d.ts +1 -1
  80. package/dist/esm/transactions/cetus.d.ts.map +1 -1
  81. package/dist/esm/transactions/cetus.js +3 -3
  82. package/dist/esm/transactions/cetus.js.map +1 -1
  83. package/dist/esm/transactions/deposit.d.ts.map +1 -1
  84. package/dist/esm/transactions/deposit.js +10 -2
  85. package/dist/esm/transactions/deposit.js.map +1 -1
  86. package/dist/esm/transactions/withdraw.d.ts.map +1 -1
  87. package/dist/esm/transactions/withdraw.js +10 -2
  88. package/dist/esm/transactions/withdraw.js.map +1 -1
  89. package/docs/assets/highlight.css +101 -0
  90. package/docs/assets/icons.js +21 -0
  91. package/docs/assets/icons.svg +1 -0
  92. package/docs/assets/main.js +2218 -0
  93. package/docs/assets/navigation.js +2 -0
  94. package/docs/assets/search.js +2 -0
  95. package/docs/assets/style.css +1489 -0
  96. package/docs/functions/alphaLpBreakdown.html +253 -0
  97. package/docs/functions/bucketDepositTx.html +267 -0
  98. package/docs/functions/bucketWithdrawTx.html +267 -0
  99. package/docs/functions/cetusLpBreakdown.html +253 -0
  100. package/docs/functions/claimRewardTxb.html +243 -0
  101. package/docs/functions/coinAmountToXTokensDoubleAsset.html +267 -0
  102. package/docs/functions/coinAmountToXTokensSingleAsset.html +260 -0
  103. package/docs/functions/coinsInPool.html +438 -0
  104. package/docs/functions/collectRewards.html +242 -0
  105. package/docs/functions/deposit.html +246 -0
  106. package/docs/functions/depositAlphaTxb.html +250 -0
  107. package/docs/functions/depositBluefinSuiFirstTxb.html +302 -0
  108. package/docs/functions/depositBluefinType1Txb.html +300 -0
  109. package/docs/functions/depositBluefinType2Txb.html +300 -0
  110. package/docs/functions/depositCetusAlphaSuiTxb.html +300 -0
  111. package/docs/functions/depositCetusSuiTxb.html +298 -0
  112. package/docs/functions/depositCetusTxb.html +298 -0
  113. package/docs/functions/depositDoubleAssetTxb.html +270 -0
  114. package/docs/functions/depositSingleAssetTxb.html +263 -0
  115. package/docs/functions/fetchAfterTransactionEvents.html +306 -0
  116. package/docs/functions/fetchAutoCompoundingEvents.html +257 -0
  117. package/docs/functions/fetchAutoCompoundingEventsGql.html +251 -0
  118. package/docs/functions/fetchCetusPools.html +231 -0
  119. package/docs/functions/fetchChainIdentifier.html +233 -0
  120. package/docs/functions/fetchCheckRatioEvents.html +249 -0
  121. package/docs/functions/fetchLiquidityChangeEvents.html +257 -0
  122. package/docs/functions/fetchMultiReceipts.html +261 -0
  123. package/docs/functions/fetchNftHolders.html +233 -0
  124. package/docs/functions/fetchPools.html +230 -0
  125. package/docs/functions/fetchPortfolioData.html +243 -0
  126. package/docs/functions/fetchProtocolData.html +231 -0
  127. package/docs/functions/fetchTVL.html +253 -0
  128. package/docs/functions/fetchUserVaultBalances.html +245 -0
  129. package/docs/functions/fetchUserVaults.html +243 -0
  130. package/docs/functions/fetchUserWalletData.html +243 -0
  131. package/docs/functions/fetchWithdrawV2Events.html +255 -0
  132. package/docs/functions/getAirdropShare.html +243 -0
  133. package/docs/functions/getAllDoubleAssetVaults.html +235 -0
  134. package/docs/functions/getAllSingleAssetVaults.html +235 -0
  135. package/docs/functions/getAllVaultBalances.html +265 -0
  136. package/docs/functions/getAllVaults.html +233 -0
  137. package/docs/functions/getAlphaUnlocks.html +245 -0
  138. package/docs/functions/getAlphaVaultBalance.html +255 -0
  139. package/docs/functions/getAmounts.html +272 -0
  140. package/docs/functions/getApr.html +243 -0
  141. package/docs/functions/getAprs.html +255 -0
  142. package/docs/functions/getApy.html +243 -0
  143. package/docs/functions/getApys.html +255 -0
  144. package/docs/functions/getCetusInvestorTicksMap.html +284 -0
  145. package/docs/functions/getCetusSqrtPriceMap.html +249 -0
  146. package/docs/functions/getCoinAmountsFromLiquidity.html +266 -0
  147. package/docs/functions/getConf.html +9882 -0
  148. package/docs/functions/getCurrentTick.html +247 -0
  149. package/docs/functions/getDoubleAssetVaultBalance.html +268 -0
  150. package/docs/functions/getDoubleAssetVaults.html +253 -0
  151. package/docs/functions/getHoldersFromTransactions.html +299 -0
  152. package/docs/functions/getInvestor.html +259 -0
  153. package/docs/functions/getInvestorPoolMap.html +241 -0
  154. package/docs/functions/getLastAutoCompoundTime.html +249 -0
  155. package/docs/functions/getLiquidity.html +260 -0
  156. package/docs/functions/getParentPool.html +256 -0
  157. package/docs/functions/getPool.html +262 -0
  158. package/docs/functions/getPoolExchangeRateMap.html +249 -0
  159. package/docs/functions/getPositionTicks.html +249 -0
  160. package/docs/functions/getPriceToTick.html +254 -0
  161. package/docs/functions/getRebalanceHistories.html +269 -0
  162. package/docs/functions/getRebalanceHistory.html +255 -0
  163. package/docs/functions/getReceipts.html +268 -0
  164. package/docs/functions/getSingleAssetVaultBalance.html +268 -0
  165. package/docs/functions/getSingleAssetVaults.html +253 -0
  166. package/docs/functions/getSuiClient.html +247 -0
  167. package/docs/functions/getSuiNodeUrl.html +232 -0
  168. package/docs/functions/getTVLs.html +243 -0
  169. package/docs/functions/getTickToPrice.html +254 -0
  170. package/docs/functions/getUserTokensFromTransactions.html +269 -0
  171. package/docs/functions/getUserTokensInUsdFromTransactions.html +263 -0
  172. package/docs/functions/getVaultBalance.html +277 -0
  173. package/docs/functions/getVaultBalanceForActiveUsers.html +261 -0
  174. package/docs/functions/getVaults.html +250 -0
  175. package/docs/functions/getXTokenVaultBalanceForActiveUsers.html +261 -0
  176. package/docs/functions/lastAutocompoundTime.html +249 -0
  177. package/docs/functions/liquidityToTokens.html +253 -0
  178. package/docs/functions/loopingDeposit.html +277 -0
  179. package/docs/functions/loopingWithdraw.html +278 -0
  180. package/docs/functions/multiLiquidityToTokens.html +271 -0
  181. package/docs/functions/multiTokensToUsd.html +262 -0
  182. package/docs/functions/multiXTokensToLiquidity.html +257 -0
  183. package/docs/functions/naviDepositTx.html +278 -0
  184. package/docs/functions/naviHasuiSuiLoopDepositTx.html +271 -0
  185. package/docs/functions/naviHasuiSuiLoopWithdrawTx.html +271 -0
  186. package/docs/functions/naviSuiVsuiLoopDepositTx.html +271 -0
  187. package/docs/functions/naviSuiVsuiLoopWithdrawTx.html +271 -0
  188. package/docs/functions/naviUsdcUsdtLoopDepositTx.html +271 -0
  189. package/docs/functions/naviUsdcUsdtLoopWithdrawTx.html +271 -0
  190. package/docs/functions/naviUsdtUsdcLoopDepositTx.html +271 -0
  191. package/docs/functions/naviUsdtUsdcLoopWithdrawTx.html +271 -0
  192. package/docs/functions/naviWithdrawTx.html +278 -0
  193. package/docs/functions/parseUserWalletData.html +243 -0
  194. package/docs/functions/setSuiClient.html +255 -0
  195. package/docs/functions/setSuiNodeUrl.html +249 -0
  196. package/docs/functions/withdraw.html +249 -0
  197. package/docs/functions/withdrawAlphaTxb.html +257 -0
  198. package/docs/functions/withdrawBluefinSuiFirstTxb.html +282 -0
  199. package/docs/functions/withdrawBluefinType1Txb.html +280 -0
  200. package/docs/functions/withdrawBluefinType2Txb.html +280 -0
  201. package/docs/functions/withdrawCetusAlphaSuiTxb.html +282 -0
  202. package/docs/functions/withdrawCetusSuiTxb.html +278 -0
  203. package/docs/functions/withdrawCetusTxb.html +278 -0
  204. package/docs/functions/withdrawTxb.html +260 -0
  205. package/docs/index.html +622 -0
  206. package/docs/interfaces/Coin.html +474 -0
  207. package/docs/interfaces/CoinPair.html +358 -0
  208. package/docs/interfaces/NaviVoloData.html +514 -0
  209. package/docs/interfaces/RebalanceHistoryType.html +652 -0
  210. package/docs/modules.html +1440 -0
  211. package/docs/types/AfterTransactionEventNode.html +305 -0
  212. package/docs/types/Allocator.html +321 -0
  213. package/docs/types/AlphaFiDoubleAssetVault.html +258 -0
  214. package/docs/types/AlphaFiMultiVaultBalance.html +219 -0
  215. package/docs/types/AlphaFiSingleAssetVault.html +244 -0
  216. package/docs/types/AlphaFiVault.html +214 -0
  217. package/docs/types/AlphaFiVaultBalance.html +220 -0
  218. package/docs/types/AlphaPoolType.html +383 -0
  219. package/docs/types/AlphaReceipt.html +220 -0
  220. package/docs/types/AlphaReceiptFields.html +421 -0
  221. package/docs/types/AlphaVaultBalance.html +245 -0
  222. package/docs/types/AutoCompoundingEventNode.html +225 -0
  223. package/docs/types/BluefinInvestor.html +209 -0
  224. package/docs/types/BluefinPoolType.html +209 -0
  225. package/docs/types/BucketInvestor.html +249 -0
  226. package/docs/types/CetusInvestor.html +240 -0
  227. package/docs/types/CetusPoolType.html +433 -0
  228. package/docs/types/CetusSwapOptions.html +209 -0
  229. package/docs/types/CoinAmounts.html +216 -0
  230. package/docs/types/CoinName.html +281 -0
  231. package/docs/types/CoinType.html +282 -0
  232. package/docs/types/CommonInvestorFields.html +276 -0
  233. package/docs/types/CreatePoolOptions.html +246 -0
  234. package/docs/types/Distributor.html +341 -0
  235. package/docs/types/DoubleAssetMultiVaultBalance.html +236 -0
  236. package/docs/types/DoubleAssetPoolNames.html +267 -0
  237. package/docs/types/DoubleAssetTokenHoldings.html +232 -0
  238. package/docs/types/DoubleAssetVaultBalance.html +229 -0
  239. package/docs/types/GetHoldersParams.html +221 -0
  240. package/docs/types/GetTokenHoldingsParams.html +227 -0
  241. package/docs/types/GetUserTokensFromTransactionsParams.html +233 -0
  242. package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +244 -0
  243. package/docs/types/GetVaultBalanceForActiveUsersParams.html +231 -0
  244. package/docs/types/GetVaultBalanceParams.html +217 -0
  245. package/docs/types/HoldingsObj.html +223 -0
  246. package/docs/types/Icon.html +266 -0
  247. package/docs/types/Investor.html +245 -0
  248. package/docs/types/LiquidityChangeEventNode.html +220 -0
  249. package/docs/types/LiquidityToTokensParams.html +255 -0
  250. package/docs/types/LiquidityToUsdParams.html +267 -0
  251. package/docs/types/LoopingDebt.html +258 -0
  252. package/docs/types/LpBreakdownType.html +238 -0
  253. package/docs/types/MemberPoolDataType.html +276 -0
  254. package/docs/types/MemberType.html +269 -0
  255. package/docs/types/MultiGetVaultBalancesParams.html +229 -0
  256. package/docs/types/NaviInvestor.html +235 -0
  257. package/docs/types/OtherReceiptFields.html +373 -0
  258. package/docs/types/PoolName.html +304 -0
  259. package/docs/types/PoolReceipt.html +253 -0
  260. package/docs/types/PoolType.html +388 -0
  261. package/docs/types/Receipt.html +475 -0
  262. package/docs/types/ReceiptGQL.html +374 -0
  263. package/docs/types/SingleAssetMultiVaultBalance.html +232 -0
  264. package/docs/types/SingleAssetPoolNames.html +247 -0
  265. package/docs/types/SingleAssetTokenHoldings.html +228 -0
  266. package/docs/types/SingleAssetVaultBalance.html +223 -0
  267. package/docs/types/SingleGetVaultBalancesParams.html +224 -0
  268. package/docs/types/StrategyType.html +217 -0
  269. package/docs/types/SuiNetwork.html +213 -0
  270. package/docs/types/SwapOptions.html +248 -0
  271. package/docs/types/TickSpacing.html +212 -0
  272. package/docs/types/TotalWeightType.html +246 -0
  273. package/docs/types/TransactionBlockType.html +358 -0
  274. package/docs/types/UserPoolLiquidity.html +221 -0
  275. package/docs/types/UserPoolTokenHoldings.html +217 -0
  276. package/docs/types/UserUsdHoldings.html +223 -0
  277. package/docs/types/VaultBalance.html +216 -0
  278. package/docs/types/WithdrawV2EventNode.html +208 -0
  279. package/docs/variables/bluefinPoolMap.html +214 -0
  280. package/docs/variables/cetusPoolMap.html +214 -0
  281. package/docs/variables/coinsList.html +220 -0
  282. package/docs/variables/defunctPoolsSet.html +209 -0
  283. package/docs/variables/doubleAssetPoolCoinMap.html +237 -0
  284. package/docs/variables/loopingAccountAddresses.html +219 -0
  285. package/docs/variables/loopingPoolCoinMap.html +233 -0
  286. package/docs/variables/naviAssetMap.html +215 -0
  287. package/docs/variables/poolIdPoolNameMap.html +218 -0
  288. package/docs/variables/poolInfo.html +304 -0
  289. package/docs/variables/singleAssetPoolCoinMap.html +229 -0
  290. package/docs/variables/stableCoins.html +207 -0
  291. package/package.json +1 -1
@@ -0,0 +1,2218 @@
1
+ "use strict";
2
+ window.translations = {
3
+ copy: "Copy",
4
+ copied: "Copied!",
5
+ normally_hidden:
6
+ "This member is normally hidden due to your filter settings.",
7
+ };
8
+ ("use strict");
9
+ (() => {
10
+ var Pe = Object.create;
11
+ var ie = Object.defineProperty;
12
+ var Oe = Object.getOwnPropertyDescriptor;
13
+ var _e = Object.getOwnPropertyNames;
14
+ var Re = Object.getPrototypeOf,
15
+ Me = Object.prototype.hasOwnProperty;
16
+ var Fe = (t, e) => () => (
17
+ e || t((e = { exports: {} }).exports, e), e.exports
18
+ );
19
+ var De = (t, e, n, r) => {
20
+ if ((e && typeof e == "object") || typeof e == "function")
21
+ for (let i of _e(e))
22
+ !Me.call(t, i) &&
23
+ i !== n &&
24
+ ie(t, i, {
25
+ get: () => e[i],
26
+ enumerable: !(r = Oe(e, i)) || r.enumerable,
27
+ });
28
+ return t;
29
+ };
30
+ var Ae = (t, e, n) => (
31
+ (n = t != null ? Pe(Re(t)) : {}),
32
+ De(
33
+ e || !t || !t.__esModule
34
+ ? ie(n, "default", { value: t, enumerable: !0 })
35
+ : n,
36
+ t,
37
+ )
38
+ );
39
+ var ue = Fe((ae, le) => {
40
+ (function () {
41
+ var t = function (e) {
42
+ var n = new t.Builder();
43
+ return (
44
+ n.pipeline.add(t.trimmer, t.stopWordFilter, t.stemmer),
45
+ n.searchPipeline.add(t.stemmer),
46
+ e.call(n, n),
47
+ n.build()
48
+ );
49
+ };
50
+ t.version = "2.3.9";
51
+ (t.utils = {}),
52
+ (t.utils.warn = (function (e) {
53
+ return function (n) {
54
+ e.console && console.warn && console.warn(n);
55
+ };
56
+ })(this)),
57
+ (t.utils.asString = function (e) {
58
+ return e == null ? "" : e.toString();
59
+ }),
60
+ (t.utils.clone = function (e) {
61
+ if (e == null) return e;
62
+ for (
63
+ var n = Object.create(null), r = Object.keys(e), i = 0;
64
+ i < r.length;
65
+ i++
66
+ ) {
67
+ var s = r[i],
68
+ o = e[s];
69
+ if (Array.isArray(o)) {
70
+ n[s] = o.slice();
71
+ continue;
72
+ }
73
+ if (
74
+ typeof o == "string" ||
75
+ typeof o == "number" ||
76
+ typeof o == "boolean"
77
+ ) {
78
+ n[s] = o;
79
+ continue;
80
+ }
81
+ throw new TypeError(
82
+ "clone is not deep and does not support nested objects",
83
+ );
84
+ }
85
+ return n;
86
+ }),
87
+ (t.FieldRef = function (e, n, r) {
88
+ (this.docRef = e), (this.fieldName = n), (this._stringValue = r);
89
+ }),
90
+ (t.FieldRef.joiner = "/"),
91
+ (t.FieldRef.fromString = function (e) {
92
+ var n = e.indexOf(t.FieldRef.joiner);
93
+ if (n === -1) throw "malformed field ref string";
94
+ var r = e.slice(0, n),
95
+ i = e.slice(n + 1);
96
+ return new t.FieldRef(i, r, e);
97
+ }),
98
+ (t.FieldRef.prototype.toString = function () {
99
+ return (
100
+ this._stringValue == null &&
101
+ (this._stringValue =
102
+ this.fieldName + t.FieldRef.joiner + this.docRef),
103
+ this._stringValue
104
+ );
105
+ });
106
+ (t.Set = function (e) {
107
+ if (((this.elements = Object.create(null)), e)) {
108
+ this.length = e.length;
109
+ for (var n = 0; n < this.length; n++) this.elements[e[n]] = !0;
110
+ } else this.length = 0;
111
+ }),
112
+ (t.Set.complete = {
113
+ intersect: function (e) {
114
+ return e;
115
+ },
116
+ union: function () {
117
+ return this;
118
+ },
119
+ contains: function () {
120
+ return !0;
121
+ },
122
+ }),
123
+ (t.Set.empty = {
124
+ intersect: function () {
125
+ return this;
126
+ },
127
+ union: function (e) {
128
+ return e;
129
+ },
130
+ contains: function () {
131
+ return !1;
132
+ },
133
+ }),
134
+ (t.Set.prototype.contains = function (e) {
135
+ return !!this.elements[e];
136
+ }),
137
+ (t.Set.prototype.intersect = function (e) {
138
+ var n,
139
+ r,
140
+ i,
141
+ s = [];
142
+ if (e === t.Set.complete) return this;
143
+ if (e === t.Set.empty) return e;
144
+ this.length < e.length
145
+ ? ((n = this), (r = e))
146
+ : ((n = e), (r = this)),
147
+ (i = Object.keys(n.elements));
148
+ for (var o = 0; o < i.length; o++) {
149
+ var a = i[o];
150
+ a in r.elements && s.push(a);
151
+ }
152
+ return new t.Set(s);
153
+ }),
154
+ (t.Set.prototype.union = function (e) {
155
+ return e === t.Set.complete
156
+ ? t.Set.complete
157
+ : e === t.Set.empty
158
+ ? this
159
+ : new t.Set(
160
+ Object.keys(this.elements).concat(Object.keys(e.elements)),
161
+ );
162
+ }),
163
+ (t.idf = function (e, n) {
164
+ var r = 0;
165
+ for (var i in e) i != "_index" && (r += Object.keys(e[i]).length);
166
+ var s = (n - r + 0.5) / (r + 0.5);
167
+ return Math.log(1 + Math.abs(s));
168
+ }),
169
+ (t.Token = function (e, n) {
170
+ (this.str = e || ""), (this.metadata = n || {});
171
+ }),
172
+ (t.Token.prototype.toString = function () {
173
+ return this.str;
174
+ }),
175
+ (t.Token.prototype.update = function (e) {
176
+ return (this.str = e(this.str, this.metadata)), this;
177
+ }),
178
+ (t.Token.prototype.clone = function (e) {
179
+ return (
180
+ (e =
181
+ e ||
182
+ function (n) {
183
+ return n;
184
+ }),
185
+ new t.Token(e(this.str, this.metadata), this.metadata)
186
+ );
187
+ });
188
+ (t.tokenizer = function (e, n) {
189
+ if (e == null || e == null) return [];
190
+ if (Array.isArray(e))
191
+ return e.map(function (m) {
192
+ return new t.Token(
193
+ t.utils.asString(m).toLowerCase(),
194
+ t.utils.clone(n),
195
+ );
196
+ });
197
+ for (
198
+ var r = e.toString().toLowerCase(),
199
+ i = r.length,
200
+ s = [],
201
+ o = 0,
202
+ a = 0;
203
+ o <= i;
204
+ o++
205
+ ) {
206
+ var l = r.charAt(o),
207
+ u = o - a;
208
+ if (l.match(t.tokenizer.separator) || o == i) {
209
+ if (u > 0) {
210
+ var d = t.utils.clone(n) || {};
211
+ (d.position = [a, u]),
212
+ (d.index = s.length),
213
+ s.push(new t.Token(r.slice(a, o), d));
214
+ }
215
+ a = o + 1;
216
+ }
217
+ }
218
+ return s;
219
+ }),
220
+ (t.tokenizer.separator = /[\s\-]+/);
221
+ (t.Pipeline = function () {
222
+ this._stack = [];
223
+ }),
224
+ (t.Pipeline.registeredFunctions = Object.create(null)),
225
+ (t.Pipeline.registerFunction = function (e, n) {
226
+ n in this.registeredFunctions &&
227
+ t.utils.warn("Overwriting existing registered function: " + n),
228
+ (e.label = n),
229
+ (t.Pipeline.registeredFunctions[e.label] = e);
230
+ }),
231
+ (t.Pipeline.warnIfFunctionNotRegistered = function (e) {
232
+ var n = e.label && e.label in this.registeredFunctions;
233
+ n ||
234
+ t.utils.warn(
235
+ `Function is not registered with pipeline. This may cause problems when serialising the index.
236
+ `,
237
+ e,
238
+ );
239
+ }),
240
+ (t.Pipeline.load = function (e) {
241
+ var n = new t.Pipeline();
242
+ return (
243
+ e.forEach(function (r) {
244
+ var i = t.Pipeline.registeredFunctions[r];
245
+ if (i) n.add(i);
246
+ else throw new Error("Cannot load unregistered function: " + r);
247
+ }),
248
+ n
249
+ );
250
+ }),
251
+ (t.Pipeline.prototype.add = function () {
252
+ var e = Array.prototype.slice.call(arguments);
253
+ e.forEach(function (n) {
254
+ t.Pipeline.warnIfFunctionNotRegistered(n), this._stack.push(n);
255
+ }, this);
256
+ }),
257
+ (t.Pipeline.prototype.after = function (e, n) {
258
+ t.Pipeline.warnIfFunctionNotRegistered(n);
259
+ var r = this._stack.indexOf(e);
260
+ if (r == -1) throw new Error("Cannot find existingFn");
261
+ (r = r + 1), this._stack.splice(r, 0, n);
262
+ }),
263
+ (t.Pipeline.prototype.before = function (e, n) {
264
+ t.Pipeline.warnIfFunctionNotRegistered(n);
265
+ var r = this._stack.indexOf(e);
266
+ if (r == -1) throw new Error("Cannot find existingFn");
267
+ this._stack.splice(r, 0, n);
268
+ }),
269
+ (t.Pipeline.prototype.remove = function (e) {
270
+ var n = this._stack.indexOf(e);
271
+ n != -1 && this._stack.splice(n, 1);
272
+ }),
273
+ (t.Pipeline.prototype.run = function (e) {
274
+ for (var n = this._stack.length, r = 0; r < n; r++) {
275
+ for (var i = this._stack[r], s = [], o = 0; o < e.length; o++) {
276
+ var a = i(e[o], o, e);
277
+ if (!(a == null || a === ""))
278
+ if (Array.isArray(a))
279
+ for (var l = 0; l < a.length; l++) s.push(a[l]);
280
+ else s.push(a);
281
+ }
282
+ e = s;
283
+ }
284
+ return e;
285
+ }),
286
+ (t.Pipeline.prototype.runString = function (e, n) {
287
+ var r = new t.Token(e, n);
288
+ return this.run([r]).map(function (i) {
289
+ return i.toString();
290
+ });
291
+ }),
292
+ (t.Pipeline.prototype.reset = function () {
293
+ this._stack = [];
294
+ }),
295
+ (t.Pipeline.prototype.toJSON = function () {
296
+ return this._stack.map(function (e) {
297
+ return t.Pipeline.warnIfFunctionNotRegistered(e), e.label;
298
+ });
299
+ });
300
+ (t.Vector = function (e) {
301
+ (this._magnitude = 0), (this.elements = e || []);
302
+ }),
303
+ (t.Vector.prototype.positionForIndex = function (e) {
304
+ if (this.elements.length == 0) return 0;
305
+ for (
306
+ var n = 0,
307
+ r = this.elements.length / 2,
308
+ i = r - n,
309
+ s = Math.floor(i / 2),
310
+ o = this.elements[s * 2];
311
+ i > 1 && (o < e && (n = s), o > e && (r = s), o != e);
312
+
313
+ )
314
+ (i = r - n),
315
+ (s = n + Math.floor(i / 2)),
316
+ (o = this.elements[s * 2]);
317
+ if (o == e || o > e) return s * 2;
318
+ if (o < e) return (s + 1) * 2;
319
+ }),
320
+ (t.Vector.prototype.insert = function (e, n) {
321
+ this.upsert(e, n, function () {
322
+ throw "duplicate index";
323
+ });
324
+ }),
325
+ (t.Vector.prototype.upsert = function (e, n, r) {
326
+ this._magnitude = 0;
327
+ var i = this.positionForIndex(e);
328
+ this.elements[i] == e
329
+ ? (this.elements[i + 1] = r(this.elements[i + 1], n))
330
+ : this.elements.splice(i, 0, e, n);
331
+ }),
332
+ (t.Vector.prototype.magnitude = function () {
333
+ if (this._magnitude) return this._magnitude;
334
+ for (var e = 0, n = this.elements.length, r = 1; r < n; r += 2) {
335
+ var i = this.elements[r];
336
+ e += i * i;
337
+ }
338
+ return (this._magnitude = Math.sqrt(e));
339
+ }),
340
+ (t.Vector.prototype.dot = function (e) {
341
+ for (
342
+ var n = 0,
343
+ r = this.elements,
344
+ i = e.elements,
345
+ s = r.length,
346
+ o = i.length,
347
+ a = 0,
348
+ l = 0,
349
+ u = 0,
350
+ d = 0;
351
+ u < s && d < o;
352
+
353
+ )
354
+ (a = r[u]),
355
+ (l = i[d]),
356
+ a < l
357
+ ? (u += 2)
358
+ : a > l
359
+ ? (d += 2)
360
+ : a == l && ((n += r[u + 1] * i[d + 1]), (u += 2), (d += 2));
361
+ return n;
362
+ }),
363
+ (t.Vector.prototype.similarity = function (e) {
364
+ return this.dot(e) / this.magnitude() || 0;
365
+ }),
366
+ (t.Vector.prototype.toArray = function () {
367
+ for (
368
+ var e = new Array(this.elements.length / 2), n = 1, r = 0;
369
+ n < this.elements.length;
370
+ n += 2, r++
371
+ )
372
+ e[r] = this.elements[n];
373
+ return e;
374
+ }),
375
+ (t.Vector.prototype.toJSON = function () {
376
+ return this.elements;
377
+ });
378
+ (t.stemmer = (function () {
379
+ var e = {
380
+ ational: "ate",
381
+ tional: "tion",
382
+ enci: "ence",
383
+ anci: "ance",
384
+ izer: "ize",
385
+ bli: "ble",
386
+ alli: "al",
387
+ entli: "ent",
388
+ eli: "e",
389
+ ousli: "ous",
390
+ ization: "ize",
391
+ ation: "ate",
392
+ ator: "ate",
393
+ alism: "al",
394
+ iveness: "ive",
395
+ fulness: "ful",
396
+ ousness: "ous",
397
+ aliti: "al",
398
+ iviti: "ive",
399
+ biliti: "ble",
400
+ logi: "log",
401
+ },
402
+ n = {
403
+ icate: "ic",
404
+ ative: "",
405
+ alize: "al",
406
+ iciti: "ic",
407
+ ical: "ic",
408
+ ful: "",
409
+ ness: "",
410
+ },
411
+ r = "[^aeiou]",
412
+ i = "[aeiouy]",
413
+ s = r + "[^aeiouy]*",
414
+ o = i + "[aeiou]*",
415
+ a = "^(" + s + ")?" + o + s,
416
+ l = "^(" + s + ")?" + o + s + "(" + o + ")?$",
417
+ u = "^(" + s + ")?" + o + s + o + s,
418
+ d = "^(" + s + ")?" + i,
419
+ m = new RegExp(a),
420
+ p = new RegExp(u),
421
+ b = new RegExp(l),
422
+ g = new RegExp(d),
423
+ L = /^(.+?)(ss|i)es$/,
424
+ f = /^(.+?)([^s])s$/,
425
+ y = /^(.+?)eed$/,
426
+ S = /^(.+?)(ed|ing)$/,
427
+ w = /.$/,
428
+ k = /(at|bl|iz)$/,
429
+ _ = new RegExp("([^aeiouylsz])\\1$"),
430
+ B = new RegExp("^" + s + i + "[^aeiouwxy]$"),
431
+ A = /^(.+?[^aeiou])y$/,
432
+ j =
433
+ /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,
434
+ q = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,
435
+ V =
436
+ /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,
437
+ $ = /^(.+?)(s|t)(ion)$/,
438
+ C = /^(.+?)e$/,
439
+ z = /ll$/,
440
+ W = new RegExp("^" + s + i + "[^aeiouwxy]$"),
441
+ H = function (c) {
442
+ var v, P, T, h, x, O, M;
443
+ if (c.length < 3) return c;
444
+ if (
445
+ ((T = c.substr(0, 1)),
446
+ T == "y" && (c = T.toUpperCase() + c.substr(1)),
447
+ (h = L),
448
+ (x = f),
449
+ h.test(c)
450
+ ? (c = c.replace(h, "$1$2"))
451
+ : x.test(c) && (c = c.replace(x, "$1$2")),
452
+ (h = y),
453
+ (x = S),
454
+ h.test(c))
455
+ ) {
456
+ var E = h.exec(c);
457
+ (h = m), h.test(E[1]) && ((h = w), (c = c.replace(h, "")));
458
+ } else if (x.test(c)) {
459
+ var E = x.exec(c);
460
+ (v = E[1]),
461
+ (x = g),
462
+ x.test(v) &&
463
+ ((c = v),
464
+ (x = k),
465
+ (O = _),
466
+ (M = B),
467
+ x.test(c)
468
+ ? (c = c + "e")
469
+ : O.test(c)
470
+ ? ((h = w), (c = c.replace(h, "")))
471
+ : M.test(c) && (c = c + "e"));
472
+ }
473
+ if (((h = A), h.test(c))) {
474
+ var E = h.exec(c);
475
+ (v = E[1]), (c = v + "i");
476
+ }
477
+ if (((h = j), h.test(c))) {
478
+ var E = h.exec(c);
479
+ (v = E[1]), (P = E[2]), (h = m), h.test(v) && (c = v + e[P]);
480
+ }
481
+ if (((h = q), h.test(c))) {
482
+ var E = h.exec(c);
483
+ (v = E[1]), (P = E[2]), (h = m), h.test(v) && (c = v + n[P]);
484
+ }
485
+ if (((h = V), (x = $), h.test(c))) {
486
+ var E = h.exec(c);
487
+ (v = E[1]), (h = p), h.test(v) && (c = v);
488
+ } else if (x.test(c)) {
489
+ var E = x.exec(c);
490
+ (v = E[1] + E[2]), (x = p), x.test(v) && (c = v);
491
+ }
492
+ if (((h = C), h.test(c))) {
493
+ var E = h.exec(c);
494
+ (v = E[1]),
495
+ (h = p),
496
+ (x = b),
497
+ (O = W),
498
+ (h.test(v) || (x.test(v) && !O.test(v))) && (c = v);
499
+ }
500
+ return (
501
+ (h = z),
502
+ (x = p),
503
+ h.test(c) && x.test(c) && ((h = w), (c = c.replace(h, ""))),
504
+ T == "y" && (c = T.toLowerCase() + c.substr(1)),
505
+ c
506
+ );
507
+ };
508
+ return function (R) {
509
+ return R.update(H);
510
+ };
511
+ })()),
512
+ t.Pipeline.registerFunction(t.stemmer, "stemmer");
513
+ (t.generateStopWordFilter = function (e) {
514
+ var n = e.reduce(function (r, i) {
515
+ return (r[i] = i), r;
516
+ }, {});
517
+ return function (r) {
518
+ if (r && n[r.toString()] !== r.toString()) return r;
519
+ };
520
+ }),
521
+ (t.stopWordFilter = t.generateStopWordFilter([
522
+ "a",
523
+ "able",
524
+ "about",
525
+ "across",
526
+ "after",
527
+ "all",
528
+ "almost",
529
+ "also",
530
+ "am",
531
+ "among",
532
+ "an",
533
+ "and",
534
+ "any",
535
+ "are",
536
+ "as",
537
+ "at",
538
+ "be",
539
+ "because",
540
+ "been",
541
+ "but",
542
+ "by",
543
+ "can",
544
+ "cannot",
545
+ "could",
546
+ "dear",
547
+ "did",
548
+ "do",
549
+ "does",
550
+ "either",
551
+ "else",
552
+ "ever",
553
+ "every",
554
+ "for",
555
+ "from",
556
+ "get",
557
+ "got",
558
+ "had",
559
+ "has",
560
+ "have",
561
+ "he",
562
+ "her",
563
+ "hers",
564
+ "him",
565
+ "his",
566
+ "how",
567
+ "however",
568
+ "i",
569
+ "if",
570
+ "in",
571
+ "into",
572
+ "is",
573
+ "it",
574
+ "its",
575
+ "just",
576
+ "least",
577
+ "let",
578
+ "like",
579
+ "likely",
580
+ "may",
581
+ "me",
582
+ "might",
583
+ "most",
584
+ "must",
585
+ "my",
586
+ "neither",
587
+ "no",
588
+ "nor",
589
+ "not",
590
+ "of",
591
+ "off",
592
+ "often",
593
+ "on",
594
+ "only",
595
+ "or",
596
+ "other",
597
+ "our",
598
+ "own",
599
+ "rather",
600
+ "said",
601
+ "say",
602
+ "says",
603
+ "she",
604
+ "should",
605
+ "since",
606
+ "so",
607
+ "some",
608
+ "than",
609
+ "that",
610
+ "the",
611
+ "their",
612
+ "them",
613
+ "then",
614
+ "there",
615
+ "these",
616
+ "they",
617
+ "this",
618
+ "tis",
619
+ "to",
620
+ "too",
621
+ "twas",
622
+ "us",
623
+ "wants",
624
+ "was",
625
+ "we",
626
+ "were",
627
+ "what",
628
+ "when",
629
+ "where",
630
+ "which",
631
+ "while",
632
+ "who",
633
+ "whom",
634
+ "why",
635
+ "will",
636
+ "with",
637
+ "would",
638
+ "yet",
639
+ "you",
640
+ "your",
641
+ ])),
642
+ t.Pipeline.registerFunction(t.stopWordFilter, "stopWordFilter");
643
+ (t.trimmer = function (e) {
644
+ return e.update(function (n) {
645
+ return n.replace(/^\W+/, "").replace(/\W+$/, "");
646
+ });
647
+ }),
648
+ t.Pipeline.registerFunction(t.trimmer, "trimmer");
649
+ (t.TokenSet = function () {
650
+ (this.final = !1),
651
+ (this.edges = {}),
652
+ (this.id = t.TokenSet._nextId),
653
+ (t.TokenSet._nextId += 1);
654
+ }),
655
+ (t.TokenSet._nextId = 1),
656
+ (t.TokenSet.fromArray = function (e) {
657
+ for (
658
+ var n = new t.TokenSet.Builder(), r = 0, i = e.length;
659
+ r < i;
660
+ r++
661
+ )
662
+ n.insert(e[r]);
663
+ return n.finish(), n.root;
664
+ }),
665
+ (t.TokenSet.fromClause = function (e) {
666
+ return "editDistance" in e
667
+ ? t.TokenSet.fromFuzzyString(e.term, e.editDistance)
668
+ : t.TokenSet.fromString(e.term);
669
+ }),
670
+ (t.TokenSet.fromFuzzyString = function (e, n) {
671
+ for (
672
+ var r = new t.TokenSet(),
673
+ i = [{ node: r, editsRemaining: n, str: e }];
674
+ i.length;
675
+
676
+ ) {
677
+ var s = i.pop();
678
+ if (s.str.length > 0) {
679
+ var o = s.str.charAt(0),
680
+ a;
681
+ o in s.node.edges
682
+ ? (a = s.node.edges[o])
683
+ : ((a = new t.TokenSet()), (s.node.edges[o] = a)),
684
+ s.str.length == 1 && (a.final = !0),
685
+ i.push({
686
+ node: a,
687
+ editsRemaining: s.editsRemaining,
688
+ str: s.str.slice(1),
689
+ });
690
+ }
691
+ if (s.editsRemaining != 0) {
692
+ if ("*" in s.node.edges) var l = s.node.edges["*"];
693
+ else {
694
+ var l = new t.TokenSet();
695
+ s.node.edges["*"] = l;
696
+ }
697
+ if (
698
+ (s.str.length == 0 && (l.final = !0),
699
+ i.push({
700
+ node: l,
701
+ editsRemaining: s.editsRemaining - 1,
702
+ str: s.str,
703
+ }),
704
+ s.str.length > 1 &&
705
+ i.push({
706
+ node: s.node,
707
+ editsRemaining: s.editsRemaining - 1,
708
+ str: s.str.slice(1),
709
+ }),
710
+ s.str.length == 1 && (s.node.final = !0),
711
+ s.str.length >= 1)
712
+ ) {
713
+ if ("*" in s.node.edges) var u = s.node.edges["*"];
714
+ else {
715
+ var u = new t.TokenSet();
716
+ s.node.edges["*"] = u;
717
+ }
718
+ s.str.length == 1 && (u.final = !0),
719
+ i.push({
720
+ node: u,
721
+ editsRemaining: s.editsRemaining - 1,
722
+ str: s.str.slice(1),
723
+ });
724
+ }
725
+ if (s.str.length > 1) {
726
+ var d = s.str.charAt(0),
727
+ m = s.str.charAt(1),
728
+ p;
729
+ m in s.node.edges
730
+ ? (p = s.node.edges[m])
731
+ : ((p = new t.TokenSet()), (s.node.edges[m] = p)),
732
+ s.str.length == 1 && (p.final = !0),
733
+ i.push({
734
+ node: p,
735
+ editsRemaining: s.editsRemaining - 1,
736
+ str: d + s.str.slice(2),
737
+ });
738
+ }
739
+ }
740
+ }
741
+ return r;
742
+ }),
743
+ (t.TokenSet.fromString = function (e) {
744
+ for (
745
+ var n = new t.TokenSet(), r = n, i = 0, s = e.length;
746
+ i < s;
747
+ i++
748
+ ) {
749
+ var o = e[i],
750
+ a = i == s - 1;
751
+ if (o == "*") (n.edges[o] = n), (n.final = a);
752
+ else {
753
+ var l = new t.TokenSet();
754
+ (l.final = a), (n.edges[o] = l), (n = l);
755
+ }
756
+ }
757
+ return r;
758
+ }),
759
+ (t.TokenSet.prototype.toArray = function () {
760
+ for (var e = [], n = [{ prefix: "", node: this }]; n.length; ) {
761
+ var r = n.pop(),
762
+ i = Object.keys(r.node.edges),
763
+ s = i.length;
764
+ r.node.final && (r.prefix.charAt(0), e.push(r.prefix));
765
+ for (var o = 0; o < s; o++) {
766
+ var a = i[o];
767
+ n.push({ prefix: r.prefix.concat(a), node: r.node.edges[a] });
768
+ }
769
+ }
770
+ return e;
771
+ }),
772
+ (t.TokenSet.prototype.toString = function () {
773
+ if (this._str) return this._str;
774
+ for (
775
+ var e = this.final ? "1" : "0",
776
+ n = Object.keys(this.edges).sort(),
777
+ r = n.length,
778
+ i = 0;
779
+ i < r;
780
+ i++
781
+ ) {
782
+ var s = n[i],
783
+ o = this.edges[s];
784
+ e = e + s + o.id;
785
+ }
786
+ return e;
787
+ }),
788
+ (t.TokenSet.prototype.intersect = function (e) {
789
+ for (
790
+ var n = new t.TokenSet(),
791
+ r = void 0,
792
+ i = [{ qNode: e, output: n, node: this }];
793
+ i.length;
794
+
795
+ ) {
796
+ r = i.pop();
797
+ for (
798
+ var s = Object.keys(r.qNode.edges),
799
+ o = s.length,
800
+ a = Object.keys(r.node.edges),
801
+ l = a.length,
802
+ u = 0;
803
+ u < o;
804
+ u++
805
+ )
806
+ for (var d = s[u], m = 0; m < l; m++) {
807
+ var p = a[m];
808
+ if (p == d || d == "*") {
809
+ var b = r.node.edges[p],
810
+ g = r.qNode.edges[d],
811
+ L = b.final && g.final,
812
+ f = void 0;
813
+ p in r.output.edges
814
+ ? ((f = r.output.edges[p]), (f.final = f.final || L))
815
+ : ((f = new t.TokenSet()),
816
+ (f.final = L),
817
+ (r.output.edges[p] = f)),
818
+ i.push({ qNode: g, output: f, node: b });
819
+ }
820
+ }
821
+ }
822
+ return n;
823
+ }),
824
+ (t.TokenSet.Builder = function () {
825
+ (this.previousWord = ""),
826
+ (this.root = new t.TokenSet()),
827
+ (this.uncheckedNodes = []),
828
+ (this.minimizedNodes = {});
829
+ }),
830
+ (t.TokenSet.Builder.prototype.insert = function (e) {
831
+ var n,
832
+ r = 0;
833
+ if (e < this.previousWord)
834
+ throw new Error("Out of order word insertion");
835
+ for (
836
+ var i = 0;
837
+ i < e.length &&
838
+ i < this.previousWord.length &&
839
+ e[i] == this.previousWord[i];
840
+ i++
841
+ )
842
+ r++;
843
+ this.minimize(r),
844
+ this.uncheckedNodes.length == 0
845
+ ? (n = this.root)
846
+ : (n = this.uncheckedNodes[this.uncheckedNodes.length - 1].child);
847
+ for (var i = r; i < e.length; i++) {
848
+ var s = new t.TokenSet(),
849
+ o = e[i];
850
+ (n.edges[o] = s),
851
+ this.uncheckedNodes.push({ parent: n, char: o, child: s }),
852
+ (n = s);
853
+ }
854
+ (n.final = !0), (this.previousWord = e);
855
+ }),
856
+ (t.TokenSet.Builder.prototype.finish = function () {
857
+ this.minimize(0);
858
+ }),
859
+ (t.TokenSet.Builder.prototype.minimize = function (e) {
860
+ for (var n = this.uncheckedNodes.length - 1; n >= e; n--) {
861
+ var r = this.uncheckedNodes[n],
862
+ i = r.child.toString();
863
+ i in this.minimizedNodes
864
+ ? (r.parent.edges[r.char] = this.minimizedNodes[i])
865
+ : ((r.child._str = i), (this.minimizedNodes[i] = r.child)),
866
+ this.uncheckedNodes.pop();
867
+ }
868
+ });
869
+ (t.Index = function (e) {
870
+ (this.invertedIndex = e.invertedIndex),
871
+ (this.fieldVectors = e.fieldVectors),
872
+ (this.tokenSet = e.tokenSet),
873
+ (this.fields = e.fields),
874
+ (this.pipeline = e.pipeline);
875
+ }),
876
+ (t.Index.prototype.search = function (e) {
877
+ return this.query(function (n) {
878
+ var r = new t.QueryParser(e, n);
879
+ r.parse();
880
+ });
881
+ }),
882
+ (t.Index.prototype.query = function (e) {
883
+ for (
884
+ var n = new t.Query(this.fields),
885
+ r = Object.create(null),
886
+ i = Object.create(null),
887
+ s = Object.create(null),
888
+ o = Object.create(null),
889
+ a = Object.create(null),
890
+ l = 0;
891
+ l < this.fields.length;
892
+ l++
893
+ )
894
+ i[this.fields[l]] = new t.Vector();
895
+ e.call(n, n);
896
+ for (var l = 0; l < n.clauses.length; l++) {
897
+ var u = n.clauses[l],
898
+ d = null,
899
+ m = t.Set.empty;
900
+ u.usePipeline
901
+ ? (d = this.pipeline.runString(u.term, { fields: u.fields }))
902
+ : (d = [u.term]);
903
+ for (var p = 0; p < d.length; p++) {
904
+ var b = d[p];
905
+ u.term = b;
906
+ var g = t.TokenSet.fromClause(u),
907
+ L = this.tokenSet.intersect(g).toArray();
908
+ if (L.length === 0 && u.presence === t.Query.presence.REQUIRED) {
909
+ for (var f = 0; f < u.fields.length; f++) {
910
+ var y = u.fields[f];
911
+ o[y] = t.Set.empty;
912
+ }
913
+ break;
914
+ }
915
+ for (var S = 0; S < L.length; S++)
916
+ for (
917
+ var w = L[S], k = this.invertedIndex[w], _ = k._index, f = 0;
918
+ f < u.fields.length;
919
+ f++
920
+ ) {
921
+ var y = u.fields[f],
922
+ B = k[y],
923
+ A = Object.keys(B),
924
+ j = w + "/" + y,
925
+ q = new t.Set(A);
926
+ if (
927
+ (u.presence == t.Query.presence.REQUIRED &&
928
+ ((m = m.union(q)),
929
+ o[y] === void 0 && (o[y] = t.Set.complete)),
930
+ u.presence == t.Query.presence.PROHIBITED)
931
+ ) {
932
+ a[y] === void 0 && (a[y] = t.Set.empty),
933
+ (a[y] = a[y].union(q));
934
+ continue;
935
+ }
936
+ if (
937
+ (i[y].upsert(_, u.boost, function (Ie, Ce) {
938
+ return Ie + Ce;
939
+ }),
940
+ !s[j])
941
+ ) {
942
+ for (var V = 0; V < A.length; V++) {
943
+ var $ = A[V],
944
+ C = new t.FieldRef($, y),
945
+ z = B[$],
946
+ W;
947
+ (W = r[C]) === void 0
948
+ ? (r[C] = new t.MatchData(w, y, z))
949
+ : W.add(w, y, z);
950
+ }
951
+ s[j] = !0;
952
+ }
953
+ }
954
+ }
955
+ if (u.presence === t.Query.presence.REQUIRED)
956
+ for (var f = 0; f < u.fields.length; f++) {
957
+ var y = u.fields[f];
958
+ o[y] = o[y].intersect(m);
959
+ }
960
+ }
961
+ for (
962
+ var H = t.Set.complete, R = t.Set.empty, l = 0;
963
+ l < this.fields.length;
964
+ l++
965
+ ) {
966
+ var y = this.fields[l];
967
+ o[y] && (H = H.intersect(o[y])), a[y] && (R = R.union(a[y]));
968
+ }
969
+ var c = Object.keys(r),
970
+ v = [],
971
+ P = Object.create(null);
972
+ if (n.isNegated()) {
973
+ c = Object.keys(this.fieldVectors);
974
+ for (var l = 0; l < c.length; l++) {
975
+ var C = c[l],
976
+ T = t.FieldRef.fromString(C);
977
+ r[C] = new t.MatchData();
978
+ }
979
+ }
980
+ for (var l = 0; l < c.length; l++) {
981
+ var T = t.FieldRef.fromString(c[l]),
982
+ h = T.docRef;
983
+ if (H.contains(h) && !R.contains(h)) {
984
+ var x = this.fieldVectors[T],
985
+ O = i[T.fieldName].similarity(x),
986
+ M;
987
+ if ((M = P[h]) !== void 0)
988
+ (M.score += O), M.matchData.combine(r[T]);
989
+ else {
990
+ var E = { ref: h, score: O, matchData: r[T] };
991
+ (P[h] = E), v.push(E);
992
+ }
993
+ }
994
+ }
995
+ return v.sort(function (ke, Qe) {
996
+ return Qe.score - ke.score;
997
+ });
998
+ }),
999
+ (t.Index.prototype.toJSON = function () {
1000
+ var e = Object.keys(this.invertedIndex)
1001
+ .sort()
1002
+ .map(function (r) {
1003
+ return [r, this.invertedIndex[r]];
1004
+ }, this),
1005
+ n = Object.keys(this.fieldVectors).map(function (r) {
1006
+ return [r, this.fieldVectors[r].toJSON()];
1007
+ }, this);
1008
+ return {
1009
+ version: t.version,
1010
+ fields: this.fields,
1011
+ fieldVectors: n,
1012
+ invertedIndex: e,
1013
+ pipeline: this.pipeline.toJSON(),
1014
+ };
1015
+ }),
1016
+ (t.Index.load = function (e) {
1017
+ var n = {},
1018
+ r = {},
1019
+ i = e.fieldVectors,
1020
+ s = Object.create(null),
1021
+ o = e.invertedIndex,
1022
+ a = new t.TokenSet.Builder(),
1023
+ l = t.Pipeline.load(e.pipeline);
1024
+ e.version != t.version &&
1025
+ t.utils.warn(
1026
+ "Version mismatch when loading serialised index. Current version of lunr '" +
1027
+ t.version +
1028
+ "' does not match serialized index '" +
1029
+ e.version +
1030
+ "'",
1031
+ );
1032
+ for (var u = 0; u < i.length; u++) {
1033
+ var d = i[u],
1034
+ m = d[0],
1035
+ p = d[1];
1036
+ r[m] = new t.Vector(p);
1037
+ }
1038
+ for (var u = 0; u < o.length; u++) {
1039
+ var d = o[u],
1040
+ b = d[0],
1041
+ g = d[1];
1042
+ a.insert(b), (s[b] = g);
1043
+ }
1044
+ return (
1045
+ a.finish(),
1046
+ (n.fields = e.fields),
1047
+ (n.fieldVectors = r),
1048
+ (n.invertedIndex = s),
1049
+ (n.tokenSet = a.root),
1050
+ (n.pipeline = l),
1051
+ new t.Index(n)
1052
+ );
1053
+ });
1054
+ (t.Builder = function () {
1055
+ (this._ref = "id"),
1056
+ (this._fields = Object.create(null)),
1057
+ (this._documents = Object.create(null)),
1058
+ (this.invertedIndex = Object.create(null)),
1059
+ (this.fieldTermFrequencies = {}),
1060
+ (this.fieldLengths = {}),
1061
+ (this.tokenizer = t.tokenizer),
1062
+ (this.pipeline = new t.Pipeline()),
1063
+ (this.searchPipeline = new t.Pipeline()),
1064
+ (this.documentCount = 0),
1065
+ (this._b = 0.75),
1066
+ (this._k1 = 1.2),
1067
+ (this.termIndex = 0),
1068
+ (this.metadataWhitelist = []);
1069
+ }),
1070
+ (t.Builder.prototype.ref = function (e) {
1071
+ this._ref = e;
1072
+ }),
1073
+ (t.Builder.prototype.field = function (e, n) {
1074
+ if (/\//.test(e))
1075
+ throw new RangeError(
1076
+ "Field '" + e + "' contains illegal character '/'",
1077
+ );
1078
+ this._fields[e] = n || {};
1079
+ }),
1080
+ (t.Builder.prototype.b = function (e) {
1081
+ e < 0 ? (this._b = 0) : e > 1 ? (this._b = 1) : (this._b = e);
1082
+ }),
1083
+ (t.Builder.prototype.k1 = function (e) {
1084
+ this._k1 = e;
1085
+ }),
1086
+ (t.Builder.prototype.add = function (e, n) {
1087
+ var r = e[this._ref],
1088
+ i = Object.keys(this._fields);
1089
+ (this._documents[r] = n || {}), (this.documentCount += 1);
1090
+ for (var s = 0; s < i.length; s++) {
1091
+ var o = i[s],
1092
+ a = this._fields[o].extractor,
1093
+ l = a ? a(e) : e[o],
1094
+ u = this.tokenizer(l, { fields: [o] }),
1095
+ d = this.pipeline.run(u),
1096
+ m = new t.FieldRef(r, o),
1097
+ p = Object.create(null);
1098
+ (this.fieldTermFrequencies[m] = p),
1099
+ (this.fieldLengths[m] = 0),
1100
+ (this.fieldLengths[m] += d.length);
1101
+ for (var b = 0; b < d.length; b++) {
1102
+ var g = d[b];
1103
+ if (
1104
+ (p[g] == null && (p[g] = 0),
1105
+ (p[g] += 1),
1106
+ this.invertedIndex[g] == null)
1107
+ ) {
1108
+ var L = Object.create(null);
1109
+ (L._index = this.termIndex), (this.termIndex += 1);
1110
+ for (var f = 0; f < i.length; f++)
1111
+ L[i[f]] = Object.create(null);
1112
+ this.invertedIndex[g] = L;
1113
+ }
1114
+ this.invertedIndex[g][o][r] == null &&
1115
+ (this.invertedIndex[g][o][r] = Object.create(null));
1116
+ for (var y = 0; y < this.metadataWhitelist.length; y++) {
1117
+ var S = this.metadataWhitelist[y],
1118
+ w = g.metadata[S];
1119
+ this.invertedIndex[g][o][r][S] == null &&
1120
+ (this.invertedIndex[g][o][r][S] = []),
1121
+ this.invertedIndex[g][o][r][S].push(w);
1122
+ }
1123
+ }
1124
+ }
1125
+ }),
1126
+ (t.Builder.prototype.calculateAverageFieldLengths = function () {
1127
+ for (
1128
+ var e = Object.keys(this.fieldLengths),
1129
+ n = e.length,
1130
+ r = {},
1131
+ i = {},
1132
+ s = 0;
1133
+ s < n;
1134
+ s++
1135
+ ) {
1136
+ var o = t.FieldRef.fromString(e[s]),
1137
+ a = o.fieldName;
1138
+ i[a] || (i[a] = 0),
1139
+ (i[a] += 1),
1140
+ r[a] || (r[a] = 0),
1141
+ (r[a] += this.fieldLengths[o]);
1142
+ }
1143
+ for (var l = Object.keys(this._fields), s = 0; s < l.length; s++) {
1144
+ var u = l[s];
1145
+ r[u] = r[u] / i[u];
1146
+ }
1147
+ this.averageFieldLength = r;
1148
+ }),
1149
+ (t.Builder.prototype.createFieldVectors = function () {
1150
+ for (
1151
+ var e = {},
1152
+ n = Object.keys(this.fieldTermFrequencies),
1153
+ r = n.length,
1154
+ i = Object.create(null),
1155
+ s = 0;
1156
+ s < r;
1157
+ s++
1158
+ ) {
1159
+ for (
1160
+ var o = t.FieldRef.fromString(n[s]),
1161
+ a = o.fieldName,
1162
+ l = this.fieldLengths[o],
1163
+ u = new t.Vector(),
1164
+ d = this.fieldTermFrequencies[o],
1165
+ m = Object.keys(d),
1166
+ p = m.length,
1167
+ b = this._fields[a].boost || 1,
1168
+ g = this._documents[o.docRef].boost || 1,
1169
+ L = 0;
1170
+ L < p;
1171
+ L++
1172
+ ) {
1173
+ var f = m[L],
1174
+ y = d[f],
1175
+ S = this.invertedIndex[f]._index,
1176
+ w,
1177
+ k,
1178
+ _;
1179
+ i[f] === void 0
1180
+ ? ((w = t.idf(this.invertedIndex[f], this.documentCount)),
1181
+ (i[f] = w))
1182
+ : (w = i[f]),
1183
+ (k =
1184
+ (w * ((this._k1 + 1) * y)) /
1185
+ (this._k1 *
1186
+ (1 - this._b + this._b * (l / this.averageFieldLength[a])) +
1187
+ y)),
1188
+ (k *= b),
1189
+ (k *= g),
1190
+ (_ = Math.round(k * 1e3) / 1e3),
1191
+ u.insert(S, _);
1192
+ }
1193
+ e[o] = u;
1194
+ }
1195
+ this.fieldVectors = e;
1196
+ }),
1197
+ (t.Builder.prototype.createTokenSet = function () {
1198
+ this.tokenSet = t.TokenSet.fromArray(
1199
+ Object.keys(this.invertedIndex).sort(),
1200
+ );
1201
+ }),
1202
+ (t.Builder.prototype.build = function () {
1203
+ return (
1204
+ this.calculateAverageFieldLengths(),
1205
+ this.createFieldVectors(),
1206
+ this.createTokenSet(),
1207
+ new t.Index({
1208
+ invertedIndex: this.invertedIndex,
1209
+ fieldVectors: this.fieldVectors,
1210
+ tokenSet: this.tokenSet,
1211
+ fields: Object.keys(this._fields),
1212
+ pipeline: this.searchPipeline,
1213
+ })
1214
+ );
1215
+ }),
1216
+ (t.Builder.prototype.use = function (e) {
1217
+ var n = Array.prototype.slice.call(arguments, 1);
1218
+ n.unshift(this), e.apply(this, n);
1219
+ }),
1220
+ (t.MatchData = function (e, n, r) {
1221
+ for (
1222
+ var i = Object.create(null), s = Object.keys(r || {}), o = 0;
1223
+ o < s.length;
1224
+ o++
1225
+ ) {
1226
+ var a = s[o];
1227
+ i[a] = r[a].slice();
1228
+ }
1229
+ (this.metadata = Object.create(null)),
1230
+ e !== void 0 &&
1231
+ ((this.metadata[e] = Object.create(null)),
1232
+ (this.metadata[e][n] = i));
1233
+ }),
1234
+ (t.MatchData.prototype.combine = function (e) {
1235
+ for (var n = Object.keys(e.metadata), r = 0; r < n.length; r++) {
1236
+ var i = n[r],
1237
+ s = Object.keys(e.metadata[i]);
1238
+ this.metadata[i] == null &&
1239
+ (this.metadata[i] = Object.create(null));
1240
+ for (var o = 0; o < s.length; o++) {
1241
+ var a = s[o],
1242
+ l = Object.keys(e.metadata[i][a]);
1243
+ this.metadata[i][a] == null &&
1244
+ (this.metadata[i][a] = Object.create(null));
1245
+ for (var u = 0; u < l.length; u++) {
1246
+ var d = l[u];
1247
+ this.metadata[i][a][d] == null
1248
+ ? (this.metadata[i][a][d] = e.metadata[i][a][d])
1249
+ : (this.metadata[i][a][d] = this.metadata[i][a][d].concat(
1250
+ e.metadata[i][a][d],
1251
+ ));
1252
+ }
1253
+ }
1254
+ }
1255
+ }),
1256
+ (t.MatchData.prototype.add = function (e, n, r) {
1257
+ if (!(e in this.metadata)) {
1258
+ (this.metadata[e] = Object.create(null)), (this.metadata[e][n] = r);
1259
+ return;
1260
+ }
1261
+ if (!(n in this.metadata[e])) {
1262
+ this.metadata[e][n] = r;
1263
+ return;
1264
+ }
1265
+ for (var i = Object.keys(r), s = 0; s < i.length; s++) {
1266
+ var o = i[s];
1267
+ o in this.metadata[e][n]
1268
+ ? (this.metadata[e][n][o] = this.metadata[e][n][o].concat(r[o]))
1269
+ : (this.metadata[e][n][o] = r[o]);
1270
+ }
1271
+ }),
1272
+ (t.Query = function (e) {
1273
+ (this.clauses = []), (this.allFields = e);
1274
+ }),
1275
+ (t.Query.wildcard = new String("*")),
1276
+ (t.Query.wildcard.NONE = 0),
1277
+ (t.Query.wildcard.LEADING = 1),
1278
+ (t.Query.wildcard.TRAILING = 2),
1279
+ (t.Query.presence = { OPTIONAL: 1, REQUIRED: 2, PROHIBITED: 3 }),
1280
+ (t.Query.prototype.clause = function (e) {
1281
+ return (
1282
+ "fields" in e || (e.fields = this.allFields),
1283
+ "boost" in e || (e.boost = 1),
1284
+ "usePipeline" in e || (e.usePipeline = !0),
1285
+ "wildcard" in e || (e.wildcard = t.Query.wildcard.NONE),
1286
+ e.wildcard & t.Query.wildcard.LEADING &&
1287
+ e.term.charAt(0) != t.Query.wildcard &&
1288
+ (e.term = "*" + e.term),
1289
+ e.wildcard & t.Query.wildcard.TRAILING &&
1290
+ e.term.slice(-1) != t.Query.wildcard &&
1291
+ (e.term = "" + e.term + "*"),
1292
+ "presence" in e || (e.presence = t.Query.presence.OPTIONAL),
1293
+ this.clauses.push(e),
1294
+ this
1295
+ );
1296
+ }),
1297
+ (t.Query.prototype.isNegated = function () {
1298
+ for (var e = 0; e < this.clauses.length; e++)
1299
+ if (this.clauses[e].presence != t.Query.presence.PROHIBITED)
1300
+ return !1;
1301
+ return !0;
1302
+ }),
1303
+ (t.Query.prototype.term = function (e, n) {
1304
+ if (Array.isArray(e))
1305
+ return (
1306
+ e.forEach(function (i) {
1307
+ this.term(i, t.utils.clone(n));
1308
+ }, this),
1309
+ this
1310
+ );
1311
+ var r = n || {};
1312
+ return (r.term = e.toString()), this.clause(r), this;
1313
+ }),
1314
+ (t.QueryParseError = function (e, n, r) {
1315
+ (this.name = "QueryParseError"),
1316
+ (this.message = e),
1317
+ (this.start = n),
1318
+ (this.end = r);
1319
+ }),
1320
+ (t.QueryParseError.prototype = new Error()),
1321
+ (t.QueryLexer = function (e) {
1322
+ (this.lexemes = []),
1323
+ (this.str = e),
1324
+ (this.length = e.length),
1325
+ (this.pos = 0),
1326
+ (this.start = 0),
1327
+ (this.escapeCharPositions = []);
1328
+ }),
1329
+ (t.QueryLexer.prototype.run = function () {
1330
+ for (var e = t.QueryLexer.lexText; e; ) e = e(this);
1331
+ }),
1332
+ (t.QueryLexer.prototype.sliceString = function () {
1333
+ for (
1334
+ var e = [], n = this.start, r = this.pos, i = 0;
1335
+ i < this.escapeCharPositions.length;
1336
+ i++
1337
+ )
1338
+ (r = this.escapeCharPositions[i]),
1339
+ e.push(this.str.slice(n, r)),
1340
+ (n = r + 1);
1341
+ return (
1342
+ e.push(this.str.slice(n, this.pos)),
1343
+ (this.escapeCharPositions.length = 0),
1344
+ e.join("")
1345
+ );
1346
+ }),
1347
+ (t.QueryLexer.prototype.emit = function (e) {
1348
+ this.lexemes.push({
1349
+ type: e,
1350
+ str: this.sliceString(),
1351
+ start: this.start,
1352
+ end: this.pos,
1353
+ }),
1354
+ (this.start = this.pos);
1355
+ }),
1356
+ (t.QueryLexer.prototype.escapeCharacter = function () {
1357
+ this.escapeCharPositions.push(this.pos - 1), (this.pos += 1);
1358
+ }),
1359
+ (t.QueryLexer.prototype.next = function () {
1360
+ if (this.pos >= this.length) return t.QueryLexer.EOS;
1361
+ var e = this.str.charAt(this.pos);
1362
+ return (this.pos += 1), e;
1363
+ }),
1364
+ (t.QueryLexer.prototype.width = function () {
1365
+ return this.pos - this.start;
1366
+ }),
1367
+ (t.QueryLexer.prototype.ignore = function () {
1368
+ this.start == this.pos && (this.pos += 1), (this.start = this.pos);
1369
+ }),
1370
+ (t.QueryLexer.prototype.backup = function () {
1371
+ this.pos -= 1;
1372
+ }),
1373
+ (t.QueryLexer.prototype.acceptDigitRun = function () {
1374
+ var e, n;
1375
+ do (e = this.next()), (n = e.charCodeAt(0));
1376
+ while (n > 47 && n < 58);
1377
+ e != t.QueryLexer.EOS && this.backup();
1378
+ }),
1379
+ (t.QueryLexer.prototype.more = function () {
1380
+ return this.pos < this.length;
1381
+ }),
1382
+ (t.QueryLexer.EOS = "EOS"),
1383
+ (t.QueryLexer.FIELD = "FIELD"),
1384
+ (t.QueryLexer.TERM = "TERM"),
1385
+ (t.QueryLexer.EDIT_DISTANCE = "EDIT_DISTANCE"),
1386
+ (t.QueryLexer.BOOST = "BOOST"),
1387
+ (t.QueryLexer.PRESENCE = "PRESENCE"),
1388
+ (t.QueryLexer.lexField = function (e) {
1389
+ return (
1390
+ e.backup(),
1391
+ e.emit(t.QueryLexer.FIELD),
1392
+ e.ignore(),
1393
+ t.QueryLexer.lexText
1394
+ );
1395
+ }),
1396
+ (t.QueryLexer.lexTerm = function (e) {
1397
+ if (
1398
+ (e.width() > 1 && (e.backup(), e.emit(t.QueryLexer.TERM)),
1399
+ e.ignore(),
1400
+ e.more())
1401
+ )
1402
+ return t.QueryLexer.lexText;
1403
+ }),
1404
+ (t.QueryLexer.lexEditDistance = function (e) {
1405
+ return (
1406
+ e.ignore(),
1407
+ e.acceptDigitRun(),
1408
+ e.emit(t.QueryLexer.EDIT_DISTANCE),
1409
+ t.QueryLexer.lexText
1410
+ );
1411
+ }),
1412
+ (t.QueryLexer.lexBoost = function (e) {
1413
+ return (
1414
+ e.ignore(),
1415
+ e.acceptDigitRun(),
1416
+ e.emit(t.QueryLexer.BOOST),
1417
+ t.QueryLexer.lexText
1418
+ );
1419
+ }),
1420
+ (t.QueryLexer.lexEOS = function (e) {
1421
+ e.width() > 0 && e.emit(t.QueryLexer.TERM);
1422
+ }),
1423
+ (t.QueryLexer.termSeparator = t.tokenizer.separator),
1424
+ (t.QueryLexer.lexText = function (e) {
1425
+ for (;;) {
1426
+ var n = e.next();
1427
+ if (n == t.QueryLexer.EOS) return t.QueryLexer.lexEOS;
1428
+ if (n.charCodeAt(0) == 92) {
1429
+ e.escapeCharacter();
1430
+ continue;
1431
+ }
1432
+ if (n == ":") return t.QueryLexer.lexField;
1433
+ if (n == "~")
1434
+ return (
1435
+ e.backup(),
1436
+ e.width() > 0 && e.emit(t.QueryLexer.TERM),
1437
+ t.QueryLexer.lexEditDistance
1438
+ );
1439
+ if (n == "^")
1440
+ return (
1441
+ e.backup(),
1442
+ e.width() > 0 && e.emit(t.QueryLexer.TERM),
1443
+ t.QueryLexer.lexBoost
1444
+ );
1445
+ if ((n == "+" && e.width() === 1) || (n == "-" && e.width() === 1))
1446
+ return e.emit(t.QueryLexer.PRESENCE), t.QueryLexer.lexText;
1447
+ if (n.match(t.QueryLexer.termSeparator))
1448
+ return t.QueryLexer.lexTerm;
1449
+ }
1450
+ }),
1451
+ (t.QueryParser = function (e, n) {
1452
+ (this.lexer = new t.QueryLexer(e)),
1453
+ (this.query = n),
1454
+ (this.currentClause = {}),
1455
+ (this.lexemeIdx = 0);
1456
+ }),
1457
+ (t.QueryParser.prototype.parse = function () {
1458
+ this.lexer.run(), (this.lexemes = this.lexer.lexemes);
1459
+ for (var e = t.QueryParser.parseClause; e; ) e = e(this);
1460
+ return this.query;
1461
+ }),
1462
+ (t.QueryParser.prototype.peekLexeme = function () {
1463
+ return this.lexemes[this.lexemeIdx];
1464
+ }),
1465
+ (t.QueryParser.prototype.consumeLexeme = function () {
1466
+ var e = this.peekLexeme();
1467
+ return (this.lexemeIdx += 1), e;
1468
+ }),
1469
+ (t.QueryParser.prototype.nextClause = function () {
1470
+ var e = this.currentClause;
1471
+ this.query.clause(e), (this.currentClause = {});
1472
+ }),
1473
+ (t.QueryParser.parseClause = function (e) {
1474
+ var n = e.peekLexeme();
1475
+ if (n != null)
1476
+ switch (n.type) {
1477
+ case t.QueryLexer.PRESENCE:
1478
+ return t.QueryParser.parsePresence;
1479
+ case t.QueryLexer.FIELD:
1480
+ return t.QueryParser.parseField;
1481
+ case t.QueryLexer.TERM:
1482
+ return t.QueryParser.parseTerm;
1483
+ default:
1484
+ var r = "expected either a field or a term, found " + n.type;
1485
+ throw (
1486
+ (n.str.length >= 1 && (r += " with value '" + n.str + "'"),
1487
+ new t.QueryParseError(r, n.start, n.end))
1488
+ );
1489
+ }
1490
+ }),
1491
+ (t.QueryParser.parsePresence = function (e) {
1492
+ var n = e.consumeLexeme();
1493
+ if (n != null) {
1494
+ switch (n.str) {
1495
+ case "-":
1496
+ e.currentClause.presence = t.Query.presence.PROHIBITED;
1497
+ break;
1498
+ case "+":
1499
+ e.currentClause.presence = t.Query.presence.REQUIRED;
1500
+ break;
1501
+ default:
1502
+ var r = "unrecognised presence operator'" + n.str + "'";
1503
+ throw new t.QueryParseError(r, n.start, n.end);
1504
+ }
1505
+ var i = e.peekLexeme();
1506
+ if (i == null) {
1507
+ var r = "expecting term or field, found nothing";
1508
+ throw new t.QueryParseError(r, n.start, n.end);
1509
+ }
1510
+ switch (i.type) {
1511
+ case t.QueryLexer.FIELD:
1512
+ return t.QueryParser.parseField;
1513
+ case t.QueryLexer.TERM:
1514
+ return t.QueryParser.parseTerm;
1515
+ default:
1516
+ var r = "expecting term or field, found '" + i.type + "'";
1517
+ throw new t.QueryParseError(r, i.start, i.end);
1518
+ }
1519
+ }
1520
+ }),
1521
+ (t.QueryParser.parseField = function (e) {
1522
+ var n = e.consumeLexeme();
1523
+ if (n != null) {
1524
+ if (e.query.allFields.indexOf(n.str) == -1) {
1525
+ var r = e.query.allFields
1526
+ .map(function (o) {
1527
+ return "'" + o + "'";
1528
+ })
1529
+ .join(", "),
1530
+ i = "unrecognised field '" + n.str + "', possible fields: " + r;
1531
+ throw new t.QueryParseError(i, n.start, n.end);
1532
+ }
1533
+ e.currentClause.fields = [n.str];
1534
+ var s = e.peekLexeme();
1535
+ if (s == null) {
1536
+ var i = "expecting term, found nothing";
1537
+ throw new t.QueryParseError(i, n.start, n.end);
1538
+ }
1539
+ switch (s.type) {
1540
+ case t.QueryLexer.TERM:
1541
+ return t.QueryParser.parseTerm;
1542
+ default:
1543
+ var i = "expecting term, found '" + s.type + "'";
1544
+ throw new t.QueryParseError(i, s.start, s.end);
1545
+ }
1546
+ }
1547
+ }),
1548
+ (t.QueryParser.parseTerm = function (e) {
1549
+ var n = e.consumeLexeme();
1550
+ if (n != null) {
1551
+ (e.currentClause.term = n.str.toLowerCase()),
1552
+ n.str.indexOf("*") != -1 && (e.currentClause.usePipeline = !1);
1553
+ var r = e.peekLexeme();
1554
+ if (r == null) {
1555
+ e.nextClause();
1556
+ return;
1557
+ }
1558
+ switch (r.type) {
1559
+ case t.QueryLexer.TERM:
1560
+ return e.nextClause(), t.QueryParser.parseTerm;
1561
+ case t.QueryLexer.FIELD:
1562
+ return e.nextClause(), t.QueryParser.parseField;
1563
+ case t.QueryLexer.EDIT_DISTANCE:
1564
+ return t.QueryParser.parseEditDistance;
1565
+ case t.QueryLexer.BOOST:
1566
+ return t.QueryParser.parseBoost;
1567
+ case t.QueryLexer.PRESENCE:
1568
+ return e.nextClause(), t.QueryParser.parsePresence;
1569
+ default:
1570
+ var i = "Unexpected lexeme type '" + r.type + "'";
1571
+ throw new t.QueryParseError(i, r.start, r.end);
1572
+ }
1573
+ }
1574
+ }),
1575
+ (t.QueryParser.parseEditDistance = function (e) {
1576
+ var n = e.consumeLexeme();
1577
+ if (n != null) {
1578
+ var r = parseInt(n.str, 10);
1579
+ if (isNaN(r)) {
1580
+ var i = "edit distance must be numeric";
1581
+ throw new t.QueryParseError(i, n.start, n.end);
1582
+ }
1583
+ e.currentClause.editDistance = r;
1584
+ var s = e.peekLexeme();
1585
+ if (s == null) {
1586
+ e.nextClause();
1587
+ return;
1588
+ }
1589
+ switch (s.type) {
1590
+ case t.QueryLexer.TERM:
1591
+ return e.nextClause(), t.QueryParser.parseTerm;
1592
+ case t.QueryLexer.FIELD:
1593
+ return e.nextClause(), t.QueryParser.parseField;
1594
+ case t.QueryLexer.EDIT_DISTANCE:
1595
+ return t.QueryParser.parseEditDistance;
1596
+ case t.QueryLexer.BOOST:
1597
+ return t.QueryParser.parseBoost;
1598
+ case t.QueryLexer.PRESENCE:
1599
+ return e.nextClause(), t.QueryParser.parsePresence;
1600
+ default:
1601
+ var i = "Unexpected lexeme type '" + s.type + "'";
1602
+ throw new t.QueryParseError(i, s.start, s.end);
1603
+ }
1604
+ }
1605
+ }),
1606
+ (t.QueryParser.parseBoost = function (e) {
1607
+ var n = e.consumeLexeme();
1608
+ if (n != null) {
1609
+ var r = parseInt(n.str, 10);
1610
+ if (isNaN(r)) {
1611
+ var i = "boost must be numeric";
1612
+ throw new t.QueryParseError(i, n.start, n.end);
1613
+ }
1614
+ e.currentClause.boost = r;
1615
+ var s = e.peekLexeme();
1616
+ if (s == null) {
1617
+ e.nextClause();
1618
+ return;
1619
+ }
1620
+ switch (s.type) {
1621
+ case t.QueryLexer.TERM:
1622
+ return e.nextClause(), t.QueryParser.parseTerm;
1623
+ case t.QueryLexer.FIELD:
1624
+ return e.nextClause(), t.QueryParser.parseField;
1625
+ case t.QueryLexer.EDIT_DISTANCE:
1626
+ return t.QueryParser.parseEditDistance;
1627
+ case t.QueryLexer.BOOST:
1628
+ return t.QueryParser.parseBoost;
1629
+ case t.QueryLexer.PRESENCE:
1630
+ return e.nextClause(), t.QueryParser.parsePresence;
1631
+ default:
1632
+ var i = "Unexpected lexeme type '" + s.type + "'";
1633
+ throw new t.QueryParseError(i, s.start, s.end);
1634
+ }
1635
+ }
1636
+ }),
1637
+ (function (e, n) {
1638
+ typeof define == "function" && define.amd
1639
+ ? define(n)
1640
+ : typeof ae == "object"
1641
+ ? (le.exports = n())
1642
+ : (e.lunr = n());
1643
+ })(this, function () {
1644
+ return t;
1645
+ });
1646
+ })();
1647
+ });
1648
+ var se = [];
1649
+ function G(t, e) {
1650
+ se.push({ selector: e, constructor: t });
1651
+ }
1652
+ var U = class {
1653
+ constructor() {
1654
+ this.alwaysVisibleMember = null;
1655
+ this.createComponents(document.body),
1656
+ this.ensureFocusedElementVisible(),
1657
+ this.listenForCodeCopies(),
1658
+ window.addEventListener("hashchange", () =>
1659
+ this.ensureFocusedElementVisible(),
1660
+ ),
1661
+ document.body.style.display ||
1662
+ (this.ensureFocusedElementVisible(),
1663
+ this.updateIndexVisibility(),
1664
+ this.scrollToHash());
1665
+ }
1666
+ createComponents(e) {
1667
+ se.forEach((n) => {
1668
+ e.querySelectorAll(n.selector).forEach((r) => {
1669
+ r.dataset.hasInstance ||
1670
+ (new n.constructor({ el: r, app: this }),
1671
+ (r.dataset.hasInstance = String(!0)));
1672
+ });
1673
+ });
1674
+ }
1675
+ filterChanged() {
1676
+ this.ensureFocusedElementVisible();
1677
+ }
1678
+ showPage() {
1679
+ document.body.style.display &&
1680
+ (document.body.style.removeProperty("display"),
1681
+ this.ensureFocusedElementVisible(),
1682
+ this.updateIndexVisibility(),
1683
+ this.scrollToHash());
1684
+ }
1685
+ scrollToHash() {
1686
+ if (location.hash) {
1687
+ let e = document.getElementById(location.hash.substring(1));
1688
+ if (!e) return;
1689
+ e.scrollIntoView({ behavior: "instant", block: "start" });
1690
+ }
1691
+ }
1692
+ ensureActivePageVisible() {
1693
+ let e = document.querySelector(".tsd-navigation .current"),
1694
+ n = e?.parentElement;
1695
+ for (; n && !n.classList.contains(".tsd-navigation"); )
1696
+ n instanceof HTMLDetailsElement && (n.open = !0), (n = n.parentElement);
1697
+ if (e && !Ve(e)) {
1698
+ let r =
1699
+ e.getBoundingClientRect().top -
1700
+ document.documentElement.clientHeight / 4;
1701
+ (document.querySelector(".site-menu").scrollTop = r),
1702
+ (document.querySelector(".col-sidebar").scrollTop = r);
1703
+ }
1704
+ }
1705
+ updateIndexVisibility() {
1706
+ let e = document.querySelector(".tsd-index-content"),
1707
+ n = e?.open;
1708
+ e && (e.open = !0),
1709
+ document.querySelectorAll(".tsd-index-section").forEach((r) => {
1710
+ r.style.display = "block";
1711
+ let i = Array.from(r.querySelectorAll(".tsd-index-link")).every(
1712
+ (s) => s.offsetParent == null,
1713
+ );
1714
+ r.style.display = i ? "none" : "block";
1715
+ }),
1716
+ e && (e.open = n);
1717
+ }
1718
+ ensureFocusedElementVisible() {
1719
+ if (
1720
+ (this.alwaysVisibleMember &&
1721
+ (this.alwaysVisibleMember.classList.remove("always-visible"),
1722
+ this.alwaysVisibleMember.firstElementChild.remove(),
1723
+ (this.alwaysVisibleMember = null)),
1724
+ !location.hash)
1725
+ )
1726
+ return;
1727
+ let e = document.getElementById(location.hash.substring(1));
1728
+ if (!e) return;
1729
+ let n = e.parentElement;
1730
+ for (; n && n.tagName !== "SECTION"; ) n = n.parentElement;
1731
+ if (!n) return;
1732
+ let r = n.offsetParent == null,
1733
+ i = n;
1734
+ for (; i !== document.body; )
1735
+ i instanceof HTMLDetailsElement && (i.open = !0), (i = i.parentElement);
1736
+ if (n.offsetParent == null) {
1737
+ (this.alwaysVisibleMember = n), n.classList.add("always-visible");
1738
+ let s = document.createElement("p");
1739
+ s.classList.add("warning"),
1740
+ (s.textContent = window.translations.normally_hidden),
1741
+ n.prepend(s);
1742
+ }
1743
+ r && e.scrollIntoView();
1744
+ }
1745
+ listenForCodeCopies() {
1746
+ document.querySelectorAll("pre > button").forEach((e) => {
1747
+ let n;
1748
+ e.addEventListener("click", () => {
1749
+ e.previousElementSibling instanceof HTMLElement &&
1750
+ navigator.clipboard.writeText(
1751
+ e.previousElementSibling.innerText.trim(),
1752
+ ),
1753
+ (e.textContent = window.translations.copied),
1754
+ e.classList.add("visible"),
1755
+ clearTimeout(n),
1756
+ (n = setTimeout(() => {
1757
+ e.classList.remove("visible"),
1758
+ (n = setTimeout(() => {
1759
+ e.textContent = window.translations.copy;
1760
+ }, 100));
1761
+ }, 1e3));
1762
+ });
1763
+ });
1764
+ }
1765
+ };
1766
+ function Ve(t) {
1767
+ let e = t.getBoundingClientRect(),
1768
+ n = Math.max(document.documentElement.clientHeight, window.innerHeight);
1769
+ return !(e.bottom < 0 || e.top - n >= 0);
1770
+ }
1771
+ var oe = (t, e = 100) => {
1772
+ let n;
1773
+ return () => {
1774
+ clearTimeout(n), (n = setTimeout(() => t(), e));
1775
+ };
1776
+ };
1777
+ var pe = Ae(ue());
1778
+ async function ce(t, e) {
1779
+ if (!window.searchData) return;
1780
+ let n = await fetch(window.searchData),
1781
+ r = new Blob([await n.arrayBuffer()])
1782
+ .stream()
1783
+ .pipeThrough(new DecompressionStream("gzip")),
1784
+ i = await new Response(r).json();
1785
+ (t.data = i),
1786
+ (t.index = pe.Index.load(i.index)),
1787
+ e.classList.remove("loading"),
1788
+ e.classList.add("ready");
1789
+ }
1790
+ function fe() {
1791
+ let t = document.getElementById("tsd-search");
1792
+ if (!t) return;
1793
+ let e = { base: t.dataset.base + "/" },
1794
+ n = document.getElementById("tsd-search-script");
1795
+ t.classList.add("loading"),
1796
+ n &&
1797
+ (n.addEventListener("error", () => {
1798
+ t.classList.remove("loading"), t.classList.add("failure");
1799
+ }),
1800
+ n.addEventListener("load", () => {
1801
+ ce(e, t);
1802
+ }),
1803
+ ce(e, t));
1804
+ let r = document.querySelector("#tsd-search input"),
1805
+ i = document.querySelector("#tsd-search .results");
1806
+ if (!r || !i)
1807
+ throw new Error(
1808
+ "The input field or the result list wrapper was not found",
1809
+ );
1810
+ i.addEventListener("mouseup", () => {
1811
+ te(t);
1812
+ }),
1813
+ r.addEventListener("focus", () => t.classList.add("has-focus")),
1814
+ He(t, i, r, e);
1815
+ }
1816
+ function He(t, e, n, r) {
1817
+ n.addEventListener(
1818
+ "input",
1819
+ oe(() => {
1820
+ Ne(t, e, n, r);
1821
+ }, 200),
1822
+ ),
1823
+ n.addEventListener("keydown", (i) => {
1824
+ i.key == "Enter"
1825
+ ? Be(e, t)
1826
+ : i.key == "ArrowUp"
1827
+ ? (de(e, n, -1), i.preventDefault())
1828
+ : i.key === "ArrowDown" && (de(e, n, 1), i.preventDefault());
1829
+ }),
1830
+ document.body.addEventListener("keypress", (i) => {
1831
+ i.altKey ||
1832
+ i.ctrlKey ||
1833
+ i.metaKey ||
1834
+ (!n.matches(":focus") &&
1835
+ i.key === "/" &&
1836
+ (i.preventDefault(), n.focus()));
1837
+ }),
1838
+ document.body.addEventListener("keyup", (i) => {
1839
+ t.classList.contains("has-focus") &&
1840
+ (i.key === "Escape" ||
1841
+ (!e.matches(":focus-within") && !n.matches(":focus"))) &&
1842
+ (n.blur(), te(t));
1843
+ });
1844
+ }
1845
+ function te(t) {
1846
+ t.classList.remove("has-focus");
1847
+ }
1848
+ function Ne(t, e, n, r) {
1849
+ if (!r.index || !r.data) return;
1850
+ e.textContent = "";
1851
+ let i = n.value.trim(),
1852
+ s;
1853
+ if (i) {
1854
+ let o = i
1855
+ .split(" ")
1856
+ .map((a) => (a.length ? `*${a}*` : ""))
1857
+ .join(" ");
1858
+ s = r.index.search(o);
1859
+ } else s = [];
1860
+ for (let o = 0; o < s.length; o++) {
1861
+ let a = s[o],
1862
+ l = r.data.rows[Number(a.ref)],
1863
+ u = 1;
1864
+ l.name.toLowerCase().startsWith(i.toLowerCase()) &&
1865
+ (u *= 1 + 1 / (1 + Math.abs(l.name.length - i.length))),
1866
+ (a.score *= u);
1867
+ }
1868
+ if (s.length === 0) {
1869
+ let o = document.createElement("li");
1870
+ o.classList.add("no-results");
1871
+ let a = document.createElement("span");
1872
+ (a.textContent = "No results found"), o.appendChild(a), e.appendChild(o);
1873
+ }
1874
+ s.sort((o, a) => a.score - o.score);
1875
+ for (let o = 0, a = Math.min(10, s.length); o < a; o++) {
1876
+ let l = r.data.rows[Number(s[o].ref)],
1877
+ u = `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-${l.kind}"></use></svg>`,
1878
+ d = he(l.name, i);
1879
+ globalThis.DEBUG_SEARCH_WEIGHTS &&
1880
+ (d += ` (score: ${s[o].score.toFixed(2)})`),
1881
+ l.parent &&
1882
+ (d = `<span class="parent">
1883
+ ${he(l.parent, i)}.</span>${d}`);
1884
+ let m = document.createElement("li");
1885
+ m.classList.value = l.classes ?? "";
1886
+ let p = document.createElement("a");
1887
+ (p.href = r.base + l.url),
1888
+ (p.innerHTML = u + d),
1889
+ m.append(p),
1890
+ p.addEventListener("focus", () => {
1891
+ e.querySelector(".current")?.classList.remove("current"),
1892
+ m.classList.add("current");
1893
+ }),
1894
+ e.appendChild(m);
1895
+ }
1896
+ }
1897
+ function de(t, e, n) {
1898
+ let r = t.querySelector(".current");
1899
+ if (!r)
1900
+ (r = t.querySelector(n == 1 ? "li:first-child" : "li:last-child")),
1901
+ r && r.classList.add("current");
1902
+ else {
1903
+ let i = r;
1904
+ if (n === 1)
1905
+ do i = i.nextElementSibling ?? void 0;
1906
+ while (i instanceof HTMLElement && i.offsetParent == null);
1907
+ else
1908
+ do i = i.previousElementSibling ?? void 0;
1909
+ while (i instanceof HTMLElement && i.offsetParent == null);
1910
+ i
1911
+ ? (r.classList.remove("current"), i.classList.add("current"))
1912
+ : n === -1 && (r.classList.remove("current"), e.focus());
1913
+ }
1914
+ }
1915
+ function Be(t, e) {
1916
+ let n = t.querySelector(".current");
1917
+ if ((n || (n = t.querySelector("li:first-child")), n)) {
1918
+ let r = n.querySelector("a");
1919
+ r && (window.location.href = r.href), te(e);
1920
+ }
1921
+ }
1922
+ function he(t, e) {
1923
+ if (e === "") return t;
1924
+ let n = t.toLocaleLowerCase(),
1925
+ r = e.toLocaleLowerCase(),
1926
+ i = [],
1927
+ s = 0,
1928
+ o = n.indexOf(r);
1929
+ for (; o != -1; )
1930
+ i.push(
1931
+ ee(t.substring(s, o)),
1932
+ `<b>${ee(t.substring(o, o + r.length))}</b>`,
1933
+ ),
1934
+ (s = o + r.length),
1935
+ (o = n.indexOf(r, s));
1936
+ return i.push(ee(t.substring(s))), i.join("");
1937
+ }
1938
+ var je = {
1939
+ "&": "&amp;",
1940
+ "<": "&lt;",
1941
+ ">": "&gt;",
1942
+ "'": "&#039;",
1943
+ '"': "&quot;",
1944
+ };
1945
+ function ee(t) {
1946
+ return t.replace(/[&<>"'"]/g, (e) => je[e]);
1947
+ }
1948
+ var I = class {
1949
+ constructor(e) {
1950
+ (this.el = e.el), (this.app = e.app);
1951
+ }
1952
+ };
1953
+ var F = "mousedown",
1954
+ ye = "mousemove",
1955
+ N = "mouseup",
1956
+ J = { x: 0, y: 0 },
1957
+ me = !1,
1958
+ ne = !1,
1959
+ qe = !1,
1960
+ D = !1,
1961
+ ve = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
1962
+ navigator.userAgent,
1963
+ );
1964
+ document.documentElement.classList.add(ve ? "is-mobile" : "not-mobile");
1965
+ ve &&
1966
+ "ontouchstart" in document.documentElement &&
1967
+ ((qe = !0), (F = "touchstart"), (ye = "touchmove"), (N = "touchend"));
1968
+ document.addEventListener(F, (t) => {
1969
+ (ne = !0), (D = !1);
1970
+ let e = F == "touchstart" ? t.targetTouches[0] : t;
1971
+ (J.y = e.pageY || 0), (J.x = e.pageX || 0);
1972
+ });
1973
+ document.addEventListener(ye, (t) => {
1974
+ if (ne && !D) {
1975
+ let e = F == "touchstart" ? t.targetTouches[0] : t,
1976
+ n = J.x - (e.pageX || 0),
1977
+ r = J.y - (e.pageY || 0);
1978
+ D = Math.sqrt(n * n + r * r) > 10;
1979
+ }
1980
+ });
1981
+ document.addEventListener(N, () => {
1982
+ ne = !1;
1983
+ });
1984
+ document.addEventListener("click", (t) => {
1985
+ me && (t.preventDefault(), t.stopImmediatePropagation(), (me = !1));
1986
+ });
1987
+ var X = class extends I {
1988
+ constructor(e) {
1989
+ super(e),
1990
+ (this.className = this.el.dataset.toggle || ""),
1991
+ this.el.addEventListener(N, (n) => this.onPointerUp(n)),
1992
+ this.el.addEventListener("click", (n) => n.preventDefault()),
1993
+ document.addEventListener(F, (n) => this.onDocumentPointerDown(n)),
1994
+ document.addEventListener(N, (n) => this.onDocumentPointerUp(n));
1995
+ }
1996
+ setActive(e) {
1997
+ if (this.active == e) return;
1998
+ (this.active = e),
1999
+ document.documentElement.classList.toggle("has-" + this.className, e),
2000
+ this.el.classList.toggle("active", e);
2001
+ let n = (this.active ? "to-has-" : "from-has-") + this.className;
2002
+ document.documentElement.classList.add(n),
2003
+ setTimeout(() => document.documentElement.classList.remove(n), 500);
2004
+ }
2005
+ onPointerUp(e) {
2006
+ D || (this.setActive(!0), e.preventDefault());
2007
+ }
2008
+ onDocumentPointerDown(e) {
2009
+ if (this.active) {
2010
+ if (e.target.closest(".col-sidebar, .tsd-filter-group")) return;
2011
+ this.setActive(!1);
2012
+ }
2013
+ }
2014
+ onDocumentPointerUp(e) {
2015
+ if (!D && this.active && e.target.closest(".col-sidebar")) {
2016
+ let n = e.target.closest("a");
2017
+ if (n) {
2018
+ let r = window.location.href;
2019
+ r.indexOf("#") != -1 && (r = r.substring(0, r.indexOf("#"))),
2020
+ n.href.substring(0, r.length) == r &&
2021
+ setTimeout(() => this.setActive(!1), 250);
2022
+ }
2023
+ }
2024
+ }
2025
+ };
2026
+ var re;
2027
+ try {
2028
+ re = localStorage;
2029
+ } catch {
2030
+ re = {
2031
+ getItem() {
2032
+ return null;
2033
+ },
2034
+ setItem() {},
2035
+ };
2036
+ }
2037
+ var Q = re;
2038
+ var ge = document.head.appendChild(document.createElement("style"));
2039
+ ge.dataset.for = "filters";
2040
+ var Y = class extends I {
2041
+ constructor(e) {
2042
+ super(e),
2043
+ (this.key = `filter-${this.el.name}`),
2044
+ (this.value = this.el.checked),
2045
+ this.el.addEventListener("change", () => {
2046
+ this.setLocalStorage(this.el.checked);
2047
+ }),
2048
+ this.setLocalStorage(this.fromLocalStorage()),
2049
+ (ge.innerHTML += `html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; }
2050
+ `),
2051
+ this.app.updateIndexVisibility();
2052
+ }
2053
+ fromLocalStorage() {
2054
+ let e = Q.getItem(this.key);
2055
+ return e ? e === "true" : this.el.checked;
2056
+ }
2057
+ setLocalStorage(e) {
2058
+ Q.setItem(this.key, e.toString()),
2059
+ (this.value = e),
2060
+ this.handleValueChange();
2061
+ }
2062
+ handleValueChange() {
2063
+ (this.el.checked = this.value),
2064
+ document.documentElement.classList.toggle(this.key, this.value),
2065
+ this.app.filterChanged(),
2066
+ this.app.updateIndexVisibility();
2067
+ }
2068
+ };
2069
+ var Z = class extends I {
2070
+ constructor(e) {
2071
+ super(e),
2072
+ (this.summary = this.el.querySelector(".tsd-accordion-summary")),
2073
+ (this.icon = this.summary.querySelector("svg")),
2074
+ (this.key = `tsd-accordion-${this.summary.dataset.key ?? this.summary.textContent.trim().replace(/\s+/g, "-").toLowerCase()}`);
2075
+ let n = Q.getItem(this.key);
2076
+ (this.el.open = n ? n === "true" : this.el.open),
2077
+ this.el.addEventListener("toggle", () => this.update());
2078
+ let r = this.summary.querySelector("a");
2079
+ r &&
2080
+ r.addEventListener("click", () => {
2081
+ location.assign(r.href);
2082
+ }),
2083
+ this.update();
2084
+ }
2085
+ update() {
2086
+ (this.icon.style.transform = `rotate(${this.el.open ? 0 : -90}deg)`),
2087
+ Q.setItem(this.key, this.el.open.toString());
2088
+ }
2089
+ };
2090
+ function Ee(t) {
2091
+ let e = Q.getItem("tsd-theme") || "os";
2092
+ (t.value = e),
2093
+ xe(e),
2094
+ t.addEventListener("change", () => {
2095
+ Q.setItem("tsd-theme", t.value), xe(t.value);
2096
+ });
2097
+ }
2098
+ function xe(t) {
2099
+ document.documentElement.dataset.theme = t;
2100
+ }
2101
+ var K;
2102
+ function we() {
2103
+ let t = document.getElementById("tsd-nav-script");
2104
+ t && (t.addEventListener("load", Le), Le());
2105
+ }
2106
+ async function Le() {
2107
+ let t = document.getElementById("tsd-nav-container");
2108
+ if (!t || !window.navigationData) return;
2109
+ let n = await (await fetch(window.navigationData)).arrayBuffer(),
2110
+ r = new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),
2111
+ i = await new Response(r).json();
2112
+ (K = t.dataset.base), K.endsWith("/") || (K += "/"), (t.innerHTML = "");
2113
+ for (let s of i) Se(s, t, []);
2114
+ window.app.createComponents(t),
2115
+ window.app.showPage(),
2116
+ window.app.ensureActivePageVisible();
2117
+ }
2118
+ function Se(t, e, n) {
2119
+ let r = e.appendChild(document.createElement("li"));
2120
+ if (t.children) {
2121
+ let i = [...n, t.text],
2122
+ s = r.appendChild(document.createElement("details"));
2123
+ s.className = t.class ? `${t.class} tsd-accordion` : "tsd-accordion";
2124
+ let o = s.appendChild(document.createElement("summary"));
2125
+ (o.className = "tsd-accordion-summary"),
2126
+ (o.dataset.key = i.join("$")),
2127
+ (o.innerHTML =
2128
+ '<svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>'),
2129
+ be(t, o);
2130
+ let a = s.appendChild(document.createElement("div"));
2131
+ a.className = "tsd-accordion-details";
2132
+ let l = a.appendChild(document.createElement("ul"));
2133
+ l.className = "tsd-nested-navigation";
2134
+ for (let u of t.children) Se(u, l, i);
2135
+ } else be(t, r, t.class);
2136
+ }
2137
+ function be(t, e, n) {
2138
+ if (t.path) {
2139
+ let r = e.appendChild(document.createElement("a"));
2140
+ (r.href = K + t.path),
2141
+ n && (r.className = n),
2142
+ location.pathname === r.pathname &&
2143
+ !r.href.includes("#") &&
2144
+ r.classList.add("current"),
2145
+ t.kind &&
2146
+ (r.innerHTML = `<svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-${t.kind}"></use></svg>`),
2147
+ (r.appendChild(document.createElement("span")).textContent = t.text);
2148
+ } else {
2149
+ let r = e.appendChild(document.createElement("span"));
2150
+ (r.innerHTML =
2151
+ '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" class="tsd-kind-icon"><use href="#icon-folder"></use></svg>'),
2152
+ (r.appendChild(document.createElement("span")).textContent = t.text);
2153
+ }
2154
+ }
2155
+ G(X, "a[data-toggle]");
2156
+ G(Z, ".tsd-accordion");
2157
+ G(Y, ".tsd-filter-item input[type=checkbox]");
2158
+ var Te = document.getElementById("tsd-theme");
2159
+ Te && Ee(Te);
2160
+ var $e = new U();
2161
+ Object.defineProperty(window, "app", { value: $e });
2162
+ fe();
2163
+ we();
2164
+ })();
2165
+ /*! Bundled license information:
2166
+
2167
+ lunr/lunr.js:
2168
+ (**
2169
+ * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9
2170
+ * Copyright (C) 2020 Oliver Nightingale
2171
+ * @license MIT
2172
+ *)
2173
+ (*!
2174
+ * lunr.utils
2175
+ * Copyright (C) 2020 Oliver Nightingale
2176
+ *)
2177
+ (*!
2178
+ * lunr.Set
2179
+ * Copyright (C) 2020 Oliver Nightingale
2180
+ *)
2181
+ (*!
2182
+ * lunr.tokenizer
2183
+ * Copyright (C) 2020 Oliver Nightingale
2184
+ *)
2185
+ (*!
2186
+ * lunr.Pipeline
2187
+ * Copyright (C) 2020 Oliver Nightingale
2188
+ *)
2189
+ (*!
2190
+ * lunr.Vector
2191
+ * Copyright (C) 2020 Oliver Nightingale
2192
+ *)
2193
+ (*!
2194
+ * lunr.stemmer
2195
+ * Copyright (C) 2020 Oliver Nightingale
2196
+ * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
2197
+ *)
2198
+ (*!
2199
+ * lunr.stopWordFilter
2200
+ * Copyright (C) 2020 Oliver Nightingale
2201
+ *)
2202
+ (*!
2203
+ * lunr.trimmer
2204
+ * Copyright (C) 2020 Oliver Nightingale
2205
+ *)
2206
+ (*!
2207
+ * lunr.TokenSet
2208
+ * Copyright (C) 2020 Oliver Nightingale
2209
+ *)
2210
+ (*!
2211
+ * lunr.Index
2212
+ * Copyright (C) 2020 Oliver Nightingale
2213
+ *)
2214
+ (*!
2215
+ * lunr.Builder
2216
+ * Copyright (C) 2020 Oliver Nightingale
2217
+ *)
2218
+ */