@feedmepos/mf-brand-app-builder 0.5.14-alpha.4 → 0.5.14

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.
Files changed (86) hide show
  1. package/dist/App-DZzvEb1n.js +101 -0
  2. package/dist/{AssetsSettings-5n_2qRjG.js → AssetsSettings-BNqB22rl.js} +102 -91
  3. package/dist/BuilderView-CdxiU_5V.js +5498 -0
  4. package/dist/ColorPicker-Bz8yOMlS.js +22 -0
  5. package/dist/{ImageUpload-DXagbr9d.js → ImageUpload-Cpkzp4iS.js} +16 -16
  6. package/dist/{LinkButton-B7xgRAIw.js → LinkButton-D0MS93kZ.js} +44 -44
  7. package/dist/{ListRepeater-vOdEfxqj.js → ListRepeater-B_aON8eJ.js} +1 -1
  8. package/dist/{ManagementSettings-BE16MVVb.js → ManagementSettings-ljpWqE-1.js} +61 -44
  9. package/dist/StepperField-xVvcmxNx.js +29 -0
  10. package/dist/{app-B9Ng1g2b.js → app-BSofsfPH.js} +72 -131
  11. package/dist/app.js +1 -1
  12. package/dist/components/src/components/Homepage.vue.d.ts +0 -2
  13. package/dist/components/src/components/atoms/Container.vue.d.ts +0 -1
  14. package/dist/components/src/main.d.ts +1 -10
  15. package/dist/{image-CgXjWyqN.js → image-Dm7AsBZX.js} +8 -8
  16. package/dist/{index-BakrTyC_.js → index-B0O5NxWl.js} +1 -2
  17. package/dist/{index-DKsLsGlf.js → index-BZ63ygCw.js} +1 -1
  18. package/dist/{vue-sonner-CBFYmm8_.js → index-CAfpg2Eg.js} +326 -256
  19. package/dist/index-CJXFGv-u.js +188 -0
  20. package/dist/main-BnnUrWK-.js +6725 -0
  21. package/dist/merchant/src/api/template/index.d.ts +2 -2
  22. package/dist/merchant/src/app.d.ts +1 -1
  23. package/dist/merchant/src/components/inputs/ColorPicker.vue.d.ts +0 -1
  24. package/dist/merchant/src/composables/useNode/index.d.ts +1 -1
  25. package/dist/merchant/src/node-configs/branch-list/props.d.ts +0 -1
  26. package/dist/merchant/src/node-configs/button-list/props.d.ts +0 -1
  27. package/dist/merchant/src/node-configs/carousel/props.d.ts +0 -1
  28. package/dist/merchant/src/node-configs/container/props.d.ts +0 -28
  29. package/dist/merchant/src/node-configs/display-image/props.d.ts +0 -1
  30. package/dist/merchant/src/node-configs/display-text/props.d.ts +0 -1
  31. package/dist/merchant/src/node-configs/member-card/props.d.ts +0 -1
  32. package/dist/merchant/src/node-configs/mock-data.d.ts +1 -5
  33. package/dist/merchant/src/node-configs/order-history-card/props.d.ts +0 -1
  34. package/dist/merchant/src/node-configs/order-method/props.d.ts +0 -1
  35. package/dist/merchant/src/node-configs/props.d.ts +1 -9
  36. package/dist/merchant/src/node-configs/schema.d.ts +1 -9
  37. package/dist/merchant/src/stores/editor/index.d.ts +1 -1
  38. package/dist/merchant/src/stores/template/index.d.ts +9 -88
  39. package/dist/package.json +2 -5
  40. package/dist/style.css +1 -1
  41. package/package.json +2 -5
  42. package/dist/App-CWHXI9Wx.js +0 -109
  43. package/dist/BaDivider-Cp9gfB4r.js +0 -10
  44. package/dist/BuilderView-CczmL4SM.js +0 -9307
  45. package/dist/ColorPicker-CD7uePb_.js +0 -590
  46. package/dist/ProjectView-ww03hVq3.js +0 -602
  47. package/dist/StepperField-nyaUK9ht.js +0 -30
  48. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  49. package/dist/components/src/components/Member/MemberAchievements.vue.d.ts +0 -33
  50. package/dist/components/src/components/Member/MemberButtonList.vue.d.ts +0 -21
  51. package/dist/components/src/components/Member/MemberCards.vue.d.ts +0 -19
  52. package/dist/components/src/components/Member/MemberSummary.vue.d.ts +0 -24
  53. package/dist/components/src/components/Member/TransactionList.vue.d.ts +0 -5
  54. package/dist/components/src/components/NavigationBar.vue.d.ts +0 -17
  55. package/dist/components/src/utils/date.d.ts +0 -22
  56. package/dist/components/src/views/_Credit.vue.d.ts +0 -20
  57. package/dist/components/src/views/_MemberProfile.vue.d.ts +0 -39
  58. package/dist/components/src/views/_Point.vue.d.ts +0 -20
  59. package/dist/components/src/views/_Referral.vue.d.ts +0 -31
  60. package/dist/components/src/views/_ReferralTutorial.vue.d.ts +0 -23
  61. package/dist/index-BAS2oeyj.js +0 -198
  62. package/dist/index-XrsRjG_o.js +0 -73
  63. package/dist/main-Cuvlrh4r.js +0 -7981
  64. package/dist/merchant/src/node-configs/member-achievements/mock-data.d.ts +0 -15
  65. package/dist/merchant/src/node-configs/member-achievements/props.d.ts +0 -40
  66. package/dist/merchant/src/node-configs/member-achievements/schema.d.ts +0 -2
  67. package/dist/merchant/src/node-configs/member-button-list/props.d.ts +0 -31
  68. package/dist/merchant/src/node-configs/member-button-list/schema.d.ts +0 -2
  69. package/dist/merchant/src/node-configs/member-cards/mock-data.d.ts +0 -3
  70. package/dist/merchant/src/node-configs/member-cards/props.d.ts +0 -24
  71. package/dist/merchant/src/node-configs/member-cards/schema.d.ts +0 -2
  72. package/dist/merchant/src/node-configs/member-history/mock-data.d.ts +0 -843
  73. package/dist/merchant/src/node-configs/member-history/props.d.ts +0 -1692
  74. package/dist/merchant/src/node-configs/member-history/schema.d.ts +0 -3
  75. package/dist/merchant/src/node-configs/member-profile/props.d.ts +0 -449
  76. package/dist/merchant/src/node-configs/member-profile/schema.d.ts +0 -2
  77. package/dist/merchant/src/node-configs/member-referral/props.d.ts +0 -98
  78. package/dist/merchant/src/node-configs/member-referral/schema.d.ts +0 -2
  79. package/dist/merchant/src/node-configs/member-referral-tutorial/props.d.ts +0 -8
  80. package/dist/merchant/src/node-configs/member-referral-tutorial/schema.d.ts +0 -2
  81. package/dist/merchant/src/node-configs/member-summary/mock-data.d.ts +0 -9
  82. package/dist/merchant/src/node-configs/member-summary/props.d.ts +0 -32
  83. package/dist/merchant/src/node-configs/member-summary/schema.d.ts +0 -2
  84. package/dist/merchant/src/views/ProjectView.vue.d.ts +0 -2
  85. package/dist/merchant/src/views/views.d.ts +0 -11
  86. package/dist/views-Dd4l-D61.js +0 -89
