@camaradesuk/git-worktree-tools 1.8.0 → 1.9.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 (143) hide show
  1. package/dist/cli/cleanpr.test.js +2 -0
  2. package/dist/cli/cleanpr.test.js.map +1 -1
  3. package/dist/cli/newpr.js +207 -14
  4. package/dist/cli/newpr.js.map +1 -1
  5. package/dist/cli/newpr.test.js +313 -4
  6. package/dist/cli/newpr.test.js.map +1 -1
  7. package/dist/cli/prs.test.js +2 -0
  8. package/dist/cli/prs.test.js.map +1 -1
  9. package/dist/cli/wt/interactive-menu.test.js +3 -0
  10. package/dist/cli/wt/interactive-menu.test.js.map +1 -1
  11. package/dist/cli/wtconfig.d.ts +1 -0
  12. package/dist/cli/wtconfig.d.ts.map +1 -1
  13. package/dist/cli/wtconfig.js +115 -0
  14. package/dist/cli/wtconfig.js.map +1 -1
  15. package/dist/cli/wtconfig.test.js +3 -0
  16. package/dist/cli/wtconfig.test.js.map +1 -1
  17. package/dist/cli/wtlink.js +31 -12
  18. package/dist/cli/wtlink.js.map +1 -1
  19. package/dist/e2e/wt/interactive-menu.e2e.test.js +2 -2
  20. package/dist/e2e/wt/interactive-menu.e2e.test.js.map +1 -1
  21. package/dist/lib/ai/types.d.ts +12 -0
  22. package/dist/lib/ai/types.d.ts.map +1 -1
  23. package/dist/lib/ai/types.js.map +1 -1
  24. package/dist/lib/cleanpr/worktree-info.d.ts.map +1 -1
  25. package/dist/lib/cleanpr/worktree-info.js +1 -6
  26. package/dist/lib/cleanpr/worktree-info.js.map +1 -1
  27. package/dist/lib/cleanpr/worktree-info.test.js +10 -13
  28. package/dist/lib/cleanpr/worktree-info.test.js.map +1 -1
  29. package/dist/lib/config-editor.d.ts.map +1 -1
  30. package/dist/lib/config-editor.js.map +1 -1
  31. package/dist/lib/config-migration/detector.d.ts +25 -0
  32. package/dist/lib/config-migration/detector.d.ts.map +1 -0
  33. package/dist/lib/config-migration/detector.js +372 -0
  34. package/dist/lib/config-migration/detector.js.map +1 -0
  35. package/dist/lib/config-migration/detector.test.d.ts +5 -0
  36. package/dist/lib/config-migration/detector.test.d.ts.map +1 -0
  37. package/dist/lib/config-migration/detector.test.js +201 -0
  38. package/dist/lib/config-migration/detector.test.js.map +1 -0
  39. package/dist/lib/config-migration/index.d.ts +29 -0
  40. package/dist/lib/config-migration/index.d.ts.map +1 -0
  41. package/dist/lib/config-migration/index.js +33 -0
  42. package/dist/lib/config-migration/index.js.map +1 -0
  43. package/dist/lib/config-migration/reporter.d.ts +53 -0
  44. package/dist/lib/config-migration/reporter.d.ts.map +1 -0
  45. package/dist/lib/config-migration/reporter.js +257 -0
  46. package/dist/lib/config-migration/reporter.js.map +1 -0
  47. package/dist/lib/config-migration/reporter.test.d.ts +5 -0
  48. package/dist/lib/config-migration/reporter.test.d.ts.map +1 -0
  49. package/dist/lib/config-migration/reporter.test.js +305 -0
  50. package/dist/lib/config-migration/reporter.test.js.map +1 -0
  51. package/dist/lib/config-migration/runner.d.ts +46 -0
  52. package/dist/lib/config-migration/runner.d.ts.map +1 -0
  53. package/dist/lib/config-migration/runner.js +364 -0
  54. package/dist/lib/config-migration/runner.js.map +1 -0
  55. package/dist/lib/config-migration/runner.test.d.ts +5 -0
  56. package/dist/lib/config-migration/runner.test.d.ts.map +1 -0
  57. package/dist/lib/config-migration/runner.test.js +235 -0
  58. package/dist/lib/config-migration/runner.test.js.map +1 -0
  59. package/dist/lib/config-migration/types.d.ts +120 -0
  60. package/dist/lib/config-migration/types.d.ts.map +1 -0
  61. package/dist/lib/config-migration/types.js +70 -0
  62. package/dist/lib/config-migration/types.js.map +1 -0
  63. package/dist/lib/config-validation.d.ts.map +1 -1
  64. package/dist/lib/config-validation.js +6 -0
  65. package/dist/lib/config-validation.js.map +1 -1
  66. package/dist/lib/config-validation.test.js +25 -0
  67. package/dist/lib/config-validation.test.js.map +1 -1
  68. package/dist/lib/config.d.ts +31 -7
  69. package/dist/lib/config.d.ts.map +1 -1
  70. package/dist/lib/config.js +2 -0
  71. package/dist/lib/config.js.map +1 -1
  72. package/dist/lib/hooks/confirmation.d.ts +49 -0
  73. package/dist/lib/hooks/confirmation.d.ts.map +1 -0
  74. package/dist/lib/hooks/confirmation.js +147 -0
  75. package/dist/lib/hooks/confirmation.js.map +1 -0
  76. package/dist/lib/hooks/confirmation.test.d.ts +7 -0
  77. package/dist/lib/hooks/confirmation.test.d.ts.map +1 -0
  78. package/dist/lib/hooks/confirmation.test.js +300 -0
  79. package/dist/lib/hooks/confirmation.test.js.map +1 -0
  80. package/dist/lib/hooks/executor.d.ts +16 -1
  81. package/dist/lib/hooks/executor.d.ts.map +1 -1
  82. package/dist/lib/hooks/executor.js +53 -4
  83. package/dist/lib/hooks/executor.js.map +1 -1
  84. package/dist/lib/hooks/index.d.ts +4 -2
  85. package/dist/lib/hooks/index.d.ts.map +1 -1
  86. package/dist/lib/hooks/index.js +3 -2
  87. package/dist/lib/hooks/index.js.map +1 -1
  88. package/dist/lib/hooks/types.d.ts +16 -0
  89. package/dist/lib/hooks/types.d.ts.map +1 -1
  90. package/dist/lib/hooks/types.js +12 -0
  91. package/dist/lib/hooks/types.js.map +1 -1
  92. package/dist/lib/lswt/action-executors.d.ts +2 -0
  93. package/dist/lib/lswt/action-executors.d.ts.map +1 -1
  94. package/dist/lib/lswt/action-executors.js +4 -3
  95. package/dist/lib/lswt/action-executors.js.map +1 -1
  96. package/dist/lib/lswt/action-executors.test.js +7 -0
  97. package/dist/lib/lswt/action-executors.test.js.map +1 -1
  98. package/dist/lib/lswt/environment.d.ts +21 -2
  99. package/dist/lib/lswt/environment.d.ts.map +1 -1
  100. package/dist/lib/lswt/environment.js +73 -32
  101. package/dist/lib/lswt/environment.js.map +1 -1
  102. package/dist/lib/lswt/environment.test.js +79 -1
  103. package/dist/lib/lswt/environment.test.js.map +1 -1
  104. package/dist/lib/lswt/worktree-info.d.ts.map +1 -1
  105. package/dist/lib/lswt/worktree-info.js +1 -6
  106. package/dist/lib/lswt/worktree-info.js.map +1 -1
  107. package/dist/lib/lswt/worktree-info.test.js +5 -17
  108. package/dist/lib/lswt/worktree-info.test.js.map +1 -1
  109. package/dist/lib/newpr/args.d.ts.map +1 -1
  110. package/dist/lib/newpr/args.js +15 -1
  111. package/dist/lib/newpr/args.js.map +1 -1
  112. package/dist/lib/newpr/hook-runner.d.ts +11 -0
  113. package/dist/lib/newpr/hook-runner.d.ts.map +1 -1
  114. package/dist/lib/newpr/hook-runner.js +49 -1
  115. package/dist/lib/newpr/hook-runner.js.map +1 -1
  116. package/dist/lib/newpr/hook-runner.test.js +121 -0
  117. package/dist/lib/newpr/hook-runner.test.js.map +1 -1
  118. package/dist/lib/newpr/plan-generator.d.ts +121 -0
  119. package/dist/lib/newpr/plan-generator.d.ts.map +1 -0
  120. package/dist/lib/newpr/plan-generator.js +185 -0
  121. package/dist/lib/newpr/plan-generator.js.map +1 -0
  122. package/dist/lib/newpr/plan-generator.test.d.ts +7 -0
  123. package/dist/lib/newpr/plan-generator.test.d.ts.map +1 -0
  124. package/dist/lib/newpr/plan-generator.test.js +387 -0
  125. package/dist/lib/newpr/plan-generator.test.js.map +1 -0
  126. package/dist/lib/newpr/types.d.ts +6 -0
  127. package/dist/lib/newpr/types.d.ts.map +1 -1
  128. package/dist/lib/prs/actions.d.ts +5 -1
  129. package/dist/lib/prs/actions.d.ts.map +1 -1
  130. package/dist/lib/prs/actions.js +12 -10
  131. package/dist/lib/prs/actions.js.map +1 -1
  132. package/dist/lib/prs/actions.test.js +48 -5
  133. package/dist/lib/prs/actions.test.js.map +1 -1
  134. package/dist/lib/wtconfig/environment.d.ts +18 -1
  135. package/dist/lib/wtconfig/environment.d.ts.map +1 -1
  136. package/dist/lib/wtconfig/environment.js +60 -24
  137. package/dist/lib/wtconfig/environment.js.map +1 -1
  138. package/dist/lib/wtconfig/environment.test.js +45 -1
  139. package/dist/lib/wtconfig/environment.test.js.map +1 -1
  140. package/dist/lib/wtlink/config-manifest.test.js +26 -0
  141. package/dist/lib/wtlink/config-manifest.test.js.map +1 -1
  142. package/package.json +2 -1
  143. package/schemas/worktreerc.schema.json +23 -0
