@verse8/platform 1.0.1 → 1.0.3

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.
@@ -1,4 +1,7 @@
1
- import { VXShopItem } from '../types/vxShop';
1
+ import { VXShopItem } from "../types/vxShop";
2
+ export interface UseVXShopOptions {
3
+ verseId?: string;
4
+ }
2
5
  export interface UseVXShopResult {
3
6
  items: VXShopItem[];
4
7
  isLoading: boolean;
@@ -7,4 +10,4 @@ export interface UseVXShopResult {
7
10
  buyItem: (productId: string) => void;
8
11
  refresh: () => Promise<void>;
9
12
  }
10
- export declare function useVXShop(): UseVXShopResult;
13
+ export declare function useVXShop(options?: UseVXShopOptions): UseVXShopResult;
@@ -4,16 +4,19 @@ exports.useVXShop = useVXShop;
4
4
  const react_1 = require("react");
5
5
  const vxShopStore_1 = require("../store/vxShopStore");
6
6
  const queryParams_1 = require("../utils/queryParams");
7
- function useVXShop() {
7
+ function useVXShop(options) {
8
8
  const [state, setState] = (0, react_1.useState)(() => vxShopStore_1.vxShopStore.getState());
9
9
  const initializedRef = (0, react_1.useRef)(false);
10
10
  (0, react_1.useEffect)(() => {
11
- const params = (0, queryParams_1.getVXShopParams)();
11
+ const params = (0, queryParams_1.getVXShopParams)(options?.verseId);
12
12
  vxShopStore_1.vxShopStore.setParams(params);
13
13
  const unsubscribe = vxShopStore_1.vxShopStore.subscribe(() => {
14
14
  setState(vxShopStore_1.vxShopStore.getState());
15
15
  });
16
- if (!initializedRef.current && params && state.items.length === 0 && !state.isLoading) {
16
+ if (!initializedRef.current &&
17
+ params &&
18
+ state.items.length === 0 &&
19
+ !state.isLoading) {
17
20
  initializedRef.current = true;
18
21
  vxShopStore_1.vxShopStore.refresh();
19
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useVXShop.js","sourceRoot":"","sources":["../../src/hooks/useVXShop.ts"],"names":[],"mappings":";;AAcA,8BA2CC;AAzDD,iCAAiE;AACjE,sDAAmD;AACnD,sDAAu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O,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,CAAC,SAAiB,EAAE,EAAE;QAChD,yBAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QACrC,MAAM,yBAAW,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO;QACP,OAAO;QACP,OAAO;KACR,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { useVXShop } from './hooks/useVXShop';
2
- export type { UseVXShopResult } from './hooks/useVXShop';
3
- export type { VXShopItem, VXShopApiResponse, VXShopParams, PurchaseConstraints, } from './types/vxShop';
1
+ export { useVXShop } from "./hooks/useVXShop";
2
+ export type { UseVXShopResult } from "./hooks/useVXShop";
3
+ export type { VXShopItem, VXShopApiResponse, VXShopParams, PurchaseConstraints, } from "./types/vxShop";
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verse8/platform",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- import { VXShopItem, VXShopParams } from '../types/vxShop';
1
+ import { VXShopItem, VXShopParams } from "../types/vxShop";
2
2
  interface VXShopStoreState {
3
3
  items: VXShopItem[];
4
4
  isLoading: boolean;
@@ -2,7 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.vxShopStore = void 0;
4
4
  const throttle_1 = require("../utils/throttle");
5
- const API_BASE_URL = 'http://localhost:3003/v1/vx-shop/products';
5
+ const getApiBaseUrl = () => {
6
+ if (typeof window === "undefined") {
7
+ return "http://localhost:3003/v1/vx-shop/products";
8
+ }
9
+ const hostname = window.location.hostname;
10
+ if (hostname === "staging.agent8-games.verse8.io") {
11
+ return "https://staging.v8-meme-api.verse8.io/v1/vx-shop/products";
12
+ }
13
+ if (hostname === "agent8-games.verse8.io" ||
14
+ hostname.startsWith("agent8-container")) {
15
+ return "https://v8-meme-api.verse8.io/v1/vx-shop/products";
16
+ }
17
+ return "http://localhost:3003/v1/vx-shop/products";
18
+ };
19
+ const API_BASE_URL = getApiBaseUrl();
6
20
  const MAX_ITEMS = 100;
7
21
  const THROTTLE_DELAY = 5000;
8
22
  class VXShopStore {
@@ -37,7 +51,7 @@ class VXShopStore {
37
51
  }
38
52
  async fetchPage(page) {
39
53
  if (!this.state.params) {
40
- throw new Error('VXShop parameters (verseId, account) are not available in query string');
54
+ throw new Error("VXShop parameters are not available. Please provide verseId (via env VITE_AGENT8_VERSE or useVXShop options) and account (via query parameter)");
41
55
  }
42
56
  const { verseId, account } = this.state.params;
43
57
  const url = `${API_BASE_URL}?verseId=${encodeURIComponent(verseId)}&account=${encodeURIComponent(account)}&page=${page}&limit=20`;
@@ -63,7 +77,7 @@ class VXShopStore {
63
77
  async refresh() {
64
78
  if (!this.state.params) {
65
79
  this.setState({
66
- error: 'VXShop parameters (verseId, account) are not available in query string',
80
+ error: "VXShop parameters are not available. Please provide verseId (via env VITE_AGENT8_VERSE or useVXShop options) and account (via query parameter)",
67
81
  isLoading: false,
68
82
  });
69
83
  return;
@@ -75,7 +89,7 @@ class VXShopStore {
75
89
  this.setState({ items, isLoading: false, error: null });
76
90
  }
77
91
  catch (error) {
78
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
92
+ const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
79
93
  this.setState({ error: errorMessage, isLoading: false });
80
94
  }
81
95
  });
@@ -84,14 +98,14 @@ class VXShopStore {
84
98
  return this.state.items.find((item) => item.productId === productId);
85
99
  }
86
100
  buyItem(productId) {
87
- if (typeof window === 'undefined') {
88
- console.warn('buyItem can only be called in browser environment');
101
+ if (typeof window === "undefined") {
102
+ console.warn("buyItem can only be called in browser environment");
89
103
  return;
90
104
  }
91
105
  window.parent.postMessage({
92
- type: 'OPEN_VX_SHOP_DIALOG',
106
+ type: "OPEN_VX_SHOP_DIALOG",
93
107
  payload: { productId },
94
- }, '*');
108
+ }, "*");
95
109
  }
96
110
  }
97
111
  exports.vxShopStore = new VXShopStore();
@@ -1 +1 @@
1
- {"version":3,"file":"vxShopStore.js","sourceRoot":"","sources":["../../src/store/vxShopStore.ts"],"names":[],"mappings":";;;AACA,gDAAmD;AAEnD,MAAM,YAAY,GAAG,2CAA2C,CAAC;AACjE,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,cAAc,GAAG,IAAI,CAAC;AAU5B,MAAM,WAAW;IAAjB;QACU,UAAK,GAAqB;YAChC,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,IAAI;YACX,SAAS,EAAE,IAAI,GAAG,EAAE;YACpB,MAAM,EAAE,IAAI;SACb,CAAC;QAEM,mBAAc,GAAG,IAAA,yBAAc,EAAC,cAAc,CAAC,CAAC;IAqG1D,CAAC;IAnGQ,SAAS,CAAC,MAA2B;QAC1C,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAC7B,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,SAAS,CAAC,QAAoB;QACnC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACnC,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC,CAAC;IACJ,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C,CAAC;YAEhD,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;gBACzC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;gBACpE,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,OAAO,CAAC,SAAiB;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;IACvE,CAAC;IAEM,OAAO,CAAC,SAAiB;QAC9B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;YAClE,OAAO;QACT,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,WAAW,CACvB;YACE,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,EAAE,SAAS,EAAE;SACvB,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;CACF;AAGY,QAAA,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import { VXShopParams } from '../types/vxShop';
2
- export declare function getVXShopParams(): VXShopParams | null;
1
+ import { VXShopParams } from "../types/vxShop";
2
+ export declare function getVXShopParams(providedVerseId?: string): VXShopParams | null;
@@ -1,14 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getVXShopParams = getVXShopParams;
4
- function getVXShopParams() {
5
- if (typeof window === 'undefined') {
4
+ function getEnvVerseId() {
5
+ try {
6
+ return import.meta?.env?.VITE_AGENT8_VERSE;
7
+ }
8
+ catch {
9
+ return undefined;
10
+ }
11
+ }
12
+ function getVXShopParams(providedVerseId) {
13
+ if (typeof window === "undefined") {
6
14
  return null;
7
15
  }
8
16
  const params = new URLSearchParams(window.location.search);
9
- const verseId = params.get('verseId');
10
- const account = params.get('account');
11
- if (!verseId || !account) {
17
+ const account = params.get("account");
18
+ if (!account) {
19
+ return null;
20
+ }
21
+ const verseId = providedVerseId || getEnvVerseId() || params.get("verseId");
22
+ if (!verseId) {
12
23
  return null;
13
24
  }
14
25
  return { verseId, account };
@@ -1 +1 @@
1
- {"version":3,"file":"queryParams.js","sourceRoot":"","sources":["../../src/utils/queryParams.ts"],"names":[],"mappings":";;AAEA,0CAcC;AAdD,SAAgB,eAAe;IAC7B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAEtC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
1
+ {"version":3,"file":"queryParams.js","sourceRoot":"","sources":["../../src/utils/queryParams.ts"],"names":[],"mappings":";;AAYA,0CAoBC;AA9BD,SAAS,aAAa;IACpB,IAAI,CAAC;QAGH,OAAO,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,iBAAiB,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAgB,eAAe,CAAC,eAAwB;IACtD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAEtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,MAAM,OAAO,GAAG,eAAe,IAAI,aAAa,EAAE,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAE5E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verse8/platform",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/README.md DELETED
@@ -1,154 +0,0 @@
1
- # @verse8/platform
2
-
3
- VX Shop integration for React applications.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @verse8/platform
9
- ```
10
-
11
- ## Usage
12
-
13
- ### Prerequisites
14
-
15
- The URL must contain `verseId` and `account` query parameters:
16
- ```
17
- ?verseId=0x1aa61710bd56894cb0423830a163219f613fb636-1752298746506&account=0x1Aa61710Bd56894cb0423830A163219f613FB636
18
- ```
19
-
20
- ### Basic Usage
21
-
22
- ```tsx
23
- import { useVXShop } from "@verse8/platform";
24
-
25
- function MyComponent() {
26
- const { items, getItem, buyItem, refresh } = useVXShop();
27
-
28
- return (
29
- <div>
30
- <button onClick={refresh}>Refresh Shop</button>
31
-
32
- {items.map((item) => (
33
- <div key={item.id}>
34
- <h3>{item.name}</h3>
35
- <p>{item.description}</p>
36
- <p>Price: {item.price}</p>
37
- <p>Stock: {item.stock}</p>
38
-
39
- {item.purchasable ? (
40
- <button onClick={() => buyItem(item.productId)}>
41
- Buy
42
- </button>
43
- ) : (
44
- <p>{item.purchaseBlockReason}</p>
45
- )}
46
- </div>
47
- ))}
48
- </div>
49
- );
50
- }
51
- ```
52
-
53
- ### API Reference
54
-
55
- #### `useVXShop()`
56
-
57
- Returns an object with the following properties:
58
-
59
- - **`items`**: `VXShopItem[]` - Array of all shop items (automatically fetches all pages, max 100 items)
60
- - **`isLoading`**: `boolean` - Loading state
61
- - **`error`**: `string | null` - Error message if any
62
- - **`getItem(productId: string)`**: `VXShopItem | undefined` - Get a specific item by productId
63
- - **`buyItem(productId: string)`**: `void` - Open purchase dialog for the item
64
- - **`refresh()`**: `Promise<void>` - Manually refresh shop data
65
-
66
- #### `VXShopItem` Type
67
-
68
- ```typescript
69
- interface VXShopItem {
70
- id: number;
71
- verseId: string;
72
- productId: string;
73
- name: string;
74
- price: number;
75
- stock: number;
76
- imageUrl: string;
77
- description: string;
78
- metadata: string | null;
79
- purchasable: boolean;
80
- purchaseBlockReason?: string;
81
- remainingPurchaseQuantity: number | null;
82
- purchaseLimit: number | null;
83
- purchaseConstraints: PurchaseConstraints | null;
84
- }
85
- ```
86
-
87
- ### Features
88
-
89
- #### Shared State Management
90
- Multiple components using `useVXShop()` share the same data source. The API is called only once and all components receive updates.
91
-
92
- ```tsx
93
- // Both components will share the same shop data
94
- function ComponentA() {
95
- const { items } = useVXShop();
96
- // ...
97
- }
98
-
99
- function ComponentB() {
100
- const { items } = useVXShop();
101
- // ...
102
- }
103
- ```
104
-
105
- #### Automatic Initial Load
106
- The hook automatically calls `refresh()` on first mount if no data exists.
107
-
108
- #### Throttled Refresh
109
- API calls are throttled with a 5-second minimum interval. Multiple `refresh()` calls within 5 seconds will be batched into a single API request.
110
-
111
- #### Pagination Handling
112
- The hook automatically fetches all pages (up to 100 items total) from the paginated API.
113
-
114
- #### Purchase Integration
115
- The `buyItem()` function opens a purchase dialog by posting a message to the parent frame:
116
-
117
- ```javascript
118
- window.parent.postMessage({
119
- type: 'OPEN_VX_SHOP_DIALOG',
120
- payload: { productId: 'product-001' }
121
- }, '*');
122
- ```
123
-
124
- ## Development
125
-
126
- ### Build
127
-
128
- ```bash
129
- npm run build
130
- ```
131
-
132
- ### Publish
133
-
134
- ```bash
135
- npm run npm:patch
136
- ```
137
-
138
- ## API Configuration
139
-
140
- The shop API endpoint is currently set to:
141
- ```
142
- http://localhost:3003/v1/vx-shop/products
143
- ```
144
-
145
- The API response format:
146
- ```json
147
- {
148
- "items": [...],
149
- "total": 2,
150
- "page": 1,
151
- "limit": 20
152
- }
153
- ```
154
-
@@ -1 +0,0 @@
1
- {"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2021.full.d.ts","../node_modules/@types/react/global.d.ts","../node_modules/csstype/index.d.ts","../node_modules/@types/prop-types/index.d.ts","../node_modules/@types/react/index.d.ts","../src/types/vxshop.ts","../src/utils/throttle.ts","../src/store/vxshopstore.ts","../src/utils/queryparams.ts","../src/hooks/usevxshop.ts","../src/index.ts","../node_modules/@types/node/compatibility/disposable.d.ts","../node_modules/@types/node/compatibility/indexable.d.ts","../node_modules/@types/node/compatibility/iterators.d.ts","../node_modules/@types/node/compatibility/index.d.ts","../node_modules/@types/node/globals.typedarray.d.ts","../node_modules/@types/node/buffer.buffer.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/web-globals/abortcontroller.d.ts","../node_modules/@types/node/web-globals/domexception.d.ts","../node_modules/@types/node/web-globals/events.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/env-http-proxy-agent.d.ts","../node_modules/undici-types/retry-handler.d.ts","../node_modules/undici-types/retry-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/util.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/eventsource.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/web-globals/fetch.d.ts","../node_modules/@types/node/web-globals/navigator.d.ts","../node_modules/@types/node/web-globals/storage.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/inspector.generated.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/sea.d.ts","../node_modules/@types/node/sqlite.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/index.d.ts","../../../../../node_modules/@types/estree/index.d.ts","../../../../../node_modules/@types/acorn/index.d.ts","../../../../../node_modules/@types/d3-array/index.d.ts","../../../../../node_modules/@types/d3-selection/index.d.ts","../../../../../node_modules/@types/d3-axis/index.d.ts","../../../../../node_modules/@types/d3-brush/index.d.ts","../../../../../node_modules/@types/d3-chord/index.d.ts","../../../../../node_modules/@types/d3-color/index.d.ts","../../../../../node_modules/@types/geojson/index.d.ts","../../../../../node_modules/@types/d3-contour/index.d.ts","../../../../../node_modules/@types/d3-delaunay/index.d.ts","../../../../../node_modules/@types/d3-dispatch/index.d.ts","../../../../../node_modules/@types/d3-drag/index.d.ts","../../../../../node_modules/@types/d3-dsv/index.d.ts","../../../../../node_modules/@types/d3-ease/index.d.ts","../../../../../node_modules/@types/d3-fetch/index.d.ts","../../../../../node_modules/@types/d3-force/index.d.ts","../../../../../node_modules/@types/d3-format/index.d.ts","../../../../../node_modules/@types/d3-geo/index.d.ts","../../../../../node_modules/@types/d3-hierarchy/index.d.ts","../../../../../node_modules/@types/d3-interpolate/index.d.ts","../../../../../node_modules/@types/d3-path/index.d.ts","../../../../../node_modules/@types/d3-polygon/index.d.ts","../../../../../node_modules/@types/d3-quadtree/index.d.ts","../../../../../node_modules/@types/d3-random/index.d.ts","../../../../../node_modules/@types/d3-time/index.d.ts","../../../../../node_modules/@types/d3-scale/index.d.ts","../../../../../node_modules/@types/d3-scale-chromatic/index.d.ts","../../../../../node_modules/@types/d3-shape/index.d.ts","../../../../../node_modules/@types/d3-time-format/index.d.ts","../../../../../node_modules/@types/d3-timer/index.d.ts","../../../../../node_modules/@types/d3-transition/index.d.ts","../../../../../node_modules/@types/d3-zoom/index.d.ts","../../../../../node_modules/@types/d3/index.d.ts","../../../../../node_modules/@types/ms/index.d.ts","../../../../../node_modules/@types/debug/index.d.ts","../../../../../node_modules/@types/estree-jsx/index.d.ts","../../../../../node_modules/@types/unist/index.d.ts","../../../../../node_modules/@types/hast/index.d.ts","../../../../../node_modules/@types/katex/index.d.ts","../../../../../node_modules/@types/mdast/index.d.ts","../../../../../node_modules/@types/mdx/types.d.ts","../../../../../node_modules/@types/mdx/index.d.ts","../../../../../node_modules/@types/nlcst/index.d.ts","../../../../../node_modules/@types/react/global.d.ts","../../../../../node_modules/csstype/index.d.ts","../../../../../node_modules/@types/prop-types/index.d.ts","../../../../../node_modules/@types/scheduler/tracing.d.ts","../../../../../node_modules/@types/react/index.d.ts","../../../../../node_modules/@types/react-reconciler/index.d.ts","../../../../../node_modules/@types/scheduler/index.d.ts","../../../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../../../node_modules/@types/trusted-types/index.d.ts","../../../../../node_modules/@types/webxr/index.d.ts"],"fileIdsList":[[72,120,137,138,171,207],[72,120,137,138],[72,120,137,138,174,202],[72,120,137,138,173,179],[72,120,137,138,184],[72,120,137,138,179],[72,120,137,138,178],[72,120,137,138,196],[72,120,137,138,192],[72,120,137,138,174,191,202],[72,120,137,138,173,174,175,176,177,178,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203],[72,120,137,138,205],[72,120,137,138,208],[72,120,137,138,212,213],[72,120,137,138,219],[72,120,137,138,215,216,217,218],[72,120,137,138,222],[72,117,118,120,137,138],[72,119,120,137,138],[120,137,138],[72,120,125,137,138,155],[72,120,121,126,131,137,138,140,152,163],[72,120,121,122,131,137,138,140],[67,68,69,72,120,137,138],[72,120,123,137,138,164],[72,120,124,125,132,137,138,141],[72,120,125,137,138,152,160],[72,120,126,128,131,137,138,140],[72,119,120,127,137,138],[72,120,128,129,137,138],[72,120,130,131,137,138],[72,119,120,131,137,138],[72,120,131,132,133,137,138,152,163],[72,120,131,132,133,137,138,147,152,155],[72,113,120,128,131,134,137,138,140,152,163],[72,120,131,132,134,135,137,138,140,152,160,163],[72,120,134,136,137,138,152,160,163],[70,71,72,73,74,75,76,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],[72,120,131,137,138],[72,120,137,138,139,163],[72,120,128,131,137,138,140,152],[72,120,137,138,141],[72,120,137,138,142],[72,119,120,137,138,143],[72,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],[72,120,137,138,145],[72,120,137,138,146],[72,120,131,137,138,147,148],[72,120,137,138,147,149,164,166],[72,120,132,137,138],[72,120,131,137,138,152,153,155],[72,120,137,138,154,155],[72,120,137,138,152,153],[72,120,137,138,155],[72,120,137,138,156],[72,117,120,137,138,152,157],[72,120,131,137,138,158,159],[72,120,137,138,158,159],[72,120,125,137,138,140,152,160],[72,120,137,138,161],[72,120,137,138,140,162],[72,120,134,137,138,146,163],[72,120,125,137,138,164],[72,120,137,138,152,165],[72,120,137,138,139,166],[72,120,137,138,167],[72,113,120,137,138],[72,113,120,131,133,137,138,143,152,155,163,165,166,168],[72,120,137,138,152,169],[57,58,59,72,120,137,138],[72,85,89,120,137,138,163],[72,85,120,137,138,152,163],[72,80,120,137,138],[72,82,85,120,137,138,160,163],[72,120,137,138,140,160],[72,120,137,138,170],[72,80,120,137,138,170],[72,82,85,120,137,138,140,163],[72,77,78,81,84,120,131,137,138,152,163],[72,85,92,120,137,138],[72,77,83,120,137,138],[72,85,106,107,120,137,138],[72,81,85,120,137,138,155,163,170],[72,106,120,137,138,170],[72,79,80,120,137,138,170],[72,85,120,137,138],[72,79,80,81,82,83,84,85,86,87,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,108,109,110,111,112,120,137,138],[72,85,100,120,137,138],[72,85,92,93,120,137,138],[72,83,85,93,94,120,137,138],[72,84,120,137,138],[72,77,80,85,120,137,138],[72,85,89,93,94,120,137,138],[72,89,120,137,138],[72,83,85,88,120,137,138,163],[72,77,82,85,92,120,137,138],[72,120,137,138,152],[72,80,85,106,120,137,138,168,170],[60,61,63,64,72,120,137,138],[61,65,72,120,137,138],[61,62,72,120,137,138],[61,72,120,137,138]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a66df3ab5de5cfcda11538cffddd67ff6a174e003788e270914c1e0248483cf","impliedFormat":1},{"version":"eb5b19b86227ace1d29ea4cf81387279d04bb34051e944bc53df69f58914b788","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"87d9d29dbc745f182683f63187bf3d53fd8673e5fca38ad5eaab69798ed29fbc","impliedFormat":1},{"version":"7a3aa194cfd5919c4da251ef04ea051077e22702638d4edcb9579e9101653519","affectsGlobalScope":true,"impliedFormat":1},{"version":"ee9170cf3b447f459d30968f5874cda316d416a89a77d7702fe082ea23e03260","signature":"cc0fade20b7d367e6ed72df3583cacbff46fe7369cb61906658aeaa5c61f8105"},{"version":"83cf010df4d08ad42f112256c05fd4b3b611a2c1bfbc4b820ba995a086b3edc0","signature":"db2a697be8c4b480307c63fecf849290a9cdced92e7390fe7d00fe1c7794361b"},{"version":"042fb4a87278cde15a940b31ff6e71ec80944de66d10e564484c7c156d8f459f","signature":"1f43d79a6e10ed99ea462edbe9aa0dec699fdb1a2ae624d4acbe5cff9799d8d5"},{"version":"69536e09406b1ee690884793cf5ce7b02b8d27a4f05be820dce17bf20d9a810c","signature":"5b8a713975089032d18b275f917d33e0493997c707bcadb8393f34a62d18f572"},{"version":"f3d2a7ca619573be756d0ea21d4629e4f1a28f4bc2d984cf22223e6785e7caf1","signature":"d0822891cd076b13eb5dbf1e5389468576349ea6e818c38bd8d6f45027a235db"},{"version":"ce5f80bdd817d56627742ffc2ea814e81066ab64950eb7416a0b59c33515212d","signature":"b8d7cedd20e3ce9d66cd8c432e2f28ae0364f54746d63815a12d2618a0e16acc"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"2cbe0621042e2a68c7cbce5dfed3906a1862a16a7d496010636cdbdb91341c0f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"bb45cd435da536500f1d9692a9b49d0c570b763ccbf00473248b777f5c1f353b","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac39df6dfb9e284bb0c205b15f4d9a2b260f5bab5c85bf2fb97d0cdd509c06ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c959a391a75be9789b43c8468f71e3fa06488b4d691d5729dde1416dcd38225b","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"5ebe6f4cc3b803cbfc962bae0d954f9c80e5078ca41eb3f1de41d92e7193ef37","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"3777eb752cef9aa8dd35bb997145413310008aa54ec44766de81a7ad891526cd","impliedFormat":1},{"version":"e0c868a08451c879984ccf4d4e3c1240b3be15af8988d230214977a3a3dad4ce","impliedFormat":1},{"version":"469532350a366536390c6eb3bde6839ec5c81fe1227a6b7b6a70202954d70c40","impliedFormat":1},{"version":"17c9f569be89b4c3c17dc17a9fb7909b6bab34f73da5a9a02d160f502624e2e8","impliedFormat":1},{"version":"003df7b9a77eaeb7a524b795caeeb0576e624e78dea5e362b053cb96ae89132a","impliedFormat":1},{"version":"7ba17571f91993b87c12b5e4ecafe66b1a1e2467ac26fcb5b8cee900f6cf8ff4","impliedFormat":1},{"version":"6fc1a4f64372593767a9b7b774e9b3b92bf04e8785c3f9ea98973aa9f4bbe490","impliedFormat":1},{"version":"d30e67059f5c545c5f8f0cc328a36d2e03b8c4a091b4301bc1d6afb2b1491a3a","impliedFormat":1},{"version":"8b219399c6a743b7c526d4267800bd7c84cf8e27f51884c86ad032d662218a9d","impliedFormat":1},{"version":"bad6d83a581dbd97677b96ee3270a5e7d91b692d220b87aab53d63649e47b9ad","impliedFormat":1},{"version":"7f15c8d21ca2c062f4760ff3408e1e0ec235bad2ca4e2842d1da7fc76bb0b12f","impliedFormat":1},{"version":"54e79224429e911b5d6aeb3cf9097ec9fd0f140d5a1461bbdece3066b17c232c","impliedFormat":1},{"version":"e1b666b145865bc8d0d843134b21cf589c13beba05d333c7568e7c30309d933a","impliedFormat":1},{"version":"ff09b6fbdcf74d8af4e131b8866925c5e18d225540b9b19ce9485ca93e574d84","impliedFormat":1},{"version":"c836b5d8d84d990419548574fc037c923284df05803b098fe5ddaa49f88b898a","impliedFormat":1},{"version":"3a2b8ed9d6b687ab3e1eac3350c40b1624632f9e837afe8a4b5da295acf491cb","impliedFormat":1},{"version":"189266dd5f90a981910c70d7dfa05e2bca901a4f8a2680d7030c3abbfb5b1e23","impliedFormat":1},{"version":"5ec8dcf94c99d8f1ed7bb042cdfa4ef6a9810ca2f61d959be33bcaf3f309debe","impliedFormat":1},{"version":"a80e02af710bdac31f2d8308890ac4de4b6a221aafcbce808123bfc2903c5dc2","impliedFormat":1},{"version":"d5895252efa27a50f134a9b580aa61f7def5ab73d0a8071f9b5bf9a317c01c2d","impliedFormat":1},{"version":"2c378d9368abcd2eba8c29b294d40909845f68557bc0b38117e4f04fc56e5f9c","impliedFormat":1},{"version":"0f345151cece7be8d10df068b58983ea8bcbfead1b216f0734037a6c63d8af87","impliedFormat":1},{"version":"37fd7bde9c88aa142756d15aeba872498f45ad149e0d1e56f3bccc1af405c520","impliedFormat":1},{"version":"2a920fd01157f819cf0213edfb801c3fb970549228c316ce0a4b1885020bad35","impliedFormat":1},{"version":"56208c500dcb5f42be7e18e8cb578f257a1a89b94b3280c506818fed06391805","impliedFormat":1},{"version":"0c94c2e497e1b9bcfda66aea239d5d36cd980d12a6d9d59e66f4be1fa3da5d5a","impliedFormat":1},{"version":"a67774ceb500c681e1129b50a631fa210872bd4438fae55e5e8698bac7036b19","impliedFormat":1},{"version":"bb220eaac1677e2ad82ac4e7fd3e609a0c7b6f2d6d9c673a35068c97f9fcd5cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"dd8936160e41420264a9d5fade0ff95cc92cab56032a84c74a46b4c38e43121e","impliedFormat":1},{"version":"1f366bde16e0513fa7b64f87f86689c4d36efd85afce7eb24753e9c99b91c319","impliedFormat":1},{"version":"421c3f008f6ef4a5db2194d58a7b960ef6f33e94b033415649cd557be09ef619","impliedFormat":1},{"version":"57568ff84b8ba1a4f8c817141644b49252cc39ec7b899e4bfba0ec0557c910a0","impliedFormat":1},{"version":"e6f10f9a770dedf552ca0946eef3a3386b9bfb41509233a30fc8ca47c49db71c","impliedFormat":1},{"version":"fb893a0dfc3c9fb0f9ca93d0648694dd95f33cbad2c0f2c629f842981dfd4e2e","impliedFormat":1},{"version":"3eb11dbf3489064a47a2e1cf9d261b1f100ef0b3b50ffca6c44dd99d6dd81ac1","impliedFormat":1},{"version":"5d08a179b846f5ee674624b349ebebe2121c455e3a265dc93da4e8d9e89722b4","impliedFormat":1},{"version":"89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","impliedFormat":1},{"version":"79b4369233a12c6fa4a07301ecb7085802c98f3a77cf9ab97eee27e1656f82e6","impliedFormat":1},{"version":"8cbbb12bfb321de8bd58ba74329f683d82e4e0abb56d998c7f1eef2e764a74c8","impliedFormat":1},{"version":"d4a22007b481fe2a2e6bfd3a42c00cd62d41edb36d30fc4697df2692e9891fc8","impliedFormat":1},{"version":"f8a6bb79327f4a6afc63d28624654522fc80f7536efa7a617ef48200b7a5f673","impliedFormat":1},{"version":"8e0733c50eaac49b4e84954106acc144ec1a8019922d6afcde3762523a3634af","impliedFormat":1},{"version":"20e87d239740059866b5245e6ef6ae92e2d63cd0b63d39af3464b9e260dddce1","impliedFormat":1},{"version":"549df62b64a71004aee17685b445a8289013daf96246ce4d9b087d13d7a27a61","affectsGlobalScope":true,"impliedFormat":1},{"version":"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","impliedFormat":1},{"version":"6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","impliedFormat":1},{"version":"f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5","impliedFormat":1},{"version":"59112973598601bb6c1970c0dd5eee78f9a440d8ffb76534d8fcde15c59830bf","affectsGlobalScope":true,"impliedFormat":1},{"version":"247389ec5593d19a2784587be69ea6349e784578070db0b30ba717bec269db38","impliedFormat":1},{"version":"7ccce4adb23a87a044c257685613126b47160f6975b224cea5f6af36c7f37514","impliedFormat":1},{"version":"15fe687c59d62741b4494d5e623d497d55eb38966ecf5bea7f36e48fc3fbe15e","impliedFormat":1},{"version":"2c3b8be03577c98530ef9cb1a76e2c812636a871f367e9edf4c5f3ce702b77f8","affectsGlobalScope":true,"impliedFormat":1},{"version":"413124c6224387f1448d67ff5a0da3c43596cec5ac5199f2a228fcb678c69e89","affectsGlobalScope":true,"impliedFormat":1}],"root":[[61,66]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"outDir":"./","removeComments":true,"skipLibCheck":true,"sourceMap":true,"strict":true,"target":8},"referencedMap":[[172,1],[173,2],[175,3],[176,3],[177,2],[178,2],[180,4],[181,2],[182,2],[183,3],[184,2],[185,2],[186,5],[187,2],[188,2],[189,6],[190,2],[191,7],[192,2],[193,2],[194,2],[195,2],[198,2],[197,8],[174,2],[199,9],[200,2],[196,2],[201,2],[202,3],[203,10],[204,11],[206,12],[207,1],[171,2],[179,2],[209,13],[210,2],[211,13],[213,14],[212,2],[205,2],[214,13],[217,2],[220,15],[215,2],[219,16],[221,2],[218,2],[223,17],[222,2],[208,2],[224,2],[216,2],[117,18],[118,18],[119,19],[72,20],[120,21],[121,22],[122,23],[67,2],[70,24],[68,2],[69,2],[123,25],[124,26],[125,27],[126,28],[127,29],[128,30],[129,30],[130,31],[131,32],[132,33],[133,34],[73,2],[71,2],[134,35],[135,36],[136,37],[170,38],[137,39],[138,2],[139,40],[140,41],[141,42],[142,43],[143,44],[144,45],[145,46],[146,47],[147,48],[148,48],[149,49],[150,2],[151,50],[152,51],[154,52],[153,53],[155,54],[156,55],[157,56],[158,57],[159,58],[160,59],[161,60],[162,61],[163,62],[164,63],[165,64],[166,65],[167,66],[74,2],[75,2],[76,2],[114,67],[115,2],[116,2],[168,68],[169,69],[59,2],[57,2],[60,70],[58,2],[54,2],[55,2],[11,2],[9,2],[10,2],[15,2],[14,2],[2,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[22,2],[23,2],[3,2],[24,2],[25,2],[4,2],[26,2],[30,2],[27,2],[28,2],[29,2],[31,2],[32,2],[33,2],[5,2],[34,2],[35,2],[36,2],[37,2],[6,2],[41,2],[38,2],[39,2],[40,2],[42,2],[7,2],[43,2],[48,2],[49,2],[44,2],[45,2],[46,2],[47,2],[8,2],[56,2],[53,2],[50,2],[51,2],[52,2],[1,2],[13,2],[12,2],[92,71],[102,72],[91,71],[112,73],[83,74],[82,75],[111,76],[105,77],[110,78],[85,79],[99,80],[84,81],[108,82],[80,83],[79,76],[109,84],[81,85],[86,86],[87,2],[90,86],[77,2],[113,87],[103,88],[94,89],[95,90],[97,91],[93,92],[96,93],[106,76],[88,94],[89,95],[98,96],[78,97],[101,88],[100,86],[104,2],[107,98],[65,99],[66,100],[63,101],[61,2],[64,102],[62,2]],"version":"5.7.2"}
@@ -1,63 +0,0 @@
1
- import { useEffect, useState, useCallback, useRef } from "react";
2
- import { vxShopStore } from "../store/vxShopStore";
3
- import { getVXShopParams } from "../utils/queryParams";
4
- import { VXShopItem } from "../types/vxShop";
5
-
6
- export interface UseVXShopResult {
7
- items: VXShopItem[];
8
- isLoading: boolean;
9
- error: string | null;
10
- getItem: (productId: string) => VXShopItem | undefined;
11
- buyItem: (productId: string) => void;
12
- refresh: () => Promise<void>;
13
- }
14
-
15
- export function useVXShop(): UseVXShopResult {
16
- const [state, setState] = useState(() => vxShopStore.getState());
17
- const initializedRef = useRef(false);
18
-
19
- useEffect(() => {
20
- // 쿼리 파라미터 설정
21
- const params = getVXShopParams();
22
- vxShopStore.setParams(params);
23
-
24
- // 구독 설정
25
- const unsubscribe = vxShopStore.subscribe(() => {
26
- setState(vxShopStore.getState());
27
- });
28
-
29
- // 초기 데이터가 없고, 파라미터가 있으면 자동으로 refresh
30
- if (
31
- !initializedRef.current &&
32
- params &&
33
- state.items.length === 0 &&
34
- !state.isLoading
35
- ) {
36
- initializedRef.current = true;
37
- vxShopStore.refresh();
38
- }
39
-
40
- return unsubscribe;
41
- }, []);
42
-
43
- const getItem = useCallback((productId: string) => {
44
- return vxShopStore.getItem(productId);
45
- }, []);
46
-
47
- const buyItem = useCallback((productId: string) => {
48
- vxShopStore.buyItem(productId);
49
- }, []);
50
-
51
- const refresh = useCallback(async () => {
52
- await vxShopStore.refresh();
53
- }, []);
54
-
55
- return {
56
- items: state.items,
57
- isLoading: state.isLoading,
58
- error: state.error,
59
- getItem,
60
- buyItem,
61
- refresh,
62
- };
63
- }
package/src/index.ts DELETED
@@ -1,8 +0,0 @@
1
- export { useVXShop } from "./hooks/useVXShop";
2
- export type { UseVXShopResult } from "./hooks/useVXShop";
3
- export type {
4
- VXShopItem,
5
- VXShopApiResponse,
6
- VXShopParams,
7
- PurchaseConstraints,
8
- } from "./types/vxShop";
@@ -1,135 +0,0 @@
1
- import { VXShopItem, VXShopApiResponse, VXShopParams } from "../types/vxShop";
2
- import { createThrottle } from "../utils/throttle";
3
-
4
- const API_BASE_URL = "http://localhost:3003/v1/vx-shop/products";
5
- const MAX_ITEMS = 100;
6
- const THROTTLE_DELAY = 5000; // 5초
7
-
8
- interface VXShopStoreState {
9
- items: VXShopItem[];
10
- isLoading: boolean;
11
- error: string | null;
12
- listeners: Set<() => void>;
13
- params: VXShopParams | null;
14
- }
15
-
16
- class VXShopStore {
17
- private state: VXShopStoreState = {
18
- items: [],
19
- isLoading: false,
20
- error: null,
21
- listeners: new Set(),
22
- params: null,
23
- };
24
-
25
- private throttledFetch = createThrottle(THROTTLE_DELAY);
26
-
27
- public setParams(params: VXShopParams | null) {
28
- this.state.params = params;
29
- }
30
-
31
- public getState(): VXShopStoreState {
32
- return this.state;
33
- }
34
-
35
- public subscribe(listener: () => void) {
36
- this.state.listeners.add(listener);
37
- return () => {
38
- this.state.listeners.delete(listener);
39
- };
40
- }
41
-
42
- private notify() {
43
- this.state.listeners.forEach((listener) => listener());
44
- }
45
-
46
- private setState(updates: Partial<VXShopStoreState>) {
47
- this.state = { ...this.state, ...updates };
48
- this.notify();
49
- }
50
-
51
- private async fetchPage(page: number): Promise<VXShopApiResponse> {
52
- if (!this.state.params) {
53
- throw new Error(
54
- "VXShop parameters (verseId, account) are not available in query string"
55
- );
56
- }
57
-
58
- const { verseId, account } = this.state.params;
59
- const url = `${API_BASE_URL}?verseId=${encodeURIComponent(
60
- verseId
61
- )}&account=${encodeURIComponent(account)}&page=${page}&limit=20`;
62
-
63
- const response = await fetch(url);
64
-
65
- if (!response.ok) {
66
- throw new Error(`Failed to fetch VX Shop items: ${response.statusText}`);
67
- }
68
-
69
- return await response.json();
70
- }
71
-
72
- private async fetchAllItems(): Promise<VXShopItem[]> {
73
- const allItems: VXShopItem[] = [];
74
- let currentPage = 1;
75
- let hasMore = true;
76
-
77
- while (hasMore && allItems.length < MAX_ITEMS) {
78
- const data = await this.fetchPage(currentPage);
79
- allItems.push(...data.items);
80
-
81
- // 다음 페이지가 있는지 확인
82
- const totalPages = Math.ceil(data.total / data.limit);
83
- hasMore = currentPage < totalPages && allItems.length < MAX_ITEMS;
84
- currentPage++;
85
- }
86
-
87
- return allItems.slice(0, MAX_ITEMS);
88
- }
89
-
90
- public async refresh(): Promise<void> {
91
- if (!this.state.params) {
92
- this.setState({
93
- error:
94
- "VXShop parameters (verseId, account) are not available in query string",
95
- isLoading: false,
96
- });
97
- return;
98
- }
99
-
100
- await this.throttledFetch(async () => {
101
- this.setState({ isLoading: true, error: null });
102
-
103
- try {
104
- const items = await this.fetchAllItems();
105
- this.setState({ items, isLoading: false, error: null });
106
- } catch (error) {
107
- const errorMessage =
108
- error instanceof Error ? error.message : "Unknown error occurred";
109
- this.setState({ error: errorMessage, isLoading: false });
110
- }
111
- });
112
- }
113
-
114
- public getItem(productId: string): VXShopItem | undefined {
115
- return this.state.items.find((item) => item.productId === productId);
116
- }
117
-
118
- public buyItem(productId: string): void {
119
- if (typeof window === "undefined") {
120
- console.warn("buyItem can only be called in browser environment");
121
- return;
122
- }
123
-
124
- window.parent.postMessage(
125
- {
126
- type: "OPEN_VX_SHOP_DIALOG",
127
- payload: { productId },
128
- },
129
- "*"
130
- );
131
- }
132
- }
133
-
134
- // 싱글톤 인스턴스
135
- export const vxShopStore = new VXShopStore();
@@ -1,33 +0,0 @@
1
- export interface PurchaseConstraints {
2
- maxPurchasePerUser?: number;
3
- }
4
-
5
- export interface VXShopItem {
6
- id: number;
7
- verseId: string;
8
- productId: string;
9
- name: string;
10
- price: number;
11
- stock: number;
12
- imageUrl: string;
13
- description: string;
14
- metadata: string | null;
15
- purchasable: boolean;
16
- purchaseBlockReason?: string;
17
- remainingPurchaseQuantity: number | null;
18
- purchaseLimit: number | null;
19
- purchaseConstraints: PurchaseConstraints | null;
20
- }
21
-
22
- export interface VXShopApiResponse {
23
- items: VXShopItem[];
24
- total: number;
25
- page: number;
26
- limit: number;
27
- }
28
-
29
- export interface VXShopParams {
30
- verseId: string;
31
- account: string;
32
- }
33
-
@@ -1,18 +0,0 @@
1
- import { VXShopParams } from '../types/vxShop';
2
-
3
- export function getVXShopParams(): VXShopParams | null {
4
- if (typeof window === 'undefined') {
5
- return null;
6
- }
7
-
8
- const params = new URLSearchParams(window.location.search);
9
- const verseId = params.get('verseId');
10
- const account = params.get('account');
11
-
12
- if (!verseId || !account) {
13
- return null;
14
- }
15
-
16
- return { verseId, account };
17
- }
18
-
@@ -1,51 +0,0 @@
1
- export function createThrottle(delay: number) {
2
- let lastCallTime = 0;
3
- let timeoutId: NodeJS.Timeout | null = null;
4
- let pendingPromise: Promise<void> | null = null;
5
- let pendingResolve: (() => void) | null = null;
6
-
7
- return async function throttle<T>(fn: () => Promise<T>): Promise<T | void> {
8
- const now = Date.now();
9
- const timeSinceLastCall = now - lastCallTime;
10
-
11
- // 이미 pending 중인 요청이 있으면 기다림
12
- if (pendingPromise) {
13
- await pendingPromise;
14
- return;
15
- }
16
-
17
- // throttle 시간이 지났으면 즉시 실행
18
- if (timeSinceLastCall >= delay) {
19
- lastCallTime = now;
20
- return await fn();
21
- }
22
-
23
- // throttle 시간이 안 지났으면 대기
24
- const remainingTime = delay - timeSinceLastCall;
25
-
26
- pendingPromise = new Promise<void>((resolve) => {
27
- pendingResolve = resolve;
28
- });
29
-
30
- if (timeoutId) {
31
- clearTimeout(timeoutId);
32
- }
33
-
34
- return new Promise<T | void>((resolve) => {
35
- timeoutId = setTimeout(async () => {
36
- lastCallTime = Date.now();
37
- const result = await fn();
38
-
39
- if (pendingResolve) {
40
- pendingResolve();
41
- pendingPromise = null;
42
- pendingResolve = null;
43
- }
44
-
45
- resolve(result);
46
- timeoutId = null;
47
- }, remainingTime);
48
- });
49
- };
50
- }
51
-
package/tsconfig.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "module": "commonjs",
5
- "declaration": true,
6
- "removeComments": true,
7
- "emitDecoratorMetadata": true,
8
- "experimentalDecorators": true,
9
- "allowSyntheticDefaultImports": true,
10
- "target": "ES2021",
11
- "sourceMap": true,
12
- "outDir": "./dist",
13
- "baseUrl": "./",
14
- "incremental": true,
15
- "skipLibCheck": true,
16
- "jsx": "react",
17
- "esModuleInterop": true
18
- },
19
- "include": ["src/**/*", "src/*"]
20
- }
21
-