1"use strict";(self.webpackChunk_vndr_ship_client=self.webpackChunk_vndr_ship_client||[]).push([[6084],{24122(e,l,i){i.d(l,{A:()=>o});i(67252);var t=i(84489),n=i(28872);const o=e=>{let l=e.show,i=e.entity,o=e.rows,a=e.handleClose,s=e.handleSubmit,d=e.allFilterOrdersSelected,c=e.customText;return(0,n.jsx)(t.aF,{maxWidth:"xs",open:l,title:"Delete ".concat(i),handleClose:a,actions:[{isClose:!0,label:"Cancel"},{onClick:s,label:"Confirm Delete",color:"error"}],children:(0,n.jsx)("div",{children:c||(d?(0,n.jsxs)(t.o5,{children:["All ",(0,n.jsx)("b",{children:i})," under current filters will be deleted!"]}):(0,n.jsx)("div",{className:"flex align-items-center",children:(0,n.jsxs)(t.o5,{component:"span",style:{marginRight:20},children:["Following ",(0,n.jsx)("b",{children:i})," will be deleted:",(0,n.jsxs)("ul",{children:["Packagings"===i?null===o||void 0===o?void 0:o.map((e,l)=>(0,n.jsxs)("li",{children:[e.title," - ",e.sku]},l)):null,"Products"===i?null===o||void 0===o?void 0:o.map((e,l)=>(0,n.jsxs)("li",{children:[e.title," - ",e.sku]},l)):null,"Warehouses"===i?null===o||void 0===o?void 0:o.map((e,l)=>(0,n.jsx)("li",{children:e.name},l)):null,"Boxes"===i?null===o||void 0===o?void 0:o.map((e,l)=>(0,n.jsx)("li",{children:e.name},l)):null,"Customers"===i?null===o||void 0===o?void 0:o.map((e,l)=>(0,n.jsx)("li",{children:e.name},l)):null,"Users"===i?null===o||void 0===o?void 0:o.map((e,l)=>(0,n.jsx)("li",{children:e.name},l)):null]}),"Do you want to proceed?"]})}))})})}},37376(e,l,i){i.d(l,{A:()=>s});var t=i(98477),n=i(37643),o=(i(67252),i(28872));const a=["children"],s=e=>{let l=e.children,i=(0,n.A)(e,a);const s=null!==i&&void 0!==i&&i.style?(0,t.A)({},i.style):{};return s.maxWidth||(s.maxWidth="1400px",s.margin="auto"),(0,o.jsx)("div",(0,t.A)((0,t.A)({style:s},i),{},{children:l}))}},80705(e,l,i){i.d(l,{A:()=>d});var t=i(67252),n=i(84489),o=i(45851),a=i(39348),s=i(28872);const d=e=>{let l=e.components,i=e.loading,d=e.breakWidth,c=e.breakAlways,r=void 0!==c&&c,x=e.buttonClassName;const u=(0,a.A)().width,g=r||u<d,v=l.filter(e=>{if(!e)return!1;const l=e.render,i=e.showCondition;return!(void 0!==i&&!i||!l)});return(0,s.jsx)(s.Fragment,{children:g?v.length>0&&(0,s.jsx)(n.ND,{buttonProps:{variant:"text",disabled:i,className:"!tw-px-0 ".concat(x||"")},spanProps:{className:"!tw-ml-auto"},noIcon:!0,buttonIcon:(0,s.jsx)(o.W1t,{}),renderMenu:e=>{let l=e.handleListKeyDown,i=e.open,t=e.handleClose;return(0,s.jsx)(n.cO,{autoFocusItem:i,onKeyDown:l,className:"!tw-flex !tw-flex-col !tw-items-start !tw-max-h-[75vh] !tw-overflow-y-auto !tw-gap-1 [&>div]:!tw-my-0 [&>div]:!tw-py-0 [&_button:not([role=combobox])]:!tw-p-0 [&_button:not(:has(svg)):not([role=combobox])]:!tw-ml-[3px]",children:v.map((e,l)=>{const i=e.render;return(0,s.jsx)("div",{className:"tw-w-full",children:null===i||void 0===i?void 0:i({isMobile:!0,handleClose:t})},l)})})}}):v.map((e,l)=>{var i;return(0,s.jsx)(t.Fragment,{children:(null===(i=e.render)||void 0===i?void 0:i.call(e,{isMobile:!1}))||null},l)})})}},96084(e,l,i){i.r(l),i.d(l,{default:()=>L});var t=i(98477),n=i(39698),o=i(67252),a=i(71288),s=i(91127),d=i(84980),c=i(84489),r=i(45851),x=i(89131),u=i(46685),g=i(38262),v=i(14618),h=i(24122),m=i(58072),w=i(94292),A=i(46559),b=i(37376),p=i(63096),j=i(43928),k=i(26600),f=i(2583),y=i(4678),P=i(28872);const N=e=>{let l=e.boxPackingAlgoActive,i=void 0!==l&&l,t=e.boxPackingAlgoQuantityActive,s=void 0!==t&&t,d=e.boxPackingAlgoWeightActive,r=void 0!==d&&d,x=e.className,u=void 0===x?"":x,g=e.label,v=e.handleChange,h=e.hideTooltip,m=void 0!==h&&h,b=e.disabled,p=void 0!==b&&b,j=e.isOrderForm,k=void 0!==j&&j;const f=(0,a.useSelector)(e=>{var l;return null===e||void 0===e||null===(l=e.auth)||void 0===l?void 0:l.user}),N=(0,y.No)({user:f,feature:y.cc.box_packing_algo});let I=!N&&(i||s||r),B=i,W=s,C=r,S="boxPackingAlgoActive",D="boxPackingAlgoQuantityActive",O="boxPackingAlgoWeightActive";const _=(0,o.useState)(I),F=(0,n.A)(_,2),Q=F[0],T=F[1];(0,o.useEffect)(()=>{T(I)},[I]);let E=null;B?E=S:W?E=D:C&&(E=O);const M=e=>{N||(v({[S]:!Q,[D]:!1,[O]:!1}),T(e=>!e))};return(0,P.jsxs)("div",{className:"tw-flex tw-flex-col ".concat(u||""),children:[k?(0,P.jsx)(c.dO,{"data-cy":"chk-box-packing-algorithm",checked:Q,value:Q,isPaywalled:N,paywalledFeature:y.cc.box_packing_algo,label:(0,P.jsxs)("div",{className:"flex align-items-center tw-gap-1",children:[(0,P.jsx)("div",{onClick:M,children:g||"Box Splitting Algorithm"}),!m&&(0,P.jsx)(A.A,{information:w.A.BOX_PACKING_ALGO,disabled:!0})]}),onChange:M,color:"primary",disabled:p}):(0,P.jsx)(c.dO,{paywalledFeature:y.cc.box_packing_algo,label:(0,P.jsxs)("div",{className:"flex align-items-center tw-gap-1",children:[g||"Box Splitting Algorithm",!m&&(0,P.jsx)(A.A,{information:w.A.BOX_PACKING_ALGO})]}),isPaywalled:N,"data-cy":"chk-box-packing-algorithm",checked:Q,onChange:M,color:"primary",disabled:p}),(0,P.jsx)(c.SD,{in:Q,children:(0,P.jsxs)(c.z6,{value:E,className:"tw-w-full tw-mt-4",onCh
1ange:e=>{(0,y.No)({user:f,feature:y.cc.box_packing_algo})||v({[S]:!1,[D]:!1,[O]:!1,[e]:!0})},children:[(0,P.jsx)(c.pO,{disabled:p,value:O,"data-cy":"rad-packing-algo-weight",labelPlacement:"end",label:"By Product Weight",fullWidth:!1}),(0,P.jsx)(c.pO,{disabled:p,"data-cy":"rad-packing-algo-quantity",value:D,labelPlacement:"end",label:"By Product Quantity",fullWidth:!1}),(0,P.jsx)(c.pO,{disabled:p,"data-cy":"rad-packing-algo-dimensions",value:S,labelPlacement:"end",label:"By Product Dimensions",fullWidth:!1})]})})]})},I=e=>(0,P.jsx)(y.L0,{feature:y.cc.box_packing_algo,isClickable:!0,children:(0,P.jsx)(N,(0,t.A)({},e))});var B=i(97146),W=i(83051),C=i(68870),S=i(67208),D=i(76276);const O=e=>{let l=e.boxes,i=void 0===l?[]:l,t=e.editingBox,n=void 0===t?null:t,o=e.active,s=e.showBoxAlgoEdiModal,r=e.boxPackingAlgoValues,x=void 0===r?{}:r,u=e.handleClose,g=e.setSubmitting;const h=(0,a.useDispatch)(),b=(0,D.A)(),p=b.toastError,j=b.toastSuccess,k=n?{id:n.id,name:n.name,maxItemsAllowed:n.maxItemsAllowed,weight:n.weight}:{id:null,name:"",maxItemsAllowed:"",weight:{units:f.Ay.POUNDS,maxWeightAllowed:"",value:""}},y=()=>!(n||null!==x&&void 0!==x&&x.boxPackingAlgoActive);return(0,P.jsx)(c.ZL,{children:(0,P.jsx)(c.l1,{enableReinitialize:!0,initialValues:k,onSubmit:async(e,l)=>{let t=l.resetForm;try{const l=n?(0,d.cloneDeep)(n):(0,d.cloneDeep)(i.find(l=>l.id===e.id));x.boxPackingAlgoQuantityActive?(l.maxItemsAllowed=parseInt(e.maxItemsAllowed),l.useInBoxPackingAlgoQty=!0):x.boxPackingAlgoWeightActive?(l.weight.maxWeightAllowed=parseFloat(e.weight.maxWeightAllowed),l.useInBoxPackingAlgoWeight=!0):x.boxPackingAlgoActive&&(l.useInBoxPackingAlgo=!0),g(!0);const o=(await v.Km.patch("/box/".concat(l.id),l)).data;h((0,m.QO)({user:o.user})),j(o.message),u(),t()}catch(c){var o,a,s;console.log((null===c||void 0===c?void 0:c.response)||c),p((null===c||void 0===c||null===(o=c.response)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.message)||(null===c||void 0===c||null===(s=c.response)||void 0===s?void 0:s.data)||(null===c||void 0===c?void 0:c.message))}finally{g(!1)}},children:e=>{let l=e.isSubmitting,t=e.submitForm,a=e.values,d=e.setFieldValue,r=e.setValues;const g=(0,S.mD)(a.weight.units)(a.weight.maxWeightAllowed);return(0,P.jsx)(c.lV,{children:(0,P.jsx)(c.aF,{open:o,title:n?n.name:"Select Box",maxWidth:y()?"sm":"xs",handleClose:u,actions:[{isClose:!0,disabled:l},{isPrimary:!0,onClick:t,label:"Save",disabled:l||x.boxPackingAlgoQuantityActive&&!parseFloat(a.maxItemsAllowed)||x.boxPackingAlgoWeightActive&&(!parseFloat(a.weight.maxWeightAllowed)||!!g),loading:l}],children:(0,P.jsxs)("section",{className:"tw-grid lg:".concat(y()?"tw-grid-cols-2":"tw-grid-cols-1"," tw-gap-4"),children:[s&&(0,P.jsx)("section",{children:(0,P.jsx)(B.l6,{name:"Select Box",label:"Select Box",value:a.id,options:null===i||void 0===i?void 0:i.map(e=>({label:e.name,value:e.id})),className:"tw-mb-5",placeholder:"Select Box..",onChange:e=>{var l;const t=i.find(l=>l.id===e.value),n={id:t.id,name:t.name,maxItemsAllowed:parseInt(t.maxItemsAllowed),weight:{units:null!==(l=t.weight.units)&&void 0!==l?l:f.Ay.POUNDS,maxWeightAllowed:parseFloat(t.weight.maxWeightAllowed),value:t.weight.value}};r(n)}})}),x.boxPackingAlgoQuantityActive&&(0,P.jsx)("section",{className:"tw-max-w-64",children:(0,P.jsx)(c.D0,{name:"maxItemsAllowed",component:C.A,label:(0,P.jsxs)("div",{className:"tw-flex tw-items-center",children:["Maximum Items",(0,P.jsx)(A.A,{information:w.A.MAX_ITEMS})]}),type:"number",onBlur:()=>{d("maxItemsAllowed",a.maxItemsAllowed)},onFocus:e=>e.target.select(),min:1,step:1})}),x.boxPackingAlgoWeightActive&&(0,P.jsxs)("section",{className:"tw-max-w-64",children:[(0,P.jsxs)("div",{className:"tw-flex",children:[(0,P.jsx)(W.J,{className:"tw-mb-1.5",htmlFor:"values.weight.maxWeightAllowed",children:"Maximum Weight"}),(0,P.jsx)(A.A,{information:w.A.MAX_WEIGHT})]}),(0,P.jsx)(c.rs,{fullWidth:!0,error:g,inputProps:{name:"values.weight.maxWeightAllowed",value:a.weight.maxWeightAllowed,max:(0,S.k0)(a.weight.units),validate:(0,S.mD)(a.weight.units),onChange:e=>{d("weight.maxWeightAllowed",parseFloat(e)||"")}},weightUnitProps:{name:"values.weight.units",value:f.Ob[f.Ay.POUNDS]}})]})]})})})}})})};var _=i(6986),F=i(91028),Q=i(39484),T=i(80705);const E="".concat(k.nv,"/Assets/boxes-illustration.svg"),M=()=>{var e,l,i,j;const k=(0,o.useState)(null),N=(0,n.A)(k,2),B=N[0],W=N[1],C=(0,o.useState)(!1),S=(0,n.A)(C,2),M=S[0],L=S[1],$=(0,o.useState)(!1),G=(0,n.A)($,2),K=G[0],z=G[1],H=(0,o.useState)({}),U=(0,n.A)(H,2),V=U[0],X=U[1],R=(0,o.useState)(!1),Y=(0,n.A)(R,2),Z=Y[0],q=Y[1],J=(0,o.useState)([]),ee=(0,n.A)(J,2),le=ee[0],ie=ee[1],te=(0,o.useState)(!1),ne=(0,n.A)(te,2),oe=ne[0],ae=ne[1],se=(0,o.useState)([]),de=(0,n.A)(se,2),ce=de[0],re=de[1],xe=(0,o.useState)(null),ue=(0,n.A)(xe,2),ge=ue[0],ve=ue[1],he=(0,o.useState)(!1),me=(0,n.A)(he,2),we=me[0],Ae=me[1],be=(0,a.useSelector)(e=>{var l;return null===e||void 0===e||null===(l=e.auth)||void 0===l?void 0:l.user}),pe=(0,a.useDispatch)(),je=(0,D.A)(),ke=je.toastError,fe=je.toastSuccess,ye=(0,o.useState)(null!==(e=null===be||void 0===be?void 0:be.boxes)&&void 0!==e?e:[]),Pe=(0,n.A)(ye,2),Ne=Pe[0],Ie=Pe[1],Be=(0,x.A)().onDragEnd;(0,o.useEffect)(()=>{var e;Ie(null!==(e=null===be||void 0===be?void 0:be.boxes)&&void 0!==e?e:[])},[null===be||void 0===be?void 0:be.boxes]);const We=(0,o.useMemo)(()=>(0,d.debounce)(async e=>{try{const l=(await v.Km.post("/box/reorder",{boxes:e})).data;pe((0,m.QO)({user:l.user}))}catch(i){var l;ke((null===i||void 0===i||null===(l=i.response)||void 0===l?void 0:l.data)||(null===i||void 0===i?void 0:i.message)||"Error saving box order")}},700),[pe,ke]);(0,o.useEffect)(()=>()=>{We.cancel()},[We,ke]);const Ce=(0,o.useState)({boxPackingAlgoActive:null===be||void 0===be?void 0:be.boxPackingAlgoActive,boxPackingAlgoQuantityActive:null===be||void 0===be?void 0:be.boxPackingAlgoQuantityActive,boxPackingAlgoWeightActive:null===be||void 0===be?void 0:be.boxPackingAlgoWeightActive}),Se=(0,n.A)(Ce,2),De=Se[0],Oe=Se[1];(0,o.useEffect)(()=>{document.title="Boxes - ShipFare"},[]),(0,o.useEffect)(()=>{_e()},[null===be||void 0===be?void 0:be.boxes,De]);const _e=()=>{var e;const l=null!==(e=null===be||void 0===be?void 0:be.boxes)&&void 0!==e?e:[];
1if(null!==De&&void 0!==De&&De.boxPackingAlgoActive){const e=l.filter(e=>!!e.useInBoxPackingAlgo);re(e)}else if(null!==De&&void 0!==De&&De.boxPackingAlgoQuantityActive){const e=l.filter(e=>("useInBoxPackingAlgoQty"in e?!!e.useInBoxPackingAlgoQty:!!e.useInBoxPackingAlgo)&&!!e.maxItemsAllowed);re(e)}else if(null!==De&&void 0!==De&&De.boxPackingAlgoWeightActive){const e=l.filter(e=>{var l;return("useInBoxPackingAlgoWeight"in e?!!e.useInBoxPackingAlgoWeight:!!e.useInBoxPackingAlgo)&&!(null===e||void 0===e||null===(l=e.weight)||void 0===l||!l.maxWeightAllowed)});re(e)}},Fe=e=>()=>{W((0,t.A)((0,t.A)({},e),{},{isExistingBox:!0})),L(!0)},Qe=(0,o.useCallback)(e=>{let l=e.box;L(!1),W(l)},[]),Te=(0,o.useCallback)(()=>{W(null),L(!0)},[]);let Ee={};B&&(Ee=(0,t.A)({},B));const Me=function(e){let l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return async()=>{z(!0);try{const i=(await v.Km.patch("/box/default/".concat(e),{isDefault:l})).data;(0,a.vA)(()=>{pe((0,m.QO)({user:i.user})),fe(i.message)})}catch(t){var i;ke((null===t||void 0===t||null===(i=t.response)||void 0===i?void 0:i.data)||(null===t||void 0===t?void 0:t.message))}z(!1)}},Le=e=>{ie(e),q(!0)},$e=async()=>{try{var e,l;z(!0);let i=Object.keys(V);null!==(e=i)&&void 0!==e&&e.length||(i=null===be||void 0===be||null===(l=be.boxes)||void 0===l?void 0:l.map(e=>e.id));const t=(await v.Km.post("/box/export",{boxIds:i})).data;(0,Q.A)(t,"box_data.csv")}catch(t){var i;ke((null===t||void 0===t||null===(i=t.response)||void 0===i?void 0:i.data)||(null===t||void 0===t?void 0:t.message)||"Error Exporting Boxes"),z(!1)}z(!1)},Ge=e=>{var l;return e.hasDryIce?"Dry Ice, ".concat(parseFloat((0,u.floatToTwo)(e.dryIceWeight))).concat(null!==(l=e.dryIceWeightUnit)&&void 0!==l?l:f.Ay.POUNDS):e.hasIcePack?"(".concat((0,u.thousandsFormat)(e.coolant.quantity),") Ice Packs, ").concat((0,_.fU)(e.coolant.dimensions)):"None"},Ke=e=>e.hasLiner?"".concat(e.liner.title,", ").concat(e.liner.thickness):"None",ze=async()=>{try{z(!0);const e=(0,t.A)({},De),l=(await v.FH.post("/user/v1/company/edit",e)).data,i=p.lw.BOX_SPLITTING_ALGO_UPDATE;(0,a.vA)(()=>{pe((0,m.QO)({user:l})),fe(i)}),ae(!1)}catch(l){var e;ke((null===l||void 0===l||null===(e=l.response)||void 0===e?void 0:e.data)||(null===l||void 0===l?void 0:l.message))}finally{z(!1)}},He=(0,o.useMemo)(()=>De.boxPackingAlgoActive!==(null===be||void 0===be?void 0:be.boxPackingAlgoActive)||De.boxPackingAlgoQuantityActive!==(null===be||void 0===be?void 0:be.boxPackingAlgoQuantityActive)||De.boxPackingAlgoWeightActive!==(null===be||void 0===be?void 0:be.boxPackingAlgoWeightActive),[null===be||void 0===be?void 0:be.boxPackingAlgoActive,null===be||void 0===be?void 0:be.boxPackingAlgoQuantityActive,null===be||void 0===be?void 0:be.boxPackingAlgoWeightActive,De]),Ue=()=>{var e;if(De.boxPackingAlgoActive||De.boxPackingAlgoQuantityActive||De.boxPackingAlgoWeightActive)return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("hr",{style:{borderColor:"#d1d5db2d",margin:0}}),(0,P.jsxs)("div",{className:"tw-text-xl lg:tw-text-2xl tw-font-semibold tw-text-secondary tw-leading-none tw-tracking-tight tw-flex tw-items-center tw-justify-between tw-gap-1",children:["Boxes Applied",(0,P.jsxs)(c.$n,{className:"tw-gap-1",variant:"contained",onClick:()=>Ae(!0),color:"secondary",disabled:K||(null===be||void 0===be||null===(e=be.boxes)||void 0===e?void 0:e.length)===ce.length,"data-cy":"add-box-button",size:"small",children:[(0,P.jsx)(r.OMN,{}),"Add"]})]}),(0,P.jsx)("ul",{className:"tw-mt-6 tw-pl-0 tw-m-0",children:ce.map(e=>{var l;return(0,P.jsxs)("li",{className:"tw-flex tw-items-center tw-justify-between tw-gap-4",children:[(0,P.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-1",children:[(0,P.jsx)("span",{className:"tw-font-bold tw-text-lg",children:e.name}),null!==De&&void 0!==De&&De.boxPackingAlgoWeightActive&&null!==e&&void 0!==e&&null!==(l=e.weight)&&void 0!==l&&l.maxWeightAllowed?(0,P.jsxs)("span",{children:["(",parseFloat((0,u.floatToTwo)(e.weight.maxWeightAllowed))," ",e.weight.units,")"]}):null]}),(0,P.jsxs)("div",{className:"tw-space-x-2",children:[!(null!==De&&void 0!==De&&De.boxPackingAlgoActive)&&(0,P.jsx)(c.$n,{size:"small",iconButton:!0,loading:K,onClick:()=>ve(e),children:(0,P.jsx)(r.ffu,{})}),(0,P.jsx)(c.$n,{size:"small",iconButton:!0,loading:K,onClick:()=>(async e=>{try{const l=(0,t.A)({},e);De.boxPackingAlgoActive?l.useInBoxPackingAlgo=!1:De.boxPackingAlgoQuantityActive?l.useInBoxPackingAlgoQty=!1:De.boxPackingAlgoWeightActive&&(l.useInBoxPackingAlgoWeight=!1),z(!0);const i=(await v.Km.patch("/box/".concat(l.id),l)).data;pe((0,m.QO)({user:i.user})),fe(i.message)}catch(o){var l,i,n;console.log((null===o||void 0===o?void 0:o.response)||o),ke((null===o||void 0===o||null===(l=o.response)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.message)||(null===o||void 0===o||null===(n=o.response)||void 0===n?void 0:n.data)||(null===o||void 0===o?void 0:o.message))}finally{z(!1)}})(e),children:(0,P.jsx)(r.epd,{})})]})]},e.id)})})]})},Ve=()=>{var e;const l=ce.map(e=>e.id);return(null!==(e=null===be||void 0===be?void 0:be.boxes)&&void 0!==e?e:[]).filter(e=>!l.includes(e.id))},Xe=Object.keys(V).length===(null===be||void 0===be||null===(l=be.boxes)||void 0===l?void 0:l.length),Re=!!Object.keys(V).length;if(oe)return(0,P.jsxs)(b.A,{children:[(0,P.jsx)("div",{className:"tw-max-w-md tw-mx-auto",children:(0,P.jsx)(c.$n,{disabled:K,onClick:()=>{ae(!1),Oe({boxPackingAlgoActive:null===be||void 0===be?void 0:be.boxPackingAlgoActive,boxPackingAlgoQuantityActive:null===be||void 0===be?void 0:be.boxPackingAlgoQuantityActive,boxPackingAlgoWeightActive:null===be||void 0===be?void 0:be.boxPackingAlgoWeightActive})},children:"Back"})}),(0,P.jsxs)(c.Zp,{className:"tw-mt-4 !tw-max-w-md !tw-mx-auto",children:[(0,P.jsx)(I,{boxPackingAlgoActive:De.boxPackingAlgoActive,boxPackingAlgoQuantityActive:De.boxPackingAlgoQuantityActive,boxPackingAlgoWeightActive:De.boxPackingAlgoWeightActive,hideTooltip:!0,label:(0,P.jsxs)("div",{className:"tw-text-xl lg:tw-text-2xl tw-font-semibold tw-text-secondary tw-leading-none tw-tracking-tight tw-flex tw-items-center tw-justify-between tw-gap-1",children:["Box Splitting Algorithm",(0,P.jsx)(A.A,{icon:(0,P.jsx)(r.$DH,{className:"tw-px-0 tw-text-secondary tw-size-5"}),information:w.A.BOX_PACKING_ALGO})]}),handleChange:e=>{Object.keys(e).forEach(l=>{Oe(i=>(0,t.A)((0,t.A)({},i),{},{[l]:e[l]}))})},disabled:K}),Ue(),He&&(0,P.jsx)("div",{className:"tw-flex tw-items-center tw-pt-0 tw-justify-end",children:(0,P.jsxs)(c.$n,{variant:"contained",color:"primary",loading:K,disabled:!He||K,onClick:ze,children:[(0,P.jsx)(r.eMP,{className:(0,F.cn)(!He||K?"tw-fill-gray-400":"tw-fill-primary")}),"Save"]})})]}),(0,P.jsx)(O,{boxes:Ve(),active:!!ge||we,editingBox:ge,showBoxAlgoEdiModal:we,boxPackingAlgoValues:De,handleClose:()=>{ve(null),Ae(!1)},setSubmitting:z})]});const Ye=!(null===be||void 0===be||null===(i=be.boxes)||void 0===i||!i.length);return(0,P.jsxs)(b.A,{className:"tw-flex tw-flex-col tw-items-center",children:[(0,P.jsx)(g.A,{editBox:B,handleClose:Qe,initialValues:Ee,active:M}),(0,P.jsx)(h.A,{show:Z,entity:"Boxes",rows:le,handleClose:()=>q(!1),handleSubmit:async()=>{try{z(!0);let e=[];e=le.length?le.map(e=>e.id):Object.keys(V);
1const l=(await v.Km.post("/box/delete",{boxIds:e})).data;X({}),(0,a.vA)(()=>{pe((0,m.QO)({user:(0,t.A)({},l.user)})),fe(l.message)})}catch(l){var e;ke((null===l||void 0===l||null===(e=l.response)||void 0===e?void 0:e.data)||(null===l||void 0===l?void 0:l.message)),z(!1)}q(!1),ie([]),z(!1)}}),Ye?(0,P.jsxs)("div",{className:"tw-w-fit tw-max-w-full",children:[(0,P.jsxs)("div",{className:"tw-flex tw-gap-4 tw-justify-between tw-flex-wrap tw-items-center tw-mb-5",children:[(0,P.jsxs)("div",{className:"tw-text-xl lg:tw-text-3xl tw-font-semibold tw-text-secondary tw-leading-none tw-tracking-tight",children:["Box",(null===be||void 0===be||null===(j=be.boxes)||void 0===j?void 0:j.length)>1?"es":""]}),(0,P.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-2",children:[(0,P.jsxs)(c.$n,{disabled:K,onClick:Te,color:"primary",variant:"contained",className:"tw-gap-1",children:[(0,P.jsx)(r.OMN,{}),(0,P.jsx)("span",{className:"sm:tw-hidden",children:"Add"}),(0,P.jsx)("span",{className:"max-sm:tw-hidden",children:"Create New Box"})]}),(0,P.jsx)(y.L0,{feature:y.cc.box_packing_algo,isClickable:!0,children:(0,P.jsx)(c.$n,{variant:"contained",color:"secondary",onClick:()=>{(0,y.No)({user:be,feature:y.cc.box_packing_algo})||ae(!0)},paywalledFeature:y.cc.box_packing_algo,children:"Box Splitting Algo"})}),(0,P.jsx)(T.A,{breakWidth:640,loading:K,components:[{showCondition:!!Object.keys(V).length,render:e=>{let l=e.isMobile;return(0,P.jsx)("div",{className:l?"tw-px-2":"",children:(0,P.jsxs)(c.$n,{disabled:K,onClick:$e,variant:l?"text":"outlined",className:l?"!tw-w-full !tw-justify-start":"",children:[(0,P.jsx)(r.lYe,{className:"tw-rotate-180 tw-mr-1"}),"Export"]})})}},{showCondition:!!Object.keys(V).length,render:e=>{let l=e.isMobile;return(0,P.jsx)("div",{className:l?"tw-px-2":"",children:(0,P.jsxs)(c.$n,{onClick:()=>{Le(Object.values(V))},loading:K,disabled:K,color:"error",variant:l?"text":"contained",className:l?"!tw-w-full !tw-justify-start":"",children:[(0,P.jsx)(r.epd,{className:"tw-mr-1"}),"Bulk Delete"]})})}}]})]})]}),(0,P.jsx)("div",{className:"tw-overflow-x-auto",children:(0,P.jsx)(c.JY,{onDragEnd:e=>{const l=Be({result:e,sourceDroppableId:"boxes",list:Ne});l&&(Ie(l),We(l))},children:(0,P.jsxs)(c.QT,{"aria-label":"boxes-table",containerClassName:"tw-w-fit tw-max-w-full",className:"tw-w-auto",size:"small",children:[(0,P.jsx)(c.A0,{children:(0,P.jsxs)(c.Hj,{children:[(0,P.jsx)(c.nd,{children:(0,P.jsx)(c.Sc,{value:"select-all-boxes",disabled:K,checked:Xe,indeterminate:Re&&!Xe,onChange:()=>{if(Re)return X({});const e=(0,s.jM)(V,e=>{be.boxes.forEach(l=>{e[l.id]=(0,t.A)({},l)})});X(e)},className:"tw-ml-8"})}),(0,P.jsx)(c.nd,{children:"Name"}),(0,P.jsx)(c.nd,{children:"Liner"}),(0,P.jsx)(c.nd,{children:"Coolant"}),(0,P.jsx)(c.nd,{children:"Outer Dimensions"}),(0,P.jsx)(c.nd,{children:"Inner Dimensions"}),(0,P.jsx)(c.nd,{children:"Volume"}),(0,P.jsx)(c.nd,{children:(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:["Weight",(0,P.jsx)(A.A,{information:w.A.BOX_WEIGHT})]})}),(0,P.jsx)(c.nd,{style:{paddingLeft:35}})]})}),(0,P.jsx)(c.gL,{droppableId:"boxes",direction:"vertical",type:"boxes",children:e=>(0,P.jsxs)(c.BF,(0,t.A)((0,t.A)({ref:e.innerRef},e.droppableProps),{},{children:[Ne.map((e,l)=>(0,P.jsx)(c.sx,{draggableId:e.id,index:l,children:l=>{var i,n,o,a,d,x,g,v,h;return(0,P.jsxs)(c.Hj,(0,t.A)((0,t.A)((0,t.A)({ref:l.innerRef},l.draggableProps),l.dragHandleProps),{},{children:[(0,P.jsx)(c.nA,{children:(0,P.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-2",children:[(0,P.jsx)(r.YzB,{fontSize:"small"}),(0,P.jsx)(c.Sc,{checked:!!V[e.id],disabled:K,value:e.id,onChange:()=>{const l=(0,s.jM)(V,l=>{V[e.id]?delete l[e.id]:l[e.id]=(0,t.A)({},e)});X(l)}})]})}),(0,P.jsxs)(c.nA,{className:"tw-font-bold tw-text-secondary",children:[(0,P.jsx)("div",{children:e.name}),e.sku&&(0,P.jsx)("div",{className:"tw-text-xs tw-font-normal tw-text-gray-500",children:e.sku})]}),(0,P.jsx)(c.nA,{children:Ke(e)}),(0,P.jsx)(c.nA,{children:Ge(e)}),(0,P.jsxs)(c.nA,{children:[parseFloat((0,u.floatToTwo)(e.dimensions.length)),"L x"," ",parseFloat((0,u.floatToTwo)(e.dimensions.width)),"W x"," ",parseFloat((0,u.floatToTwo)(e.dimensions.height)),"H"," ",e.dimensions.units]}),(0,P.jsxs)(c.nA,{children:[parseFloat((0,u.floatToTwo)(null!==(i=null===e||void 0===e||null===(n=e.internalDimensions)||void 0===n?void 0:n.length)&&void 0!==i?i:0)),"L x"," ",parseFloat((0,u.floatToTwo)(null!==(o=null===e||void 0===e||null===(a=e.internalDimensions)||void 0===a?void 0:a.width)&&void 0!==o?o:0)),"W x"," ",parseFloat((0,u.floatToTwo)(null!==(d=null===e||void 0===e||null===(x=e.internalDimensions)||void 0===x?void 0:x.height)&&void 0!==d?d:0)),"H"," ",null!==(g=null===e||void 0===e||null===(v=e.internalDimensions)||void 0===v?void 0:v.units)&&void 0!==g?g:"in"]}),(0,P.jsx)(c.nA,{children:e.useInternalDimensions?(0,P.jsx)("span",{children:(0,u.thous
1andsFormat)(e.internalDimensions.volume)}):(0,P.jsx)("span",{children:(0,u.thousandsFormat)(e.dimensions.volume)})}),(0,P.jsxs)(c.nA,{children:[parseFloat((0,u.floatToTwo)((null===e||void 0===e||null===(h=e.calculatedWeights)||void 0===h?void 0:h[f.rY[e.weight.units]])||e.weight.value))," ",e.weight.units]}),(0,P.jsx)(c.nA,{children:(0,P.jsxs)("div",{className:"tw-flex tw-justify-end",children:[(0,P.jsx)(c.m_,{title:"Edit Box",children:(0,P.jsx)(c.$n,{iconButton:!0,disabled:K,onClick:Fe(e),children:(0,P.jsx)(r.ffu,{})})}),(0,P.jsx)(c.m_,{title:e.default?"Default Box":"Make Default",children:(0,P.jsx)(c.$n,{iconButton:!0,disabled:K,onClick:Me(e.id,!e.default),children:(0,P.jsx)(c.Gg,{active:e.default})})}),(0,P.jsx)(c.m_,{title:"Delete Box",children:(0,P.jsx)(c.$n,{iconButton:!0,disabled:K,onClick:()=>Le([e]),children:(0,P.jsx)(r.epd,{})})})]})})]}))}},e.id)),e.placeholder]}))})]})})})]}):(0,P.jsxs)(c.Zp,{className:"tw-mt-4 tw-gap-0",children:[(0,P.jsx)("div",{className:"tw-text-2xl lg:tw-text-3xl tw-text-center tw-text-secondary",children:"No Boxes"}),(0,P.jsx)("img",{src:E,alt:"Boxes",className:"tw-max-h-72 tw-mx-auto tw-mt-8 tw-mb-8"}),(0,P.jsx)("div",{className:"tw-w-full tw-flex tw-justify-center",children:(0,P.jsxs)(c.$n,{disabled:K,onClick:Te,color:"secondary",variant:"contained",className:"tw-gap-1 tw-flex tw-items-center",children:[(0,P.jsx)(r.OMN,{})," Add Box"]})})]})]})},L=e=>(0,P.jsx)(j.c7,{permissions:[j.I1.EDIT_BOXES],children:(0,P.jsx)(M,(0,t.A)({},e))})},89131(e,l,i){i.d(l,{A:()=>n});var t=i(39698);const n=()=>{const e=(e,l,i)=>{const n=[...e],o=n.splice(l,1),a=(0,t.A)(o,1)[0];return n.splice(i,0,a),n};return{onDragEnd:l=>{let i=l.result,t=l.sourceDroppableId,n=l.list;if(!i.destination)return;const o=i.source,a=i.destination;if((o.droppableId!==a.droppableId||o.index!==a.index)&&o.droppableId===a.droppableId&&o.droppableId===t){return[...e(n,o.index,a.index)]}},reorder:e}}}}]);
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.