@@ -0,0 +1,22 @@
1
+ import { defineComponent as c, createElementBlock as l, openBlock as a, createElementVNode as r } from "vue";
2
+ const s = { class: "flex justify-between items-center gap-8" }, p = ["value"], _ = /* @__PURE__ */ c({
3
+ __name: "ColorPicker",
4
+ props: {
5
+ context: {}
6
+ },
7
+ setup(t) {
8
+ const n = t, o = (e) => {
9
+ n.context.node.input(e.target.value);
10
+ };
11
+ return (e, u) => (a(), l("label", s, [
12
+ r("input", {
13
+ type: "color",
14
+ value: e.context._value,
15
+ onInput: o
16
+ }, null, 40, p)
17
+ ]));
18
+ }
19
+ });
20
+ export {
21
+ _ as default
22
+ };
@@ -1,7 +1,7 @@
1
- import { defineComponent as y, ref as b, resolveComponent as w, createElementBlock as r, openBlock as s, createVNode as c, createCommentVNode as f, Fragment as C, createElementVNode as i, unref as u } from "vue";
2
- import { r as g, I as h } from "./image-CgXjWyqN.js";
1
+ import { defineComponent as y, ref as b, resolveComponent as w, createElementBlock as r, openBlock as s, createVNode as c, createCommentVNode as d, Fragment as C, createElementVNode as i, unref as u } from "vue";
2
+ import { r as g, I as h } from "./image-Dm7AsBZX.js";
3
3
  import { useCoreStore as I } from "@feedmepos/mf-common";
