@gitpod/gitpod-protocol 0.1.5-v0.6.0-beta2 → 0.1.5-vn-integrate-gitpod-yml-tasks-into-jetbrainsa.5

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 (299) hide show
  1. package/data/builtin-theia-plugins.json +9 -9
  2. package/data/gitpod-schema.json +25 -24
  3. package/lib/accounting-protocol.d.ts +155 -0
  4. package/lib/accounting-protocol.d.ts.map +1 -0
  5. package/lib/accounting-protocol.js +109 -0
  6. package/lib/accounting-protocol.js.map +1 -0
  7. package/lib/admin-protocol.d.ts +31 -4
  8. package/lib/admin-protocol.d.ts.map +1 -1
  9. package/lib/admin-protocol.js +15 -0
  10. package/lib/admin-protocol.js.map +1 -1
  11. package/lib/analytics.d.ts +45 -0
  12. package/lib/analytics.d.ts.map +1 -0
  13. package/lib/analytics.js +10 -0
  14. package/lib/analytics.js.map +1 -0
  15. package/lib/auth.d.ts +25 -0
  16. package/lib/auth.d.ts.map +1 -0
  17. package/lib/auth.js +16 -0
  18. package/lib/auth.js.map +1 -0
  19. package/lib/context-url.d.ts +31 -0
  20. package/lib/context-url.d.ts.map +1 -0
  21. package/lib/context-url.js +102 -0
  22. package/lib/context-url.js.map +1 -0
  23. package/lib/context-url.spec.d.ts +14 -0
  24. package/lib/context-url.spec.d.ts.map +1 -0
  25. package/lib/context-url.spec.js +94 -0
  26. package/lib/context-url.spec.js.map +1 -0
  27. package/lib/email-protocol.d.ts +1 -2
  28. package/lib/email-protocol.d.ts.map +1 -1
  29. package/lib/email-protocol.js +4 -4
  30. package/lib/email-protocol.js.map +1 -1
  31. package/lib/encryption/container-module.js +5 -4
  32. package/lib/encryption/container-module.js.map +1 -1
  33. package/lib/encryption/encryption-engine.js +19 -20
  34. package/lib/encryption/encryption-engine.js.map +1 -1
  35. package/lib/encryption/encryption-engine.spec.js +29 -36
  36. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  37. package/lib/encryption/encryption-service.js +29 -43
  38. package/lib/encryption/encryption-service.js.map +1 -1
  39. package/lib/encryption/key-provider.js +25 -30
  40. package/lib/encryption/key-provider.js.map +1 -1
  41. package/lib/env.d.ts +1 -2
  42. package/lib/env.d.ts.map +1 -1
  43. package/lib/env.js +20 -21
  44. package/lib/env.js.map +1 -1
  45. package/lib/gitpod-file-parser.js +25 -41
  46. package/lib/gitpod-file-parser.js.map +1 -1
  47. package/lib/gitpod-file-parser.spec.js +116 -116
  48. package/lib/gitpod-file-parser.spec.js.map +1 -1
  49. package/lib/gitpod-service.d.ts +162 -20
  50. package/lib/gitpod-service.d.ts.map +1 -1
  51. package/lib/gitpod-service.js +170 -256
  52. package/lib/gitpod-service.js.map +1 -1
  53. package/lib/headless-workspace-log.d.ts +8 -11
  54. package/lib/headless-workspace-log.d.ts.map +1 -1
  55. package/lib/headless-workspace-log.js +4 -7
  56. package/lib/headless-workspace-log.js.map +1 -1
  57. package/lib/ide-frontend-service.d.ts +4 -0
  58. package/lib/ide-frontend-service.d.ts.map +1 -1
  59. package/lib/ide-protocol.d.ts +105 -0
  60. package/lib/ide-protocol.d.ts.map +1 -0
  61. package/lib/ide-protocol.js +8 -0
  62. package/lib/ide-protocol.js.map +1 -0
  63. package/lib/index.d.ts +6 -0
  64. package/lib/index.d.ts.map +1 -1
  65. package/lib/index.js +7 -1
  66. package/lib/index.js.map +1 -1
  67. package/lib/installation-admin-protocol.d.ts +27 -0
  68. package/lib/installation-admin-protocol.d.ts.map +1 -0
  69. package/lib/installation-admin-protocol.js +30 -0
  70. package/lib/installation-admin-protocol.js.map +1 -0
  71. package/lib/messaging/browser/connection.d.ts +5 -3
  72. package/lib/messaging/browser/connection.d.ts.map +1 -1
  73. package/lib/messaging/browser/connection.js +183 -33
  74. package/lib/messaging/browser/connection.js.map +1 -1
  75. package/lib/messaging/browser/window-connection.js +35 -55
  76. package/lib/messaging/browser/window-connection.js.map +1 -1
  77. package/lib/messaging/client-call-metrics.d.ts +35 -0
  78. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  79. package/lib/messaging/client-call-metrics.js +83 -0
  80. package/lib/messaging/client-call-metrics.js.map +1 -0
  81. package/lib/messaging/error.d.ts +5 -1
  82. package/lib/messaging/error.d.ts.map +1 -1
  83. package/lib/messaging/error.js +10 -2
  84. package/lib/messaging/error.js.map +1 -1
  85. package/lib/messaging/handler.d.ts +10 -0
  86. package/lib/messaging/handler.d.ts.map +1 -1
  87. package/lib/messaging/node/connection.d.ts +1 -17
  88. package/lib/messaging/node/connection.d.ts.map +1 -1
  89. package/lib/messaging/node/connection.js +23 -59
  90. package/lib/messaging/node/connection.js.map +1 -1
  91. package/lib/messaging/proxy-factory.d.ts +2 -0
  92. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  93. package/lib/messaging/proxy-factory.js +74 -159
  94. package/lib/messaging/proxy-factory.js.map +1 -1
  95. package/lib/oss-allowlist.d.ts +14 -0
  96. package/lib/oss-allowlist.d.ts.map +1 -0
  97. package/lib/oss-allowlist.js +8 -0
  98. package/lib/oss-allowlist.js.map +1 -0
  99. package/lib/payment-protocol.d.ts +18 -0
  100. package/lib/payment-protocol.d.ts.map +1 -0
  101. package/lib/payment-protocol.js +13 -0
  102. package/lib/payment-protocol.js.map +1 -0
  103. package/lib/permission.d.ts +8 -3
  104. package/lib/permission.d.ts.map +1 -1
  105. package/lib/permission.js +36 -19
  106. package/lib/permission.js.map +1 -1
  107. package/lib/plans.d.ts +210 -0
  108. package/lib/plans.d.ts.map +1 -0
  109. package/lib/plans.js +570 -0
  110. package/lib/plans.js.map +1 -0
  111. package/lib/protocol.d.ts +118 -58
  112. package/lib/protocol.d.ts.map +1 -1
  113. package/lib/protocol.js +116 -130
  114. package/lib/protocol.js.map +1 -1
  115. package/lib/snapshot-url.d.ts +14 -0
  116. package/lib/snapshot-url.d.ts.map +1 -0
  117. package/lib/snapshot-url.js +26 -0
  118. package/lib/snapshot-url.js.map +1 -0
  119. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
  120. package/lib/snapshot-url.spec.d.ts.map +1 -0
  121. package/lib/snapshot-url.spec.js +41 -0
  122. package/lib/snapshot-url.spec.js.map +1 -0
  123. package/lib/team-subscription-protocol.d.ts +73 -0
  124. package/lib/team-subscription-protocol.d.ts.map +1 -0
  125. package/lib/team-subscription-protocol.js +63 -0
  126. package/lib/team-subscription-protocol.js.map +1 -0
  127. package/lib/teams-projects-protocol.d.ts +113 -0
  128. package/lib/teams-projects-protocol.d.ts.map +1 -0
  129. package/lib/teams-projects-protocol.js +30 -0
  130. package/lib/teams-projects-protocol.js.map +1 -0
  131. package/lib/util/analytics.d.ts +8 -0
  132. package/lib/util/analytics.d.ts.map +1 -0
  133. package/lib/util/analytics.js +79 -0
  134. package/lib/util/analytics.js.map +1 -0
  135. package/lib/util/async-iterator.js +55 -133
  136. package/lib/util/async-iterator.js.map +1 -1
  137. package/lib/util/cancelable.js +17 -59
  138. package/lib/util/cancelable.js.map +1 -1
  139. package/lib/util/date-time.js +8 -8
  140. package/lib/util/date-time.js.map +1 -1
  141. package/lib/util/deferred.js +10 -12
  142. package/lib/util/deferred.js.map +1 -1
  143. package/lib/util/disposable.js +26 -39
  144. package/lib/util/disposable.js.map +1 -1
  145. package/lib/util/event.js +58 -74
  146. package/lib/util/event.js.map +1 -1
  147. package/lib/util/garbage-collected-cache.d.ts +1 -0
  148. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  149. package/lib/util/garbage-collected-cache.js +26 -46
  150. package/lib/util/garbage-collected-cache.js.map +1 -1
  151. package/lib/util/generate-workspace-id.d.ts +4 -0
  152. package/lib/util/generate-workspace-id.d.ts.map +1 -0
  153. package/lib/util/generate-workspace-id.js +487 -0
  154. package/lib/util/generate-workspace-id.js.map +1 -0
  155. package/lib/util/{without.d.ts → generate-workspace-id.spec.d.ts} +2 -2
  156. package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
  157. package/lib/util/generate-workspace-id.spec.js +87 -0
  158. package/lib/util/generate-workspace-id.spec.js.map +1 -0
  159. package/lib/util/gitpod-cookie.d.ts +20 -0
  160. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  161. package/lib/util/gitpod-cookie.js +44 -0
  162. package/lib/util/gitpod-cookie.js.map +1 -0
  163. package/lib/util/gitpod-host-url.d.ts +2 -2
  164. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  165. package/lib/util/gitpod-host-url.js +96 -95
  166. package/lib/util/gitpod-host-url.js.map +1 -1
  167. package/lib/util/gitpod-host-url.spec.d.ts +8 -1
  168. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  169. package/lib/util/gitpod-host-url.spec.js +104 -22
  170. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  171. package/lib/util/grpc.d.ts +15 -0
  172. package/lib/util/grpc.d.ts.map +1 -0
  173. package/lib/util/grpc.js +18 -0
  174. package/lib/util/grpc.js.map +1 -0
  175. package/lib/util/jaeger-client-types.d.ts +68 -0
  176. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  177. package/lib/util/{without.js → jaeger-client-types.js} +1 -1
  178. package/lib/util/jaeger-client-types.js.map +1 -0
  179. package/lib/util/logging.d.ts +49 -33
  180. package/lib/util/logging.d.ts.map +1 -1
  181. package/lib/util/logging.js +107 -110
  182. package/lib/util/logging.js.map +1 -1
  183. package/lib/util/make-link.js +2 -2
  184. package/lib/util/make-link.js.map +1 -1
  185. package/lib/util/parse-workspace-id.d.ts +13 -3
  186. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  187. package/lib/util/parse-workspace-id.js +38 -8
  188. package/lib/util/parse-workspace-id.js.map +1 -1
  189. package/lib/util/parse-workspace-id.spec.d.ts +8 -0
  190. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  191. package/lib/util/parse-workspace-id.spec.js +127 -47
  192. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  193. package/lib/util/queue.js +16 -55
  194. package/lib/util/queue.js.map +1 -1
  195. package/lib/util/queue.spec.js +144 -288
  196. package/lib/util/queue.spec.js.map +1 -1
  197. package/lib/util/repeat.d.ts +15 -0
  198. package/lib/util/repeat.d.ts.map +1 -0
  199. package/lib/util/repeat.js +55 -0
  200. package/lib/util/repeat.js.map +1 -0
  201. package/lib/util/semaphore.js +15 -46
  202. package/lib/util/semaphore.js.map +1 -1
  203. package/lib/util/skip-if.js +6 -6
  204. package/lib/util/skip-if.js.map +1 -1
  205. package/lib/util/timeutil.js +28 -16
  206. package/lib/util/timeutil.js.map +1 -1
  207. package/lib/util/timeutil.spec.js +21 -24
  208. package/lib/util/timeutil.spec.js.map +1 -1
  209. package/lib/util/tracing.d.ts +51 -5
  210. package/lib/util/tracing.d.ts.map +1 -1
  211. package/lib/util/tracing.js +197 -62
  212. package/lib/util/tracing.js.map +1 -1
  213. package/lib/util/tracing.spec.d.ts +7 -0
  214. package/lib/util/tracing.spec.d.ts.map +1 -0
  215. package/lib/util/tracing.spec.js +121 -0
  216. package/lib/util/tracing.spec.js.map +1 -0
  217. package/lib/util/workspace-port-authentication.js +3 -2
  218. package/lib/util/workspace-port-authentication.js.map +1 -1
  219. package/lib/workspace-cluster.d.ts +76 -0
  220. package/lib/workspace-cluster.d.ts.map +1 -0
  221. package/lib/workspace-cluster.js +33 -0
  222. package/lib/workspace-cluster.js.map +1 -0
  223. package/lib/workspace-instance.d.ts +26 -2
  224. package/lib/workspace-instance.d.ts.map +1 -1
  225. package/lib/wsready.d.ts +1 -1
  226. package/lib/wsready.js +2 -2
  227. package/package.json +33 -17
  228. package/pkg-yarn.lock +18 -9
  229. package/provenance-bundle.jsonl +2 -0
  230. package/src/accounting-protocol.ts +229 -0
  231. package/src/admin-protocol.ts +53 -5
  232. package/src/analytics.ts +54 -0
  233. package/src/auth.ts +27 -0
  234. package/src/context-url.spec.ts +53 -0
  235. package/src/context-url.ts +107 -0
  236. package/src/email-protocol.ts +2 -3
  237. package/src/env.ts +10 -10
  238. package/src/gitpod-service.ts +237 -38
  239. package/src/headless-workspace-log.ts +7 -11
  240. package/src/ide-frontend-service.ts +5 -1
  241. package/src/ide-protocol.ts +119 -0
  242. package/src/index.ts +7 -1
  243. package/src/installation-admin-protocol.ts +42 -0
  244. package/src/messaging/browser/connection.ts +195 -14
  245. package/src/messaging/client-call-metrics.ts +97 -0
  246. package/src/messaging/error.ts +14 -2
  247. package/src/messaging/handler.ts +12 -0
  248. package/src/messaging/node/connection.ts +21 -68
  249. package/src/messaging/proxy-factory.ts +14 -6
  250. package/src/oss-allowlist.ts +15 -0
  251. package/src/payment-protocol.ts +20 -0
  252. package/src/permission.ts +24 -9
  253. package/src/plans.ts +632 -0
  254. package/src/protocol.ts +192 -87
  255. package/src/snapshot-url.spec.ts +25 -0
  256. package/src/snapshot-url.ts +27 -0
  257. package/src/team-subscription-protocol.ts +113 -0
  258. package/src/teams-projects-protocol.ts +147 -0
  259. package/src/util/analytics.ts +87 -0
  260. package/src/util/deferred.ts +1 -1
  261. package/src/util/garbage-collected-cache.ts +9 -3
  262. package/src/util/generate-workspace-id.spec.ts +48 -0
  263. package/src/util/generate-workspace-id.ts +475 -0
  264. package/src/util/gitpod-cookie.ts +39 -0
  265. package/src/util/gitpod-host-url.spec.ts +30 -1
  266. package/src/util/gitpod-host-url.ts +27 -13
  267. package/src/util/grpc.ts +15 -0
  268. package/src/util/jaeger-client-types.ts +102 -0
  269. package/src/util/logging.ts +102 -38
  270. package/src/util/parse-workspace-id.spec.ts +45 -4
  271. package/src/util/parse-workspace-id.ts +38 -7
  272. package/src/util/queue.spec.ts +1 -1
  273. package/src/util/repeat.ts +45 -0
  274. package/src/util/semaphore.ts +2 -2
  275. package/src/util/skip-if.ts +1 -1
  276. package/src/util/timeutil.ts +4 -4
  277. package/src/util/tracing.spec.ts +83 -0
  278. package/src/util/tracing.ts +183 -17
  279. package/src/workspace-cluster.ts +104 -0
  280. package/src/workspace-instance.ts +51 -13
  281. package/src/wsready.ts +2 -2
  282. package/lib/messaging/connection-error-handler.d.ts +0 -27
  283. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  284. package/lib/messaging/connection-error-handler.js +0 -46
  285. package/lib/messaging/connection-error-handler.js.map +0 -1
  286. package/lib/util/repeater.d.ts +0 -22
  287. package/lib/util/repeater.d.ts.map +0 -1
  288. package/lib/util/repeater.js +0 -118
  289. package/lib/util/repeater.js.map +0 -1
  290. package/lib/util/safe-promise.d.ts +0 -11
  291. package/lib/util/safe-promise.d.ts.map +0 -1
  292. package/lib/util/safe-promise.js +0 -34
  293. package/lib/util/safe-promise.js.map +0 -1
  294. package/lib/util/without.d.ts.map +0 -1
  295. package/lib/util/without.js.map +0 -1
  296. package/src/messaging/connection-error-handler.ts +0 -62
  297. package/src/util/jaeger-client.d.ts +0 -105
  298. package/src/util/repeater.ts +0 -49
  299. package/src/util/safe-promise.ts +0 -26
