@agoric/orchestration 0.1.1-dev-a446a00.0 → 0.1.1-dev-ceec1d5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/package.json +15 -15
  2. package/src/chain-info.d.ts +5 -2
  3. package/src/chain-info.d.ts.map +1 -1
  4. package/src/chain-info.ts +3 -3
  5. package/src/cosmos-api.d.ts +2 -5
  6. package/src/cosmos-api.d.ts.map +1 -1
  7. package/src/cosmos-api.ts +1 -3
  8. package/src/examples/stakeAtom.contract.d.ts +32 -19
  9. package/src/examples/stakeAtom.contract.d.ts.map +1 -1
  10. package/src/examples/stakeAtom.contract.js +21 -24
  11. package/src/examples/stakeBld.contract.d.ts.map +1 -1
  12. package/src/examples/stakeBld.contract.js +1 -1
  13. package/src/examples/swapExample.contract.d.ts +17 -6
  14. package/src/examples/swapExample.contract.d.ts.map +1 -1
  15. package/src/examples/swapExample.contract.js +9 -6
  16. package/src/examples/unbondExample.contract.d.ts.map +1 -1
  17. package/src/examples/unbondExample.contract.js +9 -7
  18. package/src/exos/chainAccountKit.d.ts +6 -8
  19. package/src/exos/chainAccountKit.d.ts.map +1 -1
  20. package/src/exos/chainAccountKit.js +23 -24
  21. package/src/exos/{stakingAccountKit.d.ts → cosmosOrchestrationAccount.d.ts} +69 -24
  22. package/src/exos/cosmosOrchestrationAccount.d.ts.map +1 -0
  23. package/src/exos/{stakingAccountKit.js → cosmosOrchestrationAccount.js} +89 -34
  24. package/src/exos/icqConnectionKit.d.ts.map +1 -1
  25. package/src/exos/icqConnectionKit.js +6 -8
  26. package/src/exos/local-chain-account-kit.d.ts +1 -1
  27. package/src/exos/local-chain-account-kit.d.ts.map +1 -1
  28. package/src/exos/local-chain-account-kit.js +5 -3
  29. package/src/facade.d.ts +3 -3
  30. package/src/facade.d.ts.map +1 -1
  31. package/src/facade.js +95 -80
  32. package/src/orchestration-api.d.ts +1 -1
  33. package/src/orchestration-api.d.ts.map +1 -1
  34. package/src/orchestration-api.ts +1 -1
  35. package/src/proposals/start-stakeAtom.d.ts +27 -19
  36. package/src/proposals/start-stakeAtom.d.ts.map +1 -1
  37. package/src/utils/mockChainInfo.d.ts +1 -2
  38. package/src/utils/mockChainInfo.d.ts.map +1 -1
  39. package/src/utils/mockChainInfo.js +2 -10
  40. package/src/utils/orchestrationAccount.d.ts +10 -0
  41. package/src/utils/orchestrationAccount.d.ts.map +1 -0
  42. package/src/utils/orchestrationAccount.js +19 -0
  43. package/src/exos/stakingAccountKit.d.ts.map +0 -1
package/src/facade.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /** @file Orchestration service */
2
2
 
3
3
  import { E } from '@endo/far';
4
+ import { prepareCosmosOrchestrationAccount } from './exos/cosmosOrchestrationAccount.js';
4
5
 
5
6
  /**
6
7
  * @import {Zone} from '@agoric/zone';
@@ -8,12 +9,25 @@ import { E } from '@endo/far';
8
9
  * @import {LocalChain} from '@agoric/vats/src/localchain.js';
9
10
  * @import {Remote} from '@agoric/internal';
10
11
  * @import {OrchestrationService} from './service.js';
11
- * @import {Chain, ChainInfo, OrchestrationAccount, Orchestrator} from './types.js';
12
+ * @import {Chain, ChainInfo, CosmosChainInfo, KnownChains, OrchestrationAccount, Orchestrator} from './types.js';
12
13
  */
