@myparcel-dev/pdk-admin-js 1.14.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/ChildProductSettings-d3SnKpPH.js +4 -0
- package/dist/Modals-fANUi3cL.js +4 -0
- package/dist/Notifications-yRVDhiMo.js +4 -0
- package/dist/OrderBox-Bw7VnSow.js +4 -0
- package/dist/OrderListItem-DY4TK4DN.js +4 -0
- package/dist/{OrderModeOrderListItem-Df7qzieL.js → OrderModeOrderListItem-B72YhSTX.js} +20 -15
- package/dist/PluginSettings-BzUwmDgk.js +4 -0
- package/dist/{PrintOptionsModalForm-mNOwCJGu.js → PrintOptionsModalForm-DC-Y2NQg.js} +1 -1
- package/dist/ProductSettings-BbWcPXUU.js +4 -0
- package/dist/{ShipmentLabel.vue_vue_type_script_setup_true_lang-LyXmsMB7.js → ShipmentLabel.vue_vue_type_script_setup_true_lang-CyQhsc5w.js} +2 -2
- package/dist/{ShipmentModeOrderListItem-1Fj_y2ET.js → ShipmentModeOrderListItem-DF_ORvSm.js} +2 -2
- package/dist/{ShipmentOptionsModalForm-BJLbTAxc.js → ShipmentOptionsModalForm-BWjYWg9h.js} +1 -1
- package/dist/{ShipmentTableBox-DHjYGaMy.js → ShipmentTableBox-syVRwjqM.js} +1 -1
- package/dist/{index-Dp-JKnen.js → index-BT1nHhjw.js} +1180 -584
- package/dist/index.js +164 -157
- package/package.json +3 -3
- package/src/__tests__/__snapshots__/exports.spec.ts.snap +8 -1
- package/tsconfig.base.json +3 -0
- package/dist/ChildProductSettings-BPyPkZXH.js +0 -4
- package/dist/Modals-9_68MyUT.js +0 -4
- package/dist/Notifications-D9VEVf0q.js +0 -4
- package/dist/OrderBox-DZEddeXm.js +0 -4
- package/dist/OrderListItem-SuUMLy47.js +0 -4
- package/dist/PluginSettings-BCJWQyay.js +0 -4
- package/dist/ProductSettings-BQXxM91a.js +0 -4
|
@@ -26,7 +26,7 @@ class Subscribable {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
const isServer = typeof window === "undefined" || "Deno" in window;
|
|
29
|
-
function noop$
|
|
29
|
+
function noop$2() {
|
|
30
30
|
return void 0;
|
|
31
31
|
}
|
|
32
32
|
function functionalUpdate(updater, input) {
|
|
@@ -634,7 +634,7 @@ class Query extends Removable {
|
|
|
634
634
|
var _this$retryer;
|
|
635
635
|
const promise = this.promise;
|
|
636
636
|
(_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options);
|
|
637
|
-
return promise ? promise.then(noop$
|
|
637
|
+
return promise ? promise.then(noop$2).catch(noop$2) : Promise.resolve();
|
|
638
638
|
}
|
|
639
639
|
destroy() {
|
|
640
640
|
super.destroy();
|
|
@@ -1359,7 +1359,7 @@ let MutationCache$1 = class MutationCache extends Subscribable {
|
|
|
1359
1359
|
var _this$resuming;
|
|
1360
1360
|
this.resuming = ((_this$resuming = this.resuming) != null ? _this$resuming : Promise.resolve()).then(() => {
|
|
1361
1361
|
const pausedMutations = this.mutations.filter((x3) => x3.state.isPaused);
|
|
1362
|
-
return notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop$
|
|
1362
|
+
return notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop$2)), Promise.resolve()));
|
|
1363
1363
|
}).then(() => {
|
|
1364
1364
|
this.resuming = void 0;
|
|
1365
1365
|
});
|
|
@@ -1604,7 +1604,7 @@ let QueryClient$1 = class QueryClient {
|
|
|
1604
1604
|
cancelOptions.revert = true;
|
|
1605
1605
|
}
|
|
1606
1606
|
const promises = notifyManager.batch(() => this.queryCache.findAll(filters).map((query) => query.cancel(cancelOptions)));
|
|
1607
|
-
return Promise.all(promises).then(noop$
|
|
1607
|
+
return Promise.all(promises).then(noop$2).catch(noop$2);
|
|
1608
1608
|
}
|
|
1609
1609
|
/**
|
|
1610
1610
|
* @deprecated This method should be used with only one object argument.
|
|
@@ -1641,9 +1641,9 @@ let QueryClient$1 = class QueryClient {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
});
|
|
1643
1643
|
}));
|
|
1644
|
-
let promise = Promise.all(promises).then(noop$
|
|
1644
|
+
let promise = Promise.all(promises).then(noop$2);
|
|
1645
1645
|
if (!(options != null && options.throwOnError)) {
|
|
1646
|
-
promise = promise.catch(noop$
|
|
1646
|
+
promise = promise.catch(noop$2);
|
|
1647
1647
|
}
|
|
1648
1648
|
return promise;
|
|
1649
1649
|
}
|
|
@@ -1663,7 +1663,7 @@ let QueryClient$1 = class QueryClient {
|
|
|
1663
1663
|
* @deprecated This method should be used with only one object argument.
|
|
1664
1664
|
*/
|
|
1665
1665
|
prefetchQuery(arg1, arg2, arg3) {
|
|
1666
|
-
return this.fetchQuery(arg1, arg2, arg3).then(noop$
|
|
1666
|
+
return this.fetchQuery(arg1, arg2, arg3).then(noop$2).catch(noop$2);
|
|
1667
1667
|
}
|
|
1668
1668
|
/**
|
|
1669
1669
|
* @deprecated This method should be used with only one object argument.
|
|
@@ -1677,7 +1677,7 @@ let QueryClient$1 = class QueryClient {
|
|
|
1677
1677
|
* @deprecated This method should be used with only one object argument.
|
|
1678
1678
|
*/
|
|
1679
1679
|
prefetchInfiniteQuery(arg1, arg2, arg3) {
|
|
1680
|
-
return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop$
|
|
1680
|
+
return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop$2).catch(noop$2);
|
|
1681
1681
|
}
|
|
1682
1682
|
resumePausedMutations() {
|
|
1683
1683
|
return this.mutationCache.resumePausedMutations();
|
|
@@ -1920,7 +1920,7 @@ class QueryObserver extends Subscribable {
|
|
|
1920
1920
|
this.updateQuery();
|
|
1921
1921
|
let promise = this.currentQuery.fetch(this.options, fetchOptions);
|
|
1922
1922
|
if (!(fetchOptions != null && fetchOptions.throwOnError)) {
|
|
1923
|
-
promise = promise.catch(noop$
|
|
1923
|
+
promise = promise.catch(noop$2);
|
|
1924
1924
|
}
|
|
1925
1925
|
return promise;
|
|
1926
1926
|
}
|
|
@@ -3701,7 +3701,7 @@ function triggerRef(ref2) {
|
|
|
3701
3701
|
function unref(ref2) {
|
|
3702
3702
|
return isRef(ref2) ? ref2.value : ref2;
|
|
3703
3703
|
}
|
|
3704
|
-
function toValue(source) {
|
|
3704
|
+
function toValue$1(source) {
|
|
3705
3705
|
return isFunction$1(source) ? source() : unref(source);
|
|
3706
3706
|
}
|
|
3707
3707
|
const shallowUnwrapHandlers = {
|
|
@@ -13696,7 +13696,7 @@ const he = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
13696
13696
|
toRaw,
|
|
13697
13697
|
toRef,
|
|
13698
13698
|
toRefs,
|
|
13699
|
-
toValue,
|
|
13699
|
+
toValue: toValue$1,
|
|
13700
13700
|
transformVNodeArgs,
|
|
13701
13701
|
triggerRef,
|
|
13702
13702
|
unref,
|
|
@@ -15221,12 +15221,14 @@ var BackendEndpoint = /* @__PURE__ */ ((BackendEndpoint2) => {
|
|
|
15221
15221
|
BackendEndpoint2["DownloadLogs"] = "downloadLogs";
|
|
15222
15222
|
BackendEndpoint2["SwitchToAcceptanceApi"] = "switchToAcceptanceApi";
|
|
15223
15223
|
BackendEndpoint2["SwitchToProductionApi"] = "switchToProductionApi";
|
|
15224
|
+
BackendEndpoint2["ProxyCapabilities"] = "proxyCapabilities";
|
|
15224
15225
|
return BackendEndpoint2;
|
|
15225
15226
|
})(BackendEndpoint || {});
|
|
15226
15227
|
var FrontendEndpoint = /* @__PURE__ */ ((FrontendEndpoint2) => {
|
|
15227
15228
|
FrontendEndpoint2["FetchCheckoutContext"] = "fetchCheckoutContext";
|
|
15228
15229
|
FrontendEndpoint2["ProxyAddressesList"] = "proxyAddressList";
|
|
15229
15230
|
FrontendEndpoint2["ProxyAddressValidate"] = "proxyAddressValidate";
|
|
15231
|
+
FrontendEndpoint2["ProxyCapabilities"] = "proxyCapabilities";
|
|
15230
15232
|
return FrontendEndpoint2;
|
|
15231
15233
|
})(FrontendEndpoint || {});
|
|
15232
15234
|
var T = Object.defineProperty;
|
|
@@ -15526,6 +15528,27 @@ var toArray = (itemOrItems, separator) => {
|
|
|
15526
15528
|
}
|
|
15527
15529
|
return Array.isArray(itemOrItems) ? itemOrItems : [itemOrItems];
|
|
15528
15530
|
};
|
|
15531
|
+
var CarrierId = /* @__PURE__ */ ((CarrierId3) => {
|
|
15532
|
+
CarrierId3[CarrierId3["PostNl"] = 1] = "PostNl";
|
|
15533
|
+
CarrierId3[CarrierId3["Bpost"] = 2] = "Bpost";
|
|
15534
|
+
CarrierId3[CarrierId3["CheapCargo"] = 3] = "CheapCargo";
|
|
15535
|
+
CarrierId3[CarrierId3["Dpd"] = 4] = "Dpd";
|
|
15536
|
+
CarrierId3[CarrierId3["Instabox"] = 5] = "Instabox";
|
|
15537
|
+
CarrierId3[CarrierId3["Dhl"] = 6] = "Dhl";
|
|
15538
|
+
CarrierId3[CarrierId3["Bol"] = 7] = "Bol";
|
|
15539
|
+
CarrierId3[CarrierId3["BolCom"] = 7] = "BolCom";
|
|
15540
|
+
CarrierId3[CarrierId3["Ups"] = 8] = "Ups";
|
|
15541
|
+
CarrierId3[CarrierId3["DhlForYou"] = 9] = "DhlForYou";
|
|
15542
|
+
CarrierId3[CarrierId3["DhlParcelConnect"] = 10] = "DhlParcelConnect";
|
|
15543
|
+
CarrierId3[CarrierId3["DhlEuroPlus"] = 11] = "DhlEuroPlus";
|
|
15544
|
+
CarrierId3[CarrierId3["UpsStandard"] = 12] = "UpsStandard";
|
|
15545
|
+
CarrierId3[CarrierId3["UpsExpressSaver"] = 13] = "UpsExpressSaver";
|
|
15546
|
+
CarrierId3[CarrierId3["Gls"] = 14] = "Gls";
|
|
15547
|
+
CarrierId3[CarrierId3["Brt"] = 15] = "Brt";
|
|
15548
|
+
CarrierId3[CarrierId3["Trunkrs"] = 16] = "Trunkrs";
|
|
15549
|
+
CarrierId3[CarrierId3["InPost"] = 17] = "InPost";
|
|
15550
|
+
return CarrierId3;
|
|
15551
|
+
})(CarrierId || {});
|
|
15529
15552
|
var CarrierName = /* @__PURE__ */ ((CarrierName3) => {
|
|
15530
15553
|
CarrierName3["PostNl"] = "postnl";
|
|
15531
15554
|
CarrierName3["Bpost"] = "bpost";
|
|
@@ -15580,8 +15603,76 @@ function createGlobalState(stateFactory) {
|
|
|
15580
15603
|
function isDefined(v) {
|
|
15581
15604
|
return unref(v) != null;
|
|
15582
15605
|
}
|
|
15606
|
+
function toValue(r) {
|
|
15607
|
+
return typeof r === "function" ? r() : unref(r);
|
|
15608
|
+
}
|
|
15583
15609
|
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
15584
15610
|
const isDef = (val) => typeof val !== "undefined";
|
|
15611
|
+
const noop$1 = () => {
|
|
15612
|
+
};
|
|
15613
|
+
function createFilterWrapper(filter, fn) {
|
|
15614
|
+
function wrapper(...args) {
|
|
15615
|
+
return new Promise((resolve2, reject) => {
|
|
15616
|
+
Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve2).catch(reject);
|
|
15617
|
+
});
|
|
15618
|
+
}
|
|
15619
|
+
return wrapper;
|
|
15620
|
+
}
|
|
15621
|
+
function debounceFilter(ms, options = {}) {
|
|
15622
|
+
let timer;
|
|
15623
|
+
let maxTimer;
|
|
15624
|
+
let lastRejector = noop$1;
|
|
15625
|
+
const _clearTimeout = (timer2) => {
|
|
15626
|
+
clearTimeout(timer2);
|
|
15627
|
+
lastRejector();
|
|
15628
|
+
lastRejector = noop$1;
|
|
15629
|
+
};
|
|
15630
|
+
const filter = (invoke) => {
|
|
15631
|
+
const duration = toValue(ms);
|
|
15632
|
+
const maxDuration = toValue(options.maxWait);
|
|
15633
|
+
if (timer)
|
|
15634
|
+
_clearTimeout(timer);
|
|
15635
|
+
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
|
|
15636
|
+
if (maxTimer) {
|
|
15637
|
+
_clearTimeout(maxTimer);
|
|
15638
|
+
maxTimer = null;
|
|
15639
|
+
}
|
|
15640
|
+
return Promise.resolve(invoke());
|
|
15641
|
+
}
|
|
15642
|
+
return new Promise((resolve2, reject) => {
|
|
15643
|
+
lastRejector = options.rejectOnCancel ? reject : resolve2;
|
|
15644
|
+
if (maxDuration && !maxTimer) {
|
|
15645
|
+
maxTimer = setTimeout(() => {
|
|
15646
|
+
if (timer)
|
|
15647
|
+
_clearTimeout(timer);
|
|
15648
|
+
maxTimer = null;
|
|
15649
|
+
resolve2(invoke());
|
|
15650
|
+
}, maxDuration);
|
|
15651
|
+
}
|
|
15652
|
+
timer = setTimeout(() => {
|
|
15653
|
+
if (maxTimer)
|
|
15654
|
+
_clearTimeout(maxTimer);
|
|
15655
|
+
maxTimer = null;
|
|
15656
|
+
resolve2(invoke());
|
|
15657
|
+
}, duration);
|
|
15658
|
+
});
|
|
15659
|
+
};
|
|
15660
|
+
return filter;
|
|
15661
|
+
}
|
|
15662
|
+
function useDebounceFn(fn, ms = 200, options = {}) {
|
|
15663
|
+
return createFilterWrapper(
|
|
15664
|
+
debounceFilter(ms, options),
|
|
15665
|
+
fn
|
|
15666
|
+
);
|
|
15667
|
+
}
|
|
15668
|
+
function refDebounced(value, ms = 200, options = {}) {
|
|
15669
|
+
const debounced = ref(value.value);
|
|
15670
|
+
const updater = useDebounceFn(() => {
|
|
15671
|
+
debounced.value = value.value;
|
|
15672
|
+
}, ms, options);
|
|
15673
|
+
watch(value, () => updater());
|
|
15674
|
+
return debounced;
|
|
15675
|
+
}
|
|
15585
15676
|
function cloneFnJSON(source) {
|
|
15586
15677
|
return JSON.parse(JSON.stringify(source));
|
|
15587
15678
|
}
|
|
@@ -15875,6 +15966,35 @@ const BACKEND_ENDPOINTS_SHIPMENTS = [
|
|
|
15875
15966
|
BackendEndpoint.SwitchToAcceptanceApi,
|
|
15876
15967
|
BackendEndpoint.SwitchToProductionApi
|
|
15877
15968
|
];
|
|
15969
|
+
var OrderMode = /* @__PURE__ */ ((OrderMode2) => {
|
|
15970
|
+
OrderMode2["Shipments"] = "Shipments";
|
|
15971
|
+
OrderMode2["OrderV1"] = "OrderV1";
|
|
15972
|
+
OrderMode2["OrderV2"] = "OrderV2";
|
|
15973
|
+
return OrderMode2;
|
|
15974
|
+
})(OrderMode || {});
|
|
15975
|
+
const ORDER_MODE_BY_NUMERIC = {
|
|
15976
|
+
0: "Shipments",
|
|
15977
|
+
1: "OrderV1",
|
|
15978
|
+
2: "OrderV2"
|
|
15979
|
+
/* OrderV2 */
|
|
15980
|
+
};
|
|
15981
|
+
const orderModeFromContextValue = (value) => {
|
|
15982
|
+
if (typeof value === "number" && value in ORDER_MODE_BY_NUMERIC) {
|
|
15983
|
+
return ORDER_MODE_BY_NUMERIC[value];
|
|
15984
|
+
}
|
|
15985
|
+
return void 0;
|
|
15986
|
+
};
|
|
15987
|
+
const resolveOrderMode = (features) => {
|
|
15988
|
+
if (features.includes(
|
|
15989
|
+
"ORDER_MANAGEMENT"
|
|
15990
|
+
/* OrderManagement */
|
|
15991
|
+
)) return "OrderV2";
|
|
15992
|
+
if (features.includes(
|
|
15993
|
+
"LEGACY_ORDER_MANAGEMENT"
|
|
15994
|
+
/* LegacyOrderManagement */
|
|
15995
|
+
)) return "OrderV1";
|
|
15996
|
+
return "Shipments";
|
|
15997
|
+
};
|
|
15878
15998
|
var AdminView = /* @__PURE__ */ ((AdminView2) => {
|
|
15879
15999
|
AdminView2["ChildProductSettings"] = "ChildProductSettings";
|
|
15880
16000
|
AdminView2["Modals"] = "Modals";
|
|
@@ -16096,7 +16216,7 @@ const ee = Object.freeze(Object.values(c)), x2 = [
|
|
|
16096
16216
|
const t = ref(false), e2 = M();
|
|
16097
16217
|
if (!e2)
|
|
16098
16218
|
throw new Error("Form not found");
|
|
16099
|
-
const r = computed(() => toValue(e2.fields).filter((a) => !a.teleportSelector)), i = computed(() => toValue(e2.fields).filter((a) => !!a.teleportSelector));
|
|
16219
|
+
const r = computed(() => toValue$1(e2.fields).filter((a) => !a.teleportSelector)), i = computed(() => toValue$1(e2.fields).filter((a) => !!a.teleportSelector));
|
|
16100
16220
|
return (a, u2) => (openBlock(), createElementBlock(Fragment, null, [
|
|
16101
16221
|
unref(e2) ? (openBlock(), createBlock(Suspense, {
|
|
16102
16222
|
key: 0,
|
|
@@ -16148,7 +16268,7 @@ const He = /* @__PURE__ */ Pe(_e, [["render", Be]]), xe = /* @__PURE__ */ define
|
|
|
16148
16268
|
setup(s, { emit: t }) {
|
|
16149
16269
|
const e2 = ref(null), r = s, i = t, u2 = toRefs(r).form.value;
|
|
16150
16270
|
return onMounted(() => {
|
|
16151
|
-
const l = toValue(e2);
|
|
16271
|
+
const l = toValue$1(e2);
|
|
16152
16272
|
l && (r.form.element = l);
|
|
16153
16273
|
}), provide(re, u2), ee.forEach((l) => {
|
|
16154
16274
|
r.form.on(l, (d) => {
|
|
@@ -16214,7 +16334,7 @@ class oe {
|
|
|
16214
16334
|
const r = this.hooks.getAvailableHooks();
|
|
16215
16335
|
if (Object.keys(e2).filter((i) => !r.includes(i)).forEach((i) => {
|
|
16216
16336
|
this[i] = e2[i];
|
|
16217
|
-
}), this.props = reactive(e2.props ?? {}), this.attributes = reactive(e2.attributes ?? {}), this.config = e2, this.form = t, this.name = e2.name, this.wrapper = e2.wrapper ?? true, this.setVisible(e2.visible ?? true), this.formattedErrors = computed(() => toValue(this.errors).map((i) => typeof i == "function" ? i() : i)), "visibleWhen" in e2 && $(() => this.config.visibleWhen(this), this.isVisible), typeof e2.component == "string") {
|
|
16337
|
+
}), this.props = reactive(e2.props ?? {}), this.attributes = reactive(e2.attributes ?? {}), this.config = e2, this.form = t, this.name = e2.name, this.wrapper = e2.wrapper ?? true, this.setVisible(e2.visible ?? true), this.formattedErrors = computed(() => toValue$1(this.errors).map((i) => typeof i == "function" ? i() : i)), "visibleWhen" in e2 && $(() => this.config.visibleWhen(this), this.isVisible), typeof e2.component == "string") {
|
|
16218
16338
|
this.component = e2.component;
|
|
16219
16339
|
return;
|
|
16220
16340
|
}
|
|
@@ -16250,7 +16370,7 @@ class Ie extends oe {
|
|
|
16250
16370
|
n(this, "validators", ref([]));
|
|
16251
16371
|
n(this, "initialValue");
|
|
16252
16372
|
n(this, "blur", async () => {
|
|
16253
|
-
await this.hooks.execute("beforeBlur", this, toValue(this.ref)), this.isSuspended.value = true, this.ref.value = await this.hooks.execute("sanitize", this, toValue(this.ref)) ?? toValue(this.ref), toValue(this.isDirty) && await this.validate(), this.isTouched.value = true, this.isSuspended.value = false, await this.hooks.execute("afterBlur", this, toValue(this.ref));
|
|
16373
|
+
await this.hooks.execute("beforeBlur", this, toValue$1(this.ref)), this.isSuspended.value = true, this.ref.value = await this.hooks.execute("sanitize", this, toValue$1(this.ref)) ?? toValue$1(this.ref), toValue$1(this.isDirty) && await this.validate(), this.isTouched.value = true, this.isSuspended.value = false, await this.hooks.execute("afterBlur", this, toValue$1(this.ref));
|
|
16254
16374
|
});
|
|
16255
16375
|
n(this, "focus", async (e3, r2) => {
|
|
16256
16376
|
await this.hooks.execute("beforeFocus", this, r2), await this.hooks.execute("focus", this, r2), await this.hooks.execute("afterFocus", this, r2);
|
|
@@ -16260,26 +16380,26 @@ class Ie extends oe {
|
|
|
16260
16380
|
});
|
|
16261
16381
|
n(this, "validate", async () => {
|
|
16262
16382
|
var h2;
|
|
16263
|
-
if (this.resetValidation(), await this.hooks.execute("beforeValidate", this, toValue(this.ref)), toValue(this.isDisabled))
|
|
16264
|
-
return this.isValid.value = true, toValue(this.isValid);
|
|
16383
|
+
if (this.resetValidation(), await this.hooks.execute("beforeValidate", this, toValue$1(this.ref)), toValue$1(this.isDisabled))
|
|
16384
|
+
return this.isValid.value = true, toValue$1(this.isValid);
|
|
16265
16385
|
const e3 = async (l) => {
|
|
16266
16386
|
var I;
|
|
16267
|
-
const d = await l.validate(this, toValue(this.ref));
|
|
16387
|
+
const d = await l.validate(this, toValue$1(this.ref));
|
|
16268
16388
|
if (!d && l.errorMessage)
|
|
16269
16389
|
if (this.errorsTarget) {
|
|
16270
|
-
const S = toValue(this.form.fields).find(
|
|
16390
|
+
const S = toValue$1(this.form.fields).find(
|
|
16271
16391
|
(ae) => ae.name === this.errorsTarget
|
|
16272
16392
|
);
|
|
16273
|
-
(I = toValue(S == null ? void 0 : S.errors)) == null || I.push(l.errorMessage);
|
|
16393
|
+
(I = toValue$1(S == null ? void 0 : S.errors)) == null || I.push(l.errorMessage);
|
|
16274
16394
|
} else
|
|
16275
|
-
toValue(this.errors).push(l.errorMessage);
|
|
16395
|
+
toValue$1(this.errors).push(l.errorMessage);
|
|
16276
16396
|
return d;
|
|
16277
|
-
}, r2 = toValue(this.validators).filter((l) => !l.precedence), i2 = toValue(this.validators).filter((l) => isOfType(l, "precedence")).sort((l, d) => (l.precedence ?? 0) - (d.precedence ?? 0));
|
|
16278
|
-
toValue(this.isOptional) || r2.push(Te(((h2 = this.form.config.validationMessages) == null ? void 0 : h2.required) ?? ""));
|
|
16397
|
+
}, r2 = toValue$1(this.validators).filter((l) => !l.precedence), i2 = toValue$1(this.validators).filter((l) => isOfType(l, "precedence")).sort((l, d) => (l.precedence ?? 0) - (d.precedence ?? 0));
|
|
16398
|
+
toValue$1(this.isOptional) || r2.push(Te(((h2 = this.form.config.validationMessages) == null ? void 0 : h2.required) ?? ""));
|
|
16279
16399
|
const a2 = (await Promise.all(r2.map(e3))).every(Boolean), u3 = await asyncEvery(i2, e3);
|
|
16280
|
-
return this.isValid.value = a2 && u3, await this.hooks.execute("afterValidate", this, toValue(this.ref), toValue(this.isValid)), toValue(this.isValid);
|
|
16400
|
+
return this.isValid.value = a2 && u3, await this.hooks.execute("afterValidate", this, toValue$1(this.ref), toValue$1(this.isValid)), toValue$1(this.isValid);
|
|
16281
16401
|
});
|
|
16282
|
-
this.ref = r.ref, (i = e2.config.initialValues) != null && i.hasOwnProperty(r.name) && (this.ref.value = e2.config.initialValues[r.name]), this.initialValue = toValue(this.ref), this.lazy = r.lazy ?? false, this.errorsTarget = r.errorsTarget, this.label = r.label ? ((u2 = (a = e2.config).renderLabel) == null ? void 0 : u2.call(a, r.label)) ?? r.label : void 0, this.isDisabled.value = r.disabled ?? false, this.isOptional.value = r.optional ?? false, this.isReadOnly.value = r.readOnly ?? false, this.createValidators(r), watch(this.ref, async (h2, l) => {
|
|
16402
|
+
this.ref = r.ref, (i = e2.config.initialValues) != null && i.hasOwnProperty(r.name) && (this.ref.value = e2.config.initialValues[r.name]), this.initialValue = toValue$1(this.ref), this.lazy = r.lazy ?? false, this.errorsTarget = r.errorsTarget, this.label = r.label ? ((u2 = (a = e2.config).renderLabel) == null ? void 0 : u2.call(a, r.label)) ?? r.label : void 0, this.isDisabled.value = r.disabled ?? false, this.isOptional.value = r.optional ?? false, this.isReadOnly.value = r.readOnly ?? false, this.createValidators(r), watch(this.ref, async (h2, l) => {
|
|
16283
16403
|
await this.hooks.execute("beforeUpdate", this, h2, l), this.isDirty.value = true, await this.hooks.execute("afterUpdate", this, h2, l);
|
|
16284
16404
|
}), watch(e2.stable, (h2) => {
|
|
16285
16405
|
h2 && (r.disabledWhen && $(() => r.disabledWhen(this), this.isDisabled), r.optionalWhen && $(() => r.optionalWhen(this), this.isOptional), r.readOnlyWhen && $(() => r.readOnlyWhen(this), this.isReadOnly));
|
|
@@ -16318,39 +16438,39 @@ class We {
|
|
|
16318
16438
|
n(this, "on");
|
|
16319
16439
|
n(this, "stable", ref(false));
|
|
16320
16440
|
n(this, "values");
|
|
16321
|
-
n(this, "getFieldMemoized", useMemoize((t2) => toValue(this.fields).find((r2) => r2.name === t2) ?? null));
|
|
16441
|
+
n(this, "getFieldMemoized", useMemoize((t2) => toValue$1(this.fields).find((r2) => r2.name === t2) ?? null));
|
|
16322
16442
|
const { fields: r, ...i } = e2;
|
|
16323
16443
|
e2.hookNames = [...ee, ...e2.hookNames ?? []], this.hooks = Z(e2), this.on = this.hooks.register.bind(this.hooks), this.off = this.hooks.unregister.bind(this.hooks), this.name = t, this.config = i, this.values = reactive({}), E(this.config.field.wrapper), E(this.config.fieldDefaults.wrapper), r.forEach((a) => {
|
|
16324
16444
|
const u2 = this.createFieldInstance(a, this);
|
|
16325
|
-
toValue(this.fields).push(u2);
|
|
16326
|
-
}), this.interactiveFields = computed(() => toValue(this.fields).filter((a) => isOfType(a, "ref"))), this.isDirty = computed(() => toValue(this.interactiveFields).some((a) => toValue(a.isDirty))), this.stable.value = true;
|
|
16445
|
+
toValue$1(this.fields).push(u2);
|
|
16446
|
+
}), this.interactiveFields = computed(() => toValue$1(this.fields).filter((a) => isOfType(a, "ref"))), this.isDirty = computed(() => toValue$1(this.interactiveFields).some((a) => toValue$1(a.isDirty))), this.stable.value = true;
|
|
16327
16447
|
}
|
|
16328
16448
|
async addElement(t, e2, r = "after") {
|
|
16329
16449
|
await this.hooks.execute(c.BeforeAddElement, this, t);
|
|
16330
|
-
const i = e2 ? toValue(this.fields).findIndex((h2) => h2.name === e2) : toValue(this.fields).length;
|
|
16450
|
+
const i = e2 ? toValue$1(this.fields).findIndex((h2) => h2.name === e2) : toValue$1(this.fields).length;
|
|
16331
16451
|
if (e2 && i === -1) {
|
|
16332
16452
|
console.error(`Field ${e2} not found in form ${this.name}`);
|
|
16333
16453
|
return;
|
|
16334
16454
|
}
|
|
16335
16455
|
const a = r === "after" ? i + 1 : i, u2 = this.createFieldInstance(t, this);
|
|
16336
|
-
return toValue(this.fields).splice(a, 0, u2), await this.hooks.execute(c.AfterAddElement, this, t), u2;
|
|
16456
|
+
return toValue$1(this.fields).splice(a, 0, u2), await this.hooks.execute(c.AfterAddElement, this, t), u2;
|
|
16337
16457
|
}
|
|
16338
16458
|
getField(t) {
|
|
16339
16459
|
return this.getFieldMemoized(t);
|
|
16340
16460
|
}
|
|
16341
16461
|
getValue(t) {
|
|
16342
16462
|
const e2 = this.ensureGetField(t);
|
|
16343
|
-
return toValue(e2.ref);
|
|
16463
|
+
return toValue$1(e2.ref);
|
|
16344
16464
|
}
|
|
16345
16465
|
getValues() {
|
|
16346
|
-
return toValue(this.values);
|
|
16466
|
+
return toValue$1(this.values);
|
|
16347
16467
|
}
|
|
16348
16468
|
removeElement(t) {
|
|
16349
|
-
const e2 = toValue(this.fields).findIndex((r) => r.name === t);
|
|
16350
|
-
toValue(this.fields).splice(e2, 1), this.getFieldMemoized.delete(t);
|
|
16469
|
+
const e2 = toValue$1(this.fields).findIndex((r) => r.name === t);
|
|
16470
|
+
toValue$1(this.fields).splice(e2, 1), this.getFieldMemoized.delete(t);
|
|
16351
16471
|
}
|
|
16352
16472
|
async reset() {
|
|
16353
|
-
await this.hooks.execute(c.BeforeReset, this), await Promise.all(toValue(this.interactiveFields).map((t) => t.reset())), await this.hooks.execute(c.AfterReset, this);
|
|
16473
|
+
await this.hooks.execute(c.BeforeReset, this), await Promise.all(toValue$1(this.interactiveFields).map((t) => t.reset())), await this.hooks.execute(c.AfterReset, this);
|
|
16354
16474
|
}
|
|
16355
16475
|
setValue(t, e2) {
|
|
16356
16476
|
const r = this.getField(t);
|
|
@@ -16365,9 +16485,9 @@ class We {
|
|
|
16365
16485
|
async validate() {
|
|
16366
16486
|
await this.hooks.execute(c.BeforeValidate, this);
|
|
16367
16487
|
const t = await Promise.all(
|
|
16368
|
-
toValue(this.fields).map((e2) => isOfType(e2, "ref") ? e2.validate() : (e2.resetValidation(), true))
|
|
16488
|
+
toValue$1(this.fields).map((e2) => isOfType(e2, "ref") ? e2.validate() : (e2.resetValidation(), true))
|
|
16369
16489
|
);
|
|
16370
|
-
return this.isValid.value = t.every(Boolean), await this.hooks.execute(c.AfterValidate, this), toValue(this.isValid);
|
|
16490
|
+
return this.isValid.value = t.every(Boolean), await this.hooks.execute(c.AfterValidate, this), toValue$1(this.isValid);
|
|
16371
16491
|
}
|
|
16372
16492
|
ensureGetField(t) {
|
|
16373
16493
|
const e2 = this.getField(t);
|
|
@@ -16391,8 +16511,8 @@ class We {
|
|
|
16391
16511
|
}
|
|
16392
16512
|
const i = new Ie(e2, r);
|
|
16393
16513
|
return watch(i.ref, async (u2) => {
|
|
16394
|
-
await this.hooks.execute(c.ElementChange, this, i, u2), toValue(i.isDisabled) || (this.values[r.name] = u2);
|
|
16395
|
-
}), toValue(i.isDisabled) || (this.values[r.name] = unref(i.ref)), this.registerElement(r.name, i);
|
|
16514
|
+
await this.hooks.execute(c.ElementChange, this, i, u2), toValue$1(i.isDisabled) || (this.values[r.name] = u2);
|
|
16515
|
+
}), toValue$1(i.isDisabled) || (this.values[r.name] = unref(i.ref)), this.registerElement(r.name, i);
|
|
16396
16516
|
}
|
|
16397
16517
|
registerElement(t, e2) {
|
|
16398
16518
|
return isDefined(t) && (this.model[t] = e2, this.getFieldMemoized.delete(t)), e2;
|
|
@@ -16408,16 +16528,16 @@ const Le = "register", ne = () => (D ?? (D = ref({})), V ?? (V = ref(Oe())), R ?
|
|
|
16408
16528
|
R.register(s, t);
|
|
16409
16529
|
},
|
|
16410
16530
|
getForm(s) {
|
|
16411
|
-
return toValue(D)[s];
|
|
16531
|
+
return toValue$1(D)[s];
|
|
16412
16532
|
},
|
|
16413
16533
|
// @ts-expect-error todo
|
|
16414
16534
|
register(s, t) {
|
|
16415
16535
|
R.execute("beforeRegister");
|
|
16416
|
-
const e2 = new We(s, U(toValue(V), t));
|
|
16417
|
-
return toValue(D)[s] = e2, R.execute("afterRegister", e2), e2;
|
|
16536
|
+
const e2 = new We(s, U(toValue$1(V), t));
|
|
16537
|
+
return toValue$1(D)[s] = e2, R.execute("afterRegister", e2), e2;
|
|
16418
16538
|
},
|
|
16419
16539
|
setDefaults(s) {
|
|
16420
|
-
V.value = U(toValue(V), s);
|
|
16540
|
+
V.value = U(toValue$1(V), s);
|
|
16421
16541
|
}
|
|
16422
16542
|
}), U = (s, t) => {
|
|
16423
16543
|
var e2, r, i, a, u2, h2;
|
|
@@ -19046,22 +19166,8 @@ const useActionStore = defineStore("actions", () => {
|
|
|
19046
19166
|
register,
|
|
19047
19167
|
dispatch,
|
|
19048
19168
|
registerOrderActions: () => {
|
|
19049
|
-
const
|
|
19050
|
-
register([
|
|
19051
|
-
ordersEditAction,
|
|
19052
|
-
ordersFetchAction,
|
|
19053
|
-
ordersPrintAction,
|
|
19054
|
-
ordersUpdateAction,
|
|
19055
|
-
...pluginSettings.order.orderMode ? [orderExportAction, orderViewInBackofficeAction] : [
|
|
19056
|
-
orderExportToShipmentsAction,
|
|
19057
|
-
ordersExportPrintShipmentsAction,
|
|
19058
|
-
shipmentsExportReturnAction,
|
|
19059
|
-
shipmentsExportReturnAction,
|
|
19060
|
-
shipmentsDeleteAction,
|
|
19061
|
-
shipmentsUpdateAction,
|
|
19062
|
-
shipmentsPrintAction
|
|
19063
|
-
]
|
|
19064
|
-
]);
|
|
19169
|
+
const orderMode = useOrderMode();
|
|
19170
|
+
register([ordersEditAction, ordersFetchAction, ordersUpdateAction, ...STORE_MODE_ACTIONS[orderMode.value]]);
|
|
19065
19171
|
},
|
|
19066
19172
|
registerModalActions: () => {
|
|
19067
19173
|
register([modalCloseAction, modalSubmitFormAction]);
|
|
@@ -19402,14 +19508,37 @@ const useMyParcelApi = () => {
|
|
|
19402
19508
|
sdk = f(client, [new de(), new ce()]);
|
|
19403
19509
|
return sdk;
|
|
19404
19510
|
};
|
|
19511
|
+
const KNOWN_CARRIER_NAMES = new Set(Object.values(CarrierName));
|
|
19512
|
+
const KNOWN_CARRIER_IDS = new Set(
|
|
19513
|
+
Object.values(CarrierId).filter((value) => typeof value === "number")
|
|
19514
|
+
);
|
|
19515
|
+
const resolveCarrierIdentifier = (input) => {
|
|
19516
|
+
if (typeof input === "number") {
|
|
19517
|
+
if (KNOWN_CARRIER_IDS.has(input)) {
|
|
19518
|
+
return input;
|
|
19519
|
+
}
|
|
19520
|
+
console.warn(`[useFetchCarrier] Unknown carrier ID "${input}", it may cause issues.`);
|
|
19521
|
+
return input;
|
|
19522
|
+
}
|
|
19523
|
+
if (KNOWN_CARRIER_NAMES.has(input)) {
|
|
19524
|
+
return input;
|
|
19525
|
+
}
|
|
19526
|
+
const normalized = input.replace(/_/g, "").toLowerCase();
|
|
19527
|
+
if (KNOWN_CARRIER_NAMES.has(normalized)) {
|
|
19528
|
+
return normalized;
|
|
19529
|
+
}
|
|
19530
|
+
console.warn(`[useFetchCarrier] Unknown carrier identifier "${input}", it may cause issues.`);
|
|
19531
|
+
return input;
|
|
19532
|
+
};
|
|
19405
19533
|
const useFetchCarrier = (carrier) => {
|
|
19534
|
+
const resolved = carrier === void 0 ? void 0 : resolveCarrierIdentifier(carrier);
|
|
19406
19535
|
const queryClient2 = useQueryClient();
|
|
19407
|
-
const queryKey = ["carriers", { name:
|
|
19536
|
+
const queryKey = ["carriers", { name: resolved }];
|
|
19408
19537
|
return useQuery(
|
|
19409
19538
|
queryKey,
|
|
19410
19539
|
async () => {
|
|
19411
19540
|
const sdk2 = useMyParcelApi();
|
|
19412
|
-
const carriers = await sdk2.getCarrier(
|
|
19541
|
+
const carriers = await sdk2.getCarrier(resolved === void 0 ? void 0 : { path: { carrier: resolved } });
|
|
19413
19542
|
return carriers[0];
|
|
19414
19543
|
},
|
|
19415
19544
|
{
|
|
@@ -19425,14 +19554,18 @@ const usePdkAdminApi = createGlobalState(() => {
|
|
|
19425
19554
|
baseUrl: globalContext.baseUrl
|
|
19426
19555
|
});
|
|
19427
19556
|
const pdkEndpoints = Object.entries(globalContext.endpoints).map(([endpointName, options]) => {
|
|
19557
|
+
const property = typeof options.property === "string" ? options.property : void 0;
|
|
19558
|
+
const responseProperty = typeof options.responseProperty === "string" ? options.responseProperty : void 0;
|
|
19428
19559
|
class PdkEndpoint extends AbstractPdkEndpoint {
|
|
19429
19560
|
constructor() {
|
|
19430
19561
|
super(...arguments);
|
|
19431
19562
|
__publicField(this, "method", options.method.toUpperCase());
|
|
19432
19563
|
__publicField(this, "name", endpointName);
|
|
19433
19564
|
__publicField(this, "path", options.path);
|
|
19434
|
-
__publicField(this, "property",
|
|
19435
|
-
|
|
19565
|
+
__publicField(this, "property", property);
|
|
19566
|
+
// If this is undefined, the SDK falls back to the endpoint instance's `property` value above.
|
|
19567
|
+
__publicField(this, "responseProperty", responseProperty);
|
|
19568
|
+
__publicField(this, "useDataEnvelope", typeof options.useDataEnvelope === "undefined" ? true : options.useDataEnvelope);
|
|
19436
19569
|
}
|
|
19437
19570
|
}
|
|
19438
19571
|
return new PdkEndpoint({
|
|
@@ -19518,19 +19651,25 @@ const createValueGetter = (instance, prefix) => {
|
|
|
19518
19651
|
if (target) {
|
|
19519
19652
|
return instance.form.getValue(`${prefix}${target}`);
|
|
19520
19653
|
}
|
|
19521
|
-
return toValue(instance.ref);
|
|
19654
|
+
return toValue$1(instance.ref);
|
|
19522
19655
|
};
|
|
19523
19656
|
};
|
|
19657
|
+
const setFieldRef = (field, value) => {
|
|
19658
|
+
if (isRef(field.ref)) {
|
|
19659
|
+
field.ref.value = value;
|
|
19660
|
+
} else {
|
|
19661
|
+
field.ref = value;
|
|
19662
|
+
}
|
|
19663
|
+
};
|
|
19524
19664
|
const createValueSetter = (instance, prefix) => {
|
|
19525
19665
|
return (value, target) => {
|
|
19526
19666
|
if (target) {
|
|
19527
|
-
instance.form.
|
|
19528
|
-
|
|
19529
|
-
|
|
19530
|
-
instance.ref.value = value;
|
|
19531
|
-
return;
|
|
19667
|
+
const targetField = instance.form.getField(`${prefix}${target}`);
|
|
19668
|
+
if (targetField) {
|
|
19669
|
+
setFieldRef(targetField, value);
|
|
19532
19670
|
}
|
|
19533
|
-
|
|
19671
|
+
} else {
|
|
19672
|
+
setFieldRef(instance, value);
|
|
19534
19673
|
}
|
|
19535
19674
|
};
|
|
19536
19675
|
};
|
|
@@ -19690,24 +19829,86 @@ const FORM_KEYS = [
|
|
|
19690
19829
|
FORM_KEY_PLUGIN_SETTINGS,
|
|
19691
19830
|
FORM_KEY_PRODUCT_SETTINGS
|
|
19692
19831
|
];
|
|
19832
|
+
const useShipmentCapabilitiesQuery = (selection) => {
|
|
19833
|
+
const enabled = computed(
|
|
19834
|
+
() => Boolean(
|
|
19835
|
+
selection.value.cc && selection.value.carrier && selection.value.packageType && selection.value.deliveryType
|
|
19836
|
+
)
|
|
19837
|
+
);
|
|
19838
|
+
const queryKey = computed(() => [BackendEndpoint.ProxyCapabilities, "shipment", selection.value]);
|
|
19839
|
+
return useQuery(
|
|
19840
|
+
queryKey,
|
|
19841
|
+
async () => {
|
|
19842
|
+
const { cc, weight, carrier, packageType, deliveryType } = selection.value;
|
|
19843
|
+
if (!cc || !carrier || !packageType || !deliveryType) return [];
|
|
19844
|
+
const pdk = usePdkAdminApi();
|
|
19845
|
+
const proxyCapabilities = pdk.proxyCapabilities;
|
|
19846
|
+
const body = {
|
|
19847
|
+
recipient: { countryCode: cc },
|
|
19848
|
+
// PDK orders carry physical-properties weight in grams (see WeightServiceInterface::UNIT_GRAMS),
|
|
19849
|
+
// and the SDK's PhysicalPropertiesWeightV2 expects a {value, unit} object — not a primitive.
|
|
19850
|
+
...weight !== void 0 ? { physicalProperties: { weight: { value: weight, unit: "g" } } } : null,
|
|
19851
|
+
carrier,
|
|
19852
|
+
packageType,
|
|
19853
|
+
deliveryType
|
|
19854
|
+
};
|
|
19855
|
+
const response = await proxyCapabilities({ body, parameters: { filterSupported: true } });
|
|
19856
|
+
return response.results ?? [];
|
|
19857
|
+
},
|
|
19858
|
+
{
|
|
19859
|
+
enabled,
|
|
19860
|
+
refetchOnWindowFocus: false,
|
|
19861
|
+
refetchOnMount: false,
|
|
19862
|
+
refetchOnReconnect: false,
|
|
19863
|
+
onError: (error) => {
|
|
19864
|
+
globalLogger.error("shipment-capabilities-query", "request failed", error);
|
|
19865
|
+
}
|
|
19866
|
+
}
|
|
19867
|
+
);
|
|
19868
|
+
};
|
|
19869
|
+
const useOrderCapabilitiesQuery = (input) => {
|
|
19870
|
+
const enabled = computed(() => Boolean(input.value.cc));
|
|
19871
|
+
const queryKey = computed(() => [BackendEndpoint.ProxyCapabilities, "order", input.value]);
|
|
19872
|
+
return useQuery(
|
|
19873
|
+
queryKey,
|
|
19874
|
+
async () => {
|
|
19875
|
+
const { cc, weight } = input.value;
|
|
19876
|
+
if (!cc) return [];
|
|
19877
|
+
const pdk = usePdkAdminApi();
|
|
19878
|
+
const proxyCapabilities = pdk.proxyCapabilities;
|
|
19879
|
+
const body = {
|
|
19880
|
+
recipient: { countryCode: cc },
|
|
19881
|
+
...weight !== void 0 ? { physicalProperties: { weight: { value: weight, unit: "g" } } } : null
|
|
19882
|
+
};
|
|
19883
|
+
const response = await proxyCapabilities({ body, parameters: { filterSupported: true } });
|
|
19884
|
+
return response.results ?? [];
|
|
19885
|
+
},
|
|
19886
|
+
{
|
|
19887
|
+
enabled,
|
|
19888
|
+
refetchOnWindowFocus: false,
|
|
19889
|
+
refetchOnMount: false,
|
|
19890
|
+
refetchOnReconnect: false,
|
|
19891
|
+
onError: (error) => {
|
|
19892
|
+
globalLogger.error("order-capabilities-query", "request failed", error);
|
|
19893
|
+
}
|
|
19894
|
+
}
|
|
19895
|
+
);
|
|
19896
|
+
};
|
|
19897
|
+
const DEBOUNCE_MS = 100;
|
|
19898
|
+
const useCapabilitiesWatcher = (order, form) => {
|
|
19899
|
+
const merged = computed(() => ({
|
|
19900
|
+
...toValue$1(order),
|
|
19901
|
+
...toValue$1(form)
|
|
19902
|
+
}));
|
|
19903
|
+
return refDebounced(merged, DEBOUNCE_MS);
|
|
19904
|
+
};
|
|
19693
19905
|
const DELIVERY_OPTIONS_PREFIX = "deliveryOptions";
|
|
19694
19906
|
const PHYSICAL_PROPERTIES_PREFIX = "physicalProperties";
|
|
19695
|
-
const SHIPMENT_OPTIONS =
|
|
19696
|
-
const SHIPMENT_OPTIONS_PREFIX = `${DELIVERY_OPTIONS_PREFIX}.${SHIPMENT_OPTIONS}`;
|
|
19907
|
+
const SHIPMENT_OPTIONS = "shipmentOptions";
|
|
19697
19908
|
const CARRIER = "carrier";
|
|
19698
19909
|
const LABEL_AMOUNT = "labelAmount";
|
|
19699
19910
|
const PACKAGE_TYPE = "packageType";
|
|
19700
19911
|
const DELIVERY_TYPE = "deliveryType";
|
|
19701
|
-
const AGE_CHECK = "ageCheck";
|
|
19702
|
-
const RECEIPT_CODE = "receiptCode";
|
|
19703
|
-
const DIRECT_RETURN = "return";
|
|
19704
|
-
const HIDE_SENDER = "hideSender";
|
|
19705
|
-
const LARGE_FORMAT = "largeFormat";
|
|
19706
|
-
const ONLY_RECIPIENT = "onlyRecipient";
|
|
19707
|
-
const SAME_DAY_DELIVERY = "sameDayDelivery";
|
|
19708
|
-
const SIGNATURE = "signature";
|
|
19709
|
-
const INSURANCE = "insurance";
|
|
19710
|
-
const PRIORITY_DELIVERY = "priorityDelivery";
|
|
19711
19912
|
const MANUAL_WEIGHT = "manualWeight";
|
|
19712
19913
|
const PROP_OPTIONS = "options";
|
|
19713
19914
|
const KEY_DESCRIPTION = "description";
|
|
@@ -19716,52 +19917,311 @@ const FIELD_CARRIER = `${DELIVERY_OPTIONS_PREFIX}.${CARRIER}`;
|
|
|
19716
19917
|
const FIELD_LABEL_AMOUNT = `${DELIVERY_OPTIONS_PREFIX}.${LABEL_AMOUNT}`;
|
|
19717
19918
|
const FIELD_PACKAGE_TYPE = `${DELIVERY_OPTIONS_PREFIX}.${PACKAGE_TYPE}`;
|
|
19718
19919
|
const FIELD_DELIVERY_TYPE = `${DELIVERY_OPTIONS_PREFIX}.${DELIVERY_TYPE}`;
|
|
19719
|
-
const FIELD_AGE_CHECK = `${SHIPMENT_OPTIONS_PREFIX}.${AGE_CHECK}`;
|
|
19720
|
-
const FIELD_DIRECT_RETURN = `${SHIPMENT_OPTIONS_PREFIX}.${DIRECT_RETURN}`;
|
|
19721
|
-
const FIELD_HIDE_SENDER = `${SHIPMENT_OPTIONS_PREFIX}.${HIDE_SENDER}`;
|
|
19722
|
-
const FIELD_LARGE_FORMAT = `${SHIPMENT_OPTIONS_PREFIX}.${LARGE_FORMAT}`;
|
|
19723
|
-
const FIELD_ONLY_RECIPIENT = `${SHIPMENT_OPTIONS_PREFIX}.${ONLY_RECIPIENT}`;
|
|
19724
|
-
const FIELD_SAME_DAY_DELIVERY = `${SHIPMENT_OPTIONS_PREFIX}.${SAME_DAY_DELIVERY}`;
|
|
19725
|
-
const FIELD_SIGNATURE = `${SHIPMENT_OPTIONS_PREFIX}.${SIGNATURE}`;
|
|
19726
|
-
const FIELD_INSURANCE = `${SHIPMENT_OPTIONS_PREFIX}.${INSURANCE}`;
|
|
19727
|
-
const FIELD_PRIORITY_DELIVERY = `${SHIPMENT_OPTIONS_PREFIX}.${PRIORITY_DELIVERY}`;
|
|
19728
19920
|
const FIELD_MANUAL_WEIGHT = `${PHYSICAL_PROPERTIES_PREFIX}.${MANUAL_WEIGHT}`;
|
|
19729
|
-
const
|
|
19730
|
-
const
|
|
19731
|
-
|
|
19732
|
-
|
|
19733
|
-
|
|
19734
|
-
|
|
19735
|
-
|
|
19736
|
-
|
|
19737
|
-
|
|
19738
|
-
|
|
19739
|
-
|
|
19740
|
-
|
|
19741
|
-
|
|
19742
|
-
|
|
19743
|
-
|
|
19744
|
-
|
|
19745
|
-
|
|
19746
|
-
|
|
19921
|
+
const FIELD_SHIPMENT_OPTIONS_PREFIX = `${DELIVERY_OPTIONS_PREFIX}.${SHIPMENT_OPTIONS}`;
|
|
19922
|
+
const wireProxyCapabilities = (form, order) => {
|
|
19923
|
+
const orderId = order.externalIdentifier;
|
|
19924
|
+
if (!orderId) {
|
|
19925
|
+
globalLogger.debug("wireProxyCapabilities", "skipped — order has no externalIdentifier", { order });
|
|
19926
|
+
return void 0;
|
|
19927
|
+
}
|
|
19928
|
+
const orderModifier = `${orderId}.order`;
|
|
19929
|
+
const shipmentModifier = `${orderId}.shipment`;
|
|
19930
|
+
const orderInput = computed(() => {
|
|
19931
|
+
var _a, _b;
|
|
19932
|
+
const manualWeightRaw = form.getValue(FIELD_MANUAL_WEIGHT);
|
|
19933
|
+
const manualWeight = typeof manualWeightRaw === "number" && manualWeightRaw > 0 ? manualWeightRaw : void 0;
|
|
19934
|
+
return {
|
|
19935
|
+
cc: (_a = order.shippingAddress) == null ? void 0 : _a.cc,
|
|
19936
|
+
weight: manualWeight ?? ((_b = order.physicalProperties) == null ? void 0 : _b.initialWeight)
|
|
19937
|
+
};
|
|
19938
|
+
});
|
|
19939
|
+
const formInput = computed(() => ({
|
|
19940
|
+
carrier: form.getValue(FIELD_CARRIER),
|
|
19941
|
+
packageType: form.getValue(FIELD_PACKAGE_TYPE),
|
|
19942
|
+
deliveryType: form.getValue(FIELD_DELIVERY_TYPE)
|
|
19943
|
+
}));
|
|
19944
|
+
const selection = useCapabilitiesWatcher(orderInput, formInput);
|
|
19945
|
+
const orderInputForQuery = computed(() => ({
|
|
19946
|
+
cc: selection.value.cc,
|
|
19947
|
+
weight: selection.value.weight
|
|
19948
|
+
}));
|
|
19949
|
+
const orderQuery = useOrderCapabilitiesQuery(orderInputForQuery);
|
|
19950
|
+
const shipmentQuery = useShipmentCapabilitiesQuery(selection);
|
|
19951
|
+
const queryStore = useQueryStore();
|
|
19952
|
+
queryStore.register(BackendEndpoint.ProxyCapabilities, orderModifier, orderQuery);
|
|
19953
|
+
queryStore.register(BackendEndpoint.ProxyCapabilities, shipmentModifier, shipmentQuery);
|
|
19954
|
+
onScopeDispose(() => {
|
|
19955
|
+
queryStore.unregister(BackendEndpoint.ProxyCapabilities, orderModifier);
|
|
19956
|
+
queryStore.unregister(BackendEndpoint.ProxyCapabilities, shipmentModifier);
|
|
19957
|
+
});
|
|
19958
|
+
return { selection };
|
|
19959
|
+
};
|
|
19960
|
+
const FIELD_TO_LABEL_KEY = {
|
|
19961
|
+
[FIELD_CARRIER]: "carrier",
|
|
19962
|
+
[FIELD_PACKAGE_TYPE]: snakeCase(`${SHIPMENT_OPTIONS}_package_type`),
|
|
19963
|
+
[FIELD_DELIVERY_TYPE]: snakeCase(`${SHIPMENT_OPTIONS}_delivery_type`)
|
|
19964
|
+
};
|
|
19965
|
+
const optionFieldName = (key) => `${FIELD_SHIPMENT_OPTIONS_PREFIX}.${key}`;
|
|
19966
|
+
const optionLabelKey = (key) => snakeCase(`${SHIPMENT_OPTIONS}_${key}`);
|
|
19967
|
+
const setFieldValue = (form, fieldName, value) => {
|
|
19968
|
+
const field = form.getField(fieldName);
|
|
19969
|
+
if (!field) return;
|
|
19970
|
+
setFieldRef(field, value);
|
|
19971
|
+
};
|
|
19972
|
+
const readShipmentSnapshot = (selection, queryStore, orderId) => {
|
|
19973
|
+
const modifier = `${orderId}.shipment`;
|
|
19974
|
+
if (!queryStore.has(BackendEndpoint.ProxyCapabilities, modifier)) return { state: "pending" };
|
|
19975
|
+
const query = queryStore.get(BackendEndpoint.ProxyCapabilities, modifier);
|
|
19976
|
+
if (toValue$1(query.status) !== "success") return { state: "pending" };
|
|
19977
|
+
const carriers = toValue$1(query.data) ?? [];
|
|
19978
|
+
const queryCarrier = selection.value.carrier;
|
|
19979
|
+
const matched = carriers.find((carrier) => carrier.carrier === queryCarrier);
|
|
19980
|
+
return matched ? { state: "matched", carrier: matched } : { state: "invalid_combo" };
|
|
19981
|
+
};
|
|
19982
|
+
const useCapabilitiesAutoClear = (form, allOptionKeys, orderId, inheritedDeliveryOptions, selection) => {
|
|
19983
|
+
const queryStore = useQueryStore();
|
|
19984
|
+
const notificationStore = useNotificationStore();
|
|
19985
|
+
const { translate: translate2 } = useLanguage();
|
|
19986
|
+
const { getCarrierCapabilitiesForOrder } = useFormCapabilities();
|
|
19987
|
+
let lastModifiedAxis;
|
|
19988
|
+
let lastModifiedPreviousValue;
|
|
19989
|
+
let suppressTracking = false;
|
|
19990
|
+
const setSilently = (fieldName, value) => {
|
|
19991
|
+
if (form.getValue(fieldName) === value) return false;
|
|
19992
|
+
suppressTracking = true;
|
|
19993
|
+
try {
|
|
19994
|
+
setFieldValue(form, fieldName, value);
|
|
19995
|
+
} finally {
|
|
19996
|
+
suppressTracking = false;
|
|
19997
|
+
}
|
|
19998
|
+
return true;
|
|
19999
|
+
};
|
|
20000
|
+
const previousAxisValues = {
|
|
20001
|
+
[FIELD_CARRIER]: form.getValue(FIELD_CARRIER),
|
|
20002
|
+
[FIELD_PACKAGE_TYPE]: form.getValue(FIELD_PACKAGE_TYPE),
|
|
20003
|
+
[FIELD_DELIVERY_TYPE]: form.getValue(FIELD_DELIVERY_TYPE)
|
|
20004
|
+
};
|
|
20005
|
+
watch(
|
|
20006
|
+
[
|
|
20007
|
+
() => form.getValue(FIELD_CARRIER),
|
|
20008
|
+
() => form.getValue(FIELD_PACKAGE_TYPE),
|
|
20009
|
+
() => form.getValue(FIELD_DELIVERY_TYPE),
|
|
20010
|
+
...allOptionKeys.map((key) => () => form.getValue(optionFieldName(key)))
|
|
20011
|
+
],
|
|
20012
|
+
() => {
|
|
20013
|
+
notificationStore.remove(CAPABILITIES_CLEARED_NOTIFICATION_ID);
|
|
20014
|
+
},
|
|
20015
|
+
{ flush: "sync" }
|
|
20016
|
+
);
|
|
20017
|
+
watch(
|
|
20018
|
+
[
|
|
20019
|
+
() => form.getValue(FIELD_CARRIER),
|
|
20020
|
+
() => form.getValue(FIELD_PACKAGE_TYPE),
|
|
20021
|
+
() => form.getValue(FIELD_DELIVERY_TYPE)
|
|
20022
|
+
],
|
|
20023
|
+
([carrierValue, packageTypeValue, deliveryTypeValue]) => {
|
|
20024
|
+
if (!suppressTracking) {
|
|
20025
|
+
if (carrierValue !== previousAxisValues[FIELD_CARRIER]) {
|
|
20026
|
+
lastModifiedAxis = FIELD_CARRIER;
|
|
20027
|
+
lastModifiedPreviousValue = previousAxisValues[FIELD_CARRIER];
|
|
20028
|
+
} else if (packageTypeValue !== previousAxisValues[FIELD_PACKAGE_TYPE]) {
|
|
20029
|
+
lastModifiedAxis = FIELD_PACKAGE_TYPE;
|
|
20030
|
+
lastModifiedPreviousValue = previousAxisValues[FIELD_PACKAGE_TYPE];
|
|
20031
|
+
} else if (deliveryTypeValue !== previousAxisValues[FIELD_DELIVERY_TYPE]) {
|
|
20032
|
+
lastModifiedAxis = FIELD_DELIVERY_TYPE;
|
|
20033
|
+
lastModifiedPreviousValue = previousAxisValues[FIELD_DELIVERY_TYPE];
|
|
20034
|
+
}
|
|
20035
|
+
}
|
|
20036
|
+
previousAxisValues[FIELD_CARRIER] = carrierValue;
|
|
20037
|
+
previousAxisValues[FIELD_PACKAGE_TYPE] = packageTypeValue;
|
|
20038
|
+
previousAxisValues[FIELD_DELIVERY_TYPE] = deliveryTypeValue;
|
|
20039
|
+
},
|
|
20040
|
+
// `sync` flush is essential here: `suppressTracking` is set inside `setSilently`'s
|
|
20041
|
+
// `try`/`finally`, which is synchronous. With Vue's default (`pre`) flush, the watcher
|
|
20042
|
+
// callback runs LATER — by which time `suppressTracking` has been reset to `false`, and
|
|
20043
|
+
// the silent write gets attributed to the user. That makes `lastModifiedPreviousValue`
|
|
20044
|
+
// capture the value the auto-clear just overwrote, and the next `revertAxis` reverts to
|
|
20045
|
+
// it — producing a flip-flop cycle visible to the merchant. Sync flush fires the callback
|
|
20046
|
+
// inside the ref setter so it observes `suppressTracking === true`.
|
|
20047
|
+
{ flush: "sync" }
|
|
20048
|
+
);
|
|
20049
|
+
const revertAxis = (axis) => {
|
|
20050
|
+
const target = lastModifiedAxis === axis ? lastModifiedPreviousValue : void 0;
|
|
20051
|
+
const changed = setSilently(axis, target);
|
|
20052
|
+
return { restored: target !== void 0, changed };
|
|
20053
|
+
};
|
|
20054
|
+
const inheritedDefault = (carrierName, axis) => {
|
|
20055
|
+
const defaults = inheritedDeliveryOptions[carrierName];
|
|
20056
|
+
if (!defaults) return void 0;
|
|
20057
|
+
return axis === FIELD_PACKAGE_TYPE ? defaults.packageType : defaults.deliveryType;
|
|
20058
|
+
};
|
|
20059
|
+
const applyCarrierDefaults = () => {
|
|
20060
|
+
const carrierName = form.getValue(FIELD_CARRIER);
|
|
20061
|
+
const pkgDefault = carrierName ? inheritedDefault(carrierName, FIELD_PACKAGE_TYPE) : void 0;
|
|
20062
|
+
const dtDefault = carrierName ? inheritedDefault(carrierName, FIELD_DELIVERY_TYPE) : void 0;
|
|
20063
|
+
if (pkgDefault !== void 0) {
|
|
20064
|
+
setSilently(FIELD_PACKAGE_TYPE, pkgDefault);
|
|
20065
|
+
}
|
|
20066
|
+
if (dtDefault !== void 0) {
|
|
20067
|
+
setSilently(FIELD_DELIVERY_TYPE, dtDefault);
|
|
20068
|
+
}
|
|
20069
|
+
};
|
|
20070
|
+
const lineForAxisClear = (axis, restored) => {
|
|
20071
|
+
const fieldLabel = translate2(FIELD_TO_LABEL_KEY[axis]);
|
|
20072
|
+
return restored ? translate2({ key: "capabilities_cleared_field_reverted", args: { field: fieldLabel } }) : translate2({ key: "capabilities_cleared_field_cleared", args: { field: fieldLabel } });
|
|
20073
|
+
};
|
|
20074
|
+
const lineForOptionClear = (optionKey) => {
|
|
20075
|
+
const fieldLabel = translate2(optionLabelKey(optionKey));
|
|
20076
|
+
return translate2({ key: "capabilities_cleared_option_cleared", args: { field: fieldLabel } });
|
|
20077
|
+
};
|
|
20078
|
+
const notifyClears = (lines) => {
|
|
20079
|
+
if (lines.length === 0) return;
|
|
20080
|
+
addCapabilitiesClearNotification(notificationStore, translate2("capabilities_cleared"), lines);
|
|
20081
|
+
};
|
|
20082
|
+
const resolveInvalidCombo = () => {
|
|
20083
|
+
if (lastModifiedAxis === FIELD_CARRIER) {
|
|
20084
|
+
applyCarrierDefaults();
|
|
20085
|
+
return [];
|
|
20086
|
+
}
|
|
20087
|
+
if (lastModifiedAxis === FIELD_PACKAGE_TYPE || lastModifiedAxis === FIELD_DELIVERY_TYPE) {
|
|
20088
|
+
const { restored, changed } = revertAxis(lastModifiedAxis);
|
|
20089
|
+
return changed ? [lineForAxisClear(lastModifiedAxis, restored)] : [];
|
|
20090
|
+
}
|
|
20091
|
+
const wrote = setSilently(FIELD_DELIVERY_TYPE, void 0);
|
|
20092
|
+
return wrote ? [lineForAxisClear(FIELD_DELIVERY_TYPE, false)] : [];
|
|
20093
|
+
};
|
|
20094
|
+
watch(
|
|
20095
|
+
() => {
|
|
20096
|
+
const carrier = getCarrierCapabilitiesForOrder(form);
|
|
20097
|
+
const packageType = form.getValue(FIELD_PACKAGE_TYPE);
|
|
20098
|
+
const deliveryType = form.getValue(FIELD_DELIVERY_TYPE);
|
|
20099
|
+
return {
|
|
20100
|
+
carrierName: carrier == null ? void 0 : carrier.carrier,
|
|
20101
|
+
packageTypesInCarrier: (carrier == null ? void 0 : carrier.packageTypes) ?? [],
|
|
20102
|
+
deliveryTypesInCarrier: (carrier == null ? void 0 : carrier.deliveryTypes) ?? [],
|
|
20103
|
+
packageType,
|
|
20104
|
+
deliveryType
|
|
20105
|
+
};
|
|
20106
|
+
},
|
|
20107
|
+
({ carrierName, packageTypesInCarrier, deliveryTypesInCarrier, packageType, deliveryType }) => {
|
|
20108
|
+
if (!carrierName) return;
|
|
20109
|
+
const packageTypeInvalid = Boolean(packageType) && !packageTypesInCarrier.includes(packageType);
|
|
20110
|
+
const deliveryTypeInvalid = Boolean(deliveryType) && !deliveryTypesInCarrier.includes(deliveryType);
|
|
20111
|
+
if (!packageTypeInvalid && !deliveryTypeInvalid) return;
|
|
20112
|
+
if (lastModifiedAxis === FIELD_CARRIER) {
|
|
20113
|
+
applyCarrierDefaults();
|
|
20114
|
+
return;
|
|
20115
|
+
}
|
|
20116
|
+
const lines = [];
|
|
20117
|
+
if (packageTypeInvalid) {
|
|
20118
|
+
const { restored, changed } = revertAxis(FIELD_PACKAGE_TYPE);
|
|
20119
|
+
if (changed) lines.push(lineForAxisClear(FIELD_PACKAGE_TYPE, restored));
|
|
20120
|
+
}
|
|
20121
|
+
if (deliveryTypeInvalid) {
|
|
20122
|
+
const { restored, changed } = revertAxis(FIELD_DELIVERY_TYPE);
|
|
20123
|
+
if (changed) lines.push(lineForAxisClear(FIELD_DELIVERY_TYPE, restored));
|
|
20124
|
+
}
|
|
20125
|
+
notifyClears(lines);
|
|
20126
|
+
},
|
|
20127
|
+
{ deep: true }
|
|
20128
|
+
);
|
|
20129
|
+
watch(
|
|
20130
|
+
() => readShipmentSnapshot(selection, queryStore, orderId),
|
|
20131
|
+
(snapshot) => {
|
|
20132
|
+
if (snapshot.state === "pending") return;
|
|
20133
|
+
if (snapshot.state === "invalid_combo") {
|
|
20134
|
+
notifyClears(resolveInvalidCombo());
|
|
20135
|
+
return;
|
|
20136
|
+
}
|
|
20137
|
+
const availableOptionKeys = Object.keys(snapshot.carrier.options);
|
|
20138
|
+
const lines = [];
|
|
20139
|
+
const silent = lastModifiedAxis === FIELD_CARRIER;
|
|
20140
|
+
for (const optionKey of allOptionKeys) {
|
|
20141
|
+
const fieldName = optionFieldName(optionKey);
|
|
20142
|
+
const value = form.getValue(fieldName);
|
|
20143
|
+
const isActive = value !== void 0 && value !== TriState.Inherit && Boolean(value);
|
|
20144
|
+
if (!isActive) continue;
|
|
20145
|
+
if (availableOptionKeys.includes(optionKey)) continue;
|
|
20146
|
+
setSilently(fieldName, TriState.Inherit);
|
|
20147
|
+
if (!silent) {
|
|
20148
|
+
lines.push(lineForOptionClear(optionKey));
|
|
20149
|
+
}
|
|
20150
|
+
}
|
|
20151
|
+
notifyClears(lines);
|
|
20152
|
+
}
|
|
20153
|
+
);
|
|
20154
|
+
};
|
|
19747
20155
|
const createRef = (refs, field, fallback) => {
|
|
19748
20156
|
return ref(refs[field] ?? fallback);
|
|
19749
20157
|
};
|
|
19750
20158
|
const createShipmentOptionField = (refs, fieldName, config) => {
|
|
19751
20159
|
const name = fieldName.split(".").pop() ?? fieldName;
|
|
20160
|
+
const capabilities = useFormCapabilities();
|
|
19752
20161
|
return defineFormField({
|
|
19753
20162
|
name: fieldName,
|
|
19754
20163
|
component: resolveFormComponent(AdminComponent.TriStateInput),
|
|
19755
20164
|
ref: createRef(refs, fieldName, TriState.Inherit),
|
|
19756
20165
|
label: getFieldLabel(name),
|
|
19757
|
-
visibleWhen:
|
|
19758
|
-
|
|
20166
|
+
visibleWhen: ({ form }) => capabilities.hasShipmentOption(form, name),
|
|
20167
|
+
// Disabled when the carrier doesn't support this option.
|
|
20168
|
+
// Required options use readOnlyWhen instead, keeping them enabled
|
|
20169
|
+
// so their value is included in the form body by getEnabledValues().
|
|
20170
|
+
disabledWhen: ({ form }) => !capabilities.hasShipmentOption(form, name),
|
|
20171
|
+
// Read-only prevents the TriState "inherit" toggle from being used,
|
|
20172
|
+
// fully locking the field when the carrier requires this option.
|
|
20173
|
+
readOnlyWhen: ({ form }) => {
|
|
20174
|
+
var _a, _b, _c;
|
|
20175
|
+
return ((_c = (_b = (_a = capabilities.getCarrierCapabilitiesForShipment(form)) == null ? void 0 : _a.options) == null ? void 0 : _b[name]) == null ? void 0 : _c.isRequired) === true;
|
|
20176
|
+
},
|
|
20177
|
+
afterUpdate(field, value) {
|
|
20178
|
+
var _a, _b, _c, _d, _e2;
|
|
20179
|
+
const carrier = capabilities.getCarrierCapabilitiesForShipment(field.form);
|
|
20180
|
+
const option = (_a = carrier == null ? void 0 : carrier.options) == null ? void 0 : _a[name];
|
|
20181
|
+
if (!option) {
|
|
20182
|
+
return;
|
|
20183
|
+
}
|
|
20184
|
+
if (option.isRequired === true && value !== TriState.On) {
|
|
20185
|
+
setFieldRef(field, TriState.On);
|
|
20186
|
+
return;
|
|
20187
|
+
}
|
|
20188
|
+
const isEnabled = TriState.On === value;
|
|
20189
|
+
for (const requiredOption of option.requires ?? []) {
|
|
20190
|
+
const targetFieldName = `${FIELD_SHIPMENT_OPTIONS_PREFIX}.${requiredOption}`;
|
|
20191
|
+
const targetField = field.form.getField(targetFieldName);
|
|
20192
|
+
if (!targetField) {
|
|
20193
|
+
continue;
|
|
20194
|
+
}
|
|
20195
|
+
if (isEnabled) {
|
|
20196
|
+
setFieldRef(targetField, TriState.On);
|
|
20197
|
+
targetField.props.readOnly = true;
|
|
20198
|
+
} else {
|
|
20199
|
+
const isRequiredByCarrier = ((_c = (_b = carrier == null ? void 0 : carrier.options) == null ? void 0 : _b[requiredOption]) == null ? void 0 : _c.isRequired) === true;
|
|
20200
|
+
if (!isRequiredByCarrier) {
|
|
20201
|
+
targetField.props.readOnly = false;
|
|
20202
|
+
}
|
|
20203
|
+
}
|
|
20204
|
+
}
|
|
20205
|
+
for (const excludedOption of option.excludes ?? []) {
|
|
20206
|
+
const targetFieldName = `${FIELD_SHIPMENT_OPTIONS_PREFIX}.${excludedOption}`;
|
|
20207
|
+
const targetField = field.form.getField(targetFieldName);
|
|
20208
|
+
if (!targetField) {
|
|
20209
|
+
continue;
|
|
20210
|
+
}
|
|
20211
|
+
if (isEnabled) {
|
|
20212
|
+
setFieldRef(targetField, TriState.Off);
|
|
20213
|
+
targetField.props.readOnly = true;
|
|
20214
|
+
} else {
|
|
20215
|
+
const isRequiredByCarrier = ((_e2 = (_d = carrier == null ? void 0 : carrier.options) == null ? void 0 : _d[excludedOption]) == null ? void 0 : _e2.isRequired) === true;
|
|
20216
|
+
if (!isRequiredByCarrier) {
|
|
20217
|
+
targetField.props.readOnly = false;
|
|
20218
|
+
}
|
|
20219
|
+
}
|
|
20220
|
+
}
|
|
20221
|
+
},
|
|
19759
20222
|
...config
|
|
19760
20223
|
});
|
|
19761
20224
|
};
|
|
19762
|
-
const createHideSenderField = (refs) => {
|
|
19763
|
-
return createShipmentOptionField(refs, FIELD_HIDE_SENDER);
|
|
19764
|
-
};
|
|
19765
20225
|
const createDeliveryTypeField = (refs) => {
|
|
19766
20226
|
return defineFormField({
|
|
19767
20227
|
name: FIELD_DELIVERY_TYPE,
|
|
@@ -19771,89 +20231,94 @@ const createDeliveryTypeField = (refs) => {
|
|
|
19771
20231
|
// options defined in afterUpdate of `createCarrierField`
|
|
19772
20232
|
});
|
|
19773
20233
|
};
|
|
19774
|
-
const createAgeCheckField = (refs) => {
|
|
19775
|
-
return createShipmentOptionField(refs, FIELD_AGE_CHECK, {
|
|
19776
|
-
afterUpdate(field) {
|
|
19777
|
-
const { form } = field;
|
|
19778
|
-
setPostNlAgeCheckSubtext(field);
|
|
19779
|
-
if (!triStateFieldIsEnabled(field.form, FIELD_AGE_CHECK)) {
|
|
19780
|
-
return;
|
|
19781
|
-
}
|
|
19782
|
-
switch (getFormCarrierName(form)) {
|
|
19783
|
-
case CarrierName.PostNl:
|
|
19784
|
-
form.setValue(FIELD_SIGNATURE, TriState.On);
|
|
19785
|
-
form.setValue(FIELD_ONLY_RECIPIENT, TriState.On);
|
|
19786
|
-
break;
|
|
19787
|
-
case CarrierName.DhlForYou:
|
|
19788
|
-
form.setValue(FIELD_SIGNATURE, TriState.Off);
|
|
19789
|
-
break;
|
|
19790
|
-
}
|
|
19791
|
-
}
|
|
19792
|
-
});
|
|
19793
|
-
};
|
|
19794
|
-
const getCarrier = (form) => {
|
|
19795
|
-
const dynamicContext = useContext(AdminContextKey.Dynamic);
|
|
19796
|
-
const chosenCarrier = form.getValue(FIELD_CARRIER);
|
|
19797
|
-
return dynamicContext.carriers.find((carrier) => carrier.externalIdentifier === chosenCarrier);
|
|
19798
|
-
};
|
|
19799
|
-
const getDeliveryTypes = (form) => {
|
|
19800
|
-
let array = Object.values(DeliveryTypeName);
|
|
19801
|
-
if (form) {
|
|
19802
|
-
const carrier = getCarrier(form);
|
|
19803
|
-
array = array.filter((name) => carrier == null ? void 0 : carrier.capabilities.deliveryTypes.includes(name));
|
|
19804
|
-
}
|
|
19805
|
-
return array.map((name) => ({
|
|
19806
|
-
label: getDynamicTranslation("delivery_type", name),
|
|
19807
|
-
value: name
|
|
19808
|
-
}));
|
|
19809
|
-
};
|
|
19810
20234
|
const createCarrierField = (refs, inheritedDeliveryOptions) => {
|
|
19811
20235
|
const dynamicContext = useContext(AdminContextKey.Dynamic);
|
|
19812
|
-
const
|
|
20236
|
+
const capabilities = useFormCapabilities();
|
|
20237
|
+
const queryStore = useQueryStore();
|
|
20238
|
+
const orderId = getOrderId();
|
|
20239
|
+
const orderModifier = typeof orderId === "string" ? `${orderId}.order` : void 0;
|
|
19813
20240
|
const { translate: translate2 } = useLanguage();
|
|
20241
|
+
const staticMeta = /* @__PURE__ */ new Map();
|
|
20242
|
+
const readOrderCarriers = () => {
|
|
20243
|
+
if (!orderModifier || !queryStore.has(BackendEndpoint.ProxyCapabilities, orderModifier)) {
|
|
20244
|
+
return void 0;
|
|
20245
|
+
}
|
|
20246
|
+
const query = queryStore.get(BackendEndpoint.ProxyCapabilities, orderModifier);
|
|
20247
|
+
const status = toValue$1(query.status);
|
|
20248
|
+
const fetchStatus = toValue$1(query.fetchStatus);
|
|
20249
|
+
if (status === "success") {
|
|
20250
|
+
return toValue$1(query.data) ?? [];
|
|
20251
|
+
}
|
|
20252
|
+
if (status === "error") {
|
|
20253
|
+
return void 0;
|
|
20254
|
+
}
|
|
20255
|
+
if (fetchStatus === "idle") {
|
|
20256
|
+
return void 0;
|
|
20257
|
+
}
|
|
20258
|
+
return "loading";
|
|
20259
|
+
};
|
|
20260
|
+
const computeOptions = (state) => {
|
|
20261
|
+
if (state === "loading") return [];
|
|
20262
|
+
const validCarrierNames = Array.isArray(state) ? new Set(state.map((c2) => c2.carrier)) : null;
|
|
20263
|
+
const carriersToRender = validCarrierNames ? dynamicContext.carriers.filter((carrier) => validCarrierNames.has(carrier.carrier ?? "")) : dynamicContext.carriers;
|
|
20264
|
+
return carriersToRender.map((carrier) => {
|
|
20265
|
+
const name = carrier.carrier ?? "";
|
|
20266
|
+
const meta = staticMeta.get(name);
|
|
20267
|
+
return {
|
|
20268
|
+
plainLabel: (meta == null ? void 0 : meta.label) ?? name,
|
|
20269
|
+
value: name,
|
|
20270
|
+
image: meta == null ? void 0 : meta.image
|
|
20271
|
+
};
|
|
20272
|
+
});
|
|
20273
|
+
};
|
|
19814
20274
|
return defineFormField({
|
|
19815
20275
|
name: FIELD_CARRIER,
|
|
19816
20276
|
label: "carrier",
|
|
19817
|
-
ref: createRef(refs, FIELD_CARRIER,
|
|
20277
|
+
ref: createRef(refs, FIELD_CARRIER, dynamicContext.shop.defaultCarrier ?? void 0),
|
|
19818
20278
|
component: resolveFormComponent(AdminComponent.RadioGroup),
|
|
19819
20279
|
props: {
|
|
19820
20280
|
options: []
|
|
19821
20281
|
},
|
|
19822
20282
|
onBeforeMount: async (field) => {
|
|
19823
20283
|
var _a;
|
|
19824
|
-
|
|
20284
|
+
await Promise.all(
|
|
19825
20285
|
dynamicContext.carriers.map(async (carrier) => {
|
|
19826
|
-
const query = useFetchCarrier(carrier.
|
|
20286
|
+
const query = useFetchCarrier(carrier.carrier);
|
|
19827
20287
|
await query.suspense();
|
|
19828
|
-
const apiCarrier = toValue(query.data);
|
|
19829
|
-
|
|
19830
|
-
|
|
19831
|
-
plainLabel += ` ${carrier.label ?? translate2(`carrier_type_${carrier.type}`)}`;
|
|
19832
|
-
}
|
|
19833
|
-
return {
|
|
19834
|
-
plainLabel,
|
|
19835
|
-
value: carrier.externalIdentifier ?? (apiCarrier == null ? void 0 : apiCarrier.name) ?? "",
|
|
20288
|
+
const apiCarrier = toValue$1(query.data);
|
|
20289
|
+
staticMeta.set(carrier.carrier ?? "", {
|
|
20290
|
+
label: (apiCarrier == null ? void 0 : apiCarrier.human) ?? translate2(`carrier_${snakeCase(carrier.carrier)}`) ?? "",
|
|
19836
20291
|
image: (apiCarrier == null ? void 0 : apiCarrier.meta.logo_svg) ? createAssetUrl(apiCarrier.meta.logo_svg) : void 0
|
|
19837
|
-
};
|
|
20292
|
+
});
|
|
19838
20293
|
})
|
|
19839
20294
|
);
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
20295
|
+
watch(
|
|
20296
|
+
() => readOrderCarriers(),
|
|
20297
|
+
(state) => {
|
|
20298
|
+
setFieldProp(field, PROP_OPTIONS, computeOptions(state));
|
|
20299
|
+
const carrier = capabilities.getCarrierCapabilitiesForOrder(field.form);
|
|
20300
|
+
if (carrier) {
|
|
20301
|
+
setFieldProp(field.form, FIELD_PACKAGE_TYPE, PROP_OPTIONS, getPackageTypes(carrier));
|
|
20302
|
+
setFieldProp(field.form, FIELD_DELIVERY_TYPE, PROP_OPTIONS, getDeliveryTypes(carrier));
|
|
20303
|
+
}
|
|
20304
|
+
},
|
|
20305
|
+
{ immediate: true }
|
|
20306
|
+
);
|
|
20307
|
+
await ((_a = field == null ? void 0 : field.afterUpdate) == null ? void 0 : _a.call(field, field, toValue$1(field.ref), void 0));
|
|
20308
|
+
updateFieldsDefaults(toValue$1(field.ref), field, inheritedDeliveryOptions);
|
|
19843
20309
|
},
|
|
19844
20310
|
afterUpdate: (field, newCarrier) => {
|
|
19845
20311
|
updateFieldsDefaults(newCarrier, field, inheritedDeliveryOptions);
|
|
19846
|
-
|
|
19847
|
-
setFieldProp(field.form, FIELD_PACKAGE_TYPE, PROP_OPTIONS, getPackageTypes(
|
|
19848
|
-
setFieldProp(field.form, FIELD_DELIVERY_TYPE, PROP_OPTIONS, getDeliveryTypes(
|
|
19849
|
-
setPostNlAgeCheckSubtext(field);
|
|
20312
|
+
const carrier = capabilities.getCarrierCapabilitiesForOrder(field.form);
|
|
20313
|
+
setFieldProp(field.form, FIELD_PACKAGE_TYPE, PROP_OPTIONS, getPackageTypes(carrier));
|
|
20314
|
+
setFieldProp(field.form, FIELD_DELIVERY_TYPE, PROP_OPTIONS, getDeliveryTypes(carrier));
|
|
19850
20315
|
}
|
|
19851
20316
|
});
|
|
19852
20317
|
};
|
|
19853
20318
|
const createDigitalStampRangeField = (refs, order) => {
|
|
19854
20319
|
var _a, _b;
|
|
19855
20320
|
const pluginSettings = usePluginSettings();
|
|
19856
|
-
const fallbackOrderData = order ? void 0 : toValue(useOrderData().order);
|
|
20321
|
+
const fallbackOrderData = order ? void 0 : toValue$1(useOrderData().order);
|
|
19857
20322
|
const orderData = order ?? fallbackOrderData;
|
|
19858
20323
|
const { initialWeight, manualWeight } = (orderData == null ? void 0 : orderData.physicalProperties) ?? {};
|
|
19859
20324
|
const totalWeight = Number(initialWeight) + Number(pluginSettings.order.emptyDigitalStampWeight ?? 0);
|
|
@@ -19864,8 +20329,9 @@ const createDigitalStampRangeField = (refs, order) => {
|
|
|
19864
20329
|
label: "weight_range",
|
|
19865
20330
|
ref: ref(selectedValue ?? TriState.Inherit),
|
|
19866
20331
|
component: resolveFormComponent(AdminComponent.SelectInput),
|
|
19867
|
-
|
|
19868
|
-
|
|
20332
|
+
// @TODO Remove package type checks when the context provides visibility restrictions per option.
|
|
20333
|
+
visibleWhen: (field) => field.form.getValue(FIELD_PACKAGE_TYPE) === "DIGITAL_STAMP",
|
|
20334
|
+
disabledWhen: (field) => field.form.getValue(FIELD_PACKAGE_TYPE) !== "DIGITAL_STAMP",
|
|
19869
20335
|
props: {
|
|
19870
20336
|
subtext: {
|
|
19871
20337
|
key: "order_weight",
|
|
@@ -19878,19 +20344,22 @@ const createDigitalStampRangeField = (refs, order) => {
|
|
|
19878
20344
|
}
|
|
19879
20345
|
});
|
|
19880
20346
|
};
|
|
19881
|
-
const
|
|
19882
|
-
return createShipmentOptionField(refs, FIELD_DIRECT_RETURN);
|
|
19883
|
-
};
|
|
19884
|
-
const createInsuranceField = (refs) => {
|
|
20347
|
+
const createInsuranceField = (refs, fieldName) => {
|
|
19885
20348
|
const formatter = useLocalizedFormatter();
|
|
19886
|
-
|
|
19887
|
-
|
|
20349
|
+
const capabilities = useFormCapabilities();
|
|
20350
|
+
let stopWatcher;
|
|
20351
|
+
return createShipmentOptionField(refs, fieldName, {
|
|
20352
|
+
ref: createRef(refs, fieldName, 0),
|
|
19888
20353
|
component: resolveFormComponent(AdminComponent.SelectInput),
|
|
19889
|
-
visibleWhen: createHasShipmentOptionWatcher(INSURANCE, false, isPackageTypePackageOrSmall),
|
|
19890
|
-
disabledWhen: createHasShipmentOptionWatcher(INSURANCE, true, isPackageTypePackageOrSmall),
|
|
19891
20354
|
onBeforeMount(field) {
|
|
19892
|
-
|
|
19893
|
-
|
|
20355
|
+
stopWatcher == null ? void 0 : stopWatcher();
|
|
20356
|
+
stopWatcher = watch(
|
|
20357
|
+
() => capabilities.getCarrierCapabilitiesForShipment(field.form),
|
|
20358
|
+
() => {
|
|
20359
|
+
setFieldProp(field, PROP_OPTIONS, capabilities.getInsuranceOptions(field.form, formatter));
|
|
20360
|
+
},
|
|
20361
|
+
{ immediate: true }
|
|
20362
|
+
);
|
|
19894
20363
|
}
|
|
19895
20364
|
});
|
|
19896
20365
|
};
|
|
@@ -19906,53 +20375,17 @@ const createLabelAmountField = (refs) => {
|
|
|
19906
20375
|
}
|
|
19907
20376
|
});
|
|
19908
20377
|
};
|
|
19909
|
-
const createLargeFormatField = (refs) => {
|
|
19910
|
-
return createShipmentOptionField(refs, FIELD_LARGE_FORMAT);
|
|
19911
|
-
};
|
|
19912
|
-
const createOnlyRecipientField = (refs) => {
|
|
19913
|
-
return createShipmentOptionField(refs, FIELD_ONLY_RECIPIENT, {
|
|
19914
|
-
readOnlyWhen: ({ form }) => hasPostNlAgeCheck(form),
|
|
19915
|
-
afterUpdate({ form }, value) {
|
|
19916
|
-
if (!(CarrierName.DhlForYou === getFormCarrierName(form) && TriState.On === value)) {
|
|
19917
|
-
return;
|
|
19918
|
-
}
|
|
19919
|
-
form.setValue(FIELD_AGE_CHECK, TriState.Off);
|
|
19920
|
-
}
|
|
19921
|
-
});
|
|
19922
|
-
};
|
|
19923
20378
|
const createPackageTypeField = (refs) => {
|
|
19924
20379
|
return defineFormField({
|
|
19925
20380
|
name: FIELD_PACKAGE_TYPE,
|
|
19926
20381
|
label: snakeCase(`${SHIPMENT_OPTIONS}_package_type`),
|
|
19927
|
-
ref: createRef(refs, FIELD_PACKAGE_TYPE,
|
|
20382
|
+
ref: createRef(refs, FIELD_PACKAGE_TYPE, "PACKAGE"),
|
|
19928
20383
|
component: resolveFormComponent(AdminComponent.RadioGroup)
|
|
19929
20384
|
// options defined in afterUpdate of `createCarrierField`
|
|
19930
20385
|
});
|
|
19931
20386
|
};
|
|
19932
|
-
const
|
|
19933
|
-
|
|
19934
|
-
visibleWhen: createHasShipmentOptionWatcher(PRIORITY_DELIVERY, false, isPackageTypeMailbox),
|
|
19935
|
-
disabledWhen: createHasShipmentOptionWatcher(PRIORITY_DELIVERY, true, isPackageTypeMailbox)
|
|
19936
|
-
});
|
|
19937
|
-
};
|
|
19938
|
-
const createSameDayDeliveryField = (refs) => {
|
|
19939
|
-
return createShipmentOptionField(refs, FIELD_SAME_DAY_DELIVERY);
|
|
19940
|
-
};
|
|
19941
|
-
const createSignatureField = (refs) => {
|
|
19942
|
-
return createShipmentOptionField(refs, FIELD_SIGNATURE, {
|
|
19943
|
-
readOnlyWhen: ({ form }) => hasPostNlAgeCheck(form)
|
|
19944
|
-
});
|
|
19945
|
-
};
|
|
19946
|
-
const createReceiptCodeField = (refs) => {
|
|
19947
|
-
return createShipmentOptionField(refs, FIELD_RECEIPT_CODE, {
|
|
19948
|
-
readOnlyWhen: ({ form }) => hasPostNlAgeCheck(form),
|
|
19949
|
-
afterUpdate({ form }, value) {
|
|
19950
|
-
if (!(CarrierName.DhlForYou === getFormCarrierName(form) && TriState.On === value)) {
|
|
19951
|
-
return;
|
|
19952
|
-
}
|
|
19953
|
-
form.setValue(FIELD_AGE_CHECK, TriState.Off);
|
|
19954
|
-
}
|
|
19955
|
-
});
|
|
20387
|
+
const fieldFactoryRegistry = {
|
|
20388
|
+
insurance: createInsuranceField
|
|
19956
20389
|
};
|
|
19957
20390
|
const createShipmentOptionsForm = (orders) => {
|
|
19958
20391
|
var _a, _b;
|
|
@@ -19965,34 +20398,68 @@ const createShipmentOptionsForm = (orders) => {
|
|
|
19965
20398
|
addBulkEditNotification(isModal);
|
|
19966
20399
|
}
|
|
19967
20400
|
const order = (isBulk ? void 0 : ordersArray[0]) ?? {};
|
|
19968
|
-
const
|
|
19969
|
-
|
|
19970
|
-
|
|
19971
|
-
|
|
19972
|
-
refs[FIELD_CARRIER] = get(order, `${FIELD_CARRIER}.externalIdentifier`);
|
|
19973
|
-
return Ne(createShipmentFormName(order.externalIdentifier), {
|
|
20401
|
+
const dynamicContext = useContext(AdminContextKey.Dynamic);
|
|
20402
|
+
const allOptionKeys = collectAllOptionKeys(dynamicContext.carriers);
|
|
20403
|
+
const refs = buildDynamicRefs(order, allOptionKeys);
|
|
20404
|
+
const form = Ne(createShipmentFormName(order.externalIdentifier), {
|
|
19974
20405
|
...isModal ? (_a = config.formConfigOverrides) == null ? void 0 : _a.modal : null,
|
|
19975
20406
|
...(_b = config.formConfigOverrides) == null ? void 0 : _b.shipmentOptions,
|
|
19976
|
-
fields:
|
|
19977
|
-
// General delivery options
|
|
19978
|
-
createCarrierField(refs, order.inheritedDeliveryOptions),
|
|
19979
|
-
createPackageTypeField(refs),
|
|
19980
|
-
createDeliveryTypeField(refs),
|
|
19981
|
-
createLabelAmountField(refs),
|
|
19982
|
-
createDigitalStampRangeField(refs, order),
|
|
19983
|
-
// Actual shipment options
|
|
19984
|
-
createAgeCheckField(refs),
|
|
19985
|
-
createSignatureField(refs),
|
|
19986
|
-
createOnlyRecipientField(refs),
|
|
19987
|
-
createDirectReturnField(refs),
|
|
19988
|
-
createLargeFormatField(refs),
|
|
19989
|
-
createHideSenderField(refs),
|
|
19990
|
-
createSameDayDeliveryField(refs),
|
|
19991
|
-
createReceiptCodeField(refs),
|
|
19992
|
-
createInsuranceField(refs),
|
|
19993
|
-
createPriorityDeliveryField(refs)
|
|
19994
|
-
]
|
|
20407
|
+
fields: createShipmentOptionsFields(refs, order, allOptionKeys)
|
|
19995
20408
|
});
|
|
20409
|
+
if (!isBulk && order.externalIdentifier) {
|
|
20410
|
+
const wired = wireProxyCapabilities(form, order);
|
|
20411
|
+
if (wired) {
|
|
20412
|
+
useCapabilitiesAutoClear(
|
|
20413
|
+
form,
|
|
20414
|
+
allOptionKeys,
|
|
20415
|
+
order.externalIdentifier,
|
|
20416
|
+
order.inheritedDeliveryOptions,
|
|
20417
|
+
wired.selection
|
|
20418
|
+
);
|
|
20419
|
+
}
|
|
20420
|
+
}
|
|
20421
|
+
return form;
|
|
20422
|
+
};
|
|
20423
|
+
const collectAllOptionKeys = (carriers) => {
|
|
20424
|
+
const keys = /* @__PURE__ */ new Set();
|
|
20425
|
+
for (const carrier of carriers) {
|
|
20426
|
+
if (!carrier.options) continue;
|
|
20427
|
+
for (const key of Object.keys(carrier.options)) {
|
|
20428
|
+
keys.add(key);
|
|
20429
|
+
}
|
|
20430
|
+
}
|
|
20431
|
+
return [...keys];
|
|
20432
|
+
};
|
|
20433
|
+
const buildDynamicRefs = (order, optionKeys) => {
|
|
20434
|
+
const refs = {};
|
|
20435
|
+
refs[FIELD_CARRIER] = get(order, `${FIELD_CARRIER}.carrier`);
|
|
20436
|
+
refs[FIELD_LABEL_AMOUNT] = get(order, FIELD_LABEL_AMOUNT);
|
|
20437
|
+
refs[FIELD_PACKAGE_TYPE] = get(order, FIELD_PACKAGE_TYPE);
|
|
20438
|
+
refs[FIELD_DELIVERY_TYPE] = get(order, FIELD_DELIVERY_TYPE);
|
|
20439
|
+
refs[FIELD_MANUAL_WEIGHT] = get(order, FIELD_MANUAL_WEIGHT);
|
|
20440
|
+
for (const key of optionKeys) {
|
|
20441
|
+
const fieldName = `${FIELD_SHIPMENT_OPTIONS_PREFIX}.${key}`;
|
|
20442
|
+
refs[fieldName] = get(order, fieldName);
|
|
20443
|
+
}
|
|
20444
|
+
return refs;
|
|
20445
|
+
};
|
|
20446
|
+
const createShipmentOptionsFields = (refs, order, optionKeys) => {
|
|
20447
|
+
const staticFields = [
|
|
20448
|
+
createCarrierField(refs, order.inheritedDeliveryOptions),
|
|
20449
|
+
createPackageTypeField(refs),
|
|
20450
|
+
createDeliveryTypeField(refs),
|
|
20451
|
+
createLabelAmountField(refs),
|
|
20452
|
+
createDigitalStampRangeField(refs, order)
|
|
20453
|
+
];
|
|
20454
|
+
const dynamicFields = optionKeys.map((key) => {
|
|
20455
|
+
const fieldName = `${FIELD_SHIPMENT_OPTIONS_PREFIX}.${key}`;
|
|
20456
|
+
const factory = fieldFactoryRegistry[key];
|
|
20457
|
+
if (factory) {
|
|
20458
|
+
return factory(refs, fieldName);
|
|
20459
|
+
}
|
|
20460
|
+
return createShipmentOptionField(refs, fieldName);
|
|
20461
|
+
});
|
|
20462
|
+
return [...staticFields, ...dynamicFields];
|
|
19996
20463
|
};
|
|
19997
20464
|
const createLabel = (label, type) => {
|
|
19998
20465
|
return label ? `${label}_${type}` : void 0;
|
|
@@ -20009,6 +20476,20 @@ const addBulkEditNotification = (isModal) => {
|
|
|
20009
20476
|
timeout: false
|
|
20010
20477
|
});
|
|
20011
20478
|
};
|
|
20479
|
+
const CAPABILITIES_CLEARED_NOTIFICATION_ID = "capabilities_cleared";
|
|
20480
|
+
const addCapabilitiesClearNotification = (notificationStore, title, lines) => {
|
|
20481
|
+
if (lines.length === 0) return;
|
|
20482
|
+
const isModal = AdminModalKey.ShipmentOptions === useModalStore().opened;
|
|
20483
|
+
notificationStore.remove(CAPABILITIES_CLEARED_NOTIFICATION_ID);
|
|
20484
|
+
notificationStore.add({
|
|
20485
|
+
id: CAPABILITIES_CLEARED_NOTIFICATION_ID,
|
|
20486
|
+
variant: Variant.Warning,
|
|
20487
|
+
title,
|
|
20488
|
+
content: lines,
|
|
20489
|
+
category: isModal ? NotificationCategory.Modal : NotificationCategory.Action,
|
|
20490
|
+
timeout: false
|
|
20491
|
+
});
|
|
20492
|
+
};
|
|
20012
20493
|
const createDefaultOption = (value) => ({
|
|
20013
20494
|
label: {
|
|
20014
20495
|
key: "option_inherit_value",
|
|
@@ -20018,16 +20499,6 @@ const createDefaultOption = (value) => ({
|
|
|
20018
20499
|
},
|
|
20019
20500
|
value: TriState.Inherit
|
|
20020
20501
|
});
|
|
20021
|
-
const isPackageTypePackage = (form) => {
|
|
20022
|
-
return PackageTypeName.Package === form.getValue(FIELD_PACKAGE_TYPE);
|
|
20023
|
-
};
|
|
20024
|
-
const hasShipmentOption = (form, option) => {
|
|
20025
|
-
const carrier = getCarrier(form);
|
|
20026
|
-
return Boolean(carrier == null ? void 0 : carrier.capabilities.shipmentOptions[option]);
|
|
20027
|
-
};
|
|
20028
|
-
const createHasShipmentOptionWatcher = (shipmentOption, invert = false, validator = isPackageTypePackage) => {
|
|
20029
|
-
return ({ form }) => (validator(form) && hasShipmentOption(form, shipmentOption)) !== invert;
|
|
20030
|
-
};
|
|
20031
20502
|
const defineFormField = (config) => {
|
|
20032
20503
|
const { props, label } = config;
|
|
20033
20504
|
return Xe({
|
|
@@ -20039,59 +20510,24 @@ const defineFormField = (config) => {
|
|
|
20039
20510
|
}
|
|
20040
20511
|
});
|
|
20041
20512
|
};
|
|
20042
|
-
const
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
};
|
|
20046
|
-
const getInsuranceOptions = (field, formatter) => {
|
|
20047
|
-
const carrier = getCarrier(field.form);
|
|
20048
|
-
const insurancePossibilities = (carrier == null ? void 0 : carrier.capabilities.shipmentOptions.insurance) ?? [];
|
|
20049
|
-
const carrierPossibilities = insurancePossibilities.map((amount) => ({
|
|
20050
|
-
plainLabel: formatter.format(Format.Currency, amount / 100),
|
|
20051
|
-
value: amount.toString()
|
|
20052
|
-
}));
|
|
20053
|
-
return [
|
|
20054
|
-
{
|
|
20055
|
-
label: "option_default",
|
|
20056
|
-
value: TriState.Inherit
|
|
20057
|
-
},
|
|
20058
|
-
...carrierPossibilities
|
|
20059
|
-
];
|
|
20060
|
-
};
|
|
20061
|
-
const getPackageTypes = (form) => {
|
|
20062
|
-
let array = Object.values(PackageTypeName);
|
|
20063
|
-
if (form) {
|
|
20064
|
-
const carrier = getCarrier(form);
|
|
20065
|
-
array = array.filter((name) => carrier == null ? void 0 : carrier.capabilities.packageTypes.includes(name));
|
|
20513
|
+
const getDeliveryTypes = (carrier) => {
|
|
20514
|
+
if (!carrier) {
|
|
20515
|
+
return [];
|
|
20066
20516
|
}
|
|
20067
|
-
return
|
|
20068
|
-
label:
|
|
20517
|
+
return carrier.deliveryTypes.map((name) => ({
|
|
20518
|
+
label: getDynamicTranslation("delivery_type", name),
|
|
20069
20519
|
value: name
|
|
20070
20520
|
}));
|
|
20071
20521
|
};
|
|
20072
|
-
const
|
|
20073
|
-
|
|
20074
|
-
if (!
|
|
20075
|
-
return
|
|
20076
|
-
}
|
|
20077
|
-
const value = toValue(field.ref);
|
|
20078
|
-
if (TriState.Inherit === value) {
|
|
20079
|
-
return TriState.On === field.props.defaultValue;
|
|
20522
|
+
const getFieldLabel = (name) => snakeCase(`${SHIPMENT_OPTIONS}_${name}`);
|
|
20523
|
+
const getPackageTypes = (carrier) => {
|
|
20524
|
+
if (!carrier) {
|
|
20525
|
+
return [];
|
|
20080
20526
|
}
|
|
20081
|
-
return
|
|
20082
|
-
|
|
20083
|
-
|
|
20084
|
-
|
|
20085
|
-
return CarrierName.PostNl === carrier && triStateFieldIsEnabled(form, FIELD_AGE_CHECK);
|
|
20086
|
-
};
|
|
20087
|
-
const isPackageTypeMailbox = (form) => {
|
|
20088
|
-
return PackageTypeName.Mailbox === form.getValue(FIELD_PACKAGE_TYPE);
|
|
20089
|
-
};
|
|
20090
|
-
const isPackageTypeSmallPackage = (form) => {
|
|
20091
|
-
return PackageTypeName.PackageSmall === form.getValue(FIELD_PACKAGE_TYPE);
|
|
20092
|
-
};
|
|
20093
|
-
const isPackageTypePackageOrSmall = (form) => {
|
|
20094
|
-
return isPackageTypePackage(form) || isPackageTypeSmallPackage(form);
|
|
20527
|
+
return carrier.packageTypes.map((packageType) => ({
|
|
20528
|
+
label: getPackageTypeTranslation(packageType),
|
|
20529
|
+
value: packageType
|
|
20530
|
+
}));
|
|
20095
20531
|
};
|
|
20096
20532
|
const memoizedResolveFormComponent = memoize((componentName) => {
|
|
20097
20533
|
return resolveComponent(prefixComponent(componentName));
|
|
@@ -20117,16 +20553,8 @@ const setFieldProp = (arg1, arg2, arg3, arg4) => {
|
|
|
20117
20553
|
}
|
|
20118
20554
|
field.props[key] = value;
|
|
20119
20555
|
};
|
|
20120
|
-
const setPostNlAgeCheckSubtext = ({ form }) => {
|
|
20121
|
-
const defaultKey = createLabel(getFieldLabel(AGE_CHECK), KEY_SUBTEXT);
|
|
20122
|
-
if (hasPostNlAgeCheck(form)) {
|
|
20123
|
-
setFieldProp(form, FIELD_AGE_CHECK, KEY_SUBTEXT, `${defaultKey}_${CarrierName.PostNl}`);
|
|
20124
|
-
} else {
|
|
20125
|
-
setFieldProp(form, FIELD_AGE_CHECK, KEY_SUBTEXT, defaultKey);
|
|
20126
|
-
}
|
|
20127
|
-
};
|
|
20128
20556
|
const updateFieldsDefaults = (carrier, { form, name }, inheritedDeliveryOptions) => {
|
|
20129
|
-
toValue(form.fields).forEach((otherField) => {
|
|
20557
|
+
toValue$1(form.fields).forEach((otherField) => {
|
|
20130
20558
|
if (otherField.name === name) {
|
|
20131
20559
|
return;
|
|
20132
20560
|
}
|
|
@@ -20135,6 +20563,71 @@ const updateFieldsDefaults = (carrier, { form, name }, inheritedDeliveryOptions)
|
|
|
20135
20563
|
otherField.props.defaultValue = get(inheritedDeliveryOptions, [carrier, ...optionPathParts]);
|
|
20136
20564
|
});
|
|
20137
20565
|
};
|
|
20566
|
+
const useFormCapabilities = () => {
|
|
20567
|
+
const queryStore = useQueryStore();
|
|
20568
|
+
const dynamicContextQuery = queryStore.get(BackendEndpoint.FetchContext, AdminContextKey.Dynamic);
|
|
20569
|
+
const orderId = getOrderId();
|
|
20570
|
+
const orderModifier = typeof orderId === "string" ? `${orderId}.order` : void 0;
|
|
20571
|
+
const shipmentModifier = typeof orderId === "string" ? `${orderId}.shipment` : void 0;
|
|
20572
|
+
const carriersFromQuery = (modifier) => {
|
|
20573
|
+
if (!queryStore.has(BackendEndpoint.ProxyCapabilities, modifier)) return void 0;
|
|
20574
|
+
const query = queryStore.get(BackendEndpoint.ProxyCapabilities, modifier);
|
|
20575
|
+
if (toValue$1(query.status) !== "success") return void 0;
|
|
20576
|
+
return toValue$1(query.data) ?? [];
|
|
20577
|
+
};
|
|
20578
|
+
const liveDynamicCarriers = () => {
|
|
20579
|
+
const data = toValue$1(dynamicContextQuery.data);
|
|
20580
|
+
return (data == null ? void 0 : data.carriers) ?? [];
|
|
20581
|
+
};
|
|
20582
|
+
const getCarrierCapabilitiesForOrder = (form) => {
|
|
20583
|
+
const chosenCarrier = form.getValue(FIELD_CARRIER);
|
|
20584
|
+
if (orderModifier) {
|
|
20585
|
+
const carriers = carriersFromQuery(orderModifier);
|
|
20586
|
+
const fromQuery = carriers == null ? void 0 : carriers.find((carrier) => carrier.carrier === chosenCarrier);
|
|
20587
|
+
if (fromQuery) return fromQuery;
|
|
20588
|
+
}
|
|
20589
|
+
return liveDynamicCarriers().find((carrier) => carrier.carrier === chosenCarrier);
|
|
20590
|
+
};
|
|
20591
|
+
const getCarrierCapabilitiesForShipment = (form) => {
|
|
20592
|
+
if (!shipmentModifier) return getCarrierCapabilitiesForOrder(form);
|
|
20593
|
+
const carriers = carriersFromQuery(shipmentModifier);
|
|
20594
|
+
if (!carriers) return getCarrierCapabilitiesForOrder(form);
|
|
20595
|
+
const chosenCarrier = form.getValue(FIELD_CARRIER);
|
|
20596
|
+
return carriers.find((carrier) => carrier.carrier === chosenCarrier);
|
|
20597
|
+
};
|
|
20598
|
+
const hasShipmentOption = (form, option) => {
|
|
20599
|
+
const carrier = getCarrierCapabilitiesForShipment(form);
|
|
20600
|
+
return Object.hasOwn((carrier == null ? void 0 : carrier.options) ?? {}, option);
|
|
20601
|
+
};
|
|
20602
|
+
const getInsuranceOptions = (form, formatter) => {
|
|
20603
|
+
var _a, _b, _c;
|
|
20604
|
+
const STEP_BELOW_THRESHOLD = 250;
|
|
20605
|
+
const STEP_ABOVE_THRESHOLD = 500;
|
|
20606
|
+
const STEP_THRESHOLD = 500;
|
|
20607
|
+
const carrier = getCarrierCapabilitiesForShipment(form);
|
|
20608
|
+
const insuranceData = ((_a = carrier == null ? void 0 : carrier.options) == null ? void 0 : _a.insurance) ?? {};
|
|
20609
|
+
const min = ((_b = insuranceData.insuredAmount) == null ? void 0 : _b.min.amount) ? insuranceData.insuredAmount.min.amount / 100 : 0;
|
|
20610
|
+
const max = ((_c = insuranceData.insuredAmount) == null ? void 0 : _c.max.amount) ? insuranceData.insuredAmount.max.amount / 100 : 0;
|
|
20611
|
+
if (max === 0) return [];
|
|
20612
|
+
const insurancePossibilities = [];
|
|
20613
|
+
for (let i = min; i <= max; i += i < STEP_THRESHOLD ? STEP_BELOW_THRESHOLD : STEP_ABOVE_THRESHOLD) {
|
|
20614
|
+
insurancePossibilities.push(i * 100);
|
|
20615
|
+
}
|
|
20616
|
+
return [
|
|
20617
|
+
{ label: "option_default", value: TriState.Inherit },
|
|
20618
|
+
...insurancePossibilities.map((amount) => ({
|
|
20619
|
+
plainLabel: formatter.format(Format.Currency, amount / 100),
|
|
20620
|
+
value: amount.toString()
|
|
20621
|
+
}))
|
|
20622
|
+
];
|
|
20623
|
+
};
|
|
20624
|
+
return {
|
|
20625
|
+
getCarrierCapabilitiesForOrder,
|
|
20626
|
+
getCarrierCapabilitiesForShipment,
|
|
20627
|
+
hasShipmentOption,
|
|
20628
|
+
getInsuranceOptions
|
|
20629
|
+
};
|
|
20630
|
+
};
|
|
20138
20631
|
const createFormTab = (tab) => {
|
|
20139
20632
|
const language = useLanguage();
|
|
20140
20633
|
const children = [h$1("div", {}, h$1(xe, { form: tab.form }))];
|
|
@@ -20172,11 +20665,14 @@ const generateFormFields = ({ fields, values }, prefix = "") => {
|
|
|
20172
20665
|
});
|
|
20173
20666
|
});
|
|
20174
20667
|
};
|
|
20668
|
+
const resolveSettingsValues = (pluginSettings, id) => {
|
|
20669
|
+
return get(pluginSettings, id) ?? get(pluginSettings, id.replace(/\.[^.]+$/, ".*"), {});
|
|
20670
|
+
};
|
|
20175
20671
|
const createPluginSettingsForm = (id, view, context) => {
|
|
20176
20672
|
var _a;
|
|
20177
20673
|
const { pluginSettings, actionContext } = context;
|
|
20178
20674
|
const mutation = useStoreQuery(BackendEndpoint.UpdatePluginSettings);
|
|
20179
|
-
const values =
|
|
20675
|
+
const values = resolveSettingsValues(pluginSettings, id);
|
|
20180
20676
|
const generatedFields = generateFormFields({ fields: view.elements, values }, `${id}.`);
|
|
20181
20677
|
return Ne(id, {
|
|
20182
20678
|
...(_a = context.config.formConfigOverrides) == null ? void 0 : _a.pluginSettings,
|
|
@@ -20236,6 +20732,48 @@ const createPluginSettingsTabs = (view, context) => {
|
|
|
20236
20732
|
return { ...tab, component: markRaw(createPluginSettingsTabsComponent(id, view2, context)) };
|
|
20237
20733
|
});
|
|
20238
20734
|
};
|
|
20735
|
+
const GENERAL_SECTION_HEADING = "settings_order_general_title";
|
|
20736
|
+
const SHIPMENT_EXPORT_FIELDS = /* @__PURE__ */ new Set(["conceptShipments", "saveCustomerAddress"]);
|
|
20737
|
+
const isSettingsDivider = (field) => {
|
|
20738
|
+
return field.$component === "SettingsDivider";
|
|
20739
|
+
};
|
|
20740
|
+
const isGeneralDivider = (field) => {
|
|
20741
|
+
return isSettingsDivider(field) && field.heading === GENERAL_SECTION_HEADING;
|
|
20742
|
+
};
|
|
20743
|
+
const filterOrderElements = (elements, orderMode) => {
|
|
20744
|
+
let inGeneralSection = false;
|
|
20745
|
+
return elements.filter((field) => {
|
|
20746
|
+
if (isGeneralDivider(field)) {
|
|
20747
|
+
inGeneralSection = true;
|
|
20748
|
+
} else if (isSettingsDivider(field)) {
|
|
20749
|
+
inGeneralSection = false;
|
|
20750
|
+
}
|
|
20751
|
+
if (!inGeneralSection) {
|
|
20752
|
+
return true;
|
|
20753
|
+
}
|
|
20754
|
+
if (SHIPMENT_EXPORT_FIELDS.has(field.name ?? "")) {
|
|
20755
|
+
return orderMode !== OrderMode.OrderV1;
|
|
20756
|
+
}
|
|
20757
|
+
return true;
|
|
20758
|
+
});
|
|
20759
|
+
};
|
|
20760
|
+
const filterPluginSettingsView = (view, orderMode) => {
|
|
20761
|
+
const entries = Object.entries(view);
|
|
20762
|
+
return Object.fromEntries(
|
|
20763
|
+
entries.map(([tabId, tabView]) => {
|
|
20764
|
+
if (tabId !== "order" || !tabView.elements) {
|
|
20765
|
+
return [tabId, tabView];
|
|
20766
|
+
}
|
|
20767
|
+
return [
|
|
20768
|
+
tabId,
|
|
20769
|
+
{
|
|
20770
|
+
...tabView,
|
|
20771
|
+
elements: filterOrderElements(tabView.elements, orderMode)
|
|
20772
|
+
}
|
|
20773
|
+
];
|
|
20774
|
+
})
|
|
20775
|
+
);
|
|
20776
|
+
};
|
|
20239
20777
|
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
20240
20778
|
name: "ReturnsForm",
|
|
20241
20779
|
components: {
|
|
@@ -20318,7 +20856,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
20318
20856
|
const props = __props;
|
|
20319
20857
|
const propRefs = toRefs(props);
|
|
20320
20858
|
const queries = useOrdersData(propRefs.order.value);
|
|
20321
|
-
const shipmentOptionsForm = createShipmentOptionsForm(queries.map((data) => toValue(data.order)).filter(isDef));
|
|
20859
|
+
const shipmentOptionsForm = createShipmentOptionsForm(queries.map((data) => toValue$1(data.order)).filter(isDef));
|
|
20322
20860
|
return (_ctx, _cache) => {
|
|
20323
20861
|
return openBlock(), createBlock(unref(xe), { form: unref(shipmentOptionsForm) }, null, 8, ["form"]);
|
|
20324
20862
|
};
|
|
@@ -20588,6 +21126,7 @@ const createRegisterComponentsPlugin = ({ config, logger }) => {
|
|
|
20588
21126
|
});
|
|
20589
21127
|
Object.entries(getOptionalComponents(app)).forEach(([componentName, component]) => {
|
|
20590
21128
|
const componentToRegister = typeof component === "string" ? componentsFromConfig[component] : component;
|
|
21129
|
+
if (!componentToRegister) return;
|
|
20591
21130
|
app.component(prefixComponent(componentName), markRaw(componentToRegister));
|
|
20592
21131
|
});
|
|
20593
21132
|
const { translate: translate2 } = useLanguage();
|
|
@@ -20684,13 +21223,13 @@ const setupAdminApp = (app, appConfig) => {
|
|
|
20684
21223
|
app.directive("test", testIdDirective);
|
|
20685
21224
|
};
|
|
20686
21225
|
const renderMap = Object.freeze({
|
|
20687
|
-
[AdminView.ChildProductSettings]: async () => import("./ChildProductSettings-
|
|
20688
|
-
[AdminView.Modals]: async () => import("./Modals-
|
|
20689
|
-
[AdminView.Notifications]: async () => import("./Notifications-
|
|
20690
|
-
[AdminView.OrderBox]: async () => import("./OrderBox-
|
|
20691
|
-
[AdminView.OrderListItem]: async () => import("./OrderListItem-
|
|
20692
|
-
[AdminView.PluginSettings]: async () => import("./PluginSettings-
|
|
20693
|
-
[AdminView.ProductSettings]: async () => import("./ProductSettings-
|
|
21226
|
+
[AdminView.ChildProductSettings]: async () => import("./ChildProductSettings-d3SnKpPH.js"),
|
|
21227
|
+
[AdminView.Modals]: async () => import("./Modals-fANUi3cL.js"),
|
|
21228
|
+
[AdminView.Notifications]: async () => import("./Notifications-yRVDhiMo.js"),
|
|
21229
|
+
[AdminView.OrderBox]: async () => import("./OrderBox-Bw7VnSow.js"),
|
|
21230
|
+
[AdminView.OrderListItem]: async () => import("./OrderListItem-DY4TK4DN.js"),
|
|
21231
|
+
[AdminView.PluginSettings]: async () => import("./PluginSettings-BzUwmDgk.js"),
|
|
21232
|
+
[AdminView.ProductSettings]: async () => import("./ProductSettings-BbWcPXUU.js")
|
|
20694
21233
|
});
|
|
20695
21234
|
const renderViewComponent = async (componentName) => {
|
|
20696
21235
|
const renderMethod = renderMap[componentName];
|
|
@@ -20840,11 +21379,21 @@ const createShipmentFormName = (orderId) => {
|
|
|
20840
21379
|
}
|
|
20841
21380
|
return `${AdminModalKey.ShipmentOptions}_${orderId}`;
|
|
20842
21381
|
};
|
|
21382
|
+
const getEnabledValues = (form) => {
|
|
21383
|
+
const values = {};
|
|
21384
|
+
for (const field of toValue$1(form.interactiveFields)) {
|
|
21385
|
+
if (toValue$1(field.isDisabled)) {
|
|
21386
|
+
continue;
|
|
21387
|
+
}
|
|
21388
|
+
values[field.name] = toValue$1(field.ref);
|
|
21389
|
+
}
|
|
21390
|
+
return values;
|
|
21391
|
+
};
|
|
20843
21392
|
const formToBody = (form) => {
|
|
20844
21393
|
if (!isOfType$1(form, "getValues")) {
|
|
20845
21394
|
return form ? form : {};
|
|
20846
21395
|
}
|
|
20847
|
-
const formValues = form
|
|
21396
|
+
const formValues = getEnabledValues(form);
|
|
20848
21397
|
return convertDotNotationToObject(formValues, (value) => {
|
|
20849
21398
|
return typeof value === "boolean" ? Number(value) : value;
|
|
20850
21399
|
});
|
|
@@ -20879,7 +21428,7 @@ const getOrderId = (instance) => {
|
|
|
20879
21428
|
const getOrderShipmentIds = (orderIds) => {
|
|
20880
21429
|
return useOrdersData(orderIds).map(({ order }) => {
|
|
20881
21430
|
var _a;
|
|
20882
|
-
return (_a = toValue(order)) == null ? void 0 : _a.shipments;
|
|
21431
|
+
return (_a = toValue$1(order)) == null ? void 0 : _a.shipments;
|
|
20883
21432
|
}).flat().filter(isDef).map((shipment) => shipment.id);
|
|
20884
21433
|
};
|
|
20885
21434
|
const fakeLinkClick = (url, attributes) => {
|
|
@@ -20921,14 +21470,11 @@ const setQueryOrder = (queryClient2, order) => {
|
|
|
20921
21470
|
const setQueryShipment = (queryClient2, shipment) => {
|
|
20922
21471
|
setQueryData(queryClient2, [QUERY_KEY_SHIPMENT, { id: shipment.id }], shipment);
|
|
20923
21472
|
};
|
|
20924
|
-
const resolveCarrier = (carrierNameOrIdentifier) => {
|
|
20925
|
-
return carrierNameOrIdentifier.split(":")[0];
|
|
20926
|
-
};
|
|
20927
21473
|
const getDynamicTranslation = (prefix, input) => {
|
|
20928
21474
|
if (!input) {
|
|
20929
21475
|
return prefix;
|
|
20930
21476
|
}
|
|
20931
|
-
return `${prefix}_${input}`;
|
|
21477
|
+
return `${prefix}_${input.toLowerCase()}`;
|
|
20932
21478
|
};
|
|
20933
21479
|
const getPackageTypeTranslation = (name) => getDynamicTranslation("package_type", name);
|
|
20934
21480
|
const translateSelectOption = (option, translate2) => {
|
|
@@ -20984,6 +21530,12 @@ const useQueryStore = defineStore("query", () => {
|
|
|
20984
21530
|
queries.value[key] = query;
|
|
20985
21531
|
return query;
|
|
20986
21532
|
};
|
|
21533
|
+
const unregister = (endpoint, modifier) => {
|
|
21534
|
+
const key = createQueryCacheKey(endpoint, modifier);
|
|
21535
|
+
if (queries.value[key] === void 0) return;
|
|
21536
|
+
globalLogger.debug(`Unregistering query ${key}`);
|
|
21537
|
+
delete queries.value[key];
|
|
21538
|
+
};
|
|
20987
21539
|
const registerShipmentQueries = (shipmentIds, orderIds) => {
|
|
20988
21540
|
toArray(validateId(unref(orderIds) ?? getOrderId(), true)).forEach((orderId) => {
|
|
20989
21541
|
toArray(unref(shipmentIds)).forEach((shipmentId) => {
|
|
@@ -21015,6 +21567,7 @@ const useQueryStore = defineStore("query", () => {
|
|
|
21015
21567
|
get: get2,
|
|
21016
21568
|
has: has2,
|
|
21017
21569
|
register,
|
|
21570
|
+
unregister,
|
|
21018
21571
|
registerShipmentQueries,
|
|
21019
21572
|
/**
|
|
21020
21573
|
* Register queries needed to render any order related component.
|
|
@@ -21024,7 +21577,7 @@ const useQueryStore = defineStore("query", () => {
|
|
|
21024
21577
|
toArray(id).forEach((orderId2) => {
|
|
21025
21578
|
var _a, _b;
|
|
21026
21579
|
const ordersQuery = register(BackendEndpoint.FetchOrders, orderId2, useFetchOrdersQuery(orderId2));
|
|
21027
|
-
(_b = (_a = toValue(ordersQuery.data)) == null ? void 0 : _a.shipments) == null ? void 0 : _b.forEach((shipment) => registerShipmentQueries(shipment.id, orderId2));
|
|
21580
|
+
(_b = (_a = toValue$1(ordersQuery.data)) == null ? void 0 : _a.shipments) == null ? void 0 : _b.forEach((shipment) => registerShipmentQueries(shipment.id, orderId2));
|
|
21028
21581
|
register(BackendEndpoint.FetchOrders, orderId2, useFetchOrdersQuery(orderId2));
|
|
21029
21582
|
register(BackendEndpoint.ExportOrders, orderId2, useExportOrdersMutation(orderId2, mode));
|
|
21030
21583
|
register(BackendEndpoint.PrintOrders, orderId2, usePrintOrdersMutation(orderId2));
|
|
@@ -21069,7 +21622,7 @@ const useStoreContextQuery = (contextKey) => {
|
|
|
21069
21622
|
};
|
|
21070
21623
|
const useContext = (contextKey = AdminContextKey.Dynamic) => {
|
|
21071
21624
|
const query = useStoreContextQuery(contextKey);
|
|
21072
|
-
const data = toValue(query.data);
|
|
21625
|
+
const data = toValue$1(query.data);
|
|
21073
21626
|
if (!data) {
|
|
21074
21627
|
throw new Error(`Context ${contextKey} not found`);
|
|
21075
21628
|
}
|
|
@@ -21130,6 +21683,16 @@ const useModalOrder = () => {
|
|
|
21130
21683
|
}
|
|
21131
21684
|
return null;
|
|
21132
21685
|
};
|
|
21686
|
+
const useOrderMode = () => {
|
|
21687
|
+
const context = useContext();
|
|
21688
|
+
return computed(() => {
|
|
21689
|
+
var _a, _b;
|
|
21690
|
+
const effective = orderModeFromContextValue(
|
|
21691
|
+
(_a = context.account) == null ? void 0 : _a.effectiveOrderMode
|
|
21692
|
+
);
|
|
21693
|
+
return effective ?? resolveOrderMode(((_b = context.account) == null ? void 0 : _b.subscriptionFeatures) ?? []);
|
|
21694
|
+
});
|
|
21695
|
+
};
|
|
21133
21696
|
const usePluginSettings = () => {
|
|
21134
21697
|
const context = useContext();
|
|
21135
21698
|
if (!context.pluginSettings) {
|
|
@@ -21246,14 +21809,14 @@ const useInputWithOptionsContext = (props, emit2, multiple) => {
|
|
|
21246
21809
|
watch(
|
|
21247
21810
|
options,
|
|
21248
21811
|
(newOptions) => {
|
|
21249
|
-
const values = toArray(toValue(model));
|
|
21812
|
+
const values = toArray(toValue$1(model));
|
|
21250
21813
|
const hasExistingValue = values.length && newOptions.some((option) => values.includes(option.value));
|
|
21251
21814
|
if (hasExistingValue || newOptions.length === 0) {
|
|
21252
21815
|
return;
|
|
21253
21816
|
}
|
|
21254
21817
|
model.value = multiple ? [newOptions[0].value] : newOptions[0].value;
|
|
21255
21818
|
},
|
|
21256
|
-
{ immediate: Number((_a = toValue(options)) == null ? void 0 : _a.length) > 0 }
|
|
21819
|
+
{ immediate: Number((_a = toValue$1(options)) == null ? void 0 : _a.length) > 0 }
|
|
21257
21820
|
);
|
|
21258
21821
|
});
|
|
21259
21822
|
return { id, options, model };
|
|
@@ -21463,7 +22026,7 @@ const useDropdownButtonContext = (props) => {
|
|
|
21463
22026
|
const propRefs = toRefs(props);
|
|
21464
22027
|
return {
|
|
21465
22028
|
dropdownActions: computed(() => {
|
|
21466
|
-
const [standalone, hidden] = partitionArray(toValue(propRefs.actions), (action) => action.standalone === true);
|
|
22029
|
+
const [standalone, hidden] = partitionArray(toValue$1(propRefs.actions), (action) => action.standalone === true);
|
|
21467
22030
|
return {
|
|
21468
22031
|
standalone,
|
|
21469
22032
|
hidden
|
|
@@ -21492,9 +22055,9 @@ const useMultiSelectInputContext = (props, emit2) => {
|
|
|
21492
22055
|
const useRadioGroupContext = (props, emit2) => {
|
|
21493
22056
|
const context = useInputWithOptionsContext(props, emit2);
|
|
21494
22057
|
const elements = computed(() => {
|
|
21495
|
-
const optionValues = (toValue(context.options) ?? []).map((option) => option.value);
|
|
22058
|
+
const optionValues = (toValue$1(context.options) ?? []).map((option) => option.value);
|
|
21496
22059
|
return createObjectWithKeys(optionValues, (value) => {
|
|
21497
|
-
const option = (toValue(context.options) ?? []).find((option2) => option2.value === value);
|
|
22060
|
+
const option = (toValue$1(context.options) ?? []).find((option2) => option2.value === value);
|
|
21498
22061
|
return createFormElement({
|
|
21499
22062
|
ref: context.model,
|
|
21500
22063
|
name: `${props.element.name}${value.toString()}`,
|
|
@@ -21611,13 +22174,13 @@ const useTableContext = (props) => {
|
|
|
21611
22174
|
return { transition };
|
|
21612
22175
|
};
|
|
21613
22176
|
const useToggleInputContext = (props, emit2) => {
|
|
21614
|
-
const toggleModel = ref(triStateToBoolean(toValue(props.modelValue)));
|
|
22177
|
+
const toggleModel = ref(triStateToBoolean(toValue$1(props.modelValue)));
|
|
21615
22178
|
const { id, model } = useElementContext(props, emit2);
|
|
21616
22179
|
watch(toggleModel, (toggle) => {
|
|
21617
22180
|
model.value = booleanToTriState(toggle);
|
|
21618
22181
|
});
|
|
21619
|
-
watch(model, (
|
|
21620
|
-
toggleModel.value = triStateToBoolean(
|
|
22182
|
+
watch(model, (modelVal) => {
|
|
22183
|
+
toggleModel.value = triStateToBoolean(modelVal);
|
|
21621
22184
|
});
|
|
21622
22185
|
return {
|
|
21623
22186
|
id,
|
|
@@ -21629,8 +22192,8 @@ const useToggleInputContext = (props, emit2) => {
|
|
|
21629
22192
|
const useTriStateInputContext = (props, emit2) => {
|
|
21630
22193
|
const { translate: translate2 } = useLanguage();
|
|
21631
22194
|
const form = M();
|
|
21632
|
-
const inheritModel = ref(TriState.Inherit === toValue(props.modelValue));
|
|
21633
|
-
const toggleModel = ref(triStateToBoolean(toValue(props.modelValue)));
|
|
22195
|
+
const inheritModel = ref(TriState.Inherit === toValue$1(props.modelValue));
|
|
22196
|
+
const toggleModel = ref(triStateToBoolean(toValue$1(props.modelValue)));
|
|
21634
22197
|
const { id, model } = useElementContext(props, emit2);
|
|
21635
22198
|
const defaultValue = computed(() => {
|
|
21636
22199
|
return props.element.props.defaultValue ?? TriState.Inherit;
|
|
@@ -21657,7 +22220,7 @@ const useTriStateInputContext = (props, emit2) => {
|
|
|
21657
22220
|
name: `${props.element.name}__toggle`,
|
|
21658
22221
|
ref: toggleModel,
|
|
21659
22222
|
// The toggle is readonly when inherit is enabled or the element itself is set to readonly.
|
|
21660
|
-
isReadOnly: markRaw(computed(() => toValue(inheritModel) || toValue(props.element.isReadOnly)))
|
|
22223
|
+
isReadOnly: markRaw(computed(() => toValue$1(inheritModel) || toValue$1(props.element.isReadOnly)))
|
|
21661
22224
|
})
|
|
21662
22225
|
);
|
|
21663
22226
|
watch(toggleModel, (toggle) => {
|
|
@@ -21677,11 +22240,11 @@ const useTriStateInputContext = (props, emit2) => {
|
|
|
21677
22240
|
model.value = TriState.Inherit;
|
|
21678
22241
|
toggleModel.value = triStateToBoolean(defaultValue2 ?? TriState.Inherit);
|
|
21679
22242
|
});
|
|
21680
|
-
watch(model, (
|
|
22243
|
+
watch(model, (modelVal) => {
|
|
21681
22244
|
if (inheritModel.value) {
|
|
21682
22245
|
return;
|
|
21683
22246
|
}
|
|
21684
|
-
toggleModel.value = triStateToBoolean(
|
|
22247
|
+
toggleModel.value = triStateToBoolean(modelVal);
|
|
21685
22248
|
});
|
|
21686
22249
|
return {
|
|
21687
22250
|
id,
|
|
@@ -21702,9 +22265,9 @@ const useOrderData = (externalIdentifier) => {
|
|
|
21702
22265
|
const allQueries = queryStore.getQueriesForOrder(orderId);
|
|
21703
22266
|
return {
|
|
21704
22267
|
loading: computed(() => {
|
|
21705
|
-
return Object.values(toValue(allQueries)).some((item) => item ? toValue(item.isLoading) : false);
|
|
22268
|
+
return Object.values(toValue$1(allQueries)).some((item) => item ? toValue$1(item.isLoading) : false);
|
|
21706
22269
|
}),
|
|
21707
|
-
order: computed(() => toValue(fetchQuery.data)),
|
|
22270
|
+
order: computed(() => toValue$1(fetchQuery.data)),
|
|
21708
22271
|
query: fetchQuery
|
|
21709
22272
|
};
|
|
21710
22273
|
};
|
|
@@ -21721,7 +22284,7 @@ const useProductData = (externalIdentifier) => {
|
|
|
21721
22284
|
const productId = validateId(externalIdentifier ?? useInstanceContext(AdminInstanceContextKey.ProductIdentifier));
|
|
21722
22285
|
const fetchQuery = useStoreQuery(BackendEndpoint.FetchProducts, productId);
|
|
21723
22286
|
return {
|
|
21724
|
-
product: computed(() => toValue(fetchQuery.data)),
|
|
22287
|
+
product: computed(() => toValue$1(fetchQuery.data)),
|
|
21725
22288
|
query: fetchQuery
|
|
21726
22289
|
};
|
|
21727
22290
|
};
|
|
@@ -21733,13 +22296,13 @@ const useShipmentData = (id) => {
|
|
|
21733
22296
|
const shipmentId = unref(id);
|
|
21734
22297
|
const queryStore = useQueryStore();
|
|
21735
22298
|
const fetchQuery = useShipment(shipmentId);
|
|
21736
|
-
const shipment = computed(() => toValue(fetchQuery.data));
|
|
21737
|
-
const orderId = (_a = toValue(shipment)) == null ? void 0 : _a.orderId;
|
|
22299
|
+
const shipment = computed(() => toValue$1(fetchQuery.data));
|
|
22300
|
+
const orderId = (_a = toValue$1(shipment)) == null ? void 0 : _a.orderId;
|
|
21738
22301
|
const allQueries = [
|
|
21739
22302
|
queryStore.getQueriesForShipment(shipmentId),
|
|
21740
22303
|
orderId ? queryStore.getQueriesForOrder(orderId) : void 0
|
|
21741
22304
|
].filter(Boolean);
|
|
21742
|
-
const carrierName = (_c = (_b = shipment.value) == null ? void 0 : _b.carrier) == null ? void 0 : _c.
|
|
22305
|
+
const carrierName = (_c = (_b = shipment.value) == null ? void 0 : _b.carrier) == null ? void 0 : _c.carrier;
|
|
21743
22306
|
const carriersQuery = carrierName ? useFetchCarrier(carrierName) : void 0;
|
|
21744
22307
|
return {
|
|
21745
22308
|
actions: instantiateActions(shipmentActions, {
|
|
@@ -21749,7 +22312,7 @@ const useShipmentData = (id) => {
|
|
|
21749
22312
|
carrier: (carriersQuery == null ? void 0 : carriersQuery.data) ?? ref(),
|
|
21750
22313
|
loading: computed(() => {
|
|
21751
22314
|
return allQueries.some(
|
|
21752
|
-
(obj) => Object.values(toValue(obj) ?? {}).some((item) => item ? toValue(item.isLoading) : false)
|
|
22315
|
+
(obj) => Object.values(toValue$1(obj) ?? {}).some((item) => item ? toValue$1(item.isLoading) : false)
|
|
21753
22316
|
);
|
|
21754
22317
|
}),
|
|
21755
22318
|
shipment
|
|
@@ -21759,7 +22322,7 @@ const useDigitalStampRanges = (weight, order) => {
|
|
|
21759
22322
|
const fallbackOrder = order ? null : useOrderData().order;
|
|
21760
22323
|
const allRanges = computed(() => {
|
|
21761
22324
|
var _a;
|
|
21762
|
-
return ((_a = toValue(order ?? fallbackOrder)) == null ? void 0 : _a.digitalStampRanges) ?? [];
|
|
22325
|
+
return ((_a = toValue$1(order ?? fallbackOrder)) == null ? void 0 : _a.digitalStampRanges) ?? [];
|
|
21763
22326
|
});
|
|
21764
22327
|
const ranges = computed(() => {
|
|
21765
22328
|
return allRanges.value.map((range) => ({
|
|
@@ -21768,7 +22331,7 @@ const useDigitalStampRanges = (weight, order) => {
|
|
|
21768
22331
|
}));
|
|
21769
22332
|
});
|
|
21770
22333
|
const currentRange = computed(() => {
|
|
21771
|
-
const resolvedWeight = toValue(weight);
|
|
22334
|
+
const resolvedWeight = toValue$1(weight);
|
|
21772
22335
|
const matchingRange = allRanges.value.find((range) => range.min <= resolvedWeight && range.max >= resolvedWeight);
|
|
21773
22336
|
return ranges.value.find((range) => range.value === (matchingRange == null ? void 0 : matchingRange.average)) ?? ranges.value[0];
|
|
21774
22337
|
});
|
|
@@ -21785,21 +22348,21 @@ const useGlobalPdkAdmin = () => {
|
|
|
21785
22348
|
return pdkAdmin;
|
|
21786
22349
|
};
|
|
21787
22350
|
const useLoadMore = (options) => {
|
|
21788
|
-
const loaded = ref(options.start ?? options.step ?? toValue(options.items).length - 1);
|
|
21789
|
-
const hasMore = computed(() => loaded.value < toValue(options.items).length - 1);
|
|
22351
|
+
const loaded = ref(options.start ?? options.step ?? toValue$1(options.items).length - 1);
|
|
22352
|
+
const hasMore = computed(() => loaded.value < toValue$1(options.items).length - 1);
|
|
21790
22353
|
const loadMore = () => {
|
|
21791
22354
|
if (!hasMore.value) {
|
|
21792
22355
|
return;
|
|
21793
22356
|
}
|
|
21794
22357
|
const step = options.step ?? 1;
|
|
21795
|
-
const maxLength = toValue(options.items).length;
|
|
22358
|
+
const maxLength = toValue$1(options.items).length;
|
|
21796
22359
|
if (loaded.value + step > maxLength) {
|
|
21797
22360
|
loaded.value = maxLength;
|
|
21798
22361
|
} else {
|
|
21799
22362
|
loaded.value += step;
|
|
21800
22363
|
}
|
|
21801
22364
|
};
|
|
21802
|
-
const items = computed(() => toValue(options.items).slice(0, loaded.value));
|
|
22365
|
+
const items = computed(() => toValue$1(options.items).slice(0, loaded.value));
|
|
21803
22366
|
return {
|
|
21804
22367
|
items,
|
|
21805
22368
|
loaded,
|
|
@@ -22055,7 +22618,7 @@ const useExportOrdersMutation = (orderIds, mode = MutationMode.Default) => {
|
|
|
22055
22618
|
var _a2;
|
|
22056
22619
|
fillShipmentsQueryData(queryClient2, ((_a2 = order.shipments) == null ? void 0 : _a2.slice(-1)) ?? [], order);
|
|
22057
22620
|
});
|
|
22058
|
-
if (input.form) {
|
|
22621
|
+
if (mode === MutationMode.Modal && input.form) {
|
|
22059
22622
|
await ((_a = input.form) == null ? void 0 : _a.reset());
|
|
22060
22623
|
}
|
|
22061
22624
|
}
|
|
@@ -22505,7 +23068,7 @@ const resolveOrderParameters = ({
|
|
|
22505
23068
|
var _a;
|
|
22506
23069
|
const formBuilder = ne();
|
|
22507
23070
|
parameters.orderIds ?? (parameters.orderIds = getOrderId(instance));
|
|
22508
|
-
parameters.form ?? (parameters.form = (_a = toValue(formBuilder.forms)) == null ? void 0 : _a[createShipmentFormName(parameters.orderIds)]);
|
|
23071
|
+
parameters.form ?? (parameters.form = (_a = toValue$1(formBuilder.forms)) == null ? void 0 : _a[createShipmentFormName(parameters.orderIds)]);
|
|
22509
23072
|
return Promise.resolve(parameters);
|
|
22510
23073
|
};
|
|
22511
23074
|
const updateAccountAction = defineAction({
|
|
@@ -22740,18 +23303,15 @@ const ordersPrintAction = defineAction({
|
|
|
22740
23303
|
return context.response;
|
|
22741
23304
|
}
|
|
22742
23305
|
});
|
|
23306
|
+
const ORDER_VIEW_IN_BACKOFFICE_ID = "show-exported-order";
|
|
22743
23307
|
const orderViewInBackofficeAction = defineAction({
|
|
22744
|
-
id:
|
|
23308
|
+
id: ORDER_VIEW_IN_BACKOFFICE_ID,
|
|
22745
23309
|
icon: AdminIcon.External,
|
|
22746
23310
|
label: "order_view_in_backoffice",
|
|
22747
23311
|
handler() {
|
|
22748
|
-
const {
|
|
22749
|
-
const
|
|
22750
|
-
|
|
22751
|
-
BE: "https://backoffice.sendmyparcel.be/orders"
|
|
22752
|
-
};
|
|
22753
|
-
const url = backofficeUrls[platform.localCountry] || backofficeUrls["NL"];
|
|
22754
|
-
window.open(url, "_blank");
|
|
23312
|
+
const { proposition } = useGlobalContext();
|
|
23313
|
+
const baseUrl = proposition.backofficeUrl.replace(/\/$/, "");
|
|
23314
|
+
window.open(`${baseUrl}/orders`, "_blank");
|
|
22755
23315
|
}
|
|
22756
23316
|
});
|
|
22757
23317
|
const pluginSettingsUpdateAction = defineAction({
|
|
@@ -22778,6 +23338,46 @@ const webhooksDeleteAction = defineAction({
|
|
|
22778
23338
|
handler: createMutationHandler(BackendEndpoint.DeleteWebhooks),
|
|
22779
23339
|
variant: Variant.Error
|
|
22780
23340
|
});
|
|
23341
|
+
const STORE_MODE_ACTIONS = {
|
|
23342
|
+
[OrderMode.OrderV1]: [orderExportAction, orderViewInBackofficeAction],
|
|
23343
|
+
[OrderMode.Shipments]: [
|
|
23344
|
+
ordersPrintAction,
|
|
23345
|
+
orderExportToShipmentsAction,
|
|
23346
|
+
ordersExportPrintShipmentsAction,
|
|
23347
|
+
shipmentsExportReturnAction,
|
|
23348
|
+
shipmentsDeleteAction,
|
|
23349
|
+
shipmentsUpdateAction,
|
|
23350
|
+
shipmentsPrintAction
|
|
23351
|
+
],
|
|
23352
|
+
// @TODO INT-1590: empty this array again once sales-channel detection gates V2.
|
|
23353
|
+
[OrderMode.OrderV2]: [
|
|
23354
|
+
ordersPrintAction,
|
|
23355
|
+
orderExportToShipmentsAction,
|
|
23356
|
+
ordersExportPrintShipmentsAction,
|
|
23357
|
+
shipmentsExportReturnAction,
|
|
23358
|
+
shipmentsDeleteAction,
|
|
23359
|
+
shipmentsUpdateAction,
|
|
23360
|
+
shipmentsPrintAction
|
|
23361
|
+
]
|
|
23362
|
+
};
|
|
23363
|
+
const BOX_MODE_ACTIONS = {
|
|
23364
|
+
[OrderMode.OrderV1]: [orderExportAction],
|
|
23365
|
+
[OrderMode.Shipments]: [orderExportToShipmentsAction, ordersPrintAction, ordersExportPrintShipmentsAction],
|
|
23366
|
+
// @TODO INT-1590: empty this array again once sales-channel detection gates V2.
|
|
23367
|
+
[OrderMode.OrderV2]: [orderExportToShipmentsAction, ordersPrintAction, ordersExportPrintShipmentsAction]
|
|
23368
|
+
};
|
|
23369
|
+
const MODAL_MODE_ACTIONS = {
|
|
23370
|
+
[OrderMode.OrderV1]: [orderExportAction],
|
|
23371
|
+
[OrderMode.Shipments]: [orderExportToShipmentsAction, ordersExportPrintShipmentsAction],
|
|
23372
|
+
// @TODO INT-1590: empty this array again once sales-channel detection gates V2.
|
|
23373
|
+
[OrderMode.OrderV2]: [orderExportToShipmentsAction, ordersExportPrintShipmentsAction]
|
|
23374
|
+
};
|
|
23375
|
+
const LIST_ITEM_MODE_ACTIONS = {
|
|
23376
|
+
[OrderMode.OrderV1]: [ordersEditAction, orderExportAction],
|
|
23377
|
+
// @TODO INT-1590: drop orderExportToShipmentsAction once sales-channel detection gates V2.
|
|
23378
|
+
[OrderMode.OrderV2]: [ordersEditAction, orderExportToShipmentsAction],
|
|
23379
|
+
[OrderMode.Shipments]: []
|
|
23380
|
+
};
|
|
22781
23381
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
22782
23382
|
__name: "ProductSettings",
|
|
22783
23383
|
props: {
|
|
@@ -22796,15 +23396,15 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
22796
23396
|
const adminConfig = useAdminConfig();
|
|
22797
23397
|
const createProductSettingsForm = () => {
|
|
22798
23398
|
var _a, _b, _c;
|
|
22799
|
-
const resolvedProduct = toValue(product);
|
|
23399
|
+
const resolvedProduct = toValue$1(product);
|
|
22800
23400
|
if (!resolvedProduct || !viewContext.view) {
|
|
22801
23401
|
throw new Error("Product settings not loaded");
|
|
22802
23402
|
}
|
|
22803
|
-
const overrides = FORM_KEY_CHILD_PRODUCT_SETTINGS === toValue(propRefs.formKey) ? {
|
|
23403
|
+
const overrides = FORM_KEY_CHILD_PRODUCT_SETTINGS === toValue$1(propRefs.formKey) ? {
|
|
22804
23404
|
...(_a = adminConfig.formConfigOverrides) == null ? void 0 : _a[FORM_KEY_PRODUCT_SETTINGS],
|
|
22805
23405
|
...(_b = adminConfig.formConfigOverrides) == null ? void 0 : _b[FORM_KEY_CHILD_PRODUCT_SETTINGS]
|
|
22806
23406
|
} : (_c = adminConfig.formConfigOverrides) == null ? void 0 : _c[FORM_KEY_PRODUCT_SETTINGS];
|
|
22807
|
-
return Ne(toValue(propRefs.formName), {
|
|
23407
|
+
return Ne(toValue$1(propRefs.formName), {
|
|
22808
23408
|
...overrides,
|
|
22809
23409
|
fields: [
|
|
22810
23410
|
...generateFormFields({
|
|
@@ -22842,22 +23442,16 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
22842
23442
|
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
22843
23443
|
__name: "ShipmentOptionsModal",
|
|
22844
23444
|
setup(__props) {
|
|
22845
|
-
const ShipmentOptionsModalForm = /* @__PURE__ */ defineAsyncComponent(() => import("./ShipmentOptionsModalForm-
|
|
22846
|
-
const
|
|
22847
|
-
const { orderMode } = pluginSettings.order;
|
|
23445
|
+
const ShipmentOptionsModalForm = /* @__PURE__ */ defineAsyncComponent(() => import("./ShipmentOptionsModalForm-BWjYWg9h.js"));
|
|
23446
|
+
const orderMode = useOrderMode();
|
|
22848
23447
|
const ordersData = computed(() => useOrdersData());
|
|
22849
|
-
const orderIds = computed(() => toValue(ordersData).map((data) => {
|
|
23448
|
+
const orderIds = computed(() => toValue$1(ordersData).map((data) => {
|
|
22850
23449
|
var _a;
|
|
22851
|
-
return (_a = toValue(data.order)) == null ? void 0 : _a.externalIdentifier;
|
|
23450
|
+
return (_a = toValue$1(data.order)) == null ? void 0 : _a.externalIdentifier;
|
|
22852
23451
|
}));
|
|
22853
23452
|
const actions = computed(() => {
|
|
22854
|
-
const disabled = toValue(ordersData).some((data) => toValue(data.query.isLoading));
|
|
22855
|
-
|
|
22856
|
-
modalCloseAction,
|
|
22857
|
-
ordersUpdateAction,
|
|
22858
|
-
...orderMode ? [orderExportAction] : [orderExportToShipmentsAction, ordersExportPrintShipmentsAction]
|
|
22859
|
-
];
|
|
22860
|
-
return instantiateActions(actions2, { disabled });
|
|
23453
|
+
const disabled = toValue$1(ordersData).some((data) => toValue$1(data.query.isLoading));
|
|
23454
|
+
return instantiateActions([modalCloseAction, ordersUpdateAction, ...MODAL_MODE_ACTIONS[orderMode.value]], { disabled });
|
|
22861
23455
|
});
|
|
22862
23456
|
return (_ctx, _cache) => {
|
|
22863
23457
|
const _component_PdkModal = resolveComponent("PdkModal");
|
|
@@ -22880,7 +23474,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
22880
23474
|
__name: "PrintOptionsModal",
|
|
22881
23475
|
setup(__props) {
|
|
22882
23476
|
const modalKey = AdminModalKey.PrintOptions;
|
|
22883
|
-
const PrintOptionsModalForm = /* @__PURE__ */ defineAsyncComponent(() => import("./PrintOptionsModalForm-
|
|
23477
|
+
const PrintOptionsModalForm = /* @__PURE__ */ defineAsyncComponent(() => import("./PrintOptionsModalForm-DC-Y2NQg.js"));
|
|
22884
23478
|
const actionStore = useActionStore();
|
|
22885
23479
|
actionStore.register(modalSubmitFormAction);
|
|
22886
23480
|
const actions = instantiateActions([modalCloseAction, modalSubmitFormAction]);
|
|
@@ -22930,24 +23524,19 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
22930
23524
|
setup(__props) {
|
|
22931
23525
|
const { order: data, loading } = useOrderData();
|
|
22932
23526
|
const { translate: translate2 } = useLanguage();
|
|
22933
|
-
const
|
|
22934
|
-
const { orderMode } = pluginSettings.order;
|
|
23527
|
+
const orderMode = useOrderMode();
|
|
22935
23528
|
const isExported = computed(() => {
|
|
22936
23529
|
var _a;
|
|
22937
|
-
return
|
|
23530
|
+
return orderMode.value === OrderMode.OrderV1 && ((_a = toValue$1(data)) == null ? void 0 : _a.exported);
|
|
22938
23531
|
});
|
|
22939
23532
|
const actions = computed(() => {
|
|
22940
23533
|
var _a;
|
|
22941
23534
|
if (isExported.value) {
|
|
22942
23535
|
return instantiateActions(orderViewInBackofficeAction);
|
|
22943
23536
|
}
|
|
22944
|
-
return instantiateActions(
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
...orderMode ? [orderExportAction] : [orderExportToShipmentsAction, ordersPrintAction, ordersExportPrintShipmentsAction]
|
|
22948
|
-
],
|
|
22949
|
-
{ orderIds: (_a = toValue(data)) == null ? void 0 : _a.externalIdentifier }
|
|
22950
|
-
);
|
|
23537
|
+
return instantiateActions([ordersUpdateAction, ...BOX_MODE_ACTIONS[orderMode.value]], {
|
|
23538
|
+
orderIds: (_a = toValue$1(data)) == null ? void 0 : _a.externalIdentifier
|
|
23539
|
+
});
|
|
22951
23540
|
});
|
|
22952
23541
|
return (_ctx, _cache) => {
|
|
22953
23542
|
const _component_PdkIcon = resolveComponent("PdkIcon");
|
|
@@ -23009,21 +23598,20 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
23009
23598
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
23010
23599
|
__name: "OrderBox",
|
|
23011
23600
|
setup(__props) {
|
|
23012
|
-
const ShipmentTableBox = /* @__PURE__ */ defineAsyncComponent(() => import("./ShipmentTableBox-
|
|
23601
|
+
const ShipmentTableBox = /* @__PURE__ */ defineAsyncComponent(() => import("./ShipmentTableBox-syVRwjqM.js"));
|
|
23013
23602
|
const queryStore = useQueryStore();
|
|
23014
23603
|
queryStore.registerContextQueries();
|
|
23015
23604
|
queryStore.registerOrderQueries();
|
|
23016
23605
|
const actionStore = useActionStore();
|
|
23017
23606
|
actionStore.registerOrderActions();
|
|
23018
|
-
const
|
|
23607
|
+
const orderMode = useOrderMode();
|
|
23019
23608
|
const { query } = useOrderData();
|
|
23020
|
-
const data = computed(() => toValue(query.data));
|
|
23021
|
-
const { orderMode } = pluginSettings.order;
|
|
23609
|
+
const data = computed(() => toValue$1(query.data));
|
|
23022
23610
|
return (_ctx, _cache) => {
|
|
23023
23611
|
var _a;
|
|
23024
23612
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
23025
23613
|
createVNode(_sfc_main$a),
|
|
23026
|
-
|
|
23614
|
+
unref(orderMode) !== unref(OrderMode).OrderV1 && ((_a = data.value) == null ? void 0 : _a.shipments.some((item) => !item.deleted)) ? (openBlock(), createBlock(unref(ShipmentTableBox), { key: 0 })) : createCommentVNode("", true)
|
|
23027
23615
|
], 64);
|
|
23028
23616
|
};
|
|
23029
23617
|
}
|
|
@@ -23051,27 +23639,26 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
23051
23639
|
__name: "OrderListItem",
|
|
23052
23640
|
setup(__props) {
|
|
23053
23641
|
const OrderModeOrderListItem = /* @__PURE__ */ defineAsyncComponent(() => {
|
|
23054
|
-
return import("./OrderModeOrderListItem-
|
|
23642
|
+
return import("./OrderModeOrderListItem-B72YhSTX.js");
|
|
23055
23643
|
});
|
|
23056
23644
|
const ShipmentModeOrderListItem = /* @__PURE__ */ defineAsyncComponent(() => {
|
|
23057
|
-
return import("./ShipmentModeOrderListItem-
|
|
23645
|
+
return import("./ShipmentModeOrderListItem-DF_ORvSm.js");
|
|
23058
23646
|
});
|
|
23059
23647
|
const queryStore = useQueryStore();
|
|
23060
23648
|
queryStore.registerContextQueries();
|
|
23061
23649
|
queryStore.registerOrderQueries();
|
|
23062
23650
|
const actionStore = useActionStore();
|
|
23063
23651
|
actionStore.registerOrderActions();
|
|
23064
|
-
const
|
|
23065
|
-
const { orderMode } = pluginSettings.order;
|
|
23652
|
+
const orderMode = useOrderMode();
|
|
23066
23653
|
const { query } = useOrderData();
|
|
23067
23654
|
const notificationFilter = (notification) => {
|
|
23068
23655
|
var _a, _b;
|
|
23069
|
-
return ((_a = notification.tags) == null ? void 0 : _a.orderIds) === ((_b = toValue(query.data)) == null ? void 0 : _b.externalIdentifier);
|
|
23656
|
+
return ((_a = notification.tags) == null ? void 0 : _a.orderIds) === ((_b = toValue$1(query.data)) == null ? void 0 : _b.externalIdentifier);
|
|
23070
23657
|
};
|
|
23071
23658
|
return (_ctx, _cache) => {
|
|
23072
23659
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
23073
23660
|
!unref(query).isLoading ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
23074
|
-
unref(orderMode) ? (openBlock(), createBlock(unref(OrderModeOrderListItem), { key: 0 })) : (openBlock(), createBlock(unref(ShipmentModeOrderListItem), { key: 1 }))
|
|
23661
|
+
unref(orderMode) === unref(OrderMode).OrderV1 || unref(orderMode) === unref(OrderMode).OrderV2 ? (openBlock(), createBlock(unref(OrderModeOrderListItem), { key: 0 })) : unref(orderMode) === unref(OrderMode).Shipments ? (openBlock(), createBlock(unref(ShipmentModeOrderListItem), { key: 1 })) : createCommentVNode("", true)
|
|
23075
23662
|
])) : createCommentVNode("", true),
|
|
23076
23663
|
createVNode(unref(_sfc_main$p), {
|
|
23077
23664
|
category: unref(NotificationCategory).Action,
|
|
@@ -23103,6 +23690,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
23103
23690
|
__name: "PluginSettingsForms",
|
|
23104
23691
|
setup(__props) {
|
|
23105
23692
|
const config = useAdminConfig();
|
|
23693
|
+
const orderMode = useOrderMode();
|
|
23106
23694
|
const dynamicContextQuery = useStoreContextQuery();
|
|
23107
23695
|
const pluginSettingsContextQuery = useStoreContextQuery(AdminContextKey.PluginSettingsView);
|
|
23108
23696
|
const tabs = ref([]);
|
|
@@ -23111,15 +23699,16 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
23111
23699
|
watch(
|
|
23112
23700
|
() => pluginSettingsContextQuery.dataUpdatedAt,
|
|
23113
23701
|
() => {
|
|
23114
|
-
if (toValue(loading)) {
|
|
23702
|
+
if (toValue$1(loading)) {
|
|
23115
23703
|
return;
|
|
23116
23704
|
}
|
|
23117
|
-
const
|
|
23118
|
-
const dynamicContext = toValue(dynamicContextQuery.data);
|
|
23119
|
-
if (!
|
|
23705
|
+
const rawPluginSettingsView = toValue$1(pluginSettingsContextQuery.data);
|
|
23706
|
+
const dynamicContext = toValue$1(dynamicContextQuery.data);
|
|
23707
|
+
if (!rawPluginSettingsView || !(dynamicContext == null ? void 0 : dynamicContext.pluginSettings)) {
|
|
23120
23708
|
tabs.value = [];
|
|
23121
23709
|
return;
|
|
23122
23710
|
}
|
|
23711
|
+
const pluginSettingsView = filterPluginSettingsView(rawPluginSettingsView, orderMode.value);
|
|
23123
23712
|
tabs.value = createPluginSettingsTabs(pluginSettingsView, {
|
|
23124
23713
|
pluginSettings: dynamicContext.pluginSettings,
|
|
23125
23714
|
actionContext,
|
|
@@ -23150,11 +23739,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
23150
23739
|
setup(__props) {
|
|
23151
23740
|
const { fetchWebhooks, createWebhooks, deleteWebhooks } = useQueryStore().registerWebhookQueries();
|
|
23152
23741
|
useActionStore().registerWebhookActions();
|
|
23153
|
-
const data = computed(() => toValue(fetchWebhooks.data) ?? []);
|
|
23742
|
+
const data = computed(() => toValue$1(fetchWebhooks.data) ?? []);
|
|
23154
23743
|
const webhooks = computed(() => {
|
|
23155
23744
|
return data.value.map((webhook) => {
|
|
23156
23745
|
let status = Status.Pending;
|
|
23157
|
-
if (!toValue(fetchWebhooks.isLoading) && !toValue(createWebhooks.isLoading) && !toValue(deleteWebhooks.isLoading)) {
|
|
23746
|
+
if (!toValue$1(fetchWebhooks.isLoading) && !toValue$1(createWebhooks.isLoading) && !toValue$1(deleteWebhooks.isLoading)) {
|
|
23158
23747
|
status = webhook.connected ? Status.Success : Status.Error;
|
|
23159
23748
|
}
|
|
23160
23749
|
return { ...webhook, status };
|
|
@@ -23269,7 +23858,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
23269
23858
|
const form = ref();
|
|
23270
23859
|
const hasAccount = computed(() => {
|
|
23271
23860
|
var _a;
|
|
23272
|
-
return Boolean((_a = toValue(contextQuery.data)) == null ? void 0 : _a.account);
|
|
23861
|
+
return Boolean((_a = toValue$1(contextQuery.data)) == null ? void 0 : _a.account);
|
|
23273
23862
|
});
|
|
23274
23863
|
watch(
|
|
23275
23864
|
contextQuery.data,
|
|
@@ -23318,7 +23907,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
23318
23907
|
const switchToProductionApiInstance = instantiateAction(switchToProductionApiAction);
|
|
23319
23908
|
const isConnectedToAcceptance = computed(() => {
|
|
23320
23909
|
var _a, _b;
|
|
23321
|
-
const context = toValue(contextQuery.data);
|
|
23910
|
+
const context = toValue$1(contextQuery.data);
|
|
23322
23911
|
const environment = (_b = (_a = context == null ? void 0 : context.pluginSettings) == null ? void 0 : _a.account) == null ? void 0 : _b.environment;
|
|
23323
23912
|
return environment === "acceptance";
|
|
23324
23913
|
});
|
|
@@ -23372,14 +23961,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
23372
23961
|
const contextQuery = useStoreContextQuery();
|
|
23373
23962
|
const updateAccount = useUpdateAccountMutation();
|
|
23374
23963
|
const deleteAccount = useDeleteAccountMutation();
|
|
23375
|
-
const loading = computed(() => toValue(contextQuery.isLoading) || toValue(updateAccount.isLoading)) || toValue(deleteAccount.isLoading);
|
|
23964
|
+
const loading = computed(() => toValue$1(contextQuery.isLoading) || toValue$1(updateAccount.isLoading)) || toValue$1(deleteAccount.isLoading);
|
|
23376
23965
|
const hasApiKey = computed(() => {
|
|
23377
23966
|
var _a;
|
|
23378
|
-
return Boolean((_a = toValue(contextQuery.data)) == null ? void 0 : _a.pluginSettings.account.apiKey);
|
|
23967
|
+
return Boolean((_a = toValue$1(contextQuery.data)) == null ? void 0 : _a.pluginSettings.account.apiKey);
|
|
23379
23968
|
});
|
|
23380
23969
|
const hasAccount = computed(() => {
|
|
23381
23970
|
var _a;
|
|
23382
|
-
return !toValue(loading) && hasApiKey.value && Boolean((_a = toValue(contextQuery.data)) == null ? void 0 : _a.account);
|
|
23971
|
+
return !toValue$1(loading) && hasApiKey.value && Boolean((_a = toValue$1(contextQuery.data)) == null ? void 0 : _a.account);
|
|
23383
23972
|
});
|
|
23384
23973
|
const { translate: translate2 } = useLanguage();
|
|
23385
23974
|
const tabs = computed(() => {
|
|
@@ -23390,7 +23979,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
23390
23979
|
label: "button_api_key_edit"
|
|
23391
23980
|
}
|
|
23392
23981
|
];
|
|
23393
|
-
if (toValue(hasAccount)) {
|
|
23982
|
+
if (toValue$1(hasAccount)) {
|
|
23394
23983
|
array.push({
|
|
23395
23984
|
name: "webhooks",
|
|
23396
23985
|
component: _sfc_main$4,
|
|
@@ -23440,7 +24029,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23440
24029
|
const dynamicContextQuery = useStoreContextQuery();
|
|
23441
24030
|
const hasAccount = computed(() => {
|
|
23442
24031
|
var _a;
|
|
23443
|
-
return Boolean((_a = toValue(dynamicContextQuery.data)) == null ? void 0 : _a.account);
|
|
24032
|
+
return Boolean((_a = toValue$1(dynamicContextQuery.data)) == null ? void 0 : _a.account);
|
|
23444
24033
|
});
|
|
23445
24034
|
return (_ctx, _cache) => {
|
|
23446
24035
|
const _component_PdkPluginSettingsWrapper = resolveComponent("PdkPluginSettingsWrapper");
|
|
@@ -23455,7 +24044,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23455
24044
|
}
|
|
23456
24045
|
});
|
|
23457
24046
|
export {
|
|
23458
|
-
|
|
24047
|
+
Size as $,
|
|
23459
24048
|
AdminModalKey as A,
|
|
23460
24049
|
_sfc_main$m as B,
|
|
23461
24050
|
_sfc_main$k as C,
|
|
@@ -23476,175 +24065,182 @@ export {
|
|
|
23476
24065
|
shipmentActions as R,
|
|
23477
24066
|
AdminIcon as S,
|
|
23478
24067
|
isDef as T,
|
|
23479
|
-
|
|
23480
|
-
|
|
23481
|
-
|
|
23482
|
-
|
|
23483
|
-
|
|
23484
|
-
|
|
24068
|
+
useOrderMode as U,
|
|
24069
|
+
instantiateAction as V,
|
|
24070
|
+
orderViewInBackofficeAction as W,
|
|
24071
|
+
LIST_ITEM_MODE_ACTIONS as X,
|
|
24072
|
+
OrderMode as Y,
|
|
24073
|
+
_sfc_main$t as Z,
|
|
23485
24074
|
_sfc_main$l as _,
|
|
23486
24075
|
createBlock as a,
|
|
23487
|
-
|
|
23488
|
-
|
|
23489
|
-
|
|
23490
|
-
|
|
23491
|
-
|
|
23492
|
-
|
|
23493
|
-
|
|
23494
|
-
|
|
23495
|
-
|
|
23496
|
-
_sfc_main$
|
|
23497
|
-
|
|
23498
|
-
|
|
23499
|
-
|
|
23500
|
-
|
|
23501
|
-
|
|
23502
|
-
|
|
23503
|
-
|
|
23504
|
-
|
|
23505
|
-
|
|
23506
|
-
|
|
23507
|
-
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
|
|
23511
|
-
|
|
23512
|
-
|
|
23513
|
-
|
|
23514
|
-
|
|
23515
|
-
|
|
23516
|
-
|
|
23517
|
-
|
|
23518
|
-
|
|
23519
|
-
|
|
23520
|
-
|
|
23521
|
-
|
|
23522
|
-
|
|
23523
|
-
|
|
23524
|
-
|
|
23525
|
-
|
|
23526
|
-
_sfc_main$
|
|
23527
|
-
|
|
23528
|
-
|
|
23529
|
-
_sfc_main$
|
|
23530
|
-
_sfc_main$
|
|
23531
|
-
_sfc_main as ag,
|
|
23532
|
-
_sfc_main$
|
|
23533
|
-
_sfc_main$
|
|
23534
|
-
|
|
23535
|
-
_sfc_main$
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
_sfc_main$
|
|
23539
|
-
|
|
23540
|
-
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
|
|
23544
|
-
|
|
23545
|
-
|
|
23546
|
-
|
|
23547
|
-
|
|
23548
|
-
|
|
23549
|
-
|
|
23550
|
-
|
|
24076
|
+
prefixComponent as a$,
|
|
24077
|
+
ordersPrintAction as a0,
|
|
24078
|
+
ordersFetchAction as a1,
|
|
24079
|
+
orderExportAction as a2,
|
|
24080
|
+
ordersExportPrintShipmentsAction as a3,
|
|
24081
|
+
ordersEditAction as a4,
|
|
24082
|
+
TransitionGroup as a5,
|
|
24083
|
+
useDigitalStampRanges as a6,
|
|
24084
|
+
isOfType$1 as a7,
|
|
24085
|
+
_sfc_main$q as a8,
|
|
24086
|
+
PackageTypeName as a9,
|
|
24087
|
+
optionalAdminPlainWrapperComponentNames as aA,
|
|
24088
|
+
requiredAdminComponentNames as aB,
|
|
24089
|
+
FORM_KEYS as aC,
|
|
24090
|
+
FORM_KEY_ACCOUNT_SETTINGS as aD,
|
|
24091
|
+
FORM_KEY_CHILD_PRODUCT_SETTINGS as aE,
|
|
24092
|
+
FORM_KEY_MODAL as aF,
|
|
24093
|
+
FORM_KEY_MODAL_PRINT_OPTIONS as aG,
|
|
24094
|
+
FORM_KEY_MODAL_RETURN_OPTIONS as aH,
|
|
24095
|
+
FORM_KEY_MODAL_SHIPMENT_OPTIONS as aI,
|
|
24096
|
+
FORM_KEY_PLUGIN_SETTINGS as aJ,
|
|
24097
|
+
FORM_KEY_PRODUCT_SETTINGS as aK,
|
|
24098
|
+
resolveFormComponent as aL,
|
|
24099
|
+
c as aM,
|
|
24100
|
+
Je as aN,
|
|
24101
|
+
M as aO,
|
|
24102
|
+
ne as aP,
|
|
24103
|
+
INJECT_ADMIN_INSTANCE as aQ,
|
|
24104
|
+
INJECT_GLOBAL_PDK_ADMIN as aR,
|
|
24105
|
+
LogLevel as aS,
|
|
24106
|
+
getActionIdentifier as aT,
|
|
24107
|
+
PdkAdmin as aU,
|
|
24108
|
+
createPdkAdmin as aV,
|
|
24109
|
+
createAdminConfig as aW,
|
|
24110
|
+
createPdkAdminPlugin as aX,
|
|
24111
|
+
createFormElement as aY,
|
|
24112
|
+
createLogger as aZ,
|
|
24113
|
+
generateFieldId as a_,
|
|
24114
|
+
useFetchCarrier as aa,
|
|
24115
|
+
_sfc_main$r as ab,
|
|
24116
|
+
getDynamicTranslation as ac,
|
|
24117
|
+
withModifiers as ad,
|
|
24118
|
+
_sfc_main$f as ae,
|
|
24119
|
+
_sfc_main$c as af,
|
|
24120
|
+
_sfc_main$b as ag,
|
|
24121
|
+
_sfc_main$9 as ah,
|
|
24122
|
+
_sfc_main$7 as ai,
|
|
24123
|
+
_sfc_main as aj,
|
|
24124
|
+
_sfc_main$g as ak,
|
|
24125
|
+
_sfc_main$p as al,
|
|
24126
|
+
PlainElement as am,
|
|
24127
|
+
_sfc_main$o as an,
|
|
24128
|
+
ReturnsForm as ao,
|
|
24129
|
+
_sfc_main$j as ap,
|
|
24130
|
+
_sfc_main$i as aq,
|
|
24131
|
+
_sfc_main$h as ar,
|
|
24132
|
+
AdminAction as as,
|
|
24133
|
+
AdminComponent as at,
|
|
24134
|
+
AdminInstanceContextKey as au,
|
|
24135
|
+
AdminView as av,
|
|
24136
|
+
NotificationCategory as aw,
|
|
24137
|
+
allAdminComponentNames as ax,
|
|
24138
|
+
optionalAdminActionContainerComponentNames as ay,
|
|
24139
|
+
optionalAdminComponentNames as az,
|
|
23551
24140
|
unref as b,
|
|
23552
|
-
|
|
23553
|
-
|
|
23554
|
-
|
|
23555
|
-
|
|
23556
|
-
|
|
23557
|
-
|
|
23558
|
-
|
|
23559
|
-
|
|
23560
|
-
|
|
23561
|
-
|
|
23562
|
-
|
|
23563
|
-
|
|
23564
|
-
|
|
23565
|
-
|
|
23566
|
-
|
|
23567
|
-
|
|
23568
|
-
|
|
23569
|
-
|
|
23570
|
-
|
|
23571
|
-
|
|
23572
|
-
|
|
23573
|
-
|
|
23574
|
-
|
|
23575
|
-
|
|
23576
|
-
|
|
23577
|
-
|
|
23578
|
-
|
|
23579
|
-
|
|
23580
|
-
|
|
23581
|
-
|
|
23582
|
-
|
|
23583
|
-
|
|
23584
|
-
|
|
23585
|
-
|
|
23586
|
-
|
|
23587
|
-
|
|
23588
|
-
|
|
23589
|
-
|
|
23590
|
-
|
|
23591
|
-
|
|
23592
|
-
|
|
23593
|
-
|
|
23594
|
-
|
|
23595
|
-
|
|
23596
|
-
|
|
23597
|
-
|
|
23598
|
-
|
|
23599
|
-
|
|
23600
|
-
|
|
23601
|
-
|
|
23602
|
-
|
|
23603
|
-
|
|
23604
|
-
|
|
23605
|
-
|
|
23606
|
-
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
|
|
23610
|
-
|
|
23611
|
-
|
|
23612
|
-
|
|
23613
|
-
|
|
23614
|
-
|
|
23615
|
-
|
|
24141
|
+
ordersUpdateAction as b$,
|
|
24142
|
+
useActionStore as b0,
|
|
24143
|
+
useModalStore as b1,
|
|
24144
|
+
useNotificationStore as b2,
|
|
24145
|
+
useAppInfo as b3,
|
|
24146
|
+
useCheckboxGroupContext as b4,
|
|
24147
|
+
useDropOffInputContext as b5,
|
|
24148
|
+
useDropdownButtonContext as b6,
|
|
24149
|
+
useElementContext as b7,
|
|
24150
|
+
useElementOptions as b8,
|
|
24151
|
+
useFormatter as b9,
|
|
24152
|
+
useUpdateProductSettingsMutation as bA,
|
|
24153
|
+
useDeleteShipmentsMutation as bB,
|
|
24154
|
+
useExportReturnMutation as bC,
|
|
24155
|
+
usePrintShipmentsMutation as bD,
|
|
24156
|
+
useUpdateShipmentsMutation as bE,
|
|
24157
|
+
usePdkMutation as bF,
|
|
24158
|
+
useCreateWebhooksMutation as bG,
|
|
24159
|
+
useDeleteWebhooksMutation as bH,
|
|
24160
|
+
useFetchContextQuery as bI,
|
|
24161
|
+
useFetchOrdersQuery as bJ,
|
|
24162
|
+
useFetchProductsQuery as bK,
|
|
24163
|
+
QUERY_KEY_ORDER as bL,
|
|
24164
|
+
QUERY_KEY_SHIPMENT as bM,
|
|
24165
|
+
useFetchShipmentsQuery as bN,
|
|
24166
|
+
useFetchWebhooksQuery as bO,
|
|
24167
|
+
defineAction as bP,
|
|
24168
|
+
updateAccountAction as bQ,
|
|
24169
|
+
refreshAccountAction as bR,
|
|
24170
|
+
deleteAccountAction as bS,
|
|
24171
|
+
fetchDynamicContextAction as bT,
|
|
24172
|
+
fetchPluginSettingsViewContextAction as bU,
|
|
24173
|
+
downloadLogsAction as bV,
|
|
24174
|
+
switchToAcceptanceApiAction as bW,
|
|
24175
|
+
switchToProductionApiAction as bX,
|
|
24176
|
+
modalCloseAction as bY,
|
|
24177
|
+
modalSubmitFormAction as bZ,
|
|
24178
|
+
orderExportToShipmentsAction as b_,
|
|
24179
|
+
useGlobalContext as ba,
|
|
24180
|
+
useGlobalPdkAdmin as bb,
|
|
24181
|
+
useInputWithOptionsContext as bc,
|
|
24182
|
+
useLoadMore as bd,
|
|
24183
|
+
useLogger as be,
|
|
24184
|
+
useModalContext as bf,
|
|
24185
|
+
useModalElementContext as bg,
|
|
24186
|
+
useMultiSelectInputContext as bh,
|
|
24187
|
+
useProductData as bi,
|
|
24188
|
+
useRadioGroupContext as bj,
|
|
24189
|
+
useSelectInputContext as bk,
|
|
24190
|
+
useShippingMethodsInputContext as bl,
|
|
24191
|
+
useStoreQuery as bm,
|
|
24192
|
+
useTableContext as bn,
|
|
24193
|
+
useToggleInputContext as bo,
|
|
24194
|
+
useTriStateInputContext as bp,
|
|
24195
|
+
useWeekdays as bq,
|
|
24196
|
+
useDeleteAccountMutation as br,
|
|
24197
|
+
useUpdateAccountMutation as bs,
|
|
24198
|
+
useDownloadLogsMutation as bt,
|
|
24199
|
+
useSwitchToAcceptanceApiMutation as bu,
|
|
24200
|
+
useSwitchToProductionApiMutation as bv,
|
|
24201
|
+
useExportOrdersMutation as bw,
|
|
24202
|
+
usePrintOrdersMutation as bx,
|
|
24203
|
+
useUpdateOrdersMutation as by,
|
|
24204
|
+
useUpdatePluginSettingsMutation as bz,
|
|
23616
24205
|
computed as c,
|
|
23617
|
-
|
|
23618
|
-
|
|
23619
|
-
|
|
23620
|
-
|
|
23621
|
-
|
|
23622
|
-
|
|
23623
|
-
|
|
23624
|
-
|
|
23625
|
-
|
|
23626
|
-
|
|
23627
|
-
|
|
23628
|
-
|
|
23629
|
-
|
|
23630
|
-
|
|
23631
|
-
|
|
23632
|
-
|
|
23633
|
-
|
|
23634
|
-
|
|
23635
|
-
|
|
23636
|
-
|
|
23637
|
-
|
|
23638
|
-
|
|
23639
|
-
|
|
23640
|
-
|
|
23641
|
-
|
|
23642
|
-
|
|
23643
|
-
|
|
23644
|
-
|
|
23645
|
-
|
|
23646
|
-
|
|
23647
|
-
|
|
24206
|
+
ORDER_VIEW_IN_BACKOFFICE_ID as c0,
|
|
24207
|
+
pluginSettingsUpdateAction as c1,
|
|
24208
|
+
shipmentsExportReturnAction as c2,
|
|
24209
|
+
shipmentsUpdateAction as c3,
|
|
24210
|
+
shipmentsDeleteAction as c4,
|
|
24211
|
+
shipmentsPrintAction as c5,
|
|
24212
|
+
webhooksFetchAction as c6,
|
|
24213
|
+
webhooksCreateAction as c7,
|
|
24214
|
+
webhooksDeleteAction as c8,
|
|
24215
|
+
createHandlerWithParameters as c9,
|
|
24216
|
+
BackendEndpoint as cA,
|
|
24217
|
+
FrontendEndpoint as cB,
|
|
24218
|
+
createMutationHandler as ca,
|
|
24219
|
+
createOrdersMutationHandler as cb,
|
|
24220
|
+
createQueryHandler as cc,
|
|
24221
|
+
createShipmentsMutationHandler as cd,
|
|
24222
|
+
doMutate as ce,
|
|
24223
|
+
executeAction as cf,
|
|
24224
|
+
executeAfterHandle as cg,
|
|
24225
|
+
executeBeforeHandle as ch,
|
|
24226
|
+
executeHandler as ci,
|
|
24227
|
+
executeNextAction as cj,
|
|
24228
|
+
resolveOrderParameters as ck,
|
|
24229
|
+
resolveQuerySuffix as cl,
|
|
24230
|
+
STORE_MODE_ACTIONS as cm,
|
|
24231
|
+
BOX_MODE_ACTIONS as cn,
|
|
24232
|
+
MODAL_MODE_ACTIONS as co,
|
|
24233
|
+
openOrPrintPdf as cp,
|
|
24234
|
+
resolvePrintParameters as cq,
|
|
24235
|
+
waitForLabelPrompt as cr,
|
|
24236
|
+
StopActionHandler as cs,
|
|
24237
|
+
_sfc_main$8 as ct,
|
|
24238
|
+
_sfc_main$6 as cu,
|
|
24239
|
+
Variant as cv,
|
|
24240
|
+
Status as cw,
|
|
24241
|
+
TriState as cx,
|
|
24242
|
+
SortType as cy,
|
|
24243
|
+
AdminContextKey as cz,
|
|
23648
24244
|
defineComponent as d,
|
|
23649
24245
|
createCommentVNode as e,
|
|
23650
24246
|
useContext as f,
|
|
@@ -23661,7 +24257,7 @@ export {
|
|
|
23661
24257
|
useVModel as q,
|
|
23662
24258
|
ref as r,
|
|
23663
24259
|
resolveComponent as s,
|
|
23664
|
-
toValue as t,
|
|
24260
|
+
toValue$1 as t,
|
|
23665
24261
|
useOrdersData as u,
|
|
23666
24262
|
withCtx as v,
|
|
23667
24263
|
watch as w,
|