donobu 2.13.1 → 2.14.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/dist/apis/SpecialFlowsApi.js +6 -6
- package/dist/apis/SpecialFlowsApi.js.map +1 -1
- package/dist/assets/generated/parameter-schemas.json +246 -145
- package/dist/assets/generated/version +1 -1
- package/dist/esm/apis/SpecialFlowsApi.js +6 -6
- package/dist/esm/apis/SpecialFlowsApi.js.map +1 -1
- package/dist/esm/assets/generated/parameter-schemas.json +246 -145
- package/dist/esm/assets/generated/version +1 -1
- package/dist/esm/managers/DonobuFlow.d.ts +3 -3
- package/dist/esm/managers/DonobuFlow.d.ts.map +1 -1
- package/dist/esm/managers/DonobuFlow.js +7 -4
- package/dist/esm/managers/DonobuFlow.js.map +1 -1
- package/dist/esm/managers/DonobuFlowsManager.d.ts +1 -1
- package/dist/esm/managers/DonobuFlowsManager.d.ts.map +1 -1
- package/dist/esm/managers/DonobuFlowsManager.js +8 -8
- package/dist/esm/managers/DonobuFlowsManager.js.map +1 -1
- package/dist/esm/managers/InteractionVisualizer.d.ts +35 -0
- package/dist/esm/managers/InteractionVisualizer.d.ts.map +1 -0
- package/dist/esm/managers/InteractionVisualizer.js +235 -0
- package/dist/esm/managers/InteractionVisualizer.js.map +1 -0
- package/dist/esm/managers/ToolTipper.d.ts +14 -17
- package/dist/esm/managers/ToolTipper.d.ts.map +1 -1
- package/dist/esm/managers/ToolTipper.js +170 -141
- package/dist/esm/managers/ToolTipper.js.map +1 -1
- package/dist/esm/models/CreateDonobuFlow.d.ts +2 -2
- package/dist/esm/models/CreateDonobuFlow.d.ts.map +1 -1
- package/dist/esm/models/FlowMetadata.d.ts +2 -2
- package/dist/esm/models/FlowMetadata.d.ts.map +1 -1
- package/dist/esm/models/ToolCallContext.d.ts +2 -2
- package/dist/esm/models/ToolCallContext.d.ts.map +1 -1
- package/dist/esm/persistence/DonobuSqliteDb.d.ts.map +1 -1
- package/dist/esm/persistence/DonobuSqliteDb.js +35 -0
- package/dist/esm/persistence/DonobuSqliteDb.js.map +1 -1
- package/dist/esm/playwrightTestExtensions.d.ts.map +1 -1
- package/dist/esm/playwrightTestExtensions.js +29 -12
- package/dist/esm/playwrightTestExtensions.js.map +1 -1
- package/dist/esm/tools/ExtractGoogleStreetviewEntityDataTool.d.ts.map +1 -1
- package/dist/esm/tools/ExtractGoogleStreetviewEntityDataTool.js +1 -1
- package/dist/esm/tools/ExtractGoogleStreetviewEntityDataTool.js.map +1 -1
- package/dist/esm/tools/ReplayableInteraction.d.ts.map +1 -1
- package/dist/esm/tools/ReplayableInteraction.js +6 -2
- package/dist/esm/tools/ReplayableInteraction.js.map +1 -1
- package/dist/managers/DonobuFlow.d.ts +3 -3
- package/dist/managers/DonobuFlow.d.ts.map +1 -1
- package/dist/managers/DonobuFlow.js +7 -4
- package/dist/managers/DonobuFlow.js.map +1 -1
- package/dist/managers/DonobuFlowsManager.d.ts +1 -1
- package/dist/managers/DonobuFlowsManager.d.ts.map +1 -1
- package/dist/managers/DonobuFlowsManager.js +8 -8
- package/dist/managers/DonobuFlowsManager.js.map +1 -1
- package/dist/managers/InteractionVisualizer.d.ts +35 -0
- package/dist/managers/InteractionVisualizer.d.ts.map +1 -0
- package/dist/managers/InteractionVisualizer.js +235 -0
- package/dist/managers/InteractionVisualizer.js.map +1 -0
- package/dist/managers/ToolTipper.d.ts +14 -17
- package/dist/managers/ToolTipper.d.ts.map +1 -1
- package/dist/managers/ToolTipper.js +170 -141
- package/dist/managers/ToolTipper.js.map +1 -1
- package/dist/models/CreateDonobuFlow.d.ts +2 -2
- package/dist/models/CreateDonobuFlow.d.ts.map +1 -1
- package/dist/models/FlowMetadata.d.ts +2 -2
- package/dist/models/FlowMetadata.d.ts.map +1 -1
- package/dist/models/ToolCallContext.d.ts +2 -2
- package/dist/models/ToolCallContext.d.ts.map +1 -1
- package/dist/persistence/DonobuSqliteDb.d.ts.map +1 -1
- package/dist/persistence/DonobuSqliteDb.js +35 -0
- package/dist/persistence/DonobuSqliteDb.js.map +1 -1
- package/dist/playwrightTestExtensions.d.ts.map +1 -1
- package/dist/playwrightTestExtensions.js +29 -12
- package/dist/playwrightTestExtensions.js.map +1 -1
- package/dist/tools/ExtractGoogleStreetviewEntityDataTool.d.ts.map +1 -1
- package/dist/tools/ExtractGoogleStreetviewEntityDataTool.js +1 -1
- package/dist/tools/ExtractGoogleStreetviewEntityDataTool.js.map +1 -1
- package/dist/tools/ReplayableInteraction.d.ts.map +1 -1
- package/dist/tools/ReplayableInteraction.js +6 -2
- package/dist/tools/ReplayableInteraction.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteractionVisualizer = void 0;
|
|
4
|
+
const Logger_1 = require("../utils/Logger");
|
|
5
|
+
const main_1 = require("../main");
|
|
6
|
+
/**
|
|
7
|
+
* Class for visualizing interactions in a webpage with a virtual mouse and messages.
|
|
8
|
+
*/
|
|
9
|
+
class InteractionVisualizer {
|
|
10
|
+
constructor(defaultDurationMillis) {
|
|
11
|
+
this.defaultDurationMillis = defaultDurationMillis;
|
|
12
|
+
this.currentMousePosition = { x: 0, y: 0 };
|
|
13
|
+
this.isMouseVisible = false;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Show the given message text visually adjacent to the given element for the given duration.
|
|
17
|
+
* Moves the virtual mouse to the element with a smooth animation.
|
|
18
|
+
* Blocks execution for the duration.
|
|
19
|
+
*/
|
|
20
|
+
async pointAt(page, element, message, durationMillis = this.defaultDurationMillis) {
|
|
21
|
+
if (!message.trim() || !durationMillis || durationMillis <= 0) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
// Get element position for mouse movement
|
|
26
|
+
const boundingBox = await element.boundingBox();
|
|
27
|
+
if (!boundingBox) {
|
|
28
|
+
Logger_1.appLogger.error('Failed to get element bounding box');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
// Calculate target position (center of the element)
|
|
32
|
+
const targetX = boundingBox.x + boundingBox.width / 2;
|
|
33
|
+
const targetY = boundingBox.y + boundingBox.height / 2;
|
|
34
|
+
// Start mouse movement and message display in parallel
|
|
35
|
+
const mouseMovementPromise = this.moveVirtualMouse(page, targetX, targetY, durationMillis / 2);
|
|
36
|
+
// Display the message for the element
|
|
37
|
+
await this.displayMessageNearElement(element, message);
|
|
38
|
+
// Create a promise for the message duration
|
|
39
|
+
const messageDurationPromise = page.waitForTimeout(durationMillis);
|
|
40
|
+
// Wait for both mouse movement and message duration to complete
|
|
41
|
+
await Promise.all([mouseMovementPromise, messageDurationPromise]);
|
|
42
|
+
// Remove only the message after the duration (keep the mouse)
|
|
43
|
+
await element.evaluate((_, [messageContainerId]) => {
|
|
44
|
+
const container = document.getElementById(messageContainerId);
|
|
45
|
+
if (container) {
|
|
46
|
+
const shadow = container.shadowRoot;
|
|
47
|
+
if (shadow) {
|
|
48
|
+
// Remove only message elements but keep the mouse
|
|
49
|
+
const messages = Array.from(shadow.querySelectorAll('.donobu-message'));
|
|
50
|
+
messages.forEach((msg) => msg.remove());
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, [InteractionVisualizer.MESSAGE_CONTAINER_ID]);
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
if (main_1.PlaywrightUtils.isPageClosedError(e)) {
|
|
57
|
+
throw e;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
Logger_1.appLogger.error(`Failed to display message at element`, e);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Moves the virtual mouse to the target position with a smooth animation.
|
|
66
|
+
*/
|
|
67
|
+
async moveVirtualMouse(page, targetX, targetY, durationMillis) {
|
|
68
|
+
await page.evaluate(([containerId, mouseId, startX, startY, endX, endY, duration]) => {
|
|
69
|
+
return new Promise((resolve) => {
|
|
70
|
+
// 1) Find or create the container
|
|
71
|
+
let container = document.getElementById(containerId);
|
|
72
|
+
if (!container) {
|
|
73
|
+
container = document.createElement('div');
|
|
74
|
+
container.id = containerId;
|
|
75
|
+
container.style.position = 'absolute';
|
|
76
|
+
container.style.top = '0';
|
|
77
|
+
container.style.left = '0';
|
|
78
|
+
container.style.width = '100%';
|
|
79
|
+
container.style.height = '100%';
|
|
80
|
+
container.style.pointerEvents = 'none';
|
|
81
|
+
document.body.appendChild(container);
|
|
82
|
+
const shadowRoot = container.attachShadow({ mode: 'open' });
|
|
83
|
+
// Insert style
|
|
84
|
+
const styleEl = document.createElement('style');
|
|
85
|
+
styleEl.textContent = `
|
|
86
|
+
:host { all: initial; }
|
|
87
|
+
.donobu-message {
|
|
88
|
+
z-index: 2147483647;
|
|
89
|
+
background-color: black;
|
|
90
|
+
color: white;
|
|
91
|
+
padding: 8px;
|
|
92
|
+
border-radius: 5px;
|
|
93
|
+
font-size: 12px;
|
|
94
|
+
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
95
|
+
display: block;
|
|
96
|
+
max-width: 300px;
|
|
97
|
+
white-space: pre-wrap;
|
|
98
|
+
box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
|
|
99
|
+
position: absolute;
|
|
100
|
+
}
|
|
101
|
+
.virtual-mouse {
|
|
102
|
+
width: 20px;
|
|
103
|
+
height: 20px;
|
|
104
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M0,0 L12,10 L7,11 L10,18 L8,19 L5,12 L0,16 Z' fill='%23ffffff' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E");
|
|
105
|
+
background-repeat: no-repeat;
|
|
106
|
+
background-size: contain;
|
|
107
|
+
position: absolute;
|
|
108
|
+
z-index: 2147483646;
|
|
109
|
+
transition-property: left, top;
|
|
110
|
+
transition-timing-function: ease-in-out;
|
|
111
|
+
filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.5));
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
shadowRoot.appendChild(styleEl);
|
|
115
|
+
}
|
|
116
|
+
const shadow = container.shadowRoot;
|
|
117
|
+
if (!shadow) {
|
|
118
|
+
resolve();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// Find or create mouse
|
|
122
|
+
let mouse = shadow.getElementById(mouseId);
|
|
123
|
+
if (!mouse) {
|
|
124
|
+
mouse = document.createElement('div');
|
|
125
|
+
mouse.id = mouseId;
|
|
126
|
+
mouse.className = 'virtual-mouse';
|
|
127
|
+
// Initial position if first time
|
|
128
|
+
mouse.style.left = `${startX}px`;
|
|
129
|
+
mouse.style.top = `${startY}px`;
|
|
130
|
+
mouse.style.transitionDuration = '0s'; // No animation initially
|
|
131
|
+
shadow.appendChild(mouse);
|
|
132
|
+
// Force reflow to ensure initial position is applied before animation
|
|
133
|
+
void mouse.offsetWidth;
|
|
134
|
+
}
|
|
135
|
+
// Animate the mouse
|
|
136
|
+
mouse.style.transitionDuration = `${duration}ms`;
|
|
137
|
+
mouse.style.left = `${endX - 10}px`; // Offset by half the cursor size
|
|
138
|
+
mouse.style.top = `${endY - 5}px`; // Offset to position pointer tip at target
|
|
139
|
+
// Resolve when transition completes or timeout as fallback
|
|
140
|
+
const transitionEndHandler = () => {
|
|
141
|
+
mouse?.removeEventListener('transitionend', transitionEndHandler);
|
|
142
|
+
resolve();
|
|
143
|
+
};
|
|
144
|
+
mouse.addEventListener('transitionend', transitionEndHandler);
|
|
145
|
+
// Fallback in case transitionend doesn't fire
|
|
146
|
+
setTimeout(resolve, duration + 50);
|
|
147
|
+
});
|
|
148
|
+
}, [
|
|
149
|
+
InteractionVisualizer.MESSAGE_CONTAINER_ID,
|
|
150
|
+
InteractionVisualizer.VIRTUAL_MOUSE_ID,
|
|
151
|
+
this.currentMousePosition.x,
|
|
152
|
+
this.currentMousePosition.y,
|
|
153
|
+
targetX,
|
|
154
|
+
targetY,
|
|
155
|
+
durationMillis,
|
|
156
|
+
]);
|
|
157
|
+
// Update current mouse position
|
|
158
|
+
this.currentMousePosition = { x: targetX, y: targetY };
|
|
159
|
+
this.isMouseVisible = true;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Creates a message adjacent to the element, inside a shadow root to avoid CSS collisions.
|
|
163
|
+
*/
|
|
164
|
+
async displayMessageNearElement(element, message) {
|
|
165
|
+
await element.evaluate((targetElement, [messageContainerId, message]) => {
|
|
166
|
+
// 1) Find container (should already exist from moveVirtualMouse)
|
|
167
|
+
const container = document.getElementById(messageContainerId);
|
|
168
|
+
if (!container || !container.shadowRoot) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const shadow = container.shadowRoot;
|
|
172
|
+
// 2) Insert message
|
|
173
|
+
const messageElement = document.createElement('div');
|
|
174
|
+
messageElement.className = 'donobu-message';
|
|
175
|
+
messageElement.textContent = message;
|
|
176
|
+
// Temporarily place off-screen to measure size
|
|
177
|
+
messageElement.style.left = '-9999px';
|
|
178
|
+
messageElement.style.top = '-9999px';
|
|
179
|
+
shadow.appendChild(messageElement);
|
|
180
|
+
// 3) Compute final position
|
|
181
|
+
const rect = targetElement.getBoundingClientRect();
|
|
182
|
+
let x = rect.left + window.scrollX;
|
|
183
|
+
let y = rect.bottom + window.scrollY + 10;
|
|
184
|
+
messageElement.style.left = `${x}px`;
|
|
185
|
+
messageElement.style.top = `${y}px`;
|
|
186
|
+
// Adjust if it goes off-screen to the right
|
|
187
|
+
const msgRect = messageElement.getBoundingClientRect();
|
|
188
|
+
const overflowRight = msgRect.right - window.innerWidth;
|
|
189
|
+
if (overflowRight > 0) {
|
|
190
|
+
messageElement.style.left = `${x - overflowRight - 10}px`;
|
|
191
|
+
}
|
|
192
|
+
// Adjust if it goes off-screen to the left
|
|
193
|
+
if (msgRect.left < 0) {
|
|
194
|
+
messageElement.style.left = `${window.scrollX + 10}px`;
|
|
195
|
+
}
|
|
196
|
+
}, [InteractionVisualizer.MESSAGE_CONTAINER_ID, message]);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Hide the virtual mouse.
|
|
200
|
+
*/
|
|
201
|
+
async hideVirtualMouse(page) {
|
|
202
|
+
if (!this.isMouseVisible) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
await page.evaluate(([containerId, mouseId]) => {
|
|
206
|
+
const container = document.getElementById(containerId);
|
|
207
|
+
if (container && container.shadowRoot) {
|
|
208
|
+
const mouse = container.shadowRoot.getElementById(mouseId);
|
|
209
|
+
if (mouse) {
|
|
210
|
+
mouse.remove();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}, [
|
|
214
|
+
InteractionVisualizer.MESSAGE_CONTAINER_ID,
|
|
215
|
+
InteractionVisualizer.VIRTUAL_MOUSE_ID,
|
|
216
|
+
]);
|
|
217
|
+
this.isMouseVisible = false;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Clean up all messages and the virtual mouse.
|
|
221
|
+
*/
|
|
222
|
+
async cleanUp(page) {
|
|
223
|
+
await page.evaluate(([containerId]) => {
|
|
224
|
+
const container = document.getElementById(containerId);
|
|
225
|
+
if (container) {
|
|
226
|
+
container.remove();
|
|
227
|
+
}
|
|
228
|
+
}, [InteractionVisualizer.MESSAGE_CONTAINER_ID]);
|
|
229
|
+
this.isMouseVisible = false;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
exports.InteractionVisualizer = InteractionVisualizer;
|
|
233
|
+
InteractionVisualizer.MESSAGE_CONTAINER_ID = 'donobu-message-shadow-container';
|
|
234
|
+
InteractionVisualizer.VIRTUAL_MOUSE_ID = 'virtual-mouse';
|
|
235
|
+
//# sourceMappingURL=InteractionVisualizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionVisualizer.js","sourceRoot":"","sources":["../../../src/managers/Interaction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IACI,KAAK,CAAC,OAAO,CAAC,IAAU;QAC7B,MAAM,IAAI,CAAC,QAAQ,CACjB,CAAC,CAAC,WAAW,CAAC,EAAE,EAAE;YAChB,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YACvD,IAAI,SAAS,EAAE,CAAC;gBACd,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,CAAC;QACH,CAAC,EACD,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAC7C,CAAC;QAEF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC9B,CAAC;;AAhSH,sDAiSC;AAhSyB,0CAAoB,GAC1C,iCAAiC,AADS,CACR;AACZ,sCAAgB,GAAG,eAAe,AAAlB,CAAmB"}
|
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
import { Page, Locator } from 'playwright';
|
|
2
2
|
export declare class ToolTipper {
|
|
3
|
-
readonly
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
blipToolTip(page: Page, toolTip: string, duration?: number): Promise<void>;
|
|
3
|
+
readonly defaultDurationMillis: number;
|
|
4
|
+
private static readonly TOOL_TIP_CONTAINER_ID;
|
|
5
|
+
private static readonly VIRTUAL_MOUSE_ID;
|
|
6
|
+
private currentMousePosition;
|
|
7
|
+
private isMouseVisible;
|
|
8
|
+
constructor(defaultDurationMillis: number);
|
|
10
9
|
/**
|
|
11
10
|
* Show the given tooltip text visually adjacent to the given element for the given duration.
|
|
11
|
+
* Moves the virtual mouse to the element with a smooth animation.
|
|
12
12
|
* Blocks execution for the duration.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
blipToolTip(page: Page, element: Locator, toolTip: string, durationMillis?: number): Promise<void>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* Returns the tooltip's unique ID.
|
|
16
|
+
* Moves the virtual mouse to the target position with a smooth animation.
|
|
18
17
|
*/
|
|
19
|
-
private
|
|
18
|
+
private moveVirtualMouse;
|
|
20
19
|
/**
|
|
21
20
|
* Creates a tooltip adjacent to the element, inside a shadow root to avoid CSS collisions.
|
|
22
|
-
* Returns the tooltip's unique ID.
|
|
23
21
|
*/
|
|
24
22
|
private displayToolTipForElement;
|
|
25
23
|
/**
|
|
26
|
-
*
|
|
24
|
+
* Hide the virtual mouse.
|
|
27
25
|
*/
|
|
28
|
-
|
|
26
|
+
hideVirtualMouse(page: Page): Promise<void>;
|
|
29
27
|
/**
|
|
30
|
-
*
|
|
31
|
-
* in case the tooltip was created via that element's evaluate call.
|
|
28
|
+
* Clean up all tooltips and the virtual mouse.
|
|
32
29
|
*/
|
|
33
|
-
|
|
30
|
+
cleanUp(page: Page): Promise<void>;
|
|
34
31
|
}
|
|
35
32
|
//# sourceMappingURL=ToolTipper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolTipper.d.ts","sourceRoot":"","sources":["../../../src/managers/ToolTipper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI3C,qBAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"ToolTipper.d.ts","sourceRoot":"","sources":["../../../src/managers/ToolTipper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI3C,qBAAa,UAAU;aAMc,qBAAqB,EAAE,MAAM;IALhE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAA+B;IAC5E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IAC3D,OAAO,CAAC,oBAAoB,CAAkB;IAC9C,OAAO,CAAC,cAAc,CAAS;gBAEI,qBAAqB,EAAE,MAAM;IAEhE;;;;OAIG;IACU,WAAW,CACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,cAAc,GAAE,MAAmC,GAClD,OAAO,CAAC,IAAI,CAAC;IA0DhB;;OAEG;YACW,gBAAgB;IAiH9B;;OAEG;YACW,wBAAwB;IAgDtC;;OAEG;IACU,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBxD;;OAEG;IACU,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAahD"}
|