@billgangcom/theme-lib 1.116.5 → 1.116.7
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.
- package/dist/{builder-C6g3vXyo.js → builder-CZXu5Hac.js} +5 -5
- package/dist/{builder-LBW2ELoj.cjs → builder-DjAWZsWX.cjs} +2 -2
- package/dist/{builder-components-BVKawcSj.cjs → builder-components-Cs3Kd5Fp.cjs} +1 -1
- package/dist/{builder-components-r7I-amdD.js → builder-components-DYJCevXV.js} +4 -4
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +22 -22
- package/dist/{charge-C6i1VdB0.js → charge-BO33PRmH.js} +5324 -5310
- package/dist/{charge-CjfcvimL.cjs → charge-CbGV61dW.cjs} +32 -32
- package/dist/{checkout-c8Dm3ltt.js → checkout-BHws_JKB.js} +5 -5
- package/dist/{checkout-C3aORSEb.cjs → checkout-BMr1ltyW.cjs} +1 -1
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-Csb_Ci8D.cjs → index-BpETNor-.cjs} +1 -1
- package/dist/{index-XV993uEE.js → index-C23sLqTE.js} +5 -5
- package/dist/{index-oDn2Xd5X.js → index-CmFApHUc.js} +5 -5
- package/dist/{index-BPisZB_H.cjs → index-D0GkszCa.cjs} +1 -1
- package/dist/{index-D3WqvNrb.cjs → index-D9Pj1vKe.cjs} +1 -1
- package/dist/{index-lHZ-FG-g.js → index-DOlYOPkO.js} +5 -5
- package/dist/{index-CRkzlVDF.cjs → index-DTWBap2Z.cjs} +1 -1
- package/dist/{index-3fPSHa2Y.js → index-DVr6y1N6.js} +5 -5
- package/dist/{index-O114ObDK.js → index-_p2-YMlC.js} +1 -1
- package/dist/{index-Bh4sBDyQ.cjs → index-jWgMpgga.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/order-BWjIxR9H.cjs +1 -0
- package/dist/order-CRherMAs.js +356 -0
- package/dist/src/storefront/components/VouchCard/index.d.ts +1 -1
- package/dist/src/storefront/models/order.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{subscription-B_flaKTe.cjs → subscription-BXxBl9fr.cjs} +1 -1
- package/dist/{subscription-649kvNLJ.js → subscription-NWrEJGZq.js} +5 -5
- package/dist/{ticket-DptH_ZLs.cjs → ticket-CC5fRwuL.cjs} +1 -1
- package/dist/{ticket-hFhJEdPz.js → ticket-L3tJ9ftw.js} +5 -5
- package/dist/{top-up-rjvD5Qd7.cjs → top-up-9EYY5Qos.cjs} +1 -1
- package/dist/{top-up-t7i03NHN.js → top-up-Dby7Plbm.js} +5 -5
- package/dist/{ui-components-DryNgQZR.js → ui-components-C1eixdPN.js} +4 -4
- package/dist/{ui-components-g-YTfuB-.cjs → ui-components-xoMojTNf.cjs} +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-BVZqVVUM.cjs → validation-B8Rt08hM.cjs} +1 -1
- package/dist/{validation-CTwdggxW.js → validation-Dj02XiYC.js} +5 -5
- package/package.json +1 -1
- package/dist/order-BqHrmCOU.cjs +0 -1
- package/dist/order-Jw5qRRMw.js +0 -356
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as j } from "react/jsx-runtime";
|
|
2
|
-
import { u as D, C as N, a as x } from "./charge-
|
|
3
|
-
import { V as A, p as G } from "./builder-
|
|
2
|
+
import { u as D, C as N, a as x } from "./charge-BO33PRmH.js";
|
|
3
|
+
import { V as A, p as G } from "./builder-CZXu5Hac.js";
|
|
4
4
|
import c from "react";
|
|
5
|
-
import { e as P } from "./ui-components-
|
|
6
|
-
import "./builder-components-
|
|
7
|
-
import "./ticket-
|
|
5
|
+
import { e as P } from "./ui-components-C1eixdPN.js";
|
|
6
|
+
import "./builder-components-DYJCevXV.js";
|
|
7
|
+
import "./ticket-L3tJ9ftw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const S = "_checkoutContainer_thje1_1", b = "_loaderContainer_thje1_20", s = {
|
|
10
10
|
checkoutContainer: S,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./charge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./charge-CbGV61dW.cjs"),u=require("./builder-DjAWZsWX.cjs"),l=require("react"),_=require("./ui-components-xoMojTNf.cjs");require("./builder-components-Cs3Kd5Fp.cjs");require("./ticket-CC5fRwuL.cjs");require("react-dom");const b="_checkoutContainer_thje1_1",S="_loaderContainer_thje1_20",s={checkoutContainer:b,loaderContainer:S},D=()=>{const{isAntistock:r}=u.useGeneralStore(),{cart:t,products:c,pending:d,getTotalAndDiscount:C,getPossibleGateways:h,submitCart:p,setGateway:m,applyCoupon:g,setDiscordSocialConnectId:j,setCustomFields:k,applyCouponPending:y,coupon:i,removeCoupon:q,getDiscordSettings:v,setPaymentMethod:x,reset:f}=n.useCart(),a=l.useMemo(()=>C(),[i,t]),o=u.useNavigate();return l.useEffect(()=>{if(t.parts.length===0){if(r){o("/");return}try{o(-1)}catch{o("/")}}},[t.parts]),d?e.jsx("div",{className:s.checkoutContainer,children:e.jsx("div",{className:s.loaderContainer,children:e.jsx(_.Loader,{})})}):e.jsxs("div",{className:s.checkoutContainer,children:[e.jsx(n.CheckoutItems,{cart:t,products:c,applyCoupon:g,applyCouponPending:y,coupon:i,removeCoupon:q,totalAndDiscount:a}),e.jsx(n.CheckoutOperational,{cart:t,getPossibleGateways:h,setGateway:m,getDiscordSettings:v,products:c,submitCart:p,totalAndDiscount:a,setCustomFieldsToCart:k,setDiscordSocialConnectId:j,setPaymentMethod:x,reset:f,isAntistock:r})]})};exports.Checkout=D;
|
package/dist/exports.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const o=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const o=require("./builder-DjAWZsWX.cjs");require("./ui-components-xoMojTNf.cjs");require("./builder-components-Cs3Kd5Fp.cjs");const t=require("./charge-CbGV61dW.cjs"),e=require("./ticket-CC5fRwuL.cjs"),r=require("./checkout-BMr1ltyW.cjs");require("react-dom");exports.AntistockRoutes=o.AntistockRoutes;exports.Routes=o.Routes;exports.formatPrice=o.formatPrice;exports.MarkdownText=t.MarkdownText;exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.parseDraftJsText=t.parseDraftJsText;exports.useCart=t.useCart;exports.useGeneralInfo=t.useGeneralInfo;exports.useMarkdownIt=t.useMarkdownIt;exports.useReCaptcha=t.useReCaptcha;exports.ColorVariables=e.ColorVariables;exports.aspectRatioOptions=e.aspectRatioOptions;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.removeNotification=e.removeNotification;exports.showNotification=e.showNotification;exports.splitTextIntoSpans=e.splitTextIntoSpans;exports.useAdaptiveStyles=e.useAdaptiveStyles;exports.useBalance=e.useBalance;exports.useBuilderPages=e.useBuilderPages;exports.useCreateTicket=e.useCreateTicket;exports.Checkout=r.Checkout;
|
package/dist/exports.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Y as p, Z as u, _ as c } from "./builder-
|
|
4
|
-
import "./ui-components-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import { M as n, R as f, I as l, u as d, H as x, J as C, G as R } from "./charge-
|
|
7
|
-
import { C as k, c as I, h as T, i as v, r as w, d as M, s as N, u as P, e as b, b as A, a as B } from "./ticket-
|
|
8
|
-
import { Checkout as J } from "./checkout-
|
|
3
|
+
import { Y as p, Z as u, _ as c } from "./builder-CZXu5Hac.js";
|
|
4
|
+
import "./ui-components-C1eixdPN.js";
|
|
5
|
+
import "./builder-components-DYJCevXV.js";
|
|
6
|
+
import { M as n, R as f, I as l, u as d, H as x, J as C, G as R } from "./charge-BO33PRmH.js";
|
|
7
|
+
import { C as k, c as I, h as T, i as v, r as w, d as M, s as N, u as P, e as b, b as A, a as B } from "./ticket-L3tJ9ftw.js";
|
|
8
|
+
import { Checkout as J } from "./checkout-BHws_JKB.js";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
export {
|
|
11
11
|
p as AntistockRoutes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),P=require("./charge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),P=require("./charge-CbGV61dW.cjs"),t=require("./builder-DjAWZsWX.cjs"),J=require("./ticket-CC5fRwuL.cjs"),g=require("./ui-components-xoMojTNf.cjs");require("./builder-components-Cs3Kd5Fp.cjs");require("react-dom");const _="_notifications_1ntnm_1",F="_wrapper_1ntnm_12",j={notifications:_,wrapper:F},z=()=>(i.useEffect(()=>{document.title="Temporarily Unavailable"},[]),s.jsx("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden",background:"var(--surface-primary)",color:"var(--text-primary)"},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1",justifyContent:"center",alignItems:"center",gap:"24px"},children:[s.jsx("h2",{style:{color:"var(--text-primary)",fontSize:"var(--font-heading-h2-size)"},children:"Temporarily Unavailable"}),s.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"var(--font-heading-h3-size)",width:"85%",textAlign:"center"},children:"We're making some quick updates to improve your shopping experience. During this time, browsing and checkout are temporarily unavailable."})]})}));function R(){const c=new URLSearchParams(document.location.search),n=c.get("customerAccessToken"),{setToken:d}=t.useStorefrontStore.getState(),{setDashInfo:u}=t.useCustomerDashboardStore.getState();n&&(c.delete("customerAccessToken"),localStorage.setItem("token",n),d(n),u(null))}const U=({children:c})=>{const n=t.useLocation(),{token:d,setToken:u}=t.useStorefrontStore(),{dashInfo:S,setDashInfo:y}=t.useCustomerDashboardStore(),{shopPassword:f}=t.useStorefrontStore(),v=t.useNavigate(),[l,b]=t.useSearchParams(),{notifications:x}=t.useNotificationStore(),[T,h]=i.useState(!0),{setCustomerEmail:I}=t.useCartStore(),{setThemeSettings:w,themeSettings:N}=t.useThemeSettingsStore(),{settings:C,setSettings:k}=t.useSettingsStore(),{setHeader:D,setFooter:q,setAnnouncement:A}=t.useLayersStore(),{general:o,setGeneral:E,isAntistock:p}=t.useGeneralStore(),{pageContext:L,setPageContext:O}=t.usePagesStore();t.useTrackingAnalytics((o==null?void 0:o.info.id)||localStorage.getItem("shopId")||null,"production",p);const W=async()=>{const e=await J.getDynamicPage(encodeURIComponent("/products"),o==null?void 0:o.info.passwordProtected);if(e){const{data:a}=e;O({...L,listings:a.listings})}};return i.useEffect(()=>{R()},[]),i.useEffect(()=>{const e=localStorage.getItem("token");if(e&&(!d||!S))try{const a=t.jwtDecode(e);y(a),u(e),I(a.email)}catch(a){console.error("Failed to decode token:",a),localStorage.removeItem("token"),u(""),y(null)}},[d,S]),i.useEffect(()=>{const e=l.get("r");e&&(localStorage.setItem("referralCode",e),l.delete("r"),b(l),v({pathname:n.pathname,search:l.toString()},{replace:!0}))},[l,n]),i.useEffect(()=>{!n.pathname.startsWith("/products")&&!n.pathname.startsWith("/admin/builder")&&o&&(o.info.passwordProtected&&f||o.isPasswordValid)&&W()},[o,f]),i.useLayoutEffect(()=>{const e=async()=>{if(h(!0),!o){const r=await P.fetchGeneral(f);if(!r.isPasswordValid&&!n.pathname.includes("/admin/builder")){v("/validation",{state:{from:n.pathname}});return}if(!r.info.passwordProtected){localStorage.removeItem("shopPassword");const{setShopPassword:m}=t.useStorefrontStore.getState();m("")}E(r)}},a=async()=>{h(!0);const{settings:r,theme:m}=(await P.fetchThemeAndSettings()).data;r?(r.settings&&k(r.settings),r.header&&D(JSON.parse(JSON.stringify(r.header))),r.footer&&q(JSON.parse(JSON.stringify(r.footer))),r.announcement&&A(JSON.parse(JSON.stringify(r.announcement)))):k(C),w(m||N),h(!1)};n.pathname.startsWith("/validation")||e(),a()},[]),p&&(o!=null&&o.info.onHold)?s.jsx(z,{}):n.pathname.startsWith("/admin/builder")?s.jsx(s.Fragment,{children:c}):s.jsx(s.Fragment,{children:T?s.jsx("div",{className:j.wrapper,children:s.jsx(g.Loader,{})}):s.jsxs(s.Fragment,{children:[c,x.length>0&&s.jsx("div",{className:j.notifications,children:x.map(e=>s.jsx(g.NotificationBuilder,{type:e.status,message:e.message,timer:e.timer||10,id:e.id,element:p?g.NotificationAntistock:e.component,label:e.label},e.id))})]})})};exports.WrapperPage=U;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { B as m, a as w, C as _ } from "./ui-components-
|
|
2
|
+
import { B as m, a as w, C as _ } from "./ui-components-C1eixdPN.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { j as I, r as b, s as j, b as v, J as P, k as T, u as k } from "./builder-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import "./charge-
|
|
7
|
-
import "./ticket-
|
|
4
|
+
import { j as I, r as b, s as j, b as v, J as P, k as T, u as k } from "./builder-CZXu5Hac.js";
|
|
5
|
+
import "./builder-components-DYJCevXV.js";
|
|
6
|
+
import "./charge-BO33PRmH.js";
|
|
7
|
+
import "./ticket-L3tJ9ftw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const C = "_wrapper_1yd2j_1", A = "_error_1yd2j_11", N = "_title_1yd2j_21", B = "_buttons_1yd2j_29", i = {
|
|
10
10
|
wrapper: C,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o, jsxs as N, Fragment as g } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { X as z, $ as U } from "./charge-
|
|
4
|
-
import { M as f, N as T, ab as F, p as G, a6 as R, e as V, O as H, m as M, a as X, u as q, V as B, b as Y, al as $, ag as K } from "./builder-
|
|
5
|
-
import { g as Q } from "./ticket-
|
|
6
|
-
import { e as Z, N as ee, p as te } from "./ui-components-
|
|
7
|
-
import "./builder-components-
|
|
3
|
+
import { X as z, $ as U } from "./charge-BO33PRmH.js";
|
|
4
|
+
import { M as f, N as T, ab as F, p as G, a6 as R, e as V, O as H, m as M, a as X, u as q, V as B, b as Y, al as $, ag as K } from "./builder-CZXu5Hac.js";
|
|
5
|
+
import { g as Q } from "./ticket-L3tJ9ftw.js";
|
|
6
|
+
import { e as Z, N as ee, p as te } from "./ui-components-C1eixdPN.js";
|
|
7
|
+
import "./builder-components-DYJCevXV.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const se = "_notifications_1ntnm_1", ae = "_wrapper_1ntnm_12", x = {
|
|
10
10
|
notifications: se,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("./builder-DjAWZsWX.cjs");const r=require("react"),t=require("./ui-components-xoMojTNf.cjs");require("./builder-components-Cs3Kd5Fp.cjs");require("./charge-CbGV61dW.cjs");require("./ticket-CC5fRwuL.cjs");require("react-dom");const i=()=>(r.useEffect(()=>{setTimeout(()=>{window.location.reload()},500)},[]),e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(t.Loader,{})}));exports.RouterErrorPage=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),e=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),e=require("./builder-DjAWZsWX.cjs"),o=require("react"),l=r=>{const{children:i}=r,{pathname:a}=e.useLocation(),{setActiveBlock:t}=e.useNavbarStore(),{setActiveBlock:s}=e.useThemeSettingsStore(),{setActiveBlock:n}=e.usePreviewStore();return o.useEffect(()=>{switch(n({id:null,neededScroll:!1}),a){case"/admin/builder":t(e.navbarBlocks[0]);break;case"/admin/builder/add":t(e.navbarBlocks[1]);break;case"/admin/builder/theme":t(e.navbarBlocks[2]);break;case"/admin/builder/settings":t(e.navbarBlocks[3]);break;case"/admin/builder/theme/colors":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[0]);break;case"/admin/builder/theme/fonts":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[1]);break;case"/admin/builder/theme/borders":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[2]);break;case"/admin/builder/theme/buttons":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[3]);break;case"/admin/builder/theme/inputs":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[4]);break}},[a]),c.jsx(c.Fragment,{children:i})};exports.ActivePage=l;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { g as i } from "./ui-components-
|
|
2
|
+
import { g as i } from "./ui-components-C1eixdPN.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { p as s, am as a } from "./builder-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import "./charge-
|
|
7
|
-
import "./ticket-
|
|
4
|
+
import { p as s, am as a } from "./builder-CZXu5Hac.js";
|
|
5
|
+
import "./builder-components-DYJCevXV.js";
|
|
6
|
+
import "./charge-BO33PRmH.js";
|
|
7
|
+
import "./ticket-L3tJ9ftw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const c = "_wrapper_ej209_1", m = "_content_ej209_12", p = "_title_ej209_22", r = {
|
|
10
10
|
wrapper: c,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./ui-components-xoMojTNf.cjs");require("react");const n=require("./builder-DjAWZsWX.cjs");require("./builder-components-Cs3Kd5Fp.cjs");require("./charge-CbGV61dW.cjs");require("./ticket-CC5fRwuL.cjs");require("react-dom");const s="_wrapper_ej209_1",c="_content_ej209_12",a="_title_ej209_22",r={wrapper:s,content:c,title:a},l=()=>{const o=n.useNavigate(),t=n.useRouteError();return console.error("ROUTE ERROR: ",t),alert(t),e.jsx("div",{className:r.wrapper,children:e.jsxs("div",{className:r.content,children:[e.jsx("h1",{className:r.title,children:"Something Went Wrong"}),e.jsx(i.Button,{type:"Primary",onClick:()=>{o("/")},children:"Go Home"})]})})};exports.DynamicErrorPage=l;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import "./builder-
|
|
2
|
+
import "./builder-CZXu5Hac.js";
|
|
3
3
|
import e from "react";
|
|
4
|
-
import { e as r } from "./ui-components-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import "./charge-
|
|
7
|
-
import "./ticket-
|
|
4
|
+
import { e as r } from "./ui-components-C1eixdPN.js";
|
|
5
|
+
import "./builder-components-DYJCevXV.js";
|
|
6
|
+
import "./charge-BO33PRmH.js";
|
|
7
|
+
import "./ticket-L3tJ9ftw.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const f = () => (e.useEffect(() => {
|
|
10
10
|
setTimeout(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, Fragment as m } from "react/jsx-runtime";
|
|
2
|
-
import { ab as d, o as l, m as b, i as u, q as t, z as s } from "./builder-
|
|
2
|
+
import { ab as d, o as l, m as b, i as u, q as t, z as s } from "./builder-CZXu5Hac.js";
|
|
3
3
|
import k from "react";
|
|
4
4
|
const B = (i) => {
|
|
5
5
|
const { children: c } = i, { pathname: r } = d(), { setActiveBlock: e } = l(), { setActiveBlock: a } = b(), { setActiveBlock: o } = u();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("./ui-components-xoMojTNf.cjs");require("react");const s=require("./builder-DjAWZsWX.cjs");require("./builder-components-Cs3Kd5Fp.cjs");require("./charge-CbGV61dW.cjs");require("./ticket-CC5fRwuL.cjs");require("react-dom");const j="_wrapper_1yd2j_1",w="_error_1yd2j_11",_="_title_1yd2j_21",b="_buttons_1yd2j_29",i={wrapper:j,error:w,title:_,buttons:b},S=async e=>{const o=localStorage.getItem("shopId")||void 0,r=localStorage.getItem("draftId"),d=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${o}/drafts/${r}/reset`;return await s.request({url:d,withToken:!0,method:"post",body:e})},x=()=>{const{error:e,setError:o}=s.useErrorStore(),{pages:r}=s.usePagesStore(),{setIsOpen:c}=s.useModalStore(),{title:d,description:m,setOnConfirm:u,setTitle:g,setDescription:p}=s.useConfirmationModalStore(),{setBlocks:h}=s.useLayersStore();async function y(){await S({resetSettings:(e==null?void 0:e.failedSettings)??!1,resetThemeSettings:(e==null?void 0:e.failedThemeSettings)??!1,resetPageIds:(e==null?void 0:e.failedPageIds)??[]}),o(null),h({}),window.location.reload()}async function f(){const a=[];r&&Object.keys(r).map(n=>r[n].id).filter(n=>n!==void 0).map(n=>a.push(n)),await S({resetSettings:!0,resetThemeSettings:!0,resetPageIds:a}),o(null)}return t.jsxs("div",{className:i.wrapper,children:[t.jsxs("div",{className:i.error,children:[t.jsxs("div",{children:[t.jsx("div",{className:i.title,children:"Oops! Something went wrong"}),t.jsx("span",{className:i.message,children:(e==null?void 0:e.message)||""})]}),t.jsxs("div",{className:i.buttons,children:[t.jsx(l.ButtonSettings,{type:"Primary",onClick:y,children:"Reset Settings"}),t.jsx(l.ButtonSettings,{type:"Secondary",onClick:a=>{a.stopPropagation(),g("Reset All Settings"),p("Are you sure you want to reset all settings? This is irreversible."),u(async()=>{await f()})},children:"Reset All Settings"})]})]}),d&&m&&t.jsx(l.BuilderModal,{close:()=>{c(!1),setTimeout(()=>{g(null),p(null),u(null),c(!0)},300)},children:t.jsx(l.ConfirmationModal,{})})]})};exports.ErrorPage=x;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./builder.cjs.js"),a=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./builder.cjs.js"),a=require("./builder-DjAWZsWX.cjs");require("react/jsx-runtime");const c=require("react"),t=require("./ui-components-xoMojTNf.cjs");require("./builder-components-Cs3Kd5Fp.cjs");const r=require("./charge-CbGV61dW.cjs"),e=require("./ticket-CC5fRwuL.cjs");require("react-dom");function u(o){c.useEffect(()=>{Object.entries(o).forEach(([s,i])=>{t.registerIcon(s,i)})},[o])}function g(o){Object.entries(o).forEach(([s,i])=>{t.registerIcon(s,i)})}exports.App=n.App;exports.AntistockRoutes=a.AntistockRoutes;exports.Routes=a.Routes;exports.formatPrice=a.formatPrice;exports.Icon=t.Icon;exports.getRegisteredIcon=t.getRegisteredIcon;exports.getRegisteredIcons=t.getRegisteredIcons;exports.isIconRegistered=t.isIconRegistered;exports.registerIcon=t.registerIcon;exports.MarkdownText=r.MarkdownText;exports.ReCaptchaProvider=r.ReCaptchaProvider;exports.parseDraftJsText=r.parseDraftJsText;exports.useCart=r.useCart;exports.useGeneralInfo=r.useGeneralInfo;exports.useMarkdownIt=r.useMarkdownIt;exports.useReCaptcha=r.useReCaptcha;exports.ColorVariables=e.ColorVariables;exports.aspectRatioOptions=e.aspectRatioOptions;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.removeNotification=e.removeNotification;exports.showNotification=e.showNotification;exports.splitTextIntoSpans=e.splitTextIntoSpans;exports.useAdaptiveStyles=e.useAdaptiveStyles;exports.useBalance=e.useBalance;exports.useBuilderPages=e.useBuilderPages;exports.useCreateTicket=e.useCreateTicket;exports.registerIcons=g;exports.useIconRegistration=u;
|
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { App as R } from "./builder.es.js";
|
|
2
|
-
import { Y as g, Z as l, _ as x } from "./builder-
|
|
2
|
+
import { Y as g, Z as l, _ as x } from "./builder-CZXu5Hac.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import { useEffect as o } from "react";
|
|
5
|
-
import { r as t } from "./ui-components-
|
|
6
|
-
import { I as C, l as b, n as k, m as T } from "./ui-components-
|
|
7
|
-
import "./builder-components-
|
|
8
|
-
import { M as w, R as A, I as E, u as M, H as N, J as O, G as P } from "./charge-
|
|
9
|
-
import { C as B, c as G, h as J, i as S, r as y, d as D, s as H, u as V, e as Y, b as Z, a as _ } from "./ticket-
|
|
5
|
+
import { r as t } from "./ui-components-C1eixdPN.js";
|
|
6
|
+
import { I as C, l as b, n as k, m as T } from "./ui-components-C1eixdPN.js";
|
|
7
|
+
import "./builder-components-DYJCevXV.js";
|
|
8
|
+
import { M as w, R as A, I as E, u as M, H as N, J as O, G as P } from "./charge-BO33PRmH.js";
|
|
9
|
+
import { C as B, c as G, h as J, i as S, r as y, d as D, s as H, u as V, e as Y, b as Z, a as _ } from "./ticket-L3tJ9ftw.js";
|
|
10
10
|
import "react-dom";
|
|
11
11
|
function f(e) {
|
|
12
12
|
o(() => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),i=require("react"),k=require("./builder-DjAWZsWX.cjs"),o=require("./charge-CbGV61dW.cjs"),_=require("./ui-components-xoMojTNf.cjs");require("./builder-components-Cs3Kd5Fp.cjs");require("./ticket-CC5fRwuL.cjs");require("react-dom");const z=async(n=1)=>await o.fetchOrders({PageNumber:n}),H=()=>{const[n,r]=i.useState(null),[d,e]=i.useState(null),[g,v]=i.useState(0),{page:y}=k.usePaginationPagesStore(),[C,u]=i.useState(!0);async function j(){u(!0);const{list:w,totalCount:l}=await z(y);r(w),v(l),e(null),u(!1)}async function m(){const w=(n==null?void 0:n.map(a=>a.gatewayName))||[],l=await o.getGatewaysDetail(w);e(l)}return i.useEffect(()=>{!d&&n&&m()},[n,d]),i.useEffect(()=>{j()},[y]),t.jsx(t.Fragment,{children:n!=null&&n.length&&n.length===0?t.jsx(o.NoItemsBlock,{title:"No Orders",description:"When you purchase products from our website, you'll see a history of orders here."}):t.jsxs(t.Fragment,{children:[t.jsx(o.PageTitle,{title:"Orders"}),t.jsx(o.OrdersTable,{orders:n,gatewaysDetail:d,totalCount:g,isLoading:C})]})})},J="_orderPage_gc87l_1",Y="_leftSection_gc87l_15",K="_content_gc87l_35",Q="_main_gc87l_42",X="_mainAntistock_gc87l_56",Z="_orderMainDataAntistock_gc87l_69",ee="_timelineBlockAntistock_gc87l_81",te="_footerAntistock_gc87l_92",se="_statusBlock_gc87l_104",ne="_timelineBlock_gc87l_81",oe="_footer_gc87l_92",ae="_rightSection_gc87l_121",ce="_header_gc87l_142",ie="_productList_gc87l_150",re="_mobileFooter_gc87l_157",le="_loaderContainer_gc87l_166",ue="_orderMainData_gc87l_69",de="_prices_gc87l_181",me="_headerTitle_gc87l_185",he="_headerDescription_gc87l_189",c={orderPage:J,leftSection:Y,content:K,main:Q,mainAntistock:X,orderMainDataAntistock:Z,timelineBlockAntistock:ee,footerAntistock:te,statusBlock:se,timelineBlock:ne,footer:oe,rightSection:ae,header:ce,productList:ie,mobileFooter:re,loaderContainer:le,orderMainData:ue,prices:de,headerTitle:me,headerDescription:he},fe="_modalContent_1a05n_1",pe="_iconContainer_1a05n_16",_e="_warningIcon_1a05n_20",ge="_title_1a05n_25",ye="_description_1a05n_33",we="_buttonContainer_1a05n_40",Se="_button_1a05n_40",h={modalContent:fe,iconContainer:pe,warningIcon:_e,title:ge,description:ye,buttonContainer:we,button:Se},xe=({isOpen:n,onClose:r,refundedAmount:d,currency:e})=>{var N,S;const g=k.useNavigate(),{token:v,shopDomain:y}=k.useStorefrontStore(),{isAntistock:C,general:u}=k.useGeneralStore(),j=!!((N=u==null?void 0:u.info)!=null&&N.disableSupport),m=(S=u==null?void 0:u.info)==null?void 0:S.thirdPartySupportUrl,w=!(j&&!m),l=new Intl.NumberFormat("en-US",{style:"currency",currency:e}),a=()=>{g(C?"/account":"/customer-dash")},D=async()=>{if(j&&m){window.open(m);return}C?window.open(`https://${y}/support`):g("/contact")},P=()=>{r()};return n?t.jsx(_.Modal,{close:r,children:t.jsxs("div",{className:h.modalContent,onClick:A=>A.stopPropagation(),children:[t.jsx("div",{className:h.iconContainer,children:t.jsx(_.Icon,{name:"WarningDiamond",fill:"var(--text-warning)",className:h.warningIcon})}),t.jsx("h2",{className:h.title,children:"Partial Delivery Failure Refund"}),t.jsxs("p",{className:h.description,children:["Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of"," ",l.format(d),", to your account balance."]}),t.jsxs("div",{className:h.buttonContainer,children:[!v&&t.jsx(_.Button,{type:"Secondary",onClick:a,className:h.button,children:"Login"}),w&&t.jsx(_.Button,{type:"Secondary",onClick:D,className:h.button,children:"Contact Support"}),t.jsx(_.Button,{type:"Primary",onClick:P,className:h.button,children:"Continue"})]})]})}):null},ke=()=>{var M,I,B,F,V,$,L,T,q;const{id:n,accessToken:r}=k.useParams(),d=k.useNavigate(),[e,g]=i.useState(),[v,y]=i.useState(!1),[C,u]=i.useState(!1),[j,m]=i.useState(!1),w=o.useCopy(),{isAntistock:l,general:a}=k.useGeneralStore(),D=((M=e==null?void 0:e.rawPrice)==null?void 0:M.currency)||"USD",P=new Intl.NumberFormat("en-US",{style:"currency",currency:D}),N=i.useMemo(()=>(e==null?void 0:e.partOrders.map(s=>{var b,O,x;return{id:Number((b=s.productWithVariant)==null?void 0:b.id)||0,partOrderId:Number(s==null?void 0:s.id)||0,image:s.productWithVariant.image,name:(()=>{var E,W;const f=((E=s.productWithVariant)==null?void 0:E.name)||"",p=((W=s.productWithVariant)==null?void 0:W.variantName)||"";return!f&&!p?"":!p||f===p?f:f?`${f} (${p})`:p})(),description:"",price:{quantity:s.quantity,amount:((O=s.productWithVariant)==null?void 0:O.price.amount)||0,currency:(x=s.productWithVariant)==null?void 0:x.price.currency},deliveryCategories:"deliveryCategories"in s?s.deliveryCategories:void 0,customerNote:s.customerNote,chargeType:s.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in s?s.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in s?s.allowedReplacementReasons:void 0}}))||[],[e]);i.useEffect(()=>{e&&(e.status===o.OrderStatus.FullDeliveryFailure||e.status===o.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&u(!0)},[e==null?void 0:e.status]);const S=i.useCallback(async(s,b,O=!1)=>{var f,p;O||y(!0);const{data:x}=await(b?o.fetchAuthorizedOrder(`${s}/${b}`):o.fetchOrder(s));y(!1),x.status!==o.OrderStatus.Completed&&((f=x.charge)==null?void 0:f.status)===o.ChargeStatus.NotPaid&&d(`/charges/${(p=x.charge)==null?void 0:p.id}`,{replace:!0}),g(x)},[d]);i.useLayoutEffect(()=>{if(n&&!r){const s=JSON.parse(localStorage.getItem("orders")||"{}");s[n]&&d(`/orders/${n}/${s[n].fullAccessToken}`)}},[n,r,d]),i.useEffect(()=>{n&&S(n,r,!0);const s=setInterval(()=>{n&&S(n,r,!0)},5e3);return()=>{clearInterval(s)}},[n,r,S]);const A=i.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===o.OrderStatus.Completed||e.status===o.OrderStatus.PartiallyDelivered||e.status===o.OrderStatus.FullDeliveryFailure)),[e]),R=i.useMemo(()=>{var s;return!!((s=a==null?void 0:a.info)!=null&&s.isVouchesEnabled&&r)},[(I=a==null?void 0:a.info)==null?void 0:I.isVouchesEnabled,r]),U=i.useMemo(()=>{var s;return!!(!((s=a==null?void 0:a.info)!=null&&s.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!l)},[(B=a==null?void 0:a.info)==null?void 0:B.isVouchesEnabled,e==null?void 0:e.review,l]),G=i.useMemo(()=>{var s;return((s=a==null?void 0:a.info)==null?void 0:s.domain)||window.location.hostname},[(F=a==null?void 0:a.info)==null?void 0:F.domain]);return v?t.jsx("div",{className:c.loaderContainer,children:t.jsx(_.Loader,{})}):t.jsxs("div",{className:c.orderPage,children:[t.jsx("div",{className:c.leftSection,children:t.jsxs("div",{className:c.content,children:[t.jsx(o.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${c.main} ${l?c.mainAntistock:""}`,children:[t.jsx(o.OrderStatusBlock,{className:c.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${c.orderMainData} ${l?c.orderMainDataAntistock:""}`,children:[R&&t.jsx(o.VouchCard,{onAddMessage:()=>m(!0),isVouchLeft:e.isVouchLeft}),t.jsx(o.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(V=e.charge)==null?void 0:V.gateway,email:e.customer?e.customer.email:(($=e.charge)==null?void 0:$.customerForCharge.email)||"",orderId:e.id}),U&&e.review&&t.jsx(o.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(o.TrackPayment,{className:`${c.timelineBlock} ${l?c.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(o.CheckoutFooter,{className:`${c.footer} ${l?c.footerAntistock:""}`})]})]})}),t.jsx("div",{className:c.rightSection,style:l?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:c.content,children:[((L=e==null?void 0:e.charge)==null?void 0:L.name)&&t.jsxs("header",{className:c.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:c.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:c.headerDescription,children:e.charge.description})]}),l?null:t.jsxs(_.Button,{type:"Secondary",onClick:()=>w((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(_.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:c.productList,children:N.map(s=>t.jsx(o.CheckoutProduct,{product:s,isOrder:!0,isApplicableForReplacement:A,orderId:n,accessToken:r,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},s.id))}),l?null:t.jsx(o.CheckoutPrices,{formatter:P,coupon:null,total:((T=e==null?void 0:e.endPrice)==null?void 0:T.amount)||0,discount:0,totalWithDiscount:((q=e==null?void 0:e.endPrice)==null?void 0:q.amount)||0,className:c.prices,isShowSubtotal:!1}),t.jsx(o.CheckoutFooter,{className:c.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(xe,{isOpen:C,onClose:()=>u(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),R&&t.jsx(o.VouchModal,{isOpen:j,onClose:()=>m(!1),products:N,orderId:n,accessToken:r,shopDomain:G,onSuccess:()=>{m(!1),n&&S(n,r,!0)}})]})},Ce=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:ke},Symbol.toStringTag,{value:"Module"}));exports.Orders=H;exports.index=Ce;
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { jsx as o, Fragment as G, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import r, { useState as Q, useMemo as O } from "react";
|
|
3
|
+
import { X as Z, p as H, M as ee, V as J, a7 as te } from "./builder-CZXu5Hac.js";
|
|
4
|
+
import { f as oe, N as ne, P as ae, O as se, g as ce, b as ie, c as C, d as re, e as le, h as ue, i as de, j as me, V as he, k as pe, L as fe, T as _e, l as z, m as ge, n as ye, o as we } from "./charge-BO33PRmH.js";
|
|
5
|
+
import { M as ke, I as X, g as A, e as Se } from "./ui-components-C1eixdPN.js";
|
|
6
|
+
import "./builder-components-DYJCevXV.js";
|
|
7
|
+
import "./ticket-L3tJ9ftw.js";
|
|
8
|
+
import "react-dom";
|
|
9
|
+
const ve = async (n = 1) => await oe({ PageNumber: n }), ct = () => {
|
|
10
|
+
const [n, c] = r.useState(null), [d, e] = Q(null), [_, N] = r.useState(0), { page: g } = Z(), [S, u] = r.useState(!0);
|
|
11
|
+
async function v() {
|
|
12
|
+
u(!0);
|
|
13
|
+
const { list: y, totalCount: i } = await ve(g);
|
|
14
|
+
c(y), N(i), e(null), u(!1);
|
|
15
|
+
}
|
|
16
|
+
async function m() {
|
|
17
|
+
const y = (n == null ? void 0 : n.map((a) => a.gatewayName)) || [], i = await ce(y);
|
|
18
|
+
e(i);
|
|
19
|
+
}
|
|
20
|
+
return r.useEffect(() => {
|
|
21
|
+
!d && n && m();
|
|
22
|
+
}, [n, d]), r.useEffect(() => {
|
|
23
|
+
v();
|
|
24
|
+
}, [g]), /* @__PURE__ */ o(G, { children: n != null && n.length && n.length === 0 ? /* @__PURE__ */ o(
|
|
25
|
+
ne,
|
|
26
|
+
{
|
|
27
|
+
title: "No Orders",
|
|
28
|
+
description: "When you purchase products from our website, you'll see a history of orders here."
|
|
29
|
+
}
|
|
30
|
+
) : /* @__PURE__ */ l(G, { children: [
|
|
31
|
+
/* @__PURE__ */ o(ae, { title: "Orders" }),
|
|
32
|
+
/* @__PURE__ */ o(
|
|
33
|
+
se,
|
|
34
|
+
{
|
|
35
|
+
orders: n,
|
|
36
|
+
gatewaysDetail: d,
|
|
37
|
+
totalCount: _,
|
|
38
|
+
isLoading: S
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }) });
|
|
42
|
+
}, Ce = "_orderPage_gc87l_1", Ne = "_leftSection_gc87l_15", be = "_content_gc87l_35", Pe = "_main_gc87l_42", De = "_mainAntistock_gc87l_56", Oe = "_orderMainDataAntistock_gc87l_69", Ae = "_timelineBlockAntistock_gc87l_81", Re = "_footerAntistock_gc87l_92", Me = "_statusBlock_gc87l_104", Ie = "_timelineBlock_gc87l_81", Ve = "_footer_gc87l_92", Be = "_rightSection_gc87l_121", Le = "_header_gc87l_142", $e = "_productList_gc87l_150", Fe = "_mobileFooter_gc87l_157", Te = "_loaderContainer_gc87l_166", Ee = "_orderMainData_gc87l_69", We = "_prices_gc87l_181", xe = "_headerTitle_gc87l_185", qe = "_headerDescription_gc87l_189", s = {
|
|
43
|
+
orderPage: Ce,
|
|
44
|
+
leftSection: Ne,
|
|
45
|
+
content: be,
|
|
46
|
+
main: Pe,
|
|
47
|
+
mainAntistock: De,
|
|
48
|
+
orderMainDataAntistock: Oe,
|
|
49
|
+
timelineBlockAntistock: Ae,
|
|
50
|
+
footerAntistock: Re,
|
|
51
|
+
statusBlock: Me,
|
|
52
|
+
timelineBlock: Ie,
|
|
53
|
+
footer: Ve,
|
|
54
|
+
rightSection: Be,
|
|
55
|
+
header: Le,
|
|
56
|
+
productList: $e,
|
|
57
|
+
mobileFooter: Fe,
|
|
58
|
+
loaderContainer: Te,
|
|
59
|
+
orderMainData: Ee,
|
|
60
|
+
prices: We,
|
|
61
|
+
headerTitle: xe,
|
|
62
|
+
headerDescription: qe
|
|
63
|
+
}, Ue = "_modalContent_1a05n_1", je = "_iconContainer_1a05n_16", Ge = "_warningIcon_1a05n_20", ze = "_title_1a05n_25", He = "_description_1a05n_33", Je = "_buttonContainer_1a05n_40", Xe = "_button_1a05n_40", h = {
|
|
64
|
+
modalContent: Ue,
|
|
65
|
+
iconContainer: je,
|
|
66
|
+
warningIcon: Ge,
|
|
67
|
+
title: ze,
|
|
68
|
+
description: He,
|
|
69
|
+
buttonContainer: Je,
|
|
70
|
+
button: Xe
|
|
71
|
+
}, Ye = ({
|
|
72
|
+
isOpen: n,
|
|
73
|
+
onClose: c,
|
|
74
|
+
refundedAmount: d,
|
|
75
|
+
currency: e
|
|
76
|
+
}) => {
|
|
77
|
+
var b, w;
|
|
78
|
+
const _ = H(), { token: N, shopDomain: g } = ee(), { isAntistock: S, general: u } = J(), v = !!((b = u == null ? void 0 : u.info) != null && b.disableSupport), m = (w = u == null ? void 0 : u.info) == null ? void 0 : w.thirdPartySupportUrl, y = !(v && !m), i = new Intl.NumberFormat("en-US", {
|
|
79
|
+
style: "currency",
|
|
80
|
+
currency: e
|
|
81
|
+
}), a = () => {
|
|
82
|
+
_(S ? "/account" : "/customer-dash");
|
|
83
|
+
}, R = async () => {
|
|
84
|
+
if (v && m) {
|
|
85
|
+
window.open(m);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
S ? window.open(`https://${g}/support`) : _("/contact");
|
|
89
|
+
}, M = () => {
|
|
90
|
+
c();
|
|
91
|
+
};
|
|
92
|
+
return n ? /* @__PURE__ */ o(ke, { close: c, children: /* @__PURE__ */ l(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: h.modalContent,
|
|
96
|
+
onClick: (I) => I.stopPropagation(),
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ o("div", { className: h.iconContainer, children: /* @__PURE__ */ o(
|
|
99
|
+
X,
|
|
100
|
+
{
|
|
101
|
+
name: "WarningDiamond",
|
|
102
|
+
fill: "var(--text-warning)",
|
|
103
|
+
className: h.warningIcon
|
|
104
|
+
}
|
|
105
|
+
) }),
|
|
106
|
+
/* @__PURE__ */ o("h2", { className: h.title, children: "Partial Delivery Failure Refund" }),
|
|
107
|
+
/* @__PURE__ */ l("p", { className: h.description, children: [
|
|
108
|
+
"Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of",
|
|
109
|
+
" ",
|
|
110
|
+
i.format(d),
|
|
111
|
+
", to your account balance."
|
|
112
|
+
] }),
|
|
113
|
+
/* @__PURE__ */ l("div", { className: h.buttonContainer, children: [
|
|
114
|
+
!N && /* @__PURE__ */ o(
|
|
115
|
+
A,
|
|
116
|
+
{
|
|
117
|
+
type: "Secondary",
|
|
118
|
+
onClick: a,
|
|
119
|
+
className: h.button,
|
|
120
|
+
children: "Login"
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
y && /* @__PURE__ */ o(
|
|
124
|
+
A,
|
|
125
|
+
{
|
|
126
|
+
type: "Secondary",
|
|
127
|
+
onClick: R,
|
|
128
|
+
className: h.button,
|
|
129
|
+
children: "Contact Support"
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ o(
|
|
133
|
+
A,
|
|
134
|
+
{
|
|
135
|
+
type: "Primary",
|
|
136
|
+
onClick: M,
|
|
137
|
+
className: h.button,
|
|
138
|
+
children: "Continue"
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
) }) : null;
|
|
145
|
+
}, Ke = () => {
|
|
146
|
+
var B, L, $, F, T, E, W, x, q;
|
|
147
|
+
const { id: n, accessToken: c } = te(), d = H(), [e, _] = r.useState(), [N, g] = r.useState(!1), [S, u] = r.useState(!1), [v, m] = r.useState(!1), y = ie(), { isAntistock: i, general: a } = J(), R = ((B = e == null ? void 0 : e.rawPrice) == null ? void 0 : B.currency) || "USD", M = new Intl.NumberFormat("en-US", {
|
|
148
|
+
style: "currency",
|
|
149
|
+
currency: R
|
|
150
|
+
}), b = r.useMemo(() => (e == null ? void 0 : e.partOrders.map((t) => {
|
|
151
|
+
var P, D, k;
|
|
152
|
+
return {
|
|
153
|
+
id: Number((P = t.productWithVariant) == null ? void 0 : P.id) || 0,
|
|
154
|
+
partOrderId: Number(t == null ? void 0 : t.id) || 0,
|
|
155
|
+
image: t.productWithVariant.image,
|
|
156
|
+
name: (() => {
|
|
157
|
+
var U, j;
|
|
158
|
+
const p = ((U = t.productWithVariant) == null ? void 0 : U.name) || "", f = ((j = t.productWithVariant) == null ? void 0 : j.variantName) || "";
|
|
159
|
+
return !p && !f ? "" : !f || p === f ? p : p ? `${p} (${f})` : f;
|
|
160
|
+
})(),
|
|
161
|
+
description: "",
|
|
162
|
+
price: {
|
|
163
|
+
quantity: t.quantity,
|
|
164
|
+
amount: ((D = t.productWithVariant) == null ? void 0 : D.price.amount) || 0,
|
|
165
|
+
currency: (k = t.productWithVariant) == null ? void 0 : k.price.currency
|
|
166
|
+
},
|
|
167
|
+
deliveryCategories: "deliveryCategories" in t ? t.deliveryCategories : void 0,
|
|
168
|
+
customerNote: t.customerNote,
|
|
169
|
+
chargeType: t.chargeType || "ONE_TIME",
|
|
170
|
+
replacementRequests: "replacementRequests" in t ? t.replacementRequests : void 0,
|
|
171
|
+
allowedReplacementReasons: "allowedReplacementReasons" in t ? t.allowedReplacementReasons : void 0
|
|
172
|
+
};
|
|
173
|
+
})) || [], [e]);
|
|
174
|
+
r.useEffect(() => {
|
|
175
|
+
e && (e.status === C.FullDeliveryFailure || e.status === C.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && u(!0);
|
|
176
|
+
}, [e == null ? void 0 : e.status]);
|
|
177
|
+
const w = r.useCallback(async (t, P, D = !1) => {
|
|
178
|
+
var p, f;
|
|
179
|
+
D || g(!0);
|
|
180
|
+
const { data: k } = await (P ? re(`${t}/${P}`) : le(t));
|
|
181
|
+
g(!1), k.status !== C.Completed && ((p = k.charge) == null ? void 0 : p.status) === ue.NotPaid && d(`/charges/${(f = k.charge) == null ? void 0 : f.id}`, {
|
|
182
|
+
replace: !0
|
|
183
|
+
}), _(k);
|
|
184
|
+
}, [d]);
|
|
185
|
+
r.useLayoutEffect(() => {
|
|
186
|
+
if (n && !c) {
|
|
187
|
+
const t = JSON.parse(localStorage.getItem("orders") || "{}");
|
|
188
|
+
t[n] && d(`/orders/${n}/${t[n].fullAccessToken}`);
|
|
189
|
+
}
|
|
190
|
+
}, [n, c, d]), r.useEffect(() => {
|
|
191
|
+
n && w(n, c, !0);
|
|
192
|
+
const t = setInterval(() => {
|
|
193
|
+
n && w(n, c, !0);
|
|
194
|
+
}, 5e3);
|
|
195
|
+
return () => {
|
|
196
|
+
clearInterval(t);
|
|
197
|
+
};
|
|
198
|
+
}, [n, c, w]);
|
|
199
|
+
const I = O(() => !!(e != null && e.isApplicableForReplacement && (e.status === C.Completed || e.status === C.PartiallyDelivered || e.status === C.FullDeliveryFailure)), [e]), V = O(() => {
|
|
200
|
+
var t;
|
|
201
|
+
return !!((t = a == null ? void 0 : a.info) != null && t.isVouchesEnabled && c);
|
|
202
|
+
}, [(L = a == null ? void 0 : a.info) == null ? void 0 : L.isVouchesEnabled, c]), Y = O(() => {
|
|
203
|
+
var t;
|
|
204
|
+
return !!(!((t = a == null ? void 0 : a.info) != null && t.isVouchesEnabled) && (e != null && e.review) && "accessToken" in e.review && !i);
|
|
205
|
+
}, [($ = a == null ? void 0 : a.info) == null ? void 0 : $.isVouchesEnabled, e == null ? void 0 : e.review, i]), K = O(() => {
|
|
206
|
+
var t;
|
|
207
|
+
return ((t = a == null ? void 0 : a.info) == null ? void 0 : t.domain) || window.location.hostname;
|
|
208
|
+
}, [(F = a == null ? void 0 : a.info) == null ? void 0 : F.domain]);
|
|
209
|
+
return N ? /* @__PURE__ */ o("div", { className: s.loaderContainer, children: /* @__PURE__ */ o(Se, {}) }) : /* @__PURE__ */ l("div", { className: s.orderPage, children: [
|
|
210
|
+
/* @__PURE__ */ o("div", { className: s.leftSection, children: /* @__PURE__ */ l("div", { className: s.content, children: [
|
|
211
|
+
/* @__PURE__ */ o(de, {}),
|
|
212
|
+
e && /* @__PURE__ */ l("div", { className: `${s.main} ${i ? s.mainAntistock : ""}`, children: [
|
|
213
|
+
/* @__PURE__ */ o(
|
|
214
|
+
me,
|
|
215
|
+
{
|
|
216
|
+
className: s.statusBlock,
|
|
217
|
+
orderStatus: e.status
|
|
218
|
+
}
|
|
219
|
+
),
|
|
220
|
+
/* @__PURE__ */ l(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
className: `${s.orderMainData} ${i ? s.orderMainDataAntistock : ""}`,
|
|
224
|
+
children: [
|
|
225
|
+
V && /* @__PURE__ */ o(
|
|
226
|
+
he,
|
|
227
|
+
{
|
|
228
|
+
onAddMessage: () => m(!0),
|
|
229
|
+
isVouchLeft: e.isVouchLeft
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
/* @__PURE__ */ o(
|
|
233
|
+
pe,
|
|
234
|
+
{
|
|
235
|
+
lastUpdate: e.createdAt,
|
|
236
|
+
paymentType: (T = e.charge) == null ? void 0 : T.gateway,
|
|
237
|
+
email: e.customer ? e.customer.email : ((E = e.charge) == null ? void 0 : E.customerForCharge.email) || "",
|
|
238
|
+
orderId: e.id
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
Y && e.review && /* @__PURE__ */ o(
|
|
242
|
+
fe,
|
|
243
|
+
{
|
|
244
|
+
orderId: e.id,
|
|
245
|
+
review: e.review
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
e.charge && e.charge.timeline && /* @__PURE__ */ o(
|
|
252
|
+
_e,
|
|
253
|
+
{
|
|
254
|
+
className: `${s.timelineBlock} ${i ? s.timelineBlockAntistock : ""}`,
|
|
255
|
+
timeline: e.charge.timeline
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ o(
|
|
259
|
+
z,
|
|
260
|
+
{
|
|
261
|
+
className: `${s.footer} ${i ? s.footerAntistock : ""}`
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
] })
|
|
265
|
+
] }) }),
|
|
266
|
+
/* @__PURE__ */ o(
|
|
267
|
+
"div",
|
|
268
|
+
{
|
|
269
|
+
className: s.rightSection,
|
|
270
|
+
style: i ? { borderLeft: "1px solid var(--border-secondary)" } : void 0,
|
|
271
|
+
children: /* @__PURE__ */ l("div", { className: s.content, children: [
|
|
272
|
+
((W = e == null ? void 0 : e.charge) == null ? void 0 : W.name) && /* @__PURE__ */ l("header", { className: s.header, children: [
|
|
273
|
+
/* @__PURE__ */ l("div", { children: [
|
|
274
|
+
/* @__PURE__ */ o("h1", { className: s.headerTitle, children: e.charge.name }),
|
|
275
|
+
e.charge.description && /* @__PURE__ */ o("p", { className: s.headerDescription, children: e.charge.description })
|
|
276
|
+
] }),
|
|
277
|
+
i ? null : /* @__PURE__ */ l(
|
|
278
|
+
A,
|
|
279
|
+
{
|
|
280
|
+
type: "Secondary",
|
|
281
|
+
onClick: () => y((e == null ? void 0 : e.id) || ""),
|
|
282
|
+
style: {
|
|
283
|
+
whiteSpace: "nowrap",
|
|
284
|
+
display: "flex",
|
|
285
|
+
alignItems: "center",
|
|
286
|
+
gap: "4px"
|
|
287
|
+
},
|
|
288
|
+
children: [
|
|
289
|
+
/* @__PURE__ */ o(X, { name: "Copy" }),
|
|
290
|
+
/* @__PURE__ */ o("span", { children: "Copy ID" })
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
] }),
|
|
295
|
+
/* @__PURE__ */ l("div", { children: [
|
|
296
|
+
/* @__PURE__ */ o("div", { className: s.productList, children: b.map((t) => /* @__PURE__ */ o(
|
|
297
|
+
ge,
|
|
298
|
+
{
|
|
299
|
+
product: t,
|
|
300
|
+
isOrder: !0,
|
|
301
|
+
isApplicableForReplacement: I,
|
|
302
|
+
orderId: n,
|
|
303
|
+
accessToken: c,
|
|
304
|
+
allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
|
|
305
|
+
},
|
|
306
|
+
t.id
|
|
307
|
+
)) }),
|
|
308
|
+
i ? null : /* @__PURE__ */ o(
|
|
309
|
+
ye,
|
|
310
|
+
{
|
|
311
|
+
formatter: M,
|
|
312
|
+
coupon: null,
|
|
313
|
+
total: ((x = e == null ? void 0 : e.endPrice) == null ? void 0 : x.amount) || 0,
|
|
314
|
+
discount: 0,
|
|
315
|
+
totalWithDiscount: ((q = e == null ? void 0 : e.endPrice) == null ? void 0 : q.amount) || 0,
|
|
316
|
+
className: s.prices,
|
|
317
|
+
isShowSubtotal: !1
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
/* @__PURE__ */ o(z, { className: s.mobileFooter })
|
|
321
|
+
] })
|
|
322
|
+
] })
|
|
323
|
+
}
|
|
324
|
+
),
|
|
325
|
+
(e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ o(
|
|
326
|
+
Ye,
|
|
327
|
+
{
|
|
328
|
+
isOpen: S,
|
|
329
|
+
onClose: () => u(!1),
|
|
330
|
+
refundedAmount: e.refundedPrice.amount,
|
|
331
|
+
currency: e.refundedPrice.currency
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
V && /* @__PURE__ */ o(
|
|
335
|
+
we,
|
|
336
|
+
{
|
|
337
|
+
isOpen: v,
|
|
338
|
+
onClose: () => m(!1),
|
|
339
|
+
products: b,
|
|
340
|
+
orderId: n,
|
|
341
|
+
accessToken: c,
|
|
342
|
+
shopDomain: K,
|
|
343
|
+
onSuccess: () => {
|
|
344
|
+
m(!1), n && w(n, c, !0);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
)
|
|
348
|
+
] });
|
|
349
|
+
}, it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
350
|
+
__proto__: null,
|
|
351
|
+
OrderPage: Ke
|
|
352
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
353
|
+
export {
|
|
354
|
+
ct as O,
|
|
355
|
+
it as i
|
|
356
|
+
};
|