@medusajs/dashboard 2.12.3-snapshot-20251216185234 → 2.12.3
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/add-locales-GGNZCABB.mjs +81 -0
- package/dist/{api-key-management-detail-6RCDH73M.mjs → api-key-management-detail-FRUN2KFK.mjs} +1 -1
- package/dist/app.css +19 -0
- package/dist/app.js +795 -680
- package/dist/app.mjs +2 -2
- package/dist/{campaign-detail-5Q4BYCPX.mjs → campaign-detail-HM3GQJLQ.mjs} +1 -1
- package/dist/{categories-metadata-J7M3XWI7.mjs → categories-metadata-WKL3MGD7.mjs} +1 -1
- package/dist/{category-detail-S5IPXMHX.mjs → category-detail-UTWWDKFP.mjs} +2 -2
- package/dist/{category-products-KPW6BA5J.mjs → category-products-XXBTCXFF.mjs} +2 -2
- package/dist/{chunk-OL24RDYM.mjs → chunk-5F427YCP.mjs} +2 -2
- package/dist/{chunk-MJDHVDOW.mjs → chunk-5ISRTMYH.mjs} +1 -1
- package/dist/{chunk-ST4P6BQN.mjs → chunk-DQUXK4WW.mjs} +1 -1
- package/dist/{chunk-YYOPBKME.mjs → chunk-DTCIBQO2.mjs} +1 -1
- package/dist/{chunk-LZFWCKOF.mjs → chunk-FKNW5MLZ.mjs} +21 -4
- package/dist/{chunk-GRZSG4EP.mjs → chunk-GLBHPDR4.mjs} +21 -16
- package/dist/{chunk-WYATCUOM.mjs → chunk-HNJ65IND.mjs} +1 -1
- package/dist/{store-add-locales-VJ4RJ7UI.mjs → chunk-IKTGFXWR.mjs} +2 -67
- package/dist/{chunk-DBXWB3RF.mjs → chunk-KSDXSKJ7.mjs} +1 -1
- package/dist/{chunk-OL6MEUKW.mjs → chunk-LWYKUORZ.mjs} +108 -105
- package/dist/{chunk-PHLCT2HA.mjs → chunk-OK6NZN2A.mjs} +1 -1
- package/dist/{chunk-ZMG5B4FG.mjs → chunk-SG2JZPTG.mjs} +1 -1
- package/dist/{chunk-CVHJAKLQ.mjs → chunk-UMCJYHAD.mjs} +1 -1
- package/dist/{collection-add-products-FU2BS3D3.mjs → collection-add-products-42F7H77E.mjs} +2 -2
- package/dist/{collection-detail-VJE7XHLV.mjs → collection-detail-PXIS3G64.mjs} +2 -2
- package/dist/{collection-list-IGA6SCNF.mjs → collection-list-O74CGY24.mjs} +2 -2
- package/dist/{collection-metadata-QK7MI3D2.mjs → collection-metadata-U6FMA4IC.mjs} +1 -1
- package/dist/{customer-detail-MOV2T3LF.mjs → customer-detail-OMTFJ6CE.mjs} +1 -1
- package/dist/{customer-group-detail-6T7OXGQD.mjs → customer-group-detail-ADK3M5LG.mjs} +1 -1
- package/dist/{customer-group-list-AJEAF5D2.mjs → customer-group-list-7ZRQ2HWU.mjs} +1 -1
- package/dist/{customers-add-customer-group-QVTVSQYM.mjs → customers-add-customer-group-5U27WHJB.mjs} +1 -1
- package/dist/{edit-rules-SMVRTCUP.mjs → edit-rules-BM2ERGVJ.mjs} +1 -1
- package/dist/en.json +1 -2
- package/dist/{inventory-create-BK52VALF.mjs → inventory-create-7MA7B5N2.mjs} +2 -2
- package/dist/{inventory-detail-ZPSEMYI2.mjs → inventory-detail-B4PRHZK3.mjs} +1 -1
- package/dist/{inventory-metadata-FNEJ3RAT.mjs → inventory-metadata-C7MJ3GY5.mjs} +1 -1
- package/dist/{inventory-stock-6WYWLWJ7.mjs → inventory-stock-WVTYPJTX.mjs} +3 -3
- package/dist/{location-detail-N3GUZSY7.mjs → location-detail-KO6EBDK5.mjs} +1 -1
- package/dist/{location-fulfillment-providers-7ZUJAGNY.mjs → location-fulfillment-providers-IORBE3E3.mjs} +2 -2
- package/dist/{location-service-zone-shipping-option-create-CNRWYZQC.mjs → location-service-zone-shipping-option-create-2R3ZFLVK.mjs} +3 -3
- package/dist/{location-service-zone-shipping-option-pricing-OGWI7VPT.mjs → location-service-zone-shipping-option-pricing-5HN2Z5RB.mjs} +2 -2
- package/dist/{login-VNOLI5YG.mjs → login-XKB6OR7I.mjs} +1 -1
- package/dist/{order-create-claim-SCDJGM46.mjs → order-create-claim-NKCOGF4A.mjs} +1 -1
- package/dist/{order-create-edit-2WALBPXS.mjs → order-create-edit-UNQYXGLL.mjs} +1 -1
- package/dist/{order-create-exchange-LQU4YN7F.mjs → order-create-exchange-WI7OA2WO.mjs} +1 -1
- package/dist/{order-create-fulfillment-OWUVTZXW.mjs → order-create-fulfillment-2LJTEWDY.mjs} +1 -1
- package/dist/{order-create-refund-Q6HQY42R.mjs → order-create-refund-7K6UJXGP.mjs} +1 -1
- package/dist/{order-create-shipment-WAGGEPRW.mjs → order-create-shipment-ZTDLLUBY.mjs} +1 -1
- package/dist/{order-detail-PVPGEWGY.mjs → order-detail-JTRUMRLO.mjs} +1 -1
- package/dist/{order-edit-billing-address-UM76J4KX.mjs → order-edit-billing-address-YHYNVLOE.mjs} +1 -1
- package/dist/{order-edit-email-CL3KNOCM.mjs → order-edit-email-TCQPEVZY.mjs} +1 -1
- package/dist/{order-edit-shipping-address-PIESTGVL.mjs → order-edit-shipping-address-CFSYQLKD.mjs} +1 -1
- package/dist/{order-export-LE363ZLB.mjs → order-export-G4SBNEJ7.mjs} +1 -1
- package/dist/{order-metadata-FHBB7MTG.mjs → order-metadata-KGPB37VL.mjs} +1 -1
- package/dist/{order-receive-return-PRVKP6J2.mjs → order-receive-return-JER24SEV.mjs} +1 -1
- package/dist/{order-request-transfer-XSAGRUMT.mjs → order-request-transfer-3FBUYZNT.mjs} +1 -1
- package/dist/{price-list-create-K5JEZT57.mjs → price-list-create-CXZCFFTP.mjs} +4 -4
- package/dist/{price-list-detail-Q5VG5VGW.mjs → price-list-detail-XOMU6U5J.mjs} +2 -2
- package/dist/{price-list-prices-add-2MQ226U4.mjs → price-list-prices-add-SDX5CQME.mjs} +4 -4
- package/dist/{price-list-prices-edit-OJZLV7OS.mjs → price-list-prices-edit-EKB6NI5D.mjs} +2 -2
- package/dist/{product-attributes-YF4TZOIO.mjs → product-attributes-STD47BGC.mjs} +2 -2
- package/dist/{product-create-KJML2332.mjs → product-create-LVGWVQAT.mjs} +3 -3
- package/dist/{product-create-variant-5EBCLM54.mjs → product-create-variant-OTJKT6WI.mjs} +2 -2
- package/dist/{product-detail-QG72542C.mjs → product-detail-OYVHJH3D.mjs} +2 -2
- package/dist/{product-edit-DZZR775Q.mjs → product-edit-3SIUUIW4.mjs} +2 -2
- package/dist/{product-export-5AD7NELI.mjs → product-export-57UUAGXF.mjs} +2 -2
- package/dist/{product-image-variants-edit-M6QF2RLE.mjs → product-image-variants-edit-2BW5BJON.mjs} +1 -1
- package/dist/{product-import-V3KQN4TV.mjs → product-import-6EM4VUXP.mjs} +1 -1
- package/dist/{product-list-EUWZIFTM.mjs → product-list-5V5GEH5K.mjs} +2 -2
- package/dist/{product-metadata-GL2MVPDI.mjs → product-metadata-JZLHBLZQ.mjs} +1 -1
- package/dist/{product-organization-O7RHELMQ.mjs → product-organization-3PQ45C4B.mjs} +2 -2
- package/dist/{product-prices-YWV6MSM6.mjs → product-prices-5ZL2RP7A.mjs} +1 -1
- package/dist/{product-stock-AKEFMK5O.mjs → product-stock-SJJABF6I.mjs} +3 -3
- package/dist/{product-tag-create-PQMDDKWH.mjs → product-tag-create-XXO4AQEC.mjs} +1 -1
- package/dist/{product-tag-detail-I3MBZX7U.mjs → product-tag-detail-BSK64HXL.mjs} +3 -3
- package/dist/{product-tag-edit-K3BBQLJR.mjs → product-tag-edit-ENCGDT7E.mjs} +1 -1
- package/dist/{product-tag-list-JUWSOMB7.mjs → product-tag-list-SLQGCNDZ.mjs} +3 -3
- package/dist/{product-tag-metadata-MJH5LH7E.mjs → product-tag-metadata-EPXHMU2K.mjs} +1 -1
- package/dist/{product-type-detail-RKHT5NBL.mjs → product-type-detail-4CRRU7YK.mjs} +2 -2
- package/dist/{product-type-metadata-CDJDFFGQ.mjs → product-type-metadata-73OKOGPP.mjs} +1 -1
- package/dist/{product-variant-detail-XAYG5CKE.mjs → product-variant-detail-RPHLG4HU.mjs} +1 -1
- package/dist/{product-variant-edit-DEZEY2H2.mjs → product-variant-edit-JF7NN64Y.mjs} +1 -1
- package/dist/{product-variant-metadata-VTZDNWUT.mjs → product-variant-metadata-HU2CXGPO.mjs} +1 -1
- package/dist/{promotion-create-HWFNUQXG.mjs → promotion-create-BHA3FQG2.mjs} +1 -1
- package/dist/{promotion-detail-QC36KXB3.mjs → promotion-detail-F3QSR52W.mjs} +1 -1
- package/dist/{refund-reason-create-YHCDEHGQ.mjs → refund-reason-create-ZA5TKW2Z.mjs} +1 -1
- package/dist/{refund-reason-edit-CZ5QZ2SZ.mjs → refund-reason-edit-N2CRCLKZ.mjs} +1 -1
- package/dist/{refund-reason-list-OJYYEYJE.mjs → refund-reason-list-SE4TMGMT.mjs} +1 -1
- package/dist/{region-metadata-H6XXUQ4S.mjs → region-metadata-O5NZBWXP.mjs} +1 -1
- package/dist/{reservation-detail-LZAQL4XA.mjs → reservation-detail-UFK6XIXE.mjs} +1 -1
- package/dist/{reservation-metadata-5HZSDDOK.mjs → reservation-metadata-AEJEKGLV.mjs} +1 -1
- package/dist/{sales-channel-add-products-F7YV4MO5.mjs → sales-channel-add-products-2LMB7EF5.mjs} +2 -2
- package/dist/{sales-channel-detail-MXIPZCGA.mjs → sales-channel-detail-EUQ4STQI.mjs} +2 -2
- package/dist/{sales-channel-list-RLGL7FM3.mjs → sales-channel-list-JXKGHX4G.mjs} +1 -1
- package/dist/{sales-channel-metadata-M364R4RJ.mjs → sales-channel-metadata-AJMQ5SQ2.mjs} +1 -1
- package/dist/{shipping-option-type-create-C5WUWON7.mjs → shipping-option-type-create-YVVIA2XC.mjs} +1 -1
- package/dist/{shipping-option-type-detail-PENS2K73.mjs → shipping-option-type-detail-ZZW36XLK.mjs} +2 -2
- package/dist/{shipping-option-type-edit-CIU5EHRP.mjs → shipping-option-type-edit-O6F74T3A.mjs} +1 -1
- package/dist/{shipping-option-type-list-DIOX7VG7.mjs → shipping-option-type-list-SPTE7MT6.mjs} +2 -2
- package/dist/{shipping-profile-metadata-75G2NNMA.mjs → shipping-profile-metadata-7WFE55VG.mjs} +1 -1
- package/dist/store-add-locales-GWCGIXHU.mjs +81 -0
- package/dist/{store-detail-JSNPOB2F.mjs → store-detail-YLJLBBZE.mjs} +1 -1
- package/dist/{store-metadata-CYXTVJUE.mjs → store-metadata-BZ57I2E6.mjs} +1 -1
- package/dist/{tax-region-create-DWGL4EUT.mjs → tax-region-create-FGTV7VJL.mjs} +1 -1
- package/dist/{tax-region-detail-2AE2EFI3.mjs → tax-region-detail-PPIMD7OX.mjs} +5 -5
- package/dist/{tax-region-edit-EEVEEU2Q.mjs → tax-region-edit-ELZKA7YH.mjs} +1 -1
- package/dist/{tax-region-province-detail-4ERSEQFF.mjs → tax-region-province-detail-FV2NDT3E.mjs} +5 -5
- package/dist/{tax-region-tax-override-create-PHCGEF7V.mjs → tax-region-tax-override-create-N572MQPZ.mjs} +3 -3
- package/dist/{tax-region-tax-override-edit-SMRPSILC.mjs → tax-region-tax-override-edit-5DCSJW6D.mjs} +4 -4
- package/dist/{translation-list-UF7FLXOW.mjs → translation-list-FK7XYLHX.mjs} +227 -141
- package/dist/{translations-edit-USQJNMAY.mjs → translations-edit-VRXZI5KW.mjs} +224 -253
- package/dist/{user-metadata-2WPJOEJA.mjs → user-metadata-GRJZZ524.mjs} +1 -1
- package/dist/{workflow-execution-detail-H2AKEZJX.mjs → workflow-execution-detail-HXTFWGKG.mjs} +1 -1
- package/package.json +9 -9
- package/src/components/data-grid/hooks/use-data-grid-cell.tsx +1 -0
- package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +1 -0
- package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +22 -4
- package/src/dashboard-app/routes/get-route.map.tsx +4 -0
- package/src/hooks/api/translations.tsx +26 -17
- package/src/i18n/translations/en.json +1 -2
- package/src/i18n/translations/es.json +1 -1
- package/src/routes/translations/add-locales/add-locales.tsx +29 -0
- package/src/routes/translations/add-locales/index.tsx +1 -0
- package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +42 -17
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +5 -1
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +182 -121
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +285 -330
package/dist/app.js
CHANGED
|
@@ -11893,7 +11893,6 @@ var init_en = __esm({
|
|
|
11893
11893
|
manage: "Manage translations",
|
|
11894
11894
|
manageLocales: "Manage locales"
|
|
11895
11895
|
},
|
|
11896
|
-
title: "Translation domains",
|
|
11897
11896
|
subtitle: "Manage translations of your data in Medusa",
|
|
11898
11897
|
list: {
|
|
11899
11898
|
metrics: "{{translated}} of {{total}} fields translated"
|
|
@@ -11917,7 +11916,7 @@ var init_en = __esm({
|
|
|
11917
11916
|
completion: {
|
|
11918
11917
|
heading: "Translated fields",
|
|
11919
11918
|
translated: "Translated",
|
|
11920
|
-
toTranslate: "
|
|
11919
|
+
toTranslate: "Missing",
|
|
11921
11920
|
footer: "Languages"
|
|
11922
11921
|
}
|
|
11923
11922
|
},
|
|
@@ -15149,7 +15148,7 @@ var init_es = __esm({
|
|
|
15149
15148
|
completion: {
|
|
15150
15149
|
heading: "Textos traducidos",
|
|
15151
15150
|
translated: "Traducidos",
|
|
15152
|
-
toTranslate: "
|
|
15151
|
+
toTranslate: "Faltantes",
|
|
15153
15152
|
footer: "Idiomas"
|
|
15154
15153
|
}
|
|
15155
15154
|
},
|
|
@@ -96929,7 +96928,7 @@ var init_tax_rates = __esm({
|
|
|
96929
96928
|
});
|
|
96930
96929
|
|
|
96931
96930
|
// src/hooks/api/translations.tsx
|
|
96932
|
-
var import_react_query43, TRANSLATIONS_QUERY_KEY, translationsQueryKeys, TRANSLATION_SETTINGS_QUERY_KEY, translationSettingsQueryKeys, TRANSLATION_STATISTICS_QUERY_KEY, translationStatisticsQueryKeys, useReferenceTranslations, useBatchTranslations, useTranslationSettings, useTranslationStatistics;
|
|
96931
|
+
var import_react_query43, TRANSLATIONS_QUERY_KEY, translationsQueryKeys, TRANSLATION_SETTINGS_QUERY_KEY, translationSettingsQueryKeys, TRANSLATION_STATISTICS_QUERY_KEY, translationStatisticsQueryKeys, useReferenceTranslations, referenceInvalidationKeysMap, useBatchTranslations, useTranslationSettings, useTranslationStatistics;
|
|
96933
96932
|
var init_translations2 = __esm({
|
|
96934
96933
|
"src/hooks/api/translations.tsx"() {
|
|
96935
96934
|
"use strict";
|
|
@@ -97085,28 +97084,33 @@ var init_translations2 = __esm({
|
|
|
97085
97084
|
const { data, ...rest } = referenceHook();
|
|
97086
97085
|
return { ...data, ...rest };
|
|
97087
97086
|
};
|
|
97087
|
+
referenceInvalidationKeysMap = /* @__PURE__ */ new Map([
|
|
97088
|
+
["product", productsQueryKeys.lists()],
|
|
97089
|
+
["product_variant", productVariantQueryKeys.lists()],
|
|
97090
|
+
["product_category", categoriesQueryKeys.lists()],
|
|
97091
|
+
["product_collection", collectionsQueryKeys.lists()],
|
|
97092
|
+
["product_type", productTypesQueryKeys.lists()],
|
|
97093
|
+
["product_tag", productTagsQueryKeys.lists()]
|
|
97094
|
+
]);
|
|
97088
97095
|
useBatchTranslations = (reference, options) => {
|
|
97089
|
-
const
|
|
97090
|
-
["product", productsQueryKeys.lists()],
|
|
97091
|
-
["product_variant", productVariantQueryKeys.lists()],
|
|
97092
|
-
["product_category", categoriesQueryKeys.lists()],
|
|
97093
|
-
["product_collection", collectionsQueryKeys.lists()],
|
|
97094
|
-
["product_type", productTypesQueryKeys.lists()],
|
|
97095
|
-
["product_tag", productTagsQueryKeys.lists()]
|
|
97096
|
-
]);
|
|
97097
|
-
return (0, import_react_query43.useMutation)({
|
|
97096
|
+
const mutation = (0, import_react_query43.useMutation)({
|
|
97098
97097
|
mutationFn: (payload) => sdk.admin.translation.batch(payload),
|
|
97099
|
-
|
|
97098
|
+
...options
|
|
97099
|
+
});
|
|
97100
|
+
const invalidateQueries = async () => {
|
|
97101
|
+
await Promise.all([
|
|
97100
97102
|
queryClient.invalidateQueries({
|
|
97101
97103
|
queryKey: referenceInvalidationKeysMap.get(reference)
|
|
97102
|
-
})
|
|
97104
|
+
}),
|
|
97103
97105
|
queryClient.invalidateQueries({
|
|
97104
97106
|
queryKey: translationStatisticsQueryKeys.lists()
|
|
97105
|
-
})
|
|
97106
|
-
|
|
97107
|
-
|
|
97108
|
-
|
|
97109
|
-
|
|
97107
|
+
})
|
|
97108
|
+
]);
|
|
97109
|
+
};
|
|
97110
|
+
return {
|
|
97111
|
+
...mutation,
|
|
97112
|
+
invalidateQueries
|
|
97113
|
+
};
|
|
97110
97114
|
};
|
|
97111
97115
|
useTranslationSettings = (query, options) => {
|
|
97112
97116
|
const { data, ...rest } = (0, import_react_query43.useQuery)({
|
|
@@ -114120,6 +114124,7 @@ var init_use_data_grid_cell = __esm({
|
|
|
114120
114124
|
case "number":
|
|
114121
114125
|
return numberCharacterRegex.test(key);
|
|
114122
114126
|
case "text":
|
|
114127
|
+
case "multiline-text":
|
|
114123
114128
|
return textCharacterRegex.test(key);
|
|
114124
114129
|
default:
|
|
114125
114130
|
return false;
|
|
@@ -115270,6 +115275,7 @@ function convertArrayToPrimitive(values, type) {
|
|
|
115270
115275
|
case "boolean":
|
|
115271
115276
|
return values.map(convertToBoolean);
|
|
115272
115277
|
case "text":
|
|
115278
|
+
case "multiline-text":
|
|
115273
115279
|
return values.map(covertToString);
|
|
115274
115280
|
default:
|
|
115275
115281
|
throw new Error(`Unsupported target type "${type}".`);
|
|
@@ -115470,7 +115476,19 @@ var init_use_data_grid_keydown_event = __esm({
|
|
|
115470
115476
|
},
|
|
115471
115477
|
[rangeEnd, matrix, getSelectionValues, setSelectionValues, execute]
|
|
115472
115478
|
);
|
|
115473
|
-
const
|
|
115479
|
+
const handleSpaceKeyText = (0, import_react99.useCallback)(
|
|
115480
|
+
(anchor2) => {
|
|
115481
|
+
const field = matrix.getCellField(anchor2);
|
|
115482
|
+
const input = queryTool?.getInput(anchor2);
|
|
115483
|
+
if (!field || !input) {
|
|
115484
|
+
return;
|
|
115485
|
+
}
|
|
115486
|
+
createSnapshot(anchor2);
|
|
115487
|
+
input.focus();
|
|
115488
|
+
},
|
|
115489
|
+
[matrix, queryTool, createSnapshot]
|
|
115490
|
+
);
|
|
115491
|
+
const handleSpaceKeyNumber = (0, import_react99.useCallback)(
|
|
115474
115492
|
(anchor2) => {
|
|
115475
115493
|
const field = matrix.getCellField(anchor2);
|
|
115476
115494
|
const input = queryTool?.getInput(anchor2);
|
|
@@ -115541,10 +115559,12 @@ var init_use_data_grid_keydown_event = __esm({
|
|
|
115541
115559
|
case "togglable-number":
|
|
115542
115560
|
handleSpaceKeyTogglableNumber(anchor);
|
|
115543
115561
|
break;
|
|
115544
|
-
case "number":
|
|
115545
115562
|
case "text":
|
|
115546
115563
|
case "multiline-text":
|
|
115547
|
-
|
|
115564
|
+
handleSpaceKeyText(anchor);
|
|
115565
|
+
break;
|
|
115566
|
+
case "number":
|
|
115567
|
+
handleSpaceKeyNumber(anchor);
|
|
115548
115568
|
break;
|
|
115549
115569
|
}
|
|
115550
115570
|
},
|
|
@@ -115553,7 +115573,8 @@ var init_use_data_grid_keydown_event = __esm({
|
|
|
115553
115573
|
isEditing,
|
|
115554
115574
|
matrix,
|
|
115555
115575
|
handleSpaceKeyBoolean,
|
|
115556
|
-
|
|
115576
|
+
handleSpaceKeyText,
|
|
115577
|
+
handleSpaceKeyNumber,
|
|
115557
115578
|
handleSpaceKeyTogglableNumber
|
|
115558
115579
|
]
|
|
115559
115580
|
);
|
|
@@ -190726,8 +190747,9 @@ var init_active_locales_section = __esm({
|
|
|
190726
190747
|
}) => {
|
|
190727
190748
|
const { t: t5 } = (0, import_react_i18next483.useTranslation)();
|
|
190728
190749
|
const navigate = (0, import_react_router_dom245.useNavigate)();
|
|
190750
|
+
const [isHovered, setIsHovered] = (0, import_react304.useState)(false);
|
|
190729
190751
|
const handleManageLocales = (0, import_react304.useCallback)(() => {
|
|
190730
|
-
navigate("/settings/
|
|
190752
|
+
navigate("/settings/translations/add-locales");
|
|
190731
190753
|
}, [navigate]);
|
|
190732
190754
|
const renderLocales = (0, import_react304.useCallback)(() => {
|
|
190733
190755
|
const maxLocalesToDetail = 2;
|
|
@@ -190739,16 +190761,31 @@ var init_active_locales_section = __esm({
|
|
|
190739
190761
|
const hasLocales = locales.length > 0;
|
|
190740
190762
|
return /* @__PURE__ */ (0, import_jsx_runtime686.jsxs)(import_ui450.Container, { className: "flex flex-col p-0", children: [
|
|
190741
190763
|
/* @__PURE__ */ (0, import_jsx_runtime686.jsxs)("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
190742
|
-
/* @__PURE__ */ (0, import_jsx_runtime686.jsx)(import_ui450.Heading, { children: t5("translations.activeLocales.heading") }),
|
|
190764
|
+
/* @__PURE__ */ (0, import_jsx_runtime686.jsx)(import_ui450.Heading, { level: "h2", children: t5("translations.activeLocales.heading") }),
|
|
190743
190765
|
/* @__PURE__ */ (0, import_jsx_runtime686.jsx)(import_ui450.IconButton, { variant: "transparent", onClick: handleManageLocales, children: /* @__PURE__ */ (0, import_jsx_runtime686.jsx)(import_icons174.PencilSquare, {}) })
|
|
190744
190766
|
] }),
|
|
190745
|
-
/* @__PURE__ */ (0, import_jsx_runtime686.jsx)("div", { className: "px-1 pb-1", children: hasLocales ? /* @__PURE__ */ (0, import_jsx_runtime686.
|
|
190746
|
-
|
|
190747
|
-
|
|
190748
|
-
|
|
190749
|
-
/* @__PURE__ */ (0, import_jsx_runtime686.jsx)(
|
|
190750
|
-
|
|
190751
|
-
|
|
190767
|
+
/* @__PURE__ */ (0, import_jsx_runtime686.jsx)("div", { className: "px-1 pb-1", children: hasLocales ? /* @__PURE__ */ (0, import_jsx_runtime686.jsx)(
|
|
190768
|
+
import_ui450.Tooltip,
|
|
190769
|
+
{
|
|
190770
|
+
open: isHovered,
|
|
190771
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime686.jsx)("div", { className: "flex flex-col gap-y-1 p-1", children: locales.map((locale) => /* @__PURE__ */ (0, import_jsx_runtime686.jsx)(import_ui450.Text, { size: "small", weight: "plus", children: locale.name }, locale.code)) }),
|
|
190772
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime686.jsxs)(
|
|
190773
|
+
import_ui450.Container,
|
|
190774
|
+
{
|
|
190775
|
+
className: "bg-ui-bg-component border-r-1 flex items-center gap-x-4 px-[19px] py-2",
|
|
190776
|
+
onMouseEnter: () => setIsHovered(true),
|
|
190777
|
+
onMouseLeave: () => setIsHovered(false),
|
|
190778
|
+
children: [
|
|
190779
|
+
/* @__PURE__ */ (0, import_jsx_runtime686.jsx)(IconAvatar, { className: "border-ui-border-base border", children: /* @__PURE__ */ (0, import_jsx_runtime686.jsx)(import_icons174.Language, {}) }),
|
|
190780
|
+
/* @__PURE__ */ (0, import_jsx_runtime686.jsxs)("div", { className: "flex flex-col", children: [
|
|
190781
|
+
/* @__PURE__ */ (0, import_jsx_runtime686.jsx)(import_ui450.Text, { size: "small", weight: "plus", children: t5("translations.activeLocales.subtitle") }),
|
|
190782
|
+
/* @__PURE__ */ (0, import_jsx_runtime686.jsx)(import_ui450.Text, { className: "text-ui-fg-subtle", size: "small", children: renderLocales() })
|
|
190783
|
+
] })
|
|
190784
|
+
]
|
|
190785
|
+
}
|
|
190786
|
+
)
|
|
190787
|
+
}
|
|
190788
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime686.jsx)(import_ui450.InlineTip, { label: "Tip", children: t5("translations.activeLocales.noLocalesTip") }) })
|
|
190752
190789
|
] });
|
|
190753
190790
|
};
|
|
190754
190791
|
}
|
|
@@ -190782,7 +190819,15 @@ var init_translation_list_section = __esm({
|
|
|
190782
190819
|
import_react_router_dom246.Link,
|
|
190783
190820
|
{
|
|
190784
190821
|
to: `/settings/translations/edit?reference=${entity.reference}`,
|
|
190785
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime687.jsx)(
|
|
190822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime687.jsx)(
|
|
190823
|
+
import_ui451.Button,
|
|
190824
|
+
{
|
|
190825
|
+
variant: "secondary",
|
|
190826
|
+
size: "small",
|
|
190827
|
+
disabled: !hasLocales || !entity.totalCount,
|
|
190828
|
+
children: "Edit"
|
|
190829
|
+
}
|
|
190830
|
+
)
|
|
190786
190831
|
}
|
|
190787
190832
|
)
|
|
190788
190833
|
]
|
|
@@ -190850,160 +190895,215 @@ var init_translations_completion_section = __esm({
|
|
|
190850
190895
|
() => Math.max(...localeStats.map((s) => s.total), 1),
|
|
190851
190896
|
[localeStats]
|
|
190852
190897
|
);
|
|
190853
|
-
|
|
190854
|
-
|
|
190855
|
-
|
|
190856
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(
|
|
190857
|
-
|
|
190858
|
-
" ",
|
|
190859
|
-
|
|
190860
|
-
|
|
190861
|
-
|
|
190862
|
-
|
|
190863
|
-
|
|
190864
|
-
|
|
190865
|
-
|
|
190866
|
-
|
|
190867
|
-
|
|
190868
|
-
|
|
190869
|
-
|
|
190870
|
-
|
|
190871
|
-
|
|
190898
|
+
const localeStatsCount = (0, import_react305.useMemo)(() => localeStats.length, [localeStats]);
|
|
190899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(import_ui452.Container, { className: "p-0", children: [
|
|
190900
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex flex-col gap-y-4 px-6 py-4", children: [
|
|
190901
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
190902
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_ui452.Heading, { level: "h2", children: t5("translations.completion.heading") }),
|
|
190903
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(import_ui452.Text, { size: "small", weight: "plus", className: "text-ui-fg-subtle", children: [
|
|
190904
|
+
translatedCount.toLocaleString(),
|
|
190905
|
+
" ",
|
|
190906
|
+
t5("general.of"),
|
|
190907
|
+
" ",
|
|
190908
|
+
totalCount.toLocaleString()
|
|
190909
|
+
] })
|
|
190910
|
+
] }),
|
|
190911
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)("div", { className: "flex h-3 w-full overflow-hidden", children: percentage > 0 ? /* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(import_jsx_runtime688.Fragment, { children: [
|
|
190912
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190913
|
+
"div",
|
|
190914
|
+
{
|
|
190915
|
+
className: "mr-0.5 h-full rounded-sm transition-all",
|
|
190916
|
+
style: {
|
|
190917
|
+
width: `${percentage}%`,
|
|
190918
|
+
backgroundColor: "var(--tag-blue-icon)",
|
|
190919
|
+
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)"
|
|
190920
|
+
}
|
|
190872
190921
|
}
|
|
190873
|
-
|
|
190874
|
-
|
|
190875
|
-
|
|
190922
|
+
),
|
|
190923
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190924
|
+
"div",
|
|
190925
|
+
{
|
|
190926
|
+
className: "h-full flex-1 rounded-sm",
|
|
190927
|
+
style: {
|
|
190928
|
+
backgroundColor: "var(--tag-blue-border)",
|
|
190929
|
+
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)"
|
|
190930
|
+
}
|
|
190931
|
+
}
|
|
190932
|
+
)
|
|
190933
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190876
190934
|
"div",
|
|
190877
190935
|
{
|
|
190878
|
-
className: "h-full
|
|
190936
|
+
className: "h-full w-full rounded-sm",
|
|
190879
190937
|
style: {
|
|
190880
|
-
backgroundColor: "var(--
|
|
190881
|
-
|
|
190938
|
+
backgroundColor: "var(--tag-blue-border)",
|
|
190939
|
+
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)"
|
|
190882
190940
|
}
|
|
190883
190941
|
}
|
|
190884
|
-
)
|
|
190885
|
-
|
|
190886
|
-
|
|
190887
|
-
|
|
190888
|
-
|
|
190889
|
-
|
|
190890
|
-
|
|
190891
|
-
|
|
190892
|
-
|
|
190893
|
-
|
|
190894
|
-
|
|
190895
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
190896
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(import_ui452.Text, { size: "small", weight: "plus", className: "text-ui-fg-subtle", children: [
|
|
190897
|
-
percentage.toFixed(1),
|
|
190898
|
-
"%"
|
|
190899
|
-
] }),
|
|
190900
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(import_ui452.Text, { size: "small", weight: "plus", className: "text-ui-fg-subtle", children: [
|
|
190901
|
-
remaining.toLocaleString(),
|
|
190902
|
-
" ",
|
|
190903
|
-
t5("general.remaining").toLowerCase()
|
|
190942
|
+
) }),
|
|
190943
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
190944
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(import_ui452.Text, { size: "small", weight: "plus", className: "text-ui-fg-subtle", children: [
|
|
190945
|
+
percentage.toFixed(1),
|
|
190946
|
+
"%"
|
|
190947
|
+
] }),
|
|
190948
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(import_ui452.Text, { size: "small", weight: "plus", className: "text-ui-fg-subtle", children: [
|
|
190949
|
+
remaining.toLocaleString(),
|
|
190950
|
+
" ",
|
|
190951
|
+
t5("general.remaining").toLowerCase()
|
|
190952
|
+
] })
|
|
190904
190953
|
] })
|
|
190905
190954
|
] }),
|
|
190906
|
-
localeStats.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(
|
|
190907
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190908
|
-
|
|
190909
|
-
|
|
190910
|
-
|
|
190911
|
-
|
|
190912
|
-
|
|
190913
|
-
|
|
190914
|
-
|
|
190915
|
-
|
|
190916
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex
|
|
190917
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.
|
|
190955
|
+
localeStats.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(import_jsx_runtime688.Fragment, { children: [
|
|
190956
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_ui452.Divider, { variant: "dashed" }),
|
|
190957
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex flex-col gap-y-3 px-6 pb-6 pt-4", children: [
|
|
190958
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)("div", { className: "flex h-32 w-full items-end gap-1", children: localeStats.map((locale) => {
|
|
190959
|
+
const heightPercent = locale.total / maxTotal * 100;
|
|
190960
|
+
const translatedPercent = locale.total > 0 ? locale.translated / locale.total * 100 : 0;
|
|
190961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190962
|
+
import_ui452.Tooltip,
|
|
190963
|
+
{
|
|
190964
|
+
open: hoveredLocale === locale.code,
|
|
190965
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex min-w-[150px] flex-col gap-y-1 p-1", children: [
|
|
190966
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_ui452.Text, { size: "small", weight: "plus", children: locale.name }),
|
|
190967
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
190968
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex items-center gap-x-2", children: [
|
|
190969
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190970
|
+
"div",
|
|
190971
|
+
{
|
|
190972
|
+
className: "h-2 w-2 rounded-full",
|
|
190973
|
+
style: {
|
|
190974
|
+
backgroundColor: "var(--tag-blue-icon)",
|
|
190975
|
+
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)"
|
|
190976
|
+
}
|
|
190977
|
+
}
|
|
190978
|
+
),
|
|
190979
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190980
|
+
import_ui452.Text,
|
|
190981
|
+
{
|
|
190982
|
+
size: "small",
|
|
190983
|
+
weight: "plus",
|
|
190984
|
+
className: "text-ui-fg-base",
|
|
190985
|
+
children: t5("translations.completion.translated")
|
|
190986
|
+
}
|
|
190987
|
+
)
|
|
190988
|
+
] }),
|
|
190918
190989
|
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190919
|
-
|
|
190990
|
+
import_ui452.Text,
|
|
190920
190991
|
{
|
|
190921
|
-
|
|
190922
|
-
|
|
190992
|
+
size: "small",
|
|
190993
|
+
weight: "plus",
|
|
190994
|
+
className: "text-ui-fg-base",
|
|
190995
|
+
children: locale.translated
|
|
190923
190996
|
}
|
|
190924
|
-
)
|
|
190997
|
+
)
|
|
190998
|
+
] }),
|
|
190999
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
191000
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsxs)("div", { className: "flex items-center gap-x-2", children: [
|
|
191001
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
191002
|
+
"div",
|
|
191003
|
+
{
|
|
191004
|
+
className: "h-2 w-2 rounded-full",
|
|
191005
|
+
style: {
|
|
191006
|
+
backgroundColor: "var(--tag-blue-border)",
|
|
191007
|
+
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)"
|
|
191008
|
+
}
|
|
191009
|
+
}
|
|
191010
|
+
),
|
|
191011
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
191012
|
+
import_ui452.Text,
|
|
191013
|
+
{
|
|
191014
|
+
size: "small",
|
|
191015
|
+
weight: "plus",
|
|
191016
|
+
className: "text-ui-fg-base",
|
|
191017
|
+
children: t5("translations.completion.toTranslate")
|
|
191018
|
+
}
|
|
191019
|
+
)
|
|
191020
|
+
] }),
|
|
190925
191021
|
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190926
191022
|
import_ui452.Text,
|
|
190927
191023
|
{
|
|
190928
191024
|
size: "small",
|
|
190929
191025
|
weight: "plus",
|
|
190930
|
-
className: "text-ui-fg-
|
|
190931
|
-
children:
|
|
191026
|
+
className: "text-ui-fg-base",
|
|
191027
|
+
children: locale.toTranslate
|
|
190932
191028
|
}
|
|
190933
191029
|
)
|
|
190934
|
-
] })
|
|
190935
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_ui452.Text, { size: "small", weight: "plus", children: locale.translated })
|
|
191030
|
+
] })
|
|
190936
191031
|
] }),
|
|
190937
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.
|
|
190938
|
-
|
|
190939
|
-
|
|
190940
|
-
|
|
190941
|
-
|
|
190942
|
-
|
|
190943
|
-
|
|
190944
|
-
|
|
190945
|
-
}
|
|
190946
|
-
}
|
|
190947
|
-
),
|
|
190948
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190949
|
-
import_ui452.Text,
|
|
190950
|
-
{
|
|
190951
|
-
size: "small",
|
|
190952
|
-
weight: "plus",
|
|
190953
|
-
className: "text-ui-fg-subtle",
|
|
190954
|
-
children: t5("translations.completion.toTranslate")
|
|
190955
|
-
}
|
|
190956
|
-
),
|
|
190957
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(import_ui452.Text, { size: "small", weight: "plus", children: locale.toTranslate })
|
|
190958
|
-
] })
|
|
190959
|
-
] }),
|
|
190960
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(
|
|
190961
|
-
"div",
|
|
190962
|
-
{
|
|
190963
|
-
className: "flex min-w-2 flex-1 cursor-pointer flex-col justify-end overflow-hidden rounded-t-sm transition-opacity",
|
|
190964
|
-
style: { height: `${heightPercent}%` },
|
|
190965
|
-
onMouseEnter: () => setHoveredLocale(locale.code),
|
|
190966
|
-
onMouseLeave: () => setHoveredLocale(null),
|
|
190967
|
-
children: [
|
|
190968
|
-
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
191032
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)("div", { className: "flex h-full flex-1 items-end justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
191033
|
+
"div",
|
|
191034
|
+
{
|
|
191035
|
+
className: "flex w-full min-w-2 max-w-[96px] flex-col justify-end overflow-hidden rounded-t-sm transition-opacity",
|
|
191036
|
+
style: { height: `${heightPercent}%` },
|
|
191037
|
+
onMouseEnter: () => setHoveredLocale(locale.code),
|
|
191038
|
+
onMouseLeave: () => setHoveredLocale(null),
|
|
191039
|
+
children: translatedPercent === 0 ? /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
190969
191040
|
"div",
|
|
190970
191041
|
{
|
|
190971
|
-
className: "w-full rounded-
|
|
191042
|
+
className: "w-full rounded-sm",
|
|
190972
191043
|
style: {
|
|
190973
|
-
height:
|
|
190974
|
-
backgroundColor: "var(--bg
|
|
190975
|
-
|
|
190976
|
-
minHeight: locale.toTranslate > 0 ? "2px" : "0"
|
|
191044
|
+
height: "100%",
|
|
191045
|
+
backgroundColor: "var(--tag-neutral-bg)",
|
|
191046
|
+
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)"
|
|
190977
191047
|
}
|
|
190978
191048
|
}
|
|
190979
|
-
),
|
|
190980
|
-
|
|
190981
|
-
|
|
190982
|
-
|
|
190983
|
-
|
|
190984
|
-
|
|
190985
|
-
|
|
190986
|
-
|
|
190987
|
-
|
|
191049
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime688.jsxs)(import_jsx_runtime688.Fragment, { children: [
|
|
191050
|
+
/* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
191051
|
+
"div",
|
|
191052
|
+
{
|
|
191053
|
+
className: "w-full rounded-sm",
|
|
191054
|
+
style: {
|
|
191055
|
+
height: `${100 - translatedPercent}%`,
|
|
191056
|
+
backgroundColor: "var(--tag-blue-border)",
|
|
191057
|
+
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
|
|
191058
|
+
minHeight: locale.toTranslate > 0 ? "2px" : "0"
|
|
191059
|
+
}
|
|
190988
191060
|
}
|
|
190989
|
-
|
|
190990
|
-
|
|
190991
|
-
|
|
191061
|
+
),
|
|
191062
|
+
translatedPercent > 0 && /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
191063
|
+
"div",
|
|
191064
|
+
{
|
|
191065
|
+
className: "mt-0.5 w-full rounded-sm",
|
|
191066
|
+
style: {
|
|
191067
|
+
height: `${translatedPercent}%`,
|
|
191068
|
+
backgroundColor: "var(--tag-blue-icon)",
|
|
191069
|
+
boxShadow: "inset 0 0 0 0.5px var(--alpha-250)",
|
|
191070
|
+
minHeight: locale.translated > 0 ? "2px" : "0"
|
|
191071
|
+
}
|
|
191072
|
+
}
|
|
191073
|
+
)
|
|
191074
|
+
] })
|
|
191075
|
+
}
|
|
191076
|
+
) })
|
|
191077
|
+
},
|
|
191078
|
+
locale.code
|
|
191079
|
+
);
|
|
191080
|
+
}) }),
|
|
191081
|
+
localeStatsCount < 9 && /* @__PURE__ */ (0, import_jsx_runtime688.jsx)("div", { className: "flex w-full gap-1", children: localeStats.map((locale) => /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
191082
|
+
"div",
|
|
191083
|
+
{
|
|
191084
|
+
className: "flex flex-1 items-center justify-center",
|
|
191085
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
191086
|
+
import_ui452.Text,
|
|
191087
|
+
{
|
|
191088
|
+
size: "xsmall",
|
|
191089
|
+
weight: "plus",
|
|
191090
|
+
className: "text-ui-fg-subtle min-w-2 whitespace-normal break-words text-center leading-tight",
|
|
191091
|
+
children: localeStatsCount < 6 ? locale.name : locale.code
|
|
190992
191092
|
}
|
|
190993
191093
|
)
|
|
190994
191094
|
},
|
|
190995
191095
|
locale.code
|
|
190996
|
-
)
|
|
190997
|
-
|
|
190998
|
-
|
|
190999
|
-
|
|
191000
|
-
|
|
191001
|
-
|
|
191002
|
-
|
|
191003
|
-
|
|
191004
|
-
|
|
191005
|
-
|
|
191006
|
-
)
|
|
191096
|
+
)) }),
|
|
191097
|
+
localeStatsCount > 9 && /* @__PURE__ */ (0, import_jsx_runtime688.jsx)(
|
|
191098
|
+
import_ui452.Text,
|
|
191099
|
+
{
|
|
191100
|
+
weight: "plus",
|
|
191101
|
+
size: "xsmall",
|
|
191102
|
+
className: "text-ui-fg-subtle text-center",
|
|
191103
|
+
children: t5("translations.completion.footer")
|
|
191104
|
+
}
|
|
191105
|
+
)
|
|
191106
|
+
] })
|
|
191007
191107
|
] })
|
|
191008
191108
|
] });
|
|
191009
191109
|
};
|
|
@@ -191146,153 +191246,113 @@ var init_translation_list2 = __esm({
|
|
|
191146
191246
|
function isEntityRow(row) {
|
|
191147
191247
|
return row._type === "entity";
|
|
191148
191248
|
}
|
|
191149
|
-
function
|
|
191150
|
-
const
|
|
191249
|
+
function buildLocaleSnapshot(translations, references, localeCode, translatableFields) {
|
|
191250
|
+
const referenceTranslations = /* @__PURE__ */ new Map();
|
|
191151
191251
|
for (const t5 of translations) {
|
|
191152
|
-
|
|
191153
|
-
|
|
191154
|
-
|
|
191155
|
-
|
|
191156
|
-
|
|
191157
|
-
|
|
191158
|
-
|
|
191159
|
-
|
|
191252
|
+
if (t5.locale_code === localeCode) {
|
|
191253
|
+
referenceTranslations.set(t5.reference_id, t5);
|
|
191254
|
+
}
|
|
191255
|
+
}
|
|
191256
|
+
const entities = {};
|
|
191257
|
+
for (const ref of references) {
|
|
191258
|
+
const existing = referenceTranslations.get(ref.id);
|
|
191259
|
+
const fields = {};
|
|
191260
|
+
for (const fieldName of translatableFields) {
|
|
191261
|
+
fields[fieldName] = existing?.translations?.[fieldName] ?? "";
|
|
191262
|
+
}
|
|
191263
|
+
entities[ref.id] = {
|
|
191264
|
+
id: existing?.id ?? null,
|
|
191265
|
+
fields
|
|
191266
|
+
};
|
|
191267
|
+
}
|
|
191268
|
+
return { localeCode, entities };
|
|
191269
|
+
}
|
|
191270
|
+
function extendSnapshot(snapshot, translations, newReferences, translatableFields) {
|
|
191271
|
+
const referenceTranslations = /* @__PURE__ */ new Map();
|
|
191272
|
+
for (const t5 of translations) {
|
|
191273
|
+
if (t5.locale_code === snapshot.localeCode) {
|
|
191274
|
+
referenceTranslations.set(t5.reference_id, t5);
|
|
191275
|
+
}
|
|
191276
|
+
}
|
|
191277
|
+
const extendedEntities = { ...snapshot.entities };
|
|
191278
|
+
for (const ref of newReferences) {
|
|
191279
|
+
if (!extendedEntities[ref.id]) {
|
|
191280
|
+
const existing = referenceTranslations.get(ref.id);
|
|
191160
191281
|
const fields = {};
|
|
191161
191282
|
for (const fieldName of translatableFields) {
|
|
191162
|
-
|
|
191163
|
-
fields[fieldName] = fieldValue;
|
|
191283
|
+
fields[fieldName] = existing?.translations?.[fieldName] ?? "";
|
|
191164
191284
|
}
|
|
191165
|
-
|
|
191285
|
+
extendedEntities[ref.id] = {
|
|
191166
191286
|
id: existing?.id ?? null,
|
|
191167
|
-
locale_code: locale.locale_code,
|
|
191168
191287
|
fields
|
|
191169
191288
|
};
|
|
191170
191289
|
}
|
|
191171
|
-
entitiesTranslationState[reference.id] = { locales };
|
|
191172
191290
|
}
|
|
191173
|
-
return {
|
|
191174
|
-
entities: entitiesTranslationState
|
|
191175
|
-
};
|
|
191291
|
+
return { ...snapshot, entities: extendedEntities };
|
|
191176
191292
|
}
|
|
191177
|
-
function
|
|
191178
|
-
return
|
|
191179
|
-
_type: "entity",
|
|
191180
|
-
reference_id: reference.id,
|
|
191181
|
-
subRows: translatableFields.map((fieldName) => ({
|
|
191182
|
-
_type: "field",
|
|
191183
|
-
reference_id: reference.id,
|
|
191184
|
-
field_name: fieldName
|
|
191185
|
-
}))
|
|
191186
|
-
}));
|
|
191293
|
+
function snapshotToFormValues(snapshot) {
|
|
191294
|
+
return { entities: snapshot.entities };
|
|
191187
191295
|
}
|
|
191188
|
-
function
|
|
191296
|
+
function computeChanges(currentState, snapshot, entityType, localeCode) {
|
|
191189
191297
|
const payload = {
|
|
191190
191298
|
create: [],
|
|
191191
191299
|
update: [],
|
|
191192
191300
|
delete: []
|
|
191193
191301
|
};
|
|
191194
191302
|
for (const [entityId, entityData] of Object.entries(currentState.entities)) {
|
|
191195
|
-
|
|
191196
|
-
|
|
191197
|
-
)) {
|
|
191198
|
-
const initial = initialState.entities[entityId]?.locales[localeCode];
|
|
191199
|
-
const hasContent = Object.values(localeTranslations.fields).some(
|
|
191200
|
-
(v) => v !== void 0 && v.trim() !== ""
|
|
191201
|
-
);
|
|
191202
|
-
const hadContent = initial && Object.values(initial.fields).some(
|
|
191203
|
-
(v) => v !== void 0 && v.trim() !== ""
|
|
191204
|
-
);
|
|
191205
|
-
if (!localeTranslations.id && hasContent) {
|
|
191206
|
-
payload.create.push({
|
|
191207
|
-
reference_id: entityId,
|
|
191208
|
-
reference: entityType,
|
|
191209
|
-
locale_code: localeTranslations.locale_code,
|
|
191210
|
-
translations: localeTranslations.fields
|
|
191211
|
-
});
|
|
191212
|
-
} else if (localeTranslations.id && hasContent) {
|
|
191213
|
-
const hasChanged = !initial || JSON.stringify(localeTranslations.fields) !== JSON.stringify(initial.fields);
|
|
191214
|
-
if (hasChanged) {
|
|
191215
|
-
payload.update.push({
|
|
191216
|
-
id: localeTranslations.id,
|
|
191217
|
-
translations: localeTranslations.fields
|
|
191218
|
-
});
|
|
191219
|
-
}
|
|
191220
|
-
} else if (localeTranslations.id && !hasContent && hadContent) {
|
|
191221
|
-
payload.delete.push(localeTranslations.id);
|
|
191222
|
-
}
|
|
191223
|
-
}
|
|
191224
|
-
}
|
|
191225
|
-
return payload;
|
|
191226
|
-
}
|
|
191227
|
-
function hasLocaleChanges(currentState, initialState, localeCode) {
|
|
191228
|
-
for (const [entityId, entityData] of Object.entries(currentState.entities)) {
|
|
191229
|
-
const currentLocale = entityData.locales[localeCode];
|
|
191230
|
-
const initialLocale = initialState.entities[entityId]?.locales[localeCode];
|
|
191231
|
-
if (!currentLocale || !initialLocale) {
|
|
191303
|
+
const baseline = snapshot.entities[entityId];
|
|
191304
|
+
if (!baseline) {
|
|
191232
191305
|
continue;
|
|
191233
191306
|
}
|
|
191234
|
-
|
|
191235
|
-
currentLocale.fields
|
|
191236
|
-
)) {
|
|
191237
|
-
const initialValue = initialLocale.fields[fieldName] ?? "";
|
|
191238
|
-
const currentValue = fieldValue ?? "";
|
|
191239
|
-
if (currentValue !== initialValue) {
|
|
191240
|
-
return true;
|
|
191241
|
-
}
|
|
191242
|
-
}
|
|
191243
|
-
}
|
|
191244
|
-
return false;
|
|
191245
|
-
}
|
|
191246
|
-
function transformSingleLocaleToBatchPayload(currentState, initialState, entityType, localeCode) {
|
|
191247
|
-
const payload = {
|
|
191248
|
-
create: [],
|
|
191249
|
-
update: [],
|
|
191250
|
-
delete: []
|
|
191251
|
-
};
|
|
191252
|
-
for (const [entityId, entityData] of Object.entries(currentState.entities)) {
|
|
191253
|
-
const localeTranslations = entityData.locales[localeCode];
|
|
191254
|
-
if (!localeTranslations) continue;
|
|
191255
|
-
const initial = initialState.entities[entityId]?.locales[localeCode];
|
|
191256
|
-
const hasContent = Object.values(localeTranslations.fields).some(
|
|
191307
|
+
const hasContent = Object.values(entityData.fields).some(
|
|
191257
191308
|
(v) => v !== void 0 && v.trim() !== ""
|
|
191258
191309
|
);
|
|
191259
|
-
const hadContent =
|
|
191310
|
+
const hadContent = Object.values(baseline.fields).some(
|
|
191260
191311
|
(v) => v !== void 0 && v.trim() !== ""
|
|
191261
191312
|
);
|
|
191262
|
-
|
|
191313
|
+
const hasChanged = JSON.stringify(entityData.fields) !== JSON.stringify(baseline.fields);
|
|
191314
|
+
if (!entityData.id && hasContent) {
|
|
191263
191315
|
payload.create.push({
|
|
191264
191316
|
reference_id: entityId,
|
|
191265
191317
|
reference: entityType,
|
|
191266
|
-
locale_code:
|
|
191267
|
-
translations:
|
|
191268
|
-
});
|
|
191269
|
-
} else if (
|
|
191270
|
-
|
|
191271
|
-
|
|
191272
|
-
|
|
191273
|
-
|
|
191274
|
-
|
|
191275
|
-
|
|
191276
|
-
}
|
|
191277
|
-
} else if (localeTranslations.id && !hasContent && hadContent) {
|
|
191278
|
-
payload.delete.push(localeTranslations.id);
|
|
191318
|
+
locale_code: localeCode,
|
|
191319
|
+
translations: entityData.fields
|
|
191320
|
+
});
|
|
191321
|
+
} else if (entityData.id && hasContent && hasChanged) {
|
|
191322
|
+
payload.update.push({
|
|
191323
|
+
id: entityData.id,
|
|
191324
|
+
translations: entityData.fields
|
|
191325
|
+
});
|
|
191326
|
+
} else if (entityData.id && !hasContent && hadContent) {
|
|
191327
|
+
payload.delete.push(entityData.id);
|
|
191279
191328
|
}
|
|
191280
191329
|
}
|
|
191281
|
-
|
|
191330
|
+
const hasChanges = payload.create.length > 0 || payload.update.length > 0 || payload.delete.length > 0;
|
|
191331
|
+
return { hasChanges, payload };
|
|
191332
|
+
}
|
|
191333
|
+
function buildTranslationRows(references, translatableFields) {
|
|
191334
|
+
return references.map((reference) => ({
|
|
191335
|
+
_type: "entity",
|
|
191336
|
+
reference_id: reference.id,
|
|
191337
|
+
subRows: translatableFields.map((fieldName) => ({
|
|
191338
|
+
_type: "field",
|
|
191339
|
+
reference_id: reference.id,
|
|
191340
|
+
field_name: fieldName
|
|
191341
|
+
}))
|
|
191342
|
+
}));
|
|
191282
191343
|
}
|
|
191283
191344
|
function useTranslationsGridColumns({
|
|
191284
191345
|
entities,
|
|
191285
|
-
translatableFields,
|
|
191286
191346
|
availableLocales,
|
|
191287
191347
|
selectedLocale,
|
|
191288
191348
|
dynamicColumnWidth
|
|
191289
191349
|
}) {
|
|
191290
191350
|
const { t: t5 } = (0, import_react_i18next487.useTranslation)();
|
|
191291
|
-
|
|
191351
|
+
return (0, import_react307.useMemo)(() => {
|
|
191292
191352
|
const selectedLocaleData = availableLocales.find(
|
|
191293
191353
|
(l) => l.locale_code === selectedLocale
|
|
191294
191354
|
);
|
|
191295
|
-
const
|
|
191355
|
+
const columns = [
|
|
191296
191356
|
columnHelper93.column({
|
|
191297
191357
|
id: "field",
|
|
191298
191358
|
name: "field",
|
|
@@ -191328,9 +191388,7 @@ function useTranslationsGridColumns({
|
|
|
191328
191388
|
if (isEntityRow(row)) {
|
|
191329
191389
|
return /* @__PURE__ */ (0, import_jsx_runtime690.jsx)(DataGrid.ReadonlyCell, { context });
|
|
191330
191390
|
}
|
|
191331
|
-
const entity = entities.find(
|
|
191332
|
-
(entity2) => entity2.id === row.reference_id
|
|
191333
|
-
);
|
|
191391
|
+
const entity = entities.find((e) => e.id === row.reference_id);
|
|
191334
191392
|
if (!entity) {
|
|
191335
191393
|
return null;
|
|
191336
191394
|
}
|
|
@@ -191339,7 +191397,7 @@ function useTranslationsGridColumns({
|
|
|
191339
191397
|
})
|
|
191340
191398
|
];
|
|
191341
191399
|
if (selectedLocaleData) {
|
|
191342
|
-
|
|
191400
|
+
columns.push(
|
|
191343
191401
|
columnHelper93.column({
|
|
191344
191402
|
id: selectedLocaleData.locale_code,
|
|
191345
191403
|
name: selectedLocaleData.locale.name,
|
|
@@ -191357,24 +191415,16 @@ function useTranslationsGridColumns({
|
|
|
191357
191415
|
if (isEntityRow(row)) {
|
|
191358
191416
|
return null;
|
|
191359
191417
|
}
|
|
191360
|
-
return `entities.${row.reference_id}.
|
|
191418
|
+
return `entities.${row.reference_id}.fields.${row.field_name}`;
|
|
191361
191419
|
},
|
|
191362
191420
|
type: "multiline-text"
|
|
191363
191421
|
})
|
|
191364
191422
|
);
|
|
191365
191423
|
}
|
|
191366
|
-
return
|
|
191367
|
-
}, [
|
|
191368
|
-
t5,
|
|
191369
|
-
translatableFields,
|
|
191370
|
-
availableLocales,
|
|
191371
|
-
selectedLocale,
|
|
191372
|
-
entities,
|
|
191373
|
-
dynamicColumnWidth
|
|
191374
|
-
]);
|
|
191375
|
-
return columns;
|
|
191424
|
+
return columns;
|
|
191425
|
+
}, [t5, availableLocales, selectedLocale, entities, dynamicColumnWidth]);
|
|
191376
191426
|
}
|
|
191377
|
-
var import_zod166, import_ui454, import_react307, import_react_hook_form145, import_react_i18next487, import_zod167, import_jsx_runtime690,
|
|
191427
|
+
var import_zod166, import_ui454, import_react307, import_react_hook_form145, import_react_i18next487, import_zod167, import_jsx_runtime690, EntityTranslationsSchema, TranslationsFormSchema, columnHelper93, FIELD_COLUMN_WIDTH, TranslationsEditForm;
|
|
191378
191428
|
var init_translations_edit_form = __esm({
|
|
191379
191429
|
"src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx"() {
|
|
191380
191430
|
"use strict";
|
|
@@ -191389,19 +191439,15 @@ var init_translations_edit_form = __esm({
|
|
|
191389
191439
|
init_keybound_form2();
|
|
191390
191440
|
init_translations2();
|
|
191391
191441
|
import_jsx_runtime690 = require("react/jsx-runtime");
|
|
191392
|
-
|
|
191442
|
+
EntityTranslationsSchema = import_zod167.z.object({
|
|
191393
191443
|
id: import_zod167.z.string().nullish(),
|
|
191394
|
-
locale_code: import_zod167.z.string(),
|
|
191395
191444
|
fields: import_zod167.z.record(import_zod167.z.string().optional())
|
|
191396
191445
|
});
|
|
191397
|
-
EntityTranslationsSchema = import_zod167.z.object({
|
|
191398
|
-
locales: import_zod167.z.record(LocaleTranslationSchema)
|
|
191399
|
-
});
|
|
191400
191446
|
TranslationsFormSchema = import_zod167.z.object({
|
|
191401
191447
|
entities: import_zod167.z.record(EntityTranslationsSchema)
|
|
191402
191448
|
});
|
|
191403
191449
|
columnHelper93 = createDataGridHelper();
|
|
191404
|
-
FIELD_COLUMN_WIDTH =
|
|
191450
|
+
FIELD_COLUMN_WIDTH = 350;
|
|
191405
191451
|
TranslationsEditForm = ({
|
|
191406
191452
|
translations,
|
|
191407
191453
|
references,
|
|
@@ -191438,57 +191484,83 @@ var init_translations_edit_form = __esm({
|
|
|
191438
191484
|
);
|
|
191439
191485
|
const [showUnsavedPrompt, setShowUnsavedPrompt] = (0, import_react307.useState)(false);
|
|
191440
191486
|
const [pendingLocale, setPendingLocale] = (0, import_react307.useState)(null);
|
|
191441
|
-
const
|
|
191442
|
-
const
|
|
191443
|
-
(
|
|
191444
|
-
[referenceCount, translatableFields]
|
|
191445
|
-
);
|
|
191446
|
-
const initialState = (0, import_react307.useRef)(
|
|
191447
|
-
initTranslationsFormState(
|
|
191487
|
+
const [isSwitchingLocale, setIsSwitchingLocale] = (0, import_react307.useState)(false);
|
|
191488
|
+
const snapshotRef = (0, import_react307.useRef)(
|
|
191489
|
+
buildLocaleSnapshot(
|
|
191448
191490
|
translations,
|
|
191449
|
-
|
|
191450
|
-
|
|
191491
|
+
references,
|
|
191492
|
+
selectedLocale,
|
|
191451
191493
|
translatableFields
|
|
191452
191494
|
)
|
|
191453
191495
|
);
|
|
191496
|
+
const knownEntityIdsRef = (0, import_react307.useRef)(
|
|
191497
|
+
new Set(references.map((r) => r.id))
|
|
191498
|
+
);
|
|
191499
|
+
const latestPropsRef = (0, import_react307.useRef)({ translations, references });
|
|
191500
|
+
(0, import_react307.useEffect)(() => {
|
|
191501
|
+
latestPropsRef.current = { translations, references };
|
|
191502
|
+
}, [translations, references]);
|
|
191454
191503
|
const form = (0, import_react_hook_form145.useForm)({
|
|
191455
191504
|
resolver: (0, import_zod166.zodResolver)(TranslationsFormSchema),
|
|
191456
|
-
defaultValues:
|
|
191505
|
+
defaultValues: snapshotToFormValues(snapshotRef.current)
|
|
191457
191506
|
});
|
|
191507
|
+
(0, import_react307.useEffect)(() => {
|
|
191508
|
+
const currentIds = new Set(references.map((r) => r.id));
|
|
191509
|
+
const newReferences = references.filter(
|
|
191510
|
+
(r) => !knownEntityIdsRef.current.has(r.id)
|
|
191511
|
+
);
|
|
191512
|
+
if (newReferences.length === 0) {
|
|
191513
|
+
return;
|
|
191514
|
+
}
|
|
191515
|
+
knownEntityIdsRef.current = currentIds;
|
|
191516
|
+
snapshotRef.current = extendSnapshot(
|
|
191517
|
+
snapshotRef.current,
|
|
191518
|
+
translations,
|
|
191519
|
+
newReferences,
|
|
191520
|
+
translatableFields
|
|
191521
|
+
);
|
|
191522
|
+
const currentValues = form.getValues();
|
|
191523
|
+
const newFormValues = {
|
|
191524
|
+
entities: { ...currentValues.entities }
|
|
191525
|
+
};
|
|
191526
|
+
for (const ref of newReferences) {
|
|
191527
|
+
if (!newFormValues.entities[ref.id]) {
|
|
191528
|
+
newFormValues.entities[ref.id] = snapshotRef.current.entities[ref.id];
|
|
191529
|
+
}
|
|
191530
|
+
}
|
|
191531
|
+
form.reset(newFormValues, {
|
|
191532
|
+
keepDirty: true,
|
|
191533
|
+
keepDirtyValues: true
|
|
191534
|
+
});
|
|
191535
|
+
}, [references, translations, translatableFields, form]);
|
|
191458
191536
|
const rows = (0, import_react307.useMemo)(
|
|
191459
|
-
() => buildTranslationRows(
|
|
191460
|
-
[
|
|
191537
|
+
() => buildTranslationRows(references, translatableFields),
|
|
191538
|
+
[references, translatableFields]
|
|
191461
191539
|
);
|
|
191462
|
-
const
|
|
191463
|
-
|
|
191464
|
-
|
|
191465
|
-
|
|
191466
|
-
|
|
191467
|
-
|
|
191468
|
-
|
|
191469
|
-
const hasChanges = hasLocaleChanges(
|
|
191470
|
-
currentValues,
|
|
191471
|
-
initialState.current,
|
|
191472
|
-
selectedLocale
|
|
191473
|
-
);
|
|
191474
|
-
if (hasChanges) {
|
|
191475
|
-
setPendingLocale(newLocale);
|
|
191476
|
-
setShowUnsavedPrompt(true);
|
|
191477
|
-
} else {
|
|
191478
|
-
setSelectedLocale(newLocale);
|
|
191479
|
-
}
|
|
191480
|
-
},
|
|
191481
|
-
[selectedLocale, form]
|
|
191540
|
+
const totalRowCount = (0, import_react307.useMemo)(
|
|
191541
|
+
() => referenceCount * (translatableFields.length + 1),
|
|
191542
|
+
[referenceCount, translatableFields]
|
|
191543
|
+
);
|
|
191544
|
+
const selectedLocaleDisplay = (0, import_react307.useMemo)(
|
|
191545
|
+
() => availableLocales.find((l) => l.locale_code === selectedLocale)?.locale.name,
|
|
191546
|
+
[availableLocales, selectedLocale]
|
|
191482
191547
|
);
|
|
191548
|
+
const columns = useTranslationsGridColumns({
|
|
191549
|
+
entities: references,
|
|
191550
|
+
availableLocales,
|
|
191551
|
+
selectedLocale,
|
|
191552
|
+
dynamicColumnWidth
|
|
191553
|
+
});
|
|
191554
|
+
const { mutateAsync, isPending, invalidateQueries } = useBatchTranslations(entityType);
|
|
191483
191555
|
const saveCurrentLocale = (0, import_react307.useCallback)(async () => {
|
|
191484
191556
|
const currentValues = form.getValues();
|
|
191485
|
-
const payload =
|
|
191557
|
+
const { hasChanges, payload } = computeChanges(
|
|
191486
191558
|
currentValues,
|
|
191487
|
-
|
|
191559
|
+
snapshotRef.current,
|
|
191488
191560
|
entityType,
|
|
191489
191561
|
selectedLocale
|
|
191490
191562
|
);
|
|
191491
|
-
if (
|
|
191563
|
+
if (!hasChanges) {
|
|
191492
191564
|
return true;
|
|
191493
191565
|
}
|
|
191494
191566
|
try {
|
|
@@ -191512,20 +191584,32 @@ var init_translations_edit_form = __esm({
|
|
|
191512
191584
|
}
|
|
191513
191585
|
if (payload.delete.length > 0) {
|
|
191514
191586
|
currentBatch.delete = payload.delete.splice(0, currentBatchAvailable);
|
|
191515
|
-
currentBatchAvailable -= currentBatch.delete.length;
|
|
191516
191587
|
}
|
|
191517
|
-
await mutateAsync(currentBatch
|
|
191588
|
+
const response = await mutateAsync(currentBatch, {
|
|
191589
|
+
onError: (error) => {
|
|
191590
|
+
import_ui454.toast.error(error.message);
|
|
191591
|
+
}
|
|
191592
|
+
});
|
|
191593
|
+
if (response.created) {
|
|
191594
|
+
for (const created of response.created) {
|
|
191595
|
+
form.setValue(`entities.${created.reference_id}.id`, created.id, {
|
|
191596
|
+
shouldDirty: false
|
|
191597
|
+
});
|
|
191598
|
+
if (snapshotRef.current.entities[created.reference_id]) {
|
|
191599
|
+
snapshotRef.current.entities[created.reference_id].id = created.id;
|
|
191600
|
+
}
|
|
191601
|
+
}
|
|
191602
|
+
}
|
|
191518
191603
|
}
|
|
191519
|
-
const
|
|
191520
|
-
for (const entityId of Object.keys(
|
|
191521
|
-
if (
|
|
191522
|
-
|
|
191523
|
-
...
|
|
191604
|
+
const savedValues = form.getValues();
|
|
191605
|
+
for (const entityId of Object.keys(savedValues.entities)) {
|
|
191606
|
+
if (snapshotRef.current.entities[entityId]) {
|
|
191607
|
+
snapshotRef.current.entities[entityId] = {
|
|
191608
|
+
...savedValues.entities[entityId]
|
|
191524
191609
|
};
|
|
191525
191610
|
}
|
|
191526
191611
|
}
|
|
191527
|
-
|
|
191528
|
-
form.reset(currentValues);
|
|
191612
|
+
form.reset(savedValues);
|
|
191529
191613
|
return true;
|
|
191530
191614
|
} catch (error) {
|
|
191531
191615
|
import_ui454.toast.error(
|
|
@@ -191534,19 +191618,59 @@ var init_translations_edit_form = __esm({
|
|
|
191534
191618
|
return false;
|
|
191535
191619
|
}
|
|
191536
191620
|
}, [form, entityType, selectedLocale, mutateAsync]);
|
|
191621
|
+
const switchToLocale = (0, import_react307.useCallback)(
|
|
191622
|
+
async (newLocale) => {
|
|
191623
|
+
setIsSwitchingLocale(true);
|
|
191624
|
+
try {
|
|
191625
|
+
await invalidateQueries();
|
|
191626
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
191627
|
+
const { translations: translations2, references: references2 } = latestPropsRef.current;
|
|
191628
|
+
const newSnapshot = buildLocaleSnapshot(
|
|
191629
|
+
translations2,
|
|
191630
|
+
references2,
|
|
191631
|
+
newLocale,
|
|
191632
|
+
translatableFields
|
|
191633
|
+
);
|
|
191634
|
+
snapshotRef.current = newSnapshot;
|
|
191635
|
+
knownEntityIdsRef.current = new Set(references2.map((r) => r.id));
|
|
191636
|
+
form.reset(snapshotToFormValues(newSnapshot));
|
|
191637
|
+
setSelectedLocale(newLocale);
|
|
191638
|
+
} finally {
|
|
191639
|
+
setIsSwitchingLocale(false);
|
|
191640
|
+
}
|
|
191641
|
+
},
|
|
191642
|
+
[translatableFields, form, invalidateQueries]
|
|
191643
|
+
);
|
|
191644
|
+
const handleLocaleChange = (0, import_react307.useCallback)(
|
|
191645
|
+
(newLocale) => {
|
|
191646
|
+
if (newLocale === selectedLocale) {
|
|
191647
|
+
return;
|
|
191648
|
+
}
|
|
191649
|
+
const currentValues = form.getValues();
|
|
191650
|
+
const { hasChanges } = computeChanges(
|
|
191651
|
+
currentValues,
|
|
191652
|
+
snapshotRef.current,
|
|
191653
|
+
entityType,
|
|
191654
|
+
selectedLocale
|
|
191655
|
+
);
|
|
191656
|
+
if (hasChanges) {
|
|
191657
|
+
setPendingLocale(newLocale);
|
|
191658
|
+
setShowUnsavedPrompt(true);
|
|
191659
|
+
} else {
|
|
191660
|
+
switchToLocale(newLocale);
|
|
191661
|
+
}
|
|
191662
|
+
},
|
|
191663
|
+
[selectedLocale, form, entityType, switchToLocale]
|
|
191664
|
+
);
|
|
191537
191665
|
const handleSaveAndSwitch = (0, import_react307.useCallback)(async () => {
|
|
191538
191666
|
const success = await saveCurrentLocale();
|
|
191539
191667
|
if (success && pendingLocale) {
|
|
191540
|
-
import_ui454.toast.success(
|
|
191541
|
-
|
|
191542
|
-
defaultValue: "Changes saved successfully"
|
|
191543
|
-
})
|
|
191544
|
-
);
|
|
191545
|
-
setSelectedLocale(pendingLocale);
|
|
191668
|
+
import_ui454.toast.success(t5("translations.edit.successToast"));
|
|
191669
|
+
await switchToLocale(pendingLocale);
|
|
191546
191670
|
}
|
|
191547
191671
|
setShowUnsavedPrompt(false);
|
|
191548
191672
|
setPendingLocale(null);
|
|
191549
|
-
}, [saveCurrentLocale, pendingLocale, t5]);
|
|
191673
|
+
}, [saveCurrentLocale, pendingLocale, t5, switchToLocale]);
|
|
191550
191674
|
const handleCancelSwitch = (0, import_react307.useCallback)(() => {
|
|
191551
191675
|
setShowUnsavedPrompt(false);
|
|
191552
191676
|
setPendingLocale(null);
|
|
@@ -191563,69 +191687,15 @@ var init_translations_edit_form = __esm({
|
|
|
191563
191687
|
},
|
|
191564
191688
|
[saveCurrentLocale, t5, handleSuccess]
|
|
191565
191689
|
);
|
|
191566
|
-
const
|
|
191567
|
-
|
|
191568
|
-
|
|
191569
|
-
|
|
191570
|
-
|
|
191571
|
-
);
|
|
191572
|
-
if (payload.create.length === 0 && payload.update.length === 0 && payload.delete.length === 0) {
|
|
191573
|
-
return;
|
|
191574
|
-
}
|
|
191575
|
-
const BATCH_SIZE = 150;
|
|
191576
|
-
const totalItems = payload.create.length + payload.update.length + payload.delete.length;
|
|
191577
|
-
const batchCount = Math.ceil(totalItems / BATCH_SIZE);
|
|
191578
|
-
for (let i = 0; i < batchCount; i++) {
|
|
191579
|
-
let currentBatchAvailable = BATCH_SIZE;
|
|
191580
|
-
const currentBatch = {
|
|
191581
|
-
create: [],
|
|
191582
|
-
update: [],
|
|
191583
|
-
delete: []
|
|
191584
|
-
};
|
|
191585
|
-
if (payload.create.length > 0) {
|
|
191586
|
-
currentBatch.create = payload.create.splice(0, currentBatchAvailable);
|
|
191587
|
-
currentBatchAvailable -= currentBatch.create.length;
|
|
191588
|
-
}
|
|
191589
|
-
if (payload.update.length > 0) {
|
|
191590
|
-
currentBatch.update = payload.update.splice(0, currentBatchAvailable);
|
|
191591
|
-
currentBatchAvailable -= currentBatch.update.length;
|
|
191592
|
-
}
|
|
191593
|
-
if (payload.delete.length > 0) {
|
|
191594
|
-
currentBatch.delete = payload.delete.splice(0, currentBatchAvailable);
|
|
191595
|
-
currentBatchAvailable -= currentBatch.delete.length;
|
|
191596
|
-
}
|
|
191597
|
-
await mutateAsync(currentBatch, {
|
|
191598
|
-
onSuccess: () => {
|
|
191599
|
-
if (i === batchCount - 1) {
|
|
191600
|
-
import_ui454.toast.success(
|
|
191601
|
-
t5("translations.edit.successToast", {
|
|
191602
|
-
defaultValue: "Translations updated successfully"
|
|
191603
|
-
})
|
|
191604
|
-
);
|
|
191605
|
-
handleSuccess();
|
|
191606
|
-
}
|
|
191607
|
-
},
|
|
191608
|
-
onError: (error) => {
|
|
191609
|
-
import_ui454.toast.error(error.message);
|
|
191610
|
-
}
|
|
191611
|
-
});
|
|
191612
|
-
}
|
|
191613
|
-
});
|
|
191614
|
-
const columns = useTranslationsGridColumns({
|
|
191615
|
-
entities,
|
|
191616
|
-
translatableFields,
|
|
191617
|
-
availableLocales,
|
|
191618
|
-
selectedLocale,
|
|
191619
|
-
dynamicColumnWidth
|
|
191620
|
-
});
|
|
191621
|
-
const selectedLocaleDisplay = availableLocales.find(
|
|
191622
|
-
(l) => l.locale_code === selectedLocale
|
|
191623
|
-
)?.locale.name;
|
|
191624
|
-
return /* @__PURE__ */ (0, import_jsx_runtime690.jsxs)(RouteFocusModal.Form, { form, children: [
|
|
191690
|
+
const handleClose = (0, import_react307.useCallback)(() => {
|
|
191691
|
+
invalidateQueries();
|
|
191692
|
+
}, [invalidateQueries]);
|
|
191693
|
+
const isLoading = isPending || isSwitchingLocale;
|
|
191694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime690.jsxs)(RouteFocusModal.Form, { form, onClose: handleClose, children: [
|
|
191625
191695
|
/* @__PURE__ */ (0, import_jsx_runtime690.jsxs)(
|
|
191626
191696
|
KeyboundForm,
|
|
191627
191697
|
{
|
|
191628
|
-
onSubmit:
|
|
191698
|
+
onSubmit: () => handleSave(true),
|
|
191629
191699
|
className: "flex h-full flex-col overflow-hidden",
|
|
191630
191700
|
children: [
|
|
191631
191701
|
/* @__PURE__ */ (0, import_jsx_runtime690.jsx)(RouteFocusModal.Header, {}),
|
|
@@ -191642,13 +191712,14 @@ var init_translations_edit_form = __esm({
|
|
|
191642
191712
|
},
|
|
191643
191713
|
state: form,
|
|
191644
191714
|
onEditingChange: (editing) => setCloseOnEscape(!editing),
|
|
191645
|
-
totalRowCount
|
|
191715
|
+
totalRowCount,
|
|
191646
191716
|
onFetchMore: fetchNextPage,
|
|
191647
191717
|
isFetchingMore: isFetchingNextPage,
|
|
191648
191718
|
hasNextPage,
|
|
191649
191719
|
headerContent: /* @__PURE__ */ (0, import_jsx_runtime690.jsxs)(
|
|
191650
191720
|
import_ui454.Select,
|
|
191651
191721
|
{
|
|
191722
|
+
disabled: isLoading,
|
|
191652
191723
|
value: selectedLocale,
|
|
191653
191724
|
onValueChange: handleLocaleChange,
|
|
191654
191725
|
size: "small",
|
|
@@ -191668,28 +191739,28 @@ var init_translations_edit_form = __esm({
|
|
|
191668
191739
|
}
|
|
191669
191740
|
) }) }),
|
|
191670
191741
|
/* @__PURE__ */ (0, import_jsx_runtime690.jsx)(RouteFocusModal.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime690.jsxs)("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
191671
|
-
/* @__PURE__ */ (0, import_jsx_runtime690.jsx)(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime690.jsx)(
|
|
191672
|
-
/* @__PURE__ */ (0, import_jsx_runtime690.jsx)(
|
|
191742
|
+
/* @__PURE__ */ (0, import_jsx_runtime690.jsx)(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime690.jsx)(
|
|
191673
191743
|
import_ui454.Button,
|
|
191674
191744
|
{
|
|
191675
|
-
size: "small",
|
|
191676
191745
|
type: "button",
|
|
191746
|
+
size: "small",
|
|
191677
191747
|
variant: "secondary",
|
|
191678
|
-
|
|
191679
|
-
|
|
191680
|
-
children: t5("actions.saveChanges")
|
|
191748
|
+
isLoading,
|
|
191749
|
+
children: t5("actions.cancel")
|
|
191681
191750
|
}
|
|
191682
|
-
),
|
|
191751
|
+
) }),
|
|
191683
191752
|
/* @__PURE__ */ (0, import_jsx_runtime690.jsx)(
|
|
191684
191753
|
import_ui454.Button,
|
|
191685
191754
|
{
|
|
191686
191755
|
size: "small",
|
|
191687
191756
|
type: "button",
|
|
191688
|
-
|
|
191689
|
-
|
|
191690
|
-
|
|
191757
|
+
variant: "secondary",
|
|
191758
|
+
onClick: () => handleSave(false),
|
|
191759
|
+
isLoading,
|
|
191760
|
+
children: t5("actions.saveChanges")
|
|
191691
191761
|
}
|
|
191692
|
-
)
|
|
191762
|
+
),
|
|
191763
|
+
/* @__PURE__ */ (0, import_jsx_runtime690.jsx)(import_ui454.Button, { size: "small", type: "submit", isLoading, children: t5("actions.saveAndClose") })
|
|
191693
191764
|
] }) })
|
|
191694
191765
|
]
|
|
191695
191766
|
}
|
|
@@ -191716,7 +191787,7 @@ var init_translations_edit_form = __esm({
|
|
|
191716
191787
|
size: "small",
|
|
191717
191788
|
onClick: handleSaveAndSwitch,
|
|
191718
191789
|
type: "button",
|
|
191719
|
-
isLoading
|
|
191790
|
+
isLoading,
|
|
191720
191791
|
children: t5("actions.saveChanges")
|
|
191721
191792
|
}
|
|
191722
191793
|
)
|
|
@@ -191825,15 +191896,55 @@ var init_translations_edit2 = __esm({
|
|
|
191825
191896
|
}
|
|
191826
191897
|
});
|
|
191827
191898
|
|
|
191899
|
+
// src/routes/translations/add-locales/add-locales.tsx
|
|
191900
|
+
var import_react_router_dom248, import_jsx_runtime692, TranslationsAddLocales;
|
|
191901
|
+
var init_add_locales = __esm({
|
|
191902
|
+
"src/routes/translations/add-locales/add-locales.tsx"() {
|
|
191903
|
+
"use strict";
|
|
191904
|
+
init_route_focus_modal2();
|
|
191905
|
+
init_api();
|
|
191906
|
+
init_feature_flag_provider();
|
|
191907
|
+
import_react_router_dom248 = require("react-router-dom");
|
|
191908
|
+
init_add_locales_form();
|
|
191909
|
+
import_jsx_runtime692 = require("react/jsx-runtime");
|
|
191910
|
+
TranslationsAddLocales = () => {
|
|
191911
|
+
const isEnabled = useFeatureFlag("translation");
|
|
191912
|
+
const navigate = (0, import_react_router_dom248.useNavigate)();
|
|
191913
|
+
if (!isEnabled) {
|
|
191914
|
+
navigate(-1);
|
|
191915
|
+
return null;
|
|
191916
|
+
}
|
|
191917
|
+
const { store, isPending, isError, error } = useStore();
|
|
191918
|
+
const ready = !!store && !isPending;
|
|
191919
|
+
if (isError) {
|
|
191920
|
+
throw error;
|
|
191921
|
+
}
|
|
191922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime692.jsx)(RouteFocusModal, { children: ready && /* @__PURE__ */ (0, import_jsx_runtime692.jsx)(AddLocalesForm, { store }) });
|
|
191923
|
+
};
|
|
191924
|
+
}
|
|
191925
|
+
});
|
|
191926
|
+
|
|
191927
|
+
// src/routes/translations/add-locales/index.tsx
|
|
191928
|
+
var add_locales_exports = {};
|
|
191929
|
+
__export(add_locales_exports, {
|
|
191930
|
+
Component: () => TranslationsAddLocales
|
|
191931
|
+
});
|
|
191932
|
+
var init_add_locales2 = __esm({
|
|
191933
|
+
"src/routes/translations/add-locales/index.tsx"() {
|
|
191934
|
+
"use strict";
|
|
191935
|
+
init_add_locales();
|
|
191936
|
+
}
|
|
191937
|
+
});
|
|
191938
|
+
|
|
191828
191939
|
// src/components/common/logo-box/avatar-box.tsx
|
|
191829
191940
|
function AvatarBox({ checked }) {
|
|
191830
|
-
return /* @__PURE__ */ (0,
|
|
191941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime693.jsxs)(
|
|
191831
191942
|
IconAvatar,
|
|
191832
191943
|
{
|
|
191833
191944
|
size: "xlarge",
|
|
191834
191945
|
className: "bg-ui-button-neutral shadow-buttons-neutral after:button-neutral-gradient relative mb-4 flex h-[50px] w-[50px] items-center justify-center rounded-xl after:inset-0 after:content-['']",
|
|
191835
191946
|
children: [
|
|
191836
|
-
checked && /* @__PURE__ */ (0,
|
|
191947
|
+
checked && /* @__PURE__ */ (0, import_jsx_runtime693.jsx)(
|
|
191837
191948
|
import_react309.motion.div,
|
|
191838
191949
|
{
|
|
191839
191950
|
className: "absolute -right-[5px] -top-1 flex size-5 items-center justify-center rounded-full border-[0.5px] border-[rgba(3,7,18,0.2)] bg-[#3B82F6] bg-gradient-to-b from-white/0 to-white/20 shadow-[0px_1px_2px_0px_rgba(3,7,18,0.12),0px_1px_2px_0px_rgba(255,255,255,0.10)_inset,0px_-1px_5px_0px_rgba(255,255,255,0.10)_inset,0px_0px_0px_0px_rgba(3,7,18,0.06)_inset]",
|
|
@@ -191844,7 +191955,7 @@ function AvatarBox({ checked }) {
|
|
|
191844
191955
|
delay: 0.8,
|
|
191845
191956
|
ease: [0, 0.71, 0.2, 1.01]
|
|
191846
191957
|
},
|
|
191847
|
-
children: /* @__PURE__ */ (0,
|
|
191958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime693.jsx)(
|
|
191848
191959
|
"svg",
|
|
191849
191960
|
{
|
|
191850
191961
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -191852,7 +191963,7 @@ function AvatarBox({ checked }) {
|
|
|
191852
191963
|
height: "20",
|
|
191853
191964
|
viewBox: "0 0 20 20",
|
|
191854
191965
|
fill: "none",
|
|
191855
|
-
children: /* @__PURE__ */ (0,
|
|
191966
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime693.jsx)(
|
|
191856
191967
|
import_react309.motion.path,
|
|
191857
191968
|
{
|
|
191858
191969
|
d: "M5.8335 10.4167L9.16683 13.75L14.1668 6.25",
|
|
@@ -191874,7 +191985,7 @@ function AvatarBox({ checked }) {
|
|
|
191874
191985
|
)
|
|
191875
191986
|
}
|
|
191876
191987
|
),
|
|
191877
|
-
/* @__PURE__ */ (0,
|
|
191988
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsxs)(
|
|
191878
191989
|
"svg",
|
|
191879
191990
|
{
|
|
191880
191991
|
className: "rounded-[10px]",
|
|
@@ -191882,8 +191993,8 @@ function AvatarBox({ checked }) {
|
|
|
191882
191993
|
fill: "none",
|
|
191883
191994
|
xmlns: "http://www.w3.org/2000/svg",
|
|
191884
191995
|
children: [
|
|
191885
|
-
/* @__PURE__ */ (0,
|
|
191886
|
-
/* @__PURE__ */ (0,
|
|
191996
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsx)("rect", { width: "400", height: "400", fill: "#18181B" }),
|
|
191997
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsx)(
|
|
191887
191998
|
"path",
|
|
191888
191999
|
{
|
|
191889
192000
|
d: "M238.088 51.1218L238.089 51.1223L310.605 92.8101C334.028 106.308 348.526 131.32 347.868 157.953L347.867 157.966V157.978V241.688C347.867 268.68 333.687 293.362 310.271 306.856L310.269 306.858L237.754 348.878C214.336 362.374 185.643 362.374 162.225 348.878L89.7127 306.859C66.6206 293.361 52.1113 268.674 52.1113 241.688V157.978C52.1113 131.326 66.6211 106.307 89.7088 92.8093C89.7101 92.8085 89.7114 92.8078 89.7127 92.807L162.556 51.1233L162.559 51.1218C185.977 37.6261 214.67 37.6261 238.088 51.1218ZM124.634 200C124.634 241.576 158.502 275.372 200.156 275.372C242.142 275.372 276.013 241.578 276.013 200C276.013 158.419 241.805 124.628 200.156 124.628C158.502 124.628 124.634 158.424 124.634 200Z",
|
|
@@ -191892,8 +192003,8 @@ function AvatarBox({ checked }) {
|
|
|
191892
192003
|
strokeWidth: "2"
|
|
191893
192004
|
}
|
|
191894
192005
|
),
|
|
191895
|
-
/* @__PURE__ */ (0,
|
|
191896
|
-
/* @__PURE__ */ (0,
|
|
192006
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsxs)("defs", { children: [
|
|
192007
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsxs)(
|
|
191897
192008
|
"linearGradient",
|
|
191898
192009
|
{
|
|
191899
192010
|
id: "paint0_linear_11869_12671",
|
|
@@ -191903,12 +192014,12 @@ function AvatarBox({ checked }) {
|
|
|
191903
192014
|
y2: "360",
|
|
191904
192015
|
gradientUnits: "userSpaceOnUse",
|
|
191905
192016
|
children: [
|
|
191906
|
-
/* @__PURE__ */ (0,
|
|
191907
|
-
/* @__PURE__ */ (0,
|
|
192017
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsx)("stop", { stopColor: "white" }),
|
|
192018
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsx)("stop", { offset: "1", stopColor: "white", stopOpacity: "0.7" })
|
|
191908
192019
|
]
|
|
191909
192020
|
}
|
|
191910
192021
|
),
|
|
191911
|
-
/* @__PURE__ */ (0,
|
|
192022
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsxs)(
|
|
191912
192023
|
"linearGradient",
|
|
191913
192024
|
{
|
|
191914
192025
|
id: "paint1_linear_11869_12671",
|
|
@@ -191918,8 +192029,8 @@ function AvatarBox({ checked }) {
|
|
|
191918
192029
|
y2: "360",
|
|
191919
192030
|
gradientUnits: "userSpaceOnUse",
|
|
191920
192031
|
children: [
|
|
191921
|
-
/* @__PURE__ */ (0,
|
|
191922
|
-
/* @__PURE__ */ (0,
|
|
192032
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsx)("stop", { stopColor: "white", stopOpacity: "0" }),
|
|
192033
|
+
/* @__PURE__ */ (0, import_jsx_runtime693.jsx)("stop", { offset: "1", stopColor: "white", stopOpacity: "0.7" })
|
|
191923
192034
|
]
|
|
191924
192035
|
}
|
|
191925
192036
|
)
|
|
@@ -191931,18 +192042,18 @@ function AvatarBox({ checked }) {
|
|
|
191931
192042
|
}
|
|
191932
192043
|
);
|
|
191933
192044
|
}
|
|
191934
|
-
var import_react309,
|
|
192045
|
+
var import_react309, import_jsx_runtime693;
|
|
191935
192046
|
var init_avatar_box = __esm({
|
|
191936
192047
|
"src/components/common/logo-box/avatar-box.tsx"() {
|
|
191937
192048
|
"use strict";
|
|
191938
192049
|
import_react309 = require("motion/react");
|
|
191939
192050
|
init_icon_avatar2();
|
|
191940
|
-
|
|
192051
|
+
import_jsx_runtime693 = require("react/jsx-runtime");
|
|
191941
192052
|
}
|
|
191942
192053
|
});
|
|
191943
192054
|
|
|
191944
192055
|
// src/routes/login/login.tsx
|
|
191945
|
-
var import_zod168, import_ui455, import_react_hook_form146, import_react_i18next488,
|
|
192056
|
+
var import_zod168, import_ui455, import_react_hook_form146, import_react_i18next488, import_react_router_dom249, z64, import_jsx_runtime694, LoginSchema, Login;
|
|
191946
192057
|
var init_login = __esm({
|
|
191947
192058
|
"src/routes/login/login.tsx"() {
|
|
191948
192059
|
"use strict";
|
|
@@ -191950,22 +192061,22 @@ var init_login = __esm({
|
|
|
191950
192061
|
import_ui455 = require("@medusajs/ui");
|
|
191951
192062
|
import_react_hook_form146 = require("react-hook-form");
|
|
191952
192063
|
import_react_i18next488 = require("react-i18next");
|
|
191953
|
-
|
|
192064
|
+
import_react_router_dom249 = require("react-router-dom");
|
|
191954
192065
|
z64 = __toESM(require("zod"));
|
|
191955
192066
|
init_form2();
|
|
191956
192067
|
init_avatar_box();
|
|
191957
192068
|
init_api();
|
|
191958
192069
|
init_is_fetch_error();
|
|
191959
192070
|
init_extension_provider2();
|
|
191960
|
-
|
|
192071
|
+
import_jsx_runtime694 = require("react/jsx-runtime");
|
|
191961
192072
|
LoginSchema = z64.object({
|
|
191962
192073
|
email: z64.string().email(),
|
|
191963
192074
|
password: z64.string()
|
|
191964
192075
|
});
|
|
191965
192076
|
Login = () => {
|
|
191966
192077
|
const { t: t5 } = (0, import_react_i18next488.useTranslation)();
|
|
191967
|
-
const location = (0,
|
|
191968
|
-
const navigate = (0,
|
|
192078
|
+
const location = (0, import_react_router_dom249.useLocation)();
|
|
192079
|
+
const navigate = (0, import_react_router_dom249.useNavigate)();
|
|
191969
192080
|
const { getWidgets } = useExtension();
|
|
191970
192081
|
const from = location.state?.from?.pathname || "/orders";
|
|
191971
192082
|
const form = (0, import_react_hook_form146.useForm)({
|
|
@@ -192006,30 +192117,30 @@ var init_login = __esm({
|
|
|
192006
192117
|
});
|
|
192007
192118
|
const serverError = form.formState.errors?.root?.serverError?.message;
|
|
192008
192119
|
const validationError = form.formState.errors.email?.message || form.formState.errors.password?.message;
|
|
192009
|
-
return /* @__PURE__ */ (0,
|
|
192010
|
-
/* @__PURE__ */ (0,
|
|
192011
|
-
/* @__PURE__ */ (0,
|
|
192012
|
-
/* @__PURE__ */ (0,
|
|
192013
|
-
/* @__PURE__ */ (0,
|
|
192120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime694.jsx)("div", { className: "bg-ui-bg-subtle flex min-h-dvh w-dvw items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime694.jsxs)("div", { className: "m-4 flex w-full max-w-[280px] flex-col items-center", children: [
|
|
192121
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(AvatarBox, {}),
|
|
192122
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsxs)("div", { className: "mb-4 flex flex-col items-center", children: [
|
|
192123
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(import_ui455.Heading, { children: t5("login.title") }),
|
|
192124
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(import_ui455.Text, { size: "small", className: "text-ui-fg-subtle text-center", children: t5("login.hint") })
|
|
192014
192125
|
] }),
|
|
192015
|
-
/* @__PURE__ */ (0,
|
|
192126
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsxs)("div", { className: "flex w-full flex-col gap-y-3", children: [
|
|
192016
192127
|
getWidgets("login.before").map((Component5, i) => {
|
|
192017
|
-
return /* @__PURE__ */ (0,
|
|
192128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime694.jsx)(Component5, {}, i);
|
|
192018
192129
|
}),
|
|
192019
|
-
/* @__PURE__ */ (0,
|
|
192130
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime694.jsxs)(
|
|
192020
192131
|
"form",
|
|
192021
192132
|
{
|
|
192022
192133
|
onSubmit: handleSubmit,
|
|
192023
192134
|
className: "flex w-full flex-col gap-y-6",
|
|
192024
192135
|
children: [
|
|
192025
|
-
/* @__PURE__ */ (0,
|
|
192026
|
-
/* @__PURE__ */ (0,
|
|
192136
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsxs)("div", { className: "flex flex-col gap-y-1", children: [
|
|
192137
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(
|
|
192027
192138
|
Form.Field,
|
|
192028
192139
|
{
|
|
192029
192140
|
control: form.control,
|
|
192030
192141
|
name: "email",
|
|
192031
192142
|
render: ({ field }) => {
|
|
192032
|
-
return /* @__PURE__ */ (0,
|
|
192143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime694.jsx)(Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime694.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime694.jsx)(
|
|
192033
192144
|
import_ui455.Input,
|
|
192034
192145
|
{
|
|
192035
192146
|
autoComplete: "email",
|
|
@@ -192041,15 +192152,15 @@ var init_login = __esm({
|
|
|
192041
192152
|
}
|
|
192042
192153
|
}
|
|
192043
192154
|
),
|
|
192044
|
-
/* @__PURE__ */ (0,
|
|
192155
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(
|
|
192045
192156
|
Form.Field,
|
|
192046
192157
|
{
|
|
192047
192158
|
control: form.control,
|
|
192048
192159
|
name: "password",
|
|
192049
192160
|
render: ({ field }) => {
|
|
192050
|
-
return /* @__PURE__ */ (0,
|
|
192051
|
-
/* @__PURE__ */ (0,
|
|
192052
|
-
/* @__PURE__ */ (0,
|
|
192161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime694.jsxs)(Form.Item, { children: [
|
|
192162
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(Form.Label, {}),
|
|
192163
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime694.jsx)(
|
|
192053
192164
|
import_ui455.Input,
|
|
192054
192165
|
{
|
|
192055
192166
|
type: "password",
|
|
@@ -192064,8 +192175,8 @@ var init_login = __esm({
|
|
|
192064
192175
|
}
|
|
192065
192176
|
)
|
|
192066
192177
|
] }),
|
|
192067
|
-
validationError && /* @__PURE__ */ (0,
|
|
192068
|
-
serverError && /* @__PURE__ */ (0,
|
|
192178
|
+
validationError && /* @__PURE__ */ (0, import_jsx_runtime694.jsx)("div", { className: "text-center", children: /* @__PURE__ */ (0, import_jsx_runtime694.jsx)(import_ui455.Hint, { className: "inline-flex", variant: "error", children: validationError }) }),
|
|
192179
|
+
serverError && /* @__PURE__ */ (0, import_jsx_runtime694.jsx)(
|
|
192069
192180
|
import_ui455.Alert,
|
|
192070
192181
|
{
|
|
192071
192182
|
className: "bg-ui-bg-base items-center p-2",
|
|
@@ -192074,21 +192185,21 @@ var init_login = __esm({
|
|
|
192074
192185
|
children: serverError
|
|
192075
192186
|
}
|
|
192076
192187
|
),
|
|
192077
|
-
/* @__PURE__ */ (0,
|
|
192188
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(import_ui455.Button, { className: "w-full", type: "submit", isLoading: isPending, children: t5("actions.continueWithEmail") })
|
|
192078
192189
|
]
|
|
192079
192190
|
}
|
|
192080
192191
|
) }),
|
|
192081
192192
|
getWidgets("login.after").map((Component5, i) => {
|
|
192082
|
-
return /* @__PURE__ */ (0,
|
|
192193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime694.jsx)(Component5, {}, i);
|
|
192083
192194
|
})
|
|
192084
192195
|
] }),
|
|
192085
|
-
/* @__PURE__ */ (0,
|
|
192196
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)("span", { className: "text-ui-fg-muted txt-small my-6", children: /* @__PURE__ */ (0, import_jsx_runtime694.jsx)(
|
|
192086
192197
|
import_react_i18next488.Trans,
|
|
192087
192198
|
{
|
|
192088
192199
|
i18nKey: "login.forgotPassword",
|
|
192089
192200
|
components: [
|
|
192090
|
-
/* @__PURE__ */ (0,
|
|
192091
|
-
|
|
192201
|
+
/* @__PURE__ */ (0, import_jsx_runtime694.jsx)(
|
|
192202
|
+
import_react_router_dom249.Link,
|
|
192092
192203
|
{
|
|
192093
192204
|
to: "/reset-password",
|
|
192094
192205
|
className: "text-ui-fg-interactive transition-fg hover:text-ui-fg-interactive-hover focus-visible:text-ui-fg-interactive-hover font-medium outline-none"
|
|
@@ -192116,13 +192227,13 @@ var init_login2 = __esm({
|
|
|
192116
192227
|
});
|
|
192117
192228
|
|
|
192118
192229
|
// src/components/common/logo-box/logo-box.tsx
|
|
192119
|
-
var import_ui456, import_react310,
|
|
192230
|
+
var import_ui456, import_react310, import_jsx_runtime695, LogoBox;
|
|
192120
192231
|
var init_logo_box = __esm({
|
|
192121
192232
|
"src/components/common/logo-box/logo-box.tsx"() {
|
|
192122
192233
|
"use strict";
|
|
192123
192234
|
import_ui456 = require("@medusajs/ui");
|
|
192124
192235
|
import_react310 = require("motion/react");
|
|
192125
|
-
|
|
192236
|
+
import_jsx_runtime695 = require("react/jsx-runtime");
|
|
192126
192237
|
LogoBox = ({
|
|
192127
192238
|
className,
|
|
192128
192239
|
checked,
|
|
@@ -192137,7 +192248,7 @@ var init_logo_box = __esm({
|
|
|
192137
192248
|
ease: [0.1, 0.8, 0.2, 1.01]
|
|
192138
192249
|
}
|
|
192139
192250
|
}) => {
|
|
192140
|
-
return /* @__PURE__ */ (0,
|
|
192251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime695.jsxs)(
|
|
192141
192252
|
"div",
|
|
192142
192253
|
{
|
|
192143
192254
|
className: (0, import_ui456.clx)(
|
|
@@ -192146,14 +192257,14 @@ var init_logo_box = __esm({
|
|
|
192146
192257
|
className
|
|
192147
192258
|
),
|
|
192148
192259
|
children: [
|
|
192149
|
-
checked && /* @__PURE__ */ (0,
|
|
192260
|
+
checked && /* @__PURE__ */ (0, import_jsx_runtime695.jsx)(
|
|
192150
192261
|
import_react310.motion.div,
|
|
192151
192262
|
{
|
|
192152
192263
|
className: "size-5 absolute -right-[5px] -top-1 flex items-center justify-center rounded-full border-[0.5px] border-[rgba(3,7,18,0.2)] bg-[#3B82F6] bg-gradient-to-b from-white/0 to-white/20 shadow-[0px_1px_2px_0px_rgba(3,7,18,0.12),0px_1px_2px_0px_rgba(255,255,255,0.10)_inset,0px_-1px_5px_0px_rgba(255,255,255,0.10)_inset,0px_0px_0px_0px_rgba(3,7,18,0.06)_inset]",
|
|
192153
192264
|
initial: { opacity: 0, scale: 0.5 },
|
|
192154
192265
|
animate: { opacity: 1, scale: 1 },
|
|
192155
192266
|
transition: containerTransition,
|
|
192156
|
-
children: /* @__PURE__ */ (0,
|
|
192267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime695.jsx)(
|
|
192157
192268
|
"svg",
|
|
192158
192269
|
{
|
|
192159
192270
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -192161,7 +192272,7 @@ var init_logo_box = __esm({
|
|
|
192161
192272
|
height: "20",
|
|
192162
192273
|
viewBox: "0 0 20 20",
|
|
192163
192274
|
fill: "none",
|
|
192164
|
-
children: /* @__PURE__ */ (0,
|
|
192275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime695.jsx)(
|
|
192165
192276
|
import_react310.motion.path,
|
|
192166
192277
|
{
|
|
192167
192278
|
d: "M5.8335 10.4167L9.16683 13.75L14.1668 6.25",
|
|
@@ -192178,7 +192289,7 @@ var init_logo_box = __esm({
|
|
|
192178
192289
|
)
|
|
192179
192290
|
}
|
|
192180
192291
|
),
|
|
192181
|
-
/* @__PURE__ */ (0,
|
|
192292
|
+
/* @__PURE__ */ (0, import_jsx_runtime695.jsx)(
|
|
192182
192293
|
"svg",
|
|
192183
192294
|
{
|
|
192184
192295
|
width: "36",
|
|
@@ -192186,7 +192297,7 @@ var init_logo_box = __esm({
|
|
|
192186
192297
|
viewBox: "0 0 36 38",
|
|
192187
192298
|
fill: "none",
|
|
192188
192299
|
xmlns: "http://www.w3.org/2000/svg",
|
|
192189
|
-
children: /* @__PURE__ */ (0,
|
|
192300
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime695.jsx)(
|
|
192190
192301
|
"path",
|
|
192191
192302
|
{
|
|
192192
192303
|
d: "M30.85 6.16832L22.2453 1.21782C19.4299 -0.405941 15.9801 -0.405941 13.1648 1.21782L4.52043 6.16832C1.74473 7.79208 0 10.802 0 14.0099V23.9505C0 27.198 1.74473 30.1683 4.52043 31.7921L13.1251 36.7822C15.9405 38.4059 19.3903 38.4059 22.2056 36.7822L30.8103 31.7921C33.6257 30.1683 35.3307 27.198 35.3307 23.9505V14.0099C35.41 10.802 33.6653 7.79208 30.85 6.16832ZM17.6852 27.8317C12.8079 27.8317 8.8426 23.8713 8.8426 19C8.8426 14.1287 12.8079 10.1683 17.6852 10.1683C22.5625 10.1683 26.5674 14.1287 26.5674 19C26.5674 23.8713 22.6022 27.8317 17.6852 27.8317Z",
|
|
@@ -192212,7 +192323,7 @@ var init_logo_box2 = __esm({
|
|
|
192212
192323
|
});
|
|
192213
192324
|
|
|
192214
192325
|
// src/routes/reset-password/reset-password.tsx
|
|
192215
|
-
var import_zod169, import_ui457, import_react_hook_form147, import_react_i18next489,
|
|
192326
|
+
var import_zod169, import_ui457, import_react_hook_form147, import_react_i18next489, import_react_router_dom250, z65, import_react311, import_react_jwt, import_jsx_runtime696, ResetPasswordInstructionsSchema, ResetPasswordSchema, ResetPasswordTokenSchema, validateDecodedResetPasswordToken, InvalidResetToken, ChooseNewPassword, ResetPassword;
|
|
192216
192327
|
var init_reset_password = __esm({
|
|
192217
192328
|
"src/routes/reset-password/reset-password.tsx"() {
|
|
192218
192329
|
"use strict";
|
|
@@ -192220,7 +192331,7 @@ var init_reset_password = __esm({
|
|
|
192220
192331
|
import_ui457 = require("@medusajs/ui");
|
|
192221
192332
|
import_react_hook_form147 = require("react-hook-form");
|
|
192222
192333
|
import_react_i18next489 = require("react-i18next");
|
|
192223
|
-
|
|
192334
|
+
import_react_router_dom250 = require("react-router-dom");
|
|
192224
192335
|
z65 = __toESM(require("zod"));
|
|
192225
192336
|
import_react311 = require("react");
|
|
192226
192337
|
import_react_jwt = require("react-jwt");
|
|
@@ -192228,7 +192339,7 @@ var init_reset_password = __esm({
|
|
|
192228
192339
|
init_logo_box2();
|
|
192229
192340
|
init_i18n2();
|
|
192230
192341
|
init_auth();
|
|
192231
|
-
|
|
192342
|
+
import_jsx_runtime696 = require("react/jsx-runtime");
|
|
192232
192343
|
ResetPasswordInstructionsSchema = z65.object({
|
|
192233
192344
|
email: z65.string().email()
|
|
192234
192345
|
});
|
|
@@ -192255,14 +192366,14 @@ var init_reset_password = __esm({
|
|
|
192255
192366
|
};
|
|
192256
192367
|
InvalidResetToken = () => {
|
|
192257
192368
|
const { t: t5 } = (0, import_react_i18next489.useTranslation)();
|
|
192258
|
-
const navigate = (0,
|
|
192259
|
-
return /* @__PURE__ */ (0,
|
|
192260
|
-
/* @__PURE__ */ (0,
|
|
192261
|
-
/* @__PURE__ */ (0,
|
|
192262
|
-
/* @__PURE__ */ (0,
|
|
192263
|
-
/* @__PURE__ */ (0,
|
|
192369
|
+
const navigate = (0, import_react_router_dom250.useNavigate)();
|
|
192370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime696.jsx)("div", { className: "bg-ui-bg-base flex min-h-dvh w-dvw items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "m-4 flex w-full max-w-[300px] flex-col items-center", children: [
|
|
192371
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(LogoBox, { className: "mb-4" }),
|
|
192372
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "mb-6 flex flex-col items-center", children: [
|
|
192373
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Heading, { children: t5("resetPassword.invalidLinkTitle") }),
|
|
192374
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Text, { size: "small", className: "text-ui-fg-subtle text-center", children: t5("resetPassword.invalidLinkHint") })
|
|
192264
192375
|
] }),
|
|
192265
|
-
/* @__PURE__ */ (0,
|
|
192376
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("div", { className: "flex w-full flex-col gap-y-3", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192266
192377
|
import_ui457.Button,
|
|
192267
192378
|
{
|
|
192268
192379
|
onClick: () => navigate("/reset-password", { replace: true }),
|
|
@@ -192271,13 +192382,13 @@ var init_reset_password = __esm({
|
|
|
192271
192382
|
children: t5("resetPassword.goToResetPassword")
|
|
192272
192383
|
}
|
|
192273
192384
|
) }),
|
|
192274
|
-
/* @__PURE__ */ (0,
|
|
192385
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("span", { className: "txt-small my-6", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192275
192386
|
import_react_i18next489.Trans,
|
|
192276
192387
|
{
|
|
192277
192388
|
i18nKey: "resetPassword.backToLogin",
|
|
192278
192389
|
components: [
|
|
192279
|
-
/* @__PURE__ */ (0,
|
|
192280
|
-
|
|
192390
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192391
|
+
import_react_router_dom250.Link,
|
|
192281
192392
|
{
|
|
192282
192393
|
to: "/login",
|
|
192283
192394
|
className: "text-ui-fg-interactive transition-fg hover:text-ui-fg-interactive-hover focus-visible:text-ui-fg-interactive-hover outline-none"
|
|
@@ -192323,30 +192434,30 @@ var init_reset_password = __esm({
|
|
|
192323
192434
|
);
|
|
192324
192435
|
});
|
|
192325
192436
|
if (!isValidResetPasswordToken) {
|
|
192326
|
-
return /* @__PURE__ */ (0,
|
|
192437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(InvalidResetToken, {});
|
|
192327
192438
|
}
|
|
192328
|
-
return /* @__PURE__ */ (0,
|
|
192329
|
-
/* @__PURE__ */ (0,
|
|
192330
|
-
/* @__PURE__ */ (0,
|
|
192331
|
-
/* @__PURE__ */ (0,
|
|
192332
|
-
/* @__PURE__ */ (0,
|
|
192439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime696.jsx)("div", { className: "bg-ui-bg-subtle flex min-h-dvh w-dvw items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "m-4 flex w-full max-w-[280px] flex-col items-center", children: [
|
|
192440
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(LogoBox, { className: "mb-4" }),
|
|
192441
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "mb-6 flex flex-col items-center", children: [
|
|
192442
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Heading, { children: t5("resetPassword.resetPassword") }),
|
|
192443
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Text, { size: "small", className: "text-ui-fg-subtle text-center", children: t5("resetPassword.newPasswordHint") })
|
|
192333
192444
|
] }),
|
|
192334
|
-
/* @__PURE__ */ (0,
|
|
192445
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("div", { className: "flex w-full flex-col gap-y-3", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)(
|
|
192335
192446
|
"form",
|
|
192336
192447
|
{
|
|
192337
192448
|
onSubmit: handleSubmit,
|
|
192338
192449
|
className: "flex w-full flex-col gap-y-6",
|
|
192339
192450
|
children: [
|
|
192340
|
-
/* @__PURE__ */ (0,
|
|
192341
|
-
/* @__PURE__ */ (0,
|
|
192342
|
-
/* @__PURE__ */ (0,
|
|
192451
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "flex flex-col gap-y-4", children: [
|
|
192452
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Input, { type: "email", disabled: true, value: invite?.entity_id }),
|
|
192453
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192343
192454
|
Form.Field,
|
|
192344
192455
|
{
|
|
192345
192456
|
control: form.control,
|
|
192346
192457
|
name: "password",
|
|
192347
192458
|
render: ({ field }) => {
|
|
192348
|
-
return /* @__PURE__ */ (0,
|
|
192349
|
-
/* @__PURE__ */ (0,
|
|
192459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)(Form.Item, { children: [
|
|
192460
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192350
192461
|
import_ui457.Input,
|
|
192351
192462
|
{
|
|
192352
192463
|
autoComplete: "new-password",
|
|
@@ -192355,19 +192466,19 @@ var init_reset_password = __esm({
|
|
|
192355
192466
|
placeholder: t5("resetPassword.newPassword")
|
|
192356
192467
|
}
|
|
192357
192468
|
) }),
|
|
192358
|
-
/* @__PURE__ */ (0,
|
|
192469
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(Form.ErrorMessage, {})
|
|
192359
192470
|
] });
|
|
192360
192471
|
}
|
|
192361
192472
|
}
|
|
192362
192473
|
),
|
|
192363
|
-
/* @__PURE__ */ (0,
|
|
192474
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192364
192475
|
Form.Field,
|
|
192365
192476
|
{
|
|
192366
192477
|
control: form.control,
|
|
192367
192478
|
name: "repeat_password",
|
|
192368
192479
|
render: ({ field }) => {
|
|
192369
|
-
return /* @__PURE__ */ (0,
|
|
192370
|
-
/* @__PURE__ */ (0,
|
|
192480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)(Form.Item, { children: [
|
|
192481
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192371
192482
|
import_ui457.Input,
|
|
192372
192483
|
{
|
|
192373
192484
|
autoComplete: "off",
|
|
@@ -192376,27 +192487,27 @@ var init_reset_password = __esm({
|
|
|
192376
192487
|
placeholder: t5("resetPassword.repeatNewPassword")
|
|
192377
192488
|
}
|
|
192378
192489
|
) }),
|
|
192379
|
-
/* @__PURE__ */ (0,
|
|
192490
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(Form.ErrorMessage, {})
|
|
192380
192491
|
] });
|
|
192381
192492
|
}
|
|
192382
192493
|
}
|
|
192383
192494
|
)
|
|
192384
192495
|
] }),
|
|
192385
|
-
showAlert && /* @__PURE__ */ (0,
|
|
192386
|
-
/* @__PURE__ */ (0,
|
|
192387
|
-
/* @__PURE__ */ (0,
|
|
192496
|
+
showAlert && /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Alert, { dismissible: true, variant: "success", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "flex flex-col", children: [
|
|
192497
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("span", { className: "text-ui-fg-base mb-1", children: t5("resetPassword.successfulResetTitle") }),
|
|
192498
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("span", { children: t5("resetPassword.successfulReset") })
|
|
192388
192499
|
] }) }),
|
|
192389
|
-
!showAlert && /* @__PURE__ */ (0,
|
|
192500
|
+
!showAlert && /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Button, { className: "w-full", type: "submit", isLoading: isPending, children: t5("resetPassword.resetPassword") })
|
|
192390
192501
|
]
|
|
192391
192502
|
}
|
|
192392
192503
|
) }) }),
|
|
192393
|
-
/* @__PURE__ */ (0,
|
|
192504
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("span", { className: "txt-small my-6", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192394
192505
|
import_react_i18next489.Trans,
|
|
192395
192506
|
{
|
|
192396
192507
|
i18nKey: "resetPassword.backToLogin",
|
|
192397
192508
|
components: [
|
|
192398
|
-
/* @__PURE__ */ (0,
|
|
192399
|
-
|
|
192509
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192510
|
+
import_react_router_dom250.Link,
|
|
192400
192511
|
{
|
|
192401
192512
|
to: "/login",
|
|
192402
192513
|
className: "text-ui-fg-base transition-fg hover:text-ui-fg-base-hover focus-visible:text-ui-fg-base-hover outline-none"
|
|
@@ -192410,7 +192521,7 @@ var init_reset_password = __esm({
|
|
|
192410
192521
|
};
|
|
192411
192522
|
ResetPassword = () => {
|
|
192412
192523
|
const { t: t5 } = (0, import_react_i18next489.useTranslation)();
|
|
192413
|
-
const [searchParams] = (0,
|
|
192524
|
+
const [searchParams] = (0, import_react_router_dom250.useSearchParams)();
|
|
192414
192525
|
const [showAlert, setShowAlert] = (0, import_react311.useState)(false);
|
|
192415
192526
|
const token = searchParams.get("token");
|
|
192416
192527
|
const form = (0, import_react_hook_form147.useForm)({
|
|
@@ -192437,28 +192548,28 @@ var init_reset_password = __esm({
|
|
|
192437
192548
|
);
|
|
192438
192549
|
});
|
|
192439
192550
|
if (token) {
|
|
192440
|
-
return /* @__PURE__ */ (0,
|
|
192551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(ChooseNewPassword, { token });
|
|
192441
192552
|
}
|
|
192442
|
-
return /* @__PURE__ */ (0,
|
|
192443
|
-
/* @__PURE__ */ (0,
|
|
192444
|
-
/* @__PURE__ */ (0,
|
|
192445
|
-
/* @__PURE__ */ (0,
|
|
192446
|
-
/* @__PURE__ */ (0,
|
|
192553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime696.jsx)("div", { className: "bg-ui-bg-base flex min-h-dvh w-dvw items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "m-4 flex w-full max-w-[300px] flex-col items-center", children: [
|
|
192554
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(LogoBox, { className: "mb-4" }),
|
|
192555
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "mb-4 flex flex-col items-center", children: [
|
|
192556
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Heading, { children: t5("resetPassword.resetPassword") }),
|
|
192557
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Text, { size: "small", className: "text-ui-fg-subtle text-center", children: t5("resetPassword.hint") })
|
|
192447
192558
|
] }),
|
|
192448
|
-
/* @__PURE__ */ (0,
|
|
192559
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("div", { className: "flex w-full flex-col gap-y-3", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)(
|
|
192449
192560
|
"form",
|
|
192450
192561
|
{
|
|
192451
192562
|
onSubmit: handleSubmit,
|
|
192452
192563
|
className: "flex w-full flex-col gap-y-6",
|
|
192453
192564
|
children: [
|
|
192454
|
-
/* @__PURE__ */ (0,
|
|
192565
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("div", { className: "mt-4 flex flex-col gap-y-3", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192455
192566
|
Form.Field,
|
|
192456
192567
|
{
|
|
192457
192568
|
control: form.control,
|
|
192458
192569
|
name: "email",
|
|
192459
192570
|
render: ({ field }) => {
|
|
192460
|
-
return /* @__PURE__ */ (0,
|
|
192461
|
-
/* @__PURE__ */ (0,
|
|
192571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)(Form.Item, { children: [
|
|
192572
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192462
192573
|
import_ui457.Input,
|
|
192463
192574
|
{
|
|
192464
192575
|
autoComplete: "email",
|
|
@@ -192466,26 +192577,26 @@ var init_reset_password = __esm({
|
|
|
192466
192577
|
placeholder: t5("fields.email")
|
|
192467
192578
|
}
|
|
192468
192579
|
) }),
|
|
192469
|
-
/* @__PURE__ */ (0,
|
|
192580
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(Form.ErrorMessage, {})
|
|
192470
192581
|
] });
|
|
192471
192582
|
}
|
|
192472
192583
|
}
|
|
192473
192584
|
) }),
|
|
192474
|
-
showAlert && /* @__PURE__ */ (0,
|
|
192475
|
-
/* @__PURE__ */ (0,
|
|
192476
|
-
/* @__PURE__ */ (0,
|
|
192585
|
+
showAlert && /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Alert, { dismissible: true, variant: "success", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsxs)("div", { className: "flex flex-col", children: [
|
|
192586
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("span", { className: "text-ui-fg-base mb-1", children: t5("resetPassword.successfulRequestTitle") }),
|
|
192587
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("span", { children: t5("resetPassword.successfulRequest") })
|
|
192477
192588
|
] }) }),
|
|
192478
|
-
/* @__PURE__ */ (0,
|
|
192589
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(import_ui457.Button, { className: "w-full", type: "submit", isLoading: isPending, children: t5("resetPassword.sendResetInstructions") })
|
|
192479
192590
|
]
|
|
192480
192591
|
}
|
|
192481
192592
|
) }) }),
|
|
192482
|
-
/* @__PURE__ */ (0,
|
|
192593
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)("span", { className: "txt-small my-6", children: /* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192483
192594
|
import_react_i18next489.Trans,
|
|
192484
192595
|
{
|
|
192485
192596
|
i18nKey: "resetPassword.backToLogin",
|
|
192486
192597
|
components: [
|
|
192487
|
-
/* @__PURE__ */ (0,
|
|
192488
|
-
|
|
192598
|
+
/* @__PURE__ */ (0, import_jsx_runtime696.jsx)(
|
|
192599
|
+
import_react_router_dom250.Link,
|
|
192489
192600
|
{
|
|
192490
192601
|
to: "/login",
|
|
192491
192602
|
className: "text-ui-fg-base transition-fg hover:text-ui-fg-base-hover focus-visible:text-ui-fg-base-hover outline-none"
|
|
@@ -192513,7 +192624,7 @@ var init_reset_password2 = __esm({
|
|
|
192513
192624
|
});
|
|
192514
192625
|
|
|
192515
192626
|
// src/routes/invite/invite.tsx
|
|
192516
|
-
var import_zod170, import_ui458, import_i18next8, import_react312, import_react313, import_react_hook_form148, import_react_i18next490, import_react_jwt2,
|
|
192627
|
+
var import_zod170, import_ui458, import_i18next8, import_react312, import_react313, import_react_hook_form148, import_react_i18next490, import_react_jwt2, import_react_router_dom251, z66, import_jsx_runtime697, CreateAccountSchema, Invite, LoginLink, InvalidView, CreateView, SuccessView, InviteSchema, validateDecodedInvite;
|
|
192517
192628
|
var init_invite = __esm({
|
|
192518
192629
|
"src/routes/invite/invite.tsx"() {
|
|
192519
192630
|
"use strict";
|
|
@@ -192525,14 +192636,14 @@ var init_invite = __esm({
|
|
|
192525
192636
|
import_react_hook_form148 = require("react-hook-form");
|
|
192526
192637
|
import_react_i18next490 = require("react-i18next");
|
|
192527
192638
|
import_react_jwt2 = require("react-jwt");
|
|
192528
|
-
|
|
192639
|
+
import_react_router_dom251 = require("react-router-dom");
|
|
192529
192640
|
z66 = __toESM(require("zod"));
|
|
192530
192641
|
init_form2();
|
|
192531
192642
|
init_avatar_box();
|
|
192532
192643
|
init_auth();
|
|
192533
192644
|
init_invites();
|
|
192534
192645
|
init_is_fetch_error();
|
|
192535
|
-
|
|
192646
|
+
import_jsx_runtime697 = require("react/jsx-runtime");
|
|
192536
192647
|
CreateAccountSchema = z66.object({
|
|
192537
192648
|
email: z66.string().email(),
|
|
192538
192649
|
first_name: z66.string().min(1),
|
|
@@ -192549,14 +192660,14 @@ var init_invite = __esm({
|
|
|
192549
192660
|
}
|
|
192550
192661
|
});
|
|
192551
192662
|
Invite = () => {
|
|
192552
|
-
const [searchParams] = (0,
|
|
192663
|
+
const [searchParams] = (0, import_react_router_dom251.useSearchParams)();
|
|
192553
192664
|
const [success, setSuccess] = (0, import_react313.useState)(false);
|
|
192554
192665
|
const token = searchParams.get("token");
|
|
192555
192666
|
const invite = token ? (0, import_react_jwt2.decodeToken)(token) : null;
|
|
192556
192667
|
const isValidInvite = invite && validateDecodedInvite(invite);
|
|
192557
|
-
return /* @__PURE__ */ (0,
|
|
192558
|
-
/* @__PURE__ */ (0,
|
|
192559
|
-
/* @__PURE__ */ (0,
|
|
192668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsx)("div", { className: "bg-ui-bg-subtle relative flex min-h-dvh w-dvw items-center justify-center p-4", children: /* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("div", { className: "flex w-full max-w-[360px] flex-col items-center", children: [
|
|
192669
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(AvatarBox, { checked: success }),
|
|
192670
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)("div", { className: "max-h-[557px] w-full will-change-contents", children: isValidInvite ? /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_react312.AnimatePresence, { children: !success ? /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192560
192671
|
import_react312.motion.div,
|
|
192561
192672
|
{
|
|
192562
192673
|
initial: false,
|
|
@@ -192574,7 +192685,7 @@ var init_invite = __esm({
|
|
|
192574
192685
|
ease: [0, 0.71, 0.2, 1.01]
|
|
192575
192686
|
},
|
|
192576
192687
|
className: "w-full will-change-transform",
|
|
192577
|
-
children: /* @__PURE__ */ (0,
|
|
192688
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192578
192689
|
import_react312.motion.div,
|
|
192579
192690
|
{
|
|
192580
192691
|
initial: false,
|
|
@@ -192591,7 +192702,7 @@ var init_invite = __esm({
|
|
|
192591
192702
|
delay: 0,
|
|
192592
192703
|
ease: [0, 0.71, 0.2, 1.01]
|
|
192593
192704
|
},
|
|
192594
|
-
children: /* @__PURE__ */ (0,
|
|
192705
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192595
192706
|
CreateView,
|
|
192596
192707
|
{
|
|
192597
192708
|
onSuccess: () => setSuccess(true),
|
|
@@ -192604,7 +192715,7 @@ var init_invite = __esm({
|
|
|
192604
192715
|
)
|
|
192605
192716
|
},
|
|
192606
192717
|
"create-account"
|
|
192607
|
-
) : /* @__PURE__ */ (0,
|
|
192718
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192608
192719
|
import_react312.motion.div,
|
|
192609
192720
|
{
|
|
192610
192721
|
initial: {
|
|
@@ -192621,18 +192732,18 @@ var init_invite = __esm({
|
|
|
192621
192732
|
ease: [0, 0.71, 0.2, 1.01]
|
|
192622
192733
|
},
|
|
192623
192734
|
className: "w-full",
|
|
192624
|
-
children: /* @__PURE__ */ (0,
|
|
192735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(SuccessView, {})
|
|
192625
192736
|
},
|
|
192626
192737
|
"success-view"
|
|
192627
|
-
) }) : /* @__PURE__ */ (0,
|
|
192738
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(InvalidView, {}) })
|
|
192628
192739
|
] }) });
|
|
192629
192740
|
};
|
|
192630
192741
|
LoginLink = () => {
|
|
192631
192742
|
const { t: t5 } = (0, import_react_i18next490.useTranslation)();
|
|
192632
|
-
return /* @__PURE__ */ (0,
|
|
192633
|
-
/* @__PURE__ */ (0,
|
|
192634
|
-
/* @__PURE__ */ (0,
|
|
192635
|
-
|
|
192743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("div", { className: "flex w-full flex-col items-center", children: [
|
|
192744
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)("div", { className: "my-6 h-px w-full border-b border-dotted" }),
|
|
192745
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192746
|
+
import_react_router_dom251.Link,
|
|
192636
192747
|
{
|
|
192637
192748
|
to: "/login",
|
|
192638
192749
|
className: "txt-small text-ui-fg-base transition-fg hover:text-ui-fg-base-hover focus-visible:text-ui-fg-base-hover font-medium outline-none",
|
|
@@ -192644,12 +192755,12 @@ var init_invite = __esm({
|
|
|
192644
192755
|
};
|
|
192645
192756
|
InvalidView = () => {
|
|
192646
192757
|
const { t: t5 } = (0, import_react_i18next490.useTranslation)();
|
|
192647
|
-
return /* @__PURE__ */ (0,
|
|
192648
|
-
/* @__PURE__ */ (0,
|
|
192649
|
-
/* @__PURE__ */ (0,
|
|
192650
|
-
/* @__PURE__ */ (0,
|
|
192758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
192759
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("div", { className: "flex flex-col items-center gap-y-1", children: [
|
|
192760
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_ui458.Heading, { children: t5("invite.invalidTokenTitle") }),
|
|
192761
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_ui458.Text, { size: "small", className: "text-ui-fg-subtle text-center", children: t5("invite.invalidTokenHint") })
|
|
192651
192762
|
] }),
|
|
192652
|
-
/* @__PURE__ */ (0,
|
|
192763
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(LoginLink, {})
|
|
192653
192764
|
] });
|
|
192654
192765
|
};
|
|
192655
192766
|
CreateView = ({
|
|
@@ -192659,7 +192770,7 @@ var init_invite = __esm({
|
|
|
192659
192770
|
}) => {
|
|
192660
192771
|
const { t: t5 } = (0, import_react_i18next490.useTranslation)();
|
|
192661
192772
|
const [invalid, setInvalid] = (0, import_react313.useState)(false);
|
|
192662
|
-
const [params2] = (0,
|
|
192773
|
+
const [params2] = (0, import_react_router_dom251.useSearchParams)();
|
|
192663
192774
|
const isFirstRun = params2.get("first_run") === "true";
|
|
192664
192775
|
const form = (0, import_react_hook_form148.useForm)({
|
|
192665
192776
|
resolver: (0, import_zod170.zodResolver)(CreateAccountSchema),
|
|
@@ -192707,20 +192818,20 @@ var init_invite = __esm({
|
|
|
192707
192818
|
});
|
|
192708
192819
|
const serverError = form.formState.errors.root?.message;
|
|
192709
192820
|
const validationError = form.formState.errors.email?.message || form.formState.errors.password?.message || form.formState.errors.repeat_password?.message || form.formState.errors.first_name?.message || form.formState.errors.last_name?.message;
|
|
192710
|
-
return /* @__PURE__ */ (0,
|
|
192711
|
-
/* @__PURE__ */ (0,
|
|
192712
|
-
/* @__PURE__ */ (0,
|
|
192713
|
-
/* @__PURE__ */ (0,
|
|
192821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("div", { className: "flex w-full flex-col items-center", children: [
|
|
192822
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("div", { className: "mb-4 flex flex-col items-center", children: [
|
|
192823
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_ui458.Heading, { children: t5("invite.title") }),
|
|
192824
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_ui458.Text, { size: "small", className: "text-ui-fg-subtle text-center", children: t5("invite.hint") })
|
|
192714
192825
|
] }),
|
|
192715
|
-
/* @__PURE__ */ (0,
|
|
192716
|
-
/* @__PURE__ */ (0,
|
|
192717
|
-
/* @__PURE__ */ (0,
|
|
192826
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("form", { onSubmit: handleSubmit, className: "flex w-full flex-col gap-y-6", children: [
|
|
192827
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("div", { className: "flex flex-col gap-y-2", children: [
|
|
192828
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192718
192829
|
Form.Field,
|
|
192719
192830
|
{
|
|
192720
192831
|
control: form.control,
|
|
192721
192832
|
name: "email",
|
|
192722
192833
|
render: ({ field }) => {
|
|
192723
|
-
return /* @__PURE__ */ (0,
|
|
192834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192724
192835
|
import_ui458.Input,
|
|
192725
192836
|
{
|
|
192726
192837
|
autoComplete: "off",
|
|
@@ -192732,13 +192843,13 @@ var init_invite = __esm({
|
|
|
192732
192843
|
}
|
|
192733
192844
|
}
|
|
192734
192845
|
),
|
|
192735
|
-
/* @__PURE__ */ (0,
|
|
192846
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192736
192847
|
Form.Field,
|
|
192737
192848
|
{
|
|
192738
192849
|
control: form.control,
|
|
192739
192850
|
name: "first_name",
|
|
192740
192851
|
render: ({ field }) => {
|
|
192741
|
-
return /* @__PURE__ */ (0,
|
|
192852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192742
192853
|
import_ui458.Input,
|
|
192743
192854
|
{
|
|
192744
192855
|
autoComplete: "given-name",
|
|
@@ -192750,13 +192861,13 @@ var init_invite = __esm({
|
|
|
192750
192861
|
}
|
|
192751
192862
|
}
|
|
192752
192863
|
),
|
|
192753
|
-
/* @__PURE__ */ (0,
|
|
192864
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192754
192865
|
Form.Field,
|
|
192755
192866
|
{
|
|
192756
192867
|
control: form.control,
|
|
192757
192868
|
name: "last_name",
|
|
192758
192869
|
render: ({ field }) => {
|
|
192759
|
-
return /* @__PURE__ */ (0,
|
|
192870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192760
192871
|
import_ui458.Input,
|
|
192761
192872
|
{
|
|
192762
192873
|
autoComplete: "family-name",
|
|
@@ -192768,13 +192879,13 @@ var init_invite = __esm({
|
|
|
192768
192879
|
}
|
|
192769
192880
|
}
|
|
192770
192881
|
),
|
|
192771
|
-
/* @__PURE__ */ (0,
|
|
192882
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192772
192883
|
Form.Field,
|
|
192773
192884
|
{
|
|
192774
192885
|
control: form.control,
|
|
192775
192886
|
name: "password",
|
|
192776
192887
|
render: ({ field }) => {
|
|
192777
|
-
return /* @__PURE__ */ (0,
|
|
192888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192778
192889
|
import_ui458.Input,
|
|
192779
192890
|
{
|
|
192780
192891
|
autoComplete: "new-password",
|
|
@@ -192787,13 +192898,13 @@ var init_invite = __esm({
|
|
|
192787
192898
|
}
|
|
192788
192899
|
}
|
|
192789
192900
|
),
|
|
192790
|
-
/* @__PURE__ */ (0,
|
|
192901
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192791
192902
|
Form.Field,
|
|
192792
192903
|
{
|
|
192793
192904
|
control: form.control,
|
|
192794
192905
|
name: "repeat_password",
|
|
192795
192906
|
render: ({ field }) => {
|
|
192796
|
-
return /* @__PURE__ */ (0,
|
|
192907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192797
192908
|
import_ui458.Input,
|
|
192798
192909
|
{
|
|
192799
192910
|
autoComplete: "off",
|
|
@@ -192806,8 +192917,8 @@ var init_invite = __esm({
|
|
|
192806
192917
|
}
|
|
192807
192918
|
}
|
|
192808
192919
|
),
|
|
192809
|
-
validationError && /* @__PURE__ */ (0,
|
|
192810
|
-
serverError && /* @__PURE__ */ (0,
|
|
192920
|
+
validationError && /* @__PURE__ */ (0, import_jsx_runtime697.jsx)("div", { className: "mt-6 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_ui458.Hint, { className: "inline-flex", variant: "error", children: validationError }) }),
|
|
192921
|
+
serverError && /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192811
192922
|
import_ui458.Alert,
|
|
192812
192923
|
{
|
|
192813
192924
|
className: "bg-ui-bg-base items-center p-2",
|
|
@@ -192817,7 +192928,7 @@ var init_invite = __esm({
|
|
|
192817
192928
|
}
|
|
192818
192929
|
)
|
|
192819
192930
|
] }),
|
|
192820
|
-
/* @__PURE__ */ (0,
|
|
192931
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192821
192932
|
import_ui458.Button,
|
|
192822
192933
|
{
|
|
192823
192934
|
className: "w-full",
|
|
@@ -192828,19 +192939,19 @@ var init_invite = __esm({
|
|
|
192828
192939
|
}
|
|
192829
192940
|
)
|
|
192830
192941
|
] }) }),
|
|
192831
|
-
/* @__PURE__ */ (0,
|
|
192942
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(LoginLink, {})
|
|
192832
192943
|
] });
|
|
192833
192944
|
};
|
|
192834
192945
|
SuccessView = () => {
|
|
192835
192946
|
const { t: t5 } = (0, import_react_i18next490.useTranslation)();
|
|
192836
|
-
return /* @__PURE__ */ (0,
|
|
192837
|
-
/* @__PURE__ */ (0,
|
|
192838
|
-
/* @__PURE__ */ (0,
|
|
192839
|
-
/* @__PURE__ */ (0,
|
|
192947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("div", { className: "flex w-full flex-col items-center gap-y-6", children: [
|
|
192948
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsxs)("div", { className: "flex flex-col items-center gap-y-1", children: [
|
|
192949
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_ui458.Heading, { className: "text-center", children: t5("invite.successTitle") }),
|
|
192950
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_ui458.Text, { size: "small", className: "text-ui-fg-subtle text-center", children: t5("invite.successHint") })
|
|
192840
192951
|
] }),
|
|
192841
|
-
/* @__PURE__ */ (0,
|
|
192842
|
-
/* @__PURE__ */ (0,
|
|
192843
|
-
|
|
192952
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_ui458.Button, { variant: "secondary", asChild: true, className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime697.jsx)(import_react_router_dom251.Link, { to: "/login", replace: true, children: t5("invite.successAction") }) }),
|
|
192953
|
+
/* @__PURE__ */ (0, import_jsx_runtime697.jsx)(
|
|
192954
|
+
import_react_router_dom251.Link,
|
|
192844
192955
|
{
|
|
192845
192956
|
to: "/login",
|
|
192846
192957
|
className: "txt-small text-ui-fg-base transition-fg hover:text-ui-fg-base-hover focus-visible:text-ui-fg-base-hover font-medium outline-none",
|
|
@@ -192875,25 +192986,25 @@ var init_invite2 = __esm({
|
|
|
192875
192986
|
});
|
|
192876
192987
|
|
|
192877
192988
|
// src/routes/no-match/no-match.tsx
|
|
192878
|
-
var import_icons175, import_ui459, import_react_i18next491,
|
|
192989
|
+
var import_icons175, import_ui459, import_react_i18next491, import_react_router_dom252, import_jsx_runtime698, NoMatch;
|
|
192879
192990
|
var init_no_match = __esm({
|
|
192880
192991
|
"src/routes/no-match/no-match.tsx"() {
|
|
192881
192992
|
"use strict";
|
|
192882
192993
|
import_icons175 = require("@medusajs/icons");
|
|
192883
192994
|
import_ui459 = require("@medusajs/ui");
|
|
192884
192995
|
import_react_i18next491 = require("react-i18next");
|
|
192885
|
-
|
|
192886
|
-
|
|
192996
|
+
import_react_router_dom252 = require("react-router-dom");
|
|
192997
|
+
import_jsx_runtime698 = require("react/jsx-runtime");
|
|
192887
192998
|
NoMatch = () => {
|
|
192888
192999
|
const { t: t5 } = (0, import_react_i18next491.useTranslation)();
|
|
192889
193000
|
const title = t5("errorBoundary.notFoundTitle");
|
|
192890
193001
|
const message = t5("errorBoundary.noMatchMessage");
|
|
192891
|
-
return /* @__PURE__ */ (0,
|
|
192892
|
-
/* @__PURE__ */ (0,
|
|
192893
|
-
/* @__PURE__ */ (0,
|
|
192894
|
-
/* @__PURE__ */ (0,
|
|
192895
|
-
/* @__PURE__ */ (0,
|
|
192896
|
-
/* @__PURE__ */ (0,
|
|
193002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime698.jsx)("div", { className: "flex size-full min-h-screen items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime698.jsxs)("div", { className: "flex flex-col items-center gap-y-6", children: [
|
|
193003
|
+
/* @__PURE__ */ (0, import_jsx_runtime698.jsxs)("div", { className: "text-ui-fg-subtle flex flex-col items-center gap-y-3", children: [
|
|
193004
|
+
/* @__PURE__ */ (0, import_jsx_runtime698.jsx)(import_icons175.ExclamationCircle, {}),
|
|
193005
|
+
/* @__PURE__ */ (0, import_jsx_runtime698.jsxs)("div", { className: "flex flex-col items-center justify-center gap-y-1", children: [
|
|
193006
|
+
/* @__PURE__ */ (0, import_jsx_runtime698.jsx)(import_ui459.Text, { size: "small", leading: "compact", weight: "plus", children: title }),
|
|
193007
|
+
/* @__PURE__ */ (0, import_jsx_runtime698.jsx)(
|
|
192897
193008
|
import_ui459.Text,
|
|
192898
193009
|
{
|
|
192899
193010
|
size: "small",
|
|
@@ -192903,7 +193014,7 @@ var init_no_match = __esm({
|
|
|
192903
193014
|
)
|
|
192904
193015
|
] })
|
|
192905
193016
|
] }),
|
|
192906
|
-
/* @__PURE__ */ (0,
|
|
193017
|
+
/* @__PURE__ */ (0, import_jsx_runtime698.jsx)(import_ui459.Button, { asChild: true, size: "small", variant: "secondary", children: /* @__PURE__ */ (0, import_jsx_runtime698.jsx)(import_react_router_dom252.Link, { to: "/", children: t5("errorBoundary.backToDashboard") }) })
|
|
192907
193018
|
] }) });
|
|
192908
193019
|
};
|
|
192909
193020
|
}
|
|
@@ -192928,20 +193039,20 @@ function getRouteMap({
|
|
|
192928
193039
|
}) {
|
|
192929
193040
|
return [
|
|
192930
193041
|
{
|
|
192931
|
-
element: /* @__PURE__ */ (0,
|
|
192932
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193042
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ProtectedRoute, {}),
|
|
193043
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
192933
193044
|
children: [
|
|
192934
193045
|
{
|
|
192935
|
-
element: /* @__PURE__ */ (0,
|
|
193046
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(MainLayout, {}),
|
|
192936
193047
|
children: [
|
|
192937
193048
|
{
|
|
192938
193049
|
path: "/",
|
|
192939
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193050
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
192940
193051
|
lazy: () => Promise.resolve().then(() => (init_home2(), home_exports))
|
|
192941
193052
|
},
|
|
192942
193053
|
{
|
|
192943
193054
|
path: "/products",
|
|
192944
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193055
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
192945
193056
|
handle: {
|
|
192946
193057
|
breadcrumb: () => (0, import_i18next9.t)("products.domain")
|
|
192947
193058
|
},
|
|
@@ -192966,14 +193077,14 @@ function getRouteMap({
|
|
|
192966
193077
|
},
|
|
192967
193078
|
{
|
|
192968
193079
|
path: ":id",
|
|
192969
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193080
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
192970
193081
|
lazy: async () => {
|
|
192971
193082
|
const { Breadcrumb, loader } = await Promise.resolve().then(() => (init_product_detail2(), product_detail_exports));
|
|
192972
193083
|
return {
|
|
192973
|
-
Component:
|
|
193084
|
+
Component: import_react_router_dom253.Outlet,
|
|
192974
193085
|
loader,
|
|
192975
193086
|
handle: {
|
|
192976
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193087
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
192977
193088
|
}
|
|
192978
193089
|
};
|
|
192979
193090
|
},
|
|
@@ -193048,7 +193159,7 @@ function getRouteMap({
|
|
|
193048
193159
|
Component: Component5,
|
|
193049
193160
|
loader,
|
|
193050
193161
|
handle: {
|
|
193051
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193162
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193052
193163
|
}
|
|
193053
193164
|
};
|
|
193054
193165
|
},
|
|
@@ -193081,7 +193192,7 @@ function getRouteMap({
|
|
|
193081
193192
|
},
|
|
193082
193193
|
{
|
|
193083
193194
|
path: "/categories",
|
|
193084
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193195
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193085
193196
|
handle: {
|
|
193086
193197
|
breadcrumb: () => (0, import_i18next9.t)("categories.domain")
|
|
193087
193198
|
},
|
|
@@ -193108,7 +193219,7 @@ function getRouteMap({
|
|
|
193108
193219
|
Component: Component5,
|
|
193109
193220
|
loader,
|
|
193110
193221
|
handle: {
|
|
193111
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193222
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193112
193223
|
}
|
|
193113
193224
|
};
|
|
193114
193225
|
},
|
|
@@ -193135,7 +193246,7 @@ function getRouteMap({
|
|
|
193135
193246
|
},
|
|
193136
193247
|
{
|
|
193137
193248
|
path: "/orders",
|
|
193138
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193249
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193139
193250
|
handle: {
|
|
193140
193251
|
breadcrumb: () => (0, import_i18next9.t)("orders.domain")
|
|
193141
193252
|
},
|
|
@@ -193158,7 +193269,7 @@ function getRouteMap({
|
|
|
193158
193269
|
Component: Component5,
|
|
193159
193270
|
loader,
|
|
193160
193271
|
handle: {
|
|
193161
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193272
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193162
193273
|
}
|
|
193163
193274
|
};
|
|
193164
193275
|
},
|
|
@@ -193225,7 +193336,7 @@ function getRouteMap({
|
|
|
193225
193336
|
},
|
|
193226
193337
|
{
|
|
193227
193338
|
path: "/promotions",
|
|
193228
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193339
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193229
193340
|
handle: {
|
|
193230
193341
|
breadcrumb: () => (0, import_i18next9.t)("promotions.domain")
|
|
193231
193342
|
},
|
|
@@ -193246,7 +193357,7 @@ function getRouteMap({
|
|
|
193246
193357
|
Component: Component5,
|
|
193247
193358
|
loader,
|
|
193248
193359
|
handle: {
|
|
193249
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193360
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193250
193361
|
}
|
|
193251
193362
|
};
|
|
193252
193363
|
},
|
|
@@ -193269,7 +193380,7 @@ function getRouteMap({
|
|
|
193269
193380
|
},
|
|
193270
193381
|
{
|
|
193271
193382
|
path: "/campaigns",
|
|
193272
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193383
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193273
193384
|
handle: {
|
|
193274
193385
|
breadcrumb: () => (0, import_i18next9.t)("campaigns.domain")
|
|
193275
193386
|
},
|
|
@@ -193291,7 +193402,7 @@ function getRouteMap({
|
|
|
193291
193402
|
Component: Component5,
|
|
193292
193403
|
loader,
|
|
193293
193404
|
handle: {
|
|
193294
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193405
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193295
193406
|
}
|
|
193296
193407
|
};
|
|
193297
193408
|
},
|
|
@@ -193318,7 +193429,7 @@ function getRouteMap({
|
|
|
193318
193429
|
},
|
|
193319
193430
|
{
|
|
193320
193431
|
path: "/collections",
|
|
193321
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193432
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193322
193433
|
handle: {
|
|
193323
193434
|
breadcrumb: () => (0, import_i18next9.t)("collections.domain")
|
|
193324
193435
|
},
|
|
@@ -193341,7 +193452,7 @@ function getRouteMap({
|
|
|
193341
193452
|
Component: Component5,
|
|
193342
193453
|
loader,
|
|
193343
193454
|
handle: {
|
|
193344
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193455
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193345
193456
|
}
|
|
193346
193457
|
};
|
|
193347
193458
|
},
|
|
@@ -193364,7 +193475,7 @@ function getRouteMap({
|
|
|
193364
193475
|
},
|
|
193365
193476
|
{
|
|
193366
193477
|
path: "/price-lists",
|
|
193367
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193478
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193368
193479
|
handle: {
|
|
193369
193480
|
breadcrumb: () => (0, import_i18next9.t)("priceLists.domain")
|
|
193370
193481
|
},
|
|
@@ -193387,7 +193498,7 @@ function getRouteMap({
|
|
|
193387
193498
|
Component: Component5,
|
|
193388
193499
|
loader,
|
|
193389
193500
|
handle: {
|
|
193390
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193501
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193391
193502
|
}
|
|
193392
193503
|
};
|
|
193393
193504
|
},
|
|
@@ -193414,7 +193525,7 @@ function getRouteMap({
|
|
|
193414
193525
|
},
|
|
193415
193526
|
{
|
|
193416
193527
|
path: "/customers",
|
|
193417
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193528
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193418
193529
|
handle: {
|
|
193419
193530
|
breadcrumb: () => (0, import_i18next9.t)("customers.domain")
|
|
193420
193531
|
},
|
|
@@ -193437,7 +193548,7 @@ function getRouteMap({
|
|
|
193437
193548
|
Component: Component5,
|
|
193438
193549
|
loader,
|
|
193439
193550
|
handle: {
|
|
193440
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193551
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193441
193552
|
}
|
|
193442
193553
|
};
|
|
193443
193554
|
},
|
|
@@ -193468,7 +193579,7 @@ function getRouteMap({
|
|
|
193468
193579
|
},
|
|
193469
193580
|
{
|
|
193470
193581
|
path: "/customer-groups",
|
|
193471
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193582
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193472
193583
|
handle: {
|
|
193473
193584
|
breadcrumb: () => (0, import_i18next9.t)("customerGroups.domain")
|
|
193474
193585
|
},
|
|
@@ -193491,7 +193602,7 @@ function getRouteMap({
|
|
|
193491
193602
|
Component: Component5,
|
|
193492
193603
|
loader,
|
|
193493
193604
|
handle: {
|
|
193494
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193605
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193495
193606
|
}
|
|
193496
193607
|
};
|
|
193497
193608
|
},
|
|
@@ -193514,7 +193625,7 @@ function getRouteMap({
|
|
|
193514
193625
|
},
|
|
193515
193626
|
{
|
|
193516
193627
|
path: "/reservations",
|
|
193517
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193628
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193518
193629
|
handle: {
|
|
193519
193630
|
breadcrumb: () => (0, import_i18next9.t)("reservations.domain")
|
|
193520
193631
|
},
|
|
@@ -193537,7 +193648,7 @@ function getRouteMap({
|
|
|
193537
193648
|
Component: Component5,
|
|
193538
193649
|
loader,
|
|
193539
193650
|
handle: {
|
|
193540
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193651
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193541
193652
|
}
|
|
193542
193653
|
};
|
|
193543
193654
|
},
|
|
@@ -193556,7 +193667,7 @@ function getRouteMap({
|
|
|
193556
193667
|
},
|
|
193557
193668
|
{
|
|
193558
193669
|
path: "/inventory",
|
|
193559
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193670
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193560
193671
|
handle: {
|
|
193561
193672
|
breadcrumb: () => (0, import_i18next9.t)("inventory.domain")
|
|
193562
193673
|
},
|
|
@@ -193583,7 +193694,7 @@ function getRouteMap({
|
|
|
193583
193694
|
Component: Component5,
|
|
193584
193695
|
loader,
|
|
193585
193696
|
handle: {
|
|
193586
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193697
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193587
193698
|
}
|
|
193588
193699
|
};
|
|
193589
193700
|
},
|
|
@@ -193618,24 +193729,24 @@ function getRouteMap({
|
|
|
193618
193729
|
]
|
|
193619
193730
|
},
|
|
193620
193731
|
{
|
|
193621
|
-
element: /* @__PURE__ */ (0,
|
|
193622
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193732
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ProtectedRoute, {}),
|
|
193733
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193623
193734
|
children: [
|
|
193624
193735
|
{
|
|
193625
193736
|
path: "/settings",
|
|
193626
193737
|
handle: {
|
|
193627
193738
|
breadcrumb: () => (0, import_i18next9.t)("app.nav.settings.header")
|
|
193628
193739
|
},
|
|
193629
|
-
element: /* @__PURE__ */ (0,
|
|
193740
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(SettingsLayout, {}),
|
|
193630
193741
|
children: [
|
|
193631
193742
|
{
|
|
193632
193743
|
index: true,
|
|
193633
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193744
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193634
193745
|
lazy: () => Promise.resolve().then(() => (init_settings2(), settings_exports))
|
|
193635
193746
|
},
|
|
193636
193747
|
{
|
|
193637
193748
|
path: "profile",
|
|
193638
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193749
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193639
193750
|
lazy: () => Promise.resolve().then(() => (init_profile_detail2(), profile_detail_exports)),
|
|
193640
193751
|
handle: {
|
|
193641
193752
|
breadcrumb: () => (0, import_i18next9.t)("profile.domain")
|
|
@@ -193649,8 +193760,8 @@ function getRouteMap({
|
|
|
193649
193760
|
},
|
|
193650
193761
|
{
|
|
193651
193762
|
path: "regions",
|
|
193652
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193653
|
-
element: /* @__PURE__ */ (0,
|
|
193763
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193764
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
193654
193765
|
handle: {
|
|
193655
193766
|
breadcrumb: () => (0, import_i18next9.t)("regions.domain")
|
|
193656
193767
|
},
|
|
@@ -193673,7 +193784,7 @@ function getRouteMap({
|
|
|
193673
193784
|
Component: Component5,
|
|
193674
193785
|
loader,
|
|
193675
193786
|
handle: {
|
|
193676
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193787
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193677
193788
|
}
|
|
193678
193789
|
};
|
|
193679
193790
|
},
|
|
@@ -193696,7 +193807,7 @@ function getRouteMap({
|
|
|
193696
193807
|
},
|
|
193697
193808
|
{
|
|
193698
193809
|
path: "store",
|
|
193699
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193810
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193700
193811
|
lazy: () => Promise.resolve().then(() => (init_store_detail2(), store_detail_exports)),
|
|
193701
193812
|
handle: {
|
|
193702
193813
|
breadcrumb: () => (0, import_i18next9.t)("store.domain")
|
|
@@ -193722,8 +193833,8 @@ function getRouteMap({
|
|
|
193722
193833
|
},
|
|
193723
193834
|
{
|
|
193724
193835
|
path: "users",
|
|
193725
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193726
|
-
element: /* @__PURE__ */ (0,
|
|
193836
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193837
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
193727
193838
|
handle: {
|
|
193728
193839
|
breadcrumb: () => (0, import_i18next9.t)("users.domain")
|
|
193729
193840
|
},
|
|
@@ -193746,7 +193857,7 @@ function getRouteMap({
|
|
|
193746
193857
|
Component: Component5,
|
|
193747
193858
|
loader,
|
|
193748
193859
|
handle: {
|
|
193749
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193860
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193750
193861
|
}
|
|
193751
193862
|
};
|
|
193752
193863
|
},
|
|
@@ -193765,8 +193876,8 @@ function getRouteMap({
|
|
|
193765
193876
|
},
|
|
193766
193877
|
{
|
|
193767
193878
|
path: "sales-channels",
|
|
193768
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193769
|
-
element: /* @__PURE__ */ (0,
|
|
193879
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193880
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
193770
193881
|
handle: {
|
|
193771
193882
|
breadcrumb: () => (0, import_i18next9.t)("salesChannels.domain")
|
|
193772
193883
|
},
|
|
@@ -193789,7 +193900,7 @@ function getRouteMap({
|
|
|
193789
193900
|
Component: Component5,
|
|
193790
193901
|
loader,
|
|
193791
193902
|
handle: {
|
|
193792
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193903
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193793
193904
|
}
|
|
193794
193905
|
};
|
|
193795
193906
|
},
|
|
@@ -193812,8 +193923,8 @@ function getRouteMap({
|
|
|
193812
193923
|
},
|
|
193813
193924
|
{
|
|
193814
193925
|
path: "locations",
|
|
193815
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193816
|
-
element: /* @__PURE__ */ (0,
|
|
193926
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193927
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
193817
193928
|
handle: {
|
|
193818
193929
|
breadcrumb: () => (0, import_i18next9.t)("locations.domain")
|
|
193819
193930
|
},
|
|
@@ -193828,7 +193939,7 @@ function getRouteMap({
|
|
|
193828
193939
|
},
|
|
193829
193940
|
{
|
|
193830
193941
|
path: "shipping-profiles",
|
|
193831
|
-
element: /* @__PURE__ */ (0,
|
|
193942
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
193832
193943
|
handle: {
|
|
193833
193944
|
breadcrumb: () => (0, import_i18next9.t)("shippingProfile.domain")
|
|
193834
193945
|
},
|
|
@@ -193851,7 +193962,7 @@ function getRouteMap({
|
|
|
193851
193962
|
Component: Component5,
|
|
193852
193963
|
loader,
|
|
193853
193964
|
handle: {
|
|
193854
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
193965
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193855
193966
|
}
|
|
193856
193967
|
};
|
|
193857
193968
|
},
|
|
@@ -193866,8 +193977,8 @@ function getRouteMap({
|
|
|
193866
193977
|
},
|
|
193867
193978
|
{
|
|
193868
193979
|
path: "shipping-option-types",
|
|
193869
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193870
|
-
element: /* @__PURE__ */ (0,
|
|
193980
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
193981
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
193871
193982
|
handle: {
|
|
193872
193983
|
breadcrumb: () => (0, import_i18next9.t)("shippingOptionTypes.domain")
|
|
193873
193984
|
},
|
|
@@ -193890,7 +194001,7 @@ function getRouteMap({
|
|
|
193890
194001
|
Component: Component5,
|
|
193891
194002
|
loader,
|
|
193892
194003
|
handle: {
|
|
193893
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
194004
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193894
194005
|
}
|
|
193895
194006
|
};
|
|
193896
194007
|
},
|
|
@@ -193911,7 +194022,7 @@ function getRouteMap({
|
|
|
193911
194022
|
Component: Component5,
|
|
193912
194023
|
loader,
|
|
193913
194024
|
handle: {
|
|
193914
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
194025
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
193915
194026
|
}
|
|
193916
194027
|
};
|
|
193917
194028
|
},
|
|
@@ -193978,8 +194089,8 @@ function getRouteMap({
|
|
|
193978
194089
|
},
|
|
193979
194090
|
{
|
|
193980
194091
|
path: "product-tags",
|
|
193981
|
-
errorElement: /* @__PURE__ */ (0,
|
|
193982
|
-
element: /* @__PURE__ */ (0,
|
|
194092
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
194093
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
193983
194094
|
handle: {
|
|
193984
194095
|
breadcrumb: () => (0, import_i18next9.t)("productTags.domain")
|
|
193985
194096
|
},
|
|
@@ -194002,7 +194113,7 @@ function getRouteMap({
|
|
|
194002
194113
|
Component: Component5,
|
|
194003
194114
|
loader,
|
|
194004
194115
|
handle: {
|
|
194005
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
194116
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
194006
194117
|
}
|
|
194007
194118
|
};
|
|
194008
194119
|
},
|
|
@@ -194021,8 +194132,8 @@ function getRouteMap({
|
|
|
194021
194132
|
},
|
|
194022
194133
|
{
|
|
194023
194134
|
path: "workflows",
|
|
194024
|
-
errorElement: /* @__PURE__ */ (0,
|
|
194025
|
-
element: /* @__PURE__ */ (0,
|
|
194135
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
194136
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
194026
194137
|
handle: {
|
|
194027
194138
|
breadcrumb: () => (0, import_i18next9.t)("workflowExecutions.domain")
|
|
194028
194139
|
},
|
|
@@ -194039,7 +194150,7 @@ function getRouteMap({
|
|
|
194039
194150
|
Component: Component5,
|
|
194040
194151
|
loader,
|
|
194041
194152
|
handle: {
|
|
194042
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
194153
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
194043
194154
|
}
|
|
194044
194155
|
};
|
|
194045
194156
|
}
|
|
@@ -194048,8 +194159,8 @@ function getRouteMap({
|
|
|
194048
194159
|
},
|
|
194049
194160
|
{
|
|
194050
194161
|
path: "product-types",
|
|
194051
|
-
errorElement: /* @__PURE__ */ (0,
|
|
194052
|
-
element: /* @__PURE__ */ (0,
|
|
194162
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
194163
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
194053
194164
|
handle: {
|
|
194054
194165
|
breadcrumb: () => (0, import_i18next9.t)("productTypes.domain")
|
|
194055
194166
|
},
|
|
@@ -194072,7 +194183,7 @@ function getRouteMap({
|
|
|
194072
194183
|
Component: Component5,
|
|
194073
194184
|
loader,
|
|
194074
194185
|
handle: {
|
|
194075
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
194186
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
194076
194187
|
}
|
|
194077
194188
|
};
|
|
194078
194189
|
},
|
|
@@ -194091,14 +194202,14 @@ function getRouteMap({
|
|
|
194091
194202
|
},
|
|
194092
194203
|
{
|
|
194093
194204
|
path: "publishable-api-keys",
|
|
194094
|
-
element: /* @__PURE__ */ (0,
|
|
194205
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
194095
194206
|
handle: {
|
|
194096
194207
|
breadcrumb: () => (0, import_i18next9.t)("apiKeyManagement.domain.publishable")
|
|
194097
194208
|
},
|
|
194098
194209
|
children: [
|
|
194099
194210
|
{
|
|
194100
194211
|
path: "",
|
|
194101
|
-
element: /* @__PURE__ */ (0,
|
|
194212
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
194102
194213
|
children: [
|
|
194103
194214
|
{
|
|
194104
194215
|
path: "",
|
|
@@ -194120,7 +194231,7 @@ function getRouteMap({
|
|
|
194120
194231
|
Component: Component5,
|
|
194121
194232
|
loader,
|
|
194122
194233
|
handle: {
|
|
194123
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
194234
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
194124
194235
|
}
|
|
194125
194236
|
};
|
|
194126
194237
|
},
|
|
@@ -194139,14 +194250,14 @@ function getRouteMap({
|
|
|
194139
194250
|
},
|
|
194140
194251
|
{
|
|
194141
194252
|
path: "secret-api-keys",
|
|
194142
|
-
element: /* @__PURE__ */ (0,
|
|
194253
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
194143
194254
|
handle: {
|
|
194144
194255
|
breadcrumb: () => (0, import_i18next9.t)("apiKeyManagement.domain.secret")
|
|
194145
194256
|
},
|
|
194146
194257
|
children: [
|
|
194147
194258
|
{
|
|
194148
194259
|
path: "",
|
|
194149
|
-
element: /* @__PURE__ */ (0,
|
|
194260
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
194150
194261
|
children: [
|
|
194151
194262
|
{
|
|
194152
194263
|
path: "",
|
|
@@ -194168,7 +194279,7 @@ function getRouteMap({
|
|
|
194168
194279
|
Component: Component5,
|
|
194169
194280
|
loader,
|
|
194170
194281
|
handle: {
|
|
194171
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
194282
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
194172
194283
|
}
|
|
194173
194284
|
};
|
|
194174
194285
|
},
|
|
@@ -194183,7 +194294,7 @@ function getRouteMap({
|
|
|
194183
194294
|
},
|
|
194184
194295
|
{
|
|
194185
194296
|
path: "tax-regions",
|
|
194186
|
-
element: /* @__PURE__ */ (0,
|
|
194297
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
194187
194298
|
handle: {
|
|
194188
194299
|
breadcrumb: () => (0, import_i18next9.t)("taxRegions.domain")
|
|
194189
194300
|
},
|
|
@@ -194200,10 +194311,10 @@ function getRouteMap({
|
|
|
194200
194311
|
},
|
|
194201
194312
|
{
|
|
194202
194313
|
path: ":id",
|
|
194203
|
-
Component:
|
|
194314
|
+
Component: import_react_router_dom253.Outlet,
|
|
194204
194315
|
loader: taxRegionLoader,
|
|
194205
194316
|
handle: {
|
|
194206
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
194317
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(TaxRegionDetailBreadcrumb, { ...match })
|
|
194207
194318
|
},
|
|
194208
194319
|
children: [
|
|
194209
194320
|
{
|
|
@@ -194249,7 +194360,7 @@ function getRouteMap({
|
|
|
194249
194360
|
Component: Component5,
|
|
194250
194361
|
loader,
|
|
194251
194362
|
handle: {
|
|
194252
|
-
breadcrumb: (match) => /* @__PURE__ */ (0,
|
|
194363
|
+
breadcrumb: (match) => /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(Breadcrumb, { ...match })
|
|
194253
194364
|
}
|
|
194254
194365
|
};
|
|
194255
194366
|
},
|
|
@@ -194278,7 +194389,7 @@ function getRouteMap({
|
|
|
194278
194389
|
},
|
|
194279
194390
|
{
|
|
194280
194391
|
path: "return-reasons",
|
|
194281
|
-
element: /* @__PURE__ */ (0,
|
|
194392
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
194282
194393
|
handle: {
|
|
194283
194394
|
breadcrumb: () => (0, import_i18next9.t)("returnReasons.domain")
|
|
194284
194395
|
},
|
|
@@ -194306,7 +194417,7 @@ function getRouteMap({
|
|
|
194306
194417
|
},
|
|
194307
194418
|
{
|
|
194308
194419
|
path: "refund-reasons",
|
|
194309
|
-
element: /* @__PURE__ */ (0,
|
|
194420
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(import_react_router_dom253.Outlet, {}),
|
|
194310
194421
|
handle: {
|
|
194311
194422
|
breadcrumb: () => (0, import_i18next9.t)("refundReasons.domain")
|
|
194312
194423
|
},
|
|
@@ -194334,7 +194445,7 @@ function getRouteMap({
|
|
|
194334
194445
|
},
|
|
194335
194446
|
{
|
|
194336
194447
|
path: "translations",
|
|
194337
|
-
errorElement: /* @__PURE__ */ (0,
|
|
194448
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
194338
194449
|
handle: {
|
|
194339
194450
|
breadcrumb: () => (0, import_i18next9.t)("translations.domain")
|
|
194340
194451
|
},
|
|
@@ -194346,6 +194457,10 @@ function getRouteMap({
|
|
|
194346
194457
|
{
|
|
194347
194458
|
path: "edit",
|
|
194348
194459
|
lazy: () => Promise.resolve().then(() => (init_translations_edit2(), translations_edit_exports))
|
|
194460
|
+
},
|
|
194461
|
+
{
|
|
194462
|
+
path: "add-locales",
|
|
194463
|
+
lazy: () => Promise.resolve().then(() => (init_add_locales2(), add_locales_exports))
|
|
194349
194464
|
}
|
|
194350
194465
|
]
|
|
194351
194466
|
},
|
|
@@ -194355,10 +194470,10 @@ function getRouteMap({
|
|
|
194355
194470
|
]
|
|
194356
194471
|
},
|
|
194357
194472
|
{
|
|
194358
|
-
element: /* @__PURE__ */ (0,
|
|
194473
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(PublicLayout, {}),
|
|
194359
194474
|
children: [
|
|
194360
194475
|
{
|
|
194361
|
-
errorElement: /* @__PURE__ */ (0,
|
|
194476
|
+
errorElement: /* @__PURE__ */ (0, import_jsx_runtime699.jsx)(ErrorBoundary, {}),
|
|
194362
194477
|
children: [
|
|
194363
194478
|
{
|
|
194364
194479
|
path: "/login",
|
|
@@ -194382,12 +194497,12 @@ function getRouteMap({
|
|
|
194382
194497
|
}
|
|
194383
194498
|
];
|
|
194384
194499
|
}
|
|
194385
|
-
var import_i18next9,
|
|
194500
|
+
var import_i18next9, import_react_router_dom253, import_jsx_runtime699;
|
|
194386
194501
|
var init_get_route_map = __esm({
|
|
194387
194502
|
"src/dashboard-app/routes/get-route.map.tsx"() {
|
|
194388
194503
|
"use strict";
|
|
194389
194504
|
import_i18next9 = require("i18next");
|
|
194390
|
-
|
|
194505
|
+
import_react_router_dom253 = require("react-router-dom");
|
|
194391
194506
|
init_protected_route2();
|
|
194392
194507
|
init_main_layout2();
|
|
194393
194508
|
init_public_layout2();
|
|
@@ -194395,7 +194510,7 @@ var init_get_route_map = __esm({
|
|
|
194395
194510
|
init_error_boundary2();
|
|
194396
194511
|
init_breadcrumb();
|
|
194397
194512
|
init_loader();
|
|
194398
|
-
|
|
194513
|
+
import_jsx_runtime699 = require("react/jsx-runtime");
|
|
194399
194514
|
}
|
|
194400
194515
|
});
|
|
194401
194516
|
|
|
@@ -194559,18 +194674,18 @@ var init_sort_menu_items_by_rank = __esm({
|
|
|
194559
194674
|
});
|
|
194560
194675
|
|
|
194561
194676
|
// src/dashboard-app/dashboard-app.tsx
|
|
194562
|
-
var import_admin_shared,
|
|
194677
|
+
var import_admin_shared, import_react_router_dom254, import_jsx_runtime700, OPTIONAL_LAST_SEGMENT_MATCH, DashboardApp;
|
|
194563
194678
|
var init_dashboard_app = __esm({
|
|
194564
194679
|
"src/dashboard-app/dashboard-app.tsx"() {
|
|
194565
194680
|
"use strict";
|
|
194566
194681
|
import_admin_shared = require("@medusajs/admin-shared");
|
|
194567
|
-
|
|
194682
|
+
import_react_router_dom254 = require("react-router-dom");
|
|
194568
194683
|
init_providers2();
|
|
194569
194684
|
init_translations();
|
|
194570
194685
|
init_get_route_map();
|
|
194571
194686
|
init_utils14();
|
|
194572
194687
|
init_sort_menu_items_by_rank();
|
|
194573
|
-
|
|
194688
|
+
import_jsx_runtime700 = require("react/jsx-runtime");
|
|
194574
194689
|
OPTIONAL_LAST_SEGMENT_MATCH = /\/([^\/])+\?$/;
|
|
194575
194690
|
DashboardApp = class {
|
|
194576
194691
|
constructor({ plugins }) {
|
|
@@ -194676,7 +194791,7 @@ var init_dashboard_app = __esm({
|
|
|
194676
194791
|
const navItem = {
|
|
194677
194792
|
label: item.label,
|
|
194678
194793
|
to: item.path,
|
|
194679
|
-
icon: item.icon ? /* @__PURE__ */ (0,
|
|
194794
|
+
icon: item.icon ? /* @__PURE__ */ (0, import_jsx_runtime700.jsx)(item.icon, {}) : void 0,
|
|
194680
194795
|
items: [],
|
|
194681
194796
|
nested: item.nested,
|
|
194682
194797
|
rank: item.rank,
|
|
@@ -194883,10 +194998,10 @@ var init_dashboard_app = __esm({
|
|
|
194883
194998
|
settingsRoutes: this.settingsRoutes,
|
|
194884
194999
|
coreRoutes: this.coreRoutes
|
|
194885
195000
|
});
|
|
194886
|
-
const router = (0,
|
|
195001
|
+
const router = (0, import_react_router_dom254.createBrowserRouter)(routes, {
|
|
194887
195002
|
basename: __BASE__ || "/"
|
|
194888
195003
|
});
|
|
194889
|
-
return /* @__PURE__ */ (0,
|
|
195004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime700.jsx)(Providers, { api: this.api, children: /* @__PURE__ */ (0, import_jsx_runtime700.jsx)(import_react_router_dom254.RouterProvider, { router }) });
|
|
194890
195005
|
}
|
|
194891
195006
|
};
|
|
194892
195007
|
}
|
|
@@ -194932,7 +195047,7 @@ function getFieldLabel(field) {
|
|
|
194932
195047
|
}
|
|
194933
195048
|
return field.name.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
194934
195049
|
}
|
|
194935
|
-
var import_ui460, import_react_i18next492,
|
|
195050
|
+
var import_ui460, import_react_i18next492, import_jsx_runtime701, FormExtensionZone, FormExtensionField, FormExtensionFieldComponent;
|
|
194936
195051
|
var init_form_extension_zone = __esm({
|
|
194937
195052
|
"src/dashboard-app/forms/form-extension-zone/form-extension-zone.tsx"() {
|
|
194938
195053
|
"use strict";
|
|
@@ -194940,9 +195055,9 @@ var init_form_extension_zone = __esm({
|
|
|
194940
195055
|
import_react_i18next492 = require("react-i18next");
|
|
194941
195056
|
init_form2();
|
|
194942
195057
|
init_utils15();
|
|
194943
|
-
|
|
195058
|
+
import_jsx_runtime701 = require("react/jsx-runtime");
|
|
194944
195059
|
FormExtensionZone = ({ fields, form }) => {
|
|
194945
|
-
return /* @__PURE__ */ (0,
|
|
195060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime701.jsx)("div", { children: fields.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime701.jsx)(FormExtensionField, { field, form }, index)) });
|
|
194946
195061
|
};
|
|
194947
195062
|
FormExtensionField = ({ field, form }) => {
|
|
194948
195063
|
const label = getFieldLabel(field);
|
|
@@ -194951,16 +195066,16 @@ var init_form_extension_zone = __esm({
|
|
|
194951
195066
|
const Component5 = field.Component;
|
|
194952
195067
|
const type = getFieldType(field.validation);
|
|
194953
195068
|
const { control } = form;
|
|
194954
|
-
return /* @__PURE__ */ (0,
|
|
195069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime701.jsx)(
|
|
194955
195070
|
Form.Field,
|
|
194956
195071
|
{
|
|
194957
195072
|
control,
|
|
194958
195073
|
name: `additional_data.${field.name}`,
|
|
194959
195074
|
render: ({ field: field2 }) => {
|
|
194960
|
-
return /* @__PURE__ */ (0,
|
|
194961
|
-
/* @__PURE__ */ (0,
|
|
194962
|
-
description && /* @__PURE__ */ (0,
|
|
194963
|
-
/* @__PURE__ */ (0,
|
|
195075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime701.jsxs)(Form.Item, { children: [
|
|
195076
|
+
/* @__PURE__ */ (0, import_jsx_runtime701.jsx)(Form.Label, { children: label }),
|
|
195077
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime701.jsx)(Form.Hint, { children: description }),
|
|
195078
|
+
/* @__PURE__ */ (0, import_jsx_runtime701.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime701.jsx)(
|
|
194964
195079
|
FormExtensionFieldComponent,
|
|
194965
195080
|
{
|
|
194966
195081
|
field: field2,
|
|
@@ -194969,7 +195084,7 @@ var init_form_extension_zone = __esm({
|
|
|
194969
195084
|
placeholder
|
|
194970
195085
|
}
|
|
194971
195086
|
) }),
|
|
194972
|
-
/* @__PURE__ */ (0,
|
|
195087
|
+
/* @__PURE__ */ (0, import_jsx_runtime701.jsx)(Form.ErrorMessage, {})
|
|
194973
195088
|
] });
|
|
194974
195089
|
}
|
|
194975
195090
|
}
|
|
@@ -194984,20 +195099,20 @@ var init_form_extension_zone = __esm({
|
|
|
194984
195099
|
const { t: t5 } = (0, import_react_i18next492.useTranslation)();
|
|
194985
195100
|
if (component) {
|
|
194986
195101
|
const Component5 = component;
|
|
194987
|
-
return /* @__PURE__ */ (0,
|
|
195102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime701.jsx)(Component5, { ...field, placeholder });
|
|
194988
195103
|
}
|
|
194989
195104
|
switch (type) {
|
|
194990
195105
|
case "text": {
|
|
194991
|
-
return /* @__PURE__ */ (0,
|
|
195106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime701.jsx)(import_ui460.Input, { ...field, placeholder });
|
|
194992
195107
|
}
|
|
194993
195108
|
case "number": {
|
|
194994
|
-
return /* @__PURE__ */ (0,
|
|
195109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime701.jsx)(import_ui460.Input, { ...field, placeholder, type: "number" });
|
|
194995
195110
|
}
|
|
194996
195111
|
case "boolean": {
|
|
194997
|
-
return /* @__PURE__ */ (0,
|
|
195112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime701.jsx)(import_ui460.Switch, { className: "rtl:rotate-180", dir: "ltr", ...field });
|
|
194998
195113
|
}
|
|
194999
195114
|
default: {
|
|
195000
|
-
return /* @__PURE__ */ (0,
|
|
195115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime701.jsx)(import_ui460.InlineTip, { variant: "warning", label: t5("general.warning"), children: "The field type does not support rendering a fallback component. Please provide a component prop." });
|
|
195001
195116
|
}
|
|
195002
195117
|
}
|
|
195003
195118
|
};
|
|
@@ -195064,7 +195179,7 @@ var import_i18n6 = __toESM(require("virtual:medusa/i18n"));
|
|
|
195064
195179
|
var import_menu_items = __toESM(require("virtual:medusa/menu-items"));
|
|
195065
195180
|
var import_routes = __toESM(require("virtual:medusa/routes"));
|
|
195066
195181
|
var import_widgets = __toESM(require("virtual:medusa/widgets"));
|
|
195067
|
-
var
|
|
195182
|
+
var import_jsx_runtime702 = require("react/jsx-runtime");
|
|
195068
195183
|
var localPlugin = {
|
|
195069
195184
|
widgetModule: import_widgets.default,
|
|
195070
195185
|
routeModule: import_routes.default,
|
|
@@ -195077,6 +195192,6 @@ function App({ plugins = [] }) {
|
|
|
195077
195192
|
const app = new DashboardApp({
|
|
195078
195193
|
plugins: [localPlugin, ...plugins]
|
|
195079
195194
|
});
|
|
195080
|
-
return /* @__PURE__ */ (0,
|
|
195195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime702.jsx)("div", { children: app.render() });
|
|
195081
195196
|
}
|
|
195082
195197
|
var app_default = App;
|