PageSourceSearch

https://cabinet.gdeprofit.ru/_next/static/chunks/pages/accessibleproducts-c321cacb25846dac.js

js gdeprofit.ru collected 2026-10-07 15:39:51 UTC 10,546 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3522],{29387:function(t){var e,n;t.exports=(e={year:0,month:1,day:2,hour:3,minute:4,second:5},n={},function(t,r,i){var s,o=function(t,e,r){void 0===r&&(r={});var i,s,o,a,u=new Date(t);return(void 0===(i=r)&&(i={}),(a=n[o=e+"|"+(s=i.timeZoneName||"short")])||(a=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:s}),n[o]=a),a).formatToParts(u)},a=function(t,n){for(var r=o(t,n),s=[],a=0;a<r.length;a+=1){var u=r[a],c=u.type,l=u.value,d=e[c];d>=0&&(s[d]=parseInt(l,10))}var f=s[3],h=s[0]+"-"+s[1]+"-"+s[2]+" "+(24===f?0:f)+":"+s[4]+":"+s[5]+":000",m=+t;return(i.utc(h).valueOf()-(m-=m%1e3))/6e4},u=r.prototype;u.tz=function(t,e){void 0===t&&(t=s);var n=this.utcOffset(),r=this.toDate(),o=r.toLocaleString("en-US",{timeZone:t}),a=Math.round((r-new Date(o))/1e3/60),u=i(o).$set("millisecond",this.$ms).utcOffset(-(15*Math.round(r.getTimezoneOffset()/15))-a,!0);if(e){var c=u.utcOffset();u=u.add(n-c,"minute")}return u.$x.$timezone=t,u},u.offsetName=function(t){var e=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return n&&n.value};var c=u.startOf;u.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return c.call(this,t,e);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return c.call(n,t,e).tz(this.$x.$timezone,!0)},i.tz=function(t,e,n){var r=n&&e,o=n||e||s,u=a(+i(),o);if("string"!=typeof t)return i(t).tz(o);var c=function(t,e,n){var r=t-60*e*1e3,i=a(r,n);if(e===i)return[r,e];var s=a(r-=60*(i-e)*1e3,n);return i===s?[r,i]:[t-60*Math.min(i,s)*1e3,Math.max(i,s)]}(i.utc(t,r).valueOf(),u,o),l=c[0],d=c[1],f=i(l).utcOffset(d);return f.$x.$timezone=o,f},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(t){s=t}})},70178:function(t){var e,n,r;t.exports=(e="minute",n=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(t,i,s){var o=i.prototype;s.utc=function(t){var e={date:t,utc:!0,args:arguments};return new i(e)},o.utc=function(t){var n=s(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var a=o.parse;o.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),a.call(this,t)};var u=o.init;o.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else u.call(this)};var c=o.utcOffset;o.utcOffset=function(t,i){var s=this.$utils().u;if(s(t))return this.$u?0:s(this.$offset)?c.call(this):this.$offset;if("string"==typeof t&&null===(t=function(t){void 0===t&&(t="");var e=t.match(n);if(!e)return null;var i=(""+e[0]).match(r)||["-",0,0],s=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===s?o:-o}(t)))return this;var o=16>=Math.abs(t)?60*t:t,a=this;if(i)return a.$offset=o,a.$u=0===t,a;if(0!==t){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(o+u,e)).$offset=o,a.$x.$localOffset=u}else a=this.utc();return a};var l=o.format;o.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,e)},o.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(t){return"s"===t&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=o.diff;o.diff=function(t,e,n){if(t&&this.$u===t.$u)return f.call(this,t,e,n);var r=this.local(),i=s(t).local();return f.call(r,i,e,n)}})},6833:function(t){t.exports=function(t,e){e.prototype.weekday=function(t){var e=this.$locale().weekStart||0,n=this.$W,r=(n<e?n+7:n)-e;return this.$utils().u(t)?r:this.subtract(r,"day").add(t,"day")}}},75304:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/accessibleproducts",function(){return n(69158)}])},40525:function(t,e,n){"use strict";var r=n(85893),i=n(87357),s=n(46901);e.Z=t=>(console.error(t.errors),(0,r.jsx)(i.Z,{children:t.errors.map((t,e)=>(0,r.jsx)(s.Z,{severity:"error",children:t.message||"Ошибка"},e))}))},87328:function(t,e,n){"use strict";var r=n(27484),i=n.n(r),s=n(29387),o=n.n(s),a=n(70178),u=n.n(a),c=n(6833),l=n.n(c);n(70600),i().extend(l()),i().extend(u()),i().extend(o()),i().locale("ru"),e.Z=i()},47397:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(37887),i=n(47705);
1let s=(0,i.BX)("\n  query GetWbAccounts {\n    wbAccounts {\n      id\n      name\n      defectiveRate\n      storagePrice\n      tax\n      additionalExpensePercent\n    }\n  }");(0,i.BX)("\n  query GetWbAccountsWithToken {\n    wbAccounts {\n      id\n      name\n      statisticsToken\n      loadingData\n      dataUpdatedAt\n      errors\n    }\n  }\n");var o=()=>{let{loading:t,error:e,data:n}=(0,r.a)(s);return{loading:t,error:e,wbAccounts:(null==n?void 0:n.wbAccounts)||void 0}}},54981:function(t,e,n){"use strict";var r=n(85893),i=n(87357),s=n(23795),o=n(34386),a=n(67294),u=n(25675),c=n.n(u);e.Z=(0,a.memo)(t=>{let{img:e,alt:n}=t;return e?(0,r.jsx)(i.Z,{sx:{position:"relative",width:"100%",height:"100%"},children:(0,r.jsx)(s.Z,{href:e,target:"_blank",rel:"noreferrer",tabIndex:-1,children:(0,r.jsx)(o.Z,{title:(0,r.jsx)(i.Z,{sx:{position:"relative",width:240,height:300},children:(0,r.jsx)(c(),{src:e,style:{objectFit:"cover"},fill:!0,alt:n||"Изображение Товара",sizes:"100%, 100%"})}),arrow:!0,placement:"right",children:(0,r.jsx)(c(),{src:e,fill:!0,alt:n||"Изображение Товара",style:{objectFit:"contain"},sizes:"100%, 100%"})})})}):(0,r.jsx)(r.Fragment,{})})},69158:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return N}});var r=n(82729),i=n(85893),s=n(68806),o=n(37887),a=n(87357),u=n(11163),c=n(40525),l=n(15861),d=n(62173),f=n(90674),h=n(87328),m=n(54981),b=n(67294),v=n(50319),g=n(34386),p=n(72852),$=n(32845),w=n(47705);let x=(0,w.BX)("\n  mutation SaveWbAccessibleProductMutation($wbAccessibleProduct: WbAccessibleProductInput!) {\n    updateWbProductAccess(wbAccessibleProduct: $wbAccessibleProduct) {\n      wbAccountId\n      nmId\n      isAccessible\n    }\n  }");var A=t=>{let[e,n]=b.useState(t.row.accessible),[r]=(0,v.D)(x),s=(0,$.l)();return(0,i.jsx)(g.Z,{title:e?"Видит":"Не видит",placement:"left",children:(0,i.jsx)(p.Z,{checked:e,onChange:()=>{let i={userId:t.row.userId,wbAccountId:t.row.wbAccountId,nmId:t.row.nmId,isAccessible:!e};r({variables:{wbAccessibleProduct:i}}).catch(console.error).then(e=>{if(!e||!e.data){console.error("Ошибка при сохранении wbAccessibleProduct");return}n(e.data.updateWbProductAccess.isAccessible),s.current.updateRows([{...t.row,accessible:e.data.updateWbProductAccess.isAccessible}])})}})})};let D=[{field:"accessible",headerName:"Видит?",width:70,renderCell:t=>{let{row:e}=t;return Object.hasOwn(e,"accessible")?(0,i.jsx)(A,{row:e}):(0,i.jsx)(i.Fragment,{})}},{field:"img",headerName:"Фото",description:"Фото",width:50,filterable:!1,sortable:!1,groupable:!1,hideable:!1,disableExport:!0,renderCell:t=>{let{value:e}=t;return e?(0,i.jsx)(m.Z,{img:e}):""}},{field:"nmId",headerName:"SKU",description:"SKU",groupable:!1,width:100},{field:"name",headerName:"Название",description:"Название товара",groupable:!1,width:250},{field:"wbAccountName",headerName:"Аккаунт WB",groupable:!0,width:250}];function I(){let t=(0,r._)(["\n  query getProducts($dateStart: String!) {\n    orderedArticles(dateStart: $dateStart) {\n      count\n      product {\n        id\n        nmId\n        img\n        supplierArticle\n        name\n        wbAccount {\n          id\n          name\n        }\n      }\n    }\n  }\n"]);return I=function(){return t},t}let Z=(0,s.Ps)(I()),j=(0,h.Z)().subtract(6,"month").format("YYYY-MM-DD");var O=t=>{let{loading:e,error:n,data:r}=(0,o.a)(Z,{variables:{dateStart:j}}),s=[];if(n&&s.push(n),s.length)return(0,i.jsx)(c.Z,{errors:s});if(!r)return(0,i.jsx)(i.Fragment,{});let u=function(t,e){console.log("processing data");let n=t.filter(t=>!!t.product),r=new Map(e.wbAccessibleProducts.map(t=>[t.nmId,t.isAccessible])),i=n.map(t=>{let n=t.product;return{id:"".concat(n.wbAccount.id,"-").concat(n.nmId),userId:e.id,accessible:r.get(n.nmId)||!1,nmId:n.nmId,img:n.img,name:n.name||n.supplierArticle||"noname",wbAccountId:n.wbAccount.id,wbAccountName:n.wbAccount.name||"Без названия"}});return i}(r.orderedArticles,t.user);return(0,i.jsxs)(a.Z,{children:[(0,i.jsxs)(l.Z,{variant:"h4",gutterBottom:!0,children:["Пользователь ",t.user.login," ",t.user.name]}),(0,i.jsx)(l.Z,{gutterBottom:!0,children:"Настройте какие товары Wildberries видит данный пользователь"}),(0,i.jsx)(a.Z,{sx:{height:"calc(100vh - 130px)",width:"100%"},children:(0,i.jsx)(d.K,{loading:e,rows:u,rowGroupingModel:["wbAccountName"],columns:D,experimentalFeatures:{columnGrouping:!1},localeText:{...f.n.components.MuiDataGrid.defaultProps.localeText,filterPanelRemoveAll:"Удалить все"},sortingOrder:["desc","asc"],hideFooter:!0,groupingColDef:{hideDescendantCount:!0,minWidth:200}})})]})},S=n(45023),y=n(47397),z=n(95395);function T(){let t=(0,r._)(["\n  query AuthorizedUser($authorizedUserId: Int!) {\n    authorizedUser(id: $authorizedUserId) {\n      id\n      login\n      name\n      role\n      wbAccessibleProducts {\n        id\n        wbAccountId\n        nmId\n        isAccessible\n      }\n    }\n  }\n"]);return T=function(){return t},t}let M=(0,s.Ps)(T()),P=()=>{let t=(0,u.useRouter)(),e=Number(t.query.id),n=[],{error:r,data:s}=(0,o.a)(M,{variables:{authorizedUserId:e}}),{error:l,wbAccounts:d}=(0,y.Z)();if(isNaN(e))return console.error(31337),(0,i.jsx)(c.Z,{errors:[{message:"За вами уже выехали"}]});if(r&&n.push(r),l&&n.push(l),n.length)return(0,i.jsx)(c.Z,{errors:n});if(!s||!d)return(0,i.jsx)(i.Fragment,{});let f=s.authorizedUser;return(0,i.jsx)(a.Z,{children:(0,i.jsx)(O,{user:f})})};P.authorize=[z.u.ADMIN],P.Layout=S.Z;var N=P}},function(t){t.O(0,[1962,4138,8584,6395,6692,34,2173,674,5023,7705,9774,2888,179],function(){return t(t.s=75304)}),_N_E=t.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.