PageSourceSearch

https://shoport.com/_next/static/chunks/pages/shop-admin/shippings/new-a23a0c201045a55b.js

js shoport.com collected 2026-10-04 07:05:20 UTC 11,601 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9413],{19957:function(a,b,c){"use strict";c.r(b),c.d(b,{"__N_SSP":function(){return A}});var d=c(27812),e=c(59499),f=c(50029),g=c(16835),h=c(77191),i=c(87794),j=c.n(i),k=c(67294),l=c(94184),m=c.n(l),n=c(11163),o=c(41664),p=c(88767),q=c(81043),r=c(96486);c.n(r);var s=c(84691),t=c(65259),u=c(11373),v=c(39169),w=c(92421),x=c(85893);function y(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function z(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?y(Object(c),!0).forEach(function(b){(0,e.Z)(a,b,c[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):y(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}var A=!0;b.default=function(a){(0,h.Z)(a);var b,c,e,i,l,y,A,B=(0,q.I0)(),C=(0,s.bU)(),D=(0,g.Z)(C,1)[0],E=(0,n.useRouter)(),F=k.useContext(w.q),G=k.useState(!1),H=(0,g.Z)(G,2),I=H[0],J=H[1],K=k.useState([]),L=(0,g.Z)(K,2),M=L[0],N=L[1],O=k.useState([]),P=(0,g.Z)(O,2),Q=P[0],R=P[1],S=k.useState(!1),T=(0,g.Z)(S,2),U=T[0],V=T[1],W=(0,p.useQuery)("automaticDeliveries",(0,f.Z)(j().mark(function a(){var b,c;return j().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.F6.get((0,u.$0)(null===(b=F.data)|| void 0===b?void 0:b.id));case 2:return c=a.sent,a.abrupt("return",c.data);case 4:case"end":return a.stop()}},a)}))),X=(0,p.useMutation)((0,f.Z)(j().mark(function a(){var b,c,d,e;return j().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.F6.post((0,u.Db)(null===(b=F.data)|| void 0===b?void 0:b.id),{shipping:{items_attributes:null==Q?void 0:null===(c=Q.map)|| void 0===c?void 0:c.call(Q,function(a){var b,c;return{product_type:null==a?void 0:null===(b=a.attributes)|| void 0===b?void 0:b.product_type,product_id:null==a?void 0:null===(c=a.attributes)|| void 0===c?void 0:c.product_id,deliver:null==a?void 0:a.deliver}})}});case 2:return e=a.sent,a.abrupt("return",null==e?void 0:null===(d=e.data)|| void 0===d?void 0:d.data);case 4:case"end":return a.stop()}},a)})),{onSuccess:function(a){B((0,v.EA)({})),E.push((0,u.XN)(null==a?void 0:a.id))},onError:function(){B((0,v.EA)({type:"red"}))}}),Y=function(){J(!1)};return W.isFetching?null:(0,x.jsxs)("div",{className:"Admin",children:[(0,x.jsx)("div",{className:"container",children:U?(0,x.jsxs)(k.Fragment,{children:[(0,x.jsxs)("div",{className:"Admin__header",children:[(0,x.jsx)(o.default,{href:u.pP,children:(0,x.jsx)("a",{className:"Admin__header__back"})}),(0,x.jsx)("h1",{className:"Admin__header__h1",children:D("pages.shopAdmin.shippings.new.confirm.h1")})]}),(0,x.jsxs)("div",{className:"ShopAdminShippingsNew",children:[(0,x.jsx)("div",{className:"Admin__section",children:(0,x.jsxs)("div",{className:"Table",style:{gridTemplateColumns:"max-content minmax(150px, 1fr) max-content max-content"},children:[(0,x.jsx)("div",{className:"Table__tr",children:[{label:D("pages.shopAdmin.shippings.new.table.id")},{label:D("pages.shopAdmin.shippings.new.table.name")},{label:D("pages.shopAdmin.shippings.new.table.deliver")},{label:""}].map(function(a,b){return(0,x.jsx)("div",{className:"Table__th",children:a.label},b)})}),null==Q?void 0:null===(b=Q.map)|| void 0===b?void 0:b.call(Q,function(a,b){var c,d,e,f;return(0,x.jsxs)("label",{className:"Table__tr",children:[(0,x.jsx)("div",{className:"Table__td",children:null==a?void 0:null===(c=a.attributes)|| void 0===c?void 0:c.id}),(0,x.jsx)("div",{className:"Table__td",children:null==a?void 0:null===(d=a.attributes)|| void 0===d?void 0:d.name}),(0,x.jsx)("div",{className:"Table__td",children:null==a?void 0:a.deliver}),(0,x.jsx)("div",{className:"Table__td",children:(0,x.jsx)("img",{className:"Table__td__img",src:null!=a&&null!==(e=a.attributes)&& void 0!==e&&e.img_url?null==a?void 0:null===(f=a.attributes)|| void 0===f?void 0:f.img_url:"/images/InputFile.svg"})})]},b)})]})}),(0,x.jsxs)("div",{className:m()("ShopAdminShippingsNew__buttons",{"ShopAdminShippingsNew__buttons--disabled":X.isLoading}),children:[(0,x.jsx)("a",{className:"Button Button--border-gray",onClick:function(){V(!1)},children:D("pages.shopAdmin.shippings.new.confirm.back")}),(0,x.jsx)("a",{className:"Button",onClick:function(){X.mutate()},children:D("pages.shopAdmin.shippings.new.confirm.submit")})]})]})]}):(0,x.jsxs)(k.Fragment,{children:[(0,x.jsxs)("div",{className:"Admin__header",children:[(0,x.jsx)(o.default,{href:u.pP,children:(0,x.jsx)("a",{className:"Admin__header__back"})}),(0,x.jsx)("h1",{className:"Admin__header__h1",children:D("pages.shopAdmin.shippings.new.h1")})]}),(0,x.jsxs)("div",{className:"ShopAdminShippingsNew",children:[(0,x.jsxs)("div",{className:"Admin__section",children:[(0,x.jsx)("div",{className:"ShopAdminShippingsNew__buttons",children:(0,x.jsx)("a",{className:"Button Button--x-small Button--blue Button--icon-plus-small",onClick:function(){J(!0)},children:D("pages.shopAdmin.shippings.new.select_products")})}),(null==Q?void 0:Q.length)==0?(0,x.jsxs)("div",{className:"Placeholder Placeholder--admin-products",children:[(0,x.jsx)("h6",{className:"Placeholder__h6",children:D("pages.shopAdmin.shippings.new.placeholder_h6")}),(0,x.jsx)("p",{className:"Placeholder__p",children:D("pages.shopAdmin.shippings.new.placeholder_p")})]}):(0,x.jsxs)(k.Fragment,{children:[(0,x.jsx)("p",{className:"ShopAdminShippingsNew__p",children:D("pages.shopAdmin.shippings.new.p")}),(0,x.jsxs)("div",{className:"Table",style:{gridTemplateColumns:"max-content minmax(150px, 1fr) max-content max-content max-content"},children:[(0,x.jsx)("div",{className:"Table__tr",children:[{label:D("pages.shopAdmin.shippings.new.table.id")},{label:D("pages.shopAdmin.shippings.new.table.name")},{label:D("pages.shopAdmin.shippings.new.table.deliver")},{label:""},{label:""}].map(function(a,b){return(0,x.jsx)("div",{className:"Table__th",children:a.label},b)})}),null==Q?void 0:null===(c=Q.map)|| void 0===c?void 0:c.call(Q,function(a,b){var c,d,e,f;return(0,x.jsxs)("label",{className:"Table__tr",children:[(0,x.jsx)("div",{className:"Table__td",children:null==a?void 0:null===(c=a.attributes)|| void 0===c?void 0:c.id}),(0,x.jsx)("div",{className:"Table__td",children:null==a?void 0:null===(d=a.attributes)|| void 0===d?void 0:d.name}),(0,x.jsx)("div",{className:"Table__td",children:(0,x.jsx)("input",{type:"text",className:"Input",value:null==a?void 0:a.deliver,onChange:function(b){var c;R(null==Q?void 0:null===(c=Q.map)|| void 0===c?void 0:c.call(Q,function(c){if(c.id==a.id){var d,e=Number(null==b?void 0:null===(d=b.target)|| void 0===d?void 0:d.value);return z(z({},c),{},{deliver:isFinite(e)?e:0})}return c}))}})}),(0,x.jsx)("div",{className:"Table__td",children:(0,x.jsx)("img",{className:"Table__td__img",src:null!=a&&null!==(e=a.attributes)&& void 0!==e&&e.img_url?null==a?void 0:null===(f=a.attributes)|| void 0===f?void 0:f.img_url:"/images/InputFile.svg"})}),(0,x.jsx)("div",{className:"Table__td",children:(0,x.jsx)("a",{className:"Button Button--x-small Button--border-gray",onClick:function(){var b;R(null==Q?void 0:null===(b=Q.filter)|| void 0===b?void 0:b.call(Q,function(b){return b.id!=a.id}))},children:D("pages.shopAdmin.shippings.new.table.delete")})})]},b)})]})]})]}),(null==Q?void 0:Q.length)>0&&(0,x.jsx)("div",{className:"ShopAdminShippingsNew__buttons",children:(0,x.jsx)("a",{className:"Button",onClick:function(){V(!0)},children:D("pages.shopAdmin.shippings.new.submit")})})]})]})}),(0,x.jsxs)("div",{className:m()("ModalShopAdminShippingsNew",{"ModalShopAdminShippingsNew--active":I}),children:[(0,x.jsx)("a",{className:"ModalShopAdminShippingsNew__overlay",onClick:function(){Y()}}),(0,x.jsx)("div",{className:"ModalShopAdminShippingsNew__panel",children:(0,x.jsxs)("div",{className:"ModalShopAdminShippingsNew__panel__wrapper",children:[(0,x.jsxs)("div",{className:"ModalShopAdminShippingsNew__panel__header",children:[(0,x.jsx)("h6",{className:"ModalShopAdminShippingsNew__panel__header__h6",children:D("pages.shopAdmin.shippings.new.modal.h6")}),(0,x.jsx)("a",{className:"ModalShopAdminShippingsNew__panel__header__close",onClick:function(){Y()}})]}),(0,x.jsxs)("form",{className:"ModalShopAdminShippingsNew__form",onSubmit:function(a){var b;a.preventDefault(),R(null==M?void 0:null===(b=M.map)|| void 0===b?void 0:b.call(M,function(a){var b,c,d,e,f=(0,r.clone)(null==W?void 0:null===(b=W.data)|| void 0===b?void 0:null===(c=b.data)|| void 0===c?void 0:null===(d=c.find)|| void 0===d?void 0:d.call(c,function(b){return b.id==a}));return z(z({},f),{},{deliver:null==f?void 0:null===(e=f.attributes)|| void 0===e?void 0:e.available})})),Y()},children:[(0,x.jsxs)("div",{className:"Table",style:{gridTemplateColumns:"max-content max-content minmax(150px, 1fr) max-content max-content"},children:[(0,x.jsxs)("div",{className:"Table__tr",children:[(0,x.jsx)("div",{className:"Table__th",children:(0,x.jsx)("input",{type:"checkbox",className:"Checkbox__input",checked:(null==M?void 0:M.length)==(null==W?void 0:null===(e=W.data)|| void 0===e?void 0:null===(i=e.data)|| void 0===i?void 0:i.length),onChange:function(a){var b,c,d,e;N(null!=a&&null!==(b=a.target)&& void 0!==b&&b.checked?null==W?void 0:null===(c=W.data)|| void 0===c?void 0:null===(d=c.data)|| void 0===d?void 0:null===(e=d.map)|| void 0===e?void 0:e.call(d,function(a){return a.id}):[])}})}),[{label:D("pages.shopAdmin.shippings.new.modal.table.id")},{label:D("pages.shopAdmin.shippings.new.modal.table.name")},{label:D("pages.shopAdmin.shippings.new.modal.table.available")},{label:""}].map(function(a,b){return(0,x.jsx)("div",{className:"Table__th",children:a.label},b)})]}),null==W?void 0:null===(l=W.data)|| void 0===l?void 0:null===(y=l.data)|| void 0===y?void 0:null===(A=y.map)|| void 0===A?void 0:A.call(y,function(a,b){var c,e,f,g,h,i;return(0,x.jsxs)("label",{className:"Table__tr",children:[(0,x.jsx)("div",{className:"Table__td",children:(0,x.jsx)("input",{type:"checkbox",className:"Checkbox__input",checked:Boolean(null==M?void 0:null===(c=M.find)|| void 0===c?void 0:c.call(M,function(b){return b==a.id})),onChange:function(b){var c,e;N(null!=b&&null!==(c=b.target)&& void 0!==c&&c.checked?[].concat((0,d.Z)(M),[null==a?void 0:a.id]):null==M?void 0:null===(e=M.filter)|| void 0===e?void 0:e.call(M,function(b){return b!=a.id}))}})}),(0,x.jsx)("div",{className:"Table__td",children:null==a?void 0:null===(e=a.attributes)|| void 0===e?void 0:e.id}),(0,x.jsx)("div",{className:"Table__td",children:null==a?void 0:null===(f=a.attributes)|| void 0===f?void 0:f.name}),(0,x.jsx)("div",{className:"Table__td",children:null==a?void 0:null===(g=a.attributes)|| void 0===g?void 0:g.available}),(0,x.jsx)("div",{className:"Table__td",children:(0,x.jsx)("img",{className:"Table__td__img",src:null!=a&&null!==(h=a.attributes)&& void 0!==h&&h.img_url?null==a?void 0:null===(i=a.attributes)|| void 0===i?void 0:i.img_url:"/images/InputFile.svg"})})]},b)})]}),(0,x.jsx)("div",{className:"ModalShopAdminShippingsNew__form__buttons",children:(0,x.jsx)("button",{className:"Button",children:D("pages.shopAdmin.shippings.new.modal.submit")})})]})]})})]})]})}},64145:function(a,b,c){(window.__NEXT_P=window.__NEXT_P||[]).push(["/shop-admin/shippings/new",function(){return c(19957)}])},77191:function(a,b,c){"use strict";function d(a){if(null==a)throw new TypeError("Cannot destructure undefined")}c.d(b,{Z:function(){return d}})}},function(a){a.O(0,[9774,2888,179],function(){return a(a.s=64145)}),_N_E=a.O()}])

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.