@@ -0,0 +1,487 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.animals = exports.colors = exports.generateWorkspaceID = void 0;
13
+ /**
14
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
15
+ * Licensed under the GNU Affero General Public License (AGPL).
16
+ * See License-AGPL.txt in the project root for license information.
17
+ */
18
+ const randomNumber = require("random-number-csprng");
19
+ function generateWorkspaceID(firstSegment, secondSegment) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const firstSeg = clean(firstSegment) || (yield random(exports.colors));
22
+ const secSeg = clean(secondSegment, Math.min(15, 23 - firstSeg.length)) || (yield random(exports.animals));
23
+ return firstSeg + '-' + secSeg + '-' + (yield random(characters, 11));
24
+ });
25
+ }
26
+ exports.generateWorkspaceID = generateWorkspaceID;
27
+ function clean(segment, maxChars = 15) {
28
+ if (!segment) {
29
+ return undefined;
30
+ }
31
+ segment = segment.toLowerCase();
32
+ let result = '';
33
+ for (let i = 0; i < segment.length; i++) {
34
+ if (characters.indexOf(segment[i]) !== -1) {
35
+ result += segment[i];
36
+ }
37
+ }
38
+ if (result.length >= 2) {
39
+ return result.substring(0, maxChars);
40
+ }
41
+ }
42
+ function random(array, length = 1) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ var result = '';
45
+ for (var i = 0; i < length; i++) {
46
+ result += array[yield randomNumber(0, array.length - 1)];
47
+ }
48
+ return result;
49
+ });
50
+ }
51
+ const characters = 'abcdefghijklmnopqrstuvwxyz0123456789'.split('');
52
+ exports.colors = [
53
+ 'amaranth',
54
+ 'amber',
55
+ 'amethyst',
56
+ 'apricot',
57
+ 'aqua',
58
+ 'aquamarine',
59
+ 'azure',
60
+ 'beige',
61
+ 'black',
62
+ 'blue',
63
+ 'blush',
64
+ 'bronze',
65
+ 'brown',
66
+ 'chocolate',
67
+ 'coffee',
68
+ 'copper',
69
+ 'coral',
70
+ 'crimson',
71
+ 'cyan',
72
+ 'emerald',
73
+ 'fuchsia',
74
+ 'gold',
75
+ 'gray',
76
+ 'green',
77
+ 'harlequin',
78
+ 'indigo',
79
+ 'ivory',
80
+ 'jade',
81
+ 'kumquat',
82
+ 'lavender',
83
+ 'lime',
84
+ 'magenta',
85
+ 'maroon',
86
+ 'moccasin',
87
+ 'olive',
88
+ 'orange',
89
+ 'peach',
90
+ 'pink',
91
+ 'plum',
92
+ 'purple',
93
+ 'red',
94
+ 'rose',
95
+ 'salmon',
96
+ 'sapphire',
97
+ 'scarlet',
98
+ 'silver',
99
+ 'tan',
100
+ 'teal',
101
+ 'tomato',
102
+ 'turquoise',
103
+ 'violet',
104
+ 'white',
105
+ 'yellow',
106
+ ];
107
+ exports.animals = [
108
+ 'canidae',
109
+ 'felidae',
110
+ 'cat',
111
+ 'cattle',
112
+ 'dog',
113
+ 'donkey',
114
+ 'goat',
115
+ 'horse',
116
+ 'pig',
117
+ 'rabbit',
118
+ 'aardvark',
119
+ 'aardwolf',
120
+ 'albatross',
121
+ 'alligator',
122
+ 'alpaca',
123
+ 'amphibian',
124
+ 'anaconda',
125
+ 'angelfish',
126
+ 'anglerfish',
127
+ 'ant',
128
+ 'anteater',
129
+ 'antelope',
130
+ 'antlion',
131
+ 'ape',
132
+ 'aphid',
133
+ 'armadillo',
134
+ 'asp',
135
+ 'baboon',
136
+ 'badger',
137
+ 'bandicoot',
138
+ 'barnacle',
139
+ 'barracuda',
140
+ 'basilisk',
141
+ 'bass',
142
+ 'bat',
143
+ 'bear',
144
+ 'beaver',
145
+ 'bedbug',
146
+ 'bee',
147
+ 'beetle',
148
+ 'bird',
149
+ 'bison',
150
+ 'blackbird',
151
+ 'boa',
152
+ 'boar',
153
+ 'bobcat',
154
+ 'bobolink',
155
+ 'bonobo',
156
+ 'booby',
157
+ 'bovid',
158
+ 'bug',
159
+ 'butterfly',
160
+ 'buzzard',
161
+ 'camel',
162
+ 'canid',
163
+ 'capybara',
164
+ 'cardinal',
165
+ 'caribou',
166
+ 'carp',
167
+ 'cat',
168
+ 'catshark',
169
+ 'caterpillar',
170
+ 'catfish',
171
+ 'cattle',
172
+ 'centipede',
173
+ 'cephalopod',
174
+ 'chameleon',
175
+ 'cheetah',
176
+ 'chickadee',
177
+ 'chicken',
178
+ 'chimpanzee',
179
+ 'chinchilla',
180
+ 'chipmunk',
181
+ 'clam',
182
+ 'clownfish',
183
+ 'cobra',
184
+ 'cockroach',
185
+ 'cod',
186
+ 'condor',
187
+ 'constrictor',
188
+ 'coral',
189
+ 'cougar',
190
+ 'cow',
191
+ 'coyote',
192
+ 'crab',
193
+ 'crane',
194
+ 'crawdad',
195
+ 'crayfish',
196
+ 'cricket',
197
+ 'crocodile',
198
+ 'crow',
199
+ 'cuckoo',
200
+ 'cicada',
201
+ 'damselfly',
202
+ 'deer',
203
+ 'dingo',
204
+ 'dinosaur',
205
+ 'dodo',
206
+ 'dog',
207
+ 'dolphin',
208
+ 'donkey',
209
+ 'dormouse',
210
+ 'dove',
211
+ 'dragonfly',
212
+ 'dragon',
213
+ 'duck',
214
+ 'eagle',
215
+ 'earthworm',
216
+ 'earwig',
217
+ 'echidna',
218
+ 'eel',
219
+ 'egret',
220
+ 'elephant',
221
+ 'elk',
222
+ 'emu',
223
+ 'ermine',
224
+ 'falcon',
225
+ 'ferret',
226
+ 'finch',
227
+ 'firefly',
228
+ 'fish',
229
+ 'flamingo',
230
+ 'flea',
231
+ 'fly',
232
+ 'flyingfish',
233
+ 'fowl',
234
+ 'fox',
235
+ 'frog',
236
+ 'gamefowl',
237
+ 'galliform',
238
+ 'gazelle',
239
+ 'gecko',
240
+ 'gerbil',
241
+ 'gibbon',
242
+ 'giraffe',
243
+ 'goat',
244
+ 'goldfish',
245
+ 'goose',
246
+ 'gopher',
247
+ 'gorilla',
248
+ 'grasshopper',
249
+ 'grouse',
250
+ 'guan',
251
+ 'guanaco',
252
+ 'guineafowl',
253
+ 'gull',
254
+ 'guppy',
255
+ 'haddock',
256
+ 'halibut',
257
+ 'hamster',
258
+ 'hare',
259
+ 'harrier',
260
+ 'hawk',
261
+ 'hedgehog',
262
+ 'heron',
263
+ 'herring',
264
+ 'hippopotamus',
265
+ 'hookworm',
266
+ 'hornet',
267
+ 'horse',
268
+ 'hoverfly',
269
+ 'hummingbird',
270
+ 'hyena',
271
+ 'iguana',
272
+ 'impala',
273
+ 'jackal',
274
+ 'jaguar',
275
+ 'jay',
276
+ 'jellyfish',
277
+ 'junglefowl',
278
+ 'kangaroo',
279
+ 'kingfisher',
280
+ 'kite',
281
+ 'kiwi',
282
+ 'koala',
283
+ 'koi',
284
+ 'krill',
285
+ 'ladybug',
286
+ 'lamprey',
287
+ 'landfowl',
288
+ 'lark',
289
+ 'leech',
290
+ 'lemming',
291
+ 'lemur',
292
+ 'leopard',
293
+ 'leopon',
294
+ 'limpet',
295
+ 'lion',
296
+ 'lizard',
297
+ 'llama',
298
+ 'lobster',
299
+ 'locust',
300
+ 'loon',
301
+ 'louse',
302
+ 'lungfish',
303
+ 'lynx',
304
+ 'macaw',
305
+ 'mackerel',
306
+ 'magpie',
307
+ 'mammal',
308
+ 'manatee',
309
+ 'mandrill',
310
+ 'marlin',
311
+ 'marmoset',
312
+ 'marmot',
313
+ 'marsupial',
314
+ 'marten',
315
+ 'mastodon',
316
+ 'meadowlark',
317
+ 'meerkat',
318
+ 'mink',
319
+ 'minnow',
320
+ 'mite',
321
+ 'mockingbird',
322
+ 'mole',
323
+ 'mollusk',
324
+ 'mongoose',
325
+ 'monkey',
326
+ 'moose',
327
+ 'mosquito',
328
+ 'moth',
329
+ 'mouse',
330
+ 'mule',
331
+ 'muskox',
332
+ 'narwhal',
333
+ 'newt',
334
+ 'nightingale',
335
+ 'ocelot',
336
+ 'octopus',
337
+ 'opossum',
338
+ 'orangutan',
339
+ 'orca',
340
+ 'ostrich',
341
+ 'otter',
342
+ 'owl',
343
+ 'ox',
344
+ 'panda',
345
+ 'panther',
346
+ 'parakeet',
347
+ 'parrot',
348
+ 'parrotfish',
349
+ 'partridge',
350
+ 'peacock',
351
+ 'peafowl',
352
+ 'pelican',
353
+ 'penguin',
354
+ 'perch',
355
+ 'pheasant',
356
+ 'pig',
357
+ 'pigeon',
358
+ 'pike',
359
+ 'pinniped',
360
+ 'piranha',
361
+ 'planarian',
362
+ 'platypus',
363
+ 'pony',
364
+ 'porcupine',
365
+ 'porpoise',
366
+ 'possum',
367
+ 'prawn',
368
+ 'primate',
369
+ 'ptarmigan',
370
+ 'puffin',
371
+ 'puma',
372
+ 'python',
373
+ 'quail',
374
+ 'quelea',
375
+ 'quokka',
376
+ 'rabbit',
377
+ 'raccoon',
378
+ 'rat',
379
+ 'rattlesnake',
380
+ 'raven',
381
+ 'reindeer',
382
+ 'reptile',
383
+ 'rhinoceros',
384
+ 'roadrunner',
385
+ 'rodent',
386
+ 'rook',
387
+ 'rooster',
388
+ 'roundworm',
389
+ 'sailfish',
390
+ 'salamander',
391
+ 'salmon',
392
+ 'sawfish',
393
+ 'scallop',
394
+ 'scorpion',
395
+ 'seahorse',
396
+ 'shark',
397
+ 'sheep',
398
+ 'shrew',
399
+ 'shrimp',
400
+ 'silkworm',
401
+ 'silverfish',
402
+ 'skink',
403
+ 'skunk',
404
+ 'sloth',
405
+ 'slug',
406
+ 'smelt',
407
+ 'snail',
408
+ 'snake',
409
+ 'snipe',
410
+ 'sole',
411
+ 'sparrow',
412
+ 'spider',
413
+ 'spoonbill',
414
+ 'squid',
415
+ 'squirrel',
416
+ 'starfish',
417
+ 'stingray',
418
+ 'stoat',
419
+ 'stork',
420
+ 'sturgeon',
421
+ 'swallow',
422
+ 'swan',
423
+ 'swift',
424
+ 'swordfish',
425
+ 'swordtail',
426
+ 'tahr',
427
+ 'takin',
428
+ 'tapir',
429
+ 'tarantula',
430
+ 'tarsier',
431
+ 'termite',
432
+ 'tern',
433
+ 'thrush',
434
+ 'tick',
435
+ 'tiger',
436
+ 'tiglon',
437
+ 'toad',
438
+ 'tortoise',
439
+ 'toucan',
440
+ 'trout',
441
+ 'tuna',
442
+ 'turkey',
443
+ 'turtle',
444
+ 'tyrannosaurus',
445
+ 'urial',
446
+ 'vicuna',
447
+ 'viper',
448
+ 'vole',
449
+ 'vulture',
450
+ 'wallaby',
451
+ 'walrus',
452
+ 'wasp',
453
+ 'warbler',
454
+ 'weasel',
455
+ 'whale',
456
+ 'whippet',
457
+ 'whitefish',
458
+ 'wildcat',
459
+ 'wildebeest',
460
+ 'wildfowl',
461
+ 'wolf',
462
+ 'wolverine',
463
+ 'wombat',
464
+ 'woodpecker',
465
+ 'worm',
466
+ 'wren',
467
+ 'xerinae',
468
+ 'yak',
469
+ 'zebra',
470
+ 'alpaca',
471
+ 'cat',
472
+ 'cattle',
473
+ 'chicken',
474
+ 'dog',
475
+ 'donkey',
476
+ 'ferret',
477
+ 'gayal',
478
+ 'goldfish',
479
+ 'guppy',
480
+ 'horse',
481
+ 'koi',
482
+ 'llama',
483
+ 'sheep',
484
+ 'yak',
485
+ 'unicorn',
486
+ ];
487
+ //# sourceMappingURL=generate-workspace-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-workspace-id.js","sourceRoot":"","sources":["../../src/util/generate-workspace-id.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;GAIG;AACH,qDAAsD;AAEtD,SAAsB,mBAAmB,CAAC,YAAqB,EAAE,aAAsB;;QACnF,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,KAAI,MAAM,MAAM,CAAC,cAAM,CAAC,CAAA,CAAC;QAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAI,MAAM,MAAM,CAAC,eAAO,CAAC,CAAA,CAAC;QACjG,OAAO,QAAQ,GAAC,GAAG,GAAC,MAAM,GAAC,GAAG,GAAC,CAAC,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;CAAA;AAJD,kDAIC;AAED,SAAS,KAAK,CAAC,OAA2B,EAAE,WAAmB,EAAE;IAC/D,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAChC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;YACzC,MAAM,IAAI,OAAO,C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IACR,QAAQ;IACR,eAAe;IACf,OAAO;IACP,QAAQ;IACR,OAAO;IACP,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;IACN,SAAS;IACT,QAAQ;IACR,OAAO;IACP,SAAS;IACT,WAAW;IACX,SAAS;IACT,YAAY;IACZ,UAAU;IACV,MAAM;IACN,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,MAAM;IACN,SAAS;IACT,KAAK;IACL,OAAO;IACP,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,SAAS;IACT,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,UAAU;IACV,OAAO;IACP,OAAO;IACP,KAAK;IACL,OAAO;IACP,OAAO;IACP,KAAK;IACL,SAAS;CACV,CAAA"}
@@ -3,5 +3,5 @@
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
4
  * See License-AGPL.txt in the project root for license information.