@@ -0,0 +1,305 @@
1
+ /**
2
+ * Tests for Config Migration Reporter
3
+ */
4
+ import { describe, it, expect } from 'vitest';
5
+ import { formatMigrationReport, formatMigrationReportJSON, formatMigrationResultReport, formatMigrationResultJSON, formatDryRunPreview, } from './reporter.js';
6
+ import { CURRENT_CONFIG_VERSION } from './types.js';
7
+ describe('Config Migration Reporter', () => {
8
+ describe('formatMigrationReport', () => {
9
+ it('formats issues grouped by severity', () => {
10
+ const detection = {
11
+ issues: [
12
+ {
13
+ type: 'future_version',
14
+ severity: 'error',
15
+ message: 'Config version is too new',
16
+ autoFixable: false,
17
+ },
18
+ {
19
+ type: 'missing_version',
20
+ severity: 'warning',
21
+ message: 'Missing configVersion',
22
+ autoFixable: true,
23
+ fixAction: {
24
+ type: 'set_key',
25
+ keyPath: 'configVersion',
26
+ value: 1,
27
+ description: 'Set configVersion to 1',
28
+ },
29
+ },
30
+ {
31
+ type: 'unknown_key',
32
+ severity: 'info',
33
+ message: 'Unknown key: foo',
34
+ autoFixable: false,
35
+ },
36
+ ],
37
+ autoFixableCount: 1,
38
+ manualFixCount: 2,
39
+ migrationRecommended: true,
40
+ targetVersion: CURRENT_CONFIG_VERSION,
41
+ legacyFilesFound: [],
42
+ };
43
+ const output = formatMigrationReport(detection);
44
+ expect(output).toContain('Config Migration Report');
45
+ expect(output).toContain('Errors:');
46
+ expect(output).toContain('Warnings:');
47
+ expect(output).toContain('Info:');
48
+ expect(output).toContain('1 auto-fixable');
49
+ expect(output).toContain('2 manual');
50
+ });
51
+ it('includes auto-fix indicators', () => {
52
+ const detection = {
53
+ issues: [
54
+ {
55
+ type: 'missing_version',
56
+ severity: 'warning',
57
+ message: 'Missing configVersion',
58
+ autoFixable: true,
59
+ fixAction: {
60
+ type: 'set_key',
61
+ keyPath: 'configVersion',
62
+ value: 1,
63
+ description: 'Set configVersion',
64
+ },
65
+ },
66
+ ],
67
+ autoFixableCount: 1,
68
+ manualFixCount: 0,
69
+ migrationRecommended: true,
70
+ targetVersion: CURRENT_CONFIG_VERSION,
71
+ legacyFilesFound: [],
72
+ };
73
+ const output = formatMigrationReport(detection);
74
+ expect(output).toContain('[auto-fix available]');
75
+ });
76
+ it('shows success message for empty issues', () => {
77
+ const detection = {
78
+ issues: [],
79
+ autoFixableCount: 0,
80
+ manualFixCount: 0,
81
+ migrationRecommended: false,
82
+ targetVersion: CURRENT_CONFIG_VERSION,
83
+ legacyFilesFound: [],
84
+ };
85
+ const output = formatMigrationReport(detection);
86
+ expect(output).toContain('No migration issues found');
87
+ expect(output).toContain('up to date');
88
+ });
89
+ it('includes suggestions when present', () => {
90
+ const detection = {
91
+ issues: [
92
+ {
93
+ type: 'unknown_key',
94
+ severity: 'info',
95
+ message: 'Unknown key: baseBranhc',
96
+ keyPath: 'baseBranhc',
97
+ suggestion: 'Did you mean "baseBranch"?',
98
+ autoFixable: false,
99
+ },
100
+ ],
101
+ autoFixableCount: 0,
102
+ manualFixCount: 1,
103
+ migrationRecommended: false,
104
+ targetVersion: CURRENT_CONFIG_VERSION,
105
+ legacyFilesFound: [],
106
+ };
107
+ const output = formatMigrationReport(detection);
108
+ expect(output).toContain('Did you mean "baseBranch"?');
109
+ });
110
+ });
111
+ describe('formatMigrationReportJSON', () => {
112
+ it('returns JSON-serializable object matching schema', () => {
113
+ const detection = {
114
+ issues: [
115
+ {
116
+ type: 'missing_version',
117
+ severity: 'warning',
118
+ message: 'Missing configVersion',
119
+ keyPath: 'configVersion',
120
+ suggestedValue: 1,
121
+ autoFixable: true,
122
+ fixAction: {
123
+ type: 'set_key',
124
+ keyPath: 'configVersion',
125
+ value: 1,
126
+ description: 'Set configVersion to 1',
127
+ },
128
+ },
129
+ ],
130
+ autoFixableCount: 1,
131
+ manualFixCount: 0,
132
+ migrationRecommended: true,
133
+ currentVersion: undefined,
134
+ targetVersion: CURRENT_CONFIG_VERSION,
135
+ configPath: '/path/to/.worktreerc',
136
+ legacyFilesFound: ['/path/to/.wtlinkrc'],
137
+ };
138
+ const json = formatMigrationReportJSON(detection);
139
+ expect(json).toHaveProperty('summary');
140
+ expect(json).toHaveProperty('issues');
141
+ expect(json).toHaveProperty('configPath');
142
+ expect(json).toHaveProperty('legacyFilesFound');
143
+ const summary = json.summary;
144
+ expect(summary.totalIssues).toBe(1);
145
+ expect(summary.autoFixableCount).toBe(1);
146
+ expect(summary.migrationRecommended).toBe(true);
147
+ expect(summary.targetVersion).toBe(CURRENT_CONFIG_VERSION);
148
+ const issues = json.issues;
149
+ expect(issues).toHaveLength(1);
150
+ expect(issues[0]).toHaveProperty('type', 'missing_version');
151
+ expect(issues[0]).toHaveProperty('fixAction');
152
+ });
153
+ it('serializes to valid JSON', () => {
154
+ const detection = {
155
+ issues: [],
156
+ autoFixableCount: 0,
157
+ manualFixCount: 0,
158
+ migrationRecommended: false,
159
+ targetVersion: CURRENT_CONFIG_VERSION,
160
+ legacyFilesFound: [],
161
+ };
162
+ const json = formatMigrationReportJSON(detection);
163
+ const serialized = JSON.stringify(json);
164
+ const parsed = JSON.parse(serialized);
165
+ expect(parsed).toEqual(json);
166
+ });
167
+ });
168
+ describe('formatMigrationResultReport', () => {
169
+ it('formats successful migration with actions', () => {
170
+ const result = {
171
+ success: true,
172
+ actionsExecuted: [
173
+ {
174
+ type: 'set_key',
175
+ keyPath: 'configVersion',
176
+ value: 1,
177
+ description: 'Set configVersion to 1',
178
+ },
179
+ { type: 'merge_legacy_file', filePath: '.wtlinkrc', description: 'Merged .wtlinkrc' },
180
+ ],
181
+ actionsSkipped: [],
182
+ errors: [],
183
+ backupPath: '/path/to/.worktree-backups/.worktreerc.backup.123',
184
+ newConfigPath: '/path/to/.worktreerc',
185
+ };
186
+ const output = formatMigrationResultReport(result);
187
+ expect(output).toContain('Migration complete');
188
+ expect(output).toContain('2 action(s) applied');
189
+ expect(output).toContain('Set configVersion to 1');
190
+ expect(output).toContain('Merged .wtlinkrc');
191
+ expect(output).toContain('Backup saved to');
192
+ });
193
+ it('formats successful migration with no changes', () => {
194
+ const result = {
195
+ success: true,
196
+ actionsExecuted: [],
197
+ actionsSkipped: [],
198
+ errors: [],
199
+ };
200
+ const output = formatMigrationResultReport(result);
201
+ expect(output).toContain('already up to date');
202
+ expect(output).toContain('No changes needed');
203
+ });
204
+ it('formats failed migration with errors', () => {
205
+ const result = {
206
+ success: false,
207
+ actionsExecuted: [
208
+ { type: 'set_key', keyPath: 'configVersion', value: 1, description: 'Set configVersion' },
209
+ ],
210
+ actionsSkipped: [
211
+ { type: 'merge_legacy_file', filePath: '.wtlinkrc', description: 'Merge .wtlinkrc' },
212
+ ],
213
+ errors: ['Failed to write config: Permission denied'],
214
+ backupPath: '/path/to/backup',
215
+ };
216
+ const output = formatMigrationResultReport(result);
217
+ expect(output).toContain('Migration failed');
218
+ expect(output).toContain('Permission denied');
219
+ expect(output).toContain('Backup available');
220
+ expect(output).toContain('Actions completed before failure');
221
+ expect(output).toContain('Actions skipped');
222
+ });
223
+ });
224
+ describe('formatMigrationResultJSON', () => {
225
+ it('returns JSON-serializable object', () => {
226
+ const result = {
227
+ success: true,
228
+ actionsExecuted: [
229
+ { type: 'set_key', keyPath: 'configVersion', value: 1, description: 'Set configVersion' },
230
+ ],
231
+ actionsSkipped: [],
232
+ errors: [],
233
+ backupPath: '/path/to/backup',
234
+ newConfigPath: '/path/to/.worktreerc',
235
+ };
236
+ const json = formatMigrationResultJSON(result);
237
+ expect(json).toHaveProperty('success', true);
238
+ expect(json).toHaveProperty('backupPath');
239
+ expect(json).toHaveProperty('actionsExecuted');
240
+ expect(json.actionsExecuted).toHaveLength(1);
241
+ });
242
+ });
243
+ describe('formatDryRunPreview', () => {
244
+ it('lists actions that would be taken', () => {
245
+ const detection = {
246
+ issues: [
247
+ {
248
+ type: 'missing_version',
249
+ severity: 'warning',
250
+ message: 'Missing configVersion',
251
+ autoFixable: true,
252
+ fixAction: {
253
+ type: 'set_key',
254
+ keyPath: 'configVersion',
255
+ value: 1,
256
+ description: 'Set configVersion to 1',
257
+ },
258
+ },
259
+ {
260
+ type: 'legacy_wtlinkrc',
261
+ severity: 'warning',
262
+ message: 'Legacy file found',
263
+ autoFixable: true,
264
+ fixAction: {
265
+ type: 'merge_legacy_file',
266
+ filePath: '.wtlinkrc',
267
+ description: 'Merge .wtlinkrc into config',
268
+ },
269
+ },
270
+ ],
271
+ autoFixableCount: 2,
272
+ manualFixCount: 0,
273
+ migrationRecommended: true,
274
+ targetVersion: CURRENT_CONFIG_VERSION,
275
+ legacyFilesFound: [],
276
+ };
277
+ const output = formatDryRunPreview(detection);
278
+ expect(output).toContain('[DRY RUN]');
279
+ expect(output).toContain('Preview');
280
+ expect(output).toContain('Set configVersion to 1');
281
+ expect(output).toContain('Merge .wtlinkrc into config');
282
+ expect(output).toContain('No files were modified');
283
+ });
284
+ it('shows message when no auto-fixable changes', () => {
285
+ const detection = {
286
+ issues: [
287
+ {
288
+ type: 'unknown_key',
289
+ severity: 'info',
290
+ message: 'Unknown key',
291
+ autoFixable: false,
292
+ },
293
+ ],
294
+ autoFixableCount: 0,
295
+ manualFixCount: 1,
296
+ migrationRecommended: false,
297
+ targetVersion: CURRENT_CONFIG_VERSION,
298
+ legacyFilesFound: [],
299
+ };
300
+ const output = formatDryRunPreview(detection);
301
+ expect(output).toContain('No auto-fixable changes to make');
302
+ });
303
+ });
304
+ });
305
+ //# sourceMappingURL=reporter.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.test.js","sourceRoot":"","sources":["../../../src/lib/config-migration/reporter.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO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,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Config Migration Runner
3
+ *
4
+ * Executes migration actions with:
5
+ * - Atomic writes (temp file + rename)
6
+ * - Backup creation before modifications
7
+ * - Rollback on failure
8
+ * - Legacy file merging
9
+ */
10
+ import { type DetectionResult, type MigrationOptions, type MigrationResult, type WtlinkMergeResult } from './types.js';
11
+ /**
12
+ * Merge wtlink configurations from existing config and legacy file
13
+ * Uses "enabled wins" conflict resolution
14
+ */
15
+ export declare function mergeWtlinkConfigs(existing: {
16
+ enabled?: string[];
17
+ disabled?: string[];
18
+ } | undefined, legacy: {
19
+ enabled: string[];
20
+ disabled: string[];
21
+ }): WtlinkMergeResult;
22
+ /**
23
+ * Create a backup of the current config file
24
+ *
25
+ * @param configPath - Path to the config file to backup
26
+ * @param repoRoot - Repository root for backup directory
27
+ * @returns Path to the backup file
28
+ */
29
+ export declare function createConfigBackup(configPath: string, repoRoot: string): string;
30
+ /**
31
+ * Restore config from a backup file
32
+ *
33
+ * @param backupPath - Path to the backup file
34
+ * @param configPath - Path to restore to
35
+ */
36
+ export declare function restoreFromBackup(backupPath: string, configPath: string): void;
37
+ /**
38
+ * Execute migration with given options
39
+ *
40
+ * @param repoRoot - Repository root path
41
+ * @param detection - Detection result from detectMigrationIssues
42
+ * @param options - Migration options
43
+ * @returns Migration result
44
+ */
45
+ export declare function runMigration(repoRoot: string, detection: DetectionResult, options?: MigrationOptions): Promise<MigrationResult>;
46
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/lib/config-migration/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,OAAO,EAGL,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AASpB;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,EACjE,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GAChD,iBAAiB,CAsCnB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB/E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAO9E;AAoFD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,eAAe,EAC1B,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,eAAe,CAAC,CA0N1B"}