1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[324],{54329:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/discount-tokens/[[...tokenId]]",function(){return n(7858)}])},7858:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=n(98788),i=n(87394),a=n(5163),o=n(52322),l=n(2784),c=n(77524),s=n(57628),d=n(84513),u=n(12532),f=n(61019),p=n(5632),g=function(){var e,t=(0,i.Z)((0,u.$)("translation"),1)[0],n=[{title:"Id",field:"id"},{title:"Token",field:"token"},{title:"ApplicationId",field:"applicationId"},{title:"ProductId",field:"productId"},{title:"AdvocateCustomerId",field:"advocateCustomerId"},{title:"referralUrl",field:"referralUrl"},{title:t("order.tableHeaders.createdUtc"),field:"creationDateUtc",render:function(e){var t=e.creationDateUtc;return"string"===typeof t?(0,d.WU)(new Date(t),"yyyy-MM-dd"):t},defaultSort:"desc"}],g=(0,i.Z)((0,s.Z)({auth:!0,endpoint:"https://referral.medibas.se/api"}),2),m=g[0],h=g[1],v=(0,f.V)().navigate,x=(0,i.Z)(l.useState([]),2),Z=x[0],j=x[1],b=(0,p.useRouter)();return l.useEffect((function(){(0,r.Z)((function(){var e,t;return(0,a.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,m({path:"discounttoken"})];case 1:return e=n.sent(),j(e),[3,3];case 2:return t=n.sent(),v(t),[3,3];case 3:return[2]}}
1))}))()}),[m,v]),(0,o.jsx)(c.Z,{columns:n,data:Z,loading:h,openedItemId:null===(e=b.query.tokenId)||void 0===e?void 0:e[0],title:t("discountTokens"),type:"discount-token"})};g.auth="admin";var m=g},77524:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(70865),i=n(87394),a=n(52322),o=n(2784),l=n(28336),c=n.n(l),s=n(35423),d=n(36350),u=n(8629),f=n(79249),p=n(38724),g=n(60905),m=n(86619),h=n(49429),v=n(77277);var x=n(5632),Z=function(e){var t=e.type,n=e.item,o=(0,i.Z)((0,d.$)("translation"),1)[0],l=(0,x.useRouter)();if(!n||!n.config)return null;var c=(0,r.Z)({},n);delete c.tableData,c.config=c.config.general.name,c.product=c.product.name;var s=Object.entries(c),Z=function(){return l.push("/admin/".concat(t,"s"))};return(0,a.jsxs)(u.Z,{fullWidth:!0,maxWidth:"lg",onClose:Z,open:!0,children:[(0,a.jsx)(f.Z,{onClose:Z,children:o("".concat(t,".details"))}),(0,a.jsx)(p.Z,{children:(0,a.jsx)(g.Z,{container:!0,item:!0,spacing:2,wrap:"wrap",children:s.map((function(e){var t,n=(0,i.Z)(e,2),r=n[0],o=n[1];return"boolean"===typeof o&&(o=o.toString()),(0,a.jsx)(g.Z,{item:!0,xs:4,children:(0,a.jsx)(m.Z,{disabled:!0,fullWidth:!0,label:(t=r,"string"!==typeof t?"":t.charAt(0).toUpperCase()+t.slice(1)),margin:"normal",value:o||""})},r)}))})}),(0,a.jsx)(h.Z,{children:(0,a.jsx)(v.Z,{onClick:Z,children:o("close")})})]})},j=n(79692),b=n(61837),y=n(61564),I=n(12817),k=n(17115),w=n(47842),C=n(96670),_=n(98069),N=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t>15&&(t=15);var n=e.reduce((function(e,t){var n=t.field;return(0,C.Z)((0,r.Z)({},e),(0,w.Z)({},n,(0,a.jsx)(_.Z,{})))}),{});return Array.from({length:t}).map((function(){return(0,r.Z)({},n)}))},T=n(45058),D=(0,j.Z)((function(e){return{toolbar:{display:"grid",gridTemplateColumns:"1fr 3rem 6rem",gridGap:"2rem",alignItems:"baseline"},toolbarFiltering:{justifyItems:"center"},datePicker:{marginRight:e.spacing(2)},root:{padding:"".concat(e.spacing(2),"px ").concat(e.spacing(1),"px")}}})),E=function(e){var t=e.selectedDate,n=e.setSelectedDate,u=e.type,f=e.title,p=e.columns,g=e.data,m=e.loading,h=e.openedItemComponent,v=e.openedItemId,j=e.loadingRows,w=e.pageSize,C=void 0===w?20:w;(0,o.useEffect)((function(){if(!m&&g.length){var e=g.length>C?C:g.length;(0,T.k)("".concat(u,".list"),e)}}),[m,g.length,u,C]);var _=(0,T.I)("".concat(u,".list")),E=N(p,_);m&&(g=j||E);var M=(0,i.Z)((0,d.$)("translation"),1)[0],S=D(),U=(0,x.useRouter)(),R=(0,o.useState)(!1),A=R[0],P=R[1],W=function(){return P((function(e){return!e}))};return(0,a.jsxs)("div",{className:S.root,children:[h?null:(0,a.jsx)(Z,{item:g.find((function(e){return e.id===v})),type:u}),h&&v?(0,a.jsx)(h,{id:v}):(0,a.jsx)(c(),{columns:p,components:{Toolbar:function(e){return(0,a.jsxs)("div",{className:S.toolbar,children:[(0,a.jsx)(l.MTableToolbar,(0,r.Z)({},e)),(0,a.jsx)("div",{className:S.toolbarFiltering,children:(0,a.jsx)(b.Z,{"aria-label":"open drawer",onClick:W,children:(0,a.jsx)(s.G6,{})})}),(0,a.jsx)(y.M,{utils:k.Z,children:(0,a.jsx)(I.M,{className:S.datePicker,disableFuture:!0,format:"yyyy-MM-dd",onChange:n,value:t,variant:"inline"})})]})}},data:g,icons:s.gw,onRowClick:function(e,t){var n=t.path||t.id||t.general.path||t.general.id;!e.target.attributes.getNamedItem("href")&&U.push("/admin/".concat(u,"s/").concat(n))},options:{pageSize:C,actionsColumnIndex:-1,filtering:A,grouping:!0,exportButton:!0,exportAllData:!0},title:null!==f&&void 0!==f?f:M("".concat(u,".list"))})]})}}},function(e){e.O(0,[70,139,790,30,845,441,374,774,888,179],(function(){return t=54329,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.