5
5
  */
6
- export declare type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
7
- //# sourceMappingURL=without.d.ts.map
6
+ export {};
7
+ //# sourceMappingURL=generate-workspace-id.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-workspace-id.spec.d.ts","sourceRoot":"","sources":["../../src/util/generate-workspace-id.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License-AGPL.txt in the project root for license information.
6
+ */
7
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
11
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
12
+ };
13
+ var __metadata = (this && this.__metadata) || function (k, v) {
14
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
+ };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const mocha_typescript_1 = require("mocha-typescript");
27
+ const chai = require("chai");
28
+ const generate_workspace_id_1 = require("./generate-workspace-id");
29
+ const gitpod_host_url_1 = require("./gitpod-host-url");
30
+ const expect = chai.expect;
31
+ let TestGenerateWorkspaceId = class TestGenerateWorkspaceId {
32
+ testGenerateWorkspaceId() {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ for (let i = 0; i < 100; i++) {
35
+ const id = yield (0, generate_workspace_id_1.generateWorkspaceID)();
36
+ expect(new gitpod_host_url_1.GitpodHostUrl().withWorkspacePrefix(id, "eu").workspaceId).to.equal(id);
37
+ }
38
+ });
39
+ }
40
+ testLongestName() {
41
+ const longestColor = generate_workspace_id_1.colors.sort((a, b) => b.length - a.length)[0];
42
+ const longestAnimal = generate_workspace_id_1.animals.sort((a, b) => b.length - a.length)[0];
43
+ const longestName = `${longestColor}-${longestAnimal}-12345678`;
44
+ expect(longestName.length <= 36, `"${longestName}" is longer than 36 chars (${longestName.length})`).to.be.true;
45
+ }
46
+ testCustomName() {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const data = [
49
+ ['foo', 'bar', 'foo-bar-'],
50
+ ['f', 'bar', '.{2,16}-bar-'],
51
+ ['gitpod-io', 'gitpod', 'gitpodio-gitpod-'],
52
+ ['this is rather long and has some "§$"% special chars', 'also here pretty long and needs abbreviation', 'thisisratherlon-alsohere-'],
53
+ ['breatheco-de', 'python-flask-api-tutorial', 'breathecode-pythonflaska-'],
54
+ ['UPPER', "CaSe", "upper-case-"]
55
+ ];
56
+ for (const d of data) {
57
+ const id = yield (0, generate_workspace_id_1.generateWorkspaceID)(d[0], d[1]);
58
+ expect(id).match(new RegExp("^" + d[2]));
59
+ expect(new gitpod_host_url_1.GitpodHostUrl().withWorkspacePrefix(id, "eu").workspaceId).to.equal(id);
60
+ expect(id.length <= 36, `"${id}" is longer than 36 chars (${id.length})`).to.be.true;
61
+ }
62
+ });
63
+ }
64
+ };
65
+ __decorate([
66
+ mocha_typescript_1.test,
67
+ __metadata("design:type", Function),
68
+ __metadata("design:paramtypes", []),
69
+ __metadata("design:returntype", Promise)
70
+ ], TestGenerateWorkspaceId.prototype, "testGenerateWorkspaceId", null);
71
+ __decorate([
72
+ mocha_typescript_1.test,
73
+ __metadata("design:type", Function),
74
+ __metadata("design:paramtypes", []),
75
+ __metadata("design:returntype", void 0)
76
+ ], TestGenerateWorkspaceId.prototype, "testLongestName", null);
77
+ __decorate([
78
+ mocha_typescript_1.test,
79
+ __metadata("design:type", Function),
80
+ __metadata("design:paramtypes", []),
81
+ __metadata("design:returntype", Promise)
82
+ ], TestGenerateWorkspaceId.prototype, "testCustomName", null);
83
+ TestGenerateWorkspaceId = __decorate([
84
+ mocha_typescript_1.suite
85
+ ], TestGenerateWorkspaceId);
86
+ module.exports = new TestGenerateWorkspaceId();
87
+ //# sourceMappingURL=generate-workspace-id.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-workspace-id.spec.js","sourceRoot":"","sources":["../../src/util/generate-workspace-id.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;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AAC,kBAAkB,CAAC;gBACzC,CAAC,sDAAsD,EAAC,8CAA8C,EAAC,2BAA2B,CAAC;gBACnI,CAAC,cAAc,EAAE,2BAA2B,EAAE,2BAA2B,CAAC;gBAC1E,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC;aACnC,CAAA;YACD,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE;gBAClB,MAAM,EAAE,GAAG,MAAM,IAAA,2CAAmB,EAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjD,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,GAAG,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvC,MAAM,CAAC,IAAI,+BAAa,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACnF,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI,EAAE,8BAA8B,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;aACxF;QACL,CAAC;KAAA;CAEJ,CAAA;AA/BS;IAAL,uBAAI;;;;sEAKJ;AAEK;IAAL,uBAAI;;;;8DAKJ;AAEK;IAAL,uBAAI;;;;6DAeJ;AA/BQ,uBAAuB;IAAnC,wBAAK;GAAO,uBAAuB,CAiCnC;AACD,MAAM,CAAC,OAAO,GAAG,IAAI,uBAAuB,EAAE,CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+ import * as cookie from 'cookie';
7
+ /**
8
+ * This cookie indicates whether the connected client is a Gitpod user (= "has logged in within the last year") or not.
9
+ * This is used by "gitpod.io" and "www.gitpod.io" to display different content/buttons.
10
+ */
11
+ export declare const NAME = "gitpod-user";
12
+ export declare const VALUE = "true";
13
+ /**
14
+ * @param domain The domain the Gitpod installation is installed onto
15
+ * @returns
16
+ */
17
+ export declare function options(domain: string): cookie.CookieSerializeOptions;
18
+ export declare function generateCookie(domain: string): string;
19
+ export declare function isPresent(cookies: string): boolean;
20
+ //# sourceMappingURL=gitpod-cookie.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitpod-cookie.d.ts","sourceRoot":"","sources":["../../src/util/gitpod-cookie.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAGjC;;;GAGG;AACH,eAAO,MAAM,IAAI,gBAAgB,CAAC;AAClC,eAAO,MAAM,KAAK,SAAS,CAAC;AAE5B;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,sBAAsB,CAUrE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGlD"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPresent = exports.generateCookie = exports.options = exports.VALUE = exports.NAME = void 0;
4
+ /**
5
+ * Copyright (c) 2021 Gitpod GmbH. All rights reserved.
6
+ * Licensed under the GNU Affero General Public License (AGPL).
7
+ * See License-AGPL.txt in the project root for license information.
8
+ */
9
+ const cookie = require("cookie");
10
+ /**
11
+ * This cookie indicates whether the connected client is a Gitpod user (= "has logged in within the last year") or not.
12
+ * This is used by "gitpod.io" and "www.gitpod.io" to display different content/buttons.
13
+ */
14
+ exports.NAME = "gitpod-user";
15
+ exports.VALUE = "true";
16
+ /**
17
+ * @param domain The domain the Gitpod installation is installed onto
18
+ * @returns
19
+ */
20
+ function options(domain) {
21
+ // Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
22
+ return {
23
+ path: "/",
24
+ httpOnly: false,
25
+ secure: false,
26
+ maxAge: 60 * 60 * 24 * 365,
27
+ sameSite: "lax",
28
+ domain: `.${domain}`, // explicilty include subdomains to not only cover "gitpod.io", but also "www.gitpod.io" or workspaces
29
+ };
30
+ }
31
+ exports.options = options;
32
+ ;
33
+ function generateCookie(domain) {
34
+ return cookie.serialize(exports.NAME, exports.VALUE, options(domain));
35
+ }
36
+ exports.generateCookie = generateCookie;
37
+ ;
38
+ function isPresent(cookies) {
39
+ // needs to match the old (gitpod-user=loggedIn) and new (gitpod-user=true) values to ensure a smooth transition during rollout.
40
+ return !!cookies.match(`${exports.NAME}=`);
41
+ }
42
+ exports.isPresent = isPresent;
43
+ ;
44
+ //# sourceMappingURL=gitpod-cookie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitpod-cookie.js","sourceRoot":"","sources":["../../src/util/gitpod-cookie.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,iCAAiC;AAGjC;;;GAGG;AACU,QAAA,IAAI,GAAG,aAAa,CAAC;AACrB,QAAA,KAAK,GAAG,MAAM,CAAC;AAE5B;;;GAGG;AACH,SAAgB,OAAO,CAAC,MAAc;IAClC,uEAAuE;IACvE,OAAO;QACH,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG;QAC1B,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,IAAI,MAAM,EAAE,EAAgB,sGAAsG;KAC7I,CAAC;AACN,CAAC;AAVD,0BAUC;AAAA,CAAC;AAEF,SAAgB,cAAc,CAAC,MAAc;IACzC,OAAO,MAAM,CAAC,SAAS,CAAC,YAAI,EAAE,aAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,CAAC;AAFD,wCAEC;AAAA,CAAC;AAEF,SAAgB,SAAS,CAAC,OAAe;IACrC,gIAAgI;IAChI,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,YAAI,GAAG,CAAC,CAAC;AACvC,CAAC;AAHD,8BAGC;AAAA,CAAC"}