4
- import "./main-Cuvlrh4r.js";
4
+ import "./main-BnnUrWK-.js";
5
5
  import { _ as $ } from "./Icon.vue_vue_type_style_index_0_lang-BcRjQndc.js";
6
6
  import { C as k } from "./CircularProgress-DdblYCtV.js";
7
7
  import { v as F } from "./v4-CKwdnpQf.js";
@@ -14,32 +14,32 @@ const B = { class: "w-full h-[210px] relative" }, P = { class: "absolute z-[1] t
14
14
  context: {}
15
15
  },
16
16
  setup(_) {
17
- const e = _, a = I(), t = b(!1);
17
+ const e = _, l = I(), t = b(!1);
18
18
  async function v(o) {
19
19
  t.value = !0, await h.uploadImage(
20
- a.currentBusiness.value._id,
20
+ l.currentBusiness.value._id,
21
21
  `${F()}.${o.name.split(".").pop()}`,
22
22
  o
23
23
  ).then((m) => {
24
24
  var p;
25
- const l = `https://image.feedmedev.cc/business/${a.currentBusiness.value._id}/${m.imagePath}`;
26
- e.context.node.input(l);
25
+ const a = `https://image.feedme.cc/business/${l.currentBusiness.value._id}/${m.imagePath}`;
26
+ e.context.node.input(a);
27
27
  const n = new Image();
28
- (p = e.context) != null && p.ignoreUpdate || (n.onload = () => {
29
- var d;
30
- ((d = e.context.node.at("$root")) == null ? void 0 : d._value).containerStyles.height = `${Math.min(n.height, 400)}px`;
31
- }), n.src = g(l);
28
+ (p = e.context.attrs.props) != null && p.ignoreUpdate || (n.onload = () => {
29
+ var f;
30
+ ((f = e.context.node.at("$root")) == null ? void 0 : f._value).containerStyles.height = `${Math.min(n.height, 400)}px`;
31
+ }), n.src = g(a);
32
32
  }).finally(() => t.value = !1);
33
33
  }
34
34
  async function x() {
35
35
  t.value = !0;
36
36
  const o = e.context._value.split("/").pop();
37
- await h.deleteImage(a.currentBusiness.value._id, o).then(() => e.context.node.input("")).finally(() => t.value = !1);
37
+ await h.deleteImage(l.currentBusiness.value._id, o).then(() => e.context.node.input("")).finally(() => t.value = !1);
38
38
  }
39
39
  return (o, m) => {
40
- const l = w("FmDropField");
40
+ const a = w("FmDropField");
41
41
  return s(), r("div", B, [
42
- c(l, {
42
+ c(a, {
43
43
  class: "w-full h-full",
44
44
  onFileUpload: v
45
45
  }),
@@ -60,10 +60,10 @@ const B = { class: "w-full h-[210px] relative" }, P = { class: "absolute z-[1] t
60
60
  class: "!text-[16px] text-fm-color-typo-white"
61
61
  })
62
62
  ])
63
- ], 64)) : f("", !0),
63
+ ], 64)) : d("", !0),
64
64
  t.value ? (s(), r("div", z, [
65
65
  c(u(k))
66
- ])) : f("", !0)
66
+ ])) : d("", !0)
67
67
  ]);
68
68
  };
69
69
  }
