@activepieces/pieces-common 0.0.9 → 0.2.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.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@activepieces/pieces-common",
3
- "version": "0.0.9",
3
+ "version": "0.2.0",
4
4
  "type": "commonjs",
5
5
  "dependencies": {
6
- "@sinclair/typebox": "0.26.8",
6
+ "@sinclair/typebox": "^0.26.3",
7
7
  "axios": "1.2.4",
8
- "nanoid": "3.3.4",
9
- "@activepieces/pieces-framework": "0.3.30",
10
- "@activepieces/shared": "0.3.52",
11
- "tslib": "2.5.3"
8
+ "nanoid": "^3.3.4",
9
+ "@activepieces/pieces-framework": "0.5.0",
10
+ "@activepieces/shared": "0.5.0",
11
+ "tslib": "1.14.1"
12
12
  },
13
13
  "main": "./src/index.js",
14
14
  "types": "./src/index.d.ts"
@@ -1,15 +1,15 @@
1
- export declare type Authentication = BearerTokenAuthentication | BasicAuthentication;
1
+ export type Authentication = BearerTokenAuthentication | BasicAuthentication;
2
2
  export declare enum AuthenticationType {
3
3
  BEARER_TOKEN = "BEARER_TOKEN",
4
4
  BASIC = "BASIC"
5
5
  }
