@billgangcom/theme-lib 1.114.1 → 1.114.3
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-dGixT-_d.js → builder-C4IiRjp5.js} +5 -5
- package/dist/{builder-BVVH9Uc0.cjs → builder-CZiRl_4b.cjs} +2 -2
- package/dist/{builder-components-BD45uk6H.js → builder-components-DUtnQsMR.js} +4 -4
- package/dist/{builder-components-BEFw4EcA.cjs → builder-components-Ds0B6KAh.cjs} +1 -1
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +22 -22
- package/dist/{charge-Nfq6BBT0.js → charge-BAjv22Uu.js} +6 -6
- package/dist/{charge-DAXMrlAq.cjs → charge-Swo2yUda.cjs} +1 -1
- package/dist/{checkout-DaksJ-vl.cjs → checkout-BihRJw1G.cjs} +1 -1
- package/dist/{checkout-DJA7m9bE.js → checkout-CsTWd6tI.js} +5 -5
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-CMngiHt6.cjs → index-0itRmU2L.cjs} +1 -1
- package/dist/{index-BE-LNEM-.cjs → index-BQKbOYps.cjs} +1 -1
- package/dist/{index-DKVA1wV8.js → index-BXuENnlY.js} +5 -5
- package/dist/{index-CgAhbfol.js → index-BbTAMqA3.js} +1 -1
- package/dist/{index-Drs_bUt0.js → index-CGhg-CkV.js} +5 -5
- package/dist/{index-CwBlGUFg.cjs → index-CJ8gac-X.cjs} +1 -1
- package/dist/{index-CSYLpXUY.js → index-D4BCHJ4l.js} +5 -5
- package/dist/{index-CxES4Y2E.cjs → index-DEpz6kqr.cjs} +1 -1
- package/dist/{index-CX9eAqxn.js → index-DcAv5U36.js} +5 -5
- package/dist/{index-Cq-HG360.cjs → index-eaTS3-Aj.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/order-DepPRtns.cjs +1 -0
- package/dist/{order-BiWH1GaD.js → order-sMlMoj4y.js} +119 -117
- package/dist/{subscription-BsED7sfb.js → subscription-2rmlPxD5.js} +5 -5
- package/dist/{subscription-DuCTTG3r.cjs → subscription-BAy6WRcF.cjs} +1 -1
- package/dist/{ticket-CbHpWM1U.cjs → ticket-Buu-gWi7.cjs} +1 -1
- package/dist/{ticket-D82dpA86.js → ticket-D5JmN5l9.js} +5 -5
- package/dist/{top-up-Czf-dtwC.cjs → top-up-Cj3r_l4u.cjs} +1 -1
- package/dist/{top-up-CKuuSysp.js → top-up-iDz6xeq5.js} +5 -5
- package/dist/{ui-components-D3S3Wicn.js → ui-components-CAvXxpG4.js} +371 -371
- package/dist/{ui-components-DgahiZcB.cjs → ui-components-DhvDTRiU.cjs} +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-otConG8r.cjs → validation-BzWFnVQz.cjs} +1 -1
- package/dist/{validation-BVXpLz7D.js → validation-CVlQrUBl.js} +5 -5
- package/package.json +1 -1
- package/dist/order-EtDX2zwp.cjs +0 -1
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, H as l, u as d, G as x, I as C, F 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 S } from "./checkout-
|
|
3
|
+
import { Y as p, Z as u, _ as c } from "./builder-C4IiRjp5.js";
|
|
4
|
+
import "./ui-components-CAvXxpG4.js";
|
|
5
|
+
import "./builder-components-DUtnQsMR.js";
|
|
6
|
+
import { M as n, R as f, H as l, u as d, G as x, I as C, F as R } from "./charge-BAjv22Uu.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-D5JmN5l9.js";
|
|
8
|
+
import { Checkout as S } from "./checkout-CsTWd6tI.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 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-CZiRl_4b.cjs");const r=require("react"),t=require("./ui-components-DhvDTRiU.cjs");require("./builder-components-Ds0B6KAh.cjs");require("./charge-Swo2yUda.cjs");require("./ticket-Buu-gWi7.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 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-DhvDTRiU.cjs");require("react");const s=require("./builder-CZiRl_4b.cjs");require("./builder-components-Ds0B6KAh.cjs");require("./charge-Swo2yUda.cjs");require("./ticket-Buu-gWi7.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;
|
|
@@ -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-CAvXxpG4.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-C4IiRjp5.js";
|
|
5
|
+
import "./builder-components-DUtnQsMR.js";
|
|
6
|
+
import "./charge-BAjv22Uu.js";
|
|
7
|
+
import "./ticket-D5JmN5l9.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,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-C4IiRjp5.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,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 { V as z, Z as U } from "./charge-
|
|
4
|
-
import { M as f, N as T, ab as V, p as F, a6 as G, e as R, O as H, m as M, a as q, u as B, V as X, b as Y, al as Z, ag as K } from "./builder-
|
|
5
|
-
import { g as Q } from "./ticket-
|
|
6
|
-
import { e as $, N as ee, p as te } from "./ui-components-
|
|
7
|
-
import "./builder-components-
|
|
3
|
+
import { V as z, Z as U } from "./charge-BAjv22Uu.js";
|
|
4
|
+
import { M as f, N as T, ab as V, p as F, a6 as G, e as R, O as H, m as M, a as q, u as B, V as X, b as Y, al as Z, ag as K } from "./builder-C4IiRjp5.js";
|
|
5
|
+
import { g as Q } from "./ticket-D5JmN5l9.js";
|
|
6
|
+
import { e as $, N as ee, p as te } from "./ui-components-CAvXxpG4.js";
|
|
7
|
+
import "./builder-components-DUtnQsMR.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 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-CZiRl_4b.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 } from "react/jsx-runtime";
|
|
2
|
-
import "./builder-
|
|
2
|
+
import "./builder-C4IiRjp5.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-CAvXxpG4.js";
|
|
5
|
+
import "./builder-components-DUtnQsMR.js";
|
|
6
|
+
import "./charge-BAjv22Uu.js";
|
|
7
|
+
import "./ticket-D5JmN5l9.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const f = () => (e.useEffect(() => {
|
|
10
10
|
setTimeout(() => {
|
|
@@ -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-Swo2yUda.cjs"),t=require("./builder-CZiRl_4b.cjs"),J=require("./ticket-Buu-gWi7.cjs"),g=require("./ui-components-DhvDTRiU.cjs");require("./builder-components-Ds0B6KAh.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 { 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-CAvXxpG4.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-C4IiRjp5.js";
|
|
5
|
+
import "./builder-components-DUtnQsMR.js";
|
|
6
|
+
import "./charge-BAjv22Uu.js";
|
|
7
|
+
import "./ticket-D5JmN5l9.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-DhvDTRiU.cjs");require("react");const n=require("./builder-CZiRl_4b.cjs");require("./builder-components-Ds0B6KAh.cjs");require("./charge-Swo2yUda.cjs");require("./ticket-Buu-gWi7.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;
|
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-CZiRl_4b.cjs");require("react/jsx-runtime");const c=require("react"),t=require("./ui-components-DhvDTRiU.cjs");require("./builder-components-Ds0B6KAh.cjs");const r=require("./charge-Swo2yUda.cjs"),e=require("./ticket-Buu-gWi7.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-C4IiRjp5.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, H as E, u as M, G as N, I as O, F as P } from "./charge-
|
|
9
|
-
import { C as B, c as G, h as S, i as y, r as D, d as F, s as H, u as J, e as V, b as Y, a as Z } from "./ticket-
|
|
5
|
+
import { r as t } from "./ui-components-CAvXxpG4.js";
|
|
6
|
+
import { I as C, l as b, n as k, m as T } from "./ui-components-CAvXxpG4.js";
|
|
7
|
+
import "./builder-components-DUtnQsMR.js";
|
|
8
|
+
import { M as w, R as A, H as E, u as M, G as N, I as O, F as P } from "./charge-BAjv22Uu.js";
|
|
9
|
+
import { C as B, c as G, h as S, i as y, r as D, d as F, s as H, u as J, e as V, b as Y, a as Z } from "./ticket-D5JmN5l9.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"),c=require("react"),x=require("./builder-CZiRl_4b.cjs"),a=require("./charge-Swo2yUda.cjs"),h=require("./ui-components-DhvDTRiU.cjs");require("./builder-components-Ds0B6KAh.cjs");require("./ticket-Buu-gWi7.cjs");require("react-dom");const M=async(s=1)=>await a.fetchOrders({PageNumber:s}),$=()=>{const[s,i]=c.useState(null),[d,e]=c.useState(null),[g,j]=c.useState(0),{page:_}=x.usePaginationPagesStore(),[k,f]=c.useState(!0);async function C(){f(!0);const{list:p,totalCount:y}=await M(_);i(p),j(y),e(null),f(!1)}async function r(){const p=(s==null?void 0:s.map(w=>w.gatewayName))||[],y=await a.getGatewaysDetail(p);e(y)}return c.useEffect(()=>{!d&&s&&r()},[s,d]),c.useEffect(()=>{C()},[_]),t.jsx(t.Fragment,{children:s!=null&&s.length&&s.length===0?t.jsx(a.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(a.PageTitle,{title:"Orders"}),t.jsx(a.OrdersTable,{orders:s,gatewaysDetail:d,totalCount:g,isLoading:k})]})})},T="_orderPage_gc87l_1",q="_leftSection_gc87l_15",L="_content_gc87l_35",W="_main_gc87l_42",E="_mainAntistock_gc87l_56",G="_orderMainDataAntistock_gc87l_69",V="_timelineBlockAntistock_gc87l_81",U="_footerAntistock_gc87l_92",z="_statusBlock_gc87l_104",H="_timelineBlock_gc87l_81",J="_footer_gc87l_92",Y="_rightSection_gc87l_121",K="_header_gc87l_142",Q="_productList_gc87l_150",X="_mobileFooter_gc87l_157",Z="_loaderContainer_gc87l_166",ee="_orderMainData_gc87l_69",te="_prices_gc87l_181",ne="_headerTitle_gc87l_185",se="_headerDescription_gc87l_189",o={orderPage:T,leftSection:q,content:L,main:W,mainAntistock:E,orderMainDataAntistock:G,timelineBlockAntistock:V,footerAntistock:U,statusBlock:z,timelineBlock:H,footer:J,rightSection:Y,header:K,productList:Q,mobileFooter:X,loaderContainer:Z,orderMainData:ee,prices:te,headerTitle:ne,headerDescription:se},ae="_modalContent_1a05n_1",oe="_iconContainer_1a05n_16",ce="_warningIcon_1a05n_20",re="_title_1a05n_25",ie="_description_1a05n_33",le="_buttonContainer_1a05n_40",ue="_button_1a05n_40",u={modalContent:ae,iconContainer:oe,warningIcon:ce,title:re,description:ie,buttonContainer:le,button:ue},de=({isOpen:s,onClose:i,refundedAmount:d,currency:e})=>{const g=x.useNavigate(),{token:j,shopDomain:_}=x.useStorefrontStore(),{isAntistock:k}=x.useGeneralStore(),f=new Intl.NumberFormat("en-US",{style:"currency",currency:e}),C=()=>{g(k?"/account":"/customer-dash")},r=async()=>{k?window.open(`https://${_}/support`):g("/contact")},p=()=>{i()};return s?t.jsx(h.Modal,{close:i,children:t.jsxs("div",{className:u.modalContent,onClick:y=>y.stopPropagation(),children:[t.jsx("div",{className:u.iconContainer,children:t.jsx(h.Icon,{name:"WarningDiamond",fill:"var(--text-warning)",className:u.warningIcon})}),t.jsx("h2",{className:u.title,children:"Partial Delivery Failure Refund"}),t.jsxs("p",{className:u.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"," ",f.format(d),", to your account balance."]}),t.jsxs("div",{className:u.buttonContainer,children:[!j&&t.jsx(h.Button,{type:"Secondary",onClick:C,className:u.button,children:"Login"}),t.jsx(h.Button,{type:"Secondary",onClick:r,className:u.button,children:"Contact Support"}),t.jsx(h.Button,{type:"Primary",onClick:p,className:u.button,children:"Continue"})]})]})}):null},me=()=>{var b,D,P,A,R,I;const{id:s,accessToken:i}=x.useParams(),d=x.useNavigate(),[e,g]=c.useState(),[j,_]=c.useState(!1),[k,f]=c.useState(!1),C=a.useCopy(),{isAntistock:r}=x.useGeneralStore(),p=((b=e==null?void 0:e.rawPrice)==null?void 0:b.currency)||"USD",y=new Intl.NumberFormat("en-US",{style:"currency",currency:p}),w=c.useMemo(()=>(e==null?void 0:e.partOrders.map(n=>{var S,N;return{id:(n==null?void 0:n.id)||0,image:n.productWithVariant.image,name:(()=>{var v,B;const l=((v=n.productWithVariant)==null?void 0:v.name)||"",m=((B=n.productWithVariant)==null?void 0:B.variantName)||"";return!l&&!m?"":!m||l===m?l:l?`${l} (${m})`:m})(),description:"",price:{quantity:n.quantity,amount:((S=n.productWithVariant)==null?void 0:S.price.amount)||0,currency:(N=n.productWithVariant)==null?void 0:N.price.currency},deliveryCategories:"deliveryCategories"in n?n.deliveryCategories:void 0,customerNote:n.customerNote,chargeType:n.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in n?n.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in n?n.allowedReplacementReasons:void 0}}))||[],[e]);c.useEffect(()=>{e&&(e.status===a.OrderStatus.FullDeliveryFailure||e.status===a.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&f(!0)},[e==null?void 0:e.status]);const O=async(n,S,N=!1)=>{var m,v;N||_(!0);const{data:l}=await(S?a.fetchAuthorizedOrder(`${n}/${S}`):a.fetchOrder(n));_(!1),l.status!==a.OrderStatus.Completed&&((m=l.charge)==null?void 0:m.status)===a.ChargeStatus.NotPaid&&d(`/charges/${(v=l.charge)==null?void 0:v.id}`,{replace:!0}),g(l)};c.useLayoutEffect(()=>{if(s&&!i){const n=JSON.parse(localStorage.getItem("orders")||"{}");n[s]&&d(`/orders/${s}/${n[s].fullAccessToken}`)}},[s]),c.useEffect(()=>{s&&O(s,i,!0);const n=setInterval(()=>{s&&O(s,i,!0)},5e3);return()=>{clearInterval(n)}},[s,i]);const F=c.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===a.OrderStatus.Completed||e.status===a.OrderStatus.PartiallyDelivered||e.status===a.OrderStatus.FullDeliveryFailure)),[e]);return j?t.jsx("div",{className:o.loaderContainer,children:t.jsx(h.Loader,{})}):t.jsxs("div",{className:o.orderPage,children:[t.jsx("div",{className:o.leftSection,children:t.jsxs("div",{className:o.content,children:[t.jsx(a.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${o.main} ${r?o.mainAntistock:""}`,children:[t.jsx(a.OrderStatusBlock,{className:o.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${o.orderMainData} ${r?o.orderMainDataAntistock:""}`,children:[t.jsx(a.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(D=e.charge)==null?void 0:D.gateway,email:e.customer?e.customer.email:((P=e.charge)==null?void 0:P.customerForCharge.email)||"",orderId:e.id}),"accessToken"in e.review&&!r&&t.jsx(a.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(a.TrackPayment,{className:`${o.timelineBlock} ${r?o.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(a.CheckoutFooter,{className:`${o.footer} ${r?o.footerAntistock:""}`})]})]})}),t.jsx("div",{className:o.rightSection,style:r?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:o.content,children:[((A=e==null?void 0:e.charge)==null?void 0:A.name)&&t.jsxs("header",{className:o.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:o.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:o.headerDescription,children:e.charge.description})]}),r?null:t.jsxs(h.Button,{type:"Secondary",onClick:()=>C((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(h.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:o.productList,children:w.map(n=>t.jsx(a.CheckoutProduct,{product:n,isOrder:!0,isApplicableForReplacement:F,orderId:s,accessToken:i,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},n.id))}),r?null:t.jsx(a.CheckoutPrices,{formatter:y,coupon:null,total:((R=e==null?void 0:e.endPrice)==null?void 0:R.amount)||0,discount:0,totalWithDiscount:((I=e==null?void 0:e.endPrice)==null?void 0:I.amount)||0,className:o.prices,isShowSubtotal:!1}),t.jsx(a.CheckoutFooter,{className:o.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(de,{isOpen:k,onClose:()=>f(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency})]})},he=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:me},Symbol.toStringTag,{value:"Module"}));exports.Orders=$;exports.index=he;
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import { jsx as t, Fragment as
|
|
2
|
-
import i, { useState as
|
|
3
|
-
import { X as
|
|
4
|
-
import { f as
|
|
5
|
-
import { M as
|
|
6
|
-
import "./builder-components-
|
|
7
|
-
import "./ticket-
|
|
1
|
+
import { jsx as t, Fragment as F, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import i, { useState as q, useMemo as V } from "react";
|
|
3
|
+
import { X as j, p as L, M as G, V as W, a7 as U } from "./builder-C4IiRjp5.js";
|
|
4
|
+
import { f as z, N as H, P as J, O as X, g as Y, b as K, c as k, d as Q, e as Z, h as ee, L as te, T as ae, i as T, j as ne, k as oe, l as se, m as ce, n as ie } from "./charge-BAjv22Uu.js";
|
|
5
|
+
import { M as re, I as x, g as b, e as le } from "./ui-components-CAvXxpG4.js";
|
|
6
|
+
import "./builder-components-DUtnQsMR.js";
|
|
7
|
+
import "./ticket-D5JmN5l9.js";
|
|
8
8
|
import "react-dom";
|
|
9
|
-
const
|
|
10
|
-
const [
|
|
9
|
+
const de = async (n = 1) => await z({ PageNumber: n }), Je = () => {
|
|
10
|
+
const [n, r] = i.useState(null), [u, e] = q(null), [h, C] = i.useState(0), { page: g } = j(), [y, p] = i.useState(!0);
|
|
11
11
|
async function N() {
|
|
12
|
-
|
|
13
|
-
const { list:
|
|
14
|
-
r(
|
|
12
|
+
p(!0);
|
|
13
|
+
const { list: _, totalCount: f } = await de(g);
|
|
14
|
+
r(_), C(f), e(null), p(!1);
|
|
15
15
|
}
|
|
16
16
|
async function c() {
|
|
17
|
-
const
|
|
18
|
-
e(
|
|
17
|
+
const _ = (n == null ? void 0 : n.map((P) => P.gatewayName)) || [], f = await Y(_);
|
|
18
|
+
e(f);
|
|
19
19
|
}
|
|
20
20
|
return i.useEffect(() => {
|
|
21
|
-
!u &&
|
|
22
|
-
}, [
|
|
21
|
+
!u && n && c();
|
|
22
|
+
}, [n, u]), i.useEffect(() => {
|
|
23
23
|
N();
|
|
24
|
-
}, [g]), /* @__PURE__ */ t(
|
|
25
|
-
|
|
24
|
+
}, [g]), /* @__PURE__ */ t(F, { children: n != null && n.length && n.length === 0 ? /* @__PURE__ */ t(
|
|
25
|
+
H,
|
|
26
26
|
{
|
|
27
27
|
title: "No Orders",
|
|
28
28
|
description: "When you purchase products from our website, you'll see a history of orders here."
|
|
29
29
|
}
|
|
30
|
-
) : /* @__PURE__ */ s(
|
|
31
|
-
/* @__PURE__ */ t(
|
|
30
|
+
) : /* @__PURE__ */ s(F, { children: [
|
|
31
|
+
/* @__PURE__ */ t(J, { title: "Orders" }),
|
|
32
32
|
/* @__PURE__ */ t(
|
|
33
|
-
|
|
33
|
+
X,
|
|
34
34
|
{
|
|
35
|
-
orders:
|
|
35
|
+
orders: n,
|
|
36
36
|
gatewaysDetail: u,
|
|
37
37
|
totalCount: h,
|
|
38
38
|
isLoading: y
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
] }) });
|
|
42
|
-
},
|
|
43
|
-
orderPage:
|
|
44
|
-
leftSection:
|
|
45
|
-
content:
|
|
46
|
-
main:
|
|
47
|
-
mainAntistock:
|
|
48
|
-
orderMainDataAntistock:
|
|
49
|
-
timelineBlockAntistock:
|
|
50
|
-
footerAntistock:
|
|
51
|
-
statusBlock:
|
|
52
|
-
timelineBlock:
|
|
53
|
-
footer:
|
|
54
|
-
rightSection:
|
|
55
|
-
header:
|
|
56
|
-
productList:
|
|
57
|
-
mobileFooter:
|
|
58
|
-
loaderContainer:
|
|
59
|
-
orderMainData:
|
|
60
|
-
prices:
|
|
61
|
-
headerTitle:
|
|
62
|
-
headerDescription:
|
|
63
|
-
},
|
|
64
|
-
modalContent:
|
|
65
|
-
iconContainer:
|
|
66
|
-
warningIcon:
|
|
67
|
-
title:
|
|
68
|
-
description:
|
|
42
|
+
}, ue = "_orderPage_gc87l_1", me = "_leftSection_gc87l_15", he = "_content_gc87l_35", ge = "_main_gc87l_42", pe = "_mainAntistock_gc87l_56", _e = "_orderMainDataAntistock_gc87l_69", fe = "_timelineBlockAntistock_gc87l_81", ye = "_footerAntistock_gc87l_92", ke = "_statusBlock_gc87l_104", Ce = "_timelineBlock_gc87l_81", Ne = "_footer_gc87l_92", ve = "_rightSection_gc87l_121", we = "_header_gc87l_142", Se = "_productList_gc87l_150", be = "_mobileFooter_gc87l_157", Pe = "_loaderContainer_gc87l_166", De = "_orderMainData_gc87l_69", Oe = "_prices_gc87l_181", Ae = "_headerTitle_gc87l_185", Re = "_headerDescription_gc87l_189", o = {
|
|
43
|
+
orderPage: ue,
|
|
44
|
+
leftSection: me,
|
|
45
|
+
content: he,
|
|
46
|
+
main: ge,
|
|
47
|
+
mainAntistock: pe,
|
|
48
|
+
orderMainDataAntistock: _e,
|
|
49
|
+
timelineBlockAntistock: fe,
|
|
50
|
+
footerAntistock: ye,
|
|
51
|
+
statusBlock: ke,
|
|
52
|
+
timelineBlock: Ce,
|
|
53
|
+
footer: Ne,
|
|
54
|
+
rightSection: ve,
|
|
55
|
+
header: we,
|
|
56
|
+
productList: Se,
|
|
57
|
+
mobileFooter: be,
|
|
58
|
+
loaderContainer: Pe,
|
|
59
|
+
orderMainData: De,
|
|
60
|
+
prices: Oe,
|
|
61
|
+
headerTitle: Ae,
|
|
62
|
+
headerDescription: Re
|
|
63
|
+
}, Ie = "_modalContent_1a05n_1", Me = "_iconContainer_1a05n_16", $e = "_warningIcon_1a05n_20", Be = "_title_1a05n_25", Fe = "_description_1a05n_33", Te = "_buttonContainer_1a05n_40", Le = "_button_1a05n_40", d = {
|
|
64
|
+
modalContent: Ie,
|
|
65
|
+
iconContainer: Me,
|
|
66
|
+
warningIcon: $e,
|
|
67
|
+
title: Be,
|
|
68
|
+
description: Fe,
|
|
69
69
|
buttonContainer: Te,
|
|
70
|
-
button:
|
|
71
|
-
},
|
|
72
|
-
isOpen:
|
|
70
|
+
button: Le
|
|
71
|
+
}, We = ({
|
|
72
|
+
isOpen: n,
|
|
73
73
|
onClose: r,
|
|
74
74
|
refundedAmount: u,
|
|
75
75
|
currency: e
|
|
76
76
|
}) => {
|
|
77
|
-
const h =
|
|
77
|
+
const h = L(), { token: C, shopDomain: g } = G(), { isAntistock: y } = W(), p = new Intl.NumberFormat("en-US", {
|
|
78
78
|
style: "currency",
|
|
79
79
|
currency: e
|
|
80
80
|
}), N = () => {
|
|
81
81
|
h(y ? "/account" : "/customer-dash");
|
|
82
82
|
}, c = async () => {
|
|
83
83
|
y ? window.open(`https://${g}/support`) : h("/contact");
|
|
84
|
-
},
|
|
84
|
+
}, _ = () => {
|
|
85
85
|
r();
|
|
86
86
|
};
|
|
87
|
-
return
|
|
87
|
+
return n ? /* @__PURE__ */ t(re, { close: r, children: /* @__PURE__ */ s(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
90
|
className: d.modalContent,
|
|
91
|
-
onClick: (
|
|
91
|
+
onClick: (f) => f.stopPropagation(),
|
|
92
92
|
children: [
|
|
93
93
|
/* @__PURE__ */ t("div", { className: d.iconContainer, children: /* @__PURE__ */ t(
|
|
94
94
|
x,
|
|
@@ -102,12 +102,12 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
102
102
|
/* @__PURE__ */ s("p", { className: d.description, children: [
|
|
103
103
|
"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",
|
|
104
104
|
" ",
|
|
105
|
-
|
|
105
|
+
p.format(u),
|
|
106
106
|
", to your account balance."
|
|
107
107
|
] }),
|
|
108
108
|
/* @__PURE__ */ s("div", { className: d.buttonContainer, children: [
|
|
109
|
-
!
|
|
110
|
-
|
|
109
|
+
!C && /* @__PURE__ */ t(
|
|
110
|
+
b,
|
|
111
111
|
{
|
|
112
112
|
type: "Secondary",
|
|
113
113
|
onClick: N,
|
|
@@ -116,7 +116,7 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
118
|
/* @__PURE__ */ t(
|
|
119
|
-
|
|
119
|
+
b,
|
|
120
120
|
{
|
|
121
121
|
type: "Secondary",
|
|
122
122
|
onClick: c,
|
|
@@ -125,10 +125,10 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
125
125
|
}
|
|
126
126
|
),
|
|
127
127
|
/* @__PURE__ */ t(
|
|
128
|
-
|
|
128
|
+
b,
|
|
129
129
|
{
|
|
130
130
|
type: "Primary",
|
|
131
|
-
onClick:
|
|
131
|
+
onClick: _,
|
|
132
132
|
className: d.button,
|
|
133
133
|
children: "Continue"
|
|
134
134
|
}
|
|
@@ -137,64 +137,66 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
137
137
|
]
|
|
138
138
|
}
|
|
139
139
|
) }) : null;
|
|
140
|
-
},
|
|
141
|
-
var
|
|
142
|
-
const { id:
|
|
140
|
+
}, xe = () => {
|
|
141
|
+
var O, A, R, I, M, $;
|
|
142
|
+
const { id: n, accessToken: r } = U(), u = L(), [e, h] = i.useState(), [C, g] = i.useState(!1), [y, p] = i.useState(!1), N = K(), { isAntistock: c } = W(), _ = ((O = e == null ? void 0 : e.rawPrice) == null ? void 0 : O.currency) || "USD", f = new Intl.NumberFormat("en-US", {
|
|
143
143
|
style: "currency",
|
|
144
|
-
currency:
|
|
145
|
-
}),
|
|
146
|
-
var
|
|
144
|
+
currency: _
|
|
145
|
+
}), P = i.useMemo(() => (e == null ? void 0 : e.partOrders.map((a) => {
|
|
146
|
+
var v, S;
|
|
147
147
|
return {
|
|
148
|
-
id: (
|
|
149
|
-
image:
|
|
148
|
+
id: (a == null ? void 0 : a.id) || 0,
|
|
149
|
+
image: a.productWithVariant.image,
|
|
150
150
|
name: (() => {
|
|
151
|
-
var w,
|
|
152
|
-
const l = ((w =
|
|
151
|
+
var w, B;
|
|
152
|
+
const l = ((w = a.productWithVariant) == null ? void 0 : w.name) || "", m = ((B = a.productWithVariant) == null ? void 0 : B.variantName) || "";
|
|
153
153
|
return !l && !m ? "" : !m || l === m ? l : l ? `${l} (${m})` : m;
|
|
154
154
|
})(),
|
|
155
155
|
description: "",
|
|
156
156
|
price: {
|
|
157
|
-
quantity:
|
|
158
|
-
amount: ((
|
|
159
|
-
currency: (
|
|
157
|
+
quantity: a.quantity,
|
|
158
|
+
amount: ((v = a.productWithVariant) == null ? void 0 : v.price.amount) || 0,
|
|
159
|
+
currency: (S = a.productWithVariant) == null ? void 0 : S.price.currency
|
|
160
160
|
},
|
|
161
|
-
deliveryCategories: "deliveryCategories" in
|
|
162
|
-
customerNote:
|
|
163
|
-
chargeType:
|
|
164
|
-
replacementRequests: "replacementRequests" in
|
|
165
|
-
allowedReplacementReasons: "allowedReplacementReasons" in
|
|
161
|
+
deliveryCategories: "deliveryCategories" in a ? a.deliveryCategories : void 0,
|
|
162
|
+
customerNote: a.customerNote,
|
|
163
|
+
chargeType: a.chargeType || "ONE_TIME",
|
|
164
|
+
replacementRequests: "replacementRequests" in a ? a.replacementRequests : void 0,
|
|
165
|
+
allowedReplacementReasons: "allowedReplacementReasons" in a ? a.allowedReplacementReasons : void 0
|
|
166
166
|
};
|
|
167
167
|
})) || [], [e]);
|
|
168
168
|
i.useEffect(() => {
|
|
169
|
-
e && (e.status ===
|
|
169
|
+
e && (e.status === k.FullDeliveryFailure || e.status === k.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && p(!0);
|
|
170
170
|
}, [e == null ? void 0 : e.status]);
|
|
171
|
-
const
|
|
171
|
+
const D = async (a, v, S = !1) => {
|
|
172
172
|
var m, w;
|
|
173
|
-
|
|
174
|
-
const { data: l } = await (
|
|
175
|
-
g(!1), l.status !==
|
|
173
|
+
S || g(!0);
|
|
174
|
+
const { data: l } = await (v ? se(`${a}/${v}`) : ce(a));
|
|
175
|
+
g(!1), l.status !== k.Completed && ((m = l.charge) == null ? void 0 : m.status) === ie.NotPaid && u(`/charges/${(w = l.charge) == null ? void 0 : w.id}`, {
|
|
176
176
|
replace: !0
|
|
177
177
|
}), h(l);
|
|
178
178
|
};
|
|
179
|
-
|
|
180
|
-
if (
|
|
181
|
-
const
|
|
182
|
-
n
|
|
179
|
+
i.useLayoutEffect(() => {
|
|
180
|
+
if (n && !r) {
|
|
181
|
+
const a = JSON.parse(localStorage.getItem("orders") || "{}");
|
|
182
|
+
a[n] && u(`/orders/${n}/${a[n].fullAccessToken}`);
|
|
183
183
|
}
|
|
184
|
-
}, [
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
|
|
184
|
+
}, [n]), i.useEffect(() => {
|
|
185
|
+
n && D(n, r, !0);
|
|
186
|
+
const a = setInterval(() => {
|
|
187
|
+
n && D(n, r, !0);
|
|
188
188
|
}, 5e3);
|
|
189
189
|
return () => {
|
|
190
|
-
clearInterval(
|
|
190
|
+
clearInterval(a);
|
|
191
191
|
};
|
|
192
|
-
}, [
|
|
192
|
+
}, [n, r]);
|
|
193
|
+
const E = V(() => !!(e != null && e.isApplicableForReplacement && (e.status === k.Completed || e.status === k.PartiallyDelivered || e.status === k.FullDeliveryFailure)), [e]);
|
|
194
|
+
return C ? /* @__PURE__ */ t("div", { className: o.loaderContainer, children: /* @__PURE__ */ t(le, {}) }) : /* @__PURE__ */ s("div", { className: o.orderPage, children: [
|
|
193
195
|
/* @__PURE__ */ t("div", { className: o.leftSection, children: /* @__PURE__ */ s("div", { className: o.content, children: [
|
|
194
|
-
/* @__PURE__ */ t(
|
|
196
|
+
/* @__PURE__ */ t(Q, {}),
|
|
195
197
|
e && /* @__PURE__ */ s("div", { className: `${o.main} ${c ? o.mainAntistock : ""}`, children: [
|
|
196
198
|
/* @__PURE__ */ t(
|
|
197
|
-
|
|
199
|
+
Z,
|
|
198
200
|
{
|
|
199
201
|
className: o.statusBlock,
|
|
200
202
|
orderStatus: e.status
|
|
@@ -206,7 +208,7 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
206
208
|
className: `${o.orderMainData} ${c ? o.orderMainDataAntistock : ""}`,
|
|
207
209
|
children: [
|
|
208
210
|
/* @__PURE__ */ t(
|
|
209
|
-
|
|
211
|
+
ee,
|
|
210
212
|
{
|
|
211
213
|
lastUpdate: e.createdAt,
|
|
212
214
|
paymentType: (A = e.charge) == null ? void 0 : A.gateway,
|
|
@@ -215,7 +217,7 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
215
217
|
}
|
|
216
218
|
),
|
|
217
219
|
"accessToken" in e.review && !c && /* @__PURE__ */ t(
|
|
218
|
-
|
|
220
|
+
te,
|
|
219
221
|
{
|
|
220
222
|
orderId: e.id,
|
|
221
223
|
review: e.review
|
|
@@ -225,14 +227,14 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
225
227
|
}
|
|
226
228
|
),
|
|
227
229
|
e.charge && e.charge.timeline && /* @__PURE__ */ t(
|
|
228
|
-
|
|
230
|
+
ae,
|
|
229
231
|
{
|
|
230
232
|
className: `${o.timelineBlock} ${c ? o.timelineBlockAntistock : ""}`,
|
|
231
233
|
timeline: e.charge.timeline
|
|
232
234
|
}
|
|
233
235
|
),
|
|
234
236
|
/* @__PURE__ */ t(
|
|
235
|
-
|
|
237
|
+
T,
|
|
236
238
|
{
|
|
237
239
|
className: `${o.footer} ${c ? o.footerAntistock : ""}`
|
|
238
240
|
}
|
|
@@ -251,7 +253,7 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
251
253
|
e.charge.description && /* @__PURE__ */ t("p", { className: o.headerDescription, children: e.charge.description })
|
|
252
254
|
] }),
|
|
253
255
|
c ? null : /* @__PURE__ */ s(
|
|
254
|
-
|
|
256
|
+
b,
|
|
255
257
|
{
|
|
256
258
|
type: "Secondary",
|
|
257
259
|
onClick: () => N((e == null ? void 0 : e.id) || ""),
|
|
@@ -269,22 +271,22 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
269
271
|
)
|
|
270
272
|
] }),
|
|
271
273
|
/* @__PURE__ */ s("div", { children: [
|
|
272
|
-
/* @__PURE__ */ t("div", { className: o.productList, children:
|
|
273
|
-
|
|
274
|
+
/* @__PURE__ */ t("div", { className: o.productList, children: P.map((a) => /* @__PURE__ */ t(
|
|
275
|
+
ne,
|
|
274
276
|
{
|
|
275
|
-
product:
|
|
277
|
+
product: a,
|
|
276
278
|
isOrder: !0,
|
|
277
|
-
isApplicableForReplacement:
|
|
278
|
-
orderId:
|
|
279
|
+
isApplicableForReplacement: E,
|
|
280
|
+
orderId: n,
|
|
279
281
|
accessToken: r,
|
|
280
282
|
allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
|
|
281
283
|
},
|
|
282
|
-
|
|
284
|
+
a.id
|
|
283
285
|
)) }),
|
|
284
286
|
c ? null : /* @__PURE__ */ t(
|
|
285
|
-
|
|
287
|
+
oe,
|
|
286
288
|
{
|
|
287
|
-
formatter:
|
|
289
|
+
formatter: f,
|
|
288
290
|
coupon: null,
|
|
289
291
|
total: ((M = e == null ? void 0 : e.endPrice) == null ? void 0 : M.amount) || 0,
|
|
290
292
|
discount: 0,
|
|
@@ -293,26 +295,26 @@ const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
|
293
295
|
isShowSubtotal: !1
|
|
294
296
|
}
|
|
295
297
|
),
|
|
296
|
-
/* @__PURE__ */ t(
|
|
298
|
+
/* @__PURE__ */ t(T, { className: o.mobileFooter })
|
|
297
299
|
] })
|
|
298
300
|
] })
|
|
299
301
|
}
|
|
300
302
|
),
|
|
301
303
|
(e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ t(
|
|
302
|
-
|
|
304
|
+
We,
|
|
303
305
|
{
|
|
304
306
|
isOpen: y,
|
|
305
|
-
onClose: () =>
|
|
307
|
+
onClose: () => p(!1),
|
|
306
308
|
refundedAmount: e.refundedPrice.amount,
|
|
307
309
|
currency: e.refundedPrice.currency
|
|
308
310
|
}
|
|
309
311
|
)
|
|
310
312
|
] });
|
|
311
|
-
},
|
|
313
|
+
}, Xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
312
314
|
__proto__: null,
|
|
313
|
-
OrderPage:
|
|
315
|
+
OrderPage: xe
|
|
314
316
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
315
317
|
export {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
+
Je as O,
|
|
319
|
+
Xe as i
|
|
318
320
|
};
|