PageSourceSearch

https://portal.godesignguru.com/build/assets/AddOnCreate-BpBOkTVI.js

js godesignguru.com collected 2026-10-04 05:48:13 UTC 11,050 bytes, 52 lines download raw bytes

1import { j as S, l as F, z as N, A as W, o as p, c, e as a, u as e, n as T, f as d, a as s, B as w, t as n, C as u, b, i as z, s as D, d as E, F as M, g as O, y as V } from "./app-yg_pP4S4.js";
2import { _ as P } from "./AddOnMultiplePrices-CvJgGF95.js";
3import { _ as R, r as j } from "./BaseInput-DrEncIoW.js";
4import { _ as g } from "./BaseListbox-BuI0rG6W.js";
5import { _ as I } from "./LiveChat-BEmWJs6j.js";
6import { _ as G } from "./CurrencyInput-DzVajgur.js";
7import { _ as H } from "./FormFooter-BR3rPhrH.js";
8import { _ as y } from "./InputError-c3Vl2Z79.js";
9import { _ as J } from "./TipTapEditor-syDIvp4e.js";
10import { _ as K } from "./DashboardLayout-CXf_hhYT.js";
11import { r as L } from "./QuestionMarkCircleIcon-JTZoUTWk.js";
12import { r as Q } from "./CheckIcon-Bb6ppPFl.js";
13import "./modelWrapper-D0DowOi8.js";
14import "./TrashIcon-7IRzqwUc.js";
15import "./ModalConfirmation-BptK8hn4.js";
16import "./LoaderIcon-BfI_LFZK.js";
17import "./_plugin-vue_export-helper-DlAUqK2U.js";
18import "./functions-DLrKIvnr.js";
19import "./XMarkIcon-C7ztHuKP.js";
20import "./index-CDyB1Hog.js";
21import "./listbox-BVei8WBz.js";
22import "./form-BcDj1t5Y.js";
23import "./use-text-value-9Z6g_4jd.js";
24import "./ChevronDownIcon-DvXuQ_5B.js";
25import "./ApplicationLogo-D4QkytOJ.js";
26import "./UserAvatar-B3-R1wxh.js";
27import "./popover-DTQdCRwt.js";
28import "./consts-7Qk9bpse.js";
29import "./index-BF2h0ubX.js";
30import "./BaseButton-DP1PFEmO.js";
31import "./BaseModal-lnT_D81c.js";
32import "./EyeIcon-C30yl1ND.js";
33import "./HomeIcon-B7IW8yDA.js";
34import "./MinusIcon-C5ZUuSoW.js";
35import "./menu-DpWDC0YJ.js";
36import "./use-tree-walker-DC0osvAV.js";
37import "./vue-transitions-DxcThSkT.js";
38import "./ClockIcon-DWc8x_ii.js";
39const X = { class: "p-6 max-sm:p-4" }, Y = { class: "h5 text-lg font-bold text-gray-900 sm:text-lg" }, Z = { class: "text-sm text-gray-500" }, ee = { class: "py-6 max-sm:py-3" }, te = { for: "title", class: "block text-base font-medium leading-5 text-gray-900" }, se = { class: "relative mt-1 lg:max-w-[50%]" }, oe = { class: "py-6 max-sm:py-3" }, le = { for: "description", class: "block text-base font-medium leading-5 text-gray-900" }, ie = { class: "relative mt-1 lg:max-w-[50%]" }, re = { key: 0, class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3" }, ae = { class: "py-6 max-sm:py-3" }, ne = { for: "type", class: "block text-base font-medium leading-5 text-gray-900" }, de = { key: 0, class: "py-6 max-sm:py-3" }, pe = { for: "price", class: "block text-base font-medium leading-5 text-gray-900" }, me = { class: "relative mt-1 lg:max-w-[50%]" }, ce = { class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3" }, ue = { id: "price-currency", class: "text-gray-500 sm:text-sm" }, _e = { class: "py-6 max-sm:py-3" }, ge = { class: "block text-base font-medium leading-5 text-gray-900" }, ye = { key: 2, class: "py-6 max-sm:py-3" }, be = { class: "block text-base font-medium leading-5 text-gray-900" }, fe = { class: "py-6 max-sm:py-3" }, he = { class: "flex items-center" }, xe = { class: "ml-[3.75rem] mt-1 text-sm text-gray-500 [@media(hover:hover)]:hidden" }, ve = { class: "py-6 max-sm:py-3" }, we = { class: "h5 mb-6 text-lg font-bold text-gray-900 sm:text-lg" }, Ve = { class: "relative mt-1 flex lg:max-w-[50%]" }, ke = { for: "applies_to_services", class: "block whitespace-normal text-sm font-medium text-gray-500" }, Ce = { class: "block" }, mt = { __name: "AddOnCreate", props: { periods: { type: Array, required: true }, services: { type: Array, required: true }, currency: { type: String, required: true } }, setup(f) {
40  const m = f, { t: i } = S(), k = [{ label: i("Add-ons"), url: route("add-ons.index") }, { label: i("Create") }], t = F({ title: null, description: null, type: "single", billing_type: "one-off", price: null, applies_to_services: [], options: [{ label: "", price: null }], currency: m.currency, billing_period: m.periods[0].id, allow_quantity_selection: true }), C = [{ label: i("Single"), value: "single" }, { label: i("Multiple"), value: "multiple" }], $ = [{ label: i("One-off"), value: "one-off" }, { label: i("Recurring"), value: "recurring" }], h = O(() =>
40 m.services.filter((l) => t.billing_type === "one-off" || l.pricing_variations.some((o) => o.billing_period_id === t.billing_period)).map((l) => ({ ...l, value: l.id, label: l.name })));
41  N(h, () => t.applies_to_services = t.applies_to_services.filter((l) => m.services.find((o) => o.id === l).pricing_variations.some((o) => o.billing_period_id === t.billing_period)));
42  const q = m.periods.map((l) => ({ value: l.id, label: _.capitalize(l.name) })), B = () => {
43    t.transform((l) => V.omitBy({ billing_type: l.billing_type, type: l.type, title: l.title, price: l.type !== "multiple" ? l.price : null, description: l.description, options: l.type === "multiple" ? l.options : null, applies_to_services: l.applies_to_services, billing_period_id: l.billing_type === "recurring" ? l.billing_period : null, allow_quantity_selection: l.allow_quantity_selection }, V.isNil)).post(route("add-ons.store"));
44  }, U = () => window.history.back();
45  return (l, o) => {
46    const A = W("VTooltip");
47    return p(), c(M, null, [a(e(T), { title: e(i)("Create add-on") }, null, 8, ["title"]), a(K, { breadcrumbs: k, "show-footer": false, "wrapper-class": "flow-root overflow-clip max-lg:[&_input]:text-base max-lg:[&_textarea]:text-base [@media(hover:none)]:[&_button[aria-haspopup=listbox]]:min-h-11" }, { header: d(() => [E(n(e(i)("Create add-on")), 1)]), default: d(() => [s("form", { onSubmit: w(B, ["prevent"]) }, [s("div", X, [s("div", Y, n(e(i)("Add-on details")), 1), s("div", Z, n(e(i)("Set up add-ons for one or more services.")), 1), s("div", ee, [s("label", te, n(e(i)("Title")), 1), s("div", se, [a(R, { id: "title", modelValue: e(t).title, "onUpdate:modelValue": o[0] || (o[0] = (r) => e(t).title = r), "has-errors": e(t).errors.title, class: "w-full" }, null, 8, ["modelValue", "has-errors"])]), a(y, { message: e(t).errors.title }, null, 8, ["message"])]), s("div", oe, [s("label", le, n(e(i)("Description")), 1), s("div", ie, [a(J, { modelValue: e(t).description, "onUpdate:modelValue": o[1] || (o[1] = (r) => e(t).description = r), class: u([e(t).errors.description ? "border-red-300 text-red-900 placeholder-red-300 ring-red-500 focus:border-red-500 focus:outline-none" : "border border-gray-300 focus:border-primary-500 focus:ring-primary-500", "overflow-hidden bg-white"]), "show-buttons": "" }, null, 8, ["modelValue", "class"]), e(t).errors.description ? (p(), c("div", re, [a(e(j), { class: "h-5 w-5 text-red-500", "aria-hidden": "true" })])) : b("", true)]), a(y, { message: e(t).errors.description }, null, 8, ["message"])]), s("div", ae, [s("label", ne, n(e(i)("Field type")), 1), a(g, { modelValue: e(t).type, "onUpdate:modelValue": o[2] || (o[2] = (r) => e(t).type = r), options: C, "same-width-dropdown": "", class: "h-full lg:max-w-[50%]" }, null, 8, ["modelValue"])]), e(t).type === "single" ? (p(), c("div", de, [s("label", pe, n(e(i)("Price")), 1), s("div", me, [a(G, { id: "price", modelValue: e(t).price, "onUpdate:modelValue": o[3] || (o[3] = (r) => e(t).price = r), inputmode: "decimal", name: "price", class: u([e(t).errors.price ? "border-red-300 text-red-900 placeholder-red-300 focus:border-red-500 focus:outline-none focus:ring-red-500" : "border border-gray-300 focus:border-primary-500 focus:ring-primary-500", "block w-full rounded-md border-gray-300 pr-12 shadow-sm sm:text-sm"]) }, null, 8, ["modelValue", "class"]), s("div", ce, [s("span", ue, n(f.currency), 1)])]), a(y, { message: e(t).errors.price }, null, 8, ["message"])])) : (p(), z(P, { key: 1, modelValue: e(t), "onUpdate:modelValue": o[4] || (o[4] = (r) => D(t) ? t.value = r : null) }, null, 8, ["modelValue"])), s("div", _e, [s("label", ge, n(e(i)("Billing type")), 1), a(g, { modelValue: e(t).billing_type, "onUpdate:modelValue": o[5] || (o[5] = (r) => e(t).billing_type = r), options: $, "same-width-dropdown": "", class: "h-full lg:max-w-[50%]" }, null, 8, ["modelValue"])]), e(t).billing_type === "recurring" ? (p(), c("div", ye, [s("label", be, n(e(i)("Billing period")), 1), a(g, { modelValue: e(t).billing_period, "onUpdate:modelValue": o[6] || (o[6] = (r) => e(t).billing_period = r), options: e(q), "same-width-dropdown": "", class: "h-full lg:max-w-[50%]" }, null, 8, ["modelValue", "options"])])) : b("", true), s("div", fe, [s("div", he, [a(I, { modelValue: e(t).allow_quantity_selection, "onUpdate:modelValue": o[7] || (o[7] = (r) => e(t).allow_quantity_selection = r) }, null, 8, ["modelValue"]), s("span", { class: "my-auto ml-4 block cursor-pointer select-none text-sm font-medium text-gray-600", onClick: o[8] || (o[8] = (r) => e(t).allow_quantity_selection = !e(t).allow_quantity_selection) }, n(e(i)("Allow quantity selection")), 1), a(A, null, { popper: d(() => [s("p", null, n(e(i)("When enabled, clients can choose how many units to purchase during checkout. When disabled, only one unit can be purchased at a time.")), 1)]), default: d(() => [a(e(L), { class: "ml-2 h-5 w-5 cursor-help text-gray-400 [@media(hover:none)]:hidden" })]), _: 1 })]), s("p", xe, n(e(i)("When enabled, clients can choose how many units to purchase during checkout. When disabled, only one unit can be purchased at a time.")), 1)]), s("div", ve, [s("div", we, n(e(i)("Where add-ons appear")), 1), s("div", Ve, [a(g, { id: "applies_to_services", modelValue: e(t).applies_to_services, "onUpdate:modelValue": o[9] || (
47o[9] = (r) => e(t).applies_to_services = r), "has-errors": e(t).errors.applies_to_services, options: h.value, placeholder: e(i)("Select services"), class: "w-full", "dropdown-classes": "bottom-10 max-lg:[&_input]:text-base", multiple: "", searchable: "", "same-width-dropdown": "" }, { label: d(() => [s("label", ke, n(e(i)("Add-ons will appear in the intake form for the following services")), 1)]), option: d(({ option: r, active: x, selected: v }) => [s("li", { class: u([x ? "bg-gray-50" : "text-gray-900", "relative cursor-default select-none py-2 pl-3 pr-9"]) }, [s("div", { class: u([v ? "font-semibold" : "font-normal", "relative block truncate"]) }, [s("span", Ce, n(r.name), 1)], 2), v ? (p(), c("span", { key: 0, class: u([x ? "text-gray-600" : "text-gray-500", "absolute inset-y-0 right-0 flex items-center pr-4"]) }, [a(e(Q), { class: "h-5 w-5", "aria-hidden": "true" })], 2)) : b("", true)], 2)]), _: 1 }, 8, ["modelValue", "has-errors", "options", "placeholder"])]), a(y, { message: e(t).errors.applies_to_services }, null, 8, ["message"])])]), a(H, { "is-dirty": e(t).isDirty, processing: e(t).processing, "submit-text": e(i)("Create") }, { left: d(() => [s("button", { class: "inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2", onClick: w(U, ["prevent"]) }, n(l.$t("Cancel")), 1)]), _: 1 }, 8, ["is-dirty", "processing", "submit-text"])], 32)]), _: 1 })], 64);
48  };
49} };
50export {
51  mt as default
52};

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.