PageSourceSearch

https://app.cartsumo.com/assets/OrderFulfillments-0HB_XGMw.js

js cartsumo.com collected 2026-10-05 02:34:43 UTC 5,333 bytes, 1 lines download raw bytes

1import{p as $,d as V,r as i,R as H,e as W,f as u,C as p,j as e,F as R,i as Z,k as P,K as G}from"./index-BRUYgDZ0.js";import{L as J,l as X}from"./index-BmDI_7Yf.js";import{o as Y}from"./Helpers-UFukXBWy.js";import{S as f}from"./Sytles-BlaSVXwF.js";import{C as ee}from"./CsToastContainer-WmQShA5H.js";import{A as re}from"./address-format1-8MlKtJHY.js";import{F as x}from"./form-control-BlzcEpd7.js";import{I as L}from"./input-kmkdOBgI.js";import{S as te}from"./select-DAFEPYlm.js";import{S as se,L as ae}from"./checkbox-DGWfnH7G.js";import{C as T}from"./card-D1zlbeBo.js";import{S as ie}from"./constants-fIewqu6O.js";import{S as B}from"./skeleton-DJoRCqp2.js";import"./currency-symbol-map-C0_j1N4a.js";import"./address-formats-CgQSAc-I.js";import"./base-input-DmRVwGit.js";import"./value-CzMcFCoR.js";import"./stateful-menu-DSzfNe12.js";import"./popover-De8jBRfr.js";import"./Combination-Cvfc6Fwa.js";import"./hooks-BM4mCzXA.js";import"./layer-B9TM2HP5.js";import"./styled-components-5E6YxkEc.js";import"./tag-BCwcHbno.js";const Re=()=>{const{id:O}=$(),l=O;document.title="Order fulfillment #"+l+" - CartSumo";let g=V();const[c,j]=i.useState(),[o,E]=i.useState(),[v,q]=i.useState(""),[h,y]=i.useState([]),[n,D]=i.useState(),[C,S]=i.useState(!1),[b,K]=i.useState(!1),[M,U]=i.useState([]),[N,k]=i.useState(!1),A=H.useRef(null),m=W();let t=new J(X);t.setLanguage(localStorage.getItem("lang")?localStorage.getItem("lang"):"en"),i.useEffect(()=>{u.get(p.CARTSUMO.APIURL+"order/"+l+"/fulfillment",{headers:{Authorization:`Bearer ${m}`}}).then(r=>{j(r.data.orderedProducts),E(r.data.shippingAddress);const s={};r.data.orderedProducts.map(a=>s[a.id]=a.qty),D(s)}).catch(r=>{}),u.get(p.CARTSUMO.APIURL+"carriers",{headers:{Authorization:`Bearer ${m}`}}).then(r=>{r.data.status==="success"&&(U(r.data.carriers),r.data.selectedCarrier&&y([{carrierCode:r.data.selectedCarrier}]))})},[m,l]);const _=()=>{let r=0;for(const s in n)r+=Number(n[s]);r>0?S(!1):S(!0)},z=()=>{k(!0);const r={lineItem:n,tracking_number:v,carrier_code:h[0]?h[0].carrierCode:"",send_mail:b===!0?1:0};u.post(p.CARTSUMO.APIURL+"order/"+l+"/fulfillment",r,{headers:{Authorization:`Bearer ${m}`}}).then(s=>{s.data.status==="success"?g("/order/"+l):(k(!1),A.current.show({children:s.data.message,kind:P.negative}))}).catch(s=>{})},Q=(r,s)=>e.jsxs("div",{className:"os-fl-it",children:[e.jsx("div",{children:e.jsx("img",{src:r.thumbImg,alt:r.name})}),e.jsxs("div",{children:[r.name,Array.isArray(r.variants)&&r.variants.length?r.variants.map((a,d)=>e.jsxs("div",{className:"prd-variant",children:[a.optionName,": ",a.optionValue]},d)):null,r.addons?Object.entries(r.addons).map(([a,d])=>e.jsxs("div",{className:"prd-variant",children:[e.jsx("strong",{children:a}),": ",Y(d)]},a)):null]}),e.jsxs("div",{className:"od-fl-qt",children:[e.jsx(L,{size:ie.mini,type:"number",pattern:"\\\\d*",inputMode:"decimal",name:"input_qty",autoComplete:"off",min:"0",max:r.qty,onKeyPress:a=>a.preventDefault(),value:n?n[r.id]:"1",overrides:{Root:{style:()=>({width:"50px"})}},onChange:a=>{let d=a.target.value;j(c.map(w=>(r.id===w.id&&(n[r.id]=d),w))),_()}})," ",e.jsxs("div",{style:{marginLeft:"8px "},children:[" of ",r.qty]})]})]},s);let F=e.jsx("div",{style:{marginTop:"16px"},children:e.jsx(B,{animation:!0,rows:3,width:"100%",overrides:{Row:{style:{height:"20px",marginBottom:"15px"}}}})});o&&(F=e.jsxs("div",{children:[e.jsxs("div",{children:[o.firstName," ",o.lastName]}),e.jsx(re,{address:o}),e.jsx("div",{children:o.phone})]}));let I=e.jsx("div",{style:{marginTop:"24px"},children:e.jsx(B,{animation:!0,rows:3,width:"100%",overrides:{Row:{style:{height:"20px",marginBottom:"15px"}}}})});return c&&(I=e.jsxs("div",{children:[e.jsx("div",{children:c?c.map((r,s)=>Q(r,s)):null}),e.jsxs("div",{style:{marginTop:"10px"},children:[e.jsxs("h3",{children:[t.trackingInformation," ",e.jsxs("span",{style:{color:"var(--color-text-secondary)"},children:["(",t.optional,")"]})]}),e.jsxs("form",{children:[e.jsx(x,{label:t.trackingNumber,caption:"",children:e.jsx(L,{name:"tracking_number",autoComplete:"off",onChange:r=>q(r.target.value),value:v})}),e.jsx(x,{label:t.shippingCarrier,caption:"",children:e.jsx(te,{clearable:!0,options:M,labelKey:"carrierName",valueKey:"carrierCode",value:h,searchable:!0,placeholder:t.selectCarrier,onCh
1ange:r=>y(r.value)})}),e.jsx(x,{children:e.jsx(se,{checked:b,onChange:r=>K(r.target.checked),labelPlacement:ae.right,children:t.sendShipmentDetails})}),e.jsx(R,{type:"button",disabled:C||N,onClick:()=>{z()},children:N?t.pleaseWait:t.update})]})]})]})),e.jsxs("div",{className:"cl-bd-ct",children:[e.jsx("h2",{children:t.fulfillment}),e.jsxs("div",{className:"row",children:[e.jsx("div",{className:"col-8 cs-mt-4",children:e.jsxs(T,{overrides:f.CardOverrides,children:[C?e.jsx(Z,{overrides:{Body:{style:{width:"auto"}}},kind:P.warning,children:t.fulfillItemMessage}):null,I]})}),e.jsx("div",{className:"col-4 right cs-mt-4",children:e.jsxs(T,{overrides:f.CardOverrides,children:[e.jsxs("div",{children:[e.jsx("div",{style:{float:"left"},children:e.jsx("b",{children:t.shippingAddress})}),e.jsx("div",{style:{float:"right"}})]}),e.jsx("div",{style:{clear:"both"}}),F]})})]}),e.jsx(ee,{ref:A}),e.jsx("div",{className:"cs-fx-bt",children:e.jsx(R,{kind:G.secondary,onClick:()=>g("/order/"+l),overrides:f.BackButton,children:t.backToOrder})})]})};export{Re as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.