@billgangcom/theme-lib 1.125.13 → 1.127.0
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-Bzjt7KtK.js → builder-DbBnEh3U.js} +5 -5
- package/dist/{builder-DNkh9C7C.cjs → builder-FlfTMOiQ.cjs} +2 -2
- package/dist/{builder-components-BT94OMxj.js → builder-components-BApQHlfu.js} +4 -4
- package/dist/{builder-components-BPLuh4_V.cjs → builder-components-C6nG2kYo.cjs} +1 -1
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +23 -23
- package/dist/{charge-IRYuGcrW.js → charge-CEnroh9b.js} +5606 -5408
- package/dist/charge-DQqXA24M.cjs +115 -0
- package/dist/{checkout-DVDZUjSQ.cjs → checkout-CKWBwYzA.cjs} +1 -1
- package/dist/{checkout-HR4DQ03v.js → checkout-DpOpLTYJ.js} +5 -5
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-D_4T-1DY.js → index--4kpy6DG.js} +5 -5
- package/dist/{index-YbQOTLgG.js → index-5AMPUrPw.js} +5 -5
- package/dist/{index-BnK6yyve.cjs → index-BWqwYf77.cjs} +1 -1
- package/dist/{index-Cgb3a13j.cjs → index-BvPCswts.cjs} +1 -1
- package/dist/{index-CJUkTBLE.cjs → index-CAhSMxcR.cjs} +1 -1
- package/dist/{index-823ih-5Z.cjs → index-CNl0hs7D.cjs} +1 -1
- package/dist/{index-D-eLh7F3.js → index-DlvpmC0X.js} +5 -5
- package/dist/{index-C7x0OpAC.js → index-DuhU_G_L.js} +1 -1
- package/dist/{index-CcqCOl2W.cjs → index-GUvAgH0Q.cjs} +1 -1
- package/dist/{index-jRrTJd8O.js → index-QEntiOo_.js} +5 -5
- package/dist/{index-CKCeewPh.js → index-YcPB7Mhe.js} +2 -2
- package/dist/{index-iwVyWU-s.cjs → index-beXlgnJA.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/order-2yMPhYdK.cjs +1 -0
- package/dist/{order-D7jXnkto.js → order-DA6bx3MX.js} +39 -38
- package/dist/src/pages/balance/bonus-tiers.d.ts +21 -0
- package/dist/src/pages/balance/bonus-utils.d.ts +23 -0
- package/dist/src/storefront/components/DeliveryItem/index.d.ts +1 -0
- package/dist/src/storefront/models/balance.d.ts +6 -0
- package/dist/src/storefront/models/checkout.d.ts +2 -1
- package/dist/src/storefront/models/order.d.ts +6 -0
- package/dist/style.css +1 -1
- package/dist/{subscription-B2aLt7q1.js → subscription-Gua672Jm.js} +5 -5
- package/dist/{subscription-B_fwssFU.cjs → subscription-hSsSCaMq.cjs} +1 -1
- package/dist/{ticket-Bj-AhEbz.js → ticket-Bo8KyxXg.js} +5 -5
- package/dist/{ticket-C30ck-ZN.cjs → ticket-CjHl2fUT.cjs} +1 -1
- package/dist/{top-up-CcPvJDbi.js → top-up-DaR2Khtl.js} +5 -5
- package/dist/{top-up-IOt4GUoS.cjs → top-up-TXCm0-cC.cjs} +1 -1
- package/dist/{ui-components-BVI8UP6Y.cjs → ui-components-BAslp_hx.cjs} +1 -1
- package/dist/{ui-components-Blu-gh32.js → ui-components-vOXufedG.js} +4 -4
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-BNISByXK.js → validation-DMRsjClx.js} +5 -5
- package/dist/{validation-CrG8xYNb.cjs → validation-DRUFbc2c.cjs} +1 -1
- package/package.json +1 -1
- package/dist/charge-C2aoqar4.cjs +0 -115
- package/dist/order-CGQ2_eCJ.cjs +0 -1
package/dist/order-CGQ2_eCJ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),r=require("react"),O=require("./builder-DNkh9C7C.cjs"),s=require("./charge-C2aoqar4.cjs"),C=require("./ui-components-BVI8UP6Y.cjs");require("./builder-components-BPLuh4_V.cjs");require("react-dom");require("./ticket-C30ck-ZN.cjs");const K=async(n=1)=>await s.fetchOrders({PageNumber:n}),Q=()=>{const[n,l]=r.useState(null),[d,e]=r.useState(null),[p,g]=r.useState(0),{page:m}=O.usePaginationPagesStore(),[f,_]=r.useState(!0);async function j(){_(!0);const{list:S,totalCount:u}=await K(m);l(S),g(u),e(null),_(!1)}async function y(){const S=(n==null?void 0:n.map(c=>c.gatewayName))||[],u=await s.getGatewaysDetail(S);e(u)}return r.useEffect(()=>{!d&&n&&y()},[n,d]),r.useEffect(()=>{j()},[m]),t.jsx(t.Fragment,{children:n!=null&&n.length&&n.length===0?t.jsx(s.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(s.PageTitle,{title:"Orders"}),t.jsx(s.OrdersTable,{orders:n,gatewaysDetail:d,totalCount:p,isLoading:f})]})})},X="_orderPage_gc87l_1",Y="_leftSection_gc87l_15",Z="_content_gc87l_35",ee="_main_gc87l_42",te="_mainAntistock_gc87l_56",se="_orderMainDataAntistock_gc87l_69",ne="_timelineBlockAntistock_gc87l_81",ae="_footerAntistock_gc87l_92",oe="_statusBlock_gc87l_104",ie="_timelineBlock_gc87l_81",ce="_footer_gc87l_92",re="_rightSection_gc87l_121",le="_header_gc87l_142",ue="_productList_gc87l_150",de="_mobileFooter_gc87l_157",me="_loaderContainer_gc87l_166",he="_orderMainData_gc87l_69",ge="_prices_gc87l_181",fe="_headerTitle_gc87l_185",pe="_headerDescription_gc87l_189",i={orderPage:X,leftSection:Y,content:Z,main:ee,mainAntistock:te,orderMainDataAntistock:se,timelineBlockAntistock:ne,footerAntistock:ae,statusBlock:oe,timelineBlock:ie,footer:ce,rightSection:re,header:le,productList:ue,mobileFooter:de,loaderContainer:me,orderMainData:he,prices:ge,headerTitle:fe,headerDescription:pe},_e=n=>{if(!n)return null;const l=n.split(":");if(l.length!==3)return null;const[d,e,p]=l,g=Number(d),m=Number(e),f=Number(p);return Number.isNaN(g)||Number.isNaN(m)||Number.isNaN(f)?null:((g*60+m)*60+f)*1e3},ye=()=>{var A,R,M,T,F,E,I,V,B;const{id:n,accessToken:l}=O.useParams(),d=O.useNavigate(),[e,p]=r.useState(),[g,m]=r.useState(!1),[f,_]=r.useState(!1),[j,y]=r.useState(!1),S=s.useCopy(),{isAntistock:u,general:c}=O.useGeneralStore(),G=((A=e==null?void 0:e.rawPrice)==null?void 0:A.currency)||"USD",U=new Intl.NumberFormat("en-US",{style:"currency",currency:G}),D=r.useMemo(()=>{var h;const a=_e((e==null?void 0:e.estimatedProcessingTime)??null),N=(h=e==null?void 0:e.timeline)==null?void 0:h[s.OrderStatus.Processing],P=(e==null?void 0:e.status)===s.OrderStatus.Processing&&N&&a?{processingStartTime:new Date(N),expectedProcessingMs:a,processingExpiresAt:e!=null&&e.processingExpiresAt?new Date(e.processingExpiresAt):void 0}:null;return(e==null?void 0:e.partOrders.map(o=>{var x,$,q;return{id:Number((x=o.productWithVariant)==null?void 0:x.id)||0,partOrderId:Number(o==null?void 0:o.id)||0,image:o.productWithVariant.image,name:(()=>{var L,W;const v=((L=o.productWithVariant)==null?void 0:L.name)||"",k=((W=o.productWithVariant)==null?void 0:W.variantName)||"";return!v&&!k?"":!k||v===k?v:v?`${v} (${k})`:k})(),description:"",price:{quantity:o.quantity,amount:(($=o.productWithVariant)==null?void 0:$.price.amount)||0,currency:(q=o.productWithVariant)==null?void 0:q.price.currency},deliveryCategories:"deliveryCategories"in o?o.deliveryCategories:void 0,customerNote:o.customerNote,chargeType:o.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in o?o.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in o?o.allowedReplacementReasons:void 0,processingInfo:P}}))||[]},[e]);r.useEffect(()=>{e&&(e.status===s.OrderStatus.FullDeliveryFailure||e.status===s.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&_(!0)},[e==null?void 0:e.status]);const w=r.useCallback(async(a,N,P=!1)=>{var o,x;P||m(!0);const{data:h}=await(N?s.fetchAuthorizedOrder(`${a}/${N}`):s.fetchOrder(a));m(!1),h.status!==s.OrderStatus.Completed&&((o=h.charge)==null?void 0:o.status)===s.ChargeStatus.NotPaid&&d(`/charges/${(x=h.charge)==null?void 0:x.id}`,{replace:!0}),p(h)},[d]);r.useLayoutEffect(()=>{if(n&&!l){const a=JSON.parse(localStorage.getItem("orders")||"{}");a[n]&&d(`/orders/${n}/${a[n].fullAccessToken}`)}},[n,l,d]),r.useEffect(()=>{n&&w(n,l,!0);const a=setInterval(()=>{n&&w(n,l,!0)},5e3);return()=>{clearInterval(a)}},[n,l,w]);const z=r.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===s.OrderStatus.Completed||e.status===s.OrderStatus.PartiallyDelivered||e.status===s.OrderStatus.FullDeliveryFailure)),[e]),b=r.useMemo(()=>{var a;return!!((a=c==null?void 0:c.info)!=null&&a.isVouchesEnabled&&l&&((e==null?void 0:e.status)===s.OrderStatus.Completed||(e==null?void 0:e.status)===s.OrderStatus.FullDeliveryFailure||(e==null?void 0:e.status)===s.OrderStatus.PartiallyDelivered))},[(R=c==null?void 0:c.info)==null?void 0:R.isVouchesEnabled,l,e==null?void 0:e.status]),H=r.useMemo(()=>{var a;return!!(!((a=c==null?void 0:c.info)!=null&&a.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!u)},[(M=c==null?void 0:c.info)==null?void 0:M.isVouchesEnabled,e==null?void 0:e.review,u]),J=r.useMemo(()=>{var a;return((a=c==null?void 0:c.info)==null?void 0:a.domain)||window.location.hostname},[(T=c==null?void 0:c.info)==null?void 0:T.domain]);return g?t.jsx("div",{className:i.loaderContainer,children:t.jsx(C.Loader,{})}):(console.log("ORDER PAGE"),console.log(e),t.jsxs("div",{className:i.orderPage,children:[t.jsx("div",{className:i.leftSection,children:t.jsxs("div",{className:i.content,children:[t.jsx(s.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${i.main} ${u?i.mainAntistock:""}`,children:[t.jsx(s.OrderStatusBlock,{className:i.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${i.orderMainData} ${u?i.orderMainDataAntistock:""}`,children:[b&&t.jsx(s.VouchCard,{onAddMessage:()=>y(!0),isVouchLeft:e.isVouchLeft}),t.jsx(s.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(F=e.charge)==null?void 0:F.gateway,email:e.customer?e.customer.email:((E=e.charge)==null?void 0:E.customerForCharge.email)||"",orderId:e.id}),H&&e.review&&t.jsx(s.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(s.TrackPayment,{className:`${i.timelineBlock} ${u?i.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(s.CheckoutFooter,{className:`${i.footer} ${u?i.footerAntistock:""}`})]})]})}),t.jsx("div",{className:i.rightSection,style:u?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:i.content,children:[((I=e==null?void 0:e.charge)==null?void 0:I.name)&&t.jsxs("header",{className:i.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:i.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:i.headerDescription,children:e.charge.description})]}),u?null:t.jsxs(C.Button,{type:"Secondary",onClick:()=>S((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(C.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:i.productList,children:D.map(a=>t.jsx(s.CheckoutProduct,{product:a,isOrder:!0,isApplicableForReplacement:z,orderId:n,accessToken:l,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},a.id))}),u?null:t.jsx(s.CheckoutPrices,{formatter:U,coupon:null,total:((V=e==null?void 0:e.endPrice)==null?void 0:V.amount)||0,discount:0,totalWithDiscount:((B=e==null?void 0:e.endPrice)==null?void 0:B.amount)||0,className:i.prices,isShowSubtotal:!1}),t.jsx(s.CheckoutFooter,{className:i.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(s.RefundNotificationModal,{isOpen:f,onClose:()=>_(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),b&&t.jsx(s.VouchModal,{isOpen:j,onClose:()=>y(!1),products:D,orderId:n,accessToken:l,shopDomain:J,onSuccess:()=>{y(!1),n&&w(n,l,!0)}})]}))},Se=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:ye},Symbol.toStringTag,{value:"Module"}));exports.Orders=Q;exports.index=Se;
|