@gooddata/sdk-ui-ext 11.52.0-alpha.6 → 11.52.0-alpha.7
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/esm/dataLoaders/InsightDataLoader.d.ts +6 -0
- package/esm/dataLoaders/InsightDataLoader.d.ts.map +1 -1
- package/esm/dataLoaders/InsightDataLoader.js +4 -1
- package/esm/dataLoaders/index.d.ts +13 -0
- package/esm/dataLoaders/index.d.ts.map +1 -1
- package/esm/dataLoaders/index.js +14 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/insightView/InsightRenderer.d.ts +2 -5
- package/esm/insightView/InsightRenderer.d.ts.map +1 -1
- package/esm/insightView/InsightRenderer.js +1 -2
- package/esm/internal/components/pluggableVisualizations/mekko/PluggableMekko.d.ts +6 -1
- package/esm/internal/components/pluggableVisualizations/mekko/PluggableMekko.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/mekko/PluggableMekko.js +25 -4
- package/esm/internal/components/pluggableVisualizations/pivotTable/PluggablePivotTable.d.ts.map +1 -1
- package/esm/internal/components/pluggableVisualizations/pivotTable/PluggablePivotTable.js +0 -1
- package/esm/internal/translations/en-US.localization-bundle.d.ts +4 -0
- package/esm/internal/translations/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-US.localization-bundle.js +4 -0
- package/esm/notificationsPanel/Notification/Notification.d.ts.map +1 -1
- package/esm/notificationsPanel/Notification/Notification.js +6 -3
- package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetail.d.ts +3 -3
- package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetail.d.ts.map +1 -1
- package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetail.js +4 -4
- package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetailDialog.d.ts +9 -3
- package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetailDialog.d.ts.map +1 -1
- package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetailDialog.js +4 -4
- package/esm/sdk-ui-ext.d.ts +13 -0
- package/esm/share/ObjectShareDialog.js +22 -6
- package/esm/share/messages.d.ts +7 -0
- package/esm/share/messages.d.ts.map +1 -1
- package/esm/share/messages.js +5 -0
- package/esm/share/objectShareController.helpers.d.ts +117 -17
- package/esm/share/objectShareController.helpers.d.ts.map +1 -1
- package/esm/share/objectShareController.helpers.js +181 -44
- package/esm/share/objectShareController.types.d.ts +34 -10
- package/esm/share/objectShareController.types.d.ts.map +1 -1
- package/esm/share/useAccessList.d.ts +6 -0
- package/esm/share/useAccessList.d.ts.map +1 -1
- package/esm/share/useAccessList.js +26 -6
- package/esm/share/useLabelScope.d.ts +46 -1
- package/esm/share/useLabelScope.d.ts.map +1 -1
- package/esm/share/useLabelScope.js +98 -6
- package/esm/share/useObjectShareController.d.ts.map +1 -1
- package/esm/share/useObjectShareController.js +213 -45
- package/esm/share/useObjectShareDialog.d.ts +7 -0
- package/esm/share/useObjectShareDialog.d.ts.map +1 -1
- package/esm/share/useObjectShareDialog.js +22 -2
- package/package.json +21 -21
|
@@ -58,13 +58,57 @@ export declare function directLevel(permissions: readonly string[]): ObjectShare
|
|
|
58
58
|
export declare function levelsAbove(level: ObjectSharePermissionLevel | undefined): ObjectSharePermissionLevel[];
|
|
59
59
|
/** Levels strictly below the given one, e.g. for disabling levels an inherited grant already exceeds. */
|
|
60
60
|
export declare function levelsBelow(level: ObjectSharePermissionLevel): ObjectSharePermissionLevel[];
|
|
61
|
+
/** The stronger of two levels; undefined only when both are. */
|
|
62
|
+
export declare function maxLevel(a: ObjectSharePermissionLevel | undefined, b: ObjectSharePermissionLevel | undefined): ObjectSharePermissionLevel | undefined;
|
|
61
63
|
/**
|
|
62
|
-
* The
|
|
63
|
-
* grant already covers it. Set
|
|
64
|
-
* a
|
|
65
|
-
*
|
|
64
|
+
* The inherited permission to surface as a warning, or undefined when the direct
|
|
65
|
+
* grant already covers it. Set when the grantee *inherits* a level (via a group or
|
|
66
|
+
* a parent workspace) that the direct grant does not reach — including the
|
|
67
|
+
* inherited-only case (`direct` undefined), where the whole displayed level comes
|
|
68
|
+
* from inheritance.
|
|
66
69
|
*/
|
|
67
|
-
export declare function effectivePermissionAbove(direct: ObjectSharePermissionLevel, inheritedLevel: ObjectSharePermissionLevel | undefined): ObjectSharePermissionLevel | undefined;
|
|
70
|
+
export declare function effectivePermissionAbove(direct: ObjectSharePermissionLevel | undefined, inheritedLevel: ObjectSharePermissionLevel | undefined): ObjectSharePermissionLevel | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Whether picking `level` for this grantee would change the level they EFFECTIVELY hold.
|
|
73
|
+
*
|
|
74
|
+
* The permission menu shows the effective level, so a pick is only meaningful if it moves
|
|
75
|
+
* that: under an inherited EDIT, picking SHARE or VIEW cannot lower anything, it would just
|
|
76
|
+
* rewrite the grant made here where nobody can see it. Conversely a direct EDIT under an
|
|
77
|
+
* inherited SHARE CAN be lowered to VIEW, because the effective level then drops to SHARE.
|
|
78
|
+
*
|
|
79
|
+
* The single source of this rule. Everything that reacts to a pick must agree: the
|
|
80
|
+
* controller refuses a pick that changes nothing, so any confirm staged for one would ask
|
|
81
|
+
* the user to approve a change that then silently does not happen.
|
|
82
|
+
*
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
export declare function changesEffectiveLevel(grantee: Pick<IObjectShareGrantee, "level" | "inheritedLevel">, level: ObjectSharePermissionLevel): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether revoking this grantee's direct grant would change the level they EFFECTIVELY
|
|
88
|
+
* hold. False when inheritance alone already covers the displayed level: the revoke still
|
|
89
|
+
* removes the local grant, but restricts nothing the grantee can do — so no
|
|
90
|
+
* "Restrict your access?" confirm may be staged for it ({@link changesEffectiveLevel}'s
|
|
91
|
+
* rule, applied to removal).
|
|
92
|
+
*
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
export declare function removalChangesEffectiveLevel(grantee: Pick<IObjectShareGrantee, "level" | "inheritedLevel">): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* The row fields to apply when THIS workspace's direct grant moves to `direct`:
|
|
98
|
+
* the displayed level recomposes against whatever is inherited, so a re-grade below
|
|
99
|
+
* an inherited level cannot make the row understate the grantee's real access.
|
|
100
|
+
*
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
export declare function withDirectLevel(grantee: IObjectShareGrantee, direct: ObjectSharePermissionLevel): IObjectShareGrantee;
|
|
104
|
+
/**
|
|
105
|
+
* The row a grantee falls back to once their direct grant is revoked but inherited
|
|
106
|
+
* access remains — the row survives the removal as inherited-only rather than
|
|
107
|
+
* disappearing and reappearing on the next load.
|
|
108
|
+
*
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
export declare function withoutDirectGrant(grantee: IObjectShareGrantee, inheritedLevel: ObjectSharePermissionLevel): IObjectShareGrantee;
|
|
68
112
|
export declare function granteesFromAccessList(list: IObjectAccessList | undefined): IObjectShareGrantee[];
|
|
69
113
|
/**
|
|
70
114
|
* A transient edit overlaid on a fetched grantee row (keyed by grantee id in
|
|
@@ -90,6 +134,17 @@ export type GranteeEdit = {
|
|
|
90
134
|
kind: "removed";
|
|
91
135
|
pending: boolean;
|
|
92
136
|
settled?: GranteeEdit;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Pending marker only — the row renders exactly as it stands. For a write that
|
|
140
|
+
* locks the row without changing its access (a label-scope edit), so nothing has
|
|
141
|
+
* to invent a level: reusing the `level` overlay would record the DISPLAYED level
|
|
142
|
+
* as the direct grant, and that level is the effective one.
|
|
143
|
+
*/
|
|
144
|
+
| {
|
|
145
|
+
kind: "locked";
|
|
146
|
+
pending: boolean;
|
|
147
|
+
settled?: GranteeEdit;
|
|
93
148
|
};
|
|
94
149
|
/**
|
|
95
150
|
* Transient edit of the all-workspace-users rule (general access + its level),
|
|
@@ -118,12 +173,18 @@ export declare function toGranularGrantee(kind: "user" | "group", granteeRef: Ob
|
|
|
118
173
|
/**
|
|
119
174
|
* The principal a label-scope reconcile applies to: a named user/group, or the
|
|
120
175
|
* implicit all-workspace-users rule (general access).
|
|
176
|
+
*
|
|
177
|
+
* `level` is the permission a label GRANT carries, so a label mirrors the level
|
|
178
|
+
* held on the object rather than always landing on VIEW. Defaults to VIEW when
|
|
179
|
+
* omitted; irrelevant for revokes, which write an empty permission set.
|
|
121
180
|
*/
|
|
122
|
-
export type LabelScopePrincipal = {
|
|
181
|
+
export type LabelScopePrincipal = ({
|
|
123
182
|
kind: "user" | "group";
|
|
124
183
|
granteeRef: ObjRef;
|
|
125
184
|
} | {
|
|
126
185
|
allWorkspaceUsers: true;
|
|
186
|
+
}) & {
|
|
187
|
+
level?: ObjectSharePermissionLevel;
|
|
127
188
|
};
|
|
128
189
|
export declare function granularGranteeFor(principal: LabelScopePrincipal, level: ObjectSharePermissionLevel | "none"): IGranularAccessGrantee;
|
|
129
190
|
/**
|
|
@@ -139,12 +200,42 @@ export declare function buildLabelMutations(principal: LabelScopePrincipal, desi
|
|
|
139
200
|
grantee: IGranularAccessGrantee;
|
|
140
201
|
}>;
|
|
141
202
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
203
|
+
* Pure: the per-label writes that re-grade `principal`'s EXISTING label scope to
|
|
204
|
+
* `principal.level`. Unlike {@link buildLabelMutations} this is not a set diff —
|
|
205
|
+
* the scope is unchanged and every in-scope label is rewritten — so it is what a
|
|
206
|
+
* permission-level change on the object needs to keep its labels in step. `labels` is
|
|
207
|
+
* the permissionable set, so every write targets a label that can take a grant.
|
|
208
|
+
*
|
|
209
|
+
* The primary label is deliberately EXCLUDED. Its access is implicit — {@link
|
|
210
|
+
* buildLabelMutations} never grants or revokes it — so a grant written here would be
|
|
211
|
+
* one nothing can take away: a later removal diffs the primary as unchanged and leaves
|
|
212
|
+
* the grantee holding the primary label after their object access is gone.
|
|
213
|
+
*/
|
|
214
|
+
export declare function buildLabelRegrades(principals: LabelScopePrincipal[], scopeLabelIds: ReadonlySet<string>, labels: IObjectShareLabel[]): Array<{
|
|
215
|
+
id: string;
|
|
216
|
+
ref: ObjRef;
|
|
217
|
+
grantees: IGranularAccessGrantee[];
|
|
218
|
+
}>;
|
|
219
|
+
/**
|
|
220
|
+
* One principal's label-scope move. Held per principal because grantees added in
|
|
221
|
+
* a single step each pick their own scope, so one desired set can't stand for the
|
|
222
|
+
* whole batch.
|
|
223
|
+
*
|
|
224
|
+
* @internal
|
|
146
225
|
*/
|
|
147
|
-
export
|
|
226
|
+
export interface ILabelScopeChange {
|
|
227
|
+
principal: LabelScopePrincipal;
|
|
228
|
+
desiredLabelIds: ReadonlySet<string>;
|
|
229
|
+
currentLabelIds: ReadonlySet<string>;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Multi-principal variant of {@link buildLabelMutations}, each principal moving its
|
|
233
|
+
* own scope: groups the per-label writes so each label is one write carrying every
|
|
234
|
+
* principal that changes on it. Keys on `label.id`, not the raw `ObjRef` — a Map
|
|
235
|
+
* keyed on ObjRef would key on object identity and fail to merge
|
|
236
|
+
* equal-but-distinct refs.
|
|
237
|
+
*/
|
|
238
|
+
export declare function buildLabelMutationsForScopes(changes: readonly ILabelScopeChange[], labels: IObjectShareLabel[]): Array<{
|
|
148
239
|
id: string;
|
|
149
240
|
ref: ObjRef;
|
|
150
241
|
grantees: IGranularAccessGrantee[];
|
|
@@ -154,11 +245,20 @@ export declare const NO_LABELS: IObjectShareLabel[];
|
|
|
154
245
|
/** Shared empty id-set for "no labels in scope" diffs. */
|
|
155
246
|
export declare const EMPTY_IDS: ReadonlySet<string>;
|
|
156
247
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
248
|
+
* Where `granteeId`'s access to this object comes from, or `undefined` when they hold it
|
|
249
|
+
* at all. The two flags are INDEPENDENT: a grantee can hold a grant made here *and*
|
|
250
|
+
* inherit one from a group or a parent workspace, and both facts matter — `direct` says
|
|
251
|
+
* there is something here to revoke, `inherited` says access survives revoking it.
|
|
252
|
+
* Collapsing them to a single winner is what made a dual-granted label read as
|
|
253
|
+
* inaccessible once its local grant was revoked.
|
|
254
|
+
*
|
|
255
|
+
* Inspects the raw grants rather than `granteesFromAccessList`, which normalizes every
|
|
256
|
+
* listed user/group to a VIEW level even when it carries no permissions — so a
|
|
257
|
+
* revoked-but-still-listed entry would otherwise read as granted, mis-scoping a per-label
|
|
258
|
+
* checkbox to a label the grantee can't actually access.
|
|
162
259
|
*/
|
|
163
|
-
export declare function
|
|
260
|
+
export declare function granteeGrantIn(list: IObjectAccessList, id: string): {
|
|
261
|
+
direct: boolean;
|
|
262
|
+
inherited: boolean;
|
|
263
|
+
} | undefined;
|
|
164
264
|
//# sourceMappingURL=objectShareController.helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectShareController.helpers.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,KAAK,EACR,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,0BAA0B,EAC7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,MAAM,EAC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EvG;AAED,yGAAyG;AACzG,wBAAgB,WAAW,CAAC,KAAK,EAAE,0BAA0B,GAAG,0BAA0B,EAAE,CAE3F;AAED
|
|
1
|
+
{"version":3,"file":"objectShareController.helpers.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,KAAK,EACR,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,0BAA0B,EAC7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,6FAA6F;AAC7F,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,KAAK,EAAE,MAAM,GAAG,SAAS,GAC1B,qBAAqB,CAKvB;AAED,kHAAkH;AAClH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGvF;AAED,oHAAkH;AAClH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,uBAAuB,GAAG,qBAAqB,CAI9F;AAED,gGAA0F;AAC1F,wBAAgB,eAAe,CAC3B,KAAK,EAAE,qBAAqB,EAC5B,MAAM,EAAE,MAAM,GACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAQlC;AAED,wGAAsG;AACtG,wBAAgB,kBAAkB,CAAC,OAAO,E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C;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,sBAAsB,EAAE,CAAA;CAAE,CAAC,CAaxE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAC9B,SAAS,EAAE,mBAAmB,CAAC;IAC/B,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACxC;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,EAAE,SAAS,iBAAiB,EAAE,EACrC,MAAM,EAAE,iBAAiB,EAAE,GAC5B,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,sBAAsB,EAAE,CAAA;CAAE,CAAC,CAmBxE;AAED,sFAAsF;AACtF,eAAO,MAAM,SAAS,EAAE,iBAAiB,EAAO,CAAC;AAEjD,0DAA0D;AAC1D,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,MAAM,CAAqB,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC1B,IAAI,EAAE,iBAAiB,EACvB,EAAE,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAcrD"}
|
|
@@ -115,25 +115,117 @@ export function levelsAbove(level) {
|
|
|
115
115
|
export function levelsBelow(level) {
|
|
116
116
|
return LEVELS_STRONGEST_FIRST.filter((l) => LEVEL_RANK[l] < LEVEL_RANK[level]);
|
|
117
117
|
}
|
|
118
|
+
/** The stronger of two levels; undefined only when both are. */
|
|
119
|
+
export function maxLevel(a, b) {
|
|
120
|
+
if (a === undefined) {
|
|
121
|
+
return b;
|
|
122
|
+
}
|
|
123
|
+
if (b === undefined) {
|
|
124
|
+
return a;
|
|
125
|
+
}
|
|
126
|
+
return LEVEL_RANK[a] >= LEVEL_RANK[b] ? a : b;
|
|
127
|
+
}
|
|
118
128
|
/**
|
|
119
|
-
* The
|
|
120
|
-
* grant already covers it. Set
|
|
121
|
-
* a
|
|
122
|
-
*
|
|
129
|
+
* The inherited permission to surface as a warning, or undefined when the direct
|
|
130
|
+
* grant already covers it. Set when the grantee *inherits* a level (via a group or
|
|
131
|
+
* a parent workspace) that the direct grant does not reach — including the
|
|
132
|
+
* inherited-only case (`direct` undefined), where the whole displayed level comes
|
|
133
|
+
* from inheritance.
|
|
123
134
|
*/
|
|
124
135
|
export function effectivePermissionAbove(direct, inheritedLevel) {
|
|
125
|
-
|
|
136
|
+
if (!inheritedLevel) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
return direct === undefined || LEVEL_RANK[inheritedLevel] > LEVEL_RANK[direct]
|
|
140
|
+
? inheritedLevel
|
|
141
|
+
: undefined;
|
|
126
142
|
}
|
|
127
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* The permission-derived fields of a grantee row, given the raw direct and
|
|
145
|
+
* inherited permission sets.
|
|
146
|
+
*
|
|
147
|
+
* The displayed `level` is the EFFECTIVE one — the stronger of the direct grant and
|
|
148
|
+
* anything inherited (from a group, or from a parent workspace in a hierarchy) —
|
|
149
|
+
* so a grantee who only inherits EDIT reads as "Can edit & share" rather than
|
|
150
|
+
* falling back to VIEW. `directLevel` keeps what THIS workspace grants (undefined
|
|
151
|
+
* when the access is inherited-only): it is what writes re-grade and what decides
|
|
152
|
+
* whether there is anything here to remove.
|
|
153
|
+
*/
|
|
128
154
|
function granteeAccess(permissions, inheritedPermissions) {
|
|
129
|
-
const
|
|
155
|
+
const direct = strongestLevel(permissions);
|
|
130
156
|
const inheritedLevel = strongestLevel(inheritedPermissions);
|
|
157
|
+
// A listed grantee with NEITHER set is a revoked-but-still-listed entry. VIEW is the
|
|
158
|
+
// historical placeholder for its level, and it counts as the DIRECT one: leaving
|
|
159
|
+
// `directLevel` undefined would classify the row as inherited-only, disabling Remove
|
|
160
|
+
// and claiming inherited access that does not exist.
|
|
161
|
+
const directLevel = direct ?? (inheritedLevel === undefined ? "VIEW" : undefined);
|
|
131
162
|
return {
|
|
132
|
-
level,
|
|
133
|
-
|
|
163
|
+
level: maxLevel(directLevel, inheritedLevel) ?? "VIEW",
|
|
164
|
+
directLevel,
|
|
165
|
+
effectivePermission: effectivePermissionAbove(direct, inheritedLevel),
|
|
134
166
|
inheritedLevel,
|
|
135
167
|
};
|
|
136
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Whether picking `level` for this grantee would change the level they EFFECTIVELY hold.
|
|
171
|
+
*
|
|
172
|
+
* The permission menu shows the effective level, so a pick is only meaningful if it moves
|
|
173
|
+
* that: under an inherited EDIT, picking SHARE or VIEW cannot lower anything, it would just
|
|
174
|
+
* rewrite the grant made here where nobody can see it. Conversely a direct EDIT under an
|
|
175
|
+
* inherited SHARE CAN be lowered to VIEW, because the effective level then drops to SHARE.
|
|
176
|
+
*
|
|
177
|
+
* The single source of this rule. Everything that reacts to a pick must agree: the
|
|
178
|
+
* controller refuses a pick that changes nothing, so any confirm staged for one would ask
|
|
179
|
+
* the user to approve a change that then silently does not happen.
|
|
180
|
+
*
|
|
181
|
+
* @internal
|
|
182
|
+
*/
|
|
183
|
+
export function changesEffectiveLevel(grantee, level) {
|
|
184
|
+
return maxLevel(level, grantee.inheritedLevel) !== grantee.level;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Whether revoking this grantee's direct grant would change the level they EFFECTIVELY
|
|
188
|
+
* hold. False when inheritance alone already covers the displayed level: the revoke still
|
|
189
|
+
* removes the local grant, but restricts nothing the grantee can do — so no
|
|
190
|
+
* "Restrict your access?" confirm may be staged for it ({@link changesEffectiveLevel}'s
|
|
191
|
+
* rule, applied to removal).
|
|
192
|
+
*
|
|
193
|
+
* @internal
|
|
194
|
+
*/
|
|
195
|
+
export function removalChangesEffectiveLevel(grantee) {
|
|
196
|
+
return grantee.inheritedLevel !== grantee.level;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The row fields to apply when THIS workspace's direct grant moves to `direct`:
|
|
200
|
+
* the displayed level recomposes against whatever is inherited, so a re-grade below
|
|
201
|
+
* an inherited level cannot make the row understate the grantee's real access.
|
|
202
|
+
*
|
|
203
|
+
* @internal
|
|
204
|
+
*/
|
|
205
|
+
export function withDirectLevel(grantee, direct) {
|
|
206
|
+
return {
|
|
207
|
+
...grantee,
|
|
208
|
+
level: maxLevel(direct, grantee.inheritedLevel) ?? direct,
|
|
209
|
+
directLevel: direct,
|
|
210
|
+
effectivePermission: effectivePermissionAbove(direct, grantee.inheritedLevel),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* The row a grantee falls back to once their direct grant is revoked but inherited
|
|
215
|
+
* access remains — the row survives the removal as inherited-only rather than
|
|
216
|
+
* disappearing and reappearing on the next load.
|
|
217
|
+
*
|
|
218
|
+
* @internal
|
|
219
|
+
*/
|
|
220
|
+
export function withoutDirectGrant(grantee, inheritedLevel) {
|
|
221
|
+
return {
|
|
222
|
+
...grantee,
|
|
223
|
+
level: inheritedLevel,
|
|
224
|
+
directLevel: undefined,
|
|
225
|
+
effectivePermission: inheritedLevel,
|
|
226
|
+
pending: undefined,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
137
229
|
export function granteesFromAccessList(list) {
|
|
138
230
|
if (!list) {
|
|
139
231
|
return [];
|
|
@@ -185,11 +277,7 @@ export function mergeGrantees(base, edits, selfId, selfIdentity) {
|
|
|
185
277
|
return settled.grantee;
|
|
186
278
|
}
|
|
187
279
|
if (g && settled?.kind === "level") {
|
|
188
|
-
return
|
|
189
|
-
...g,
|
|
190
|
-
level: settled.level,
|
|
191
|
-
effectivePermission: effectivePermissionAbove(settled.level, g.inheritedLevel),
|
|
192
|
-
};
|
|
280
|
+
return withDirectLevel(g, settled.level);
|
|
193
281
|
}
|
|
194
282
|
return g;
|
|
195
283
|
};
|
|
@@ -203,19 +291,29 @@ export function mergeGrantees(base, edits, selfId, selfIdentity) {
|
|
|
203
291
|
}
|
|
204
292
|
if (edit.kind === "removed") {
|
|
205
293
|
// Visible (muted, at its last committed state) only while the revoke is
|
|
206
|
-
// in flight
|
|
207
|
-
// keep the base row hidden.
|
|
294
|
+
// in flight.
|
|
208
295
|
const committed = edit.pending ? committedRow(g, edit.settled) : undefined;
|
|
209
|
-
|
|
296
|
+
if (committed) {
|
|
297
|
+
return { ...committed, pending: "removing" };
|
|
298
|
+
}
|
|
299
|
+
// A settled removal revokes only what THIS workspace granted. When the
|
|
300
|
+
// grantee still inherits access (a group, a parent workspace), the row
|
|
301
|
+
// survives as inherited-only — dropping it would claim the removal took
|
|
302
|
+
// away access it cannot reach. With nothing inherited the row is gone and
|
|
303
|
+
// the entry persists to keep the base row hidden.
|
|
304
|
+
return g?.inheritedLevel ? withoutDirectGrant(g, g.inheritedLevel) : undefined;
|
|
305
|
+
}
|
|
306
|
+
if (edit.kind === "locked") {
|
|
307
|
+
// Access unchanged: render whatever the row had COMMITTED and add the saving
|
|
308
|
+
// marker. Rendering the fetched row instead would undo the committed state
|
|
309
|
+
// for the duration of the write — a removal survivor would reappear with the
|
|
310
|
+
// direct grant it just lost.
|
|
311
|
+
const committed = edit.settled ? renderEntry(g, { ...edit.settled, pending: false }) : g;
|
|
312
|
+
return committed ? { ...committed, pending: edit.pending ? "saving" : undefined } : undefined;
|
|
210
313
|
}
|
|
211
314
|
if (edit.kind === "level") {
|
|
212
315
|
return g
|
|
213
|
-
? {
|
|
214
|
-
...g,
|
|
215
|
-
level: edit.level,
|
|
216
|
-
effectivePermission: effectivePermissionAbove(edit.level, g.inheritedLevel),
|
|
217
|
-
pending: edit.pending ? "saving" : undefined,
|
|
218
|
-
}
|
|
316
|
+
? { ...withDirectLevel(g, edit.level), pending: edit.pending ? "saving" : undefined }
|
|
219
317
|
: undefined;
|
|
220
318
|
}
|
|
221
319
|
return { ...edit.grantee, pending: edit.pending ? "saving" : undefined };
|
|
@@ -275,21 +373,51 @@ export function buildLabelMutations(principal, desiredLabelIds, currentLabelIds,
|
|
|
275
373
|
if (wanted === had) {
|
|
276
374
|
continue;
|
|
277
375
|
}
|
|
278
|
-
writes.push({
|
|
376
|
+
writes.push({
|
|
377
|
+
ref: label.ref,
|
|
378
|
+
grantee: granularGranteeFor(principal, wanted ? (principal.level ?? "VIEW") : "none"),
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
return writes;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Pure: the per-label writes that re-grade `principal`'s EXISTING label scope to
|
|
385
|
+
* `principal.level`. Unlike {@link buildLabelMutations} this is not a set diff —
|
|
386
|
+
* the scope is unchanged and every in-scope label is rewritten — so it is what a
|
|
387
|
+
* permission-level change on the object needs to keep its labels in step. `labels` is
|
|
388
|
+
* the permissionable set, so every write targets a label that can take a grant.
|
|
389
|
+
*
|
|
390
|
+
* The primary label is deliberately EXCLUDED. Its access is implicit — {@link
|
|
391
|
+
* buildLabelMutations} never grants or revokes it — so a grant written here would be
|
|
392
|
+
* one nothing can take away: a later removal diffs the primary as unchanged and leaves
|
|
393
|
+
* the grantee holding the primary label after their object access is gone.
|
|
394
|
+
*/
|
|
395
|
+
export function buildLabelRegrades(principals, scopeLabelIds, labels) {
|
|
396
|
+
const writes = [];
|
|
397
|
+
for (const label of labels) {
|
|
398
|
+
if (label.isPrimary || !scopeLabelIds.has(label.id)) {
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
writes.push({
|
|
402
|
+
id: label.id,
|
|
403
|
+
ref: label.ref,
|
|
404
|
+
grantees: principals.map((p) => granularGranteeFor(p, p.level ?? "VIEW")),
|
|
405
|
+
});
|
|
279
406
|
}
|
|
280
407
|
return writes;
|
|
281
408
|
}
|
|
282
409
|
/**
|
|
283
|
-
* Multi-principal variant of {@link buildLabelMutations}
|
|
284
|
-
* writes so each label is one write carrying every
|
|
285
|
-
* Keys on `label.id`, not the raw `ObjRef` — a Map
|
|
286
|
-
* object identity and fail to merge
|
|
410
|
+
* Multi-principal variant of {@link buildLabelMutations}, each principal moving its
|
|
411
|
+
* own scope: groups the per-label writes so each label is one write carrying every
|
|
412
|
+
* principal that changes on it. Keys on `label.id`, not the raw `ObjRef` — a Map
|
|
413
|
+
* keyed on ObjRef would key on object identity and fail to merge
|
|
414
|
+
* equal-but-distinct refs.
|
|
287
415
|
*/
|
|
288
|
-
export function
|
|
416
|
+
export function buildLabelMutationsForScopes(changes, labels) {
|
|
289
417
|
const byLabel = new Map();
|
|
290
418
|
for (const label of labels) {
|
|
291
|
-
for (const
|
|
292
|
-
const writes = buildLabelMutations(principal, desiredLabelIds, currentLabelIds, [label]);
|
|
419
|
+
for (const change of changes) {
|
|
420
|
+
const writes = buildLabelMutations(change.principal, change.desiredLabelIds, change.currentLabelIds, [label]);
|
|
293
421
|
if (writes.length === 0) {
|
|
294
422
|
continue;
|
|
295
423
|
}
|
|
@@ -305,20 +433,29 @@ export const NO_LABELS = [];
|
|
|
305
433
|
/** Shared empty id-set for "no labels in scope" diffs. */
|
|
306
434
|
export const EMPTY_IDS = new Set();
|
|
307
435
|
/**
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
436
|
+
* Where `granteeId`'s access to this object comes from, or `undefined` when they hold it
|
|
437
|
+
* at all. The two flags are INDEPENDENT: a grantee can hold a grant made here *and*
|
|
438
|
+
* inherit one from a group or a parent workspace, and both facts matter — `direct` says
|
|
439
|
+
* there is something here to revoke, `inherited` says access survives revoking it.
|
|
440
|
+
* Collapsing them to a single winner is what made a dual-granted label read as
|
|
441
|
+
* inaccessible once its local grant was revoked.
|
|
442
|
+
*
|
|
443
|
+
* Inspects the raw grants rather than `granteesFromAccessList`, which normalizes every
|
|
444
|
+
* listed user/group to a VIEW level even when it carries no permissions — so a
|
|
445
|
+
* revoked-but-still-listed entry would otherwise read as granted, mis-scoping a per-label
|
|
446
|
+
* checkbox to a label the grantee can't actually access.
|
|
313
447
|
*/
|
|
314
|
-
export function
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
448
|
+
export function granteeGrantIn(list, id) {
|
|
449
|
+
const sourceOf = (permissions, inherited) => permissions.length > 0 || inherited.length > 0
|
|
450
|
+
? { direct: permissions.length > 0, inherited: inherited.length > 0 }
|
|
451
|
+
: undefined;
|
|
452
|
+
for (const g of list.grants) {
|
|
453
|
+
if (isGranularUserAccess(g) && id === granteeId("user", g.user.ref)) {
|
|
454
|
+
return sourceOf(g.permissions, g.inheritedPermissions);
|
|
318
455
|
}
|
|
319
|
-
if (isGranularUserGroupAccess(g)) {
|
|
320
|
-
return
|
|
456
|
+
if (isGranularUserGroupAccess(g) && id === granteeId("group", g.userGroup.ref)) {
|
|
457
|
+
return sourceOf(g.permissions, g.inheritedPermissions);
|
|
321
458
|
}
|
|
322
|
-
|
|
323
|
-
|
|
459
|
+
}
|
|
460
|
+
return undefined;
|
|
324
461
|
}
|
|
@@ -46,18 +46,31 @@ export interface IObjectShareGrantee extends IGranteeIdentityFacts {
|
|
|
46
46
|
* profile, so it holds for rows of any origin (fetched or optimistic).
|
|
47
47
|
*/
|
|
48
48
|
isSelf?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* EFFECTIVE permission level shown on the row — the stronger of {@link directLevel}
|
|
51
|
+
* and {@link inheritedLevel}, so a grantee who only inherits a level is not
|
|
52
|
+
* understated as VIEW.
|
|
53
|
+
*/
|
|
49
54
|
level: ObjectSharePermissionLevel;
|
|
50
55
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
56
|
+
* Permission level granted by THIS workspace, or undefined when the grantee's
|
|
57
|
+
* access is inherited-only (a group, or a parent workspace in a hierarchy).
|
|
58
|
+
* This — not {@link level} — is what a re-grade writes and what decides whether
|
|
59
|
+
* there is a grant here to remove: inherited access cannot be revoked from here.
|
|
60
|
+
*/
|
|
61
|
+
directLevel?: ObjectSharePermissionLevel;
|
|
62
|
+
/**
|
|
63
|
+
* Inherited permission to surface as a warning: set when inheritance carries the
|
|
64
|
+
* grantee above their direct grant (including inherited-only, where the whole
|
|
65
|
+
* displayed level is inherited). Undefined when the direct grant already covers
|
|
66
|
+
* the effective permission. Drives the row's warning badge.
|
|
55
67
|
*/
|
|
56
68
|
effectivePermission?: ObjectSharePermissionLevel;
|
|
57
69
|
/**
|
|
58
|
-
* Strongest permission the grantee inherits (
|
|
59
|
-
* the current direct
|
|
60
|
-
* can be
|
|
70
|
+
* Strongest permission the grantee inherits (via a group, or a parent workspace),
|
|
71
|
+
* regardless of the current direct level. Retained from the fetch so the
|
|
72
|
+
* displayed level and badge can be recomposed locally when the direct level
|
|
73
|
+
* changes (no refetch).
|
|
61
74
|
*/
|
|
62
75
|
inheritedLevel?: ObjectSharePermissionLevel;
|
|
63
76
|
/**
|
|
@@ -164,11 +177,22 @@ export interface IObjectShareControllerState {
|
|
|
164
177
|
*/
|
|
165
178
|
labelsInitializing: boolean;
|
|
166
179
|
/**
|
|
167
|
-
* Per-grantee label scope: grantee id → the label ids that grantee can access
|
|
168
|
-
* The primary label is always included.
|
|
169
|
-
*
|
|
180
|
+
* Per-grantee label scope: grantee id → the label ids that grantee can access,
|
|
181
|
+
* whether granted here or inherited. The primary label is always included.
|
|
182
|
+
*
|
|
183
|
+
* A MISSING entry means the scope is not resolved for that grantee — only then may a
|
|
184
|
+
* consumer fall back to all labels, and only once {@link labelsResolved}. An entry
|
|
185
|
+
* that is an EMPTY array is a resolved answer: no non-primary label is in scope.
|
|
170
186
|
*/
|
|
171
187
|
selectedLabelIdsByGrantee: Record<string, string[]>;
|
|
188
|
+
/**
|
|
189
|
+
* The subset of {@link selectedLabelIdsByGrantee} a grantee only INHERITS (from a
|
|
190
|
+
* group, or a parent workspace) with no grant on the label in this workspace.
|
|
191
|
+
* Those labels are in scope but cannot be re-scoped here: there is nothing local
|
|
192
|
+
* to revoke, so consumers render them locked. Same rule as a grantee row whose
|
|
193
|
+
* object access is inherited-only, which cannot be removed either.
|
|
194
|
+
*/
|
|
195
|
+
inheritedLabelIdsByGrantee: Record<string, string[]>;
|
|
172
196
|
/** Pending confirm — when set, the confirm dialog is visible. */
|
|
173
197
|
pendingGeneralAccess?: GeneralAccessValue;
|
|
174
198
|
/** Grantees staged in the add-grantee dialog before confirmation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectShareController.types.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzG,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IACxD,EAAE,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAC9D,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,0BAA0B,CAAC;IAClC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;IACjD
|
|
1
|
+
{"version":3,"file":"objectShareController.types.d.ts","sourceRoot":"","sources":["../../src/share/objectShareController.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzG,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,wBAAwB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IACxD,EAAE,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAC9D,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,KAAK,EAAE,0BAA0B,CAAC;IAClC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,0BAA0B,CAAC;IACzC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;IACjD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,0BAA0B,CAAC;IAC5C;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,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,EAAE,iBAAiB,EAAE,CAAC;IAC7B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -65,6 +65,12 @@ export interface IAccessList {
|
|
|
65
65
|
* plain level entry would drop the row from the merged view.
|
|
66
66
|
*/
|
|
67
67
|
applyGranteeLevel: (id: string, level: ObjectSharePermissionLevel) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Lock a row for a write that leaves its access unchanged (a label-scope edit):
|
|
70
|
+
* adds the pending marker only. Use this rather than re-applying the displayed
|
|
71
|
+
* level, which would persist the EFFECTIVE level as the row's direct grant.
|
|
72
|
+
*/
|
|
73
|
+
applyGranteeLock: (id: string) => void;
|
|
68
74
|
/** Overlay a pending removal; the row renders muted until the write settles. */
|
|
69
75
|
applyGranteeRemove: (id: string) => void;
|
|
70
76
|
/** Commit the pending edit for `id` after a successful write. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccessList.d.ts","sourceRoot":"","sources":["../../src/share/useAccessList.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EACH,KAAK,sBAAsB,EAK9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,KAAK,gBAAgB,EAKxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAmB,MAAM,sBAAsB,CAAC;AAS7G,OAAO,EAEH,KAAK,SAAS,EASjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACR,2BAA2B,EAC3B,mBAAmB,EACnB,aAAa,EACb,0BAA0B,EAC7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,oDA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