1import { o as m, c as y, a as t, t as n, F as S, r as O, u as i, b as B, d as h, w as G, v as M, e as p, f as F, g as v, h as P, i as R, m as E, j as U, p as I, k as T, l as z, n as D, q as A, s as K, x as L, y as b } from "./app-BQglH-tG.js"; 2import { S as W } from "./powered_by_stripe-CbOTyS_c.js"; 3import { _ as H } from "./BaseButton-BF1tDvcc.js"; 4import { f as k, i as j, p as J, d as Q } from "./functions-DNMBuN0o.js"; 5import { u as X } from "./modelWrapper-BuMWMt6a.js"; 6import { r as Y, _ as Z } from "./OrderAdminAlert-DwL3mvap.js"; 7import { _ as ee, a as te } from "./PaymentMethodField-m2X2yP-i.js"; 8import { _ as se } from "./BaseStepper-D0zmqV0f.js"; 9import { _ as ae } from "./FullPageLayout-DxacpfKu.js"; 10import { s as w, g as oe } from "./getStripe-DmGsoq_G.js"; 11import "./AlertCard-BE4TGkwO.js"; 12import "./LiveChat-Cv9P2dP9.js"; 13import "./index-B6o3v9Fz.js"; 14import "./consts-CUuEXtFB.js"; 15import "./form-BicfoI4A.js"; 16import "./vue-tabler-icons.es-_MpZvCnK.js"; 17import "./XMarkIcon-JhKzQL4a.js"; 18import "./ApplicationLogo-BE-OKeyv.js"; 19import "./_plugin-vue_export-helper-DlAUqK2U.js"; 20import "./UserAvatar-Boyff1w9.js"; 21import "./popover-Blq397Xu.js"; 22import "./BaseInput-1l26qd8j.js"; 23import "./LoaderIcon-BOkmnW5w.js"; 24import "./ModalConfirmation-DER2JDFV.js"; 25import "./index-CQ6xcn9I.js"; 26import "./CheckIcon-pbR60zuN.js"; 27import "./BaseListbox-CWI9LspK.js"; 28import "./listbox--4vAmvqx.js"; 29import "./use-text-value-CY-cTGmG.js"; 30import "./ChevronDownIcon-CtpQP63k.js"; 31import "./BasePhoneInput-Dix9OCAt.js"; 32import "./Checkbox-BqkCWzaU.js"; 33import "./InputError-BlVrgZq_.js"; 34import "./radio-group-F9iT_Js4.js"; 35import "./use-tree-walker-BR_K-2Kt.js"; 36import "./FormFooter-cMftLzxe.js"; 37const re = { class: "sticky top-16 rounded-md bg-gray-50 px-4 py-6" }, ie = { class: "mb-2 text-lg font-bold text-gray-900" }, ne = { class: "truncate pr-10" }, le = { class: "flex space-x-1" }, ce = { class: "truncate text-sm font-medium text-gray-900" }, de = { class: "shrink-0 text-sm font-medium text-gray-900" }, ue = { class: "shrink-0 text-sm text-gray-900" }, me = { class: "space-y-4 py-4 text-gray-500" }, pe = { class: "flex items-center justify-between" }, ye = { class: "text-base font-medium" }, fe = { class: "text-sm" }, _e = { key: 0, class: "flex items-center justify-between" }, ve = { class: "text-base font-medium" }, ge = { class: "text-sm" }, xe = { class: "flex items-center justify-between border-t pt-6" }, he = { class: "text-base font-medium text-gray-900" }, be = { key: 0, class: "text-sm font-normal text-gray-600" }, ke = { class: "text-base font-medium text-gray-900" }, we = { class: "mb-6 mt-4 flex space-x-2" }, $e = { class: "flex h-5 items-center" }, qe = { for: "terms", class: "select-none text-sm text-gray-500" }, Ve = { href: "#", target: "_blank", class: "text-blue-500" }, Ae = { class: "mt-6" }, Se = { class: "flex flex-col items-center" }, Be = { class: "w-full border-b pb-4 pt-12" }, Ce = { class: "flex items-center justify-center space-x-2" }, Fe = { class: "font-semibold text-gray-900" }, je = ["src"], Ne = { __name: "AddOnCheckoutSummary", props: { modelValue: { type: Object, required: true }, addOns: { type: Array, required: true }, currency: { type: String, required: true } }, emits: ["update:modelValue"], setup(r, { emit: a }) { 38 const l = r, e = X(l, a, "modelValue"), f = l.addOns.reduce((c, s) => c + parseFloat(s.price * s.pivot.quantity), 0), g = v(() => _.chain(f).multiply(e.value.taxes).divide(100).value()), $ = v(() => _.chain(f).add(g.value).value()), q = v(() => e.value.taxes > 0); 39 return (c, s) => (m(), y(S, null, [t("div", re, [t("h4", ie, n(c.$t("Order summary")), 1)]), (m(true), y(S, null, O(r.addOns, (o, u) => (m(), y("div", { key: `add-on-${u}`, class: "flex justify-between border-b py-4" }, [t("div", ne, [t("div", le, [t("span", ce, n(o.label), 1), t("span", de, n(o.pivot.quantity > 1 ? `x${o.pivot.quantity}` : ""), 1)])]), t("span", ue, n(i(k)(o.price * o.pivot.quantity, r.currency, false)), 1)]))), 128)), t("dl", null, [t("div", me, [t("div", pe, [t("dt", ye, n(c.$t("Subtotal")), 1), t("dd", fe, n(i(k)(i(f), r.currency, false)), 1)]), q.value ? (m(), y("div", _e, [t("dt", ve, n(c.$t("Taxes ({percentage}%)", { percentage: i(e).taxes })), 1), t("dd", ge, n(i(k)(g.value, r.currency, false)), 1)])) : B("", true)]), t("div", xe, [t("dt", he, [h(n(c.$t("Grand total")) + " ", 1), r.currency ? (m(), y("span", be, " (" + n(r.currency) + ") ", 1)) : B("", true)]), t("dd", ke, n(i(k)($.value, r.currency, false)), 1)]), t("div", we, [t("div", $e, [G(t("input", { id: "terms", "onUpdate:modelValue": s[0] || (s[0] = (o) => i(e).accepted_tos = o), name: "terms", type: "checkbox", class: "h-4 w-4 roun
39ded border-gray-300 text-primary-600 focus:outline-none focus:ring-0 focus:ring-offset-0" }, null, 512), [[M, i(e).accepted_tos]])]), t("label", qe, [h(n(c.$t("By submitting this form you agree to our")) + " ", 1), t("a", Ve, n(c.$t("terms of service")), 1), s[1] || (s[1] = h(". ", -1))])]), t("div", Ae, [p(H, { class: "w-full", disabled: !i(e).accepted_tos }, { default: F(() => [h(n(c.$t("Complete order")), 1)]), _: 1 }, 8, ["disabled"])]), t("div", Se, [t("div", Be, [t("div", Ce, [p(i(Y), { class: "h-5 w-5 text-gray-900" }), t("span", Fe, n(c.$t("Secure checkout")), 1)])]), t("img", { src: i(W), alt: "Powered By Stripe", class: "w-36" }, null, 8, je)])])], 64)); 40} }, Oe = { class: "mb-12 px-4" }, Ge = { class: "mb-6 text-3xl font-bold text-gray-900" }, Me = { class: "grid grid-cols-12 gap-x-12" }, Pe = { class: "col-span-7 space-y-8" }, Re = { class: "col-span-5" }, Ee = { __name: "AddOnCheckoutBillingDetails", props: E({ paymentGateways: { type: Array, required: true }, addOns: { type: Array, required: true }, askFullAddress: { type: Boolean, required: true } }, { modelValue: { type: [Object, String, Number] }, modelModifiers: {} }), emits: ["update:modelValue"], setup(r) { 41 const a = P(r, "modelValue"); 42 return (l, d) => (m(), y("div", Oe, [t("h3", Ge, n(l.$t("Checkout")), 1), i(j) ? (m(), R(Z, { key: 0, class: "mb-6" })) : B("", true), t("div", Me, [t("div", Pe, [p(ee, { modelValue: a.value, "onUpdate:modelValue": d[0] || (d[0] = (e) => a.value = e), "ask-full-address": r.askFullAddress }, null, 8, ["modelValue", "ask-full-address"]), p(te, { modelValue: a.value, "onUpdate:modelValue": d[1] || (d[1] = (e) => a.value = e), "payment-gateways": r.paymentGateways }, null, 8, ["modelValue", "payment-gateways"])]), t("div", Re, [p(Ne, { modelValue: a.value, "onUpdate:modelValue": d[2] || (d[2] = (e) => a.value = e), "add-ons": r.addOns, currency: r.addOns[0].add_on.currency }, null, 8, ["modelValue", "add-ons", "currency"])])])])); 43} }, Ue = { class: "pt-12" }, $t = { __name: "AddOnCheckout", props: { draftRequest: { type: Object, required: true }, taxes: { type: [String, Number], default: "0" }, paymentGateways: { type: Array, required: true }, countries: { type: Array, required: true }, rewardfulApiKey: { type: String, required: false }, tapfiliateAccountId: { type: String, required: false }, askFullAddress: { type: Boolean, required: false } }, setup(r) { 44 const a = r, l = v(() => L().props.auth.user), { t: d } = U(); 45 I("countries", a.countries), T(() => { 46 const s = a.draftRequest.add_on_options, o = s.reduce((N, C) => N + parseFloat(C.price * C.pivot.quantity), 0), u = _.chain(o).multiply(a.taxes).divide(100).value(), x = s[0].add_on.currency, V = _.chain(o).add(u).value(); 47 w.value.options = { mode: "payment", amount: J(V, x), currency: x.toLowerCase() }; 48 }); 49 const e = z({ taxes: a.taxes, accepted_tos: false, billing: { invoice_to: l.value.invoice_to, country: l.value.country, processing: false, for_company: !!(l.value && l.value.tax_code), street_address: l.value.street_address, city: l.value.city, province: l.value.province, zip_code: l.value.zip_code, tax_code: l.value.tax_code }, payment_type: Q(a.paymentGateways), payment_method_id: null, payment_reference: null }), f = v(() => _.find(a.countries, { name: e.billing.country })), g = [{ name: d("Billing details"), component: Ee, props: { addOns: a.draftRequest.add_on_options, paymentGateways: a.paymentGateways, askFullAddress: a.askFullAddress }, disableNext: () => !e.accepted_tos || j.value }], $ = async () => { 50 const s = oe(), { error: o } = await s.confirmPayment({ elements: w.value.elements, clientSecret: e.client_secret, confirmParams: { return_url: route("checkout.complete"), payment_method_data: { billing_details: { address: { country: f.value.iso_3166_1_alpha2, postal_code: e.billing.zip_code } } } }, redirect: "if_required", setup_future_usage: "off_session" }); 51 if (o) { 52 w.value.cardError = o.message, e.processing = false; 53 return; 54 } 55 A.visit(route("checkout.invoice.confirmation", e.invoice_id)); 56 }, q = async () => { 57 try { 58 const s = await axios.post(route("add-ons.checkout.stripe", a.draftRequest.slug), b.omitBy({ billing: e.billing }, b.isNil)); 59 if (e.client_secret = s.data.client_secret, e.invoice_id = s.data.invoice_id, s.data.status === "succeeded") return A.visit(route("checkout.invoice.confirmation", e.invoice_id)); 60 } catch ({ response: s }) { 61 e.processing = false;
62 const o = _.reduce(s.data.errors, (u, x, V) => (u[V] = x[0], u), {}); 63 e.errors = o; 64 } 65 }, c = async () => { 66 if (e.processing = true, e.payment_type == "stripe") { 67 const { error: s } = await w.value.elements.submit(); 68 if (s) { 69 e.processing = false; 70 return; 71 } 72 return await q(), await $(); 73 } else e.transform((s) => b.omitBy({ payment_reference: s.payment_reference, billing: s.billing }, b.isNil)).post(route("add-ons.checkout.manual", a.draftRequest.slug)); 74 }; 75 return (s, o) => (m(), y(S, null, [p(i(D), { title: i(d)("Checkout") }, null, 8, ["title"]), p(ae, { "rewardful-api-key": r.rewardfulApiKey, "tapfiliate-account-id": r.tapfiliateAccountId }, { default: F(() => [t("div", Ue, [p(se, { modelValue: i(e), "onUpdate:modelValue": o[0] || (o[0] = (u) => K(e) ? e.value = u : null), steps: g, "finish-text": i(d)("Complete order"), "validate-go-back": false, loading: i(e).processing, onFinish: c, onExit: o[1] || (o[1] = (u) => i(A).get(s.route("requests.index"))) }, null, 8, ["modelValue", "finish-text", "loading"])])]), _: 1 }, 8, ["rewardful-api-key", "tapfiliate-account-id"])], 64)); 76} }; 77export { 78 $t as default 79};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.