13
14
 
14
15
  /** @type {any} */
15
16
  const anyVal = null;
16
17
 
18
+ // FIXME should be configurable
19
+ const mockLocalChainInfo = {
20
+ allegedName: 'agoric',
21
+ allowedMessages: [],
22
+ allowedQueries: [],
23
+ chainId: 'agoriclocal',
24
+ connections: anyVal,
25
+ ibcHooksEnabled: true,
26
+ icaEnabled: true,
27
+ icqEnabled: true,
28
+ pfmEnabled: true,
29
+ };
30
+
17
31
  /**
18
32
  * @param {Remote<LocalChain>} localchain
19
33
  * @returns {Chain}
@@ -22,18 +36,10 @@ const makeLocalChainFacade = localchain => {
22
36
  return {
23
37
  /** @returns {Promise<ChainInfo>} */
24
38
  async getChainInfo() {
25
- return {
26
- allegedName: 'agoric',
27
- allowedMessages: [],
28
- allowedQueries: [],
29
- chainId: 'agoric-3',
30
- connections: anyVal,
31
- ibcHooksEnabled: true,
32
- icaEnabled: true,
33
- icqEnabled: true,
34
- pfmEnabled: true,
35
- };
39
+ return mockLocalChainInfo;
36
40
  },
41
+
42
+ // @ts-expect-error FIXME promise resolution through membrane
37
43
  async makeAccount() {
38
44
  const account = await E(localchain).makeAccount();
39
45
 
@@ -42,6 +48,30 @@ const makeLocalChainFacade = localchain => {
42
48
  console.log('deposit got', payment);
43
49
  return E(account).deposit(payment);
44
50
  },
51
+ async getAddress() {
52
+ const addressStr = await E(account).getAddress();
53
+ return {
54
+ address: addressStr,
55
+ chainId: mockLocalChainInfo.chainId,
56
+ addressEncoding: 'bech32',
57
+ };
58
+ },
59
+ getBalance(_denom) {
60
+ // FIXME map denom to Brand
61
+ const brand = /** @type {any} */ (null);
62
+ return E(account).getBalance(brand);
63
+ },
64
+ getBalances() {
65
+ throw new Error('not yet implemented');
66
+ },
67
+ send(toAccount, amount) {
68
+ // FIXME implement
69
+ console.log('send got', toAccount, amount);
70
+ },
71
+ transfer(amount, destination, opts) {
72
+ // FIXME implement
73
+ console.log('transfer got', amount, destination, opts);
74
+ },
45
75
  transferSteps(amount, msg) {
46
76
  console.log('transferSteps got', amount, msg);
47
77
  return Promise.resolve();
@@ -54,78 +84,57 @@ const makeLocalChainFacade = localchain => {
54
84
  /**
55
85
  * @template {string} C
56
86
  * @param {C} name
57
- * @returns {Chain}
87
+ * @param {object} io
88
+ * @param {Remote<OrchestrationService>} io.orchestration
89
+ * @param {Remote<TimerService>} io.timer
90
+ * @param {ZCF} io.zcf
91
+ * @param {Zone} io.zone
92
+ * @returns {Chain<C>}
58
93
  */
59
- const makeRemoteChainFacade = name => {
60
- const chainInfo = {
94
+ const makeRemoteChainFacade = (name, { orchestration, timer, zcf, zone }) => {
95
+ const chainInfo = /** @type {CosmosChainInfo} */ ({
61
96
  allegedName: name,
62
97
  chainId: 'fixme',
63
- };
98
+ connections: {},
99
+ icaEnabled: true,
100
+ icqEnabled: true,
101
+ pfmEnabled: true,
102
+ ibcHooksEnabled: true,
103
+ allowedMessages: [],
104
+ allowedQueries: [],
105
+ });
106
+ const makeRecorderKit = () => anyVal;
107
+ const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount(
108
+ zone.subZone(name),
109
+ makeRecorderKit,
110
+ zcf,
111
+ );
112
+
64
113
  return {
65
- /** @returns {Promise<ChainInfo>} */
66
- getChainInfo: async () => anyVal,
114
+ getChainInfo: async () => chainInfo,
67
115
  /** @returns {Promise<OrchestrationAccount<C>>} */
68
116
  makeAccount: async () => {
69
117
  console.log('makeAccount for', name);
70
- // @ts-expect-error fake yet
71
- return {
72
- delegate(validator, amount) {
73
- console.log('delegate got', validator, amount);
74
- return Promise.resolve();
75
- },
76
- deposit(payment) {
77
- console.log('deposit got', payment);
78
- return Promise.resolve();
79
- },
80
- getAddress() {
81
- return {
82
- chainId: chainInfo.chainId,
83
- address: 'an address!',
84
- addressEncoding: 'bech32',
85
- };
86
- },
87
- getBalance(_denom) {
88
- console.error('getBalance not yet implemented');
89
- return Promise.resolve({ denom: 'fixme', value: 0n });
90
- },
91
- getBalances() {
92
- throw new Error('not yet implemented');
93
- },
94
- getDelegations() {
95
- console.error('getDelegations not yet implemented');
96
- return [];
97
- },
98
- getRedelegations() {
99
- throw new Error('not yet implemented');
100
- },
101
- getUnbondingDelegations() {
102
- throw new Error('not yet implemented');
103
- },
104
- liquidStake() {
105
- console.error('liquidStake not yet implemented');
106
- return 0n;
107
- },
108
- send(toAccount, amount) {
109
- console.log('send got', toAccount, amount);
110
- return Promise.resolve();
111
- },
112
- transfer(amount, destination, memo) {
113
- console.log('transfer got', amount, destination, memo);
114
- return Promise.resolve();
115
- },
116
- transferSteps(amount, msg) {
117
- console.log('transferSteps got', amount, msg);
118
- return Promise.resolve();
119
- },
120
- undelegate(validator, amount) {
121
- console.log('undelegate got', validator, amount);
122
- return Promise.resolve();
123
- },
124
- withdraw(amount) {
125
- console.log('withdraw got', amount);
126
- return Promise.resolve();
127
- },
128
- };
118
+
119
+ // FIXME look up real values
120
+ const hostConnectionId = 'connection-1';
121
+ const controllerConnectionId = 'connection-2';
122
+
123
+ const icaAccount = await E(orchestration).makeAccount(
124
+ hostConnectionId,
125
+ controllerConnectionId,
126
+ );
127
+
128
+ const address = await E(icaAccount).getAddress();
129
+
130
+ // FIXME look up real values
131
+ const bondDenom = name;
132
+ return makeCosmosOrchestrationAccount(address, bondDenom, {
133
+ account: icaAccount,
134
+ storageNode: anyVal,
135
+ icqConnection: anyVal,
136
+ timer,
137
+ });
129
138
  },
130
139
  };
131
140
  };
@@ -133,10 +142,10 @@ const makeRemoteChainFacade = name => {
133
142
  /**
134
143
  * @param {{
135
144
  * zone: Zone;
136
- * timerService: Remote<TimerService> | null;
145
+ * timerService: Remote<TimerService>;
137
146
  * zcf: ZCF;
138
147
  * storageNode: Remote<StorageNode>;
139
- * orchestrationService: Remote<OrchestrationService> | null;
148
+ * orchestrationService: Remote<OrchestrationService>;
140
149
  * localchain: Remote<LocalChain>;
141
150
  * }} powers
142
151
  */
@@ -172,7 +181,13 @@ export const makeOrchestrationFacade = ({
172
181
  if (name === 'agoric') {
173
182
  return makeLocalChainFacade(localchain);
174
183
  }
175
- return makeRemoteChainFacade(name);
184
+
185
+ return makeRemoteChainFacade(name, {
186
+ orchestration: orchestrationService,
187
+ timer: timerService,
188
+ zcf,
189
+ zone,
190
+ });
176
191
  },
177
192
  makeLocalAccount() {
178
193
  return E(localchain).makeAccount();
@@ -128,7 +128,7 @@ export interface OrchestrationAccountI {
128
128
  * deposit payment from zoe to the account. For remote accounts,
129
129
  * an IBC Transfer will be executed to transfer funds there.
130
130
  */
131
- deposit: (payment: Payment) => Promise<void>;
131
+ deposit: (payment: Payment<'nat'>) => Promise<void>;
132
132
  }
133
133
  /**
134
134
  * Internal structure for TransferMsgs.
@@ -1 +1 @@
1
- {"version":3,"file":"orchestration-api.d.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AAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -170,7 +170,7 @@ export interface OrchestrationAccountI {
170
170
  * deposit payment from zoe to the account. For remote accounts,
171
171
  * an IBC Transfer will be executed to transfer funds there.
172
172
  */
173
- deposit: (payment: Payment) => Promise<void>;
173
+ deposit: (payment: Payment<'nat'>) => Promise<void>;
174
174
  }
175
175
 
176
176
  /**
@@ -21,18 +21,41 @@ export function startStakeAtom({ consume: { agoricNames, board, chainStorage, ch
21
21
  }, baggage: import("@agoric/vat-data").Baggage) => Promise<{
22
22
  publicFacet: import("@endo/exo").Guarded<{
23
23
  makeAccount(): Promise<import("@endo/exo").Guarded<{
24
+ asContinuingOffer(): {
25
+ publicSubscribers: {
26
+ account: {
27
+ description: string;
28
+ subscriber: globalThis.Subscriber<import("../exos/cosmosOrchestrationAccount.js").ComosOrchestrationAccountNotification>;
29
+ storagePath: Promise<string>;
30
+ };
31
+ };
32
+ invitationMakers: import("@endo/exo").Guarded<{
33
+ Delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: Amount<"nat">): Promise<Invitation<void, undefined>>;
34
+ Redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<Invitation<void, undefined>>;
35
+ WithdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<Invitation<import("../orchestration-api.js").DenomAmount[], undefined>>;
36
+ Undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<Invitation<void, undefined>>;
37
+ CloseAccount(): never;
38
+ TransferAccount(): never;
39
+ }>;
40
+ holder: import("@endo/exo").Guarded<any>;
41
+ };
24
42
  getPublicTopics(): {
25
43
  account: {
26
44
  description: string;
27
- subscriber: globalThis.Subscriber<import("../exos/stakingAccountKit.js").StakingAccountNotification>;
45
+ subscriber: globalThis.Subscriber<import("../exos/cosmosOrchestrationAccount.js").ComosOrchestrationAccountNotification>;
28
46
  storagePath: Promise<string>;
29
47
  };
30
48
  };
31
49
  getAddress(): import("../orchestration-api.js").ChainAddress;
32
50
  delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
51
+ deposit(payment: any): Promise<void>;
52
+ getBalances(): Promise<never>;
33
53
  redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
34
54
  withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<import("../orchestration-api.js").DenomAmount[]>;
35
- getBalance(denom?: string | undefined): Promise<import("../orchestration-api.js").DenomAmount>;
55
+ getBalance(denom: import("../orchestration-api.js").DenomArg): Promise<import("../orchestration-api.js").DenomAmount>;
56
+ send(toAccount: any, amount: any): never;
57
+ transfer(amount: any, msg: any): never;
58
+ transferSteps(amount: any, msg: any): never;
36
59
  withdrawRewards(): never;
37
60
  undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<void>;
38
61
  }>>;
@@ -40,7 +63,7 @@ export function startStakeAtom({ consume: { agoricNames, board, chainStorage, ch
40
63
  publicSubscribers: {
41
64
  account: {
42
65
  description: string;
43
- subscriber: globalThis.Subscriber<import("../exos/stakingAccountKit.js").StakingAccountNotification>;
66
+ subscriber: globalThis.Subscriber<import("../exos/cosmosOrchestrationAccount.js").ComosOrchestrationAccountNotification>;
44
67
  storagePath: Promise<string>;
45
68
  };
46
69
  };
@@ -52,22 +75,7 @@ export function startStakeAtom({ consume: { agoricNames, board, chainStorage, ch
52
75
  CloseAccount(): never;
53
76
  TransferAccount(): never;
54
77
  }>;
55
- account: import("@endo/exo").Guarded<{
56
- getPublicTopics(): {
57
- account: {
58
- description: string;
59
- subscriber: globalThis.Subscriber<import("../exos/stakingAccountKit.js").StakingAccountNotification>;
60
- storagePath: Promise<string>;
61
- };
62
- };
63
- getAddress(): import("../orchestration-api.js").ChainAddress;
64
- delegate(validator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
65
- redelegate(srcValidator: import("../cosmos-api.js").CosmosValidatorAddress, dstValidator: import("../cosmos-api.js").CosmosValidatorAddress, amount: import("../orchestration-api.js").AmountArg): Promise<void>;
66
- withdrawReward(validator: import("../cosmos-api.js").CosmosValidatorAddress): Promise<import("../orchestration-api.js").DenomAmount[]>;
67
- getBalance(denom?: string | undefined): Promise<import("../orchestration-api.js").DenomAmount>;
68
- withdrawRewards(): never;
69
- undelegate(delegations: import("@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js").Delegation[]): Promise<void>;
70
- }>;
78
+ holder: import("@endo/exo").Guarded<any>;
71
79
  }, undefined>>;
72
80
  }>;
73
81
  }>>;
@@ -1 +1 @@
1
- {"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAoBO,0OAXI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,SAAiB,EAAE,YAAY,OAoCc,IAAI,cACjD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2GAuDgjH,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;eA1FrjH,CAAC;SACH,CAAC;KACH,CAAC;CACH;;kBAuDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;oCAnG+C,gCAAgC"}
1
+ {"version":3,"file":"start-stakeAtom.d.ts","sourceRoot":"","sources":["start-stakeAtom.js"],"names":[],"mappings":"AAoBO,0OAXI,eAAe,GAAG;IAC5B,YAAgB,EAAE;QAClB,OAAa,EAAE;YACf,SAAiB,EAAE,YAAY,OA2CxB,IAAI,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+GAiDm1H,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA1Fj3H,CAAC;SACH,CAAC;KACH,CAAC;CACH;;kBAuDH;AAGM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN;oCAnG+C,gCAAgC"}
@@ -1,4 +1,3 @@
1
- export function prepareMockChainInfo(zone: Zone): Pick<CosmosChainInfo, "connections" | "chainId">;
2
- import type { Zone } from '@agoric/zone';
1
+ export function prepareMockChainInfo(): Pick<CosmosChainInfo, "connections" | "chainId">;
3
2
  import type { CosmosChainInfo } from '../cosmos-api.js';
4
3
  //# sourceMappingURL=mockChainInfo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mockChainInfo.d.ts","sourceRoot":"","sources":["mockChainInfo.js"],"names":[],"mappings":"AAyEO,mGAYN;0BA3EsB,cAAc;qCACgB,kBAAkB"}
1
+ {"version":3,"file":"mockChainInfo.d.ts","sourceRoot":"","sources":["mockChainInfo.js"],"names":[],"mappings":"AAwEO,yFAKN;qCAlEoD,kBAAkB"}
@@ -68,19 +68,11 @@ const connectionEntries = harden({
68
68
  });
69
69
 
70
70
  /**
71
- * @param {Zone} zone
72
71
  * @returns {Pick<CosmosChainInfo, 'connections' | 'chainId'>}
73
72
  */
74
- export const prepareMockChainInfo = zone => {
75
- const agoricConnections =
76
- /** @type {import('@agoric/store').MapStore<string, IBCConnectionInfo>} */ (
77
- zone.mapStore('ibcConnections')
78
- );
79
-
80
- agoricConnections.addAll(Object.entries(connectionEntries));
81
-
73
+ export const prepareMockChainInfo = () => {
82
74
  return harden({
83
75
  chainId: 'agoriclocal',
84
- connections: agoricConnections,
76
+ connections: connectionEntries,
85
77
  });
86
78
  };
@@ -0,0 +1,10 @@
1
+ export namespace orchestrationAccountMethods {
2
+ let getAddress: import("@endo/patterns").MethodGuard;
3
+ let getBalance: import("@endo/patterns").MethodGuard;
4
+ let getBalances: import("@endo/patterns").MethodGuard;
5
+ let send: import("@endo/patterns").MethodGuard;
6
+ let transfer: import("@endo/patterns").MethodGuard;
7
+ let transferSteps: import("@endo/patterns").MethodGuard;
8
+ let deposit: import("@endo/patterns").MethodGuard;
9
+ }
10
+ //# sourceMappingURL=orchestrationAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrationAccount.d.ts","sourceRoot":"","sources":["orchestrationAccount.js"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { M } from '@endo/patterns';
2
+ import { PaymentShape } from '@agoric/ertp';
3
+ import { AmountArgShape, ChainAddressShape, CoinShape } from '../typeGuards.js';
4
+
5
+ /** @import {OrchestrationAccountI} from '../orchestration-api.js'; */
6
+
7
+ // TODO complete this interface
8
+ /** @see {OrchestrationAccountI} */
9
+ export const orchestrationAccountMethods = {
10
+ getAddress: M.call().returns(ChainAddressShape),
11
+ getBalance: M.callWhen(M.any()).returns(CoinShape),
12
+ getBalances: M.callWhen().returns(M.arrayOf(CoinShape)),
13
+ send: M.callWhen(ChainAddressShape, AmountArgShape).returns(M.undefined()),
14
+ transfer: M.callWhen(AmountArgShape, ChainAddressShape).returns(
15
+ M.undefined(),
16
+ ),
17
+ transferSteps: M.callWhen(AmountArgShape, M.any()).returns(M.undefined()),
18
+ deposit: M.callWhen(PaymentShape).returns(M.undefined()),
19
+ };
@@ -1 +0,0 @@
1
- {"version":3,"file":"stakingAccountKit.d.ts","sourceRoot":"","sources":["stakingAccountKit.js"],"names":[],"mappings":"AAmDA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH;;;;;;;;;GAeG;AAOH,6CAGE;AAgBK,uFAqCD,WAAW,GAAE,QAAS,OAAO,WAC5B,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,0HAxClB,GAAG;;iBAkCC,WAAW;;;;;;;;;QAelB,wDAAwD;;;QAWxD;;;WAGG;;;;QAgBH;;;WAGG;4DADQ,MAAM,CAAC,KAAK,CAAC;QAUxB;;;;WAIG;;QAaH,gDAAgD;;QAShD;;WAEG;;;QAYH;;;;WAIG;;;;;;;;;;;QAmBH,8BAA8B;;QAI9B;;;;;WAKG;;QAkBH;;;;;;WAMG;;QAmBH;;;WAGG;;QAmBH;;;WAGG;;;QA0BH;;WAEG;;;GA0CV;;;;;;;;;;;;;eAzVe,MAAM;;;gCA2VR,UAAU,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;kCACvD,iBAAiB,CAAC,QAAQ,CAAC;0BA7WlB,cAAc;iCAJU,6CAA6C;kCADqC,aAAa;gCAAb,aAAa;kCAI/G,cAAc;+BAJoF,aAAa;0BAEvH,kDAAkD;4CAFwD,aAAa;iCAAb,aAAa;gCAGjH,wDAAwD"}