6
- export declare type BaseAuthentication<T extends AuthenticationType> = {
6
+ export type BaseAuthentication<T extends AuthenticationType> = {
7
7
  type: T;
8
8
  };
9
- export declare type BearerTokenAuthentication = BaseAuthentication<AuthenticationType.BEARER_TOKEN> & {
9
+ export type BearerTokenAuthentication = BaseAuthentication<AuthenticationType.BEARER_TOKEN> & {
10
10
  token: string;
11
11
  };
12
- export declare type BasicAuthentication = BaseAuthentication<AuthenticationType.BASIC> & {
12
+ export type BasicAuthentication = BaseAuthentication<AuthenticationType.BASIC> & {
13
13
  username: string;
14
14
  password: string;
15
15
  };
@@ -5,5 +5,5 @@ var AuthenticationType;
5
5
  (function (AuthenticationType) {
6
6
  AuthenticationType["BEARER_TOKEN"] = "BEARER_TOKEN";
7
7
  AuthenticationType["BASIC"] = "BASIC";
8
- })(AuthenticationType = exports.AuthenticationType || (exports.AuthenticationType = {}));
8
+ })(AuthenticationType || (exports.AuthenticationType = AuthenticationType = {}));
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/common/src/lib/authentication/index.ts"],"names":[],"mappings":";;;AAEA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC7B,mDAA6B,CAAA;IAC7B,qCAAe,CAAA;AAChB,CAAC,EAHW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAG7B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/common/src/lib/authentication/index.ts"],"names":[],"mappings":";;;AAEA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC7B,mDAA6B,CAAA;IAC7B,qCAAe,CAAA;AAChB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B"}
@@ -1,3 +1,2 @@
1
1
  import { OAuth2PropertyValue } from "@activepieces/pieces-framework";
2
2
  export declare const getAccessTokenOrThrow: (auth: OAuth2PropertyValue | undefined) => string;
3
- export * from './assertions';
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAccessTokenOrThrow = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const getAccessTokenOrThrow = (auth) => {
6
5
  const accessToken = auth === null || auth === void 0 ? void 0 : auth.access_token;
7
6
  if (accessToken === undefined) {
@@ -10,5 +9,4 @@ const getAccessTokenOrThrow = (auth) => {
10
9
  return accessToken;
11
10
  };
12
11
  exports.getAccessTokenOrThrow = getAccessTokenOrThrow;
13
- tslib_1.__exportStar(require("./assertions"), exports);
14
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/common/src/lib/helpers/index.ts"],"names":[],"mappings":";;;;AAEO,MAAM,qBAAqB,GAAG,CAAC,IAAqC,EAAU,EAAE;IACrF,MAAM,WAAW,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAC;IAEvC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AARW,QAAA,qBAAqB,yBAQhC;AAEF,uDAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/common/src/lib/helpers/index.ts"],"names":[],"mappings":";;;AAEO,MAAM,qBAAqB,GAAG,CAAC,IAAqC,EAAU,EAAE;IACrF,MAAM,WAAW,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAC;IAEvC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AARW,QAAA,qBAAqB,yBAQhC"}
@@ -11,7 +11,7 @@ declare class BearerTokenAuthenticationConverter implements AuthenticationConver
11
11
  declare class BasicTokenAuthenticationConverter implements AuthenticationConverter<BasicAuthentication> {
12
12
  convert(authentication: BasicAuthentication, headers: HttpHeaders): HttpHeaders;
13
13
  }
14
- declare type AuthenticationConverter<T extends Authentication> = {
14
+ type AuthenticationConverter<T extends Authentication> = {
15
15
  convert: (authentication: T, headers: HttpHeaders) => HttpHeaders;
16
16
  };
17
17
  export {};
@@ -2,7 +2,7 @@ import { AxiosHttpClient } from '../axios/axios-http-client';
2
2
  import type { HttpMessageBody } from './http-message-body';
3
3
  import type { HttpRequest } from './http-request';
4
4
  import { HttpResponse } from './http-response';
5
- export declare type HttpClient = {
5
+ export type HttpClient = {
6
6
  sendRequest<RequestBody extends HttpMessageBody, ResponseBody extends HttpMessageBody>(request: HttpRequest<RequestBody>): Promise<HttpResponse<ResponseBody>>;
7
7
  };
8
8
  export declare const httpClient: AxiosHttpClient;
@@ -7,5 +7,5 @@ var HttpHeader;
7
7
  HttpHeader["ACCEPT"] = "Accept";
8
8
  HttpHeader["API_KEY"] = "Api-Key";
9
9
  HttpHeader["CONTENT_TYPE"] = "Content-Type";
10
- })(HttpHeader = exports.HttpHeader || (exports.HttpHeader = {}));
10
+ })(HttpHeader || (exports.HttpHeader = HttpHeader = {}));
11
11
  //# sourceMappingURL=http-header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-header.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/common/src/lib/http/core/http-header.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,6CAA+B,CAAA;IAC/B,+BAAiB,CAAA;IACd,iCAAmB,CAAA;IACtB,2CAA6B,CAAA;AAC9B,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB"}
1
+ {"version":3,"file":"http-header.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/common/src/lib/http/core/http-header.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,6CAA+B,CAAA;IAC/B,+BAAiB,CAAA;IACd,iCAAmB,CAAA;IACtB,2CAA6B,CAAA;AAC9B,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB"}
@@ -1 +1 @@
1
- export declare type HttpHeaders = Record<string, string | string[] | undefined>;
1
+ export type HttpHeaders = Record<string, string | string[] | undefined>;
@@ -1 +1 @@
1
- export declare type HttpMessageBody = Record<string, any>;
1
+ export type HttpMessageBody = Record<string, any>;
@@ -9,5 +9,5 @@ var HttpMethod;
9
9
  HttpMethod["PUT"] = "PUT";
10
10
  HttpMethod["DELETE"] = "DELETE";
11
11
  HttpMethod["HEAD"] = "HEAD";
12
- })(HttpMethod = exports.HttpMethod || (exports.HttpMethod = {}));
12
+ })(HttpMethod || (exports.HttpMethod = HttpMethod = {}));
13
13
  //# sourceMappingURL=http-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-method.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/common/src/lib/http/core/http-method.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAOX;AAPD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACd,CAAC,EAPW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAOrB"}
1
+ {"version":3,"file":"http-method.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/common/src/lib/http/core/http-method.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAOX;AAPD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACd,CAAC,EAPW,UAAU,0BAAV,UAAU,QAOrB"}
@@ -3,7 +3,7 @@ import type { HttpMethod } from './http-method';
3
3
  import type { QueryParams } from './query-params';