@@ -1,35 +1,35 @@
1
- import { defineComponent as L, ref as f, computed as k, onBeforeMount as I, resolveComponent as c, createBlock as v, openBlock as u, withCtx as m, createElementVNode as o, createVNode as r, createElementBlock as x, Fragment as F, renderList as M, toDisplayString as P, withModifiers as R } from "vue";
2
- import { B as y } from "./BaDivider-Cp9gfB4r.js";
3
- import { _ as $ } from "./Icon.vue_vue_type_style_index_0_lang-BcRjQndc.js";
4
- import { u as j } from "./index-BAS2oeyj.js";
5
- import "@feedmepos/mf-common";
6
- const z = {
1
+ import { defineComponent as L, ref as f, computed as k, onBeforeMount as P, resolveComponent as c, createBlock as v, openBlock as p, withCtx as m, createElementVNode as o, createVNode as r, createElementBlock as x, Fragment as C, renderList as F, toDisplayString as I, withModifiers as R } from "vue";
2
+ import { u as $, B as y } from "./index-CJXFGv-u.js";
3
+ import { _ as j } from "./Icon.vue_vue_type_style_index_0_lang-BcRjQndc.js";
4
+ import { useCoreStore as z } from "@feedmepos/mf-common";
5
+ const A = {
7
6
  key: 1,
8
7
  type: "button",
9
8
  class: "min-w-[162px] py-[6px] px-8 flex justify-between items-center bg-fm-color-system-warning-100 rounded-lg"
10
- }, A = { class: "w-[113px] h-full fm-typo-en-body-md-600 text-fm-color-primary line-clamp-1" }, N = { class: "w-full flex flex-col gap-16" }, O = { class: "w-full flex gap-8 flex-wrap" }, W = { class: "w-full flex gap-8 flex-wrap" }, G = { class: "w-full flex items-center" }, H = { class: "w-full flex justify-end items-center gap-12" }, Y = /* @__PURE__ */ L({
9
+ }, G = { class: "w-[113px] h-full fm-typo-en-body-md-600 text-fm-color-primary line-clamp-1" }, H = { class: "w-full flex flex-col gap-16" }, N = { class: "w-full flex gap-8 flex-wrap" }, O = { class: "w-full flex gap-8 flex-wrap" }, W = { class: "w-full flex items-center" }, q = { class: "w-full flex justify-end items-center gap-12" }, Y = /* @__PURE__ */ L({
11
10
  __name: "LinkButton",
12
11
  props: {
13
12
  context: {}
14
13
  },
15
14
  setup(E) {
16
- const l = E, s = f(""), i = f(""), d = f(!1), h = j(), b = k(
17
- () => h.state.allTemplates.filter(
15
+ const l = E, s = f(""), i = f(""), d = f(!1);
16
+ z();
17
+ const b = $(), h = k(
18
+ () => b.state.allTemplates.filter(
18
19
  (t) => {
19
20
  var e;
20
- return t.templateId !== ((e = h.state.selectedTemplate) == null ? void 0 : e.templateId);
21
+ return t.templateId !== ((e = b.state.selectedTemplate) == null ? void 0 : e.templateId);
21
22
  }
22
23
  )
23
24
  ), _ = [
24
- { title: "Homepage", path: "" },
25
- { title: "Credits", path: "Member::credit" },
26
- { title: "Points", path: "Member::point" },
27
- { title: "Vouchers", path: "Member::vouchers" },
28
- { title: "Store", path: "Member::store" },
29
- { title: "Missions", path: "Member::mission" },
30
- { title: "Games", path: "Member::games" }
25
+ { title: "Homepage", path: "Member::Homepage" },
26
+ { title: "Credit", path: "Member::Credit" },
27
+ { title: "Points", path: "Member::Points" },
28
+ { title: "Voucher", path: "Member::Voucher" },
29
+ { title: "Game", path: "Member::Game" },
30
+ { title: "Store", path: "Member::Store" }
31
31
  ];
32
- function B() {
32
+ function M() {
33
33
  i.value ? l.context.node.input({
34
34
  path: i.value ? `https://${i.value}` : "",
35
35
  isExternal: !0
@@ -38,13 +38,13 @@ const z = {
38
38
  isExternal: !1
39
39
  }), d.value = !1;
40
40
  }
41
- function C() {
41
+ function V() {
42
42
  l.context.node.input({
43
43
  path: "",
44
44
  isExternal: !1
45
45
  });
46
46
  }
47
- function T(t) {
47
+ function B(t) {
48
48
  s.value = "", i.value = t;
49
49
  }
50
50
  function g(t) {
@@ -54,25 +54,25 @@ const z = {
54
54
  var t, e, n;
55
55
  (t = l.context._value) != null && t.isExternal ? (i.value = ((e = l.context._value) == null ? void 0 : e.path.replace("https://", "")) || "", s.value = "") : (s.value = ((n = l.context._value) == null ? void 0 : n.path) || "", i.value = "");
56
56
  }
57
- function V() {
57
+ function S() {
58
58
  d.value = !1, w();
59
59
  }
60
- const U = k(() => {
60
+ const T = k(() => {
61
61
  var t, e, n;
62
62
  if ((t = l.context._value) != null && t.isExternal)
63
63
  return l.context._value.path;
64
64
  if (l.context._value.path.startsWith("Template::"))
65
- return (e = b.value.find(
66
- (p) => p.templateId === l.context._value.path.split("::").pop()
65
+ return (e = h.value.find(
66
+ (u) => u.templateId === l.context._value.path.split("::").pop()
67
67
  )) == null ? void 0 : e.templateAlias;
68
68
  if (l.context._value.path.startsWith("Member::"))
69
- return (n = _.find((p) => p.path === l.context._value.path)) == null ? void 0 : n.title;
69
+ return (n = _.find((u) => u.path === l.context._value.path)) == null ? void 0 : n.title;
70
70
  });
71
- return I(() => {
71
+ return P(() => {
72
72
  w();
73
73
  }), (t, e) => {
74
- const n = c("FmButton"), p = c("FmRadio"), S = c("FmTextField"), D = c("FmDialog");
75
- return u(), v(D, {
74
+ const n = c("FmButton"), u = c("FmRadio"), U = c("FmTextField"), D = c("FmDialog");
75
+ return p(), v(D, {
76
76
  modelValue: d.value,
77
77
  "onUpdate:modelValue": e[0] || (e[0] = (a) => d.value = a),
78
78
  "min-width": 500
@@ -80,14 +80,14 @@ const z = {
80
80
  "dialog-button": m(() => {
81
81
  var a;
82
82
  return [
83
- (a = t.context._value) != null && a.path ? (u(), x("button", z, [
84
- o("p", A, P(U.value), 1),
85
- r($, {
83
+ (a = t.context._value) != null && a.path ? (p(), x("button", A, [
84
+ o("p", G, I(T.value), 1),
85
+ r(j, {
86
86
  name: "close",
87
87
  class: "text-[24px] text-fm-color-primary",
88
- onClick: R(C, ["stop"])
88
+ onClick: R(V, ["stop"])
89
89
  })
90
- ])) : (u(), v(n, {
90
+ ])) : (p(), v(n, {
91
91
  key: 0,
92
92
  variant: "secondary",
93
93
  "prepend-icon": "link",
@@ -101,29 +101,29 @@ const z = {
101
101
  o("div", null, "Link Destination", -1)
102
102
  ])),
103
103
  "dialog-footer": m(() => [
104
- o("div", H, [
104
+ o("div", q, [
105
105
  r(n, {
106
106
  type: "button",
107
107
  variant: "secondary",
108
108
  label: "Cancel",
109
109
  size: "md",
110
- onClick: V
110
+ onClick: S
111
111
  }),
112
112
  r(n, {
113
113
  type: "button",
114
114
  variant: "primary",
115
115
  label: "Save",
116
116
  size: "md",
117
- onClick: B
117
+ onClick: M
118
118
  })
119
119
  ])
120
120
  ]),
121
121
  default: m(() => [
122
- o("div", N, [
122
+ o("div", H, [
123
123
  e[4] || (e[4] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, " Member ", -1)),
124
124
  r(y),
125
- o("div", O, [
126
- (u(), x(F, null, M(_, (a) => r(p, {
125
+ o("div", N, [
126
+ (p(), x(C, null, F(_, (a) => r(u, {
127
127
  "model-value": s.value,
128
128
  "onUpdate:modelValue": g,
129
129
  rules: () => [],
@@ -133,8 +133,8 @@ const z = {
133
133
  ]),
134
134
  e[5] || (e[5] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, " Other template ", -1)),
135
135
  r(y),
136
- o("div", W, [
137
- (u(!0), x(F, null, M(b.value, (a) => (u(), v(p, {
136
+ o("div", O, [
137
+ (p(!0), x(C, null, F(h.value, (a) => (p(), v(u, {
138
138
  "model-value": s.value,
139
139
  "onUpdate:modelValue": g,
140
140
  rules: () => [],
@@ -144,12 +144,12 @@ const z = {
144
144
  ]),
145
145
  e[6] || (e[6] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, " External URL ", -1)),
146
146
  r(y),
147
- o("div", G, [
147
+ o("div", W, [
148
148
  e[3] || (e[3] = o("div", { class: "w-120 shrink-0" }, "Enter URL", -1)),
149
- r(S, {
149
+ r(U, {
150
150
  class: "w-full",
151
151
  "model-value": i.value,
152
- "onUpdate:modelValue": T
152
+ "onUpdate:modelValue": B
153
153
  }, {
154
154
  prepend: m(() => e[2] || (e[2] = [
155
155
  o("div", { class: "text-fm-color-typo-tertiary" }, "https://", -1)
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as b, resolveComponent as y, createBlock as s, openBlock as c, unref as u, withCtx as i, createElementBlock as m, Fragment as x, renderList as g, createElementVNode as p, createVNode as n, resolveDynamicComponent as F } from "vue";
2
- import { F as f } from "./app-B9Ng1g2b.js";
2
+ import { F as f } from "./app-BSofsfPH.js";
3
3
  const h = { class: "flex justify-end gap-4 items-center w-full py-16 px-12 border-b" }, z = { class: "flex flex-col gap-4 w-full p-12" }, I = /* @__PURE__ */ b({
4
4
  __name: "ListRepeater",
5
5
  props: {
@@ -1,9 +1,8 @@
1
- import { defineComponent as x, ref as b, computed as B, watch as j, resolveComponent as m, createElementBlock as w, openBlock as p, createElementVNode as r, createVNode as c, createBlock as z, unref as l, withCtx as S, toDisplayString as $ } from "vue";
2
- import { useCoreStore as F } from "@feedmepos/mf-common";
3
- import { B as g } from "./index-XrsRjG_o.js";
4
- import { K as P } from "./vue-sonner-CBFYmm8_.js";
5
- import { r as U, I as V } from "./image-CgXjWyqN.js";
6
- const q = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), C = [
1
+ import { defineComponent as j, ref as w, computed as z, watch as $, resolveComponent as m, createElementBlock as y, openBlock as p, createElementVNode as r, createVNode as l, createBlock as S, unref as o, withCtx as F, toDisplayString as C } from "vue";
2
+ import { useCoreStore as P } from "@feedmepos/mf-common";
3
+ import { K as k, B as g } from "./index-CAfpg2Eg.js";
4
+ import { r as U, I as V } from "./image-Dm7AsBZX.js";
5
+ const q = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), A = [
7
6
  "brand",
8
7
  "home",
9
8
  "app",
@@ -501,18 +500,18 @@ const q = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), C = [
501
500
  "za",
502
501
  "zm",
503
502
  "zw"
504
- ], A = { class: "w-full flex flex-col gap-40" }, I = { class: "flex flex-col gap-24" }, R = { class: "w-full flex items-center justify-between h-[36px]" }, T = { class: "w-full flex gap-32" }, E = { class: "relative shrink-0 h-[100px] w-[100px]" }, L = ["src"], D = { class: "absolute -top-8 -right-8 rounded-full h-32 w-32 border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white flex justify-center items-center" }, K = { class: "w-full flex flex-col gap-24 max-w-[400px]" }, M = { class: "text-fm-color-typo-secondary" }, W = /* @__PURE__ */ x({
503
+ ], I = { class: "w-full flex flex-col gap-40" }, L = { class: "flex flex-col gap-24" }, T = { class: "w-full flex items-center justify-between h-[36px]" }, E = { class: "w-full flex gap-32" }, R = { class: "relative shrink-0 h-[100px] w-[100px]" }, D = ["src"], K = { class: "absolute -top-8 -right-8 rounded-full h-32 w-32 border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white flex justify-center items-center" }, M = { class: "w-full flex flex-col gap-24 max-w-[400px]" }, N = { class: "text-fm-color-typo-secondary" }, W = /* @__PURE__ */ j({
505
504
  __name: "ManagementSettings",
506
- setup(N) {
507
- const s = F(), d = b(!0), a = b({
505
+ setup(O) {
506
+ const s = P(), d = w(!0), a = w({
508
507
  name: "",
509
508
  url: "",
510
509
  thumbnail: ""
511
- }), y = B(
512
- () => "https://{slug}.feedmedev.vip".replace("https://{slug}", "")
510
+ }), h = z(
511
+ () => "https://{slug}.feedme.vip".replace("https://{slug}", "")
513
512
  );
514
- function k() {
515
- P.promise(
513
+ function _() {
514
+ k.promise(
516
515
  g.setShortUrl(
517
516
  a.value.url,
518
517
  s.currentBusiness.value.url ?? "",
@@ -537,23 +536,36 @@ const q = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), C = [
537
536
  }
538
537
  );
539
538
  }
540
- function _(t) {
541
- var i, o;
542
- const e = ((i = t.dataTransfer) == null ? void 0 : i.files[0]) ?? ((o = t.target) == null ? void 0 : o.files[0]);
539
+ function x(t) {
540
+ var i, u;
541
+ const e = ((i = t.dataTransfer) == null ? void 0 : i.files[0]) ?? ((u = t.target) == null ? void 0 : u.files[0]);
543
542
  V.uploadImage(
544
543
  s.currentBusiness.value._id,
545
544
  `thumbnail/${(/* @__PURE__ */ new Date()).toISOString()}.${e.name.split(".").pop()}`,
546
545
  e
547
- ).then(async (u) => {
546
+ ).then(async (c) => {
548
547
  await g.updateBusinessProfile(s.currentBusiness.value._id, {
549
548
  name: a.value.name,
550
549
  url: a.value.url,
551
- thumbnail: `https://image.feedmedev.cc/business/${s.currentBusiness.value._id}/${u.imagePath}`,
550
+ thumbnail: `https://image.feedme.cc/business/${s.currentBusiness.value._id}/${c.imagePath}`,
552
551
  coverPhoto: s.currentBusiness.value.coverPhoto
553
- }), a.value.thumbnail = `https://image.feedmedev.cc/business/${s.currentBusiness.value._id}/${u.imagePath}`;
552
+ }), a.value.thumbnail = `https://image.feedme.cc/business/${s.currentBusiness.value._id}/${c.imagePath}`;
554
553
  });
555
554
  }
556
- return j(
555
+ function B() {
556
+ var t, e;
557
+ k.promise(
558
+ navigator.clipboard.writeText(
559
+ `${((t = s.currentBusiness.value) == null ? void 0 : t.url) ?? ((e = s.currentBusiness.value) == null ? void 0 : e._id)}${h.value}`
560
+ ),
561
+ {
562
+ loading: "Copying...",
563
+ success: () => "Link copied",
564
+ error: () => "Error copying link, please try again"
565
+ }
566
+ );
567
+ }
568
+ return $(
557
569
  () => s.currentBusiness.value,
558
570
  () => {
559
571
  var t, e, i;
@@ -561,37 +573,37 @@ const q = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), C = [
561
573
  },
562
574
  { immediate: !0 }
563
575
  ), (t, e) => {
564
- var f, v;
565
- const i = m("FmButton"), o = m("FmAvatar"), u = m("FmIcon"), h = m("FmTextField");
566
- return p(), w("div", A, [
567
- r("div", I, [
568
- r("div", R, [
576
+ var v, b;
577
+ const i = m("FmButton"), u = m("FmAvatar"), c = m("FmIcon"), f = m("FmTextField");
578
+ return p(), y("div", I, [
579
+ r("div", L, [
580
+ r("div", T, [
569
581
  e[4] || (e[4] = r("h2", { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Business details ", -1)),
570
- c(i, {
582
+ l(i, {
571
583
  disabled: d.value,
572
584
  label: "Save",
573
- onClick: k
585
+ onClick: _
574
586
  }, null, 8, ["disabled"])
575
587
  ]),
576
- r("div", T, [
577
- r("div", E, [
578
- a.value.thumbnail ? (p(), w("img", {
588
+ r("div", E, [
589
+ r("div", R, [
590
+ a.value.thumbnail ? (p(), y("img", {
579
591
  key: 0,
580
592
  class: "h-full w-full rounded-full",
581
- src: l(U)(a.value.thumbnail)
582
- }, null, 8, L)) : (p(), z(o, {
593
+ src: o(U)(a.value.thumbnail)
594
+ }, null, 8, D)) : (p(), S(u, {
583
595
  key: 1,
584
- name: ((f = l(s).currentBusiness.value) == null ? void 0 : f.name) ?? "",
596
+ name: ((v = o(s).currentBusiness.value) == null ? void 0 : v.name) ?? "",
585
597
  class: "h-full w-full !fm-typo-en-title-md-600 bg-fm-color-primary-oats text-fm-color-primary"
586
598
  }, null, 8, ["name"])),
587
- r("button", D, [
599
+ r("button", K, [
588
600
  r("input", {
589
601
  class: "absolute top-0 left-0 h-32 w-32 opacity-0 cursor-pointer",
590
602
  type: "file",
591
603
  accept: "image/*",
592
- onChange: _
604
+ onChange: x
593
605
  }, null, 32),
594
- c(u, {
606
+ l(c, {
595
607
  size: "md",
596
608
  name: "edit",
597
609
  color: "neutral-black",
@@ -599,8 +611,8 @@ const q = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), C = [
599
611
  })
600
612
  ])
601
613
  ]),
602
- r("div", K, [
603
- c(h, {
614
+ r("div", M, [
615
+ l(f, {
604
616
  class: "w-full",
605
617
  label: "Business name",
606
618
  modelValue: a.value.name,
@@ -609,22 +621,27 @@ const q = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), C = [
609
621
  e[1] || (e[1] = (n) => d.value = !1)
610
622
  ]
611
623
  }, null, 8, ["modelValue"]),
612
- c(h, {
624
+ l(f, {
613
625
  class: "w-full",
614
626
  label: "URL",
615
- placeholder: (v = l(s).currentBusiness.value) == null ? void 0 : v._id,
627
+ placeholder: (b = o(s).currentBusiness.value) == null ? void 0 : b._id,
616
628
  modelValue: a.value.url,
617
629
  "onUpdate:modelValue": [
618
630
  e[2] || (e[2] = (n) => a.value.url = n),
619
631
  e[3] || (e[3] = (n) => d.value = !1)
620
632
  ],
621
633
  rules: [
622
- (n) => !n || l(q).test(n) || "Min 6 characters, alphanumeric only",
623
- (n) => !n || !l(C).includes(n) || "Business URL is reserved"
634
+ (n) => !n || o(q).test(n) || "Min 6 characters, alphanumeric only",
635
+ (n) => !n || !o(A).includes(n) || "Business URL is reserved"
624
636
  ]
625
637
  }, {
626
- append: S(() => [
627
- r("span", M, $(y.value), 1)
638
+ append: F(() => [
639
+ r("span", N, C(h.value), 1),
640
+ l(i, {
641
+ icon: "content_copy",
642
+ variant: "plain",
643
+ onClick: B
644
+ })
628
645
  ]),
629
646
  _: 1
630
647
  }, 8, ["placeholder", "modelValue", "rules"])
@@ -0,0 +1,29 @@
1
+ import { defineComponent as l, computed as c, resolveComponent as d, createBlock as s, openBlock as u } from "vue";
2
+ const m = /* @__PURE__ */ l({
3
+ __name: "StepperField",
4
+ props: {
5
+ context: {}
6
+ },
7
+ setup(n) {
8
+ const e = n;
9
+ function o(t) {
10
+ e.context.node.input(`${t}${e.context.suffix}`);
11
+ }
12
+ const p = c(() => +e.context._value.replace(e.context.suffix, ""));
13
+ return (t, i) => {
14
+ const a = d("FmStepperField");
15
+ return u(), s(a, {
16
+ class: "max-w-[160px]",
17
+ "model-value": p.value,
18
+ disabled: t.context.disabled ?? !1,
19
+ "onUpdate:modelValue": o,
20
+ "append-text": t.context.suffix,
21
+ step: 1,
22
+ "max-fraction-digits": 0
23
+ }, null, 8, ["model-value", "disabled", "append-text"]);
24
+ };
25
+ }
26
+ });
27
+ export {
28
+ m as default
29
+ };