@baseplate-dev/project-builder-web 0.1.1

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 (41) hide show
  1. package/LICENSE +390 -0
  2. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-Ctbly4ZZ.js +2 -0
  3. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-Ctbly4ZZ.js.map +1 -0
  4. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-BHHYg2H_.js +5 -0
  5. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-BHHYg2H_.js.map +1 -0
  6. package/dist/assets/__federation_shared_@baseplate-dev/ui-components-CmzFub-E.js +46 -0
  7. package/dist/assets/__federation_shared_@baseplate-dev/ui-components-CmzFub-E.js.map +1 -0
  8. package/dist/assets/__federation_shared_react-CTQ9xfiH.js +2 -0
  9. package/dist/assets/__federation_shared_react-CTQ9xfiH.js.map +1 -0
  10. package/dist/assets/__federation_shared_react-dom-DPv53nVg.js +2 -0
  11. package/dist/assets/__federation_shared_react-dom-DPv53nVg.js.map +1 -0
  12. package/dist/assets/__federation_shared_zod-DQ8g46gT.js +2 -0
  13. package/dist/assets/__federation_shared_zod-DQ8g46gT.js.map +1 -0
  14. package/dist/assets/_virtual___federation_fn_import-Dy9UIuGh.js +2 -0
  15. package/dist/assets/_virtual___federation_fn_import-Dy9UIuGh.js.map +1 -0
  16. package/dist/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  17. package/dist/assets/geist-latin-wght-normal-Dg_dQHbK.woff2 +0 -0
  18. package/dist/assets/geist-mono-latin-ext-wght-normal-b6lpi8_2.woff2 +0 -0
  19. package/dist/assets/geist-mono-latin-wght-normal-Cjtb1TV-.woff2 +0 -0
  20. package/dist/assets/index-9Ra4Lmds.js +10 -0
  21. package/dist/assets/index-9Ra4Lmds.js.map +1 -0
  22. package/dist/assets/index-B0D_rfGi.js +10 -0
  23. package/dist/assets/index-B0D_rfGi.js.map +1 -0
  24. package/dist/assets/index-BK9gSEM3.css +1 -0
  25. package/dist/assets/index-D6_Hw_qm.js +2 -0
  26. package/dist/assets/index-D6_Hw_qm.js.map +1 -0
  27. package/dist/assets/index-DC_DCd-Q.js +12 -0
  28. package/dist/assets/index-DC_DCd-Q.js.map +1 -0
  29. package/dist/assets/index-DnBjawZO.js +78 -0
  30. package/dist/assets/index-DnBjawZO.js.map +1 -0
  31. package/dist/assets/index.esm-hwiNhM7-.js +10 -0
  32. package/dist/assets/index.esm-hwiNhM7-.js.map +1 -0
  33. package/dist/assets/isEqual-C420KeG-.js +2 -0
  34. package/dist/assets/isEqual-C420KeG-.js.map +1 -0
  35. package/dist/assets/model-utils-C4ofeY6G.js +2 -0
  36. package/dist/assets/model-utils-C4ofeY6G.js.map +1 -0
  37. package/dist/favicon.ico +0 -0
  38. package/dist/images/logo.png +0 -0
  39. package/dist/index.html +27 -0
  40. package/dist/preview-app.json +465 -0
  41. package/package.json +104 -0
