PageSourceSearch

https://portal.godesignguru.com/build/assets/InternalSubscriptionsCheckout-udYl1Zca.js

js godesignguru.com collected 2026-10-04 05:48:55 UTC 12,891 bytes, 76 lines download raw bytes

1import { o as d, c as m, a as e, t, e as c, u as s, b as D, f as U, d as g, w as I, v as O, C as V, F as L, r as z, g as x, G as A, q as S, l as G, j as T, J as X, n as J, B as P, s as Q, y as B } from "./app-yg_pP4S4.js";
2import { _ as W } from "./InputError-c3Vl2Z79.js";
3import { S as H } from "./powered_by_stripe-CbOTyS_c.js";
4import { _ as E } from "./BaseButton-DP1PFEmO.js";
5import { _ as K } from "./BaseInput-DrEncIoW.js";
6import { _ as N } from "./ServiceImage-_IFbGTdH.js";
7import { f as y, n as Y } from "./functions-DLrKIvnr.js";
8import { u as Z } from "./modelWrapper-D0DowOi8.js";
9import { an as M } from "./XMarkIcon-C7ztHuKP.js";
10import { r as ee } from "./ShieldCheckIcon-kwx7dlBG.js";
11import { _ as te } from "./CardField-DQ4HQHKB.js";
12import { _ as se } from "./DashboardLayout-CXf_hhYT.js";
13import { g as q, s as F } from "./getStripe-BXcvn0by.js";
14import "./index-CDyB1Hog.js";
15import "./AlertCard-SUuzXx3b.js";
16import "./UserAvatar-B3-R1wxh.js";
17import "./ApplicationLogo-D4QkytOJ.js";
18import "./LiveChat-BEmWJs6j.js";
19import "./_plugin-vue_export-helper-DlAUqK2U.js";
20import "./popover-DTQdCRwt.js";
21import "./consts-7Qk9bpse.js";
22import "./form-BcDj1t5Y.js";
23import "./LoaderIcon-BfI_LFZK.js";
24import "./ModalConfirmation-BptK8hn4.js";
25import "./index-BF2h0ubX.js";
26import "./CheckIcon-Bb6ppPFl.js";
27import "./BaseModal-lnT_D81c.js";
28import "./EyeIcon-C30yl1ND.js";
29import "./HomeIcon-B7IW8yDA.js";
30import "./MinusIcon-C5ZUuSoW.js";
31import "./menu-DpWDC0YJ.js";
32import "./use-text-value-9Z6g_4jd.js";
33import "./use-tree-walker-DC0osvAV.js";
34import "./vue-transitions-DxcThSkT.js";
35import "./ClockIcon-DWc8x_ii.js";
36const ae = { class: "sticky top-16 rounded-md bg-gray-50 px-4 py-6" }, oe = { class: "mb-2 text-lg font-bold text-gray-900" }, ie = { class: "flex justify-between border-b py-4" }, re = { class: "truncate pr-10" }, ne = { class: "flex space-x-1" }, ce = { class: "truncate font-medium text-gray-900" }, le = { class: "shrink-0 text-sm text-gray-900" }, de = { key: 0, class: "flex justify-between border-b py-4" }, me = { class: "truncate pr-10" }, ue = { class: "flex space-x-1" }, pe = { class: "truncate font-medium text-gray-900" }, fe = { class: "shrink-0 text-sm text-gray-900" }, _e = { class: "border-b py-6" }, ve = { for: "discount-code", class: "block text-sm font-medium text-gray-700" }, he = { class: "mt-1 flex space-x-4 max-lg:[&_input]:text-base [@media(hover:none)]:[&_input]:min-h-11" }, ye = { key: 0, class: "flex items-center justify-center space-x-3" }, ge = { key: 1 }, be = { class: "space-y-4 py-4 text-gray-500" }, xe = { class: "flex items-center justify-between" }, $e = { class: "text-base font-medium" }, we = { class: "text-sm" }, ke = { key: 0, class: "flex items-center justify-between" }, Se = { class: "text-base font-medium" }, Ue = { class: "text-sm text-primary-600" }, je = { class: "flex items-center justify-between border-t pt-6" }, Ce = { class: "text-base font-medium text-gray-900" }, De = { class: "text-base font-medium text-gray-900" }, Ve = { class: "mb-6 mt-4 flex space-x-2 [@media(hover:none)]:py-1" }, Pe = { class: "flex h-5 items-center" }, Be = { for: "terms", class: "select-none text-sm text-gray-500 [@media(hover:none)]:-my-3 [@media(hover:none)]:py-3" }, Ee = { href: "https://www.manyrequests.com/terms-of-services", target: "_blank", class: "text-blue-500" }, Me = { class: "mt-6" }, qe = { key: 0, class: "flex items-center justify-center space-x-3" }, Fe = { key: 1 }, Ie = { class: "flex flex-col items-center" }, Le = { class: "w-full border-b pb-4 pt-12" }, Ne = { class: "flex items-center justify-center space-x-2" }, Re = { class: "font-semibold text-gray-900" }, Oe = { class: "mb-12 flex space-x-1 pt-4" }, ze = ["src", "alt"], Ae = ["src"], Ge = { __name: "InternalSubscriptionsCheckoutSummary", props: { modelValue: { type: Object, required: true }, seatUsage: { type: Number, required: true }, variation: { type: Object, required: true } }, emits: ["update:modelValue", "complete"], setup(r, { emit: j }) {
37  const a = r, u = j, o = Z(a, u, "modelValue"), C = x(() => o.value.discount > 0), f = A(false), $ = [{ name: "mastercard", image: new URL("/build/assets/mastercard-vSs7tDTs.png", import.meta.url).href }, { name: "visa", image: new URL("/build/assets/visa-DIAmXEvq.png", import.meta.url).href }, { name: "american-express", image: new URL("/build/assets/american-express-ChmQ_Mkf.png", import.meta.url).href }, { name: "discover", image: new URL("/build/assets/discover-DcpPhwFX.png", import.meta.url).href }, { name: "ucb", image: new URL("/build/assets/ucb-B7os8fhx.png", import.meta.url).href }], w = x(() => Math.max(0, a.seatUsage - a.variation.included_seats)), v = x(() => w.value * a.variation.extra_seat_price), l = x(() => parseFloat(a.variation.price) + v.value), p = x(() => _.chain(l.value).subtract(o.value.discount).value()), b = (i) => _.capitalize(i), k = () => {
38    o.value.processing || !o.value.coupon || f.value || (f.value = true, o.value.discount = 0, S.get(route("settings.profile.admin.subscriptions.checkout.verify-coupon", a.variation), { code: o.value.coupon }, { preserveState: true, preserveScroll: true, onSuccess: (i) => {
39      const n = i.props.flash.coupon;
40      if (f.value = false, n.percent_off) return o.value.discount = _.chain(l.value).multiply(n.percent_off).divide(100).value(
40);
41      o.value.discount = Y(n.amount_off);
42    }, onError: (i) => {
43      o.value.discount = 0, o.value.coupon = null, o.value.errors.coupon = i.code, f.value = false;
44    } }));
45  };
46  return (i, n) => (d(), m("div", ae, [e("h4", oe, t(i.$t("Order summary")), 1), e("div", ie, [e("div", re, [e("div", ne, [c(N, { class: "h-9 w-9 object-cover md:my-1 md:mr-2", service: { name: r.variation.plan.title, image: r.variation.plan.image } }, null, 8, ["service"]), e("div", null, [e("span", ce, t(b(r.variation.plan.title)), 1)])])]), e("span", le, t(s(y)(r.variation.price, "USD", false)), 1)]), r.variation.extra_seat_price ? (d(), m("div", de, [e("div", me, [e("div", ue, [n[3] || (n[3] = e("div", { class: "h-9 w-9 md:my-1 md:mr-2" }, null, -1)), e("div", null, [e("span", pe, t(w.value) + " x " + t(i.$t("Extra seats")), 1)])])]), e("span", fe, t(s(y)(v.value, "USD", false)), 1)])) : D("", true), e("div", _e, [e("label", ve, t(i.$t("Coupon code")), 1), e("div", he, [c(K, { id: "discount-code", modelValue: s(o).coupon, "onUpdate:modelValue": n[0] || (n[0] = (h) => s(o).coupon = h), placeholder: i.$t("Enter your coupon code"), class: "w-full" }, null, 8, ["modelValue", "placeholder"]), c(E, { secondary: "", class: "[@media(hover:none)]:min-h-11", disabled: f.value, onClick: k }, { default: U(() => [f.value ? (d(), m("span", ye, [c(s(M), { class: "h-5 w-5 animate-spin" }), e("span", null, t(i.$t("Processing")), 1)])) : (d(), m("span", ge, t(i.$t("Apply")), 1))]), _: 1 }, 8, ["disabled"])])]), e("dl", null, [e("div", be, [e("div", xe, [e("dt", $e, t(i.$t("Subtotal")), 1), e("dd", we, t(s(y)(l.value, "USD", false)), 1)]), C.value ? (d(), m("div", ke, [e("dt", Se, t(i.$t("Discount")), 1), e("dd", Ue, t(s(y)(s(o).discount, "USD", false)), 1)])) : D("", true)]), e("div", je, [e("dt", Ce, [g(t(i.$t("Grand total")) + " ", 1), n[4] || (n[4] = e("span", { class: "text-sm font-normal text-gray-600" }, " (USD) ", -1))]), e("dd", De, t(s(y)(p.value, "USD", false)), 1)]), e("div", null, [e("div", Ve, [e("div", Pe, [I(e("input", { id: "terms", "onUpdate:modelValue": n[1] || (n[1] = (h) => s(o).accepted_tos = h), name: "terms", type: "checkbox", class: "h-4 w-4 rounded border-gray-300 text-primary-600 focus:outline-none focus:ring-0 focus:ring-offset-0" }, null, 512), [[O, s(o).accepted_tos]])]), e("label", Be, [g(t(i.$t("By submitting this form you agree to our")) + " ", 1), e("a", Ee, t(i.$t("terms of service")), 1), n[5] || (n[5] = g(". ", -1))])]), e("div", Me, [c(E, { class: V(["w-full [@media(hover:none)]:min-h-11", { "cursor-not-allowed bg-primary-600/50": !s(o).accepted_tos || s(o).processing }]), disabled: !s(o).accepted_tos || s(o).processing, onClick: n[2] || (n[2] = (h) => u("complete")) }, { default: U(() => [s(o).processing ? (d(), m("span", qe, [c(s(M), { class: V(["h-5 w-5", { "animate-spin": s(o).processing }]) }, null, 8, ["class"]), e("span", null, t(i.$t("Processing")), 1)])) : (d(), m("span", Fe, t(i.$t("Complete order")), 1))]), _: 1 }, 8, ["class", "disabled"])])]), e("div", Ie, [e("div", Le, [e("div", Ne, [c(s(ee), { class: "h-5 w-5 text-gray-900" }), e("span", Re, t(i.$t("Secure checkout")), 1)])]), e("div", Oe, [(d(), m(L, null, z($, (h, R) => e("img", { key: R, src: h.image, alt: h.name, class: "h-6 w-9 rounded-md border border-gray-300 object-contain p-0.5" }, null, 8, ze)), 64))]), e("img", { src: s(H), alt: "Powered By Stripe", class: "w-36" }, null, 8, Ae)])])]));
47} }, Te = { class: "grid grid-cols-12 gap-x-12 bg-white p-6 max-lg:block max-sm:p-4" }, Xe = { class: "col-span-7 space-y-8" }, Je = { class: "flex rounded-md bg-gray-50 p-4" }, Qe = { class: "w-full" }, We = { class: "mb-2 font-bold text-gray-900" }, He = { class: "flex justify-between max-sm:flex-col-reverse max-sm:gap-2" }, Ke = { class: "prose prose-base whitespace-normal text-sm text-gray-500" }, Ye = { class: "flex justify-end max-sm:justify-start" }, Ze = { class: "truncate text-sm text-gray-900" }, et = { class: "font-bold" }, tt = { class: "ml-1 capitalize text-gray-500" }, st = { key: 0, class: "mt-4" }, at = { class: "prose prose-base whitespace-normal text-sm text-gray-500" }, ot = { class: "font-semibold" }, it = { class: "border-t border-gray-200 py-6" }, rt = { class: "mb-6 text-lg font-bold text-gray-900" }, nt = { class: "col-span-5 max-lg:mt-2" }, Gt = { __name: "InternalSubscriptionsCheckout", props: { variation: { type: Object, required: true }, seatUsage: { type: Number, required: true } }, setup(r) {
48  const j = r, a = G({ accepted_tos: false, payment_method_id: null, coupon: null }), { t: u } = T(), o = [{ label: u("Settings"), url: route("settings.modules.index") }, { label: u("Subscriptions"), url: route("settings.profile.admin.subscriptions.index") }, { label: u("Checkout") }], C = async () => await q(true).createPaymentMethod("card", F.value.cardElement), f = () => {
49    q(true).confirmCardPayment(a.client_secret, { payment_method: a.payment_method_id, setup_future_usage: "off_session" }).then((l) => {
50      l.paymentIntent && l.paymentIntent.status === "succeeded" ? S.visit(route("internal-checkout.invoice.confirmation", a.invoice_id)) : (F.value.cardError = l.error.message, a.processing = false);
51    });
52  }, $ = async () => {
53    if (a.processing) return;
54    a.processing = true;
55    const { paymentMethod: v, error: l } = await C();
56    if (l) {
57      a.processing = false;
58      return;
59    }
60    a.payment_method_id = v.id, axios.post(route("settings.profile.admin.subscriptions.checkout.process", j.variation.id), B.omitBy({ payment_method_id: a.payment_method_id, coupon: a.coupon }, B.isNil)).then(async (p) => {
61      if (a.client_secret = p.data.client_secret, a.invoice_id = p.data.invoice_id, p.data.status === "succeeded") return S.visit(route("internal-checkout.invoice.confirmation", a.invoice_id));
62      f();
63    }).catch(({ response: p }) => {
64      a.processing = false;
65      const b = _.reduce(p.data.errors, (k, i, n) => (k[n] = i[0], k), {});
66      a.errors = b;
67    });
68  }, w = () => S.visit(route("settings.profile.admin.subscriptions.index"));
69  return (v, l) => {
70    const p = X("dompurify-html");
71    return d(), m(L, null, [c(s(J), { title: s(u)("Subscriptions") }, null, 8, ["title"]), c(se, { breadcrumbs: o }, { header: U(() => [g(t(s(u)("Subscribe")), 1)]), default: U(() => [e("form", { onSubmit: P($, ["prevent"]), onReset: P(w, ["prevent"]) }, [e("div", Te, [e("div", Xe, [e("div", Je, [c(N, { class: "h-9 !w-9 object-cover max-md:mr-3 md:my-1 md:mr-2", service: { name: r.variation.plan.title, image: r.variation.plan.image } }, null, 8, ["service"]), e("div", Qe, [e("h3", We, t(r.variation.plan.title), 1), e("div", He, [I(e("div", Ke, null, 512), [[p, r.variation.plan.description]]), e("div", Ye, [e("p", Ze, [e("span", et, t(s(y)(r.variation.price)), 1), e("span", tt, t(r.variation.billing_period.description), 1)])])]), r.variation.extra_seat_price ? (d(), m("div", st, [e("p", at, [g(t(s(u)("Extra seat:")) + " ", 1), e("span", ot, t(s(y)(r.variation.extra_seat_price)), 1), g(" " + t(r.variation.billing_period.description), 1)])])) : D("", true)])]), e("div", it, [e("h4", rt, t(v.$t("Payment method")), 1), c(te, { "is-internal": true }), c(W, { message: s(a).errors.general }, null, 8, ["message"])])]), e("div", nt, [c(Ge, { modelValue: s(a), "onUpdate:modelValue": l[0] || (l[0] = (b) => Q(a) ? a.value = b : null), variation: r.variation, "seat-usage": r.seatUsage, onComplete: $ }, null, 8, ["modelValue", "variation", "seat-usage"])])])], 32)]), _: 1 })], 64);
72  };
73} };
74export {
75  Gt as default
76};

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.