decord/source/modules/checkout/utils/OrderUtils.native.tsx
2026-08-13 07:00:46 +00:00

135 lines
3.7 KiB
TypeScript

// Module ID: 7465
// Function ID: 7466
// Name: _discardDraftOrder
// Dependencies: [5, 4325, 6940, 2]
// Exports: discardDraftOrder
// Module 7465 (_discardDraftOrder)
import asyncGeneratorStep from "asyncGeneratorStep";
import { OrderStatus } from "CustomCheckoutFlow";
const require = arg1;
function _discardDraftOrder() {
const self = this;
const tmp = callback((arg0) => {
let closure_0 = arg0;
let c5 = 0;
let c6 = 0;
let c4 = 0;
const iter = (function*(arg0) {
let c0;
let c1;
if (c6 === 2) {
c6 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp7 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let asyncGeneratorStep = tmp3;
let user = tmp5;
let callback;
user = undefined;
({ checkoutSucceeded: c0, order: c1 } = callback);
c5 = 1;
c6 = 1;
return { value: "ct", done: true };
}
} else {
if (1 === tmp8) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
let obj1 = { value: null, done: true };
obj1[0] = arg1;
return obj1;
} else if (!callback) {
let id;
if (user != null) {
id = user.id;
}
if (null != id) {
if (user.status === constants.DRAFT) {
let c4 = 1;
obj1 = callback(user[2]);
c5 = 3;
c6 = 1;
const obj2 = { value: null, done: false };
obj2[0] = obj1.discardOrder(user.id);
return obj2;
}
}
}
} else {
if (2 === tmp8) {
c4 = 0;
} else if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 !== 2) {
c4 = 0;
}
c4 = 0;
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
c6 = 3;
}
} catch (tmp21) {
constants = tmp21;
if (tmp4 === c4) {
c6 = tmp2;
throw tmp21;
} else {
c5 = tmp;
}
}
}
})();
iter.next();
return iter;
});
const _discardDraftOrder = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
const result = require("getOrders").fileFinishedImporting("modules/checkout/utils/OrderUtils.native.tsx");
export const discardDraftOrder = function discardDraftOrder(arg0) {
const self = this;
const apply = _discardDraftOrder.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
};