package/LICENSE ADDED
@@ -0,0 +1,390 @@
1
+ Copyright (c) 2025 Half Dome Labs LLC (https://halfdomelabs.com) and individual contributors.
2
+
3
+ ## License
4
+
5
+ This project is licensed under the Mozilla Public License 2.0 (MPL-2.0) with the following exception:
6
+
7
+ **Generated Code Exception**: All code generated by Baseplate generators and templates belongs entirely to the user who generated it. Half Dome Labs LLC disclaims any copyright interest in generated code. Users may use, modify, distribute, and license generated code under any terms they choose, including proprietary licenses, with no restrictions or attribution requirements.
8
+
9
+ # Mozilla Public License Version 2.0
10
+
11
+ 1. Definitions
12
+
13
+ ---
14
+
15
+ 1.1. "Contributor"
16
+ means each individual or legal entity that creates, contributes to
17
+ the creation of, or owns Covered Software.
18
+
19
+ 1.2. "Contributor Version"
20
+ means the combination of the Contributions of others (if any) used
21
+ by a Contributor and that particular Contributor's Contribution.
22
+
23
+ 1.3. "Contribution"
24
+ means Covered Software of a particular Contributor.
25
+
26
+ 1.4. "Covered Software"
27
+ means Source Code Form to which the initial Contributor has attached
28
+ the notice in Exhibit A, the Executable Form of such Source Code
29
+ Form, and Modifications of such Source Code Form, in each case
30
+ including portions thereof.
31
+
32
+ 1.5. "Incompatible With Secondary Licenses"
33
+ means
34
+
35
+ (a) that the initial Contributor has attached the notice described
36
+ in Exhibit B to the Covered Software; or
37
+
38
+ (b) that the Covered Software was made available under the terms of
39
+ version 1.1 or earlier of the License, but not also under the
40
+ terms of a Secondary License.
41
+
42
+ 1.6. "Executable Form"
43
+ means any form of the work other than Source Code Form.
44
+
45
+ 1.7. "Larger Work"
46
+ means a work that combines Covered Software with other material, in
47
+ a separate file or files, that is not Covered Software.
48
+
49
+ 1.8. "License"
50
+ means this document.
51
+
52
+ 1.9. "Licensable"
53
+ means having the right to grant, to the maximum extent possible,
54
+ whether at the time of the initial grant or subsequently, any and
55
+ all of the rights conveyed by this License.
56
+
57
+ 1.10. "Modifications"
58
+ means any of the following:
59
+
60
+ (a) any file in Source Code Form that results from an addition to,
61
+ deletion from, or modification of the contents of Covered
62
+ Software; or
63
+
64
+ (b) any new file in Source Code Form that contains any Covered
65
+ Software.
66
+
67
+ 1.11. "Patent Claims" of a Contributor
68
+ means any patent claim(s), including without limitation, method,
69
+ process, and apparatus claims, in any patent Licensable by such
70
+ Contributor that would be infringed, but for the grant of the
71
+ License, by the making, using, selling, offering for sale, having
72
+ made, import, or transfer of either its Contributions or its
73
+ Contributor Version.
74
+
75
+ 1.12. "Secondary License"
76
+ means either the GNU General Public License, Version 2.0, the GNU
77
+ Lesser General Public License, Version 2.1, the GNU Affero General
78
+ Public License, Version 3.0, or any later versions of those
79
+ licenses.
80
+
81
+ 1.13. "Source Code Form"
82
+ means the form of the work preferred for making modifications.
83
+
84
+ 1.14. "You" (or "Your")
85
+ means an individual or a legal entity exercising rights under this
86
+ License. For legal entities, "You" includes any entity that
87
+ controls, is controlled by, or is under common control with You. For
88
+ purposes of this definition, "control" means (a) the power, direct
89
+ or indirect, to cause the direction or management of such entity,
90
+ whether by contract or otherwise, or (b) ownership of more than
91
+ fifty percent (50%) of the outstanding shares or beneficial
92
+ ownership of such entity.
93
+
94
+ 2. License Grants and Conditions
95
+
96
+ ---
97
+
98
+ 2.1. Grants
99
+
100
+ Each Contributor hereby grants You a world-wide, royalty-free,
101
+ non-exclusive license:
102
+
103
+ (a) under intellectual property rights (other than patent or trademark)
104
+ Licensable by such Contributor to use, reproduce, make available,
105
+ modify, display, perform, distribute, and otherwise exploit its
106
+ Contributions, either on an unmodified basis, with Modifications, or
107
+ as part of a Larger Work; and
108
+
109
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
110
+ for sale, have made, import, and otherwise transfer either its
111
+ Contributions or its Contributor Version.
112
+
113
+ 2.2. Effective Date
114
+
115
+ The licenses granted in Section 2.1 with respect to any Contribution
116
+ become effective for each Contribution on the date the Contributor first
117
+ distributes such Contribution.
118
+
119
+ 2.3. Limitations on Grant Scope
120
+
121
+ The licenses granted in this Section 2 are the only rights granted under
122
+ this License. No additional rights or licenses will be implied from the
123
+ distribution or licensing of Covered Software under this License.
124
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
125
+ Contributor:
126
+
127
+ (a) for any code that a Contributor has removed from Covered Software;
128
+ or
129
+
130
+ (b) for infringements caused by: (i) Your and any other third party's
131
+ modifications of Covered Software, or (ii) the combination of its
132
+ Contributions with other software (except as part of its Contributor
133
+ Version); or
134
+
135
+ (c) under Patent Claims infringed by Covered Software in the absence of
136
+ its Contributions.
137
+
138
+ This License does not grant any rights in the trademarks, service marks,
139
+ or logos of any Contributor (except as may be necessary to comply with
140
+ the notice requirements in Section 3.4).
141
+
142
+ 2.4. Subsequent Licenses
143
+
144
+ No Contributor makes additional grants as a result of Your choice to
145
+ distribute the Covered Software under a subsequent version of this
146
+ License (see Section 10.2) or under the terms of a Secondary License (if
147
+ permitted under the terms of Section 3.3).
148
+
149
+ 2.5. Representation
150
+
151
+ Each Contributor represents that the Contributor believes its
152
+ Contributions are its original creation(s) or it has sufficient rights
153
+ to grant the rights to its Contributions conveyed by this License.
154
+
155
+ 2.6. Fair Use
156
+
157
+ This License is not intended to limit any rights You have under
158
+ applicable copyright doctrines of fair use, fair dealing, or other
159
+ equivalents.
160
+
161
+ 2.7. Conditions
162
+
163
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
164
+ in Section 2.1.
165
+
166
+ 3. Responsibilities
167
+
168
+ ---
169
+
170
+ 3.1. Distribution of Source Form
171
+
172
+ All distribution of Covered Software in Source Code Form, including any
173
+ Modifications that You create or to which You contribute, must be under
174
+ the terms of this License. You must inform recipients that the Source
175
+ Code Form of the Covered Software is governed by the terms of this
176
+ License, and how they can obtain a copy of this License. You may not
177
+ attempt to alter or restrict the recipients' rights in the Source Code
178
+ Form.
179
+
180
+ 3.2. Distribution of Executable Form
181
+
182
+ If You distribute Covered Software in Executable Form then:
183
+
184
+ (a) such Covered Software must also be made available in Source Code
185
+ Form, as described in Section 3.1, and You must inform recipients of
186
+ the Executable Form how they can obtain a copy of such Source Code
187
+ Form by reasonable means in a timely manner, at a charge no more
188
+ than the cost of distribution to the recipient; and
189
+
190
+ (b) You may distribute such Executable Form under the terms of this
191
+ License, or sublicense it under different terms, provided that the
192
+ license for the Executable Form does not attempt to limit or alter
193
+ the recipients' rights in the Source Code Form under this License.
194
+
195
+ 3.3. Distribution of a Larger Work
196
+
197
+ You may create and distribute a Larger Work under terms of Your choice,
198
+ provided that You also comply with the requirements of this License for
199
+ the Covered Software. If the Larger Work is a combination of Covered
200
+ Software with a work governed by one or more Secondary Licenses, and the
201
+ Covered Software is not Incompatible With Secondary Licenses, this
202
+ License permits You to additionally distribute such Covered Software
203
+ under the terms of such Secondary License(s), so that the recipient of
204
+ the Larger Work may, at their option, further distribute the Covered
205
+ Software under the terms of either this License or such Secondary
206
+ License(s).
207
+
208
+ 3.4. Notices
209
+
210
+ You may not remove or alter the substance of any license notices
211
+ (including copyright notices, patent notices, disclaimers of warranty,
212
+ or limitations of liability) contained within the Source Code Form of
213
+ the Covered Software, except that You may alter any license notices to
214
+ the extent required to remedy known factual inaccuracies.
215
+
216
+ 3.5. Application of Additional Terms
217
+
218
+ You may choose to offer, and to charge a fee for, warranty, support,
219
+ indemnity or liability obligations to one or more recipients of Covered
220
+ Software. However, You may do so only on Your own behalf, and not on
221
+ behalf of any Contributor. You must make it absolutely clear that any
222
+ such warranty, support, indemnity, or liability obligation is offered by
223
+ You alone, and You hereby agree to indemnify every Contributor for any
224
+ liability incurred by such Contributor as a result of warranty, support,
225
+ indemnity or liability terms You offer. You may include additional
226
+ disclaimers of warranty and limitations of liability specific to any
227
+ jurisdiction.
228
+
229
+ 4. Inability to Comply Due to Statute or Regulation
230
+
231
+ ---
232
+
233
+ If it is impossible for You to comply with any of the terms of this
234
+ License with respect to some or all of the Covered Software due to
235
+ statute, judicial order, or regulation then You must: (a) comply with
236
+ the terms of this License to the maximum extent possible; and (b)
237
+ describe the limitations and the code they affect. Such description must
238
+ be placed in a text file included with all distributions of the Covered
239
+ Software under this License. Except to the extent prohibited by statute
240
+ or regulation, such description must be sufficiently detailed for a
241
+ recipient of ordinary skill to be able to understand it.
242
+
243
+ 5. Termination
244
+
245
+ ---
246
+
247
+ 5.1. The rights granted under this License will terminate automatically
248
+ if You fail to comply with any of its terms. However, if You become
249
+ compliant, then the rights granted under this License from a particular
250
+ Contributor are reinstated (a) provisionally, unless and until such
251
+ Contributor explicitly and finally terminates Your grants, and (b) on an
252
+ ongoing basis, if such Contributor fails to notify You of the
253
+ non-compliance by some reasonable means prior to 60 days after You have
254
+ come back into compliance. Moreover, Your grants from a particular
255
+ Contributor are reinstated on an ongoing basis if such Contributor
256
+ notifies You of the non-compliance by some reasonable means, this is the
257
+ first time You have received notice of non-compliance with this License
258
+ from such Contributor, and You become compliant prior to 30 days after
259
+ Your receipt of the notice.
260
+
261
+ 5.2. If You initiate litigation against any entity by asserting a patent
262
+ infringement claim (excluding declaratory judgment actions,
263
+ counter-claims, and cross-claims) alleging that a Contributor Version
264
+ directly or indirectly infringes any patent, then the rights granted to
265
+ You by any and all Contributors for the Covered Software under Section
266
+ 2.1 of this License shall terminate.
267
+
268
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
269
+ end user license agreements (excluding distributors and resellers) which
270
+ have been validly granted by You or Your distributors under this License
271
+ prior to termination shall survive termination.
272
+
273
+ ---
274
+
275
+ - *
276
+ - 6. Disclaimer of Warranty \*
277
+ - ------------------------- \*
278
+ - *
279
+ - Covered Software is provided under this License on an "as is" \*
280
+ - basis, without warranty of any kind, either expressed, implied, or \*
281
+ - statutory, including, without limitation, warranties that the \*
282
+ - Covered Software is free of defects, merchantable, fit for a \*
283
+ - particular purpose or non-infringing. The entire risk as to the \*
284
+ - quality and performance of the Covered Software is with You. \*
285
+ - Should any Covered Software prove defective in any respect, You \*
286
+ - (not any Contributor) assume the cost of any necessary servicing, \*
287
+ - repair, or correction. This disclaimer of warranty constitutes an \*
288
+ - essential part of this License. No use of any Covered Software is \*
289
+ - authorized under this License except under this disclaimer. \*
290
+ - *
291
+
292
+ ---
293
+
294
+ ---
295
+
296
+ - *
297
+ - 7. Limitation of Liability \*
298
+ - -------------------------- \*
299
+ - *
300
+ - Under no circumstances and under no legal theory, whether tort \*
301
+ - (including negligence), contract, or otherwise, shall any \*
302
+ - Contributor, or anyone who distributes Covered Software as \*
303
+ - permitted above, be liable to You for any direct, indirect, \*
304
+ - special, incidental, or consequential damages of any character \*
305
+ - including, without limitation, damages for lost profits, loss of \*
306
+ - goodwill, work stoppage, computer failure or malfunction, or any \*
307
+ - and all other commercial damages or losses, even if such party \*
308
+ - shall have been informed of the possibility of such damages. This \*
309
+ - limitation of liability shall not apply to liability for death or \*
310
+ - personal injury resulting from such party's negligence to the \*
311
+ - extent applicable law prohibits such limitation. Some \*
312
+ - jurisdictions do not allow the exclusion or limitation of \*
313
+ - incidental or consequential damages, so this exclusion and \*
314
+ - limitation may not apply to You. \*
315
+ - *
316
+
317
+ ---
318
+
319
+ 8. Litigation
320
+
321
+ ---
322
+
323
+ Any litigation relating to this License may be brought only in the
324
+ courts of a jurisdiction where the defendant maintains its principal
325
+ place of business and such litigation shall be governed by laws of that
326
+ jurisdiction, without reference to its conflict-of-law provisions.
327
+ Nothing in this Section shall prevent a party's ability to bring
328
+ cross-claims or counter-claims.
329
+
330
+ 9. Miscellaneous
331
+
332
+ ---
333
+
334
+ This License represents the complete agreement concerning the subject
335
+ matter hereof. If any provision of this License is held to be
336
+ unenforceable, such provision shall be reformed only to the extent
337
+ necessary to make it enforceable. Any law or regulation which provides
338
+ that the language of a contract shall be construed against the drafter
339
+ shall not be used to construe this License against a Contributor.
340
+
341
+ 10. Versions of the License
342
+
343
+ ---
344
+
345
+ 10.1. New Versions
346
+
347
+ Mozilla Foundation is the license steward. Except as provided in Section
348
+ 10.3, no one other than the license steward has the right to modify or
349
+ publish new versions of this License. Each version will be given a
350
+ distinguishing version number.
351
+
352
+ 10.2. Effect of New Versions
353
+
354
+ You may distribute the Covered Software under the terms of the version
355
+ of the License under which You originally received the Covered Software,
356
+ or under the terms of any subsequent version published by the license
357
+ steward.
358
+
359
+ 10.3. Modified Versions
360
+
361
+ If you create software not governed by this License, and you want to
362
+ create a new license for such software, you may create and use a
363
+ modified version of this License if you rename the license and remove
364
+ any references to the name of the license steward (except to note that
365
+ such modified license differs from this License).
366
+
367
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
368
+ Licenses
369
+
370
+ If You choose to distribute Source Code Form that is Incompatible With
371
+ Secondary Licenses under the terms of this version of the License, the
372
+ notice described in Exhibit B of this License must be attached.
373
+
374
+ ## Exhibit A - Source Code Form License Notice
375
+
376
+ This Source Code Form is subject to the terms of the Mozilla Public
377
+ License, v. 2.0. If a copy of the MPL was not distributed with this
378
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
379
+
380
+ If it is not possible or desirable to put the notice in a particular
381
+ file, then You may include the notice in a location (such as a LICENSE
382
+ file in a relevant directory) where a recipient would be likely to look
383
+ for such a notice.
384
+
385
+ You may add additional accurate notices of copyright ownership.
386
+
387
+ ## Exhibit B - "Incompatible With Secondary Licenses" Notice
388
+
389
+ This Source Code Form is "Incompatible With Secondary Licenses", as
390
+ defined by the Mozilla Public License, v. 2.0.
@@ -0,0 +1,2 @@
1
+ import{i}from"../../_virtual___federation_fn_import-Dy9UIuGh.js";import{j as s,c as p,i as v,b as k}from"../../index.esm-hwiNhM7-.js";import{F as B,M as y,l as M,c as b}from"../../model-utils-C4ofeY6G.js";import{i as h}from"../../isEqual-C420KeG-.js";const w=await i("react"),S=w.createContext(null);function m(){const e=w.useContext(S);if(!e)throw new Error("useProjectDefinition must be used within a <ProjectDefinitionProvider>");return e}const{ComboboxField:j,useControllerMerged:N}=await i("@baseplate-dev/ui-components"),{useMemo:E,useState:F}=await i("react");function W(e){return{label:`Create "${e}"`,value:e}}function D({canCreate:e,value:t,...n}){const{definition:r}=m(),[o,a]=F(""),c=E(()=>{const d=r.features.map(u=>({label:u.name,value:u.id}));if(!e)return d;const l=o||t;return!!!d.some(u=>u.label===l||u.value===l)&&l&&B.validateFeatureName(l)?[...d,W(l)]:d},[r.features,o,t,e]);return s.jsx(j,{placeholder:"Select a feature",...n,searchQuery:e?o:void 0,onSearchQueryChange:a,options:c,value:t})}function re({name:e,control:t,...n}){const{field:r,fieldState:{error:o}}=N({name:e,control:t},n),a=n;return s.jsx(D,{error:o?.message,...a,...r,value:r.value??null})}const{ComboboxField:T,useControllerMerged:$}=await i("@baseplate-dev/ui-components"),{useMemo:I,useState:q}=await i("react");function R(e){return{label:`Create "${e}"`,value:e}}function P({canCreate:e,value:t,...n}){const{definition:r}=m(),[o,a]=q(""),c=I(()=>{const d=r.models.map(u=>({label:u.name,value:u.id}));if(!e)return d;const l=o||t;return!!!d.some(u=>u.label===l||u.value===l)&&l&&y.validateModelName(l)?[...d,R(l)]:d},[r.models,o,t,e]);return s.jsx(T,{placeholder:"Select a model",...n,searchQuery:e?o:void 0,onSearchQueryChange:a,options:c,value:t})}function oe({name:e,control:t,...n}){const{field:r,fieldState:{error:o}}=$({name:e,control:t},n),a=n;return s.jsx(P,{error:o?.message,...a,...r,value:r.value??null})}const{Alert:A,AlertDescription:U,AlertTitle:V}=await i("@baseplate-dev/ui-components");function se({pendingModelChanges:e}){const t=Object.values(e).filter(n=>n!==void 0);return t.length===0?null:s.jsx("div",{className:"space-y-4",children:t.map(n=>s.jsxs(A,{variant:n.isNewModel?"default":"warning",children:[s.jsxs(V,{children:[n.isNewModel?"New Model":"Model Changes",": ",n.name]}),s.jsx(U,{children:s.jsxs("div",{className:"mt-2 space-y-2",children:[n.isNewModel?s.jsx("p",{children:"This is a new model that will be created with the following configuration:"}):s.jsx("p",{children:"The following changes will be applied to the model:"}),s.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[n.changes["model.fields"]?.length?s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:n.changes["model.fields"].length})," ","field(s) will be",n.isNewModel?" created":" added or updated"]}):void 0,n.changes["model.relations"]?.length?s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:n.changes["model.relations"].length})," ","relation(s) will be",n.isNewModel?" created":" added or updated"]}):void 0,n.changes["model.uniqueConstraints"]?.length?s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:n.changes["model.uniqueConstraints"].length})," ","unique constraint(s) will be"," ",n.isNewModel?"created":"added or updated"]}):void 0,n.changes["model.primaryKeyFieldRefs"]?.length?s.jsxs("li",{children:["Primary key will be ",n.isNewModel?"set":"updated"," ","with"," ",s.jsx("span",{className:"font-medium",children:n.changes["model.primaryKeyFieldRefs"].length})," ","field(s)"]}):void 0]})]})})]},n.name))})}const{createContext:Q}=await i("react"),O=Q(null),{useEffect:C,useId:H}=await i("react"),f=p(e=>({activeBlockers:[],addBlocker:t=>{e(n=>({activeBlockers:[...n.activeBlockers,t]}))},removeBlocker:t=>{e(n=>({activeBlockers:n.activeBlockers.filter(r=>r.id!==t)}))},requestedBlockers:[],requestBlocker(t){e(n=>({requestedBlockers:[...n.requestedBlockers,t]}))},clearRequestedBlockers:()=>{e(()=>({requestedBlockers:[]}))}}));function ae(){const e=f(r=>r.activeBlockers.length>0),t=f(r=>r.clearRequestedBlockers);C(()=>()=>{t()},[t]);const n=f(r=>r.requestBlocker);return e?n:({onContinue:r})=>{r()}}function x(e){const t=H(),n=f(o=>o.addBlocker),r=f(o=>o.removeBlocker);C(()=>{if(!e.disableBlock)return n({disableBlock:e.disableBlock,title:e.title,content:e.content,buttonContinueWithoutSaveText:e.buttonContinueWithoutSaveText,onContinueWithoutSave:e.onContinueWithoutSave,buttonContinueText:e.buttonContinueText,onContinue:e.onContinue,id:t}),()=>{r(t)}},[n,r,e.disableBlock,e.buttonContinueWithoutSaveText,e.onContinueWithoutSave,e.buttonContinueText,e.content,e.title,e.onContinue,t])}function ie(e,t){x({disableBlock:!e.isDirty,title:"Unsaved Changes",content:"You have unsaved changes. Are you sure you want to continue?",buttonContinueText:"Discard Changes",onContinue:()=>(t(),!0)})}const{toast:le}=await i("@baseplate-dev/ui-components"),{useEffect:ue,useRef:z}=await i("react");function ce({control:e,reset:t,onSubmit:n}){const r=z(!1),o=v({control:e});r.current=o.isDirty,x({disableBlock:!o.isDirty,title:"Unsaved Changes",content:"You have unsaved changes. Do you want to save your changes?",buttonContinueWithoutSaveText:"Discard Changes",onContinueWithoutSave:()=>(t(),!0),buttonContinueText:"Save",onContinue:async()=>(await n(),await new Promise(a=>setTimeout(a,1)),!r.current)})}const{useContext:K}=await i("react");function de(){const e=K(O);if(!e)throw new Error("useErrorHandler must be used within an ErrorHandlerContext");return e}const{useMemo:Y}=await i("react");function fe(e){const{pluginContainer:t}=m();return Y(()=>M(e,t),[e,t])}const{toast:G}=await i("@baseplate-dev/ui-components"),{useEffect:J,useRef:L}=await i("react");function me(e){const t=k(e),{reset:n,formState:r}=t,{isDirty:o}=r,{updatedExternally:a}=m(),c=L(void 0);return J(()=>{c.current&&!h(c.current.oldDefaultValues,e?.defaultValues)&&(n(e?.defaultValues),o&&a&&G.warning("Contents were updated externally so form was reset!")),(!c.current||!h(c.current.oldDefaultValues,e?.defaultValues))&&(c.current={oldDefaultValues:e?.defaultValues})},[e?.defaultValues,n,a,o]),t}function he(e){return e}function X(){const e=new Map;return{registerInputWebConfig(t){if(e.has(t.name))throw new Error(`Admin CRUD input with name ${t.name} is already registered`);e.set(t.name,t)},getInputWebConfig(t,n=[]){const r=n.find(a=>a.name===t);if(r)return r;const o=e.get(t);if(!o)throw new Error(`Unable to find input with name ${t}`);return o},getInputWebConfigs(t=[]){return[...t,...e.values()]}}}const be=b("core/admin-crud-input-web",{defaultInitializer:X});function we(e){return e}function Z(){const e=new Map;return{registerTransformerWebConfig(t){if(e.has(t.name))throw new Error(`Model transformer with name ${t.name} is already registered`);e.set(t.name,t)},getTransformerWebConfig(t,n=[]){const r=n.find(a=>a.name===t);if(r)return r;const o=e.get(t);if(!o)throw new Error(`Unable to find transformer with name ${t}`);return o},getTransformerWebConfigs(t=[]){return[...t,...e.values()]}}}const Ce=b("core/model-transformer-web",{defaultInitializer:Z});function xe(e){if(e!=="")return e}export{O as ErrorHandlerContext,D as FeatureComboboxField,re as FeatureComboboxFieldController,P as ModelComboboxField,oe as ModelComboboxFieldController,se as ModelMergerResultAlert,S as ProjectDefinitionContext,be as adminCrudInputWebSpec,he as createAdminCrudInputWebConfig,X as createAdminCrudInputWebImplementation,Z as createModelTransformerWebImplementation,we as createNewModelTransformerWebConfig,Ce as modelTransformerWebSpec,xe as setUndefinedIfEmpty,ae as useBlockBeforeContinue,ie as useBlockDirtyFormNavigate,ce as useBlockUnsavedChangesNavigate,x as useBlockerDialog,f as useBlockerDialogState,de as useErrorHandler,fe as usePluginEnhancedSchema,m as useProjectDefinition,me as useResettableForm};
2
+ //# sourceMappingURL=web-Ctbly4ZZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-Ctbly4ZZ.js","sources":["../../../../../project-builder-lib/dist/web/hooks/useProjectDefinition.js","../../../../../project-builder-lib/dist/web/components/FeatureComboboxField.js","../../../../../project-builder-lib/dist/web/components/ModelComboboxField.js","../../../../../project-builder-lib/dist/web/components/ModelMergerResultAlert.js","../../../../../project-builder-lib/dist/web/contexts/error-handler.js","../../../../../project-builder-lib/dist/web/hooks/useBlockerDialog.js","../../../../../project-builder-lib/dist/web/hooks/useBlockDirtyFormNavigate.js","../../../../../project-builder-lib/dist/web/hooks/useBlockUnsavedChangesNavigate.js","../../../../../project-builder-lib/dist/web/hooks/useErrorHandler.js","../../../../../project-builder-lib/dist/web/hooks/usePluginEnhancedSchema.js","../../../../../project-builder-lib/dist/web/hooks/useResettableForm.js","../../../../../project-builder-lib/dist/web/specs/admin-crud-input-web-spec.js","../../../../../project-builder-lib/dist/web/specs/model-transformer-web-spec.js","../../../../../project-builder-lib/dist/web/utils/form.js"],"sourcesContent":["import React from 'react';\nexport const ProjectDefinitionContext = React.createContext(null);\nexport function useProjectDefinition() {\n const result = React.useContext(ProjectDefinitionContext);\n if (!result) {\n throw new Error(`useProjectDefinition must be used within a <ProjectDefinitionProvider>`);\n }\n return result;\n}\n//# sourceMappingURL=useProjectDefinition.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { ComboboxField, useControllerMerged, } from '@baseplate-dev/ui-components';\nimport { useMemo, useState } from 'react';\nimport { FeatureUtils } from '#src/definition/index.js';\nimport { useProjectDefinition } from '../hooks/useProjectDefinition.js';\nfunction createCreateOption(value) {\n return {\n label: `Create \"${value}\"`,\n value,\n };\n}\nfunction FeatureComboboxField({ canCreate, value, ...rest }) {\n const { definition } = useProjectDefinition();\n const [searchQuery, setSearchQuery] = useState('');\n const featureOptions = useMemo(() => {\n const baseFeatures = definition.features.map((feature) => ({\n label: feature.name,\n value: feature.id,\n }));\n if (!canCreate)\n return baseFeatures;\n const newFeatureName = searchQuery ? searchQuery : value;\n const doesNewFeatureExist = !!baseFeatures.some((option) => option.label === newFeatureName || option.value === newFeatureName);\n return !doesNewFeatureExist &&\n newFeatureName &&\n FeatureUtils.validateFeatureName(newFeatureName)\n ? [...baseFeatures, createCreateOption(newFeatureName)]\n : baseFeatures;\n }, [definition.features, searchQuery, value, canCreate]);\n return (_jsx(ComboboxField, { placeholder: \"Select a feature\", ...rest, searchQuery: canCreate ? searchQuery : undefined, onSearchQueryChange: setSearchQuery, options: featureOptions, value: value }));\n}\nfunction FeatureComboboxFieldController({ name, control, ...rest }) {\n const { field, fieldState: { error }, } = useControllerMerged({ name, control }, rest);\n const restProps = rest;\n return (_jsx(FeatureComboboxField, { error: error?.message, ...restProps, ...field, value: field.value ?? null }));\n}\nexport { FeatureComboboxField, FeatureComboboxFieldController };\n//# sourceMappingURL=FeatureComboboxField.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { ComboboxField, useControllerMerged, } from '@baseplate-dev/ui-components';\nimport { useMemo, useState } from 'react';\nimport { ModelUtils } from '#src/definition/index.js';\nimport { useProjectDefinition } from '../hooks/useProjectDefinition.js';\nfunction createCreateOption(value) {\n return {\n label: `Create \"${value}\"`,\n value,\n };\n}\nfunction ModelComboboxField({ canCreate, value, ...rest }) {\n const { definition } = useProjectDefinition();\n const [searchQuery, setSearchQuery] = useState('');\n const modelOptions = useMemo(() => {\n const baseModels = definition.models.map((model) => ({\n label: model.name,\n value: model.id,\n }));\n if (!canCreate)\n return baseModels;\n const newModelName = searchQuery ? searchQuery : value;\n const doesNewModelExist = !!baseModels.some((option) => option.label === newModelName || option.value === newModelName);\n return !doesNewModelExist &&\n newModelName &&\n ModelUtils.validateModelName(newModelName)\n ? [...baseModels, createCreateOption(newModelName)]\n : baseModels;\n }, [definition.models, searchQuery, value, canCreate]);\n return (_jsx(ComboboxField, { placeholder: \"Select a model\", ...rest, searchQuery: canCreate ? searchQuery : undefined, onSearchQueryChange: setSearchQuery, options: modelOptions, value: value }));\n}\nfunction ModelComboboxFieldController({ name, control, ...rest }) {\n const { field, fieldState: { error }, } = useControllerMerged({ name, control }, rest);\n const restProps = rest;\n return (_jsx(ModelComboboxField, { error: error?.message, ...restProps, ...field, value: field.value ?? null }));\n}\nexport { ModelComboboxField, ModelComboboxFieldController };\n//# sourceMappingURL=ModelComboboxField.js.map","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { Alert, AlertDescription, AlertTitle, } from '@baseplate-dev/ui-components';\nexport function ModelMergerResultAlert({ pendingModelChanges, }) {\n const changes = Object.values(pendingModelChanges).filter((change) => change !== undefined);\n if (changes.length === 0) {\n return null;\n }\n return (_jsx(\"div\", { className: \"space-y-4\", children: changes.map((change) => (_jsxs(Alert, { variant: change.isNewModel ? 'default' : 'warning', children: [_jsxs(AlertTitle, { children: [change.isNewModel ? 'New Model' : 'Model Changes', \": \", change.name] }), _jsx(AlertDescription, { children: _jsxs(\"div\", { className: \"mt-2 space-y-2\", children: [change.isNewModel ? (_jsx(\"p\", { children: \"This is a new model that will be created with the following configuration:\" })) : (_jsx(\"p\", { children: \"The following changes will be applied to the model:\" })), _jsxs(\"ul\", { className: \"list-disc pl-4 space-y-1\", children: [change.changes['model.fields']?.length ? (_jsxs(\"li\", { children: [_jsx(\"span\", { className: \"font-medium\", children: change.changes['model.fields'].length }), ' ', \"field(s) will be\", change.isNewModel ? ' created' : ' added or updated'] })) : undefined, change.changes['model.relations']?.length ? (_jsxs(\"li\", { children: [_jsx(\"span\", { className: \"font-medium\", children: change.changes['model.relations'].length }), ' ', \"relation(s) will be\", change.isNewModel ? ' created' : ' added or updated'] })) : undefined, change.changes['model.uniqueConstraints']?.length ? (_jsxs(\"li\", { children: [_jsx(\"span\", { className: \"font-medium\", children: change.changes['model.uniqueConstraints'].length }), ' ', \"unique constraint(s) will be\", ' ', change.isNewModel ? 'created' : 'added or updated'] })) : undefined, change.changes['model.primaryKeyFieldRefs']?.length ? (_jsxs(\"li\", { children: [\"Primary key will be \", change.isNewModel ? 'set' : 'updated', ' ', \"with\", ' ', _jsx(\"span\", { className: \"font-medium\", children: change.changes['model.primaryKeyFieldRefs'].length }), ' ', \"field(s)\"] })) : undefined] })] }) })] }, change.name))) }));\n}\n//# sourceMappingURL=ModelMergerResultAlert.js.map","import { createContext } from 'react';\nexport const ErrorHandlerContext = createContext(null);\n//# sourceMappingURL=error-handler.js.map","import { useEffect, useId } from 'react';\nimport { create } from 'zustand';\nexport const useBlockerDialogState = create((set) => ({\n activeBlockers: [],\n addBlocker: (options) => {\n set((state) => ({\n activeBlockers: [...state.activeBlockers, options],\n }));\n },\n removeBlocker: (id) => {\n set((state) => ({\n activeBlockers: state.activeBlockers.filter((blocker) => blocker.id !== id),\n }));\n },\n requestedBlockers: [],\n requestBlocker(options) {\n set((state) => ({\n requestedBlockers: [...state.requestedBlockers, options],\n }));\n },\n clearRequestedBlockers: () => {\n set(() => ({\n requestedBlockers: [],\n }));\n },\n}));\nexport function useBlockBeforeContinue() {\n const hasActiveBlockers = useBlockerDialogState((state) => state.activeBlockers.length > 0);\n const clearRequestedBlockers = useBlockerDialogState((state) => state.clearRequestedBlockers);\n // make sure we clear any blocker requests if we navigate away\n useEffect(() => () => {\n clearRequestedBlockers();\n }, [clearRequestedBlockers]);\n const requestBlocker = useBlockerDialogState((state) => state.requestBlocker);\n // if no blockers, continue immediately\n if (!hasActiveBlockers) {\n return ({ onContinue }) => {\n onContinue();\n };\n }\n return requestBlocker;\n}\nexport function useBlockerDialog(options) {\n const id = useId();\n const addBlocker = useBlockerDialogState((state) => state.addBlocker);\n const removeBlocker = useBlockerDialogState((state) => state.removeBlocker);\n useEffect(() => {\n if (options.disableBlock) {\n return;\n }\n addBlocker({\n disableBlock: options.disableBlock,\n title: options.title,\n content: options.content,\n buttonContinueWithoutSaveText: options.buttonContinueWithoutSaveText,\n onContinueWithoutSave: options.onContinueWithoutSave,\n buttonContinueText: options.buttonContinueText,\n onContinue: options.onContinue,\n id,\n });\n return () => {\n removeBlocker(id);\n };\n }, [\n addBlocker,\n removeBlocker,\n options.disableBlock,\n options.buttonContinueWithoutSaveText,\n options.onContinueWithoutSave,\n options.buttonContinueText,\n options.content,\n options.title,\n options.onContinue,\n id,\n ]);\n}\n//# sourceMappingURL=useBlockerDialog.js.map","import { useBlockerDialog } from './useBlockerDialog.js';\nexport function useBlockDirtyFormNavigate(formState, reset) {\n useBlockerDialog({\n disableBlock: !formState.isDirty,\n title: 'Unsaved Changes',\n content: 'You have unsaved changes. Are you sure you want to continue?',\n buttonContinueText: 'Discard Changes',\n onContinue: () => {\n reset();\n return true;\n },\n });\n}\n//# sourceMappingURL=useBlockDirtyFormNavigate.js.map","import { toast } from '@baseplate-dev/ui-components';\nimport { flattenObject } from 'es-toolkit';\nimport { useEffect, useRef } from 'react';\nimport { useFormState } from 'react-hook-form';\nimport { useBlockerDialog } from './useBlockerDialog.js';\nexport function useBlockUnsavedChangesNavigate({ control, reset, onSubmit, }) {\n const isDirtyRef = useRef(false);\n const formState = useFormState({ control });\n isDirtyRef.current = formState.isDirty;\n if (import.meta.env.DEV) {\n // eslint-disable-next-line react-hooks/rules-of-hooks -- only want to run this check in dev mode for performance/usability reasons\n useEffect(() => {\n if (Object.keys(formState.dirtyFields).length === 0 &&\n formState.isDirty) {\n // a bit of a hack to figure out what the issue is but OK since we only do this in dev mode\n const { _formValues, _defaultValues } = control;\n const formValueKeys = Object.keys(flattenObject(_formValues));\n const defaultValueKeys = Object.keys(flattenObject(_defaultValues));\n const missingKeys = formValueKeys.filter((key) => !defaultValueKeys.includes(key));\n toast.error(`Form is dirty but no fields are marked as dirty. This implies that there is likely a field ` +\n `is controlled but not set in defaultValues. This can be fixed by setting the default value to the field. ` +\n `Note: You will only see this error if you are running the app in dev mode. ` +\n `Missing fields: ${missingKeys.join(', ')}`);\n }\n }, [formState.dirtyFields, formState.isDirty, control]);\n }\n useBlockerDialog({\n disableBlock: !formState.isDirty,\n title: 'Unsaved Changes',\n content: 'You have unsaved changes. Do you want to save your changes?',\n buttonContinueWithoutSaveText: 'Discard Changes',\n onContinueWithoutSave: () => {\n reset();\n return true;\n },\n buttonContinueText: 'Save',\n onContinue: async () => {\n await onSubmit();\n // a bit of a hack to make sure we get the latest form state before continuing\n // there's not an easy way of figuring out if the submission was successful or not\n // so we wait for a React re-render and then check if the form is still dirty\n await new Promise((resolve) => setTimeout(resolve, 1));\n return !isDirtyRef.current;\n },\n });\n}\n//# sourceMappingURL=useBlockUnsavedChangesNavigate.js.map","import { useContext } from 'react';\nimport { ErrorHandlerContext } from '../contexts/error-handler.js';\nexport function useErrorHandler() {\n const context = useContext(ErrorHandlerContext);\n if (!context) {\n throw new Error('useErrorHandler must be used within an ErrorHandlerContext');\n }\n return context;\n}\n//# sourceMappingURL=useErrorHandler.js.map","import { useMemo } from 'react';\nimport { zPluginWrapper } from '#src/plugins/index.js';\nimport { useProjectDefinition } from './useProjectDefinition.js';\nexport function usePluginEnhancedSchema(schema) {\n const { pluginContainer } = useProjectDefinition();\n return useMemo(() => zPluginWrapper(schema, pluginContainer), [schema, pluginContainer]);\n}\n//# sourceMappingURL=usePluginEnhancedSchema.js.map","import { toast } from '@baseplate-dev/ui-components';\nimport { isEqual } from 'es-toolkit';\nimport { useEffect, useRef } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useProjectDefinition } from './useProjectDefinition.js';\nexport function useResettableForm(props) {\n const formProps = useForm(props);\n const { reset, formState } = formProps;\n const { isDirty } = formState;\n const { updatedExternally } = useProjectDefinition();\n const oldValues = useRef(undefined);\n useEffect(() => {\n if (oldValues.current &&\n !isEqual(oldValues.current.oldDefaultValues, props?.defaultValues)) {\n reset(props?.defaultValues);\n if (isDirty && updatedExternally) {\n toast.warning('Contents were updated externally so form was reset!');\n }\n }\n if (!oldValues.current ||\n !isEqual(oldValues.current.oldDefaultValues, props?.defaultValues)) {\n oldValues.current = {\n oldDefaultValues: props?.defaultValues,\n };\n }\n }, [props?.defaultValues, reset, updatedExternally, isDirty]);\n return formProps;\n}\n//# sourceMappingURL=useResettableForm.js.map","import { createPluginSpec } from '#src/plugins/spec/types.js';\nexport function createAdminCrudInputWebConfig(config) {\n return config;\n}\nexport function createAdminCrudInputWebImplementation() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputs = new Map();\n return {\n registerInputWebConfig(input) {\n if (inputs.has(input.name)) {\n throw new Error(`Admin CRUD input with name ${input.name} is already registered`);\n }\n inputs.set(input.name, input);\n },\n getInputWebConfig(name, builtInInputs = []) {\n const builtInInput = builtInInputs.find((b) => b.name === name);\n if (builtInInput) {\n return builtInInput;\n }\n const input = inputs.get(name);\n if (!input) {\n throw new Error(`Unable to find input with name ${name}`);\n }\n return input;\n },\n getInputWebConfigs(builtInInputs = []) {\n return [...builtInInputs, ...inputs.values()];\n },\n };\n}\n/**\n * Spec for adding config component for plugin\n */\nexport const adminCrudInputWebSpec = createPluginSpec('core/admin-crud-input-web', { defaultInitializer: createAdminCrudInputWebImplementation });\n//# sourceMappingURL=admin-crud-input-web-spec.js.map","import { createPluginSpec } from '#src/plugins/spec/types.js';\nexport function createNewModelTransformerWebConfig(config) {\n return config;\n}\nexport function createModelTransformerWebImplementation() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const transformers = new Map();\n return {\n registerTransformerWebConfig(transformer) {\n if (transformers.has(transformer.name)) {\n throw new Error(`Model transformer with name ${transformer.name} is already registered`);\n }\n transformers.set(transformer.name, transformer);\n },\n getTransformerWebConfig(name, builtInTransformers = []) {\n const builtInTransformer = builtInTransformers.find((b) => b.name === name);\n if (builtInTransformer) {\n return builtInTransformer;\n }\n const transformer = transformers.get(name);\n if (!transformer) {\n throw new Error(`Unable to find transformer with name ${name}`);\n }\n return transformer;\n },\n getTransformerWebConfigs(builtInTransformers = []) {\n return [...builtInTransformers, ...transformers.values()];\n },\n };\n}\n/**\n * Spec for adding config component for plugin\n */\nexport const modelTransformerWebSpec = createPluginSpec('core/model-transformer-web', { defaultInitializer: createModelTransformerWebImplementation });\n//# sourceMappingURL=model-transformer-web-spec.js.map","export function setUndefinedIfEmpty(value) {\n if (value === '')\n return undefined;\n return value;\n}\n//# sourceMappingURL=form.js.map"],"names":["React","importShared","ProjectDefinitionContext","useProjectDefinition","result","ComboboxField","useControllerMerged","useMemo","useState","createCreateOption","value","FeatureComboboxField","canCreate","rest","definition","searchQuery","setSearchQuery","featureOptions","baseFeatures","feature","newFeatureName","option","FeatureUtils","_jsx","FeatureComboboxFieldController","name","control","field","error","restProps","ModelComboboxField","modelOptions","baseModels","model","newModelName","ModelUtils","ModelComboboxFieldController","Alert","AlertDescription","AlertTitle","ModelMergerResultAlert","pendingModelChanges","changes","change","_jsxs","createContext","ErrorHandlerContext","useEffect","useId","useBlockerDialogState","create","set","options","state","id","blocker","useBlockBeforeContinue","hasActiveBlockers","clearRequestedBlockers","requestBlocker","onContinue","useBlockerDialog","addBlocker","removeBlocker","useBlockDirtyFormNavigate","formState","reset","toast","useRef","useBlockUnsavedChangesNavigate","onSubmit","isDirtyRef","useFormState","resolve","useContext","useErrorHandler","context","usePluginEnhancedSchema","schema","pluginContainer","zPluginWrapper","useResettableForm","props","formProps","useForm","isDirty","updatedExternally","oldValues","isEqual","createAdminCrudInputWebConfig","config","createAdminCrudInputWebImplementation","inputs","input","builtInInputs","builtInInput","b","adminCrudInputWebSpec","createPluginSpec","createNewModelTransformerWebConfig","createModelTransformerWebImplementation","transformers","transformer","builtInTransformers","builtInTransformer","modelTransformerWebSpec","setUndefinedIfEmpty"],"mappings":"2PAAA,MAAAA,EAAA,MAAAC,EAAA,OAAA,EACaC,EAA2BF,EAAM,cAAc,IAAI,EACzD,SAASG,GAAuB,CACnC,MAAMC,EAASJ,EAAM,WAAWE,CAAwB,EACxD,GAAI,CAACE,EACD,MAAM,IAAI,MAAM,wEAAwE,EAE5F,OAAOA,CACX,CCPA,KAAA,CAAA,cAAAC,EAAA,oBAAAC,CAAA,EAAA,MAAAL,EAAA,8BAAA,EACA,CAAA,QAAAM,EAAA,SAAAC,CAAA,EAAA,MAAAP,EAAA,OAAA,EAGA,SAASQ,EAAmBC,EAAO,CAC/B,MAAO,CACH,MAAO,WAAWA,CAAK,IACvB,MAAAA,CACH,CACL,CACA,SA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