1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="05019195-6e45-5ffa-aa36-9e76f838eb9b")}catch(e){}}(); 2import{e as Ye,q as Pe,V as He,r as i,ab as Oe,j as e,W as Me,N as Ne,X as qe,Y as Qe,c as we,s as Fe,k as J,n as d,Z as se,m as Xe,$ as Re,a0 as me,a1 as xe,B as ue,a2 as Ze,ft as Ve,a3 as et,o as le,u as tt,ag as st,A as Le,a8 as ke,F as lt}from"./index-DmqEQZ_1.js";import{E as ot}from"./empty-shipment-0z4UaUEC.js";import{C as Be}from"./CustomEmptyState-t0kq3jiO.js";import{C as it}from"./IndexTableCell-C9o6fpFn.js";import{F as nt,T as Ue,S as at}from"./TableListPaginator-CK5HvAHX.js";import{d as A,u as rt,e as ct}from"./ShipmentsContext-DBzh8UO2.js";import{F as o,M as pt}from"./types-BWwAlU9l.js";import{T as ht}from"./index-CFwoekT3.js";import{u as mt,O as ve}from"./useCountryListFilterOptions-CKVJU3qI.js";import{T as ut}from"./TableListClearAllFiltersButton-DlTFT1wp.js";import{u as dt}from"./useConnectedStoreOptions-WzZ30A_b.js";import{u as bt}from"./useOrgCarrierServiceOptions-DbK4lkm6.js";import{u as gt}from"./useShipmentTagOptions-Bs4s7X_O.js";import{S as Ae}from"./useCanBuyShipment-FiWph9Wz.js";import{S as de}from"./sortOrder-CV10GBqu.js";import"./SkeletonDisplayText-6JVwGM8Z.js";import"./SkeletonBodyText-DISN5OIt.js";import"./SkeletonThumbnail-CUsX453v.js";import"./shipmentStatus-D7BvCoWo.js";import"./useDateRangePicker-jUwaBI32.js";import"./useIndexTableSelectionState-D3KujluR.js";import"./usePaginationMetadata-Bc3tMKhH.js";import"./connectedStoreFilterType-qLEqpdoF.js";import"./omit-Ccfueyna.js";import"./_baseUnset-DvIg8w3J.js";import"./last-DXTTfs9a.js";import"./CloneShipmentModal-8GcME8dL.js";import"./index-BonSJHFD.js";import"./index-Bva9GOhg.js";import"./useSavedAddressFormSchema-BYlwobvn.js";import"./index-esm-C4bmqvkG.js";import"./index-DCgKM3kH.js";import"./countries-BhE82V1V.js";import"./_createAggregator-B587KDqf.js";import"./option-DVC9NjBR.js";import"./CountrySelect-Cz3cDhHn.js";import"./useCountryOptions-hLpn5iu0.js";import"./TagList-blaORFTO.js";import"./index-DfZCYHDy.js";import"./CustomPhoneInput-BDQtLkB6.js";import"./groupBy-DBLwNMIR.js";import"./useShipmentCountrySelectProps-DH21ong4.js";import"./addressType-Dq-BWODb.js";import"./useCountryErrorMap-CcReXmob.js";import"./dedupeSuggestedAddresses-CNnrC5NF.js";import"./resolveAddressValidationMessages-J2Nq605t.js";import"./EditShipmentTagsModal-B5LzqRvt.js";import"./ShipmentTagsSelect-C1X_tELp.js";import"./useCarrierLogo-BBrwri0x.js";import"./empty-CmuRKk3V.js";import"./useCountry-C6qYWgzP.js";import"./index-DrsEE8wW.js";import"./SsCare-DjqZHPOn.js";import"./PaymentRow-DM8uQo8g.js";import"./validateAddressCompleteness-CVsSj-B9.js";import"./index-SH1odjlJ.js";import"./zonos-logo-CKwfRRSC.js";import"./AddressIndicator-CtwOqNDj.js";import"./FeatureIndicatorsStack-DrcxmfPf.js";import"./CustomCarrierAccount-CkgVtrdQ.js";import"./ShipmentTagsSection-BKOIB7EP.js";import"./merchantOfRecord-DdjkzC68.js";import"./shipment-BFTbbL-x.js";import"./ReturnShipmentIndicator-ClSKjtNF.js";import"./shippingChannel-GpNxDmE8.js";import"./TableListCell-Cq8m54rn.js";import"./quotationSelectionStrategy-BnXm6c0u.js";import"./CriticalTooltip-Da6VGGqX.js";import"./RiskMinor.svg-DPmRfNw-.js";import"./DeleteMinor.svg-zwVoOOMX.js";import"./package-Cefcpvov.js";import"./MobileIndexTableWrapper-DMPHdq70.js";import"./bucket-10-B1mB5QUF.js";import"./carrier-services-qYSKLoQ3.js";const je=Object.freeze(["sender","receiver","packages","status"]),D=le("div",{target:"e1nd6ben2"})({name:"1t435p1",styles:".Polaris-OptionList{padding:0;.Polaris-Box{border:none;padding:0;}.Polaris-OptionList__Title,.Polaris-OptionList-Option__Label{padding-left:0;padding-right:0;}}"}),$e=le("div",{target:"e1nd6ben1"})({name:"xh0ihz",styles:"& .Polaris-Button__Icon{line-height:0;}"}),Ge=le("div",{target:"e1nd6ben0"})({name:"1j6ew5d",styles:"& .Polaris-ActionList__Item.Polaris-ActionList--active svg{fill:var(--p-icon-success);}"}),Ct=({searchInput:h,statusFilter:p,senderCountryFilter:$,receiverCountryFilter:s,carrierServiceFilter:a,connectedStoreFilter:m,shipmentTagIdFilter:f,dateRangeFilter:S,formattedDateRangeFilter:u,dateRangeMonthYear:K,disableDates:_,sortField:L,sortOrder:N,onQueryChange:oe,onQueryClear:C,onStatusFilterChange:I,onStatusFilterClear:E,onSenderCountryFilterChange:w,onSenderCountryFilterClear:T,onReceiverCountryFilterChange:x,onReceiverCountryFilterClear:y,onCarrierServiceFilterChange:V,onCarrierServiceFilterClear:k,onConnectedStoreFilterChange:B,onConnectedStoreFilterClear:v,onShipmentTagIdFilterChange:U,onShipmentTagIdFilterClear:j,onDateRangeFilterChange:be,onDateRangeFilterClear:G,onDateRangeMonthYearChange:ge,columnsVisibility:ie,onColumnsVisibilityChange:q,onSortFieldChange:P,onSortOrderChange:Y})=>{const{t}=Ye(),{countriesByContinent:O,countries:Q}=mt(),{carrierServices:ne,carrierServicesGroupedByCarrierName:Ce}=bt(),{connectedStoreOptions:F}=dt(),{shipmentTagOptions:X}=gt(),{value:ae,setFalse:H,toggle:M}=Pe(!1),{value:re,setFalse:Z,toggle:ee}=Pe(!1),te=He(),fe=[Ae.closed_by_store,Ae.cancelled_by_store,Ae.cancel_by_order_sync_condition_unmet],ce=i.useMemo(()=>{const n=[];if(p&&p.length>0){const r=p.slice(0,3),b=p.slice(3),g=t(`pages.shipments.tableList.filters.${o.STATUS}.label`),c=r.map(z=>t(`pages.shipments.tableList.columns.status.options.${Oe(z)}.label`));n.push({key:o.STATUS,label:p.length>3?`${g}: ${c.join(", ")} ${t("pages.shipments.tableList.filters.andWithCount",{count:b.length})}`:`${g}: ${c.join(", ")}`,onRemove:E})}if(u!=null&&u.start&&u.end&&n.push({key:o.DATE_RANGE,label:`${t(`pages.shipments.tableList.filters.${o.DATE_RANGE}.label`)}: ${u.start} - ${u.end}`,onRemove:G}),a&&a.length>0){const r=a.slice(0,3).map(c=>{var z;
2return((z=ne.find(Ee=>Ee.value===c))==null?void 0:z.label)??c}).join(", "),b=a.slice(3),g=t(`pages.shipments.tableList.filters.${o.CARRIER_SERVICE}.label`);n.push({key:o.CARRIER_SERVICE,label:a.length>3?`${g}: ${r} ${t("pages.shipments.tableList.filters.andWithCount",{count:b.length})}`:`${g}: ${r}`,onRemove:k})}if($&&$.length>0&&n.push({key:o.SENDER_COUNTRY,label:`${t(`pages.shipments.tableList.filters.${o.SENDER_COUNTRY}.label`)}: ${Q.filter(r=>$.includes(r.value)).map(r=>r.label).join(", ")}`,onRemove:T}),s&&s.length>0&&n.push({key:o.RECEIVER_COUNTRY,label:`${t(`pages.shipments.tableList.filters.${o.RECEIVER_COUNTRY}.label`)}: ${Q.filter(r=>s.includes(r.value)).map(r=>r.label).join(", ")}`,onRemove:y}),m&&m.length>0){const r=m.slice(0,3),b=`${t(`pages.shipments.tableList.filters.${o.ORDER_SOURCE}.label`)}: ${F.filter(c=>r.includes(c.value)).map(c=>c.label).join(",")}`,g=m.slice(3);n.push({key:o.ORDER_SOURCE,label:m.length>3?`${b} ${t("pages.shipments.tableList.filters.andWithCount",{count:g.length})}`:b,onRemove:v})}if(f&&f.length>0){const r=f.slice(0,3),b=`${t(`pages.shipments.tableList.filters.${o.SHIPMENT_TAG}.label`)}: ${X.filter(c=>r.includes(c.value)).map(c=>c.label).join(", ")}`,g=f.slice(3);n.push({key:o.SHIPMENT_TAG,label:f.length>3?`${b} ${t("pages.shipments.tableList.filters.andWithCount",{count:g.length})}`:b,onRemove:j})}return n},[p,u.start,u.end,a,$,s,m,f,t,E,G,k,ne,Q,T,y,F,v,X,j]),pe=i.useMemo(()=>[{title:t("pages.shipments.tableList.sorters.title"),items:[{prefix:e(Me,{label:!0,checked:L===A.created_at}),content:t("pages.shipments.tableList.sorters.fields.createdAt.label"),onAction:()=>P(A.created_at)},{prefix:e(Me,{label:!0,checked:L===A.order_ref}),content:t("pages.shipments.tableList.sorters.fields.orderRef.label"),onAction:()=>P(A.order_ref)}]},{items:[{prefix:e(qe,{fill:"#006D41"}),active:N===de.asc,content:Ne(L).with(A.created_at,()=>t("pages.shipments.tableList.sorters.orders.oldestFirst.label")).with(A.order_ref,()=>t("pages.shipments.tableList.sorters.orders.aToZ.label")).exhaustive(),onAction:()=>Y(de.asc)},{prefix:e(Qe,{}),active:N===de.desc,content:Ne(L).with(A.created_at,()=>t("pages.shipments.tableList.sorters.orders.newestFirst.label")).with(A.order_ref,()=>t("pages.shipments.tableList.sorters.orders.zToA.label")).exhaustive(),onAction:()=>Y(de.desc)}]}],[P,Y,L,N,t]),Se=i.useCallback(()=>{C(),we.track({event:"listing_search_keyword_cleared",properties:void 0})},[C]),he=i.useCallback(()=>{C(),E(),T(),y(),G(),k(),v(),j(),we.track({event:"listing_search_all_filters_cleared",properties:void 0})},[k,v,j,T,y,G,C,E]),_e=Fe();return J(d,{spacing:"loose",children:[e(d.Item,{fill:!0,children:J(d,{spacing:"tight",children:[e(d.Item,{fill:!0,children:e(nt,{filters:[{key:o.STATUS,label:t(`pages.shipments.tableList.filters.${o.STATUS}.label`),filter:e(D,{children:e(se,{allowMultiple:!0,selected:p,options:fe.map(n=>({label:t(`pages.shipments.tableList.columns.status.options.${Oe(n)}.label`),value:n})),onChange:I})}),shortcut:!0},{key:o.DATE_RANGE,label:t(`pages.shipments.tableList.filters.${o.DATE_RANGE}.label`),filter:e(Xe,{allowRange:!0,multiMonth:!0,month:K.month,year:K.year,selected:S?{start:S==null?void 0:S.start.toJSDate(),end:S==null?void 0:S.end.toJSDate()}:void 0,disableDatesBefore:_==null?void 0:_.before.toJSDate(),disableDatesAfter:_==null?void 0:_.after.toJSDate(),onMonthChange:ge,onChange:be}),shortcut:!0},{key:o.CARRIER_SERVICE,label:t(`pages.shipments.tableList.filters.${o.CARRIER_SERVICE}.label`),filter:e(D,{children:e(se,{allowMultiple:!0,selected:a??[],sections:Object.entries(Ce).map(([n,r])=>({title:n,options:r})),onChange:V})}),shortcut:!0},{key:o.SENDER_COUNTRY,label:t(`pages.shipments.tableList.filters.${o.SENDER_COUNTRY}.label`),filter:e(D,{children:e(ve,{labelHidden:!0,allowMultiple:!0,label:t("form.fields.country.label"),placeholder:t("form.fields.country.placeholder"),selected:$??[],sections:O,onChange:w})}),hideClearButton:!0,shortcut:!0},{key:o.RECEIVER_COUNTRY,label:t(`pages.shipments.tableList.filters.${o.RECEIVER_COUNTRY}.label`),filter:e(D,{children:e(ve,{labelHidden:!0,allowMultiple:!0,label:t("form.fields.country.label"),placeholder:t("form.fields.country.placeholder"),selected:s??[],sections:O,onChange:x})}),hideClearButton:!0,shortcut:!0},{key:o.ORDER_SOURCE,label:t(`pages.shipments.tableList.filters.${o.ORDER_SOURCE}.label`),filter:e(D,{children:e(se,{allowMultiple:!0,selected:m??[],options:F,onChange:B})}),shortcut:!0},{key:o.SHIPMENT_TAG,label:t(`pages.shipments.tableList.filters.${o.SHIPMENT_TAG}.label`),filter:e(D,{children:e(ve,{labelHidden:!0,allowMultiple:!0,label:t("form.fields.shipmentTags.label"),placeholder:t("form.fields.shipmentTags.placeholder.search"),selected:f??[],sections:[{options:X}],onChange:U})}),hideClearButton:!0,shortcut:!0}],appliedFilters:ce,queryValue:h,queryPlaceholder:t("pages.shipments.tableList.filters.searchField.placeholder"),onQueryChange:oe,onQueryClear:Se,onClearAll:he})}),!te&&e(d.Item,{children:J(d,{spacing:"tight",children:[e(d.Item,{children:e($e,{children:e(Re,{segmented:!0,children:e(me,{active:re,activator:e(ue,{onClick:ee,
2icon:e(Ze,{size:20})}),onClose:Z,children:e(Ge,{children:e(xe,{sections:pe})})})})})}),e(d.Item,{children:e($e,{children:e(Re,{segmented:!0,children:e(me,{active:ae,onClose:H,activator:e(ue,{onClick:M,icon:e(Ve,{size:20})}),children:e(se,{allowMultiple:!0,onChange:q,options:je.map(n=>({label:t(`pages.shipments.tableList.columns.${n}.label`),value:n})),selected:ie})})})})})]})}),te&&e(d.Item,{children:e(d,{spacing:"tight",children:e(d.Item,{children:e($e,{children:J(Re,{segmented:!0,children:[e(me,{active:ae,onClose:H,activator:e(ue,{onClick:M,icon:e(Ve,{size:20})}),children:e(se,{allowMultiple:!0,onChange:q,options:je.map(n=>({label:t(`pages.shipments.tableList.columns.${n}.label`),value:n})),selected:ie})}),e(me,{active:re,activator:e(ue,{onClick:ee,icon:e(et,{size:20})}),onClose:Z,children:e(Ge,{children:e(xe,{sections:pe})})})]})})})})})]})}),_e&&e(d.Item,{children:e(ut,{disabled:h.trim()===""&&ce.length===0,onClick:he})})]})},ft=le("div",{target:"e11h8td01"})({name:"2ewnbj",styles:"padding:14px 14px 14px 20px"}),St=le("div",{target:"e11h8td00"})(({$isMobile:h})=>h&&` 3 .Polaris-IndexTable__StickyTable--condensed { 4 border-bottom: 1px solid var(--p-border-subdued); 5 } 6 7 .Polaris-IndexTable--condensedRow { 8 border-top: 0; 9 border-bottom: 8px solid var(--p-surface-neutral-subdued); 10 } 11 12 .Polaris-IndexTable--condensedRow:last-child { 13 border-bottom: 0; 14 }`,";"),_t=()=>{const{t:h}=Ye(),{userOrgConfigs:p}=tt(),{draftShipmentsCancelledPageValue:$}=rt(),{shipmentsData:s,cachedMetadata:a,dateRangeFilter:m,isShipmentsDataLoading:f,isShipmentsDataFetching:S,refetchShipmentsData:u,currentPageIndex:K,currentPerPage:_,handlePageChange:L,handlePagePrevious:N,handlePageNext:oe,searchKeyword:C,setSearchKeyword:I,statusFilter:E,setStatusFilter:w,senderCountryFilter:T,setSenderCountryFilter:x,receiverCountryFilter:y,setReceiverCountryFilter:V,carrierServiceFilter:k,setCarrierServiceFilter:B,connectedStoreFilter:v,setConnectedStoreFilter:U,dateRangeMonthYear:j,formattedDateRangeFilter:be,disableDates:G,setDateRangeFilter:ge,setDateRangeMonthYear:ie,resetDateRangeFilter:q,selectedResources:P,handleSelectionChange:Y,clearSelection:t,columnsVisibility:O,setColumnsVisibility:Q,areAllResourcesSelectedForThisPage:ne,sortField:Ce,setSortField:F,sortOrder:X,setSortOrder:ae,shipmentTagIdFilter:H,setShipmentTagIdFilter:M}=$,re=S,Z=i.useMemo(()=>{const l=["orderReference","status","receiver"];return p!=null&&p.isSmartyAddressValidationEnabled&&l.push("addressValidations"),l.push("carrierService","featureIndicators","paymentAmount","packages","sender","orderSource","ssid","actions"),l},[p==null?void 0:p.isSmartyAddressValidationEnabled]),ee=i.useMemo(()=>{const l=Z,W=ct.filter(R=>!O.includes(R)&&l.includes(R));return l.filter(R=>!W.includes(R)).map((R,ye)=>({id:`${ye}-heading`,title:h(`pages.shipments.tableList.columns.${R}.label`,"")}))},[h,O,Z]),te=i.useCallback(()=>{t()},[t]),fe=i.useCallback(l=>{I(l)},[I]),ce=i.useCallback(()=>{I("")},[I]),pe=i.useCallback(l=>{w(l)},[w]),Se=i.useCallback(()=>{w([])},[w]),he=i.useCallback(l=>{x(l)},[x]),_e=i.useCallback(()=>{x([])},[x]),n=i.useCallback(l=>{V(l)},[V]),r=i.useCallback(()=>{V([])},[V]),b=i.useCallback(()=>{q()},[q]),g=i.useCallback(l=>{B(l)},[B]),c=i.useCallback(()=>{B([])},[B]),z=i.useCallback(l=>{U(l)},[U]),Ee=i.useCallback(()=>{U([])},[U]),ze=i.useCallback(l=>{M(l)},[M]),We=i.useCallback(()=>{M([])},[M]),Te=i.useMemo(()=>((s==null?void 0:s.meta.total)??0)>_,[_,s==null?void 0:s.meta.total]),De=i.useMemo(()=>{const l=[];return Te&&l.push({content:h("pages.shipments.tableList.bulkActions.cancelSelection"),onAction:te}),l},[te,Te,h]),Je=i.useMemo(()=>((s==null?void 0:s.items)??[]).length>0||C||E.length>0||T.length>0||y.length>0||m||k.length>0||v.length>0||H.length>0,[k.length,v.length,H.length,m,T.length,y.length,C,s==null?void 0:s.items,E.length]);st(()=>{I(C)},500,[]);const Ie=He();return J(lt,{children:[Je&&e(Le.Section,{children:e(Ct,{searchInput:C,statusFilter:E,senderCountryFilter:T,receiverCountryFilter:y,carrierServiceFilter:k,connectedStoreFilter:v,shipmentTagIdFilter:H,dateRangeFilter:m,formattedDateRangeFilter:be,dateRangeMonthYear:j,disableDates:G,columnsVisibility:O,sortField:Ce,sortOrder:X,onQueryChange:fe,onQueryClear:ce,onStatusFilterChange:pe,onStatusFilterClear:Se,onCarrierServiceFilterChange:g,onCarrierServiceFilterClear:c,onConnectedStoreFilterChange:z,onConnectedStoreFilterClear:Ee,onShipmentTagIdFilterChange:ze,onShipmentTagIdFilterClear:We,onSenderCountryFilterChange:he,onSenderCountryFilterClear:_e,onReceiverCountryFilterChange:n,onReceiverCountryFilterClear:r,onDateRangeFilterChange:ge,onDateRangeFilterClear:b,onDateRangeMonthYearChange:ie,onColumnsVisibilityChange:Q,onSortFieldChange:F,onSortOrderChange:ae})}),!!(s!=null&&s.items.length)&&e(Le.Section,{flush:!0,children:e(ft,{children:e(Ue,{currentItemsCount:(s==null?void 0:s.items.length)??0,totalItemsCount:(a==null?void 0:a.total)??0,currentPageIndex:K,totalPagesCount:(a==null?void 0:a.lastPage)??0,onPageChange:L,onPreviousPage:N,onNextPage:oe})})}),e(St,{$isMobile:Ie,children:J(it,{lastColumnSticky:!0,itemCount:(s==null?void 0:s.meta.total)??1,selectedItemsCount:ne?"All":P.length,headings:ee,loading:f||re,resourceName:{singular:"",plural:""},onSelectionChange:Y,promotedBulkActions:De,condensed:Ie,emptyState:C.length||!ke(E)||!ke(T)||!ke(y)||m?e(Be,{title:h("pages.shipments.emptyState.notFound.title")}):e(Be,{title:h("pages.shipments.emptyState.draft.title"),desc:h("pages.shipments.emptyState.draft.desc"),image:ot}),children:[!s&&Array.from({length:10}).map((l,W)=>e(at,{index:W,columns:ee.length},W)),s==null?void 0:s.items.map((l,W)=>{const R=!!P.find(Ke=>Ke.id===l.id),ye=()=>{Y("all",!1,l.id),u()};return e(ht,{columnsVisibility:O,shipment:l,index:W,selected:R,disabled:P.length>=pt&&!R,onBuy:u,onDeleted:ye,refetch:u},l.id)})]})}),Te&&e(Le.Section,{children:e(Ue,{currentItemsCount:(s==null?void 0:s.items.length)??0,totalItemsCount:(a==null?void 0:a.total)??0,currentPageIndex:K,totalPagesCount:(a==null?void 0:a.lastPage)??0,onPageChange:L,onPreviousPage:N,onNextPage:oe})})]})},Gs=i.memo(_t);export{Gs as default}; 15//# debugId=05019195-6e45-5ffa-aa36-9e76f838eb9b 16//# sourceMappingURL=index-CONtksqa.js.map
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.