@apia/api 2.0.9 → 2.0.10
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/ApiaApiContext.js +15 -0
- package/dist/ApiaApiContext.js.map +1 -0
- package/dist/ApiaApiHandler.d.ts +62 -0
- package/dist/ApiaApiHandler.d.ts.map +1 -0
- package/dist/ApiaApiHandler.js +374 -0
- package/dist/ApiaApiHandler.js.map +1 -0
- package/dist/apiaApi.d.ts +156 -0
- package/dist/apiaApi.d.ts.map +1 -0
- package/dist/apiaApi.js +458 -0
- package/dist/apiaApi.js.map +1 -0
- package/dist/buttons/ApiaApiButtonsContainer.js +129 -0
- package/dist/buttons/ApiaApiButtonsContainer.js.map +1 -0
- package/dist/fields/ApiaApiCheckbox.js +39 -0
- package/dist/fields/ApiaApiCheckbox.js.map +1 -0
- package/dist/fields/ApiaApiFieldsContainer.js +213 -0
- package/dist/fields/ApiaApiFieldsContainer.js.map +1 -0
- package/dist/fields/ApiaApiFileInput.js +34 -0
- package/dist/fields/ApiaApiFileInput.js.map +1 -0
- package/dist/fields/ApiaApiInput.d.ts +20 -0
- package/dist/fields/ApiaApiInput.d.ts.map +1 -0
- package/dist/fields/ApiaApiInput.js +110 -0
- package/dist/fields/ApiaApiInput.js.map +1 -0
- package/dist/fields/ApiaApiRadio.js +43 -0
- package/dist/fields/ApiaApiRadio.js.map +1 -0
- package/dist/fields/ApiaApiSelect.js +64 -0
- package/dist/fields/ApiaApiSelect.js.map +1 -0
- package/dist/fields/ApiaApiTextArea.js +50 -0
- package/dist/fields/ApiaApiTextArea.js.map +1 -0
- package/dist/index.d.ts +4 -297
- package/dist/index.js +3 -3212
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +39 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from '@apia/theme/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { createContext } from 'react';
|
|
4
|
+
|
|
5
|
+
const ApiaApiId = createContext("apiaApi");
|
|
6
|
+
const ApiaApiContext = ({
|
|
7
|
+
children,
|
|
8
|
+
id
|
|
9
|
+
}) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(ApiaApiId.Provider, { value: id, children });
|
|
11
|
+
};
|
|
12
|
+
var ApiaApiContext$1 = React.memo(ApiaApiContext);
|
|
13
|
+
|
|
14
|
+
export { ApiaApiContext$1 as default };
|
|
15
|
+
//# sourceMappingURL=ApiaApiContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiaApiContext.js","sources":["../src/ApiaApiContext.tsx"],"sourcesContent":["import { createContext } from 'react';\r\nimport * as React from 'react';\r\n\r\nlet apiaApiId: string | undefined;\r\n\r\nexport function getApiaApiId() {\r\n if (!apiaApiId) throw new Error('There is no apia api id');\r\n return apiaApiId;\r\n}\r\n\r\nconst ApiaApiId = createContext<string | undefined>('apiaApi');\r\n\r\nconst ApiaApiContext = ({\r\n children,\r\n id,\r\n}: {\r\n id: string;\r\n children: React.ReactNode;\r\n}) => {\r\n apiaApiId = id;\r\n return <ApiaApiId.Provider value={id}>{children}</ApiaApiId.Provider>;\r\n};\r\n\r\nexport default React.memo(ApiaApiContext);\r\n"],"names":[],"mappings":";;;;AAUA,MAAM,SAAA,GAAY,cAAkC,SAAS,CAAA,CAAA;AAE7D,MAAM,iBAAiB,CAAC;AAAA,EACtB,QAAA;AAAA,EACA,EAAA;AACF,CAGM,KAAA;AAEJ,EAAA,2BAAQ,SAAU,CAAA,QAAA,EAAV,EAAmB,KAAA,EAAO,IAAK,QAAS,EAAA,CAAA,CAAA;AAClD,CAAA,CAAA;AAEA,uBAAe,KAAA,CAAM,KAAK,cAAc,CAAA;;;;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AxiosResponse } from 'axios';
|
|
3
|
+
import { TApiaLoad, TModify, TApiaFormElement } from '@apia/util';
|
|
4
|
+
import { notify } from '@apia/notifications';
|
|
5
|
+
import { TModal } from '@apia/components';
|
|
6
|
+
import { IApiaApiRequestConfig } from './types.js';
|
|
7
|
+
|
|
8
|
+
type TMethod = {
|
|
9
|
+
name: string;
|
|
10
|
+
props: {
|
|
11
|
+
attributes?: Record<string, unknown>;
|
|
12
|
+
currentUrl?: string;
|
|
13
|
+
funCall?: string;
|
|
14
|
+
inlineArguments?: string[];
|
|
15
|
+
messages?: unknown;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type TApiaApiMethodHandler = {
|
|
19
|
+
alert: typeof notify;
|
|
20
|
+
close: () => void;
|
|
21
|
+
configuration?: THandleConfiguration;
|
|
22
|
+
formDefinition: TApiaLoad;
|
|
23
|
+
setModalProps?: (configuration: THandleConfiguration, formDefinition?: TApiaLoad) => TModal | null;
|
|
24
|
+
reset: () => void;
|
|
25
|
+
setError: typeof notify;
|
|
26
|
+
setMessage: (message: Record<string, unknown>) => unknown;
|
|
27
|
+
setState: React.Dispatch<React.SetStateAction<IApiaApiHandlerState>>;
|
|
28
|
+
state: IApiaApiHandlerState;
|
|
29
|
+
setValue: (name: string, value: string) => void;
|
|
30
|
+
};
|
|
31
|
+
type TApiaApiMethod = (handler: TApiaApiMethodHandler, props: TMethod['props']) => Promise<void> | void;
|
|
32
|
+
type TApiaApiField = TApiaApiMethodHandler & {
|
|
33
|
+
element: TModify<TApiaFormElement, {
|
|
34
|
+
onChange: React.ChangeEventHandler;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
type TStoredApiaApiMethod = (props?: TMethod['props']) => unknown;
|
|
38
|
+
/**
|
|
39
|
+
* Este método permite cargar en forma asíncrona un método que se encuentre
|
|
40
|
+
* dentro del directorio /api/methods
|
|
41
|
+
*/
|
|
42
|
+
declare function getFunction(name: string, handler: TApiaApiMethodHandler): Promise<TStoredApiaApiMethod | undefined>;
|
|
43
|
+
interface IModalConfig {
|
|
44
|
+
modalTitle?: string;
|
|
45
|
+
onClose?: () => void;
|
|
46
|
+
onMessage?: (message: Record<string, unknown>) => unknown;
|
|
47
|
+
onMessageClose?: () => unknown;
|
|
48
|
+
onSubmitted?: (handler: TApiaApiMethodHandler, response: AxiosResponse<Record<string, unknown> | null> | null) => unknown;
|
|
49
|
+
}
|
|
50
|
+
type THandleConfiguration = Partial<Pick<IApiaApiRequestConfig<unknown>, 'modalConfiguration' | 'methodsPath' | 'setModalProps'>>;
|
|
51
|
+
interface IApiaApiHandlerState {
|
|
52
|
+
disabled: boolean;
|
|
53
|
+
isLoading: boolean;
|
|
54
|
+
isMultipart: boolean;
|
|
55
|
+
progress: number;
|
|
56
|
+
errors: Record<string, string>;
|
|
57
|
+
windowIndex: number;
|
|
58
|
+
}
|
|
59
|
+
declare const ApiaApiHandler: React.MemoExoticComponent<() => React.JSX.Element>;
|
|
60
|
+
|
|
61
|
+
export { ApiaApiHandler, type IApiaApiHandlerState, type IModalConfig, type TApiaApiField, type TApiaApiMethod, type TApiaApiMethodHandler, type THandleConfiguration, getFunction };
|
|
62
|
+
//# sourceMappingURL=ApiaApiHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiaApiHandler.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { jsx, jsxs } from '@apia/theme/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Box, getVariant } from '@apia/theme';
|
|
4
|
+
import { EventEmitter, StatefulEmitter, arrayOrArray, focus, focusSelector, useLatest } from '@apia/util';
|
|
5
|
+
import { notify } from '@apia/notifications';
|
|
6
|
+
import { validationsStore, Form } from '@apia/validations';
|
|
7
|
+
import { useModal, Modal, ProgressBar } from '@apia/components';
|
|
8
|
+
import ApiaApiContext from './ApiaApiContext.js';
|
|
9
|
+
import { ApiaActions } from './apiaApi.js';
|
|
10
|
+
import { ApiaApiFieldsContainer } from './fields/ApiaApiFieldsContainer.js';
|
|
11
|
+
import { ApiaApiButtonsContainer } from './buttons/ApiaApiButtonsContainer.js';
|
|
12
|
+
|
|
13
|
+
const ApiaApiMessenger = new class extends EventEmitter {
|
|
14
|
+
}();
|
|
15
|
+
const FunctionsDispatcher = new class extends EventEmitter {
|
|
16
|
+
}();
|
|
17
|
+
const apiaApiForm = "ApiaApiForm";
|
|
18
|
+
const methods = {};
|
|
19
|
+
async function getFunction(name, handler) {
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
try {
|
|
22
|
+
const separateNameFromParametersRegex = /^\/?([\w\d_-]+)\/?(?:\(([^)]*)\))?$/;
|
|
23
|
+
const match = name.match(separateNameFromParametersRegex);
|
|
24
|
+
if (match) {
|
|
25
|
+
const functionName = match[1];
|
|
26
|
+
const parameters = match[2];
|
|
27
|
+
const path = [
|
|
28
|
+
...handler.configuration?.methodsPath?.split("/").filter((current) => !!current) ?? [],
|
|
29
|
+
functionName
|
|
30
|
+
].join("/");
|
|
31
|
+
const storeMethodAndResolve = (result) => {
|
|
32
|
+
if (typeof result?.default?.default !== "function")
|
|
33
|
+
notFound();
|
|
34
|
+
const method = result.default.default;
|
|
35
|
+
methods[functionName] = (props) => {
|
|
36
|
+
return method(handler, {
|
|
37
|
+
...props,
|
|
38
|
+
inlineArguments: parameters?.split(",").map((argument) => {
|
|
39
|
+
if (argument.startsWith("'") || argument.startsWith('"'))
|
|
40
|
+
return argument.slice(1, argument.length - 1);
|
|
41
|
+
return argument;
|
|
42
|
+
}) ?? []
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
resolve(methods[functionName]);
|
|
46
|
+
};
|
|
47
|
+
const notFound = () => {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`${functionName}.ts not found at ${path}.ts nor ./${functionName}.ts`
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
import(
|
|
53
|
+
/* webpackChunkName: "api-methods-[request]" */
|
|
54
|
+
`/api/methods/${path}.ts`
|
|
55
|
+
).then(storeMethodAndResolve).catch(() => {
|
|
56
|
+
if (handler.configuration?.methodsPath !== void 0)
|
|
57
|
+
import(
|
|
58
|
+
/* webpackChunkName: "api-methods-[request]" */
|
|
59
|
+
`/api/methods/${functionName}.ts`
|
|
60
|
+
).then(storeMethodAndResolve).catch(notFound);
|
|
61
|
+
else {
|
|
62
|
+
notFound();
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.error(e);
|
|
68
|
+
handler.reset();
|
|
69
|
+
handler.setError({
|
|
70
|
+
type: "danger",
|
|
71
|
+
message: "Error while loading current method."
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function isForm(responseObject) {
|
|
77
|
+
return responseObject.form !== void 0 && typeof responseObject.form === "object" && !!responseObject.form;
|
|
78
|
+
}
|
|
79
|
+
function isFunction(responseObject) {
|
|
80
|
+
return typeof responseObject.canClose === "boolean" && typeof responseObject.type === "string" && !!responseObject.function;
|
|
81
|
+
}
|
|
82
|
+
function isMessage(responseObject) {
|
|
83
|
+
if (typeof responseObject.canClose === "boolean" && typeof responseObject.type === "string" && typeof responseObject.text === "object" && responseObject.text && typeof responseObject.text.label === "string") {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
const modalConfigurationHandler = new StatefulEmitter();
|
|
89
|
+
function useModalConfiguration() {
|
|
90
|
+
const value = modalConfigurationHandler.useState("value");
|
|
91
|
+
const latestValue = useLatest(value);
|
|
92
|
+
return latestValue;
|
|
93
|
+
}
|
|
94
|
+
const currentFormDispatcher = new class currentFormDispatcher2 extends EventEmitter {
|
|
95
|
+
emit(eventName, params) {
|
|
96
|
+
super.emit(eventName, params);
|
|
97
|
+
}
|
|
98
|
+
}();
|
|
99
|
+
function handle(responseObject, currentUrl, configuration) {
|
|
100
|
+
modalConfigurationHandler.setState("value", configuration);
|
|
101
|
+
if (isForm(responseObject)) {
|
|
102
|
+
currentFormDispatcher.emit("form", responseObject);
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
if (isFunction(responseObject)) {
|
|
106
|
+
FunctionsDispatcher.emit("method", {
|
|
107
|
+
name: responseObject.function.name,
|
|
108
|
+
props: {
|
|
109
|
+
messages: responseObject.function.messages,
|
|
110
|
+
attributes: responseObject.function,
|
|
111
|
+
currentUrl
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
if (isMessage(responseObject)) {
|
|
117
|
+
ApiaApiMessenger.emit("message", {
|
|
118
|
+
predicate: responseObject.text.content,
|
|
119
|
+
title: responseObject.text.title
|
|
120
|
+
});
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
const initialState = {
|
|
126
|
+
disabled: false,
|
|
127
|
+
isLoading: false,
|
|
128
|
+
isMultipart: false,
|
|
129
|
+
progress: 0,
|
|
130
|
+
errors: {}
|
|
131
|
+
};
|
|
132
|
+
const ApiaApiHandlerNonMemoized = () => {
|
|
133
|
+
const configuration = useModalConfiguration();
|
|
134
|
+
const [state, setState] = React.useState({
|
|
135
|
+
...initialState,
|
|
136
|
+
windowIndex: -1
|
|
137
|
+
});
|
|
138
|
+
const [currentForm2, setCurrentForm] = React.useState(
|
|
139
|
+
void 0
|
|
140
|
+
);
|
|
141
|
+
React.useEffect(() => {
|
|
142
|
+
return currentFormDispatcher.on("form", setCurrentForm);
|
|
143
|
+
}, []);
|
|
144
|
+
const setValue = React.useCallback((name, value) => {
|
|
145
|
+
return validationsStore.setFieldValue(apiaApiForm, name, value);
|
|
146
|
+
}, []);
|
|
147
|
+
React.useEffect(() => {
|
|
148
|
+
if (!currentForm2)
|
|
149
|
+
return;
|
|
150
|
+
const elements = arrayOrArray(currentForm2?.form?.elements?.element ?? []);
|
|
151
|
+
let isMultipart = false;
|
|
152
|
+
const elementsValues = Object.values(elements);
|
|
153
|
+
let i = 0;
|
|
154
|
+
while (i < elementsValues.length && !isMultipart) {
|
|
155
|
+
if (elementsValues[i++].type === "file") {
|
|
156
|
+
isMultipart = true;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
setState((currentState) => {
|
|
160
|
+
return {
|
|
161
|
+
...currentState,
|
|
162
|
+
...initialState,
|
|
163
|
+
isMultipart
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
}, [currentForm2]);
|
|
167
|
+
const { show, onClose, ...modalHookProps } = useModal();
|
|
168
|
+
const close = React.useCallback(() => {
|
|
169
|
+
onClose();
|
|
170
|
+
currentFormDispatcher.emit("form", void 0);
|
|
171
|
+
setState((currentState) => {
|
|
172
|
+
return { ...currentState, ...initialState };
|
|
173
|
+
});
|
|
174
|
+
configuration.current?.modalConfiguration?.onClose?.();
|
|
175
|
+
validationsStore.unregisterForm(apiaApiForm);
|
|
176
|
+
}, [onClose, configuration]);
|
|
177
|
+
const modalRef = React.useRef(null);
|
|
178
|
+
React.useEffect(() => {
|
|
179
|
+
const elements = modalRef.current?.querySelectorAll(
|
|
180
|
+
"a,input,textarea,button"
|
|
181
|
+
);
|
|
182
|
+
if (elements?.length === 1)
|
|
183
|
+
void focus.on([...elements][0]);
|
|
184
|
+
});
|
|
185
|
+
const setError = React.useCallback(
|
|
186
|
+
(notification) => {
|
|
187
|
+
notify({ ...notification });
|
|
188
|
+
},
|
|
189
|
+
[]
|
|
190
|
+
);
|
|
191
|
+
const initialFocusGetter = React.useCallback((ref) => {
|
|
192
|
+
return ref?.querySelector(focusSelector);
|
|
193
|
+
}, []);
|
|
194
|
+
const defaultModalProps = React.useMemo(
|
|
195
|
+
() => ({
|
|
196
|
+
onClose: close,
|
|
197
|
+
id: apiaApiForm,
|
|
198
|
+
title: configuration.current?.modalConfiguration?.modalTitle ?? currentForm2?.form.title,
|
|
199
|
+
size: "md-fixed",
|
|
200
|
+
shouldCloseOnEsc: !state.disabled,
|
|
201
|
+
shouldCloseOnOverlayClick: !state.disabled,
|
|
202
|
+
initialFocusGetter
|
|
203
|
+
}),
|
|
204
|
+
[
|
|
205
|
+
close,
|
|
206
|
+
configuration,
|
|
207
|
+
currentForm2?.form.title,
|
|
208
|
+
initialFocusGetter,
|
|
209
|
+
state.disabled
|
|
210
|
+
]
|
|
211
|
+
);
|
|
212
|
+
const getModalProps = React.useCallback(
|
|
213
|
+
(innerHandler) => {
|
|
214
|
+
if (innerHandler.setModalProps) {
|
|
215
|
+
const overrideProps = innerHandler.setModalProps?.(
|
|
216
|
+
{
|
|
217
|
+
methodsPath: innerHandler.configuration?.methodsPath,
|
|
218
|
+
modalConfiguration: innerHandler.configuration?.modalConfiguration
|
|
219
|
+
},
|
|
220
|
+
innerHandler.formDefinition
|
|
221
|
+
);
|
|
222
|
+
if (overrideProps) {
|
|
223
|
+
const currentOnClose = () => {
|
|
224
|
+
overrideProps?.onClose?.();
|
|
225
|
+
defaultModalProps.onClose?.();
|
|
226
|
+
};
|
|
227
|
+
const currentOnExited = () => {
|
|
228
|
+
overrideProps?.onExited?.();
|
|
229
|
+
modalHookProps?.onExited?.();
|
|
230
|
+
};
|
|
231
|
+
return {
|
|
232
|
+
...defaultModalProps,
|
|
233
|
+
...overrideProps,
|
|
234
|
+
...modalHookProps,
|
|
235
|
+
onClose: currentOnClose,
|
|
236
|
+
onExited: currentOnExited
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return { ...defaultModalProps, ...modalHookProps };
|
|
241
|
+
},
|
|
242
|
+
[defaultModalProps, modalHookProps]
|
|
243
|
+
);
|
|
244
|
+
const getHandler = React.useCallback(() => {
|
|
245
|
+
const newHandler = {
|
|
246
|
+
alert,
|
|
247
|
+
close,
|
|
248
|
+
configuration: configuration.current,
|
|
249
|
+
formDefinition: currentForm2,
|
|
250
|
+
reset: () => {
|
|
251
|
+
return setState((currentState) => {
|
|
252
|
+
return {
|
|
253
|
+
...currentState,
|
|
254
|
+
...initialState
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
},
|
|
258
|
+
setError,
|
|
259
|
+
setMessage: (message) => {
|
|
260
|
+
if (configuration.current?.modalConfiguration?.onMessage)
|
|
261
|
+
configuration.current.modalConfiguration.onMessage(message);
|
|
262
|
+
},
|
|
263
|
+
setState,
|
|
264
|
+
state,
|
|
265
|
+
setValue
|
|
266
|
+
};
|
|
267
|
+
return newHandler;
|
|
268
|
+
}, [close, configuration, currentForm2, setError, state, setValue]);
|
|
269
|
+
const handler = getHandler();
|
|
270
|
+
const modalProps = getModalProps(handler);
|
|
271
|
+
const handleAction = React.useCallback(
|
|
272
|
+
async (action) => {
|
|
273
|
+
const innerHandler = getHandler();
|
|
274
|
+
if (action.toDo === "ajaxHiddeAll") {
|
|
275
|
+
close();
|
|
276
|
+
}
|
|
277
|
+
if (action.toDo === "functionTimedCall") {
|
|
278
|
+
const method = await getFunction(
|
|
279
|
+
arrayOrArray(action.param)[1],
|
|
280
|
+
innerHandler
|
|
281
|
+
);
|
|
282
|
+
if (method) {
|
|
283
|
+
setTimeout(
|
|
284
|
+
() => method({
|
|
285
|
+
currentUrl: innerHandler.formDefinition?.form.action ?? "noUrl"
|
|
286
|
+
}),
|
|
287
|
+
Number(action.param[0])
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
[close, getHandler]
|
|
293
|
+
);
|
|
294
|
+
const handleFunction = React.useCallback(
|
|
295
|
+
async ({ name, props: { messages, attributes, currentUrl } }) => {
|
|
296
|
+
const innerHandler = getHandler();
|
|
297
|
+
const method = await getFunction(`${name}`, innerHandler);
|
|
298
|
+
if (method) {
|
|
299
|
+
method({ messages, attributes, currentUrl });
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
[getHandler]
|
|
303
|
+
);
|
|
304
|
+
const handleMessage = React.useCallback(
|
|
305
|
+
(ev) => {
|
|
306
|
+
const innerHandler = getHandler();
|
|
307
|
+
notify({
|
|
308
|
+
message: ev.predicate,
|
|
309
|
+
type: "warning",
|
|
310
|
+
onClose: innerHandler.configuration?.modalConfiguration?.onMessageClose
|
|
311
|
+
});
|
|
312
|
+
const onMessage = innerHandler.configuration?.modalConfiguration?.onMessage;
|
|
313
|
+
if (onMessage) {
|
|
314
|
+
onMessage(ev);
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
[getHandler]
|
|
318
|
+
);
|
|
319
|
+
React.useEffect(() => {
|
|
320
|
+
const u1 = ApiaApiMessenger.on("message", handleMessage);
|
|
321
|
+
const u2 = FunctionsDispatcher.on("method", handleFunction);
|
|
322
|
+
const u3 = ApiaActions.on("action", handleAction);
|
|
323
|
+
return () => {
|
|
324
|
+
u1();
|
|
325
|
+
u2();
|
|
326
|
+
u3();
|
|
327
|
+
};
|
|
328
|
+
}, [handleAction, handleFunction, handleMessage, state.windowIndex]);
|
|
329
|
+
React.useEffect(() => {
|
|
330
|
+
if (currentForm2) {
|
|
331
|
+
show();
|
|
332
|
+
}
|
|
333
|
+
}, [currentForm2]);
|
|
334
|
+
const formRef = React.useCallback(
|
|
335
|
+
async (el) => {
|
|
336
|
+
if (el && currentForm2?.form.onLoad) {
|
|
337
|
+
const method = await getFunction(
|
|
338
|
+
`${currentForm2?.form.onLoad}`,
|
|
339
|
+
getHandler()
|
|
340
|
+
);
|
|
341
|
+
if (method) {
|
|
342
|
+
method();
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
[currentForm2?.form.onLoad, getHandler]
|
|
347
|
+
);
|
|
348
|
+
return /* @__PURE__ */ jsx(ApiaApiContext, { id: apiaApiForm, children: /* @__PURE__ */ jsx(Modal, { ...modalProps, ref: modalRef, children: currentForm2 && /* @__PURE__ */ jsx(Box, { ...getVariant("layout.common.modals.apiaApi"), children: /* @__PURE__ */ jsxs(
|
|
349
|
+
Form,
|
|
350
|
+
{
|
|
351
|
+
name: apiaApiForm,
|
|
352
|
+
unregisterOnUnmount: true,
|
|
353
|
+
avoidFieldsOverride: true,
|
|
354
|
+
className: "handler__form",
|
|
355
|
+
children: [
|
|
356
|
+
/* @__PURE__ */ jsx(ApiaApiFieldsContainer, { definition: currentForm2, ...handler }),
|
|
357
|
+
state.isMultipart && state.progress > 0 && /* @__PURE__ */ jsx(Box, { className: "progressBox", children: /* @__PURE__ */ jsx(
|
|
358
|
+
ProgressBar,
|
|
359
|
+
{
|
|
360
|
+
id: "ApiaApiHandler progress",
|
|
361
|
+
progress: state.progress,
|
|
362
|
+
loading: true
|
|
363
|
+
}
|
|
364
|
+
) }),
|
|
365
|
+
/* @__PURE__ */ jsx(ApiaApiButtonsContainer, { definition: currentForm2, ...handler }),
|
|
366
|
+
/* @__PURE__ */ jsx(Box, { ref: formRef, sx: { display: "none" } })
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
) }) }) });
|
|
370
|
+
};
|
|
371
|
+
const ApiaApiHandler = React.memo(ApiaApiHandlerNonMemoized);
|
|
372
|
+
|
|
373
|
+
export { ApiaApiHandler, apiaApiForm, getFunction, handle, isForm, isFunction };
|
|
374
|
+
//# sourceMappingURL=ApiaApiHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiaApiHandler.js","sources":["../src/ApiaApiHandler.tsx"],"sourcesContent":["/* eslint-disable max-classes-per-file */\r\n\r\nimport * as React from 'react';\r\nimport { Box } from '@apia/theme';\r\nimport { AxiosResponse } from 'axios';\r\nimport {\r\n arrayOrArray,\r\n EventEmitter,\r\n focus,\r\n focusSelector,\r\n StatefulEmitter,\r\n TApiaAction,\r\n TApiaFormElement,\r\n TApiaFunction,\r\n TApiaLoad,\r\n TApiaLoadText,\r\n TModify,\r\n useLatest,\r\n} from '@apia/util';\r\nimport { notify } from '@apia/notifications';\r\nimport { Form, validationsStore } from '@apia/validations';\r\nimport { Modal, ProgressBar, TModal, useModal } from '@apia/components';\r\nimport { getVariant } from '@apia/theme';\r\nimport ApiaApiContext from './ApiaApiContext';\r\nimport { IApiaApiRequestConfig } from './types';\r\nimport { ApiaActions } from './apiaApi';\r\nimport { ApiaApiFieldsContainer } from './fields/ApiaApiFieldsContainer';\r\nimport { ApiaApiButtonsContainer } from './buttons/ApiaApiButtonsContainer';\r\n\r\nexport type TMessage = {\r\n isHtml?: boolean;\r\n predicate: string;\r\n title?: string;\r\n};\r\ntype TMessageLocal = { title: string; predicate: string };\r\ntype TMethod = {\r\n name: string;\r\n props: {\r\n attributes?: Record<string, unknown>;\r\n currentUrl?: string;\r\n funCall?: string;\r\n inlineArguments?: string[];\r\n messages?: unknown;\r\n };\r\n};\r\nconst ApiaApiMessenger = new (class extends EventEmitter<{\r\n message: TMessageLocal;\r\n}> {})();\r\nconst FunctionsDispatcher = new (class extends EventEmitter<{\r\n method: TMethod;\r\n}> {})();\r\n\r\nexport type TApiaApiMethodHandler = {\r\n alert: typeof notify;\r\n close: () => void;\r\n configuration?: THandleConfiguration;\r\n formDefinition: TApiaLoad;\r\n setModalProps?: (\r\n configuration: THandleConfiguration,\r\n formDefinition?: TApiaLoad,\r\n ) => TModal | null;\r\n reset: () => void;\r\n setError: typeof notify;\r\n setMessage: (message: Record<string, unknown>) => unknown;\r\n setState: React.Dispatch<React.SetStateAction<IApiaApiHandlerState>>;\r\n state: IApiaApiHandlerState;\r\n setValue: (name: string, value: string) => void;\r\n};\r\n\r\nexport type TApiaApiMethod = (\r\n handler: TApiaApiMethodHandler,\r\n props: TMethod['props'],\r\n) => Promise<void> | void;\r\n\r\nexport type TApiaApiField = TApiaApiMethodHandler & {\r\n element: TModify<TApiaFormElement, { onChange: React.ChangeEventHandler }>;\r\n};\r\n\r\nexport const apiaApiForm = 'ApiaApiForm';\r\n\r\ntype TStoredApiaApiMethod = (props?: TMethod['props']) => unknown;\r\n\r\nconst methods: Record<string, TStoredApiaApiMethod> = {};\r\n\r\n/**\r\n * Este método permite cargar en forma asíncrona un método que se encuentre\r\n * dentro del directorio /api/methods\r\n */\r\nexport async function getFunction(\r\n name: string,\r\n handler: TApiaApiMethodHandler,\r\n): Promise<TStoredApiaApiMethod | undefined> {\r\n return new Promise((resolve) => {\r\n try {\r\n const separateNameFromParametersRegex =\r\n /^\\/?([\\w\\d_-]+)\\/?(?:\\(([^)]*)\\))?$/;\r\n const match = name.match(separateNameFromParametersRegex);\r\n if (match) {\r\n const functionName = match[1];\r\n const parameters = match[2];\r\n const path: string = [\r\n ...(handler.configuration?.methodsPath\r\n ?.split('/')\r\n .filter((current) => !!current) ?? []),\r\n functionName,\r\n ].join('/');\r\n const storeMethodAndResolve = (result: {\r\n default: { default: TApiaApiMethod };\r\n }) => {\r\n if (typeof result?.default?.default !== 'function') notFound();\r\n\r\n const method = result.default.default;\r\n methods[functionName] = (props?: TMethod['props']) => {\r\n return method(handler, {\r\n ...props,\r\n inlineArguments:\r\n parameters?.split(',').map((argument) => {\r\n if (argument.startsWith(\"'\") || argument.startsWith('\"'))\r\n return argument.slice(1, argument.length - 1);\r\n return argument;\r\n }) ?? [],\r\n });\r\n };\r\n resolve(methods[functionName]);\r\n };\r\n\r\n const notFound = () => {\r\n throw new Error(\r\n `${functionName}.ts not found at ${path}.ts nor ./${functionName}.ts`,\r\n );\r\n };\r\n\r\n import(\r\n /* webpackChunkName: \"api-methods-[request]\" */ `/api/methods/${path}.ts`\r\n )\r\n .then(storeMethodAndResolve)\r\n .catch(() => {\r\n if (handler.configuration?.methodsPath !== undefined)\r\n import(\r\n /* webpackChunkName: \"api-methods-[request]\" */ `/api/methods/${functionName}.ts`\r\n )\r\n\r\n .then(storeMethodAndResolve)\r\n .catch(notFound);\r\n else {\r\n notFound();\r\n }\r\n });\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n handler.reset();\r\n handler.setError({\r\n type: 'danger',\r\n message: 'Error while loading current method.',\r\n });\r\n }\r\n });\r\n}\r\n\r\nexport function isForm(\r\n responseObject: Record<string, unknown>,\r\n): responseObject is TApiaLoad {\r\n return (\r\n responseObject.form !== undefined &&\r\n typeof responseObject.form === 'object' &&\r\n !!responseObject.form\r\n );\r\n}\r\n\r\nexport function isFunction(\r\n responseObject: Record<string, unknown>,\r\n): responseObject is TApiaLoad<TApiaFunction> {\r\n return (\r\n typeof responseObject.canClose === 'boolean' &&\r\n typeof responseObject.type === 'string' &&\r\n !!responseObject.function\r\n );\r\n}\r\n\r\nfunction isMessage(\r\n responseObject: Record<string, unknown>,\r\n): responseObject is TApiaLoad<TApiaLoadText> {\r\n if (\r\n typeof responseObject.canClose === 'boolean' &&\r\n typeof responseObject.type === 'string' &&\r\n typeof responseObject.text === 'object' &&\r\n responseObject.text &&\r\n typeof (responseObject.text as Record<string, unknown>).label === 'string'\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport interface IModalConfig {\r\n modalTitle?: string;\r\n onClose?: () => void;\r\n onMessage?: (message: Record<string, unknown>) => unknown;\r\n onMessageClose?: () => unknown;\r\n onSubmitted?: (\r\n handler: TApiaApiMethodHandler,\r\n response: AxiosResponse<Record<string, unknown> | null> | null,\r\n ) => unknown;\r\n}\r\n\r\nconst modalConfigurationHandler = new StatefulEmitter<{\r\n value: THandleConfiguration;\r\n}>();\r\n\r\nfunction useModalConfiguration() {\r\n const value = modalConfigurationHandler.useState('value');\r\n const latestValue = useLatest(value);\r\n\r\n return latestValue;\r\n}\r\n\r\nexport type THandleConfiguration = Partial<\r\n Pick<\r\n IApiaApiRequestConfig<unknown>,\r\n 'modalConfiguration' | 'methodsPath' | 'setModalProps'\r\n >\r\n>;\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nlet currentForm: TApiaLoad | undefined;\r\nconst currentFormDispatcher =\r\n new (class currentFormDispatcher extends EventEmitter<{\r\n form: TApiaLoad;\r\n }> {\r\n emit<K extends 'form'>(\r\n eventName: K,\r\n params?: { form: TApiaLoad }[K] | undefined,\r\n ): void {\r\n super.emit(eventName, params as TApiaLoad);\r\n currentForm = params;\r\n }\r\n })();\r\n\r\nexport function handle(\r\n responseObject: Record<string, unknown>,\r\n currentUrl: string,\r\n configuration: THandleConfiguration,\r\n) {\r\n modalConfigurationHandler.setState('value', configuration);\r\n if (isForm(responseObject)) {\r\n currentFormDispatcher.emit('form', responseObject);\r\n return true;\r\n }\r\n if (isFunction(responseObject)) {\r\n FunctionsDispatcher.emit('method', {\r\n name: responseObject.function.name,\r\n props: {\r\n messages: responseObject.function.messages,\r\n attributes: responseObject.function,\r\n currentUrl,\r\n },\r\n });\r\n return true;\r\n }\r\n if (isMessage(responseObject)) {\r\n ApiaApiMessenger.emit('message', {\r\n predicate: responseObject.text.content,\r\n title: responseObject.text.title,\r\n });\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport interface IApiaApiHandlerState {\r\n disabled: boolean;\r\n isLoading: boolean;\r\n isMultipart: boolean;\r\n progress: number;\r\n errors: Record<string, string>;\r\n windowIndex: number;\r\n}\r\n\r\nconst initialState: Omit<IApiaApiHandlerState, 'windowIndex'> = {\r\n disabled: false,\r\n isLoading: false,\r\n isMultipart: false,\r\n progress: 0,\r\n errors: {},\r\n};\r\n\r\nconst ApiaApiHandlerNonMemoized = () => {\r\n const configuration = useModalConfiguration();\r\n\r\n const [state, setState] = React.useState<IApiaApiHandlerState>({\r\n ...initialState,\r\n windowIndex: -1,\r\n });\r\n\r\n const [currentForm, setCurrentForm] = React.useState<TApiaLoad | undefined>(\r\n undefined,\r\n );\r\n React.useEffect(() => {\r\n return currentFormDispatcher.on('form', setCurrentForm);\r\n }, []);\r\n\r\n const setValue = React.useCallback((name: string, value: string) => {\r\n return validationsStore.setFieldValue(apiaApiForm, name, value);\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n if (!currentForm) return;\r\n const elements = arrayOrArray(currentForm?.form?.elements?.element ?? []);\r\n\r\n let isMultipart = false;\r\n const elementsValues = Object.values(elements);\r\n let i = 0;\r\n while (i < elementsValues.length && !isMultipart) {\r\n if (elementsValues[i++].type === 'file') {\r\n isMultipart = true;\r\n }\r\n }\r\n\r\n setState((currentState) => {\r\n return {\r\n ...currentState,\r\n ...initialState,\r\n isMultipart,\r\n };\r\n });\r\n }, [currentForm]);\r\n\r\n const { show, onClose, ...modalHookProps } = useModal();\r\n\r\n const close = React.useCallback(() => {\r\n onClose();\r\n currentFormDispatcher.emit('form', undefined);\r\n setState((currentState) => {\r\n return { ...currentState, ...initialState };\r\n });\r\n configuration.current?.modalConfiguration?.onClose?.();\r\n\r\n validationsStore.unregisterForm(apiaApiForm);\r\n }, [onClose, configuration]);\r\n\r\n const modalRef = React.useRef<HTMLDivElement>(null);\r\n\r\n React.useEffect(() => {\r\n const elements = modalRef.current?.querySelectorAll(\r\n 'a,input,textarea,button',\r\n );\r\n if (elements?.length === 1)\r\n void focus.on(([...elements] as HTMLElement[])[0]);\r\n });\r\n\r\n const setError = React.useCallback(\r\n (notification: Parameters<typeof notify>[0]) => {\r\n notify({ ...notification });\r\n },\r\n [],\r\n );\r\n\r\n const initialFocusGetter = React.useCallback((ref: HTMLElement) => {\r\n return ref?.querySelector(focusSelector) as HTMLElement;\r\n }, []);\r\n\r\n const defaultModalProps = React.useMemo(\r\n (): TModal => ({\r\n onClose: close,\r\n id: apiaApiForm,\r\n title:\r\n configuration.current?.modalConfiguration?.modalTitle ??\r\n currentForm?.form.title,\r\n size: 'md-fixed',\r\n shouldCloseOnEsc: !state.disabled,\r\n shouldCloseOnOverlayClick: !state.disabled,\r\n initialFocusGetter,\r\n }),\r\n [\r\n close,\r\n configuration,\r\n currentForm?.form.title,\r\n initialFocusGetter,\r\n state.disabled,\r\n ],\r\n );\r\n\r\n const getModalProps = React.useCallback(\r\n (innerHandler: TApiaApiMethodHandler) => {\r\n if (innerHandler.setModalProps) {\r\n const overrideProps = innerHandler.setModalProps?.(\r\n {\r\n methodsPath: innerHandler.configuration?.methodsPath,\r\n modalConfiguration: innerHandler.configuration?.modalConfiguration,\r\n },\r\n innerHandler.formDefinition,\r\n );\r\n if (overrideProps) {\r\n const currentOnClose = () => {\r\n overrideProps?.onClose?.();\r\n defaultModalProps.onClose?.();\r\n };\r\n const currentOnExited = () => {\r\n overrideProps?.onExited?.();\r\n modalHookProps?.onExited?.();\r\n };\r\n return {\r\n ...defaultModalProps,\r\n ...overrideProps,\r\n ...modalHookProps,\r\n onClose: currentOnClose,\r\n onExited: currentOnExited,\r\n };\r\n }\r\n }\r\n return { ...defaultModalProps, ...modalHookProps };\r\n },\r\n [defaultModalProps, modalHookProps],\r\n );\r\n\r\n const getHandler = React.useCallback(() => {\r\n const newHandler: TApiaApiMethodHandler = {\r\n alert,\r\n close,\r\n configuration: configuration.current,\r\n formDefinition: currentForm as TApiaLoad,\r\n reset: () => {\r\n return setState((currentState) => {\r\n return {\r\n ...currentState,\r\n ...initialState,\r\n };\r\n });\r\n },\r\n setError,\r\n setMessage: (message) => {\r\n if (configuration.current?.modalConfiguration?.onMessage)\r\n configuration.current.modalConfiguration.onMessage(message);\r\n },\r\n setState,\r\n state,\r\n setValue,\r\n };\r\n return newHandler;\r\n }, [close, configuration, currentForm, setError, state, setValue]);\r\n\r\n const handler = getHandler();\r\n const modalProps = getModalProps(handler);\r\n\r\n const handleAction = React.useCallback(\r\n async (action: TModify<TApiaAction, { param: string[] }>) => {\r\n const innerHandler = getHandler();\r\n if (action.toDo === 'ajaxHiddeAll') {\r\n close();\r\n }\r\n if (action.toDo === 'functionTimedCall') {\r\n const method = await getFunction(\r\n arrayOrArray(action.param)[1],\r\n innerHandler,\r\n );\r\n\r\n if (method) {\r\n /*\r\n * Aquí el timeout se utiliza debido a que Apia lo establece de esa\r\n * forma,\r\n * Existe un retorno de Apia llamado functionTimedCall que\r\n * espera que una función se ejecute luego de un timeout, y\r\n * yo solamente respeté dicho comportamiento.\r\n */\r\n setTimeout(\r\n () =>\r\n method({\r\n currentUrl: innerHandler.formDefinition?.form.action ?? 'noUrl',\r\n }),\r\n Number(action.param[0]),\r\n );\r\n }\r\n }\r\n },\r\n [close, getHandler],\r\n );\r\n\r\n const handleFunction = React.useCallback(\r\n async ({ name, props: { messages, attributes, currentUrl } }: TMethod) => {\r\n const innerHandler = getHandler();\r\n const method = await getFunction(`${name}`, innerHandler);\r\n if (method) {\r\n method({ messages, attributes, currentUrl });\r\n }\r\n },\r\n [getHandler],\r\n );\r\n\r\n const handleMessage = React.useCallback(\r\n (ev: TMessage) => {\r\n const innerHandler = getHandler();\r\n notify({\r\n message: ev.predicate,\r\n type: 'warning',\r\n onClose: innerHandler.configuration?.modalConfiguration?.onMessageClose,\r\n });\r\n const onMessage =\r\n innerHandler.configuration?.modalConfiguration?.onMessage;\r\n if (onMessage) {\r\n onMessage(ev);\r\n }\r\n },\r\n [getHandler],\r\n );\r\n\r\n React.useEffect(() => {\r\n const u1 = ApiaApiMessenger.on('message', handleMessage);\r\n const u2 = FunctionsDispatcher.on('method', handleFunction);\r\n const u3 = ApiaActions.on('action', handleAction);\r\n\r\n return () => {\r\n u1();\r\n u2();\r\n u3();\r\n };\r\n }, [handleAction, handleFunction, handleMessage, state.windowIndex]);\r\n\r\n React.useEffect(() => {\r\n if (currentForm) {\r\n show();\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [currentForm]);\r\n\r\n const formRef = React.useCallback(\r\n async (el: HTMLElement) => {\r\n if (el && currentForm?.form.onLoad) {\r\n const method = await getFunction(\r\n `${currentForm?.form.onLoad}`,\r\n getHandler(),\r\n );\r\n if (method) {\r\n method();\r\n }\r\n }\r\n },\r\n [currentForm?.form.onLoad, getHandler],\r\n );\r\n\r\n return (\r\n <ApiaApiContext id={apiaApiForm}>\r\n <Modal {...modalProps} ref={modalRef}>\r\n {currentForm && (\r\n <Box {...getVariant('layout.common.modals.apiaApi')}>\r\n <Form\r\n name={apiaApiForm}\r\n unregisterOnUnmount\r\n avoidFieldsOverride\r\n className=\"handler__form\"\r\n >\r\n <ApiaApiFieldsContainer definition={currentForm} {...handler} />\r\n {state.isMultipart && state.progress > 0 && (\r\n <Box className=\"progressBox\">\r\n <ProgressBar\r\n id=\"ApiaApiHandler progress\"\r\n progress={state.progress}\r\n loading\r\n />\r\n </Box>\r\n )}\r\n <ApiaApiButtonsContainer definition={currentForm} {...handler} />\r\n <Box ref={formRef} sx={{ display: 'none' }} />\r\n </Form>\r\n </Box>\r\n )}\r\n </Modal>\r\n </ApiaApiContext>\r\n );\r\n};\r\n\r\nexport const ApiaApiHandler = React.memo(ApiaApiHandlerNonMemoized);\r\n"],"names":["currentFormDispatcher","currentForm"],"mappings":";;;;;;;;;;;;AA6CA,MAAM,gBAAA,GAAmB,IAAK,cAAc,YAEzC,CAAA;AAAC,CAAG,EAAA,CAAA;AACP,MAAM,mBAAA,GAAsB,IAAK,cAAc,YAE5C,CAAA;AAAC,CAAG,EAAA,CAAA;AA4BA,MAAM,WAAc,GAAA,cAAA;AAI3B,MAAM,UAAgD,EAAC,CAAA;AAMjC,eAAA,WAAA,CACpB,MACA,OAC2C,EAAA;AAC3C,EAAO,OAAA,IAAI,OAAQ,CAAA,CAAC,OAAY,KAAA;AAC9B,IAAI,IAAA;AACF,MAAA,MAAM,+BACJ,GAAA,qCAAA,CAAA;AACF,MAAM,MAAA,KAAA,GAAQ,IAAK,CAAA,KAAA,CAAM,+BAA+B,CAAA,CAAA;AACxD,MAAA,IAAI,KAAO,EAAA;AACT,QAAM,MAAA,YAAA,GAAe,MAAM,CAAC,CAAA,CAAA;AAC5B,QAAM,MAAA,UAAA,GAAa,MAAM,CAAC,CAAA,CAAA;AAC1B,QAAA,MAAM,IAAe,GAAA;AAAA,UACnB,GAAI,OAAA,CAAQ,aAAe,EAAA,WAAA,EACvB,MAAM,GAAG,CAAA,CACV,MAAO,CAAA,CAAC,OAAY,KAAA,CAAC,CAAC,OAAO,KAAK,EAAC;AAAA,UACtC,YAAA;AAAA,SACF,CAAE,KAAK,GAAG,CAAA,CAAA;AACV,QAAM,MAAA,qBAAA,GAAwB,CAAC,MAEzB,KAAA;AACJ,UAAI,IAAA,OAAO,MAAQ,EAAA,OAAA,EAAS,OAAY,KAAA,UAA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