4
4
  import { HttpHeaders } from './http-headers';
5
5
  import { Authentication } from '../../authentication';
6
- export declare type HttpRequest<RequestBody extends HttpMessageBody = any> = {
6
+ export type HttpRequest<RequestBody extends HttpMessageBody = any> = {
7
7
  method: HttpMethod;
8
8
  url: string;
9
9
  body?: RequestBody | undefined;
@@ -1,6 +1,6 @@
1
1
  import { HttpMessageBody } from "./http-message-body";
2
2
  import { HttpHeaders } from "./http-headers";
3
- export declare type HttpResponse<RequestBody extends HttpMessageBody = any> = {
3
+ export type HttpResponse<RequestBody extends HttpMessageBody = any> = {
4
4
  status: number;
5
5
  headers?: HttpHeaders | undefined;
6
6
  body: RequestBody;
@@ -4,5 +4,5 @@ exports.MediaType = void 0;
4
4
  var MediaType;
5
5
  (function (MediaType) {
6
6
  MediaType["APPLICATION_JSON"] = "application/json";
7
- })(MediaType = exports.MediaType || (exports.MediaType = {}));
7
+ })(MediaType || (exports.MediaType = MediaType = {}));
8
8
  //# sourceMappingURL=media-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"media-type.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/common/src/lib/http/core/media-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAEX;AAFD,WAAY,SAAS;IACpB,kDAAqC,CAAA;AACtC,CAAC,EAFW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAEpB"}
1
+ {"version":3,"file":"media-type.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/common/src/lib/http/core/media-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAEX;AAFD,WAAY,SAAS;IACpB,kDAAqC,CAAA;AACtC,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB"}
@@ -1 +1 @@
1
- export declare type QueryParams = Record<string, string>;
1
+ export type QueryParams = Record<string, string>;
@@ -1,20 +1,22 @@
1
1
  import { Store } from "@activepieces/pieces-framework";
2
- interface TimebasedPolling<INPUT> {
2
+ interface TimebasedPolling<AuthValue, PropsValue> {
3
3
  strategy: DedupeStrategy.TIMEBASED;
4
- items: ({ store, propsValue, lastFetchEpochMS }: {
4
+ items: (params: {
5
+ auth: AuthValue;
5
6
  store: Store;
6
- propsValue: INPUT;
7
+ propsValue: PropsValue;
7
8
  lastFetchEpochMS: number;
8
9
  }) => Promise<{
9
10
  epochMilliSeconds: number;
10
11
  data: unknown;
11
12
  }[]>;
12
13
  }
13
- interface LastItemPolling<INPUT> {
14
+ interface LastItemPolling<AuthValue, PropsValue> {
14
15
  strategy: DedupeStrategy.LAST_ITEM;
15
- items: ({ store, propsValue, lastItemId }: {
16
+ items: (params: {
17
+ auth: AuthValue;
16
18
  store: Store;
17
- propsValue: INPUT;
19
+ propsValue: PropsValue;
18
20
  lastItemId: unknown;
19
21
  }) => Promise<{
20
22
  id: unknown;
@@ -25,24 +27,28 @@ export declare enum DedupeStrategy {
25
27
  TIMEBASED = 0,
26
28
  LAST_ITEM = 1
27
29
  }
28
- export declare type Polling<T> = TimebasedPolling<T> | LastItemPolling<T>;
30
+ export type Polling<AuthValue, PropsValue> = TimebasedPolling<AuthValue, PropsValue> | LastItemPolling<AuthValue, PropsValue>;
29
31
  export declare const pollingHelper: {
30
- poll<INPUT>(polling: Polling<INPUT>, { store, propsValue, maxItemsToPoll }: {
32
+ poll<AuthValue, PropsValue>(polling: Polling<AuthValue, PropsValue>, { store, auth, propsValue, maxItemsToPoll }: {
31
33
  store: Store;
32
- propsValue: INPUT;
34
+ auth: AuthValue;
35
+ propsValue: PropsValue;
33
36
  maxItemsToPoll?: number | undefined;
34
37
  }): Promise<unknown[]>;
35
- onEnable<INPUT_1>(polling: Polling<INPUT_1>, { store, propsValue }: {
38
+ onEnable<AuthValue_1, PropsValue_1>(polling: Polling<AuthValue_1, PropsValue_1>, { store, auth, propsValue }: {
36
39
  store: Store;
37
- propsValue: INPUT_1;
40
+ auth: AuthValue_1;
41
+ propsValue: PropsValue_1;
38
42
  }): Promise<void>;
39
- onDisable<INPUT_2>(polling: Polling<INPUT_2>, { store, propsValue }: {
43
+ onDisable<AuthValue_2, PropsValue_2>(polling: Polling<AuthValue_2, PropsValue_2>, params: {
40
44
  store: Store;
41
- propsValue: INPUT_2;
45
+ auth: AuthValue_2;
46
+ propsValue: PropsValue_2;
42
47
  }): Promise<void>;
43
- test<INPUT_3>(polling: Polling<INPUT_3>, { store, propsValue }: {
48
+ test<AuthValue_3, PropsValue_3>(polling: Polling<AuthValue_3, PropsValue_3>, { auth, propsValue, store }: {
44
49
  store: Store;
45
- propsValue: INPUT_3;
50
+ auth: AuthValue_3;
51
+ propsValue: PropsValue_3;
46
52
  }): Promise<unknown[]>;
47
53
  };
48
54
  export {};
@@ -7,22 +7,22 @@ var DedupeStrategy;
7
7
  (function (DedupeStrategy) {
8
8
  DedupeStrategy[DedupeStrategy["TIMEBASED"] = 0] = "TIMEBASED";
9
9
  DedupeStrategy[DedupeStrategy["LAST_ITEM"] = 1] = "LAST_ITEM";
10
- })(DedupeStrategy = exports.DedupeStrategy || (exports.DedupeStrategy = {}));
10
+ })(DedupeStrategy || (exports.DedupeStrategy = DedupeStrategy = {}));
11
11
  exports.pollingHelper = {
12
- poll(polling, { store, propsValue, maxItemsToPoll }) {
12
+ poll(polling, { store, auth, propsValue, maxItemsToPoll }) {
13
13
  var _a, _b, _c;
14
14
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
15
  switch (polling.strategy) {
16
16
  case DedupeStrategy.TIMEBASED: {
17
17
  const lastEpochMilliSeconds = (_a = (yield store.get("lastPoll"))) !== null && _a !== void 0 ? _a : 0;
18
- const items = yield polling.items({ store, propsValue, lastFetchEpochMS: lastEpochMilliSeconds });
18
+ const items = yield polling.items({ store, auth, propsValue, lastFetchEpochMS: lastEpochMilliSeconds });
19
19
  const newLastEpochMilliSeconds = items.reduce((acc, item) => Math.max(acc, item.epochMilliSeconds), lastEpochMilliSeconds);
20
20
  yield store.put("lastPoll", newLastEpochMilliSeconds);
21
21
  return items.filter(f => f.epochMilliSeconds > lastEpochMilliSeconds).map((item) => item.data);
22
22
  }
23
23
  case DedupeStrategy.LAST_ITEM: {
24
24
  const lastItemId = (yield store.get("lastItem"));
25
- const items = yield polling.items({ store, propsValue, lastItemId });
25
+ const items = yield polling.items({ store, auth, propsValue, lastItemId });
26
26
  const lastItemIndex = items.findIndex(f => f.id === lastItemId);
27
27
  let newItems = [];
28
28
  if ((0, shared_1.isNil)(lastItemId) || lastItemIndex == -1) {
@@ -45,7 +45,7 @@ exports.pollingHelper = {
45
45
  }
46
46
  });
47
47
  },
48
- onEnable(polling, { store, propsValue }) {
48
+ onEnable(polling, { store, auth, propsValue }) {
49
49
  var _a;
50
50
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
51
51
  switch (polling.strategy) {
@@ -54,7 +54,7 @@ exports.pollingHelper = {
54
54
  break;
55
55
  }
56
56
  case DedupeStrategy.LAST_ITEM: {
57
- const items = (yield polling.items({ store, propsValue, lastItemId: null }));
57
+ const items = (yield polling.items({ store, auth, propsValue, lastItemId: null }));
58
58
  const lastItemId = (_a = items === null || items === void 0 ? void 0 : items[0]) === null || _a === void 0 ? void 0 : _a.id;
59
59
  if (!(0, shared_1.isNil)(lastItemId)) {
60
60
  yield store.put("lastItem", lastItemId);
@@ -67,7 +67,7 @@ exports.pollingHelper = {
67
67
  }
68
68
  });
69
69
  },
70
- onDisable(polling, { store, propsValue }) {
70
+ onDisable(polling, params) {
71
71
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
72
72
  switch (polling.strategy) {
73
73
  case DedupeStrategy.TIMEBASED:
@@ -76,16 +76,16 @@ exports.pollingHelper = {
76
76
  }
77
77
  });
78
78
  },
79
- test(polling, { store, propsValue }) {
79
+ test(polling, { auth, propsValue, store }) {
80
80
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
81
81
  let items = [];
82
82
  switch (polling.strategy) {
83
83
  case DedupeStrategy.TIMEBASED: {
84
- items = yield polling.items({ store, propsValue, lastFetchEpochMS: 0 });
84
+ items = yield polling.items({ store, auth, propsValue, lastFetchEpochMS: 0 });
85
85
  break;
86
86
  }
87
87
  case DedupeStrategy.LAST_ITEM: {
88
- items = yield polling.items({ store: store, propsValue, lastItemId: null });
88
+ items = yield polling.items({ store, auth, propsValue, lastItemId: null });
89
89
  break;
90
90
  }
91
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/common/src/lib/polling/index.ts"],"names":[],"mappings":";;;;AACA,iDAA4C;AAwB5C,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,6DAAS,CAAA;IACT,6DAAS,CAAA;AACb,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAIY,QAAA,aAAa,GAAG;IACnB,IAAI,CAAQ,OAAuB,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAgE;;;YAC1I,QAAQ,OA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AC;oBAC9E,MAAM;iBACT;gBACD,KAAK,cAAc,CAAC,SAAS,CAAC,CAAC;oBAC3B,KAAK,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC3E,MAAM;iBACT;aACJ;YACD,OAAO,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7D,CAAC;KAAA;CACJ,CAAA;AAED,SAAS,iBAAiB,CAAC,KAAgB;IACvC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE;QACnB,OAAO,KAAK,CAAC;KAChB;SAAM;QACH,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC5B;AACL,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function assertNotNullOrUndefined<T>(value: T | null | undefined, fieldName: string): asserts value is T;
2
- export declare const isNotUndefined: <T>(value: T | undefined) => value is T;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isNotUndefined = exports.assertNotNullOrUndefined = void 0;
4
- function assertNotNullOrUndefined(value, fieldName) {
5
- if (value === null || value === undefined) {
6
- throw new Error(`${fieldName} is null or undefined`);
7
- }
8
- }
9
- exports.assertNotNullOrUndefined = assertNotNullOrUndefined;
10
- const isNotUndefined = (value) => {
11
- return value !== undefined;
12
- };
13
- exports.isNotUndefined = isNotUndefined;
14
- //# sourceMappingURL=assertions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertions.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/common/src/lib/helpers/assertions.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB,CACtC,KAA2B,EAC3B,SAAiB;IAEjB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,uBAAuB,CAAC,CAAC;KACtD;AACH,CAAC;AAPD,4DAOC;AAEM,MAAM,cAAc,GAAG,CAAI,KAAoB,EAAc,EAAE;IACpE,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B,CAAC,CAAA;AAFY,QAAA,cAAc,kBAE1B"}