@rechargeapps/storefront-client 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,9 +23,16 @@ async function activateMembership(session, id, activateRequest) {
23
23
  }, session);
24
24
  return membership;
25
25
  }
26
+ async function changeMembership(session, id, changeRequest) {
27
+ const { membership } = await request.rechargeApiRequest("post", `/memberships/${id}/change`, {
28
+ data: changeRequest
29
+ }, session);
30
+ return membership;
31
+ }
26
32
 
27
33
  exports.activateMembership = activateMembership;
28
34
  exports.cancelMembership = cancelMembership;
35
+ exports.changeMembership = changeMembership;
29
36
  exports.getMembership = getMembership;
30
37
  exports.listMemberships = listMemberships;
31
38
  //# sourceMappingURL=membership.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"membership.js","sources":["../../../src/api/membership.ts"],"sourcesContent":["import {\n ActivateMembershipRequest,\n CancelMembershipRequest,\n MembershipListParams,\n MembershipListResponse,\n MembershipResponse,\n} from '../types/membership';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/** @internal Retrieves membership information for passed in id */\nexport async function getMembership(session: Session, id: string | number) {\n const { membership } = await rechargeApiRequest<MembershipResponse>('get', `/memberships`, { id }, session);\n return membership;\n}\n\n/** @internal Retrieves a list of memberships */\nexport function listMemberships(session: Session, query?: MembershipListParams) {\n return rechargeApiRequest<MembershipListResponse>('get', `/memberships`, { query }, session);\n}\n\n/** @internal Cancels a membership */\nexport async function cancelMembership(session: Session, id: string | number, cancelRequest: CancelMembershipRequest) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/cancel`,\n {\n data: cancelRequest,\n },\n session\n );\n return membership;\n}\n\n/** @internal Activates a membership */\nexport async function activateMembership(\n session: Session,\n id: string | number,\n activateRequest: ActivateMembershipRequest\n) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/activate`,\n {\n data: activateRequest,\n },\n session\n );\n return membership;\n}\n"],"names":["rechargeApiRequest"],"mappings":";;;;;;AACO,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE;AACjD,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAMA,0BAAkB,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1F,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,SAAS,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE;AAChD,EAAE,OAAOA,0BAAkB,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC;AACM,eAAe,gBAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE;AACnE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,eAAe,kBAAkB,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE;AACvE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE;AACzF,IAAI,IAAI,EAAE,eAAe;AACzB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB;;;;;;;"}
1
+ {"version":3,"file":"membership.js","sources":["../../../src/api/membership.ts"],"sourcesContent":["import {\n ActivateMembershipRequest,\n CancelMembershipRequest,\n ChangeMembershipRequest,\n MembershipListParams,\n MembershipListResponse,\n MembershipResponse,\n} from '../types/membership';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/** @internal Retrieves membership information for passed in id */\nexport async function getMembership(session: Session, id: string | number) {\n const { membership } = await rechargeApiRequest<MembershipResponse>('get', `/memberships`, { id }, session);\n return membership;\n}\n\n/** @internal Retrieves a list of memberships */\nexport function listMemberships(session: Session, query?: MembershipListParams) {\n return rechargeApiRequest<MembershipListResponse>('get', `/memberships`, { query }, session);\n}\n\n/** @internal Cancels a membership */\nexport async function cancelMembership(session: Session, id: string | number, cancelRequest: CancelMembershipRequest) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/cancel`,\n {\n data: cancelRequest,\n },\n session\n );\n return membership;\n}\n\n/** @internal Activates a membership */\nexport async function activateMembership(\n session: Session,\n id: string | number,\n activateRequest: ActivateMembershipRequest\n) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/activate`,\n {\n data: activateRequest,\n },\n session\n );\n return membership;\n}\n\n/** @internal changes a membership program/product*/\nexport async function changeMembership(session: Session, id: string | number, changeRequest: ChangeMembershipRequest) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/change`,\n {\n data: changeRequest,\n },\n session\n );\n return membership;\n}\n"],"names":["rechargeApiRequest"],"mappings":";;;;;;AACO,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE;AACjD,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAMA,0BAAkB,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1F,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,SAAS,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE;AAChD,EAAE,OAAOA,0BAAkB,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC;AACM,eAAe,gBAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE;AACnE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,eAAe,kBAAkB,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE;AACvE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE;AACzF,IAAI,IAAI,EAAE,eAAe;AACzB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,eAAe,gBAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE;AACnE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAMA,0BAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB;;;;;;;;"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var request = require('../utils/request.js');
6
+
7
+ async function getMembershipProgram(session, id, options) {
8
+ const { membership_program } = await request.rechargeApiRequest("get", `/membership_programs`, { id, query: { include: options == null ? void 0 : options.include } }, session);
9
+ return membership_program;
10
+ }
11
+ function listMembershipPrograms(session, query) {
12
+ return request.rechargeApiRequest("get", `/membership_programs`, { query }, session);
13
+ }
14
+
15
+ exports.getMembershipProgram = getMembershipProgram;
16
+ exports.listMembershipPrograms = listMembershipPrograms;
17
+ //# sourceMappingURL=membershipProgram.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"membershipProgram.js","sources":["../../../src/api/membershipProgram.ts"],"sourcesContent":["import {\n MembershipProgramListParams,\n MembershipProgramListResponse,\n MembershipProgramResponse,\n GetMembershipProgramOptions,\n} from '../types/membershipProgram';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/** @internal Retrieves membership program information for passed in id */\nexport async function getMembershipProgram(\n session: Session,\n id: string | number,\n options?: GetMembershipProgramOptions\n) {\n const { membership_program } = await rechargeApiRequest<MembershipProgramResponse>(\n 'get',\n `/membership_programs`,\n { id, query: { include: options?.include } },\n session\n );\n return membership_program;\n}\n\n/** @internal Retrieves a list of memberships */\nexport function listMembershipPrograms(session: Session, query?: MembershipProgramListParams) {\n return rechargeApiRequest<MembershipProgramListResponse>('get', `/membership_programs`, { query }, session);\n}\n"],"names":["rechargeApiRequest"],"mappings":";;;;;;AACO,eAAe,oBAAoB,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE;AACjE,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAMA,0BAAkB,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1K,EAAE,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AACM,SAAS,sBAAsB,CAAC,OAAO,EAAE,KAAK,EAAE;AACvD,EAAE,OAAOA,0BAAkB,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AAC/E;;;;;"}
package/dist/cjs/index.js CHANGED
@@ -8,6 +8,7 @@ var charge = require('./api/charge.js');
8
8
  var cdn = require('./api/cdn.js');
9
9
  var bundle = require('./api/bundle.js');
10
10
  var membership = require('./api/membership.js');
11
+ var membershipProgram = require('./api/membershipProgram.js');
11
12
  var metafield = require('./api/metafield.js');
12
13
  var onetime = require('./api/onetime.js');
13
14
  var order = require('./api/order.js');
@@ -60,8 +61,11 @@ exports.validateBundle = bundle.validateBundle;
60
61
  exports.validateDynamicBundle = bundle.validateDynamicBundle;
61
62
  exports.activateMembership = membership.activateMembership;
62
63
  exports.cancelMembership = membership.cancelMembership;
64
+ exports.changeMembership = membership.changeMembership;
63
65
  exports.getMembership = membership.getMembership;
64
66
  exports.listMemberships = membership.listMemberships;
67
+ exports.getMembershipProgram = membershipProgram.getMembershipProgram;
68
+ exports.listMembershipPrograms = membershipProgram.listMembershipPrograms;
65
69
  exports.createMetafield = metafield.createMetafield;
66
70
  exports.deleteMetafield = metafield.deleteMetafield;
67
71
  exports.updateMetafield = metafield.updateMetafield;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -19,6 +19,12 @@ async function activateMembership(session, id, activateRequest) {
19
19
  }, session);
20
20
  return membership;
21
21
  }
22
+ async function changeMembership(session, id, changeRequest) {
23
+ const { membership } = await rechargeApiRequest("post", `/memberships/${id}/change`, {
24
+ data: changeRequest
25
+ }, session);
26
+ return membership;
27
+ }
22
28
 
23
- export { activateMembership, cancelMembership, getMembership, listMemberships };
29
+ export { activateMembership, cancelMembership, changeMembership, getMembership, listMemberships };
24
30
  //# sourceMappingURL=membership.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"membership.js","sources":["../../../src/api/membership.ts"],"sourcesContent":["import {\n ActivateMembershipRequest,\n CancelMembershipRequest,\n MembershipListParams,\n MembershipListResponse,\n MembershipResponse,\n} from '../types/membership';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/** @internal Retrieves membership information for passed in id */\nexport async function getMembership(session: Session, id: string | number) {\n const { membership } = await rechargeApiRequest<MembershipResponse>('get', `/memberships`, { id }, session);\n return membership;\n}\n\n/** @internal Retrieves a list of memberships */\nexport function listMemberships(session: Session, query?: MembershipListParams) {\n return rechargeApiRequest<MembershipListResponse>('get', `/memberships`, { query }, session);\n}\n\n/** @internal Cancels a membership */\nexport async function cancelMembership(session: Session, id: string | number, cancelRequest: CancelMembershipRequest) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/cancel`,\n {\n data: cancelRequest,\n },\n session\n );\n return membership;\n}\n\n/** @internal Activates a membership */\nexport async function activateMembership(\n session: Session,\n id: string | number,\n activateRequest: ActivateMembershipRequest\n) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/activate`,\n {\n data: activateRequest,\n },\n session\n );\n return membership;\n}\n"],"names":[],"mappings":";;AACO,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE;AACjD,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1F,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,SAAS,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE;AAChD,EAAE,OAAO,kBAAkB,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC;AACM,eAAe,gBAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE;AACnE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,eAAe,kBAAkB,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE;AACvE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE;AACzF,IAAI,IAAI,EAAE,eAAe;AACzB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB;;;;"}
1
+ {"version":3,"file":"membership.js","sources":["../../../src/api/membership.ts"],"sourcesContent":["import {\n ActivateMembershipRequest,\n CancelMembershipRequest,\n ChangeMembershipRequest,\n MembershipListParams,\n MembershipListResponse,\n MembershipResponse,\n} from '../types/membership';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/** @internal Retrieves membership information for passed in id */\nexport async function getMembership(session: Session, id: string | number) {\n const { membership } = await rechargeApiRequest<MembershipResponse>('get', `/memberships`, { id }, session);\n return membership;\n}\n\n/** @internal Retrieves a list of memberships */\nexport function listMemberships(session: Session, query?: MembershipListParams) {\n return rechargeApiRequest<MembershipListResponse>('get', `/memberships`, { query }, session);\n}\n\n/** @internal Cancels a membership */\nexport async function cancelMembership(session: Session, id: string | number, cancelRequest: CancelMembershipRequest) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/cancel`,\n {\n data: cancelRequest,\n },\n session\n );\n return membership;\n}\n\n/** @internal Activates a membership */\nexport async function activateMembership(\n session: Session,\n id: string | number,\n activateRequest: ActivateMembershipRequest\n) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/activate`,\n {\n data: activateRequest,\n },\n session\n );\n return membership;\n}\n\n/** @internal changes a membership program/product*/\nexport async function changeMembership(session: Session, id: string | number, changeRequest: ChangeMembershipRequest) {\n const { membership } = await rechargeApiRequest<MembershipResponse>(\n 'post',\n `/memberships/${id}/change`,\n {\n data: changeRequest,\n },\n session\n );\n return membership;\n}\n"],"names":[],"mappings":";;AACO,eAAe,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE;AACjD,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1F,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,SAAS,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE;AAChD,EAAE,OAAO,kBAAkB,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC;AACM,eAAe,gBAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE;AACnE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,eAAe,kBAAkB,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE;AACvE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE;AACzF,IAAI,IAAI,EAAE,eAAe;AACzB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB,CAAC;AACM,eAAe,gBAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE;AACnE,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;AACvF,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG,EAAE,OAAO,CAAC,CAAC;AACd,EAAE,OAAO,UAAU,CAAC;AACpB;;;;"}
@@ -0,0 +1,12 @@
1
+ import { rechargeApiRequest } from '../utils/request.js';
2
+
3
+ async function getMembershipProgram(session, id, options) {
4
+ const { membership_program } = await rechargeApiRequest("get", `/membership_programs`, { id, query: { include: options == null ? void 0 : options.include } }, session);
5
+ return membership_program;
6
+ }
7
+ function listMembershipPrograms(session, query) {
8
+ return rechargeApiRequest("get", `/membership_programs`, { query }, session);
9
+ }
10
+
11
+ export { getMembershipProgram, listMembershipPrograms };
12
+ //# sourceMappingURL=membershipProgram.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"membershipProgram.js","sources":["../../../src/api/membershipProgram.ts"],"sourcesContent":["import {\n MembershipProgramListParams,\n MembershipProgramListResponse,\n MembershipProgramResponse,\n GetMembershipProgramOptions,\n} from '../types/membershipProgram';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\n/** @internal Retrieves membership program information for passed in id */\nexport async function getMembershipProgram(\n session: Session,\n id: string | number,\n options?: GetMembershipProgramOptions\n) {\n const { membership_program } = await rechargeApiRequest<MembershipProgramResponse>(\n 'get',\n `/membership_programs`,\n { id, query: { include: options?.include } },\n session\n );\n return membership_program;\n}\n\n/** @internal Retrieves a list of memberships */\nexport function listMembershipPrograms(session: Session, query?: MembershipProgramListParams) {\n return rechargeApiRequest<MembershipProgramListResponse>('get', `/membership_programs`, { query }, session);\n}\n"],"names":[],"mappings":";;AACO,eAAe,oBAAoB,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE;AACjE,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1K,EAAE,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AACM,SAAS,sBAAsB,CAAC,OAAO,EAAE,KAAK,EAAE;AACvD,EAAE,OAAO,kBAAkB,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AAC/E;;;;"}
package/dist/esm/index.js CHANGED
@@ -3,7 +3,8 @@ export { loginShopifyApi, loginShopifyAppProxy, sendPasswordlessCode, sendPasswo
3
3
  export { applyDiscountToCharge, getCharge, listCharges, processCharge, removeDiscountsFromCharge, skipCharge, unskipCharge } from './api/charge.js';
4
4
  export { getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, resetCDNCache } from './api/cdn.js';
5
5
  export { createBundleSelection, deleteBundleSelection, getBundleId, getBundleSelection, getDynamicBundleItems, listBundleSelections, updateBundleSelection, validateBundle, validateDynamicBundle } from './api/bundle.js';
6
- export { activateMembership, cancelMembership, getMembership, listMemberships } from './api/membership.js';
6
+ export { activateMembership, cancelMembership, changeMembership, getMembership, listMemberships } from './api/membership.js';
7
+ export { getMembershipProgram, listMembershipPrograms } from './api/membershipProgram.js';
7
8
  export { createMetafield, deleteMetafield, updateMetafield } from './api/metafield.js';
8
9
  export { createOnetime, deleteOnetime, getOnetime, listOnetimes, updateOnetime } from './api/onetime.js';
9
10
  export { getOrder, listOrders } from './api/order.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1572,6 +1572,111 @@ interface CancelMembershipRequest {
1572
1572
  cancellation_reason_comments: string;
1573
1573
  expires_at: IsoDateString;
1574
1574
  }
1575
+ /** @internal */
1576
+ type intervalUnit = 'day' | 'month' | 'year';
1577
+ /** @internal */
1578
+ interface ChangeMembershipRequest {
1579
+ /** Updates the membership program to the membership specified one. If membership_program_id is not specified, a external_product_id should be specified. */
1580
+ membership_program_id?: number;
1581
+ /** Updates the membership product to the specified one. If external_product_id is not specified, a membership_program_id should be specified. */
1582
+ external_product_id?: string;
1583
+ /** Updates the the variant id to the specified one. */
1584
+ external_variant_id?: string;
1585
+ /** Updates the interval frequency to the specified one. A charge_interval_frequency must be included when providing an interval frequency. */
1586
+ charge_interval_frequency?: number;
1587
+ /** Updates the interval frequency unit to the specified one. A charge_interval_frequency must be included when providing an interval unit. */
1588
+ charge_interval_unit?: intervalUnit;
1589
+ /** Updates the price to the specified one. If not provided the subscription will be updated with the price of the new external_product_id*/
1590
+ price?: number;
1591
+ /** Updates the membership quantity. This is only meant to be used with memberships whose quantity is greater than 1. */
1592
+ quantity?: number;
1593
+ }
1594
+
1595
+ /** @internal */
1596
+ interface MembershipBenefit {
1597
+ id: number;
1598
+ category: string;
1599
+ type: string;
1600
+ status: string;
1601
+ name: string;
1602
+ program_id: number;
1603
+ description: string;
1604
+ created_at: IsoDateString;
1605
+ updated_at: IsoDateString;
1606
+ }
1607
+
1608
+ /** @internal */
1609
+ type CollectionsSortBy = 'id-desc' | 'id-asc' | 'created_at-asc' | 'created_at-desc' | 'updated_at-desc' | 'updated_at-asc' | 'title-asc' | 'title-desc';
1610
+ /** @internal */
1611
+ type CollectionTypes = 'automatic' | 'manual';
1612
+ /** @internal */
1613
+ interface Collection {
1614
+ id: number;
1615
+ title: string;
1616
+ description: string;
1617
+ sort_order: CollectionsSortBy;
1618
+ type: CollectionTypes;
1619
+ created_at: IsoDateString;
1620
+ updated_at: IsoDateString;
1621
+ }
1622
+
1623
+ /** @internal */
1624
+ interface ExternalAttributeSchema {
1625
+ order_tag: string;
1626
+ customer_tags: {
1627
+ [key: string]: string;
1628
+ };
1629
+ segments: {
1630
+ [key: string]: string;
1631
+ };
1632
+ image_path: string;
1633
+ }
1634
+ /** @internal */
1635
+ interface GetMembershipProgramOptions {
1636
+ include?: MembershipProgramIncludes[];
1637
+ }
1638
+ /** @internal */
1639
+ interface MembershipProgram {
1640
+ id: number;
1641
+ description: string;
1642
+ name: string;
1643
+ status: string;
1644
+ tag_name: string;
1645
+ created_at: IsoDateString;
1646
+ updated_at: IsoDateString;
1647
+ external_attributes: ExternalAttributeSchema;
1648
+ includes?: {
1649
+ membership_benefits?: MembershipBenefit[];
1650
+ collections?: Collection[];
1651
+ };
1652
+ }
1653
+ /** @internal */
1654
+ interface MembershipProgramResponse {
1655
+ membership_program: MembershipProgram;
1656
+ }
1657
+ /** @internal */
1658
+ interface MembershipProgramListResponse {
1659
+ next_cursor: null | string;
1660
+ previous_cursor: null | string;
1661
+ membership_programs: MembershipProgram[];
1662
+ }
1663
+ /** @internal */
1664
+ type MembershipProgramSortBy = 'id-asc' | 'id-desc';
1665
+ /** @internal */
1666
+ type MembershipProgramStatus = 'active' | 'inactive';
1667
+ /** @internal */
1668
+ type MembershipProgramIncludes = 'membership_benefits' | 'collections';
1669
+ /** @internal */
1670
+ interface MembershipProgramListParams extends ListParams<MembershipProgramSortBy> {
1671
+ /** Return the membership program with specified IDs. */
1672
+ ids?: number[];
1673
+ /** Return the membership program with specified status. */
1674
+ status?: MembershipProgramStatus;
1675
+ /** If true the response will include the deleted membership programs as well as the others. */
1676
+ include_deleted?: boolean;
1677
+ /** Includes the specified resources associated to each returned membership program. */
1678
+ include?: MembershipProgramIncludes[];
1679
+ }
1575
1680
 
