@activepieces/piece-sendfox 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/package.json +19 -0
- package/src/common/index.d.ts +13 -0
- package/src/common/index.js +81 -0
- package/src/common/index.js.map +1 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +22 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/create-contact.d.ts +6 -0
- package/src/lib/actions/create-contact.js +49 -0
- package/src/lib/actions/create-contact.js.map +1 -0
- package/src/lib/actions/create-list.d.ts +3 -0
- package/src/lib/actions/create-list.js +32 -0
- package/src/lib/actions/create-list.js.map +1 -0
- package/src/lib/actions/unsubscribe-contact.d.ts +3 -0
- package/src/lib/actions/unsubscribe-contact.js +32 -0
- package/src/lib/actions/unsubscribe-contact.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-sendfox",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@sinclair/typebox": "^0.26.3",
|
|
6
|
+
"axios": "1.4.0",
|
|
7
|
+
"dayjs": "^1.11.8",
|
|
8
|
+
"is-base64": "^1.1.0",
|
|
9
|
+
"nanoid": "^3.3.4",
|
|
10
|
+
"object-sizeof": "^2.6.3",
|
|
11
|
+
"semver": "7.5.4",
|
|
12
|
+
"@activepieces/pieces-common": "0.2.2",
|
|
13
|
+
"@activepieces/pieces-framework": "0.6.13",
|
|
14
|
+
"@activepieces/shared": "0.7.3",
|
|
15
|
+
"tslib": "2.6.1"
|
|
16
|
+
},
|
|
17
|
+
"main": "./src/index.js",
|
|
18
|
+
"types": "./src/index.d.ts"
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpMethod, HttpMessageBody, HttpResponse } from '@activepieces/pieces-common';
|
|
2
|
+
export declare function getLists(accessToken: string): Promise<{
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
}[][]>;
|
|
6
|
+
export declare function getcontacts(accessToken: string): Promise<{
|
|
7
|
+
id: number;
|
|
8
|
+
name: string;
|
|
9
|
+
}[]>;
|
|
10
|
+
export declare const sendfoxCommon: {
|
|
11
|
+
lists: import("@activepieces/pieces-framework").DropdownProperty<number, false>;
|
|
12
|
+
};
|
|
13
|
+
export declare function callsendfoxApi<T extends HttpMessageBody>(method: HttpMethod, apiUrl: string, accessToken: string, body: any | undefined): Promise<HttpResponse<T>>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callsendfoxApi = exports.sendfoxCommon = exports.getcontacts = exports.getLists = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
function getLists(accessToken) {
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
const list_of_lists = [];
|
|
10
|
+
let last_page = 1;
|
|
11
|
+
for (let i = 1; i <= last_page; i++) {
|
|
12
|
+
const response = (yield callsendfoxApi(pieces_common_1.HttpMethod.GET, `lists?page=${i}`, accessToken, undefined)).body;
|
|
13
|
+
last_page = response.last_page;
|
|
14
|
+
const lists = response.data;
|
|
15
|
+
list_of_lists.push(lists);
|
|
16
|
+
}
|
|
17
|
+
return list_of_lists;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
exports.getLists = getLists;
|
|
21
|
+
function getcontacts(accessToken) {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
let list_of_contacts = [];
|
|
24
|
+
let last_page = 1;
|
|
25
|
+
for (let i = 1; i <= last_page; i++) {
|
|
26
|
+
const response = (yield callsendfoxApi(pieces_common_1.HttpMethod.GET, `contacts?page=${i}`, accessToken, undefined)).body;
|
|
27
|
+
last_page = response.last_page;
|
|
28
|
+
const contacts = response.data;
|
|
29
|
+
list_of_contacts.push(contacts);
|
|
30
|
+
}
|
|
31
|
+
// convert the list of contacts to have name as first_name+last_name
|
|
32
|
+
list_of_contacts = list_of_contacts.flat().map((contact) => {
|
|
33
|
+
return { id: contact.id, name: contact.first_name + " " + contact.last_name };
|
|
34
|
+
});
|
|
35
|
+
return list_of_contacts;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
exports.getcontacts = getcontacts;
|
|
39
|
+
exports.sendfoxCommon = {
|
|
40
|
+
lists: pieces_framework_1.Property.Dropdown({
|
|
41
|
+
displayName: 'Lists',
|
|
42
|
+
required: false,
|
|
43
|
+
refreshers: ['auth'],
|
|
44
|
+
options: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
const authentication = auth;
|
|
46
|
+
if (!authentication) {
|
|
47
|
+
return {
|
|
48
|
+
disabled: true,
|
|
49
|
+
placeholder: 'connect your account first',
|
|
50
|
+
options: [],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const accessToken = authentication;
|
|
54
|
+
const list_of_lists = yield getLists(accessToken);
|
|
55
|
+
return {
|
|
56
|
+
disabled: false,
|
|
57
|
+
options: list_of_lists.flat().map((list) => {
|
|
58
|
+
return {
|
|
59
|
+
label: list.name,
|
|
60
|
+
value: list.id,
|
|
61
|
+
};
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
}),
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
function callsendfoxApi(method, apiUrl, accessToken, body) {
|
|
68
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
return yield pieces_common_1.httpClient.sendRequest({
|
|
70
|
+
method: method,
|
|
71
|
+
url: `https://api.sendfox.com/${apiUrl}`,
|
|
72
|
+
authentication: {
|
|
73
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
74
|
+
token: accessToken,
|
|
75
|
+
},
|
|
76
|
+
body: body,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
exports.callsendfoxApi = callsendfoxApi;
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/sendfox/src/common/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA+E;AAC/E,+DAMqC;AAErC,SAAsB,QAAQ,CAAC,WAAmB;;QAC9C,MAAM,aAAa,GAAG,EAAE,CAAC;QACzB,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAG,CAAC,IAAI,SAAS,EAAG,CAAC,EAAE,EAAE;YACnC,MAAM,QAAQ,GAAG,CAAE,MAAM,cAAc,CAOpC,0BAAU,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;YACpE,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;YAC/B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC5B,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,aAAa,CAAC;IACzB,CAAC;CAAA;AAjBD,4BAiBC;AACD,SAAsB,WAAW,CAAC,WAAmB;;QACjD,IAAI,gBAAgB,GAAG,EAAE,CAAC;QAC1B,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAG,CAAC,IAAI,SAAS,EAAG,CAAC,EAAE,EAAE;YACnC,MAAM,QAAQ,GAAG,CAAE,MAAM,cAAc,CAQpC,0BAAU,CAAC,GAAG,EAAE,iBAAiB,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;YAC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,CAAC;AAEF,SAAsB,cAAc,CAClC,MAAkB,EAClB,MAAc,EACd,WAAmB,EACnB,IAAqB;;QAErB,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAI;YACrC,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,2BAA2B,MAAM,EAAE;YACxC,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,WAAW;aACnB;YACD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC;CAAA;AAfD,wCAeC"}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendfox = exports.sendfoxAuth = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
const create_list_1 = require("./lib/actions/create-list");
|
|
6
|
+
const unsubscribe_contact_1 = require("./lib/actions/unsubscribe-contact");
|
|
7
|
+
const create_contact_1 = require("./lib/actions/create-contact");
|
|
8
|
+
exports.sendfoxAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
9
|
+
displayName: 'API Key',
|
|
10
|
+
description: "To obtain your personal token, follow these steps:\n1. Log in to your SendFox account.\n2. Visit https://sendfox.com/account/oauth to create one\n3. From OAuth Apps click on Create New Token.\n4. Enter any name you want then click create.\n5. Copy and paste your token here.",
|
|
11
|
+
required: true,
|
|
12
|
+
});
|
|
13
|
+
exports.sendfox = (0, pieces_framework_1.createPiece)({
|
|
14
|
+
displayName: "Sendfox",
|
|
15
|
+
auth: exports.sendfoxAuth,
|
|
16
|
+
minimumSupportedRelease: '0.7.1',
|
|
17
|
+
logoUrl: "https://cdn.activepieces.com/pieces/sendfox.png",
|
|
18
|
+
authors: ["Salem-Alaa"],
|
|
19
|
+
actions: [create_list_1.createList, unsubscribe_contact_1.unsubscribe, create_contact_1.createContact],
|
|
20
|
+
triggers: [],
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/sendfox/src/index.ts"],"names":[],"mappings":";;;AACA,qEAAwE;AACxE,2DAAuD;AACvD,2EAAgE;AAChE,iEAA6D;AAChD,QAAA,WAAW,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC5C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAC,oRAAoR;IAChS,QAAQ,EAAE,IAAI;CACjB,CAAC,CAAC;AAEU,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,IAAI,EAAE,mBAAW;IACjB,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,iDAAiD;IAC1D,OAAO,EAAE,CAAC,YAAY,CAAC;IACvB,OAAO,EAAE,CAAE,wBAAU,EAAG,iCAAW,EAAG,8BAAa,CAAE;IACrD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const createContact: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
firstname: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
lastname: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
list: import("@activepieces/pieces-framework").DropdownProperty<number, false>;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createContact = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const index_1 = require("../../index");
|
|
7
|
+
const common_1 = require("../../common");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.createContact = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'create-contact',
|
|
11
|
+
auth: index_1.sendfoxAuth,
|
|
12
|
+
displayName: 'Create Contact',
|
|
13
|
+
description: 'Create a new contact',
|
|
14
|
+
props: {
|
|
15
|
+
email: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Email',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
firstname: pieces_framework_1.Property.ShortText({
|
|
20
|
+
displayName: 'First Name',
|
|
21
|
+
required: false,
|
|
22
|
+
}),
|
|
23
|
+
lastname: pieces_framework_1.Property.ShortText({
|
|
24
|
+
displayName: 'Last Name',
|
|
25
|
+
required: false,
|
|
26
|
+
}),
|
|
27
|
+
list: common_1.sendfoxCommon.lists,
|
|
28
|
+
},
|
|
29
|
+
run(context) {
|
|
30
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const authentication = context.auth;
|
|
32
|
+
const accessToken = authentication;
|
|
33
|
+
const email = context.propsValue.email;
|
|
34
|
+
const firstname = context.propsValue.firstname;
|
|
35
|
+
const lastname = context.propsValue.lastname;
|
|
36
|
+
const list = context.propsValue.list;
|
|
37
|
+
const request_body = { email: email };
|
|
38
|
+
if (firstname)
|
|
39
|
+
request_body['first_name'] = firstname;
|
|
40
|
+
if (lastname)
|
|
41
|
+
request_body['last_name'] = lastname;
|
|
42
|
+
if (list)
|
|
43
|
+
request_body['list_ids'] = [list];
|
|
44
|
+
const response = (yield (0, common_1.callsendfoxApi)(pieces_common_1.HttpMethod.POST, 'contacts', accessToken, request_body)).body;
|
|
45
|
+
return [response];
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=create-contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-contact.js","sourceRoot":"","sources":["../../../../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C,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,QAAQ,GAAG,CAAE,MAAM,IAAA,uBAAc,EAAC,0BAAU,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,CAAE,CAAC,CAAC,IAAI,CAAC;YACvG,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createList = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const index_1 = require("../../index");
|
|
7
|
+
const common_1 = require("../../common");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.createList = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'create-list',
|
|
11
|
+
auth: index_1.sendfoxAuth,
|
|
12
|
+
displayName: 'Create List',
|
|
13
|
+
description: 'Create a new list',
|
|
14
|
+
props: {
|
|
15
|
+
task_name: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'List Name',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
run(context) {
|
|
21
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const authentication = context.auth;
|
|
23
|
+
const accessToken = authentication;
|
|
24
|
+
const task_name = context.propsValue.task_name;
|
|
25
|
+
const response = (yield (0, common_1.callsendfoxApi)(pieces_common_1.HttpMethod.POST, 'lists', accessToken, {
|
|
26
|
+
name: task_name,
|
|
27
|
+
})).body;
|
|
28
|
+
return [response];
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=create-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-list.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/sendfox/src/lib/actions/create-list.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAA0C;AAC1C,yCAA8C;AAC9C,+DAAyD;AAE5C,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,mBAAW;IACjB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE;QACH,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACnB,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAE;YAC/B,MAAM,WAAW,GAAG,cAAc,CAAE;YACpC,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,CAAE;YAChD,MAAM,QAAQ,GAAG,CAAE,MAAM,IAAA,uBAAc,EAAC,0BAAU,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE;gBAC3E,IAAI,EAAE,SAAS;aAClB,CAAC,CAAC,CAAC,IAAI,CAAC;YACT,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unsubscribe = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const index_1 = require("../../index");
|
|
7
|
+
const common_1 = require("../../common");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.unsubscribe = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'unsubscribe',
|
|
11
|
+
auth: index_1.sendfoxAuth,
|
|
12
|
+
displayName: 'Unsubscribe Contact',
|
|
13
|
+
description: 'Unsubscribe a contact',
|
|
14
|
+
props: {
|
|
15
|
+
email: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Email',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
run(context) {
|
|
21
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const authentication = context.auth;
|
|
23
|
+
const accessToken = authentication;
|
|
24
|
+
const email = context.propsValue.email;
|
|
25
|
+
const response = (yield (0, common_1.callsendfoxApi)(pieces_common_1.HttpMethod.PATCH, 'unsubscribe', accessToken, {
|
|
26
|
+
email: email,
|
|
27
|
+
})).body;
|
|
28
|
+
return [response];
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=unsubscribe-contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsubscribe-contact.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/sendfox/src/lib/actions/unsubscribe-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uCAA0C;AAC1C,yCAA8C;AAC9C,+DAAyD;AAE5C,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACpC,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,mBAAW;IACjB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,uBAAuB;IACpC,KAAK,EAAE;QACH,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACnB,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAE;YAC/B,MAAM,WAAW,GAAG,cAAc,CAAE;YACpC,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAE;YACxC,MAAM,QAAQ,GAAG,CAAE,MAAM,IAAA,uBAAc,EAAC,0BAAU,CAAC,KAAK,EAAE,aAAa,EAAE,WAAW,EAAC;gBACjF,KAAK,EAAG,KAAK;aAChB,CAAC,CAAC,CAAC,IAAI,CAAC;YACT,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;KAAA;CACJ,CAAC,CAAC"}
|