@rechargeapps/storefront-client 0.14.0 → 0.15.2
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.
- package/dist/cjs/api/bundle.js +1 -1
- package/dist/cjs/api/bundle.js.map +1 -1
- package/dist/cjs/api/charge.js +5 -0
- package/dist/cjs/api/charge.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/bundle.js +1 -1
- package/dist/esm/api/bundle.js.map +1 -1
- package/dist/esm/api/charge.js +5 -1
- package/dist/esm/api/charge.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/umd/recharge-client.min.js +9 -9
- package/package.json +2 -2
package/dist/cjs/api/bundle.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var bundlingData = require('@
|
|
5
|
+
var bundlingData = require('@rechargeapps/bundling-data');
|
|
6
6
|
var request = require('../utils/request.js');
|
|
7
7
|
var options = require('../utils/options.js');
|
|
8
8
|
var cdn = require('./cdn.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sources":["../../../src/api/bundle.ts"],"sourcesContent":["import { toLineItemProperty } from '@
|
|
1
|
+
{"version":3,"file":"bundle.js","sources":["../../../src/api/bundle.ts"],"sourcesContent":["import { toLineItemProperty } from '@rechargeapps/bundling-data';\nimport { Bundle } from '../types';\nimport { shopifyAppProxyRequest } from '../utils/request';\nimport { getOptions } from '../utils/options';\nimport { getCDNBundleSettings } from './cdn';\n\nconst STORE_FRONT_MANAGER_URL = '/bundling-storefront-manager';\n\nfunction getTimestampSecondsFromClient(): number {\n /**\n * Get the current unix epoch in seconds from the client-side.\n */\n return Math.ceil(Date.now() / 1000);\n}\n\nasync function getTimestampSecondsFromServer(): Promise<number> {\n /**\n * Get the unix epoch from the server instead of using it directly from the\n * client. This must reduce even more the number of invalid Bundles.\n */\n try {\n const { timestamp } = await shopifyAppProxyRequest<{ timestamp: number }>('get', `${STORE_FRONT_MANAGER_URL}/t`, {\n headers: { 'X-Recharge-App': 'storefront-client' },\n });\n return timestamp;\n } catch (ex) {\n console.error(`Fetch failed: ${ex}. Using client-side date.`);\n return getTimestampSecondsFromClient();\n }\n}\n\nexport async function getBundleId(bundle: Bundle): Promise<string> {\n const opts = getOptions();\n const isValid = await validateBundle(bundle);\n if (!isValid) {\n throw new Error('Bundle selection is invalid.');\n }\n const timestampSeconds = await getTimestampSecondsFromServer();\n const bundleData = toLineItemProperty({\n variantId: bundle.externalVariantId,\n version: timestampSeconds,\n items: bundle.selections.map(item => {\n return {\n collectionId: item.collectionId,\n productId: item.externalProductId,\n variantId: item.externalVariantId,\n quantity: item.quantity,\n sku: '',\n };\n }),\n });\n\n try {\n const payload = await shopifyAppProxyRequest<{ id: string; code: number; message: string }>(\n 'post',\n `${STORE_FRONT_MANAGER_URL}/api/v1/bundles`,\n {\n data: {\n bundle: bundleData,\n },\n headers: {\n Origin: `https://${opts.storeIdentifier}`,\n },\n }\n );\n\n if (!payload.id || payload.code !== 200) {\n throw new Error(`1: failed generating rb_id: ${JSON.stringify(payload)}`);\n }\n\n return payload.id;\n } catch (e) {\n // Handle NetworkError exceptions\n throw new Error(`2: failed generating rb_id ${e}`);\n }\n}\n\nexport async function validateBundle(bundle: Bundle): Promise<boolean> {\n try {\n const bundleSettings = await getCDNBundleSettings(bundle.externalProductId);\n // once we implement this function, we can make it raise an exception\n // we could also have a local store relative to this function so we don't have to pass bundleProduct\n return !!bundle && !!bundleSettings;\n } catch (e) {\n console.error('Error fetching bundle settings');\n return false;\n }\n}\n"],"names":["shopifyAppProxyRequest","getOptions","toLineItemProperty","getCDNBundleSettings"],"mappings":";;;;;;;;;AAIA,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAC/D,SAAS,6BAA6B,GAAG;AACzC,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC;AACrC,CAAC;AACD,eAAe,6BAA6B,GAAG;AAC/C,EAAE,IAAI;AACN,IAAI,MAAM,EAAE,SAAS,EAAE,GAAG,MAAMA,8BAAsB,CAAC,KAAK,EAAE,CAAC,EAAE,uBAAuB,CAAC,EAAE,CAAC,EAAE;AAC9F,MAAM,OAAO,EAAE,EAAE,gBAAgB,EAAE,mBAAmB,EAAE;AACxD,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,SAAS,CAAC;AACrB,GAAG,CAAC,OAAO,EAAE,EAAE;AACf,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAClE,IAAI,OAAO,6BAA6B,EAAE,CAAC;AAC3C,GAAG;AACH,CAAC;AACM,eAAe,WAAW,CAAC,MAAM,EAAE;AAC1C,EAAE,MAAM,IAAI,GAAGC,kBAAU,EAAE,CAAC;AAC5B,EAAE,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;AAC/C,EAAE,IAAI,CAAC,OAAO,EAAE;AAChB,IAAI,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;AACpD,GAAG;AACH,EAAE,MAAM,gBAAgB,GAAG,MAAM,6BAA6B,EAAE,CAAC;AACjE,EAAE,MAAM,UAAU,GAAGC,+BAAkB,CAAC;AACxC,IAAI,SAAS,EAAE,MAAM,CAAC,iBAAiB;AACvC,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK;AAC3C,MAAM,OAAO;AACb,QAAQ,YAAY,EAAE,IAAI,CAAC,YAAY;AACvC,QAAQ,SAAS,EAAE,IAAI,CAAC,iBAAiB;AACzC,QAAQ,SAAS,EAAE,IAAI,CAAC,iBAAiB;AACzC,QAAQ,QAAQ,EAAE,IAAI,CAAC,QAAQ;AAC/B,QAAQ,GAAG,EAAE,EAAE;AACf,OAAO,CAAC;AACR,KAAK,CAAC;AACN,GAAG,CAAC,CAAC;AACL,EAAE,IAAI;AACN,IAAI,MAAM,OAAO,GAAG,MAAMF,8BAAsB,CAAC,MAAM,EAAE,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,EAAE;AACtG,MAAM,IAAI,EAAE;AACZ,QAAQ,MAAM,EAAE,UAAU;AAC1B,OAAO;AACP,MAAM,OAAO,EAAE;AACf,QAAQ,MAAM,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;AACjD,OAAO;AACP,KAAK,CAAC,CAAC;AACP,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,GAAG,EAAE;AAC7C,MAAM,MAAM,IAAI,KAAK,CAAC,CAAC,4BAA4B,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,EAAE,CAAC;AACtB,GAAG,CAAC,OAAO,CAAC,EAAE;AACd,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,GAAG;AACH,CAAC;AACM,eAAe,cAAc,CAAC,MAAM,EAAE;AAC7C,EAAE,IAAI;AACN,IAAI,MAAM,cAAc,GAAG,MAAMG,wBAAoB,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChF,IAAI,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,cAAc,CAAC;AACxC,GAAG,CAAC,OAAO,CAAC,EAAE;AACd,IAAI,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;;;;;"}
|
package/dist/cjs/api/charge.js
CHANGED
|
@@ -29,10 +29,15 @@ async function unskipCharge(session, id) {
|
|
|
29
29
|
const { charge } = await request.rechargeApiRequest("post", `/charges/${id}/unskip`, {}, session);
|
|
30
30
|
return charge;
|
|
31
31
|
}
|
|
32
|
+
async function processCharge(session, id) {
|
|
33
|
+
const { charge } = await request.rechargeApiRequest("post", `/charges/${id}/process`, {}, session);
|
|
34
|
+
return charge;
|
|
35
|
+
}
|
|
32
36
|
|
|
33
37
|
exports.applyDiscount = applyDiscount;
|
|
34
38
|
exports.getCharge = getCharge;
|
|
35
39
|
exports.listCharges = listCharges;
|
|
40
|
+
exports.processCharge = processCharge;
|
|
36
41
|
exports.removeDiscount = removeDiscount;
|
|
37
42
|
exports.skipCharge = skipCharge;
|
|
38
43
|
exports.unskipCharge = unskipCharge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charge.js","sources":["../../../src/api/charge.ts"],"sourcesContent":["import { ApplyDiscountRequest, ChargeListParams, ChargeListResponse, ChargeResponse } from '../types/charge';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/* Retrieve a Charge using the charge_id. */\nexport async function getCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('get', `/charges`, { id }, session);\n return charge;\n}\n\n/** Lists charges */\nexport function listCharges(session: Session, query?: ChargeListParams) {\n return rechargeApiRequest<ChargeListResponse>('get', `/charges`, { query }, session);\n}\n\n/**\n * You cannot add a Discount to an existing queued Charge if the Charge or the associated Address already has one.\n * You can provide either discount_id or discount_code. If both parameters are passed, the value for discount_id will take precedence.\n * If a Charge has a Discount and it gets updated, or a regeneration occurs, the Discount will be lost. Regeneration is a process that refreshes the Charge JSON with new data in the case of the Subscription or Address being updated.\n */\nexport async function applyDiscount(session: Session, id: number | string, applyRequest: ApplyDiscountRequest) {\n const { charge } = await rechargeApiRequest<ChargeResponse>(\n 'post',\n `/charges/${id}/apply_discount`,\n {\n data: applyRequest,\n },\n session\n );\n return charge;\n}\n\n/**\n * Remove a Discount from a Charge without destroying the Discount.\n * In most cases the Discount should be removed from the Address. When the Discount is removed from the Address, the Discount is also removed from any future Charges.\n * If the Discount is on the parent Address, you cannot remove it using charge_id.\n * When removing your Discount, it is preferable to pass the address_id so that the Discount stays removed if the Charge is regenerated. Only pass charge_id in edge cases in which there are two or more Charges on a parent Address and you only want to remove the Discount from one Charge.\n * If you pass both parameters, it will remove the Discount from the Address.\n */\nexport async function removeDiscount(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/remove_discount`, {}, session);\n return charge;\n}\n\n/* Skip a Charge. */\nexport async function skipCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/skip`, {}, session);\n return charge;\n}\n\n/* Unskip a Charge. */\nexport async function unskipCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/unskip`, {}, session);\n return charge;\n}\n"],"names":["rechargeApiRequest"],"mappings":";;;;;;AACO,eAAe,SAAS,CAAC,OAAO,EAAE,EAAE,EAAE;AAC7C,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAClF,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,SAAS,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE;AAC5C,EAAE,OAAOA,0BAAkB,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC;AACM,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE;AAC/D,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE;AAClD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AACrG,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,UAAU,CAAC,OAAO,EAAE,EAAE,EAAE;AAC9C,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1F,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE;AAChD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC5F,EAAE,OAAO,MAAM,CAAC;AAChB
|
|
1
|
+
{"version":3,"file":"charge.js","sources":["../../../src/api/charge.ts"],"sourcesContent":["import { ApplyDiscountRequest, ChargeListParams, ChargeListResponse, ChargeResponse } from '../types/charge';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/* Retrieve a Charge using the charge_id. */\nexport async function getCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('get', `/charges`, { id }, session);\n return charge;\n}\n\n/** Lists charges */\nexport function listCharges(session: Session, query?: ChargeListParams) {\n return rechargeApiRequest<ChargeListResponse>('get', `/charges`, { query }, session);\n}\n\n/**\n * You cannot add a Discount to an existing queued Charge if the Charge or the associated Address already has one.\n * You can provide either discount_id or discount_code. If both parameters are passed, the value for discount_id will take precedence.\n * If a Charge has a Discount and it gets updated, or a regeneration occurs, the Discount will be lost. Regeneration is a process that refreshes the Charge JSON with new data in the case of the Subscription or Address being updated.\n */\nexport async function applyDiscount(session: Session, id: number | string, applyRequest: ApplyDiscountRequest) {\n const { charge } = await rechargeApiRequest<ChargeResponse>(\n 'post',\n `/charges/${id}/apply_discount`,\n {\n data: applyRequest,\n },\n session\n );\n return charge;\n}\n\n/**\n * Remove a Discount from a Charge without destroying the Discount.\n * In most cases the Discount should be removed from the Address. When the Discount is removed from the Address, the Discount is also removed from any future Charges.\n * If the Discount is on the parent Address, you cannot remove it using charge_id.\n * When removing your Discount, it is preferable to pass the address_id so that the Discount stays removed if the Charge is regenerated. Only pass charge_id in edge cases in which there are two or more Charges on a parent Address and you only want to remove the Discount from one Charge.\n * If you pass both parameters, it will remove the Discount from the Address.\n */\nexport async function removeDiscount(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/remove_discount`, {}, session);\n return charge;\n}\n\n/* Skip a Charge. */\nexport async function skipCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/skip`, {}, session);\n return charge;\n}\n\n/* Unskip a Charge. */\nexport async function unskipCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/unskip`, {}, session);\n return charge;\n}\n\n/* Process a Charge. */\nexport async function processCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/process`, {}, session);\n return charge;\n}\n"],"names":["rechargeApiRequest"],"mappings":";;;;;;AACO,eAAe,SAAS,CAAC,OAAO,EAAE,EAAE,EAAE;AAC7C,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAClF,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,SAAS,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE;AAC5C,EAAE,OAAOA,0BAAkB,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC;AACM,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE;AAC/D,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE;AAClD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AACrG,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,UAAU,CAAC,OAAO,EAAE,EAAE,EAAE;AAC9C,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1F,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE;AAChD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC5F,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE;AACjD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC7F,EAAE,OAAO,MAAM,CAAC;AAChB;;;;;;;;;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -30,6 +30,7 @@ exports.loginShopifyAppProxy = auth.loginShopifyAppProxy;
|
|
|
30
30
|
exports.applyDiscount = charge.applyDiscount;
|
|
31
31
|
exports.getCharge = charge.getCharge;
|
|
32
32
|
exports.listCharges = charge.listCharges;
|
|
33
|
+
exports.processCharge = charge.processCharge;
|
|
33
34
|
exports.removeDiscount = charge.removeDiscount;
|
|
34
35
|
exports.skipCharge = charge.skipCharge;
|
|
35
36
|
exports.unskipCharge = charge.unskipCharge;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/esm/api/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toLineItemProperty } from '@
|
|
1
|
+
import { toLineItemProperty } from '@rechargeapps/bundling-data';
|
|
2
2
|
import { shopifyAppProxyRequest } from '../utils/request.js';
|
|
3
3
|
import { getOptions } from '../utils/options.js';
|
|
4
4
|
import { getCDNBundleSettings } from './cdn.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sources":["../../../src/api/bundle.ts"],"sourcesContent":["import { toLineItemProperty } from '@
|
|
1
|
+
{"version":3,"file":"bundle.js","sources":["../../../src/api/bundle.ts"],"sourcesContent":["import { toLineItemProperty } from '@rechargeapps/bundling-data';\nimport { Bundle } from '../types';\nimport { shopifyAppProxyRequest } from '../utils/request';\nimport { getOptions } from '../utils/options';\nimport { getCDNBundleSettings } from './cdn';\n\nconst STORE_FRONT_MANAGER_URL = '/bundling-storefront-manager';\n\nfunction getTimestampSecondsFromClient(): number {\n /**\n * Get the current unix epoch in seconds from the client-side.\n */\n return Math.ceil(Date.now() / 1000);\n}\n\nasync function getTimestampSecondsFromServer(): Promise<number> {\n /**\n * Get the unix epoch from the server instead of using it directly from the\n * client. This must reduce even more the number of invalid Bundles.\n */\n try {\n const { timestamp } = await shopifyAppProxyRequest<{ timestamp: number }>('get', `${STORE_FRONT_MANAGER_URL}/t`, {\n headers: { 'X-Recharge-App': 'storefront-client' },\n });\n return timestamp;\n } catch (ex) {\n console.error(`Fetch failed: ${ex}. Using client-side date.`);\n return getTimestampSecondsFromClient();\n }\n}\n\nexport async function getBundleId(bundle: Bundle): Promise<string> {\n const opts = getOptions();\n const isValid = await validateBundle(bundle);\n if (!isValid) {\n throw new Error('Bundle selection is invalid.');\n }\n const timestampSeconds = await getTimestampSecondsFromServer();\n const bundleData = toLineItemProperty({\n variantId: bundle.externalVariantId,\n version: timestampSeconds,\n items: bundle.selections.map(item => {\n return {\n collectionId: item.collectionId,\n productId: item.externalProductId,\n variantId: item.externalVariantId,\n quantity: item.quantity,\n sku: '',\n };\n }),\n });\n\n try {\n const payload = await shopifyAppProxyRequest<{ id: string; code: number; message: string }>(\n 'post',\n `${STORE_FRONT_MANAGER_URL}/api/v1/bundles`,\n {\n data: {\n bundle: bundleData,\n },\n headers: {\n Origin: `https://${opts.storeIdentifier}`,\n },\n }\n );\n\n if (!payload.id || payload.code !== 200) {\n throw new Error(`1: failed generating rb_id: ${JSON.stringify(payload)}`);\n }\n\n return payload.id;\n } catch (e) {\n // Handle NetworkError exceptions\n throw new Error(`2: failed generating rb_id ${e}`);\n }\n}\n\nexport async function validateBundle(bundle: Bundle): Promise<boolean> {\n try {\n const bundleSettings = await getCDNBundleSettings(bundle.externalProductId);\n // once we implement this function, we can make it raise an exception\n // we could also have a local store relative to this function so we don't have to pass bundleProduct\n return !!bundle && !!bundleSettings;\n } catch (e) {\n console.error('Error fetching bundle settings');\n return false;\n }\n}\n"],"names":[],"mappings":";;;;;AAIA,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAC/D,SAAS,6BAA6B,GAAG;AACzC,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC;AACrC,CAAC;AACD,eAAe,6BAA6B,GAAG;AAC/C,EAAE,IAAI;AACN,IAAI,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,sBAAsB,CAAC,KAAK,EAAE,CAAC,EAAE,uBAAuB,CAAC,EAAE,CAAC,EAAE;AAC9F,MAAM,OAAO,EAAE,EAAE,gBAAgB,EAAE,mBAAmB,EAAE;AACxD,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,SAAS,CAAC;AACrB,GAAG,CAAC,OAAO,EAAE,EAAE;AACf,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAClE,IAAI,OAAO,6BAA6B,EAAE,CAAC;AAC3C,GAAG;AACH,CAAC;AACM,eAAe,WAAW,CAAC,MAAM,EAAE;AAC1C,EAAE,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;AAC5B,EAAE,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;AAC/C,EAAE,IAAI,CAAC,OAAO,EAAE;AAChB,IAAI,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;AACpD,GAAG;AACH,EAAE,MAAM,gBAAgB,GAAG,MAAM,6BAA6B,EAAE,CAAC;AACjE,EAAE,MAAM,UAAU,GAAG,kBAAkB,CAAC;AACxC,IAAI,SAAS,EAAE,MAAM,CAAC,iBAAiB;AACvC,IAAI,OAAO,EAAE,gBAAgB;AAC7B,IAAI,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK;AAC3C,MAAM,OAAO;AACb,QAAQ,YAAY,EAAE,IAAI,CAAC,YAAY;AACvC,QAAQ,SAAS,EAAE,IAAI,CAAC,iBAAiB;AACzC,QAAQ,SAAS,EAAE,IAAI,CAAC,iBAAiB;AACzC,QAAQ,QAAQ,EAAE,IAAI,CAAC,QAAQ;AAC/B,QAAQ,GAAG,EAAE,EAAE;AACf,OAAO,CAAC;AACR,KAAK,CAAC;AACN,GAAG,CAAC,CAAC;AACL,EAAE,IAAI;AACN,IAAI,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,MAAM,EAAE,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,EAAE;AACtG,MAAM,IAAI,EAAE;AACZ,QAAQ,MAAM,EAAE,UAAU;AAC1B,OAAO;AACP,MAAM,OAAO,EAAE;AACf,QAAQ,MAAM,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;AACjD,OAAO;AACP,KAAK,CAAC,CAAC;AACP,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,GAAG,EAAE;AAC7C,MAAM,MAAM,IAAI,KAAK,CAAC,CAAC,4BAA4B,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,EAAE,CAAC;AACtB,GAAG,CAAC,OAAO,CAAC,EAAE;AACd,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,GAAG;AACH,CAAC;AACM,eAAe,cAAc,CAAC,MAAM,EAAE;AAC7C,EAAE,IAAI;AACN,IAAI,MAAM,cAAc,GAAG,MAAM,oBAAoB,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChF,IAAI,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,cAAc,CAAC;AACxC,GAAG,CAAC,OAAO,CAAC,EAAE;AACd,IAAI,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH;;;;"}
|
package/dist/esm/api/charge.js
CHANGED
|
@@ -25,6 +25,10 @@ async function unskipCharge(session, id) {
|
|
|
25
25
|
const { charge } = await rechargeApiRequest("post", `/charges/${id}/unskip`, {}, session);
|
|
26
26
|
return charge;
|
|
27
27
|
}
|
|
28
|
+
async function processCharge(session, id) {
|
|
29
|
+
const { charge } = await rechargeApiRequest("post", `/charges/${id}/process`, {}, session);
|
|
30
|
+
return charge;
|
|
31
|
+
}
|
|
28
32
|
|
|
29
|
-
export { applyDiscount, getCharge, listCharges, removeDiscount, skipCharge, unskipCharge };
|
|
33
|
+
export { applyDiscount, getCharge, listCharges, processCharge, removeDiscount, skipCharge, unskipCharge };
|
|
30
34
|
//# sourceMappingURL=charge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charge.js","sources":["../../../src/api/charge.ts"],"sourcesContent":["import { ApplyDiscountRequest, ChargeListParams, ChargeListResponse, ChargeResponse } from '../types/charge';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/* Retrieve a Charge using the charge_id. */\nexport async function getCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('get', `/charges`, { id }, session);\n return charge;\n}\n\n/** Lists charges */\nexport function listCharges(session: Session, query?: ChargeListParams) {\n return rechargeApiRequest<ChargeListResponse>('get', `/charges`, { query }, session);\n}\n\n/**\n * You cannot add a Discount to an existing queued Charge if the Charge or the associated Address already has one.\n * You can provide either discount_id or discount_code. If both parameters are passed, the value for discount_id will take precedence.\n * If a Charge has a Discount and it gets updated, or a regeneration occurs, the Discount will be lost. Regeneration is a process that refreshes the Charge JSON with new data in the case of the Subscription or Address being updated.\n */\nexport async function applyDiscount(session: Session, id: number | string, applyRequest: ApplyDiscountRequest) {\n const { charge } = await rechargeApiRequest<ChargeResponse>(\n 'post',\n `/charges/${id}/apply_discount`,\n {\n data: applyRequest,\n },\n session\n );\n return charge;\n}\n\n/**\n * Remove a Discount from a Charge without destroying the Discount.\n * In most cases the Discount should be removed from the Address. When the Discount is removed from the Address, the Discount is also removed from any future Charges.\n * If the Discount is on the parent Address, you cannot remove it using charge_id.\n * When removing your Discount, it is preferable to pass the address_id so that the Discount stays removed if the Charge is regenerated. Only pass charge_id in edge cases in which there are two or more Charges on a parent Address and you only want to remove the Discount from one Charge.\n * If you pass both parameters, it will remove the Discount from the Address.\n */\nexport async function removeDiscount(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/remove_discount`, {}, session);\n return charge;\n}\n\n/* Skip a Charge. */\nexport async function skipCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/skip`, {}, session);\n return charge;\n}\n\n/* Unskip a Charge. */\nexport async function unskipCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/unskip`, {}, session);\n return charge;\n}\n"],"names":[],"mappings":";;AACO,eAAe,SAAS,CAAC,OAAO,EAAE,EAAE,EAAE;AAC7C,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAClF,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,SAAS,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE;AAC5C,EAAE,OAAO,kBAAkB,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC;AACM,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE;AAC/D,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE;AAClD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AACrG,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,UAAU,CAAC,OAAO,EAAE,EAAE,EAAE;AAC9C,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1F,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE;AAChD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC5F,EAAE,OAAO,MAAM,CAAC;AAChB;;;;"}
|
|
1
|
+
{"version":3,"file":"charge.js","sources":["../../../src/api/charge.ts"],"sourcesContent":["import { ApplyDiscountRequest, ChargeListParams, ChargeListResponse, ChargeResponse } from '../types/charge';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/* Retrieve a Charge using the charge_id. */\nexport async function getCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('get', `/charges`, { id }, session);\n return charge;\n}\n\n/** Lists charges */\nexport function listCharges(session: Session, query?: ChargeListParams) {\n return rechargeApiRequest<ChargeListResponse>('get', `/charges`, { query }, session);\n}\n\n/**\n * You cannot add a Discount to an existing queued Charge if the Charge or the associated Address already has one.\n * You can provide either discount_id or discount_code. If both parameters are passed, the value for discount_id will take precedence.\n * If a Charge has a Discount and it gets updated, or a regeneration occurs, the Discount will be lost. Regeneration is a process that refreshes the Charge JSON with new data in the case of the Subscription or Address being updated.\n */\nexport async function applyDiscount(session: Session, id: number | string, applyRequest: ApplyDiscountRequest) {\n const { charge } = await rechargeApiRequest<ChargeResponse>(\n 'post',\n `/charges/${id}/apply_discount`,\n {\n data: applyRequest,\n },\n session\n );\n return charge;\n}\n\n/**\n * Remove a Discount from a Charge without destroying the Discount.\n * In most cases the Discount should be removed from the Address. When the Discount is removed from the Address, the Discount is also removed from any future Charges.\n * If the Discount is on the parent Address, you cannot remove it using charge_id.\n * When removing your Discount, it is preferable to pass the address_id so that the Discount stays removed if the Charge is regenerated. Only pass charge_id in edge cases in which there are two or more Charges on a parent Address and you only want to remove the Discount from one Charge.\n * If you pass both parameters, it will remove the Discount from the Address.\n */\nexport async function removeDiscount(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/remove_discount`, {}, session);\n return charge;\n}\n\n/* Skip a Charge. */\nexport async function skipCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/skip`, {}, session);\n return charge;\n}\n\n/* Unskip a Charge. */\nexport async function unskipCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/unskip`, {}, session);\n return charge;\n}\n\n/* Process a Charge. */\nexport async function processCharge(session: Session, id: number | string) {\n const { charge } = await rechargeApiRequest<ChargeResponse>('post', `/charges/${id}/process`, {}, session);\n return charge;\n}\n"],"names":[],"mappings":";;AACO,eAAe,SAAS,CAAC,OAAO,EAAE,EAAE,EAAE;AAC7C,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAClF,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,SAAS,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE;AAC5C,EAAE,OAAO,kBAAkB,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC;AACM,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE;AAC/D,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE;AAClD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AACrG,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,UAAU,CAAC,OAAO,EAAE,EAAE,EAAE;AAC9C,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1F,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE;AAChD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC5F,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC;AACM,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE;AACjD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC7F,EAAE,OAAO,MAAM,CAAC;AAChB;;;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createAddress, deleteAddress, getAddress, listAddresses, mergeAddresses, skipFutureCharge, updateAddress } from './api/address.js';
|
|
2
2
|
export { loginShopifyApi, loginShopifyAppProxy } from './api/auth.js';
|
|
3
|
-
export { applyDiscount, getCharge, listCharges, removeDiscount, skipCharge, unskipCharge } from './api/charge.js';
|
|
3
|
+
export { applyDiscount, getCharge, listCharges, processCharge, removeDiscount, skipCharge, unskipCharge } from './api/charge.js';
|
|
4
4
|
export { getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, resetCDNCache } from './api/cdn.js';
|
|
5
5
|
export { getBundleId, validateBundle } from './api/bundle.js';
|
|
6
6
|
export { activateMembership, cancelMembership, getMembership, listMemberships } from './api/membership.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -572,6 +572,7 @@ declare function applyDiscount(session: Session, id: number | string, applyReque
|
|
|
572
572
|
declare function removeDiscount(session: Session, id: number | string): Promise<Charge>;
|
|
573
573
|
declare function skipCharge(session: Session, id: number | string): Promise<Charge>;
|
|
574
574
|
declare function unskipCharge(session: Session, id: number | string): Promise<Charge>;
|
|
575
|
+
declare function processCharge(session: Session, id: number | string): Promise<Charge>;
|
|
575
576
|
|
|
576
577
|
declare type Method = 'get' | 'post' | 'put' | 'delete';
|
|
577
578
|
declare type Request = <T>(method: Method, url: string, options?: RequestOptions) => Promise<T>;
|
|
@@ -1482,4 +1483,4 @@ declare const api: {
|
|
|
1482
1483
|
};
|
|
1483
1484
|
declare function initRecharge(opt?: InitOptions): void;
|
|
1484
1485
|
|
|
1485
|
-
export { ActivateMembershipRequest, Address, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, ApplyDiscountRequest, AssociatedAddress, Bundle, BundleSelection, BundleTranslations, CDNBaseWidgetSettings, CDNBundleLayoutSettings, CDNBundleSettings, CDNBundleStep, CDNBundleStepOption, CDNBundleVariant, CDNBundleVariantOptionSource, CDNBundleVariantSelectionDefault, CDNPrices, CDNProduct, CDNProductAndSettings, CDNProductKeyObject, CDNProductOption, CDNProductOptionValue, CDNProductRaw, CDNProductResource, CDNProductsAndSettings, CDNProductsAndSettingsResource, CDNSellingPlan, CDNSellingPlanAllocations, CDNSellingPlanGroup, CDNStoreSettings, CDNSubscriptionOption, CDNVariant, CDNVariantOptionValue, CDNWidgetSettings, CDNWidgetSettingsRaw, CDNWidgetSettingsResource, CRUDRequestOptions, CancelMembershipRequest, CancelSubscriptionRequest, ChannelSettings, Charge, ChargeListParams, ChargeListResponse, ChargeResponse, ChargeSortBy, ChargeStatus, ColorString, CreateAddressRequest, CreateOnetimeRequest, CreateSubscriptionRequest, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerOptionalUpdateProps, Delivery, Discount, ExternalId, ExternalTransactionId, FirstOption, GetCustomerOptions, GetRequestOptions, HTMLString, InitOptions, IntervalUnit, IsoDateString, LineItem, ListParams, LoginResponse, Membership, MembershipIncludes, MembershipListParams, MembershipListResponse, MembershipResponse, MembershipStatus, MembershipsSortBy, MergeAddressesRequest, Method, Onetime, OnetimeCreateProps, OnetimeListParams, OnetimeOptionalCreateProps, OnetimeOptionalUpdateProps, OnetimeRequiredCreateProps, OnetimesResponse, OnetimesSortBy, Order, OrderListParams, OrderSortBy, OrderStatus, OrderType, OrdersResponse, PaymentDetails, PaymentMethod, PaymentMethodListParams, PaymentMethodOptionalUpdateProps, PaymentMethodSortBy, PaymentMethodStatus, PaymentMethodsResponse, PaymentType, Plan, PlanListParams, PlanSortBy, PlanType, PlansResponse, PriceAdjustmentsType, ProcessorName, ProductImage, Property, Request, RequestHeaders, RequestOptions, RequestOptionsHeaders, Session, ShippingLine, SkipFutureChargeAddressRequest, SkipFutureChargeAddressResponse, StorefrontEnvironment, StorefrontOptions, StorefrontPurchaseOption, SubType, Subscription, SubscriptionListParams, SubscriptionOptionalCreateProps, SubscriptionOptionalUpdateProps, SubscriptionPreferences, SubscriptionRequiredCreateProps, SubscriptionSortBy, SubscriptionsResponse, TaxLine, Translations, UpdateAddressRequest, UpdateCustomerRequest, UpdateOnetimeRequest, UpdatePaymentMethodRequest, UpdateSubscriptionParams, UpdateSubscriptionRequest, WidgetIconColor, WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscount, cancelMembership, cancelSubscription, createAddress, createOnetime, createSubscription, deleteAddress, deleteOnetime, getAddress, getBundleId, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCustomer, getDeliverySchedule, getMembership, getOnetime, getOrder, getPaymentMethod, getPlan, getSubscription, initRecharge, listAddresses, listCharges, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginShopifyApi, loginShopifyAppProxy, membershipIncludes, mergeAddresses, removeDiscount, resetCDNCache, skipCharge, skipFutureCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateCustomer, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, validateBundle };
|
|
1486
|
+
export { ActivateMembershipRequest, Address, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, ApplyDiscountRequest, AssociatedAddress, Bundle, BundleSelection, BundleTranslations, CDNBaseWidgetSettings, CDNBundleLayoutSettings, CDNBundleSettings, CDNBundleStep, CDNBundleStepOption, CDNBundleVariant, CDNBundleVariantOptionSource, CDNBundleVariantSelectionDefault, CDNPrices, CDNProduct, CDNProductAndSettings, CDNProductKeyObject, CDNProductOption, CDNProductOptionValue, CDNProductRaw, CDNProductResource, CDNProductsAndSettings, CDNProductsAndSettingsResource, CDNSellingPlan, CDNSellingPlanAllocations, CDNSellingPlanGroup, CDNStoreSettings, CDNSubscriptionOption, CDNVariant, CDNVariantOptionValue, CDNWidgetSettings, CDNWidgetSettingsRaw, CDNWidgetSettingsResource, CRUDRequestOptions, CancelMembershipRequest, CancelSubscriptionRequest, ChannelSettings, Charge, ChargeListParams, ChargeListResponse, ChargeResponse, ChargeSortBy, ChargeStatus, ColorString, CreateAddressRequest, CreateOnetimeRequest, CreateSubscriptionRequest, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerOptionalUpdateProps, Delivery, Discount, ExternalId, ExternalTransactionId, FirstOption, GetCustomerOptions, GetRequestOptions, HTMLString, InitOptions, IntervalUnit, IsoDateString, LineItem, ListParams, LoginResponse, Membership, MembershipIncludes, MembershipListParams, MembershipListResponse, MembershipResponse, MembershipStatus, MembershipsSortBy, MergeAddressesRequest, Method, Onetime, OnetimeCreateProps, OnetimeListParams, OnetimeOptionalCreateProps, OnetimeOptionalUpdateProps, OnetimeRequiredCreateProps, OnetimesResponse, OnetimesSortBy, Order, OrderListParams, OrderSortBy, OrderStatus, OrderType, OrdersResponse, PaymentDetails, PaymentMethod, PaymentMethodListParams, PaymentMethodOptionalUpdateProps, PaymentMethodSortBy, PaymentMethodStatus, PaymentMethodsResponse, PaymentType, Plan, PlanListParams, PlanSortBy, PlanType, PlansResponse, PriceAdjustmentsType, ProcessorName, ProductImage, Property, Request, RequestHeaders, RequestOptions, RequestOptionsHeaders, Session, ShippingLine, SkipFutureChargeAddressRequest, SkipFutureChargeAddressResponse, StorefrontEnvironment, StorefrontOptions, StorefrontPurchaseOption, SubType, Subscription, SubscriptionListParams, SubscriptionOptionalCreateProps, SubscriptionOptionalUpdateProps, SubscriptionPreferences, SubscriptionRequiredCreateProps, SubscriptionSortBy, SubscriptionsResponse, TaxLine, Translations, UpdateAddressRequest, UpdateCustomerRequest, UpdateOnetimeRequest, UpdatePaymentMethodRequest, UpdateSubscriptionParams, UpdateSubscriptionRequest, WidgetIconColor, WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscount, cancelMembership, cancelSubscription, createAddress, createOnetime, createSubscription, deleteAddress, deleteOnetime, getAddress, getBundleId, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCustomer, getDeliverySchedule, getMembership, getOnetime, getOrder, getPaymentMethod, getPlan, getSubscription, initRecharge, listAddresses, listCharges, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginShopifyApi, loginShopifyAppProxy, membershipIncludes, mergeAddresses, processCharge, removeDiscount, resetCDNCache, skipCharge, skipFutureCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateCustomer, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, validateBundle };
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* recharge-client-0.
|
|
2
|
+
* recharge-client-0.15.2.min.js
|
|
3
3
|
* Copyright (c) Recharge
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
(function(
|
|
7
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}ci.call(me.prototype);function W(r,e){if(!(this instanceof W))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new B(e.headers),this.url=e.url||"",this._initBody(r)}ci.call(W.prototype),W.prototype.clone=function(){return new W(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new B(this.headers),url:this.url})},W.error=function(){var r=new W(null,{status:0,statusText:""});return r.type="error",r};var vf=[301,302,303,307,308];W.redirect=function(r,e){if(vf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new W(null,{status:e,headers:{location:r}})};var be=j.DOMException;try{new be}catch{be=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},be.prototype=Object.create(Error.prototype),be.prototype.constructor=be}function li(r,e){return new Promise(function(t,n){var i=new me(r,e);if(i.signal&&i.signal.aborted)return n(new be("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var s={status:a.status,statusText:a.statusText,headers:df(a.getAllResponseHeaders()||"")};s.url="responseURL"in a?a.responseURL:s.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new W(c,s))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new be("Aborted","AbortError"))},0)};function f(s){try{return s===""&&j.location.href?j.location.href:s}catch{return s}}a.open(i.method,f(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(q.blob?a.responseType="blob":q.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof B)?Object.getOwnPropertyNames(e.headers).forEach(function(s){a.setRequestHeader(s,Bt(e.headers[s]))}):i.headers.forEach(function(s,c){a.setRequestHeader(c,s)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}li.polyfill=!0,j.fetch||(j.fetch=li,j.Headers=B,j.Request=me,j.Response=W),self.fetch.bind(self);var gf=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},pi=typeof Symbol<"u"&&Symbol,_f=gf,mf=function(){return typeof pi!="function"||typeof Symbol!="function"||typeof pi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_f()},bf="Function.prototype.bind called on incompatible ",Ut=Array.prototype.slice,wf=Object.prototype.toString,$f="[object Function]",Ef=function(e){var t=this;if(typeof t!="function"||wf.call(t)!==$f)throw new TypeError(bf+t);for(var n=Ut.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Ut.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Ut.call(arguments)))},o=Math.max(0,t.length-n.length),f=[],s=0;s<o;s++)f.push("$"+s);if(i=Function("binder","return function ("+f.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},Of=Ef,Ct=Function.prototype.bind||Of,Af=Ct,Sf=Af.call(Function.call,Object.prototype.hasOwnProperty),I,Re=SyntaxError,hi=Function,Me=TypeError,Lt=function(r){try{return hi('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var jt=function(){throw new Me},Tf=we?function(){try{return arguments.callee,jt}catch{try{return we(arguments,"callee").get}catch{return jt}}}():jt,Be=mf(),ce=Object.getPrototypeOf||function(r){return r.__proto__},Ne={},If=typeof Uint8Array>"u"?I:ce(Uint8Array),De={"%AggregateError%":typeof AggregateError>"u"?I:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?I:ArrayBuffer,"%ArrayIteratorPrototype%":Be?ce([][Symbol.iterator]()):I,"%AsyncFromSyncIteratorPrototype%":I,"%AsyncFunction%":Ne,"%AsyncGenerator%":Ne,"%AsyncGeneratorFunction%":Ne,"%AsyncIteratorPrototype%":Ne,"%Atomics%":typeof Atomics>"u"?I:Atomics,"%BigInt%":typeof BigInt>"u"?I:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?I:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?I:Float32Array,"%Float64Array%":typeof Float64Array>"u"?I:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?I:FinalizationRegistry,"%Function%":hi,"%GeneratorFunction%":Ne,"%Int8Array%":typeof Int8Array>"u"?I:Int8Array,"%Int16Array%":typeof Int16Array>"u"?I:Int16Array,"%Int32Array%":typeof Int32Array>"u"?I:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Be?ce(ce([][Symbol.iterator]())):I,"%JSON%":typeof JSON=="object"?JSON:I,"%Map%":typeof Map>"u"?I:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Be?I:ce(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?I:Promise,"%Proxy%":typeof Proxy>"u"?I:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?I:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?I:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Be?I:ce(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?I:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Be?ce(""[Symbol.iterator]()):I,"%Symbol%":Be?Symbol:I,"%SyntaxError%":Re,"%ThrowTypeError%":Tf,"%TypedArray%":If,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array>"u"?I:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?I:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?I:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?I:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?I:WeakMap,"%WeakRef%":typeof WeakRef>"u"?I:WeakRef,"%WeakSet%":typeof WeakSet>"u"?I:WeakSet},Pf=function r(e){var t;if(e==="%AsyncFunction%")t=Lt("async function () {}");else if(e==="%GeneratorFunction%")t=Lt("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Lt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=ce(i.prototype))}return De[e]=t,t},yi={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Qe=Ct,xr=Sf,xf=Qe.call(Function.call,Array.prototype.concat),Ff=Qe.call(Function.apply,Array.prototype.splice),di=Qe.call(Function.call,String.prototype.replace),Fr=Qe.call(Function.call,String.prototype.slice),Rf=Qe.call(Function.call,RegExp.prototype.exec),Mf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Bf=/\\(\\)?/g,Nf=function(e){var t=Fr(e,0,1),n=Fr(e,-1);if(t==="%"&&n!=="%")throw new Re("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Re("invalid intrinsic syntax, expected opening `%`");var i=[];return di(e,Mf,function(a,o,f,s){i[i.length]=f?di(s,Bf,"$1"):o||a}),i},Df=function(e,t){var n=e,i;if(xr(yi,n)&&(i=yi[n],n="%"+i[0]+"%"),xr(De,n)){var a=De[n];if(a===Ne&&(a=Pf(n)),typeof a>"u"&&!t)throw new Me("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Re("intrinsic "+e+" does not exist!")},kt=function(e,t){if(typeof e!="string"||e.length===0)throw new Me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Me('"allowMissing" argument must be a boolean');if(Rf(/^%?[^%]*%?$/,e)===null)throw new Re("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Nf(e),i=n.length>0?n[0]:"",a=Df("%"+i+"%",t),o=a.name,f=a.value,s=!1,c=a.alias;c&&(i=c[0],Ff(n,xf([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var p=n[l],d=Fr(p,0,1),_=Fr(p,-1);if((d==='"'||d==="'"||d==="`"||_==='"'||_==="'"||_==="`")&&d!==_)throw new Re("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(s=!0),i+="."+p,o="%"+i+"%",xr(De,o))f=De[o];else if(f!=null){if(!(p in f)){if(!t)throw new Me("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&l+1>=n.length){var E=we(f,p);u=!!E,u&&"get"in E&&!("originalValue"in E.get)?f=E.get:f=f[p]}else u=xr(f,p),f=f[p];u&&!s&&(De[o]=f)}}return f},vi={exports:{}};(function(r){var e=Ct,t=kt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),f=t("%Object.defineProperty%",!0),s=t("%Math.max%");if(f)try{f({},"a",{value:1})}catch{f=null}r.exports=function(u){var p=a(e,i,arguments);if(o&&f){var d=o(p,"length");d.configurable&&f(p,"length",{value:1+s(0,u.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};f?f(r.exports,"apply",{value:c}):r.exports.apply=c})(vi);var gi=kt,_i=vi.exports,Uf=_i(gi("String.prototype.indexOf")),Cf=function(e,t){var n=gi(e,!!t);return typeof n=="function"&&Uf(e,".prototype.")>-1?_i(n):n},Ue=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},z=[],G=[],Lf=typeof Uint8Array<"u"?Uint8Array:Array,qt=!1;function mi(){qt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)z[e]=r[e],G[r.charCodeAt(e)]=e;G["-".charCodeAt(0)]=62,G["_".charCodeAt(0)]=63}function jf(r){qt||mi();var e,t,n,i,a,o,f=r.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[f-2]==="="?2:r[f-1]==="="?1:0,o=new Lf(f*3/4-a),n=a>0?f-4:f;var s=0;for(e=0,t=0;e<n;e+=4,t+=3)i=G[r.charCodeAt(e)]<<18|G[r.charCodeAt(e+1)]<<12|G[r.charCodeAt(e+2)]<<6|G[r.charCodeAt(e+3)],o[s++]=i>>16&255,o[s++]=i>>8&255,o[s++]=i&255;return a===2?(i=G[r.charCodeAt(e)]<<2|G[r.charCodeAt(e+1)]>>4,o[s++]=i&255):a===1&&(i=G[r.charCodeAt(e)]<<10|G[r.charCodeAt(e+1)]<<4|G[r.charCodeAt(e+2)]>>2,o[s++]=i>>8&255,o[s++]=i&255),o}function kf(r){return z[r>>18&63]+z[r>>12&63]+z[r>>6&63]+z[r&63]}function qf(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(kf(n));return i.join("")}function bi(r){qt||mi();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,f=0,s=t-n;f<s;f+=o)a.push(qf(r,f,f+o>s?s:f+o));return n===1?(e=r[t-1],i+=z[e>>2],i+=z[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=z[e>>10],i+=z[e>>4&63],i+=z[e<<2&63],i+="="),a.push(i),a.join("")}function Rr(r,e,t,n,i){var a,o,f=i*8-n-1,s=(1<<f)-1,c=s>>1,l=-7,u=t?i-1:0,p=t?-1:1,d=r[e+u];for(u+=p,a=d&(1<<-l)-1,d>>=-l,l+=f;l>0;a=a*256+r[e+u],u+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=p,l-=8);if(a===0)a=1-c;else{if(a===s)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(d?-1:1)*o*Math.pow(2,a-n)}function wi(r,e,t,n,i,a){var o,f,s,c=a*8-i-1,l=(1<<c)-1,u=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,_=n?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),o+u>=1?e+=p/s:e+=p*Math.pow(2,1-u),e*s>=2&&(o++,s/=2),o+u>=l?(f=0,o=l):o+u>=1?(f=(e*s-1)*Math.pow(2,i),o=o+u):(f=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=f&255,d+=_,f/=256,i-=8);for(o=o<<i|f,c+=i;c>0;r[t+d]=o&255,d+=_,o/=256,c-=8);r[t+d-_]|=E*128}var Vf={}.toString,$i=Array.isArray||function(r){return Vf.call(r)=="[object Array]"};/*!
|
|
6
|
+
(function(re,Ke){typeof exports=="object"&&typeof module<"u"?module.exports=Ke():typeof define=="function"&&define.amd?define(Ke):(re=typeof globalThis<"u"?globalThis:re||self,re.recharge=Ke())})(this,function(){"use strict";var re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ke(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var j=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof j<"u"&&j,V={searchParams:"URLSearchParams"in j,iterable:"Symbol"in j&&"iterator"in Symbol,blob:"FileReader"in j&&"Blob"in j&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in j,arrayBuffer:"ArrayBuffer"in j};function ef(r){return r&&DataView.prototype.isPrototypeOf(r)}if(V.arrayBuffer)var rf=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],tf=ArrayBuffer.isView||function(r){return r&&rf.indexOf(Object.prototype.toString.call(r))>-1};function Ze(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function Rt(r){return typeof r!="string"&&(r=String(r)),r}function Mt(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return V.iterable&&(e[Symbol.iterator]=function(){return e}),e}function N(r){this.map={},r instanceof N?r.forEach(function(e,t){this.append(t,e)},this):Array.isArray(r)?r.forEach(function(e){this.append(e[0],e[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(e){this.append(e,r[e])},this)}N.prototype.append=function(r,e){r=Ze(r),e=Rt(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},N.prototype.delete=function(r){delete this.map[Ze(r)]},N.prototype.get=function(r){return r=Ze(r),this.has(r)?this.map[r]:null},N.prototype.has=function(r){return this.map.hasOwnProperty(Ze(r))},N.prototype.set=function(r,e){this.map[Ze(r)]=Rt(e)},N.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},N.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),Mt(r)},N.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),Mt(r)},N.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),Mt(r)},V.iterable&&(N.prototype[Symbol.iterator]=N.prototype.entries);function Nt(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function oi(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function nf(r){var e=new FileReader,t=oi(e);return e.readAsArrayBuffer(r),t}function af(r){var e=new FileReader,t=oi(e);return e.readAsText(r),t}function of(r){for(var e=new Uint8Array(r),t=new Array(e.length),n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return t.join("")}function ui(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function fi(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:V.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:V.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:V.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():V.arrayBuffer&&V.blob&&ef(r)?(this._bodyArrayBuffer=ui(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):V.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||tf(r))?this._bodyArrayBuffer=ui(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):V.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},V.blob&&(this.blob=function(){var r=Nt(this);if(r)return r;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var r=Nt(this);return r||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(nf)}),this.text=function(){var r=Nt(this);if(r)return r;if(this._bodyBlob)return af(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(of(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},V.formData&&(this.formData=function(){return this.text().then(sf)}),this.json=function(){return this.text().then(JSON.parse)},this}var uf=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ff(r){var e=r.toUpperCase();return uf.indexOf(e)>-1?e:r}function _e(r,e){if(!(this instanceof _e))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(r instanceof _e){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,e.headers||(this.headers=new N(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!t&&r._bodyInit!=null&&(t=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new N(e.headers)),this.method=ff(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}_e.prototype.clone=function(){return new _e(this,{body:this._bodyInit})};function sf(r){var e=new FormData;return r.trim().split("&").forEach(function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(a))}}),e}function cf(r){var e=new N,t=r.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
|
|
7
|
+
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}fi.call(_e.prototype);function W(r,e){if(!(this instanceof W))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new N(e.headers),this.url=e.url||"",this._initBody(r)}fi.call(W.prototype),W.prototype.clone=function(){return new W(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new N(this.headers),url:this.url})},W.error=function(){var r=new W(null,{status:0,statusText:""});return r.type="error",r};var lf=[301,302,303,307,308];W.redirect=function(r,e){if(lf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new W(null,{status:e,headers:{location:r}})};var me=j.DOMException;try{new me}catch{me=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},me.prototype=Object.create(Error.prototype),me.prototype.constructor=me}function si(r,e){return new Promise(function(t,n){var i=new _e(r,e);if(i.signal&&i.signal.aborted)return n(new me("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var s={status:a.status,statusText:a.statusText,headers:cf(a.getAllResponseHeaders()||"")};s.url="responseURL"in a?a.responseURL:s.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new W(c,s))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new me("Aborted","AbortError"))},0)};function f(s){try{return s===""&&j.location.href?j.location.href:s}catch{return s}}a.open(i.method,f(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(V.blob?a.responseType="blob":V.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof N)?Object.getOwnPropertyNames(e.headers).forEach(function(s){a.setRequestHeader(s,Rt(e.headers[s]))}):i.headers.forEach(function(s,c){a.setRequestHeader(c,s)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}si.polyfill=!0,j.fetch||(j.fetch=si,j.Headers=N,j.Request=_e,j.Response=W),self.fetch.bind(self);var pf=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},ci=typeof Symbol<"u"&&Symbol,hf=pf,yf=function(){return typeof ci!="function"||typeof Symbol!="function"||typeof ci("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hf()},df="Function.prototype.bind called on incompatible ",Dt=Array.prototype.slice,vf=Object.prototype.toString,gf="[object Function]",_f=function(e){var t=this;if(typeof t!="function"||vf.call(t)!==gf)throw new TypeError(df+t);for(var n=Dt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Dt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Dt.call(arguments)))},o=Math.max(0,t.length-n.length),f=[],s=0;s<o;s++)f.push("$"+s);if(i=Function("binder","return function ("+f.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},mf=_f,Bt=Function.prototype.bind||mf,bf=Bt,wf=bf.call(Function.call,Object.prototype.hasOwnProperty),x,Fe=SyntaxError,li=Function,Re=TypeError,Ut=function(r){try{return li('"use strict"; return ('+r+").constructor;")()}catch{}},be=Object.getOwnPropertyDescriptor;if(be)try{be({},"")}catch{be=null}var Ct=function(){throw new Re},$f=be?function(){try{return arguments.callee,Ct}catch{try{return be(arguments,"callee").get}catch{return Ct}}}():Ct,Me=yf(),se=Object.getPrototypeOf||function(r){return r.__proto__},Ne={},Ef=typeof Uint8Array>"u"?x:se(Uint8Array),De={"%AggregateError%":typeof AggregateError>"u"?x:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?x:ArrayBuffer,"%ArrayIteratorPrototype%":Me?se([][Symbol.iterator]()):x,"%AsyncFromSyncIteratorPrototype%":x,"%AsyncFunction%":Ne,"%AsyncGenerator%":Ne,"%AsyncGeneratorFunction%":Ne,"%AsyncIteratorPrototype%":Ne,"%Atomics%":typeof Atomics>"u"?x:Atomics,"%BigInt%":typeof BigInt>"u"?x:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?x:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?x:Float32Array,"%Float64Array%":typeof Float64Array>"u"?x:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?x:FinalizationRegistry,"%Function%":li,"%GeneratorFunction%":Ne,"%Int8Array%":typeof Int8Array>"u"?x:Int8Array,"%Int16Array%":typeof Int16Array>"u"?x:Int16Array,"%Int32Array%":typeof Int32Array>"u"?x:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Me?se(se([][Symbol.iterator]())):x,"%JSON%":typeof JSON=="object"?JSON:x,"%Map%":typeof Map>"u"?x:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Me?x:se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?x:Promise,"%Proxy%":typeof Proxy>"u"?x:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?x:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?x:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Me?x:se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?x:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Me?se(""[Symbol.iterator]()):x,"%Symbol%":Me?Symbol:x,"%SyntaxError%":Fe,"%ThrowTypeError%":$f,"%TypedArray%":Ef,"%TypeError%":Re,"%Uint8Array%":typeof Uint8Array>"u"?x:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?x:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?x:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?x:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?x:WeakMap,"%WeakRef%":typeof WeakRef>"u"?x:WeakRef,"%WeakSet%":typeof WeakSet>"u"?x:WeakSet},Af=function r(e){var t;if(e==="%AsyncFunction%")t=Ut("async function () {}");else if(e==="%GeneratorFunction%")t=Ut("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Ut("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=se(i.prototype))}return De[e]=t,t},pi={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Je=Bt,Pr=wf,Of=Je.call(Function.call,Array.prototype.concat),Sf=Je.call(Function.apply,Array.prototype.splice),hi=Je.call(Function.call,String.prototype.replace),Ir=Je.call(Function.call,String.prototype.slice),Tf=Je.call(Function.call,RegExp.prototype.exec),xf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pf=/\\(\\)?/g,If=function(e){var t=Ir(e,0,1),n=Ir(e,-1);if(t==="%"&&n!=="%")throw new Fe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Fe("invalid intrinsic syntax, expected opening `%`");var i=[];return hi(e,xf,function(a,o,f,s){i[i.length]=f?hi(s,Pf,"$1"):o||a}),i},Ff=function(e,t){var n=e,i;if(Pr(pi,n)&&(i=pi[n],n="%"+i[0]+"%"),Pr(De,n)){var a=De[n];if(a===Ne&&(a=Af(n)),typeof a>"u"&&!t)throw new Re("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Fe("intrinsic "+e+" does not exist!")},Lt=function(e,t){if(typeof e!="string"||e.length===0)throw new Re("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Re('"allowMissing" argument must be a boolean');if(Tf(/^%?[^%]*%?$/,e)===null)throw new Fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=If(e),i=n.length>0?n[0]:"",a=Ff("%"+i+"%",t),o=a.name,f=a.value,s=!1,c=a.alias;c&&(i=c[0],Sf(n,Of([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var p=n[l],d=Ir(p,0,1),_=Ir(p,-1);if((d==='"'||d==="'"||d==="`"||_==='"'||_==="'"||_==="`")&&d!==_)throw new Fe("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(s=!0),i+="."+p,o="%"+i+"%",Pr(De,o))f=De[o];else if(f!=null){if(!(p in f)){if(!t)throw new Re("base intrinsic for "+e+" exists, but the property is not available.");return}if(be&&l+1>=n.length){var E=be(f,p);u=!!E,u&&"get"in E&&!("originalValue"in E.get)?f=E.get:f=f[p]}else u=Pr(f,p),f=f[p];u&&!s&&(De[o]=f)}}return f},yi={exports:{}};(function(r){var e=Bt,t=Lt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),f=t("%Object.defineProperty%",!0),s=t("%Math.max%");if(f)try{f({},"a",{value:1})}catch{f=null}r.exports=function(u){var p=a(e,i,arguments);if(o&&f){var d=o(p,"length");d.configurable&&f(p,"length",{value:1+s(0,u.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};f?f(r.exports,"apply",{value:c}):r.exports.apply=c})(yi);var di=Lt,vi=yi.exports,Rf=vi(di("String.prototype.indexOf")),Mf=function(e,t){var n=di(e,!!t);return typeof n=="function"&&Rf(e,".prototype.")>-1?vi(n):n},Be=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},z=[],G=[],Nf=typeof Uint8Array<"u"?Uint8Array:Array,jt=!1;function gi(){jt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)z[e]=r[e],G[r.charCodeAt(e)]=e;G["-".charCodeAt(0)]=62,G["_".charCodeAt(0)]=63}function Df(r){jt||gi();var e,t,n,i,a,o,f=r.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[f-2]==="="?2:r[f-1]==="="?1:0,o=new Nf(f*3/4-a),n=a>0?f-4:f;var s=0;for(e=0,t=0;e<n;e+=4,t+=3)i=G[r.charCodeAt(e)]<<18|G[r.charCodeAt(e+1)]<<12|G[r.charCodeAt(e+2)]<<6|G[r.charCodeAt(e+3)],o[s++]=i>>16&255,o[s++]=i>>8&255,o[s++]=i&255;return a===2?(i=G[r.charCodeAt(e)]<<2|G[r.charCodeAt(e+1)]>>4,o[s++]=i&255):a===1&&(i=G[r.charCodeAt(e)]<<10|G[r.charCodeAt(e+1)]<<4|G[r.charCodeAt(e+2)]>>2,o[s++]=i>>8&255,o[s++]=i&255),o}function Bf(r){return z[r>>18&63]+z[r>>12&63]+z[r>>6&63]+z[r&63]}function Uf(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(Bf(n));return i.join("")}function _i(r){jt||gi();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,f=0,s=t-n;f<s;f+=o)a.push(Uf(r,f,f+o>s?s:f+o));return n===1?(e=r[t-1],i+=z[e>>2],i+=z[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=z[e>>10],i+=z[e>>4&63],i+=z[e<<2&63],i+="="),a.push(i),a.join("")}function Fr(r,e,t,n,i){var a,o,f=i*8-n-1,s=(1<<f)-1,c=s>>1,l=-7,u=t?i-1:0,p=t?-1:1,d=r[e+u];for(u+=p,a=d&(1<<-l)-1,d>>=-l,l+=f;l>0;a=a*256+r[e+u],u+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=p,l-=8);if(a===0)a=1-c;else{if(a===s)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(d?-1:1)*o*Math.pow(2,a-n)}function mi(r,e,t,n,i,a){var o,f,s,c=a*8-i-1,l=(1<<c)-1,u=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,_=n?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),o+u>=1?e+=p/s:e+=p*Math.pow(2,1-u),e*s>=2&&(o++,s/=2),o+u>=l?(f=0,o=l):o+u>=1?(f=(e*s-1)*Math.pow(2,i),o=o+u):(f=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=f&255,d+=_,f/=256,i-=8);for(o=o<<i|f,c+=i;c>0;r[t+d]=o&255,d+=_,o/=256,c-=8);r[t+d-_]|=E*128}var Cf={}.toString,bi=Array.isArray||function(r){return Cf.call(r)=="[object Array]"};/*!
|
|
8
8
|
* The buffer module from node.js, for the browser.
|
|
9
9
|
*
|
|
10
10
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
11
11
|
* @license MIT
|
|
12
|
-
*/var Gf=50;y.TYPED_ARRAY_SUPPORT=Ue.TYPED_ARRAY_SUPPORT!==void 0?Ue.TYPED_ARRAY_SUPPORT:!0,Mr();function Mr(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ne(r,e){if(Mr()<e)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=y.prototype):(r===null&&(r=new y(e)),r.length=e),r}function y(r,e,t){if(!y.TYPED_ARRAY_SUPPORT&&!(this instanceof y))return new y(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return Vt(this,r)}return Ei(this,r,e,t)}y.poolSize=8192,y._augment=function(r){return r.__proto__=y.prototype,r};function Ei(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?zf(r,e,t,n):typeof e=="string"?Wf(r,e,t):Xf(r,e)}y.from=function(r,e,t){return Ei(null,r,e,t)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array);function Oi(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Hf(r,e,t,n){return Oi(e),e<=0?ne(r,e):t!==void 0?typeof n=="string"?ne(r,e).fill(t,n):ne(r,e).fill(t):ne(r,e)}y.alloc=function(r,e,t){return Hf(null,r,e,t)};function Vt(r,e){if(Oi(e),r=ne(r,e<0?0:Ht(e)|0),!y.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}y.allocUnsafe=function(r){return Vt(null,r)},y.allocUnsafeSlow=function(r){return Vt(null,r)};function Wf(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!y.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=Ai(e,t)|0;r=ne(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function Gt(r,e){var t=e.length<0?0:Ht(e.length)|0;r=ne(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function zf(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),y.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=y.prototype):r=Gt(r,e),r}function Xf(r,e){if(X(e)){var t=Ht(e.length)|0;return r=ne(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||hs(e.length)?ne(r,0):Gt(r,e);if(e.type==="Buffer"&&$i(e.data))return Gt(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ht(r){if(r>=Mr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Mr().toString(16)+" bytes");return r|0}y.isBuffer=ys;function X(r){return!!(r!=null&&r._isBuffer)}y.compare=function(e,t){if(!X(e)||!X(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},y.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(e,t){if(!$i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=y.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!X(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function Ai(r,e){if(X(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Dr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Bi(r).length;default:if(n)return Dr(r).length;e=(""+e).toLowerCase(),n=!0}}y.byteLength=Ai;function Yf(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return as(this,e,t);case"utf8":case"utf-8":return Pi(this,e,t);case"ascii":return ns(this,e,t);case"latin1":case"binary":return is(this,e,t);case"base64":return rs(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return os(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}y.prototype._isBuffer=!0;function $e(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}y.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)$e(this,t,t+1);return this},y.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)$e(this,t,t+3),$e(this,t+1,t+2);return this},y.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)$e(this,t,t+7),$e(this,t+1,t+6),$e(this,t+2,t+5),$e(this,t+3,t+4);return this},y.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Pi(this,0,e):Yf.apply(this,arguments)},y.prototype.equals=function(e){if(!X(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},y.prototype.inspect=function(){var e="",t=Gf;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},y.prototype.compare=function(e,t,n,i,a){if(!X(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,f=n-t,s=Math.min(o,f),c=this.slice(i,a),l=e.slice(t,n),u=0;u<s;++u)if(c[u]!==l[u]){o=c[u],f=l[u];break}return o<f?-1:f<o?1:0};function Si(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=y.from(e,n)),X(e))return e.length===0?-1:Ti(r,e,t,n,i);if(typeof e=="number")return e=e&255,y.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Ti(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Ti(r,e,t,n,i){var a=1,o=r.length,f=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,f/=2,t/=2}function s(d,_){return a===1?d[_]:d.readUInt16BE(_*a)}var c;if(i){var l=-1;for(c=t;c<o;c++)if(s(r,c)===s(e,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===f)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+f>o&&(t=o-f),c=t;c>=0;c--){for(var u=!0,p=0;p<f;p++)if(s(r,c+p)!==s(e,p)){u=!1;break}if(u)return c}return-1}y.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},y.prototype.indexOf=function(e,t,n){return Si(this,e,t,n,!0)},y.prototype.lastIndexOf=function(e,t,n){return Si(this,e,t,n,!1)};function Kf(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var f=parseInt(e.substr(o*2,2),16);if(isNaN(f))return o;r[t+o]=f}return o}function Zf(r,e,t,n){return Ur(Dr(e,r.length-t),r,t,n)}function Ii(r,e,t,n){return Ur(ls(e),r,t,n)}function Jf(r,e,t,n){return Ii(r,e,t,n)}function Qf(r,e,t,n){return Ur(Bi(e),r,t,n)}function es(r,e,t,n){return Ur(ps(e,r.length-t),r,t,n)}y.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t;if((n===void 0||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Kf(this,e,t,n);case"utf8":case"utf-8":return Zf(this,e,t,n);case"ascii":return Ii(this,e,t,n);case"latin1":case"binary":return Jf(this,e,t,n);case"base64":return Qf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return es(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rs(r,e,t){return e===0&&t===r.length?bi(r):bi(r.slice(e,t))}function Pi(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,f=a>239?4:a>223?3:a>191?2:1;if(i+f<=t){var s,c,l,u;switch(f){case 1:a<128&&(o=a);break;case 2:s=r[i+1],(s&192)===128&&(u=(a&31)<<6|s&63,u>127&&(o=u));break;case 3:s=r[i+1],c=r[i+2],(s&192)===128&&(c&192)===128&&(u=(a&15)<<12|(s&63)<<6|c&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:s=r[i+1],c=r[i+2],l=r[i+3],(s&192)===128&&(c&192)===128&&(l&192)===128&&(u=(a&15)<<18|(s&63)<<12|(c&63)<<6|l&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,f=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=f}return ts(n)}var xi=4096;function ts(r){var e=r.length;if(e<=xi)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=xi));return t}function ns(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function is(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function as(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",a=e;a<t;++a)i+=cs(r[a]);return i}function os(r,e,t){for(var n=r.slice(e,t),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}y.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i;if(y.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=y.prototype;else{var a=t-e;i=new y(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function N(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},y.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},y.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},y.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},y.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},y.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},y.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},y.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},y.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=t,a=1,o=this[e+--i];i>0&&(a*=256);)o+=this[e+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},y.prototype.readInt8=function(e,t){return t||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},y.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},y.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},y.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},y.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},y.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),Rr(this,e,!0,23,4)},y.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),Rr(this,e,!1,23,4)},y.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),Rr(this,e,!0,52,8)},y.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),Rr(this,e,!1,52,8)};function V(r,e,t,n,i,a){if(!X(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}y.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;V(this,e,t,n,a,0)}var o=1,f=0;for(this[t]=e&255;++f<n&&(o*=256);)this[t+f]=e/o&255;return t+n},y.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;V(this,e,t,n,a,0)}var o=n-1,f=1;for(this[t+o]=e&255;--o>=0&&(f*=256);)this[t+o]=e/f&255;return t+n},y.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,1,255,0),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Br(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}y.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Br(this,e,t,!0),t+2},y.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Br(this,e,t,!1),t+2};function Nr(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}y.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Nr(this,e,t,!0),t+4},y.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Nr(this,e,t,!1),t+4},y.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);V(this,e,t,n,a-1,-a)}var o=0,f=1,s=0;for(this[t]=e&255;++o<n&&(f*=256);)e<0&&s===0&&this[t+o-1]!==0&&(s=1),this[t+o]=(e/f>>0)-s&255;return t+n},y.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);V(this,e,t,n,a-1,-a)}var o=n-1,f=1,s=0;for(this[t+o]=e&255;--o>=0&&(f*=256);)e<0&&s===0&&this[t+o+1]!==0&&(s=1),this[t+o]=(e/f>>0)-s&255;return t+n},y.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,1,127,-128),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},y.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Br(this,e,t,!0),t+2},y.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Br(this,e,t,!1),t+2},y.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Nr(this,e,t,!0),t+4},y.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Nr(this,e,t,!1),t+4};function Fi(r,e,t,n,i,a){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ri(r,e,t,n,i){return i||Fi(r,e,t,4),wi(r,e,t,n,23,4),t+4}y.prototype.writeFloatLE=function(e,t,n){return Ri(this,e,t,!0,n)},y.prototype.writeFloatBE=function(e,t,n){return Ri(this,e,t,!1,n)};function Mi(r,e,t,n,i){return i||Fi(r,e,t,8),wi(r,e,t,n,52,8),t+8}y.prototype.writeDoubleLE=function(e,t,n){return Mi(this,e,t,!0,n)},y.prototype.writeDoubleBE=function(e,t,n){return Mi(this,e,t,!1,n)},y.prototype.copy=function(e,t,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n,o;if(this===e&&n<t&&t<i)for(o=a-1;o>=0;--o)e[o+t]=this[o+n];else if(a<1e3||!y.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},y.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var a=e.charCodeAt(0);a<256&&(e=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!y.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var f=X(e)?e:Dr(new y(e,i).toString()),s=f.length;for(o=0;o<n-t;++o)this[o+t]=f[o%s]}return this};var us=/[^+\/0-9A-Za-z-_]/g;function fs(r){if(r=ss(r).replace(us,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function ss(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function cs(r){return r<16?"0"+r.toString(16):r.toString(16)}function Dr(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function ls(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function ps(r,e){for(var t,n,i,a=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,i=t%256,a.push(i),a.push(n);return a}function Bi(r){return jf(fs(r))}function Ur(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function hs(r){return r!==r}function ys(r){return r!=null&&(!!r._isBuffer||Ni(r)||ds(r))}function Ni(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function ds(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ni(r.slice(0,0))}function Di(){throw new Error("setTimeout has not been defined")}function Ui(){throw new Error("clearTimeout has not been defined")}var le=Di,pe=Ui;typeof Ue.setTimeout=="function"&&(le=setTimeout),typeof Ue.clearTimeout=="function"&&(pe=clearTimeout);function Ci(r){if(le===setTimeout)return setTimeout(r,0);if((le===Di||!le)&&setTimeout)return le=setTimeout,setTimeout(r,0);try{return le(r,0)}catch{try{return le.call(null,r,0)}catch{return le.call(this,r,0)}}}function vs(r){if(pe===clearTimeout)return clearTimeout(r);if((pe===Ui||!pe)&&clearTimeout)return pe=clearTimeout,clearTimeout(r);try{return pe(r)}catch{try{return pe.call(null,r)}catch{return pe.call(this,r)}}}var ie=[],Ce=!1,Ee,Cr=-1;function gs(){!Ce||!Ee||(Ce=!1,Ee.length?ie=Ee.concat(ie):Cr=-1,ie.length&&Li())}function Li(){if(!Ce){var r=Ci(gs);Ce=!0;for(var e=ie.length;e;){for(Ee=ie,ie=[];++Cr<e;)Ee&&Ee[Cr].run();Cr=-1,e=ie.length}Ee=null,Ce=!1,vs(r)}}function _s(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ie.push(new ji(r,e)),ie.length===1&&!Ce&&Ci(Li)}function ji(r,e){this.fun=r,this.array=e}ji.prototype.run=function(){this.fun.apply(null,this.array)};var ms="browser",bs="browser",ws=!0,$s={},Es=[],Os="",As={},Ss={},Ts={};function Oe(){}var Is=Oe,Ps=Oe,xs=Oe,Fs=Oe,Rs=Oe,Ms=Oe,Bs=Oe;function Ns(r){throw new Error("process.binding is not supported")}function Ds(){return"/"}function Us(r){throw new Error("process.chdir is not supported")}function Cs(){return 0}var Le=Ue.performance||{},Ls=Le.now||Le.mozNow||Le.msNow||Le.oNow||Le.webkitNow||function(){return new Date().getTime()};function js(r){var e=Ls.call(Le)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var ks=new Date;function qs(){var r=new Date,e=r-ks;return e/1e3}var Lr={nextTick:_s,title:ms,browser:ws,env:$s,argv:Es,version:Os,versions:As,on:Is,addListener:Ps,once:xs,off:Fs,removeListener:Rs,removeAllListeners:Ms,emit:Bs,binding:Ns,cwd:Ds,chdir:Us,umask:Cs,hrtime:js,platform:bs,release:Ss,config:Ts,uptime:qs},Wt;typeof Object.create=="function"?Wt=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Wt=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var ki=Wt,Vs=/%[sdj%]/g;function jr(r){if(!rr(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(Y(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(Vs,function(f){if(f==="%%")return"%";if(t>=i)return f;switch(f){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return f}}),o=n[t];t<i;o=n[++t])er(o)||!Ae(o)?a+=" "+o:a+=" "+Y(o);return a}function zt(r,e){if(K(Ue.process))return function(){return zt(r,e).apply(this,arguments)};if(Lr.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Lr.throwDeprecation)throw new Error(e);Lr.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var kr={},Xt;function qi(r){if(K(Xt)&&(Xt=Lr.env.NODE_DEBUG||""),r=r.toUpperCase(),!kr[r])if(new RegExp("\\b"+r+"\\b","i").test(Xt)){var e=0;kr[r]=function(){var t=jr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else kr[r]=function(){};return kr[r]}function Y(r,e){var t={seen:[],stylize:Hs};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Vr(e)?t.showHidden=e:e&&rn(t,e),K(t.showHidden)&&(t.showHidden=!1),K(t.depth)&&(t.depth=2),K(t.colors)&&(t.colors=!1),K(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Gs),qr(t,r,t.depth)}Y.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Y.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Gs(r,e){var t=Y.styles[e];return t?"\x1B["+Y.colors[t][0]+"m"+r+"\x1B["+Y.colors[t][1]+"m":r}function Hs(r,e){return r}function Ws(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function qr(r,e,t){if(r.customInspect&&e&&ir(e.inspect)&&e.inspect!==Y&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return rr(n)||(n=qr(r,n,t)),n}var i=zs(r,e);if(i)return i;var a=Object.keys(e),o=Ws(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),nr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return Yt(e);if(a.length===0){if(ir(e)){var f=e.name?": "+e.name:"";return r.stylize("[Function"+f+"]","special")}if(tr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Gr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(nr(e))return Yt(e)}var s="",c=!1,l=["{","}"];if(Zt(e)&&(c=!0,l=["[","]"]),ir(e)){var u=e.name?": "+e.name:"";s=" [Function"+u+"]"}if(tr(e)&&(s=" "+RegExp.prototype.toString.call(e)),Gr(e)&&(s=" "+Date.prototype.toUTCString.call(e)),nr(e)&&(s=" "+Yt(e)),a.length===0&&(!c||e.length==0))return l[0]+s+l[1];if(t<0)return tr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var p;return c?p=Xs(r,e,t,o,a):p=a.map(function(d){return Kt(r,e,t,o,d,c)}),r.seen.pop(),Ys(p,s,l)}function zs(r,e){if(K(e))return r.stylize("undefined","undefined");if(rr(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(Jt(e))return r.stylize(""+e,"number");if(Vr(e))return r.stylize(""+e,"boolean");if(er(e))return r.stylize("null","null")}function Yt(r){return"["+Error.prototype.toString.call(r)+"]"}function Xs(r,e,t,n,i){for(var a=[],o=0,f=e.length;o<f;++o)Xi(e,String(o))?a.push(Kt(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(s){s.match(/^\d+$/)||a.push(Kt(r,e,t,n,s,!0))}),a}function Kt(r,e,t,n,i,a){var o,f,s;if(s=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},s.get?s.set?f=r.stylize("[Getter/Setter]","special"):f=r.stylize("[Getter]","special"):s.set&&(f=r.stylize("[Setter]","special")),Xi(n,i)||(o="["+i+"]"),f||(r.seen.indexOf(s.value)<0?(er(t)?f=qr(r,s.value,null):f=qr(r,s.value,t-1),f.indexOf(`
|
|
12
|
+
*/var Lf=50;y.TYPED_ARRAY_SUPPORT=Be.TYPED_ARRAY_SUPPORT!==void 0?Be.TYPED_ARRAY_SUPPORT:!0,Rr();function Rr(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function te(r,e){if(Rr()<e)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=y.prototype):(r===null&&(r=new y(e)),r.length=e),r}function y(r,e,t){if(!y.TYPED_ARRAY_SUPPORT&&!(this instanceof y))return new y(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return kt(this,r)}return wi(this,r,e,t)}y.poolSize=8192,y._augment=function(r){return r.__proto__=y.prototype,r};function wi(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Vf(r,e,t,n):typeof e=="string"?kf(r,e,t):qf(r,e)}y.from=function(r,e,t){return wi(null,r,e,t)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array);function $i(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function jf(r,e,t,n){return $i(e),e<=0?te(r,e):t!==void 0?typeof n=="string"?te(r,e).fill(t,n):te(r,e).fill(t):te(r,e)}y.alloc=function(r,e,t){return jf(null,r,e,t)};function kt(r,e){if($i(e),r=te(r,e<0?0:qt(e)|0),!y.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}y.allocUnsafe=function(r){return kt(null,r)},y.allocUnsafeSlow=function(r){return kt(null,r)};function kf(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!y.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=Ei(e,t)|0;r=te(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function Vt(r,e){var t=e.length<0?0:qt(e.length)|0;r=te(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Vf(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),y.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=y.prototype):r=Vt(r,e),r}function qf(r,e){if(X(e)){var t=qt(e.length)|0;return r=te(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||fs(e.length)?te(r,0):Vt(r,e);if(e.type==="Buffer"&&bi(e.data))return Vt(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function qt(r){if(r>=Rr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Rr().toString(16)+" bytes");return r|0}y.isBuffer=ss;function X(r){return!!(r!=null&&r._isBuffer)}y.compare=function(e,t){if(!X(e)||!X(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},y.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(e,t){if(!bi(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=y.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!X(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function Ei(r,e){if(X(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Dr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ri(r).length;default:if(n)return Dr(r).length;e=(""+e).toLowerCase(),n=!0}}y.byteLength=Ei;function Gf(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return es(this,e,t);case"utf8":case"utf-8":return Ti(this,e,t);case"ascii":return Jf(this,e,t);case"latin1":case"binary":return Qf(this,e,t);case"base64":return Kf(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rs(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}y.prototype._isBuffer=!0;function we(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}y.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)we(this,t,t+1);return this},y.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)we(this,t,t+3),we(this,t+1,t+2);return this},y.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)we(this,t,t+7),we(this,t+1,t+6),we(this,t+2,t+5),we(this,t+3,t+4);return this},y.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Ti(this,0,e):Gf.apply(this,arguments)},y.prototype.equals=function(e){if(!X(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},y.prototype.inspect=function(){var e="",t=Lf;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},y.prototype.compare=function(e,t,n,i,a){if(!X(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,f=n-t,s=Math.min(o,f),c=this.slice(i,a),l=e.slice(t,n),u=0;u<s;++u)if(c[u]!==l[u]){o=c[u],f=l[u];break}return o<f?-1:f<o?1:0};function Ai(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=y.from(e,n)),X(e))return e.length===0?-1:Oi(r,e,t,n,i);if(typeof e=="number")return e=e&255,y.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Oi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Oi(r,e,t,n,i){var a=1,o=r.length,f=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,f/=2,t/=2}function s(d,_){return a===1?d[_]:d.readUInt16BE(_*a)}var c;if(i){var l=-1;for(c=t;c<o;c++)if(s(r,c)===s(e,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===f)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+f>o&&(t=o-f),c=t;c>=0;c--){for(var u=!0,p=0;p<f;p++)if(s(r,c+p)!==s(e,p)){u=!1;break}if(u)return c}return-1}y.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},y.prototype.indexOf=function(e,t,n){return Ai(this,e,t,n,!0)},y.prototype.lastIndexOf=function(e,t,n){return Ai(this,e,t,n,!1)};function Hf(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var f=parseInt(e.substr(o*2,2),16);if(isNaN(f))return o;r[t+o]=f}return o}function Wf(r,e,t,n){return Br(Dr(e,r.length-t),r,t,n)}function Si(r,e,t,n){return Br(os(e),r,t,n)}function zf(r,e,t,n){return Si(r,e,t,n)}function Xf(r,e,t,n){return Br(Ri(e),r,t,n)}function Yf(r,e,t,n){return Br(us(e,r.length-t),r,t,n)}y.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t;if((n===void 0||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Hf(this,e,t,n);case"utf8":case"utf-8":return Wf(this,e,t,n);case"ascii":return Si(this,e,t,n);case"latin1":case"binary":return zf(this,e,t,n);case"base64":return Xf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yf(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Kf(r,e,t){return e===0&&t===r.length?_i(r):_i(r.slice(e,t))}function Ti(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,f=a>239?4:a>223?3:a>191?2:1;if(i+f<=t){var s,c,l,u;switch(f){case 1:a<128&&(o=a);break;case 2:s=r[i+1],(s&192)===128&&(u=(a&31)<<6|s&63,u>127&&(o=u));break;case 3:s=r[i+1],c=r[i+2],(s&192)===128&&(c&192)===128&&(u=(a&15)<<12|(s&63)<<6|c&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:s=r[i+1],c=r[i+2],l=r[i+3],(s&192)===128&&(c&192)===128&&(l&192)===128&&(u=(a&15)<<18|(s&63)<<12|(c&63)<<6|l&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,f=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=f}return Zf(n)}var xi=4096;function Zf(r){var e=r.length;if(e<=xi)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=xi));return t}function Jf(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function Qf(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function es(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",a=e;a<t;++a)i+=as(r[a]);return i}function rs(r,e,t){for(var n=r.slice(e,t),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}y.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i;if(y.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=y.prototype;else{var a=t-e;i=new y(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function D(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},y.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},y.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},y.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},y.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},y.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},y.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},y.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},y.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=t,a=1,o=this[e+--i];i>0&&(a*=256);)o+=this[e+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},y.prototype.readInt8=function(e,t){return t||D(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},y.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},y.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},y.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},y.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},y.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),Fr(this,e,!0,23,4)},y.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),Fr(this,e,!1,23,4)},y.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),Fr(this,e,!0,52,8)},y.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),Fr(this,e,!1,52,8)};function q(r,e,t,n,i,a){if(!X(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}y.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=1,f=0;for(this[t]=e&255;++f<n&&(o*=256);)this[t+f]=e/o&255;return t+n},y.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=n-1,f=1;for(this[t+o]=e&255;--o>=0&&(f*=256);)this[t+o]=e/f&255;return t+n},y.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,255,0),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Mr(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}y.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Mr(this,e,t,!0),t+2},y.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Mr(this,e,t,!1),t+2};function Nr(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}y.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Nr(this,e,t,!0),t+4},y.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Nr(this,e,t,!1),t+4},y.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=0,f=1,s=0;for(this[t]=e&255;++o<n&&(f*=256);)e<0&&s===0&&this[t+o-1]!==0&&(s=1),this[t+o]=(e/f>>0)-s&255;return t+n},y.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=n-1,f=1,s=0;for(this[t+o]=e&255;--o>=0&&(f*=256);)e<0&&s===0&&this[t+o+1]!==0&&(s=1),this[t+o]=(e/f>>0)-s&255;return t+n},y.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,127,-128),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},y.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Mr(this,e,t,!0),t+2},y.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Mr(this,e,t,!1),t+2},y.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Nr(this,e,t,!0),t+4},y.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Nr(this,e,t,!1),t+4};function Pi(r,e,t,n,i,a){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ii(r,e,t,n,i){return i||Pi(r,e,t,4),mi(r,e,t,n,23,4),t+4}y.prototype.writeFloatLE=function(e,t,n){return Ii(this,e,t,!0,n)},y.prototype.writeFloatBE=function(e,t,n){return Ii(this,e,t,!1,n)};function Fi(r,e,t,n,i){return i||Pi(r,e,t,8),mi(r,e,t,n,52,8),t+8}y.prototype.writeDoubleLE=function(e,t,n){return Fi(this,e,t,!0,n)},y.prototype.writeDoubleBE=function(e,t,n){return Fi(this,e,t,!1,n)},y.prototype.copy=function(e,t,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n,o;if(this===e&&n<t&&t<i)for(o=a-1;o>=0;--o)e[o+t]=this[o+n];else if(a<1e3||!y.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},y.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var a=e.charCodeAt(0);a<256&&(e=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!y.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var f=X(e)?e:Dr(new y(e,i).toString()),s=f.length;for(o=0;o<n-t;++o)this[o+t]=f[o%s]}return this};var ts=/[^+\/0-9A-Za-z-_]/g;function ns(r){if(r=is(r).replace(ts,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function is(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function as(r){return r<16?"0"+r.toString(16):r.toString(16)}function Dr(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function os(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function us(r,e){for(var t,n,i,a=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,i=t%256,a.push(i),a.push(n);return a}function Ri(r){return Df(ns(r))}function Br(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function fs(r){return r!==r}function ss(r){return r!=null&&(!!r._isBuffer||Mi(r)||cs(r))}function Mi(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function cs(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Mi(r.slice(0,0))}function Ni(){throw new Error("setTimeout has not been defined")}function Di(){throw new Error("clearTimeout has not been defined")}var ce=Ni,le=Di;typeof Be.setTimeout=="function"&&(ce=setTimeout),typeof Be.clearTimeout=="function"&&(le=clearTimeout);function Bi(r){if(ce===setTimeout)return setTimeout(r,0);if((ce===Ni||!ce)&&setTimeout)return ce=setTimeout,setTimeout(r,0);try{return ce(r,0)}catch{try{return ce.call(null,r,0)}catch{return ce.call(this,r,0)}}}function ls(r){if(le===clearTimeout)return clearTimeout(r);if((le===Di||!le)&&clearTimeout)return le=clearTimeout,clearTimeout(r);try{return le(r)}catch{try{return le.call(null,r)}catch{return le.call(this,r)}}}var ne=[],Ue=!1,$e,Ur=-1;function ps(){!Ue||!$e||(Ue=!1,$e.length?ne=$e.concat(ne):Ur=-1,ne.length&&Ui())}function Ui(){if(!Ue){var r=Bi(ps);Ue=!0;for(var e=ne.length;e;){for($e=ne,ne=[];++Ur<e;)$e&&$e[Ur].run();Ur=-1,e=ne.length}$e=null,Ue=!1,ls(r)}}function hs(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ne.push(new Ci(r,e)),ne.length===1&&!Ue&&Bi(Ui)}function Ci(r,e){this.fun=r,this.array=e}Ci.prototype.run=function(){this.fun.apply(null,this.array)};var ys="browser",ds="browser",vs=!0,gs={},_s=[],ms="",bs={},ws={},$s={};function Ee(){}var Es=Ee,As=Ee,Os=Ee,Ss=Ee,Ts=Ee,xs=Ee,Ps=Ee;function Is(r){throw new Error("process.binding is not supported")}function Fs(){return"/"}function Rs(r){throw new Error("process.chdir is not supported")}function Ms(){return 0}var Ce=Be.performance||{},Ns=Ce.now||Ce.mozNow||Ce.msNow||Ce.oNow||Ce.webkitNow||function(){return new Date().getTime()};function Ds(r){var e=Ns.call(Ce)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var Bs=new Date;function Us(){var r=new Date,e=r-Bs;return e/1e3}var Cr={nextTick:hs,title:ys,browser:vs,env:gs,argv:_s,version:ms,versions:bs,on:Es,addListener:As,once:Os,off:Ss,removeListener:Ts,removeAllListeners:xs,emit:Ps,binding:Is,cwd:Fs,chdir:Rs,umask:Ms,hrtime:Ds,platform:ds,release:ws,config:$s,uptime:Us},Gt;typeof Object.create=="function"?Gt=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Gt=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var Li=Gt,Cs=/%[sdj%]/g;function Lr(r){if(!er(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(Y(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(Cs,function(f){if(f==="%%")return"%";if(t>=i)return f;switch(f){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return f}}),o=n[t];t<i;o=n[++t])Qe(o)||!Ae(o)?a+=" "+o:a+=" "+Y(o);return a}function Ht(r,e){if(K(Be.process))return function(){return Ht(r,e).apply(this,arguments)};if(Cr.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Cr.throwDeprecation)throw new Error(e);Cr.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var jr={},Wt;function ji(r){if(K(Wt)&&(Wt=Cr.env.NODE_DEBUG||""),r=r.toUpperCase(),!jr[r])if(new RegExp("\\b"+r+"\\b","i").test(Wt)){var e=0;jr[r]=function(){var t=Lr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else jr[r]=function(){};return jr[r]}function Y(r,e){var t={seen:[],stylize:js};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Vr(e)?t.showHidden=e:e&&Qt(t,e),K(t.showHidden)&&(t.showHidden=!1),K(t.depth)&&(t.depth=2),K(t.colors)&&(t.colors=!1),K(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Ls),kr(t,r,t.depth)}Y.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Y.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Ls(r,e){var t=Y.styles[e];return t?"\x1B["+Y.colors[t][0]+"m"+r+"\x1B["+Y.colors[t][1]+"m":r}function js(r,e){return r}function ks(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function kr(r,e,t){if(r.customInspect&&e&&nr(e.inspect)&&e.inspect!==Y&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return er(n)||(n=kr(r,n,t)),n}var i=Vs(r,e);if(i)return i;var a=Object.keys(e),o=ks(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),tr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return zt(e);if(a.length===0){if(nr(e)){var f=e.name?": "+e.name:"";return r.stylize("[Function"+f+"]","special")}if(rr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(qr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(tr(e))return zt(e)}var s="",c=!1,l=["{","}"];if(Yt(e)&&(c=!0,l=["[","]"]),nr(e)){var u=e.name?": "+e.name:"";s=" [Function"+u+"]"}if(rr(e)&&(s=" "+RegExp.prototype.toString.call(e)),qr(e)&&(s=" "+Date.prototype.toUTCString.call(e)),tr(e)&&(s=" "+zt(e)),a.length===0&&(!c||e.length==0))return l[0]+s+l[1];if(t<0)return rr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var p;return c?p=qs(r,e,t,o,a):p=a.map(function(d){return Xt(r,e,t,o,d,c)}),r.seen.pop(),Gs(p,s,l)}function Vs(r,e){if(K(e))return r.stylize("undefined","undefined");if(er(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(Kt(e))return r.stylize(""+e,"number");if(Vr(e))return r.stylize(""+e,"boolean");if(Qe(e))return r.stylize("null","null")}function zt(r){return"["+Error.prototype.toString.call(r)+"]"}function qs(r,e,t,n,i){for(var a=[],o=0,f=e.length;o<f;++o)Wi(e,String(o))?a.push(Xt(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(s){s.match(/^\d+$/)||a.push(Xt(r,e,t,n,s,!0))}),a}function Xt(r,e,t,n,i,a){var o,f,s;if(s=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},s.get?s.set?f=r.stylize("[Getter/Setter]","special"):f=r.stylize("[Getter]","special"):s.set&&(f=r.stylize("[Setter]","special")),Wi(n,i)||(o="["+i+"]"),f||(r.seen.indexOf(s.value)<0?(Qe(t)?f=kr(r,s.value,null):f=kr(r,s.value,t-1),f.indexOf(`
|
|
13
13
|
`)>-1&&(a?f=f.split(`
|
|
14
14
|
`).map(function(c){return" "+c}).join(`
|
|
15
15
|
`).substr(2):f=`
|
|
16
16
|
`+f.split(`
|
|
17
17
|
`).map(function(c){return" "+c}).join(`
|
|
18
|
-
`))):f=r.stylize("[Circular]","special")),K(o)){if(a&&i.match(/^\d+$/))return f;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=r.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=r.stylize(o,"string"))}return o+": "+f}function
|
|
18
|
+
`))):f=r.stylize("[Circular]","special")),K(o)){if(a&&i.match(/^\d+$/))return f;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=r.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=r.stylize(o,"string"))}return o+": "+f}function Gs(r,e,t){var n=r.reduce(function(i,a){return a.indexOf(`
|
|
19
19
|
`)>=0,i+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(e===""?"":e+`
|
|
20
20
|
`)+" "+r.join(`,
|
|
21
|
-
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function Zt(r){return Array.isArray(r)}function Vr(r){return typeof r=="boolean"}function er(r){return r===null}function Vi(r){return r==null}function Jt(r){return typeof r=="number"}function rr(r){return typeof r=="string"}function Gi(r){return typeof r=="symbol"}function K(r){return r===void 0}function tr(r){return Ae(r)&&Qt(r)==="[object RegExp]"}function Ae(r){return typeof r=="object"&&r!==null}function Gr(r){return Ae(r)&&Qt(r)==="[object Date]"}function nr(r){return Ae(r)&&(Qt(r)==="[object Error]"||r instanceof Error)}function ir(r){return typeof r=="function"}function Hi(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function Wi(r){return y.isBuffer(r)}function Qt(r){return Object.prototype.toString.call(r)}function en(r){return r<10?"0"+r.toString(10):r.toString(10)}var Ks=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Zs(){var r=new Date,e=[en(r.getHours()),en(r.getMinutes()),en(r.getSeconds())].join(":");return[r.getDate(),Ks[r.getMonth()],e].join(" ")}function zi(){console.log("%s - %s",Zs(),jr.apply(null,arguments))}function rn(r,e){if(!e||!Ae(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Xi(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Js={inherits:ki,_extend:rn,log:zi,isBuffer:Wi,isPrimitive:Hi,isFunction:ir,isError:nr,isDate:Gr,isObject:Ae,isRegExp:tr,isUndefined:K,isSymbol:Gi,isString:rr,isNumber:Jt,isNullOrUndefined:Vi,isNull:er,isBoolean:Vr,isArray:Zt,inspect:Y,deprecate:zt,format:jr,debuglog:qi},Qs=Object.freeze({__proto__:null,format:jr,deprecate:zt,debuglog:qi,inspect:Y,isArray:Zt,isBoolean:Vr,isNull:er,isNullOrUndefined:Vi,isNumber:Jt,isString:rr,isSymbol:Gi,isUndefined:K,isRegExp:tr,isObject:Ae,isDate:Gr,isError:nr,isFunction:ir,isPrimitive:Hi,isBuffer:Wi,log:zi,inherits:ki,_extend:rn,default:Js}),ec=Ze(Qs),rc=ec.inspect,tn=typeof Map=="function"&&Map.prototype,nn=Object.getOwnPropertyDescriptor&&tn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Hr=tn&&nn&&typeof nn.get=="function"?nn.get:null,tc=tn&&Map.prototype.forEach,an=typeof Set=="function"&&Set.prototype,on=Object.getOwnPropertyDescriptor&&an?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Wr=an&&on&&typeof on.get=="function"?on.get:null,nc=an&&Set.prototype.forEach,ic=typeof WeakMap=="function"&&WeakMap.prototype,ar=ic?WeakMap.prototype.has:null,ac=typeof WeakSet=="function"&&WeakSet.prototype,or=ac?WeakSet.prototype.has:null,oc=typeof WeakRef=="function"&&WeakRef.prototype,Yi=oc?WeakRef.prototype.deref:null,uc=Boolean.prototype.valueOf,fc=Object.prototype.toString,sc=Function.prototype.toString,cc=String.prototype.match,un=String.prototype.slice,he=String.prototype.replace,lc=String.prototype.toUpperCase,Ki=String.prototype.toLowerCase,Zi=RegExp.prototype.test,Ji=Array.prototype.concat,Z=Array.prototype.join,pc=Array.prototype.slice,Qi=Math.floor,fn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,sn=Object.getOwnPropertySymbols,cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,je=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===je?"object":"symbol")?Symbol.toStringTag:null,ea=Object.prototype.propertyIsEnumerable,ra=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ta(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Zi.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Qi(-r):Qi(r);if(n!==r){var i=String(n),a=un.call(e,i.length+1);return he.call(i,t,"$&_")+"."+he.call(he.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return he.call(e,t,"$&_")}var ln=rc,na=ln.custom,ia=ua(na)?na:null,hc=function r(e,t,n,i){var a=t||{};if(ye(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ye(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=ye(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ye(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ye(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return sa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var s=String(e);return f?ta(e,s):s}if(typeof e=="bigint"){var c=String(e)+"n";return f?ta(e,c):c}var l=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return pn(e)?"[Array]":"[Object]";var u=Fc(a,n);if(typeof i>"u")i=[];else if(fa(i,e)>=0)return"[Circular]";function p(re,_e,se){if(_e&&(i=pc.call(i),i.push(_e)),se){var Pr={depth:a.depth};return ye(a,"quoteStyle")&&(Pr.quoteStyle=a.quoteStyle),r(re,Pr,n+1,i)}return r(re,a,n+1,i)}if(typeof e=="function"&&!oa(e)){var d=$c(e),_=zr(e,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(_.length>0?" { "+Z.call(_,", ")+" }":"")}if(ua(e)){var E=je?he.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):cn.call(e);return typeof e=="object"&&!je?ur(E):E}if(Ic(e)){for(var $="<"+Ki.call(String(e.nodeName)),b=e.attributes||[],S=0;S<b.length;S++)$+=" "+b[S].name+"="+aa(yc(b[S].value),"double",a);return $+=">",e.childNodes&&e.childNodes.length&&($+="..."),$+="</"+Ki.call(String(e.nodeName))+">",$}if(pn(e)){if(e.length===0)return"[]";var h=zr(e,p);return u&&!xc(h)?"["+yn(h,u)+"]":"[ "+Z.call(h,", ")+" ]"}if(vc(e)){var A=zr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!ea.call(e,"cause")?"{ ["+String(e)+"] "+Z.call(Ji.call("[cause]: "+p(e.cause),A),", ")+" }":A.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Z.call(A,", ")+" }"}if(typeof e=="object"&&o){if(ia&&typeof e[ia]=="function"&&ln)return ln(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Ec(e)){var P=[];return tc.call(e,function(re,_e){P.push(p(_e,e,!0)+" => "+p(re,e))}),ca("Map",Hr.call(e),P,u)}if(Sc(e)){var R=[];return nc.call(e,function(re){R.push(p(re,e))}),ca("Set",Wr.call(e),R,u)}if(Oc(e))return hn("WeakMap");if(Tc(e))return hn("WeakSet");if(Ac(e))return hn("WeakRef");if(_c(e))return ur(p(Number(e)));if(bc(e))return ur(p(fn.call(e)));if(mc(e))return ur(uc.call(e));if(gc(e))return ur(p(String(e)));if(!dc(e)&&!oa(e)){var m=zr(e,p),v=ra?ra(e)===Object.prototype:e instanceof Object||e.constructor===Object,g=e instanceof Object?"":"null prototype",w=!v&&k&&Object(e)===e&&k in e?un.call(de(e),8,-1):g?"Object":"",O=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",L=O+(w||g?"["+Z.call(Ji.call([],w||[],g||[]),": ")+"] ":"");return m.length===0?L+"{}":u?L+"{"+yn(m,u)+"}":L+"{ "+Z.call(m,", ")+" }"}return String(e)};function aa(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function yc(r){return he.call(String(r),/"/g,""")}function pn(r){return de(r)==="[object Array]"&&(!k||!(typeof r=="object"&&k in r))}function dc(r){return de(r)==="[object Date]"&&(!k||!(typeof r=="object"&&k in r))}function oa(r){return de(r)==="[object RegExp]"&&(!k||!(typeof r=="object"&&k in r))}function vc(r){return de(r)==="[object Error]"&&(!k||!(typeof r=="object"&&k in r))}function gc(r){return de(r)==="[object String]"&&(!k||!(typeof r=="object"&&k in r))}function _c(r){return de(r)==="[object Number]"&&(!k||!(typeof r=="object"&&k in r))}function mc(r){return de(r)==="[object Boolean]"&&(!k||!(typeof r=="object"&&k in r))}function ua(r){if(je)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!cn)return!1;try{return cn.call(r),!0}catch{}return!1}function bc(r){if(!r||typeof r!="object"||!fn)return!1;try{return fn.call(r),!0}catch{}return!1}var wc=Object.prototype.hasOwnProperty||function(r){return r in this};function ye(r,e){return wc.call(r,e)}function de(r){return fc.call(r)}function $c(r){if(r.name)return r.name;var e=cc.call(sc.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function fa(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Ec(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Wr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Oc(r){if(!ar||!r||typeof r!="object")return!1;try{ar.call(r,ar);try{or.call(r,or)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Ac(r){if(!Yi||!r||typeof r!="object")return!1;try{return Yi.call(r),!0}catch{}return!1}function Sc(r){if(!Wr||!r||typeof r!="object")return!1;try{Wr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Tc(r){if(!or||!r||typeof r!="object")return!1;try{or.call(r,or);try{ar.call(r,ar)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Ic(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function sa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return sa(un.call(r,0,e.maxStringLength),e)+n}var i=he.call(he.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Pc);return aa(i,"single",e)}function Pc(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+lc.call(e.toString(16))}function ur(r){return"Object("+r+")"}function hn(r){return r+" { ? }"}function ca(r,e,t,n){var i=n?yn(t,n):Z.call(t,", ");return r+" ("+e+") {"+i+"}"}function xc(r){for(var e=0;e<r.length;e++)if(fa(r[e],`
|
|
22
|
-
`)>=0)return!1;return!0}function
|
|
21
|
+
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function Yt(r){return Array.isArray(r)}function Vr(r){return typeof r=="boolean"}function Qe(r){return r===null}function ki(r){return r==null}function Kt(r){return typeof r=="number"}function er(r){return typeof r=="string"}function Vi(r){return typeof r=="symbol"}function K(r){return r===void 0}function rr(r){return Ae(r)&&Zt(r)==="[object RegExp]"}function Ae(r){return typeof r=="object"&&r!==null}function qr(r){return Ae(r)&&Zt(r)==="[object Date]"}function tr(r){return Ae(r)&&(Zt(r)==="[object Error]"||r instanceof Error)}function nr(r){return typeof r=="function"}function qi(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function Gi(r){return y.isBuffer(r)}function Zt(r){return Object.prototype.toString.call(r)}function Jt(r){return r<10?"0"+r.toString(10):r.toString(10)}var Hs=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ws(){var r=new Date,e=[Jt(r.getHours()),Jt(r.getMinutes()),Jt(r.getSeconds())].join(":");return[r.getDate(),Hs[r.getMonth()],e].join(" ")}function Hi(){console.log("%s - %s",Ws(),Lr.apply(null,arguments))}function Qt(r,e){if(!e||!Ae(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Wi(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var zs={inherits:Li,_extend:Qt,log:Hi,isBuffer:Gi,isPrimitive:qi,isFunction:nr,isError:tr,isDate:qr,isObject:Ae,isRegExp:rr,isUndefined:K,isSymbol:Vi,isString:er,isNumber:Kt,isNullOrUndefined:ki,isNull:Qe,isBoolean:Vr,isArray:Yt,inspect:Y,deprecate:Ht,format:Lr,debuglog:ji},Xs=Object.freeze({__proto__:null,format:Lr,deprecate:Ht,debuglog:ji,inspect:Y,isArray:Yt,isBoolean:Vr,isNull:Qe,isNullOrUndefined:ki,isNumber:Kt,isString:er,isSymbol:Vi,isUndefined:K,isRegExp:rr,isObject:Ae,isDate:qr,isError:tr,isFunction:nr,isPrimitive:qi,isBuffer:Gi,log:Hi,inherits:Li,_extend:Qt,default:zs}),Ys=Ke(Xs),Ks=Ys.inspect,en=typeof Map=="function"&&Map.prototype,rn=Object.getOwnPropertyDescriptor&&en?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Gr=en&&rn&&typeof rn.get=="function"?rn.get:null,Zs=en&&Map.prototype.forEach,tn=typeof Set=="function"&&Set.prototype,nn=Object.getOwnPropertyDescriptor&&tn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=tn&&nn&&typeof nn.get=="function"?nn.get:null,Js=tn&&Set.prototype.forEach,Qs=typeof WeakMap=="function"&&WeakMap.prototype,ir=Qs?WeakMap.prototype.has:null,ec=typeof WeakSet=="function"&&WeakSet.prototype,ar=ec?WeakSet.prototype.has:null,rc=typeof WeakRef=="function"&&WeakRef.prototype,zi=rc?WeakRef.prototype.deref:null,tc=Boolean.prototype.valueOf,nc=Object.prototype.toString,ic=Function.prototype.toString,ac=String.prototype.match,an=String.prototype.slice,pe=String.prototype.replace,oc=String.prototype.toUpperCase,Xi=String.prototype.toLowerCase,Yi=RegExp.prototype.test,Ki=Array.prototype.concat,Z=Array.prototype.join,uc=Array.prototype.slice,Zi=Math.floor,on=typeof BigInt=="function"?BigInt.prototype.valueOf:null,un=Object.getOwnPropertySymbols,fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Le=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Le?"object":"symbol")?Symbol.toStringTag:null,Ji=Object.prototype.propertyIsEnumerable,Qi=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ea(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Yi.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Zi(-r):Zi(r);if(n!==r){var i=String(n),a=an.call(e,i.length+1);return pe.call(i,t,"$&_")+"."+pe.call(pe.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return pe.call(e,t,"$&_")}var sn=Ks,ra=sn.custom,ta=aa(ra)?ra:null,fc=function r(e,t,n,i){var a=t||{};if(he(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(he(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=he(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(he(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(he(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var f=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ua(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var s=String(e);return f?ea(e,s):s}if(typeof e=="bigint"){var c=String(e)+"n";return f?ea(e,c):c}var l=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return cn(e)?"[Array]":"[Object]";var u=Sc(a,n);if(typeof i>"u")i=[];else if(oa(i,e)>=0)return"[Circular]";function p(ee,ge,fe){if(ge&&(i=uc.call(i),i.push(ge)),fe){var xr={depth:a.depth};return he(a,"quoteStyle")&&(xr.quoteStyle=a.quoteStyle),r(ee,xr,n+1,i)}return r(ee,a,n+1,i)}if(typeof e=="function"&&!ia(e)){var d=gc(e),_=Wr(e,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(_.length>0?" { "+Z.call(_,", ")+" }":"")}if(aa(e)){var E=Le?pe.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):fn.call(e);return typeof e=="object"&&!Le?or(E):E}if(Ec(e)){for(var $="<"+Xi.call(String(e.nodeName)),b=e.attributes||[],S=0;S<b.length;S++)$+=" "+b[S].name+"="+na(sc(b[S].value),"double",a);return $+=">",e.childNodes&&e.childNodes.length&&($+="..."),$+="</"+Xi.call(String(e.nodeName))+">",$}if(cn(e)){if(e.length===0)return"[]";var h=Wr(e,p);return u&&!Oc(h)?"["+pn(h,u)+"]":"[ "+Z.call(h,", ")+" ]"}if(lc(e)){var O=Wr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!Ji.call(e,"cause")?"{ ["+String(e)+"] "+Z.call(Ki.call("[cause]: "+p(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Z.call(O,", ")+" }"}if(typeof e=="object"&&o){if(ta&&typeof e[ta]=="function"&&sn)return sn(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(_c(e)){var P=[];return Zs.call(e,function(ee,ge){P.push(p(ge,e,!0)+" => "+p(ee,e))}),fa("Map",Gr.call(e),P,u)}if(wc(e)){var R=[];return Js.call(e,function(ee){R.push(p(ee,e))}),fa("Set",Hr.call(e),R,u)}if(mc(e))return ln("WeakMap");if($c(e))return ln("WeakSet");if(bc(e))return ln("WeakRef");if(hc(e))return or(p(Number(e)));if(dc(e))return or(p(on.call(e)));if(yc(e))return or(tc.call(e));if(pc(e))return or(p(String(e)));if(!cc(e)&&!ia(e)){var m=Wr(e,p),v=Qi?Qi(e)===Object.prototype:e instanceof Object||e.constructor===Object,g=e instanceof Object?"":"null prototype",w=!v&&k&&Object(e)===e&&k in e?an.call(ye(e),8,-1):g?"Object":"",A=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",L=A+(w||g?"["+Z.call(Ki.call([],w||[],g||[]),": ")+"] ":"");return m.length===0?L+"{}":u?L+"{"+pn(m,u)+"}":L+"{ "+Z.call(m,", ")+" }"}return String(e)};function na(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function sc(r){return pe.call(String(r),/"/g,""")}function cn(r){return ye(r)==="[object Array]"&&(!k||!(typeof r=="object"&&k in r))}function cc(r){return ye(r)==="[object Date]"&&(!k||!(typeof r=="object"&&k in r))}function ia(r){return ye(r)==="[object RegExp]"&&(!k||!(typeof r=="object"&&k in r))}function lc(r){return ye(r)==="[object Error]"&&(!k||!(typeof r=="object"&&k in r))}function pc(r){return ye(r)==="[object String]"&&(!k||!(typeof r=="object"&&k in r))}function hc(r){return ye(r)==="[object Number]"&&(!k||!(typeof r=="object"&&k in r))}function yc(r){return ye(r)==="[object Boolean]"&&(!k||!(typeof r=="object"&&k in r))}function aa(r){if(Le)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!fn)return!1;try{return fn.call(r),!0}catch{}return!1}function dc(r){if(!r||typeof r!="object"||!on)return!1;try{return on.call(r),!0}catch{}return!1}var vc=Object.prototype.hasOwnProperty||function(r){return r in this};function he(r,e){return vc.call(r,e)}function ye(r){return nc.call(r)}function gc(r){if(r.name)return r.name;var e=ac.call(ic.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function oa(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function _c(r){if(!Gr||!r||typeof r!="object")return!1;try{Gr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function mc(r){if(!ir||!r||typeof r!="object")return!1;try{ir.call(r,ir);try{ar.call(r,ar)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function bc(r){if(!zi||!r||typeof r!="object")return!1;try{return zi.call(r),!0}catch{}return!1}function wc(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Gr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function $c(r){if(!ar||!r||typeof r!="object")return!1;try{ar.call(r,ar);try{ir.call(r,ir)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Ec(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function ua(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return ua(an.call(r,0,e.maxStringLength),e)+n}var i=pe.call(pe.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ac);return na(i,"single",e)}function Ac(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+oc.call(e.toString(16))}function or(r){return"Object("+r+")"}function ln(r){return r+" { ? }"}function fa(r,e,t,n){var i=n?pn(t,n):Z.call(t,", ");return r+" ("+e+") {"+i+"}"}function Oc(r){for(var e=0;e<r.length;e++)if(oa(r[e],`
|
|
22
|
+
`)>=0)return!1;return!0}function Sc(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=Z.call(Array(r.indent+1)," ");else return null;return{base:t,prev:Z.call(Array(e+1),t)}}function pn(r,e){if(r.length===0)return"";var t=`
|
|
23
23
|
`+e.prev+e.base;return t+Z.call(r,","+t)+`
|
|
24
|
-
`+e.prev}function zr(r,e){var t=pn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ye(r,i)?e(r[i],r):""}var a=typeof sn=="function"?sn(r):[],o;if(je){o={};for(var f=0;f<a.length;f++)o["$"+a[f]]=a[f]}for(var s in r)!ye(r,s)||t&&String(Number(s))===s&&s<r.length||je&&o["$"+s]instanceof Symbol||(Zi.call(/[^\w$]/,s)?n.push(e(s,r)+": "+e(r[s],r)):n.push(s+": "+e(r[s],r)));if(typeof sn=="function")for(var c=0;c<a.length;c++)ea.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var dn=kt,ke=Cf,Rc=hc,Mc=dn("%TypeError%"),Xr=dn("%WeakMap%",!0),Yr=dn("%Map%",!0),Bc=ke("WeakMap.prototype.get",!0),Nc=ke("WeakMap.prototype.set",!0),Dc=ke("WeakMap.prototype.has",!0),Uc=ke("Map.prototype.get",!0),Cc=ke("Map.prototype.set",!0),Lc=ke("Map.prototype.has",!0),vn=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},jc=function(r,e){var t=vn(r,e);return t&&t.value},kc=function(r,e,t){var n=vn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},qc=function(r,e){return!!vn(r,e)},Vc=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Mc("Side channel does not contain "+Rc(a))},get:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Bc(e,a)}else if(Yr){if(t)return Uc(t,a)}else if(n)return jc(n,a)},has:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Dc(e,a)}else if(Yr){if(t)return Lc(t,a)}else if(n)return qc(n,a);return!1},set:function(a,o){Xr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Xr),Nc(e,a,o)):Yr?(t||(t=new Yr),Cc(t,a,o)):(n||(n={key:{},next:null}),kc(n,a,o))}};return i},Gc=String.prototype.replace,Hc=/%20/g,gn={RFC1738:"RFC1738",RFC3986:"RFC3986"},_n={default:gn.RFC3986,formatters:{RFC1738:function(r){return Gc.call(r,Hc,"+")},RFC3986:function(r){return String(r)}},RFC1738:gn.RFC1738,RFC3986:gn.RFC3986},Wc=_n,mn=Object.prototype.hasOwnProperty,Se=Array.isArray,J=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),zc=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Se(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},la=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},Xc=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Se(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!mn.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return Se(e)&&!Se(t)&&(i=la(e,n)),Se(e)&&Se(t)?(t.forEach(function(a,o){if(mn.call(e,o)){var f=e[o];f&&typeof f=="object"&&a&&typeof a=="object"?e[o]=r(f,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var f=t[o];return mn.call(a,o)?a[o]=r(a[o],f,n):a[o]=f,a},i)},Yc=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Kc=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Zc=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var f="",s=0;s<o.length;++s){var c=o.charCodeAt(s);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Wc.RFC1738&&(c===40||c===41)){f+=o.charAt(s);continue}if(c<128){f=f+J[c];continue}if(c<2048){f=f+(J[192|c>>6]+J[128|c&63]);continue}if(c<55296||c>=57344){f=f+(J[224|c>>12]+J[128|c>>6&63]+J[128|c&63]);continue}s+=1,c=65536+((c&1023)<<10|o.charCodeAt(s)&1023),f+=J[240|c>>18]+J[128|c>>12&63]+J[128|c>>6&63]+J[128|c&63]}return f},Jc=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],f=Object.keys(o),s=0;s<f.length;++s){var c=f[s],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return zc(t),e},Qc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},el=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},rl=function(e,t){return[].concat(e,t)},tl=function(e,t){if(Se(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},pa={arrayToObject:la,assign:Yc,combine:rl,compact:Jc,decode:Kc,encode:Zc,isBuffer:el,isRegExp:Qc,maybeMap:tl,merge:Xc},ha=Vc,bn=pa,fr=_n,nl=Object.prototype.hasOwnProperty,ya={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ae=Array.isArray,il=String.prototype.split,al=Array.prototype.push,da=function(r,e){al.apply(r,ae(e)?e:[e])},ol=Date.prototype.toISOString,va=fr.default,U={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:bn.encode,encodeValuesOnly:!1,format:va,formatter:fr.formatters[va],indices:!1,serializeDate:function(e){return ol.call(e)},skipNulls:!1,strictNullHandling:!1},ul=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},wn={},fl=function r(e,t,n,i,a,o,f,s,c,l,u,p,d,_,E,$){for(var b=e,S=$,h=0,A=!1;(S=S.get(wn))!==void 0&&!A;){var P=S.get(e);if(h+=1,typeof P<"u"){if(P===h)throw new RangeError("Cyclic object value");A=!0}typeof S.get(wn)>"u"&&(h=0)}if(typeof s=="function"?b=s(t,b):b instanceof Date?b=u(b):n==="comma"&&ae(b)&&(b=bn.maybeMap(b,function(ui){return ui instanceof Date?u(ui):ui})),b===null){if(a)return f&&!_?f(t,U.encoder,E,"key",p):t;b=""}if(ul(b)||bn.isBuffer(b)){if(f){var R=_?t:f(t,U.encoder,E,"key",p);if(n==="comma"&&_){for(var m=il.call(String(b),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+d(f(m[g],U.encoder,E,"value",p));return[d(R)+(i&&ae(b)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(f(b,U.encoder,E,"value",p))]}return[d(t)+"="+d(String(b))]}var w=[];if(typeof b>"u")return w;var O;if(n==="comma"&&ae(b))O=[{value:b.length>0?b.join(",")||null:void 0}];else if(ae(s))O=s;else{var L=Object.keys(b);O=c?L.sort(c):L}for(var re=i&&ae(b)&&b.length===1?t+"[]":t,_e=0;_e<O.length;++_e){var se=O[_e],Pr=typeof se=="object"&&typeof se.value<"u"?se.value:b[se];if(!(o&&Pr===null)){var R2=ae(b)?typeof n=="function"?n(re,se):re:re+(l?"."+se:"["+se+"]");$.set(e,h);var af=ha();af.set(wn,$),da(w,r(Pr,R2,n,i,a,o,f,s,c,l,u,p,d,_,E,af))}}return w},sl=function(e){if(!e)return U;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||U.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=fr.default;if(typeof e.format<"u"){if(!nl.call(fr.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=fr.formatters[n],a=U.filter;return(typeof e.filter=="function"||ae(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:U.addQueryPrefix,allowDots:typeof e.allowDots>"u"?U.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:U.charsetSentinel,delimiter:typeof e.delimiter>"u"?U.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:U.encode,encoder:typeof e.encoder=="function"?e.encoder:U.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:U.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:U.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:U.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:U.strictNullHandling}},cl=function(r,e){var t=r,n=sl(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ae(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var f;e&&e.arrayFormat in ya?f=e.arrayFormat:e&&"indices"in e?f=e.indices?"indices":"repeat":f="indices";var s=ya[f];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=s==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=ha(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||da(o,fl(t[p],p,s,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var d=o.join(n.delimiter),_=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),d.length>0?_+d:""},qe=pa,$n=Object.prototype.hasOwnProperty,ll=Array.isArray,D={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:qe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},pl=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},ga=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},hl="utf8=%26%2310003%3B",yl="utf8=%E2%9C%93",dl=function(e,t){var n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,a),f=-1,s,c=t.charset;if(t.charsetSentinel)for(s=0;s<o.length;++s)o[s].indexOf("utf8=")===0&&(o[s]===yl?c="utf-8":o[s]===hl&&(c="iso-8859-1"),f=s,s=o.length);for(s=0;s<o.length;++s)if(s!==f){var l=o[s],u=l.indexOf("]="),p=u===-1?l.indexOf("="):u+1,d,_;p===-1?(d=t.decoder(l,D.decoder,c,"key"),_=t.strictNullHandling?null:""):(d=t.decoder(l.slice(0,p),D.decoder,c,"key"),_=qe.maybeMap(ga(l.slice(p+1),t),function(E){return t.decoder(E,D.decoder,c,"value")})),_&&t.interpretNumericEntities&&c==="iso-8859-1"&&(_=pl(_)),l.indexOf("[]=")>-1&&(_=ll(_)?[_]:_),$n.call(n,d)?n[d]=qe.combine(n[d],_):n[d]=_}return n},vl=function(r,e,t,n){for(var i=n?e:ga(e,t),a=r.length-1;a>=0;--a){var o,f=r[a];if(f==="[]"&&t.parseArrays)o=[].concat(i);else{o=t.plainObjects?Object.create(null):{};var s=f.charAt(0)==="["&&f.charAt(f.length-1)==="]"?f.slice(1,-1):f,c=parseInt(s,10);!t.parseArrays&&s===""?o={0:i}:!isNaN(c)&&f!==s&&String(c)===s&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(o=[],o[c]=i):s!=="__proto__"&&(o[s]=i)}i=o}return i},gl=function(e,t,n,i){if(!!e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,f=/(\[[^[\]]*])/g,s=n.depth>0&&o.exec(a),c=s?a.slice(0,s.index):a,l=[];if(c){if(!n.plainObjects&&$n.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var u=0;n.depth>0&&(s=f.exec(a))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&$n.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(s[1])}return s&&l.push("["+a.slice(s.index)+"]"),vl(l,t,n,i)}},_l=function(e){if(!e)return D;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?D.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?D.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:D.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:D.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:D.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:D.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:D.comma,decoder:typeof e.decoder=="function"?e.decoder:D.decoder,delimiter:typeof e.delimiter=="string"||qe.isRegExp(e.delimiter)?e.delimiter:D.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:D.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:D.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:D.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:D.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:D.strictNullHandling}},ml=function(r,e){var t=_l(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?dl(r,t):r,i=t.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var f=a[o],s=gl(f,n[f],t,typeof r=="string");i=qe.merge(i,s,t)}return t.allowSparse===!0?i:qe.compact(i)},bl=cl,wl=ml,$l=_n,El={formats:$l,parse:wl,stringify:bl};let _a={storeIdentifier:"",environment:"prod"};function Ol(r){_a=r}function sr(){return _a}const Al=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",Sl=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",Tl=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",Il="/tools/recurring";var Pl=Object.defineProperty,ma=Object.getOwnPropertySymbols,xl=Object.prototype.hasOwnProperty,Fl=Object.prototype.propertyIsEnumerable,ba=(r,e,t)=>e in r?Pl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,En=(r,e)=>{for(var t in e||(e={}))xl.call(e,t)&&ba(r,t,e[t]);if(ma)for(var t of ma(e))Fl.call(e,t)&&ba(r,t,e[t]);return r};function Rl(r){return El.stringify(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Kr(r,e,t={}){const n=sr();return ve(r,`${Tl(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function T(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:f,storeIdentifier:s}=sr(),c=o.apiToken,l=Al(f),u=En({"X-Recharge-Access-Token":c,"X-Recharge-Version":"2021-11"},a||{}),p=En({shop_url:s},n);return ve(r,`${l}${e}`,{id:t,query:p,data:i,headers:u})}async function On(r,e,t={}){return ve(r,`${Il}${e}`,t)}async function ve(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const p=[u,Rl(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let f;i&&r!=="get"&&(f=JSON.stringify(i));const s=En({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:s,body:f,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Error(`${c.status}: ${l.error}`):new Error("A connection error occurred while making the request");return l}function Ml(r,e){return T("get","/addresses",{query:e},r)}async function Bl(r,e){const{address:t}=await T("get","/addresses",{id:e},r);return t}async function Nl(r,e){const{address:t}=await T("post","/addresses",{data:e},r);return t}async function Dl(r,e,t){const{address:n}=await T("put","/addresses",{id:e,data:t},r);return n}function Ul(r,e){return T("delete","/addresses",{id:e},r)}async function Cl(r,e){const{address:t}=await T("post","/addresses/merge",{data:e},r);return t}async function Ll(r,e,t){const{charge:n}=await T("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var jl=Object.freeze({__proto__:null,listAddresses:Ml,getAddress:Bl,createAddress:Nl,updateAddress:Dl,deleteAddress:Ul,mergeAddresses:Cl,skipFutureCharge:Ll});async function kl(){const{storefrontAccessToken:r}=sr(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await On("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function ql(r,e){const{environment:t,storeIdentifier:n}=sr(),i=Sl(t),a=await ve("post",`${i}/shopify_storefront_access`,{data:{customer_token:r,storefront_token:e,shop_url:n},headers:{"X-Recharge-App":"storefront-client"}});return a.api_token?{apiToken:a.api_token,customerId:a.customer_id}:null}var Vl=Object.freeze({__proto__:null,loginShopifyAppProxy:kl,loginShopifyApi:ql}),oe={},Zr={},wa={},An={},ue={},Gl=typeof te=="object"&&te&&te.Object===Object&&te,$a=Gl,Hl=$a,Wl=typeof self=="object"&&self&&self.Object===Object&&self,zl=Hl||Wl||Function("return this")(),Q=zl,Xl=Q,Yl=Xl.Symbol,Ve=Yl,Ea=Ve,Oa=Object.prototype,Kl=Oa.hasOwnProperty,Zl=Oa.toString,cr=Ea?Ea.toStringTag:void 0;function Jl(r){var e=Kl.call(r,cr),t=r[cr];try{r[cr]=void 0;var n=!0}catch{}var i=Zl.call(r);return n&&(e?r[cr]=t:delete r[cr]),i}var Ql=Jl,ep=Object.prototype,rp=ep.toString;function tp(r){return rp.call(r)}var np=tp,Aa=Ve,ip=Ql,ap=np,op="[object Null]",up="[object Undefined]",Sa=Aa?Aa.toStringTag:void 0;function fp(r){return r==null?r===void 0?up:op:Sa&&Sa in Object(r)?ip(r):ap(r)}var fe=fp;function sp(r){return r!=null&&typeof r=="object"}var H=sp,cp=fe,lp=H,pp="[object Number]";function hp(r){return typeof r=="number"||lp(r)&&cp(r)==pp}var Jr=hp,M={},Ta={exports:{}};function yp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var ge=yp,dp=fe,vp=ge,gp="[object AsyncFunction]",_p="[object Function]",mp="[object GeneratorFunction]",bp="[object Proxy]";function wp(r){if(!vp(r))return!1;var e=dp(r);return e==_p||e==mp||e==gp||e==bp}var Sn=wp,$p=Q,Ep=$p["__core-js_shared__"],Op=Ep,Tn=Op,Ia=function(){var r=/[^.]+$/.exec(Tn&&Tn.keys&&Tn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Ap(r){return!!Ia&&Ia in r}var Sp=Ap,Tp=Function.prototype,Ip=Tp.toString;function Pp(r){if(r!=null){try{return Ip.call(r)}catch{}try{return r+""}catch{}}return""}var Pa=Pp,xp=Sn,Fp=Sp,Rp=ge,Mp=Pa,Bp=/[\\^$.*+?()[\]{}|]/g,Np=/^\[object .+?Constructor\]$/,Dp=Function.prototype,Up=Object.prototype,Cp=Dp.toString,Lp=Up.hasOwnProperty,jp=RegExp("^"+Cp.call(Lp).replace(Bp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kp(r){if(!Rp(r)||Fp(r))return!1;var e=xp(r)?jp:Np;return e.test(Mp(r))}var qp=kp;function Vp(r,e){return r?.[e]}var Gp=Vp,Hp=qp,Wp=Gp;function zp(r,e){var t=Wp(r,e);return Hp(t)?t:void 0}var Te=zp,Xp=Te,Yp=function(){try{var r=Xp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),xa=Yp,Fa=xa;function Kp(r,e,t){e=="__proto__"&&Fa?Fa(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Ra=Kp;function Zp(r,e){return r===e||r!==r&&e!==e}var Qr=Zp,Jp=Ra,Qp=Qr,eh=Object.prototype,rh=eh.hasOwnProperty;function th(r,e,t){var n=r[e];(!(rh.call(r,e)&&Qp(n,t))||t===void 0&&!(e in r))&&Jp(r,e,t)}var Ma=th,nh=Ma,ih=Ra;function ah(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var f=e[a],s=n?n(t[f],r[f],f,t,r):void 0;s===void 0&&(s=r[f]),i?ih(t,f,s):nh(t,f,s)}return t}var Ge=ah;function oh(r){return r}var et=oh;function uh(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var fh=uh,sh=fh,Ba=Math.max;function ch(r,e,t){return e=Ba(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Ba(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var f=Array(e+1);++i<e;)f[i]=n[i];return f[e]=t(o),sh(r,this,f)}}var Na=ch;function lh(r){return function(){return r}}var ph=lh,hh=ph,Da=xa,yh=et,dh=Da?function(r,e){return Da(r,"toString",{configurable:!0,enumerable:!1,value:hh(e),writable:!0})}:yh,vh=dh,gh=800,_h=16,mh=Date.now;function bh(r){var e=0,t=0;return function(){var n=mh(),i=_h-(n-t);if(t=n,i>0){if(++e>=gh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var wh=bh,$h=vh,Eh=wh,Oh=Eh($h),Ua=Oh,Ah=et,Sh=Na,Th=Ua;function Ih(r,e){return Th(Sh(r,e,Ah),r+"")}var Ph=Ih,xh=9007199254740991;function Fh(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=xh}var In=Fh,Rh=Sn,Mh=In;function Bh(r){return r!=null&&Mh(r.length)&&!Rh(r)}var lr=Bh,Nh=9007199254740991,Dh=/^(?:0|[1-9]\d*)$/;function Uh(r,e){var t=typeof r;return e=e??Nh,!!e&&(t=="number"||t!="symbol"&&Dh.test(r))&&r>-1&&r%1==0&&r<e}var Pn=Uh,Ch=Qr,Lh=lr,jh=Pn,kh=ge;function qh(r,e,t){if(!kh(t))return!1;var n=typeof e;return(n=="number"?Lh(t)&&jh(e,t.length):n=="string"&&e in t)?Ch(t[e],r):!1}var Ca=qh,Vh=Ph,Gh=Ca;function Hh(r){return Vh(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&Gh(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var f=t[n];f&&r(e,f,n,a)}return e})}var Wh=Hh;function zh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var La=zh,Xh=fe,Yh=H,Kh="[object Arguments]";function Zh(r){return Yh(r)&&Xh(r)==Kh}var Jh=Zh,ja=Jh,Qh=H,ka=Object.prototype,ey=ka.hasOwnProperty,ry=ka.propertyIsEnumerable,ty=ja(function(){return arguments}())?ja:function(r){return Qh(r)&&ey.call(r,"callee")&&!ry.call(r,"callee")},xn=ty,ny=Array.isArray,C=ny,pr={exports:{}};function iy(){return!1}var ay=iy;(function(r,e){var t=Q,n=ay,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,f=o?t.Buffer:void 0,s=f?f.isBuffer:void 0,c=s||n;r.exports=c})(pr,pr.exports);var oy=fe,uy=In,fy=H,sy="[object Arguments]",cy="[object Array]",ly="[object Boolean]",py="[object Date]",hy="[object Error]",yy="[object Function]",dy="[object Map]",vy="[object Number]",gy="[object Object]",_y="[object RegExp]",my="[object Set]",by="[object String]",wy="[object WeakMap]",$y="[object ArrayBuffer]",Ey="[object DataView]",Oy="[object Float32Array]",Ay="[object Float64Array]",Sy="[object Int8Array]",Ty="[object Int16Array]",Iy="[object Int32Array]",Py="[object Uint8Array]",xy="[object Uint8ClampedArray]",Fy="[object Uint16Array]",Ry="[object Uint32Array]",F={};F[Oy]=F[Ay]=F[Sy]=F[Ty]=F[Iy]=F[Py]=F[xy]=F[Fy]=F[Ry]=!0,F[sy]=F[cy]=F[$y]=F[ly]=F[Ey]=F[py]=F[hy]=F[yy]=F[dy]=F[vy]=F[gy]=F[_y]=F[my]=F[by]=F[wy]=!1;function My(r){return fy(r)&&uy(r.length)&&!!F[oy(r)]}var By=My;function Ny(r){return function(e){return r(e)}}var Fn=Ny,hr={exports:{}};(function(r,e){var t=$a,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,f=function(){try{var s=i&&i.require&&i.require("util").types;return s||o&&o.binding&&o.binding("util")}catch{}}();r.exports=f})(hr,hr.exports);var Dy=By,Uy=Fn,qa=hr.exports,Va=qa&&qa.isTypedArray,Cy=Va?Uy(Va):Dy,Ga=Cy,Ly=La,jy=xn,ky=C,qy=pr.exports,Vy=Pn,Gy=Ga,Hy=Object.prototype,Wy=Hy.hasOwnProperty;function zy(r,e){var t=ky(r),n=!t&&jy(r),i=!t&&!n&&qy(r),a=!t&&!n&&!i&&Gy(r),o=t||n||i||a,f=o?Ly(r.length,String):[],s=f.length;for(var c in r)(e||Wy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Vy(c,s)))&&f.push(c);return f}var Ha=zy,Xy=Object.prototype;function Yy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Xy;return r===t}var Rn=Yy;function Ky(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Zy=Ky,Jy=ge,Qy=Rn,ed=Zy,rd=Object.prototype,td=rd.hasOwnProperty;function nd(r){if(!Jy(r))return ed(r);var e=Qy(r),t=[];for(var n in r)n=="constructor"&&(e||!td.call(r,n))||t.push(n);return t}var id=nd,ad=Ha,od=id,ud=lr;function fd(r){return ud(r)?ad(r,!0):od(r)}var rt=fd,sd=Ge,cd=Wh,ld=rt,pd=cd(function(r,e){sd(e,ld(e),r)}),hd=pd;(function(r){r.exports=hd})(Ta);var tt={},Ie={};function yd(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(!e(r[t],t,r))return!1;return!0}var dd=yd;function vd(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),f=o.length;f--;){var s=o[r?f:++i];if(t(a[s],s,a)===!1)break}return e}}var gd=vd,_d=gd,md=_d(),bd=md;function wd(r,e){return function(t){return r(e(t))}}var Wa=wd,$d=Wa,Ed=$d(Object.keys,Object),Od=Ed,Ad=Rn,Sd=Od,Td=Object.prototype,Id=Td.hasOwnProperty;function Pd(r){if(!Ad(r))return Sd(r);var e=[];for(var t in Object(r))Id.call(r,t)&&t!="constructor"&&e.push(t);return e}var xd=Pd,Fd=Ha,Rd=xd,Md=lr;function Bd(r){return Md(r)?Fd(r):Rd(r)}var He=Bd,Nd=bd,Dd=He;function Ud(r,e){return r&&Nd(r,e,Dd)}var Cd=Ud,Ld=lr;function jd(r,e){return function(t,n){if(t==null)return t;if(!Ld(t))return r(t,n);for(var i=t.length,a=e?i:-1,o=Object(t);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return t}}var kd=jd,qd=Cd,Vd=kd,Gd=Vd(qd),Mn=Gd,Hd=Mn;function Wd(r,e){var t=!0;return Hd(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var zd=Wd;function Xd(){this.__data__=[],this.size=0}var Yd=Xd,Kd=Qr;function Zd(r,e){for(var t=r.length;t--;)if(Kd(r[t][0],e))return t;return-1}var nt=Zd,Jd=nt,Qd=Array.prototype,ev=Qd.splice;function rv(r){var e=this.__data__,t=Jd(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():ev.call(e,t,1),--this.size,!0}var tv=rv,nv=nt;function iv(r){var e=this.__data__,t=nv(e,r);return t<0?void 0:e[t][1]}var av=iv,ov=nt;function uv(r){return ov(this.__data__,r)>-1}var fv=uv,sv=nt;function cv(r,e){var t=this.__data__,n=sv(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var lv=cv,pv=Yd,hv=tv,yv=av,dv=fv,vv=lv;function We(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}We.prototype.clear=pv,We.prototype.delete=hv,We.prototype.get=yv,We.prototype.has=dv,We.prototype.set=vv;var it=We,gv=it;function _v(){this.__data__=new gv,this.size=0}var mv=_v;function bv(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var wv=bv;function $v(r){return this.__data__.get(r)}var Ev=$v;function Ov(r){return this.__data__.has(r)}var Av=Ov,Sv=Te,Tv=Q,Iv=Sv(Tv,"Map"),Bn=Iv,Pv=Te,xv=Pv(Object,"create"),at=xv,za=at;function Fv(){this.__data__=za?za(null):{},this.size=0}var Rv=Fv;function Mv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Bv=Mv,Nv=at,Dv="__lodash_hash_undefined__",Uv=Object.prototype,Cv=Uv.hasOwnProperty;function Lv(r){var e=this.__data__;if(Nv){var t=e[r];return t===Dv?void 0:t}return Cv.call(e,r)?e[r]:void 0}var jv=Lv,kv=at,qv=Object.prototype,Vv=qv.hasOwnProperty;function Gv(r){var e=this.__data__;return kv?e[r]!==void 0:Vv.call(e,r)}var Hv=Gv,Wv=at,zv="__lodash_hash_undefined__";function Xv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Wv&&e===void 0?zv:e,this}var Yv=Xv,Kv=Rv,Zv=Bv,Jv=jv,Qv=Hv,eg=Yv;function ze(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}ze.prototype.clear=Kv,ze.prototype.delete=Zv,ze.prototype.get=Jv,ze.prototype.has=Qv,ze.prototype.set=eg;var rg=ze,Xa=rg,tg=it,ng=Bn;function ig(){this.size=0,this.__data__={hash:new Xa,map:new(ng||tg),string:new Xa}}var ag=ig;function og(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var ug=og,fg=ug;function sg(r,e){var t=r.__data__;return fg(e)?t[typeof e=="string"?"string":"hash"]:t.map}var ot=sg,cg=ot;function lg(r){var e=cg(this,r).delete(r);return this.size-=e?1:0,e}var pg=lg,hg=ot;function yg(r){return hg(this,r).get(r)}var dg=yg,vg=ot;function gg(r){return vg(this,r).has(r)}var _g=gg,mg=ot;function bg(r,e){var t=mg(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var wg=bg,$g=ag,Eg=pg,Og=dg,Ag=_g,Sg=wg;function Xe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Xe.prototype.clear=$g,Xe.prototype.delete=Eg,Xe.prototype.get=Og,Xe.prototype.has=Ag,Xe.prototype.set=Sg;var Nn=Xe,Tg=it,Ig=Bn,Pg=Nn,xg=200;function Fg(r,e){var t=this.__data__;if(t instanceof Tg){var n=t.__data__;if(!Ig||n.length<xg-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Pg(n)}return t.set(r,e),this.size=t.size,this}var Rg=Fg,Mg=it,Bg=mv,Ng=wv,Dg=Ev,Ug=Av,Cg=Rg;function Ye(r){var e=this.__data__=new Mg(r);this.size=e.size}Ye.prototype.clear=Bg,Ye.prototype.delete=Ng,Ye.prototype.get=Dg,Ye.prototype.has=Ug,Ye.prototype.set=Cg;var Dn=Ye,Lg="__lodash_hash_undefined__";function jg(r){return this.__data__.set(r,Lg),this}var kg=jg;function qg(r){return this.__data__.has(r)}var Vg=qg,Gg=Nn,Hg=kg,Wg=Vg;function ut(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Gg;++e<t;)this.add(r[e])}ut.prototype.add=ut.prototype.push=Hg,ut.prototype.has=Wg;var zg=ut;function Xg(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}var Yg=Xg;function Kg(r,e){return r.has(e)}var Zg=Kg,Jg=zg,Qg=Yg,e_=Zg,r_=1,t_=2;function n_(r,e,t,n,i,a){var o=t&r_,f=r.length,s=e.length;if(f!=s&&!(o&&s>f))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var u=-1,p=!0,d=t&t_?new Jg:void 0;for(a.set(r,e),a.set(e,r);++u<f;){var _=r[u],E=e[u];if(n)var $=o?n(E,_,u,e,r,a):n(_,E,u,r,e,a);if($!==void 0){if($)continue;p=!1;break}if(d){if(!Qg(e,function(b,S){if(!e_(d,S)&&(_===b||i(_,b,t,n,a)))return d.push(S)})){p=!1;break}}else if(!(_===E||i(_,E,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var Ya=n_,i_=Q,a_=i_.Uint8Array,Ka=a_;function o_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var u_=o_;function f_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var s_=f_,Za=Ve,Ja=Ka,c_=Qr,l_=Ya,p_=u_,h_=s_,y_=1,d_=2,v_="[object Boolean]",g_="[object Date]",__="[object Error]",m_="[object Map]",b_="[object Number]",w_="[object RegExp]",$_="[object Set]",E_="[object String]",O_="[object Symbol]",A_="[object ArrayBuffer]",S_="[object DataView]",Qa=Za?Za.prototype:void 0,Un=Qa?Qa.valueOf:void 0;function T_(r,e,t,n,i,a,o){switch(t){case S_:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case A_:return!(r.byteLength!=e.byteLength||!a(new Ja(r),new Ja(e)));case v_:case g_:case b_:return c_(+r,+e);case __:return r.name==e.name&&r.message==e.message;case w_:case E_:return r==e+"";case m_:var f=p_;case $_:var s=n&y_;if(f||(f=h_),r.size!=e.size&&!s)return!1;var c=o.get(r);if(c)return c==e;n|=d_,o.set(r,e);var l=l_(f(r),f(e),n,i,a,o);return o.delete(r),l;case O_:if(Un)return Un.call(r)==Un.call(e)}return!1}var I_=T_;function P_(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Cn=P_,x_=Cn,F_=C;function R_(r,e,t){var n=e(r);return F_(r)?n:x_(n,t(r))}var eo=R_;function M_(r,e){for(var t=-1,n=r==null?0:r.length,i=0,a=[];++t<n;){var o=r[t];e(o,t,r)&&(a[i++]=o)}return a}var B_=M_;function N_(){return[]}var ro=N_,D_=B_,U_=ro,C_=Object.prototype,L_=C_.propertyIsEnumerable,to=Object.getOwnPropertySymbols,j_=to?function(r){return r==null?[]:(r=Object(r),D_(to(r),function(e){return L_.call(r,e)}))}:U_,Ln=j_,k_=eo,q_=Ln,V_=He;function G_(r){return k_(r,V_,q_)}var no=G_,io=no,H_=1,W_=Object.prototype,z_=W_.hasOwnProperty;function X_(r,e,t,n,i,a){var o=t&H_,f=io(r),s=f.length,c=io(e),l=c.length;if(s!=l&&!o)return!1;for(var u=s;u--;){var p=f[u];if(!(o?p in e:z_.call(e,p)))return!1}var d=a.get(r),_=a.get(e);if(d&&_)return d==e&&_==r;var E=!0;a.set(r,e),a.set(e,r);for(var $=o;++u<s;){p=f[u];var b=r[p],S=e[p];if(n)var h=o?n(S,b,p,e,r,a):n(b,S,p,r,e,a);if(!(h===void 0?b===S||i(b,S,t,n,a):h)){E=!1;break}$||($=p=="constructor")}if(E&&!$){var A=r.constructor,P=e.constructor;A!=P&&"constructor"in r&&"constructor"in e&&!(typeof A=="function"&&A instanceof A&&typeof P=="function"&&P instanceof P)&&(E=!1)}return a.delete(r),a.delete(e),E}var Y_=X_,K_=Te,Z_=Q,J_=K_(Z_,"DataView"),Q_=J_,em=Te,rm=Q,tm=em(rm,"Promise"),nm=tm,im=Te,am=Q,om=im(am,"Set"),um=om,fm=Te,sm=Q,cm=fm(sm,"WeakMap"),lm=cm,jn=Q_,kn=Bn,qn=nm,Vn=um,Gn=lm,ao=fe,Ke=Pa,oo="[object Map]",pm="[object Object]",uo="[object Promise]",fo="[object Set]",so="[object WeakMap]",co="[object DataView]",hm=Ke(jn),ym=Ke(kn),dm=Ke(qn),vm=Ke(Vn),gm=Ke(Gn),Pe=ao;(jn&&Pe(new jn(new ArrayBuffer(1)))!=co||kn&&Pe(new kn)!=oo||qn&&Pe(qn.resolve())!=uo||Vn&&Pe(new Vn)!=fo||Gn&&Pe(new Gn)!=so)&&(Pe=function(r){var e=ao(r),t=e==pm?r.constructor:void 0,n=t?Ke(t):"";if(n)switch(n){case hm:return co;case ym:return oo;case dm:return uo;case vm:return fo;case gm:return so}return e});var ft=Pe,Hn=Dn,_m=Ya,mm=I_,bm=Y_,lo=ft,po=C,ho=pr.exports,wm=Ga,$m=1,yo="[object Arguments]",vo="[object Array]",st="[object Object]",Em=Object.prototype,go=Em.hasOwnProperty;function Om(r,e,t,n,i,a){var o=po(r),f=po(e),s=o?vo:lo(r),c=f?vo:lo(e);s=s==yo?st:s,c=c==yo?st:c;var l=s==st,u=c==st,p=s==c;if(p&&ho(r)){if(!ho(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new Hn),o||wm(r)?_m(r,e,t,n,i,a):mm(r,e,s,t,n,i,a);if(!(t&$m)){var d=l&&go.call(r,"__wrapped__"),_=u&&go.call(e,"__wrapped__");if(d||_){var E=d?r.value():r,$=_?e.value():e;return a||(a=new Hn),i(E,$,t,n,a)}}return p?(a||(a=new Hn),bm(r,e,t,n,i,a)):!1}var Am=Om,Sm=Am,_o=H;function mo(r,e,t,n,i){return r===e?!0:r==null||e==null||!_o(r)&&!_o(e)?r!==r&&e!==e:Sm(r,e,t,n,mo,i)}var bo=mo,Tm=Dn,Im=bo,Pm=1,xm=2;function Fm(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var f=t[i];if(o&&f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++i<a;){f=t[i];var s=f[0],c=r[s],l=f[1];if(o&&f[2]){if(c===void 0&&!(s in r))return!1}else{var u=new Tm;if(n)var p=n(c,l,s,r,e,u);if(!(p===void 0?Im(l,c,Pm|xm,n,u):p))return!1}}return!0}var Rm=Fm,Mm=ge;function Bm(r){return r===r&&!Mm(r)}var wo=Bm,Nm=wo,Dm=He;function Um(r){for(var e=Dm(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Nm(i)]}return e}var Cm=Um;function Lm(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var $o=Lm,jm=Rm,km=Cm,qm=$o;function Vm(r){var e=km(r);return e.length==1&&e[0][2]?qm(e[0][0],e[0][1]):function(t){return t===r||jm(t,r,e)}}var Gm=Vm,Hm=fe,Wm=H,zm="[object Symbol]";function Xm(r){return typeof r=="symbol"||Wm(r)&&Hm(r)==zm}var ct=Xm,Ym=C,Km=ct,Zm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jm=/^\w*$/;function Qm(r,e){if(Ym(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Km(r)?!0:Jm.test(r)||!Zm.test(r)||e!=null&&r in Object(e)}var Wn=Qm,Eo=Nn,e0="Expected a function";function zn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(e0);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(zn.Cache||Eo),t}zn.Cache=Eo;var r0=zn,t0=r0,n0=500;function i0(r){var e=t0(r,function(n){return t.size===n0&&t.clear(),n}),t=e.cache;return e}var a0=i0,o0=a0,u0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f0=/\\(\\)?/g,s0=o0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(u0,function(t,n,i,a){e.push(i?a.replace(f0,"$1"):n||t)}),e}),c0=s0;function l0(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var lt=l0,Oo=Ve,p0=lt,h0=C,y0=ct,d0=1/0,Ao=Oo?Oo.prototype:void 0,So=Ao?Ao.toString:void 0;function To(r){if(typeof r=="string")return r;if(h0(r))return p0(r,To)+"";if(y0(r))return So?So.call(r):"";var e=r+"";return e=="0"&&1/r==-d0?"-0":e}var v0=To,g0=v0;function _0(r){return r==null?"":g0(r)}var m0=_0,b0=C,w0=Wn,$0=c0,E0=m0;function O0(r,e){return b0(r)?r:w0(r,e)?[r]:$0(E0(r))}var pt=O0,A0=ct,S0=1/0;function T0(r){if(typeof r=="string"||A0(r))return r;var e=r+"";return e=="0"&&1/r==-S0?"-0":e}var yr=T0,I0=pt,P0=yr;function x0(r,e){e=I0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[P0(e[t++])];return t&&t==n?r:void 0}var Xn=x0,F0=Xn;function R0(r,e,t){var n=r==null?void 0:F0(r,e);return n===void 0?t:n}var M0=R0;function B0(r,e){return r!=null&&e in Object(r)}var N0=B0,D0=pt,U0=xn,C0=C,L0=Pn,j0=In,k0=yr;function q0(r,e,t){e=D0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=k0(e[n]);if(!(a=r!=null&&t(r,o)))break;r=r[o]}return a||++n!=i?a:(i=r==null?0:r.length,!!i&&j0(i)&&L0(o,i)&&(C0(r)||U0(r)))}var V0=q0,G0=N0,H0=V0;function W0(r,e){return r!=null&&H0(r,e,G0)}var z0=W0,X0=bo,Y0=M0,K0=z0,Z0=Wn,J0=wo,Q0=$o,eb=yr,rb=1,tb=2;function nb(r,e){return Z0(r)&&J0(e)?Q0(eb(r),e):function(t){var n=Y0(t,r);return n===void 0&&n===e?K0(t,r):X0(e,n,rb|tb)}}var ib=nb;function ab(r){return function(e){return e?.[r]}}var ob=ab,ub=Xn;function fb(r){return function(e){return ub(e,r)}}var sb=fb,cb=ob,lb=sb,pb=Wn,hb=yr;function yb(r){return pb(r)?cb(hb(r)):lb(r)}var db=yb,vb=Gm,gb=ib,_b=et,mb=C,bb=db;function wb(r){return typeof r=="function"?r:r==null?_b:typeof r=="object"?mb(r)?gb(r[0],r[1]):vb(r):bb(r)}var Io=wb,$b=dd,Eb=zd,Ob=Io,Ab=C,Sb=Ca;function Tb(r,e,t){var n=Ab(r)?$b:Eb;return t&&Sb(r,e,t)&&(e=void 0),n(r,Ob(e))}var Yn=Tb;Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calculatePadding=Fb,Ie.slicePadding=Rb;var Ib=Yn,Pb=xb(Ib);function xb(r){return r&&r.__esModule?r:{default:r}}function Fb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Rb(r,e){var t=r.slice(e),n=(0,Pb.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(tt,"__esModule",{value:!0}),tt.Cursor=void 0;var Mb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Bb=Ie;function Nb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Kn=function(){function r(e){Nb(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return Mb(r,[{key:"_setBuffer",value:function(t){this._buffer=t,this.length=t.length}},{key:"buffer",value:function(){return this._buffer}},{key:"tap",value:function(t){return t(this),this}},{key:"clone",value:function(t){var n=new this.constructor(this.buffer());return n.seek(arguments.length===0?this.tell():t),n}},{key:"tell",value:function(){return this._index}},{key:"seek",value:function(t,n){return arguments.length===1&&(n=t,t="="),t==="+"?this._index+=n:t==="-"?this._index-=n:this._index=n,this}},{key:"rewind",value:function(){return this.seek(0)}},{key:"eof",value:function(){return this.tell()===this.buffer().length}},{key:"write",value:function(t,n,i){return this.seek("+",this.buffer().write(t,this.tell(),n,i))}},{key:"fill",value:function(t,n){return arguments.length===1&&(n=this.buffer().length-this.tell()),this.buffer().fill(t,this.tell(),this.tell()+n),this.seek("+",n),this}},{key:"slice",value:function(t){arguments.length===0&&(t=this.length-this.tell());var n=new this.constructor(this.buffer().slice(this.tell(),this.tell()+t));return this.seek("+",t),n}},{key:"copyFrom",value:function(t){var n=t instanceof y?t:t.buffer();return n.copy(this.buffer(),this.tell(),0,n.length),this.seek("+",n.length),this}},{key:"concat",value:function(t){t.forEach(function(i,a){i instanceof r&&(t[a]=i.buffer())}),t.unshift(this.buffer());var n=y.concat(t);return this._setBuffer(n),this}},{key:"toString",value:function(t,n){arguments.length===0?(t="utf8",n=this.buffer().length-this.tell()):arguments.length===1&&(n=this.buffer().length-this.tell());var i=this.buffer().toString(t,this.tell(),this.tell()+n);return this.seek("+",n),i}},{key:"writeBufferPadded",value:function(t){var n=(0,Bb.calculatePadding)(t.length),i=y.alloc(n);return this.copyFrom(new r(t)).copyFrom(new r(i))}}]),r}();[[1,["readInt8","readUInt8"]],[2,["readInt16BE","readInt16LE","readUInt16BE","readUInt16LE"]],[4,["readInt32BE","readInt32LE","readUInt32BE","readUInt32LE","readFloatBE","readFloatLE"]],[8,["readDoubleBE","readDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Kn.prototype[e]=function(){var n=this.buffer()[e](this.tell());return this.seek("+",r[0]),n}})}),[[1,["writeInt8","writeUInt8"]],[2,["writeInt16BE","writeInt16LE","writeUInt16BE","writeUInt16LE"]],[4,["writeInt32BE","writeInt32LE","writeUInt32BE","writeUInt32LE","writeFloatBE","writeFloatLE"]],[8,["writeDoubleBE","writeDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Kn.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),tt.Cursor=Kn,Object.defineProperty(M,"__esModule",{value:!0}),M.default=qb;var Db=Ta.exports,Po=Fo(Db),Ub=Sn,Cb=Fo(Ub),xo=tt;function Fo(r){return r&&r.__esModule?r:{default:r}}var Lb=Math.pow(2,16),jb={toXDR:function(e){var t=new xo.Cursor(Lb);this.write(e,t);var n=t.tell();return t.rewind(),t.slice(n).buffer()},fromXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw",n=void 0;switch(t){case"raw":n=e;break;case"hex":n=y.from(e,"hex");break;case"base64":n=y.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new xo.Cursor(n),a=this.read(i);return a},validateXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch{return!1}}},kb={toXDR:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw",t=this.constructor.toXDR(this);switch(e){case"raw":return t;case"hex":return t.toString("hex");case"base64":return t.toString("base64");default:throw new Error("Invalid format "+e+', must be "raw", "hex", "base64"')}}};function qb(r){(0,Po.default)(r,jb),(0,Cb.default)(r)&&(0,Po.default)(r.prototype,kb)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.Int=void 0;var Vb=Jr,Ro=Mo(Vb),Gb=M,Hb=Mo(Gb);function Mo(r){return r&&r.__esModule?r:{default:r}}var dr=ue.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Ro.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,Ro.default)(e)||Math.floor(e)!==e?!1:e>=dr.MIN_VALUE&&e<=dr.MAX_VALUE}};dr.MAX_VALUE=Math.pow(2,31)-1,dr.MIN_VALUE=-Math.pow(2,31),(0,Hb.default)(dr);var ht={};function Wb(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Zn={exports:{}};(function(r){/**
|
|
24
|
+
`+e.prev}function Wr(r,e){var t=cn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=he(r,i)?e(r[i],r):""}var a=typeof un=="function"?un(r):[],o;if(Le){o={};for(var f=0;f<a.length;f++)o["$"+a[f]]=a[f]}for(var s in r)!he(r,s)||t&&String(Number(s))===s&&s<r.length||Le&&o["$"+s]instanceof Symbol||(Yi.call(/[^\w$]/,s)?n.push(e(s,r)+": "+e(r[s],r)):n.push(s+": "+e(r[s],r)));if(typeof un=="function")for(var c=0;c<a.length;c++)Ji.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var hn=Lt,je=Mf,Tc=fc,xc=hn("%TypeError%"),zr=hn("%WeakMap%",!0),Xr=hn("%Map%",!0),Pc=je("WeakMap.prototype.get",!0),Ic=je("WeakMap.prototype.set",!0),Fc=je("WeakMap.prototype.has",!0),Rc=je("Map.prototype.get",!0),Mc=je("Map.prototype.set",!0),Nc=je("Map.prototype.has",!0),yn=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},Dc=function(r,e){var t=yn(r,e);return t&&t.value},Bc=function(r,e,t){var n=yn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Uc=function(r,e){return!!yn(r,e)},Cc=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new xc("Side channel does not contain "+Tc(a))},get:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Pc(e,a)}else if(Xr){if(t)return Rc(t,a)}else if(n)return Dc(n,a)},has:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Fc(e,a)}else if(Xr){if(t)return Nc(t,a)}else if(n)return Uc(n,a);return!1},set:function(a,o){zr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new zr),Ic(e,a,o)):Xr?(t||(t=new Xr),Mc(t,a,o)):(n||(n={key:{},next:null}),Bc(n,a,o))}};return i},Lc=String.prototype.replace,jc=/%20/g,dn={RFC1738:"RFC1738",RFC3986:"RFC3986"},vn={default:dn.RFC3986,formatters:{RFC1738:function(r){return Lc.call(r,jc,"+")},RFC3986:function(r){return String(r)}},RFC1738:dn.RFC1738,RFC3986:dn.RFC3986},kc=vn,gn=Object.prototype.hasOwnProperty,Oe=Array.isArray,J=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Vc=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Oe(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},sa=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},qc=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Oe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!gn.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return Oe(e)&&!Oe(t)&&(i=sa(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(gn.call(e,o)){var f=e[o];f&&typeof f=="object"&&a&&typeof a=="object"?e[o]=r(f,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var f=t[o];return gn.call(a,o)?a[o]=r(a[o],f,n):a[o]=f,a},i)},Gc=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Hc=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Wc=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var f="",s=0;s<o.length;++s){var c=o.charCodeAt(s);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===kc.RFC1738&&(c===40||c===41)){f+=o.charAt(s);continue}if(c<128){f=f+J[c];continue}if(c<2048){f=f+(J[192|c>>6]+J[128|c&63]);continue}if(c<55296||c>=57344){f=f+(J[224|c>>12]+J[128|c>>6&63]+J[128|c&63]);continue}s+=1,c=65536+((c&1023)<<10|o.charCodeAt(s)&1023),f+=J[240|c>>18]+J[128|c>>12&63]+J[128|c>>6&63]+J[128|c&63]}return f},zc=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],f=Object.keys(o),s=0;s<f.length;++s){var c=f[s],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Vc(t),e},Xc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Yc=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Kc=function(e,t){return[].concat(e,t)},Zc=function(e,t){if(Oe(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},ca={arrayToObject:sa,assign:Gc,combine:Kc,compact:zc,decode:Hc,encode:Wc,isBuffer:Yc,isRegExp:Xc,maybeMap:Zc,merge:qc},la=Cc,_n=ca,ur=vn,Jc=Object.prototype.hasOwnProperty,pa={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ie=Array.isArray,Qc=String.prototype.split,el=Array.prototype.push,ha=function(r,e){el.apply(r,ie(e)?e:[e])},rl=Date.prototype.toISOString,ya=ur.default,U={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:_n.encode,encodeValuesOnly:!1,format:ya,formatter:ur.formatters[ya],indices:!1,serializeDate:function(e){return rl.call(e)},skipNulls:!1,strictNullHandling:!1},tl=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},mn={},nl=function r(e,t,n,i,a,o,f,s,c,l,u,p,d,_,E,$){for(var b=e,S=$,h=0,O=!1;(S=S.get(mn))!==void 0&&!O;){var P=S.get(e);if(h+=1,typeof P<"u"){if(P===h)throw new RangeError("Cyclic object value");O=!0}typeof S.get(mn)>"u"&&(h=0)}if(typeof s=="function"?b=s(t,b):b instanceof Date?b=u(b):n==="comma"&&ie(b)&&(b=_n.maybeMap(b,function(ai){return ai instanceof Date?u(ai):ai})),b===null){if(a)return f&&!_?f(t,U.encoder,E,"key",p):t;b=""}if(tl(b)||_n.isBuffer(b)){if(f){var R=_?t:f(t,U.encoder,E,"key",p);if(n==="comma"&&_){for(var m=Qc.call(String(b),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+d(f(m[g],U.encoder,E,"value",p));return[d(R)+(i&&ie(b)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(f(b,U.encoder,E,"value",p))]}return[d(t)+"="+d(String(b))]}var w=[];if(typeof b>"u")return w;var A;if(n==="comma"&&ie(b))A=[{value:b.length>0?b.join(",")||null:void 0}];else if(ie(s))A=s;else{var L=Object.keys(b);A=c?L.sort(c):L}for(var ee=i&&ie(b)&&b.length===1?t+"[]":t,ge=0;ge<A.length;++ge){var fe=A[ge],xr=typeof fe=="object"&&typeof fe.value<"u"?fe.value:b[fe];if(!(o&&xr===null)){var S2=ie(b)?typeof n=="function"?n(ee,fe):ee:ee+(l?"."+fe:"["+fe+"]");$.set(e,h);var Qu=la();Qu.set(mn,$),ha(w,r(xr,S2,n,i,a,o,f,s,c,l,u,p,d,_,E,Qu))}}return w},il=function(e){if(!e)return U;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||U.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=ur.default;if(typeof e.format<"u"){if(!Jc.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=U.filter;return(typeof e.filter=="function"||ie(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:U.addQueryPrefix,allowDots:typeof e.allowDots>"u"?U.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:U.charsetSentinel,delimiter:typeof e.delimiter>"u"?U.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:U.encode,encoder:typeof e.encoder=="function"?e.encoder:U.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:U.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:U.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:U.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:U.strictNullHandling}},al=function(r,e){var t=r,n=il(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ie(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var f;e&&e.arrayFormat in pa?f=e.arrayFormat:e&&"indices"in e?f=e.indices?"indices":"repeat":f="indices";var s=pa[f];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=s==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=la(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||ha(o,nl(t[p],p,s,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var d=o.join(n.delimiter),_=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),d.length>0?_+d:""},ke=ca,bn=Object.prototype.hasOwnProperty,ol=Array.isArray,B={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ke.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ul=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},da=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},fl="utf8=%26%2310003%3B",sl="utf8=%E2%9C%93",cl=function(e,t){var n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,a),f=-1,s,c=t.charset;if(t.charsetSentinel)for(s=0;s<o.length;++s)o[s].indexOf("utf8=")===0&&(o[s]===sl?c="utf-8":o[s]===fl&&(c="iso-8859-1"),f=s,s=o.length);for(s=0;s<o.length;++s)if(s!==f){var l=o[s],u=l.indexOf("]="),p=u===-1?l.indexOf("="):u+1,d,_;p===-1?(d=t.decoder(l,B.decoder,c,"key"),_=t.strictNullHandling?null:""):(d=t.decoder(l.slice(0,p),B.decoder,c,"key"),_=ke.maybeMap(da(l.slice(p+1),t),function(E){return t.decoder(E,B.decoder,c,"value")})),_&&t.interpretNumericEntities&&c==="iso-8859-1"&&(_=ul(_)),l.indexOf("[]=")>-1&&(_=ol(_)?[_]:_),bn.call(n,d)?n[d]=ke.combine(n[d],_):n[d]=_}return n},ll=function(r,e,t,n){for(var i=n?e:da(e,t),a=r.length-1;a>=0;--a){var o,f=r[a];if(f==="[]"&&t.parseArrays)o=[].concat(i);else{o=t.plainObjects?Object.create(null):{};var s=f.charAt(0)==="["&&f.charAt(f.length-1)==="]"?f.slice(1,-1):f,c=parseInt(s,10);!t.parseArrays&&s===""?o={0:i}:!isNaN(c)&&f!==s&&String(c)===s&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(o=[],o[c]=i):s!=="__proto__"&&(o[s]=i)}i=o}return i},pl=function(e,t,n,i){if(!!e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,f=/(\[[^[\]]*])/g,s=n.depth>0&&o.exec(a),c=s?a.slice(0,s.index):a,l=[];if(c){if(!n.plainObjects&&bn.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var u=0;n.depth>0&&(s=f.exec(a))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&bn.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(s[1])}return s&&l.push("["+a.slice(s.index)+"]"),ll(l,t,n,i)}},hl=function(e){if(!e)return B;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?B.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?B.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:B.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:B.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:B.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:B.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:B.comma,decoder:typeof e.decoder=="function"?e.decoder:B.decoder,delimiter:typeof e.delimiter=="string"||ke.isRegExp(e.delimiter)?e.delimiter:B.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:B.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:B.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:B.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:B.strictNullHandling}},yl=function(r,e){var t=hl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?cl(r,t):r,i=t.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var f=a[o],s=pl(f,n[f],t,typeof r=="string");i=ke.merge(i,s,t)}return t.allowSparse===!0?i:ke.compact(i)},dl=al,vl=yl,gl=vn,_l={formats:gl,parse:vl,stringify:dl};let va={storeIdentifier:"",environment:"prod"};function ml(r){va=r}function fr(){return va}const bl=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",wl=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",$l=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",El="/tools/recurring";var Al=Object.defineProperty,ga=Object.getOwnPropertySymbols,Ol=Object.prototype.hasOwnProperty,Sl=Object.prototype.propertyIsEnumerable,_a=(r,e,t)=>e in r?Al(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,wn=(r,e)=>{for(var t in e||(e={}))Ol.call(e,t)&&_a(r,t,e[t]);if(ga)for(var t of ga(e))Sl.call(e,t)&&_a(r,t,e[t]);return r};function Tl(r){return _l.stringify(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Yr(r,e,t={}){const n=fr();return de(r,`${$l(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function T(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:f,storeIdentifier:s}=fr(),c=o.apiToken,l=bl(f),u=wn({"X-Recharge-Access-Token":c,"X-Recharge-Version":"2021-11"},a||{}),p=wn({shop_url:s},n);return de(r,`${l}${e}`,{id:t,query:p,data:i,headers:u})}async function $n(r,e,t={}){return de(r,`${El}${e}`,t)}async function de(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const p=[u,Tl(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let f;i&&r!=="get"&&(f=JSON.stringify(i));const s=wn({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:s,body:f,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Error(`${c.status}: ${l.error}`):new Error("A connection error occurred while making the request");return l}function xl(r,e){return T("get","/addresses",{query:e},r)}async function Pl(r,e){const{address:t}=await T("get","/addresses",{id:e},r);return t}async function Il(r,e){const{address:t}=await T("post","/addresses",{data:e},r);return t}async function Fl(r,e,t){const{address:n}=await T("put","/addresses",{id:e,data:t},r);return n}function Rl(r,e){return T("delete","/addresses",{id:e},r)}async function Ml(r,e){const{address:t}=await T("post","/addresses/merge",{data:e},r);return t}async function Nl(r,e,t){const{charge:n}=await T("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Dl=Object.freeze({__proto__:null,listAddresses:xl,getAddress:Pl,createAddress:Il,updateAddress:Fl,deleteAddress:Rl,mergeAddresses:Ml,skipFutureCharge:Nl});async function Bl(){const{storefrontAccessToken:r}=fr(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await $n("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function Ul(r,e){const{environment:t,storeIdentifier:n}=fr(),i=wl(t),a=await de("post",`${i}/shopify_storefront_access`,{data:{customer_token:r,storefront_token:e,shop_url:n},headers:{"X-Recharge-App":"storefront-client"}});return a.api_token?{apiToken:a.api_token,customerId:a.customer_id}:null}var Cl=Object.freeze({__proto__:null,loginShopifyAppProxy:Bl,loginShopifyApi:Ul}),ma={},En={},ae={},Ll=typeof re=="object"&&re&&re.Object===Object&&re,ba=Ll,jl=ba,kl=typeof self=="object"&&self&&self.Object===Object&&self,Vl=jl||kl||Function("return this")(),Q=Vl,ql=Q,Gl=ql.Symbol,Ve=Gl,wa=Ve,$a=Object.prototype,Hl=$a.hasOwnProperty,Wl=$a.toString,sr=wa?wa.toStringTag:void 0;function zl(r){var e=Hl.call(r,sr),t=r[sr];try{r[sr]=void 0;var n=!0}catch{}var i=Wl.call(r);return n&&(e?r[sr]=t:delete r[sr]),i}var Xl=zl,Yl=Object.prototype,Kl=Yl.toString;function Zl(r){return Kl.call(r)}var Jl=Zl,Ea=Ve,Ql=Xl,ep=Jl,rp="[object Null]",tp="[object Undefined]",Aa=Ea?Ea.toStringTag:void 0;function np(r){return r==null?r===void 0?tp:rp:Aa&&Aa in Object(r)?Ql(r):ep(r)}var oe=np;function ip(r){return r!=null&&typeof r=="object"}var H=ip,ap=oe,op=H,up="[object Number]";function fp(r){return typeof r=="number"||op(r)&&ap(r)==up}var Kr=fp,M={},Oa={exports:{}};function sp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var ve=sp,cp=oe,lp=ve,pp="[object AsyncFunction]",hp="[object Function]",yp="[object GeneratorFunction]",dp="[object Proxy]";function vp(r){if(!lp(r))return!1;var e=cp(r);return e==hp||e==yp||e==pp||e==dp}var An=vp,gp=Q,_p=gp["__core-js_shared__"],mp=_p,On=mp,Sa=function(){var r=/[^.]+$/.exec(On&&On.keys&&On.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function bp(r){return!!Sa&&Sa in r}var wp=bp,$p=Function.prototype,Ep=$p.toString;function Ap(r){if(r!=null){try{return Ep.call(r)}catch{}try{return r+""}catch{}}return""}var Ta=Ap,Op=An,Sp=wp,Tp=ve,xp=Ta,Pp=/[\\^$.*+?()[\]{}|]/g,Ip=/^\[object .+?Constructor\]$/,Fp=Function.prototype,Rp=Object.prototype,Mp=Fp.toString,Np=Rp.hasOwnProperty,Dp=RegExp("^"+Mp.call(Np).replace(Pp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bp(r){if(!Tp(r)||Sp(r))return!1;var e=Op(r)?Dp:Ip;return e.test(xp(r))}var Up=Bp;function Cp(r,e){return r?.[e]}var Lp=Cp,jp=Up,kp=Lp;function Vp(r,e){var t=kp(r,e);return jp(t)?t:void 0}var Se=Vp,qp=Se,Gp=function(){try{var r=qp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),xa=Gp,Pa=xa;function Hp(r,e,t){e=="__proto__"&&Pa?Pa(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Ia=Hp;function Wp(r,e){return r===e||r!==r&&e!==e}var Zr=Wp,zp=Ia,Xp=Zr,Yp=Object.prototype,Kp=Yp.hasOwnProperty;function Zp(r,e,t){var n=r[e];(!(Kp.call(r,e)&&Xp(n,t))||t===void 0&&!(e in r))&&zp(r,e,t)}var Fa=Zp,Jp=Fa,Qp=Ia;function eh(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var f=e[a],s=n?n(t[f],r[f],f,t,r):void 0;s===void 0&&(s=r[f]),i?Qp(t,f,s):Jp(t,f,s)}return t}var qe=eh;function rh(r){return r}var Jr=rh;function th(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var nh=th,ih=nh,Ra=Math.max;function ah(r,e,t){return e=Ra(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Ra(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var f=Array(e+1);++i<e;)f[i]=n[i];return f[e]=t(o),ih(r,this,f)}}var Ma=ah;function oh(r){return function(){return r}}var uh=oh,fh=uh,Na=xa,sh=Jr,ch=Na?function(r,e){return Na(r,"toString",{configurable:!0,enumerable:!1,value:fh(e),writable:!0})}:sh,lh=ch,ph=800,hh=16,yh=Date.now;function dh(r){var e=0,t=0;return function(){var n=yh(),i=hh-(n-t);if(t=n,i>0){if(++e>=ph)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var vh=dh,gh=lh,_h=vh,mh=_h(gh),Da=mh,bh=Jr,wh=Ma,$h=Da;function Eh(r,e){return $h(wh(r,e,bh),r+"")}var Ah=Eh,Oh=9007199254740991;function Sh(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Oh}var Sn=Sh,Th=An,xh=Sn;function Ph(r){return r!=null&&xh(r.length)&&!Th(r)}var cr=Ph,Ih=9007199254740991,Fh=/^(?:0|[1-9]\d*)$/;function Rh(r,e){var t=typeof r;return e=e??Ih,!!e&&(t=="number"||t!="symbol"&&Fh.test(r))&&r>-1&&r%1==0&&r<e}var Tn=Rh,Mh=Zr,Nh=cr,Dh=Tn,Bh=ve;function Uh(r,e,t){if(!Bh(t))return!1;var n=typeof e;return(n=="number"?Nh(t)&&Dh(e,t.length):n=="string"&&e in t)?Mh(t[e],r):!1}var Ba=Uh,Ch=Ah,Lh=Ba;function jh(r){return Ch(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&Lh(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var f=t[n];f&&r(e,f,n,a)}return e})}var kh=jh;function Vh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Ua=Vh,qh=oe,Gh=H,Hh="[object Arguments]";function Wh(r){return Gh(r)&&qh(r)==Hh}var zh=Wh,Ca=zh,Xh=H,La=Object.prototype,Yh=La.hasOwnProperty,Kh=La.propertyIsEnumerable,Zh=Ca(function(){return arguments}())?Ca:function(r){return Xh(r)&&Yh.call(r,"callee")&&!Kh.call(r,"callee")},xn=Zh,Jh=Array.isArray,C=Jh,lr={exports:{}};function Qh(){return!1}var ey=Qh;(function(r,e){var t=Q,n=ey,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,f=o?t.Buffer:void 0,s=f?f.isBuffer:void 0,c=s||n;r.exports=c})(lr,lr.exports);var ry=oe,ty=Sn,ny=H,iy="[object Arguments]",ay="[object Array]",oy="[object Boolean]",uy="[object Date]",fy="[object Error]",sy="[object Function]",cy="[object Map]",ly="[object Number]",py="[object Object]",hy="[object RegExp]",yy="[object Set]",dy="[object String]",vy="[object WeakMap]",gy="[object ArrayBuffer]",_y="[object DataView]",my="[object Float32Array]",by="[object Float64Array]",wy="[object Int8Array]",$y="[object Int16Array]",Ey="[object Int32Array]",Ay="[object Uint8Array]",Oy="[object Uint8ClampedArray]",Sy="[object Uint16Array]",Ty="[object Uint32Array]",F={};F[my]=F[by]=F[wy]=F[$y]=F[Ey]=F[Ay]=F[Oy]=F[Sy]=F[Ty]=!0,F[iy]=F[ay]=F[gy]=F[oy]=F[_y]=F[uy]=F[fy]=F[sy]=F[cy]=F[ly]=F[py]=F[hy]=F[yy]=F[dy]=F[vy]=!1;function xy(r){return ny(r)&&ty(r.length)&&!!F[ry(r)]}var Py=xy;function Iy(r){return function(e){return r(e)}}var Pn=Iy,pr={exports:{}};(function(r,e){var t=ba,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,f=function(){try{var s=i&&i.require&&i.require("util").types;return s||o&&o.binding&&o.binding("util")}catch{}}();r.exports=f})(pr,pr.exports);var Fy=Py,Ry=Pn,ja=pr.exports,ka=ja&&ja.isTypedArray,My=ka?Ry(ka):Fy,Va=My,Ny=Ua,Dy=xn,By=C,Uy=lr.exports,Cy=Tn,Ly=Va,jy=Object.prototype,ky=jy.hasOwnProperty;function Vy(r,e){var t=By(r),n=!t&&Dy(r),i=!t&&!n&&Uy(r),a=!t&&!n&&!i&&Ly(r),o=t||n||i||a,f=o?Ny(r.length,String):[],s=f.length;for(var c in r)(e||ky.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Cy(c,s)))&&f.push(c);return f}var qa=Vy,qy=Object.prototype;function Gy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||qy;return r===t}var In=Gy;function Hy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Wy=Hy,zy=ve,Xy=In,Yy=Wy,Ky=Object.prototype,Zy=Ky.hasOwnProperty;function Jy(r){if(!zy(r))return Yy(r);var e=Xy(r),t=[];for(var n in r)n=="constructor"&&(e||!Zy.call(r,n))||t.push(n);return t}var Qy=Jy,ed=qa,rd=Qy,td=cr;function nd(r){return td(r)?ed(r,!0):rd(r)}var Qr=nd,id=qe,ad=kh,od=Qr,ud=ad(function(r,e){id(e,od(e),r)}),fd=ud;(function(r){r.exports=fd})(Oa);var et={},Te={};function sd(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(!e(r[t],t,r))return!1;return!0}var cd=sd;function ld(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),f=o.length;f--;){var s=o[r?f:++i];if(t(a[s],s,a)===!1)break}return e}}var pd=ld,hd=pd,yd=hd(),dd=yd;function vd(r,e){return function(t){return r(e(t))}}var Ga=vd,gd=Ga,_d=gd(Object.keys,Object),md=_d,bd=In,wd=md,$d=Object.prototype,Ed=$d.hasOwnProperty;function Ad(r){if(!bd(r))return wd(r);var e=[];for(var t in Object(r))Ed.call(r,t)&&t!="constructor"&&e.push(t);return e}var Od=Ad,Sd=qa,Td=Od,xd=cr;function Pd(r){return xd(r)?Sd(r):Td(r)}var Ge=Pd,Id=dd,Fd=Ge;function Rd(r,e){return r&&Id(r,e,Fd)}var Md=Rd,Nd=cr;function Dd(r,e){return function(t,n){if(t==null)return t;if(!Nd(t))return r(t,n);for(var i=t.length,a=e?i:-1,o=Object(t);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return t}}var Bd=Dd,Ud=Md,Cd=Bd,Ld=Cd(Ud),Fn=Ld,jd=Fn;function kd(r,e){var t=!0;return jd(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Vd=kd;function qd(){this.__data__=[],this.size=0}var Gd=qd,Hd=Zr;function Wd(r,e){for(var t=r.length;t--;)if(Hd(r[t][0],e))return t;return-1}var rt=Wd,zd=rt,Xd=Array.prototype,Yd=Xd.splice;function Kd(r){var e=this.__data__,t=zd(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Yd.call(e,t,1),--this.size,!0}var Zd=Kd,Jd=rt;function Qd(r){var e=this.__data__,t=Jd(e,r);return t<0?void 0:e[t][1]}var ev=Qd,rv=rt;function tv(r){return rv(this.__data__,r)>-1}var nv=tv,iv=rt;function av(r,e){var t=this.__data__,n=iv(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var ov=av,uv=Gd,fv=Zd,sv=ev,cv=nv,lv=ov;function He(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}He.prototype.clear=uv,He.prototype.delete=fv,He.prototype.get=sv,He.prototype.has=cv,He.prototype.set=lv;var tt=He,pv=tt;function hv(){this.__data__=new pv,this.size=0}var yv=hv;function dv(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var vv=dv;function gv(r){return this.__data__.get(r)}var _v=gv;function mv(r){return this.__data__.has(r)}var bv=mv,wv=Se,$v=Q,Ev=wv($v,"Map"),Rn=Ev,Av=Se,Ov=Av(Object,"create"),nt=Ov,Ha=nt;function Sv(){this.__data__=Ha?Ha(null):{},this.size=0}var Tv=Sv;function xv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Pv=xv,Iv=nt,Fv="__lodash_hash_undefined__",Rv=Object.prototype,Mv=Rv.hasOwnProperty;function Nv(r){var e=this.__data__;if(Iv){var t=e[r];return t===Fv?void 0:t}return Mv.call(e,r)?e[r]:void 0}var Dv=Nv,Bv=nt,Uv=Object.prototype,Cv=Uv.hasOwnProperty;function Lv(r){var e=this.__data__;return Bv?e[r]!==void 0:Cv.call(e,r)}var jv=Lv,kv=nt,Vv="__lodash_hash_undefined__";function qv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=kv&&e===void 0?Vv:e,this}var Gv=qv,Hv=Tv,Wv=Pv,zv=Dv,Xv=jv,Yv=Gv;function We(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}We.prototype.clear=Hv,We.prototype.delete=Wv,We.prototype.get=zv,We.prototype.has=Xv,We.prototype.set=Yv;var Kv=We,Wa=Kv,Zv=tt,Jv=Rn;function Qv(){this.size=0,this.__data__={hash:new Wa,map:new(Jv||Zv),string:new Wa}}var eg=Qv;function rg(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var tg=rg,ng=tg;function ig(r,e){var t=r.__data__;return ng(e)?t[typeof e=="string"?"string":"hash"]:t.map}var it=ig,ag=it;function og(r){var e=ag(this,r).delete(r);return this.size-=e?1:0,e}var ug=og,fg=it;function sg(r){return fg(this,r).get(r)}var cg=sg,lg=it;function pg(r){return lg(this,r).has(r)}var hg=pg,yg=it;function dg(r,e){var t=yg(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var vg=dg,gg=eg,_g=ug,mg=cg,bg=hg,wg=vg;function ze(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}ze.prototype.clear=gg,ze.prototype.delete=_g,ze.prototype.get=mg,ze.prototype.has=bg,ze.prototype.set=wg;var Mn=ze,$g=tt,Eg=Rn,Ag=Mn,Og=200;function Sg(r,e){var t=this.__data__;if(t instanceof $g){var n=t.__data__;if(!Eg||n.length<Og-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Ag(n)}return t.set(r,e),this.size=t.size,this}var Tg=Sg,xg=tt,Pg=yv,Ig=vv,Fg=_v,Rg=bv,Mg=Tg;function Xe(r){var e=this.__data__=new xg(r);this.size=e.size}Xe.prototype.clear=Pg,Xe.prototype.delete=Ig,Xe.prototype.get=Fg,Xe.prototype.has=Rg,Xe.prototype.set=Mg;var Nn=Xe,Ng="__lodash_hash_undefined__";function Dg(r){return this.__data__.set(r,Ng),this}var Bg=Dg;function Ug(r){return this.__data__.has(r)}var Cg=Ug,Lg=Mn,jg=Bg,kg=Cg;function at(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Lg;++e<t;)this.add(r[e])}at.prototype.add=at.prototype.push=jg,at.prototype.has=kg;var Vg=at;function qg(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}var Gg=qg;function Hg(r,e){return r.has(e)}var Wg=Hg,zg=Vg,Xg=Gg,Yg=Wg,Kg=1,Zg=2;function Jg(r,e,t,n,i,a){var o=t&Kg,f=r.length,s=e.length;if(f!=s&&!(o&&s>f))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var u=-1,p=!0,d=t&Zg?new zg:void 0;for(a.set(r,e),a.set(e,r);++u<f;){var _=r[u],E=e[u];if(n)var $=o?n(E,_,u,e,r,a):n(_,E,u,r,e,a);if($!==void 0){if($)continue;p=!1;break}if(d){if(!Xg(e,function(b,S){if(!Yg(d,S)&&(_===b||i(_,b,t,n,a)))return d.push(S)})){p=!1;break}}else if(!(_===E||i(_,E,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var za=Jg,Qg=Q,e_=Qg.Uint8Array,Xa=e_;function r_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var t_=r_;function n_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var i_=n_,Ya=Ve,Ka=Xa,a_=Zr,o_=za,u_=t_,f_=i_,s_=1,c_=2,l_="[object Boolean]",p_="[object Date]",h_="[object Error]",y_="[object Map]",d_="[object Number]",v_="[object RegExp]",g_="[object Set]",__="[object String]",m_="[object Symbol]",b_="[object ArrayBuffer]",w_="[object DataView]",Za=Ya?Ya.prototype:void 0,Dn=Za?Za.valueOf:void 0;function $_(r,e,t,n,i,a,o){switch(t){case w_:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case b_:return!(r.byteLength!=e.byteLength||!a(new Ka(r),new Ka(e)));case l_:case p_:case d_:return a_(+r,+e);case h_:return r.name==e.name&&r.message==e.message;case v_:case __:return r==e+"";case y_:var f=u_;case g_:var s=n&s_;if(f||(f=f_),r.size!=e.size&&!s)return!1;var c=o.get(r);if(c)return c==e;n|=c_,o.set(r,e);var l=o_(f(r),f(e),n,i,a,o);return o.delete(r),l;case m_:if(Dn)return Dn.call(r)==Dn.call(e)}return!1}var E_=$_;function A_(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Bn=A_,O_=Bn,S_=C;function T_(r,e,t){var n=e(r);return S_(r)?n:O_(n,t(r))}var Ja=T_;function x_(r,e){for(var t=-1,n=r==null?0:r.length,i=0,a=[];++t<n;){var o=r[t];e(o,t,r)&&(a[i++]=o)}return a}var P_=x_;function I_(){return[]}var Qa=I_,F_=P_,R_=Qa,M_=Object.prototype,N_=M_.propertyIsEnumerable,eo=Object.getOwnPropertySymbols,D_=eo?function(r){return r==null?[]:(r=Object(r),F_(eo(r),function(e){return N_.call(r,e)}))}:R_,Un=D_,B_=Ja,U_=Un,C_=Ge;function L_(r){return B_(r,C_,U_)}var ro=L_,to=ro,j_=1,k_=Object.prototype,V_=k_.hasOwnProperty;function q_(r,e,t,n,i,a){var o=t&j_,f=to(r),s=f.length,c=to(e),l=c.length;if(s!=l&&!o)return!1;for(var u=s;u--;){var p=f[u];if(!(o?p in e:V_.call(e,p)))return!1}var d=a.get(r),_=a.get(e);if(d&&_)return d==e&&_==r;var E=!0;a.set(r,e),a.set(e,r);for(var $=o;++u<s;){p=f[u];var b=r[p],S=e[p];if(n)var h=o?n(S,b,p,e,r,a):n(b,S,p,r,e,a);if(!(h===void 0?b===S||i(b,S,t,n,a):h)){E=!1;break}$||($=p=="constructor")}if(E&&!$){var O=r.constructor,P=e.constructor;O!=P&&"constructor"in r&&"constructor"in e&&!(typeof O=="function"&&O instanceof O&&typeof P=="function"&&P instanceof P)&&(E=!1)}return a.delete(r),a.delete(e),E}var G_=q_,H_=Se,W_=Q,z_=H_(W_,"DataView"),X_=z_,Y_=Se,K_=Q,Z_=Y_(K_,"Promise"),J_=Z_,Q_=Se,em=Q,rm=Q_(em,"Set"),tm=rm,nm=Se,im=Q,am=nm(im,"WeakMap"),om=am,Cn=X_,Ln=Rn,jn=J_,kn=tm,Vn=om,no=oe,Ye=Ta,io="[object Map]",um="[object Object]",ao="[object Promise]",oo="[object Set]",uo="[object WeakMap]",fo="[object DataView]",fm=Ye(Cn),sm=Ye(Ln),cm=Ye(jn),lm=Ye(kn),pm=Ye(Vn),xe=no;(Cn&&xe(new Cn(new ArrayBuffer(1)))!=fo||Ln&&xe(new Ln)!=io||jn&&xe(jn.resolve())!=ao||kn&&xe(new kn)!=oo||Vn&&xe(new Vn)!=uo)&&(xe=function(r){var e=no(r),t=e==um?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case fm:return fo;case sm:return io;case cm:return ao;case lm:return oo;case pm:return uo}return e});var ot=xe,qn=Nn,hm=za,ym=E_,dm=G_,so=ot,co=C,lo=lr.exports,vm=Va,gm=1,po="[object Arguments]",ho="[object Array]",ut="[object Object]",_m=Object.prototype,yo=_m.hasOwnProperty;function mm(r,e,t,n,i,a){var o=co(r),f=co(e),s=o?ho:so(r),c=f?ho:so(e);s=s==po?ut:s,c=c==po?ut:c;var l=s==ut,u=c==ut,p=s==c;if(p&&lo(r)){if(!lo(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new qn),o||vm(r)?hm(r,e,t,n,i,a):ym(r,e,s,t,n,i,a);if(!(t&gm)){var d=l&&yo.call(r,"__wrapped__"),_=u&&yo.call(e,"__wrapped__");if(d||_){var E=d?r.value():r,$=_?e.value():e;return a||(a=new qn),i(E,$,t,n,a)}}return p?(a||(a=new qn),dm(r,e,t,n,i,a)):!1}var bm=mm,wm=bm,vo=H;function go(r,e,t,n,i){return r===e?!0:r==null||e==null||!vo(r)&&!vo(e)?r!==r&&e!==e:wm(r,e,t,n,go,i)}var _o=go,$m=Nn,Em=_o,Am=1,Om=2;function Sm(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var f=t[i];if(o&&f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++i<a;){f=t[i];var s=f[0],c=r[s],l=f[1];if(o&&f[2]){if(c===void 0&&!(s in r))return!1}else{var u=new $m;if(n)var p=n(c,l,s,r,e,u);if(!(p===void 0?Em(l,c,Am|Om,n,u):p))return!1}}return!0}var Tm=Sm,xm=ve;function Pm(r){return r===r&&!xm(r)}var mo=Pm,Im=mo,Fm=Ge;function Rm(r){for(var e=Fm(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Im(i)]}return e}var Mm=Rm;function Nm(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var bo=Nm,Dm=Tm,Bm=Mm,Um=bo;function Cm(r){var e=Bm(r);return e.length==1&&e[0][2]?Um(e[0][0],e[0][1]):function(t){return t===r||Dm(t,r,e)}}var Lm=Cm,jm=oe,km=H,Vm="[object Symbol]";function qm(r){return typeof r=="symbol"||km(r)&&jm(r)==Vm}var ft=qm,Gm=C,Hm=ft,Wm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zm=/^\w*$/;function Xm(r,e){if(Gm(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Hm(r)?!0:zm.test(r)||!Wm.test(r)||e!=null&&r in Object(e)}var Gn=Xm,wo=Mn,Ym="Expected a function";function Hn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(Ym);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(Hn.Cache||wo),t}Hn.Cache=wo;var Km=Hn,Zm=Km,Jm=500;function Qm(r){var e=Zm(r,function(n){return t.size===Jm&&t.clear(),n}),t=e.cache;return e}var e0=Qm,r0=e0,t0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n0=/\\(\\)?/g,i0=r0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(t0,function(t,n,i,a){e.push(i?a.replace(n0,"$1"):n||t)}),e}),a0=i0;function o0(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var st=o0,$o=Ve,u0=st,f0=C,s0=ft,c0=1/0,Eo=$o?$o.prototype:void 0,Ao=Eo?Eo.toString:void 0;function Oo(r){if(typeof r=="string")return r;if(f0(r))return u0(r,Oo)+"";if(s0(r))return Ao?Ao.call(r):"";var e=r+"";return e=="0"&&1/r==-c0?"-0":e}var l0=Oo,p0=l0;function h0(r){return r==null?"":p0(r)}var y0=h0,d0=C,v0=Gn,g0=a0,_0=y0;function m0(r,e){return d0(r)?r:v0(r,e)?[r]:g0(_0(r))}var ct=m0,b0=ft,w0=1/0;function $0(r){if(typeof r=="string"||b0(r))return r;var e=r+"";return e=="0"&&1/r==-w0?"-0":e}var hr=$0,E0=ct,A0=hr;function O0(r,e){e=E0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[A0(e[t++])];return t&&t==n?r:void 0}var Wn=O0,S0=Wn;function T0(r,e,t){var n=r==null?void 0:S0(r,e);return n===void 0?t:n}var x0=T0;function P0(r,e){return r!=null&&e in Object(r)}var I0=P0,F0=ct,R0=xn,M0=C,N0=Tn,D0=Sn,B0=hr;function U0(r,e,t){e=F0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=B0(e[n]);if(!(a=r!=null&&t(r,o)))break;r=r[o]}return a||++n!=i?a:(i=r==null?0:r.length,!!i&&D0(i)&&N0(o,i)&&(M0(r)||R0(r)))}var C0=U0,L0=I0,j0=C0;function k0(r,e){return r!=null&&j0(r,e,L0)}var V0=k0,q0=_o,G0=x0,H0=V0,W0=Gn,z0=mo,X0=bo,Y0=hr,K0=1,Z0=2;function J0(r,e){return W0(r)&&z0(e)?X0(Y0(r),e):function(t){var n=G0(t,r);return n===void 0&&n===e?H0(t,r):q0(e,n,K0|Z0)}}var Q0=J0;function eb(r){return function(e){return e?.[r]}}var rb=eb,tb=Wn;function nb(r){return function(e){return tb(e,r)}}var ib=nb,ab=rb,ob=ib,ub=Gn,fb=hr;function sb(r){return ub(r)?ab(fb(r)):ob(r)}var cb=sb,lb=Lm,pb=Q0,hb=Jr,yb=C,db=cb;function vb(r){return typeof r=="function"?r:r==null?hb:typeof r=="object"?yb(r)?pb(r[0],r[1]):lb(r):db(r)}var So=vb,gb=cd,_b=Vd,mb=So,bb=C,wb=Ba;function $b(r,e,t){var n=bb(r)?gb:_b;return t&&wb(r,e,t)&&(e=void 0),n(r,mb(e))}var zn=$b;Object.defineProperty(Te,"__esModule",{value:!0}),Te.calculatePadding=Sb,Te.slicePadding=Tb;var Eb=zn,Ab=Ob(Eb);function Ob(r){return r&&r.__esModule?r:{default:r}}function Sb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Tb(r,e){var t=r.slice(e),n=(0,Ab.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(et,"__esModule",{value:!0}),et.Cursor=void 0;var xb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Pb=Te;function Ib(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Xn=function(){function r(e){Ib(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return xb(r,[{key:"_setBuffer",value:function(t){this._buffer=t,this.length=t.length}},{key:"buffer",value:function(){return this._buffer}},{key:"tap",value:function(t){return t(this),this}},{key:"clone",value:function(t){var n=new this.constructor(this.buffer());return n.seek(arguments.length===0?this.tell():t),n}},{key:"tell",value:function(){return this._index}},{key:"seek",value:function(t,n){return arguments.length===1&&(n=t,t="="),t==="+"?this._index+=n:t==="-"?this._index-=n:this._index=n,this}},{key:"rewind",value:function(){return this.seek(0)}},{key:"eof",value:function(){return this.tell()===this.buffer().length}},{key:"write",value:function(t,n,i){return this.seek("+",this.buffer().write(t,this.tell(),n,i))}},{key:"fill",value:function(t,n){return arguments.length===1&&(n=this.buffer().length-this.tell()),this.buffer().fill(t,this.tell(),this.tell()+n),this.seek("+",n),this}},{key:"slice",value:function(t){arguments.length===0&&(t=this.length-this.tell());var n=new this.constructor(this.buffer().slice(this.tell(),this.tell()+t));return this.seek("+",t),n}},{key:"copyFrom",value:function(t){var n=t instanceof y?t:t.buffer();return n.copy(this.buffer(),this.tell(),0,n.length),this.seek("+",n.length),this}},{key:"concat",value:function(t){t.forEach(function(i,a){i instanceof r&&(t[a]=i.buffer())}),t.unshift(this.buffer());var n=y.concat(t);return this._setBuffer(n),this}},{key:"toString",value:function(t,n){arguments.length===0?(t="utf8",n=this.buffer().length-this.tell()):arguments.length===1&&(n=this.buffer().length-this.tell());var i=this.buffer().toString(t,this.tell(),this.tell()+n);return this.seek("+",n),i}},{key:"writeBufferPadded",value:function(t){var n=(0,Pb.calculatePadding)(t.length),i=y.alloc(n);return this.copyFrom(new r(t)).copyFrom(new r(i))}}]),r}();[[1,["readInt8","readUInt8"]],[2,["readInt16BE","readInt16LE","readUInt16BE","readUInt16LE"]],[4,["readInt32BE","readInt32LE","readUInt32BE","readUInt32LE","readFloatBE","readFloatLE"]],[8,["readDoubleBE","readDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Xn.prototype[e]=function(){var n=this.buffer()[e](this.tell());return this.seek("+",r[0]),n}})}),[[1,["writeInt8","writeUInt8"]],[2,["writeInt16BE","writeInt16LE","writeUInt16BE","writeUInt16LE"]],[4,["writeInt32BE","writeInt32LE","writeUInt32BE","writeUInt32LE","writeFloatBE","writeFloatLE"]],[8,["writeDoubleBE","writeDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Xn.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),et.Cursor=Xn,Object.defineProperty(M,"__esModule",{value:!0}),M.default=Ub;var Fb=Oa.exports,To=Po(Fb),Rb=An,Mb=Po(Rb),xo=et;function Po(r){return r&&r.__esModule?r:{default:r}}var Nb=Math.pow(2,16),Db={toXDR:function(e){var t=new xo.Cursor(Nb);this.write(e,t);var n=t.tell();return t.rewind(),t.slice(n).buffer()},fromXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw",n=void 0;switch(t){case"raw":n=e;break;case"hex":n=y.from(e,"hex");break;case"base64":n=y.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new xo.Cursor(n),a=this.read(i);return a},validateXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch{return!1}}},Bb={toXDR:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw",t=this.constructor.toXDR(this);switch(e){case"raw":return t;case"hex":return t.toString("hex");case"base64":return t.toString("base64");default:throw new Error("Invalid format "+e+', must be "raw", "hex", "base64"')}}};function Ub(r){(0,To.default)(r,Db),(0,Mb.default)(r)&&(0,To.default)(r.prototype,Bb)}Object.defineProperty(ae,"__esModule",{value:!0}),ae.Int=void 0;var Cb=Kr,Io=Fo(Cb),Lb=M,jb=Fo(Lb);function Fo(r){return r&&r.__esModule?r:{default:r}}var yr=ae.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Io.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,Io.default)(e)||Math.floor(e)!==e?!1:e>=yr.MIN_VALUE&&e<=yr.MAX_VALUE}};yr.MAX_VALUE=Math.pow(2,31)-1,yr.MIN_VALUE=-Math.pow(2,31),(0,jb.default)(yr);var lt={};function kb(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Yn={exports:{}};(function(r){/**
|
|
25
25
|
* @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
|
26
26
|
* Released under the Apache License, Version 2.0
|
|
27
27
|
* see: https://github.com/dcodeIO/Long.js for details
|
|
28
|
-
*/(function(e,t){typeof Wb=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(te,function(){function e(l,u,p){this.low=l|0,this.high=u|0,this.unsigned=!!p}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,p){var d,_;return p?(u=u>>>0,0<=u&&u<256&&(_=n[u],_)?_:(d=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=d),d)):(u=u|0,-128<=u&&u<128&&(_=t[u],_)?_:(d=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=d),d))},e.fromNumber=function(u,p){return p=!!p,isNaN(u)||!isFinite(u)?e.ZERO:!p&&u<=-s?e.MIN_VALUE:!p&&u+1>=s?e.MAX_VALUE:p&&u>=f?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,p).negate():new e(u%o|0,u/o|0,p)},e.fromBits=function(u,p,d){return new e(u,p,d)},e.fromString=function(u,p,d){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof p=="number"&&(d=p,p=!1),d=d||10,d<2||36<d)throw Error("radix out of range: "+d);var _;if((_=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(_===0)return e.fromString(u.substring(1),p,d).negate();for(var E=e.fromNumber(Math.pow(d,8)),$=e.ZERO,b=0;b<u.length;b+=8){var S=Math.min(8,u.length-b),h=parseInt(u.substring(b,b+S),d);if(S<8){var A=e.fromNumber(Math.pow(d,S));$=$.multiply(A).add(e.fromNumber(h))}else $=$.multiply(E),$=$.add(e.fromNumber(h))}return $.unsigned=p,$},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,f=o*o,s=f/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),_=this.divide(d);return p=_.multiply(d).subtract(this),_.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var E=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var $="";;){var b=p.divide(E),S=p.subtract(b.multiply(E)).toInt()>>>0,h=S.toString(u);if(p=b,p.isZero())return h+$;for(;h.length<6;)h="0"+h;$=""+h+$}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var p=this.isNegative(),d=u.isNegative();return p&&!d?-1:!p&&d?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(u){e.isLong(u)||(u=e.fromValue(u));var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,b=u.high&65535,S=u.low>>>16,h=u.low&65535,A=0,P=0,R=0,m=0;return m+=E+h,R+=m>>>16,m&=65535,R+=_+S,P+=R>>>16,R&=65535,P+=d+b,A+=P>>>16,P&=65535,A+=p+$,A&=65535,e.fromBits(R<<16|m,A<<16|P,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(c)&&u.lessThan(c))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,b=u.high&65535,S=u.low>>>16,h=u.low&65535,A=0,P=0,R=0,m=0;return m+=E*h,R+=m>>>16,m&=65535,R+=_*h,P+=R>>>16,R&=65535,R+=E*S,P+=R>>>16,R&=65535,P+=d*h,A+=P>>>16,P&=65535,P+=_*S,A+=P>>>16,P&=65535,P+=E*b,A+=P>>>16,P&=65535,A+=p*h+d*S+_*b+E*$,A&=65535,e.fromBits(R<<16|m,A<<16|P,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var p,d,_;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var E=this.shiftRight(1);return p=E.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),_=p.add(d.divide(u)),_)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(_=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var $=Math.ceil(Math.log(p)/Math.LN2),b=$<=48?1:Math.pow(2,$-48),S=e.fromNumber(p),h=S.multiply(u);h.isNegative()||h.greaterThan(d);)p-=b,S=e.fromNumber(p,this.unsigned),h=S.multiply(u);S.isZero()&&(S=e.ONE),_=_.add(S),d=d.subtract(h)}return _},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var p=this.high;if(u<32){var d=this.low;return e.fromBits(d>>>u|p<<32-u,p>>>u,this.unsigned)}else return u===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>u-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(Zn),Object.defineProperty(ht,"__esModule",{value:!0}),ht.Hyper=void 0;var zb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Bo=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},Xb=Zn.exports,vr=No(Xb),Yb=M,Kb=No(Yb);function No(r){return r&&r.__esModule?r:{default:r}}function Zb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Jb(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Qb(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var gr=ht.Hyper=function(r){Qb(e,r),zb(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not a Hyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^-?\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Bo(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!1);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Bo(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!1);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return Zb(this,e),Jb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(vr.default);(0,Kb.default)(gr),gr.MAX_VALUE=new gr(vr.default.MAX_VALUE.low,vr.default.MAX_VALUE.high),gr.MIN_VALUE=new gr(vr.default.MIN_VALUE.low,vr.default.MIN_VALUE.high);var xe={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.UnsignedInt=void 0;var ew=Jr,Do=Uo(ew),rw=M,tw=Uo(rw);function Uo(r){return r&&r.__esModule?r:{default:r}}var _r=xe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Do.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");if(e<0)throw new Error("XDR Write Error: negative number "+e);t.writeUInt32BE(e)},isValid:function(e){return!(0,Do.default)(e)||Math.floor(e)!==e?!1:e>=_r.MIN_VALUE&&e<=_r.MAX_VALUE}};_r.MAX_VALUE=Math.pow(2,32)-1,_r.MIN_VALUE=0,(0,tw.default)(_r);var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.UnsignedHyper=void 0;var nw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Co=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},iw=Zn.exports,mr=Lo(iw),aw=M,ow=Lo(aw);function Lo(r){return r&&r.__esModule?r:{default:r}}function uw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function fw(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function sw(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var br=yt.UnsignedHyper=function(r){sw(e,r),nw(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not an UnsignedHyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Co(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!0);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Co(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!0);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return uw(this,e),fw(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(mr.default);(0,ow.default)(br),br.MAX_VALUE=new br(mr.default.MAX_UNSIGNED_VALUE.low,mr.default.MAX_UNSIGNED_VALUE.high),br.MIN_VALUE=new br(mr.default.MIN_VALUE.low,mr.default.MIN_VALUE.high);var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.Float=void 0;var cw=Jr,jo=ko(cw),lw=M,pw=ko(lw);function ko(r){return r&&r.__esModule?r:{default:r}}var hw=dt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,jo.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,jo.default)(e)}};(0,pw.default)(hw);var vt={};Object.defineProperty(vt,"__esModule",{value:!0}),vt.Double=void 0;var yw=Jr,qo=Vo(yw),dw=M,vw=Vo(dw);function Vo(r){return r&&r.__esModule?r:{default:r}}var gw=vt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,qo.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,qo.default)(e)}};(0,vw.default)(gw);var gt={};Object.defineProperty(gt,"__esModule",{value:!0}),gt.Quadruple=void 0;var _w=M,mw=bw(_w);function bw(r){return r&&r.__esModule?r:{default:r}}var ww=gt.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,mw.default)(ww);var wr={},$w=fe,Ew=H,Ow="[object Boolean]";function Aw(r){return r===!0||r===!1||Ew(r)&&$w(r)==Ow}var Sw=Aw;Object.defineProperty(wr,"__esModule",{value:!0}),wr.Bool=void 0;var Tw=Sw,Iw=Ho(Tw),Go=ue,Pw=M,xw=Ho(Pw);function Ho(r){return r&&r.__esModule?r:{default:r}}var Fw=wr.Bool={read:function(e){var t=Go.Int.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new Error("XDR Read Error: Got "+t+" when trying to read a bool")}},write:function(e,t){var n=e?1:0;return Go.Int.write(n,t)},isValid:function(e){return(0,Iw.default)(e)}};(0,xw.default)(Fw);var _t={},Rw=fe,Mw=C,Bw=H,Nw="[object String]";function Dw(r){return typeof r=="string"||!Mw(r)&&Bw(r)&&Rw(r)==Nw}var Wo=Dw;Object.defineProperty(_t,"__esModule",{value:!0}),_t.String=void 0;var Uw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Cw=Wo,zo=Jn(Cw),Lw=C,jw=Jn(Lw),Xo=ue,kw=xe,Yo=Ie,qw=M,Vw=Jn(qw);function Jn(r){return r&&r.__esModule?r:{default:r}}function Gw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Hw=_t.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kw.UnsignedInt.MAX_VALUE;Gw(this,r),this._maxLength=e}return Uw(r,[{key:"read",value:function(t){var n=Xo.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,Yo.calculatePadding)(n),a=t.slice(n);return(0,Yo.slicePadding)(t,i),a.buffer()}},{key:"readString",value:function(t){return this.read(t).toString("utf8")}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));var i=void 0;(0,zo.default)(t)?i=y.from(t,"utf8"):i=y.from(t),Xo.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,zo.default)(t))n=y.from(t,"utf8");else if((0,jw.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,Vw.default)(Hw.prototype);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.Opaque=void 0;var Ww=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Ko=Ie,zw=M,Xw=Yw(zw);function Yw(r){return r&&r.__esModule?r:{default:r}}function Kw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Zw=mt.Opaque=function(){function r(e){Kw(this,r),this._length=e,this._padding=(0,Ko.calculatePadding)(e)}return Ww(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Ko.slicePadding)(t,this._padding),n.buffer()}},{key:"write",value:function(t,n){if(t.length!==this._length)throw new Error("XDR Write Error: Got "+t.length+" bytes, expected "+this._length);n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length===this._length}}]),r}();(0,Xw.default)(Zw.prototype);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.VarOpaque=void 0;var Jw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Zo=ue,Qw=xe,Jo=Ie,e1=M,r1=t1(e1);function t1(r){return r&&r.__esModule?r:{default:r}}function n1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var i1=bt.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qw.UnsignedInt.MAX_VALUE;n1(this,r),this._maxLength=e}return Jw(r,[{key:"read",value:function(t){var n=Zo.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length VarOpaque,"+("max allowed is "+this._maxLength));var i=(0,Jo.calculatePadding)(n),a=t.slice(n);return(0,Jo.slicePadding)(t,i),a.buffer()}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));Zo.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,r1.default)(i1.prototype);var wt={},Fe={exports:{}};function a1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Qo=a1,o1=et;function u1(r){return typeof r=="function"?r:o1}var eu=u1,f1=Qo,s1=Mn,c1=eu,l1=C;function p1(r,e){var t=l1(r)?f1:s1;return t(r,c1(e))}var h1=p1;(function(r){r.exports=h1})(Fe);var y1=/\s/;function d1(r){for(var e=r.length;e--&&y1.test(r.charAt(e)););return e}var v1=d1,g1=v1,_1=/^\s+/;function m1(r){return r&&r.slice(0,g1(r)+1).replace(_1,"")}var b1=m1,w1=b1,ru=ge,$1=ct,tu=0/0,E1=/^[-+]0x[0-9a-f]+$/i,O1=/^0b[01]+$/i,A1=/^0o[0-7]+$/i,S1=parseInt;function T1(r){if(typeof r=="number")return r;if($1(r))return tu;if(ru(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=ru(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=w1(r);var t=O1.test(r);return t||A1.test(r)?S1(r.slice(2),t?2:8):E1.test(r)?tu:+r}var I1=T1,P1=I1,nu=1/0,x1=17976931348623157e292;function F1(r){if(!r)return r===0?r:0;if(r=P1(r),r===nu||r===-nu){var e=r<0?-1:1;return e*x1}return r===r?r:0}var R1=F1,M1=R1;function B1(r){var e=M1(r),t=e%1;return e===e?t?e-t:e:0}var N1=B1,D1=La,U1=eu,C1=N1,L1=9007199254740991,Qn=4294967295,j1=Math.min;function k1(r,e){if(r=C1(r),r<1||r>L1)return[];var t=Qn,n=j1(r,Qn);e=U1(e),r-=Qn;for(var i=D1(n,e);++t<r;)e(t);return i}var iu=k1;Object.defineProperty(wt,"__esModule",{value:!0}),wt.Array=void 0;var q1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),V1=Yn,G1=$r(V1),H1=Fe.exports,W1=$r(H1),z1=iu,X1=$r(z1),Y1=C,au=$r(Y1),K1=M,Z1=$r(K1);function $r(r){return r&&r.__esModule?r:{default:r}}function J1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Q1=wt.Array=function(){function r(e,t){J1(this,r),this._childType=e,this._length=t}return q1(r,[{key:"read",value:function(t){var n=this;return(0,X1.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,au.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,W1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,au.default)(t)||t.length!==this._length?!1:(0,G1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,Z1.default)(Q1.prototype);var $t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.VarArray=void 0;var e$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),r$=Yn,t$=Er(r$),n$=Fe.exports,i$=Er(n$),a$=iu,o$=Er(a$),u$=C,ou=Er(u$),f$=xe,uu=ue,s$=M,c$=Er(s$);function Er(r){return r&&r.__esModule?r:{default:r}}function l$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var p$=$t.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f$.UnsignedInt.MAX_VALUE;l$(this,r),this._childType=e,this._maxLength=t}return e$(r,[{key:"read",value:function(t){var n=this,i=uu.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,o$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ou.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));uu.Int.write(t.length,n),(0,i$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ou.default)(t)||t.length>this._maxLength?!1:(0,t$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,c$.default)(p$.prototype);var Et={};function h$(r){return r===null}var y$=h$;function d$(r){return r===void 0}var Or=d$;Object.defineProperty(Et,"__esModule",{value:!0}),Et.Option=void 0;var v$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),g$=y$,fu=ei(g$),_$=Or,su=ei(_$),cu=wr,m$=M,b$=ei(m$);function ei(r){return r&&r.__esModule?r:{default:r}}function w$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var $$=Et.Option=function(){function r(e){w$(this,r),this._childType=e}return v$(r,[{key:"read",value:function(t){if(cu.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,fu.default)(t)||(0,su.default)(t));cu.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,fu.default)(t)||(0,su.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,b$.default)($$.prototype);var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.Void=void 0;var E$=Or,lu=pu(E$),O$=M,A$=pu(O$);function pu(r){return r&&r.__esModule?r:{default:r}}var S$=Ar.Void={read:function(){},write:function(e){if(!(0,lu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,lu.default)(e)}};(0,A$.default)(S$);var Ot={},T$=lt;function I$(r,e){return T$(e,function(t){return r[t]})}var P$=I$,x$=P$,F$=He;function R$(r){return r==null?[]:x$(r,F$(r))}var M$=R$;Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.Enum=void 0;var B$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),N$=Fe.exports,D$=ri(N$),U$=M$,C$=ri(U$),hu=ue,L$=M,j$=ri(L$);function ri(r){return r&&r.__esModule?r:{default:r}}function k$(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function q$(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function yu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var V$=Ot.Enum=function(){function r(e,t){yu(this,r),this.name=e,this.value=t}return B$(r,null,[{key:"read",value:function(t){var n=hu.Int.read(t);if(!this._byValue.has(n))throw new Error("XDR Read Error: Unknown "+this.enumName+" member for value "+n);return this._byValue.get(n)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: Unknown "+t+" is not a "+this.enumName);hu.Int.write(t.value,n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"members",value:function(){return this._members}},{key:"values",value:function(){return(0,C$.default)(this._members)}},{key:"fromName",value:function(t){var n=this._members[t];if(!n)throw new Error(t+" is not a member of "+this.enumName);return n}},{key:"fromValue",value:function(t){var n=this._byValue.get(t);if(!n)throw new Error(t+" is not a value of any member of "+this.enumName);return n}},{key:"create",value:function(t,n,i){var a=function(o){q$(f,o);function f(){return yu(this,f),k$(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,D$.default)(i,function(o,f){var s=new a(f,o);a._members[f]=s,a._byValue.set(o,s),a[f]=function(){return s}}),a}}]),r}();(0,j$.default)(V$);var At={},G$=Mn,H$=lr;function W$(r,e){var t=-1,n=H$(r)?Array(r.length):[];return G$(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var z$=W$,X$=lt,Y$=Io,K$=z$,Z$=C;function J$(r,e){var t=Z$(r)?X$:K$;return t(r,Y$(e))}var Q$=J$;function eE(r){for(var e=-1,t=r==null?0:r.length,n={};++e<t;){var i=r[e];n[i[0]]=i[1]}return n}var rE=eE,Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});var tE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function nE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Sr.Reference=function(){function r(){nE(this,r)}return tE(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(At,"__esModule",{value:!0}),At.Struct=void 0;var St=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var f=e[Symbol.iterator](),s;!(i=(s=f.next()).done)&&(n.push(s.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),iE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),aE=Fe.exports,du=Tr(aE),oE=Q$,uE=Tr(oE),fE=Or,sE=Tr(fE),cE=rE,lE=Tr(cE),pE=Sr,hE=M,yE=Tr(hE);function Tr(r){return r&&r.__esModule?r:{default:r}}function dE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function vE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function vu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var gE=At.Struct=function(){function r(e){vu(this,r),this._attributes=e||{}}return iE(r,null,[{key:"read",value:function(t){var n=(0,uE.default)(this._fields,function(i){var a=St(i,2),o=a[0],f=a[1],s=f.read(t);return[o,s]});return new this((0,lE.default)(n))}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.structName);(0,du.default)(this._fields,function(i){var a=St(i,2),o=a[0],f=a[1],s=t._attributes[o];f.write(s,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){vE(f,o);function f(){return vu(this,f),dE(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var f=St(o,2),s=f[0],c=f[1];return c instanceof pE.Reference&&(c=c.resolve(t)),[s,c]}),(0,du.default)(a._fields,function(o){var f=St(o,1),s=f[0];a.prototype[s]=_E(s)}),a}}]),r}();(0,yE.default)(gE);function _E(r){return function(t){return(0,sE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Union=void 0;var mE=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var f=e[Symbol.iterator](),s;!(i=(s=f.next()).done)&&(n.push(s.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),bE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),wE=Fe.exports,It=xt(wE),$E=Or,gu=xt($E),EE=Wo,_u=xt(EE),Pt=Ar,ti=Sr,OE=M,AE=xt(OE);function xt(r){return r&&r.__esModule?r:{default:r}}function SE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function TE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function mu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var IE=Tt.Union=function(){function r(e,t){mu(this,r),this.set(e,t)}return bE(r,[{key:"set",value:function(t,n){(0,_u.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==Pt.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===Pt.Void?Pt.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,gu.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(f){TE(s,f);function s(){return mu(this,s),SE(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ti.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,It.default)(i.arms,function(f,s){f instanceof ti.Reference&&(f=f.resolve(t)),a._arms[s]=f});var o=i.defaultArm;return o instanceof ti.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,It.default)(i.switches,function(f){var s=mE(f,2),c=s[0],l=s[1];(0,_u.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,gu.default)(a._switchOn.values)||(0,It.default)(a._switchOn.values(),function(f){a[f.name]=function(s){return new a(f,s)},a.prototype[f.name]=function(c){return this.set(f,c)}}),(0,It.default)(a._arms,function(f,s){f!==Pt.Void&&(a.prototype[s]=function(){return this.get(s)})}),a}}]),r}();(0,AE.default)(IE),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ue;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=ht;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=xe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=yt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=dt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=vt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var f=gt;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var s=wr;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var c=_t;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=mt;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=bt;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=wt;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=$t;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=Et;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var E=Ar;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})});var $=Ot;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=At;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var S=Tt;Object.keys(S).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return S[h]}})})}(An);var bu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var w=0;w<g.length;w++){var O=g[w];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(v,O.key,O)}}return function(v,g,w){return g&&m(v.prototype,g),w&&m(v,w),v}}(),t=Sr;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=_;var n=Or,i=l(n),a=Fe.exports,o=l(a),f=An,s=c(f);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(v[g]=m[g]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function d(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function _(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var g=new R(v);m(g),g.resolve()}return v}var E=function(m){d(v,m);function v(g){u(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return w.name=g,w}return e(v,[{key:"resolve",value:function(w){var O=w.definitions[this.name];return O.resolve(w)}}]),v}(t.Reference),$=function(m){d(v,m);function v(g,w){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var L=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return L.childReference=g,L.length=w,L.variable=O,L}return e(v,[{key:"resolve",value:function(w){var O=this.childReference,L=this.length;return O instanceof t.Reference&&(O=O.resolve(w)),L instanceof t.Reference&&(L=L.resolve(w)),this.variable?new s.VarArray(O,L):new s.Array(O,L)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g){u(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return w.childReference=g,w.name=g.name,w}return e(v,[{key:"resolve",value:function(w){var O=this.childReference;return O instanceof t.Reference&&(O=O.resolve(w)),new s.Option(O)}}]),v}(t.Reference),S=function(m){d(v,m);function v(g,w){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.sizedType=g,O.length=w,O}return e(v,[{key:"resolve",value:function(w){var O=this.length;return O instanceof t.Reference&&(O=O.resolve(w)),new this.sizedType(O)}}]),v}(t.Reference),h=function(){function m(v,g,w){u(this,m),this.constructor=v,this.name=g,this.config=w}return e(m,[{key:"resolve",value:function(g){return this.name in g.results?g.results[this.name]:this.constructor(g,this.name,this.config)}}]),m}();function A(m,v,g){return g instanceof t.Reference&&(g=g.resolve(m)),m.results[v]=g,g}function P(m,v,g){return m.results[v]=g,g}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(g,w){var O=new h(s.Enum.create,g,w);this.define(g,O)}},{key:"struct",value:function(g,w){var O=new h(s.Struct.create,g,w);this.define(g,O)}},{key:"union",value:function(g,w){var O=new h(s.Union.create,g,w);this.define(g,O)}},{key:"typedef",value:function(g,w){var O=new h(A,g,w);this.define(g,O)}},{key:"const",value:function(g,w){var O=new h(P,g,w);this.define(g,O)}},{key:"void",value:function(){return s.Void}},{key:"bool",value:function(){return s.Bool}},{key:"int",value:function(){return s.Int}},{key:"hyper",value:function(){return s.Hyper}},{key:"uint",value:function(){return s.UnsignedInt}},{key:"uhyper",value:function(){return s.UnsignedHyper}},{key:"float",value:function(){return s.Float}},{key:"double",value:function(){return s.Double}},{key:"quadruple",value:function(){return s.Quadruple}},{key:"string",value:function(g){return new S(s.String,g)}},{key:"opaque",value:function(g){return new S(s.Opaque,g)}},{key:"varOpaque",value:function(g){return new S(s.VarOpaque,g)}},{key:"array",value:function(g,w){return new $(g,w)}},{key:"varArray",value:function(g,w){return new $(g,w,!0)}},{key:"option",value:function(g){return new b(g)}},{key:"define",value:function(g,w){if((0,i.default)(this._destination[g]))this._definitions[g]=w;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new E(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(w){w.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(bu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=An;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=bu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(wa),Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.xdr=void 0;const PE=(0,wa.config)(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})});Zr.xdr=PE,Object.defineProperty(oe,"__esModule",{value:!0}),oe.decodeToLegacyBoxOrder=oe.encodeLegacyBoxOrder=oe.toBundle=$u=oe.toLineItemProperty=void 0;const ee=Zr;function wu(r){let e={variantId:ee.xdr.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ee.xdr.BundleItem({collectionId:ee.xdr.Uint64.fromString(n.collectionId.toString()),productId:ee.xdr.Uint64.fromString(n.productId.toString()),variantId:ee.xdr.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ee.xdr.BundleItemExt(0)})),ext:new ee.xdr.BundleExt(0)};const t=new ee.xdr.Bundle(e);return ee.xdr.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}var $u=oe.toLineItemProperty=wu;function Eu(r){const e=ee.xdr.BundleEnvelope.fromXDR(r,"base64").v1();return{variantId:e.variantId().toString(),version:e.version(),items:e.items().map(t=>({collectionId:t.collectionId().toString(),productId:t.productId().toString(),variantId:t.variantId().toString(),sku:t.sku().toString(),quantity:t.quantity()}))}}oe.toBundle=Eu;function xE(r,e,t=1){const n={variantId:r.toString(),version:t,items:[]};for(const i in e)if(Object.hasOwnProperty.call(e,i)){const a=e[i];n.items.push({collectionId:a.dsId.toString(),productId:a.pId.toString(),variantId:a.vId.toString(),sku:a.sku||"",quantity:a.qty})}return wu(n)}oe.encodeLegacyBoxOrder=xE;function FE(r){let e={};try{Eu(r).items.forEach(n=>{e[n.variantId]={dsId:n.collectionId,pId:Number.parseInt(n.productId),vId:Number.parseInt(n.variantId),sku:n.sku,qty:n.quantity}})}catch{e=JSON.parse(y.from(r,"base64").toString())}return e}oe.decodeToLegacyBoxOrder=FE;var RE=Ge,ME=He;function BE(r,e){return r&&RE(e,ME(e),r)}var NE=BE,DE=Ge,UE=rt;function CE(r,e){return r&&DE(e,UE(e),r)}var LE=CE,ni={exports:{}};(function(r,e){var t=Q,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,f=o?o.allocUnsafe:void 0;function s(c,l){if(l)return c.slice();var u=c.length,p=f?f(u):new c.constructor(u);return c.copy(p),p}r.exports=s})(ni,ni.exports);function jE(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var kE=jE,qE=Ge,VE=Ln;function GE(r,e){return qE(r,VE(r),e)}var HE=GE,WE=Wa,zE=WE(Object.getPrototypeOf,Object),ii=zE,XE=Cn,YE=ii,KE=Ln,ZE=ro,JE=Object.getOwnPropertySymbols,QE=JE?function(r){for(var e=[];r;)XE(e,KE(r)),r=YE(r);return e}:ZE,Ou=QE,eO=Ge,rO=Ou;function tO(r,e){return eO(r,rO(r),e)}var nO=tO,iO=eo,aO=Ou,oO=rt;function uO(r){return iO(r,oO,aO)}var Au=uO,fO=Object.prototype,sO=fO.hasOwnProperty;function cO(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&sO.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var lO=cO,Su=Ka;function pO(r){var e=new r.constructor(r.byteLength);return new Su(e).set(new Su(r)),e}var ai=pO,hO=ai;function yO(r,e){var t=e?hO(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var dO=yO,vO=/\w*$/;function gO(r){var e=new r.constructor(r.source,vO.exec(r));return e.lastIndex=r.lastIndex,e}var _O=gO,Tu=Ve,Iu=Tu?Tu.prototype:void 0,Pu=Iu?Iu.valueOf:void 0;function mO(r){return Pu?Object(Pu.call(r)):{}}var bO=mO,wO=ai;function $O(r,e){var t=e?wO(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var EO=$O,OO=ai,AO=dO,SO=_O,TO=bO,IO=EO,PO="[object Boolean]",xO="[object Date]",FO="[object Map]",RO="[object Number]",MO="[object RegExp]",BO="[object Set]",NO="[object String]",DO="[object Symbol]",UO="[object ArrayBuffer]",CO="[object DataView]",LO="[object Float32Array]",jO="[object Float64Array]",kO="[object Int8Array]",qO="[object Int16Array]",VO="[object Int32Array]",GO="[object Uint8Array]",HO="[object Uint8ClampedArray]",WO="[object Uint16Array]",zO="[object Uint32Array]";function XO(r,e,t){var n=r.constructor;switch(e){case UO:return OO(r);case PO:case xO:return new n(+r);case CO:return AO(r,t);case LO:case jO:case kO:case qO:case VO:case GO:case HO:case WO:case zO:return IO(r,t);case FO:return new n;case RO:case NO:return new n(r);case MO:return SO(r);case BO:return new n;case DO:return TO(r)}}var YO=XO,KO=ge,xu=Object.create,ZO=function(){function r(){}return function(e){if(!KO(e))return{};if(xu)return xu(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),JO=ZO,QO=JO,eA=ii,rA=Rn;function tA(r){return typeof r.constructor=="function"&&!rA(r)?QO(eA(r)):{}}var nA=tA,iA=ft,aA=H,oA="[object Map]";function uA(r){return aA(r)&&iA(r)==oA}var fA=uA,sA=fA,cA=Fn,Fu=hr.exports,Ru=Fu&&Fu.isMap,lA=Ru?cA(Ru):sA,pA=lA,hA=ft,yA=H,dA="[object Set]";function vA(r){return yA(r)&&hA(r)==dA}var gA=vA,_A=gA,mA=Fn,Mu=hr.exports,Bu=Mu&&Mu.isSet,bA=Bu?mA(Bu):_A,wA=bA,$A=Dn,EA=Qo,OA=Ma,AA=NE,SA=LE,TA=ni.exports,IA=kE,PA=HE,xA=nO,FA=no,RA=Au,MA=ft,BA=lO,NA=YO,DA=nA,UA=C,CA=pr.exports,LA=pA,jA=ge,kA=wA,qA=He,VA=rt,GA=1,HA=2,WA=4,Nu="[object Arguments]",zA="[object Array]",XA="[object Boolean]",YA="[object Date]",KA="[object Error]",Du="[object Function]",ZA="[object GeneratorFunction]",JA="[object Map]",QA="[object Number]",Uu="[object Object]",eS="[object RegExp]",rS="[object Set]",tS="[object String]",nS="[object Symbol]",iS="[object WeakMap]",aS="[object ArrayBuffer]",oS="[object DataView]",uS="[object Float32Array]",fS="[object Float64Array]",sS="[object Int8Array]",cS="[object Int16Array]",lS="[object Int32Array]",pS="[object Uint8Array]",hS="[object Uint8ClampedArray]",yS="[object Uint16Array]",dS="[object Uint32Array]",x={};x[Nu]=x[zA]=x[aS]=x[oS]=x[XA]=x[YA]=x[uS]=x[fS]=x[sS]=x[cS]=x[lS]=x[JA]=x[QA]=x[Uu]=x[eS]=x[rS]=x[tS]=x[nS]=x[pS]=x[hS]=x[yS]=x[dS]=!0,x[KA]=x[Du]=x[iS]=!1;function Ft(r,e,t,n,i,a){var o,f=e&GA,s=e&HA,c=e&WA;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!jA(r))return r;var l=UA(r);if(l){if(o=BA(r),!f)return IA(r,o)}else{var u=MA(r),p=u==Du||u==ZA;if(CA(r))return TA(r,f);if(u==Uu||u==Nu||p&&!i){if(o=s||p?{}:DA(r),!f)return s?xA(r,SA(o,r)):PA(r,AA(o,r))}else{if(!x[u])return i?r:{};o=NA(r,u,f)}}a||(a=new $A);var d=a.get(r);if(d)return d;a.set(r,o),kA(r)?r.forEach(function($){o.add(Ft($,e,t,$,r,a))}):LA(r)&&r.forEach(function($,b){o.set(b,Ft($,e,t,b,r,a))});var _=c?s?RA:FA:s?VA:qA,E=l?void 0:_(r);return EA(E||r,function($,b){E&&(b=$,$=r[b]),OA(o,b,Ft($,e,t,b,r,a))}),o}var vS=Ft;function gS(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var _S=gS;function mS(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}var bS=mS,wS=Xn,$S=bS;function ES(r,e){return e.length<2?r:wS(r,$S(e,0,-1))}var OS=ES,AS=pt,SS=_S,TS=OS,IS=yr;function PS(r,e){return e=AS(e,r),r=TS(r,e),r==null||delete r[IS(SS(e))]}var xS=PS,FS=fe,RS=ii,MS=H,BS="[object Object]",NS=Function.prototype,DS=Object.prototype,Cu=NS.toString,US=DS.hasOwnProperty,CS=Cu.call(Object);function LS(r){if(!MS(r)||FS(r)!=BS)return!1;var e=RS(r);if(e===null)return!0;var t=US.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Cu.call(t)==CS}var jS=LS,kS=jS;function qS(r){return kS(r)?void 0:r}var VS=qS,Lu=Ve,GS=xn,HS=C,ju=Lu?Lu.isConcatSpreadable:void 0;function WS(r){return HS(r)||GS(r)||!!(ju&&r&&r[ju])}var zS=WS,XS=Cn,YS=zS;function ku(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=YS),i||(i=[]);++a<o;){var f=r[a];e>0&&t(f)?e>1?ku(f,e-1,t,n,i):XS(i,f):n||(i[i.length]=f)}return i}var KS=ku,ZS=KS;function JS(r){var e=r==null?0:r.length;return e?ZS(r,1):[]}var QS=JS,eT=QS,rT=Na,tT=Ua;function nT(r){return tT(rT(r,void 0,eT),r+"")}var iT=nT,aT=lt,oT=vS,uT=xS,fT=pt,sT=Ge,cT=VS,lT=iT,pT=Au,hT=1,yT=2,dT=4,vT=lT(function(r,e){var t={};if(r==null)return t;var n=!1;e=aT(e,function(a){return a=fT(a,r),n||(n=a.length>1),a}),sT(r,pT(r),t),n&&(t=oT(t,hT|yT|dT,cT));for(var i=e.length;i--;)uT(t,e[i]);return t}),gT=vT,_T=Object.defineProperty,mT=Object.defineProperties,bT=Object.getOwnPropertyDescriptors,qu=Object.getOwnPropertySymbols,wT=Object.prototype.hasOwnProperty,$T=Object.prototype.propertyIsEnumerable,Vu=(r,e,t)=>e in r?_T(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ET=(r,e)=>{for(var t in e||(e={}))wT.call(e,t)&&Vu(r,t,e[t]);if(qu)for(var t of qu(e))$T.call(e,t)&&Vu(r,t,e[t]);return r},OT=(r,e)=>mT(r,bT(e));function AT(r){try{return JSON.parse(r)}catch{return r}}function ST(r){return Object.entries(r).reduce((e,[t,n])=>OT(ET({},e),{[t]:AT(n)}),{})}var TT=Object.defineProperty,IT=Object.defineProperties,PT=Object.getOwnPropertyDescriptors,Gu=Object.getOwnPropertySymbols,xT=Object.prototype.hasOwnProperty,FT=Object.prototype.propertyIsEnumerable,Hu=(r,e,t)=>e in r?TT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Wu=(r,e)=>{for(var t in e||(e={}))xT.call(e,t)&&Hu(r,t,e[t]);if(Gu)for(var t of Gu(e))FT.call(e,t)&&Hu(r,t,e[t]);return r},zu=(r,e)=>IT(r,PT(e));function Xu(r){var e;const t=ST(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return zu(Wu({},gT(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function Yu(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return zu(Wu({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function RT(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Yu(i)}),t})}const Rt="2020-12",MT={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Ir=new Map;function Mt(r,e){return Ir.has(r)||Ir.set(r,e()),Ir.get(r)}async function oi(r){const{product:e}=await Mt(`product.${r}`,()=>Kr("get",`/product/${Rt}/${r}.json`));return Yu(e)}async function Ku(){return await Mt("storeSettings",()=>Kr("get",`/${Rt}/store_settings.json`).catch(()=>MT))}async function Zu(){const{widget_settings:r}=await Mt("widgetSettings",()=>Kr("get",`/${Rt}/widget_settings.json`));return Xu(r)}async function Ju(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Mt("productsAndSettings",()=>Kr("get",`/product/${Rt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:RT(r),widget_settings:Xu(e),store_settings:t??{}}}async function BT(){const{products:r}=await Ju();return r}async function NT(r){const[e,t,n]=await Promise.all([oi(r),Ku(),Zu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Qu(r){const{bundle_product:e}=await oi(r);return e}async function ef(){return Array.from(Ir.keys()).forEach(r=>Ir.delete(r))}var DT=Object.freeze({__proto__:null,getCDNProduct:oi,getCDNStoreSettings:Ku,getCDNWidgetSettings:Zu,getCDNProductsAndSettings:Ju,getCDNProducts:BT,getCDNProductAndSettings:NT,getCDNBundleSettings:Qu,resetCDNCache:ef});const rf="/bundling-storefront-manager";function UT(){return Math.ceil(Date.now()/1e3)}async function CT(){try{const{timestamp:r}=await On("get",`${rf}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),UT()}}async function LT(r){const e=sr();if(!await tf(r))throw new Error("Bundle selection is invalid.");const t=await CT(),n=$u({variantId:r.externalVariantId,version:t,items:r.selections.map(i=>({collectionId:i.collectionId,productId:i.externalProductId,variantId:i.externalVariantId,quantity:i.quantity,sku:""}))});try{const i=await On("post",`${rf}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}async function tf(r){try{const e=await Qu(r.externalProductId);return!!r&&!!e}catch{return console.error("Error fetching bundle settings"),!1}}var jT=Object.freeze({__proto__:null,getBundleId:LT,validateBundle:tf});async function kT(r,e){const{charge:t}=await T("get","/charges",{id:e},r);return t}function qT(r,e){return T("get","/charges",{query:e},r)}async function VT(r,e,t){const{charge:n}=await T("post",`/charges/${e}/apply_discount`,{data:t},r);return n}async function GT(r,e){const{charge:t}=await T("post",`/charges/${e}/remove_discount`,{},r);return t}async function HT(r,e){const{charge:t}=await T("post",`/charges/${e}/skip`,{},r);return t}async function WT(r,e){const{charge:t}=await T("post",`/charges/${e}/unskip`,{},r);return t}var zT=Object.freeze({__proto__:null,getCharge:kT,listCharges:qT,applyDiscount:VT,removeDiscount:GT,skipCharge:HT,unskipCharge:WT});async function XT(r,e){const{membership:t}=await T("get","/memberships",{id:e},r);return t}function YT(r,e){return T("get","/memberships",{query:e},r)}async function KT(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function ZT(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/activate`,{data:t},r);return n}var JT=Object.freeze({__proto__:null,getMembership:XT,listMemberships:YT,cancelMembership:KT,activateMembership:ZT});async function QT(r,e){const{onetime:t}=await T("get","/onetimes",{id:e},r);return t}function e2(r,e){return T("get","/onetimes",{query:e},r)}async function r2(r,e){const{onetime:t}=await T("post","/onetimes",{data:e},r);return t}async function t2(r,e,t){const{onetime:n}=await T("put","/onetimes",{id:e,data:t},r);return n}function n2(r,e){return T("delete","/onetime",{id:e},r)}var i2=Object.freeze({__proto__:null,getOnetime:QT,listOnetimes:e2,createOnetime:r2,updateOnetime:t2,deleteOnetime:n2});async function a2(r,e){const{order:t}=await T("get","/orders",{id:e},r);return t}function o2(r,e){return T("get","/orders",{query:e},r)}var u2=Object.freeze({__proto__:null,getOrder:a2,listOrders:o2});async function f2(r,e){const{payment_method:t}=await T("get","/payment_methods",{id:e},r);return t}async function s2(r,e,t){const{payment_method:n}=await T("put","/payment_methods",{id:e,data:t},r);return n}function c2(r,e){return T("get","/payment_methods",{query:e},r)}var l2=Object.freeze({__proto__:null,getPaymentMethod:f2,updatePaymentMethod:s2,listPaymentMethods:c2});async function p2(r,e){const{plan:t}=await T("get","/plans",{id:e},r);return t}function h2(r,e){return T("get","/plans",{query:e},r)}var y2=Object.freeze({__proto__:null,getPlan:p2,listPlans:h2});async function d2(r,e){const{subscription:t}=await T("get","/subscriptions",{id:e},r);return t}function v2(r,e){return T("get","/subscriptions",{query:e},r)}async function g2(r,e){const{subscription:t}=await T("post","/subscriptions",{data:e},r);return t}async function _2(r,e,t,n){const{subscription:i}=await T("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function m2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t}},r);return n}async function b2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function w2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/cancel`,{data:t},r);return n}async function $2(r,e){const{subscription:t}=await T("post",`/subscriptions/${e}/activate`,{},r);return t}async function E2(r,e,t){const{charge:n}=await T("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}var O2=Object.freeze({__proto__:null,getSubscription:d2,listSubscriptions:v2,createSubscription:g2,updateSubscription:_2,updateSubscriptionChargeDate:m2,updateSubscriptionAddress:b2,cancelSubscription:w2,activateSubscription:$2,skipSubscriptionCharge:E2});async function A2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function S2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("put","/customers",{id:t,data:e},r);return n}async function T2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await T("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}var I2=Object.freeze({__proto__:null,getCustomer:A2,updateCustomer:S2,getDeliverySchedule:T2});const P2={get(r,e){return ve("get",r,e)},post(r,e){return ve("post",r,e)},put(r,e){return ve("put",r,e)},delete(r,e){return ve("delete",r,e)}};function x2(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function F2(r={}){const e=r;Ol({storeIdentifier:x2(r.storeIdentifier),storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),ef()}const nf={init:F2,api:P2,address:jl,auth:Vl,bundle:jT,charge:zT,cdn:DT,customer:I2,membership:JT,onetime:i2,order:u2,paymentMethod:l2,plan:y2,subscription:O2};try{nf.init()}catch{}return nf});
|
|
28
|
+
*/(function(e,t){typeof kb=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(re,function(){function e(l,u,p){this.low=l|0,this.high=u|0,this.unsigned=!!p}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,p){var d,_;return p?(u=u>>>0,0<=u&&u<256&&(_=n[u],_)?_:(d=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=d),d)):(u=u|0,-128<=u&&u<128&&(_=t[u],_)?_:(d=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=d),d))},e.fromNumber=function(u,p){return p=!!p,isNaN(u)||!isFinite(u)?e.ZERO:!p&&u<=-s?e.MIN_VALUE:!p&&u+1>=s?e.MAX_VALUE:p&&u>=f?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,p).negate():new e(u%o|0,u/o|0,p)},e.fromBits=function(u,p,d){return new e(u,p,d)},e.fromString=function(u,p,d){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof p=="number"&&(d=p,p=!1),d=d||10,d<2||36<d)throw Error("radix out of range: "+d);var _;if((_=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(_===0)return e.fromString(u.substring(1),p,d).negate();for(var E=e.fromNumber(Math.pow(d,8)),$=e.ZERO,b=0;b<u.length;b+=8){var S=Math.min(8,u.length-b),h=parseInt(u.substring(b,b+S),d);if(S<8){var O=e.fromNumber(Math.pow(d,S));$=$.multiply(O).add(e.fromNumber(h))}else $=$.multiply(E),$=$.add(e.fromNumber(h))}return $.unsigned=p,$},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,f=o*o,s=f/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),_=this.divide(d);return p=_.multiply(d).subtract(this),_.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var E=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var $="";;){var b=p.divide(E),S=p.subtract(b.multiply(E)).toInt()>>>0,h=S.toString(u);if(p=b,p.isZero())return h+$;for(;h.length<6;)h="0"+h;$=""+h+$}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var p=this.isNegative(),d=u.isNegative();return p&&!d?-1:!p&&d?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(u){e.isLong(u)||(u=e.fromValue(u));var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,b=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,P=0,R=0,m=0;return m+=E+h,R+=m>>>16,m&=65535,R+=_+S,P+=R>>>16,R&=65535,P+=d+b,O+=P>>>16,P&=65535,O+=p+$,O&=65535,e.fromBits(R<<16|m,O<<16|P,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(c)&&u.lessThan(c))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,b=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,P=0,R=0,m=0;return m+=E*h,R+=m>>>16,m&=65535,R+=_*h,P+=R>>>16,R&=65535,R+=E*S,P+=R>>>16,R&=65535,P+=d*h,O+=P>>>16,P&=65535,P+=_*S,O+=P>>>16,P&=65535,P+=E*b,O+=P>>>16,P&=65535,O+=p*h+d*S+_*b+E*$,O&=65535,e.fromBits(R<<16|m,O<<16|P,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var p,d,_;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var E=this.shiftRight(1);return p=E.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),_=p.add(d.divide(u)),_)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(_=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var $=Math.ceil(Math.log(p)/Math.LN2),b=$<=48?1:Math.pow(2,$-48),S=e.fromNumber(p),h=S.multiply(u);h.isNegative()||h.greaterThan(d);)p-=b,S=e.fromNumber(p,this.unsigned),h=S.multiply(u);S.isZero()&&(S=e.ONE),_=_.add(S),d=d.subtract(h)}return _},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var p=this.high;if(u<32){var d=this.low;return e.fromBits(d>>>u|p<<32-u,p>>>u,this.unsigned)}else return u===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>u-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(Yn),Object.defineProperty(lt,"__esModule",{value:!0}),lt.Hyper=void 0;var Vb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Ro=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},qb=Yn.exports,dr=Mo(qb),Gb=M,Hb=Mo(Gb);function Mo(r){return r&&r.__esModule?r:{default:r}}function Wb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function zb(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Xb(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var vr=lt.Hyper=function(r){Xb(e,r),Vb(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not a Hyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^-?\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Ro(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!1);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Ro(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!1);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return Wb(this,e),zb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(dr.default);(0,Hb.default)(vr),vr.MAX_VALUE=new vr(dr.default.MAX_VALUE.low,dr.default.MAX_VALUE.high),vr.MIN_VALUE=new vr(dr.default.MIN_VALUE.low,dr.default.MIN_VALUE.high);var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.UnsignedInt=void 0;var Yb=Kr,No=Do(Yb),Kb=M,Zb=Do(Kb);function Do(r){return r&&r.__esModule?r:{default:r}}var gr=Pe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,No.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");if(e<0)throw new Error("XDR Write Error: negative number "+e);t.writeUInt32BE(e)},isValid:function(e){return!(0,No.default)(e)||Math.floor(e)!==e?!1:e>=gr.MIN_VALUE&&e<=gr.MAX_VALUE}};gr.MAX_VALUE=Math.pow(2,32)-1,gr.MIN_VALUE=0,(0,Zb.default)(gr);var pt={};Object.defineProperty(pt,"__esModule",{value:!0}),pt.UnsignedHyper=void 0;var Jb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Bo=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},Qb=Yn.exports,_r=Uo(Qb),ew=M,rw=Uo(ew);function Uo(r){return r&&r.__esModule?r:{default:r}}function tw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function nw(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function iw(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var mr=pt.UnsignedHyper=function(r){iw(e,r),Jb(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not an UnsignedHyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Bo(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!0);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Bo(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!0);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return tw(this,e),nw(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(_r.default);(0,rw.default)(mr),mr.MAX_VALUE=new mr(_r.default.MAX_UNSIGNED_VALUE.low,_r.default.MAX_UNSIGNED_VALUE.high),mr.MIN_VALUE=new mr(_r.default.MIN_VALUE.low,_r.default.MIN_VALUE.high);var ht={};Object.defineProperty(ht,"__esModule",{value:!0}),ht.Float=void 0;var aw=Kr,Co=Lo(aw),ow=M,uw=Lo(ow);function Lo(r){return r&&r.__esModule?r:{default:r}}var fw=ht.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Co.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Co.default)(e)}};(0,uw.default)(fw);var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.Double=void 0;var sw=Kr,jo=ko(sw),cw=M,lw=ko(cw);function ko(r){return r&&r.__esModule?r:{default:r}}var pw=yt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,jo.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,jo.default)(e)}};(0,lw.default)(pw);var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.Quadruple=void 0;var hw=M,yw=dw(hw);function dw(r){return r&&r.__esModule?r:{default:r}}var vw=dt.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,yw.default)(vw);var br={},gw=oe,_w=H,mw="[object Boolean]";function bw(r){return r===!0||r===!1||_w(r)&&gw(r)==mw}var ww=bw;Object.defineProperty(br,"__esModule",{value:!0}),br.Bool=void 0;var $w=ww,Ew=qo($w),Vo=ae,Aw=M,Ow=qo(Aw);function qo(r){return r&&r.__esModule?r:{default:r}}var Sw=br.Bool={read:function(e){var t=Vo.Int.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new Error("XDR Read Error: Got "+t+" when trying to read a bool")}},write:function(e,t){var n=e?1:0;return Vo.Int.write(n,t)},isValid:function(e){return(0,Ew.default)(e)}};(0,Ow.default)(Sw);var vt={},Tw=oe,xw=C,Pw=H,Iw="[object String]";function Fw(r){return typeof r=="string"||!xw(r)&&Pw(r)&&Tw(r)==Iw}var Go=Fw;Object.defineProperty(vt,"__esModule",{value:!0}),vt.String=void 0;var Rw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Mw=Go,Ho=Kn(Mw),Nw=C,Dw=Kn(Nw),Wo=ae,Bw=Pe,zo=Te,Uw=M,Cw=Kn(Uw);function Kn(r){return r&&r.__esModule?r:{default:r}}function Lw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var jw=vt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bw.UnsignedInt.MAX_VALUE;Lw(this,r),this._maxLength=e}return Rw(r,[{key:"read",value:function(t){var n=Wo.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,zo.calculatePadding)(n),a=t.slice(n);return(0,zo.slicePadding)(t,i),a.buffer()}},{key:"readString",value:function(t){return this.read(t).toString("utf8")}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));var i=void 0;(0,Ho.default)(t)?i=y.from(t,"utf8"):i=y.from(t),Wo.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Ho.default)(t))n=y.from(t,"utf8");else if((0,Dw.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,Cw.default)(jw.prototype);var gt={};Object.defineProperty(gt,"__esModule",{value:!0}),gt.Opaque=void 0;var kw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Xo=Te,Vw=M,qw=Gw(Vw);function Gw(r){return r&&r.__esModule?r:{default:r}}function Hw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Ww=gt.Opaque=function(){function r(e){Hw(this,r),this._length=e,this._padding=(0,Xo.calculatePadding)(e)}return kw(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Xo.slicePadding)(t,this._padding),n.buffer()}},{key:"write",value:function(t,n){if(t.length!==this._length)throw new Error("XDR Write Error: Got "+t.length+" bytes, expected "+this._length);n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length===this._length}}]),r}();(0,qw.default)(Ww.prototype);var _t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.VarOpaque=void 0;var zw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Yo=ae,Xw=Pe,Ko=Te,Yw=M,Kw=Zw(Yw);function Zw(r){return r&&r.__esModule?r:{default:r}}function Jw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Qw=_t.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xw.UnsignedInt.MAX_VALUE;Jw(this,r),this._maxLength=e}return zw(r,[{key:"read",value:function(t){var n=Yo.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length VarOpaque,"+("max allowed is "+this._maxLength));var i=(0,Ko.calculatePadding)(n),a=t.slice(n);return(0,Ko.slicePadding)(t,i),a.buffer()}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));Yo.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,Kw.default)(Qw.prototype);var mt={},Ie={exports:{}};function e1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Zo=e1,r1=Jr;function t1(r){return typeof r=="function"?r:r1}var Jo=t1,n1=Zo,i1=Fn,a1=Jo,o1=C;function u1(r,e){var t=o1(r)?n1:i1;return t(r,a1(e))}var f1=u1;(function(r){r.exports=f1})(Ie);var s1=/\s/;function c1(r){for(var e=r.length;e--&&s1.test(r.charAt(e)););return e}var l1=c1,p1=l1,h1=/^\s+/;function y1(r){return r&&r.slice(0,p1(r)+1).replace(h1,"")}var d1=y1,v1=d1,Qo=ve,g1=ft,eu=0/0,_1=/^[-+]0x[0-9a-f]+$/i,m1=/^0b[01]+$/i,b1=/^0o[0-7]+$/i,w1=parseInt;function $1(r){if(typeof r=="number")return r;if(g1(r))return eu;if(Qo(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Qo(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=v1(r);var t=m1.test(r);return t||b1.test(r)?w1(r.slice(2),t?2:8):_1.test(r)?eu:+r}var E1=$1,A1=E1,ru=1/0,O1=17976931348623157e292;function S1(r){if(!r)return r===0?r:0;if(r=A1(r),r===ru||r===-ru){var e=r<0?-1:1;return e*O1}return r===r?r:0}var T1=S1,x1=T1;function P1(r){var e=x1(r),t=e%1;return e===e?t?e-t:e:0}var I1=P1,F1=Ua,R1=Jo,M1=I1,N1=9007199254740991,Zn=4294967295,D1=Math.min;function B1(r,e){if(r=M1(r),r<1||r>N1)return[];var t=Zn,n=D1(r,Zn);e=R1(e),r-=Zn;for(var i=F1(n,e);++t<r;)e(t);return i}var tu=B1;Object.defineProperty(mt,"__esModule",{value:!0}),mt.Array=void 0;var U1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),C1=zn,L1=wr(C1),j1=Ie.exports,k1=wr(j1),V1=tu,q1=wr(V1),G1=C,nu=wr(G1),H1=M,W1=wr(H1);function wr(r){return r&&r.__esModule?r:{default:r}}function z1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var X1=mt.Array=function(){function r(e,t){z1(this,r),this._childType=e,this._length=t}return U1(r,[{key:"read",value:function(t){var n=this;return(0,q1.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,nu.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,k1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,nu.default)(t)||t.length!==this._length?!1:(0,L1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,W1.default)(X1.prototype);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.VarArray=void 0;var Y1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),K1=zn,Z1=$r(K1),J1=Ie.exports,Q1=$r(J1),e$=tu,r$=$r(e$),t$=C,iu=$r(t$),n$=Pe,au=ae,i$=M,a$=$r(i$);function $r(r){return r&&r.__esModule?r:{default:r}}function o$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var u$=bt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n$.UnsignedInt.MAX_VALUE;o$(this,r),this._childType=e,this._maxLength=t}return Y1(r,[{key:"read",value:function(t){var n=this,i=au.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,r$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,iu.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));au.Int.write(t.length,n),(0,Q1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,iu.default)(t)||t.length>this._maxLength?!1:(0,Z1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,a$.default)(u$.prototype);var wt={};function f$(r){return r===null}var s$=f$;function c$(r){return r===void 0}var Er=c$;Object.defineProperty(wt,"__esModule",{value:!0}),wt.Option=void 0;var l$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),p$=s$,ou=Jn(p$),h$=Er,uu=Jn(h$),fu=br,y$=M,d$=Jn(y$);function Jn(r){return r&&r.__esModule?r:{default:r}}function v$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var g$=wt.Option=function(){function r(e){v$(this,r),this._childType=e}return l$(r,[{key:"read",value:function(t){if(fu.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,ou.default)(t)||(0,uu.default)(t));fu.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,ou.default)(t)||(0,uu.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,d$.default)(g$.prototype);var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.Void=void 0;var _$=Er,su=cu(_$),m$=M,b$=cu(m$);function cu(r){return r&&r.__esModule?r:{default:r}}var w$=Ar.Void={read:function(){},write:function(e){if(!(0,su.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,su.default)(e)}};(0,b$.default)(w$);var $t={},$$=st;function E$(r,e){return $$(e,function(t){return r[t]})}var A$=E$,O$=A$,S$=Ge;function T$(r){return r==null?[]:O$(r,S$(r))}var x$=T$;Object.defineProperty($t,"__esModule",{value:!0}),$t.Enum=void 0;var P$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),I$=Ie.exports,F$=Qn(I$),R$=x$,M$=Qn(R$),lu=ae,N$=M,D$=Qn(N$);function Qn(r){return r&&r.__esModule?r:{default:r}}function B$(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function U$(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function pu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var C$=$t.Enum=function(){function r(e,t){pu(this,r),this.name=e,this.value=t}return P$(r,null,[{key:"read",value:function(t){var n=lu.Int.read(t);if(!this._byValue.has(n))throw new Error("XDR Read Error: Unknown "+this.enumName+" member for value "+n);return this._byValue.get(n)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: Unknown "+t+" is not a "+this.enumName);lu.Int.write(t.value,n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"members",value:function(){return this._members}},{key:"values",value:function(){return(0,M$.default)(this._members)}},{key:"fromName",value:function(t){var n=this._members[t];if(!n)throw new Error(t+" is not a member of "+this.enumName);return n}},{key:"fromValue",value:function(t){var n=this._byValue.get(t);if(!n)throw new Error(t+" is not a value of any member of "+this.enumName);return n}},{key:"create",value:function(t,n,i){var a=function(o){U$(f,o);function f(){return pu(this,f),B$(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,F$.default)(i,function(o,f){var s=new a(f,o);a._members[f]=s,a._byValue.set(o,s),a[f]=function(){return s}}),a}}]),r}();(0,D$.default)(C$);var Et={},L$=Fn,j$=cr;function k$(r,e){var t=-1,n=j$(r)?Array(r.length):[];return L$(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var V$=k$,q$=st,G$=So,H$=V$,W$=C;function z$(r,e){var t=W$(r)?q$:H$;return t(r,G$(e))}var X$=z$;function Y$(r){for(var e=-1,t=r==null?0:r.length,n={};++e<t;){var i=r[e];n[i[0]]=i[1]}return n}var K$=Y$,Or={};Object.defineProperty(Or,"__esModule",{value:!0});var Z$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function J$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Or.Reference=function(){function r(){J$(this,r)}return Z$(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Et,"__esModule",{value:!0}),Et.Struct=void 0;var At=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var f=e[Symbol.iterator](),s;!(i=(s=f.next()).done)&&(n.push(s.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Q$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),eE=Ie.exports,hu=Sr(eE),rE=X$,tE=Sr(rE),nE=Er,iE=Sr(nE),aE=K$,oE=Sr(aE),uE=Or,fE=M,sE=Sr(fE);function Sr(r){return r&&r.__esModule?r:{default:r}}function cE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function lE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function yu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var pE=Et.Struct=function(){function r(e){yu(this,r),this._attributes=e||{}}return Q$(r,null,[{key:"read",value:function(t){var n=(0,tE.default)(this._fields,function(i){var a=At(i,2),o=a[0],f=a[1],s=f.read(t);return[o,s]});return new this((0,oE.default)(n))}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.structName);(0,hu.default)(this._fields,function(i){var a=At(i,2),o=a[0],f=a[1],s=t._attributes[o];f.write(s,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){lE(f,o);function f(){return yu(this,f),cE(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var f=At(o,2),s=f[0],c=f[1];return c instanceof uE.Reference&&(c=c.resolve(t)),[s,c]}),(0,hu.default)(a._fields,function(o){var f=At(o,1),s=f[0];a.prototype[s]=hE(s)}),a}}]),r}();(0,sE.default)(pE);function hE(r){return function(t){return(0,iE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.Union=void 0;var yE=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var f=e[Symbol.iterator](),s;!(i=(s=f.next()).done)&&(n.push(s.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),dE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),vE=Ie.exports,St=xt(vE),gE=Er,du=xt(gE),_E=Go,vu=xt(_E),Tt=Ar,ei=Or,mE=M,bE=xt(mE);function xt(r){return r&&r.__esModule?r:{default:r}}function wE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function $E(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function gu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var EE=Ot.Union=function(){function r(e,t){gu(this,r),this.set(e,t)}return dE(r,[{key:"set",value:function(t,n){(0,vu.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==Tt.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===Tt.Void?Tt.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,du.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(f){$E(s,f);function s(){return gu(this,s),wE(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ei.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,St.default)(i.arms,function(f,s){f instanceof ei.Reference&&(f=f.resolve(t)),a._arms[s]=f});var o=i.defaultArm;return o instanceof ei.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,St.default)(i.switches,function(f){var s=yE(f,2),c=s[0],l=s[1];(0,vu.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,du.default)(a._switchOn.values)||(0,St.default)(a._switchOn.values(),function(f){a[f.name]=function(s){return new a(f,s)},a.prototype[f.name]=function(c){return this.set(f,c)}}),(0,St.default)(a._arms,function(f,s){f!==Tt.Void&&(a.prototype[s]=function(){return this.get(s)})}),a}}]),r}();(0,bE.default)(EE),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ae;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=lt;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Pe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=pt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=ht;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=yt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var f=dt;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var s=br;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var c=vt;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=gt;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=_t;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=mt;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=bt;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=wt;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var E=Ar;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})});var $=$t;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=Et;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var S=Ot;Object.keys(S).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return S[h]}})})}(En);var _u={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var w=0;w<g.length;w++){var A=g[w];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(v,A.key,A)}}return function(v,g,w){return g&&m(v.prototype,g),w&&m(v,w),v}}(),t=Or;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=_;var n=Er,i=l(n),a=Ie.exports,o=l(a),f=En,s=c(f);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(v[g]=m[g]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function d(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function _(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var g=new R(v);m(g),g.resolve()}return v}var E=function(m){d(v,m);function v(g){u(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return w.name=g,w}return e(v,[{key:"resolve",value:function(w){var A=w.definitions[this.name];return A.resolve(w)}}]),v}(t.Reference),$=function(m){d(v,m);function v(g,w){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var L=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return L.childReference=g,L.length=w,L.variable=A,L}return e(v,[{key:"resolve",value:function(w){var A=this.childReference,L=this.length;return A instanceof t.Reference&&(A=A.resolve(w)),L instanceof t.Reference&&(L=L.resolve(w)),this.variable?new s.VarArray(A,L):new s.Array(A,L)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g){u(this,v);var w=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return w.childReference=g,w.name=g.name,w}return e(v,[{key:"resolve",value:function(w){var A=this.childReference;return A instanceof t.Reference&&(A=A.resolve(w)),new s.Option(A)}}]),v}(t.Reference),S=function(m){d(v,m);function v(g,w){u(this,v);var A=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return A.sizedType=g,A.length=w,A}return e(v,[{key:"resolve",value:function(w){var A=this.length;return A instanceof t.Reference&&(A=A.resolve(w)),new this.sizedType(A)}}]),v}(t.Reference),h=function(){function m(v,g,w){u(this,m),this.constructor=v,this.name=g,this.config=w}return e(m,[{key:"resolve",value:function(g){return this.name in g.results?g.results[this.name]:this.constructor(g,this.name,this.config)}}]),m}();function O(m,v,g){return g instanceof t.Reference&&(g=g.resolve(m)),m.results[v]=g,g}function P(m,v,g){return m.results[v]=g,g}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(g,w){var A=new h(s.Enum.create,g,w);this.define(g,A)}},{key:"struct",value:function(g,w){var A=new h(s.Struct.create,g,w);this.define(g,A)}},{key:"union",value:function(g,w){var A=new h(s.Union.create,g,w);this.define(g,A)}},{key:"typedef",value:function(g,w){var A=new h(O,g,w);this.define(g,A)}},{key:"const",value:function(g,w){var A=new h(P,g,w);this.define(g,A)}},{key:"void",value:function(){return s.Void}},{key:"bool",value:function(){return s.Bool}},{key:"int",value:function(){return s.Int}},{key:"hyper",value:function(){return s.Hyper}},{key:"uint",value:function(){return s.UnsignedInt}},{key:"uhyper",value:function(){return s.UnsignedHyper}},{key:"float",value:function(){return s.Float}},{key:"double",value:function(){return s.Double}},{key:"quadruple",value:function(){return s.Quadruple}},{key:"string",value:function(g){return new S(s.String,g)}},{key:"opaque",value:function(g){return new S(s.Opaque,g)}},{key:"varOpaque",value:function(g){return new S(s.VarOpaque,g)}},{key:"array",value:function(g,w){return new $(g,w)}},{key:"varArray",value:function(g,w){return new $(g,w,!0)}},{key:"option",value:function(g){return new b(g)}},{key:"define",value:function(g,w){if((0,i.default)(this._destination[g]))this._definitions[g]=w;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new E(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(w){w.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(_u),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=En;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=_u;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(ma);const ue=ma.config(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})});function AE(r){let e={variantId:ue.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ue.BundleItem({collectionId:ue.Uint64.fromString(n.collectionId.toString()),productId:ue.Uint64.fromString(n.productId.toString()),variantId:ue.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ue.BundleItemExt(0)})),ext:new ue.BundleExt(0)};const t=new ue.Bundle(e);return ue.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}var OE=qe,SE=Ge;function TE(r,e){return r&&OE(e,SE(e),r)}var xE=TE,PE=qe,IE=Qr;function FE(r,e){return r&&PE(e,IE(e),r)}var RE=FE,ri={exports:{}};(function(r,e){var t=Q,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,f=o?o.allocUnsafe:void 0;function s(c,l){if(l)return c.slice();var u=c.length,p=f?f(u):new c.constructor(u);return c.copy(p),p}r.exports=s})(ri,ri.exports);function ME(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var NE=ME,DE=qe,BE=Un;function UE(r,e){return DE(r,BE(r),e)}var CE=UE,LE=Ga,jE=LE(Object.getPrototypeOf,Object),ti=jE,kE=Bn,VE=ti,qE=Un,GE=Qa,HE=Object.getOwnPropertySymbols,WE=HE?function(r){for(var e=[];r;)kE(e,qE(r)),r=VE(r);return e}:GE,mu=WE,zE=qe,XE=mu;function YE(r,e){return zE(r,XE(r),e)}var KE=YE,ZE=Ja,JE=mu,QE=Qr;function eA(r){return ZE(r,QE,JE)}var bu=eA,rA=Object.prototype,tA=rA.hasOwnProperty;function nA(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&tA.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var iA=nA,wu=Xa;function aA(r){var e=new r.constructor(r.byteLength);return new wu(e).set(new wu(r)),e}var ni=aA,oA=ni;function uA(r,e){var t=e?oA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var fA=uA,sA=/\w*$/;function cA(r){var e=new r.constructor(r.source,sA.exec(r));return e.lastIndex=r.lastIndex,e}var lA=cA,$u=Ve,Eu=$u?$u.prototype:void 0,Au=Eu?Eu.valueOf:void 0;function pA(r){return Au?Object(Au.call(r)):{}}var hA=pA,yA=ni;function dA(r,e){var t=e?yA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var vA=dA,gA=ni,_A=fA,mA=lA,bA=hA,wA=vA,$A="[object Boolean]",EA="[object Date]",AA="[object Map]",OA="[object Number]",SA="[object RegExp]",TA="[object Set]",xA="[object String]",PA="[object Symbol]",IA="[object ArrayBuffer]",FA="[object DataView]",RA="[object Float32Array]",MA="[object Float64Array]",NA="[object Int8Array]",DA="[object Int16Array]",BA="[object Int32Array]",UA="[object Uint8Array]",CA="[object Uint8ClampedArray]",LA="[object Uint16Array]",jA="[object Uint32Array]";function kA(r,e,t){var n=r.constructor;switch(e){case IA:return gA(r);case $A:case EA:return new n(+r);case FA:return _A(r,t);case RA:case MA:case NA:case DA:case BA:case UA:case CA:case LA:case jA:return wA(r,t);case AA:return new n;case OA:case xA:return new n(r);case SA:return mA(r);case TA:return new n;case PA:return bA(r)}}var VA=kA,qA=ve,Ou=Object.create,GA=function(){function r(){}return function(e){if(!qA(e))return{};if(Ou)return Ou(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),HA=GA,WA=HA,zA=ti,XA=In;function YA(r){return typeof r.constructor=="function"&&!XA(r)?WA(zA(r)):{}}var KA=YA,ZA=ot,JA=H,QA="[object Map]";function eO(r){return JA(r)&&ZA(r)==QA}var rO=eO,tO=rO,nO=Pn,Su=pr.exports,Tu=Su&&Su.isMap,iO=Tu?nO(Tu):tO,aO=iO,oO=ot,uO=H,fO="[object Set]";function sO(r){return uO(r)&&oO(r)==fO}var cO=sO,lO=cO,pO=Pn,xu=pr.exports,Pu=xu&&xu.isSet,hO=Pu?pO(Pu):lO,yO=hO,dO=Nn,vO=Zo,gO=Fa,_O=xE,mO=RE,bO=ri.exports,wO=NE,$O=CE,EO=KE,AO=ro,OO=bu,SO=ot,TO=iA,xO=VA,PO=KA,IO=C,FO=lr.exports,RO=aO,MO=ve,NO=yO,DO=Ge,BO=Qr,UO=1,CO=2,LO=4,Iu="[object Arguments]",jO="[object Array]",kO="[object Boolean]",VO="[object Date]",qO="[object Error]",Fu="[object Function]",GO="[object GeneratorFunction]",HO="[object Map]",WO="[object Number]",Ru="[object Object]",zO="[object RegExp]",XO="[object Set]",YO="[object String]",KO="[object Symbol]",ZO="[object WeakMap]",JO="[object ArrayBuffer]",QO="[object DataView]",eS="[object Float32Array]",rS="[object Float64Array]",tS="[object Int8Array]",nS="[object Int16Array]",iS="[object Int32Array]",aS="[object Uint8Array]",oS="[object Uint8ClampedArray]",uS="[object Uint16Array]",fS="[object Uint32Array]",I={};I[Iu]=I[jO]=I[JO]=I[QO]=I[kO]=I[VO]=I[eS]=I[rS]=I[tS]=I[nS]=I[iS]=I[HO]=I[WO]=I[Ru]=I[zO]=I[XO]=I[YO]=I[KO]=I[aS]=I[oS]=I[uS]=I[fS]=!0,I[qO]=I[Fu]=I[ZO]=!1;function Pt(r,e,t,n,i,a){var o,f=e&UO,s=e&CO,c=e&LO;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!MO(r))return r;var l=IO(r);if(l){if(o=TO(r),!f)return wO(r,o)}else{var u=SO(r),p=u==Fu||u==GO;if(FO(r))return bO(r,f);if(u==Ru||u==Iu||p&&!i){if(o=s||p?{}:PO(r),!f)return s?EO(r,mO(o,r)):$O(r,_O(o,r))}else{if(!I[u])return i?r:{};o=xO(r,u,f)}}a||(a=new dO);var d=a.get(r);if(d)return d;a.set(r,o),NO(r)?r.forEach(function($){o.add(Pt($,e,t,$,r,a))}):RO(r)&&r.forEach(function($,b){o.set(b,Pt($,e,t,b,r,a))});var _=c?s?OO:AO:s?BO:DO,E=l?void 0:_(r);return vO(E||r,function($,b){E&&(b=$,$=r[b]),gO(o,b,Pt($,e,t,b,r,a))}),o}var sS=Pt;function cS(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var lS=cS;function pS(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}var hS=pS,yS=Wn,dS=hS;function vS(r,e){return e.length<2?r:yS(r,dS(e,0,-1))}var gS=vS,_S=ct,mS=lS,bS=gS,wS=hr;function $S(r,e){return e=_S(e,r),r=bS(r,e),r==null||delete r[wS(mS(e))]}var ES=$S,AS=oe,OS=ti,SS=H,TS="[object Object]",xS=Function.prototype,PS=Object.prototype,Mu=xS.toString,IS=PS.hasOwnProperty,FS=Mu.call(Object);function RS(r){if(!SS(r)||AS(r)!=TS)return!1;var e=OS(r);if(e===null)return!0;var t=IS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Mu.call(t)==FS}var MS=RS,NS=MS;function DS(r){return NS(r)?void 0:r}var BS=DS,Nu=Ve,US=xn,CS=C,Du=Nu?Nu.isConcatSpreadable:void 0;function LS(r){return CS(r)||US(r)||!!(Du&&r&&r[Du])}var jS=LS,kS=Bn,VS=jS;function Bu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=VS),i||(i=[]);++a<o;){var f=r[a];e>0&&t(f)?e>1?Bu(f,e-1,t,n,i):kS(i,f):n||(i[i.length]=f)}return i}var qS=Bu,GS=qS;function HS(r){var e=r==null?0:r.length;return e?GS(r,1):[]}var WS=HS,zS=WS,XS=Ma,YS=Da;function KS(r){return YS(XS(r,void 0,zS),r+"")}var ZS=KS,JS=st,QS=sS,eT=ES,rT=ct,tT=qe,nT=BS,iT=ZS,aT=bu,oT=1,uT=2,fT=4,sT=iT(function(r,e){var t={};if(r==null)return t;var n=!1;e=JS(e,function(a){return a=rT(a,r),n||(n=a.length>1),a}),tT(r,aT(r),t),n&&(t=QS(t,oT|uT|fT,nT));for(var i=e.length;i--;)eT(t,e[i]);return t}),cT=sT,lT=Object.defineProperty,pT=Object.defineProperties,hT=Object.getOwnPropertyDescriptors,Uu=Object.getOwnPropertySymbols,yT=Object.prototype.hasOwnProperty,dT=Object.prototype.propertyIsEnumerable,Cu=(r,e,t)=>e in r?lT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,vT=(r,e)=>{for(var t in e||(e={}))yT.call(e,t)&&Cu(r,t,e[t]);if(Uu)for(var t of Uu(e))dT.call(e,t)&&Cu(r,t,e[t]);return r},gT=(r,e)=>pT(r,hT(e));function _T(r){try{return JSON.parse(r)}catch{return r}}function mT(r){return Object.entries(r).reduce((e,[t,n])=>gT(vT({},e),{[t]:_T(n)}),{})}var bT=Object.defineProperty,wT=Object.defineProperties,$T=Object.getOwnPropertyDescriptors,Lu=Object.getOwnPropertySymbols,ET=Object.prototype.hasOwnProperty,AT=Object.prototype.propertyIsEnumerable,ju=(r,e,t)=>e in r?bT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ku=(r,e)=>{for(var t in e||(e={}))ET.call(e,t)&&ju(r,t,e[t]);if(Lu)for(var t of Lu(e))AT.call(e,t)&&ju(r,t,e[t]);return r},Vu=(r,e)=>wT(r,$T(e));function qu(r){var e;const t=mT(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Vu(ku({},cT(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function Gu(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Vu(ku({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function OT(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Gu(i)}),t})}const It="2020-12",ST={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Tr=new Map;function Ft(r,e){return Tr.has(r)||Tr.set(r,e()),Tr.get(r)}async function ii(r){const{product:e}=await Ft(`product.${r}`,()=>Yr("get",`/product/${It}/${r}.json`));return Gu(e)}async function Hu(){return await Ft("storeSettings",()=>Yr("get",`/${It}/store_settings.json`).catch(()=>ST))}async function Wu(){const{widget_settings:r}=await Ft("widgetSettings",()=>Yr("get",`/${It}/widget_settings.json`));return qu(r)}async function zu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Ft("productsAndSettings",()=>Yr("get",`/product/${It}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:OT(r),widget_settings:qu(e),store_settings:t??{}}}async function TT(){const{products:r}=await zu();return r}async function xT(r){const[e,t,n]=await Promise.all([ii(r),Hu(),Wu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Xu(r){const{bundle_product:e}=await ii(r);return e}async function Yu(){return Array.from(Tr.keys()).forEach(r=>Tr.delete(r))}var PT=Object.freeze({__proto__:null,getCDNProduct:ii,getCDNStoreSettings:Hu,getCDNWidgetSettings:Wu,getCDNProductsAndSettings:zu,getCDNProducts:TT,getCDNProductAndSettings:xT,getCDNBundleSettings:Xu,resetCDNCache:Yu});const Ku="/bundling-storefront-manager";function IT(){return Math.ceil(Date.now()/1e3)}async function FT(){try{const{timestamp:r}=await $n("get",`${Ku}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),IT()}}async function RT(r){const e=fr();if(!await Zu(r))throw new Error("Bundle selection is invalid.");const t=await FT(),n=AE({variantId:r.externalVariantId,version:t,items:r.selections.map(i=>({collectionId:i.collectionId,productId:i.externalProductId,variantId:i.externalVariantId,quantity:i.quantity,sku:""}))});try{const i=await $n("post",`${Ku}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}async function Zu(r){try{const e=await Xu(r.externalProductId);return!!r&&!!e}catch{return console.error("Error fetching bundle settings"),!1}}var MT=Object.freeze({__proto__:null,getBundleId:RT,validateBundle:Zu});async function NT(r,e){const{charge:t}=await T("get","/charges",{id:e},r);return t}function DT(r,e){return T("get","/charges",{query:e},r)}async function BT(r,e,t){const{charge:n}=await T("post",`/charges/${e}/apply_discount`,{data:t},r);return n}async function UT(r,e){const{charge:t}=await T("post",`/charges/${e}/remove_discount`,{},r);return t}async function CT(r,e){const{charge:t}=await T("post",`/charges/${e}/skip`,{},r);return t}async function LT(r,e){const{charge:t}=await T("post",`/charges/${e}/unskip`,{},r);return t}async function jT(r,e){const{charge:t}=await T("post",`/charges/${e}/process`,{},r);return t}var kT=Object.freeze({__proto__:null,getCharge:NT,listCharges:DT,applyDiscount:BT,removeDiscount:UT,skipCharge:CT,unskipCharge:LT,processCharge:jT});async function VT(r,e){const{membership:t}=await T("get","/memberships",{id:e},r);return t}function qT(r,e){return T("get","/memberships",{query:e},r)}async function GT(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function HT(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/activate`,{data:t},r);return n}var WT=Object.freeze({__proto__:null,getMembership:VT,listMemberships:qT,cancelMembership:GT,activateMembership:HT});async function zT(r,e){const{onetime:t}=await T("get","/onetimes",{id:e},r);return t}function XT(r,e){return T("get","/onetimes",{query:e},r)}async function YT(r,e){const{onetime:t}=await T("post","/onetimes",{data:e},r);return t}async function KT(r,e,t){const{onetime:n}=await T("put","/onetimes",{id:e,data:t},r);return n}function ZT(r,e){return T("delete","/onetime",{id:e},r)}var JT=Object.freeze({__proto__:null,getOnetime:zT,listOnetimes:XT,createOnetime:YT,updateOnetime:KT,deleteOnetime:ZT});async function QT(r,e){const{order:t}=await T("get","/orders",{id:e},r);return t}function e2(r,e){return T("get","/orders",{query:e},r)}var r2=Object.freeze({__proto__:null,getOrder:QT,listOrders:e2});async function t2(r,e){const{payment_method:t}=await T("get","/payment_methods",{id:e},r);return t}async function n2(r,e,t){const{payment_method:n}=await T("put","/payment_methods",{id:e,data:t},r);return n}function i2(r,e){return T("get","/payment_methods",{query:e},r)}var a2=Object.freeze({__proto__:null,getPaymentMethod:t2,updatePaymentMethod:n2,listPaymentMethods:i2});async function o2(r,e){const{plan:t}=await T("get","/plans",{id:e},r);return t}function u2(r,e){return T("get","/plans",{query:e},r)}var f2=Object.freeze({__proto__:null,getPlan:o2,listPlans:u2});async function s2(r,e){const{subscription:t}=await T("get","/subscriptions",{id:e},r);return t}function c2(r,e){return T("get","/subscriptions",{query:e},r)}async function l2(r,e){const{subscription:t}=await T("post","/subscriptions",{data:e},r);return t}async function p2(r,e,t,n){const{subscription:i}=await T("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function h2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t}},r);return n}async function y2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function d2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/cancel`,{data:t},r);return n}async function v2(r,e){const{subscription:t}=await T("post",`/subscriptions/${e}/activate`,{},r);return t}async function g2(r,e,t){const{charge:n}=await T("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}var _2=Object.freeze({__proto__:null,getSubscription:s2,listSubscriptions:c2,createSubscription:l2,updateSubscription:p2,updateSubscriptionChargeDate:h2,updateSubscriptionAddress:y2,cancelSubscription:d2,activateSubscription:v2,skipSubscriptionCharge:g2});async function m2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function b2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("put","/customers",{id:t,data:e},r);return n}async function w2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await T("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}var $2=Object.freeze({__proto__:null,getCustomer:m2,updateCustomer:b2,getDeliverySchedule:w2});const E2={get(r,e){return de("get",r,e)},post(r,e){return de("post",r,e)},put(r,e){return de("put",r,e)},delete(r,e){return de("delete",r,e)}};function A2(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function O2(r={}){const e=r;ml({storeIdentifier:A2(r.storeIdentifier),storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),Yu()}const Ju={init:O2,api:E2,address:Dl,auth:Cl,bundle:MT,charge:kT,cdn:PT,customer:$2,membership:WT,onetime:JT,order:r2,paymentMethod:a2,plan:f2,subscription:_2};try{Ju.init()}catch{}return Ju});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rechargeapps/storefront-client",
|
|
3
3
|
"description": "Storefront client for Recharge",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.2",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"format": "prettier --check '{src,cypress}/**/*.{js,ts}'"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@
|
|
32
|
+
"@rechargeapps/bundling-data": "^2.1.3",
|
|
33
33
|
"isomorphic-fetch": "3.0.0",
|
|
34
34
|
"lodash": "4.17.21",
|
|
35
35
|
"qs": "6.11.0"
|