1576
1681
  interface Onetime {
1577
1682
  /** Unique numeric identifier for the Onetime purchase. */
@@ -1780,6 +1885,13 @@ declare function listMemberships(session: Session, query?: MembershipListParams)
1780
1885
  declare function cancelMembership(session: Session, id: string | number, cancelRequest: CancelMembershipRequest): Promise<Membership>;
1781
1886
  /** @internal Activates a membership */
1782
1887
  declare function activateMembership(session: Session, id: string | number, activateRequest: ActivateMembershipRequest): Promise<Membership>;
1888
+ /** @internal changes a membership program/product*/
1889
+ declare function changeMembership(session: Session, id: string | number, changeRequest: ChangeMembershipRequest): Promise<Membership>;
1890
+
1891
+ /** @internal Retrieves membership program information for passed in id */
1892
+ declare function getMembershipProgram(session: Session, id: string | number, options?: GetMembershipProgramOptions): Promise<MembershipProgram>;
1893
+ /** @internal Retrieves a list of memberships */
1894
+ declare function listMembershipPrograms(session: Session, query?: MembershipProgramListParams): Promise<MembershipProgramListResponse>;
1783
1895
 
1784
1896
  declare function createMetafield(session: Session, createRequest: CreateMetafieldRequest): Promise<Metafield>;
1785
1897
  declare function updateMetafield(session: Session, id: string | number, updateRequest: UpdateMetafieldRequest): Promise<Metafield>;
@@ -1867,4 +1979,4 @@ declare const api: {
1867
1979
  };
1868
1980
  declare function initRecharge(opt?: InitOptions): void;
1869
1981
 
1870
- export { ActivateMembershipRequest, Address, AddressIncludes, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, AssociatedAddress, BasicSubscriptionParams, BooleanLike, BooleanNumbers, BooleanString, BooleanStringNumbers, BundleAppProxy, BundleSelection, BundleSelectionAppProxy, BundleSelectionItem, BundleSelectionItemRequiredCreateProps, BundleSelectionListParams, BundleSelectionsResponse, BundleSelectionsSortBy, 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, ChargeIncludes, ChargeListParams, ChargeListResponse, ChargeResponse, ChargeSortBy, ChargeStatus, ColorString, CreateAddressRequest, CreateBundleSelectionRequest, CreateMetafieldRequest, CreateOnetimeRequest, CreateSubscriptionRequest, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerPortalAccessResponse, Delivery, DeliveryLineItem, DeliveryOrder, DeliveryPaymentMethod, Discount, DynamicBundleItemAppProxy, DynamicBundlePropertiesAppProxy, ExternalId, ExternalTransactionId, FirstOption, GetAddressOptions, GetChargeOptions, GetCustomerOptions, GetPaymentMethodOptions, GetRequestOptions, GetSubscriptionOptions, HTMLString, InitOptions, IntervalUnit, IsoDateString, LineItem, ListParams, LoginResponse, Membership, MembershipIncludes, MembershipListParams, MembershipListResponse, MembershipResponse, MembershipStatus, MembershipsSortBy, MergeAddressesRequest, Metafield, MetafieldOptionalCreateProps, MetafieldOwnerResource, MetafieldRequiredCreateProps, Method, Onetime, OnetimeListParams, OnetimeOptionalCreateProps, OnetimeRequiredCreateProps, OnetimesResponse, OnetimesSortBy, Order, OrderIncludes, OrderListParams, OrderSortBy, OrderStatus, OrderType, OrdersResponse, PasswordlessCodeResponse, PasswordlessValidateResponse, PaymentDetails, PaymentMethod, PaymentMethodIncludes, PaymentMethodListParams, PaymentMethodSortBy, PaymentMethodStatus, PaymentMethodsResponse, PaymentType, Plan, PlanListParams, PlanSortBy, PlanType, PlansResponse, PriceAdjustmentsType, ProcessorName, ProductImage, Property, Request, RequestHeaders, RequestOptions, Session, ShippingLine, SkipFutureChargeAddressRequest, SkipFutureChargeAddressResponse, StorefrontEnvironment, StorefrontOptions, StorefrontPurchaseOption, SubType, Subscription, SubscriptionIncludes, SubscriptionListParams, SubscriptionOptionalCreateProps, SubscriptionPreferences, SubscriptionRequiredCreateProps, SubscriptionSortBy, SubscriptionStatus, Subscription_2021_01, SubscriptionsResponse, TaxLine, Translations, UpdateAddressRequest, UpdateBundleSelectionRequest, UpdateCustomerRequest, UpdateMetafieldRequest, UpdateOnetimeRequest, UpdatePaymentMethodRequest, UpdateSubscriptionParams, UpdateSubscriptionRequest, UpdateSubscriptionsParams, UpdateSubscriptionsRequest, WidgetIconColor, WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscountToAddress, applyDiscountToCharge, cancelMembership, cancelSubscription, createAddress, createBundleSelection, createMetafield, createOnetime, createSubscription, createSubscriptions, deleteAddress, deleteBundleSelection, deleteMetafield, deleteOnetime, getAddress, getBundleId, getBundleSelection, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCustomer, getCustomerPortalAccess, getDeliverySchedule, getDynamicBundleItems, getMembership, getOnetime, getOrder, getPaymentMethod, getPlan, getSubscription, initRecharge, listAddresses, listBundleSelections, listCharges, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginShopifyApi, loginShopifyAppProxy, membershipIncludes, mergeAddresses, processCharge, removeDiscountsFromAddress, removeDiscountsFromCharge, resetCDNCache, sendPasswordlessCode, sendPasswordlessCodeAppProxy, skipCharge, skipFutureCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateBundleSelection, updateCustomer, updateMetafield, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, updateSubscriptions, validateBundle, validateDynamicBundle, validatePasswordlessCode, validatePasswordlessCodeAppProxy };
1982
+ export { ActivateMembershipRequest, Address, AddressIncludes, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, AssociatedAddress, BasicSubscriptionParams, BooleanLike, BooleanNumbers, BooleanString, BooleanStringNumbers, BundleAppProxy, BundleSelection, BundleSelectionAppProxy, BundleSelectionItem, BundleSelectionItemRequiredCreateProps, BundleSelectionListParams, BundleSelectionsResponse, BundleSelectionsSortBy, 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, ChangeMembershipRequest, ChannelSettings, Charge, ChargeIncludes, ChargeListParams, ChargeListResponse, ChargeResponse, ChargeSortBy, ChargeStatus, ColorString, CreateAddressRequest, CreateBundleSelectionRequest, CreateMetafieldRequest, CreateOnetimeRequest, CreateSubscriptionRequest, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerPortalAccessResponse, Delivery, DeliveryLineItem, DeliveryOrder, DeliveryPaymentMethod, Discount, DynamicBundleItemAppProxy, DynamicBundlePropertiesAppProxy, ExternalAttributeSchema, ExternalId, ExternalTransactionId, FirstOption, GetAddressOptions, GetChargeOptions, GetCustomerOptions, GetMembershipProgramOptions, GetPaymentMethodOptions, GetRequestOptions, GetSubscriptionOptions, HTMLString, InitOptions, IntervalUnit, IsoDateString, LineItem, ListParams, LoginResponse, Membership, MembershipBenefit, MembershipIncludes, MembershipListParams, MembershipListResponse, MembershipProgram, MembershipProgramIncludes, MembershipProgramListParams, MembershipProgramListResponse, MembershipProgramResponse, MembershipProgramSortBy, MembershipProgramStatus, MembershipResponse, MembershipStatus, MembershipsSortBy, MergeAddressesRequest, Metafield, MetafieldOptionalCreateProps, MetafieldOwnerResource, MetafieldRequiredCreateProps, Method, Onetime, OnetimeListParams, OnetimeOptionalCreateProps, OnetimeRequiredCreateProps, OnetimesResponse, OnetimesSortBy, Order, OrderIncludes, OrderListParams, OrderSortBy, OrderStatus, OrderType, OrdersResponse, PasswordlessCodeResponse, PasswordlessValidateResponse, PaymentDetails, PaymentMethod, PaymentMethodIncludes, PaymentMethodListParams, PaymentMethodSortBy, PaymentMethodStatus, PaymentMethodsResponse, PaymentType, Plan, PlanListParams, PlanSortBy, PlanType, PlansResponse, PriceAdjustmentsType, ProcessorName, ProductImage, Property, Request, RequestHeaders, RequestOptions, Session, ShippingLine, SkipFutureChargeAddressRequest, SkipFutureChargeAddressResponse, StorefrontEnvironment, StorefrontOptions, StorefrontPurchaseOption, SubType, Subscription, SubscriptionIncludes, SubscriptionListParams, SubscriptionOptionalCreateProps, SubscriptionPreferences, SubscriptionRequiredCreateProps, SubscriptionSortBy, SubscriptionStatus, Subscription_2021_01, SubscriptionsResponse, TaxLine, Translations, UpdateAddressRequest, UpdateBundleSelectionRequest, UpdateCustomerRequest, UpdateMetafieldRequest, UpdateOnetimeRequest, UpdatePaymentMethodRequest, UpdateSubscriptionParams, UpdateSubscriptionRequest, UpdateSubscriptionsParams, UpdateSubscriptionsRequest, WidgetIconColor, WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscountToAddress, applyDiscountToCharge, cancelMembership, cancelSubscription, changeMembership, createAddress, createBundleSelection, createMetafield, createOnetime, createSubscription, createSubscriptions, deleteAddress, deleteBundleSelection, deleteMetafield, deleteOnetime, getAddress, getBundleId, getBundleSelection, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCustomer, getCustomerPortalAccess, getDeliverySchedule, getDynamicBundleItems, getMembership, getMembershipProgram, getOnetime, getOrder, getPaymentMethod, getPlan, getSubscription, initRecharge, intervalUnit, listAddresses, listBundleSelections, listCharges, listMembershipPrograms, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginShopifyApi, loginShopifyAppProxy, membershipIncludes, mergeAddresses, processCharge, removeDiscountsFromAddress, removeDiscountsFromCharge, resetCDNCache, sendPasswordlessCode, sendPasswordlessCodeAppProxy, skipCharge, skipFutureCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateBundleSelection, updateCustomer, updateMetafield, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, updateSubscriptions, validateBundle, validateDynamicBundle, validatePasswordlessCode, validatePasswordlessCodeAppProxy };
@@ -1,4 +1,4 @@
1
- // recharge-client-1.0.1.min.js | MIT License | © Recharge Inc.
1
+ // recharge-client-1.1.0.min.js | MIT License | © Recharge Inc.
2
2
  (function(ne,Ke){typeof exports=="object"&&typeof module<"u"?module.exports=Ke():typeof define=="function"&&define.amd?define(Ke):(ne=typeof globalThis<"u"?globalThis:ne||self,ne.recharge=Ke())})(this,function(){"use strict";var ne=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 L=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof L<"u"&&L,k={searchParams:"URLSearchParams"in L,iterable:"Symbol"in L&&"iterator"in Symbol,blob:"FileReader"in L&&"Blob"in L&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in L,arrayBuffer:"ArrayBuffer"in L};function tf(r){return r&&DataView.prototype.isPrototypeOf(r)}if(k.arrayBuffer)var nf=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],af=ArrayBuffer.isView||function(r){return r&&nf.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 kt(r){return typeof r!="string"&&(r=String(r)),r}function qt(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return k.iterable&&(e[Symbol.iterator]=function(){return e}),e}function D(r){this.map={},r instanceof D?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)}D.prototype.append=function(r,e){r=Ze(r),e=kt(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},D.prototype.delete=function(r){delete this.map[Ze(r)]},D.prototype.get=function(r){return r=Ze(r),this.has(r)?this.map[r]:null},D.prototype.has=function(r){return this.map.hasOwnProperty(Ze(r))},D.prototype.set=function(r,e){this.map[Ze(r)]=kt(e)},D.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},D.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),qt(r)},D.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),qt(r)},D.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),qt(r)},k.iterable&&(D.prototype[Symbol.iterator]=D.prototype.entries);function Gt(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 of(r){var e=new FileReader,t=Oi(e);return e.readAsArrayBuffer(r),t}function uf(r){var e=new FileReader,t=Oi(e);return e.readAsText(r),t}function sf(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 Si(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function Ii(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:k.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:k.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():k.arrayBuffer&&k.blob&&tf(r)?(this._bodyArrayBuffer=Si(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):k.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||af(r))?this._bodyArrayBuffer=Si(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):k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},k.blob&&(this.blob=function(){var r=Gt(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=Gt(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(of)}),this.text=function(){var r=Gt(this);if(r)return r;if(this._bodyBlob)return uf(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(sf(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},k.formData&&(this.formData=function(){return this.text().then(lf)}),this.json=function(){return this.text().then(JSON.parse)},this}var ff=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function cf(r){var e=r.toUpperCase();return ff.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 D(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 D(e.headers)),this.method=cf(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 lf(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 pf(r){var e=new D,t=r.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
3
3
  `)===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}Ii.call(_e.prototype);function Y(r,e){if(!(this instanceof Y))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 D(e.headers),this.url=e.url||"",this._initBody(r)}Ii.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},Y.error=function(){var r=new Y(null,{status:0,statusText:""});return r.type="error",r};var hf=[301,302,303,307,308];Y.redirect=function(r,e){if(hf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new Y(null,{status:e,headers:{location:r}})};var me=L.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 Pi(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 f={status:a.status,statusText:a.statusText,headers:pf(a.getAllResponseHeaders()||"")};f.url="responseURL"in a?a.responseURL:f.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new Y(c,f))},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 s(f){try{return f===""&&L.location.href?L.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(k.blob?a.responseType="blob":k.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 D)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,kt(e.headers[f]))}):i.headers.forEach(function(f,c){a.setRequestHeader(c,f)}),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)})}Pi.polyfill=!0,L.fetch||(L.fetch=Pi,L.Headers=D,L.Request=_e,L.Response=Y),self.fetch.bind(self);var df=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},Ti=typeof Symbol<"u"&&Symbol,yf=df,vf=function(){return typeof Ti!="function"||typeof Symbol!="function"||typeof Ti("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:yf()},gf="Function.prototype.bind called on incompatible ",Wt=Array.prototype.slice,_f=Object.prototype.toString,mf="[object Function]",wf=function(e){var t=this;if(typeof t!="function"||_f.call(t)!==mf)throw new TypeError(gf+t);for(var n=Wt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Wt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Wt.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.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},bf=wf,Vt=Function.prototype.bind||bf,$f=Vt,Af=$f.call(Function.call,Object.prototype.hasOwnProperty),T,Fe=SyntaxError,xi=Function,Me=TypeError,Ht=function(r){try{return xi('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var zt=function(){throw new Me},Ef=we?function(){try{return arguments.callee,zt}catch{try{return we(arguments,"callee").get}catch{return zt}}}():zt,De=vf(),pe=Object.getPrototypeOf||function(r){return r.__proto__},Be={},Of=typeof Uint8Array>"u"?T:pe(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":De?pe([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":Be,"%AsyncGenerator%":Be,"%AsyncGeneratorFunction%":Be,"%AsyncIteratorPrototype%":Be,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":xi,"%GeneratorFunction%":Be,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De?pe(pe([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De?T:pe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De?T:pe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De?pe(""[Symbol.iterator]()):T,"%Symbol%":De?Symbol:T,"%SyntaxError%":Fe,"%ThrowTypeError%":Ef,"%TypedArray%":Of,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet},Sf=function r(e){var t;if(e==="%AsyncFunction%")t=Ht("async function () {}");else if(e==="%GeneratorFunction%")t=Ht("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Ht("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=pe(i.prototype))}return Ne[e]=t,t},Ri={"%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=Vt,xr=Af,If=Je.call(Function.call,Array.prototype.concat),Pf=Je.call(Function.apply,Array.prototype.splice),Fi=Je.call(Function.call,String.prototype.replace),Rr=Je.call(Function.call,String.prototype.slice),Tf=Je.call(Function.call,RegExp.prototype.exec),xf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Rf=/\\(\\)?/g,Ff=function(e){var t=Rr(e,0,1),n=Rr(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 Fi(e,xf,function(a,o,s,f){i[i.length]=s?Fi(f,Rf,"$1"):o||a}),i},Mf=function(e,t){var n=e,i;if(xr(Ri,n)&&(i=Ri[n],n="%"+i[0]+"%"),xr(Ne,n)){var a=Ne[n];if(a===Be&&(a=Sf(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 Fe("intrinsic "+e+" does not exist!")},Xt=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(Tf(/^%?[^%]*%?$/,e)===null)throw new Fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ff(e),i=n.length>0?n[0]:"",a=Mf("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],Pf(n,If([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var p=n[l],d=Rr(p,0,1),_=Rr(p,-1);if((d==='"'||d==="'"||d==="`"||_==='"'||_==="'"||_==="`")&&d!==_)throw new Fe("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(f=!0),i+="."+p,o="%"+i+"%",xr(Ne,o))s=Ne[o];else if(s!=null){if(!(p in s)){if(!t)throw new Me("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&l+1>=n.length){var $=we(s,p);u=!!$,u&&"get"in $&&!("originalValue"in $.get)?s=$.get:s=s[p]}else u=xr(s,p),s=s[p];u&&!f&&(Ne[o]=s)}}return s},Mi={exports:{}};(function(r){var e=Vt,t=Xt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var p=a(e,i,arguments);if(o&&s){var d=o(p,"length");d.configurable&&s(p,"length",{value:1+f(0,u.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(Mi);var Di=Xt,Bi=Mi.exports,Df=Bi(Di("String.prototype.indexOf")),Bf=function(e,t){var n=Di(e,!!t);return typeof n=="function"&&Df(e,".prototype.")>-1?Bi(n):n},Ue=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},K=[],W=[],Nf=typeof Uint8Array<"u"?Uint8Array:Array,Yt=!1;function Ni(){Yt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)K[e]=r[e],W[r.charCodeAt(e)]=e;W["-".charCodeAt(0)]=62,W["_".charCodeAt(0)]=63}function Uf(r){Yt||Ni();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Nf(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=W[r.charCodeAt(e)]<<18|W[r.charCodeAt(e+1)]<<12|W[r.charCodeAt(e+2)]<<6|W[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=W[r.charCodeAt(e)]<<2|W[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=W[r.charCodeAt(e)]<<10|W[r.charCodeAt(e+1)]<<4|W[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function Cf(r){return K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}function Lf(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(Cf(n));return i.join("")}function Ui(r){Yt||Ni();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(Lf(r,s,s+o>f?f:s+o));return n===1?(e=r[t-1],i+=K[e>>2],i+=K[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=K[e>>10],i+=K[e>>4&63],i+=K[e<<2&63],i+="="),a.push(i),a.join("")}function Fr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>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+=s;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===f)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 Ci(r,e,t,n,i,a){var o,s,f,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<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=p/f:e+=p*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=s&255,d+=_,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+d]=o&255,d+=_,o/=256,c-=8);r[t+d-_]|=$*128}var jf={}.toString,Li=Array.isArray||function(r){return jf.call(r)=="[object Array]"};/*!
4
4
  * The buffer module from node.js, for the browser.
@@ -14,13 +14,13 @@
14
14
  `))):s=r.stylize("[Circular]","special")),Q(o)){if(a&&i.match(/^\d+$/))return s;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+": "+s}function Hc(r,e,t){var n=r.reduce(function(i,a){return a.indexOf(`
15
15
  `)>=0,i+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(e===""?"":e+`
16
16
  `)+" "+r.join(`,
17
- `)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function an(r){return Array.isArray(r)}function Gr(r){return typeof r=="boolean"}function Qe(r){return r===null}function oa(r){return r==null}function on(r){return typeof r=="number"}function er(r){return typeof r=="string"}function ua(r){return typeof r=="symbol"}function Q(r){return r===void 0}function rr(r){return Ee(r)&&un(r)==="[object RegExp]"}function Ee(r){return typeof r=="object"&&r!==null}function Wr(r){return Ee(r)&&un(r)==="[object Date]"}function tr(r){return Ee(r)&&(un(r)==="[object Error]"||r instanceof Error)}function nr(r){return typeof r=="function"}function sa(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function fa(r){return y.isBuffer(r)}function un(r){return Object.prototype.toString.call(r)}function sn(r){return r<10?"0"+r.toString(10):r.toString(10)}var zc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Xc(){var r=new Date,e=[sn(r.getHours()),sn(r.getMinutes()),sn(r.getSeconds())].join(":");return[r.getDate(),zc[r.getMonth()],e].join(" ")}function ca(){console.log("%s - %s",Xc(),jr.apply(null,arguments))}function fn(r,e){if(!e||!Ee(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function la(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Yc={inherits:ia,_extend:fn,log:ca,isBuffer:fa,isPrimitive:sa,isFunction:nr,isError:tr,isDate:Wr,isObject:Ee,isRegExp:rr,isUndefined:Q,isSymbol:ua,isString:er,isNumber:on,isNullOrUndefined:oa,isNull:Qe,isBoolean:Gr,isArray:an,inspect:J,deprecate:en,format:jr,debuglog:aa},Kc=Object.freeze({__proto__:null,format:jr,deprecate:en,debuglog:aa,inspect:J,isArray:an,isBoolean:Gr,isNull:Qe,isNullOrUndefined:oa,isNumber:on,isString:er,isSymbol:ua,isUndefined:Q,isRegExp:rr,isObject:Ee,isDate:Wr,isError:tr,isFunction:nr,isPrimitive:sa,isBuffer:fa,log:ca,inherits:ia,_extend:fn,default:Yc}),Zc=Ke(Kc),Jc=Zc.inspect,cn=typeof Map=="function"&&Map.prototype,ln=Object.getOwnPropertyDescriptor&&cn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Vr=cn&&ln&&typeof ln.get=="function"?ln.get:null,Qc=cn&&Map.prototype.forEach,pn=typeof Set=="function"&&Set.prototype,hn=Object.getOwnPropertyDescriptor&&pn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=pn&&hn&&typeof hn.get=="function"?hn.get:null,el=pn&&Set.prototype.forEach,rl=typeof WeakMap=="function"&&WeakMap.prototype,ir=rl?WeakMap.prototype.has:null,tl=typeof WeakSet=="function"&&WeakSet.prototype,ar=tl?WeakSet.prototype.has:null,nl=typeof WeakRef=="function"&&WeakRef.prototype,pa=nl?WeakRef.prototype.deref:null,il=Boolean.prototype.valueOf,al=Object.prototype.toString,ol=Function.prototype.toString,ul=String.prototype.match,dn=String.prototype.slice,ye=String.prototype.replace,sl=String.prototype.toUpperCase,ha=String.prototype.toLowerCase,da=RegExp.prototype.test,ya=Array.prototype.concat,ee=Array.prototype.join,fl=Array.prototype.slice,va=Math.floor,yn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,vn=Object.getOwnPropertySymbols,gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,je=typeof Symbol=="function"&&typeof Symbol.iterator=="object",j=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===je?"object":"symbol")?Symbol.toStringTag:null,ga=Object.prototype.propertyIsEnumerable,_a=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ma(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||da.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-va(-r):va(r);if(n!==r){var i=String(n),a=dn.call(e,i.length+1);return ye.call(i,t,"$&_")+"."+ye.call(ye.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ye.call(e,t,"$&_")}var _n=Jc,wa=_n.custom,ba=Ea(wa)?wa:null,cl=function r(e,t,n,i){var a=t||{};if(ve(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ve(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=ve(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(ve(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(ve(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=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 f=String(e);return s?ma(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?ma(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 mn(e)?"[Array]":"[Object]";var u=Pl(a,n);if(typeof i>"u")i=[];else if(Oa(i,e)>=0)return"[Circular]";function p(H,te,X){if(te&&(i=fl.call(i),i.push(te)),X){var Re={depth:a.depth};return ve(a,"quoteStyle")&&(Re.quoteStyle=a.quoteStyle),r(H,Re,n+1,i)}return r(H,a,n+1,i)}if(typeof e=="function"&&!Aa(e)){var d=ml(e),_=zr(e,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(_.length>0?" { "+ee.call(_,", ")+" }":"")}if(Ea(e)){var $=je?ye.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):gn.call(e);return typeof e=="object"&&!je?or($):$}if(Ol(e)){for(var b="<"+ha.call(String(e.nodeName)),w=e.attributes||[],A=0;A<w.length;A++)b+=" "+w[A].name+"="+$a(ll(w[A].value),"double",a);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+ha.call(String(e.nodeName))+">",b}if(mn(e)){if(e.length===0)return"[]";var h=zr(e,p);return u&&!Il(h)?"["+bn(h,u)+"]":"[ "+ee.call(h,", ")+" ]"}if(hl(e)){var I=zr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!ga.call(e,"cause")?"{ ["+String(e)+"] "+ee.call(ya.call("[cause]: "+p(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ee.call(I,", ")+" }"}if(typeof e=="object"&&o){if(ba&&typeof e[ba]=="function"&&_n)return _n(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(wl(e)){var P=[];return Qc.call(e,function(H,te){P.push(p(te,e,!0)+" => "+p(H,e))}),Ia("Map",Vr.call(e),P,u)}if(Al(e)){var R=[];return el.call(e,function(H){R.push(p(H,e))}),Ia("Set",Hr.call(e),R,u)}if(bl(e))return wn("WeakMap");if(El(e))return wn("WeakSet");if($l(e))return wn("WeakRef");if(yl(e))return or(p(Number(e)));if(gl(e))return or(p(yn.call(e)));if(vl(e))return or(il.call(e));if(dl(e))return or(p(String(e)));if(!pl(e)&&!Aa(e)){var m=zr(e,p),v=_a?_a(e)===Object.prototype:e instanceof Object||e.constructor===Object,g=e instanceof Object?"":"null prototype",E=!v&&j&&Object(e)===e&&j in e?dn.call(ge(e),8,-1):g?"Object":"",S=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",B=S+(E||g?"["+ee.call(ya.call([],E||[],g||[]),": ")+"] ":"");return m.length===0?B+"{}":u?B+"{"+bn(m,u)+"}":B+"{ "+ee.call(m,", ")+" }"}return String(e)};function $a(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function ll(r){return ye.call(String(r),/"/g,"&quot;")}function mn(r){return ge(r)==="[object Array]"&&(!j||!(typeof r=="object"&&j in r))}function pl(r){return ge(r)==="[object Date]"&&(!j||!(typeof r=="object"&&j in r))}function Aa(r){return ge(r)==="[object RegExp]"&&(!j||!(typeof r=="object"&&j in r))}function hl(r){return ge(r)==="[object Error]"&&(!j||!(typeof r=="object"&&j in r))}function dl(r){return ge(r)==="[object String]"&&(!j||!(typeof r=="object"&&j in r))}function yl(r){return ge(r)==="[object Number]"&&(!j||!(typeof r=="object"&&j in r))}function vl(r){return ge(r)==="[object Boolean]"&&(!j||!(typeof r=="object"&&j in r))}function Ea(r){if(je)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!gn)return!1;try{return gn.call(r),!0}catch{}return!1}function gl(r){if(!r||typeof r!="object"||!yn)return!1;try{return yn.call(r),!0}catch{}return!1}var _l=Object.prototype.hasOwnProperty||function(r){return r in this};function ve(r,e){return _l.call(r,e)}function ge(r){return al.call(r)}function ml(r){if(r.name)return r.name;var e=ul.call(ol.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 wl(r){if(!Vr||!r||typeof r!="object")return!1;try{Vr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function bl(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 $l(r){if(!pa||!r||typeof r!="object")return!1;try{return pa.call(r),!0}catch{}return!1}function Al(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Vr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function El(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 Ol(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(dn.call(r,0,e.maxStringLength),e)+n}var i=ye.call(ye.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Sl);return $a(i,"single",e)}function Sl(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":"")+sl.call(e.toString(16))}function or(r){return"Object("+r+")"}function wn(r){return r+" { ? }"}function Ia(r,e,t,n){var i=n?bn(t,n):ee.call(t,", ");return r+" ("+e+") {"+i+"}"}function Il(r){for(var e=0;e<r.length;e++)if(Oa(r[e],`
17
+ `)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function an(r){return Array.isArray(r)}function Gr(r){return typeof r=="boolean"}function Qe(r){return r===null}function oa(r){return r==null}function on(r){return typeof r=="number"}function er(r){return typeof r=="string"}function ua(r){return typeof r=="symbol"}function Q(r){return r===void 0}function rr(r){return Ee(r)&&un(r)==="[object RegExp]"}function Ee(r){return typeof r=="object"&&r!==null}function Wr(r){return Ee(r)&&un(r)==="[object Date]"}function tr(r){return Ee(r)&&(un(r)==="[object Error]"||r instanceof Error)}function nr(r){return typeof r=="function"}function sa(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function fa(r){return y.isBuffer(r)}function un(r){return Object.prototype.toString.call(r)}function sn(r){return r<10?"0"+r.toString(10):r.toString(10)}var zc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Xc(){var r=new Date,e=[sn(r.getHours()),sn(r.getMinutes()),sn(r.getSeconds())].join(":");return[r.getDate(),zc[r.getMonth()],e].join(" ")}function ca(){console.log("%s - %s",Xc(),jr.apply(null,arguments))}function fn(r,e){if(!e||!Ee(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function la(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Yc={inherits:ia,_extend:fn,log:ca,isBuffer:fa,isPrimitive:sa,isFunction:nr,isError:tr,isDate:Wr,isObject:Ee,isRegExp:rr,isUndefined:Q,isSymbol:ua,isString:er,isNumber:on,isNullOrUndefined:oa,isNull:Qe,isBoolean:Gr,isArray:an,inspect:J,deprecate:en,format:jr,debuglog:aa},Kc=Object.freeze({__proto__:null,format:jr,deprecate:en,debuglog:aa,inspect:J,isArray:an,isBoolean:Gr,isNull:Qe,isNullOrUndefined:oa,isNumber:on,isString:er,isSymbol:ua,isUndefined:Q,isRegExp:rr,isObject:Ee,isDate:Wr,isError:tr,isFunction:nr,isPrimitive:sa,isBuffer:fa,log:ca,inherits:ia,_extend:fn,default:Yc}),Zc=Ke(Kc),Jc=Zc.inspect,cn=typeof Map=="function"&&Map.prototype,ln=Object.getOwnPropertyDescriptor&&cn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Vr=cn&&ln&&typeof ln.get=="function"?ln.get:null,Qc=cn&&Map.prototype.forEach,pn=typeof Set=="function"&&Set.prototype,hn=Object.getOwnPropertyDescriptor&&pn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=pn&&hn&&typeof hn.get=="function"?hn.get:null,el=pn&&Set.prototype.forEach,rl=typeof WeakMap=="function"&&WeakMap.prototype,ir=rl?WeakMap.prototype.has:null,tl=typeof WeakSet=="function"&&WeakSet.prototype,ar=tl?WeakSet.prototype.has:null,nl=typeof WeakRef=="function"&&WeakRef.prototype,pa=nl?WeakRef.prototype.deref:null,il=Boolean.prototype.valueOf,al=Object.prototype.toString,ol=Function.prototype.toString,ul=String.prototype.match,dn=String.prototype.slice,ye=String.prototype.replace,sl=String.prototype.toUpperCase,ha=String.prototype.toLowerCase,da=RegExp.prototype.test,ya=Array.prototype.concat,ee=Array.prototype.join,fl=Array.prototype.slice,va=Math.floor,yn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,vn=Object.getOwnPropertySymbols,gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,je=typeof Symbol=="function"&&typeof Symbol.iterator=="object",j=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===je?"object":"symbol")?Symbol.toStringTag:null,ga=Object.prototype.propertyIsEnumerable,_a=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ma(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||da.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-va(-r):va(r);if(n!==r){var i=String(n),a=dn.call(e,i.length+1);return ye.call(i,t,"$&_")+"."+ye.call(ye.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ye.call(e,t,"$&_")}var _n=Jc,wa=_n.custom,ba=Ea(wa)?wa:null,cl=function r(e,t,n,i){var a=t||{};if(ve(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ve(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=ve(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(ve(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(ve(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=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 f=String(e);return s?ma(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?ma(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 mn(e)?"[Array]":"[Object]";var u=Pl(a,n);if(typeof i>"u")i=[];else if(Oa(i,e)>=0)return"[Circular]";function p(H,te,X){if(te&&(i=fl.call(i),i.push(te)),X){var Re={depth:a.depth};return ve(a,"quoteStyle")&&(Re.quoteStyle=a.quoteStyle),r(H,Re,n+1,i)}return r(H,a,n+1,i)}if(typeof e=="function"&&!Aa(e)){var d=ml(e),_=zr(e,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(_.length>0?" { "+ee.call(_,", ")+" }":"")}if(Ea(e)){var $=je?ye.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):gn.call(e);return typeof e=="object"&&!je?or($):$}if(Ol(e)){for(var b="<"+ha.call(String(e.nodeName)),w=e.attributes||[],A=0;A<w.length;A++)b+=" "+w[A].name+"="+$a(ll(w[A].value),"double",a);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+ha.call(String(e.nodeName))+">",b}if(mn(e)){if(e.length===0)return"[]";var h=zr(e,p);return u&&!Il(h)?"["+bn(h,u)+"]":"[ "+ee.call(h,", ")+" ]"}if(hl(e)){var I=zr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!ga.call(e,"cause")?"{ ["+String(e)+"] "+ee.call(ya.call("[cause]: "+p(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ee.call(I,", ")+" }"}if(typeof e=="object"&&o){if(ba&&typeof e[ba]=="function"&&_n)return _n(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(wl(e)){var P=[];return Qc.call(e,function(H,te){P.push(p(te,e,!0)+" => "+p(H,e))}),Ia("Map",Vr.call(e),P,u)}if(Al(e)){var R=[];return el.call(e,function(H){R.push(p(H,e))}),Ia("Set",Hr.call(e),R,u)}if(bl(e))return wn("WeakMap");if(El(e))return wn("WeakSet");if($l(e))return wn("WeakRef");if(yl(e))return or(p(Number(e)));if(gl(e))return or(p(yn.call(e)));if(vl(e))return or(il.call(e));if(dl(e))return or(p(String(e)));if(!pl(e)&&!Aa(e)){var m=zr(e,p),v=_a?_a(e)===Object.prototype:e instanceof Object||e.constructor===Object,g=e instanceof Object?"":"null prototype",O=!v&&j&&Object(e)===e&&j in e?dn.call(ge(e),8,-1):g?"Object":"",S=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",B=S+(O||g?"["+ee.call(ya.call([],O||[],g||[]),": ")+"] ":"");return m.length===0?B+"{}":u?B+"{"+bn(m,u)+"}":B+"{ "+ee.call(m,", ")+" }"}return String(e)};function $a(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function ll(r){return ye.call(String(r),/"/g,"&quot;")}function mn(r){return ge(r)==="[object Array]"&&(!j||!(typeof r=="object"&&j in r))}function pl(r){return ge(r)==="[object Date]"&&(!j||!(typeof r=="object"&&j in r))}function Aa(r){return ge(r)==="[object RegExp]"&&(!j||!(typeof r=="object"&&j in r))}function hl(r){return ge(r)==="[object Error]"&&(!j||!(typeof r=="object"&&j in r))}function dl(r){return ge(r)==="[object String]"&&(!j||!(typeof r=="object"&&j in r))}function yl(r){return ge(r)==="[object Number]"&&(!j||!(typeof r=="object"&&j in r))}function vl(r){return ge(r)==="[object Boolean]"&&(!j||!(typeof r=="object"&&j in r))}function Ea(r){if(je)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!gn)return!1;try{return gn.call(r),!0}catch{}return!1}function gl(r){if(!r||typeof r!="object"||!yn)return!1;try{return yn.call(r),!0}catch{}return!1}var _l=Object.prototype.hasOwnProperty||function(r){return r in this};function ve(r,e){return _l.call(r,e)}function ge(r){return al.call(r)}function ml(r){if(r.name)return r.name;var e=ul.call(ol.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 wl(r){if(!Vr||!r||typeof r!="object")return!1;try{Vr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function bl(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 $l(r){if(!pa||!r||typeof r!="object")return!1;try{return pa.call(r),!0}catch{}return!1}function Al(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Vr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function El(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 Ol(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(dn.call(r,0,e.maxStringLength),e)+n}var i=ye.call(ye.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Sl);return $a(i,"single",e)}function Sl(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":"")+sl.call(e.toString(16))}function or(r){return"Object("+r+")"}function wn(r){return r+" { ? }"}function Ia(r,e,t,n){var i=n?bn(t,n):ee.call(t,", ");return r+" ("+e+") {"+i+"}"}function Il(r){for(var e=0;e<r.length;e++)if(Oa(r[e],`
18
18
  `)>=0)return!1;return!0}function Pl(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=ee.call(Array(r.indent+1)," ");else return null;return{base:t,prev:ee.call(Array(e+1),t)}}function bn(r,e){if(r.length===0)return"";var t=`
19
19
  `+e.prev+e.base;return t+ee.call(r,","+t)+`
20
- `+e.prev}function zr(r,e){var t=mn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ve(r,i)?e(r[i],r):""}var a=typeof vn=="function"?vn(r):[],o;if(je){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)!ve(r,f)||t&&String(Number(f))===f&&f<r.length||je&&o["$"+f]instanceof Symbol||(da.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof vn=="function")for(var c=0;c<a.length;c++)ga.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var $n=Xt,ke=Bf,Tl=cl,xl=$n("%TypeError%"),Xr=$n("%WeakMap%",!0),Yr=$n("%Map%",!0),Rl=ke("WeakMap.prototype.get",!0),Fl=ke("WeakMap.prototype.set",!0),Ml=ke("WeakMap.prototype.has",!0),Dl=ke("Map.prototype.get",!0),Bl=ke("Map.prototype.set",!0),Nl=ke("Map.prototype.has",!0),An=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},Ul=function(r,e){var t=An(r,e);return t&&t.value},Cl=function(r,e,t){var n=An(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Ll=function(r,e){return!!An(r,e)},jl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new xl("Side channel does not contain "+Tl(a))},get:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Rl(e,a)}else if(Yr){if(t)return Dl(t,a)}else if(n)return Ul(n,a)},has:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ml(e,a)}else if(Yr){if(t)return Nl(t,a)}else if(n)return Ll(n,a);return!1},set:function(a,o){Xr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Xr),Fl(e,a,o)):Yr?(t||(t=new Yr),Bl(t,a,o)):(n||(n={key:{},next:null}),Cl(n,a,o))}};return i},kl=String.prototype.replace,ql=/%20/g,En={RFC1738:"RFC1738",RFC3986:"RFC3986"},Pa={default:En.RFC3986,formatters:{RFC1738:function(r){return kl.call(r,ql,"+")},RFC3986:function(r){return String(r)}},RFC1738:En.RFC1738,RFC3986:En.RFC3986},Gl=Pa,On=Object.prototype.hasOwnProperty,Oe=Array.isArray,re=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Wl=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}}},Ta=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},Vl=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)||!On.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=Ta(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(On.call(e,o)){var s=e[o];s&&typeof s=="object"&&a&&typeof a=="object"?e[o]=r(s,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var s=t[o];return On.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Hl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},zl=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}},Xl=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 s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Gl.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+re[c];continue}if(c<2048){s=s+(re[192|c>>6]+re[128|c&63]);continue}if(c<55296||c>=57344){s=s+(re[224|c>>12]+re[128|c>>6&63]+re[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=re[240|c>>18]+re[128|c>>12&63]+re[128|c>>6&63]+re[128|c&63]}return s},Yl=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],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Wl(t),e},Kl=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Zl=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Jl=function(e,t){return[].concat(e,t)},Ql=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)},ep={arrayToObject:Ta,assign:Hl,combine:Jl,compact:Yl,decode:zl,encode:Xl,isBuffer:Zl,isRegExp:Kl,maybeMap:Ql,merge:Vl},xa=jl,Sn=ep,ur=Pa,rp=Object.prototype.hasOwnProperty,Ra={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},oe=Array.isArray,tp=String.prototype.split,np=Array.prototype.push,Fa=function(r,e){np.apply(r,oe(e)?e:[e])},ip=Date.prototype.toISOString,Ma=ur.default,C={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Sn.encode,encodeValuesOnly:!1,format:Ma,formatter:ur.formatters[Ma],indices:!1,serializeDate:function(e){return ip.call(e)},skipNulls:!1,strictNullHandling:!1},ap=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},In={},op=function r(e,t,n,i,a,o,s,f,c,l,u,p,d,_,$,b){for(var w=e,A=b,h=0,I=!1;(A=A.get(In))!==void 0&&!I;){var P=A.get(e);if(h+=1,typeof P<"u"){if(P===h)throw new RangeError("Cyclic object value");I=!0}typeof A.get(In)>"u"&&(h=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=u(w):n==="comma"&&oe(w)&&(w=Sn.maybeMap(w,function(Ei){return Ei instanceof Date?u(Ei):Ei})),w===null){if(a)return s&&!_?s(t,C.encoder,$,"key",p):t;w=""}if(ap(w)||Sn.isBuffer(w)){if(s){var R=_?t:s(t,C.encoder,$,"key",p);if(n==="comma"&&_){for(var m=tp.call(String(w),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+d(s(m[g],C.encoder,$,"value",p));return[d(R)+(i&&oe(w)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(s(w,C.encoder,$,"value",p))]}return[d(t)+"="+d(String(w))]}var E=[];if(typeof w>"u")return E;var S;if(n==="comma"&&oe(w))S=[{value:w.length>0?w.join(",")||null:void 0}];else if(oe(f))S=f;else{var B=Object.keys(w);S=c?B.sort(c):B}for(var H=i&&oe(w)&&w.length===1?t+"[]":t,te=0;te<S.length;++te){var X=S[te],Re=typeof X=="object"&&typeof X.value<"u"?X.value:w[X];if(!(o&&Re===null)){var LR=oe(w)?typeof n=="function"?n(H,X):H:H+(l?"."+X:"["+X+"]");b.set(e,h);var rf=xa();rf.set(In,b),Fa(E,r(Re,LR,n,i,a,o,s,f,c,l,u,p,d,_,$,rf))}}return E},up=function(e){if(!e)return C;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||C.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(!rp.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=C.filter;return(typeof e.filter=="function"||oe(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:C.addQueryPrefix,allowDots:typeof e.allowDots>"u"?C.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:C.charsetSentinel,delimiter:typeof e.delimiter>"u"?C.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:C.encode,encoder:typeof e.encoder=="function"?e.encoder:C.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:C.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:C.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:C.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:C.strictNullHandling}},sp=function(r,e){var t=r,n=up(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):oe(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in Ra?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=Ra[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=xa(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||Fa(o,op(t[p],p,f,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:""};let Da={storeIdentifier:"",environment:"prod"};function fp(r){Da=r}function ue(){return Da}const cp=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",Pn=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",lp=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",pp="/tools/recurring";class Kr{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}var hp=Object.defineProperty,dp=Object.defineProperties,yp=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,vp=Object.prototype.hasOwnProperty,gp=Object.prototype.propertyIsEnumerable,Na=(r,e,t)=>e in r?hp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zr=(r,e)=>{for(var t in e||(e={}))vp.call(e,t)&&Na(r,t,e[t]);if(Ba)for(var t of Ba(e))gp.call(e,t)&&Na(r,t,e[t]);return r},_p=(r,e)=>dp(r,yp(e));function mp(r){return sp(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Jr(r,e,t={}){const n=ue();return z(r,`${lp(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function O(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f,loginRetryFn:c}=ue(),l=o.apiToken,u=cp(s),p=Zr({"X-Recharge-Access-Token":l,"X-Recharge-Version":"2021-11"},a||{}),d=Zr({shop_url:f},n);try{return await z(r,`${u}${e}`,{id:t,query:d,data:i,headers:p})}catch(_){if(c&&_ instanceof Kr&&_.status===401)return c().then($=>{if($)return z(r,`${u}${e}`,{id:t,query:d,data:i,headers:_p(Zr({},p),{"X-Recharge-Access-Token":$.apiToken})});throw _});throw _}}async function sr(r,e,t={}){return z(r,`${pp}${e}`,t)}async function z(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,mp(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=Zr({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Kr(l.error,c.status):l&&l.errors?new Kr(JSON.stringify(l.errors),c.status):new Kr("A connection error occurred while making the request");return l}function wp(r,e){return O("get","/addresses",{query:e},r)}async function bp(r,e,t){const{address:n}=await O("get","/addresses",{id:e,query:{include:t?.include}},r);return n}async function $p(r,e){const{address:t}=await O("post","/addresses",{data:e},r);return t}async function Tn(r,e,t){const{address:n}=await O("put","/addresses",{id:e,data:t},r);return n}async function Ap(r,e,t){return Tn(r,e,{discounts:[{code:t}]})}async function Ep(r,e){return Tn(r,e,{discounts:[]})}function Op(r,e){return O("delete","/addresses",{id:e},r)}async function Sp(r,e){const{address:t}=await O("post","/addresses/merge",{data:e},r);return t}async function Ip(r,e,t){const{charge:n}=await O("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Pp=Object.freeze({__proto__:null,listAddresses:wp,getAddress:bp,createAddress:$p,updateAddress:Tn,applyDiscountToAddress:Ap,removeDiscountsFromAddress:Ep,deleteAddress:Op,mergeAddresses:Sp,skipFutureCharge:Ip});async function Tp(){const{storefrontAccessToken:r}=ue(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await sr("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function xp(r,e){const{environment:t,storefrontAccessToken:n,storeIdentifier:i}=ue(),a=Pn(t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const s=await z("post",`${a}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:i},headers:o});return s.api_token?{apiToken:s.api_token,customerId:s.customer_id}:null}async function Rp(r){const{environment:e,storefrontAccessToken:t,storeIdentifier:n}=ue(),i=Pn(e),a={};t&&(a["X-Recharge-Storefront-Access-Token"]=t);const o=await z("post",`${i}/attempt_login`,{data:{email:r,shop:n},headers:a});if(o.errors)throw new Error(o.errors);return o.session_token}async function Fp(r){const{storefrontAccessToken:e,storeIdentifier:t}=ue(),n={};e&&(n["X-Recharge-Storefront-Access-Token"]=e);const i=await sr("post","/attempt_login",{data:{email:r,shop:t},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function Mp(r,e,t){const{environment:n,storefrontAccessToken:i,storeIdentifier:a}=ue(),o=Pn(n),s={};i&&(s["X-Recharge-Storefront-Access-Token"]=i);const f=await z("post",`${o}/validate_login`,{data:{code:t,email:r,session_token:e,shop:a},headers:s});if(f.errors)throw new Error(f.errors);return{apiToken:f.api_token,customerId:f.customer_id}}async function Dp(r,e,t){const{storefrontAccessToken:n,storeIdentifier:i}=ue(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const o=await sr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:i},headers:a});if(o.errors)throw new Error(o.errors);return{apiToken:o.api_token,customerId:o.customer_id}}var Bp=Object.freeze({__proto__:null,loginShopifyAppProxy:Tp,loginShopifyApi:xp,sendPasswordlessCode:Rp,sendPasswordlessCodeAppProxy:Fp,validatePasswordlessCode:Mp,validatePasswordlessCodeAppProxy:Dp});let Np=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");function Up(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 Qr=Up;function Cp(){this.__data__=[],this.size=0}var Lp=Cp;function jp(r,e){return r===e||r!==r&&e!==e}var et=jp,kp=et;function qp(r,e){for(var t=r.length;t--;)if(kp(r[t][0],e))return t;return-1}var rt=qp,Gp=rt,Wp=Array.prototype,Vp=Wp.splice;function Hp(r){var e=this.__data__,t=Gp(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Vp.call(e,t,1),--this.size,!0}var zp=Hp,Xp=rt;function Yp(r){var e=this.__data__,t=Xp(e,r);return t<0?void 0:e[t][1]}var Kp=Yp,Zp=rt;function Jp(r){return Zp(this.__data__,r)>-1}var Qp=Jp,eh=rt;function rh(r,e){var t=this.__data__,n=eh(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var th=rh,nh=Lp,ih=zp,ah=Kp,oh=Qp,uh=th;function qe(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])}}qe.prototype.clear=nh,qe.prototype.delete=ih,qe.prototype.get=ah,qe.prototype.has=oh,qe.prototype.set=uh;var tt=qe,sh=tt;function fh(){this.__data__=new sh,this.size=0}var ch=fh;function lh(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var ph=lh;function hh(r){return this.__data__.get(r)}var dh=hh;function yh(r){return this.__data__.has(r)}var vh=yh,gh=typeof ne=="object"&&ne&&ne.Object===Object&&ne,Ua=gh,_h=Ua,mh=typeof self=="object"&&self&&self.Object===Object&&self,wh=_h||mh||Function("return this")(),G=wh,bh=G,$h=bh.Symbol,Ge=$h,Ca=Ge,La=Object.prototype,Ah=La.hasOwnProperty,Eh=La.toString,fr=Ca?Ca.toStringTag:void 0;function Oh(r){var e=Ah.call(r,fr),t=r[fr];try{r[fr]=void 0;var n=!0}catch{}var i=Eh.call(r);return n&&(e?r[fr]=t:delete r[fr]),i}var Sh=Oh,Ih=Object.prototype,Ph=Ih.toString;function Th(r){return Ph.call(r)}var xh=Th,ja=Ge,Rh=Sh,Fh=xh,Mh="[object Null]",Dh="[object Undefined]",ka=ja?ja.toStringTag:void 0;function Bh(r){return r==null?r===void 0?Dh:Mh:ka&&ka in Object(r)?Rh(r):Fh(r)}var se=Bh;function Nh(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var fe=Nh,Uh=se,Ch=fe,Lh="[object AsyncFunction]",jh="[object Function]",kh="[object GeneratorFunction]",qh="[object Proxy]";function Gh(r){if(!Ch(r))return!1;var e=Uh(r);return e==jh||e==kh||e==Lh||e==qh}var xn=Gh,Wh=G,Vh=Wh["__core-js_shared__"],Hh=Vh,Rn=Hh,qa=function(){var r=/[^.]+$/.exec(Rn&&Rn.keys&&Rn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function zh(r){return!!qa&&qa in r}var Xh=zh,Yh=Function.prototype,Kh=Yh.toString;function Zh(r){if(r!=null){try{return Kh.call(r)}catch{}try{return r+""}catch{}}return""}var Ga=Zh,Jh=xn,Qh=Xh,ed=fe,rd=Ga,td=/[\\^$.*+?()[\]{}|]/g,nd=/^\[object .+?Constructor\]$/,id=Function.prototype,ad=Object.prototype,od=id.toString,ud=ad.hasOwnProperty,sd=RegExp("^"+od.call(ud).replace(td,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fd(r){if(!ed(r)||Qh(r))return!1;var e=Jh(r)?sd:nd;return e.test(rd(r))}var cd=fd;function ld(r,e){return r?.[e]}var pd=ld,hd=cd,dd=pd;function yd(r,e){var t=dd(r,e);return hd(t)?t:void 0}var Se=yd,vd=Se,gd=G,_d=vd(gd,"Map"),Fn=_d,md=Se,wd=md(Object,"create"),nt=wd,Wa=nt;function bd(){this.__data__=Wa?Wa(null):{},this.size=0}var $d=bd;function Ad(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Ed=Ad,Od=nt,Sd="__lodash_hash_undefined__",Id=Object.prototype,Pd=Id.hasOwnProperty;function Td(r){var e=this.__data__;if(Od){var t=e[r];return t===Sd?void 0:t}return Pd.call(e,r)?e[r]:void 0}var xd=Td,Rd=nt,Fd=Object.prototype,Md=Fd.hasOwnProperty;function Dd(r){var e=this.__data__;return Rd?e[r]!==void 0:Md.call(e,r)}var Bd=Dd,Nd=nt,Ud="__lodash_hash_undefined__";function Cd(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Nd&&e===void 0?Ud:e,this}var Ld=Cd,jd=$d,kd=Ed,qd=xd,Gd=Bd,Wd=Ld;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=jd,We.prototype.delete=kd,We.prototype.get=qd,We.prototype.has=Gd,We.prototype.set=Wd;var Vd=We,Va=Vd,Hd=tt,zd=Fn;function Xd(){this.size=0,this.__data__={hash:new Va,map:new(zd||Hd),string:new Va}}var Yd=Xd;function Kd(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Zd=Kd,Jd=Zd;function Qd(r,e){var t=r.__data__;return Jd(e)?t[typeof e=="string"?"string":"hash"]:t.map}var it=Qd,ey=it;function ry(r){var e=ey(this,r).delete(r);return this.size-=e?1:0,e}var ty=ry,ny=it;function iy(r){return ny(this,r).get(r)}var ay=iy,oy=it;function uy(r){return oy(this,r).has(r)}var sy=uy,fy=it;function cy(r,e){var t=fy(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var ly=cy,py=Yd,hy=ty,dy=ay,yy=sy,vy=ly;function Ve(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])}}Ve.prototype.clear=py,Ve.prototype.delete=hy,Ve.prototype.get=dy,Ve.prototype.has=yy,Ve.prototype.set=vy;var Mn=Ve,gy=tt,_y=Fn,my=Mn,wy=200;function by(r,e){var t=this.__data__;if(t instanceof gy){var n=t.__data__;if(!_y||n.length<wy-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new my(n)}return t.set(r,e),this.size=t.size,this}var $y=by,Ay=tt,Ey=ch,Oy=ph,Sy=dh,Iy=vh,Py=$y;function He(r){var e=this.__data__=new Ay(r);this.size=e.size}He.prototype.clear=Ey,He.prototype.delete=Oy,He.prototype.get=Sy,He.prototype.has=Iy,He.prototype.set=Py;var Dn=He;function Ty(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Bn=Ty,xy=Se,Ry=function(){try{var r=xy(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Ha=Ry,za=Ha;function Fy(r,e,t){e=="__proto__"&&za?za(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Xa=Fy,My=Xa,Dy=et,By=Object.prototype,Ny=By.hasOwnProperty;function Uy(r,e,t){var n=r[e];(!(Ny.call(r,e)&&Dy(n,t))||t===void 0&&!(e in r))&&My(r,e,t)}var Ya=Uy,Cy=Ya,Ly=Xa;function jy(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],f=n?n(t[s],r[s],s,t,r):void 0;f===void 0&&(f=r[s]),i?Ly(t,s,f):Cy(t,s,f)}return t}var ze=jy;function ky(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Ka=ky;function qy(r){return r!=null&&typeof r=="object"}var V=qy,Gy=se,Wy=V,Vy="[object Arguments]";function Hy(r){return Wy(r)&&Gy(r)==Vy}var zy=Hy,Za=zy,Xy=V,Ja=Object.prototype,Yy=Ja.hasOwnProperty,Ky=Ja.propertyIsEnumerable,Zy=Za(function(){return arguments}())?Za:function(r){return Xy(r)&&Yy.call(r,"callee")&&!Ky.call(r,"callee")},Nn=Zy,Jy=Array.isArray,U=Jy,cr={exports:{}};function Qy(){return!1}var ev=Qy;(function(r,e){var t=G,n=ev,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,s=o?t.Buffer:void 0,f=s?s.isBuffer:void 0,c=f||n;r.exports=c})(cr,cr.exports);var rv=9007199254740991,tv=/^(?:0|[1-9]\d*)$/;function nv(r,e){var t=typeof r;return e=e??rv,!!e&&(t=="number"||t!="symbol"&&tv.test(r))&&r>-1&&r%1==0&&r<e}var at=nv,iv=9007199254740991;function av(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=iv}var Un=av,ov=se,uv=Un,sv=V,fv="[object Arguments]",cv="[object Array]",lv="[object Boolean]",pv="[object Date]",hv="[object Error]",dv="[object Function]",yv="[object Map]",vv="[object Number]",gv="[object Object]",_v="[object RegExp]",mv="[object Set]",wv="[object String]",bv="[object WeakMap]",$v="[object ArrayBuffer]",Av="[object DataView]",Ev="[object Float32Array]",Ov="[object Float64Array]",Sv="[object Int8Array]",Iv="[object Int16Array]",Pv="[object Int32Array]",Tv="[object Uint8Array]",xv="[object Uint8ClampedArray]",Rv="[object Uint16Array]",Fv="[object Uint32Array]",F={};F[Ev]=F[Ov]=F[Sv]=F[Iv]=F[Pv]=F[Tv]=F[xv]=F[Rv]=F[Fv]=!0,F[fv]=F[cv]=F[$v]=F[lv]=F[Av]=F[pv]=F[hv]=F[dv]=F[yv]=F[vv]=F[gv]=F[_v]=F[mv]=F[wv]=F[bv]=!1;function Mv(r){return sv(r)&&uv(r.length)&&!!F[ov(r)]}var Dv=Mv;function Bv(r){return function(e){return r(e)}}var Cn=Bv,lr={exports:{}};(function(r,e){var t=Ua,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s})(lr,lr.exports);var Nv=Dv,Uv=Cn,Qa=lr.exports,eo=Qa&&Qa.isTypedArray,Cv=eo?Uv(eo):Nv,ro=Cv,Lv=Ka,jv=Nn,kv=U,qv=cr.exports,Gv=at,Wv=ro,Vv=Object.prototype,Hv=Vv.hasOwnProperty;function zv(r,e){var t=kv(r),n=!t&&jv(r),i=!t&&!n&&qv(r),a=!t&&!n&&!i&&Wv(r),o=t||n||i||a,s=o?Lv(r.length,String):[],f=s.length;for(var c in r)(e||Hv.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Gv(c,f)))&&s.push(c);return s}var to=zv,Xv=Object.prototype;function Yv(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Xv;return r===t}var Ln=Yv;function Kv(r,e){return function(t){return r(e(t))}}var no=Kv,Zv=no,Jv=Zv(Object.keys,Object),Qv=Jv,eg=Ln,rg=Qv,tg=Object.prototype,ng=tg.hasOwnProperty;function ig(r){if(!eg(r))return rg(r);var e=[];for(var t in Object(r))ng.call(r,t)&&t!="constructor"&&e.push(t);return e}var ag=ig,og=xn,ug=Un;function sg(r){return r!=null&&ug(r.length)&&!og(r)}var pr=sg,fg=to,cg=ag,lg=pr;function pg(r){return lg(r)?fg(r):cg(r)}var Xe=pg,hg=ze,dg=Xe;function yg(r,e){return r&&hg(e,dg(e),r)}var vg=yg;function gg(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var _g=gg,mg=fe,wg=Ln,bg=_g,$g=Object.prototype,Ag=$g.hasOwnProperty;function Eg(r){if(!mg(r))return bg(r);var e=wg(r),t=[];for(var n in r)n=="constructor"&&(e||!Ag.call(r,n))||t.push(n);return t}var Og=Eg,Sg=to,Ig=Og,Pg=pr;function Tg(r){return Pg(r)?Sg(r,!0):Ig(r)}var ot=Tg,xg=ze,Rg=ot;function Fg(r,e){return r&&xg(e,Rg(e),r)}var Mg=Fg,jn={exports:{}};(function(r,e){var t=G,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,l){if(l)return c.slice();var u=c.length,p=s?s(u):new c.constructor(u);return c.copy(p),p}r.exports=f})(jn,jn.exports);function Dg(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var kn=Dg;function Bg(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 Ng=Bg;function Ug(){return[]}var io=Ug,Cg=Ng,Lg=io,jg=Object.prototype,kg=jg.propertyIsEnumerable,ao=Object.getOwnPropertySymbols,qg=ao?function(r){return r==null?[]:(r=Object(r),Cg(ao(r),function(e){return kg.call(r,e)}))}:Lg,qn=qg,Gg=ze,Wg=qn;function Vg(r,e){return Gg(r,Wg(r),e)}var Hg=Vg;function zg(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Gn=zg,Xg=no,Yg=Xg(Object.getPrototypeOf,Object),Wn=Yg,Kg=Gn,Zg=Wn,Jg=qn,Qg=io,e_=Object.getOwnPropertySymbols,r_=e_?function(r){for(var e=[];r;)Kg(e,Jg(r)),r=Zg(r);return e}:Qg,oo=r_,t_=ze,n_=oo;function i_(r,e){return t_(r,n_(r),e)}var a_=i_,o_=Gn,u_=U;function s_(r,e,t){var n=e(r);return u_(r)?n:o_(n,t(r))}var uo=s_,f_=uo,c_=qn,l_=Xe;function p_(r){return f_(r,l_,c_)}var so=p_,h_=uo,d_=oo,y_=ot;function v_(r){return h_(r,y_,d_)}var fo=v_,g_=Se,__=G,m_=g_(__,"DataView"),w_=m_,b_=Se,$_=G,A_=b_($_,"Promise"),E_=A_,O_=Se,S_=G,I_=O_(S_,"Set"),P_=I_,T_=Se,x_=G,R_=T_(x_,"WeakMap"),co=R_,Vn=w_,Hn=Fn,zn=E_,Xn=P_,Yn=co,lo=se,Ye=Ga,po="[object Map]",F_="[object Object]",ho="[object Promise]",yo="[object Set]",vo="[object WeakMap]",go="[object DataView]",M_=Ye(Vn),D_=Ye(Hn),B_=Ye(zn),N_=Ye(Xn),U_=Ye(Yn),Ie=lo;(Vn&&Ie(new Vn(new ArrayBuffer(1)))!=go||Hn&&Ie(new Hn)!=po||zn&&Ie(zn.resolve())!=ho||Xn&&Ie(new Xn)!=yo||Yn&&Ie(new Yn)!=vo)&&(Ie=function(r){var e=lo(r),t=e==F_?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case M_:return go;case D_:return po;case B_:return ho;case N_:return yo;case U_:return vo}return e});var ut=Ie,C_=Object.prototype,L_=C_.hasOwnProperty;function j_(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&L_.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var k_=j_,q_=G,G_=q_.Uint8Array,_o=G_,mo=_o;function W_(r){var e=new r.constructor(r.byteLength);return new mo(e).set(new mo(r)),e}var Kn=W_,V_=Kn;function H_(r,e){var t=e?V_(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var z_=H_,X_=/\w*$/;function Y_(r){var e=new r.constructor(r.source,X_.exec(r));return e.lastIndex=r.lastIndex,e}var K_=Y_,wo=Ge,bo=wo?wo.prototype:void 0,$o=bo?bo.valueOf:void 0;function Z_(r){return $o?Object($o.call(r)):{}}var J_=Z_,Q_=Kn;function em(r,e){var t=e?Q_(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var rm=em,tm=Kn,nm=z_,im=K_,am=J_,om=rm,um="[object Boolean]",sm="[object Date]",fm="[object Map]",cm="[object Number]",lm="[object RegExp]",pm="[object Set]",hm="[object String]",dm="[object Symbol]",ym="[object ArrayBuffer]",vm="[object DataView]",gm="[object Float32Array]",_m="[object Float64Array]",mm="[object Int8Array]",wm="[object Int16Array]",bm="[object Int32Array]",$m="[object Uint8Array]",Am="[object Uint8ClampedArray]",Em="[object Uint16Array]",Om="[object Uint32Array]";function Sm(r,e,t){var n=r.constructor;switch(e){case ym:return tm(r);case um:case sm:return new n(+r);case vm:return nm(r,t);case gm:case _m:case mm:case wm:case bm:case $m:case Am:case Em:case Om:return om(r,t);case fm:return new n;case cm:case hm:return new n(r);case lm:return im(r);case pm:return new n;case dm:return am(r)}}var Im=Sm,Pm=fe,Ao=Object.create,Tm=function(){function r(){}return function(e){if(!Pm(e))return{};if(Ao)return Ao(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),st=Tm,xm=st,Rm=Wn,Fm=Ln;function Mm(r){return typeof r.constructor=="function"&&!Fm(r)?xm(Rm(r)):{}}var Dm=Mm,Bm=ut,Nm=V,Um="[object Map]";function Cm(r){return Nm(r)&&Bm(r)==Um}var Lm=Cm,jm=Lm,km=Cn,Eo=lr.exports,Oo=Eo&&Eo.isMap,qm=Oo?km(Oo):jm,Gm=qm,Wm=ut,Vm=V,Hm="[object Set]";function zm(r){return Vm(r)&&Wm(r)==Hm}var Xm=zm,Ym=Xm,Km=Cn,So=lr.exports,Io=So&&So.isSet,Zm=Io?Km(Io):Ym,Jm=Zm,Qm=Dn,ew=Bn,rw=Ya,tw=vg,nw=Mg,iw=jn.exports,aw=kn,ow=Hg,uw=a_,sw=so,fw=fo,cw=ut,lw=k_,pw=Im,hw=Dm,dw=U,yw=cr.exports,vw=Gm,gw=fe,_w=Jm,mw=Xe,ww=ot,bw=1,$w=2,Aw=4,Po="[object Arguments]",Ew="[object Array]",Ow="[object Boolean]",Sw="[object Date]",Iw="[object Error]",To="[object Function]",Pw="[object GeneratorFunction]",Tw="[object Map]",xw="[object Number]",xo="[object Object]",Rw="[object RegExp]",Fw="[object Set]",Mw="[object String]",Dw="[object Symbol]",Bw="[object WeakMap]",Nw="[object ArrayBuffer]",Uw="[object DataView]",Cw="[object Float32Array]",Lw="[object Float64Array]",jw="[object Int8Array]",kw="[object Int16Array]",qw="[object Int32Array]",Gw="[object Uint8Array]",Ww="[object Uint8ClampedArray]",Vw="[object Uint16Array]",Hw="[object Uint32Array]",x={};x[Po]=x[Ew]=x[Nw]=x[Uw]=x[Ow]=x[Sw]=x[Cw]=x[Lw]=x[jw]=x[kw]=x[qw]=x[Tw]=x[xw]=x[xo]=x[Rw]=x[Fw]=x[Mw]=x[Dw]=x[Gw]=x[Ww]=x[Vw]=x[Hw]=!0,x[Iw]=x[To]=x[Bw]=!1;function ft(r,e,t,n,i,a){var o,s=e&bw,f=e&$w,c=e&Aw;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!gw(r))return r;var l=dw(r);if(l){if(o=lw(r),!s)return aw(r,o)}else{var u=cw(r),p=u==To||u==Pw;if(yw(r))return iw(r,s);if(u==xo||u==Po||p&&!i){if(o=f||p?{}:hw(r),!s)return f?uw(r,nw(o,r)):ow(r,tw(o,r))}else{if(!x[u])return i?r:{};o=pw(r,u,s)}}a||(a=new Qm);var d=a.get(r);if(d)return d;a.set(r,o),_w(r)?r.forEach(function(b){o.add(ft(b,e,t,b,r,a))}):vw(r)&&r.forEach(function(b,w){o.set(w,ft(b,e,t,w,r,a))});var _=c?f?fw:sw:f?ww:mw,$=l?void 0:_(r);return ew($||r,function(b,w){$&&(w=b,b=r[w]),rw(o,w,ft(b,e,t,w,r,a))}),o}var zw=ft,Xw=se,Yw=V,Kw="[object Symbol]";function Zw(r){return typeof r=="symbol"||Yw(r)&&Xw(r)==Kw}var ct=Zw,Jw=U,Qw=ct,e0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r0=/^\w*$/;function t0(r,e){if(Jw(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Qw(r)?!0:r0.test(r)||!e0.test(r)||e!=null&&r in Object(e)}var Zn=t0,Ro=Mn,n0="Expected a function";function Jn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(n0);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(Jn.Cache||Ro),t}Jn.Cache=Ro;var i0=Jn,a0=i0,o0=500;function u0(r){var e=a0(r,function(n){return t.size===o0&&t.clear(),n}),t=e.cache;return e}var s0=u0,f0=s0,c0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l0=/\\(\\)?/g,p0=f0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(c0,function(t,n,i,a){e.push(i?a.replace(l0,"$1"):n||t)}),e}),h0=p0,Fo=Ge,d0=Qr,y0=U,v0=ct,g0=1/0,Mo=Fo?Fo.prototype:void 0,Do=Mo?Mo.toString:void 0;function Bo(r){if(typeof r=="string")return r;if(y0(r))return d0(r,Bo)+"";if(v0(r))return Do?Do.call(r):"";var e=r+"";return e=="0"&&1/r==-g0?"-0":e}var _0=Bo,m0=_0;function w0(r){return r==null?"":m0(r)}var b0=w0,$0=U,A0=Zn,E0=h0,O0=b0;function S0(r,e){return $0(r)?r:A0(r,e)?[r]:E0(O0(r))}var lt=S0;function I0(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var P0=I0,T0=ct,x0=1/0;function R0(r){if(typeof r=="string"||T0(r))return r;var e=r+"";return e=="0"&&1/r==-x0?"-0":e}var hr=R0,F0=lt,M0=hr;function D0(r,e){e=F0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[M0(e[t++])];return t&&t==n?r:void 0}var Qn=D0;function B0(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 N0=B0,U0=Qn,C0=N0;function L0(r,e){return e.length<2?r:U0(r,C0(e,0,-1))}var j0=L0,k0=lt,q0=P0,G0=j0,W0=hr;function V0(r,e){return e=k0(e,r),r=G0(r,e),r==null||delete r[W0(q0(e))]}var H0=V0,z0=se,X0=Wn,Y0=V,K0="[object Object]",Z0=Function.prototype,J0=Object.prototype,No=Z0.toString,Q0=J0.hasOwnProperty,eb=No.call(Object);function rb(r){if(!Y0(r)||z0(r)!=K0)return!1;var e=X0(r);if(e===null)return!0;var t=Q0.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&No.call(t)==eb}var tb=rb,nb=tb;function ib(r){return nb(r)?void 0:r}var ab=ib,Uo=Ge,ob=Nn,ub=U,Co=Uo?Uo.isConcatSpreadable:void 0;function sb(r){return ub(r)||ob(r)||!!(Co&&r&&r[Co])}var fb=sb,cb=Gn,lb=fb;function Lo(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=lb),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?Lo(s,e-1,t,n,i):cb(i,s):n||(i[i.length]=s)}return i}var pb=Lo,hb=pb;function db(r){var e=r==null?0:r.length;return e?hb(r,1):[]}var yb=db;function vb(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 ei=vb,gb=ei,jo=Math.max;function _b(r,e,t){return e=jo(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=jo(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=t(o),gb(r,this,s)}}var ko=_b;function mb(r){return function(){return r}}var wb=mb;function bb(r){return r}var dr=bb,$b=wb,qo=Ha,Ab=dr,Eb=qo?function(r,e){return qo(r,"toString",{configurable:!0,enumerable:!1,value:$b(e),writable:!0})}:Ab,Ob=Eb,Sb=800,Ib=16,Pb=Date.now;function Tb(r){var e=0,t=0;return function(){var n=Pb(),i=Ib-(n-t);if(t=n,i>0){if(++e>=Sb)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Go=Tb,xb=Ob,Rb=Go,Fb=Rb(xb),ri=Fb,Mb=yb,Db=ko,Bb=ri;function Nb(r){return Bb(Db(r,void 0,Mb),r+"")}var Ub=Nb,Cb=Qr,Lb=zw,jb=H0,kb=lt,qb=ze,Gb=ab,Wb=Ub,Vb=fo,Hb=1,zb=2,Xb=4,Yb=Wb(function(r,e){var t={};if(r==null)return t;var n=!1;e=Cb(e,function(a){return a=kb(a,r),n||(n=a.length>1),a}),qb(r,Vb(r),t),n&&(t=Lb(t,Hb|zb|Xb,Gb));for(var i=e.length;i--;)jb(t,e[i]);return t}),ti=Yb,Kb=Object.defineProperty,Zb=Object.defineProperties,Jb=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,Qb=Object.prototype.hasOwnProperty,e1=Object.prototype.propertyIsEnumerable,Vo=(r,e,t)=>e in r?Kb(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,r1=(r,e)=>{for(var t in e||(e={}))Qb.call(e,t)&&Vo(r,t,e[t]);if(Wo)for(var t of Wo(e))e1.call(e,t)&&Vo(r,t,e[t]);return r},t1=(r,e)=>Zb(r,Jb(e));function n1(r){try{return JSON.parse(r)}catch{return r}}function i1(r){return Object.entries(r).reduce((e,[t,n])=>t1(r1({},e),{[t]:n1(n)}),{})}const Ho=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;var a1=Object.defineProperty,o1=Object.defineProperties,u1=Object.getOwnPropertyDescriptors,zo=Object.getOwnPropertySymbols,s1=Object.prototype.hasOwnProperty,f1=Object.prototype.propertyIsEnumerable,Xo=(r,e,t)=>e in r?a1(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Yo=(r,e)=>{for(var t in e||(e={}))s1.call(e,t)&&Xo(r,t,e[t]);if(zo)for(var t of zo(e))f1.call(e,t)&&Xo(r,t,e[t]);return r},Ko=(r,e)=>o1(r,u1(e));function Zo(r){var e;const t=i1(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Ko(Yo({},ti(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function Jo(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Ko(Yo({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function c1(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Jo(i)}),t})}const pt="2020-12",l1={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},yr=new Map;function ht(r,e){return yr.has(r)||yr.set(r,e()),yr.get(r)}async function ni(r){const{product:e}=await ht(`product.${r}`,()=>Jr("get",`/product/${pt}/${r}.json`));return Jo(e)}async function Qo(){return await ht("storeSettings",()=>Jr("get",`/${pt}/store_settings.json`).catch(()=>l1))}async function eu(){const{widget_settings:r}=await ht("widgetSettings",()=>Jr("get",`/${pt}/widget_settings.json`));return Zo(r)}async function ru(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await ht("productsAndSettings",()=>Jr("get",`/product/${pt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:c1(r),widget_settings:Zo(e),store_settings:t??{}}}async function p1(){const{products:r}=await ru();return r}async function h1(r){const[e,t,n]=await Promise.all([ni(r),Qo(),eu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function tu(r){const{bundle_product:e}=await ni(r);return e}async function nu(){return Array.from(yr.keys()).forEach(r=>yr.delete(r))}var d1=Object.freeze({__proto__:null,getCDNProduct:ni,getCDNStoreSettings:Qo,getCDNWidgetSettings:eu,getCDNProductsAndSettings:ru,getCDNProducts:p1,getCDNProductAndSettings:h1,getCDNBundleSettings:tu,resetCDNCache:nu}),iu={},ii={},ce={},y1=se,v1=V,g1="[object Number]";function _1(r){return typeof r=="number"||v1(r)&&y1(r)==g1}var dt=_1,M={},au={exports:{}},m1=dr,w1=ko,b1=ri;function $1(r,e){return b1(w1(r,e,m1),r+"")}var ou=$1,A1=et,E1=pr,O1=at,S1=fe;function I1(r,e,t){if(!S1(t))return!1;var n=typeof e;return(n=="number"?E1(t)&&O1(e,t.length):n=="string"&&e in t)?A1(t[e],r):!1}var uu=I1,P1=ou,T1=uu;function x1(r){return P1(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&&T1(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=t[n];s&&r(e,s,n,a)}return e})}var R1=x1,F1=ze,M1=R1,D1=ot,B1=M1(function(r,e){F1(e,D1(e),r)}),N1=B1;(function(r){r.exports=N1})(au);var yt={},Pe={};function U1(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 C1=U1;function L1(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var f=o[r?s:++i];if(t(a[f],f,a)===!1)break}return e}}var j1=L1,k1=j1,q1=k1(),G1=q1,W1=G1,V1=Xe;function H1(r,e){return r&&W1(r,e,V1)}var z1=H1,X1=pr;function Y1(r,e){return function(t,n){if(t==null)return t;if(!X1(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 K1=Y1,Z1=z1,J1=K1,Q1=J1(Z1),ai=Q1,e$=ai;function r$(r,e){var t=!0;return e$(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var t$=r$,n$="__lodash_hash_undefined__";function i$(r){return this.__data__.set(r,n$),this}var a$=i$;function o$(r){return this.__data__.has(r)}var u$=o$,s$=Mn,f$=a$,c$=u$;function vt(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new s$;++e<t;)this.add(r[e])}vt.prototype.add=vt.prototype.push=f$,vt.prototype.has=c$;var l$=vt;function p$(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 h$=p$;function d$(r,e){return r.has(e)}var y$=d$,v$=l$,g$=h$,_$=y$,m$=1,w$=2;function b$(r,e,t,n,i,a){var o=t&m$,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))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&w$?new v$:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var _=r[u],$=e[u];if(n)var b=o?n($,_,u,e,r,a):n(_,$,u,r,e,a);if(b!==void 0){if(b)continue;p=!1;break}if(d){if(!g$(e,function(w,A){if(!_$(d,A)&&(_===w||i(_,w,t,n,a)))return d.push(A)})){p=!1;break}}else if(!(_===$||i(_,$,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var su=b$;function $$(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var A$=$$;function E$(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var O$=E$,fu=Ge,cu=_o,S$=et,I$=su,P$=A$,T$=O$,x$=1,R$=2,F$="[object Boolean]",M$="[object Date]",D$="[object Error]",B$="[object Map]",N$="[object Number]",U$="[object RegExp]",C$="[object Set]",L$="[object String]",j$="[object Symbol]",k$="[object ArrayBuffer]",q$="[object DataView]",lu=fu?fu.prototype:void 0,oi=lu?lu.valueOf:void 0;function G$(r,e,t,n,i,a,o){switch(t){case q$:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case k$:return!(r.byteLength!=e.byteLength||!a(new cu(r),new cu(e)));case F$:case M$:case N$:return S$(+r,+e);case D$:return r.name==e.name&&r.message==e.message;case U$:case L$:return r==e+"";case B$:var s=P$;case C$:var f=n&x$;if(s||(s=T$),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=R$,o.set(r,e);var l=I$(s(r),s(e),n,i,a,o);return o.delete(r),l;case j$:if(oi)return oi.call(r)==oi.call(e)}return!1}var W$=G$,pu=so,V$=1,H$=Object.prototype,z$=H$.hasOwnProperty;function X$(r,e,t,n,i,a){var o=t&V$,s=pu(r),f=s.length,c=pu(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[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 $=!0;a.set(r,e),a.set(e,r);for(var b=o;++u<f;){p=s[u];var w=r[p],A=e[p];if(n)var h=o?n(A,w,p,e,r,a):n(w,A,p,r,e,a);if(!(h===void 0?w===A||i(w,A,t,n,a):h)){$=!1;break}b||(b=p=="constructor")}if($&&!b){var I=r.constructor,P=e.constructor;I!=P&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof P=="function"&&P instanceof P)&&($=!1)}return a.delete(r),a.delete(e),$}var Y$=X$,ui=Dn,K$=su,Z$=W$,J$=Y$,hu=ut,du=U,yu=cr.exports,Q$=ro,eA=1,vu="[object Arguments]",gu="[object Array]",gt="[object Object]",rA=Object.prototype,_u=rA.hasOwnProperty;function tA(r,e,t,n,i,a){var o=du(r),s=du(e),f=o?gu:hu(r),c=s?gu:hu(e);f=f==vu?gt:f,c=c==vu?gt:c;var l=f==gt,u=c==gt,p=f==c;if(p&&yu(r)){if(!yu(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new ui),o||Q$(r)?K$(r,e,t,n,i,a):Z$(r,e,f,t,n,i,a);if(!(t&eA)){var d=l&&_u.call(r,"__wrapped__"),_=u&&_u.call(e,"__wrapped__");if(d||_){var $=d?r.value():r,b=_?e.value():e;return a||(a=new ui),i($,b,t,n,a)}}return p?(a||(a=new ui),J$(r,e,t,n,i,a)):!1}var nA=tA,iA=nA,mu=V;function wu(r,e,t,n,i){return r===e?!0:r==null||e==null||!mu(r)&&!mu(e)?r!==r&&e!==e:iA(r,e,t,n,wu,i)}var bu=wu,aA=Dn,oA=bu,uA=1,sA=2;function fA(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],l=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new aA;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?oA(l,c,uA|sA,n,u):p))return!1}}return!0}var cA=fA,lA=fe;function pA(r){return r===r&&!lA(r)}var $u=pA,hA=$u,dA=Xe;function yA(r){for(var e=dA(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,hA(i)]}return e}var vA=yA;function gA(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Au=gA,_A=cA,mA=vA,wA=Au;function bA(r){var e=mA(r);return e.length==1&&e[0][2]?wA(e[0][0],e[0][1]):function(t){return t===r||_A(t,r,e)}}var $A=bA,AA=Qn;function EA(r,e,t){var n=r==null?void 0:AA(r,e);return n===void 0?t:n}var OA=EA;function SA(r,e){return r!=null&&e in Object(r)}var IA=SA,PA=lt,TA=Nn,xA=U,RA=at,FA=Un,MA=hr;function DA(r,e,t){e=PA(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=MA(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&&FA(i)&&RA(o,i)&&(xA(r)||TA(r)))}var BA=DA,NA=IA,UA=BA;function CA(r,e){return r!=null&&UA(r,e,NA)}var LA=CA,jA=bu,kA=OA,qA=LA,GA=Zn,WA=$u,VA=Au,HA=hr,zA=1,XA=2;function YA(r,e){return GA(r)&&WA(e)?VA(HA(r),e):function(t){var n=kA(t,r);return n===void 0&&n===e?qA(t,r):jA(e,n,zA|XA)}}var KA=YA;function ZA(r){return function(e){return e?.[r]}}var JA=ZA,QA=Qn;function eE(r){return function(e){return QA(e,r)}}var rE=eE,tE=JA,nE=rE,iE=Zn,aE=hr;function oE(r){return iE(r)?tE(aE(r)):nE(r)}var uE=oE,sE=$A,fE=KA,cE=dr,lE=U,pE=uE;function hE(r){return typeof r=="function"?r:r==null?cE:typeof r=="object"?lE(r)?fE(r[0],r[1]):sE(r):pE(r)}var Eu=hE,dE=C1,yE=t$,vE=Eu,gE=U,_E=uu;function mE(r,e,t){var n=gE(r)?dE:yE;return t&&_E(r,e,t)&&(e=void 0),n(r,vE(e))}var si=mE;Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.calculatePadding=AE,Pe.slicePadding=EE;var wE=si,bE=$E(wE);function $E(r){return r&&r.__esModule?r:{default:r}}function AE(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function EE(r,e){var t=r.slice(e),n=(0,bE.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(yt,"__esModule",{value:!0}),yt.Cursor=void 0;var OE=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}}(),SE=Pe;function IE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var fi=function(){function r(e){IE(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return OE(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,SE.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){fi.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){fi.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),yt.Cursor=fi,Object.defineProperty(M,"__esModule",{value:!0}),M.default=DE;var PE=au.exports,Ou=Iu(PE),TE=xn,xE=Iu(TE),Su=yt;function Iu(r){return r&&r.__esModule?r:{default:r}}var RE=Math.pow(2,16),FE={toXDR:function(e){var t=new Su.Cursor(RE);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 Su.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}}},ME={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 DE(r){(0,Ou.default)(r,FE),(0,xE.default)(r)&&(0,Ou.default)(r.prototype,ME)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.Int=void 0;var BE=dt,Pu=Tu(BE),NE=M,UE=Tu(NE);function Tu(r){return r&&r.__esModule?r:{default:r}}var vr=ce.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Pu.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,Pu.default)(e)||Math.floor(e)!==e?!1:e>=vr.MIN_VALUE&&e<=vr.MAX_VALUE}};vr.MAX_VALUE=Math.pow(2,31)-1,vr.MIN_VALUE=-Math.pow(2,31),(0,UE.default)(vr);var _t={};function CE(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 ci={exports:{}};(function(r){/**
20
+ `+e.prev}function zr(r,e){var t=mn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ve(r,i)?e(r[i],r):""}var a=typeof vn=="function"?vn(r):[],o;if(je){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)!ve(r,f)||t&&String(Number(f))===f&&f<r.length||je&&o["$"+f]instanceof Symbol||(da.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof vn=="function")for(var c=0;c<a.length;c++)ga.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var $n=Xt,ke=Bf,Tl=cl,xl=$n("%TypeError%"),Xr=$n("%WeakMap%",!0),Yr=$n("%Map%",!0),Rl=ke("WeakMap.prototype.get",!0),Fl=ke("WeakMap.prototype.set",!0),Ml=ke("WeakMap.prototype.has",!0),Dl=ke("Map.prototype.get",!0),Bl=ke("Map.prototype.set",!0),Nl=ke("Map.prototype.has",!0),An=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},Ul=function(r,e){var t=An(r,e);return t&&t.value},Cl=function(r,e,t){var n=An(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Ll=function(r,e){return!!An(r,e)},jl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new xl("Side channel does not contain "+Tl(a))},get:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Rl(e,a)}else if(Yr){if(t)return Dl(t,a)}else if(n)return Ul(n,a)},has:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ml(e,a)}else if(Yr){if(t)return Nl(t,a)}else if(n)return Ll(n,a);return!1},set:function(a,o){Xr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Xr),Fl(e,a,o)):Yr?(t||(t=new Yr),Bl(t,a,o)):(n||(n={key:{},next:null}),Cl(n,a,o))}};return i},kl=String.prototype.replace,ql=/%20/g,En={RFC1738:"RFC1738",RFC3986:"RFC3986"},Pa={default:En.RFC3986,formatters:{RFC1738:function(r){return kl.call(r,ql,"+")},RFC3986:function(r){return String(r)}},RFC1738:En.RFC1738,RFC3986:En.RFC3986},Gl=Pa,On=Object.prototype.hasOwnProperty,Oe=Array.isArray,re=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Wl=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}}},Ta=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},Vl=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)||!On.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=Ta(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(On.call(e,o)){var s=e[o];s&&typeof s=="object"&&a&&typeof a=="object"?e[o]=r(s,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var s=t[o];return On.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Hl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},zl=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}},Xl=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 s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Gl.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+re[c];continue}if(c<2048){s=s+(re[192|c>>6]+re[128|c&63]);continue}if(c<55296||c>=57344){s=s+(re[224|c>>12]+re[128|c>>6&63]+re[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=re[240|c>>18]+re[128|c>>12&63]+re[128|c>>6&63]+re[128|c&63]}return s},Yl=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],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Wl(t),e},Kl=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Zl=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Jl=function(e,t){return[].concat(e,t)},Ql=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)},ep={arrayToObject:Ta,assign:Hl,combine:Jl,compact:Yl,decode:zl,encode:Xl,isBuffer:Zl,isRegExp:Kl,maybeMap:Ql,merge:Vl},xa=jl,Sn=ep,ur=Pa,rp=Object.prototype.hasOwnProperty,Ra={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},oe=Array.isArray,tp=String.prototype.split,np=Array.prototype.push,Fa=function(r,e){np.apply(r,oe(e)?e:[e])},ip=Date.prototype.toISOString,Ma=ur.default,C={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Sn.encode,encodeValuesOnly:!1,format:Ma,formatter:ur.formatters[Ma],indices:!1,serializeDate:function(e){return ip.call(e)},skipNulls:!1,strictNullHandling:!1},ap=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},In={},op=function r(e,t,n,i,a,o,s,f,c,l,u,p,d,_,$,b){for(var w=e,A=b,h=0,I=!1;(A=A.get(In))!==void 0&&!I;){var P=A.get(e);if(h+=1,typeof P<"u"){if(P===h)throw new RangeError("Cyclic object value");I=!0}typeof A.get(In)>"u"&&(h=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=u(w):n==="comma"&&oe(w)&&(w=Sn.maybeMap(w,function(Ei){return Ei instanceof Date?u(Ei):Ei})),w===null){if(a)return s&&!_?s(t,C.encoder,$,"key",p):t;w=""}if(ap(w)||Sn.isBuffer(w)){if(s){var R=_?t:s(t,C.encoder,$,"key",p);if(n==="comma"&&_){for(var m=tp.call(String(w),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+d(s(m[g],C.encoder,$,"value",p));return[d(R)+(i&&oe(w)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(s(w,C.encoder,$,"value",p))]}return[d(t)+"="+d(String(w))]}var O=[];if(typeof w>"u")return O;var S;if(n==="comma"&&oe(w))S=[{value:w.length>0?w.join(",")||null:void 0}];else if(oe(f))S=f;else{var B=Object.keys(w);S=c?B.sort(c):B}for(var H=i&&oe(w)&&w.length===1?t+"[]":t,te=0;te<S.length;++te){var X=S[te],Re=typeof X=="object"&&typeof X.value<"u"?X.value:w[X];if(!(o&&Re===null)){var GR=oe(w)?typeof n=="function"?n(H,X):H:H+(l?"."+X:"["+X+"]");b.set(e,h);var rf=xa();rf.set(In,b),Fa(O,r(Re,GR,n,i,a,o,s,f,c,l,u,p,d,_,$,rf))}}return O},up=function(e){if(!e)return C;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||C.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(!rp.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=C.filter;return(typeof e.filter=="function"||oe(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:C.addQueryPrefix,allowDots:typeof e.allowDots>"u"?C.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:C.charsetSentinel,delimiter:typeof e.delimiter>"u"?C.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:C.encode,encoder:typeof e.encoder=="function"?e.encoder:C.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:C.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:C.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:C.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:C.strictNullHandling}},sp=function(r,e){var t=r,n=up(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):oe(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in Ra?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=Ra[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=xa(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||Fa(o,op(t[p],p,f,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:""};let Da={storeIdentifier:"",environment:"prod"};function fp(r){Da=r}function ue(){return Da}const cp=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",Pn=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",lp=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",pp="/tools/recurring";class Kr{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}var hp=Object.defineProperty,dp=Object.defineProperties,yp=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,vp=Object.prototype.hasOwnProperty,gp=Object.prototype.propertyIsEnumerable,Na=(r,e,t)=>e in r?hp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zr=(r,e)=>{for(var t in e||(e={}))vp.call(e,t)&&Na(r,t,e[t]);if(Ba)for(var t of Ba(e))gp.call(e,t)&&Na(r,t,e[t]);return r},_p=(r,e)=>dp(r,yp(e));function mp(r){return sp(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Jr(r,e,t={}){const n=ue();return z(r,`${lp(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function E(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f,loginRetryFn:c}=ue(),l=o.apiToken,u=cp(s),p=Zr({"X-Recharge-Access-Token":l,"X-Recharge-Version":"2021-11"},a||{}),d=Zr({shop_url:f},n);try{return await z(r,`${u}${e}`,{id:t,query:d,data:i,headers:p})}catch(_){if(c&&_ instanceof Kr&&_.status===401)return c().then($=>{if($)return z(r,`${u}${e}`,{id:t,query:d,data:i,headers:_p(Zr({},p),{"X-Recharge-Access-Token":$.apiToken})});throw _});throw _}}async function sr(r,e,t={}){return z(r,`${pp}${e}`,t)}async function z(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,mp(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=Zr({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Kr(l.error,c.status):l&&l.errors?new Kr(JSON.stringify(l.errors),c.status):new Kr("A connection error occurred while making the request");return l}function wp(r,e){return E("get","/addresses",{query:e},r)}async function bp(r,e,t){const{address:n}=await E("get","/addresses",{id:e,query:{include:t?.include}},r);return n}async function $p(r,e){const{address:t}=await E("post","/addresses",{data:e},r);return t}async function Tn(r,e,t){const{address:n}=await E("put","/addresses",{id:e,data:t},r);return n}async function Ap(r,e,t){return Tn(r,e,{discounts:[{code:t}]})}async function Ep(r,e){return Tn(r,e,{discounts:[]})}function Op(r,e){return E("delete","/addresses",{id:e},r)}async function Sp(r,e){const{address:t}=await E("post","/addresses/merge",{data:e},r);return t}async function Ip(r,e,t){const{charge:n}=await E("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Pp=Object.freeze({__proto__:null,listAddresses:wp,getAddress:bp,createAddress:$p,updateAddress:Tn,applyDiscountToAddress:Ap,removeDiscountsFromAddress:Ep,deleteAddress:Op,mergeAddresses:Sp,skipFutureCharge:Ip});async function Tp(){const{storefrontAccessToken:r}=ue(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await sr("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function xp(r,e){const{environment:t,storefrontAccessToken:n,storeIdentifier:i}=ue(),a=Pn(t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const s=await z("post",`${a}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:i},headers:o});return s.api_token?{apiToken:s.api_token,customerId:s.customer_id}:null}async function Rp(r){const{environment:e,storefrontAccessToken:t,storeIdentifier:n}=ue(),i=Pn(e),a={};t&&(a["X-Recharge-Storefront-Access-Token"]=t);const o=await z("post",`${i}/attempt_login`,{data:{email:r,shop:n},headers:a});if(o.errors)throw new Error(o.errors);return o.session_token}async function Fp(r){const{storefrontAccessToken:e,storeIdentifier:t}=ue(),n={};e&&(n["X-Recharge-Storefront-Access-Token"]=e);const i=await sr("post","/attempt_login",{data:{email:r,shop:t},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function Mp(r,e,t){const{environment:n,storefrontAccessToken:i,storeIdentifier:a}=ue(),o=Pn(n),s={};i&&(s["X-Recharge-Storefront-Access-Token"]=i);const f=await z("post",`${o}/validate_login`,{data:{code:t,email:r,session_token:e,shop:a},headers:s});if(f.errors)throw new Error(f.errors);return{apiToken:f.api_token,customerId:f.customer_id}}async function Dp(r,e,t){const{storefrontAccessToken:n,storeIdentifier:i}=ue(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const o=await sr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:i},headers:a});if(o.errors)throw new Error(o.errors);return{apiToken:o.api_token,customerId:o.customer_id}}var Bp=Object.freeze({__proto__:null,loginShopifyAppProxy:Tp,loginShopifyApi:xp,sendPasswordlessCode:Rp,sendPasswordlessCodeAppProxy:Fp,validatePasswordlessCode:Mp,validatePasswordlessCodeAppProxy:Dp});let Np=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");function Up(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 Qr=Up;function Cp(){this.__data__=[],this.size=0}var Lp=Cp;function jp(r,e){return r===e||r!==r&&e!==e}var et=jp,kp=et;function qp(r,e){for(var t=r.length;t--;)if(kp(r[t][0],e))return t;return-1}var rt=qp,Gp=rt,Wp=Array.prototype,Vp=Wp.splice;function Hp(r){var e=this.__data__,t=Gp(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Vp.call(e,t,1),--this.size,!0}var zp=Hp,Xp=rt;function Yp(r){var e=this.__data__,t=Xp(e,r);return t<0?void 0:e[t][1]}var Kp=Yp,Zp=rt;function Jp(r){return Zp(this.__data__,r)>-1}var Qp=Jp,eh=rt;function rh(r,e){var t=this.__data__,n=eh(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var th=rh,nh=Lp,ih=zp,ah=Kp,oh=Qp,uh=th;function qe(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])}}qe.prototype.clear=nh,qe.prototype.delete=ih,qe.prototype.get=ah,qe.prototype.has=oh,qe.prototype.set=uh;var tt=qe,sh=tt;function fh(){this.__data__=new sh,this.size=0}var ch=fh;function lh(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var ph=lh;function hh(r){return this.__data__.get(r)}var dh=hh;function yh(r){return this.__data__.has(r)}var vh=yh,gh=typeof ne=="object"&&ne&&ne.Object===Object&&ne,Ua=gh,_h=Ua,mh=typeof self=="object"&&self&&self.Object===Object&&self,wh=_h||mh||Function("return this")(),G=wh,bh=G,$h=bh.Symbol,Ge=$h,Ca=Ge,La=Object.prototype,Ah=La.hasOwnProperty,Eh=La.toString,fr=Ca?Ca.toStringTag:void 0;function Oh(r){var e=Ah.call(r,fr),t=r[fr];try{r[fr]=void 0;var n=!0}catch{}var i=Eh.call(r);return n&&(e?r[fr]=t:delete r[fr]),i}var Sh=Oh,Ih=Object.prototype,Ph=Ih.toString;function Th(r){return Ph.call(r)}var xh=Th,ja=Ge,Rh=Sh,Fh=xh,Mh="[object Null]",Dh="[object Undefined]",ka=ja?ja.toStringTag:void 0;function Bh(r){return r==null?r===void 0?Dh:Mh:ka&&ka in Object(r)?Rh(r):Fh(r)}var se=Bh;function Nh(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var fe=Nh,Uh=se,Ch=fe,Lh="[object AsyncFunction]",jh="[object Function]",kh="[object GeneratorFunction]",qh="[object Proxy]";function Gh(r){if(!Ch(r))return!1;var e=Uh(r);return e==jh||e==kh||e==Lh||e==qh}var xn=Gh,Wh=G,Vh=Wh["__core-js_shared__"],Hh=Vh,Rn=Hh,qa=function(){var r=/[^.]+$/.exec(Rn&&Rn.keys&&Rn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function zh(r){return!!qa&&qa in r}var Xh=zh,Yh=Function.prototype,Kh=Yh.toString;function Zh(r){if(r!=null){try{return Kh.call(r)}catch{}try{return r+""}catch{}}return""}var Ga=Zh,Jh=xn,Qh=Xh,ed=fe,rd=Ga,td=/[\\^$.*+?()[\]{}|]/g,nd=/^\[object .+?Constructor\]$/,id=Function.prototype,ad=Object.prototype,od=id.toString,ud=ad.hasOwnProperty,sd=RegExp("^"+od.call(ud).replace(td,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fd(r){if(!ed(r)||Qh(r))return!1;var e=Jh(r)?sd:nd;return e.test(rd(r))}var cd=fd;function ld(r,e){return r?.[e]}var pd=ld,hd=cd,dd=pd;function yd(r,e){var t=dd(r,e);return hd(t)?t:void 0}var Se=yd,vd=Se,gd=G,_d=vd(gd,"Map"),Fn=_d,md=Se,wd=md(Object,"create"),nt=wd,Wa=nt;function bd(){this.__data__=Wa?Wa(null):{},this.size=0}var $d=bd;function Ad(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Ed=Ad,Od=nt,Sd="__lodash_hash_undefined__",Id=Object.prototype,Pd=Id.hasOwnProperty;function Td(r){var e=this.__data__;if(Od){var t=e[r];return t===Sd?void 0:t}return Pd.call(e,r)?e[r]:void 0}var xd=Td,Rd=nt,Fd=Object.prototype,Md=Fd.hasOwnProperty;function Dd(r){var e=this.__data__;return Rd?e[r]!==void 0:Md.call(e,r)}var Bd=Dd,Nd=nt,Ud="__lodash_hash_undefined__";function Cd(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Nd&&e===void 0?Ud:e,this}var Ld=Cd,jd=$d,kd=Ed,qd=xd,Gd=Bd,Wd=Ld;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=jd,We.prototype.delete=kd,We.prototype.get=qd,We.prototype.has=Gd,We.prototype.set=Wd;var Vd=We,Va=Vd,Hd=tt,zd=Fn;function Xd(){this.size=0,this.__data__={hash:new Va,map:new(zd||Hd),string:new Va}}var Yd=Xd;function Kd(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Zd=Kd,Jd=Zd;function Qd(r,e){var t=r.__data__;return Jd(e)?t[typeof e=="string"?"string":"hash"]:t.map}var it=Qd,ey=it;function ry(r){var e=ey(this,r).delete(r);return this.size-=e?1:0,e}var ty=ry,ny=it;function iy(r){return ny(this,r).get(r)}var ay=iy,oy=it;function uy(r){return oy(this,r).has(r)}var sy=uy,fy=it;function cy(r,e){var t=fy(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var ly=cy,py=Yd,hy=ty,dy=ay,yy=sy,vy=ly;function Ve(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])}}Ve.prototype.clear=py,Ve.prototype.delete=hy,Ve.prototype.get=dy,Ve.prototype.has=yy,Ve.prototype.set=vy;var Mn=Ve,gy=tt,_y=Fn,my=Mn,wy=200;function by(r,e){var t=this.__data__;if(t instanceof gy){var n=t.__data__;if(!_y||n.length<wy-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new my(n)}return t.set(r,e),this.size=t.size,this}var $y=by,Ay=tt,Ey=ch,Oy=ph,Sy=dh,Iy=vh,Py=$y;function He(r){var e=this.__data__=new Ay(r);this.size=e.size}He.prototype.clear=Ey,He.prototype.delete=Oy,He.prototype.get=Sy,He.prototype.has=Iy,He.prototype.set=Py;var Dn=He;function Ty(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Bn=Ty,xy=Se,Ry=function(){try{var r=xy(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Ha=Ry,za=Ha;function Fy(r,e,t){e=="__proto__"&&za?za(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Xa=Fy,My=Xa,Dy=et,By=Object.prototype,Ny=By.hasOwnProperty;function Uy(r,e,t){var n=r[e];(!(Ny.call(r,e)&&Dy(n,t))||t===void 0&&!(e in r))&&My(r,e,t)}var Ya=Uy,Cy=Ya,Ly=Xa;function jy(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],f=n?n(t[s],r[s],s,t,r):void 0;f===void 0&&(f=r[s]),i?Ly(t,s,f):Cy(t,s,f)}return t}var ze=jy;function ky(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Ka=ky;function qy(r){return r!=null&&typeof r=="object"}var V=qy,Gy=se,Wy=V,Vy="[object Arguments]";function Hy(r){return Wy(r)&&Gy(r)==Vy}var zy=Hy,Za=zy,Xy=V,Ja=Object.prototype,Yy=Ja.hasOwnProperty,Ky=Ja.propertyIsEnumerable,Zy=Za(function(){return arguments}())?Za:function(r){return Xy(r)&&Yy.call(r,"callee")&&!Ky.call(r,"callee")},Nn=Zy,Jy=Array.isArray,U=Jy,cr={exports:{}};function Qy(){return!1}var ev=Qy;(function(r,e){var t=G,n=ev,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,s=o?t.Buffer:void 0,f=s?s.isBuffer:void 0,c=f||n;r.exports=c})(cr,cr.exports);var rv=9007199254740991,tv=/^(?:0|[1-9]\d*)$/;function nv(r,e){var t=typeof r;return e=e??rv,!!e&&(t=="number"||t!="symbol"&&tv.test(r))&&r>-1&&r%1==0&&r<e}var at=nv,iv=9007199254740991;function av(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=iv}var Un=av,ov=se,uv=Un,sv=V,fv="[object Arguments]",cv="[object Array]",lv="[object Boolean]",pv="[object Date]",hv="[object Error]",dv="[object Function]",yv="[object Map]",vv="[object Number]",gv="[object Object]",_v="[object RegExp]",mv="[object Set]",wv="[object String]",bv="[object WeakMap]",$v="[object ArrayBuffer]",Av="[object DataView]",Ev="[object Float32Array]",Ov="[object Float64Array]",Sv="[object Int8Array]",Iv="[object Int16Array]",Pv="[object Int32Array]",Tv="[object Uint8Array]",xv="[object Uint8ClampedArray]",Rv="[object Uint16Array]",Fv="[object Uint32Array]",F={};F[Ev]=F[Ov]=F[Sv]=F[Iv]=F[Pv]=F[Tv]=F[xv]=F[Rv]=F[Fv]=!0,F[fv]=F[cv]=F[$v]=F[lv]=F[Av]=F[pv]=F[hv]=F[dv]=F[yv]=F[vv]=F[gv]=F[_v]=F[mv]=F[wv]=F[bv]=!1;function Mv(r){return sv(r)&&uv(r.length)&&!!F[ov(r)]}var Dv=Mv;function Bv(r){return function(e){return r(e)}}var Cn=Bv,lr={exports:{}};(function(r,e){var t=Ua,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s})(lr,lr.exports);var Nv=Dv,Uv=Cn,Qa=lr.exports,eo=Qa&&Qa.isTypedArray,Cv=eo?Uv(eo):Nv,ro=Cv,Lv=Ka,jv=Nn,kv=U,qv=cr.exports,Gv=at,Wv=ro,Vv=Object.prototype,Hv=Vv.hasOwnProperty;function zv(r,e){var t=kv(r),n=!t&&jv(r),i=!t&&!n&&qv(r),a=!t&&!n&&!i&&Wv(r),o=t||n||i||a,s=o?Lv(r.length,String):[],f=s.length;for(var c in r)(e||Hv.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Gv(c,f)))&&s.push(c);return s}var to=zv,Xv=Object.prototype;function Yv(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Xv;return r===t}var Ln=Yv;function Kv(r,e){return function(t){return r(e(t))}}var no=Kv,Zv=no,Jv=Zv(Object.keys,Object),Qv=Jv,eg=Ln,rg=Qv,tg=Object.prototype,ng=tg.hasOwnProperty;function ig(r){if(!eg(r))return rg(r);var e=[];for(var t in Object(r))ng.call(r,t)&&t!="constructor"&&e.push(t);return e}var ag=ig,og=xn,ug=Un;function sg(r){return r!=null&&ug(r.length)&&!og(r)}var pr=sg,fg=to,cg=ag,lg=pr;function pg(r){return lg(r)?fg(r):cg(r)}var Xe=pg,hg=ze,dg=Xe;function yg(r,e){return r&&hg(e,dg(e),r)}var vg=yg;function gg(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var _g=gg,mg=fe,wg=Ln,bg=_g,$g=Object.prototype,Ag=$g.hasOwnProperty;function Eg(r){if(!mg(r))return bg(r);var e=wg(r),t=[];for(var n in r)n=="constructor"&&(e||!Ag.call(r,n))||t.push(n);return t}var Og=Eg,Sg=to,Ig=Og,Pg=pr;function Tg(r){return Pg(r)?Sg(r,!0):Ig(r)}var ot=Tg,xg=ze,Rg=ot;function Fg(r,e){return r&&xg(e,Rg(e),r)}var Mg=Fg,jn={exports:{}};(function(r,e){var t=G,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,l){if(l)return c.slice();var u=c.length,p=s?s(u):new c.constructor(u);return c.copy(p),p}r.exports=f})(jn,jn.exports);function Dg(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var kn=Dg;function Bg(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 Ng=Bg;function Ug(){return[]}var io=Ug,Cg=Ng,Lg=io,jg=Object.prototype,kg=jg.propertyIsEnumerable,ao=Object.getOwnPropertySymbols,qg=ao?function(r){return r==null?[]:(r=Object(r),Cg(ao(r),function(e){return kg.call(r,e)}))}:Lg,qn=qg,Gg=ze,Wg=qn;function Vg(r,e){return Gg(r,Wg(r),e)}var Hg=Vg;function zg(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Gn=zg,Xg=no,Yg=Xg(Object.getPrototypeOf,Object),Wn=Yg,Kg=Gn,Zg=Wn,Jg=qn,Qg=io,e_=Object.getOwnPropertySymbols,r_=e_?function(r){for(var e=[];r;)Kg(e,Jg(r)),r=Zg(r);return e}:Qg,oo=r_,t_=ze,n_=oo;function i_(r,e){return t_(r,n_(r),e)}var a_=i_,o_=Gn,u_=U;function s_(r,e,t){var n=e(r);return u_(r)?n:o_(n,t(r))}var uo=s_,f_=uo,c_=qn,l_=Xe;function p_(r){return f_(r,l_,c_)}var so=p_,h_=uo,d_=oo,y_=ot;function v_(r){return h_(r,y_,d_)}var fo=v_,g_=Se,__=G,m_=g_(__,"DataView"),w_=m_,b_=Se,$_=G,A_=b_($_,"Promise"),E_=A_,O_=Se,S_=G,I_=O_(S_,"Set"),P_=I_,T_=Se,x_=G,R_=T_(x_,"WeakMap"),co=R_,Vn=w_,Hn=Fn,zn=E_,Xn=P_,Yn=co,lo=se,Ye=Ga,po="[object Map]",F_="[object Object]",ho="[object Promise]",yo="[object Set]",vo="[object WeakMap]",go="[object DataView]",M_=Ye(Vn),D_=Ye(Hn),B_=Ye(zn),N_=Ye(Xn),U_=Ye(Yn),Ie=lo;(Vn&&Ie(new Vn(new ArrayBuffer(1)))!=go||Hn&&Ie(new Hn)!=po||zn&&Ie(zn.resolve())!=ho||Xn&&Ie(new Xn)!=yo||Yn&&Ie(new Yn)!=vo)&&(Ie=function(r){var e=lo(r),t=e==F_?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case M_:return go;case D_:return po;case B_:return ho;case N_:return yo;case U_:return vo}return e});var ut=Ie,C_=Object.prototype,L_=C_.hasOwnProperty;function j_(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&L_.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var k_=j_,q_=G,G_=q_.Uint8Array,_o=G_,mo=_o;function W_(r){var e=new r.constructor(r.byteLength);return new mo(e).set(new mo(r)),e}var Kn=W_,V_=Kn;function H_(r,e){var t=e?V_(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var z_=H_,X_=/\w*$/;function Y_(r){var e=new r.constructor(r.source,X_.exec(r));return e.lastIndex=r.lastIndex,e}var K_=Y_,wo=Ge,bo=wo?wo.prototype:void 0,$o=bo?bo.valueOf:void 0;function Z_(r){return $o?Object($o.call(r)):{}}var J_=Z_,Q_=Kn;function em(r,e){var t=e?Q_(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var rm=em,tm=Kn,nm=z_,im=K_,am=J_,om=rm,um="[object Boolean]",sm="[object Date]",fm="[object Map]",cm="[object Number]",lm="[object RegExp]",pm="[object Set]",hm="[object String]",dm="[object Symbol]",ym="[object ArrayBuffer]",vm="[object DataView]",gm="[object Float32Array]",_m="[object Float64Array]",mm="[object Int8Array]",wm="[object Int16Array]",bm="[object Int32Array]",$m="[object Uint8Array]",Am="[object Uint8ClampedArray]",Em="[object Uint16Array]",Om="[object Uint32Array]";function Sm(r,e,t){var n=r.constructor;switch(e){case ym:return tm(r);case um:case sm:return new n(+r);case vm:return nm(r,t);case gm:case _m:case mm:case wm:case bm:case $m:case Am:case Em:case Om:return om(r,t);case fm:return new n;case cm:case hm:return new n(r);case lm:return im(r);case pm:return new n;case dm:return am(r)}}var Im=Sm,Pm=fe,Ao=Object.create,Tm=function(){function r(){}return function(e){if(!Pm(e))return{};if(Ao)return Ao(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),st=Tm,xm=st,Rm=Wn,Fm=Ln;function Mm(r){return typeof r.constructor=="function"&&!Fm(r)?xm(Rm(r)):{}}var Dm=Mm,Bm=ut,Nm=V,Um="[object Map]";function Cm(r){return Nm(r)&&Bm(r)==Um}var Lm=Cm,jm=Lm,km=Cn,Eo=lr.exports,Oo=Eo&&Eo.isMap,qm=Oo?km(Oo):jm,Gm=qm,Wm=ut,Vm=V,Hm="[object Set]";function zm(r){return Vm(r)&&Wm(r)==Hm}var Xm=zm,Ym=Xm,Km=Cn,So=lr.exports,Io=So&&So.isSet,Zm=Io?Km(Io):Ym,Jm=Zm,Qm=Dn,ew=Bn,rw=Ya,tw=vg,nw=Mg,iw=jn.exports,aw=kn,ow=Hg,uw=a_,sw=so,fw=fo,cw=ut,lw=k_,pw=Im,hw=Dm,dw=U,yw=cr.exports,vw=Gm,gw=fe,_w=Jm,mw=Xe,ww=ot,bw=1,$w=2,Aw=4,Po="[object Arguments]",Ew="[object Array]",Ow="[object Boolean]",Sw="[object Date]",Iw="[object Error]",To="[object Function]",Pw="[object GeneratorFunction]",Tw="[object Map]",xw="[object Number]",xo="[object Object]",Rw="[object RegExp]",Fw="[object Set]",Mw="[object String]",Dw="[object Symbol]",Bw="[object WeakMap]",Nw="[object ArrayBuffer]",Uw="[object DataView]",Cw="[object Float32Array]",Lw="[object Float64Array]",jw="[object Int8Array]",kw="[object Int16Array]",qw="[object Int32Array]",Gw="[object Uint8Array]",Ww="[object Uint8ClampedArray]",Vw="[object Uint16Array]",Hw="[object Uint32Array]",x={};x[Po]=x[Ew]=x[Nw]=x[Uw]=x[Ow]=x[Sw]=x[Cw]=x[Lw]=x[jw]=x[kw]=x[qw]=x[Tw]=x[xw]=x[xo]=x[Rw]=x[Fw]=x[Mw]=x[Dw]=x[Gw]=x[Ww]=x[Vw]=x[Hw]=!0,x[Iw]=x[To]=x[Bw]=!1;function ft(r,e,t,n,i,a){var o,s=e&bw,f=e&$w,c=e&Aw;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!gw(r))return r;var l=dw(r);if(l){if(o=lw(r),!s)return aw(r,o)}else{var u=cw(r),p=u==To||u==Pw;if(yw(r))return iw(r,s);if(u==xo||u==Po||p&&!i){if(o=f||p?{}:hw(r),!s)return f?uw(r,nw(o,r)):ow(r,tw(o,r))}else{if(!x[u])return i?r:{};o=pw(r,u,s)}}a||(a=new Qm);var d=a.get(r);if(d)return d;a.set(r,o),_w(r)?r.forEach(function(b){o.add(ft(b,e,t,b,r,a))}):vw(r)&&r.forEach(function(b,w){o.set(w,ft(b,e,t,w,r,a))});var _=c?f?fw:sw:f?ww:mw,$=l?void 0:_(r);return ew($||r,function(b,w){$&&(w=b,b=r[w]),rw(o,w,ft(b,e,t,w,r,a))}),o}var zw=ft,Xw=se,Yw=V,Kw="[object Symbol]";function Zw(r){return typeof r=="symbol"||Yw(r)&&Xw(r)==Kw}var ct=Zw,Jw=U,Qw=ct,e0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r0=/^\w*$/;function t0(r,e){if(Jw(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Qw(r)?!0:r0.test(r)||!e0.test(r)||e!=null&&r in Object(e)}var Zn=t0,Ro=Mn,n0="Expected a function";function Jn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(n0);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(Jn.Cache||Ro),t}Jn.Cache=Ro;var i0=Jn,a0=i0,o0=500;function u0(r){var e=a0(r,function(n){return t.size===o0&&t.clear(),n}),t=e.cache;return e}var s0=u0,f0=s0,c0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l0=/\\(\\)?/g,p0=f0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(c0,function(t,n,i,a){e.push(i?a.replace(l0,"$1"):n||t)}),e}),h0=p0,Fo=Ge,d0=Qr,y0=U,v0=ct,g0=1/0,Mo=Fo?Fo.prototype:void 0,Do=Mo?Mo.toString:void 0;function Bo(r){if(typeof r=="string")return r;if(y0(r))return d0(r,Bo)+"";if(v0(r))return Do?Do.call(r):"";var e=r+"";return e=="0"&&1/r==-g0?"-0":e}var _0=Bo,m0=_0;function w0(r){return r==null?"":m0(r)}var b0=w0,$0=U,A0=Zn,E0=h0,O0=b0;function S0(r,e){return $0(r)?r:A0(r,e)?[r]:E0(O0(r))}var lt=S0;function I0(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var P0=I0,T0=ct,x0=1/0;function R0(r){if(typeof r=="string"||T0(r))return r;var e=r+"";return e=="0"&&1/r==-x0?"-0":e}var hr=R0,F0=lt,M0=hr;function D0(r,e){e=F0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[M0(e[t++])];return t&&t==n?r:void 0}var Qn=D0;function B0(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 N0=B0,U0=Qn,C0=N0;function L0(r,e){return e.length<2?r:U0(r,C0(e,0,-1))}var j0=L0,k0=lt,q0=P0,G0=j0,W0=hr;function V0(r,e){return e=k0(e,r),r=G0(r,e),r==null||delete r[W0(q0(e))]}var H0=V0,z0=se,X0=Wn,Y0=V,K0="[object Object]",Z0=Function.prototype,J0=Object.prototype,No=Z0.toString,Q0=J0.hasOwnProperty,eb=No.call(Object);function rb(r){if(!Y0(r)||z0(r)!=K0)return!1;var e=X0(r);if(e===null)return!0;var t=Q0.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&No.call(t)==eb}var tb=rb,nb=tb;function ib(r){return nb(r)?void 0:r}var ab=ib,Uo=Ge,ob=Nn,ub=U,Co=Uo?Uo.isConcatSpreadable:void 0;function sb(r){return ub(r)||ob(r)||!!(Co&&r&&r[Co])}var fb=sb,cb=Gn,lb=fb;function Lo(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=lb),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?Lo(s,e-1,t,n,i):cb(i,s):n||(i[i.length]=s)}return i}var pb=Lo,hb=pb;function db(r){var e=r==null?0:r.length;return e?hb(r,1):[]}var yb=db;function vb(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 ei=vb,gb=ei,jo=Math.max;function _b(r,e,t){return e=jo(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=jo(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=t(o),gb(r,this,s)}}var ko=_b;function mb(r){return function(){return r}}var wb=mb;function bb(r){return r}var dr=bb,$b=wb,qo=Ha,Ab=dr,Eb=qo?function(r,e){return qo(r,"toString",{configurable:!0,enumerable:!1,value:$b(e),writable:!0})}:Ab,Ob=Eb,Sb=800,Ib=16,Pb=Date.now;function Tb(r){var e=0,t=0;return function(){var n=Pb(),i=Ib-(n-t);if(t=n,i>0){if(++e>=Sb)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Go=Tb,xb=Ob,Rb=Go,Fb=Rb(xb),ri=Fb,Mb=yb,Db=ko,Bb=ri;function Nb(r){return Bb(Db(r,void 0,Mb),r+"")}var Ub=Nb,Cb=Qr,Lb=zw,jb=H0,kb=lt,qb=ze,Gb=ab,Wb=Ub,Vb=fo,Hb=1,zb=2,Xb=4,Yb=Wb(function(r,e){var t={};if(r==null)return t;var n=!1;e=Cb(e,function(a){return a=kb(a,r),n||(n=a.length>1),a}),qb(r,Vb(r),t),n&&(t=Lb(t,Hb|zb|Xb,Gb));for(var i=e.length;i--;)jb(t,e[i]);return t}),ti=Yb,Kb=Object.defineProperty,Zb=Object.defineProperties,Jb=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,Qb=Object.prototype.hasOwnProperty,e1=Object.prototype.propertyIsEnumerable,Vo=(r,e,t)=>e in r?Kb(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,r1=(r,e)=>{for(var t in e||(e={}))Qb.call(e,t)&&Vo(r,t,e[t]);if(Wo)for(var t of Wo(e))e1.call(e,t)&&Vo(r,t,e[t]);return r},t1=(r,e)=>Zb(r,Jb(e));function n1(r){try{return JSON.parse(r)}catch{return r}}function i1(r){return Object.entries(r).reduce((e,[t,n])=>t1(r1({},e),{[t]:n1(n)}),{})}const Ho=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;var a1=Object.defineProperty,o1=Object.defineProperties,u1=Object.getOwnPropertyDescriptors,zo=Object.getOwnPropertySymbols,s1=Object.prototype.hasOwnProperty,f1=Object.prototype.propertyIsEnumerable,Xo=(r,e,t)=>e in r?a1(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Yo=(r,e)=>{for(var t in e||(e={}))s1.call(e,t)&&Xo(r,t,e[t]);if(zo)for(var t of zo(e))f1.call(e,t)&&Xo(r,t,e[t]);return r},Ko=(r,e)=>o1(r,u1(e));function Zo(r){var e;const t=i1(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Ko(Yo({},ti(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function Jo(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Ko(Yo({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function c1(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Jo(i)}),t})}const pt="2020-12",l1={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},yr=new Map;function ht(r,e){return yr.has(r)||yr.set(r,e()),yr.get(r)}async function ni(r){const{product:e}=await ht(`product.${r}`,()=>Jr("get",`/product/${pt}/${r}.json`));return Jo(e)}async function Qo(){return await ht("storeSettings",()=>Jr("get",`/${pt}/store_settings.json`).catch(()=>l1))}async function eu(){const{widget_settings:r}=await ht("widgetSettings",()=>Jr("get",`/${pt}/widget_settings.json`));return Zo(r)}async function ru(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await ht("productsAndSettings",()=>Jr("get",`/product/${pt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:c1(r),widget_settings:Zo(e),store_settings:t??{}}}async function p1(){const{products:r}=await ru();return r}async function h1(r){const[e,t,n]=await Promise.all([ni(r),Qo(),eu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function tu(r){const{bundle_product:e}=await ni(r);return e}async function nu(){return Array.from(yr.keys()).forEach(r=>yr.delete(r))}var d1=Object.freeze({__proto__:null,getCDNProduct:ni,getCDNStoreSettings:Qo,getCDNWidgetSettings:eu,getCDNProductsAndSettings:ru,getCDNProducts:p1,getCDNProductAndSettings:h1,getCDNBundleSettings:tu,resetCDNCache:nu}),iu={},ii={},ce={},y1=se,v1=V,g1="[object Number]";function _1(r){return typeof r=="number"||v1(r)&&y1(r)==g1}var dt=_1,M={},au={exports:{}},m1=dr,w1=ko,b1=ri;function $1(r,e){return b1(w1(r,e,m1),r+"")}var ou=$1,A1=et,E1=pr,O1=at,S1=fe;function I1(r,e,t){if(!S1(t))return!1;var n=typeof e;return(n=="number"?E1(t)&&O1(e,t.length):n=="string"&&e in t)?A1(t[e],r):!1}var uu=I1,P1=ou,T1=uu;function x1(r){return P1(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&&T1(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=t[n];s&&r(e,s,n,a)}return e})}var R1=x1,F1=ze,M1=R1,D1=ot,B1=M1(function(r,e){F1(e,D1(e),r)}),N1=B1;(function(r){r.exports=N1})(au);var yt={},Pe={};function U1(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 C1=U1;function L1(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var f=o[r?s:++i];if(t(a[f],f,a)===!1)break}return e}}var j1=L1,k1=j1,q1=k1(),G1=q1,W1=G1,V1=Xe;function H1(r,e){return r&&W1(r,e,V1)}var z1=H1,X1=pr;function Y1(r,e){return function(t,n){if(t==null)return t;if(!X1(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 K1=Y1,Z1=z1,J1=K1,Q1=J1(Z1),ai=Q1,e$=ai;function r$(r,e){var t=!0;return e$(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var t$=r$,n$="__lodash_hash_undefined__";function i$(r){return this.__data__.set(r,n$),this}var a$=i$;function o$(r){return this.__data__.has(r)}var u$=o$,s$=Mn,f$=a$,c$=u$;function vt(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new s$;++e<t;)this.add(r[e])}vt.prototype.add=vt.prototype.push=f$,vt.prototype.has=c$;var l$=vt;function p$(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 h$=p$;function d$(r,e){return r.has(e)}var y$=d$,v$=l$,g$=h$,_$=y$,m$=1,w$=2;function b$(r,e,t,n,i,a){var o=t&m$,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))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&w$?new v$:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var _=r[u],$=e[u];if(n)var b=o?n($,_,u,e,r,a):n(_,$,u,r,e,a);if(b!==void 0){if(b)continue;p=!1;break}if(d){if(!g$(e,function(w,A){if(!_$(d,A)&&(_===w||i(_,w,t,n,a)))return d.push(A)})){p=!1;break}}else if(!(_===$||i(_,$,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var su=b$;function $$(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var A$=$$;function E$(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var O$=E$,fu=Ge,cu=_o,S$=et,I$=su,P$=A$,T$=O$,x$=1,R$=2,F$="[object Boolean]",M$="[object Date]",D$="[object Error]",B$="[object Map]",N$="[object Number]",U$="[object RegExp]",C$="[object Set]",L$="[object String]",j$="[object Symbol]",k$="[object ArrayBuffer]",q$="[object DataView]",lu=fu?fu.prototype:void 0,oi=lu?lu.valueOf:void 0;function G$(r,e,t,n,i,a,o){switch(t){case q$:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case k$:return!(r.byteLength!=e.byteLength||!a(new cu(r),new cu(e)));case F$:case M$:case N$:return S$(+r,+e);case D$:return r.name==e.name&&r.message==e.message;case U$:case L$:return r==e+"";case B$:var s=P$;case C$:var f=n&x$;if(s||(s=T$),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=R$,o.set(r,e);var l=I$(s(r),s(e),n,i,a,o);return o.delete(r),l;case j$:if(oi)return oi.call(r)==oi.call(e)}return!1}var W$=G$,pu=so,V$=1,H$=Object.prototype,z$=H$.hasOwnProperty;function X$(r,e,t,n,i,a){var o=t&V$,s=pu(r),f=s.length,c=pu(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[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 $=!0;a.set(r,e),a.set(e,r);for(var b=o;++u<f;){p=s[u];var w=r[p],A=e[p];if(n)var h=o?n(A,w,p,e,r,a):n(w,A,p,r,e,a);if(!(h===void 0?w===A||i(w,A,t,n,a):h)){$=!1;break}b||(b=p=="constructor")}if($&&!b){var I=r.constructor,P=e.constructor;I!=P&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof P=="function"&&P instanceof P)&&($=!1)}return a.delete(r),a.delete(e),$}var Y$=X$,ui=Dn,K$=su,Z$=W$,J$=Y$,hu=ut,du=U,yu=cr.exports,Q$=ro,eA=1,vu="[object Arguments]",gu="[object Array]",gt="[object Object]",rA=Object.prototype,_u=rA.hasOwnProperty;function tA(r,e,t,n,i,a){var o=du(r),s=du(e),f=o?gu:hu(r),c=s?gu:hu(e);f=f==vu?gt:f,c=c==vu?gt:c;var l=f==gt,u=c==gt,p=f==c;if(p&&yu(r)){if(!yu(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new ui),o||Q$(r)?K$(r,e,t,n,i,a):Z$(r,e,f,t,n,i,a);if(!(t&eA)){var d=l&&_u.call(r,"__wrapped__"),_=u&&_u.call(e,"__wrapped__");if(d||_){var $=d?r.value():r,b=_?e.value():e;return a||(a=new ui),i($,b,t,n,a)}}return p?(a||(a=new ui),J$(r,e,t,n,i,a)):!1}var nA=tA,iA=nA,mu=V;function wu(r,e,t,n,i){return r===e?!0:r==null||e==null||!mu(r)&&!mu(e)?r!==r&&e!==e:iA(r,e,t,n,wu,i)}var bu=wu,aA=Dn,oA=bu,uA=1,sA=2;function fA(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],l=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new aA;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?oA(l,c,uA|sA,n,u):p))return!1}}return!0}var cA=fA,lA=fe;function pA(r){return r===r&&!lA(r)}var $u=pA,hA=$u,dA=Xe;function yA(r){for(var e=dA(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,hA(i)]}return e}var vA=yA;function gA(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Au=gA,_A=cA,mA=vA,wA=Au;function bA(r){var e=mA(r);return e.length==1&&e[0][2]?wA(e[0][0],e[0][1]):function(t){return t===r||_A(t,r,e)}}var $A=bA,AA=Qn;function EA(r,e,t){var n=r==null?void 0:AA(r,e);return n===void 0?t:n}var OA=EA;function SA(r,e){return r!=null&&e in Object(r)}var IA=SA,PA=lt,TA=Nn,xA=U,RA=at,FA=Un,MA=hr;function DA(r,e,t){e=PA(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=MA(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&&FA(i)&&RA(o,i)&&(xA(r)||TA(r)))}var BA=DA,NA=IA,UA=BA;function CA(r,e){return r!=null&&UA(r,e,NA)}var LA=CA,jA=bu,kA=OA,qA=LA,GA=Zn,WA=$u,VA=Au,HA=hr,zA=1,XA=2;function YA(r,e){return GA(r)&&WA(e)?VA(HA(r),e):function(t){var n=kA(t,r);return n===void 0&&n===e?qA(t,r):jA(e,n,zA|XA)}}var KA=YA;function ZA(r){return function(e){return e?.[r]}}var JA=ZA,QA=Qn;function eE(r){return function(e){return QA(e,r)}}var rE=eE,tE=JA,nE=rE,iE=Zn,aE=hr;function oE(r){return iE(r)?tE(aE(r)):nE(r)}var uE=oE,sE=$A,fE=KA,cE=dr,lE=U,pE=uE;function hE(r){return typeof r=="function"?r:r==null?cE:typeof r=="object"?lE(r)?fE(r[0],r[1]):sE(r):pE(r)}var Eu=hE,dE=C1,yE=t$,vE=Eu,gE=U,_E=uu;function mE(r,e,t){var n=gE(r)?dE:yE;return t&&_E(r,e,t)&&(e=void 0),n(r,vE(e))}var si=mE;Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.calculatePadding=AE,Pe.slicePadding=EE;var wE=si,bE=$E(wE);function $E(r){return r&&r.__esModule?r:{default:r}}function AE(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function EE(r,e){var t=r.slice(e),n=(0,bE.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(yt,"__esModule",{value:!0}),yt.Cursor=void 0;var OE=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}}(),SE=Pe;function IE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var fi=function(){function r(e){IE(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return OE(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,SE.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){fi.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){fi.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),yt.Cursor=fi,Object.defineProperty(M,"__esModule",{value:!0}),M.default=DE;var PE=au.exports,Ou=Iu(PE),TE=xn,xE=Iu(TE),Su=yt;function Iu(r){return r&&r.__esModule?r:{default:r}}var RE=Math.pow(2,16),FE={toXDR:function(e){var t=new Su.Cursor(RE);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 Su.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}}},ME={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 DE(r){(0,Ou.default)(r,FE),(0,xE.default)(r)&&(0,Ou.default)(r.prototype,ME)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.Int=void 0;var BE=dt,Pu=Tu(BE),NE=M,UE=Tu(NE);function Tu(r){return r&&r.__esModule?r:{default:r}}var vr=ce.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Pu.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,Pu.default)(e)||Math.floor(e)!==e?!1:e>=vr.MIN_VALUE&&e<=vr.MAX_VALUE}};vr.MAX_VALUE=Math.pow(2,31)-1,vr.MIN_VALUE=-Math.pow(2,31),(0,UE.default)(vr);var _t={};function CE(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 ci={exports:{}};(function(r){/**
21
21
  * @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
22
22
  * Released under the Apache License, Version 2.0
23
23
  * see: https://github.com/dcodeIO/Long.js for details
24
- */(function(e,t){typeof CE=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(ne,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<=-f?e.MIN_VALUE:!p&&u+1>=f?e.MAX_VALUE:p&&u>=s?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.fromNumber(Math.pow(d,8)),b=e.ZERO,w=0;w<u.length;w+=8){var A=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+A),d);if(A<8){var I=e.fromNumber(Math.pow(d,A));b=b.multiply(I).add(e.fromNumber(h))}else b=b.multiply($),b=b.add(e.fromNumber(h))}return b.unsigned=p,b},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,s=o*o,f=s/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.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var b="";;){var w=p.divide($),A=p.subtract(w.multiply($)).toInt()>>>0,h=A.toString(u);if(p=w,p.isZero())return h+b;for(;h.length<6;)h="0"+h;b=""+h+b}},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,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,I=0,P=0,R=0,m=0;return m+=$+h,R+=m>>>16,m&=65535,R+=_+A,P+=R>>>16,R&=65535,P+=d+w,I+=P>>>16,P&=65535,I+=p+b,I&=65535,e.fromBits(R<<16|m,I<<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,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,I=0,P=0,R=0,m=0;return m+=$*h,R+=m>>>16,m&=65535,R+=_*h,P+=R>>>16,R&=65535,R+=$*A,P+=R>>>16,R&=65535,P+=d*h,I+=P>>>16,P&=65535,P+=_*A,I+=P>>>16,P&=65535,P+=$*w,I+=P>>>16,P&=65535,I+=p*h+d*A+_*w+$*b,I&=65535,e.fromBits(R<<16|m,I<<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 $=this.shiftRight(1);return p=$.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 b=Math.ceil(Math.log(p)/Math.LN2),w=b<=48?1:Math.pow(2,b-48),A=e.fromNumber(p),h=A.multiply(u);h.isNegative()||h.greaterThan(d);)p-=w,A=e.fromNumber(p,this.unsigned),h=A.multiply(u);A.isZero()&&(A=e.ONE),_=_.add(A),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})})(ci),Object.defineProperty(_t,"__esModule",{value:!0}),_t.Hyper=void 0;var LE=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}}(),xu=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)}},jE=ci.exports,gr=Ru(jE),kE=M,qE=Ru(kE);function Ru(r){return r&&r.__esModule?r:{default:r}}function GE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}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 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)}var _r=_t.Hyper=function(r){VE(e,r),LE(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=xu(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=xu(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 GE(this,e),WE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(gr.default);(0,qE.default)(_r),_r.MAX_VALUE=new _r(gr.default.MAX_VALUE.low,gr.default.MAX_VALUE.high),_r.MIN_VALUE=new _r(gr.default.MIN_VALUE.low,gr.default.MIN_VALUE.high);var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.UnsignedInt=void 0;var HE=dt,Fu=Mu(HE),zE=M,XE=Mu(zE);function Mu(r){return r&&r.__esModule?r:{default:r}}var mr=Te.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Fu.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,Fu.default)(e)||Math.floor(e)!==e?!1:e>=mr.MIN_VALUE&&e<=mr.MAX_VALUE}};mr.MAX_VALUE=Math.pow(2,32)-1,mr.MIN_VALUE=0,(0,XE.default)(mr);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.UnsignedHyper=void 0;var YE=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}}(),Du=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)}},KE=ci.exports,wr=Bu(KE),ZE=M,JE=Bu(ZE);function Bu(r){return r&&r.__esModule?r:{default:r}}function QE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function eO(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 rO(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=mt.UnsignedHyper=function(r){rO(e,r),YE(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=Du(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=Du(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 QE(this,e),eO(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(wr.default);(0,JE.default)(br),br.MAX_VALUE=new br(wr.default.MAX_UNSIGNED_VALUE.low,wr.default.MAX_UNSIGNED_VALUE.high),br.MIN_VALUE=new br(wr.default.MIN_VALUE.low,wr.default.MIN_VALUE.high);var wt={};Object.defineProperty(wt,"__esModule",{value:!0}),wt.Float=void 0;var tO=dt,Nu=Uu(tO),nO=M,iO=Uu(nO);function Uu(r){return r&&r.__esModule?r:{default:r}}var aO=wt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Nu.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Nu.default)(e)}};(0,iO.default)(aO);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.Double=void 0;var oO=dt,Cu=Lu(oO),uO=M,sO=Lu(uO);function Lu(r){return r&&r.__esModule?r:{default:r}}var fO=bt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,Cu.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,Cu.default)(e)}};(0,sO.default)(fO);var $t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.Quadruple=void 0;var cO=M,lO=pO(cO);function pO(r){return r&&r.__esModule?r:{default:r}}var hO=$t.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,lO.default)(hO);var $r={},dO=se,yO=V,vO="[object Boolean]";function gO(r){return r===!0||r===!1||yO(r)&&dO(r)==vO}var _O=gO;Object.defineProperty($r,"__esModule",{value:!0}),$r.Bool=void 0;var mO=_O,wO=ku(mO),ju=ce,bO=M,$O=ku(bO);function ku(r){return r&&r.__esModule?r:{default:r}}var AO=$r.Bool={read:function(e){var t=ju.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 ju.Int.write(n,t)},isValid:function(e){return(0,wO.default)(e)}};(0,$O.default)(AO);var At={},EO=se,OO=U,SO=V,IO="[object String]";function PO(r){return typeof r=="string"||!OO(r)&&SO(r)&&EO(r)==IO}var qu=PO;Object.defineProperty(At,"__esModule",{value:!0}),At.String=void 0;var TO=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=qu,Gu=li(xO),RO=U,FO=li(RO),Wu=ce,MO=Te,Vu=Pe,DO=M,BO=li(DO);function li(r){return r&&r.__esModule?r:{default:r}}function NO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var UO=At.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MO.UnsignedInt.MAX_VALUE;NO(this,r),this._maxLength=e}return TO(r,[{key:"read",value:function(t){var n=Wu.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,Vu.calculatePadding)(n),a=t.slice(n);return(0,Vu.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,Gu.default)(t)?i=y.from(t,"utf8"):i=y.from(t),Wu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Gu.default)(t))n=y.from(t,"utf8");else if((0,FO.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,BO.default)(UO.prototype);var Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.Opaque=void 0;var CO=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}}(),Hu=Pe,LO=M,jO=kO(LO);function kO(r){return r&&r.__esModule?r:{default:r}}function qO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GO=Et.Opaque=function(){function r(e){qO(this,r),this._length=e,this._padding=(0,Hu.calculatePadding)(e)}return CO(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Hu.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,jO.default)(GO.prototype);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.VarOpaque=void 0;var WO=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}}(),zu=ce,VO=Te,Xu=Pe,HO=M,zO=XO(HO);function XO(r){return r&&r.__esModule?r:{default:r}}function YO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var KO=Ot.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VO.UnsignedInt.MAX_VALUE;YO(this,r),this._maxLength=e}return WO(r,[{key:"read",value:function(t){var n=zu.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,Xu.calculatePadding)(n),a=t.slice(n);return(0,Xu.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));zu.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,zO.default)(KO.prototype);var St={},xe={exports:{}},ZO=dr;function JO(r){return typeof r=="function"?r:ZO}var Yu=JO,QO=Bn,eS=ai,rS=Yu,tS=U;function nS(r,e){var t=tS(r)?QO:eS;return t(r,rS(e))}var iS=nS;(function(r){r.exports=iS})(xe);var aS=/\s/;function oS(r){for(var e=r.length;e--&&aS.test(r.charAt(e)););return e}var uS=oS,sS=uS,fS=/^\s+/;function cS(r){return r&&r.slice(0,sS(r)+1).replace(fS,"")}var lS=cS,pS=lS,Ku=fe,hS=ct,Zu=0/0,dS=/^[-+]0x[0-9a-f]+$/i,yS=/^0b[01]+$/i,vS=/^0o[0-7]+$/i,gS=parseInt;function _S(r){if(typeof r=="number")return r;if(hS(r))return Zu;if(Ku(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Ku(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=pS(r);var t=yS.test(r);return t||vS.test(r)?gS(r.slice(2),t?2:8):dS.test(r)?Zu:+r}var mS=_S,wS=mS,Ju=1/0,bS=17976931348623157e292;function $S(r){if(!r)return r===0?r:0;if(r=wS(r),r===Ju||r===-Ju){var e=r<0?-1:1;return e*bS}return r===r?r:0}var AS=$S,ES=AS;function OS(r){var e=ES(r),t=e%1;return e===e?t?e-t:e:0}var Qu=OS,SS=Ka,IS=Yu,PS=Qu,TS=9007199254740991,pi=4294967295,xS=Math.min;function RS(r,e){if(r=PS(r),r<1||r>TS)return[];var t=pi,n=xS(r,pi);e=IS(e),r-=pi;for(var i=SS(n,e);++t<r;)e(t);return i}var es=RS;Object.defineProperty(St,"__esModule",{value:!0}),St.Array=void 0;var FS=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}}(),MS=si,DS=Ar(MS),BS=xe.exports,NS=Ar(BS),US=es,CS=Ar(US),LS=U,rs=Ar(LS),jS=M,kS=Ar(jS);function Ar(r){return r&&r.__esModule?r:{default:r}}function qS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GS=St.Array=function(){function r(e,t){qS(this,r),this._childType=e,this._length=t}return FS(r,[{key:"read",value:function(t){var n=this;return(0,CS.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,rs.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,NS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,rs.default)(t)||t.length!==this._length?!1:(0,DS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,kS.default)(GS.prototype);var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.VarArray=void 0;var WS=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}}(),VS=si,HS=Er(VS),zS=xe.exports,XS=Er(zS),YS=es,KS=Er(YS),ZS=U,ts=Er(ZS),JS=Te,ns=ce,QS=M,e2=Er(QS);function Er(r){return r&&r.__esModule?r:{default:r}}function r2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var t2=It.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JS.UnsignedInt.MAX_VALUE;r2(this,r),this._childType=e,this._maxLength=t}return WS(r,[{key:"read",value:function(t){var n=this,i=ns.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,KS.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ts.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));ns.Int.write(t.length,n),(0,XS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ts.default)(t)||t.length>this._maxLength?!1:(0,HS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,e2.default)(t2.prototype);var Pt={};function n2(r){return r===null}var i2=n2;function a2(r){return r===void 0}var Or=a2;Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.Option=void 0;var o2=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}}(),u2=i2,is=hi(u2),s2=Or,as=hi(s2),os=$r,f2=M,c2=hi(f2);function hi(r){return r&&r.__esModule?r:{default:r}}function l2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var p2=Pt.Option=function(){function r(e){l2(this,r),this._childType=e}return o2(r,[{key:"read",value:function(t){if(os.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,is.default)(t)||(0,as.default)(t));os.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,is.default)(t)||(0,as.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,c2.default)(p2.prototype);var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Void=void 0;var h2=Or,us=ss(h2),d2=M,y2=ss(d2);function ss(r){return r&&r.__esModule?r:{default:r}}var v2=Sr.Void={read:function(){},write:function(e){if(!(0,us.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,us.default)(e)}};(0,y2.default)(v2);var Tt={},g2=Qr;function _2(r,e){return g2(e,function(t){return r[t]})}var m2=_2,w2=m2,b2=Xe;function $2(r){return r==null?[]:w2(r,b2(r))}var A2=$2;Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Enum=void 0;var E2=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}}(),O2=xe.exports,S2=di(O2),I2=A2,P2=di(I2),fs=ce,T2=M,x2=di(T2);function di(r){return r&&r.__esModule?r:{default:r}}function R2(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 F2(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 cs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var M2=Tt.Enum=function(){function r(e,t){cs(this,r),this.name=e,this.value=t}return E2(r,null,[{key:"read",value:function(t){var n=fs.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);fs.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,P2.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){F2(s,o);function s(){return cs(this,s),R2(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,S2.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,x2.default)(M2);var xt={},D2=ai,B2=pr;function N2(r,e){var t=-1,n=B2(r)?Array(r.length):[];return D2(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var U2=N2,C2=Qr,L2=Eu,j2=U2,k2=U;function q2(r,e){var t=k2(r)?C2:j2;return t(r,L2(e))}var G2=q2;function W2(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 V2=W2,Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});var H2=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 z2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Ir.Reference=function(){function r(){z2(this,r)}return H2(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(xt,"__esModule",{value:!0}),xt.Struct=void 0;var Rt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.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")}}(),X2=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}}(),Y2=xe.exports,ls=Pr(Y2),K2=G2,Z2=Pr(K2),J2=Or,Q2=Pr(J2),eI=V2,rI=Pr(eI),tI=Ir,nI=M,iI=Pr(nI);function Pr(r){return r&&r.__esModule?r:{default:r}}function aI(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 oI(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 ps(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var uI=xt.Struct=function(){function r(e){ps(this,r),this._attributes=e||{}}return X2(r,null,[{key:"read",value:function(t){var n=(0,Z2.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,rI.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,ls.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){oI(s,o);function s(){return ps(this,s),aI(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Rt(o,2),f=s[0],c=s[1];return c instanceof tI.Reference&&(c=c.resolve(t)),[f,c]}),(0,ls.default)(a._fields,function(o){var s=Rt(o,1),f=s[0];a.prototype[f]=sI(f)}),a}}]),r}();(0,iI.default)(uI);function sI(r){return function(t){return(0,Q2.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Union=void 0;var fI=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.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")}}(),cI=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}}(),lI=xe.exports,Mt=Bt(lI),pI=Or,hs=Bt(pI),hI=qu,ds=Bt(hI),Dt=Sr,yi=Ir,dI=M,yI=Bt(dI);function Bt(r){return r&&r.__esModule?r:{default:r}}function vI(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 gI(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 ys(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _I=Ft.Union=function(){function r(e,t){ys(this,r),this.set(e,t)}return cI(r,[{key:"set",value:function(t,n){(0,ds.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!==Dt.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===Dt.Void?Dt.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,hs.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(s){gI(f,s);function f(){return ys(this,f),vI(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof yi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Mt.default)(i.arms,function(s,f){s instanceof yi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof yi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Mt.default)(i.switches,function(s){var f=fI(s,2),c=f[0],l=f[1];(0,ds.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,hs.default)(a._switchOn.values)||(0,Mt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Mt.default)(a._arms,function(s,f){s!==Dt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,yI.default)(_I),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ce;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=_t;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Te;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=mt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=wt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=bt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=$t;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=$r;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=At;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=Et;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=Ot;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=St;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=It;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=Pt;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var $=Sr;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=Tt;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var w=xt;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var A=Ft;Object.keys(A).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return A[h]}})})}(ii);var vs={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var E=0;E<g.length;E++){var S=g[E];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,g,E){return g&&m(v.prototype,g),E&&m(v,E),v}}(),t=Ir;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=xe.exports,o=l(a),s=ii,f=c(s);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 $=function(m){d(v,m);function v(g){u(this,v);var E=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return E.name=g,E}return e(v,[{key:"resolve",value:function(E){var S=E.definitions[this.name];return S.resolve(E)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g,E){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var B=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return B.childReference=g,B.length=E,B.variable=S,B}return e(v,[{key:"resolve",value:function(E){var S=this.childReference,B=this.length;return S instanceof t.Reference&&(S=S.resolve(E)),B instanceof t.Reference&&(B=B.resolve(E)),this.variable?new f.VarArray(S,B):new f.Array(S,B)}}]),v}(t.Reference),w=function(m){d(v,m);function v(g){u(this,v);var E=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return E.childReference=g,E.name=g.name,E}return e(v,[{key:"resolve",value:function(E){var S=this.childReference;return S instanceof t.Reference&&(S=S.resolve(E)),new f.Option(S)}}]),v}(t.Reference),A=function(m){d(v,m);function v(g,E){u(this,v);var S=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return S.sizedType=g,S.length=E,S}return e(v,[{key:"resolve",value:function(E){var S=this.length;return S instanceof t.Reference&&(S=S.resolve(E)),new this.sizedType(S)}}]),v}(t.Reference),h=function(){function m(v,g,E){u(this,m),this.constructor=v,this.name=g,this.config=E}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 I(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,E){var S=new h(f.Enum.create,g,E);this.define(g,S)}},{key:"struct",value:function(g,E){var S=new h(f.Struct.create,g,E);this.define(g,S)}},{key:"union",value:function(g,E){var S=new h(f.Union.create,g,E);this.define(g,S)}},{key:"typedef",value:function(g,E){var S=new h(I,g,E);this.define(g,S)}},{key:"const",value:function(g,E){var S=new h(P,g,E);this.define(g,S)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(g){return new A(f.String,g)}},{key:"opaque",value:function(g){return new A(f.Opaque,g)}},{key:"varOpaque",value:function(g){return new A(f.VarOpaque,g)}},{key:"array",value:function(g,E){return new b(g,E)}},{key:"varArray",value:function(g,E){return new b(g,E,!0)}},{key:"option",value:function(g){return new w(g)}},{key:"define",value:function(g,E){if((0,i.default)(this._destination[g]))this._definitions[g]=E;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new $(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(E){E.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(vs),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ii;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=vs;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(iu);function mI(r){const e={variantId:le.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new le.BundleItem({collectionId:le.Uint64.fromString(n.collectionId.toString()),productId:le.Uint64.fromString(n.productId.toString()),variantId:le.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new le.BundleItemExt(0)})),ext:new le.BundleExt(0)},t=new le.Bundle(e);return le.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const le=iu.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")}})}),gs="/bundling-storefront-manager";function wI(){return Math.ceil(Date.now()/1e3)}async function bI(){try{const{timestamp:r}=await sr("get",`${gs}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),wI()}}async function $I(r){const e=ue(),t=await _s(r);if(t!==!0)throw new Error(t);const n=await bI(),i=mI({variantId:r.externalVariantId,version:n,items:r.selections.map(a=>({collectionId:a.collectionId,productId:a.externalProductId,variantId:a.externalVariantId,quantity:a.quantity,sku:""}))});try{const a=await sr("post",`${gs}/api/v1/bundles`,{data:{bundle:i},headers:{Origin:`https://${e.storeIdentifier}`}});if(!a.id||a.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(a)}`);return a.id}catch(a){throw new Error(`2: failed generating rb_id ${a}`)}}function AI(r,e){const t=ms(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Np(9)}:${r.externalProductId}`;return r.selections.map(i=>{const a={id:i.externalVariantId,quantity:i.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:r.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:i.collectionId}};return i.sellingPlan?a.selling_plan=i.sellingPlan:i.shippingIntervalFrequency&&(a.properties.shipping_interval_frequency=i.shippingIntervalFrequency,a.properties.shipping_interval_unit_type=i.shippingIntervalUnitType,a.id=`${i.discountedVariantId}`),a})}async function _s(r){try{return r?await tu(r.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const EI={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function ms(r){if(!r)return"No bundle defined.";if(r.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:t}=r.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||t){if(!e||!t)return"Shipping intervals do not match on selections.";{const n=EI[t];for(let i=0;i<r.selections.length;i++){const{shippingIntervalFrequency:a,shippingIntervalUnitType:o}=r.selections[i];if(a&&a!==e||o&&!n.includes(o))return"Shipping intervals do not match on selections."}}}return!0}async function OI(r,e){const{bundle_selection:t}=await O("get","/bundle_selections",{id:e},r);return t}function SI(r,e){return O("get","/bundle_selections",{query:e},r)}async function II(r,e){const{bundle_selection:t}=await O("post","/bundle_selections",{data:e},r);return t}async function PI(r,e,t){const{bundle_selection:n}=await O("put","/bundle_selections",{id:e,data:t},r);return n}function TI(r,e){return O("delete","/bundle_selections",{id:e},r)}var xI=Object.freeze({__proto__:null,getBundleId:$I,getDynamicBundleItems:AI,validateBundle:_s,validateDynamicBundle:ms,getBundleSelection:OI,listBundleSelections:SI,createBundleSelection:II,updateBundleSelection:PI,deleteBundleSelection:TI});async function RI(r,e,t){const{charge:n}=await O("get","/charges",{id:e,query:{include:t?.include}},r);return n}function FI(r,e){return O("get","/charges",{query:e},r)}async function MI(r,e,t){const{charge:n}=await O("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function DI(r,e){const{charge:t}=await O("post",`/charges/${e}/remove_discount`,{},r);return t}async function BI(r,e){const{charge:t}=await O("post",`/charges/${e}/skip`,{},r);return t}async function NI(r,e){const{charge:t}=await O("post",`/charges/${e}/unskip`,{},r);return t}async function UI(r,e){const{charge:t}=await O("post",`/charges/${e}/process`,{},r);return t}var CI=Object.freeze({__proto__:null,getCharge:RI,listCharges:FI,applyDiscountToCharge:MI,removeDiscountsFromCharge:DI,skipCharge:BI,unskipCharge:NI,processCharge:UI});async function LI(r,e){const{membership:t}=await O("get","/memberships",{id:e},r);return t}function jI(r,e){return O("get","/memberships",{query:e},r)}async function kI(r,e,t){const{membership:n}=await O("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function qI(r,e,t){const{membership:n}=await O("post",`/memberships/${e}/activate`,{data:t},r);return n}var GI=Object.freeze({__proto__:null,getMembership:LI,listMemberships:jI,cancelMembership:kI,activateMembership:qI});async function WI(r,e){const{metafield:t}=await O("post","/metafields",{data:{metafield:e}},r);return t}async function VI(r,e,t){const{metafield:n}=await O("put","/metafields",{id:e,data:{metafield:t}},r);return n}function HI(r,e){return O("delete","/metafields",{id:e},r)}var zI=Object.freeze({__proto__:null,createMetafield:WI,updateMetafield:VI,deleteMetafield:HI});async function XI(r,e){const{onetime:t}=await O("get","/onetimes",{id:e},r);return t}function YI(r,e){return O("get","/onetimes",{query:e},r)}async function KI(r,e){const{onetime:t}=await O("post","/onetimes",{data:e},r);return t}async function ZI(r,e,t){const{onetime:n}=await O("put","/onetimes",{id:e,data:t},r);return n}function JI(r,e){return O("delete","/onetimes",{id:e},r)}var QI=Object.freeze({__proto__:null,getOnetime:XI,listOnetimes:YI,createOnetime:KI,updateOnetime:ZI,deleteOnetime:JI});async function eP(r,e){const{order:t}=await O("get","/orders",{id:e},r);return t}function rP(r,e){return O("get","/orders",{query:e},r)}var tP=Object.freeze({__proto__:null,getOrder:eP,listOrders:rP});async function nP(r,e,t){const{payment_method:n}=await O("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function iP(r,e,t){const{payment_method:n}=await O("put","/payment_methods",{id:e,data:t},r);return n}function aP(r,e){return O("get","/payment_methods",{query:e},r)}var oP=Object.freeze({__proto__:null,getPaymentMethod:nP,updatePaymentMethod:iP,listPaymentMethods:aP});async function uP(r,e){const{plan:t}=await O("get","/plans",{id:e},r);return t}function sP(r,e){return O("get","/plans",{query:e},r)}var fP=Object.freeze({__proto__:null,getPlan:uP,listPlans:sP}),ws=co,cP=ws&&new ws,bs=cP,lP=dr,$s=bs,pP=$s?function(r,e){return $s.set(r,e),r}:lP,As=pP,hP=st,dP=fe;function yP(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=hP(r.prototype),n=r.apply(t,e);return dP(n)?n:t}}var Nt=yP,vP=Nt,gP=G,_P=1;function mP(r,e,t){var n=e&_P,i=vP(r);function a(){var o=this&&this!==gP&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}var wP=mP,bP=Math.max;function $P(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,c=bP(a-o,0),l=Array(f+c),u=!n;++s<f;)l[s]=e[s];for(;++i<o;)(u||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[s++]=r[i++];return l}var Es=$P,AP=Math.max;function EP(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,c=e.length,l=AP(a-s,0),u=Array(l+c),p=!n;++i<l;)u[i]=r[i];for(var d=i;++f<c;)u[d+f]=e[f];for(;++o<s;)(p||i<a)&&(u[d+t[o]]=r[i++]);return u}var Os=EP;function OP(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&++n;return n}var SP=OP;function IP(){}var vi=IP,PP=st,TP=vi,xP=4294967295;function Ut(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=xP,this.__views__=[]}Ut.prototype=PP(TP.prototype),Ut.prototype.constructor=Ut;var gi=Ut;function RP(){}var FP=RP,Ss=bs,MP=FP,DP=Ss?function(r){return Ss.get(r)}:MP,Is=DP,BP={},NP=BP,Ps=NP,UP=Object.prototype,CP=UP.hasOwnProperty;function LP(r){for(var e=r.name+"",t=Ps[e],n=CP.call(Ps,e)?t.length:0;n--;){var i=t[n],a=i.func;if(a==null||a==r)return i.name}return e}var jP=LP,kP=st,qP=vi;function Ct(r,e){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Ct.prototype=kP(qP.prototype),Ct.prototype.constructor=Ct;var Ts=Ct,GP=gi,WP=Ts,VP=kn;function HP(r){if(r instanceof GP)return r.clone();var e=new WP(r.__wrapped__,r.__chain__);return e.__actions__=VP(r.__actions__),e.__index__=r.__index__,e.__values__=r.__values__,e}var zP=HP,XP=gi,xs=Ts,YP=vi,KP=U,ZP=V,JP=zP,QP=Object.prototype,eT=QP.hasOwnProperty;function Lt(r){if(ZP(r)&&!KP(r)&&!(r instanceof XP)){if(r instanceof xs)return r;if(eT.call(r,"__wrapped__"))return JP(r)}return new xs(r)}Lt.prototype=YP.prototype,Lt.prototype.constructor=Lt;var rT=Lt,tT=gi,nT=Is,iT=jP,aT=rT;function oT(r){var e=iT(r),t=aT[e];if(typeof t!="function"||!(e in tT.prototype))return!1;if(r===t)return!0;var n=nT(t);return!!n&&r===n[0]}var uT=oT,sT=As,fT=Go,cT=fT(sT),Rs=cT,lT=/\{\n\/\* \[wrapped with (.+)\] \*/,pT=/,? & /;function hT(r){var e=r.match(lT);return e?e[1].split(pT):[]}var dT=hT,yT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function vT(r,e){var t=e.length;if(!t)return r;var n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(yT,`{
24
+ */(function(e,t){typeof CE=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(ne,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<=-f?e.MIN_VALUE:!p&&u+1>=f?e.MAX_VALUE:p&&u>=s?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.fromNumber(Math.pow(d,8)),b=e.ZERO,w=0;w<u.length;w+=8){var A=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+A),d);if(A<8){var I=e.fromNumber(Math.pow(d,A));b=b.multiply(I).add(e.fromNumber(h))}else b=b.multiply($),b=b.add(e.fromNumber(h))}return b.unsigned=p,b},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,s=o*o,f=s/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.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var b="";;){var w=p.divide($),A=p.subtract(w.multiply($)).toInt()>>>0,h=A.toString(u);if(p=w,p.isZero())return h+b;for(;h.length<6;)h="0"+h;b=""+h+b}},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,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,I=0,P=0,R=0,m=0;return m+=$+h,R+=m>>>16,m&=65535,R+=_+A,P+=R>>>16,R&=65535,P+=d+w,I+=P>>>16,P&=65535,I+=p+b,I&=65535,e.fromBits(R<<16|m,I<<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,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,I=0,P=0,R=0,m=0;return m+=$*h,R+=m>>>16,m&=65535,R+=_*h,P+=R>>>16,R&=65535,R+=$*A,P+=R>>>16,R&=65535,P+=d*h,I+=P>>>16,P&=65535,P+=_*A,I+=P>>>16,P&=65535,P+=$*w,I+=P>>>16,P&=65535,I+=p*h+d*A+_*w+$*b,I&=65535,e.fromBits(R<<16|m,I<<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 $=this.shiftRight(1);return p=$.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 b=Math.ceil(Math.log(p)/Math.LN2),w=b<=48?1:Math.pow(2,b-48),A=e.fromNumber(p),h=A.multiply(u);h.isNegative()||h.greaterThan(d);)p-=w,A=e.fromNumber(p,this.unsigned),h=A.multiply(u);A.isZero()&&(A=e.ONE),_=_.add(A),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})})(ci),Object.defineProperty(_t,"__esModule",{value:!0}),_t.Hyper=void 0;var LE=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}}(),xu=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)}},jE=ci.exports,gr=Ru(jE),kE=M,qE=Ru(kE);function Ru(r){return r&&r.__esModule?r:{default:r}}function GE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}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 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)}var _r=_t.Hyper=function(r){VE(e,r),LE(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=xu(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=xu(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 GE(this,e),WE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(gr.default);(0,qE.default)(_r),_r.MAX_VALUE=new _r(gr.default.MAX_VALUE.low,gr.default.MAX_VALUE.high),_r.MIN_VALUE=new _r(gr.default.MIN_VALUE.low,gr.default.MIN_VALUE.high);var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.UnsignedInt=void 0;var HE=dt,Fu=Mu(HE),zE=M,XE=Mu(zE);function Mu(r){return r&&r.__esModule?r:{default:r}}var mr=Te.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Fu.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,Fu.default)(e)||Math.floor(e)!==e?!1:e>=mr.MIN_VALUE&&e<=mr.MAX_VALUE}};mr.MAX_VALUE=Math.pow(2,32)-1,mr.MIN_VALUE=0,(0,XE.default)(mr);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.UnsignedHyper=void 0;var YE=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}}(),Du=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)}},KE=ci.exports,wr=Bu(KE),ZE=M,JE=Bu(ZE);function Bu(r){return r&&r.__esModule?r:{default:r}}function QE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function eO(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 rO(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=mt.UnsignedHyper=function(r){rO(e,r),YE(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=Du(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=Du(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 QE(this,e),eO(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(wr.default);(0,JE.default)(br),br.MAX_VALUE=new br(wr.default.MAX_UNSIGNED_VALUE.low,wr.default.MAX_UNSIGNED_VALUE.high),br.MIN_VALUE=new br(wr.default.MIN_VALUE.low,wr.default.MIN_VALUE.high);var wt={};Object.defineProperty(wt,"__esModule",{value:!0}),wt.Float=void 0;var tO=dt,Nu=Uu(tO),nO=M,iO=Uu(nO);function Uu(r){return r&&r.__esModule?r:{default:r}}var aO=wt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Nu.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Nu.default)(e)}};(0,iO.default)(aO);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.Double=void 0;var oO=dt,Cu=Lu(oO),uO=M,sO=Lu(uO);function Lu(r){return r&&r.__esModule?r:{default:r}}var fO=bt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,Cu.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,Cu.default)(e)}};(0,sO.default)(fO);var $t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.Quadruple=void 0;var cO=M,lO=pO(cO);function pO(r){return r&&r.__esModule?r:{default:r}}var hO=$t.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,lO.default)(hO);var $r={},dO=se,yO=V,vO="[object Boolean]";function gO(r){return r===!0||r===!1||yO(r)&&dO(r)==vO}var _O=gO;Object.defineProperty($r,"__esModule",{value:!0}),$r.Bool=void 0;var mO=_O,wO=ku(mO),ju=ce,bO=M,$O=ku(bO);function ku(r){return r&&r.__esModule?r:{default:r}}var AO=$r.Bool={read:function(e){var t=ju.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 ju.Int.write(n,t)},isValid:function(e){return(0,wO.default)(e)}};(0,$O.default)(AO);var At={},EO=se,OO=U,SO=V,IO="[object String]";function PO(r){return typeof r=="string"||!OO(r)&&SO(r)&&EO(r)==IO}var qu=PO;Object.defineProperty(At,"__esModule",{value:!0}),At.String=void 0;var TO=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=qu,Gu=li(xO),RO=U,FO=li(RO),Wu=ce,MO=Te,Vu=Pe,DO=M,BO=li(DO);function li(r){return r&&r.__esModule?r:{default:r}}function NO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var UO=At.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MO.UnsignedInt.MAX_VALUE;NO(this,r),this._maxLength=e}return TO(r,[{key:"read",value:function(t){var n=Wu.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,Vu.calculatePadding)(n),a=t.slice(n);return(0,Vu.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,Gu.default)(t)?i=y.from(t,"utf8"):i=y.from(t),Wu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Gu.default)(t))n=y.from(t,"utf8");else if((0,FO.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,BO.default)(UO.prototype);var Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.Opaque=void 0;var CO=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}}(),Hu=Pe,LO=M,jO=kO(LO);function kO(r){return r&&r.__esModule?r:{default:r}}function qO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GO=Et.Opaque=function(){function r(e){qO(this,r),this._length=e,this._padding=(0,Hu.calculatePadding)(e)}return CO(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Hu.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,jO.default)(GO.prototype);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.VarOpaque=void 0;var WO=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}}(),zu=ce,VO=Te,Xu=Pe,HO=M,zO=XO(HO);function XO(r){return r&&r.__esModule?r:{default:r}}function YO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var KO=Ot.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VO.UnsignedInt.MAX_VALUE;YO(this,r),this._maxLength=e}return WO(r,[{key:"read",value:function(t){var n=zu.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,Xu.calculatePadding)(n),a=t.slice(n);return(0,Xu.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));zu.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,zO.default)(KO.prototype);var St={},xe={exports:{}},ZO=dr;function JO(r){return typeof r=="function"?r:ZO}var Yu=JO,QO=Bn,eS=ai,rS=Yu,tS=U;function nS(r,e){var t=tS(r)?QO:eS;return t(r,rS(e))}var iS=nS;(function(r){r.exports=iS})(xe);var aS=/\s/;function oS(r){for(var e=r.length;e--&&aS.test(r.charAt(e)););return e}var uS=oS,sS=uS,fS=/^\s+/;function cS(r){return r&&r.slice(0,sS(r)+1).replace(fS,"")}var lS=cS,pS=lS,Ku=fe,hS=ct,Zu=0/0,dS=/^[-+]0x[0-9a-f]+$/i,yS=/^0b[01]+$/i,vS=/^0o[0-7]+$/i,gS=parseInt;function _S(r){if(typeof r=="number")return r;if(hS(r))return Zu;if(Ku(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Ku(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=pS(r);var t=yS.test(r);return t||vS.test(r)?gS(r.slice(2),t?2:8):dS.test(r)?Zu:+r}var mS=_S,wS=mS,Ju=1/0,bS=17976931348623157e292;function $S(r){if(!r)return r===0?r:0;if(r=wS(r),r===Ju||r===-Ju){var e=r<0?-1:1;return e*bS}return r===r?r:0}var AS=$S,ES=AS;function OS(r){var e=ES(r),t=e%1;return e===e?t?e-t:e:0}var Qu=OS,SS=Ka,IS=Yu,PS=Qu,TS=9007199254740991,pi=4294967295,xS=Math.min;function RS(r,e){if(r=PS(r),r<1||r>TS)return[];var t=pi,n=xS(r,pi);e=IS(e),r-=pi;for(var i=SS(n,e);++t<r;)e(t);return i}var es=RS;Object.defineProperty(St,"__esModule",{value:!0}),St.Array=void 0;var FS=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}}(),MS=si,DS=Ar(MS),BS=xe.exports,NS=Ar(BS),US=es,CS=Ar(US),LS=U,rs=Ar(LS),jS=M,kS=Ar(jS);function Ar(r){return r&&r.__esModule?r:{default:r}}function qS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GS=St.Array=function(){function r(e,t){qS(this,r),this._childType=e,this._length=t}return FS(r,[{key:"read",value:function(t){var n=this;return(0,CS.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,rs.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,NS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,rs.default)(t)||t.length!==this._length?!1:(0,DS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,kS.default)(GS.prototype);var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.VarArray=void 0;var WS=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}}(),VS=si,HS=Er(VS),zS=xe.exports,XS=Er(zS),YS=es,KS=Er(YS),ZS=U,ts=Er(ZS),JS=Te,ns=ce,QS=M,e2=Er(QS);function Er(r){return r&&r.__esModule?r:{default:r}}function r2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var t2=It.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JS.UnsignedInt.MAX_VALUE;r2(this,r),this._childType=e,this._maxLength=t}return WS(r,[{key:"read",value:function(t){var n=this,i=ns.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,KS.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ts.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));ns.Int.write(t.length,n),(0,XS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ts.default)(t)||t.length>this._maxLength?!1:(0,HS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,e2.default)(t2.prototype);var Pt={};function n2(r){return r===null}var i2=n2;function a2(r){return r===void 0}var Or=a2;Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.Option=void 0;var o2=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}}(),u2=i2,is=hi(u2),s2=Or,as=hi(s2),os=$r,f2=M,c2=hi(f2);function hi(r){return r&&r.__esModule?r:{default:r}}function l2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var p2=Pt.Option=function(){function r(e){l2(this,r),this._childType=e}return o2(r,[{key:"read",value:function(t){if(os.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,is.default)(t)||(0,as.default)(t));os.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,is.default)(t)||(0,as.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,c2.default)(p2.prototype);var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Void=void 0;var h2=Or,us=ss(h2),d2=M,y2=ss(d2);function ss(r){return r&&r.__esModule?r:{default:r}}var v2=Sr.Void={read:function(){},write:function(e){if(!(0,us.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,us.default)(e)}};(0,y2.default)(v2);var Tt={},g2=Qr;function _2(r,e){return g2(e,function(t){return r[t]})}var m2=_2,w2=m2,b2=Xe;function $2(r){return r==null?[]:w2(r,b2(r))}var A2=$2;Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Enum=void 0;var E2=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}}(),O2=xe.exports,S2=di(O2),I2=A2,P2=di(I2),fs=ce,T2=M,x2=di(T2);function di(r){return r&&r.__esModule?r:{default:r}}function R2(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 F2(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 cs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var M2=Tt.Enum=function(){function r(e,t){cs(this,r),this.name=e,this.value=t}return E2(r,null,[{key:"read",value:function(t){var n=fs.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);fs.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,P2.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){F2(s,o);function s(){return cs(this,s),R2(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,S2.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,x2.default)(M2);var xt={},D2=ai,B2=pr;function N2(r,e){var t=-1,n=B2(r)?Array(r.length):[];return D2(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var U2=N2,C2=Qr,L2=Eu,j2=U2,k2=U;function q2(r,e){var t=k2(r)?C2:j2;return t(r,L2(e))}var G2=q2;function W2(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 V2=W2,Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});var H2=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 z2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Ir.Reference=function(){function r(){z2(this,r)}return H2(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(xt,"__esModule",{value:!0}),xt.Struct=void 0;var Rt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.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")}}(),X2=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}}(),Y2=xe.exports,ls=Pr(Y2),K2=G2,Z2=Pr(K2),J2=Or,Q2=Pr(J2),eI=V2,rI=Pr(eI),tI=Ir,nI=M,iI=Pr(nI);function Pr(r){return r&&r.__esModule?r:{default:r}}function aI(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 oI(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 ps(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var uI=xt.Struct=function(){function r(e){ps(this,r),this._attributes=e||{}}return X2(r,null,[{key:"read",value:function(t){var n=(0,Z2.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,rI.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,ls.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){oI(s,o);function s(){return ps(this,s),aI(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Rt(o,2),f=s[0],c=s[1];return c instanceof tI.Reference&&(c=c.resolve(t)),[f,c]}),(0,ls.default)(a._fields,function(o){var s=Rt(o,1),f=s[0];a.prototype[f]=sI(f)}),a}}]),r}();(0,iI.default)(uI);function sI(r){return function(t){return(0,Q2.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Union=void 0;var fI=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.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")}}(),cI=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}}(),lI=xe.exports,Mt=Bt(lI),pI=Or,hs=Bt(pI),hI=qu,ds=Bt(hI),Dt=Sr,yi=Ir,dI=M,yI=Bt(dI);function Bt(r){return r&&r.__esModule?r:{default:r}}function vI(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 gI(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 ys(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _I=Ft.Union=function(){function r(e,t){ys(this,r),this.set(e,t)}return cI(r,[{key:"set",value:function(t,n){(0,ds.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!==Dt.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===Dt.Void?Dt.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,hs.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(s){gI(f,s);function f(){return ys(this,f),vI(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof yi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Mt.default)(i.arms,function(s,f){s instanceof yi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof yi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Mt.default)(i.switches,function(s){var f=fI(s,2),c=f[0],l=f[1];(0,ds.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,hs.default)(a._switchOn.values)||(0,Mt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Mt.default)(a._arms,function(s,f){s!==Dt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,yI.default)(_I),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ce;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=_t;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Te;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=mt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=wt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=bt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=$t;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=$r;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=At;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=Et;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=Ot;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=St;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=It;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=Pt;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var $=Sr;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=Tt;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var w=xt;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var A=Ft;Object.keys(A).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return A[h]}})})}(ii);var vs={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var O=0;O<g.length;O++){var S=g[O];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,g,O){return g&&m(v.prototype,g),O&&m(v,O),v}}(),t=Ir;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=xe.exports,o=l(a),s=ii,f=c(s);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 $=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.name=g,O}return e(v,[{key:"resolve",value:function(O){var S=O.definitions[this.name];return S.resolve(O)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g,O){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var B=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return B.childReference=g,B.length=O,B.variable=S,B}return e(v,[{key:"resolve",value:function(O){var S=this.childReference,B=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),B instanceof t.Reference&&(B=B.resolve(O)),this.variable?new f.VarArray(S,B):new f.Array(S,B)}}]),v}(t.Reference),w=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.childReference=g,O.name=g.name,O}return e(v,[{key:"resolve",value:function(O){var S=this.childReference;return S instanceof t.Reference&&(S=S.resolve(O)),new f.Option(S)}}]),v}(t.Reference),A=function(m){d(v,m);function v(g,O){u(this,v);var S=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return S.sizedType=g,S.length=O,S}return e(v,[{key:"resolve",value:function(O){var S=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),new this.sizedType(S)}}]),v}(t.Reference),h=function(){function m(v,g,O){u(this,m),this.constructor=v,this.name=g,this.config=O}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 I(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,O){var S=new h(f.Enum.create,g,O);this.define(g,S)}},{key:"struct",value:function(g,O){var S=new h(f.Struct.create,g,O);this.define(g,S)}},{key:"union",value:function(g,O){var S=new h(f.Union.create,g,O);this.define(g,S)}},{key:"typedef",value:function(g,O){var S=new h(I,g,O);this.define(g,S)}},{key:"const",value:function(g,O){var S=new h(P,g,O);this.define(g,S)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(g){return new A(f.String,g)}},{key:"opaque",value:function(g){return new A(f.Opaque,g)}},{key:"varOpaque",value:function(g){return new A(f.VarOpaque,g)}},{key:"array",value:function(g,O){return new b(g,O)}},{key:"varArray",value:function(g,O){return new b(g,O,!0)}},{key:"option",value:function(g){return new w(g)}},{key:"define",value:function(g,O){if((0,i.default)(this._destination[g]))this._definitions[g]=O;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new $(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(O){O.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(vs),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ii;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=vs;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(iu);function mI(r){const e={variantId:le.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new le.BundleItem({collectionId:le.Uint64.fromString(n.collectionId.toString()),productId:le.Uint64.fromString(n.productId.toString()),variantId:le.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new le.BundleItemExt(0)})),ext:new le.BundleExt(0)},t=new le.Bundle(e);return le.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const le=iu.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")}})}),gs="/bundling-storefront-manager";function wI(){return Math.ceil(Date.now()/1e3)}async function bI(){try{const{timestamp:r}=await sr("get",`${gs}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),wI()}}async function $I(r){const e=ue(),t=await _s(r);if(t!==!0)throw new Error(t);const n=await bI(),i=mI({variantId:r.externalVariantId,version:n,items:r.selections.map(a=>({collectionId:a.collectionId,productId:a.externalProductId,variantId:a.externalVariantId,quantity:a.quantity,sku:""}))});try{const a=await sr("post",`${gs}/api/v1/bundles`,{data:{bundle:i},headers:{Origin:`https://${e.storeIdentifier}`}});if(!a.id||a.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(a)}`);return a.id}catch(a){throw new Error(`2: failed generating rb_id ${a}`)}}function AI(r,e){const t=ms(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Np(9)}:${r.externalProductId}`;return r.selections.map(i=>{const a={id:i.externalVariantId,quantity:i.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:r.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:i.collectionId}};return i.sellingPlan?a.selling_plan=i.sellingPlan:i.shippingIntervalFrequency&&(a.properties.shipping_interval_frequency=i.shippingIntervalFrequency,a.properties.shipping_interval_unit_type=i.shippingIntervalUnitType,a.id=`${i.discountedVariantId}`),a})}async function _s(r){try{return r?await tu(r.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const EI={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function ms(r){if(!r)return"No bundle defined.";if(r.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:t}=r.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||t){if(!e||!t)return"Shipping intervals do not match on selections.";{const n=EI[t];for(let i=0;i<r.selections.length;i++){const{shippingIntervalFrequency:a,shippingIntervalUnitType:o}=r.selections[i];if(a&&a!==e||o&&!n.includes(o))return"Shipping intervals do not match on selections."}}}return!0}async function OI(r,e){const{bundle_selection:t}=await E("get","/bundle_selections",{id:e},r);return t}function SI(r,e){return E("get","/bundle_selections",{query:e},r)}async function II(r,e){const{bundle_selection:t}=await E("post","/bundle_selections",{data:e},r);return t}async function PI(r,e,t){const{bundle_selection:n}=await E("put","/bundle_selections",{id:e,data:t},r);return n}function TI(r,e){return E("delete","/bundle_selections",{id:e},r)}var xI=Object.freeze({__proto__:null,getBundleId:$I,getDynamicBundleItems:AI,validateBundle:_s,validateDynamicBundle:ms,getBundleSelection:OI,listBundleSelections:SI,createBundleSelection:II,updateBundleSelection:PI,deleteBundleSelection:TI});async function RI(r,e,t){const{charge:n}=await E("get","/charges",{id:e,query:{include:t?.include}},r);return n}function FI(r,e){return E("get","/charges",{query:e},r)}async function MI(r,e,t){const{charge:n}=await E("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function DI(r,e){const{charge:t}=await E("post",`/charges/${e}/remove_discount`,{},r);return t}async function BI(r,e){const{charge:t}=await E("post",`/charges/${e}/skip`,{},r);return t}async function NI(r,e){const{charge:t}=await E("post",`/charges/${e}/unskip`,{},r);return t}async function UI(r,e){const{charge:t}=await E("post",`/charges/${e}/process`,{},r);return t}var CI=Object.freeze({__proto__:null,getCharge:RI,listCharges:FI,applyDiscountToCharge:MI,removeDiscountsFromCharge:DI,skipCharge:BI,unskipCharge:NI,processCharge:UI});async function LI(r,e){const{membership:t}=await E("get","/memberships",{id:e},r);return t}function jI(r,e){return E("get","/memberships",{query:e},r)}async function kI(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function qI(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/activate`,{data:t},r);return n}async function GI(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/change`,{data:t},r);return n}var WI=Object.freeze({__proto__:null,getMembership:LI,listMemberships:jI,cancelMembership:kI,activateMembership:qI,changeMembership:GI});async function VI(r,e,t){const{membership_program:n}=await E("get","/membership_programs",{id:e,query:{include:t?.include}},r);return n}function HI(r,e){return E("get","/membership_programs",{query:e},r)}var zI=Object.freeze({__proto__:null,getMembershipProgram:VI,listMembershipPrograms:HI});async function XI(r,e){const{metafield:t}=await E("post","/metafields",{data:{metafield:e}},r);return t}async function YI(r,e,t){const{metafield:n}=await E("put","/metafields",{id:e,data:{metafield:t}},r);return n}function KI(r,e){return E("delete","/metafields",{id:e},r)}var ZI=Object.freeze({__proto__:null,createMetafield:XI,updateMetafield:YI,deleteMetafield:KI});async function JI(r,e){const{onetime:t}=await E("get","/onetimes",{id:e},r);return t}function QI(r,e){return E("get","/onetimes",{query:e},r)}async function eP(r,e){const{onetime:t}=await E("post","/onetimes",{data:e},r);return t}async function rP(r,e,t){const{onetime:n}=await E("put","/onetimes",{id:e,data:t},r);return n}function tP(r,e){return E("delete","/onetimes",{id:e},r)}var nP=Object.freeze({__proto__:null,getOnetime:JI,listOnetimes:QI,createOnetime:eP,updateOnetime:rP,deleteOnetime:tP});async function iP(r,e){const{order:t}=await E("get","/orders",{id:e},r);return t}function aP(r,e){return E("get","/orders",{query:e},r)}var oP=Object.freeze({__proto__:null,getOrder:iP,listOrders:aP});async function uP(r,e,t){const{payment_method:n}=await E("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function sP(r,e,t){const{payment_method:n}=await E("put","/payment_methods",{id:e,data:t},r);return n}function fP(r,e){return E("get","/payment_methods",{query:e},r)}var cP=Object.freeze({__proto__:null,getPaymentMethod:uP,updatePaymentMethod:sP,listPaymentMethods:fP});async function lP(r,e){const{plan:t}=await E("get","/plans",{id:e},r);return t}function pP(r,e){return E("get","/plans",{query:e},r)}var hP=Object.freeze({__proto__:null,getPlan:lP,listPlans:pP}),ws=co,dP=ws&&new ws,bs=dP,yP=dr,$s=bs,vP=$s?function(r,e){return $s.set(r,e),r}:yP,As=vP,gP=st,_P=fe;function mP(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=gP(r.prototype),n=r.apply(t,e);return _P(n)?n:t}}var Nt=mP,wP=Nt,bP=G,$P=1;function AP(r,e,t){var n=e&$P,i=wP(r);function a(){var o=this&&this!==bP&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}var EP=AP,OP=Math.max;function SP(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,c=OP(a-o,0),l=Array(f+c),u=!n;++s<f;)l[s]=e[s];for(;++i<o;)(u||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[s++]=r[i++];return l}var Es=SP,IP=Math.max;function PP(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,c=e.length,l=IP(a-s,0),u=Array(l+c),p=!n;++i<l;)u[i]=r[i];for(var d=i;++f<c;)u[d+f]=e[f];for(;++o<s;)(p||i<a)&&(u[d+t[o]]=r[i++]);return u}var Os=PP;function TP(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&++n;return n}var xP=TP;function RP(){}var vi=RP,FP=st,MP=vi,DP=4294967295;function Ut(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=DP,this.__views__=[]}Ut.prototype=FP(MP.prototype),Ut.prototype.constructor=Ut;var gi=Ut;function BP(){}var NP=BP,Ss=bs,UP=NP,CP=Ss?function(r){return Ss.get(r)}:UP,Is=CP,LP={},jP=LP,Ps=jP,kP=Object.prototype,qP=kP.hasOwnProperty;function GP(r){for(var e=r.name+"",t=Ps[e],n=qP.call(Ps,e)?t.length:0;n--;){var i=t[n],a=i.func;if(a==null||a==r)return i.name}return e}var WP=GP,VP=st,HP=vi;function Ct(r,e){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Ct.prototype=VP(HP.prototype),Ct.prototype.constructor=Ct;var Ts=Ct,zP=gi,XP=Ts,YP=kn;function KP(r){if(r instanceof zP)return r.clone();var e=new XP(r.__wrapped__,r.__chain__);return e.__actions__=YP(r.__actions__),e.__index__=r.__index__,e.__values__=r.__values__,e}var ZP=KP,JP=gi,xs=Ts,QP=vi,eT=U,rT=V,tT=ZP,nT=Object.prototype,iT=nT.hasOwnProperty;function Lt(r){if(rT(r)&&!eT(r)&&!(r instanceof JP)){if(r instanceof xs)return r;if(iT.call(r,"__wrapped__"))return tT(r)}return new xs(r)}Lt.prototype=QP.prototype,Lt.prototype.constructor=Lt;var aT=Lt,oT=gi,uT=Is,sT=WP,fT=aT;function cT(r){var e=sT(r),t=fT[e];if(typeof t!="function"||!(e in oT.prototype))return!1;if(r===t)return!0;var n=uT(t);return!!n&&r===n[0]}var lT=cT,pT=As,hT=Go,dT=hT(pT),Rs=dT,yT=/\{\n\/\* \[wrapped with (.+)\] \*/,vT=/,? & /;function gT(r){var e=r.match(yT);return e?e[1].split(vT):[]}var _T=gT,mT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function wT(r,e){var t=e.length;if(!t)return r;var n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(mT,`{
25
25
  /* [wrapped with `+e+`] */
26
- `)}var gT=vT;function _T(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}var mT=_T;function wT(r){return r!==r}var bT=wT;function $T(r,e,t){for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}var AT=$T,ET=mT,OT=bT,ST=AT;function IT(r,e,t){return e===e?ST(r,e,t):ET(r,OT,t)}var PT=IT,TT=PT;function xT(r,e){var t=r==null?0:r.length;return!!t&&TT(r,e,0)>-1}var RT=xT,FT=Bn,MT=RT,DT=1,BT=2,NT=8,UT=16,CT=32,LT=64,jT=128,kT=256,qT=512,GT=[["ary",jT],["bind",DT],["bindKey",BT],["curry",NT],["curryRight",UT],["flip",qT],["partial",CT],["partialRight",LT],["rearg",kT]];function WT(r,e){return FT(GT,function(t){var n="_."+t[0];e&t[1]&&!MT(r,n)&&r.push(n)}),r.sort()}var VT=WT,HT=dT,zT=gT,XT=ri,YT=VT;function KT(r,e,t){var n=e+"";return XT(r,zT(n,YT(HT(n),t)))}var Fs=KT,ZT=uT,JT=Rs,QT=Fs,ex=1,rx=2,tx=4,nx=8,Ms=32,Ds=64;function ix(r,e,t,n,i,a,o,s,f,c){var l=e&nx,u=l?o:void 0,p=l?void 0:o,d=l?a:void 0,_=l?void 0:a;e|=l?Ms:Ds,e&=~(l?Ds:Ms),e&tx||(e&=~(ex|rx));var $=[r,e,i,d,u,_,p,s,f,c],b=t.apply(void 0,$);return ZT(r)&&JT(b,$),b.placeholder=n,QT(b,r,e)}var Bs=ix;function ax(r){var e=r;return e.placeholder}var _i=ax,ox=kn,ux=at,sx=Math.min;function fx(r,e){for(var t=r.length,n=sx(e.length,t),i=ox(r);n--;){var a=e[n];r[n]=ux(a,t)?i[a]:void 0}return r}var cx=fx,Ns="__lodash_placeholder__";function lx(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===Ns)&&(r[t]=Ns,a[i++]=t)}return a}var jt=lx,px=Es,hx=Os,dx=SP,Us=Nt,yx=Bs,vx=_i,gx=cx,_x=jt,mx=G,wx=1,bx=2,$x=8,Ax=16,Ex=128,Ox=512;function Cs(r,e,t,n,i,a,o,s,f,c){var l=e&Ex,u=e&wx,p=e&bx,d=e&($x|Ax),_=e&Ox,$=p?void 0:Us(r);function b(){for(var w=arguments.length,A=Array(w),h=w;h--;)A[h]=arguments[h];if(d)var I=vx(b),P=dx(A,I);if(n&&(A=px(A,n,i,d)),a&&(A=hx(A,a,o,d)),w-=P,d&&w<c){var R=_x(A,I);return yx(r,e,Cs,b.placeholder,t,A,R,s,f,c-w)}var m=u?t:this,v=p?m[r]:r;return w=A.length,s?A=gx(A,s):_&&w>1&&A.reverse(),l&&f<w&&(A.length=f),this&&this!==mx&&this instanceof b&&(v=$||Us(v)),v.apply(m,A)}return b}var Ls=Cs,Sx=ei,Ix=Nt,Px=Ls,Tx=Bs,xx=_i,Rx=jt,Fx=G;function Mx(r,e,t){var n=Ix(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=xx(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:Rx(o,f);if(a-=c.length,a<t)return Tx(r,e,Px,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Fx&&this instanceof i?n:r;return Sx(l,this,o)}return i}var Dx=Mx,Bx=ei,Nx=Nt,Ux=G,Cx=1;function Lx(r,e,t,n){var i=e&Cx,a=Nx(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),p=this&&this!==Ux&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Bx(p,i?t:this,u)}return o}var jx=Lx,kx=Es,qx=Os,js=jt,ks="__lodash_placeholder__",mi=1,Gx=2,Wx=4,qs=8,Tr=128,Gs=256,Vx=Math.min;function Hx(r,e){var t=r[1],n=e[1],i=t|n,a=i<(mi|Gx|Tr),o=n==Tr&&t==qs||n==Tr&&t==Gs&&r[7].length<=e[8]||n==(Tr|Gs)&&e[7].length<=e[8]&&t==qs;if(!(a||o))return r;n&mi&&(r[2]=e[2],i|=t&mi?0:Wx);var s=e[3];if(s){var f=r[3];r[3]=f?kx(f,s,e[4]):s,r[4]=f?js(r[3],ks):e[4]}return s=e[5],s&&(f=r[5],r[5]=f?qx(f,s,e[6]):s,r[6]=f?js(r[5],ks):e[6]),s=e[7],s&&(r[7]=s),n&Tr&&(r[8]=r[8]==null?e[8]:Vx(r[8],e[8])),r[9]==null&&(r[9]=e[9]),r[0]=e[0],r[1]=i,r}var zx=Hx,Xx=As,Yx=wP,Kx=Dx,Zx=Ls,Jx=jx,Qx=Is,eR=zx,rR=Rs,tR=Fs,Ws=Qu,nR="Expected a function",Vs=1,iR=2,wi=8,bi=16,$i=32,Hs=64,zs=Math.max;function aR(r,e,t,n,i,a,o,s){var f=e&iR;if(!f&&typeof r!="function")throw new TypeError(nR);var c=n?n.length:0;if(c||(e&=~($i|Hs),n=i=void 0),o=o===void 0?o:zs(Ws(o),0),s=s===void 0?s:Ws(s),c-=i?i.length:0,e&Hs){var l=n,u=i;n=i=void 0}var p=f?void 0:Qx(r),d=[r,e,t,n,i,l,u,a,o,s];if(p&&eR(d,p),r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]===void 0?f?0:r.length:zs(d[9]-c,0),!s&&e&(wi|bi)&&(e&=~(wi|bi)),!e||e==Vs)var _=Yx(r,e,t);else e==wi||e==bi?_=Kx(r,e,s):(e==$i||e==(Vs|$i))&&!i.length?_=Jx(r,e,t,n):_=Zx.apply(void 0,d);var $=p?Xx:rR;return tR($(_,d),r,e)}var oR=aR,uR=ou,sR=oR,fR=_i,cR=jt,lR=32,Ai=uR(function(r,e){var t=cR(e,fR(Ai));return sR(r,lR,void 0,e,t)});Ai.placeholder={};var Xs=Ai,pR=Object.defineProperty,hR=Object.defineProperties,dR=Object.getOwnPropertyDescriptors,Ys=Object.getOwnPropertySymbols,yR=Object.prototype.hasOwnProperty,vR=Object.prototype.propertyIsEnumerable,Ks=(r,e,t)=>e in r?pR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zs=(r,e)=>{for(var t in e||(e={}))yR.call(e,t)&&Ks(r,t,e[t]);if(Ys)for(var t of Ys(e))vR.call(e,t)&&Ks(r,t,e[t]);return r},Js=(r,e)=>hR(r,dR(e));function gR(r,e){return Js(Zs({},ti(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${e.charge_interval_frequency}`,order_interval_frequency:`${e.order_interval_frequency}`,status:e.status?e.status.toUpperCase():void 0})}function _R(r,e){var t;return Js(Zs({},ti(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=e.external_variant_id)!=null&&t.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:e.charge_interval_frequency?`${e.charge_interval_frequency}`:void 0,order_interval_frequency:e.order_interval_frequency?`${e.order_interval_frequency}`:void 0,force_update:r})}function Qs(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:u,shopify_variant_id:p,has_queued_charges:d,is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:w,next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:I,order_interval_frequency:P,order_interval_unit:R,presentment_currency:m,price:v,product_title:g,properties:E,quantity:S,sku:B,sku_override:H,status:te,updated_at:X,variant_title:Re}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${p}`},has_queued_charges:Ho(d),is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:Ho(w),next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:I,order_interval_frequency:parseInt(P,10),order_interval_unit:R,presentment_currency:m,price:`${v}`,product_title:g??"",properties:E,quantity:S,sku:B,sku_override:H,status:te.toLowerCase(),updated_at:X,variant_title:Re}}async function mR(r,e,t){const{subscription:n}=await O("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function wR(r,e){return O("get","/subscriptions",{query:e},r)}async function bR(r,e,t){const{subscription:n}=await O("post","/subscriptions",{data:e,query:t},r);return n}async function $R(r,e,t,n){const{subscription:i}=await O("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function AR(r,e,t,n){const{subscription:i}=await O("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},r);return i}async function ER(r,e,t){const{subscription:n}=await O("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function OR(r,e,t,n){const{subscription:i}=await O("post",`/subscriptions/${e}/cancel`,{data:t,query:n},r);return i}async function SR(r,e,t){const{subscription:n}=await O("post",`/subscriptions/${e}/activate`,{query:t},r);return n}async function IR(r,e,t){const{charge:n}=await O("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}async function PR(r,e){const t=e.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=r;if(!n)throw new Error("No customerId in session.");const i=e[0].address_id;if(!e.every(f=>f.address_id===i))throw new Error("All subscriptions must have the same address_id.");const a=Xs(gR,n),o=e.map(a),{subscriptions:s}=await O("post",`/addresses/${i}/subscriptions-bulk`,{data:{subscriptions:o},headers:{"X-Recharge-Version":"2021-01"}},r);return s.map(Qs)}async function TR(r,e,t,n){const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=Xs(_R,!!(n!=null&&n.force_update)),s=t.map(o),{subscriptions:f}=await O("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s},headers:{"X-Recharge-Version":"2021-01"}},r);return f.map(Qs)}var xR=Object.freeze({__proto__:null,getSubscription:mR,listSubscriptions:wR,createSubscription:bR,updateSubscription:$R,updateSubscriptionChargeDate:AR,updateSubscriptionAddress:ER,cancelSubscription:OR,activateSubscription:SR,skipSubscriptionCharge:IR,createSubscriptions:PR,updateSubscriptions:TR});async function RR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function FR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("put","/customers",{id:t,data:e},r);return n}async function MR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await O("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}async function DR(r){return await O("get","/portal_access",{},r)}var BR=Object.freeze({__proto__:null,getCustomer:RR,updateCustomer:FR,getDeliverySchedule:MR,getCustomerPortalAccess:DR});const NR={get(r,e){return z("get",r,e)},post(r,e){return z("post",r,e)},put(r,e){return z("put",r,e)},delete(r,e){return z("delete",r,e)}};function UR(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 CR(r={}){const e=r;fp({storeIdentifier:UR(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),nu()}const ef={init:CR,api:NR,address:Pp,auth:Bp,bundle:xI,charge:CI,cdn:d1,customer:BR,membership:GI,metafield:zI,onetime:QI,order:tP,paymentMethod:oP,plan:fP,subscription:xR};try{ef.init()}catch{}return ef});
26
+ `)}var bT=wT;function $T(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}var AT=$T;function ET(r){return r!==r}var OT=ET;function ST(r,e,t){for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}var IT=ST,PT=AT,TT=OT,xT=IT;function RT(r,e,t){return e===e?xT(r,e,t):PT(r,TT,t)}var FT=RT,MT=FT;function DT(r,e){var t=r==null?0:r.length;return!!t&&MT(r,e,0)>-1}var BT=DT,NT=Bn,UT=BT,CT=1,LT=2,jT=8,kT=16,qT=32,GT=64,WT=128,VT=256,HT=512,zT=[["ary",WT],["bind",CT],["bindKey",LT],["curry",jT],["curryRight",kT],["flip",HT],["partial",qT],["partialRight",GT],["rearg",VT]];function XT(r,e){return NT(zT,function(t){var n="_."+t[0];e&t[1]&&!UT(r,n)&&r.push(n)}),r.sort()}var YT=XT,KT=_T,ZT=bT,JT=ri,QT=YT;function ex(r,e,t){var n=e+"";return JT(r,ZT(n,QT(KT(n),t)))}var Fs=ex,rx=lT,tx=Rs,nx=Fs,ix=1,ax=2,ox=4,ux=8,Ms=32,Ds=64;function sx(r,e,t,n,i,a,o,s,f,c){var l=e&ux,u=l?o:void 0,p=l?void 0:o,d=l?a:void 0,_=l?void 0:a;e|=l?Ms:Ds,e&=~(l?Ds:Ms),e&ox||(e&=~(ix|ax));var $=[r,e,i,d,u,_,p,s,f,c],b=t.apply(void 0,$);return rx(r)&&tx(b,$),b.placeholder=n,nx(b,r,e)}var Bs=sx;function fx(r){var e=r;return e.placeholder}var _i=fx,cx=kn,lx=at,px=Math.min;function hx(r,e){for(var t=r.length,n=px(e.length,t),i=cx(r);n--;){var a=e[n];r[n]=lx(a,t)?i[a]:void 0}return r}var dx=hx,Ns="__lodash_placeholder__";function yx(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===Ns)&&(r[t]=Ns,a[i++]=t)}return a}var jt=yx,vx=Es,gx=Os,_x=xP,Us=Nt,mx=Bs,wx=_i,bx=dx,$x=jt,Ax=G,Ex=1,Ox=2,Sx=8,Ix=16,Px=128,Tx=512;function Cs(r,e,t,n,i,a,o,s,f,c){var l=e&Px,u=e&Ex,p=e&Ox,d=e&(Sx|Ix),_=e&Tx,$=p?void 0:Us(r);function b(){for(var w=arguments.length,A=Array(w),h=w;h--;)A[h]=arguments[h];if(d)var I=wx(b),P=_x(A,I);if(n&&(A=vx(A,n,i,d)),a&&(A=gx(A,a,o,d)),w-=P,d&&w<c){var R=$x(A,I);return mx(r,e,Cs,b.placeholder,t,A,R,s,f,c-w)}var m=u?t:this,v=p?m[r]:r;return w=A.length,s?A=bx(A,s):_&&w>1&&A.reverse(),l&&f<w&&(A.length=f),this&&this!==Ax&&this instanceof b&&(v=$||Us(v)),v.apply(m,A)}return b}var Ls=Cs,xx=ei,Rx=Nt,Fx=Ls,Mx=Bs,Dx=_i,Bx=jt,Nx=G;function Ux(r,e,t){var n=Rx(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=Dx(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:Bx(o,f);if(a-=c.length,a<t)return Mx(r,e,Fx,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Nx&&this instanceof i?n:r;return xx(l,this,o)}return i}var Cx=Ux,Lx=ei,jx=Nt,kx=G,qx=1;function Gx(r,e,t,n){var i=e&qx,a=jx(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),p=this&&this!==kx&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Lx(p,i?t:this,u)}return o}var Wx=Gx,Vx=Es,Hx=Os,js=jt,ks="__lodash_placeholder__",mi=1,zx=2,Xx=4,qs=8,Tr=128,Gs=256,Yx=Math.min;function Kx(r,e){var t=r[1],n=e[1],i=t|n,a=i<(mi|zx|Tr),o=n==Tr&&t==qs||n==Tr&&t==Gs&&r[7].length<=e[8]||n==(Tr|Gs)&&e[7].length<=e[8]&&t==qs;if(!(a||o))return r;n&mi&&(r[2]=e[2],i|=t&mi?0:Xx);var s=e[3];if(s){var f=r[3];r[3]=f?Vx(f,s,e[4]):s,r[4]=f?js(r[3],ks):e[4]}return s=e[5],s&&(f=r[5],r[5]=f?Hx(f,s,e[6]):s,r[6]=f?js(r[5],ks):e[6]),s=e[7],s&&(r[7]=s),n&Tr&&(r[8]=r[8]==null?e[8]:Yx(r[8],e[8])),r[9]==null&&(r[9]=e[9]),r[0]=e[0],r[1]=i,r}var Zx=Kx,Jx=As,Qx=EP,eR=Cx,rR=Ls,tR=Wx,nR=Is,iR=Zx,aR=Rs,oR=Fs,Ws=Qu,uR="Expected a function",Vs=1,sR=2,wi=8,bi=16,$i=32,Hs=64,zs=Math.max;function fR(r,e,t,n,i,a,o,s){var f=e&sR;if(!f&&typeof r!="function")throw new TypeError(uR);var c=n?n.length:0;if(c||(e&=~($i|Hs),n=i=void 0),o=o===void 0?o:zs(Ws(o),0),s=s===void 0?s:Ws(s),c-=i?i.length:0,e&Hs){var l=n,u=i;n=i=void 0}var p=f?void 0:nR(r),d=[r,e,t,n,i,l,u,a,o,s];if(p&&iR(d,p),r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]===void 0?f?0:r.length:zs(d[9]-c,0),!s&&e&(wi|bi)&&(e&=~(wi|bi)),!e||e==Vs)var _=Qx(r,e,t);else e==wi||e==bi?_=eR(r,e,s):(e==$i||e==(Vs|$i))&&!i.length?_=tR(r,e,t,n):_=rR.apply(void 0,d);var $=p?Jx:aR;return oR($(_,d),r,e)}var cR=fR,lR=ou,pR=cR,hR=_i,dR=jt,yR=32,Ai=lR(function(r,e){var t=dR(e,hR(Ai));return pR(r,yR,void 0,e,t)});Ai.placeholder={};var Xs=Ai,vR=Object.defineProperty,gR=Object.defineProperties,_R=Object.getOwnPropertyDescriptors,Ys=Object.getOwnPropertySymbols,mR=Object.prototype.hasOwnProperty,wR=Object.prototype.propertyIsEnumerable,Ks=(r,e,t)=>e in r?vR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zs=(r,e)=>{for(var t in e||(e={}))mR.call(e,t)&&Ks(r,t,e[t]);if(Ys)for(var t of Ys(e))wR.call(e,t)&&Ks(r,t,e[t]);return r},Js=(r,e)=>gR(r,_R(e));function bR(r,e){return Js(Zs({},ti(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${e.charge_interval_frequency}`,order_interval_frequency:`${e.order_interval_frequency}`,status:e.status?e.status.toUpperCase():void 0})}function $R(r,e){var t;return Js(Zs({},ti(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=e.external_variant_id)!=null&&t.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:e.charge_interval_frequency?`${e.charge_interval_frequency}`:void 0,order_interval_frequency:e.order_interval_frequency?`${e.order_interval_frequency}`:void 0,force_update:r})}function Qs(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:u,shopify_variant_id:p,has_queued_charges:d,is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:w,next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:I,order_interval_frequency:P,order_interval_unit:R,presentment_currency:m,price:v,product_title:g,properties:O,quantity:S,sku:B,sku_override:H,status:te,updated_at:X,variant_title:Re}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${p}`},has_queued_charges:Ho(d),is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:Ho(w),next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:I,order_interval_frequency:parseInt(P,10),order_interval_unit:R,presentment_currency:m,price:`${v}`,product_title:g??"",properties:O,quantity:S,sku:B,sku_override:H,status:te.toLowerCase(),updated_at:X,variant_title:Re}}async function AR(r,e,t){const{subscription:n}=await E("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function ER(r,e){return E("get","/subscriptions",{query:e},r)}async function OR(r,e,t){const{subscription:n}=await E("post","/subscriptions",{data:e,query:t},r);return n}async function SR(r,e,t,n){const{subscription:i}=await E("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function IR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},r);return i}async function PR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function TR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/cancel`,{data:t,query:n},r);return i}async function xR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/activate`,{query:t},r);return n}async function RR(r,e,t){const{charge:n}=await E("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}async function FR(r,e){const t=e.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=r;if(!n)throw new Error("No customerId in session.");const i=e[0].address_id;if(!e.every(f=>f.address_id===i))throw new Error("All subscriptions must have the same address_id.");const a=Xs(bR,n),o=e.map(a),{subscriptions:s}=await E("post",`/addresses/${i}/subscriptions-bulk`,{data:{subscriptions:o},headers:{"X-Recharge-Version":"2021-01"}},r);return s.map(Qs)}async function MR(r,e,t,n){const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=Xs($R,!!(n!=null&&n.force_update)),s=t.map(o),{subscriptions:f}=await E("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s},headers:{"X-Recharge-Version":"2021-01"}},r);return f.map(Qs)}var DR=Object.freeze({__proto__:null,getSubscription:AR,listSubscriptions:ER,createSubscription:OR,updateSubscription:SR,updateSubscriptionChargeDate:IR,updateSubscriptionAddress:PR,cancelSubscription:TR,activateSubscription:xR,skipSubscriptionCharge:RR,createSubscriptions:FR,updateSubscriptions:MR});async function BR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function NR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("put","/customers",{id:t,data:e},r);return n}async function UR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await E("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}async function CR(r){return await E("get","/portal_access",{},r)}var LR=Object.freeze({__proto__:null,getCustomer:BR,updateCustomer:NR,getDeliverySchedule:UR,getCustomerPortalAccess:CR});const jR={get(r,e){return z("get",r,e)},post(r,e){return z("post",r,e)},put(r,e){return z("put",r,e)},delete(r,e){return z("delete",r,e)}};function kR(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 qR(r={}){const e=r;fp({storeIdentifier:kR(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),nu()}const ef={init:qR,api:jR,address:Pp,auth:Bp,bundle:xI,charge:CI,cdn:d1,customer:LR,membership:WI,membershipProgram:zI,metafield:ZI,onetime:nP,order:oP,paymentMethod:cP,plan:hP,subscription:DR};try{ef.init()}catch{}return ef});
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": "1.0.1",
4
+ "version": "1.1.0",
5
5
  "author": "Recharge Inc.",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.js",